1

I've been using the following code to create my android OData service consumer.

Services = ODataConsumer
           .newBuilder("http://xxx.xxx.xxx.xxx:xxxxx/WCFDataServices.svc/")
           .setFormatType(FormatType.JSON).build();

What I want to know is when the client makes a request through the Services consumer will the request make the server create a JSON formatted response or will the OData4j/consumer convert the response to JSON format.

Thanks in advance for the help. :)

Hessi-Dude
  • 61
  • 3
  • 10

2 Answers2

0

It requests a JSON response from the server using the Accept request header. It does no conversion.

See: http://code.google.com/p/odata4j/source/browse/odata4j-jersey/src/main/java/org/odata4j/jersey/consumer/ODataJerseyClient.java#175

Hope that helps,
- john

John Spurlock
  • 1,723
  • 1
  • 13
  • 12
0

Odata defalut format is ATOM. If you want you can change it to JSON, as you already doing.

"FormatType.JSON"

OData4j/consumer APIs are responsible to convert the response type whatever format you have defined.