Follow by Email

Saturday, May 25, 2013

using wsHttpBinding endpoint with transport security for a WCF Service in

hi in this post i will show how to use wsHttpBinding endpoint  with transport security for a WCF Service in

Go to the webconfig file of the WCF application:

1. After defining the implementation of the methods which are going to be exposed by the service, we will go to the web.config file here will define the service behavior, endpoint(wsHttpBinding) and transport security.

<?xml version="1.0"?>

    <compilation debug="true" targetFramework="4.0" />
        <binding name="SecurityByTransport">
          <security mode="Transport">
            <transport clientCredentialType="Windows" />

        <behavior name="ServiceBehavior">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />

      <service behaviorConfiguration="ServiceBehavior" name="WcfService5.Service1">
        <endpoint binding="wsHttpBinding" contract="WcfService5.IService1"/>
        <endpoint address="mex" binding="mexHttpBinding"
              name="MetadataBinding" contract="IMetadataExchange"/>

    <modules runAllManagedModulesForAllRequests="true"/>
        To browse web app root directory during debugging, set the value below to true.
        Set to false before deployment to avoid disclosing web app folder information.
    <directoryBrowse enabled="true"/>


2. Run the project to check the desired output