WebContentTypeMapper.GetMessageFormatForContentType(String) 方法

定义

在派生类中重写时,返回用于指定内容类型的消息格式。

public:
 abstract System::ServiceModel::Channels::WebContentFormat GetMessageFormatForContentType(System::String ^ contentType);
public abstract System.ServiceModel.Channels.WebContentFormat GetMessageFormatForContentType (string contentType);
abstract member GetMessageFormatForContentType : string -> System.ServiceModel.Channels.WebContentFormat
Public MustOverride Function GetMessageFormatForContentType (contentType As String) As WebContentFormat

参数

contentType
String

用于指示要解释的数据为 MIME 类型的内容类型。

返回

WebContentFormat,指定将消息内容类型映射到的格式。

注解

这是一种扩展机制,可用来重写将内容类型映射到 Web 内容格式的方式。 例如,如果所有传入消息都作为“原始二进制数据”进行处理,而不执行 XML 或 JSON 分析,则可以实现 WebContentTypeMapper 始终返回 Raw 的 ,而不考虑传入的内容类型。

适用于