Cómo analizar la solicitud de jabón en iPhone

I am trying to send a request to server with my soap request and trying to get the server response,so I got the server response eith many tags.. below is my server response

<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><GetCustomersResponse xmlns="http://www.fashionize.ca/"><GetCustomersResult><Customer><ID>2</ID><No>LASEN</No><Name>La Senza</Name><Add1>43221 Van Horn</Add1><Add2 /><LanguageCd>EN</LanguageCd><DateCreated>2011-08-16T09:33:00</DateCreated></Customer><Customer><ID>1</ID><No>THUND</No><Name>Thunder Bay</Name><Add1>1234 Miaw</Add1><Add2 /><LanguageCd>FR</LanguageCd><DateCreated>2011-08-16T09:33:00</DateCreated></Customer></GetCustomersResult></GetCustomersResponse></soap:Body></soap:Envelope>

Here as u can see it has many tags like customer name,add1,add2 so i want o know how to parse this..

Saludos Ranjit

preguntado el 27 de agosto de 11 a las 14:08

4 Respuestas

SOAP is pretty horrible to deal with, but not impossible. If you have the option to use JSON instead then that is a much better alternative.

Here is a great article on SOAP on iOS: http://blog.exadel.com/2011/03/working-with-ios-and-soap/

Respondido 27 ago 11, 18:08

thanks stefan...I am following the traditional way..without using any tools..and using NSXMLParser for parsing..can u tell me how to parse the image? - Ranjit

Tratar http://sudzc.com/. It generates a code for you and be able to parse any Soap message very easily and quickly.

Respondido 27 ago 11, 18:08

Hi vanya..thanks for your reply..r there any good tutorials for sudzc..apart from their official site..and I am using the traditional way of parsing and using NSXML for parsing - Ranjit

I've used wsdl2objc (http://code.google.com/p/wsdl2objc/) quite successfully. You'll have to set a compiler flag and add a build path, but otherwise it's pretty much hassle-free.

Respondido 27 ago 11, 18:08

Please see the demo prepared for iOS/OSX using sample web service.

It uses swift - SOAP request creator & response parser.

DEMO

Done using Alamofire & SWXMLHash library

Muchas Gracias

Respondido 11 Abr '16, 10:04

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.