TheObserver
Programmer
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.
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.