[jboss-svn-commits] JBL Code SVN: r25117 - in labs/jbosstm/trunk/XTS: WS-C/dev/src11/com/arjuna/webservices11/wscoor/processors and 21 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Feb 5 08:34:56 EST 2009


Author: adinn
Date: 2009-02-05 08:34:55 -0500 (Thu, 05 Feb 2009)
New Revision: 25117

Modified:
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/ServiceRegistry.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/processors/ActivationCoordinatorProcessor.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/processors/RegistrationCoordinatorProcessor.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/sei/ActivationPortTypeImpl.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/sei/RegistrationPortTypeImpl.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/server/ActivationCoordinatorInitialisation.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/server/RegistrationCoordinatorInitialisation.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/ContextFactory.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/Registrar.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/messaging/ActivationCoordinatorProcessorImpl.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/messaging/RegistrationCoordinatorProcessorImpl.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/client/TerminationCoordinatorClient.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/client/TerminationParticipantClient.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/sei/TerminationCoordinatorPortTypeImpl.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/server/TerminationCoordinatorInitialisation.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/server/TerminationParticipantInitialisation.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/client/CompletionCoordinatorClient.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/client/CompletionInitiatorClient.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/client/CoordinatorClient.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/client/ParticipantClient.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/server/CompletionCoordinatorInitialisation.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/server/CompletionInitiatorInitialisation.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/server/CoordinatorInitialisation.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/server/ParticipantInitialisation.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/client/CoordinatorCompletionCoordinatorClient.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/client/CoordinatorCompletionParticipantClient.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/client/ParticipantCompletionCoordinatorClient.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/client/ParticipantCompletionParticipantClient.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/server/CoordinatorCompletionCoordinatorInitialisation.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/server/CoordinatorCompletionParticipantInitialisation.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/server/ParticipantCompletionCoordinatorInitialisation.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/server/ParticipantCompletionParticipantInitialisation.java
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/common/Environment.java
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/common/Environment.java
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/ContextFactoryImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/RegistrarImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/context/TxContextImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/remote/TransactionManagerImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/remote/UserTransactionImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/ContextFactoryImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/RegistrarImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/context/TxContextImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/remote/BusinessActivityManagerImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/remote/UserBusinessActivityImple.java
   labs/jbosstm/trunk/XTS/demo/src/com/jboss/jbosstm/xts/demo/client/BasicClient.java
   labs/jbosstm/trunk/XTS/sar/src/org/jboss/jbossts/XTSService.java
Log:
Enabled use of https for all XTS messages when using the WS-TX 1.1
protocols -- fixes JBTM-347.

This requires enabling of the secure HTTP port in any JBoss AS which
is running either an XTS client, an XST participannt (web service) or
the XTS coordinator. It also requires setting up a keystore and
truststore to allow secure communications using SSL.

Secure communication is switched on by specifying an XTS coordinator
URL with an https scheme. The usual XTS 1.1 coordinator endpoint
address is

  http://<bindhost>:8080/ws-c11/ActivationService

where <bindhost> is the bind address supplied as a parameter on the
JBoss AS run.sh/run.bat command line using the -b flag (<bindhost>
defaults to localhost if this parameter is not supplied).

If the client is run in an AS which specifies the coordinator URL as

  https://<bindhost>:8443/ws-c11/ActivationService

then the initial client<-->coordinator exchange at transaction begin
and all subsequent XTS message exchanges between client<-->coordinator
and participant (web service)<-->coordinator will employ https.

The coordinator URL can be reset in a variety of ways and this fix has
changed the behaviour slightly. One option is to set system
properties, either for the whole URL

  org.jboss.jbossts.xts11.coordinator.url

  if unset then the components properties are tested for and used to
  constrct a URL

or, in case that is unset, by specifying individual components of the
URL

  org.jboss.jbossts.xts11.coordinator.scheme

  value should be http/https and defaults to http


  org.jboss.jbossts.xts11.coordinator.host

  defaults to <bindhost>


  org.jboss.jbossts.xts11.coordinator.port

  defaults to jbossweb http port (normally 8080) if scheme is http and
  jbossweb secure http port (normally 8443) if scheme is https


  org.jboss.jbossts.xts11.coordinator.path

  defaults to ws-c11/ActivationService

If none of these system properties is set then the URL is obtained
from the value of property org.jboss.jbossts.xts11.coordinatorURL
which is specified in property file wstx11.xml which can be found in
config.jar in the deployed jbossxts.sar. Edits to this file take
effect the next time the XTS service is deployed.


Modified: labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/ServiceRegistry.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/ServiceRegistry.java	2009-02-05 08:06:04 UTC (rev 25116)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/ServiceRegistry.java	2009-02-05 13:34:55 UTC (rev 25117)
@@ -40,6 +40,11 @@
     private final Map<String, String> serviceProviderRegistry = new TreeMap<String, String>() ;
 
     /**
+     * The secure SOAP service provider registry.
+     */
+    private final Map<String, String> secureServiceProviderRegistry = new TreeMap<String, String>() ;
+
+    /**
      * Get the service registry.
      * @return The service registry.
      */
@@ -62,6 +67,19 @@
     }
 
     /**
+     * Register the specified secure service.
+     * @param serviceName The secure service name.
+     * @param url The service url.
+     */
+    public void registerSecureServiceProvider(final String serviceName, final String url)
+    {
+        synchronized(secureServiceProviderRegistry)
+        {
+            secureServiceProviderRegistry.put(serviceName, url) ;
+        }
+    }
+
+    /**
      * Remove the specified service.
      * @param serviceName The service name.
      */
@@ -74,6 +92,18 @@
     }
 
     /**
+     * Remove the specified secure service.
+     * @param serviceName The secure service name.
+     */
+    public void removeSecureServiceProvider(final String serviceName)
+    {
+        synchronized(secureServiceProviderRegistry)
+        {
+            secureServiceProviderRegistry.remove(serviceName) ;
+        }
+    }
+
+    /**
      * Get the service URI.
      * @param serviceName The service name.
      * @return The service URI or null if not registered.
@@ -89,4 +119,36 @@
 
         return uri;
     }
+
+    /**
+     * Get the secure service URI.
+     * @param serviceName The secure service name.
+     * @return The secure service URI or null if not registered.
+     */
+    public String getSecureServiceURI(final String serviceName)
+    {
+        String uri;
+
+        synchronized(secureServiceProviderRegistry)
+        {
+            uri = secureServiceProviderRegistry.get(serviceName) ;
+        }
+
+        return uri;
+    }
+
+    /**
+     * Get the service URI.
+     * @param serviceName The service name.
+     * @param isSecure true if the secure service URL is required false if the normal service URL is required
+     * @return The service URI or null if not registered.
+     */
+    public String getServiceURI(final String serviceName, boolean isSecure)
+    {
+        if (isSecure) {
+            return getSecureServiceURI(serviceName);
+        } else {
+            return getServiceURI(serviceName);
+        }
+    }
 }
\ No newline at end of file

Modified: labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/processors/ActivationCoordinatorProcessor.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/processors/ActivationCoordinatorProcessor.java	2009-02-05 08:06:04 UTC (rev 25116)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/processors/ActivationCoordinatorProcessor.java	2009-02-05 13:34:55 UTC (rev 25117)
@@ -65,5 +65,6 @@
      */
     public abstract CreateCoordinationContextResponseType
         createCoordinationContext(final CreateCoordinationContextType createCoordinationContext,
-                                  final AddressingProperties addressingProperties) ;
+                                  final AddressingProperties addressingProperties,
+                                  final boolean isSecure) ;
 }

Modified: labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/processors/RegistrationCoordinatorProcessor.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/processors/RegistrationCoordinatorProcessor.java	2009-02-05 08:06:04 UTC (rev 25116)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/processors/RegistrationCoordinatorProcessor.java	2009-02-05 13:34:55 UTC (rev 25117)
@@ -67,5 +67,5 @@
      * @param arjunaContext The arjuna context.
      */
     public abstract RegisterResponseType register(final RegisterType register, final AddressingProperties addressingContext,
-        final ArjunaContext arjunaContext) ;
+        final ArjunaContext arjunaContext, final boolean isSecure) ;
 }

Modified: labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/sei/ActivationPortTypeImpl.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/sei/ActivationPortTypeImpl.java	2009-02-05 08:06:04 UTC (rev 25116)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/sei/ActivationPortTypeImpl.java	2009-02-05 13:34:55 UTC (rev 25117)
@@ -14,6 +14,7 @@
 import javax.xml.ws.addressing.JAXWSAConstants;
 import javax.xml.ws.handler.MessageContext;
 import javax.xml.ws.soap.Addressing;
+import javax.servlet.http.HttpServletRequest;
 
 /**
  * Created by IntelliJ IDEA.
@@ -43,8 +44,10 @@
         CreateCoordinationContextType parameters)
     {
         MessageContext ctx = webServiceCtx.getMessageContext();
+        HttpServletRequest request = (HttpServletRequest)ctx.get(MessageContext.SERVLET_REQUEST);
+        boolean isSecure = request.getScheme().equals("https");
         AddressingProperties inboundAddressProperties
             = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
-        return ActivationCoordinatorProcessor.getCoordinator().createCoordinationContext(parameters, inboundAddressProperties);
+        return ActivationCoordinatorProcessor.getCoordinator().createCoordinationContext(parameters, inboundAddressProperties, isSecure);
    }
 }

Modified: labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/sei/RegistrationPortTypeImpl.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/sei/RegistrationPortTypeImpl.java	2009-02-05 08:06:04 UTC (rev 25116)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/sei/RegistrationPortTypeImpl.java	2009-02-05 13:34:55 UTC (rev 25117)
@@ -12,6 +12,7 @@
 import javax.xml.ws.WebServiceContext;
 import javax.xml.ws.soap.Addressing;
 import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
 
 import com.arjuna.webservices11.wscoor.processors.RegistrationCoordinatorProcessor;
 import com.arjuna.webservices11.wsarj.ArjunaContext;
@@ -46,11 +47,13 @@
     )
     {
         MessageContext ctx = webServiceCtx.getMessageContext();
+        HttpServletRequest request = (HttpServletRequest)ctx.get(MessageContext.SERVLET_REQUEST);
+        boolean isSecure = request.getScheme().equals("https");
         AddressingProperties inboundAddressProperties
             = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
         final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx) ;
 
-        return RegistrationCoordinatorProcessor.getCoordinator().register(parameters, inboundAddressProperties, arjunaContext);
+        return RegistrationCoordinatorProcessor.getCoordinator().register(parameters, inboundAddressProperties, arjunaContext, isSecure);
 
     }
 }

Modified: labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/server/ActivationCoordinatorInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/server/ActivationCoordinatorInitialisation.java	2009-02-05 08:06:04 UTC (rev 25116)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/server/ActivationCoordinatorInitialisation.java	2009-02-05 13:34:55 UTC (rev 25117)
@@ -43,9 +43,6 @@
     {
         Sequencer.Callback callback = new Sequencer.Callback(Sequencer.SEQUENCE_WSCOOR11, Sequencer.WEBAPP_WSC11) {
            public void run() {
-               // TODO if we rely upon JaxWS to automatically publish implementation classes it will only
-               // do so under a URL based on service name. which means we cannot define a service using
-               // multiple port bindings because thsi causes a namespace clash
                final ServiceRegistry serviceRegistry = ServiceRegistry.getRegistry() ;
                String bindAddress = System.getProperty(Environment.XTS_BIND_ADDRESS);
                String bindPort = System.getProperty(Environment.XTS_BIND_PORT);
@@ -58,10 +55,18 @@
                if (bindPort == null) {
                    bindPort = "8080";
                }
+
+               if (secureBindPort == null) {
+                   secureBindPort = "8443";
+               }
+
                final String baseUri = "http://" +  bindAddress + ":" + bindPort + "/ws-c11/";
                final String uri = baseUri + "ActivationService";
+               final String secureBaseUri = "https://" + bindAddress + ":" + secureBindPort + "/ws-c11/";
+               final String secureUri = secureBaseUri + "ActivationService";
 
                serviceRegistry.registerServiceProvider(CoordinationConstants.ACTIVATION_SERVICE_NAME, uri) ;
+               serviceRegistry.registerSecureServiceProvider(CoordinationConstants.ACTIVATION_SERVICE_NAME, secureUri) ;
            }
         };
     }

Modified: labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/server/RegistrationCoordinatorInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/server/RegistrationCoordinatorInitialisation.java	2009-02-05 08:06:04 UTC (rev 25116)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/server/RegistrationCoordinatorInitialisation.java	2009-02-05 13:34:55 UTC (rev 25117)
@@ -56,10 +56,18 @@
                if (bindPort == null) {
                    bindPort = "8080";
                }
+
+               if (secureBindPort == null) {
+                   secureBindPort = "8443";
+               }
+
                final String baseUri = "http://" +  bindAddress + ":" + bindPort + "/ws-c11/";
                final String uri = baseUri + "RegistrationService";
+               final String secureBaseUri = "https://" + bindAddress + ":" + secureBindPort + "/ws-c11/";
+               final String secureUri = secureBaseUri + "RegistrationService";
 
                serviceRegistry.registerServiceProvider(CoordinationConstants.REGISTRATION_SERVICE_NAME, uri) ;
+               serviceRegistry.registerSecureServiceProvider(CoordinationConstants.REGISTRATION_SERVICE_NAME, secureUri); ;
            }
         };
     }

Modified: labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/ContextFactory.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/ContextFactory.java	2009-02-05 08:06:04 UTC (rev 25116)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/ContextFactory.java	2009-02-05 13:34:55 UTC (rev 25117)
@@ -56,7 +56,7 @@
      */
 	
     public CoordinationContext create(final String coordinationTypeURI,
-            final Long expires, final CoordinationContextType currentContext)
+            final Long expires, final CoordinationContextType currentContext, final boolean isSecure)
         throws InvalidCreateParametersException;
 
     /**

Modified: labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/Registrar.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/Registrar.java	2009-02-05 08:06:04 UTC (rev 25116)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/Registrar.java	2009-02-05 13:34:55 UTC (rev 25117)
@@ -36,7 +36,8 @@
      * @throws com.arjuna.wsc.NoActivityException if the actvity does not exist
      */
     public W3CEndpointReference register(final W3CEndpointReference participantProtocolService,
-        final String protocolIdentifier, final InstanceIdentifier instanceIdentifier)
+        final String protocolIdentifier, final InstanceIdentifier instanceIdentifier,
+        final boolean isSecure)
         throws AlreadyRegisteredException, InvalidProtocolException, InvalidStateException, NoActivityException;
 
     /**

Modified: labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/messaging/ActivationCoordinatorProcessorImpl.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/messaging/ActivationCoordinatorProcessorImpl.java	2009-02-05 08:06:04 UTC (rev 25116)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/messaging/ActivationCoordinatorProcessorImpl.java	2009-02-05 13:34:55 UTC (rev 25117)
@@ -52,7 +52,8 @@
      */
     public CreateCoordinationContextResponseType
         createCoordinationContext(final CreateCoordinationContextType createCoordinationContext,
-                                  final AddressingProperties addressingProperties)
+                                  final AddressingProperties addressingProperties,
+                                  final boolean isSecure)
     {
         final ContextFactoryMapper contextFactoryMapper = ContextFactoryMapper.getFactory() ;
         try
@@ -68,7 +69,7 @@
                     final Expires expiresElement = createCoordinationContext.getExpires() ;
                     final Long expires = (expiresElement == null ? null : new Long(expiresElement.getValue())) ;
                     
-                    coordinationContext = contextFactory.create(coordinationType, expires, createCoordinationContext.getCurrentContext()) ;
+                    coordinationContext = contextFactory.create(coordinationType, expires, createCoordinationContext.getCurrentContext(), isSecure) ;
                     final CreateCoordinationContextResponseType response = new CreateCoordinationContextResponseType() ;
                     response.setCoordinationContext(coordinationContext) ;
                     return response;

Modified: labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/messaging/RegistrationCoordinatorProcessorImpl.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/messaging/RegistrationCoordinatorProcessorImpl.java	2009-02-05 08:06:04 UTC (rev 25116)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/messaging/RegistrationCoordinatorProcessorImpl.java	2009-02-05 13:34:55 UTC (rev 25117)
@@ -59,7 +59,7 @@
      * @param arjunaContext The arjuna context.
      */
     public RegisterResponseType register(final RegisterType register, final AddressingProperties addressingContext,
-        final ArjunaContext arjunaContext)
+        final ArjunaContext arjunaContext, final boolean isSecure)
     {
         final com.arjuna.wsc11.RegistrarMapper registrarMapper = RegistrarMapper.getFactory() ;
         try
@@ -74,7 +74,7 @@
                     final W3CEndpointReference participantProtocolService = register.getParticipantProtocolService() ;
                     final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier();
                     final W3CEndpointReference coordinationProtocolService =
-                            registrar.register(participantProtocolService, protocolIdentifier, instanceIdentifier) ;
+                            registrar.register(participantProtocolService, protocolIdentifier, instanceIdentifier, isSecure) ;
                     final RegisterResponseType response = new RegisterResponseType() ;
 
                     response.setCoordinatorProtocolService(coordinationProtocolService);

Modified: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/client/TerminationCoordinatorClient.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/client/TerminationCoordinatorClient.java	2009-02-05 08:06:04 UTC (rev 25116)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/client/TerminationCoordinatorClient.java	2009-02-05 13:34:55 UTC (rev 25117)
@@ -73,7 +73,12 @@
      */
     private EndpointReference terminationParticipant ;
 
+    /**
+     * The participant URI for secure replies.
+     */
+    private EndpointReference secureTerminationParticipant ;
 
+
     /**
      * Construct the terminator participant client.
      */
@@ -95,13 +100,21 @@
         // Add client policies
         //ClientPolicy.register(handlerRegistry) ;
         final String terminationParticipantURIString =
-            ServiceRegistry.getRegistry().getServiceURI(ArjunaTX11Constants.TERMINATION_PARTICIPANT_SERVICE_NAME);
+            ServiceRegistry.getRegistry().getServiceURI(ArjunaTX11Constants.TERMINATION_PARTICIPANT_SERVICE_NAME, false);
+        final String secureTerminationParticipantURIString =
+            ServiceRegistry.getRegistry().getServiceURI(ArjunaTX11Constants.TERMINATION_PARTICIPANT_SERVICE_NAME, true);
         try {
             URI terminationParticipantURI = new URI(terminationParticipantURIString);
             terminationParticipant = builder.newEndpointReference(terminationParticipantURI);
         } catch (URISyntaxException use) {
             // TODO - log fault and throw exception
         }
+        try {
+            URI secureTerminationParticipantURI = new URI(secureTerminationParticipantURIString);
+            secureTerminationParticipant = builder.newEndpointReference(secureTerminationParticipantURI);
+        } catch (URISyntaxException use) {
+            // TODO - log fault and throw exception
+        }
     }
 
     /**
@@ -114,7 +127,8 @@
     public void sendComplete(final W3CEndpointReference coordinator, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
         throws SoapFault, IOException
     {
-        AddressingHelper.installFromFaultTo(addressingProperties, terminationParticipant, identifier);
+        EndpointReference participant = getParticipant(coordinator);
+        AddressingHelper.installFromFaultTo(addressingProperties, participant, identifier);
         final TerminationCoordinatorPortType port = getPort(coordinator, addressingProperties, identifier, completeAction);
         final NotificationType complete = new NotificationType();
 
@@ -131,7 +145,8 @@
     public void sendClose(final W3CEndpointReference coordinator, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
         throws SoapFault, IOException
     {
-        AddressingHelper.installFromFaultTo(addressingProperties, terminationParticipant, identifier);
+        EndpointReference participant = getParticipant(coordinator);
+        AddressingHelper.installFromFaultTo(addressingProperties, participant, identifier);
         final TerminationCoordinatorPortType port = getPort(coordinator, addressingProperties, identifier, closeAction);
         final NotificationType close = new NotificationType();
 
@@ -148,7 +163,8 @@
     public void sendCancel(final W3CEndpointReference coordinator, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
         throws SoapFault, IOException
     {
-        AddressingHelper.installFromFaultTo(addressingProperties, terminationParticipant, identifier);
+        EndpointReference participant = getParticipant(coordinator);
+        AddressingHelper.installFromFaultTo(addressingProperties, participant, identifier);
         final TerminationCoordinatorPortType port = getPort(coordinator, addressingProperties, identifier, cancelAction);
         final NotificationType cancel = new NotificationType();
 
@@ -173,7 +189,23 @@
         // use the SoapFaultService to format a soap fault and send it back to the faultto or from address
         SoapFaultClient.sendSoapFault((SoapFault11)soapFault, endpoint, addressingProperties, faultAction);
     }
+
     /**
+     * return a participant endpoint appropriate to the type of coordinator
+     * @param coordinator
+     * @return either the secure terminaton coordinator endpoint or the non-secure endpoint
+     */
+    EndpointReference getParticipant(W3CEndpointReference coordinator)
+    {
+        String address = coordinator.getAddress();
+        if (address.startsWith("https")) {
+            return secureTerminationParticipant;
+        } else {
+            return terminationParticipant;
+        }
+    }
+
+    /**
      * Get the Terminator Coordinator client singleton.
      * @return The Terminator Coordinator client singleton.
      */

Modified: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/client/TerminationParticipantClient.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/client/TerminationParticipantClient.java	2009-02-05 08:06:04 UTC (rev 25116)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/client/TerminationParticipantClient.java	2009-02-05 13:34:55 UTC (rev 25117)
@@ -79,6 +79,11 @@
     private EndpointReference terminationCoordinator ;
 
     /**
+     * The participant URI for securereplies.
+     */
+    private EndpointReference secureTerminationCoordinator ;
+
+    /**
      * Construct the terminator coordinator client.
      */
     private TerminationParticipantClient()
@@ -100,13 +105,21 @@
         // Add client policies
         // ClientPolicy.register(handlerRegistry) ;
         final String terminationCoordinatorURIString =
-            ServiceRegistry.getRegistry().getServiceURI(ArjunaTX11Constants.TERMINATION_COORDINATOR_SERVICE_NAME);
+            ServiceRegistry.getRegistry().getServiceURI(ArjunaTX11Constants.TERMINATION_COORDINATOR_SERVICE_NAME, false);
+        final String secureTerminationCoordinatorURIString =
+            ServiceRegistry.getRegistry().getServiceURI(ArjunaTX11Constants.TERMINATION_COORDINATOR_SERVICE_NAME, true);
         try {
             URI terminationCoordinatorURI = new URI(terminationCoordinatorURIString);
             terminationCoordinator = builder.newEndpointReference(terminationCoordinatorURI);
         } catch (URISyntaxException use) {
             // TODO - log fault and throw exception
         }
+        try {
+            URI secureTerminationCoordinatorURI = new URI(secureTerminationCoordinatorURIString);
+            secureTerminationCoordinator = builder.newEndpointReference(secureTerminationCoordinatorURI);
+        } catch (URISyntaxException use) {
+            // TODO - log fault and throw exception
+        }
     }
 
     /**
@@ -119,7 +132,8 @@
     public void sendCompleted(final W3CEndpointReference participant, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
         throws SoapFault, IOException
     {
-        AddressingHelper.installFromFaultTo(addressingProperties, terminationCoordinator, identifier);
+        EndpointReference coordinator = getCoordinator(participant);
+        AddressingHelper.installFromFaultTo(addressingProperties, coordinator, identifier);
         final TerminationParticipantPortType port = getPort(participant, addressingProperties, identifier, completedAction);
         final NotificationType completed = new NotificationType();
 
@@ -136,7 +150,8 @@
     public void sendClosed(final W3CEndpointReference participant, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
         throws SoapFault, IOException
     {
-        AddressingHelper.installFromFaultTo(addressingProperties, terminationCoordinator, identifier);
+        EndpointReference coordinator = getCoordinator(participant);
+        AddressingHelper.installFromFaultTo(addressingProperties, coordinator, identifier);
         final TerminationParticipantPortType port = getPort(participant, addressingProperties, identifier, closedAction);
         final NotificationType closed = new NotificationType();
 
@@ -153,7 +168,8 @@
     public void sendCancelled(final W3CEndpointReference participant,final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
         throws SoapFault, IOException
     {
-        AddressingHelper.installFromFaultTo(addressingProperties, terminationCoordinator, identifier);
+        EndpointReference coordinator = getCoordinator(participant);
+        AddressingHelper.installFromFaultTo(addressingProperties, coordinator, identifier);
         final TerminationParticipantPortType port = getPort(participant, addressingProperties, identifier, cancelledAction);
         final NotificationType cancelled = new NotificationType();
 
@@ -170,7 +186,8 @@
     public void sendFaulted(final W3CEndpointReference participant, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
         throws SoapFault, IOException
     {
-        AddressingHelper.installFromFaultTo(addressingProperties, terminationCoordinator, identifier);
+        EndpointReference coordinator = getCoordinator(participant);
+        AddressingHelper.installFromFaultTo(addressingProperties, coordinator, identifier);
         final TerminationParticipantPortType port = getPort(participant, addressingProperties, identifier, faultedAction);
         final NotificationType faulted = new NotificationType();
 
@@ -179,19 +196,19 @@
 
     /**
      * Send a fault.
-     * @param participant the endpoint reference for the participant to notify
+     * @param endpoint the endpoint reference to notify
      * @param addressingProperties The addressing context.
      * @param soapFault The SOAP fault.
      * @param identifier The arjuna  instance identifier.
      * @throws com.arjuna.webservices.SoapFault For any errors.
      * @throws java.io.IOException for any transport errors.
      */
-    public void sendSoapFault(final W3CEndpointReference participant, final AddressingProperties addressingProperties, final SoapFault soapFault, final InstanceIdentifier identifier)
+    public void sendSoapFault(final W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final SoapFault soapFault, final InstanceIdentifier identifier)
         throws SoapFault, IOException
     {
         //AddressingHelper.installFrom(addressingProperties, terminationCoordinator, identifier);
         AddressingHelper.installNoneReplyTo(addressingProperties);
-        final TerminationParticipantPortType port = getPort(participant, addressingProperties, identifier, soapFaultAction);
+        final TerminationParticipantPortType port = getPort(endpoint, addressingProperties, identifier, soapFaultAction);
         final ExceptionType fault = new ExceptionType();
         // we pass the fault type, reason and subcode. we cannot pass the detail and header elements as they are
         // built from Kev's element types rather than dom element types. this is all we need anyway since we only
@@ -227,6 +244,21 @@
     }
 
     /**
+     * return a coordinator endpoint appropriate to the type of participant
+     * @param participant
+     * @return either the secure terminaton participant endpoint or the non-secure endpoint
+     */
+    EndpointReference getCoordinator(W3CEndpointReference participant)
+    {
+        String address = participant.getAddress();
+        if (address.startsWith("https")) {
+            return secureTerminationCoordinator;
+        } else {
+            return terminationCoordinator;
+        }
+    }
+
+    /**
      * Get the Terminator Coordinator client singleton.
      * @return The Terminator Coordinator client singleton.
      */

Modified: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/sei/TerminationCoordinatorPortTypeImpl.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/sei/TerminationCoordinatorPortTypeImpl.java	2009-02-05 08:06:04 UTC (rev 25116)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/sei/TerminationCoordinatorPortTypeImpl.java	2009-02-05 13:34:55 UTC (rev 25117)
@@ -18,6 +18,7 @@
 import javax.xml.ws.addressing.AddressingProperties;
 import javax.xml.ws.addressing.JAXWSAConstants;
 import javax.xml.ws.handler.MessageContext;
+import javax.servlet.http.HttpServletRequest;
 
 import org.jboss.jbossts.xts.soapfault.Fault;
 
@@ -53,6 +54,8 @@
         NotificationType parameters)
     {
         MessageContext ctx = webServiceCtx.getMessageContext();
+        HttpServletRequest request = (HttpServletRequest)ctx.get(MessageContext.SERVLET_REQUEST);
+        boolean isSecure = request.getScheme().equals("https");
         final NotificationType complete = parameters;
         final AddressingProperties inboundAddressProperties
             = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);

Modified: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/server/TerminationCoordinatorInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/server/TerminationCoordinatorInitialisation.java	2009-02-05 08:06:04 UTC (rev 25116)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/server/TerminationCoordinatorInitialisation.java	2009-02-05 13:34:55 UTC (rev 25117)
@@ -55,10 +55,18 @@
                if (bindPort == null) {
                    bindPort = "8080";
                }
+
+               if (secureBindPort == null) {
+                   secureBindPort = "8443";
+               }
+
                final String baseUri = "http://" +  bindAddress + ":" + bindPort + "/ws-t11/";
                final String uri = baseUri + ArjunaTX11Constants.TERMINATION_COORDINATOR_SERVICE_NAME;
