I’m trying to obtain a result from a web service in a java program. I’ve done xml services before but this one is text based and i can’t figure out how to record the response.
Here is the webService: http://ws.geonames.org/countryCode?lat=47.03&lng=10.2
Thanks!
If it’s only text, and you doesn’t use any standard format (like SOAP), you need to use Sockets:
Use this if you had many lines:
Or use this if you had ONLY ONE line (like the Web Service in your question):
And finish with:
In my case, countryCode it was “AT”