Created On:  31 May 2012

Problem:

The Net Express 5.1 documentation includes a section on how to use Web Services with the Microsoft SOAP Toolkit.  This is found under Help > Contents > Programminmg > Web Services > Chapter 3: COBOL Web Services using the Microsoft SOAP Toolkit.

The example in the documentation is no longer valid.  Can you please give me a new example of how to use the SOAP Toolkit?

Resolution:

Microsoft's Soap Toolkit has not been supported by Microsoft since 2005.  Microsoft now recommends that you use Visual Studio .NET to create Web Services or to create Web Service clients.

The creation of COBOL web service clients in .NET is fully supported in Net Express .NET running under Visual Studio or in Visual COBOL.

The Microsoft Toolkit 3.0 still seems to work OK but the sample in the NX 5.1 docs is now invalid as the Toolkit registry name has changed as well as the example web service no longer exists.

The following is an updated version of the sample that uses the Microsoft Soap Toolkit 3.0 to call the Shakespeare web service, which takes a phrase in a Shakespeare play as input and returns the name of the play and the context in which the phrase appears.

This was tested using Net Express 5.1 under Windows 7 64-bit.

      $set ooctrl(+p)
       class-control.
           MSSOAP is class "$OLE$MSSOAP.SoapClient30"
           olesup is class "olesup".
       working-storage section.
       01  Soap      object reference.
       78  WSDL-Url  value
           z"http://www.xmlme.com/WSShakespeare.asmx?WSDL".
       01 wsSpeech      pic x(5000).
       procedure division.

           invoke MSSOAP "new" returning Soap
           invoke Soap "mssoapinit" using WSDL-Url
                                          z"Shakespeare"
           invoke olesup "setDispatchType" using by value 0 size 4
           invoke Soap "getSpeech" using z"To be, or not to be"
              returning wsSpeech
           end-invoke
           display wsSpeech
           invoke Soap "finalize" returning Soap
           stop run.

Incident #2574357