Brief introduction
JavaScript Object notation (JSON) is a text-based open standard designed for human-readable data interchange. JSON is derived from the JavaScript scripting language, which is used to represent simple data structures and associative arrays called objects. In the past, the vast majority of SaaS applications were used by enterprise customers. JSON is considered an efficient and efficient way to represent data on HTTP. Earlier, almost all SaaS applications that exposed WEB services (which transmit data as SOAP messages) began providing connectivity through the REST API (the data being transmitted is json/xml).
The WebSphere cast Iron (later referred to as Cast Iron) is an important role in data integration and migration across all internal and external applications, typically using XML and XML Schemas. In the WebSphere Cast Iron V6.3, two new activities are introduced to effectively support the consolidation process (orchestration) build, which involves the use of JSON data (Read JSON and Write JSON). This article describes various ways to configure Read JSON and Write JSON to help you efficiently process JSON data.
Read JSON Activity Overview
The Read JSON activity is used to convert a JSON-formatted string into an XML variable that can be used for mapping between activities during the consolidation process. To do this, you need an XML schema that converts the JOSN string to an XML variable. In the configuration process, you can use a sample JSON or XML string to generate an XML schema (output pattern), or you can use the XML schema provided in the WSDL or XML Schema section of the studio project, which is described in the next section 。
Configure Read JSON Activity
In this section, we'll learn how to configure the Read JSON activity.
Drag the Read JSON activity to the workspace, and then click Configure in the Checklist pane, as shown in Figure 1.
Figure 1. Read JSON Configure window
You can configure the schema by using the Json/xml string to generate an XML schema, or you can specify an XML schema that exists in the wsdl/xml pattern. This XML schema is the XML schema for the MAP outputs XML variable.
Generates an XML schema from the Json/xml string. Select Use JSON or XML message type from the Configure window, as shown in Figure 2.
Figure 2. Select a message type –use JSON or XML messages
Then copy the JSON or XML message to the text area and click Generate Output map as shown in Figure 3. This generates the Read JSON output parameter (XML schema), which can be viewed in Map output.
Figure 3. Sample JSON or XML message that generates the output pattern