|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.xml.ws.api.message.Messages
public abstract class Messages
Factory methods for various Message
implementations.
This class provides various methods to create different
flavors of Message
classes that store data
in different formats.
This is a part of the JAX-WS RI internal API so that
Tube
implementations can reuse the implementations
done inside the JAX-WS.
If you find some of the useful convenience methods missing from this class, please talk to us.
Method Summary | |
---|---|
static Message |
create(org.w3c.dom.Element soapEnvelope)
Creates a Message from an Element that represents
the whole SOAP message. |
static Message |
create(javax.xml.bind.JAXBContext context,
java.lang.Object jaxbObject,
SOAPVersion soapVersion)
Deprecated. |
static Message |
create(javax.xml.bind.Marshaller marshaller,
java.lang.Object jaxbObject,
SOAPVersion soapVersion)
Deprecated. Use #create(JAXBRIContext, Object, SOAPVersion) |
static Message |
create(javax.xml.soap.SOAPFault fault)
Creates a fault Message . |
static Message |
create(javax.xml.soap.SOAPMessage saaj)
Creates a Message backed by a SAAJ SOAPMessage object. |
static Message |
create(SOAPVersion soapVersion,
javax.xml.ws.ProtocolException pex,
javax.xml.namespace.QName faultcode)
To be called to convert a ProtocolException and faultcode for a given SOAPVersion in to a Message . |
static Message |
create(javax.xml.transform.Source envelope,
SOAPVersion soapVersion)
Creates a Message using Source as entire envelope. |
static Message |
create(java.lang.String unsupportedAction,
AddressingVersion av,
SOAPVersion sv)
Creates a fault Message that captures the code/subcode/subsubcode
defined by WS-Addressing if wsa:Action is not supported. |
static Message |
create(java.lang.Throwable t,
SOAPVersion soapVersion)
Creates a Message that represents an exception as a fault. |
static Message |
create(com.sun.xml.stream.buffer.XMLStreamBuffer xsb)
Creates a Message from XMLStreamBuffer that retains the
whole envelope infoset. |
static Message |
create(javax.xml.stream.XMLStreamReader reader)
Creates a Message from XMLStreamReader that points to
the start of the envelope. |
static Message |
createAddressingFaultMessage(WSBinding binding,
Packet p,
javax.xml.namespace.QName missingHeader)
Creates a fault Message that captures the code/subcode/subsubcode
defined by WS-Addressing if one of the expected WS-Addressing headers is
missing in the message |
static Message |
createAddressingFaultMessage(WSBinding binding,
javax.xml.namespace.QName missingHeader)
Deprecated. Use createAddressingFaultMessage(WSBinding, Packet, QName) |
static Message |
createEmpty(SOAPVersion soapVersion)
Creates a Message that doesn't have any payload. |
static Message |
createRaw(javax.xml.bind.JAXBContext context,
java.lang.Object jaxbObject,
SOAPVersion soapVersion)
Deprecated. For use when creating a Dispatch object with an unknown JAXB implementation for he JAXBContext parameter. |
static Message |
createUsingPayload(org.w3c.dom.Element payload,
SOAPVersion ver)
Creates a Message from an Element that represents
a payload. |
static Message |
createUsingPayload(javax.xml.transform.Source payload,
SOAPVersion ver)
Creates a Message using Source as payload. |
static Message |
createUsingPayload(javax.xml.stream.XMLStreamReader payload,
SOAPVersion ver)
Creates a Message using XMLStreamReader as payload. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Message create(javax.xml.bind.JAXBContext context, java.lang.Object jaxbObject, SOAPVersion soapVersion)
Message
backed by a JAXB bean.
context
- The context to be used to produce infoset from the object. Must not be null.jaxbObject
- The JAXB object that represents the payload. must not be null. This object
must be bound to an element (which means it either is a JAXBElement
or
an instanceof a class with XmlRootElement
).soapVersion
- The SOAP version of the message. Must not be null.public static Message createRaw(javax.xml.bind.JAXBContext context, java.lang.Object jaxbObject, SOAPVersion soapVersion)
public static Message create(javax.xml.bind.Marshaller marshaller, java.lang.Object jaxbObject, SOAPVersion soapVersion)
#create(JAXBRIContext, Object, SOAPVersion)
public static Message create(javax.xml.soap.SOAPMessage saaj)
Message
backed by a SAAJ SOAPMessage
object.
If the SOAPMessage
contains headers and attachments, this method
does the right thing.
saaj
- The SOAP message to be represented as a Message
.
Must not be null. Once this method is invoked, the created
Message
will own the SOAPMessage
, so it shall
never be touched directly.public static Message createUsingPayload(javax.xml.transform.Source payload, SOAPVersion ver)
Message
using Source
as payload.
payload
- Source payload is Message
's payload
Must not be null. Once this method is invoked, the created
Message
will own the Source
, so it shall
never be touched directly.ver
- The SOAP version of the message. Must not be null.public static Message createUsingPayload(javax.xml.stream.XMLStreamReader payload, SOAPVersion ver)
Message
using XMLStreamReader
as payload.
payload
- XMLStreamReader payload is Message
's payload
Must not be null. Once this method is invoked, the created
Message
will own the XMLStreamReader
, so it shall
never be touched directly.ver
- The SOAP version of the message. Must not be null.public static Message createUsingPayload(org.w3c.dom.Element payload, SOAPVersion ver)
Message
from an Element
that represents
a payload.
payload
- The element that becomes the child element of the SOAP body.
Must not be null.ver
- The SOAP version of the message. Must not be null.public static Message create(org.w3c.dom.Element soapEnvelope)
Message
from an Element
that represents
the whole SOAP message.
soapEnvelope
- The SOAP envelope element.public static Message create(javax.xml.transform.Source envelope, SOAPVersion soapVersion)
Message
using Source as entire envelope.
envelope
- Source envelope is used to create Message
Must not be null. Once this method is invoked, the created
Message
will own the Source
, so it shall
never be touched directly.public static Message createEmpty(SOAPVersion soapVersion)
Message
that doesn't have any payload.
@NotNull public static Message create(@NotNull javax.xml.stream.XMLStreamReader reader)
Message
from XMLStreamReader
that points to
the start of the envelope.
reader
- can point to the start document or the start element (of <s:Envelope>)@NotNull public static Message create(@NotNull com.sun.xml.stream.buffer.XMLStreamBuffer xsb)
Message
from XMLStreamBuffer
that retains the
whole envelope infoset.
xsb
- This buffer must contain the infoset of the whole envelope.public static Message create(java.lang.Throwable t, SOAPVersion soapVersion)
Message
that represents an exception as a fault. The
created message reflects if t or t.getCause() is SOAPFaultException.
creates a fault message with default faultCode env:Server if t or t.getCause()
is not SOAPFaultException. Otherwise, it use SOAPFaultException's faultCode
Throwable
.public static Message create(javax.xml.soap.SOAPFault fault)
Message
.
This method is not designed for efficiency, and we don't expect to be used for the performance critical codepath.
fault
- The populated SAAJ data structure that represents a fault
in detail.
SOAPFault
.public static Message createAddressingFaultMessage(WSBinding binding, javax.xml.namespace.QName missingHeader)
createAddressingFaultMessage(WSBinding, Packet, QName)
public static Message createAddressingFaultMessage(WSBinding binding, Packet p, javax.xml.namespace.QName missingHeader)
Message
that captures the code/subcode/subsubcode
defined by WS-Addressing if one of the expected WS-Addressing headers is
missing in the message
binding
- WSBindingp
- Packet
that was missing a WS-Addressing header.missingHeader
- The missing WS-Addressing Header
public static Message create(@NotNull java.lang.String unsupportedAction, @NotNull AddressingVersion av, @NotNull SOAPVersion sv)
Message
that captures the code/subcode/subsubcode
defined by WS-Addressing if wsa:Action is not supported.
unsupportedAction
- The unsupported Action. Must not be null.av
- The WS-Addressing version of the message. Must not be null.sv
- The SOAP Version of the message. Must not be null.
@NotNull public static Message create(@NotNull SOAPVersion soapVersion, @NotNull javax.xml.ws.ProtocolException pex, @Nullable javax.xml.namespace.QName faultcode)
ProtocolException
and faultcode for a given SOAPVersion
in to a Message
.
soapVersion
- SOAPVersion.SOAP_11
or SOAPVersion.SOAP_12
pex
- a ProtocolExceptionfaultcode
- soap faultcode. Its ignored if the ProtocolException
instance is SOAPFaultException
and it has a
faultcode present in the underlying SOAPFault
.
Message
representing SOAP fault
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |