You can choose from four main hosting options. The following table provides information about each option
A typical WCF configuration file contains the four elements as the following.
You can use the tools that are provided with Visual Studio 2008 to generate a proxy class. You can instantiate the proxy class and invoke its methods, or you can create a proxy by using the ChannelFactory class.
A client can obtain much of the information that is required to communicate with a service by querying the service metadata. The service metadata describes the WCF service; it includes information about the operations that it exposes and the types that those operations use
For a client application to successfully call a WCF service, the client application must have access to the following items:
When you develop a self-hosted application, such as a Windows service, or an executable file application, your code follows a distinct sequence. The life cycle of a typical self-hosted WCF service includes the following steps:
The separation of concerns is one of the basic tenets of good software design. Taking this approach helps individual software elements remain flexible and maintainable as the overall system develops.
You can host your WCF service in several ways such as in:
To host a service in a managed application, you must create a contract and then implement the service. You must understand the role of the contract and the service implementation to understand how to develop a self-hosted service. The first two rows in the table provide examples of a contract and a service implementation. The last two rows link to code examples for building and configuring your self-hosted service.
Sometimes it is sufficient to start transactions at service boundaries. At other times, you must create client applications (Windows-based applications or other services) that take control of their own transactions.