Codechef4u is a community for computer professionals,by computer professionals,just like you; who loves sharing and helping each others,Join them
Share your post

WCF Endpoints

Each end point is medium to communicate with external world. All communication with WCF service occurs through the endpoints of the service.

Each END point consist four properties:

1.  Address (Where)   2.  Binding (How)   3. Contract (What)   4. Behavior (Custom Changes)

Address:

Simply tells external world where service located. The URL specifies where this WCF service is hosted .Client will use this URL to connect to the service.
Example: http://localhost/EmployeeLeavesService/LeaveSummery.svc

Binding:

Binding explains how client communicate with WCF service. There are different protocols used in binding, you can use any protocol according to your WCF service requirement.

Protocols:

BasicHttpBinding:       

Classic(Basic before WCF) web service,No security by default

WSHttpBinding:                  

With WS-* support. Supports Security,transactions

WSDualHttpBinding:   

With duplex contract and transaction support

WSFederationHttpBinding:

With federated security. Supports transactions

MsmqIntegrationBinding:

Communication directly with MSMQ applications. Supports transactions

NetMsmqBinding:      

Communication between WCF applications by using queuing. Supports transactions

NetNamedPipeBinding:       

Communication between WCF applications on same computer. Supports duplex contracts and transactions

NetPeerTcpBinding: 

Communication between computers across peer-to-peer services. Supports duplex contracts

NetTcpBinding:         

Communication between WCF applications across computers. Supports duplex contracts and transactions

Binding Example:

Basic HTTP:

<basicHttpBinding>
  <binding name="BasicHttpBinding_ILeaveSummeryWebService" receiveTimeout="02:50:00" maxReceivedMessageSize="2147483647" />
 </basicHttpBinding>

 

WS HTTP:

 

<wsHttpBinding>
        <binding name="WSHttpBinding_ILeaveSummeryWebService" receiveTimeout="02:50:00"
          maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
          <security mode="TransportWithMessageCredential">
            <message clientCredentialType="UserName" algorithmSuite="xyztestName256" />
          </security>
        </binding>
</wsHttpBinding>


Contract:

A contract that specifies what operations available, operations specifies what endpoint will communicate with external world.
<endpoint contract="ILeaveSummeryWebService" binding="wsHttpBinding" bindingConfiguration="WsHttpBinding_ILeaveSummeryWebService" address="http://localhost/EmployeeLeavesService/LeaveSummery.svc" />

Behavior:

A set of behaviors that specify local implementation details of the endpoint.

<serviceBehaviors>
        <behavior name=" EmployeeLeavesWebServiceBehaviour">
          <!--Set this to a high value in order to be able to serialize many objects--> 
          <dataContractSerializer maxItemsInObjectGraph="2147483647" />
 
          <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="false" />
          <!-- 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 httpHelpPageEnabled="false" includeExceptionDetailInFaults="true" />
            <serviceCredentials>
                <userNameAuthentication userNamePasswordValidationMode="Custom"
                                        customUserNamePasswordValidatorType="EmployeeLeavesService.LeaveCustomUserNameValidator, EmployeeLeavesService" />
            </serviceCredentials>
 
        </behavior>
      </serviceBehaviors>
    </behaviors>
 
 

Invalid entry,please enter valid data.

Loading