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/12 07:46:02 UTC

svn commit: r169771 - in /webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl: codegen/emitter/JavaEmitter.java template/java/InterfaceImplementationTemplate.xsl

Author: ajith
Date: Wed May 11 22:46:02 2005
New Revision: 169771

URL: http://svn.apache.org/viewcvs?rev=169771&view=rev
Log:
Added some more stub code to the xsl

Modified:
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/codegen/emitter/JavaEmitter.java
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/template/java/InterfaceImplementationTemplate.xsl

Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/codegen/emitter/JavaEmitter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/codegen/emitter/JavaEmitter.java?rev=169771&r1=169770&r2=169771&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/codegen/emitter/JavaEmitter.java (original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/codegen/emitter/JavaEmitter.java Wed May 11 22:46:02 2005
@@ -61,6 +61,8 @@
 
     public void emitStub() throws CodeGenerationException {
         //todo need to out the type mapper code here
+        //it can be the
+
         super.emitStub();
     }
 
@@ -95,6 +97,7 @@
 
         Element methodElement = null;
         Attr methodNameAttr = null;
+        Attr methodURIAttr = null;
         WSDLOperation operation = null;
 
         for (Iterator iterator = col.iterator(); iterator.hasNext();) {
@@ -106,6 +109,10 @@
             methodNameAttr.setValue(operation.getName().getLocalPart());
             methodElement.setAttributeNode(methodNameAttr);
 
+            methodURIAttr = doc.createAttribute("namepace");
+            methodURIAttr.setValue(operation.getName().getNamespaceURI());
+            methodElement.setAttributeNode(methodURIAttr);
+
             methodElement.appendChild(getInputElement(doc,operation));
             methodElement.appendChild(getOutputElement(doc,operation));
 
@@ -132,6 +139,14 @@
         Attr nameAttribute = doc.createAttribute("name");
         nameAttribute.setValue(boundInterface.getName().getLocalPart()+"Stub");
         rootElement.setAttributeNode(nameAttribute);
+
+        Attr nameServiceAttribute = doc.createAttribute("servicename");
+        nameServiceAttribute.setValue(boundInterface.getName().getLocalPart());
+        rootElement.setAttributeNode(nameServiceAttribute);
+
+        Attr nameSpaceAttribute = doc.createAttribute("namespace");
+        nameSpaceAttribute.setValue(boundInterface.getName().getNamespaceURI());
+        rootElement.setAttributeNode(nameSpaceAttribute);
 
         Attr InterfaceNameAttribute = doc.createAttribute("interfaceName");
         InterfaceNameAttribute.setValue(boundInterface.getName().getLocalPart());

Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/template/java/InterfaceImplementationTemplate.xsl
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/template/java/InterfaceImplementationTemplate.xsl?rev=169771&r1=169770&r2=169771&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/template/java/InterfaceImplementationTemplate.xsl (original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/template/java/InterfaceImplementationTemplate.xsl Wed May 11 22:46:02 2005
@@ -12,13 +12,21 @@
     public class <xsl:value-of select="@name"></xsl:value-of> extends org.apache.axis.clientapi.Stub implements <xsl:value-of select="$interfaceName"/>{
 
        static{
-         org.apache.axis.description.AxisOperation __operation;
+        _axisGlobal = new org.apache.axis.description.AxisGlobal();
+        _axisSystem = new org.apache.axis.engine.AxisSystemImpl(_axisGlobal);
+		_systemContext = new org.apache.axis.context.SystemContext(_axisSystem);
+		_service = new org.apache.axis.description.AxisService();
+
+        _service.setName(new javax.xml.namespace.QName("<xsl:value-of select="@namespace"/>", "<xsl:value-of select="@servicename"/>"));
+
+        org.apache.axis.description.AxisOperation __operation;
+
       <xsl:for-each select="method">
           __operation = new org.apache.axis.description.AxisOperation();
-
+          __operation.setName(new javax.xml.namespace.QName("<xsl:value-of select="@namespace"/>", "<xsl:value-of select="@name"/>"));
           // more things are supposed to come here
 
-          _operations[<xsl:value-of select="position()"/>]=__operation;
+          _operations[<xsl:value-of select="position()-1"/>]=__operation;
 
      </xsl:for-each>
        }
@@ -33,8 +41,11 @@
          *<xsl:if test="$inputtype!=''">@param <xsl:value-of select="$inputparam"></xsl:value-of></xsl:if>
          */
         public  <xsl:value-of select="$outputtype"/><xsl:text> </xsl:text><xsl:value-of select="@name"/>(<xsl:if test="$inputtype!=''"><xsl:value-of select="$inputtype"/><xsl:text> </xsl:text><xsl:value-of select="$inputparam"></xsl:value-of></xsl:if>) throws java.rmi.RemoteException;
-            <xsl:if test="$outputtype!=''">return null;</xsl:if>
-            <!-- this needs to be changed -->
+            // we know its call because we have the mep at the time of the stub generation.
+		    Call _call = new Call(_systemContext.getServiceContext("<xsl:value-of select="generate-id()"/>"));<!-- this needs to change -->
+ 		    MessageContext _messageContext = getMessageContext();
+		    _call.invokeNonBlocking(_operations[<xsl:value-of select="position()-1"/>], _messageContext);
+            <xsl:if test="$outputtype!=''">return null;</xsl:if>  <!-- this needs to be changed -->
         }
      </xsl:for-each>
     }