O'Reilly logo

Spring Web Services 2 Cookbook by Shameer Kunjumohamed, Hamidreza Sattari

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

Chapter 4. Exception/SOAP Fault Handling

In this chapter, we will cover:

  • Handling server-side exceptions by returning an exception's message as a SOAP fault string

  • Mapping exception class names to SOAP faults

  • Annotating exception classes with the @SOAPFault

  • Writing your own exception resolvers in Spring-WS

Introduction

The server-side exceptions generated while processing a Web-Service are transmitted as SOAP faults. The SOAP <Fault> element is used to carry error and status information within a SOAP message.

The following code represents a general structure of the SOAP fault element in a SOAP message:

<SOAP-ENV:Fault> <faultcode xsi:type="xsd:string">SOAFP-ENV:Client</faultcode> <faultstring xsi:type="xsd:string"> A human readable summary of the fault ...

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