This guide describes what can be done after you check out the full Soaplab module from the CVS. All tasks described here are invoked using the Java's wonderful tool Ant (which is part of the CVS Soaplab module - you do not need to download anything else). Usually, the Ant tasks are meant for developers who make changes in the source code. It is true also for Soaplab. But additionally to these tasks, the Soaplab module includes also tasks for creating and deploying Soaplab-based web services. These task are well suited for testing new Web services. As explained already in the README file you can use either build.sh (or build.bat for Windoze), or build-dev.sh (or build-dev.bat). Because usually you use the latter, the examples below use the -dev form. Just remember that
Why not just to type ant as usual? Because it would invoke your own Ant - which may be of a different version than the Ant used by Soaplab, and because it does not have one or two additional tasks that Soaplab's Ant has. Be aware that from the same reason the building scripts do not use the environment variable ANT_HOME even if it is set.Be also aware that some tasks (especially those generating metadata for new services) use Perl scripts and that they would work almost certainly only under Unix. They may work with Cygwin under Windoze but I have not tried it. You may also influence the building by setting various properties. The easiest way is to create file build.properties either directly in the soaplab directory, or in your home directory. You can use provided build.properties.template as a template. This build.properties.template file has details what properties can be set and what they mean. Usually, however, the only properties you may need to set, are: and very recommended one (if you have installed jikes on your machine):catalina.home = /where/is/your/tomcat jdbc.passwd = what is your password to local MySQL database General rules about properties used by Ant are:build.compiler = jikes
And finally, here is what can be done:
The normal build tasks are:
The summary is that after checking out the Soaplab CVS module you should gather all third-party libraries and compile everything by: ./build.shAnd that would be enough to invoke Soaplab's command-line clients (whose scripts are in the run subdirectory). At this moment, however, these clients can be used only to access Soaplab services running elsewhere. Your own services have not yet been deployed. Before going to explain how to do that let's talk briefly about how to build various distributions. You need these tasks if you wish to pack Soaplab files into a tarred package that can be used independently on the Soaplab CVS module. One reason for doing it is to have a separate space where you can put all your Soaplab services and use them on a production level - without being mixed with the latest changes that may happen in the CVS module itself. The binary distribution has also a nice feature that you can add your and third-party services to it as they come - you do not need to create and install your binary distribution again and again from the scratch.
Binary distributionThe binary distribution contains all necessary files, plus a small number of testing services (both AppLab-based and Gowlab-based). It will be created in the doc/dist directory by typing:./build-dev.sh dist-binaryBe aware this tasks uses Perl in order to generate metadata for the testing services. By default, it includes the following AppLab services: helloworld dotand the following Gowlab services: emblsrs helloworld medlinesrs yeastgrid echoYou can change this by setting different names in the space separated lists in the properties aa (for AppLab services) and/or ga (for Gowlab services). The corresponding ACD files for such services must be found in the src/etc/acd/applab and/or src/etc/acd/gowlab. For example, assuming you have created src/etc/acd/applab/bigdeal.acd, src/etc/acd/applab/biggerdeal.acd, and src/etc/acd/gowlab/favorite.acd files, you can create a binary distribution just with these three services by typing: ./build-dev.sh '-Daa=bigdeal biggerdeal' -Dga=favorite dist-binary Once you have a binary distribution, you can move it somewhere, unpack it, run the installation script (which is included in the binary distribution) and deploy included services to your Tomcat engine. The details how to install and use the binary distribution are here. Note that instead of packing it yourself you can also download a ready binary distribution from the main Soaplab distribution site. So when should I use my own binary distribution? When you have made some changes in Soaplab, or when you have applied patches provided by someone else - but the official binary distribution is still not available. Obviously this task is meant primarily for the developers of the Soaplab core that are involved in new releases. A service set distributionOne of the advantages of Soaplab is its uniformity how to access different tools and web resources. This uniformity allows to keep separately the Soaplab core that does not change often, and metadata (and other supporting files) for individual services. Because the metadata are site-independent (meaning that they do not, or should not, contain any site-specific locations or paths) they can be shared and re-used by other service providers, too.Note, however, that this is about sharing metadata, not the services themselves. For Gowlab-based services, it is sufficient, but for the AppLab-based services you need to have also the command-line analysis tools that will be invoked by Soaplab/AppLab and that will do the real job. This task can create such site-independent package. A service set distribution is a package containing files related to a set of services (such as services metadata and additional plug-in classes written particularly for these services) - but without the Soaplab core files. This allows to have relatively small packages - that are independent on the latest changes in Soaplab core classes - and that can be shared by Soaplab services providers. For already existing packages check the contrib subdirectory of the Soaplab main distribution site. If you wish to put there your own service sets please contact me. In order to use such service set you need to have installed somewhere a Soaplab binary distribution, and then you merge the service set with that binary distribution. You can add many service sets into one binary distribution. Well, the expression "into one binary distribution" is not precise. You are not merging a service set into a tarred binary distribution, but you are merging into directories where the binary distribution had been unpacked and installed.Of course, in order to create a service set you need to have some services. Which means you need to create first some ACD files describing new services. This image explains the relationship between binary and CVS distributions: Now let's have a look how to invoke this task and how to tell which services should be included in the resulting package. The basic typing is: ./build-dev.sh dist-servicesYou can tune what services will be included in the package, how to name them, etc., by setting various properties before invoking this task. As always with Ant, you can do it directly on the command line, using -Dname=value syntax, or you can first put the properties into build.properties file where Ant reads them from. The more important properties are:
The created package will contain:
If you are interested in more details about the contents and structure of the created package check the description in script utils/add-services.pl. Having such package, you can go to the next step which is to merge new services with the existing ones. This is done, as shown in the picture above, in the place where you have installed the binary distribution. Go to the Binary distribution Guide to find how to do it. You will find there that it is done by invoking a single script that does everything for you: cd .../analysis-interfaces ws/add-services <file-with-set-of-new-services> Distribution of EMBOSS servicesA slightly special case of a service set is the set of all EMBOSS applications. Because of the EMBOSS's prominent place in Soaplab project there is a specialized Ant task for it:./build-dev.sh emboss-dist-servicesThis task requires the emboss.home property - pointing to a directory where your local EMBOSS is installed (and where this task gets all the ACD files for EMBOSS tools). If not set the default value /usr/local/emboss will be used (which may not be what you wish). Once you create a package with EMBOSS services, however, everything is the same as with other packages. You deploy it again using ws/add-services in the binary distribution.
Only-clients distributionThe result of this distribution is a set of files needed for invoking Soaplab services. The details how to use it (which is quite straightforward) are in the accompanied (included) README file.
This is the only distribution that has been tested to work also under Windoze.Type: ./build-dev.sh dist-clientsThe result will appear in the docs/dist directory. The tasks in this group need to cooperate with your Tomcat engine. They will create services metadata, generate services supporting classes, compile them, and deploy services. I have used it only with Tomcat and Axis - but it may work with other servlet engines as well. Whenever Tomcat gets new classes (or deployed services) it must be told about it. How to tell, it depends on the Tomcat version: in all versions restarting the Tomcat works fine. Therefore, some tasks will ask you to restart your Tomcat. For versions 5 and up, you may use, however, a less drastic way, because there is a Tomcat Manager interface to help. So if you use such manager, just do what should be done with the manager when a task asks for restarting. It is generally wise to know what is happening "under the hood" when deploying services. Here are few tips:
Now, let's examine how to add new services. Note that the tasks described here are just doing what is explained in details in a the Binary distribution Guide. Create a new ACD file (or files) in src/etc/acd/applab or in src/etc/acd/gowlab, and type: ./build-dev.sh gowlab ./build-dev.sh applab ./build-dev.sh api-derivedThe first invocation creates and deploys all Gowlab services, the second does the same for the AppLab services, and the last one creates an API for all derived services. If you wish to limit what ACD files (e.g. what services) to deploy, use properties aa and ga. For example: ./build-dev.sh -Dga=newgowlabservice gowlab ./build-dev.sh -Daa=newapplabservice applabYou will notice that the tasks above invoke a lot of sub-tasks. Sometimes it may be useful to call some of them independently:
./build-dev.sh gen-applab ./build-dev.sh gen-gowlab ./build-dev.sh gen-allThese tasks generate XML metadata from the ACD files. It is useful to use it when you are in the process of creating ACD files and you want to be sure that they are syntactically correct before proceeding on.
In the previous section you have learned how to create everything for a set of services, including derived services and their deployment to a Tomcat engine. But sometimes you need just to update API documentation of the derived services, but not to touch their deployment. Use create-derived task. For example, for a set of AppLab and Gowlab services that are always part of any Soaplab distribution you can invoke: ./build-dev.sh -Daa='helloworld dot' \ -Dga='emblsrs helloworld medlinesrs yeastgrid echo' \ create-derivedThe Soaplab can use a mySQL database for keeping results of the analysis tools. The details how to set up such database are described in a Binary distribution Guide. The same can be achieved, however, by the create-database task: ./build-dev.sh create-databaseThe task will first warn you that all current data in an existing local database will be removed if you continue, and it will give you a chance to abort the task. The documentation for Perl Soaplab client can be re-generated by typing: ./build-dev.sh perldoc
Martin Senger
Last modified: Thu Mar 3 21:29:01 2005 |