SoapHttpClientProtocol.SoapVersion SoapHttpClientProtocol.SoapVersion SoapHttpClientProtocol.SoapVersion SoapHttpClientProtocol.SoapVersion Property

정의

XML 웹 서비스에 SOAP 요청을 수행 하는 데 사용 된 SOAP 프로토콜의 버전을 가져오거나 설정 합니다.Gets or sets the version of the SOAP protocol used to make the SOAP request to the XML Web service.

public:
 property System::Web::Services::Protocols::SoapProtocolVersion SoapVersion { System::Web::Services::Protocols::SoapProtocolVersion get(); void set(System::Web::Services::Protocols::SoapProtocolVersion value); };
[System.Runtime.InteropServices.ComVisible(false)]
public System.Web.Services.Protocols.SoapProtocolVersion SoapVersion { get; set; }
member this.SoapVersion : System.Web.Services.Protocols.SoapProtocolVersion with get, set
Public Property SoapVersion As SoapProtocolVersion

속성 값

SoapProtocolVersion 값 중 하나입니다.One of the SoapProtocolVersion values. 기본값은 Soap11입니다.The default is Soap11.

예제

다음 코드 예제에서는 SOAP 1.2에는 XML 웹 서비스와 통신 하는 데 사용 되는 프로토콜의 버전을 설정 합니다.The following code example sets the version of the protocol used to communicate with an XML Web service to SOAP 1.2.

<%@ Page Language="C#" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Net" %>
<%@ Import Namespace="System.Web.Services.Protocols" %>

<html>

    <script runat="server">

        void EnterBtn_Click(Object Src, EventArgs E) 
	{
	  // Create a new instance of a proxy class for your XML Web service.
	  ServerUsage su = new ServerUsage();
            
          // Specifies that SOAP 1.2 is used communicate with the XML Web service.
         su.SoapVersion = SoapProtocolVersion.Soap12;

	  // Invoke an XML Web service method that uses session state and thus cookies.
	  int count = su.PerSessionServiceUsage();         
       }
         
    </script>
    <body>
       <form runat=server ID="Form1">
           
             Click to bump up the Session Counter.
             <p>
             <asp:button text="Bump Up Counter" Onclick="EnterBtn_Click" runat=server ID="Button1" NAME="Button1"/>
             <p>
             <asp:label id="SessionCount"  runat=server/>
          
       </form>
    </body>
</html>
<%@ Page Language="VB" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Net" %>
<%@ Import Namespace="System.Web.Services.Protocols" %>

<html>

    <script runat=server>

        Public Sub EnterBtn_Click(src As Object, E As EventArgs) 

	  ' Create a new instance of a proxy class for your XML Web service.
	  Dim su As ServerUsage = new ServerUsage()

          ' Specifies that SOAP 1.2 is used communicate with the XML Web service.
          su.SoapVersion = SoapProtocolVersion.Soap12

	  ' Invoke an XML Web service method that uses session state and thus cookies.
	  Dim count As Integer = su.PerSessionServiceUsage()         
	End Sub
         
    </script>
    <body>
       <form runat=server ID="Form1">
           
             Click to bump up the Session Counter.
             <p>
             <asp:button text="Bump Up Counter" Onclick="EnterBtn_Click" runat=server ID="Button1" NAME="Button1"/>
             <p>
             <asp:label id="SessionCount"  runat=server/>
          
       </form>
    </body>
</html>

설명

합니다 SoapVersion 에 웹 서비스 기술 언어 도구 (Wsdl.exe)에서 생성 된 프록시 클래스에서 속성을 설정할 Soap11 XML 웹 서비스에 대 한 WSDL 문서에서 SOAP 1.1 버전을 지 원하는 경우 기본적으로 합니다.The SoapVersion property is set in the proxy class generated by the Web Services Description Language tool (Wsdl.exe) to Soap11 by default when a WSDL document for an XML Web service supports SOAP version 1.1. 그러나 XML 웹 서비스를만 지 원하는 경우 SOAP 1.2, Wsdl.exe 집합 합니다 SoapVersion 속성을 Soap12입니다.However, when an XML Web service only supports SOAP 1.2, Wsdl.exe sets the SoapVersion property to Soap12. 사용 하 여 Wsdl.exe 사용 하 여 프록시 클래스를 생성할 때 SOAP 프로토콜의 버전을 선택 합니다는 /protocol 스위치와 함께 합니다 SOAP 또는 SOAP12 설정을 설정 하는 SoapVersion 속성을 Soap11Soap12각각 .To choose the version of the SOAP protocol when generating the proxy class with Wsdl.exe, use the /protocol switch with the SOAP or SOAP12 settings to set the SoapVersion property to Soap11 and Soap12, respectively.

적용 대상

추가 정보