tags:

views:

48

answers:

2

Hello,

I am just a beginner in i-phone development and right now i am developing one facebook application. thing is that i need to fetch data from webservice where data is in such format :

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap:Body>

<abc1>string</abc1>
<abc2>string</abc2>
<abc3>string</abc3>

</soap:Body>
</soap:Envelope>

where abc is a variable from which i need to fetch data.problem comes here,i am not aware how to fetch data from this using either json or xml.

Can anybody help me out please??

Thank you in advance.

A: 

Why dont you try web service connectivity tools like,

KSoap WSClient++ etc

Akash Kava
Thank you for the response but i don't have much knowledge about such tools,still let me try for that.also i forgot to mention that i am able to make connection by passing url but it results into the above format itself,so can't fetch data from the desired variable.any idea?
also is there any way to convert that stuff into json format,it makes easy to fetch data.
These tools are very easy to use, you give them the url, they will generate the code that has to be included in the project and you can connect it easily. It will create corresponding objects quite easily. Parsing is quite complicated in objective-c
Akash Kava
+1  A: 

You may try to use TouchXML

CXMLDocument *theXMLDocument = [[[CXMLDocument alloc] initWithXMLString:yourXMLString options:0 error:&theError] autorelease]; 

NSArray *theNodes = NULL;

theNodes = [theXMLDocument nodesForXPath:@"//root" error:&theError];
for (CXMLElement *theElement in theNodes)
{
   theNodes = [theElement nodesForXPath:@"./abc" error:NULL];
   NSLog(@"%@", theNodes);
}
vodkhang