Hello Everyone !
I am trying to call a function that is located in an AX class. I am doing this from .Net application in C#.
I am using Microsoft.Dynamics.BusinessConnectorNet.dll
the code that i am using is given below:
Axapta ax;
Object axObject;
ax = new Axapta();
System.Net.NetworkCredential nc = new System.Net.NetworkCredential("username", "pass","domain");
string username = "username";
ax.LogonAs(username.Trim(), "domain", nc, "", "", "", "");
Label1.Text = " logged on to axapta";
axObject = ax.CallStaticClassMethod("TestClass", "returnString", "my parameter");
Label1.Text = axObject.ToString();
but the code gives me the error at the red line
Error: Failed to initialize Business connector.
I have double checked that my credentials are valid.
What might be the error and what is the possible solution ?