|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.muse.ws.addressing.MessageHeaders
public class MessageHeaders
MessageHeaders provides WS-Addressing processing for SOAP message headers.
It can be used to parse SOAP headers according to WS-A spec and read the
values or create a new set of headers that can be serialized to a
set of valid SOAP headers.
This class references the W3C DOM API rather than the SAAJ API
because SOAPElements can usually be converted into DOM Elements very
easily, but having a DOM Element does not mean that the user code has
access to (or wants access to) the SAAJ API and its SOAP factories.
EndpointReference
Constructor Summary | |
---|---|
MessageHeaders(Element soapHeaders)
Creates a valid set of WS-A message headers from the given SOAP Header. |
|
MessageHeaders(EndpointReference to,
String action)
Creates a new set of WS-A message headers targeted to the given EPR and Action. |
Method Summary | |
---|---|
MessageHeaders |
createFaultHeaders()
Returns a new set of WS-A message headers based on this object; the headers returned can be used when replying to a message with a fault. |
MessageHeaders |
createReplyHeaders()
Returns a new set of WS-A message headers based on this object; the headers returned can be used when replying to a message (no fault). |
String |
getAction()
|
Element |
getCustomHeader(QName elementName)
This method is useful if you are only expecting one instance of a given SOAP header element and do not want to sort through a Collection or Iterator just to get one item. |
Collection |
getCustomHeaderNames()
|
Collection |
getCustomHeaders(QName elementName)
|
EndpointReference |
getFaultToAddress()
|
EndpointReference |
getFromAddress()
|
String |
getMessageID()
|
String |
getMethodName()
|
String |
getRelationship()
|
QName |
getRelationshipType()
|
EndpointReference |
getReplyToAddress()
|
EndpointReference |
getToAddress()
|
protected void |
setAction(String action)
|
void |
setFaultToAddress(EndpointReference faultTo)
|
void |
setFromAddress(EndpointReference from)
|
protected void |
setMessageID(String messageID)
|
void |
setRelationship(String relationship)
|
void |
setReplyToAddress(EndpointReference replyTo)
|
protected void |
setToAddress(EndpointReference to)
|
protected void |
throwInvalidAddressingHeaderFault(String message)
|
String |
toString()
|
Element |
toXML()
Converts this object into an XML representation, as defined by its related schema or specification. |
Element |
toXML(Document doc)
Converts this object into an XML representation, as defined by its related schema or specification. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MessageHeaders(Element soapHeaders) throws SoapFault
soapHeaders
- The Element representing a SOAP envelope's Header. The Header
should contain all of the required WS-A elements.
SoapFault
- createFaultHeaders()
,
createReplyHeaders()
public MessageHeaders(EndpointReference to, String action)
to
- The EPR that will supply the URI for wsa:To.action
- The wsa:Action URI.Method Detail |
---|
public MessageHeaders createFaultHeaders()
createReplyHeaders()
,
getFaultToAddress()
,
setFaultToAddress(EndpointReference)
,
WsaConstants.FAULT_URI
public MessageHeaders createReplyHeaders()
getReplyToAddress()
,
setReplyToAddress(EndpointReference)
public String getAction()
public Element getCustomHeader(QName elementName)
elementName
- The name of the non-WS-A SOAP header to return.
public Collection getCustomHeaders(QName elementName)
elementName
- The name of the non-WS-A SOAP header(s) to return.
public Collection getCustomHeaderNames()
public EndpointReference getFaultToAddress()
public EndpointReference getFromAddress()
public String getMessageID()
public String getMethodName()
public String getRelationship()
public QName getRelationshipType()
WsaConstants.REPLY_RELATIONSHIP_QNAME
public EndpointReference getReplyToAddress()
public EndpointReference getToAddress()
protected void setAction(String action)
action
- The wsa:Action URI. This cannot be null.public void setFaultToAddress(EndpointReference faultTo)
faultTo
- The wsa:FaultTo EPR - if non-null, a copy of EPR will be made,
so modifications to the original will have no effect on this
set of headers.public void setFromAddress(EndpointReference from)
from
- The wsa:From EPR - if non-null, a copy of EPR will be made, so
modifications to the original will have no effect on this set
of headers.protected void setMessageID(String messageID)
messageID
- The wsa:MessageID. This cannot be null.public void setRelationship(String relationship)
relationship
- The wsa:RelatesTo ID. This cannot be null;public void setReplyToAddress(EndpointReference replyTo)
replyTo
- The wsa:ReplyTo EPR - if non-null, a copy of EPR will be made,
so modifications to the original will have no effect on this
set of headers.protected void setToAddress(EndpointReference to)
to
- An EPR with the address value for the wsa:To URI. This cannot
be null. No copy of the given EPR is made, so subsequent
modifications to it will affect this object.protected void throwInvalidAddressingHeaderFault(String message) throws SoapFault
SoapFault
public String toString()
toString
in class Object
public Element toXML()
XmlSerializable
toXML
in interface XmlSerializable
toXML(Document)
public Element toXML(Document doc)
XmlSerializable
toXML
in interface XmlSerializable
doc
- The XML Document to use when creating new elements for the
SOAP Header XML. The elements that are created will not
be appended to this Document.
SoapConstants.HEADER_QNAME
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |