我通过ksoap2通过andriod连接到.asmx webservice但不幸的是,web服务收到了从android发送的空值! 我正在连接到本地IIS服务器(笔记本电脑),我的服务器使用了一切都很好,因为我在本地机器上部署我的服务它没有从android接收参数!!
// URL = "http://192.168.#.#/"
// NAME_SPACE = "http://192.168.#.#/cabservice.asmx";
String webResult = null;
Resources resource = this.activity.getResources();
SoapObject request = new SoapObject(resource.getString(R.string.NAMESPACE), resource.getString(R.string.METHOD_NAME_Customer));
request.addProperty("phoneID",this.phoneID);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
HttpTransportSE androidHTTPRequest = new HttpTransportSE(resource.getString(R.string.URL));
// androidHTTPRequest.setXmlVersionTag("<?xml version=\"1.0\"encoding=\"UTF-8\"?>");
androidHTTPRequest.debug = true;
try
{
for(int i = 0; i < 3; i++){
androidHTTPRequest.call(resource.getString(R.string.SOAP_ACTION_Customer), envelope);
webResult = envelope.getResponse().toString();
if(webResult != null)
break;
}
}
catch (Exception e) {
e.printStackTrace();
}
return webResult;
本地服务器接收参数应该做些什么?