Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The Salesforce streaming inbound endpoint allows you to perform various Salesforce streaming data via WSO2 ESB. The Salesforce streaming API receives notifications for changes to Salesforce data that match a Salesforce Object Query Language (SOQL) query you define, in a secure and scalable way. For more information see Salesforce streaming documentation.

...

To use the Salesforce inbound endpoint, you need to first create a PushTopic that contains a SOQL query.

To do this, go to Go to the developer console of your Salesforce account . and click on Debug->Open Execute Anonymous Window. Add the following entry in the Enter Apex Code window.  

Code Block
languagetext
titlepushTopic InvoiceStatementUpdates
PushTopic pushTopic = new PushTopic();
pushTopic.Name = 'InvoiceStatementUpdates';
pushTopic.Query = 'SELECT Id, Name, wso2__Status__c, wso2__Description__c FROM wso2__Invoice_Statement__';
pushTopic.ApiVersion = 35.0;
pushTopic.NotifyForOperationCreate = true;
pushTopic.NotifyForOperationUpdate = true;
pushTopic.NotifyForOperationUndelete = true;
pushTopic.NotifyForOperationDelete = true;
pushTopic.NotifyForFields = 'Referenced';
insert pushTopic;

Click Execute.

Related Salesforce streaming API documentation

Retrieving the Account information 

...

Code Block
<inboundEndpoint xmlns="http://ws.apache.org/ns/synapse"
             	name="SaleforceInboundEP"
             	sequence="reqSequence"
             	onError="fault"
             	class="org.wso2.carbon.inbound.salesforce.poll.SalesforceStreamData"
             	suspend="false">
   <parameters>
  	<parameter name="sequential">true</parameter>
  	<parameter name="interval">10</parameter>
  	<parameter name="coordination">true</parameter>
    <parameter name="connection.salesforce.userName">xxx@gmail.com<>MyUsername</parameter>
    <parameter name="connection.salesforce.loginEndpoint">https://login.salesforce.com</parameter>
    <parameter name="connection.salesforce.password">xxxxYYYY<>MyPassword</parameter>   
    <parameter name="connection.salesforce.salesforceObject">InvoiceStatementUpdates</parameter> 
    <parameter name="connection.salesforce.connectionTimeout">20000</parameter> 
   	<parameter name="connection.salesforce.readTimeout">110000</parameter> 
   	<parameter name="connection.salesforce.waitTime">10000</parameter> 
 	<parameter name="connection.salesforce.packageName">cometd</parameter> 
   	<parameter name="connection.salesforce.packageVersion">35.0</parameter>
	<parameter name="connection.salesforce.soapApiVersion">22.0</parameter>
 </parameters>
</inboundEndpoint>

...