HttpWebClientProtocol 클래스

정의

HTTP 전송 프로토콜을 사용하는 모든 XML Web services 클라이언트 프록시의 기본 클래스를 나타냅니다.

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

예제

다음 예제는 라고 하는 XML 웹 서비스를 호출 하는 ASP.NET 웹 폼을 Math입니다. 내에서 EnterBtn_Click 함수 Web Form 서버의 다른 사이트에 클라이언트를 자동으로 리디렉션할 수 있습니다. 또한 XML 웹 서비스 메서드를 호출 하기 전에 클라이언트 인증 자격 증명, 프록시 설정, 인코딩 요청 및 요청에 대 한 제한 시간 설정 합니다.

<%@ 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>
   
<%@ 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>
   

설명

이 클래스의 속성을 XML 웹 서비스 요청 및 응답을 전송 하는 데 사용 하는 HTTP 요청 개체의 동작을 제어 하에 사용 됩니다. 속성에 속성을 매핑할 HttpWebRequest합니다.

HTTP를 사용 하 여 XML 웹 서비스와 통신 하려면 프록시 클래스에서 직접 또는 간접적으로 파생 만들어야 HttpWebClientProtocol XML 웹 서비스에 대 한 합니다. 프록시 클래스를 수동으로 만드는 대신 지정된 된 XML 웹 서비스의 서비스 설명에 대 한 프록시 클래스를 만들려면 Wsdl.exe 도구를 사용할 수 있습니다.

HttpWebClientProtocol 모든 프록시 클래스에 대 한 기본 클래스 이므로 해당 속성에 프록시 클래스에 있습니다. 이러한 속성은 기본 전송의 요청 동작을 제어 하는 데 유용 합니다. 예를 들어, 사용 된 Proxy 방화벽을 통해 XML Web services 호출에 대 한 속성입니다. 초기화에 사용 되는 이러한 속성 중 상당수는 HttpWebRequest 웹 요청입니다.

SoapHttpClientProtocolHttpGetClientProtocol, 및 HttpPostClientProtocol 에서 직접 또는 간접적으로 파생 HttpWebClientProtocol SOAP에 대 한 지원을 제공 하기 위해 HTTP-GET 및 HTTP-POST 각각.

생성자

HttpWebClientProtocol()

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

속성

AllowAutoRedirect

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

CanRaiseEvents

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

(다음에서 상속됨 Component)
ClientCertificates

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

ConnectionGroupName

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

(다음에서 상속됨 WebClientProtocol)
Container

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

(다음에서 상속됨 Component)
CookieContainer

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

Credentials

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

(다음에서 상속됨 WebClientProtocol)
DesignMode

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

(다음에서 상속됨 Component)
EnableDecompression

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

Events

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

(다음에서 상속됨 Component)
PreAuthenticate

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

(다음에서 상속됨 WebClientProtocol)
Proxy

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

RequestEncoding

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

(다음에서 상속됨 WebClientProtocol)
Site

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

(다음에서 상속됨 Component)
Timeout

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

(다음에서 상속됨 WebClientProtocol)
UnsafeAuthenticatedConnectionSharing

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

Url

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

(다음에서 상속됨 WebClientProtocol)
UseDefaultCredentials

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

(다음에서 상속됨 WebClientProtocol)
UserAgent

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

메서드

Abort()

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

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

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

CreateObjRef(Type)

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

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

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

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

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

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

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

(다음에서 상속됨 Object)
GenerateXmlMappings(Type, ArrayList)

지정한 형식으로 노출되는 각 XML Web services 메서드의 XmlMembersMapping을 가져와서 지정한 ArrayList에 저장합니다.

GenerateXmlMappings(Type[], ArrayList)

지정한 형식으로 노출된 각 XML Web services 메서드의 XmlMembersMapping을 가져와서 해당 매핑을 ArrayList는 물론 이 메서드가 반환하는 Hashtable에 저장합니다.

GetHashCode()

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

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

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

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

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

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

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

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

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

GetWebResponse(WebRequest)

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

GetWebResponse(WebRequest, IAsyncResult)

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

InitializeLifetimeService()
사용되지 않습니다.

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

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

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

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

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

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

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

(다음에서 상속됨 Component)

이벤트

Disposed

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

(다음에서 상속됨 Component)

적용 대상

스레드 보안

이 클래스의 속성의 새 인스턴스를에 복사 됩니다는 WebRequest 각 XML 웹 서비스 메서드 호출에 대 한 개체입니다. 동일한 XML 웹 서비스 메서드를 호출 하는 동안 WebClientProtocol 인스턴스에 서로 다른 여러 스레드에서 동시에 동기화가 없는지 하려는 속성의 일관 된 스냅샷을 전송 하는 것을 WebRequest 개체. 따라서 속성을 수정 하 고 서로 다른 동시 메서드 호출을 수행 하는 경우 XML Web의 다른 인스턴스를 사용 해야 하는 스레드 서비스 프록시 또는 고유한 동기화를 제공 합니다.

추가 정보