I am trying to pass a string as a attachment, but when I examine what is being sent it looks as if the string is being passed in the Body.
According to weblogic : Certain Java data types, if used as parameters or return values of a method that implements a Web Service operation, are automatically transported as SOAP Attachments (rather than elements in the SOAP body) when going over the wire.
As I understand it this means passing a parameter as a datahandler.
Here is my code snippet
String attachement = attach.getAttachments().toString(); StringDataSource sds = new StringDataSource(attachement,"String","Attachment");
DataHandler dh = new DataHandler(sds); Results res = new Results();
//The remote soap call. port.scanForViruses(dh);
I have created a DataHandler and am passing it as a parameter, as laid down in weblogic.
I have set up a sniffer, but not sure what I should be looking for to say it has been passed as a Attachement: Here is the sniffer output:
------ 10.101.193.171:11001->localhost:3669 ------ HTTP/1.1 200 OK Date: Thu, 08 Jun 2006 09:53:52 GMT Content-Length: 2338 Content-Type: text/xml Connection: Keep-Alive