+               final String secureBaseUri = "https://" +  bindAddress + ":" + secureBindPort + "/ws-t11/";
+               final String secureUri = secureBaseUri + ArjunaTX11Constants.TERMINATION_COORDINATOR_SERVICE_NAME;
 
                serviceRegistry.registerServiceProvider(ArjunaTX11Constants.TERMINATION_COORDINATOR_SERVICE_NAME, uri) ;
+               serviceRegistry.registerSecureServiceProvider(ArjunaTX11Constants.TERMINATION_COORDINATOR_SERVICE_NAME, secureUri) ;
            }
         };
     }

Modified: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/server/TerminationParticipantInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/server/TerminationParticipantInitialisation.java	2009-02-05 08:06:04 UTC (rev 25116)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/server/TerminationParticipantInitialisation.java	2009-02-05 13:34:55 UTC (rev 25117)
@@ -55,9 +55,18 @@
                if (bindPort == null) {
                    bindPort = "8080";
                }
+
+               if (secureBindPort == null) {
+                   secureBindPort = "8443";
+               }
+
                final String baseUri = "http://" +  bindAddress + ":" + bindPort + "/ws-t11/";
                final String uri = baseUri + ArjunaTX11Constants.TERMINATION_PARTICIPANT_SERVICE_NAME;
+               final String secureBaseUri = "https://" +  bindAddress + ":" + secureBindPort + "/ws-t11/";
+               final String secureUri = secureBaseUri + ArjunaTX11Constants.TERMINATION_PARTICIPANT_SERVICE_NAME;
+
                serviceRegistry.registerServiceProvider(ArjunaTX11Constants.TERMINATION_PARTICIPANT_SERVICE_NAME, uri) ;
+               serviceRegistry.registerSecureServiceProvider(ArjunaTX11Constants.TERMINATION_PARTICIPANT_SERVICE_NAME, secureUri) ;
            }
         };
     }

Modified: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/client/CompletionCoordinatorClient.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/client/CompletionCoordinatorClient.java	2009-02-05 08:06:04 UTC (rev 25116)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/client/CompletionCoordinatorClient.java	2009-02-05 13:34:55 UTC (rev 25117)
@@ -44,6 +44,11 @@
     private EndpointReference completionInitiator ;
 
     /**
+     * The completion initiator URI for secure replies.
+     */
+    private EndpointReference secureCompletionInitiator ;
+
+    /**
      * Construct the completion coordinator client.
      */
     private CompletionCoordinatorClient()
@@ -63,13 +68,21 @@
         // ClientPolicy.register(handlerRegistry) ;
 
         final String completionInitiatorURIString =
-            ServiceRegistry.getRegistry().getServiceURI(AtomicTransactionConstants.COMPLETION_INITIATOR_SERVICE_NAME) ;
+            ServiceRegistry.getRegistry().getServiceURI(AtomicTransactionConstants.COMPLETION_INITIATOR_SERVICE_NAME, false) ;
+        final String secureCompletionInitiatorURIString =
+            ServiceRegistry.getRegistry().getServiceURI(AtomicTransactionConstants.COMPLETION_INITIATOR_SERVICE_NAME, true) ;
         try {
             URI completionInitiatorURI = new URI(completionInitiatorURIString) ;
             completionInitiator = builder.newEndpointReference(completionInitiatorURI);
         } catch (URISyntaxException use) {
             // TODO - log fault and throw exception
         }
+        try {
+            URI secureCompletionInitiatorURI = new URI(secureCompletionInitiatorURIString) ;
+            secureCompletionInitiator = builder.newEndpointReference(secureCompletionInitiatorURI);
+        } catch (URISyntaxException use) {
+            // TODO - log fault and throw exception
+        }
     }
 
     /**
@@ -82,7 +95,8 @@
     public void sendCommit(final W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
         throws SoapFault, IOException
     {
-        AddressingHelper.installFromFaultTo(addressingProperties, completionInitiator, identifier);
+        EndpointReference initiator = getCompletionInitiator(endpoint);
+        AddressingHelper.installFromFaultTo(addressingProperties, initiator, identifier);
         CompletionCoordinatorPortType port = getPort(endpoint, addressingProperties, commitAction);
         Notification commit = new Notification();
 
@@ -99,7 +113,8 @@
     public void sendRollback(final W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
         throws SoapFault, IOException
     {
-        AddressingHelper.installFromFaultTo(addressingProperties, completionInitiator, identifier);
+        EndpointReference initiator = getCompletionInitiator(endpoint);
+        AddressingHelper.installFromFaultTo(addressingProperties, initiator, identifier);
         CompletionCoordinatorPortType port = getPort(endpoint, addressingProperties, rollbackAction);
         Notification rollback = new Notification();
                 
@@ -107,6 +122,21 @@
     }
 
     /**
+     * return a completion initiator endpoint appropriate to the type of completion coordinator
+     * @param participant
+     * @return either the secure terminaton participant endpoint or the non-secure endpoint
+     */
+    EndpointReference getCompletionInitiator(W3CEndpointReference participant)
+    {
+        String address = participant.getAddress();
+        if (address.startsWith("https")) {
+            return secureCompletionInitiator;
+        } else {
+            return completionInitiator;
+        }
+    }
+
+    /**
      * Get the Completion Coordinator client singleton.
      * @return The Completion Coordinator client singleton.
      */

Modified: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/client/CompletionInitiatorClient.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/client/CompletionInitiatorClient.java	2009-02-05 08:06:04 UTC (rev 25116)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/client/CompletionInitiatorClient.java	2009-02-05 13:34:55 UTC (rev 25117)
@@ -50,6 +50,11 @@
     private EndpointReference completionCoordinator ;
 
     /**
+     * The completion coordinator URI for secure replies.
+     */
+    private EndpointReference secureCompletionCoordinator ;
+
+    /**
      * Construct the completion initiator client.
      */
     private CompletionInitiatorClient()
@@ -70,13 +75,21 @@
         // ClientPolicy.register(handlerRegistry) ;
 
         final String completionCoordinatorURIString =
-            ServiceRegistry.getRegistry().getServiceURI(AtomicTransactionConstants.COMPLETION_COORDINATOR_SERVICE_NAME) ;
+            ServiceRegistry.getRegistry().getServiceURI(AtomicTransactionConstants.COMPLETION_COORDINATOR_SERVICE_NAME, false) ;
+        final String secureCompletionCoordinatorURIString =
+            ServiceRegistry.getRegistry().getServiceURI(AtomicTransactionConstants.COMPLETION_COORDINATOR_SERVICE_NAME, true) ;
         try {
             URI completionCoordinatorURI = new URI(completionCoordinatorURIString) ;
             completionCoordinator = builder.newEndpointReference(completionCoordinatorURI);
         } catch (URISyntaxException use) {
             // TODO - log fault and throw exception
         }
+        try {
+            URI secureCompletionCoordinatorURI = new URI(secureCompletionCoordinatorURIString) ;
+            secureCompletionCoordinator = builder.newEndpointReference(secureCompletionCoordinatorURI);
+        } catch (URISyntaxException use) {
+            // TODO - log fault and throw exception
+        }
     }
 
     /**
@@ -89,7 +102,8 @@
     public void sendCommitted(final W3CEndpointReference participant, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
         throws SoapFault, IOException
     {
-        AddressingHelper.installFaultTo(addressingProperties, completionCoordinator, identifier);
+        EndpointReference coordinator = getCompletionCoordinator(participant);
+        AddressingHelper.installFaultTo(addressingProperties, coordinator, identifier);
         CompletionInitiatorPortType port = getPort(participant, addressingProperties, committedAction);
         Notification commited = new Notification();
 
@@ -106,7 +120,8 @@
     public void sendAborted(final W3CEndpointReference participant, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
         throws SoapFault, IOException
     {
-        AddressingHelper.installFaultTo(addressingProperties, completionCoordinator, identifier);
+        EndpointReference coordinator = getCompletionCoordinator(participant);
+        AddressingHelper.installFaultTo(addressingProperties, coordinator, identifier);
         CompletionInitiatorPortType port = getPort(participant, addressingProperties, abortedAction);
         Notification aborted = new Notification();
 
@@ -130,6 +145,21 @@
     }
 
     /**
+     * return a completion coordinator endpoint appropriate to the type of completion initiator
+     * @param participant
+     * @return either the secure terminaton participant endpoint or the non-secure endpoint
+     */
+    EndpointReference getCompletionCoordinator(W3CEndpointReference participant)
+    {
+        String address = participant.getAddress();
+        if (address.startsWith("https")) {
+            return secureCompletionCoordinator;
+        } else {
+            return completionCoordinator;
+        }
+    }
+
+    /**
      * Get the Completion Coordinator client singleton.
      * @return The Completion Coordinator client singleton.
      */

Modified: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/client/CoordinatorClient.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/client/CoordinatorClient.java	2009-02-05 08:06:04 UTC (rev 25116)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/client/CoordinatorClient.java	2009-02-05 13:34:55 UTC (rev 25117)
@@ -58,6 +58,11 @@
     private EndpointReference participant ;
 
     /**
+     * The participant URI for secure replies.
+     */
+    private EndpointReference secureParticipant ;
+
+    /**
      * Construct the coordinator client.
      */
     private CoordinatorClient()
@@ -80,13 +85,21 @@
         // ClientPolicy.register(handlerRegistry) ;
 
         final String participantURIString =
-            ServiceRegistry.getRegistry().getServiceURI(AtomicTransactionConstants.PARTICIPANT_SERVICE_NAME);
+            ServiceRegistry.getRegistry().getServiceURI(AtomicTransactionConstants.PARTICIPANT_SERVICE_NAME, false);
+        final String secureParticipantURIString =
+            ServiceRegistry.getRegistry().getServiceURI(AtomicTransactionConstants.PARTICIPANT_SERVICE_NAME, true);
         try {
             URI participantURI = new URI(participantURIString);
             participant = builder.newEndpointReference(participantURI);
         } catch (URISyntaxException use) {
             // TODO - log fault and throw exception
         }
+        try {
+            URI secureParticipantURI = new URI(secureParticipantURIString);
+            secureParticipant = builder.newEndpointReference(secureParticipantURI);
+        } catch (URISyntaxException use) {
+            // TODO - log fault and throw exception
+        }
     }
 
     /**
@@ -99,6 +112,7 @@
     public void sendPrepared(final W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
         throws SoapFault, IOException
     {
+        EndpointReference participant = getParticipant(endpoint);
         AddressingHelper.installFromFaultTo(addressingProperties, participant, identifier);
         CoordinatorPortType port = getPort(endpoint, addressingProperties, preparedAction);
         Notification prepared = new Notification();
@@ -116,6 +130,7 @@
     public void sendAborted(final W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
         throws SoapFault, IOException
     {
+        EndpointReference participant = getParticipant(endpoint);
         AddressingHelper.installFaultTo(addressingProperties, participant, identifier);
         CoordinatorPortType port = getPort(endpoint, addressingProperties, abortedAction);
         Notification aborted = new Notification();
@@ -133,6 +148,7 @@
     public void sendReadOnly(final W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
         throws SoapFault, IOException
     {
+        EndpointReference participant = getParticipant(endpoint);
         AddressingHelper.installFaultTo(addressingProperties, participant, identifier);
         CoordinatorPortType port = getPort(endpoint, addressingProperties, readOnlyAction);
         Notification readOnly = new Notification();
@@ -150,6 +166,7 @@
     public void sendCommitted(final W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
         throws SoapFault, IOException
     {
+        EndpointReference participant = getParticipant(endpoint);
         AddressingHelper.installFaultTo(addressingProperties, participant, identifier);
         CoordinatorPortType port = getPort(endpoint, addressingProperties, committedAction);
         Notification committed = new Notification();
@@ -174,6 +191,21 @@
     }
 
     /**
+     * return a participant endpoint appropriate to the type of coordinator
+     * @param endpoint
+     * @return either the secure participant endpoint or the non-secure endpoint
+     */
+    EndpointReference getParticipant(W3CEndpointReference endpoint)
+    {
+        String address = endpoint.getAddress();
+        if (address.startsWith("https")) {
+            return secureParticipant;
+        } else {
+            return participant;
+        }
+    }
+
+    /**
      * Get the Completion Coordinator client singleton.
      * @return The Completion Coordinator client singleton.
      */

Modified: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/client/ParticipantClient.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/client/ParticipantClient.java	2009-02-05 08:06:04 UTC (rev 25116)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/client/ParticipantClient.java	2009-02-05 13:34:55 UTC (rev 25117)
@@ -54,6 +54,11 @@
     private EndpointReference coordinator ;
 
     /**
+     * The coordinator URI for secure replies.
+     */
+    private EndpointReference secureCoordinator ;
+
+    /**
      * Construct the completion initiator client.
      */
     {
@@ -73,13 +78,20 @@
         // Add client policies
         // ClientPolicy.register(handlerRegistry) ;
 
-        final String coordinatorURIString = ServiceRegistry.getRegistry().getServiceURI(AtomicTransactionConstants.COORDINATOR_SERVICE_NAME);
+        final String coordinatorURIString = ServiceRegistry.getRegistry().getServiceURI(AtomicTransactionConstants.COORDINATOR_SERVICE_NAME, false);
+        final String secureCoordinatorURIString = ServiceRegistry.getRegistry().getServiceURI(AtomicTransactionConstants.COORDINATOR_SERVICE_NAME, true);
         try {
             URI coordinatorURI = new URI(coordinatorURIString);
             coordinator = builder.newEndpointReference(coordinatorURI);
         } catch (URISyntaxException use) {
             // TODO - log fault and throw exception
         }
+        try {
+            URI secureCoordinatorURI = new URI(secureCoordinatorURIString);
+            secureCoordinator = builder.newEndpointReference(secureCoordinatorURI);
+        } catch (URISyntaxException use) {
+            // TODO - log fault and throw exception
+        }
 
     }
 
