Author: lresende
Date: Thu Mar 13 10:32:45 2008
New Revision: 636807

URL: http://svn.apache.org/viewvc?rev=636807&view=rev
Log:
TUSCANY-1894 - Updating XSLT Template used to create java interfaces from wsdl 
to add RemoteException to the list of exceptions of a given method

Modified:
    
incubator/tuscany/java/sca/itest/bpel/helloworld/src/test/java/helloworld/HelloWorld.java
    
incubator/tuscany/java/sca/itest/bpel/helloworld/src/test/java/helloworld/HelloWorldTestCase.java
    
incubator/tuscany/java/sca/samples/helloworld-bpel/src/test/java/helloworld/BPELHelloWorldTestCase.java
    
incubator/tuscany/java/sca/tools/wsdl2java/src/main/resources/RemotableInterfaceTemplate.xsl

Modified: 
incubator/tuscany/java/sca/itest/bpel/helloworld/src/test/java/helloworld/HelloWorld.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/bpel/helloworld/src/test/java/helloworld/HelloWorld.java?rev=636807&r1=636806&r2=636807&view=diff
==============================================================================
--- 
incubator/tuscany/java/sca/itest/bpel/helloworld/src/test/java/helloworld/HelloWorld.java
 (original)
+++ 
incubator/tuscany/java/sca/itest/bpel/helloworld/src/test/java/helloworld/HelloWorld.java
 Thu Mar 13 10:32:45 2008
@@ -37,7 +37,7 @@
         this.helloService = helloService;
     }
     
-    public String hello(String hello) {
+    public String hello(String hello) throws java.rmi.RemoteException {
         System.out.println(">>> Invoking helloService.hello with : " + hello);
         return this.helloService.hello(hello);
     }

Modified: 
incubator/tuscany/java/sca/itest/bpel/helloworld/src/test/java/helloworld/HelloWorldTestCase.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/bpel/helloworld/src/test/java/helloworld/HelloWorldTestCase.java?rev=636807&r1=636806&r2=636807&view=diff
==============================================================================
--- 
incubator/tuscany/java/sca/itest/bpel/helloworld/src/test/java/helloworld/HelloWorldTestCase.java
 (original)
+++ 
incubator/tuscany/java/sca/itest/bpel/helloworld/src/test/java/helloworld/HelloWorldTestCase.java
 Thu Mar 13 10:32:45 2008
@@ -49,13 +49,13 @@
         scaDomain.close();
     }
     
