Skip to Content
avatar image
Former Member

HELP: iOS SUP OData SDK - SDMParser

Hi,

This is my first time dealing with iOS SUP OData SDK. I build the apps based on the How To guides from SDN.

I had finished build the Model and Data class in SAP, and the gateway service is working fine. I can post the url in my browser and get the response back with expected XML.

Now, I am building an iOS app, which will post the same URL back to SAP, and receive the XML. I am using the SUP OData SDK for iOS, the developer guide is available here: http://infocenter.sybase.com/help/topic/com.sybase.infocenter.dc01708.0210/doc/html/nkr1311702599475.html

The app is post the URL with the SDMConnectivity component, via HTTPRequest, and the connection to the SAP is working fine, and the expected service document XML is getting correctly. The next thing I need to do is, by parse the service document xml and converts it to an objective c service document object. I do the parsing with SDMParse component.The problem is arise here.

1. I am following the guide, to parse the service documents xml with these code:

SDMODataServiceDocument* sdmParseODataServiceDocumentXML(NSData* const cont_in);
 self.serviceDocument = sdmParseODataServiceDocumentXML([self.httpRequest responseData]);

2. The error occur after execute the second line of code, the error shown in the console is:

2011-12-29 18:21:31.412 OData_SUP_1[4032:15203] +[NSString isNullOrEmpty:]: unrecognized selector sent to class 0x17c9c3c
2011-12-29 18:21:31.414 OData_SUP_1[4032:15203] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSString isNullOrEmpty:]: unrecognized selector sent to class 0x17c9c3c'
*** First throw call stack:
(0xaeb062 0x39add0a 0xaecaed 0xa51f10 0xa51cf2 0x4091d 0x3a8fb 0x3b29b 0x3ba88 0x27731 0x1652672 0x4548b37 0x454edab 0x1650e0d 0x270f0 0x27b2d 0x2817a 0x3859 0xc802c6 0xc81196 0xc90033 0xc90ae8 0xc84399 0x1facfa9 0xabf1d5 0xa24042 0xa2292a 0xa21dd4 0xa21ceb 0xc80b97 0xc8238b 0x34f0 0x2d15 0x1)
terminate called throwing an exception

Then, I had stuck in this error for whole day. I can't debug the source code because the SDK do not provide the implementation file. I had try my best imagination to guess what's went wrong, but I can't solve it. I had even check convert the Data that I received from [self.httpRequest responseData] into XML, and compare it with the result from Browser and Guides, nothing looks wrong.

Do anyone experience this issue before? Or you can advice me what I can do in Xcode to get better understanding regarding the error I got?

Thanks in advance for your help.

Regards,

Edison Wang

Edited by: Hsin Yoong Wang on Dec 29, 2011 11:55 AM

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Jan 02, 2012 at 01:34 PM

    Hi all,

    I had resolved this problem. The problem due to I did a mistake in the XCode, in the Other Linker Flag field.

    I should fill in "ObjC -all_load" but I miss out a space, "ObjC-all_load", then all this problem arise.

    Thank you.

    Regards,

    Edison Wang

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 10, 2012 at 10:48 AM

    Hi,

    I am trying to consume a Odata Service from my Native Android Application.

    I am following the same steps as described in OData SDK Document.

    By Default, SDMConnectivity component is performing SUP Request. I need to change this to use HTTP/HTTPS Request for my Android Application. I couldnot find the way to do this, from the OData SDK.

    For iOS Applicaiton, this is done using setRequest/SDMHTTPRequest. Any idea, how the same is achieved for Android application ?

    Regards

    Elavarasan S

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 09, 2012 at 07:19 AM

    Hi Wang,

    I have some problem in using SDM parser , i cant figure out how i should use the SDMParser APIs to parse my XML. i followed the infocenter document and i have completed the first 2 steps.

    1.Converting XML service document to Objective-c Document.

    2.I am able to get the oData schema also.

    But when i am trying to do the third step

    NSMutableArray sdmParseODataEntriesXML(NSData* const content_in, const SDMODataEntitySchema* const entitySchema, const SDMODataServiceDocument* const serviceDocument)

    what are all the argument i need to pass.Particularly for SDMOdataEntitySchema.

    Please help me to solve this issue. If you can please provide me the steps what you have followed to parse the XML and convert those values to the Dictionaries or Arrays.

    Thanks in Advance.

    Add comment
    10|10000 characters needed characters exceeded