Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何以编程方式在IIS中托管WCF服务?_C#_Wcf_Wcf Endpoint - Fatal编程技术网

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

C# 如何以编程方式在IIS中托管WCF服务?,c#,wcf,wcf-endpoint,C#,Wcf,Wcf Endpoint,我有一个WCF 3.0服务,已在我的web应用程序的web.config中配置,该服务通过.svc文件托管: <endpoint address="https://domain.co.uk/services/accountservice" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IAccountService" contract="AccountS

我有一个WCF 3.0服务,已在我的web应用程序的
web.config
中配置,该服务通过
.svc
文件托管:

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

在web.config中,地址值不应该是纯文本,因为我们希望使用现有的加密算法对其进行加密,并且只将加密值存储在那里。那怎么可能呢


我在想,也许我应该以编程方式在IIS中托管WCF服务,以便在运行时通过从
AppSetting
读取
EncryptedAddress
值,然后在运行时对其进行解密来设置地址。这怎么可能呢?

对于堆栈溢出中的问题,已经有几个答案,例如:


这是在
服务
中还是在
客户
部分?因为无论您是尝试托管还是使用服务,方法都有很大的不同。无论哪种情况:为什么要麻烦?因为这看起来像是通过模糊实现的安全性。您可以尝试了解.svc文件扩展名是如何工作的。我相信您会发现WCF实现了IHttpHandler。您可能能够重建该代码路径。@codecaster实际上,我需要为客户端和服务执行此操作。