Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6619281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:56:46+00:00 2026-05-25T20:56:46+00:00

I am unable to parse response recieve using Touch XML My response from SOAP

  • 0

I am unable to parse response recieve using Touch XML My response from SOAP

    <CXMLDocument 0x4b30110 [0x4b34c90]> <?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>
    <GetImagesResponse xmlns="http://tempuri.org/">
      <GetImagesResult>;http://www.google.com;http://www.hotmail.com;http://www.yahoo.com</GetImagesResult>
    </GetImagesResponse>
  </soap:Body>
</soap:Envelope>

/// Touch XML function

    -(void) grabRSSFeed:(NSData *)responseData {

    // Initialize the blogEntries MutableArray that we declared in the header
    self.rssEntries = [[[NSMutableArray alloc] init] autorelease];

    // Create a new rssParser object based on the TouchXML "CXMLDocument" class, this is the
    // object that actually grabs and processes the RSS data

    CXMLDocument *rssParser = [[CXMLDocument alloc] initWithData:responseData options:0 error:nil];
    //CXMLDocument *rssParser = [[CXMLDocument alloc] initWithContentsOfURL:url options:0 error:nil];

    NSLog(@"rssParser %@",rssParser);
    //NSLog(@"url %@",url);

    // Create a new Array object to be used with the looping of the results from the rssParser
    NSArray *resultNodes = NULL;

    // Set the resultNodes Array to contain an object for every instance of an  node in our RSS feed
    resultNodes = [rssParser nodesForXPath:@"//GetImagesResult" error:nil];

    // Loop through the resultNodes to access each items actual data
    for (CXMLElement *resultElement in resultNodes) {

        // Create a temporary MutableDictionary to store the items fields in, which will eventually end up in blogEntries
        NSMutableDictionary *blogItem = [[[NSMutableDictionary alloc] init] autorelease];

        // Create a counter variable as type "int"
        int counter;

        // Loop through the children of the current  node
        for(counter = 0; counter < [resultElement childCount]; counter++) {

            //[resultElement initWithXMLString:@""];
            NSString *strValue = [[resultElement childAtIndex:counter] stringValue];
            //strValue = [strValue stringByReplacingOccurrencesOfString:@"\n" withString:@""];
            NSString *strName = [[resultElement childAtIndex:counter] name];

            if ([resultNodes containsObject:@""] || resultNodes == nil || resultElement == nil || [resultElement isEqual:@""] || [resultElement children] == nil) {

                NSLog(@"Null Object");
            }
            else {

                if (strValue && strName) {

                    // Add each field to the blogItem Dictionary with the node name as key and node value as the value
                    [blogItem setObject:[[resultElement childAtIndex:counter] stringValue] forKey:[[resultElement childAtIndex:counter] name]];
                }
            }
        }

        // Add the blogItem to the global blogEntries Array so that the view can access it.
        [self.rssEntries addObject:[blogItem copy]];

        NSLog(@"RSS Entries %@",self.rssEntries);
    }

    [[rssParser retain] release];
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T20:56:47+00:00Added an answer on May 25, 2026 at 8:56 pm

    Being “unable to parse response” is a very vague description of your problem. However, at first glance I noticed that this XPath query…

    resultNodes = [rssParser nodesForXPath:@"//GetImagesResult" error:nil];
    

    …is most likely not matching any elements and thus returning an empty array.

    Why? Your XML has a namespace. Use nodesForXPath:namespaceMappings:error: method instead of nodesForXPath:error:. The former has an extra parameter that lets you provide a namespace mapping dictionary. Then edit your XPath query accordingly. See the example below:

    NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
                          @"http://tempuri.org/",
                          @"tempuri", 
                          nil];
    
    // Set the resultNodes Array to contain an object for every instance of an  node in our RSS feed
    resultNodes = [rssParser nodesForXPath:@"//tempuri:GetImagesResult" namespaceMappings:dict error:nil];
    

    Also, the last statement of the method is nonsense:

    [[rssParser retain] release];
    

    To balance the alloc-init, it should be:

    [rssParser release];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using restkit and I have problems parsing an xml: Unable to find
I am trying to parse a xml file that i have (using javascript DOM).
I am trying to parse JSON response from a httpwebrequest fetch and a little
My issue is to display file coming from a XML Response on the iPhone
I have an XML response from HTTP POST of this form <PaymentResponse><TransDate>301111</TransDate><TransTime>011505</TransTime><SourceID>0</SourceID><Balance>0</Balance><ResponseCode>06</ResponseCode><ResponseMessage>Error XXXX</ResponseMessage><ApprovalCode>DECL</ApprovalCode><ApprovalAmount>0</ApprovalAmount></PaymentResponse> But
I have this xml feed in Chinese, which NSXLParsers is unable to parse. It
Error: Unable to read data from the transport connection: A blocking operation was interrupted
I am unable to consume messages sent via ActiveMQ from my Flex client. Sending
Why is the compiler unable to infer the correct type for the result from
I am using a gem which uses soap/wsdlDriver. When I post I get back

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.