I don't have a handler on the client side, only on the server side.
If I get rid of the handler on the server side, I get the exact same
behavior, the data is inlined in the SOAPBody. How do I get the
behavior shown here
http://java.sun.com/webservices/docs/2.0/jaxws/mtom-swaref.html in 2.4
MTOM Samples? The output I'm expecting would look more like this:
Content-Type: Multipart/Related; start-info="text/xml";
type="application/xop+xml";
boundary="----=_Part_0_1744155.1118953559416"
Content-Length: 3453
SOAPAction: ""
------=_Part_1_4558657.1118953559446
Content-Type: application/xop+xml; type="text/xml"; charset=utf-8
<soapenv:Envelope
xmlns:soapenv="
http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<Detail
xmlns="
http://example.org/mtom/data">
<Photo>RHVrZQ==</Photo>
<image>
<xop:Include
xmlns:xop="
http://www.w3.org/2004/08/xop/include"
href="cid:5aeaa450-17f0-4484-b845-a8480c363444_at_example.org">
</xop:Include>
</image>
</Detail>
</soapenv:Body>
</soapenv:Envelope>
------=_Part_1_4558657.1118953559446
Content-Type: image/jpeg
Content-ID: <5aeaa450-17f0-4484-b845-a8480c363444_at_example.org>
<<binary data...>>
-----Original Message-----
From: Vivek.Pandey_at_Sun.COM [mailto:Vivek.Pandey_at_Sun.COM]
Sent: Thursday, April 19, 2007 5:01 PM
To: users_at_jax-ws.dev.java.net
Subject: Re: MTOM inlining large amounts of data
Do you have handler on the client side? When you have MTOM enabled and
there is Handler, sine the Message is converted in to SOAPMessage and
the binary data is anyway inlined in to the SOAPMessage we dont again
covert them back to the attachments. This defeats the purpose of MTOM
optimization.
-vivek.
Fisher, Brice A wrote:
>
> I'm sending a file via a DataHandler using MTOM.
>
> I expected to see something like the SOAP message in the JAX-WS
> documentation for MTOM (SOAPBody contains an xop:Include statement
> referencing the binary data by content id), but my SOAP message has
> (massive amount of / 2MB of) binary data dropped into the SOAP
Envelope.
>
> Any ideas what I'm doing wrong?
>
> The WebService looks like this:
>
> @MTOM
> @WebService()
> @HandlerChain( file="handlers.xml")
> *public** class* GSWebService2 {
> @WebMethod()
> * public* String putStreamingFileMTOM(@XmlMimeType("*/*")DataHandler
> dh, String filename) {}
> }
>
>
> The xsd includes this:
>
> <xs:complexType name="putStreamingFileMTOM"> <xs:sequence> <xs:element
> name="arg0" ns1:expectedContentTypes="*/*"
> type="xs:base64Binary" minOccurs="0"/> <xs:element name="arg1"
> type="xs:string" minOccurs="0"/> </xs:sequence> </xs:complexType>
>
> My stub function looks like this:
>
> @WebMethod
> @WebResult(targetNamespace = "")
> @RequestWrapper(localName = "putStreamingFileMTOM", targetNamespace =
> "_http://GroupService.company.com/_
> <http://GroupService.company.com/>", className =
> "com.company.groupservice.PutStreamingFileMTOM")
>
> @ResponseWrapper(localName = "putStreamingFileMTOMResponse",
> targetNamespace = "_http://GroupService.company.com/_
> <http://GroupService.company.com/>", className =
> "com.company.groupservice.PutStreamingFileMTOMResponse")
>
> * public* String putStreamingFileMTOM( @WebParam(name = "arg0",
> targetNamespace = "") DataHandler arg0, @WebParam(name = "arg1",
> targetNamespace = "") String arg1);
>
> I'm creating my service port like so (zero to force MTOM to use
> attachments, same result without it):
>
> GSWebService2 proxy = service.getGSWebService2Port(*new*
> MTOMFeature(0));
>
> I'm making my call like so:
>
> String res =
> proxy.putStreamingFileMTOM(/getDataHandler/("bafishe_www.zip"),"bafish
> e_www.zip");
>
>
> The HTTP content looks like this (I snipped it off after a bit of
> encoded binary data, I've never been patient enough with my logging
> tools to get to arg1):
>
> POST /Java6WS/GSWebService2 HTTP/1.1
> SOAPAction: ""
> Accept: text/xml, multipart/related, text/html, image/gif, image/jpeg,
> *; q=.2, */*; q=.2
> Content-Type:
>
multipart/related;type="application/xop+xml";boundary="uuid:8d3575b3-6e6
a-4b58-9365-037a1ef55c75";start-info="text/xml"
>
> User-Agent: Java/1.6.0
> Host: localhost:8081
> Connection: keep-alive
> Transfer-Encoding: chunked
>
> ffb
> --uuid:8d3575b3-6e6a-4b58-9365-037a1ef55c75
> Content-Type: application/xop+xml;charset=utf-8;type="text/xml"
> Content-Transfer-Encoding: binary
>
> <?xml version="1.0" ?><S:Envelope
> xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Body><ns2:putSt
> reamingFileMTOM
> xmlns:ns2="http://GroupService.company.com/"><arg0>UEsDBAoAAAAAAERROC4
> AAAAAAAAAAAAAAAAEABUAd3d3L1VUCQADb3MxPncG2kRVeAQAhlD0AVBLAwQKAAAAAAASX
> ZQtAAAAAAAAAAAAAAAACAAVAHd3dy9DVlMvVVQJAAMkZAM+dgbaRFV4BACGUPQBUEsDBAo
> AAAAAAKWCky1...
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jax-ws.dev.java.net
For additional commands, e-mail: users-help_at_jax-ws.dev.java.net