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)

[SettingsBindableAttribute(true)]
public string Url { get; set; }

Property Value

Type: System.String
The base URL of the XML Web service the client is requesting. The default is 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));

.NET Framework

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

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

Show:
© 2014 Microsoft