You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by aj...@apache.org on 2005/05/19 14:29:14 UTC
svn commit: r170919 - in
/webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi:
InOutMEPClient.java Stub.java
Author: ajith
Date: Thu May 19 05:29:13 2005
New Revision: 170919
URL: http://svn.apache.org/viewcvs?rev=170919&view=rev
Log:
Checking in a change in the stub and the inoutMEPClient
Modified:
webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/InOutMEPClient.java
webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/Stub.java
Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/InOutMEPClient.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/InOutMEPClient.java?rev=170919&r1=170918&r2=170919&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/InOutMEPClient.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/InOutMEPClient.java Thu May 19 05:29:13 2005
@@ -190,11 +190,23 @@
if (senderTransport == null) {
senderTransport = inferTransport(to);
}
+ if(listenerTransport == null){
+ listenerTransport = senderTransport;
+ }
+
+
+ if(msgctx.getTransportIn() == null){
+ final TransportInDescription transportIn =
+ syscontext.getEngineConfig().getTransportIn(new QName(senderTransport));
+ msgctx.setTransportIn(transportIn);
+ }
+ if(msgctx.getTransportOut() == null){
+ final TransportOutDescription transportOut =
+ syscontext.getEngineConfig().getTransportOut(new QName(listenerTransport));
+ msgctx.setTransportOut(transportOut);
+ }
+
- final TransportInDescription transportIn =
- syscontext.getEngineConfig().getTransportIn(new QName(senderTransport));
- final TransportOutDescription transportOut =
- syscontext.getEngineConfig().getTransportOut(new QName(listenerTransport));
msgctx.setOperationContext(axisop.findOperationContext(msgctx, serviceContext, false));
msgctx.setServiceContext(serviceContext);
Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/Stub.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/Stub.java?rev=170919&r1=170918&r2=170919&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/Stub.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/Stub.java Thu May 19 05:29:13 2005
@@ -19,8 +19,18 @@
import javax.xml.namespace.QName;
import org.apache.axis.context.EngineContextFactory;
+import org.apache.axis.context.ConfigurationContext;
+import org.apache.axis.context.ServiceContext;
+import org.apache.axis.context.MessageContext;
import org.apache.axis.deployment.DeploymentException;
import org.apache.axis.engine.AxisFault;
+import org.apache.axis.description.ServiceDescription;
+import org.apache.axis.description.OperationDescription;
+import org.apache.axis.addressing.EndpointReference;
+import org.apache.axis.addressing.AddressingConstants;
+import org.apache.axis.soap.SOAPEnvelope;
+import org.apache.axis.om.OMAbstractFactory;
+import org.apache.axis.om.OMElement;
/**
* @author chathura@opensource.lk
@@ -28,10 +38,13 @@
*/
public abstract class Stub {
- protected org.apache.axis.context.ConfigurationContext _configurationContext;
- protected org.apache.axis.description.ServiceDescription _service;
- protected static org.apache.axis.description.OperationDescription[] _operations;
-
+ protected ConfigurationContext _configurationContext;
+ protected static ServiceDescription _service;
+ protected ServiceContext _serviceContext;
+ protected EndpointReference toEPR ;
+
+
+
/**
* If _maintainSession is set to True all the calls will use the same
* ServiceContext and the user can Share information through that
@@ -41,23 +54,31 @@
protected String _currentSessionId = null;
- protected Stub(QName serviceName, String axis2Home)throws DeploymentException, AxisFault{
- _configurationContext = new EngineContextFactory().buildClientEngineContext(axis2Home);
- _service = new org.apache.axis.description.ServiceDescription();
- _service.setName(serviceName);
-
- for (int i = 0; i < _operations.length; i++) {
- _service.addOperation(_operations[i]);
- }
-
- _configurationContext.getEngineConfig().addService(_service);
+ protected Stub()throws DeploymentException, AxisFault{
+
}
- public abstract void _setSessionInfo(Object key, Object value) throws Exception;
-
- public abstract Object _getSessionInfo(Object key) throws Exception ;
-
-
+// public abstract void _setSessionInfo(Object key, Object value) throws Exception;
+//
+// public abstract Object _getSessionInfo(Object key) throws Exception ;
+
+ public void _setSessionInfo(Object key, Object value)throws java.lang.Exception{
+ if(!_maintainSession){
+ //TODO Comeup with a Exception
+ throw new java.lang.Exception("Client is running the session OFF mode: Start session before saving to a session ");
+ }
+ _configurationContext.getServiceContext(_currentSessionId).setProperty(key, value);
+ }
+
+
+ public Object _getSessionInfo(Object key) throws java.lang.Exception{
+ if(!_maintainSession){
+ //TODO Comeup with a Exception
+ throw new java.lang.Exception("Client is running the session OFF mode: Start session before saving to a session ");
+ }
+ return _configurationContext.getServiceContext(_currentSessionId).getProperty(key);
+ }
+
public void _startSession(){
_maintainSession = true;
_currentSessionId = getID() ;
@@ -78,4 +99,17 @@
//TODO Get the UUID generator to generate values
return Long.toString(System.currentTimeMillis());
}
+
+ protected SOAPEnvelope createEnvelope(OMElement omElement){
+ SOAPEnvelope env = OMAbstractFactory.getSOAP11Factory().getDefaultEnvelope();
+ env.getBody().addChild(omElement);
+ return env;
+ }
+ /**
+ * get the message context
+ */
+ protected MessageContext getMessageContext() throws AxisFault {
+ return new MessageContext(null,null,null,_configurationContext);
+ }
}
+