WCF

WCF – Cross-machine semaphore with WCF

Came across an interesting question on StackOverflow on how one might be able to throttle the number of requests across multiple servers running the same WCF service. So for instance, if you have 3 servers sitting behind a load balancer and for one reason or another you can only allow 5 requests to be made …

WCF – Cross-machine semaphore with WCF Read More »

WCF – Be ware of the field ordering when using DataContractSerializer

One of the less known aspect of the DataContractSerializer is its dependency on the order in which fields are serialized and deserialized. As this article points out, the basic rules for ordering include: If a data contract type is a part of an inheritance hierarchy, data members of its base types are always first in …

WCF – Be ware of the field ordering when using DataContractSerializer Read More »

WCF – Data Contract version round-tripping using IExtensibleDataObject

With WCF, provided that you’re using the DataContractSerializer and not the NetDataContractSerializer, you have a certain degree of protection against data contract changes from the client’s perspective. Existing contracts will still work if existing members are not removed from the data contract, which means you are free to add new members to the data contract …

WCF – Data Contract version round-tripping using IExtensibleDataObject Read More »

WCF – Using the NetDataContractSerializer to share your type

DataContractSerializer For those of your who are familiar with WCF you would no doubt know about the DataContractSerializer class, the DataContractSerializer does not include the CLR type information in the serialized XML, which allows for loose coupling between the client and server because they don’t have to share the same CLR types. However, this also …

WCF – Using the NetDataContractSerializer to share your type Read More »

.Net Tips – Use Request and Response objects

We’ve all been there before, write a simple service with a simple method: As time goes by, the simple method gets more complicated, and the list of parameters grows and eventually simple method is overloaded to provide more variety and simple method is simple no more! A simple solution to this is the Request-Response pattern, …

.Net Tips – Use Request and Response objects Read More »

WCF – Improve performance with greater concurrency

As good and innovative as WCF is, it also introduced a lot of new complexities and whilst it is easy to get something up and running quickly it takes much more understanding to make your service perform as well as it could. There are many things you need to consider such as binding types, serialization …

WCF – Improve performance with greater concurrency Read More »

.Net Tips – Using custom ServiceThrottlingAttribute to specify WCF service throttling behaviour

If you have created a WCF service in the past then I assume you’re aware that WCF is very heavily configuration-driven and that you can specify the service behaviour including the throttling parameters (MaxConcurrentCalls, MaxConcurrentInstances, MaxConcurrentSessions) in the config file. But to specify the type of service (PerCall, PerSession or Singleton) you need to apply …

.Net Tips – Using custom ServiceThrottlingAttribute to specify WCF service throttling behaviour Read More »

.Net Tips – using configSource or file attribute to externalize config sections

There’s a little known attribute which was introduced in the .Net framework 2.0 called configSource, which allows you to externalize sections of the configuration file. It works just like the optional file attribute found on the appSettings element: <appSettings file = “relative file name” /> but can be added to any configuration section to specify …

.Net Tips – using configSource or file attribute to externalize config sections Read More »

DataContract Serialization by Reference using the IsReference Property

I came across this blog post the other day which introduced to me a cool addition to the DataContract serializer – the ability to generate XML by reference rather than by value: http://www.zamd.net/2008/05/20/DataContractSerializerAndIsReferenceProperty.aspx Not much for me to add to it really, just read the blog to see how it works.

Dealing with Circular References in WCF

Using entity classes in your application and WCF is complaining about the circular references between your classes? Well, I had the exact same problem not long ago, and I found this post on James Kovac’s blog about circular references and how to get around them: http://www.jameskovacs.com/blog/GoingAroundInCirclesWithWCF.aspx The key things to note from this post is …

Dealing with Circular References in WCF Read More »

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close