annotate GEMBASSY-1.0.3/gsoap/wsdl/wsdl2h.cpp @ 0:8300eb051bea draft

Initial upload
author ktnyt
date Fri, 26 Jun 2015 05:19:29 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
1 /*
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
2 wsdl2h.cpp
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
3
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
4 WSDL parser, translator, and generator (of the gSOAP header file format)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
5
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
6 --------------------------------------------------------------------------------
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
7 gSOAP XML Web services tools
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
8 Copyright (C) 2000-2013, Robert van Engelen, Genivia Inc. All Rights Reserved.
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
9 This software is released under one of the following licenses:
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
10 GPL or Genivia's license for commercial use.
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
11 --------------------------------------------------------------------------------
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
12 GPL license.
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
13
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
14 This program is free software; you can redistribute it and/or modify it under
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
15 the terms of the GNU General Public License as published by the Free Software
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
16 Foundation; either version 2 of the License, or (at your option) any later
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
17 version.
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
18
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
19 This program is distributed in the hope that it will be useful, but WITHOUT ANY
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
20 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
21 PARTICULAR PURPOSE. See the GNU General Public License for more details.
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
22
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
23 You should have received a copy of the GNU General Public License along with
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
24 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
25 Place, Suite 330, Boston, MA 02111-1307 USA
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
26
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
27 Author contact information:
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
28 engelen@genivia.com / engelen@acm.org
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
29 --------------------------------------------------------------------------------
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
30 A commercial use license is available from Genivia, Inc., contact@genivia.com
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
31 --------------------------------------------------------------------------------
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
32
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
33 Build:
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
34 soapcpp2 -ipwsdl wsdl.h
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
35 g++ -o wsdl2h wsdl2h.cpp types.cpp service.cpp wsdl.cpp schema.cpp wsdlC.cpp stdsoap2.cpp
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
36
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
37 TODO:
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
38 Resolve relative versus absolute import paths for reading imported WSDL/schema (use URL local addresses)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
39 Do not generate abstract complexTypes, but include defs in derived types
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
40 Handle simpleType derivation from base64
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
41
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
42 */
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
43
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
44 #include "includes.h"
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
45 #include "types.h"
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
46 #include "service.h"
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
47
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
48 #ifndef WSDL2H_IMPORT_PATH
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
49 #define WSDL2H_IMPORT_PATH (NULL)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
50 #endif
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
51
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
52 #ifndef WSDL_TYPEMAP_FILE
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
53 #define WSDL_TYPEMAP_FILE "typemap.dat"
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
54 #endif
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
55
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
56 static void init();
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
57 static void options(int argc, char **argv);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
58
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
59 int _flag = 0,
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
60 aflag = 0,
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
61 bflag = 0,
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
62 cflag = 0,
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
63 dflag = 0,
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
64 eflag = 0,
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
65 fflag = 0,
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
66 gflag = 0,
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
67 iflag = 0,
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
68 jflag = 0,
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
69 kflag = 0,
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
70 mflag = 0,
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
71 pflag = 0,
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
72 Pflag = 0,
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
73 Rflag = 0,
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
74 sflag = 0,
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
75 uflag = 0,
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
76 vflag = 0,
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
77 wflag = 0,
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
78 Wflag = 0,
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
79 xflag = 0,
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
80 yflag = 0,
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
81 zflag = 0;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
82
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
83 int infiles = 0;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
84 char *infile[MAXINFILES],
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
85 *outfile = NULL,
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
86 *proxy_host = NULL,
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
87 *proxy_userid = NULL,
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
88 *proxy_passwd = NULL,
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
89 *auth_userid = NULL,
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
90 *auth_passwd = NULL;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
91 const char
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
92 *mapfile = WSDL_TYPEMAP_FILE,
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
93 *import_path = WSDL2H_IMPORT_PATH,
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
94 *cwd_path = NULL,
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
95 *cppnamespace = NULL;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
96
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
97 int proxy_port = 8080;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
98
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
99 FILE *stream = stdout;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
100
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
101 SetOfString exturis;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
102
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
103 extern struct Namespace namespaces[];
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
104
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
105 const char *service_prefix = NULL;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
106 const char *schema_prefix = "ns";
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
107
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
108 const char elementformat[] = " %-35s %-30s";
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
109 const char pointerformat[] = " %-35s *%-30s";
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
110 const char attributeformat[] = " @%-35s %-30s";
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
111 const char vectorformat[] = " std::vector<%-23s> %-30s";
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
112 const char pointervectorformat[] = " std::vector<%-22s> *%-30s";
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
113 const char vectorformat_open[] = " std::vector<%s";
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
114 const char arrayformat[] = " %-35s *__ptr%-25s";
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
115 const char arraysizeformat[] = " %-35s __size%-24s";
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
116 const char arrayoffsetformat[] = "// %-35s __offset%-22s";
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
117 const char sizeformat[] = " $%-35s __size%-24s";
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
118 const char choiceformat[] = " $%-35s __union%-23s";
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
119 const char schemaformat[] = "//gsoap %-5s schema %s:\t%s\n";
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
120 const char serviceformat[] = "//gsoap %-4s service %s:\t%s %s\n";
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
121 const char paraformat[] = " %-35s%s%s%s";
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
122 const char anonformat[] = " %-35s%s_%s%s";
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
123
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
124 const char copyrightnotice[] = "\n** The gSOAP WSDL/Schema processor for C and C++, wsdl2h release " WSDL2H_VERSION "\n** Copyright (C) 2000-2013 Robert van Engelen, Genivia Inc.\n** All Rights Reserved. This product is provided \"as is\", without any warranty.\n** The wsdl2h tool is released under one of the following licenses:\n** GPL or the commercial license by Genivia Inc. Use option -l for details.\n\n";
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
125
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
126 const char licensenotice[] = "\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
127 --------------------------------------------------------------------------------\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
128 gSOAP XML Web services tools\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
129 Copyright (C) 2000-2013, Robert van Engelen, Genivia Inc. All Rights Reserved.\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
130 \n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
131 This software is released under one of the following licenses:\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
132 GPL or Genivia's license for commercial use.\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
133 --------------------------------------------------------------------------------\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
134 GPL license.\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
135 \n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
136 This program is free software; you can redistribute it and/or modify it under\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
137 the terms of the GNU General Public License as published by the Free Software\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
138 Foundation; either version 2 of the License, or (at your option) any later\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
139 version.\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
140 \n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
141 This program is distributed in the hope that it will be useful, but WITHOUT ANY\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
142 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
143 PARTICULAR PURPOSE. See the GNU General Public License for more details.\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
144 \n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
145 You should have received a copy of the GNU General Public License along with\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
146 this program; if not, write to the Free Software Foundation, Inc., 59 Temple\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
147 Place, Suite 330, Boston, MA 02111-1307 USA\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
148 \n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
149 Author contact information:\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
150 engelen@genivia.com / engelen@acm.org\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
151 \n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
152 This program is released under the GPL with the additional exemption that\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
153 compiling, linking, and/or using OpenSSL is allowed.\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
154 --------------------------------------------------------------------------------\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
155 A commercial-use license is available from Genivia, Inc., contact@genivia.com\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
156 --------------------------------------------------------------------------------\n";
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
157
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
158 int main(int argc, char **argv)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
159 { init();
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
160 fprintf(stderr, "%s", copyrightnotice);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
161 options(argc, argv);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
162 Definitions def;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
163 wsdl__definitions definitions;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
164 definitions.read(infiles, infile);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
165 if (definitions.error())
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
166 { definitions.print_fault();
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
167 exit(1);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
168 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
169 definitions.traverse();
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
170 def.compile(definitions);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
171 if (outfile)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
172 { fclose(stream);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
173 fprintf(stderr, "\nTo complete the process, compile with:\n> soapcpp2 %s\n", outfile);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
174 if (!cflag)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
175 fprintf(stderr, "or to generate C++ proxy and object classes:\n> soapcpp2 -j %s\n", outfile);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
176 fprintf(stderr, "\n");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
177 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
178 return 0;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
179 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
180
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
181 ////////////////////////////////////////////////////////////////////////////////
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
182 //
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
183 // Initialization
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
184 //
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
185 ////////////////////////////////////////////////////////////////////////////////
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
186
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
187 static void init()
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
188 { struct Namespace *p = namespaces;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
189 if (p)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
190 { for (; p->id; p++)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
191 { if (p->in && *p->in)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
192 exturis.insert(p->in);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
193 if (p->ns && *p->ns)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
194 exturis.insert(p->ns);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
195 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
196 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
197 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
198
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
199 ////////////////////////////////////////////////////////////////////////////////
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
200 //
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
201 // Parse command line options
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
202 //
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
203 ////////////////////////////////////////////////////////////////////////////////
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
204
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
205 static void options(int argc, char **argv)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
206 { int i;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
207 infiles = 0;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
208 for (i = 1; i < argc; i++)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
209 { char *a = argv[i];
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
210 if (*a == '-'
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
211 #ifdef WIN32
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
212 || *a == '/'
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
213 #endif
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
214 )
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
215 { int g = 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
216 while (g && *++a)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
217 { switch (*a)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
218 { case '_':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
219 _flag = 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
220 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
221 case 'a':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
222 aflag = 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
223 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
224 case 'b':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
225 bflag = 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
226 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
227 case 'c':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
228 cflag = 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
229 if (cppnamespace)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
230 fprintf(stderr, "wsdl2h: Options -c and -q clash\n");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
231 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
232 case 'd':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
233 dflag = 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
234 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
235 case 'e':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
236 eflag = 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
237 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
238 case 'f':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
239 fflag = 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
240 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
241 case 'g':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
242 gflag = 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
243 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
244 case 'i':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
245 iflag = 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
246 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
247 case 'j':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
248 jflag = 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
249 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
250 case 'k':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
251 kflag = 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
252 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
253 case 'I':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
254 a++;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
255 g = 0;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
256 if (*a)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
257 import_path = a;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
258 else if (i < argc && argv[++i])
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
259 import_path = argv[i];
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
260 else
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
261 fprintf(stderr, "wsdl2h: Option -I requires a path argument\n");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
262 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
263 case 'l':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
264 fprintf(stderr, "%s", licensenotice);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
265 exit(0);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
266 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
267 case 'm':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
268 mflag = 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
269 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
270 case 'n':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
271 a++;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
272 g = 0;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
273 if (*a)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
274 schema_prefix = a;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
275 else if (i < argc && argv[++i])
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
276 schema_prefix = argv[i];
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
277 else
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
278 fprintf(stderr, "wsdl2h: Option -n requires a prefix name argument\n");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
279 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
280 case 'N':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
281 a++;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
282 g = 0;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
283 if (*a)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
284 service_prefix = a;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
285 else if (i < argc && argv[++i])
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
286 service_prefix = argv[i];
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
287 else
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
288 fprintf(stderr, "wsdl2h: Option -N requires a prefix name argument\n");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
289 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
290 case 'o':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
291 a++;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
292 g = 0;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
293 if (*a)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
294 outfile = a;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
295 else if (i < argc && argv[++i])
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
296 outfile = argv[i];
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
297 else
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
298 fprintf(stderr, "wsdl2h: Option -o requires an output file argument\n");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
299 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
300 case 'p':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
301 pflag = 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
302 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
303 case 'P':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
304 Pflag = 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
305 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
306 case 'q':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
307 a++;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
308 g = 0;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
309 if (*a)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
310 cppnamespace = a;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
311 else if (i < argc && argv[++i])
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
312 cppnamespace = argv[i];
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
313 else
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
314 fprintf(stderr, "wsdl2h: Option -q requires a C++ namespace name argument\n");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
315 if (cflag)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
316 fprintf(stderr, "wsdl2h: Options -c and -q clash\n");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
317 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
318 case 'r':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
319 a++;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
320 g = 0;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
321 if (*a)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
322 proxy_host = a;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
323 else if (i < argc && argv[++i])
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
324 proxy_host = argv[i];
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
325 else
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
326 fprintf(stderr, "wsdl2h: Option -r requires proxy host:port:userid:passwd or :userid:passwd authentication argument\n");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
327 if (proxy_host)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
328 { char *s = (char*)emalloc(strlen(proxy_host + 1));
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
329 strcpy(s, proxy_host);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
330 proxy_host = s;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
331 s = strchr(proxy_host, ':');
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
332 if (s)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
333 { *s = '\0';
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
334 if (*proxy_host)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
335 { proxy_port = soap_strtol(s + 1, &s, 10);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
336 if (s && *s == ':')
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
337 { *s = '\0';
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
338 proxy_userid = s + 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
339 s = strchr(proxy_userid, ':');
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
340 if (s && *s == ':')
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
341 { *s = '\0';
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
342 proxy_passwd = s + 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
343 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
344 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
345 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
346 else
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
347 { s = proxy_host;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
348 proxy_host = NULL;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
349 auth_userid = s + 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
350 s = strchr(auth_userid, ':');
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
351 if (s && *s == ':')
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
352 { *s = '\0';
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
353 auth_passwd = s + 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
354 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
355 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
356 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
357 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
358 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
359 case 'R':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
360 Rflag = 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
361 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
362 case 's':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
363 sflag = 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
364 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
365 case 't':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
366 a++;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
367 g = 0;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
368 if (*a)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
369 mapfile = a;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
370 else if (i < argc && argv[++i])
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
371 mapfile = argv[i];
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
372 else
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
373 fprintf(stderr, "wsdl2h: Option -t requires a type map file argument\n");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
374 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
375 case 'u':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
376 uflag = 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
377 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
378 case 'v':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
379 vflag = 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
380 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
381 case 'w':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
382 wflag = 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
383 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
384 case 'W':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
385 Wflag = 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
386 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
387 case 'x':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
388 xflag = 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
389 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
390 case 'y':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
391 yflag = 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
392 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
393 case 'z':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
394 a++;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
395 g = 0;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
396 if (*a)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
397 zflag = soap_strtol(a, NULL, 10);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
398 else if (i < argc && argv[++i])
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
399 zflag = soap_strtol(argv[i], NULL, 10);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
400 else
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
401 zflag = 1;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
402 break;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
403 case '?':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
404 case 'h':
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
405 fprintf(stderr, "Usage: wsdl2h [-a] [-b] [-c] [-d] [-e] [-f] [-g] [-h] [-I path] [-i] [-j] [-k] [-l] [-m] [-N name] [-n name] [-P|-p] [-q name] [-R] [-r proxyhost[:port[:uid:pwd]]] [-r:userid:passwd] [-s] [-t typemapfile] [-u] [-v] [-w] [-W] [-x] [-y] [-z#] [-_] [-o outfile.h] infile.wsdl infile.xsd http://www... ...\n\n");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
406 fprintf(stderr, "\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
407 -a generate indexed struct names for local elements with anonymous types\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
408 -b bi-directional operations (duplex ops) added to serve one-way responses\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
409 -c generate C source code\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
410 -d use DOM to populate xs:any, xs:anyType, and xs:anyAttribute\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
411 -e don't qualify enum names\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
412 -f generate flat C++ class hierarchy\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
413 -g generate global top-level element declarations\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
414 -h display help info\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
415 -Ipath use path to find files\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
416 -i don't import (advanced option)\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
417 -j don't generate SOAP_ENV__Header and SOAP_ENV__Detail definitions\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
418 -k don't generate SOAP_ENV__Header mustUnderstand qualifiers\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
419 -l display license information\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
420 -m use xsd.h module to import primitive types\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
421 -Nname use name for service prefixes to produce a service for each binding\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
422 -nname use name as the base namespace prefix instead of 'ns'\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
423 -ofile output to file\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
424 -P don't create polymorphic types inherited from xsd__anyType\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
425 -p create polymorphic types inherited from base xsd__anyType\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
426 -qname use name for the C++ namespace of all declarations\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
427 -R generate REST operations for REST bindings in the WSDL\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
428 -rhost[:port[:uid:pwd]]\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
429 connect via proxy host, port, and proxy credentials\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
430 -r:uid:pwd\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
431 connect with authentication credentials (digest auth requires SSL)\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
432 -s don't generate STL code (no std::string and no std::vector)\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
433 -tfile use type map file instead of the default file typemap.dat\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
434 -u don't generate unions\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
435 -v verbose output\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
436 -W suppress warnings\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
437 -w always wrap response parameters in a response struct (<=1.1.4 behavior)\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
438 -x don't generate _XML any/anyAttribute extensibility elements\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
439 -y generate typedef synonyms for structs and enums\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
440 -z1 compatibility with 2.7.6e: generate pointer-based arrays\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
441 -z2 compatibility with 2.7.7 to 2.7.15: qualify element/attribute references\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
442 -z3 compatibility with 2.7.16 to 2.8.7: qualify element/attribute references\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
443 -z4 compatibility up to 2.8.11: don't generate union structs in std::vector\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
444 -z5 compatibility up to 2.8.15\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
445 -_ don't generate _USCORE (replace with UNICODE _x005f)\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
446 infile.wsdl infile.xsd http://www... list of input sources (if none: use stdin)\n\
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
447 \n");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
448 exit(0);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
449 default:
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
450 fprintf(stderr, "wsdl2h: Unknown option %s\n", a);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
451 exit(1);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
452 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
453 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
454 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
455 else
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
456 { infile[infiles++] = argv[i];
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
457 if (infiles >= MAXINFILES)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
458 { fprintf(stderr, "wsdl2h: too many files\n");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
459 exit(1);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
460 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
461 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
462 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
463 if (infiles)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
464 { if (!outfile)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
465 { if (strncmp(infile[0], "http://", 7) && strncmp(infile[0], "https://", 8))
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
466 { const char *s = strrchr(infile[0], '.');
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
467 if (s && (!soap_tag_cmp(s, ".wsdl") || !soap_tag_cmp(s, ".gwsdl") || !soap_tag_cmp(s, ".xsd")))
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
468 { outfile = estrdup(infile[0]);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
469 outfile[s - infile[0] + 1] = 'h';
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
470 outfile[s - infile[0] + 2] = '\0';
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
471 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
472 else
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
473 { outfile = (char*)emalloc(strlen(infile[0]) + 3);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
474 strcpy(outfile, infile[0]);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
475 strcat(outfile, ".h");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
476 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
477 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
478 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
479 if (outfile)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
480 { stream = fopen(outfile, "w");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
481 if (!stream)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
482 { fprintf(stderr, "Cannot write to %s\n", outfile);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
483 exit(1);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
484 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
485 if (cppnamespace)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
486 fprintf(stream, "namespace %s {\n", cppnamespace);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
487 fprintf(stderr, "Saving %s\n\n", outfile);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
488 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
489 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
490 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
491
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
492 ////////////////////////////////////////////////////////////////////////////////
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
493 //
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
494 // Namespaces
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
495 //
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
496 ////////////////////////////////////////////////////////////////////////////////
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
497
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
498 struct Namespace namespaces[] =
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
499 {
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
500 {"SOAP-ENV", "http://schemas.xmlsoap.org/soap/envelope/", "http://www.w3.org/*/soap-envelope"},
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
501 {"SOAP-ENC", "http://schemas.xmlsoap.org/soap/encoding/", "http://www.w3.org/*/soap-encoding"},
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
502 {"xsi", "http://www.w3.org/2001/XMLSchema-instance"},
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
503 {"xsd", "-"}, // http://www.w3.org/2001/XMLSchema"}, // don't use this, it might conflict with xs
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
504 {"xml", "http://www.w3.org/XML/1998/namespace"},
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
505 {"xs", "http://www.w3.org/2001/XMLSchema", "http://www.w3.org/*/XMLSchema" },
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
506 {"http", "http://schemas.xmlsoap.org/wsdl/http/"},
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
507 {"soap", "http://schemas.xmlsoap.org/wsdl/soap/", "http://schemas.xmlsoap.org/wsdl/soap*/"},
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
508 {"mime", "http://schemas.xmlsoap.org/wsdl/mime/"},
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
509 {"xmime", "http://www.w3.org/2005/05/xmlmime"},
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
510 {"dime", "http://schemas.xmlsoap.org/ws/2002/04/dime/wsdl/", "http://schemas.xmlsoap.org/ws/*/dime/wsdl/"},
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
511 {"sp", "http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702", "http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"},
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
512 {"wsdl", "http://schemas.xmlsoap.org/wsdl/", "http://www.w3.org/ns/wsdl"},
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
513 {"wsdli", "http://www.w3.org/ns/wsdl-instance"},
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
514 {"wsdlx", "http://www.w3.org/ns/wsdl-extensions"},
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
515 {"wsoap", "http://www.w3.org/ns/wsdl/soap"},
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
516 {"whttp", "http://www.w3.org/ns/wsdl/http"},
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
517 {"wrpc", "http://www.w3.org/ns/wsdl/rpc"},
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
518 {"wsa_", "http://www.w3.org/2005/08/addressing"},
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
519 {"wsaw", "http://www.w3.org/2006/05/addressing/wsdl"},
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
520 {"wsam", "http://www.w3.org/2007/05/addressing/metadata"},
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
521 {"wsrmp", "http://schemas.xmlsoap.org/ws/2005/02/rm/policy", "http://docs.oasis-open.org/ws-rx/wsrmp/*"},
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
522 {"wsp", "http://www.w3.org/ns/ws-policy", "http://schemas.xmlsoap.org/ws/2004/09/policy"},
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
523 {"wst", "http://docs.oasis-open.org/ws-sx/ws-trust/200512"},
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
524 {"wsu_", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"},
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
525 {"gwsdl", "http://www.gridforum.org/namespaces/2003/03/gridWSDLExtensions"},
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
526 {NULL, NULL}
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
527 };