Troubleshooting binary upload failures
If an API call succeeds from Swagger or from a direct API Gateway test but fails when triggered by ION, review the request payload, transfer encoding, and form-data content type configuration.
Document type mismatch
To diagnose, compare the payload in the API Gateway logs between a working Swagger test call and the failing ION-triggered call. Look for the Content-Type header and whether the payload starts with base64 characters, for example, iVBORw0K... for PNG, instead of raw binary bytes.
To resolve the issue, change the input document type from a BOD to an ANY document. See the Binary content section for details.
Chunked transfer encoding
When an Enterprise Connector is in the request path, the HTTP request can use Transfer-Encoding: chunked instead of a Content-Length header. In chunked encoding, the request body is sent in pieces, and each piece is preceded by its size in hexadecimal.
Some target systems do not fully support chunked transfer-encoded requests, especially for multipart/form-data payloads.
Symptoms of this issue include:
- The API call succeeds when the Enterprise Connector is bypassed but fails when the Enterprise Connector is used.
- The target receives the complete payload, as confirmed by logs, but returns errors that indicate that the file content is missing or malformed.
- Larger files, for example, files larger than 256 KB, encounter errors while smaller files succeed.
To diagnose, enable debug logging for the logical ID and for these classes:
com.infor.ion.plugins.api.adapter.ionapi.client.IonApiCallcom.infor.ion.shared.restclient.RestClient
Review the logs to confirm whether chunked encoding is used and whether the multipart boundary termination, --boundary--, is included at the end of the payload.
To resolve the issue, bypass the Enterprise Connector if acceptable for the API call. If the Enterprise Connector is required, verify that the target system HTTP parser supports chunked transfer encoding for request bodies. Contact the target application vendor if the parser does not handle chunked multipart requests.
Content type configuration
Verify that the Content type column in the Form Data Parameters table is set to the correct media type for the file that is being uploaded.
If the content type is left at the default value, for example, text/plain for an ANY document, the target API may not recognize the payload as a valid file.