CXF JAXWS Client Returning Null

We’re using CXF to generate both our web service and client. For a certain method call, the web service was returning the correct XML (we used tcpmon to make sure of this), but the CXF client was returning null to our code, instead of the returned objects. Other web service methods were returning data correctly, however.

After some research we discovered a difference between the WSDLs for the two method calls. Here’s the correct one:

Note that the correct xsd:element has a name of “return,” but the incorrect one has a name of “User.” For some reason, the CXF client ignores returned data unless its name is “return”. When we switched “User” to “return,” it worked fine.

If any readers have details on why this is the case, or other light to shed on the issue, please comment. Thanks!

Post navigation

2 Responses to CXF JAXWS Client Returning Null

Thank you so much!
I’m using Spring to create a JaxWS client proxy from annotated Jaca interface and my method call returned null. After reading your post, I removed the @WebResult annotation from interface and bang, it worked!