Activating SOAP to Rest Transformation
You must have the Manage APIs functional privilege assigned to perform this task.
To activate SOAP to REST transformation for a SOAP operation
1. Click APIs in the title navigation bar.
2. Select the required API from the list of available APIs.
The API details page for the selected API appears.
3. Click Edit.
4. Click REST transformation.
A list of SOAP operations already exposed to the consumers as well as to be transformed from SOAP to REST appears. By default, all the SOAP operations are in inactive state.
5. Click to activate the SOAP to REST transformation for the SOAP operations. Alternatively, you can activate the SOAP to REST transformation for multiple SOAP operations simultaneously by clicking the Transform all operations activation toggle button.
6. Select the operation to edit the SOAP operations.
7. In the Transformation Configuration section, configure the following settings:
Use Schema for XML to JSON transformation If you select this checkbox, the XML schema (present in the WSDL) defines the data type of the entity. The data type can either be String, Int, Double, Float, or Boolean. In the response from the native server, if an entity is of a different data type other than the ones defined in the XML schema, API Gateway returns it is as a String data type and not an error.
If you do not select this checkbox, API Gateway does not honor the XML schema during transformation. Instead, API Gateway derives the data type of entities based on the native service response.
By default, this checkbox is not selected for any SOAP API. If you have migrated your APIs from another instance of API Gateway , the value of this checkbox will depend on the value of the Extended property pg.soapToRest.typeConvertorEnabled in the source API Gateway of the migrated APIs. The pg.soapToRest.typeConvertorEnabled property specifies whether the key values in a SOAP request must be converted to their primitive type when a SOAP API is transformed to REST API.
Note:
Date and Enumeration data types are also considered to be strings. When API Gateway cannot determine the data type of any value, it considers the data type to be a string.
Use default values from schema If you select this checkbox, API Gateway considers the default values provided in the XML schema, if there are no values present in a request or response. If the request or response has some value, this value overrides the default value from XML schema.
If you do not select this checkbox, API Gateway does not consider the default values present in the XML schema even if there are no values present in the request or response.
Remove operation name in response If you select this checkbox, the root node is not passed as a part of SOAP to REST response and only the JSON is passed. Root node is generally the SOAP operation name or SOAP operation response name, present in the XML schema. This check box is applicable only to JSON responses.
If you do not select this checkbox, JSON response is accompanied by the root node. By default, this check box is not selected for any SOAP API.
8. Click Save.
The API details page for the selected API appears.
9. Click REST transformation.
A list of REST resources for the SOAP operations appears. Click on each resource to view the details that are available as REST definitions.