Create a SOAP web service client

You can use Genero Studio to write, compile, and execute a SOAP Genero Web Services (GWS) client application.

Before you begin:

The Web Services Description Language (WSDL) description must be provided by the service provider. It can be provided as a file or as a URL. You can use the WSDL description to determine the operations of the Web Service in your BDL program, the required parameters, and the return values.

About this task:

The wizard retrieves the WSDL information and generates a .4gl file containing the BDL functions for the WSDL operations, which can be called by a Genero Web Service client application.

  1. In the Projects, right-click an application, folder, or library node and select Add Web Service > Client Consuming WSDL....
  2. Complete the steps in the Add Web Services - Client consuming WSDL wizard:
    1. On the Services selection page, enter the details needed to locate the WSDL file.
    2. On the Project integration page, determine how the web service will be integrated into the project:
      • Add web services to project (Recommended) produces a .wsdl file which is added to the project, and a readonly .4gl in the intermediate files. The default action on the .wsdl file is 'View 4gl source'. To open the .4gl and view the API, double-click click on the .wsdl file . The client stub can be called from MAIN.
      • Advanced allows you to select more options. This produces an editable client .4gl client stub which is added to the project and can be edited.
      Sample client API:
      IMPORT FGL SOAP_client_API
          DEFINE ret INTEGER
          LET record1_readRequest.country_code = "FRA"
          CALL record1_read_g() RETURNING ret
          DISPLAY SFMT("The description of %1 is %2.",record1_readRequest.country_code, record1_readResponse.resultset.country_codedesc)
      END MAIN
    See The Web Services wizard for further details.
  3. Use the Genero Studio Build menu option to compile and link your new application.

If you must access the web service using a proxy, provide the proxy information using Tools > Preferences (or, if you are on a Mac, Genero Studio > Preferences).