简体   繁体   English

如何以编程方式在IIS中托管WCF服务?

[英]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: 我有一个WCF 3.0服务,该服务已在通过.svc文件托管的Web应用程序的web.config中进行了配置:

<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. 地址值不应在web.config中以纯文本格式显示,因为我们希望使用已有的加密算法对其进行加密,并且仅将加密后的值存储在该地址中。 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. 我在想,也许我应该以编程方式在我们的IIS中托管WCF服务,以便可以在运行时通过从AppSetting读取EncryptedAddress值来设置地址,然后在运行时对其进行解密。 How would that be possible? 那怎么可能呢?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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