PresentRequest ::= SEQUENCE { referenceId [2] IMPLICIT OCTET STRING OPTIONAL, resultSetId [31] IMPLICIT VisibleString, resultSetStartPoint [30] IMPLICIT INTEGER, numberOfRecordsRequested [30] IMPLICIT INTEGER, elementSetNames ElementSetNames OPTIONAL, preferredRecordSyntax [104] IMPLICIT OBJECT IDENTIFIER OPTIONAL }
\270\020\237\037\007default\236\001\001\235\001\012What's behind it:
presentRequest = { \270\020 resultSetId = "default" \237\037\007default resultSetStartPoint = 1 \236\001\001 numberOfRecordsRequested = 10 \235\001\012 }One more view of the same thing (see ISO 8825 for details):
tag=24, Class=2, form=1, count=3 tag=31, Class=2, form=0, count=7 data=default 6666767 45615C4 tag=30, Class=2, form=0, count=1 data=. 0 1 tag=29, Class=2, form=0, count=1 data=. 0 A
1/1003 4/1 5/100 3/2 6/1 2/3 Type/Value Meaning 1/1003 author 4/1 with words structured as a phrase 5/100 no truncation 3/2 compared with the first item in the field 6/1 not necessarily consuming an entire subfield 2/3 and compared for equality
-> Begin Type-1 query query = { type-1 = { -> Specify Bib-1 attribute set attributeSet = OID 1.2.840.10003.3.1 -> Begin RPN query rpn = { rpnRpnOp = { rpn1 = { op = { attrTerm = { attributes = { use = Body of text position = Any position in subfield structure = Word list completeness = Incomplete subfield } -> User's first search term term = { general = "heart" } } } } rpn2 = { op = { attrTerm = { attributes = { use = Body of text position = Any position in subfield structure = Word list completeness = Incomplete subfield } -> User's second search term term = { general = "depression" } } } } -> Boolean AND connecting user's first and second search terms op = { and = and } } } } }
The actual communication between server and client is encoded in the BER binary format. What appears below is an annotated translation of a binary log of a Z39.50 session, as produced by a pretty-printer utility.
Note:
Client requests below are marked by lines beginning with C:
Server requests and actions are marked by lines beginning with S:
Lines beginning with -> are descriptive comments
-> Server senses an incoming TCP connection S:Association with myhost.Berkeley.EDU -> PDU 1: Client sends an initialization request C:initRequest = { -> Client states versions it supports C: protocolVersion = { C: version-1(0) C: version-2(1) C: } C: options = { -> Client states facilities & features it would use C: search(0) C: present(1) C: delSet(2) C: resourceReport(3) C: triggerResourceCtrl(4) C: resourceCtrl(5) C: accessCtrl(6) C: } -> Client proposes some buffer sizes C: preferredMessageSize = 4096 C: exceptionalRecordSize = 8192 -> Client software announces its identity C: implementationId = "1991" C: implementationName = "UCB Info Client" C: implementationVersion = "0.2" C:} -> PDU 2: Server responds to initialization request -> Server states versions it supports S:initResponse = { S: protocolVersion = { S: version-1(0) S: version-2(1) S: } -> Server states features it supports S: options = { S: search(0) S: present(1) S: delSet(2) S: } -> Server agrees with buffer sizes (the server always has the last word) S: preferredMessageSize = 4096 S: exceptionalRecordSize = 8192 -> Z39.50 (not TCP) session "accepted" S: result = true -> Server software announces its identity S: implementationId = "1994" S: implementationName = "NLM MEDLARS Server" S: implementationVersion = "0.3" -> Server sends information that client may optionally display S: userInformationField = { S: data = " S:Welcome to the NLM Z39.50 server (beta) S: S:" S: } S:} -> PDU 3: Client sends a search request C:searchRequest = { -> Three numbers saying the client wants only one record back, and only if the total count < 100 C: smallSetUpperBound = 1 C: largeSetLowerBound = 100 C: mediumSetPresentNumber = 1 -> Replace any existing result set of the same name C: replaceIndicator = true -> Client sends the name of the result set C: resultSetName = "default" C: databaseNames = { C: "medline" C: } -> Begin Type-1 query C: query = { C: type-1 = { -> Specify Bib-1 attribute set C: attributeSet = OID 1.2.840.10003.3.1 -> Begin RPN query C: rpn = { C: op = { C: attrTerm = { C: attributes = { C: relation = Equal C: use = Subject C: } -> User's search term C: term = { C: general = "heart" C: } C: } C: } C: } C: } C: } C:} -> PDU 4: Server responds to search request S:searchResponse = { S: resultCount = 7927 S: numberOfRecordsReturned = 0 S: nextResultSetPosition = 1 S: searchStatus = true S: presentStatus = success(0) S:} -> PDU 5: Client sends a present request C:presentRequest = { C: resultSetId = "default" -> Send one record starting at record 5555 within result set C: resultSetStartPoint = 5555 C: numberOfRecordsRequested = 1 C:} -> PDU 6: Server responds to present request S:presentResponse = { S: numberOfRecordsReturned = 1 -> Number of record following last one delivered S: nextResultSetPosition = 5556 S: presentStatus = success(0) S: records = { S: responseRecords = { S: { -> The requested record S: record = { S: retrievalRecord = { -> Record is in USMARC format S: id = OID 1.2.840.10003.5.10 -> Beginning of the record itself (truncated) S: data = "02729naa 2200336z 450000100[...]" -> [Rest of record deleted in this example] S: } S: } S: } S: } S: } S:} -> Server senses that client has closed TCP connection (no PDU sent to client) S:Association closed: release or abort.