Code Bye

webservice调用报错 SAXException

org.xml.sax.SAXException: No deserializer for {http://schemas.xmlsoap.org/soap/encoding/}string
at org.apache.axis.encoding.DeserializerImpl.onStartElement(DeserializerImpl.java:453)
at org.apache.axis.encoding.DeserializerImpl.startElement(DeserializerImpl.java:393)
at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1048)
at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
at org.apache.axis.encoding.DeserializerImpl.startElement(DeserializerImpl.java:369)
at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1048)
at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:345)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
at org.apache.axis.client.Call.invoke(Call.java:2467)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.webservice.Test.getHelloWord(Test.java:71)
at com.webservice.Test.main(Test.java:20)
Exception in thread “main” AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode: 
 faultString: org.xml.sax.SAXException: No deserializer for {http://schemas.xmlsoap.org/soap/encoding/}string
 faultActor: 
 faultNode: 
 faultDetail: 
{http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXException: No deserializer for {http://schemas.xmlsoap.org/soap/encoding/}string
at org.apache.axis.encoding.DeserializerImpl.onStartElement(DeserializerImpl.java:453)
at org.apache.axis.encoding.DeserializerImpl.startElement(DeserializerImpl.java:393)
at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1048)
at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
at org.apache.axis.encoding.DeserializerImpl.startElement(DeserializerImpl.java:369)
at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1048)
at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:345)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
at org.apache.axis.client.Call.invoke(Call.java:2467)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.webservice.Test.getHelloWord(Test.java:71)
at com.webservice.Test.main(Test.java:20)

请问一下这是什么原因导致的问题

Service service = new Service ();
Call call = (Call) service.createCall ();
call.setTargetEndpointAddress(new java.net.URL(“http://172.16.215.18:8081/wf_cas/services/SessionService”));
 call.setOperation(“getHelloWord”);        
Map<String,String> returnParamMap = null;
HashMap paramMap=new HashMap();
paramMap.put(“name”,”托尔斯泰”);
returnParamMap = (Map<String,String>)call.invoke(new Object[] {paramMap});
System.out.println(returnParamMap.get(“returnMap”));
我现在修改 call.setOperation(“getHelloWord”);      为 call.setOperationName(“getHelloWord”);      就能够解决。但是我不知道什么原因

20分
就是调用方法没得呗

20分
用的axis几?call.setOperation();会把所有的参数都清空。
public void setOperation(String opName)
  {
    if (this.service == null) {
      throw new JAXRPCException(Messages.getMessage("noService04"));
    }

    setOperationName(opName);
    setEncodingStyle(null);
    setReturnType(null);
    removeAllParameters();

 


CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明webservice调用报错 SAXException