Brian Noyes presented on Window Communication Foundation (WCF) to the Capitol .NET User Group. He said that WCF is designed around services orientation. I asked if services orientation was the same as SOA and Noyes replied not necessarily, adding that there was some debate on the precise definition of SOA.
Noyes listed the needs of a services oriented world: the need to connect clients to back-end services, the need to be decoupled from the specific service technology/calling patterns, and the need to support distributed system capabilities (service hosting, instance management, reliability, async communications, transactions, and security).
WCF is a framework for connecting distributed applications. It is part of .NET 3.0 and enables building SOA applications. WCF implements Web Security (WS) standards. It has a single API that supports .NET remoting, asp.NET web services, enterprise services & communications, and MSMQ.
.NET has messaging systems at its core, SOAP messages (not necessarily XML/Text). Clients and services communicate through endpoints. Endpoints consist of address (where), binding (how), and contract (what).
Noyes compared it to a phone call: the number to be dialed (address), the language and grammar & syntax (binding), and what you are going to say (contract).
He walked through the WCF address process: the location of a web service, that is, the URL (protocol, server domain, port, and service URI (optional). For example, you could have multiple logical services off of the same port.
Noyes compared WCF Bindings elements to Lego blocks. He described bindings as the brains of communications, encapsulating what happens on the wire. Bindings determine the wire level protocol, communications patterns, message format, security, transactions, and reliability. Bindings can be extracted out of code and put into config.
Noyes characterized bindings as “SOAP on a wire.” WCF defines nine standard bindings. They are compatible with: Basic, TCP, Peer TCP, Named Pipe, and Web Security (WS). Noyes said the bindings were pre-configured but can be tweaked. Standard bindings can be customized, or developers can define custom bindings.
A member of the audience asked, “What is card space?” Noyes replied that it was a new identity subsystem, which can manage multiple passwords, user name/password, WSSy, and DIME.
Noyes described the kinds of WCF Contracts: services contracts (operations exposed by the service), data contracts (what data is passed through the service operations), message contracts, and fault contracts.
He explained that service contracts are defined as an attribute of Type via .NET interface. The .NET interface can go down to the WSDC level but doesn’t have to. For security reasons, nothing is exposed unless specified; the default settings are all set to “opt in.” (This suggests to this observer that Microsoft has finally internalized the necessity of building security into its software.)
To implement a service type, implement a service contract interface. This does not require WCF specifics for basic communication. Clients are connected via a WCF proxy, and the proxy exposes service contract methods. Passing data is based on data contracts; best practice is to define data contracts for custom types used in the service contract. (My notes indicate using SPUtil to implement data contracts.)
Noyes said that interoperability is mostly addressed through message contracts.
He ended the presentation with a brief overview of WCF’s advanced capabilities: asynchronous calls, call back, sessions (Noyes indicated this doesn’t go well with transactions), security, reliability, queuing, transactions, and peer to peer.
Connecting Applications with WCF - Slides and demos
WCF Master Class
A Developers Guide to Deploying Windows Forms Applications by Brian Noyes