On Windows XP, Internet Information Service (IIS) does not use HTTP.sys which is the HTTP driver that can be used to share HTTP traffic on the same port by multiple applications. This means that when IIS is running, the default port 80 is taken by IIS and no other applications can use it.

 

So if you use WSDualHttpBinding for your service, the client won’t be able to open the listener against the default port 80 on the same machine and it would fail with AddressAlreadyInUseException.

 

To workaround this, you need to change the ClientBaseAddress of WSDualHttpBinding on the client side so that it uses a different port than the one that IIS is using. From client config, you can do the following:

  <system.serviceModel>

    <client>

      <endpoint name="WSDualOnXP"

                address="http://localhost/WSDualOnXP/HelloWorld.svc"

                binding="wsDualHttpBinding"

                bindingConfiguration="WSDualOnXP"

                contract="HelloWorldClient.IHelloContract" />

    </client>

    <bindings>

      <wsDualHttpBinding>

        <binding name="WSDualOnXP" clientBaseAddress="http://localhost:808/WSDualOnXP/"/>

      </wsDualHttpBinding>

    </bindings>

  </system.serviceModel>

From code, you can also set the ClientBaseAddress:

WSDualHttpBinding binding = new WSDualHttpBinding();

binding.ClientBaseAddress = "http://localhost:808/WSDualOnXP/";

 

On the server side, you don’t have to specify the ClientBaseAddress since the addressing correlation is automatically done by WCF infrastructure.