Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

using a REST-based webservice  RSS feed

 
Johnny Gara
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's the best way to do this?

Is it a simple matter of reading the url to the WS, reading the contents as html, and then running that through a XML reader?

I'm pretty new to all this so any help (best practice) would be appreciated....
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I gather you are trying to make a client for an existing RESTful webservice.

Typically you would create a HttpURLConnection to a URL and read the response stream according the type of the return.

RESTful services are not restricted to returning XML, the returned stream could be any MIME type. Surely you have some sort of documentation on what this service returns.

If it returns XML you can hand the response stream to an XML parser and follow standard XML processing.

Bill
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!