Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CXF 2.7.7 org.apache.cxf.interceptor.Fault: Unexpected element

I am experiencing an error I cannot understand since upgrading to CXF 2.7.7. When making a web service call CXF is reporting this exception:

org.apache.cxf.interceptor.Fault: 
Unexpected element {http://schema.myorg.com/GetReference/}ReferenceResponse found.
Expected {http://services.myorg.com/}getReferences

This makes no sense, because ReferenceResponse is exactly the response I expect. The name getReferences appears to refer to the name of the @WebMethod annotated method that is being called. The return type of this method is ReferenceResponse.

What am I missing?

like image 974
rjsang Avatar asked Oct 22 '13 03:10

rjsang


1 Answers

I never found a truly satisfactory answer to this, but, it was solved when I replaced the existing client interface with one generated by wsdl2cxf. This also involved migrating from Xbeans to JAXB for marshaling, which may have had something to do with it.

However, in the interim adding the following annotation to the interface prevented the error.

@EndpointProperty(key = "soap.no.validate.parts", value = "true")
like image 129
rjsang Avatar answered Sep 30 '22 13:09

rjsang