@@ -93,6 +105,7 @@
     public void sendPrepare(final W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
         throws SoapFault, IOException
     {
+        EndpointReference coordinator = getCoordinator(endpoint);
         AddressingHelper.installFromFaultTo(addressingProperties, coordinator, identifier);
         ParticipantPortType port = getPort(endpoint, addressingProperties, prepareAction);
         Notification prepare = new Notification();
@@ -110,6 +123,7 @@
     public void sendCommit(final W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
         throws SoapFault, IOException
     {
+        EndpointReference coordinator = getCoordinator(endpoint);
         AddressingHelper.installFromFaultTo(addressingProperties, coordinator, identifier);
         ParticipantPortType port = getPort(endpoint, addressingProperties, commitAction);
         Notification commit = new Notification();
@@ -127,6 +141,7 @@
     public void sendRollback(final W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
         throws SoapFault, IOException
     {
+        EndpointReference coordinator = getCoordinator(endpoint);
         AddressingHelper.installFromFaultTo(addressingProperties, coordinator, identifier);
         ParticipantPortType port = getPort(endpoint, addressingProperties, rollbackAction);
         Notification rollback = new Notification();
@@ -151,6 +166,21 @@
     }
 
     /**
+     * return a coordinator endpoint appropriate to the type of participant
+     * @param endpoint
+     * @return either the secure coordinator endpoint or the non-secure endpoint
+     */
+    EndpointReference getCoordinator(W3CEndpointReference endpoint)
+    {
+        String address = endpoint.getAddress();
+        if (address.startsWith("https")) {
+            return secureCoordinator;
+        } else {
+            return coordinator;
+        }
+    }
+
+    /**
      * Get the Completion Coordinator client singleton.
      * @return The Completion Coordinator client singleton.
      */

Modified: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/server/CompletionCoordinatorInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/server/CompletionCoordinatorInitialisation.java	2009-02-05 08:06:04 UTC (rev 25116)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/server/CompletionCoordinatorInitialisation.java	2009-02-05 13:34:55 UTC (rev 25117)
@@ -56,10 +56,18 @@
                if (bindPort == null) {
                    bindPort = "8080";
                }
+
+               if (secureBindPort == null) {
+                   secureBindPort = "8443";
+               }
+
                final String baseUri = "http://" +  bindAddress + ":" + bindPort + "/ws-t11/";
                final String uri = baseUri + AtomicTransactionConstants.COMPLETION_COORDINATOR_SERVICE_NAME;
+               final String secureBaseUri = "https://" +  bindAddress + ":" + secureBindPort + "/ws-t11/";
+               final String secureUri = secureBaseUri + AtomicTransactionConstants.COMPLETION_COORDINATOR_SERVICE_NAME;
 
                serviceRegistry.registerServiceProvider(AtomicTransactionConstants.COMPLETION_COORDINATOR_SERVICE_NAME, uri) ;
+               serviceRegistry.registerSecureServiceProvider(AtomicTransactionConstants.COMPLETION_COORDINATOR_SERVICE_NAME, secureUri) ;
            }
         };
     }

Modified: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/server/CompletionInitiatorInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/server/CompletionInitiatorInitialisation.java	2009-02-05 08:06:04 UTC (rev 25116)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/server/CompletionInitiatorInitialisation.java	2009-02-05 13:34:55 UTC (rev 25117)
@@ -56,10 +56,18 @@
                if (bindPort == null) {
                    bindPort = "8080";
                }
+
+               if (secureBindPort == null) {
+                   secureBindPort = "8443";
+               }
+
                final String baseUri = "http://" +  bindAddress + ":" + bindPort + "/ws-t11/";
                final String uri = baseUri + AtomicTransactionConstants.COMPLETION_INITIATOR_SERVICE_NAME;
+               final String secureBaseUri = "https://" +  bindAddress + ":" + secureBindPort + "/ws-t11/";
+               final String secureUri = secureBaseUri + AtomicTransactionConstants.COMPLETION_INITIATOR_SERVICE_NAME;
 
                serviceRegistry.registerServiceProvider(AtomicTransactionConstants.COMPLETION_INITIATOR_SERVICE_NAME, uri) ;
+               serviceRegistry.registerSecureServiceProvider(AtomicTransactionConstants.COMPLETION_INITIATOR_SERVICE_NAME, secureUri) ;
            }
         };
     }

Modified: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/server/CoordinatorInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/server/CoordinatorInitialisation.java	2009-02-05 08:06:04 UTC (rev 25116)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/server/CoordinatorInitialisation.java	2009-02-05 13:34:55 UTC (rev 25117)
@@ -55,10 +55,18 @@
                if (bindPort == null) {
                    bindPort = "8080";
                }
+
+               if (secureBindPort == null) {
+                   secureBindPort = "8443";
+               }
+
                final String baseUri = "http://" +  bindAddress + ":" + bindPort + "/ws-t11/";
                final String uri = baseUri + AtomicTransactionConstants.COORDINATOR_SERVICE_NAME;
+               final String secureBaseUri = "https://" +  bindAddress + ":" + secureBindPort + "/ws-t11/";
+               final String secureUri = secureBaseUri + AtomicTransactionConstants.COORDINATOR_SERVICE_NAME;
 
                serviceRegistry.registerServiceProvider(AtomicTransactionConstants.COORDINATOR_SERVICE_NAME, uri) ;
+               serviceRegistry.registerSecureServiceProvider(AtomicTransactionConstants.COORDINATOR_SERVICE_NAME, secureUri) ;
            }
         };
     }

Modified: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/server/ParticipantInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/server/ParticipantInitialisation.java	2009-02-05 08:06:04 UTC (rev 25116)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/server/ParticipantInitialisation.java	2009-02-05 13:34:55 UTC (rev 25117)
@@ -55,10 +55,18 @@
                if (bindPort == null) {
                    bindPort = "8080";
                }
+
+               if (secureBindPort == null) {
+                   secureBindPort = "8443";
+               }
+
                final String baseUri = "http://" +  bindAddress + ":" + bindPort + "/ws-t11/";
                final String uri = baseUri + AtomicTransactionConstants.PARTICIPANT_SERVICE_NAME;
+               final String secureBaseUri = "https://" +  bindAddress + ":" + secureBindPort + "/ws-t11/";
+               final String secureUri = secureBaseUri + AtomicTransactionConstants.PARTICIPANT_SERVICE_NAME;
 
                serviceRegistry.registerServiceProvider(AtomicTransactionConstants.PARTICIPANT_SERVICE_NAME, uri) ;
+               serviceRegistry.registerSecureServiceProvider(AtomicTransactionConstants.PARTICIPANT_SERVICE_NAME, secureUri) ;
            }
         };
     }

Modified: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/client/CoordinatorCompletionCoordinatorClient.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/client/CoordinatorCompletionCoordinatorClient.java	2009-02-05 08:06:04 UTC (rev 25116)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/client/CoordinatorCompletionCoordinatorClient.java	2009-02-05 13:34:55 UTC (rev 25117)
@@ -95,6 +95,11 @@
     private EndpointReference coordinatorCompletionParticipant = null;
 
     /**
+     * The coordinator completion participant URI for replies.
+     */
+    private EndpointReference secureCoordinatorCompletionParticipant = null;
+
+    /**
      * Construct the participant completion coordinator client.
      */
     private CoordinatorCompletionCoordinatorClient()
@@ -121,13 +126,21 @@
         //ClientPolicy.register(handlerRegistry) ;
 
         final String coordinatorCompletionParticipantURIString =
-            ServiceRegistry.getRegistry().getServiceURI(BusinessActivityConstants.COORDINATOR_COMPLETION_PARTICIPANT_SERVICE_NAME) ;
+            ServiceRegistry.getRegistry().getServiceURI(BusinessActivityConstants.COORDINATOR_COMPLETION_PARTICIPANT_SERVICE_NAME, false) ;
+        final String secureCoordinatorCompletionParticipantURIString =
+            ServiceRegistry.getRegistry().getServiceURI(BusinessActivityConstants.COORDINATOR_COMPLETION_PARTICIPANT_SERVICE_NAME, true) ;
         try {
             URI coordinatorCompletionParticipantURI = new URI(coordinatorCompletionParticipantURIString) ;
             coordinatorCompletionParticipant = builder.newEndpointReference(coordinatorCompletionParticipantURI);
         } catch (URISyntaxException use) {
             // TODO - log fault and throw exception
         }
+        try {
+            URI secureCoordinatorCompletionParticipantURI = new URI(secureCoordinatorCompletionParticipantURIString) ;
+            secureCoordinatorCompletionParticipant = builder.newEndpointReference(secureCoordinatorCompletionParticipantURI);
+        } catch (URISyntaxException use) {
+            // TODO - log fault and throw exception
+        }
     }
 
     /**
@@ -140,7 +153,8 @@
     public void sendCompleted(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
         throws SoapFault, IOException
     {
-        AddressingHelper.installFromFaultTo(addressingProperties, coordinatorCompletionParticipant, identifier);
+        EndpointReference participant = getParticipant(endpoint);
+        AddressingHelper.installFromFaultTo(addressingProperties, participant, identifier);
         BusinessAgreementWithCoordinatorCompletionCoordinatorPortType port;
         port = getPort(endpoint, addressingProperties, completedAction);
         NotificationType completed = new NotificationType();
@@ -159,7 +173,8 @@
         final QName exceptionIdentifier)
         throws SoapFault, IOException
     {
-        AddressingHelper.installFromFaultTo(addressingProperties, coordinatorCompletionParticipant, identifier);
+        EndpointReference participant = getParticipant(endpoint);
+        AddressingHelper.installFromFaultTo(addressingProperties, participant, identifier);
         BusinessAgreementWithCoordinatorCompletionCoordinatorPortType port;
         port = getPort(endpoint, addressingProperties, failAction);
         ExceptionType fail = new ExceptionType();
@@ -178,7 +193,8 @@
     public void sendCompensated(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
         throws SoapFault, IOException
     {
-        AddressingHelper.installFaultTo(addressingProperties, coordinatorCompletionParticipant, identifier);
+        EndpointReference participant = getParticipant(endpoint);
+        AddressingHelper.installFaultTo(addressingProperties, participant, identifier);
         BusinessAgreementWithCoordinatorCompletionCoordinatorPortType port;
         port = getPort(endpoint, addressingProperties, compensatedAction);
         NotificationType compensated = new NotificationType();
@@ -196,7 +212,8 @@
     public void sendClosed(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
         throws SoapFault, IOException
     {
-        AddressingHelper.installFaultTo(addressingProperties, coordinatorCompletionParticipant, identifier);
+        EndpointReference participant = getParticipant(endpoint);
+        AddressingHelper.installFaultTo(addressingProperties, participant, identifier);
         BusinessAgreementWithCoordinatorCompletionCoordinatorPortType port;
         port = getPort(endpoint, addressingProperties, closedAction);
         NotificationType closed = new NotificationType();
@@ -214,7 +231,8 @@
     public void sendCancelled(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
         throws SoapFault, IOException
     {
-        AddressingHelper.installFaultTo(addressingProperties, coordinatorCompletionParticipant, identifier);
+        EndpointReference participant = getParticipant(endpoint);
+        AddressingHelper.installFaultTo(addressingProperties, participant, identifier);
         BusinessAgreementWithCoordinatorCompletionCoordinatorPortType port;
         port = getPort(endpoint, addressingProperties, cancelledAction);
         NotificationType camcelled = new NotificationType();
@@ -232,7 +250,8 @@
     public void sendExit(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
         throws SoapFault, IOException
     {
-        AddressingHelper.installFromFaultTo(addressingProperties, coordinatorCompletionParticipant, identifier);
+        EndpointReference participant = getParticipant(endpoint);
+        AddressingHelper.installFromFaultTo(addressingProperties, participant, identifier);
         BusinessAgreementWithCoordinatorCompletionCoordinatorPortType port;
         port = getPort(endpoint, addressingProperties, exitAction);
         NotificationType exited = new NotificationType();
@@ -250,7 +269,8 @@
     public void sendCannotComplete(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
         throws SoapFault, IOException
     {
-        AddressingHelper.installFromFaultTo(addressingProperties, coordinatorCompletionParticipant, identifier);
+        EndpointReference participant = getParticipant(endpoint);
+        AddressingHelper.installFromFaultTo(addressingProperties, participant, identifier);
         BusinessAgreementWithCoordinatorCompletionCoordinatorPortType port;
         port = getPort(endpoint, addressingProperties, cannotCompleteAction);
         NotificationType cannotComplete = new NotificationType();
@@ -268,7 +288,8 @@
     public void sendGetStatus(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
         throws SoapFault, IOException
     {
-        AddressingHelper.installFromFaultTo(addressingProperties, coordinatorCompletionParticipant, identifier);
+        EndpointReference participant = getParticipant(endpoint);
+        AddressingHelper.installFromFaultTo(addressingProperties, participant, identifier);
         BusinessAgreementWithCoordinatorCompletionCoordinatorPortType port;
         port = getPort(endpoint, addressingProperties, getStatusAction);
         NotificationType getStatus = new NotificationType();
@@ -287,7 +308,8 @@
         final QName state)
         throws SoapFault, IOException
     {
-        AddressingHelper.installFromFaultTo(addressingProperties, coordinatorCompletionParticipant, identifier);
+        EndpointReference participant = getParticipant(endpoint);
+        AddressingHelper.installFromFaultTo(addressingProperties, participant, identifier);
         BusinessAgreementWithCoordinatorCompletionCoordinatorPortType port;
         port = getPort(endpoint, addressingProperties, statusAction);
         StatusType status = new StatusType();
@@ -297,6 +319,21 @@
     }
 
     /**
+     * return a participant endpoint appropriate to the type of coordinator
+     * @param endpoint
+     * @return either the secure participant endpoint or the non-secure endpoint
+     */
+    EndpointReference getParticipant(W3CEndpointReference endpoint)
+    {
+        String address = endpoint.getAddress();
+        if (address.startsWith("https")) {
+            return secureCoordinatorCompletionParticipant;
+        } else {
+            return coordinatorCompletionParticipant;
+        }
+    }
+
+    /**
      * Get the Completion Coordinator client singleton.
      * @return The Completion Coordinator client singleton.
      */

Modified: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/client/CoordinatorCompletionParticipantClient.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/client/CoordinatorCompletionParticipantClient.java	2009-02-05 08:06:04 UTC (rev 25116)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/client/CoordinatorCompletionParticipantClient.java	2009-02-05 13:34:55 UTC (rev 25117)
@@ -94,6 +94,11 @@
     private EndpointReference coordinatorCompletionCoordinator = null;
 
     /**
+     * The coordinator completion coordinator URI for secure replies.
+     */
+    private EndpointReference secureCoordinatorCompletionCoordinator = null;
+
+    /**
      * Construct the participant completion coordinator client.
      */
     private CoordinatorCompletionParticipantClient()
@@ -120,13 +125,21 @@
         // ClientPolicy.register(handlerRegistry) ;
 
         final String coordinatorCompletionCoordinatorURIString =
