Behavior Merge in WCF 4.0 Configuration

One of the brand new configuration features you can find in the Beta 2 release of .NET 4.0 is the ability to merge behaviors in the configuration hierarchy. This should make it easier to manage behaviors when you want a set of common behaviors to be used consistently. To illustrate how this works, let’s say…

4

Separating out WCF Configuration Into Multiple Files with configSource

WCF configuration files can sometimes be very, very long. And there’s a good reason for that too: WCF makes heavy use of configuration so that you can do just about anything you can do with code in a config file. I recently decided to estimate how much of the entire framework’s configuration belongs to WCF…

1

WCF 101: The Simplest WCF Example You’ll Ever See

Every once in a while, I’ll encounter a developer that thinks that WCF is too complicated to use. Whereas in fact, the basics of WCF are incredibly simple. MSDN’s tutorial hides this fact by making their introduction to WCF a fairly long and painful 6-step process, but you need much less to write your first…

7

Beta 2’s out!

Ok, so a bit late, but the Beta 2 release of Visual Studio 2010 was released two weeks ago. With Beta 2 come a number of changes to the DataContractResolver, so I’ve finally found the time to update my previous post. For those that have read the post during Beta 1, ResolveType has become TryResolveType…

0

Serializing Plain Old CLR Object (POCO) types with DataContractSerializer

When version 3.0 of the .NET framework shipped, DataContractSerializer could only support a few categories of CLR types. Sowmy has a good list of these that you can find here. The recommended model was to use DataContractAttributes on classes and structs along with DataMemberAttributes on fields and properties to customize the serialization of types. I…

0

Optimizing Away Repeat XML Namespace Declarations with DataContractSerializer

For performance reasons, DataContractSerializer can’t always figure out what namespaces will be used in a serialized instance ahead of time. And so, you may sometimes end up having a certain XML namespace defined over and over again when it only has to be declared once. This can be particularly painful because XML namespaces tend to…

7

Comparing the Performance of .NET Serializers

The .NET framework comes with a variety of different serializers. Hopefully, my overview of these serializers will have provided some insight into the differences between them and the various advantages and disadvantages of using different serializers. But there are not only great differences in functionality between the serializers, but there are also vast differences in…

11

Setting Configuration Defaults with Nameless Elements in WCF 4

This is my second post about Beta 1 features in WCF 4.0 after introducing the DataContractResolver.   Beta 1 introduces a new way of using WCF configuration. It’s now possible to specify a default for bindings, service behaviors, endpoint behaviors, and standard endpoints.   Here’s a concrete example to illustrate my point. Suppose you have…

0

Customizing the XML for collections with XmlSerializer and DataContractSerializer

One of the most common requests I get about serialization is to explain how to get collections to serialize out one way or another to XML. Specifically, developers are interested in being able to manipulate the hierarchy level of the collection within their XML and the names of the various XML elements. In today’s post,…

2