{
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_v2_response, 0, (Z_SOAP_fun) yaz_srw_codec},
{YAZ_XMLNS_UPDATE_v0_9, 0, (Z_SOAP_fun) yaz_ucp_codec},
{0, 0, 0}
};
#endif
#include <yaz/soap.h>
+#include <yaz/match_glob.h>
#if YAZ_HAVE_XML2
#include <libxml/parser.h>
/* 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)
{
p_top_tmp.children = ptr;
ret = (*handlers[i].f)(o, &p_top_tmp, &handler_data,
handlers[i].client_data,
- handlers[i].ns);
+ (const char *)ptr->ns->href);
if (ret || !handler_data)
z_soap_error(o, p, "SOAP-ENV:Client",
}
else
{
+ const char *ns = (const char *) ptr->ns->href;
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))
break;
+ }
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);
else
{
ret = z_soap_error(o, p, "SOAP-ENV:Client",
- "No handler for NS",
- (const char *)ptr->ns->href);
+ "No handler for NS", ns);
}
}
xmlFreeDoc(doc);
{
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_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);
- 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;