ContractReference.DocRef 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定 XML Web Service 的 URL,此服務會實作 Ref 屬性中參考的服務描述。
public:
property System::String ^ DocRef { System::String ^ get(); void set(System::String ^ value); };
public string DocRef { get; set; }
member this.DocRef : string with get, set
Public Property DocRef As String
屬性值
XML Web Service 的 URL,實作 Ref 屬性中所參考的服務描述。
範例
下列程式碼範例會設定 DocRef 的 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("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.
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)
myContractReference.DocRef = myAttributeCollection(1).Value
Console.WriteLine("The URL implementing the referenced service description is : {0}", myContractReference.DocRef)
備註
在探索檔中,服務描述的參考包含在 XML 元素內 contractRef
。
contractRef
XML 元素有下表所述的兩個屬性。
屬性 | 描述 |
---|---|
ref | 服務描述的 URL。 屬性 Ref 代表屬性的值 ref 。 |
docRef | 實作 屬性所指定之服務描述的 ref XML Web 服務的 URL。 屬性 DocRef 代表屬性的值 docRef 。 |