Mule CXF Marshall Response

I use cxf: jaxws-client in Mule 3, and the response I get from my web service call is of type ReleaseasingInputStream. I tried adding http-response-to-message-transformer, but this throws an error. Does anyone know how I can get the response as an object and not a ReleaseingInputStream?

Thank you very much.

+4
source share
3 answers

To solve the problem, put <cxf-client> inside the <outbound-endpoint> section (NOT BEFORE THIS), changing the following code

  <cxf:jaxws-client clientClass="com.xyz.services.WSServices" port="WSServicesSoap" wsdlLocation="classpath:wsdl-file.wsdl" operation="GimmeDataOperation" /> <outbound-endpoint exchange-pattern="request-response" address="http://localhost:8083/OutboundService" /> 

which produces the output of ReleasingInputStream for

  <outbound-endpoint exchange-pattern="request-response" address="http://localhost:8083/OutboundService" > <cxf:jaxws-client clientClass="com.xyz.services.WSServices" port="WSServicesSoap" wsdlLocation="classpath:wsdl-file.wsdl" operation="GimmeDataOperation" /> </outbound-endpoint> 

which returns the expected object.

+3
source

I had the same problem. I solved this by adding an ObjectToString transformer to the response side of the outgoing endpoint, like this:

 <mule> <object-to-string-transformer name="ObjectToString"/> <flow> ... ... ... <cxf:jaxws-client clientClass="com.my.ClientClass" port="MyPort" wsdlLocation="classpath:MyWsdl.wsdl" operation="MyOperation" /> <outbound-endpoint address="http://some.address/path/to/service" exchange-pattern="request-response" responseTransformer-refs="ObjectToString" /> ... ... ... </flow> </mule> 
+1
source

The whole point of a jaxws client is to get an unmarshaled Java object, so getting a WS response as a String or ReleaseInputStream should not even be an option.

To make <cxf: jaxws-client> work, as you would expect the WS client to work - put INSIDE for the endpoint <outbound; you will get the correct Java object as a payload.

+1
source

All Articles