This documentation is archived and is not being maintained.

ContractReference::DocRef Property

Gets and sets the URL for a XML Web service implementing the service description referenced in the Ref property.

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

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

Property Value

Type: System::String
The URL for a XML Web service implementing the Service Description referenced in the Ref property.

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 DocRef property of 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 );
myContractReference->DocRef = myAttributeCollection[ 1 ]->Value;
Console::WriteLine( "The URL implementing the referenced service description is : {0}", myContractReference->DocRef );
// 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);

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: