Author: dasarath
Date: Fri Jan  6 21:38:07 2006
New Revision: 366677

URL: http://svn.apache.org/viewcvs?rev=366677&view=rev
Log: (empty)

Modified:
    
webservices/kandula/branches/Kandula_1/src/samples/interopibm/src/InitiatorApp.java
    
webservices/kandula/branches/Kandula_1/src/samples/interopibm/src/ManInTheMiddle.java

Modified: 
webservices/kandula/branches/Kandula_1/src/samples/interopibm/src/InitiatorApp.java
URL: 
http://svn.apache.org/viewcvs/webservices/kandula/branches/Kandula_1/src/samples/interopibm/src/InitiatorApp.java?rev=366677&r1=366676&r2=366677&view=diff
==============================================================================
--- 
webservices/kandula/branches/Kandula_1/src/samples/interopibm/src/InitiatorApp.java
 (original)
+++ 
webservices/kandula/branches/Kandula_1/src/samples/interopibm/src/InitiatorApp.java
 Fri Jan  6 21:38:07 2006
@@ -1,9 +1,13 @@
 
 import java.net.URL;
 
+import javax.xml.soap.Name;
+
 import org.apache.axis.message.addressing.EndpointReference;
 import org.apache.ws.transaction.coordinator.ActivationStub;
+import org.apache.ws.transaction.coordinator.Callback;
 import org.apache.ws.transaction.coordinator.CoordinationContext;
+import org.apache.ws.transaction.coordinator.TimedOutException;
 import org.apache.ws.transaction.coordinator.at.ATCoordinator;
 import org.apache.ws.transaction.coordinator.at.CompletionCoordinatorStub;
 import org.apache.ws.transaction.utility.TCPSnifferHelper;
@@ -18,14 +22,14 @@
  *  
  */
 public class InitiatorApp {
-       
+
        private final String IBM_INTEROP_SERVICE = 
"http://wsi.alphaworks.ibm.com:8080/wstx/services/InteropService";;
-       
+
        private final String KANDULA_INTEROP_SERVICE = 
"http://localhost:8081/axis/services/InteropService";;
 
-       private final String KANDULA_ACTIVATION_SERVICE = 
"http://localhost:8081/axis/services/Activation";;
-       
-       private String eprOfInteropService = KANDULA_INTEROP_SERVICE;
+       private final String KANDULA_ACTIVATION_SERVICE = 
"http://localhost:8081/axis/services/activationCoordinator";;
+
+       private String eprOfInteropService = IBM_INTEROP_SERVICE;
 
        private InteropService_PortType getInteropService() throws Exception {
                return new InteropServiceServiceLocator().getInteropService(new 
URL(
@@ -139,21 +143,63 @@
 
        public void begin() throws Exception {
                ActivationStub stub = new ActivationStub(new EndpointReference(
-                               
"http://localhost:8081/axis/services/Activation";));
+                               
"http://localhost:8081/axis/services/activationCoordinator";));
                ctx = 
stub.createCoordinationContext(ATCoordinator.COORDINATION_TYPE_ID);
                cps = ctx.register(ATCoordinator.PROTOCOL_ID_COMPLETION,
                        new EndpointReference(
-                                       
"http://localhost:8081/axis/services/CompletionInitiator";));
+                                       
"http://localhost:8081/axis/services/completionInitiator";));
                SetCoordCtxHandler.setCtx(ctx);
        }
 
+       private class CallbackImpl implements Callback {
+
+               /*
+                * (non-Javadoc)
+                * 
+                * @see org.apache.ws.transaction.coordinator.Callback#getID()
+                */
+               public String getID() {
+                       return "urn:foo";
+               }
+
+               /*
+                * (non-Javadoc)
+                * 
+                * @see 
org.apache.ws.transaction.coordinator.Callback#onFault(javax.xml.soap.Name)
+                */
+               public void onFault(Name code) {
+                       // TODO Auto-generated method stub
+
+               }
+
+               /*
+                * (non-Javadoc)
+                * 
+                * @see org.apache.ws.transaction.coordinator.Callback#timeout()
+                */
+               public void timeout() throws TimedOutException {
+                       // TODO Auto-generated method stub
+
+               }
+
+               /*
+                * (non-Javadoc)
+                * 
+                * @see 
org.apache.ws.transaction.coordinator.Callback#getEndpointReference()
+                */
+               public EndpointReference getEndpointReference() {
+                       return null;
+               }
+
+       }
+
        public void commit() throws Exception {
                SetCoordCtxHandler.setCtx(null);
-               new CompletionCoordinatorStub(cps).commitOperation(null);
+               new CompletionCoordinatorStub(new CallbackImpl(), 
cps).commitOperation(null);
        }
 
        public void rollback() throws Exception {
                SetCoordCtxHandler.setCtx(null);
-               new CompletionCoordinatorStub(cps).rollbackOperation(null);
+               new CompletionCoordinatorStub(new CallbackImpl(), 
cps).rollbackOperation(null);
        }
 }

Modified: 
webservices/kandula/branches/Kandula_1/src/samples/interopibm/src/ManInTheMiddle.java
URL: 
http://svn.apache.org/viewcvs/webservices/kandula/branches/Kandula_1/src/samples/interopibm/src/ManInTheMiddle.java?rev=366677&r1=366676&r2=366677&view=diff
==============================================================================
--- 
webservices/kandula/branches/Kandula_1/src/samples/interopibm/src/ManInTheMiddle.java
 (original)
+++ 
webservices/kandula/branches/Kandula_1/src/samples/interopibm/src/ManInTheMiddle.java
 Fri Jan  6 21:38:07 2006
@@ -167,11 +167,14 @@
                        if (stage == 6) {
                                stage = 7;
                                return false;
-                       }
-                       // TODO:
-                       // requires further verification using a TCP sniffer 
since the
-                       // 2 Prepared messages may not be received before the 
3rd Rollback is issued.
-                       return !(stage > 10);
+                       } else if (stage == 11) {
+                               stage = 12;
+                               return false;
+                       } else if (stage == 12) {
+                               stage = 13;
+                               return false;
+                       } else
+                               return true;
                }
 
                public synchronized boolean onRollbackMsg(String msg) {
@@ -182,7 +185,7 @@
                                stage = 11;
                                return true;
                        }
-                       return false;
+                       return stage < 13;
                }
        }
 
@@ -355,7 +358,7 @@
                ManInTheMiddle middleMan = new ManInTheMiddle(
                                new 
ManInTheMiddle.PreparedAfterTimeoutTestOrchestratorImpl());
                middleMan.forward(8081, 8083);
-               //      middleMan.forward(8082, 8084);
+               middleMan.forward(8082, 8084);
 
        }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to