ContractReference.DocRef 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取或设置实现在 Ref 属性中引用的服务说明的 XML Web services 的 URL。
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
属性值
实现在 Ref 属性中引用的服务说明的 XML Web services 的 URL。
示例
下面的代码示例设置 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 元素的两个属性。
Attribute | 说明 |
---|---|
ref | 服务说明的 URL。 该 Ref 属性表示特性的值 ref 。 |
docRef | 实现由属性指定的服务说明的 ref XML Web 服务的 URL。 该 DocRef 属性表示特性的值 docRef 。 |