The IntegraTx Project
http://integratx.sourceforge.net
ClientX: IntegraTx's Web Services client generator
ClientX is a module that dynamically generates web based applications that use
IntegraTx's platform Web Services. This way, Web Services can be tested either
by hand or automatically with JUnit. These clients are created in a Java/J2EE/JBoss
multi-tier architecture using the Struts framework. This program, written in
Ant + Java + XSLT, generates Java sources and classes, JSPs, and XML files,
everything packaged in a .WAR for a web-based client that will call a Web Service.
The input is a WSDL file (XML file that defines a Web Service, representing
a "contract" between the client and the server). The ClientX module
will generate the required files for the presentation layer (in Struts) and
the business layer (a plain Java object or a Stateless Session Bean). For the
business layer, ClientX uses JBossWS client libraries to call a Web Service.
There is no SQL or database access involved.
- ClientX uses as input a WSDL file to know the input and output fields that
the Web Service uses.
- ClientX generates necessary JSP, Java and XML files. It compiles the java
classes and adds the files to a specified JAR. This JAR should be available
to the application server to run the generated client.
- The generated client has a presentation layer (JSPs/servlets/Java Beans,Struts)
and a business layer (a plain Java class) used to call IntegraTx's services.
The business layer is also used to test the IntegraTx application - calling
the Java classes directly from JUnit instead of the presentation layer.
- When generating a client for a specified WSDL, ClientX generates JSPs to
input information (based on the input fields in the WSDL), passes control
to the Java class at the business layer that calls IntegraTx's service, and
receives an answer (in the output fields). The client shows the input fields
and the answer received in the result web page.
- Each ClientX generation creates a single client for a specific IntegraTx's
service.
- As a premise, ClientX does not use a database engine: it invokes directly
IntegraTx services.
- The Web Service client will be added to an existing .WAR file.
Diagram of the generated client, and its interaction with IntegraTx:

ClientX: Technical definitions
- To generate a client, ClientX uses an XML file with creation options. This
way, the client can be created several times without the need to re-enter
information. The XML can have any name, but a nomenclature is recommended.
For instance clientx-getcurrencyinfo.xml has a clientx-
prefix and in lower case the name of IntegraTx's Web Service getCurrencyInfo.
- Example of a ClientX XML file:
<CLIENTX>
<WSDL-NAME>getcurrinfo.wsdl</WSDL-NAME>
<WAR-NAME>wsclient.war</WAR-NAME>
<INPUT>
<TITLE>Title of the HTML INPUT web page</TITLE>
<CSS>styles.css</CSS>
<URL>getcurrinfo</URL>
</INPUT>
<OUTPUT>
<TITLE>Title of the HTML OUTPUT web page</TITLE>
<CSS>styles.css</CSS>
</OUTPUT>
<BIZ-CLASS>
<SOURCE>dirname/BizGetCurrencyInfo</SOURCE>
<CLASS-DIR>classdirectory</CLASS-DIR>
<METHOD>getCurrencyInfo</METHOD>
<CREATE-SESSION-EJB>0</CREATE-SESSION-EJB>
</BIZ-CLASS>
</CLIENTX>
Where:
- WSDL-NAME specifies the name of the input wsdl file that contains the input/output
fields to be used to call IntegraTx's service.
- WAR-NAME is the name of the WAR that ClientX generates, packaging all the
generated objects. Several clients can be included in the same WAR file. Note:
this WAR file will be recreated every time ClientX is run.
- INPUT contains information about the input fields. TITLE is the HTML title
(optional, the default is a blank title), CSS is the CSS file with the styles
for the HTML tags, and URL is the URL used to call the generated client.
- OUTPUT contains information about the output fields. TITLE is the HTML title
(optional, the default is a blank title), CSS is the CSS file with the styles
for the HTML tags (can be the same as the input CSS).
- BIZ-CLASS contains information about the NAME of the Java class at the business
layer and the directory where the java class is generated (this directory
is created if not exists). CLASS-DIR specifies the name of the directory where
the classes are generated when compiled. METHOD tag is the method name that
calls the IntegraTx service. CREATE-SESSION-EJB tells ClientX whether to create
a Stateless Session Bean at the domain layer (indicated by 1), or a plain
Java object (indicated by 0). If omitted, ClientX generates a plain Java object
at the domain layer.
Directory structure of the generated client
The generated client will be packged in a .WAR file, and its internal directory
structure will be as follows (using directory names provided in the XML example):
example.war
|-- src
|-- bizlayer
|-- getcurrinfo (this directory includes business layer Java/EJB files)
|-- present
|-- getcurrinfo (this directory includes presentation layer files)
|-- META-INF
application.xml
|-- WEB-INF
|-- lib
getcurrinfo.jar (JAR file that includes bizlayer and present classes)
web.xml
struts-config.xml
struts-*.tld (Struts libraries)
Please feel free to send ideas to integratx@gmail.com
or visit the SourceForge.net website at www.sourceforge.net/projects/integratx