Re: Error 1829 from a Webservice
Posted in 2005
Topics: Security, Permissions & Auditing
Hi, I did try a WebService with IIS 5.1 using Visual Studio 2003 on WinXP. Did not have any issues at all. Here is a code snippet... I will try with IIS 6.0 and respond. [WebMethod] public string getCustDetail(int custId) { string OutString = " "; string ConnStr = "Server=ol_ibm_thinkvg;DataBase=stores_demo;User ID=xxx;Password=xxx"; string SqlCmd = "SELECT fname, lname FROM customer where customer_num=?"; IfxConnection ifxConn = new IfxConnection(ConnStr ); ifxConn.Open(); IfxCommand selCmd = new IfxCommand(SqlCmd,ifxConn ); selCmd.Parameters.Add("customer_num",custId); IfxDataReader dr = selCmd.ExecuteReader(); while(dr.Read()) { OutString = dr.GetString(0) + " " + dr. GetString(1); } dr.Close(); ifxConn.Close(); return(OutString); } Venkatesh. jparagg@gmail.com Sent by: owner-informix-list@iiug.org 11/10/2005 02:40 AM Please respond to jparagg To: informix-list@iiug.org cc: Subject: Re: Error 1829 from a Webservice Hello, Thanks for your reply. Yes, I forgot to mention I am on IIS 6.0. By "It fails in webservice" I mean, only the connection. It is something like Scenario that fails is : webservice function --> calls a DLL function --> DLL internally connects to db -->Here before connecting to db, I dumped the environment variables to a text file (from the DLL itself). --> The text file shows proper variables and other debug messages but connection returns -1829 Scenario that works is : Sample application in delphi. --> calls (the same) DLL function --> DLL internally connects to db --> Dumping the environment variables to the text file (from the DLL itself). --> The text file shows proper variables and other debug messages also the connection returns success and function returns required data I will try your suggestion to write dummy C# DLL to check whether the enviornment variables are same... Thanks and regards jpar sending to informix-list
Hello Venkatesh, Thank you for your efforts. My problem is little different. I do not have a web method conncting to database. I have an unmanaged DLL written in C (and EC). That connects to data and retrives values. For example I have a function in the DLL like char * dbemp_name(int emp_no). The DLL internally connects to database, retrives the required information disconnects and returns the required name. This works fine from any application. Now I am writing a wrapper in a webservice. That wrapper calls the function from this "unmanaged" DLL. My code is something like : : : DLLImport statements : : [WebMethod] public string ws_emp_name(int emp_no ) { string sResult = " < START > " ; try { int iResult = db_open(); sResult += " <Called db_open()> iResult = " + iResult.ToString() ; if (iResult >= 0) { sResult += " Result of dbemp_name("+ noemp.ToString() + ") is " + dbemp_name(emp_no); sResult += " <After dbemp_name(emp_no)> "; db_close(); sResult += " <End of db_close()> "; } } catch (Exception exp) { sResult += " ERROR ENCOUNTERED -->" + exp.Message ; } return sResult; } When this method is invoked, db_open() that connects to database returns me the result as -1829. This works fine with normal application. Returns me the required data. In the unamanged DLL, I tried putting debug statements and dumping into a simple text file to find out wheter in the db_open it gets all the envriornment variables and whether it gets access / permissions to the ".pam" file. All those debug statements give proper results. Only in webservice the in the debug statements it returns -1829 after connection whereas it returns success in a normal application. Hope this explains more about the scenario... Thanks again for your efforts, Regards, JPar