Tuesday 20 March 2012

Calling Axapta 2009 Static Method from outside the domain using LogonAs

Dear All here is an article to how to call an Axapta static method from outside the domain server through a web service and business connector


Dim creds As New System.Net.NetworkCredential()
creds.Domain = ConfigurationSettings.AppSettings("Domain").ToString '
creds.UserName = ConfigurationSettings.AppSettings("ProxyName").ToString
creds.Password = ConfigurationSettings.AppSettings("ProxyPassword").ToString            ax.LogonAs(ConfigurationSettings.AppSettings("AdminName").ToString,ConfigurationSettings.AppSettings("Domain").ToString, creds, "", "", ConfigurationSettings.AppSettings("AXServer").ToString, "")

ax.CallStaticClassMethod("ClassName", "MethodName",)

ax.Logoff()

Note: Be sure that the proxy user name and password will be the proxy defined inside the Axapta which we can get from here Administration > Setup > Security > System Service account
Above the business connector  there is the alias name and the domain which we will use in the Network Credential parameters

No comments:

Post a Comment