ContractReference.DocRef Property

Definition

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

C#
public string DocRef { get; set; }

Property Value

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

Examples

The following code example sets the DocRef property of ContractReference.

C#
// 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.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);

Remarks

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.

Applies to

Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

See also