Jibx2Wsdl toolJibx2Wsdl is the tool used to generate a binding definition and matching WSDL and schema definitions from existing Java code. It includes support for Java 5 enumerations and typed collections, JavaDoc extraction for use in service definitions, and all the data model customizations of BindGen. Jibx2Wsdl allows you to expose existing code as web services using Axis2 and JiBX data binding, while retaining the flexibility to modify your data model and adjust the JiBX bindings so that the XML is unchanged. Alternatively, you can just generate a WSDL and schema using Jibx2Wsdl and throw away the JiBX binding definitions, using the generated WSDL and schema as a quick start on a start-from-WSDL approach. The generated doc/lit wrapped WSDLs are compatible with Apache Axis2 and other major web service frameworks. Running Jibx2WsdlJibx2Wsdl executes as a Java application, meaning it needs to be run directly from a
console window using the "java" command, or though some equivalent technique (such as
an Ant The Jibx2Wsdl application main class is Here's a sample of running Jibx2Wsdl on Unix/Linux systems from the examples/jibx2wsdl/example1 directory of the distribution (in a single line, shown split here only for formatting): java -cp ../../../lib/jibx-tools.jar:start/bin org.jibx.ws.wsdl.tools.Jibx2Wsdl com.sosnoski.ws.library.jibx2wsdl.BookServer1 On Windows, the corresponding command line is: java -cp ..\..\..\lib\jibx-tools.jar;start\bin org.jibx.ws.wsdl.tools.Jibx2Wsdl com.sosnoski.ws.library.jibx2wsdl.BookServer1 By default, Jibx2Wsdl output just goes to the current directory where it was executed. The generated root binding definition is named binding.xml, and the generated WSDL and schema name is derived from the target namespace (which in turn is derived from the Java package name). Using build toolsYou can easily run Jibx2Wsdl from an Ant build, just as you would any other Java application. The build.xml in the examples/jibx2wsdl/example1 directory gives an example of this (which passes an optional source directory path parameter, in addition to a root class name), as shown below: <path id="jibx-classpath"> <fileset dir="${jibx-home}/lib" includes="**/*.jar"/> <pathelement location="bin"/> </path> ... <!-- Generate bindings, schemas, and WSDL --> <target name="generate-wsdl" depends="compile-starter"> <delete quiet="true" dir="${basedir}/gen"/> <mkdir dir="${basedir}/gen"/> <echo message="Running Jibx2Wsdl tool"/> <java classpathref="jibx-classpath" classname="org.jibx.ws.wsdl.tools.Jibx2Wsdl" fork="true" failonerror="true"> <arg value="-p"/> <arg value="${basedir}/start/bin"/> <arg value="-s"/> <arg value="${basedir}/start/src"/> <arg value="-t"/> <arg value="${basedir}/gen"/> <arg value="--strip-prefixes=m_"/> <arg value="com.sosnoski.ws.library.jibx2wsdl.BookServer1"/> </java> </target> Most IDEs allow you to directly execute an Ant build target, so you can use the Ant approach to running Jibx2Wsdl from within your IDE. Command line parametersYou can pass a variety of command line parameters to Jibx2Wsdl, as listed below in alphabetical order:
You need to specify one or more service definition class names as command line parameters to Jibx2Wsdl. Each class you name is used as a starting point for generating service definitions. Jibx2Wsdl examines each class listed to find methods to be exposed as web service operations. Each parameter type passed to a service method, or result type returned from a method, is then included in the binding and schema generation. These are recursively examined to find the complete set of classes necessary to represent your data. Jibx2Wsdl then generates binding and schema definitions for all of these classes. The service definition class names must be at the end of the command line, following any other command line parameters. You can pass global customizations to Jibx2Wsdl as command-line parameters,
by using |