## Using the Ant Tasks at the Command Line

### Prerequisites:

1. Import the CXF Ant property file for the scenario being run into an Eclipse workspace before running the task from the command line by selecting File > New > Other... > Web Services > Ant Files from the top level menu.
2. Edit the CXF Ant property file and set the `scenarioType` and `initialSelection` parameters:
   - `cxf_tdjava.properties`. Ensure the scenarioType parameter is set to service and the initialSelection points to the location of your WSDL file. See Top-down CXF Web service Ant task properties file reference for additional information on setting these parameters.
   - `cxf_bujava.properties`. Ensure the scenarioType parameter is set to service and the initialSelection points to the location of your Java bean. See Bottom-up CXF Web service Ant task properties file reference for additional information on setting these parameters.
   - `cxf_client.properties`. Ensure the scenarioType parameter is set to client and the initialSelection points to the location of your WSDL file. See CXF Web service client Ant task properties file reference for additional information on setting these parameters.

To invoke the Ant tasks from the command line complete the following steps:

1. Navigate to the plugins directory of your WTP installation and extract the contents of the org.eclipse.wst.command.env plug-in.
2. In the extracted plug-in go to the ant folder. The following files should exist there:
   - wsant.bat
   - wsgen.xml
3. Copy the required CXF Ant property file that was imported in the prerequisites into the ant folder.
4. Edit the wsgen.xml file to point to the CXF Ant property file.
5. Edit the wsant.bat file and set the following local environment variables to reflect your system configuration:
   - `JAVAEXE` the location of a 1.5 or higher JDK.
   - `INSTALL_DIRECTORY` the Eclipse install directory.
   - `LAUNCHER_JAR` the location of the Eclipse Equinox Launcher jar.
   - `WORKSPACE` the location of the workspace that contains the Dynamic Web projects being used.
6. To run the Ant task open a command line, navigate to the ant folder and type wsant
7. Check the wsgen.txt file for output after the generation has completed.
8. Navigate to the Dynamic Web project in the file system or refresh the project in Eclipse to find the generated artifacts.