
Microsoft Dynamics 365 Online Version 1612 (8.2.2.128) (DB 8.2.2.128) online
Hi, during plugin execution we call an external webservice. It is a SOAP webservice. About 1 of 20 of these requests fails because of the following reason: "The underlying connection was closed: A connection that was expected to be kept alive was closed by the server."
Status: KeepAliveFailure
InnerException: "Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host."
In some very rare cases we even got a 401 instead.
To investiage this we created an action in CRM, that also calls that webservice. We then created a tool that endlessly triggers the execution of this action and right after this the tool also calls the webservice from the local machine. We found out, that the requests only get interrupted when the call is made from within CRM. There was not a single error when calling the webservice from the local machine. We triggered about 200 requests this way.
When the connection gets cut, it allways happens after around 19 seconds execution time (this includes the time it takes to trigger the CRM action and get the response).
We tracked all the network traffic on the webserver where the webservice is running and also on the machine, where the firewall is installed, which is inbetween the webserver and the internet. We didn't find any suspicious things, so I came to the idea that the connection might already get cut within the Microsoft infrastructure (some gateway server or proxy or what not).
According to this post it is not a thing on the senders side, but either something on the recievers side or on the way to there.
Did anybody else experience such a behavior or even knows what is going on there? Once again: the requests only sometimes fail, when they are done "from wihin the CRM instance".
Would it help to change our plugin to a "Azure-aware plug-in"? Is using a Azure service endpoint any other than directly calling a webservice?
*This post is locked for comments
I have the same question (0)The fact that the failures always happen after around 19 seconds is suspicious, though from your screenshot it looks like some calls can take longer than 19 seconds and still succeed, so its not a simple timeout issue.
I think your best approach would be create an Azure-aware plugin. If you do this, CRM will be responsible for the communication to the Azure endpoint via a standard robust mechanism, then within Azure you have more control over the communication to your web service