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/enc +oding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:s +oapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http:// +www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soa +p/envelope/"> <soap:Body> <soap:Fault> <faultcode>soap:Server</faultcode> <faultstring>test2 at D:/Benutzer/tschoening/Eigene Dateien/E +clipse/Perl-Bibliotheken/stmodul/elrev_dotnet.pm line 5906.</faultstr +ing> </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/enc +oding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:s +oapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http:// +www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soa +p/envelope/"> <soap:Body> <elrev_SchreibeLabelResponse xsi:nil="true" xmlns="http://localh +ost/elrev_dotnet"/> </soap:Body> </soap:Envelope>

In reply to missing soap:fault when using eval{} by Pickwick

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.