HttpPostClientProtocol 클래스

정의

HTTP-POST 프로토콜을 사용하는 XML Web services 클라이언트 프록시의 기본 클래스입니다.

public ref class HttpPostClientProtocol : System::Web::Services::Protocols::HttpSimpleClientProtocol
public class HttpPostClientProtocol : System.Web.Services.Protocols.HttpSimpleClientProtocol
type HttpPostClientProtocol = class
    inherit HttpSimpleClientProtocol
Public Class HttpPostClientProtocol
Inherits HttpSimpleClientProtocol
상속

예제

다음 예제는 Wsdl.exe 유틸리티에서 생성 된 프록시 클래스는 Math 아래 XML 웹 서비스입니다. 프록시 클래스에서 파생 되며 HttpPostClientProtocol, 추상에서 파생 되는 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::HttpPostClientProtocol
{
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::HtmlFormParameterWriter::typeid)]
   [returnvalue:System::Xml::Serialization::XmlRootAttribute("snippet1>",Namespace="http://www.contoso.com/",IsNullable=false)]
   int Add( String^ num1, String^ num2 )
   {
      array<Object^>^temp2 = {num1,num2};
      return  *dynamic_cast<int^>(this->Invoke( "Add", (String::Concat( this->Url, "/Add" )), temp2 ));
   }

   [System::Diagnostics::DebuggerStepThroughAttribute]
   System::IAsyncResult^ BeginAdd( String^ num1, String^ num2, System::AsyncCallback^ callback, Object^ asyncState )
   {
      array<Object^>^temp3 = {num1,num2};
      return this->BeginInvoke( "Add", (this->Url + "/Add" ), temp3, 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.HttpPostClientProtocol
{
    [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.HtmlFormParameterWriter))]
    [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.HttpPostClientProtocol
    
    <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.HtmlFormParameterWriter))>  _
    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

다음 예제는 Math 이전 프록시 클래스 생성 된 XML 웹 서비스입니다.

<%@ WebService Language="C#" Class="Math"%>
 using System.Web.Services;
 using System;
 
 public class Math {
      [ WebMethod ]
      public int Add(int num1, int num2) {
          return num1+num2;
          }
 }
<%@ WebService Language="VB" Class="Math"%>
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 'Add
End Class 'Math

설명

XML 웹 서비스 클라이언트를 사용 하는 경우 기본 매개 변수에서 HTTP POST 프로토콜을 URL 인코딩 규칙을 사용 하 여 HTTP 본문 내에서 인코딩 되 및 일반 XML을 사용 하 여 응답 합니다. 이 프로토콜에서 파생 된 클래스를 사용 하 여 MimeFormatter 매개 변수를 인코딩하고 값에 표준 MIME 형식을 반환 합니다. 사용할 인코더는 서비스 설명에 지정 됩니다.

작성 하는 경우 다음 ASP.NET을 사용 하 여 XML 웹 서비스 클라이언트를 직접 파생 되는 프록시 클래스에서 직접 또는 WebClientProtocol 호출 하려는 XML 웹 서비스에 만들어야 합니다. XML 웹 서비스 클라이언트는 HTTP를 사용 하 여를 호출 하는 경우 프록시 클래스를 파생 HttpSimpleClientProtocol에서 파생 됩니다는 WebClientProtocol합니다.

HttpGetClientProtocolHttpPostClientProtocol 에서 파생 HttpSimpleClientProtocol, HTTP-GET 및 HTTP-POST를 각각 사용 하 여 XML 웹 서비스 메서드를 호출 하는 것에 대 한 지원을 제공 합니다. SOAP를 사용 하 여 XML 웹 서비스를 호출 하는 클라이언트에서 파생 되어야 SoapHttpClientProtocol합니다.

프록시 클래스를 빌드하는 방법에 대한 자세한 내용은 XML 웹 서비스 프록시 만들기를 참조하세요.

생성자

HttpPostClientProtocol()

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

속성

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 메서드의 비동기 호출을 시작합니다.

(다음에서 상속됨 HttpSimpleClientProtocol)
CancelAsync(Object)

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

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

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

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

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

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

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

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

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

(다음에서 상속됨 HttpSimpleClientProtocol)
Equals(Object)

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

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

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

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

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

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

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

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

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

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

지정된 URL에 대해 WebRequest 인스턴스를 만듭니다.

GetWebResponse(WebRequest)

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

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

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

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

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

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

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

(다음에서 상속됨 HttpSimpleClientProtocol)
InvokeAsync(String, String, Object[], SendOrPostCallback)

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

(다음에서 상속됨 HttpSimpleClientProtocol)
InvokeAsync(String, String, Object[], SendOrPostCallback, Object)

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

(다음에서 상속됨 HttpSimpleClientProtocol)
MemberwiseClone()

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

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

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

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

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

(다음에서 상속됨 Component)

이벤트

Disposed

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

(다음에서 상속됨 Component)

적용 대상

추가 정보