Export (0) Print
Expand All

WebClientProtocol.Url Property

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

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

Property Value

The base URL of the XML Web service the client is requesting. The default is a Empty.

Remarks

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.

Example

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


[C++] 
// Set the URL property to a different Web server than that described in the
// service description.
math->Url = S"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))

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

WebClientProtocol Class | WebClientProtocol Members | System.Web.Services.Protocols Namespace

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft