Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
IPolicyExportExtension.ExportPolicy Method

AsymmetricSecurityBindingElement.IPolicyExportExtension.ExportPolicy Method

Exports a custom policy assertion about bindings, which is added to the Web Services Description Language (WSDL) information.

Namespace:  System.ServiceModel.Channels
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

void IPolicyExportExtension.ExportPolicy(
	MetadataExporter exporter,
	PolicyConversionContext context


Type: System.ServiceModel.Description.MetadataExporter

The MetadataExporter that you can use to modify the exporting process.

Type: System.ServiceModel.Description.PolicyConversionContext

The PolicyConversionContext that you can use to insert your custom policy assertion.


IPolicyExportExtension.ExportPolicy(MetadataExporter, PolicyConversionContext)

This method writes binding-related statements into the WSDL information exposed by a particular contract and is used by Windows Communication Foundation (WCF) to communicate to clients the existence of this custom binding element in the binding stack.

This method takes two parameters: 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 use this method to add your own policy assertions to the appropriate collection.

The Contract property exposes the ContractDescription for the endpoint that is being exported. This allows this method 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.

Once custom policy assertions are attached to the WSDL information, clients can detect and import the custom binding assertions by implementing an IPolicyImportExtension interface.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
© 2015 Microsoft