SOAP Faults
A SOAP fault is a standards-based format for transferring exceptions between applications. Recall from Chapter 2 that the SOAP specification defines a standard XML format for messages that include a header and body section. The same specification includes a definition for SOAP faults, providing structure for the contents of the message body when errors occur. This makes it possible for different technologies and platforms to provide plumbing to handle faults in a predictable manner. In most cases, this means converting the fault into some form of exception construct representative of the platform. Developers interact with the exception to deal with error conditions.
I discussed in Chapter 2 that the SOAP specification has two versions. In fact, one of the biggest differences between SOAP 1.1 and SOAP 1.2 is in the format for the SOAP fault. Not only do these specifications describe the format for faults, they also supply guidance on the contents of faults (such as error codes) and on the way platforms should process faults.
Fault Versions
SOAP 1.1 and SOAP 1.2 both define a format for faults. Though they essentially contain similar information when serialized, the naming conventions for XML elements were refactored slightly. Table 8-1 compares XML elements described by each specification and describes their purpose.
Table 8-1. Comparison of SOAP 1.1 and SOAP 1.2 elements
|
SOAP 1.1 |
SOAP 1.2 |
Element description |
|---|---|---|
|
|
|
Required. Can be one of the specification’s ... |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access