com.sun.identity.liberty.ws.soapbinding
クラス Message

java.lang.Object
  上位を拡張 com.sun.identity.liberty.ws.soapbinding.Message

public class Message
extends Object

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.


フィールドの概要
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.
 
コンストラクタの概要
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.
 
メソッドの概要
 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.
 

フィールドの詳細

ANONYMOUS

public static final int ANONYMOUS
anonymous profile is specified.

関連項目:
定数フィールド値

X509_TOKEN

public static final int X509_TOKEN
X509 Token profile is specified.

関連項目:
定数フィールド値

SAML_TOKEN

public static final int SAML_TOKEN
SAML Token profile is specified.

関連項目:
定数フィールド値

BEARER_TOKEN

public static final int BEARER_TOKEN
Bearer Token profile is specified.

関連項目:
定数フィールド値

NULL_NULL

public static final String NULL_NULL
Authentication mechanism "urn:liberty:security:2003-08:null:null"

関連項目:
定数フィールド値

NULL_X509

public static final String NULL_X509
Authentication mechanism "urn:liberty:security:2003-08:null:X509"

関連項目:
定数フィールド値

NULL_SAML

public static final String NULL_SAML
Authentication mechanism "urn:liberty:security:2003-08:null:SAML"

関連項目:
定数フィールド値

NULL_BEARER

public static final String NULL_BEARER
Authentication mechanism "urn:liberty:security:2004-04:null:Bearer"

関連項目:
定数フィールド値

TLS_NULL

public static final String TLS_NULL
Authentication mechanism "urn:liberty:security:2003-08:TLS:null"

関連項目:
定数フィールド値

TLS_X509

public static final String TLS_X509
Authentication mechanism "urn:liberty:security:2003-08:TLS:X509"

関連項目:
定数フィールド値

TLS_SAML

public static final String TLS_SAML
Authentication mechanism "urn:liberty:security:2003-08:TLS:SAML"

関連項目:
定数フィールド値

TLS_BEARER

public static final String TLS_BEARER
Authentication mechanism "urn:liberty:security:2004-04:TLS:Bearer"

関連項目:
定数フィールド値

CLIENT_TLS_NULL

public static final String CLIENT_TLS_NULL
Authentication mechanism "urn:liberty:security:2003-08:ClientTLS:null"

関連項目:
定数フィールド値

CLIENT_TLS_X509

public static final String CLIENT_TLS_X509
Authentication mechanism "urn:liberty:security:2003-08:ClientTLS:X509"

関連項目:
定数フィールド値

CLIENT_TLS_SAML

public static final String CLIENT_TLS_SAML
Authentication mechanism "urn:liberty:security:2003-08:ClientTLS:SAML"

関連項目:
定数フィールド値

CLIENT_TLS_BEARER

public static final String CLIENT_TLS_BEARER
Authentication mechanism "urn:liberty:security:2004-04:ClientTLS:Bearer"

関連項目:
定数フィールド値

NULL_X509_WSF11

public static final String NULL_X509_WSF11
Authentication mechanism "urn:liberty:security:2005-02:null:X509"

関連項目:
定数フィールド値

TLS_X509_WSF11

public static final String TLS_X509_WSF11
Authentication mechanism "urn:liberty:security:2005-02:TLS:X509"

関連項目:
定数フィールド値

CLIENT_TLS_X509_WSF11

public static final String CLIENT_TLS_X509_WSF11
Authentication mechanism "urn:liberty:security:2005-02:ClientTLS:X509"

関連項目:
定数フィールド値

NULL_SAML_WSF11

public static final String NULL_SAML_WSF11
Authentication mechanism "urn:liberty:security:2005-02:null:SAML"

関連項目:
定数フィールド値

TLS_SAML_WSF11

public static final String TLS_SAML_WSF11
Authentication mechanism "urn:liberty:security:2005-02:TLS:SAML"

関連項目:
定数フィールド値

CLIENT_TLS_SAML_WSF11

public static final String CLIENT_TLS_SAML_WSF11
Authentication mechanism "urn:liberty:security:2005-02:ClientTLS:SAML"

関連項目:
定数フィールド値

NULL_BEARER_WSF11

public static final String NULL_BEARER_WSF11
Authentication mechanism "urn:liberty:security:2005-02:null:Bearer"

関連項目:
定数フィールド値

TLS_BEARER_WSF11

public static final String TLS_BEARER_WSF11
Authentication mechanism "urn:liberty:security:2005-02:TLS:Bearer"

関連項目:
定数フィールド値

CLIENT_TLS_BEARER_WSF11

public static final String CLIENT_TLS_BEARER_WSF11
Authentication mechanism "urn:liberty:security:2005-02:ClientTLS:Bearer"

