BasicHttpBinding.MessageEncoding BasicHttpBinding.MessageEncoding BasicHttpBinding.MessageEncoding BasicHttpBinding.MessageEncoding Property

定义

获取或设置是使用 MTOM 还是文本对 SOAP 消息进行编码。Gets or sets whether MTOM or Text is used to encode SOAP messages.

public:
 property System::ServiceModel::WSMessageEncoding MessageEncoding { System::ServiceModel::WSMessageEncoding get(); void set(System::ServiceModel::WSMessageEncoding value); };
public System.ServiceModel.WSMessageEncoding MessageEncoding { get; set; }
member this.MessageEncoding : System.ServiceModel.WSMessageEncoding with get, set
Public Property MessageEncoding As WSMessageEncoding

属性值

WSMessageEncoding 的值,指示是使用 MTOM 还是文本/XML 对 SOAP 消息进行编码。The value of WSMessageEncoding that indicates whether MTOM or Text/XML is used to encode SOAP messages. 默认值为 TextThe default value is Text.

示例

下面的示例将 MessageEncoding 设置为 Text。The following example sets MessageEncoding to Text.


BasicHttpBinding binding = new BasicHttpBinding();
// Use double the default value
binding.MessageEncoding = WSMessageEncoding.Text;

也可以在配置文件中设置此属性的值。The value of this property can also be set in the configuration file.

适用于