Call REST failure

0
Hello, in a Mircoflow I am trying to use the Call REST to call a restful api running locally when button clicked (resful api is written with asp.net and the api is tested fine with postman and works fine). This returns error without any additional information (Error message: “An error occured. Please contact your system administrator”). Any hint on what I have missed?
asked
3 answers
1

Apparently, the server you call returns with an HTTP 307 code (a rather rare one, I would say).

Mendix does not automatically follow redirects, so you need to figure the actual endpoint you need.

You can find out more information using custom error handling, something I would always recommend for REST actions. Set the error handling for example on Custom with(out) rollback and create another outgoing flow.

Now to investigate the problem further, you can insert a breakpoint and see in the variables pane what the latestHttpResponse is the server returned. You can even retrieve the http headers from the latest http response (see screenshot).

Hopefully this helps a bit!

Regards, Johan

answered
1

Check what request your app has sent. Do so in Studio Pro, in the console-pane, click menu-option ‘Advanced’ → ‘Set log levels’, set ‘REST Consume’ to trace. You will now see the exact http-message.

answered
0

If you are running mendix in Mendix studio pro, you should be able to see an error in the console pane of your mendix studio pro. in the cloud, you can access the error log in the cloud.

If you don't see an error in the console, it may be that you are actually seeing a timeout: the call takes longer than mendix likes. You can make Mendix wait longer by running the microflow asynchronous: https://docs.mendix.com/refguide7/starting-microflows#4-execution

I hope this helps.

answered