From: Thorsten S. <tsc...@am...> - 2010-06-22 10:35:18
|
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: <soap:Envelope soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <soap:Fault> <faultcode>soap:Server</faultcode> <faultstring>test2 at D:/Benutzer/tschoening/Eigene Dateien/Eclipse/Perl-Bibliotheken/stmodul/elrev_dotnet.pm line 5906.</faultstring> </soap:Fault> </soap:Body> </soap:Envelope> ...and how it is with eval{} in DBIx::Log4perl::db present: <soap:Envelope soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <elrev_SchreibeLabelResponse xsi:nil="true" xmlns="http://localhost/elrev_dotnet"/> </soap:Body> </soap:Envelope> Mit freundlichen Grüßen, Thorsten Schöning -- Thorsten Schöning AM-SoFT IT-Systeme - Hameln | Potsdam | Leipzig Telefon: Potsdam: 0331-743881-0 E-Mail: tsc...@am... Web: http://www.am-soft.de AM-SoFT GmbH IT-Systeme, Konsumhof 1-5, 14482 Potsdam Amtsgericht Potsdam HRB 21278 P, Geschäftsführer: Andreas Muchow |