Hello all,

I have written a SOAP client using Axis2 which receives a binary file in the response. The binary file is attached using MOTM XOP. When I use an http sniffer to look at the response everything looks good...the response contains an XOP:Include reference to the attached content. The attached content in this case is sent as binary but it's just an XML file which I can visually inspect.

However, when I print out the respsonse with the following code:

OMElement result = servClient.sendReceive(method);
System.out.println(result);

I get this body:

<soap:Body></soap:Envelope>
<PassExcelBinaryResponse xmlns="http://XXXXXXXX/soap/WebServices.asp";><PassExcelBinaryResult>PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJ5ZXMiPz4NCjxOZXdEYXRhU2V0Pg0KICA8eHM6c2NoZW1hIGlkPSJOZXdEYXRhU2V0IiB4bWxucz0iIiB4bWxuczp4cz0iaHR0cDovL3d3d........LOTS AND LOTS MORE

The size of the attached binary file is 900K. The size of the content in PassExcelBinaryResult is suspiciously around 30% larger...it looks like Axis2 (Axiom?) has encoded the attached file.

For reference here is my code to write the attached binary:

OMText binaryNode = (OMText)xmlElement.getFirstOMChild();
DataHandler dh = (DataHandler)binaryNode.getDataHandler();
FileOutputStream out = new FileOutputStream("../../test/data/temp.xml");
dh.writeTo(out);
out.close();

So my question: Is Axis2 encoding the binary attachment merely for display purposes? Or will it try to encode the binary attachment and then have to decode it when I write the file.

As mentioned using the above code is working however it is very slow..it is about 4x slower to read the attachment than an equivalent client written for .NET. This is what led me to start wondering why it was so slow and seeing that the content seemed to be encoded after I receive the response.

Thanks,

Derek

_________________________________________________________________
Find out the restaurants participating in Winterlicious http://local.live.com/default.aspx?v=2&cp=43.658648~-79.383962&style=r&lvl=15&tilt=-90&dir=0&alt=-1000&scene=3702663&cid=7ABE80D1746919B4!1329
From January 26 to February 8, 2007


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to