Java 1.5+ and ANT 1.6.5+ are both prerequisites for LegStar. Make sure JAVA_HOME and ANT_HOME environment variables are set and that $JAVA_HOME/bin (%JAVA_HOME%/bin on Windows) and $ANT_HOME/bin (%ANT_HOME%/bin on Windows) are both in your system path.
A further requirement of xsdcgen is that JAVA_HOME points to a JDK not a JRE. This is because the sample web service provided needs the apt task that is part of Sun's tools.jar only available in JDKs.
These instructions apply if you are installing from the xsdcgen standalone distribution. If you are installling the complete LegStar distribution please refer to legstar distribution.
The directory tree should look like this:
<installDir> |---->LICENSE |---->NOTICE |---->README |----><samples> |----><quickstarts> |----><proxy_pojo_jvmquery> |---->build-pojo.xml |---->build-java2xs.xml |----><src> |---->**/*.java |----><proxy_ws_cultureinfo> |---->build-war.xml |---->build-xsd2xs.xml |----><src> |---->**/*.java |----><webapp> |----><jaxws-cultureinfo> |----><WEB-INF> |---->web.xml |---->sun-jaxws.xml |----><lib> |---->*.jar
From the samples/quickstarts/proxy_pojo_jvmquery folder, run command "ant -f build-pojo.xml" and check the result.
You can now run command "ant -f build-java2xs.xml" which generates a COBOL-annotated XML schema named jvmquery.xsd in the schema folder.
Each java type, from the jvmquery source, map to an XML schema complex type. Each XML schema element has special Cobol annotations with default attributes, such as maximum character string sizes.
The war file contains a simple JAX-WS endpoint that provides a Web Service implementation.
From the samples/quickstarts/proxy_ws_cultureinfo folder, run command "ant -f build-war.xml" and check the result.
Deploy the generated war file from the war folder into your J2EE container deployment folder (ex $CATALINA_BASE/webapps).
Check the build-xsd2xs.xml in.uri parameter. It assumes the J2EE container you deployed the target Web Service to, is listening on localhost, port 8080. You might need to customize this.
You can now run command "ant -f build-xsd2xs.xml" which generates a COBOL-annotated XML schema named cultureinfo.xsd in the schema folder. It does so by reading the target Web Service WSDL.
Each complex type and element from the source WSDL also exists in the generated mapping XML schema. Each element also has special Cobol annotations with default attributes, such as maximum character string sizes.