Use JSON (ii) in WebSphere Cast Iron to invoke the JSON-based rest API

Source: Internet
Author: User
Tags json session id

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.