Exposing COBOL as Web Services

Describes how Visual COBOL and Enterprise Server support native and .NET COBOL applications as Web services.

Using Visual COBOL, you can choose from several methods provided to expose COBOL as Web services, and in some cases, deploy and run your Web services on Enterprise Server. In addition, you can also generate client applications to access your Web services.

Interface Mapping Toolkit (IMTK)
Starting with a native COBOL program, you can create Web services that use either the SOAP or JSON protocol by mapping a service interface from which to generate Web service components, or by generating Web service components directly from WSDL or JSON. You can further run these Web services on Enterprise Server and access them via a generated COBOL console client and, depending on the type of Web service, by additional client types. See Interface Mapping Toolkit (IMTK ) for details.
Note: Enterprise Server supports document/literal, RPC/encoded, and JSON encoding styles.
.NET COBOL
In Visual COBOL, you can use the Windows Communication Foundation (WCF) COBOL project template and compile your COBOL applications to .exe and .dll files that include Microsoft Intermediate Language (MSIL) code. MSIL uses the Microsoft .NET Framework and includes WCF integration. You can then expose your WCF applications as Web services with the COBOL application running as .NET code.

This method requires native OO COBOL or C# on the front end to invoke the Web service; however, you can then optionally call procedural COBOL for the back end. See Building Service-Oriented Applications with WCF and COBOL.

Calling COBOL from Another Language
You can call COBOL using any of a wide variety of other programming languages. Some of these languages have direct Web services support through tooling and Application Server deployment.
CAUTION:
When developing a Web service using this method, be sure to include a failsafe to address the scenario in which the COBOL program crashes or issues a STOP RUN when executed in the same process of an Application Server. Failure to address this scenario introduces the risk of bringing down the Application Server.