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

Client unable to detect fatal SOAP failure (e.g. unable to connect to host)

Expand Messages
  • Ollie Cook
    Good evening, With a base install of SOAP::Lite version 0.66 I don t think it is possible for the user/developer to detect whether the SOAP call failed, and
    Message 1 of 1 , Jan 26, 2006
    View Source
    • 0 Attachment
      Good evening,

      With a base install of SOAP::Lite version 0.66 I don't think it is
      possible for the user/developer to detect whether the SOAP 'call'
      failed, and I consider this a bug. I was wondering if any other
      users have come across this.

      For example, the following code returns the empty string ('') if
      SOAP::Lite is unable to communicate with the SOAP server:

      $soap->call(SOAP::Data->name($action) => $soapdata)

      This does not allow the user/developer to easily determine that there
      has been a fatal error.

      Within SOAP::Transport::HTTP the response structure is as follows during
      this instance:

      $VAR1 = bless( {
      '_content' => '',
      '_rc' => 500,
      '_headers' => bless( {
      'client-date' => 'Wed, 25 Jan
      2006 15:56:32 GMT'
      }, 'HTTP::Headers' ),
      '_msg' => 'Can\'t connect to a.b.c.d:80 (connect:
      Connection refused)',
      '_request' => ...

      _content is what is being returned to the client, where what would
      actually be more useful would be to push _msg up to the client through
      SOAP::Lite.

      I have rolled a small patch (see #1) which will at least allow the
      user/developer to detect the 'undef' and handle that error case, but it
      doesn't expose the actual cause of the error "Can't connect to a.b.c.d",
      so I don't think this is the _correct_ fix.

      Does anyone have any opinion on what should be the correct way of pushing
      that error up the stack and into the users visibility?

      Thanks for your time,

      Ollie

      1: http://rt.cpan.org/Ticket/Attachment/158815/49167/HTTP.pm.patch
      --
      Ollie Cook
      UNIX Scripter
      Information Systems

      Direct Line: 020 8834 8128
      Waterfront | Hammersmith Embankment | Chancellors Road London | W6 9HP
    Your message has been successfully submitted and would be delivered to recipients shortly.