Parse the response from the backend to the device.
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 ODataEntry * entry = [entriesArray objectAtIndex:<(NSUInteger)>] ODataPropertyValueObject *prop = [entry getPropertyValueByPath:@"NAME"]; NSString *value = [prop getValue];
The ODataDataParser detects whether the content is JSON or Atom, and parses the content passed to it.