Results 1 to 3 of 3

Thread: Spring-WS Client - Input message with attachment

  1. #1
    Join Date
    Nov 2008
    Posts
    3

    Default Spring-WS Client - Input message with attachment

    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?

  2. #2
    Join Date
    Nov 2008
    Posts
    3

    Default

    Sorry if it sounded very basic. i've got it worked using WebServiceMessageCallback()

    Thank you!

  3. #3
    Join Date
    Mar 2008
    Posts
    11

    Default

    Hi vrsarav,

    Do you mind sharing your code for this?

    Thanks
    Phil

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •