Implement the IPolicyExportExtension interface on a System.ServiceModel.Channels..::.BindingElement object to write statements about endpoint capabilities or requirements into the WSDL information exposed by a particular endpoint. Typically the binding element is one that implements some feature, but this is not required. To load your policy exporter from a configuration file, implement a System.ServiceModel.Configuration..::.BindingElementExtensionElement that returns the policy exporter BindingElement object.
The policy exporter is used by Windows Communication Foundation (WCF) to use policy assertions to communicate to clients the existence of that custom binding requirement or endpoint capability.
The ExportPolicy method takes the MetadataExporter and PolicyConversionContext objects. Use the GetBindingAssertions, GetMessageBindingAssertions, and GetOperationBindingAssertions methods to obtain collections of policy assertions that have already been exported at various scopes. Then add your custom policy assertion object to the appropriate collection.
The Contract property exposes the ContractDescription for the endpoint that is being exported. This allows the IPolicyExportExtension extension to correctly scope their exported policy assertions. For example, security attributes in code may add behaviors to the ContractDescription that indicate where security policy assertions should be added.
The IPolicyExportExtension mechanism only supports exporting policy assertions in WSDL. To export custom WSDL elements you must use the IWsdlExportExtension mechanism to modify the WSDL directly.
Once custom policy assertions have been attached to the WSDL information, clients can detect and import the custom binding assertions by using an IPolicyImportExtension object.