【发布时间】:2011-01-25 20:44:27
【问题描述】:
我有 wcf iis 托管服务。 我已经创建了标准(来自 vs 模板)wcf 服务及其客户端。在客户端,我将 ServiceReference 添加到我的 wcf 服务。一切都很好。没有错误,此服务器的 Web 表单也可以工作。下一步我将我的 wcf 服务发布到 Win2003 IIS6.0。 我成功去http://server:1234/Service1.svc,看web-form,可以查wsdl。 但是当我运行:svcutil.exe http://server:1234/Service1.svc?wsdl 或添加服务引用时,我遇到了错误:
Error: Cannot obtain Metadata from http://server:1234/Service1.svc?wsdl
If this is a Windows (R) Communication Foundation service to which you have acce
ss, please check that you have enabled metadata publishing at the specified addr
ess. For help enabling metadata publishing, please refer to the MSDN documentat
ion at http://go.microsoft.com/fwlink/?LinkId=65455.
WS-Metadata Exchange Error URI: http://server:1234/Service1.svc?wsdl
Metadata contains a reference that cannot be resolved:
'http://server:1234/Service1.svc?wsdl'.
The remote server returned an unexpected response: (417) Expectation failed.
The remote server returned an error: (417) Expectation failed.
在我的服务配置中,我有:
端点地址="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
服务元数据 httpGetEnabled="true"/>
我无法理解问题。 你能帮助我吗。非常感谢
【问题讨论】: