Author: rineholt
Date: Fri Sep 29 03:49:58 2006
New Revision: 451219
URL: http://svn.apache.org/viewvc?view=rev&rev=451219
Log:
TUSCANY-754
http://issues.apache.org/jira/browse/TUSCANY-754
patch from Luciano Resende thanks!
Added:
incubator/tuscany/java/sca/tools/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/RemotableInterfaceWritter.java
(with props)
incubator/tuscany/java/sca/tools/src/main/resources/RemotableInterfaceTemplate.xsl
Modified:
incubator/tuscany/java/sampleapps/bigbank/account/pom.xml
incubator/tuscany/java/sampleapps/bigbank/webclient/pom.xml
incubator/tuscany/java/sca/tools/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/JavaInterfaceEmitter.java
incubator/tuscany/java/testing/sca/interop/clients/webserviceInteropDoc/src/main/resources/wsdl/interopdoc.wsdl
Modified: incubator/tuscany/java/sampleapps/bigbank/account/pom.xml
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sampleapps/bigbank/account/pom.xml?view=diff&rev=451219&r1=451218&r2=451219
==============================================================================
--- incubator/tuscany/java/sampleapps/bigbank/account/pom.xml (original)
+++ incubator/tuscany/java/sampleapps/bigbank/account/pom.xml Fri Sep 29
03:49:58 2006
@@ -73,6 +73,13 @@
<version>3.8.1</version>
<scope>test</scope>
</dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca.kernel</groupId>
+ <artifactId>tuscany-api</artifactId>
+ <version>${sca.version}</version>
+ <scope>provided</scope>
+ </dependency>
</dependencies>
<build>
<resources>
Modified: incubator/tuscany/java/sampleapps/bigbank/webclient/pom.xml
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sampleapps/bigbank/webclient/pom.xml?view=diff&rev=451219&r1=451218&r2=451219
==============================================================================
--- incubator/tuscany/java/sampleapps/bigbank/webclient/pom.xml (original)
+++ incubator/tuscany/java/sampleapps/bigbank/webclient/pom.xml Fri Sep 29
03:49:58 2006
@@ -63,6 +63,14 @@
<version>3.8.1</version>
<scope>test</scope>
</dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca.kernel</groupId>
+ <artifactId>tuscany-api</artifactId>
+ <version>${sca.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
</dependencies>
<build>
@@ -82,6 +90,7 @@
</resource>
</resources>
<plugins>
+
<plugin>
<groupId>org.apache.tuscany.sdo</groupId>
<artifactId>tuscany-sdo-plugin</artifactId>
@@ -114,7 +123,6 @@
</execution>
</executions>
</plugin>
-
<plugin>
<groupId>org.apache.tuscany.sca.plugins</groupId>
<artifactId>tuscany-war-plugin</artifactId>
Modified:
incubator/tuscany/java/sca/tools/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/JavaInterfaceEmitter.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tools/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/JavaInterfaceEmitter.java?view=diff&rev=451219&r1=451218&r2=451219
==============================================================================
---
incubator/tuscany/java/sca/tools/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/JavaInterfaceEmitter.java
(original)
+++
incubator/tuscany/java/sca/tools/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/JavaInterfaceEmitter.java
Fri Sep 29 03:49:58 2006
@@ -195,7 +195,7 @@
if (!codegenConfiguration.getOutputLocation().exists()) {
codegenConfiguration.getOutputLocation().mkdirs();
}
- InterfaceWriter interfaceWriter = new
InterfaceWriter(this.codegenConfiguration
+ InterfaceWriter interfaceWriter = new
RemotableInterfaceWritter(this.codegenConfiguration
.getOutputLocation(),
this.codegenConfiguration.getOutputLanguage());
String packageName =
interfaceModel.getDocumentElement().getAttribute("package");
Added:
incubator/tuscany/java/sca/tools/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/RemotableInterfaceWritter.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tools/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/RemotableInterfaceWritter.java?view=auto&rev=451219
==============================================================================
---
incubator/tuscany/java/sca/tools/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/RemotableInterfaceWritter.java
(added)
+++
incubator/tuscany/java/sca/tools/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/RemotableInterfaceWritter.java
Fri Sep 29 03:49:58 2006
@@ -0,0 +1,51 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation or its licensors, as
applicable.
+ *
+ * Licensed 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.
+ */
+package org.apache.tuscany.tools.wsdl2java.generate;
+
+import java.io.File;
+
+import org.apache.axis2.wsdl.codegen.CodeGenerationException;
+import org.apache.axis2.wsdl.codegen.writer.InterfaceWriter;
+
+/**
+ * @author lresende
+ */
+public class RemotableInterfaceWritter extends InterfaceWriter {
+ private static final String
REMOTABLE_INTERFACE_TEMPLATE="/RemotableInterfaceTemplate.xsl";
+
+ public RemotableInterfaceWritter(String outputFileLocation) {
+ super(outputFileLocation);
+ }
+
+ public RemotableInterfaceWritter(File outputFileLocation, String language)
{
+ super(outputFileLocation, language);
+ }
+
+ /**
+ * Loads the template.
+ */
+ @Override
+ public void loadTemplate() throws CodeGenerationException {
+ // the default behavior for the class writers is to use the property
map from the languge specific types
+ // The properties are arranged in the following order
+ // <lang-name>.* .template=<write-class>,<template-name>
+
+ //overrida original behaviour to always load the template we specified
+ this.xsltStream =
this.getClass().getResourceAsStream(REMOTABLE_INTERFACE_TEMPLATE);
+
+ }
+}
Propchange:
incubator/tuscany/java/sca/tools/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/RemotableInterfaceWritter.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/tuscany/java/sca/tools/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/RemotableInterfaceWritter.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
incubator/tuscany/java/sca/tools/src/main/resources/RemotableInterfaceTemplate.xsl
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tools/src/main/resources/RemotableInterfaceTemplate.xsl?view=auto&rev=451219
==============================================================================
---
incubator/tuscany/java/sca/tools/src/main/resources/RemotableInterfaceTemplate.xsl
(added)
+++
incubator/tuscany/java/sca/tools/src/main/resources/RemotableInterfaceTemplate.xsl
Fri Sep 29 03:49:58 2006
@@ -0,0 +1,98 @@
+<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.apache.tuscany.api.annotation.DataType;
+
+ /*
+ * <xsl:value-of select="@name"/> java interface
+ */
+
+ @Remotable
+ @DataType(name="commonj.sdo.DataObject")
+ 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: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 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:if></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
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/param">
+ <xsl:if test="@type!=''">[EMAIL PROTECTED] <xsl:value-of
select="@name"></xsl:value-of><xsl:text>
+ </xsl:text></xsl:if></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 java.rmi.RemoteException;
+
+ </xsl:if>
+ </xsl:for-each>
+
+ <!-- Apply other templates -->
+ //<xsl:apply-templates/>
+ }
+
+
+ </xsl:template>
+ </xsl:stylesheet>
\ No newline at end of file
Modified:
incubator/tuscany/java/testing/sca/interop/clients/webserviceInteropDoc/src/main/resources/wsdl/interopdoc.wsdl
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/interop/clients/webserviceInteropDoc/src/main/resources/wsdl/interopdoc.wsdl?view=diff&rev=451219&r1=451218&r2=451219
==============================================================================
---
incubator/tuscany/java/testing/sca/interop/clients/webserviceInteropDoc/src/main/resources/wsdl/interopdoc.wsdl
(original)
+++
incubator/tuscany/java/testing/sca/interop/clients/webserviceInteropDoc/src/main/resources/wsdl/interopdoc.wsdl
Fri Sep 29 03:49:58 2006
@@ -170,6 +170,9 @@
<port name="interopDocPort" binding="tns:doc_test_binding">
<soap:address
location="http://www.whitemesa.net/interopdoc"/>
+ <!-- soap:address
location="http://mssoapinterop.org/asmx/simple.asmx"/ -->
+ <!-- soap:address
location="http://easysoap.sourceforge.net/cgi-bin/interopserver"/ -->
+ <!-- soap:address
location="http://www.mssoapinterop.org/remoting/ServiceAllTypes.soap"/ -->
<http-conf:client
xmlns:http-conf="http://celtix.objectweb.org/transports/http/configuration"
AllowChunking="false"/>
</port>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]