Question

We have some COBOL programs in our financial applications which need to interact with some of our backend systems. One of the available interfaces is through a web service. Can a program written in Cobol make requests to a web service?

Was it helpful?

Solution

Microfocus provide a tool called Enterprise Server which allows COBOL to interact with web services.

If you have a COBOL program A and another COBOL program B and A calls B via the interface section, the tool allows you to expose B's interface section as a web service.

For program A, you then generate a client proxy and A can now call B via a web service.

Of course, because B now has a web service any other type of program (command line, Windows application, Java, ASP etc.) can now also call it.

OTHER TIPS

I've never used COBOL but from quick Google search it looks like it's possible.

This looks like it'll help, and talks about integrating webservices with cobol through c code.

What platform is this on? IBM's CICS supports webservices invokationnn from cobol program via EXEC CICS INVOKE.

ibm is now trying to implement a technology called embedded websphere with java. ibm belives this is the only way to give the life to mainframes.

I know I can write a WebService with Delphi and call a COBOL DLL or call a Delphi dll to comunicate with webservice.

Right now Im writing a webservice client, it will be a DLL, and Ill call from old COBOL systems.

If you have and are using CICS, it has built-in mechanisms for that. But assuming you can't use that for some reason, you can build an HTTP client using the IBM TCP/IP 'EZASOKET' modules.

I work for a company with a z/OS system running mostly COBOL, batch (JCL) and CICS. To call webservices, we wrote a module to implement HTTP 1.0 using TCP/IP. With modules

  • EZASOKET
    • GETHOSTBYNAME
    • SOCKET
    • CONNECT
    • WRITE
    • FCNTL
    • READ
    • CLOSE
    • SELECTEX

supplementary modules:

  • EZACIC04 translates EBCDIC to ASCII
  • EZACIC05 translates ASCII to EBCDIC
  • EZACIC06 convert character to bit mask
  • EZACIC08 decode IP address

Since I wrote this for my company, I can't just give out the code. But for reference, it took me 3 days to write the module (plus a little debugging later), and that was with an example to start with that did a partial hacky way of doing it.

You will need to read through IBM's references to know how to use the EZA modules.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top