1
我有以下的(減少)的代碼,我想通過一個web.config如何在web.config中爲CustomBinding配置TransportSecurityBindingElement?
var security = new TransportSecurityBindingElement();
security.EndpointSupportingTokenParameters.SignedEncrypted.Add(new UserNameSecurityTokenParameters());
var binding = new CustomBinding(security);
是否有可能配置來配置這個自定義使用web配置結合?如果可能的話,我如何配置支持令牌參數的端點?我已經試過以下配置,但它不驗證對DotNetConfig.xsd:
<system.serviceModel>
<bindings>
<customBinding>
<binding name="SomeBinding" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00">
<transportSecurity> <!-- Fails validation -->
<!-- How do I configure the EndpointSupportingTokenParameters -->
</transportSecurity>
</binding>
</customBinding>
</bindings>
<client>
...
</client>
</system.serviceModel>