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

Timeout and error control don't work

Expand Messages
  • hans poo
    Hi, i am using SOAP::Lite versión 0.69, just installed from CPAN, i ve been in many troubles, finally made it work with wsdl, https and apache basic
    Message 1 of 1 , Mar 8, 2007
    • 0 Attachment
      Hi, i'am using SOAP::Lite versión 0.69, just installed from CPAN, i've
      been in many troubles, finally made it work with wsdl, https and
      apache basic authentication, but not completely:

      First: Authentication
      ---------------------
      I found myself in the chicken and egg problem trying to use an wsdl
      document protected with basic credentials directly from a web server,
      this way:

      sub SOAP::Transport::HTTP::Client::get_basic_credentials {
      return 'user' => 'password';
      }
      my $soap = SOAP::Lite->service('https://myserver.com/services.wsdl');

      It was impossible and i was forced to download manually the wsdl
      document to the hard disk. The point is: basic http authentication
      works as documented, but not for downloading the wsdl document itself.

      This way it works:

      sub SOAP::Transport::HTTP::Client::get_basic_credentials {
      return 'user' => 'password';
      }
      my $soap = SOAP::Lite->service('file:/myproject/wsdl/services.wsdl');


      Second: Timeout
      ---------------
      I wasn't able to set the timeout, i've tried different combinations,
      for example:

      my $soap = ...
      $soap->transport->timeout(5);

      in this case, it says there is no transport method.

      Because i'am using wsdl i've not tried the many proxy method examples.


      Third: Error Control
      --------------------
      Finally, the error control mechanisms doesn't seem to work:

      my $result = $soap->hello("world");

      if ($result->fault) {
      warn "Error XXXX: ", $result->faultstring;
      return undef;
      }

      This code appears everywhere, but in my case $result is not an object,
      just a hash reference, hence can't call nothing.

      Besides all this, the application is working correctly, but i need to
      improve it with proper timeout and error control.

      I've worked before with plain XML and XML::RPC (Frontier), but this is
      my first SOAP::Lite Application, any help will be appreciated.

      Thanks for reading
      Hans Poo
    Your message has been successfully submitted and would be delivered to recipients shortly.