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

2214proper use of on_faul()?

Expand Messages
  • Daryl Williams
    Dec 26, 2002
    • 0 Attachment
      folks,

      i have searched through the documentation to no avail. their error
      handling examples use a different calling systax than the script
      i am trying to improve, to provide better error handling.

      i've played with several different variations, but none have worked.
      my latest try was to test the fault() value from my method's response,
      but this does not seem to work either. actually i would rather use a
      more glabal approach, like on_fault(), but so far i haven't found the
      proper usage, given my script's soap calling syntax. perhaps, i am
      doing something wrong, or there is a better way to do this. or maybe
      the answer is right under my nose and i can't see it. any help, pointers
      etc. are welcomed. the code looks something like this:

      use SOAP::Lite 'autodispatch';
      sub runsoap
      {
      my ($vhost, $service, $method, @arglist) = @_;

      my $uri = "http://${vhost}:5253/VPSAdmin";
      my $proxy = "http://${vhost}:5253/";

      SOAP::Lite->self->uri($uri)->proxy($proxy);

      my $soap = SOAP::Lite->self;
      my $objname = "VPSAdmin::${service}";
      my $obj = $objname->new($vhost);

      if ( ! defined $obj ) {
      die_gracefully("null response from server!");
      }

      $method_response = $obj->$method($vhost, @arglist);
      if ( $method_response->fault ) {
      die_gracefully($method_response->faultstring);
      }

      return $method_response;
      }

      regards and happy holidays!

      daryl
    • Show all 3 messages in this topic