When working with Web Services in Stambia the response of json type is normally parsed by Stambia in a json metadata structure.

This makes it easy to read and load the response's elements but sometimes we do need to keep the whole received json structure as well.


There are few solutions that you can use to do that.


1. Use this article to get the raw response instead of the parsed json structure :

https://stambia.org/doc/65-technology-articles/web-services/invoking/465-retrieving-raw-unstructured-data-from-a-web-service

Create a stage in your target database where you will load the response.

Map the stage field to the target table where you want to stock the whole response.


Now, to get some particular values from the json structure of the repsonse, there are two solutions:

  • if the database you are using have a function like JSON_VALUE or a specific type (like json type in postgres), you can use it to get the specific values and map them in your second target, for example in postgres


  • if your database does not have any functions that would allow to parse the json data, you can export the whole structure into temporary file, using a file metadata and string_content property field, then you need to create a json metadata that will point to this temporary file and will allow you to read the elements you need in a dedicated mapping


2. Another solution would be to do your mapping as you would normally do (with a json structure in output):


and use the "Received Messages folder" option on the "Integration Rdms to Wsdl" template with ${/CORE_SESSION_ID}$ variable to make this folder unique per session:

This way during the execution of your API call Stambia will generate the output files with the response's headers, content in this folder.


You will simply need to load sting_content of the .out files generated in this folder after the call is made.

Metadata File that will allow to load string content of all the .out files that are in the temporary folder:



Mapping:

You will need to execute both mappings in one process (so that they share sessionId).

In the process, you need to delete header.out files before loading the .out files and delete the out files with the temporary folder after they are loaded: