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

on_fault handler not invoked for a service?

Expand Messages
  • Ivor Durham
    I have a simple service for uploading a file to a server with authentication. If the authentication fails, I generate a fault. If I invoke the operation using
    Message 1 of 1 , Nov 26, 2007
    • 0 Attachment
      I have a simple service for uploading a file to a server with
      authentication. If the authentication fails, I generate a fault. If I
      invoke the operation using a uri and proxy with an on_fault handler,
      the handler is invoked correctly to report the fault. On the other
      hand if I replace the uri and proxy with a service and WSDL file, the
      debug output shows the same fault being returned but the on_fault
      handler is not being invoked.

      That is this version invokes the on_fault handler correctly:

      $result = SOAP::Lite
      -> on_fault(\&handleSOAPFault)
      -> uri('http://ivorcc/TestWebServices')
      -> proxy('http://ivorcc/testwebservices.cgi')
      -> importCSVData($login, $password, $dataString);

      while this version does not invoked the on_fault handler:

      $result = SOAP::Lite
      -> on_fault(\&handleSOAPFault)
      -> service('http://ivorcc/TestWebServices.wsdl')
      -> importCSVData($login, $password, $dataString);

      The debug output for the SOAP transaction appears to be the same in
      both cases.

      The WSDL description was created through the Eclipse IDE's WSDL editor
      and includes the fault message description. The operation functions
      correctly in the absence of a fault.

      Any hints on where to RTFM for this problem or ideas why the on_fault
      behavior is different would be much appreciated. A search of this
      group finds a number of people with questions about fault handling
      when using a service, but no clear solution about why the on_fault
      handler should not be invoked [or I missed it :-(]

      Thanks in advance.
    Your message has been successfully submitted and would be delivered to recipients shortly.