如何在iOS中使用ASPX Web服务?

编程入门 行业动态 更新时间:2024-10-23 15:25:10
本文介绍了如何在iOS中使用ASPX Web服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

有人可以澄清在iOS中使用aspx Web服务的过程吗?我已经尝试过JSON框架,但是现在,需要创建一个使用XML格式的 Web服务的应用程序.我既需要向服务器发布一些数据,又需要从服务器获取数据.我已经阅读了有关我发现的适用于iOS的现有XML解析器的信息(此处)

Could anybody clarify the process of consuming aspx webservices in iOS? I have already tried JSON framework but now, need to create an app that consumes webservices in XML format. I need both to post some data to, and get data from the server. I already read about existing XML parsers for iOS that I found (here)

问题是我是否需要进行其他设置,例如将查询字符串包装在SOAP或smth中才能与Web服务器通信?在链接中只使用其中一个提到的库就足够了吗?还是我需要其他东西?

The question is do I need to do additional setup, like wrapping my query strings in SOAP or smth, in order to communicate with webserver? Would it be sufficient to use only one of mentioned libraries in the link or do I need additional stuff?

更新:我在网上找到了一个教程(此处),演示了如何使用Json框架使用Web服务.另外,我发现了另一个使用NSXMLParser进行演示的示例(此处).我对WSDL和SOAP并不是很熟悉,因此需要有关如何实现的任何详细说明:).在这两个示例中,您只需要构造一个xml格式的请求字符串并执行它即可.这两个示例实际上都绕过了SOAP和WSDL的繁重工作,因此我想知道我是否必须了解并做更多的事情,才能构造一个请求字符串,执行它并获得响应?

UPDATE: I found one tutorial on web (here) that demonstrates how to consume web services using Json-framework. Also, I found another one that demonstrates it using NSXMLParser (here). I'm not not very familiar with WSDL and SOAP, so any detailed explanation on how to implement would be desirable :). In both of these examples you just have to construct a request string in xml format and execute it, and that's it. Both examples actually bypasses the heavyness of SOAP and WSDL, so I was wondering do I have to know and do more that just construct a request string, execute it and get response?

推荐答案

虽然wsdl2objc在那里(如@Girish Kolari所指出),但事实是,没有简单的答案.我从来没有成功地使wsdl2objc能够很好地完成我无法轻松完成的工作.您将需要学习SOAP和WSDL.如果您无法访问REST界面,那只是生活中的事实.以我的经验,对简单SOAP访问的最佳选择是手工完成,对某些复杂SOAP访问的最佳选择是gSOAP.对于非常复杂的访问,最好的选择是重新设计某些东西,使其不那么复杂,理想情况下是在REST中.SOAP是一种巨大的痛苦,某些语言(C#)使您无法使用SOAP.ObjC不能使您免受其困扰,因此它仍然是一个巨大的痛苦.

While wsdl2objc is out there (as noted by @Girish Kolari), the truth is that there's no easy answer. I've never successfully gotten wsdl2objc working well for something that I couldn't have done more easily by hand. You will need to learn SOAP and WSDL. That's just a fact of life if you can't get access to a REST interface. In my experience, your best bet for simple SOAP access is to do it by hand, and your best bet for somewhat complicated SOAP access is gSOAP. Your best bet for very complicated access is to redesign something so it's not so complicated, ideally in REST. SOAP is a giant pain that some languages (C#) shield you from. ObjC does not shield you from it, so it continues to be a giant pain.

是的,SOAP在我的口腔中留下难闻的味道.

Yes, SOAP leaves a bad taste in my mouth.

更多推荐

如何在iOS中使用ASPX Web服务?

本文发布于:2023-11-11 18:30:52,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1579235.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何在   iOS   Web   ASPX

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!