[jboss-svn-commits] JBL Code SVN: r18013 - in labs/jbosstm/workspace/adinn/XTSGF: WS-C/dev/src/com/arjuna/webservices/wsarj and 39 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Mon Jan 21 12:06:40 EST 2008


Author: adinn
Date: 2008-01-21 12:06:39 -0500 (Mon, 21 Jan 2008)
New Revision: 18013

Added:
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsarjtx/client/WSARJTXClientWS.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsat/client/WSATClientWS.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsba/client/WSBAClientWS.java
   labs/jbosstm/workspace/adinn/XTSGF/demo/dd/jboss/context-handlers11.xml
Modified:
   labs/jbosstm/workspace/adinn/XTSGF/WS-C/dev/src/com/arjuna/webservices/wsaddrws/AddressingHelper.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-C/dev/src/com/arjuna/webservices/wsarj/ArjunaContextWS.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-C/dev/src/com/arjuna/webservices/wsarj/handler/InstanceIdentifierHandlerWS.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-C/dev/src/com/arjuna/webservices/wscoor/CoordinationConstantsWS.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-C/dev/src/com/arjuna/webservices/wscoor/client/WSCOORClientWS.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-C/dev/src/com/arjuna/webservices/wscoor/sei/RegistrationPortTypeImpl.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-C/dev/src/com/arjuna/wsc/ActivationCoordinatorWS.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-C/dev/src/com/arjuna/wsc/RegistrationCoordinatorWS.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-C/dev/src/com/arjuna/wsc/messaging/ActivationCoordinatorProcessorWSImpl.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-C/dev/src/com/arjuna/wsc/messaging/RegistrationCoordinatorProcessorWSImpl.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/dd/wsarjtx/wsdl/wsarjtx-termination-coordinator-binding.wsdl
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/dd/wsarjtx/wsdl/wsarjtx-termination-participant-binding.wsdl
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/dd/wscoor1.1/wsdl/wsat-binding.wsdl
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/dd/wscoor1.1/wsdl/wsat-coordinator-binding.wsdl
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsarjtx/client/TerminationCoordinatorClientWS.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsarjtx/client/TerminationParticipantClientWS.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsarjtx/processors/TerminationCoordinatorProcessorWS.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsarjtx/sei/TerminationCoordinatorPortTypeImpl.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsarjtx/sei/TerminationParticipantPortTypeImpl.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsarjtx/server/TerminationParticipantInitialisation.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsarjtx/server/TerminationParticipantWSInitialisation.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsat/AtomicTransactionWSConstants.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsat/client/CompletionCoordinatorClientWS.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsat/client/CompletionInitiatorClientWS.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsat/client/CoordinatorClientWS.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsat/client/ParticipantClientWS.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsat/sei/CompletionCoordinatorPortTypeImpl.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsat/sei/CompletionInitiatorPortTypeImpl.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsat/sei/CoordinatorPortTypeImpl.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsat/sei/ParticipantPortTypeImpl.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsba/StateWS.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsba/client/CoordinatorCompletionCoordinatorClientWS.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsba/client/CoordinatorCompletionParticipantClientWS.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsba/client/ParticipantCompletionCoordinatorClientWS.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsba/client/ParticipantCompletionParticipantClientWS.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsba/processors/CoordinatorCompletionParticipantProcessorWS.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsba/processors/ParticipantCompletionCoordinatorProcessorWS.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsba/processors/ParticipantCompletionParticipantProcessorWS.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsba/sei/BusinessAgreementWithCoordinatorCompletionCoordinatorPortTypeImpl.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsba/sei/BusinessAgreementWithCoordinatorCompletionParticipantPortTypeImpl.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsba/sei/BusinessAgreementWithParticipantCompletionCoordinatorPortTypeImpl.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsba/sei/BusinessAgreementWithParticipantCompletionParticipantPortTypeImpl.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/BusinessActivityTerminatorWS.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/CompletionCoordinatorProcessorWSImpl.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/CoordinatorCompletionCoordinatorProcessorWSImpl.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/CoordinatorCompletionParticipantProcessorWSImpl.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/CoordinatorProcessorWSImpl.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/ParticipantCompletionCoordinatorProcessorWSImpl.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/ParticipantCompletionParticipantProcessorWSImpl.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/ParticipantProcessorWSImpl.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/TerminationCoordinatorProcessorWSImpl.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/deploy/TransactionWSInitialisation.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/engines/CoordinatorCompletionCoordinatorEngineWS.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/engines/CoordinatorCompletionParticipantEngineWS.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/engines/CoordinatorEngineWS.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/engines/ParticipantCompletionCoordinatorEngineWS.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/engines/ParticipantCompletionParticipantEngineWS.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/engines/ParticipantEngineWS.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/stub/BusinessActivityTerminatorStubWS.java
   labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/stub/CompletionStubWS.java
   labs/jbosstm/workspace/adinn/XTSGF/WSTX/classes/com/arjuna/mw/wst/client/JaxBaseHeaderContextProcessorWS.java
   labs/jbosstm/workspace/adinn/XTSGF/WSTX/classes/com/arjuna/mw/wst/common/CoordinationContextHelperWS.java
   labs/jbosstm/workspace/adinn/XTSGF/WSTX/classes/com/arjuna/mwlabs/wst/at/ContextFactoryWSImple.java
   labs/jbosstm/workspace/adinn/XTSGF/WSTX/classes/com/arjuna/mwlabs/wst/at/RegistrarWSImple.java
   labs/jbosstm/workspace/adinn/XTSGF/WSTX/classes/com/arjuna/mwlabs/wst/at/context/ArjunaContextWSImple.java
   labs/jbosstm/workspace/adinn/XTSGF/WSTX/classes/com/arjuna/mwlabs/wst/at/remote/TransactionManagerWSImple.java
   labs/jbosstm/workspace/adinn/XTSGF/WSTX/classes/com/arjuna/mwlabs/wst/ba/BusinessActivityTerminatorWSImple.java
   labs/jbosstm/workspace/adinn/XTSGF/WSTX/classes/com/arjuna/mwlabs/wst/ba/ContextFactoryWSImple.java
   labs/jbosstm/workspace/adinn/XTSGF/WSTX/classes/com/arjuna/mwlabs/wst/ba/RegistrarWSImple.java
   labs/jbosstm/workspace/adinn/XTSGF/WSTX/classes/com/arjuna/mwlabs/wst/ba/context/ArjunaContextWSImple.java
   labs/jbosstm/workspace/adinn/XTSGF/WSTX/classes/com/arjuna/mwlabs/wst/ba/remote/BusinessActivityManagerWSImple.java
   labs/jbosstm/workspace/adinn/XTSGF/WSTX/classes/com/arjuna/mwlabs/wst/ba/remote/UserBusinessActivityWSImple.java
   labs/jbosstm/workspace/adinn/XTSGF/demo/src/com/jboss/jbosstm/xts/demo/client/BasicClient.java
   labs/jbosstm/workspace/adinn/XTSGF/demo/src/com/jboss/jbosstm/xts/demo/services/restaurant/RestaurantServiceAT.java
   labs/jbosstm/workspace/adinn/XTSGF/demo/src/com/jboss/jbosstm/xts/demo/services/restaurant/RestaurantServiceBA.java
   labs/jbosstm/workspace/adinn/XTSGF/demo/src/com/jboss/jbosstm/xts/demo/services/taxi/TaxiServiceAT.java
   labs/jbosstm/workspace/adinn/XTSGF/demo/src/com/jboss/jbosstm/xts/demo/services/taxi/TaxiServiceBA.java
   labs/jbosstm/workspace/adinn/XTSGF/demo/src/com/jboss/jbosstm/xts/demo/services/theatre/TheatreServiceAT.java
   labs/jbosstm/workspace/adinn/XTSGF/demo/src/com/jboss/jbosstm/xts/demo/services/theatre/TheatreServiceBA.java
   labs/jbosstm/workspace/adinn/XTSGF/demo/xts-build.xml
   labs/jbosstm/workspace/adinn/XTSGF/ext/wsbrew.jar
Log:
a version which deploys and works on glassfish 2.0 (v2-b58g)!

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-C/dev/src/com/arjuna/webservices/wsaddrws/AddressingHelper.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-C/dev/src/com/arjuna/webservices/wsaddrws/AddressingHelper.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-C/dev/src/com/arjuna/webservices/wsaddrws/AddressingHelper.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -1,6 +1,7 @@
 package com.arjuna.webservices.wsaddrws;
 
 import com.arjuna.wsc.messaging.MessageId;
+import com.arjuna.wsc.messaging.MessageIdWS;
 
 import javax.xml.ws.addressing.AddressingBuilder;
 import javax.xml.ws.addressing.AddressingProperties;
@@ -86,7 +87,7 @@
         } else {
             // client does not care about id but we have to set some id or WSA will complain
 
-            final String dummyID = MessageId.getMessageId();
+            final String dummyID = MessageIdWS.getMessageId();
 
             requestProperties.setMessageID(makeURI(builder, dummyID));
         }
@@ -94,6 +95,36 @@
     }
 
     /**
+     * Create an addressing context that represents a request to the specified address.
+     * @param address TheendpointReference target address.
+     * @param messageID The message id of the new message.
+     * @param action The action of the new message.
+     * @return The addressing context.
+     *
+     * N.B. Still need to do From, Action, ReplyTo, FaultTo if needed.
+     */
+    public static AddressingProperties createRequestContext(final String address, final String action, final String messageID)
+    {
+        // create this each time so it uses the current thread classloader
+        // this allows the builder class to be redefined via a property
+        AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
+        final AddressingProperties requestProperties = builder.newAddressingProperties();
+        requestProperties.setTo(makeURI(builder, address));
+        if (messageID != null) {
+            requestProperties.setMessageID(makeURI(builder, messageID));
+        } else {
+            // client does not care about id but we have to set some id or WSA will complain
+
+            final String dummyID = MessageIdWS.getMessageId();
+
+            requestProperties.setMessageID(makeURI(builder, dummyID));
+        }
+        requestProperties.setAction(makeURI(builder, action));
+
+        return requestProperties;
+    }
+
+    /**
      * Create an addressing context that represents a notification to the specified context.
      * @param addressingProperties The addressing properties used to derive the notification addressing context.
      * @param messageID The message id of the new message.

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-C/dev/src/com/arjuna/webservices/wsarj/ArjunaContextWS.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-C/dev/src/com/arjuna/webservices/wsarj/ArjunaContextWS.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-C/dev/src/com/arjuna/webservices/wsarj/ArjunaContextWS.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -76,6 +76,7 @@
         }
         final ArjunaContextWS newContext = new ArjunaContextWS() ;
         messageContext.put(ARJUNAWS_CONTEXT_PROPERTY, newContext) ;
+        messageContext.setScope(ARJUNAWS_CONTEXT_PROPERTY, MessageContext.Scope.APPLICATION);
         return newContext ;
     }
 }

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-C/dev/src/com/arjuna/webservices/wsarj/handler/InstanceIdentifierHandlerWS.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-C/dev/src/com/arjuna/webservices/wsarj/handler/InstanceIdentifierHandlerWS.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-C/dev/src/com/arjuna/webservices/wsarj/handler/InstanceIdentifierHandlerWS.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -126,7 +126,7 @@
             while (iterator.hasNext()) {
                 final SOAPHeaderElement headerElement = iterator.next();
                 if (ArjunaConstants.WSARJ_ELEMENT_INSTANCE_IDENTIFIER_QNAME.equals(headerElement.getElementQName())) {
-                    // found it - clear te must understand flag, retrieve the value and store an arjuna
+                    // found it - clear the must understand flag, retrieve the value and store an arjuna
                     // context in the message context
                     headerElement.setMustUnderstand(false);
                     String identifierString = headerElement.getValue();

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-C/dev/src/com/arjuna/webservices/wscoor/CoordinationConstantsWS.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-C/dev/src/com/arjuna/webservices/wscoor/CoordinationConstantsWS.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-C/dev/src/com/arjuna/webservices/wscoor/CoordinationConstantsWS.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -236,4 +236,12 @@
      * The NoActivity error code QName.
      */
     public QName WSCOOR_ERROR_CODE_NO_ACTIVITY_QNAME = new QName(WSCOOR_NAMESPACE, WSCOOR_ERROR_CODE_NO_ACTIVITY, WSCOOR_PREFIX) ;
+    /**
+     * The unexpected exception error code.
+     */
+    public String WSCOOR_ERROR_CODE_EXCEPTION = "Exception" ;
+    /**
+     * The NoActivity error code QName.
+     */
+    public QName WSCOOR_ERROR_CODE_EXCEPTION_QNAME = new QName(WSCOOR_NAMESPACE, WSCOOR_ERROR_CODE_EXCEPTION, WSCOOR_PREFIX) ;
 }

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-C/dev/src/com/arjuna/webservices/wscoor/client/WSCOORClientWS.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-C/dev/src/com/arjuna/webservices/wscoor/client/WSCOORClientWS.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-C/dev/src/com/arjuna/webservices/wscoor/client/WSCOORClientWS.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -1,8 +1,12 @@
 package com.arjuna.webservices.wscoor.client;
 
 import com.arjuna.webservices.wsarj.handler.InstanceIdentifierHandlerWS;
+import com.arjuna.webservices.wsaddrws.AddressingHelper;
 import org.jboss.ws.extensions.addressing.jaxws.WSAddressingClientHandler;
-import org.oasis_open.docs.ws_tx.wscoor._2006._06.*;
+import org.oasis_open.docs.ws_tx.wscoor._2006._06.ActivationPortType;
+import org.oasis_open.docs.ws_tx.wscoor._2006._06.ActivationService;
+import org.oasis_open.docs.ws_tx.wscoor._2006._06.RegistrationPortType;
+import org.oasis_open.docs.ws_tx.wscoor._2006._06.RegistrationService;
 
 import javax.xml.ws.BindingProvider;
 import javax.xml.ws.addressing.AddressingBuilder;
@@ -10,6 +14,8 @@
 import javax.xml.ws.addressing.AttributedURI;
 import javax.xml.ws.addressing.JAXWSAConstants;
 import javax.xml.ws.handler.Handler;
+import javax.xml.ws.soap.AddressingFeature;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
 import java.net.URISyntaxException;
 import java.util.ArrayList;
 import java.util.List;
@@ -24,6 +30,7 @@
  */
 public class WSCOORClientWS
 {
+    // TODO -- do we really need a thread local here or can we just use one service?
     /**
      *  thread local which maintains a per thread activation service instance
      */
@@ -43,7 +50,7 @@
      * fetch a coordinator activation service unique to the current thread
      * @return
      */
-    private static ActivationService getActivationService()
+    private static synchronized ActivationService getActivationService()
     {
         if (activationService.get() == null) {
             activationService.set(new ActivationService());
@@ -55,7 +62,7 @@
      * fetch a coordinator registration service unique to the current thread
      * @return
      */
-    private static RegistrationService getRegistrationService()
+    private static synchronized RegistrationService getRegistrationService()
     {
         if (registrationService.get() == null) {
             registrationService.set(new RegistrationService());
@@ -69,16 +76,15 @@
         // TODO - we need the 2.1 verison of Service so we can specify that we want to use the WS Addressing feature
         // JBossWs implements it on Service21, a subclass of Service, and our generated service inherots from Service.
         ActivationService service = getActivationService();
-        // ActivationPortType port = service.getPort(ActivationPortType.class, new AddressingFeature(true, true));
-        // TODO - can we implement this by using a W3CEndpointreference? Yes, if we use the To address in props
-        ActivationPortType port = service.getPort(ActivationPortType.class);
+        // ActivationPortType port = service.getPort(ActivationPortType.class);
+        ActivationPortType port = service.getPort(ActivationPortType.class, new AddressingFeature(true, true));
         BindingProvider bindingProvider = (BindingProvider)port;
         AttributedURI toUri = addressingProperties.getTo();
         /*
          * we don't actually need to configure an instance identifier handler for this port -- it's the only one
          * on which we do not need to pass implicit context data either outgoing or returning.
-         * But we do have to add the the WSAdressing client handler to get round the fact that we cannot specify the
-         * WS AddressingFeature when we create the service
+         * But we do have to add the the WSAdressing client handler to ensure that the addressing properties
+         * are encoded into the SOAP message
          */
         List<Handler> customHandlerChain = new ArrayList<Handler>();
 		customHandlerChain.add(new WSAddressingClientHandler());
@@ -103,43 +109,29 @@
 
     // don't think we ever need this as we get a registration port from the endpoint ref returned by
     // the activation port request
-    public static RegistrationPortType getRegistrationPort(AddressingProperties addressingProperties,
-                                                           String action)
+    public static RegistrationPortType getRegistrationPort(W3CEndpointReference endpointReference, String action, String messageID)
     {
-        // TODO - we need the 2.1 verison of Service so we can specify that we want to use the WS Addressing feature
-        // JBossWs implements it on Service21, a subclass of Service, and our generated service inherots from Service.
         RegistrationService service = getRegistrationService();
-        // RegistrationPortType port = service.getPort(RegistrationPortType.class, new AddressingFeature(true, true));
-        RegistrationPortType port = service.getPort(RegistrationPortType.class);
+        RegistrationPortType port = service.getPort(endpointReference, RegistrationPortType.class, new AddressingFeature(true, true));
         BindingProvider bindingProvider = (BindingProvider)port;
-        AttributedURI toUri = addressingProperties.getTo();
         /*
-         * we need to install an instance identifier handler for this port so that we impliclty pass and return
-         * context data
-         * we also have to add the the WSAdressing client handler to get round the fact that we cannot specify the
-         * WS AddressingFeature when we create the service
+         * we need to configure an instance identifier handler for this port to pass the tx context either
+         * outgoing or returning. We also have to add the the WSAdressing client handler to ensure that the
+         * addressing properties are encoded into the SOAP message
          */
         List<Handler> customHandlerChain = new ArrayList<Handler>();
-		customHandlerChain.add(new InstanceIdentifierHandlerWS());
+        customHandlerChain.add(new InstanceIdentifierHandlerWS());
         customHandlerChain.add(new WSAddressingClientHandler());
 		bindingProvider.getBinding().setHandlerChain(customHandlerChain);
-
+        // the address will have been pulled out of the endpoint by getPort but we still have to set it in the
+        // addressing properties along with the action and message id
         Map<String, Object> requestContext = bindingProvider.getRequestContext();
-	    requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES, addressingProperties);
+        String address = (String)requestContext.get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
+        AddressingProperties addressingProperties = AddressingHelper.createRequestContext(address, action, messageID);
+        requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES, addressingProperties);
 	    // jbossws should do this for us . . .
 	    requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, addressingProperties);
-        requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, toUri.toString());
 
-        try {
-            addressingProperties.setAction(builder.newURI(action));
-        } catch (URISyntaxException use) {
-            // TODO log this error
-        }
-
-        // TODO we should not need to do this?
-        requestContext.put(BindingProvider.SOAPACTION_USE_PROPERTY, new Boolean(true));
-        requestContext.put(BindingProvider.SOAPACTION_URI_PROPERTY, action);
-
         return port;
     }
 }

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-C/dev/src/com/arjuna/webservices/wscoor/sei/RegistrationPortTypeImpl.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-C/dev/src/com/arjuna/webservices/wscoor/sei/RegistrationPortTypeImpl.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-C/dev/src/com/arjuna/webservices/wscoor/sei/RegistrationPortTypeImpl.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -50,7 +50,7 @@
         MessageContext ctx = webServiceCtx.getMessageContext();
         AddressingProperties inboundAddressProperties
             = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
-        final ArjunaContextWS arjunaContext = ArjunaContextWS.getContext(ctx) ;
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx) ;
 
         return RegistrationCoordinatorProcessorWS.getCoordinator().register(parameters, inboundAddressProperties, arjunaContext);
 

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-C/dev/src/com/arjuna/wsc/ActivationCoordinatorWS.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-C/dev/src/com/arjuna/wsc/ActivationCoordinatorWS.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-C/dev/src/com/arjuna/wsc/ActivationCoordinatorWS.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -64,10 +64,7 @@
         
         final Expires expiresValue;
         if (expires == null) {
-            // expiresValue = null;
-            expiresValue = new Expires();
-            expiresValue.setValue((long)Integer.MAX_VALUE
-            );
+            expiresValue = null;
         } else {
             expiresValue = new Expires();
             expiresValue.setValue(expires.longValue());
@@ -89,14 +86,9 @@
             final QName subcode = soapFault.getFaultCodeAsQName() ;
             if (CoordinationConstantsWS.WSCOOR_ERROR_CODE_INVALID_PARAMETERS_QNAME.equals(subcode))
             {
-                try {
-                    String reasonText = soapFault.getFaultReasonText(null);
-                    throw new InvalidCreateParametersException(reasonText);
-                } catch (SOAPException se) {
-                    throw new SoapFault(se);
-                }
+                throw new InvalidCreateParametersException(soapFault.getFaultString());
             }
-            throw new SoapFault(sfe) ;
+            throw new SoapFault(sfe);
         }
     }
 }

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-C/dev/src/com/arjuna/wsc/RegistrationCoordinatorWS.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-C/dev/src/com/arjuna/wsc/RegistrationCoordinatorWS.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-C/dev/src/com/arjuna/wsc/RegistrationCoordinatorWS.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -1,19 +1,29 @@
 package com.arjuna.wsc;
 
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.wsarj.handler.InstanceIdentifierHandlerWS;
+import com.arjuna.webservices.wsaddrws.AddressingHelper;
 import com.arjuna.webservices.wscoor.CoordinationConstantsWS;
-import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.wscoor.client.WSCOORClientWS;
+import org.oasis_open.docs.ws_tx.wscoor._2006._06.*;
+import org.jboss.ws.extensions.addressing.jaxws.WSAddressingClientHandler;
 
 import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPFault;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.JAXWSAConstants;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.Handler;
+import javax.xml.ws.soap.AddressingFeature;
+import javax.xml.ws.soap.SOAPFaultException;
 import javax.xml.ws.wsaddressing.W3CEndpointReference;
-import javax.xml.ws.soap.SOAPFaultException;
-import javax.xml.soap.SOAPFault;
-import javax.xml.soap.SOAPException;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.net.URISyntaxException;
 
-import org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContextType;
-import org.oasis_open.docs.ws_tx.wscoor._2006._06.RegisterResponseType;
-import org.oasis_open.docs.ws_tx.wscoor._2006._06.RegistrationPortType;
-import org.oasis_open.docs.ws_tx.wscoor._2006._06.RegisterType;
-
 /**
  * Wrapper around low level Registration Coordinator messaging.
  * @author kevin
@@ -48,35 +58,30 @@
 
             registerType.setProtocolIdentifier(protocolIdentifier);
             registerType.setParticipantProtocolService(participantProtocolService);
-            // TODO - set the message id for the call in the addressing properties attached to the port
-            RegistrationPortType port = endpointReference.getPort(RegistrationPortType.class);
+            RegistrationPortType port = WSCOORClientWS.getRegistrationPort(endpointReference, CoordinationConstantsWS.WSCOOR_ACTION_REGISTER, messageID);
             response = port.registerOperation(registerType);
             return response.getCoordinatorProtocolService();
         } catch (SOAPFaultException sfe) {
-            try {
-                // TODO -- work out which faults we should really throw. in particular do we need to retain SoapFault
-                final SOAPFault soapFault = sfe.getFault() ;
-                final QName subcode = soapFault.getFaultCodeAsQName() ;
-                if (CoordinationConstantsWS.WSCOOR_ERROR_CODE_ALREADY_REGISTERED_QNAME.equals(subcode))
-                {
-                    throw new AlreadyRegisteredException(soapFault.getFaultReasonText(null)) ;
-                }
-                else if (CoordinationConstantsWS.WSCOOR_ERROR_CODE_INVALID_PROTOCOL_QNAME.equals(subcode))
-                {
-                    throw new InvalidProtocolException(soapFault.getFaultReasonText(null)) ;
-                }
-                else if (CoordinationConstantsWS.WSCOOR_ERROR_CODE_INVALID_STATE_QNAME.equals(subcode))
-                {
-                    throw new InvalidStateException(soapFault.getFaultReasonText(null)) ;
-                }
-                else if (CoordinationConstantsWS.WSCOOR_ERROR_CODE_NO_ACTIVITY_QNAME.equals(subcode))
-                {
-                    throw new NoActivityException(soapFault.getFaultReasonText(null)) ;
-                }
-            } catch (SOAPException se) {
-                throw new SoapFault(se);
+            // TODO -- work out which faults we should really throw. in particular do we need to retain SoapFault
+            final SOAPFault soapFault = sfe.getFault() ;
+            final QName subcode = soapFault.getFaultCodeAsQName() ;
+            if (CoordinationConstantsWS.WSCOOR_ERROR_CODE_ALREADY_REGISTERED_QNAME.equals(subcode))
+            {
+                throw new AlreadyRegisteredException(soapFault.getFaultString()) ;
             }
-            throw new SoapFault(sfe) ;
+            else if (CoordinationConstantsWS.WSCOOR_ERROR_CODE_INVALID_PROTOCOL_QNAME.equals(subcode))
+            {
+                throw new InvalidProtocolException(soapFault.getFaultString()) ;
+            }
+            else if (CoordinationConstantsWS.WSCOOR_ERROR_CODE_INVALID_STATE_QNAME.equals(subcode))
+            {
+                throw new InvalidStateException(soapFault.getFaultString()) ;
+            }
+            else if (CoordinationConstantsWS.WSCOOR_ERROR_CODE_NO_ACTIVITY_QNAME.equals(subcode))
+            {
+                throw new NoActivityException(soapFault.getFaultString()) ;
+            }
+            throw new SoapFault(sfe);
         }
     }
 }

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-C/dev/src/com/arjuna/wsc/messaging/ActivationCoordinatorProcessorWSImpl.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-C/dev/src/com/arjuna/wsc/messaging/ActivationCoordinatorProcessorWSImpl.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-C/dev/src/com/arjuna/wsc/messaging/ActivationCoordinatorProcessorWSImpl.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -22,6 +22,7 @@
 
 import com.arjuna.webservices.logging.WSCLogger;
 import com.arjuna.webservices.wscoor.CoordinationConstants;
+import com.arjuna.webservices.wscoor.CoordinationConstantsWS;
 import com.arjuna.webservices.wscoor.processors.ActivationCoordinatorProcessorWS;
 import com.arjuna.webservices.SoapFaultType;
 import com.arjuna.wsc.ContextFactoryWS;
@@ -46,7 +47,7 @@
      * Create the coordination context.
      * @param createCoordinationContext The create coordination context request.
      * @param addressingProperties The addressing context.
-     * @message com.arjuna.wsc.messaging.ActivationCoordinatorWSWSProcessorImpl_1 [com.arjuna.wsc.messaging.ActivationCoordinatorWSProcessorImpl_1] - Invalid create coordination context parameters
+     * @message com.arjuna.wsc.messaging.ActivationCoordinatorWSProcessorImpl_1 [com.arjuna.wsc.messaging.ActivationCoordinatorWSProcessorImpl_1] - Invalid create coordination context parameters
      * @message com.arjuna.wsc.messaging.ActivationCoordinatorWSProcessorImpl_2 [com.arjuna.wsc.messaging.ActivationCoordinatorWSProcessorImpl_2] - Unexpected exception thrown from create:
      * @message com.arjuna.wsc.messaging.ActivationCoordinatorWSProcessorImpl_3 [com.arjuna.wsc.messaging.ActivationCoordinatorWSProcessorImpl_3] - CreateCoordinationContext called for unknown coordination type: {0}
      */
@@ -77,7 +78,7 @@
                 {
 	                SOAPFactory factory = SOAPFactory.newInstance();
                     SOAPFault soapFault = factory.createFault(SoapFaultType.FAULT_SENDER.getValue(), CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_PARAMETERS_QNAME);
-                    WSCLogger.log_mesg.getString("com.arjuna.wsc.messaging.ActivationCoordinatorWSProcessorImpl_1") ;
+                    soapFault.addDetail().addDetailEntry(CoordinationConstantsWS.WSCOOR_ERROR_CODE_INVALID_PARAMETERS_QNAME).addTextNode(WSCLogger.log_mesg.getString("com.arjuna.wsc.messaging.ActivationCoordinatorWSProcessorImpl_1"));
 	                throw new SOAPFaultException(soapFault);
                 }
                 catch (final Throwable th)
