Class Message
- java.lang.Object
-
- com.sun.identity.liberty.ws.soapbinding.Message
-
@SupportedAll public class Message extends Object
TheMessage
class is used by web service client and server to construct request or response. It will be sent over the SOAP connection. TheMessage
contains SOAP headers and bodies. The SOAP binding defines the following headers:CorrelationHeader
,ProviderHeader
,ConsentHeader
,UsageDirectiveHeader
,ProcessingContextHeader
andServiceInstanceUpdateHeader
. The first 2 are required and the others are optional. Signing is mandatory forCorrelationHeader
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
Fields Modifier and Type Field Description static int
ANONYMOUS
anonymous profile is specified.static int
BEARER_TOKEN
Bearer Token profile is specified.static int
SAML_TOKEN
SAML Token profile is specified.static int
X509_TOKEN
X509 Token profile is specified.
-
Constructor Summary
Constructors Constructor Description Message()
Default Constructor.Message(SOAPFault soapFault)
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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SecurityAssertion
getAssertion()
Returns the SAML assertion used for signing.List
getBodies()
Returns a list of SOAP bodies.ConsentHeader
getConsentHeader()
Returns theConsentHeader
.CorrelationHeader
getCorrelationHeader()
Returns theCorrelationHeader
.X509Certificate
getMessageCertificate()
Returns the X509 certificate used in message level authentication.List
getOtherSOAPHeaders()
Returns a list of SOAP headers exceptCorrelationHeader
,ConsentHeader
,UsageDirectiveHeader
andSecurity
header.X509Certificate
getPeerCertificate()
Returns the X509 certificate used in client authentication.int
getSecurityProfileType()
Gets security profile type.List
getSigningIds()
Returns a list of id's for signing.SOAPFault
getSOAPFault()
Returns theSOAPFault
.Object
getToken()
Returns a token for the sender of this Message.List
getUsageDirectiveHeaders()
Returns a list ofUsageDirectiveHeader
.String
getWSFVersion()
Returns the web services version of the message.void
setSOAPBody(Element body)
Sets a SOAP body.Document
toDocument(boolean refresh)
Returns the SOAP message inorg.w3c.dom.Document
format.String
toString()
Returns the SOAP message in String format.
-
-
-
Field Detail
-
ANONYMOUS
public static final int ANONYMOUS
anonymous profile is specified.- See Also:
- Constant Field Values
-
X509_TOKEN
public static final int X509_TOKEN
X509 Token profile is specified.- See Also:
- Constant Field Values
-
SAML_TOKEN
public static final int SAML_TOKEN
SAML Token profile is specified.- See Also:
- Constant Field Values
-
BEARER_TOKEN
public static final int BEARER_TOKEN
Bearer Token profile is specified.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Message
public Message()
Default Constructor.
-
Message
public Message(SOAPFault soapFault)
This constructor is to create a SOAP fault message.- Parameters:
soapFault
-SOAPFault
-
Message
public Message(InputStream inputStream) throws SOAPBindingException
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 Detail
-
getSecurityProfileType
public int getSecurityProfileType()
Gets security profile type. Possible values are ANONYMOUS, X509_TOKEN and SAML_TOKEN.- Returns:
- the Security Profile type
-
getCorrelationHeader
public CorrelationHeader getCorrelationHeader()
Returns theCorrelationHeader
.- Returns:
- the
CorrelationHeader
.
-
getConsentHeader
public ConsentHeader getConsentHeader()
Returns theConsentHeader
.- Returns:
- the
ConsentHeader
.
-
getUsageDirectiveHeaders
public List getUsageDirectiveHeaders()
Returns a list ofUsageDirectiveHeader
.- Returns:
- a list of
UsageDirectiveHeader
.
-
getOtherSOAPHeaders
public List 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
public SOAPFault getSOAPFault()
Returns theSOAPFault
.- Returns:
- the
SOAPFault
.
-
getBodies
public List getBodies()
Returns a list of SOAP bodies. Each entry will be aorg.w3c.dom.Element
.- Returns:
- a list of SOAP bodies
-
getAssertion
public SecurityAssertion getAssertion()
Returns the SAML assertion used for signing.- Returns:
- the SAML assertion.
-
getPeerCertificate
public X509Certificate getPeerCertificate()
Returns the X509 certificate used in client authentication.- Returns:
- a X509 certificate
-
getMessageCertificate
public X509Certificate getMessageCertificate()
Returns the X509 certificate used in message level authentication.- Returns:
- a X509 certificate.
-
getToken
public Object getToken()
Returns a token for the sender of this Message.- Returns:
- a token Object.
-
getSigningIds
public List getSigningIds()
Returns a list of id's for signing.- Returns:
- a list of id's for signing.
-
setSOAPBody
public void setSOAPBody(Element body)
Sets a SOAP body. To send a SOAP Fault, please use methodsetSOAPFault
.- Parameters:
body
- aorg.w3c.dom.Element
-
toString
public String toString()
Returns the SOAP message in String format.
-
toDocument
public Document toDocument(boolean refresh) throws SOAPBindingException
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
public String getWSFVersion()
Returns the web services version of the message.- Returns:
- the web services version.
-
-