无法将整数值传递给服务请求 . 到达服务请求的值变为null这是我的代码
private static final String METHOD_NAME = "GetPrivileges";
private static final String NAMESPACE = "http://AuthorizationManagement.ServiceContracts/2007/01/";
private static final String URL = "http://192.168.5.219/NTLS_Authorization/AuthorisationManager.asmx";
final String SOAP_ACTION = "http://AuthorizationManagement.ServiceContracts/2007/01/GetPrivileges";
public void call(){try {SoapObject request = new SoapObject(NAMESPACE,METHOD_NAME);
PropertyInfo pi=new PropertyInfo();
pi.type=PropertyInfo.INTEGER_CLASS;
pi.setName("RoleID");
pi.setValue(3);
pi.setNamespace(NAMESPACE);
request.addProperty(pi);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
androidHttpTransport.call(SOAP_ACTION, envelope);
Object result = envelope.getResponse();
String resultData = result.toString();
2 回答
只需添加此项即可
可以尝试这段代码// note don't put directly number(3 in ur case) instead pass it as parameter ...