Using SOAP Callback Operations

To use callback operations, you need to create one or more Uniface services that implement the defined operations, and configure Uniface so that it can find the component containing the callback operations.

A component that implements the callback operations must be a local Uniface service. For call-in, it can be the target Uniface web service.

Callback operations can be implemented in multiple services. This makes it possible to add new functionality by adding another callback operation, without having to modify your existing callbacks. The list of services that implement the operations must be specified in the assignment file of the calling application (for call-out); or of the Uniface Web Application Server (for call-in).

Uniface calls the PRE operation on the specified services in the order given. For the POST operation, it traverses the list in reverse order.

  1. To use callback operations for call-in:
    1. Create a Uniface service that implements one or both of the SOAP_CALLIN_PRE and SOAP_CALLIN_POST operations.

      This can be a component that provides generic processing for all Uniface web services, or you can implement these operations in each Uniface web service to provide more customized SOAP envelope processing.

    2. In the wasv.asn file, specify the callback service to use by setting the $SOAP_CALLIN_CB setting.

      For example:

      [SETTINGS]
      $SOAP_CALLIN_CB = myCallin
      [SETTINGS]
      $SOAP_CALLIN_CB = myCallin, [self]
  2. To use callback operations for call-out:
    1. Create one or more Uniface services that implement the callback operations SOAP_CALLOUT_PRE and SOAP_CALLOUT_POST.
    2. To specify the callback services that are common to all web services, specify the service names using the SOAP connector option callback in the [DRIVER_SETTINGS] section.

      For example, in the wasv.asn file, the callback option specifies a Uniface service SoapCallbackService that is called when calling out to all web services:

      [DRIVER_SETTINGS]
      SOP U2.0
      USYS$SOP_PARAMS = callback=SoapCallbackService
    3. To specify the callback services that are specific to a web service, list the services that implement the operations for a specific web service in the [SERVICES_EXEC] section of the assignment file. WebService1

      For example, in the wasv.asn file, :

      [SERVICES_EXEC]
      WebService1=SOP:WebService1 callback=CallbackSvcPre, CallbackSvcPost
      WebService2=SOP:WebService2 callback=CallbackSvc2

Related Topics