16
Salesforce Integratio n Patterns Jan. 20th, 2017 1

Salesforce Integration Patterns

Embed Size (px)

Citation preview

Page 1: Salesforce Integration Patterns

Salesforce Integration Patterns

Jan. 20th, 2017

1

Page 2: Salesforce Integration Patterns

2

Salesforce Integration PatternsA variety of integration patterns currently exist for Salesforce. We’ll examine the following in this presentation.

• Outbound Messaging

• Salesforce Connect (ODATA)

• Canvas

• REST API Integration (inbound/outbound)

• SOAP API Integration (inbound/outbound)

Let’s take a deeper dive into each.

Page 3: Salesforce Integration Patterns

3

Outbound MessagingOutbound messaging allows you to specify that changes to data fields within Salesforce can automatically propagated to external systems. A backend queue is used to manage the outbound calls.

Outbound messaging is part of the workflow rule functionality in Salesforce. Workflow rules watch for specific kinds of field changes and trigger automatic Salesforce actions, such as sending email alerts, creating task records, or sending an outbound message.

Page 4: Salesforce Integration Patterns

4

Pros/Cons of Outbound Messaging

• Simple to setup within Salesforce.

• Can be invoked via workflow rules and Apex.

• Up to 100 notifications can take place within a single SOAP message. This makes it very efficient.

• Guaranteed message delivery for up to 24 hours (retries for that duration).

• Asynchronous so no client latency.

• Session id automatically included for callbacks.

• Two-way SSL possible for extra security

Advantages

• Receiving service must implement Salesforces’ outbound messaging WSDL.

• REST is not an option for outbound messaging.

• Governor/developer limits exist.

Disadvantages

Page 5: Salesforce Integration Patterns

5

Salesforce ConnectSalesforce Connect provides a gateway to accessing external data via the OData protocol. The external data is exposed in such a way as resemble custom object.

● Data is accessed in real-time - doesn’t use copying.● Gives access to external data with point-and-click simplicity.● Allows the full range of CRUD operations (create, read, update and

delete).

Page 6: Salesforce Integration Patterns

6

What Exactly is OData?.

OData is a REST-based protocol for querying and updating data and is built on standardized technologies such as HTTP, Atom/XML, and JSON. It is different from other REST-based web services in that it provides a uniform way to describe both the data and the data model.

Page 7: Salesforce Integration Patterns

7

Pros/Cons of Salesforce Connect

• If your external data already supports the OData protocol, setup within Salesforce couldn’t be simpler.

• External objects are treated nearly identically to custom objects.

• Configuration can largely be done in a point-and-click fashion - no custom code required.

• External objects can be included in reporting and analytics.

Advantages

• External data integration limits are applicable. For example, there’s a maximum of 50,000 records retrieved or created an hour.

• Debugging tools are weak.

• Performance is a wild card - caching and optimization strategies are largely unknown.

• Salesforce charges an additional monthly fee for Salesforce Connect.

Disadvantages

Page 8: Salesforce Integration Patterns

8

Salesforce CanvasCanvas is an iFrame-based technology that allows you to embed content from an external system. However, unlike conventional iFrames, where you are restricted from fetching data from domains other than its host (i.e., the same origin policy), Canvas provides a Javascript SDK that allows you to tightly integrate the canvas app with Salesforce callouts.

Page 9: Salesforce Integration Patterns

9

Canvas API & SecurityThanks to the Canvas SDK, developers can surface IFrame applications that can fully integrate with the parent Salesforce application. There are several available security options for permitting such calls. They include OAuth support and signed requests, A signed request contains a consumer key, access token, and other contextual information that is useful for building tightly-integrated applications.

You can also authenticate the user via SAML if Salesforce is configured as an identity provider.

Page 10: Salesforce Integration Patterns

1010

Pros/Cons of Salesforce Canvas

• Developers can create applications using the technology stack most familiar to them.

• Canvas SDK includes CSS classes that allow an embedded app to have a seamless UI experience.

• Configuration within Salesforce couldn’t be easier - just a few simple steps.

• No additional licenses costs.

Advantages

• The web application that must be exposed via Canvas must exist.

• In order to fully leverage Canvas, you will have to use the Canvas SDK, which effectively means it can’t be reused in a stand-alone fashion.

• As with nearly every Salesforce solution - developer limits are in place. For example, you are limited to 5,000 Canvas SDK calls per 24 hour period.

Disadvantages

Page 11: Salesforce Integration Patterns

11

Salesforce REST APIREST API provides a powerful, convenient, and simple Web services API for interacting with Force.com.

The REST API provides a standard set of calls for accessing Salesforce remotely, and new calls can be defined using Apex REST annotations.

In addition to calling Salesforce, REST can also be used for placing outbound calls. The Batch API is also suitable for batch routines.

Page 12: Salesforce Integration Patterns

12

Understanding a Salesforce REST API call.

Page 13: Salesforce Integration Patterns

13

Using REST Explorer in Salesforce Workbench

Page 14: Salesforce Integration Patterns

14

Pros/Cons of Salesforce REST API

• Simple to use with nearly all platform languages & technologies.

• A Javascript API (“Javascript REST Toolkit”) enables client web applications to place direct calls to Salesforce (i.e., no same origin issue).

• Can support XML or JSON protocols.

• Very comprehensive - a wide range of Salesforce capabilities are exposed via the protocol.

• Supports all standard OAuth authentication mechanisms.

Advantages

• As always, Salesforce developer limits apply. For example, depending upon your license, you may not be able to place more than 15k calls a day.

• OAuth is required for accessing standard REST API calls (but those you define via Apex can be exposed without OAuth).

• REST not available for outbound messaging (requires SOAP).

Disadvantages

Page 15: Salesforce Integration Patterns

15

Salesforce SOAPSalesforce SOAP was their first true integration API, and it still remains popular today. Salesforce provides two different types of WSDLs that can be used:

● Partner WSDL is loosely typed and generic to Salesforce org instance. You can dynamically fetch Salesforce configuration data, such as available custom objects.

● Enterprise WSDL. A strongly typed WSDL that is specific to the organization you are working with.

Given these chooses the big advantage to the Partner WSDL is that it remains static and thus immune to changes within Salesforce. However, unlike the Enterprise WSDL, it can be much tedious to work with.

Page 16: Salesforce Integration Patterns

16

Pros/Cons of Salesforce SOAP API

• Platforms such as .NET and Java can leverage code-generation tools that make it fairly straightforward for generating SOAP requests. SDK’s exist to further streamline the process for Java, .NET, PHP and Ruby.

• Testing the SOAP web services can be done using free tools such as SoapUI with IDEs such as Eclipse.

Advantages

• As always, Salesforce developer limits apply. For example, depending upon your license, you may not be able to place more than 15k calls a day.

• SOAP isn’t an option for accessing the Bulk or Chatter APIs - they are only exposed as REST calls.

Disadvantages