TempFileReadPostExecuter
Configuration file |
None. Configuration is done directly with a string in field "Config file". |
Class name |
com.ebd.hub.datawizard.postexec.TempFileReadPostExecuter |
Description
This postexecuter reads the data for the Response from a temp file. The selected value for the Response field "Content" is ignored.
The path to this temp file has to be set in the field "Config file". Variables with syntax @VARIABLENAME@ are allowed, but the variable has to be defined in the profile.
By default, the file is deleted after being read. If you add ;noDelete (without whitespaces) after the temp file path, the file will not be deleted.
Example
Problem: A profile acts as a web service. It uses an HTTP(S) Response to send data to an external server, which delivers an HTTP response that is forwarded by Message to a subsequent profile. This subsequent profile processes the response and creates the response for the web service client that has called the first profile. How can that be done?
Solution: The first profile passes an unambiguous name for a temp file to the subsequent profile by using a variable. The subsequent profile then saves the HTTP response of the external server in this temp file. Now the first profile reads the temp file in a subsequent Response with the TempFileReadPostExecuter and sends it back to the web service client with the response class DefaultWebServiceResponse. The temp file will be automatically deleted!
If the HTTP response is not only to be returned to the client via the class DefaultWebServiceResponse but also to be archived as a zip file in a local folder, the postfix ;noDelete after the path name in the first call of the TempFileReadPostExecuter makes sure that the file is not deleted. In a further Response (type "File"), the file can then be read and deleted again to save the data as a zip file.
Note: For a better understanding, please read the section Profile chains.