Search code examples
performance-testingload-testingdynamics-365-operations

Performance testing in Dynamics 365 for Operations - no endpoint listening


Short error description:

Ms.Dynamics.Performance.CreateUsers.exe from PerfSDK throws error

There was no endpoint listening at https://mytest.sandbox.operations.dynamics.com/Services/AxUserManagement/Service.svc/ws2007FedHttp that could accept the message.

Long error description:

I have created a single user C# test from an XML recording and run it with PerfSDK successfully as described in the first part of the PerfSDK and multiuser testing with Visual Studio Online guide.

I am having trouble running multiuser load tests as described in the second part of the lab. The link above seems to be the only resource online describing how a multiuser test can be created from a singleuser test and how Visual Studio Online can be used to run it in a sandbox environment. I've also watched a few videos such as Tools to Measure and Improve Microsoft Dynamics AX Performance, Performance Tools and the like, but none of them explains all the steps that need to be taken in as much detail as the above article.

I've done the following:

  1. Created a recording of a scenario with Task Recorder in Dynamics 365 for Operations.
  2. Created C# perf test from recording in Visual Studio using the PerfSDKSample project from the PerfSDK folder.
  3. Followed all 'Steps to run single user performance test with Perf SDK' from the article;
  4. Built the solution and successfully ran my test from Test Explorer: Internet Explorer opened starting and replaying the scenario that I had recorded.

Note: I used DEV environment usnconeboxax1aos.cloud.onebox.dynamics.com for testing. When I tried using another hostname in CloudEnvironment.Config (a sandbox, e.g. mysandbox.sandbox.operations.dynamics.com), the singleuser test failed with the following error message:

System.TypeInitializationException: The type initializer for 'MS.Dynamics.TestTools.CloudCommonTestUtilities.Authentication.UserManagement' threw an exception. ---> System.ServiceModel.EndpointNotFoundException: There was no endpoint listening at https://mysandbox.sandbox.operations.dynamics.com/Services/AxUserManagement/Service.svc/ws2007FedHttp that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. ---> System.Net.WebException: The remote server returned an error: (404) Not Found..

  1. For multiuser testing, I launched Visual Studio from Visual Studio Online portal https://app.vssps.visualstudio.com/profile/view
  2. I modified the TestSetup method as follows:

Single-user TestSetup:

public void TestSetup()
{
    SetupData();
    _userContext = new UserContext(UserManagement.AdminUser);
    Client = DispatchedClient.DefaultInstance;
    Client.ForceEditMode = false;
    Client.Company = "GB01";
    Client.Open();
}

Multi-user TestSetup:

public void TestSetup()
{
    var testroot = System.Environment.GetEnvironmentVariable("DeploymentDir");
    if (string.IsNullOrEmpty(testroot))
    {
        testroot = System.IO.Directory.GetCurrentDirectory();
    }
    Environment.SetEnvironmentVariable("testroot", testroot);
    if (this.TestContext != null)
    {
        timerProvider = new TimerProvider(this.TestContext);
    }
    SetupData();
    _userContext = new UserContext(UserManagement.AdminUser);
    Client = new DispatchedClientHelper().GetClient();
    Client.ForceEditMode = false;
    Client.Company = "GB01";
    Client.Open();
}
  1. I set the HostName in CloudEnvironment.Config to the sandbox URL e.g. mysandbox.sandbox.operations.dynamics.com.
  2. Logged in to the sandbox machine and installed the certificate I had generated earlier for the single-user testing.
  3. Updated wif.config on the sandbox machine in the same way it had been updated in DEV earlier, and restarted IIS.
  4. Double-clicked vsonline.testsettings in Solution Explorer and used the settings recommended in the above article (accordingly modified for my certificate and test scenario).
  5. Opened SampleLoadTest.loadtest from Solution Explorer and tweaked it to use only my test in the Test Mix node, reduced test duration and user count.
  6. Run the load test.

The load test ended with a few errors. The first TestError is the same as mentioned above:

Initialization method MS.Dynamics.Performance.Application.TaskRecorder.GenJnlBase.TestSetup threw exception. System.TypeInitializationException: System.TypeInitializationException: The type initializer for 'MS.Dynamics.TestTools.CloudCommonTestUtilities.Authentication.UserManagement' threw an exception. ---> System.ServiceModel.EndpointNotFoundException: There was no endpoint listening at https://mysandbox.sandbox.operations.dynamics.com/Services/AxUserManagement/Service.svc/ws2007FedHttp that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. ---> System.Net.WebException: The remote server returned an error: (404) Not Found..

  1. Finally, even though I was able to run Ms.Dynamics.Performance.CreateUsers.exe on my DEV machine successfully (a number of test AX users were created in usnconeboxax1aos.cloud.onebox.dynamics.com), when the sandbox environment URL was set in CloudEnvironment.Config, Ms.Dynamics.Performance.CreateUsers.exe failed with same error:

C:\PerfSDK>Ms.Dynamics.Performance.CreateUsers.exe 3 GB01 Failed with the following error: System.TypeInitializationException: The type initializer for 'MS.Dynamics.TestTools.CloudCommonTestUtilities.Authentication.UserManagement' threw an exception. ---> System.ServiceModel.EndpointNotFoundException: There was no endpoint listening at https://mytest.sandbox.operations.dynamics.com/Services/AxUserManagement/Service.svc/ws2007FedHttp that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. ... Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at MS.Dynamics.TestTools.CloudCommonTestUtilities.AxUserManagementServiceReference.IAxUserManagement.EnumUsers() at MS.Dynamics.TestTools.CloudCommonTestUtilities.Authentication.UserManagement.PopulateAxUsers() at MS.Dynamics.TestTools.CloudCommonTestUtilities.Authentication.UserManagement..cctor() --- End of inner exception stack trace --- at MS.Dynamics.TestTools.CloudCommonTestUtilities.Authentication.UserManagement.get_AdminUser() at MS.Dynamics.Performance.CreateUsers.Program.Main(String[] args)


Solution

  • As per the walkthrough,

    If you have an ARR-enabled environment, i.e. you have 2 endpoints like this:

    • apr-arr8aossoap.axcloud.test.dynamics.com
    • apr-arr8aos.axcloud.test.dynamics.com

    You would need to enter both endpoints in CloudEnvironment.Config

    endpoints

    The no endpoint listening error can be resolved by specifying correct SOAP hostname, e.g.

    <ExecutionConfigurations Key="HostName" Value="mysandbox.sandbox.operations.dynamics.com" />
    <ExecutionConfigurations Key="SoapHostName" Value="mysandboxaossoap.sandbox.operations.dynamics.com" />