Native Console App utilizing API / Web Service

Getting a new CRM in house and need to be able to call an API from a Native Console App and get the information from the database. Wondering if anybody might have a example of a Visual Cobol, Native Console App that calls API (Rest or Soap) and utilizes WSDL to return the information?

I cannot go directly against database(s), exec sql as I currently do, I need to utilize an Api or web service.

  • Which Visual COBOL product and version are you using, Visual COBOL for Eclipse, Visual COBOL for Visual Studio or DevHub?

    Visual COBOL provides a tool called the Interface Mapping Toolkit or IMTK which allows you to generate a native client COBOL program from a supplied WSDL (SOAP) or a JSON Schema (REST). You can use these generated clients as-is or adapt them to your own needs.

    You can access this directly through a project template in Visual COBOL for Visual Studio 3.0. Select New-->Projects-->COBOL-->Native and then select Web Service Client Application from WSDL/JSON. This will allow you to point to either a WSDL file for your 3rd party SOAP Web Service or a JSON Schema file for your 3rd party REST Web Service. It will generate a native console application from either of these files.
  • VC 2.2 did not have support for REST services as this was added in 2.3. It did however have support for generating clients for SOAP Web Services from a 3rd party WSDL file, although there was no project template available for this. I believe that it was an option from the Services or Tools menu.

    I would strongly suggest that you upgrade to 3.0 if you wish to take advantage of this feature.