Newer Version Available

This content describes an older version of this product. View Latest

Step 4: Add the Source Code

  1. Add the following code to a Java source file named StreamingClientExample.java. This code subscribes to the PushTopic channel and handles the streaming information.
  2. Edit StreamingClientExample.java and modify the following values:
    File Name Static Resource Name
    USER_NAME Username of the logged-in user
    PASSWORD Password for the USER_NAME (or logged-in user)
    CHANNEL /topic/InvoiceStatementUpdates
    LOGIN_ENDPOINT https://test.salesforce.com (Only if you are using a sandbox. If you are in a production organization, no change is required for LOGIN_ENDPOINT.)
  3. Add the following code to a Java source file named SoapLoginUtil.java. This code sends a username and password to the server and receives the session ID.

    Never handle the usernames and passwords of others. Before using in a production environment, delegate the login to OAuth.

    Important

  4. In a different browser window, create or modify an InvoiceStatement. After you create or change data that corresponds to the query in your PushTopic, the output looks something like this: