Namespaces more or less in correct place
authorAdam Dickmeiss <adam@indexdata.dk>
Tue, 3 Sep 2013 13:29:37 +0000 (15:29 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Tue, 3 Sep 2013 13:29:37 +0000 (15:29 +0200)
client/client.c
include/yaz/srw.h
src/srw.c
src/srwutil.c
src/zoom-sru.c

index 925c503..64de44b 100644 (file)
@@ -4452,7 +4452,7 @@ static void http_response(Z_HTTP_Response *hres)
             Z_SOAP *soap_package = 0;
             ODR o = odr_createmem(ODR_DECODE);
             Z_SOAP_Handler soap_handlers[] = {
-                {YAZ_XMLNS_SRU_v2_response, 0, (Z_SOAP_fun) yaz_srw_codec},
+                {YAZ_XMLNS_SRU_v2_mask, 0, (Z_SOAP_fun) yaz_srw_codec},
                 {YAZ_XMLNS_UPDATE_v0_9, 0, (Z_SOAP_fun) yaz_ucp_codec},
                 {YAZ_XMLNS_SRU_v1_response, 0, (Z_SOAP_fun) yaz_srw_codec},
                 {0, 0, 0}
index 9dfc82b..743c1d0 100644 (file)
@@ -49,10 +49,18 @@ typedef struct {
 
 typedef struct {
     char *recordSchema;
-    int recordPacking;
+
+    int recordPacking; /* recordXMLEscaping in SRU 2.0 */
 #define Z_SRW_recordPacking_string 0
 #define Z_SRW_recordPacking_XML 1
 #define Z_SRW_recordPacking_URL 2
+
+#if 0
+    int packing;   /* recordPacking in SRU 2.0 */
+#define Z_SRW_packed   0
+#define Z_SRW_unpacked     1
+#endif
+
     char *recordData_buf;
     int recordData_len;
     Odr_int *recordPosition;
@@ -81,7 +89,10 @@ typedef struct {
     Odr_int *startRecord;
     Odr_int *maximumRecords;
     char *recordSchema;
-    char *recordPacking;
+
+    char *recordPacking;       /* recordXMLEscaping in SRU 2.0 */
+    char *packing;             /* recordPacking in SRU 2.0 */
+
     char *recordXPath;
     char *database;
     char *stylesheet;
@@ -108,6 +119,7 @@ typedef struct {
 
 typedef struct {
     char *recordPacking;
+    char *packing;
     char *database;
     char *stylesheet;
 } Z_SRW_explainRequest;
@@ -216,7 +228,7 @@ YAZ_EXPORT int yaz_srw_codec(ODR o, void * pptr,
 YAZ_EXPORT int yaz_ucp_codec(ODR o, void * pptr,
                              Z_SRW_PDU **handler_data,
                              void *client_data, const char *ns);
-YAZ_EXPORT Z_SRW_PDU *yaz_srw_get_core_v_1_1(ODR o);
+YAZ_EXPORT Z_SRW_PDU *yaz_srw_get_core_v_2_0(ODR o);
 YAZ_EXPORT Z_SRW_PDU *yaz_srw_get_pdu(ODR o, int which, const char *version);
 YAZ_EXPORT Z_SRW_PDU *yaz_srw_get(ODR o, int which);
 YAZ_EXPORT Z_SRW_recordVersion *yaz_srw_get_record_versions(ODR o, int num);
@@ -324,7 +336,7 @@ void yaz_encode_sru_extra(Z_SRW_PDU *sr, ODR odr, const char *extra_args);
 #define YAZ_XMLNS_SRU_v1_1 "http://www.loc.gov/zing/srw/"
 #define YAZ_XMLNS_DIAG_v1_1 "http://www.loc.gov/zing/srw/diagnostic/"
 #define YAZ_XMLNS_UPDATE_v0_9 "http://www.loc.gov/zing/srw/update/"
-#define YAZ_XMLNS_SRU_v2_response "http://docs.oasis-open.org/ns/search-ws/sru*esponse"
+#define YAZ_XMLNS_SRU_v2_mask "http://docs.oasis-open.org/ns/search-ws/*"
 #define YAZ_XMLNS_SRU_v1_response "http://www.loc.gov/*"
 
 YAZ_EXPORT
index 82e1acd..2cc0c7d 100644 (file)
--- a/src/srw.c
+++ b/src/srw.c
@@ -220,16 +220,19 @@ static int match_xsd_integer(xmlNodePtr ptr, const char *elem, ODR o,
 char *yaz_negotiate_sru_version(char *input_ver)
 {
     if (!input_ver)
-        input_ver = "1.1";
-
+        return "2.0";
     if (!strcmp(input_ver, "1.1"))
         return "1.1";
-    return "1.2"; /* our latest supported version */
+    if (!strncmp(input_ver, "1.", 2))
+        return "1.2";
+    if (!strncmp(input_ver, "2.", 2))
+        return "2.0";
+    return 0;
 }
 
 static int yaz_srw_record(ODR o, xmlNodePtr pptr, Z_SRW_record *rec,
                           Z_SRW_extra_record **extra,
-                          void *client_data, const char *ns)
+                          void *client_data)
 {
     if (o->direction == ODR_DECODE)
     {
@@ -237,6 +240,9 @@ static int yaz_srw_record(ODR o, xmlNodePtr pptr, Z_SRW_record *rec,
 
         char *spack = 0;
         xmlNodePtr ptr;
+#ifdef Z_SRW_packed
+        rec->packing = 0;
+#endif
         rec->recordSchema = 0;
         rec->recordData_buf = 0;
         rec->recordData_len = 0;
@@ -339,7 +345,7 @@ static int yaz_srw_record(ODR o, xmlNodePtr pptr, Z_SRW_record *rec,
 
 static int yaz_srw_records(ODR o, xmlNodePtr pptr, Z_SRW_record **recs,
                            Z_SRW_extra_record ***extra,
-                           int *num, void *client_data, const char *ns)
+                           int *num, void *client_data)
 {
     if (o->direction == ODR_DECODE)
     {
@@ -361,7 +367,7 @@ static int yaz_srw_records(ODR o, xmlNodePtr pptr, Z_SRW_record **recs,
             if (ptr->type == XML_ELEMENT_NODE &&
                 !xmlStrcmp(ptr->name, BAD_CAST "record"))
             {
-                yaz_srw_record(o, ptr, *recs + i, *extra + i, client_data, ns);
+                yaz_srw_record(o, ptr, *recs + i, *extra + i, client_data);
                 i++;
             }
         }
@@ -374,7 +380,7 @@ static int yaz_srw_records(ODR o, xmlNodePtr pptr, Z_SRW_record **recs,
             xmlNodePtr rptr = xmlNewChild(pptr, 0, BAD_CAST "record",
                                           0);
             yaz_srw_record(o, rptr, (*recs)+i, (*extra ? *extra + i : 0),
-                           client_data, ns);
+                           client_data);
         }
     }
     return 0;
@@ -743,7 +749,7 @@ int yaz_srw_codec(ODR o, void * vptr, Z_SRW_PDU **handler_data,
         if (method->type != XML_ELEMENT_NODE)
             return -1;
 
-        *p = yaz_srw_get_core_v_1_1(o);
+        *p = yaz_srw_get_core_v_2_0(o);
 
         if (!xmlStrcmp(method->name, BAD_CAST "searchRetrieveRequest"))
         {
@@ -761,6 +767,7 @@ int yaz_srw_codec(ODR o, void * vptr, Z_SRW_PDU **handler_data,
             req->maximumRecords = 0;
             req->recordSchema = 0;
             req->recordPacking = 0;
+            req->packing = 0;
             req->recordXPath = 0;
             req->resultSetTTL = 0;
             req->stylesheet = 0;
@@ -857,7 +864,7 @@ int yaz_srw_codec(ODR o, void * vptr, Z_SRW_PDU **handler_data,
                 else if (match_element(ptr, "records"))
                     yaz_srw_records(o, ptr, &res->records,
                                     &res->extra_records,
-                                    &res->num_records, client_data, ns);
+                                    &res->num_records, client_data);
                 else if (match_xsd_integer(ptr, "nextRecordPosition", o,
                                            &res->nextRecordPosition))
                     ;
@@ -878,6 +885,7 @@ int yaz_srw_codec(ODR o, void * vptr, Z_SRW_PDU **handler_data,
             req = (*p)->u.explain_request = (Z_SRW_explainRequest *)
                 odr_malloc(o, sizeof(*req));
             req->recordPacking = 0;
+            req->packing = 0;
             req->database = 0;
             req->stylesheet = 0;
             for (; ptr; ptr = ptr->next)
@@ -925,7 +933,7 @@ int yaz_srw_codec(ODR o, void * vptr, Z_SRW_PDU **handler_data,
                     ;
                 else if (match_element(ptr, "record"))
                     yaz_srw_record(o, ptr, &res->record, &res->extra_record,
-                                   client_data, ns);
+                                   client_data);
                 else if (match_element(ptr, "diagnostics"))
                     yaz_srw_diagnostics(o, ptr, &res->diagnostics,
                                         &res->num_diagnostics,
@@ -1024,19 +1032,22 @@ int yaz_srw_codec(ODR o, void * vptr, Z_SRW_PDU **handler_data,
         Z_SRW_PDU **p = handler_data;
         xmlNsPtr ns_srw;
         xmlNodePtr ptr = 0;
-
+        int version2 = !(*p)->srw_version ||
+            strcmp((*p)->srw_version, "2.") > 0;
         if ((*p)->which == Z_SRW_searchRetrieve_request)
         {
             Z_SRW_searchRetrieveRequest *req = (*p)->u.request;
             const char *queryType = req->queryType;
+            if (version2)
+                ns = "http://docs.oasis-open.org/ns/search-ws/sruRequest";
             ptr = xmlNewChild(pptr, 0, BAD_CAST "searchRetrieveRequest", 0);
             ns_srw = xmlNewNs(ptr, BAD_CAST ns, BAD_CAST "zs");
             xmlSetNs(ptr, ns_srw);
 
-            if ((*p)->srw_version)
+            if (!version2)
                 add_xsd_string(ptr, "version", (*p)->srw_version);
 
-            if (strcmp((*p)->srw_version, "2.") > 0)
+            if (version2)
             {
                 if (queryType)
                     add_xsd_string(ptr, "queryType", queryType);
@@ -1074,11 +1085,13 @@ int yaz_srw_codec(ODR o, void * vptr, Z_SRW_PDU **handler_data,
         else if ((*p)->which == Z_SRW_searchRetrieve_response)
         {
             Z_SRW_searchRetrieveResponse *res = (*p)->u.response;
+            if (version2)
+                ns = "http://docs.oasis-open.org/ns/search-ws/sruResponse";
             ptr = xmlNewChild(pptr, 0, BAD_CAST "searchRetrieveResponse", 0);
             ns_srw = xmlNewNs(ptr, BAD_CAST ns, BAD_CAST "zs");
             xmlSetNs(ptr, ns_srw);
 
-            if ((*p)->srw_version)
+            if (!version2)
                 add_xsd_string(ptr, "version", (*p)->srw_version);
             add_xsd_integer(ptr, "numberOfRecords", res->numberOfRecords);
             add_xsd_string(ptr, "resultSetId", res->resultSetId);
@@ -1088,7 +1101,7 @@ int yaz_srw_codec(ODR o, void * vptr, Z_SRW_PDU **handler_data,
                 xmlNodePtr rptr = xmlNewChild(ptr, 0, BAD_CAST "records", 0);
                 yaz_srw_records(o, rptr, &res->records, &res->extra_records,
                                 &res->num_records,
-                                client_data, ns);
+                                client_data);
             }
             add_xsd_integer(ptr, "nextRecordPosition",
                             res->nextRecordPosition);
@@ -1107,7 +1120,8 @@ int yaz_srw_codec(ODR o, void * vptr, Z_SRW_PDU **handler_data,
             ns_srw = xmlNewNs(ptr, BAD_CAST ns, BAD_CAST "zs");
             xmlSetNs(ptr, ns_srw);
 
-            add_xsd_string(ptr, "version", (*p)->srw_version);
+            if (!version2)
+                add_xsd_string(ptr, "version", (*p)->srw_version);
             add_xsd_string(ptr, "recordPacking", req->recordPacking);
             add_xsd_string(ptr, "stylesheet", req->stylesheet);
             add_xsd_string(ptr, "database", req->database);
@@ -1124,7 +1138,7 @@ int yaz_srw_codec(ODR o, void * vptr, Z_SRW_PDU **handler_data,
             {
                 xmlNodePtr ptr1 = xmlNewChild(ptr, 0, BAD_CAST "record", 0);
                 yaz_srw_record(o, ptr1, &res->record, &res->extra_record,
-                               client_data, ns);
+                               client_data);
             }
             if (res->num_diagnostics)
             {
@@ -1138,11 +1152,14 @@ int yaz_srw_codec(ODR o, void * vptr, Z_SRW_PDU **handler_data,
         {
             Z_SRW_scanRequest *req = (*p)->u.scan_request;
             const char *queryType = req->queryType;
+            if (version2)
+                ns = "http://docs.oasis-open.org/ns/search-ws/scan";
             ptr = xmlNewChild(pptr, 0, BAD_CAST "scanRequest", 0);
             ns_srw = xmlNewNs(ptr, BAD_CAST ns, BAD_CAST "zs");
             xmlSetNs(ptr, ns_srw);
 
-            add_xsd_string(ptr, "version", (*p)->srw_version);
+            if (!version2)
+                add_xsd_string(ptr, "version", (*p)->srw_version);
 
             if (strcmp((*p)->srw_version, "2.") > 0)
             {
@@ -1165,11 +1182,14 @@ int yaz_srw_codec(ODR o, void * vptr, Z_SRW_PDU **handler_data,
         else if ((*p)->which == Z_SRW_scan_response)
         {
             Z_SRW_scanResponse *res = (*p)->u.scan_response;
+            if (version2)
+                ns = "http://docs.oasis-open.org/ns/search-ws/scan";
             ptr = xmlNewChild(pptr, 0, BAD_CAST "scanResponse", 0);
             ns_srw = xmlNewNs(ptr, BAD_CAST ns, BAD_CAST "zs");
             xmlSetNs(ptr, ns_srw);
 
-            add_xsd_string(ptr, "version", (*p)->srw_version);
+            if (!version2)
+                add_xsd_string(ptr, "version", (*p)->srw_version);
 
             if (res->num_terms)
             {
@@ -1215,7 +1235,7 @@ int yaz_ucp_codec(ODR o, void * vptr, Z_SRW_PDU **handler_data,
         if (method->type != XML_ELEMENT_NODE)
             return -1;
 
-        *p = yaz_srw_get_core_v_1_1(o);
+        *p = yaz_srw_get_core_v_2_0(o);
 
         if (!xmlStrcmp(method->name, BAD_CAST "updateRequest"))
         {
@@ -1265,7 +1285,7 @@ int yaz_ucp_codec(ODR o, void * vptr, Z_SRW_PDU **handler_data,
                 {
                     req->record = yaz_srw_get_record(o);
                     yaz_srw_record(o, ptr, req->record, &req->extra_record,
-                                   client_data, ns_ucp_str);
+                                   client_data);
                 }
                 else if (match_xsd_string(ptr, "stylesheet", o,
                                           &req->stylesheet))
@@ -1313,7 +1333,7 @@ int yaz_ucp_codec(ODR o, void * vptr, Z_SRW_PDU **handler_data,
                 {
                     res->record = yaz_srw_get_record(o);
                     yaz_srw_record(o, ptr, res->record, &res->extra_record,
-                                   client_data, ns_ucp_str);
+                                   client_data);
                 }
                 else if (match_element(ptr, "diagnostics"))
                     yaz_srw_diagnostics(o, ptr, &res->diagnostics,
@@ -1358,7 +1378,7 @@ int yaz_ucp_codec(ODR o, void * vptr, Z_SRW_PDU **handler_data,
                 xmlNodePtr rptr = xmlNewChild(ptr, 0, BAD_CAST "record", 0);
                 xmlSetNs(rptr, ns_srw);
                 yaz_srw_record(o, rptr, req->record, &req->extra_record,
-                               client_data, ns_ucp_str);
+                               client_data);
            }
            if (req->extraRequestData_len)
             {
@@ -1390,7 +1410,7 @@ int yaz_ucp_codec(ODR o, void * vptr, Z_SRW_PDU **handler_data,
                 xmlNodePtr rptr = xmlNewChild(ptr, 0, BAD_CAST "record", 0);
                 xmlSetNs(rptr, ns_srw);
                 yaz_srw_record(o, rptr, res->record, &res->extra_record,
-                               client_data, ns_ucp_str);
+                               client_data);
            }
            if (res->num_diagnostics)
            {
index 9420a21..37d8f9e 100644 (file)
@@ -269,11 +269,12 @@ int yaz_srw_decode(Z_HTTP_Request *hreq, Z_SRW_PDU **srw_pdu,
             const char *p0 = hreq->path, *p1;
             int ret = -1;
 
-            static Z_SOAP_Handler soap_handlers[4] = {
+            static Z_SOAP_Handler soap_handlers[5] = {
 #if YAZ_HAVE_XML2
                 { YAZ_XMLNS_SRU_v1_1, 0, (Z_SOAP_fun) yaz_srw_codec },
                 { YAZ_XMLNS_SRU_v1_0, 0, (Z_SOAP_fun) yaz_srw_codec },
                 { YAZ_XMLNS_UPDATE_v0_9, 0, (Z_SOAP_fun) yaz_ucp_codec },
+                { YAZ_XMLNS_SRU_v2_mask, 0, (Z_SOAP_fun) yaz_srw_codec },
 #endif
                 {0, 0, 0}
             };
@@ -295,6 +296,8 @@ int yaz_srw_decode(Z_HTTP_Request *hreq, Z_SRW_PDU **srw_pdu,
                 *srw_pdu = (Z_SRW_PDU*) (*soap_package)->u.generic->p;
                 yaz_srw_decodeauth(*srw_pdu, hreq, 0, 0, decode);
 
+                if ((*soap_package)->u.generic->no == 3) /* SRU 2 ! */
+                    (*soap_package)->u.generic->no = 0;
                 if ((*srw_pdu)->which == Z_SRW_searchRetrieve_request &&
                     (*srw_pdu)->u.request->database == 0)
                     (*srw_pdu)->u.request->database = db;
@@ -386,7 +389,8 @@ int yaz_sru_decode(Z_HTTP_Request *hreq, Z_SRW_PDU **srw_pdu,
         char *scanClause = 0;
         char *recordXPath = 0;
         char *recordSchema = 0;
-        char *recordPacking = "xml";  /* xml packing is default for SRU */
+        char *recordXMLEscaping = 0;
+        char *recordPacking = 0;
         char *maximumRecords = 0;
         char *startRecord = 0;
         char *maximumTerms = 0;
@@ -443,6 +447,8 @@ int yaz_sru_decode(Z_HTTP_Request *hreq, Z_SRW_PDU **srw_pdu,
                     recordSchema = v;
                 else if (!strcmp(n, "recordPacking"))
                     recordPacking = v;
+                else if (!strcmp(n, "recordXMLEscaping"))
+                    recordXMLEscaping = v;
                 else if (!strcmp(n, "version"))
                     version = v;
                 else if (!strcmp(n, "scanClause"))
@@ -480,24 +486,16 @@ int yaz_sru_decode(Z_HTTP_Request *hreq, Z_SRW_PDU **srw_pdu,
                 }
             }
         }
-        if (!version)
-        {
-            if (uri_name)
-                yaz_add_srw_diagnostic(
-                    decode, diag, num_diag,
-                    YAZ_SRW_MANDATORY_PARAMETER_NOT_SUPPLIED, "version");
-            version = "1.1";
-        }
-
+        if (!operation && query)
+            operation = "searchRetrieve";
         version = yaz_negotiate_sru_version(version);
 
         if (!version)
         {   /* negotiation failed. */
             yaz_add_srw_diagnostic(decode, diag, num_diag,
-                                   YAZ_SRW_UNSUPP_VERSION, "1.2");
-            version = "1.2";
+                                   YAZ_SRW_UNSUPP_VERSION, "2.0");
+            version = "2.0";
         }
-
         if (!operation)
         {
             if (uri_name)
@@ -506,6 +504,20 @@ int yaz_sru_decode(Z_HTTP_Request *hreq, Z_SRW_PDU **srw_pdu,
                     YAZ_SRW_MANDATORY_PARAMETER_NOT_SUPPLIED, "operation");
             operation = "explain";
         }
+        if (strcmp(version, "2.0"))
+        {
+            if (recordXMLEscaping)
+            {
+                yaz_add_srw_diagnostic(decode, diag, num_diag,
+                                       YAZ_SRW_UNSUPP_PARAMETER,
+                                       "recordXMLEscaping");
+
+            }
+            recordXMLEscaping = recordPacking;
+            recordPacking = "packed";
+        }
+        if (!recordXMLEscaping)
+            recordXMLEscaping = "xml";
         if (!strcmp(operation, "searchRetrieve"))
         {
             Z_SRW_PDU *sr = yaz_srw_get(decode, Z_SRW_searchRetrieve_request);
@@ -530,7 +542,8 @@ int yaz_sru_decode(Z_HTTP_Request *hreq, Z_SRW_PDU **srw_pdu,
             }
             sr->u.request->recordXPath = recordXPath;
             sr->u.request->recordSchema = recordSchema;
-            sr->u.request->recordPacking = recordPacking;
+            sr->u.request->recordPacking = recordXMLEscaping;
+            sr->u.request->packing = recordPacking;
             sr->u.request->stylesheet = stylesheet;
 
             yaz_sru_decode_integer(decode, "maximumRecords", maximumRecords,
@@ -568,7 +581,8 @@ int yaz_sru_decode(Z_HTTP_Request *hreq, Z_SRW_PDU **srw_pdu,
             sr->extra_args = extra_args;
             yaz_srw_decodeauth(sr, hreq, username, password, decode);
             *srw_pdu = sr;
-            sr->u.explain_request->recordPacking = recordPacking;
+            sr->u.explain_request->recordPacking = recordXMLEscaping;
+            sr->u.explain_request->packing = recordPacking;
             sr->u.explain_request->database = db;
 
             sr->u.explain_request->stylesheet = stylesheet;
@@ -718,14 +732,14 @@ static Z_SRW_PDU *yaz_srw_get_core_ver(ODR o, const char *version)
     return p;
 }
 
-Z_SRW_PDU *yaz_srw_get_core_v_1_1(ODR o)
+Z_SRW_PDU *yaz_srw_get_core_v_2_0(ODR o)
 {
-    return yaz_srw_get_core_ver(o, "1.1");
+    return yaz_srw_get_core_ver(o, "2.0");
 }
 
 Z_SRW_PDU *yaz_srw_get(ODR o, int which)
 {
-    return yaz_srw_get_pdu(o, which, "1.1");
+    return yaz_srw_get_pdu(o, which, "2.0");
 }
 
 Z_SRW_PDU *yaz_srw_get_pdu(ODR o, int which, const char *version)
@@ -862,16 +876,19 @@ void yaz_add_name_value_str(ODR o, char **name, char **value,  int *i,
 static int yaz_get_sru_parms(const Z_SRW_PDU *srw_pdu, ODR encode,
                              char **name, char **value, int max_names)
 {
+    int version2 = strcmp(srw_pdu->srw_version, "2.") > 0;
     int i = 0;
     char *queryType;
-    yaz_add_name_value_str(encode, name, value, &i, "version", srw_pdu->srw_version);
+    if (!version2)
+        yaz_add_name_value_str(encode, name, value, &i, "version", srw_pdu->srw_version);
     name[i] = "operation";
     switch (srw_pdu->which)
     {
     case Z_SRW_searchRetrieve_request:
-        value[i++] = "searchRetrieve";
+        if (!version2)
+            value[i++] = "searchRetrieve";
         queryType = srw_pdu->u.request->queryType;
-        if (strcmp(srw_pdu->srw_version, "2.") > 0)
+        if (version2)
         {
             yaz_add_name_value_str(encode, name, value, &i, "queryType",
                                    queryType);
@@ -928,7 +945,7 @@ static int yaz_get_sru_parms(const Z_SRW_PDU *srw_pdu, ODR encode,
     case Z_SRW_scan_request:
         value[i++] = "scan";
         queryType = srw_pdu->u.request->queryType;
-        if (strcmp(srw_pdu->srw_version, "2.") > 0)
+        if (version2)
         {
             if (queryType && strcmp(queryType, "cql"))
                 yaz_add_name_value_str(encode, name, value, &i, "queryType",
index 12f226f..a5e6169 100644 (file)
@@ -420,7 +420,7 @@ int ZOOM_handle_sru(ZOOM_connection c, Z_HTTP_Response *hres,
         ODR o = c->odr_in;
         Z_SOAP_Handler soap_handlers[3] = {
             {YAZ_XMLNS_SRU_v1_response, 0, (Z_SOAP_fun) yaz_srw_codec},
-            {YAZ_XMLNS_SRU_v2_response, 0, (Z_SOAP_fun) yaz_srw_codec},
+            {YAZ_XMLNS_SRU_v2_mask, 0, (Z_SOAP_fun) yaz_srw_codec},
             {0, 0, 0}
         };
         ret = z_soap_codec(o, &soap_package,