แก้ไข

แชร์ผ่าน


BasicHttpBinding.ReaderQuotas Property

Definition

Gets or sets constraints on the complexity of SOAP messages that can be processed by endpoints configured with this binding.

public:
 property System::Xml::XmlDictionaryReaderQuotas ^ ReaderQuotas { System::Xml::XmlDictionaryReaderQuotas ^ get(); void set(System::Xml::XmlDictionaryReaderQuotas ^ value); };
public System.Xml.XmlDictionaryReaderQuotas ReaderQuotas { get; set; }
member this.ReaderQuotas : System.Xml.XmlDictionaryReaderQuotas with get, set
Public Property ReaderQuotas As XmlDictionaryReaderQuotas

Property Value

The XmlDictionaryReaderQuotas that specifies the complexity constraints.

Examples

The following example sets ReaderQuotas to application settings.

BasicHttpBinding binding = new BasicHttpBinding();
XmlDictionaryReaderQuotas readerQuotas = new XmlDictionaryReaderQuotas();
readerQuotas.MaxArrayLength = 25 * 1024;

binding.ReaderQuotas = readerQuotas;

The value of this property can also be set in the configuration file.

<configuration>
  <system.serviceModel>

    <bindings>
      <basicHttpBinding>
        <binding name="Binding1">
          <readerQuotas maxBytesPerRead ="1000" 
                        maxDepth="100"/>

          <security mode="None" />
        </binding>
      </basicHttpBinding>
    </bindings>

  </system.serviceModel>

</configuration>

Remarks

The complexity constraints provide protection from denial of service (DOS) attacks that attempt to use message complexity to tie up endpoint processing resources. Other complexity constraints include items such as a maximum element depth and a maximum length for string content within the message.

Applies to