Discussion:
AX4 Business connector Login
(too old to reply)
Mau
2006-09-04 13:41:02 UTC
Permalink
Im having problems logging in via Business connector with a webservice. The
problem is that there is no user account on the server running te webservice.
I tried using
Axapta.LogonAs("USER", "THEDOMAIN","", "", "", "", "", "THESERVER",
"THECONFIG");

This works on my local machine, but not on the server. How would I log in to
Ax4? Do I need to setup a configuration specially for the business connector?
I have installed Ax4 client and the .NET and .COM businessconnector, and I
am using the .COM businessconnection within C#.

Please help
Mau
2006-09-04 14:08:01 UTC
Permalink
My webservice is working fine, and the business connector is also working
fine. Because I can instantiate axapta objects. but as soon as I log in, it
fails.
Post by Mau
Im having problems logging in via Business connector with a webservice. The
problem is that there is no user account on the server running te webservice.
I tried using
Axapta.LogonAs("USER", "THEDOMAIN","", "", "", "", "", "THESERVER",
"THECONFIG");
This works on my local machine, but not on the server. How would I log in to
Ax4? Do I need to setup a configuration specially for the business connector?
I have installed Ax4 client and the .NET and .COM businessconnector, and I
am using the .COM businessconnection within C#.
Please help
Mau
2006-09-04 15:31:02 UTC
Permalink
When I run the webapp from Visual studio it works perfectly, but when I use
IIS I get the following error:
System.Runtime.InteropServices.COMException: Failed to initialize Business
connector.
at AxaptaCOMConnector.Axapta3Class.LogonAs(Object userName, Object
domain, Object bcProxyAccountUsername, Object bcProxyAccountDomain, Object
bcProxyAccountPassword, Object company, Object language, Object objectServer,
Object configuration)
at MIEService.saveToAx(String xml) in
c:\Inetpub\wwwroot\Adcorp\App_Code\Service.cs:line 242
at MIEService.kmiePutResult(String kmieUser, String kmiePass, Int32
kmieSys, String kmieXml) in
c:\Inetpub\wwwroot\Adcorp\App_Code\Service.cs:line 109




the code :

Axapta3 Axapta;
IAxaptaObject thisClass;
Axapta = new Axapta3();
Axapta.LogonAs("MViljoen", "SISZA","", "", "", "", "", "SISAPP1",
"AxDev_var");
thisClass = Axapta.CreateObject("SISSaveMIEResult", null, null,
null, null, null, null);
Axapta.Refresh();
thisClass.Call("save", xml, null, null, null, null, null);
Axapta.Logoff();


LogonAs fails. I think it must be some config setting in IIS! please help!
Rodion Pronin
2008-01-14 21:35:05 UTC
Permalink
Hi Mau,

I have the same thing, but instead of IIS, I'm trying to login to AX via
standard windows service. and I'm getting the same error, did you figure out
why it was breaking?

Rodion
Mau
2008-01-15 13:31:01 UTC
Permalink
Hi,

Yes, firstly you should check that the user you are using to log on to Ax is
part of Active Directory. Then in Ax the business connector proxy need to be
set as this user.

Then using the .Net business connector try:
Ax = new Axapta();
Ax.LogonAs(user,
domain,
new System.Net.NetworkCredential(user, password,
domain),
"",
"",
objectServer,
null);

The objectServer should be the servername and port: "servername:port".
Post by Rodion Pronin
Hi Mau,
I have the same thing, but instead of IIS, I'm trying to login to AX via
standard windows service. and I'm getting the same error, did you figure out
why it was breaking?
Rodion
Rodion Pronin
2008-01-15 17:36:04 UTC
Permalink
Hi Mau,

Yes I've tried that, and it works with little exception. You didn't pass
configuration name to LogonAs function. your last parameter is null.

if I were to pass a legit configuration name, it would stop working, giving
me the same error. the funny part is however that if I were to do it from
winforms app, it would work just as fine, only from win service it wouldn't...

Rodion
bhuvana
2008-03-06 10:43:02 UTC
Permalink
Hi,

I am trying to call the logon method from outlook VBA code, but though i
tried all the possibility of the logon parameters, it throws some error.
please advise
Post by Rodion Pronin
Hi Mau,
Yes I've tried that, and it works with little exception. You didn't pass
configuration name to LogonAs function. your last parameter is null.
if I were to pass a legit configuration name, it would stop working, giving
me the same error. the funny part is however that if I were to do it from
winforms app, it would work just as fine, only from win service it wouldn't...
Rodion
Loading...