Window Communication Foundation ABC

What is WCF?

WCF (Window Communication Service) is use for developing the service oriented application .WCF service is use for communicating and sharing data with real time in multi locations. You can send data message asynchronously from one endpoint to another endpoint. WCF services can be distributed as a globally and can be use in Workflow and Silverlight.

What is address, binding and contract in WCF?

<service name=”Service” behaviorConfiguration=”ServiceBehavior”>

<endpoint address=”http://localhost:50975/Service1.svc” contract=”IService1″ binding=”wsHttpBinding”></endpoint>

</service>

 Address: In WCF address specifies the URL of WCF service and denote that where this service will be hosted.

Binding: Binding Specify that how client can communicate with service. There are different protocols available into the WCF service to communicate with client.

Contract: Contract specify the collection of the operation that is specify that what the endpoint will communicate with the client. Basically contract defined the data and interface that can be use by client.

What is Service behavior in WCF?

<behaviors>

      <serviceBehaviors >

        <behavior name=”ServiceBehavior”>

          <!– To avoid disclosing metadata information, set the value below to false before deployment –>

          <serviceMetadata httpGetEnabled=”true”/>

          <!– To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information –>

          <serviceDebug includeExceptionDetailInFaults=”true”/>

          <serviceThrottling maxConcurrentCalls=”5″ maxConcurrentInstances=”10″ maxConcurrentSessions=”10″/>

        </behavior>

      </serviceBehaviors>

    </behaviors>

Service behavior is use to define the metadata of the WCF service. You can define the service throttling, Service Metadata, service debug in service behavior. You can use service behaviors to configuration of service and modify to the service runtime behavior in client and service applications.

Types of Binding:

Binding are use in Window communication service for connecting the endpoint.

<system.serviceModel>

    <services>

      <service name=Service behaviorConfiguration=ServiceBehavior>

        <endpoint address=http://localhost:50975/Service1.svc contract=IService1 binding=wsHttpBinding></endpoint>

      </service>

    </services>

    <behaviors>

      <serviceBehaviors >

        <behavior name=ServiceBehavior>

          <!– To avoid disclosing metadata information, set the value below to false before deployment –>

          <serviceMetadata httpGetEnabled=true/>

          <!– To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information –>

          <serviceDebug includeExceptionDetailInFaults=true/>

          <serviceThrottling maxConcurrentCalls=5 maxConcurrentInstances=10 maxConcurrentSessions=10/>

        </behavior>

      </serviceBehaviors>

    </behaviors>

    <serviceHostingEnvironment multipleSiteBindingsEnabled=true />

  </system.serviceModel>

 

These are following main binding:-

BasicHTTPBinding:  BasicHttpBinding is use for exposing the asmx web service in WCF service. Basic binding use HTTP Protocol for connecting to the web services.

WSHttpBinding:  WSHttpBinding are more secure, reliable and interoperable binding. WSHttpBinding use the HTTP and HTTPS transport for communication. The WSHttpBinding support the transaction and

And WS-* functionality.

 

WSDualHttpBinding: WSDualHttpBinding is use for duplex service contract or communication in SOAP.

NetNamedPipeBinding: NetNamedPipe binding is use for connect to the other WCF endpoint on same machine.

WsFederationHttpBinding:WSFederationHttpBinding is use for WS-Federation Protocol for authentication and authrorization usres.

NetMSMQBinding: NetMSMQBinding is use to create the queued message connection with other WCF endpoint.

NetTCPBinding: NetTCPBinding is secure and optimize binding and its use for cross machine communication between WCF Applications.

NetPeerTCPBinding: NetPeerTCP Binding is use for multiple machine communication.

Leave a Reply

Your email address will not be published. Required fields are marked *

5 + 4 =


All Rights Reserved 2019 | DesignzRush (OPC) Pvt. Ltd.
Inline
Inline