-
Notifications
You must be signed in to change notification settings - Fork 0
/
stdsoap2.h
2709 lines (2440 loc) · 91.9 KB
/
stdsoap2.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
stdsoap2.h 2.8.13 (update)
gSOAP runtime engine
gSOAP XML Web services tools
Copyright (C) 2000-2013, Robert van Engelen, Genivia Inc., All Rights Reserved.
This part of the software is released under ONE of the following licenses:
GPL, or the gSOAP public license, or Genivia's license for commercial use.
--------------------------------------------------------------------------------
Contributors:
Wind River Systems, Inc., for the following additions
- vxWorks compatible
--------------------------------------------------------------------------------
gSOAP public license.
The contents of this file are subject to the gSOAP Public License Version 1.3
(the "License"); you may not use this file except in compliance with the
License. You may obtain a copy of the License at
http://www.cs.fsu.edu/~engelen/soaplicense.html
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the License.
The Initial Developer of the Original Code is Robert A. van Engelen.
Copyright (C) 2000-2013, Robert van Engelen, Genivia Inc., All Rights Reserved.
--------------------------------------------------------------------------------
GPL license.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place, Suite 330, Boston, MA 02111-1307 USA
Author contact information:
This program is released under the GPL with the additional exemption that
compiling, linking, and/or using OpenSSL is allowed.
--------------------------------------------------------------------------------
A commercial use license is available from Genivia, Inc., [email protected]
--------------------------------------------------------------------------------
*/
#define GSOAP_VERSION 20813
#ifdef WITH_SOAPDEFS_H
# include "soapdefs.h" /* include user-defined stuff */
#endif
#ifndef _THREAD_SAFE
# define _THREAD_SAFE
#endif
#ifndef OPENSERVER
# ifndef _REENTRANT
# define _REENTRANT
# endif
#endif
#ifndef SOAP_FMAC1 /* stdsoap2.h declaration macro */
# define SOAP_FMAC1
#endif
#ifndef SOAP_FMAC2 /* stdsoap2.h declaration macro */
# define SOAP_FMAC2
#endif
#ifndef SOAP_FMAC3 /* (de)serializer declaration macro */
# define SOAP_FMAC3
#endif
#ifndef SOAP_FMAC3S /* string converter for (de)serializer declaration macro */
# define SOAP_FMAC3S SOAP_FMAC3
#endif
#ifndef SOAP_FMAC4 /* (de)serializer declaration macro */
# define SOAP_FMAC4
#endif
#ifndef SOAP_FMAC4S /* string converter for (de)serializer declaration macro */
# define SOAP_FMAC4S SOAP_FMAC4
#endif
#ifndef SOAP_FMAC5 /* stub/skeleton declaration macro */
# define SOAP_FMAC5
#endif
#ifndef SOAP_FMAC6 /* stub/skeleton declaration macro */
# define SOAP_FMAC6
#endif
#ifndef SOAP_CMAC /* class declaration macro */
# define SOAP_CMAC
#endif
#ifndef SOAP_NMAC /* namespace table declaration macro */
# define SOAP_NMAC
#endif
#ifndef SOAP_SOURCE_STAMP
# define SOAP_SOURCE_STAMP(str)
#endif
/* gSOAP 2.7.4 and higher: fast look-aside buffering is stable */
#ifndef WITH_FAST
# define WITH_FAST
#endif
#ifndef STDSOAP_H
#define STDSOAP_H
#if defined(__vxworks) || defined(__VXWORKS__)
# ifndef VXWORKS
# define VXWORKS
# endif
#endif
#ifdef _WIN32
# ifndef WIN32
# define WIN32
# endif
#endif
/* for legacy purposes we use WIN32 macro even though 64 bit is supported */
#ifdef _WIN64
# ifndef WIN32
# define WIN32
# endif
#endif
#ifdef _WIN32_WCE
# ifndef UNDER_CE
# define UNDER_CE _WIN32_WCE
# endif
#endif
#ifdef UNDER_CE
# ifndef WIN32
# define WIN32
# endif
#endif
#ifdef __BORLANDC__
# ifdef __WIN32__
# ifndef WIN32
# define WIN32
# endif
# endif
#endif
#ifdef __CYGWIN__
# ifndef CYGWIN
# define CYGWIN
# endif
#endif
#ifdef __SYMBIAN32__
# define SYMBIAN
# undef WIN32
#endif
#if defined(__palmos__) || defined(PALM_GCC) || defined(__PALMOS_TRAPS__)
# ifndef PALM
# define PALM
# endif
#endif
#if defined(__hpux)
# ifndef HP_UX
# define HP_UX
# endif
#endif
#if defined(__digital__) && defined(__unix__)
# ifndef TRU64
# define TRU64
# endif
#endif
#ifdef __MVS__
# ifndef OS390
# define OS390
# endif
#endif
#ifdef HAVE_CONFIG_H
# include "config.h"
# if defined(WITH_OPENSSL)
# ifndef HAVE_OPENSSL_SSL_H
# undef WITH_OPENSSL
# endif
# endif
# if defined(WITH_GNUTLS)
# ifndef HAVE_GNUTLS_GNUTLS_H
# undef WITH_GNUTLS
# endif
# endif
# if defined(WITH_ZLIB) || defined(WITH_GZIP)
# ifndef HAVE_ZLIB_H
# undef WITH_ZLIB
# undef WITH_GZIP
# endif
# endif
#else
# if defined(UNDER_CE)
# define WITH_LEAN
# define HAVE_SSCANF
# elif defined(WIN32)
# define HAVE_SNPRINTF
# define HAVE_STRRCHR
# define HAVE_STRTOD
# define HAVE_SSCANF
# define HAVE_STRTOD_L
# define HAVE_SPRINTF_L
# define HAVE_STRTOL
# define HAVE_STRTOUL
# if _MSC_VER >= 1300
# define HAVE_STRTOLL // use _strtoi64
# define HAVE_STRTOULL // use _strtoui64
# endif
# define HAVE_SYS_TIMEB_H
# define HAVE_FTIME
# define HAVE_GMTIME
# define HAVE_WCTOMB
# define HAVE_MBTOWC
# define SOAP_LONG_FORMAT "%I64d"
# define SOAP_ULONG_FORMAT "%I64u"
# elif defined(CYGWIN)
# define HAVE_POLL
# define HAVE_SNPRINTF
# define HAVE_STRRCHR
# define HAVE_STRTOD
# define HAVE_SSCANF
# define HAVE_STRTOL
# define HAVE_STRTOUL
# define HAVE_SYS_TIMEB_H
# define HAVE_FTIME
# define HAVE_RAND_R
# define HAVE_GMTIME_R
# define HAVE_LOCALTIME_R
# define HAVE_STRERROR_R
# define HAVE_WCTOMB
# define HAVE_MBTOWC
# elif defined(__APPLE__)
# define HAVE_POLL
# define HAVE_SNPRINTF
# define HAVE_STRRCHR
# define HAVE_STRTOD
# define HAVE_SSCANF
# define HAVE_STRTOD_L
# define HAVE_SSCANF_L
# define HAVE_SPRINTF_L
# define HAVE_STRTOL
# define HAVE_STRTOUL
# define HAVE_RAND_R
# define HAVE_GMTIME_R
# define HAVE_LOCALTIME_R
# define HAVE_STRERROR_R
# define HAVE_TIMEGM
# define HAVE_WCTOMB
# define HAVE_MBTOWC
# elif defined(_AIX43)
# define HAVE_SNPRINTF
# define HAVE_STRRCHR
# define HAVE_STRTOD
# define HAVE_SSCANF
# define HAVE_STRTOL
# define HAVE_STRTOUL
# define HAVE_SYS_TIMEB_H
# define HAVE_FTIME
# define HAVE_RAND_R
# define HAVE_GMTIME_R
# define HAVE_LOCALTIME_R
# define HAVE_WCTOMB
# define HAVE_MBTOWC
# elif defined(_AIX41)
# define HAVE_SNPRINTF
# define HAVE_STRRCHR
# define HAVE_STRTOD
# define HAVE_SSCANF
# define HAVE_STRTOL
# define HAVE_STRTOUL
# define HAVE_SYS_TIMEB_H
# define HAVE_WCTOMB
# define HAVE_MBTOWC
# elif defined(HP_UX)
# define HAVE_SNPRINTF
# define HAVE_STRRCHR
# define HAVE_STRTOD
# define HAVE_SSCANF
# define HAVE_STRTOL
# define HAVE_STRTOUL
# define HAVE_SYS_TIMEB_H
# define HAVE_FTIME
# define HAVE_RAND_R
# define HAVE_GMTIME_R
# define HAVE_LOCALTIME_R
# define HAVE_WCTOMB
# define HAVE_MBTOWC
# define HAVE_ISNAN
# elif defined(FREEBSD) || defined(__FreeBSD__) || defined(OPENBSD)
# define HAVE_POLL
# define HAVE_SNPRINTF
# define HAVE_STRRCHR
# define HAVE_STRTOD
# define HAVE_SSCANF
# define HAVE_STRTOD_L
# define HAVE_SSCANF_L
# define HAVE_SPRINTF_L
# define HAVE_STRTOL
# define HAVE_STRTOUL
# define HAVE_STRTOLL
# define HAVE_STRTOULL
# define HAVE_GETTIMEOFDAY
# define HAVE_RAND_R
# define HAVE_GMTIME_R
# define HAVE_LOCALTIME_R
# define HAVE_STRERROR_R
# define HAVE_WCTOMB
# define HAVE_MBTOWC
# define SOAP_LONG_FORMAT "%qd"
# define SOAP_ULONG_FORMAT "%qu"
# define HAVE_ISNAN
# define HAVE_ISINF
# elif defined(__VMS)
# include <ioctl.h>
# define HAVE_SNPRINTF
# define HAVE_STRRCHR
# define HAVE_STRTOD
# define HAVE_SSCANF
# define HAVE_STRTOL
# define HAVE_STRTOUL
# define HAVE_SYS_TIMEB_H
# define HAVE_FTIME
# define HAVE_RAND_R
# define HAVE_GMTIME_R
# define HAVE_LOCALTIME_R
# define HAVE_WCTOMB
# define HAVE_MBTOWC
# elif defined(__GLIBC__) || defined(__GNU__)
# define HAVE_POLL
# define HAVE_SNPRINTF
# define HAVE_STRRCHR
# define HAVE_STRTOD
# define HAVE_SSCANF
# define HAVE_STRTOD_L
# define HAVE_SSCANF_L
# define HAVE_SPRINTF_L
# define HAVE_STRTOL
# define HAVE_STRTOUL
# define HAVE_STRTOLL
# define HAVE_STRTOULL
# define HAVE_SYS_TIMEB_H
# define HAVE_FTIME
# define HAVE_RAND_R
# define HAVE_GMTIME_R
# define HAVE_LOCALTIME_R
# define HAVE_STRERROR_R
# define HAVE_TIMEGM
# define HAVE_WCTOMB
# define HAVE_MBTOWC
# define HAVE_ISNAN
# define HAVE_ISINF
# elif defined(TRU64)
# define HAVE_SNPRINTF
# define HAVE_STRRCHR
# define HAVE_STRTOD
# define HAVE_SSCANF
# define HAVE_STRTOL
# define HAVE_STRTOUL
# define HAVE_GETTIMEOFDAY
# define HAVE_SYS_TIMEB_H
# define HAVE_RAND_R
# define HAVE_GMTIME_R
# define HAVE_LOCALTIME_R
# define __USE_STD_IOSTREAM
# define HAVE_WCTOMB
# define HAVE_MBTOWC
# define SOAP_LONG_FORMAT "%ld"
# define SOAP_ULONG_FORMAT "%lu"
# elif defined(MAC_CARBON)
# define WITH_NOIO
# define HAVE_SNPRINTF
# define HAVE_STRRCHR
# define HAVE_STRTOD
# define HAVE_SSCANF
# define HAVE_STRTOD_L
# define HAVE_SSCANF_L
# define HAVE_SPRINTF_L
# define HAVE_STRTOL
# define HAVE_STRTOUL
# define HAVE_FTIME
# define HAVE_RAND_R
# define HAVE_GETHOSTBYNAME_R
# define HAVE_GMTIME_R
# define HAVE_LOCALTIME_R
# define HAVE_STRERROR_R
# define HAVE_WCTOMB
# define HAVE_MBTOWC
# elif defined(PALM)
# define WITH_LEAN
# define HAVE_STRTOD /* strtod() is defined in palmFunctions.h */
# include <stdlib.h> /* Needs to be included before unix headers */
# include <sys_types.h>
# define IGNORE_STDIO_STUBS
# include <StdIOPalm.h>
# define O_NONBLOCK FNONBIO
# include <sys_socket.h>
# include "palmFunctions.h"
# elif defined(SYMBIAN)
# define WITH_LEAN
# define WITH_NONAMESPACES
# define HAVE_STRTOD /* use STRTOD since sscanf doesn't seem to work */
# include <e32def.h>
# include <sys/ioctl.h>
# elif defined(VXWORKS)
# ifdef _WRS_KERNEL
# define _POSIX_THREADS 1
# endif
# define HAVE_STRRCHR
# define HAVE_STRTOD
# define HAVE_SSCANF
# define HAVE_STRTOL
# define HAVE_STRTOUL
# define HAVE_GMTIME
# define HAVE_LOCALTIME
# define HAVE_MKTIME
# elif defined(OS390)
# define HAVE_SNPRINTF
# define HAVE_STRRCHR
# define HAVE_STRTOD
# define HAVE_SSCANF
# define HAVE_STRTOL
# define HAVE_STRTOUL
# define HAVE_SYS_TIMEB_H
# define HAVE_FTIME
# define HAVE_RAND_R
# define HAVE_GMTIME_R
# define HAVE_LOCALTIME_R
# define HAVE_WCTOMB
# define HAVE_MBTOWC
# elif defined(AS400)
# define HAVE_SNPRINTF
# define HAVE_STRRCHR
# define HAVE_STRTOD
# define HAVE_SSCANF
# define HAVE_STRTOL
# define HAVE_STRTOUL
# define HAVE_SYS_TIMEB_H
# define HAVE_FTIME
# define HAVE_RAND_R
# define HAVE_GMTIME_R
# define HAVE_LOCALTIME_R
# define HAVE_WCTOMB
# define HAVE_MBTOWC
# elif defined(__QNX__) || defined(QNX)
/* QNX does not have a working version of strtof */
# undef HAVE_STRTOF
# define HAVE_POLL
# define HAVE_SNPRINTF
# define HAVE_STRRCHR
# define HAVE_STRTOD
# define HAVE_SSCANF
# define HAVE_STRTOL
# define HAVE_STRTOUL
# define HAVE_SYS_TIMEB_H
# define HAVE_FTIME
# define HAVE_RAND_R
# define HAVE_GETHOSTBYNAME_R
# define HAVE_GMTIME_R
# define HAVE_LOCALTIME_R
# define HAVE_STRERROR_R
# define HAVE_WCTOMB
# define HAVE_MBTOWC
# define LONG64 long
# define ULONG64 unsigned LONG64
# define SOAP_LONG_FORMAT "%ld"
# define SOAP_ULONG_FORMAT "%lu"
# elif defined(SUN_OS)
# define HAVE_SNPRINTF
# define HAVE_STRRCHR
# define HAVE_STRTOD
# define HAVE_SSCANF
# define HAVE_STRTOL
# define HAVE_STRTOUL
# define HAVE_SYS_TIMEB_H
# define HAVE_FTIME
# define HAVE_RAND_R
# define HAVE_GETHOSTBYNAME_R
# define HAVE_GMTIME_R
# define HAVE_LOCALTIME_R
# else
/* Default assumptions for supported functions */
# define HAVE_SNPRINTF
# define HAVE_STRRCHR
# define HAVE_STRTOD
# define HAVE_SSCANF
# define HAVE_STRTOL
# define HAVE_STRTOUL
# define HAVE_SYS_TIMEB_H
# define HAVE_FTIME
# define HAVE_RAND_R
# define HAVE_GETHOSTBYNAME_R
# define HAVE_GMTIME_R
# define HAVE_LOCALTIME_R
# define HAVE_STRERROR_R
# ifdef MB_LEN_MAX
# define HAVE_WCTOMB
# define HAVE_MBTOWC
# endif
# endif
#endif
/* gSOAP 2.7.15 and higher: always retain CDATA in literal XML, unless WITH_LEAN or WITH_NOCDATA */
#ifndef WITH_LEAN
# ifndef WITH_NOCDATA
# ifndef WITH_CDATA
# define WITH_CDATA
# endif
# endif
#endif
#ifdef WITH_LEANER
# ifndef WITH_LEAN
# define WITH_LEAN
# endif
#endif
#ifdef WITH_LEAN
# ifdef WITH_COOKIES
# error "Cannot build WITH_LEAN code WITH_COOKIES enabled"
# endif
#endif
/* native Win, HP-UX, and AIX compilers don't like empty structs */
#if defined(WIN32) || defined(HP_UX) || defined(_AIX41) || defined(_AIX43) || defined(VXWORKS)
# define WITH_NOEMPTYSTRUCT
#endif
#ifdef WITH_PURE_VIRTUAL
# define SOAP_PURE_VIRTUAL = 0
#else
# define SOAP_PURE_VIRTUAL
#endif
#ifdef HP_UX
# undef HAVE_STRTOLL
# undef HAVE_STRTOULL
#endif
/* older OpenVMS TCP/IP stacks cannot handle 65536 bytes */
#ifdef __VMS
# ifndef SOAP_BUFLEN
# define SOAP_BUFLEN (65535)
# endif
#endif
/* if we have xlocale.h we use it to avoid decimal point conversion issues */
#ifdef WITH_C_LOCALE
# ifdef WIN32
# include <locale.h>
# else
# include <xlocale.h>
# endif
#else
# undef HAVE_STRTOF_L
# undef HAVE_STRTOD_L
# undef HAVE_SSCANF_L
# undef HAVE_SPRINTF_L
#endif
#ifdef TANDEM_NONSTOP
# define SOAP_BUFLEN (32767)
/*# define WITH_NOSTDLIB */ /* uncommment to remove stdlib dependences */
# define WITH_NOIO /* no IO dependences, e.g. remove TCP/IP */
# define int32_t int
# define int64_t long long
# define LONG64 long long
# define ULONG64 long long
# define DBL_PINFTY (1.1579208923716189e77)
# define WITH_NOEMPTYSTRUCT
# undef HAVE_WCTOMB
# undef HAVE_MBTOWC
# undef HAVE_GMTIME_R
# undef HAVE_LOCALTIME_R
# undef HAVE_SNPRINTF
# define SOAP_BUFLEN (32767)
# define SOAP_SOCKET short
#pragma nolist
# include <sys\param.h>
# include <sys\socket.h>
# include <netinet\in.h>
# include <netdb.h>
# include <stdio.h>
# include <fcntl.h>
# include <string.h>
# include <stdlib.h>
# include <memory.h>
# include <errno.h>
# include <cextdecs.h(TIME,FILE_CLOSE_,AWAITIOX,DELAY,FILEINFO,FILE_GETINFO_)>
# define INET_ERROR 4294967295
#pragma list
#endif
#ifndef WITH_NOSTDLIB
# include <stdlib.h>
# ifndef PALM
# include <stdio.h>
# include <string.h>
# endif
# include <ctype.h>
# include <limits.h>
#endif
#ifdef WITH_NTLM
# include <ntlm.h>
#endif
#ifdef HAVE_POLL
# include <poll.h>
#endif
#if defined(__cplusplus) && !defined(WITH_LEAN) && !defined(WITH_COMPAT)
# include <string>
# include <iostream>
#endif
#ifdef WITH_NOHTTP
# ifndef WITH_NOIO
# define WITH_NOIO
# undef WITH_COOKIES
# endif
#endif
/* Suggestion when SOAP_FD_EXCEEDED error occurs:
Some systems allow increasing FD_SETSIZE before including sys/types.h:
#define FD_SETSIZE (2048)
*/
#ifndef UNDER_CE
# ifndef PALM
# ifndef WITH_NOIO
# include <errno.h>
# include <sys/types.h>
# endif
# ifndef WITH_LEAN
# ifdef HAVE_SYS_TIMEB_H
# include <sys/timeb.h> /* for ftime() */
# endif
# include <time.h>
# endif
# endif
#endif
#ifdef OPENSERVER
# include <sys/socket.h>
# include <sys/stream.h>
# include <sys/protosw.h>
extern int h_errno;
#endif
#ifndef WITH_NOIO
# ifndef WIN32
# ifndef PALM
# include <sys/socket.h>
# ifdef VXWORKS
# include <sockLib.h>
# include <selectLib.h>
# ifndef _WRS_KERNEL
# include <strings.h>
# endif
# else
# ifndef SYMBIAN
# include <strings.h>
# endif
# endif
# ifdef SUN_OS
# include <sys/stream.h> /* SUN */
# include <sys/socketvar.h> /* SUN < 2.8 (?) */
# endif
# ifdef VXWORKS
# ifdef _WRS_KERNEL
# include <sys/times.h>
# endif
# else
# include <sys/time.h>
# endif
# include <netinet/in.h>
# ifdef OS390
# include <netinet/tcp_var.h>
# else
# include <netinet/tcp.h> /* TCP_NODELAY */
# endif
# include <arpa/inet.h>
# endif
# endif
#endif
#ifdef WIN32
# define SOAP_WINSOCKINT int
#else
# define SOAP_WINSOCKINT size_t
#endif
#if defined(WITH_IPV6_V6ONLY) || defined(WITH_NO_IPV6_V6ONLY)
# ifndef WITH_IPV6
# define WITH_IPV6
# endif
#endif
#ifdef WIN32
# ifndef UNDER_CE
# include <io.h>
# include <fcntl.h>
# endif
// When you get macro redefinition errors when compiling the code below:
// a) try arrange your includes so <windows.h> is included after "stdsoap2.h"
// b) or define _WINSOCKAPI_ first:
// #define _WINSOCKAPI_ // stops windows.h including winsock.h
// #include <windows.h>
// #include "stdsoap2.h"
// c) or compile with the -DWIN32_LEAN_AND_MEAN switch
# include <winsock2.h> // Visual Studio 2005 users: install Platform SDK (R2)
# include <ws2tcpip.h>
// # define _WSPIAPI_COUNTOF // DEV NOTE: enble to fix problems with VC6
// # include <wspiapi.h>
# include <ws2spi.h> // DEV NOTE: replaces older wspiapi.h above
# ifdef WITH_IPV6
# define SOAP_GAI_STRERROR gai_strerrorA
# endif
#else
# ifdef VXWORKS
# include <hostLib.h>
# include <ioctl.h>
# include <ioLib.h>
# endif
# ifndef WITH_NOIO
# ifndef PALM
# include <netdb.h>
# include <netinet/in.h>
# include <unistd.h>
# include <fcntl.h>
# ifdef _AIX41
# include <sys/select.h>
# endif
# endif
# endif
#endif
#ifdef WITH_FASTCGI
# include <fcgi_stdio.h>
#endif
#ifdef WITH_OPENSSL
# ifdef __VMS
# pragma names save
# pragma names uppercase
# endif
# undef WITH_GNUTLS
# define OPENSSL_NO_KRB5
# include <openssl/bio.h>
# include <openssl/err.h>
# include <openssl/rand.h>
# include <openssl/ssl.h>
# include <openssl/x509v3.h>
# ifndef ALLOW_OLD_VERSIONS
# if (OPENSSL_VERSION_NUMBER < 0x00905100L)
# error "Must use OpenSSL 0.9.6 or later"
# endif
# endif
# ifdef __VMS
# pragma names restore
# endif
#endif
#ifdef WITH_GNUTLS
# include <gnutls/gnutls.h>
# include <gnutls/x509.h>
# include <gcrypt.h>
# ifndef HAVE_PTHREAD_H
# ifdef _POSIX_THREADS
# define HAVE_PTHREAD_H /* make GNUTLS thread safe */
# endif
# endif
#endif
#ifdef WITH_GZIP
# ifndef WITH_ZLIB
# define WITH_ZLIB
# endif
#endif
#ifdef WITH_CASEINSENSITIVETAGS
# define SOAP_STRCMP soap_tag_cmp /* case insensitve XML element/attribute names */
#else
# define SOAP_STRCMP strcmp /* case sensitive XML element/attribute names */
#endif
#ifdef WITH_ZLIB
# include <zlib.h>
#endif
#ifndef WITH_NOSTDLIB
# ifndef PALM
# include <math.h> /* for isnan() */
# endif
#endif
/* #define DEBUG */ /* Uncomment to debug sending (in file SENT.log) receiving (in file RECV.log) and messages (in file TEST.log) */
#ifdef __cplusplus
extern "C" {
#endif
/* Portability: define SOAP_SOCKLEN_T */
#if defined(_AIX)
# if defined(_AIX43)
# define SOAP_SOCKLEN_T socklen_t
# else
# define SOAP_SOCKLEN_T int
# endif
#elif defined(SOCKLEN_T)
# define SOAP_SOCKLEN_T SOCKLEN_T
#elif defined(__socklen_t_defined) || defined(_SOCKLEN_T) || defined(CYGWIN) || defined(FREEBSD) || defined(__FreeBSD__) || defined(OPENBSD) || defined(__QNX__) || defined(QNX) || defined(OS390)
# define SOAP_SOCKLEN_T socklen_t
#elif defined(IRIX) || defined(WIN32) || defined(__APPLE__) || defined(SUN_OS) || defined(OPENSERVER) || defined(TRU64) || defined(VXWORKS) || defined(HP_UX)
# define SOAP_SOCKLEN_T int
#else
# define SOAP_SOCKLEN_T size_t
#endif
#ifndef SOAP_SOCKET
# ifdef WIN32
# define SOAP_SOCKET SOCKET
# define soap_closesocket(n) closesocket(n)
# else
# define SOAP_SOCKET int
# define soap_closesocket(n) close(n)
# endif
#endif
#define SOAP_INVALID_SOCKET ((SOAP_SOCKET)-1)
#define soap_valid_socket(n) ((n) != SOAP_INVALID_SOCKET)
#define SOAP_SHUT_WR 1
#define SOAP_SHUT_RDWR 2
#ifndef SOAP_GAI_STRERROR
# define SOAP_GAI_STRERROR gai_strerror
#endif
#ifndef FD_SETSIZE
# define FD_SETSIZE (1024)
#endif
#ifdef WITH_LEAN
# define SOAP_CHK_EOF SOAP_EOF
#else
# define SOAP_CHK_EOF (soap->error ? soap->error : SOAP_EOF)
#endif
#ifdef __cplusplus
# ifndef __STDC_FORMAT_MACROS
# define __STDC_FORMAT_MACROS
# endif
#endif
#if defined(SYMBIAN)
# define LONG64 long
# define ULONG64 unsigned LONG64
#elif !defined(WIN32) || defined(CYGWIN) || defined(__GLIBC__) || defined(__GNU__)
# ifndef LONG64
# if defined(HAVE_INTTYPES_H)
# include <stdint.h>
# include <inttypes.h>
# define LONG64 int64_t
# define ULONG64 uint64_t
# elif defined(HAVE_SYS_INTTYPES_H)
# include <sys/inttypes.h>
# define LONG64 int64_t
# define ULONG64 uint64_t
# elif defined(HAVE_STDINT_H)
# include <stdint.h>
# define LONG64 int64_t
# define ULONG64 uint64_t
# elif defined(__GLIBC__)
# include <bits/wordsize.h>
# if (__WORDSIZE == 64)
# define LONG64 int64_t
# define ULONG64 uint64_t
# ifndef SOAP_LONG_FORMAT
# define SOAP_LONG_FORMAT "%ld"
# endif
# ifndef SOAP_ULONG_FORMAT
# define SOAP_ULONG_FORMAT "%lu"
# endif
# else
# define LONG64 long long
# define ULONG64 unsigned LONG64
# endif
# else
# define LONG64 long long
# define ULONG64 unsigned LONG64
# endif
# endif
#elif defined(UNDER_CE)
# define LONG64 __int64
# define ULONG64 unsigned LONG64
#elif defined(__BORLANDC__)
# define LONG64 __int64
# define ULONG64 unsigned LONG64
#endif
#ifdef PRId64
# ifndef SOAP_LONG_FORMAT
# define SOAP_LONG_FORMAT "%" PRId64
# endif
#endif
#ifdef PRIu64
# ifndef SOAP_ULONG_FORMAT
# define SOAP_ULONG_FORMAT "%" PRIu64
# endif
#endif
#ifndef SOAP_LONG_FORMAT
# define SOAP_LONG_FORMAT "%lld" /* printf format for 64 bit ints */
#endif
#ifndef SOAP_ULONG_FORMAT
# define SOAP_ULONG_FORMAT "%llu" /* printf format for unsigned 64 bit ints */
#endif
#if defined(WIN32) && !defined(CYGWIN)
# define soap_int32 __int32
#elif defined(SYMBIAN)
# define soap_int32 long
#elif defined(PALM)
# define soap_int32 Int32
#elif defined(_AIX)
# if defined(_AIX43)
# define soap_int32 int32_t
# else
# define soap_int32 signed int
# endif
#else
# define soap_int32 int32_t
#endif
#ifdef WIN32
# define SOAP_ERANGE ERANGE
# define SOAP_EINTR WSAEINTR
# define SOAP_EAGAIN WSAEWOULDBLOCK
# define SOAP_EWOULDBLOCK WSAEWOULDBLOCK
# define SOAP_EINPROGRESS WSAEINPROGRESS
# define SOAP_EADDRINUSE WSAEADDRINUSE
#else
# define SOAP_ERANGE ERANGE
# define SOAP_EINTR EINTR
# define SOAP_EAGAIN EAGAIN
# define SOAP_EADDRINUSE EADDRINUSE
# ifdef SYMBIAN
# define SOAP_EWOULDBLOCK 9898
# define SOAP_EINPROGRESS 9899
# else
# define SOAP_EWOULDBLOCK EWOULDBLOCK
# define SOAP_EINPROGRESS EINPROGRESS
# endif
#endif
#ifdef WIN32
# ifdef UNDER_CE
# define soap_errno GetLastError()
# define soap_socket_errno(s) GetLastError()
# define soap_reset_errno SetLastError(0)
# else
# define soap_errno GetLastError()
# define soap_socket_errno(s) WSAGetLastError()
# define soap_reset_errno SetLastError(0)
# endif
#else
# ifndef WITH_NOIO
# define soap_errno errno
# define soap_socket_errno(s) errno
# define soap_reset_errno (errno = 0)
# else
# define soap_errno 0
# define soap_socket_errno(s) 0
# define soap_reset_errno
# endif