Export (0) Print
Expand All

XmlMediaTypeFormatter Class

MediaTypeFormatter class to handle Xml.

System.Object
  System.Net.Http.Formatting.MediaTypeFormatter
    System.Net.Http.Formatting.XmlMediaTypeFormatter

Namespace:  System.Net.Http.Formatting
Assembly:  System.Net.Http.Formatting (in System.Net.Http.Formatting.dll)

public class XmlMediaTypeFormatter : MediaTypeFormatter

The XmlMediaTypeFormatter type exposes the following members.

  NameDescription
Public methodXmlMediaTypeFormatter()Initializes a new instance of the XmlMediaTypeFormatter class.
Protected methodXmlMediaTypeFormatter(XmlMediaTypeFormatter)Initializes a new instance of the XmlMediaTypeFormatter class.
Top

  NameDescription
Public propertyStatic memberDefaultMediaTypeGets the default media type for the XML formatter.
Public propertyIndentGets or sets a value indicating whether to indent elements when writing data.
Public propertyMaxDepthGets and sets the maximum nested node depth.
Public propertyMediaTypeMappingsGets the mutable collection of MediaTypeMapping objects that match HTTP requests to media types. (Inherited from MediaTypeFormatter.)
Public propertyRequiredMemberSelectorGets or sets the IRequiredMemberSelector instance used to determine required members. (Inherited from MediaTypeFormatter.)
Public propertySupportedEncodingsGets the mutable collection of character encodings supported bythis MediaTypeFormatter. (Inherited from MediaTypeFormatter.)
Public propertySupportedMediaTypesGets the mutable collection of media types supported bythis MediaTypeFormatter. (Inherited from MediaTypeFormatter.)
Public propertyUseXmlSerializerGets or sets a value indicating whether the XML formatter uses the XmlSerializer as the default serializer, instead of using the DataContractSerializer.
Public propertyWriterSettingsGets the settings to be used while writing.
Top

  NameDescription
Public methodCanReadTypeQueries whether the XmlMediaTypeFormatter can deserializean object of the specified type. (Overrides MediaTypeFormatter.CanReadType(Type).)
Public methodCanWriteTypeQueries whether the XmlMediaTypeFormatter can serializean object of the specified type. (Overrides MediaTypeFormatter.CanWriteType(Type).)
Public methodCreateDataContractSerializerCalled during deserialization to get the DataContractSerializer serializer.
Protected methodCreateXmlReaderCalled during deserialization to get the XML reader to use for reading objects from the stream.
Public methodCreateXmlSerializerCalled during deserialization to get the XML serializer.
Protected methodCreateXmlWriterCalled during serialization to get the XML writer to use for writing objects to the stream.
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Protected methodGetDeserializerCalled during deserialization to get the XML serializer to use for deserializing objects.
Public methodGetHashCode (Inherited from Object.)
Public methodGetPerRequestFormatterInstanceReturns a specialized instance of the MediaTypeFormatter that can format a response for the given parameters. (Inherited from MediaTypeFormatter.)
Protected methodGetSerializerCalled during serialization to get the XML serializer to use for serializing objects.
Public methodGetType (Inherited from Object.)
Public methodInvokeCreateXmlReaderThis method is to support infrastructure and is not intended to be used directly from your code.
Public methodInvokeCreateXmlWriterThis method is to support infrastructure and is not intended to be used directly from your code.
Public methodInvokeGetDeserializerThis method is to support infrastructure and is not intended to be used directly from your code.
Public methodInvokeGetSerializerThis method is to support infrastructure and is not intended to be used directly from your code.
Protected methodMemberwiseClone (Inherited from Object.)
Public methodReadFromStreamAsync(Type, Stream, HttpContent, IFormatterLogger) Called during deserialization to read an object of the specified type from the specified readStream. (Overrides MediaTypeFormatter.ReadFromStreamAsync(Type, Stream, HttpContent, IFormatterLogger).)
Public methodReadFromStreamAsync(Type, Stream, HttpContent, IFormatterLogger, CancellationToken)Asynchronously deserializes an object of the specified type. (Inherited from MediaTypeFormatter.)
Public methodRemoveSerializerUnregisters the serializer currently associated with the given type.
Public methodSelectCharacterEncodingDetermines the best character encoding for reading or writing an HTTP entity body, given a set of content headers. (Inherited from MediaTypeFormatter.)
Public methodSetDefaultContentHeaders Sets the default headers for content that will be formatted using this formatter. This method is called from the ObjectContent constructor. This implementation sets the Content-Type header to the value of mediaType if it is not null. If it is null it sets the Content-Type to the default media type of this formatter. If the Content-Type does not specify a charset it will set it using this formatters configured Encoding. (Inherited from MediaTypeFormatter.)
Public methodSetSerializer(Type, XmlObjectSerializer)Registers an XmlObjectSerializer to read or write objects of a specified type.
Public methodSetSerializer(Type, XmlSerializer)Registers an XmlSerializer to read or write objects of a specified type.
Public methodSetSerializer<T>(XmlObjectSerializer)Registers an XmlObjectSerializer to read or write objects of a specified type.
Public methodSetSerializer<T>(XmlSerializer)Registers an XmlSerializer to read or write objects of a specified type.
Public methodToString (Inherited from Object.)
Public methodWriteToStreamAsync(Type, Object, Stream, HttpContent, TransportContext)Asynchronously writes an object of the specified type. (Inherited from MediaTypeFormatter.)
Public methodWriteToStreamAsync(Type, Object, Stream, HttpContent, TransportContext, CancellationToken)Called during serialization to write an object of the specified type to the specified writeStream. (Overrides MediaTypeFormatter.WriteToStreamAsync(Type, Object, Stream, HttpContent, TransportContext, CancellationToken).)
Top

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft