다음을 통해 공유


ServiceDebugBehavior.HttpHelpPageEnabled 속성

정의

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

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

속성 값

trueWCF가 HTML 도움말 페이지를 게시하는 경우 그렇지 않으면 . 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 브라우저에 HttpHelpPageEnabledfalse 표시되는 HTML 도움말 페이지의 게시를 사용하지 않도록 속성을 설정합니다.

HTML 도움말 페이지가 속성에 의해 HttpsHelpPageUrl 제어되는 위치에 게시되도록 하려면 이 속성을 true 설정해야 하며 다음 조건 중 하나도 true여야 합니다.

  • HttpsHelpPageUrl 속성은 HTTP 프로토콜 체계를 지원하는 절대 주소입니다.

  • HTTP 프로토콜 체계를 지원하는 서비스에 대한 기본 주소가 있습니다.

HTTP 프로토콜 체계를 지원하지 않는 절대 주소가 속성에 HttpsHelpPageUrl 할당된 경우 예외가 throw되지만 이전 조건을 충족하지 않는 다른 시나리오에서는 예외가 발생하지 않고 HTML 도움말 페이지도 없습니다.

적용 대상