Skip to Content
Programming WCF Services, 3rd Edition
book

Programming WCF Services, 3rd Edition

by Juval Lowy
August 2010
Intermediate to advanced
908 pages
26h 22m
English
O'Reilly Media, Inc.
Content preview from Programming WCF Services, 3rd Edition

Context Bindings

With .NET 3.5, WCF gained three additional bindings dedicated to managing custom contexts. These bindings, found in the System.WorkflowServices.dll assembly, are the BasicHttpContextBinding, the NetTcpContextBinding, and the WSHttpContextBinding. The context bindings all derive from their respective regular bindings:

public class BasicHttpContextBinding : BasicHttpBinding
{
   /* Same constructors as BasicHttpBinding */
}

public class NetTcpContextBinding : NetTcpBinding
{
   /* Same constructors as NetTcpBinding */

   public ProtectionLevel ContextProtectionLevel
   {get;set;}
}
public class WSHttpContextBinding : WSHttpBinding
{
   /* Same constructors as WSHttpBinding */

   public ProtectionLevel ContextProtectionLevel
   {get;set;}
}

In the case of the NetTcpContextBinding and the WSHttpContextBinding, the ContextProtectionLevel indicates how to protect the context while in transfer, as discussed in Chapter 10.

The context bindings are used exactly the same way as their base bindings, yet they add support for a dedicated context management protocol. These bindings can be used with or without a context. The context protocol lets you pass as a custom context a collection of strings in the form of pairs of keys and values, stored implicitly in the message headers. There are several important differences between using a context binding and using the direct message headers for passing out-of-band parameters to a custom context:

  • With a context binding, you can only set the information to ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Programming WCF Services, 4th Edition

Programming WCF Services, 4th Edition

Juval Lowy, Michael Montgomery
Programming .NET Security

Programming .NET Security

Adam Freeman, Allen Jones

Publisher Resources

ISBN: 9781449382476Supplemental ContentErrata Page