【问题标题】:How to change WCF Binding and Endpoint properties using AutofacServiceHostFactory如何使用 AutofacServiceHostFactory 更改 WCF 绑定和端点属性
【发布时间】:2011-10-19 07:06:19
【问题描述】:

我想增加 MaxBufferSize、MaxBufferPoolSize、ReceivedMessageSize 以及 readerQuotas maxDepth="2147483646" maxStringContentLength="2147483646" maxArrayLength="2147483646" maxBytesPerRead="2147483646" maxNameTableCharCount="2147483646",据我了解我必须在注册过程中更改这些参数。但是我在任何地方都没有看到这样做的例子。

我将不胜感激有关此事的任何帮助。

【问题讨论】:

    标签: autofac wcf


    【解决方案1】:

    不知道你是否找到了答案,但它看起来像这样:

    builder.Register(
        container =>
            new ChannelFactory<TService>(
                new WSHttpBinding { TransactionFlow = supportTransactionFlow, 
                                    MaxReceivedMessageSize = 2147483646, 
                                    ReaderQuotas = { 
                                          MaxStringContentLength = 2147483646,
                                          MaxDepth = 2147483646,
                                          MaxArrayLength= 2147483646 }},
                endpointAddress)).InstancePerDependency();
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-04-01
      • 2018-12-27
      • 2011-09-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多