That is correct. There are two files I had to apply changes to manually once the wizard generated all the appropriate files for the new web service:
1) The MyEJB.wsdl file had to be changed to change the return type as hexBinary and specify content type as application/pdf.
...
<element name="requestPDFResponse">
<complexType>
<sequence>
<element name="requestPDFReturn" nillable="true" type="xsd:hexBinary"/>
</sequence>
</complexType>
</element>
...
<mime:multipartRelated>
<mime
art>
<wsdlsoap:body use="literal"/>
</mime
art>
<mime
art>
<mime:content part="requestAttachmentReturn" type="application/pdf"/>
</mime
art>
</mime:multipartRelated>
2) I changed the MyEJB_mappings.xml file as well to reflect the return type which is now a byte[] as its class type and also to specify the return value which is the DataHandler. I actually tricked it a bit in order for WSAD to regenerate the mapping for me. Basically, once I manually changed the above wsdl file with the content type changes, I did a Web Service->Generate
Java Bean Skeleton. It is then recreated for me the mappings file.
...
<java-xml-type-mapping id="JavaXMLTypeMapping_1140546093755">
<class-type>byte[]</class-type>
<root-type-qname id="RootTypeQname_1140546093755">
<namespaceURI>
http://www.w3.org/2001/XMLSchema</namespaceURI>
<localpart>hexBinary</localpart>
</root-type-qname>
<qname-scope>simpleType</qname-scope>
</java-xml-type-mapping>
...
<method-return-value>javax.activation.DataHandler</method-return-value>
<wsdl-message id="WSDLMessage_1140546093755">
<namespaceURI>
http://myspace</namespaceURI>
<localpart>requestPDF</localpart>
</wsdl-message>
....
I can send you my full wsdl file, as well as the mappings file if you like to take a look at.
So, I am kind of stuck at this point... Also, I am curious, DataHandler object is obviously NOT serializable. So, I am not sure does that mean it can not be sent across and we need to write our own serializable wrappers for it but all the examples on the web that show the
SOAP attachment, just simply pass the DataHandler. So, I guess I am a bit confused at that part. Also, WSAD flags that fact as well...