axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Meeraj Kunnumpurath" <mkunnumpur...@googlemail.com>
Subject Re: MTOM Support
Date Fri, 02 Nov 2007 18:08:43 GMT
Apologies, I sent this by mistake to the dev list. I will repost this
to the user list.

Meeraj

On 11/2/07, Meeraj Kunnumpurath <mkunnumpurath@googlemail.com> wrote:
> Hi,
>
> I have been looking at wiriting a client using AXIOM for sending
> binary attachments. The code is shown below,
>
>     public void testExchange() throws Exception {
>
>         DataHandler dataHandler = new DataHandler(new
> FileDataSource("Picture.jpg"));
>
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>
>         OMElement request = fac.createOMElement("data", null);
>
>         OMText binaryData = fac.createOMText(dataHandler, true);
>         binaryData.setOptimize(false);
>
>         request.addChild(binaryData);
>
>         OMElement method = fac.createOMElement("exchange", null);
>         method.addChild(request);
>
>         Options options = new Options();
>         options.setTo(new
> EndpointReference("http://localhost:8900/axis2/exchange"));
>         options.setProperty(Constants.Configuration.ENABLE_MTOM,
> Constants.VALUE_TRUE);
>
>         ServiceClient sender = new ServiceClient();
>         sender.setOptions(options);
>
>         sender.sendReceive(method);
>
>     }
>
> Unfortunately, the message is being sent to the server inlined without
> any mime parts. I have tried SWA instead of MTOM, but the same result.
> Any pointers would be highly appreciated. The message trace for
> request is shown below,
>
> <?xml version='1.0' encoding='utf-8'?>
> <soapenv:Envelope
>    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
>   <soapenv:Body>
>     <exchange>
>       <data>/9j/4RBZRXhpZgA.....38z/2Q==</data>
>     </exchange>
>   </soapenv:Body>
> </soapenv:Envelope>
>
> Kind regards
> Meeraj
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


Mime
View raw message