aspose file tools
The moose likes Web Services and the fly likes using a REST-based webservice Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Web Services
Reply Bookmark "using a REST-based webservice" Watch "using a REST-based webservice" New topic
Author

using a REST-based webservice

Johnny Gara
Ranch Hand

Joined: Mar 09, 2007
Posts: 43
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

Joined: Mar 22, 2000
Posts: 12325
    
    1
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


Java Resources at www.wbrogden.com
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: using a REST-based webservice
 
Similar Threads
The Winners Are --
Reading a 300M file in Java the best way?
connection session variable
Place Association
Clone () method