How to write a jSeduite Web Service

Building a Web Service using the JAx-WS framework is not such a big deal.

But, to ensure that the service can be included inside the jSeduite service pool, you must follow a set of guidelines and then make jSeduite maintainer's life easier (and it's not such a big deal too LOL ).

$JSEDUITE_HOME refers to the folder where you've checkout–ed the SVN repository content.

Netbeans Project Creation

Web Service Creation

If you wan to save a lot of time (and make Netbeans more reactive), deactivate the auto-deploy silly mechanism:

Interface Creation

Here is an example of such an operation:

/** Log an error inside the system
 * @param trigger Name of the orchestration where the error was catched
 * @param level log level [eg SEVERE, INFO, WARNING, FATAL, ...)
 * @param message the content of the error message
 */
@WebMethod(operationName = "log")
@Oneway
public void log(@WebParam(name = "trigger") String trigger,
                @WebParam(name = "level") String level,
                @WebParam(name = "message") String message) {
  // Your code goes here ...
}

Business Object

If the web service use a complex data model, this model must be defined as a simple Java class as JAX-WS will manipulate simple POJO.

Warning: Be careful on the name you give to your business object class …

Librairies

Database connectivity

Database usage MUST be handled trough the DatabaseConnection library.

import fr.unice.i3s.modalis.jSeduite.libraries.mysql.*;

Third Party

Database Scheme

If the web service use the database as persistent back-end, you'll have to describe the table creation process in a SQL file.

Collaborative Environment

SVN Repository

Documentation

Contract Extraction

You'll have to add the WSDL contracts (and its XSD datamodel) into the global contracts repository.

To perform such a job, you can use the add_contract.sh bash script :

mosser@asmodeus:~/repositories/jseduite/architecture$ ./add_contract.sh http://localhost:8080/jSeduite/PartnerKeys/PartnerKeysService     
# Retrieving remote files
20:37:09 URL:http://localhost:8080/jSeduite/PartnerKeys/PartnerKeysService?wsdl [2183/2183] -> "/tmp/add_contract.sh.XXXXXX.gQE41Waa" [1]
20:37:09 URL:http://localhost:8080/jSeduite/PartnerKeys/PartnerKeysService?xsd=1 [1076/1076] -> "/tmp/add_contract.sh.XXXXXX.Z37DPqk6" [1]
# Formatting  XSD file
contracts/PartnerKeysService.xsd: XML document text
# Replacing schemaLocation attribute in WSDL file
# Formating WSDL file
contracts/PartnerKeysService.wsdl: XML document text

Architectural Description

The jSeduite Architectural Description Tool allows formal techniques to be used over the global architecture.

Enhance the $JSEDUITE_HOME/architecture/description/jSeduite.pl description using this tools to take care of your new service.

Wiki Description

Official Download creation

jSeduite Admin Only

Releasing Process

You cannot re-copy a folder into the release one. If you absolutely need to perform a new release with same version number, you'll have to delete the old one before using the following command line:

mosser@asmodeus:~/repositories/jSeduite$ svn delete https://jseduite.googlecode.com/svn/releases/X.y/webservices/ServiceName

To create a new release folder, use the usual svn mkdir command from the command line:

mosser@asmodeus:~/repositories/jSeduite$ svn mkdir --parents https://jseduite.googlecode.com/svn/releases/X.y/webservices