Printer Friendly Version      Send     
Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
Previous Versions
.NET Framework 1.1
.NET Framework
Reference
Properties
 Url Property
This page is specific to
Microsoft Visual Studio 2003/.NET Framework 1.1

Other versions are also available for the following:
.NET Framework Class Library
ContractReference.Url Property

Gets or sets the URL for the referenced Service Description.

[Visual Basic]
Overrides Public Property Url As String
[C#]
public override string Url {get; set;}
[C++]
public: __property String* get_Url();
public: __property void set_Url(String*);
[JScript]
public override function get Url() : String;
public override function set Url(String);

Property Value

The URL for the referenced service description.

Remarks

For the ContractReference class, the Url property returns the value of the Ref property.

Example

[Visual Basic] 
Dim myProtocol As New DiscoveryClientProtocol()

' Get the DiscoveryDocument.
Dim myDiscoveryDocument As DiscoveryDocument = _
    myProtocol.Discover("http://localhost/ContractReference/Test_vb.disco")
Dim myArrayList As ArrayList = _
    CType(myDiscoveryDocument.References, ArrayList)

' Get the ContractReference.
Dim myContractRefrence As ContractReference = _
    CType(myArrayList(0), ContractReference)

' Get the DefaultFileName associated with the .disco file.
Dim myFileName As String  = myContractRefrence.DefaultFilename

' Get the URL associated with the .disco file.
Dim myUrl As String  = myContractRefrence.Url
Console.WriteLine("The DefaulFilename is: " + myUrl)
Console.WriteLine("The URL is: " + myUrl)

[C#] 
DiscoveryClientProtocol myProtocol = new DiscoveryClientProtocol();

// Get the DiscoveryDocument.
DiscoveryDocument myDiscoveryDocument =
    myProtocol.Discover("http://localhost/ContractReference/test_cs.disco");
ArrayList myArrayList = (ArrayList)myDiscoveryDocument.References;

 // Get the ContractReference.
ContractReference myContractRefrence = (ContractReference)myArrayList[0];

// Get the DefaultFileName associated with the .disco file.
String myFileName = myContractRefrence.DefaultFilename;

// Get the URL associated with the .disco file.
String myUrl = myContractRefrence.Url;
Console.WriteLine("The DefaulFilename is: " + myUrl);
Console.WriteLine("The URL is: " + myUrl);

[C++] 
DiscoveryClientProtocol* myProtocol = new DiscoveryClientProtocol();

// Get the DiscoveryDocument.
DiscoveryDocument* myDiscoveryDocument =
    myProtocol->Discover(S"http://localhost/ContractReference/test_cs.disco");
ArrayList* myArrayList = dynamic_cast<ArrayList*>(myDiscoveryDocument->References);

// Get the ContractReference.
ContractReference* myContractRefrence = dynamic_cast<ContractReference*>(myArrayList->Item[0]);

// Get the DefaultFileName associated with the .disco file.
String* myFileName = myContractRefrence->DefaultFilename;

// Get the URL associated with the .disco file.
String* myUrl = myContractRefrence->Url;
Console::WriteLine(S"The DefaulFilename is: {0}", myUrl);
Console::WriteLine(S"The URL is: {0}", myUrl);

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter 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 | Ref

© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker