Note: This might look like duplicate but its not.
I have created a .net(WCF) service which validates the username and password. Now I would like
to consume this in my Objective C. I am reading couple of books on Objective C but there is no enough description on consuming web service.
Note: Most of the google references are using the third party tools like ASIHTTPRequest
But I do not want to use any third party source code.
Please guide me and help me.
You can use NSURLConnection to retrieve data from a web service. Create a request (NSMutableURLRequest) specifying the URL, method, etc. Next, create a NSURLConnection and set up a connection delegate. You’ll generally want to use an url connection in asynchronous mode, so you’ll need a delegate to receive messages when the connection connects, gets data, finishes, and so on.
If it’s a SOAP-based service you’ll have some work to do to get the data into useable form. If it’s a RESTful service that provides JSON or XML, life is considerably easier — MacOS X and iOS both include classes that can help you parse these formats.
There are lots of examples of using web services, and they don’t all depend on ASIHTTPRequest. One such example provided by Apple is the “Seismic” project.