Tuesday 4 March 2014

WCF basic tutorial

Introduction to Ends, Contract, Address and Bindings:

Ends.
      End point is associate among service and Application.
      End points have three important things.
        Contract
        Address
        Bindings

<endpoint address="http://localhost/Design_Time_Addresses/SampleService/Service1/"
                binding="basicHttpBinding“ contract="ServiceReference1.IEmpService"        
                name="BasicHttpBinding_IEmpService" />

Contract
             Contract is agreement between one or more service interfaces. You can describe parameters and return values for the service methods.
Address
            Addresses can indicate your service location i.e.URL
Bindings
           Bindings can determine how your end point going to be accessed. i.e. you have to access your service into SOAP over HTTP and binary over TCP. Your end point will create two bindings and support both bindings the service interface.

Specifications of WCF

       WCF supports all specifications.
       Which is called WS* Specifications.
       We have some list of specifications.
         Messaging (WS-Addressing)
         Security
         Reliability
         Transactions
         Metadata

Messaging (Ws-Addressing)
         Define some extra Additions SOAP headers.
         Optimize the transmission in MTOM (Message Transmission Optimization Mechanism).
         The Message Transmission Optimization Mechanism (MTOM) defines an optimized transmission format for SOAP messages based on the XML-binary Optimized Packaging (XOP) specification.


Security
         WS-Security
         WS-Trust
         WS-Secure Conversation
         The above security can define the authentication, data integrity and method privacy.

Reliability
         WS-Reliable
          This specification to ensure end to end communication to SOAP message back and forth at many times.


Transaction
         WS-Coordination
         WS-Atomic Transaction
         This specification can enable the transaction for your SOAP Messages.


Metadata  
         WS-Policy
         WS-Metadata Exchange
         WSDL implements done by metadata exchange protocols.
         WS-policy provides more feature to use this service.
         It’s support other language also C++, JAVA etc..

  

Type of Contracts in WCF

       Service Contract
       Operation Contract
       Data Contract

Service Contract
           This attribute define which application interface will be exposed as service.

Operation Contract
           The Operation Contract dictates which methods should be exposed to the external client using this service.

Data Contract
      The Data Contract attributes defines which type of complex data will be exchanged between the client and the service.  Determine which parameter to be serialized.


Thanks Guys 
                      Next post we will share about WCF bindings and  SOA (Service Oriented Architecture)