다음을 통해 공유


HttpSimpleClientProtocol 클래스

정의

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

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 의해 생성 된 프록시 클래스입니다. 프록시 클래스는 추상 HttpSimpleClientProtocol 클래스에서 HttpGetClientProtocol파생되는 파생 클래스입니다.

#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 파생됩니다. 기본적으로 애플리케이션/x-www-form-urlencoded MIME 형식 및 일반 XML의 응답을 사용하여 인코딩 매개 변수에서 파생 HttpSimpleClientProtocol 되는 프록시 클래스입니다. 특성을 사용하여 HttpMethodAttribute 사용자 지정 mime 포맷터를 지정할 수 있지만 서비스 설명 및 프록시 생성에 통합하는 것은 지원되지 않습니다.

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

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

생성자

Name Description
HttpSimpleClientProtocol()

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

속성

Name Description
AllowAutoRedirect

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

(다음에서 상속됨 HttpWebClientProtocol)
CanRaiseEvents

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

(다음에서 상속됨 Component)
ClientCertificates

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

(다음에서 상속됨 HttpWebClientProtocol)
ConnectionGroupName

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

(다음에서 상속됨 WebClientProtocol)
Container

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

(다음에서 상속됨 Component)
CookieContainer

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

(다음에서 상속됨 HttpWebClientProtocol)
Credentials

XML 웹 서비스 클라이언트 인증에 대한 보안 자격 증명을 가져오거나 설정합니다.

(다음에서 상속됨 WebClientProtocol)
DesignMode

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

(다음에서 상속됨 Component)
EnableDecompression

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

(다음에서 상속됨 HttpWebClientProtocol)
Events

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

(다음에서 상속됨 Component)
PreAuthenticate

사전 인증을 사용할 수 있는지 여부를 가져오거나 설정합니다.

(다음에서 상속됨 WebClientProtocol)
Proxy

방화벽을 통해 XML 웹 서비스 요청을 만들기 위한 프록시 정보를 가져오거나 설정합니다.

(다음에서 상속됨 HttpWebClientProtocol)
RequestEncoding

Encoding XML 웹 서비스에 대한 클라이언트 요청을 만드는 데 사용됩니다.

(다음에서 상속됨 WebClientProtocol)
Site

ISite값을 Component 가져오거나 설정합니다.

(다음에서 상속됨 Component)
Timeout

XML 웹 서비스 클라이언트가 동기 XML 웹 서비스 요청에 대한 회신이 도착할 때까지 대기하는 시간을 나타냅니다(밀리초).

(다음에서 상속됨 WebClientProtocol)
UnsafeAuthenticatedConnectionSharing

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

(다음에서 상속됨 HttpWebClientProtocol)
Url

클라이언트가 요청하는 XML 웹 서비스의 기본 URL을 가져오거나 설정합니다.

(다음에서 상속됨 WebClientProtocol)
UseDefaultCredentials

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

(다음에서 상속됨 WebClientProtocol)
UserAgent

각 요청과 함께 전송되는 사용자 에이전트 헤더의 값을 가져오거나 설정합니다.

(다음에서 상속됨 HttpWebClientProtocol)

메서드

Name Description
Abort()

XML 웹 서비스 메서드에 대한 요청을 취소합니다.

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

XML 웹 서비스의 메서드에 대한 비동기 호출을 시작합니다.

CancelAsync(Object)

호출이 이미 완료되지 않은 경우 XML 웹 서비스 메서드에 대한 비동기 호출을 취소합니다.

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

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

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

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

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

관리되지 않는 리소스를 Component 해제하고 관리되는 리소스를 선택적으로 해제합니다.

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

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

Equals(Object)

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

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

기본 해시 함수로 사용됩니다.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

HTTP를 사용하여 XML 웹 서비스 메서드를 호출합니다.

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

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

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

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

MemberwiseClone()

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

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

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

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

String(있는 경우)의 Component이름을 포함하는 값을 반환합니다. 이 메서드는 재정의해서는 안 됩니다.

(다음에서 상속됨 Component)

이벤트

Name Description
Disposed

구성 요소가 메서드 호출에 Dispose() 의해 삭제될 때 발생합니다.

(다음에서 상속됨 Component)

적용 대상

스레드 보안

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

추가 정보