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
18
votes
4 answers

WCF Web Api vs WebHttpBinding

I'm new to WCF RESTFull services developpment and I'm looking for some usefull information and your experience feedback about using webHttpBinding compared to the new WCF Web API http://wcf.codeplex.com/. What I'm looking for is to know about the…
Tomasz Jaskuλa
  • 15,723
  • 5
  • 46
  • 73
18
votes
3 answers

Can I have both a Controller and an ApiController for the same thing?

I've just started to use the VS 2012 RC, and I'm creating an ASP.NET MVC 4 web application in which I plan to provide both an HTML-based user interface and a WebApi-based programming interface. For my HTML website, I have a controller and view for…
Gary McGill
  • 26,400
  • 25
  • 118
  • 202
17
votes
2 answers

Autofac and IDisposable interface

Assuming that I have the following interface and class: public interface IFooRepo : IDisposable { //... } public FooRepo : IFooRepo { //Methods here //Properly implement the IDisposbale.Dispose() here } I use Autofac as IoC…
tugberk
  • 57,477
  • 67
  • 243
  • 335
16
votes
3 answers

Ajax Post: 405 Method Not Allowed

Within my API Controller called Payment, I have the following method: [HttpPost] public HttpResponseMessage Charge(Payment payment) { var processedPayment = _paymentProcessor.Charge(payment); var response =…
Mike
  • 2,561
  • 7
  • 34
  • 56
15
votes
4 answers

Web API model binding

Given the ASP.NET Web API route: example/{Id} Which maps to the following ApiController action method: public void Example(Model m) { ... } With the model class defined as: public class Model { public int Id { get; set; } public string…
Andrew Davey
  • 5,441
  • 3
  • 43
  • 57
15
votes
1 answer

asmx to WCF or Web API

I have an application that I'm building and for the moment, I built some web services using ASMX. In the end, the application will be deployed on azure. The web services are really simple in that all they do is call a class in the AppCode folder…
frenchie
  • 51,731
  • 109
  • 304
  • 510
13
votes
4 answers

ASP.NET Web Api Routing Customization

I have WebApi controllers that end with the "Api" suffix in their names (For ex: StudentsApiController, InstructorsApiController). I do this to easily differentiate my MVC controllers from WebApi controllers. I want my WebApi routes to look similar…
muruge
  • 4,083
  • 3
  • 38
  • 45
13
votes
4 answers

Removing headers from the response

I need to cloak certain headers generated by ASP.NET and IIS and returned in the responses from a ASP.NET WebAPI service. The headers I need to cloak are: Server X-AspNet-Version X-AspNetMvc-Version X-Powered-By The service was earlier hosted in…
Hendrik W. Hansen
  • 391
  • 1
  • 3
  • 14
12
votes
1 answer

Web API concurrency and scalability

We are faced with the task to convert a REST service based on custom code to Web API. The service has a substantial amount of requests and operates on data that could take some time to load, but once loaded it can be cached and used to serve all of…
Hendrik W. Hansen
  • 391
  • 1
  • 3
  • 14
11
votes
2 answers

Extract contents from HttpResponseMessage

I'm recieving an object of type System.Net.Http.HttpResponseMessage>, how do I get the List? I tried casting the content property and getting a value from the content property via its value property but nothing seems to work. Thanks for…
Nicolas Straub
  • 3,381
  • 6
  • 21
  • 42
11
votes
3 answers

WebApi with EF Code First generates error when having parent child relation

I am breaking my head over this issue. I did find something on the internet about it, but not a clear answer. My problem: I have to classes in Model section of an MVC3 web app: ParentClass and ChildClass On ParentClass there is a property Children…
Mounhim
  • 1,674
  • 1
  • 17
  • 32
11
votes
2 answers

Minimum files needed to deploy webAPI server side

So after a great deal of research I'm starting to enhance our service server stack with a webAPI entry point. Based on this thread, and especially the last post by a member of the Digerati board, we are implementing webAPI services as a facade into…
SASS_Shooter
  • 2,186
  • 19
  • 30
10
votes
3 answers

Working with System.Threading.Tasks.Task instead of Stream

I was using a method like below on the previous versions of WCF Web API: // grab the posted stream Stream stream = request.Content.ContentReadStream; // write it to using (FileStream fileStream = File.Create(fullFileName, (int)stream.Length))…
tugberk
  • 57,477
  • 67
  • 243
  • 335
10
votes
3 answers

PostAsync HttpClient error with Web Api - System.AggregateException "A task was canceled."

I'm trying to call PostAsync method using System.Net.Http.HttpClient from the Web API. I get the following error: System.AggregateException "A task was canceled." Task: Id = 1, Status = System.Threading.Tasks.TaskStatus.Canceled, Method =…
pfeds
  • 2,183
  • 4
  • 32
  • 48
9
votes
1 answer

c# client to consume OData with linq support

ASP.NET MVC4 Beta introduced an easy way to create OData endpoints using WebAPI. So having the following controller: public class ValuesController : ApiController { // GET /api/values public IQueryable Get() { return…
Shaddix
  • 5,901
  • 8
  • 45
  • 86
1
2
3
17 18