Questions tagged [wcf-web-api]

The WCF Web API project allows WCF developers to expose their APIs via HTTP. Under ASP.NET MVC4, WCF Web API has become ASP.NET Web API.

The WCF Web API project focuses on allowing WCF developers to expose their APIs for programmatic access over HTTP by browsers and devices. With the release of ASP.NET MVC4, WCF Web API is now ASP.NET Web API.

Project Links:

269 questions
2
votes
1 answer

How to return deep serialized object (with complex type properties) in Asp.Net web api?

I have next classes: public class Event { public int Id { get; set; } public string Title { get; set; } public string Description { get; set; } public List Images { get; set; } } public class ImageLink { public int Id {…
Roman Bats
  • 1,775
  • 3
  • 30
  • 40
2
votes
3 answers

DELETE method .NET WebAPI does not work

I've seen tons of posts about this, but the DELETE method of my new WebAPI simply does not work and returns a 404, using Windows 7 32-bit, IIS 7.5. I've tried Uninstalling WebDAV Adding PUT, DELETE, OPTIONS to the…
Chris Dixon
  • 9,147
  • 5
  • 36
  • 68
2
votes
1 answer

CORS/JSONP with WebAPI Security woes

I'm wondering if there's anyone out there with a simplified resolution for my scenario, I'm out of ideas now. I have a WebAPI service, which I want to be on another domain than my site calling it. This service has been secured, so required Basic…
Chris Dixon
  • 9,147
  • 5
  • 36
  • 68
1
vote
1 answer

WebApi returning wrong status code

I have an operation handler that checks for authentication and throws an exception when authentication fails using throw new WebFaultException(HttpStatusCode.Unauthorized); However this still returns a 404 Not Found status code to the client/test…
Stuart
  • 201
  • 1
  • 11
1
vote
0 answers

HTTPS Web API and Android

I have built a RESTful web service using Microsoft Web API framework. I've been able to test the service from my computer and other computers of my network (using the browser). But when I try to hit my web service from Android, nothing happens.…
hilbert
  • 171
  • 1
  • 5
1
vote
0 answers

WCF WebApi Test Client, does it do anything with the body of a request?

I am writing a RESTful api using WCF Web Api Preview 6. I've just spent most of the day figuring out that it doesn't like "prettified" Json! I have a method which produces "human readable" Json, ie - it spreads the text over multiple lines to make…
Antony Scott
  • 21,690
  • 12
  • 62
  • 94
1
vote
2 answers

IQueryable WebAPI service: why do I need to call .ToList()?

I inherited this code from a developer who left last week. His code is based on the article: "Restful WCF / EF POCO / UnitOfWork / Repository / MEF". This method works (when I browse to http://myapp/myservice/Returns): [WebGet(UriTemplate =…
Merenzo
  • 5,326
  • 4
  • 31
  • 46
1
vote
1 answer

Operation Handler WCF Web Api malfunctionging?

I'm building a web api using WCF web api preview 6, currently I'm stuck with a little problem. I would like to have an operation handler to inject an IPrincipal to the operation in order to determine which user is making the request. I already have…
Daniel
  • 2,484
  • 4
  • 27
  • 35
1
vote
1 answer

Castle Windsor and WCF Web Api Message Handlers

I'm trying to use Castle Windsor to create my message handlers because just using ... MessageHandlers.Add(typeof(MyHandler)); ... doesn't allow me to use constructor injection of other services, for example a logger So, I've create an installer…
Antony Scott
  • 21,690
  • 12
  • 62
  • 94
1
vote
1 answer

ReaderQuota Settings in WCF WebApi

In WCF WebApi (Preview 6), Many of the WCF binding attributes have been moved into the configuration class. For example: var config = new HttpConfiguration {MaxReceivedMessageSize = 250001}; What are the corresponding settings for ?…
Jeff
  • 551
  • 3
  • 8
1
vote
2 answers

WCF WebApi, what is the correct way to handle IsThisTaken query?

I am in the process of writing a WCF webapi application and have a need to check whether an email address is taken or not. This needs to be a query the client-side code can do before attempting a PUT. So, what I'm trying to do is use HEAD in…
Antony Scott
  • 21,690
  • 12
  • 62
  • 94
1
vote
1 answer

WebApi HttpClient help getting collection (version .6)

I am calling on a WCF Data Services v3 Odata service. I am having trouble getting my collection filled in the below example. I am able to get a json string of the 3 people, but if I try and get a custom collection filled, the collection has a count…
Terrence
  • 313
  • 2
  • 12
1
vote
1 answer

Preventing flooding in WCF

I'm using WCF Web API. I want to prevent flooding on method calls. I've limited maxConcurrentCalls to 10. But I need more constraints. For example, if some client calls same method in 3 sec., it must throw an exception about flood call. Also if some…
oruchreis
  • 866
  • 2
  • 12
  • 28
1
vote
1 answer

WCF Web api and complex types with odata

I'm using WCF web api to bui;d a rest service that returns coplex objects from an odata query. Unfortunately, querying complex types doesn't seem to work. E.G. public IQueryable Get() { var people = new List() { …
jwanga
  • 4,166
  • 4
  • 26
  • 27
1
vote
1 answer

Returning 'Allow' Entity Header with HTTPResponseMessage in WCF Web API

I'm trying to return the 'Allow' entity header within the response message and I keep getting the following message: {"The header cannot be added. Make sure to add request headers to HttpRequestMessage, response headers to HttpResponseMessage, and…