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 aj...@apache.org on 2005/08/04 12:11:17 UTC
svn commit: r227339 - in
/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/java:
CallbackHandlerTemplate.xsl InterfaceImplementationTemplate.xsl
InterfaceTemplate.xsl SkeletonTemplate.xsl
Author: ajith
Date: Thu Aug 4 03:10:16 2005
New Revision: 227339
URL: http://svn.apache.org/viewcvs?rev=227339&view=rev
Log:
Updated the templates. Now the code generation is completely based on the MEP of the given method.
Modified:
webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/java/CallbackHandlerTemplate.xsl
webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl
webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/java/InterfaceTemplate.xsl
webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/java/SkeletonTemplate.xsl
Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/java/CallbackHandlerTemplate.xsl
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/java/CallbackHandlerTemplate.xsl?rev=227339&r1=227338&r2=227339&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/java/CallbackHandlerTemplate.xsl (original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/java/CallbackHandlerTemplate.xsl Thu Aug 4 03:10:16 2005
@@ -8,12 +8,12 @@
*/
public class <xsl:value-of select="@name"/>{
-
-
-
+
+
+
private Object clientData;
-
-
+
+
/**
* User can pass in any object that needs to be accessed once the NonBlocking
* Web service call is finished and appropreate method of this CallBack is called.
@@ -25,27 +25,39 @@
}
- <xsl:for-each select="method">
- /**
- * auto generated Axis2 call back method for <xsl:value-of select="@name"/> method
- *
- */
- public void receiveResult<xsl:value-of select="@name"/>( <xsl:value-of select="output/param/@type"/><xsl:text> </xsl:text><xsl:value-of select="output/param/@name"/>) {
- //Fill here with the code to handle the response
-
- }
-
- /**
- * auto generated Axis2 Error handler
- *
- */
- public void receiveError<xsl:value-of select="@name"/>(java.lang.Exception e) {
- //Fill here with the code to handle the exception
+ <xsl:for-each select="method">
+ <xsl:variable name="outParamType"><xsl:value-of select="output/param/@type"/></xsl:variable>
+ <xsl:variable name="outParamName"><xsl:value-of select="output/param/@name"/></xsl:variable>
+ <xsl:variable name="mep"><xsl:value-of select="@mep"/></xsl:variable>
+ <xsl:choose>
+ <!-- Code generation for in-out only. Need to consider the other meps also
+ They should be parts of this xsl:choose loop -->
+ <xsl:when test="$mep='http://www.w3.org/2004/08/wsdl/in-out'">
+ /**
+ * auto generated Axis2 call back method for <xsl:value-of select="@name"/> method
+ *
+ */
+ public void receiveResult<xsl:value-of select="@name"/>( <xsl:value-of select="$outParamType"/><xsl:text> </xsl:text><xsl:value-of select="$outParamName"/>) {
+ //Fill here with the code to handle the response
+ }
+
+ /**
+ * auto generated Axis2 Error handler
+ *
+ */
+ public void receiveError<xsl:value-of select="@name"/>(java.lang.Exception e) {
+ //Fill here with the code to handle the exception
+ }
+ </xsl:when>
+ <xsl:otherwise>
+ // No methods generated for meps other than in-out
+ </xsl:otherwise>
+ </xsl:choose>
+
+
+ </xsl:for-each>
- }
- </xsl:for-each>
-
}
</xsl:template>
- </xsl:stylesheet>
\ No newline at end of file
+</xsl:stylesheet>
\ No newline at end of file
Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl?rev=227339&r1=227338&r2=227339&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl (original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl Thu Aug 4 03:10:16 2005
@@ -37,7 +37,6 @@
* Constructor
*/
public <xsl:value-of select="@name"/>(String axis2Home,String targetEndpoint) throws java.lang.Exception {
-
this.toEPR = new org.apache.axis2.addressing.EndpointReference(targetEndpoint);
//creating the configuration
_configurationContext = new org.apache.axis2.context.ConfigurationContextFactory().buildClientConfigurationContext(axis2Home);
@@ -58,25 +57,31 @@
<xsl:for-each select="method">
<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="inputtype"><xsl:value-of select="input/param/@type"></xsl:value-of></xsl:variable> <!-- this needs to change-->
- <xsl:variable name="inputparam"><xsl:value-of select="input/param/@name"></xsl:value-of></xsl:variable> <!-- this needs to change-->
- <xsl:variable name="dbsupportclassname"><xsl:value-of select="@dbsupportname"></xsl:value-of></xsl:variable>
+ <xsl:variable name="dbsupportclassname"><xsl:value-of select="@dbsupportname"></xsl:value-of></xsl:variable>
<xsl:variable name="soapAction"><xsl:value-of select="@soapaction"></xsl:value-of></xsl:variable>
<xsl:variable name="fullsupporterclassname"><xsl:value-of select="$dbpackage"/>.<xsl:value-of select="$dbsupportclassname"/></xsl:variable>
+ <xsl:variable name="mep"><xsl:value-of select="@mep"/></xsl:variable>
- <!-- When genrating code, the MEP should be taken into account -->
-
+ <!-- Code generation for the in-out mep -->
+ <xsl:if test="$mep='http://www.w3.org/2004/08/wsdl/in-out'">
<xsl:if test="$isSync='1'">
/**
* Auto generated method signature
* @see <xsl:value-of select="$package"/>.<xsl:value-of select="$interfaceName"/>#<xsl:value-of select="@name"/>
- *<xsl:if test="$inputtype!=''">@param <xsl:value-of select="$inputparam"></xsl:value-of></xsl:if>
+ <xsl:for-each select="input/param">
+ <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="$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:if test="$inputtype!=''"><xsl:value-of select="$inputtype"/><xsl:text> </xsl:text><xsl:value-of select="$inputparam"></xsl:value-of></xsl:if>) throws java.rmi.RemoteException{
+ public <xsl:choose><xsl:when test="$outputtype=''">void</xsl:when><xsl:otherwise><xsl:value-of select="$outputtype"/></xsl:otherwise></xsl:choose>
+ <xsl:text> </xsl:text><xsl:value-of select="@name"/>(
+ <xsl:for-each select="input/param">
+ <xsl:if test="@type!=''"><xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@type"/><xsl:text> </xsl:text><xsl:value-of select="@name"/>
+ </xsl:if>
+ </xsl:for-each>) throws java.rmi.RemoteException{
org.apache.axis2.clientapi.Call _call = new org.apache.axis2.clientapi.Call(_serviceContext);
_call.setTransportInfo(this.senderTransport,this.listenerTransport,this.useSeparateListener);
- _call.setDoREST(this.doRest);
+ _call.setDoREST(this.doRest);
org.apache.axis2.context.MessageContext _messageContext = getMessageContext();
_call.setTo(this.toEPR);
@@ -84,54 +89,49 @@
org.apache.axis2.soap.SOAPEnvelope env = null;
env = createEnvelope();
<xsl:choose>
- <xsl:when test="$inputtype!=''">
+ <!-- test the number of input parameters
+ If the number of parameter is more then just run the normal test-->
+ <xsl:when test="count(input/param)>0">
<xsl:choose>
<xsl:when test="$style='rpc'">
- // Style is RPC
- setValueRPC(env,
- "<xsl:value-of select="@namespace"/>",
- "<xsl:value-of select="@name"/>",
- new String[]{"<xsl:value-of select="$inputparam"/>"},
- new Object[]{<xsl:value-of select="$inputparam"/>}); //this needs to be fixed
+ // Style is RPC
+ setValueRPC(env,"<xsl:value-of select="@namespace"/>","<xsl:value-of select="@name"/>",
+ new String[]{<xsl:for-each select="input/param"><xsl:if test="count(input/param)>1">,</xsl:if>"<xsl:value-of select="@name"/>"</xsl:for-each>},
+ new Object[]{<xsl:for-each select="input/param"><xsl:if test="count(input/param)>1">,</xsl:if><xsl:value-of select="@name"/></xsl:for-each>});
</xsl:when>
-
<xsl:when test="$style='doc'">
- //Style is Doc
- setValueDoc(env,<xsl:value-of select="$fullsupporterclassname"/>.toOM(<xsl:value-of select="$inputparam"/>));
+ <!-- for the doc lit case there can be only one element. So take the first element -->
+ //Style is Doc.
+ setValueDoc(env,<xsl:value-of select="$fullsupporterclassname"/>.toOM(<xsl:value-of select="input/param[1]/@name"/>));
</xsl:when>
<xsl:otherwise>
- //Unknown style!! No code is generated
- throw java.lang.UnsupportedOperationException("Unknown Style");
+ //Unknown style!! No code is generated
+ throw java.lang.UnsupportedOperationException("Unknown Style");
</xsl:otherwise>
</xsl:choose>
</xsl:when>
+ <!-- No input parameters present. So generate assuming no input parameters-->
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$style='rpc'">
- //Style is RPC. No input parameters
- setValueRPC(env,
- "<xsl:value-of select="@namespace"/>",
- "<xsl:value-of select="@name"/>",
- null,
- null);
+ //Style is RPC. No input parameters
+ setValueRPC(env,"<xsl:value-of select="@namespace"/>","<xsl:value-of select="@name"/>",null,null);
</xsl:when>
- <!-- The follwing code is specific to XML beans-->
- <xsl:when test="$style='doc'">
- //Style is Doc. No input parameters
- setValueDoc(env,null);
+ <xsl:when test="$style='doc'">
+ //Style is Doc. No input parameters
+ setValueDoc(env,null);
</xsl:when>
<xsl:otherwise>
- //Unknown style!! No code is generated
- throw UnsupportedOperationException("Unknown Style");
+ //Unknown style!! No code is generated
+ throw UnsupportedOperationException("Unknown Style");
</xsl:otherwise>
</xsl:choose>
-
</xsl:otherwise>
</xsl:choose>
_messageContext.setEnvelope(env);
<xsl:choose>
- <xsl:when test="$outputtype=''">
- _call.invokeBlocking(_operations[<xsl:value-of select="position()-1"/>], _messageContext);
+ <xsl:when test="$outputtype=''">
+ _call.invokeBlocking(_operations[<xsl:value-of select="position()-1"/>], _messageContext);
return;
</xsl:when>
<xsl:otherwise>
@@ -147,67 +147,73 @@
</xsl:if>
<xsl:if test="$isAsync='1'">
/**
- * Auto generated method signature
+ * Auto generated method signature for Asynchronous Invocations
* @see <xsl:value-of select="$package"/>.<xsl:value-of select="$interfaceName"/>#start<xsl:value-of select="@name"/>
- *<xsl:if test="$inputtype!=''">@param <xsl:value-of select="$inputparam"></xsl:value-of></xsl:if>
+ <xsl:for-each select="input/param">
+ <xsl:if test="@type!=''">* @param <xsl:value-of select="@name"></xsl:value-of><xsl:text>
+ </xsl:text></xsl:if></xsl:for-each>
*/
- public void start<xsl:value-of select="@name"/>(<xsl:if test="$inputtype!=''"><xsl:value-of select="$inputtype"/><xsl:text> </xsl:text><xsl:value-of select="$inputparam"></xsl:value-of>,</xsl:if>final <xsl:value-of select="$package"/>.<xsl:value-of select="$callbackname"/> callback) throws java.rmi.RemoteException{
- org.apache.axis2.clientapi.Call _call = new org.apache.axis2.clientapi.Call(_serviceContext);<!-- this needs to change -->
+ public void start<xsl:value-of select="@name"/>(
+ <xsl:for-each select="input/param">
+ <xsl:if test="@type!=''"><xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@type"/><xsl:text> </xsl:text><xsl:value-of select="@name"></xsl:value-of></xsl:if></xsl:for-each>
+ <xsl:if test="count(input/param)>0">,</xsl:if>final <xsl:value-of select="$package"/>.<xsl:value-of select="$callbackname"/> callback) throws java.rmi.RemoteException{
+
+ org.apache.axis2.clientapi.Call _call = new org.apache.axis2.clientapi.Call(_serviceContext);
org.apache.axis2.context.MessageContext _messageContext = getMessageContext();
_call.setTo(this.toEPR);
_call.setSoapAction("<xsl:value-of select="$soapAction"/>");
org.apache.axis2.soap.SOAPEnvelope env = createEnvelope();
<xsl:choose>
- <xsl:when test="$inputtype!=''">
+ <!-- There are more than 1 parameter in the input-->
+ <xsl:when test="count(input/param)>0">
<xsl:choose>
<xsl:when test="$style='rpc'">
- // Style is RPC
- setValueRPC(env,
- "<xsl:value-of select="@namespace"/>",
- "<xsl:value-of select="@name"/>",
- new String[]{"<xsl:value-of select="$inputparam"/>"},
- new Object[]{<xsl:value-of select="$inputparam"/>});
+ // Style is RPC
+ setValueRPC(env,
+ "<xsl:value-of select="@namespace"/>",
+ "<xsl:value-of select="@name"/>",
+ new String[]{<xsl:for-each select="input/param"><xsl:if test="count(input/param)>1">,</xsl:if>"<xsl:value-of select="@name"/>"</xsl:for-each>},
+ new Object[]{<xsl:for-each select="input/param"><xsl:if test="count(input/param)>1">,</xsl:if><xsl:value-of select="@name"/></xsl:for-each>});
</xsl:when>
- <!-- The follwing code is specific to XML beans-->
<xsl:when test="$style='doc'">
- //Style is Doc
- setValueDoc(env,<xsl:value-of select="$fullsupporterclassname"/>.toOM(<xsl:value-of select="$inputparam"/>));
+ //Style is Doc
+ setValueDoc(env,<xsl:value-of select="$fullsupporterclassname"/>.toOM(<xsl:value-of select="input/param[1]/@name"/>));
</xsl:when>
<xsl:otherwise>
- //Unknown style!! No code is generated
- throw UnsupportedOperationException("Unknown Style");
+ //Unknown style!! No code is generated
+ throw UnsupportedOperationException("Unknown Style");
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$style='rpc'">
- //Style is RPC. No input parameters
- setValueRPC(env,
- "<xsl:value-of select="@namespace"/>",
- "<xsl:value-of select="@name"/>",
- null,
- null);
+ //Style is RPC. No input parameters
+ setValueRPC(env,
+ "<xsl:value-of select="@namespace"/>",
+ "<xsl:value-of select="@name"/>",
+ null,
+ null);
</xsl:when>
<!-- The follwing code is specific to XML beans-->
<xsl:when test="$style='doc'">
- //Style is Doc. No input parameters
- setValueDoc(env,null);
+ //Style is Doc. No input parameters
+ setValueDoc(env,null);
</xsl:when>
<xsl:otherwise>
- //Unknown style!! No code is generated
- throw UnsupportedOperationException("Unknown Style");
+ //Unknown style!! No code is generated
+ throw UnsupportedOperationException("Unknown Style");
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
_messageContext.setEnvelope(env);
- _call.invokeNonBlocking(_operations[<xsl:value-of select="position()-1"/>], _messageContext, new org.apache.axis2.clientapi.Callback(){
+ _call.invokeNonBlocking(_operations[<xsl:value-of select="position()-1"/>], _messageContext, new org.apache.axis2.clientapi.Callback(){
public void onComplete(org.apache.axis2.clientapi.AsyncResult result){
-
+
java.lang.Object object = <xsl:value-of select="$fullsupporterclassname"/>.fromOM(getElement(result.getResponseEnvelope(),"<xsl:value-of select="$style"/>"),<xsl:value-of select="$outputtype"/>.class);
-
+
callback.receiveResult<xsl:value-of select="@name"/>((<xsl:value-of select="$outputtype"/>)object);
}
public void reportError(java.lang.Exception e){
@@ -219,6 +225,70 @@
<!-- this needs to be changed -->
}
+ </xsl:if>
+ <!-- End of in-out mep -->
+ </xsl:if>
+ <!-- Start of in only mep-->
+ <xsl:if test="$mep='http://www.w3.org/2004/08/wsdl/in-only'">
+ <!-- for the in only mep there is no notion of sync or async. And there is no return type also -->
+ public void <xsl:text> </xsl:text><xsl:value-of select="@name"/>(
+ <xsl:for-each select="input/param">
+ <xsl:if test="@type!=''"><xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@type"/><xsl:text> </xsl:text><xsl:value-of select="@name"/>
+ </xsl:if>
+ </xsl:for-each>) throws java.rmi.RemoteException{
+ org.apache.axis2.clientapi.Call _call = new org.apache.axis2.clientapi.Call(_serviceContext);
+ _call.setTransportInfo(this.senderTransport,this.listenerTransport,this.useSeparateListener);
+ _call.setDoREST(this.doRest);
+
+ org.apache.axis2.context.MessageContext _messageContext = getMessageContext();
+ _call.setTo(this.toEPR);
+ _call.setSoapAction("<xsl:value-of select="$soapAction"/>");
+ org.apache.axis2.soap.SOAPEnvelope env = null;
+ env = createEnvelope();
+ <xsl:choose>
+ <!-- test the number of input parameters
+ If the number of parameter is more then just run the normal generation-->
+ <xsl:when test="count(input/param)>0">
+ <xsl:choose>
+ <xsl:when test="$style='rpc'">
+ // Style is RPC
+ setValueRPC(env,"<xsl:value-of select="@namespace"/>","<xsl:value-of select="@name"/>",
+ new String[]{<xsl:for-each select="input/param"><xsl:if test="count(input/param)>1">,</xsl:if>"<xsl:value-of select="@name"/>"</xsl:for-each>},
+ new Object[]{<xsl:for-each select="input/param"><xsl:if test="count(input/param)>1">,</xsl:if><xsl:value-of select="@name"/></xsl:for-each>});
+ </xsl:when>
+ <xsl:when test="$style='doc'">
+ <!-- for the doc lit case there can be only one element. So take the first element -->
+ //Style is Doc.
+ setValueDoc(env,<xsl:value-of select="$fullsupporterclassname"/>.toOM(<xsl:value-of select="input/param[1]/@name"/>));
+ </xsl:when>
+ <xsl:otherwise>
+ //Unknown style!! No code is generated
+ throw java.lang.UnsupportedOperationException("Unknown Style");
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <!-- No input parameters present. So generate assuming no input parameters-->
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="$style='rpc'">
+ //Style is RPC. No input parameters
+ setValueRPC(env,"<xsl:value-of select="@namespace"/>","<xsl:value-of select="@name"/>",null,null);
+ </xsl:when>
+ <xsl:when test="$style='doc'">
+ //Style is Doc. No input parameters
+ setValueDoc(env,null);
+ </xsl:when>
+ <xsl:otherwise>
+ //Unknown style!! No code is generated
+ throw UnsupportedOperationException("Unknown Style");
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ _messageContext.setEnvelope(env);
+ _call.invokeBlocking(_operations[<xsl:value-of select="position()-1"/>], _messageContext);
+ return;
+ }
</xsl:if>
</xsl:for-each>
}
Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/java/InterfaceTemplate.xsl
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/java/InterfaceTemplate.xsl?rev=227339&r1=227338&r2=227339&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/java/InterfaceTemplate.xsl (original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/java/InterfaceTemplate.xsl Thu Aug 4 03:10:16 2005
@@ -11,28 +11,65 @@
/*
* Auto generated java interface by the Axis code generator
*/
+
public interface <xsl:value-of select="@name"></xsl:value-of> {
- <xsl:for-each select="method">
+ <xsl:for-each select="method">
+ <!-- Code for in-out mep -->
+ <xsl:if test="@mep='http://www.w3.org/2004/08/wsdl/in-out'">
<xsl:variable name="outputtype"><xsl:value-of select="output/param/@type"></xsl:value-of></xsl:variable>
+
+ <!-- start of the sync block -->
<xsl:if test="$isSync='1'">
/**
* Auto generated method signature
<xsl:for-each select="input/param">
- * @param <xsl:value-of select="@name"/>
- </xsl:for-each>
+ <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="$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:for-each select="input/param"><xsl:value-of select="@type"/><xsl:text> </xsl:text><xsl:value-of select="@name"></xsl:value-of><xsl:if test="not(position()=last())">, </xsl:if></xsl:for-each>) throws java.rmi.RemoteException;
+ public <xsl:choose><xsl:when test="$outputtype=''">void</xsl:when><xsl:otherwise><xsl:value-of select="$outputtype"/></xsl:otherwise></xsl:choose>
+ <xsl:text> </xsl:text><xsl:value-of select="@name"/>(
+ <xsl:for-each select="input/param">
+ <xsl:if test="@type!=''"><xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@type"/><xsl:text> </xsl:text><xsl:value-of select="@name"/>
+ </xsl:if>
+ </xsl:for-each>) throws java.rmi.RemoteException;
+ <!-- end of the sync block -->
</xsl:if>
+
+ <!-- start of the async block -->
<xsl:if test="$isAsync='1'">
/**
* Auto generated method signature
+ <xsl:for-each select="input/param">
+ <xsl:if test="@type!=''">* @param <xsl:value-of select="@name"></xsl:value-of><xsl:text>
+ </xsl:text></xsl:if></xsl:for-each>
+ */
+ public void start<xsl:value-of select="@name"/>(
<xsl:for-each select="input/param">
- * @param <xsl:value-of select="@name"/>
- </xsl:for-each>
+ <xsl:if test="@type!=''"><xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@type"/><xsl:text> </xsl:text><xsl:value-of select="@name"></xsl:value-of></xsl:if></xsl:for-each>
+ <xsl:if test="count(input/param)>0">,</xsl:if>final <xsl:value-of select="$package"/>.<xsl:value-of select="$callbackname"/> callback) throws java.rmi.RemoteException;
+ </xsl:if>
+<!-- end of async block-->
+
+ </xsl:if>
+ <!-- Code for in-only mep -->
+ <xsl:if test="@mep='http://www.w3.org/2004/08/wsdl/in-only'">
+
+ <!-- For in-only meps there would not be any asynchronous methods since there is no output -->
+ /**
+ * Auto generated method signature
+ <xsl:for-each select="input/param">
+ <xsl:if test="@type!=''">*@param <xsl:value-of select="@name"></xsl:value-of><xsl:text>
+ </xsl:text></xsl:if></xsl:for-each>
*/
- public void start<xsl:value-of select="@name"/>(<xsl:for-each select="input/param"><xsl:value-of select="@type"/><xsl:text> </xsl:text><xsl:value-of select="@name"></xsl:value-of>, </xsl:for-each>final <xsl:value-of select="$package"/>.<xsl:value-of select="$callbackname"/> callback) throws java.rmi.RemoteException;
+ public void
+ <xsl:text> </xsl:text><xsl:value-of select="@name"/>(
+ <xsl:for-each select="input/param">
+ <xsl:if test="@type!=''"><xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@type"/><xsl:text> </xsl:text><xsl:value-of select="@name"/>
+ </xsl:if>
+ </xsl:for-each>) throws java.rmi.RemoteException;
+
</xsl:if>
- </xsl:for-each>
- }
+ </xsl:for-each>
+ }
</xsl:template>
- </xsl:stylesheet>
\ No newline at end of file
+ </xsl:stylesheet>
\ No newline at end of file
Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/java/SkeletonTemplate.xsl
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/java/SkeletonTemplate.xsl?rev=227339&r1=227338&r2=227339&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/java/SkeletonTemplate.xsl (original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/java/SkeletonTemplate.xsl Thu Aug 4 03:10:16 2005
@@ -1,30 +1,28 @@
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:template match="/interface">
-
package <xsl:value-of select="@package"/>;
-
/**
* Auto generated java skeleton for the service by the Axis code generator
*/
-
public class <xsl:value-of select="@name"></xsl:value-of> {
<xsl:for-each select="method">
<xsl:variable name="outputtype"><xsl:value-of select="output/param/@type"></xsl:value-of></xsl:variable>
-
- <xsl:variable name="inputtype"><xsl:value-of select="input/param/@type"></xsl:value-of></xsl:variable> <!-- this needs to change-->
- <xsl:variable name="inputparam"><xsl:value-of select="input/param/@name"></xsl:value-of></xsl:variable> <!-- this needs to change-->
-
+ <!-- regardless of the sync or async status, the generated method signature would be just a usual
+ java method -->
/**
* Auto generated method signature
- *<xsl:if test="$inputtype!=''">@param <xsl:value-of select="$inputparam"></xsl:value-of></xsl:if>
+ <xsl:for-each select="input/param">
+ <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="$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:if test="$inputtype!=''"><xsl:value-of select="$inputtype"/><xsl:text> </xsl:text><xsl:value-of select="$inputparam"></xsl:value-of></xsl:if>){
+ public <xsl:if test="$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:for-each select="input/param">
+ <xsl:if test="@type!=''"><xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@type"/><xsl:text> </xsl:text><xsl:value-of select="@name"/>
+ </xsl:if>
+ </xsl:for-each> ){
//Todo fill this with the necessary business logic
<xsl:if test="$outputtype!=''">return null;</xsl:if>
}
-
-
</xsl:for-each>
}
</xsl:template>