0

I have a asp.net Webservice which returns me XML. What should i use in Android and how to parse?

JavaNewb
  • 35
  • 1
  • 1
  • 5

2 Answers2

2

Is your WS SOAP based or RESTful?

These threads Invoking WEbService from Android and Working with XML on Android might help you get started.

Community
  • 1
  • 1
Samuh
  • 36,316
  • 26
  • 109
  • 116
  • How can i find that out? I only know that i get xml files? – JavaNewb Feb 22 '11 at 13:46
  • A quick check would be to see if responses are SOAP messages(XML tags containing prefix). If they are normal XML(no soap namespace) then the webservice is RESTful. – Samuh Feb 22 '11 at 13:51
  • Okay, no SOAP. So i cant use kSoap2 library? Can i get soap messages instead of only xml? – JavaNewb Feb 22 '11 at 14:23
  • why would you want to do that? Connect to the remote server using DefaultHTTPClient and parse the response XML using XML Pull parser. – Samuh Feb 22 '11 at 15:04
  • Are you communicating via formatted URLS, or if you're testing in VS, are you doing it by going into VS and saying "Import Web Service"...something like that. If the former its probably some REST variant, if the latter, then probably SOAP. If it is soap you shouldn't have to access the XML at all, VS should generate code to marshal everything to objects in the language of your choice. – mezmo Feb 22 '11 at 15:06
1

In order to parse the XML please use kSoap2 library. Also check this post

Shashank_Itmaster
  • 2,465
  • 5
  • 30
  • 56