SOAPHeaderElement (Java EE 5)

Java EE API


javax.xml.soap Interface SOAPHeaderElement

All Superinterfaces:
Element, Node, SOAPElement

public interface SOAPHeaderElement
extends SOAPElement

Implements: SOAPElement

表示 SOAP 信封 SOAP 头部分的内容的对象。SOAPHeader 对象的直接子级只能用 SOAPHeaderElement 对象的形式表示。

SOAPHeaderElement 对象可以将其他 SOAPElement 对象作为其子级。

英文文档:

An object representing the contents in the SOAP header part of the SOAP envelope. The immediate children of a SOAPHeader object can be represented only as SOAPHeaderElement objects.

A SOAPHeaderElement object can have other SOAPElement objects as its children.


Field Summary
 
Fields inherited from interface org.w3c.dom.Node
 
Fields inherited from interface org.w3c.dom.Node
 
Method Summary
 String
 boolean
 boolean
 String
 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 setActor(String actorURI)
将与此 SOAPHeaderElement 对象关联的 actor 设置为指定 actor。actor 的默认值为:SOAPConstants.URI_SOAP_ACTOR_NEXT

如果此 SOAPHeaderElement 支持 SOAP 1.2,则此调用等效于 #setRole(String)

actorURI 给出要设置 actor URI 的 String
ThrowsIllegalArgumentException: 如果在设置 actor 时出现问题。
See also getActor

英文文档:

setActor

void setActor(String actorURI)
Sets the actor associated with this SOAPHeaderElement object to the specified actor. The default value of an actor is: SOAPConstants.URI_SOAP_ACTOR_NEXT

If this SOAPHeaderElement supports SOAP 1.2 then this call is equivalent to setRole(String)

Parameters:
actorURI - a String giving the URI of the actor to set
Throws:
IllegalArgumentException - if there is a problem in setting the actor.
See Also:
getActor()

public void setRole(String uri) throws SOAPException
将与此 SOAPHeaderElement 对象关联的 Role 设置为指定 Role
uri Role 的 URI
ThrowsSOAPException: 如果在设置 role 时出现错误
ThrowsUnsupportedOperationException: 如果此消息不支持 SOAP 1.2 定义的 Fault Role。
sinceSAAJ 1.3
英文文档:

setRole

void setRole(String uri)
             throws SOAPException
Sets the Role associated with this SOAPHeaderElement object to the specified Role.

Parameters:
uri - - the URI of the Role
Throws:
SOAPException - if there is an error in setting the role
UnsupportedOperationException - if this message does not support the SOAP 1.2 concept of Fault Role.
Since:
SAAJ 1.3

public String getActor()
返回此 SOAPHeaderElement actor 属性的 URL。

如果此 SOAPHeaderElement 支持 SOAP 1.2,则此调用等效于 #getRole()

return 给出 actor URI 的 String
See also setActor

英文文档:

getActor

String getActor()
Returns the uri of the actor attribute of this SOAPHeaderElement.

If this SOAPHeaderElement supports SOAP 1.2 then this call is equivalent to getRole()

Returns:
a String giving the URI of the actor
See Also:
setActor(java.lang.String)

public String getRole()
返回此 SOAPHeaderElement Role 属性的值。
return 给出 Role URI 的 String
ThrowsUnsupportedOperationException: 如果此消息不支持 SOAP 1.2 定义的 Fault Role。
sinceSAAJ 1.3
英文文档:

getRole

String getRole()
Returns the value of the Role attribute of this SOAPHeaderElement.

Returns:
a String giving the URI of the Role
Throws:
UnsupportedOperationException - if this message does not support the SOAP 1.2 concept of Fault Role.
Since:
SAAJ 1.3

public void setMustUnderstand(boolean mustUnderstand)
将此 SOAPHeaderElement 对象的 mustUnderstand 属性设置为 true 或 false。

如果 mustUnderstand 属性处于开状态,则收到 SOAPHeaderElement 的 actor 必须对其进行正确处理。在 SOAPHeaderElement 对象修改消息的情况下,这可确保消息能被正确的修改。

mustUnderstand 该参数为 true 时,将 mustUnderstand 属性设置为 true;该参数为 false 时,则将其设置为 false
ThrowsIllegalArgumentException: 如果在设置 mustUnderstand 属性时出现问题。
See also getMustUnderstand, setRelay

英文文档:

setMustUnderstand

void setMustUnderstand(boolean mustUnderstand)
Sets the mustUnderstand attribute for this SOAPHeaderElement object to be either true or false.

If the mustUnderstand attribute is on, the actor who receives the SOAPHeaderElement must process it correctly. This ensures, for example, that if the SOAPHeaderElement object modifies the message, that the message is being modified correctly.

Parameters:
mustUnderstand - true to set the mustUnderstand attribute to true; false to set it to false
Throws:
IllegalArgumentException - if there is a problem in setting the mustUnderstand attribute
See Also:
getMustUnderstand(), setRelay(boolean)

public boolean getMustUnderstand()
返回此 SOAPHeaderElement mustUnderstand 属性的 boolean 值。
return 如果启用了此 SOAPHeaderElement 对象的 mustUnderstand 属性,则返回 true;否则返回 false
英文文档:

getMustUnderstand

boolean getMustUnderstand()
Returns the boolean value of the mustUnderstand attribute for this SOAPHeaderElement.

Returns:
true if the mustUnderstand attribute of this SOAPHeaderElement object is turned on; false otherwise

public void setRelay(boolean relay) throws SOAPException
将此 SOAPHeaderElementrelay 属性设置为 true 或 false。

SOAP relay 属性设置为 true 指示 SOAP 头块必须通过其指定的所有节点进行中继,但实际并不处理该头块。此属性在 mustUnderstand 属性设置为 true 或被最终接收者(默认)指定的头块处被忽略。此属性的默认值为 false

relay relay 属性的新值
ThrowsSOAPException: 如果在设置 relay 属性时出现问题。
ThrowsUnsupportedOperationException: 如果此消息不支持 SOAP 1.2 定义的 Relay 属性。
sinceSAAJ 1.3
See also setMustUnderstand, getRelay

英文文档:

setRelay

void setRelay(boolean relay)
              throws SOAPException
Sets the relay attribute for this SOAPHeaderElement to be either true or false.

The SOAP relay attribute is set to true to indicate that the SOAP header block must be relayed by any node that is targeted by the header block but not actually process it. This attribute is ignored on header blocks whose mustUnderstand attribute is set to true or that are targeted at the ultimate reciever (which is the default). The default value of this attribute is false.

Parameters:
relay - the new value of the relay attribute
Throws:
SOAPException - if there is a problem in setting the relay attribute.
UnsupportedOperationException - if this message does not support the SOAP 1.2 concept of Relay attribute.
Since:
SAAJ 1.3
See Also:
setMustUnderstand(boolean), getRelay()

public boolean getRelay()
返回此 SOAPHeaderElement relay 属性的 boolean 值。
return 如果 relay 属性已开启,则返回 true;否则返回 false
ThrowsUnsupportedOperationException: 如果此消息不支持 SOAP 1.2 定义的 Relay 属性。
sinceSAAJ 1.3
See also getMustUnderstand, setRelay
英文文档:

getRelay

boolean getRelay()
Returns the boolean value of the relay attribute for this SOAPHeaderElement

Returns:
true if the relay attribute is turned on; false otherwise
Throws:
UnsupportedOperationException - if this message does not support the SOAP 1.2 concept of Relay attribute.
Since:
SAAJ 1.3
See Also:
getMustUnderstand(), setRelay(boolean)


Submit a bug or feature

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

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

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