HttpSimpleClientProtocol 클래스

정의

간단한 HTTP-GET 및 HTTP-POST 프로토콜 바인딩을 사용하여 XML Web services와 통신하기 위한 기본 클래스를 나타냅니다.

public ref class HttpSimpleClientProtocol abstract : System::Web::Services::Protocols::HttpWebClientProtocol
public abstract class HttpSimpleClientProtocol : System.Web.Services.Protocols.HttpWebClientProtocol
[System.Runtime.InteropServices.ComVisible(true)]
public abstract class HttpSimpleClientProtocol : System.Web.Services.Protocols.HttpWebClientProtocol
type HttpSimpleClientProtocol = class
    inherit HttpWebClientProtocol
[<System.Runtime.InteropServices.ComVisible(true)>]
type HttpSimpleClientProtocol = class
    inherit HttpWebClientProtocol
Public MustInherit Class HttpSimpleClientProtocol
Inherits HttpWebClientProtocol
상속
파생
특성

예제

다음 코드 예제는 아래 XML 웹 서비스에 대 한 Math Wsdl.exe 의해 생성 된 프록시 클래스입니다. 프록시 클래스에서 파생 되며 HttpGetClientProtocol, 추상에서 파생 되는 HttpSimpleClientProtocol 클래스입니다.

#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 ));
   }
};
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)));
    }
}
Option Strict On
Option Explicit On

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

다음 코드 예제는 이전 프록시 클래스를 만든 XML 웹 서비스입니다 Math .

#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;
   }

};

using System.Web.Services;
using System;

public class Math
{
    [WebMethod]
    public int Add(int num1, int num2)
    {
        return num1 + num2;
    }
}
Imports System.Web.Services

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

설명

이 클래스는 매개 변수를 인코딩하고 값을 일반적인 MIME 형식으로 반환하는 인코더를 사용하여 HTTP를 통해 XML 웹 서비스와 통신하기 위한 대부분의 구현을 지정합니다. 이러한 인코더는 클래스에서 파생됩니다 MimeFormatter . 기본적으로에서 파생 된 프록시 클래스 HttpSimpleClientProtocol 애플리케이션/x-www-형식-urlencoded MIME 형식 및 응답을 사용 하 여 일반 xml에서 매개 변수를 인코딩합니다. 특성을 사용하여 HttpMethodAttribute 사용자 지정 mime 포맷터를 지정할 수 있지만 서비스 설명 및 프록시 생성에 통합하는 것은 지원되지 않습니다.

Notes to Inheritors: 이 클래스를 재정의하는 경우 XML 웹 서비스의 특정 형식과 관련된 파생 클래스에 메서드를 도입할 수 있습니다. 메서드는 단순히 매개 변수를 캡처하고 기본 클래스를 호출하여 사이트와 통신하는 작업을 수행합니다. 도입된 메서드가 비동기인 경우 해당 메서드 및 EndInvoke 메서드를 BeginInvoke 호출합니다. 도입된 메서드가 동기식인 경우 메서드를 호출합니다 Invoke . 재정의된 생성자는 일반적으로 XML 웹 서비스 메서드의 URI로 속성을 설정합니다 Url .

웹 서비스 설명 언어 도구(Wsdl.exe)는 지정된 서비스 설명에 HttpSimpleClientProtocol 대한 파생 클래스를 생성합니다.

생성자

HttpSimpleClientProtocol()

HttpSimpleClientProtocol 클래스의 새 인스턴스를 초기화합니다.

속성

AllowAutoRedirect

클라이언트가 서버 리디렉션을 자동으로 따르는지 여부를 나타내는 값을 가져오거나 설정합니다.

(다음에서 상속됨 HttpWebClientProtocol)
CanRaiseEvents

구성 요소가 이벤트를 발생시킬 수 있는지 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 Component)
ClientCertificates

클라이언트 인증서의 컬렉션을 가져옵니다.

(다음에서 상속됨 HttpWebClientProtocol)
ConnectionGroupName

요청에 대한 연결 그룹의 이름을 가져오거나 설정합니다.

(다음에서 상속됨 WebClientProtocol)
Container

IContainer을 포함하는 Component를 가져옵니다.

(다음에서 상속됨 Component)
CookieContainer

쿠키의 컬렉션을 가져오거나 설정합니다.

(다음에서 상속됨 HttpWebClientProtocol)
Credentials

XML Web services 클라이언트 인증의 보안 자격 증명을 가져오거나 설정합니다.

(다음에서 상속됨 WebClientProtocol)
DesignMode

Component가 현재 디자인 모드인지 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 Component)
EnableDecompression

HttpWebClientProtocol에 대해 압축 해제가 사용되는지 여부를 나타내는 값을 가져오거나 설정합니다.

(다음에서 상속됨 HttpWebClientProtocol)
Events

Component에 연결된 이벤트 처리기의 목록을 가져옵니다.

(다음에서 상속됨 Component)
PreAuthenticate

사전 인증을 활성화할지 여부를 나타내는 값을 가져오거나 설정합니다.

(다음에서 상속됨 WebClientProtocol)
Proxy

방화벽을 통해 XML Web services를 요청하기 위한 프록시 정보를 가져오거나 설정합니다.

(다음에서 상속됨 HttpWebClientProtocol)
RequestEncoding

XML Web services에 클라이언트 요청을 하는 데 사용되는 Encoding입니다.

(다음에서 상속됨 WebClientProtocol)
Site

ComponentISite를 가져오거나 설정합니다.

(다음에서 상속됨 Component)
Timeout

동기 XML Web services 요청에 대한 응답이 도착하기까지 대기하는 시간(밀리초)을 나타냅니다.

(다음에서 상속됨 WebClientProtocol)
UnsafeAuthenticatedConnectionSharing

클라이언트가 NTLM 인증을 사용하여 XML Web services가 호스팅되는 웹 서버에 연결하는 데 연결 공유가 사용되는지 여부를 나타내는 값을 가져오거나 설정합니다.

(다음에서 상속됨 HttpWebClientProtocol)
Url

클라이언트에서 요청 중인 XML Web services의 기본 URL을 가져오거나 설정합니다.

(다음에서 상속됨 WebClientProtocol)
UseDefaultCredentials

Credentials 속성을 DefaultCredentials 속성 값으로 설정할지 여부를 나타내는 값을 가져오거나 설정합니다.

(다음에서 상속됨 WebClientProtocol)
UserAgent

각 요청과 함께 보내지는 사용자 에이전트 헤더에 대한 값을 가져오거나 설정합니다.

(다음에서 상속됨 HttpWebClientProtocol)

메서드

Abort()

XML Web services 메서드에 대한 요청을 취소합니다.

(다음에서 상속됨 WebClientProtocol)
BeginInvoke(String, String, Object[], AsyncCallback, Object)

XML Web services 메서드의 비동기 호출을 시작합니다.

CancelAsync(Object)

호출이 아직 완료되지 않은 경우 XML Web services 메서드에 대한 비동기적 호출을 취소합니다.

(다음에서 상속됨 HttpWebClientProtocol)
CreateObjRef(Type)

원격 개체와 통신하는 데 사용되는 프록시 생성에 필요한 모든 관련 정보가 들어 있는 개체를 만듭니다.

(다음에서 상속됨 MarshalByRefObject)
Dispose()

Component에서 사용하는 모든 리소스를 해제합니다.

(다음에서 상속됨 Component)
Dispose(Boolean)

Component에서 사용하는 관리되지 않는 리소스를 해제하고, 관리되는 리소스를 선택적으로 해제할 수 있습니다.

(다음에서 상속됨 Component)
EndInvoke(IAsyncResult)

HTTP를 사용하여 XML Web services 메서드의 비동기 호출을 완료합니다.

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetLifetimeService()
사용되지 않습니다.

이 인스턴스의 수명 정책을 제어하는 현재의 수명 서비스 개체를 검색합니다.

(다음에서 상속됨 MarshalByRefObject)
GetService(Type)

Component 또는 해당 Container에서 제공하는 서비스를 나타내는 개체를 반환합니다.

(다음에서 상속됨 Component)
GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
GetWebRequest(Uri)

지정된 URI에 대해 WebRequest를 만듭니다.

(다음에서 상속됨 HttpWebClientProtocol)
GetWebResponse(WebRequest)

XML Web services 메서드에 대한 동기 요청에서 응답을 반환합니다.

(다음에서 상속됨 HttpWebClientProtocol)
GetWebResponse(WebRequest, IAsyncResult)

XML Web services 메서드에 대한 비동기 요청에서 응답을 반환합니다.

(다음에서 상속됨 HttpWebClientProtocol)
InitializeLifetimeService()
사용되지 않습니다.

이 인스턴스의 수명 정책을 제어하는 수명 서비스 개체를 가져옵니다.

(다음에서 상속됨 MarshalByRefObject)
Invoke(String, String, Object[])

HTTP를 사용하여 XML Web services 메서드를 호출합니다.

InvokeAsync(String, String, Object[], SendOrPostCallback)

지정한 메서드를 비동기적으로 호출합니다.

InvokeAsync(String, String, Object[], SendOrPostCallback, Object)

연결 상태를 유지하면서 지정한 메서드를 비동기적으로 호출합니다.

MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
MemberwiseClone(Boolean)

현재 MarshalByRefObject 개체의 단순 복사본을 만듭니다.

(다음에서 상속됨 MarshalByRefObject)
ToString()

Component의 이름이 포함된 String을 반환합니다(있는 경우). 이 메서드는 재정의할 수 없습니다.

(다음에서 상속됨 Component)

이벤트

Disposed

Dispose() 메서드를 호출하여 구성 요소를 삭제할 때 발생합니다.

(다음에서 상속됨 Component)

적용 대상

스레드 보안

이 형식은 스레드로부터 안전합니다.

추가 정보