One Request, a Mandatory Response, & an Optional Response



In this chapter, we will understand the concept of one request, a mandatory response, and an optional response.

  • The Client BPEL Service sends a single request to the Service BPEL Process and receives one or two responses.

  • Here, the request is to order a product online. If the product is delayed, the service sends a message letting the customer know. In any case, the service always sends a notification when the item ships.

  • The Client BPEL Service needs a scope activity containing the invoke activity to send the request, and a receive activity to accept the mandatory reply. For the optional message, the onMessage handler of the scope activity is set along with the instructions on what to do if the optional message is received (for example, notify you that the product has been delayed). The Client BPEL Process waits to receive the mandatory reply. If the mandatory reply is received first, the BPEL Process continues without waiting for the optional reply.

  • The Service BPEL Process needs a scope activity containing the receive activity and an invoke activity to send the mandatory shipping message, and the scope's onAlarm handler to send the optional delayed message if a timer expires (for example, send the delayed message if the item is not shipped in 24 hours).

  • As with all partner activities, the Web Services Description Language (WSDL) file defines the interaction.

Optional Response
Advertisements