1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>4. SRU</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"><link rel="start" href="index.html" title="YAZ User's Guide and Reference"><link rel="up" href="soap.html" title="Chapter 8. SOAP and SRU"><link rel="prev" href="soap.xml.html" title="3. SOAP Packages"><link rel="next" href="tools.html" title="Chapter 9. Supporting Tools"></head><body><link rel="stylesheet" type="text/css" href="common/style1.css"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">4. SRU</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="soap.xml.html">Prev</a> </td><th width="60%" align="center">Chapter 8. SOAP and SRU</th><td width="20%" align="right"> <a accesskey="n" href="tools.html">Next</a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="soap.srw"></a>4. SRU</h2></div></div></div><p>
2 SRU SOAP is just one implementation of a SOAP handler as described
3 in the previous section.
4 The encoder/decoder handler for SRU is defined as
6 </p><pre class="synopsis">
7 #include <yaz/srw.h>
9 int yaz_srw_codec(ODR o, void * pptr,
10 Z_SRW_GDU **handler_data,
11 void *client_data, const char *ns);
13 Here, <code class="literal">Z_SRW_GDU</code> is either
14 searchRetrieveRequest or a searchRetrieveResponse.
15 </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
16 The xQuery and xSortKeys are not handled yet by
17 the SRW implementation of YAZ. Explain is also missing.
18 Future versions of YAZ will include these features.
20 The definition of searchRetrieveRequest is:
21 </p><pre class="synopsis">
24 #define Z_SRW_query_type_cql 1
25 #define Z_SRW_query_type_xcql 2
26 #define Z_SRW_query_type_pqf 3
34 #define Z_SRW_sort_type_none 1
35 #define Z_SRW_sort_type_sort 2
36 #define Z_SRW_sort_type_xSort 3
48 } Z_SRW_searchRetrieveRequest;
50 Please observe that data of type xsd:string is represented
51 as a char pointer (<code class="literal">char *</code>). A null pointer
52 means that the element is absent.
53 Data of type xsd:integer is representd as a pointer to
54 an int (<code class="literal">int *</code>). Again, a null pointer
55 us used for absent elements.
57 The SearchRetrieveResponse has the following definition.
58 </p><pre class="synopsis">
60 int * numberOfRecords;
62 int * resultSetIdleTime;
64 Z_SRW_record *records;
67 Z_SRW_diagnostic *diagnostics;
69 int *nextRecordPosition;
70 } Z_SRW_searchRetrieveResponse;
72 The <code class="literal">num_records</code> and <code class="literal">num_diagnostics</code>
73 is number of returned records and diagnostics respectively and also
74 correspond to the "size of" arrays <code class="literal">records</code>
75 and <code class="literal">diagnostics</code>.
77 A retrieval record is defined as follows:
78 </p><pre class="synopsis">
86 The record data is defined as a buffer of some length so that
87 data can be of any type. SRW 1.0 currenly doesn't allow for this
88 (only XML), but future versions might do.
91 </p><pre class="synopsis">
97 </p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="soap.xml.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="soap.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="tools.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">3. SOAP Packages </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 9. Supporting Tools</td></tr></table></div></body></html>