Configure the WCF Service to Use basicHttpBinding

In this step, you configure your WCF service endpoint to use basicHttpBinding.
  1. Right-click the Web.config file of the WCF service and then click Edit WCF Configuration.
If you do not see the Edit WCF Configuration option, on the Tools menu, click WCF Service Configuration Editor. Close the WCF Service Configuration Editor tool that appears. The option should now appear on the web.config context menu.
  1. In the Configuration Editor, in the Configuration section, expand Service and then expand Endpoints.
  2. Select the first node [Empty Name]. Set the name attribute to BasicHttpEndpoint.
By default, the name will be empty because it is an optional attribute.
  1. In the Service Endpoint section, set the binding attribute to basicHttpBinding by choosing this option from the drop-down list.
  2. In the Configuration Editor, on the File menu, click Save.
  3. In Visual Studio, verify your configuration settings in Web.config. The configuration should look as follows:
<services>

        <service behaviorConfiguration="ServiceBehavior" name="Service">
          <endpoint address="" binding="basicHttpBinding"
              name="BasicHttpEndpoint"
              bindingConfiguration=""
              contract="IService">
            <identity>
              <dns value="localhost" />
            </identity>
          </endpoint>
          <endpoint address="mex" binding="mexHttpBinding"
             contract="IMetadataExchange" />
        </service>
      </services>

0 Responses to “Configure the WCF Service to Use basicHttpBinding”

Post a Comment

Labels

Topics