【问题标题】:Soap Webservice XML parsing in IOSIOS中的Soap Webservice XML解析
【发布时间】:2014-08-11 09:56:23
【问题描述】:

我是 SOAP XML Web 服务的新手。我发起肥皂请求并得到如下响应

<?xml version="1.0" encoding="ISO-8859-1"?>
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:createemailResponse xmlns:ns1="urn:hellowsdl"><return xsi:type="xsd:string”>{“data”:[{“email”:”ex@yahoo.com”,”pid”:”32502”}]}</return></ns1:createemailResponse></SOAP-ENV:Body>

在此我想从 createemailResponse 检索响应字符串为 {“data”:[{“email”:”ex@yahoo.com”,”pid”:”32502”}]}。请帮帮我...

【问题讨论】:

  • 你有 SOAP 服务的 wsdl 文件吗?
  • 是的,我有肥皂服务的 wsdl 文件。
  • 你能解决你的问题吗?

标签: ios xml web-services soap


【解决方案1】:

您可以使用一些第三方工具来根据您的 wsdl 设计创建模型类和服务调用类。对于我的一个应用程序,我已按照以下链接中的教程进行操作:

http://www.priyaontech.com/2012/10/soap-based-webservices-integration-in-an-ios-app/

按照上面的教程,您可以避免调用 SOAP 服务的大量代码。这样您的代码看起来更有条理和可读性。

【讨论】:

  • 感谢分享链接。我会检查网址。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-05-10
  • 1970-01-01
  • 2013-02-08
  • 1970-01-01
相关资源
最近更新 更多