我的 ASP.NET Web 应用程序通过引用程序集 Microsoft.Web.Services3.dll, v2.0.50727 来使用 WSE 3.0 协议
namespace Microsoft.Web.Services3
{
public class WebServicesClientProtocol : SoapHttpClientProtocol
{
public WebServicesClientProtocol();
............
public void SetPolicy(Policy policy);
public void SetPolicy(string policyName);
............
}
}
我的问题特定于SetPolicy(string policyName)
当前字符串是从该策略的特定配置文件中获取的。
<policies xmlns="http://schemas.microsoft.com/wse/2005/06/policy">
<extensions>
<extension name="CertificateOverTransportSecurityAssertion" type="ABCD.ApplicationBlocks.WSSecurity.CertificateOverTransportSecurityAssertion, AAAA.ApplicationBlocks.WSSecurity" />
</extensions>
<policy name="ClientPolicy">
<CertificateOverTransportSecurityAssertion clientCertificateSubjectDistinguishedName="E=xxxxx, CN=yyyyy, OU=zzzz, O=ssss, L=hhhhh, S=ee, C=ii"/>
</policy>
</policies>
我想从代码中进行配置。
//current -- where "ClientPolicy" is gotten from config. file.
theServiceWse.SetPolicy("ClientPolicy");
//proposed usage of
public void SetPolicy(Policy policy);
我该怎么办?