Export (0) Print
Expand All

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)

public string Url { get; set; }
/** @property */
public String get_Url ()

/** @property */
public void set_Url (String value)

public function get Url () : String

public function set Url (value : String)

Not applicable.

Property Value

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.

// 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));


// 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));

// 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 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0, 1.0
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2014 Microsoft