Messaging is an essential element of distributed systems. For components and services to communicate across process and machine boundaries, the messaging between those components and services must be compatible or at least understood by their respective runtime environments. Messaging is usually compatible in one of these three ways: if communicating platforms are compatible; if there is an adapter that understands both platforms well enough to convert messages; or, if messages conform to a standard supported by both platforms. Considering the last statement, years ago XML made it possible to describe messages with schema, and shortly afterward web services introduced a way to generate platform-neutral messaging with Simple Object Access Protocol (SOAP), with a programmatically consumable contract described in Web Services Description Language (WSDL). Since then, advanced web services standards have continued to evolve supplying XML conformance specifications for things like security, attachments and reliability through specifications like OASIS Web Services Security (WSS), WS-Trust, WS-SecureConversation, SAML, MTOM, and WS-ReliableMessaging.
Windows Communication Foundation (WCF, formerly known as Indigo) is built upon the foundation of web services messaging and related standards, while at the same time makes it possible to serialize messages in a more compact binary format, or in a more proprietary way. Still, the core message can always be represented in XML, therefore be considered compatible with any platform that understands XML, and agrees on the contract that defines said messaging between systems.
There are many approaches to building service contracts with WCF including different approaches to code-first and contract-first design. You get to pick your approach based on what you have to work with, and that’s where the thrust of this article is. How do you decide if code-first is for you? What approaches to contract-first exist? And, what are we still missing?
|