on 02-24-2012 3:46 PM
Hello all,
I'm trying to parse the XML data in xCode to objC objects.
responseData and responseString are filled with correct data from GW.
executing the command:
[svcDocParser parse: respData];
following error occurs:
Terminating app due to uncaught exception 'SMDParserException', reason: 'NotAServiceDocument'
serverUrl = @"http://<server.domain>:Port/sap/opu/sdata/Name/MOBILE/mobileCollection?$filter=type%20EQ%20'G'%20and%20userid%20EQ%20'USERID'&sap-client=060&$format=xml";
request = [SDMRequestBuilder requestWithURL:[NSURL URLWithString:serverUrl]];
[request setRequestMethod:@"GET"];
[request setUsername:bname.text];
[request setPassword:passwort.text];
[request addRequestHeader:@"Accept" value:@"application/atom+xml"];
[request addRequestHeader:@"Content-Type" value:@"application/atom+xml;type=entry"];
[request addRequestHeader:@"X-Requested-With" value:@"SAPDataLibrary-ObjC"];
[request startSynchronous];
NSData* respData = [request responseData];
SDMODataServiceDocument* sdmParseODataServiceDocumentXML(NSData* const content_in);
SDMODataServiceDocumentParser* svcDocParser = [[SDMODataServiceDocumentParser alloc] init];
[svcDocParser parse: respData];
SDMODataServiceDocument *serviceDocument= svcDocParser.serviceDocument;
SDMODataCollection *collection = [serviceDocument.schema getCollectionByName:@"AccountCollection"];
NSArray *entries = sdmParseODataEntriesXML([request responseData],collection.entitySchema,serviceDocument);
NSMutableArray *properties = [NSMutableArray array];
int ArrayIndex = -1;
for (SDMODataEntry *entry in entries)
{
NSDictionary *dict = entry.fields; ArrayIndex = ArrayIndex + 1 ;
[properties insertObject:dict atIndex:ArrayIndex];
}
self.MyProperties = properties;
Could someone help me?
Thanks a lot and kind regards,
Alexander
Hi Alex
I have the same problem, did you solve it? how could you did that?
thanx
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.