1
votes

I implemented web service client by wsdl2java provided by apache cxf version 3.1.7. I cant attach the wsdl file coz it is too large. when i executing the client i got the error message like below.

Sep 07, 2016 9:38:27 AM org.apache.cxf.phase.PhaseInterceptorChain doDefaultLogging
WARNING: Interceptor for {http://service.business.tfs.kes.com}updateService#{http://service.business.tfs.kes.com}saveOrUpdateISINByPara has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Unexpected wrapper element {http://schemas.xmlsoap.org/soap/envelope/}Envelope found.   Expected {http://service.business.tfs.kes.com}saveOrUpdateISINByParaResponse.
    at org.apache.cxf.wsdl.interceptors.DocLiteralInInterceptor.handleMessage(DocLiteralInInterceptor.java:106)
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
    at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:798)
    at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1670)
    at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1551)
    at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1348)
    at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
    at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:651)
    at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
    at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:514)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:423)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:324)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:277)
    at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
    at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:139)
    at com.sun.proxy.$Proxy41.saveOrUpdateISINByPara(Unknown Source)
Disconnected from the target VM, address: '127.0.0.1:35342', transport: 'socket'
    at com.cal.common.webservice.UpdateServicePortType_UpdateServiceHttpEndpoint_Client.main(UpdateServicePortType_UpdateServiceHttpEndpoint_Client.java:73)

Exception in thread "main" javax.xml.ws.http.HTTPException
    at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:153)
    at com.sun.proxy.$Proxy41.saveOrUpdateISINByPara(Unknown Source)
    at com.cal.common.webservice.UpdateServicePortType_UpdateServiceHttpEndpoint_Client.main(UpdateServicePortType_UpdateServiceHttpEndpoint_Client.java:73)
Caused by: org.apache.cxf.interceptor.Fault: Unexpected wrapper element {http://schemas.xmlsoap.org/soap/envelope/}Envelope found.   Expected {http://service.business.tfs.kes.com}saveOrUpdateISINByParaResponse.
    at org.apache.cxf.wsdl.interceptors.DocLiteralInInterceptor.handleMessage(DocLiteralInInterceptor.java:106)
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
    at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:798)
    at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1670)
    at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1551)
    at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1348)
    at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
    at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:651)
    at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
    at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:514)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:423)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:324)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:277)
    at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
    at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:139)
    ... 2 more

im directly using the classes and the test classes which are generated from the apache cxf wsdl2java. i have no authority to change the remote web service.

when im searching i found below link but it is for servers. CXF 2.7.7 org.apache.cxf.interceptor.Fault: Unexpected element

can anyone help me on this?

1
Probably You need to check the SOAP Version. It looks like SOAP Version is 1.2. In the consumer client trying giving the soap version as 1.2. - Vijendra Kumar Kulhade
Actually what happened is the other way. client send soap wrapper but server not expected it. where i can change this. - Lasitha Benaragama
can you provide some detail about your soap client? - Vijendra Kumar Kulhade
This is cxf auto generated web service client code. - Lasitha Benaragama

1 Answers

0
votes

Your exception shows you service is expecting soap version 1.2.

Use this link to change soap version.