-    public void testServiceInvocation() {
+    public void testServiceInvocation() throws Exception {
         HelloPortType bpelService = scaDomain.getService(HelloPortType.class, 
"BPELHelloWorldService");
         String response = bpelService.hello("Hello");
         assertEquals("Hello World", response);
     }
     
-    public void testReferenceInvocation() {
+    public void testReferenceInvocation() throws Exception {
         HelloWorld bpelService = scaDomain.getService(HelloWorld.class, 
"BPELHelloWorld");
         String response = bpelService.hello("Hello");
         assertEquals("Hello World", response);        

Modified: 
incubator/tuscany/java/sca/samples/helloworld-bpel/src/test/java/helloworld/BPELHelloWorldTestCase.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/helloworld-bpel/src/test/java/helloworld/BPELHelloWorldTestCase.java?rev=636807&r1=636806&r2=636807&view=diff
==============================================================================
--- 
incubator/tuscany/java/sca/samples/helloworld-bpel/src/test/java/helloworld/BPELHelloWorldTestCase.java
 (original)
+++ 
incubator/tuscany/java/sca/samples/helloworld-bpel/src/test/java/helloworld/BPELHelloWorldTestCase.java
 Thu Mar 13 10:32:45 2008
@@ -52,7 +52,7 @@
         scaDomain.close();
     }
     
-    public void testInvoke() {
+    public void testInvoke() throws Exception {
         String response = bpelService.hello("Hello");
         assertEquals("Hello World", response);
     }

Modified: 
incubator/tuscany/java/sca/tools/wsdl2java/src/main/resources/RemotableInterfaceTemplate.xsl
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tools/wsdl2java/src/main/resources/RemotableInterfaceTemplate.xsl?rev=636807&r1=636806&r2=636807&view=diff
==============================================================================
--- 
incubator/tuscany/java/sca/tools/wsdl2java/src/main/resources/RemotableInterfaceTemplate.xsl
 (original)
+++ 
incubator/tuscany/java/sca/tools/wsdl2java/src/main/resources/RemotableInterfaceTemplate.xsl
 Thu Mar 13 10:32:45 2008
@@ -1,121 +1,130 @@
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.    
--->
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
-    <xsl:output method="text"/>
-
-    <!-- import the databinding template-->
-    <xsl:include href="databindsupporter"/>
-    <!-- import the other templates for databinding
-         Note  -  these names would be handled by a special
-         URI resolver during the xslt transformations
-     -->
-    <xsl:include href="externalTemplate"/>
-
-
-    <xsl:template match="/interface">
-    <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="callbackname"><xsl:value-of 
select="@callbackname"/></xsl:variable>
-    <xsl:variable name="package"><xsl:value-of 
select="@package"/></xsl:variable>
-
-    /**
-     * <xsl:value-of select="@name"/>.java
-     *
-     * This file was auto-generated from WSDL
-     * by the Apache Axis2 version: #axisVersion# #today#
-     */
-    package <xsl:value-of select="$package"/>;
-
-    import org.osoa.sca.annotations.Remotable;
-    
-    /*
-     *  <xsl:value-of select="@name"/> java interface
-     */
-
-    @Remotable
-    public interface <xsl:value-of select="@name"></xsl:value-of> {
-          <xsl:for-each select="method">
-            <!-- Code for in-out mep -->
-         <xsl:if test="@mep='12'">
-         <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 signatures
-         <xsl:for-each select="input/[EMAIL PROTECTED]'']">* @param 
<xsl:value-of select="@name"></xsl:value-of><xsl:text>&#10;         
</xsl:text></xsl:for-each>
-         <xsl:for-each select="fault/[EMAIL PROTECTED]'']">* @throws 
<xsl:value-of select="@name"></xsl:value-of><xsl:text>&#10;         
*</xsl:text></xsl:for-each>
-         */
-         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/[EMAIL PROTECTED]'']">
-            <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:for-each select="fault/[EMAIL PROTECTED]'']">
-            <xsl:if test="position()=1">throws </xsl:if><xsl:if 
test="position()>1">,</xsl:if><xsl:text> </xsl:text><xsl:value-of 
select="@name"/>
-          </xsl:for-each>;
-        <!-- 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/[EMAIL PROTECTED]'']">* @param 
<xsl:value-of select="@name"></xsl:value-of><xsl:text>&#10;         
</xsl:text></xsl:for-each>
-         <xsl:for-each select="fault/[EMAIL PROTECTED]'']">* @throws 
<xsl:value-of select="@name"></xsl:value-of><xsl:text>&#10;         
*</xsl:text></xsl:for-each>
-          */
-
-        public void start<xsl:value-of select="@name"/>(
-         <xsl:variable name="paramCount"><xsl:value-of 
select="count(input/[EMAIL PROTECTED]''])"></xsl:value-of></xsl:variable>
-               <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="$paramCount>0">,</xsl:if>final <xsl:value-of 
select="$package"/>.<xsl:value-of select="$callbackname"/> callback) 
<xsl:for-each select="fault/[EMAIL PROTECTED]'']">
-            <xsl:if test="position()=1">throws </xsl:if><xsl:if 
test="position()>1">,</xsl:if><xsl:text> </xsl:text><xsl:value-of 
select="@name"/>
-          </xsl:for-each>;
-        </xsl:if>
-       <!-- end of async block-->
-
-     </xsl:if>
-        <!-- Code for in-only mep -->
-       <xsl:if test="@mep='10'">
-
-       <!-- 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/[EMAIL PROTECTED]'']">* @param 
<xsl:value-of select="@name"></xsl:value-of><xsl:text>&#10;         
</xsl:text></xsl:for-each>
-         <xsl:for-each select="fault/[EMAIL PROTECTED]'']">* @throws 
<xsl:value-of select="@name"></xsl:value-of><xsl:text>&#10;         
*</xsl:text></xsl:for-each>
-         */
-         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>) <xsl:for-each select="fault/[EMAIL PROTECTED]'']">
-            <xsl:if test="position()=1">throws </xsl:if><xsl:if 
test="position()>1">,</xsl:if><xsl:text> </xsl:text><xsl:value-of 
select="@name"/>
-          </xsl:for-each>;
-
-        </xsl:if>
-       </xsl:for-each>
-
-       <!-- Apply other templates --> 
-       //<xsl:apply-templates/>
-       }
-
-
-    </xsl:template>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+-->
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
+    <xsl:output method="text"/>
+
+    <!-- import the databinding template-->
+    <xsl:include href="databindsupporter"/>
+    <!-- import the other templates for databinding
+         Note  -  these names would be handled by a special
+         URI resolver during the xslt transformations
+     -->
+    <xsl:include href="externalTemplate"/>
+
+
+    <xsl:template match="/interface">
+
+    <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="callbackname"><xsl:value-of 
select="@callbackname"/></xsl:variable>
+    <xsl:variable name="package"><xsl:value-of 
select="@package"/></xsl:variable>
+
+    /**
+     * <xsl:value-of select="@name"/>.java
+     *
+     * This file was auto-generated from WSDL
+     * by the Apache Axis2 version: #axisVersion# #today#
+     */
+    package <xsl:value-of select="$package"/>;
+
+    import org.osoa.sca.annotations.Remotable;
+    import org.osoa.sca.annotations.Service;
+    
+    /*
+     *  <xsl:value-of select="@name"/> java interface
+     */
+
+    @Remotable
+    @Service
+    public interface <xsl:value-of select="@name"></xsl:value-of> {
+          <xsl:for-each select="method">
+
+            <!-- Code for in-out mep -->
+         <xsl:if test="@mep='12'">
+         <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 signatures
+         <xsl:for-each select="input/[EMAIL PROTECTED]'']">* @param 
<xsl:value-of select="@name"></xsl:value-of><xsl:text>&#10;         
</xsl:text></xsl:for-each>
+         <xsl:for-each select="fault/[EMAIL PROTECTED]'']">* @throws 
<xsl:value-of select="@name"></xsl:value-of><xsl:text>&#10;         
*</xsl:text></xsl:for-each>
+
+         */
+         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/[EMAIL PROTECTED]'']">
+            <xsl:if test="position()>1">,</xsl:if><xsl:value-of 
select="@type"/><xsl:text> </xsl:text><xsl:value-of select="@name"/>
+          </xsl:for-each>) throws <xsl:for-each select="fault/[EMAIL 
PROTECTED]'']">
+            <xsl:if test="position()>1">,</xsl:if><xsl:text> 
</xsl:text><xsl:value-of select="@name"/><xsl:if 
test="position()=last()">,</xsl:if>
+
+          </xsl:for-each> 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/[EMAIL PROTECTED]'']">* @param 
<xsl:value-of select="@name"></xsl:value-of><xsl:text>&#10;         
</xsl:text></xsl:for-each>
+         <xsl:for-each select="fault/[EMAIL PROTECTED]'']">* @throws 
<xsl:value-of select="@name"></xsl:value-of><xsl:text>&#10;         
*</xsl:text></xsl:for-each>
+
+          */
+
+        public void start<xsl:value-of select="@name"/>(
+         <xsl:variable name="paramCount"><xsl:value-of 
select="count(input/[EMAIL PROTECTED]''])"></xsl:value-of></xsl:variable>
+               <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="$paramCount>0">,</xsl:if>final <xsl:value-of 
select="$package"/>.<xsl:value-of select="$callbackname"/> callback) throws 
<xsl:for-each select="fault/[EMAIL PROTECTED]'']">
+            <xsl:if test="position()>1">,</xsl:if><xsl:text> 
</xsl:text><xsl:value-of select="@name"/><xsl:if 
test="position()=last()">,</xsl:if>
+          </xsl:for-each> java.rmi.RemoteException;
+        </xsl:if>
+       <!-- end of async block-->
+
+     </xsl:if>
+        <!-- Code for in-only mep -->
+       <xsl:if test="@mep='10'">
+
+       <!-- 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/[EMAIL PROTECTED]'']">* @param 
<xsl:value-of select="@name"></xsl:value-of><xsl:text>&#10;         
</xsl:text></xsl:for-each>
+         <xsl:for-each select="fault/[EMAIL PROTECTED]'']">* @throws 
<xsl:value-of select="@name"></xsl:value-of><xsl:text>&#10;         
*</xsl:text></xsl:for-each>
+         */
+         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 <xsl:for-each select="fault/[EMAIL 
PROTECTED]'']">
+            <xsl:if test="position()>1">,</xsl:if><xsl:text> 
</xsl:text><xsl:value-of select="@name"/><xsl:if 
test="position()=last()">,</xsl:if>
+          </xsl:for-each> java.rmi.RemoteException;
+
+        </xsl:if>
+
+       </xsl:for-each>
+
+       <!-- Apply other templates --> 
+       //<xsl:apply-templates/>
+       }
+
+
+    </xsl:template>
    </xsl:stylesheet>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to