weboperationcontext

What is the WCF equivalent of HttpContext.Current.Request.RawUrl?

I've got some RESTful services running in a pure WCF context (i.e. ASP.NET compatibility is not enabled, and thus there is no HttpContext.Current object available). The URLs to the services are rewritten at the start of the request using an IHttpModule (which at that point does have an HttpContext and rewrites it using HttpContext.Curre...

How System.ServiceModel.Web.WebOperationContext works when InstanceContextMode is Single?

If my WCF Service has this attribute: [ServiceBehavior( InstanceContextMode = InstanceContextMode.Single, ConcurrencyMode = ConcurrencyMode.Multiple)] How can the following a Singleton work in a call? System.ServiceModel.Web.WebOperationContext.Current ...

WCF 4 REST service can't return a StatusDescription, only StatusCode

I'm currently migrating my WCF RESTful service from .NET 3.5 (Starter Kit) to .NET 4. I started my project using a WCF Rest service template from Visual Studio 2010. I had to figure out how to keep my authorization scheme (formely done with RequestInterceptor) using ServiceAuthorizationManager. After some work and researching I got it do...

Problems with custom exception in WCF Service

I've developed a service using webHttpBinding and i'm having problems with getting the StatusDescription on the client. I'm able to set the StatusCode. I've tried some code i've found through google with no success. This is the errorhandler i'm using: public class ErrorHandlerEx : IErrorHandler { public bool HandleError(Excepti...

WebOperationContext Object reference not set to an instance of an object

When I try to use WebOperationContext.Current in a WCF project, the Current is null. Below is the example. Could anyone please shed a light on it? WebForm - default.aspx: ServiceClient sc = new ServiceClient(); Response.Write(sc.DoWork(1) + "<br />"); WebOperationContext c = WebOperationContext.Current; --Current is null...