SOAPFault (Java EE 5)

Java EE API


javax.xml.soap Interface SOAPFault

All Superinterfaces:
Element, Node, SOAPBodyElement, SOAPElement

public interface SOAPFault
extends SOAPBodyElement

Implements: 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
 
Fields inherited from interface org.w3c.dom.Node
 
Fields inherited from interface org.w3c.dom.Node
 
Method Summary
 Detail
 void
 void
 Detail
 String
 String
 Name
 QName
 String
 Iterator
 String
 Iterator
 String
 String
 Locale
 Iterator
 boolean
 void
 void
 void
 void
 void
 void
 void
 void
 void
 
Methods inherited from interface javax.xml.soap.SOAPElement
 
Methods inherited from interface javax.xml.soap.Node
 
Methods inherited from interface org.w3c.dom.Node
 
Methods inherited from interface org.w3c.dom.Element
 
Methods inherited from interface org.w3c.dom.Node
 

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 对象。它必须是限定于名称空间的。
ThrowsSOAPException: 如果在将 faultcode 元素添加到底层 XML 树时出现错误。
sinceSAAJ 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 over setFaultCode(String).

Parameters:
faultCodeQName - a Name 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 对象。它必须是限定于名称空间的。
ThrowsSOAPException: 如果在将 faultcode 元素添加到底层 XML 树时出现错误。
sinceSAAJ 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 over setFaultCode(Name).

Parameters:
faultCodeQName - a QName 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.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" 形式,其中前缀是用名称空间声明定义的。
ThrowsSOAPException: 如果在将 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 - a String 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 the faultCode 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
sinceSAAJ 1.2
See also setFaultCode(Name)
英文文档:

getFaultCodeAsName

Name getFaultCodeAsName()
Gets the mandatory SOAP 1.1 fault code for this SOAPFault object as a SAAJ Name 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 the getFaultCode 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
sinceSAAJ 1.3
See also setFaultCode(QName)
英文文档:

getFaultCodeAsQName

QName getFaultCodeAsQName()
Gets the fault code for this SOAPFault object as a QName 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 序列的 IteratorIterator 不应支持可选的 remove 方法。Subcode 返回的顺序反映了 Subcode 在错误代码中从上到下的层次结构。
ThrowsUnsupportedOperationException: 如果此消息不支持 SOAP 1.2 定义的 Subcode。
sinceSAAJ 1.3
英文文档:

getFaultSubcodes

Iterator getFaultSubcodes()
Gets the Subcodes for this SOAPFault as an iterator over QNames.

Returns:
an Iterator that accesses a sequence of QNames. This Iterator should not support the optional remove 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 的后续调用将返回空迭代器。
ThrowsUnsupportedOperationException: 如果此消息不支持 SOAP 1.2 定义的 Subcode。
sinceSAAJ 1.3
英文文档:

removeAllFaultSubcodes

void removeAllFaultSubcodes()
Removes any Subcodes that may be contained by this SOAPFault. Subsequent calls to getFaultSubcodes will return an empty iterator until a call to appendFaultSubcode 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。
ThrowsSOAPException: 如果在设置 Subcode 时出现错误
ThrowsUnsupportedOperationException: 如果此消息不支持 SOAP 1.2 定义的 Subcode。
sinceSAAJ 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 Subcode
UnsupportedOperationException - 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 对象的参与者
ThrowsSOAPException: 如果在将 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 to setFaultRole(String)

Parameters:
faultActor - a String identifying the actor that caused this SOAPFault object
Throws:
SOAPException - if there was an error in adding the faultActor 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 to getFaultRole()

Returns:
a String giving the actor in the message path that caused this SOAPFault 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,给出对错误的解释
ThrowsSOAPException: 如果在将 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 - a String giving an explanation of the fault
Throws:
SOAPException - if there was an error in adding the faultString 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 的本地语言
ThrowsSOAPException: 如果在将 faultString 添加到底层 XML 树时出现错误。
sinceSAAJ 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 - a String giving an explanation of the fault
locale - a Locale object indicating the native language of the faultString
Throws:
SOAPException - if there was an error in adding the faultString 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
sinceSAAJ 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 or null 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。
sinceSAAJ 1.3
英文文档:

