开发者

WCF SSL over load balancer. Load balancer changing ssl port

My client application is trying to call a wcf service using transport security. The wcf service is sitting on 2 nodes behind a hardware load balancer.

The hardware load balancer gets the wcf call on port 443, and then changes the port to 44556. This gives a endpoint mismatch error. The guys that look after our production and qa departments here, don't want the wcf service sitting on port 443 for whatever reason, and thus why they setup the port change.

I then changed the load balancer 开发者_StackOverflow中文版to not change the port to 44556, but to leave it as port 443, and the service gets called as expected.

My question is, is there any configuration I can make to my service\IIS, that will let the service accept the wcf call on port 44566 when it came in from port 443?

Thanks,


Yes, you need to change your server and client bindings. Check out clientVia element.

On the server: Add the listenUri attribute to your endpoint and change the name of the address to your service with an urn. (same name for the client)

<endpoint address="urn:MyService" listenUri="https://localhost:443/MyService" binding="customBinding" bindingConfiguration="NetHttpBinding" contract=Interface.ITradingPlatform"/>

On the client:

For example, instead of specifying the URL in the address field of the endpoint, add a urn and then add a behaviorConfiguration attribute:

<endpoint name="ServerHTTP"
                      address="urn:MyService"
                      binding="customBinding"
                      bindingConfiguration="NetHttpBinding"
                      contract="Client.ITradingPlatform"
            behaviorConfiguration="BehaviorHTTP">

      </endpoint>

You will also need to define the behaviorConfiguration:

<behaviors>
      <endpointBehaviors>
 <behavior name="BehaviorHTTP">
          <clientVia viaUri="https://yourdomain.com:443/MyService"/>
        </behavior>
</endpointBehaviors>
    </behaviors>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