projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Document s=ag
[yaz-moved-to-github.git]
/
src
/
soap.c
diff --git
a/src/soap.c
b/src/soap.c
index
8c23a9a
..
0f564b0
100644
(file)
--- a/
src/soap.c
+++ b/
src/soap.c
@@
-1,8
+1,6
@@
-/*
- * Copyright (C) 1995-2005, Index Data ApS
+/* This file is part of the YAZ toolkit.
+ * Copyright (C) 1995-2012 Index Data
* See the file LICENSE for details.
* See the file LICENSE for details.
- *
- * $Id: soap.c,v 1.15 2006-10-24 08:05:45 adam Exp $
*/
/**
* \file soap.c
*/
/**
* \file soap.c
@@
-11,8
+9,12
@@
* This implements encoding and decoding of SOAP packages using
* Libxml2.
*/
* This implements encoding and decoding of SOAP packages using
* Libxml2.
*/
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
#include <yaz/soap.h>
#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>
@@
-55,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++)
/* 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)
{
@@
-65,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,
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",
if (ret || !handler_data)
z_soap_error(o, p, "SOAP-ENV:Client",
@@
-181,15
+183,19
@@
int z_soap_codec_enc_xsl(ODR o, Z_SOAP **pp,
}
else
{
}
else
{
+ 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))
break;
break;
+ }
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);
@@
-206,8
+212,7
@@
int z_soap_codec_enc_xsl(ODR o, Z_SOAP **pp,
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);
}
}
xmlFreeDoc(doc);
}
}
xmlFreeDoc(doc);
@@
-261,12
+266,10
@@
int z_soap_codec_enc_xsl(ODR o, Z_SOAP **pp,
xmlDocSetRootElement(doc, body_ptr->children);
body_ptr->children = 0;
xmlFreeNode(envelope_ptr);
xmlDocSetRootElement(doc, body_ptr->children);
body_ptr->children = 0;
xmlFreeNode(envelope_ptr);
- if (!encoding)
- encoding = "utf-8";
}
if (stylesheet)
{
}
if (stylesheet)
{
- char *content = odr_malloc(o, strlen(stylesheet) + 40);
+ char *content = (char *) odr_malloc(o, strlen(stylesheet) + 40);
xmlNodePtr pi, ptr = xmlDocGetRootElement(doc);
sprintf(content, "type=\"text/xsl\" href=\"%s\"", stylesheet);
xmlNodePtr pi, ptr = xmlDocGetRootElement(doc);
sprintf(content, "type=\"text/xsl\" href=\"%s\"", stylesheet);
@@
-353,6
+356,7
@@
int z_soap_error(ODR o, Z_SOAP *p,
/*
* Local variables:
* c-basic-offset: 4
/*
* Local variables:
* c-basic-offset: 4
+ * c-file-style: "Stroustrup"
* indent-tabs-mode: nil
* End:
* vim: shiftwidth=4 tabstop=8 expandtab
* indent-tabs-mode: nil
* End:
* vim: shiftwidth=4 tabstop=8 expandtab