我正在尝试向我的服务添加一个MEX端点。当我开始服务的时候
WCF服务主机找不到任何服务元数据。这可能导致客户端应用程序不正确地运行。请检查是否启用元数据。你想退出吗?
这是我的配置文件:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<compilation debug="true" />
</system.web>
<system.serviceModel>
<services>
<service name="WcfServiceLibrary1.CustomerService"
behaviorConfiguration="Metadata">
<endpoint address=""
binding="wsHttpBinding"
contract="WcfServiceLibrary1.IService1">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8000" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="Metadata">
<serviceMetadata httpGetEnabled="true" />
</behavior>
<behavior>
<serviceMetadata httpGetEnabled="True"/>
<serviceDebug includeExceptionDetailInFaults="False" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>有人知道我为什么还会收到这个消息吗?
谢谢
发布于 2014-04-01 01:42:16
您不必指定mex端点和httpGetEnabled。只有一个才能公开元数据。不要特别指定httpGetUrl,因为这取决于您的托管环境。
试试这个..。
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<compilation debug="true" />
</system.web>
<system.serviceModel>
<services>
<service name="WcfServiceLibrary1.CustomerService"
behaviorConfiguration="Metadata">
<endpoint address=""
binding="wsHttpBinding"
contract="WcfServiceLibrary1.IService1">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8000" />
</baseAddresses>
</host>
</service>
</services>
</system.serviceModel>
</configuration>https://stackoverflow.com/questions/9022734
复制相似问题