ServiceDebugBehavior.HttpHelpPageEnabled プロパティ

定義

Windows Communication Foundation (WCF) が、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

プロパティ値

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>

注釈

HttpHelpPageEnabled プロパティを false に設定して、HTML ブラウザーに表示される HTML ヘルプ ページの公開を無効にします。

HttpsHelpPageUrl プロパティで制御される場所で HTML ヘルプ ページを確実に公開するには、このプロパティを true に設定し、次のいずれかの条件も true である必要があります。

  • HttpsHelpPageUrl プロパティは、HTTP プロトコル スキームをサポートする絶対アドレスです。

  • HTTP プロトコル スキームをサポートするサービスのベース アドレスがあります。

HTTP プロトコル スキームをサポートしない絶対アドレスが HttpsHelpPageUrl プロパティに割り当てられている場合は例外がスローされますが、前の基準をどれも満たさないその他のシナリオでは、例外も HTML ヘルプ ページも表示されません。

適用対象