【发布时间】:2016-11-06 14:07:39
【问题描述】:
我已经浪费了 xx 小时来寻找解决方案,但没有成功:(
我有 IIS 服务器在 NAT 之后,安装了 WCF 服务主机(在 IIS 上)。 本地和局域网通信客户端-WcfService 工作属性,但是当我尝试将服务引用(通过 Internet)添加到我的 wcf 服务主机时 - 在 Visual Studio 中,我遇到以下问题:
请求失败,HTTP 状态为 400:错误请求。 元数据包含无法解析的引用:
我已将路由器端口 WAN 重定向到 WCF Sercice 的端口 Lan。它的工作属性,因为当我通过互联网连接到浏览器中的http://[...] .svc 文件时,我可以看到正确的站点。
我的 web.config
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="mexBehavior">
<serviceMetadata httpGetEnabled="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="mexBehavior" name="KSPDJOBService.KSPDJOBService">
<endpoint address="" binding="wsHttpBinding" contract="KSPDJOBService.IKSPDJOBService" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost/KSPDJOBService" />
</baseAddresses>
</host>
</service>
</services>
任何想法如何解决我的问题?我会非常感谢任何提示。
谢谢。 对不起我的英语:)
【问题讨论】: