Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
 Url Property

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

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

Gets or sets the base URL of the XML Web service the client is requesting.

Namespace:  System.Web.Services.Protocols
Assembly:  System.Web.Services (in System.Web.Services.dll)
Visual Basic (Declaration)
Public Property Url As String
Visual Basic (Usage)
Dim instance As WebClientProtocol
Dim value As String

value = instance.Url

instance.Url = value
C#
public string Url { get; set; }
Visual C++
public:
property String^ Url {
    String^ get ();
    void set (String^ value);
}
JScript
public function get Url () : String
public function set Url (value : String)

Property Value

Type: System..::.String
The base URL of the XML Web service the client is requesting. The default is a Empty.

Proxy classes generated using Wsdl.exe will set a default Url property for the client to use. The default Url is determined by the location attribute found in the service description from which the proxy class was generated.

Derived classes supporting specific protocols, such as HttpGetClientProtocol and HttpPostClientProtocol might add extra information to Url to make the XML Web service request.

The Url property can be changed to refer to any XML Web service that implements the same service description that the proxy class was generated from.

The following example changes the Url property for the math XML Web service to the Web server named http:// www.contoso.com.

Visual Basic
' Set the URL property to a different Web server than that described in the
' service description.
math.Url = "http://www.contoso.com/math.asmx"
Dim total As Integer = math.Add(Convert.ToInt32(Num1.Text), _
                                 Convert.ToInt32(Num2.Text))


C#
// Set the URL property to a different Web server than that described in the
// service description.
math.Url = "http://www.contoso.com/math.asmx";
int total = math.Add(Convert.ToInt32(Num1.Text), Convert.ToInt32(Num2.Text));


Visual C++
// Set the URL property to a different Web server than that described in the
// service description.
math->Url = "http://www.contoso.com/math.asmx";
int total = math->Add( Convert::ToInt32( Num1.Text ), Convert::ToInt32( Num2.Text ) );

JScript
// Set the URL property to a different Web server than that described in the
// service description.
math.Url = "http://www.contoso.com/math.asmx"
var total : int = math.Add(Convert.ToInt32(Num1.Text), Convert.ToInt32(Num2.Text))


Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98, Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 3.5, 2.0, 1.0
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker