I recently presented a webinar that was hosted by IBM Systems Media: “Making CICS Applications Available as Web Services“. It was a technical, how-to presentation where I spent most of the hour doing a live build of a web service to expose a CICS application. If you have a need to make your CICS applications available in this way, or to provide an API to your CICS applications, watching this recorded webinar will show you how to do that.

At the end of the presentation, we had a number of questions that I wanted to capture and share through our blog, as they represent the types of questions we regularly get from architects and programmers who are trying to find the best way to integrate CICS applications with cloud, web, or mobile applications. Here’s a summary of the questions, and if you have one of  your own, please use the form at the end of this post to contact us.

Q: It seems like this product is targeted for use by application developers, not systems programmers or sysadmins, correct, or not?

A: We have found that many people end up using HostBridge, and a lot of people can do development. We can show anybody that knows how to write code how to write web services. I have Systems Programmers that use HostBridge to do system programmer things that they need to do, like running certain CEMT commands or other types of thing where they’re checking on the system. Most typically, it’s going to be an application developer of some sort that writes these web services and creates these services to the outside world. It turns out, that COBOL programmers are really the best at this. They don’t know JavaScript, very often; they don’t know how to do object-oriented programming. But the hardest part of creating mainframe web services is not writing the JavaScript. The hardest part is understanding the applications on the host: how do they behave, what errors they’re going to get, and what happens there. We see all sorts of people use HostBridge in an organization, from end-to-end.

Q: How does a CICS web service work with existing host security, like RACF, ACF2

A: HostBridge does not change the security model whatsoever. Whatever security you have in place works the same. When a request comes in from the outside world, CICS gets control of that request before HostBridge is invoked. So we’re going through RACF, through ACF2 or TopSecret, and we’re getting authorized with those credentials. Then when HostBridge launches, we’re running under those credentials. So, the web service you create can’t do anything that those credentials aren’t authorized to do. And, all the auditing and logging is exactly the same. Whatever UserID you pass through us to run under, that’s the UserID the transaction runs under. All the security is kept exactly the same. There’s not a new security model, nor are there special security considerations for HostBridge. It uses the same application security that’s already in place.

Q: When accessing a transaction, that displays 20 lines at a time, can we merge multiple pages of the transaction into a single output using a web service?

A: Absolutely. That’s the strength of HostBridge. I have customers – and this is not an exaggeration – doing thousands of screens in a single web request. Now, we don’t recommend that; that’s obviously not a micro-service, but they had a need to extract information out of the host, so they went through multiple screens. It is not uncommon to go through 50, 60, or even 100 screens for many of our customers, to extract information where they are paging down, or pulling information from multiple locations. Or maybe they’re making multiple COMMAREA program calls and aggregating all that into a single response using a web service. HostBridge has the ability to run visual transactions, which is what I showed you today, but it also can call COMMAREA programs, or read from VSAM files or DB2 directly. So we’re able to aggregate any number of screens from any number of applications into a single response. In fact, we can run multiple transactions in different CICS regions, as long as they’re MRO-connected, we can run multiple transactions from multiple environments, pulling all that data back in a single response.

Q: What’s Postman?

A: Postman is just a testing tool you can pull down off of the internet that allows you to do a web service request, that’s really easy to download and use. I use it because it’s simple, and you can do unit-testing inside of it as well. It’s a utility that’s out there and available in a free and paid version.

Q: What happens if we add a new field between fields in the BMS map of a CICS program?

A: HostBridge just keeps right on working. Unless you’re going to change field names, adding or moving a field doesn’t affect how a web service created with HostBridge works, and applications continue to work downstream. If you delete a field you’re currently using, you’re going to create an error that will cause a problem. Adding new fields, however, doesn’t cause any issues whatsoever.

Q: Can HostBridge access programs or data outside of CICS?

A: Yes. Programs outside of CICS can call into HostBridge. CICS, using HostBridge, can call outside. CICS can talk to HostBridge, and also through the EXCI interface, applications on the host can also talk to HostBridge directly as well. So you can actually call HostBridge from a batch program running inside CICS. We are a CICS application, so we’re always inside CICS. But, most of our customers are coming from the outside world, from .NET or J2EE and making web service calls into the host. You can also call a web service from the mainframe.

Q: How do you pass credentials from a web service to CICS?

A: The internet standard is to use a Basic Authentication header or an X.509 certificate. CICS supports both approaches, and we support all of the methods that CICS does.

Q: Could RDz support HostBridge web service builds?

A: Yes, through the use of a few short scripts to push the JavaScript to the host. For those that want to do this, I have examples of calling the HostBridge “Make” service from client side JavaScript, curl and perl. Reach out to me using the form below if you’d like these examples, or any of the others I can provide.

If you have another question you’d like us to answer about CICS web services, JavaScript on the mainframe, or HostBridge, please contact us using the form below. We’d be happy to dialogue with you and answer your questions!