The official namespace for responses, according to
http://docs.oasis-open.org/search-ws/searchRetrieve/v1.0/cs01/schemas/sruResponse.xsd
appears to be http://docs.oasis-open.org/ns/search-ws/sruResponse .
nature.com's server, however, usee namespace
http://docs.oasis-open.org/ns/search-ws/sru-2-0-response
For this reason we are now using a glob-expr to match up the namespace.
ZOOM C and yaz-client updated.
Perhaps SRU 1.2 uses same namespace, I don't know. I can not find
a single real example showing the "real" namespace in the documentation
from OASIS. The namespace for requests is different from responses, but
this is not added to YAZ yet, when we don't encode them yet.
{
Z_SOAP *soap_package = 0;
ODR o = odr_createmem(ODR_DECODE);
{
Z_SOAP *soap_package = 0;
ODR o = odr_createmem(ODR_DECODE);
- Z_SOAP_Handler soap_handlers[3] = {
+ Z_SOAP_Handler soap_handlers[4] = {
{YAZ_XMLNS_SRU_v1_1, 0, (Z_SOAP_fun) yaz_srw_codec},
{YAZ_XMLNS_SRU_v1_1, 0, (Z_SOAP_fun) yaz_srw_codec},
+ {YAZ_XMLNS_SRU_v2_response, 0, (Z_SOAP_fun) yaz_srw_codec},
{YAZ_XMLNS_UPDATE_v0_9, 0, (Z_SOAP_fun) yaz_ucp_codec},
{0, 0, 0}
};
{YAZ_XMLNS_UPDATE_v0_9, 0, (Z_SOAP_fun) yaz_ucp_codec},
{0, 0, 0}
};
#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_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"
YAZ_EXPORT
int yaz_srw_check_content_type(Z_HTTP_Response *hres);
YAZ_EXPORT
int yaz_srw_check_content_type(Z_HTTP_Response *hres);
#endif
#include <yaz/soap.h>
#endif
#include <yaz/soap.h>
+#include <yaz/match_glob.h>
#if YAZ_HAVE_XML2
#include <libxml/parser.h>
#if YAZ_HAVE_XML2
#include <libxml/parser.h>
/* check for SRU root node match */
for (i = 0; handlers[i].ns; i++)
/* check for SRU root node match */
for (i = 0; handlers[i].ns; i++)
- if (!xmlStrcmp(ptr->ns->href, BAD_CAST handlers[i].ns))
+ if (yaz_match_glob(handlers[i].ns, (const char *)ptr->ns->href))
break;
if (handlers[i].ns)
{
break;
if (handlers[i].ns)
{
p_top_tmp.children = ptr;
ret = (*handlers[i].f)(o, &p_top_tmp, &handler_data,
handlers[i].client_data,
p_top_tmp.children = ptr;
ret = (*handlers[i].f)(o, &p_top_tmp, &handler_data,
handlers[i].client_data,
+ (const char *)ptr->ns->href);
if (ret || !handler_data)
z_soap_error(o, p, "SOAP-ENV:Client",
if (ret || !handler_data)
z_soap_error(o, p, "SOAP-ENV:Client",
+ const char *ns = (const char *) ptr->ns->href;
for (i = 0; handlers[i].ns; i++)
for (i = 0; handlers[i].ns; i++)
- if (!xmlStrcmp(ptr->ns->href, BAD_CAST handlers[i].ns))
+ {
+ fprintf(stderr, "checking globns=%s ns=%s\n",
+ handlers[i].ns, ns);
+ if (yaz_match_glob(handlers[i].ns, ns))
if (handlers[i].ns)
{
void *handler_data = 0;
ret = (*handlers[i].f)(o, pptr, &handler_data,
if (handlers[i].ns)
{
void *handler_data = 0;
ret = (*handlers[i].f)(o, pptr, &handler_data,
- handlers[i].client_data,
- handlers[i].ns);
+ handlers[i].client_data, ns);
if (ret || !handler_data)
z_soap_error(o, p, "SOAP-ENV:Client",
"SOAP Handler returned error", 0);
if (ret || !handler_data)
z_soap_error(o, p, "SOAP-ENV:Client",
"SOAP Handler returned error", 0);
else
{
ret = z_soap_error(o, p, "SOAP-ENV:Client",
else
{
ret = z_soap_error(o, p, "SOAP-ENV:Client",
- "No handler for NS",
- (const char *)ptr->ns->href);
+ "No handler for NS", ns);
{
Z_SOAP *soap_package = 0;
ODR o = c->odr_in;
{
Z_SOAP *soap_package = 0;
ODR o = c->odr_in;
- Z_SOAP_Handler soap_handlers[2] = {
+ Z_SOAP_Handler soap_handlers[3] = {
{YAZ_XMLNS_SRU_v1_1, 0, (Z_SOAP_fun) yaz_srw_codec},
{YAZ_XMLNS_SRU_v1_1, 0, (Z_SOAP_fun) yaz_srw_codec},
+ {YAZ_XMLNS_SRU_v2_response, 0, (Z_SOAP_fun) yaz_srw_codec},
{0, 0, 0}
};
ret = z_soap_codec(o, &soap_package,
&hres->content_buf, &hres->content_len,
soap_handlers);
{0, 0, 0}
};
ret = z_soap_codec(o, &soap_package,
&hres->content_buf, &hres->content_len,
soap_handlers);
- if (!ret && soap_package->which == Z_SOAP_generic &&
- soap_package->u.generic->no == 0)
+ if (!ret && soap_package->which == Z_SOAP_generic)
{
Z_SRW_PDU *sr = (Z_SRW_PDU*) soap_package->u.generic->p;
{
Z_SRW_PDU *sr = (Z_SRW_PDU*) soap_package->u.generic->p;