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.
- Client 1 updates a subscription, as follows:
- Client 1 sends a SOAP message to Smile that contains the subscription update() method.
- Smile receives the SOAP message and updates the subscription.
- Smile sends a SOAP response to Client 1 and the SubscriptionUpdated message to the message bus. Both messages contain details of the updated subscription.
- The Client 2 listener retrieves the SubscriptionUpdated message from the message bus.
- Client 2 verifies that it has the latest version of the updated subscription
information, as follows:
- Client 2 sends a SOAP message to Smile that contains the subscription get() method.
- Smile receives the SOAP message and retrieves the subscription details.
- 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.