Fire-and-Forget Communication

The first type of messaging we’ll consider is fire-and-forget methods, which are supported intrinsically by .NET Remoting and XML Web services. With fire-and-forget methods, the client sends a request message but the server never responds. Therefore, the remote method can’t set a ByRef parameter or return a value. In addition, if the remote method throws an unhandled exception, it won’t be propagated back to the client.

To create a fire-and-forget XML Web service method, you need to apply a SoapDocumentMethod attribute to the appropriate Web method and set the OneWay property to True. Example 8-1 shows an example.

Example 8-1. A one-way Web method

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

Get Microsoft® .NET Distributed Applications: Integrating XML Web Services and .NET Remoting 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.