Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

SoapQName Class

Wraps an XSD QName type.

System.Object
  System.Runtime.Remoting.Metadata.W3cXsd2001.SoapQName

Namespace:  System.Runtime.Remoting.Metadata.W3cXsd2001
Assembly:  mscorlib (in mscorlib.dll)

[SerializableAttribute]
[ComVisibleAttribute(true)]
public sealed class SoapQName : ISoapXsd

The SoapQName type exposes the following members.

  NameDescription
Public methodSoapQName()Initializes a new instance of the SoapQName class.
Public methodSoapQName(String)Initializes a new instance of the SoapQName class with the local part of a qualified name.
Public methodSoapQName(String, String)Initializes a new instance of the SoapQName class with the namespace alias and the local part of a qualified name.
Public methodSoapQName(String, String, String)Initializes a new instance of the SoapQName class with the namespace alias, the local part of a qualified name, and the namespace that is referenced by the alias.
Top

  NameDescription
Public propertyKeyGets or sets the namespace alias of a qualified name.
Public propertyNameGets or sets the name portion of a qualified name.
Public propertyNamespaceGets or sets the namespace that is referenced by Key.
Public propertyStatic memberXsdTypeGets the XML Schema definition language (XSD) of the current SOAP type.
Top

  NameDescription
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodGetXsdTypeReturns the XML Schema definition language (XSD) of the current SOAP type.
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodStatic memberParseConverts the specified String into a SoapQName object.
Public methodToStringReturns the qualified name as a String. (Overrides Object.ToString().)
Top

For more information about XSD data types, see the "XML Data Types Reference" in the MSDN Library at http://msdn.microsoft.com/library.

The following code example shows how to use the members in the SoapQName class to convert between a SoapQName object and an XSD QName string.


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

    }
}


.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Community Additions

ADD
Show:
© 2015 Microsoft