[英]Using web.config in a Self-Hosted c# WCF console app (setting MaxStringContentLength server side)
[英]WCF - web.config: independent service references [for self-hosted and IIS-hosting]
問題:如何修改web.config以支持包含的具有不同地址的WCF-ServiceApplication服務參考。 在自托管和IIS模式下,有不同的地址。 如何做,而無需在每個WCF-ServiceApplication中為每個部署過程更改web.config。 我可以動態地請求/更新服務引用嗎?
背景技術:我想在IIS中進行外部通信並自托管進行內部通信,以支持內部不同的協議。 當然是由於安全問題。 我有約7個WCF-ServiceApplications web.configs可以修改。
問題 WCF-ServiceApplication依賴於其他WCF-ServiceApplications作為服務引用。 根據托管方法,地址會更改。
自托管
<endpoint address="http://localhost:50108/ABService.svc"
binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_IABService"
contract="ABServiceReference.IABService"
name="BasicHttpBinding_IAndonBoardService" />
IIS
<endpoint address="http://localhost:20200/AB/ABervice.svc"
binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_IABService"
contract="ABServiceReference.IABService"
name="BasicHttpBinding_IABService" />
這可以幫助您: 在代碼中配置WCF服務並創建ServiceHostFactory
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.