Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Consumption of Web Services

Status
Not open for further replies.

TheObserver

Programmer
Mar 26, 2002
91
0
0
US
I have a question regarding the consumption of web services. I have previously written REST services, and those work fine. I was writing a client to consume them in PHP, so I wrote a class that would connect to the service via curl, pull over the content of the service (an xml document), and then I would use SimpleXMLParser to go through the document and extract data.

Granted, curl may not be the ideal way to do the data pull, but it works well and since the access rate is rather low, it shouldn't create and load issues on the client server.

I have recently had need to write another client/consumer in Java. I was leaning towards using URL and URLContent to get the content from a web service and then parse the content to extract my data. However, I was told by a coworker that this method of connecting was "hokey". However, I can't find any client/consumer that at its essence doesn't do pretty much the exact same thing.

Am I missing something here? Is there something in the default Java JDK that allows for some form of "better" consumption that doesn't boil down to what I've proposed? I can't seem to find anything that is different from what I'm trying to do.

Thanks.
 
You observed right, *the* way to inquire information on a webservice is to get it's service interface, usualy called WSDL, and that is available in XML format exclusively. All needed info on the webservice is available from there.

Most webservice frameworks provide tooling to either get the WSDL specs from a service, or generate java source to access the service (using that framework, obviously). One that comes to mind is Axis2 (from A search on Google should reveal 'more' of these frameworks ;-)

HTH
TonHu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top