Blue Theme Orange Theme Green Theme Red Theme
 
Home | Forums | Videos | Photos | Downloads | Blogs | E-Books | Interviews | Jobs | Beginners | Training
 | Consulting  
Submit an Article Submit a Blog 
 Login Close
User Id:
Password:
 
Forgot Password
Forgot Username
Why Register
 Jump to
Skip Navigation Links
TechnologyExpand Technology
WebsiteExpand Website
 Resources  
Close
 Our Network  
Close
Search :       Advanced Search »
Home » .NET 3.0/3.5 » Introduction to Windows Communication Foundation

Introduction to Windows Communication Foundation

This paper is intended to present the fundamental concepts of Windows Communication Foundation as the new programming model for service-oriented development. Windows Communication Foundation (WCF) is Microsoft’s unified programming model for building service-oriented applications.

Author Rank:
Technologies: .NET Compact Framework, .NET 1.0/1.1, Web Services, XML,Visual C# .NET
Total downloads :
Total page views :  30168
Rating :
 3.2/5
This article has been rated :  5 times
   Print Read/Post comments Post a comment  Rate  
   Email to a friend  Bookmark  Similar Articles  Author's other articles  
 
Become a Sponsor



Introduction.

Windows Communication Foundation (WCF) is Microsoft's unified programming model for building service-oriented applications.  It enables developers to build secure, reliable, transacted solutions that interoperate with applications in different platforms.

Interoperability is the fundamental characteristic of WCF. The fundamental communication mechanism is based on Web Services specifications such as SOAP, XML, XSD, WSDL and newly established standards including the WS-* protocols. These specifications address several areas, including basic messaging, security, reliability, transactions, and working with a service's metadata.

WCF relies on WS-Policy and WS-Metadata Exchange to discover information about the communications partners. Reliable communication is essential for most situations (no duplicates messages), and WS-Reliable Messaging would be used to interact with many of the other applications in this scenario. WS-Security and the related specifications might also be used for establishing a secure channel. The specifications support the main security services such as authentication, integrity and confidentiality. WS-Atomic Transaction is very important for managing transactional context involving several transactional resources.

The key point is that WCF implements interoperable Web services, complete with cross-platform security, reliability, transactions, and other services. It also is transport neutral, protocol neutral, and format neutral. For example, services are free to make use of HTTP, TCP, named pipes, and any other transport mechanisms for which there is an implementation. It is possible the WCF-to-WCF communication to be optimized, but all other communication uses standard Web services protocols.

The architecture.

The architecture is based on layers. See on Figure 1.

Figure 1.

This architecture permits programmers to work at several levels. High-level programming leverages the service runtime and doesn't require developers to directly work with messages at all, unless they want to. At the other end of the spectrum, developers can program to the messaging layer and take charge of communication activities.

Contracts

Contracts define various aspects of the message system. The data contract describes how every business object to be on the wire is going to be persisted using XML. The message contract defines specific message parts (header and body) using SOAP protocols, and allows finer-grained control over parts of the message. The service contract specifies the actual method signatures of the service. The policy and binding contracts enable you to specify transport, security details, and other aspects that must be met in order to communicate with a service.

Service Runtime

The service runtime manages the execution of services. It is possible to be specified the run-time behaviors through attributes or configuration settings. For example, a service can indicate that its instances are not thread-safe. Throttling behavior allows you to put limits on the number of connections, sessions, and threads. Error handling behaviors control how errors are handled and reported to clients. Metadata behavior governs how and whether metadata is made available to the outside world. Transaction behavior enables the rollback of transacted operations if a failure occurs. Dispatch behavior is the control of how a message is processed by the WCF infrastructure. Parameter filtering allows preset actions to occur based on filters acting on message headers.

Messaging

The messaging layer illustrates the possible formats and exchange patterns of the data. WS Security channel is an implementation of the WS-Security specification enabling security at the message layer. The WS Reliable Messaging channel enables the guarantee of message delivery. The encoders present a variety of encodings that can be used to suit the needs of the message. The HTTP channel specifies that the HyperText Transport Protocol is used for message delivery. The TCP channel similarly specifies the TCP protocol. The Transaction Flow channel governs transacted message patterns. The Named Pipe channel enables inter-process communication. The MSMQ channel enables interoperation with MSMQ applications.

Activation and Hosting

The specific method by which a service is started is determined by its activation options. And services can be either self-hosted or hosted in the context of another application. The Windows Activation Service (WAS) enables WCF applications to be activated automatically when deployed on a computer running the WAS. Services can also be manually run as executables (.EXE files). A service can also be run automatically as a Windows service. And a service can also be run as a COM+ application.

Services from the Outside.

From the outside, a service is collection of endpoints and a service description. The description is the information necessary for interchange messages with the service. It is used WSDL, XML Schemas, WS-Policy (description of non-functional requirements such as security mechanisms, schedules availability, and quality of service), WS-Metadata Exchange (WS-MEX) for asking the service to describe itself.

The endpoint is a basic unit of communication in Windows Communication Foundation (WCF). It is the physical port. You interchange messages with a service through the endpoints. Each endpoint is made up of three elements: an address, a binding, and a contract. The endpoint's ABC, A stands for address, B stands for binding and C stands for contract.

The address is basically a URI. The format of the address is scheme://myservice.mydomain.com:port/path. For example for accessing a service using http protocol you must write the following address down http://myservice.mydomain.com:8080/myservice/financialservice.svc, or for accessing a service using tcp protocol by the port 2525 you must write the following address down

