2014-10-28 175 views
1

我正在創建一個簡單的wcf Web服務,它允許用戶從數據庫表中提取數據。執行後如果我在網絡瀏覽器中查看服務,我會得到下面的頁面在客戶端測試中測試wcf時出錯

After viewing the service in browser i got the page without error (您已經創建了一個服務。)沒有任何錯誤。但如果我調試模式,我會得到以下錯誤。

displayed this page if debugging to run in test client window

我真的不明白問題出在哪裏是來自,但即時通訊的思想從我的配置細來,但我只是不能得到哪裏。

這裏是我的web.config文件。

<system.serviceModel> 
    <services> 
     <service behaviorConfiguration="namespaceName.Service1Behavior" name="namespaceName.Service"> 
      <endpoint address="http://localhost:6937/Service.svc" binding="basicHttpBinding" contract="namespaceName.IService"> 
       <identity> 
        <dns value="localhost" /> 
       </identity> 
      </endpoint> 
      <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> 
     </service> 
    </services> 
    <behaviors> 
     <serviceBehaviors> 
      <behavior name="namespaceName.Service1Behavior"> 
       <!-- To avoid disclosing metadata information, set the value below to false before deployment --> 
       <serviceMetadata httpGetEnabled="true" /> 
       <!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information --> 
       <serviceDebug includeExceptionDetailInFaults="false" /> 
      </behavior> 
     </serviceBehaviors> 
    </behaviors> 
</system.serviceModel> 

回答

1

我認爲你有這個在您的配置文件:

<system.web> 
    <compilation debug="true" /> 
<system.web> 
+1

感謝@krystan我沒有包括。但現在我的工作已經添加了。再次感謝。 – 2014-10-28 11:09:43