ASP.NET Web API is a framework for building HTTP services for clients like browsers and mobile devices. It is based on the Microsoft .NET Framework and ideal choice for building RESTful services.
4
votes
0answers
468 views
Asp.Net Web API Error: The 'ObjectContent`1' type failed to serialize the response body for content type 'application/xml; charset=utf-8'
Simplest example of this, I get a collection and try to output it via Web API:
// GET api/items
public IEnumerable<Item> Get()
{
return MyContext.Items.ToList();
}
And I get the error:
...
3
votes
0answers
370 views
Async WebApi ActionFilterAttribute. An asynchronous module or handler completed while an asynchronous operation was still pending
I understand await waits for a task (an awaitable) to complete.
But I'm confused about what that actually means.
The code that doesn't work:
public async override void ...
3
votes
0answers
214 views
Generating version specific help documentation pages for ASP.NET Web API application
I am using the WebAPI Versioning package to version my API by the X-Api-Header by using the "VersionHeaderVersionedControllerSelector". I am also using the Microsoft.AspNet.WebApi.HelpPage to ...
3
votes
0answers
196 views
Required to install asp.net (“Application Server”) when deploying WebApi to server 2012?
I'm new to WebAPI in .Net 4.5. Probably my question is an FAQ, but I couldn't find how to solve it:
Do I need to add the application server role in addition to IIS to have an IIS hosted WebApi ...
3
votes
0answers
590 views
Entity Framework Composite Foreign Key and Navigational Property not being populated in entity during an Include
There are two entities pointing to a legacy database, the main entity should take in the secondary entity using an Include and eager load the data. Unfortunately, the entity comes up null even though ...
2
votes
0answers
21 views
How to use a Database Generated Identity Key in Web Api OData
I've managed to create number of readonly Web Api OData services following the tutorials here: http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api. I'm therefore employing the ...
2
votes
0answers
99 views
Web API as a Proxy and Chunked Transfer Encoding
I have been playing around with using Web API (Web Host) as a proxy server and have run into an issue with how my Web API proxy handles responses with the "Transfer-Encoding: chunked" header.
When ...
2
votes
0answers
75 views
ASP.MVC: Does JsonValueProviderFactory work with querystring variables?
Back in the day of ASP.NET MVC 3, I used JsonValueProviderFactory as per Phil Haack's Blog to bind JSON data as a Query String parameter to a strongly typed parameter.
Today, I find this isn't ...
2
votes
0answers
181 views
Missing request.CreateResponse in vb.net Webapi Projects
I seem to have tracked down the problem but do not know how to fix it, or if I can.
When I create a new C# WebAPI project, and add an import for System.Net.Http I can access
...
2
votes
0answers
50 views
Patterns for handling scheduled/unscheduled downtime using ServiceStack and WebApi
Now that we have webservices running, we need to make changes to db, servers etc. so ..
wondering if there are any patterns for handling planned and unplanned downtime using ServiceStack and also ...
2
votes
0answers
80 views
How to control JSON.NET serialization of System.Data.Spatial.DbGeometry
I have a DB First Entity Framework 5 Data Access Layer that is mapped to a table containing a SQL geometry type field called CenterCoordinate. The resulting entity contains this:
public ...
2
votes
0answers
87 views
How does JSON.NET serialize objects when using EF table-per-hierarchy?
I'm using Entity Framework Code First table-per-hierarchy in my ASP.NET Web API project. One of my models has a List that is of the type of the abstract base class of the hierarchy.
List<Dog> ...
2
votes
0answers
370 views
.Net Web API No HTTP resource was found that matches the request URI
I am working on .Net Web API which is working fine in debug as well as on localhost IIS but when i publish this to server it starts giving following error :-
"Message": "No HTTP resource was found ...
2
votes
0answers
35 views
Contextual serialization from WebApi endpoint based on permissions
I am using the Asp.Net Web Api. I would like to be able to filter out certain fields on the response objects based on the connected clients access rights.
Example:
class Foo
{
...
2
votes
0answers
115 views
Multiple actions were found that match the request (GET)
I am defining 2 GET methods in my controller, one named "Favorites", and another simply named "Get". In my routes, I specifically map different URL routes to these 2 different methods.
However, when ...