0

Dot net webservice is returning the complete arraylist. But response is not getting stored in soap object and count is always Zero.

SoapObject request=new SoapObject(Servicedata.NAMESPACE, Servicedata.METHOD_NAMECHAPTERLIST);

request.addProperty("Subject",Subject);
SoapSerializationEnvelope envelope=new SoapSerializationEnvelope(SoapEnvelope.VER11);

envelope.dotNet=true;

envelope.setOutputSoapObject(request);

HttpTransportSE androidHttpTransport=new HttpTransportSE(Servicedata.URL);

androidHttpTransport.call(Servicedata.SOAP_ACTIONCHAPTERLIST, envelope);

Chapterresultstr=(SoapObject)envelope.getResponse();  

Totalchapter=Chapterresultstr.getPropertyCount();

Log.e("Chapter",Integer.toString(Totalchapter));

Please let me know if you need any more information.

Thanks.

3 Answers 3

0

Try this and tell me if it works :

Object resultsString = (Object)envelope.getResponse();

    String data = resultsString.toString();

Instead of

    Chapterresultstr=(SoapObject)envelope.getResponse();  

Totalchapter=Chapterresultstr.getPropertyCount();

Log.e("Chapter",Integer.toString(Totalchapter));
1
  • post your logcat then Jul 31, 2014 at 9:37
0
request.addProperty("Subject", Subject);

replace with

request.addProperty("arge1", Subject);

Soap in this way is not a good solution I recommend using HTTPS this way

1
  • If Request property is given statically in webservice then it value is returned in SOAP object. But I give it dynamically then it still returns NULL in SOAP object. Jul 31, 2014 at 5:29
0

I rarely ever use the SoapObject from getResponse. I usually just use androidHttpTransport.responseDump - which returns the raw XML and then parse the XML.

You could also try this tutorial for returning arrays from SOAP web service http://seesharpgears.blogspot.com/2010/10/web-service-that-returns-array-of.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.