我有一个简单的WCF4 REST服务,在使用浏览器时工作正常。但是,当我尝试从VS2010中的其他项目添加服务引用时,出现错误消息:“HTML文档不包含Web服务发现信息。”如何使用WCF的新简化配置模型公开元数据
我的问题是,由于WCF4有一个新的简化配置模型,我找不到任何有关如何打开当前公开的标准端点的元数据交换端点的实例。
我试着添加一个条目,如下所示,但它没有解决问题。
这里是我的配置:
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
<standardEndpoints>
<webHttpEndpoint>
<!--
Configure the WCF REST service base address via the global.asax.cs file and the default endpoint via the attributes on the <standardEndpoint> element below
-->
<standardEndpoint name="" helpEnabled="true" automaticFormatSelectionEnabled="true"/>
</webHttpEndpoint>
<mexEndpoint>
<standardEndpoint name=""/>
</mexEndpoint>
</standardEndpoints>
</system.serviceModel>
任何援助将不胜感激。
里克
基于REST的服务(的WebHttpBinding)没有(也可以通过元数据交换被曝光的元数据mex)协议。这是REST与SOAP的主要缺点之一... – 2010-09-25 21:44:02