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 2006/01/06 15:07:44 UTC

svn commit: r366507 - in /webservices/axis2/trunk/java/modules: codegen/src/org/apache/axis2/wsdl/template/java/ core/src/org/apache/axis2/client/ core/src/org/apache/axis2/description/ integration/test/org/apache/axis2/security/ security/interop/org/a...

Author: ajith
Date: Fri Jan  6 06:07:21 2006
New Revision: 366507

URL: http://svn.apache.org/viewcvs?rev=366507&view=rev
Log:
Adding the new client API change (Service client/Operation Client)
1. Changed the InterfaceImplementationTemplate.xsl
2. Made the callback class an abstract class
3. made the methods toOm and fromOM private

Fixed some minor issues with the security classes too

Modified:
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/CallbackHandlerTemplate.xsl
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/DatabindingTemplate.xsl
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/Stub.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutInAxisOperation.java
    webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/InteropTestBase.java
    webservices/axis2/trunk/java/modules/security/interop/org/apache/axis2/security/InteropScenarioClient.java

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/CallbackHandlerTemplate.xsl
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/CallbackHandlerTemplate.xsl?rev=366507&r1=366506&r2=366507&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/CallbackHandlerTemplate.xsl (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/CallbackHandlerTemplate.xsl Fri Jan  6 06:07:21 2006
@@ -13,7 +13,7 @@
      *  <xsl:value-of select="@name"/> Callback class 
      */
 
-    public class <xsl:value-of select="@name"/>{
+    public abstract class <xsl:value-of select="@name"/>{
 
 
 

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/DatabindingTemplate.xsl
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/DatabindingTemplate.xsl?rev=366507&r1=366506&r2=366507&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/DatabindingTemplate.xsl (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/DatabindingTemplate.xsl Fri Jan  6 06:07:21 2006
@@ -16,7 +16,7 @@
 
         <xsl:for-each select="param">
             <xsl:if test="@type!=''">
-                public  org.apache.axis2.om.OMElement  toOM(<xsl:value-of select="@type"/> param){
+                private  org.apache.axis2.om.OMElement  toOM(<xsl:value-of select="@type"/> param){
                 org.apache.axis2.om.impl.llom.builder.StAXOMBuilder builder = new org.apache.axis2.om.impl.llom.builder.StAXOMBuilder
                 (org.apache.axis2.om.OMAbstractFactory.getOMFactory(),new org.apache.axis2.util.StreamWrapper(param.newXMLStreamReader())) ;
 
@@ -29,7 +29,7 @@
                   return documentElement;
                 }
 
-                public org.apache.axis2.soap.SOAPEnvelope toEnvelope(org.apache.axis2.soap.SOAPFactory factory, <xsl:value-of select="@type"/> param){
+                private org.apache.axis2.soap.SOAPEnvelope toEnvelope(org.apache.axis2.soap.SOAPFactory factory, <xsl:value-of select="@type"/> param){
                     org.apache.axis2.soap.SOAPEnvelope envelope = factory.getDefaultEnvelope();
                     envelope.getBody().addChild(toOM(param));
                     return envelope;
@@ -93,7 +93,7 @@
 
             <xsl:for-each select="param">
                 <xsl:if test="@type!=''">
-                    public  org.apache.axis2.om.OMElement  toOM(<xsl:value-of select="@type"/> param){
+                    private  org.apache.axis2.om.OMElement  toOM(<xsl:value-of select="@type"/> param){
                         if (param instanceof org.apache.axis2.databinding.ADBBean){
                             org.apache.axis2.om.impl.llom.builder.StAXOMBuilder builder = new org.apache.axis2.om.impl.llom.builder.StAXOMBuilder
                             (org.apache.axis2.om.OMAbstractFactory.getOMFactory(), param.getPullParser(<xsl:value-of select="@type"/>.MY_QNAME));
@@ -107,7 +107,7 @@
                         }
                     }
 
-                    public  org.apache.axis2.soap.SOAPEnvelope toEnvelope(org.apache.axis2.soap.SOAPFactory factory, <xsl:value-of select="@type"/> param){
+                    private  org.apache.axis2.soap.SOAPEnvelope toEnvelope(org.apache.axis2.soap.SOAPFactory factory, <xsl:value-of select="@type"/> param){
                         if (param instanceof org.apache.axis2.databinding.ADBBean){
                             org.apache.axis2.databinding.ADBSOAPModelBuilder builder = new
                                     org.apache.axis2.databinding.ADBSOAPModelBuilder(param.getPullParser(param.MY_QNAME),
@@ -122,7 +122,7 @@
                 </xsl:if>
             </xsl:for-each>
 
-            public  java.lang.Object fromOM(org.apache.axis2.om.OMElement param,
+            private  java.lang.Object fromOM(org.apache.axis2.om.OMElement param,
             java.lang.Class type){
                  Object obj;
                 try {
@@ -144,15 +144,15 @@
        <!-- #################################################################################  -->
        <!-- ############################   none template!!!   ##############################  -->
        <xsl:template match="databinders[@dbtype='none']">
-           public  org.apache.axis2.om.OMElement fromOM(org.apache.axis2.om.OMElement param, java.lang.Class type){
+           private  org.apache.axis2.om.OMElement fromOM(org.apache.axis2.om.OMElement param, java.lang.Class type){
               return param;
            }
 
-           public  org.apache.axis2.om.OMElement  toOM(org.apache.axis2.om.OMElement param){
+           private  org.apache.axis2.om.OMElement  toOM(org.apache.axis2.om.OMElement param){
                return param;
            }
 
-           public org.apache.axis2.soap.SOAPEnvelope toEnvelope(org.apache.axis2.soap.SOAPFactory factory, org.apache.axis2.om.OMElement param){
+           private org.apache.axis2.soap.SOAPEnvelope toEnvelope(org.apache.axis2.soap.SOAPFactory factory, org.apache.axis2.om.OMElement param){
                 org.apache.axis2.soap.SOAPEnvelope envelope = factory.getDefaultEnvelope();
                 envelope.getBody().addChild(param));
                 return envelope;

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl?rev=366507&r1=366506&r2=366507&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl Fri Jan  6 06:07:21 2006
@@ -53,46 +53,47 @@
         </xsl:for-each>
         }
 
-        /**
-        * Constructor
-        */
-        public <xsl:value-of select="@name"/>(String axis2Home,String targetEndpoint) throws java.lang.Exception {
-        //creating the configuration
-        _configurationContext = new org.apache.axis2.context.ConfigurationContextFactory().createConfigurationContextFromFileSystem(axis2Home);
-        _configurationContext.getAxisConfiguration().addService(_service);
-        _serviceContext =new org.apache.axis2.context.ServiceGroupContext(_configurationContext, _service.getParent()).getServiceContext(_service);
-        _clientOptions.setTo(new org.apache.axis2.addressing.EndpointReference(targetEndpoint));
 
-        <!--  Set the soap version depending on the binding. Default is 1.1 so don't set anything for that case-->
+
+     public <xsl:value-of select="@name"/>(org.apache.axis2.context.ConfigurationContext configurationContext, String targetEndpoint)
+        throws java.lang.Exception {
+
+        _serviceClient = new org.apache.axis2.client.ServiceClient(configurationContext,_service);
+        _serviceClient.getOptions().setTo(new org.apache.axis2.addressing.EndpointReference(
+                targetEndpoint));
         <xsl:if test="$soapVersion='1.2'">
             //Set the soap version
-            _clientOptions.setSoapVersionURI(org.apache.axis2.soap.SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
+            _options.setSoapVersionURI(org.apache.axis2.soap.SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
         </xsl:if>
 
+    }
 
-
-        }
-
-        /**
-        * Default Constructor
-        */
-        public <xsl:value-of select="@name"/>() throws java.lang.Exception {
-        <!-- change this -->
+    /**
+     * Default Constructor
+     */
+    public <xsl:value-of select="@name"/>() throws java.lang.Exception {
         <xsl:for-each select="endpoint">
             <xsl:choose>
                 <xsl:when test="position()=1">
-                    this(AXIS2_HOME,"<xsl:value-of select="."/>" );
+                    this("<xsl:value-of select="."/>" );
                 </xsl:when>
                 <xsl:otherwise>
-                    //this(AXIS2_HOME,"<xsl:value-of select="."/>" );
+                    //this("<xsl:value-of select="."/>" );
                 </xsl:otherwise>
             </xsl:choose>
             <xsl:if test="@policyRef">
-                //this has a policy ! The policy is written to the follwing file<xsl:value-of select="@policyRef"></xsl:value-of>
+                //this has a policy ! The policy is written to the following file<xsl:value-of select="@policyRef"></xsl:value-of>
             </xsl:if>
         </xsl:for-each>
+    }
 
-        }
+    /**
+     * Constructor taking the traget endpoint
+     */
+    public <xsl:value-of select="@name"/>(String targetEndpoint) throws java.lang.Exception {
+        this(new org.apache.axis2.context.ConfigurationContextFactory().createConfigurationContextFromFileSystem(AXIS2_HOME),
+                targetEndpoint);
+    }
 
 
 
@@ -119,20 +120,14 @@
                         <xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@type"/><xsl:text> </xsl:text><xsl:value-of select="@name"/>
                     </xsl:for-each>) throws java.rmi.RemoteException{
 
-                    org.apache.axis2.client.Call _call = new org.apache.axis2.client.Call(_serviceContext);
-                    org.apache.axis2.client.Options _options = new org.apache.axis2.client.Options(_clientOptions);
-                    _call.setClientOptions(_options);
-
-                    org.apache.axis2.context.MessageContext _messageContext = getMessageContext();
-                    _options.setSoapAction("<xsl:value-of select="$soapAction"/>");
-                    <!-- see whether this makes sense
-             this is not implemented in the emitter properly-->
-                    <xsl:for-each select="input/param[@Action!='']">_options.setAction("<xsl:value-of select="@Action"/>");</xsl:for-each>
+               org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[<xsl:value-of select="position()-1"/>].getName());
+              _operationClient.getOptions().setSoapAction("<xsl:value-of select="$soapAction"/>");
+              _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true);
 
-                    //set the properties
-                    populateModules(_call);
+              <!--todo if the stub was generated with unwrapping, wrap all parameters into a single element-->
 
-                    org.apache.axis2.soap.SOAPEnvelope env;
+              // create SOAP envelope with that payload
+              org.apache.axis2.soap.SOAPEnvelope env;
                     <xsl:variable name="count"><xsl:value-of select="count(input/param[@type!=''])"></xsl:value-of></xsl:variable>
                     <xsl:choose>
                         <!-- test the number of input parameters
@@ -148,7 +143,7 @@
                                 <xsl:when test="$style='doc'">
                                     //Style is Doc.
                                     <xsl:for-each select="input/param[@location='body']">
-                                        env = toEnvelope(getFactory(this._clientOptions.getSoapVersionURI()), <xsl:value-of select="@name"/>);
+                                        env = toEnvelope(getFactory(_options.getSoapVersionURI()), <xsl:value-of select="@name"/>);
                                     </xsl:for-each>
                                     <xsl:for-each select="input/param[@location='header']">
                                         env.getHeader().addChild(toOM(<xsl:value-of select="@name"/>));
@@ -179,25 +174,36 @@
                         </xsl:otherwise>
                     </xsl:choose>
 
-                    _messageContext.setEnvelope(env);
-                    <xsl:choose>
+        // create message context with that soap envelope
+        org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext() ;
+        _messageContext.setEnvelope(env);
+
+        // add the message contxt to the operation client
+        _operationClient.addMessageContext(_messageContext);
+        //set the options hierarchy
+        _options.setParent (_operationClient.getOptions());
+        _operationClient.setOptions (_options);
+
+        //execute the operation client
+        _operationClient.execute(true);
+
+                     <xsl:choose>
                         <xsl:when test="$outputtype=''">
-                            _call.invokeBlocking(_operations[<xsl:value-of select="position()-1"/>], _messageContext);
                             return;
                         </xsl:when>
                         <xsl:otherwise>
-                            //set the exception throwing status
-                            _call.getClientOptions().setExceptionToBeThrownOnSOAPFault(true);
-                            org.apache.axis2.context.MessageContext  _returnMessageContext = _call.invokeBlocking(_operations[<xsl:value-of select="position()-1"/>], _messageContext);
+                           org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext(
+                                                       org.apache.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE);
                             org.apache.axis2.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope();
+                            <!-- todo need to change this to cater for unwrapped messgaes (multiple parts) -->
                             java.lang.Object object = fromOM(getElement(_returnEnv,"<xsl:value-of select="$style"/>"),<xsl:value-of select="$outputtype"/>.class);
                             return (<xsl:value-of select="$outputtype"/>)object;
                         </xsl:otherwise>
                     </xsl:choose>
 
-                    <!-- this needs to be changed -->
                     }
                 </xsl:if>
+                <!-- Async method generation -->
                 <xsl:if test="$isAsync='1'">
                     /**
                     * Auto generated method signature for Asynchronous Invocations
@@ -212,49 +218,48 @@
                         <xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@type"/><xsl:text> </xsl:text><xsl:value-of select="@name"></xsl:value-of></xsl:for-each>
                     <xsl:if test="$paramCount>0">,</xsl:if>final <xsl:value-of select="$package"/>.<xsl:value-of select="$callbackname"/> callback) throws java.rmi.RemoteException{
 
-                    org.apache.axis2.client.Call _call = new org.apache.axis2.client.Call(_serviceContext);
-                    org.apache.axis2.client.Options _options = new org.apache.axis2.client.Options(_clientOptions);
-                    _call.setClientOptions(_options);
-                    org.apache.axis2.context.MessageContext _messageContext = getMessageContext();
-                    _options.setSoapAction("<xsl:value-of select="$soapAction"/>");
+                    org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[<xsl:value-of select="position()-1"/>].getName());
+              _operationClient.getOptions().setSoapAction("<xsl:value-of select="$soapAction"/>");
+              _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true);
 
-                    <xsl:for-each select="input/param[@Action!='']">_options.setAction("<xsl:value-of select="@Action"/>");</xsl:for-each>
+              <!--todo if the stub was generated with unwrapping, wrap all parameters into a single element-->
 
-                    org.apache.axis2.soap.SOAPEnvelope env = createEnvelope();
+              // create SOAP envelope with that payload
+              org.apache.axis2.soap.SOAPEnvelope env;
+                    <xsl:variable name="count"><xsl:value-of select="count(input/param[@type!=''])"></xsl:value-of></xsl:variable>
                     <xsl:choose>
-                        <!-- There are more than 1 parameter in the input-->
-                        <xsl:when test="$paramCount>0">
+                        <!-- test the number of input parameters
+                        If the number of parameter is more then just run the normal test-->
+                        <xsl:when test="$count>0">
                             <xsl:choose>
                                 <xsl:when test="$style='rpc'">
                                     // Style is RPC
-                                    org.apache.axis2.rpc.client.RPCStub.setValueRPC(getFactory(_options.getSoapVersionURI()), env,
-                                    "<xsl:value-of select="@namespace"/>",
-                                    "<xsl:value-of select="@name"/>",
+                                    org.apache.axis2.rpc.client.RPCStub.setValueRPC(getFactory(_options.getSoapVersionURI(), env,"<xsl:value-of select="@namespace"/>","<xsl:value-of select="@name"/>",
                                     new String[]{<xsl:for-each select="input/param[@type!='']"><xsl:if test="position()>1">,</xsl:if>"<xsl:value-of select="@name"/>"</xsl:for-each>},
                                     new Object[]{<xsl:for-each select="input/param[@type!='']"><xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@name"/></xsl:for-each>});
                                 </xsl:when>
-
                                 <xsl:when test="$style='doc'">
-                                    //Style is Doc
-                                    env = toEnvelope(getFactory(this._clientOptions.getSoapVersionURI()), <xsl:value-of select="input/param[1]/@name"/>);
+                                    //Style is Doc.
+                                    <xsl:for-each select="input/param[@location='body']">
+                                        env = toEnvelope(getFactory(_options.getSoapVersionURI()), <xsl:value-of select="@name"/>);
+                                    </xsl:for-each>
+                                    <xsl:for-each select="input/param[@location='header']">
+                                        env.getHeader().addChild(toOM(<xsl:value-of select="@name"/>));
+                                    </xsl:for-each>
                                 </xsl:when>
                                 <xsl:otherwise>
                                     //Unknown style!! No code is generated
-                                    throw UnsupportedOperationException("Unknown Style");
+                                    throw java.lang.UnsupportedOperationException("Unknown Style");
                                 </xsl:otherwise>
                             </xsl:choose>
                         </xsl:when>
+                        <!-- No input parameters present. So generate assuming no input parameters-->
                         <xsl:otherwise>
                             <xsl:choose>
                                 <xsl:when test="$style='rpc'">
                                     //Style is RPC. No input parameters
-                                    org.apache.axis2.rpc.client.RPCStub.setValueRPC(getFactory(_options.getSoapVersionURI()), env,
-                                    "<xsl:value-of select="@namespace"/>",
-                                    "<xsl:value-of select="@name"/>",
-                                    null,
-                                    null);
+                                    org.apache.axis2.rpc.client.RPCStub.setValueRPC(getFactory(_options.getSoapVersionURI()), env,"<xsl:value-of select="@namespace"/>","<xsl:value-of select="@name"/>",null,null);
                                 </xsl:when>
-                                <!-- The follwing code is specific to XML beans-->
                                 <xsl:when test="$style='doc'">
                                     //Style is Doc. No input parameters
                                     <!-- setValueDoc(env,null); -->
@@ -266,26 +271,40 @@
                             </xsl:choose>
                         </xsl:otherwise>
                     </xsl:choose>
-                    _messageContext.setEnvelope(env);
+
+        // create message context with that soap envelope
+        org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext() ;
+        _messageContext.setEnvelope(env);
+
+        // add the message contxt to the operation client
+        _operationClient.addMessageContext(_messageContext);
+        //set the options hierarchy
+        _options.setParent (_operationClient.getOptions());
+        _operationClient.setOptions (_options);
+
                     <xsl:choose>
                         <xsl:when test="$outputtype=''">
                             //Nothing to pass as the callback!!!
-                            _call.invokeNonBlocking(_operations[<xsl:value-of select="position()-1"/>], _messageContext,null);
                         </xsl:when>
                         <xsl:otherwise>
-                            _call.invokeNonBlocking(_operations[<xsl:value-of select="position()-1"/>], _messageContext, new org.apache.axis2.client.async.Callback(){
-                            public void onComplete(org.apache.axis2.client.async.AsyncResult result){
+                           _operationClient.setCallback(new org.apache.axis2.client.async.Callback() {
+                    public void onComplete(
+                            org.apache.axis2.client.async.AsyncResult result) {
+                        java.lang.Object object = fromOM(getElement(
+                                result.getResponseEnvelope(), "doc"),
+                               <xsl:value-of select="$outputtype"/>.class);
+                        callback.receiveResult<xsl:value-of select="@name"/>((<xsl:value-of select="$outputtype"/>) object);
+                    }
 
-                            java.lang.Object object = fromOM(getElement(result.getResponseEnvelope(),"<xsl:value-of select="$style"/>"),<xsl:value-of select="$outputtype"/>.class);
-                            callback.receiveResult<xsl:value-of select="@name"/>((<xsl:value-of select="$outputtype"/>)object);
-                            }
-                            public void onError(java.lang.Exception e){
-                            callback.receiveError<xsl:value-of select="@name"/>(e);
-                            }
-                            }
-                            );
+                    public void onError(java.lang.Exception e) {
+                        callback.receiveError<xsl:value-of select="@name"/>(e);
+                    }
+                });
                         </xsl:otherwise>
                     </xsl:choose>
+           //execute the operation client
+           _operationClient.execute(true);
+
                     }
                 </xsl:if>
                 <!-- End of in-out mep -->
@@ -297,17 +316,14 @@
                 <xsl:for-each select="input/param[@type!='']">
                     <xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@type"/><xsl:text> </xsl:text><xsl:value-of select="@name"/>
                 </xsl:for-each>) throws java.rmi.RemoteException{
-                org.apache.axis2.client.MessageSender _msgSender = new org.apache.axis2.client.MessageSender(_serviceContext);
 
-                org.apache.axis2.context.MessageContext _messageContext = getMessageContext();
-                org.apache.axis2.client.Options _options = new org.apache.axis2.client.Options(_clientOptions);
-                _msgSender.setClientOptions(_options);
-
-                _options.setSoapAction("<xsl:value-of select="$soapAction"/>");
+                org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[<xsl:value-of select="position()-1"/>].getName());
+                _operationClient.getOptions().setSoapAction("<xsl:value-of select="$soapAction"/>");
+                _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true);
 
                 <xsl:for-each select="input/param[@Action!='']">_options.setAction("<xsl:value-of select="@Action"/>");</xsl:for-each>
                 org.apache.axis2.soap.SOAPEnvelope env;
-                env = createEnvelope();
+
                 <xsl:choose>
                     <!-- test the number of input parameters
                        If the number of parameter is more then just run the normal generation-->
@@ -315,6 +331,7 @@
                         <xsl:choose>
                             <xsl:when test="$style='rpc'">
                                 // Style is RPC
+                                env = createEnvelope();
                                 org.apache.axis2.rpc.client.RPCStub.setValueRPC(getFactory(_options.getSoapVersionURI()), env,"<xsl:value-of select="@namespace"/>","<xsl:value-of select="@name"/>",
                                 new String[]{<xsl:for-each select="input/param[@type!='']"><xsl:if test="position()>1">,</xsl:if>"<xsl:value-of select="@name"/>"</xsl:for-each>},
                                 new Object[]{<xsl:for-each select="input/param[@type!='']"><xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@name"/></xsl:for-each>});
@@ -322,7 +339,7 @@
                             <xsl:when test="$style='doc'">
                                 <!-- for the doc lit case there can be only one element. So take the first element -->
                                 //Style is Doc.
-                                env = toEnvelope(getFactory(this._clientOptions.getSoapVersionURI()), <xsl:value-of select="input/param[1]/@name"/>);
+                                env = toEnvelope(getFactory(_options.getSoapVersionURI()), <xsl:value-of select="input/param[1]/@name"/>);
                             </xsl:when>
                             <xsl:otherwise>
                                 //Unknown style!! No code is generated
@@ -349,13 +366,19 @@
                     </xsl:otherwise>
                 </xsl:choose>
 
-                //set the properties
-                populateModules(_msgSender);
-
-                _messageContext.setEnvelope(env);
-                _msgSender.send(_operations[<xsl:value-of select="position()-1"/>], _messageContext);
-                return;
-                }
+                // create message context with that soap envelope
+            org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext() ;
+            _messageContext.setEnvelope(env);
+
+            // add the message contxt to the operation client
+            _operationClient.addMessageContext(_messageContext);
+            //set the options hierarchy
+            _options.setParent (_operationClient.getOptions());
+            _operationClient.setOptions (_options);
+
+             _operationClient.execute(true);
+             return;
+           }
             </xsl:if>
         </xsl:for-each>
 

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/Stub.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/Stub.java?rev=366507&r1=366506&r2=366507&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/Stub.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/Stub.java Fri Jan  6 06:07:21 2006
@@ -18,9 +18,6 @@
 package org.apache.axis2.client;
 
 import org.apache.axis2.AxisFault;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.context.ServiceContext;
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.om.OMAbstractFactory;
 import org.apache.axis2.om.OMElement;
@@ -42,80 +39,26 @@
      * ServiceContext. The user can share information through this
      * ServiceContext across operations.
      */
-    protected boolean _maintainSession;
-    protected String _currentSessionId;
-    protected Options _clientOptions = new Options();
-    protected ConfigurationContext _configurationContext;
-    protected ServiceContext _serviceContext;
+    protected Options _options = new Options();
+    protected ServiceClient _serviceClient;
 
-    protected Stub() {
+    public Options _getOptions() {
+        return _options;
     }
 
-    public void _endSession() {
-        _maintainSession = false;
-    }
-
-    public Options _getClientOptions() {
-        return _clientOptions;
-    }
-
-    protected String _getServiceContextID() {
-        if (_maintainSession) {
-            return _currentSessionId;
-        } else {
-            return getID();
-        }
-    }
-
-    public Object _getSessionInfo(String key) throws Exception {
-        if (!_maintainSession) {
-
-            // TODO Comeup with a Exception
-            throw new Exception(
-                    "Client is running the session OFF mode: Start session before saving to a session ");
-        }
-        return null;
-//        return _configurationContext.getServiceContext(_currentSessionId).getProperty(key);
-    }
-
-    public void _setClientOptions(Options _clientOptions) {
-        this._clientOptions = _clientOptions;
-    }
-
-    public void _setSessionInfo(String key, Object value) throws Exception {
-        if (!_maintainSession) {
-
-            // TODO Comeup with a Exception
-            throw new Exception(
-                    "Client is running the session OFF mode: Start session before saving to a session ");
-        }
-//        _configurationContext.getServiceContext(_currentSessionId).setProperty(key, value);
-    }
-
-    public void _startSession() {
-        _maintainSession = true;
-        _currentSessionId = getID();
+    public void _setOptions(Options _clientOptions) {
+        this._options = _clientOptions;
     }
 
     protected SOAPEnvelope createEnvelope() throws SOAPProcessingException {
-        return getFactory(this._clientOptions.getSoapVersionURI()).getDefaultEnvelope();
+        return getFactory(this._options.getSoapVersionURI()).getDefaultEnvelope();
     }
 
-    public void engageModule(String moduleName) {
-        this.modules.add(moduleName);
+    public void engageModule(QName moduleName) throws AxisFault {
+        _serviceClient.engageModule(moduleName);
     }
 
-    protected void populateModules(Call call) throws AxisFault {
-        for (int i = 0; i < modules.size(); i++) {
-            call.engageModule(new QName((String) this.modules.get(i)));
-        }
-    }
 
-    protected void populateModules(MessageSender sender) throws AxisFault {
-        for (int i = 0; i < modules.size(); i++) {
-            sender.engageModule(new QName((String) this.modules.get(i)));
-        }
-    }
 
     /**
      * A util method that extracts the correct element.
@@ -145,7 +88,7 @@
     }
 
     protected SOAPFactory getFactory(String soapNamespaceURI) {
-        String soapVersionURI = _clientOptions.getSoapVersionURI();
+        String soapVersionURI = _options.getSoapVersionURI();
 
         if (SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(soapVersionURI)) {
             return OMAbstractFactory.getSOAP11Factory();
@@ -156,18 +99,6 @@
         }
     }
 
-    private String getID() {
 
-        // TODO Get the UUID generator to generate values
-        return Long.toString(System.currentTimeMillis());
-    }
 
-    /**
-     * Gets the message context.
-     */
-    protected MessageContext getMessageContext() throws AxisFault {
-        MessageContext messageContext = new MessageContext();
-        messageContext.setConfigurationContext(_configurationContext);
-        return messageContext;
-    }
 }

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutInAxisOperation.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutInAxisOperation.java?rev=366507&r1=366506&r2=366507&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutInAxisOperation.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutInAxisOperation.java Fri Jan  6 06:07:21 2006
@@ -328,6 +328,9 @@
         responseMessageContext.setSessionContext(msgctx.getSessionContext());
         responseMessageContext.setTransportIn(msgctx.getTransportIn());
         responseMessageContext.setTransportOut(msgctx.getTransportOut());
+        // This is a hack - Needs to change
+        responseMessageContext.setOptions(options);
+
 
         responseMessageContext.setProperty(MessageContext.TRANSPORT_IN, msgctx
                 .getProperty(MessageContext.TRANSPORT_IN));

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/InteropTestBase.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/InteropTestBase.java?rev=366507&r1=366506&r2=366507&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/InteropTestBase.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/InteropTestBase.java Fri Jan  6 06:07:21 2006
@@ -139,7 +139,7 @@
                     OutflowConfiguration.class,
                     InflowConfiguration.class
             });
-            m.invoke(clientObj,new Object[]{Constants.TESTING_PATH + getClientRepo(),targetEpr,getOutflowConfiguration(), getInflowConfiguration()});
+            m.invoke(clientObj,new Object[]{Constants.TESTING_PATH + DEFAULT_CLIENT_REPOSITORY,targetEpr,getOutflowConfiguration(), getInflowConfiguration()});
 
         } catch (Exception e) {
             e.printStackTrace();

Modified: webservices/axis2/trunk/java/modules/security/interop/org/apache/axis2/security/InteropScenarioClient.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/security/interop/org/apache/axis2/security/InteropScenarioClient.java?rev=366507&r1=366506&r2=366507&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/security/interop/org/apache/axis2/security/InteropScenarioClient.java (original)
+++ webservices/axis2/trunk/java/modules/security/interop/org/apache/axis2/security/InteropScenarioClient.java Fri Jan  6 06:07:21 2006
@@ -28,7 +28,7 @@
 import org.xmlsoap.ping.PingResponse;
 import org.xmlsoap.ping.PingResponseDocument;
 import org.xmlsoap.ping.TicketType;
-
+import org.apache.axis2.context.ConfigurationContextFactory;
 
 /**
  * Client for the interop service
@@ -36,14 +36,14 @@
  */
 public class InteropScenarioClient {
 
-	String soapNsURI = SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI;
-	
+String soapNsURI = SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI;
+
 	public InteropScenarioClient(boolean useSOAP12InStaticConfigTest) {
 		if(useSOAP12InStaticConfigTest) {
 			soapNsURI = SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI;
 		}
 	}
-	
+
     public void invokeWithStaticConfig(String clientRepo, String url) throws Exception {
         TicketType ticket = TicketType.Factory.newInstance();
         ticket.setId("My ticket Id");
@@ -55,13 +55,14 @@
         PingDocument pingDoc = PingDocument.Factory.newInstance();
         pingDoc.setPing(ping);
 
-        PingPortStub stub = new PingPortStub(clientRepo,url);
+        PingPortStub stub = new PingPortStub(
+                new ConfigurationContextFactory().createConfigurationContextFromFileSystem(clientRepo),url);
 
         //Enable MTOM to those scenarios where they are configured using:
         //<optimizeParts>xpathExpression</optimizeParts>
-        stub._getClientOptions().setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);
-        stub._getClientOptions().setSoapVersionURI(soapNsURI);
-        
+        stub._getOptions().setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);
+        stub._getOptions().setSoapVersionURI(soapNsURI);
+
         PingResponseDocument pingResDoc = stub.Ping(pingDoc);
 
         PingResponse pingRes = pingResDoc.getPingResponse();
@@ -76,24 +77,26 @@
         Ping ping = Ping.Factory.newInstance();
         ping.setText("Testing axis2-wss4j module");
         ping.setTicket(ticket);
-        
+
         PingDocument pingDoc = PingDocument.Factory.newInstance();
         pingDoc.setPing(ping);
 
-        PingPortStub stub = new PingPortStub(clientRepo,url);
-        
+        PingPortStub stub = new PingPortStub(
+                new ConfigurationContextFactory().createConfigurationContextFromFileSystem(clientRepo),url);
+
         //Enable MTOM to those scenarios where they are configured using:
         //<optimizeParts>xpathExpression</optimizeParts>
-        stub._getClientOptions().setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);
-        
+        stub._getOptions().setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);
+
         //Engage the security module
-        stub.engageModule("security");
+        
+        stub.engageModule(new javax.xml.namespace.QName("security"));
 
         if(outflowConfig !=null){
-        	stub._getClientOptions().setProperty(WSSHandlerConstants.OUTFLOW_SECURITY, outflowConfig.getProperty());
+        	stub._getOptions().setProperty(WSSHandlerConstants.OUTFLOW_SECURITY, outflowConfig.getProperty());
         }
         if(inflowConfig != null) {
-        	stub._getClientOptions().setProperty(WSSHandlerConstants.INFLOW_SECURITY, inflowConfig.getProperty());
+        	stub._getOptions().setProperty(WSSHandlerConstants.INFLOW_SECURITY, inflowConfig.getProperty());
         }
         PingResponseDocument pingResDoc = stub.Ping(pingDoc);