By: Aaron Hillegass Emailed: 1729 times Printed: 2337 times
Web services are simply an HTTP request and response whereby each may be carrying XML data. So using a Web service from Cocoa is simply a matter of being able to send HTTP requests and receive responses. It also may require generating and parsing XML.
Figure: Your Average Web Service in Action
HTTP requests and responses are handled by NSURL, NSURLRequest, and NSURLConnection.
Generating and parsing XML are typically done by NSXMLDocument and NSXMLNode. Suppose that you have an NSData containing this XML:
<?xml version="1.0" encoding="UTF-8"?> <person> <first>Larry</first> <last>Furg</last> </person>
NSXMLDocument will parse it into a handy tree.
Figure: Parsed XML Document
Be the first one to add a comment
Most Viewed Articles (in Cocoa )
Most Emailed Articles (in Cocoa)