iPhone与ASP.NET WebService的交互 [英] iPhone interaction with ASP.NET WebService
问题描述
我必须开发一个应用程序,它将请求在ASP.NET中开发的Web服务。
I have to develop an application, which will request to a web service developed in ASP.NET.
我不知道,创建的代码是什么对asp.net Web服务的请求,
I don't know, what is the code of creating a request to asp.net web service,
asp.net Web服务如何响应iPhone应用程序?
How asp.net web service will respond to iPhone Application?
iPhone如何以正确的方式解析响应?
How iPhone will parse that response to proper way?
我已经读过这个问题
如何从iPhone中的WebService获取数据?
但是给定的链接只给出.pdf文件。
I have already read this question
How to Fetch Data From a WebService in iPhone?
But given link only gives the .pdf file.
我需要的是示例代码 - 这可以解释我如何建立连接&从asp.net Web服务中检索数据。
My need is sample code - that can explain me how to make connection & retrieve data from asp.net web service.
推荐答案
您实际上可以创建一个Web服务并使其易于集成到您的服务中iphone up。我建议如果你使用.net来创建一个带有webHttp出价的WCF服务并实现get和post方法,你可以在json和xml中获得响应(这是一组用来解析iphone上的Json的类,它将解析回复轻而易举,他们在网络上是可用的,只需很少的设置,你就可以使用NSURLRequest从iphone获取和发布。下面是一篇关于制作一个安静的wcf服务的文章 http://www.developer.com/净/ article.php / 10916_3695436_2 。使用WCF也很容易为您的服务添加身份验证和安全性。
You can actually make a web service and make it real easy to integrate into your iphone up. I would suggest if you are using .net to create a WCF service with webHttp bidding and implement get and post methods, you can get responses back in json and xml (theres a set of classes to parse Json on the iphone that will make parsing the response a breeze, they are avaialble in the web), with little setup you will be able to perform gets and post from the iphone using NSURLRequest. Heres an article that talks about making a restful wcf service http://www.developer.com/net/article.php/10916_3695436_2. Its also very easy to add authentication and security to your services with WCF.
这篇关于iPhone与ASP.NET WebService的交互的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!