|
|
Java EE 5 SDK 深圳电信培训中心.徐海蛟老师. |
||||||||
| 上一个类 下一个类 | 框架 无框架 | ||||||||
| 摘要: 嵌套 | 字段 | 构造器 | 方法 | 详细信息: 字段 | 构造器 | 方法 | ||||||||
javax.xml.soap Interface SOAPFault
- 所有父接口:
- Element, Node, SOAPBodyElement, SOAPElement
public interface SOAPFault
- extends SOAPBodyElement
An element in the SOAPBody object that contains
error and/or status information. This information may relate to
errors in the SOAPMessage object or to problems
that are not related to the content in the message itself. Problems
not related to the message itself are generally errors in
processing, such as the inability to communicate with an upstream
server.
Depending on the protocol specified while creating the
MessageFactory instance, a SOAPFault has
sub-elements as defined in the SOAP 1.1/SOAP 1.2 specification.
| 字段摘要 |
|---|
| 方法摘要 | |
|---|---|
Detail |
addDetail()
Creates an optional Detail object and sets it as the
Detail object for this SOAPFault
object. |
void |
addFaultReasonText(String text,
Locale locale)
Appends or replaces a Reason Text item containing the specified text message and an xml:lang derived from locale. |
void |
appendFaultSubcode(QName subcode)
Adds a Subcode to the end of the sequence of Subcodes contained by this SOAPFault. |
Detail |
getDetail()
Returns the optional detail element for this SOAPFault
object. |
String |
getFaultActor()
Gets the fault actor for this SOAPFault object. |
String |
getFaultCode()
Gets the fault code for this SOAPFault object. |
Name |
getFaultCodeAsName()
Gets the mandatory SOAP 1.1 fault code for this SOAPFault object as a SAAJ Name object. |
QName |
getFaultCodeAsQName()
Gets the fault code for this SOAPFault object as a QName object. |
String |
getFaultNode()
Returns the optional Node element value for this SOAPFault object. |
Iterator |
getFaultReasonLocales()
Returns an Iterator over a distinct sequence of
Locales for which there are associated Reason Text items. |
String |
getFaultReasonText(Locale locale)
Returns the Reason Text associated with the given Locale. |
Iterator |
getFaultReasonTexts()
Returns an Iterator over a sequence of
String objects containing all of the Reason Text items for
this SOAPFault. |
String |
getFaultRole()
Returns the optional Role element value for this SOAPFault object. |
String |
getFaultString()
Gets the fault string for this SOAPFault object. |
Locale |
getFaultStringLocale()
Gets the locale of the fault string for this SOAPFault
object. |
Iterator |
getFaultSubcodes()
Gets the Subcodes for this SOAPFault as an iterator over
QNames. |
boolean |
hasDetail()
Returns true if this SOAPFault has a Detail
subelement and false otherwise. |
void |
removeAllFaultSubcodes()
Removes any Subcodes that may be contained by this SOAPFault. |
void |
setFaultActor(String faultActor)
Sets this SOAPFault object with the given fault actor. |
void |
setFaultCode(Name faultCodeQName)
Sets this SOAPFault object with the given fault code. |
void |
setFaultCode(QName faultCodeQName)
Sets this SOAPFault object with the given fault code. |
void |
setFaultCode(String faultCode)
Sets this SOAPFault object with the give fault code. |
void |
setFaultNode(String uri)
Creates or replaces any existing Node element value for this SOAPFault object. |
void |
setFaultRole(String uri)
Creates or replaces any existing Role element value for this SOAPFault object. |
void |
setFaultString(String faultString)
Sets the fault string for this SOAPFault object
to the given string. |
void |
setFaultString(String faultString,
Locale locale)
Sets the fault string for this SOAPFault object
to the given string and localized to the given locale. |
| Methods inherited from interface javax.xml.soap.Node |
|---|
detachNode, getParentElement, getValue, recycleNode, setParentElement, setValue |
| Methods inherited from interface org.w3c.dom.Node |
|---|
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData |
| Methods inherited from interface org.w3c.dom.Element |
|---|
getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, getSchemaTypeInfo, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNS |
| Methods inherited from interface org.w3c.dom.Node |
|---|
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData |
| 方法详细信息 |
|---|
setFaultCode
void setFaultCode(Name faultCodeQName) throws SOAPException
- Sets this
SOAPFaultobject with the given fault code.Fault codes, which give information about the fault, are defined in the SOAP 1.1 specification. A fault code is mandatory and must be of type
Name. This method provides a convenient way to set a fault code. For example,SOAPEnvelope se = ...; // Create a qualified name in the SOAP namespace with a localName // of "Client". Note that prefix parameter is optional and is null // here which causes the implementation to use an appropriate prefix. Name qname = se.createName("Client", null, SOAPConstants.URI_NS_SOAP_ENVELOPE); SOAPFault fault = ...; fault.setFaultCode(qname);It is preferable to use this method oversetFaultCode(String). - 参数:
faultCodeQName- aNameobject giving the fault code to be set. It must be namespace qualified.- 抛出异常:
SOAPException- if there was an error in adding the faultcode element to the underlying XML tree.- 从以下版本开始:
- SAAJ 1.2
- 另请参见:
getFaultCodeAsName()
setFaultCode
void setFaultCode(QName faultCodeQName) throws SOAPException
- Sets this
SOAPFaultobject with the given fault code. It is preferable to use this method oversetFaultCode(Name). - 参数:
faultCodeQName- aQNameobject giving the fault code to be set. It must be namespace qualified.- 抛出异常:
SOAPException- if there was an error in adding thefaultcodeelement to the underlying XML tree.- 从以下版本开始:
- SAAJ 1.3
- 另请参见:
getFaultCodeAsQName(),setFaultCode(Name),getFaultCodeAsQName()
setFaultCode
void setFaultCode(String faultCode) throws SOAPException
- Sets this
SOAPFaultobject with the give fault code.Fault codes, which given information about the fault, are defined in the SOAP 1.1 specification. This element is mandatory in SOAP 1.1. Because the fault code is required to be a QName it is preferable to use the
setFaultCode(Name)form of this method. - 参数:
faultCode- aStringgiving the fault code to be set. It must be of the form "prefix:localName" where the prefix has been defined in a namespace declaration.- 抛出异常:
SOAPException- if there was an error in adding thefaultCodeto the underlying XML tree.- 另请参见:
setFaultCode(Name),getFaultCode(),SOAPElement.addNamespaceDeclaration(java.lang.String, java.lang.String)
getFaultCodeAsName
Name getFaultCodeAsName()
- Gets the mandatory SOAP 1.1 fault code for this
SOAPFaultobject as a SAAJNameobject. The SOAP 1.1 specification requires the value of the "faultcode" element to be of type QName. This method returns the content of the element as a QName in the form of a SAAJ Name object. This method should be used instead of thegetFaultCodemethod since it allows applications to easily access the namespace name without additional parsing. - 返回:
- a
Namerepresenting the faultcode - 从以下版本开始:
- SAAJ 1.2
- 另请参见:
setFaultCode(Name)
getFaultCodeAsQName
QName getFaultCodeAsQName()
- Gets the fault code for this
SOAPFaultobject as aQNameobject. - 返回:
- a
QNamerepresenting the faultcode - 从以下版本开始:
- SAAJ 1.3
- 另请参见:
setFaultCode(QName)
getFaultSubcodes
Iterator getFaultSubcodes()
- Gets the Subcodes for this
SOAPFaultas an iterator overQNames. - 返回:
- an
Iteratorthat accesses a sequence ofQNames. ThisIteratorshould not support the optionalremovemethod. The order in which the Subcodes are returned reflects the hierarchy of Subcodes present in the fault from top to bottom. - 抛出异常:
UnsupportedOperationException- if this message does not support the SOAP 1.2 concept of Subcode.- 从以下版本开始:
- SAAJ 1.3
removeAllFaultSubcodes
void removeAllFaultSubcodes()
- Removes any Subcodes that may be contained by this
SOAPFault. Subsequent calls togetFaultSubcodeswill return an empty iterator until a call toappendFaultSubcodeis made. - 抛出异常:
UnsupportedOperationException- if this message does not support the SOAP 1.2 concept of Subcode.- 从以下版本开始:
- SAAJ 1.3
appendFaultSubcode
void appendFaultSubcode(QName subcode) throws SOAPException
- Adds a Subcode to the end of the sequence of Subcodes contained by this
SOAPFault. Subcodes, which were introduced in SOAP 1.2, are represented by a recursive sequence of subelements rooted in the mandatory Code subelement of a SOAP Fault. - 参数:
subcode- a QName containing the Value of the Subcode.- 抛出异常:
SOAPException- if there was an error in setting the SubcodeUnsupportedOperationException- if this message does not support the SOAP 1.2 concept of Subcode.- 从以下版本开始:
- SAAJ 1.3
getFaultCode
String getFaultCode()
- Gets the fault code for this
SOAPFaultobject. - 返回:
- a
Stringwith the fault code - 另请参见:
getFaultCodeAsName(),setFaultCode(javax.xml.soap.Name)
setFaultActor
void setFaultActor(String faultActor) throws SOAPException
- Sets this
SOAPFaultobject with the given fault actor.The fault actor is the recipient in the message path who caused the fault to happen.
If this
SOAPFaultsupports SOAP 1.2 then this call is equivalent tosetFaultRole(String) - 参数:
faultActor- aStringidentifying the actor that caused thisSOAPFaultobject- 抛出异常:
SOAPException- if there was an error in adding thefaultActorto the underlying XML tree.- 另请参见:
getFaultActor()
getFaultActor
String getFaultActor()
- Gets the fault actor for this
SOAPFaultobject.If this
SOAPFaultsupports SOAP 1.2 then this call is equivalent togetFaultRole() - 返回:
- a
Stringgiving the actor in the message path that caused thisSOAPFaultobject - 另请参见:
setFaultActor(java.lang.String)
setFaultString
void setFaultString(String faultString) throws SOAPException
- Sets the fault string for this
SOAPFaultobject to the given string.If this
SOAPFaultis part of a message that supports SOAP 1.2 then this call is equivalent to:addFaultReasonText(faultString, Locale.getDefault()); - 参数:
faultString- aStringgiving an explanation of the fault- 抛出异常:
SOAPException- if there was an error in adding thefaultStringto the underlying XML tree.- 另请参见:
getFaultString()
setFaultString
void setFaultString(String faultString, Locale locale) throws SOAPException
- Sets the fault string for this
SOAPFaultobject to the given string and localized to the given locale.If this
SOAPFaultis part of a message that supports SOAP 1.2 then this call is equivalent to:addFaultReasonText(faultString, locale); - 参数:
faultString- aStringgiving an explanation of the faultlocale- aLocaleobject indicating the native language of thefaultString- 抛出异常:
SOAPException- if there was an error in adding thefaultStringto the underlying XML tree.- 从以下版本开始:
- SAAJ 1.2
- 另请参见:
getFaultString()
getFaultString
String getFaultString()
- Gets the fault string for this
SOAPFaultobject.If this
SOAPFaultis part of a message that supports SOAP 1.2 then this call is equivalent to:String reason = null; try { reason = (String) getFaultReasonTexts().next(); } catch (SOAPException e) {} return reason; - 返回:
- a
Stringgiving an explanation of the fault - 另请参见:
setFaultString(String),setFaultString(String, Locale)
getFaultStringLocale
Locale getFaultStringLocale()
- Gets the locale of the fault string for this
SOAPFaultobject.If this
SOAPFaultis part of a message that supports SOAP 1.2 then this call is equivalent to:Locale locale = null; try { locale = (Locale) getFaultReasonLocales().next(); } catch (SOAPException e) {} return locale; - 返回:
- a
Localeobject indicating the native language of the fault string ornullif no locale was specified - 从以下版本开始:
- SAAJ 1.2
- 另请参见:
setFaultString(String, Locale)
hasDetail
boolean hasDetail()
- Returns true if this
SOAPFaulthas aDetailsubelement and false otherwise. Equivalent to(getDetail()!=null). - 返回:
- true if this
SOAPFaulthas aDetailsubelement and false otherwise. - 从以下版本开始:
- SAAJ 1.3
getDetail
Detail getDetail()
- Returns the optional detail element for this
SOAPFaultobject.A
Detailobject carries application-specific error information, the scope of the error information is restricted to faults in theSOAPBodyElementobjects if this is a SOAP 1.1 Fault. - 返回:
- a
Detailobject with application-specific error information if present, null otherwise
addDetail
Detail addDetail() throws SOAPException
- Creates an optional
Detailobject and sets it as theDetailobject for thisSOAPFaultobject.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.
- 返回:
- the new
Detailobject - 抛出异常:
SOAPException- if thisSOAPFaultobject already contains a validDetailobject
getFaultReasonLocales
Iterator getFaultReasonLocales() throws SOAPException
- Returns an
Iteratorover a distinct sequence ofLocales for which there are associated Reason Text items. Any of theseLocales can be used in a call togetFaultReasonTextin order to obtain a localized version of the Reason Text string. - 返回:
- an
Iteratorover a sequence ofLocaleobjects for which there are associated Reason Text items. - 抛出异常:
SOAPException- if there was an error in retrieving the fault Reason locales.UnsupportedOperationException- if this message does not support the SOAP 1.2 concept of Fault Reason.- 从以下版本开始:
- SAAJ 1.3
getFaultReasonTexts
Iterator getFaultReasonTexts() throws SOAPException
- Returns an
Iteratorover a sequence ofStringobjects containing all of the Reason Text items for thisSOAPFault. - 返回:
- an
Iteratorover env:Fault/env:Reason/env:Text items. - 抛出异常:
SOAPException- if there was an error in retrieving the fault Reason texts.UnsupportedOperationException- if this message does not support the SOAP 1.2 concept of Fault Reason.- 从以下版本开始:
- SAAJ 1.3
getFaultReasonText
String getFaultReasonText(Locale locale) throws SOAPException
- Returns the Reason Text associated with the given
Locale. If more than one such Reason Text exists the first matching Text is returned - 参数:
locale- -- theLocalefor which a localized Reason Text is desired- 返回:
- the Reason Text associated with
locale - 抛出异常:
SOAPException- if there was an error in retrieving the fault Reason text for the specified locale .UnsupportedOperationException- if this message does not support the SOAP 1.2 concept of Fault Reason.- 从以下版本开始:
- SAAJ 1.3
- 另请参见:
getFaultString()
addFaultReasonText
void addFaultReasonText(String text, Locale locale) throws SOAPException
- Appends or replaces a Reason Text item containing the specified
text message and an xml:lang derived from
locale. If a Reason Text item with this xml:lang already exists its text value will be replaced withtext. Thelocaleparameter should not benullCode sample:
SOAPFault fault = ...; fault.addFaultReasonText("Version Mismatch", Locale.ENGLISH); - 参数:
text- -- reason message stringlocale- -- Locale object representing the locale of the message- 抛出异常:
SOAPException- if there was an error in adding the Reason text or thelocalepassed wasnull.UnsupportedOperationException- if this message does not support the SOAP 1.2 concept of Fault Reason.- 从以下版本开始:
- SAAJ 1.3
getFaultNode
String getFaultNode()
- Returns the optional Node element value for this
SOAPFaultobject. The Node element is optional in SOAP 1.2. - 返回:
- Content of the env:Fault/env:Node element as a String
or
nullif none - 抛出异常:
UnsupportedOperationException- if this message does not support the SOAP 1.2 concept of Fault Node.- 从以下版本开始:
- SAAJ 1.3
setFaultNode
void setFaultNode(String uri) throws SOAPException
- Creates or replaces any existing Node element value for
this
SOAPFaultobject. The Node element is optional in SOAP 1.2. - 抛出异常:
SOAPException- if there was an error in setting the Node for thisSOAPFaultobject.UnsupportedOperationException- if this message does not support the SOAP 1.2 concept of Fault Node.- 从以下版本开始:
- SAAJ 1.3
getFaultRole
String getFaultRole()
- Returns the optional Role element value for this
SOAPFaultobject. The Role element is optional in SOAP 1.2. - 返回:
- Content of the env:Fault/env:Role element as a String
or
nullif none - 抛出异常:
UnsupportedOperationException- if this message does not support the SOAP 1.2 concept of Fault Role.- 从以下版本开始:
- SAAJ 1.3
setFaultRole
void setFaultRole(String uri) throws SOAPException
- Creates or replaces any existing Role element value for
this
SOAPFaultobject. The Role element is optional in SOAP 1.2. - 参数:
uri- - the URI of the Role- 抛出异常:
SOAPException- if there was an error in setting the Role for thisSOAPFaultobject.UnsupportedOperationException- if this message does not support the SOAP 1.2 concept of Fault Role.- 从以下版本开始:
- SAAJ 1.3
|
|
Java EE 5 SDK 深圳电信培训中心.徐海蛟老师. |
||||||||
| 上一个类 下一个类 | 框架 无框架 | ||||||||
| 摘要: 嵌套 | 字段 | 构造器 | 方法 | 详细信息: 字段 | 构造器 | 方法 | ||||||||
提交错误或意见
版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。深圳电信培训中心.徐海蛟老师教学参考.