HttpWebClientProtocol クラスとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > HttpWebClientProtocol クラスの意味・解説 

HttpWebClientProtocol クラス

HTTP トランスポート プロトコル使用するすべての XML Web サービス クライアント プロキシ基本クラス

名前空間: System.Web.Services.Protocols
アセンブリ: System.Web.Services (system.web.services.dll 内)
構文構文

<ComVisibleAttribute(True)> _
Public MustInherit Class
 HttpWebClientProtocol
    Inherits WebClientProtocol
Dim instance As HttpWebClientProtocol
[ComVisibleAttribute(true)] 
public abstract class HttpWebClientProtocol
 : WebClientProtocol
[ComVisibleAttribute(true)] 
public ref class HttpWebClientProtocol abstract
 : public WebClientProtocol
/** @attribute ComVisibleAttribute(true) */ 
public abstract class HttpWebClientProtocol
 extends WebClientProtocol
ComVisibleAttribute(true) 
public abstract class HttpWebClientProtocol
 extends WebClientProtocol
解説解説

このクラスプロパティ使用してXML Web サービス要求および応答送信するために使用する HTTP 要求オブジェクト動作制御します。このプロパティは、HttpWebRequest のプロパティ割り当てられます。

HTTP使用して XML Web サービス通信する場合は、XML Web サービス使用する HttpWebClientProtocol から間接または直接派生するプロキシ クラス作成する必要がありますプロキシ クラス手動作成する代わりに、Wsdl.exe ツール使用して指定されXML Web サービスサービス説明からプロキシ クラス作成できます

HttpWebClientProtocol はすべてのプロキシ クラス基本クラスであるため、そのプロパティ作成したプロキシ クラスプロパティ同じになります。これらのプロパティは、基になるトランスポート要求動作制御するために役立ちます。たとえば、ファイアウォールとおして XML Web サービス呼び出すには、Proxy プロパティ使用します。これらの多数プロパティは、Web 要求を行う HttpWebRequest初期化使用されます。

SoapHttpClientProtocol、HttpGetClientProtocol、および HttpPostClientProtocol は、HttpWebClientProtocol から直接的または間接的に派生してそれぞれ SOAP、HTTP-GET、および HTTP-POST をサポートします

使用例使用例

XML Web サービス (Math) を呼び出す ASP.NET Web フォームの例を次に示します。この Web フォームでは、EnterBtn_Click 関数の中で、サーバークライアントを他のサイト自動的にリダイレクトできるようにします。また XML Web サービス メソッド呼び出す前にクライアント認証資格情報プロキシ設定要求エンコーディング、および要求タイムアウト設定します

<%@ Page Language="VB" %>
<%@ Import Namespace="System.Net"
 %>

<html>
    <script language="VB" runat="server">

    Sub EnterBtn_Click(Src As Object,
 E As EventArgs)
        Dim math As New
 MyMath.Math()
        
        ' Allow the server to redirect the request.
        math.AllowAutoRedirect = True
        
        ' Set the client-side credentials using the Credentials property.
        Dim credentials = New NetworkCredential("Joe",
 "password", "mydomain")
        math.Credentials = credentials
        
        ' Set the proxy server to proxyserver, set the port to 80 and
 specify to bypass
        ' the proxy server for local addresses.
        Dim proxyObject = New WebProxy("http://proxyserver:80",
 True)
        math.Proxy = proxyObject
        
        ' Set the encoding to utf-8.
        math.RequestEncoding = System.Text.Encoding.UTF8
        
        ' Set the time out to 15 seconds.
        math.Timeout = 15000
        
        Dim iTotal As Integer
 = math.Add(Convert.ToInt32(Num1.Text), _
           Convert.ToInt32(Num2.Text))
        Total.Text = "Total: " & iTotal.ToString()
    End Sub
 
    </script>
 
    <body>
       <form action="MathClient.aspx" runat=server>
           
          Enter the two numbers you want to add and
 then press the Total button.
          <p>
          Number 1: <asp:textbox id="Num1" runat=server/>
  +
          Number 2: <asp:textbox id="Num2" runat=server/>
 =
          <asp:button text="Total" Onclick="EnterBtn_Click"
 runat=server/>
          <p>
          <asp:label id="Total"  runat=server/>
          
       </form>
    </body>
 </html>
   
<%@ Page Language="C#" %>
<%@ Import Namespace="System.Net" %>

<html>
    <script language="C#" runat="server">
       void EnterBtn_Click(Object Src, EventArgs E) 
          {
             MyMath.Math math = new MyMath.Math();

             // Allow the server to redirect the request.
             math.AllowAutoRedirect = true;

             // Set the client-side credentials using the Credentials
 property.
             ICredentials credentials =
                new NetworkCredential("Joe","password"
,"mydomain");
             math.Credentials = credentials;

             // Set the proxy server to proxyserver, set the port to
 80, and specify to bypass
             // the proxy server for local addresses.
             IWebProxy proxyObject = new WebProxy("http://proxyserver:80"
,true);
             math.Proxy = proxyObject;

             // Set the encoding to utf-8.
             math.RequestEncoding = System.Text.Encoding.UTF8;

             // Set the time out to 15 seconds
             math.Timeout = 15000;

             int total = math.Add(Convert.ToInt32(Num1.Text),
                Convert.ToInt32(Num2.Text));
             Total.Text = "Total: " + total.ToString();
         }
 
    </script>
 
    <body>
       <form action="MathClient.aspx" runat=server>
           
          Enter the two numbers you want to add and then press the Total button.
          <p>
          Number 1: <asp:textbox id="Num1" runat=server/>  +
          Number 2: <asp:textbox id="Num2" runat=server/> =
          <asp:button text="Total" Onclick="EnterBtn_Click"
 runat=server/>
          <p>
          <asp:label id="Total"  runat=server/>
          
       </form>
    </body>
 </html>
   
継承階層継承階層
System.Object
   System.MarshalByRefObject
     System.ComponentModel.Component
       System.Web.Services.Protocols.WebClientProtocol
        System.Web.Services.Protocols.HttpWebClientProtocol
           System.Web.Services.Discovery.DiscoveryClientProtocol
           System.Web.Services.Protocols.HttpSimpleClientProtocol
           System.Web.Services.Protocols.SoapHttpClientProtocol
スレッド セーフスレッド セーフ
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
HttpWebClientProtocol メンバ
System.Web.Services.Protocols 名前空間
WebClientProtocol
WebRequest
SoapHttpClientProtocol
HttpGetClientProtocol クラス
HttpPostClientProtocol クラス


このページでは「.NET Framework クラス ライブラリ リファレンス」からHttpWebClientProtocol クラスを検索した結果を表示しています。
Weblioに収録されているすべての辞書からHttpWebClientProtocol クラスを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からHttpWebClientProtocol クラス を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「HttpWebClientProtocol クラス」の関連用語

HttpWebClientProtocol クラスのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



HttpWebClientProtocol クラスのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS