WebClientProtocol.Url Właściwość

Definicja

Pobiera lub ustawia podstawowy adres URL usługi sieci Web XML, o który żąda klient.

public:
 property System::String ^ Url { System::String ^ get(); void set(System::String ^ value); };
public string Url { get; set; }
[System.ComponentModel.SettingsBindable(true)]
public string Url { get; set; }
member this.Url : string with get, set
[<System.ComponentModel.SettingsBindable(true)>]
member this.Url : string with get, set
Public Property Url As String

Wartość właściwości

Podstawowy adres URL usługi sieci Web XML, o który żąda klient. Wartość domyślna to Empty.

Atrybuty

Przykłady

Poniższy przykład zmienia Url właściwość math usługi sieci Web XML na serwer sieci Web o nazwie 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"
Dim total As Integer = math.Add(Convert.ToInt32(Num1.Text), _
                                 Convert.ToInt32(Num2.Text))

Uwagi

Klasy serwerów proxy generowane przy użyciu Wsdl.exe ustawią właściwość domyślną Url , która będzie używana przez klienta. Wartość domyślna Url jest określana przez atrybut lokalizacji znaleziony w opisie usługi, z którego wygenerowano klasę serwera proxy.

Klasy pochodne obsługujące określone protokoły, takie jak HttpGetClientProtocol i HttpPostClientProtocol mogą dodawać dodatkowe informacje Url w celu wykonania żądania usługi sieci Web XML.

Właściwość Url można zmienić tak, aby odwoływała się do dowolnej usługi sieci Web XML, która implementuje ten sam opis usługi, z którego została wygenerowana klasa serwera proxy.

Dotyczy

Zobacz też