Jun 29, 2007

WCF Callback Port for WSDualHttpBinding

When using a callback contract and the WSDualHttpBinding WCF binding then port 80 is assigned per default. As this produces an obvious problem when IIS is installed, you have to configure another port for your callback service on the client side.

// set callback port for dual HTTP binding as another channel is required. Not for npipe, tcpip.

WSDualHttpBinding binding = cf.Endpoint.Binding as WSDualHttpBinding;

if (binding != null)


    int port = int.Parse((string)ConfigurationManager.AppSettings["DeviceServerCallbackPort"]);

    binding.ClientBaseAddress = new Uri(cf.Endpoint.Address.Uri.Scheme + "://"

        + System.Environment.MachineName + ":" + port + "/" + typeof(IDeviceServerService).Name);


No comments:

Post a Comment