JiBX: Jibx2Wsdl Examples

# JiBX: Jibx2Wsdl Examples |

JiBX Basics Overview Getting Started Binding Compiler Binding on Load Runtime Extras Building JiBX Maven Contributing License News and Status Support FAQ Mailing Lists Bugs User Comments Sponsors Start from Code Start from Code BindGen Example Code Example 1 Example 2 Example 3 Example 4 Customizations Reference SchemaGen Jibx2Wsdl Examples Customizations Start from Schema Start from Schema CodeGen Schema Datatype Handling Example Code Default Generation Simple Customizations More Customizations Modular Generation Customizations Reference Extensions Reference Binding Definition Binding Tutorial A basic binding Binding extras Structure mapping Collections and arrays Using mappings Advanced binding Method hooks Custom code Precompiled Bindings Definition details Definition contexts Conversions Date/time conversions XML summary <binding> element <include> element <format> element <namespace> element <mapping> element <value> element <structure> element <collection> element Attribute groups Usage API Runtime JavaDocs Subprojects Eclipse Plug-in Introduction Install Usage JiBX/WS Axis2 Usage JiBX/OTA Schema Library | ### Jibx2Wsdl example code The /examples/jibx2wsdl directory of the JiBX distribution contains some samples for demonstrating the use of Jibx2Wsdl, each in a separate subdirectory. All the samples use the same approach to build a service implementation and corresponding client, starting from a service definition class which implements (or at least defines) some sort of functionality. The service definition class is used to generate a WSDL service definition, and the data classes passed to or from the service methods are used to generate XML schema definitions. This starting code is in a starter directory within each example subdirectory. If you just want to try generating WSDL and schema definitions (along with the JiBX binding, of course), you can do that using only the JiBX code. If you want to generate and try the client and server code, you also need an Axis2 installation updated with the latest JiBX jars (using the jibx-axis2 download). You may also need to edit the /examples/jibx2wsdl/build.properties file and set the paths to your JiBX and Axis2 (if used) installations. The path provided for JiBX is correct as long as you keep the code as part of your distribution. All the examples use the same directory structure, with a starter subdirectory for the service definition and data classes, a client directory for the client code, and a server directory for the service code. The client and server directory each contain some provided code to start with, for a simple test program on the client side and for a service implementation class on the server side (which in most cases just delegates to the original service definition class provided in the starter code). The client and server code can only be compiled once the linkage code has been generated using Axis2. An Ant build.xml file is included in each example. If you run `ant` from a console open to the example directory, without specifying a target, it'll list the targets available with each example. ### Example details Here's the list of examples: example1 - library service, using books and types with Java 5 typed lists example2 - equivalent to example1, but using arrays rather than Java 5 typed list, and with customizations example3 - more complex library, using polymorphism to include both books and DVDs in the library, using Java 5 typed lists and enums, and customizations example4 - still more complex library, with multiple variations on DVDs, and multiple alternative customizations infoq-example - updated version of code used in the "Code First" Web Services Reconsidered article Currently only the infoq-example uses any customizations which are specifically for Jibx2Wsdl, rather than just BindGen.