我在使用 ksoap2 从 android 调用 .net Web 服务时遇到问题。调用在没有参数的情况下执行得很好,但是当我传递任何类型的参数时,Web 服务只会收到一个空值。我尽了一切可能,但到目前为止没有运气。我希望有人可以提供帮助,客户端代码是:
public static boolean temp(){
try {
SoapObject request = new SoapObject(NAMESPACE,METHOD_NAME_TEMP);
PopertyInfo p = new PropertyInfo();
p.type = PropertyInfo.INTEGER_CLASS;
p.setName("num");
p.setValue(5);
p.setNamespace(NAMESPACE);
request.addProperty(p) ;
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11 );
envelope.dotNet = true;
envelope.encodingStyle = SoapSerializationEnvelope.ENC;
envelope.setOutputSoapObject(request);
AndroidHttpTransport androidHttpTransport = new AndroidHttpTransport (URL);
androidHttpTransport.call(SOAP_ACTION_TEMP, envelope);
.....
}
.....