简体   繁体   中英

org.apache.cxf.interceptor.Fault: Unexpected element / WebSphere-Liberty Migration from WebSphere-7

The code that is working in WebSphere-7 is giving the following error in WebSphere Liberty:

        javax.xml.ws.soap.SOAPFaultException: Unexpected element {http://example.com/service/Quoting/v2}SubmitRateScenarioResponse found.
       Expected {http://example.com/esb/header/v3}ESBHeader.
            at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:156)

        Caused by: 
        org.apache.cxf.interceptor.Fault: Unexpected element {http://example.com/service/Quoting/v2}SubmitRateScenarioResponse found.   
Expected {http://example.com/esb/header/v3}ESBHeader.
            at org.apache.cxf.interceptor.DocLiteralInInterceptor.validatePart(DocLiteralInInterceptor.java:275)

Any help is appreciated.

So, the problem seems to be that the SOAP Message received by the Service contains unexpected content. The client is building a SOAP Message that is violating the contract between the Service and Client. Sorry, I can't give you a better answer without more information.

Understanding what the Service is expecting compared to what the client is sending is key, and finding that would be possible with some more work. To start, I would compare what the Soap Message looks like when sent by the client on v7 to what the client is sending on Liberty by using a tool like tcpmon or fiddler to capture the message.

Were both the client and service migrated to Liberty from WebSphere V7? If you migrated the Service, was it migrated as a binary or rebuilt from a WSDL? If it was rebuilt, comparing the original WSDL from v7 to the rebuilt WSDL might tell you something about how the Service's expectations have changed.

Go through below url . may be you will find your solution

i was getting same error when i tried to hit rest api using postman client .

http://camel.465427.n5.nabble.com/i-am-getting-exception-org-apache-cxf-interceptor-Fault-org-apache-camel-CamelContext-td5742012.html#a5742016

Root cause is - camel-core jar is missed . put jar file on server->lib or apache/lib

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM