Sending a SOAP Request using ASIHTTP & Parsing using TouchXML

Hi All !sugartin xml parsing touchxml xmlns custom

For sending requests to SOAP web-services, one can use different techniques as follows.

  • Using NSURLConnection & NSXMLParser
  • Using NSURLConnection & TouchXML Parser
  • Using NSURLConnection & LibXml2 Parser
  • Using ASIHTTPRequest & NSXML Parser/TouchXML Parser/LibXml2 Parser.

Using this post, I am quickly going to illustrate “How to send a request to SOAP Web-services using ASIHTTP & Parse response using TouchXML?”

Here we are going to consume a SOAP-web-service for authentication.

Step 1. Define your SOAP Request as a constant & put @ sign for all input parameters. Example is as follows. (Just a preferable way, choice is yours as code is yours too)

Step 2. Define a method which will send ASIHTTPRequest. Please go through the comments within the code given to understand each statement’s importance. For example, following method is for authenticating a user with username & password parameters.

Step3. Add Response handler methods as follows.

Step4. Add Logic for parsing using TouchXML. If you are struggling with custom name-space-parsing issues, I’ve illustrated how to resolve that issue.

Hope above illustration would make your life little easy.


Leave a Reply

Your email address will not be published. Required fields are marked *