|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
javax.xml.soap Interface SOAPFault
- All Superinterfaces:
- Element, Node, SOAPBodyElement, SOAPElement
public interface SOAPFault
- extends SOAPBodyElement
SOAPBody
对象中的元素,包含错误和/或状态信息。此信息可能与 SOAPMessage
对象中的错误相关,也可能与和消息本身的内容无关的问题相关。与消息本身无关的问题通常是处理过程中的错误,如无法与上游服务器通信。
SOAPFault
具有 SOAP 1.1 或 SOAP 1.2 规范中定义的子元素,具体取决于创建 MessageFactory
实例时指定的 protocol
。
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.
Field Summary |
---|
Method Summary | |
---|---|
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
Locale s 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 |
Method Detail |
---|
public void
setFaultCode(Name faultCodeQName) throws SOAPException
使用给定的错误代码设置此 SOAPFault
对象。
给出有关错误信息的错误代码是在 SOAP 1.1 规范中定义的。错误代码是强制性的 (mandatory),必须是 QName
类型。此方法提供设置错误代码的便捷方式。例如,
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);相比
#setFaultCode(String)
方法,最好优先使用此方法。
faultCodeQName |
给出要设置的错误代码的 Name 对象。它必须是限定于名称空间的。 |
Throws | SOAPException: 如果在将 faultcode 元素添加到底层 XML 树时出现错误。 |
since | SAAJ 1.2 |
See also | getFaultCodeAsName |
setFaultCode
void setFaultCode(Name faultCodeQName) throws SOAPException
- Sets this
SOAPFault
object 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)
. - Parameters:
faultCodeQName
- aName
object giving the fault code to be set. It must be namespace qualified.- Throws:
SOAPException
- if there was an error in adding the faultcode element to the underlying XML tree.- Since:
- SAAJ 1.2
- See Also:
getFaultCodeAsName()
public void
setFaultCode(javax.xml.namespace.QName faultCodeQName) throws SOAPException
使用给定的错误代码设置此 SOAPFault
对象。相比 #setFaultCode(Name)
方法,最好优先使用此方法。
faultCodeQName |
提供要设置的错误代码的 QName 对象。它必须是限定于名称空间的。 |
Throws | SOAPException:
如果在将 faultcode 元素添加到底层 XML 树时出现错误。 |
since | SAAJ 1.3 |
See also | getFaultCodeAsQName, setFaultCode(Name), getFaultCodeAsQName() |
setFaultCode
void setFaultCode(QName faultCodeQName) throws SOAPException
- Sets this
SOAPFault
object with the given fault code. It is preferable to use this method oversetFaultCode(Name)
. - Parameters:
faultCodeQName
- aQName
object giving the fault code to be set. It must be namespace qualified.- Throws:
SOAPException
- if there was an error in adding thefaultcode
element to the underlying XML tree.- Since:
- SAAJ 1.3
- See Also:
getFaultCodeAsQName()
,setFaultCode(Name)
,getFaultCodeAsQName()
public void
setFaultCode(String faultCode) throws SOAPException
使用给定的错误代码设置此 SOAPFault
对象。
给出有关错误信息的错误代码是在 SOAP 1.1 规范中定义的。此元素在 SOAP 1.1 中是强制性的。因为错误代码要求是 QName,所以最好使用此方法的 #setFaultCode(Name)
形式。
faultCode |
提供要设置的错误代码的 String 。它必须是 "prefix:localName" 形式,其中前缀是用名称空间声明定义的。 |
Throws | SOAPException:
如果在将 faultCode 添加到底层 XML 树时出现错误。 |
See also | setFaultCode(Name), getFaultCode, addNamespaceDeclaration |
setFaultCode
void setFaultCode(String faultCode) throws SOAPException
- Sets this
SOAPFault
object 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. - Parameters:
faultCode
- aString
giving the fault code to be set. It must be of the form "prefix:localName" where the prefix has been defined in a namespace declaration.- Throws:
SOAPException
- if there was an error in adding thefaultCode
to the underlying XML tree.- See Also:
setFaultCode(Name)
,getFaultCode()
,SOAPElement.addNamespaceDeclaration(java.lang.String, java.lang.String)
public Name
getFaultCodeAsName()
以 SAAJ Name
对象形式获取此 SOAPFault
对象的强制性 SOAP 1.1 错误代码。SOAP 1.1 规范要求 "faultcode" 元素的值为 QName 类型。此方法以 SAAJ Name 对象的形式返回 QName 形式的元素内容。应该使用此方法来代替 getFaultCode
方法,因为它允许应用程序方便地访问名称空间名,而不需要其他解析。
return |
表示错误代码的 Name |
since | SAAJ 1.2 |
See also | setFaultCode(Name) |
getFaultCodeAsName
Name getFaultCodeAsName()
- Gets the mandatory SOAP 1.1 fault code for this
SOAPFault
object as a SAAJName
object. 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 thegetFaultCode
method since it allows applications to easily access the namespace name without additional parsing. - Returns:
- a
Name
representing the faultcode - Since:
- SAAJ 1.2
- See Also:
setFaultCode(Name)
public javax.xml.namespace.QName
getFaultCodeAsQName()
以 QName
对象形式获取此 SOAPFault
对象的错误代码。
return |
表示错误代码的 QName
|
since | SAAJ 1.3 |
See also | setFaultCode(QName) |
getFaultCodeAsQName
QName getFaultCodeAsQName()
- Gets the fault code for this
SOAPFault
object as aQName
object. - Returns:
- a
QName
representing the faultcode - Since:
- SAAJ 1.3
- See Also:
setFaultCode(QName)
public java.util.Iterator<E>
getFaultSubcodes()
以 QNames
迭代器形式获取此 SOAPFault
的 Subcode。
return |
访问 QNames 序列的 Iterator 此 Iterator 不应支持可选的 remove 方法。Subcode 返回的顺序反映了 Subcode 在错误代码中从上到下的层次结构。 |
Throws | UnsupportedOperationException: 如果此消息不支持 SOAP 1.2 定义的 Subcode。 |
since | SAAJ 1.3 |
getFaultSubcodes
Iterator getFaultSubcodes()
- Gets the Subcodes for this
SOAPFault
as an iterator overQNames
. - Returns:
- an
Iterator
that accesses a sequence ofQNames
. ThisIterator
should not support the optionalremove
method. The order in which the Subcodes are returned reflects the hierarchy of Subcodes present in the fault from top to bottom. - Throws:
UnsupportedOperationException
- if this message does not support the SOAP 1.2 concept of Subcode.- Since:
- SAAJ 1.3
public void
removeAllFaultSubcodes()
移除此 SOAPFault
可能包含的任何 Subcode。在调用 appendFaultSubcode
之前,对 getFaultSubcodes
的后续调用将返回空迭代器。
Throws | UnsupportedOperationException: 如果此消息不支持 SOAP 1.2 定义的 Subcode。 |
since | SAAJ 1.3 |
removeAllFaultSubcodes
void removeAllFaultSubcodes()
- Removes any Subcodes that may be contained by this
SOAPFault
. Subsequent calls togetFaultSubcodes
will return an empty iterator until a call toappendFaultSubcode
is made. - Throws:
UnsupportedOperationException
- if this message does not support the SOAP 1.2 concept of Subcode.- Since:
- SAAJ 1.3
public void
appendFaultSubcode(javax.xml.namespace.QName subcode) throws SOAPException
将 Subcode 添加到此 SOAPFault
包含的 Subcode 序列的末尾。SOAP 1.2 中引入的 Subcode 由递归子元素序列表示,该序列由 SOAP Fault 的强制 Code 子元素排列形成。
subcode | 包含 Subcode 值的 QName。 |
Throws | SOAPException: 如果在设置 Subcode 时出现错误 |
Throws | UnsupportedOperationException: 如果此消息不支持 SOAP 1.2 定义的 Subcode。 |
since | 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. - Parameters:
subcode
- a QName containing the Value of the Subcode.- Throws:
SOAPException
- if there was an error in setting the SubcodeUnsupportedOperationException
- if this message does not support the SOAP 1.2 concept of Subcode.- Since:
- SAAJ 1.3
public String
getFaultCode()
获取此 SOAPFault
对象的错误代码。
return |
带有错误代码的 String |
See also | getFaultCodeAsName, setFaultCode |
getFaultCode
String getFaultCode()
- Gets the fault code for this
SOAPFault
object. - Returns:
- a
String
with the fault code - See Also:
getFaultCodeAsName()
,setFaultCode(javax.xml.soap.Name)
public void
setFaultActor(String faultActor) throws SOAPException
使用给定的错误参与者 (actor) 设置此 SOAPFault
对象。
错误参与者是消息路径中导致发生错误的接收方。
如果此 SOAPFault
支持 SOAP 1.2,则此调用等效于 #setFaultRole(String)
faultActor |
一个 String ,标识导致此 SOAPFault 对象的参与者 |
Throws | SOAPException:
如果在将 faultActor 添加到底层 XML 树时出现错误。 |
See also | getFaultActor |
setFaultActor
void setFaultActor(String faultActor) throws SOAPException
- Sets this
SOAPFault
object with the given fault actor.The fault actor is the recipient in the message path who caused the fault to happen.
If this
SOAPFault
supports SOAP 1.2 then this call is equivalent tosetFaultRole(String)
- Parameters:
faultActor
- aString
identifying the actor that caused thisSOAPFault
object- Throws:
SOAPException
- if there was an error in adding thefaultActor
to the underlying XML tree.- See Also:
getFaultActor()
public String
getFaultActor()
获取此 SOAPFault
对象的错误参与者。
如果此 SOAPFault
支持 SOAP 1.2,那么此调用等效于 #getFaultRole()
。
return |
一个 String ,给出消息路径中导致此 SOAPFault 对象的参与者 |
See also | setFaultActor |
getFaultActor
String getFaultActor()
- Gets the fault actor for this
SOAPFault
object.If this
SOAPFault
supports SOAP 1.2 then this call is equivalent togetFaultRole()
- Returns:
- a
String
giving the actor in the message path that caused thisSOAPFault
object - See Also:
setFaultActor(java.lang.String)
public void
setFaultString(String faultString) throws SOAPException
将此 SOAPFault
对象的错误字符串设定为给定字符串。
如果此 SOAPFault
是支持 SOAP 1.2 的消息的一部分,则此调用等效于:
addFaultReasonText(faultString, Locale.getDefault());
faultString |
一个 String ,给出对错误的解释 |
Throws | SOAPException:
如果在将 faultString 添加到底层 XML 树时出现错误。 |
See also | getFaultString |
setFaultString
void setFaultString(String faultString) throws SOAPException
- Sets the fault string for this
SOAPFault
object to the given string.If this
SOAPFault
is part of a message that supports SOAP 1.2 then this call is equivalent to:addFaultReasonText(faultString, Locale.getDefault());
- Parameters:
faultString
- aString
giving an explanation of the fault- Throws:
SOAPException
- if there was an error in adding thefaultString
to the underlying XML tree.- See Also:
getFaultString()
public void
setFaultString(String faultString, java.util.Locale locale) throws SOAPException
将此 SOAPFault
对象的错误字符串设定为给定字符串,并本地化为给定语言环境。
如果此 SOAPFault
是支持 SOAP 1.2 的消息的一部分,则此调用等效于:
addFaultReasonText(faultString, locale);
faultString |
一个 String ,给出对错误的解释 |
locale |
一个 Locale 对象,指示 faultString 的本地语言 |
Throws | SOAPException:
如果在将 faultString 添加到底层 XML 树时出现错误。 |
since | SAAJ 1.2 |
See also | getFaultString |
setFaultString
void setFaultString(String faultString, Locale locale) throws SOAPException
- Sets the fault string for this
SOAPFault
object to the given string and localized to the given locale.If this
SOAPFault
is part of a message that supports SOAP 1.2 then this call is equivalent to:addFaultReasonText(faultString, locale);
- Parameters:
faultString
- aString
giving an explanation of the faultlocale
- aLocale
object indicating the native language of thefaultString
- Throws:
SOAPException
- if there was an error in adding thefaultString
to the underlying XML tree.- Since:
- SAAJ 1.2
- See Also:
getFaultString()
public String
getFaultString()
获取此 SOAPFault
对象的错误字符串。
如果此 SOAPFault
是支持 SOAP 1.2 的消息的一部分,则此调用等效于:
String reason = null; try { reason = (String) getFaultReasonTexts().next(); } catch (SOAPException e) {} return reason;
return |
一个 String ,给出对错误的解释 |
See also | setFaultString(String), setFaultString(String, Locale) |
getFaultString
String getFaultString()
- Gets the fault string for this
SOAPFault
object.If this
SOAPFault
is 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;
- Returns:
- a
String
giving an explanation of the fault - See Also:
setFaultString(String)
,setFaultString(String, Locale)
public java.util.Locale
getFaultStringLocale()
获取此 SOAPFault
对象错误字符串的语言环境。
如果此 SOAPFault
是支持 SOAP 1.2 的消息的一部分,则此调用等效于:
Locale locale = null; try { locale = (Locale) getFaultReasonLocales().next(); } catch (SOAPException e) {} return locale;
return |
一个 Locale 对象,指示默认字符串的本地语言,如果没有指定语言环境,则返回 null |
since | SAAJ 1.2 |
See also | setFaultString(String, Locale) |
getFaultStringLocale
Locale getFaultStringLocale()
- Gets the locale of the fault string for this
SOAPFault
object.If this
SOAPFault
is 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;
- Returns:
- a
Locale
object indicating the native language of the fault string ornull
if no locale was specified - Since:
- SAAJ 1.2
- See Also:
setFaultString(String, Locale)
public boolean
hasDetail()
如果此 SOAPFault
有一个 Detail
子元素,则返回 true,否则返回 false。与 (getDetail()!=null)
等效。
return |
如果此 SOAPFault 有一个 Detail 子元素,则返回 true,否则返回 false。
|
since | SAAJ 1.3 |
hasDetail
boolean hasDetail()
- Returns true if this
SOAPFault
has aDetail
subelement and false otherwise. Equivalent to(getDetail()!=null)
. - Returns:
- true if this
SOAPFault
has aDetail
subelement and false otherwise. - Since:
- SAAJ 1.3
public Detail
getDetail()
返回此 SOAPFault
对象的可选 detail 元素。
Detail
对象携带了特定于应用程序的错误信息,如果该错误信息是 SOAP 1.1 Fault,则其范围限于 SOAPBodyElement
对象中的错误。
return |
带有特定于应用程序的错误信息的 Detail 对象(如果存在);如果不存在此类对象,则返回 null。
|
getDetail
Detail getDetail()
- Returns the optional detail element for this
SOAPFault
object.A
Detail
object carries application-specific error information, the scope of the error information is restricted to faults in theSOAPBodyElement
objects if this is a SOAP 1.1 Fault. - Returns:
- a
Detail
object with application-specific error information if present, null otherwise
public Detail
addDetail() throws SOAPException
创建可选的 Detail
对象,并将其设置为此 SOAPFault
对象的 Detail
对象。
当错误已包含详细信息时,添加详细信息是非法的。因此,此方法应该在移除了现有的详细信息之后调用。
return |
新的 Detail 对象
|
Throws | SOAPException:
如果此 SOAPFault 对象已包含一个有效的 Detail 对象 |
addDetail
Detail addDetail() throws SOAPException
- Creates an optional
Detail
object and sets it as theDetail
object for thisSOAPFault
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.
- Returns:
- the new
Detail
object - Throws:
SOAPException
- if thisSOAPFault
object already contains a validDetail
object
public java.util.Iterator<E>
getFaultReasonLocales() throws SOAPException
返回一个 Iterator
,它可以在与 Reason Text 项关联的 Locale
独特序列上进行迭代。这些 Locale
都可以用于对 getFaultReasonText
的调用,以便获取 Reason Text 字符串的本地化版本。
return |
一个 Iterator ,可在与 Reason Text 项关联的 Locale 对象序列上进行迭代。
|
Throws | SOAPException: 如果检索错误 Reason 语言环境时出现错误。 |
Throws | UnsupportedOperationException: 如果此消息不支持 SOAP 1.2 定义的 Fault Reason。 |
since | SAAJ 1.3 |
getFaultReasonLocales
Iterator getFaultReasonLocales() throws SOAPException
- Returns an
Iterator
over a distinct sequence ofLocale
s for which there are associated Reason Text items. Any of theseLocale
s can be used in a call togetFaultReasonText
in order to obtain a localized version of the Reason Text string. - Returns:
- an
Iterator
over a sequence ofLocale
objects for which there are associated Reason Text items. - Throws:
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.- Since:
- SAAJ 1.3
public java.util.Iterator<E>
getFaultReasonTexts() throws SOAPException
返回一个 Iterator
,它可以在包含此 SOAPFault
所有 Reason Text 项的 String
对象序列上进行迭代。
return |
一个 Iterator ,可在 env:Fault/env:Reason/env:Text 项上进行迭代。
|
Throws | SOAPException: 如果检索错误 Reason 文本时出现错误。 |
Throws | UnsupportedOperationException: 如果此消息不支持 SOAP 1.2 定义的 Fault Reason。 |
since | SAAJ 1.3 |
getFaultReasonTexts
Iterator getFaultReasonTexts() throws SOAPException
- Returns an
Iterator
over a sequence ofString
objects containing all of the Reason Text items for thisSOAPFault
. - Returns:
- an
Iterator
over env:Fault/env:Reason/env:Text items. - Throws:
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.- Since:
- SAAJ 1.3
public String
getFaultReasonText(java.util.Locale locale) throws SOAPException
返回与给定 Locale
关联的 Reason Text。如果存在一个以上这种 Reason Text,则返回第一个与 Text 匹配的 Reason Text。
locale |
本地化 Reason Text 时需要的 Locale |
return |
与 locale 关联的 Reason Text
|
Throws | SOAPException: 如果针对指定语言环境检索错误 Reason 文本时出现错误。 |
Throws | UnsupportedOperationException: 如果此消息不支持 SOAP 1.2 定义的 Fault Reason。 |
since | SAAJ 1.3 |
See also | getFaultString |
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 - Parameters:
locale
- -- theLocale
for which a localized Reason Text is desired- Returns:
- the Reason Text associated with
locale
- Throws:
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.- Since:
- SAAJ 1.3
- See Also:
getFaultString()
public void
addFaultReasonText(String text, java.util.Locale locale) throws SOAPException
追加或替换包含指定文本消息的 Reason Text 项,以及从 locale
派生的 xml:lang。如果已经存在带有此 xml:lang 的 Reason Text 项,则其文本值将被 text
替换。locale
参数不应为 null
。
代码示例:
SOAPFault fault = ...; fault.addFaultReasonText("Version Mismatch", Locale.ENGLISH);
text | 原因消息字符串 |
locale | 表示消息语言环境的 Locale 对象 |
Throws | SOAPException:
如果在添加 Reason 文本时出现错误,或者传递的 locale 为 null 。 |
Throws | UnsupportedOperationException: 如果此消息不支持 SOAP 1.2 定义的 Fault Reason。 |
since | SAAJ 1.3 |
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
. Thelocale
parameter should not benull
Code sample:
SOAPFault fault = ...; fault.addFaultReasonText("Version Mismatch", Locale.ENGLISH);
- Parameters:
text
- -- reason message stringlocale
- -- Locale object representing the locale of the message- Throws:
SOAPException
- if there was an error in adding the Reason text or thelocale
passed wasnull
.UnsupportedOperationException
- if this message does not support the SOAP 1.2 concept of Fault Reason.- Since:
- SAAJ 1.3
public String
getFaultNode()
返回此 SOAPFault
对象的可选 Node 元素值。Node 元素在 SOAP 1.2 中是可选的。
return |
String 形式的 env:Fault/env:Node 元素的内容,如果没有此类内容,则返回 null
|
Throws | UnsupportedOperationException: 如果此消息不支持 SOAP 1.2 定义的 Fault Node。 |
since | SAAJ 1.3 |
getFaultNode
String getFaultNode()
- Returns the optional Node element value for this
SOAPFault
object. The Node element is optional in SOAP 1.2. - Returns:
- Content of the env:Fault/env:Node element as a String
or
null
if none - Throws:
UnsupportedOperationException
- if this message does not support the SOAP 1.2 concept of Fault Node.- Since:
- SAAJ 1.3
public void
setFaultNode(String uri) throws SOAPException
创建或替换此 SOAPFault
对象的任何现有 Node 元素。Node 元素在 SOAP 1.2 中是可选的。
Throws | SOAPException:
如果在设置此 SOAPFault 对象的 Node 时出现错误。 |
Throws | UnsupportedOperationException: 如果此消息不支持 SOAP 1.2 定义的 Fault Node。 |
since | SAAJ 1.3 |
setFaultNode
void setFaultNode(String uri) throws SOAPException
- Creates or replaces any existing Node element value for
this
SOAPFault
object. The Node element is optional in SOAP 1.2. - Throws:
SOAPException
- if there was an error in setting the Node for thisSOAPFault
object.UnsupportedOperationException
- if this message does not support the SOAP 1.2 concept of Fault Node.- Since:
- SAAJ 1.3
public String
getFaultRole()
返回此 SOAPFault
对象的可选 Role 元素值。Role 元素在 SOAP 1.2 中是可选的。
return |
String 形式的 env:Fault/env:Role 元素的内容,如果没有此类内容,则返回 null
|
Throws | UnsupportedOperationException: 如果此消息不支持 SOAP 1.2 定义的 Fault Role。 |
since | SAAJ 1.3 |
getFaultRole
String getFaultRole()
- Returns the optional Role element value for this
SOAPFault
object. The Role element is optional in SOAP 1.2. - Returns:
- Content of the env:Fault/env:Role element as a String
or
null
if none - Throws:
UnsupportedOperationException
- if this message does not support the SOAP 1.2 concept of Fault Role.- Since:
- SAAJ 1.3
public void
setFaultRole(String uri) throws SOAPException
创建或替换此 SOAPFault
对象的任何现有 Role 元素。Role 元素在 SOAP 1.2 中是可选的。
uri | Role 的 URI |
Throws | SOAPException:
如果在设置此 SOAPFault 对象的 Role 时出现错误。 |
Throws | UnsupportedOperationException: 如果此消息不支持 SOAP 1.2 定义的 Fault Role。 |
since | SAAJ 1.3 |
setFaultRole
void setFaultRole(String uri) throws SOAPException
- Creates or replaces any existing Role element value for
this
SOAPFault
object. The Role element is optional in SOAP 1.2. - Parameters:
uri
- - the URI of the Role- Throws:
SOAPException
- if there was an error in setting the Role for thisSOAPFault
object.UnsupportedOperationException
- if this message does not support the SOAP 1.2 concept of Fault Role.- Since:
- SAAJ 1.3
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Submit a bug or feature
Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!