webhttpbinding

Limiting access to a WCF REST (webHttpBinding) Service using the ASP.NET Membership Provider?

I have found a lot of material on the web about using the ASP.NET Membership Provider with the wsHttpBindings, but I haven't seen any reference to using it with webHttpBindings. I am looking for a system that will work in two scenarios: The user is logged into an asp.net website and the website is making calls to the service. The user...

How to enable webHttp connection in WCF?

Hi, I am developing a solution for transfering data from android phone to the server (written in C#/.NET). I created a WCF service and testing with emulator everything worked fine. Then when I tried to login from mobile phone (connected to home wifi network) I got the following exception message: org.apache.http.conn.HttpHostConnec...

How do you pass user credentials from WebClient to a WCF REST service?

I am trying to expose a WCT REST service and only users with valid username and password would be able to access it. The username and password are stored in a SQL database. Here is the service contract: public interface IDataService { [OperationContract] [WebGet(ResponseFormat = WebMessageFormat.Json)] byte[] GetData(doubl...

WCF consuming multiple possible REST responses

I've recently started reading about the WebHttpBinding usage in WCF and being able to consume REST services, however, I've been stumped on this one for a bit now. I'm writing a service that makes a single request to a given api, however, can return one of many responses. For example, the generic response: <ActualResponse> <ResponseIte...

What is the syntax that should be used for WebMessageBodyStyle.Wrapped?

I can't find any documentation on the syntax for a HttpWebRequest wrapped body. ...

Is it possible to use ASP.NET MembershipProvider/RoleProvider in self-hosted WCF services?

I am trying to use custom ASP.NET MembershipProvider and RoleProvider to handle security for my service. The service is self-hosted in a console app, not in IIS. I use webHttpBinding with Basic Authentication. I configured serviceCredentials and serviceAuthorization to use providers. Providers really get initialized. But WCF seems to ig...

how to make WCF webHttp behaviour accept HEAD verbs?

I have a WCF service hosted in a Windows service. I've added to it a webHttpBinding with a webHttp behaviour and whenever I send it a GET request I get http 200 which is what I want, problem is I get an http 405 whenever I send it a HEAD request. Is there a way to make it return http 200 also for HEAD? Is that even possible? edit: that...

Unable to set maxReceivedMessageSize through web.config

Hello there, I have now investigated the 400 - BadRequest code for the last two hours. A lot of sugestions goes towards ensuring the bindingConfiguration attribute is set correctly, and in my case, it is. Now, I need YOUR help before destroying the building i am in :-) I run a WCF RestFull service (very lightweight, using this resourc...

WCF WebHttpBinding Testing Tool

I'm developing WCF RESTful Services and looking for a testing tool/invoker for calling these services without writing client code. Can anybody refer me to a tool for invoking RESTful services especially services using the WCF WebHttpBinding? ...

WebHttpBinding Security Question

Hi, I have created a RESTful Service and implemented the Authentication. It accepts username and password and then grants access to the service requested. It Works fine. Now I want to use SSL on top of my Service. For this I Created Certificate, Then In IIS I gave the required settings. But my service is not working. I am using webHttp...

In WCF, for a webHttpBinding, how do I specify credentials in the client side web.config when the server is using basic authentication?

Hello, I have two WCF RESTful services - the "general" service is public and has no security; the "admin" service I intend to use basic authentication over SSL. This is my server side web.config: <system.serviceModel> <bindings> <webHttpBinding> <binding name="general" maxReceivedMessageSize="2147483647"> ...

Is it possible to make a webHttpBinding WCF service to answer binary?

I implemented this contract [OperationContract] [WebGet(UriTemplate = "{parameter}", BodyStyle= WebMessageBodyStyle.Bare)] byte[] Operation(string parameter); But, when I called the implementation, all I got was something like this: <base64Binary xmlns="http://schemas.microsoft.com/2003/10/Serialization/"&gt;dGVzdA==&lt;/base64Binary...

Http Headers enconding problem in self-hosted webHttpBinding service

I have a webHttp file upload/download service. The file name might have non-ascii characters. First, I tried our service on IIS. Upload/Download worked well for small files. To handle large files I needed wcf streaming which is no supported on IIS. So I moved to console host. Now there was a surprise. IIS sends HTTP-headers as they are i...

WCF Call Passing a Null Parameter

I have a WebHttpBinding WCF service that I am calling. My first POST method send the object correctly, but subsequent calls to POST methods are passing null for the object. Here is my service: public void Update(ObjectDTO objectDTO) { string token = WebOperationContext.Current != null ? WebOperationContext.Current.IncomingRequest.He...

Adding a service reference to a WCF service with webHttpBinding and security mode Transport results in an incorrect config file.

I have searched and searched and I cannot find a solution. It seems like it would be relatively common to run into this... WCF REST service over https. When I add the service reference all of the proxy classes are correct and I can create the objects defined in the service, call the services, etc. However, I can't create a configured ...

WebHttpBinding: Log all errors to service logfile

I have a self-hosted WCF service that uses a WebHttpBinding. In the implementation of the service, all exceptions are caught and a appropriate message is returned to the caller. All exceptions are also logged to the service logfile. catch (Exception ex) { _log.Error("Error posting message", ex); WebOperat...

WcfRestContrib: Is there any example of using a WCF REST service (with basic authentication) from a desktop client

Is there any example of using a WCF REST service with basic HTTP authentication from a desktop client? I am using WCF REST Contrib. and authentication works fine when a use a javascript client from the browser, but when I try to use a C# Console app. I get a BasicUnauthorizedException {"You have unsuccessfully attempted to access a secu...

BasicHttpBinding vs wsHttpBinding vs WebHttpBinding

Dear Devs I need a comparisons chart of above 3 mentioned bindings in terms of features and performance. i have seen some between ws and basic but i need web as well. Please if anyone has link to any article please share i have tried google but no gain yet. ...

How to work with POST/GET request variables (eg arrays) in C# WCF webhttpbinding?

How to work with POST/GET request variables (eg arrays) in C# WCF webhttpbinding? Tutorials, articles with code samples wanted, specialy for arrays. ...

Is it possible to create sessions (like php sessions) with C# WCF WebHttpBinding?

Is it possible to create sessions with C# WCF WebHttpBinding? (Something like like php sessions with cookies and so on) ...