Questions tagged [wcf-rest]

A REST service built with WCF

REST Service built for WCF that contains HTTP specifications for GET, PUT, POST and DELETE as well as other standard REST elements.

MSDN documentation

619 questions
4
votes
4 answers

WCF REST is not returning a Vary response header when media type is negotiated

I have a simple WCF REST service: [ServiceContract] [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)] [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)] public class Service1 { …
vtortola
  • 34,709
  • 29
  • 161
  • 263
4
votes
3 answers

wcf REST Services and JQuery Ajax Post: Method not allowed

Anyone knows what's wrong with this? I cant get the json response from my wcf rest service. Jquery $.ajax({ type: 'POST', url: "http://localhost:8090/UserService/ValidateUser", data: {username: 'newuser', password: 'pwd'}, contentType:…
h3n
  • 5,142
  • 9
  • 46
  • 76
4
votes
2 answers

How to tweak default JSON serializer in WCF REST

WCF REST service works great in a way that it will reply/accept JSON or XML depending on header. I want to tweak built-in JSON serializer a little so it encodes/decodes Byte[] little different. More specifically, I want to use Base64 for that. Is…
katit
  • 17,375
  • 35
  • 128
  • 256
4
votes
3 answers

Why use WCF REST when you have JsonResult in ASP.NET MVC?

I'm building an ASP.NET MVC application and still consider myself new to ASP.NET MVC. I come from a WCF REST background, so I initially set up a number of services that my jQuery-based client would call via RESTful AJAX requests. As I learned more…
David Hoerster
  • 28,421
  • 8
  • 67
  • 102
4
votes
1 answer

Sharing the same port for WCF REST and ASP.NET Web API

I've an existing JSON based service implemented using WCF webhttpbinding. This service is hosted in Windows service. We've implemented SSL as well. Now I'm planning to create new JSON based services using ASP.NET Web API which should be hosted in…
VJAI
  • 32,167
  • 23
  • 102
  • 164
4
votes
3 answers

WCF REST Service Template 40(CS) Cross domain error

Hi I have a WCF Rest service using ( WCF REST Service Template 40(CS)). I have managed to get it to return Json response. It is working fine when the project is run. But when I try to make a Ajaxcall to the service from the browser, I am getting…
Arti
  • 2,993
  • 11
  • 68
  • 121
4
votes
3 answers

Can WCF Restful service allow same method expose as WebGet and WebInvoke?

Can WCF Restful service allow same method expose as WebGet and WebInvoke like method overloading? Both method shoud be accessible from same URL. For Ex. [ServiceContract] public interface IWeChatBOService { [WebGet(UriTemplate =…
Sanjay Rabadiya
  • 478
  • 5
  • 10
4
votes
1 answer

Unable to get property 'appendChild' of undefined or null reference in WCF Rest

I have Developed a WCF Rest Service which returns dateTime. When I Run the Service in IE, Service is breaking and giving exception stating that Unhandled exception at line 82, column 1840 in script block 0x800a138f - JavaScript run time error:…
Karthik Dheeraj
  • 1,039
  • 1
  • 13
  • 25
4
votes
1 answer

WCF Restfull WS post method and HTML form

I have simple .net restful web service published on IIS: [OperationContract] [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, UriTemplate = "formTestGET?firstInput={firstInput}&socondInput={socondInput}")] string…
Milos
  • 1,678
  • 4
  • 23
  • 49
4
votes
2 answers

Error when trying to create json web service in asp.net

I followed this to create a json web service in asp.net 3.5: Creating JSON-enabled WCF services in .NET 3.5 (archive.org) (Was at: http://www.pluralsight.com/community/blogs/fritz/archive/2008/01/31/50121.aspx) It works fine if I want to use it…
Martin
4
votes
2 answers

Cross-platform RESTful WCF method, passing and returning byte array

So simple in theory, but I have never been a wiz at WCF configuration. What I am trying to do is this: I have a WCF method that matches this signature: [OperationContract] [WebInvoke(Method = "POST")] Stream PostPackets(Stream rawPackets); All I…
saml
  • 463
  • 3
  • 14
4
votes
1 answer

WCF REST error HTTP 307

I have a REST WCF service. When a POST attempt is made to this service to an operation as mentioned below, I get the below error: [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "", RequestFormat = WebMessageFormat.Xml, BodyStyle =…
Thomas
  • 1,970
  • 4
  • 28
  • 59
3
votes
2 answers

Uploading an image using WCF RESTFul service full working example

As part of a pretty large application I need to provide a REST Service that uploads an image. Since the whole application is .NET, I've been trying to find an working example of a WCF RESTFul Service that does that but couldn't (Which defines the…
Tomer
  • 4,382
  • 5
  • 38
  • 48
3
votes
1 answer

Can we use [Operationcontract(isOneWay="true")] in WCF REST?

I want to call rest operation from jquery. I don't want to wait for the response, but instead,just confirm that it reached the server(status 202). can I use [operationContarct(isOneWay="true"] in my IService ? Is it as simple as calling any $.ajax…
yoav barnea
  • 5,836
  • 2
  • 22
  • 27
3
votes
2 answers

WCF REST Service: How to make query parameters required and return HTTP 400 on wrong values?

1. Required parameter In the following example URI definition [WebGet(UriTemplate = "GetData?value={value}")] [OperationContract] string GetData(int value); { return string.Format("You entered: {0}, value); } the "value" parameter is optional…
AndiDog
  • 68,631
  • 21
  • 159
  • 205