我正在尝试创建一个WCF服务,但是没有出现元数据,我尝试:
<system.serviceModel>
<services>
<service
name ="MyNamespace.IMyContract"
behaviorConfiguration="mex">
<endpoint
address = ""
binding = "wsHttpBinding"
contract = "MyNamespace.IMyContract"
/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="mex">
<serviceMetadata httpGetEnabled="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
我尝试使用http://MyServer/receptor.svc
访问,但显示Metadata publishing for this service is currently disabled.
和http://MyServer/mex
显示404
,为什么?我做错了什么?
OBS1:我在Windows 7上的IIS7.5中发布我的服务。
OBS2:如果我删除了behaviorConfiguration="mex"
,则元数据可以正常工作,但basicHttpBinding
不能使用wsHttpBinding
。
答案 0 :(得分:0)
我忘记了:
<endpoint address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />