1
在託管我在IIS上稱爲「SimpleWCF」的WCF服務;我在瀏覽器中手動瀏覽時遇到以下錯誤;
元數據錯誤 - WCF
無法在由服務SimpleWCF實施的合同列表中找到合同名稱'IMetadataExchange'。將ServiceMetadataBehavior添加到配置文件或直接添加到ServiceHost以啓用對此合同的支持。
我無法理解這個錯誤的原因[仍然是新的。
這是我的配置文件;
<configuration>
<system.serviceModel>
<behaviors>
<endpointBehaviors>
<behavior name="">
<webHttp />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<basicHttpBinding>
<binding name="LargeData" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
<security mode="None">
</security>
</binding>
</basicHttpBinding>
</bindings>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
<services>
<service name="SimpleWCF">
<endpoint address="http://localhost/Sample/SimpleWCF.svc" binding="basicHttpBinding" bindingConfiguration="LargeData" contract="SimpleWCF"/>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
</system.serviceModel>
<system.web>
<compilation debug="true"/>
</system.web>
</configuration>
(+1)你是男人的標誌。我有同樣的問題,直到我一起刪除名稱屬性。 – capdragon 2011-09-09 17:44:44