Iphone – How to Fetch Data From a WebService in iPhone

iphoneweb services

I have to develop an application which includes following things,

=> Make a request to the Web Service through an iPhone…

=> fetch Data from web service…

I have never used an web service to develop iPhone application.

But i know what is web service.

The example of web service is given below. a snapshot
alt text

Best Answer

To retrieve data from the webservice you can use NSURLRequest or NSMutableURLRequest

...where you can use methods such as + sendSynchronousRequest:returningResponse:error: or sendAsynchronousRequest. If you are simply doing a get, you can retrieve your xml or json in a very easy way using [NSString s tringWithContentOfURL:url] this will read in the response into the string you assign it to.