I have a problem in sending messge with attachments using sendSourceAndReceiveToResult() method of the webservicetemplate class.
I'm able to send in the message with attachment using SAAJ client.
But I'm trying to send using Spring-WS client.
I'm able to attach a binary file to the input SoapMessage. SoapMessage is created by casting the WebServiceMessage which is again created using messageFactory. I have tried customizing echo client for this.
But when i try to send the message as source using sendSourceAndReceiveToResult() it doesn't send in the attachment. It just send the plain SOAP message.
Here is a code snippet
SoapMessage inputMessage = (SoapMessage)getMessageFactory().createWebServiceM essage(request.getInputStream());
Attachment attachment = inputMessage.addAttachment(...,...)
getWebServiceTemplate().sendSourceAndReceiveToResu lt(inputMessage.getPayloadSource(), result);
is this the right way to do?