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 :)
Service that Invokes a basic Search in Salesforce

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 = “”;
string password = params[0]; // your password+securitytoken generated by SFDC
salesforcesoap:ClientConnector sales = create salesforcesoap:ClientConnector(username, password, “", “1.1”);

In the querySalesForce Method, we invoke the query method from the pre-configured connector.

The execution is simple:

Result from Salesforce Query Execution
Ballerina Execution Runtime

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.

Developer Experience — Integrated Environment for Ballerina-Lang in Idea.


Keep your eyes opened and check how Ballerina-lang is evolving, and be ready for make your services and integrations to dance.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.