Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "SCA Java support in STP"

(SCDL Editing)
(Introduction)
 
(21 intermediate revisions by one other user not shown)
Line 1: Line 1:
 
This wiki page is used to explain the current SCA Java support in STP Service Creation project.
 
This wiki page is used to explain the current SCA Java support in STP Service Creation project.
  
It's just draft version, please give your valuable feedback to help us to improve it in the next milestone.
+
It's just a draft version, please give your valuable feedback to help us improving in the next milestone.
  
 
Thanks
 
Thanks
Line 12: Line 12:
  
 
   * Project wizard to help user to create sca java component
 
   * Project wizard to help user to create sca java component
   * Fasttrack wizard to generate default.scdl and java empty interface/impl class
+
   * Fasttrack wizard to generate default.composite and java empty interface/impl class
 
   * SCDL Editor. which is indeed the WST XML Editor with sca.xsd loaded
 
   * SCDL Editor. which is indeed the WST XML Editor with sca.xsd loaded
 
   * SCA and tuscany annotations editing support.
 
   * SCA and tuscany annotations editing support.
 
   * launch configuration to run & debug sca java component with Eclipse.
 
   * launch configuration to run & debug sca java component with Eclipse.
   * Integrated with Tuscany Java2Wsdl tool -sca-java-1.0-M2 release
+
   * Integrated with Tuscany Java2Wsdl tool - apache-tuscany-sca-0.91-incubating release
  
 
Runtime/Spec info:
 
Runtime/Spec info:
  
   * SCA java impl v0.95
+
   * SCA java impl v1.00
   * SCA Assemble model v0.96
+
   * SCA Assemble model v1.00
   * Tuscany-sca-java-1.0-M2 release
+
   * apache-tuscany-sca-0.91-incubating release
  
 
== Setup Eclipse Plugins ==
 
== Setup Eclipse Plugins ==
Line 29: Line 29:
 
* Eclipse SDK 3.2
 
* Eclipse SDK 3.2
 
* STP Plugins http://download.eclipse.org/stp/committers/
 
* STP Plugins http://download.eclipse.org/stp/committers/
* Apache Tuscany plugin  http://www.eclipse.org/stp/plugins/tuscany-eclipse-plugin-1.0-incubator-M2.zip
+
* Apache Tuscany plugin  http://www.eclipse.org/stp/sc/plugins/tuscany-eclipse-plugin-1.0-incubator-M2.zip
* Apache CXF Plugin  http://people.apache.org/repo/m2-snapshot-repository/org/apache/cxf/cxf-eclipse-plugin/2.0-incubator-RC-SNAPSHOT
+
* Apache CXF Plugin  http://www.eclipse.org/stp/sc/plugins/cxf-eclipse-plugin-2.0-incubator-M1-SNAPSHOT.zip
 
* Eclipse WST
 
* Eclipse WST
 
* Eclipse DTP
 
* Eclipse DTP
 
* Eclipse EMF
 
* Eclipse EMF
 
* Eclipse GEF
 
* Eclipse GEF
{| style="width:25%; height:200px" border="1"
 
| STP Plugins
 
| http://download.eclipse.org/stp/committers/
 
|-
 
| Apache Tuscany plugin
 
| http://www.eclipse.org/stp/plugins/tuscany-eclipse-plugin-1.0-incubator-M2.zip
 
|}
 
  
  
Line 50: Line 43:
 
== Creating SCA Java Component using STP Service Creation and Tuscany ==
 
== Creating SCA Java Component using STP Service Creation and Tuscany ==
 
=== Creating SCA Java component project ===
 
=== Creating SCA Java component project ===
 +
==== Project Wizard ====
 +
 +
[[Image:Sca_project_wizard.JPG]]
 +
 +
==== SCA Fasttrack ====
 +
 +
From this fasttrak page, We will generate scdl file, Manifest file, empty Java class with @Service annotation for uesr to get started.
 +
 +
