0

我收到如下所示的错误。请告诉我哪里出错了。

这是我写的代码

          SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
               SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
                 SoapEnvelope.VER12);
               envelope.setOutputSoapObject(request);
               try {

                       HttpTransportSE  httpTransport = new HttpTransportSE(URL);
                       httpTransport.call(SOAP_ACTION, envelope);
              // httpTransport.call(SOAP_ACTION, envelope);
               SoapObject result = (SoapObject) envelope.bodyIn;
                    Log.i("Result........................", result.toString());
                    System.out.println(result);
                    Toast.makeText(SAPSoapWebservicesActivity.this, result.toString(),
                                50000).show();

             } catch (IOException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
             } catch (Exception e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
             }

08-20 12:01:01.606: WARN/System.err(939): org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope (position:START_TAG <html>@1:6 in java.io.InputStreamReader@4052df28)
4

1 回答 1

1
"org.xmlpull.v1.XmlPullParserException: expected: START_TAG"  

XML Parsing Error. 当未从服务器接收到 预先要求的格式化响应时,解析器在解析时推送此异常。

建议:

  • Parsing the response从服务器之前,只需通过烘烤或打印在LogCat.
  • 检查Parameters你传递给Web Service Method你正在调用的那个。如果需要parameter or the method name does not match,它会给你一个不合适的响应,在解析时会给出这个异常,就像解析器所期望的那样"something else"
于 2012-08-20T07:09:27.360 回答