我一直在尝试使用 .NET 网络服务
private static final String SOAP_ACTION = "http://tempuri.org/ICustomers/getAllProductsDT";
private static final String METHOD_NAME = "getAllProductsDT";
private static final String NAMESPACE = "http://tempuri.org/";
private static final String URL = "http://10.121.11.53/Customers/Customers.svc";
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
soapEnvelope.setOutputSoapObject(request);
HttpTransportSE androidHttpTransportSE = new HttpTransportSE(URL);
androidHttpTransportSE.debug=true;
androidHttpTransportSE.call(SOAP_ACTION, soapEnvelope);
String str= soapEnvelope.getResponse().toString();
我的第一个日志没有出现在 logcat 中,第二个日志我发现了以下异常:
org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope (position:START_TAG <html>@1:6 in java.io.InputStreamReader@43e56bb0)
05-14 16:08:28.573: W/System.err(3532): org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope (position:START_TAG <HTML>@1:6 in java.io.InputStreamReader@43e56bb0)