如何从 iPhone 访问 SOAP 服务 [英] How to access SOAP services from iPhone

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

问题描述

我计划为 iPhone 开发一个应用程序,该应用程序必须访问几个 SOAP 服务.在对 iPhone SDK 进行一些基本检查时,我找不到任何对访问 SOAP 服务的支持,通过谷歌搜索得出的结论是 iPhone SDK 中不支持 SOAP.

I'm planning to develop an app for the iPhone and that app would have to access a couple of SOAP services. While doing some basic checking in the iPhone SDK I was not able to find any support for accessing SOAP services, a bit of Googling lead to the conclusion that there is no support for SOAP in the iPhone SDK.

因此,如果我确实想构建该应用程序,我需要想出一种方法来从 iPhone 访问 SOAP 服务.最好的方法是什么?任何最佳实践?是否有人已经使用 iPhone SDK 中提供的功能编写了一个库来访问 SOAP 服务?

So if I do want to build that app I'll need to come up with a approach to access SOAP services from the iPhone. What would be the best approach? Any best practices? Did someone already write a library using the functionality that is present in the iPhone SDK to access SOAP services?

(由于我需要访问的服务是由另一方公开的,他们只将其公开为 SOAP,不幸的是,不能选择切换到另一种类型的接口(例如基于 REST 的 API).

(Since the service I need to access is exposed by another party and they only expose it as SOAP, it's unfortunately not an option to switch to another type of interface (e.g. REST based API).

格罗

推荐答案

一句话:不要.

好吧,显然这不是一个真正的答案.但是仍然应该不惜一切代价避免使用 SOAP.;-) 是否可以在 iPhone 和 Web 服务之间添加代理服务器?也许可以为您将 REST 转换为 SOAP?

OK obviously that isn't a real answer. But still SOAP should be avoided at all costs. ;-) Is it possible to add a proxy server between the iPhone and the web service? Perhaps something that converts REST into SOAP for you?

可以尝试 CSOAP,这是一个依赖于 libxml2(它包含在 iPhone SDK 中).

You could try CSOAP, a SOAP library that depends on libxml2 (which is included in the iPhone SDK).

我为 OSX 编写了自己的 SOAP 框架.但是,它没有得到积极维护,需要一些时间才能移植到 iPhone(您需要将 NSXML 替换为 TouchXML 开始)

I've written my own SOAP framework for OSX. However it is not actively maintained and will require some time to port to the iPhone (you'll need to replace NSXML with TouchXML for a start)

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

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