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
6
votes
2 answers

HTTP caching in WCF Web API seems inconsistent across browsers

I'm implementing a simple REST service with the WCF Web API and attempt to set HTTP headers in order to cache responses. For a simple GET like this http://localhost:49302/my/2 the response headers look like this: Server: ASP.NET Development…
Mark Seemann
  • 225,310
  • 48
  • 427
  • 736
6
votes
4 answers

Validating model properties WCF Web APi

I have a set of services hosted with WCF Web Api, what I need to do is validate the properties inside the models of the app. In MVC 3 for example I decorate properties in the model like this: [StringLength(30)] public string UserName { get;…
Daniel
  • 2,484
  • 4
  • 27
  • 35
6
votes
4 answers

C# WCF Web Api 4 MaxReceivedMessageSize

I am using the WCF Web Api 4.0 framework and am running into the maxReceivedMessageSize has exceeded 65,000 error. I've updated my webconfig to look like this but because I am uisng the WCF Web Api I think this isn't even used anymore as I am no…
Luke Belbina
  • 5,708
  • 12
  • 52
  • 75
6
votes
1 answer

WCF Web API UriTemplate Elements Found in Multiple Methods

Let's say I am using the new WCF Web API to build a RESTful service and, in my service, I have a section of the URI that will describe the target resource, but is used on (nearly) all methods of the contract. For example, if I have a User service…
Jim D'Angelo
  • 3,952
  • 3
  • 25
  • 39
6
votes
2 answers

Returning IQueryable but need Raven stats to insert TotalResults header

I have a WebApi method which returns an IQueryable of RavenDB documents. The caller needs to know the number of possible results (because the actual results are limited/paged). So, I have something like this at the end of my WebApi…
Adam
  • 4,159
  • 4
  • 32
  • 53
5
votes
1 answer

Performance of asp.net WebAPI vs. asp.net MVC controller emmiting JSON?

Does anyone know if there are performance benefits from using the WebAPI rather than just using an MVC controller which returns JSON?
UpTheCreek
  • 31,444
  • 34
  • 152
  • 221
5
votes
1 answer

WCF Web Api as a subdomain of an asp.net mvc 3 app?

I have an mvc app running on mydomain.com, and I have added a wcf web api to the web project. I can access the rest service by going to mydomain.com/MyResource but I actually want MyResource to ONLY work if I go to api.myDomain.com/MyResource, and…
nacho10f
  • 5,816
  • 6
  • 42
  • 73
5
votes
1 answer

How to POST a POCO with WCF WebApi's HttpClient

I'm using the WCF WebApi stack (Preview 4) via NuGet (pkg version 0.3.0) and cannot seem to figure out how to "POST a POCO" using HttpClient. Given the following: Public Class MyInfo Public Property MyDate As DateTime Public Property MyId As…
ckittel
  • 6,478
  • 3
  • 41
  • 71
5
votes
4 answers

Set default response type in WCF Web Api

I've a set of services hosted with WCF Web Api and I communicate with them in JSON from javascript. In most cases I'm okay modifying the accepts bit of the header to require a JSON response but there are some cases arising where I can't do this.…
Daniel Revell
  • 8,338
  • 14
  • 57
  • 95
5
votes
3 answers

how would one get methods exposed in a webAPI project?

How can I programatically get a list of public methods w/parameters that are exposed in my webAPI project? I need to provide this list to our QA dept. I dont want to compile and maintain the list myself. I want to provide a link for QA to find the…
sme
  • 75
  • 1
  • 1
  • 6
5
votes
1 answer

What replaced HttpOperationHandler in WCF Web API to ASP.NET Web API

In upgrading an old project that was built using WCF Web API to now use ASP.NET Web API, I have run into a few classes that implement HttpOperationHandler. I'm unable to find an equivalent class in the new assemblies. Does…
Chris Missal
  • 5,987
  • 3
  • 28
  • 46
4
votes
2 answers

Reading custom Content-Type (f.e. StackOverflow) feeds using HttpClient from WebAPI

I like a lot how the HttpClient is architectured - but I can't figure out how to add a "not quite standard" media type to be handled by the XmlSerializer. This code: var cli = new HttpClient(); cli …
Sergey Aldoukhov
  • 22,316
  • 18
  • 72
  • 99
4
votes
2 answers

What is the difference between making calls to mvc controller methods and WCF WEB API Rest Service Calls?

What is the difference between making calls to mvc controller methods and WCF WEB API Rest Service Calls? I can create an mvc controller post method that will allow me to execute any code i need. I can also create a WCF Web API REST Service with…
BentOnCoding
  • 27,307
  • 14
  • 64
  • 92
4
votes
1 answer

WCF/WebAPI: HTTP 500 error when I pass more than one parameter to a WebGet method

I have a very dumb problem but for some reason I am unable to find any cure or information about it on the Net. Summary: I cannot pass to a WebGet method more than one parameter. If I do, server returns HTTP 500 error and the method does not…
Alex Avrutin
  • 1,344
  • 2
  • 17
  • 24
4
votes
4 answers

Can I tell the WCF WebAPI serializer to ignore nested class objects?

I am using WCF WebAPI to write REST services using WCF. I am returning my POCO classes as json/xml objects from my service. Most of my POCO classes contain ICollections as they are part of EF4.1 Code First, hence I get error : Cannot serialize…
Anand
  • 4,523
  • 10
  • 47
  • 72