summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar snowdrop2004-06-03 08:53:31 +0000
committerGravatar snowdrop2004-06-03 08:53:31 +0000
commit4666292be1927bdb2e319f417a08ab17c91de784 (patch)
treed235a470090a18bb801646eebf24f214a6243675
parentdba04a85c15cf13cae1e3cb1e47e586e2fabc039 (diff)
downloadcsoap-4666292be1927bdb2e319f417a08ab17c91de784.tar.gz
csoap-4666292be1927bdb2e319f417a08ab17c91de784.tar.bz2
develop
-rw-r--r--config.h.in6
-rwxr-xr-xwsdl2c/wsdl2c.c51
-rw-r--r--xsd2c/xsd2c.c22
-rwxr-xr-xxsd2c/xsd2c.h23
4 files changed, 73 insertions, 29 deletions
diff --git a/config.h.in b/config.h.in
index 2e100bd..0356f7c 100644
--- a/config.h.in
+++ b/config.h.in
@@ -51,9 +51,6 @@
/* Define to 1 if you have the `vprintf' function. */
#undef HAVE_VPRINTF
-/* Name of package */
-#undef PACKAGE
-
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
@@ -78,9 +75,6 @@
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
#undef TM_IN_SYS_TIME
-/* Version number of package */
-#undef VERSION
-
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
diff --git a/wsdl2c/wsdl2c.c b/wsdl2c/wsdl2c.c
index 43d0a3c..5b744e7 100755
--- a/wsdl2c/wsdl2c.c
+++ b/wsdl2c/wsdl2c.c
@@ -1,3 +1,26 @@
+/******************************************************************
+ * $Id: wsdl2c.c,v 1.5 2004/06/03 08:53:34 snowdrop Exp $
+ *
+ * CSOAP Project: A SOAP client/server library in C
+ * Copyright (C) 2003 Ferhat Ayaz
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Email: ayaz@jprogrammer.net
+ */
#include <libxml/xpath.h>
#include <xsd2c/xsd2c.h>
#include <xsd2c/util.h> /* parseNS */
@@ -176,7 +199,7 @@ void handleInputParameters(xmlDocPtr doc, const char *name)
xmlNodePtr node;
xmlNodePtr cur;
- xmlChar *var_name, *var_type, *var_element;
+ xmlChar *var_name, *var_type;
parseNS(name, ns, message_name); /* check why to pase ns? */
@@ -208,24 +231,20 @@ void handleInputParameters(xmlDocPtr doc, const char *name)
}
var_type = xmlGetProp(cur, "type");
- if (var_type != NULL) {
- fprintf(stdout, "\t\t(type:%s,%s)\n", (const char*)var_type, (const char*)var_name);
- xmlFree(var_name);
- xmlFree(var_type);
- cur = cur->next;
- continue;
+ if (var_type == NULL) {
+ var_type = xmlGetProp(cur, "element");
}
- var_element = xmlGetProp(cur, "element");
- if (var_element == NULL) {
+ if (var_type == NULL) {
fprintf(stderr, "ERROR: Found <part> without attrbute 'type' or 'element'! (message:'%s')\n",
message_name);
xmlFree(var_name);
cur = cur->next;
continue;
- }
+ }
+
- fprintf(stdout, "\t\t(element:%s,%s)\n", (const char*)var_element, (const char*)var_name);
+ fprintf(stdout, "\t\t(%s,%s)\n", trXSD2C((const char*)var_type), (const char*)var_name);
xmlFree(var_name);
xmlFree(var_type);
@@ -491,7 +510,14 @@ int main(int argc, char *argv[])
xmlNewDocProp(doc, "xmlns", "http://schemas.xmlsoap.org/wsdl/");
}
+ if (!xsdInitTrModule(xsdRoot))
+ return 1;
+
+ if (!xsdInitObjModule(xsdRoot))
+ return 1;
+
+
if (xsdEngineRun(xsdRoot, outDir)) {
fprintf(stderr, "xsd2c engine error\n");
return 1;
@@ -512,4 +538,5 @@ static
void usage(const char* execname)
{
fprintf(stderr, "usage: %s -d dest <wsdl file>\n", execname);
-} \ No newline at end of file
+}
+
diff --git a/xsd2c/xsd2c.c b/xsd2c/xsd2c.c
index 80660c3..d870f7c 100644
--- a/xsd2c/xsd2c.c
+++ b/xsd2c/xsd2c.c
@@ -1,5 +1,5 @@
/******************************************************************
- * $Id: xsd2c.c,v 1.3 2004/06/02 15:35:07 snowdrop Exp $
+ * $Id: xsd2c.c,v 1.4 2004/06/03 08:53:34 snowdrop Exp $
*
* CSOAP Project: A SOAP client/server library in C
* Copyright (C) 2003 Ferhat Ayaz
@@ -19,7 +19,7 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
- * Email: ayaz@jprogrammet.net
+ * Email: ayaz@jprogrammer.net
******************************************************************/
#include <libxml/xmlmemory.h>
@@ -685,20 +685,20 @@ int xsdInitObjModule(xmlNodePtr xsdNode)
return 1;
}
-
-int xsdEngineRun(xmlNodePtr xsdNode, const char* destDir)
+void xsdSetDestDir(const char* destDir)
{
-
- if (!xsdInitTrModule(xsdNode))
- return 1;
-
- if (!xsdInitObjModule(xsdNode))
- return 1;
strcpy(outDir, destDir);
-
+
mkdir(destDir, S_IRUSR|S_IWUSR|S_IXUSR |
S_IRGRP|S_IWGRP|S_IXGRP |
S_IROTH|S_IXOTH );
+}
+
+int xsdEngineRun(xmlNodePtr xsdNode, const char* destDir)
+{
+
+
+ xsdSetDestDir(destDir);
if (xsdNode != NULL) {
runGenerator(xsdNode);
diff --git a/xsd2c/xsd2c.h b/xsd2c/xsd2c.h
index 73bf6b6..7bb4b8c 100755
--- a/xsd2c/xsd2c.h
+++ b/xsd2c/xsd2c.h
@@ -1,3 +1,26 @@
+/******************************************************************
+ * $Id: xsd2c.h,v 1.2 2004/06/03 08:53:34 snowdrop Exp $
+ *
+ * CSOAP Project: A SOAP client/server library in C
+ * Copyright (C) 2003 Ferhat Ayaz
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Email: ayaz@jprogrammer.net
+ */
#ifndef XSD2C_H
#define XSD2C_H