O'Reilly logo

Pro WCF: Practical Microsoft SOA Implementation by Nishith Pathak, Amit Bahree, Shawn Cicoria, Dennis Mulder, Chris Peiris

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Introducing Data Contracts

Data contracts are the "agreement" between a service and its consumer. At an abstract level, the contract defines how the data will be exchanged between the two and also defines what data is returned for each type (that is, serialized to XML). For a service and its consumer to communicate, they do not necessarily have to share the same types; they need to share only the data contracts. The default serialize engine in WCF is the data contract serializer, which is implemented as the DataContractSerializer class and is the recommended way to go for WCF. All .NET primitive types can be serialized without any other requirement. However, new complex types need to have an associated data contract defined before they can be ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required