This documentation is archived and is not being maintained.

ContractReference::Ref Property

Gets or sets the URL to the referenced service description.

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

public:
property String^ Ref {
	String^ get ();
	void set (String^ value);
}

Property Value

Type: System::String
The URL to the referenced service description.

Within a discovery document, a reference to a service description is contained within a contractRef XML element. The contractRef XML element has two attributes described in the following table.

Attribute

Description

ref

The URL for the service description.The Ref property represents the value of the ref attribute.

docRef

The URL for a XML Web service implementing the service description specified by the ref attribute. The DocRef property represents the value of the docRef attribute.

The following code example sets the Ref property of a ContractReference.

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

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: