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

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

HttpSimpleClientProtocol クラス

単純な HTTP-GET プロトコル バインディングおよび HTTP-POST プロトコル バインディング使用してXML Web サービスとの通信を行う基本クラス表します

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

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

このクラスは、HTTP 経由XML Web サービスとの通信を行う大部分実装が、エンコーダ使用してパラメータ戻り値を共通の MIME 形式エンコードすることを指定します。これらのエンコーダは、MimeFormatter クラスから派生します。既定では、HttpSimpleClientProtocol から派生したプロキシ クラスは、application/x-www-form-urlencoded MIME タイプおよび書式なし XML応答私用して、パラメータエンコードます。カスタムMIME フォーマッタは、HttpMethodAttribute 属性使用して指定できますが、これをサービス説明プロキシ生成統合するためのサポート行われません。

Notes to Inheritors: このクラスオーバーライドすると、特定のタイプXML Web サービス固有のメソッドを、派生クラス導入できます。これらのメソッドは、単にパラメータキャプチャし、サイト通信する作業実行する基本クラス呼び出します。導入されメソッド非同期場合は、BeginInvoke メソッドおよび EndInvoke メソッド呼び出します。導入されメソッド同期場合は、Invoke メソッド呼び出します。通常オーバーライドされたコンストラクタは、Url プロパティXML Web サービス メソッドURI設定します

Web サービス記述言語ツール (Wsdl.exe) は、特定のサービス説明に対して HttpSimpleClientProtocol派生クラス生成します

使用例使用例

Wsdl.exe によって、下の Math XML Web サービス用に生成されるプロキシ クラスコード例次に示しますプロキシ クラスは、HttpGetClientProtocol から派生します。このクラスは、HttpSimpleClientProtocol 抽象クラスから派生します。

Option Strict On
Option Explicit On

Imports System
Imports System.Diagnostics
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.Xml.Serialization


Public Class MyMath
    Inherits System.Web.Services.Protocols.HttpGetClientProtocol
    
    <System.Diagnostics.DebuggerStepThroughAttribute()>  _
    Public Sub New()
        MyBase.New
        Me.Url = "http://www.contoso.com/math.asmx"
    End Sub
    
    <System.Diagnostics.DebuggerStepThroughAttribute(),  _
     System.Web.Services.Protocols.HttpMethodAttribute(GetType(System.Web.Services.Protocols.XmlReturnReader),
 GetType(System.Web.Services.Protocols.UrlParameterWriter))>
  _
    Public Function Add(ByVal
 num1 As String, ByVal
 num2 As String) As <System.Xml.Serialization.XmlRootAttribute("int", [Namespace]:="http://www.contoso.com/",
 IsNullable:=false)> Integer
        Return CType(Me.Invoke("Add",
 (Me.Url + "/Add"), New
 Object() {num1, num2}),Integer)
    End Function
    
    <System.Diagnostics.DebuggerStepThroughAttribute()>  _
    Public Function BeginAdd(ByVal
 num1 As String, ByVal
 num2 As String, ByVal callback As System.AsyncCallback, ByVal asyncState As
 Object) As System.IAsyncResult
        Return Me.BeginInvoke("Add",
 (Me.Url + "/Add"), New
 Object() {num1, num2}, callback, asyncState)
    End Function
    
    <System.Diagnostics.DebuggerStepThroughAttribute()>  _
    Public Function EndAdd(ByVal
 asyncResult As System.IAsyncResult) As Integer
        Return CType(Me.EndInvoke(asyncResult)
,Integer)
    End Function
End Class
using System.Diagnostics;
using System.Xml.Serialization;
using System;
using System.Web.Services.Protocols;
using System.Web.Services;


