Next | SOAP::Lite Client Experiences | 9 |
Just for kicks, lets get a list of records from the database. Does anyone know SQL? This is like a SELECT command.
my $recordListSom = $soap->getRecordListForTable( SOAP::Data->name( "cookie" => $cookie ), SOAP::Data->name( "tablename" => "Defect" ), SOAP::Data->name( "filtername" => 'Assigned with Estimated Date' ), SOAP::Data->name( "columnList" => ''); if ( $recordListSom->fault ) { my $faultstring = $logonSom->faultstring; die "Fault string : $faultstring \n"; } my @items = $recordListSom->valueof('//Envelope/Body/getRecordListForTableResponse/recordlist/records/item/row/item'); my @columns = $recordListSom->valueof('//Envelope/Body/getRecordListForTableResponse/recordlist/columnlist/item'); my $columnCount = scalar(@columns); my $recordCount = scalar(@items) / $columnCount if $columnCount;
Unlike SQL, you get the whole list back, you cannot iterate through the results one line at a time. The SOM has a structure with all the records.
Perhaps this is a problem with software vender, and not SOAP, and could have provided a better set of methods: one to start the record list, and one to retrieve every record.
Still, this is very heavy programming, and not very straight forward.
Copyright © 2004 David Baird |