0

I am consuming a dotnet webservice on android code using ksoap2.I can successfully call the webservice without any parameters but when I tried to call method using a string parameters i am getting this error mentioned below.

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.

I am adding the parameters in this way.

request.addProperty("arg0", "username"); 
request.addProperty("arg1", "pass");

Errors thrown in this line

 SoapPrimitive result = (SoapPrimitive)envelope.getResponse();
Jeyaganesh
  • 1,334
  • 5
  • 26
  • 48

1 Answers1

0

I solved myself.

Instead of

SoapPrimitive result = (SoapPrimitive) envelope.getResponse();

i used

SoapObject result = (SoapObject) envelope.getResponse();
SilentKiller
  • 6,944
  • 6
  • 40
  • 75
Jeyaganesh
  • 1,334
  • 5
  • 26
  • 48
  • great job. Even I faced this when I started working on ksoap initially. If u are keen on working with .NET (.asmx) webservices in future refer [this](http://stackoverflow.com/questions/7860887/how-to-call-a-local-web-service-from-an-android-mobile-application) – Parth Doshi Nov 27 '11 at 05:35