Name

SOAPFaultElement

Synopsis

public interface SOAPFaultElement extends SOAPElement {
}

SOAPFaultElement is a subinterface of SOAPElement that represents an element that has been added directly to a SOAPFault. In all other respects, a SOAPFaultElement is the same as a SOAPElement. The Detail element, described earlier in this chapter, is an example of a SOAPFaultElement that can be created using the addDetail( ) method of the SOAPFault interface. There are two other ways to create a SOAPFaultElement:

  • Using the addChildElement( ) method that SOAPFault inherits from SOAPElement. For example, fault.addChildElement("BookError", "books", "urn:BookService") creates and returns a SOAPFaultElement called BookError in the namespace urn:BookService, and also adds it to the SOAPFault element referenced by the variable fault.

  • Creating a SOAPElement using the methods of SOAPFactory or SOAPElementFactory and using addChildElement( ) to add it to a SOAPFault. In this case, the SOAPElement is replaced by an equivalent SOAPFaultElement, and any nested elements are copied.

Implementations

Detail

Get Java Web Services in a Nutshell 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.