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 ds...@apache.org on 2006/09/25 05:55:51 UTC
svn commit: r449560 - in
/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java:
InterfaceImplementationTemplate.xsl MessageReceiverTemplate.xsl
Author: dsosnoski
Date: Sun Sep 24 20:55:50 2006
New Revision: 449560
URL: http://svn.apache.org/viewvc?view=rev&rev=449560
Log:
Pass information for JiBX unwrapped binding to code generation, delegate method generation to databinding when flagged
Modified:
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/MessageReceiverTemplate.xsl
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?view=diff&rev=449560&r1=449559&r2=449560
==============================================================================
--- 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 Sun Sep 24 20:55:50 2006
@@ -204,6 +204,11 @@
<xsl:for-each select="method">
+
+ <!-- If usedbmethod attribute present, gives name of method to call for implementation -->
+ <xsl:variable name="usedbimpl"><xsl:value-of select="@usdbimpl"/></xsl:variable>
+ <xsl:if test="$usedbimpl!='true'">
+
<xsl:variable name="outputtype"><xsl:value-of select="output/param/@type"></xsl:value-of></xsl:variable>
<xsl:variable name="style"><xsl:value-of select="@style"></xsl:value-of></xsl:variable>
<xsl:variable name="soapAction"><xsl:value-of select="@soapaction"></xsl:value-of></xsl:variable>
@@ -699,6 +704,7 @@
return;
}
</xsl:if>
+ </xsl:if>
</xsl:for-each>
/**
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=449560&r1=449559&r2=449560
==============================================================================
--- 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 Sun Sep 24 20:55:50 2006
@@ -56,91 +56,97 @@
<xsl:for-each select="method">
- <xsl:variable name="returntype"><xsl:value-of select="output/param/@type"/></xsl:variable>
- <xsl:variable name="returnvariable"><xsl:value-of select="output/param/@name"/></xsl:variable>
- <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)){
-
-
- <xsl:if test="$returntype!=''">
- <xsl:value-of select="$returntype"/>
- <xsl:text> </xsl:text>
- <xsl:value-of select="$returnvariable"/> = null;
- </xsl:if>
-
-
+
+ <!-- If usedbmethod attribute present, gives name of method to call for implementation -->
+ <xsl:variable name="usedbmethod"><xsl:value-of select="@usedbmethod"/></xsl:variable>
<xsl:choose>
- <!-- We really don't need to make a difference between these-->
- <xsl:when test="$style='document' or $style='rpc'">
- //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:when test="$usedbmethod=''">
+ <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:variable name="returntype"><xsl:value-of select="output/param/@type"/></xsl:variable>
+ <xsl:variable name="returnvariable"><xsl:value-of select="output/param/@name"/></xsl:variable>
+
+ <xsl:if test="$returntype!=''">
+ <xsl:value-of select="$returntype"/>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="$returnvariable"/> = null;
+ </xsl:if>
+
+ <xsl:choose>
+ <!-- We really don't need to make a difference between these-->
+ <xsl:when test="$style='document' or $style='rpc'">
+ //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: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="$returntype!=''"><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>
+ param<xsl:value-of select="position()"/>
+ </xsl:for-each>
+ );
- <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="$returntype!=''"><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>
- param<xsl:value-of select="position()"/>
- </xsl:for-each>
-
- );
-
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="$returntype!=''"><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="$returntype!=''"><xsl:value-of select="$returnvariable"/> =</xsl:if>
- skel.<xsl:value-of select="@name"/>();
+ <xsl:if test="$returntype!=''"><xsl:value-of select="$returnvariable"/> =</xsl:if>
+ skel.<xsl:value-of select="@name"/>(wrappedParam) ;
</xsl:otherwise>
</xsl:choose>
-
- <xsl:choose>
- <xsl:when test="$returntype!=''">
- envelope = toEnvelope(getSOAPFactory(msgContext), <xsl:value-of select="$returnvariable"/>, false);
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:if test="$returntype!=''"><xsl:value-of select="$returnvariable"/> =</xsl:if>
+ skel.<xsl:value-of select="@name"/>();
+ </xsl:otherwise>
+ </xsl:choose>
+
+ <xsl:choose>
+ <xsl:when test="$returntype!=''">
+ envelope = toEnvelope(getSOAPFactory(msgContext), <xsl:value-of select="$returnvariable"/>, false);
+ </xsl:when>
+ <xsl:otherwise>
+ envelope = getSOAPFactory(msgContext).getDefaultEnvelope();
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:when>
+
<xsl:otherwise>
- envelope = getSOAPFactory(msgContext).getDefaultEnvelope();
+ //Unknown style!! No code is generated
+ throw new UnsupportedOperationException("Unknown Style");
</xsl:otherwise>
</xsl:choose>
</xsl:when>
-
+
<xsl:otherwise>
- //Unknown style!! No code is generated
- throw new UnsupportedOperationException("Unknown Style");
+ envelope = <xsl:value-of select="$usedbmethod"/>(msgContext.getEnvelope().getBody().getFirstElement(), getSOAPFactory(msgContext));
</xsl:otherwise>
+
</xsl:choose>
-
+
}
</xsl:for-each>
@@ -236,43 +242,55 @@
if(op.getName() != null & (methodName = op.getName().getLocalPart()) != null){
<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)){
-
+
+ <!-- If usedbmethod attribute present, gives name of method to call for implementation -->
+ <xsl:variable name="usedbmethod"><xsl:value-of select="@usedbmethod"/></xsl:variable>
<xsl:choose>
- <xsl:when test="$style='rpc'">
-
- //rpc style -- this needs to be filled
-
- </xsl:when>
- <xsl:when test="$style='document'">
- //doc style
- <xsl:variable name="paramCount"><xsl:value-of select="count(input/param[@location='body'])"/></xsl:variable>
+ <xsl:when test="$usedbmethod=''">
+
+ <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)){
+
<xsl:choose>
- <xsl:when test="$paramCount > 0"> skel.<xsl:value-of select="@name"/>(
- <xsl:for-each select="input/param[@location='body']">
- <xsl:if test="@type!=''">(<xsl:value-of select="@type"/>)fromOM(
- inMessage.getEnvelope().getBody().getFirstElement(),
- <xsl:value-of select="@type"/>.class,
- getEnvelopeNamespaces(inMessage.getEnvelope())
- )<xsl:if test="position() > 1">,</xsl:if></xsl:if>
- </xsl:for-each>);
+ <xsl:when test="$style='rpc'">
+
+ //rpc style -- this needs to be filled
+
</xsl:when>
- <xsl:otherwise>skel.<xsl:value-of select="@name"/>();</xsl:otherwise>
+ <xsl:when test="$style='document'">
+ //doc style
+ <xsl:variable name="paramCount"><xsl:value-of select="count(input/param[@location='body'])"/></xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$paramCount > 0"> skel.<xsl:value-of select="@name"/>(
+ <xsl:for-each select="input/param[@location='body']">
+ <xsl:if test="@type!=''">(<xsl:value-of select="@type"/>)fromOM(
+ inMessage.getEnvelope().getBody().getFirstElement(),
+ <xsl:value-of select="@type"/>.class,
+ getEnvelopeNamespaces(inMessage.getEnvelope())
+ )<xsl:if test="position() > 1">,</xsl:if></xsl:if>
+ </xsl:for-each>);
+ </xsl:when>
+ <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");
+ </xsl:otherwise>
</xsl:choose>
</xsl:when>
-
+
<xsl:otherwise>
- //Unknown style!! No code is generated
- throw new UnsupportedOperationException("Unknown Style");
+ <xsl:value-of select="$usedbmethod"/>(msgContext.getEnvelope().getBody().getFirstElement(), null);
</xsl:otherwise>
+
</xsl:choose>
-
+
}
</xsl:for-each>
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org