1
votes

I'm trying to use the cxf:jaxws-client in conjunction with an http outbound endpoint to consume a web service using Mule 3.3. I have read a number of sources (e.g. Mule CXF Marshall Response) indicating if I want to receive the unmarshalled Java object returned by my operation, the cxf:jaxws-client element should be placed inside the outbound-endpoint, e.g. something like:

<http:outbound-endpoint host="localhost" port="9001" path="crmService?wsdl">
   <cxf:jaxws-client operation="getSomething" serviceClass="com.something.Service" />
</http:outbound-endpoint>

However, when I try this I get a schema error in Mule Studio stating "JAX-WS client is not allowed to be a child of element HTTP". If the above is not allowed, how do I get hold of the unmarshalled object returned by the operation?

1
Usually, cxf:jaxws-client is placed before the http:outbound-endpoint.David Dossot

1 Answers

2
votes

So the problem is that Studio does not support nested MP's inside of an endpoint. What you need to do is to place the jaxws-client before the outbound endpoint.

Because of the way CXF MP's works, it's going to process the following MP's and then return to the jaxws client where is going to unmarshall the response. Therefore, the payload after the outbound endpoint is going to be the soap message. To get the POJO you need to declare a sub-flow with the jaxws client and outbound endpoint. After the subflow executes, the main flow is going to get the POJO as you need.

We need to update the documentation so this behavior is clear.

HTH Eva