Class Message
java.lang.Object
com.sun.identity.liberty.ws.soapbinding.Message
The
Message
class is used by web service client and server to
construct request or response. It will be sent over the SOAP connection.
The Message
contains SOAP headers and bodies. The SOAP binding
defines the following headers: CorrelationHeader
,
ProviderHeader
, ConsentHeader
,
UsageDirectiveHeader
, ProcessingContextHeader
and ServiceInstanceUpdateHeader
.
The first 2 are required and the others are optional.
Signing is mandatory for CorrelationHeader
and SOAP Body
element which is the parent of the bodies. Other headers are optional,
so each header needs to have a flag to specify whether it needs to be
signed or not. For each header that needs to be signed, it must have an
id attribute in the top element. The constuctor will take a SAML assertion
or cert alias in order to sign.-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
anonymous profile is specified.static final int
Bearer Token profile is specified.static final int
SAML Token profile is specified.static final int
X509 Token profile is specified. -
Constructor Summary
ConstructorDescriptionMessage()
Default Constructor.This constructor is to create a SOAP fault message.Message
(InputStream inputStream) This constructor takes an InputStream.Message
(javax.xml.soap.SOAPMessage soapMessage) This constructor takes a SOAP message which is received from a SOAP connection. -
Method Summary
Modifier and TypeMethodDescriptionReturns the SAML assertion used for signing.Returns a list of SOAP bodies.Returns theConsentHeader
.Returns theCorrelationHeader
.Returns the X509 certificate used in message level authentication.Returns a list of SOAP headers exceptCorrelationHeader
,ConsentHeader
,UsageDirectiveHeader
andSecurity
header.Returns the X509 certificate used in client authentication.int
Gets security profile type.Returns a list of id's for signing.Returns theSOAPFault
.getToken()
Returns a token for the sender of this Message.Returns a list ofUsageDirectiveHeader
.Returns the web services version of the message.void
setSOAPBody
(Element body) Sets a SOAP body.toDocument
(boolean refresh) Returns the SOAP message inorg.w3c.dom.Document
format.toString()
Returns the SOAP message in String format.
-
Field Details
-
ANONYMOUS
public static final int ANONYMOUSanonymous profile is specified.- See Also:
-
X509_TOKEN
public static final int X509_TOKENX509 Token profile is specified.- See Also:
-
SAML_TOKEN
public static final int SAML_TOKENSAML Token profile is specified.- See Also:
-
BEARER_TOKEN
public static final int BEARER_TOKENBearer Token profile is specified.- See Also:
-
-
Constructor Details
-
Message
public Message()Default Constructor. -
Message
This constructor is to create a SOAP fault message.- Parameters:
soapFault
-SOAPFault
-
Message
This constructor takes an InputStream.- Parameters:
inputStream
- an InputStream- Throws:
SOAPBindingException
- if an error occurs while parsing the input.
-
Message
public Message(javax.xml.soap.SOAPMessage soapMessage) throws SOAPBindingException, SOAPFaultException This constructor takes a SOAP message which is received from a SOAP connection.- Parameters:
soapMessage
- a SOAP message- Throws:
SOAPBindingException
- if an error occurs while parsing the SOAP messageSOAPFaultException
-
-
Method Details
-
getSecurityProfileType
public int getSecurityProfileType()Gets security profile type. Possible values are ANONYMOUS, X509_TOKEN and SAML_TOKEN.- Returns:
- the Security Profile type
-
getCorrelationHeader
Returns theCorrelationHeader
.- Returns:
- the
CorrelationHeader
.
-
getConsentHeader
Returns theConsentHeader
.- Returns:
- the
ConsentHeader
.
-
getUsageDirectiveHeaders
Returns a list ofUsageDirectiveHeader
.- Returns:
- a list of
UsageDirectiveHeader
.
-
getOtherSOAPHeaders
Returns a list of SOAP headers exceptCorrelationHeader
,ConsentHeader
,UsageDirectiveHeader
andSecurity
header. Each entry will be aorg.w3c.dom.Element
.- Returns:
- a list of SOAP headers
-
getSOAPFault
Returns theSOAPFault
.- Returns:
- the
SOAPFault
.
-
getBodies
Returns a list of SOAP bodies. Each entry will be aorg.w3c.dom.Element
.- Returns:
- a list of SOAP bodies
-
getAssertion
Returns the SAML assertion used for signing.- Returns:
- the SAML assertion.
-
getPeerCertificate
Returns the X509 certificate used in client authentication.- Returns:
- a X509 certificate
-
getMessageCertificate
Returns the X509 certificate used in message level authentication.- Returns:
- a X509 certificate.
-
getToken
Returns a token for the sender of this Message.- Returns:
- a token Object.
-
getSigningIds
Returns a list of id's for signing.- Returns:
- a list of id's for signing.
-
setSOAPBody
Sets a SOAP body. To send a SOAP Fault, please use methodsetSOAPFault
.- Parameters:
body
- aorg.w3c.dom.Element
-
toString
Returns the SOAP message in String format. -
toDocument
Returns the SOAP message inorg.w3c.dom.Document
format.- Parameters:
refresh
- true to reconstruct a document, false to reuse a previous document. If previous document doesn't exist, it will construct a new document.- Returns:
- the SOAP message in
org.w3c.dom.Document
format. - Throws:
SOAPBindingException
- if an error occurs while constructing theorg.w3c.dom.Document
.
-
getWSFVersion
Returns the web services version of the message.- Returns:
- the web services version.
-