Avoid redundant YAZ includes.
[yaz4j-moved-to-github.git] / dependencies / yaz-2.1.28 / doc / soap.srw.html
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.70.1"><link rel="start" href="index.html" title="YAZ User's Guide and Reference"><link rel="up" href="soap.html" title="Chapter 7. SOAP and SRU"><link rel="prev" href="soap.xml.html" title="3. SOAP Packages"><link rel="next" href="tools.html" title="Chapter 8. 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 7. 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
5       follows:
6       </p><pre class="synopsis">
7 #include &lt;yaz/srw.h&gt;
8
9 int yaz_srw_codec(ODR o, void * pptr,
10                   Z_SRW_GDU **handler_data,
11                   void *client_data, const char *ns);
12       </pre><p>
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.
19       </p></div><p>
20       The definition of searchRetrieveRequest is:
21       </p><pre class="synopsis">
22 typedef struct {
23
24 #define Z_SRW_query_type_cql  1
25 #define Z_SRW_query_type_xcql 2
26 #define Z_SRW_query_type_pqf  3
27     int query_type;
28     union {
29         char *cql;
30         char *xcql;
31         char *pqf;
32     } query;
33
34 #define Z_SRW_sort_type_none 1
35 #define Z_SRW_sort_type_sort 2
36 #define Z_SRW_sort_type_xSort 3
37     int sort_type;
38     union {
39         char *none;
40         char *sortKeys;
41         char *xSortKeys;
42     } sort;
43     int  *startRecord;
44     int  *maximumRecords;
45     char *recordSchema;
46     char *recordPacking;
47     char *database;
48 } Z_SRW_searchRetrieveRequest;
49       </pre><p>
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.
56     </p><p>
57       The SearchRetrieveResponse has the following definition.
58       </p><pre class="synopsis">
59 typedef struct {
60     int * numberOfRecords;
61     char * resultSetId;
62     int * resultSetIdleTime;
63     
64     Z_SRW_record *records;
65     int num_records;
66
67     Z_SRW_diagnostic *diagnostics;
68     int num_diagnostics;
69     int *nextRecordPosition;
70 } Z_SRW_searchRetrieveResponse;
71       </pre><p>
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>.
76     </p><p>
77       A retrieval record is defined as follows:
78       </p><pre class="synopsis">
79 typedef struct {
80     char *recordSchema;
81     char *recordData_buf;
82     int recordData_len;
83     int *recordPosition;
84 } Z_SRW_record;
85       </pre><p>
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.
89     </p><p>
90       And, a diagnostic as:
91       </p><pre class="synopsis">
92 typedef struct {
93     int  *code;
94     char *details;
95 } Z_SRW_diagnostic;
96       </pre><p>
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 8. Supporting Tools</td></tr></table></div></body></html>