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
9
votes
3 answers

Could not load type 'System.ServiceModel.Activation.HttpHandler' Version conflict with WCF REST

I've run into a problem with WCF REST Service. I get: Could not load type 'System.ServiceModel.Activation.HttpHandler' from assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. when running inside of the…
Rick Strahl
  • 15,839
  • 13
  • 83
  • 121
9
votes
4 answers

WCF The underlying connection was closed: An unexpected error occurred on a receive

I am using a RestClient app to communicate with my WCF service .and I am getting the following exception The underlying connection was closed: An unexpected error occurred on a receive. This is the C# code I use string q =…
Millar
  • 1,075
  • 5
  • 16
  • 34
9
votes
1 answer

Dynamically assigning json response content-type in WCF Azure Service Bus

I am writing a POC application which uses Microsoft.ServiceBus.dll 1.0.0.0 (the .NET 3.5 version). My WCF contract and service look like the following: [ServiceContract(Name="MyServiceContract", Namespace = "http://mydomain.com/")] internal…
Gavin Osborn
  • 2,542
  • 3
  • 26
  • 42
8
votes
1 answer

JSON.NET Serializer for WCF REST Services

I am trying to use the NETFx Json.NET MediaTypeFormatter nuget package to swap out the default DataContractJsonSerializer in my WCF REST service (4.0 framework). I downloaded the package in my project and added the following lines of code in the…
muruge
  • 3,947
  • 3
  • 36
  • 45
8
votes
7 answers

How to make user login from only one device at a time

I have a RestAPI which when hit authenticate the user. This api is exposed to android and ios developers they hit this api to allow user to login to our app My requirement is this.1) If user has cell phone say abc phone with IMEI "abc1234". He logs…
Learner
  • 1,018
  • 3
  • 12
  • 29
8
votes
2 answers

How to pass and consume a JSON parameter to/with RESTful WCF service?

I am a beginner at RESTful services. I need to create an interface where the client needs to pass up to 9 parameters. I would prefer to pass the parameters as a JSON object. For instance if my JSON is: '{ "age":100, "name":"foo", …
pencilCake
  • 45,443
  • 73
  • 211
  • 346
8
votes
1 answer

Intermittent Connection Reset by Peer errors in Android connecting to .NET REST endpoint

I'm getting intermittent errors from devices connecting to my IIS REST service via SSL. My app works just fine, but sometimes I get this exception. It is handled properly and does not bring down app.. ut I wonder what does it mean and if there any…
katit
  • 15,901
  • 32
  • 116
  • 238
7
votes
2 answers

Sending Post request to RESTful WCF with json

I have tried every combination to send a request to send a POST request to RESTful WCF from jQuery. Can someone imitate and make it working. Code is here : http://pastebin.com/Ua97919C I am working with WCF from past 2 years, but every time i send…
iMatoria
  • 1,410
  • 2
  • 19
  • 35
7
votes
4 answers

WCF 4.0 REST username password authentication

I have been struggling with username/password authentication/authorization in a WCF 4.0 RESTfull service using the ASP.Net membership/role providers. Having spent two days trying to find something that most people agree on, I gave up. A lot of…
NVM
  • 5,146
  • 4
  • 38
  • 58
7
votes
1 answer

DataContractJsonSerializer DateTime implicit timezone conversion

I have a date time in the database and I retrieve it from the database using Entity Framework, I then pass out the data via JSON API through the DataContractJsonSerializer. The time in the date time field appears to have been adjusted according to…
krisdyson
  • 3,165
  • 7
  • 41
  • 84
7
votes
2 answers

Get Client IP address using WCF 4.5 RemoteEndpointMessageProperty in load balancing situation

I have hosted WCF 4.5 Restful service in IIS and I am trying to use RemoteEndpointMessageProperty to get the IP address of the client who consumes the service. Code 1: private string GetClientIP() { OperationContext context =…
RGS
  • 4,825
  • 4
  • 29
  • 52
7
votes
1 answer

What is the difference between RequestInterceptor and MessageInspector?

I have two queries here :- 1) What is the basic difference between Microsoft.ServiceModel.Web.RequestInterceptor and System.ServiceModel.Dispatcher.DispatchRuntime.MessageInspectors (IdispatchMessageInterceptor) Both appears to be Request/Message…
Anil Purswani
  • 1,757
  • 6
  • 28
  • 60
7
votes
3 answers

How can I pass JSON as well as File to REST API in JAVA?

My main question is how can I pass JSON as well as File to post request to REST API? What needs in Spring framework to work as client and wait for response by passing post with JSON and File? Options: Do I need to use FileRepresentation with…
Kunal Shah
  • 181
  • 12
7
votes
1 answer

Call WCF Resfull methods with using OAUTH 2.0

I am looking for any article or forum thread, where I could find information how to make oauth 2.0 authentication. Especially I have MVC 3 application and WCF Restfull API. And I have to call API methods from web app with using oauth 2.0 protocol…
Yara
  • 4,063
  • 6
  • 38
  • 60
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
  • 23,888
  • 10
  • 59
  • 92
1
2
3
41 42