我想使用来自 android 应用程序的 C# Web 服务。在我的项目中,我使用 SOAP 请求取回数据,使用 kSOAP 2 库,但是当我在我的...... asmx , C# 后端,使用此代码
SoapObject getWeather(String customerNumber) throws Exception {
PropertyInfo property = new PropertyInfo();
property.setName("LicenseId");
property.setValue("8BEBFB9F-D9C9-4880-9225-AB50976F2975");
property.setType(String.class);
SoapObject request = new SoapObject("http://mobilesuite365.com",
"GetCustomers");
request.addProperty(property);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
// It seems that it is a .NET Web service because it doesn't work
// without next line
HttpTransportSE transport = new HttpTransportSE(
"http://www.mobilesuite365.net/app2/getdata.asmx");
transport.debug = true;
transport.call("http://mobilesuite365.com/GetCustomers", envelope);
return (SoapObject) envelope.getResponse();
我收到此错误 "XmlPullParserException: Unexpected token (position:TEXT" ,因为响应类似于 JSON,但 ksoap 可以处理 xml 格式..
如何从响应中获取响应并处理信息并在我的应用程序中使用它?
感谢帮助