Long Delay Conencting To CRM

I am in the process of building a Class Library to provide
communication between a custom desktop application Microsoft CRM 4.0.
So far everything is working pretty well, I can connect to the CRM
server, read data in to my application and write modified data back to
CRM.
The problem however is with the initial connection to CRM which takes
anything from 15-30 seconds. From an end-user's perspective this is an
eternity.

Below is the method I'm using to connect to CRM, can anyone suggest
any changes that will speed this up?

public class AppFunctions
{
    private static CrmService _service;

    public AppFunctions(string serverName, string orgName)
    {
        CrmAuthenticationToken token = new CrmAuthenticationToken();
        token.AuthenticationType = 0;
        token.OrganizationName = orgName;

         _service = new CrmService();
        _service.Credentials =
System.Net.CredentialCache.DefaultCredentials;

        _service.CrmAuthenticationTokenValue = token;
        _service.Url = string.Format("http://{0}/mscrmservices/2007/
crmservice.asmx", serverName);
    }

    <Other methods>
}
0
3/28/2008 11:22:20 AM
crm 35858 articles. 1 followers. Follow

2 Replies
481 Views

Similar Articles

[PageSpeed] 15

The initial delay when using the CrmService is caused by two things. First 
the CrmService proxy class has to be compiled (from IL to native) and the 
serialization has to be loaded. This requires a large amount of processing 
and therefor time. This compilation only occurs the first time an instance of 
the crmservice proxy is created in an AppDomain.

Second when a call is executed on the server for the first time additional 
class and such may need to be loaded.

This normal behaviour for the .NET framework. You can optimize the load time 
for the CrmService by generating a new service proxy using the WSDL tool and 
clearing out any requests and object you don't use. The problem with doing 
this is that it is a lot of work.

-- 
Patrick Verbeeten (MCPD)
Lead Developer 
Aviva IT  

Extended Entity and Plug-in browser: 
http://www.patrickverbeeten.com/maps/CrmTool.aspx



"lord.torall@gmail.com" wrote:

> I am in the process of building a Class Library to provide
> communication between a custom desktop application Microsoft CRM 4.0.
> So far everything is working pretty well, I can connect to the CRM
> server, read data in to my application and write modified data back to
> CRM.
> The problem however is with the initial connection to CRM which takes
> anything from 15-30 seconds. From an end-user's perspective this is an
> eternity.
> 
> Below is the method I'm using to connect to CRM, can anyone suggest
> any changes that will speed this up?
> 
> public class AppFunctions
> {
>     private static CrmService _service;
> 
>     public AppFunctions(string serverName, string orgName)
>     {
>         CrmAuthenticationToken token = new CrmAuthenticationToken();
>         token.AuthenticationType = 0;
>         token.OrganizationName = orgName;
> 
>          _service = new CrmService();
>         _service.Credentials =
> System.Net.CredentialCache.DefaultCredentials;
> 
>         _service.CrmAuthenticationTokenValue = token;
>         _service.Url = string.Format("http://{0}/mscrmservices/2007/
> crmservice.asmx", serverName);
>     }
> 
>     <Other methods>
> }
> 
0
Patrick2861 (490)
3/28/2008 1:34:01 PM
On Mar 28, 6:22=A0am, lord.tor...@gmail.com wrote:
> I am in the process of building a Class Library to provide
> communication between a custom desktop application Microsoft CRM 4.0.
> So far everything is working pretty well, I can connect to the CRM
> server, read data in to my application and write modified data back to
> CRM.
> The problem however is with the initial connection to CRM which takes
> anything from 15-30 seconds. From an end-user's perspective this is an
> eternity.
>
> Below is the method I'm using to connect to CRM, can anyone suggest
> any changes that will speed this up?
>
> public class AppFunctions
> {
> =A0 =A0 private static CrmService _service;
>
> =A0 =A0 public AppFunctions(string serverName, string orgName)
> =A0 =A0 {
> =A0 =A0 =A0 =A0 CrmAuthenticationToken token =3D new CrmAuthenticationToke=
n();
> =A0 =A0 =A0 =A0 token.AuthenticationType =3D 0;
> =A0 =A0 =A0 =A0 token.OrganizationName =3D orgName;
>
> =A0 =A0 =A0 =A0 =A0_service =3D new CrmService();
> =A0 =A0 =A0 =A0 _service.Credentials =3D
> System.Net.CredentialCache.DefaultCredentials;
>
> =A0 =A0 =A0 =A0 _service.CrmAuthenticationTokenValue =3D token;
> =A0 =A0 =A0 =A0 _service.Url =3D string.Format("http://{0}/mscrmservices/2=
007/
> crmservice.asmx", serverName);
> =A0 =A0 }
>
> =A0 =A0 <Other methods>
>
>
>
> }- Hide quoted text -
>
> - Show quoted text -

I had the same situation, I found the following issues:

1.- the issue was that when I created the Web service reference, I
make the reference to the Development server, whenI deployed to the
production server it was taking longer.

The server was hardcoded on the Wsdl proxy class

        public CrmService() {
            this.Url =3D "http://crmdevlopment:5555/mscrmservices/2006/
crmservice.asmx";
        }


Solution:

Make modifications to the proxy class and create a new CrmService
override

public CrmService(string UrlPath)
{
    if (String.IsNullOrEmpty(UrlPath))
    {
            this.Url =3D "http://crmdevlopment:5555/mscrmservices/2006/
crmservice.asmx";

    }
    else
    {
           base.Url =3D UrlPath.Trim();
    }
}


2.-User access and Authentication was not correct.


Hope this will help

Abe Saldana
http://crmbuzz.net

0
sabecas (4)
3/30/2008 4:35:56 AM
Reply:

Similar Artilces:

Deleting CRM User!
I am looking to find ouit how one can delete a CRM USer and have the license go back into the pool of unused licenses. I can only find a way to disable the account. The users that I wanted to delete are in the disable user account view right now but I need to delete them and I need the licenses. I do not believe that you can delete using the supplied interfaces. You simply remove the license as stated below. If you were to remove or delete a user, there could be many orphaned entities. "Joseph Michaud" <joseph@vndinc.com> wrote in message news:#Qfbbc7UDHA.964@TK2MS...

error LNK2001: unresolved external symbol "long __cdecl _com_dispatch_method(struct IDispatch *,long,unsigned short,unsigned short,void *,wchar_t const *,...)" (?_com_dispatch_method@@YAJPAUIDispatch@
Hi, I have installed Visual Studio Express 2005, and the platform SDK. I'm trying to compile, but get this linker error. The only reference I found on the web was a post of this person describing the possible cause: http://www.eggheadcafe.com/ng/microsoft.public.platformsdk.sdk_install/post20679802.asp Any clues, hints.. ? Leo Well, since you didn't bother to put the error message in the body of the text, it is a bit hard to read. Please do not put content in the headers. I only see the first segment of the header in my reader. A header that contains interesting informatio...

Delay in execution when Button is clicked.
Hi, I'm developing an application using MFC that plays WAV audio files. My user interface consists of 3 buttons - Play, Pause and Stop. When I click the play button, my program Reads the WAV file in chunks of 1024bytes and stores them in a static array. The array is processed in another function and the array is refilled in a while loop. On clicking the Pause button the file being played should be Paused. I am facing some difficulty here. Although the play and pause are working fine, there is a delay in execution for the "OnPauseClick". (When the pause button is clicked). I...

CRM Truncating Data Issue
I have a problem with our CRM system displaying the following error message; "The data you have entered for one or more fields is too long. The record will be saved in CRM with truncated data" I have read the KB article that refers to this message http://support.microsoft.com/kb/923071 and would be interested to know 1 - if anyone is having the same problem with the Desktop client and not just the Laptop client? 2 - Is it possible that this issue will occur when the Exchange server is experiencing periods of intense activity. The result being that Outlook has problems contac...

CRM 4.0: Report Wizard - Query execution failed for data set 'DSMain'.
How come the following report made by Report Wizard fail ? An error has occurred during report processing. Query execution failed for data set 'DSMain'. The column 'accountid' was specified multiple times for 'account0'. The report is designed as follows: New Report, Start a new report, Reportname = "test" Primary record type : Accounts Use saved view: Active Accounts Add a single column = AccountName All the rest is default choices. Changing saved view to My Active Accounts yields the same result. Changing saved view to Accounts: Responded to Campaingns ...

Milo: What is microsoft.windowslive.translator.btn? Name too long
In "C:\Documents and Settings\[myname]\Application Data\Microsoft\Windows Live\Toolbar\Custom Buttons", there is a folder called microsoft.windowslive.translator.btn that is causing me to have trouble backing up my computer. I'm being told that that path or folder name is too long. At first I thought it was the path, but trying to copy microsoft.windowslive.translator.btn DIRECTLY into the MyDocuments folder caused the same error, so now I'm pretty sure that it’s the 36 characters in that folder name that is the problem. Sure enough, when I renamed a copy...

Track Contact in CRM
I have a set of Outlook Contacts. When I try to "Track" the contact to be a CRM contact, I receive an error message indicating that the contact is not valid for promotion. If I created a new contact in Outlook, it works fine. This issue is only happening for the existing contacts prior to having CRM installed. This is also unique to one workstation. Anybody have other troubleshooting tips? Try looking at all the contact fields on the Outlook contact. I will bet you will find a user defined or other non-standard field populated. Not sure on OL 2003 but on OL 2007 there is an ...

ACT! or CRM 3.0?
Hi, I am currently using ACT! for my clients...and I am thinking of switching to CRM3.0 1) ACT! users share the same database and see the same customer contact info etc? How do I do that with CRM3.0 2) How do I check other user's calendar's in CRM and get an overall view of all my sales staff and their calendars. Its not that obvious with CRM 3.0? Thanks Elvis CRM uses a SQL database that all users access. However, you can use very granular security roles in CRM to restrict what users can view, edit, or delete. CRM is still lacking an easy way to get high-level views of emp...

crm-functionality in outgoing mails created by third-party tools
starting a new mail from Outlook opens a form with CRM-functionality (buttons). starting a new mail by any other application (to be sended by outlook) opens a form without CRM-functionality. Any suggestions? ...

Long Filename Hunter
hello, is the anyone know of a program/freeware that can search the disk for files with "long" file names? it is laborious to drill down dozens of folders and hundreds/thousands of subfolders hunting down down long file names. for example I found a couple of tiles with filenames as long as a sentence, obviously using all the amount allotted for naming a file. thanks... ~db -- db���`�...�><)))�> DatabaseBen, Retired Professional - Systems Analyst - Database Developer - Accountancy - Veteran of the Armed Forces - Microsoft Partner...

CRM Application Professional exam
I've looked almost everywhere, trying to get more information about the exam but with no luck. There does not appear to be any material available. I attended the course, the instructor is extremely professional and knows his stuff. The Training Kit provided covers exactly what is in the exam. I passed with 86% doing the course and 1 days study. Also found the help and tutorial in CRM most helpful. "O.K." wrote: > I've looked almost everywhere, trying to get more information about the exam > but with no luck. I can add to this. The link below is to the CRM CSA...

Replace Cell Address in A Long Formula
From time to time, I need to do some change in some very long formula. For example: =TRIM(IF(ISERROR(FIND(" ",B46,FIND(" ",B46,1)+2)),MID(B46,FIND(" ",B46,1)+1,LEN(B46)),MID(B46,FIND(" ",B46,FIND(" ",B46)+2),LEN(B46)))) I want to replace all the "B46" with "F18". Is there a easier way? Thanks. One quick and dirty way is to Edit>Replace B46 with F18. HTH Anders Silven "plumstone" <plumstone@discussions.microsoft.com> skrev i meddelandet news:29A2448B-1055-4847-9779-EA0FDDA5C05D@microsoft.com... > From...

Long Long Long Nested If Function
Hello, I need some help on a very long nested if formula. Or at least thats the type that I have been trying to use to get the calculations on my spreadsheet. I have this formula which is working for me but it is only one of the 5 variables I need to include in it. 1) =IF(B5="cdy",IF(P23=20,1625,(IF(P23=40,1875,2200)))) to this formula I need to add =IF(B5="nwr",IF(P23=20,850,(IF(P23=40,935,1260)))) =IF(B5="lsp",IF(P23=20,1125,(IF(P23=40,1225,1550)))) =IF(B5="mtrl",IF(P23=20,1035,(IF(P23=40,1150,1500)))) =IF(B5="trto",IF(P...

CRM & VPNs
I'm trying to connect to CRM via a VPN, but it doesn't seem to be working. Any special considerations? I can connect to another "intranet", but not CRM. -- Brandon IT Director Office Equipment & Supplies at http://www.presentationsdirect.com whats the message you get Brandon "Brandon S." <bsmith@presentationsdirect.nospam.com> wrote in message news:#Gj#ETiUDHA.3220@tk2msftngp13.phx.gbl... > I'm trying to connect to CRM via a VPN, but it doesn't seem to be working. > Any special considerations? I can connect to another "intranet&qu...

Long Print Times w/ Publisher mail merge
I frequently have mail merge documents cretaed in Pub 2007. They work great, but it takes forever publisher to release/spool these documents to the printer, and for the documents to print. I think I understand why this happens, what I am after is a way to print faster. Does anyone have any tricks to reduce the file size that is sent to the printer? Surely there must be a way around this, a way to print these mail merges faster. Anyone? Do you have a lot of images? Gradients? Is your printer driver current? Have you looked at the printer settings? Can you change the spooler settings, do...

an error appeared when some one trying to save any thing on CRM 3.
Hi All, we have CRM 3.0 installed in our network, resentlly users start suffering from an error appeared when saving any kind of data on CRM web client, the fact that dtat are not saved as well. I checked logs on CRM server, and I noted that there are a lot of c360 events in event viewr, and am not sure about another event related to kerberos error if it's affecting CRM or not? any one can advice please?? MSN no one to help with this... "Mohammad S Najdawi" wrote: > Hi All, > we have CRM 3.0 installed in our network, resentlly users start suffering > from an e...

Import Contacts from Outlook into CRM as Accounts
I have a customer with about 800 Contacts within Outlook and I need to import them into CRM as accounts. How can this be done easily? Is there an easy way to do this, or another way to go about getting this done? Mike, I will try and answer this. First, you should understand that Outllook stores all of its data (Contacts, Mail Messages, Tasks, etc.) in a PST file (usually contact.pst) and this file is usually in your profile folder (C:\Documents and Settings\kevin\Local Settings\Application Data\Microsoft\Outlook). Note: There should or may be other PST files there as well (maybe ba...

how long does outlook 2003 save sent items?
i just looked today and all of my sent items from the past 4 years are GONE!!! i do not use archiving, and i have checked my old archive folder for them, they are not there. any help would be much appreciated - r gatestoo <gatestoo@hotmail.com> wrote: > i just looked today and all of my sent items from the past 4 years are > GONE!!! Then you deleted them somehow or are hiding them with a view filter because Outlook doesn't delete anything automatically, unless you've instructed it to do so. -- Brian Tillman ...

CRM to CRM data import
I am trying to figure out if its possible to import data into a MS CRM system from an existing MS CRM. We wanted to change the main Organization Unit but found out that its not possible, now we are trying to get another instance up and import data from old instance. Any comments/help? Thanks Unfortunately, you need to use the CRM Data Migration Framework. Mike "Farooq" <farooq@managepoint.com> wrote in message news:%23egr8Dl%23DHA.1268@TK2MSFTNGP12.phx.gbl... > I am trying to figure out if its possible to import data into a MS CRM > system from an existing MS CRM. ...

Problems with CRM 3.0 install
I'm sure that I've just done something idiotic, but I'm throwing myself on the mercy of the group. I've installed CRM 3.0 Small Business on SBS2003 Standard server. The install seemed to go ok, but I'm having the following problems that I can't seem to resolve: 1) I can connect from my laptop to the crm server via IE using http:<url>:5555, but I cannot get the installed version of the CRM client to work on my laptop. I keep getting the error message that it cannot communicate with the crm server. 2) From the CRM Web interface I can send an email directly to a ...

CRM adding tags when sending email
So I sent an email with the following subject line: Your interest in our click fraud seminars It appeared with the following subject line: Your interest in our click fraud seminars CRM:00330002 Is there a way to get rid of the CRM tag? -- Vincent Granville www.datashaping.com Hi, You can remove that easier by going to Settings --> Settings --> Organization Settings --> System Settings -- > Email Tracking Track Email checkbox, change it to no. Click Ok to save the changes. Hope this helps. Darren Liu Crowe http://www.crowecrm.com On Aug 7, 4:50 pm, nonickname <datashap....

Going CRM Offline
I am getting same error too. ...

long, LONG anf LPARAM
Hi Guys, A very Basic Question.Can anyone tell me whats exactly the difference between long, LONG and LPARAM in windows.If they all are same then what was the need to having 3 different names.any idea..?? thanks and regards, Sada "sada" <sadashiv.borkar@gmail.com> wrote: >Hi Guys, > A very Basic Question.Can anyone tell me whats exactly the >difference between > long, LONG and LPARAM in windows.If they all are same then >what was the need to having 3 different names.any idea..?? "long" is a primitive type in C++. Windo...

CRM Install Problems
Greets All. I'm trying to install CRM server from the MS Action Pack on SBS2k. I think I have all the prerequisites taken care of, SQL installs fine, exchange installs ok and even CRM seems to be happy...it even gets to where it's removing installation files. But then, at the very end...BAM! "Failed to install Mircrosoft Customer Relationship Mangement Server. Failed to provision your initial business. Failed to create organization. Unknown error. (80041A04)" Anyone run into this one and have some pointers? Also on a side note, I kind of inherited a preexisting d...

How long is too long for a post in this forum?
I tried to send the text of an error window that popped up in Excel, along with some specific questions. I learned that one is not allowed to insert a JPG, so I attached a couple. Then I got the too long message. I trimmed up the body of the message and removed one JPG attachment and tried again. This time, the system gave me a similar too long message and deleted my outboxed message. Each JPG file was only 60KB in size So how long is too long, and how can we tell in advance of the system deleting the whole message? Please do NOT attach anything to posts here. You will NOT make ...