Menu
- General Information
- Architecture :
- Services & Processes
- CookBooks
- Deployment
- Bundled Applications
- Source Code :
- Third-Party Setup :
- Polytech Staff Area :
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
).
$JSEDUITE_HOME refers to the folder where you've checkout–ed the SVN repository content.
Java Web category, and then the Web Application project type.Name to your service name (without the Service postfix)$JSEDUITE_HOME/webservices as Project LocationUse dedicated folder for storing librairies boxNextServerContext Path to /jSeduite/ProjectName instead of /ProjectNameFinish as we're not going to use any built-in framework. New / Web ServicePackage: provider.jSeduite.technical.categoryfr.unice.i3s.modalis.jSeduite.technical.image.picasa package to represent a service published by modalis.i3s.unice.fr which deals with image category and more precisely picasa concept. Finish.
If you wan to save a lot of time (and make Netbeans more reactive), deactivate the auto-deploy silly mechanism:
PropertiesRun node in the left panelDeploy on save check box. 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 ... }
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.
Source Packages nodeNew / Java ClassprivateWarning: Be careful on the name you give to your business object class …
Log data class if you're defining a log(…) operation.Database usage MUST be handled trough the DatabaseConnection library.
Library node.Add Project.$JSEDUITE_HOME/librairies directoryDatabaseConnection project (java cup)dist/DatabaseConnection.jar file is highlighted on the right panelAdd Project Jar Files button to create the link. import statement inside your service code: import fr.unice.i3s.modalis.jSeduite.libraries.mysql.*;
Add JAR/ Folder menu item.jar file using the file chooser panelCopy to Librairies Folder radio buttonChoose button.If the web service use the database as persistent back-end, you'll have to describe the table creation process in a SQL file.
$JSEDUITE_HOME/librairies/DatabaseSchemas projectNew SQL File using ServiceName as file name inside the Schemas folder.sql extension is automatically added DROP TABLE IS EXISTS statement before describing a new relation.ServiceName_init file inside the Data package.Subversion menu item, and then CommitCommit buttonYou'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
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.
:services:ws namespacejar file in the $JSEDUITE_HOME/webservices/ServiceName/dist folderServiceName-vX.y.war (X and y as for the releasing process)New Download inside the GoogleCode interfaceServiceName X.y ServiceType-WebService & Since-M.n where M.n is the current jSeduite releasesubmit file to upload the War file.Subversion / Copy ToRemote folder instead of the Local one.Repository Location using the following scheme: releases/X.y/webservices/ServiceNameX is the major version numbery is the revision number inside this version.Copy Description: Service Name X.y releaseCopy buttonYou 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