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

How to include Declaration with XElement.ToString()

I am trying to write an XML response for my web service however I can't figure out how to make the declaration appear in the response. My code is like so : StringBuilder sBuilder = new StringBuilder(); using (XmlWriter writer =…
BentOnCoding
  • 27,307
  • 14
  • 64
  • 92
6
votes
3 answers

HttpClient & HttpResponseMessage missing in VS 2010 - its for consume REST services

does anyone know if HttpClient & HttpResponseMessage classes are available in VS 2010? I can't seem to get them to work, do i need to add a reference or using namespace? These classes were originally from the starter kit for REST for Vs 2008... In…
mark smith
  • 20,637
  • 47
  • 135
  • 187
6
votes
4 answers

How to consume WCF REST Service in C#?

My contract details are below. I am using Json response and request format and also using POST method. How to write a client to consume this service in c#. [OperationContract()] [WebInvoke(UriTemplate = "/RESTJson_Sample1_Sample1Add", Method =…
senthil kumar
  • 151
  • 1
  • 2
  • 9
6
votes
1 answer

Access HttpContext inside WCF RequestInterceptor

I am using the WCF REST stater kit to build a plain xml over HTTP service. As part of this Im using a RequestInterceptor to do authentication. Inside of the RequestInterceptor I have access to a System.ServiceModel.Channels.RequestContext object…
Dav Evans
  • 4,031
  • 7
  • 41
  • 60
6
votes
2 answers

WCF REST: What is it expecting my XML to look like in requests?

I have the following method in my WCF service: [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Xml, RequestFormat = WebMessageFormat.Xml)] public int GetOne(string param1,…
Ocelot20
  • 10,510
  • 11
  • 55
  • 96
5
votes
3 answers

SOAP headers in WCF REST error

I have that error : Operation 'GetFields' in contract 'IService' uses a MessageContract that has SOAP headers. SOAP headers are not supported by the None MessageVersion. The problem is that my operation was used by two endpoints : CustomEndpoint…
netmajor
  • 6,507
  • 14
  • 68
  • 100
5
votes
1 answer

How to enable GZip compression in a self-hosted RESTful WCF webservice?

I have a RESTful WCF web service written in C# using .NET 4.0, and I'd like the responses to be compressed using GZip or deflate. (I might need to support compression for requests too, but that is not yet a requirement). It will be deployed as a…
Martin Szabo
  • 146
  • 2
  • 6
5
votes
3 answers

Exception Handling in WCF REST Full Service

I am developing REST Full API using WCF Service 4.5 F/W. Please suggest how to send exception or any business validation messages to client. I am looking for a very generic solution please suggest the best ways of doing it. I have tried some…
SJ Alex
  • 149
  • 3
  • 12
5
votes
1 answer

Built-in way to do Basic Authentication with WCF REST service?

I am using Basic Authentication in my WCF service. And also using ASP Membership provider for authentication. Web.Config: For REST service:
RajeshKannan
  • 894
  • 2
  • 16
  • 32
5
votes
1 answer

Difference between PUT and POST using WCF REST

I have tried to implement a REST WCF in order to explore difference between PUT and POST verb. I have uploded a file in a location using the service. The service implementation is as folowing: [OperationContract] [WebInvoke(UriTemplate =…
techmad
  • 933
  • 2
  • 11
  • 14
4
votes
3 answers

WCF and JSON binding

I am trying to create a wcf service that returns json. I have some problems with my config file and i also don't know how to test it.
sebastian.roibu
  • 2,579
  • 7
  • 37
  • 59
4
votes
2 answers

How does one set the location header to a UriTemplate of another service in WCF 4.0 REST without magic strings?

Consider the following two WCF 4.0 REST services: [ServiceContract] [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)] public class…
bloudraak
  • 5,902
  • 5
  • 37
  • 52
4
votes
1 answer

How to pass the current windows credential to a WCF REST service from a Windows 8 Native app made using JS?

I am trying to call a WCF REST service from my windows 8 app and I'm always prompted for the credential. I have Default Windows Credentials activated in the package manifest and am looking for the equivalent of HttpClientHandler handler = new…
Samarth
  • 69
  • 5
4
votes
1 answer

Requiring SSL certificates and client certificates throws exception in WCF JSON service

I have a simple WCF service setup that uses JSON. In this service I want to use client authentication with a client certificate. I've configured IIS 6 to require SSL and to require client certificates by setting the folder /site/services/wcf/json/.…
Lee Gillen
  • 143
  • 1
  • 9
4
votes
1 answer

Communicating between 2008 SQL Server DB and Android App

I've been doing a lot of reading about this subject and I am now of the conclusion that to communicate between a 2008 SQL Server database and an Android application, I need to create a RESTful Service to sit in between that returns JSON…
user903601
1 2
3
41 42