我正在尝试使用ksoap2,但似乎大写soap对象的名称会引发异常。代码示例和它抛出的异常如下。
奇怪的是,当我检查ht.responseDump
时,数据确实从服务器返回
提前致谢!
SoapObject foo = new SoapObject(NAMESPACE1, "foo");
SoapObject bar = new SoapObject(NAMESPACE1, "bar");
SoapObject search = new SoapObject(NAMESPACE1, "search");
SoapObject keywords = new SoapObject(NAMESPACE2, "Keywords"); //spelling this at 'keywords' is fine
search.addSoapObject(keywords);
bar.addSoapObject(search);
foo.addSoapObject(bar);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.bodyOut = foo ;
envelope.setAddAdornments(false);
HttpTransportSE ht = new HttpTransportSE("http://foo.bar/service");
ht.debug = true;
ht.call(null, envelope);
//returns the correct data, but throws an XmlPullParserException exception
//unexpected type (position:TEXT
//https://www.trus...@1:1327 in java.io.InputStreamReader@44eddd48)
答案 0 :(得分:0)
我想也许是因为你没有收到回复(调用getResponse方法)。