Proxy Bypassing Behavior

The HTTP transport and binding element have three settings for controlling the proxy behavior. public bool BypassProxyOnLocal { get; set; }public Uri ProxyAddress { get; set; }public bool UseDefaultWebProxy { get; set; } UseDefaultWebProxy controls whether manual proxy settings are used or whether the automatically-configured system proxy settings are used. ProxyAddress is how you manually…


Format for Configuring HTTP and TCP Activation

IIS uses some inscrutable strings to configure the activatable bindings of a web site. Here’s the minimum you need to interpret a binding and get started working with activation. Activation is controlled by the activationHost.config file. In the list of web sites, each site has a binding section that contains the list of supported protocols….


Controlling the Synchronization Context

The synchronization context is invisible state that flows around making sure that the proper threading model is being used with requests. Windows Forms applications, for example, require that calls be made on a particular thread and the synchronization context makes sure that that thread marshalling takes place. Rarely though, you need to manually intervene in…


Mixing Message Contract Attributes

What’s wrong with the following code? The error message when you try this is better than it used to be a few months ago. However, since you don’t see the error until you try to run your service, I still see people making this mistake. [MessageContract]public class MyMessage{ [MessageBodyMember] public string name;}[ServiceContract]public interface IService{ [OperationContract]…


Dangers of Application Domain Recycling

Secure calls to a hosted service are intermittently failing with the following error message: An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail. The inner exception looks like this: The message could not be processed. This is most likely because the action…


Tuning Service Throttles

The first step in tuning a service is figuring out which throttles should be adjusted. The default throttle values for WCF are extremely conservative out of the box, meaning that you almost always will be tuning throttle values upwards. This also means that you can get a lot of information from running your service with…


Getting the Client’s Password

I’m writing a middle-tier service that needs to act as the client. I can get the user name from the client credentials but the password isn’t available. How do I get the client’s password? Most reputable security systems never give the service access to the client’s password. What they do give the service is the…


Slight Style Change

During the server upgrade a while back, there was a settings change that caused wide content to get cut off rather than displaying scroll bars. There pretty frequently are some long lines in the code samples that won’t fit on the average display. I guess they were trying to encourage everyone to go out and…


Light Week Coming Up

Due to the holidays, there will be no posts on Thursday or Friday of next week. There will be posts Monday through Wednesday, but I may not always be approving/responding to comments or answering email until the week after.


Building a Secure Composite Duplex

I’m getting this error message even though I have security enabled for my service: Unhandled Exception: System.InvalidOperationException: The response message must be protected. This is required by an operation of the contract (‘ICalculator’, ‘http://Microsoft.ServiceModel.Samples’). The protection must be provided by the binding (‘CustomBinding’, ‘’). This is sometimes a symptom of incorrect layering between security and…