@@ -88,7 +89,7 @@
                     }
                     SOAPFactory factory = SOAPFactory.newInstance();
                     SOAPFault soapFault = factory.createFault() ;
-                    soapFault.addDetail().addTextNode(th.getMessage());
+                    soapFault.addDetail().addDetailEntry(CoordinationConstantsWS.WSCOOR_ERROR_CODE_EXCEPTION_QNAME).addTextNode(th.getMessage());
                     throw new SOAPFaultException(soapFault);
                 }
             }
@@ -101,7 +102,7 @@
 
                 SOAPFactory factory = SOAPFactory.newInstance();
                 SOAPFault soapFault = factory.createFault(SoapFaultType.FAULT_SENDER.getValue(), CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_PARAMETERS_QNAME) ;
-                WSCLogger.log_mesg.getString("com.arjuna.wsc.messaging.ActivationCoordinatorWSProcessorImpl_1") ;
+                soapFault.addDetail().addDetailEntry(CoordinationConstantsWS.WSCOOR_ERROR_CODE_INVALID_PARAMETERS_QNAME).addTextNode(WSCLogger.log_mesg.getString("com.arjuna.wsc.messaging.ActivationCoordinatorWSProcessorImpl_1"));
                 throw new SOAPFaultException(soapFault);
             }
         }

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-C/dev/src/com/arjuna/wsc/messaging/RegistrationCoordinatorProcessorWSImpl.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-C/dev/src/com/arjuna/wsc/messaging/RegistrationCoordinatorProcessorWSImpl.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-C/dev/src/com/arjuna/wsc/messaging/RegistrationCoordinatorProcessorWSImpl.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -30,6 +30,7 @@
 import org.oasis_open.docs.ws_tx.wscoor._2006._06.RegisterResponseType;
 import org.oasis_open.docs.ws_tx.wscoor._2006._06.RegisterType;
 
+import javax.xml.soap.Detail;
 import javax.xml.soap.SOAPFactory;
 import javax.xml.soap.SOAPFault;
 import javax.xml.ws.ProtocolException;
@@ -82,28 +83,28 @@
                 {
                     SOAPFactory factory = SOAPFactory.newInstance();
                     SOAPFault soapFault = factory.createFault(SoapFaultType.FAULT_SENDER.getValue(), CoordinationConstantsWS.WSCOOR_ERROR_CODE_ALREADY_REGISTERED_QNAME);
-                    WSCLogger.log_mesg.getString("com.arjuna.wsc.messaging.RegistrationCoordinatorWSProcessorImpl_1") ;
+                    soapFault.addDetail().addDetailEntry(CoordinationConstantsWS.WSCOOR_ERROR_CODE_ALREADY_REGISTERED_QNAME).addTextNode(WSCLogger.log_mesg.getString("com.arjuna.wsc.messaging.RegistrationCoordinatorWSProcessorImpl_1"));
                     throw new SOAPFaultException(soapFault);
                 }
                 catch (final InvalidProtocolException invalidProtocolException)
                 {
                     SOAPFactory factory = SOAPFactory.newInstance();
                     SOAPFault soapFault = factory.createFault(SoapFaultType.FAULT_SENDER.getValue(), CoordinationConstantsWS.WSCOOR_ERROR_CODE_INVALID_PROTOCOL_QNAME);
-                    WSCLogger.log_mesg.getString("com.arjuna.wsc.messaging.RegistrationCoordinatorWSProcessorImpl_2") ;
+                    soapFault.addDetail().addDetailEntry(CoordinationConstantsWS.WSCOOR_ERROR_CODE_INVALID_PARAMETERS_QNAME).addTextNode(WSCLogger.log_mesg.getString("com.arjuna.wsc.messaging.RegistrationCoordinatorWSProcessorImpl_2"));
                     throw new SOAPFaultException(soapFault);
                 }
                 catch (final InvalidStateException InvalidStateException)
                 {
                     SOAPFactory factory = SOAPFactory.newInstance();
                     SOAPFault soapFault = factory.createFault(SoapFaultType.FAULT_SENDER.getValue(), CoordinationConstantsWS.WSCOOR_ERROR_CODE_INVALID_STATE_QNAME);
-                    WSCLogger.log_mesg.getString("com.arjuna.wsc.messaging.RegistrationCoordinatorWSProcessorImpl_3") ;
+                    soapFault.addDetail().addDetailEntry(CoordinationConstantsWS.WSCOOR_ERROR_CODE_INVALID_STATE_QNAME).addTextNode(WSCLogger.log_mesg.getString("com.arjuna.wsc.messaging.RegistrationCoordinatorWSProcessorImpl_3"));
                     throw new SOAPFaultException(soapFault);
                 }
                 catch (final NoActivityException noActivityException)
                 {
                     SOAPFactory factory = SOAPFactory.newInstance();
                     SOAPFault soapFault = factory.createFault(SoapFaultType.FAULT_SENDER.getValue(), CoordinationConstantsWS.WSCOOR_ERROR_CODE_NO_ACTIVITY_QNAME);
-                    WSCLogger.log_mesg.getString("com.arjuna.wsc.messaging.RegistrationCoordinatorWSProcessorImpl_4") ;
+                    soapFault.addDetail().addDetailEntry(CoordinationConstantsWS.WSCOOR_ERROR_CODE_NO_ACTIVITY_QNAME).addTextNode(WSCLogger.log_mesg.getString("com.arjuna.wsc.messaging.RegistrationCoordinatorWSProcessorImpl_4"));
                     throw new SOAPFaultException(soapFault);
                 }
                 catch (final Throwable th)
@@ -114,7 +115,7 @@
                     }
                     SOAPFactory factory = SOAPFactory.newInstance();
                     SOAPFault soapFault = factory.createFault();
-                    soapFault.addDetail().addTextNode(th.getMessage());
+                    soapFault.addDetail().addDetailEntry(CoordinationConstantsWS.WSCOOR_ERROR_CODE_EXCEPTION_QNAME).addTextNode(th.getMessage());
                     throw new SOAPFaultException(soapFault);
                 }
             }

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/dd/wsarjtx/wsdl/wsarjtx-termination-coordinator-binding.wsdl
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/dd/wsarjtx/wsdl/wsarjtx-termination-coordinator-binding.wsdl	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/dd/wsarjtx/wsdl/wsarjtx-termination-coordinator-binding.wsdl	2008-01-21 17:06:39 UTC (rev 18013)
@@ -37,7 +37,7 @@
 
 	<!-- termination coordinator service definition -->
 	<wsdl:service name="TerminationCoordinatorService">
-	    <wsdl:port binding="wsarjtx:TerminationCoordinator_SOAPBinding" name="TerminationCoordinatorService">
+	    <wsdl:port binding="wsarjtx:TerminationCoordinator_SOAPBinding" name="TerminationCoordinatorPortType">
                 <soap:address location="http://localhost:9000/wst11/TerminationCoordinatorService"/>
 	    </wsdl:port>
 	</wsdl:service>

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/dd/wsarjtx/wsdl/wsarjtx-termination-participant-binding.wsdl
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/dd/wsarjtx/wsdl/wsarjtx-termination-participant-binding.wsdl	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/dd/wsarjtx/wsdl/wsarjtx-termination-participant-binding.wsdl	2008-01-21 17:06:39 UTC (rev 18013)
@@ -51,7 +51,7 @@
 	</wsdl:binding>
 	<!-- termination participant service definition -->
 	<wsdl:service name="TerminationParticipantService">
-	    <wsdl:port binding="wsarjtx:TerminationParticipant_SOAPBinding" name="TerminationParticipantService">
+	    <wsdl:port binding="wsarjtx:TerminationParticipant_SOAPBinding" name="TerminationParticipantPortType">
                 <soap:address location="http://localhost:9000/wst11/TerminationParticipantService"/>
 	    </wsdl:port>
 	</wsdl:service>

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/dd/wscoor1.1/wsdl/wsat-binding.wsdl
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/dd/wscoor1.1/wsdl/wsat-binding.wsdl	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/dd/wscoor1.1/wsdl/wsat-binding.wsdl	2008-01-21 17:06:39 UTC (rev 18013)
@@ -105,7 +105,7 @@
        <wsaw:UsingAddressing required="true"/>
     </wsdl:port>
 
-    <wsdl:port binding="wsat:Coordinator_SOAPBinding" name="CoordinatoPortType">
+    <wsdl:port binding="wsat:Coordinator_SOAPBinding" name="CoordinatorPortType">
       <soap:address location="http://localhost:9000/SoapContext/WSAT/CoordinatorSoapPort"/>
        <wsaw:UsingAddressing required="true"/>
     </wsdl:port>

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/dd/wscoor1.1/wsdl/wsat-coordinator-binding.wsdl
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/dd/wscoor1.1/wsdl/wsat-coordinator-binding.wsdl	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/dd/wscoor1.1/wsdl/wsat-coordinator-binding.wsdl	2008-01-21 17:06:39 UTC (rev 18013)
@@ -37,7 +37,7 @@
   </wsdl:binding>
 
   <wsdl:service name="CoordinatorService">
-    <wsdl:port binding="wsat:Coordinator_SOAPBinding" name="CoordinatoPortType">
+    <wsdl:port binding="wsat:Coordinator_SOAPBinding" name="CoordinatorPortType">
       <soap:address location="http://localhost:9000/wst11/CoordinatorService"/>
        <wsaw:UsingAddressing required="true"/>
     </wsdl:port>

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsarjtx/client/TerminationCoordinatorClientWS.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsarjtx/client/TerminationCoordinatorClientWS.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsarjtx/client/TerminationCoordinatorClientWS.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -118,7 +118,7 @@
         final TerminationCoordinatorPortType port = getPort(coordinator, addressingProperties, identifier, closeAction);
         final NotificationType close = new NotificationType();
 
-        port.completeOperation(close);
+        port.closeOperation(close);
     }
 
     /**
@@ -131,10 +131,10 @@
     public void sendCancel(final W3CEndpointReference coordinator, final AddressingProperties addressingProperties, final InstanceIdentifierWS identifier)
         throws SoapFault, IOException
     {
-        final TerminationCoordinatorPortType port = getPort(coordinator, addressingProperties, identifier, completeAction);
+        final TerminationCoordinatorPortType port = getPort(coordinator, addressingProperties, identifier, cancelAction);
         final NotificationType cancel = new NotificationType();
 
-        port.completeOperation(cancel);
+        port.cancelOperation(cancel);
     }
 
     /**
@@ -151,23 +151,9 @@
                                                    final InstanceIdentifierWS identifier,
                                                    final AttributedURI action)
     {
-        TerminationCoordinatorPortType port = endpoint.getPort(TerminationCoordinatorPortType.class, new AddressingFeature(true, true));
-        BindingProvider bindingProvider = (BindingProvider)port;
-        /*
-        * we need to install an instance identifier handler for this port so that we impliclty pass and return
-        * context data
-        */
-        List<Handler> customHandlerChain = new ArrayList<Handler>();
-        customHandlerChain.add(new InstanceIdentifierHandlerWS());
-        bindingProvider.getBinding().setHandlerChain(customHandlerChain);
-
-        // install the correct action on the addressing properties and hang them off the request context
-        addressingProperties.setAction(action);
-        Map<String, Object> requestContext = bindingProvider.getRequestContext();
-        requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES, addressingProperties);
-        // jbossws should do this for us . . .
-        requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, addressingProperties);
-
-        return port;
+        // we only need the message id from the addressing properties as the address is already wrapped up
+        // in the ednpoint reference. also the identifier should already be installed in the endpoint
+        // reference as a reference parameter so we don't need that either
+        return WSARJTXClientWS.getTerminationCoordinatorPort(endpoint, action, addressingProperties);
     }
 }
\ No newline at end of file

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsarjtx/client/TerminationParticipantClientWS.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsarjtx/client/TerminationParticipantClientWS.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsarjtx/client/TerminationParticipantClientWS.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -129,7 +129,7 @@
         final TerminationParticipantPortType port = getPort(participant, addressingProperties, identifier, closedAction);
         final NotificationType closed = new NotificationType();
 
-        port.completedOperation(closed);
+        port.closedOperation(closed);
     }
 
     /**
@@ -201,23 +201,9 @@
                                                    final InstanceIdentifierWS identifier,
                                                    final AttributedURI action)
     {
-        TerminationParticipantPortType port = endpoint.getPort(TerminationParticipantPortType.class, new AddressingFeature(true, true));
-        BindingProvider bindingProvider = (BindingProvider)port;
-        /*
-        * we need to install an instance identifier handler for this port so that we impliclty pass and return
-        * context data
-        */
-        List<Handler> customHandlerChain = new ArrayList<Handler>();
-        customHandlerChain.add(new InstanceIdentifierHandlerWS());
-        bindingProvider.getBinding().setHandlerChain(customHandlerChain);
-
-        // install the correct action on the addressing properties and hang them off the request context
-        addressingProperties.setAction(action);
-        Map<String, Object> requestContext = bindingProvider.getRequestContext();
-        requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES, addressingProperties);
-        // jbossws should do this for us . . .
-        requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, addressingProperties);
-
-        return port;
+        // we only need the message id from the addressing properties as the address is already wrapped up
+        // in the ednpoint reference. also the identifier should already be installed in the endpoint
+        // reference as a reference parameter so we don't need that either
+        return WSARJTXClientWS.getTerminationParticipantPort(endpoint, action, addressingProperties);
     }
 }
\ No newline at end of file

Added: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsarjtx/client/WSARJTXClientWS.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsarjtx/client/WSARJTXClientWS.java	                        (rev 0)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsarjtx/client/WSARJTXClientWS.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -0,0 +1,140 @@
+package com.arjuna.webservices.wsarjtx.client;
+
+import com.arjuna.schemas.ws._2005._10.wsarjtx.TerminationCoordinatorPortType;
+import com.arjuna.schemas.ws._2005._10.wsarjtx.TerminationCoordinatorService;
+import com.arjuna.schemas.ws._2005._10.wsarjtx.TerminationParticipantPortType;
+import com.arjuna.schemas.ws._2005._10.wsarjtx.TerminationParticipantService;
+import com.arjuna.webservices.wsarj.handler.InstanceIdentifierHandlerWS;
+
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.addressing.AddressingBuilder;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.AttributedURI;
+import javax.xml.ws.addressing.JAXWSAConstants;
+import javax.xml.ws.handler.Handler;
+import javax.xml.ws.soap.AddressingFeature;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.net.URISyntaxException;
+
+import org.jboss.ws.extensions.addressing.jaxws.WSAddressingClientHandler;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: adinn
+ * Date: Oct 7, 2007
+ * Time: 3:14:28 PM
+ * To change this template use File | Settings | File Templates.
+ */
+public class WSARJTXClientWS
+{
+    // TODO -- do we really need a thread local here or can we just use one service?
+    /**
+     *  thread local which maintains a per thread termination coordinator service instance
+     */
+    private static ThreadLocal<TerminationCoordinatorService> terminationCoordinatorService = new ThreadLocal<TerminationCoordinatorService>();
+
+    /**
+     *  thread local which maintains a per thread termination participant service instance
+     */
+    private static ThreadLocal<TerminationParticipantService> terminationParticipantService = new ThreadLocal<TerminationParticipantService>();
+
+    /**
+     *  builder used to construct addressing info for calls
+     */
+    private static AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
+
+    /**
+     * fetch a termination coordinator service unique to the current thread
+     * @return
+     */
+    private static synchronized TerminationCoordinatorService getTerminationCoordinatorService()
+    {
+        if (terminationCoordinatorService.get() == null) {
+            terminationCoordinatorService.set(new TerminationCoordinatorService());
+        }
+        return terminationCoordinatorService.get();
+    }
+
+    /**
+     * fetch a termination participant service unique to the current thread
+     * @return
+     */
+    private static synchronized TerminationParticipantService getTerminationParticipantService()
+    {
+        if (terminationParticipantService.get() == null) {
+            terminationParticipantService.set(new TerminationParticipantService());
+        }
+        return terminationParticipantService.get();
+    }
+
+    public static TerminationCoordinatorPortType getTerminationCoordinatorPort(W3CEndpointReference endpointReference,
+                                                                                AttributedURI action,
+                                                                                AddressingProperties addressingProperties)
+    {
+        TerminationCoordinatorService service = getTerminationCoordinatorService();
+        TerminationCoordinatorPortType port = service.getPort(endpointReference, TerminationCoordinatorPortType.class, new AddressingFeature(true, true));
+        BindingProvider bindingProvider = (BindingProvider)port;
+        /*
+         * we need to configure an instance identifier handler for this port to pass the tx context either
+         * outgoing or returning. We also have to add the the WSAdressing client handler to ensure that the
+         * addressing properties are encoded into the SOAP message
+         */
+        List<Handler> customHandlerChain = new ArrayList<Handler>();
+        customHandlerChain.add(new InstanceIdentifierHandlerWS());
+        customHandlerChain.add(new WSAddressingClientHandler());
+		bindingProvider.getBinding().setHandlerChain(customHandlerChain);
+        // the address will have been pulled out of the endpoint by getPort but we still have to set it in the
+        // addressing properties along with the action and message id
+        Map<String, Object> requestContext = bindingProvider.getRequestContext();
+        String address = (String)requestContext.get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
+        try {
+            addressingProperties.setTo(builder.newURI(address));
+        } catch (URISyntaxException use) {
+            // TODO -- log unexpected error here
+        }
+        addressingProperties.setAction(action);
+        requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES, addressingProperties);
+	    // jbossws should do this for us . . .
+	    requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, addressingProperties);
+
+        return port;
+    }
+
+    // don't think we ever need this as we get a registration port from the endpoint ref returned by
+    // the activation port request
+    public static TerminationParticipantPortType getTerminationParticipantPort(W3CEndpointReference endpointReference,
+                                                                               AttributedURI action,
+                                                                               AddressingProperties addressingProperties)
+    {
+        TerminationParticipantService service = getTerminationParticipantService();
+        TerminationParticipantPortType port = service.getPort(endpointReference, TerminationParticipantPortType.class, new AddressingFeature(true, true));
+        BindingProvider bindingProvider = (BindingProvider)port;
+        /*
+         * we need to configure an instance identifier handler for this port to pass the tx context either
+         * outgoing or returning. We also have to add the the WSAdressing client handler to ensure that the
+         * addressing properties are encoded into the SOAP message
+         */
+        List<Handler> customHandlerChain = new ArrayList<Handler>();
+        customHandlerChain.add(new InstanceIdentifierHandlerWS());
+        customHandlerChain.add(new WSAddressingClientHandler());
+		bindingProvider.getBinding().setHandlerChain(customHandlerChain);
+        // the address will have been pulled out of the endpoint by getPort but we still have to set it in the
+        // addressing properties along with the action and message id
+        Map<String, Object> requestContext = bindingProvider.getRequestContext();
+        String address = (String)requestContext.get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
+        try {
+            addressingProperties.setTo(builder.newURI(address));
+        } catch (URISyntaxException use) {
+            // TODO -- log unexpected error here
+        }
+        addressingProperties.setAction(action);
+        requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES, addressingProperties);
+	    // jbossws should do this for us . . .
+	    requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, addressingProperties);
+
+        return port;
+    }
+}
\ No newline at end of file

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsarjtx/processors/TerminationCoordinatorProcessorWS.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsarjtx/processors/TerminationCoordinatorProcessorWS.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsarjtx/processors/TerminationCoordinatorProcessorWS.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -22,6 +22,7 @@
 
 import com.arjuna.schemas.ws._2005._10.wsarjtx.NotificationType;
 import com.arjuna.webservices.wsarj.ArjunaContextWS;
+import com.arjuna.webservices.wsarj.InstanceIdentifierWS;
 import com.arjuna.wst.BusinessActivityTerminatorWS;
 
 import javax.xml.ws.addressing.AddressingProperties;
@@ -72,6 +73,13 @@
     public abstract void deactivateParticipant(final BusinessActivityTerminatorWS participant) ;
 
     /**
+     * Get the participant with the specified identifier.
+     * @param instanceIdentifier The participant identifier.
+     * @return The participant or null if not known.
+     */
+    public abstract BusinessActivityTerminatorWS getParticipant(final InstanceIdentifierWS instanceIdentifier) ;
+
+    /**
      * Cancel.
      * @param cancel The cancel notification.
      * @param addressingProperties The addressing context.

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsarjtx/sei/TerminationCoordinatorPortTypeImpl.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsarjtx/sei/TerminationCoordinatorPortTypeImpl.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsarjtx/sei/TerminationCoordinatorPortTypeImpl.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -9,10 +9,7 @@
 import com.arjuna.webservices.wsarjtx.processors.TerminationCoordinatorProcessorWS;
 
 import javax.annotation.Resource;
-import javax.jws.Oneway;
-import javax.jws.WebMethod;
-import javax.jws.WebParam;
-import javax.jws.WebService;
+import javax.jws.*;
 import javax.jws.soap.SOAPBinding;
 import javax.xml.ws.WebServiceContext;
 import javax.xml.ws.soap.Addressing;
@@ -33,6 +30,7 @@
         portName = "TerminationCoordinatorPortType"
 )
 @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
+ at HandlerChain(file="handlers.xml")
 @Addressing(required=true)
 public class TerminationCoordinatorPortTypeImpl implements TerminationCoordinatorPortType
 {
@@ -54,7 +52,7 @@
         final NotificationType complete = parameters;
         final AddressingProperties inboundAddressProperties
             = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
-        final ArjunaContextWS arjunaContext = ArjunaContextWS.getContext(ctx);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
 
         TaskManager.getManager().queueTask(new Task() {
             public void executeTask() {
@@ -77,11 +75,11 @@
         final NotificationType close = parameters;
         final AddressingProperties inboundAddressProperties
             = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
-        final ArjunaContextWS arjunaContext = ArjunaContextWS.getContext(ctx);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
 
         TaskManager.getManager().queueTask(new Task() {
             public void executeTask() {
-                TerminationCoordinatorProcessorWS.getProcessor().complete(close, inboundAddressProperties, arjunaContext) ;
+                TerminationCoordinatorProcessorWS.getProcessor().close(close, inboundAddressProperties, arjunaContext) ;
             }
         }) ;
     }
@@ -100,11 +98,11 @@
         final NotificationType cancel = parameters;
         final AddressingProperties inboundAddressProperties
             = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
-        final ArjunaContextWS arjunaContext = ArjunaContextWS.getContext(ctx);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
 
         TaskManager.getManager().queueTask(new Task() {
             public void executeTask() {
-                TerminationCoordinatorProcessorWS.getProcessor().complete(cancel, inboundAddressProperties, arjunaContext) ;
+                TerminationCoordinatorProcessorWS.getProcessor().cancel(cancel, inboundAddressProperties, arjunaContext) ;
             }
         }) ;
     }

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsarjtx/sei/TerminationParticipantPortTypeImpl.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsarjtx/sei/TerminationParticipantPortTypeImpl.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsarjtx/sei/TerminationParticipantPortTypeImpl.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -13,10 +13,7 @@
 import com.arjuna.webservices.wsarjtx.processors.TerminationParticipantProcessorWS;
 
 import javax.annotation.Resource;
-import javax.jws.Oneway;
-import javax.jws.WebMethod;
-import javax.jws.WebParam;
-import javax.jws.WebService;
+import javax.jws.*;
 import javax.jws.soap.SOAPBinding;
 import javax.xml.namespace.QName;
 import javax.xml.ws.WebServiceContext;
@@ -35,10 +32,11 @@
  */
 @WebService(name = "TerminationParticipantPortType", targetNamespace = "http://schemas.arjuna.com/ws/2005/10/wsarjtx",
         wsdlLocation = "../wsdl/wsarjtx-termination-participant-binding.wsdl",
-        serviceName = "TerminationParticipantervice",
+        serviceName = "TerminationParticipantService",
         portName = "TerminationParticipantPortType"
 )
 @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
+ at HandlerChain(file="handlers.xml")
 @Addressing(required=true)
 public class TerminationParticipantPortTypeImpl implements TerminationParticipantPortType
 {
@@ -60,7 +58,7 @@
         final NotificationType completed = parameters;
         final AddressingProperties inboundAddressProperties
             = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
-        final ArjunaContextWS arjunaContext = ArjunaContextWS.getContext(ctx);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
 
         TaskManager.getManager().queueTask(new Task() {
             public void executeTask() {
@@ -83,7 +81,7 @@
         final NotificationType closed = parameters;
         final AddressingProperties inboundAddressProperties
             = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
-        final ArjunaContextWS arjunaContext = ArjunaContextWS.getContext(ctx);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
 
         TaskManager.getManager().queueTask(new Task() {
             public void executeTask() {
@@ -106,7 +104,7 @@
         final NotificationType cancelled = parameters;
         final AddressingProperties inboundAddressProperties
             = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
-        final ArjunaContextWS arjunaContext = ArjunaContextWS.getContext(ctx);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
 
         TaskManager.getManager().queueTask(new Task() {
             public void executeTask() {
@@ -129,7 +127,7 @@
         final NotificationType faulted = parameters;
         final AddressingProperties inboundAddressProperties
             = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
-        final ArjunaContextWS arjunaContext = ArjunaContextWS.getContext(ctx);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
 
         TaskManager.getManager().queueTask(new Task() {
             public void executeTask() {
@@ -157,7 +155,7 @@
         final SoapFault soapFault;
         final AddressingProperties inboundAddressProperties
             = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
-        final ArjunaContextWS arjunaContext = ArjunaContextWS.getContext(ctx);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
         try {
             SoapFaultType soapFaultType = SoapFaultType.toState(parameters.getSoapFaultType());
             soapFault = new SoapFault(soapFaultType, subcode, reason);

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsarjtx/server/TerminationParticipantInitialisation.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsarjtx/server/TerminationParticipantInitialisation.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsarjtx/server/TerminationParticipantInitialisation.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -47,15 +47,20 @@
      */
     public void contextInitialized(final ServletContextEvent servletContextEvent)
     {
-        ServletContext context = servletContextEvent.getServletContext();
-        String baseURI = context.getInitParameter("BaseURI");
-        final String uri = baseURI + "/" + ArjunaTXWSConstants.TERMINATION_PARTICIPANT_SERVICE_NAME;
+        Sequencer.Callback callback = new Sequencer.Callback(Sequencer.WEBAPP_WST) {
+           public void run() {
+               final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
 
-        Sequencer.Callback callback = new Sequencer.Callback(Sequencer.WEBAPP_WST11) {
-           public void run() {
-               // TODO work out how to configure the endpoint name here
-               final ServiceRegistryWS serviceRegistry = ServiceRegistryWS.getRegistry() ;
-               serviceRegistry.registerServiceProvider(ArjunaTXWSConstants.TERMINATION_PARTICIPANT_SERVICE_NAME, uri) ;
+               // Add WS-Addressing
+               AddressingPolicy.register(handlerRegistry) ;
+               // Add Arjuna handlers
+               ArjunaPolicy.register(handlerRegistry) ;
+               // Add Terminator coordinator.
+               TerminationParticipantPolicy.register(handlerRegistry) ;
+
+               final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
+               soapRegistry.registerSoapService(ArjunaTXConstants.SERVICE_TERMINATION_PARTICIPANT,
+                       new SoapService(handlerRegistry)) ;
            }
         };
     }

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsarjtx/server/TerminationParticipantWSInitialisation.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsarjtx/server/TerminationParticipantWSInitialisation.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsarjtx/server/TerminationParticipantWSInitialisation.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -22,13 +22,16 @@
 
 import javax.servlet.ServletContextEvent;
 import javax.servlet.ServletContextListener;
+import javax.servlet.ServletContext;
 
 import com.arjuna.webservices.HandlerRegistry;
 import com.arjuna.webservices.SoapRegistry;
 import com.arjuna.webservices.SoapService;
+import com.arjuna.webservices.ServiceRegistryWS;
 import com.arjuna.webservices.wsaddr.policy.AddressingPolicy;
 import com.arjuna.webservices.wsarj.policy.ArjunaPolicy;
 import com.arjuna.webservices.wsarjtx.ArjunaTXConstants;
+import com.arjuna.webservices.wsarjtx.ArjunaTXWSConstants;
 import com.arjuna.webservices.wsarjtx.policy.TerminationParticipantPolicy;
 import com.arjuna.services.framework.startup.Sequencer;
 
@@ -44,20 +47,15 @@
      */
     public void contextInitialized(final ServletContextEvent servletContextEvent)
     {
-        Sequencer.Callback callback = new Sequencer.Callback(Sequencer.WEBAPP_WST) {
-           public void run() {
-               final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
+        ServletContext context = servletContextEvent.getServletContext();
+        String baseURI = context.getInitParameter("BaseURI");
+        final String uri = baseURI + "/" + ArjunaTXWSConstants.TERMINATION_PARTICIPANT_SERVICE_NAME;
 
-               // Add WS-Addressing
-               AddressingPolicy.register(handlerRegistry) ;
-               // Add Arjuna handlers
-               ArjunaPolicy.register(handlerRegistry) ;
-               // Add Terminator coordinator.
-               TerminationParticipantPolicy.register(handlerRegistry) ;
-
-               final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
-               soapRegistry.registerSoapService(ArjunaTXConstants.SERVICE_TERMINATION_PARTICIPANT,
-                       new SoapService(handlerRegistry)) ;
+        Sequencer.Callback callback = new Sequencer.Callback(Sequencer.WEBAPP_WST11) {
+           public void run() {
+               // TODO work out how to configure the endpoint name here
+               final ServiceRegistryWS serviceRegistry = ServiceRegistryWS.getRegistry() ;
+               serviceRegistry.registerServiceProvider(ArjunaTXWSConstants.TERMINATION_PARTICIPANT_SERVICE_NAME, uri) ;
            }
         };
     }

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsat/AtomicTransactionWSConstants.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsat/AtomicTransactionWSConstants.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsat/AtomicTransactionWSConstants.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -27,7 +27,7 @@
     /**
      * The completion coordinator service name.
      */
-    public String COMPLETION_COORDINATOR_SERVICE_NAME = "CompletionCoordinator" ;
+    public String COMPLETION_COORDINATOR_SERVICE_NAME = "CompletionCoordinatorService" ;
     /**
      * The completion coordinator service qname.
      */
@@ -45,7 +45,7 @@
     /**
       * The completion initiator service name.
       */
-     public String COMPLETION_INITIATOR_SERVICE_NAME = "CompletionInitiator" ;
+     public String COMPLETION_INITIATOR_SERVICE_NAME = "CompletionInitiatorService" ;
      /**
       * The completion initiator service qname.
       */
@@ -62,7 +62,7 @@
     /**
      * The coordinator service name.
      */
-    public String COORDINATOR_SERVICE_NAME = "Coordinator" ;
+    public String COORDINATOR_SERVICE_NAME = "CoordinatorService" ;
     /**
      * The coordinator service qname.
      */
@@ -79,7 +79,7 @@
     /**
      * The participant service name.
      */
-    public String PARTICIPANT_SERVICE_NAME = "Participant" ;
+    public String PARTICIPANT_SERVICE_NAME = "ParticipantService" ;
     /**
      * The participant service qname.
      */

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsat/client/CompletionCoordinatorClientWS.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsat/client/CompletionCoordinatorClientWS.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsat/client/CompletionCoordinatorClientWS.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -55,8 +55,8 @@
     {
         final AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
         try {
-            commitAction = builder.newURI(AtomicTransactionConstants.WSAT_ACTION_COMMIT);
-            rollbackAction = builder.newURI(AtomicTransactionConstants.WSAT_ACTION_ROLLBACK);
+            commitAction = builder.newURI(AtomicTransactionWSConstants.WSAT_ACTION_COMMIT);
+            rollbackAction = builder.newURI(AtomicTransactionWSConstants.WSAT_ACTION_ROLLBACK);
         } catch (URISyntaxException use) {
             // TODO - log fault and throw exception
         }
@@ -129,23 +129,6 @@
                                                   final AddressingProperties addressingProperties,
                                                   final AttributedURI action)
     {
-        CompletionCoordinatorPortType port = endpoint.getPort(CompletionCoordinatorPortType.class, new AddressingFeature(true, true));
-        BindingProvider bindingProvider = (BindingProvider)port;
-        /*
-        * we need to install an instance identifier handler for this port so that we impliclty pass and return
-        * context data
-        */
-        List<Handler> customHandlerChain = new ArrayList<Handler>();
-        customHandlerChain.add(new InstanceIdentifierHandlerWS());
-        bindingProvider.getBinding().setHandlerChain(customHandlerChain);
-
-        // install the correct action on the addressing properties and hang them off the request context
-        addressingProperties.setAction(action);
-        Map<String, Object> requestContext = bindingProvider.getRequestContext();
-        requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES, addressingProperties);
-        // jbossws should do this for us . . .
-        requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, addressingProperties);
-
-        return port;
+        return WSATClientWS.getCompletionCoordinatorPort(endpoint, action, addressingProperties);
     }
 }

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsat/client/CompletionInitiatorClientWS.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsat/client/CompletionInitiatorClientWS.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsat/client/CompletionInitiatorClientWS.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -59,9 +59,9 @@
     {
         final AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
         try {
-            committedAction = builder.newURI(AtomicTransactionConstants.WSAT_ACTION_COMMITTED);
-            abortedAction = builder.newURI(AtomicTransactionConstants.WSAT_ACTION_ABORTED);
-            faultAction = builder.newURI(AtomicTransactionConstants.WSAT_ACTION_FAULT);
+            committedAction = builder.newURI(AtomicTransactionWSConstants.WSAT_ACTION_COMMITTED);
+            abortedAction = builder.newURI(AtomicTransactionWSConstants.WSAT_ACTION_ABORTED);
+            faultAction = builder.newURI(AtomicTransactionWSConstants.WSAT_ACTION_FAULT);
         } catch (URISyntaxException use) {
             // TODO - log fault and throw exception
         }
@@ -148,23 +148,6 @@
                                                 final AddressingProperties addressingProperties,
                                                 final AttributedURI action)
     {
-        CompletionInitiatorPortType port = participant.getPort(CompletionInitiatorPortType.class, new AddressingFeature(true, true));
-        BindingProvider bindingProvider = (BindingProvider)port;
-        /*
-        * we need to install an instance identifier handler for this port so that we impliclty pass and return
-        * context data
-        */
-        List<Handler> customHandlerChain = new ArrayList<Handler>();
-        customHandlerChain.add(new InstanceIdentifierHandlerWS());
-        bindingProvider.getBinding().setHandlerChain(customHandlerChain);
-
-        // install the correct action on the addressing properties and hang them off the request context
-        addressingProperties.setAction(action);
-        Map<String, Object> requestContext = bindingProvider.getRequestContext();
-        requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES, addressingProperties);
-        // jbossws should do this for us . . .
-        requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, addressingProperties);
-
-        return port;
+        return WSATClientWS.getCompletionInitiatorPort(participant, action, addressingProperties);
     }
 }

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsat/client/CoordinatorClientWS.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsat/client/CoordinatorClientWS.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsat/client/CoordinatorClientWS.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -67,11 +67,11 @@
     {
         final AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
         try {
-            preparedAction = builder.newURI(AtomicTransactionConstants.WSAT_ACTION_PREPARED);
-            abortedAction = builder.newURI(AtomicTransactionConstants.WSAT_ACTION_ABORTED);
-            readOnlyAction = builder.newURI(AtomicTransactionConstants.WSAT_ACTION_READ_ONLY);
-            committedAction = builder.newURI(AtomicTransactionConstants.WSAT_ACTION_COMMITTED);
-            faultAction = builder.newURI(AtomicTransactionConstants.WSAT_ACTION_FAULT);
+            preparedAction = builder.newURI(AtomicTransactionWSConstants.WSAT_ACTION_PREPARED);
+            abortedAction = builder.newURI(AtomicTransactionWSConstants.WSAT_ACTION_ABORTED);
+            readOnlyAction = builder.newURI(AtomicTransactionWSConstants.WSAT_ACTION_READ_ONLY);
+            committedAction = builder.newURI(AtomicTransactionWSConstants.WSAT_ACTION_COMMITTED);
+            faultAction = builder.newURI(AtomicTransactionWSConstants.WSAT_ACTION_FAULT);
         } catch (URISyntaxException use) {
             // TODO - log fault and throw exception
         }
@@ -190,23 +190,6 @@
                                                 final AddressingProperties addressingProperties,
                                                 final AttributedURI action)
     {
-        CoordinatorPortType port = participant.getPort(CoordinatorPortType.class, new AddressingFeature(true, true));
-        BindingProvider bindingProvider = (BindingProvider)port;
-        /*
-        * we need to install an instance identifier handler for this port so that we impliclty pass and return
-        * context data
-        */
-        List<Handler> customHandlerChain = new ArrayList<Handler>();
-        customHandlerChain.add(new InstanceIdentifierHandlerWS());
-        bindingProvider.getBinding().setHandlerChain(customHandlerChain);
-
-        // install the correct action on the addressing properties and hang them off the request context
-        addressingProperties.setAction(action);
-        Map<String, Object> requestContext = bindingProvider.getRequestContext();
-        requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES, addressingProperties);
-        // jbossws should do this for us . . .
-        requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, addressingProperties);
-
-        return port;
+        return WSATClientWS.getCoordinatorPort(participant, action, addressingProperties);
     }
 }

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsat/client/ParticipantClientWS.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsat/client/ParticipantClientWS.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsat/client/ParticipantClientWS.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -62,10 +62,10 @@
     {
         final AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
         try {
-            prepareAction = builder.newURI(AtomicTransactionConstants.WSAT_ACTION_PREPARE);
-            commitAction = builder.newURI(AtomicTransactionConstants.WSAT_ACTION_COMMIT);
-            rollbackAction = builder.newURI(AtomicTransactionConstants.WSAT_ACTION_ROLLBACK);
-            faultAction = builder.newURI(AtomicTransactionConstants.WSAT_ACTION_FAULT);
+            prepareAction = builder.newURI(AtomicTransactionWSConstants.WSAT_ACTION_PREPARE);
+            commitAction = builder.newURI(AtomicTransactionWSConstants.WSAT_ACTION_COMMIT);
+            rollbackAction = builder.newURI(AtomicTransactionWSConstants.WSAT_ACTION_ROLLBACK);
+            faultAction = builder.newURI(AtomicTransactionWSConstants.WSAT_ACTION_FAULT);
         } catch (URISyntaxException use) {
             // TODO - log fault and throw exception
         }
@@ -168,23 +168,6 @@
                                                 final AddressingProperties addressingProperties,
                                                 final AttributedURI action)
     {
-        ParticipantPortType port = participant.getPort(ParticipantPortType.class, new AddressingFeature(true, true));
-        BindingProvider bindingProvider = (BindingProvider)port;
-        /*
-        * we need to install an instance identifier handler for this port so that we impliclty pass and return
-        * context data
-        */
-        List<Handler> customHandlerChain = new ArrayList<Handler>();
-        customHandlerChain.add(new InstanceIdentifierHandlerWS());
-        bindingProvider.getBinding().setHandlerChain(customHandlerChain);
-
-        // install the correct action on the addressing properties and hang them off the request context
-        addressingProperties.setAction(action);
-        Map<String, Object> requestContext = bindingProvider.getRequestContext();
-        requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES, addressingProperties);
-        // jbossws should do this for us . . .
-        requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, addressingProperties);
-
-        return port;
+        return WSATClientWS.getParticipantPort(participant, action, addressingProperties);
     }
 }

Added: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsat/client/WSATClientWS.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsat/client/WSATClientWS.java	                        (rev 0)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsat/client/WSATClientWS.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -0,0 +1,236 @@
+package com.arjuna.webservices.wsat.client;
+
+import com.arjuna.webservices.wsarj.handler.InstanceIdentifierHandlerWS;
+import org.oasis_open.docs.ws_tx.wsat._2006._06.*;
+import org.jboss.ws.extensions.addressing.jaxws.WSAddressingClientHandler;
+
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.addressing.AddressingBuilder;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.AttributedURI;
+import javax.xml.ws.addressing.JAXWSAConstants;
+import javax.xml.ws.handler.Handler;
+import javax.xml.ws.soap.AddressingFeature;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: adinn
+ * Date: Oct 7, 2007
+ * Time: 3:14:28 PM
+ * To change this template use File | Settings | File Templates.
+ */
+public class WSATClientWS
+{
+    // TODO -- do we really need a thread local here or can we just use one service?
+    /**
+     *  thread local which maintains a per thread coordinator service instance
+     */
+    private static ThreadLocal<CoordinatorService> coordinatorService = new ThreadLocal<CoordinatorService>();
+
+    /**
+     *  thread local which maintains a per thread participant service instance
+     */
+    private static ThreadLocal<ParticipantService> participantService = new ThreadLocal<ParticipantService>();
+
+    /**
+     *  thread local which maintains a per thread completion coordinator service instance
+     */
+    private static ThreadLocal<CompletionCoordinatorService> completionCoordinatorService = new ThreadLocal<CompletionCoordinatorService>();
+
+    /**
+     *  thread local which maintains a per thread completion initiator service instance
+     */
+    private static ThreadLocal<CompletionInitiatorService> completionInitiatorService = new ThreadLocal<CompletionInitiatorService>();
+
+    /**
+     *  builder used to construct addressing info for calls
+     */
+    private static AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
+
+    /**
+     * fetch a coordinator service unique to the current thread
+     * @return
+     */
+    private static synchronized CoordinatorService getCoordinatorService()
+    {
+        if (coordinatorService.get() == null) {
+            coordinatorService.set(new CoordinatorService());
+        }
+        return coordinatorService.get();
+    }
+
+    /**
+     * fetch a participant service unique to the current thread
+     * @return
+     */
+    private static synchronized ParticipantService getParticipantService()
+    {
+        if (participantService.get() == null) {
+            participantService.set(new ParticipantService());
+        }
+        return participantService.get();
+    }
+
+    /**
+     * fetch a completion coordinator service unique to the current thread
+     * @return
+     */
+    private static synchronized CompletionCoordinatorService getCompletionCoordinatorService()
+    {
+        if (completionCoordinatorService.get() == null) {
+            completionCoordinatorService.set(new CompletionCoordinatorService());
+        }
+        return completionCoordinatorService.get();
+    }
+
+    /**
+     * fetch a completion initiator service unique to the current thread
+     * @return
+     */
+    private static synchronized CompletionInitiatorService getCompletionInitiatorService()
+    {
+        if (completionInitiatorService.get() == null) {
+            completionInitiatorService.set(new CompletionInitiatorService());
+        }
+        return completionInitiatorService.get();
+    }
+
+    public static CoordinatorPortType getCoordinatorPort(W3CEndpointReference endpointReference,
+                                                         AttributedURI action,
+                                                         AddressingProperties addressingProperties)
+    {
+        CoordinatorService service = getCoordinatorService();
+        CoordinatorPortType port = service.getPort(endpointReference, CoordinatorPortType.class, new AddressingFeature(true, true));
+        BindingProvider bindingProvider = (BindingProvider)port;
+        /*
+         * we need to configure an instance identifier handler for this port to pass the tx context either
+         * outgoing or returning. We also have to add the the WSAdressing client handler to ensure that the
+         * addressing properties are encoded into the SOAP message
+         */
+        List<Handler> customHandlerChain = new ArrayList<Handler>();
+        customHandlerChain.add(new InstanceIdentifierHandlerWS());
+        customHandlerChain.add(new WSAddressingClientHandler());
+		bindingProvider.getBinding().setHandlerChain(customHandlerChain);
+        // the address will have been pulled out of the endpoint by getPort but we still have to set it in the
+        // addressing properties along with the action and message id
+        Map<String, Object> requestContext = bindingProvider.getRequestContext();
+        String address = (String)requestContext.get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
+        try {
+            addressingProperties.setTo(builder.newURI(address));
+        } catch (URISyntaxException use) {
+            // TODO -- log unexpected error here
+        }
+        addressingProperties.setAction(action);
+        requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES, addressingProperties);
+	    // jbossws should do this for us . . .
+	    requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, addressingProperties);
+
+        return port;
+    }
+
+    // don't think we ever need this as we get a registration port from the endpoint ref returned by
+    // the activation port request
+    public static ParticipantPortType getParticipantPort(W3CEndpointReference endpointReference,
+                                                         AttributedURI action,
+                                                         AddressingProperties addressingProperties)
+    {
+        ParticipantService service = getParticipantService();
+        ParticipantPortType port = service.getPort(endpointReference, ParticipantPortType.class, new AddressingFeature(true, true));
+        BindingProvider bindingProvider = (BindingProvider)port;
+        /*
+         * we need to configure an instance identifier handler for this port to pass the tx context either
+         * outgoing or returning. We also have to add the the WSAdressing client handler to ensure that the
+         * addressing properties are encoded into the SOAP message
+         */
+        List<Handler> customHandlerChain = new ArrayList<Handler>();
+        customHandlerChain.add(new InstanceIdentifierHandlerWS());
+        customHandlerChain.add(new WSAddressingClientHandler());
+		bindingProvider.getBinding().setHandlerChain(customHandlerChain);
+        // the address will have been pulled out of the endpoint by getPort but we still have to set it in the
+        // addressing properties along with the action and message id
+        Map<String, Object> requestContext = bindingProvider.getRequestContext();
+        String address = (String)requestContext.get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
+        try {
+            addressingProperties.setTo(builder.newURI(address));
+        } catch (URISyntaxException use) {
+            // TODO -- log unexpected error here
+        }
+        addressingProperties.setAction(action);
+        requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES, addressingProperties);
+	    // jbossws should do this for us . . .
+	    requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, addressingProperties);
+
+        return port;
+    }
+
+    public static CompletionCoordinatorPortType getCompletionCoordinatorPort(W3CEndpointReference endpointReference,
+                                                                             AttributedURI action,
+                                                                             AddressingProperties addressingProperties)
+    {
+        CompletionCoordinatorService service = getCompletionCoordinatorService();
+        CompletionCoordinatorPortType port = service.getPort(endpointReference, CompletionCoordinatorPortType.class, new AddressingFeature(true, true));
+        BindingProvider bindingProvider = (BindingProvider)port;
+        /*
+         * we need to configure an instance identifier handler for this port to pass the tx context either
+         * outgoing or returning. We also have to add the the WSAdressing client handler to ensure that the
+         * addressing properties are encoded into the SOAP message
+         */
+        List<Handler> customHandlerChain = new ArrayList<Handler>();
+        customHandlerChain.add(new InstanceIdentifierHandlerWS());
+        customHandlerChain.add(new WSAddressingClientHandler());
+		bindingProvider.getBinding().setHandlerChain(customHandlerChain);
+        // the address will have been pulled out of the endpoint by getPort but we still have to set it in the
+        // addressing properties along with the action and message id
+        Map<String, Object> requestContext = bindingProvider.getRequestContext();
+        String address = (String)requestContext.get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
+        try {
+            addressingProperties.setTo(builder.newURI(address));
+        } catch (URISyntaxException use) {
+            // TODO -- log unexpected error here
+        }
+        addressingProperties.setAction(action);
+        requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES, addressingProperties);
+	    // jbossws should do this for us . . .
+	    requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, addressingProperties);
+
+        return port;
+    }
+
+    public static CompletionInitiatorPortType getCompletionInitiatorPort(W3CEndpointReference endpointReference,
+                                                                         AttributedURI action,
+                                                                         AddressingProperties addressingProperties)
+    {
+        CompletionInitiatorService service = getCompletionInitiatorService();
+        CompletionInitiatorPortType port = service.getPort(endpointReference, CompletionInitiatorPortType.class, new AddressingFeature(true, true));
+        BindingProvider bindingProvider = (BindingProvider)port;
+        /*
+         * we need to configure an instance identifier handler for this port to pass the tx context either
+         * outgoing or returning. We also have to add the the WSAdressing client handler to ensure that the
+         * addressing properties are encoded into the SOAP message
+         */
+        List<Handler> customHandlerChain = new ArrayList<Handler>();
+        customHandlerChain.add(new InstanceIdentifierHandlerWS());
+        customHandlerChain.add(new WSAddressingClientHandler());
+		bindingProvider.getBinding().setHandlerChain(customHandlerChain);
+        // the address will have been pulled out of the endpoint by getPort but we still have to set it in the
+        // addressing properties along with the action and message id
+        Map<String, Object> requestContext = bindingProvider.getRequestContext();
+        String address = (String)requestContext.get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
+        try {
+            addressingProperties.setTo(builder.newURI(address));
+        } catch (URISyntaxException use) {
+            // TODO -- log unexpected error here
+        }
+        addressingProperties.setAction(action);
+        requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES, addressingProperties);
+	    // jbossws should do this for us . . .
+	    requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, addressingProperties);
+
+        return port;
+    }
+}
\ No newline at end of file

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsat/sei/CompletionCoordinatorPortTypeImpl.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsat/sei/CompletionCoordinatorPortTypeImpl.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsat/sei/CompletionCoordinatorPortTypeImpl.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -50,7 +50,7 @@
         final Notification commit = parameters;
         final AddressingProperties inboundAddressProperties
             = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
-        final ArjunaContextWS arjunaContext = ArjunaContextWS.getContext(ctx);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
 
         TaskManager.getManager().queueTask(new Task() {
             public void executeTask() {
@@ -73,7 +73,7 @@
         final Notification rollback = parameters;
         final AddressingProperties inboundAddressProperties
             = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
-        final ArjunaContextWS arjunaContext = ArjunaContextWS.getContext(ctx);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
 
         TaskManager.getManager().queueTask(new Task() {
             public void executeTask() {

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsat/sei/CompletionInitiatorPortTypeImpl.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsat/sei/CompletionInitiatorPortTypeImpl.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsat/sei/CompletionInitiatorPortTypeImpl.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -51,7 +51,7 @@
         final Notification committed = parameters;
         final AddressingProperties inboundAddressProperties
             = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
-        final ArjunaContextWS arjunaContext = ArjunaContextWS.getContext(ctx);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
 
         TaskManager.getManager().queueTask(new Task() {
             public void executeTask() {
@@ -74,7 +74,7 @@
         final Notification aborted = parameters;
         final AddressingProperties inboundAddressProperties
             = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
-        final ArjunaContextWS arjunaContext = ArjunaContextWS.getContext(ctx);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
 
         TaskManager.getManager().queueTask(new Task() {
             public void executeTask() {

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsat/sei/CoordinatorPortTypeImpl.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsat/sei/CoordinatorPortTypeImpl.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsat/sei/CoordinatorPortTypeImpl.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -51,7 +51,7 @@
         final Notification prepared = parameters;
         final AddressingProperties inboundAddressProperties
             = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
-        final ArjunaContextWS arjunaContext = ArjunaContextWS.getContext(ctx);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
 
         TaskManager.getManager().queueTask(new Task() {
             public void executeTask() {
@@ -74,7 +74,7 @@
         final Notification aborted = parameters;
         final AddressingProperties inboundAddressProperties
             = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
-        final ArjunaContextWS arjunaContext = ArjunaContextWS.getContext(ctx);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
 
         TaskManager.getManager().queueTask(new Task() {
             public void executeTask() {
@@ -97,7 +97,7 @@
         final Notification readOnly = parameters;
         final AddressingProperties inboundAddressProperties
             = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
-        final ArjunaContextWS arjunaContext = ArjunaContextWS.getContext(ctx);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
 
         TaskManager.getManager().queueTask(new Task() {
             public void executeTask() {
@@ -120,7 +120,7 @@
         final Notification committed = parameters;
         final AddressingProperties inboundAddressProperties
             = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
-        final ArjunaContextWS arjunaContext = ArjunaContextWS.getContext(ctx);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
 
         TaskManager.getManager().queueTask(new Task() {
             public void executeTask() {

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsat/sei/ParticipantPortTypeImpl.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsat/sei/ParticipantPortTypeImpl.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsat/sei/ParticipantPortTypeImpl.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -51,7 +51,7 @@
         final Notification prepare = parameters;
         final AddressingProperties inboundAddressProperties
             = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
-        final ArjunaContextWS arjunaContext = ArjunaContextWS.getContext(ctx);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
 
         TaskManager.getManager().queueTask(new Task() {
             public void executeTask() {
@@ -74,7 +74,7 @@
         final Notification commit = parameters;
         final AddressingProperties inboundAddressProperties
             = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
-        final ArjunaContextWS arjunaContext = ArjunaContextWS.getContext(ctx);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
 
         TaskManager.getManager().queueTask(new Task() {
             public void executeTask() {
@@ -97,7 +97,7 @@
         final Notification rollback = parameters;
         final AddressingProperties inboundAddressProperties
             = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
-        final ArjunaContextWS arjunaContext = ArjunaContextWS.getContext(ctx);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
 
         TaskManager.getManager().queueTask(new Task() {
             public void executeTask() {

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsba/StateWS.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsba/StateWS.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsba/StateWS.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -202,7 +202,7 @@
      */
     private static QName getQualifiedName(final String name)
     {
-        return new QName(BusinessActivityConstants.WSBA_NAMESPACE,
-                name, BusinessActivityConstants.WSBA_PREFIX) ;
+        return new QName(BusinessActivityWSConstants.WSBA_NAMESPACE,
+                name, BusinessActivityWSConstants.WSBA_PREFIX) ;
     }
 }
\ No newline at end of file

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsba/client/CoordinatorCompletionCoordinatorClientWS.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsba/client/CoordinatorCompletionCoordinatorClientWS.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsba/client/CoordinatorCompletionCoordinatorClientWS.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -106,15 +106,15 @@
     {
         final AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
         try {
-            completedAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_COMPLETED);
+            completedAction = builder.newURI(BusinessActivityWSConstants.WSBA_ACTION_COMPLETED);
             failAction = builder.newURI(BusinessActivityWSConstants.WSBA_ACTION_FAIL);
-            compensatedAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_COMPENSATED);
-            closedAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_CLOSED);
-            cancelledAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_CANCELLED);
-            exitAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_EXIT);
+            compensatedAction = builder.newURI(BusinessActivityWSConstants.WSBA_ACTION_COMPENSATED);
+            closedAction = builder.newURI(BusinessActivityWSConstants.WSBA_ACTION_CLOSED);
+            cancelledAction = builder.newURI(BusinessActivityWSConstants.WSBA_ACTION_CANCELLED);
+            exitAction = builder.newURI(BusinessActivityWSConstants.WSBA_ACTION_EXIT);
             cannotCompleteAction = builder.newURI(BusinessActivityWSConstants.WSBA_ACTION_CANNOT_COMPLETE);
-            getStatusAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_GET_STATUS);
-            statusAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_STATUS);
+            getStatusAction = builder.newURI(BusinessActivityWSConstants.WSBA_ACTION_GET_STATUS);
+            statusAction = builder.newURI(BusinessActivityWSConstants.WSBA_ACTION_STATUS);
         } catch (URISyntaxException use) {
             // TODO - log fault and throw exception
         }
@@ -311,25 +311,6 @@
     private BusinessAgreementWithCoordinatorCompletionCoordinatorPortType
     getPort(final W3CEndpointReference participant, final AddressingProperties addressingProperties, final AttributedURI action)
     {
-        BusinessAgreementWithCoordinatorCompletionCoordinatorPortType port;
-        port = participant.getPort(BusinessAgreementWithCoordinatorCompletionCoordinatorPortType.class,
-                new AddressingFeature(true, true));
-        BindingProvider bindingProvider = (BindingProvider)port;
-        /*
-        * we need to install an instance identifier handler for this port so that we impliclty pass and return
-        * context data
-        */
-        List<Handler> customHandlerChain = new ArrayList<Handler>();
-        customHandlerChain.add(new InstanceIdentifierHandlerWS());
-        bindingProvider.getBinding().setHandlerChain(customHandlerChain);
-
-        // install the correct action on the addressing properties and hang them off the request context
-        addressingProperties.setAction(action);
-        Map<String, Object> requestContext = bindingProvider.getRequestContext();
-        requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES, addressingProperties);
-        // jbossws should do this for us . . .
-        requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, addressingProperties);
-
-        return port;
+        return WSBAClientWS.getCoordinatorCompletionCoordinatorPort(participant, action, addressingProperties);
     }
 }
\ No newline at end of file

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsba/client/CoordinatorCompletionParticipantClientWS.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsba/client/CoordinatorCompletionParticipantClientWS.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsba/client/CoordinatorCompletionParticipantClientWS.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -105,15 +105,15 @@
     {
         final AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
         try {
-            completeAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_COMPLETE);
-            closeAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_CLOSE);
-            cancelAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_CANCEL);
-            compensateAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_COMPENSATE);
+            completeAction = builder.newURI(BusinessActivityWSConstants.WSBA_ACTION_COMPLETE);
+            closeAction = builder.newURI(BusinessActivityWSConstants.WSBA_ACTION_CLOSE);
+            cancelAction = builder.newURI(BusinessActivityWSConstants.WSBA_ACTION_CANCEL);
+            compensateAction = builder.newURI(BusinessActivityWSConstants.WSBA_ACTION_COMPENSATE);
             failedAction = builder.newURI(BusinessActivityWSConstants.WSBA_ACTION_FAILED);
-            exitedAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_EXITED);
+            exitedAction = builder.newURI(BusinessActivityWSConstants.WSBA_ACTION_EXITED);
             notCompletedAction = builder.newURI(BusinessActivityWSConstants.WSBA_ACTION_NOT_COMPLETED);
-            getStatusAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_GET_STATUS);
-            statusAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_STATUS);
+            getStatusAction = builder.newURI(BusinessActivityWSConstants.WSBA_ACTION_GET_STATUS);
+            statusAction = builder.newURI(BusinessActivityWSConstants.WSBA_ACTION_STATUS);
         } catch (URISyntaxException use) {
             // TODO - log fault and throw exception
         }
@@ -308,25 +308,6 @@
     private BusinessAgreementWithCoordinatorCompletionParticipantPortType
     getPort(final W3CEndpointReference participant, final AddressingProperties addressingProperties, final AttributedURI action)
     {
-        BusinessAgreementWithCoordinatorCompletionParticipantPortType port;
-        port = participant.getPort(BusinessAgreementWithCoordinatorCompletionParticipantPortType.class,
-                new AddressingFeature(true, true));
-        BindingProvider bindingProvider = (BindingProvider)port;
-        /*
-        * we need to install an instance identifier handler for this port so that we impliclty pass and return
-        * context data
-        */
-        List<Handler> customHandlerChain = new ArrayList<Handler>();
-        customHandlerChain.add(new InstanceIdentifierHandlerWS());
-        bindingProvider.getBinding().setHandlerChain(customHandlerChain);
-
-        // install the correct action on the addressing properties and hang them off the request context
-        addressingProperties.setAction(action);
-        Map<String, Object> requestContext = bindingProvider.getRequestContext();
-        requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES, addressingProperties);
-        // jbossws should do this for us . . .
-        requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, addressingProperties);
-
-        return port;
+        return WSBAClientWS.getCoordinatorCompletionParticipantPort(participant, action, addressingProperties);
     }
 }
\ No newline at end of file

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsba/client/ParticipantCompletionCoordinatorClientWS.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsba/client/ParticipantCompletionCoordinatorClientWS.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsba/client/ParticipantCompletionCoordinatorClientWS.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -106,15 +106,15 @@
     {
         final AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
         try {
-            completedAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_COMPLETED);
+            completedAction = builder.newURI(BusinessActivityWSConstants.WSBA_ACTION_COMPLETED);
             failAction = builder.newURI(BusinessActivityWSConstants.WSBA_ACTION_FAIL);
-            compensatedAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_COMPENSATED);
-            closedAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_CLOSED);
-            cancelledAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_CANCELLED);
-            exitAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_EXIT);
+            compensatedAction = builder.newURI(BusinessActivityWSConstants.WSBA_ACTION_COMPENSATED);
+            closedAction = builder.newURI(BusinessActivityWSConstants.WSBA_ACTION_CLOSED);
+            cancelledAction = builder.newURI(BusinessActivityWSConstants.WSBA_ACTION_CANCELLED);
+            exitAction = builder.newURI(BusinessActivityWSConstants.WSBA_ACTION_EXIT);
             cannotCompleteAction = builder.newURI(BusinessActivityWSConstants.WSBA_ACTION_CANNOT_COMPLETE);
-            getStatusAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_GET_STATUS);
-            statusAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_STATUS);
+            getStatusAction = builder.newURI(BusinessActivityWSConstants.WSBA_ACTION_GET_STATUS);
+            statusAction = builder.newURI(BusinessActivityWSConstants.WSBA_ACTION_STATUS);
         } catch (URISyntaxException use) {
             // TODO - log fault and throw exception
         }
@@ -311,25 +311,6 @@
     private BusinessAgreementWithParticipantCompletionCoordinatorPortType
     getPort(final W3CEndpointReference participant, final AddressingProperties addressingProperties, final AttributedURI action)
     {
-        BusinessAgreementWithParticipantCompletionCoordinatorPortType port;
-        port = participant.getPort(BusinessAgreementWithParticipantCompletionCoordinatorPortType.class,
-                new AddressingFeature(true, true));
-        BindingProvider bindingProvider = (BindingProvider)port;
-        /*
-        * we need to install an instance identifier handler for this port so that we impliclty pass and return
-        * context data
-        */
-        List<Handler> customHandlerChain = new ArrayList<Handler>();
-        customHandlerChain.add(new InstanceIdentifierHandlerWS());
-        bindingProvider.getBinding().setHandlerChain(customHandlerChain);
-
-        // install the correct action on the addressing properties and hang them off the request context
-        addressingProperties.setAction(action);
-        Map<String, Object> requestContext = bindingProvider.getRequestContext();
-        requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES, addressingProperties);
-        // jbossws should do this for us . . .
-        requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, addressingProperties);
-
-        return port;
+        return WSBAClientWS.getParticipantCompletionCoordinatorPort(participant, action, addressingProperties);
     }
 }
\ No newline at end of file

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsba/client/ParticipantCompletionParticipantClientWS.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsba/client/ParticipantCompletionParticipantClientWS.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsba/client/ParticipantCompletionParticipantClientWS.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -101,14 +101,14 @@
     {
         final AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
         try {
-            closeAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_CLOSE);
-            cancelAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_CANCEL);
-            compensateAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_COMPENSATE);
+            closeAction = builder.newURI(BusinessActivityWSConstants.WSBA_ACTION_CLOSE);
+            cancelAction = builder.newURI(BusinessActivityWSConstants.WSBA_ACTION_CANCEL);
+            compensateAction = builder.newURI(BusinessActivityWSConstants.WSBA_ACTION_COMPENSATE);
             failedAction = builder.newURI(BusinessActivityWSConstants.WSBA_ACTION_FAILED);
-            exitedAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_EXITED);
+            exitedAction = builder.newURI(BusinessActivityWSConstants.WSBA_ACTION_EXITED);
             notCompletedAction = builder.newURI(BusinessActivityWSConstants.WSBA_ACTION_NOT_COMPLETED);
-            getStatusAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_GET_STATUS);
-            statusAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_STATUS);
+            getStatusAction = builder.newURI(BusinessActivityWSConstants.WSBA_ACTION_GET_STATUS);
+            statusAction = builder.newURI(BusinessActivityWSConstants.WSBA_ACTION_STATUS);
         } catch (URISyntaxException use) {
             // TODO - log fault and throw exception
         }
@@ -286,25 +286,6 @@
     private BusinessAgreementWithParticipantCompletionParticipantPortType
     getPort(final W3CEndpointReference participant, final AddressingProperties addressingProperties, final AttributedURI action)
     {
-        BusinessAgreementWithParticipantCompletionParticipantPortType port;
-        port = participant.getPort(BusinessAgreementWithParticipantCompletionParticipantPortType.class,
-                new AddressingFeature(true, true));
-        BindingProvider bindingProvider = (BindingProvider)port;
-        /*
-        * we need to install an instance identifier handler for this port so that we impliclty pass and return
-        * context data
-        */
-        List<Handler> customHandlerChain = new ArrayList<Handler>();
-        customHandlerChain.add(new InstanceIdentifierHandlerWS());
-        bindingProvider.getBinding().setHandlerChain(customHandlerChain);
-
-        // install the correct action on the addressing properties and hang them off the request context
-        addressingProperties.setAction(action);
-        Map<String, Object> requestContext = bindingProvider.getRequestContext();
-        requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES, addressingProperties);
-        // jbossws should do this for us . . .
-        requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, addressingProperties);
-
-        return port;
+        return WSBAClientWS.getParticipantCompletionParticipantPort(participant, action, addressingProperties);
     }
 }
\ No newline at end of file

Added: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsba/client/WSBAClientWS.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsba/client/WSBAClientWS.java	                        (rev 0)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsba/client/WSBAClientWS.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -0,0 +1,237 @@
+package com.arjuna.webservices.wsba.client;
+
+import com.arjuna.webservices.wsarj.handler.InstanceIdentifierHandlerWS;
+import org.oasis_open.docs.ws_tx.wsat._2006._06.CoordinatorPortType;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.*;
+import org.jboss.ws.extensions.addressing.jaxws.WSAddressingClientHandler;
+
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.addressing.AddressingBuilder;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.AttributedURI;
+import javax.xml.ws.addressing.JAXWSAConstants;
+import javax.xml.ws.handler.Handler;
+import javax.xml.ws.soap.AddressingFeature;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: adinn
+ * Date: Oct 7, 2007
+ * Time: 3:14:28 PM
+ * To change this template use File | Settings | File Templates.
+ */
+public class WSBAClientWS
+{
+    // TODO -- do we really need a thread local here or can we just use one service?
+    /**
+     *  thread local which maintains a per thread participant completion coordinator service instance
+     */
+    private static ThreadLocal<BusinessAgreementWithParticipantCompletionCoordinatorService> participantCompletionCoordinatorService = new ThreadLocal<BusinessAgreementWithParticipantCompletionCoordinatorService>();
+
+    /**
+     *  thread local which maintains a per thread participant completion participant service instance
+     */
+    private static ThreadLocal<BusinessAgreementWithParticipantCompletionParticipantService> participantCompletionParticipantService = new ThreadLocal<BusinessAgreementWithParticipantCompletionParticipantService>();
+
+    /**
+     *  thread local which maintains a per thread coordinator completion coordinator service instance
+     */
+    private static ThreadLocal<BusinessAgreementWithCoordinatorCompletionCoordinatorService> coordinatorCompletionCoordinatorService = new ThreadLocal<BusinessAgreementWithCoordinatorCompletionCoordinatorService>();
+
+    /**
+     *  thread local which maintains a per thread coordinator completion participant service instance
+     */
+    private static ThreadLocal<BusinessAgreementWithCoordinatorCompletionParticipantService> coordinatorCompletionParticipantService = new ThreadLocal<BusinessAgreementWithCoordinatorCompletionParticipantService>();
+
+    /**
+     *  builder used to construct addressing info for calls
+     */
+    private static AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
+
+    /**
+     * fetch a participant completion coordinator service unique to the current thread
+     * @return
+     */
+    private static synchronized BusinessAgreementWithParticipantCompletionCoordinatorService getParticipantCompletionCoordinatorService()
+    {
+        if (participantCompletionCoordinatorService.get() == null) {
+            participantCompletionCoordinatorService.set(new BusinessAgreementWithParticipantCompletionCoordinatorService());
+        }
+        return participantCompletionCoordinatorService.get();
+    }
+
+    /**
+     * fetch a participant completion participant service unique to the current thread
+     * @return
+     */
+    private static synchronized BusinessAgreementWithParticipantCompletionParticipantService getParticipantCompletionParticipantService()
+    {
+        if (participantCompletionParticipantService.get() == null) {
+            participantCompletionParticipantService.set(new BusinessAgreementWithParticipantCompletionParticipantService());
+        }
+        return participantCompletionParticipantService.get();
+    }
+
+    /**
+     * fetch a coordinator completion coordinator service unique to the current thread
+     * @return
+     */
+    private static synchronized BusinessAgreementWithCoordinatorCompletionCoordinatorService getCoordinatorCompletionCoordinatorService()
+    {
+        if (coordinatorCompletionCoordinatorService.get() == null) {
+            coordinatorCompletionCoordinatorService.set(new BusinessAgreementWithCoordinatorCompletionCoordinatorService());
+        }
+        return coordinatorCompletionCoordinatorService.get();
+    }
+
+    /**
+     * fetch a coordinator completion participant service unique to the current thread
+     * @return
+     */
+    private static synchronized BusinessAgreementWithCoordinatorCompletionParticipantService getCoordinatorCompletionParticipantService()
+    {
+        if (coordinatorCompletionParticipantService.get() == null) {
+            coordinatorCompletionParticipantService.set(new BusinessAgreementWithCoordinatorCompletionParticipantService());
+        }
+        return coordinatorCompletionParticipantService.get();
+    }
+
+    public static BusinessAgreementWithParticipantCompletionCoordinatorPortType getParticipantCompletionCoordinatorPort(W3CEndpointReference endpointReference,
+                                                         AttributedURI action,
+                                                         AddressingProperties addressingProperties)
+    {
+        BusinessAgreementWithParticipantCompletionCoordinatorService service = getParticipantCompletionCoordinatorService();
+        BusinessAgreementWithParticipantCompletionCoordinatorPortType port = service.getPort(endpointReference, BusinessAgreementWithParticipantCompletionCoordinatorPortType.class, new AddressingFeature(true, true));
+        BindingProvider bindingProvider = (BindingProvider)port;
+        /*
+         * we need to configure an instance identifier handler for this port to pass the tx context either
+         * outgoing or returning. We also have to add the the WSAdressing client handler to ensure that the
+         * addressing properties are encoded into the SOAP message
+         */
+        List<Handler> customHandlerChain = new ArrayList<Handler>();
+        customHandlerChain.add(new InstanceIdentifierHandlerWS());
+        customHandlerChain.add(new WSAddressingClientHandler());
+		bindingProvider.getBinding().setHandlerChain(customHandlerChain);
+        // the address will have been pulled out of the endpoint by getPort but we still have to set it in the
+        // addressing properties along with the action and message id
+        Map<String, Object> requestContext = bindingProvider.getRequestContext();
+        String address = (String)requestContext.get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
+        try {
+            addressingProperties.setTo(builder.newURI(address));
+        } catch (URISyntaxException use) {
+            // TODO -- log unexpected error here
+        }
+        addressingProperties.setAction(action);
+        requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES, addressingProperties);
+	    // jbossws should do this for us . . .
+	    requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, addressingProperties);
+
+        return port;
+    }
+
+    // don't think we ever need this as we get a registration port from the endpoint ref returned by
+    // the activation port request
+    public static BusinessAgreementWithParticipantCompletionParticipantPortType getParticipantCompletionParticipantPort(W3CEndpointReference endpointReference,
+                                                         AttributedURI action,
+                                                         AddressingProperties addressingProperties)
+    {
+        BusinessAgreementWithParticipantCompletionParticipantService service = getParticipantCompletionParticipantService();
+        BusinessAgreementWithParticipantCompletionParticipantPortType port = service.getPort(endpointReference, BusinessAgreementWithParticipantCompletionParticipantPortType.class, new AddressingFeature(true, true));
+        BindingProvider bindingProvider = (BindingProvider)port;
+        /*
+         * we need to configure an instance identifier handler for this port to pass the tx context either
+         * outgoing or returning. We also have to add the the WSAdressing client handler to ensure that the
+         * addressing properties are encoded into the SOAP message
+         */
+        List<Handler> customHandlerChain = new ArrayList<Handler>();
+        customHandlerChain.add(new InstanceIdentifierHandlerWS());
+        customHandlerChain.add(new WSAddressingClientHandler());
+		bindingProvider.getBinding().setHandlerChain(customHandlerChain);
+        // the address will have been pulled out of the endpoint by getPort but we still have to set it in the
+        // addressing properties along with the action and message id
+        Map<String, Object> requestContext = bindingProvider.getRequestContext();
+        String address = (String)requestContext.get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
+        try {
+            addressingProperties.setTo(builder.newURI(address));
+        } catch (URISyntaxException use) {
+            // TODO -- log unexpected error here
+        }
+        addressingProperties.setAction(action);
+        requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES, addressingProperties);
+	    // jbossws should do this for us . . .
+	    requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, addressingProperties);
+
+        return port;
+    }
+
+    public static BusinessAgreementWithCoordinatorCompletionCoordinatorPortType getCoordinatorCompletionCoordinatorPort(W3CEndpointReference endpointReference,
+                                                                             AttributedURI action,
+                                                                             AddressingProperties addressingProperties)
+    {
+        BusinessAgreementWithCoordinatorCompletionCoordinatorService service = getCoordinatorCompletionCoordinatorService();
+        BusinessAgreementWithCoordinatorCompletionCoordinatorPortType port = service.getPort(endpointReference, BusinessAgreementWithCoordinatorCompletionCoordinatorPortType.class, new AddressingFeature(true, true));
+        BindingProvider bindingProvider = (BindingProvider)port;
+        /*
+         * we need to configure an instance identifier handler for this port to pass the tx context either
+         * outgoing or returning. We also have to add the the WSAdressing client handler to ensure that the
+         * addressing properties are encoded into the SOAP message
+         */
+        List<Handler> customHandlerChain = new ArrayList<Handler>();
+        customHandlerChain.add(new InstanceIdentifierHandlerWS());
+        customHandlerChain.add(new WSAddressingClientHandler());
+		bindingProvider.getBinding().setHandlerChain(customHandlerChain);
+        // the address will have been pulled out of the endpoint by getPort but we still have to set it in the
+        // addressing properties along with the action and message id
+        Map<String, Object> requestContext = bindingProvider.getRequestContext();
+        String address = (String)requestContext.get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
+        try {
+            addressingProperties.setTo(builder.newURI(address));
+        } catch (URISyntaxException use) {
+            // TODO -- log unexpected error here
+        }
+        addressingProperties.setAction(action);
+        requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES, addressingProperties);
+	    // jbossws should do this for us . . .
+	    requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, addressingProperties);
+
+        return port;
+    }
+
+    public static BusinessAgreementWithCoordinatorCompletionParticipantPortType getCoordinatorCompletionParticipantPort(W3CEndpointReference endpointReference,
+                                                                         AttributedURI action,
+                                                                         AddressingProperties addressingProperties)
+    {
+        BusinessAgreementWithCoordinatorCompletionParticipantService service = getCoordinatorCompletionParticipantService();
+        BusinessAgreementWithCoordinatorCompletionParticipantPortType port = service.getPort(endpointReference, BusinessAgreementWithCoordinatorCompletionParticipantPortType.class, new AddressingFeature(true, true));
+        BindingProvider bindingProvider = (BindingProvider)port;
+        /*
+         * we need to configure an instance identifier handler for this port to pass the tx context either
+         * outgoing or returning. We also have to add the the WSAdressing client handler to ensure that the
+         * addressing properties are encoded into the SOAP message
+         */
+        List<Handler> customHandlerChain = new ArrayList<Handler>();
+        customHandlerChain.add(new InstanceIdentifierHandlerWS());
+        customHandlerChain.add(new WSAddressingClientHandler());
+		bindingProvider.getBinding().setHandlerChain(customHandlerChain);
+        // the address will have been pulled out of the endpoint by getPort but we still have to set it in the
+        // addressing properties along with the action and message id
+        Map<String, Object> requestContext = bindingProvider.getRequestContext();
+        String address = (String)requestContext.get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
+        try {
+            addressingProperties.setTo(builder.newURI(address));
+        } catch (URISyntaxException use) {
+            // TODO -- log unexpected error here
+        }
+        addressingProperties.setAction(action);
+        requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES, addressingProperties);
+	    // jbossws should do this for us . . .
+	    requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, addressingProperties);
+
+        return port;
+    }
+}
\ No newline at end of file

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsba/processors/CoordinatorCompletionParticipantProcessorWS.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsba/processors/CoordinatorCompletionParticipantProcessorWS.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsba/processors/CoordinatorCompletionParticipantProcessorWS.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -115,14 +115,22 @@
     public abstract void exited(final NotificationType exited, final AddressingProperties addressingProperties, final ArjunaContextWS arjunaContext) ;
 
     /**
-     * Faulted.
-     * @param faulted The faulted notification.
+     * Not Completed.
+     * @param notCompleted The not completed notification.
      * @param addressingProperties The addressing context.
      * @param arjunaContext The arjuna context.
      */
-    public abstract void faulted(final NotificationType faulted, final AddressingProperties addressingProperties, final ArjunaContextWS arjunaContext) ;
+    public abstract void notCompleted(final NotificationType notCompleted, final AddressingProperties addressingProperties, final ArjunaContextWS arjunaContext) ;
 
     /**
+     * Failed.
+     * @param failed The failed notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void failed(final NotificationType failed, final AddressingProperties addressingProperties, final ArjunaContextWS arjunaContext) ;
+
+    /**
      * Get Status.
      * @param getStatus The get status notification.
      * @param addressingProperties The addressing context.

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsba/processors/ParticipantCompletionCoordinatorProcessorWS.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsba/processors/ParticipantCompletionCoordinatorProcessorWS.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsba/processors/ParticipantCompletionCoordinatorProcessorWS.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -109,6 +109,14 @@
         final ArjunaContextWS arjunaContext) ;
 
     /**
+     * Completed.
+     * @param cannotComplete The cannot complete notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void cannotComplete(final NotificationType cannotComplete, final AddressingProperties addressingProperties, final ArjunaContextWS arjunaContext);
+
+    /**
      * Exit.
      * @param exit The exit notification.
      * @param addressingProperties The addressing context.

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsba/processors/ParticipantCompletionParticipantProcessorWS.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsba/processors/ParticipantCompletionParticipantProcessorWS.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsba/processors/ParticipantCompletionParticipantProcessorWS.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -28,7 +28,6 @@
 
 import javax.xml.ws.addressing.AddressingProperties;
 
-
 /**
  * The Participant Completion Participant processor.
  * @author kevin
@@ -107,6 +106,14 @@
     public abstract void exited(final NotificationType exited, final AddressingProperties addressingProperties, final ArjunaContextWS arjunaContext) ;
 
     /**
+     * Not Completed.
+     * @param notCompleted The not completed notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void notCompleted(final NotificationType notCompleted, final AddressingProperties addressingProperties, final ArjunaContextWS arjunaContext) ;
+
+    /**
      * Faulted.
      * @param failed The failed notification.
      * @param addressingProperties The addressing context.

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsba/sei/BusinessAgreementWithCoordinatorCompletionCoordinatorPortTypeImpl.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsba/sei/BusinessAgreementWithCoordinatorCompletionCoordinatorPortTypeImpl.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsba/sei/BusinessAgreementWithCoordinatorCompletionCoordinatorPortTypeImpl.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -54,7 +54,7 @@
         final NotificationType completed = parameters;
         final AddressingProperties inboundAddressProperties
             = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
-        final ArjunaContextWS arjunaContext = ArjunaContextWS.getContext(ctx);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
 
         TaskManager.getManager().queueTask(new Task() {
             public void executeTask() {
@@ -77,7 +77,7 @@
         final ExceptionType fail = parameters;
         final AddressingProperties inboundAddressProperties
             = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
-        final ArjunaContextWS arjunaContext = ArjunaContextWS.getContext(ctx);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
 
         TaskManager.getManager().queueTask(new Task() {
             public void executeTask() {
@@ -100,7 +100,7 @@
         final NotificationType compensated = parameters;
         final AddressingProperties inboundAddressProperties
             = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
-        final ArjunaContextWS arjunaContext = ArjunaContextWS.getContext(ctx);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
 
         TaskManager.getManager().queueTask(new Task() {
             public void executeTask() {
@@ -123,7 +123,7 @@
         final NotificationType closed = parameters;
         final AddressingProperties inboundAddressProperties
             = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
-        final ArjunaContextWS arjunaContext = ArjunaContextWS.getContext(ctx);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
 
         TaskManager.getManager().queueTask(new Task() {
             public void executeTask() {
@@ -146,7 +146,7 @@
         final NotificationType canceled = parameters;
         final AddressingProperties inboundAddressProperties
             = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
-        final ArjunaContextWS arjunaContext = ArjunaContextWS.getContext(ctx);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
 
         TaskManager.getManager().queueTask(new Task() {
             public void executeTask() {
@@ -169,7 +169,7 @@
         final NotificationType exit = parameters;
         final AddressingProperties inboundAddressProperties
             = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
-        final ArjunaContextWS arjunaContext = ArjunaContextWS.getContext(ctx);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
 
         TaskManager.getManager().queueTask(new Task() {
             public void executeTask() {
@@ -192,7 +192,7 @@
         final NotificationType cannotComplete = parameters;
         final AddressingProperties inboundAddressProperties
             = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
-        final ArjunaContextWS arjunaContext = ArjunaContextWS.getContext(ctx);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
 
         TaskManager.getManager().queueTask(new Task() {
             public void executeTask() {
@@ -215,7 +215,7 @@
         final NotificationType getStatus = parameters;
         final AddressingProperties inboundAddressProperties
             = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
-        final ArjunaContextWS arjunaContext = ArjunaContextWS.getContext(ctx);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
 
         TaskManager.getManager().queueTask(new Task() {
             public void executeTask() {

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsba/sei/BusinessAgreementWithCoordinatorCompletionParticipantPortTypeImpl.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsba/sei/BusinessAgreementWithCoordinatorCompletionParticipantPortTypeImpl.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsba/sei/BusinessAgreementWithCoordinatorCompletionParticipantPortTypeImpl.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -1,14 +1,21 @@
 
 package com.arjuna.webservices.wsba.sei;
 
+import com.arjuna.services.framework.task.Task;
+import com.arjuna.services.framework.task.TaskManager;
+import com.arjuna.webservices.wsarj.ArjunaContextWS;
+import com.arjuna.webservices.wsba.processors.CoordinatorCompletionParticipantProcessorWS;
 import org.oasis_open.docs.ws_tx.wsba._2006._06.BusinessAgreementWithCoordinatorCompletionParticipantPortType;
 import org.oasis_open.docs.ws_tx.wsba._2006._06.NotificationType;
 import org.oasis_open.docs.ws_tx.wsba._2006._06.StatusType;
 
+import javax.annotation.Resource;
 import javax.jws.*;
 import javax.jws.soap.SOAPBinding;
-import javax.annotation.Resource;
 import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.JAXWSAConstants;
+import javax.xml.ws.handler.MessageContext;
 import javax.xml.ws.soap.Addressing;
 
 
@@ -41,6 +48,17 @@
         @WebParam(name = "Complete", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
         NotificationType parameters)
     {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType complete = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                CoordinatorCompletionParticipantProcessorWS.getProcessor().complete(complete, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
     }
 
     /**
@@ -53,6 +71,17 @@
         @WebParam(name = "Close", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
         NotificationType parameters)
     {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType close = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                CoordinatorCompletionParticipantProcessorWS.getProcessor().close(close, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
     }
 
     /**
@@ -65,6 +94,17 @@
         @WebParam(name = "Cancel", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
         NotificationType parameters)
     {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType cancel = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                CoordinatorCompletionParticipantProcessorWS.getProcessor().cancel(cancel, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
     }
 
     /**
@@ -77,6 +117,17 @@
         @WebParam(name = "Compensate", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
         NotificationType parameters)
     {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType compensate = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                CoordinatorCompletionParticipantProcessorWS.getProcessor().compensate(compensate, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
     }
 
     /**
@@ -89,6 +140,17 @@
         @WebParam(name = "Failed", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
         NotificationType parameters)
     {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType failed = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                CoordinatorCompletionParticipantProcessorWS.getProcessor().failed(failed, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
     }
 
     /**
@@ -101,6 +163,17 @@
         @WebParam(name = "Exited", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
         NotificationType parameters)
     {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType exited = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                CoordinatorCompletionParticipantProcessorWS.getProcessor().exited(exited, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
     }
 
     /**
@@ -113,6 +186,17 @@
         @WebParam(name = "NotCompleted", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
         NotificationType parameters)
     {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType notCompleted = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                CoordinatorCompletionParticipantProcessorWS.getProcessor().notCompleted(notCompleted, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
     }
 
     /**
@@ -125,6 +209,17 @@
         @WebParam(name = "GetStatus", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
         NotificationType parameters)
     {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType getStatus = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                CoordinatorCompletionParticipantProcessorWS.getProcessor().getStatus(getStatus, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
     }
 
     /**
@@ -137,5 +232,16 @@
         @WebParam(name = "Status", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
         StatusType parameters)
     {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final StatusType status = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                CoordinatorCompletionParticipantProcessorWS.getProcessor().status(status, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
     }
 }
\ No newline at end of file

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsba/sei/BusinessAgreementWithParticipantCompletionCoordinatorPortTypeImpl.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsba/sei/BusinessAgreementWithParticipantCompletionCoordinatorPortTypeImpl.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsba/sei/BusinessAgreementWithParticipantCompletionCoordinatorPortTypeImpl.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -1,15 +1,22 @@
 
 package com.arjuna.webservices.wsba.sei;
 
+import com.arjuna.services.framework.task.Task;
+import com.arjuna.services.framework.task.TaskManager;
+import com.arjuna.webservices.wsarj.ArjunaContextWS;
+import com.arjuna.webservices.wsba.processors.ParticipantCompletionCoordinatorProcessorWS;
 import org.oasis_open.docs.ws_tx.wsba._2006._06.BusinessAgreementWithParticipantCompletionCoordinatorPortType;
 import org.oasis_open.docs.ws_tx.wsba._2006._06.ExceptionType;
 import org.oasis_open.docs.ws_tx.wsba._2006._06.NotificationType;
 import org.oasis_open.docs.ws_tx.wsba._2006._06.StatusType;
 
+import javax.annotation.Resource;
 import javax.jws.*;
 import javax.jws.soap.SOAPBinding;
-import javax.annotation.Resource;
 import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.JAXWSAConstants;
+import javax.xml.ws.handler.MessageContext;
 import javax.xml.ws.soap.Addressing;
 
 /**
@@ -20,7 +27,7 @@
  */
 @WebService(name = "BusinessAgreementWithParticipantCompletionCoordinatorPortType", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06",
         wsdlLocation = "../wsdl/wsba-participant-completion-coordinator-binding.wsdl",
-        serviceName = "BusinessAgreementWithCoordinatorCompletionParticipantService",
+        serviceName = "BusinessAgreementWithParticipantCompletionCoordinatorService",
         portName = "BusinessAgreementWithParticipantCompletionCoordinatorPortType"
 )
 @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