-            ServiceRegistry.getRegistry().getServiceURI(BusinessActivityConstants.COORDINATOR_COMPLETION_COORDINATOR_SERVICE_NAME) ;
+            ServiceRegistry.getRegistry().getServiceURI(BusinessActivityConstants.COORDINATOR_COMPLETION_COORDINATOR_SERVICE_NAME, false) ;
+        final String secureCoordinatorCompletionCoordinatorURIString =
+            ServiceRegistry.getRegistry().getServiceURI(BusinessActivityConstants.COORDINATOR_COMPLETION_COORDINATOR_SERVICE_NAME, true) ;
         try {
             URI coordinatorCompletionCoordinatorURI = new URI(coordinatorCompletionCoordinatorURIString) ;
             coordinatorCompletionCoordinator = builder.newEndpointReference(coordinatorCompletionCoordinatorURI);
         } catch (URISyntaxException use) {
             // TODO - log fault and throw exception
         }
+        try {
+            URI secureCoordinatorCompletionCoordinatorURI = new URI(secureCoordinatorCompletionCoordinatorURIString) ;
+            secureCoordinatorCompletionCoordinator = builder.newEndpointReference(secureCoordinatorCompletionCoordinatorURI);
+        } catch (URISyntaxException use) {
+            // TODO - log fault and throw exception
+        }
     }
 
     /**
@@ -139,7 +152,8 @@
     public void sendComplete(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
         throws SoapFault, IOException
     {
-        AddressingHelper.installFromFaultTo(addressingProperties, coordinatorCompletionCoordinator, identifier);
+        EndpointReference coordinator = getCoordinator(endpoint);
+        AddressingHelper.installFromFaultTo(addressingProperties, coordinator, identifier);
         BusinessAgreementWithCoordinatorCompletionParticipantPortType port;
         port = getPort(endpoint, addressingProperties, completeAction);
         NotificationType complete = new NotificationType();
@@ -157,7 +171,8 @@
     public void sendClose(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
         throws SoapFault, IOException
     {
-        AddressingHelper.installFromFaultTo(addressingProperties, coordinatorCompletionCoordinator, identifier);
+        EndpointReference coordinator = getCoordinator(endpoint);
+        AddressingHelper.installFromFaultTo(addressingProperties, coordinator, identifier);
         BusinessAgreementWithCoordinatorCompletionParticipantPortType port;
         port = getPort(endpoint, addressingProperties, closeAction);
         NotificationType close = new NotificationType();
@@ -175,7 +190,8 @@
     public void sendCancel(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
         throws SoapFault, IOException
     {
-        AddressingHelper.installFromFaultTo(addressingProperties, coordinatorCompletionCoordinator, identifier);
+        EndpointReference coordinator = getCoordinator(endpoint);
+        AddressingHelper.installFromFaultTo(addressingProperties, coordinator, identifier);
         BusinessAgreementWithCoordinatorCompletionParticipantPortType port;
         port = getPort(endpoint, addressingProperties, cancelAction);
         NotificationType cancel = new NotificationType();
@@ -193,7 +209,8 @@
     public void sendCompensate(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
         throws SoapFault, IOException
     {
-        AddressingHelper.installFromFaultTo(addressingProperties, coordinatorCompletionCoordinator, identifier);
+        EndpointReference coordinator = getCoordinator(endpoint);
+        AddressingHelper.installFromFaultTo(addressingProperties, coordinator, identifier);
         BusinessAgreementWithCoordinatorCompletionParticipantPortType port;
         port = getPort(endpoint, addressingProperties, compensateAction);
         NotificationType compensate = new NotificationType();
@@ -211,7 +228,8 @@
     public void sendFailed(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
         throws SoapFault, IOException
     {
-        AddressingHelper.installFaultTo(addressingProperties, coordinatorCompletionCoordinator, identifier);
+        EndpointReference coordinator = getCoordinator(endpoint);
+        AddressingHelper.installFaultTo(addressingProperties, coordinator, identifier);
         BusinessAgreementWithCoordinatorCompletionParticipantPortType port;
         port = getPort(endpoint, addressingProperties, failedAction);
         NotificationType failed = new NotificationType();
@@ -229,7 +247,8 @@
     public void sendExited(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
         throws SoapFault, IOException
     {
-        AddressingHelper.installFaultTo(addressingProperties, coordinatorCompletionCoordinator, identifier);
+        EndpointReference coordinator = getCoordinator(endpoint);
+        AddressingHelper.installFaultTo(addressingProperties, coordinator, identifier);
         BusinessAgreementWithCoordinatorCompletionParticipantPortType port;
         port = getPort(endpoint, addressingProperties, exitedAction);
         NotificationType exit = new NotificationType();
@@ -247,7 +266,8 @@
     public void sendNotCompleted(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
         throws SoapFault, IOException
     {
-        AddressingHelper.installFaultTo(addressingProperties, coordinatorCompletionCoordinator, identifier);
+        EndpointReference coordinator = getCoordinator(endpoint);
+        AddressingHelper.installFaultTo(addressingProperties, coordinator, identifier);
         BusinessAgreementWithCoordinatorCompletionParticipantPortType port;
         port = getPort(endpoint, addressingProperties, notCompletedAction);
         NotificationType notCompleted = new NotificationType();
@@ -265,7 +285,8 @@
     public void sendGetStatus(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
         throws SoapFault, IOException
     {
-        AddressingHelper.installFromFaultTo(addressingProperties, coordinatorCompletionCoordinator, identifier);
+        EndpointReference coordinator = getCoordinator(endpoint);
+        AddressingHelper.installFromFaultTo(addressingProperties, coordinator, identifier);
         BusinessAgreementWithCoordinatorCompletionParticipantPortType port;
         port = getPort(endpoint, addressingProperties, getStatusAction);
         NotificationType getStatus = new NotificationType();
@@ -284,7 +305,8 @@
         final QName state)
         throws SoapFault, IOException
     {
-        AddressingHelper.installFromFaultTo(addressingProperties, coordinatorCompletionCoordinator, identifier);
+        EndpointReference coordinator = getCoordinator(endpoint);
+        AddressingHelper.installFromFaultTo(addressingProperties, coordinator, identifier);
         BusinessAgreementWithCoordinatorCompletionParticipantPortType port;
         port = getPort(endpoint, addressingProperties, statusAction);
         StatusType status = new StatusType();
@@ -294,6 +316,21 @@
     }
 
     /**
+     * return a coordinator endpoint appropriate to the type of participant
+     * @param endpoint
+     * @return either the secure coordinator endpoint or the non-secure endpoint
+     */
+    EndpointReference getCoordinator(W3CEndpointReference endpoint)
+    {
+        String address = endpoint.getAddress();
+        if (address.startsWith("https")) {
+            return secureCoordinatorCompletionCoordinator;
+        } else {
+            return coordinatorCompletionCoordinator;
+        }
+    }
+
+    /**
      * Get the Completion Coordinator client singleton.
      * @return The Completion Coordinator client singleton.
      */

Modified: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/client/ParticipantCompletionCoordinatorClient.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/client/ParticipantCompletionCoordinatorClient.java	2009-02-05 08:06:04 UTC (rev 25116)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/client/ParticipantCompletionCoordinatorClient.java	2009-02-05 13:34:55 UTC (rev 25117)
@@ -95,6 +95,11 @@
     private EndpointReference participantCompletionParticipant = null;
 
     /**
+     * The participant completion participant URI for secure replies.
+     */
+    private EndpointReference secureParticipantCompletionParticipant = null;
+
+    /**
      * Construct the participant completion coordinator client.
      */
     private ParticipantCompletionCoordinatorClient()
@@ -121,13 +126,21 @@
         // ClientPolicy.register(handlerRegistry) ;
 
         final String participantCompletionParticipantURIString =
-            ServiceRegistry.getRegistry().getServiceURI(BusinessActivityConstants.PARTICIPANT_COMPLETION_PARTICIPANT_SERVICE_NAME) ;
+            ServiceRegistry.getRegistry().getServiceURI(BusinessActivityConstants.PARTICIPANT_COMPLETION_PARTICIPANT_SERVICE_NAME, false) ;
+        final String secureParticipantCompletionParticipantURIString =
+            ServiceRegistry.getRegistry().getServiceURI(BusinessActivityConstants.PARTICIPANT_COMPLETION_PARTICIPANT_SERVICE_NAME, true) ;
         try {
             URI participantCompletionParticipantURI = new URI(participantCompletionParticipantURIString) ;
             participantCompletionParticipant = builder.newEndpointReference(participantCompletionParticipantURI);
         } catch (URISyntaxException use) {
             // TODO - log fault and throw exception
         }
+        try {
+            URI secureParticipantCompletionParticipantURI = new URI(secureParticipantCompletionParticipantURIString) ;
+            secureParticipantCompletionParticipant = builder.newEndpointReference(secureParticipantCompletionParticipantURI);
+        } catch (URISyntaxException use) {
+            // TODO - log fault and throw exception
+        }
     }
 
     /**
@@ -140,7 +153,8 @@
     public void sendCompleted(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
         throws SoapFault, IOException
     {
-        AddressingHelper.installFromFaultTo(addressingProperties, participantCompletionParticipant, identifier);
+        EndpointReference participant = getParticipant(endpoint);
+        AddressingHelper.installFromFaultTo(addressingProperties, participant, identifier);
         BusinessAgreementWithParticipantCompletionCoordinatorPortType port;
         port = getPort(endpoint, addressingProperties, completedAction);
         NotificationType completed = new NotificationType();
@@ -159,7 +173,8 @@
         final QName exceptionIdentifier)
         throws SoapFault, IOException
     {
-        AddressingHelper.installFromFaultTo(addressingProperties, participantCompletionParticipant, identifier);
+        EndpointReference participant = getParticipant(endpoint);
+        AddressingHelper.installFromFaultTo(addressingProperties, participant, identifier);
         BusinessAgreementWithParticipantCompletionCoordinatorPortType port;
         port = getPort(endpoint, addressingProperties, failAction);
         ExceptionType fail = new ExceptionType();
@@ -178,7 +193,8 @@
     public void sendCompensated(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
         throws SoapFault, IOException
     {
-        AddressingHelper.installFaultTo(addressingProperties, participantCompletionParticipant, identifier);
+        EndpointReference participant = getParticipant(endpoint);
+        AddressingHelper.installFaultTo(addressingProperties, participant, identifier);
         BusinessAgreementWithParticipantCompletionCoordinatorPortType port;
         port = getPort(endpoint, addressingProperties, compensatedAction);
         NotificationType compensated = new NotificationType();
@@ -196,7 +212,8 @@
     public void sendClosed(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
         throws SoapFault, IOException
     {
-        AddressingHelper.installFaultTo(addressingProperties, participantCompletionParticipant, identifier);
+        EndpointReference participant = getParticipant(endpoint);
+        AddressingHelper.installFaultTo(addressingProperties, participant, identifier);
         BusinessAgreementWithParticipantCompletionCoordinatorPortType port;
         port = getPort(endpoint, addressingProperties, closedAction);
         NotificationType closed = new NotificationType();
@@ -214,7 +231,8 @@
     public void sendCancelled(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
         throws SoapFault, IOException
     {
-        AddressingHelper.installFaultTo(addressingProperties, participantCompletionParticipant, identifier);
+        EndpointReference participant = getParticipant(endpoint);
+        AddressingHelper.installFaultTo(addressingProperties, participant, identifier);
         BusinessAgreementWithParticipantCompletionCoordinatorPortType port;
         port = getPort(endpoint, addressingProperties, cancelledAction);
         NotificationType cancelled = new NotificationType();
@@ -232,7 +250,8 @@
     public void sendExit(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
         throws SoapFault, IOException
     {
-        AddressingHelper.installFromFaultTo(addressingProperties, participantCompletionParticipant, identifier);
+        EndpointReference participant = getParticipant(endpoint);
+        AddressingHelper.installFromFaultTo(addressingProperties, participant, identifier);
         BusinessAgreementWithParticipantCompletionCoordinatorPortType port;
         port = getPort(endpoint, addressingProperties, exitAction);
         NotificationType exit = new NotificationType();
@@ -250,7 +269,8 @@
     public void sendCannotComplete(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
         throws SoapFault, IOException
     {
-        AddressingHelper.installFromFaultTo(addressingProperties, participantCompletionParticipant, identifier);
+        EndpointReference participant = getParticipant(endpoint);
+        AddressingHelper.installFromFaultTo(addressingProperties, participant, identifier);
         BusinessAgreementWithParticipantCompletionCoordinatorPortType port;
         port = getPort(endpoint, addressingProperties, cannotCompleteAction);
         NotificationType cannotComplete = new NotificationType();
@@ -268,7 +288,8 @@
     public void sendGetStatus(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
         throws SoapFault, IOException
     {
-        AddressingHelper.installFromFaultTo(addressingProperties, participantCompletionParticipant, identifier);
+        EndpointReference participant = getParticipant(endpoint);
+        AddressingHelper.installFromFaultTo(addressingProperties, participant, identifier);
         BusinessAgreementWithParticipantCompletionCoordinatorPortType port;
         port = getPort(endpoint, addressingProperties, getStatusAction);
         NotificationType getStatus = new NotificationType();
@@ -287,7 +308,8 @@
         final QName state)
         throws SoapFault, IOException
     {
-        AddressingHelper.installFromFaultTo(addressingProperties, participantCompletionParticipant, identifier);
+        EndpointReference participant = getParticipant(endpoint);
+        AddressingHelper.installFromFaultTo(addressingProperties, participant, identifier);
         BusinessAgreementWithParticipantCompletionCoordinatorPortType port;
         port = getPort(endpoint, addressingProperties, statusAction);
         StatusType status = new StatusType();
@@ -297,6 +319,21 @@
     }
 
     /**
+     * return a participant endpoint appropriate to the type of coordinator
+     * @param endpoint
+     * @return either the secure participant endpoint or the non-secure endpoint
+     */
+    EndpointReference getParticipant(W3CEndpointReference endpoint)
+    {
+        String address = endpoint.getAddress();
+        if (address.startsWith("https")) {
+            return secureParticipantCompletionParticipant;
+        } else {
+            return participantCompletionParticipant;
+        }
+    }
+
+    /**
      * Get the Completion Coordinator client singleton.
      * @return The Completion Coordinator client singleton.
      */

Modified: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/client/ParticipantCompletionParticipantClient.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/client/ParticipantCompletionParticipantClient.java	2009-02-05 08:06:04 UTC (rev 25116)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/client/ParticipantCompletionParticipantClient.java	2009-02-05 13:34:55 UTC (rev 25117)
@@ -90,8 +90,13 @@
     private EndpointReference participantCompletionCoordinator = null;
 
     /**
-     * Construct the participant completion coordinator client.
+     * The participant completion coordinator URI for secure replies.
      */
