2012-03-17 159 views
0

我有一个jax-rpc Web服务。当我试图通过XML Web服务出现以下错误:在此说明将xml传递给jax rpc Web服务

Can a jax-ws web service use an rpc type call and receive raw xml?

但在以前的帖子

[3/18/12 4:26:27:947 IST] 0000002b WebServicesSe E  com.ibm.ws.webservices.engine.transport.http.WebServicesServlet doPost WSWS3227E: Error:  Exception: 
           WebServicesFault 
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException 
faultString: org.xml.sax.SAXException: WSWS3084E: Error: SimpleDeserializer  encountered a child element, which is NOT expected, in something it was trying to deserialize. Message being parsed: 
faultActor: null 
faultDetail: 

org.xml.sax.SAXException: WSWS3084E: Error: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize. Message being parsed: 
at com.ibm.ws.webservices.engine.WebServicesFault.makeFault(WebServicesFault.java:298) 
at com.ibm.ws.webservices.engine.SOAPPart._getSOAPEnvelope(SOAPPart.java:1090) 
at com.ibm.ws.webservices.engine.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:628) 
at com.ibm.ws.webservices.engine.SOAPPart.getEnvelope(SOAPPart.java:656) 
at com.ibm.ws.webservices.engine.handlers.jaxrpc.JAXRPCHandlerChain.handleRequest(JAXRPCHandlerChain.java:301) 
at com.ibm.ws.webservices.engine.handlers.jaxrpc.JAXRPCHandler.invokeServerRequestHandler(JAXRPCHandler.java:506) 
at com.ibm.ws.webservices.engine.handlers.jaxrpc.JAXRPCHandler$1.invoke(JAXRPCHandler.java:380) 
at com.ibm.ws.webservices.engine.PivotHandlerWrapper.invoke(PivotHandlerWrapper.java:209) 
at com.ibm.ws.webservices.engine.WebServicesEngine.invoke(WebServicesEngine.java:336) 
at com.ibm.ws.webservices.engine.transport.http.WebServicesServlet.doPost(WebServicesServlet.java:908) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:738) 
at com.ibm.ws.webservices.engine.transport.http.WebServicesServletBase.service(WebServicesServletBase.java:344) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831) 
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1443) 
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:790) 
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:443) 
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:175) 
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3610) 
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:274) 
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:926) 
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1557) 
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:173) 
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:455) 
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:384) 
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:272) 
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214) 
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113) 
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165) 
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217) 
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161) 
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138) 
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:202) 
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:766) 
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:896) 
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1527) 

类似的错误,原始XML是一种基于关闭的Web服务使用的模式。这里没有输入使用的特定模式。

WSDL文件是:提前任何帮助,您可以提供

<?xml version="1.0" encoding="UTF-8"?> 
<wsdl:definitions targetNamespace="http://service.session.plh"  xmlns:impl="http://service.session.plh" xmlns:intf="http://service.session.plh" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsi="http://ws-i.org/profiles/basic/1.1/xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 
<wsdl:types> 
<schema targetNamespace="http://service.session.plh" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 
<element name="AddPatientResponse"> 
<complexType> 
    <sequence> 
    <element name="AddPatientReturn" nillable="true" type="xsd:string"/> 
    </sequence> 
</complexType> 
</element> 
<element name="AddPatient"> 
<complexType> 
<sequence> 
    <element name="patientform" nillable="true" type="xsd:string"/> 
</sequence> 
</complexType> 
</element> 
</schema> 
</wsdl:types> 

<wsdl:message name="AddPatientRequest"> 
<wsdl:part element="impl:AddPatient" name="parameters"> 
</wsdl:part> 

</wsdl:message> 

<wsdl:message name="AddPatientResponse"> 
<wsdl:part element="impl:AddPatientResponse" name="parameters"> 
</wsdl:part> 

</wsdl:message> 

<wsdl:portType name="StaffBean"> 
<wsdl:operation name="AddPatient"> 
    <wsdl:input message="impl:AddPatientRequest" name="AddPatientRequest"> 
</wsdl:input> 

    <wsdl:output message="impl:AddPatientResponse" name="AddPatientResponse"> 
</wsdl:output> 

</wsdl:operation> 

</wsdl:portType> 

<wsdl:binding name="StaffSoapBinding" type="impl:StaffBean"> 
<wsaw:UsingAddressing wsdl:required="false" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"/> 
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> 
<wsdl:operation name="AddPatient"> 
    <wsdlsoap:operation soapAction="AddPatient"/> 
    <wsdl:input name="AddPatientRequest"> 
    <wsdlsoap:body use="literal"/> 
    </wsdl:input> 
    <wsdl:output name="AddPatientResponse"> 
    <wsdlsoap:body use="literal"/> 
    </wsdl:output> 
</wsdl:operation> 
</wsdl:binding> 
<wsdl:service name="StaffService"> 
<wsdl:port binding="impl:StaffSoapBinding" name="Staff"> 
    <wsdlsoap:address location="http://localhost:9080/PLHospitalService/services/Staff"/> 
</wsdl:port> 
</wsdl:service> 
</wsdl:definitions> 

感谢。请尽快回复。将投票给任何答案。

+0

有人请回复快... – nkvp 2012-03-19 15:29:45

回答

1

您能否提供您拨打该服务的SOAP请求?

请求的预期XML结构与WSDL的XML结构不匹配。

+0

恩,谢谢你的回答。实际上,我试图将XML作为字符串传递,以便发生异常。 – nkvp 2012-06-21 13:08:20