SRW is just one implementation of a SOAP handler as described in the previous section. The encoder/decoder handler for SRW is defined as follows:
#include <yaz/srw.h> int yaz_srw_codec(ODR o, void * pptr, Z_SRW_GDU **handler_data, void *client_data, const char *ns); |
Note: The xQuery and xSortKeys are not handled yet by the SRW implementation of YAZ. Explain is also missing. Future versions of YAZ will include these features.
The definition of searchRetrieveRequest is:
typedef struct { #define Z_SRW_query_type_cql 1 #define Z_SRW_query_type_xcql 2 #define Z_SRW_query_type_pqf 3 int query_type; union { char *cql; char *xcql; char *pqf; } query; #define Z_SRW_sort_type_none 1 #define Z_SRW_sort_type_sort 2 #define Z_SRW_sort_type_xSort 3 int sort_type; union { char *none; char *sortKeys; char *xSortKeys; } sort; int *startRecord; int *maximumRecords; char *recordSchema; char *recordPacking; char *database; } Z_SRW_searchRetrieveRequest; |
The SearchRetrieveResponse has the following definition.
typedef struct { int * numberOfRecords; char * resultSetId; int * resultSetIdleTime; Z_SRW_record *records; int num_records; Z_SRW_diagnostic *diagnostics; int num_diagnostics; int *nextRecordPosition; } Z_SRW_searchRetrieveResponse; |
A retrieval record is defined as follows:
typedef struct { char *recordSchema; char *recordData_buf; int recordData_len; int *recordPosition; } Z_SRW_record; |
And, a diagnostic as:
typedef struct { int *code; char *details; } Z_SRW_diagnostic; |