org.apache.axis2.security.util
Class Axis2Util

java.lang.Object
  extended byorg.apache.axis2.security.util.Axis2Util

public class Axis2Util
extends java.lang.Object

Utility class for the Axis2-WSS4J Module


Constructor Summary
Axis2Util()
           
 
Method Summary
static org.w3c.dom.Document getDocumentFromSOAPEnvelope(SOAPEnvelope env)
          Create a DOM Document using the SOAP Envelope
static java.lang.String getKey(java.lang.String originalKey, boolean inHandler, int repetition)
          This is used to provide the appropriate key to pickup config params from the message context.
static SOAPEnvelope getSOAPEnvelopeFromDocument(org.w3c.dom.Document doc, org.apache.ws.security.SOAPConstants constants, SOAPEnvelope reqEnv)
          This is to be used only in the signature situation where the security header can be inserted into the original SOAPEnvelope rather than replacing the whole envelope
static SOAPEnvelope getSOAPEnvelopeFromDocument(org.w3c.dom.Document doc, java.lang.String envelopeNS)
          Covert a DOM Document containing a SOAP Envelope in to a org.apache.axis2.soap.SOAPEnvelope
static org.w3c.dom.Element toDOM(OMElement element)
          Convert a given OMElement to a DOM Element
static OMElement toOM(org.w3c.dom.Element element)
          Convert a given DOM Element to an OMElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Axis2Util

public Axis2Util()
Method Detail

getDocumentFromSOAPEnvelope

public static org.w3c.dom.Document getDocumentFromSOAPEnvelope(SOAPEnvelope env)
                                                        throws org.apache.ws.security.WSSecurityException
Create a DOM Document using the SOAP Envelope

Parameters:
env - An org.apache.axis2.soap.SOAPEnvelope instance
Returns:
the DOM Document of the given SOAP Envelope
Throws:
java.lang.Exception
org.apache.ws.security.WSSecurityException

getSOAPEnvelopeFromDocument

public static SOAPEnvelope getSOAPEnvelopeFromDocument(org.w3c.dom.Document doc,
                                                       java.lang.String envelopeNS)
                                                throws org.apache.ws.security.WSSecurityException
Covert a DOM Document containing a SOAP Envelope in to a org.apache.axis2.soap.SOAPEnvelope

Parameters:
doc - DOM Document
envelopeNS - SOAP Namespace of the the given Envelope
Returns:
Throws:
java.lang.Exception
org.apache.ws.security.WSSecurityException

getSOAPEnvelopeFromDocument

public static SOAPEnvelope getSOAPEnvelopeFromDocument(org.w3c.dom.Document doc,
                                                       org.apache.ws.security.SOAPConstants constants,
                                                       SOAPEnvelope reqEnv)
                                                throws org.apache.ws.security.WSSecurityException
This is to be used only in the signature situation where the security header can be inserted into the original SOAPEnvelope rather than replacing the whole envelope

Parameters:
doc -
reqEnv -
Returns:
Throws:
org.apache.ws.security.WSSecurityException

getKey

public static java.lang.String getKey(java.lang.String originalKey,
                                      boolean inHandler,
                                      int repetition)
This is used to provide the appropriate key to pickup config params from the message context. This is acutally used when the outflow handler (WSDoAllSender) is repeated n number of times

Parameters:
originalKey - The default key
inHandler - Whether the handler is the inflow handler or not
repetition - The current repetition number
Returns:
The key to be used internally in the security module to pick up the config params

toOM

public static OMElement toOM(org.w3c.dom.Element element)
                      throws TrustException
Convert a given DOM Element to an OMElement

Parameters:
element -
Returns:
Throws:
TrustException

toDOM

public static org.w3c.dom.Element toDOM(OMElement element)
                                 throws TrustException
Convert a given OMElement to a DOM Element

Parameters:
element -
Returns:
Throws:
TrustException