When we switch from JAX-RPC to JAX-WS, I try to call a WebService that uses JAX-W / JAXB. The client itself still uses JAX-RPC. The WSDL file remains unchanged.
It works great, as long as there are no attachments. In applications, this does not work. The client says that they are not there. Although they are visible in the SOAP message.
As I understand this problem, JAX-WS uses MTOM to place binary data in the message, and JAX-RPC uses MIME.
Is there any way to make this work?
Here's what the JAX-RPC message looks like:
HTTP/1.1 200 OK Date: Tue, 21 Dec 2010 15:24:10 GMT Transfer-Encoding: chunked Content-Type: multipart/related;boundary="----=_Part_6_5206227.1292945050584";type="text/xml";start="<soapPart>" SOAPAction: "http://XXX" X-Powered-By: Servlet/2.5 JSP/2.1 014a ------=_Part_6_5206227.1292945050584 Content-Type: text/xml; charset=utf-8 Content-Transfer-Encoding: 8bit Content-ID: <soapPart> <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Header/><env:Body><operationWithAttachments href="cid:operationWithAttachments"/></env:Body></env:Envelope> 0522 ------=_Part_6_5206227.1292945050584 Content-Type: multipart/mixed; boundary="----=_Part_5_12763436.1292945050570" Content-ID: <operationWithAttachments> ------=_Part_5_12763436.1292945050570 Content-Type: application/pdf; name=HelloWorld.pdf Content-Disposition: attachment; filename=HelloWorld.pdf %PDF-1.4 %öäüß 1 0 obj << /Type /Catalog /Version /1.4 /Pages 2 0 R >> endobj 2 0 obj << ...
And here is the new JAX-WS post:
HTTP/1.1 200 OK Date: Tue, 21 Dec 2010 15:23:02 GMT Transfer-Encoding: chunked Content-Type: multipart/related;start="<rootpart* 07499eba-7835-4fe0-bb07-a04801504fb5@example.jaxws.sun.com >";type="application/xop+xml";boundary="uuid:07499eba-7835-4fe0-bb07-a04801504fb5";start-info="text/xml" X-Powered-By: Servlet/2.5 JSP/2.1 02ba --uuid:07499eba-7835-4fe0-bb07-a04801504fb5 Content-Id: <rootpart* 07499eba-7835-4fe0-bb07-a04801504fb5@example.jaxws.sun.com > Content-Type: application/xop+xml;charset=utf-8;type="text/xml" Content-Transfer-Encoding: binary <?xml version='1.0' encoding='UTF-8'?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Body><ns6:operationWithAttachments xmlns:ns6="XX" xmlns:ns5="XX" xmlns:ns4="XX" xmlns:ns3="XX" xmlns:ns2="XX" xmlns="XX"> 00ba <Include xmlns="http://www.w3.org/2004/08/xop/include" href="cid: 9832a057-f692-4f48-ac7d-4dbd7ce76a74@example.jaxws.sun.com "/></ns6:operationWithAttachments></S:Body></S:Envelope> 0562 --uuid:07499eba-7835-4fe0-bb07-a04801504fb5 Content-Id: < 9832a057-f692-4f48-ac7d-4dbd7ce76a74@example.jaxws.sun.com > Content-Type: multipart/mixed; boundary="----=_Part_4_6279014.1292944982388" Content-Transfer-Encoding: binary ------=_Part_4_6279014.1292944982388 Content-Type: application/pdf; name=HelloWorld.pdf Content-Disposition: attachment; filename=HelloWorld.pdf %PDF-1.4 %öäüß 1 0 obj << /Type /Catalog /Version /1.4 /Pages 2 0 R >> endobj 2 0 obj << ...
(I deleted the namespaces myself, so this is not a problem)
The idea is to make them be the same.
Has anyone ever done this?
Many thanks for your help
Michael
source share