O'Reilly logo

Microsoft® Visual Basic® .NET Programmer's Cookbook by Matthew MacDonald

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required