org.ogf.graap.wsag.client.wsrf.impl
Class Axis2SoapClient

java.lang.Object
  extended by org.apache.muse.ws.addressing.soap.SimpleSoapClient
      extended by org.ogf.graap.wsag.client.wsrf.impl.Axis2SoapClient
All Implemented Interfaces:
org.apache.muse.util.Traceable, org.apache.muse.ws.addressing.soap.SoapClient, org.apache.muse.ws.addressing.soap.SoapMonitor

public class Axis2SoapClient
extends org.apache.muse.ws.addressing.soap.SimpleSoapClient

Basic implementation of a SOAP client. The client implements the capabilities to send SOAP messages to a WSAG4J server and performs basic security processing operations. The client implementation is NOT thread-safe. Multi-threading applications must use multiple client objects in order to perform multiple operations in parallel.

Author:
Oliver Waeldrich

Field Summary
static int DEFAULT_TIME_OUT_IN_MILLI_SECONDS
          The SOAP client timeout in milliseconds.
static String WSAG4J_WSRF_CLIENT_CONFIG_FILE
          user provided WSAG4J WSRF client configuration file name, this will overwrite the default configuration
static String WSAG4J_WSRF_CLIENT_CONFIG_FILE_DEFAULT
          default WSAG4J WSRF client configuration file name
 
Constructor Summary
Axis2SoapClient(Properties properties, ISecurityProperties securityProperties)
          Creates a new SOAP client with the given security properties.
 
Method Summary
protected  Element createMessage(org.apache.muse.ws.addressing.EndpointReference source, org.apache.muse.ws.addressing.EndpointReference destination, String action, Element[] bodyElements, Element[] extraHeaders)
          
protected  Element doAxisCall(Element soapRequest, org.apache.muse.ws.addressing.EndpointReference dest, String wsaAction)
          Executes a SOAP call by using the Axis 2 SOAP engine.
static ConfigurationType findWSAG4JConfiguration(String fileName)
           
protected  Element[] generateExtraHeaders()
           
static org.apache.axis2.context.ConfigurationContext getConfigurationContext()
          Returns the current Axis2 configuration context used for the SOAP communication.
 org.apache.ws.security.components.crypto.Crypto getCrypto()
           
static String getDefaultAxis2ConfigurationPath()
          Returns the default location of the Axis2 configuration files.
 Properties getProperties()
           
protected  ClientSecurityHandler[] getSecurityHandler()
           
protected  void initialize()
          initializes this client instance
 Element[] send(org.apache.muse.ws.addressing.EndpointReference src, org.apache.muse.ws.addressing.EndpointReference dest, String wsaAction, Element[] body, Element[] extraHeaders)
          
static void setConfigurationContext(org.apache.axis2.context.ConfigurationContext configurationContext)
          Enables implementations to provide an alternative Axis2 configuration context that will be used for communicating with the WSAG4J server.
static void setDefaultAxis2ConfigurationPath(String defaultAxis2ConfigurationPath)
          Sets the default location of the Axis2 configuration files.
 void setProperties(Properties properties)
           
 
Methods inherited from class org.apache.muse.ws.addressing.soap.SimpleSoapClient
getConnectionHandler, getDestinationURL, getSoapMonitorPort, getTraceWriter, isUsingSoapMonitor, isUsingTrace, send, setConnectionHandler, setTrace, setTraceWriter, startSoapMonitor, stopSoapMonitor, trace, trace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WSAG4J_WSRF_CLIENT_CONFIG_FILE

public static final String WSAG4J_WSRF_CLIENT_CONFIG_FILE
user provided WSAG4J WSRF client configuration file name, this will overwrite the default configuration

See Also:
Constant Field Values

WSAG4J_WSRF_CLIENT_CONFIG_FILE_DEFAULT

public static final String WSAG4J_WSRF_CLIENT_CONFIG_FILE_DEFAULT
default WSAG4J WSRF client configuration file name

See Also:
Constant Field Values

DEFAULT_TIME_OUT_IN_MILLI_SECONDS

public static int DEFAULT_TIME_OUT_IN_MILLI_SECONDS
The SOAP client timeout in milliseconds.

Constructor Detail

Axis2SoapClient

public Axis2SoapClient(Properties properties,
                       ISecurityProperties securityProperties)
Creates a new SOAP client with the given security properties.

Parameters:
securityProperties - the security properties to use
Method Detail

getConfigurationContext

public static org.apache.axis2.context.ConfigurationContext getConfigurationContext()
Returns the current Axis2 configuration context used for the SOAP communication.

Returns:
the configurationContext

setConfigurationContext

public static void setConfigurationContext(org.apache.axis2.context.ConfigurationContext configurationContext)
Enables implementations to provide an alternative Axis2 configuration context that will be used for communicating with the WSAG4J server.

Parameters:
configurationContext - the configurationContext to set

initialize

protected void initialize()
initializes this client instance


createMessage

protected Element createMessage(org.apache.muse.ws.addressing.EndpointReference source,
                                org.apache.muse.ws.addressing.EndpointReference destination,
                                String action,
                                Element[] bodyElements,
                                Element[] extraHeaders)

Overrides:
createMessage in class org.apache.muse.ws.addressing.soap.SimpleSoapClient

send

public Element[] send(org.apache.muse.ws.addressing.EndpointReference src,
                      org.apache.muse.ws.addressing.EndpointReference dest,
                      String wsaAction,
                      Element[] body,
                      Element[] extraHeaders)

Specified by:
send in interface org.apache.muse.ws.addressing.soap.SoapClient
Overrides:
send in class org.apache.muse.ws.addressing.soap.SimpleSoapClient

doAxisCall

protected Element doAxisCall(Element soapRequest,
                             org.apache.muse.ws.addressing.EndpointReference dest,
                             String wsaAction)
                      throws org.apache.axis2.AxisFault
Executes a SOAP call by using the Axis 2 SOAP engine.

Parameters:
soapRequest - the SOAP request as a DOM element
dest - the destination EPR
wsaAction - the web service action
Returns:
the SOAP response as a DOM element
Throws:
org.apache.axis2.AxisFault - indicates a SOAP fault during the request

generateExtraHeaders

protected Element[] generateExtraHeaders()
Returns:
Returns a set of extra header elements that is included in the SOAP message.
Throws:
SecurityException

getSecurityHandler

protected ClientSecurityHandler[] getSecurityHandler()
Returns:
the security handler of this client instance

getProperties

public Properties getProperties()
Returns:
the properties

setProperties

public void setProperties(Properties properties)
Parameters:
properties - the properties to set

getCrypto

public org.apache.ws.security.components.crypto.Crypto getCrypto()
Returns:
the crypto

getDefaultAxis2ConfigurationPath

public static String getDefaultAxis2ConfigurationPath()
Returns the default location of the Axis2 configuration files. The path must be available in the classpath and must contain an Axis2 configuration file with the name client.axis2.xml and all required modules.

Returns:
the Axis2 configuration path

setDefaultAxis2ConfigurationPath

public static void setDefaultAxis2ConfigurationPath(String defaultAxis2ConfigurationPath)
                                             throws Exception
Sets the default location of the Axis2 configuration files. The path must be available in the classpath and must contain an Axis2 configuration file with the name client.axis2.xml and all required modules. Implementations may change the default path in order to provide an alternative configuration path and recreate the default Axis2 configuration context.

Parameters:
defaultAxis2ConfigurationPath - the Axis2 configuration path
Throws:
Exception - indicates that the creation of the new Axis2 configuration context failed

findWSAG4JConfiguration

public static ConfigurationType findWSAG4JConfiguration(String fileName)
                                                 throws IOException
Parameters:
fileName - The file name of the requested XML configuration file.
Returns:
The XML configuration file as an XmlObject.
Throws:
IOException - the configuration file could not be read or a related error occurred


Copyright © 2008-2012. All Rights Reserved.