Blackberry アプリで次のエラーが表示されます。
org.xmlpull.v1.XmlPullParserException:expected"END_TAG</{http://schemas.xmlsoap.org/soap/envelope/}soap:Fault>@3:181 in java.io.InputStreamReader@d88bc808)
私はエンベロープを作成するために KSoap2 を使用しています。応答を受け取ったら、次のコードを使用して XML を返します。おそらくそうすべきではありません (このコードは明らかに不完全です)。
String serviceUrl = WS_URL + Globals.theApp.getConnectionString();
String serviceNamespace = "http://www.mysite.com/";
String soapAction = "http://www.mysite.com/postMessage";
SoapObject rpc = new SoapObject(serviceNamespace, "postMessage");
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.bodyOut = rpc;
envelope.dotNet = true;
envelope.encodingStyle = SoapSerializationEnvelope.XSD;
envelope.addMapping("http://www.mysite.com/", "Message", new Message().getClass());
PropertyInfo pinfo = new PropertyInfo();
pinfo.name = "myMessage";
pinfo.namespace = serviceNamespace;
pinfo.type = Message.MESSAGE_CLASS;
rpc.addProperty("Message", message);
HttpTransport ht = new HttpTransport(serviceUrl);
ht.debug = true;
String xmlResponse;
try
{
ht.call(soapAction, envelope);
xmlResponse = envelope.getResponse().toString();
SoapObject myResponse = (SoapObject)envelope.getResponse();
xmlResponse = ht.responseDump;
私は ht.responseDump を使用して xml 文字列を取得しています (以前は XML で何も返されていなかったためです)。そこから xmlResponse などを解析しようとしています.....
しかし、そのエラーが発生します。なぜですか?? ht.responseDump はこれを行う最良の方法ではありませんか? ht.debug は何をしますか?? xml が途切れてしまうのはなぜですか??
前もって感謝します。私は本当に助けが必要です。