我正在使用ksoap2库来调用Web服务方法。以下代码用于它
SoapObject request = new SoapObject(SOAP_ACTION, SOAP_METHOD);
for (Map.Entry<String, String> entry : params.entrySet()) {
// Use this to add parameters
request.addProperty(entry.getKey(), entry.getValue());
}
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11);
envelope.setOutputSoapObject(request);
envelope.dotNet = false;
HttpTransportSE androidHttpTransport = new HttpTransportSE(SOAP_URL);
// this is the actual part that will call the webservice
androidHttpTransport.call(SOAP_ACTION, envelope);
它给了我XML拉解析器异常“意外令牌(位置:TEXT”。但我使用相同的库来调用同一服务URL中的另一个方法而没有任何错误。 我的android os版本是4.0