This document will explain the usage of JiBX with Axis2 in order to expose existing Java code as a Web service and to implement a client for an existing Web service (or the service stubs for implementing the service).
JiBX data binding supports fast and flexible conversions between plain old Java objects (POJOs) and XML. JiBX uses a mapped binding approach that's based on a binding definition document you provide. This lets you customize the way your Java objects are converted to and from XML. These features make JiBX especially useful if you're developing a Web service based on existing Java code.
Axis2 supports using JiBX with your Web services, including generating the necessary linkage code for both client and server sides. However, the Axis2 support for JiBX doesn't currently include code generation from the schema for a Web service - you need to provide your own data classes and JiBX binding definition, and you also need to make sure that the binding definition matches the XML structures defined for your Web service. The JiBX project provides some basic tools to help with code generation from schema, binding generation from Java classes, and schema generation from the combination of Java classes and a binding definition. In the future, improved versions of these tools will be integrated directly into the Axis2 framework support, but for now you're on your own with this part of the setup.
You can use JiBX data binding both to expose existing Java code as a service, and to build a client for an existing service. This document runs through the sequence of steps involved for each of these cases, just to help users understand the basic approach to working with JiBX in Axis2. You can find full instructions on the standard JiBX parts of this sequence on the JiBX web site.
Here's the sequence of steps for using JiBX with Axis2 to expose existing Java code as a Web service:
The above is assuming:
If this is not the case, you'll also need to create wrapper classes and perhaps wrapper methods for now. See the JiBX example for more details on this.
Here's the sequence of steps for using JiBX with Axis2 to implement a client for an existing Web service (or the service stubs for implementing the service):
To run the WSDL2Java tool for JiBX data binding you need:
Soon after the release of Axis2 1.0 the JiBX support will be extended to support automatic handling of "wrapped" doc/lit services. This will dramatically reduce the number of classes that need to be defined for working with simple services, and simplify both starting from Java and starting from WSDL.
The full JiBX 1.1 release will also provide much improved support for code generation from schemas, and for binding+schema generation from code, and these features will be integrated into the Axis2 JiBX support. Check the JiBX project site for updates on both JiBX 1.1 and the Axis2 JiBX support.