web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Calling a webservice from within a plugin: The underlying connection was closed

(0) ShareShare
ReportReport
Posted on by

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.

VatTester.png

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)
  • David Jennaway Profile Picture
    14,065 on at

    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 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans