SoapServices.GetInteropTypeFromXmlElement(String, String) Method

Definition

Retrieves the Type that should be used during deserialization of an unrecognized object type with the given XML element name and namespace.

C#
public static Type GetInteropTypeFromXmlElement(string xmlElement, string xmlNamespace);
C#
[System.Security.SecurityCritical]
public static Type GetInteropTypeFromXmlElement(string xmlElement, string xmlNamespace);

Parameters

xmlElement
String

The XML element name of the unknown object type.

xmlNamespace
String

The XML namespace of the unknown object type.

Returns

The Type of object associated with the specified XML element name and namespace.

Attributes

Exceptions

The immediate caller does not have infrastructure permission.

Examples

The following code example shows how to use this method. This code example is part of a larger example provided for the SoapServices class.

C#
string interopTypeXmlElementName = 
    "ExampleClassElementName";
string interopTypeXmlNamespace = 
    "http://example.org/ExampleXmlNamespace";
Type interopType = SoapServices.GetInteropTypeFromXmlElement(
    interopTypeXmlElementName, 
    interopTypeXmlNamespace);
Console.WriteLine("The interop type is {0}.", interopType);

string interopTypeXmlTypeName = 
    "ExampleXmlTypeName";
string interopTypeXmlTypeNamespace = 
    "http://example.org/ExampleXmlTypeNamespace";
interopType = SoapServices.GetInteropTypeFromXmlType(
    interopTypeXmlTypeName, interopTypeXmlTypeNamespace);
Console.WriteLine("The interop type is {0}.", interopType);

Remarks

The current method returns values set up through RegisterInteropXmlElement and PreLoad.

Applies to

Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1