locked
CRM Performance Toolkit 2011: HTTP Status 401: Unauthorized on CreateNewNoteForAccount test RRS feed

  • Question

  • Hi!

    I installed a CRM Performance Toolkit 2011 on virtual enviroment which including CRM 2011, SQL Server, Visual Studio etc all in a one box. Installation seems to be done correctly to the point where I tried to run a first test "CreateNewNoteForAccount". It manages to to navigate to homepage but when test tries to do SearchAccounts part using AppGridWebService and reset method I'll get "Unauthorized" exception and test fails.

                // Search for the account name
                AppGridWebService.AppGridWebService ag = new AppGridWebService.AppGridWebService();
                CrmRequest wtr = null;

                try { ag.Reset(gridXml, gridId); }
                catch (crmException x)
                {

    I have debugged the code with Visual Studio + capture data using Fiddler2 and for me it seems that SOAP request is not authenticated. Code trying to call Reset method without any authentication for some odd reason.

    If I go with same test user directly using browser to that webservice, post a same data and invoke a reset method it works. Also if tweak a code and add following line, authentication goes correctly but that lead to another problem that code won't go to catch (crmException x) -section where it should I guess...

    ag.Credentials = System.Net.CredentialCache.DefaultCredentials;

    So anyone have had similar problems? It might be something to do with installation but can't figure out what is wrong.

    Also I can't figure out how that code should ever go to catch -section at all? I found that these SOAP requested should go through crmrequest -class because there "throw new crmException(wtr)", but couldn't find a problem why it won't go through that which might explain that authentication problem also.

    I'm using currently Visual Studio 2010 Ultimate (Trial version) SP1 for this test if that has something to do with that.

    Thursday, December 8, 2011 3:51 PM

Answers

  • Hi Jupek,

     

    First off, I highly recommend using a separate client for the CRM 2011 Performance Toolkit if you are doing any performance testing.  Just in case you missed any of the required steps in your install and setup the toolkit documentation can be found here.

    Can you search for a file called QTAgent.exe.config, open it in notepad and find a node called appSettings the last entry should have a value similar to this node

    Thanks,

    Russ

     

    <add key=”urlkey” value=”crm://homepage/”/>
    


      where homepage is the name of your web server.  Let me know if it exists and if the name is correct.

    Friday, December 9, 2011 4:18 AM
  • Hi Mr.Russ

    Have to ask one question about that urlkey value. Your example included value "crm://homepage/". Because my installation missed this configuration I manually put there this value http://crm2011:5555/ which is starting point to my system. Is it correct or is that crm -some "magic word" there...that might explain that RegistrationPrefix for "crm" what I have been wondering. Have to test this asap...that might be a answer what I'm looking for... :)


    edit: I tested this and crm:://homepage/ is the 'magic' string to fix this problem. So the problem was that my installation failed to modify this value to qtagent config and without knowledge I entered wrong value there and code failed to work. Case is resolved. Thank you for your help!
    Friday, December 9, 2011 2:06 PM

All replies

  • Hi Jupek,

     

    First off, I highly recommend using a separate client for the CRM 2011 Performance Toolkit if you are doing any performance testing.  Just in case you missed any of the required steps in your install and setup the toolkit documentation can be found here.

    Can you search for a file called QTAgent.exe.config, open it in notepad and find a node called appSettings the last entry should have a value similar to this node

    Thanks,

    Russ

     

    <add key=”urlkey” value=”crm://homepage/”/>
    


      where homepage is the name of your web server.  Let me know if it exists and if the name is correct.

    Friday, December 9, 2011 4:18 AM
  • I'm aware that this setup is not for "Performance test". I just wanted to evaluate this tool with two test users for bigger purpose is it working or not.

    Setup missed that QTAgent.Exce.config entry but I found out it myself after debug. And currently I have that enty on that config. So it is fixed. And I have done everything as far I know according this documentation. :( But hard to know what else it migh have been missed because I don't know if there is any setup logs etc. where to check any setup errors.

    Friday, December 9, 2011 6:31 AM
  • Is there any other edits than this urlkey on QTAgent.exe.config or other Visual Studio .config's which installation might have been skipped?

    According the documentation and a code, registration for crmRequestFactory should do the trick and hijack the "native calls" for SOAP requests and wrap it with crmRequest...but it seems for me it is not doing it.

    So this goes without errors...but other hand it seems not do the trick...should that "crm" be something else...my site url is starting as http://crm2011:5555 

    WebRequest.RegisterPrefix("crm", new crmRequestFactory());

    and as stated on my original post authorization and codes similar to following won't ever reach that catch block

    try { agws.Refresh(GridXmlHelper.AccountPage()); }

    catch (crmException x)

    Any ideas what could be the problem?


    Friday, December 9, 2011 7:38 AM
  • Hi Mr.Russ

    Have to ask one question about that urlkey value. Your example included value "crm://homepage/". Because my installation missed this configuration I manually put there this value http://crm2011:5555/ which is starting point to my system. Is it correct or is that crm -some "magic word" there...that might explain that RegistrationPrefix for "crm" what I have been wondering. Have to test this asap...that might be a answer what I'm looking for... :)


    edit: I tested this and crm:://homepage/ is the 'magic' string to fix this problem. So the problem was that my installation failed to modify this value to qtagent config and without knowledge I entered wrong value there and code failed to work. Case is resolved. Thank you for your help!
    Friday, December 9, 2011 2:06 PM
  • That is great to Jupek.  Just to ensure did your EntityManager and LoadTest2010 databases get created in your version of SQL?  Was VSTS installed before the toolkit was?

    Thanks for the feedback.

    Russ

    Friday, December 9, 2011 8:43 PM
  • Both of those databases exists and got created fine...as far I know. :)

    For that VS question I'm not 100% sure. It is possible that first time I ran a setup I only had Visual Studio Premium installed. Then I installed/upgraded VS to Ultimate (trial to check if this work or not) and after uninstalling toolkit and after new setup that config was not edited. Also my Visual Studio is on this enviroment installed to non default location (e:\....) so it there is no decent check for this on installation that might lead to configuration problem.

    Another think I had to manually fix was runpopulate.bat which missed also all SET clauses for properties that BAT uses.

    Monday, December 12, 2011 11:42 AM