soap to json transformer

SOAP to JSON Transformer

Version: 17.07

Supported Since: 17.01

What is a SOAP to JSON Transformer?

A SOAP to JSON Transformer is a processing element which transforms a 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 order to use this processing element, you must first select the Message Transformation dependency from the processor list when you are creating an empty Ultra project. If you have already created a project, you can add this dependency via Component Registry. From Tools menu, select Ultra Studio → Component Registry and from the Processors list, select the Message Transformation dependency.

soap json outports

Out Ports

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

Parameters

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.

  • namespace_prefix:local_part

  • local_part

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 a 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.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Body>
         <request>
            <symbol id="1">ADRT</symbol>
         </request>
   </soapenv:Body>
</soapenv:Envelope>

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.

{
    "request":{
        "symbol":{
            "id":"1",
            "value":"ADRT"
        }
    }
}

Sample Use Case

In the following use case, the requirement is to read a message with a SOAP payload from a SFTP server, convert the message payload to JSON and then deliver it to another SFTP endpoint.

soap to json flow
soap to json config

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.

In this topic
In this topic
Contact Us