#!/usr/local/bin/perl5 require 5.001; use strict; # CryoNet SOAP Search Client, written in Perl, using SOAP::Lite # http://www.cryonet.org/soap/ # Kevin Q. Brown, July, 2003 use SOAP::Lite; # use SOAP::Lite +trace => all; $SOAP::Constants::DO_NOT_USE_CHARSET = 1; # $sortOrder can be 'rank', 'old', or 'new' my ( $searchStr, $sortOrder, $startDisp, $numDisp, $minNmbr, $maxNmbr ) = ('liquid nitrogen', 'new', 11, 10, 0, 99999); # Use SOAP::Lite proxy to submit search and retrieve results my $res = SOAP::Lite -> uri('http://www.cryonet.org/soap') -> proxy('http://www.cryonet.org/cgi-bin/soap.cgi') -> search( SOAP::Data->name(searchStr => $searchStr), SOAP::Data->name(sortOrder => $sortOrder), SOAP::Data->name(startDisp => $startDisp), SOAP::Data->name(numDisp => $numDisp), SOAP::Data->name(minNmbr => $minNmbr), SOAP::Data->name(maxNmbr => $maxNmbr) ); if ($res->fault) { print $res->faultcode, " ", $res->faultstring, "\n"; exit 1; } # Display meta data from search my @nodes = $res->valueof('//SearchMetaData'); print "SearchMetaData:\n\n"; print "startDisp\nnumDisp\nmatchNmbr\nhref\n" . "searchStr\nsearchTime\ndbDate\nwarnMsg\n\n"; foreach my $node (@nodes) { print $node->{'startDisp'} . "\n" . $node->{'numDisp'} . "\n" . $node->{'matchNmbr'} . "\n" . $node->{'href'} . "\n" . $node->{'searchStr'} . "\n" . $node->{'searchTime'} . "\n" . $node->{'dbDate'} . "\n" . $node->{'warnMsg'} . "\n\n"; # Alternate display # while ( my ($key,$val) = each( %{$node} ) ) # { print "$key: $val\n"; } } # Display search results my @nodes = $res->valueof('//SearchResults'); print "SearchResults:\n\n"; print "msgNmbr\nmsgDate\nmsgSize\nmsgSubject\nmsgSynopsis\n\n"; foreach my $node (@nodes) { print $node->{'msgNmbr'} . "\n" . $node->{'msgDate'} . "\n" . $node->{'msgSize'} . "\n" . $node->{'msgSubject'} . "\n" . $node->{'msgSynopsis'} . "\n\n"; # Alternate display # while ( my ($key,$val) = each( %{$node} ) ) # { print "$key: $val\n"; } } exit 0;