WCF is not bound to the correct IP address

We have a WCF service deployed to a Windows 2003 server with some problems. The configuration uses wsHttpBinding, and we specify the IP address. Services are hosted by the Windows service.

When we start the service, most of the time it captures the wrong IP address. Several times, it was tied to the correct address only in order to remove this binding and move to another address (there are 2) associated with the NIC after processing for a short time.

Port 80 is currently used (we configured IIS to bind to only one address through httpcfg), although we tried it using different ports with the same results.

When the Windows service starts hosting the WCF service, the properties indicate that it is bound to the correct address; however, tcpview shows that it is really listening on the wrong address.

Here is the part of the configuration that sets baseAddress. One that is tied to the end of .4 instead of .9

<services>
    <service name="Service.MyService"
             behaviorConfiguration="serviceBehavior">
        <host>
            <baseAddresses>
                <add baseAddress="http://xx.xx.xx.9:80/" />
            </baseAddresses>
        </host>
        <endpoint address="MyService"
                  binding="wsHttpBinding"
                  bindingConfiguration="WSHttpBinding_IMyService"
                  contract="Service.IMyService" />
        <endpoint address="mex"
                  binding="mexHttpBinding"
                  contract="IMetadataExchange" />
    </service>
</services>
  • Is there any other configuration that needs to be installed?
  • Is there a tool that can help track where this is due to the wrong address?
+3
source share
6 answers

The WCF configuration looks fine. This can be a problem when binding your NICs. First of all, make sure that the network adapter with the correct address. Here is an article that discusses how to install and view nic-binding orders:

http://theregime.wordpress.com/2008/03/04/how-to-setview-the-nic-bind-order-in-windows/

+1

: IP- xx.xx.xx.4 NIC IIS. , , , .

Description:
Unable to bind to the underlying transport for xx.xx.xx.4:80. The IP Listen-Only list may contain a reference to an interface which may not exist on this machine.  The data field contains the error number.

xAdd.x.x.x.x.x.x.x.

0

. , NetTcp WsHttp, 80. WsHttp, IP-.

0

BaseAddress . IIS.

0

Source: https://habr.com/ru/post/1697728/


All Articles