ServiceDebugBehavior.HttpHelpPageEnabled 속성

정의

WCF(Windows Communication Foundation)가 HttpHelpPageUrl 속성으로 제어된 주소에 HTML 도움말 페이지를 게시할지 여부를 제어하는 값을 가져오거나 설정합니다.

public:
 property bool HttpHelpPageEnabled { bool get(); void set(bool value); };
public bool HttpHelpPageEnabled { get; set; }
member this.HttpHelpPageEnabled : bool with get, set
Public Property HttpHelpPageEnabled As Boolean

속성 값

Boolean

WCF가 HTML 도움말 페이지를 게시하면 true이고, 그렇지 않으면 false입니다. 기본값은 true입니다.

예제

다음 코드 예제에서는 구성 파일을 사용하여 HTML 도움말 페이지 기능을 사용하도록 설정하고 디버깅 목적으로 SOAP 오류 내부의 예외 정보를 클라이언트에 반환하는 방법을 보여 줍니다. 이 구성 파일에서는 ServiceDebugBehavior 기능을 지원하는 다음과 같은 기본 단계를 보여 줍니다.

<configuration>
  <system.serviceModel>
    <services>
      <!-- 
        Step 1. Add a behaviorConfiguration attribute
        in the <service> element.
      -->
      <service 
        name="Microsoft.WCF.Documentation.SampleService"
        behaviorConfiguration="metadataAndDebug">
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8080/SampleService" />
          </baseAddresses>
        </host>
        <endpoint
          address=""
          binding="wsHttpBinding"
          contract="Microsoft.WCF.Documentation.ISampleService"
        />
        <endpoint
           address="mex"
           binding="mexHttpBinding"
           contract="IMetadataExchange"
        />
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <!-- 
          Step 2. Inside a <serviceBehaviors> section, add 
          a name attribute in the <behaviors> element that 
          matches the behaviorConfiguration attribute in the
          <service> element above.
        -->
        <behavior name="metadataAndDebug">
          <serviceMetadata 
            httpGetEnabled="true" 
            httpGetUrl=""
          />
          <!-- 
            Step 3. Add a <serviceDebug> element and 
            modify the various attributes that suit your 
            scenario.
          -->
          <serviceDebug 
            httpHelpPageEnabled="true" 
            includeExceptionDetailInFaults="true"
          />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
</configuration>

설명

HTML 브라우저에 표시되는 HTML 도움말 페이지가 게시되지 않게 하려면 HttpHelpPageEnabled 속성을 false로 설정합니다.

HttpsHelpPageUrl 속성으로 지정된 위치에 HTML 도움말 페이지를 게시하려면 이 속성을 true로 설정하고 다음 조건 중 하나를 충족해야 합니다.

  • HttpsHelpPageUrl 속성이 HTTP 프로토콜 체계를 지원하는 절대 주소이어야 합니다.

  • HTTP 프로토콜 체계를 지원하는 서비스의 기본 주소가 있어야 합니다.

HTTP 프로토콜 체계를 지원하지 않는 절대 주소가 HttpsHelpPageUrl 속성에 지정되면 예외가 throw되지만, 위의 조건을 모두 충족하지 않는 시나리오에서는 예외가 발생하지 않고 HTML 도움말 페이지도 생성되지 않습니다.

적용 대상