Quantcast
Channel: CRM Development forum
Viewing all articles
Browse latest Browse all 8223

SDK WebClientPlugin is very slow

$
0
0

I need a plugin which executes a httpwebrequest and found an example in the SDK. ( WebClientPlugin.cs )

If I use this sample plugin I recognized that it is very slow. The first 5 time I execute the plugin( I registered it synchronal on the create of the account) it takes more than 5 seconds in an CRM online organization until the plugin has finished and the record is saved. I put in some tracing and found out that the plugin is fired very quickly but only the downloaddata is very slow. I tried to use different web pages to go sure that the webpage is not the bottle neck.

It would be great if someone has an idea why this is that slow in an online environment. The same code only takes 200 ms in an winforms application.

The code looks straight forward :

   

using (WebClient client = newWebClient())                {                    byte[] responseBytes = client.DownloadData(_webAddress);                    string response = Encoding.UTF8.GetString(responseBytes);                    //</snippetWebClientPlugin2>                    tracingService.Trace(response.Substring(0, 250));                    // For demonstration purposes, throw an exception so that the response// is shown in the trace dialog of the Microsoft Dynamics CRM user interface.                } 

Does someone have an idea why it is that slow to download the data.

thx

 


Viewing all articles
Browse latest Browse all 8223

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>