Most enterprise-level applications have a need to integrate with other applications used by the same organization. These integration usually cater to different layers, like Data, Business Logic, Presentation and Security, depending on the requirement. This helps organizations achieve greater levels of operational consistency, efficiency and quality.
This article, the first in the series Learning Salesforce Integration, outlines a few of the options available for integrating other client applications with the Force.com platform. The main focus is on Web Service integration, including both inbound and outbound to Force.com. The client application considered in this article is Oracle Siebel CRM.
Speaking further on the different layers and integration features available at each level for an enterprise-level application, we have:
User Interface Integration is one great way to surface various applications inside Salesforce with little redesign of each individual app. It provides your users a single point of entry into multiple applications. The most relevant example is Facebook Apps, which appears to be in the Facebook instance but in reality, the content is served from different application vendors.
Source: https://developer.salesforce.com/page/Integration
Business Logic Integration uses Apex Web Services for Inbound and Apex Callouts for Outbound. It typically handles a scenario where business logic is spread across several applications to implement the complete end-to-end business process. An example would be building complex logic on the data received before committing it into Salesforce.
Data Integration uses SOAP APIs and REST APIs. It typically handles data synchronization requirements, where one application in an enterprise acts as the primary source for a particular business object, like Account. It requires no coding in Salesforce, which is an advantage, but then it cannot implement any custom logic.
As mentioned earlier, our focus for the rest of this document will be on the Business Logic and Data Integration layers, which implement Web Services.
Business Logic Integration helps extend the business logic present in Force.com with outside platforms. In the case of inbound logic integration, it is handled using Apex Web Services.
Apex Web Services allow us to write logic and expose it as a web service with external applications. It gives us flexibility in adding custom logic before modifying the Force.com standard or custom objects data. We can apply project-specific business logic while exposing web services.
It requires knowledge of Apex for writing the Apex classes that expose web services to be invoked by client applications. The steps involved are:
Apex Callouts enable invoking external web services that utilize SOAP, and WSDL or REST Services. This way the outbound scenario for web service integration can be handled. Two ways to generate callouts are importing the WSDL into Apex or by HTTP (RESTful) Services classes.
Data Integration helps us in maintaining consistency in the application data between multiple systems that need to be in sync. One way we can achieve talking about real-time synchronization of data between systems is by using SOAP APIs, among other available options.
SOAP API lets you create, retrieve, update or delete records, such as accounts, leads and custom objects. With more than 20 different calls, SOAP API also allows you to maintain passwords, perform searches and much more. Use SOAP API in any language that supports web services. It provides two WSDLs to choose from –
To access the current WSDLs for your organization, log into your Salesforce organization and from Setup, click Develop -> API -> Generate Enterprise/Partner WSDL. In general, the enterprise WSDL is more straightforward to use, while the partner WSDL is more flexible and dynamically adaptable to different organizations, allowing you to write a single application that can be used for multiple users and multiple organizations.
REST API provides a powerful, convenient, and simple REST-based web services interface for interacting with Salesforce. Its advantages include ease of integration and development, and it’s an excellent choice of technology for use with mobile applications and Web projects.
Security Considerations
Accessing Salesforce data or business logic via any of the above-mentioned inbound interfacing ways requires the client application to authenticate. This authentication is subject to the same security protections that are used in the Salesforce UI. Using valid credentials for the Salesforce organization being accessed, the server authenticates the credentials and, if valid, provides the client application with:
Additional security considerations include configuring profiles/permission sets with appropriate features, settings and objects enabled and assigning users to them. One such permission is API Enabled, which needs to be granted to the user for accessing the APIs.
Testing with soapUI
Using the Salesforce-generated WSDLs is not straightforward and therefore, to have a feel for the same you can opt for soapUI as a testing tool before actually getting into real application integration development. The process remains the same, i.e., importing the WSDL as a new project in soapUI and modifying the request message. But few points to remember –
Let’s walk through a hypothetical scenario for integrating Force.com with a client application, in this case, Oracle Siebel CRM. Techflex Pvt. Ltd. is a medium-sized manufacturing company that uses Oracle Siebel CRM (on premise) for managing its sales of packaging machines. Recently, it expanded internationally and the management introduced Salesforce Professional Edition for the new branch. After the initial bulk data load of Accounts, Contacts, Opportunities and Leads into the Salesforce application, the IT team at Techflex needed to build interfaces to keep both applications in sync with respect to the overall customer details (Accounts) and the customers’ primary contacts (Contacts). Siebel2Salesforce Account and Contact Interface For Techflex, Siebel remains the primary application for maintaining Accounts and Contacts. An interface is required to send the Account/Contact details to Salesforce as soon as it is created or updated in Siebel. Design Considerations:
Steps to Implement:
There are no development efforts required on the Salesforce side, except for creating any new fields needed for capturing complete Account and Contact details to match the existing Siebel Business Object Structure. Note: If after publishing the interface any new fields are created on the Salesforce side, the new WSDL needs to be shared with the other application. |
This article listed a few ways of integrating Force.com using Web Services. Now we can distinguish between situations in order to identify the best possible way to integrate. For example, if we need to have a straightforward data exchange between a client application and Salesforce, we should go with the Data Integration options like SOAP API, but in case we need to have some logic before or after the data is committed or sent out of Salesforce, we should opt for the Business Logic Integration options like Apex Web Services or Apex Callouts.
We also learned about security needs and using soapUI for testing. Finally, the elaborated scenario of Techflex Pvt. Ltd. illustrated a simple integration requirement that used SOAP API over Apex because there were no custom logic needs.
Next in this series, Force.com SOAP API Sample WSDL Structures discusses in detail about SOAP API and presents several common business scenarios requiring the exchange of data between systems. The working request messages illustrated should give a quick way to head start the learning.
Anupam Rastogi is a CRM Consultant working in CSC, who has rich experience in popular CRM products like Salesforce and Oracle Siebel CRM. His expertise includes niche areas like integration, coding, etc. Having worked in several domains like Public Sector, Sales, Marketing, Call Center, Aviation, Energy and Telecom, he has a great sense of designing CRM applications around business needs.
He aims at becoming one of the finest Consultants in the CRM world, sharing his experiences with businesses worldwide. His leisure time activities include photography (and playing with its associated software, like Lightroom, Photoshop), cooking and traveling.
He can be reached @ anupam.rastogi@gmail.com or LinkedIn Profile.