2016-09-12 41 views
0

我有一個tcp配置,看起來像這樣。添加一些customBinding屬性到netTcpBinding

<netTcpBinding> 
     <binding name="BindingConfig" maxReceivedMessageSize="2147483647" sendTimeout="10675199.02:48:05.4775807" closeTimeout="10675199.02:48:05.4775807" openTimeout="10675199.02:48:05.4775807" receiveTimeout="10675199.02:48:05.4775807"> 
      <security mode="Message"> 
      <transport clientCredentialType="Windows" /> 
      <message clientCredentialType="Windows" /> 
      </security> 
      <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> 
      <reliableSession inactivityTimeout="10675199.02:48:05.4775807" /> 
     </binding> 
     </netTcpBinding> 

我需要添加一些只能在cust中使用的密鑰。配置。

<customBinding> 
     <binding name="CustBinding"> 
      <security> 
      <localServiceSettings sessionKeyRenewalInterval="10675199.02:48:05.4775807" sessionKeyRolloverInterval="10675199.02:48:05.4775807" timestampValidityDuration="10675199.02:48:05.4775807"/> 
      </security> 
     </binding> 
     </customBinding> 

是否有實現這一目標比翻譯TCP配置到自定義配置的一種更好的方式(而無需編寫代碼)?

回答

0

不,因爲它們不作爲已製作的綁定的屬性存在,您需要創建一個自定義的屬性來支持所需的屬性。