Allow more namespaces for SRU
authorAdam Dickmeiss <adam@indexdata.dk>
Thu, 18 Oct 2012 11:24:25 +0000 (13:24 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Thu, 18 Oct 2012 11:27:35 +0000 (13:27 +0200)
This is to allow, for example, an incorrect namespace returned
from server http://services.igi-global.com/sru .

client/client.c
include/yaz/srw.h
src/zoom-sru.c

index 549678c..bbce995 100644 (file)
@@ -4459,10 +4459,10 @@ static void http_response(Z_HTTP_Response *hres)
         {
             Z_SOAP *soap_package = 0;
             ODR o = odr_createmem(ODR_DECODE);
-            Z_SOAP_Handler soap_handlers[4] = {
-                {YAZ_XMLNS_SRU_v1_1, 0, (Z_SOAP_fun) yaz_srw_codec},
+            Z_SOAP_Handler soap_handlers[] = {
                 {YAZ_XMLNS_SRU_v2_response, 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}
             };
             ret = z_soap_codec(o, &soap_package,
index 2fa1c1e..7868884 100644 (file)
@@ -336,6 +336,7 @@ void yaz_encode_sru_extra(Z_SRW_PDU *sr, ODR odr, const char *extra_args);
 #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_v1_response "http://www.loc.gov/*"
 
 YAZ_EXPORT
 int yaz_srw_check_content_type(Z_HTTP_Response *hres);
index 9936bdd..87de7c3 100644 (file)
@@ -426,7 +426,7 @@ int ZOOM_handle_sru(ZOOM_connection c, Z_HTTP_Response *hres,
         Z_SOAP *soap_package = 0;
         ODR o = c->odr_in;
         Z_SOAP_Handler soap_handlers[3] = {
-            {YAZ_XMLNS_SRU_v1_1, 0, (Z_SOAP_fun) yaz_srw_codec},
+            {YAZ_XMLNS_SRU_v1_response, 0, (Z_SOAP_fun) yaz_srw_codec},
             {YAZ_XMLNS_SRU_v2_response, 0, (Z_SOAP_fun) yaz_srw_codec},
             {0, 0, 0}
         };