Discussion:
ASP.NET Business Connector example?
(too old to reply)
Justin Biggs
2009-02-24 21:01:02 UTC
Permalink
Hello,

I'm trying to use the business connector in an ASP.NET page to try and logon
to our AX 4.0 SP1 system. It's failing on the logon method with the
exception "Microsoft.Dynamics.BusinessConnectorNet.LogonFailedException:
Failed to logon to Axapta." I've tried setting the business connector in the
Dynamics AX Configuration utility on the web server where the page is being
hosted, but it hasn't worked.

Am I missing a step on how to set up the web server to properly use the
connector? Is there any configuration I need to do in IIS that I maybe
haven't? The code on the page does nothing but try to log on to the system:

Sub page_load()

Dim ax As Object =
Server.CreateObject("Microsoft.Dynamics.BusinessConnectorNet.Axapta")

Dim orderContainer As Object

ax.Logon("", "", "", "")
orderContainer = ax.CreateAxaptaContainer()

ax.Logoff()

End Sub
--
Best Regards,
Justin
KlaasD
2009-02-25 09:57:03 UTC
Permalink
Hi Justin,

Are you specifying the correct parameters in your axapta object?

ax.Logon("", "", "", "")
should be:
ax.Logon(company, language, serverName, configurationName);
-> ax.Logon("DAT", "en-us", theServer, theConfigName);

Here are the things I would try:
Check if the user you are using to log in has access to AX (is in the user
list), and has admin access (to be sure that isn’t the problem).
Then log on in Windows on with that user, and create a configuration of the
type "business connector" (not local client), and use that in you ax.logon()
method.

Kind Regards,
Klaas.
Post by Justin Biggs
Hello,
I'm trying to use the business connector in an ASP.NET page to try and logon
to our AX 4.0 SP1 system. It's failing on the logon method with the
Failed to logon to Axapta." I've tried setting the business connector in the
Dynamics AX Configuration utility on the web server where the page is being
hosted, but it hasn't worked.
Am I missing a step on how to set up the web server to properly use the
connector? Is there any configuration I need to do in IIS that I maybe
Sub page_load()
Dim ax As Object =
Server.CreateObject("Microsoft.Dynamics.BusinessConnectorNet.Axapta")
Dim orderContainer As Object
ax.Logon("", "", "", "")
orderContainer = ax.CreateAxaptaContainer()
ax.Logoff()
End Sub
--
Best Regards,
Justin
Justin Biggs
2009-02-25 16:43:01 UTC
Permalink
Hi Klaas,

I was relying on the default parameters to be used, since the company and
language and such would be pulled from my dynamics user once the connection
was established.

I think I found where I went wrong. From a web page, I need to use
LogonAs() instead of Logon(). Followed the advice of the axaptapedia article
found here: http://www.axaptapedia.com/.NET_Integration, under the "Business
Connector in a Web Application" section. One thing to note, using the
bcproxy account as the user to logon as did not work, but using my own userid
did. The network credentials object created for the business connector did
work. I'll eventually have to change the user the page is called from, but I
was able to look in the Online users form in the instance I wanted to connect
to and see a business connector user logged in.

Thanks for the advice Klaas.
--
Best Regards,
Justin
Post by KlaasD
Hi Justin,
Are you specifying the correct parameters in your axapta object?
ax.Logon("", "", "", "")
ax.Logon(company, language, serverName, configurationName);
-> ax.Logon("DAT", "en-us", theServer, theConfigName);
Check if the user you are using to log in has access to AX (is in the user
list), and has admin access (to be sure that isn’t the problem).
Then log on in Windows on with that user, and create a configuration of the
type "business connector" (not local client), and use that in you ax.logon()
method.
Kind Regards,
Klaas.
Post by Justin Biggs
Hello,
I'm trying to use the business connector in an ASP.NET page to try and logon
to our AX 4.0 SP1 system. It's failing on the logon method with the
Failed to logon to Axapta." I've tried setting the business connector in the
Dynamics AX Configuration utility on the web server where the page is being
hosted, but it hasn't worked.
Am I missing a step on how to set up the web server to properly use the
connector? Is there any configuration I need to do in IIS that I maybe
Sub page_load()
Dim ax As Object =
Server.CreateObject("Microsoft.Dynamics.BusinessConnectorNet.Axapta")
Dim orderContainer As Object
ax.Logon("", "", "", "")
orderContainer = ax.CreateAxaptaContainer()
ax.Logoff()
End Sub
--
Best Regards,
Justin
raj2k09
2009-03-10 14:29:03 UTC
Permalink
Dear Justin,

I am a newbie for X++ programming, I have a task for acessing Axapta Server
using a WebService. Can u pl tell me the parameters for the LogonAs() as the
parameters which I passed are not accepting.
Post by Justin Biggs
Hi Klaas,
I was relying on the default parameters to be used, since the company and
language and such would be pulled from my dynamics user once the connection
was established.
I think I found where I went wrong. From a web page, I need to use
LogonAs() instead of Logon(). Followed the advice of the axaptapedia article
found here: http://www.axaptapedia.com/.NET_Integration, under the "Business
Connector in a Web Application" section. One thing to note, using the
bcproxy account as the user to logon as did not work, but using my own userid
did. The network credentials object created for the business connector did
work. I'll eventually have to change the user the page is called from, but I
was able to look in the Online users form in the instance I wanted to connect
to and see a business connector user logged in.
Thanks for the advice Klaas.
--
Best Regards,
Justin
Post by KlaasD
Hi Justin,
Are you specifying the correct parameters in your axapta object?
ax.Logon("", "", "", "")
ax.Logon(company, language, serverName, configurationName);
-> ax.Logon("DAT", "en-us", theServer, theConfigName);
Check if the user you are using to log in has access to AX (is in the user
list), and has admin access (to be sure that isn’t the problem).
Then log on in Windows on with that user, and create a configuration of the
type "business connector" (not local client), and use that in you ax.logon()
method.
Kind Regards,
Klaas.
Post by Justin Biggs
Hello,
I'm trying to use the business connector in an ASP.NET page to try and logon
to our AX 4.0 SP1 system. It's failing on the logon method with the
Failed to logon to Axapta." I've tried setting the business connector in the
Dynamics AX Configuration utility on the web server where the page is being
hosted, but it hasn't worked.
Am I missing a step on how to set up the web server to properly use the
connector? Is there any configuration I need to do in IIS that I maybe
Sub page_load()
Dim ax As Object =
Server.CreateObject("Microsoft.Dynamics.BusinessConnectorNet.Axapta")
Dim orderContainer As Object
ax.Logon("", "", "", "")
orderContainer = ax.CreateAxaptaContainer()
ax.Logoff()
End Sub
--
Best Regards,
Justin
Loading...