Hi all, I tried sending a SOAP message to a http servlet with an attachment consisting of binary data (a byte array of non-printables) but I was unsuccessful.
I attach the data like this:
BinaryDataSource bds = new BinaryDataSource(new ByteArrayInputStream(bytes)); DataHandler dh = new DataHandler(bds); AttachmentPart attach = soapMsg.createAttachmentPart(dh); attach.setContentId("data"); soapMsg.addAttachmentPart(attach);
where BinaryDataSource is my own simple implementation of DataSource. When I send the SOAP message, some data appears to be there (it is non-printable data so I only get a few letters here and there) but once the servlet catches the SOAP message, the data is gone.
Any idea on how to transmit or recover that data? Other ways of transmitting binary data with SOAP are also welcome although I am using HUGE files so encoding is not an option. TIA -matt