Hi Khaled,
SOAP attachements are not enabled by default. If you were do deploy a service like this :
the Image object would be returned to the client, depending on the SOAP style ( document or rpc ), as an BASE64 encoding right into the XML .
this would be the HTTP response headers :
and this would be the SOAP response:
<?xml version="1.0" ?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:retrievePictureResponse xmlns:ns2="http://service.ivan.com/">
<return xmlns="">iVBORwEWDx...</return>
</ns2:retrievePictureResponse>
</S:Body>
</S:Envelope>
However, if you would use the @MTOM annotation when deploying, like this:
Take note that MTOM is used as an optimization of transferring large amounts of data through soap.
The server would optimize binary transfers through SOAP, that is use the attachment part of the SOAP message to encode the Image:
HTTP response headers:
And this would be the WSDL generated by the appserver :
So to answer your question, yes in the case of MTOM, there are clear specifications in the WSDL ( wsp:Policy elements ) on how to encode large binary attachments into the SOAP message. For a weird reason I cannot get the SOAP attachment to work ( it's something related to my client JARs ), but you can see it in depth in Ivan Kriszan notes chapter 10.3.
And BTW , ALL binary transfers are Base64 encoded. There is no such thing as a Direct binary attachment.
PS all of this are based on what Ivan Kriszan has explained in his notes. This example is not mine.
Thanks,
Victor