I am trying to parse response from an OData REST service. When response is in JSON format, it is easy to use ReadAsJsonDataContract
method from WCF REST starter kit
WCF Data Services has a client which can be used to consume the responses and materialize CLR object from those. Take a look at the System.Data.Services.Client.DataServiceContext
class and all related classes.
In fact, in VS you can "Add Service Reference" to your OData services and it will generate client-side classes for the services as well as a derived class from the DataServiceContext
for you to use.
If you already have the client side classes you can use the DataServiceContext.Execute<T>
method to issue any query and materialize its results into the client side types.