Lets Learn WCF from Scratch Part - 1

Saratvaddilli
Posted by in WCF category on for Beginner level | Points: 100 | Views : 7915 red flag

WCF stands for Windows Communication Foundation, is the latest technology that enables communication between applications in the distributed environment.
Lets learn how to create , host , consume a WCF service in a series of articles

Introduction


Windows Communication Foundation(WCF) is a framework for building service-oriented applications.Using WCF,you can send data as asynchronous messages from one service endpoint to another.

Objective


Lets learn WCF from the scratch , so lets see about basic terminology which we use in the WCF services that might help us to understand WCF in a better way 

Terminology :


To consume any WCF service we need the destination address where actually the service was hosted .lets assume that the below link was the destination address :

                                      http://192.168.1.89/Service1.svc
                                       (1)             (2)                 (3)
 
we can divide the above URL into three parts as i done above 
 
(1)Transport mechanism
(2)Service hosted location
(3)Service name
  

Address : 


It is the transport mechanism through which we are sending  .They are different types of transport mechanisms 
in WCF and more transport mechanisms can be added using the built-in-extension points of WCF

         1)HTTP/HTTPS
         2)TCP
         3)IPC ( Named Pipes)
         4)MSMQ 
         5)Peer Network 

Binding :


We call WCF as a service so, they should be a communication between the client and the server as one way or two way or duplex .We know that communication means sending information in message format from client to server and vice-verse .
To send messages between client and server we need to bind server and client .WCF provides some in-built binding.
        
        1)BasicHttpBinding: Basic web service communication.By default, there is no security provided for messages when the   client calls happen. In other words, data is sent as plain text.

          2)WsHttpBinding: It cannot be consumed by older .NET version less than 3 version.
        
        3)WSFederationHttpBinding:This binding will describe the client to authenticate using security tokens.
                
        4)WSDualHttpBinding :WSDualHttpBinding should be avoided if possible. WSDualHttpBinding is not     interoperable . It has been deprecated in WCF.

       5)NetTcpBinding :Specifies a secure ,reliable optimized binding suitable for cross-machine communication.
        
         6)NetNamedPipeBinding :Specifies a secure ,reliable optimized binding suitable for cross-machine communication with in the same machine .

      7)NetMsmqBinding : The NetMsmqBinding is the queued binding WCF provides for two endpoints to communicate using MSMQ.
   
       8)NetPeerTcpBinding : The NetPeerTcpBinding provides support for the creation of peer networking applications.

     9)MsmqIntegrationBinding :MsmqIntegrationBinding  enables WCF applications to send/receive messages to and from existing MSMQ applications .

Contract :


                  WCF contract is a set of specification that defines the interfaces of the WCF Service. They are different types of contracts .
           
       1)Data Contracts :Data Contracts are defined with the DataContractAttribute and DataMemberAttribute

         2) Service Contract :  Service Contract are defined by applying the ServiceContractAttribute and OperationContractAttribute to an  interface or class

       3)Message Fault Contract :Message Contracts give you more control over the actual SOAP message for a service operation request or reply 

        4)Fault Contract : errors can be handled and error messages can be conveyed to the client applications using SOAP Fault Contract 

Conclusion :


We had seen basic terminology of WCF  and in the next article we will learn in detail about Binding in WCF 


Reference

http://msdn.microsoft.com/en-us/library/aa480210.aspx

Page copy protected against web site content infringement by Copyscape

About the Author

Saratvaddilli
Full Name: vaddilli sarat
Member Level: Bronze
Member Status: Member,MVP
Member Since: 7/30/2012 3:54:23 AM
Country: India
Thanks and Regards V.SaratChand Show difficulties that how difficult you are
www.dotnetfunda.com
I am sarat vaddilli working on the cutting edge technologies like html5,css3, Jquery and MicroSoft technologies like Asp.Net,Asp.Net MVC, SQL Server.

Login to vote for this post.

Comments or Responses

Login to post response

Comment using Facebook(Author doesn't get notification)