C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Articles » .NET Framework »

Windows Communication Foundation --Introduction


Posted Date: 21 Feb 2007    Resource Type: Articles    Category: .NET Framework
Author: jairam narasimhamMember Level: Silver    
Rating: 1 out of 5Points: 10



Introduction


There are different SOA technologies used for communication between applications.ex are Web services,enterprice services,remoting etc.These technologies surely provide a wide range of functionality but are isolated from eachother.Imagine a scenario where you would appreciate a combination of these technologies, you would like to communicate between two applications of different platform,so you use webservices and also you want to have a reliable messaging gaurantee.but these two technologies can be brought under one umberella using a new framework called WCF(also known as indigo).


Paragraph Heading 1



How indigo will help you?

It provides a unified programing model.so wether it is remoting or it is webservice ,you have a same programming model for both.Let us imagine a previou scenario where you need an application to be exposed in intranet as well as outside.that means probably you would be using two seperate codes or classes build for them.Now imagine that you would like to add a new functionality to the application,this will force you to add the functionality in both the classess,that means a repeatebility has occoured.At this point,one would think ,it would had been better if everything would had been done in a single class or any change in one class could reflect all the other applications using it.Yes,this is how WCF will help you, reduced repeatedness.

How is this acheived?
This is achieved by using attributes in your program and a one to many kind of relationship between the service and clients.Before knowing how it exactly happens we must know atleast the following terms first.
servicecontract
When you write your application in wcf you should mention the attribute [ServiceContract] above the interface decleration.This will imply that the interface can be exposed to the outer world.Also the functions inside the interface must be preeceede with the attribute [OperationContract].This will ensure that the function is exposed to the outer world.Only those functions which are mentioned with the [OperationContract] attribute are exposed to the outer world.

Bindings
Bindings provide the communication channel between the services and clients which are using the services .There are 9 different types of bindings depending on what protocol you would like to use between service and a client.EX it may be HTTTP,TCP,MSMQ.so binding name would differ for remoting ,webservices etc

Implementing a one to many relationship:

This is acheived by configuring the endpoints of a service. Here comes the intresting part of the entire story.The configuration file would contain the name of the interfaces and several endpoints.Each endpoint has a name , adress ,binding and contract.Now if you want use remoting concept you would configure an endpoint by setting is binding attribute to "NetTcpBinding" and contract as the interface name which is exposed to the outer world.Adress as the url where service lies.
Now you would like a webservice to be used, what you do is create an endpoint with changed type of bindings.

After creating these endpoints these endpoints are ready to be accessed from client also.In the clientside also the cofig file should be cofigured in a similar manner.

You can create a proxy class similar to how we create in webservice by using svcutil.exe.after using this you will get a cs and config file which you have to append in youtr project

a config file example












Summary


This explains that wcf is a powerfull framework which is developed to provide a solution for both functionality,flexibility and efficiency with interoperability,productivity and service orientation kept in mind.
Any doubts regarding this please fell free to write to me











Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Extended TextBox Component Class - VB.Net
Previous Resource: Problem with w3wp.exe, the Asp.net worker process in Windows 2003
Return to Discussion Resource Index
Post New Resource
Category: .NET Framework


Post resources and earn money!
 
Related Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use