Exercise 3: Default Binding

In the previous exercise, you were able to create and deployed a WCF Workflow Service Application that uses a default service configuration. A default endpoint for HTTP using basicHttpBinding was added to the service when this one was opened. In this exercise, you will change that default endpoint to use the wsHttpBinding.

Task 0 – Opening the Solution

To begin this exercise, you can use the solution you finished from Exercise 2. Alternatively, you can follow the following steps to begin with Exercise 3.

  1. Open the starting solution for Exercise 3 located under the Source\Ex3-ProtocolMapping\Begin (choosing the folder that matches the language of your preference.) Use it as the starting point for this exercise.
  2. Press CTRL+SHIFT+B to build the solution.

Task 1 – Changing the Default Binding

In this task, you will modify the protocol mapping for the default service configuration to use wsHttpBinding for addresses that use the http scheme.

  1. Open Web.config.
  2. Add the protocolMapping section inside the system.serviceModel node.

    (Code Snippet - What is new in WCF4 Lab – protocolMapping XML)

    Web.config

    <system.serviceModel>
    <protocolMapping> <add scheme="http" binding="wsHttpBinding" /> </protocolMapping>

Next Step

Exercise 3: Verification