Below is the directory structure that's required to get started. The lib directory holds all of the required WebLogic jar files, the src directory contains the source code. It is possible to point the build system to your local WebLogic install by changing the wlslibs path in the build-base.xml file; personally I like to have these in a separate directory and to have just the JARs that I need. The build and dist directories are not strictly required as they are created during build. The final EAR file will be in the dist directory.
I define all of the properties in a separate properties file. This specifies the WLS admin URL, target server, username and password, the directory locations and the web service details such as its name, context path, the JWS source file and whether to keep the generated Java source code or not. Since jwsc is used, the serviceURI is set to the value of serviceName attribute on the @WebService annotation and hence not defined here.
The following file is used to create the WebLogic classpath and to define the jwsc and wldeploy tasks. It also loads the properties file. I find it more logical to separate this into a different build file, although it can be included in the main build.xml file if preferred. This build file cannot be used on its own, so the default target fails the build if it's invoked directly.
This is the main build.xml file, it imports the build-base.xml and defines all of the required targets. The default target is 'all', which will clean, build and deploy the web service. The build-service target uses jwsc to compile the JWS file and package it into a WAR file. This is followed by packaging it into an EAR file ready for deployment. The deploy-service target will attempt to undeploy the web service first (no failure on error) and then to deploy it.
That's all there is to it, this doesn't show how to add additional deployment descriptors to the build or how to package extra libraries, that will be covered in other blog posts in the future.
-i