SoapQName 类

定义

包装 XSD QName 类型。

public ref class SoapQName sealed : System::Runtime::Remoting::Metadata::W3cXsd2001::ISoapXsd
[System.Serializable]
public sealed class SoapQName : System.Runtime.Remoting.Metadata.W3cXsd2001.ISoapXsd
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class SoapQName : System.Runtime.Remoting.Metadata.W3cXsd2001.ISoapXsd
[<System.Serializable>]
type SoapQName = class
    interface ISoapXsd
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type SoapQName = class
    interface ISoapXsd
Public NotInheritable Class SoapQName
Implements ISoapXsd
继承
SoapQName
属性
实现

示例

下面的代码示例演示如何使用 类中的SoapQName成员在 对象和 XSD QName 字符串之间SoapQName转换。

#using <System.Runtime.Remoting.dll>
using namespace System;
using namespace System::Runtime::Remoting::Metadata::W3cXsd2001;

int main()
{
   // Parse an XSD formatted string to create a SoapQName object.
   String^ xsdQName = L"tns:SomeName";
   SoapQName^ qName = SoapQName::Parse( xsdQName );

   // Print the value of the SoapQName object in XSD format.
   Console::WriteLine( L"The SoapQName object in XSD format is {0}.", qName );

   // Print the XSD type string of the SoapQName object.
   Console::WriteLine( L"The XSD type of the SoapQName "
   L"object is {0}.", qName->GetXsdType() );

   // Print the XSD type string of the SoapQName class.
   Console::WriteLine( L"The XSD type of the SoapQName class "
   L"is {0}.", SoapQName::XsdType );

   // Create a QName object.
   SoapQName^ soapQNameInstance = gcnew SoapQName(
      L"tns",L"SomeName",L"http://example.org" );
   
   // Print the key the SoapQName object.
   Console::WriteLine( L"The key of the SoapQName object is {0}.",
      soapQNameInstance->Key );

   // Print the name of the SoapQName object.
   Console::WriteLine( L"The name of the SoapQName "
   L"object is {0}.", soapQNameInstance->Name );

   // Print the namespace of the SoapQName class.
   Console::WriteLine( L"The namespace for this instance of SoapQName is {0}.",
      soapQNameInstance->Namespace );
}
using System;
using System.Runtime.Remoting.Metadata.W3cXsd2001;

public class Demo
{
    public static void Main(string[] args)
    {
        // Parse an XSD formatted string to create a SoapQName object.
        string xsdQName = "tns:SomeName";
        SoapQName qName = SoapQName.Parse(xsdQName);

        // Print the value of the SoapQName object in XSD format.
        Console.WriteLine(
            "The SoapQName object in XSD format is {0}.",
            qName.ToString());

        // Print the XSD type string of the SoapQName object.
        Console.WriteLine("The XSD type of the SoapQName " +
            "object is {0}.", qName.GetXsdType());

        // Print the XSD type string of the SoapQName class.
        Console.WriteLine(
            "The XSD type of the SoapQName class " +
            "is {0}.", SoapQName.XsdType);

        // Create a QName object.
        SoapQName soapQNameInstance =
            new SoapQName("tns", "SomeName", "http://example.org");

        // Print the key the SoapQName object.
        Console.WriteLine("The key of the SoapQName " +
            "object is {0}.", soapQNameInstance.Key);

        // Print the name of the SoapQName object.
        Console.WriteLine("The name of the SoapQName " +
            "object is {0}.", soapQNameInstance.Name);

        // Print the namespace of the SoapQName class.
        Console.WriteLine("The namespace for this instance of SoapQName " +
            "is {0}.", soapQNameInstance.Namespace);
    }
}

注解

有关 XSD 数据类型的详细信息,请参阅 XML 数据类型参考

构造函数

SoapQName()

初始化 SoapQName 类的新实例。

SoapQName(String)

用限定名的本地部分初始化 SoapQName 类的新实例。

SoapQName(String, String)

用限定名的命名空间别名和本地部分初始化 SoapQName 类的新实例。

SoapQName(String, String, String)

用限定名的命名空间别名、本地部分以及由该别名引用的命名空间来初始化 SoapQName 类的新实例。

属性

Key

获取或设置限定名的命名空间别名。

Name

获取或设置限定名的名称部分。

Namespace

获取或设置由 Key 引用的命名空间。

XsdType

获取当前 SOAP 类型的 XML 架构定义语言 (XSD)。

方法

Equals(Object)

确定指定对象是否等于当前对象。

(继承自 Object)
GetHashCode()

作为默认哈希函数。

(继承自 Object)
GetType()

获取当前实例的 Type

(继承自 Object)
GetXsdType()

返回当前 SOAP 类型的 XML 架构定义语言 (XSD)。

MemberwiseClone()

创建当前 Object 的浅表副本。

(继承自 Object)
Parse(String)

将指定的 String 转换为 SoapQName 对象。

ToString()

String 的形式返回限定名。

适用于