Calling Web Services from Uniface

To call out to a web service, use the Uniface import facility (/sti/mwr=ws) from the Uniface command line.

  1. Configure the SOAP Connector. For more information, see Configuring the SOAP Connector.
  2. Import the WSDL of the Web service using the command line switch /sti/mwr=ws, and desired sub-switches. For more information, see Importing WSDL Definitions for Web Services.

    For example:

    /sti /mwr=ws http://TheWebServicesServerSide/math?WSDL

    Uniface creates a SOAP signature with the name provided in the <wsdl:service name> tag in the wsdl file, for example, MATHSERVICE.

    Tip: It can be useful to first import the WSDL using the /nosig/verbose/gen="xml" qualifiers and examine the log file produced. The log file will describe the contents of the WSDL, so that you can ascertain whether there are complex parameters, and if so determine the /gen options you want to use for the actual import.

    /sti /mwr=ws /gen="xml" http://www.WebSite.com/aWebService/aWebService.wsdl
  3. Open the SOAP signature in the Signature Editor. Examine the operations in the signature and compile the signature.

    To view or edit the SOAP properties in the Signature Editor, click the >> button next to the SOAP Implementation field to open the Define Implementation dialog box, where click the Properties button to open the Define SOAP Properties dialog box.

    An example SOAP properties:

    Define SOAP Parameters dialog

  4. In the Uniface component where you want to call the web service, use the activate ProcScript statement to call the operations in the SOAP signature.

    For example:

    activate "MATHSERVICE".add(TheResult,2.5,100)
    • If the data type of an operation parameter in the SOAP signature is Entity or Occurrence, add the entity or occurrence to the component.
    • If the same entity is used for separate IN and OUT parameters, you can define these as subtypes of the entity. This ensures that the output and input parameter values do not overwrite each other. For more information, see Subtype Entities.
    • If the data type of a web service parameter is complex, create a well-formed XML string that matches the schema definition for the parameter. For more information, see Generating Complex Parameters for Web Services .
    • If security and authentication are needed for sending requests or accessing the Web service, configure the SOAP call-out connector by specifying options for the USYS$SOP_PARAMS setting in the [DRIVER_SETTINGS] section of your .asn file.
  5. Identify and trace problems encountered while calling a Web service during testing or deployment. For more information, see Tracing Web Services Call-Out Problems.