You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by di...@apache.org on 2008/09/15 16:05:14 UTC

svn commit: r695475 [1/2] - in /webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl: codegen/emitter/ codegen/extension/ template/c/

Author: dimuthu
Date: Mon Sep 15 07:05:14 2008
New Revision: 695475

URL: http://svn.apache.org/viewvc?rev=695475&view=rev
Log:
adding unwrapp mode for wsdl2c tool - fix for https://issues.apache.org/jira/browse/AXIS2C-1145 

Modified:
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/CEmitter.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/TypeMapperExtension.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/c/ServiceSkeleton.xsl
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/c/SkelHeaderTemplate.xsl
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/c/SkelSourceTemplate.xsl
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/c/StubHeaderTemplate.xsl
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/c/StubSourceTemplate.xsl

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/CEmitter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/CEmitter.java?rev=695475&r1=695474&r2=695475&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/CEmitter.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/CEmitter.java Mon Sep 15 07:05:14 2008
@@ -53,6 +53,8 @@
 import java.util.Iterator;
 import java.util.List;
 
+import com.ibm.wsdl.util.xml.DOM2Writer;
+
 public class CEmitter extends AxisServiceBasedMultiLanguageEmitter {
     protected static final String C_STUB_PREFIX = "axis2_stub_";
     protected static final String C_SKEL_PREFIX = "axis2_skel_";
@@ -293,7 +295,7 @@
         rootElement.appendChild(getUniqueListofFaults(doc));
 
         /////////////////////////////////////////////////////
-//        System.out.println(DOM2Writer.nodeToString(rootElement));
+        // System.out.println(DOM2Writer.nodeToString(rootElement));
         /////////////////////////////////////////////////////
 
 
@@ -679,8 +681,7 @@
         addAttribute(doc, "caps-type", paramType.toUpperCase(), param);
 
         if (!paramType.equals("") && !paramType.equals("void") &&
-                !paramType.equals("org.apache.axiom.om.OMElement") &&
-                !typeMappingStr.equals(C_DEFAULT_TYPE)) {
+                !typeMappingStr.equals(C_DEFAULT_TYPE) && typeMappingStr.contains("adb_")) {
             addAttribute(doc, "ours", "yes", param);
         }
     }

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/TypeMapperExtension.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/TypeMapperExtension.java?rev=695475&r1=695474&r2=695475&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/TypeMapperExtension.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/TypeMapperExtension.java Mon Sep 15 07:05:14 2008
@@ -23,6 +23,7 @@
 import org.apache.axis2.wsdl.codegen.CodeGenerationException;
 import org.apache.axis2.wsdl.databinding.DefaultTypeMapper;
 import org.apache.axis2.wsdl.databinding.TypeMapper;
+import org.apache.axis2.wsdl.databinding.CTypeMapper;
 import org.apache.axis2.wsdl.i18n.CodegenMessages;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
@@ -63,7 +64,14 @@
             TypeMapper mapper = configuration.getTypeMapper();
             // there is no mapper present - so just create a new one
             if (mapper == null) {
-                mapper = new DefaultTypeMapper();
+                if (configuration.getOutputLanguage() != null &&
+                    !configuration.getOutputLanguage().trim().equals("") &&
+                    configuration.getOutputLanguage().toLowerCase().equals("c")) {
+                    mapper = new CTypeMapper();
+    
+                }  else {
+                    mapper = new DefaultTypeMapper();
+                }
             }
 
             //read the file as a DOM

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/c/ServiceSkeleton.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/c/ServiceSkeleton.xsl?rev=695475&r1=695474&r2=695475&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/c/ServiceSkeleton.xsl (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/c/ServiceSkeleton.xsl Mon Sep 15 07:05:14 2008
@@ -108,14 +108,14 @@
             <xsl:if test="input/param[@location='soap_header']">
              void
              axis2_skel_op_<xsl:value-of select="$servicename"/>_<xsl:value-of select="@name"/>_free_input_headers(const axutil_env_t *env, <xsl:for-each select="input/param[@location='soap_header']"><xsl:if test="position()!=1">,</xsl:if>
-                                                     <xsl:variable name="inputtype"><xsl:if test="@ours">adb_</xsl:if><xsl:value-of select="@type"/><xsl:if test="@ours">_t*</xsl:if></xsl:variable>
+                                                     <xsl:variable name="inputtype"><xsl:value-of select="@type"/></xsl:variable>
                                                      <xsl:value-of select="$inputtype"/><xsl:text> _</xsl:text><xsl:value-of select="@name"/>
                                                      </xsl:for-each>);
             </xsl:if>
             <xsl:if test="output/param[@location='soap_header']">
              void
              axis2_skel_op_<xsl:value-of select="$servicename"/>_<xsl:value-of select="@name"/>_free_output_headers(const axutil_env_t *env, <xsl:for-each select="output/param[@location='soap_header']"><xsl:if test="position()!=1">,</xsl:if>
-                                                     <xsl:variable name="outputtype"><xsl:if test="@ours">adb_</xsl:if><xsl:value-of select="@type"/><xsl:if test="@ours">_t*</xsl:if></xsl:variable>
+                                                     <xsl:variable name="outputtype"><xsl:value-of select="@type"/></xsl:variable>
                                                      <xsl:value-of select="$outputtype"/><xsl:text> _</xsl:text><xsl:value-of select="@name"/>
                                                      </xsl:for-each>);
            </xsl:if>
@@ -192,7 +192,7 @@
         <xsl:if test="input/param[@location='soap_header']">
          void
          axis2_skel_op_<xsl:value-of select="$servicename"/>_<xsl:value-of select="@name"/>_free_input_headers(const axutil_env_t *env, <xsl:for-each select="input/param[@location='soap_header']"><xsl:if test="position()!=1">,</xsl:if>
-                                                 <xsl:variable name="inputtype"><xsl:if test="@ours">adb_</xsl:if><xsl:value-of select="@type"/><xsl:if test="@ours">_t*</xsl:if></xsl:variable>
+                                                 <xsl:variable name="inputtype"><xsl:value-of select="@type"/></xsl:variable>
                                                  <xsl:value-of select="$inputtype"/><xsl:text> _</xsl:text><xsl:value-of select="@name"/>
                                                  </xsl:for-each>)
          {
@@ -202,7 +202,7 @@
                 <xsl:when test="@ours">
                     if(<xsl:value-of select="$header_var"/>)
                     {
-                        adb_<xsl:value-of select="@type"/>_free(<xsl:value-of select="$header_var"/>, env);
+                        <xsl:value-of select="substring-before(@type, '_t*')"/>_free(<xsl:value-of select="$header_var"/>, env);
                     }
                 </xsl:when>
                 <xsl:otherwise>
@@ -223,7 +223,7 @@
         <xsl:if test="output/param[@location='soap_header']">
          void
          axis2_skel_op_<xsl:value-of select="$servicename"/>_<xsl:value-of select="@name"/>_free_output_headers(const axutil_env_t *env, <xsl:for-each select="output/param[@location='soap_header']"><xsl:if test="position()!=1">,</xsl:if>
-                                                 <xsl:variable name="outputtype"><xsl:if test="@ours">adb_</xsl:if><xsl:value-of select="@type"/><xsl:if test="@ours">_t*</xsl:if></xsl:variable>
+                                                 <xsl:variable name="outputtype"><xsl:value-of select="@type"/></xsl:variable>
                                                  <xsl:value-of select="$outputtype"/><xsl:text> _</xsl:text><xsl:value-of select="@name"/>
                                                  </xsl:for-each>)
          {
@@ -233,7 +233,7 @@
                 <xsl:when test="@ours">
                     if(<xsl:value-of select="$header_var"/>)
                     {
-                        adb_<xsl:value-of select="@type"/>_free(<xsl:value-of select="$header_var"/>, env);
+                        <xsl:value-of select="substring-before(@type, '_t*')"/>_free(<xsl:value-of select="$header_var"/>, env);
                     }
                 </xsl:when>
                 <xsl:otherwise> 
@@ -370,23 +370,19 @@
             <xsl:variable name="position"><xsl:value-of select="position()"/></xsl:variable>
             <xsl:variable name="outputtype">
               <xsl:choose>
-                <xsl:when test="output/param/@ours">adb_<xsl:value-of select="output/param/@type"/>_t*</xsl:when>
                 <xsl:when test="not(output/param/@type)">axis2_status_t</xsl:when>
                 <xsl:otherwise><xsl:value-of select="output/param/@type"></xsl:value-of></xsl:otherwise>
               </xsl:choose>
             </xsl:variable>
-            <xsl:value-of select="$outputtype"/> ret_val<xsl:value-of select="$position"/><xsl:if test="output/param/@ours"> = NULL</xsl:if>;
+            <xsl:value-of select="$outputtype"/> ret_val<xsl:value-of select="$position"/>;
             <xsl:if test="input/param/@type!=''">
-              <xsl:variable name="inputtype"><xsl:if test="input/param/@ours">adb_</xsl:if><xsl:value-of select="input/param/@type"/><xsl:if test="input/param/@ours">_t*</xsl:if></xsl:variable>
-              <xsl:value-of select="$inputtype"/> input_val<xsl:value-of select="$position"/><xsl:if test="input/param/@ours"> = NULL</xsl:if>;
+              <xsl:value-of select="input/param/@type"/> input_val<xsl:value-of select="$position"/>;
             </xsl:if>
             <xsl:for-each select="input/param[@location='soap_header']">
-                <xsl:variable name="inputtype"><xsl:if test="@ours">adb_</xsl:if><xsl:value-of select="@type"/><xsl:if test="@ours">_t*</xsl:if></xsl:variable>
-                <xsl:value-of select="$inputtype"/><xsl:text> _</xsl:text><xsl:value-of select="@name"/><xsl:value-of select="$position"/> = NULL;
+                <xsl:value-of select="@type"/><xsl:text> _</xsl:text><xsl:value-of select="@name"/><xsl:value-of select="$position"/> = NULL;
             </xsl:for-each>
             <xsl:for-each select="output/param[@location='soap_header']">
-                <xsl:variable name="outputtype"><xsl:if test="@ours">adb_</xsl:if><xsl:value-of select="@type"/><xsl:if test="@ours">_t*</xsl:if></xsl:variable>
-                <xsl:value-of select="$outputtype"/><xsl:text> _</xsl:text><xsl:value-of select="@name"/><xsl:value-of select="$position"/> = NULL;
+                <xsl:value-of select="@type"/><xsl:text> _</xsl:text><xsl:value-of select="@name"/><xsl:value-of select="$position"/> = NULL;
             </xsl:for-each>
           </xsl:for-each>
 
@@ -438,13 +434,13 @@
                     <xsl:if test="input/param/@type!=''">
                     input_val<xsl:value-of select="$position"/> = <xsl:choose>
                         <xsl:when test="input/param/@ours">
-                        adb_<xsl:value-of select="input/param/@type"/>_create( env);
-                        if( AXIS2_FAILURE == adb_<xsl:value-of select="input/param/@type"/>_deserialize(input_val<xsl:value-of select="$position"/>, env, &amp;content_node, NULL, AXIS2_FALSE))
+                        <xsl:value-of select="substring-before(input/param/@type, '_t*')"/>_create( env);
+                        if( AXIS2_FAILURE == <xsl:value-of select="substring-before(input/param/@type, '_t*')"/>_deserialize(input_val<xsl:value-of select="$position"/>, env, &amp;content_node, NULL, AXIS2_FALSE))
                         {
-                            adb_<xsl:value-of select="input/param/@type"/>_free(input_val<xsl:value-of select="$position"/>, env);
+                            <xsl:value-of select="substring-before(input/param/@type, '_t*')"/>_free(input_val<xsl:value-of select="$position"/>, env);
                       
                             AXIS2_ERROR_SET(env->error, AXIS2_ERROR_DATA_ELEMENT_IS_NULL, AXIS2_FAILURE);
-                            AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "NULL returnted from the <xsl:value-of select="input/param/@type"/>_deserialize: "
+                            AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "NULL returnted from the <xsl:value-of select="substring-before(input/param/@type, '_t*')"/>_deserialize: "
                                         "This should be due to an invalid XML");
                             return NULL;      
                         }
@@ -484,27 +480,27 @@
                         axis2_skel_op_<xsl:value-of select="$servicename"/>_<xsl:value-of select="$method-name"/>_free_input_headers(env, <xsl:for-each select="../../input/param[@location='soap_header']"><xsl:if test="position()!=1">,</xsl:if>
                                                      <xsl:text>_</xsl:text><xsl:value-of select="@name"/><xsl:value-of select="$position"/>
                                                      </xsl:for-each>);
-                        adb_<xsl:value-of select="$inputtype"/>_free(input_val<xsl:value-of select="$position"/>, env);
+                        <xsl:value-of select="substring-before($inputtype, '_t*')"/>_free(input_val<xsl:value-of select="$position"/>, env);
                         </xsl:if>
                         return NULL;
                     }
               
                     <xsl:choose>
                     <xsl:when test="@ours">
-                        <xsl:value-of select="$header_var"/> = adb_<xsl:value-of select="@type"/>_create(env);
+                        <xsl:value-of select="$header_var"/> = <xsl:value-of select="substring-before(@type, '_t*')"/>_create(env);
 
-                        if(adb_<xsl:value-of select="@type"/>_deserialize(<xsl:value-of select="$header_var"/>, env, &amp;input_header, NULL, AXIS2_FALSE ) == AXIS2_FAILURE)
+                        if(<xsl:value-of select="substring-before(@type, '_t*')"/>_deserialize(<xsl:value-of select="$header_var"/>, env, &amp;input_header, NULL, AXIS2_FALSE ) == AXIS2_FAILURE)
                         {
                             if(<xsl:value-of select="$header_var"/> != NULL)
                             {
-                                adb_<xsl:value-of select="@type"/>_free(<xsl:value-of select="$header_var"/>, env);
+                                <xsl:value-of select="substring-before(@type, '_t*')"/>_free(<xsl:value-of select="$header_var"/>, env);
                             }
-                            AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "NULL returnted from the <xsl:value-of select="@type"/>_deserialize: "
+                            AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "NULL returnted from the <xsl:value-of select="substring-before(@type, '_t*')"/>_deserialize: "
                                                                     "This should be due to an invalid input header");
                             axis2_skel_op_<xsl:value-of select="$servicename"/>_<xsl:value-of select="$method-name"/>_free_input_headers(env, <xsl:for-each select="../../input/param[@location='soap_header']"><xsl:if test="position()!=1">,</xsl:if>
                                                           <xsl:text>_</xsl:text><xsl:value-of select="@name"/><xsl:value-of select="$position"/>
                                                          </xsl:for-each>);
-                            adb_<xsl:value-of select="$inputtype"/>_free(input_val<xsl:value-of select="$position"/>, env);
+                            <xsl:value-of select="substring-before($inputtype, '_t*')"/>_free(input_val<xsl:value-of select="$position"/>, env);
                             return NULL;
                         }
                     </xsl:when>
@@ -519,26 +515,36 @@
                     <xsl:choose>
                     <xsl:when test="$isUnwrapParameters">
                         <xsl:variable name="inputparam_values">
+                            <xsl:choose>
+                                <xsl:when test="input/param/@complextype">
                                                 <xsl:for-each select="input/param/param[@type!='']">,
-                                                     adb_<xsl:value-of select="$inputtype"/>_property<xsl:value-of select="position()"/>(input_val<xsl:value-of select="$position"/><xsl:text>, env)</xsl:text>
+                                                     <xsl:value-of select="substring-before(../@complextype, '_t*')"/>_get_property<xsl:value-of select="position()"/>(
+                                                            <xsl:value-of select="substring-before($inputtype, '_t*')"/>_get_property1(input_val<xsl:value-of select="$position"/><xsl:text>, env)</xsl:text>
+                                                            <xsl:text>, env)</xsl:text>
                                                 </xsl:for-each>
-                        </xsl:variable>
-                        <xsl:variable name="outputparam_types">
-                            <xsl:choose>
-                                <xsl:when test="output/param/param/@ours">
-                                    <xsl:text>adb_</xsl:text><xsl:value-of select="output/param/param/@type"/>
                                 </xsl:when>
                                 <xsl:otherwise>
-                                    <xsl:value-of select="output/param/param/@type"/>
+                                                <xsl:for-each select="input/param/param[@type!='']">,
+                                                     <xsl:value-of select="substring-before($inputtype, '_t*')"/>_get_property<xsl:value-of select="position()"/>(input_val<xsl:value-of select="$position"/><xsl:text>, env)</xsl:text>
+                                                </xsl:for-each>
                                 </xsl:otherwise>
                             </xsl:choose>
                         </xsl:variable>
+                        <xsl:variable name="outputparam_types" select="output/param/param/@type"/>
                         {
                            <xsl:value-of select="$outputparam_types"/> ret_unwrapped = <xsl:value-of select="$svcop-prefix"/>_<xsl:value-of select="$method-name"/><xsl:text>(env</xsl:text>
                                                 <xsl:value-of select="$inputparam_values"/><xsl:for-each select="output/param[@location='soap_header']">,
                                                     <xsl:text>&amp;_</xsl:text><xsl:value-of select="@name"/><xsl:value-of select="$position"/>
                                                 </xsl:for-each>);
-                           ret_val<xsl:value-of select="$position"/> = adb_<xsl:value-of select="output/param/@type"/>_create_with_values(env, ret_unwrapped);
+                            <xsl:choose>
+                                <xsl:when test="output/param/@complextype">
+                                    ret_val<xsl:value-of select="$position"/> = <xsl:value-of select="substring-before(output/param/@type, '_t*')"/>_create_with_values(env, 
+                                            <xsl:value-of select="substring-before(output/param/@complextype, '_t*')"/>_create_with_values(env, ret_unwrapped));
+                                </xsl:when>
+                                <xsl:otherwise>
+                                    ret_val<xsl:value-of select="$position"/> = <xsl:value-of select="substring-before(output/param/@type, '_t*')"/>_create_with_values(env, ret_unwrapped);
+                                </xsl:otherwise>
+                            </xsl:choose>
                         }
                     </xsl:when>
                     <xsl:otherwise>
@@ -561,7 +567,7 @@
                             AXIS2_ERROR_SET(env->error, AXIS2_ERROR_DATA_ELEMENT_IS_NULL, AXIS2_FAILURE);
                             AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "NULL returnted from the business logic from <xsl:value-of select="$method-name"/> ");
                             <xsl:if test="input/param/@ours">
-                                adb_<xsl:value-of select="input/param/@type"/>_free(input_val<xsl:value-of select="$position"/>, env);
+                                <xsl:value-of select="substring-before(input/param/@type, '_t*')"/>_free(input_val<xsl:value-of select="$position"/>, env);
                             </xsl:if>
                             <xsl:if test="input/param/@location='soap_header'">
                                 axis2_skel_op_<xsl:value-of select="$servicename"/>_<xsl:value-of select="$method-name"/>_free_input_headers(env, <xsl:for-each select="input/param[@location='soap_header']"><xsl:if test="position()!=1">,</xsl:if>
@@ -577,10 +583,10 @@
                         }
                         ret_node = <xsl:choose>
                                        <xsl:when test="output/param/@ours">
-                                   adb_<xsl:value-of select="$outputtype"/>_serialize(ret_val<xsl:value-of select="$position"/>, env, NULL, NULL, AXIS2_TRUE, NULL, NULL);
-                                   adb_<xsl:value-of select="$outputtype"/>_free(ret_val<xsl:value-of select="$position"/>, env);
+                                   <xsl:value-of select="substring-before($outputtype, '_t*')"/>_serialize(ret_val<xsl:value-of select="$position"/>, env, NULL, NULL, AXIS2_TRUE, NULL, NULL);
+                                   <xsl:value-of select="substring-before($outputtype, '_t*')"/>_free(ret_val<xsl:value-of select="$position"/>, env);
                                    <xsl:if test="input/param/@type!=''">
-                                    adb_<xsl:value-of select="input/param/@type"/>_free(input_val<xsl:value-of select="$position"/>, env);
+                                    <xsl:value-of select="substring-before(input/param/@type, '_t*')"/>_free(input_val<xsl:value-of select="$position"/>, env);
                                    </xsl:if>
                                        </xsl:when>
                                        <xsl:otherwise>ret_val<xsl:value-of select="$position"/>;</xsl:otherwise>
@@ -633,7 +639,7 @@
                         <xsl:for-each select="output/param[@location='soap_header']">
                             <xsl:choose>
                             <xsl:when test="@ours">
-                            output_header = adb_<xsl:value-of select="@type"/>_serialize(_<xsl:value-of select="@name"/><xsl:value-of select="$position"/>, env, NULL, NULL, AXIS2_TRUE, NULL, NULL);
+                            output_header = <xsl:value-of select="substring-before(@type, '_t*')"/>_serialize(_<xsl:value-of select="@name"/><xsl:value-of select="$position"/>, env, NULL, NULL, AXIS2_TRUE, NULL, NULL);
                             </xsl:when>
                             <xsl:otherwise>
                             output_header = _<xsl:value-of select="@name"/>;
@@ -661,7 +667,7 @@
                             AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "NULL returnted from the business logic from <xsl:value-of select="$method-name"/> ");
                         }
                         <xsl:if test="input/param/@type!=''">
-                           adb_<xsl:value-of select="input/param/@type"/>_free(input_val<xsl:value-of select="$position"/>, env);
+                           <xsl:value-of select="substring-before(input/param/@type, '_t*')"/>_free(input_val<xsl:value-of select="$position"/>, env);
                         </xsl:if>
                         <xsl:if test="input/param/@location='soap_header'">
                         axis2_skel_op_<xsl:value-of select="$servicename"/>_<xsl:value-of select="$method-name"/>_free_input_headers(env, <xsl:for-each select="input/param[@location='soap_header']"><xsl:if test="position()!=1">,</xsl:if>

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/c/SkelHeaderTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/c/SkelHeaderTemplate.xsl?rev=695475&r1=695474&r2=695475&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/c/SkelHeaderTemplate.xsl (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/c/SkelHeaderTemplate.xsl Mon Sep 15 07:05:14 2008
@@ -44,11 +44,11 @@
 
    <xsl:for-each select="method">
     <xsl:for-each select="input/param[@type!='' and @ours]">
-     <xsl:variable name="inputtype">adb_<xsl:value-of select="@type"></xsl:value-of></xsl:variable>
+     <xsl:variable name="inputtype" select="substring-before(@type, '_t*')"/>
      #include "<xsl:value-of select="$inputtype"/>.h"
     </xsl:for-each>
     <xsl:for-each select="output/param[@type!='' and @ours]">
-     <xsl:variable name="outputtype">adb_<xsl:value-of select="@type"></xsl:value-of></xsl:variable>
+     <xsl:variable name="outputtype" select="substring-before(@type, '_t*')"/>
      #include "<xsl:value-of select="$outputtype"/>.h"
     </xsl:for-each>
    </xsl:for-each>
@@ -63,17 +63,8 @@
          <xsl:variable name="outputtype">
             <xsl:choose>
                 <xsl:when test="$isUnwrapParameters">
-                    <xsl:choose>
-                        <xsl:when test="output/param/param/@ours">
-                            <xsl:text>adb_</xsl:text><xsl:value-of select="output/param/param/@type"/>
-                        </xsl:when>
-                        <xsl:otherwise>
-                            <xsl:value-of select="output/param/param/@type"/>
-                        </xsl:otherwise>
-                    </xsl:choose>
+                    <xsl:value-of select="output/param/param/@type"/>
                 </xsl:when>
-                <xsl:when test="output/param/@ours=''">axis2_status_t</xsl:when>
-                <xsl:when test="output/param/@ours">adb_<xsl:value-of select="output/param/@type"></xsl:value-of>_t*</xsl:when>
                 <xsl:otherwise><xsl:value-of select="output/param/@type"></xsl:value-of></xsl:otherwise>
             </xsl:choose>
          </xsl:variable>
@@ -85,9 +76,9 @@
          * auto generated function declaration
          * for "<xsl:value-of select="@qname"/>" operation.
          * @param env environment ( mandatory)<xsl:if test="not($isUnwrapParameters)"><xsl:for-each select="input/param[@type!='']"><xsl:text>
-         </xsl:text>* @param _<xsl:value-of select="@name"/> of the <xsl:if test="@ours"> adb type adb_</xsl:if><xsl:value-of select="@type"/><xsl:if test="@ours">_t*</xsl:if></xsl:for-each></xsl:if>
+         </xsl:text>* @param _<xsl:value-of select="@name"/> of the <xsl:value-of select="@type"/></xsl:for-each></xsl:if>
          <xsl:if test="$isUnwrapParameters"><xsl:for-each select="input/param/param[@type!='']"><xsl:text>
-         </xsl:text>* @param _<xsl:value-of select="@name"/> of the <xsl:if test="@ours"> adb type adb_</xsl:if><xsl:value-of select="@type"/><xsl:if test="@ours">_t*</xsl:if></xsl:for-each></xsl:if>
+         </xsl:text>* @param _<xsl:value-of select="@name"/> of the <xsl:value-of select="@type"/></xsl:for-each></xsl:if>
          *<xsl:for-each select="output/param[@location='soap_header']"><xsl:text>
          </xsl:text>* @param dp_<xsl:value-of select="@name"/> - output header</xsl:for-each>
          * @return <xsl:value-of select="$outputtype"/><xsl:text>
@@ -98,14 +89,12 @@
             <xsl:choose>
             <xsl:when test="$isUnwrapParameters">
                                           <xsl:for-each select="input/param/param[@type!='']">,
-                                              <xsl:variable name="inputtype"><xsl:if test="@ours">adb_</xsl:if><xsl:value-of select="@type"/><xsl:if test="@ours">_t*</xsl:if></xsl:variable>
-                                              <xsl:value-of select="$inputtype"/><xsl:text> _</xsl:text><xsl:value-of select="@name"/>
+                                              <xsl:value-of select="@type"/><xsl:text> _</xsl:text><xsl:value-of select="@name"/>
                                           </xsl:for-each>
             </xsl:when>
             <xsl:otherwise>
                                           <xsl:for-each select="input/param[@type!='']">,
-                                              <xsl:variable name="inputtype"><xsl:if test="@ours">adb_</xsl:if><xsl:value-of select="@type"/><xsl:if test="@ours">_t*</xsl:if></xsl:variable>
-                                              <xsl:value-of select="$inputtype"/><xsl:text> _</xsl:text><xsl:value-of select="@name"/>
+                                              <xsl:value-of select="@type"/><xsl:text> _</xsl:text><xsl:value-of select="@name"/>
                                           </xsl:for-each>
             </xsl:otherwise>
             </xsl:choose>
@@ -118,7 +107,7 @@
         <xsl:text> </xsl:text>
         <xsl:value-of select="$method-prefix"/>_<xsl:value-of select="@name"/><xsl:text>(const axutil_env_t *env</xsl:text>
                                           <xsl:value-of select="$inputparams"/><xsl:for-each select="output/param[@location='soap_header']">,
-                                            <xsl:variable name="outputtype"><xsl:if test="@ours">adb_</xsl:if><xsl:value-of select="@type"/><xsl:if test="@ours">_t**</xsl:if></xsl:variable>
+                                            <xsl:variable name="outputtype"><xsl:value-of select="@type"/><xsl:if test="@ours">*</xsl:if></xsl:variable>
                                             <xsl:value-of select="$outputtype"/><xsl:text> dp_</xsl:text><xsl:value-of select="@name"/><xsl:text> /* output header double ptr*/</xsl:text>
                                           </xsl:for-each> );
      </xsl:for-each>

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/c/SkelSourceTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/c/SkelSourceTemplate.xsl?rev=695475&r1=695474&r2=695475&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/c/SkelSourceTemplate.xsl (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/c/SkelSourceTemplate.xsl Mon Sep 15 07:05:14 2008
@@ -42,17 +42,8 @@
          <xsl:variable name="outputtype">
             <xsl:choose>
                 <xsl:when test="$isUnwrapParameters">
-                    <xsl:choose>
-                        <xsl:when test="output/param/param/@ours">
-                            <xsl:text>adb_</xsl:text><xsl:value-of select="output/param/param/@type"/>
-                        </xsl:when>
-                        <xsl:otherwise>
-                            <xsl:value-of select="output/param/param/@type"/>
-                        </xsl:otherwise>
-                    </xsl:choose>
+                    <xsl:value-of select="output/param/param/@type"/>
                 </xsl:when>
-                <xsl:when test="output/param/@ours=''">axis2_status_t</xsl:when>
-                <xsl:when test="output/param/@ours">adb_<xsl:value-of select="output/param/@type"></xsl:value-of>_t*</xsl:when>
                 <xsl:otherwise><xsl:value-of select="output/param/@type"></xsl:value-of></xsl:otherwise>
             </xsl:choose>
          </xsl:variable>
@@ -63,9 +54,9 @@
          * auto generated function definition signature
          * for "<xsl:value-of select="@qname"/>" operation.
          * @param env environment ( mandatory)<xsl:if test="not($isUnwrapParameters)"><xsl:for-each select="input/param[@type!='']"><xsl:text>
-         </xsl:text>* @param _<xsl:value-of select="@name"/> of the <xsl:if test="@ours"> adb type adb_</xsl:if><xsl:value-of select="@type"/><xsl:if test="@ours">_t*</xsl:if></xsl:for-each></xsl:if>
+         </xsl:text>* @param _<xsl:value-of select="@name"/> of the <xsl:value-of select="@type"/></xsl:for-each></xsl:if>
          <xsl:if test="$isUnwrapParameters"><xsl:for-each select="input/param/param[@type!='']"><xsl:text>
-         </xsl:text>* @param _<xsl:value-of select="@name"/> of the <xsl:if test="@ours"> adb type adb_</xsl:if><xsl:value-of select="@type"/><xsl:if test="@ours">_t*</xsl:if></xsl:for-each></xsl:if>
+         </xsl:text>* @param _<xsl:value-of select="@name"/> of the <xsl:value-of select="@type"/></xsl:for-each></xsl:if>
          *<xsl:for-each select="output/param[@location='soap_header']"><xsl:text>
          </xsl:text>* @param dp_<xsl:value-of select="@name"/> - output header</xsl:for-each>
          * @return <xsl:value-of select="$outputtype"/><xsl:text>
@@ -76,14 +67,12 @@
             <xsl:choose>
             <xsl:when test="$isUnwrapParameters">
                                           <xsl:for-each select="input/param/param[@type!='']">,
-                                              <xsl:variable name="inputtype"><xsl:if test="@ours">adb_</xsl:if><xsl:value-of select="@type"/><xsl:if test="@ours">_t*</xsl:if></xsl:variable>
-                                              <xsl:value-of select="$inputtype"/><xsl:text> _</xsl:text><xsl:value-of select="@name"/>
+                                              <xsl:value-of select="@type"/><xsl:text> _</xsl:text><xsl:value-of select="@name"/>
                                           </xsl:for-each>
             </xsl:when>
             <xsl:otherwise>
                                           <xsl:for-each select="input/param[@type!='']">,
-                                              <xsl:variable name="inputtype"><xsl:if test="@ours">adb_</xsl:if><xsl:value-of select="@type"/><xsl:if test="@ours">_t*</xsl:if></xsl:variable>
-                                              <xsl:value-of select="$inputtype"/><xsl:text> _</xsl:text><xsl:value-of select="@name"/>
+                                              <xsl:value-of select="@type"/><xsl:text> _</xsl:text><xsl:value-of select="@name"/>
                                           </xsl:for-each>
             </xsl:otherwise>
             </xsl:choose>
@@ -96,7 +85,7 @@
         <xsl:text> </xsl:text>
         <xsl:value-of select="$method-prefix"/>_<xsl:value-of select="@name"/><xsl:text>(const axutil_env_t *env</xsl:text>
                                           <xsl:value-of select="$inputparams"/><xsl:for-each select="output/param[@location='soap_header']">,
-                                            <xsl:variable name="outputtype"><xsl:if test="@ours">adb_</xsl:if><xsl:value-of select="@type"/><xsl:if test="@ours">_t**</xsl:if></xsl:variable>
+                                            <xsl:variable name="outputtype"><xsl:value-of select="@type"/><xsl:if test="@ours">*</xsl:if></xsl:variable>
                                             <xsl:value-of select="$outputtype"/><xsl:text> dp_</xsl:text><xsl:value-of select="@name"/><xsl:text> /* output header double ptr*/</xsl:text>
                                           </xsl:for-each> )
         {

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/c/StubHeaderTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/c/StubHeaderTemplate.xsl?rev=695475&r1=695474&r2=695475&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/c/StubHeaderTemplate.xsl (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/c/StubHeaderTemplate.xsl Mon Sep 15 07:05:14 2008
@@ -47,11 +47,11 @@
 
        <xsl:for-each select="method">
         <xsl:for-each select="input/param[@type!='' and @ours ]">
-         <xsl:variable name="inputtype">adb_<xsl:value-of select="@type"></xsl:value-of></xsl:variable>
+         <xsl:variable name="inputtype" select="substring-before(@type, '_t*')"/>
          #include "<xsl:value-of select="$inputtype"/>.h"
         </xsl:for-each>
         <xsl:for-each select="output/param[@type!='' and @ours ]">
-         <xsl:variable name="outputtype">adb_<xsl:value-of select="@type"></xsl:value-of></xsl:variable>
+         <xsl:variable name="outputtype" select="substring-before(@type, '_t*')"/>
          #include "<xsl:value-of select="$outputtype"/>.h"
         </xsl:for-each>
        </xsl:for-each>
@@ -97,17 +97,8 @@
             <xsl:variable name="outputtype">
                 <xsl:choose>
                     <xsl:when test="$isUnwrapParameters">
-                        <xsl:choose>
-                            <xsl:when test="output/param/param/@ours">
-                                <xsl:text>adb_</xsl:text><xsl:value-of select="output/param/param/@type"/>
-                            </xsl:when>
-                            <xsl:otherwise>
-                                <xsl:value-of select="output/param/param/@type"/>
-                            </xsl:otherwise>
-                        </xsl:choose>
+                        <xsl:value-of select="output/param/param/@type"/>
                     </xsl:when>
-                    <xsl:when test="output/param/@ours=''">axis2_status_t</xsl:when>
-                    <xsl:when test="output/param/@ours">adb_<xsl:value-of select="output/param/@type"></xsl:value-of>_t*</xsl:when>
                     <xsl:otherwise><xsl:value-of select="output/param/@type"></xsl:value-of></xsl:otherwise>
                 </xsl:choose>
             </xsl:variable>
@@ -116,9 +107,9 @@
              * for "<xsl:value-of select="@qname"/>" operation.
              * @param stub The stub (axis2_stub_t)
              * @param env environment ( mandatory)<xsl:if test="not($isUnwrapParameters)"><xsl:for-each select="input/param[@type!='']"><xsl:text>
-             </xsl:text>* @param _<xsl:value-of select="@name"/> of the <xsl:if test="@ours"> adb type adb_</xsl:if><xsl:value-of select="@type"/><xsl:if test="@ours">_t*</xsl:if></xsl:for-each></xsl:if>
+             </xsl:text>* @param _<xsl:value-of select="@name"/> of the <xsl:value-of select="@type"/></xsl:for-each></xsl:if>
              <xsl:if test="$isUnwrapParameters"><xsl:for-each select="input/param/param[@type!='']"><xsl:text>
-             </xsl:text>* @param _<xsl:value-of select="@name"/> of the <xsl:if test="@ours"> adb type adb_</xsl:if><xsl:value-of select="@type"/><xsl:if test="@ours">_t*</xsl:if></xsl:for-each></xsl:if>
+             </xsl:text>* @param _<xsl:value-of select="@name"/> of the <xsl:value-of select="@type"/></xsl:for-each></xsl:if>
              *<xsl:for-each select="output/param[@location='soap_header']"><xsl:text>
              </xsl:text>* @param dp_<xsl:value-of select="@name"/> - output header</xsl:for-each>
              * @return <xsl:value-of select="$outputtype"/>
@@ -128,14 +119,12 @@
                 <xsl:choose>
                 <xsl:when test="$isUnwrapParameters">
                                               <xsl:for-each select="input/param/param[@type!='']">,
-                                                  <xsl:variable name="inputtype"><xsl:if test="@ours">adb_</xsl:if><xsl:value-of select="@type"/><xsl:if test="@ours">_t*</xsl:if></xsl:variable>
-                                                  <xsl:value-of select="$inputtype"/><xsl:text> _</xsl:text><xsl:value-of select="@name"/>
+                                                  <xsl:value-of select="@type"/><xsl:text> _</xsl:text><xsl:value-of select="@name"/>
                                               </xsl:for-each>
                 </xsl:when>
                 <xsl:otherwise>
                                               <xsl:for-each select="input/param[@type!='']">,
-                                                  <xsl:variable name="inputtype"><xsl:if test="@ours">adb_</xsl:if><xsl:value-of select="@type"/><xsl:if test="@ours">_t*</xsl:if></xsl:variable>
-                                                  <xsl:value-of select="$inputtype"/><xsl:text> _</xsl:text><xsl:value-of select="@name"/>
+                                                  <xsl:value-of select="@type"/><xsl:text> _</xsl:text><xsl:value-of select="@name"/>
                                               </xsl:for-each>
                 </xsl:otherwise>
                 </xsl:choose>
@@ -148,7 +137,7 @@
             <xsl:text> </xsl:text>
             axis2_stub_op_<xsl:value-of select="$servicename"/>_<xsl:value-of select="@name"/><xsl:text>( axis2_stub_t *stub, const axutil_env_t *env</xsl:text>
                                                     <xsl:value-of select="$inputparams"/><xsl:for-each select="output/param[@location='soap_header']">,
-                                                        <xsl:variable name="outputtype"><xsl:if test="@ours">adb_</xsl:if><xsl:value-of select="@type"/><xsl:if test="@ours">_t**</xsl:if></xsl:variable>
+                                                        <xsl:variable name="outputtype"><xsl:value-of select="@type"/><xsl:if test="@ours">*</xsl:if></xsl:variable>
                                                         <xsl:value-of select="$outputtype"/><xsl:text> dp_</xsl:text><xsl:value-of select="@name"/><xsl:text> /* output header double ptr*/</xsl:text>
                                                     </xsl:for-each>);
           </xsl:if>
@@ -164,17 +153,8 @@
         <xsl:variable name="outputtype">
             <xsl:choose>
                 <xsl:when test="$isUnwrapParameters">
-                    <xsl:choose>
-                        <xsl:when test="output/param/param/@ours">
-                            <xsl:text>adb_</xsl:text><xsl:value-of select="output/param/param/@type"/>
-                        </xsl:when>
-                        <xsl:otherwise>
                             <xsl:value-of select="output/param/param/@type"/>
-                        </xsl:otherwise>
-                    </xsl:choose>
                 </xsl:when>
-                <xsl:when test="output/param/@ours=''">axis2_status_t</xsl:when>
-                <xsl:when test="output/param/@ours">adb_<xsl:value-of select="output/param/@type"></xsl:value-of>_t*</xsl:when>
                 <xsl:otherwise><xsl:value-of select="output/param/@type"></xsl:value-of></xsl:otherwise>
             </xsl:choose>
         </xsl:variable>
@@ -185,14 +165,12 @@
             <xsl:choose>
             <xsl:when test="$isUnwrapParameters">
                                               <xsl:for-each select="input/param/param[@type!='']">,
-                                                  <xsl:variable name="inputtype"><xsl:if test="@ours">adb_</xsl:if><xsl:value-of select="@type"/><xsl:if test="@ours">_t*</xsl:if></xsl:variable>
-                                                  <xsl:value-of select="$inputtype"/><xsl:text> _</xsl:text><xsl:value-of select="@name"/>
+                                                  <xsl:value-of select="@type"/><xsl:text> _</xsl:text><xsl:value-of select="@name"/>
                                               </xsl:for-each>
             </xsl:when>
             <xsl:otherwise>
                                               <xsl:for-each select="input/param[@type!='']">,
-                                                  <xsl:variable name="inputtype"><xsl:if test="@ours">adb_</xsl:if><xsl:value-of select="@type"/><xsl:if test="@ours">_t*</xsl:if></xsl:variable>
-                                                  <xsl:value-of select="$inputtype"/><xsl:text> _</xsl:text><xsl:value-of select="@name"/>
+                                                  <xsl:value-of select="@type"/><xsl:text> _</xsl:text><xsl:value-of select="@name"/>
                                               </xsl:for-each>
             </xsl:otherwise>
             </xsl:choose>
@@ -205,9 +183,9 @@
          * @param env environment ( mandatory)</xsl:text>
          <!--  select only the body parameters  -->
          <xsl:if test="not($isUnwrapParameters)"><xsl:for-each select="input/param[@type!='']"><xsl:text>
-         * @param _</xsl:text><xsl:value-of select="@name"/> of the <xsl:if test="@ours"> adb type adb_</xsl:if><xsl:value-of select="@type"/><xsl:if test="@ours">_t*</xsl:if></xsl:for-each></xsl:if>
+         * @param _</xsl:text><xsl:value-of select="@name"/> of the <xsl:value-of select="@type"/></xsl:for-each></xsl:if>
          <xsl:if test="$isUnwrapParameters"><xsl:for-each select="input/param/param[@type!='']"><xsl:text>
-         * @param _</xsl:text><xsl:value-of select="@name"/> of the <xsl:if test="@ours"> adb type adb_</xsl:if><xsl:value-of select="@type"/><xsl:if test="@ours">_t*</xsl:if></xsl:for-each></xsl:if>
+         * @param _</xsl:text><xsl:value-of select="@name"/> of the <xsl:value-of select="@type"/></xsl:for-each></xsl:if>
          * @param user_data user data to be accessed by the callbacks
          * @param on_complete callback to handle on complete
          * @param on_error callback to handle on error
@@ -217,7 +195,7 @@
         void axis2_stub_start_op_<xsl:value-of select="$servicename"/>_<xsl:value-of select="@name"/>( axis2_stub_t *stub, const axutil_env_t *env<xsl:value-of select="$inputparams"/>,
                                                   void *user_data,
                                                   axis2_status_t ( AXIS2_CALL *on_complete ) (const axutil_env_t *, <xsl:value-of select="$outputtype"/><xsl:text> _</xsl:text><xsl:value-of select="output/param/@name"/><xsl:for-each select="output/param[@location='soap_header']">,
-                                                      <xsl:variable name="header_outputtype"><xsl:if test="@ours">adb_</xsl:if><xsl:value-of select="@type"/><xsl:if test="@ours">_t*</xsl:if></xsl:variable>
+                                                      <xsl:variable name="header_outputtype"><xsl:value-of select="@type"/></xsl:variable>
                                                       <xsl:value-of select="$header_outputtype"/><xsl:text> _</xsl:text><xsl:value-of select="@name"/>
                                                       </xsl:for-each>, void *data) ,
                                                   axis2_status_t ( AXIS2_CALL *on_error ) (const axutil_env_t *, int exception, void *data) );
@@ -236,7 +214,7 @@
         <xsl:if test="input/param[@location='soap_header']">
          void
          axis2_stub_op_<xsl:value-of select="$servicename"/>_<xsl:value-of select="@name"/>_free_input_headers(const axutil_env_t *env, <xsl:for-each select="input/param[@location='soap_header']"><xsl:if test="position()!=1">,</xsl:if>
-                                                 <xsl:variable name="inputtype"><xsl:if test="@ours">adb_</xsl:if><xsl:value-of select="@type"/><xsl:if test="@ours">_t*</xsl:if></xsl:variable>
+                                                 <xsl:variable name="inputtype"><xsl:value-of select="@type"/></xsl:variable>
                                                  <xsl:value-of select="$inputtype"/><xsl:text> _</xsl:text><xsl:value-of select="@name"/>
                                                  </xsl:for-each>);
         </xsl:if>
@@ -252,7 +230,7 @@
         <xsl:if test="output/param[@location='soap_header']">
          void
          axis2_stub_op_<xsl:value-of select="$servicename"/>_<xsl:value-of select="@name"/>_free_output_headers(const axutil_env_t *env, <xsl:for-each select="output/param[@location='soap_header']"><xsl:if test="position()!=1">,</xsl:if>
-                                                 <xsl:variable name="outputtype"><xsl:if test="@ours">adb_</xsl:if><xsl:value-of select="@type"/><xsl:if test="@ours">_t*</xsl:if></xsl:variable>
+                                                 <xsl:variable name="outputtype"><xsl:value-of select="@type"/></xsl:variable>
                                                  <xsl:value-of select="$outputtype"/><xsl:text> _</xsl:text><xsl:value-of select="@name"/>
                                                  </xsl:for-each>);
         </xsl:if>