I am curious and interested in the mobile platform, and recently started to develop and learn iPhone. The learning path is from Objective-C to cococa. The method is to read two English documents for getting started, and to learn about Apple's SDK. The basic idea of the product is to use. NET on the server and iPhone on the mobile client.
Some complex logic processing is implemented on the server. The client interacts with the server through XML and parses XML on the iPhone client to display data through cocoa. Because iPhone and DoNet are two completely different platforms. The iPhone depends on the mac system platform and DoNet depends on the Windows system platform. In this article, I will use a Hello World Program to describe cross-platform calls from mac to Windows through WCF.
1. Create a simple WCF Service
The Service Contract Code is as follows:
The implementation is as follows:
2. call WCF in iPhone
Unlike how DoNet calls the WCF Service, NSURLConnection is used to obtain data from the WCF server. The Code is as follows:
Click to view the chart
NSURLConnection delegation method:
Click to view the chart
The delegate Method for parsing Hello World in XML. For Objective-C parsing XML, you can view my previous blog:
Click to view the chart
Run: