In this article I will present an easy to understand example when to use Data Contract Known Types, e.g. the KnownTypeAttribute class, to make a WCF Service serialize and a service consumer deserialize types when using inheritance. The MSDN has the complete documentation on this, take a look here: KnownTypeAttribute Class.
In this example I will use a hierarchy of different types of vehicles, e.g. a base vehicle type, a car type, a bike type and a kid’s bike type. I will use WCF 4 (.NET 4), Visual Studio 2010 and the WcfTestClient to test the service.
The great thing with KnownTypeAttribute is that WCF can expose one method supporting all types in a class in a hierarchy.
WCF 4 comes with a bunch of new features where I find the service announcement and service discovery really cool. In this article I will implement a couple of services using these new features.
In a previous article,
The last week I’ve been busy, or shall I say lost in the world of RESTful Services. I have been reading white papers, watching screencasts, trying out the WCF REST Starter Kit on
The other day I wrote about sharing types between web services to simplify implementation of consumers of these services. You can read about it
The other day I got a question from a colleague of mine, regarding the XML schema usage when defining a web service interface, like the one defined in series. The question was something like this: “How will the consumer of the web service react if the, from the XSD file, auto-generated class used as in and return parameters is updated?” I couldn’t give a straight answer, other than that I assumed it would be transparent to the consumer as long as no nodes were changed or removed and only new nodes were added to the schema. I decided to give it a try, using a really simple XSD and a couple of really simple web methods. I will give a schematic picture of the scenario that I will test out later on.
I decided to start the process of creating a web service using an MVC like design pattern by specifying the interface towards the consumers. The interface has to be “nice”, and by that I mean that the parameters and return values should be easy to understand and use.
In this article I will explain how to implement a custom SOAP extension to be able log all incoming and outgoing SOAP messages passing through a .NET web service.