SoapDocumentMethodAttribute.OneWay 속성

정의

웹 서버가 XML Web services 메서드 처리를 완료할 때까지 XML Web services 클라이언트에서 대기하는지 여부를 가져오거나 설정합니다.

public:
 property bool OneWay { bool get(); void set(bool value); };
public bool OneWay { get; set; }
member this.OneWay : bool with get, set
Public Property OneWay As Boolean

속성 값

Boolean

웹 서버가 XML Web services 메서드를 완전히 처리할 때까지 XML Web services 클라이언트에서 대기하지 않으면 true입니다. 기본값은 false입니다.

예제

다음 코드 예제는 XML 웹 서비스 메서드가 완료 될 때까지 기다리는 클라이언트가 필요 하지 않은 XML 웹 서비스 메서드를 합니다. 따라서 샘플 설정 합니다 OneWay 속성을 true입니다.

<%@ WebService Language="C#" Class="Stats" %>
 
 using System.Web.Services;
 using System.Web.Services.Protocols;
 
 public class Stats: WebService {
 
      [ SoapDocumentMethod(OneWay=true) ]
      [ WebMethod(Description="Starts nightly statistics batch process.") ]
      public void StartStatsCrunch() {
         // Begin nightly statistics crunching process.
         // A one-way method cannot have return values.
      }      
 
 }
<%@ WebService Language="VB" Class="Stats" %>
 
Imports System.Web.Services
Imports System.Web.Services.Protocols

Public Class Stats
    Inherits WebService
        
    <SoapDocumentMethod(OneWay := True), _
    WebMethod(Description := "Starts nightly statistics batch process.")> _
    Public Sub _
        StartStatsCrunch()
        
        ' Begin nightly statistics crunching process.
        ' A one-way method cannot have return values.
    End Sub
End Class

설명

XML 웹 서비스 메서드를에 하는 경우는 OneWay 속성으로 설정 true, XML 웹 서비스 클라이언트는 웹 서버가 XML 웹 서비스 메서드 처리를 완료할 때까지 대기 하지 않아도 됩니다. 웹 서버는 역직렬화 되는 즉시는 SoapServerMessage, XML 웹 서비스 메서드를 호출 하기 전에 서버는 HTTP 202 상태 코드를 반환 합니다. HTTP 202 상태 코드가 웹 서버에서 메시지 처리를 시작 하는 클라이언트를 나타냅니다. 따라서 XML 웹 서비스 클라이언트를 웹 서버에서 메시지를 성공적으로 처리 되었음을 승인을 받습니다.

단방향 메서드는 반환 값 또는 out 매개 변수를 가질 수 없습니다.

있는.NET Framework 버전 1.0 XML 웹 서비스 메서드를 사용 하는 경우는 SoapRpcMethodAttribute 또는 SoapDocumentMethodAttribute 특성을 사용 하 여 적용할 합니다 OneWay 집합의 속성 true에 대 한 액세스 권한이 없습니다 해당 HttpContext 를 사용 하 여는 정적 Current 속성입니다. 액세스는 HttpContext에서 XML 웹 서비스 메서드를 구현 하는 클래스를 파생 WebService 액세스는 Context 속성.

적용 대상

추가 정보