0

我正在通过 ksoap2 通过 andriod 连接到 .asmx 网络服务,但不幸的是,网络服务接收到从 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;

本地服务器接收参数应该额外做什么?

4

0 回答 0