Author: amilas Date: Thu Dec 6 04:56:18 2007 New Revision: 601724 URL: http://svn.apache.org/viewvc?rev=601724&view=rev Log: Add response unwrapping support for empty response messages.
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/InterfaceImplementationTemplate.xsl webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceTemplate.xsl webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/MessageReceiverTemplate.xsl webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/SkeletonInterfaceTemplate.xsl webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/SkeletonTemplate.xsl Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/CallbackHandlerTemplate.xsl URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/CallbackHandlerTemplate.xsl?rev=601724&r1=601723&r2=601724&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 Thu Dec 6 04:56:18 2007 @@ -69,6 +69,7 @@ <xsl:variable name="outParamComplexType" select="output/[EMAIL PROTECTED]'body']/@complextype"></xsl:variable> <xsl:variable name="outParamCount" select="count(output/[EMAIL PROTECTED]'body']/param)"></xsl:variable> <xsl:variable name="mep"><xsl:value-of select="@mep"/></xsl:variable> + <xsl:variable name="isUnwrapParameters" select="input/[EMAIL PROTECTED]'body' and @type!='']/@unwrappParameters"/> <xsl:choose> <!-- Code generation for in-out only. Need to consider the other meps also They should be parts of this xsl:choose loop --> @@ -84,6 +85,8 @@ </xsl:when> <xsl:when test="string-length(normalize-space($outParamComplexType)) > 0"> <xsl:value-of select="$outParamComplexType"/><xsl:text> </xsl:text>result + </xsl:when> + <xsl:when test="($outParamCount=0) and ($isUnwrapParameters)"> </xsl:when> <xsl:when test="string-length(normalize-space($outParamType)) > 0"> <xsl:value-of select="$outParamType"/><xsl:text> </xsl:text>result Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl?rev=601724&r1=601723&r2=601724&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 Thu Dec 6 04:56:18 2007 @@ -220,7 +220,7 @@ <xsl:variable name="outputparamcount"><xsl:value-of select="count(output/[EMAIL PROTECTED]'body']/param)"/></xsl:variable> <xsl:variable name="outputparamshorttype"><xsl:value-of select="output/[EMAIL PROTECTED]'body']/@shorttype"/></xsl:variable> <xsl:variable name="outputparampartname"><xsl:value-of select="output/[EMAIL PROTECTED]'body']/param/@partname"/></xsl:variable> - + <xsl:variable name="isUnwrapParameters" select="input/[EMAIL PROTECTED]'body' and @type!='']/@unwrappParameters"/> <!-- MTOM --> <xsl:variable name="method-name"><xsl:value-of select="@name"/></xsl:variable> <xsl:variable name="method-ns"><xsl:value-of select="@namespace"/> </xsl:variable> @@ -271,23 +271,24 @@ </xsl:for-each>) </xsl:when> <xsl:otherwise> + public <xsl:choose> <xsl:when test="$outputtype=''">void</xsl:when> <xsl:when test="$outputparamcount=1"><xsl:value-of select="output/[EMAIL PROTECTED]'body']/param/@type"/></xsl:when> <xsl:when test="string-length(normalize-space($outputcomplextype)) > 0"><xsl:value-of select="$outputcomplextype"/></xsl:when> + <xsl:when test="($outputparamcount=0) and ($isUnwrapParameters)">void</xsl:when> <xsl:otherwise><xsl:value-of select="$outputtype"/></xsl:otherwise> </xsl:choose> <xsl:text> </xsl:text><xsl:value-of select="@name"/>( <xsl:variable name="inputcount" select="count(input/[EMAIL PROTECTED]'body' and @type!=''])"/> - <xsl:variable name="isUnwrapParameters" select="input/[EMAIL PROTECTED]'body' and @type!='']/@unwrappParameters"/> <xsl:variable name="inputParamCount" select="count(input/[EMAIL PROTECTED]'body' and @type!='']/param)"/> <xsl:choose> <xsl:when test="$inputcount=1"> <!-- Even when the parameters are 1 we have to see whether we have the wrapped parameters --> - <xsl:choose> + <xsl:choose> <xsl:when test="$isUnwrapParameters"> <xsl:for-each select="input/[EMAIL PROTECTED]'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"/> @@ -347,7 +348,6 @@ wrapped parameters --> <!-- unwrapping takes place only if the back word compatiblity is off. if -b on then we do not unwrapp and only remove the top element --> - <xsl:variable name="isUnwrapParameters" select="input/[EMAIL PROTECTED]'body' and @type!='']/@unwrappParameters"/> <xsl:variable name="inputElementType" select="input/[EMAIL PROTECTED]'body' and @type!='']/@type"></xsl:variable> <xsl:variable name="inputElementComplexType" select="input/[EMAIL PROTECTED]'body' and @type!='']/@complextype"></xsl:variable> <xsl:variable name="opName" select="input/[EMAIL PROTECTED]'body' and @type!='']/@opname"></xsl:variable> @@ -505,6 +505,9 @@ <xsl:when test="(string-length(normalize-space($outputcomplextype)) > 0)"> return get<xsl:value-of select="$outputopname"/>((<xsl:value-of select="$outputtype"/>)object); </xsl:when> + <xsl:when test="($outputparamcount=0) and ($isUnwrapParameters)"> + return; + </xsl:when> <xsl:otherwise> return (<xsl:value-of select="$outputtype"/>)object; </xsl:otherwise> @@ -586,7 +589,6 @@ public void start<xsl:value-of select="@name"/>( <xsl:variable name="inputcount" select="count(input/[EMAIL PROTECTED]'body' and @type!=''])"/> - <xsl:variable name="isUnwrapParameters" select="input/[EMAIL PROTECTED]'body' and @type!='']/@unwrappParameters"/> <xsl:variable name="inputWrappedCount" select="count(input/[EMAIL PROTECTED]'body' and @type!='']/param)"/> <xsl:choose> @@ -642,7 +644,6 @@ <xsl:when test="$inputcount=1"> <!-- Even when the parameters are 1 we have to see whether we have the wrapped parameters --> - <xsl:variable name="isUnwrapParameters" select="input/[EMAIL PROTECTED]'body' and @type!='']/@unwrappParameters"/> <xsl:variable name="inputElementType" select="input/[EMAIL PROTECTED]'body' and @type!='']/@type"></xsl:variable> <xsl:choose> @@ -781,6 +782,7 @@ <xsl:when test="string-length(normalize-space($outputcomplextype)) > 0"> (<xsl:value-of select="$outputcomplextype"/>)object); </xsl:when> + <xsl:when test="($outputparamcount=0) and ($isUnwrapParameters)">);</xsl:when> <xsl:otherwise> (<xsl:value-of select="$outputtype"/>)object); </xsl:otherwise> @@ -904,7 +906,6 @@ <xsl:when test="$inputcount=1"> <!-- Even when the parameters are 1 we have to see whether we have the wrapped parameters --> - <xsl:variable name="isUnwrapParameters" select="input/[EMAIL PROTECTED]'body' and @type!='']/@unwrappParameters"/> <xsl:choose> <xsl:when test="$isUnwrapParameters"> <xsl:for-each select="input/[EMAIL PROTECTED]'body' and @type!='']/param"> @@ -962,7 +963,6 @@ <xsl:when test="$inputcount=1"> <!-- Even when the parameters are 1 we have to see whether we have the wrapped parameters --> - <xsl:variable name="isUnwrapParameters" select="input/[EMAIL PROTECTED]'body' and @type!='']/@unwrappParameters"/> <xsl:variable name="inputElementType" select="input/[EMAIL PROTECTED]'body' and @type!='']/@type"></xsl:variable> <xsl:choose> Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceTemplate.xsl URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceTemplate.xsl?rev=601724&r1=601723&r2=601724&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceTemplate.xsl (original) +++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceTemplate.xsl Thu Dec 6 04:56:18 2007 @@ -55,8 +55,9 @@ <xsl:variable name="outputtype"><xsl:value-of select="output/[EMAIL PROTECTED]'body']/@type"></xsl:value-of></xsl:variable> <xsl:variable name="outputcomplextype"><xsl:value-of select="output/[EMAIL PROTECTED]'body']/@complextype"></xsl:value-of></xsl:variable> <xsl:variable name="outputparamcount"><xsl:value-of select="count(output/[EMAIL PROTECTED]'body']/param)"></xsl:value-of></xsl:variable> + <xsl:variable name="isUnwrapParameters" select="input/[EMAIL PROTECTED]'body' and @type!='']/@unwrappParameters"/> - <!-- start of the sync block --> + <!-- start of the sync block --> <xsl:if test="$isSync='1'"> /** @@ -105,6 +106,7 @@ <xsl:when test="$outputparamcount=1"><xsl:value-of select="output/[EMAIL PROTECTED]'body']/param/@type"/></xsl:when> <xsl:when test="string-length(normalize-space($outputcomplextype)) > 0"><xsl:value-of select="$outputcomplextype"/></xsl:when> + <xsl:when test="($outputparamcount=0) and ($isUnwrapParameters)">void</xsl:when> <xsl:otherwise><xsl:value-of select="$outputtype"/></xsl:otherwise> </xsl:choose> <xsl:text> </xsl:text><xsl:value-of select="@name"/>( @@ -114,7 +116,6 @@ <xsl:when test="$inputcount=1"> <!-- Even when the parameters are 1 we have to see whether we have the wrapped parameters --> - <xsl:variable name="isUnwrapParameters" select="input/[EMAIL PROTECTED]'body' and @type!='']/@unwrappParameters"/> <xsl:choose> <xsl:when test="$isUnwrapParameters"> <xsl:for-each select="input/[EMAIL PROTECTED]'body' and @type!='']/param"> 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?rev=601724&r1=601723&r2=601724&view=diff ============================================================================== --- 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 Thu Dec 6 04:56:18 2007 @@ -178,6 +178,7 @@ getEnvelopeNamespaces(msgContext.getEnvelope())); <!-- Even when the parameters are 1 we have to see whether we have the wrapped parameters --> + <xsl:variable name="isUnwrapParameters" select="input/[EMAIL PROTECTED]'body' and @type!='']/@unwrappParameters"/> <xsl:if test="string-length(normalize-space($returntype)) > 0"><xsl:value-of select="$returnvariable"/> = <!-- set the response wrappers if unwrapping on --> <xsl:choose> @@ -188,9 +189,12 @@ <xsl:when test="string-length(normalize-space($returncomplextype)) > 0"> wrap<xsl:value-of select="$operationName"/>( </xsl:when> + <xsl:when test="($returnparamcount=0) and ($isUnwrapParameters)"> + wrap<xsl:value-of select="$operationName"/>(); + </xsl:when> </xsl:choose> </xsl:if> - <xsl:variable name="isUnwrapParameters" select="input/[EMAIL PROTECTED]'body' and @type!='']/@unwrappParameters"/> + <xsl:choose> <xsl:when test="($isUnwrapParameters)"> <!-- generate the references. the getters need to be 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?rev=601724&r1=601723&r2=601724&view=diff ============================================================================== --- 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 Thu Dec 6 04:56:18 2007 @@ -112,10 +112,12 @@ ) </xsl:when> <xsl:otherwise> + <xsl:variable name="isUnwrapParameters" select="input/[EMAIL PROTECTED]'body' and @type!='']/@unwrappParameters"/> public <xsl:choose> <xsl:when test="$count=0 or $outputtype=''">void</xsl:when> <xsl:when test="$outputparamcount=1"><xsl:value-of select="output/[EMAIL PROTECTED]'body']/param/@type"/></xsl:when> <xsl:when test="string-length(normalize-space($outputcomplextype)) > 0"><xsl:value-of select="$outputcomplextype"/></xsl:when> + <xsl:when test="($outputparamcount=0) and ($isUnwrapParameters)">void</xsl:when> <xsl:otherwise><xsl:value-of select="$outputtype"/></xsl:otherwise></xsl:choose> <xsl:text> </xsl:text><xsl:value-of select="@name"/> ( 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?rev=601724&r1=601723&r2=601724&view=diff ============================================================================== --- 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 Thu Dec 6 04:56:18 2007 @@ -114,11 +114,12 @@ ) </xsl:when> <xsl:otherwise> - + <xsl:variable name="isUnwrapParameters" select="input/[EMAIL PROTECTED]'body' and @type!='']/@unwrappParameters"/> public <xsl:choose> <xsl:when test="$count=0 or $outputtype=''">void</xsl:when> <xsl:when test="$outputparamcount=1"><xsl:value-of select="output/[EMAIL PROTECTED]'body']/param/@type"/></xsl:when> <xsl:when test="string-length(normalize-space($outputcomplextype)) > 0"><xsl:value-of select="$outputcomplextype"/></xsl:when> + <xsl:when test="($outputparamcount=0) and ($isUnwrapParameters)">void</xsl:when> <xsl:otherwise><xsl:value-of select="$outputtype"/></xsl:otherwise></xsl:choose> <xsl:text> </xsl:text><xsl:value-of select="@name"/> ( --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]