Once the CLIENT process is configured and running, any NonStop application can access the associated Web service by sending the process a predefined IPM request and waiting for the response. Each IPM request contains a LightWave header which contains a 2 byte method code. The method code indicates which Web service method should be invoked by this IPM request. The remainder of the IPM consists of fields that correspond to the parameters of the selected web service method.
For example, using the following fragment from the generated DDL for the sample Employees service API, to invoke a "Get Employees" request:
- Initialize the get-employees-rq structure to 0 values.
- Set the GET-EMPLOYEES-RQ.LIGHTWAVE-RQ-HEADER.RQ-CODE value to RQ-GET-EMPLOYEES.
- Optionally set the GET-EMPLOYEES-RQ.LIGHTWAVE-RQ-HEADER.RQ-TIMEOUT value to the number of milliseconds to wait for the request to complete.
- Set any remaining application element values.
- Send the IPM to the CLIENT process using the appropriate Guardian system procedure call.
To ensure compatibility with future versions of LightWave Client, the LIGHTWAVE-RQ-HEADER structure must be initialized to binary 0 before populating other values.
Once the CLIENT process invokes the Web service method it returns the response in an IPM. This response IPM also contains a standard CLIENT header which contains a 2 byte response code. If the response code is zero, the remainder of the IPM consists of fields that correspond to the output parameters of the Web service method. If the response code is non-zero then the application should treat the response as an error.