RoyZeng / odata4j

Automatically exported from code.google.com/p/odata4j
0 stars 0 forks source link

Exception when parsing result of a Service Operation which returns a collection of Entries #281

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

Use odata4j for parsing the response of the Service Operation 
"GetProductsByRating" of the OData test service.

GET http://services.odata.org/V2/OData/OData.svc/GetProductsByRating?rating=4 
HTTP/1.1

Minimal reproduction example code:
int nbEntriesInResponse = 
ODataJerseyConsumer.newBuilder("http://services.odata.org/V2/OData/OData.svc/").
build().callFunction("GetProductsByRating").pInt32("rating", 
4).execute().count();

What is the expected output? What do you see instead?
Expected to get the number of entries in the response, but got the following 
exception instead "java.lang.RuntimeException: 
java.lang.UnsupportedOperationException: Not supported yet".

What version of the product are you using? On what operating system?
odata4j 0.6

Please provide any additional information below.
When the accepted response format is changed to JSON, the exception message 
changes:

java.lang.RuntimeException: java.lang.IllegalArgumentException: Unable to 
locate format parser for org.odata4j.core.OEntity and format JSON

Minimal reproduction exception code for JSON:
int nbEntriesInResponse = 
ODataJerseyConsumer.newBuilder("http://services.odata.org/V2/OData/OData.svc/").
setFormatType(FormatType.JSON).build().callFunction("GetProductsByRating").pInt3
2("rating", 4).execute().count();

Original issue reported on code.google.com by Linard.V...@tenforce.com on 6 Aug 2014 at 10:05