<extensions>
此配置元素包含一个 XML 元素集合,该集合包含随可检测到的标准元数据(EPR、ContractTypeName、BindingName、Scope 和 ListenURI)一起发布的自定义元数据。 下面是使用此配置元素的示例。
<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">
<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>