-2

After a few hours of research, i'm not able to parse a soap response. I don't have used WSDL2OBJC or SudZc for parsing my WSDL file, I have used SoapUI which returns XML.

For an example of how it looks like :

    <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>

My question is : How can I parse this, just to have the "Entity" properties (Just the line with Entity id=2 name=red ...) ?

Thanks in advance,

Regards

DarkRainbow
  • 97
  • 1
  • 5

1 Answers1

1

Use the NSXML parser and then have the entities implement the NSCoding protocol. Insider initWithCoder, you will be able to get the properties out and populate the objects.

Rob
  • 11,446
  • 7
  • 39
  • 57
  • btw, I'm the author of an open source project on GitHub that does this with JSON: http://github.com/ontometrics/JSONCoding.git – Rob Jan 25 '13 at 19:00