I have a Spring-WS web service where i would like to be able to send back binary data to the client. My intention is to format the SOAP response to either use MTOM or Soap with attachements. The response will be a JAXB object.
I have already setup the Spring-WS environment and can send and receive requests usign JAXB. I am however struggling to setup the Binary attachement response as most of the tutorials and information on the web are mostly related to Clients sending attachements whereas i am interested in Server sending attachements back to the client.
Two questions:
Which is the recommended approach for returning binary data to the client? SOAP with attachements, MTOM or just simply return the base64encoded data as an xml tag?
Are there any examples that shows how to configure Spring-WS to return Binary attachments using either of the two methods?