public class MyMath : System.Web.Services.Protocols.HttpGetClientProtocol
 {
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    public MyMath() {
        this.Url = "http://www.contoso.com/math.asmx";
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.Web.Services.Protocols.HttpMethodAttribute(typeof(System.Web.Services.Protocols.XmlReturnReader),
 typeof(System.Web.Services.Protocols.UrlParameterWriter))]
    [return: System.Xml.Serialization.XmlRootAttribute("int",
 Namespace="http://www.contoso.com/", IsNullable=false)]
    public int Add(string
 num1, string num2) {
        return ((int)(this.Invoke("Add",
 (this.Url + "/Add"), new object[]
 {num1,
                    num2})));
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    public System.IAsyncResult BeginAdd(string
 num1, string num2, System.AsyncCallback callback, object asyncState)
 {
        return this.BeginInvoke("Add",
 (this.Url + "/Add"), new object[]
 {num1,
                    num2}, callback, asyncState);
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    public int EndAdd(System.IAsyncResult asyncResult)
 {
        return ((int)(this.EndInvoke(asyncResult)));
    }
}
#using <System.Web.Services.dll>
#using <System.Xml.dll>
#using <System.dll>

using namespace System::Diagnostics;
using namespace System::Xml::Serialization;
using namespace System;
using namespace System::Web::Services::Protocols;
using namespace System::Web::Services;

public ref class MyMath: public
 System::Web::Services::Protocols::HttpGetClientProtocol
{
public:

   [System::Diagnostics::DebuggerStepThroughAttribute]
   MyMath()
   {
      this->Url = "http://www.contoso.com/math.asmx";
   }

   [System::Diagnostics::DebuggerStepThroughAttribute]
   [System::Web::Services::Protocols::HttpMethodAttribute(System::Web::Services::Protocols::XmlReturnReader::typeid
,
   System::Web::Services::Protocols::UrlParameterWriter::typeid)]
   [returnvalue:System::Xml::Serialization::XmlRootAttribute("snippet1>"
,Namespace="http://www.contoso.com/",IsNullable=false)]
   int Add( String^ num1, String^ num2 )
   {
      array<Object^>^temp0 = {num1,num2};
      return  *dynamic_cast<int^>(this->Invoke(
 "Add", (String::Concat( this->Url, "/Add"
 )), temp0 ));
   }

   [System::Diagnostics::DebuggerStepThroughAttribute]
   System::IAsyncResult^ BeginAdd( String^ num1, String^ num2, System::AsyncCallback^
 callback, Object^ asyncState )
   {
      array<Object^>^temp1 = {num1,num2};
      return this->BeginInvoke( "Add",
 (String::Concat( this->Url, "/Add" )), temp1, callback,
 asyncState );
   }

   [System::Diagnostics::DebuggerStepThroughAttribute]
   int EndAdd( System::IAsyncResult^ asyncResult )
   {
      return  *dynamic_cast<int^>(this->EndInvoke(
 asyncResult ));
   }
};
import System.Diagnostics.*;
import System.Xml.Serialization.*;
import System.*;
import System.Web.Services.Protocols.*;
import System.Web.Services.*;

public class MyMath extends System.Web.Services.Protocols.HttpGetClientProtocol
{   
    /** @attribute System.Diagnostics.DebuggerStepThroughAttribute()
     */
    public MyMath()
    {
        this.set_Url("http://www.contoso.com/math.asmx");
    } //MyMath
   
    /** @attribute System.Diagnostics.DebuggerStepThroughAttribute()
     */
    /** @attribute System.Web.Services.Protocols.HttpMethodAttribute
        (System.Web.Services.Protocols.XmlReturnReader.class,
        System.Web.Services.Protocols.UrlParameterWriter.class)
     */
    public int Add(String num1, String num2)
    {
        return Integer.parseInt(System.Convert.ToString( 
            this.Invoke("Add", this.get_Url()
 + "/Add", 
            new Object[]{num1, num2})));
    } //Add  
   
    /** @attribute System.Diagnostics.DebuggerStepThroughAttribute()
     */
    public System.IAsyncResult BeginAdd(String num1, String num2,
 
        System.AsyncCallback callback, Object asyncState)
    {
        return this.BeginInvoke("Add",
 this.get_Url() + "/Add", 
            new Object[]{num1, num2}, callback, asyncState) ;
    } //BeginAdd   
   
    /** @attribute System.Diagnostics.DebuggerStepThroughAttribute()
     */
    public int EndAdd(System.IAsyncResult asyncResult)
    {
        return Integer.parseInt(System.Convert.ToString(
            this.EndInvoke(asyncResult))) ;
    } //EndAdd
} //MyMath

前述プロキシ クラス作成元の Math XML Web サービスコード例次に示します

Imports System.Web.Services
Imports System

Public Class Math
    <WebMethod()> _
    Public Function Add(num1 As
 Integer, num2 As Integer)As
 Integer
    
        Return num1 + num2
    End Function
    
End Class

using System.Web.Services;
using System;

public class Math {
     [ WebMethod ]
     public int Add(int
 num1, int num2) {
         return num1+num2;
         }
}

#using <System.EnterpriseServices.dll>
#using <System.Web.Services.dll>

using namespace System::Web::Services;
using namespace System;
public ref class Math
{
public:

   [WebMethod]
   int Add( int num1, int
 num2 )
   {
      return num1 + num2;
   }

};

import System.Web.Services
import System

class Math{
    public WebMethod()
    function Add(num1 : int, num2 : int):
 int{
        return num1 + num2
    }   
}

継承階層継承階層
System.Object
   System.MarshalByRefObject
     System.ComponentModel.Component
       System.Web.Services.Protocols.WebClientProtocol
         System.Web.Services.Protocols.HttpWebClientProtocol
          System.Web.Services.Protocols.HttpSimpleClientProtocol
             System.Web.Services.Protocols.HttpGetClientProtocol
             System.Web.Services.Protocols.HttpPostClientProtocol
スレッド セーフスレッド セーフ

この型は、マルチスレッド操作に対して安全です。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
HttpSimpleClientProtocol メンバ
System.Web.Services.Protocols 名前空間
SoapHttpClientProtocol


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

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

辞書ショートカット

すべての辞書の索引

「HttpSimpleClientProtocol クラス」の関連用語

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

   

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



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

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

©2025 GRAS Group, Inc.RSS