Share via


XmlSerializerCache.GetXmlSerializer Method

Returns an !:System.Xml.XmlSerializer for the specified type and default XML namespace.

Namespace: Microsoft.Web.Services2.Xml
Assembly: Microsoft.Web.Services2 (in microsoft.web.services2.dll)

Usage

'Usage
Dim type As Type
Dim defaultNamespace As String
Dim returnValue As XmlSerializer
returnValue = XmlSerializerCache.GetXmlSerializer(type, defaultNamespace)

Syntax

'Declaration
Public Shared Function GetXmlSerializer( _
    ByVal type As Type, _
    ByVal defaultNamespace As String _
) As XmlSerializer
public static XmlSerializer GetXmlSerializer(
    Type type, 
    string defaultNamespace
);
public: static XmlSerializer^ GetXmlSerializer(
    Type^ type, 
    String^ defaultNamespace
);
public static XmlSerializer GetXmlSerializer(
    Type type, 
    System.String defaultNamespace
);
public static function GetXmlSerializer(
     type : Type, 
     defaultNamespace : String
) : XmlSerializer;

Parameters

  • type
    The type of object that the !:System.Xml.XmlSerializer can serialize.
  • defaultNamespace
    The default namespace to use for all the XML elements.

Return Value

An !:System.Xml.XmlSerializer for the specified type and default XML namespace.

Remarks

This method returns an existing XML serializer if a match is found in the cache. Otherwise, this method returns a new XML serializer of the specified type and namespace and adds it to the cache.

Thread Safety

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

Platforms

Development Platforms

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, Windows Longhorn, and Windows 2000

Target Platforms

Windows 2000, Windows 2000 Server, Windows 2000 Advanced Server, Windows XP Home Edition, Windows XP Professional, Windows Server 2003, Windows Longhorn, Pocket PC, Windows CE, Smart Phone

See Also

Reference

XmlSerializerCache Class
Microsoft.Web.Services2.Xml Namespace

Other Resources

XmlSerializerCache Members