【发布时间】:2014-07-10 07:22:50
【问题描述】:
我在尝试从 WSDL Web 服务获取响应时一次又一次地收到此错误。
我是这样使用它的:
//Create request
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
//Property which holds input parameters
PropertyInfo celsiusPI = new PropertyInfo();
celsiusPI.setName("Driver.Token");
celsiusPI.setType(PropertyInfo.STRING_CLASS);
celsiusPI.setValue("c1f40074-4bf8-4159-ba15-e799e9efad9e");
PropertyInfo latitude = new PropertyInfo();
latitude.setName("Latitude");
latitude.setType(Double.class);
latitude.setValue(28.5192);
PropertyInfo longitude = new PropertyInfo();
longitude.setName("Longitude");
longitude.setType(Double.class);
longitude.setValue(77.2130);
//Add the property to request object
request.addProperty(celsiusPI);
request.addProperty(latitude);
request.addProperty(longitude);
//Create envelope
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11);
envelope.dotNet = true;
//Set output SOAP object
envelope.setOutputSoapObject(request);
//Create HTTP call object
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
try {
//Involve web service
androidHttpTransport.call(SOAP_ACTION, envelope);
//Get the response
//SoapPrimitive response = (SoapPrimitive) envelope.getResponse();
Object response = envelope.getResponse();
//Assign it to fahren static variable
fahren = response.toString();
Log.d("Response Message", fahren);
} catch (Exception e) {
e.getMessage();
Log.d("Response Message--------------------", e.getMessage());
}
}
得到这个异常:SoapFault - faultcode: 's:Client' faultstring: 'Error code 2006' faultactor: 'null' detail: org.kxml2.kdom.Node
这非常令人沮丧。如果有人可以帮助我!
【问题讨论】: