Partilhar via


<endpointExtensions>

This section registers a new standard endpoint in the extensions section in a machine or application configuration file. You can add a standard endpoint to this collection by using the add keyword, and setting the type attribute of the element to the endpoint type, as well as the name attribute to the name of the standard endpoint.

The following example uses the add element, as well as the name attribute to add a standard endpoint to the <endpointExtensions> section of the configuration file.

<system.serviceModel>
    <extensions>
        <endpointExtensions>
           <add name="udpDiscoveryEndpoint"
                type="System.Discovery.UdpEndpointCollectionElement, System.Discovery.dll, Version=1.0.0.0, Culture=neutral, PublicKeyToken=ffffffffffffffff"/>
        </endpointExtensions> 
    </extensions>
</system.serviceModel>

After the standard endpoint has been registered, you can use it as shown in the following example. In the <endpoint> element element, the kind attribute specifies the standard endpoint type that has been registered in the <endpointExtensions> section. The endpointConfiguration attribute will be identical to the name attribute of the configuration element of the standard endpoint in the **<standardEndpoints> ** section.

<system.serviceModel>
    <services>
      <service name="Service1">
        <endpoint kind="udpDiscoveryEndpoint"
                  endpointConfiguration="udpConfig" />
      </service>
    </services>
    <standardEndpoints>
      <udpDiscoveryEndpoint>
        <standardEndpoint
                  name="udpConfig"
                  multicastAddress="soap.udp://239.255.255.250:3703"
                  ... />
      </udpDiscoveryEndpoint>
    </standardEndpoints>
  </system.serviceModel>