Example: SOAP methods and the message bus

This example demonstrates how you can write applications that use both the SOAP API and the message bus to perform tasks in Smile. In this example, Client 1 requests a subscription update. Smile updates the subscription and publishes a message to the bus. Client 2 receives the message after a delay and checks that the message contains the most up-to-date information about the subscription.
  1. Client 1 updates a subscription, as follows:
    1. Client 1 sends a SOAP message to Smile that contains the subscription update() method.
    2. Smile receives the SOAP message and updates the subscription.
    3. Smile sends a SOAP response to Client 1 and the SubscriptionUpdated message to the message bus. Both messages contain details of the updated subscription.
  2. The Client 2 listener retrieves the SubscriptionUpdated message from the message bus.
  3. Client 2 verifies that it has the latest version of the updated subscription information, as follows:
    1. Client 2 sends a SOAP message to Smile that contains the subscription get() method.
    2. Smile receives the SOAP message and retrieves the subscription details.
    3. Smile sends a SOAP response to Client 2 that contains the current subscription details. Smile does not send a message to the message bus for this transaction because the SOAP method did not change the subscription.

Figure: An example of SOAP methods and the message bus

The image shows that clients can use SOAP to communicate directly with Smile, and that Smile sends messages to the message bus that listeners can retrieve.