|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.identity.liberty.ws.soapbinding.Message
public class 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 String |
CLIENT_TLS_BEARER
Authentication mechanism "urn:liberty:security:2004-04:ClientTLS:Bearer" |
static String |
CLIENT_TLS_BEARER_WSF11
Authentication mechanism "urn:liberty:security:2005-02:ClientTLS:Bearer" |
static String |
CLIENT_TLS_NULL
Authentication mechanism "urn:liberty:security:2003-08:ClientTLS:null" |
static String |
CLIENT_TLS_SAML
Authentication mechanism "urn:liberty:security:2003-08:ClientTLS:SAML" |
static String |
CLIENT_TLS_SAML_WSF11
Authentication mechanism "urn:liberty:security:2005-02:ClientTLS:SAML" |
static String |
CLIENT_TLS_X509
Authentication mechanism "urn:liberty:security:2003-08:ClientTLS:X509" |
static String |
CLIENT_TLS_X509_WSF11
Authentication mechanism "urn:liberty:security:2005-02:ClientTLS:X509" |
static String |
NULL_BEARER
Authentication mechanism "urn:liberty:security:2004-04:null:Bearer" |
static String |
NULL_BEARER_WSF11
Authentication mechanism "urn:liberty:security:2005-02:null:Bearer" |
static String |
NULL_NULL
Authentication mechanism "urn:liberty:security:2003-08:null:null" |
static String |
NULL_SAML
Authentication mechanism "urn:liberty:security:2003-08:null:SAML" |
static String |
NULL_SAML_WSF11
Authentication mechanism "urn:liberty:security:2005-02:null:SAML" |
static String |
NULL_X509
Authentication mechanism "urn:liberty:security:2003-08:null:X509" |
static String |
NULL_X509_WSF11
Authentication mechanism "urn:liberty:security:2005-02:null:X509" |
static int |
SAML_TOKEN
SAML Token profile is specified. |
static String |
TLS_BEARER
Authentication mechanism "urn:liberty:security:2004-04:TLS:Bearer" |
static String |
TLS_BEARER_WSF11
Authentication mechanism "urn:liberty:security:2005-02:TLS:Bearer" |
static String |
TLS_NULL
Authentication mechanism "urn:liberty:security:2003-08:TLS:null" |
static String |
TLS_SAML
Authentication mechanism "urn:liberty:security:2003-08:TLS:SAML" |
static String |
TLS_SAML_WSF11
Authentication mechanism "urn:liberty:security:2005-02:TLS:SAML" |
static String |
TLS_X509
Authentication mechanism "urn:liberty:security:2003-08:TLS:X509" |
static String |
TLS_X509_WSF11
Authentication mechanism "urn:liberty:security:2005-02:TLS:X509" |
static int |
X509_TOKEN
X509 Token profile is specified. |
Constructor Summary | |
---|---|
Message()
Default Constructor. |
|
Message(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. |
|
Message(javax.xml.soap.SOAPMessage soapMessage)
This constructor takes a SOAP message which is received from a SOAP connection. |
Method Summary | |
---|---|
SecurityAssertion |
getAssertion()
Returns the SAML assertion used for signing. |
String |
getAuthenticationMechanism()
Gets authentication mechanism. |
BinarySecurityToken |
getBinarySecurityToken()
Returns a binary security token used for signing. |
List |
getBodies()
Returns a list of SOAP bodies. |
List |
getBodies(String namespaceURI,
String localName)
Returns a list of SOAP bodies. |
ConsentHeader |
getConsentHeader()
Returns the ConsentHeader . |
CorrelationHeader |
getCorrelationHeader()
Returns the CorrelationHeader . |
String |
getIPAddress()
Returns the IP address of remote site of the SOAP connection. |
X509Certificate |
getMessageCertificate()
Returns the X509 certificate used in message level authentication. |
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. |
List |
getOtherSOAPHeaders()
Returns a list of SOAP headers except CorrelationHeader ,
ConsentHeader , UsageDirectiveHeader and
Security header. |
X509Certificate |
getPeerCertificate()
Returns the X509 certificate used in client authentication. |
ProcessingContextHeader |
getProcessingContextHeader()
Returns the ProcessingContextHeader . |
ProviderHeader |
getProviderHeader()
Returns the ProviderHeader . |
int |
getSecurityProfileType()
Gets security profile type. |
ServiceInstanceUpdateHeader |
getServiceInstanceUpdateHeader()
Returns the ServiceInstanceUpdateHeader . |
List |
getSigningIds()
Returns a list of id's for signing. |
SOAPFault |
getSOAPFault()
Returns the SOAPFault . |
Object |
getToken()
Returns a token for the sender of this Message. |
List |
getUsageDirectiveHeaders()
Returns a list of UsageDirectiveHeader . |
String |
getWSFVersion()
Returns the web services version of the message. |
boolean |
isClientAuthentication()
Returns a boolean flag to determine if this Message will be sent to a server that requires client authentication. |
void |
setBinarySecurityToken(BinarySecurityToken binaryToken)
Sets a binary security token for this message. |
void |
setClientAuthentication(boolean clientAuthentication)
Sets a boolean flag. |
void |
setConsentHeader(ConsentHeader consentHeader)
Sets ConsentHeader . |
void |
setCorrelationHeader(CorrelationHeader correlationHeader)
Sets the CorrelationHeader . |
void |
setOtherSecurityHeader(Element header)
Sets a security header. |
void |
setOtherSecurityHeaders(List headers)
Sets a list of security headers. |
void |
setOtherSOAPHeader(Element header,
String signingId)
Sets a SOAP header except CorrelationHeader ,
ConsentHeader and UsageDirectiveHeader . |
void |
setOtherSOAPHeaders(List headers,
List signingIds)
Sets a list of SOAP headers except CorrelationHeader ,
ConsentHeader , UsageDirectiveHeader and
'Security' header. |
void |
setProcessingContextHeader(ProcessingContextHeader processingContextHeader)
Sets the ProcessingContextHeader . |
void |
setProviderHeader(ProviderHeader providerHeader)
Sets ProviderHeader if it is not null. |
void |
setSecurityProfileType(int profileType)
Sets security profile type. |
void |
setServiceInstanceUpdateHeader(ServiceInstanceUpdateHeader serviceInstanceUpdateHeader)
Sets the ServiceInstanceUpdateHeader . |
void |
setSOAPBodies(List bodies)
Sets a list of SOAP bodies. |
void |
setSOAPBody(Element body)
Sets a SOAP body. |
void |
setSOAPFault(SOAPFault soapFault)
Sets the SOAPFault . |
void |
setUsageDirectiveHeaders(List usageDirectiveHeaders)
Sets a list of UsageDirectiveHeader . |
void |
setWSFVersion(String version)
Sets the web services version to the message. |
Document |
toDocument()
Returns the SOAP message in org.w3c.dom.Document format. |
Document |
toDocument(boolean refresh)
Returns the SOAP message in org.w3c.dom.Document format. |
String |
toString()
Returns the SOAP message in String format. |
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 String NULL_NULL
public static final String NULL_X509
public static final String NULL_SAML
public static final String NULL_BEARER
public static final String TLS_NULL
public static final String TLS_X509
public static final String TLS_SAML
public static final String TLS_BEARER
public static final String CLIENT_TLS_NULL
public static final String CLIENT_TLS_X509
public static final String CLIENT_TLS_SAML
public static final String CLIENT_TLS_BEARER
public static final String NULL_X509_WSF11
public static final String TLS_X509_WSF11
public static final String CLIENT_TLS_X509_WSF11
public static final String NULL_SAML_WSF11
public static final String TLS_SAML_WSF11
public static final String CLIENT_TLS_SAML_WSF11
public static final String NULL_BEARER_WSF11
public static final String TLS_BEARER_WSF11
public static final String CLIENT_TLS_BEARER_WSF11
Constructor Detail |
---|
public Message()
public Message(ProviderHeader providerHeader) throws SOAPBindingException
providerHeader
- ProviderHeader
.
SOAPBindingException
- if provider header is null.public Message(ProviderHeader providerHeader, SecurityAssertion assertion) throws SOAPBindingException
providerHeader
- ProviderHeader
assertion
- a SAML assertion
SOAPBindingException
- 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 token
SOAPBindingException
- if an error occurs while processing
the token or the provider header is nullpublic Message(SOAPFault soapFault)
soapFault
- SOAPFault
public Message(InputStream inputStream) throws SOAPBindingException
inputStream
- an InputStream
SOAPBindingException
- if an error occurs while parsing the input.public Message(javax.xml.soap.SOAPMessage soapMessage) throws SOAPBindingException, SOAPFaultException
soapMessage
- a SOAP message
SOAPBindingException
- if an error occurs while parsing the
SOAP message
SOAPFaultException
Method Detail |
---|
public int getSecurityProfileType()
public void setSecurityProfileType(int profileType)
profileType
- Profile Type. Possible values are ANONYMOUS,
X509_TOKEN , SAML_TOKEN and BEARER_TOKENpublic void setBinarySecurityToken(BinarySecurityToken binaryToken)
binaryToken
- a binary security tokenpublic String getAuthenticationMechanism()
public boolean isClientAuthentication()
public CorrelationHeader getCorrelationHeader()
CorrelationHeader
.
CorrelationHeader
.public ConsentHeader getConsentHeader()
ConsentHeader
.
ConsentHeader
.public List getUsageDirectiveHeaders()
UsageDirectiveHeader
.
UsageDirectiveHeader
.public ProviderHeader getProviderHeader()
ProviderHeader
.
ProviderHeader
.public ProcessingContextHeader getProcessingContextHeader()
ProcessingContextHeader
.
ProcessingContextHeader
.public ServiceInstanceUpdateHeader getServiceInstanceUpdateHeader()
ServiceInstanceUpdateHeader
.
ServiceInstanceUpdateHeader
.public List getOtherSOAPHeaders()
CorrelationHeader
,
ConsentHeader
, UsageDirectiveHeader
and
Security
header. Each entry will be a
org.w3c.dom.Element
.
public SOAPFault getSOAPFault()
SOAPFault
.
SOAPFault
.public List getBodies()
org.w3c.dom.Element
.
public List getBodies(String namespaceURI, String localName)
org.w3c.dom.Element
with specified
namespace URI and local name.
namespaceURI
- namspace URIlocalName
- local name
public List getOtherSecurityHeaders()
org.w3c.dom.Element
.
public SecurityAssertion getAssertion()
public BinarySecurityToken getBinarySecurityToken()
public X509Certificate getPeerCertificate()
public X509Certificate getMessageCertificate()
public Object getToken()
public String getIPAddress()
public List getSigningIds()
public void setCorrelationHeader(CorrelationHeader correlationHeader)
CorrelationHeader
.
correlationHeader
- CorrelationHeader
public void setConsentHeader(ConsentHeader consentHeader)
ConsentHeader
.
consentHeader
- the ConsentHeader
.public void setUsageDirectiveHeaders(List usageDirectiveHeaders)
UsageDirectiveHeader
.
usageDirectiveHeaders
- a list of UsageDirectiveHeader
.public void setProviderHeader(ProviderHeader providerHeader)
ProviderHeader
if it is not null.
providerHeader
- the ProviderHeader
.public void setProcessingContextHeader(ProcessingContextHeader processingContextHeader)
ProcessingContextHeader
.
processingContextHeader
- ProcessingContextHeader
public void setServiceInstanceUpdateHeader(ServiceInstanceUpdateHeader serviceInstanceUpdateHeader)
ServiceInstanceUpdateHeader
.
serviceInstanceUpdateHeader
- the ServiceInstanceUpdateHeader
public void setOtherSOAPHeaders(List headers, 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(Element header, String signingId)
CorrelationHeader
,
ConsentHeader
and UsageDirectiveHeader
.
header
- a org.w3c.dom.Element
signingId
- the value of id
attribute for signing.
A value null value for this attribute is assumed as no signing.public void setOtherSecurityHeaders(List headers)
org.w3c.dom.Element
.
headers
- a list of security headers.public void setOtherSecurityHeader(Element header)
header
- the security header element.public void setSOAPFault(SOAPFault soapFault)
SOAPFault
.
soapFault
- the SOAPFault
.public void setSOAPBodies(List bodies)
org.w3c.dom.Element
. To send a SOAP Fault, please use
method setSOAPFault
.
bodies
- a list of SOAP bodies.public void setSOAPBody(Element body)
setSOAPFault
.
body
- a org.w3c.dom.Element
public void setClientAuthentication(boolean clientAuthentication)
clientAuthentication
- a boolean flagpublic String toString()
toString
in class Object
public Document toDocument() throws SOAPBindingException
org.w3c.dom.Document
format.
org.w3c.dom.Document
format.
SOAPBindingException
- if an error occurs while constructing
a document.public Document toDocument(boolean refresh) throws SOAPBindingException
org.w3c.dom.Document
format.
refresh
- true to reconstruct a document, false to reuse a
previous document. If previous document doesn't exist,
it will construct a new document.
org.w3c.dom.Document
format.
SOAPBindingException
- if an error occurs while constructing
the org.w3c.dom.Document
.public String getWSFVersion()
public void setWSFVersion(String version)
version
- the web services framework version.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |