2
是否可以在服務的Web.config文件中定義默認的客戶端綁定配置?WCF:是否可以在服務的Web.config中指定默認的客戶端配置設置?
我想,這樣的客戶並不需要經常更改默認設置
沿着這個東西線(不工作)指定默認maxReceivedMessageSize和maxBufferPoolSize值:
<bindings>
<wsHttpBinding >
<binding name="Standard" maxReceivedMessageSize="6000000" maxBufferPoolSize="200000000" >
<readerQuotas maxDepth="32" maxBytesPerRead="200000000"
maxArrayLength="200000000"
maxStringContentLength="200000000"/>
<security mode="TransportWithMessageCredential" />
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint binding="wsHttpBinding"
bindingConfiguration="Standard"
contract="SomeContract" />
</client>
這似乎設置服務端點上綁定的默認值。是否有類似的技術可以用來指定所有客戶端配置的默認值? – cordialgerm 2012-03-21 19:01:28
@pickles:只需在客戶端的配置中使用相同的方法...這些默認值總是適用於您定義它們的配置。 – 2012-03-21 19:06:42
好了,因此無法爲服務配置中的所有客戶端指定默認值。謝謝 – cordialgerm 2012-03-21 19:26:12