From 00537b483d646bd04a204708ecbde708861f044e Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 18 Oct 2012 13:24:25 +0200 Subject: [PATCH] Allow more namespaces for SRU This is to allow, for example, an incorrect namespace returned from server http://services.igi-global.com/sru . --- client/client.c | 4 ++-- include/yaz/srw.h | 1 + src/zoom-sru.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/client/client.c b/client/client.c index 549678c..bbce995 100644 --- a/client/client.c +++ b/client/client.c @@ -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, diff --git a/include/yaz/srw.h b/include/yaz/srw.h index 2fa1c1e..7868884 100644 --- a/include/yaz/srw.h +++ b/include/yaz/srw.h @@ -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); diff --git a/src/zoom-sru.c b/src/zoom-sru.c index 9936bdd..87de7c3 100644 --- a/src/zoom-sru.c +++ b/src/zoom-sru.c @@ -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} }; -- 1.7.10.4