Announcement Announcement Module
Collapse
No announcement yet.
Raw SOAP message Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Raw SOAP message

    Hello folks.

    I currently have a working web service consumer with marshalled classes and everything.

    I would like to give the user in addition the ability to post raw SOAP messages, that include file attachments.

    In other words, I want the user to provide the full SOAP message, all the way up to (and including) the SOAP envelope tags.

    First attempt was using WebServiceTemplate with SaajSoapMessageFactory, and using wstemplate.sendSourceAndReceiveToResult(...) to send my message. However, the factory adds the additional envelope, header, and body tags which I don't want (red).

    It becomes something like:
    <env>
    <header/>
    <body>


    <env>
    <header/>
    <body>
    my stuff
    </body>
    </env>

    </body>
    </env>



    Therefore, I decided to use DomPoxMessageFactory which takes the raw SOAP input as is. The problem is that I can't add attachments to the SOAP message because I can't cast WebServiceMessage to SoapMessage in the WebServiceMessageCallback method to add the attachment.

    Any help to solve this would be appreciated!

    (PS: I need to use WebServiceTemplate because I might add WS-Security features later on using interceptors, so that it applies to both normal mode and raw soap mode).

    Thank you.

    Chadi.
Working...
X