Usage
REST to SOAP (Pre-Processing)
Description | REST Request | Transformed SOAP Request |
---|---|---|
Normal JSON |
{ "employee" : { "first-name" : "Jane", "last-name" : "Doe", "address" : "Paris" "phone-number" : "123456" } } |
<?xml version="1.0" encoding="UTF-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <employee> <first-name>Jane</first-name> <last-name>Doe</last-name> <address>Paris</address> <phone-number>123456</phone-number> </employee> </soap:Body> </soap:Envelope> |
JSON with nested tag |
{ "employee" : { "first-name" : "Jane", "last-name" : "Doe", "address" : { "street" : "123 A Street" }, "phone-number" : "123456" } } |
<?xml version="1.0" encoding="UTF-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <employee> <first-name>Jane</first-name> <last-name>Doe</last-name> <address> <street>123 A Street</street> </address> <phone-number>123456</phone-number> </employee> </soap:Body> </soap:Envelope> |
JSON with attribute |
{ "employee" : { "first-name" : "Jane", "last-name" : "Doe", "address" : { "street" : "123 A Street" }, "phone-number" : [ { "@type" : "work", "$" : "555-1111" }, { "@type" : "cell", "$" : "555-2222" } ] } |
<?xml version="1.0" encoding="UTF-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <employee> <first-name>Jane</first-name> <last-name>Doe</last-name> <address> <street>123 A Street</street> </address> <phone-number type="work">555-1111</phone-number> <phone-number type="cell">555-2222</phone-number> </employee> </soap:Body> </soap:Envelope> |
JSON with empty object |
{ "employee" : { "first-name" : "Jane", "last-name" : "Doe", "address" : { "street" : "123 A Street" }, "phone-number" : [ { "@type" : "work", "$" : "555-1111" }, { "@type" : "cell", "$" : "555-2222" } ], "other-details" : {} } |
<?xml version="1.0" encoding="UTF-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <employee> <first-name>Jane</first-name> <last-name>Doe</last-name> <address> <street>123 A Street</street> </address> <phone-number type="work">555-1111</phone-number> <phone-number type="cell">555-2222</phone-number> <other-details></other-details> </employee> </soap:Body> </soap:Envelope> |
JSON with namespace |
{ "m:GetPrice": { "@xmlns:m": "https://www.w3schools.com/prices", "m:Item": "Apples" } } |
<?xml version="1.0" encoding="UTF-8"?> <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <env:Header /> <env:Body> <m:GetPrice xmlns:m="https://www.w3schools.com/prices"> <m:Item>Apples</m:Item> </m:GetPrice> </env:Body> </env:Envelope> |
SOAP to REST (Post-Processing)
Description | Post-Input Data | SOAP Message | Transformed REST Message | Remarks |
---|---|---|---|---|
Normal SOAP Message |
<?xml version="1.0" encoding="UTF-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soap:Body> <employee> <first-name>Jane</first-name> <last-name>Doe</last-name> <address>Paris</address> <phone-number>123456</phone-number> </employee> </soap:Body> </soap:Envelope> |
{ "employee":{ "first-name":"Jane", "last-name":"Doe", "address":"Paris", "phone-number":"123456" } } |
||
SOAP message with nested tag |
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <employee> <first-name>Jane</first-name> <last-name>Doe</last-name> <address> <street>123 A Street</street> </address> <phone-number>123456</phone-number> </employee> </soap:Body> </soap:Envelope> |
{ "employee": { "first-name": "Jane", "last-name": "Doe", "address": { "street": "123 A Street" }, "phone-number": "123456" } } |
||
SOAP message with attribute |
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <employee> <first-name>Jane</first-name> <last-name>Doe</last-name> <address> <street>123 A Street</street> </address> <phone-number type="work">555-1111</phone-number> <phone-number type="cell">555-2222</phone-number> </employee> </soap:Body> </soap:Envelope> |
{ "employee": { "first-name": "Jane", "last-name": "Doe", "address": { "street": "123 A Street" }, "phone-number": [ { "@type": "work", "$": "555-1111" }, { "@type": "cell", "$": "555-2222" } ] } } |
||
Add a new node | node_interpretation : strict
text_node_name : testNode |
<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <catalog> <book> <name>bookName1</name> </book> </catalog> </soap:Body> </soap:Envelope> |
{ "catalog": { "book": { "name": { "testNode": "bookName1"} |
Both values, node_interpretation and text_node_name, are mandatory in pre-input configuration to get the specific result. The node_interpretation value must always be 'strict'.
Be sure to configure this both together in pre-inputs to add any text node. |
Add Custom Attribute prefix | use_attribute_prefix:yes attribute_prefix:# |
<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <catalog> <book id="01"> <name>bookName1</name> </book> </catalog> </soap:Body> </soap:Envelope> |
{ "catalog": { "book": { "#id":"01", "name": "bookName1" } } } |
Both values, use_attribute_prefix and attribute_prefix, are mandatory in pre-input configuration to get the specific result. The use_attribute_prefix value must always be 'yes'.
The attribute_prefix must be used with use_attribute_prefix. |
Namespace handling | namespace_handling:yes |
<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <test> <pre:elem xmlns:pre="urn::value">xyz</pre:elem> </test> </soap:Body> </soap:Envelope> |
{ "test": { "pre:elem": { "xmlns:pre": "urn::value", "$": "xyz" } } } |
To handle namespace, you must provide 'namespace_handling:yes' in pre-inputs. |
Custom Name Space Prefix | namespace_handling:yes use_namespace_prefix:yes namespace_prefix:# |
<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <test> <pre:elem xmlns:pre="urn::value">xyz</pre:elem> </test> </soap:Body> </soap:Envelope> |
{ "test": { "pre:elem": { "#xmlns:pre": "urn::value", "$": "xyz" } } } |
To handle namespace, these three values are required in pre-input configurations. This should be configured together as shown in the example. |
Array Representation : Compact | array_representation : compact
array_parent_child : options|option |
<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <xml> <options> <option>1</option> <option>2</option> </options> </xml> </soap:Body> </soap:Envelope> |
{ "xml": { "options": { "option": [1,2] } } } |
array_representation and array_parent_child must be used together to handle array representation. array_representation compact creates a compact array as shown in the JSON example.
array_representation and array_parent_child should be configured together in pre-inputs to define array_representation. In the case of multiple arrays in the JSON, array_parent_child becomes a comma-separated list of parent|child. |
Array Representation : Expanded | array_representation : expand
array_parent_child : options|option |
<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <xml> <options> <option>1</option> <option>2</option> </options> </xml> </soap:Body> </soap:Envelope> |
{ "xml": { "options": { "option": [1,2] } } } |
Expand array_representation is the default array_representation. If there is no configuration in pre-inputs, the default is expand. |
Recognize Number | consider_number:true |
<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <a> <b>100</b> <c>value</c> </a> </soap:Body> </soap:Envelope> |
{ "a": { "b": 100, "c": "value" } } |
This feature is applicable for SOAP→REST transformation only. |
consider_number:false |
<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <a> <b>100</b> <c>value</c> </a> </soap:Body> </soap:Envelope> |
{ "a": { "b": "100", "c": "value" } } |
This feature is applicable for SOAP→REST transformation only. | |
Recognize Boolean | consider_boolean:true |
<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <a> <b>true</b> <c>value</c> </a> </soap:Body> </soap:Envelope> |
{ "a": { "b": true "c": "value" } } |
This feature is applicable for SOAP→REST transformation only. |
consider_boolean:false |
<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <a> <b>true</b> <c>value</c> </a> </soap:Body> </soap:Envelope> |
{ "a": { "b": "true" "c": "value" } } |
This feature is applicable for SOAP→REST transformation only. |