Web Services in Mac Cocoa Programming

By: Aaron Hillegass Emailed: 1645 times Printed: 2113 times    

Latest comments
By: rohit kumar - how this program is work
By: Kirti - Hi..thx for the hadoop in
By: Spijker - I have altered the code a
By: ali mohammed - why we use the java in ne
By: ali mohammed - why we use the java in ne
By: mizhelle - when I exported the data
By: raul - no output as well, i'm ge
By: Rajesh - thanx very much...
By: Suindu De - Suppose we are executing

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.

Figure: Classes for Making HTTP Requests

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


Cocoa Home | All Cocoa Tutorials | Latest Cocoa Tutorials

Sponsored Links

If this tutorial doesn't answer your question, or you have a specific question, just ask an expert here. Post your question to get a direct answer.



Bookmark and Share

Comments(0)


Be the first one to add a comment

Your name (required):


Your email(required, will not be shown to the public):


Your sites URL (optional):


Your comments:



More Tutorials by Aaron Hillegass
Printing in Mac Cocoa Programming
Web Services in Mac Cocoa Programming
Weak References in Mac Cocoa Programming
Garbage Collector in Cocoa Programming in Mac
Using NSOpenGLView in Cocoa Programming in Mac
Multithreading versus Multiprocessing in Mac OS X.
Life Cycle of a Cocoa Application
Frameworks in Cocoa Programming
Objects, Classes, Methods, and Messages in Cocoa Programming
Programming Language used in Cocoa Programming
What is Cocoa? A brief history of Cocoa.
Tools for Cocoa Programming

More Tutorials in Cocoa
Listing of files in a tar file in Mac OS X.
Listing of files in a zip file in Mac OS X.
Multithreading versus Multiprocessing in Mac OS X.
Using NSOpenGLView in Cocoa Programming in Mac
Garbage Collector in Cocoa Programming in Mac
Weak References in Mac Cocoa Programming
Web Services in Mac Cocoa Programming
Printing in Mac Cocoa Programming
Tools for Cocoa Programming
What is Cocoa? A brief history of Cocoa.
Programming Language used in Cocoa Programming
Objects, Classes, Methods, and Messages in Cocoa Programming
Frameworks in Cocoa Programming
Life Cycle of a Cocoa Application

More Latest News
Most Viewed Articles (in Cocoa )
Listing of files in a zip file in Mac OS X.
Garbage Collector in Cocoa Programming in Mac
Web Services in Mac Cocoa Programming
Tools for Cocoa Programming
What is Cocoa? A brief history of Cocoa.
Programming Language used in Cocoa Programming
Objects, Classes, Methods, and Messages in Cocoa Programming
Frameworks in Cocoa Programming
Life Cycle of a Cocoa Application
Listing of files in a tar file in Mac OS X.
Multithreading versus Multiprocessing in Mac OS X.
Using NSOpenGLView in Cocoa Programming in Mac
Weak References in Mac Cocoa Programming
Printing in Mac Cocoa Programming
Most Emailed Articles (in Cocoa)
Multithreading versus Multiprocessing in Mac OS X.
Tools for Cocoa Programming
Web Services in Mac Cocoa Programming
Printing in Mac Cocoa Programming
Programming Language used in Cocoa Programming
Objects, Classes, Methods, and Messages in Cocoa Programming
Frameworks in Cocoa Programming
Listing of files in a tar file in Mac OS X.
Listing of files in a zip file in Mac OS X.
Garbage Collector in Cocoa Programming in Mac
Weak References in Mac Cocoa Programming
What is Cocoa? A brief history of Cocoa.
Life Cycle of a Cocoa Application
Using NSOpenGLView in Cocoa Programming in Mac