小编Geo*_*ker的帖子

通过负载均衡器在IIS上的WCF报告错误的基址

我正在尝试通过负载均衡器在IIS 6上通过SSL启动WCF服务.我最初的问题是一个明显且讨论得很好的问题 - WSDL页面上显示的地址指向https://SERVERNAME/WebServices/mydomainws.svc而不是www.mydomain.com.此问题的答案是在IIS中添加主机头值.我这样做了,它起作用了...... 我现在在浏览器中查看wsdl时获得http://www.mydomain.com/WebServices/mydomainws.svc.如果我点击该链接(非ssl链接),我会得到一个再次引用服务器名称的服务定义.

下一个建议的补救措施是使用WCF Extras,它提供了一个允许您指定基址的扩展.但是设置该配置条目只更新了soap12:地址.EndPointReference地址仍在使用计算机名称.

总结:WSDL作为在Web浏览器查看https://www.mydomain.com/WebServices/mydomainws.svc: HTTP://www.mydomain.com/WebServices/mydomainws.scv

单击上面的链接可以看到带有以下服务条目的实际wsdl文件:

HTTPS://ServerName/WebServices/mydomainws.svc

我的服务器配置文件包含以下serviceModel条目:

<system.serviceModel>
    <bindings>
        <wsHttpBinding>
            <binding name="TransportSecurity">
                <security mode="Transport">
                    <message clientCredentialType="None"/>
                    <transport clientCredentialType="None"/>
                </security>
            </binding>
        </wsHttpBinding>
    </bindings>
    <services>
        <service name="mydomain.ws.mydomainws" behaviorConfiguration="mydomainwsBehavior">
            <!-- Service Endpoints -->
            <endpoint address="" **behaviorConfiguration="CorrectEndPoint"** binding="wsHttpBinding" bindingConfiguration="TransportSecurity" contract="mydomain.ws.Imydomainws"/>
            <endpoint address="mex" **behaviorConfiguration="CorrectEndPoint"** binding="mexHttpsBinding" contract="IMetadataExchange"/>
        </service>
    </services>
    <behaviors>
        <serviceBehaviors>
            <behavior name="mydomainwsBehavior">
                <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before …
Run Code Online (Sandbox Code Playgroud)

iis https wcf

8
推荐指数
1
解决办法
6532
查看次数

标签 统计

https ×1

iis ×1

wcf ×1