Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Commented Feature: Support ODataMediaTypeFormatter usage by HttpClient [1140]

$
0
0
My company expects to implement IIS hosted Web APIs that run on app servers. These will be called by IIS hosted web applications that run on web servers.

We can therefore use ApiControllers on the app servers and call them from HttpClient from the web servers. I like this programming model, where we use the same MediaTypeFormatter and extensibility points at both ends of the wire.

We expect to use EntitySetController endpoints wherever we can, for general CRUD operations, using the JSON light format. Then fall back to ApiControllers if we have to - for operations like IN queries that OData doesn't support.

Ideally I'd like to be able to the following. These may need to use different wire formats (maybe JSON.Net and JSON light). However, I don't want to have to use a DataServiceContext to call EntitySetController, since supporting two entirely different client side programming models adds a lot of work.

* Use the HttpClient to talk to an ApiController
* Use the HttpClient to talk to an EntitySetController

I think I'm right in saying that the second case requires the client to use the ODataMediaTypeFormatter, and the client needs to provide an IEdmModel via the HttpRequestMessage.SetEdmModel method. However, I've been unable to get this to work, with various formatter / serialization problems.

If this supported currently, and if so can anyone point me to some sample code? Any help appreciated.
Comments: Hi Gary, this is something we'd like to look into in a future version. In the meantime we recommend using the WCF Data Services client to talk to the Web API OData service. An alternative is to use ODataLib directly, which in the end is what Web API OData uses to implement the OData functionality.

Viewing all articles
Browse latest Browse all 7215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>