Share via


BasicHttpBinding.MaxReceivedMessageSize 속성

정의

이 바인딩으로 구성된 채널에서 수신할 수 있는 최대 메시지 크기(바이트)를 가져오거나 설정합니다.

public:
 property long MaxReceivedMessageSize { long get(); void set(long value); };
public long MaxReceivedMessageSize { get; set; }
member this.MaxReceivedMessageSize : int64 with get, set
Public Property MaxReceivedMessageSize As Long

속성 값

바인딩에서 처리하는 메시지의 최대 크기(바이트)입니다. 기본값은 65,536바이트입니다.

예외

값이 0보다 작은 경우

예제

다음 예제에서는 MaxReceivedMessageSize를 1,000,000바이트로 설정합니다.

BasicHttpBinding binding = new BasicHttpBinding();

binding.MaxReceivedMessageSize = 1000000;

이 속성의 값은 구성 파일에서 설정할 수도 있습니다.

<configuration>
  <system.serviceModel>

    <bindings>
      <basicHttpBinding>
        <binding name="Binding1"
                 maxReceivedMessageSize = "1000000">
          <security mode="None" />
        </binding>
      </basicHttpBinding>
    </bindings>

  </system.serviceModel>

</configuration>

설명

BasicHttpBinding을 사용하여 서비스에서 유선으로 수신할 수 있는 메시지의 크기는 각 메시지에 할당된 메모리 양으로 제한됩니다. 이 메시지 크기 제한은 DoS 유형의 공격에 대한 노출을 막기 위한 것입니다.

에 속성 MaxBufferSize 도 있습니다 BasicHttpBinding.

버퍼링된 전송의 경우 (TransferMode 로 설정 Buffered됨). 이 값은 항상 MaxReceivedMessageSize에서 지정한 값과 같습니다.

스트리밍 전송(TransferMode 로 설정 Streamed)의 경우 메시지를 생성하려면 SOAP 헤더만 버퍼링되어야 합니다. 본문은 주문형으로 스트리밍할 수 있습니다. 이 경우 MaxBufferSize 는 MaxReceivedMessageSize보다 작거나 같으며, 여기서 MaxReceivedMessageSize는 전체 메시지(헤더 및 본문)의 크기를 경계로 하고 MaxBufferSize SOAP 헤더의 크기를 제한합니다.

적용 대상