我正在使用ksoap2在android代码上使用dotnet webservice.I可以成功调用webservice而不使用任何参数但是当我尝试使用字符串参数调用方法时,我收到下面提到的错误。
soap:Server' faultstring: 'System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.NullReferenceException: Object reference not set to an instance of an object.
我正在以这种方式添加参数。
request.addProperty("arg0", "username");
request.addProperty("arg1", "pass");
此行中抛出的错误
SoapPrimitive result = (SoapPrimitive)envelope.getResponse();
答案 0 :(得分:0)
我解决了自己。
而不是
SoapPrimitive result = (SoapPrimitive) envelope.getResponse();
我用过
SoapObject result = (SoapObject) envelope.getResponse();