IPhoneCallingWCFServices are the content to be introduced in this article. Due to the curiosity and interest in mobile platforms, I recently startedIPhoneDevelopment and learning. The learning path is from objective-c to cococa. The method is to read two English documents for getting started, and to learn about the apple sdk. The basic idea of the product is to use. net on the server and mobile client.IPhone.
Some complex logic processing is implemented on the server. The client interacts with the server through XML.IPhoneThe client parses XML to display data through cocoa. BecauseIPhoneAnd DoNet are two completely different platforms.IPhoneRelying on the mac system platform, donet relies 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
Different from how donet calls the wcf Service, NSURLConnection is used to obtain data from the WCF server. The Code is as follows: Click to zoom in)
NSURLConnection delegate method: Click to enlarge)
Parse the delegate method of hello world in XML. For objective-c parsing xml, see my previous blog: Click to enlarge)
Run:
Summary: This article describes how to use a simple exampleIPhoneCallWCF. UseWcfCross-platform implementation is quite simple!
Code:
Wcf code: http://files.cnblogs.com/zhuqil/WcfService1.rar
Cocoa code: http://files.cnblogs.com/zhuqil/wcf2.zip
Summary: details about cross-platformIPhoneCallingWCFI hope this article will help you with the introduction of the service.