Last week I developed a mini-class on an introduction to Windows Communication Foundation (WCF) for engineers at Microsoft. One of the hardest parts about WCF is not so much the technology, but rather understanding exactly what WCF is. One way to think of WCF is as a generalization of Web Services. Let me explain. Suppose you have a normal Web Service which contains Web Methods which expose some proprietary data in a SQL database (think book information for example). In a normal Web Service scenario, a client program (usually Internet Explorer) makes a request for book information using SOAP over HTTP to a Web Server which in turn queries the Web Service which is usually being hosted by IIS. The Web Service fetches the requested data and returns the data to the client using SOAP over HTTP. Well in some sense WCF takes this model and gives you options at every step of the way. The basic idea is the same: a client requests data from a server using SOAP and the data is returned using SOAP. But the WCF requesting client can be IE or any kind of program. WCF uses SOAP but the SOAP message can ride on HTTP or any kind of protocol. The WCF server can be hosted in IIS or any kind of service. Additionally, compared to Web Services, WCF gives you additional features such as transactions and enhanced reliability. The screenshot below shows a WCF demo from the training class I created.
So how do you test WCF systems? One the one hand you are still dealing with a request-response type of scenario so testing WCF systems is similar to testing Web Services. But because there are so many variables in a WCF system, your testing effort will be significantly more complex.