|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
javax.xml.soap Interface SOAPBody
- All Superinterfaces:
- Element, Node, SOAPElement
public interface SOAPBody
- extends SOAPElement
表示 SOAP 消息中 SOAP 正文元素内容的对象。SOAP 正文元素由能影响特定于应用程序内容的处理方式的 XML 数据组成。
SOAPBody
对象包含了 SOAPBodyElement
对象,后者具有 SOAP 正文的内容。携带状态和/或错误信息的 SOAPFault
对象是 SOAPBodyElement
对象的一个示例。
See also | javax.xml.soap.SOAPFault |
An object that represents the contents of the SOAP body element in a SOAP message. A SOAP body element consists of XML data that affects the way the application-specific content is processed.
A SOAPBody
object contains SOAPBodyElement
objects, which have the content for the SOAP body.
A SOAPFault
object, which carries status and/or
error information, is an example of a SOAPBodyElement
object.
- See Also:
SOAPFault
Field Summary |
---|
Method Summary | |
---|---|
SOAPBodyElement |
addBodyElement(Name name)
Creates a new SOAPBodyElement object with the specified
name and adds it to this SOAPBody object. |
SOAPBodyElement |
addBodyElement(QName qname)
Creates a new SOAPBodyElement object with the specified
QName and adds it to this SOAPBody object. |
SOAPBodyElement |
addDocument(Document document)
Adds the root node of the DOM
Document
to this SOAPBody object. |
SOAPFault |
addFault()
Creates a new SOAPFault object and adds it to
this SOAPBody object. |
SOAPFault |
addFault(Name faultCode,
String faultString)
Creates a new SOAPFault object and adds it to this
SOAPBody object. |
SOAPFault |
addFault(Name faultCode,
String faultString,
Locale locale)
Creates a new SOAPFault object and adds it to
this SOAPBody object. |
SOAPFault |
addFault(QName faultCode,
String faultString)
Creates a new SOAPFault object and adds it to this SOAPBody
object. |
SOAPFault |
addFault(QName faultCode,
String faultString,
Locale locale)
Creates a new SOAPFault object and adds it to this
SOAPBody object. |
Document |
extractContentAsDocument()
Creates a new DOM
Document and sets
the first child of this SOAPBody as it's document
element. |
SOAPFault |
getFault()
Returns the SOAPFault object in this SOAPBody
object. |
boolean |
hasFault()
Indicates whether a SOAPFault object exists in this
SOAPBody object. |
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 SOAPFault
addFault() throws SOAPException
创建新的 SOAPFault
对象,并将其添加到此 SOAPBody
对象。新的 SOAPFault
会将强制性 (mandatory) 子元素设置为默认值。SOAPFault
的类型可以是 SOAP 1.1 或 SOAP 1.2 SOAPFault
,这取决于创建 MessageFactory
实例时指定的 protocol
。
一个 SOAPBody
最多只能包含一个 SOAPFault
子元素。
return |
新的 SOAPFault 对象 |
Throws | SOAPException: 如果存在 SOAP 错误 |
addFault
SOAPFault addFault() throws SOAPException
- Creates a new
SOAPFault
object and adds it to thisSOAPBody
object. The newSOAPFault
will have default values set for the mandatory child elements. The type of theSOAPFault
will be a SOAP 1.1 or a SOAP 1.2SOAPFault
depending on theprotocol
specified while creating theMessageFactory
instance.A
SOAPBody
may contain at most oneSOAPFault
child element. - Returns:
- the new
SOAPFault
object - Throws:
SOAPException
- if there is a SOAP error
public SOAPFault
addFault(Name faultCode, String faultString, java.util.Locale locale) throws SOAPException
创建新的 SOAPFault
对象,并将其添加到此 SOAPBody
对象。SOAPFault
的类型可以是 SOAP 1.1 或 SOAP 1.2 SOAPFault
,这取决于创建 MessageFactory
实例时指定的 protocol
。
对于 SOAP 1.2,faultCode
参数是 Fault/Code/Value 元素的值,faultString
参数是 Fault/Reason/Text 元素的值。对于 SOAP 1.1,faultCode
参数是 faultcode
元素的值,faultString
参数是 faultstring
元素的值。
一个 SOAPBody
最多只能包含一个 SOAPFault
子元素。
faultCode |
Name 对象,给出要设置的错误代码;必须是正使用的 SOAP 规范的版本中定义的错误代码之一 |
faultString |
一个 String ,给出对错误的解释 |
locale |
java.util.Locale 对象,指示 faultString 的本地语言 |
return |
新的 SOAPFault 对象 |
Throws | SOAPException: 如果存在 SOAP 错误 |
since | SAAJ 1.2 |
See also | setFaultCode, setFaultString |
addFault
SOAPFault addFault(Name faultCode, String faultString, Locale locale) throws SOAPException
- Creates a new
SOAPFault
object and adds it to thisSOAPBody
object. The type of theSOAPFault
will be a SOAP 1.1 or a SOAP 1.2SOAPFault
depending on theprotocol
specified while creating theMessageFactory
instance.For SOAP 1.2 the
faultCode
parameter is the value of the Fault/Code/Value element and thefaultString
parameter is the value of the Fault/Reason/Text element. For SOAP 1.1 thefaultCode
parameter is the value of thefaultcode
element and thefaultString
parameter is the value of thefaultstring
element.A
SOAPBody
may contain at most oneSOAPFault
child element. - Parameters:
faultCode
- aName
object giving the fault code to be set; must be one of the fault codes defined in the Version of SOAP specification in usefaultString
- aString
giving an explanation of the faultlocale
- aLocale
object indicating the native language of thefaultString
- Returns:
- the new
SOAPFault
object - Throws:
SOAPException
- if there is a SOAP error- Since:
- SAAJ 1.2
- See Also:
SOAPFault.setFaultCode(javax.xml.soap.Name)
,SOAPFault.setFaultString(java.lang.String)
public SOAPFault
addFault(javax.xml.namespace.QName faultCode, String faultString, java.util.Locale locale) throws SOAPException
创建新的 SOAPFault
对象,并将其添加到此 SOAPBody
对象。SOAPFault
的类型可以是 SOAP 1.1 或 SOAP 1.2 SOAPFault
,这取决于创建 MessageFactory
实例时指定的 protocol
。
对于 SOAP 1.2,faultCode
参数是 Fault/Code/Value 元素的值,faultString
参数是 Fault/Reason/Text 元素的值。对于 SOAP 1.1,faultCode
参数是 faultcode
元素的值,faultString
参数是 faultstring
元素的值。
一个 SOAPBody
最多只能包含一个 SOAPFault
子元素。
faultCode |
QName 对象,给出要设置的错误代码;必须是正使用的 SOAP 规范的版本中定义的错误代码之一。 |
faultString |
String ,给出错误的解释 |
locale |
Locale 对象,指示 faultString 的本地语言 |
return |
新的 SOAPFault 对象 |
Throws | SOAPException: 如果存在 SOAP 错误 |
since | SAAJ 1.3 |
See also | setFaultCode, setFaultString, addFault(Name faultCode, String faultString, Locale locale) |
addFault
SOAPFault addFault(QName faultCode, String faultString, Locale locale) throws SOAPException
- Creates a new
SOAPFault
object and adds it to thisSOAPBody
object. The type of theSOAPFault
will be a SOAP 1.1 or a SOAP 1.2SOAPFault
depending on theprotocol
specified while creating theMessageFactory
instance.For SOAP 1.2 the
faultCode
parameter is the value of the Fault/Code/Value element and thefaultString
parameter is the value of the Fault/Reason/Text element. For SOAP 1.1 thefaultCode
parameter is the value of thefaultcode
element and thefaultString
parameter is the value of thefaultstring
element.A
SOAPBody
may contain at most oneSOAPFault
child element. - Parameters:
faultCode
- aQName
object giving the fault code to be set; must be one of the fault codes defined in the version of SOAP specification in use.faultString
- aString
giving an explanation of the faultlocale
- aLocale
object indicating the native language of thefaultString
- Returns:
- the new
SOAPFault
object - Throws:
SOAPException
- if there is a SOAP error- Since:
- SAAJ 1.3
- See Also:
SOAPFault.setFaultCode(javax.xml.soap.Name)
,SOAPFault.setFaultString(java.lang.String)
,addFault(Name faultCode, String faultString, Locale locale)
public SOAPFault
addFault(Name faultCode, String faultString) throws SOAPException
创建新的 SOAPFault
对象,并将其添加到此 SOAPBody
对象。SOAPFault
的类型可以是 SOAP 1.1 或 SOAP 1.2 SOAPFault
,这取决于创建 MessageFactory
实例时指定的 protocol
。
对于 SOAP 1.2,faultCode
参数是 Fault/Code/Value 元素的值,faultString
参数是 Fault/Reason/Text 元素的值。对于 SOAP 1.1,faultCode
参数是 faultcode 元素的值,faultString
参数是 faultstring 元素的值。
如果是 SOAP 1.2 错误,Fault/Reason/Text 元素上强制性 xml:lang
属性的默认值将设置为 java.util.Locale.getDefault()
一个 SOAPBody
最多只能包含一个 SOAPFault
子元素。
faultCode |
Name 对象,给出要设置的错误代码;必须是正使用的 SOAP 规范的版本中定义的错误代码之一 |
faultString |
String ,给出错误的解释 |
return |
新的 SOAPFault 对象 |
Throws | SOAPException: 如果存在 SOAP 错误 |
since | SAAJ 1.2 |
See also | setFaultCode, setFaultString |
addFault
SOAPFault addFault(Name faultCode, String faultString) throws SOAPException
- Creates a new
SOAPFault
object and adds it to thisSOAPBody
object. The type of theSOAPFault
will be a SOAP 1.1 or a SOAP 1.2SOAPFault
depending on theprotocol
specified while creating theMessageFactory
instance.For SOAP 1.2 the
faultCode
parameter is the value of the Fault/Code/Value element and thefaultString
parameter is the value of the Fault/Reason/Text element. For SOAP 1.1 thefaultCode
parameter is the value of the faultcode element and thefaultString
parameter is the value of the faultstring element.In case of a SOAP 1.2 fault, the default value for the mandatory
xml:lang
attribute on the Fault/Reason/Text element will be set tojava.util.Locale.getDefault()
A
SOAPBody
may contain at most oneSOAPFault
child element. - Parameters:
faultCode
- aName
object giving the fault code to be set; must be one of the fault codes defined in the version of SOAP specification in usefaultString
- aString
giving an explanation of the fault- Returns:
- the new
SOAPFault
object - Throws:
SOAPException
- if there is a SOAP error- Since:
- SAAJ 1.2
- See Also:
SOAPFault.setFaultCode(javax.xml.soap.Name)
,SOAPFault.setFaultString(java.lang.String)
public SOAPFault
addFault(javax.xml.namespace.QName faultCode, String faultString) throws SOAPException
创建新的 SOAPFault
对象,并将其添加到此 SOAPBody
对象。SOAPFault
的类型可以是 SOAP 1.1 或 SOAP 1.2 SOAPFault
,这取决于创建 MessageFactory
实例时指定的 protocol
。
对于 SOAP 1.2,faultCode
参数是 Fault/Code/Value 元素的值,faultString
参数是 Fault/Reason/Text 元素的值。对于 SOAP 1.1,faultCode
参数是 faultcode 元素的值,faultString
参数是 faultstring 元素的值。
如果是 SOAP 1.2 错误,Fault/Reason/Text 元素上强制性 xml:lang
属性的默认值将设置为 java.util.Locale.getDefault()
一个 SOAPBody
最多只能包含一个 SOAPFault
子元素
faultCode |
QName 对象,给出要设置的错误代码;必须是正使用的 SOAP 规范的版本中定义的错误代码之一 |
faultString |
String ,给出错误的解释 |
return |
新的 SOAPFault 对象 |
Throws | SOAPException: 如果存在 SOAP 错误 |
since | SAAJ 1.3 |
See also | setFaultCode, setFaultString, addFault(Name faultCode, String faultString) |
addFault
SOAPFault addFault(QName faultCode, String faultString) throws SOAPException
- Creates a new
SOAPFault
object and adds it to thisSOAPBody
object. The type of theSOAPFault
will be a SOAP 1.1 or a SOAP 1.2SOAPFault
depending on theprotocol
specified while creating theMessageFactory
instance.For SOAP 1.2 the
faultCode
parameter is the value of the Fault/Code/Value element and thefaultString
parameter is the value of the Fault/Reason/Text element. For SOAP 1.1 thefaultCode
parameter is the value of the faultcode element and thefaultString
parameter is the value of the faultstring element.In case of a SOAP 1.2 fault, the default value for the mandatory
xml:lang
attribute on the Fault/Reason/Text element will be set tojava.util.Locale.getDefault()
A
SOAPBody
may contain at most oneSOAPFault
child element - Parameters:
faultCode
- aQName
object giving the fault code to be set; must be one of the fault codes defined in the version of SOAP specification in usefaultString
- aString
giving an explanation of the fault- Returns:
- the new
SOAPFault
object - Throws:
SOAPException
- if there is a SOAP error- Since:
- SAAJ 1.3
- See Also:
SOAPFault.setFaultCode(javax.xml.soap.Name)
,SOAPFault.setFaultString(java.lang.String)
,addFault(Name faultCode, String faultString)
public boolean
hasFault()
指示此 SOAPBody
对象中是否存在 SOAPFault
对象。
return |
如果此 SOAPBody 对象中存在 SOAPFault 对象,则返回 true ;否则返回 false
|
hasFault
boolean hasFault()
- Indicates whether a
SOAPFault
object exists in thisSOAPBody
object. - Returns:
true
if aSOAPFault
object exists in thisSOAPBody
object;false
otherwise
public SOAPFault
getFault()
返回此 SOAPBody
对象中的 SOAPFault
对象。
return |
此 SOAPBody 对象中的 SOAPFault 对象(如果存在);若不存在,则返回 null。
|
getFault
SOAPFault getFault()
- Returns the
SOAPFault
object in thisSOAPBody
object. - Returns:
- the
SOAPFault
object in thisSOAPBody
object if present, null otherwise.
public SOAPBodyElement
addBodyElement(Name name) throws SOAPException
使用指定名称创建新的 SOAPBodyElement
对象,并将其添加到此 SOAPBody
对象。
name |
Name 对象,带有新 SOAPBodyElement 对象的名称 |
return |
新的 SOAPBodyElement 对象 |
Throws | SOAPException: 如果发生 SOAP 错误 |
See also | addBodyElement(javax.xml.namespace.QName) |
addBodyElement
SOAPBodyElement addBodyElement(Name name) throws SOAPException
- Creates a new
SOAPBodyElement
object with the specified name and adds it to thisSOAPBody
object. - Parameters:
name
- aName
object with the name for the newSOAPBodyElement
object- Returns:
- the new
SOAPBodyElement
object - Throws:
SOAPException
- if a SOAP error occurs- See Also:
addBodyElement(javax.xml.namespace.QName)
public SOAPBodyElement
addBodyElement(javax.xml.namespace.QName qname) throws SOAPException
使用指定 QName 创建新的 SOAPBodyElement
对象,并将其添加到此 SOAPBody
对象。
qname |
QName 对象,带有新 SOAPBodyElement 对象的名称 |
return |
新的 SOAPBodyElement 对象 |
Throws | SOAPException: 如果发生 SOAP 错误 |
since | SAAJ 1.3 |
See also | addBodyElement(Name) |
addBodyElement
SOAPBodyElement addBodyElement(QName qname) throws SOAPException
- Creates a new
SOAPBodyElement
object with the specified QName and adds it to thisSOAPBody
object. - Parameters:
qname
- aQName
object with the qname for the newSOAPBodyElement
object- Returns:
- the new
SOAPBodyElement
object - Throws:
SOAPException
- if a SOAP error occurs- Since:
- SAAJ 1.3
- See Also:
addBodyElement(Name)
public SOAPBodyElement
addDocument(org.w3c.dom.Document document) throws SOAPException
将 DOM
org.w3c.dom.Document
的根节点添加到此 SOAPBody
对象。
调用此方法会使 document
参数失效。在调用 addDocument
时,客户端应用程序应丢弃所有对此 Document
及其内容的引用。继续使用此类引用的应用程序将产生不确定的行为。
document |
Document 对象,该对象的根节点将被添加到此 SOAPBody 。 |
return |
表示被添加根节点的 SOAPBodyElement 。 |
Throws | SOAPException:
如果无法添加 Document |
since | SAAJ 1.2 |
addDocument
SOAPBodyElement addDocument(Document document) throws SOAPException
- Adds the root node of the DOM
Document
to thisSOAPBody
object.Calling this method invalidates the
document
parameter. The client application should discard all references to thisDocument
and its contents upon callingaddDocument
. The behavior of an application that continues to use such references is undefined. - Parameters:
document
- theDocument
object whose root node will be added to thisSOAPBody
.- Returns:
- the
SOAPBodyElement
that represents the root node that was added. - Throws:
SOAPException
- if theDocument
cannot be added- Since:
- SAAJ 1.2
public org.w3c.dom.Document
extractContentAsDocument() throws SOAPException
创建新的 DOM
org.w3c.dom.Document
,并将此 SOAPBody
的第一个子元素设置为它的文档元素。子 SOAPElement
作为进程的一部分被移除。
return |
SOAPBody 内容的
org.w3c.dom.Document 表示形式。
|
Throws | SOAPException:
如果不存在任何 SOAPBody 的子 SOAPElement 。 |
since | SAAJ 1.3 |
extractContentAsDocument
Document extractContentAsDocument() throws SOAPException
- Creates a new DOM
Document
and sets the first child of thisSOAPBody
as it's document element. The childSOAPElement
is removed as part of the process. - Returns:
- the
Document
representation of theSOAPBody
content. - Throws:
SOAPException
- if there is not exactly one childSOAPElement
of theSOAPBody
.- 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 : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!