The image shows a diagram of what happens when one request results in a mandatory response and an optional response. The following actions take place:
The client BPEL process has a scope activity in an onMessage attribute. The scope activity has a Call service invoke activity to send the request to the service BPEL process, and Wait for Callback receive activity for the callback.
The client Call service invoke activity sends a request to the service BPEL process, by way of a WSDL partner link.
The service BPEL process has the following activities:
A receive activity to receive the client's response
A switch activity containing logic to either delay a response or not.
An invoke activity to send the mandatory response back to the client.
If the product is delayed, the switch activity in the service selects Message A and sends it to the Wait for Callback receive activity in the client BPEL process.
When the product ships, the invoke activity sends Message B to the Wait for Callback receive activity in the client BPEL process.