SoapHttpClientProtocol.SoapVersion 속성

정의

XML Web services에 대한 SOAP 요청을 만드는 데 사용되는 SOAP 프로토콜의 버전을 가져오거나 설정합니다.

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; }
[<System.Runtime.InteropServices.ComVisible(false)>]
member this.SoapVersion : System.Web.Services.Protocols.SoapProtocolVersion with get, set
Public Property SoapVersion As SoapProtocolVersion

속성 값

SoapProtocolVersion

SoapProtocolVersion 값 중 하나입니다. 기본값은 Soap11입니다.

특성

예제

다음 코드 예제에서는 XML 웹 서비스와 통신하는 데 사용되는 프로토콜 버전을 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 속성은 XML 웹 서비스에 대한 WSDL 문서가 SOAP 버전 1.1을 지원하는 경우 기본적으로 웹 서비스 설명 언어 도구(Wsdl.exe) Soap11 에서 생성된 프록시 클래스에서 설정됩니다. 그러나 XML 웹 서비스에서 SOAP 1.2만 지원하는 경우 Wsdl.exe 속성을 Soap12SoapVersion로 설정합니다. Wsdl.exe 사용하여 프록시 클래스를 생성할 때 SOAP 프로토콜의 버전을 선택하려면 스위치를 사용 /protocol 하거나 SOAP12 설정하여 속성을 Soap11 각각 설정 및 Soap12설정합니다SoapVersion.SOAP

적용 대상

추가 정보