[英]Configuring WCF Service on IIS
這是我第一次使用WCF。 開發應用程序非常容易,但是這使我難以部署在IIS上。
我已經盡一切努力進行部署,但是客戶端開始將未授權的用戶異常(或類似的東西)拋出未定義的異常(在web.config文件和app.config文件進行了無數次更改之后)。
我回到了在VS(cassini)中可以正常工作的默認配置。
任何快速指示器或指向詳細教程的某些鏈接將不勝感激。
提前致謝
<system.serviceModel>
<services>
<service behaviorConfiguration="MBTService.Service1Behavior"
name="MBTService.MBTService">
<endpoint address="" binding="wsHttpBinding" contract="MBTSTBO.IMBTService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="MBTService.Service1Behavior">
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above 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>
雖然不是特定於您的情況,但是WCF跟蹤通常是診斷WCF配置問題的非常好的工具。 您可以在此處看到如何配置WCF跟蹤,這非常簡單,WCF運行時基本上會將一些信息發送到.svclog文件中
然后,您可以使用“ 服務跟蹤查看器工具” (位於“所有程序”->“ Visual Studio 2010”->“ Microsoft Windows SDK工具”中)分析日志,並查看在特定請求期間出了什么問題,它提供了比異常消息更多的信息。
強尼
這是一個長鏡頭,但是一旦我遇到相同的問題(未經授權的訪問),問題是某些文件(從Webmail下載)被Windows阻止了。 取消阻止這些文件后,Web服務便開始正常工作。
希望能幫助到你。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.