This documentation is archived and is not being maintained.

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

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(S"http://localhost/Discoverydoc.disco");

XmlNode * myXmlRoot = myXmlDocument -> FirstChild;
XmlNode * myXmlNode = myXmlRoot->Item[S"scl:contractRef"]; 
XmlAttributeCollection * myAttributeCollection = myXmlNode -> Attributes;

myContractReference->Ref = myAttributeCollection->ItemOf[0]->Value; 
Console::WriteLine(S"The URL to the referenced service description is : {0}", myContractReference -> Ref);
myContractReference -> DocRef = myAttributeCollection->ItemOf[1]->Value;
Console::WriteLine(S"The URL implementing the referenced service description is : {0}", myContractReference -> DocRef);
Console::WriteLine(S"Namespace for the referenced service description is : {0}", ContractReference::Namespace);

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

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

.NET Framework

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