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

2366Error handling on Windows

Expand Messages
  • toddbfleming <tfleming@rrinc.com>
    Feb 11, 2003
    • 0 Attachment
      I'm new to SOAP and I keep running into problems with error handling.
      First a question:

      When does a function return a result? When does it return an SOM?

      Now to one of my problems: I can't get the error handling example
      (modified) in http://guide.soaplite.com/#error%20handling to work
      right under Windows 2000. I modified it to call an undefined function
      on my own server.

      If I run the client and server under Solaris everything works fine; I
      get this error message:

      SOAP-ENV:Client, Failed to locate method (c2f) in class
      (test::Callback) at /usr/local/lib/perl5/site_perl/5.8.0/SOAP/Lite.pm
      line 2195.

      If I run them under Windows 2000, I get this garbled error message:
      at c.pl line 7rver Error

      The server sends this response (similar on both Windows and Solaris):

      <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope
      xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:SOAP-
      ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-
      xmlns:xsd="http://www.w3.org/1999/XMLSchema" SOAP-
      ENV:Body><SOAP-ENV:Fault><faultcode xsi:type="xsd:string">SOAP-
      ENV:Client</faultcode><faultstring xsi:type="xsd:string">Failed to
      locate method (c2f) in class (test::Callback) at
      C:/usr/local/perl/site/lib/SOAP/Lite.pm line

      Client (c.pl)

      use SOAP::Lite;
      $soap = SOAP::Lite
      -> uri('http://www.rrinc.com/test/Callback')
      -> proxy('http://localhost:2031');
      $result = $soap->c2f(37.5);
      unless ($result->fault)
      print $result->result();
      } else
      print join ', ',

      Server (s.pl)

      use SOAP::Lite;
      use SOAP::Transport::HTTP;

      package test::Callback;

      sub CopyMessage
      print "in CopyMessage: ", $_[1], "\n";

      package main;

      $daemon = SOAP::Transport::HTTP::Daemon
      -> new(LocalPort => 2031)
      -> dispatch_to('test::Callback');
      print "SOAP server ", $daemon->url, "\n";

      while (my $connection = $daemon->accept)
      while (my $r = $connection->get_request)

      print $daemon->response->content, "\n";

      undef $connection;
    • Show all 3 messages in this topic