ServiceDebugBehavior.HttpHelpPageEnabled Eigenschap

Definitie

Hiermee wordt een waarde opgehaald of ingesteld waarmee wordt bepaald of Windows Communication Foundation (WCF) een HTML-helppagina publiceert op het adres dat wordt beheerd door de eigenschap 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

Waarde van eigenschap

true als WCF een HTML-Help-pagina publiceert; anders, false. De standaardwaarde is true.

Voorbeelden

In het volgende codevoorbeeld ziet u hoe u een configuratiebestand gebruikt om de HTML Help-paginafunctie in te schakelen en uitzonderingsgegevens in een SOAP-fout terug te sturen naar de client voor foutopsporing. Dit configuratiebestand bevat de volgende basisstappen voor het toevoegen van ondersteuning voor de ServiceDebugBehavior functies:

<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>

Opmerkingen

Stel de HttpHelpPageEnabled eigenschap in om false de publicatie van een HTML-Help-pagina die zichtbaar is voor HTML-browsers uit te schakelen.

Om ervoor te zorgen dat de HTML-Help-pagina wordt gepubliceerd op de locatie die wordt beheerd door de HttpsHelpPageUrl eigenschap, moet u deze eigenschap true instellen op en moet een van de volgende voorwaarden ook waar zijn:

  • De HttpsHelpPageUrl eigenschap is een absoluut adres dat ondersteuning biedt voor het HTTP-protocolschema.

  • Er is een basisadres voor de service die ondersteuning biedt voor het HTTP-protocolschema.

Hoewel er een uitzondering wordt gegenereerd als een absoluut adres dat het HTTP-protocolschema niet ondersteunt, wordt toegewezen aan de HttpsHelpPageUrl eigenschap, leidt elk ander scenario waarin aan geen van de voorgaande criteria wordt voldaan, geen uitzondering en geen HTML-helppagina.

Van toepassing op