我正在开发一个 IOS 应用程序,它使用 Web 服务 (SOAP/WSDL)。我是这样构建的:我手动构建我的 SOAP 消息(使用soapui),我这样调用它:
NSData *xmlData = // a method to construct my soap xml (my xml is in resources folder of my application which I have generated with soapui)
NSURL *url = [NSURL URLWithString:@"https:myUrlWSDL"];
self.currentRequest = [ASIFormDataRequest requestWithURL:url];
[self.currentRequest appendPostData:xmlData];
[self.currentRequest setDelegate:self];
[self.currentRequest startAsynchronous];
这很好用。
我的问题是:为什么其他程序员使用 gSoap 等 SOAP 客户端来调用他们的 Web 服务?他们为什么不使用我所描述的简单的东西呢? (这不是我的)为什么有这么多 SOAP 客户端和实用程序?
感谢您的回答。
最佳答案
当您开始了解 WS-Security 和服务的其他复杂性时,通过自己编写来解析 SOAP 请求/响应、计算出加密等越来越没有意义。特别是当您必须支持多个平台时。因此,gSOAP 是一个可以在 Android 和 iOS 中运行的 C++ 库,并且已经做到了这一点。
关于iphone - SOAP 和 IOS 开发,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6358628/