//the AX 4.0 application already have the user login account and proxy
account in the //following code
Axapta ax = new Axapta();
try
{
System.Net.NetworkCredential credential = new
System.Net.NetworkCredential("Eddie","MywindowsPassword");
ax.LogonAs("Eddie", null, credential, null, null, null, null);
ax.Logoff();
catch (Exception ex)
{
return ex.ToString();
}
Or simple call ax.Logon(null, null, null, null);
I got error as following:
“Microsoft.Dynamics.BusinessConnectorNet.LogonFailedException: Failed to
establish connection. at Microsoft.Dynamics.BusinessConnectorNet.Axapta.Logon
...”
However, when I create windows application just use as following:
try
{
ax.Logon(null, null, null, null);catch (Exception ex)
{
return ex.ToString();
}
Then work perfectly in the windows form. I do not know why.
Please help.
Thanks a lot
When you connect through the business connector from an ASP.NET site it logs
on as a 'Webuser' which requires a Webuser license for each connection and a
COM connector license.
If you are connecting through the business connector from a Winform/Console
applicaiton it loges on as a 'Worker' and only uses a COM connector license.
If you don't have any webuser licenses you will get that error on login.
Thanks
You'd have to check what licenses you purchased to be sure and if that is
the case you will have to buy some web user licenses. You'll have to contact
the reseller you bought Dynamics from to purchase the licenses. They are
sold in bundles of 25 (I believe) and are based on concurrent users. So if
you'll only have 10 concurrent users, the 25 user license should be fine, but
if you are going to have 75 cuncurrent users you will have to buy that number
of licenses.
Hope that helps.