Commit a601185d authored by Nicolas Dolet's avatar Nicolas Dolet

Synchronize trunk examples with the FRASCATI_1_0_1 branch.

parent b85fd6a3
...@@ -29,21 +29,20 @@ This module gathers the server and the client. ...@@ -29,21 +29,20 @@ This module gathers the server and the client.
For running the example, open two terminals (for the server and for the client). For running the example, open two terminals (for the server and for the client).
Compilation with Maven: (for the server and the client) Compilation with Maven:
----------------------- -----------------------
mvn install mvn install
Execution with Maven: (for the server and the client) Execution with Maven:
--------------------- ---------------------
mvn -Prun 1) Open a console for the server
cd server
Compilation and execution with the FraSCAti scripts: (for the server) mvn -Prun
---------------------------------------------------- 2) Open another console for the client
frascati compile src calculator-server cd client
frascati run soap-calc -libpath calculator-server.jar mvn -Prun
Compilation and execution with the FraSCAti scripts: (for the client) Compilation and execution with the FraSCAti scripts:
---------------------------------------------------- ----------------------------------------------------
frascati wsdl2java -f src/main/wsdl/Calculator.wsdl -o src/main/java 1) Open a console and follow instructions in the 'server' directory
frascati compile src calculator-client 2) Open another console and follow instructions in the 'client' directory
frascati run calc-client -libpath calculator-client.jar -s calc -m add -p 1 2
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry kind="src" path="target/generated/src/main/java"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>calc-client</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.maven.ide.eclipse.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.maven.ide.eclipse.maven2Nature</nature>
</natures>
</projectDescription>
#Thu Jun 04 01:10:39 CEST 2009
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.source=1.5
#Thu Jun 04 01:10:37 CEST 2009
activeProfiles=
eclipse.preferences.version=1
fullBuildGoals=process-test-resources
includeModules=false
resolveWorkspaceProjects=true
resourceFilterGoals=process-resources resources\:testResources
skipCompilerPlugin=true
version=1
============================================================================
OW2 FraSCAti Examples: Calculator
Copyright (C) 2009 INRIA, USTL
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Contact: frascati@ow2.org
Author: Nicolas Dolet
============================================================================
FraSCAti Calculator Client example:
-----------------------------------
This example shows how to consume the Calculator web service exposed by the
Calculator Server example from FraSCAti.
Compilation and execution with the FraSCAti scripts:
----------------------------------------------------
frascati wsdl2java -f src/main/wsdl/Calculator.wsdl -o src/main/java
frascati compile src calculator-client
frascati run calc-client -libpath calculator-client.jar -s calc -m add -p 1 2
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
</parent> </parent>
<properties> <properties>
<wsdl.file>http://localhost:8080/Calculator?wsdl</wsdl.file> <wsdl.file>src/main/wsdl/Calculator.wsdl</wsdl.file>
<composite.file>calc-client</composite.file> <composite.file>calc-client</composite.file>
<service.name>calc</service.name> <service.name>calc</service.name>
<method.name>add</method.name> <method.name>add</method.name>
......
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="CalcService" targetNamespace="http://api.soapcalc.examples.frascati.ow2.org/" xmlns:ns1="http://schemas.xmlsoap.org/soap/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://api.soapcalc.examples.frascati.ow2.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:types>
<xsd:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://api.soapcalc.examples.frascati.ow2.org/" xmlns:tns="http://api.soapcalc.examples.frascati.ow2.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="mult" type="tns:mult"/>
<xsd:complexType name="mult">
<xsd:sequence>
<xsd:element name="arg0" type="xsd:int"/>
<xsd:element name="arg1" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="multResponse" type="tns:multResponse"/>
<xsd:complexType name="multResponse">
<xsd:sequence>
<xsd:element name="return" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="div" type="tns:div"/>
<xsd:complexType name="div">
<xsd:sequence>
<xsd:element name="arg0" type="xsd:int"/>
<xsd:element name="arg1" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="divResponse" type="tns:divResponse"/>
<xsd:complexType name="divResponse">
<xsd:sequence>
<xsd:element name="return" type="xsd:double"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="add" type="tns:add"/>
<xsd:complexType name="add">
<xsd:sequence>
<xsd:element name="arg0" type="xsd:int"/>
<xsd:element name="arg1" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="addResponse" type="tns:addResponse"/>
<xsd:complexType name="addResponse">
<xsd:sequence>
<xsd:element name="return" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="sub" type="tns:sub"/>
<xsd:complexType name="sub">
<xsd:sequence>
<xsd:element name="arg0" type="xsd:int"/>
<xsd:element name="arg1" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="subResponse" type="tns:subResponse"/>
<xsd:complexType name="subResponse">
<xsd:sequence>
<xsd:element name="return" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</wsdl:types>
<wsdl:message name="add">
<wsdl:part element="tns:add" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="div">
<wsdl:part element="tns:div" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="divResponse">
<wsdl:part element="tns:divResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="multResponse">
<wsdl:part element="tns:multResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="subResponse">
<wsdl:part element="tns:subResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="sub">
<wsdl:part element="tns:sub" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="mult">
<wsdl:part element="tns:mult" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="addResponse">
<wsdl:part element="tns:addResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="CalcServicePortType">
<wsdl:operation name="mult">
<wsdl:input message="tns:mult" name="mult">
</wsdl:input>
<wsdl:output message="tns:multResponse" name="multResponse">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="div">
<wsdl:input message="tns:div" name="div">
</wsdl:input>
<wsdl:output message="tns:divResponse" name="divResponse">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="add">
<wsdl:input message="tns:add" name="add">
</wsdl:input>
<wsdl:output message="tns:addResponse" name="addResponse">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="sub">
<wsdl:input message="tns:sub" name="sub">
</wsdl:input>
<wsdl:output message="tns:subResponse" name="subResponse">
</wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="CalcServiceSoapBinding" type="tns:CalcServicePortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="mult">
<soap:operation soapAction="" style="document"/>
<wsdl:input name="mult">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="multResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="div">
<soap:operation soapAction="" style="document"/>
<wsdl:input name="div">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="divResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="add">
<soap:operation soapAction="" style="document"/>
<wsdl:input name="add">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="addResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="sub">
<soap:operation soapAction="" style="document"/>
<wsdl:input name="sub">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="subResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="CalcService">
<wsdl:port binding="tns:CalcServiceSoapBinding" name="CalcServicePort">
<soap:address location="http://localhost:8080/Calculator"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>soap-calculator</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.maven.ide.eclipse.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.maven.ide.eclipse.maven2Nature</nature>
</natures>
</projectDescription>
#Mon May 25 17:52:38 CEST 2009
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.source=1.5
#Mon May 25 17:52:35 CEST 2009
activeProfiles=
eclipse.preferences.version=1
fullBuildGoals=process-test-resources
includeModules=false
resolveWorkspaceProjects=true
resourceFilterGoals=process-resources resources\:testResources
skipCompilerPlugin=true
version=1
============================================================================
OW2 FraSCAti Examples: Calculator
Copyright (C) 2009 INRIA, USTL
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Contact: frascati@ow2.org
Author: Nicolas Dolet
============================================================================
FraSCAti Calculator Server example:
-----------------------------------
This example shows how to expose a web service (Calculator) with FraSCAti.
Compilation and execution with the FraSCAti scripts: (for the server)
----------------------------------------------------
frascati compile src calculator-server
frascati run soap-calc -libpath calculator-server.jar
============================================================================
OW2 FraSCAti Examples: Helloworld RMI
Copyright (C) 2009 INRIA, USTL
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Contact: frascati@ow2.org
Author: Nicolas Dolet
============================================================================
HelloWorld RMI:
---------------
This example shows how to expose an SCA service in a Java RMI registry and how
to consume it with an SCA client composite.
Compilation with Maven:
-----------------------
mvn install
Execution with Maven:
---------------------
1) Open a console for the server
cd server
mvn -Prun
2) Open another console for the client
cd client
mvn -Prun
Compilation and execution with the FraSCAti scripts:
----------------------------------------------------
1) Open a console and follow instructions in the 'server' directory
2) Open another console and follow instructions in the 'client' directory
============================================================================
OW2 FraSCAti Examples: Helloworld RMI
Copyright (C) 2009 INRIA, USTL
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Contact: frascati@ow2.org
Author: Nicolas Dolet
============================================================================
HelloWorld RMI Client:
----------------------
This example shows how to consume the service exposed in a Java RMI registry by
the helloworld-rmi server example.
Compilation and execution with the FraSCAti scripts:
----------------------------------------------------
frascati compile src hello-rmi
frascati run helloworld-rmi-client -libpath hello-rmi.jar -s r -m run
<?xml version="1.0"?>
<!--
* OW2 FraSCAti Examples: Helloworld RMI
*
* Copyright (c) 2009 INRIA, USTL
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Contact: frascati@ow2.org
*
* Author: Nicolas Dolet
*
* Contributor(s):
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.ow2.frascati.examples</groupId>
<artifactId>helloworld-rmi-client</artifactId>
<version>1.0.1</version>
<packaging>jar</packaging>
<name>OW2 FraSCAti Examples: Helloworld RMI Client</name>
<parent>
<groupId>org.ow2.frascati.examples</groupId>
<artifactId>helloworld-rmi-parent</artifactId>
<version>1.0.1</version>
</parent>
<properties>
<composite.file>helloworld-rmi-client</composite.file>
<service.name>r</service.name>
<method.name>run</method.name>
<method.params>' '</method.params>
</properties>
<dependencies>
<dependency>
<groupId>org.ow2.frascati.factory</groupId>
<artifactId>frascati-factory-tools</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>
/***
* OW2 FraSCAti Assembly Factory Examples : HelloWorld
* Copyright (C) 2008 INRIA, USTL
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Contact: frascati@ow2.org
*
* Author: Damien Fournier
*/
package example.hw;
import org.osoa.sca.annotations.Init;
import org.osoa.sca.annotations.Reference;
public class ClientImpl
implements Runnable {
//--------------------------------------------------------------------------
// SCA Reference
// --------------------------------------------------------------------------
private Service s;
@Reference
public void setPrintService(Service service) {
this.s = service;
}
//--------------------------------------------------------------------------
// Default constructor
// --------------------------------------------------------------------------
public ClientImpl() {
Console.println("CLIENT created");
}
@Init
public void init() {
Console.println("CLIENT initialized");
}
//--------------------------------------------------------------------------
// Implementation of the Runnable interface
// --------------------------------------------------------------------------
public void run() {
Console.println("Call the service...");
s.print("hello world");
}
}
/***
* OW2 FraSCAti Assembly Factory Examples : HelloWorld
* Copyright (C) 2008 INRIA, USTL
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of