Access Keys:
Skip to content (Access Key - 0)
community header community tab mule tab ibeans tab muleforge tab

QuickStart ESB adapter for a CICS program, using ant scripts.

QuickStart description

The purpose of this quickstart document is to quickly build a functioning sample integrating Mule with a backend IBM CICS system.

Once deployed, the generated Mule service will act as an adapter for the sample CICS COBOL program LSFILEAE. ESB clients can then consume the Mule service without any knowledge of the actual legacy backend system:

If you would rather use WebSphere MQ instead of HTTP as the wire protocol to reach the mainframe then the Mule configuration will be:

Installation

Follow instructions in:InstallationInstructions

If you installed the z/OS CICS modules, then the target LSFILEAE COBOL program is ready. Otherwise, the source is in the samples/mule/quickstarts/legstar_adapter/cobol sub-folder and you need to upload, compile and install it in CICS.

Generate a Mule service adapter for a mainframe program

These steps will guide you through the process of generating an ESB adapter using ant scripts. There is an alternative method, using Eclipse plugins, that will be described later.

First step is to generate an XML schema from the source of the target COBOL program LSFILEAE.

Go to folder samples/mule/quickstarts/legstar_adapter.

From the ant folder, run command ant -f build-cob2xs.xml. This should create a schema folder with a generated XML schema lsfileae.xsd.

If you open lsfileae.xsd you will notice that each COBOL data structure in the LSFILEAE COBOL source has been mapped to an XML Schema type.

Next step turns the XML schema types into Java annotated classes. This is achieved with 2 ant scripts:

  • From the ant folder, run command ant -f build-jaxb.xml. As a result, the src folder contains generated JAXB classes. These were derived from the sample XML Schema in the schema folder. Sources are also compiled, with binaries stored under build.
  • From the ant folder, run command ant -f build-coxb.xml. This should create binding classes which can be used as an alternative to the JAXB classes to achieve high performances.

The last step generates the transformers and Mule configuration.

From the ant folder run command ant -f build-mule2cixs.xml. By default, this script uses HTTP connectivity to CICS. For WebSphere MQ edit the script and follow directions.

Under src/com/legstar/test/cixs/mule/lsfileae you will find the generated transformer classes that turn java value objects or XML to mainframe byte arrays. These transformers can be used in any Mule configuration and are independant from the transport chosen.

Under legstar_adapter, Mule configuration samples are generated:

  • mule-adapter-config-lsfileae-http-java-legstar.xml

Is the Mule configuration file. Notice that generated transformers are referenced. Access to mainframe uses the transport that you have chosen previously. The client is expected to send serialized java objects over an inbound TCP connection.

  • mule-adapter-config-lsfileae-http-xml-legstar.xml

Is an alternative where clients can send XML over TCP instead of serialized java objects.

The ant folder contains the build.xml generated ant script which bundles the mule-legstar-lsfileae.jar file and deploys the generated transformers to your Mule installation (Defined by the MULE_HOME environment variable).

Testing the Mule service adapter

The installation src/org/mule/transport/legstar/test/lsfileae folder contains the LsfileaeClientTest junit class that you can use to invoke the newly deployed component.

Alternatively, the src/org/mule/transport/legstar/test/lsfileae folder also contains LsfileaeHttpTest junit class that uses the Mule junit framework and will start a Mule instance as part of the test itself. You don't need to actually deploy the generated artifacts in order to run this test but you have to include the Mule libraries in your project classpath.

LsfileaeHttpXmlTest is an alternative to LsfileaeHttpTest where the client sends XML rather than serialized Java objects.

Adaptavist Theme Builder (3.3.3-conf210) Powered by Atlassian Confluence 2.10, the Enterprise Wiki.
Free theme builder license