Next SOAP::Lite Client Experiences 11

Rewriting the Script with the WSDL


     my $wsdl   = 'http://localhost/cgi-bin/ttsoapcgi.wsdl';
     my $schema = 'http://www.w3.org/2001/XMLSchema';
     my $soap = SOAP::Lite->service($wsdl)->xmlschema($schema);

     my $cookie = $soap->DatabaseLogon($dbName, $dbUser, $dbPass);
     if ($soap->call->fault) {
         my $faultstring = $soap->call->faultstring;
         die "$0: login error: $faultstring\n";
     }

     my $recordList = $soap->getRecordListForTable(
          $cookie, 'Defect', 'Assigned with Estimated Date', '');
     if ( $soap->call->fault ) {
         my $faultstring = $soap->call->faultstring;
         die "$0: record list error: $faultstring\n";
     }

     for my $recnum (
         map { $_->{row}[0]->{value} }
         @{$recordList->{records}}
     ) {
         my $action = $soap->getDefect($cookie, $recnum, '');
         ...
     }

Copyright © 2004 David Baird