SoapDocumentMethodAttribute.Action 속성

정의

SOAP 요청의 SOAPAction HTTP 헤더 필드를 가져오거나 설정합니다.

public:
 property System::String ^ Action { System::String ^ get(); void set(System::String ^ value); };
public string Action { get; set; }
member this.Action : string with get, set
Public Property Action As String

속성 값

String

SOAP 요청의 SOAPAction HTTP 헤더 필드입니다. 기본값은 http://tempuri.org/MethodNameMethodName이 XML 웹 서비스 메서드의 이름입니다.

예제

다음 코드 예제에서는 합니다 Action 속성을 http://www.contoso.com/GetUserName입니다.

<%@ WebService Language="C#" class="MyUser" %>
 
 using System.Web.Services;
 using System.Web.Services.Protocols;
 
 public class MyUser : WebService {
 
      [ SoapDocumentMethod(Action="http://www.contoso.com/GetUserName")]
      public string GetUserName() {
       return User.Identity.Name;
      }
 }
<%@ WebService Language="VB" class="MyUser" %>

Imports System.Web.Services
Imports System.Web.Services.Protocols

Public Class MyUser
    Inherits WebService
        
    <SoapDocumentMethod(Action := "http://www.contoso.com/GetUserName")> _
    Public Function _
        GetUserName() As String
        
        Return User.Identity.Name
    End Function
End Class

설명

일반적으로 Action 속성은 요청 의도 나타내는 URI입니다. 그러나 SOAP 사양은 제한이 URI의 형식에 또는 모든 규칙 여부에 대 한 URI를 확인할 수 있습니다. 내용을 확인 하 고 현재 상태는 Action 속성을 http에서 SOAP 요청 메시지를 적절 하 게 필터링 할 방화벽과 같이 웹 서버에서 사용할 수 있습니다.

기본적으로.NET Framework 버전 1.1에는 게시는 Action 속성에는 soapAction 특성은 soap:operation 요소 각각에 대 한 XML 웹 서비스에 대해 생성 된 WSDL 문서에서 SOAP 바인딩을 지원 합니다. 자세한 내용은 W3C 웹 사이트의 SOAP 사양을 참조하세요.

적용 대상