org.apache.axis.message

Class SOAPFault

Implemented Interfaces:
Cloneable, org.w3c.dom.Element, Node, NodeList, Serializable, SOAPBodyElement, SOAPElement, SOAPFault

public class SOAPFault
extends SOAPBodyElement
implements SOAPFault

A Fault body element.
Authors:
Sam Ruby (rubys@us.ibm.com)
Glen Daniels (gdaniels@apache.org)
Tom Jordahl (tomj@macromedia.com)

Nested Class Summary

Nested classes/interfaces inherited from class org.apache.axis.message.MessageElement

MessageElement.QNameAttr

Field Summary

protected Detail
detail
protected AxisFault
fault
protected String
prefix

Fields inherited from class org.apache.axis.message.MessageElement

_isRoot, context, encodingStyle, endEventIndex, fixupDeserializer, href, id, log, message, namespaces, qNameAttrs, recorder, startContentsIndex, startEventIndex, typeQName

Fields inherited from class org.apache.axis.message.NodeImpl

_isDirty, attributes, children, document, log, name, namespaceURI, parent, prefix, textRep

Constructor Summary

SOAPFault(String namespace, String localName, String prefix, Attributes attrs, DeserializationContext context)
Advanced constructor used for deserialization.
SOAPFault(AxisFault fault)

Method Summary

Detail
addDetail()
Creates a Detail object and sets it as the Detail object for this SOAPFaultException object.
Detail
getDetail()
Returns the detail element for this SOAPFaultException object.
AxisFault
getFault()
String
getFaultActor()
Gets the fault actor for this SOAPFaultException object.
String
getFaultCode()
Gets the fault code for this SOAPFaultException object.
Name
getFaultCodeAsName()
String
getFaultString()
Gets the fault string for this SOAPFaultException object.
Locale
getFaultStringLocale()
void
outputImpl(SerializationContext context)
override point -output to a serialization context.
void
setFault(AxisFault fault)
void
setFaultActor(String faultActor)
Sets this SOAPFaultException object with the given fault actor.
void
setFaultCode(String faultCode)
Sets this SOAPFaultException object with the given fault code.
void
setFaultCode(Name faultCodeQName)
void
setFaultString(String faultString)
Sets the fault string for this SOAPFaultException object to the given string.
void
setFaultString(String faultString, Locale locale)

Methods inherited from class org.apache.axis.message.SOAPBodyElement

setParentElement

Methods inherited from class org.apache.axis.message.MessageElement

addAttribute, addAttribute, addAttribute, addAttribute, addChild, addChildElement, addChildElement, addChildElement, addChildElement, addChildElement, addMapping, addNamespaceDeclaration, addTextNode, childDeepCloned, cloneNode, cloning, detachAllChildren, equals, findElement, getAllAttributes, getAsDOM, getAsDocument, getAsString, getAttribute, getAttributeNS, getAttributeNode, getAttributeNodeNS, getAttributeValue, getAttributeValue, getAttributesEx, getChildElement, getChildElements, getChildElements, getChildElements, getChildren, getCompleteAttributes, getDeserializationContext, getElementName, getElementsByTagName, getElementsByTagNameNS, getElementsNS, getEncodingStyle, getEnvelope, getFixupDeserializer, getHref, getID, getLength, getName, getNamespacePrefixes, getNamespaceURI, getObjectValue, getObjectValue, getOwnerDocument, getPrefix, getQName, getRealElement, getRecorder, getSchemaTypeInfo, getTagName, getType, getValue, getValueAsType, getValueAsType, getValueDOM, getVisibleNamespacePrefixes, hasAttribute, hasAttributeNS, isRoot, item, output, outputImpl, publishContents, publishToHandler, removeAttribute, removeAttribute, removeAttributeNS, removeAttributeNode, removeContents, removeNamespaceDeclaration, setAllAttributes, setAttribute, setAttribute, setAttributeNS, setAttributeNode, setAttributeNodeNS, setContentsIndex, setEncodingStyle, setEndIndex, setEnvelope, setFixupDeserializer, setIdAttribute, setIdAttributeNS, setIdAttributeNode, setNSMappings, setName, setNamespaceURI, setObjectValue, setQName, setRecorder, setType, setValue, toString

Methods inherited from class org.apache.axis.message.NodeImpl

appendChild, cloneNode, compareDocumentPosition, convertAttrSAXtoDOM, detachNode, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParent, getParentElement, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, getValue, hasAttributes, hasChildNodes, initializeChildren, insertBefore, isDefaultNamespace, isDirty, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, makeAttributesEditable, normalize, output, recycleNode, removeChild, replaceChild, reset, setDirty, setDirty, setNodeValue, setOwnerDocument, setParent, setParentElement, setPrefix, setTextContent, setUserData, setValue

Field Details

detail

protected Detail detail

fault

protected AxisFault fault

prefix

protected String prefix

Constructor Details

SOAPFault

public SOAPFault(String namespace,
                 String localName,
                 String prefix,
                 Attributes attrs,
                 DeserializationContext context)
            throws AxisFault
Advanced constructor used for deserialization.
  1. The context provides the mappings and Sax event recorder
  2. The soap messaging style is determined from the current message context, defaulting to SOAP1.1 if there is no current context.
  3. if there is an id attribute (any namespace), then the ID is registered with DeserializationContext.registerElementByID(String,MessageElement) ;a new recorder is created if needed.
  4. If there is an attribute "root" in the default SOAP namespace, then it is examined to see if it marks the element as root (value=="1" or not)
  5. If there is an arrayType attribute then we assume we are an array and set our MessageElement.typeQName field appropriately.
  6. The MessageElement.href field is set if there is a relevant href value
Parameters:
namespace - namespace namespace of element
prefix - prefix prefix of element
context - deserialization context for this message element
Throws:
AxisFault - if the encoding style is not recognized/supported

SOAPFault

public SOAPFault(AxisFault fault)

Method Details

addDetail

public Detail addDetail()
            throws SOAPException
Creates a Detail object and sets it as the Detail object for this SOAPFaultException object.

It is illegal to add a detail when the fault already contains a detail. Therefore, this method should be called only after the existing detail has been removed.

Specified by:
addDetail in interface SOAPFault
Returns:
the new Detail object
Throws:
SOAPException - if this SOAPFaultException object already contains a valid Detail object

getDetail

public Detail getDetail()
Returns the detail element for this SOAPFaultException object.

A Detail object carries application-specific error information related to SOAPBodyElement objects.

Specified by:
getDetail in interface SOAPFault
Returns:
a Detail object with application-specific error information

getFault

public AxisFault getFault()

getFaultActor

public String getFaultActor()
Gets the fault actor for this SOAPFaultException object.
Specified by:
getFaultActor in interface SOAPFault
Returns:
a String giving the actor in the message path that caused this SOAPFaultException object
See Also:
setFaultActor(java.lang.String)

getFaultCode

public String getFaultCode()
Gets the fault code for this SOAPFaultException object.
Specified by:
getFaultCode in interface SOAPFault
Returns:
a String with the fault code

getFaultCodeAsName

public Name getFaultCodeAsName()
Specified by:
getFaultCodeAsName in interface SOAPFault

getFaultString

public String getFaultString()
Gets the fault string for this SOAPFaultException object.
Specified by:
getFaultString in interface SOAPFault
Returns:
a String giving an explanation of the fault

getFaultStringLocale

public Locale getFaultStringLocale()
Specified by:
getFaultStringLocale in interface SOAPFault

outputImpl

public void outputImpl(SerializationContext context)
            throws Exception
override point -output to a serialization context.
Overrides:
outputImpl in interface MessageElement
Parameters:

setFault

public void setFault(AxisFault fault)

setFaultActor

public void setFaultActor(String faultActor)
            throws SOAPException
Sets this SOAPFaultException object with the given fault actor.

The fault actor is the recipient in the message path who caused the fault to happen.

Specified by:
setFaultActor in interface SOAPFault
Parameters:
faultActor - a String identifying the actor that caused this SOAPFaultException object
Throws:
SOAPException - if there was an error in adding the faultActor to the underlying XML tree.

setFaultCode

public void setFaultCode(String faultCode)
            throws SOAPException
Sets this SOAPFaultException object with the given fault code.

Fault codes, which given information about the fault, are defined in the SOAP 1.1 specification.

Specified by:
setFaultCode in interface SOAPFault
Parameters:
faultCode - a String giving the fault code to be set; must be one of the fault codes defined in the SOAP 1.1 specification
Throws:
SOAPException - if there was an error in adding the faultCode to the underlying XML tree.

setFaultCode

public void setFaultCode(Name faultCodeQName)
            throws SOAPException
Specified by:
setFaultCode in interface SOAPFault

setFaultString

public void setFaultString(String faultString)
            throws SOAPException
Sets the fault string for this SOAPFaultException object to the given string.
Specified by:
setFaultString in interface SOAPFault
Parameters:
faultString - a String giving an explanation of the fault
Throws:
SOAPException - if there was an error in adding the faultString to the underlying XML tree.

setFaultString

public void setFaultString(String faultString,
                           Locale locale)
            throws SOAPException
Specified by:
setFaultString in interface SOAPFault

Copyright © 2005 Apache Web Services Project. All Rights Reserved.