Java Web Service Soap fault exception client -
i trying web service client in java using eclipse , error:
exception in thread "main" javax.xml.ws.soap.soapfaultexception: message part not recognized. (does exist in service wsdl?) @ org.apache.cxf.jaxws.jaxwsclientproxy.invoke(jaxwsclientproxy.java:158) @ com.sun.proxy.$proxy26.req(unknown source) @ com.caller.main(caller.java:31) caused by: org.apache.cxf.binding.soap.soapfault: message part not recognized. (does exist in service wsdl?) @ org.apache.cxf.binding.soap.interceptor.soap11faultininterceptor.unmarshalfault(soap11faultininterceptor.java:84) @ org.apache.cxf.binding.soap.interceptor.soap11faultininterceptor.handlemessage(soap11faultininterceptor.java:51) @ org.apache.cxf.binding.soap.interceptor.soap11faultininterceptor.handlemessage(soap11faultininterceptor.java:40) @ org.apache.cxf.phase.phaseinterceptorchain.dointercept(phaseinterceptorchain.java:272) @ org.apache.cxf.interceptor.abstractfaultchaininitiatorobserver.onmessage(abstractfaultchaininitiatorobserver.java:113) @ org.apache.cxf.binding.soap.interceptor.checkfaultinterceptor.handlemessage(checkfaultinterceptor.java:69) @ org.apache.cxf.binding.soap.interceptor.checkfaultinterceptor.handlemessage(checkfaultinterceptor.java:34) @ org.apache.cxf.phase.phaseinterceptorchain.dointercept(phaseinterceptorchain.java:272) @ org.apache.cxf.endpoint.clientimpl.onmessage(clientimpl.java:849) @ org.apache.cxf.transport.http.httpconduit$wrappedoutputstream.handleresponseinternal(httpconduit.java:1626) @ org.apache.cxf.transport.http.httpconduit$wrappedoutputstream.handleresponse(httpconduit.java:1515) @ org.apache.cxf.transport.http.httpconduit$wrappedoutputstream.close(httpconduit.java:1318) @ org.apache.cxf.transport.abstractconduit.close(abstractconduit.java:56) @ org.apache.cxf.transport.http.httpconduit.close(httpconduit.java:632) @ org.apache.cxf.interceptor.messagesenderinterceptor$messagesenderendinginterceptor.handlemessage(messagesenderinterceptor.java:62) @ org.apache.cxf.phase.phaseinterceptorchain.dointercept(phaseinterceptorchain.java:272) @ org.apache.cxf.endpoint.clientimpl.doinvoke(clientimpl.java:572) @ org.apache.cxf.endpoint.clientimpl.invoke(clientimpl.java:481) @ org.apache.cxf.endpoint.clientimpl.invoke(clientimpl.java:382) @ org.apache.cxf.endpoint.clientimpl.invoke(clientimpl.java:335) @ org.apache.cxf.frontend.clientproxy.invokesync(clientproxy.java:96) @ org.apache.cxf.jaxws.jaxwsclientproxy.invoke(jaxwsclientproxy.java:136) ... 2 more
wsdl
<?xml version="1.0" encoding="utf-8" ?> - <wsdl:definitions name="test" targetnamespace="http://com/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://com/" xmlns:xsd="http://www.w3.org/2001/xmlschema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"> - <wsdl:types> - <schema xmlns="http://www.w3.org/2001/xmlschema"> <import namespace="http://com/" schemalocation="test_schema1.xsd" /> </schema> </wsdl:types> - <wsdl:message name="get"> <wsdl:part name="parameters" element="tns:get" /> </wsdl:message> - <wsdl:message name="getresponse"> <wsdl:part name="parameters" element="tns:getresponse" /> </wsdl:message> - <wsdl:porttype name="testporttype"> - <wsdl:operation name="get"> <wsdl:input name="get" message="tns:get" /> <wsdl:output name="getresponse" message="tns:getresponse" /> </wsdl:operation> </wsdl:porttype> - <wsdl:binding name="testsoapbinding" type="tns:testporttype"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> - <wsdl:operation name="get"> <soap:operation soapaction="" style="document" /> - <wsdl:input name="get"> <soap:body use="literal" /> </wsdl:input> - <wsdl:output name="getresponse"> <soap:body use="literal" /> </wsdl:output> </wsdl:operation> </wsdl:binding> - <wsdl:service name="test"> - <wsdl:port name="testport" binding="tns:testsoapbinding"> <soap:address location="http://localhost:8080/testwebserv/services/testport" /> </wsdl:port> </wsdl:service> </wsdl:definitions>
i deleted project posted question , created new project same method name changed can me?
i found out problem after lot of tweaking,the problem in package.info. older package.info goes this
@javax.xml.bind.annotation.xmlschema(namespace = "your_namespace", elementformdefault = javax.xml.bind.annotation.xmlnsform.qualified)
i removed elementformdefault
, working perfectly.but can tell me real reason because new technology...
Comments
Post a Comment