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 6000009
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:37:57+00:00 2026-05-23T00:37:57+00:00

I am trying to parse thE following string that i receive from my WebService

  • 0

I am trying to parse thE following string that i receive from my WebService using SOAP..
Since i am not able to parse the data i receive from my web service( of which i have no idea why.. please take a look here parsing XML using Soap Web Services) i am converting the data to an NSString and then using TOUCHXML to parse the string

NSString *theXML = [[NSString alloc] 
                    initWithBytes: [webData mutableBytes] 
                    length:[webData length] 
                    encoding:NSUTF8StringEncoding];

the string that i get is

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">

<s:Body>

<GetCategoryResponse xmlns="http://tempuri.org/">

<GetCategoryResult>

<Root>

<Record>

<catid>1</catid><catname>Hi</catname><catlogo>http://10.25.4.49/monsoonstore/Category/50X50.GIF</catlogo>

</Record>

</Root>

</GetCategoryResult>

</GetCategoryResponse>

</s:Body>

</s:Envelope>

since i am not able to get any parser to read the NSData i get from webservice i convert the above string to the following (ie. the exact xml i needed)

<Root><Record><catid>1</catid><catname>Hi</catname><catlogo>http://10.25.4.49/monsoonstore/Category/50X50.GIF</catlogo></Record></Root>

CXMLDocument *doc = [[CXMLDocument alloc] initWithXMLString:check options:0 error:nil];



  NSArray *items = [doc nodesForXPath:@"//Root" error:nil];




for (CXMLElement *item in items) 

{


NSLog(@"Root");

    NSArray *titles = [item elementsForName:@"Record"];

for(CXMLElement *title in titles) 
{
    NSLog(@"Record");

     break;
}

 NSArray *categories = [item elementsForName:@"catid"];

    for(CXMLElement *category in categories)
    {
        NSLog(@"catid");

        break;
    }


NSArray *artists = [item elementsForName:@"catname"];

    for(CXMLElement *artist in artists) 
    {
        NSLog(@"catname");

        break;
        }
.
.
.
.

The Root and Record logs get called while the catid never gets called.. what am i possibly doing wrong??

  • 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-23T00:37:58+00:00Added an answer on May 23, 2026 at 12:37 am

    I think you are searching catid under records (and not under root) So change

     NSArray *categories = [item elementsForName:@"catid"];
    

    to

    NSArray *categories = [titles elementsForName:@"catid"];
    

    I mean, search element catid under records, not under root.

    My above code could give you compile error, as i havent worked on TouchXML, but you know what i mean.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to parse the following JSON string remotely: [{name:Object1,data:[1,2]},{name:Object2,data:[3,4]}] I am doing
I am trying to parse data from a xml web service but I am
I have the following HTML that I'm trying to parse using the HTML Agility
I am trying to parse the following using Dom parser in Android. <offerURL> http://statTest.dealtime.com/DealFrame/DealFrame.cmp?bm=553&BEFID=93767&aon=%5E1&MerchantID=434524&crawler_id=1909400&dealId=TCk4NTG97Aa3wSQgh2U3FQ%3D%3D&url=http%3A%2F%2Frover.ebay.com%2Frover%2F1%2F707-64686-24023-0%2F2%3Fipn%3Dpsmain%26icep_item_id%3D190622592957%26icep_vectorid%3D260601%26kwid%3D1%26mtid%3D637%26crlp%3D1_260601%26kw%3D%7Bquery%7D%26query%3D%7Bquery%7D%26linkin_id%3D%7Blinkin_id%7D%26sortbid%3D%7Bbidamount%7D%26fitem%3D190622592957%26mt_id%3D637&linkin_id=7000251&Issdt=120323134700&searchID=p2.77722a731149145f60fa&DealName=Samsung+B2100+Outdoor+In+Schwarz+%28black%29+Orig.+Neuware&dlprc=89.95&crn=&istrsmrc=1&isathrsl=0&AR=1&NG=3&NDP=6&PN=1&ST=7&DB=sdcprod&MT=phx-pkadu-intl-dc20&FPT=DSP&NDS=&NMS=&MRS=&PD=95929320&brnId=14863&IsFtr=0&IsSmart=0&DMT=&op=&CM=&DlLng=7&RR=1&cid=&semid1=&semid2=&IsLps=0&CC=0&SL=0&FS=1&code=&acode=538&category=&HasLink=&frameId=&ND=&MN=&PT=&prjID=&GR=&lnkId=&VK=
So I'm trying to parse the following XML document with C#, using System.XML: <root
I'm trying to parse a title from the following piece of html: Website (Newton)
I am trying to parse the json values from the following stream: {id: tag:search.xxxxx.com,2005:xxxxxxxxxxx}
I am trying to get a webpage to parse using the following code. <var-def
I am trying to parse an XMl document that i received into a string
Currently I am trying to parse an xml string that I already have (no

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.