SoapServices.DecodeXmlNamespaceForClrTypeNamespace Method

Definition

Decodes the XML namespace and assembly names from the provided common language runtime namespace.

public:
 static bool DecodeXmlNamespaceForClrTypeNamespace(System::String ^ inNamespace, [Runtime::InteropServices::Out] System::String ^ % typeNamespace, [Runtime::InteropServices::Out] System::String ^ % assemblyName);
public static bool DecodeXmlNamespaceForClrTypeNamespace (string inNamespace, out string typeNamespace, out string assemblyName);
[System.Security.SecurityCritical]
public static bool DecodeXmlNamespaceForClrTypeNamespace (string inNamespace, out string typeNamespace, out string assemblyName);
static member DecodeXmlNamespaceForClrTypeNamespace : string * string * string -> bool
[<System.Security.SecurityCritical>]
static member DecodeXmlNamespaceForClrTypeNamespace : string * string * string -> bool
Public Shared Function DecodeXmlNamespaceForClrTypeNamespace (inNamespace As String, ByRef typeNamespace As String, ByRef assemblyName As String) As Boolean

Parameters

inNamespace
String

The common language runtime namespace.

typeNamespace
String

When this method returns, contains a String that holds the decoded namespace name. This parameter is passed uninitialized.

assemblyName
String

When this method returns, contains a String that holds the decoded assembly name. This parameter is passed uninitialized.

Returns

true if the namespace and assembly names were successfully decoded; otherwise, false.

Attributes

Exceptions

The inNamespace parameter is null or empty.

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.

// Extract a CLR namespace and assembly name from an XML namespace.
String^ typeNamespace;
String^ assemblyName;
SoapServices::DecodeXmlNamespaceForClrTypeNamespace(
   xmlNamespace,typeNamespace,assemblyName );
Console::WriteLine( L"The name of the CLR namespace is {0}.", typeNamespace );
Console::WriteLine( L"The name of the CLR assembly is {0}.", assemblyName );
// Extract a CLR namespace and assembly name from an XML namespace.
string typeNamespace;
string assemblyName;
SoapServices.DecodeXmlNamespaceForClrTypeNamespace(xmlNamespace,
    out typeNamespace, out assemblyName);
Console.WriteLine("The name of the CLR namespace is {0}.", 
    typeNamespace);
Console.WriteLine("The name of the CLR assembly is {0}.", 
    assemblyName);

Remarks

When the .NET Framework is parsing an XML stream, it needs to know how to convert the XML read from the stream into common language runtime types. The information that specifies how the .NET Framework should generate and parse an XML stream is stored in custom attributes that are located in the System.Runtime.Remoting.Metadata namespace. There are two ways to specify this information in a configuration file: either by explicitly specifying the mappings, or by specifying which object types to preload. The current method supports the retrieval of such mappings.

Applies to