Parsing the Data

Parse the response from the backend to the device.

Retrieving the Response from Backend

Based on the data request sent to the backend, retrieve the data as a response to the device:

//Parse the service document
ODataServiceDocumentParser *svcDocParser = [[ODataServiceDocumentParser alloc] init];
NSData *svc = [serviceDocRequest responseData];
[svcDocParser parse: svc];
ODataServiceDocument *serviceDocument = svcDocParser.serviceDocument;

//Parse the metadata document
NSData *metadata = [metadataRequest responseData];
ODataSchema *schema1 = ParseODataSchemaXML(metadata,serviceDocument);

//Parse the entries
NSData *entriesData = [entriesRequest responseData];
//Get the array of objects of type ODataEntry
NSMutableArray *entriesArray = ParseODataEntriesXML(entriesData, schema1,self.serviceDocument); 

Accessing Properties of ODataEntry

The code snippet explains how to access properties of ODataEntry.
 //Accessing properties of ODataEntry
 ODataEntry * entry = [entriesArray objectAtIndex:<(NSUInteger)>]
 ODataPropertyValueObject *prop = [entry getPropertyValueByPath:@"NAME"];
 NSString *value = [prop getValue];   

JSON Parser

The ODataDataParser detects whether the content is JSON or Atom, and parses the content passed to it.