About Outbound EAI Streaming Responses
The following figure provides an overview of the components and process flow used for streaming an outbound response.

As shown in this figure, the process flow for streaming an outbound response is as follows:
-
An EAI request from the HTTP client is received by the AI.
-
The AI forwards the request to the SWE Server.
-
The SWE Server then performs one of the following actions:
-
If the request is not a streaming request, the SWE Server calls the EAI Object Manager method.
-
If the request is a streaming request, then the file is first written to disk before the SWE Server calls the EAI Object Manager method.
-
-
The EAI Object Manager forwards the response to the SWE Server, and SWE queries the output arguments.
-
If a file reference is found, then the SWE Server transmits the file to the client.
Whether multiple chunks will be sent or not depends upon the size of the file. If chunking is needed, then the SWE Server sends the first chunk to the AI, also embedding the streaming information in the response.
-
The AI sends the chunk to the client including the HTTP headers in the response, and then it requeries the SWE Server to get the next chunk.
Note: The AI sends the HTTP response headers only for the first chunk.The cycle continues until the entire file has been transmitted to the HTTP client.