X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fsoap.c;h=0f564b02bcbe1dd606040642a2dcbb92d23db9ea;hb=2bf750fa7a6e28d9ebb1fabd6325ecf4cfac7e49;hp=167f0fca27ab79b644ae9475d265eef2ec75b8b2;hpb=2788a4851b551e1a3efb320a2878b809f2d8a9d7;p=yaz-moved-to-github.git diff --git a/src/soap.c b/src/soap.c index 167f0fc..0f564b0 100644 --- a/src/soap.c +++ b/src/soap.c @@ -1,5 +1,5 @@ /* This file is part of the YAZ toolkit. - * Copyright (C) 1995-2009 Index Data + * Copyright (C) 1995-2012 Index Data * See the file LICENSE for details. */ /** @@ -9,8 +9,12 @@ * This implements encoding and decoding of SOAP packages using * Libxml2. */ +#if HAVE_CONFIG_H +#include +#endif #include +#include #if YAZ_HAVE_XML2 #include @@ -53,7 +57,7 @@ int z_soap_codec_enc_xsl(ODR o, Z_SOAP **pp, /* 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) { @@ -63,7 +67,7 @@ int z_soap_codec_enc_xsl(ODR o, Z_SOAP **pp, 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", @@ -179,15 +183,19 @@ int z_soap_codec_enc_xsl(ODR o, Z_SOAP **pp, } 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); @@ -204,8 +212,7 @@ int z_soap_codec_enc_xsl(ODR o, Z_SOAP **pp, 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); @@ -349,6 +356,7 @@ int z_soap_error(ODR o, Z_SOAP *p, /* * Local variables: * c-basic-offset: 4 + * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab