【发布时间】:2011-09-29 09:44:23
【问题描述】:
我创建了使用 IIS 6 (Windows XP) 托管的 WCF 服务:
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="myServiceBehaviors">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service name="Namespace.Class" behaviorConfiguration="myServiceBehaviors">
<endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex" />
</service>
</services>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
我已经使用 Visual Studio 2010 创建了虚拟目录 (MyVirtualFolder),当我将浏览器指向“http://localhost/MyVirtualFolder/MyService.svc”时 我收到错误页面,告诉我我应该打开 metadataExchange 接口,并说明如何执行此操作,我将如何修改我的配置文件。我仔细检查了一下,我的配置等于 html 页面提出的配置。
为什么IMetaDataExchange接口不可用?
提前谢谢你!
【问题讨论】:
-
您使用的是什么类型的绑定。请添加完整的配置代码
-
我认为您的问题是您没有为服务配置“主要”端点。您只配置了 mex 端点。
标签: .net wcf web-services configuration wcf-configuration