Call the WCF Service on a cross-platform iPhone

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.