You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fx-dev@ws.apache.org by th...@apache.org on 2006/05/13 15:47:09 UTC
svn commit: r406098 [2/2] - in
/webservices/kandula/trunk/java/src/org/apache/kandula: ./ context/
context/impl/ coordinator/ coordinator/at/ coordinator/ba/ faults/
initiator/ participant/ utility/ wsat/ wsat/completion/ wsat/twopc/ wscoor/
Modified: webservices/kandula/trunk/java/src/org/apache/kandula/utility/KandulaListener.java
URL: http://svn.apache.org/viewcvs/webservices/kandula/trunk/java/src/org/apache/kandula/utility/KandulaListener.java?rev=406098&r1=406097&r2=406098&view=diff
==============================================================================
--- webservices/kandula/trunk/java/src/org/apache/kandula/utility/KandulaListener.java (original)
+++ webservices/kandula/trunk/java/src/org/apache/kandula/utility/KandulaListener.java Sat May 13 06:47:07 2006
@@ -46,15 +46,14 @@
public int serverPort;
private KandulaListener() throws IOException {
- KandulaConfiguration configuration = KandulaConfiguration
- .getInstance();
+ KandulaConfiguration configuration = KandulaConfiguration.getInstance();
responseConfigurationContext = ConfigurationContextFactory
- .createConfigurationContextFromFileSystem(
- configuration.getKandulaListenerRepository(),
- configuration.getKandulaListenerAxis2Xml());
+ .createConfigurationContextFromFileSystem(configuration
+ .getKandulaListenerRepository(), configuration
+ .getKandulaListenerAxis2Xml());
try {
- serverPort = Integer.parseInt(KandulaConfiguration
- .getInstance().getKadulaListenerPort());
+ serverPort = Integer.parseInt(KandulaConfiguration.getInstance()
+ .getKadulaListenerPort());
} catch (Exception e) {
serverPort = 5059;
}
@@ -104,9 +103,9 @@
responseConfigurationContext.getAxisConfiguration().addService(
service);
- //TODO : check how to do this or this is neccessary anymore
- // Utils.resolvePhases(receiver.getSystemContext()
- // .getAxisConfiguration(), service);
+ // TODO : check how to do this or this is neccessary anymore
+ // Utils.resolvePhases(receiver.getSystemContext()
+ // .getAxisConfiguration(), service);
}
}
Modified: webservices/kandula/trunk/java/src/org/apache/kandula/wsat/AbstractATNotifierStub.java
URL: http://svn.apache.org/viewcvs/webservices/kandula/trunk/java/src/org/apache/kandula/wsat/AbstractATNotifierStub.java?rev=406098&r1=406097&r2=406098&view=diff
==============================================================================
--- webservices/kandula/trunk/java/src/org/apache/kandula/wsat/AbstractATNotifierStub.java (original)
+++ webservices/kandula/trunk/java/src/org/apache/kandula/wsat/AbstractATNotifierStub.java Sat May 13 06:47:07 2006
@@ -56,10 +56,11 @@
public AbstractATNotifierStub(String axis2Home, String axis2Xml,
AxisService service) throws AbstractKandulaException {
- //creating the configuration
+ // creating the configuration
this.service = service;
try {
- configurationContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(axis2Home,
+ configurationContext = ConfigurationContextFactory
+ .createConfigurationContextFromFileSystem(axis2Home,
axis2Xml);
configurationContext.getAxisConfiguration().addService(service);
} catch (DeploymentException e) {
@@ -96,10 +97,8 @@
final OperationClient client = operations[opIndex].createClient(
serviceContext, options);
- SOAPFactory factory = OMAbstractFactory
- .getSOAP12Factory();
- SOAPEnvelope env = factory
- .getDefaultEnvelope();
+ SOAPFactory factory = OMAbstractFactory.getSOAP12Factory();
+ SOAPEnvelope env = factory.getDefaultEnvelope();
OMNamespace wsAT = factory.createOMNamespace(Constants.WS_AT,
"wsat");
@@ -112,8 +111,8 @@
options.setReplyTo(replyToEPR);
}
options.setAction(action);
- // options.setTranportOut(org.apache.axis2.Constants.TRANSPORT_HTTP);
- // System.out.println(operations[opIndex]);
+ // options.setTranportOut(org.apache.axis2.Constants.TRANSPORT_HTTP);
+ // System.out.println(operations[opIndex]);
client.addMessageContext(messageContext);
/*
* hacking till we get fire and forget corretly in Axis2
@@ -129,7 +128,7 @@
}
});
thread.start();
-
+
} catch (AxisFault e) {
throw new KandulaGeneralException(e);
}
Modified: webservices/kandula/trunk/java/src/org/apache/kandula/wsat/completion/CompletionCoordinatorPortTypeRawXMLSkeleton.java
URL: http://svn.apache.org/viewcvs/webservices/kandula/trunk/java/src/org/apache/kandula/wsat/completion/CompletionCoordinatorPortTypeRawXMLSkeleton.java?rev=406098&r1=406097&r2=406098&view=diff
==============================================================================
--- webservices/kandula/trunk/java/src/org/apache/kandula/wsat/completion/CompletionCoordinatorPortTypeRawXMLSkeleton.java (original)
+++ webservices/kandula/trunk/java/src/org/apache/kandula/wsat/completion/CompletionCoordinatorPortTypeRawXMLSkeleton.java Sat May 13 06:47:07 2006
@@ -18,7 +18,8 @@
import org.apache.axiom.om.OMElement;
import org.apache.axis2.AxisFault;
-import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.context.OperationContext;
+import org.apache.axis2.wsdl.WSDLConstants;
import org.apache.kandula.Constants;
import org.apache.kandula.coordinator.at.ATCoordinator;
import org.apache.kandula.faults.AbstractKandulaException;
@@ -29,10 +30,10 @@
*/
public class CompletionCoordinatorPortTypeRawXMLSkeleton {
- private MessageContext msgContext;
+ private OperationContext opContext;
- public void init(MessageContext context) {
- this.msgContext = context;
+ public void setOperationContext(OperationContext opContext) {
+ this.opContext = opContext;
}
/**
@@ -41,10 +42,11 @@
*/
public OMElement commitOperation(OMElement requestElement) throws AxisFault {
String activityId;
- //log.info("Visited Commit operation");
+ // log.info("Visited Commit operation");
StorageFactory.getInstance().setConfigurationContext(
- msgContext.getServiceContext().getConfigurationContext());
- OMElement header = msgContext.getEnvelope().getHeader();
+ opContext.getServiceContext().getConfigurationContext());
+ OMElement header = opContext.getMessageContext(
+ WSDLConstants.MESSAGE_LABEL_IN_VALUE).getEnvelope().getHeader();
activityId = header.getFirstChildWithName(
Constants.TRANSACTION_ID_PARAMETER).getText();
// TODO do we need to check the incoming message
@@ -64,14 +66,15 @@
String activityId;
StorageFactory.getInstance().setConfigurationContext(
- msgContext.getServiceContext().getConfigurationContext());
- //log.info("Visited rollback operation");
- OMElement header = msgContext.getEnvelope().getHeader();
+ opContext.getServiceContext().getConfigurationContext());
+ // log.info("Visited rollback operation");
+ OMElement header = opContext.getMessageContext(
+ WSDLConstants.MESSAGE_LABEL_IN_VALUE).getEnvelope().getHeader();
activityId = header.getFirstChildWithName(
Constants.TRANSACTION_ID_PARAMETER).getText();
try {
ATCoordinator coordinator = new ATCoordinator();
- coordinator.commitOperation(activityId);
+ coordinator.rollbackOperation(activityId);
} catch (AbstractKandulaException e) {
AxisFault fault = new AxisFault(e);
fault.setFaultCode(e.getFaultCode());
Modified: webservices/kandula/trunk/java/src/org/apache/kandula/wsat/completion/CompletionCoordinatorPortTypeRawXMLStub.java
URL: http://svn.apache.org/viewcvs/webservices/kandula/trunk/java/src/org/apache/kandula/wsat/completion/CompletionCoordinatorPortTypeRawXMLStub.java?rev=406098&r1=406097&r2=406098&view=diff
==============================================================================
--- webservices/kandula/trunk/java/src/org/apache/kandula/wsat/completion/CompletionCoordinatorPortTypeRawXMLStub.java (original)
+++ webservices/kandula/trunk/java/src/org/apache/kandula/wsat/completion/CompletionCoordinatorPortTypeRawXMLStub.java Sat May 13 06:47:07 2006
@@ -44,7 +44,7 @@
"CompletionCoordinatorPortType"));
this.toEPR = targetEndpoint;
- //creating the operations
+ // creating the operations
AxisOperation operation;
operations = new AxisOperation[2];
@@ -62,13 +62,13 @@
}
public void commitOperation() throws AbstractKandulaException {
- //TODO must send reply to epr
+ // TODO must send reply to epr
this.notify("Commit", Constants.WS_AT_COMMIT, 0, null);
}
public void rollbackOperation() throws AbstractKandulaException {
- //TODO must send reply to EPR
+ // TODO must send reply to EPR
this.notify("Rollback", Constants.WS_AT_ROLLBACK, 1, null);
}
Modified: webservices/kandula/trunk/java/src/org/apache/kandula/wsat/completion/CompletionInitiatorPortTypeRawXMLSkeleton.java
URL: http://svn.apache.org/viewcvs/webservices/kandula/trunk/java/src/org/apache/kandula/wsat/completion/CompletionInitiatorPortTypeRawXMLSkeleton.java?rev=406098&r1=406097&r2=406098&view=diff
==============================================================================
--- webservices/kandula/trunk/java/src/org/apache/kandula/wsat/completion/CompletionInitiatorPortTypeRawXMLSkeleton.java (original)
+++ webservices/kandula/trunk/java/src/org/apache/kandula/wsat/completion/CompletionInitiatorPortTypeRawXMLSkeleton.java Sat May 13 06:47:07 2006
@@ -17,7 +17,9 @@
package org.apache.kandula.wsat.completion;
import org.apache.axiom.om.OMElement;
-import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.OperationContext;
+import org.apache.axis2.wsdl.WSDLConstants;
import org.apache.kandula.Constants;
import org.apache.kandula.Status;
import org.apache.kandula.context.AbstractContext;
@@ -28,16 +30,18 @@
*/
public class CompletionInitiatorPortTypeRawXMLSkeleton {
- private MessageContext msgContext;
+ private OperationContext opContext;
- public void init(MessageContext context) {
- this.msgContext = context;
+ public void setOperationContext(OperationContext opContext) {
+ this.opContext = opContext;
}
- public OMElement committedOperation(OMElement requestElement) {
+ public OMElement committedOperation(OMElement requestElement)
+ throws AxisFault {
StorageFactory.getInstance().setConfigurationContext(
- msgContext.getServiceContext().getConfigurationContext());
- OMElement header = msgContext.getEnvelope().getHeader();
+ opContext.getServiceContext().getConfigurationContext());
+ OMElement header = opContext.getMessageContext(
+ WSDLConstants.MESSAGE_LABEL_IN_VALUE).getEnvelope().getHeader();
String requesterID = header.getFirstChildWithName(
Constants.REQUESTER_ID_PARAMETER).getText();
AbstractContext context = (AbstractContext) StorageFactory
@@ -46,10 +50,12 @@
return null;
}
- public OMElement abortedOperation(OMElement requestElement) {
+ public OMElement abortedOperation(OMElement requestElement)
+ throws AxisFault {
StorageFactory.getInstance().setConfigurationContext(
- msgContext.getServiceContext().getConfigurationContext());
- OMElement header = msgContext.getEnvelope().getHeader();
+ opContext.getServiceContext().getConfigurationContext());
+ OMElement header = opContext.getMessageContext(
+ WSDLConstants.MESSAGE_LABEL_IN_VALUE).getEnvelope().getHeader();
String requesterID = header.getFirstChildWithName(
Constants.REQUESTER_ID_PARAMETER).getText();
AbstractContext context = (AbstractContext) StorageFactory
Modified: webservices/kandula/trunk/java/src/org/apache/kandula/wsat/completion/CompletionInitiatorPortTypeRawXMLStub.java
URL: http://svn.apache.org/viewcvs/webservices/kandula/trunk/java/src/org/apache/kandula/wsat/completion/CompletionInitiatorPortTypeRawXMLStub.java?rev=406098&r1=406097&r2=406098&view=diff
==============================================================================
--- webservices/kandula/trunk/java/src/org/apache/kandula/wsat/completion/CompletionInitiatorPortTypeRawXMLStub.java (original)
+++ webservices/kandula/trunk/java/src/org/apache/kandula/wsat/completion/CompletionInitiatorPortTypeRawXMLStub.java Sat May 13 06:47:07 2006
@@ -40,12 +40,11 @@
public CompletionInitiatorPortTypeRawXMLStub(
EndpointReference targetEndpoint) throws AbstractKandulaException {
super(KandulaConfiguration.getInstance().getCoordinatorRepo(),
- KandulaConfiguration.getInstance()
- .getCoordinatorAxis2Conf(), new AxisService(
- "CompletionInitiatorPortType"));
+ KandulaConfiguration.getInstance().getCoordinatorAxis2Conf(),
+ new AxisService("CompletionInitiatorPortType"));
this.toEPR = targetEndpoint;
- //creating the operations
+ // creating the operations
AxisOperation operation;
operations = new AxisOperation[2];
Modified: webservices/kandula/trunk/java/src/org/apache/kandula/wsat/completion/CompletionInitiatorServiceListener.java
URL: http://svn.apache.org/viewcvs/webservices/kandula/trunk/java/src/org/apache/kandula/wsat/completion/CompletionInitiatorServiceListener.java?rev=406098&r1=406097&r2=406098&view=diff
==============================================================================
--- webservices/kandula/trunk/java/src/org/apache/kandula/wsat/completion/CompletionInitiatorServiceListener.java (original)
+++ webservices/kandula/trunk/java/src/org/apache/kandula/wsat/completion/CompletionInitiatorServiceListener.java Sat May 13 06:47:07 2006
@@ -31,7 +31,6 @@
import org.apache.kandula.Constants;
import org.apache.kandula.utility.KandulaListener;
-
/**
* @author <a href="mailto:thilina@opensource.lk"> Thilina Gunarathne </a>
*/
Modified: webservices/kandula/trunk/java/src/org/apache/kandula/wsat/twopc/CoordinatorPortTypeRawXMLSkeleton.java
URL: http://svn.apache.org/viewcvs/webservices/kandula/trunk/java/src/org/apache/kandula/wsat/twopc/CoordinatorPortTypeRawXMLSkeleton.java?rev=406098&r1=406097&r2=406098&view=diff
==============================================================================
--- webservices/kandula/trunk/java/src/org/apache/kandula/wsat/twopc/CoordinatorPortTypeRawXMLSkeleton.java (original)
+++ webservices/kandula/trunk/java/src/org/apache/kandula/wsat/twopc/CoordinatorPortTypeRawXMLSkeleton.java Sat May 13 06:47:07 2006
@@ -18,7 +18,8 @@
import org.apache.axiom.om.OMElement;
import org.apache.axis2.AxisFault;
-import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.context.OperationContext;
+import org.apache.axis2.wsdl.WSDLConstants;
import org.apache.kandula.Constants;
import org.apache.kandula.coordinator.at.ATCoordinator;
import org.apache.kandula.faults.AbstractKandulaException;
@@ -29,10 +30,10 @@
* @author <a href="mailto:thilina@opensource.lk"> Thilina Gunarathne </a>
*/
public class CoordinatorPortTypeRawXMLSkeleton {
- private MessageContext msgContext;
+ private OperationContext opContext;
- public void init(MessageContext context) {
- this.msgContext = context;
+ public void setOperationContext(OperationContext opContext) {
+ this.opContext = opContext;
}
/**
@@ -42,8 +43,9 @@
public OMElement preparedOperation(OMElement requestElement)
throws AxisFault {
StorageFactory.getInstance().setConfigurationContext(
- msgContext.getServiceContext().getConfigurationContext());
- OMElement header = msgContext.getEnvelope().getHeader();
+ opContext.getServiceContext().getConfigurationContext());
+ OMElement header = opContext.getMessageContext(
+ WSDLConstants.MESSAGE_LABEL_IN_VALUE).getEnvelope().getHeader();
String activityId = header.getFirstChildWithName(
Constants.TRANSACTION_ID_PARAMETER).getText();
String enlistmentId = header.getFirstChildWithName(
@@ -66,8 +68,9 @@
public OMElement abortedOperation(OMElement requestElement)
throws AxisFault {
StorageFactory.getInstance().setConfigurationContext(
- msgContext.getServiceContext().getConfigurationContext());
- OMElement header = msgContext.getEnvelope().getHeader();
+ opContext.getServiceContext().getConfigurationContext());
+ OMElement header = opContext.getMessageContext(
+ WSDLConstants.MESSAGE_LABEL_IN_VALUE).getEnvelope().getHeader();
String activityId = header.getFirstChildWithName(
Constants.TRANSACTION_ID_PARAMETER).getText();
String enlistmentId = header.getFirstChildWithName(
@@ -90,8 +93,9 @@
public OMElement readOnlyOperation(OMElement requestElement)
throws AxisFault {
StorageFactory.getInstance().setConfigurationContext(
- msgContext.getServiceContext().getConfigurationContext());
- OMElement header = msgContext.getEnvelope().getHeader();
+ opContext.getServiceContext().getConfigurationContext());
+ OMElement header = opContext.getMessageContext(
+ WSDLConstants.MESSAGE_LABEL_IN_VALUE).getEnvelope().getHeader();
String activityId = header.getFirstChildWithName(
Constants.TRANSACTION_ID_PARAMETER).getText();
String enlistmentId = header.getFirstChildWithName(
@@ -114,15 +118,16 @@
public OMElement committedOperation(OMElement requestElement)
throws AxisFault {
StorageFactory.getInstance().setConfigurationContext(
- msgContext.getServiceContext().getConfigurationContext());
- OMElement header = msgContext.getEnvelope().getHeader();
+ opContext.getServiceContext().getConfigurationContext());
+ OMElement header = opContext.getMessageContext(
+ WSDLConstants.MESSAGE_LABEL_IN_VALUE).getEnvelope().getHeader();
String activityId = header.getFirstChildWithName(
Constants.TRANSACTION_ID_PARAMETER).getText();
String enlistmentId = header.getFirstChildWithName(
Constants.ENLISTMENT_ID_PARAMETER).getText();
ATCoordinator coordinator = new ATCoordinator();
try {
- coordinator.countParticipantOutcome(activityId, enlistmentId);
+ coordinator.countParticipantOutcome(activityId, enlistmentId);
} catch (AbstractKandulaException e) {
AxisFault fault = new AxisFault(e);
fault.setFaultCode(e.getFaultCode());
@@ -137,7 +142,7 @@
*/
public OMElement replayOperation(OMElement requestElement) throws AxisFault {
StorageFactory.getInstance().setConfigurationContext(
- msgContext.getServiceContext().getConfigurationContext());
+ opContext.getServiceContext().getConfigurationContext());
System.out.println("Visited Replay operation");
return null;
}
Modified: webservices/kandula/trunk/java/src/org/apache/kandula/wsat/twopc/CoordinatorPortTypeRawXMLStub.java
URL: http://svn.apache.org/viewcvs/webservices/kandula/trunk/java/src/org/apache/kandula/wsat/twopc/CoordinatorPortTypeRawXMLStub.java?rev=406098&r1=406097&r2=406098&view=diff
==============================================================================
--- webservices/kandula/trunk/java/src/org/apache/kandula/wsat/twopc/CoordinatorPortTypeRawXMLStub.java (original)
+++ webservices/kandula/trunk/java/src/org/apache/kandula/wsat/twopc/CoordinatorPortTypeRawXMLStub.java Sat May 13 06:47:07 2006
@@ -36,14 +36,12 @@
*/
public CoordinatorPortTypeRawXMLStub(EndpointReference targetEndpoint)
throws AbstractKandulaException {
- super(
- KandulaConfiguration.getInstance()
- .getParticipantRepository(), KandulaConfiguration
- .getInstance().getParticipantAxis2Conf(),
+ super(KandulaConfiguration.getInstance().getParticipantRepository(),
+ KandulaConfiguration.getInstance().getParticipantAxis2Conf(),
new AxisService("CoordinatorPortType"));
this.toEPR = targetEndpoint;
- //creating the operations
+ // creating the operations
AxisOperation operation;
operations = new AxisOperation[5];
@@ -97,7 +95,7 @@
}
public void replayOperation() throws AbstractKandulaException {
- //must send reply to epr
+ // must send reply to epr
this.notify("Replay", Constants.WS_AT_REPLAY, 4, null);
}
Modified: webservices/kandula/trunk/java/src/org/apache/kandula/wsat/twopc/ParticipantPortTypeRawXMLSkeleton.java
URL: http://svn.apache.org/viewcvs/webservices/kandula/trunk/java/src/org/apache/kandula/wsat/twopc/ParticipantPortTypeRawXMLSkeleton.java?rev=406098&r1=406097&r2=406098&view=diff
==============================================================================
--- webservices/kandula/trunk/java/src/org/apache/kandula/wsat/twopc/ParticipantPortTypeRawXMLSkeleton.java (original)
+++ webservices/kandula/trunk/java/src/org/apache/kandula/wsat/twopc/ParticipantPortTypeRawXMLSkeleton.java Sat May 13 06:47:07 2006
@@ -18,7 +18,8 @@
import org.apache.axiom.om.OMElement;
import org.apache.axis2.AxisFault;
-import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.context.OperationContext;
+import org.apache.axis2.wsdl.WSDLConstants;
import org.apache.kandula.Constants;
import org.apache.kandula.context.AbstractContext;
import org.apache.kandula.faults.AbstractKandulaException;
@@ -31,16 +32,17 @@
*/
public class ParticipantPortTypeRawXMLSkeleton {
- private MessageContext msgContext;
+ private OperationContext opContext;
- public void init(MessageContext context) {
- this.msgContext = context;
+ public void setOperationContext(OperationContext opContext) {
+ this.opContext = opContext;
}
public OMElement prepareOperation(OMElement requestEle) throws AxisFault {
StorageFactory.getInstance().setConfigurationContext(
- msgContext.getServiceContext().getConfigurationContext());
- OMElement header = msgContext.getEnvelope().getHeader();
+ opContext.getServiceContext().getConfigurationContext());
+ OMElement header = opContext.getMessageContext(
+ WSDLConstants.MESSAGE_LABEL_IN_VALUE).getEnvelope().getHeader();
String requesterID = header.getFirstChildWithName(
Constants.REQUESTER_ID_PARAMETER).getText();
Store store = StorageFactory.getInstance().getStore();
@@ -59,8 +61,9 @@
public OMElement commitOperation(OMElement requestEle) throws AxisFault {
StorageFactory.getInstance().setConfigurationContext(
- msgContext.getServiceContext().getConfigurationContext());
- OMElement header = msgContext.getEnvelope().getHeader();
+ opContext.getServiceContext().getConfigurationContext());
+ OMElement header = opContext.getMessageContext(
+ WSDLConstants.MESSAGE_LABEL_IN_VALUE).getEnvelope().getHeader();
String requesterID = header.getFirstChildWithName(
Constants.REQUESTER_ID_PARAMETER).getText();
Store store = StorageFactory.getInstance().getStore();
@@ -78,8 +81,9 @@
public OMElement rollbackOperation(OMElement requestEle) throws AxisFault {
StorageFactory.getInstance().setConfigurationContext(
- msgContext.getServiceContext().getConfigurationContext());
- OMElement header = msgContext.getEnvelope().getHeader();
+ opContext.getServiceContext().getConfigurationContext());
+ OMElement header = opContext.getMessageContext(
+ WSDLConstants.MESSAGE_LABEL_IN_VALUE).getEnvelope().getHeader();
String requesterID = header.getFirstChildWithName(
Constants.REQUESTER_ID_PARAMETER).getText();
Store store = StorageFactory.getInstance().getStore();
Modified: webservices/kandula/trunk/java/src/org/apache/kandula/wsat/twopc/ParticipantPortTypeRawXMLStub.java
URL: http://svn.apache.org/viewcvs/webservices/kandula/trunk/java/src/org/apache/kandula/wsat/twopc/ParticipantPortTypeRawXMLStub.java?rev=406098&r1=406097&r2=406098&view=diff
==============================================================================
--- webservices/kandula/trunk/java/src/org/apache/kandula/wsat/twopc/ParticipantPortTypeRawXMLStub.java (original)
+++ webservices/kandula/trunk/java/src/org/apache/kandula/wsat/twopc/ParticipantPortTypeRawXMLStub.java Sat May 13 06:47:07 2006
@@ -38,11 +38,10 @@
*/
public ParticipantPortTypeRawXMLStub() throws AbstractKandulaException {
super(KandulaConfiguration.getInstance().getCoordinatorRepo(),
- KandulaConfiguration.getInstance()
- .getCoordinatorAxis2Conf(), new AxisService(
- "ParticipantPortType"));
+ KandulaConfiguration.getInstance().getCoordinatorAxis2Conf(),
+ new AxisService("ParticipantPortType"));
- //creating the operations
+ // creating the operations
AxisOperation operation;
operations = new AxisOperation[3];
@@ -67,7 +66,7 @@
public void prepareOperation(EndpointReference targetEndpoint)
throws AbstractKandulaException {
- //TODO must send reply TO epr
+ // TODO must send reply TO epr
this.toEPR = targetEndpoint;
this.notify("Prepare", Constants.WS_AT_PREPARE, 0, null);
@@ -75,7 +74,7 @@
public void commitOperation(EndpointReference targetEndpoint)
throws AbstractKandulaException {
- //TODO must send reply to epr
+ // TODO must send reply to epr
this.toEPR = targetEndpoint;
this.notify("Commit", Constants.WS_AT_COMMIT, 1, null);
@@ -83,7 +82,7 @@
public void rollbackOperation(EndpointReference targetEndpoint)
throws AbstractKandulaException {
- //TODO must send reply to epr
+ // TODO must send reply to epr
this.toEPR = targetEndpoint;
this.notify("Rollback", Constants.WS_AT_ROLLBACK, 2, null);
}
Modified: webservices/kandula/trunk/java/src/org/apache/kandula/wsat/twopc/ParticipantServiceListener.java
URL: http://svn.apache.org/viewcvs/webservices/kandula/trunk/java/src/org/apache/kandula/wsat/twopc/ParticipantServiceListener.java?rev=406098&r1=406097&r2=406098&view=diff
==============================================================================
--- webservices/kandula/trunk/java/src/org/apache/kandula/wsat/twopc/ParticipantServiceListener.java (original)
+++ webservices/kandula/trunk/java/src/org/apache/kandula/wsat/twopc/ParticipantServiceListener.java Sat May 13 06:47:07 2006
@@ -30,7 +30,6 @@
import org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver;
import org.apache.kandula.Constants;
import org.apache.kandula.utility.KandulaListener;
-import org.codehaus.jam.internal.elements.ParameterImpl;
/**
* @author <a href="mailto:thilina@opensource.lk"> Thilina Gunarathne </a>
Modified: webservices/kandula/trunk/java/src/org/apache/kandula/wscoor/ActivationCoordinatorPortTypeRawXMLStub.java
URL: http://svn.apache.org/viewcvs/webservices/kandula/trunk/java/src/org/apache/kandula/wscoor/ActivationCoordinatorPortTypeRawXMLStub.java?rev=406098&r1=406097&r2=406098&view=diff
==============================================================================
--- webservices/kandula/trunk/java/src/org/apache/kandula/wscoor/ActivationCoordinatorPortTypeRawXMLStub.java (original)
+++ webservices/kandula/trunk/java/src/org/apache/kandula/wscoor/ActivationCoordinatorPortTypeRawXMLStub.java Sat May 13 06:47:07 2006
@@ -42,14 +42,18 @@
import org.apache.axis2.description.AxisServiceGroup;
import org.apache.axis2.description.InOnlyAxisOperation;
import org.apache.axis2.description.OutInAxisOperation;
+import org.apache.axis2.description.OutOnlyAxisOperation;
import org.apache.axis2.description.Parameter;
import org.apache.axis2.receivers.AbstractMessageReceiver;
import org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver;
+import org.apache.axis2.wsdl.WSDLConstants;
import org.apache.kandula.Constants;
+import org.apache.kandula.context.AbstractContext;
+import org.apache.kandula.context.CoordinationContext;
+import org.apache.kandula.context.impl.ATActivityContext;
import org.apache.kandula.faults.KandulaGeneralException;
import org.apache.kandula.utility.EndpointReferenceFactory;
import org.apache.kandula.utility.KandulaListener;
-import org.codehaus.jam.internal.elements.ParameterImpl;
/**
* @author <a href="mailto:thilina@opensource.lk"> Thilina Gunarathne </a>
@@ -68,7 +72,7 @@
protected EndpointReference toEPR;
- protected AxisOperation[] operations;
+ protected AxisOperation operation;
/**
* Constructor
@@ -92,48 +96,60 @@
this.configurationContext, (AxisServiceGroup) this.service
.getParent());
this.serviceContext = new ServiceContext(service, sgc);
-
- //creating the operations
- AxisOperation operationDesc;
- operations = new org.apache.axis2.description.AxisOperation[1];
-
- operationDesc = new OutInAxisOperation();
- operationDesc.setName(new javax.xml.namespace.QName(
- "http://schemas.xmlsoap.org/ws/2003/09/wscoor",
- "CreateCoordinationContextOperation"));
- operations[0] = operationDesc;
- service.addOperation(operationDesc);
-
}
- public void createCoordinationContextOperation(String coordinationType,
- String id) throws IOException {
+ public void createCoordinationContextOperation(AbstractContext context, boolean async) throws IOException, KandulaGeneralException {
EndpointReference replyToEpr;
MessageContext messageContext = new MessageContext();
Options options = new Options();
messageContext.setProperty(AddressingConstants.WS_ADDRESSING_VERSION,
AddressingConstants.Final.WSA_NAMESPACE);
- SOAPEnvelope env = createSOAPEnvelope(coordinationType);
+ SOAPEnvelope env = createSOAPEnvelope(context.getCoordinationType());
messageContext.setEnvelope(env);
- replyToEpr = setupListener();
- EndpointReferenceFactory.addReferenceProperty(replyToEpr,
- Constants.REQUESTER_ID_PARAMETER, id);
- options.setReplyTo(replyToEpr);
options.setTo(this.toEPR);
options.setAction(Constants.WS_COOR_CREATE_COORDINATIONCONTEXT);
- // messageSender
- // .setSenderTransport(org.apache.axis2.Constants.TRANSPORT_HTTP);
- OperationClient client = operations[0].createClient(serviceContext,
- options);
- client.addMessageContext(messageContext);
- client.execute(false);
+
+ if (async) {
+ operation = new OutOnlyAxisOperation();
+ operation.setName(new javax.xml.namespace.QName("http://schemas.xmlsoap.org/ws/2003/09/wscoor","CreateCoordinationContextOperation"));
+ service.addOperation(operation);
+ replyToEpr = setupListener();
+ EndpointReferenceFactory.addReferenceProperty(replyToEpr,
+ Constants.REQUESTER_ID_PARAMETER, (String) context
+ .getProperty(AbstractContext.REQUESTER_ID));
+ options.setReplyTo(replyToEpr);
+ OperationClient client = operation.createClient(serviceContext,
+ options);
+ client.addMessageContext(messageContext);
+ client.execute(false);
+ } else {
+ operation = new OutInAxisOperation();
+ operation.setName(new javax.xml.namespace.QName("http://schemas.xmlsoap.org/ws/2003/09/wscoor","CreateCoordinationContextOperation"));
+ service.addOperation(operation);
+ OperationClient client = operation.createClient(serviceContext,
+ options);
+ client.addMessageContext(messageContext);
+ client.execute(true);
+ MessageContext msgContext = client
+ .getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
+ OMElement response = msgContext.getEnvelope().getBody()
+ .getFirstChildWithName(new QName(Constants.WS_COOR,"CreateCoordinationContextResponse"));
+ OMElement contextElement = response.getFirstChildWithName(new QName(Constants.WS_COOR,"CoordinationContext"));
+ if (contextElement!=null) {
+ CoordinationContext coordinationContext = CoordinationContext.Factory.newContext(contextElement);
+ context.setCoordinationContext(coordinationContext);
+ }
+ else
+ {
+ throw new KandulaGeneralException("CoordinationContext was not found in the CreareCoordinationContextResponse Message");
+ }
+ }
+
}
- private SOAPEnvelope createSOAPEnvelope(
- String coordinationType) {
- SOAPFactory factory = OMAbstractFactory
- .getSOAP12Factory();
+ private SOAPEnvelope createSOAPEnvelope(String coordinationType) {
+ SOAPFactory factory = OMAbstractFactory.getSOAP12Factory();
SOAPEnvelope env = factory.getDefaultEnvelope();
OMNamespace wsCoor = factory.createOMNamespace(Constants.WS_COOR,
"wscoor");
Modified: webservices/kandula/trunk/java/src/org/apache/kandula/wscoor/ActivationPortTypeRawXMLSkeleton.java
URL: http://svn.apache.org/viewcvs/webservices/kandula/trunk/java/src/org/apache/kandula/wscoor/ActivationPortTypeRawXMLSkeleton.java?rev=406098&r1=406097&r2=406098&view=diff
==============================================================================
--- webservices/kandula/trunk/java/src/org/apache/kandula/wscoor/ActivationPortTypeRawXMLSkeleton.java (original)
+++ webservices/kandula/trunk/java/src/org/apache/kandula/wscoor/ActivationPortTypeRawXMLSkeleton.java Sat May 13 06:47:07 2006
@@ -23,7 +23,7 @@
import org.apache.axiom.om.OMNamespace;
import org.apache.axiom.soap.SOAPFactory;
import org.apache.axis2.AxisFault;
-import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.context.OperationContext;
import org.apache.kandula.Constants;
import org.apache.kandula.context.AbstractContext;
import org.apache.kandula.coordinator.Coordinator;
@@ -35,10 +35,10 @@
*/
public class ActivationPortTypeRawXMLSkeleton {
- private MessageContext msgContext;
+ private OperationContext opContext;
- public void init(MessageContext context) {
- this.msgContext = context;
+ public void setOperationContext(OperationContext opContext) {
+ this.opContext = opContext;
}
/**
@@ -49,7 +49,7 @@
throws AxisFault {
AbstractContext context;
StorageFactory.getInstance().setConfigurationContext(
- msgContext.getServiceContext().getConfigurationContext());
+ opContext.getServiceContext().getConfigurationContext());
/*
* Extracting data from the incoming message
*/
Added: webservices/kandula/trunk/java/src/org/apache/kandula/wscoor/ActivationPortTypeRawXMLSyncMessageReceiver.java
URL: http://svn.apache.org/viewcvs/webservices/kandula/trunk/java/src/org/apache/kandula/wscoor/ActivationPortTypeRawXMLSyncMessageReceiver.java?rev=406098&view=auto
==============================================================================
--- webservices/kandula/trunk/java/src/org/apache/kandula/wscoor/ActivationPortTypeRawXMLSyncMessageReceiver.java (added)
+++ webservices/kandula/trunk/java/src/org/apache/kandula/wscoor/ActivationPortTypeRawXMLSyncMessageReceiver.java Sat May 13 06:47:07 2006
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.kandula.wscoor;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.description.AxisOperation;
+import org.apache.axis2.engine.DependencyManager;
+import org.apache.kandula.Constants;
+
+/**
+ * @author <a href="mailto:thilina@opensource.lk"> Thilina Gunarathne </a>
+ */
+public class ActivationPortTypeRawXMLSyncMessageReceiver extends
+ org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver {
+
+ public void invokeBusinessLogic(
+ org.apache.axis2.context.MessageContext msgContext,
+ org.apache.axis2.context.MessageContext newMsgContext)
+ throws org.apache.axis2.AxisFault {
+
+ try {
+
+ // get the implementation class for the Web Service
+ Object obj = getTheImplementationObject(msgContext);
+
+ // Inject the Message Context if it is asked for
+ DependencyManager.configureBusinessLogicProvider(obj, msgContext
+ .getOperationContext());
+
+ ActivationPortTypeRawXMLSkeleton skel = (ActivationPortTypeRawXMLSkeleton) obj;
+ // Out Envelop
+ SOAPEnvelope envelope = null;
+ // Find the operation that has been set by the Dispatch phase.
+ AxisOperation op = msgContext.getOperationContext()
+ .getAxisOperation();
+
+ String methodName;
+ if (op.getName() != null
+ & (methodName = op.getName().getLocalPart()) != null) {
+ if (("createCoordinationContextOperation").equals(methodName)) {
+ OMElement response = null;
+
+ // doc style
+ response = skel
+ .createCoordinationContextOperation((OMElement) msgContext
+ .getEnvelope().getBody().getFirstElement()
+ .detach());
+
+ // Create a default envelop
+ envelope = getSOAPFactory(msgContext).getDefaultEnvelope();
+ // Create a Omelement of the result if a result exist
+
+ envelope.getBody().setFirstChild(response);
+ }
+ newMsgContext.setEnvelope(envelope);
+ newMsgContext
+ .setWSAAction(Constants.WS_COOR_CREATE_COORDINATIONCONTEXT_RESPONSE);
+ newMsgContext.setRelationships(null);
+ }
+ } catch (Exception e) {
+ throw AxisFault.makeFault(e);
+ }
+
+ }
+
+}
\ No newline at end of file
Modified: webservices/kandula/trunk/java/src/org/apache/kandula/wscoor/ActivationRequesterPortTypeRawXMLSkeleton.java
URL: http://svn.apache.org/viewcvs/webservices/kandula/trunk/java/src/org/apache/kandula/wscoor/ActivationRequesterPortTypeRawXMLSkeleton.java?rev=406098&r1=406097&r2=406098&view=diff
==============================================================================
--- webservices/kandula/trunk/java/src/org/apache/kandula/wscoor/ActivationRequesterPortTypeRawXMLSkeleton.java (original)
+++ webservices/kandula/trunk/java/src/org/apache/kandula/wscoor/ActivationRequesterPortTypeRawXMLSkeleton.java Sat May 13 06:47:07 2006
@@ -17,7 +17,9 @@
package org.apache.kandula.wscoor;
import org.apache.axiom.om.OMElement;
-import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.OperationContext;
+import org.apache.axis2.wsdl.WSDLConstants;
import org.apache.kandula.Constants;
import org.apache.kandula.context.AbstractContext;
import org.apache.kandula.context.CoordinationContext;
@@ -28,17 +30,19 @@
*/
public class ActivationRequesterPortTypeRawXMLSkeleton {
- private MessageContext msgContext;
+ private OperationContext opContext;
- public void init(MessageContext context) {
- this.msgContext = context;
+ public void setOperationContext(OperationContext opContext) {
+ this.opContext = opContext;
}
public OMElement createCoordinationContextResponseOperation(
- OMElement responseElement) {
+ OMElement responseElement) throws AxisFault {
OMElement response = responseElement.getFirstElement();
if ("CoordinationContext".equals(response.getLocalName())) {
- OMElement header = msgContext.getEnvelope().getHeader();
+ OMElement header = opContext.getMessageContext(
+ WSDLConstants.MESSAGE_LABEL_IN_VALUE).getEnvelope()
+ .getHeader();
String requesterID = header.getFirstChildWithName(
Constants.REQUESTER_ID_PARAMETER).getText();
CoordinationContext coordinationContext = CoordinationContext.Factory
Modified: webservices/kandula/trunk/java/src/org/apache/kandula/wscoor/RegistrationCoordinatorPortTypeRawXMLStub.java
URL: http://svn.apache.org/viewcvs/webservices/kandula/trunk/java/src/org/apache/kandula/wscoor/RegistrationCoordinatorPortTypeRawXMLStub.java?rev=406098&r1=406097&r2=406098&view=diff
==============================================================================
--- webservices/kandula/trunk/java/src/org/apache/kandula/wscoor/RegistrationCoordinatorPortTypeRawXMLStub.java (original)
+++ webservices/kandula/trunk/java/src/org/apache/kandula/wscoor/RegistrationCoordinatorPortTypeRawXMLStub.java Sat May 13 06:47:07 2006
@@ -41,16 +41,20 @@
import org.apache.axis2.description.AxisService;
import org.apache.axis2.description.AxisServiceGroup;
import org.apache.axis2.description.InOnlyAxisOperation;
+import org.apache.axis2.description.OutInAxisOperation;
import org.apache.axis2.description.OutOnlyAxisOperation;
import org.apache.axis2.description.Parameter;
import org.apache.axis2.receivers.AbstractMessageReceiver;
import org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver;
+import org.apache.axis2.wsdl.WSDLConstants;
import org.apache.kandula.Constants;
+import org.apache.kandula.context.AbstractContext;
+import org.apache.kandula.context.impl.ATActivityContext;
import org.apache.kandula.faults.AbstractKandulaException;
import org.apache.kandula.faults.KandulaGeneralException;
+import org.apache.kandula.storage.StorageFactory;
import org.apache.kandula.utility.EndpointReferenceFactory;
import org.apache.kandula.utility.KandulaListener;
-import org.codehaus.jam.internal.elements.ParameterImpl;
/**
* @author <a href="mailto:thilina@opensource.lk"> Thilina Gunarathne </a>
@@ -80,7 +84,7 @@
this.toEPR = targetEndpoint;
service = new AxisService("RegistrationCoordinatorPortType");
try {
- configurationContext =ConfigurationContextFactory
+ configurationContext = ConfigurationContextFactory
.createConfigurationContextFromFileSystem(axis2Home,
axis2Xml);
configurationContext.getAxisConfiguration().addService(service);
@@ -94,42 +98,69 @@
.getParent());
this.serviceContext = new ServiceContext(service, sgc);
- operation = new OutOnlyAxisOperation();
- operation.setName(new javax.xml.namespace.QName(
- "http://schemas.xmlsoap.org/ws/2003/09/wscoor",
- "RegisterOperation"));
- service.addOperation(operation);
-
}
- public void registerOperation(String protocolType, EndpointReference epr,
- String id) throws IOException {
+ public void registerOperation(AbstractContext context,
+ EndpointReference epr, boolean async) throws IOException, KandulaGeneralException {
EndpointReference replyToEpr;
MessageContext messageContext = new MessageContext();
Options options = new Options();
messageContext.setProperty(AddressingConstants.WS_ADDRESSING_VERSION,
AddressingConstants.Submission.WSA_NAMESPACE);
- SOAPEnvelope env = createSOAPEnvelope(
- protocolType, epr);
+ SOAPEnvelope env = createSOAPEnvelope(context
+ .getRegistrationProtocol(), epr);
messageContext.setEnvelope(env);
- replyToEpr = setupListener();
- EndpointReferenceFactory.addReferenceProperty(replyToEpr,
- Constants.REQUESTER_ID_PARAMETER, id);
- options.setReplyTo(replyToEpr);
options.setTo(this.toEPR);
options.setAction(Constants.WS_COOR_REGISTER);
- OperationClient client = operation
- .createClient(serviceContext, options);
- client.addMessageContext(messageContext);
- client.execute(false);
+
+ if (async) {
+ operation = new OutOnlyAxisOperation();
+ operation.setName(new javax.xml.namespace.QName(
+ "http://schemas.xmlsoap.org/ws/2003/09/wscoor",
+ "RegisterOperation"));
+ service.addOperation(operation);
+ replyToEpr = setupListener();
+ EndpointReferenceFactory.addReferenceProperty(replyToEpr,
+ Constants.REQUESTER_ID_PARAMETER, (String) context
+ .getProperty(AbstractContext.REQUESTER_ID));
+ options.setReplyTo(replyToEpr);
+ OperationClient client = operation.createClient(serviceContext,
+ options);
+ client.addMessageContext(messageContext);
+ client.execute(false);
+ } else {
+ operation = new OutInAxisOperation();
+ operation.setName(new javax.xml.namespace.QName(
+ "http://schemas.xmlsoap.org/ws/2003/09/wscoor",
+ "RegisterOperation"));
+ service.addOperation(operation);
+ OperationClient client = operation.createClient(serviceContext,
+ options);
+ client.addMessageContext(messageContext);
+ client.execute(true);
+ MessageContext msgContext = client
+ .getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
+ OMElement response = msgContext.getEnvelope().getBody()
+ .getFirstChildWithName(new QName(Constants.WS_COOR,"RegisterResponse"));
+ OMElement serviceElement = response.getFirstChildWithName(new QName(Constants.WS_COOR,"CoordinatorProtocolService"));
+ if (serviceElement!=null) {
+ EndpointReference coordinatorService = EndpointReferenceFactory
+ .endpointFromOM(serviceElement.getFirstElement());
+ context.setProperty(ATActivityContext.COORDINATION_EPR,
+ coordinatorService);
+ }
+ else
+ {
+ throw new KandulaGeneralException("CoordinatorProtocolService epr was not found in the RegistrationResponse Message");
+ }
+ }
}
- private SOAPEnvelope createSOAPEnvelope(
- String protocolType, EndpointReference epr) {
+ private SOAPEnvelope createSOAPEnvelope(String protocolType,
+ EndpointReference epr) {
- SOAPFactory factory = OMAbstractFactory
- .getSOAP12Factory();
+ SOAPFactory factory = OMAbstractFactory.getSOAP12Factory();
SOAPEnvelope env = factory.getDefaultEnvelope();
OMNamespace wsCoor = factory.createOMNamespace(Constants.WS_COOR,
"wscoor");
Modified: webservices/kandula/trunk/java/src/org/apache/kandula/wscoor/RegistrationPortTypeRawXMLSkeleton.java
URL: http://svn.apache.org/viewcvs/webservices/kandula/trunk/java/src/org/apache/kandula/wscoor/RegistrationPortTypeRawXMLSkeleton.java?rev=406098&r1=406097&r2=406098&view=diff
==============================================================================
--- webservices/kandula/trunk/java/src/org/apache/kandula/wscoor/RegistrationPortTypeRawXMLSkeleton.java (original)
+++ webservices/kandula/trunk/java/src/org/apache/kandula/wscoor/RegistrationPortTypeRawXMLSkeleton.java Sat May 13 06:47:07 2006
@@ -24,7 +24,8 @@
import org.apache.axiom.soap.SOAPFactory;
import org.apache.axis2.AxisFault;
import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.context.OperationContext;
+import org.apache.axis2.wsdl.WSDLConstants;
import org.apache.kandula.Constants;
import org.apache.kandula.coordinator.Coordinator;
import org.apache.kandula.faults.AbstractKandulaException;
@@ -36,10 +37,10 @@
*/
public class RegistrationPortTypeRawXMLSkeleton {
- private MessageContext msgContext;
+ private OperationContext opContext;
- public void init(MessageContext msgContext) {
- this.msgContext = msgContext;
+ public void setOperationContext(OperationContext opContext) {
+ this.opContext = opContext;
}
public OMElement registerOperation(OMElement request) throws AxisFault {
@@ -48,7 +49,7 @@
EndpointReference participantEPR;
String activityId;
StorageFactory.getInstance().setConfigurationContext(
- msgContext.getServiceContext().getConfigurationContext());
+ opContext.getServiceContext().getConfigurationContext());
/*
* Extracting data from the received message
*/
@@ -56,10 +57,12 @@
new QName("ProtocolIdentifier")).getText();
OMElement participantEPRElement = request
.getFirstChildWithName(new QName("ParticipantProtocolService"));
- //Extracting the participant EPR
- participantEPR = EndpointReferenceFactory.endpointFromOM(participantEPRElement);
+ // Extracting the participant EPR
+ participantEPR = EndpointReferenceFactory
+ .endpointFromOM(participantEPRElement);
- OMElement header = msgContext.getEnvelope().getHeader();
+ OMElement header = opContext.getMessageContext(
+ WSDLConstants.MESSAGE_LABEL_IN_VALUE).getEnvelope().getHeader();
activityId = header.getFirstChildWithName(
Constants.TRANSACTION_ID_PARAMETER).getText();
/*
@@ -94,7 +97,8 @@
"CoordinatorProtocolService", wsCoor);
OMElement coordinatorProtocolService = factory.createOMElement(
"CoordinatorProtocolService", wsCoor);
- EndpointReferenceFactory.endpointToOM(epr, coordinatorProtocolService, factory);
+ EndpointReferenceFactory.endpointToOM(epr, coordinatorProtocolService,
+ factory);
protocolService.addChild(coordinatorProtocolService);
return protocolService;
}
Added: webservices/kandula/trunk/java/src/org/apache/kandula/wscoor/RegistrationPortTypeRawXMLSyncMessageReceiver.java
URL: http://svn.apache.org/viewcvs/webservices/kandula/trunk/java/src/org/apache/kandula/wscoor/RegistrationPortTypeRawXMLSyncMessageReceiver.java?rev=406098&view=auto
==============================================================================
--- webservices/kandula/trunk/java/src/org/apache/kandula/wscoor/RegistrationPortTypeRawXMLSyncMessageReceiver.java (added)
+++ webservices/kandula/trunk/java/src/org/apache/kandula/wscoor/RegistrationPortTypeRawXMLSyncMessageReceiver.java Sat May 13 06:47:07 2006
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.kandula.wscoor;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.description.AxisOperation;
+import org.apache.axis2.engine.DependencyManager;
+import org.apache.kandula.Constants;
+
+/**
+ * @author <a href="mailto:thilina@opensource.lk"> Thilina Gunarathne </a>
+ */
+public class RegistrationPortTypeRawXMLSyncMessageReceiver extends
+ org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver {
+
+ public void invokeBusinessLogic(
+ org.apache.axis2.context.MessageContext msgContext,
+ org.apache.axis2.context.MessageContext newMsgContext)
+ throws org.apache.axis2.AxisFault {
+
+ try {
+
+ // get the implementation class for the Web Service
+ Object obj = getTheImplementationObject(msgContext);
+
+ // Inject the Message Context if it is asked for
+ DependencyManager.configureBusinessLogicProvider(obj, msgContext
+ .getOperationContext());
+
+ RegistrationPortTypeRawXMLSkeleton skel = (RegistrationPortTypeRawXMLSkeleton) obj;
+ // Out Envelop
+ SOAPEnvelope envelope = null;
+ // Find the operation that has been set by the Dispatch phase.
+ AxisOperation op = msgContext.getOperationContext()
+ .getAxisOperation();
+
+ String methodName;
+ if (op.getName() != null
+ & (methodName = op.getName().getLocalPart()) != null) {
+ if (("registerOperation").equals(methodName)) {
+ OMElement response = null;
+
+ // doc style
+ response = skel
+ .registerOperation((OMElement) msgContext
+ .getEnvelope().getBody().getFirstElement()
+ .detach());
+
+ // Create a default envelop
+ envelope = getSOAPFactory(msgContext).getDefaultEnvelope();
+ // Create a Omelement of the result if a result exist
+
+ envelope.getBody().setFirstChild(response);
+ }
+ newMsgContext.setEnvelope(envelope);
+ newMsgContext.setWSAAction(Constants.WS_COOR_REGISTER_RESPONSE);
+ newMsgContext.setRelationships(null);
+ }
+ } catch (Exception e) {
+ throw AxisFault.makeFault(e);
+ }
+
+ }
+
+}
\ No newline at end of file
Modified: webservices/kandula/trunk/java/src/org/apache/kandula/wscoor/RegistrationRequesterPortTypeRawXMLSkeleton.java
URL: http://svn.apache.org/viewcvs/webservices/kandula/trunk/java/src/org/apache/kandula/wscoor/RegistrationRequesterPortTypeRawXMLSkeleton.java?rev=406098&r1=406097&r2=406098&view=diff
==============================================================================
--- webservices/kandula/trunk/java/src/org/apache/kandula/wscoor/RegistrationRequesterPortTypeRawXMLSkeleton.java (original)
+++ webservices/kandula/trunk/java/src/org/apache/kandula/wscoor/RegistrationRequesterPortTypeRawXMLSkeleton.java Sat May 13 06:47:07 2006
@@ -17,8 +17,12 @@
package org.apache.kandula.wscoor;
import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMException;
+import org.apache.axis2.AxisFault;
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.context.OperationContext;
+import org.apache.axis2.wsdl.WSDLConstants;
import org.apache.kandula.Constants;
import org.apache.kandula.context.AbstractContext;
import org.apache.kandula.context.impl.ATActivityContext;
@@ -30,17 +34,18 @@
*/
public class RegistrationRequesterPortTypeRawXMLSkeleton {
- private MessageContext msgContext;
+ private OperationContext opContext;
- public void init(MessageContext context) {
- this.msgContext = context;
+ public void setOperationContext(OperationContext opContext) {
+ this.opContext = opContext;
}
- public OMElement registerResponseOperation(OMElement responseElement) {
+ public OMElement registerResponseOperation(OMElement responseElement) throws AxisFault{
OMElement response = responseElement.getFirstElement();
if ("CoordinatorProtocolService".equals(response.getLocalName())) {
- OMElement header = msgContext.getEnvelope().getHeader();
+ OMElement header = opContext.getMessageContext(
+ WSDLConstants.MESSAGE_LABEL_IN_VALUE).getEnvelope().getHeader();
String requesterID = header.getFirstChildWithName(
Constants.REQUESTER_ID_PARAMETER).getText();
EndpointReference coordinatorService = EndpointReferenceFactory
---------------------------------------------------------------------
To unsubscribe, e-mail: kandula-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: kandula-dev-help@ws.apache.org