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

WCF WebApi Enabling OData query support

I followed Getting started with WCF Web API. Everything works well and it supports some of the operators like ?$filter=Name eq 'Ajay' ?$top=4 But when I try other queries like $filter=substringof('Ajay', Name) OR $filter=length(Name) gt 5 It…
Ajay Bhosale
  • 1,872
  • 24
  • 35
2
votes
4 answers

C# WCF Web API + JSONP

Is there an easy way to get JSONP working for the new WCF Web API rest services? I've tried this with no luck
Chris Kolenko
  • 1,020
  • 17
  • 32
2
votes
1 answer

MVC 3 WCF Rest Service In Partial Trust

I have created a MVC 3 WCF Rest project using the tutorial described here. The only problem is that am able to run the project and access the rest api when the application is running at high trust level but when i change the trust level to medium i…
user437329
2
votes
1 answer

Wcf Web APi OData

I have recently discovered OData & the new WCF Web APi library on codeplex. The web api allows me to expose results as IQueryable, which allows me to expose URL's in the OData format. Myn question is what is the difference between this and a regular…
MikeRay1
  • 108
  • 7
2
votes
1 answer

How does WCF WebApi map a request URI to the appropriate service type / operation?

How does WCF REST (and WCF WebApi) map a Uri to the correct service endpoint? Within the context of WCF WebApi Preview 4: Inside a custom delegating channel, I would like to find the associated route prefix or service Type based on the incoming…
Daniel
  • 1,843
  • 2
  • 18
  • 27
2
votes
1 answer

WCF WebApi's Self-Hosting not accepting PUT verbs

I have put together a HTTP driven API using the WCF WebAPI that uses the PUT verb. When hosted inside of an MVC3 project that is hosted upon IIS Express, everything works as designed. However, when I unit-test I'm occasionally wanting to test the…
Ray Hayes
  • 14,896
  • 8
  • 53
  • 78
2
votes
6 answers

WCF Web API RESTful is not allowed by Access-Control-Allow-Origin

Seems like I have a cross domain access problem. I've seen some solutions that are indicating to add "Access-Control-Allow-Origin: *", but I don't know where I can do this. Do I need to create some handler? I'm using WCF Web API. Error:…
aumanets
  • 3,703
  • 8
  • 39
  • 59
2
votes
2 answers

WCF REST Web API and MVC on same server and port

I'm looking at putting together a REST based system which still has a standard browser style access. My desire is to have both of these on the same machine, but what are my options? Use IIS to host both the web-site and the REST service (different…
Ray Hayes
  • 14,896
  • 8
  • 53
  • 78
2
votes
2 answers

Uploading files WCF Web API Endpoint

Is there any way to upload a file to WCF web API endpoint? If so, how can I access Network Stream to read data? Any help is very much appreciated. Thanks.
aumanets
  • 3,703
  • 8
  • 39
  • 59
2
votes
1 answer

Passing current authentication credentials from UWP app to web service to access resources on server with these credentials

My Windows 10 UWP app is calling a WebAPI web service that I have created. I need to pass the current credentials on the client side when calling the web service so that it can access other resources using these credentials. I also need to do this…
slayernoah
  • 4,382
  • 11
  • 42
  • 73
2
votes
1 answer

How should i return data in Web API Controller Methods?

I have a UI that needs lots of information. Most of the information has been identified as separate entities in database. For example, displaying the details of an Employee. The UI page might be Employee details with various sections regarding…
2
votes
1 answer

How to work with [Required] attribute & Model State Validation within Web Api Put

Currently I am facing, a problem, when try to call Web Api put method from MVC Api Client, lets describe my code structure bellow Test Model (Web Api end) public sealed class Test { [Required] public int Id { get; set; } …
Shubhajyoti Ghosh
  • 1,292
  • 5
  • 27
  • 45
2
votes
1 answer

ChannelFactory with Json.Net formatter

I have a web api rest service set up and can use the httpclient + json.net formatter to use it without any problems. But i want to implement this usage with a channel factory and replace the default json serializer there with json.net…
Looooooka
  • 99
  • 1
  • 3
2
votes
0 answers

MVC Web API POST request not working from client application but working from chrome Postman extension

I have a web API service with the controller as follows. RoutePrefix("api/Product")] public class ProductController : ApiController { [HttpPost] [POST("InsertProduct")] public HttpResponseMessage InsertProduct(ProductDetail product) …
2
votes
1 answer

Attribute routing not working

I'm new with attribute routing with aspnet web api. public class UsersController : ApiController { [GET("users/me/brands/{id}")] public IEnumerable GetBrands(long id) { return _repository.FindByUser(id); } } but I…
Thiago Custodio
  • 17,332
  • 6
  • 45
  • 90