Home > Forum > General > Error sending a POST request (System.Net.Http.HttpRequestException)

Error sending a POST request (System.Net.Http.HttpRequestException)
0

Hi,

have you encountered this problem?
The REST action is called on a path that is handled by a recursive action (global).
Execution limits are set to >30s everywhere.
Despite this error, request sometimes reach the target system and sometimes do not, which is very inconvenient.
Do you think this is a problem related to the Webcon application?

Response End
Exceptions:
System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.Http.WinHttpException: Error 12002 calling WINHTTP_CALLBACK_STATUS_REQUEST_ERROR, 'The operation timed out'.
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Threading.Tasks.RendezvousAwaitable`1.GetResult()
at System.Net.Http.WinHttpHandler.<StartRequestAsync>d__122.MoveNext()
--- End of inner exception stack trace ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at WebCon.WorkFlow.BusinessLogic.Actions.Logic.Webservices.REST.RestRequestExecutor.<SendRequestAsync>d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at WebCon.WorkFlow.BusinessLogic.Actions.Logic.Webservices.REST.RestRequestExecutor.<ExecuteRequestAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at WebCon.WorkFlow.BusinessLogic.Actions.Logic.Webservices.REST.InvokeRESTWebServiceAction.<FireActionAsync>d__7.MoveNext()

Other:

Wersja: 7
Czas trwania: 31935 ms

MVP

Hi Radoslaw,

I don't think this is a WEBCON related issue. The big issue here is of course the random timeouts.

I would test the following:
- If it's possible, I would execute the same POST requests with PowerShell for some time and see, whether the behavior is the same. Of course this would be a problem, if this requests creates data and you don't have a test environment on other side.
- If you don't have access to the target system or it doesn't log any incoming requests, setup HTTPToolkit on the WEBCON server and run it as a proxy. This way you will be able to see the outgoing HTTP Requests. Maybe this will help
https://daniels-notes.de/posts/2022/debug-web-service-datasource#configuration-of-http-toolkit


Best regards,
Daniel

MVP

Hi,

we have just run into the same error.

System.Net.Http.WinHttpException: Error 12029 calling WINHTTP_CALLBACK_STATUS_REQUEST_ERROR, 'A connection with the server could not be established'.
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()


We are using an REST action in a for each loop. This worked a few times, but failed in another. My guess is, that we ran into the maximum allowed execution time and the request has been cancelled by WEBCON.

Best regards,
Daniel