SoapServices.DecodeXmlNamespaceForClrTypeNamespace 方法

定义

从提供的公共语言运行时命名空间解码 XML 命名空间和程序集名称。

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

参数

inNamespace
String

公共语言运行时命名空间。

typeNamespace
String

此方法返回时,包含一个 String 包含解码的命名空间名称。 此参数未初始化传递。

assemblyName
String

此方法返回时,包含一个 String 包含解码的程序集名称。 此参数未初始化传递。

返回

true 如果已成功解码命名空间和程序集名称,则为 ;否则,为 false.

属性

例外

参数 inNamespacenull 空。

即时调用方没有基础结构权限。

示例

下面的代码示例演示如何使用此方法。 该代码示例是 SoapServices 类中的一个较大示例的一部分。

// 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);

注解

当.NET框架分析 XML 流时,它需要知道如何将从流读取的 XML 转换为公共语言运行时类型。 指定 .NET Framework 如何生成和分析 XML 流的信息存储在位于 System.Runtime.Remoting.Metadata 命名空间的自定义属性中。 可通过两种方法在配置文件中指定此信息:通过显式指定映射,或指定要预加载的对象类型。 当前方法支持检索此类映射。

适用于