Partager via


SoapServices.RegisterInteropXmlType(String, String, Type) Méthode

Définition

Associe le nom de type et l'espace de noms XML donnés au type du runtime à utiliser durant la désérialisation.

public:
 static void RegisterInteropXmlType(System::String ^ xmlType, System::String ^ xmlTypeNamespace, Type ^ type);
public static void RegisterInteropXmlType (string xmlType, string xmlTypeNamespace, Type type);
[System.Security.SecurityCritical]
public static void RegisterInteropXmlType (string xmlType, string xmlTypeNamespace, Type type);
static member RegisterInteropXmlType : string * string * Type -> unit
[<System.Security.SecurityCritical>]
static member RegisterInteropXmlType : string * string * Type -> unit
Public Shared Sub RegisterInteropXmlType (xmlType As String, xmlTypeNamespace As String, type As Type)

Paramètres

xmlType
String

Type XML à utiliser durant la désérialisation.

xmlTypeNamespace
String

Espace de noms XML à utiliser durant la désérialisation.

type
Type

Type du runtime à utiliser durant la désérialisation.

Attributs

Exceptions

L'appelant immédiat n'a pas d'autorisation d'accès à l'infrastructure.

Exemples

L'exemple de code suivant montre comment utiliser cette méthode. Cet exemple de code fait partie d’un exemple plus grand fourni pour la SoapServices classe .

// Get the currently registered type for the given XML element
// and namespace.
String^ registeredXmlTypeName = L"ExampleXmlTypeName";
String^ registeredXmlTypeNamespace =
   L"http://example.org/ExampleXmlTypeNamespace";
registeredType = SoapServices::GetInteropTypeFromXmlType(
   registeredXmlTypeName, registeredXmlTypeNamespace );
Console::WriteLine( L"The registered interop type is {0}.",
   registeredType );

// Register a new type for the XML element and namespace.
SoapServices::RegisterInteropXmlType( registeredXmlTypeName,
   registeredXmlTypeNamespace,String::typeid );

// Get the currently registered type for the given XML element
// and namespace.
registeredType = SoapServices::GetInteropTypeFromXmlType(
   registeredXmlTypeName,registeredXmlTypeNamespace );
Console::WriteLine( L"The registered interop type is {0}.",
   registeredType );
// Get the currently registered type for the given XML element 
// and namespace.
string registeredXmlTypeName = 
    "ExampleXmlTypeName";
string registeredXmlTypeNamespace = 
    "http://example.org/ExampleXmlTypeNamespace";
registeredType = 
    SoapServices.GetInteropTypeFromXmlType(
    registeredXmlTypeName, 
    registeredXmlTypeNamespace);
Console.WriteLine(
    "The registered interop type is {0}.",
    registeredType);

// Register a new type for the XML element and namespace.
SoapServices.RegisterInteropXmlType(
    registeredXmlTypeName,
    registeredXmlTypeNamespace, 
    typeof(String));

// Get the currently registered type for the given XML element 
// and namespace.
registeredType = 
    SoapServices.GetInteropTypeFromXmlType(
    registeredXmlTypeName, 
    registeredXmlTypeNamespace);
Console.WriteLine(
    "The registered interop type is {0}.",
    registeredType);

S’applique à