Write JSON activity configuration

During this procedure, you apply a sample JSON or XML message to the Write JSON input parameter. If you prefer, you can also use a schema for this task.

About this task

Note: Because not all JSON messages contain a root node, Studio, by default, adds a virtual root element to all JSON messages during a write JSON activity. (Virtual nodes facilitate handling of rootless messages in Studio). To determine if a root node is present, view the message in the Configure panel. If the message does not contain a root element, Studio will automatically generate one during the write JSON activity and display it in the root element file. To remove the root element, delete it from the Configure panel so the output message matches the required structure.

Procedure

  1. Click Configure from the Checklist. The Configure window is displayed.
  2. In the Configure window, you can either use an XML Schema or JSON or XML message to generate map.
    1. If you are specifying an XML schema to apply to the Write JSON input parameter, do the following: In the Select XML Schema field, click the Select XML Schema button to browse and select XML schema. Select the XML schema to parse during run time and click OK.
    2. If you want to use the JSON or XML message, copy the JSON or XML message into the Use JSON or XML message to generate the output schema text area.
  3. Choose a Virtual Root Configuration.
    1. When you use JSON or XML message to generate map, if more than one element present in JSON, then by default, Remove root Element is checked automatically.
    2. When you use XML Schema to generate map, Remove root Element is not checked by default.
    Note: If the Remove Root Element is checked, the first root element is skipped and the JSON text is created properly with the remaining elements. You can specify a Root Element Name. However if the Remove Root Element is not checked, then for all the complex types will not get the root element names and hence will be displayed as null.
  4. Specify how the data defined by the OutputJSON output parameter is to be encoded:
    1. Select the Data is text-Needs no decoding or encoding option if the data is text and does not require encoding.
    2. Select the Encode data using encoding type option if outgoing data is binary data that requires encoding using the specified encoding type.
  5. Set the encoding type using one of the following options:
    1. From the Encode data using encoding type list, select one of the default encoding types.
    2. Click directly in the Encode data using encoding type field and enter your encoding type.
    3. Click OK.
  6. Click Generate Map.



Feedback | Notices


Timestamp icon Last updated: Tuesday, 27 September 2016


http://pic.dhe.ibm.com/infocenter/wci/v7r0m0/topic/com.ibm.wci.doc/Write_json_Activity_conf.html