我尝试在Android中从this获取数据,但报错
org.xmlpull.v1.XmlPullParserException: Unexpected token (position:TEXT [{"BusinessPart...
我们有两个作为参数C
和P
传递的值,并返回JSON数据。
这是我的Java代码:
public void getMyDataFromWS() {
String SOAP_ACTION = "http://tempuri.org/GetCustomerDataforMobile";
String METHOD_NAME = "GetCustomerDataforMobile";
String NAMESPACE = "http://tempuri.org/";
String URL = "http://arg-online.net/MobileGetService.asmx";
try {
SoapObject Request = new SoapObject(NAMESPACE, METHOD_NAME);
// Request.addProperty("datatype", getCel);
SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
soapEnvelope.dotNet = true;
soapEnvelope.setOutputSoapObject(Request);
HttpTransportSE transport = new HttpTransportSE(URL);
transport.call(SOAP_ACTION, soapEnvelope);
resultString = (SoapPrimitive) soapEnvelope.getResponse();
Log.i(TAG, "Result Celsius: " + resultString);
} catch (Exception ex) {
Log.e(TAG, "Error: " + ex.getMessage());
}
}
和 SOAP ACTION
,NAMESPACE
,METHOD
和URL
是 here >
private static String SOAP_ACTION = "http://tempuri.org/GetCustomerDataforMobile";
private static String NAMESPACE = "http://tempuri.org/";
private static String METHOD_NAME = "GetCustomerDataforMobile";
private static String URL = "http://arg-online.net/MobileGetService.asmx";
// private static String PRAMS = "datatype";