次の方法で共有


WebClientProtocol.Url プロパティ

定義

クライアントが要求している XML Web サービスのベース URL を取得または設定します。

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

プロパティ値

クライアントが要求している XML Web サービスのベース URL。 既定値は、Empty です。

属性

次の例では、math XML Web サービスの Url プロパティを http:// www.contoso.com という名前の Web サーバーに変更します。

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

注釈

Wsdl.exe を使用して生成されたプロキシ クラスは、クライアントが使用する既定の Url プロパティを設定します。 既定の Url は、プロキシ クラスが生成されたサービスの説明にある場所属性によって決まります。

HttpGetClientProtocolHttpPostClientProtocolなど、特定のプロトコルをサポートする派生クラスは、XML Web サービス要求を行うためにUrlに追加情報を追加する場合があります。

Url プロパティは、プロキシ クラスが生成されたのと同じサービス記述を実装する XML Web サービスを参照するように変更できます。

適用対象

こちらもご覧ください