Loading ...
Sorry, an error occurred while loading the content.

Re: [soaplite] on fault(): finding the real error message

Expand Messages
  • Duncan Cameron
    At 2005-03-24, 19:08:35 Sebastien Boving & Nicole Kersting ... That doesn t look like a good example of a fault handler, as passing back an empty SOM object
    Message 1 of 1 , Mar 25, 2005
    View Source
    • 0 Attachment
      At 2005-03-24, 19:08:35 Sebastien Boving & Nicole Kersting
      <sebbov@...> wrote:
      >i'm having several instances where using an on_fault() handler which
      >has the same form as the t/...t tests that come with SOAP::Lite, that
      >is:
      >
      > on_fault => sub {
      > my $soap = shift;
      > my $res = shift;
      > ref $res ? warn(join " ", "SOAP FAULT:", $res->faultstring, "\n")
      > : warn(join " ", "TRANSPORT ERROR:",
      >$soap->transport->status, "\n");
      > return new SOAP::SOM;
      > }
      That doesn't look like a good example of a fault handler, as passing
      back an empty SOM object will mislead the client.

      >return weird:
      >
      >TRANSPORT ERROR: 200 OK
      >
      >messages.
      Well, in the case that $res is not a reference you are not printing its

      value. I would expect that value to indicate the problem.
      The default on_fault handler, which you can see in the source for
      SOAP::Lite, is probably fine for what you need. If the error is a
      SOAP::SOM object then it will be passed back to the client, otherwise
      it will die.

      Duncan



      Send instant messages to your online friends http://uk.messenger.yahoo.com
    Your message has been successfully submitted and would be delivered to recipients shortly.