WCF 在查看 MyService.svc?wsdl 时不使用计算机名而不是域名 [英] WCF not using computer name instead of domain name when viewing MyService.svc?wsdl

查看:18
本文介绍了WCF 在查看 MyService.svc?wsdl 时不使用计算机名而不是域名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 WCF 服务似乎使用计算机名而不是域名.当我查看 MyService.svc?wsdl 链接时,它显示了我的计算机名称.

My WCF serice seems to be using the computer-name instead of the domain name. When I view the MyService.svc?wsdl link it is showing my computer name.

在 web.config 中的何处添加我的域名?端点地址、基地址或身份?

Where do I add my domain name in the web.config? Endpoint address, baseaddress or identity?

注意:我使用的是 SSL,所以它必须是 https://www.example.com/myservice.svc

Note: I am using SSL so it has to be https://www.example.com/myservice.svc

推荐答案

WCF 4.0 已通过使用请求标头的新配置选项在某些情况下解决了此问题:

WCF 4.0 has solved this issue in some instances with a new config option that use Request Headers:

    <behaviors>
        <serviceBehaviors>
            <behavior name="AutoVaultUploadBehavior">
                <useRequestHeadersForMetadataAddress>
                    <defaultPorts>
                        <add scheme="https" port="443" />
                    </defaultPorts>
                </useRequestHeadersForMetadataAddress>

这篇关于WCF 在查看 MyService.svc?wsdl 时不使用计算机名而不是域名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