net.tcp://myservice.mydomain.com:2525/myservice/financialservice.svc.

The binding describes how a service communicates with the partners. It is a collection of details such as transport method, encoding format, reliability requirements, and security requirements. WCF creates a channel stack to satisfy the using binding.

The contract is a collection of operations that specifies what the endpoint communicates to the outside world. Each operation is a simple message exchange, for example a request message and an associated reply message that form a request/reply message exchange.

Conclusion.

This paper is intended to present the fundamental concepts of Windows Communication Foundation as the new programming model for service-oriented development. WCF implements new specifications adopted in standardization organizations such as OASIS, W3C, etc. And it is a good object model that really represents the concepts of the Service-Oriented Architecture.


Login to add your contents and source code to this article
 [Top] Rate this article
 About the author
 
John Charles Olamendy
He’s a senior Integration Solutions Architect and Consultant. His primary area of involvement is in Object-Oriented Analysis and Design, Database design , Enterprise Application Integration, Unified Modeling Language, Design Patterns and Software Development Process. He has knowledge and extensive experience in the development of Enterprise Applications using Microsoft.NET and J2EE technologies and standards. He is proficient with distributed systems programming; and business-process integration and messaging using the principles of the Services Oriented Architecture (SOA) and related technologies such as Microsoft BizTalk Server, Web Services (Windows Communication Foundation, WSE, BEA WebLogic, Oracle AS and Axis) through multiple implementations of loosely-coupled system. He’s a prolific blogger contributing to .NET and J2EE communities and actively writes articles on subjects relating to integration of applications, business intelligence, and enterprise applications development. He holds a Master’s degree in Business Informatics at Otto Von Guericke University, Magdeburg, Germany. He was recently awarded as MVP. He currently works in the telecommunication industry and delivers integration solutions for this industry. He harbors a true passion for the technology.
Looking for C# Consulting?
C# Consulting is founded in 2002 by the founders of C# Corner. Unlike a traditional consulting company, our consultants are well-known experts in .NET and many of them are MVPs, authors, and trainers. We specialize in Microsoft .NET development and utilize Agile Development and Extreme Programming practices to provide fast pace quick turnaround results. Our software development model is a mix of Agile Development, traditional SDLC, and Waterfall models.
Click here to learn more about C# Consulting.
 
Introducing MaxV - one click. infinite control. Hyper-V Hosting from MaximumASP.
Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
Dynamic PDF
ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications.
Go.NET
Build custom interactive diagrams, network, workflow editors, flowcharts, or software design tools. Includes many predefined kinds of nodes, links, and basic shapes. Supports layers, scrolling, zooming, selection, drag-and-drop, clipboard, in-place editing, tooltips, grids, printing, overview window, palette. 100% implemented in C# as a managed .NET Control. Document/View/Tool architecture with many properties&events. Optional automatic layout.
Dundas Software
Dundas Chart for .NET is the most advanced .NET charting package available today.  With an extremely complete feature set, elegant architecture and easy implementation, Dundas Chart can quickly add advanced Charting functionality to enhance and transform ASP.NET and Windows Forms applications.  Whether you are implementing charting into internal projects, or building applications for clients, Dundas Chart offers advanced technology and advanced results to get the most out of data.
Clickatell's SMS Gateway
Clickatell's Developer Solutions allow you to SMS enable any website or application via a range of API's. Learn More about our API connections.
Free access to .NET Memory Management video
Everything you need to know about Garbage Collection, Temporary Objects, Fragmentation, Finalization and common causes of memory leaks in .NET. Watch the video here.
Microsoft Visual Studio 2010
Microsoft Visual Studio 2010 offers more to developers than any other Visual Studio release. Work more productively and collaboratively-with greater control over your work at every step. The Beta 2 can give you a head start on achieving efficiency.
 
   Print Read/Post comments Post a comment  Rate  
   Email to a friend  Bookmark  Similar Articles  Author's other articles  
 
 Post a Feedback, Comment, or Question about this article
Subject:  
Comment:  
Dundas Dashboard
Become a Sponsor
 Comments
Nice by Prabakar On November 7, 2006

Neat and Good  introduction for Windows communication foundation

Reply | Email | Delete | Modify | 
Good introduction by Mahesh On September 7, 2008
Keep up the good work,
Reply | Email | Delete | Modify | 
WCF security by mark.balasundram On April 16, 2009
Is it possible to do IP authentication using WCF under TCP protocol?
Reply | Email | Delete | Modify | 
Re: WCF security by John Charles On April 16, 2009
Yes,
You should use Internet Protocol Security (IPsec) for authentication and authorization of IP packet. IP Sec can be used to protect data between hosts (computers and servers) and gateways (routers and firewalls).
Thanks,
John C. Olamendy.
Reply | Email | Delete | Modify | 
Re: Re: WCF security by mark.balasundram On April 16, 2009

Thanks John, Your article was informative. In IIS we can accept or deny access to an IP, so I can perform similar activity here as well? If so do you have any "How To" doc?

Reply | Email | Delete | Modify | 

 Hosted by MaximumASP  |  Found a broken link?  |  Contact Us  |  Terms & conditions  |  Privacy Policy  |  Site Map  |  Suggest an Idea  |  Media Kit
Current Version: 5.2009.6.2
 © 1999 - 2009  Mindcracker LLC. All Rights Reserved