Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
STP Service Creation User Guide
Contents
- 1 Installation
- 2 Example
- 3 Create service component
- 3.1 Create JAX-WS component
- 3.1.1 Concepts
- 3.1.2 Tasks
- 3.1.2.1 Overview
- 3.1.2.2 Create service component from java interface
- 3.1.2.3 Create service component from wsdl
- 3.1.2.4 Add JAX-WS handler
- 3.1.2.5 Use the annotation property view
- 3.1.2.6 Add JAX-WS functions to existing eclipse project
- 3.1.2.7 Generate code from wsdl file
- 3.1.2.8 Annotation validation
- 3.1.2.9 Edit the wsdl document
- 3.1.2.10 Create simple frontend for Apache CXF
- 3.2 Create RESTful service (TBD)
- 3.3 Create JBI component (TBD)
- 3.4 Create SCA component (TBD)
- 3.1 Create JAX-WS component
- 4 Package and deploy service component
- 5 Test and debug your component
- 6 Report bug/Get help
Installation
Install from update site
This kind of installation downloads STP plugins, and plugins required from other Eclipse projects automatically.
Download from STP website
The latest STP 0.7.0 build can be downloaded from here
Plugins required from other Eclipse projects
*emf-sdo-xsd-SDK-2.3.0 *GEF-ALL-3.3 *JEM-SDK-1.2.3_jem *wtp-sdk-S-2.0 *GMF-sdk-2.0 *mdt-ocl-SDK-1.1 *emf-validation-SDK-1.1 *emf-query-SDK-1.1 *emf-transaction-SDK-1.1 *javax.wsdl 1.5.1
Install to eclipse
Extract all required plugins to the STP Installation directory
Install runtime
Select one of the following as Pre-requisite SOA runtime:
- JAX-WS runtime: Apache CXF 2.1 SNAPSHOT, or Sun JAX-WS RI
- SCA runtime: Apache Tuscany SCA Java 1.0
- Apache Tomcat (Install only if you want to deploy the generated service to Tomcat Container)
In order to deploy JAX-WS service to Tomcat container, please copy all jars under ${apache_cxf_install}/libs and ${apache_cxf_install}/modules into ${tomcat_install}/shared/lib
Example
Create service component
Create JAX-WS component
Concepts
JAX-WS
The Java API for XML Web Services (JAX-WS) specification defines a set of APIs and annotations for developing Web services. It makes extensive use of the annotations introduced in Java 5.0. These annotations make it easier to map a Java object to a service and map a WSDL contract to a Java object.
Related information
Annotations
Annotations are a way of adding metadata to Java source code that is available to the programmer at runtime.
They play a critical role in JAX-WS, where they are used to map Java to WSDL and XML Schema, and to control how the JAX-WS runtime processes and responds to web service invocations.
When you create a JAX-WS Java First project, you need to add JAX-WS annotations to your starting point code, in order to have Eclipse automatically generate the required WSDL and stub code for your web service.
You can add annotations to types, methods, and parameters. Each method that is public within the Java class must include a @WebRequest annotation, while each types requires a @WebService annotation.
You can add annotations to your Java code using the JAX-WS menu and further refine your annotations in the Annotation Properties view.
When you create a WSDL First project, annotated code is generated for you automatically.
Related information
JAX-WS Annotations specification
Annotation Properties view
The Annotation Properties view allows you to edit the JAX-WS annotations in your Java code.
To open the Annotation Properties view, select Window > Show View > Other ... > STP > Annotation Properties.
As you move through the types, methods, and parameters in your Java code in either the Editor view or the Package Explorer, the Annotation Properties view changes to display the annotations that are possible for a particular element.
To add an annotation, select true in the Value column.
Click the + icon next to the annotation to display the attributes associated with it.
Supported annotations
The following annotations are supported in the Eclipse STP Annotation Properties editor:
JSR 181
javax.jws.WebService
javax.jws.WebMethod
javax.jws.Oneway
javax.jws.WebParam
javax.jws.WebResult
javax.jws.HandlerChain
javax.jws.soap.SOAPBinding
javax.jws.soap.SOAPMessageHandlers
JAX-WS 2.0
javax.xml.ws.ServiceMode
javax.xml.ws.WebFault
javax.xml.ws.RequestWrapper
javax.xml.ws.ResponseWrapper
javax.xml.ws.WebServiceClient
javax.xml.ws.WebEndpoint
javax.xml.ws.WebServiceProvider
javax.xml.ws.BindingType
javax.xml.ws.WebServiceRef
javax.xml.ws.WebServiceRefs
SCA 0.95
org.osoa.sca.annotations.AnnotationSupport
org.osoa.sca.annotations.Callback
org.osoa.sca.annotations.ComponentName
org.osoa.sca.annotations.Constructor
org.osoa.sca.annotations.Context
org.osoa.sca.annotations.Destroy
org.osoa.sca.annotations.Init
org.osoa.sca.annotations.OneWay
org.osoa.sca.annotations.Property
org.osoa.sca.annotations.Reference
org.osoa.sca.annotations.Remotable
org.osoa.sca.annotations.Scope
org.osoa.sca.annotations.Service
org.osoa.sca.annotations.Session
org.osoa.sca.annotations.SessionID
Apache Tuscany 1.0
org.apache.tuscany.api.annotation.DataType
org.apache.tuscany.api.annotation.DataContext
org.apache.tuscany.api.annotation.LogLevel
org.apache.tuscany.api.annotation.Monitor
Tasks
Overview
Creating and deploying a JAX-WS service using Eclipse STP involves the following steps:
1.Choose a JAX-WS runtime. 2.Do one of the following:
*Create a Java First project, add annotations to the code, and then generate stub code. *Create a WSDL First project. Annotated stub code is generated for you automatically.
3.Update the generated stub code as required and rebuild your project. 4.Create a connection profile. 5.Generate a deployment archive. 6.Deploy the service.
Create service component from java interface
Create service component from wsdl
Add JAX-WS handler
Use the annotation property view
Add JAX-WS functions to existing eclipse project
Generate code from wsdl file
Annotation validation
Edit the wsdl document
Double click a wsdl file from the navigator tree, you will open wsdl editor. Switch to Design Tab, you can right click to add operation or message part or Fault to wsdl file, or edit name/message part by double-clicking. In outline view, you can navigate the wsdl document tree and add/delete elements.
Create simple frontend for Apache CXF
Create RESTful service (TBD)
Create JBI component (TBD)
Create SCA component (TBD)
Package and deploy service component
Add a server
Create deployable package
Deploy component
Undeploy component
Test and debug your component
Create a test client
Use REST test client (TBD)
Debug your application
Report bug/Get help
Where to report STP bug
Where to get help
Maillist
There are two maillists:
stp-user maillist for stp users.
stp-dev maillist for stp developers.
For detail information on how to subscribe, please refer to stp-user, stp-dev
Newsgroup
STP newsgroup is used by end users to ask questions.
server: news.eclipse.org
For detail information on how to register, please refer to here