WSDualHttpBindingElement.MaxReceivedMessageSize 属性

定义

获取或设置配置了此绑定配置的通道上可以接收的消息的最大大小(以字节为单位)。Gets or sets the maximum size, in bytes, for a message that can be received on a channel configured with this binding.

public:
 property long MaxReceivedMessageSize { long get(); void set(long value); };
[System.Configuration.ConfigurationProperty("maxReceivedMessageSize", DefaultValue=Mono.Cecil.CustomAttributeArgument)]
[System.Configuration.LongValidator(MinValue=1)]
public long MaxReceivedMessageSize { get; set; }
[<System.Configuration.ConfigurationProperty("maxReceivedMessageSize", DefaultValue=Mono.Cecil.CustomAttributeArgument)>]
[<System.Configuration.LongValidator(MinValue=1)>]
member this.MaxReceivedMessageSize : int64 with get, set
Public Property MaxReceivedMessageSize As Long

属性值

Int64

绑定可处理的最大消息大小(以字节为单位)。The maximum size, in bytes, for a message that is processed by the binding. 默认值为 65,536 字节。The default value is 65,536 bytes.

属性

注解

使用 WSDualHttpBinding 类的服务能够在网络上接收的消息的大小受到为每个消息分配的内存量的限制。The size of the messages that can be received on the wire by services using the WSDualHttpBinding class is bounded by the amount of memory allocated for each message. 对消息大小进行的此限制旨在降低遭受拒绝服务 (DoS) 攻击的可能性。This bound on message size is intended to limit exposure to DoS-style attacks.

请注意,MaxBufferPoolSizeMaxReceivedMessageSize 的设置都是本地行为设置。Note that the settings for MaxBufferPoolSize and MaxReceivedMessageSize, are local behavioral settings. 这表示它们不会传输到元数据中的其他终结点。This means that they are not transmitted to other endpoints in metadata. 如果为元数据中一个最大消息大小为 2GB 的服务生成了一个代理,则该代理的最大消息大小仍为默认的 64K。If you generate a proxy to a service with a maximum message size of 2GB from metadata, the proxy still has a default value 64K. 这样就使对消息和消息缓冲区大小进行适当限制的控制权处在本地管理员的管辖范围内。This leaves control of the appropriate bounds for message and message buffer size in the scope of local administrators.

适用于