【发布时间】:2021-04-17 05:41:50
【问题描述】:
我在新安装时遇到了 WCF 元数据问题(Windows Server 2016 上的 IIS 10)
情况
-
WCF 服务运行良好(就像以前的安装一样)
-
wsdl 的导航(通过浏览器)不再可能,或者更好
-
http://ServiceA/ServiceA.svc: 是(网页可用)但指向 xml 的链接不起作用(来自 IIS 的错误 400)
-
https://ServiceA/ServiceA.svc:连页面都没有
此外,在 serviceMetadata 中声明使用 https 而非 http,这与刚刚描述的行为相反。
下面是 web.config 的摘录
<services>
<service behaviorConfiguration="ServiceBehavior" name="...">
<endpoint address="https://<fqdn>/ServiceA/ServiceA.svc"
binding="wsHttpBinding"
bindingConfiguration="wsHttpEndpointBinding"
name="WsHttpBinding"
contract="ServiceContracts.IServiceA">
</endpoint>
</service>
</services>
<behaviors>
<serviceBehaviors>
<serviceMetadata httpsGetEnabled="true" httpGetEnabled="false" />
...
可能与名称解析有关吗? PC 名称为 AAAAAA,FQDN 为 BBBBB.domain.ext
感谢您的任何建议 L.
【问题讨论】:
-
您好,问题解决了吗?如果您认为我的回复对您有帮助,您可以将其标记为答案。
-
嗨。抱歉,我有段时间没上网。明天我将按照您的建议尝试删除端点地址。我很困惑,因为在开始时我设置了相对路径(/ServiceA/ServiceA.svc)并且 svc 是可访问的,但它不是服务本身。设置完整的url,情况已经交换(没有svc,但服务ok)。我会告诉你。同时,谢谢。
标签: wcf metadata http-status-code-400 svc