[Net-z3950] First-time use problems

Chuck Bearden cbearden at rice.edu
Wed May 15 00:22:32 CEST 2002


This is my first go-round ever with Z39.50, so I'm fairly clueless,
though I have read the docs.

In order to debug a problem with my institution's Z39.50 server, I'm
trying to write a simple client that works.  I'm running Debian
Potato, using the yaz .debs I got from the Index Data site, using the
latest Net::Z3950 from CPAN, and using MARC.pm 1.15 (though I don't
think I'm getting far enough for that to matter).  I can't write a
client that works, and I've tried it across several servers.

I've done the really simple thing I've seen in the docs & in one
other posting:

-------------------------script-------------------------
#!/usr/bin/perl -wd
$|=1;

use Net::Z3950;
$conn = new Net::Z3950::Connection('star.tsl.state.tx.us', 2200,
                                   databaseName => 'unicorn');

$rs = $conn->search('Alamo');

print "found ", $rs->size(), " records:\n";
$op = $conn->op();
if ($op == Net::Z3950::Op::Get) {
    my @recs = $conn->records();

    foreach(@recs){
        print $_->rawdata();
    }
}
-------------------------script-------------------------

This is one of several servers I assume ought to work.  I've tried 4
or 5, all with the same results.  Running the above yields:

  cbearden at edwards:~/bin/z3950$ ./newtest
  Can't call method "size" on an undefined value at ./newtest line 10.

Obviously, nothing is being returned from the search method on the
connection object.  I inspect $conn with 'x' in the debug mode, and
I see inter alia

  'addinfo' => 'Expected CONSTRUCTED PDU not found (pdu error: 3002)'

I'll append the complete contents of the $conn object.  This has
happened with all the servers I've tried (except ours, which I think
is not working properly).

Any idea what's up?  Should I compile yaz myself and re-install
Net::Z39.50?

All suggestions gratefully received.

Thanks,
Chuck
======================================================================
 Chuck Bearden   Library Systems Programmer/Analyst   Rice University
 cbearden at rice.edu           713.348.3634          713.348.5862 (fax)
======================================================================


  DB<3> x $conn
0  Net::Z3950::Connection=HASH(0x83d4814)
   'addinfo' => 'Expected CONSTRUCTED PDU not found (pdu error: 3002)'
   'cs' => 138250888
   'errcode' => 100
   'host' => 'star.tsl.state.tx.us'
   'idleWatcher' => Event::idle=HASH(0x83d470c)
      '_user_data_' => Net::Z3950::Connection=HASH(0x83d4814)
         -> REUSED_ADDRESS
   'initResponse' => Net::Z3950::APDU::InitResponse=HASH(0x841cd0c)
      'implementationId' => 'Unicorn 2001 Bath Lvl 1'
      'implementationName' => 'SIRSI Corporation'
      'implementationVersion' => 3.0
      'maximumRecordSize' => 65530
      'preferredMessageSize' => 65530
      'referenceId' => 'init'
      'result' => 255
   'mgr' => Net::Z3950::Manager=HASH(0x83d4874)
      'connections' => ARRAY(0x83d48b0)
         0  Net::Z3950::Connection=HASH(0x83d4814)
            -> REUSED_ADDRESS
      'options' => HASH(0x83d4880)
           empty hash
   'op' => 3953
   'options' => HASH(0x83d48ec)
      'databaseName' => 'unicorn'
   'port' => 2200
   'queued' => ''
   'refId2cb' => HASH(0x83d4820)
        empty hash
   'resultSet' => undef
   'resultSets' => ARRAY(0x83d48a4)
      0  undef
   'searchResponse' => Net::Z3950::APDU::SearchResponse=HASH(0x83b788c)
      'nextResultSetPosition' => 0
      'numberOfRecordsReturned' => 0
      'records' => Net::Z3950::APDU::DefaultDiagFormat=HASH(0x8430540)
         'addinfo' => 'Expected CONSTRUCTED PDU not found (pdu error: 3002)'
         'condition' => 100
         'diagnosticSetId' => '1.2.840.10003.4.1'
      'referenceId' => 0
      'resultCount' => 0
      'resultSetStatus' => 3
      'searchStatus' => 0
   'sock' => IO::Handle=GLOB(0x83d4760)
      -> *Symbol::GEN0
            FileHandle({*Symbol::GEN0}) => fileno(3)
   'writeWatcher' => Event::io=HASH(0x83d46f4)
      '_user_data_' => Net::Z3950::Connection=HASH(0x83d4814)
         -> REUSED_ADDRESS






More information about the Net-z3950 mailing list