Errors and the SOAP Fault

Errors and abnormal processing termination are a fact of life. With luck, your users didn't uncover a latent bug. But at any time you might lose a connection to your database server or encounter some other runtime-based situation that manages to murder your Web Service.

These situations are managed in Web Services through the SOAP Fault packet, which you saw in Chapter 4, “.NET Web Services and SOAP.” Within .NET, you can take two main paths to issue a SOAP Fault packet: You allow .NET to create one for you, or you take matters into your own hands and issue one yourself. Let's see how you accomplish both.

Default .NET SOAP Fault Processing

If you want to maintain the standard SOAP Fault behavior that .NET provides, simply ...

Get Applied SOAP: Implementing .NET XML Web Services 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.