hasDetail

boolean hasDetail()
Returns true if this SOAPFault has a Detail subelement and false otherwise. Equivalent to (getDetail()!=null).

Returns:
true if this SOAPFault has a Detail 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 the SOAPBodyElement 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 对象
ThrowsSOAPException: 如果此 SOAPFault 对象已包含一个有效的 Detail 对象

英文文档:

addDetail

Detail addDetail()
                 throws SOAPException
Creates an optional Detail object and sets it as the Detail object for this SOAPFault 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 this SOAPFault object already contains a valid Detail object

public java.util.Iterator<E> getFaultReasonLocales() throws SOAPException
返回一个 Iterator,它可以在与 Reason Text 项关联的 Locale 独特序列上进行迭代。这些 Locale 都可以用于对 getFaultReasonText 的调用,以便获取 Reason Text 字符串的本地化版本。
return 一个 Iterator,可在与 Reason Text 项关联的 Locale 对象序列上进行迭代。
ThrowsSOAPException: 如果检索错误 Reason 语言环境时出现错误。
ThrowsUnsupportedOperationException: 如果此消息不支持 SOAP 1.2 定义的 Fault Reason。
sinceSAAJ 1.3
英文文档:

getFaultReasonLocales

Iterator getFaultReasonLocales()
                               throws SOAPException
Returns an Iterator over a distinct sequence of Locales for which there are associated Reason Text items. Any of these Locales can be used in a call to getFaultReasonText in order to obtain a localized version of the Reason Text string.

Returns:
an Iterator over a sequence of Locale 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 项上进行迭代。
ThrowsSOAPException: 如果检索错误 Reason 文本时出现错误。
ThrowsUnsupportedOperationException: 如果此消息不支持 SOAP 1.2 定义的 Fault Reason。
sinceSAAJ 1.3
英文文档:

getFaultReasonTexts

Iterator getFaultReasonTexts()
                             throws SOAPException
Returns an Iterator over a sequence of String objects containing all of the Reason Text items for this SOAPFault.

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
returnlocale 关联的 Reason Text
ThrowsSOAPException: 如果针对指定语言环境检索错误 Reason 文本时出现错误。
ThrowsUnsupportedOperationException: 如果此消息不支持 SOAP 1.2 定义的 Fault Reason。
sinceSAAJ 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 - -- the Locale 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 对象
ThrowsSOAPException: 如果在添加 Reason 文本时出现错误,或者传递的 localenull
ThrowsUnsupportedOperationException: 如果此消息不支持 SOAP 1.2 定义的 Fault Reason。
sinceSAAJ 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 with text. The locale parameter should not be null

Code sample:

 SOAPFault fault = ...;
 fault.addFaultReasonText("Version Mismatch", Locale.ENGLISH);
 

Parameters:
text - -- reason message string
locale - -- Locale object representing the locale of the message
Throws:
SOAPException - if there was an error in adding the Reason text or the locale passed was null.
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
ThrowsUnsupportedOperationException: 如果此消息不支持 SOAP 1.2 定义的 Fault Node。
sinceSAAJ 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 中是可选的。
ThrowsSOAPException: 如果在设置此 SOAPFault 对象的 Node 时出现错误。
ThrowsUnsupportedOperationException: 如果此消息不支持 SOAP 1.2 定义的 Fault Node。
sinceSAAJ 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 this SOAPFault 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
ThrowsUnsupportedOperationException: 如果此消息不支持 SOAP 1.2 定义的 Fault Role。
sinceSAAJ 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
ThrowsSOAPException: 如果在设置此 SOAPFault 对象的 Role 时出现错误。
ThrowsUnsupportedOperationException: 如果此消息不支持 SOAP 1.2 定义的 Fault Role。
sinceSAAJ 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 this SOAPFault object.
UnsupportedOperationException - if this message does not support the SOAP 1.2 concept of Fault Role.
Since:
SAAJ 1.3


Submit a bug or feature

Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.

一看就知道只有菜鸟才干这么无知的事啦。

PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!