ContractReference.Ref Property
Gets or sets the URL to the referenced service description.
[Visual Basic] Public Property Ref As String [C#] public string Ref {get; set;} [C++] public: __property String* get_Ref(); public: __property void set_Ref(String*); [JScript] public function get Ref() : String; public function set Ref(String);
Property Value
The URL to the referenced service description.
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. |
Example
[Visual Basic, C#, C++] The following code example sets the Ref property of a ContractReference.
[Visual Basic] ' Call the Constructor of ContractReference. Dim myContractReference As New ContractReference() Dim myXmlDocument As New XmlDocument() ' Read the discovery document for the 'contractRef' tag. myXmlDocument.Load("http://localhost/Discoverydoc.disco") Dim myXmlRoot As XmlNode = myXmlDocument.FirstChild Dim myXmlNode As XmlNode = myXmlRoot("scl:contractRef") Dim myAttributeCollection As XmlAttributeCollection = myXmlNode.Attributes myContractReference.Ref = myAttributeCollection(0).Value Console.WriteLine("The URL to the referenced service description is : {0}", myContractReference.Ref) [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); [C++] // 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);
[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button
in the upper-left corner of the page.
Requirements
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
See Also
ContractReference Class | ContractReference Members | System.Web.Services.Discovery Namespace | DocRef