Ballerina How to: Salesforce Connector
Create integrations that interact with the famous SaaS vendors in the market is crucial for any integration technology. For Ballerina-Lang it is extremely important, especially given the fact the the most of the organizations are living the hybrid IT, combining on-premises with cloud-based solutions.
This is a Service Example that shows you how you can do a basic searching in Salesforce:
Note: Create a dev account in SFDC is out of the scope of that post :)
We created a Service called sfdc which contains a resource called querySalesForce.
As global access for any other resource, we had declared the following objects:
xml soapResponse;
xml[] headers = [];
string username = “edgarsilva@gmail.com”;
string password = params[0]; // your password+securitytoken generated by SFDC
salesforcesoap:ClientConnector sales = create salesforcesoap:ClientConnector(username, password, “https://login.salesforce.com/services/Soap/u/39.0", “1.1”);
In the querySalesForce Method, we invoke the query method from the pre-configured connector.
The execution is simple:
Developer Experience
I've been using Idea Plugin, and that is a really good experience if you want to play a little with Ballerina-lang.
Conclusion
Keep your eyes opened and check how Ballerina-lang is evolving, and be ready for make your services and integrations to dance.