Hi,
I am using an abstraction over HTTPClient i.e. Camel-Http component to
communicate with a remote Webservice.
The remote Webservice handles attachments without using MTOM.
I called a method on the Webservice which returns an inline base64
encoded attachment with it.
As the remote Webservice is unaware of the length of the attachment, it
sends it in chunked form
The response with chunked data looks like this in TCPMon.
2000
<?xml version="1.0" ?><S:Envelope
xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Body><ns2:GetFile
Response
xmlns:ns2="http://www.example.org/Danger/"><xmlPayload>LlJNRgAAABIAAQAAA
AAAAAAGUFJPUAAAADIAAAAAUMAAA
AAAAAAAAAAQbG9naWNhbC1maWxlaW5mbwAAAj8AAAI/AAAAAAAAAAsAAAAaAAAJSW5kZXhhY
mxlAAAAAAAEAAAAAQA
:
:
:
2000
UKLJli8cAss/98U+OllJQfyuNI7/qg6b2gzlQ4GKDNv0iBMnUFGD/nVAqQWklZ0W956TkEUT
bQKYf/aCS9J6VDPppbVDrRmKz4P3pima
:
:
:
AAAAAAAAABAAAAAA==</xmlPayload></ns2:GetFileResponse></S:Body></S:Envelo
pe>
0
At the client side, I am using axiom's StAXSOAPModelBuilder to build a
SOAP structure.
The StaxSOAPModelBuilder only returns the first chunk when I retrieved
the attachment using following code.
DataHandler dataHandler = null;
OMText omText = null;
omText = (OMText) omElement.getFirstOMChild();
omText.setBinary(true);
dataHandler = (DataHandler) omText.getDataHandler();
As per my understanding the white space after the chunk de-limiters
could be a reason for getting the first chunk only.
Please suggest how to get the whole attachment when the response is sent
as chunked by the remote Webservice.
Thanks,
--------
anirban
|