@@ -41,6 +48,17 @@
         @WebParam(name = "Completed", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
         NotificationType parameters)
     {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType completed = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                ParticipantCompletionCoordinatorProcessorWS.getProcessor().completed(completed, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
     }
 
     /**
@@ -53,6 +71,17 @@
         @WebParam(name = "Fail", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
         ExceptionType parameters)
     {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final ExceptionType fail = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                ParticipantCompletionCoordinatorProcessorWS.getProcessor().fail(fail, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
     }
 
     /**
@@ -65,6 +94,17 @@
         @WebParam(name = "Compensated", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
         NotificationType parameters)
     {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType compensated = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                ParticipantCompletionCoordinatorProcessorWS.getProcessor().compensated(compensated, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
     }
 
     /**
@@ -77,6 +117,17 @@
         @WebParam(name = "Closed", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
         NotificationType parameters)
     {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType closed = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                ParticipantCompletionCoordinatorProcessorWS.getProcessor().closed(closed, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
     }
 
     /**
@@ -89,6 +140,17 @@
         @WebParam(name = "Canceled", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
         NotificationType parameters)
     {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType cancelled = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                ParticipantCompletionCoordinatorProcessorWS.getProcessor().cancelled(cancelled, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
     }
 
     /**
@@ -101,6 +163,17 @@
         @WebParam(name = "Exit", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
         NotificationType parameters)
     {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType exit = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                ParticipantCompletionCoordinatorProcessorWS.getProcessor().exit(exit, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
     }
 
     /**
@@ -113,6 +186,17 @@
         @WebParam(name = "CannotComplete", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
         NotificationType parameters)
     {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType cannotComplete = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                ParticipantCompletionCoordinatorProcessorWS.getProcessor().cannotComplete(cannotComplete, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
     }
 
     /**
@@ -125,6 +209,17 @@
         @WebParam(name = "GetStatus", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
         NotificationType parameters)
     {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType getStatus = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                ParticipantCompletionCoordinatorProcessorWS.getProcessor().getStatus(getStatus, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
     }
 
     /**
@@ -137,5 +232,16 @@
         @WebParam(name = "Status", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
         StatusType parameters)
     {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final StatusType status = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                ParticipantCompletionCoordinatorProcessorWS.getProcessor().status(status, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
     }
 }
\ No newline at end of file

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsba/sei/BusinessAgreementWithParticipantCompletionParticipantPortTypeImpl.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsba/sei/BusinessAgreementWithParticipantCompletionParticipantPortTypeImpl.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/webservices/wsba/sei/BusinessAgreementWithParticipantCompletionParticipantPortTypeImpl.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -1,14 +1,21 @@
 
 package com.arjuna.webservices.wsba.sei;
 
+import com.arjuna.services.framework.task.Task;
+import com.arjuna.services.framework.task.TaskManager;
+import com.arjuna.webservices.wsarj.ArjunaContextWS;
+import com.arjuna.webservices.wsba.processors.ParticipantCompletionParticipantProcessorWS;
 import org.oasis_open.docs.ws_tx.wsba._2006._06.BusinessAgreementWithParticipantCompletionParticipantPortType;
 import org.oasis_open.docs.ws_tx.wsba._2006._06.NotificationType;
 import org.oasis_open.docs.ws_tx.wsba._2006._06.StatusType;
 
+import javax.annotation.Resource;
 import javax.jws.*;
 import javax.jws.soap.SOAPBinding;
-import javax.annotation.Resource;
 import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.JAXWSAConstants;
+import javax.xml.ws.handler.MessageContext;
 import javax.xml.ws.soap.Addressing;
 
 
@@ -20,7 +27,7 @@
  */
 @WebService(name = "BusinessAgreementWithParticipantCompletionParticipantPortType", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06",
         wsdlLocation = "../wsdl/wsba-participant-completion-participant-binding.wsdl",
-        serviceName = "BusinessAgreementWithCoordinatorCompletionParticipantService",
+        serviceName = "BusinessAgreementWithParticipantCompletionParticipantService",
         portName = "BusinessAgreementWithParticipantCompletionParticipantPortType"
 )
 @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
@@ -41,6 +48,17 @@
         @WebParam(name = "Close", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
         NotificationType parameters)
     {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType close = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                ParticipantCompletionParticipantProcessorWS.getProcessor().close(close, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
     }
     /**
      *
@@ -52,6 +70,17 @@
         @WebParam(name = "Cancel", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
         NotificationType parameters)
     {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType cancel = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                ParticipantCompletionParticipantProcessorWS.getProcessor().cancel(cancel, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
     }
 
     /**
@@ -64,6 +93,17 @@
         @WebParam(name = "Compensate", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
         NotificationType parameters)
     {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType compensate = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                ParticipantCompletionParticipantProcessorWS.getProcessor().compensate(compensate, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
     }
 
     /**
@@ -76,6 +116,17 @@
         @WebParam(name = "Failed", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
         NotificationType parameters)
     {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType failed = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                ParticipantCompletionParticipantProcessorWS.getProcessor().failed(failed, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
     }
 
     /**
@@ -88,6 +139,17 @@
         @WebParam(name = "Exited", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
         NotificationType parameters)
     {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType exited = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                ParticipantCompletionParticipantProcessorWS.getProcessor().exited(exited, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
     }
 
     /**
@@ -100,6 +162,17 @@
         @WebParam(name = "NotCompleted", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
         NotificationType parameters)
     {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType notCompleted = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                ParticipantCompletionParticipantProcessorWS.getProcessor().notCompleted(notCompleted, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
     }
 
     /**
@@ -112,6 +185,17 @@
         @WebParam(name = "GetStatus", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
         NotificationType parameters)
     {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType getStatus = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                ParticipantCompletionParticipantProcessorWS.getProcessor().getStatus(getStatus, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
     }
 
     /**
@@ -124,5 +208,16 @@
         @WebParam(name = "Status", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
         StatusType parameters)
     {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final StatusType status = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContextWS arjunaContext = ArjunaContextWS.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                ParticipantCompletionParticipantProcessorWS.getProcessor().status(status, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
     }
 }
\ No newline at end of file

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/BusinessActivityTerminatorWS.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/BusinessActivityTerminatorWS.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/BusinessActivityTerminatorWS.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -39,6 +39,9 @@
 
 public interface BusinessActivityTerminatorWS extends BusinessActivityTerminator
 {
-
-    public W3CEndpointReference getTerminatorEndpoint() ;
+    /**
+     * return either the terminator or participant endpoint depending upon what type of terminator strub this is
+     * @return
+     */
+    public W3CEndpointReference getEndpoint() ;
 }
\ No newline at end of file

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/CompletionCoordinatorProcessorWSImpl.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/CompletionCoordinatorProcessorWSImpl.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/CompletionCoordinatorProcessorWSImpl.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -1,23 +1,25 @@
 package com.arjuna.wst.messaging;
 
-import com.arjuna.webservices.wsat.processors.CompletionCoordinatorProcessorWS;
-import com.arjuna.webservices.wsat.client.CompletionInitiatorClientWS;
-import com.arjuna.webservices.base.processors.ActivatedObjectProcessor;
-import com.arjuna.webservices.wsarj.InstanceIdentifierWS;
-import com.arjuna.webservices.wsarj.ArjunaContextWS;
-import com.arjuna.webservices.wsaddrws.AddressingHelper;
 import com.arjuna.webservices.SoapFault;
 import com.arjuna.webservices.SoapFaultType;
+import com.arjuna.webservices.base.processors.ActivatedObjectProcessor;
 import com.arjuna.webservices.logging.WSTLogger;
+import com.arjuna.webservices.wsaddrws.AddressingHelper;
+import com.arjuna.webservices.wsarj.ArjunaContextWS;
+import com.arjuna.webservices.wsarj.InstanceIdentifierWS;
 import com.arjuna.webservices.wsarjtx.ArjunaTXConstants;
-import com.arjuna.wst.*;
+import com.arjuna.webservices.wsat.client.CompletionInitiatorClientWS;
+import com.arjuna.webservices.wsat.processors.CompletionCoordinatorProcessorWS;
 import com.arjuna.wsc.messaging.MessageId;
-
-import java.text.MessageFormat;
-
+import com.arjuna.wsc.messaging.MessageIdWS;
+import com.arjuna.wst.CompletionCoordinatorParticipantWS;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.TransactionRolledBackException;
+import com.arjuna.wst.UnknownTransactionException;
 import org.oasis_open.docs.ws_tx.wsat._2006._06.Notification;
 
 import javax.xml.ws.addressing.AddressingProperties;
+import java.text.MessageFormat;
 
 /**
  * The Completion Coordinator processor.
@@ -86,7 +88,7 @@
         {
             if (participant != null)
             {
-                final String messageId = MessageId.getMessageId() ;
+                final String messageId = MessageIdWS.getMessageId() ;
                 try
                 {
                     participant.commit() ;
@@ -94,7 +96,7 @@
                 catch (final TransactionRolledBackException trbe)
                 {
                     final AddressingProperties responseAddressingContext =
-                        AddressingHelper.createNotificationContext(messageId) ;
+                        AddressingHelper.createResponseContext(addressingProperties, messageId) ;
                     CompletionInitiatorClientWS.getClient().sendAborted(participant.getParticipant(), responseAddressingContext, instanceIdentifier) ;
                     return ;
                 }
@@ -121,12 +123,12 @@
                     {
                         WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.CompletionCoordinatorProcessorWSImpl_3", th) ;
                     }
-                    final AddressingProperties faultAddressingContext = AddressingHelper.createFaultContext(addressingProperties, MessageId.getMessageId()) ;
+                    final AddressingProperties faultAddressingContext = AddressingHelper.createFaultContext(addressingProperties, MessageIdWS.getMessageId()) ;
                     final SoapFault soapFault = new SoapFault(th) ;
                     CompletionInitiatorClientWS.getClient().sendSoapFault(participant.getParticipant(), faultAddressingContext, soapFault, instanceIdentifier) ;
                     return ;
                 }
-                final AddressingProperties responseAddressingContext = AddressingHelper.createNotificationContext(messageId) ;
+                final AddressingProperties responseAddressingContext = AddressingHelper.createResponseContext(addressingProperties, messageId) ;
                 CompletionInitiatorClientWS.getClient().sendCommitted(participant.getParticipant(), responseAddressingContext, instanceIdentifier) ;
             }
             else
@@ -135,7 +137,7 @@
                 {
                     WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.CompletionCoordinatorProcessorWSImpl_4", new Object[] {instanceIdentifier}) ;
                 }
-                final AddressingProperties faultAddressingContext = AddressingHelper.createFaultContext(addressingProperties, MessageId.getMessageId()) ;
+                final AddressingProperties faultAddressingContext = AddressingHelper.createFaultContext(addressingProperties, MessageIdWS.getMessageId()) ;
                 final SoapFault soapFault = new SoapFault(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME,
                         WSTLogger.log_mesg.getString("com.arjuna.wst.messaging.CompletionCoordinatorProcessorWSImpl_5")) ;
                 CompletionInitiatorClientWS.getClient().sendSoapFault(participant.getParticipant(), faultAddressingContext, soapFault, instanceIdentifier) ;
@@ -163,7 +165,7 @@
         {
             if (participant != null)
             {
-                final String messageId = MessageId.getMessageId() ;
+                final String messageId = MessageIdWS.getMessageId() ;
                 try
                 {
                     participant.rollback() ;
@@ -191,12 +193,12 @@
                     {
                         WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.CompletionCoordinatorProcessorWSImpl_8", th) ;
                     }
-                    final AddressingProperties faultAddressingContext = AddressingHelper.createFaultContext(addressingProperties, MessageId.getMessageId()) ;
+                    final AddressingProperties faultAddressingContext = AddressingHelper.createFaultContext(addressingProperties, MessageIdWS.getMessageId()) ;
                     final SoapFault soapFault = new SoapFault(th) ;
                     CompletionInitiatorClientWS.getClient().sendSoapFault(participant.getParticipant(), faultAddressingContext, soapFault, instanceIdentifier) ;
                     return ;
                 }
-                final AddressingProperties responseAddressingContext = AddressingHelper.createNotificationContext(messageId) ;
+                final AddressingProperties responseAddressingContext = AddressingHelper.createResponseContext(addressingProperties, messageId) ;
                 CompletionInitiatorClientWS.getClient().sendAborted(participant.getParticipant(), responseAddressingContext, instanceIdentifier) ;
             }
             else
@@ -205,7 +207,7 @@
                 {
                     WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.CompletionCoordinatorProcessorWSImpl_9", new Object[] {instanceIdentifier}) ;
                 }
-                final AddressingProperties faultAddressingContext = AddressingHelper.createFaultContext(addressingProperties, MessageId.getMessageId()) ;
+                final AddressingProperties faultAddressingContext = AddressingHelper.createFaultContext(addressingProperties, MessageIdWS.getMessageId()) ;
                 final SoapFault soapFault = new SoapFault(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME,
                     WSTLogger.log_mesg.getString("com.arjuna.wst.messaging.CompletionCoordinatorProcessorWSImpl_10")) ;
                 CompletionInitiatorClientWS.getClient().sendSoapFault(participant.getParticipant(), faultAddressingContext, soapFault, instanceIdentifier) ;

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/CoordinatorCompletionCoordinatorProcessorWSImpl.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/CoordinatorCompletionCoordinatorProcessorWSImpl.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/CoordinatorCompletionCoordinatorProcessorWSImpl.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -27,9 +27,8 @@
 import com.arjuna.webservices.wsarj.ArjunaContextWS;
 import com.arjuna.webservices.wsarj.InstanceIdentifierWS;
 import com.arjuna.webservices.wsba.CoordinatorCompletionCoordinatorInboundEventsWS;
-import com.arjuna.webservices.wsba.client.CoordinatorCompletionParticipantClientWS;
 import com.arjuna.webservices.wsba.processors.CoordinatorCompletionCoordinatorProcessorWS;
-import com.arjuna.wsc.messaging.MessageId;
+import com.arjuna.wsc.messaging.MessageIdWS;
 import org.oasis_open.docs.ws_tx.wsba._2006._06.ExceptionType;
 import org.oasis_open.docs.ws_tx.wsba._2006._06.NotificationType;
 import org.oasis_open.docs.ws_tx.wsba._2006._06.StatusType;
@@ -440,7 +439,7 @@
     private void sendExited(final AddressingProperties addressingProperties, final ArjunaContextWS arjunaContext)
     {
         // KEV add check for recovery
-        final String messageId = MessageId.getMessageId() ;
+        final String messageId = MessageIdWS.getMessageId() ;
         final AddressingProperties responseAddressingContext = AddressingHelper.createNotificationContext(messageId) ;
         try
         {
@@ -467,7 +466,7 @@
     private void sendFailed(final AddressingProperties addressingProperties, final ArjunaContextWS arjunaContext)
     {
         // KEV add check for recovery
-        final String messageId = MessageId.getMessageId() ;
+        final String messageId = MessageIdWS.getMessageId() ;
         final AddressingProperties responseAddressingContext = AddressingHelper.createNotificationContext(messageId) ;
         try
         {

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/CoordinatorCompletionParticipantProcessorWSImpl.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/CoordinatorCompletionParticipantProcessorWSImpl.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/CoordinatorCompletionParticipantProcessorWSImpl.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -27,9 +27,9 @@
 import com.arjuna.webservices.wsarj.ArjunaContextWS;
 import com.arjuna.webservices.wsarj.InstanceIdentifierWS;
 import com.arjuna.webservices.wsba.CoordinatorCompletionParticipantInboundEventsWS;
-import com.arjuna.webservices.wsba.client.CoordinatorCompletionCoordinatorClientWS;
 import com.arjuna.webservices.wsba.processors.CoordinatorCompletionParticipantProcessorWS;
 import com.arjuna.wsc.messaging.MessageId;
+import com.arjuna.wsc.messaging.MessageIdWS;
 import org.oasis_open.docs.ws_tx.wsba._2006._06.NotificationType;
 import org.oasis_open.docs.ws_tx.wsba._2006._06.StatusType;
 
@@ -83,8 +83,8 @@
      * @param addressingProperties The addressing context.
      * @param arjunaContext The arjuna context.
      *
-     * @message com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.cancel_1 [com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..cancel_1] - Unexpected exception thrown from cancel:
-     * @message com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.cancel_2 [com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..cancel_2] - Cancel called on unknown participant: {0}
+     * @message com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.cancel_1 [com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.cancel_1] - Unexpected exception thrown from cancel:
+     * @message com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.cancel_2 [com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.cancel_2] - Cancel called on unknown participant: {0}
      */
     public void cancel(final NotificationType cancel, final AddressingProperties addressingProperties, final ArjunaContextWS arjunaContext)
     {
@@ -122,8 +122,8 @@
      * @param addressingProperties The addressing context.
      * @param arjunaContext The arjuna context.
      *
-     * @message com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..close_1 [com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..close_1] - Unexpected exception thrown from close:
-     * @message com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..close_2 [com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..close_2] - Close called on unknown participant: {0}
+     * @message com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.close_1 [com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.close_1] - Unexpected exception thrown from close:
+     * @message com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.close_2 [com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.close_2] - Close called on unknown participant: {0}
      */
     public void close(final NotificationType close, final AddressingProperties addressingProperties, final ArjunaContextWS arjunaContext)
     {
@@ -140,7 +140,7 @@
             {
                 if (WSTLogger.arjLoggerI18N.isDebugEnabled())
                 {
-                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..close_1", th) ;
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.close_1", th) ;
                 }
             }
         }
@@ -148,7 +148,7 @@
         {
             if (WSTLogger.arjLoggerI18N.isDebugEnabled())
             {
-                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..close_2", new Object[] {instanceIdentifier}) ;
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.close_2", new Object[] {instanceIdentifier}) ;
             }
             // TODO - cannot do this as we don't have an endpoint
             // sendClosed(addressingProperties, arjunaContext) ;
@@ -161,8 +161,8 @@
      * @param addressingProperties The addressing context.
      * @param arjunaContext The arjuna context.
      *
-     * @message com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..compensate_1 [com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..compensate_1] - Unexpected exception thrown from compensate:
-     * @message com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..compensate_2 [com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..compensate_2] - Compensate called on unknown participant: {0}
+     * @message com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.compensate_1 [com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.compensate_1] - Unexpected exception thrown from compensate:
+     * @message com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.compensate_2 [com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.compensate_2] - Compensate called on unknown participant: {0}
      */
     public void compensate(final NotificationType compensate, final AddressingProperties addressingProperties, final ArjunaContextWS arjunaContext)
     {
@@ -179,7 +179,7 @@
             {
                 if (WSTLogger.arjLoggerI18N.isDebugEnabled())
                 {
-                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..compensate_1", th) ;
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.compensate_1", th) ;
                 }
             }
         }
@@ -187,7 +187,7 @@
         {
             if (WSTLogger.arjLoggerI18N.isDebugEnabled())
             {
-                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..compensate_2", new Object[] {instanceIdentifier}) ;
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.compensate_2", new Object[] {instanceIdentifier}) ;
             }
             // TODO - cannot do this as we don't have an endpoint
             // sendCompensated(addressingProperties, arjunaContext) ;
@@ -200,9 +200,9 @@
      * @param addressingProperties The addressing context.
      * @param arjunaContext The arjuna context.
      *
-     * @message com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..complete_1 [com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..complete_1] - Unexpected exception thrown from complete:
-     * @message com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..complete_2 [com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..complete_2] - Complete called on unknown participant: {0}
-     * @message com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..complete_3 [com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..complete_3] - Complete called on unknown participant
+     * @message com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.complete_1 [com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.complete_1] - Unexpected exception thrown from complete:
+     * @message com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.complete_2 [com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.complete_2] - Complete called on unknown participant: {0}
+     * @message com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.complete_3 [com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.complete_3] - Complete called on unknown participant
      */
     public void complete(final NotificationType complete, final AddressingProperties addressingProperties, final ArjunaContextWS arjunaContext)
     {
@@ -219,7 +219,7 @@
             {
                 if (WSTLogger.arjLoggerI18N.isDebugEnabled())
                 {
-                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..complete_1", th) ;
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.complete_1", th) ;
                 }
             }
         }
@@ -227,10 +227,10 @@
         {
             if (WSTLogger.arjLoggerI18N.isDebugEnabled())
             {
-                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..complete_2", new Object[] {instanceIdentifier}) ;
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.complete_2", new Object[] {instanceIdentifier}) ;
             }
             // TODO - cannot do this as we don't have an endpoint
-            // sendFault(addressingProperties, arjunaContext, WSTLogger.log_mesg.getString("com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..complete_3")) ;
+            // sendFault(addressingProperties, arjunaContext, WSTLogger.log_mesg.getString("com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.complete_3")) ;
         }
     }
 
@@ -240,8 +240,8 @@
      * @param addressingProperties The addressing context.
      * @param arjunaContext The arjuna context.
      *
-     * @message com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..exited_1 [com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..exited_1] - Unexpected exception thrown from exited:
-     * @message com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..exited_2 [com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..exited_2] - Exited called on unknown participant: {0}
+     * @message com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.exited_1 [com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.exited_1] - Unexpected exception thrown from exited:
+     * @message com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.exited_2 [com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.exited_2] - Exited called on unknown participant: {0}
      */
     public void exited(final NotificationType exited, final AddressingProperties addressingProperties, final ArjunaContextWS arjunaContext)
     {
@@ -258,26 +258,26 @@
             {
                 if (WSTLogger.arjLoggerI18N.isDebugEnabled())
                 {
-                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..exited_1", th) ;
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.exited_1", th) ;
                 }
             }
         }
         else if (WSTLogger.arjLoggerI18N.isDebugEnabled())
         {
-            WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..exited_2", new Object[] {instanceIdentifier}) ;
+            WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.exited_2", new Object[] {instanceIdentifier}) ;
         }
     }
 
     /**
-     * Faulted.
-     * @param faulted The faulted notification.
+     * Not Completed.
+     * @param notCompleted The not completed notification.
      * @param addressingProperties The addressing context.
      * @param arjunaContext The arjuna context.
      *
-     * @message com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..faulted_1 [com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..faulted_1] - Unexpected exception thrown from faulted:
-     * @message com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..faulted_2 [com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..faulted_2] - Faulted called on unknown participant: {0}
+     * @message com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.notCompleted_1 [com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.notCompleted_1] - Unexpected exception thrown from notCompleted:
+     * @message com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.notCompleted_2 [com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.notCompleted_2] - NotCompleted called on unknown participant: {0}
      */
-    public void faulted(final NotificationType faulted, final AddressingProperties addressingProperties, final ArjunaContextWS arjunaContext)
+    public void notCompleted(final NotificationType notCompleted, final AddressingProperties addressingProperties, final ArjunaContextWS arjunaContext)
     {
         final InstanceIdentifierWS instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
         final CoordinatorCompletionParticipantInboundEventsWS participant = getParticipant(instanceIdentifier) ;
@@ -286,30 +286,64 @@
         {
             try
             {
-                participant.failed(faulted, addressingProperties, arjunaContext) ;
+                participant.notCompleted(notCompleted, addressingProperties, arjunaContext) ;
             }
             catch (final Throwable th)
             {
                 if (WSTLogger.arjLoggerI18N.isDebugEnabled())
                 {
-                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..faulted_1", th) ;
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.notCompleted_1", th) ;
                 }
             }
         }
         else if (WSTLogger.arjLoggerI18N.isDebugEnabled())
         {
-            WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..faulted_2", new Object[] {instanceIdentifier}) ;
+            WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.notCompleted_2", new Object[] {instanceIdentifier}) ;
         }
     }
 
     /**
+     * Failed.
+     * @param failed The failed notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.failed_1 [com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.failed_1] - Unexpected exception thrown from failed:
+     * @message com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.failed_2 [com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.failed_2] - Failed called on unknown participant: {0}
+     */
+    public void failed(final NotificationType failed, final AddressingProperties addressingProperties, final ArjunaContextWS arjunaContext)
+    {
+        final InstanceIdentifierWS instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final CoordinatorCompletionParticipantInboundEventsWS participant = getParticipant(instanceIdentifier) ;
+
+        if (participant != null)
+        {
+            try
+            {
+                participant.failed(failed, addressingProperties, arjunaContext) ;
+            }
+            catch (final Throwable th)
+            {
+                if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.faulted_1", th) ;
+                }
+            }
+        }
+        else if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+        {
+            WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.faulted_2", new Object[] {instanceIdentifier}) ;
+        }
+    }
+
+    /**
      * Get Status.
      * @param getStatus The get status notification.
      * @param addressingProperties The addressing context.
      * @param arjunaContext The arjuna context.
      *
-     * @message com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..getStatus_1 [com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..getStatus_1] - Unexpected exception thrown from getStatus:
-     * @message com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..getStatus_2 [com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..getStatus_2] - GetStatus called on unknown participant: {0}
+     * @message com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.getStatus_1 [com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.getStatus_1] - Unexpected exception thrown from getStatus:
+     * @message com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.getStatus_2 [com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.getStatus_2] - GetStatus called on unknown participant: {0}
      */
     public void getStatus(final NotificationType getStatus, final AddressingProperties addressingProperties, final ArjunaContextWS arjunaContext)
     {
@@ -326,13 +360,13 @@
             {
                 if (WSTLogger.arjLoggerI18N.isDebugEnabled())
                 {
-                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..getStatus_1", th) ;
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.getStatus_1", th) ;
                 }
             }
         }
         else if (WSTLogger.arjLoggerI18N.isDebugEnabled())
         {
-            WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..getStatus_2", new Object[] {instanceIdentifier}) ;
+            WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.getStatus_2", new Object[] {instanceIdentifier}) ;
         }
     }
 
