Brief introduction
The WebSphere cast Iron (cast Iron) is widely used for integration and migration across internal and external applications. In the past, most SaaS-based applications have exposed the REST APIs, which are used to process JSON data. However, Cast Iron mainly deals with XML and XML schemas. To support a valid REST API call, Cast Iron introduced two new activities to process JSON data.
You can use the Read JSON and Write JSON activities to create JSON requests and parse the JSON response in the process of calling the REST APIs, most of which are exposed by the SaaS vendor. In part 2nd, you will learn an effective way to invoke the Salesforce.com REST API to create an Account record.
Call a salesforce.com API
In this scenario, you must invoke a salesforce.com REST API to create an account that accepts input and sends a reply data in JSON format. A sample JSON request and Salesforce.com REST API response are shown in table 1.
When building complex consolidation processes, the mentioned input names can be mapped across variables, which must eventually be sent as part of the JSON Request data. Similarly, the JSON Response received from the Salesforce.com API must be easily mapped to enable effective consolidation process development.
In the consolidation process shown in Figure 1, "name" can be passed as an HTTP principal to the Receive REST Request activity for the Write JSON to form the JSON request for the Salesforce.com API. On the other hand, the salesforce.com API call output is available for Read JSON activity, which provides output data in XML format so that mapping can be implemented easily and efficiently across the consolidation process.
Figure 1. Create a salesforce.com account consolidation process
The receive REST request activity receives text from the principal variable. The ' name ' value is used to create an account in Salesforce.com. Table 2 shows the steps to complete the checklist for the Receive REST Request activity.
The Get SDFC session ID (Invoke service) activity logs on to the salesforce.com using the exposed Web service and extracts the session ID for use by salesforce.com for further invocation. Table 3 shows the steps to complete the Get SDFC session ID activity Checklist.