ContractReference.Namespace Field

XML namespace for service description references in discovery documents.

Namespace: System.Web.Services.Discovery
Assembly: System.Web.Services (in system.web.services.dll)

public:
literal String^ Namespace
public static final String Namespace
public const var Namespace : String
Not applicable.

Within a discovery document, a reference to a Service Description is contained within a contractRef XML element, which is a part of the XML namespace specified in the Namespace constant.

The following code example outputs to the console the value of the Namespace constant.

// Call the Constructor of ContractReference.
ContractReference^ myContractReference = gcnew ContractReference;
XmlDocument^ myXmlDocument = gcnew XmlDocument;

// Read the discovery document for the 'contractRef' tag.
myXmlDocument->Load( "http://localhost/Discoverydoc.disco" );
XmlNode^ myXmlRoot = myXmlDocument->FirstChild;
XmlNode^ myXmlNode = myXmlRoot[ "scl:contractRef" ];
XmlAttributeCollection^ myAttributeCollection = myXmlNode->Attributes;
myContractReference->Ref = myAttributeCollection[ 0 ]->Value;
Console::WriteLine( "The URL to the referenced service description is : {0}", myContractReference->Ref );
myContractReference->DocRef = myAttributeCollection[ 1 ]->Value;
Console::WriteLine( "The URL implementing the referenced service description is : {0}", myContractReference->DocRef );
Console::WriteLine( "Namespace for the referenced service description is : {0}", ContractReference::Namespace );

// Call the Constructor of ContractReference.
ContractReference myContractReference = new ContractReference();
XmlDocument myXmlDocument = new XmlDocument();

// Read the discovery document for the 'contractRef' tag.
myXmlDocument.Load("http://localhost/Discoverydoc.disco");

XmlNode myXmlRoot = myXmlDocument.get_FirstChild();
XmlNode myXmlNode = myXmlRoot.get_Item("scl:contractRef");
XmlAttributeCollection myAttributeCollection = myXmlNode.
    get_Attributes();
myContractReference.set_Ref(myAttributeCollection.Item(0).get_Value());
Console.WriteLine("The URL to the referenced service "
    + "description is : {0}", myContractReference.get_Ref());
myContractReference.set_DocRef(myAttributeCollection.Item(1).
    get_Value());
Console.WriteLine("The URL implementing the referenced service "
    + "description is : {0}", myContractReference.get_DocRef());
Console.WriteLine("Namespace for the referenced service "
    + "description is : {0}", ContractReference.Namespace);

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show: