![]() ![]() ![]() ![]() ![]() ![]() |
AquaLogic Enterprise Security supports the ability of Axis-based Web Services clients to fail over to another Web Services SSM when the client encounters a connection problem. The following sections describe this failover functionality:
Note: | The Web Services client failover feature is supported for clients developed with Axis 1.2 or later. For more information, see the Apache Axis site: http://ws.apache.org/axis/ . |
To configure a Web Services client for failover:
/webservice-ssm/lib/ssmwsClientFailover.jar
and Log4j.jar
.-Daxis.ClientConfigFile=<SSMWS_INSTANCE_HOME>/config/failover-client-config.wsdd
// Populate the SSMInstanceList with the list of WS SSM instances. For example:
ArrayList SSMInstanceList = new ArrayList();
SSMInstanceList.add("http://12.10.1.4:9090");
SSMInstanceList.add("http://12.10.1.2:9090");
// Set the Http Connection Time Out and number of retry attempts
// that will be made on the SSM instance
int noOfRetry = 3;
int httpConTimeOut = 60000; // The time is in milliseconds.
FailOverManager.getInstance(SSMInstanceList, noOfRetry,httpConTimeOut);
// <<<<<<< Original Client Code >>>>>>
ServiceRegistryBindingStub serviceRegistry =
new ServiceRegistryBindingStub(new java.net.URL(serviceRegistryURL),null);
SsmIdType ssmIdType =
new SsmIdType(ServiceTypeEnum.ALES_AUTHENTICATION, ssmId);
ComplexAnyURI authURL;
authURL = serviceRegistry.locateService(ssmIdType);
System.out.println("Authentication URL: " + authURL.getLocateServiceResponse().toString());
/**
* Authentication Code
*/
// get the URL for the Authentication Service should be
// http://<hostname>:<webservice-ssm-port>/Authentication
authenticationService = new AuthenticationBindingStub(
new java.net.URL(authURL.getLocateServiceResponse().toString()),null);
Listing 4-2 gives an example of the failover-client-config.wsdd file.
<?xml version="1.0" encoding="UTF-8"?>
<deployment name="defaultClientConfig"
xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<globalConfiguration>
<parameter name="disablePrettyXML" value="true"/>
<parameter name="enableNamespacePrefixOptimization" value="false"/>
</globalConfiguration>
<transport name="http" pivot="java:com.bea.security.ssmws.client.failover.FailOverHTTPSender"/>
<transport name="local" pivot="java:org.apache.axis.transport.local.LocalSender"/>
<transport name="java" pivot="java:org.apache.axis.transport.java.JavaSender"/>
</deployment>
The FailOverManager
class stores and manages the failover endpoints for Web Services clients. This class is a singleton; it stores a list of endpoints and the values for the number of retries on connection failure and HTTP connection timeout. It includes the following public methods:
Returns an instance of the FailOverManager
. This method makes sure that there is only one instance of this class in the JVM. This method is invoked to get an instance of the FailOverManager
configured with its default properties. The FailOverManager
has the following configuration properties:
BindingStub
. Default is empty.
If you need to change any of these values, then use the getInstance(ArrayList failOverEndPoints,int noOfRetries, int httpConTimeOut)
method, which takes these as arguments.
Returns an instance of the FailOverManager
. You can supply values for the failover endpoint list, number of retries, and HTTP connection timeout as arguments.
Replaces the existing list of failover endpoints with the provided list of endpoints. The currentEndPoint
variable of the FailOverManager
points to the first endpoint in the list. On failover, the Web Services client attempts to connect to the listed endpoints in the order they are provided. Each endpoint is tried the number of times specified by the noOfRetries
property of the FailOverManager
before failing over to the next endpoint. If all the endpoints fail, AXIS will throw the regular connection exception to the client.
This method is thread-safe; you can call this method during runtime to refresh the list of endpoints.
Returns the list of end points.
![]() ![]() ![]() |