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
1
vote
1 answer

WCF service, WCF Data Service, Web Api, SignalR? What to use?

I know there might not be one simple answer for this, but i was hoping if somebody can point me in the right direction... We have an ASP.NET webforms application with its own MS SQL database at our company's office, but now we want to show some data…
Jeroen1984
  • 1,616
  • 1
  • 19
  • 32
1
vote
1 answer

System.Net.Http.HttpMethod cannot be serialized, WCF Web API

I am using the HttpClient library to create a WCF Web API. Snippet from service contract: [ServiceContract] public interface IMyService { [WebGet(UriTemplate = "Foo/{id}/{securityKey}/{filename}")] …
Dan
  • 29,100
  • 43
  • 148
  • 207
1
vote
1 answer

How to properly pass stream through rest service to retrieve its length

I'm passing the stream this way: StreamReader sr = new StreamReader(openFileDialog1.FileName); byte[] fileStream = Utility.ReadFully(sr.BaseStream); HttpWebRequest request = (HttpWebRequest)WebRequest.Create(new Uri(baseAddress)); request.Method =…
fiberOptics
  • 6,955
  • 25
  • 70
  • 105
1
vote
3 answers

.net web api updating model on PUT

So I'm trying to update a model. Here's how my models are set up: public class Event{ public int Id {get;set;} public string Name {get;set;} public DateTime Date {get;set;} public int Organizerid {get;set;} public virtual User Organizer…
gdubs
  • 2,724
  • 9
  • 55
  • 102
1
vote
2 answers

.Net Web API SerializationException

I am writing a simple API using .Net's Web API. I have defined the following Model: public class VehicleUpdate { [Required(ErrorMessage = "DealerID Required")] public int DealerID { get; set; } [Required(ErrorMessage = "VIN…
jkruer01
  • 2,175
  • 4
  • 32
  • 57
1
vote
1 answer

Cant use FirstDispositionNameOrDefault after asp.net mvc4 WebApi beta Upgrade

I have just upgraded from WebApi beta to the latest WebApi packages from NuGet. The visual studio project I am using targets .NET 4.0 and not 4.5. I have been able to resolve all issues but one. I am uploading files using Multipart Form via the…
Nosh
  • 485
  • 7
  • 24
1
vote
0 answers

WCF 4.5, WebAPI, or a mix of the two?

Here's my scenario: I'm using .NET 4.5 and creating a WCF Service that will expose sensitive data and will require a username/password to access. Now, I'd like that service to be able to return JSONP as it'll be cross-domain (which is where I'm…
Chris Dixon
  • 9,147
  • 5
  • 36
  • 68
1
vote
1 answer

Custom authorization using WEB API

I've implmented an service using MVC WEB API and i implemented a custom way to authenticate the requests. this is how it looks like: public HttpResponseMessage GetTest() { try { IDBModel DAO = new…
Zoltan Varadi
  • 2,468
  • 2
  • 34
  • 51
1
vote
1 answer

Post large string to Web API controller

I have a following controller public class MyController : ApiController { [HttpPost] public string LoadData(string currentState) { } } I post some data from browser with jQuery.post. The length of the state should be 29915 characters,…
Andrey M.
  • 3,688
  • 3
  • 33
  • 36
0
votes
1 answer

WebAPI: HttpClient response string model binding

How to bind the json/xml response of WebApi to a model type? Like if I have a model User and my api returns list of users in json/xml format then how can I automatically bind the response to List? In WCF client with WebHttpBinding once we…
Abhijit-K
  • 3,569
  • 1
  • 23
  • 31
0
votes
0 answers

wcf hide methods

i visit this post about hide from wsdl , i'v not yet test if its work on wsdl. [ServiceContract] [DeprecatedOperationsWsdlExportExtension] public interface ICalculator{[OperationContract] int Add(int x, int y); [OperationContract] int…
roy.d
  • 1,030
  • 2
  • 16
  • 33
0
votes
2 answers

How do I access my own API from my MVC site?

here's my setup: I have an MVC3 site hosted with a www subdomain (e.g., www.example.com). My site is secured via SSL and forms authentication, backed by ASP.NET membership/role providers. I have HTTP handlers providing service capabilities under…
David Peden
  • 17,596
  • 6
  • 52
  • 72
0
votes
1 answer

HTML serializing issue in WCF Web API to XML and Json

I am using WCF Web API service to publish some data via Json and Xml. But I have a problem with html string to serialize it. for Xml serialize I use XmlMediaTypeFormatter() and for Json serialize I have CustomJSONMediaTypeFormatter class which…
serhads
  • 462
  • 2
  • 7
  • 22
0
votes
1 answer

How do I add a Response Handler to Microsoft.ApplicationServer.Http.HttpConfiguration as part of WCF Web Api?

I've an ASP.NET MVC project, where I use the WCF Web Api (Preview 6), and I want to use this to support a simple JSON service that supports JSONP. The JSON part of the service I got up and running pretty easy, but I've got some problems with the…
PropellerHead
  • 929
  • 1
  • 12
  • 27
0
votes
1 answer

WCF WEB API Client Pure Json: Will the use of MemoryStream cause Performace issuse if used in a API call for large amount of data

I have written the following code to return a different Json Object based on the JobId user is passing. what i wanted to know was whether using MemoryStream in the Function ReturnPureJson cause any performance related issuse in the WCF API calls? …
CostaIvo
  • 1,029
  • 13
  • 19