Consuming a BIS web service from Extend Cobol program

We have several web services running using BIS/IIS in a test environment; we're able to consume those services from C# and from ASP web pages.  We need to ensure we can consume them with an Extend Cobol program as well - first attempts were abysmal (no doubt reflecting lack of understanding of XML extensions).  Is there a sample program provided with BIS which demonstrates consuming a BIS web service?

  • Verified Answer

    Hi Tony,

    As far as I am aware, there is no super-easy way of doing this - nothing like the automated creation of WSDL and request/response processing found in the creation of a BIS web service.  This is no doubt due to the fact that consumption of web services from existing COBOL programs is less in demand.

    There is nothing special about a BIS web service that distinguishes it from other SOAP web services.  What I have always done is to use a SOAP testing tool - typically soapUI - to get exemplars of the request and response that you then craft into XSLT to be used for consuming the web service.

    Point soapUI at the web service to fetch the WSDL.  When soapUI processes the WSDL it creates an exemplar of the SOAP request, with question marks as placeholders for the data that must be provided in the request.  Copy the XML exemplar to a text editor.  Now, to create an XSL from this XML, wrap the XML in a stylesheet and template declarations as follows:

    <xsl:stylesheet version="1.0" xmlns:xsl="">
    <xsl:output method="xml" encoding="utf-8"/>
    <xsl:template match="/">
    XML request exemplar here

    Now go through the XML request exemplar replacing all the '?' with - typically - <xsl:value-of> instructions that will pull data from the raw XML document that can be seen by exporting your data structure with no stylesheet.  If you are processing arrays, you will probably need to turn to <xsl:for-each> to iterate through repeating data.  A total example is probably not practical here, but I hope you get the idea.

    You can also use the XML response obtained by soapUI in a similar manner to create an XSLT that will pull data from the response into an XML document that matches your data structure used to import the data returned by the web service.

    XSLT editors (I use Stylus Studio) make this XSLT creation a bit easier.  Stylus Studio can use the XML exemplar obtained from soapUI and another obtained from XML Extensions in a visual mapping tool.  However, I typically just use the text editor because the process, once learned, is quite straightforward. 

    I hope this helps.

  • Thanks, Tom - I think I followed your explanation, and I'll give that a try (as soon as i dig out of this week's crises)!


  • Note that I changed the method attribute in the <xsl:output> from html (in the original post) to xml.  

    I too am a bit under water this week.