简体   繁体   中英

WCF Client with multiple NICS must use a specific IP Address

I have a WCF client application that is being run on a clustered server. Which means that I have at least 2 IP addresses, the actual machine address and the cluster address.

The server side firewall only recognizes the cluster address, yes we could add all the possible addresses to the firewall but that is not what my customer wants.

So I need to be able to select the IP Address to use from the client application. I would have thought there would be syntax similar to the TCP bind for use with WCF.

The WCF client side configuration is really basic and works just fine until this went on a clustered server.

One would think this is not an uncommon configuration and there should be a standard configuration solution, I just can't find it.

Any suggestions?

<client>
<!--
    Server II
-->
    <endpoint address="https://test.us/JLink/Service.svc"
              binding="wsHttpBinding" 
              bindingConfiguration="WSHttpBinding_Service"
              contract="Svc.IService" 
              name="WSHttpBinding_Service">
      <identity>
        <dns value="localhost" />
      </identity>
    </endpoint>
</client>

This is NOT hosted in IIS.

TLDR: It's not .net's responsbility to bind to an IP. See the documentation on your chosen web server (IIS most likely).

I suspect you want to setup http://test.us/ correctly with the correct IP bind in IIS. As WCF uses Windows Activation Service to get IIS to redirect the http call to the application. This will be even easier if your application is in fact hosted IN IIS, which it looks like it is (given the .svc service address).

This website will show you how to do this for IIS http://www.visualwin.com/Host-Header/

Just enter the IP address you want to bind to when you get to the part where it asks "Enter the IP address to use for this website".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM