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 am...@apache.org on 2006/11/20 10:55:03 UTC
svn commit: r477125 [2/2] - in /webservices/axis2/trunk/java/modules:
adb-codegen/src/org/apache/axis2/schema/
adb-codegen/src/org/apache/axis2/schema/template/
codegen/src/org/apache/axis2/wsdl/codegen/emitter/
codegen/src/org/apache/axis2/wsdl/codege...
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/MessageReceiverTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/MessageReceiverTemplate.xsl?view=diff&rev=477125&r1=477124&r2=477125
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/MessageReceiverTemplate.xsl (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/MessageReceiverTemplate.xsl Mon Nov 20 01:54:58 2006
@@ -14,8 +14,7 @@
<xsl:template match="/interface[@basereceiver='org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver']">
<xsl:variable name="skeletonname"><xsl:value-of select="@skeletonInterfaceName"/></xsl:variable>
- <xsl:variable name="dbsupportpackage"><xsl:value-of select="@dbsupportpackage"/></xsl:variable>
-
+ <xsl:variable name="isbackcompatible" select="@isbackcompatible"/>
/**
* <xsl:value-of select="@name"/>.java
*
@@ -70,6 +69,7 @@
<xsl:variable name="returntype" select="output/param/@type"/>
<xsl:variable name="returnvariable" select="output/param/@name"/>
+ <xsl:variable name="returncomplextype"><xsl:value-of select="output/param/@complextype"/></xsl:variable>
<xsl:if test="string-length(normalize-space($returntype)) > 0">
<xsl:value-of select="$returntype"/>
@@ -83,48 +83,96 @@
//doc style
<xsl:variable name="inputcount" select="count(input/param[@location='body' and @type!=''])"/>
<xsl:variable name="inputtype" select="input/param[@location='body' and @type!='']/@type"/>
+ <xsl:variable name="inputComplexType" select="input/param[@location='body' and @type!='']/@complextype"/>
+ <xsl:variable name="operationName" select="input/param[@location='body' and @type!='']/@opname"/>
<xsl:choose>
- <xsl:when test="$inputcount=1">
- <xsl:value-of select="$inputtype"/> wrappedParam =
- (<xsl:value-of select="$inputtype"/>)fromOM(
- msgContext.getEnvelope().getBody().getFirstElement(),
- <xsl:value-of select="$inputtype"/>.class,
- getEnvelopeNamespaces(msgContext.getEnvelope()));
- <!-- Even when the parameters are 1 we have to see whether we have the
- wrapped parameters -->
- <xsl:variable name="inputWrappedCount" select="count(input/param[@location='body' and @type!='']/param)"/>
+ <xsl:when test="$isbackcompatible = 'true'">
<xsl:choose>
- <xsl:when test="$inputWrappedCount > 0">
- <!-- generate the references. the getters need to be
- generated by the databinding-->
- <!--<xsl:for-each select="input/param[@location='body' and @type!='']/param">-->
- <!--<xsl:value-of select="@type"/> param<xsl:value-of select="position()"/>-->
- <!--= get<xsl:value-of select="@partname"/>(wrappedParam);-->
- <!--</xsl:for-each>-->
-
- <xsl:if test="string-length(normalize-space($returntype)) > 0"><xsl:value-of select="$returnvariable"/> =</xsl:if>
- skel.<xsl:value-of select="@name"/>(
- <xsl:for-each select="input/param[@location='body' and @type!='']/param">
- <xsl:if test="position() > 1">,</xsl:if>
- get<xsl:value-of select="@partname"/>(wrappedParam)
- </xsl:for-each>
-
- );
-
+ <xsl:when test="$inputcount=1">
+ <xsl:value-of select="$inputtype"/> wrappedParam =
+ (<xsl:value-of select="$inputtype"/>)fromOM(
+ msgContext.getEnvelope().getBody().getFirstElement(),
+ <xsl:value-of select="$inputtype"/>.class,
+ getEnvelopeNamespaces(msgContext.getEnvelope()));
+
+ <xsl:if test="string-length(normalize-space($returntype)) > 0"><xsl:value-of select="$returnvariable"/> =</xsl:if>
+ <xsl:choose>
+ <xsl:when test="(string-length(normalize-space($inputComplexType)) > 0) and (string-length(normalize-space($returncomplextype)) > 0)">
+ wrap<xsl:value-of select="$operationName"/>(skel.<xsl:value-of select="@name"/>(
+ get<xsl:value-of select="$operationName"/>(wrappedParam)));
+ </xsl:when>
+ <xsl:when test="(string-length(normalize-space($inputComplexType)) > 0) and (string-length(normalize-space($returncomplextype)) < 1)">
+ skel.<xsl:value-of select="@name"/>(
+ get<xsl:value-of select="$operationName"/>(wrappedParam));
+ </xsl:when>
+ <xsl:when test="(string-length(normalize-space($inputComplexType)) < 1) and (string-length(normalize-space($returncomplextype)) > 0)">
+ wrap<xsl:value-of select="$operationName"/>(skel.<xsl:value-of select="@name"/>(wrappedParam));
+ </xsl:when>
+ <xsl:otherwise>
+ skel.<xsl:value-of select="@name"/>(wrappedParam);
+ </xsl:otherwise>
+ </xsl:choose>
+
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:if test="string-length(normalize-space($returntype)) > 0"><xsl:value-of select="$returnvariable"/> =</xsl:if>
+ <xsl:choose>
+ <xsl:when test="string-length(normalize-space($returncomplextype)) > 0">
+ wrap<xsl:value-of select="$operationName"/>(skel.<xsl:value-of select="@name"/>());
+ </xsl:when>
+ <xsl:otherwise>
+ skel.<xsl:value-of select="@name"/>();
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="$inputcount=1">
+ <xsl:value-of select="$inputtype"/> wrappedParam =
+ (<xsl:value-of select="$inputtype"/>)fromOM(
+ msgContext.getEnvelope().getBody().getFirstElement(),
+ <xsl:value-of select="$inputtype"/>.class,
+ getEnvelopeNamespaces(msgContext.getEnvelope()));
+ <!-- Even when the parameters are 1 we have to see whether we have the
+ wrapped parameters -->
+ <xsl:variable name="inputWrappedCount" select="count(input/param[@location='body' and @type!='']/param)"/>
+ <xsl:choose>
+ <xsl:when test="$inputWrappedCount > 0">
+ <!-- generate the references. the getters need to be
+ generated by the databinding-->
+ <!--<xsl:for-each select="input/param[@location='body' and @type!='']/param">-->
+ <!--<xsl:value-of select="@type"/> param<xsl:value-of select="position()"/>-->
+ <!--= get<xsl:value-of select="@partname"/>(wrappedParam);-->
+ <!--</xsl:for-each>-->
+
+ <xsl:if test="string-length(normalize-space($returntype)) > 0"><xsl:value-of select="$returnvariable"/> =</xsl:if>
+ skel.<xsl:value-of select="@name"/>(
+ <xsl:for-each select="input/param[@location='body' and @type!='']/param">
+ <xsl:if test="position() > 1">,</xsl:if>
+ get<xsl:value-of select="@partname"/>(wrappedParam)
+ </xsl:for-each>
+
+ );
+
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:if test="string-length(normalize-space($returntype)) > 0"><xsl:value-of select="$returnvariable"/> =</xsl:if>
+ skel.<xsl:value-of select="@name"/>(wrappedParam) ;
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:when>
<xsl:otherwise>
- <xsl:if test="string-length(normalize-space($returntype)) > 0"><xsl:value-of select="$returnvariable"/> =</xsl:if>
- skel.<xsl:value-of select="@name"/>(wrappedParam) ;
+ <xsl:if test="string-length(normalize-space($returntype)) > 0"><xsl:value-of select="$returnvariable"/> =</xsl:if>
+ skel.<xsl:value-of select="@name"/>();
</xsl:otherwise>
</xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="string-length(normalize-space($returntype)) > 0"><xsl:value-of select="$returnvariable"/> =</xsl:if>
- skel.<xsl:value-of select="@name"/>();
</xsl:otherwise>
</xsl:choose>
+
<xsl:choose>
<xsl:when test="string-length(normalize-space($returntype)) > 0">
envelope = toEnvelope(getSOAPFactory(msgContext), <xsl:value-of select="$returnvariable"/>, false);
@@ -204,7 +252,6 @@
<!-- start of in-only -->
<xsl:template match="/interface[@basereceiver='org.apache.axis2.receivers.AbstractInMessageReceiver']">
<xsl:variable name="skeletonname"><xsl:value-of select="@skeletonInterfaceName"/></xsl:variable>
- <xsl:variable name="dbsupportpackage"><xsl:value-of select="@dbsupportpackage"/></xsl:variable>
/**
* <xsl:value-of select="@name"/>.java
@@ -241,8 +288,6 @@
<xsl:for-each select="method">
- <xsl:variable name="namespace"><xsl:value-of select="@namespace"/></xsl:variable>
- <xsl:variable name="name"><xsl:value-of select="@name"/></xsl:variable>
<xsl:variable name="style"><xsl:value-of select="@style"/></xsl:variable>
if("<xsl:value-of select="@name"/>".equals(methodName)){
@@ -253,9 +298,9 @@
<xsl:when test="string-length(normalize-space($usedbmethod))=0">
<xsl:choose>
<xsl:when test="$style='rpc'">
-
+
//rpc style -- this needs to be filled
-
+
</xsl:when>
<xsl:when test="$style='document'">
//doc style
@@ -273,7 +318,7 @@
<xsl:otherwise>skel.<xsl:value-of select="@name"/>();</xsl:otherwise>
</xsl:choose>
</xsl:when>
-
+
<xsl:otherwise>
//Unknown style!! No code is generated
throw new UnsupportedOperationException("Unknown Style");
@@ -325,7 +370,7 @@
<xsl:template match="/interface[@basereceiver='org.apache.axis2.receivers.AbstractRobustInMessageReceiver']">
<xsl:variable name="skeletonname"><xsl:value-of select="@skeletonInterfaceName"/></xsl:variable>
- <xsl:variable name="dbsupportpackage"><xsl:value-of select="@dbsupportpackage"/></xsl:variable>
+ <xsl:variable name="isbackcompatible" select="@isbackcompatible"/>
/**
* <xsl:value-of select="@name"/>.java
@@ -374,9 +419,6 @@
<xsl:choose>
<xsl:when test="string-length(normalize-space($usedbmethod))=0">
- <xsl:variable name="namespace"><xsl:value-of select="@namespace"/></xsl:variable>
-
- <xsl:variable name="name"><xsl:value-of select="@name"/></xsl:variable>
<xsl:variable name="style"><xsl:value-of select="@style"/></xsl:variable>
<xsl:choose>
@@ -385,38 +427,71 @@
//doc style
<xsl:variable name="inputcount" select="count(input/param[@location='body' and @type!=''])"/>
<xsl:variable name="inputtype" select="input/param[@location='body' and @type!='']/@type"/>
+ <xsl:variable name="operationName" select="input/param[@location='body' and @type!='']/@opname"/>
<xsl:choose>
- <xsl:when test="$inputcount=1">
- <xsl:value-of select="$inputtype"/> wrappedParam =
- (<xsl:value-of select="$inputtype"/>)fromOM(
- msgContext.getEnvelope().getBody().getFirstElement(),
- <xsl:value-of select="$inputtype"/>.class,
- getEnvelopeNamespaces(msgContext.getEnvelope()));
- <!-- Even when the parameters are 1 we have to see whether we have the
- wrapped parameters -->
- <xsl:variable name="inputWrappedCount" select="count(input/param[@location='body' and @type!='']/param)"/>
- <xsl:choose>
- <xsl:when test="$inputWrappedCount > 0">
- skel.<xsl:value-of select="@name"/>(
- <xsl:for-each select="input/param[@location='body' and @type!='']/param">
- <xsl:if test="position() > 1">,</xsl:if>
- get<xsl:value-of select="@partname"/>(wrappedParam)
- </xsl:for-each>
-
- );
-
+ <xsl:when test="$isbackcompatible = 'true'">
+ <xsl:choose>
+ <xsl:when test="$inputcount=1">
+ <xsl:value-of select="$inputtype"/> wrappedParam =
+ (<xsl:value-of select="$inputtype"/>)fromOM(
+ msgContext.getEnvelope().getBody().getFirstElement(),
+ <xsl:value-of select="$inputtype"/>.class,
+ getEnvelopeNamespaces(msgContext.getEnvelope()));
+ <!-- Even when the parameters are 1 we have to see whether we have the
+ wrapped parameters -->
+ <xsl:variable name="inputComplexType" select="count(input/param[@location='body' and @type!='']/param)"/>
+ <xsl:variable name="operationName" select="input/param[@location='body' and @type!='']/@opname"/>
+ <xsl:choose>
+ <xsl:when test="string-length(normalize-space($inputComplexType)) > 0">
+ skel.<xsl:value-of select="@name"/>(
+ get<xsl:value-of select="$operationName"/>(wrappedParam)
+ );
+ </xsl:when>
+ <xsl:otherwise>
+ skel.<xsl:value-of select="@name"/>(wrappedParam) ;
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:when>
<xsl:otherwise>
- skel.<xsl:value-of select="@name"/>(wrappedParam) ;
+ skel.<xsl:value-of select="@name"/>();
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
- skel.<xsl:value-of select="@name"/>();
+ <xsl:choose>
+ <xsl:when test="$inputcount=1">
+ <xsl:value-of select="$inputtype"/> wrappedParam =
+ (<xsl:value-of select="$inputtype"/>)fromOM(
+ msgContext.getEnvelope().getBody().getFirstElement(),
+ <xsl:value-of select="$inputtype"/>.class,
+ getEnvelopeNamespaces(msgContext.getEnvelope()));
+ <!-- Even when the parameters are 1 we have to see whether we have the
+ wrapped parameters -->
+ <xsl:variable name="inputWrappedCount" select="count(input/param[@location='body' and @type!='']/param)"/>
+ <xsl:choose>
+ <xsl:when test="$inputWrappedCount > 0">
+ skel.<xsl:value-of select="@name"/>(
+ <xsl:for-each select="input/param[@location='body' and @type!='']/param">
+ <xsl:if test="position() > 1">,</xsl:if>
+ get<xsl:value-of select="@partname"/>(wrappedParam)
+ </xsl:for-each>
+
+ );
+ </xsl:when>
+ <xsl:otherwise>
+ skel.<xsl:value-of select="@name"/>(wrappedParam) ;
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ skel.<xsl:value-of select="@name"/>();
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:otherwise>
</xsl:choose>
- envelope = getSOAPFactory(msgContext).getDefaultEnvelope();
+
+ envelope = getSOAPFactory(msgContext).getDefaultEnvelope();
</xsl:when>
<xsl:otherwise>
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/SkeletonInterfaceTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/SkeletonInterfaceTemplate.xsl?view=diff&rev=477125&r1=477124&r2=477125
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/SkeletonInterfaceTemplate.xsl (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/SkeletonInterfaceTemplate.xsl Mon Nov 20 01:54:58 2006
@@ -12,17 +12,46 @@
* <xsl:value-of select="@name"/> java skeleton interface for the axisService
*/
public interface <xsl:value-of select="@name"></xsl:value-of> {
+ <xsl:variable name="isbackcompatible" select="@isbackcompatible"/>
<xsl:for-each select="method">
<xsl:variable name="count"><xsl:value-of select="count(output/param)"/></xsl:variable>
<xsl:variable name="outputtype"><xsl:value-of select="output/param/@type"/></xsl:variable>
+ <xsl:variable name="outputcomplextype"><xsl:value-of select="output/param/@complextype"/></xsl:variable>
<!-- regardless of the sync or async status, the generated method signature would be just a usual
java method -->
/**
* Auto generated method signature
*/
- public <xsl:if test="$count=0 or $outputtype=''">void</xsl:if><xsl:if test="$outputtype!=''"><xsl:value-of select="$outputtype"/></xsl:if><xsl:text> </xsl:text><xsl:value-of select="@name"/>
- (
- <xsl:variable name="inputcount" select="count(input/param[@location='body' and @type!=''])"/>
+
+ <xsl:choose>
+ <xsl:when test="$isbackcompatible = 'true'">
+ public <xsl:choose><xsl:when test="$count=0 or $outputtype=''">void</xsl:when>
+ <xsl:when test="string-length(normalize-space($outputcomplextype)) > 0"><xsl:value-of select="$outputcomplextype"/></xsl:when>
+ <xsl:when test="$outputtype!=''"><xsl:value-of select="$outputtype"/></xsl:when>
+ </xsl:choose><xsl:text> </xsl:text><xsl:value-of select="@name"/>
+ (
+ <xsl:variable name="inputcount" select="count(input/param[@location='body' and @type!=''])"/>
+ <xsl:choose>
+ <xsl:when test="$inputcount=1">
+ <!-- should provide the inter complex type to method signature if is available -->
+ <xsl:variable name="inputComplexType" select="input/param[@location='body' and @type!='']/@complextype"/>
+ <xsl:choose>
+ <xsl:when test="string-length(normalize-space($inputComplexType)) > 0">
+ <xsl:value-of select="$inputComplexType"/><xsl:text> </xsl:text><xsl:value-of select="input/param[@location='body' and @type!='']/@name"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="input/param[@location='body' and @type!='']/@type"/><xsl:text> </xsl:text><xsl:value-of select="input/param[@location='body' and @type!='']/@name"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise><!-- Just leave it - nothing we can do here --></xsl:otherwise>
+ </xsl:choose>
+ )
+ </xsl:when>
+ <xsl:otherwise>
+ public <xsl:if test="$count=0 or $outputtype=''">void</xsl:if><xsl:if test="$outputtype!=''"><xsl:value-of select="$outputtype"/></xsl:if><xsl:text> </xsl:text><xsl:value-of select="@name"/>
+ (
+ <xsl:variable name="inputcount" select="count(input/param[@location='body' and @type!=''])"/>
<xsl:choose>
<xsl:when test="$inputcount=1">
<!-- Even when the parameters are 1 we have to see whether we have the
@@ -40,15 +69,16 @@
</xsl:choose>
</xsl:when>
<xsl:otherwise><!-- Just leave it - nothing we can do here --></xsl:otherwise>
- </xsl:choose>
- )
+ </xsl:choose>
+ )
+ </xsl:otherwise>
+ </xsl:choose>
<!--add the faults-->
<xsl:for-each select="fault/param[@type!='']">
<xsl:if test="position()=1">throws </xsl:if>
<xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@name"/>
</xsl:for-each>;
- </xsl:for-each>
-
+ </xsl:for-each>
}
</xsl:template>
</xsl:stylesheet>
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/SkeletonTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/SkeletonTemplate.xsl?view=diff&rev=477125&r1=477124&r2=477125
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/SkeletonTemplate.xsl (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/SkeletonTemplate.xsl Mon Nov 20 01:54:58 2006
@@ -13,9 +13,11 @@
*/
public class <xsl:value-of select="@name"></xsl:value-of>
<xsl:if test="@skeletonInterfaceName"> implements <xsl:value-of select="@skeletonInterfaceName"/></xsl:if>{
+ <xsl:variable name="isbackcompatible" select="@isbackcompatible"/>
<xsl:for-each select="method">
<xsl:variable name="count"><xsl:value-of select="count(output/param)"/></xsl:variable>
<xsl:variable name="outputtype" select="output/param/@type"/>
+ <xsl:variable name="outputcomplextype"><xsl:value-of select="output/param/@complextype"/></xsl:variable>
<!-- regardless of the sync or async status, the generated method signature would be just a usual
java method -->
/**
@@ -25,28 +27,57 @@
<xsl:if test="@type!=''">* @param <xsl:value-of select="@name"></xsl:value-of><xsl:text>
</xsl:text></xsl:if></xsl:for-each>
*/
- public <xsl:if test="$count=0 or $outputtype=''">void</xsl:if><xsl:if test="$outputtype!=''"><xsl:value-of select="$outputtype"/></xsl:if><xsl:text> </xsl:text><xsl:value-of select="@name"/>
+ <xsl:choose>
+ <xsl:when test="$isbackcompatible = 'true'">
+ public <xsl:choose><xsl:when test="$count=0 or $outputtype=''">void</xsl:when>
+ <xsl:when test="string-length(normalize-space($outputcomplextype)) > 0"><xsl:value-of select="$outputcomplextype"/></xsl:when>
+ <xsl:when test="$outputtype!=''"><xsl:value-of select="$outputtype"/></xsl:when>
+ </xsl:choose><xsl:text> </xsl:text><xsl:value-of select="@name"/>
(
- <xsl:variable name="inputcount" select="count(input/param[@location='body' and @type!=''])"/>
- <xsl:choose>
- <xsl:when test="$inputcount=1">
- <!-- Even when the parameters are 1 we have to see whether we have the
- wrapped parameters -->
- <xsl:variable name="inputWrappedCount" select="count(input/param[@location='body' and @type!='']/param)"/>
- <xsl:choose>
- <xsl:when test="$inputWrappedCount > 0">
- <xsl:for-each select="input/param[@location='body' and @type!='']/param">
- <xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@type"/><xsl:text> </xsl:text><xsl:value-of select="@name"/>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="input/param[@location='body' and @type!='']/@type"/><xsl:text> </xsl:text><xsl:value-of select="input/param[@location='body' and @type!='']/@name"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise><!-- Just leave it - nothing we can do here --></xsl:otherwise>
- </xsl:choose>
- )
+ <xsl:variable name="inputcount" select="count(input/param[@location='body' and @type!=''])"/>
+ <xsl:choose>
+ <xsl:when test="$inputcount=1">
+ <!-- Even when the parameters are 1 we have to see whether we have the
+ wrapped parameters -->
+ <xsl:variable name="inputComplexType" select="input/param[@location='body' and @type!='']/@complextype"/>
+ <xsl:choose>
+ <xsl:when test="string-length(normalize-space($inputComplexType)) > 0">
+ <xsl:value-of select="$inputComplexType"/><xsl:text> </xsl:text><xsl:value-of select="input/param[@location='body' and @type!='']/@name"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="input/param[@location='body' and @type!='']/@type"/><xsl:text> </xsl:text><xsl:value-of select="input/param[@location='body' and @type!='']/@name"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise><!-- Just leave it - nothing we can do here --></xsl:otherwise>
+ </xsl:choose>
+ )
+ </xsl:when>
+ <xsl:otherwise>
+ public <xsl:if test="$count=0 or $outputtype=''">void</xsl:if><xsl:if test="$outputtype!=''"><xsl:value-of select="$outputtype"/></xsl:if><xsl:text> </xsl:text><xsl:value-of select="@name"/>
+ (
+ <xsl:variable name="inputcount" select="count(input/param[@location='body' and @type!=''])"/>
+ <xsl:choose>
+ <xsl:when test="$inputcount=1">
+ <!-- Even when the parameters are 1 we have to see whether we have the
+ wrapped parameters -->
+ <xsl:variable name="inputWrappedCount" select="count(input/param[@location='body' and @type!='']/param)"/>
+ <xsl:choose>
+ <xsl:when test="$inputWrappedCount > 0">
+ <xsl:for-each select="input/param[@location='body' and @type!='']/param">
+ <xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@type"/><xsl:text> </xsl:text><xsl:value-of select="@name"/>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="input/param[@location='body' and @type!='']/@type"/><xsl:text> </xsl:text><xsl:value-of select="input/param[@location='body' and @type!='']/@name"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise><!-- Just leave it - nothing we can do here --></xsl:otherwise>
+ </xsl:choose>
+ )
+ </xsl:otherwise>
+ </xsl:choose>
<!--add the faults-->
<xsl:for-each select="fault/param[@type!='']">
<xsl:if test="position()=1">throws </xsl:if>
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/TestClassTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/TestClassTemplate.xsl?view=diff&rev=477125&r1=477124&r2=477125
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/TestClassTemplate.xsl (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/TestClassTemplate.xsl Mon Nov 20 01:54:58 2006
@@ -10,6 +10,7 @@
<xsl:variable name="stubname"><xsl:value-of select="@stubname"/></xsl:variable>
<xsl:variable name="isSync"><xsl:value-of select="@isSync"/></xsl:variable>
<xsl:variable name="isAsync"><xsl:value-of select="@isAsync"/></xsl:variable>
+ <xsl:variable name="isbackcompatible" select="@isbackcompatible"/>
/**
* <xsl:value-of select="@name"/>.java
@@ -52,10 +53,15 @@
<xsl:for-each select="input/param[@type!='']">
<xsl:variable name="opname" select="@opname"/>
<xsl:variable name="paramname" select="@name"/>
+ <xsl:variable name="complexType" select="@complextype"/>
+
<xsl:variable name="paramcount" select="count(param[@type!='' and @opname=$opname])"/>
<xsl:choose>
- <xsl:when test="$paramcount > 0">
+ <xsl:when test="($isbackcompatible='true') and string-length(normalize-space($complexType)) > 0">
+ <xsl:if test="@type!=''"><xsl:if test="position()>1">,</xsl:if>get<xsl:value-of select="@opname"/>(<xsl:value-of select="@name"/>)</xsl:if>
+ </xsl:when>
+ <xsl:when test="($paramcount > 0) and not($isbackcompatible='true')">
<xsl:for-each select="param[@type!='' and @opname=$opname]">
<xsl:if test="position()>1">,</xsl:if>get<xsl:value-of select="@partname"/>(<xsl:value-of select="$paramname"/>)
</xsl:for-each>
@@ -72,10 +78,14 @@
<xsl:variable name="opname" select="@opname"/>
<xsl:variable name="paramname" select="@name"/>
+ <xsl:variable name="complexType" select="@complextype"/>
<xsl:variable name="paramcount" select="count(param[@type!='' and @opname=$opname])"/>
<xsl:choose>
- <xsl:when test="$paramcount > 0">
+ <xsl:when test="($isbackcompatible='true') and string-length(normalize-space($complexType)) > 0">
+ <xsl:if test="@type!=''"><xsl:if test="position()>1">,</xsl:if>get<xsl:value-of select="@opname"/>(<xsl:value-of select="@name"/>)</xsl:if>
+ </xsl:when>
+ <xsl:when test="($paramcount > 0) and not($isbackcompatible='true')">
<xsl:for-each select="param[@type!='' and @opname=$opname]">
<xsl:if test="position()>1">,</xsl:if>get<xsl:value-of select="@partname"/>(<xsl:value-of select="$paramname"/>)
</xsl:for-each>
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/TestObjectCreationTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/TestObjectCreationTemplate.xsl?view=diff&rev=477125&r1=477124&r2=477125
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/TestObjectCreationTemplate.xsl (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/TestObjectCreationTemplate.xsl Mon Nov 20 01:54:58 2006
@@ -120,8 +120,24 @@
</xsl:otherwise>
</xsl:choose>
}
+
</xsl:if>
</xsl:for-each>
+ <!-- to support for backword compatiblity we have to add and wrapp method-->
+ <xsl:if test="generate-id($inputElement) = generate-id(key('paramsIn', $inputElementType)[1])">
+ <xsl:if test="string-length(normalize-space($inputElementComplexType)) > 0">
+ private <xsl:value-of select="$inputElementComplexType"/> get<xsl:value-of select="$opname"/>(
+ <xsl:value-of select="$inputElementType"/> wrappedType){
+ return wrappedType.get<xsl:value-of select="$inputElementShortType"/>();
+ }
+ private <xsl:value-of select="$inputElementType"/> wrap<xsl:value-of select="$opname"/>(
+ <xsl:value-of select="$inputElementComplexType"/> innerType){
+ <xsl:value-of select="$inputElementType"/> wrappedElement = new <xsl:value-of select="$inputElementType"/>();
+ wrappedElement.set<xsl:value-of select="$inputElementShortType"/>(innerType);
+ return wrappedElement;
+ }
+ </xsl:if>
+ </xsl:if>
</xsl:if>
</xsl:for-each>
Modified: webservices/axis2/trunk/java/modules/integration/maven.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/maven.xml?view=diff&rev=477125&r1=477124&r2=477125
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/maven.xml (original)
+++ webservices/axis2/trunk/java/modules/integration/maven.xml Mon Nov 20 01:54:58 2006
@@ -164,14 +164,21 @@
<ant:echo>Running codegen for eBaySvc WSDL</ant:echo>
<java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
<classpath refid="maven.dependency.classpath"/>
- <arg line="-ss -sd -g -b -o target/eBaySvc -s -uri test-resources/eBaySvc.wsdl"/>
+ <arg line="-ss -sd -g -u -ssi -t -o target/eBaySvc -uri test-resources/eBaySvc.wsdl"/>
</java>
<ant:ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="target/eBaySvc"
target="jar.server"/>
+ <ant:echo>Running codegen for eBaySvc WSDL Back word compatibiliy</ant:echo>
+ <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
+ <classpath refid="maven.dependency.classpath"/>
+ <arg line="-ss -sd -g -t -u -ssi -b -s -o target/eBaySvcB -uri test-resources/eBaySvc.wsdl"/>
+ </java>
+ <ant:ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="target/eBaySvcB"
+ target="jar.server"/>
<ant:echo>Running codegen for eBaySvc WSDL with un wrapping </ant:echo>
<java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
<classpath refid="maven.dependency.classpath"/>
- <arg line="-ss -sd -g -b -o target/eBaySvcUW -s -t -uw -uri test-resources/eBaySvc.wsdl"/>
+ <arg line="-ss -sd -ssi -u -g -t -uw -o target/eBaySvcUW -uri test-resources/eBaySvc.wsdl"/>
</java>
<ant:ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="target/eBaySvcUW"
target="jar.server"/>
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org