SOAP Callback Operations for Web Services Call-In
When clients call in to Uniface web services they may provide a SOAP envelope that includes encrypted content, or information that Uniface itself does not handle or require, and they may expect a similar response back. To ensure that you can handle and construct SOAP envelopes that meet these requirements, you can implement callback operations that are automatically called before and after the target operation of the web service.
- SOAP_CALLIN_PRE—called before the target operation is executed. It can be used to examine the SOAP envelope and header, decrypt encrypted content, and modify the SOAP header that is passed to the target web service.
- SOAP_CALLIN_POST—called after the target operation has executed. It can be used to encrypt content and modify the response SOAP envelope.
These operations can be implemented in the web service itself or in a separate service that provides processing for all your Uniface web services.
The list of services that implement the operations must be specified in the $SOAP_CALLIN_CB setting in the assignment file of the Uniface Web Application Server (by default, wasv.asn).
When a client calls in to a Uniface web service, Uniface calls the SOAP_CALLIN_PRE operation on the services specified by the $SOAP_CALLIN_CB assignment setting, in the order given. Prior to sending the response, the SOAP_CALLIN_POST operation is called, this time processing the list of services in reverse order. This makes it possible to deploy extra processing on the envelope without having to change existing pre and post operations.
Note: The SOAP callback operations supercede the Uniface Web Services Call-In API, which provides similar functionality as 3GL functions. If you have existing web services that make use of the API, these will continue to work, but the API is obsolete and no longer maintained. For new web services, you should use the callback operations rather than the API.
Calling Sequence
When Uniface receives a request for a specific web service, it starts the following sequence of events:
- For each callback service named in the $SOAP_CALLIN_CB setting, an
existing instance is re-used or a new one is instantiated. If
[self]
has been specified, the component that was specified in the URL of the web service is instantiated. The SOAP_CALLIN_PRE operation of the first component is called before the second one is instantiated - Calls the SOAP_CALLIN_PRE operation on the list of services specified by the $SOAP_CALLIN_CB setting.
- Activates the web service operation specified in the SOAP envelope produced by the SOAP_CALLIN_PRE. Because the SOAP_CALLIN_PRE operation can change the SOAP envelope, this operation might not be the same one that was activated by the client.
- Calls the SOAP_CALLIN_POST operation on the list of services specified by the $SOAP_CALLIN_CB setting, in reverse order.
- Deletes all instances of the components used. State has been preserved from the first SOAP_CALLIN_PRE operation to the last SOAP_CALLIN_POST, and after that all state is removed from the server