Hi Joel,
The 8th parameter to Axapta.Logon2 is a boolean value specifying whether the user credentials are for a web user or not. If not then it should look like this. Axapta.Logon2("Admin","adminpwd","tx2","","","",",false,","); Regards, -- Luis Mourão [EMAIL PROTECTED] --- In [EMAIL PROTECTED], "Joel WU" <[EMAIL PROTECTED]> wrote: > Hi all: > > > > I have the problem when I try to test the Webservice using C# using the > Axapta COM Connector > > I get a exception when I try to logon to Axpata.. However I won't have such > error when I write a Windows Application using C# > > Any one know what is happening to my code? > > > > Regards, > > Joel > > > > using System; > > using System.Collections; > > using System.ComponentModel; > > using System.Data; > > using System.Diagnostics; > > using System.Web; > > using System.Web.Services; > > using System.Data.SqlClient; > > namespace AxaptaConnector > > { > > /// <summary> > > /// Summary description for Service1. > > /// </summary> > > public class AxaptaService : System.Web.Services.WebService > > { > > public AxaptaService() > > { > > //CODEGEN: This call is required by the ASP.NET Web Services > Designer > > InitializeComponent(); > > } > > > > #region Component Designer generated code > > > > //Required by the Web Services Designer > > private IContainer components = null; > > > > private void InitializeComponent() > > { > > } > > protected override void Dispose( bool disposing ) > > { > > if(disposing && components != null) > > { > > components.Dispose(); > > } > > base.Dispose(disposing); > > } > > > > #endregion > > > > [WebMethod] > > public string getCustCount() > > { > > int cnt; > > AxaptaCOMConnector.Axapta2 Axapta = new > AxaptaCOMConnector.Axapta2Class(); > > > > DataSet mydataset = new DataSet(); > > try > > { > > > Axapta.Logon2("Admin","adminpwd","tx2","","","",",",","); > > } > > catch(Exception Er) > > { > > return Er.Message; > <------------------------------------------------- Exception Happen > > } > > > > AxaptaCOMConnector.IAxaptaRecord CustRecord; > > try > > { > > CustRecord = Axapta.CreateRecord("CustTable"); > > cnt = 0; > > while (CustRecord.Found) > > { > > cnt++; > > CustRecord.Next(); > > } > > } > > catch(Exception Err) > > { > > Axapta.Logoff(); > > return Err.Message; > > } > > Axapta.Logoff(); > > return "OK"; > > } > > } > > } ------------------------ Yahoo! Groups Sponsor --------------------~--> $9.95 domain names from Yahoo!. Register anything. http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/kGEolB/TM --------------------------------------------------------------------~-> Sharing the knowledge on Axapta. Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/Axapta-Knowledge-Village/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/