@@ -342,8 +376,8 @@
      * @param addressingProperties The addressing context.
      * @param arjunaContext The arjuna context.
      *
-     * @message com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..status_1 [com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..status_1] - Unexpected exception thrown from status:
-     * @message com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..status_2 [com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..status_2] - Status called on unknown participant: {0}
+     * @message com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.status_1 [com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.status_1] - Unexpected exception thrown from status:
+     * @message com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.status_2 [com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.status_2] - Status called on unknown participant: {0}
      */
     public void status(final StatusType status, final AddressingProperties addressingProperties, final ArjunaContextWS arjunaContext)
     {
@@ -360,13 +394,13 @@
             {
                 if (WSTLogger.arjLoggerI18N.isDebugEnabled())
                 {
-                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..status_1", th) ;
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.status_1", th) ;
                 }
             }
         }
         else if (WSTLogger.arjLoggerI18N.isDebugEnabled())
         {
-            WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..status_2", new Object[] {instanceIdentifier}) ;
+            WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.status_2", new Object[] {instanceIdentifier}) ;
         }
     }
 
@@ -376,8 +410,8 @@
      * @param addressingProperties The addressing context.
      * @param arjunaContext The arjuna context.
      *
-     * @message com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..soapFault_1 [com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..soapFault_1] - Unexpected exception thrown from soapFault:
-     * @message com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..soapFault_2 [com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..soapFault_2] - SoapFault called on unknown participant: {0}
+     * @message com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.soapFault_1 [com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.soapFault_1] - Unexpected exception thrown from soapFault:
+     * @message com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.soapFault_2 [com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.soapFault_2] - SoapFault called on unknown participant: {0}
      */
     public void soapFault(final SoapFault fault, final AddressingProperties addressingProperties,
         final ArjunaContextWS arjunaContext)
@@ -395,13 +429,13 @@
             {
                 if (WSTLogger.arjLoggerI18N.isDebugEnabled())
                 {
-                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..soapFault_1", th) ;
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.soapFault_1", th) ;
                 }
             }
         }
         else if (WSTLogger.arjLoggerI18N.isDebugEnabled())
         {
-            WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl..soapFault_2", new Object[] {instanceIdentifier}) ;
+            WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.CoordinatorCompletionParticipantProcessorWSImpl.soapFault_2", new Object[] {instanceIdentifier}) ;
         }
     }
 
@@ -443,7 +477,7 @@
     private void sendClosed(final AddressingProperties addressingProperties, final ArjunaContextWS arjunaContext)
     {
         // KEV add check for recovery
-        final String messageId = MessageId.getMessageId() ;
+        final String messageId = MessageIdWS.getMessageId() ;
         final AddressingProperties responseAddressingProperties = AddressingHelper.createNotificationContext(messageId) ;
         try
         {
@@ -470,7 +504,7 @@
     private void sendCompensated(final AddressingProperties addressingProperties, final ArjunaContextWS arjunaContext)
     {
         // KEV add check for recovery
-        final String messageId = MessageId.getMessageId() ;
+        final String messageId = MessageIdWS.getMessageId() ;
         final AddressingProperties responseAddressingProperties = AddressingHelper.createNotificationContext(messageId) ;
         try
         {
@@ -498,7 +532,7 @@
     private void sendFault(final AddressingProperties addressingProperties, final ArjunaContextWS arjunaContext, final String exceptionIdentifier)
     {
         // KEV add check for recovery
-        final String messageId = MessageId.getMessageId() ;
+        final String messageId = MessageIdWS.getMessageId() ;
         final AddressingProperties responseAddressingProperties = AddressingHelper.createNotificationContext(messageId) ;
         try
         {

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/CoordinatorProcessorWSImpl.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/CoordinatorProcessorWSImpl.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/CoordinatorProcessorWSImpl.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -1,14 +1,15 @@
 package com.arjuna.wst.messaging;
 
-import com.arjuna.webservices.wsat.processors.CoordinatorProcessorWS;
-import com.arjuna.webservices.wsat.CoordinatorInboundEventsWS;
+import com.arjuna.webservices.SoapFault;
 import com.arjuna.webservices.base.processors.ActivatedObjectProcessor;
-import com.arjuna.webservices.wsarj.InstanceIdentifierWS;
-import com.arjuna.webservices.wsarj.ArjunaContextWS;
 import com.arjuna.webservices.logging.WSTLogger;
-import com.arjuna.webservices.SoapFault;
 import com.arjuna.webservices.wsaddrws.AddressingHelper;
+import com.arjuna.webservices.wsarj.ArjunaContextWS;
+import com.arjuna.webservices.wsarj.InstanceIdentifierWS;
+import com.arjuna.webservices.wsat.CoordinatorInboundEventsWS;
+import com.arjuna.webservices.wsat.processors.CoordinatorProcessorWS;
 import com.arjuna.wsc.messaging.MessageId;
+import com.arjuna.wsc.messaging.MessageIdWS;
 import org.oasis_open.docs.ws_tx.wsat._2006._06.Notification;
 
 import javax.xml.ws.addressing.AddressingProperties;
@@ -257,7 +258,7 @@
     private void sendInvalidState(final AddressingProperties addressingProperties, final ArjunaContextWS arjunaContext)
     {
         // KEV add check for recovery
-        final String responseMessageId = MessageId.getMessageId() ;
+        final String responseMessageId = MessageIdWS.getMessageId() ;
         final AddressingProperties responseAddressingContext = AddressingHelper.createNotificationContext(responseMessageId) ;
         final InstanceIdentifierWS instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
 
@@ -297,7 +298,7 @@
     private void sendRollback(final AddressingProperties addressingProperties, final ArjunaContextWS arjunaContext)
     {
         // KEV add check for recovery
-        final String messageId = MessageId.getMessageId() ;
+        final String messageId = MessageIdWS.getMessageId() ;
         final AddressingProperties responseAddressingContext = AddressingHelper.createNotificationContext(messageId) ;
         final InstanceIdentifierWS instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
         /*

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/ParticipantCompletionCoordinatorProcessorWSImpl.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/ParticipantCompletionCoordinatorProcessorWSImpl.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/ParticipantCompletionCoordinatorProcessorWSImpl.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -27,9 +27,8 @@
 import com.arjuna.webservices.wsarj.ArjunaContextWS;
 import com.arjuna.webservices.wsarj.InstanceIdentifierWS;
 import com.arjuna.webservices.wsba.ParticipantCompletionCoordinatorInboundEventsWS;
-import com.arjuna.webservices.wsba.client.ParticipantCompletionParticipantClientWS;
 import com.arjuna.webservices.wsba.processors.ParticipantCompletionCoordinatorProcessorWS;
-import com.arjuna.wsc.messaging.MessageId;
+import com.arjuna.wsc.messaging.MessageIdWS;
 import org.oasis_open.docs.ws_tx.wsba._2006._06.ExceptionType;
 import org.oasis_open.docs.ws_tx.wsba._2006._06.NotificationType;
 import org.oasis_open.docs.ws_tx.wsba._2006._06.StatusType;
@@ -216,6 +215,41 @@
     }
 
     /**
+     * Completed.
+     * @param cannotComplete The cannot complete notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst.messaging.ParticipantCompletionCoordinatorProcessorWSImpl.cannotComplete_1 [com.arjuna.wst.messaging.ParticipantCompletionCoordinatorProcessorWSImpl.cannotComplete_1] - Unexpected exception thrown from cannot complete:
+     * @message com.arjuna.wst.messaging.ParticipantCompletionCoordinatorProcessorWSImpl.cannotComplete_2 [com.arjuna.wst.messaging.ParticipantCompletionCoordinatorProcessorWSImpl.cannotComplete_2] - Cannot complete called on unknown coordinator: {0}
+     */
+    public void cannotComplete(final NotificationType cannotComplete, final AddressingProperties addressingProperties,
+        final ArjunaContextWS arjunaContext)
+    {
+        final InstanceIdentifierWS instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final ParticipantCompletionCoordinatorInboundEventsWS coordinator = getCoordinator(instanceIdentifier) ;
+
+        if (coordinator != null)
+        {
+            try
+            {
+                coordinator.cannotComplete(cannotComplete, addressingProperties, arjunaContext) ;
+            }
+            catch (final Throwable th)
+            {
+                if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.ParticipantCompletionCoordinatorProcessorWSImpl.completed_1", th) ;
+                }
+            }
+        }
+        else if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+        {
+            WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.ParticipantCompletionCoordinatorProcessorWSImpl.completed_2", new Object[] {instanceIdentifier}) ;
+        }
+    }
+
+    /**
      * Exit.
      * @param exit The exit notification.
      * @param addressingProperties The addressing context.
@@ -406,7 +440,7 @@
     private void sendExited(final AddressingProperties addressingProperties, final ArjunaContextWS arjunaContext)
     {
         // KEV add check for recovery
-        final String messageId = MessageId.getMessageId() ;
+        final String messageId = MessageIdWS.getMessageId() ;
         final AddressingProperties responseAddressingProperties = AddressingHelper.createNotificationContext(messageId) ;
         try
         {
@@ -433,7 +467,7 @@
     private void sendFailed(final AddressingProperties addressingProperties, final ArjunaContextWS arjunaContext)
     {
         // KEV add check for recovery
-        final String messageId = MessageId.getMessageId() ;
+        final String messageId = MessageIdWS.getMessageId() ;
         final AddressingProperties responseAddressingProperties = AddressingHelper.createNotificationContext(  messageId) ;
         try
         {

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/ParticipantCompletionParticipantProcessorWSImpl.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/ParticipantCompletionParticipantProcessorWSImpl.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/ParticipantCompletionParticipantProcessorWSImpl.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -27,9 +27,9 @@
 import com.arjuna.webservices.wsarj.ArjunaContextWS;
 import com.arjuna.webservices.wsarj.InstanceIdentifierWS;
 import com.arjuna.webservices.wsba.ParticipantCompletionParticipantInboundEventsWS;
-import com.arjuna.webservices.wsba.client.ParticipantCompletionCoordinatorClientWS;
 import com.arjuna.webservices.wsba.processors.ParticipantCompletionParticipantProcessorWS;
 import com.arjuna.wsc.messaging.MessageId;
+import com.arjuna.wsc.messaging.MessageIdWS;
 import org.oasis_open.docs.ws_tx.wsba._2006._06.NotificationType;
 import org.oasis_open.docs.ws_tx.wsba._2006._06.StatusType;
 
@@ -226,6 +226,40 @@
     }
 
     /**
+     * Not Completed.
+     * @param notCompleted The not completed notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst.messaging.ParticipantCompletionParticipantProcessorWSImpl.notCompleted_1 [com.arjuna.wst.messaging.ParticipantCompletionParticipantProcessorWSImpl.notCompleted_1] - Unexpected exception thrown from notCompleted:
+     * @message com.arjuna.wst.messaging.ParticipantCompletionParticipantProcessorWSImpl.notCompleted_2 [com.arjuna.wst.messaging.ParticipantCompletionParticipantProcessorWSImpl.notCompleted_2] - Exited called on unknown participant: {0}
+     */
+    public void notCompleted(final NotificationType notCompleted, final AddressingProperties addressingProperties, final ArjunaContextWS arjunaContext)
+    {
+        final InstanceIdentifierWS  instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final ParticipantCompletionParticipantInboundEventsWS participant = getParticipant(instanceIdentifier) ;
+
+        if (participant != null)
+        {
+            try
+            {
+                participant.notCompleted(notCompleted, addressingProperties, arjunaContext) ;
+            }
+            catch (final Throwable th)
+            {
+                if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.ParticipantCompletionParticipantProcessorWSImpl.notCompleted_1", th) ;
+                }
+            }
+        }
+        else if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+        {
+            WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.ParticipantCompletionParticipantProcessorWSImpl.notCompleted_2", new Object[] {instanceIdentifier}) ;
+        }
+    }
+
+    /**
      * Failed.
      * @param failed The failed notification.
      * @param addressingProperties The addressing context.
@@ -373,7 +407,7 @@
     private void sendCancelled(final AddressingProperties addressingProperties, final ArjunaContextWS arjunaContext)
     {
         // KEV add check for recovery
-        final String messageId = MessageId.getMessageId() ;
+        final String messageId = MessageIdWS.getMessageId() ;
         final AddressingProperties responseAddressingProperties = AddressingHelper.createNotificationContext(messageId) ;
         try
         {
@@ -400,7 +434,7 @@
     private void sendClosed(final AddressingProperties addressingProperties, final ArjunaContextWS arjunaContext)
     {
         // KEV add check for recovery
-        final String messageId = MessageId.getMessageId() ;
+        final String messageId = MessageIdWS.getMessageId() ;
         final AddressingProperties responseAddressingProperties = AddressingHelper.createNotificationContext(messageId) ;
         try
         {
@@ -427,7 +461,7 @@
     private void sendCompensated(final AddressingProperties addressingProperties, final ArjunaContextWS arjunaContext)
     {
         // KEV add check for recovery
-        final String messageId = MessageId.getMessageId() ;
+        final String messageId = MessageIdWS.getMessageId() ;
         final AddressingProperties responseAddressingProperties = AddressingHelper.createNotificationContext(messageId) ;
         try
         {

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/ParticipantProcessorWSImpl.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/ParticipantProcessorWSImpl.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/ParticipantProcessorWSImpl.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -1,15 +1,14 @@
 package com.arjuna.wst.messaging;
 
-import com.arjuna.webservices.wsat.processors.ParticipantProcessorWS;
-import com.arjuna.webservices.wsat.ParticipantInboundEventsWS;
-import com.arjuna.webservices.wsat.client.CoordinatorClientWS;
+import com.arjuna.webservices.SoapFault;
 import com.arjuna.webservices.base.processors.ActivatedObjectProcessor;
-import com.arjuna.webservices.wsarj.InstanceIdentifierWS;
-import com.arjuna.webservices.wsarj.ArjunaContextWS;
 import com.arjuna.webservices.logging.WSTLogger;
-import com.arjuna.webservices.SoapFault;
 import com.arjuna.webservices.wsaddrws.AddressingHelper;
-import com.arjuna.wsc.messaging.MessageId;
+import com.arjuna.webservices.wsarj.ArjunaContextWS;
+import com.arjuna.webservices.wsarj.InstanceIdentifierWS;
+import com.arjuna.webservices.wsat.ParticipantInboundEventsWS;
+import com.arjuna.webservices.wsat.processors.ParticipantProcessorWS;
+import com.arjuna.wsc.messaging.MessageIdWS;
 import org.oasis_open.docs.ws_tx.wsat._2006._06.Notification;
 
 import javax.xml.ws.addressing.AddressingProperties;
@@ -221,8 +220,8 @@
     private void sendCommitted(final AddressingProperties addressingProperties, final ArjunaContextWS arjunaContext)
     {
         // KEV add check for recovery
-        final String messageId = MessageId.getMessageId() ;
-        final AddressingProperties responseAddressingProperties = AddressingHelper.createNotificationContext(messageId) ;
+        final String messageId = MessageIdWS.getMessageId() ;
+        final AddressingProperties responseAddressingProperties = AddressingHelper.createResponseContext(addressingProperties, messageId) ;
         final InstanceIdentifierWS instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
         /*
          * TODO - fix this. participant is null and we cannto send a message without an endpoint
@@ -251,8 +250,8 @@
     private void sendAborted(final AddressingProperties addressingProperties, final ArjunaContextWS arjunaContext)
     {
         // KEV add check for recovery
-        final String messageId = MessageId.getMessageId() ;
-        final AddressingProperties responseAddressingProperties = AddressingHelper.createNotificationContext(messageId) ;
+        final String messageId = MessageIdWS.getMessageId() ;
+        final AddressingProperties responseAddressingProperties = AddressingHelper.createResponseContext(addressingProperties, messageId) ;
         final InstanceIdentifierWS instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
         /*
          * TODO - fix this. participant is null and we cannto send a message without an endpoint

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/TerminationCoordinatorProcessorWSImpl.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/TerminationCoordinatorProcessorWSImpl.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/TerminationCoordinatorProcessorWSImpl.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -32,6 +32,7 @@
 import com.arjuna.webservices.wsarjtx.client.TerminationParticipantClientWS;
 import com.arjuna.webservices.wsarjtx.processors.TerminationCoordinatorProcessorWS;
 import com.arjuna.wsc.messaging.MessageId;
+import com.arjuna.wsc.messaging.MessageIdWS;
 import com.arjuna.wst.*;
 
 import javax.xml.ws.addressing.AddressingProperties;
@@ -85,12 +86,12 @@
         activatedObjectProcessor.deactivateObject(participant) ;
     }
 
-    /**
+   /**
      * Get the participant with the specified identifier.
      * @param instanceIdentifier The participant identifier.
      * @return The participant or null if not known.
      */
-    private BusinessActivityTerminatorWS getParticipant(final InstanceIdentifierWS instanceIdentifier)
+    public BusinessActivityTerminatorWS getParticipant(final InstanceIdentifierWS instanceIdentifier)
     {
         final String identifier = (instanceIdentifier != null ? instanceIdentifier.getInstanceIdentifier() : null) ;
         return (BusinessActivityTerminatorWS)activatedObjectProcessor.getObject(identifier) ;
@@ -112,9 +113,9 @@
         {
             if (participant != null)
             {
-                W3CEndpointReference endpoint = participant.getTerminatorEndpoint();
+                W3CEndpointReference endpoint = participant.getEndpoint();
 
-                final String messageId = MessageId.getMessageId() ;
+                final String messageId = MessageIdWS.getMessageId() ;
                 try
                 {
                     participant.cancel() ;
@@ -148,7 +149,7 @@
                     {
                         WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.TerminationCoordinatorProcessorWSImpl_3", th) ;
                     }
-                    final AddressingProperties faultAddressingProperties = AddressingHelper.createNotificationContext(MessageId.getMessageId()) ;
+                    final AddressingProperties faultAddressingProperties = AddressingHelper.createNotificationContext(MessageIdWS.getMessageId()) ;
                     final SoapFault soapFault = new SoapFault(th) ;
                     TerminationParticipantClientWS.getClient().sendSoapFault(endpoint, faultAddressingProperties, soapFault, instanceIdentifier) ;
                     return ;
@@ -192,16 +193,16 @@
         {
             if (participant != null)
             {
-                W3CEndpointReference endpoint = participant.getTerminatorEndpoint();
+                W3CEndpointReference endpoint = participant.getEndpoint();
 
-                final String messageId = MessageId.getMessageId() ;
+                final String messageId = MessageIdWS.getMessageId() ;
                 try
                 {
                     participant.close() ;
                 }
                 catch (final UnknownTransactionException ute)
                 {
-                    final AddressingProperties faultAddressingProperties = AddressingHelper.createNotificationContext(messageId) ;
+                    final AddressingProperties faultAddressingProperties = AddressingHelper.createFaultContext(addressingProperties, messageId) ;
                     final SoapFault soapFault = new SoapFault(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME,
                         WSTLogger.log_mesg.getString("com.arjuna.wst.messaging.TerminationCoordinatorProcessorWSImpl_6")) ;
                     TerminationParticipantClientWS.getClient().sendSoapFault(endpoint, faultAddressingProperties, soapFault, instanceIdentifier) ;
@@ -209,7 +210,7 @@
                 }
                 catch (final TransactionRolledBackException trbe)
                 {
-                    final AddressingProperties faultAddressingProperties = AddressingHelper.createNotificationContext(messageId) ;
+                    final AddressingProperties faultAddressingProperties = AddressingHelper.createFaultContext(addressingProperties, messageId) ;
                     final SoapFault soapFault = new SoapFault(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.TRANSACTIONROLLEDBACK_ERROR_CODE_QNAME,
                         WSTLogger.log_mesg.getString("com.arjuna.wst.messaging.TerminationCoordinatorProcessorWSImpl_7")) ;
                     TerminationParticipantClientWS.getClient().sendSoapFault(endpoint, faultAddressingProperties, soapFault, instanceIdentifier) ;
@@ -217,7 +218,7 @@
                 }
                 catch (final SystemException se)
                 {
-                    final AddressingProperties faultAddressingProperties = AddressingHelper.createNotificationContext(messageId) ;
+                    final AddressingProperties faultAddressingProperties = AddressingHelper.createFaultContext(addressingProperties, messageId) ;
                     final String pattern = WSTLogger.log_mesg.getString("com.arjuna.wst.messaging.TerminationCoordinatorProcessorWSImpl_8") ;
                     final String message = MessageFormat.format(pattern, new Object[] {se}) ;
                     final SoapFault soapFault = new SoapFault(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNERROR_ERROR_CODE_QNAME, message) ;
@@ -230,13 +231,13 @@
                     {
                         WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.TerminationCoordinatorProcessorWSImpl_9", th) ;
                     }
-                    final AddressingProperties faultAddressingProperties = AddressingHelper.createNotificationContext(MessageId.getMessageId()) ;
+                    final AddressingProperties faultAddressingProperties = AddressingHelper.createFaultContext(addressingProperties, MessageIdWS.getMessageId()) ;
                     final SoapFault soapFault = new SoapFault(th) ;
                     TerminationParticipantClientWS.getClient().sendSoapFault(endpoint, faultAddressingProperties, soapFault, instanceIdentifier) ;
                     return ;
                 }
                 final AddressingProperties responseAddressingProperties =
-                    AddressingHelper.createNotificationContext(messageId) ;
+                    AddressingHelper.createResponseContext(addressingProperties, messageId) ;
                 TerminationParticipantClientWS.getClient().sendClosed(endpoint, responseAddressingProperties, instanceIdentifier) ;
             }
             else
@@ -274,9 +275,9 @@
         {
             if (participant != null)
             {
-                W3CEndpointReference endpoint = participant.getTerminatorEndpoint();
+                W3CEndpointReference endpoint = participant.getEndpoint();
 
-                final String messageId = MessageId.getMessageId() ;
+                final String messageId = MessageIdWS.getMessageId() ;
                 try
                 {
                     participant.complete() ;
@@ -310,7 +311,7 @@
                     {
                         WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.TerminationCoordinatorProcessorWSImpl_14", th) ;
                     }
-                    final AddressingProperties faultAddressingProperties = AddressingHelper.createNotificationContext(MessageId.getMessageId()) ;
+                    final AddressingProperties faultAddressingProperties = AddressingHelper.createNotificationContext(MessageIdWS.getMessageId()) ;
                     final SoapFault soapFault = new SoapFault(th) ;
                     TerminationParticipantClientWS.getClient().sendSoapFault(endpoint, faultAddressingProperties, soapFault, instanceIdentifier) ;
                     return ;

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/deploy/TransactionWSInitialisation.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/deploy/TransactionWSInitialisation.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/deploy/TransactionWSInitialisation.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -47,7 +47,7 @@
      */
     public void contextInitialized(final ServletContextEvent servletContextEvent)
     {
-        Sequencer.Callback callback = new Sequencer.Callback(Sequencer.WEBAPP_WST) {
+        Sequencer.Callback callback = new Sequencer.Callback(Sequencer.WEBAPP_WST11) {
            public void run() {
                CompletionCoordinatorProcessorWS.setProcessor(new CompletionCoordinatorProcessorWSImpl()) ;
                ParticipantProcessorWS.setProcessor(new ParticipantProcessorWSImpl()) ;

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/engines/CoordinatorCompletionCoordinatorEngineWS.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/engines/CoordinatorCompletionCoordinatorEngineWS.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/engines/CoordinatorCompletionCoordinatorEngineWS.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -30,7 +30,7 @@
 import com.arjuna.webservices.wsba.StateWS;
 import com.arjuna.webservices.wsba.client.CoordinatorCompletionParticipantClientWS;
 import com.arjuna.webservices.wsba.processors.CoordinatorCompletionCoordinatorProcessorWS;
-import com.arjuna.wsc.messaging.MessageId;
+import com.arjuna.wsc.messaging.MessageIdWS;
 import com.arjuna.wst.BAParticipantManagerWS;
 import org.oasis_open.docs.ws_tx.wsba._2006._06.ExceptionType;
 import org.oasis_open.docs.ws_tx.wsba._2006._06.NotificationType;
@@ -974,7 +974,7 @@
      */
     private AddressingProperties createContext()
     {
-        final String messageId = MessageId.getMessageId() ;
+        final String messageId = MessageIdWS.getMessageId() ;
         return AddressingHelper.createNotificationContext(messageId) ;
     }
 }
\ No newline at end of file

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/engines/CoordinatorCompletionParticipantEngineWS.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/engines/CoordinatorCompletionParticipantEngineWS.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/engines/CoordinatorCompletionParticipantEngineWS.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -31,7 +31,7 @@
 import com.arjuna.webservices.wsba.StateWS;
 import com.arjuna.webservices.wsba.client.CoordinatorCompletionCoordinatorClientWS;
 import com.arjuna.webservices.wsba.processors.CoordinatorCompletionParticipantProcessorWS;
-import com.arjuna.wsc.messaging.MessageId;
+import com.arjuna.wsc.messaging.MessageIdWS;
 import com.arjuna.wst.BusinessAgreementWithCoordinatorCompletionParticipant;
 import com.arjuna.wst.FaultedException;
 import org.oasis_open.docs.ws_tx.wsba._2006._06.NotificationType;
@@ -1068,7 +1068,7 @@
      */
     private AddressingProperties createContext()
     {
-        final String messageId = MessageId.getMessageId() ;
+        final String messageId = MessageIdWS.getMessageId() ;
         return AddressingHelper.createNotificationContext(messageId) ;
     }
 }
\ No newline at end of file

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/engines/CoordinatorEngineWS.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/engines/CoordinatorEngineWS.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/engines/CoordinatorEngineWS.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -1,29 +1,28 @@
 package com.arjuna.wst.messaging.engines;
 
-import com.arjuna.webservices.wsat.StateWS;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.SoapFaultType;
+import com.arjuna.webservices.logging.WSTLogger;
+import com.arjuna.webservices.util.TransportTimer;
+import com.arjuna.webservices.wsaddrws.AddressingHelper;
+import com.arjuna.webservices.wsarj.ArjunaContextWS;
+import com.arjuna.webservices.wsarj.InstanceIdentifierWS;
 import com.arjuna.webservices.wsat.CoordinatorInboundEventsWS;
+import com.arjuna.webservices.wsat.StateWS;
 import com.arjuna.webservices.wsat.client.ParticipantClientWS;
 import com.arjuna.webservices.wsat.processors.CoordinatorProcessorWS;
-import com.arjuna.webservices.wsarj.InstanceIdentifierWS;
-import com.arjuna.webservices.wsarj.ArjunaContextWS;
-import com.arjuna.webservices.SoapFault;
-import com.arjuna.webservices.SoapFaultType;
 import com.arjuna.webservices.wscoor.CoordinationConstantsWS;
-import com.arjuna.webservices.wsaddrws.AddressingHelper;
-import com.arjuna.webservices.util.TransportTimer;
-import com.arjuna.webservices.logging.WSTLogger;
-import com.arjuna.wsc.messaging.MessageId;
+import com.arjuna.wsc.messaging.MessageIdWS;
+import org.oasis_open.docs.ws_tx.wsat._2006._06.Notification;
 
 import javax.xml.namespace.QName;
-import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import javax.xml.ws.addressing.AddressingBuilder;
 import javax.xml.ws.addressing.AddressingProperties;
 import javax.xml.ws.addressing.AttributedURI;
-import javax.xml.ws.addressing.AddressingBuilder;
 import javax.xml.ws.addressing.Relationship;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
 import java.util.TimerTask;
 
-import org.oasis_open.docs.ws_tx.wsat._2006._06.Notification;
-
 /**
  * The coordinator state engine
  * @author kevin
@@ -593,7 +592,7 @@
      */
     private AddressingProperties createContext()
     {
-        final String messageId = MessageId.getMessageId() ;
+        final String messageId = MessageIdWS.getMessageId() ;
         return AddressingHelper.createNotificationContext(messageId) ;
     }
 }

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/engines/ParticipantCompletionCoordinatorEngineWS.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/engines/ParticipantCompletionCoordinatorEngineWS.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/engines/ParticipantCompletionCoordinatorEngineWS.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -30,7 +30,7 @@
 import com.arjuna.webservices.wsba.StateWS;
 import com.arjuna.webservices.wsba.client.ParticipantCompletionParticipantClientWS;
 import com.arjuna.webservices.wsba.processors.ParticipantCompletionCoordinatorProcessorWS;
-import com.arjuna.wsc.messaging.MessageId;
+import com.arjuna.wsc.messaging.MessageIdWS;
 import com.arjuna.wst.BAParticipantManagerWS;
 import org.oasis_open.docs.ws_tx.wsba._2006._06.ExceptionType;
 import org.oasis_open.docs.ws_tx.wsba._2006._06.NotificationType;
@@ -869,7 +869,7 @@
      */
     private AddressingProperties createContext()
     {
-        final String messageId = MessageId.getMessageId() ;
+        final String messageId = MessageIdWS.getMessageId() ;
         return AddressingHelper.createNotificationContext(messageId);
     }
 }
\ No newline at end of file

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/engines/ParticipantCompletionParticipantEngineWS.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/engines/ParticipantCompletionParticipantEngineWS.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/engines/ParticipantCompletionParticipantEngineWS.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -31,7 +31,7 @@
 import com.arjuna.webservices.wsba.StateWS;
 import com.arjuna.webservices.wsba.client.ParticipantCompletionCoordinatorClientWS;
 import com.arjuna.webservices.wsba.processors.ParticipantCompletionParticipantProcessorWS;
-import com.arjuna.wsc.messaging.MessageId;
+import com.arjuna.wsc.messaging.MessageIdWS;
 import com.arjuna.wst.BusinessAgreementWithParticipantCompletionParticipant;
 import com.arjuna.wst.FaultedException;
 import org.oasis_open.docs.ws_tx.wsba._2006._06.NotificationType;
@@ -947,7 +947,7 @@
      */
     private AddressingProperties createContext()
     {
-        final String messageId = MessageId.getMessageId() ;
+        final String messageId = MessageIdWS.getMessageId() ;
         return AddressingHelper.createNotificationContext(messageId) ;
     }
 }
\ No newline at end of file

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/engines/ParticipantEngineWS.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/engines/ParticipantEngineWS.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/messaging/engines/ParticipantEngineWS.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -12,7 +12,7 @@
 import com.arjuna.webservices.wsat.client.CoordinatorClientWS;
 import com.arjuna.webservices.wsat.processors.ParticipantProcessorWS;
 import com.arjuna.webservices.wscoor.CoordinationConstantsWS;
-import com.arjuna.wsc.messaging.MessageId;
+import com.arjuna.wsc.messaging.MessageIdWS;
 import com.arjuna.wst.*;
 import org.oasis_open.docs.ws_tx.wsat._2006._06.Notification;
 
@@ -564,7 +564,7 @@
      */
     private AddressingProperties createContext()
     {
-        final String messageId = MessageId.getMessageId() ;
+        final String messageId = MessageIdWS.getMessageId() ;
         return AddressingHelper.createNotificationContext(messageId) ;
     }
     

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/stub/BusinessActivityTerminatorStubWS.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/stub/BusinessActivityTerminatorStubWS.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/stub/BusinessActivityTerminatorStubWS.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -38,6 +38,7 @@
 import com.arjuna.webservices.wsarjtx.processors.TerminationParticipantCallbackWS;
 import com.arjuna.webservices.wsarjtx.processors.TerminationParticipantProcessorWS;
 import com.arjuna.wsc.messaging.MessageId;
+import com.arjuna.wsc.messaging.MessageIdWS;
 import com.arjuna.wst.FaultedException;
 import com.arjuna.wst.SystemException;
 import com.arjuna.wst.TransactionRolledBackException;
@@ -62,7 +63,7 @@
     public void close ()
         throws TransactionRolledBackException, UnknownTransactionException, SystemException
     {
-        final AddressingProperties addressingProperties = AddressingHelper.createNotificationContext(MessageId.getMessageId()) ;
+        final AddressingProperties addressingProperties = AddressingHelper.createNotificationContext(MessageIdWS.getMessageId()) ;
 
         final RequestCallback callback = new RequestCallback() ;
         final TerminationParticipantProcessorWS terminationParticipantProcessor = TerminationParticipantProcessorWS.getProcessor() ;
@@ -107,7 +108,7 @@
     public void cancel ()
         throws FaultedException, UnknownTransactionException, SystemException
     {
-        final AddressingProperties addressingProperties = AddressingHelper.createNotificationContext(MessageId.getMessageId()) ;
+        final AddressingProperties addressingProperties = AddressingHelper.createNotificationContext(MessageIdWS.getMessageId()) ;
 
         final RequestCallback callback = new RequestCallback() ;
         final TerminationParticipantProcessorWS terminationParticipantProcessor = TerminationParticipantProcessorWS.getProcessor() ;
@@ -152,7 +153,7 @@
     public void complete ()
         throws FaultedException, UnknownTransactionException, SystemException
     {
-        final AddressingProperties addressingProperties = AddressingHelper.createNotificationContext(MessageId.getMessageId()) ;
+        final AddressingProperties addressingProperties = AddressingHelper.createNotificationContext(MessageIdWS.getMessageId()) ;
 
         final RequestCallback callback = new RequestCallback() ;
         final TerminationParticipantProcessorWS terminationParticipantProcessor = TerminationParticipantProcessorWS.getProcessor() ;
@@ -194,7 +195,7 @@
         throw new SystemException() ;
     }
 
-    public W3CEndpointReference getTerminatorEndpoint()
+    public W3CEndpointReference getEndpoint()
     {
         return _terminationCoordinator;
     }
@@ -216,7 +217,7 @@
     public void error ()
         throws SystemException
     {
-        final AddressingProperties addressingProperties = AddressingHelper.createNotificationContext(MessageId.getMessageId()) ;
+        final AddressingProperties addressingProperties = AddressingHelper.createNotificationContext(MessageIdWS.getMessageId()) ;
         final SoapFault soapFault = new SoapFault(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNERROR_ERROR_CODE_QNAME,
                 WSTLogger.log_mesg.getString("com.arjuna.wst.stub.BusinessActivityTerminatorStubWS_1")) ;
         try

Modified: labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/stub/CompletionStubWS.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/stub/CompletionStubWS.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WS-T/dev/src/com/arjuna/wst/stub/CompletionStubWS.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -1,23 +1,22 @@
 package com.arjuna.wst.stub;
 
-import com.arjuna.webservices.wsat.processors.CompletionInitiatorProcessorWS;
-import com.arjuna.webservices.wsat.processors.CompletionInitiatorCallbackWS;
-import com.arjuna.webservices.wsat.client.CompletionCoordinatorClientWS;
-import com.arjuna.webservices.wsarj.ArjunaContextWS;
-import com.arjuna.webservices.wsarj.InstanceIdentifierWS;
 import com.arjuna.webservices.SoapFault;
 import com.arjuna.webservices.wsaddrws.AddressingHelper;
+import com.arjuna.webservices.wsarj.ArjunaContextWS;
+import com.arjuna.webservices.wsarj.InstanceIdentifierWS;
 import com.arjuna.webservices.wsarjtx.ArjunaTXConstants;
+import com.arjuna.webservices.wsat.client.CompletionCoordinatorClientWS;
+import com.arjuna.webservices.wsat.processors.CompletionInitiatorCallbackWS;
+import com.arjuna.webservices.wsat.processors.CompletionInitiatorProcessorWS;
+import com.arjuna.wsc.messaging.MessageIdWS;
+import com.arjuna.wst.SystemException;
 import com.arjuna.wst.TransactionRolledBackException;
 import com.arjuna.wst.UnknownTransactionException;
-import com.arjuna.wst.SystemException;
-import com.arjuna.wsc.messaging.MessageId;
+import org.oasis_open.docs.ws_tx.wsat._2006._06.Notification;
 
 import javax.xml.ws.addressing.AddressingProperties;
 import javax.xml.ws.wsaddressing.W3CEndpointReference;
 
-import org.oasis_open.docs.ws_tx.wsat._2006._06.Notification;
-
 public class CompletionStubWS implements
 		com.arjuna.wst.CompletionCoordinatorParticipant
 {
@@ -34,7 +33,7 @@
 	public void commit () throws TransactionRolledBackException,
             UnknownTransactionException, SystemException
     {
-        final AddressingProperties addressingProperties = AddressingHelper.createNotificationContext(MessageId.getMessageId()) ;
+        final AddressingProperties addressingProperties = AddressingHelper.createNotificationContext(MessageIdWS.getMessageId()) ;
 
         final CompletionStubWS.RequestCallback callback = new CompletionStubWS.RequestCallback() ;
         final CompletionInitiatorProcessorWS completionInitiator = CompletionInitiatorProcessorWS.getProcessor() ;
@@ -76,7 +75,7 @@
 
 	public void rollback () throws UnknownTransactionException, SystemException
 	{
-        final AddressingProperties addressingProperties = AddressingHelper.createNotificationContext(MessageId.getMessageId()) ;
+        final AddressingProperties addressingProperties = AddressingHelper.createNotificationContext(MessageIdWS.getMessageId()) ;
 
         final CompletionStubWS.RequestCallback callback = new CompletionStubWS.RequestCallback() ;
         final CompletionInitiatorProcessorWS completionInitiator = CompletionInitiatorProcessorWS.getProcessor() ;

Modified: labs/jbosstm/workspace/adinn/XTSGF/WSTX/classes/com/arjuna/mw/wst/client/JaxBaseHeaderContextProcessorWS.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WSTX/classes/com/arjuna/mw/wst/client/JaxBaseHeaderContextProcessorWS.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WSTX/classes/com/arjuna/mw/wst/client/JaxBaseHeaderContextProcessorWS.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -110,7 +110,7 @@
                 {
                     header = env.addHeader() ;
                 }
-                final Name name = env.createName(CoordinationConstantsWS.WSCOOR_ELEMENT_COORDINATION_CONTEXT, CoordinationConstantsWS.WSCOOR_PREFIX, CoordinationConstants.WSCOOR_NAMESPACE) ;
+                final Name name = env.createName(CoordinationConstantsWS.WSCOOR_ELEMENT_COORDINATION_CONTEXT, CoordinationConstantsWS.WSCOOR_PREFIX, CoordinationConstantsWS.WSCOOR_NAMESPACE) ;
                 final SOAPHeaderElement headerElement = header.addHeaderElement(name) ;
                 headerElement.addNamespaceDeclaration(CoordinationConstantsWS.WSCOOR_PREFIX, CoordinationConstantsWS.WSCOOR_NAMESPACE) ;
                 headerElement.setMustUnderstand(true) ;

Modified: labs/jbosstm/workspace/adinn/XTSGF/WSTX/classes/com/arjuna/mw/wst/common/CoordinationContextHelperWS.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WSTX/classes/com/arjuna/mw/wst/common/CoordinationContextHelperWS.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WSTX/classes/com/arjuna/mw/wst/common/CoordinationContextHelperWS.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -48,7 +48,7 @@
             JAXBContext jaxbContext = JAXBContext.newInstance("org.oasis_open.docs.ws_tx.wscoor._2006._06");
             Unmarshaller unmarshaller;
             unmarshaller = jaxbContext.createUnmarshaller();
-            CoordinationContextType coordinationContextType = (CoordinationContextType)unmarshaller.unmarshal(headerElement);
+            CoordinationContextType coordinationContextType = unmarshaller.unmarshal(headerElement.getFirstChild(), CoordinationContextType.class).getValue();
 
             return coordinationContextType;
         } catch (JAXBException jaxbe) {

Modified: labs/jbosstm/workspace/adinn/XTSGF/WSTX/classes/com/arjuna/mwlabs/wst/at/ContextFactoryWSImple.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WSTX/classes/com/arjuna/mwlabs/wst/at/ContextFactoryWSImple.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WSTX/classes/com/arjuna/mwlabs/wst/at/ContextFactoryWSImple.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -162,29 +162,7 @@
                     expiresInstance.setValue(transactionExpires);
                     coordinationContext.setExpires(expiresInstance);
                 }
-                final W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
-                builder.serviceName(CoordinationConstantsWS.REGISTRATION_SERVICE_QNAME);
-                builder.endpointName(CoordinationConstantsWS.REGISTRATION_ENDPOINT_QNAME);
-                // strictly we shouldn't need either of these in order to get an epref we can hand on
-                // to the client. since we are in the same Java EE app this should be enough to spec an
-                // epref which let sthe client call back to the registration endpoint. in fcat even if we
-                // supply wsdl and address we still only get a half-baked epref with no metadata installed.
-                // this menas any epref we create here is essentially useless: it cannot be use dto obtain
-                // a stub for calling back to the service nor can it be inspected to obtain the service
-                // name, endpoint name and address. however since JaxWS forces us to return this datatype
-                // when the wsdl specifies a WSA endpoint we have no choice about using it. snookered!
-                builder.address(registrationCoordinatorURI);
-                builder.wsdlDocumentLocation(registrationCoordinatorURI + "?wsdl");
-                InstanceIdentifierWS.setEndpointInstanceIdentifier(builder, arjunaContext.getTransactionIdentifier());
-                // here's another attempt to fix the missing functionality -- we can try supplying metadata by hand
-                // using the format dictated by the Web Services Metadata Exchange Specification (MEX). Unfortunately,
-                // this also fails to work. the metadata is indeed successfully transferred to the client in the
-                // W3CEndpointreference. Unfortunately when teh spi.Provider code converts it to a local (Sun)
-                // WSEndpointReference instance under W3CEndpointReference.getPort() it throws away the metadata
-                // element supplied here, installs its own empty Metadata object then complains because there is no
-                //  WSDL metadata!
-                addMetadataWSDLRef(builder, registrationCoordinatorURI + "?wsdl");
-                W3CEndpointReference registrationCoordinator = builder.build();
+                W3CEndpointReference registrationCoordinator = getRegistrationCoordinator(registrationCoordinatorURI, arjunaContext);
                 coordinationContext.setRegistrationService(registrationCoordinator) ;
 
 				/*
@@ -245,7 +223,19 @@
 		return null;
 	}
 
-	/**
+    private static W3CEndpointReference getRegistrationCoordinator(String registrationCoordinatorURI, ArjunaContextWSImple arjunaContext) {
+        final W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
+        builder.serviceName(CoordinationConstantsWS.REGISTRATION_SERVICE_QNAME);
+        builder.endpointName(CoordinationConstantsWS.REGISTRATION_ENDPOINT_QNAME);
+        // strictly we shouldn't need to set the address because we are in the same web app as the
+        // coordinator but we have to as the W3CEndpointReference implementation is incomplete
+        builder.address(registrationCoordinatorURI);
+        InstanceIdentifierWS.setEndpointInstanceIdentifier(builder, arjunaContext.getTransactionIdentifier());
+        W3CEndpointReference registrationCoordinator = builder.build();
+        return registrationCoordinator;
+    }
+
+    /**
 	 * Called when a context factory is removed from a context factory mapper.
 	 * This method will be called multiple times if the context factory is
 	 * removed from multiple context factory mappers or from the same context

Modified: labs/jbosstm/workspace/adinn/XTSGF/WSTX/classes/com/arjuna/mwlabs/wst/at/RegistrarWSImple.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WSTX/classes/com/arjuna/mwlabs/wst/at/RegistrarWSImple.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WSTX/classes/com/arjuna/mwlabs/wst/at/RegistrarWSImple.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -36,9 +36,9 @@
 		// register with mapper using tx id as protocol identifier.
         final RegistrarMapperWS mapper = RegistrarMapperWS.getFactory() ;
 
-		mapper.addRegistrar(AtomicTransactionConstants.WSAT_SUB_PROTOCOL_DURABLE_2PC, this);
-		mapper.addRegistrar(AtomicTransactionConstants.WSAT_SUB_PROTOCOL_VOLATILE_2PC, this);
-		mapper.addRegistrar(AtomicTransactionConstants.WSAT_SUB_PROTOCOL_COMPLETION, this);
+		mapper.addRegistrar(AtomicTransactionWSConstants.WSAT_SUB_PROTOCOL_DURABLE_2PC, this);
+		mapper.addRegistrar(AtomicTransactionWSConstants.WSAT_SUB_PROTOCOL_VOLATILE_2PC, this);
+		mapper.addRegistrar(AtomicTransactionWSConstants.WSAT_SUB_PROTOCOL_COMPLETION, this);
 	}
 
 	/**
@@ -119,7 +119,7 @@
 
 		// TODO check for AlreadyRegisteredException
 
-		if (AtomicTransactionConstants.WSAT_SUB_PROTOCOL_DURABLE_2PC.equals(protocolIdentifier))
+		if (AtomicTransactionWSConstants.WSAT_SUB_PROTOCOL_DURABLE_2PC.equals(protocolIdentifier))
 		{
 			// enlist participant that wraps the requester URI.
 			final String participantId = "D" + new Uid().stringForm();
@@ -138,7 +138,7 @@
 				throw new InvalidStateException();
 			}
 		}
-		else if (AtomicTransactionConstants.WSAT_SUB_PROTOCOL_VOLATILE_2PC.equals(protocolIdentifier))
+		else if (AtomicTransactionWSConstants.WSAT_SUB_PROTOCOL_VOLATILE_2PC.equals(protocolIdentifier))
 		{
 			// enlist participant that wraps the requester URI.
 			final String participantId = "V" + new Uid().stringForm();
@@ -157,7 +157,7 @@
 				throw new InvalidStateException();
 			}
 		}
-		else if (AtomicTransactionConstants.WSAT_SUB_PROTOCOL_COMPLETION.equals(protocolIdentifier))
+		else if (AtomicTransactionWSConstants.WSAT_SUB_PROTOCOL_COMPLETION.equals(protocolIdentifier))
 		{
 			try
 			{
@@ -224,7 +224,7 @@
 			throws AlreadyRegisteredException, InvalidProtocolException,
 			InvalidStateException, NoActivityException
     {
-		if (AtomicTransactionConstants.WSAT_SUB_PROTOCOL_DURABLE_2PC.equals(protocolIdentifier))
+		if (AtomicTransactionWSConstants.WSAT_SUB_PROTOCOL_DURABLE_2PC.equals(protocolIdentifier))
 		{
 			// enlist participant that wraps the requester URI.
             final String participantId = "D" + new Uid().stringForm();
@@ -241,7 +241,7 @@
                 throw new InvalidStateException();
             }
 		}
-		else if (AtomicTransactionConstants.WSAT_SUB_PROTOCOL_VOLATILE_2PC.equals(protocolIdentifier))
+		else if (AtomicTransactionWSConstants.WSAT_SUB_PROTOCOL_VOLATILE_2PC.equals(protocolIdentifier))
 		{
 			// enlist participant that wraps the requester URI.
             final String participantId = "V" + new Uid().stringForm();
@@ -258,7 +258,7 @@
                 throw new InvalidStateException();
             }
 		}
-		else if (AtomicTransactionConstants.WSAT_SUB_PROTOCOL_COMPLETION.equals(protocolIdentifier))
+		else if (AtomicTransactionWSConstants.WSAT_SUB_PROTOCOL_COMPLETION.equals(protocolIdentifier))
 		{
 			// not allowed for subordinate transactions!
 

Modified: labs/jbosstm/workspace/adinn/XTSGF/WSTX/classes/com/arjuna/mwlabs/wst/at/context/ArjunaContextWSImple.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WSTX/classes/com/arjuna/mwlabs/wst/at/context/ArjunaContextWSImple.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WSTX/classes/com/arjuna/mwlabs/wst/at/context/ArjunaContextWSImple.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -41,8 +41,7 @@
 import com.arjuna.mw.wscf.utils.DomUtil;
 import com.arjuna.mw.wstx.logging.wstxLogger;
 import com.arjuna.mwlabs.wscf.model.twophase.arjunacore.ACCoordinator;
-import com.arjuna.webservices.wsat.AtomicTransactionConstants;
-import com.arjuna.webservices.wscoor.CoordinationConstants;
+import com.arjuna.webservices.wsat.AtomicTransactionWSConstants;
 import com.arjuna.webservices.wscoor.CoordinationConstantsWS;
 import org.w3c.dom.Element;
 
@@ -166,7 +165,7 @@
                 _context.appendChild(expires);
 
                 Element coordinationType = doc.createElement("wscoor:" + _coordinationType);
-                coordinationType.appendChild(doc.createTextNode(AtomicTransactionConstants.WSAT_PROTOCOL));
+                coordinationType.appendChild(doc.createTextNode(AtomicTransactionWSConstants.WSAT_PROTOCOL));
 
                 _context.appendChild(coordinationType);
 

Modified: labs/jbosstm/workspace/adinn/XTSGF/WSTX/classes/com/arjuna/mwlabs/wst/at/remote/TransactionManagerWSImple.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WSTX/classes/com/arjuna/mwlabs/wst/at/remote/TransactionManagerWSImple.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WSTX/classes/com/arjuna/mwlabs/wst/at/remote/TransactionManagerWSImple.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -38,7 +38,7 @@
     {
 		try
 		{
-			final W3CEndpointReference coordinator = registerParticipant(getParticipant(id) , AtomicTransactionConstants.WSAT_SUB_PROTOCOL_DURABLE_2PC);
+			final W3CEndpointReference coordinator = registerParticipant(getParticipant(id), AtomicTransactionWSConstants.WSAT_SUB_PROTOCOL_DURABLE_2PC);
 
 			ParticipantProcessorWS.getProcessor().activateParticipant(new ParticipantEngineWS(tpp, id, coordinator), id) ;
 		}
@@ -62,7 +62,7 @@
 	{
 		try
 		{
-			final W3CEndpointReference coordinator = registerParticipant(getParticipant(id), AtomicTransactionConstants.WSAT_SUB_PROTOCOL_VOLATILE_2PC);
+			final W3CEndpointReference coordinator = registerParticipant(getParticipant(id), AtomicTransactionWSConstants.WSAT_SUB_PROTOCOL_VOLATILE_2PC);
 
 			ParticipantProcessorWS.getProcessor().activateParticipant(new ParticipantEngineWS(tpp, id, coordinator), id) ;
 		}
@@ -131,7 +131,7 @@
 			if (currentTx == null)
 				throw new com.arjuna.wsc.NoActivityException();
 
-			return registerParticipant(participantEndpoint, AtomicTransactionConstants.WSAT_SUB_PROTOCOL_COMPLETION);
+			return registerParticipant(participantEndpoint, AtomicTransactionWSConstants.WSAT_SUB_PROTOCOL_COMPLETION);
 		}
 		catch (com.arjuna.wsc.InvalidProtocolException ex)
 		{

Modified: labs/jbosstm/workspace/adinn/XTSGF/WSTX/classes/com/arjuna/mwlabs/wst/ba/BusinessActivityTerminatorWSImple.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WSTX/classes/com/arjuna/mwlabs/wst/ba/BusinessActivityTerminatorWSImple.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WSTX/classes/com/arjuna/mwlabs/wst/ba/BusinessActivityTerminatorWSImple.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -1,9 +1,14 @@
 package com.arjuna.mwlabs.wst.ba;
 
+import com.arjuna.webservices.ServiceRegistryWS;
+import com.arjuna.webservices.wsarj.InstanceIdentifierWS;
+import com.arjuna.webservices.wsarjtx.ArjunaTXWSConstants;
+import com.arjuna.webservices.wsat.AtomicTransactionWSConstants;
 import com.arjuna.wst.BusinessActivityTerminatorWS;
 import com.arjuna.wst.SystemException;
 
 import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import javax.xml.ws.wsaddressing.W3CEndpointReferenceBuilder;
 
 /**
  * Local business activity terminator which can be used to close a business activity from the terminator
@@ -13,17 +18,37 @@
         extends BusinessActivityTerminatorImple
         implements BusinessActivityTerminatorWS
 {
+    private W3CEndpointReference participantEndpoint;
+
+    /**
+     * create a business activity terminator for use on the server side with an empty participant endpoint
+     * which gets set at registration time
+     * @throws SystemException
+     */
     public BusinessActivityTerminatorWSImple()
             throws SystemException
     {
         super();
+        participantEndpoint = null;
     }
 
-    public W3CEndpointReference getTerminatorEndpoint()
+    /**
+     * update the business activity terminator with an endpoint supplied at registration time
+     *
+     * @param participantEndpoint
+     */
+    public void setEndpoint(W3CEndpointReference participantEndpoint)
     {
-        // we need to implement this to satisfy the interaface used by TerminationCorodinatorProcessor
-        // but since it gets run on the termination coordinator side it doesn't actually need to return
-        // an endpoint and will never actually get called
-        return null;
+        this.participantEndpoint = participantEndpoint;
     }
+
+    /**
+     * retrieve the participant endpoint associated with this business activity terminator
+     * 
+     * @return
+     */
+    public W3CEndpointReference getEndpoint()
+    {
+        return participantEndpoint;
+    }
 }

Modified: labs/jbosstm/workspace/adinn/XTSGF/WSTX/classes/com/arjuna/mwlabs/wst/ba/ContextFactoryWSImple.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WSTX/classes/com/arjuna/mwlabs/wst/ba/ContextFactoryWSImple.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WSTX/classes/com/arjuna/mwlabs/wst/ba/ContextFactoryWSImple.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -34,15 +34,15 @@
 import com.arjuna.mw.wscf.model.sagas.CoordinatorManagerFactory;
 import com.arjuna.mw.wscf.model.sagas.api.CoordinatorManager;
 import com.arjuna.mw.wstx.logging.wstxLogger;
-import com.arjuna.mwlabs.wst.ba.context.ArjunaContextImple;
+import com.arjuna.mwlabs.wst.ba.context.ArjunaContextWSImple;
 import com.arjuna.webservices.ServiceRegistryWS;
 import com.arjuna.webservices.wsarj.InstanceIdentifierWS;
 import com.arjuna.webservices.wsarjtx.processors.TerminationCoordinatorProcessorWS;
-import com.arjuna.webservices.wsba.BusinessActivityConstants;
 import com.arjuna.webservices.wsba.BusinessActivityWSConstants;
 import com.arjuna.webservices.wscoor.CoordinationConstantsWS;
 import com.arjuna.wsc.ContextFactoryWS;
 import com.arjuna.wsc.InvalidCreateParametersException;
+import com.arjuna.wst.BusinessActivityTerminatorWS;
 import org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContext;
 import org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContextType;
 import org.oasis_open.docs.ws_tx.wscoor._2006._06.Expires;
@@ -127,7 +127,7 @@
 
     		_coordManager.begin(timeout);
 
-            final ArjunaContextImple arjunaContext = ArjunaContextImple.getContext() ;
+            final ArjunaContextWSImple arjunaContext = ArjunaContextWSImple.getContext() ;
             final ServiceRegistryWS serviceRegistry = ServiceRegistryWS.getRegistry() ;
             final String registrationCoordinatorURI = serviceRegistry.getServiceURI(CoordinationConstantsWS.REGISTRATION_SERVICE_NAME) ;
 
@@ -135,6 +135,7 @@
             coordinationContext.setCoordinationType(coordinationTypeURI) ;
             CoordinationContextType.Identifier identifier = new CoordinationContextType.Identifier();
             identifier.setValue("urn:"+arjunaContext.getTransactionIdentifier());
+            coordinationContext.setIdentifier(identifier) ;
             final int transactionExpires = arjunaContext.getTransactionExpires() ;
             if (transactionExpires > 0)
             {
@@ -142,15 +143,12 @@
                 expiresInstance.setValue(transactionExpires);
                 coordinationContext.setExpires(expiresInstance);
             }
-            final W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
-            builder.serviceName(CoordinationConstantsWS.REGISTRATION_SERVICE_QNAME);
-            builder.endpointName(CoordinationConstantsWS.REGISTRATION_ENDPOINT_QNAME);
-            builder.address(registrationCoordinatorURI);
-            InstanceIdentifierWS.setEndpointInstanceIdentifier(builder, arjunaContext.getTransactionIdentifier());
-            W3CEndpointReference registrationCoordinator = builder.build();
+            final W3CEndpointReference registrationCoordinator = getRegistrationCoordinator(registrationCoordinatorURI, arjunaContext);
             coordinationContext.setRegistrationService(registrationCoordinator) ;
 
-            TerminationCoordinatorProcessorWS.getProcessor().activateParticipant(new BusinessActivityTerminatorWSImple(), arjunaContext.getTransactionIdentifier()) ;
+            String transactionIdentifier = arjunaContext.getTransactionIdentifier();
+            BusinessActivityTerminatorWS terminator = new BusinessActivityTerminatorWSImple();
+            TerminationCoordinatorProcessorWS.getProcessor().activateParticipant(terminator, transactionIdentifier);
 
     		_theRegistrar.associate();
 
@@ -184,14 +182,26 @@
 	else
 	{
 	    wstxLogger.arjLoggerI18N.warn("com.arjuna.mwlabs.wst.ba.ContextFactoryWSImple_1",
-					  new Object[]{BusinessActivityConstants.WSBA_PROTOCOL_ATOMIC_OUTCOME, coordinationTypeURI});
+					  new Object[]{BusinessActivityWSConstants.WSBA_PROTOCOL_ATOMIC_OUTCOME, coordinationTypeURI});
 
-	    throw new InvalidCreateParametersException(wstxLogger.log_mesg.getString("com.arjuna.mwlabs.wst.ba.ContextFactoryWSImple_3")+" < "+BusinessActivityConstants.WSBA_PROTOCOL_ATOMIC_OUTCOME+", "+coordinationTypeURI+" >");
+	    throw new InvalidCreateParametersException(wstxLogger.log_mesg.getString("com.arjuna.mwlabs.wst.ba.ContextFactoryWSImple_3")+" < "+BusinessActivityWSConstants.WSBA_PROTOCOL_ATOMIC_OUTCOME+", "+coordinationTypeURI+" >");
 	}
 
 	return null;
     }
 
+    private static W3CEndpointReference getRegistrationCoordinator(String registrationCoordinatorURI, ArjunaContextWSImple arjunaContext) {
+        final W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
+        builder.serviceName(CoordinationConstantsWS.REGISTRATION_SERVICE_QNAME);
+        builder.endpointName(CoordinationConstantsWS.REGISTRATION_ENDPOINT_QNAME);
+        // strictly we shouldn't need to set the address because we are in the same web app as the
+        // coordinator but we have to as the W3CEndpointReference implementation is incomplete
+        builder.address(registrationCoordinatorURI);
+        InstanceIdentifierWS.setEndpointInstanceIdentifier(builder, arjunaContext.getTransactionIdentifier());
+        W3CEndpointReference registrationCoordinator = builder.build();
+        return registrationCoordinator;
+    }
+
     /**
      * Called when a context factory is removed from a context factory mapper. This method will be called multiple
      * times if the context factory is removed from multiple context factory mappers or from the same context factory

Modified: labs/jbosstm/workspace/adinn/XTSGF/WSTX/classes/com/arjuna/mwlabs/wst/ba/RegistrarWSImple.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WSTX/classes/com/arjuna/mwlabs/wst/ba/RegistrarWSImple.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WSTX/classes/com/arjuna/mwlabs/wst/ba/RegistrarWSImple.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -44,9 +44,10 @@
 import com.arjuna.webservices.wsarj.InstanceIdentifierWS;
 import com.arjuna.webservices.wsarjtx.ArjunaTXConstants;
 import com.arjuna.webservices.wsarjtx.ArjunaTXWSConstants;
-import com.arjuna.webservices.wsba.BusinessActivityConstants;
+import com.arjuna.webservices.wsarjtx.processors.TerminationCoordinatorProcessorWS;
 import com.arjuna.webservices.wsba.BusinessActivityWSConstants;
 import com.arjuna.wsc.*;
+import com.arjuna.wst.BusinessActivityTerminatorWS;
 import com.arjuna.wst.messaging.engines.CoordinatorCompletionCoordinatorEngineWS;
 import com.arjuna.wst.messaging.engines.ParticipantCompletionCoordinatorEngineWS;
 import com.arjuna.wst.stub.BusinessAgreementWithCoordinatorCompletionStubWS;
@@ -69,10 +70,10 @@
 		final RegistrarMapperWS mapper = RegistrarMapperWS.getFactory();
 
 		mapper.addRegistrar(
-			BusinessActivityConstants.WSBA_SUB_PROTOCOL_PARTICIPANT_COMPLETION, this);
+			BusinessActivityWSConstants.WSBA_SUB_PROTOCOL_PARTICIPANT_COMPLETION, this);
 		mapper.addRegistrar(
-			BusinessActivityConstants.WSBA_SUB_PROTOCOL_COORDINATOR_COMPLETION, this);
-		// mapper.addRegistrar(ArjunaTXConstants.WSARJTX_PROTOCOL_TERMINATION, this);
+			BusinessActivityWSConstants.WSBA_SUB_PROTOCOL_COORDINATOR_COMPLETION, this);
+		mapper.addRegistrar(ArjunaTXConstants.WSARJTX_PROTOCOL_TERMINATION, this);
 	}
 
 	/**
@@ -141,7 +142,7 @@
 
 		// TODO check for AlreadyRegisteredException
 
-		if (BusinessActivityConstants.WSBA_SUB_PROTOCOL_PARTICIPANT_COMPLETION
+		if (BusinessActivityWSConstants.WSBA_SUB_PROTOCOL_PARTICIPANT_COMPLETION
 				.equals(protocolIdentifier))
 		{
 			// enlist participant that wraps the requester URI.
@@ -170,7 +171,7 @@
 			}
 		}
 		else
-			if (BusinessActivityConstants.WSBA_SUB_PROTOCOL_COORDINATOR_COMPLETION
+			if (BusinessActivityWSConstants.WSBA_SUB_PROTOCOL_COORDINATOR_COMPLETION
 					.equals(protocolIdentifier))
 			{
 				final String id = new Uid().stringForm();
@@ -199,9 +200,16 @@
 			else
 				if (ArjunaTXConstants.WSARJTX_PROTOCOL_TERMINATION.equals(protocolIdentifier))
 				{
-					try
+                    /*
+                     * update the server side terminator with the participant end point
+                     */
+                    BusinessActivityTerminatorWSImple terminator;
+                    terminator = (BusinessActivityTerminatorWSImple)TerminationCoordinatorProcessorWS.getProcessor().getParticipant(instanceIdentifier);
+                    terminator.setEndpoint(participantProtocolService);
+                    
+                    try
 					{
-						return getParticipantManager(
+                        return getParticipantManager(
                                 ArjunaTXWSConstants.TERMINATION_COORDINATOR_SERVICE_QNAME,
 								ArjunaTXWSConstants.TERMINATION_COORDINATOR_PORT_QNAME,
                                 ServiceRegistryWS.getRegistry().getServiceURI(ArjunaTXWSConstants.TERMINATION_COORDINATOR_SERVICE_NAME),
@@ -217,7 +225,7 @@
 					wstxLogger.arjLoggerI18N
 							.warn(
 									"com.arjuna.mwlabs.wst.ba.RegistrarWSImple_1",
-									new Object[] { BusinessActivityConstants.WSBA_PROTOCOL_ATOMIC_OUTCOME, protocolIdentifier });
+									new Object[] { BusinessActivityWSConstants.WSBA_PROTOCOL_ATOMIC_OUTCOME, protocolIdentifier });
 
 					throw new InvalidProtocolException();
 				}

Modified: labs/jbosstm/workspace/adinn/XTSGF/WSTX/classes/com/arjuna/mwlabs/wst/ba/context/ArjunaContextWSImple.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WSTX/classes/com/arjuna/mwlabs/wst/ba/context/ArjunaContextWSImple.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WSTX/classes/com/arjuna/mwlabs/wst/ba/context/ArjunaContextWSImple.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -31,10 +31,6 @@
 
 package com.arjuna.mwlabs.wst.ba.context;
 
-import javax.xml.parsers.DocumentBuilder;
-
-import org.w3c.dom.Element;
-
 import com.arjuna.ats.arjuna.coordinator.ActionHierarchy;
 import com.arjuna.mw.wsas.UserActivityFactory;
 import com.arjuna.mw.wsas.activity.ActivityHierarchy;
@@ -45,9 +41,12 @@
 import com.arjuna.mw.wscf.utils.DomUtil;
 import com.arjuna.mw.wstx.logging.wstxLogger;
 import com.arjuna.mwlabs.wscf.model.sagas.arjunacore.ACCoordinator;
-import com.arjuna.webservices.wsba.BusinessActivityConstants;
+import com.arjuna.webservices.wsba.BusinessActivityWSConstants;
 import com.arjuna.webservices.wscoor.CoordinationConstantsWS;
+import org.w3c.dom.Element;
 
+import javax.xml.parsers.DocumentBuilder;
+
 /**
  * On demand this class creates the SOAP context information necessary to
  * propagate the hierarchy of coordinators associated with the current
@@ -167,7 +166,7 @@
                 _context.appendChild(expires);
 
                 Element coordinationType = doc.createElement("wscoor:" + _coordinationType);
-                coordinationType.appendChild(doc.createTextNode(BusinessActivityConstants.WSBA_PROTOCOL_ATOMIC_OUTCOME));
+                coordinationType.appendChild(doc.createTextNode(BusinessActivityWSConstants.WSBA_PROTOCOL_ATOMIC_OUTCOME));
 
                 _context.appendChild(coordinationType);
 

Modified: labs/jbosstm/workspace/adinn/XTSGF/WSTX/classes/com/arjuna/mwlabs/wst/ba/remote/BusinessActivityManagerWSImple.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WSTX/classes/com/arjuna/mwlabs/wst/ba/remote/BusinessActivityManagerWSImple.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WSTX/classes/com/arjuna/mwlabs/wst/ba/remote/BusinessActivityManagerWSImple.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -77,7 +77,7 @@
         final W3CEndpointReference participant = getParticipant(service, endpoint, address, id) ;
     	try
     	{
-            W3CEndpointReference baPMEndpoint = registerParticipant(participant, BusinessActivityConstants.WSBA_SUB_PROTOCOL_PARTICIPANT_COMPLETION);
+            W3CEndpointReference baPMEndpoint = registerParticipant(participant, BusinessActivityWSConstants.WSBA_SUB_PROTOCOL_PARTICIPANT_COMPLETION);
             final ParticipantCompletionParticipantEngineWS engine = new ParticipantCompletionParticipantEngineWS(id, baPMEndpoint, bap) ;
             ParticipantCompletionParticipantProcessorWS.getProcessor().activateParticipant(engine, id) ;
 
@@ -111,7 +111,7 @@
         final W3CEndpointReference participant = getParticipant(service, endpoint, address, id) ;
     	try
     	{
-    	    W3CEndpointReference baPMEndpoint = registerParticipant(participant, BusinessActivityConstants.WSBA_SUB_PROTOCOL_COORDINATOR_COMPLETION);
+    	    W3CEndpointReference baPMEndpoint = registerParticipant(participant, BusinessActivityWSConstants.WSBA_SUB_PROTOCOL_COORDINATOR_COMPLETION);
             final CoordinatorCompletionParticipantEngineWS engine = new CoordinatorCompletionParticipantEngineWS(id, baPMEndpoint, bawcp) ;
             CoordinatorCompletionParticipantProcessorWS.getProcessor().activateParticipant(engine, id) ;
 

Modified: labs/jbosstm/workspace/adinn/XTSGF/WSTX/classes/com/arjuna/mwlabs/wst/ba/remote/UserBusinessActivityWSImple.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/WSTX/classes/com/arjuna/mwlabs/wst/ba/remote/UserBusinessActivityWSImple.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/WSTX/classes/com/arjuna/mwlabs/wst/ba/remote/UserBusinessActivityWSImple.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -41,7 +41,7 @@
 import com.arjuna.webservices.wsarj.InstanceIdentifierWS;
 import com.arjuna.webservices.wsarjtx.ArjunaTXConstants;
 import com.arjuna.webservices.wsarjtx.ArjunaTXWSConstants;
-import com.arjuna.webservices.wsba.BusinessActivityConstants;
+import com.arjuna.webservices.wsba.BusinessActivityWSConstants;
 import com.arjuna.webservices.wscoor.CoordinationConstantsWS;
 import com.arjuna.wsc.ActivationCoordinatorWS;
 import com.arjuna.wsc.InvalidCreateParametersException;
@@ -260,7 +260,7 @@
             final Long expires = (timeout > 0 ? new Long(timeout) : null) ;
             final String messageId = MessageIdWS.getMessageId() ;
             final CoordinationContextType coordinationContext = ActivationCoordinatorWS.createCoordinationContext(
-                    _activationCoordinatorService, messageId, BusinessActivityConstants.WSBA_PROTOCOL_ATOMIC_OUTCOME, expires, null) ;
+                    _activationCoordinatorService, messageId, BusinessActivityWSConstants.WSBA_PROTOCOL_ATOMIC_OUTCOME, expires, null) ;
             if (coordinationContext == null)
             {
                 throw new SystemException(

Added: labs/jbosstm/workspace/adinn/XTSGF/demo/dd/jboss/context-handlers11.xml
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/demo/dd/jboss/context-handlers11.xml	                        (rev 0)
+++ labs/jbosstm/workspace/adinn/XTSGF/demo/dd/jboss/context-handlers11.xml	2008-01-21 17:06:39 UTC (rev 18013)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+-->
+<handler-chains xmlns="http://java.sun.com/xml/ns/javaee"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+xsi:schemaLocation="http://java.sun.com/xml/ns/javaee">
+    <handler-chain>
+	<handler>
+		<handler-name>ContextHandler</handler-name>
+		<handler-class>com.arjuna.mw.wst.service.JaxWSHeaderContextProcessorWS</handler-class>
+	</handler>
+    </handler-chain>
+</handler-chains>

Modified: labs/jbosstm/workspace/adinn/XTSGF/demo/src/com/jboss/jbosstm/xts/demo/client/BasicClient.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/demo/src/com/jboss/jbosstm/xts/demo/client/BasicClient.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/demo/src/com/jboss/jbosstm/xts/demo/client/BasicClient.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -33,7 +33,7 @@
 import com.arjuna.mw.wst.UserBusinessActivityFactory;
 import com.arjuna.mw.wst.UserTransaction;
 import com.arjuna.mw.wst.UserTransactionFactory;
-import com.arjuna.mw.wst.client.JaxWSHeaderContextProcessor;
+import com.arjuna.mw.wst.client.JaxWSHeaderContextProcessorWS;
 import com.arjuna.wst.TransactionRolledBackException;
 import com.jboss.jbosstm.xts.demo.restaurant.IRestaurantService;
 import com.jboss.jbosstm.xts.demo.restaurant.IRestaurantServiceBA;
@@ -52,8 +52,6 @@
 import javax.xml.ws.BindingProvider;
 import javax.xml.ws.Service;
 import javax.xml.ws.handler.Handler;
-import javax.xml.ws.wsaddressing.W3CEndpointReference;
-import javax.xml.ws.wsaddressing.W3CEndpointReferenceBuilder;
 import java.io.IOException;
 import java.net.MalformedURLException;
 import java.net.URL;
@@ -332,7 +330,7 @@
      */
     private void configureClientHandler(BindingProvider bindingProvider)
     {
-        Handler handler = new JaxWSHeaderContextProcessor();
+        Handler handler = new JaxWSHeaderContextProcessorWS();
         List<Handler> handlers = Collections.singletonList(handler);
         bindingProvider.getBinding().setHandlerChain(handlers);
     }

Modified: labs/jbosstm/workspace/adinn/XTSGF/demo/src/com/jboss/jbosstm/xts/demo/services/restaurant/RestaurantServiceAT.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/demo/src/com/jboss/jbosstm/xts/demo/services/restaurant/RestaurantServiceAT.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/demo/src/com/jboss/jbosstm/xts/demo/services/restaurant/RestaurantServiceAT.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -51,7 +51,7 @@
         name = "RestaurantServiceAT", targetNamespace = "http://www.jboss.com/jbosstm/xts/demo/Restaurant",
         wsdlLocation = "../wsdl/RestaurantServiceAT.wsdl")
 @HandlerChain(file = "../context-handlers.xml", name = "Context Handlers")                  
- at SOAPBinding(style = SOAPBinding.Style.RPC)
+ at SOAPBinding(style=SOAPBinding.Style.RPC)
 public class RestaurantServiceAT implements IRestaurantService
 {
     /**

Modified: labs/jbosstm/workspace/adinn/XTSGF/demo/src/com/jboss/jbosstm/xts/demo/services/restaurant/RestaurantServiceBA.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/demo/src/com/jboss/jbosstm/xts/demo/services/restaurant/RestaurantServiceBA.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/demo/src/com/jboss/jbosstm/xts/demo/services/restaurant/RestaurantServiceBA.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -30,9 +30,9 @@
 package com.jboss.jbosstm.xts.demo.services.restaurant;
 
 import com.arjuna.ats.arjuna.common.Uid;
-import com.arjuna.mw.wst.BusinessActivityManager;
-import com.arjuna.mw.wst.BusinessActivityManagerFactory;
-import com.arjuna.wst.BAParticipantManager;
+import com.arjuna.mw.wst.BusinessActivityManagerFactoryWS;
+import com.arjuna.mw.wst.BusinessActivityManagerWS;
+import com.arjuna.wst.BAParticipantManagerWS;
 import com.arjuna.wst.SystemException;
 import com.jboss.jbosstm.xts.demo.restaurant.IRestaurantServiceBA;
 
@@ -50,7 +50,7 @@
         name = "RestaurantServiceBA", targetNamespace = "http://www.jboss.com/jbosstm/xts/demo/Restaurant",
         wsdlLocation = "../wsdl/RestaurantServiceBA.wsdl")
 @HandlerChain(file = "../context-handlers.xml", name = "Context Handlers")
- at SOAPBinding(style = SOAPBinding.Style.RPC)
+ at SOAPBinding(style=SOAPBinding.Style.RPC)
 public class RestaurantServiceBA implements IRestaurantServiceBA
 {
     /**
@@ -70,7 +70,7 @@
         RestaurantView restaurantView = RestaurantView.getSingletonInstance();
         RestaurantManager restaurantManager = RestaurantManager.getSingletonInstance();
 
-        BusinessActivityManager activityManager = BusinessActivityManagerFactory.businessActivityManager();
+        BusinessActivityManagerWS activityManager = BusinessActivityManagerFactoryWS.businessActivityManager();
 
         // get the transaction context of this thread:
         String transactionId = null;
@@ -107,7 +107,7 @@
 
             RestaurantParticipantBA restaurantParticipant = new RestaurantParticipantBA(transactionId, how_many);
             // enlist the Participant for this service:
-            BAParticipantManager participantManager = null;
+            BAParticipantManagerWS participantManager = null;
             try
             {
                 participantManager = activityManager.enlistForBusinessAgreementWithParticipantCompletion(restaurantParticipant, new Uid().toString());

Modified: labs/jbosstm/workspace/adinn/XTSGF/demo/src/com/jboss/jbosstm/xts/demo/services/taxi/TaxiServiceAT.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/demo/src/com/jboss/jbosstm/xts/demo/services/taxi/TaxiServiceAT.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/demo/src/com/jboss/jbosstm/xts/demo/services/taxi/TaxiServiceAT.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -50,7 +50,7 @@
         name = "TaxiServiceAT", targetNamespace = "http://www.jboss.com/jbosstm/xts/demo/Taxi",
         wsdlLocation = "../wsdl/TaxiServiceAT.wsdl")
 @HandlerChain(file = "../context-handlers.xml", name = "Context Handlers")
- at SOAPBinding(style = SOAPBinding.Style.RPC)
+ at SOAPBinding(style=SOAPBinding.Style.RPC)
 public class TaxiServiceAT implements ITaxiService
 {
     /**

Modified: labs/jbosstm/workspace/adinn/XTSGF/demo/src/com/jboss/jbosstm/xts/demo/services/taxi/TaxiServiceBA.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/demo/src/com/jboss/jbosstm/xts/demo/services/taxi/TaxiServiceBA.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/demo/src/com/jboss/jbosstm/xts/demo/services/taxi/TaxiServiceBA.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -30,16 +30,16 @@
 package com.jboss.jbosstm.xts.demo.services.taxi;
 
 import com.arjuna.ats.arjuna.common.Uid;
-import com.arjuna.mw.wst.BusinessActivityManager;
-import com.arjuna.mw.wst.BusinessActivityManagerFactory;
-import com.arjuna.wst.BAParticipantManager;
+import com.arjuna.mw.wst.BusinessActivityManagerFactoryWS;
+import com.arjuna.mw.wst.BusinessActivityManagerWS;
+import com.arjuna.wst.BAParticipantManagerWS;
 import com.arjuna.wst.SystemException;
 import com.jboss.jbosstm.xts.demo.taxi.ITaxiServiceBA;
 
-import javax.jws.WebService;
 import javax.jws.HandlerChain;
 import javax.jws.WebMethod;
 import javax.jws.WebResult;
+import javax.jws.WebService;
 import javax.jws.soap.SOAPBinding;
 
 /**
@@ -53,7 +53,7 @@
         name = "TaxiServiceBA", targetNamespace = "http://www.jboss.com/jbosstm/xts/demo/Taxi",
         wsdlLocation = "../wsdl/TaxiServiceBA.wsdl")
 @HandlerChain(file = "../context-handlers.xml", name = "Context Handlers")
- at SOAPBinding(style = SOAPBinding.Style.RPC)
+ at SOAPBinding(style=SOAPBinding.Style.RPC)
 public class TaxiServiceBA implements ITaxiServiceBA
 {
     /**
@@ -70,7 +70,7 @@
         TaxiView taxiView = TaxiView.getSingletonInstance();
         TaxiManager taxiManager = TaxiManager.getSingletonInstance();
 
-        BusinessActivityManager activityManager = BusinessActivityManagerFactory.businessActivityManager();
+        BusinessActivityManagerWS activityManager = BusinessActivityManagerFactoryWS.businessActivityManager();
 
         // get the transaction context of this thread:
         String transactionId = null;
@@ -105,7 +105,7 @@
             // it worked, so now we need a participant enlisted in case of compensation:
             TaxiParticipantBA taxiParticipant = new TaxiParticipantBA(transactionId);
             // enlist the Participant for this service:
-            BAParticipantManager participantManager = null;
+            BAParticipantManagerWS participantManager = null;
             try
             {
                 participantManager = activityManager.enlistForBusinessAgreementWithParticipantCompletion(taxiParticipant, new Uid().toString());

Modified: labs/jbosstm/workspace/adinn/XTSGF/demo/src/com/jboss/jbosstm/xts/demo/services/theatre/TheatreServiceAT.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/demo/src/com/jboss/jbosstm/xts/demo/services/theatre/TheatreServiceAT.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/demo/src/com/jboss/jbosstm/xts/demo/services/theatre/TheatreServiceAT.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -51,7 +51,7 @@
         name = "TheatreServiceAT", targetNamespace = "http://www.jboss.com/jbosstm/xts/demo/Theatre",
         wsdlLocation = "../wsdl/TheatreServiceAT.wsdl")
 @HandlerChain(file = "../context-handlers.xml", name = "Context Handlers")
- at SOAPBinding(style = SOAPBinding.Style.RPC)
+ at SOAPBinding(style=SOAPBinding.Style.RPC)
 public class TheatreServiceAT implements ITheatreService
 {
     /**

Modified: labs/jbosstm/workspace/adinn/XTSGF/demo/src/com/jboss/jbosstm/xts/demo/services/theatre/TheatreServiceBA.java
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/demo/src/com/jboss/jbosstm/xts/demo/services/theatre/TheatreServiceBA.java	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/demo/src/com/jboss/jbosstm/xts/demo/services/theatre/TheatreServiceBA.java	2008-01-21 17:06:39 UTC (rev 18013)
@@ -30,8 +30,9 @@
 package com.jboss.jbosstm.xts.demo.services.theatre;
 
 import com.arjuna.ats.arjuna.common.Uid;
-import com.arjuna.mw.wst.BusinessActivityManager;
-import com.arjuna.mw.wst.BusinessActivityManagerFactory;
+import com.arjuna.mw.wst.BusinessActivityManagerFactoryWS;
+import com.arjuna.mw.wst.BusinessActivityManagerWS;
+import com.arjuna.wst.BAParticipantManagerWS;
 import com.arjuna.wst.SystemException;
 import com.jboss.jbosstm.xts.demo.theatre.ITheatreServiceBA;
 
@@ -48,7 +49,7 @@
 @WebService(serviceName="TheatreServiceBAService", portName="TheatreServiceBA",
         name = "TheatreServiceBA", targetNamespace = "http://www.jboss.com/jbosstm/xts/demo/Theatre",
         wsdlLocation = "../wsdl/TheatreServiceBA.wsdl")
- at SOAPBinding(style = SOAPBinding.Style.RPC)
+ at SOAPBinding(style=SOAPBinding.Style.RPC)
 @HandlerChain(file = "../context-handlers.xml", name = "Context Handlers")
 public class TheatreServiceBA implements ITheatreServiceBA
 {
@@ -73,7 +74,7 @@
         TheatreView theatreView = TheatreView.getSingletonInstance();
         TheatreManager theatreManager = TheatreManager.getSingletonInstance();
 
-        BusinessActivityManager activityManager = BusinessActivityManagerFactory.businessActivityManager();
+        BusinessActivityManagerWS activityManager = BusinessActivityManagerFactoryWS.businessActivityManager();
 
         // get the transaction context of this thread:
         String transactionId = null;
@@ -104,7 +105,7 @@
 
             TheatreParticipantBA theatreParticipant = new TheatreParticipantBA(transactionId, how_many, which_area);
             // enlist the Participant for this service:
-            com.arjuna.wst.BAParticipantManager participantManager = null;
+            BAParticipantManagerWS participantManager = null;
             try
             {
                 participantManager = activityManager.enlistForBusinessAgreementWithParticipantCompletion(theatreParticipant, new Uid().toString());

Modified: labs/jbosstm/workspace/adinn/XTSGF/demo/xts-build.xml
===================================================================
--- labs/jbosstm/workspace/adinn/XTSGF/demo/xts-build.xml	2008-01-21 17:05:07 UTC (rev 18012)
+++ labs/jbosstm/workspace/adinn/XTSGF/demo/xts-build.xml	2008-01-21 17:06:39 UTC (rev 18013)
@@ -168,7 +168,7 @@
 
     <target name="jboss-webservices" depends="compile">
         <copy tofile="${build.dir}/classes/com/jboss/jbosstm/xts/demo/services/context-handlers.xml"
-	      file="${jboss.dd.dir}/context-handlers.xml"/>
+	      file="${jboss.dd.dir}/context-handlers11.xml"/>
 <!--
         <war destfile="${build.dir}/xts-demo-webservices.war" webxml="${jboss.dd.dir}/service-web-app.xml">
 -->

Modified: labs/jbosstm/workspace/adinn/XTSGF/ext/wsbrew.jar
===================================================================
(Binary files differ)




More information about the jboss-svn-commits mailing list