Hi,

Currently the Camel spring-ws producer doesn't contain any logic to extract
attachments from response messages. It just returns the resulting XML for
further processing in your Camel route [1]. The Camel spring-ws producer
uses a simple SourceExtractor (NoopSourceExtractor) to return the XML
response as a Camel message body.

You can try replacing this SourceExtractor with a
WebServiceMessageExtractor that is capable of handeling attachments. The
code in this sample [2] shows such an extractor (starting at line 128).
This requires some modifications to the current Camel spring-ws
producer. Consider filing a JIRA if you need this functionality or better
yet, contribute a patch [3]. Patches are greatly appreciated.

Regards,
Richard

[1] One can optionally leverage JAXB, Jibx, etc for this purpose. See
http://camel.apache.org/data-format.html
[2]
https://fisheye.springsource.org/browse/spring-ws/trunk/samples/mtom/client/spring-ws/src/org/springframework/ws/samples/mtom/client/sws/AxiomMtomClient.java?r=1403#l128
[3] http://camel.apache.org/contributing.html

On Fri, Feb 24, 2012 at 5:30 PM, Jan Fredrik Wedén <[email protected]>wrote:

> Hi,
>
> This is my first shot at camel routing and I'm trying to use the Spring WS
> component to call a webservice and marshal the response. The problem is
> that this particular service returns the actual payload XML as an
> attachment and the SOAP body contains the response type element wrapping a
> single XML element with reference to the attachment cid. How should I go
> about in order to retrieve and later marshal this response?
>
> What I've done so far is this:
>
> I'm using Spring to set up my Camel context and configure
> a org.springframework.ws.client.core.WebServiceTemplate which uses
> a org.springframework.ws.soap.saaj.SaajSoapMessageFactory and
> a org.springframework.ws.transport.http.CommonsHttpMessageSender
>
> In my route definition I route a request to this endpoint using "spring-ws:
> https://the.remote.service?webServiceTemplate=#wsTemplate"; as the uri.
> Which seems to work just fine - I can even spot the attachment in the
> response if I have httpclient log the wire contents it receives.
>
> The problem is when I try to process the resulting Exchange in any way. At
> this point the in body just contains what was inside the SOAP body element
> and the attachment is nowhere to be found.
>
> --
> - Jan Fredrik Wedén
>

Reply via email to