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,而不考虑传入的内容类型。

适用于