Ios 在objective-c中解析SOAP响应
经过几个小时的研究,我无法解析soap响应。 我没有使用Ios 在objective-c中解析SOAP响应,ios,objective-c,parsing,soap,nsxmlparser,Ios,Objective C,Parsing,Soap,Nsxmlparser,经过几个小时的研究,我无法解析soap响应。 我没有使用WSDL2OBJC或SudZc来解析我的WSDL文件,我使用了返回XML的SoapUI 有关其外观的示例: <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility- 1.0.xsd"&g
WSDL2OBJC
或SudZc
来解析我的WSDL文件,我使用了返回XML的SoapUI
有关其外观的示例:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility- 1.0.xsd">
<s:Header>
<o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis- open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<u:Timestamp u:Id="_0">
<u:Created>2013-01-25T12:19:59.906Z</u:Created>
<u:Expires>2013-01-25T12:24:59.906Z</u:Expires>
</u:Timestamp>
</o:Security>
</s:Header>
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<getAllEntitiesResponse xmlns="http://tempuri.org/">
<getAllEntitiesResult>
<Entity Id="2" Name="red" Hexa="#CD0000" Alpha="1" LastUpdated="2012-06-27T10:36:33.39">
<EntityKey>
/* Some code */
</EntityKey>
</Entity>
2013-01-25T12:19:59.906Z
2013-01-25T12:24:59.906Z
/*一些代码*/
我的问题是:我如何解析它,只是为了拥有“实体”属性(只是实体id=2 name=red的行
提前感谢,
使用NSXML解析器,然后让实体实现NSCoding协议。Insider initWithCoder,您将能够获取属性并填充对象。顺便说一句,我是GitHub上一个开源项目的作者,该项目使用JSON实现这一点: