我在MS Web Developer 2010 Express中創建了WCF服務庫,其ITestSerivce是服務合同,並且遵循Web.config配置。但是我得到這個錯誤 : 錯誤:無法從http://localhost:56016/TestService.svc 獲得元數據: 我不明白爲什麼網址是http://localhost:56016其中基址是http://localhost:8001在MS Web Developer 2010 Express中構建WCF服務庫
任何人可以幫助我這個問題。
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<services>
<service behaviorConfiguration="ServiceBehavior" name="TestService">
<host>
<baseAddresses>
<add baseAddress ="http://localhost:8001/" />
</baseAddresses>
</host>
<endpoint address="" binding="wsHttpBinding" contract="ITestService"/>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehavior">
<!--Setting httpGetEnabled you can publish the metadata -->
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="True" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<wsHttpBinding>
<binding name="SampleServiceBinding">
<security/>
</binding>
</wsHttpBinding>
</bindings>
</system.serviceModel>
</configuration>
我沒有使用cassini並使用WCF Test Client工具。爲什麼它會顯示 http:// localhost:56016/TestService.svc。 – sameer 2012-02-15 12:43:10
您的WCF服務如何託管? – Rajesh 2012-02-15 13:44:08