Skip to Content
0
Former Member
Oct 06, 2014 at 06:48 AM

Android OData url encoding

49 Views

Hi,

I am trying to use $filter option like this:

GET http://services.odata.org/OData/OData.svc/Products?$filter=Name eq 'Milk'

200 OK

{

"odata.metadata": "http://services.odata.org/OData/OData.svc/$metadata#Products",

"value": [

{

"ID": 1,

"Name": "Milk",

"Description": "Low fat milk",

"ReleaseDate": "1995-10-01T00:00:00",

"DiscontinuedDate": null,

"Rating": 3,

"Price": 3.5

}

]

}

Same from sdk:

String path = URLEncoder.encode("Products?$filter=Name eq 'Milk'", "UTF-8");

ODataResponseSingle response = store.executeReadEntitySet(path, null);

10-06 09:44:18.719: E/AndroidRuntime(7261): FATAL EXCEPTION: Thread-5377

10-06 09:44:18.719: E/AndroidRuntime(7261): java.lang.NullPointerException

10-06 09:44:18.719: E/AndroidRuntime(7261): at com.sap.smp.client.odata.online.PayloadHandler.getHandler(PayloadHandler.java:352)

10-06 09:44:18.719: E/AndroidRuntime(7261): at com.sap.smp.client.odata.online.ODataOnlineStrategyAsync.processResult(ODataOnlineStrategyAsync.java:495)

10-06 09:44:18.719: E/AndroidRuntime(7261): at com.sap.smp.client.odata.online.ODataOnlineStrategyAsync$CommunicationListener.onResponseReceived(ODataOnlineStrategyAsync.java:126)

10-06 09:44:18.719: E/AndroidRuntime(7261): at com.sap.smp.client.httpc.HttpConversationManager$ConversationFlow.processResponse(HttpConversationManager.java:1403)

10-06 09:44:18.719: E/AndroidRuntime(7261): at com.sap.smp.client.httpc.HttpConversationManager$ConversationFlow.run(HttpConversationManager.java:905)

10-06 09:44:18.719: E/AndroidRuntime(7261): at com.sap.smp.client.httpc.HttpConversationManager$DelegatingRunnable.run(HttpConversationManager.java:1934)

10-06 09:44:18.719: E/AndroidRuntime(7261): at java.lang.Thread.run(Thread.java:856)

Anyone else facing this? What I am missing here or is this the bug?