WebChannelFactory inside a WCF Service

When using a WebChannelFactory inside a WCF service that already has an OperationContext, you may need to create a new context before being able to successfully callout using a channel created by the WebChannelFactory. (Notice the line in bold) public class RelationService : IRelationService {   public Relation[] GetRelations()   {     var factory =…

7

How to consume REST services with WCF

As you are probably aware by now, Windows Communication Foundation (WCF) 3.5 introduced a new binding called WebHttpBinding to create and to consume REST based services. If you are new to the WCF Web Programming model then see here for more details. There have been many articles and blogs on how to host a RESTful…

30

WCF error handling and some best practices

I put together the following brief description of WCF Error Handling and some possible best practices for a customer. You may also find it useful:   There are 4 sets of errors that clients can expect:   Invalid configuration: when bindings, behaviors or any other configs are in conflict with some other settings. Communication errors:…

11

From Exceptions to Faults

A question that I often get asked during workshops on WCF is “Why does WCF use Faults instead of .NET Exceptions?” Exceptions expose a set of limitations and possible security risks: –          They are platform/technology specific: .NET exceptions may have no meaning on other platforms –          Exceptions can cause tight-coupling between clients and service. o  …

5

WCF, WPF and Visual Studio 2008 in action – Student Canvas Sample

As part of my job as an Application Development Consultant (ADC) at Microsoft, I usually deliver talks on new technologies for different audiences. I am giving a talk on WCF next week and decided to put together a user friendly demo showing some of the capabilities of WCF. In this demo, both the service and…

2

WCF Authentication: Custom Username and Password Validator

There are a number of authentication techniques supported by WCF. For instance Windows Authentication, X509 Certificates, Issued Tokens, and Username and Password are all mechanisms that can be used for authentication. These client credential types are configured as part of the binding configuration for an endpoint. For example the config section below customises the netTcpBinding…

33

Customising WCF Proxy Generation in Visual Studio 2008

I was asked today how easy it is to hook into the WCF client proxy generation process in Visual Studio 2008. The answer is “It is very easy”. Visual Studio has this great extensibility point that allows third-parties to create “Custom Tools” for specific files. One of the properties that is accessible to you for…

16

WCF Tools

WCF provides a number of tools that make it easier to create, deploy, and administer WCF applications. Tool Name Description COM+ Service Model Configuration Tool (ComSvcConfig.exe) This is a utility used to configure service model integration for COM+ applications. Using this tool you can expose an interface within your COM+ component as a WCF web…

0