Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SOAP AttachmentPart file corruption

Status
Not open for further replies.

sedj

Programmer
Aug 6, 2002
5,610
Hi,

I am having some difficulty in retrieving valid data from SOAPMessage attachments - the SOAPMessage arrives successfully, and the data is uncorrupted, but the AttachmentPart.getContent() method seems to add bytes into the recieved attachment - corrupting the file.

For example, a zip file when sent is 500kb, but when recieved is 1000kb.
All is fine for text, image and msword files, but the ByteArrayInputStream which is returned by a call to AttachmentPart.getContent() when the MIME type is application/zip (or pdf) seems to be adding bytes.

I know it is due to the AttachmentPart.getContent() call because if I write the SOAPMessage out to a file, and split the attachments manually, the data is fine.

Any ideas why ?

Cheers

Ben
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top