Use libxml2 instead of libxslt(and libxml2)
[yaz-moved-to-github.git] / zutil / soap.c
index a19fc57..f06ae8f 100644 (file)
@@ -2,12 +2,12 @@
  * Copyright (c) 2002-2003, Index Data.
  * See the file LICENSE for details.
  *
- * $Id: soap.c,v 1.2 2003-02-14 18:49:24 adam Exp $
+ * $Id: soap.c,v 1.4 2003-02-17 22:35:48 adam Exp $
  */
 
 #include <yaz/soap.h>
 
-#if HAVE_XSLT
+#if HAVE_XML2
 #include <libxml/parser.h>
 #include <libxml/tree.h>
 
@@ -54,7 +54,7 @@ int z_soap_codec(ODR o, Z_SOAP **pp,
         /* check that root node is Envelope */
         ptr = xmlDocGetRootElement(doc);
         if (!ptr || ptr->type != XML_ELEMENT_NODE ||
-            strcmp(ptr->name, "Envelope"))
+            strcmp(ptr->name, "Envelope") || !ptr->ns)
         {
             xmlFreeDoc(doc);
             return z_soap_error(o, p, "SOAP-ENV:Client",
@@ -183,6 +183,8 @@ int z_soap_codec(ODR o, Z_SOAP **pp,
 
         envelope_ptr = xmlNewNode(0, "Envelope");
         ns_env = xmlNewNs(envelope_ptr, p->ns, "SOAP-ENV");
+        xmlSetNs(envelope_ptr, ns_env);
+
         body_ptr = xmlNewChild(envelope_ptr, ns_env, "Body", 0);
         xmlDocSetRootElement(doc, envelope_ptr);