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

620 questions
111
votes
10 answers

Cannot set content-type to 'application/json' in jQuery.ajax

When I have this code $.ajax({ type: 'POST', //contentType: "application/json", url: 'http://localhost:16329/Hello', data: { name: 'norm' }, dataType: 'json' }); in Fiddler I can see following raw request POST…
Vitalii Korsakov
  • 38,491
  • 18
  • 68
  • 85
100
votes
6 answers

Can we create custom HTTP Status codes?

I have a REST and WCF service and want to send a custom status code based on the operation. For example when some validation fails then I want to send HTTP 444 and when authorization fails I want to send HTTP 455 The question is how do we have it…
Rajesh
  • 7,381
  • 5
  • 19
  • 34
37
votes
5 answers

jQuery .ajax() POST Request throws 405 (Method Not Allowed) on RESTful WCF

I am sending a post request to a RESTFUL WCF service application. I am able to successfully send a POST request through Fiddler. However when I do this through the jQuery Ajax method the function returns the following to the Chrome Developer…
Brandon Davis
  • 705
  • 1
  • 6
  • 12
20
votes
4 answers

CORS Support within WCF REST Services

I have a WCF REST service hosted within a Windows service and I would like to send the Access-Control-Allow-Origin HTTP header (defined as part of CORS) with every response. My attempted solution was to have something like the following within an…
Kevin
  • 7,234
  • 4
  • 25
  • 30
20
votes
3 answers

RESTful services: WCF versus ASP.NET MVC

A very common approach to implementing RESTful services is by utilizing ASP.NET MVC to do so over WCF. ASP.NET MVC has excellent RESTful support by via flexible URL routing and flexible HTTP Method mapping to controller actions. WCF 4.0 now has…
16
votes
3 answers

WCF REST Service not visible in WCFTestClient

I have successfully configured 3 endpoints for my prototype service. The endpoints are basicHttpBinding, wsHttpBinding, and webHttpBinding. The only glitch I have at the moment is in the WCFTestClient. When I point it to my service it lists the…
codedog
  • 2,368
  • 9
  • 36
  • 65
14
votes
2 answers

ServiceHost only supports class service types

I have a service named WcfService2 (original i know) which has an IService.cs file with a public interface: namespace WcfService2 { [ServiceContract] public interface IService1 { [OperationContract] …
G Gr
  • 5,756
  • 20
  • 83
  • 176
14
votes
3 answers

WCF Error : Relative end point addresses

Um quite new to WCF . I think I have messed up a bit. So this is what I did so far and I ve hosted my WCF service in IIS First the Contracts using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using…
co2f2e
  • 15,562
  • 16
  • 60
  • 109
12
votes
1 answer

Difference between wcf restful services and WEB API

I am query for a long time now.Where exactly we need to use WEB API and where should we use WCF restful services. What ever we want to achieve in WEB API we are able to achieve in WCF Rest. I tried to dig into answers but i got we need to do extra…
abhijit
  • 187
  • 1
  • 1
  • 11
12
votes
1 answer

Difference between WebOperationContext.current and HttpContext.Current

I develop web and mobile applications for my customers. In my current architecture, many resources are shared between the web access and mobile access. An aspx page can be shown on web and be called to a web view in a mobile app. My question is…
tdelepine
  • 1,916
  • 11
  • 18
12
votes
2 answers

Implementing DotNetOpenAuth (oAuth2) for WCF (Rest Service) Framework 4.0

I have created a WCF API (Rest Services) and I would like to implement the protocol for authentication oAuth 2. I know that this library DotNetOpenAuth is very useful for implement oAuth2 for WebApi but I havent seen any documentation or examples…
JosMen
  • 333
  • 3
  • 10
11
votes
2 answers

RESTful WCF wrapping json response with method name

I am pretty new to RESTful WCF services so bear with me. I am trying to build a simple RESTful WCF service that returns a List of Students as json response. All works well until the point where I try to convert the json string back to list of…
Vinod
  • 909
  • 1
  • 15
  • 38
11
votes
4 answers

Transaction in REST WCF service

We are having a REST WCF service. we want the save operation on this REST service to be in transaction. Is there a way to pass Transaction object over the wire to REST WCF service?
Balaji
  • 1,979
  • 5
  • 24
  • 33
11
votes
1 answer

ASP.NET Web Api (REST): Authentication using the users credentials or a token? Leave "Register new user" resource password free?

I am trying to create a REST service using asp.net web api and everything is working fine but I have now come across what to do with authentication. I am a little confused of where to start, here is what I have been thinking. I have an REST api that…
Martin
  • 22,234
  • 53
  • 190
  • 309
9
votes
1 answer

Customize the WebHttp Help Output in WCF

For a service with webHttpBinding and helpEnabled="true", the help information is getting generated properly. Was wondering if it is possible to control the output somehow. Below are the changes I would like to make. Remove the JSON help as the…
fozylet
  • 1,231
  • 1
  • 13
  • 24
1
2 3
41 42