|
|
This article does not cite any references or sources. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed. (June 2009) |
The Windows Communication Foundation (or WCF), is an application programming interface in the .NET Framework for building connected, service-oriented applications.
Contents |
Overview
Originally code named "Indigo", WCF is one of four APIs introduced with the .NET Framework 3.0, in December 2006. WCF unifies several other communication APIs supported by the .NET Framework 2.0. Previously, separate APIs for SOAP-based communications for maximum interoperability (Web Services), binary-optimized communications between applications running on Windows machines (.NET Remoting), transactional communications (Distributed Transactions), and asynchronous communications (Message Queues) existed. WCF unified all these mechanisms into a single, common, general service-oriented programming model for communications.
WCF can use SOAP messages between two processes, thereby making WCF-based applications interoperable with any other process that communicates via SOAP messages. When a WCF process communicates with a non–WCF process, XML-based encoding is used for the SOAP messages but when it communicates with another WCF process, the SOAP messages can be encoded in an optimized binary format. Both encodings conform to the fundamental information model of XML, the XML Information Set (XML Infoset).
WCF uses a pluggable encoding system, allowing developers to write their own encoders.[1] With the release of the .NET Framework 3.5 in November 2007, Microsoft released an encoder that added support for the JSON serialization format to WCF.[2] This allows WCF service endpoints to service requests from AJAX-powered web pages.
Service oriented architecture
WCF is designed in accordance with Service oriented architecture principles to support Distributed computing where services are consumed by consumers. Clients can consume multiple services and services can be consumed by multiple clients. Services are loosely coupled to each other. Services typically have a WSDL interface which any WCF client can use to consume the service, irrespective of which platform the service is hosted on. WCF implements many advanced web services (WS) standards such as WS-Addressing, WS-ReliableMessaging and WS-Security.
WCF Service
A WCF Service is composed of three parts — a Service class that implements the service to be provided, a host environment to host the service, and one or more endpoints to which clients will connect. All communications with the WCF service happens via the endpoints. The endpoints specify a Contract that defines which methods of the Service class will be accessible via the endpoint; each endpoint may expose a different set of methods. The endpoints also define a binding that specifies how a client will communicate with the service and the address where the endpoint is hosted.
In Windows Vista, Windows Server 2008 and Windows 7 (operating systems that include IIS 7), Windows Activation Services can be used to host the WCF service. Otherwise the WCF service can be hosted in IIS, or it can be self-hosted in any process by using the ServiceHost class, which is provided by WCF. A self-hosted WCF service might be provided by a console-based application, a Windows Forms application, or a Windows service (the Windows counterpart to a daemon), for example.
Defining Endpoints
A WCF client connects to a WCF service via an endpoint. Each Service exposes its Contract via one or more endpoints. An endpoint has an address, which is a URL specifying where the endpoint can be accessed, and binding properties that specify how the data will be transferred.
The mnemonic "ABC" can be used to remember Address / Binding / Contract. Binding specifies what communication protocols are used to access the service, whether security mechanisms are to be used, and the like. WCF includes predefined bindings for most common communication protocols such as SOAP over HTTP, SOAP over TCP, and SOAP over Message Queues etc.
When a client wants to access the service via an endpoint, it not only needs to know the Contract, but it also has to adhere to the binding specified by the endpoint. Thus, both client and server must have compatible endpoints.
Adoption
Microsoft partners are supporting WCF. SAP delivers add-ins to the Visual Studio tool that can generate WCF client-side proxies that connect to SAP Enterprise systems. IBM is producing a WCF Channel for MQ. Microsoft has also delivered The WCF Line of Business Adapter SDK to enable developers to create WCF-based communication connectivity to virtually any external system. The WCF LOB Adapter SDK is what enables JNBridge, for example, to build the JMS Adapter for .NET.
References
- ^ "Custom Encoders". Microsoft. http://msdn2.microsoft.com/en-us/library/ms735115.aspx. Retrieved 2008-04-24.
- ^ "AJAX Integration and JSON Support". Microsoft. http://msdn2.microsoft.com/en-us/library/bb412173.aspx. Retrieved 2008-04-24.
See also
Additional Resources about WCF
- Craig McMurtry, Marc Mercuri, and Nigel Watling: Microsoft Windows Communication Foundation: Hands-On, SAMS Publishing, May 26 2006, ISBN 0-672-32877-1
- Steve Resnick, Richard Crane, Chris Bowen: Essential Windows Communication Foundation (WCF): For .NET Framework 3.5, Addison-Wesley, February 11 2008, ISBN 0-321-44006-4
- Craig McMurtry, Marc Mercuri, Nigel Watling, Matt Winkler: Windows Communication Foundation Unleashed (WCF), Sams Publishing, March 6 2007, ISBN 0-672-32948-4
- Juval Löwy: Programming WCF Services, O'Reilly Media, Inc., February 20, 2007, ISBN 0-596-526997
External links
- Windows Communication Foundation, MSDN Windows Communication Foundation portal.
- Microsoft samples in MSDN, Microsoft's WCF samples web site.
- WCF Security Guide, Microsoft Patterns & Practices - Improving Web Services Security: Scenarios and Implementation Guidance for WCF. Released Aug 1, 2008.
- Understanding WCF Services in Silverlight 2 - In depth explanation of WCF services for Silverlight clients.
- David Chappell: "Introduction to WCF" and "Dealing with Diversity", two papers covering WCF. November 2007.
- "Programming Services" screen cast, Pluralsight
- A Lap Around the Windows Communication Foundation presentation
|
|||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||
This entry is from Wikipedia, the leading user-contributed encyclopedia. It may not have been reviewed by professional editors (see full disclaimer)




