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

Global on_fault problem when using service description

Expand Messages
  • crosen9999
    I m finding that using a global fault handler doesn t seem to work when using WSDL to create the SOAP object: # global on_fault handler use SOAP::Lite on_fault
    Message 1 of 1 , Feb 13, 2004
    • 0 Attachment
      I'm finding that using a global fault handler doesn't seem to work
      when using WSDL to create the SOAP object:

      # global on_fault handler
      use SOAP::Lite on_fault => sub {print "global on_fault executed\n";};
      my $helloWS = SOAP::Lite->service($wsdl);
      my $hello = $helloWS->sayHello();
      # on_fault sub will never execute, and script dies on transport error

      Though it does work when setting the fault handler at the local
      level:

      # on_fault handler attached to specific object
      use SOAP::Lite;
      my $helloWS = SOAP::Lite->service($wsdl);
      -> on_fault (sub {print "local on_fault executed\n";});
      my $hello = $helloWS->sayHello();
      # on_fault sub executes, and script does not die on transport error

      I'd ideally like to use global fault handlers - I'm not sure if I'm
      doing something wrong, or if this isn't supported.

      Thanks,

      Cliff
    Your message has been successfully submitted and would be delivered to recipients shortly.