Running a service in Tomcat on zOS
Skip to end of metadata
Go to start of metadata

It is relatively straightforward to run a CXF service in a Tomcat container on z/OS. This makes it possible to access data stored on these mainframes, for example in DB2 databases and to expose that data as a Web Service using the same methods used on other platforms. No mainframe specific knowledge or skills are required.

There are a couple of steps:

  1. Copy Tomcat to z/OS and set it up
  2. Deploy a service
  3. Test a service

Copy Tomcat to z/OS and set it up

Simply copying Tomcat to z/OS, extracting the jar and running the startup script does not work in the case of z/OS, since z/OS is an EBCDIC platform, instead of an ASCII platform that Tomcat pretty much assumes.

Tomcat needs to be extracted correctly and instead of running it using the startup script, it needs to be executed under the control of JZOS. JZOS is supplied as part of the IBM JDK on z/OS. If your version of the JDK on z/OS does not include JZOS, you need to obtain a newer version of the JDK that does include it.

Tomcat then needs to be configured and started by following the instructions for JZOS and Tomcat

Sample JCL to run Tomcat looks as follows:

TOMCAT.JCL

This JCL needs to be updated with your JDK and Tomcat installation locations.

Deploy a service

Services can be deployed as usual for Tomcat. For example, the service WAR file can be FTP-ed to the .../webapps HFS directory or the Tomcat Manager can be used to deploy the service. If using FTP or another copy procedure to copy WAR file to z/OS, ensure that the WAR file is copied in binary mode, otherwise it will be ASCII-EBCDIC translated during the FTP and completely corrupted.

Test a service

Just point your SOAP client at the hostname, port and CXF service details of the Tomcat server running on z/OS and the client should run fine. You should not see any difference from running it against a non-mainframe host.

Labels
  • No labels