Maven plug-in for WSDL2Java
The preceding code is used to create the server side code from wsdl file. If you are familiar with maven, you could realize this project is actually used a sub module of its parent module. In your parent pom file, you should have something like this
Preparing for deployment with AXIS server
You can check the Using Maven instruction to find out how to generate the web service artifact. Please also be aware of version matching for the plug-ins used for the two projects, ie Axis1.4 and Axis1.2?
Modify the web.xml file in the WEB-INF directory
Copy the HibernateSoapBindingImpl.java to the source folder and deploy.wsdd to the WEB-INF directory. You can change the name of HibernateSoapBindingImpl.java if you want.
Deploying web service with AXIS
Run the installation and deploy it onto the server. Once it is done, we need to deploy the web service with AXIS. To do that we need to run the AdminClient with deploy.wsdd file at client side. Deploy.wsdd file is deployment descriptor we want to tell Axis about. The Axis Administration Web Service lets the AdminClient program and its Ant task counterpart submit a new WSDD file for interpretation. The Axis ‘engine’ will update its configuration, then save its state. By default Axis saves it state into the global configuration file axis/WEB-INF/server-config.wsdd.
- server-config.wsdd is the configuration file of the Axis Server. It contains the description of all the web services that are deployed on your server (+ some other configuration data).
- deploy.wsdd is generated at the same time as your stubs when you use java2wsdl. deploy.wsdd is used by the deployment tool to deploy the given service. Once your service is deployed, you no longer need this file.
For convenience, we need to setup the classpath to run the AdminClient. You need to add all the libraries into the classpath, ie
set classpath= C:\axis\axis-1_4\lib\activation.jar;C:\axis\axis-1_4\lib\axis.jar;C:\axis\axis-1_4\lib\axis-ant.jar;C:\axis\axis-1_4\lib\commons-discovery-0.2.jar;C:\axis\axis-1_4\lib\commons-logging-1.0.4.jar;C:\axis\axis-1_4\lib\jaxrpc.jar;C:\axis\axis-1_4\lib\log4j-1.2.8.jar;C:\axis\axis-1_4\lib\saaj.jar;C:\axis\axis-1_4\lib\wsdl4j-1.5.1.jar;
Please be aware that there is no space allowed between to two values. To store this information permanently in WinNT/2000/XP you will need to right click on "My Computer" and select "Properties". Click the "Advanced" tab and create the new environmental variables. It is often better to use WordPad to create the variable string and then paste it into the appropriate text field.
Once the classpath being set, you can call the AdminClient class to deploy the web service
You have to make sure the directory you are calling the following command contains the file deploy.wsdd. If you are not in this directory you will get a "java.io.FileNotFoundException: deploy.wsdd (The system cannot find the file specified)" exception.
This will create server-config.wsdd file in the WEB-INF and deploy the web service to the server. For further deployment, you can just copy the server-config.wsdd file to WEB-INF folder in your development directory before you wrap the project to the war file.
Using http://localhost:8080/hibernatews/services/Hibernate to check whether your web service is up running.