Gets or sets whether an XML Web service client waits for the Web server to finish processing an XML Web service method.
Assembly: System.Web.Services (in System.Web.Services.dll)
Public Property OneWay As Boolean Get Set
public bool OneWay { get; set; }
public: property bool OneWay { bool get (); void set (bool value); }
member OneWay : bool with get, set
Property Value
Type: System.Booleantrue if the XML Web service client does not wait for the Web server to completely process an XML Web service method; otherwise, false. The default is false.
When an XML Web service method has the OneWay property set to true, the XML Web service client does not have to wait for the Web server to finish processing the XML Web service method. As soon as the Web server has deserialized the SoapServerMessage, but before it invokes the XML Web service method, the server returns an HTTP 202 status code. An HTTP 202 status code indicates to the client that the Web server has started processing the message. Therefore, an XML Web service client receives no acknowledgment that the Web server successfully processed the message.
One-way methods cannot have a return value or any out parameters.
If you are using the .NET Framework version 1.0 XML Web service methods that have either the SoapRpcMethodAttribute or SoapDocumentMethodAttribute attribute applied to them with the OneWay property set to true, do not allow access to their HttpContext using the static Current property. To access the HttpContext, derive the class implementing the XML Web service method from WebService and access the Context property.
The following code example sets the OneWay property to true.
<%@ WebService Language="VB" Class="Stats" %> Imports System.Web.Services Imports System.Web.Services.Protocols Public Class Stats Inherits WebService <SoapRpcMethod(OneWay := True), _ WebMethod(Description := "Starts nightly stats batch process.")> _ Public Sub _ StartStatsCrunch() ' Begin a process that takes a long time to complete. End Sub End Class
<%@ WebService Language="C#" Class="Stats" %> using System.Web.Services; using System.Web.Services.Protocols; public class Stats: WebService { [ SoapRpcMethod(OneWay=true) ] [ WebMethod(Description="Starts nightly stats batch process.") ] public void StartStatsCrunch() { // Begin a process that takes a long time to complete. } }
.NET Framework
Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0.NET Framework Client Profile
Supported in: 4, 3.5 SP1Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.