iPhone - 调用SOAP服务 [英] iPhone - calling SOAP services

查看:132
本文介绍了iPhone - 调用SOAP服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习如何使用iPhone为学生项目使用Web服务。

I'm learning how to consume web services for a student project using the iPhone.

如何使用 http://code.google.com建议如何从iPhone访问SOAP服务 / p / wsdl2objc / 使用服务。

The top answer from How to access SOAP services from iPhone suggested using http://code.google.com/p/wsdl2objc/ to consume services.

但是,我尝试过使用 http://www.weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl ,但它崩溃申请。

However, I've tried using http://www.weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl for the WSDL, but it crashes the application.

有什么想法吗?我不确定问题是与WSDL有关还是与应用程序有关。

Any thoughts? I'm not sure if the problem is with the WSDL or with the application.

推荐答案

我对 wsdl2objc 是最不成熟的。 Apple的解决方案( WSMethodInvocation 及其亲属)尽管年龄稍大,但情况稍好一些。我希望你有一些简单的答案,但是当你开始使用它时,我的经验是你有两个选择:

My experience with wsdl2objc is that it is immature at best. Apple's solutions (WSMethodInvocation and its kin) are little better despite their age. I wish there were some easy answer for you, but when you get down with it, my experience is you have two options:


  • 手写SOAP调用。对于简单的服务,这是可能的,如果我可以逃脱它,它实际上是我的首选解决方案。

  • Hand write the SOAP calls. For simple services this is possible, and it is actually my preferred solution if I can get away with it.

包裹 gSOAP - 在ObjC ++中生成的代码。

Wrap gSOAP-generated code in ObjC++.

您的最佳选项当然是找到一种方法来避免使用SOAP并使用REST接口(如果可能的话)。

Your best option of course is to find a way to avoid SOAP and use a REST interface if you can possibly get one.

如果您有使用SOAP的经验,那么您可能需要帮助 wsdl2objc 框架。他们有一个值得称赞的目标。我还没有试过他们本周发布的0.6版本。也许它现在好多了。如果你正在尝试0.5版本,也许再试一次。

If you're experienced in SOAP, then you may want to help out the wsdl2objc framework. They have a laudable goal. I haven't tried out the 0.6 release they put out this week. Maybe it's much better now. If you're trying the 0.5 release, maybe try again.

我知道你是学生,所以你的需求是不同的。作为一名专业人士,我在Cocoa中避免像瘟疫一样使用SOAP,当我无法避免时,我会回到gSOAP。幸运的是,REST越来越受欢迎,所以我通常可以再次躲闪。

I know you're a student, so your needs are different. As a professional, I avoid SOAP in Cocoa like the plague, and fall back to gSOAP when I can't avoid it. Luckily REST is becoming increasingly popular, so I usually can dodge the bullet one more time.

这篇关于iPhone - 调用SOAP服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