関連項目:
定数フィールド値
コンストラクタの詳細

Message

public Message()
Default Constructor.


Message

public Message(ProviderHeader providerHeader)
        throws SOAPBindingException
The default constructor uses default cert alias defined in AMConfig for signing.

パラメータ:
providerHeader - ProviderHeader.
例外:
SOAPBindingException - if provider header is null.

Message

public Message(ProviderHeader providerHeader,
               SecurityAssertion assertion)
        throws SOAPBindingException
This constructor takes a SAML assertion for signing.

パラメータ:
providerHeader - ProviderHeader
assertion - a SAML assertion
例外:
SOAPBindingException - if an error occurs while processing the SAML assertion or the provider header is null

Message

public Message(ProviderHeader providerHeader,
               BinarySecurityToken token)
        throws SOAPBindingException
This constructor takes a binary security token for signing.

パラメータ:
providerHeader - ProviderHeader
token - a binary security token
例外:
SOAPBindingException - if an error occurs while processing the token or the provider header is null

Message

public Message(SOAPFault soapFault)
This constructor is to create a SOAP fault message.

パラメータ:
soapFault - SOAPFault

Message

public Message(InputStream inputStream)
        throws SOAPBindingException
This constructor takes an InputStream.

パラメータ:
inputStream - an InputStream
例外:
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.

パラメータ:
soapMessage - a SOAP message
例外:
SOAPBindingException - if an error occurs while parsing the SOAP message
SOAPFaultException
メソッドの詳細

getSecurityProfileType

public int getSecurityProfileType()
Gets security profile type. Possible values are ANONYMOUS, X509_TOKEN and SAML_TOKEN.

戻り値:
the Security Profile type

setSecurityProfileType

public void setSecurityProfileType(int profileType)
Sets security profile type.

パラメータ:
profileType - Profile Type. Possible values are ANONYMOUS, X509_TOKEN , SAML_TOKEN and BEARER_TOKEN

setBinarySecurityToken

public void setBinarySecurityToken(BinarySecurityToken binaryToken)
Sets a binary security token for this message.

パラメータ:
binaryToken - a binary security token

getAuthenticationMechanism

public String getAuthenticationMechanism()
Gets authentication mechanism. Possible values are NULL_NULL,NULL_X509, NULL_SAML, TLS_NULL, TLS_X509, TLS_SAML, CLIENT_TLS_NULL,CLIENT_TLS_X509, CLIENT_TLS_SAML, NULL_BEAER, TLS_BEARER, and CLIENT_TLS_BEARER.

戻り値:
an authentication mechanism

isClientAuthentication

public boolean isClientAuthentication()
Returns a boolean flag to determine if this Message will be sent to a server that requires client authentication.

戻り値:
true if this Message will be sent to a server that requires client authentication

getCorrelationHeader

public CorrelationHeader getCorrelationHeader()
Returns the CorrelationHeader.

戻り値:
the CorrelationHeader.

getConsentHeader

public ConsentHeader getConsentHeader()
Returns the ConsentHeader.

戻り値:
the ConsentHeader.

getUsageDirectiveHeaders

public List getUsageDirectiveHeaders()
Returns a list of UsageDirectiveHeader.

戻り値:
a list of UsageDirectiveHeader.

getProviderHeader

public ProviderHeader getProviderHeader()
Returns the ProviderHeader.

戻り値:
the ProviderHeader.

getProcessingContextHeader

public ProcessingContextHeader getProcessingContextHeader()
Returns the ProcessingContextHeader.

戻り値:
the ProcessingContextHeader.

getServiceInstanceUpdateHeader

public ServiceInstanceUpdateHeader getServiceInstanceUpdateHeader()
Returns the ServiceInstanceUpdateHeader.

戻り値:
the ServiceInstanceUpdateHeader.

getOtherSOAPHeaders

public List getOtherSOAPHeaders()
Returns a list of SOAP headers except CorrelationHeader, ConsentHeader, UsageDirectiveHeader and Security header. Each entry will be a org.w3c.dom.Element.

戻り値:
a list of SOAP headers

getSOAPFault

public SOAPFault getSOAPFault()
Returns the SOAPFault.

戻り値:
the SOAPFault.

getBodies

public List getBodies()
Returns a list of SOAP bodies. Each entry will be a org.w3c.dom.Element.

戻り値:
a list of SOAP bodies

getBodies

public List getBodies(String namespaceURI,
                      String localName)
Returns a list of SOAP bodies. Each entry will be a org.w3c.dom.Element with specified namespace URI and local name.

パラメータ:
namespaceURI - namspace URI
localName - local name
戻り値:
a list of SOAP bodies

getOtherSecurityHeaders

public 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. Each entry will be a org.w3c.dom.Element.

戻り値:
a list of security headers

getAssertion

public SecurityAssertion getAssertion()
Returns the SAML assertion used for signing.

戻り値:
the SAML assertion.

getBinarySecurityToken

public BinarySecurityToken getBinarySecurityToken()
Returns a binary security token used for signing.

戻り値:
a binary security token.

getPeerCertificate

public X509Certificate getPeerCertificate()
Returns the X509 certificate used in client authentication.

戻り値:
a X509 certificate

getMessageCertificate

public X509Certificate getMessageCertificate()
Returns the X509 certificate used in message level authentication.

戻り値:
a X509 certificate.

getToken

public Object getToken()
Returns a token for the sender of this Message.

戻り値:
a token Object.

getIPAddress

public String getIPAddress()
Returns the IP address of remote site of the SOAP connection.

戻り値:
a IP address

getSigningIds

public List getSigningIds()
Returns a list of id's for signing.

戻り値:
a list of id's for signing.

setCorrelationHeader

public void setCorrelationHeader(CorrelationHeader correlationHeader)
Sets the CorrelationHeader.

パラメータ:
correlationHeader - CorrelationHeader

setConsentHeader

public void setConsentHeader(ConsentHeader consentHeader)
Sets ConsentHeader.

パラメータ:
consentHeader - the ConsentHeader.

setUsageDirectiveHeaders

public void setUsageDirectiveHeaders(List usageDirectiveHeaders)
Sets a list of UsageDirectiveHeader.

パラメータ:
usageDirectiveHeaders - a list of UsageDirectiveHeader.

setProviderHeader

public void setProviderHeader(ProviderHeader providerHeader)
Sets ProviderHeader if it is not null.

パラメータ:
providerHeader - the ProviderHeader.

setProcessingContextHeader

public void setProcessingContextHeader(ProcessingContextHeader processingContextHeader)
Sets the ProcessingContextHeader.

パラメータ:
processingContextHeader - ProcessingContextHeader

setServiceInstanceUpdateHeader

public void setServiceInstanceUpdateHeader(ServiceInstanceUpdateHeader serviceInstanceUpdateHeader)
Sets the ServiceInstanceUpdateHeader.

パラメータ:
serviceInstanceUpdateHeader - the ServiceInstanceUpdateHeader

setOtherSOAPHeaders

public void setOtherSOAPHeaders(List headers,
                                List signingIds)
Sets a list of SOAP headers except 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 signing

setOtherSOAPHeader

public void setOtherSOAPHeader(Element header,
                               String signingId)
Sets a SOAP header except 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.

setOtherSecurityHeaders

public void setOtherSecurityHeaders(List headers)
Sets a list of security headers. Each entry will be a org.w3c.dom.Element.

パラメータ:
headers - a list of security headers.

setOtherSecurityHeader

public void setOtherSecurityHeader(Element header)
Sets a security header.

パラメータ:
header - the security header element.

setSOAPFault

public void setSOAPFault(SOAPFault soapFault)
Sets the SOAPFault.

パラメータ:
soapFault - the SOAPFault.

setSOAPBodies

public void setSOAPBodies(List bodies)
Sets a list of SOAP bodies. Each entry will be a org.w3c.dom.Element. To send a SOAP Fault, please use method setSOAPFault.

パラメータ:
bodies - a list of SOAP bodies.

setSOAPBody

public void setSOAPBody(Element body)
Sets a SOAP body. To send a SOAP Fault, please use method setSOAPFault.

パラメータ:
body - a org.w3c.dom.Element

setClientAuthentication

public void setClientAuthentication(boolean clientAuthentication)
Sets a boolean flag. If the flag is true, this Message will be sent to a server that requires client authentication.

パラメータ:
clientAuthentication - a boolean flag

toString

public String toString()
Returns the SOAP message in String format.

オーバーライド:
クラス Object 内の toString
戻り値:
the SOAP message in String format.

toDocument

public Document toDocument()
                    throws SOAPBindingException
Returns the SOAP message in org.w3c.dom.Document format.

戻り値:
the SOAP message in org.w3c.dom.Document format.
例外:
SOAPBindingException - if an error occurs while constructing a document.

toDocument

public Document toDocument(boolean refresh)
                    throws SOAPBindingException
Returns the SOAP message in 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.
戻り値:
the SOAP message in org.w3c.dom.Document format.
例外:
SOAPBindingException - if an error occurs while constructing the org.w3c.dom.Document.

getWSFVersion

public String getWSFVersion()
Returns the web services version of the message.

戻り値:
the web services version.

setWSFVersion

public void setWSFVersion(String version)
Sets the web services version to the message.

パラメータ:
version - the web services framework version.