Category Archives: WCF

Windows Communication Foundation (part of the Microsoft .NET framework)

WCF error-handling strategies (part 2): Throwing specific fault exceptions

(See WCF error-handling strategies part 1 here) Deciding on the right error-handling strategy for your WCF services and clients can be tricky. But if you’re not 100% clear on exactly what strategy you are using and how it will behave … Continue reading

Posted in C#, WCF

WCF error-handling strategies (part 1): IServiceBehavior and IErrorHandler

Probably the biggest of all cross-cutting concerns is error-handling and logging. Unfortunately, WCF doesn’t seem to have a silver bullet for capturing, logging and suppressing exceptions thrown in the service layer. Ignoring Windsor interceptors for the moment (which deserve a … Continue reading

Posted in C#, WCF

How to avoid changing your WCF service contracts

WCF service contracts are like legal contracts. Once released, they are set in stone and should never be broken. If there are client applications which consume your service and you decide to change one of the operation signatures on the … Continue reading

Posted in Architecture, C#, WCF

Creating a WCF service proxy with ChannelFactory<T>

Before going into the details of using ChannelFactory, if you are not familiar with service proxies (or have used them but don’t understand why they’re important) here’s a little bit of background. When a client application makes a call to … Continue reading

Posted in Architecture, C#, Multi-threading, WCF

Resolving data contracts shared between multiple WCF services with SvcUtil

If you’re using the SvcUtil.exe tool to generate proxies for WCF services, before long you may hit a problem where the same data contract shared between two services results in a compiler error at the client. You could just specify … Continue reading

Posted in WCF

Generating WCF service proxy classes using SvcUtil

There are various ways to make calls to a WCF service from client code but this particular example uses the Microsoft svcutil.exe proxy generation tool. This is most appropriate when you want to consume a third party service and don’t … Continue reading

Posted in Automation, C#, WCF

Keeping domain models and view models separate with ASP.NET MVC and WCF

The location, role and responsibility of objects within a software system is a common topic in the forums with plenty of disagreement about what is and isn’t correct. But first, let’s just define some commonly found objects and their roles: … Continue reading

Posted in Architecture, ASP.NET MVC, WCF