Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
missing soap:fault when using eval{}by Pickwick (Beadle) |
on Jun 22, 2010 at 10:00 UTC ( [id://845868]=perlquestion: print w/replies, xml ) | Need Help?? |
Pickwick has asked for the wisdom of the Perl Monks concerning the following question: Hello all, I have some missing SOAP-Faults with Soap:Lite 0.710.08 on Windows Server 2003 R2 SP2 32 Bit with ActivePerl-5.10.1.1007-MSWin32-x86-291969.msi. We have two simple webservices provided through SOAP::Transport::HTTP::CGI with each having it's own dispatcher CGI-script, it's own classes etc. Soap-Lite dispatches the requests using a class instance provided with dipsatch_with and this class instance create a new class instance with the real webservice logic, for example accessing the database and doing some stuff. I recently found that under some circumstances when the logic implementing class dies, the execution stops as expected but the error message does not reach the client. In those circumstances Soap-Lite seems to generate and empty response from the called function, which is not what I need, of course. The first time I recognized this behaviour I hunted it down to the DESTROY method of the class with the logic which used an eval{} to catch errors from the method disconnecting from the database. I played a little bit and it seemd that only the existance of an eval{} with no code in it or elswhere in DESTROY made the difference: If the eval was present and I died somewhere in the class, Saop-Lite didn't generate a saup:Faul but an empty response from the called method. Without the eval{} Soap-Lite responded with a soap-Fault, as needed. I just deleted that eval{} because I didn't need it anymore. Now I have the problem again and hunted it down to an eval{} in the Package DBIx::Log4perl::db. If this eval is present and my method dies after initiating the database connection using DBIx::Log4perl, SOAP-Lite again just generates empty method call responses. dieing before the database initialisation and therefore don't using DBIx::Log4perl generates a soap:Fault, as expected. Don't using DBIx::Log4perl but normally calling DBI->connect(...) does generate a soap:Fault even with establashing the database connection. But of course I want to use DBIx::Log4perl. I don't think it has something to do with DBIx::Log4perl directly because my second webservice does establish the database connection using DBIx::Log4perl and dieing in that webservice after connecting does produce a soap:Fault. It seems it has something to do with the eval{} in some specific caller depth or stuff likie that, but I'm really stuck here. Do you have any idea under which circumstances SOAP-Lite may not be able to recognize a die properly or can't get the error message to produce a soap:Fault? Thanks for any hints! One example response how it should be:
...and how it is with eval{} in DBIx::Log4perl::db present:
Back to
Seekers of Perl Wisdom
|
|