Udostępnij za pośrednictwem


<endpointDiscovery>

Specifies the various discovery settings for an endpoint, such as its discoverability, scopes, and any custom extensions to its metadata.

Schema Hierarchy

<system.serviceModel>
  <behaviors>
    <endpointBehaviors>
      <behavior> of <endpointBehaviors>
        <endpointDiscovery>

Syntax

<behaviors>  <endpointBehaviors>    <behavior name="String">      <endpointDiscovery enable="Boolean">        <scopes>          <add scope="URI"/>        </scopes>        <extensions>        </extensions>      </endpointDiscovery>    </behavior>  </endpointBehaviors></behaviors>

Attributes and Elements

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

Attributes

Attribute Description

enabled

A Boolean value that that specifies whether discoverability is enabled on this endpoint. The default is false.

Child Elements

Element Description

<scopes>

A collection of scope URIs for the endpoint. More than one scope Uris can be associated with a single endpoint.

<extensions> [of <endpointDiscovery>]

A collection of XML elements that allows you to specify custom metadata to be published for an endpoint.

Parent Elements

Element Description

<behavior> of <endpointBehaviors>

Specifies a behavior element.

Remarks

When added to the endpoint’s behavior configuration and with the enabled attribute set to true, this configuration element enables its discoverability. In addition, you can use the <scopes>child element to specifying custom scope Uris that can be used to filter service endpoints during query, as well as the <extensions> child element to specify custom metadata that should be published along with the standard discoverable metadata (EPR, ContractTypeName, BindingName, Scope and ListenURI).

This configuration element is dependent on the <serviceDiscovery> element that provides the service level control of discoverability. This means that this element’s settings are ignored if <serviceDiscovery> is not present in the configuration.

Example

The following configuration example specifies filtering scopes and extension metadata to be published for an endpoint.

<services>
  <service name="CalculatorService"
           behaviorConfiguration="CalculatorServiceBehavior">
     <endpoint binding="basicHttpBinding"
              address="calculator"
              contract="ICalculatorService"
              behaviorConfiguration="calculatorEndpointBehavior" />
  </service>
</services>
<behaviors>
  <serviceBehaviors>
    <behavior name="CalculatorServiceBehavior">
      <serviceDiscovery />
    </behavior>
  </serviceBehaviors>
  <endpointBehaviors>
    <behavior name="calculatorEndpointBehavior">
      <endpointDiscovery enable="true">
        <scopes>
          <add scope="http://contoso/test1"/>
          <add scope="http://contoso/test2"/>
        </scopes>
        <extensions>
          <e:Publisher xmlns:e="http://example.org">
            <e:Name>The Example Organization</e:Name>
            <e:Address>One Example Way, ExampleTown, EX 12345</e:Address>
            <e:Contact>support@example.org</e:Contact>
          </e:Publisher>
          <AnotherCustomMetadata>Custom Metadata</AnotherCustomMetadata>
        </extensions>
      </endpointDiscovery>
    </behavior>
  </endpointBehaviors>
</behaviors>

See Also

Reference

EndpointDiscoveryBehavior