简体   繁体   中英

How to host a WCF Service in IIS Programatically?

I have a WCF 3.0 service which has been configured in the web.config of my web application where it's hosted via an .svc file:

<endpoint address="https://domain.co.uk/services/accountservice"
             binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IAccountService"
             contract="AccountServiceReference.IAccountService"
             name="BasicHttpBinding_IAccountService" />

The address value shouldn't be in plain text in the web.config, as we'd like to encrypt it with an encryption algorithm that we have and only store the encrypted value there. How would that be possible?

I was thinking perhaps I should be programmatically hosting the WCF service in our IIS so that the address can be set at runtime by reading the EncryptedAddress value from an AppSetting then decrypting it at runtime. How would that be possible?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM