WCF Web 服务元数据包含计算机名称 [英] WCF web service metadata contains computer name
问题描述
我的 Web 服务托管在我服务器上的 IIS 中,当我尝试下载服务的元数据时,它给我一个错误:无法解析远程名称:win2008x64(服务器名称).在服务器上,我有 2 个绑定,一个是 http,另一个是 https..
我该如何解决这个问题?
My web service is hosted in IIS on my server, when i try to download the metadata of the service it gives me an error: The remote name could not be resolved: win2008x64 (server name). On server, i have 2 bindings, one http, the other one is https..
How can i resolve this issue?
The document was understood, but it could not be processed.
- The WSDL document contains links that could not be resolved.
- There was an error downloading 'http://win2008x64:1668/Service.svc?xsd=xsd0'.
- The remote name could not be resolved: 'win2008x64'
Metadata contains a reference that cannot be resolved: 'http://89.x.x.x:166x/Service.svc?wsdl'.
Metadata contains a reference that cannot be resolved: 'http://89.x.x.x:166x/Service.svc?wsdl'.
If the service is defined in the current solution, try building the solution and adding the service reference again.
提前致谢.
推荐答案
我使用了 WcfExtras (WcfExtras="http://wcfextras.codeplex.com/wikipage?title=HowToUse&referringTitle=Home" rel="nofollow">如何使用) Codeplex 上的项目来处理此类问题.如果您的服务器位于某种代理之后,这也很有用.您只需要定义一个位置属性并覆盖您的服务的 url:
I used WcfExtras (how to use) project on codeplex to deal with this kind of issue. This is also useful if your server is behind a proxy of some kind. You need only to define a location attribute and override the url to your service:
<endpointBehaviors>
<behavior name="Sample.WsdlSampleEndpointBehavior">
<wsdlExtensions location="http://127.0.0.1/Sample/WsdlSample.svc" />
</behavior>
</endpointBehaviors>
这篇关于WCF Web 服务元数据包含计算机名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!