+    private EndpointReference secureParticipantCompletionCoordinator = null;
+
+    /**
+     * Construct the participant completion participant client.
+     */
     private ParticipantCompletionParticipantClient()
     {
         final AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
@@ -115,8 +120,16 @@
         // ClientPolicy.register(handlerRegistry) ;
 
         final String participantCompletionCoordinatorURIString =
-            ServiceRegistry.getRegistry().getServiceURI(BusinessActivityConstants.PARTICIPANT_COMPLETION_COORDINATOR_SERVICE_NAME) ;
+            ServiceRegistry.getRegistry().getServiceURI(BusinessActivityConstants.PARTICIPANT_COMPLETION_COORDINATOR_SERVICE_NAME, false) ;
+        final String secureParticipantCompletionCoordinatorURIString =
+            ServiceRegistry.getRegistry().getServiceURI(BusinessActivityConstants.PARTICIPANT_COMPLETION_COORDINATOR_SERVICE_NAME, true) ;
         try {
+            URI secureParticipantCompletionCoordinatorURI = new URI(secureParticipantCompletionCoordinatorURIString) ;
+            secureParticipantCompletionCoordinator = builder.newEndpointReference(secureParticipantCompletionCoordinatorURI);
+        } catch (URISyntaxException use) {
+            // TODO - log fault and throw exception
+        }
+        try {
             URI participantCompletionCoordinatorURI = new URI(participantCompletionCoordinatorURIString) ;
             participantCompletionCoordinator = builder.newEndpointReference(participantCompletionCoordinatorURI);
         } catch (URISyntaxException use) {
@@ -134,7 +147,8 @@
     public void sendClose(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
         throws SoapFault, IOException
     {
-        AddressingHelper.installFromFaultTo(addressingProperties, participantCompletionCoordinator, identifier);
+        EndpointReference coordinator = getCoordinator(endpoint);
+        AddressingHelper.installFromFaultTo(addressingProperties, coordinator, identifier);
         BusinessAgreementWithParticipantCompletionParticipantPortType port;
         port = getPort(endpoint, addressingProperties, closeAction);
         NotificationType close = new NotificationType();
@@ -152,7 +166,8 @@
     public void sendCancel(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
         throws SoapFault, IOException
     {
-        AddressingHelper.installFromFaultTo(addressingProperties, participantCompletionCoordinator, identifier);
+        EndpointReference coordinator = getCoordinator(endpoint);
+        AddressingHelper.installFromFaultTo(addressingProperties, coordinator, identifier);
         BusinessAgreementWithParticipantCompletionParticipantPortType port;
         port = getPort(endpoint, addressingProperties, cancelAction);
         NotificationType cancel = new NotificationType();
@@ -170,7 +185,8 @@
     public void sendCompensate(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
         throws SoapFault, IOException
     {
-        AddressingHelper.installFromFaultTo(addressingProperties, participantCompletionCoordinator, identifier);
+        EndpointReference coordinator = getCoordinator(endpoint);
+        AddressingHelper.installFromFaultTo(addressingProperties, coordinator, identifier);
         BusinessAgreementWithParticipantCompletionParticipantPortType port;
         port = getPort(endpoint, addressingProperties, compensateAction);
         NotificationType compensate = new NotificationType();
@@ -188,7 +204,8 @@
     public void sendFailed(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
         throws SoapFault, IOException
     {
-        AddressingHelper.installFaultTo(addressingProperties, participantCompletionCoordinator, identifier);
+        EndpointReference coordinator = getCoordinator(endpoint);
+        AddressingHelper.installFaultTo(addressingProperties, coordinator, identifier);
         BusinessAgreementWithParticipantCompletionParticipantPortType port;
         port = getPort(endpoint, addressingProperties, failedAction);
         NotificationType failed = new NotificationType();
@@ -206,7 +223,8 @@
     public void sendExited(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
         throws SoapFault, IOException
     {
-        AddressingHelper.installFaultTo(addressingProperties, participantCompletionCoordinator, identifier);
+        EndpointReference coordinator = getCoordinator(endpoint);
+        AddressingHelper.installFaultTo(addressingProperties, coordinator, identifier);
         BusinessAgreementWithParticipantCompletionParticipantPortType port;
         port = getPort(endpoint, addressingProperties, exitedAction);
         NotificationType exited = new NotificationType();
@@ -224,7 +242,8 @@
     public void sendNotCompleted(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
         throws SoapFault, IOException
     {
-        AddressingHelper.installFaultTo(addressingProperties, participantCompletionCoordinator, identifier);
+        EndpointReference coordinator = getCoordinator(endpoint);
+        AddressingHelper.installFaultTo(addressingProperties, coordinator, identifier);
         BusinessAgreementWithParticipantCompletionParticipantPortType port;
         port = getPort(endpoint, addressingProperties, notCompletedAction);
         NotificationType notCompleted = new NotificationType();
@@ -242,7 +261,8 @@
     public void sendGetStatus(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
         throws SoapFault, IOException
     {
-        AddressingHelper.installFromFaultTo(addressingProperties, participantCompletionCoordinator, identifier);
+        EndpointReference coordinator = getCoordinator(endpoint);
+        AddressingHelper.installFromFaultTo(addressingProperties, coordinator, identifier);
         BusinessAgreementWithParticipantCompletionParticipantPortType port;
         port = getPort(endpoint, addressingProperties, getStatusAction);
         NotificationType getStatus = new NotificationType();
@@ -261,7 +281,8 @@
         final QName state)
         throws SoapFault, IOException
     {
-        AddressingHelper.installFromFaultTo(addressingProperties, participantCompletionCoordinator, identifier);
+        EndpointReference coordinator = getCoordinator(endpoint);
+        AddressingHelper.installFromFaultTo(addressingProperties, coordinator, identifier);
         BusinessAgreementWithParticipantCompletionParticipantPortType port;
         port = getPort(endpoint, addressingProperties, statusAction);
         StatusType status = new StatusType();
@@ -270,6 +291,21 @@
         port.statusOperation(status);
     }
 
+    /**
+     * return a coordinator endpoint appropriate to the type of participant
+     * @param endpoint
+     * @return either the secure coordinator endpoint or the non-secure endpoint
+     */
+    EndpointReference getCoordinator(W3CEndpointReference endpoint)
+    {
+        String address = endpoint.getAddress();
+        if (address.startsWith("https")) {
+            return secureParticipantCompletionCoordinator;
+        } else {
+            return participantCompletionCoordinator;
+        }
+    }
+
    /**
      * Get the Completion Coordinator client singleton.
      * @return The Completion Coordinator client singleton.

Modified: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/server/CoordinatorCompletionCoordinatorInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/server/CoordinatorCompletionCoordinatorInitialisation.java	2009-02-05 08:06:04 UTC (rev 25116)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/server/CoordinatorCompletionCoordinatorInitialisation.java	2009-02-05 13:34:55 UTC (rev 25117)
@@ -55,10 +55,18 @@
                if (bindPort == null) {
                    bindPort = "8080";
                }
+
+               if (secureBindPort == null) {
+                   secureBindPort = "8443";
+               }
+
                final String baseUri = "http://" +  bindAddress + ":" + bindPort + "/ws-t11/";
                final String uri = baseUri + BusinessActivityConstants.COORDINATOR_COMPLETION_COORDINATOR_SERVICE_NAME;
+               final String secureBaseUri = "https://" +  bindAddress + ":" + secureBindPort + "/ws-t11/";
+               final String secureUri = secureBaseUri + BusinessActivityConstants.COORDINATOR_COMPLETION_COORDINATOR_SERVICE_NAME;
 
                serviceRegistry.registerServiceProvider(BusinessActivityConstants.COORDINATOR_COMPLETION_COORDINATOR_SERVICE_NAME, uri) ;
+               serviceRegistry.registerSecureServiceProvider(BusinessActivityConstants.COORDINATOR_COMPLETION_COORDINATOR_SERVICE_NAME, secureUri) ;
            }
         };
     }

Modified: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/server/CoordinatorCompletionParticipantInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/server/CoordinatorCompletionParticipantInitialisation.java	2009-02-05 08:06:04 UTC (rev 25116)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/server/CoordinatorCompletionParticipantInitialisation.java	2009-02-05 13:34:55 UTC (rev 25117)
@@ -55,10 +55,18 @@
                if (bindPort == null) {
                    bindPort = "8080";
                }
+
+               if (secureBindPort == null) {
+                   secureBindPort = "8443";
+               }
+
                final String baseUri = "http://" +  bindAddress + ":" + bindPort + "/ws-t11/";
                final String uri = baseUri + BusinessActivityConstants.COORDINATOR_COMPLETION_PARTICIPANT_SERVICE_NAME;
+               final String secureBaseUri = "https://" +  bindAddress + ":" + secureBindPort + "/ws-t11/";
+               final String secureUri = secureBaseUri + BusinessActivityConstants.COORDINATOR_COMPLETION_PARTICIPANT_SERVICE_NAME;
 
                serviceRegistry.registerServiceProvider(BusinessActivityConstants.COORDINATOR_COMPLETION_PARTICIPANT_SERVICE_NAME, uri) ;
+               serviceRegistry.registerSecureServiceProvider(BusinessActivityConstants.COORDINATOR_COMPLETION_PARTICIPANT_SERVICE_NAME, secureUri) ;
            }
         };
     }

Modified: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/server/ParticipantCompletionCoordinatorInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/server/ParticipantCompletionCoordinatorInitialisation.java	2009-02-05 08:06:04 UTC (rev 25116)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/server/ParticipantCompletionCoordinatorInitialisation.java	2009-02-05 13:34:55 UTC (rev 25117)
@@ -55,10 +55,18 @@
                if (bindPort == null) {
                    bindPort = "8080";
                }
+
+               if (secureBindPort == null) {
+                   secureBindPort = "8443";
+               }
+
                final String baseUri = "http://" +  bindAddress + ":" + bindPort + "/ws-t11/";
                final String uri = baseUri + BusinessActivityConstants.PARTICIPANT_COMPLETION_COORDINATOR_SERVICE_NAME;
+               final String secureBaseUri = "https://" +  bindAddress + ":" + secureBindPort + "/ws-t11/";
+               final String secureUri = secureBaseUri + BusinessActivityConstants.PARTICIPANT_COMPLETION_COORDINATOR_SERVICE_NAME;
 
                serviceRegistry.registerServiceProvider(BusinessActivityConstants.PARTICIPANT_COMPLETION_COORDINATOR_SERVICE_NAME, uri) ;
+               serviceRegistry.registerSecureServiceProvider(BusinessActivityConstants.PARTICIPANT_COMPLETION_COORDINATOR_SERVICE_NAME, secureUri) ;
            }
         };
     }

Modified: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/server/ParticipantCompletionParticipantInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/server/ParticipantCompletionParticipantInitialisation.java	2009-02-05 08:06:04 UTC (rev 25116)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/server/ParticipantCompletionParticipantInitialisation.java	2009-02-05 13:34:55 UTC (rev 25117)
@@ -55,10 +55,18 @@
                if (bindPort == null) {
                    bindPort = "8080";
                }
+
+               if (secureBindPort == null) {
+                   secureBindPort = "8443";
+               }
+
                final String baseUri = "http://" +  bindAddress + ":" + bindPort + "/ws-t11/";
                final String uri = baseUri + BusinessActivityConstants.PARTICIPANT_COMPLETION_PARTICIPANT_SERVICE_NAME;
+               final String secureBaseUri = "https://" +  bindAddress + ":" + secureBindPort + "/ws-t11/";
+               final String secureUri = secureBaseUri + BusinessActivityConstants.PARTICIPANT_COMPLETION_PARTICIPANT_SERVICE_NAME;
 
                serviceRegistry.registerServiceProvider(BusinessActivityConstants.PARTICIPANT_COMPLETION_PARTICIPANT_SERVICE_NAME, uri) ;
+               serviceRegistry.registerSecureServiceProvider(BusinessActivityConstants.PARTICIPANT_COMPLETION_PARTICIPANT_SERVICE_NAME, secureUri) ;
            }
         };
     }

Modified: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/common/Environment.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/common/Environment.java	2009-02-05 08:06:04 UTC (rev 25116)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/common/Environment.java	2009-02-05 13:34:55 UTC (rev 25117)
@@ -38,6 +38,7 @@
 {
 
     public static final String COORDINATOR_URL = "org.jboss.jbossts.xts.coordinatorURL";
+    public static final String COORDINATOR_SCHEME = "org.jboss.jbossts.xts.coordinator.scheme";
     public static final String COORDINATOR_HOST = "org.jboss.jbossts.xts.coordinator.host";
     public static final String COORDINATOR_PORT = "org.jboss.jbossts.xts.coordinator.port";
     public static final String COORDINATOR_PATH = "org.jboss.jbossts.xts.coordinator.path";

Modified: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/common/Environment.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/common/Environment.java	2009-02-05 08:06:04 UTC (rev 25116)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/common/Environment.java	2009-02-05 13:34:55 UTC (rev 25117)
@@ -38,6 +38,7 @@
 {
 
     public static final String COORDINATOR_URL = "org.jboss.jbossts.xts11.coordinatorURL";
+    public static final String COORDINATOR_SCHEME = "org.jboss.jbossts.xts11.coordinator.scheme";
     public static final String COORDINATOR_HOST = "org.jboss.jbossts.xts11.coordinator.host";
     public static final String COORDINATOR_PORT = "org.jboss.jbossts.xts11.coordinator.port";
     public static final String COORDINATOR_PATH = "org.jboss.jbossts.xts11.coordinator.path";

Modified: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/ContextFactoryImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/ContextFactoryImple.java	2009-02-05 08:06:04 UTC (rev 25116)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/ContextFactoryImple.java	2009-02-05 13:34:55 UTC (rev 25117)
@@ -122,7 +122,7 @@
 	 */
 
 	public CoordinationContext create (final String coordinationTypeURI, final Long expires,
-            final CoordinationContextType currentContext)
+            final CoordinationContextType currentContext, final boolean isSecure)
 			throws InvalidCreateParametersException
 	{
 		if (coordinationTypeURI.equals(AtomicTransactionConstants.WSAT_PROTOCOL))
@@ -149,7 +149,7 @@
 
                 final ArjunaContextImple arjunaContext = ArjunaContextImple.getContext() ;
                 final ServiceRegistry serviceRegistry = ServiceRegistry.getRegistry() ;
-                final String registrationCoordinatorURI = serviceRegistry.getServiceURI(CoordinationConstants.REGISTRATION_SERVICE_NAME) ;
+                final String registrationCoordinatorURI = serviceRegistry.getServiceURI(CoordinationConstants.REGISTRATION_SERVICE_NAME, isSecure) ;
 
                 final CoordinationContext coordinationContext = new CoordinationContext() ;
                 coordinationContext.setCoordinationType(coordinationTypeURI);
@@ -198,16 +198,16 @@
                     final String messageId = MessageId.getMessageId() ;
                     W3CEndpointReference participant;
                     W3CEndpointReference coordinator;
-                    participant= getParticipant(vtppid);
+                    participant= getParticipant(vtppid, isSecure);
                     coordinator = RegistrationCoordinator.register(currentContext, messageId, participant, AtomicTransactionConstants.WSAT_SUB_PROTOCOL_VOLATILE_2PC) ;
                     ParticipantProcessor.getProcessor().activateParticipant(new ParticipantEngine(vtpp, vtppid, coordinator), vtppid) ;
-                    participant= getParticipant(dtppid);
+                    participant= getParticipant(dtppid, isSecure);
                     coordinator = RegistrationCoordinator.register(currentContext, messageId, participant, AtomicTransactionConstants.WSAT_SUB_PROTOCOL_DURABLE_2PC) ;
                     ParticipantProcessor.getProcessor().activateParticipant(new ParticipantEngine(dtpp, dtppid, coordinator), dtppid) ;
 
                     // ok now create the context
                     final ServiceRegistry serviceRegistry = ServiceRegistry.getRegistry() ;
-                    final String registrationCoordinatorURI = serviceRegistry.getServiceURI(CoordinationConstants.REGISTRATION_SERVICE_NAME) ;
+                    final String registrationCoordinatorURI = serviceRegistry.getServiceURI(CoordinationConstants.REGISTRATION_SERVICE_NAME, isSecure) ;
 
                     final CoordinationContext coordinationContext = new CoordinationContext() ;
                     coordinationContext.setCoordinationType(coordinationTypeURI);
@@ -271,11 +271,11 @@
 		return null;
 	}
 
-    private W3CEndpointReference getParticipant(final String id)
+    private W3CEndpointReference getParticipant(final String id, final boolean isSecure)
     {
         final QName serviceName = AtomicTransactionConstants.PARTICIPANT_SERVICE_QNAME;
         final QName endpointName = AtomicTransactionConstants.PARTICIPANT_PORT_QNAME;
-        final String address = ServiceRegistry.getRegistry().getServiceURI(AtomicTransactionConstants.PARTICIPANT_SERVICE_NAME);
+        final String address = ServiceRegistry.getRegistry().getServiceURI(AtomicTransactionConstants.PARTICIPANT_SERVICE_NAME, isSecure);
         W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
         builder.serviceName(serviceName);
         builder.endpointName(endpointName);

Modified: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/RegistrarImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/RegistrarImple.java	2009-02-05 08:06:04 UTC (rev 25116)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/RegistrarImple.java	2009-02-05 13:34:55 UTC (rev 25117)
@@ -91,14 +91,14 @@
 	 * applicable. This needs updating!
 	 */
 	public W3CEndpointReference register(final W3CEndpointReference participantProtocolService,
-        final String protocolIdentifier, final InstanceIdentifier instanceIdentifier)
+        final String protocolIdentifier, final InstanceIdentifier instanceIdentifier, final boolean isSecure)
 			throws AlreadyRegisteredException, InvalidProtocolException,
             InvalidStateException, NoActivityException
 	{
 		Object tx = _hierarchies.get(instanceIdentifier.getInstanceIdentifier());
 
 		if (tx instanceof SubordinateCoordinator)
-			return registerWithSubordinate((SubordinateCoordinator)tx, participantProtocolService, protocolIdentifier);
+			return registerWithSubordinate((SubordinateCoordinator)tx, participantProtocolService, protocolIdentifier, isSecure);
 
 		ActivityHierarchy hier = (ActivityHierarchy) tx;
 
@@ -132,7 +132,7 @@
 
 				_coordManager.suspend();
 
-				return getCoordinator(participantId) ;
+				return getCoordinator(participantId, isSecure) ;
 			}
 			catch (Exception ex)
 			{
@@ -151,7 +151,7 @@
 
 				_coordManager.suspend();
 
-				return getCoordinator(participantId) ;
+				return getCoordinator(participantId, isSecure) ;
 			}
 			catch (Exception ex)
 			{
@@ -167,7 +167,7 @@
 
 				_coordManager.suspend();
 
-				return getCompletionCoordinator(instanceIdentifier) ;
+				return getCompletionCoordinator(instanceIdentifier, isSecure) ;
 			}
 			catch (Exception ex)
 			{
@@ -221,7 +221,8 @@
 	}
 
 	private final W3CEndpointReference registerWithSubordinate(final SubordinateCoordinator theTx,
-        final W3CEndpointReference participantProtocolService, final String protocolIdentifier)
+        final W3CEndpointReference participantProtocolService, final String protocolIdentifier,
+        final boolean isSecure)
 			throws AlreadyRegisteredException, InvalidProtocolException,
 			InvalidStateException, NoActivityException
     {
@@ -235,7 +236,7 @@
                 final Durable2PCStub participantStub = new Durable2PCStub(participantId, participantProtocolService) ;
                 theTx.enlistParticipant(new DurableTwoPhaseCommitParticipant(participantStub, participantId));
 
-                return getCoordinator(participantId) ;
+                return getCoordinator(participantId, isSecure) ;
             }
             catch (Exception ex)
             {
@@ -252,7 +253,7 @@
                 final Volatile2PCStub participantStub = new Volatile2PCStub(participantId, participantProtocolService) ;
                 theTx.enlistSynchronization(new VolatileTwoPhaseCommitParticipant(participantStub)) ;
 
-                return getCoordinator(participantId) ;
+                return getCoordinator(participantId, isSecure) ;
             }
             catch (Exception ex)
             {
@@ -274,10 +275,10 @@
 		}
 	}
 
-    private W3CEndpointReference getCompletionCoordinator(final InstanceIdentifier instanceIdentifier)
+    private W3CEndpointReference getCompletionCoordinator(final InstanceIdentifier instanceIdentifier, final boolean isSecure)
     {
         W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
-        String address = ServiceRegistry.getRegistry().getServiceURI(AtomicTransactionConstants.COMPLETION_COORDINATOR_SERVICE_NAME);
+        String address = ServiceRegistry.getRegistry().getServiceURI(AtomicTransactionConstants.COMPLETION_COORDINATOR_SERVICE_NAME, isSecure);
         builder.serviceName(AtomicTransactionConstants.COMPLETION_COORDINATOR_SERVICE_QNAME);
         builder.endpointName(AtomicTransactionConstants.COMPLETION_COORDINATOR_PORT_QNAME);
         builder.address(address);
@@ -285,10 +286,10 @@
         return builder.build();
     }
 
-    private W3CEndpointReference getCoordinator(final String participantId)
+    private W3CEndpointReference getCoordinator(final String participantId, final boolean isSecure)
     {
         W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
-        String address = ServiceRegistry.getRegistry().getServiceURI(AtomicTransactionConstants.COORDINATOR_SERVICE_NAME);
+        String address = ServiceRegistry.getRegistry().getServiceURI(AtomicTransactionConstants.COORDINATOR_SERVICE_NAME, isSecure);
         builder.serviceName(AtomicTransactionConstants.COORDINATOR_SERVICE_QNAME);
         builder.endpointName(AtomicTransactionConstants.COORDINATOR_PORT_QNAME);
         builder.address(address);

Modified: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/context/TxContextImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/context/TxContextImple.java	2009-02-05 08:06:04 UTC (rev 25116)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/context/TxContextImple.java	2009-02-05 13:34:55 UTC (rev 25117)
@@ -91,6 +91,16 @@
 		return _context.toString();
 	}
 
+    public boolean isSecure()
+    {
+        if (valid()) {
+            CoordinationContextType coordinationContextType = _context.getCoordinationContext();
+            String address = coordinationContextType.getRegistrationService().getAddress();
+            return address.startsWith("https");
+        }
+        return false;
+    }
+
 	private Context _context;
 
 }
\ No newline at end of file

Modified: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/remote/TransactionManagerImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/remote/TransactionManagerImple.java	2009-02-05 08:06:04 UTC (rev 25116)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/remote/TransactionManagerImple.java	2009-02-05 13:34:55 UTC (rev 25117)
@@ -38,7 +38,8 @@
     {
 		try
 		{
-			final W3CEndpointReference coordinator = registerParticipant(getParticipant(id), AtomicTransactionConstants.WSAT_SUB_PROTOCOL_DURABLE_2PC);
+            final W3CEndpointReference participant = getParticipant(id, isCurrentContextSecure());
+			final W3CEndpointReference coordinator = registerParticipant(participant, AtomicTransactionConstants.WSAT_SUB_PROTOCOL_DURABLE_2PC);
 
 			ParticipantProcessor.getProcessor().activateParticipant(new ParticipantEngine(tpp, id, coordinator), id) ;
 		}
@@ -62,7 +63,8 @@
 	{
 		try
 		{
-			final W3CEndpointReference coordinator = registerParticipant(getParticipant(id), AtomicTransactionConstants.WSAT_SUB_PROTOCOL_VOLATILE_2PC);
+            final W3CEndpointReference participant = getParticipant(id, isCurrentContextSecure());
+			final W3CEndpointReference coordinator = registerParticipant(participant, AtomicTransactionConstants.WSAT_SUB_PROTOCOL_VOLATILE_2PC);
 
 			ParticipantProcessor.getProcessor().activateParticipant(new ParticipantEngine(tpp, id, coordinator), id) ;
 		}
@@ -149,11 +151,20 @@
 		}
 	}
 
-    private W3CEndpointReference getParticipant(final String id)
+    private boolean isCurrentContextSecure()  throws SystemException
     {
+        TxContextImple currentTx = (TxContextImple) _ctxManager.currentTransaction();
+        if (currentTx != null) {
+            return currentTx.isSecure();
+        }
+        return false;
+    }
+
+    private W3CEndpointReference getParticipant(final String id, final boolean isSecure)
+    {
         final QName serviceName = AtomicTransactionConstants.PARTICIPANT_SERVICE_QNAME;
         final QName endpointName = AtomicTransactionConstants.PARTICIPANT_PORT_QNAME;
-        final String address = ServiceRegistry.getRegistry().getServiceURI(AtomicTransactionConstants.PARTICIPANT_SERVICE_NAME);
+        final String address = ServiceRegistry.getRegistry().getServiceURI(AtomicTransactionConstants.PARTICIPANT_SERVICE_NAME, isSecure);
         W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
         builder.serviceName(serviceName);
         builder.endpointName(endpointName);

Modified: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/remote/UserTransactionImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/remote/UserTransactionImple.java	2009-02-05 08:06:04 UTC (rev 25116)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/remote/UserTransactionImple.java	2009-02-05 13:34:55 UTC (rev 25117)
@@ -170,7 +170,7 @@
 
             final TxContextImple txContext = (TxContextImple) tm.currentTransaction();
             final String id = txContext.identifier();
-            final W3CEndpointReference completionCoordinator = tm.enlistForCompletion(getCompletionParticipant(id));
+            final W3CEndpointReference completionCoordinator = tm.enlistForCompletion(getCompletionParticipant(id, txContext.isSecure()));
 
 			_completionCoordinators.put(id, completionCoordinator);
 		}
@@ -366,11 +366,11 @@
      * @param id the current transaction context identifier
      * @return
      */
-    private W3CEndpointReference getCompletionParticipant(final String id)
+    private W3CEndpointReference getCompletionParticipant(final String id, final boolean isSecure)
     {
         final QName serviceName = AtomicTransactionConstants.COMPLETION_INITIATOR_SERVICE_QNAME;
         final QName endpointName = AtomicTransactionConstants.COMPLETION_INITIATOR_PORT_QNAME;
-        final String address = ServiceRegistry.getRegistry().getServiceURI(AtomicTransactionConstants.COMPLETION_INITIATOR_SERVICE_NAME);
+        final String address = ServiceRegistry.getRegistry().getServiceURI(AtomicTransactionConstants.COMPLETION_INITIATOR_SERVICE_NAME, isSecure);
         W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
         builder.serviceName(serviceName);
         builder.endpointName(endpointName);

Modified: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/ContextFactoryImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/ContextFactoryImple.java	2009-02-05 08:06:04 UTC (rev 25116)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/ContextFactoryImple.java	2009-02-05 13:34:55 UTC (rev 25117)
@@ -105,7 +105,7 @@
      */
 
     public CoordinationContext create (final String coordinationTypeURI,
-            final Long expires, final CoordinationContextType currentContext)
+            final Long expires, final CoordinationContextType currentContext, final boolean isSecure)
         throws InvalidCreateParametersException
     {
         if (BusinessActivityConstants.WSBA_PROTOCOL_ATOMIC_OUTCOME.equals(coordinationTypeURI))
@@ -131,7 +131,7 @@
 
             final ArjunaContextImple arjunaContext = ArjunaContextImple.getContext() ;
             final ServiceRegistry serviceRegistry = ServiceRegistry.getRegistry() ;
-            final String registrationCoordinatorURI = serviceRegistry.getServiceURI(CoordinationConstants.REGISTRATION_SERVICE_NAME) ;
+            final String registrationCoordinatorURI = serviceRegistry.getServiceURI(CoordinationConstants.REGISTRATION_SERVICE_NAME, isSecure) ;
 
             final CoordinationContext coordinationContext = new CoordinationContext() ;
             coordinationContext.setCoordinationType(coordinationTypeURI) ;

Modified: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/RegistrarImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/RegistrarImple.java	2009-02-05 08:06:04 UTC (rev 25116)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/RegistrarImple.java	2009-02-05 13:34:55 UTC (rev 25117)
@@ -118,7 +118,8 @@
 	public W3CEndpointReference register (
 			final W3CEndpointReference participantProtocolService,
 			final String protocolIdentifier,
-			final InstanceIdentifier instanceIdentifier)
+			final InstanceIdentifier instanceIdentifier,
+            final boolean isSecure)
 			throws AlreadyRegisteredException, InvalidProtocolException,
 			InvalidStateException, NoActivityException
 	{
@@ -162,7 +163,7 @@
 				return getParticipantManager(
                         BusinessActivityConstants.PARTICIPANT_COMPLETION_COORDINATOR_SERVICE_QNAME,
                         BusinessActivityConstants.PARTICIPANT_COMPLETION_COORDINATOR_PORT_QNAME,
-                        ServiceRegistry.getRegistry().getServiceURI(BusinessActivityConstants.PARTICIPANT_COMPLETION_COORDINATOR_SERVICE_NAME),
+                        ServiceRegistry.getRegistry().getServiceURI(BusinessActivityConstants.PARTICIPANT_COMPLETION_COORDINATOR_SERVICE_NAME, isSecure),
 						id);
 			}
 			catch (Exception ex)
@@ -189,7 +190,7 @@
 					return getParticipantManager(
                             BusinessActivityConstants.COORDINATOR_COMPLETION_COORDINATOR_SERVICE_QNAME,
 							BusinessActivityConstants.COORDINATOR_COMPLETION_COORDINATOR_PORT_QNAME,
-                            ServiceRegistry.getRegistry().getServiceURI(BusinessActivityConstants.COORDINATOR_COMPLETION_COORDINATOR_SERVICE_NAME),
+                            ServiceRegistry.getRegistry().getServiceURI(BusinessActivityConstants.COORDINATOR_COMPLETION_COORDINATOR_SERVICE_NAME, isSecure),
 							id);
 				}
 				catch (Exception ex)
@@ -212,7 +213,7 @@
                         return getParticipantManager(
                                 ArjunaTX11Constants.TERMINATION_COORDINATOR_SERVICE_QNAME,
 								ArjunaTX11Constants.TERMINATION_COORDINATOR_PORT_QNAME,
-                                ServiceRegistry.getRegistry().getServiceURI(ArjunaTX11Constants.TERMINATION_COORDINATOR_SERVICE_NAME),
+                                ServiceRegistry.getRegistry().getServiceURI(ArjunaTX11Constants.TERMINATION_COORDINATOR_SERVICE_NAME, isSecure),
                                 instanceIdentifier.getInstanceIdentifier());
 					}
 					catch (Exception ex)

Modified: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/context/TxContextImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/context/TxContextImple.java	2009-02-05 08:06:04 UTC (rev 25116)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/context/TxContextImple.java	2009-02-05 13:34:55 UTC (rev 25117)
@@ -91,6 +91,16 @@
         return _context.toString();
     }
 
+    public boolean isSecure()
+    {
+        if (valid()) {
+            CoordinationContextType coordinationContextType = _context.getCoordinationContext();
+            String address = coordinationContextType.getRegistrationService().getAddress();
+            return address.startsWith("https");
+        }
+        return false;
+    }
+
     private Context _context;
 
 }
\ No newline at end of file

Modified: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/remote/BusinessActivityManagerImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/remote/BusinessActivityManagerImple.java	2009-02-05 08:06:04 UTC (rev 25116)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/remote/BusinessActivityManagerImple.java	2009-02-05 13:34:55 UTC (rev 25117)
@@ -74,10 +74,11 @@
     {
         final QName service = BusinessActivityConstants.PARTICIPANT_COMPLETION_PARTICIPANT_SERVICE_QNAME;
         final QName endpoint = BusinessActivityConstants.PARTICIPANT_COMPLETION_PARTICIPANT_PORT_QNAME;
-        final String address = ServiceRegistry.getRegistry().getServiceURI(BusinessActivityConstants.PARTICIPANT_COMPLETION_PARTICIPANT_SERVICE_NAME);
-        final W3CEndpointReference participant = getParticipant(service, endpoint, address, id) ;
-    	try
-    	{
+        try
+        {
+            boolean isSecure = ((TxContextImple)currentTransaction()).isSecure();
+            final String address = ServiceRegistry.getRegistry().getServiceURI(BusinessActivityConstants.PARTICIPANT_COMPLETION_PARTICIPANT_SERVICE_NAME, isSecure);
+            final W3CEndpointReference participant = getParticipant(service, endpoint, address, id) ;
             W3CEndpointReference baPMEndpoint = registerParticipant(participant, BusinessActivityConstants.WSBA_SUB_PROTOCOL_PARTICIPANT_COMPLETION);
             final ParticipantCompletionParticipantEngine engine = new ParticipantCompletionParticipantEngine(id, baPMEndpoint, bap) ;
             ParticipantCompletionParticipantProcessor.getProcessor().activateParticipant(engine, id) ;
@@ -108,10 +109,11 @@
     {
         final QName service = BusinessActivityConstants.COORDINATOR_COMPLETION_PARTICIPANT_SERVICE_QNAME;
         final QName endpoint = BusinessActivityConstants.COORDINATOR_COMPLETION_PARTICIPANT_PORT_QNAME;
-        final String address = ServiceRegistry.getRegistry().getServiceURI(BusinessActivityConstants.COORDINATOR_COMPLETION_PARTICIPANT_SERVICE_NAME);
-        final W3CEndpointReference participant = getParticipant(service, endpoint, address, id) ;
-    	try
-    	{
+        boolean isSecure = ((TxContextImple)currentTransaction()).isSecure();
+        try
+        {
+            final String address = ServiceRegistry.getRegistry().getServiceURI(BusinessActivityConstants.COORDINATOR_COMPLETION_PARTICIPANT_SERVICE_NAME, isSecure);
+            final W3CEndpointReference participant = getParticipant(service, endpoint, address, id) ;
     	    W3CEndpointReference baPMEndpoint = registerParticipant(participant, BusinessActivityConstants.WSBA_SUB_PROTOCOL_COORDINATOR_COMPLETION);
             final CoordinatorCompletionParticipantEngine engine = new CoordinatorCompletionParticipantEngine(id, baPMEndpoint, bawcp) ;
             CoordinatorCompletionParticipantProcessor.getProcessor().activateParticipant(engine, id) ;

Modified: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/remote/UserBusinessActivityImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/remote/UserBusinessActivityImple.java	2009-02-05 08:06:04 UTC (rev 25116)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/remote/UserBusinessActivityImple.java	2009-02-05 13:34:55 UTC (rev 25117)
@@ -312,7 +312,7 @@
         try
         {
             return RegistrationCoordinator.register(coordinationContext, messageId,
-                getParticipantProtocolService(ctx.identifier()), com.arjuna.webservices.wsarjtx.ArjunaTXConstants.WSARJTX_PROTOCOL_TERMINATION) ;
+                getParticipantProtocolService(ctx.identifier(), ctx.isSecure()), com.arjuna.webservices.wsarjtx.ArjunaTXConstants.WSARJTX_PROTOCOL_TERMINATION) ;
         }
         catch (final Throwable th)
         {
@@ -320,13 +320,13 @@
         }
     }
 
-    private W3CEndpointReference getParticipantProtocolService(final String id)
+    private W3CEndpointReference getParticipantProtocolService(final String id, boolean isSecure)
     {
         // final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
         // final String serviceURI = soapRegistry.getServiceURI(ArjunaTX11Constants.SERVICE_TERMINATION_PARTICIPANT) ;
         final QName serviceId = ArjunaTX11Constants.TERMINATION_PARTICIPANT_SERVICE_QNAME;
         final QName endpointId = ArjunaTX11Constants.TERMINATION_PARTICIPANT_PORT_QNAME;
-        final String address = ServiceRegistry.getRegistry().getServiceURI(ArjunaTX11Constants.TERMINATION_PARTICIPANT_SERVICE_NAME);
+        final String address = ServiceRegistry.getRegistry().getServiceURI(ArjunaTX11Constants.TERMINATION_PARTICIPANT_SERVICE_NAME, isSecure);
         W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
         builder.serviceName(serviceId);
         builder.endpointName(endpointId);

Modified: labs/jbosstm/trunk/XTS/demo/src/com/jboss/jbosstm/xts/demo/client/BasicClient.java
===================================================================
--- labs/jbosstm/trunk/XTS/demo/src/com/jboss/jbosstm/xts/demo/client/BasicClient.java	2009-02-05 08:06:04 UTC (rev 25116)
+++ labs/jbosstm/trunk/XTS/demo/src/com/jboss/jbosstm/xts/demo/client/BasicClient.java	2009-02-05 13:34:55 UTC (rev 25117)
@@ -183,7 +183,7 @@
     private static final String TAXI_PREFIX = "taxi";
     /**
      * The local name for the AT Taxi webservice.
-     */
+     */                                       c
     private static final String TAXI_SERVICE_AT = "TaxiServiceATService";
     /**
      * The QName for the AT Taxi webservice.

Modified: labs/jbosstm/trunk/XTS/sar/src/org/jboss/jbossts/XTSService.java
===================================================================
--- labs/jbosstm/trunk/XTS/sar/src/org/jboss/jbossts/XTSService.java	2009-02-05 08:06:04 UTC (rev 25116)
+++ labs/jbosstm/trunk/XTS/sar/src/org/jboss/jbossts/XTSService.java	2009-02-05 13:34:55 UTC (rev 25117)
@@ -153,8 +153,13 @@
         // so we convert it here, then XTS internally convert it back later. sigh.
         // likewise for ints to Strings for hte port numbers.
 
-        String bindAddress = httpBindInetAddress.getHostAddress();
+        String bindAddress = httpBindInetAddress.getHostName();
 
+        if (bindAddress == null || "".equals(bindAddress)) {
+            // use the ip address instead of the name
+            bindAddress= httpBindInetAddress.getHostAddress();
+        }
+
         System.setProperty(com.arjuna.wsc.common.Environment.XTS_BIND_ADDRESS, bindAddress);
         System.setProperty(com.arjuna.wsc11.common.Environment.XTS_BIND_ADDRESS, bindAddress);
 
@@ -176,22 +181,30 @@
 
         if (System.getProperty(com.arjuna.wsc.common.Environment.XTS_COMMAND_LINE_COORDINATOR_URL) == null) {
             String coordinatorURL = System.getProperty(com.arjuna.mw.wst.common.Environment.COORDINATOR_URL);
+            String coordinatorScheme = System.getProperty(com.arjuna.mw.wst.common.Environment.COORDINATOR_SCHEME);
             String coordinatorHost = System.getProperty(com.arjuna.mw.wst.common.Environment.COORDINATOR_HOST);
             String coordinatorPort = System.getProperty(com.arjuna.mw.wst.common.Environment.COORDINATOR_PORT);
             String coordinatorPath = System.getProperty(com.arjuna.mw.wst.common.Environment.COORDINATOR_PATH);
             if (coordinatorURL != null) {
                 System.setProperty(com.arjuna.wsc.common.Environment.XTS_COMMAND_LINE_COORDINATOR_URL, coordinatorURL);
-            } else if (coordinatorHost != null || coordinatorPort != null || coordinatorPath != null) {
+            } else if (coordinatorScheme != null || coordinatorHost != null || coordinatorPort != null || coordinatorPath != null) {
+                if (coordinatorScheme == null) {
+                    coordinatorScheme = "http";
+                }
                 if (coordinatorHost == null) {
                     coordinatorHost = (bindAddress != null ? bindAddress : "127.0.0.1");
                 }
                 if (coordinatorPort == null) {
-                    coordinatorPort = (httpPort != 0 ? ""+httpPort : "8080");
+                    if ("https".equals(coordinatorScheme)) {
+                        coordinatorPort = (httpsPort != 0 ? ""+httpsPort : "8443");
+                    } else {
+                        coordinatorPort = (httpPort != 0 ? ""+httpPort : "8080");
+                    }
                 }
                 if (coordinatorPath == null) {
                     coordinatorPath = "ws-c10/soap/ActivationCoordinator";
                 }
-                coordinatorURL = "http://" + coordinatorHost + ":" + coordinatorPort + "/" + coordinatorPath;
+                coordinatorURL = coordinatorScheme + "://" + coordinatorHost + ":" + coordinatorPort + "/" + coordinatorPath;
                 System.setProperty(com.arjuna.wsc.common.Environment.XTS_COMMAND_LINE_COORDINATOR_URL, coordinatorURL);
                 System.setProperty(com.arjuna.mw.wst.common.Environment.COORDINATOR_URL, coordinatorURL);
             }
@@ -201,22 +214,30 @@
 
         if (System.getProperty(com.arjuna.wsc11.common.Environment.XTS_COMMAND_LINE_COORDINATOR_URL) == null) {
             String coordinatorURL = System.getProperty(com.arjuna.mw.wst11.common.Environment.COORDINATOR_URL);
+            String coordinatorScheme = System.getProperty(com.arjuna.mw.wst11.common.Environment.COORDINATOR_SCHEME);
             String coordinatorHost = System.getProperty(com.arjuna.mw.wst11.common.Environment.COORDINATOR_HOST);
             String coordinatorPort = System.getProperty(com.arjuna.mw.wst11.common.Environment.COORDINATOR_PORT);
             String coordinatorPath = System.getProperty(com.arjuna.mw.wst11.common.Environment.COORDINATOR_PATH);
             if (coordinatorURL != null) {
                 System.setProperty(com.arjuna.wsc11.common.Environment.XTS_COMMAND_LINE_COORDINATOR_URL, coordinatorURL);
-            } else if (coordinatorHost != null || coordinatorPort != null || coordinatorPath != null) {
+            } else if (coordinatorScheme != null || coordinatorHost != null || coordinatorPort != null || coordinatorPath != null) {
+                if (coordinatorScheme == null) {
+                    coordinatorScheme = "http";
+                }
                 if (coordinatorHost == null) {
                     coordinatorHost = (bindAddress != null ? bindAddress : "127.0.0.1");
                 }
                 if (coordinatorPort == null) {
-                    coordinatorPort = (httpPort != 0 ? ""+httpPort : "8080");
+                    if ("https".equals(coordinatorScheme)) {
+                        coordinatorPort = (httpsPort != 0 ? ""+httpsPort : "8443");
+                    } else {
+                        coordinatorPort = (httpPort != 0 ? ""+httpPort : "8080");
+                    }
                 }
                 if (coordinatorPath == null) {
                     coordinatorPath = "ws-c11/ActivationService";
                 }
-                coordinatorURL = "http://" + coordinatorHost + ":" + coordinatorPort + "/" + coordinatorPath;
+                coordinatorURL = coordinatorScheme + "://" + coordinatorHost + ":" + coordinatorPort + "/" + coordinatorPath;
                 System.setProperty(com.arjuna.wsc11.common.Environment.XTS_COMMAND_LINE_COORDINATOR_URL, coordinatorURL);
                 System.setProperty(com.arjuna.mw.wst11.common.Environment.COORDINATOR_URL, coordinatorURL);
             }




More information about the jboss-svn-commits mailing list