Sample Ant Build File for a Java Client
6-8 Getting Started With JAX-RPC Web Services for Oracle WebLogic Server
You must also copy the following clientgen-generated files from clientgens destination directory to javacs destination directory, keeping the same subdirectory
hierarchy in the destination:
packageNameServiceName_internaldd.xml packageNameServiceName_java_wsdl_mapping.xml
packageNameServiceName_saved_wsdl.wsdl
where packageName refers to the subdirectory hierarchy that corresponds to the package of the generated JAX-RPC stubs and ServiceName refers to the name of the
Web service.
To run the client application, add a run target to the build.xml that includes a call to the java task, as shown below:
path id=client.class.path pathelement path=clientclasses
pathelement path={java.class.path} path
target name=run java
fork=true classname=examples.webServices.simple_client.Main
failonerror=true classpath refid=client.class.path
arg line=http:{wls.hostname}:{wls.port}complexComplexService target
The path task adds the clientclasses directory to the CLASSPATH. The run target invokes the Main application, passing it the URL of the deployed Web service
as its single argument.
See Section 6.2.5, Sample Ant Build File for a Java Client
for a full sample build.xml
file that contains additional targets from those described in this procedure, such as clean.
Rerun the build-client target to regenerate the artifacts and recompile into classes, then execute the run target to invoke the echoStruct operation:
prompt ant build-client run You can use the build-client and run targets in the build.xml file to iteratively
update, rebuild, and run the Java client application as part of your development process.