[[Image:Sca_fasttrack.JPG]]
 +
 +
==== WebService Binding ====
 +
 +
[[Image:Sca_ws_binding.JPG]]
 +
 +
==== RMI Binding ====
 +
 +
[[Image:Sca_rmi_binding.JPG]]
 +
 +
==== project structure ====
 +
The SCA Java project has been created with following folders structure
 +
 +
{| style="width:25%; height:200px" border="1"
 +
| /bin
 +
| The build output jar file.
 +
|-
 +
| /classes
 +
| compile result
 +
|-
 +
| /META-INF/sca
 +
| holding the SCDL file for this component
 +
|-
 +
| /src
 +
| Java Source code
 +
|-
 +
| /WSDL
 +
| The WSDL file will be generated here by Tuscany J2W if it is WS binding
 +
|}
 +
 +
 +
[[Image:Sca_project_folders.JPG]]
 +
 
=== SCDL Editing ===
 
=== SCDL Editing ===
 
The SCDL Editing is provided by customizing the standard XML Editor as following:
 
The SCDL Editing is provided by customizing the standard XML Editor as following:
 
*Register SCDL file as XML content type
 
*Register SCDL file as XML content type
 
*Register sca.xsd to schema validator  
 
*Register sca.xsd to schema validator  
Design View of the SCDL Editor [[Image:Sca_scdleditor_designview.JPG]]
+
Design View of the SCDL Editor  
  
Source View of the SCDL Editor [[Image:Sca_scdleditor_sourceview.JPG]]
+
  [[Image:Sca_scdleditor_designview.JPG]]
 +
 
 +
Source View of the SCDL Editor  
 +
 
 +
  [[Image:Sca_scdleditor_sourceview.JPG]]
  
 
You will got error message from schema validator for the generated scdl file. Please leave it for now, since those default.scdl comes with
 
You will got error message from schema validator for the generated scdl file. Please leave it for now, since those default.scdl comes with
Line 78: Line 116:
  
 
=== WSDL Editor ===
 
=== WSDL Editor ===
 +
Directly use WST WSDL Editor here.
 +
 
=== Generating Jar file ===
 
=== Generating Jar file ===
 +
I created a JarBuilder to automatically package all classes, scdl and wsdl files into one single jar file, and put it under /Project/bin.
 +
 
=== Run the SCA Java component ===
 
=== Run the SCA Java component ===
 +
The java launch configuration will be created for user to run & debug the SCA component within Eclipse.
 +
In the launch config:
 +
* Set mainclass to "org.apache.tuscany.launcher.MainLauncherBooter".
 +
* Set program args to the jar file of the component.
 +
* Set vmargs to "-Dtuscany.installDir=kit_dir_from_perference"
 +
 +
 +
I plan to add '-Doffline=true' flag in the launch configuration and preference page later.
 +
 +
[[Image:Sca_run_java.JPG]]
 +
 +
Notice: You will get error when try to run the webservice binding component in this release. the RMI binding works fine
 +
 
=== Create client project ===
 
=== Create client project ===
 +
For WebService binding component, you can use Eclipse WTP to generate the client
 +
File->New->Others..->WebService->WebService Client
 +
 
=== Deploy to tomcat container ===
 
=== Deploy to tomcat container ===
 +
'''TBD'''
 +
 
== Todo list ==
 
== Todo list ==
 +
'''TBD'''
 +
 
== References ==
 
== References ==
 +
*Apache Tuscany project http://incubator.apache.org/tuscany/
 +
*SCA & SDO spec http://www.osoa.org/display/Main/Home
 +
*Eclipse STP project http://www.eclipse.org/stp/

Latest revision as of 04:14, 30 August 2007

This wiki page is used to explain the current SCA Java support in STP Service Creation project.

It's just a draft version, please give your valuable feedback to help us improving in the next milestone.

Thanks

Johnson Ma (Jan 24, 2007)

