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?
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")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With