调用 webservice 时报 :SoapFault - faultcode: 'soapenv:Server' faultstring: 'Index: 0, Size: 0' faultactor: 'null' detail: [email protected]
- Java code
String url; Propertytool pt = new Propertytool("Sysconfig.properties"); url = pt.getValue("serurl") + servername + "?wsdl"; // 实例化SoapObject对象 SoapObject spobejct = new SoapObject(namespace, funcname); // 传入参数 addpre(spobejct, hm); // 设置Soap的请求信息,参数部分为Soap协议的版本号 SoapSerializationEnvelope envelope = new SoapSerializationEnvelope( SoapEnvelope.VER11); envelope.bodyOut = spobejct; AndroidHttpTransport transport = new AndroidHttpTransport(url); try { transport.call(null, envelope); } catch (XmlPullParserException e) { // TODO Auto-generated catch block e.printStackTrace(); } try { Object o = envelope.getResponse();//异常在这里抛出来的。郁闷的很,前面的调用都是正常的,换了 3 个参数的 服务方法就报错了。 return o; } catch (Exception ee) { Log.v("fsfs", ee.getMessage()); } return null;
------解决方案--------------------
url后面的"?wsdl"去了试试
------解决方案--------------------
参考一下J2ME的