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
2
votes
1 answer

WebOperationContext.Current.OutgoingResponse.StatusCode is not working

In WCF REST API I would like to set own StatusCode for some reason - WebOperationContext.Current.OutgoingResponse.StatusCode = HttpStatusCode.Forbidden (or any other statuscode) it doesn't work at all as in the client end : - using…
Anil Purswani
  • 1,857
  • 6
  • 35
  • 63
2
votes
1 answer

Bind List with dynamically returned columns

I am writing WCF service. The output of my sql query will return me different no of columns everytime based on table selected. I bind the result of sql query to my list. Now i dont know how do i bind list with dynamically returned columns. Here is…
DevelopmentIsMyPassion
  • 3,541
  • 4
  • 34
  • 60
2
votes
1 answer

Unexplained performance difference between WCF rest vs SOAP webservice

We are exploring whether it is worth it to switch from SOAP webservices to REST. I have created a REST webservice with the following info: [ServiceContract] public interface IRestServiceImpl { [OperationContract] [WebInvoke(Method =…
ptn77
  • 567
  • 3
  • 8
  • 23
2
votes
1 answer

Deploying WCF Rest webservice to IIS 6.0 gives HTTP Error 404 - File or directory not found

I have a WCF rest webservice that runs fine on my local VS2010 environment, but when deployed to IIS 6.0 on windows server 2003, I get the HTTP Error 404 - File or directory not found. I've searched other threads with similar questions and tried all…
ptn77
  • 567
  • 3
  • 8
  • 23
2
votes
2 answers

How do I get a DataMemberAttribute use a boolean type

I have a simple test app that pulls an xml doc from a rest interface. The data element has a couple of string fields and a couple of boolean fields. I creates a simple entity class and put a DataContractAttribute on it and then added…
MikeD
  • 923
  • 4
  • 12
  • 24
2
votes
1 answer

WCF Rest WebFaultException always return 202

When I have an exception in my code I want to return it as a FaultException/WebFaultException depending on if it is REST or SOAP. The following problem is with a REST component of my project. The Exception is triggered, I see it in my debug window…
guiomie
  • 4,988
  • 6
  • 37
  • 67
2
votes
0 answers

Error 405 - HTTP verb used to access this page is not allowed for asmx service and WCF Rest service

We have deployed web services at http://mobile.example.com. This location has both .asmx services and WCF REST services and both these have been working great for last many days. Since yesterday we are getting error "HTTP verb used to access this…
dotcoder
  • 2,828
  • 10
  • 34
  • 50
2
votes
1 answer

In WCF can I have a wildcard character in a literal segment of my UriTemplate?

I am authoring a RESTful WCF service using .Net 4.0. I want the following two URLS: /root/document/{ids}?fields={fields} /root/externaldocument/{ids}?fields={fields} to map to the same interface member: Documents GetDocuments(string ids, string…
Joe Alfano
  • 10,149
  • 6
  • 29
  • 40
2
votes
1 answer

RestSharp Usage

Recently I was using RestSharp to consume my Restful Resouce. and expected exchanging data with JSon between server and client. Below is my C# code. var client = new RestSharp.RestClient(); var request = new…
Joe.wang
  • 11,537
  • 25
  • 103
  • 180
2
votes
1 answer

unable to get json response coming from REST web service in html using jQuery

I have a JSON response coming from REST web service and want to bind that data to html using jQuery. Looks like its not even hitting web service url which I have provided in my jquery. Url is working fine which gives me JSON data in browser but…
rajcool111
  • 657
  • 4
  • 14
  • 36
2
votes
1 answer

Change Content-Type of WebFaultException

I have a WCF REST service whose interface methods are annotated with [WebGet(..., ResponseFormat = WebMessageFormat.Json)] and normally provide JSON-formatted responses. Right now the code indicates errors with: throw new…
jtb
  • 889
  • 11
  • 27
2
votes
1 answer

Implement Restful WCF OData Service

I've implemented a WCF OData Service in my project. Right now I need to my services return JsonResult for my clients. How can I implement Restful WCF OData Service? Or is there any alternative approach to return JsonResult in my services?
user1318951
2
votes
1 answer

Passing parameters to WCF restful service with POST method

how can I use Fiddler to pass 2 parameters to a method with a signature like this : [WebInvoke(UriTemplate = "Login", Method = "POST", ResponseFormat = WebMessageFormat.Xml, BodyStyle = WebMessageBodyStyle.WrappedRequest)] bool…
Hamza_L
  • 644
  • 4
  • 18
2
votes
1 answer

Inject repository into ServiceAuthorizationManager using Unity

I would like to inject a repository (using unity) to an ServiceAuthorizationManager implementation. Is it possible? public class APIKeyAuthorization : ServiceAuthorizationManager { private readonly IKeysService _keysService; …
Gui Ferreira
  • 4,367
  • 6
  • 28
  • 41
2
votes
2 answers

How to consume a web services end point through c#

I want to make a get request to the following end point through C#. http://api.example.com/1/companies/{id} I was looking at WCF rest starter kit and wonder there are other ways to make get requests easily than installing rest starter kit. Please…
Joshua
  • 2,275
  • 7
  • 41
  • 57