Version: 17.01
Supported Since: 17.01
A SOAP to JSON Transformer is a processing element which transforms an SOAP message payload to a JSON
payload. This is similar to the XML to JSON Transformer processing element, except this processing element
transforms only the SOAP payload (i.e. the XML part within the soapenv:Body
element) to
JSON.
This transformation is done based on a generic set of rules and hence this processing element is most suitable for simple transformations. For complex transformations based on custom rules, Adroitlogic Data Mapping Tool is recommended.
In the following use case, the requirement is to read a message with an SOAP payload from a SFTP server, convert the message payload to JSON and then deliver it to another SFTP endpoint.
In this flow, the "Processor" outport of SFTP ingress connector is connected to the inport of the SOAP to JSON Transformer so that the SFTP message received by the connector is handed over to the transformer next. If the processing element is able to transform the payload from SOAP to JSON successfully, the message with the transformed payload is handed over to the SFTP egress connector, as the "Next" outport of the SOAP to JSON Transformer is connected to it.
In the case of transformation failure, a log will be generated and then the message flow will complete in an exceptional state, as the "On Exception" outport of the SOAP to JSON Transformer is connected to a Logger processing element, followed by an Exceptional Flow End element.
Next |
The message will be sent to this outport if the payload transformation is completed successfully |
On Exception |
The message will be sent to this outport if the processing element failed to transform the payload due to some reason |
Starting element |
Basic |
An optional starting element name to begin transformation from. This must be an element within the SOAP payload. If this is specified, only the XML part within the specified element will be converted to JSON and set as the new payload of the message. If SOAP payload does not contain such element, the resulting payload will be empty. This parameter can be specified in either of the following formats.
|
Retain namespace prefixes |
Basic |
Whether to retain namespace prefixes of SOAP tags in the JSON keys as well. By default this parameter is set to true. |
Key for content |
Basic |
In case where an SOAP element has one or more attributes in addition to the textual content, the value of this parameter will be used as the JSON key for the textual content. This parameter is optional and defaults to "value". For example refer the following sample SOAP content.
Notice that in the following converted JSON output, textual content of symbol element is contained under the key "value", which is the value of this parameter.
|