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

Exception handling

Expand Messages
  • Yair Gottdenker
    Hello all, I am writing web service. I want to use soap lite for the client side and for the server I am using jax-ws. I want to handle errors using
    Message 1 of 1 , Dec 8, 2008
    • 0 Attachment
      Hello all,

      I am writing web service. I want to use soap lite for the client side
      and for the server I am using jax-ws. I want to handle errors using
      exceptions. My server side WS throws javax.xml.ws.WebServiceException.
      My problem is no matter what I do, I can't catch the exception and get
      the exception string out.

      My client code:
      #!/usr/bin/perl -w
      use strict;

      use SOAP::Lite
      on_fault => sub { my($soap, $res) = @_;
      die ref $res ? $res->faultdetail : $soap->transport->status, "\n";
      };

      my $res = SOAP::Lite
      ->service('http://localhost:8084/casi/CWS?wsdl');

      my $var = SOAP::Data->type('string');
      $var->name('p1');
      $var->value('my p1');

      eval {
      print "before call\n";
      my $result = $client->test1($var);
      print $result. '\n';;
      };
      if ($@) {
      print "$@\n";
      }

      Any ideas?
    Your message has been successfully submitted and would be delivered to recipients shortly.