|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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 | |
static int |
ANONYMOUS
anonymous profile is specified. |
static int |
BEARER_TOKEN
Bearer Token profile is specified. |
static java.lang.String |
CLIENT_TLS_BEARER
Authentication mechanism "urn:liberty:security:2004-04:ClientTLS:Bearer" |
static java.lang.String |
CLIENT_TLS_NULL
Authentication mechanism "urn:liberty:security:2003-08:ClientTLS:null" |
static java.lang.String |
CLIENT_TLS_SAML
Authentication mechanism "urn:liberty:security:2003-08:ClientTLS:SAML" |
static java.lang.String |
CLIENT_TLS_X509
Authentication mechanism "urn:liberty:security:2003-08:ClientTLS:X509" |
static java.lang.String |
NULL_BEARER
Authentication mechanism "urn:liberty:security:2004-04:null:Bearer" |
static java.lang.String |
NULL_NULL
Authentication mechanism "urn:liberty:security:2003-08:null:null" |
static java.lang.String |
NULL_SAML
Authentication mechanism "urn:liberty:security:2003-08:null:SAML" |
static java.lang.String |
NULL_X509
Authentication mechanism "urn:liberty:security:2003-08:null:X509" |
static int |
SAML_TOKEN
SAML Token profile is specified. |
static java.lang.String |
TLS_BEARER
Authentication mechanism "urn:liberty:security:2004-04:TLS:Bearer" |
static java.lang.String |
TLS_NULL
Authentication mechanism "urn:liberty:security:2003-08:TLS:null" |
static java.lang.String |
TLS_SAML
Authentication mechanism "urn:liberty:security:2003-08:TLS:SAML" |
static java.lang.String |
TLS_X509
Authentication mechanism "urn:liberty:security:2003-08:TLS:X509" |
static int |
X509_TOKEN
X509 Token profile is specified. |
Constructor Summary | |
Message()
The default constructor uses default cert alias defined in AMConfig for signing. |
|
Message(java.io.InputStream inputStream)
This constructor takes an InputStream. |
|
Message(ProviderHeader providerHeader)
The default constructor uses default cert alias defined in AMConfig for signing. |
|
Message(ProviderHeader providerHeader,
BinarySecurityToken token)
This constructor takes a binary security token for signing. |
|
Message(ProviderHeader providerHeader,
SecurityAssertion assertion)
This constructor takes a SAML assertion for signing. |
|
Message(SOAPFault soapFault)
This constructor is to create a SOAP fault message. |
Method Summary | |
SecurityAssertion |
getAssertion()
Returns the SAML assertion used for signing. |
java.lang.String |
getAuthenticationMechanism()
Gets authentication mechanism. |
BinarySecurityToken |
getBinarySecurityToken()
Returns a binary security token used for signing. |
java.util.List |
getBodies()
Returns a list of SOAP bodies. |
java.util.List |
getBodies(java.lang.String namespaceURI,
java.lang.String localName)
Returns a list of SOAP bodies. |
ConsentHeader |
getConsentHeader()
Returns ConsentHeader . |
CorrelationHeader |
getCorrelationHeader()
Returns CorrelationHeader . |
java.lang.String |
getIPAddress()
Returns the IP address of remote site of the SOAP connection. |
java.security.cert.X509Certificate |
getMessageCertificate()
Returns the X509 certificate used in message level authentication |
java.util.List |
getOtherSecurityHeaders()
Returns a list of security header except the SAML assertion used in SAML token profile or the binary security token used in X509 token profile. |
java.util.List |
getOtherSOAPHeaders()
Returns a list of SOAP headers except CorrelationHeader ,
ConsentHeader , UsageDirectiveHeader and
'Security' header. |
java.security.cert.X509Certificate |
getPeerCertificate()
Returns the X509 certificate used in client authentication |
ProcessingContextHeader |
getProcessingContextHeader()
Returns ProcessingContextHeader . |
ProviderHeader |
getProviderHeader()
Returns ProviderHeader . |
int |
getSecurityProfileType()
Gets security profile type. |
ServiceInstanceUpdateHeader |
getServiceInstanceUpdateHeader()
Returns ServiceInstanceUpdateHeader . |
java.util.List |
getSigningIds()
Returns a list of id's for signing. |
SOAPFault |
getSOAPFault()
Returns SOAPFault |
java.lang.Object |
getToken()
Returns a token for the sender of this Message. |
java.util.List |
getUsageDirectiveHeaders()
Returns a list of UsageDirectiveHeader . |
boolean |
isClientAuthentication()
Returns a boolean flag to determine if this Message will be sent to a server that requires client authentication. |
void |
setClientAuthentication(boolean clientAuthentication)
Sets a boolean flag. |
void |
setConsentHeader(ConsentHeader consentHeader)
Sets ConsentHeader . |
void |
setCorrelationHeader(CorrelationHeader correlationHeader)
Sets CorrelationHeader . |
void |
setOtherSecurityHeader(org.w3c.dom.Element header)
Sets a security header. |
void |
setOtherSecurityHeaders(java.util.List headers)
Sets a list of security headers. |
void |
setOtherSOAPHeader(org.w3c.dom.Element header,
java.lang.String signingId)
Sets a SOAP header except CorrelationHeader ,
ConsentHeader and UsageDirectiveHeader . |
void |
setOtherSOAPHeaders(java.util.List headers,
java.util.List signingIds)
Sets a list of SOAP headers except CorrelationHeader ,
ConsentHeader , UsageDirectiveHeader and
'Security' header. |
void |
setProcessingContextHeader(ProcessingContextHeader processingContextHeader)
Sets ProcessingContextHeader . |
void |
setProviderHeader(ProviderHeader providerHeader)
Sets ProviderHeader if it is not null. |
void |
setServiceInstanceUpdateHeader(ServiceInstanceUpdateHeader serviceInstanceUpdateHeader)
Sets ServiceInstanceUpdateHeader . |
void |
setSOAPBodies(java.util.List bodies)
Sets a list of SOAP bodies. |
void |
setSOAPBody(org.w3c.dom.Element body)
Sets a SOAP body. |
void |
setSOAPFault(SOAPFault soapFault)
Sets SOAPFault . |
void |
setUsageDirectiveHeaders(java.util.List usageDirectiveHeaders)
Sets a list of UsageDirectiveHeader . |
org.w3c.dom.Document |
toDocument()
Returns the SOAP message in org.w3c.dom.Document format |
org.w3c.dom.Document |
toDocument(boolean refresh)
Returns the SOAP message in org.w3c.dom.Document format |
java.lang.String |
toString()
Returns the SOAP message in String format |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int ANONYMOUS
public static final int X509_TOKEN
public static final int SAML_TOKEN
public static final int BEARER_TOKEN
public static final java.lang.String NULL_NULL
public static final java.lang.String NULL_X509
public static final java.lang.String NULL_SAML
public static final java.lang.String NULL_BEARER
public static final java.lang.String TLS_NULL
public static final java.lang.String TLS_X509
public static final java.lang.String TLS_SAML
public static final java.lang.String TLS_BEARER
public static final java.lang.String CLIENT_TLS_NULL
public static final java.lang.String CLIENT_TLS_X509
public static final java.lang.String CLIENT_TLS_SAML
public static final java.lang.String CLIENT_TLS_BEARER
Constructor Detail |
public Message()
public Message(ProviderHeader providerHeader) throws SOAPBindingException
providerHeader
- ProviderHeader
SOAPBindingException
- if provider header is nullpublic Message(ProviderHeader providerHeader, SecurityAssertion assertion) throws SOAPBindingException
providerHeader
- ProviderHeader
assertion
- a SAML assertionSOAPBindingException
- if an error occurs while processing
the SAML assertion or the provider
header is nullpublic Message(ProviderHeader providerHeader, BinarySecurityToken token) throws SOAPBindingException
providerHeader
- ProviderHeader
token
- a binary security tokenSOAPBindingException
- if an error occurs while processing
the token or the provider header is nullpublic Message(SOAPFault soapFault)
soapFault
- SOAPFault
public Message(java.io.InputStream inputStream) throws SOAPBindingException
inputStream
- an InputStreamSOAPBindingException
- if an error occurs while parsing
the inputMethod Detail |
public int getSecurityProfileType()
public java.lang.String getAuthenticationMechanism()
public boolean isClientAuthentication()
public CorrelationHeader getCorrelationHeader()
CorrelationHeader
.CorrelationHeader
public ConsentHeader getConsentHeader()
ConsentHeader
.ConsentHeader
public java.util.List getUsageDirectiveHeaders()
UsageDirectiveHeader
.UsageDirectiveHeader
public ProviderHeader getProviderHeader()
ProviderHeader
.ProviderHeader
public ProcessingContextHeader getProcessingContextHeader()
ProcessingContextHeader
.ProcessingContextHeader
public ServiceInstanceUpdateHeader getServiceInstanceUpdateHeader()
ServiceInstanceUpdateHeader
.ServiceInstanceUpdateHeader
public java.util.List getOtherSOAPHeaders()
CorrelationHeader
,
ConsentHeader
, UsageDirectiveHeader
and
'Security' header.
Each entry will be a org.w3c.dom.Element
.public SOAPFault getSOAPFault()
SOAPFault
SOAPFault
public java.util.List getBodies()
org.w3c.dom.Element
.public java.util.List getBodies(java.lang.String namespaceURI, java.lang.String localName)
org.w3c.dom.Element
with specified
namespace URI and local name.namespaceURI
- namspace URIlocalName
- local namepublic java.util.List getOtherSecurityHeaders()
org.w3c.dom.Element
.public SecurityAssertion getAssertion()
public BinarySecurityToken getBinarySecurityToken()
public java.security.cert.X509Certificate getPeerCertificate()
public java.security.cert.X509Certificate getMessageCertificate()
public java.lang.Object getToken()
public java.lang.String getIPAddress()
public java.util.List getSigningIds()
public void setCorrelationHeader(CorrelationHeader correlationHeader)
CorrelationHeader
.correlationHeader
- CorrelationHeader
public void setConsentHeader(ConsentHeader consentHeader)
ConsentHeader
.consentHeader
- ConsentHeader
public void setUsageDirectiveHeaders(java.util.List usageDirectiveHeaders)
UsageDirectiveHeader
.usageDirectiveHeaders
- a list of UsageDirectiveHeader
public void setProviderHeader(ProviderHeader providerHeader)
ProviderHeader
if it is not null.providerHeader
- ProviderHeader
public void setProcessingContextHeader(ProcessingContextHeader processingContextHeader)
ProcessingContextHeader
.processingContextHeader
- ProcessingContextHeader
public void setServiceInstanceUpdateHeader(ServiceInstanceUpdateHeader serviceInstanceUpdateHeader)
ServiceInstanceUpdateHeader
.serviceInstanceUpdateHeader
- ServiceInstanceUpdateHeader
public void setOtherSOAPHeaders(java.util.List headers, java.util.List signingIds)
CorrelationHeader
,
ConsentHeader
, UsageDirectiveHeader
and
'Security' header.
Each entry will be a org.w3c.dom.Element
.headers
- a list of SOAP headers.signingIds
- a list of values of 'id' attribute for signingpublic void setOtherSOAPHeader(org.w3c.dom.Element header, java.lang.String signingId)
CorrelationHeader
,
ConsentHeader
and UsageDirectiveHeader
.header
- a org.w3c.dom.Element
signingId
- the value of 'id' attribute for signing. a null means
no signingpublic void setOtherSecurityHeaders(java.util.List headers)
org.w3c.dom.Element
.headers
- a list of security headers.public void setOtherSecurityHeader(org.w3c.dom.Element header)
header
- a security headerpublic void setSOAPFault(SOAPFault soapFault)
SOAPFault
.soapFault
- SOAPFault
public void setSOAPBodies(java.util.List bodies)
org.w3c.dom.Element
. To send a SOAP Fault, please use
method setSOAPFault
.bodies
- a list of SOAP bodies.public void setSOAPBody(org.w3c.dom.Element body)
setSOAPFault
.body
- a org.w3c.dom.Element
public void setClientAuthentication(boolean clientAuthentication)
clientAuthentication
- a boolean flagpublic java.lang.String toString()
toString
in class java.lang.Object
public org.w3c.dom.Document toDocument() throws SOAPBindingException
org.w3c.dom.Document
formatorg.w3c.dom.Document
formatSOAPBindingException
- if an error occurs while constructing
a documentpublic org.w3c.dom.Document toDocument(boolean refresh) throws SOAPBindingException
org.w3c.dom.Document
formatrefresh
- true to reconstruct a document, false to reuse a
previous document. If previous document doesn't exist,
it will construct a new documentorg.w3c.dom.Document
formatSOAPBindingException
- if an error occurs while constructing
the org.w3c.dom.Document
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |