Cannot find child element: not using namespace ?
dust_puppy May 18, 2006 11:23 AMHi
i get javax.xml.rpc.JAXRPCException: Cannot find child element: getVersionReturn when i am calling an external webservice from AS 4.0.4.GA.
i have the folowing WSDL
<wsdl:message name="getVersionResponse"> <wsdl:part name="getVersionReturn" type="xsd:string"/> </wsdl:message>
<wsdl:operation name="getVersion"> <wsdl:input message="impl:getVersionRequest" name="getVersionRequest"/> <wsdl:output message="impl:getVersionResponse" name="getVersionResponse"/> </wsdl:operation>
<wsdl:operation name="getVersion"> <wsdlsoap:operation soapAction=""/> <wsdl:input name="getVersionRequest"> <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://netcom.no/xil/2003/09/location" use="encoded"/> </wsdl:input> <wsdl:output name="getVersionResponse"> <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://netcom.no/xil/2003/09/location" use="encoded"/> </wsdl:output> </wsdl:operation>
and i have used wstool to generate the jaxrpc maping
<service-endpoint-method-mapping> <java-method-name>getVersion</java-method-name> <wsdl-operation>getVersion</wsdl-operation> <wsdl-return-value-mapping> <method-return-value>java.lang.String</method-return-value> <wsdl-message xmlns:wsdlMsgNS='http://netcom.no/xil/2003/09/location'>wsdlMsgNS:Location_getVersionResponse</wsdl-message> <wsdl-message-part-name>result</wsdl-message-part-name> </wsdl-return-value-mapping> </service-endpoint-method-mapping>
i turnd on debuging and got the following output
17:09:58,232 DEBUG [SOAPConnectionImpl] Outgoing SOAPMessage <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'> <env:Header/> <env:Body> <ns1:getVersion xmlns:ns1='http://netcom.no/xil/2003/09/location'/> </env:Body> </env:Envelope> 17:09:58,232 DEBUG [HTTPClientInvoker] Setting request header with SOAPAction : "" 17:09:58,232 DEBUG [HTTPClientInvoker] Setting request header with Content-Type : text/xml; charset=UTF-8 ... ... 17:09:58,263 DEBUG [MessageFactoryImpl] createMessage: [contentType=text/xml; charset=utf-8] 17:09:58,263 DEBUG [SOAPContentElement] setXMLFragment: <ns1:getVersionReturn xsi:type='xsd:string'>Location Web Service version 1 build 007</ns1:getVersionReturn> 17:09:58,263 DEBUG [SOAPConnectionImpl] Incomming Response SOAPMessage <soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'> <soapenv:Header/> <soapenv:Body> <ns1:getVersionResponse soapenv:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' xmlns:ns1='http://netcom.no/xil/2003/09/location'> <ns1:getVersionReturn xsi:type='xsd:string'>Location Web Service version 1 build 007</ns1:getVersionReturn> </ns1:getVersionResponse> </soapenv:Body> </soapenv:Envelope> 17:09:58,263 DEBUG [SOAPBindingProvider] unbindResponseMessage: {http://netcom.no/xil/2003/09/location}getVersion 17:11:14,327 DEBUG [MessageContextAssociation] popMessageContext: org.jboss.ws.soap.SOAPMessageContextImpl@c1bdd7 17:11:14,327 ERROR [STDERR] java.rmi.RemoteException: Call invocation failed: Cannot find child element: getVersionReturn; nested exception is: javax.xml.rpc.JAXRPCException: Cannot find child element: getVersionReturn
i downloaded the jbossWS source and debuged the code in the method org.jboss.ws.binding.soap.SOAPBindingProvider.getParameterFromMessage()
it compairs xmlName and elName chich in my case are
xmlName= getVersionReturn
elName= {http://netcom.no/xil/2003/09/location}getVersionReturn
i have tryed to modefly booth wsdl and jaxrpc but nu sucsess =(, should it not use the namespace on the "part" that i specefy in the operation ?
i hope someone can help me with this becaus i am out of ideas =/
many thanks
/ANders