Error 1829 from a Webservice
Posted in 2005
Topics: General Discussion
Hello, I have a webservice in C# that wraps a DLL (unmanaged - written in C, ec) to retrieve some data from database. Inspite of the environment variable pointing to proper informix dir, and the file is also present in the msg folder, connection returns 1829. Before calling connection statement, I debuged and dumped environment variable INFORMIXDIR and also tried to open and close the .pam file from the msg subdirectory (in readonly mode), and that worked fine. The DLL works outside the webservice but not through the webservice. Stuck at the problem currently. Any help would be greatly appreciated, Regards, jpar
jparagg@gmail.com wrote: > I have a webservice in C# that wraps a DLL (unmanaged - written in C, > ec) to retrieve some data from database. > > Inspite of the environment variable pointing to proper informix dir, > and the file is also present in the msg folder, connection returns > 1829. Before calling connection statement, I debuged and dumped > environment variable INFORMIXDIR and also tried to open and close the > .pam file from the msg subdirectory (in readonly mode), and that worked > fine. > > The DLL works outside the webservice but not through the webservice. > Stuck at the problem currently. > Any help would be greatly appreciated, Unfortunately, the 'works outside web service' and 'fails inside web service' means that the web service environment isn't the same as the non-(web service) environment - and the problem is most likely INFORMIXDIR. You were certainly on the correct track aiming for the environment variable - but at this distance from the problem, it looks like the web server is not setting the environment. Given the use of C#, I imagine this is IIS? I'm not familiar with all the ins and outs of that. With Apache, you have to explicitly set the environment - with SetEnv directives. Suggestion: write a dummy C# DLL module that opens a file and writes the environment to it - one that simulates the DLL that fails. I suspect that the (lack of) environment in that file will help you. (In C - on Unix - you would obtain the full environment via: extern char **environ; This is the only POSIX variable for which there is no header - AFAIK.) -- Jonathan Leffler #include <disclaimer.h> Email: jleffler@earthlink.net, jleffler@us.ibm.com Guardian of DBD::Informix v2005.02 -- http://dbi.perl.org/
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