Convert Input Parameters XML to JSON


New in 20.18.01This utility is used to preserve namespaces and attributes in XML, when the data is converted from XML to JSON to be converted back to XML. For an input XML, the utility returns the JSON string suitable to be used as input parameters while invoking TrueSight Orchestration Execute process REST API call.

If your XML contains double quotes, double quotes are escaped and XML values are converted into XML strings.

Convert Input Parameters XML to JSON workflow input

Input

Description

Required

input xml

Contains the XML that you want to convert to JSON format.

Sample input XML
<inputParameters>
 <inputParameter>
   <name>adapter name</name>
   <value>text with double-quotes - "</value>
 </inputParameter>
 <inputParameter>
   <name>target connection data</name>
   <value>
     <connection-details>
      <hostname>blah.doodle.com</hostname>
       <username>somename</username>
        <password>
         <EncryptedData xmlns="http://www.w3.org/2001/04/xmlenc" Type="http://www.w3.org/2001/04/xmlenc#Content">
           <CipherData>
             <CipherValue>some-enrypted-data</CipherValue>
           </CipherData>
         </EncryptedData>
       </password>
       <invocation-mechanism>ssh</invocation-mechanism>
       <timeout>120</timeout>
       <adapter-name>SSHAdapter</adapter-name>
     </connection-details>
   </value>
 </inputParameter>
</inputParameters>

Yes


Convert Input Parameters XML to JSON workflow output

Output

Description

json output

Contains the JSON output for the XML input.

{
   "inputParameters":[
      {
         "name":"adapter name",
         "value":"text with double-quotes - \""
      },
      {
         "name":"target connection data",
         "value":"<connection-details><hostname>blah.doodle.com</hostname><username>somename</username><password><EncryptedData xmlns=\"http://www.w3.org/2001/04/xmlenc\" Type=\"http://www.w3.org/2001/04/xmlenc#Content\"><CipherData><CipherValue>some-enrypted-data</CipherValue></CipherData></EncryptedData></password><invocation-mechanism>ssh</invocation-mechanism><timeout>120</timeout><adapter-name>SSHAdapter</adapter-name></connection-details>",
         "type":"xml"
      }
   ]
}

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*