MtomMessageEncodingBindingElement.IPolicyExportExtension.ExportPolicy(MetadataExporter, PolicyConversionContext) 方法

定義

將產生的原則判斷提示插入 WSDL,該原則判斷提示會指出正在使用 MTOM 編碼。Inserts a policy assertion into the WSDL, when it is generated, which indicates that an MTOM encoding is being used.

 virtual void System.ServiceModel.Description.IPolicyExportExtension.ExportPolicy(System::ServiceModel::Description::MetadataExporter ^ exporter, System::ServiceModel::Description::PolicyConversionContext ^ policyContext) = System::ServiceModel::Description::IPolicyExportExtension::ExportPolicy;
void IPolicyExportExtension.ExportPolicy (System.ServiceModel.Description.MetadataExporter exporter, System.ServiceModel.Description.PolicyConversionContext policyContext);
Sub ExportPolicy (exporter As MetadataExporter, policyContext As PolicyConversionContext) Implements IPolicyExportExtension.ExportPolicy

參數

exporter
MetadataExporter

WsdlExporter,可匯出合約資訊。The WsdlExporter that exports the contract information.

policyContext
PolicyConversionContext

WsdlContractConversionContext 物件,提供從匯出的 WSDL 項目到合約描述之間的對應。A WsdlContractConversionContext object that provides mappings from exported WSDL elements to the contract description.

實作

例外狀況

policyContextnullpolicyContext is null.

備註

這個原則判斷提示會指出可在這個端點使用 MTOM 最佳化。This policy assertion indicates that MTOM optimization can be used at this endpoint. 這樣表示必須接受使用文字或 MTOM 格式的訊息。It implies that messages either in the text or MTOM format must be accepted. 在用戶端上,會剖析這個原則判斷提示,並且啟用接受 MTOM 編碼訊息的功能。On the client, this policy assertion is parsed and the ability to accept MTOM-encoded messages is enabled. 此原則判斷提示如下。The policy assertion is as follows.

<wsoma:OptimizedMimeSerialization xmlns:wsoma="http://schemas.xmlsoap.org/ws/2004/09/policy/optimizedmimeserialization" />  

適用於