IPhone cross-platform calling of the WCF Service

Source: Internet
Author: User

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:

Related Article

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.