Hello @Robert Wijn 2,
If you want Indicium to behave as a proxy, then your only option is a Custom Protocol process flow, because this is the only way in which you can fully influence Indicium's HTTP response.
states that it should be called using the /open in stead of /indicium
If the URL for a regular process flow is /indicium/iam/appl/process_flow
then the URL for a Custom Protocol process flow is /indicium/open/iam/appl/process_flow
. Note that you can use any HTTP method, request body and query string to start this process flow and you can return any HTTP response.
For a more detailed explanation of Custom Protocol process flows, check this blog.
I hope this helps.
Hi Vincent,
This indeed seems the way to go. I have created a process flow with a HTTP-connector inside. When I call this flow from Postman however, I receive a HTTP 500 without additional explanation. When I look inside the process, the HTTP-connector returns a HTTP 200 with the expected values. Results of this HTTP call are placed in the process variables which are assigned to properties (response_code, response_body and response_headers). The values of these properties (process variables) seem to be correct at the end of the process flow:
response_body {"translations":i{"detected_source_language":"NL","text":"Dies ist eine Regel"}]}
response_code 200
response_headers a{"Key":"Date","Value":"Tue, 28 Jan 2025 14:53:01 GMT"},{"Key":"Transfer-Encoding","Value":"chunked"},{"Key":"Vary","Value":"Accept-Encoding"},{"Key":"Access-Control-Allow-Origin","Value":"*"},{"Key":"Strict-Transport-Security","Value":"max-age=63072000; includeSubDomains; preload"},{"Key":"Server-Timing","Value":"l7_lb_tls;dur=44, l7_lb_idle;dur=9, l7_lb_receive;dur=0, l7_lb_total;dur=321"},{"Key":"Access-Control-Expose-Headers","Value":"Server-Timing, X-Trace-ID"},{"Key":"x-trace-id","Value":"d392eea0a1825885cc428cceefd99c3e"},{"Key":"Content-Type","Value":"application/json"}]
status_code 0
Any idea where the issue could be?
Maybe any one else any idea what the cause of the HTTP 500 message could be when using a custom protocol?
Hi Robert Wijn,
Isn’t there anything in the Indicium error log? I would expect something to be logged there in this case. Or maybe is there a TSFMessage header in the response (I don’t think so in thise case, but good to double check).
Hi Dick,
Thanks for the reply. Indead there is no TSFMessage in the header, but I did find something in the Indicium logging in regards to not being able to deserialize some JSON content:
2025-02-04T15:06:47.5403406+00:00 4000038e-0000-db00-b63f-84710c7967bb bERR] An unhandled exception occurred while processing the request. (ffba027a)
Newtonsoft.Json.JsonSerializationException: Cannot deserialize the current JSON array
(e.g. g1,2,3]) into type 'System.Collections.Generic.Dictionary`2ySystem.String,System.Stringi]]'
because the type requires a JSON object (e.g. {"name":"value"}) to deserialize correctly.
To fix this error either change the JSON to a JSON object (e.g. {"name":"value"})
or change the deserialized type to an array or a type that implements a collection interface
(e.g. ICollection, IList) like List<T> that can be deserialized from a JSON array.
JsonArrayAttribute can also be added to the type to force it to deserialize from a JSON array.
Path '', line 1, position 1.
When I take a look at the process properties above, everything seems to be JSON-like (except response code). I think I'm missing something...
Hi Dick, Vincent,
I found the cause of the issue. It seems that the value side of the JSON needs to be specified as an array. So something like:
{
"Key": ["Content-Type"], "Value": ["application/json"]
}
Thanks for directing me in the right direction...