次の方法で共有


<serviceDebug>

Specifies debugging and help information features for a Windows Communication Foundation (WCF) service.

<system.serviceModel>

  <behaviors>

    <serviceBehaviors>

      <behavior> of <serviceBehaviors>

        <serviceDebug>

                                    
                                    <serviceDebug httpHelpPageEnabled="Boolean"
                                
                                    
                                        httpHelpPageUrl="Uri"
                                
                                    
                                        httpsHelpPageEnabled="Boolean"
                                
                                    
                                        httpsHelpPageUrl="Uri"
                                
                                    
                                        includeExceptionDetailInFaults="Boolean" />
                                

Attributes and Elements

The following sections describe attributes, child elements, and parent elements.

Attributes

Attribute Description

httpHelpPageEnabled

A Boolean value that controls whether WCF publishes an HTML help page at the address specified by the httpHelpPageUrl attribute. The default is true.

You can set this property to false to disable the publication of an HTML help page visible to HTML browsers.

To ensure the HTML help page is published at the location controlled by the httpHelpPageUrl attribute, you must set this attribute to true. In addition, one of the following conditions must also be met:

  • The httpHelpPageUrl attribute is an absolute address that supports the HTTP protocol scheme.

  • There is a base address for the service that supports the HTTP protocol scheme.

Although an exception is thrown if an absolute address that does not support the HTTP protocol scheme is assigned to the httpHelpPageUrl attribute, any other scenario in which neither of the preceding criteria is met results in no exception and no HTML help page.

httpHelpPageUrl

A URI that specifies the relative or absolute HTTP-based URL of the custom HTML help file the user sees when the endpoint is viewed using an HTML browser.

You can use this attribute to enable the use of a custom HTML help file that is returned from an HTTP/Get request, for example, from an HTML browser. The location of the HTML help file is resolved as follows.

  1. If the value of this attribute is a relative address, the location of the HTML help file is the value of the service base address that supports HTTP requests, plus this property value.

  2. If the value of this attribute is an absolute address and supports HTTP requests, the location of the HTML help file is the value of this property.

  3. If the value of this attribute is absolute but does not support HTTP requests, an exception is thrown.

This attribute is valid only when the httpHelpPageEnabled attribute is true.

httpsHelpPageEnabled

A Boolean value that controls whether WCF publishes an HTML help page at the address specified by the httpsHelpPageUrl attribute. The default is true.

You can set this property to false to disable the publication of an HTML help page visible to HTML browsers.

To ensure the HTML help page is published at the location controlled by the httpsHelpPageUrl attribute, you must set this attribute to true. In addition, one of the following conditions must also be met:

  • The httpsHelpPageUrl attribute is an absolute address that supports the HTTPS protocol scheme.

  • There is a base address for the service that supports the HTTPS protocol scheme.

Although an exception is thrown if an absolute address that does not support the HTTPS protocol scheme is assigned to the httpsHelpPageUrl attribute, any other scenario in which neither of the preceding criteria is met results in no exception and no HTML help page.

httpsHelpPageUrl

A URI that specifies the relative or absolute HTTPS-based URL of the custom HTML help file the user sees when the endpoint is viewed using an HTML browser.

You can use this attribute to enable the use of a custom HTML help file that is returned from an HTTPS/Get request, for example, from an HTML browser. The location of the HTML help file is resolved as follows:

  • If the value of this property is a relative address, the location of the HTML help file is the value of the service base address that supports HTTPS requests, plus this property value.

  • If the value of this property is an absolute address and supports HTTPS requests, the location of the HTML help file is the value of this property.

  • If the value of this property is absolute but does not support HTTPS requests, an exception is thrown.

This attribute is valid only when the httpHelpPageEnabled attribute is true.

includeExceptionDetailInFaults

A value that specifies whether to include managed exception information in the detail of SOAP faults returned to the client for debugging purposes. The default is false.

If you set this attribute to true, you can enable the flow of managed exception information to the client for debugging purposes, as well as the publication of HTML information files for users browsing the service in Web browsers.

Caution noteCaution:

Returning managed exception information to services can be a security risk. This is because exception details expose information about the internal client implementation that could be used by unauthorized services.

Child Elements

None.

Parent Elements

Element Description

<behavior> of <endpointBehaviors>

Specifies a behavior element.

Remarks

Setting includeExceptionDetailInFaults to true allows the service to return any exception that is thrown by the application code even if the exception is not declared using the FaultContractAttribute. This setting is useful when debugging cases where the server is throwing an unexpected exception.

You can also set httpsHelpPageEnabled and httpsHelpPageUrl to enable or disable the help page. Each service can optionally expose a help page that contains information about the service including the endpoint to get WSDL for the service. This can be enabled by setting httpHelpPageEnabled to true. This enables the help page to be returned to a GET request to the base address of the service. You can change this address by setting another attribute httpHelpPageUrl. You can make this secure by using HTTPS instead of HTTP.

See Also

Reference

ServiceDebugElement

Footer image

Send comments about this topic to Microsoft.
© Microsoft Corporation. All rights reserved.