首页 文章

WCF IIS svcutil错误

提问于
浏览
0

我有wcf iis托管服务 . 我已经创建了标准(来自vs模板)wcf服务及其客户端 . 在客户端,我将ServiceReference添加到我的wcf服务 . 一切都很好 . 没有错误,此服务器的Web表单也可以正常工作 . 下一步我将我的wcf服务发布到Win2003 IIS6.0 . 我成功去了http://server:1234/Service1.svc,看到网页表格,可以查看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.

在我的服务配置中,我有:

endpoints 地址= "mex" binding = "mexHttpBinding" contract = "IMetadataExchange" />
serviceMetadata httpGetEnabled = "true" />

我无法理解问题 . 你能帮助我吗 . 非常感谢

2 回答

  • 0

    编辑:

    这个答案已经发布,并且对这个问题没有特别用处(因为它是基于原始问题中的拼写错误) . 话虽如此,我仍然觉得这些信息对于那些有类似问题的人来说很有用,他们可能会在寻找答案时找到这个问题 . 如果有权删除答案的人认为这需要删除 - 请随时将其删除 .


    原始答案:

    我'm not sure if this is helpful or not - I'有类似的问题 . 请注意,当您在错误消息中进一步向下访问 http://server:1234/Service1.svc 时,它提到MEX endpoints 是 http://aurit-server:1234/Service1.svc ...然后,根据您的绑定设置方式,可能是 aurit-server 不是您的有效 endpoints 服务MEX ......但 server 是反之亦然 .

    我知道这不仅仅是指出我在解决类似问题时忽略了一些东西 - 希望它有所帮助 . 即 aurit-serverserver 可能无法互换......在我的情况下,它们不可互换 .


    编辑:

    顺便说一下,我向你发了这个建议 . 如果它可以帮助你,请确保你投票Chesso! (Chesso's answer to meBlog post referenced in Chesso's answer) .

  • 0

    我遇到了这个问题(“远程服务器返回了意外的响应:(417)期望失败”)尝试将服务引用添加到我部署在另一台服务器上的WCF服务时 . 在这种情况下,原来是互联网属性 .

    • 转到控制面板 - >互联网属性,“连接”选项卡 .

    • 单击“LAN设置”按钮 .

    • 取消选中“自动检测设置”和“使用自动配置脚本” .

    • 单击确定,应用/确定 .

    在那之后,我可以添加服务参考就好了 . 如果你有这个问题值得一试 .

相关问题