Create a One-Way Web Method

Problem

You want a Web method to perform a long task, and you don’t want to force the client to wait while the Web service code executes.

Solution

Create a one-way Web method by applying the SoapDocumentMethod or SoapRpcMethod attribute and setting the OneWay property to True.

Discussion

With one-way Web methods, the client sends a request message, and the server responds immediately to indicate that the method began processing. This behavior has the following consequences:

  • The client doesn’t need to wait while the Web method code executes.

  • The Web method can’t return any information to the client, either through a return value or a ByRef parameter.

  • If the Web method throws an unhandled exception, it won’t be propagated back ...

Get Microsoft® Visual Basic® .NET Programmer's Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.