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

Lost $SIG{__DIE__} with SOAP requests.

Expand Messages
  • Himanshu Garg
    Hi, My application installs its own die handlers to do some cleanup. These die handlers are lost when requests come via SOAP. I wonder if this is a mistake I
    Message 1 of 1 , Nov 2, 2006
    View Source
    • 0 Attachment
      Hi,

      My application installs its own die handlers to do some cleanup.
      These die handlers are lost when requests come via SOAP. I wonder if
      this is a mistake I am making or something SOAP::Lite does.

      I am therefore trying to understand how SOAP::Lite handles
      application die's. I wonder what is the effect of local $SIG{__DIE__}
      in the code shown in PS

      Kindly let me know the reason or whether or not I am looking at
      the right place.

      Thank You,
      Himanshu.

      PS

      From SOAP/Lite.pm:-

      sub handle {
      SOAP::Trace::trace('()');
      my $self = shift;
      $self = $self->new if !ref $self; # inits the server when called in
      a static context
      $self->init_context();
      # we want to restore it when we are done
      local $SOAP::Constants::DEFAULT_XML_SCHEMA
      = $SOAP::Constants::DEFAULT_XML_SCHEMA;

      # SOAP version WILL NOT be restored when we are done.
      # is it problem?

      my $result = eval {
      local $SIG{__DIE__};
      # why is this here:
      $self->serializer->soapversion(1.1);
      my $request = eval { $self->deserializer->deserialize($_[0]) };
      die SOAP::Fault
      ->faultcode($SOAP::Constants::FAULT_VERSION_MISMATCH)
      ->faultstring($@)
      ...
      }
    Your message has been successfully submitted and would be delivered to recipients shortly.