Introduction

We just added SCA Java support in STP service creation project. It allows user to create/debug SCA component within Eclipse by providing following functions:

  * Project wizard to help user to create sca java component
  * Fasttrack wizard to generate default.composite and java empty interface/impl class
  * SCDL Editor. which is indeed the WST XML Editor with sca.xsd loaded
  * SCA and tuscany annotations editing support.
  * launch configuration to run & debug sca java component with Eclipse.
  * Integrated with Tuscany Java2Wsdl tool - apache-tuscany-sca-0.91-incubating release

Runtime/Spec info:

  * SCA java impl v1.00
  * SCA Assemble model v1.00
  * apache-tuscany-sca-0.91-incubating release

Setup Eclipse Plugins

The STP does not have update site yet. So we need to setup the Eclipse env manually. Please download and install the following plugins:


Please set the Tuscany kit location in preference page as the image below before do any SCA related work.

Sca preferences.JPG

Creating SCA Java Component using STP Service Creation and Tuscany

Creating SCA Java component project

Project Wizard

Sca project wizard.JPG

SCA Fasttrack

From this fasttrak page, We will generate scdl file, Manifest file, empty Java class with @Service annotation for uesr to get started.

Sca fasttrack.JPG

WebService Binding

Sca ws binding.JPG

RMI Binding

Sca rmi binding.JPG

project structure

The SCA Java project has been created with following folders structure

/bin The build output jar file.
/classes compile result
/META-INF/sca holding the SCDL file for this component
/src Java Source code
/WSDL The WSDL file will be generated here by Tuscany J2W if it is WS binding


Sca project folders.JPG

SCDL Editing

The SCDL Editing is provided by customizing the standard XML Editor as following:

  • Register SCDL file as XML content type
  • Register sca.xsd to schema validator

Design View of the SCDL Editor

 Sca scdleditor designview.JPG

Source View of the SCDL Editor

 Sca scdleditor sourceview.JPG

You will got error message from schema validator for the generated scdl file. Please leave it for now, since those default.scdl comes with Tuscany1.0 M2 examples also have same problem.

SCA annotation editing

The SCA and Tuscany annotations are supported by extending the annotation editing framework in STP. In the java source editor, once you select java class, method or field, we will show the applicable annotations in the Annotation Properties View. Then you can add appreciate annotation from there. Notice: the sca annotation validation rules hasn't been setup yet. It will be provided in the next milestone

Sca annotation properties view.JPG

Generating WSDL

The Tuscany Java2wsdl tool has been integrated as an incremental builder, which is linking to java interface class with @Service annotation. For our example, the HelloWorld.wsdl will be automatically generated every time user modify the HelloWorld interface class. The current J2W option has been set according to those values defined in default.scdl file :

* service name ("-sn") = JavaInterfaceName + "Service"
* soap address ("-l") = "http://localhost:8080/service/"
 

Later on, We will provide preference/project properties to configure all J2W options including style, use, target namespace and output WSDL file name...etc

WSDL Editor

Directly use WST WSDL Editor here.

Generating Jar file

I created a JarBuilder to automatically package all classes, scdl and wsdl files into one single jar file, and put it under /Project/bin.

Run the SCA Java component

The java launch configuration will be created for user to run & debug the SCA component within Eclipse. In the launch config:

  • Set mainclass to "org.apache.tuscany.launcher.MainLauncherBooter".
  • Set program args to the jar file of the component.
  • Set vmargs to "-Dtuscany.installDir=kit_dir_from_perference"


I plan to add '-Doffline=true' flag in the launch configuration and preference page later.

Sca run java.JPG

Notice: You will get error when try to run the webservice binding component in this release. the RMI binding works fine

Create client project

For WebService binding component, you can use Eclipse WTP to generate the client File->New->Others..->WebService->WebService Client

Deploy to tomcat container

TBD

Todo list

TBD

References

Back to the top