Tag Archives: Force.com

Catching Salesforce Outbound Messages with NodeJS

via Catching Salesforce Outbound Messages with NodeJS – topcoder.

When building applications that are integrated with Salesforce, one of the choices you have to make is howyou get data out of Salesforce and into your app. You can use one of the many ETL tools on the market, you can poll for changed records, use the Force.com Streaming API, use Apex HTTP Callouts from Salesforce or Outbound Messages.

I’ve covered most of these approaches in the past but have purposefully overlooked Outbound Messages. Why? Because, in general, I hate working with XML. Perhaps it harkens back to my SAP days but every time I have to traverse an XML structure, I think a kitten dies somewhere.

However, with that said, Outbound Messages are quite magical. You hook them up as an action to yourWorkflow Rule, so that whenever a record is, for example, created or updated in some manner, the platform will fire off some record data to the endpoint specified in the Outbound Message. My only issue with them is that they only support XML and most web languages like Ruby, JavaScript, Go, etc. prefer JSON (and so do I). So here’s a simple NodeJS app that will receive the XML from your Outbound Message and convert it into a JavaScript object that you can then use to do all sorts of awesome stuff!

*You can find all of the code for this application at my github repo. What follows is the interesting part that catches the XML and parses it in routes/obm.js.

How to use Salesforce REST API with your JavaServer Pages

How to use Salesforce REST API with your JavaServer Pages

This tutorial gives an example of a JSP and how to integrate it with the Salesforce REST API. We will walk through the step­by­step process of creating an external client to manage your data with Force.com,while using HTTP(S) and JSON.

In this example, I am using Mac OS X 10.9.2 with Apache Tomcat 7 server and Java 1.7. Eclipse Java EE edition is the IDE used for development and testing. The instructions given in this tutorial should work with minor modifications for other platforms as well.

If you want to access the entire sample code from this tutorial, you can access it here:github.com/seethaa/force_rest_example

All code is updated to work with the httpclient 4.3 libraries.