Consuming Web Services

To enable a COBOL program to consume a Web service, we provide the C$JAVA library routine and the NETDEFGEN utility.

If the Web service is running on J2EE, the Java programmer packages the WSDL from the Web service in a WAR file with all the necessary resources including a Java client proxy, and the COBOL programmer invokes the service by calling the C$JAVA routine and naming the proxy as a USING parameter.

If the Web service is running under .NET, the .NET programmer generates a client proxy from the Web service and incorporates that proxy into a .NET assembly. The COBOL programmer then uses NETDEFGEN to create a COBOL COPY file for the proxy. The programmer then copies the COPY file into the COBOL program and uses the CREATE, DISPLAY, INQUIRE, and MODIFY statements to access the Web service methods and events.