--- /tmp/gsoap-2.8.104-3mrarcrve/debian/gsoap-doc_2.8.104-3_all.deb +++ gsoap-doc_2.8.104-3_all.deb ├── file list │ @@ -1,3 +1,3 @@ │ -rw-r--r-- 0 0 0 4 2021-03-08 13:06:23.000000 debian-binary │ --rw-r--r-- 0 0 0 46976 2021-03-08 13:06:23.000000 control.tar.xz │ --rw-r--r-- 0 0 0 12546112 2021-03-08 13:06:23.000000 data.tar.xz │ +-rw-r--r-- 0 0 0 46984 2021-03-08 13:06:23.000000 control.tar.xz │ +-rw-r--r-- 0 0 0 12546008 2021-03-08 13:06:23.000000 data.tar.xz ├── control.tar.xz │ ├── control.tar │ │ ├── ./md5sums │ │ │ ├── ./md5sums │ │ │ │┄ Files differ ├── data.tar.xz │ ├── data.tar │ │ ├── file list │ │ │ @@ -355,15 +355,15 @@ │ │ │ -rw-r--r-- 0 root (0) root (0) 5162 2021-03-08 13:06:23.000000 ./usr/share/doc/gsoap-doc/guide/html/group__group__soap.js │ │ │ -rw-r--r-- 0 root (0) root (0) 133290 2021-03-08 13:06:23.000000 ./usr/share/doc/gsoap-doc/guide/html/group__group__ssl.html │ │ │ -rw-r--r-- 0 root (0) root (0) 2377 2021-03-08 13:06:23.000000 ./usr/share/doc/gsoap-doc/guide/html/group__group__ssl.js │ │ │ -rw-r--r-- 0 root (0) root (0) 74502 2021-03-08 13:06:23.000000 ./usr/share/doc/gsoap-doc/guide/html/group__group__threads.html │ │ │ -rw-r--r-- 0 root (0) root (0) 1922 2021-03-08 13:06:23.000000 ./usr/share/doc/gsoap-doc/guide/html/group__group__threads.js │ │ │ -rw-r--r-- 0 root (0) root (0) 126767 2021-03-08 13:06:23.000000 ./usr/share/doc/gsoap-doc/guide/html/group__group__with.html │ │ │ -rw-r--r-- 0 root (0) root (0) 3411 2021-03-08 13:06:23.000000 ./usr/share/doc/gsoap-doc/guide/html/group__group__with.js │ │ │ --rw-r--r-- 0 root (0) root (0) 1834624 2021-03-08 13:06:23.000000 ./usr/share/doc/gsoap-doc/guide/html/index.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 1834631 2021-03-08 13:06:23.000000 ./usr/share/doc/gsoap-doc/guide/html/index.html │ │ │ -rw-r--r-- 0 root (0) root (0) 2872 2021-03-08 13:06:23.000000 ./usr/share/doc/gsoap-doc/guide/html/index_8md.html │ │ │ -rw-r--r-- 0 root (0) root (0) 175457 2021-03-08 13:06:23.000000 ./usr/share/doc/gsoap-doc/guide/html/jquery.js │ │ │ -rw-r--r-- 0 root (0) root (0) 3222 2021-03-08 13:06:23.000000 ./usr/share/doc/gsoap-doc/guide/html/menu.js │ │ │ -rw-r--r-- 0 root (0) root (0) 5236 2021-03-08 13:06:23.000000 ./usr/share/doc/gsoap-doc/guide/html/menudata.js │ │ │ -rw-r--r-- 0 root (0) root (0) 10253 2021-03-08 13:06:23.000000 ./usr/share/doc/gsoap-doc/guide/html/modules.html │ │ │ -rw-r--r-- 0 root (0) root (0) 1709 2021-03-08 13:06:23.000000 ./usr/share/doc/gsoap-doc/guide/html/modules.js │ │ │ -rw-r--r-- 0 root (0) root (0) 153 2021-03-08 13:06:23.000000 ./usr/share/doc/gsoap-doc/guide/html/nav_f.png │ │ ├── ./usr/share/doc/gsoap-doc/guide/html/index.html │ │ │ @@ -56951,29 +56951,29 @@ │ │ │ 000de760: 6c69 7374 3c2f 7370 616e 3e20 3c73 7061 list id="1& │ │ │ 000de7b0: 7175 6f74 3b3c 2f73 7061 6e3e 3c73 7061 quot;p␋ │ │ │ -000de7e0: 3b8a 3c2f 7370 616e 3e3c 2f64 6976 3e0a ;.. │ │ │ +000de7d0: 6974 6572 616c 223e 2623 7832 3431 303b iteral">␐ │ │ │ +000de7e0: d05b 3c2f 7370 616e 3e3c 2f64 6976 3e0a .[. │ │ │ 000de7f0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
p& │ │ │ -000de820: 2378 3234 3042 3b8a 573a 563c 2f73 7061 #x240B;.W:V&# │ │ │ +000de820: 7832 3431 303b d05b 7c4d 563c 2f73 7061 x2410;.[|MV
.
p␋ │ │ │ -000de870: 8a57 3a56 3c2f 7370 616e 3e3c 2f64 6976 .W:V
␐. │ │ │ +000de870: 5b7c 4d56 3c2f 7370 616e 3e3c 2f64 6976 [|MV.
│ │ │ -000de8b0: 7026 2378 3234 3042 3b8a 573a 563c 2f73 p␋.W:V
.
< │ │ │ 000de900: 3b6e 6578 7420 6872 6566 3d26 7175 6f74 ;next href=" │ │ │ 000de910: 3b3c 2f73 7061 6e3e 2331 2671 756f 743b ;#1" │ │ │ 000de920: 2f26 6774 3b20 3c2f 6469 763e 0a3c 6469 />
. <q │ │ │ 000dfab0: 7265 663c 2f73 7061 6e3e 3d3c 7370 616e ref=.R.W
.
<r i │ │ │ -000dfb20: 643d 2671 756f 743b 3c2f 7370 616e 3e31 d="1 │ │ │ -000dfb30: 3c73 7061 6e20 636c 6173 733d 2273 7472 &quo │ │ │ -000dfb50: 743b 2078 7369 3a6e 696c 3d26 7175 6f74 t; xsi:nil=" │ │ │ -000dfb60: 3b3c 2f73 7061 6e3e 3c73 7061 6e20 636c ;tr │ │ │ -000dfb80: 7565 3c2f 7370 616e 3e26 7175 6f74 3b2f ue"/ │ │ │ -000dfb90: 2667 743b 3c2f 6469 763e 0a3c 6469 7620 >
.
< │ │ │ -000dfbb0: 3b2f 3c73 7061 6e20 636c 6173 733d 226b ;/X>
.< │ │ │ -000dfbe0: 2f64 6976 3e3c 212d 2d20 6672 6167 6d65 /div>

│ │ │ -000dfc00: 5468 6520 6465 7365 7269 616c 697a 6572 The deserializer │ │ │ -000dfc10: 2072 6563 6f6e 7374 7275 6374 7320 7468 reconstructs th │ │ │ -000dfc20: 6520 7374 7275 6374 203c 636f 6465 3e58 e struct X │ │ │ -000dfc30: 3c2f 636f 6465 3e20 6672 6f6d 2074 6869 from thi │ │ │ -000dfc40: 7320 666f 726d 206f 6620 584d 4c2c 2074 s form of XML, t │ │ │ -000dfc50: 6865 7265 6279 2070 7265 7365 7276 696e hereby preservin │ │ │ -000dfc60: 6720 7468 6520 696e 7465 6772 6974 7920 g the integrity │ │ │ -000dfc70: 6f66 2074 6865 2064 6174 6120 7374 7275 of the data stru │ │ │ -000dfc80: 6374 7572 6520 7365 7269 616c 697a 6564 cture serialized │ │ │ -000dfc90: 2e3c 2f70 3e0a 3c70 3e57 6865 6e20 7468 .

.

When th │ │ │ -000dfca0: 6520 6465 7365 7269 616c 697a 6572 2065 e deserializer e │ │ │ -000dfcb0: 6e63 6f75 6e74 6572 7320 616e 2058 4d4c ncounters an XML │ │ │ -000dfcc0: 2065 6c65 6d65 6e74 2074 6861 7420 6861 element that ha │ │ │ -000dfcd0: 7320 6120 3c65 6d3e 3c63 6f64 653e 7873 s a xs │ │ │ -000dfce0: 693a 6e69 6c3d 2274 7275 6522 3c2f 636f i:nil="true" attribu │ │ │ -000dfd00: 7465 2062 7574 2074 6865 2063 6f72 7265 te but the corre │ │ │ -000dfd10: 7370 6f6e 6469 6e67 2043 2f43 2b2b 2064 sponding C/C++ d │ │ │ -000dfd20: 6174 6120 6973 206e 6f74 2061 2070 6f69 ata is not a poi │ │ │ -000dfd30: 6e74 6572 206f 7220 7265 6665 7265 6e63 nter or referenc │ │ │ -000dfd40: 652c 2074 6865 2064 6573 6572 6961 6c69 e, the deseriali │ │ │ -000dfd50: 7a65 7220 7769 6c6c 2074 6572 6d69 6e61 zer will termina │ │ │ -000dfd60: 7465 2077 6974 6820 6120 3c63 6f64 653e te with a │ │ │ -000dfd70: 2353 4f41 505f 4e55 4c4c 3c2f 636f 6465 #SOAP_NULL fault when the │ │ │ -000dfd90: 203c 636f 6465 3e23 534f 4150 5f58 4d4c #SOAP_XML │ │ │ -000dfda0: 5f53 5452 4943 543c 2f63 6f64 653e 2066 _STRICT f │ │ │ -000dfdb0: 6c61 6720 6973 2073 6574 2e3c 2f70 3e0a lag is set.

. │ │ │ -000dfdc0: 3c70 3ef0 9f94 9d20 3c61 2068 7265 663d

.... Back to tabl │ │ │ -000dfde0: 6520 6f66 2063 6f6e 7465 6e74 733c 2f61 e of contents

.

.Void │ │ │ -000dfe20: 706f 696e 7465 7220 7365 7269 616c 697a pointer serializ │ │ │ -000dfe30: 6174 696f 6e3c 2f68 323e 0a3c 703e 566f ation

.

Vo │ │ │ -000dfe40: 6964 2070 6f69 6e74 6572 7320 283c 636f id pointers (void*) │ │ │ -000dfe60: 2063 616e 6e6f 7420 6265 2073 6572 6961 cannot be seria │ │ │ -000dfe70: 6c69 7a65 6420 696e 2058 4d4c 2062 6563 lized in XML bec │ │ │ -000dfe80: 6175 7365 2074 6865 2074 7970 6520 6f66 ause the type of │ │ │ -000dfe90: 2064 6174 6120 7265 6665 7272 6564 2074 data referred t │ │ │ -000dfea0: 6f20 6973 2075 6e74 7970 6564 2e20 546f o is untyped. To │ │ │ -000dfeb0: 2065 6e61 626c 6520 7468 6520 7365 7269 enable the seri │ │ │ -000dfec0: 616c 697a 6174 696f 6e20 6f66 2076 6f69 alization of voi │ │ │ -000dfed0: 6420 706f 696e 7465 7273 2074 6861 7420 d pointers that │ │ │ -000dfee0: 6172 6520 6d65 6d62 6572 7320 6f66 2073 are members of s │ │ │ -000dfef0: 7472 7563 7473 2061 6e64 2063 6c61 7373 tructs and class │ │ │ -000dff00: 6573 2c20 796f 7520 6361 6e20 696e 7365 es, you can inse │ │ │ -000dff10: 7274 2061 203c 636f 6465 3e69 6e74 205f rt a int _ │ │ │ -000dff20: 5f74 7970 653c 2f63 6f64 653e 206d 656d _type mem │ │ │ -000dff30: 6265 7220 7269 6768 7420 6265 666f 7265 ber right before │ │ │ -000dff40: 2074 6865 2076 6f69 6420 706f 696e 7465 the void pointe │ │ │ -000dff50: 7220 6d65 6d62 6572 2e20 5468 6520 3c63 r member. The int __type member con │ │ │ -000dff80: 7461 696e 7320 7275 6e20 7469 6d65 2069 tains run time i │ │ │ -000dff90: 6e66 6f72 6d61 7469 6f6e 206f 6e20 7468 nformation on th │ │ │ -000dffa0: 6520 7479 7065 206f 6620 7468 6520 6461 e type of the da │ │ │ -000dffb0: 7461 2070 6f69 6e74 6564 2074 6f20 6279 ta pointed to by │ │ │ -000dffc0: 203c 636f 6465 3e76 6f69 642a 3c2f 636f void* member in a │ │ │ -000dffe0: 7374 7275 6374 2f63 6c61 7373 2074 6f20 struct/class to │ │ │ -000dfff0: 656e 6162 6c65 2074 6865 2073 6572 6961 enable the seria │ │ │ -000e0000: 6c69 7a61 7469 6f6e 206f 6620 7468 6973 lization of this │ │ │ -000e0010: 2064 6174 612e 2054 6865 203c 636f 6465 data. The int __type member is set │ │ │ -000e0040: 2074 6f20 6120 3c63 6f64 653e 534f 4150 to a SOAP │ │ │ -000e0050: 5f54 5950 455f 543c 2f63 6f64 653e 2076 _TYPE_T v │ │ │ -000e0060: 616c 7565 2c20 7768 6572 6520 3c63 6f64 alue, where T is th │ │ │ -000e0080: 6520 6e61 6d65 206f 6620 6120 7479 7065 e name of a type │ │ │ -000e0090: 2e20 5468 6520 736f 6170 6370 7032 2074 . The soapcpp2 t │ │ │ -000e00a0: 6f6f 6c20 6765 6e65 7261 7465 7320 7468 ool generates th │ │ │ -000e00b0: 6520 3c63 6f64 653e 534f 4150 5f54 5950 e SOAP_TYP │ │ │ -000e00c0: 455f 543c 2f63 6f64 653e 2064 6566 696e E_T defin │ │ │ -000e00d0: 6974 696f 6e73 2069 6e20 3c65 6d3e 3c63 itions in soapH.h and uses │ │ │ -000e0100: 2074 6865 6d20 696e 7465 726e 616c 6c79 them internally │ │ │ -000e0110: 2074 6f20 756e 6971 7565 6c79 2069 6465 to uniquely ide │ │ │ -000e0120: 6e74 6966 7920 7468 6520 7479 7065 206f ntify the type o │ │ │ -000e0130: 6620 6561 6368 206f 626a 6563 742e 2054 f each object. T │ │ │ -000e0140: 6865 2074 7970 6520 6e61 6d69 6e67 2063 he type naming c │ │ │ -000e0150: 6f6e 7665 6e74 696f 6e73 206f 7574 6c69 onventions outli │ │ │ -000e0160: 6e65 6420 696e 2053 6563 7469 6f6e 203c ned in Section < │ │ │ -000e0170: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ -000e0180: 663d 2269 6e64 6578 2e68 746d 6c23 7365 f="index.html#se │ │ │ -000e0190: 7269 616c 697a 6522 3e53 6572 6961 6c69 rialize">Seriali │ │ │ -000e01a0: 7a69 6e67 2043 2f43 2b2b 2064 6174 6120 zing C/C++ data │ │ │ -000e01b0: 746f 2058 4d4c 3c2f 613e 2061 7265 2075 to XML are u │ │ │ -000e01c0: 7365 6420 746f 2064 6574 6572 6d69 6e65 sed to determine │ │ │ -000e01d0: 2074 6865 2074 7970 6520 6e61 6d65 2066 the type name f │ │ │ -000e01e0: 6f72 203c 636f 6465 3e54 3c2f 636f 6465 or T. Values serial │ │ │ -000e0200: 697a 6564 2069 6e20 584d 4c20 7769 7468 ized in XML with │ │ │ -000e0210: 2074 6869 7320 6170 7072 6f61 6368 2061 this approach a │ │ │ -000e0220: 6c77 6179 7320 6361 7272 7920 7468 6520 lways carry the │ │ │ -000e0230: 3c65 6d3e 3c63 6f64 653e 7873 693a 7479 xsi:ty │ │ │ -000e0240: 7065 3c2f 636f 6465 3e3c 2f65 6d3e 2061 pe a │ │ │ -000e0250: 7474 7269 6275 7465 2069 6e20 584d 4c20 ttribute in XML │ │ │ -000e0260: 746f 2069 6e64 6963 6174 6520 7468 6520 to indicate the │ │ │ -000e0270: 7479 7065 206f 6620 636f 6e74 656e 7420 type of content │ │ │ -000e0280: 7365 7269 616c 697a 6564 2e3c 2f70 3e0a serialized.

. │ │ │ -000e0290: 3c70 3e48 6572 6520 6973 2061 6e20 6578

Here is an ex │ │ │ -000e02a0: 616d 706c 6520 746f 2069 6c6c 7573 7472 ample to illustr │ │ │ -000e02b0: 6174 6520 7468 6520 7365 7269 616c 697a ate the serializ │ │ │ -000e02c0: 6174 696f 6e20 6f66 2061 203c 636f 6465 ation of a void* me │ │ │ -000e02e0: 6d62 6572 2069 6e20 6120 7374 7275 6374 mber in a struct │ │ │ -000e02f0: 2f63 6c61 7373 3a3c 2f70 3e0a 3c64 6976 /class:

.
struct │ │ │ -000e0340: 203c 2f73 7061 6e3e 6e73 5f5f 7265 636f ns__reco │ │ │ -000e0350: 7264 203c 2f64 6976 3e0a 3c64 6976 2063 rd
.
{.
int _ │ │ │ -000e03b0: 5f74 7970 653b 203c 7370 616e 2063 6c61 _type; // │ │ │ -000e03d0: 7468 6520 534f 4150 5f54 5950 455f 5420 the SOAP_TYPE_T │ │ │ -000e03e0: 706f 696e 7465 6420 746f 2062 7920 7661 pointed to by va │ │ │ -000e03f0: 6c3c 2f73 7061 6e3e 3c2f 6469 763e 0a3c l
.< │ │ │ -000e0400: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -000e0410: 3e20 2020 203c 7370 616e 2063 6c61 7373 > v │ │ │ -000e0430: 6f69 643c 2f73 7061 6e3e 202a 7661 6c3b oid *val; │ │ │ -000e0440: 2020 3c73 7061 6e20 636c 6173 733d 2263 // seria │ │ │ -000e0460: 6c69 7a65 2061 6e79 2074 7970 6520 696e lize any type in │ │ │ -000e0470: 2065 6c65 6d65 6e74 2026 6c74 3b76 616c element <val │ │ │ -000e0480: 2667 743b 3c2f 7370 616e 3e3c 2f64 6976 >
.
};
.

The __type i │ │ │ -000e04e0: 6e74 6567 6572 2063 616e 2062 6520 7365 nteger can be se │ │ │ -000e04f0: 7420 746f 2030 2061 7420 7275 6e20 7469 t to 0 at run ti │ │ │ -000e0500: 6d65 2074 6f20 6f6d 6974 2074 6865 2073 me to omit the s │ │ │ -000e0510: 6572 6961 6c69 7a61 7469 6f6e 206f 6620 erialization of │ │ │ -000e0520: 7468 6520 766f 6964 2070 6f69 6e74 6572 the void pointer │ │ │ -000e0530: 206d 656d 6265 722e 3c2f 703e 0a3c 703e member.

.

│ │ │ -000e0540: 5468 6520 666f 6c6c 6f77 696e 6720 6578 The following ex │ │ │ -000e0550: 616d 706c 6520 696c 6c75 7374 7261 7465 ample illustrate │ │ │ -000e0560: 7320 7468 6520 696e 6974 6961 6c69 7a61 s the initializa │ │ │ -000e0570: 7469 6f6e 206f 6620 3c63 6f64 653e 6d79 tion of my │ │ │ -000e0580: 5374 7275 6374 3c2f 636f 6465 3e20 7769 Struct wi │ │ │ -000e0590: 7468 2061 2076 6f69 6420 706f 696e 7465 th a void pointe │ │ │ -000e05a0: 7220 746f 2061 6e20 696e 743a 3c2f 703e r to an int:

│ │ │ -000e05b0: 0a3c 6469 7620 636c 6173 733d 2266 7261 .
s │ │ │ -000e05f0: 7472 7563 7420 3c2f 7370 616e 3e6e 735f truct ns_ │ │ │ -000e0600: 5f72 6563 6f72 6420 533b 203c 2f64 6976 _record S;
.
in │ │ │ -000e0640: 743c 2f73 7061 6e3e 206e 203d 2031 3233 t n = 123 │ │ │ -000e0650: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
S.val │ │ │ -000e0670: 203d 2028 3c73 7061 6e20 636c 6173 733d = (vo │ │ │ -000e0690: 6964 3c2f 7370 616e 3e2a 2926 616d 703b id*)& │ │ │ -000e06a0: 6e3b 203c 2f64 6976 3e0a 3c64 6976 2063 n;
.
S.__ │ │ │ -000e06c0: 7479 7065 203d 2053 4f41 505f 5459 5045 type = SOAP_TYPE │ │ │ -000e06d0: 5f69 6e74 3b20 3c2f 6469 763e 0a3c 2f64 _int;
.

The seria │ │ │ -000e0700: 6c69 7a65 6420 6f75 7470 7574 206f 6620 lized output of │ │ │ -000e0710: 3c63 6f64 653e 533c 2f63 6f64 653e 2063 S c │ │ │ -000e0720: 6f6e 7461 696e 7320 7468 6520 696e 7465 ontains the inte │ │ │ -000e0730: 6765 7220 696e 2069 7473 203c 656d 3e3c ger in its < │ │ │ -000e0740: 636f 6465 3e76 616c 3c2f 636f 6465 3e3c code>val< │ │ │ -000e0750: 2f65 6d3e 2065 6c65 6d65 6e74 3a3c 2f70 /em> element:

.
< │ │ │ -000e07a0: 3c73 7061 6e20 636c 6173 733d 226b 6579 ns:rec │ │ │ -000e07c0: 6f72 643c 2f73 7061 6e3e 2667 743b 3c2f ord>.
<val xsi:type │ │ │ -000e0830: 3c2f 7370 616e 3e3d 3c73 7061 6e20 636c ="xsd:in │ │ │ -000e0860: 7426 7175 6f74 3b3c 2f73 7061 6e3e 2667 t"&g │ │ │ -000e0870: 743b 3132 3326 6c74 3b2f 3c73 7061 6e20 t;123</val&g │ │ │ -000e08a0: 743b 3c2f 6469 763e 0a3c 6469 7620 636c t;
.
</ │ │ │ -000e08c0: 3c73 7061 6e20 636c 6173 733d 226b 6579 ns:rec │ │ │ -000e08e0: 6f72 643c 2f73 7061 6e3e 2667 743b 3c2f ord>.

The deseri │ │ │ -000e0920: 616c 697a 6572 2066 6f72 203c 636f 6465 alizer for ns__record will automati │ │ │ -000e0950: 6361 6c6c 7920 7365 7420 7468 6520 3c63 cally set the __type field and void │ │ │ -000e0980: 2070 6f69 6e74 6572 2077 6865 6e20 6465 pointer when de │ │ │ -000e0990: 7365 7269 616c 697a 696e 6720 7468 6520 serializing the │ │ │ -000e09a0: 6461 7461 2c20 7072 6f76 6964 6564 2074 data, provided t │ │ │ -000e09b0: 6861 7420 7468 6520 584d 4c20 656c 656d hat the XML elem │ │ │ -000e09c0: 656e 7420 3c65 6d3e 3c63 6f64 653e 7661 ent va │ │ │ -000e09d0: 6c3c 2f63 6f64 653e 3c2f 656d 3e20 6361 l ca │ │ │ -000e09e0: 7272 6965 7320 7468 6520 3c65 6d3e 3c63 rries the xsi:type attribu │ │ │ -000e0a10: 7465 2066 726f 6d20 7768 6963 6820 6974 te from which it │ │ │ -000e0a20: 2063 616e 2064 6574 6572 6d69 6e65 2074 can determine t │ │ │ -000e0a30: 6865 2074 7970 652e 3c2f 703e 0a3c 646c he type.

.
Note
when seri │ │ │ -000e0a70: 616c 697a 696e 6720 7374 7269 6e67 7320 alizing strings │ │ │ -000e0a80: 7669 6120 6120 3c63 6f64 653e 766f 6964 via a void │ │ │ -000e0a90: 2a3c 2f63 6f64 653e 206d 656d 6265 722c * member, │ │ │ -000e0aa0: 2074 6865 203c 636f 6465 3e76 6f69 642a the void* │ │ │ -000e0ab0: 3c2f 636f 6465 3e20 706f 696e 7465 7220 pointer │ │ │ -000e0ac0: 6d75 7374 2064 6972 6563 746c 7920 706f must directly po │ │ │ -000e0ad0: 696e 7420 746f 2074 6865 2073 7472 696e int to the strin │ │ │ -000e0ae0: 6720 7661 6c75 6520 7261 7468 6572 2074 g value rather t │ │ │ -000e0af0: 6861 6e20 696e 6469 7265 6374 6c79 2061 han indirectly a │ │ │ -000e0b00: 7320 7769 7468 2061 6c6c 206f 7468 6572 s with all other │ │ │ -000e0b10: 2074 7970 6573 2e20 466f 7220 6578 616d types. For exam │ │ │ -000e0b20: 706c 653a 3c2f 6464 3e3c 2f64 6c3e 0a3c ple:
.< │ │ │ -000e0b30: 6469 7620 636c 6173 733d 2266 7261 676d div class="fragm │ │ │ -000e0b40: 656e 7422 3e3c 6469 7620 636c 6173 733d ent">
str │ │ │ -000e0b70: 7563 7420 3c2f 7370 616e 3e6e 735f 5f72 uct ns__r │ │ │ -000e0b80: 6563 6f72 6420 533b 203c 2f64 6976 3e0a ecord S;
. │ │ │ -000e0b90: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
S.val = (void │ │ │ -000e0bd0: 2a29 3c73 7061 6e20 636c 6173 733d 2273 *)&q │ │ │ -000e0bf0: 756f 743b 4865 6c6c 6f26 7175 6f74 3b3c uot;Hello"< │ │ │ -000e0c00: 2f73 7061 6e3e 3b20 3c2f 6469 763e 0a3c /span>;
.< │ │ │ -000e0c10: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -000e0c20: 3e53 2e5f 5f74 7970 6520 3d20 534f 4150 >S.__type = SOAP │ │ │ -000e0c30: 5f54 5950 455f 7374 7269 6e67 3b20 3c2f _TYPE_string; .

T │ │ │ -000e0c60: 6869 7320 6973 2074 6865 2063 6173 6520 his is the case │ │ │ -000e0c70: 666f 7220 616c 6c20 7374 7269 6e67 2d62 for all string-b │ │ │ -000e0c80: 6173 6564 2074 7970 6573 2c20 696e 636c ased types, incl │ │ │ -000e0c90: 7564 696e 6720 7479 7065 7320 6465 6669 uding types defi │ │ │ -000e0ca0: 6e65 6420 7769 7468 203c 636f 6465 3e74 ned with t │ │ │ -000e0cb0: 7970 6564 6566 2063 6861 722a 3c2f 636f ypedef char*.

.

You │ │ │ -000e0cd0: 6d61 7920 7573 6520 616e 2061 7262 6974 may use an arbit │ │ │ -000e0ce0: 7261 7279 2073 7566 6669 7820 7769 7468 rary suffix with │ │ │ -000e0cf0: 2074 6865 203c 636f 6465 3e5f 5f74 7970 the __typ │ │ │ -000e0d00: 653c 2f63 6f64 653e 206d 656d 6265 7273 e members │ │ │ -000e0d10: 2074 6f20 6861 6e64 6c65 206d 756c 7469 to handle multi │ │ │ -000e0d20: 706c 6520 766f 6964 2070 6f69 6e74 6572 ple void pointer │ │ │ -000e0d30: 7320 696e 2073 7472 7563 7473 2f63 6c61 s in structs/cla │ │ │ -000e0d40: 7373 6573 2e20 466f 7220 6578 616d 706c sses. For exampl │ │ │ -000e0d50: 653a 3c2f 703e 0a3c 6469 7620 636c 6173 e:

.
< │ │ │ -000e0d80: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -000e0d90: 6f72 6422 3e73 7472 7563 7420 3c2f 7370 ord">struct ns__record .
{
.< │ │ │ -000e0dd0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -000e0de0: 3e20 2020 203c 7370 616e 2063 6c61 7373 > i │ │ │ -000e0e00: 6e74 3c2f 7370 616e 3e20 5f5f 7479 7065 nt __type │ │ │ -000e0e10: 4f66 703b 203c 7370 616e 2063 6c61 7373 Ofp; // th │ │ │ -000e0e30: 6520 534f 4150 5f54 5950 455f 5420 706f e SOAP_TYPE_T po │ │ │ -000e0e40: 696e 7465 6420 746f 2062 7920 7020 3c2f inted to by p
.
│ │ │ -000e0e70: 2020 3c73 7061 6e20 636c 6173 733d 226b void │ │ │ -000e0e90: 3c2f 7370 616e 3e20 2a70 3b20 2020 2020 *p; │ │ │ -000e0ea0: 2020 3c73 7061 6e20 636c 6173 733d 2263 // eleme │ │ │ -000e0ec0: 6e74 2026 6c74 3b70 2667 743b 3c2f 7370 nt <p>
.
│ │ │ -000e0ef0: 3c73 7061 6e20 636c 6173 733d 226b 6579 int __typeOfq; │ │ │ -000e0f20: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // the SOA │ │ │ -000e0f40: 505f 5459 5045 5f54 2070 6f69 6e74 6564 P_TYPE_T pointed │ │ │ -000e0f50: 2074 6f20 6279 2071 203c 2f73 7061 6e3e to by q │ │ │ -000e0f60: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
void *q; // element &l │ │ │ -000e0fd0: 743b 7126 6774 3b3c 2f73 7061 6e3e 3c2f t;q>.
};
. │ │ │ -000e1000: 3c2f 6469 763e 3c21 2d2d 2066 7261 676d

Becaus │ │ │ -000e1020: 6520 7365 7276 6963 6520 6d65 7468 6f64 e service method │ │ │ -000e1030: 2070 6172 616d 6574 6572 7320 6172 6520 parameters are │ │ │ -000e1040: 7374 6f72 6564 2077 6974 6869 6e20 7374 stored within st │ │ │ -000e1050: 7275 6374 732c 2079 6f75 2063 616e 2075 ructs, you can u │ │ │ -000e1060: 7365 203c 636f 6465 3e5f 5f74 7970 653c se __type< │ │ │ -000e1070: 2f63 6f64 653e 2061 6e64 203c 636f 6465 /code> and void* pa │ │ │ -000e1090: 7261 6d65 7465 7273 2074 6f20 7061 7373 rameters to pass │ │ │ -000e10a0: 2070 6f6c 796d 6f72 7068 6963 2061 7267 polymorphic arg │ │ │ -000e10b0: 756d 656e 7473 2077 6974 686f 7574 2068 uments without h │ │ │ -000e10c0: 6176 696e 6720 746f 2064 6566 696e 6520 aving to define │ │ │ -000e10d0: 6120 432b 2b20 636c 6173 7320 6869 6572 a C++ class hier │ │ │ -000e10e0: 6172 6368 7920 2853 6563 7469 6f6e 203c archy (Section < │ │ │ -000e10f0: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ -000e1100: 663d 2269 6e64 6578 2e68 746d 6c23 706f f="index.html#po │ │ │ -000e1110: 6c79 6d6f 7270 6822 3e50 6f6c 796d 6f72 lymorph">Polymor │ │ │ -000e1120: 7068 6973 6d2c 2064 6572 6976 6564 2074 phism, derived t │ │ │ -000e1130: 7970 6573 2c20 616e 6420 6479 6e61 6d69 ypes, and dynami │ │ │ -000e1140: 6320 6269 6e64 696e 6720 696e 2043 2b2b c binding in C++ │ │ │ -000e1150: 3c2f 613e 2029 2c20 7072 6f76 6964 6564 ), provided │ │ │ -000e1160: 2074 6861 7420 3c65 6d3e 3c63 6f64 653e that │ │ │ -000e1170: 7873 693a 7479 7065 3c2f 636f 6465 3e3c xsi:type< │ │ │ -000e1180: 2f65 6d3e 2061 7474 7269 6275 7465 7320 /em> attributes │ │ │ -000e1190: 6172 6520 7072 6573 656e 7420 696e 2074 are present in t │ │ │ -000e11a0: 6865 2058 4d4c 2065 6c65 6d65 6e74 732e he XML elements. │ │ │ -000e11b0: 2046 6f72 2065 7861 6d70 6c65 3a3c 2f70 For example:

.
│ │ │ -000e1200: 7479 7065 6465 663c 2f73 7061 6e3e 203c typedef < │ │ │ -000e1210: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -000e1220: 6f72 6474 7970 6522 3e63 6861 723c 2f73 ordtype">char *xsd__strin │ │ │ -000e1240: 673b 203c 2f64 6976 3e0a 3c64 6976 2063 g;
.
typedef │ │ │ -000e1280: 203c 7370 616e 2063 6c61 7373 3d22 6b65 int xsd__int; │ │ │ -000e12b0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
t │ │ │ -000e12e0: 7970 6564 6566 3c2f 7370 616e 3e20 3c73 ypedef float xsd__float; │ │ │ -000e1320: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
│ │ │ -000e1350: 656e 756d 3c2f 7370 616e 3e20 6e73 5f5f enum ns__ │ │ │ -000e1360: 7374 6174 7573 207b 206f 6e2c 206f 6666 status { on, off │ │ │ -000e1370: 207d 3b20 3c2f 6469 763e 0a3c 6469 7620 };
.
struct ns__widget
.
{
.
│ │ │ -000e13f0: 2020 3c73 7061 6e20 636c 6173 733d 226b char │ │ │ -000e1410: 3c2f 7370 616e 3e20 2a6e 616d 653b 3c2f *name;.
int │ │ │ -000e1460: 7061 7274 3b3c 2f64 6976 3e0a 3c64 6976 part;
.
}; │ │ │ -000e1480: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
int ns │ │ │ -000e14c0: 5f5f 7765 626d 6574 686f 6428 3c73 7061 __webmethod(int │ │ │ -000e14f0: 205f 5f74 7970 652c 203c 7370 616e 2063 __type, void * │ │ │ -000e1520: 6461 7461 2c20 3c73 7061 6e20 636c 6173 data, stru │ │ │ -000e1540: 6374 3c2f 7370 616e 3e20 6e73 5f5f 7765 ct ns__we │ │ │ -000e1550: 626d 6574 686f 6452 6573 706f 6e73 6520 bmethodResponse │ │ │ -000e1560: 7b20 3c73 7061 6e20 636c 6173 733d 226b { int< │ │ │ -000e1580: 2f73 7061 6e3e 205f 5f74 7970 653b 203c /span> __type; < │ │ │ -000e1590: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -000e15a0: 6f72 6474 7970 6522 3e76 6f69 643c 2f73 ordtype">void *return_; } │ │ │ -000e15c0: 202a 6f75 7429 3b3c 2f64 6976 3e0a 3c2f *out);
.

This met │ │ │ -000e15f0: 686f 6420 6861 7320 6120 706f 6c79 6d6f hod has a polymo │ │ │ -000e1600: 7270 6869 6320 696e 7075 7420 7061 7261 rphic input para │ │ │ -000e1610: 6d65 7465 7220 3c63 6f64 653e 6461 7461 meter data │ │ │ -000e1620: 3c2f 636f 6465 3e20 616e 6420 6120 706f and a po │ │ │ -000e1630: 6c79 6d6f 7270 6869 6320 6f75 7470 7574 lymorphic output │ │ │ -000e1640: 2070 6172 616d 6574 6572 203c 636f 6465 parameter return_. │ │ │ -000e1660: 2054 6865 203c 636f 6465 3e5f 5f74 7970 The __typ │ │ │ -000e1670: 653c 2f63 6f64 653e 2070 6172 616d 6574 e paramet │ │ │ -000e1680: 6572 7320 6361 6e20 6265 206f 6e65 206f ers can be one o │ │ │ -000e1690: 6620 3c63 6f64 653e 534f 4150 5f54 5950 f SOAP_TYP │ │ │ -000e16a0: 455f 7873 645f 5f73 7472 696e 673c 2f63 E_xsd__string, SOAP │ │ │ -000e16c0: 5f54 5950 455f 7873 645f 5f69 6e74 3c2f _TYPE_xsd__int, SOA │ │ │ -000e16e0: 505f 5459 5045 5f78 7364 5f5f 666c 6f61 P_TYPE_xsd__floa │ │ │ -000e16f0: 743c 2f63 6f64 653e 2c20 3c63 6f64 653e t, │ │ │ -000e1700: 534f 4150 5f54 5950 455f 6e73 5f5f 7374 SOAP_TYPE_ns__st │ │ │ -000e1710: 6174 7573 3c2f 636f 6465 3e2c 206f 7220 atus, or │ │ │ -000e1720: 3c63 6f64 653e 534f 4150 5f54 5950 455f SOAP_TYPE_ │ │ │ -000e1730: 6e73 5f5f 7769 6467 6574 3c2f 636f 6465 ns__widget. The WSDL and │ │ │ -000e1750: 5853 4420 6669 6c65 7320 7072 6f64 7563 XSD files produc │ │ │ -000e1760: 6564 2062 7920 7468 6520 736f 6170 6370 ed by the soapcp │ │ │ -000e1770: 7032 2074 6f6f 6c20 6465 636c 6172 6520 p2 tool declare │ │ │ -000e1780: 7468 6520 3c63 6f64 653e 766f 6964 2a3c the void*< │ │ │ -000e1790: 2f63 6f64 653e 2070 6f6c 796d 6f72 7068 /code> polymorph │ │ │ -000e17a0: 6963 206d 656d 6265 7273 2061 7320 3c65 ic members as xsd:anyT │ │ │ -000e17c0: 7970 653c 2f63 6f64 653e 3c2f 656d 3e20 ype │ │ │ -000e17d0: 656c 656d 656e 7473 2e3c 2f70 3e0a 3c70 elements.

.

To declare a wr │ │ │ -000e17f0: 6170 7065 7220 7374 7275 6374 2f63 6c61 apper struct/cla │ │ │ -000e1800: 7373 2066 6f72 203c 636f 6465 3e76 6f69 ss for voi │ │ │ -000e1810: 642a 3c2f 636f 6465 3e20 706f 696e 7465 d* pointe │ │ │ -000e1820: 7273 2061 6c6c 6f77 7320 7573 2074 6f20 rs allows us to │ │ │ -000e1830: 7265 7573 6520 7468 6973 206d 6563 6861 reuse this mecha │ │ │ -000e1840: 6e69 736d 2077 6865 6e20 7765 2075 7365 nism when we use │ │ │ -000e1850: 203c 636f 6465 3e5f 5f73 656c 663c 2f63 __self as a member │ │ │ -000e1870: 206e 616d 6520 7468 6174 2072 6566 6572 name that refer │ │ │ -000e1880: 7320 746f 2074 6865 2063 7572 7265 6e74 s to the current │ │ │ -000e1890: 2058 4d4c 2065 6c65 6d65 6e74 2074 6167 XML element tag │ │ │ -000e18a0: 206e 616d 653a 3c2f 703e 0a3c 6469 7620 name:

.
struct │ │ │ -000e18f0: 3c2f 7370 616e 3e5f 5f61 6e79 203c 2f64 __any .
{
. │ │ │ -000e1930: 2020 2020 3c73 7061 6e20 636c 6173 733d in │ │ │ -000e1950: 743c 2f73 7061 6e3e 205f 5f74 7970 653b t __type; │ │ │ -000e1960: 2020 203c 7370 616e 2063 6c61 7373 3d22 // the │ │ │ -000e1980: 534f 4150 5f54 5950 455f 5420 706f 696e SOAP_TYPE_T poin │ │ │ -000e1990: 7465 6420 746f 2062 7920 5f5f 7365 6c66 ted to by __self │ │ │ -000e19a0: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ -000e19c0: 2020 2020 3c73 7061 6e20 636c 6173 733d vo │ │ │ -000e19e0: 6964 3c2f 7370 616e 3e20 2a5f 5f73 656c id *__sel │ │ │ -000e19f0: 663b 203c 7370 616e 2063 6c61 7373 3d22 f; // seri │ │ │ -000e1a10: 616c 697a 6520 616e 7920 7479 7065 206f alize any type o │ │ │ -000e1a20: 6620 636f 6e74 656e 7420 6f66 2074 6865 f content of the │ │ │ -000e1a30: 2063 7572 7265 6e74 2065 6c65 6d65 6e74 current element │ │ │ -000e1a40: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ -000e1a60: 7d3b 3c2f 6469 763e 0a3c 6469 7620 636c };
.
struct n │ │ │ -000e1aa0: 735f 5f72 6563 6f72 643c 2f64 6976 3e0a s__record
. │ │ │ -000e1ab0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
{
.
│ │ │ -000e1ae0: 5f5f 616e 7920 7661 6c3b 3c2f 6469 763e __any val;
│ │ │ -000e1af0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
};
.

The follow │ │ │ -000e1b30: 696e 6720 6578 616d 706c 6520 696c 6c75 ing example illu │ │ │ -000e1b40: 7374 7261 7465 7320 7468 6520 696e 6974 strates the init │ │ │ -000e1b50: 6961 6c69 7a61 7469 6f6e 206f 6620 3c63 ialization of __ns__record │ │ │ -000e1b70: 3c2f 636f 6465 3e20 7769 7468 2061 2076 with a v │ │ │ -000e1b80: 6f69 6420 706f 696e 7465 7220 746f 2061 oid pointer to a │ │ │ -000e1b90: 6e20 696e 743a 3c2f 703e 0a3c 6469 7620 n int:

.
struct │ │ │ -000e1be0: 3c2f 7370 616e 3e6e 735f 5f72 6563 6f72 ns__recor │ │ │ -000e1bf0: 6420 533b 203c 2f64 6976 3e0a 3c64 6976 d S;
.
int n = 123; .
S.val.__ite │ │ │ -000e1c60: 6d20 3d20 283c 7370 616e 2063 6c61 7373 m = (v │ │ │ -000e1c80: 6f69 643c 2f73 7061 6e3e 2a29 2661 6d70 oid*)& │ │ │ -000e1c90: 3b6e 3b20 3c2f 6469 763e 0a3c 6469 7620 ;n;
.
S.v │ │ │ -000e1cb0: 616c 2e5f 5f74 7970 6520 3d20 534f 4150 al.__type = SOAP │ │ │ -000e1cc0: 5f54 5950 455f 696e 743b 203c 2f64 6976 _TYPE_int;
.

The │ │ │ -000e1cf0: 7365 7269 616c 697a 6564 206f 7574 7075 serialized outpu │ │ │ -000e1d00: 7420 6f66 203c 636f 6465 3e53 3c2f 636f t of S contains the │ │ │ -000e1d20: 2069 6e74 6567 6572 3a3c 2f70 3e0a 3c64 integer:

. │ │ │ -000e1d40: 3c64 6976 2063 6c61 7373 3d22 6672 6167
<ns:record< │ │ │ -000e1d90: 2f73 7061 6e3e 2667 743b 3c2f 6469 763e /span>>
│ │ │ -000e1da0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
<val xsi:type= │ │ │ -000e1e20: 2671 756f 743b 7873 643a 696e 7426 7175 "xsd:int&qu │ │ │ -000e1e30: 6f74 3b3c 2f73 7061 6e3e 2667 743b 3132 ot;>12 │ │ │ -000e1e40: 3326 6c74 3b2f 3c73 7061 6e20 636c 6173 3</ │ │ │ -000e1e60: 7661 6c3c 2f73 7061 6e3e 2667 743b 3c2f val>.
</ns:record< │ │ │ -000e1eb0: 2f73 7061 6e3e 2667 743b 3c2f 6469 763e /span>>
│ │ │ -000e1ec0: 0a3c 2f64 6976 3e3c 212d 2d20 6672 6167 .
< │ │ │ -000e1ee0: 703e f09f 949d 203c 6120 6872 6566 3d22 p>.... Back to table │ │ │ -000e1f00: 206f 6620 636f 6e74 656e 7473 3c2f 613e of contents │ │ │ -000e1f10: 3c2f 703e 0a3c 6832 3e3c 6120 636c 6173

.

│ │ │ -000e1f40: 0a46 6978 6564 2d73 697a 6520 6172 7261 .Fixed-size arra │ │ │ -000e1f50: 7920 7365 7269 616c 697a 6174 696f 6e3c y serialization< │ │ │ -000e1f60: 2f68 323e 0a3c 703e 4669 7865 6420 7369 /h2>.

Fixed si │ │ │ -000e1f70: 7a65 2061 7272 6179 7320 6172 6520 7365 ze arrays are se │ │ │ -000e1f80: 7269 616c 697a 6564 2061 7320 7265 7065 rialized as repe │ │ │ -000e1f90: 7469 7469 6f6e 7320 6f66 203c 656d 3e3c titions of < │ │ │ -000e1fa0: 636f 6465 3e69 7465 6d3c 2f63 6f64 653e code>item │ │ │ -000e1fb0: 3c2f 656d 3e20 656c 656d 656e 7473 2077 elements w │ │ │ -000e1fc0: 6974 6820 7468 6520 6172 7261 7920 7661 ith the array va │ │ │ -000e1fd0: 6c75 6573 2069 6e20 584d 4c2e 204d 756c lues in XML. Mul │ │ │ -000e1fe0: 7469 2d64 696d 656e 7369 6f6e 616c 2066 ti-dimensional f │ │ │ -000e1ff0: 6978 6564 2073 697a 6520 6172 7261 7973 ixed size arrays │ │ │ -000e2000: 2061 7265 2073 6572 6961 6c69 7a65 6420 are serialized │ │ │ -000e2010: 6173 206e 6573 7465 6420 3c65 6d3e 3c63 as nested item< │ │ │ -000e2030: 2f65 6d3e 2065 6c65 6d65 6e74 732c 2077 /em> elements, w │ │ │ -000e2040: 6865 7265 2074 6865 206f 7574 6572 2065 here the outer e │ │ │ -000e2050: 6c65 6d65 6e74 7320 6172 6520 6172 7261 lements are arra │ │ │ -000e2060: 7973 2e3c 2f70 3e0a 3c70 3e54 6865 2073 ys.

.

The s │ │ │ -000e2070: 6572 6961 6c69 7a61 7469 6f6e 206f 6620 erialization of │ │ │ -000e2080: 6669 7865 642d 7369 7a65 2061 7272 6179 fixed-size array │ │ │ -000e2090: 7320 7375 7070 6f72 7473 2074 6865 2053 s supports the S │ │ │ -000e20a0: 4f41 5020 5250 4320 656e 636f 6469 6e67 OAP RPC encoding │ │ │ -000e20b0: 206d 756c 7469 2d64 696d 656e 7369 6f6e multi-dimension │ │ │ -000e20c0: 616c 2061 7272 6179 2066 6f72 6d61 7420 al array format │ │ │ -000e20d0: 6173 2077 656c 6c20 6173 2070 6172 7469 as well as parti │ │ │ -000e20e0: 616c 6c79 2074 7261 6e73 6d69 7474 6564 ally transmitted │ │ │ -000e20f0: 2061 6e64 2073 7061 7273 6520 6172 7261 and sparse arra │ │ │ -000e2100: 7920 666f 726d 6174 7320 7374 616e 6461 y formats standa │ │ │ -000e2110: 7264 697a 6564 2069 6e20 534f 4150 2031 rdized in SOAP 1 │ │ │ -000e2120: 2e31 2061 6e64 2031 2e32 2e3c 2f70 3e0a .1 and 1.2.

. │ │ │ -000e2130: 3c70 3e46 6f72 2065 7861 6d70 6c65 3a3c

For example:< │ │ │ -000e2140: 2f70 3e0a 3c64 6976 2063 6c61 7373 3d22 /p>.

// Contents of │ │ │ -000e2190: 2066 696c 6520 2671 756f 743b 6669 7865 file "fixe │ │ │ -000e21a0: 642e 6826 7175 6f74 3b3a 203c 2f73 7061 d.h":
.
struct E │ │ │ -000e21f0: 7861 6d70 6c65 203c 2f64 6976 3e0a 3c64 xample
. │ │ │ -000e2210: 7b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 {
.
float a[3];
.
};
.

This spec │ │ │ -000e22a0: 6966 6965 7320 6120 6669 7865 642d 7369 ifies a fixed-si │ │ │ -000e22b0: 7a65 2061 7272 6179 2070 6172 7420 6f66 ze array part of │ │ │ -000e22c0: 2074 6865 203c 636f 6465 3e73 7472 7563 the struc │ │ │ -000e22d0: 7420 4578 616d 706c 653c 2f63 6f64 653e t Example │ │ │ -000e22e0: 2e20 5468 6520 7365 7269 616c 697a 6564 . The serialized │ │ │ -000e22f0: 206f 7574 7075 7420 6f66 2061 7272 6179 output of array │ │ │ -000e2300: 203c 636f 6465 3e61 3c2f 636f 6465 3e20 a │ │ │ -000e2310: 6973 3a3c 2f70 3e0a 3c64 6976 2063 6c61 is:

.
│ │ │ -000e2340: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
< │ │ │ -000e2370: 613c 2f73 7061 6e3e 2667 743b 3c2f 6469 a>.
<item │ │ │ -000e23c0: 2667 743b 312e 3026 6c74 3b2f 3c73 7061 >1.0</item>
.
│ │ │ -000e2410: 266c 743b 3c73 7061 6e20 636c 6173 733d <it │ │ │ -000e2430: 656d 3c2f 7370 616e 3e26 6774 3b32 2e30 em>2.0 │ │ │ -000e2440: 266c 743b 2f3c 7370 616e 2063 6c61 7373 </i │ │ │ -000e2460: 7465 6d3c 2f73 7061 6e3e 2667 743b 3c2f tem>.
<item>3.0</item>
. │ │ │ -000e2500: 266c 743b 2f3c 7370 616e 2063 6c61 7373 </a │ │ │ -000e2520: 3c2f 7370 616e 3e26 6774 3b3c 2f64 6976 >
.
│ │ │ -000e2550: 3c70 3e41 6e79 2064 6573 6572 6961 6c69

Any deseriali │ │ │ -000e2560: 7a65 6420 6974 656d 7320 6f66 2061 6e20 zed items of an │ │ │ -000e2570: 6172 7261 7920 7468 6174 2064 6f20 6e6f array that do no │ │ │ -000e2580: 7420 6669 7420 696e 2074 6865 2066 6978 t fit in the fix │ │ │ -000e2590: 6564 2073 697a 6520 6172 7261 792c 2069 ed size array, i │ │ │ -000e25a0: 2e65 2e20 6172 6520 6f75 7420 6f66 2062 .e. are out of b │ │ │ -000e25b0: 6f75 6e64 732c 2061 7265 2069 676e 6f72 ounds, are ignor │ │ │ -000e25c0: 6564 2062 7920 7468 6520 6465 7365 7269 ed by the deseri │ │ │ -000e25d0: 616c 697a 6572 2077 6865 6e20 7468 6520 alizer when the │ │ │ -000e25e0: 3c63 6f64 653e 2353 4f41 505f 435f 4e4f #SOAP_C_NO │ │ │ -000e25f0: 494f 423c 2f63 6f64 653e 2066 6c61 6720 IOB flag │ │ │ -000e2600: 6973 2073 6574 2c20 6f74 6865 7277 6973 is set, otherwis │ │ │ -000e2610: 6520 3c63 6f64 653e 2353 4f41 505f 494f e #SOAP_IO │ │ │ -000e2620: 423c 2f63 6f64 653e 2065 7272 6f72 7320 B errors │ │ │ -000e2630: 7769 6c6c 2062 6520 6765 6e65 7261 7465 will be generate │ │ │ -000e2640: 6420 6279 2074 6865 2064 6573 6572 6961 d by the deseria │ │ │ -000e2650: 6c69 7a65 722e 3c2f 703e 0a3c 703e f09f lizer.

.

.. │ │ │ -000e2660: 949d 203c 6120 6872 6566 3d22 2322 3e42 .. B │ │ │ -000e2670: 6163 6b20 746f 2074 6162 6c65 206f 6620 ack to table of │ │ │ -000e2680: 636f 6e74 656e 7473 3c2f 613e 3c2f 703e contents

│ │ │ -000e2690: 0a3c 6832 3e3c 6120 636c 6173 733d 2261 .

.Dynami │ │ │ -000e26c0: 6320 6172 7261 7920 7365 7269 616c 697a c array serializ │ │ │ -000e26d0: 6174 696f 6e3c 2f68 323e 0a3c 703e 4479 ation

.

Dy │ │ │ -000e26e0: 6e61 6d69 6320 6172 7261 7973 2061 7265 namic arrays are │ │ │ -000e26f0: 206d 7563 6820 6d6f 7265 2066 6c65 7869 much more flexi │ │ │ -000e2700: 626c 6520 7468 616e 2066 6978 6564 2d73 ble than fixed-s │ │ │ -000e2710: 697a 6520 6172 7261 7973 2e20 4479 6e61 ize arrays. Dyna │ │ │ -000e2720: 6d69 6320 6172 7261 7973 2064 6563 6c61 mic arrays decla │ │ │ -000e2730: 7265 6420 696e 2074 6865 2069 6e74 6572 red in the inter │ │ │ -000e2740: 6661 6365 2068 6561 6465 7220 6669 6c65 face header file │ │ │ -000e2750: 2066 6f72 2073 6f61 7063 7070 3220 6172 for soapcpp2 ar │ │ │ -000e2760: 6520 6120 7370 6563 6961 6c20 7374 7275 e a special stru │ │ │ -000e2770: 6374 206f 7220 636c 6173 7320 6f72 2061 ct or class or a │ │ │ -000e2780: 7265 2070 6172 7420 6f66 2061 2073 7472 re part of a str │ │ │ -000e2790: 7563 7420 6f72 2063 6c61 7373 2077 6974 uct or class wit │ │ │ -000e27a0: 6820 6120 6d65 6d62 6572 2070 6f69 6e74 h a member point │ │ │ -000e27b0: 696e 6720 746f 2061 6e20 6172 7261 7920 ing to an array │ │ │ -000e27c0: 6f66 2065 6c65 6d65 6e74 7320 616e 6420 of elements and │ │ │ -000e27d0: 6120 6d65 6d62 6572 2074 6861 7420 7374 a member that st │ │ │ -000e27e0: 6f72 6573 2074 6865 2073 697a 6520 6f66 ores the size of │ │ │ -000e27f0: 2074 6865 2061 7272 6179 2e20 4479 6e61 the array. Dyna │ │ │ -000e2800: 6d69 6320 6172 7261 7920 616c 6c6f 6361 mic array alloca │ │ │ -000e2810: 7469 6f6e 7320 6172 6520 6561 7379 2075 tions are easy u │ │ │ -000e2820: 7369 6e67 2074 6865 2073 6f61 7063 7070 sing the soapcpp │ │ │ -000e2830: 2d67 656e 6572 6174 6564 203c 636f 6465 -generated soap_new_T functions for │ │ │ -000e2860: 2074 7970 6520 3c63 6f64 653e 543c 2f63 type T. This funct │ │ │ -000e2880: 696f 6e20 6973 2075 7365 6420 746f 2061 ion is used to a │ │ │ -000e2890: 6c6c 6f63 6174 6520 616e 2061 7272 6179 llocate an array │ │ │ -000e28a0: 206f 6620 7661 6c75 6573 2077 6869 6368 of values which │ │ │ -000e28b0: 2063 616e 2074 6865 6e20 6265 2061 7373 can then be ass │ │ │ -000e28c0: 6967 6e65 6420 746f 2074 6865 2070 6f69 igned to the poi │ │ │ -000e28d0: 6e74 6572 206d 656d 6265 7220 6f66 2074 nter member of t │ │ │ -000e28e0: 6865 2073 7472 7563 742f 636c 6173 7320 he struct/class │ │ │ -000e28f0: 7468 6174 2073 746f 7265 7320 7468 6520 that stores the │ │ │ -000e2900: 6172 7261 7920 706f 696e 7465 7220 7769 array pointer wi │ │ │ -000e2910: 7468 2069 7473 2073 697a 652e 3c2f 703e th its size.

│ │ │ -000e2920: 0a3c 703e 546f 2066 6163 696c 6974 6174 .

To facilitat │ │ │ -000e2930: 6520 534f 4150 2052 5043 2065 6e63 6f64 e SOAP RPC encod │ │ │ -000e2940: 696e 672c 2053 4f41 502d 656e 636f 6465 ing, SOAP-encode │ │ │ -000e2950: 6420 6172 7261 7973 2072 6571 7569 7265 d arrays require │ │ │ -000e2960: 2073 7065 6369 616c 2074 7265 6174 6d65 special treatme │ │ │ -000e2970: 6e74 2e20 534f 4150 2d65 6e63 6f64 6564 nt. SOAP-encoded │ │ │ -000e2980: 2061 7272 6179 7320 6172 6520 7369 6e67 arrays are sing │ │ │ -000e2990: 6c65 2d20 6f72 206d 756c 7469 2d64 696d le- or multi-dim │ │ │ -000e29a0: 656e 7369 6f6e 616c 2061 7272 6179 7320 ensional arrays │ │ │ -000e29b0: 7769 7468 2062 6f75 6e64 7320 7468 6174 with bounds that │ │ │ -000e29c0: 2061 7070 6561 7220 696e 2058 4d4c 2e20 appear in XML. │ │ │ -000e29d0: 5468 6573 6520 6172 7261 7973 206d 6179 These arrays may │ │ │ -000e29e0: 2061 6c73 6f20 6861 7665 206f 6666 7365 also have offse │ │ │ -000e29f0: 7473 2074 6861 7420 6469 6666 6572 2066 ts that differ f │ │ │ -000e2a00: 726f 6d20 7a65 726f 2e20 5468 6520 696e rom zero. The in │ │ │ -000e2a10: 7465 6e74 206f 6620 534f 4150 2d65 6e63 tent of SOAP-enc │ │ │ -000e2a20: 6f64 6564 2061 7272 6179 7320 6973 2074 oded arrays is t │ │ │ -000e2a30: 6f20 7265 706c 6963 6174 6520 6d75 6c74 o replicate mult │ │ │ -000e2a40: 692d 6469 6d65 6e73 696f 6e61 6c20 6172 i-dimensional ar │ │ │ -000e2a50: 7261 7973 2063 6f6d 6d6f 6e6c 7920 666f rays commonly fo │ │ │ -000e2a60: 756e 6420 696e 2070 726f 6772 616d 6d69 und in programmi │ │ │ -000e2a70: 6e67 206c 616e 6775 6167 6573 2e3c 2f70 ng languages.

.

However, XM │ │ │ -000e2a90: 4c20 616c 736f 2070 726f 7669 6465 7320 L also provides │ │ │ -000e2aa0: 6120 7369 6d70 6c65 2077 6179 2074 6f20 a simple way to │ │ │ -000e2ab0: 7265 7072 6573 656e 7420 6120 7365 7175 represent a sequ │ │ │ -000e2ac0: 656e 6365 206f 6620 7661 6c75 6573 2077 ence of values w │ │ │ -000e2ad0: 6974 6820 6120 7365 7175 656e 6365 206f ith a sequence o │ │ │ -000e2ae0: 6620 584d 4c20 656c 656d 656e 7473 2e20 f XML elements. │ │ │ -000e2af0: 5468 6973 2064 6966 6665 7273 2066 726f This differs fro │ │ │ -000e2b00: 6d20 534f 4150 2d65 6e63 6f64 6564 2061 m SOAP-encoded a │ │ │ -000e2b10: 7272 6179 7320 696e 2074 6861 7420 534f rrays in that SO │ │ │ -000e2b20: 4150 2d65 6e63 6f64 6564 2061 7272 6179 AP-encoded array │ │ │ -000e2b30: 7320 6172 6520 656c 656d 656e 7473 2077 s are elements w │ │ │ -000e2b40: 6974 6820 6e65 7374 6564 203c 656d 3e3c ith nested < │ │ │ -000e2b50: 636f 6465 3e69 7465 6d3c 2f63 6f64 653e code>item │ │ │ -000e2b60: 3c2f 656d 3e20 656c 656d 656e 7473 2077 elements w │ │ │ -000e2b70: 6974 6820 7661 6c75 6573 2c20 7468 6f75 ith values, thou │ │ │ -000e2b80: 6768 2053 4f41 5020 6465 7365 7269 616c gh SOAP deserial │ │ │ -000e2b90: 697a 6572 7320 6d61 7920 6967 6e6f 7265 izers may ignore │ │ │ -000e2ba0: 2074 6865 206e 616d 6520 6f66 2074 6865 the name of the │ │ │ -000e2bb0: 7365 2065 6c65 6d65 6e74 7320 7768 656e se elements when │ │ │ -000e2bc0: 2070 6172 7369 6e67 2058 4d4c 2061 7320 parsing XML as │ │ │ -000e2bd0: 7374 6174 6564 2069 6e20 7468 6520 534f stated in the SO │ │ │ -000e2be0: 4150 2073 7065 6369 6669 6361 7469 6f6e AP specification │ │ │ -000e2bf0: 732e 3c2f 703e 0a3c 703e 426f 7468 2053 s.

.

Both S │ │ │ -000e2c00: 4f41 502d 656e 636f 6465 6420 6172 7261 OAP-encoded arra │ │ │ -000e2c10: 7973 2061 6e64 2073 6571 7565 6e63 6573 ys and sequences │ │ │ -000e2c20: 206f 6620 584d 4c20 656c 656d 656e 7473 of XML elements │ │ │ -000e2c30: 2061 7265 2073 7570 706f 7274 6564 2069 are supported i │ │ │ -000e2c40: 6e20 6753 4f41 502c 2075 7369 6e67 2064 n gSOAP, using d │ │ │ -000e2c50: 796e 616d 6963 2061 7272 6179 7320 616e ynamic arrays an │ │ │ -000e2c60: 6420 636f 6e74 6169 6e65 7273 2e20 5468 d containers. Th │ │ │ -000e2c70: 6520 6261 7369 6373 2077 696c 6c20 6265 e basics will be │ │ │ -000e2c80: 2064 6573 6372 6962 6564 206e 6578 742e described next. │ │ │ -000e2c90: 2046 6f72 2061 6464 6974 696f 6e61 6c20 For additional │ │ │ -000e2ca0: 6465 7461 696c 732c 2073 6565 2074 6865 details, see the │ │ │ -000e2cb0: 203c 6120 6872 6566 3d22 2e2e 2f2e 2e2f C a │ │ │ -000e2ce0: 6e64 2043 2b2b 2058 4d4c 2044 6174 6120 nd C++ XML Data │ │ │ -000e2cf0: 4269 6e64 696e 6773 3c2f 613e 2064 6f63 Bindings doc │ │ │ -000e2d00: 756d 656e 7461 7469 6f6e 2e3c 2f70 3e0a umentation.

. │ │ │ -000e2d10: 3c70 3ef0 9f94 9d20 3c61 2068 7265 663d

.... Back to tabl │ │ │ -000e2d30: 6520 6f66 2063 6f6e 7465 6e74 733c 2f61 e of contents

.

.SOAP-encoded a │ │ │ -000e2d80: 7272 6179 2062 6f75 6e64 733c 2f68 333e rray bounds

│ │ │ -000e2d90: 0a3c 703e 534f 4150 2d65 6e63 6f64 6564 .

SOAP-encoded │ │ │ -000e2da0: 2061 7272 6179 7320 7573 6520 7468 6520 arrays use the │ │ │ -000e2db0: 3c65 6d3e 3c63 6f64 653e 534f 4150 2d45 SOAP-E │ │ │ -000e2dc0: 4e43 3a41 7272 6179 3c2f 636f 6465 3e3c NC:Array< │ │ │ -000e2dd0: 2f65 6d3e 2061 7474 7269 6275 7465 2069 /em> attribute i │ │ │ -000e2de0: 6e20 584d 4c20 746f 2069 6465 6e74 6966 n XML to identif │ │ │ -000e2df0: 7920 7468 6520 6172 7261 7920 616e 6420 y the array and │ │ │ -000e2e00: 7468 6520 3c65 6d3e 3c63 6f64 653e 534f the SO │ │ │ -000e2e10: 4150 2d45 4e43 3a61 7272 6179 5479 7065 AP-ENC:arrayType │ │ │ -000e2e20: 3c2f 636f 6465 3e3c 2f65 6d3e 2061 7474 att │ │ │ -000e2e30: 7269 6275 7465 2074 6f20 6964 656e 7469 ribute to identi │ │ │ -000e2e40: 6679 2074 6865 2061 7272 6179 2064 696d fy the array dim │ │ │ -000e2e50: 656e 7369 6f6e 616c 6974 7920 616e 6420 ensionality and │ │ │ -000e2e60: 6974 7320 7369 7a65 2e3c 2f70 3e0a 3c70 its size.

.

As a security m │ │ │ -000e2e80: 6561 7375 7265 2074 6f20 6176 6f69 6420 easure to avoid │ │ │ -000e2e90: 6465 6e69 616c 206f 6620 7365 7276 6963 denial of servic │ │ │ -000e2ea0: 6520 6174 7461 636b 7320 6261 7365 6420 e attacks based │ │ │ -000e2eb0: 6f6e 2073 656e 6469 6e67 2061 2068 7567 on sending a hug │ │ │ -000e2ec0: 6520 6172 7261 7920 7369 7a65 2076 616c e array size val │ │ │ -000e2ed0: 7565 2075 7369 6e67 2074 6865 203c 656d ue using the SOAP-ENC: │ │ │ -000e2ef0: 6172 7261 7954 7970 653c 2f63 6f64 653e arrayType │ │ │ -000e2f00: 3c2f 656d 3e20 6174 7472 6962 7574 652c attribute, │ │ │ -000e2f10: 2072 6571 7569 7269 6e67 2074 6865 2061 requiring the a │ │ │ -000e2f20: 6c6c 6f63 6174 696f 6e20 6f66 206c 6172 llocation of lar │ │ │ -000e2f30: 6765 2063 6875 6e6b 7320 6f66 206d 656d ge chunks of mem │ │ │ -000e2f40: 6f72 792c 2074 6865 2074 6f74 616c 206e ory, the total n │ │ │ -000e2f50: 756d 6265 7220 6f66 2061 7272 6179 2065 umber of array e │ │ │ -000e2f60: 6c65 6d65 6e74 7320 7365 7420 6279 2074 lements set by t │ │ │ -000e2f70: 6865 203c 656d 3e3c 636f 6465 3e53 4f41 he SOA │ │ │ -000e2f80: 502d 454e 433a 6172 7261 7954 7970 653c P-ENC:arrayType< │ │ │ -000e2f90: 2f63 6f64 653e 3c2f 656d 3e20 6174 7472 /code> attr │ │ │ -000e2fa0: 6962 7574 6520 6361 6e6e 6f74 2065 7863 ibute cannot exc │ │ │ -000e2fb0: 6565 6420 3c63 6f64 653e 2353 4f41 505f eed #SOAP_ │ │ │ -000e2fc0: 4d41 5841 5252 4159 5349 5a45 3c2f 636f MAXARRAYSIZE, which is se │ │ │ -000e2fe0: 7420 746f 2031 3030 3030 3020 6279 2064 t to 100000 by d │ │ │ -000e2ff0: 6566 6175 6c74 2e20 5468 6973 206c 696d efault. This lim │ │ │ -000e3000: 6974 2069 7320 6e6f 7420 6120 6861 7264 it is not a hard │ │ │ -000e3010: 206c 696d 6974 206f 6e20 7468 6520 6e75 limit on the nu │ │ │ -000e3020: 6d62 6572 206f 6620 6172 7261 7920 656c mber of array el │ │ │ -000e3030: 656d 656e 7473 2c20 6275 7420 7261 7468 ements, but rath │ │ │ -000e3040: 6572 2074 6f20 6176 6f69 6420 7072 652d er to avoid pre- │ │ │ -000e3050: 616c 6c6f 6361 7469 6e67 206c 6172 6765 allocating large │ │ │ -000e3060: 2061 7272 6179 7320 6173 2073 7461 7465 arrays as state │ │ │ -000e3070: 642e 2054 6865 2068 6172 6420 6c69 6d69 d. The hard limi │ │ │ -000e3080: 7420 6f6e 2074 6865 206e 756d 6265 7220 t on the number │ │ │ -000e3090: 6f66 2061 7272 6179 2065 6c65 6d65 6e74 of array element │ │ │ -000e30a0: 7320 7265 6365 6976 6564 2069 7320 3c63 s received is soap │ │ │ -000e3170: 3a3a 6d61 786f 6363 7572 733c 2f61 3e3c ::maxoccurs< │ │ │ -000e3180: 2f63 6f64 653e 2077 6869 6368 2069 7320 /code> which is │ │ │ -000e3190: 7365 7420 746f 203c 636f 6465 3e23 534f set to #SO │ │ │ -000e31a0: 4150 5f4d 4158 4f43 4355 5253 3c2f 636f AP_MAXOCCURS by default. │ │ │ -000e31c0: 4279 2063 6f6e 7472 6173 742c 2074 6865 By contrast, the │ │ │ -000e31d0: 203c 636f 6465 3e23 534f 4150 5f4d 4158 #SOAP_MAX │ │ │ -000e31e0: 4152 5241 5953 495a 453c 2f63 6f64 653e ARRAYSIZE │ │ │ -000e31f0: 206c 696d 6974 206f 6e6c 7920 6e65 6761 limit only nega │ │ │ -000e3200: 7469 7665 6c79 2061 6666 6563 7473 206d tively affects m │ │ │ -000e3210: 756c 7469 2d64 696d 656e 7369 6f6e 616c ulti-dimensional │ │ │ -000e3220: 2061 7272 6179 7320 6265 6361 7573 6520 arrays because │ │ │ -000e3230: 7468 6520 6469 6d65 6e73 696f 6e61 6c69 the dimensionali │ │ │ -000e3240: 7479 206f 6620 7468 6520 7265 6365 6976 ty of the receiv │ │ │ -000e3250: 696e 6720 6172 7261 7920 6d61 7920 6265 ing array may be │ │ │ -000e3260: 206c 6f73 7420 7768 656e 2074 6865 206e lost when the n │ │ │ -000e3270: 756d 6265 7220 6f66 2065 6c65 6d65 6e74 umber of element │ │ │ -000e3280: 7320 6578 6365 6564 7320 3130 3030 3030 s exceeds 100000 │ │ │ -000e3290: 2e20 4f6e 652d 6469 6d65 6e73 696f 6e61 . One-dimensiona │ │ │ -000e32a0: 6c20 6172 7261 7973 2061 7265 206e 6f74 l arrays are not │ │ │ -000e32b0: 2061 6666 6563 7465 6420 616e 6420 706f affected and po │ │ │ -000e32c0: 7075 6c61 7465 6420 6166 7465 7220 7468 pulated after th │ │ │ -000e32d0: 6973 206c 696d 6974 2062 7920 7369 6d70 is limit by simp │ │ │ -000e32e0: 6c79 2064 6573 6572 6961 6c69 7a69 6e67 ly deserializing │ │ │ -000e32f0: 2074 6865 2061 7272 6179 2065 6c65 6d65 the array eleme │ │ │ -000e3300: 6e74 7320 7265 6365 6976 6564 2e3c 2f70 nts received.

.

.... Back to ta │ │ │ -000e3330: 626c 6520 6f66 2063 6f6e 7465 6e74 733c ble of contents< │ │ │ -000e3340: 2f61 3e3c 2f70 3e0a 3c68 333e 3c61 2063 /a>

.

.One │ │ │ -000e3370: 2d64 696d 656e 7369 6f6e 616c 2064 796e -dimensional dyn │ │ │ -000e3380: 616d 6963 2053 4f41 502d 656e 636f 6465 amic SOAP-encode │ │ │ -000e3390: 6420 6172 7261 7973 3c2f 6833 3e0a 3c70 d arrays

.

A special form │ │ │ -000e33b0: 6f66 2073 7472 7563 7420 6f72 2063 6c61 of struct or cla │ │ │ -000e33c0: 7373 2069 7320 7573 6564 2074 6f20 6465 ss is used to de │ │ │ -000e33d0: 6669 6e65 206f 6e65 2d64 696d 656e 7369 fine one-dimensi │ │ │ -000e33e0: 6f6e 616c 2064 796e 616d 6963 2053 4f41 onal dynamic SOA │ │ │ -000e33f0: 502d 656e 636f 6465 6420 6172 7261 7973 P-encoded arrays │ │ │ -000e3400: 2069 6e20 616e 2069 6e74 6572 6661 6365 in an interface │ │ │ -000e3410: 2068 6561 6465 7220 6669 6c65 2066 6f72 header file for │ │ │ -000e3420: 2073 6f61 7063 7070 322e 2045 6163 6820 soapcpp2. Each │ │ │ -000e3430: 6172 7261 7920 6861 7320 6120 706f 696e array has a poin │ │ │ -000e3440: 7465 7220 7661 7269 6162 6c65 2061 6e64 ter variable and │ │ │ -000e3450: 2061 206d 656d 6265 7220 7468 6174 2072 a member that r │ │ │ -000e3460: 6563 6f72 6473 2074 6865 206e 756d 6265 ecords the numbe │ │ │ -000e3470: 7220 6f66 2065 6c65 6d65 6e74 7320 7468 r of elements th │ │ │ -000e3480: 6520 706f 696e 7465 7220 706f 696e 7473 e pointer points │ │ │ -000e3490: 2074 6f20 696e 206d 656d 6f72 792e 3c2f to in memory..

The genera │ │ │ -000e34b0: 6c20 666f 726d 206f 6620 7468 6520 7374 l form of the st │ │ │ -000e34c0: 7275 6374 206f 7220 636c 6173 7320 6465 ruct or class de │ │ │ -000e34d0: 636c 6172 6174 696f 6e20 7468 6174 2063 claration that c │ │ │ -000e34e0: 6f6e 7461 696e 7320 6120 6f6e 652d 6469 ontains a one-di │ │ │ -000e34f0: 6d65 6e73 696f 6e61 6c20 6479 6e61 6d69 mensional dynami │ │ │ -000e3500: 6320 534f 4150 2d65 6e63 6f64 6564 2061 c SOAP-encoded a │ │ │ -000e3510: 7272 6179 2069 733a 3c2f 703e 0a3c 6469 rray is:

.
struc │ │ │ -000e3560: 7420 3c2f 7370 616e 3e61 7272 6179 5f6e t array_n │ │ │ -000e3570: 616d 6520 3c2f 6469 763e 0a3c 6469 7620 ame
.
{.
Type │ │ │ -000e35b0: 2a5f 5f70 7472 3b20 203c 7370 616e 2063 *__ptr; / │ │ │ -000e35d0: 2f20 706f 696e 7465 7220 746f 2061 7272 / pointer to arr │ │ │ -000e35e0: 6179 206f 6620 656c 656d 656e 7473 2069 ay of elements i │ │ │ -000e35f0: 6e20 6d65 6d6f 7279 3c2f 7370 616e 3e3c n memory< │ │ │ -000e3600: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
int │ │ │ -000e3640: 205f 5f73 697a 653b 2020 203c 7370 616e __size; // number of el │ │ │ -000e3670: 656d 656e 7473 2070 6f69 6e74 6564 2074 ements pointed t │ │ │ -000e3680: 6f20 3c2f 7370 616e 3e3c 2f64 6976 3e0a o
. │ │ │ -000e3690: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
│ │ │ -000e36c0: 696e 743c 2f73 7061 6e3e 205f 5f6f 6666 int __off │ │ │ -000e36d0: 7365 743b 203c 7370 616e 2063 6c61 7373 set; // op │ │ │ -000e36f0: 7469 6f6e 616c 2053 4f41 5020 312e 3120 tional SOAP 1.1 │ │ │ -000e3700: 6172 7261 7920 6f66 6673 6574 3c2f 7370 array offset
.
│ │ │ -000e3730: 2e2e 2e20 2020 2020 2020 2020 2020 3c73 ... // anything │ │ │ -000e3760: 7468 6174 2066 6f6c 6c6f 7773 2068 6572 that follows her │ │ │ -000e3770: 6520 7769 6c6c 2062 6520 6967 6e6f 7265 e will be ignore │ │ │ -000e3780: 6420 3c2f 7370 616e 3e3c 2f64 6976 3e0a d
. │ │ │ -000e3790: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
};
.

The i │ │ │ -000e43b0: 6d70 6c65 6d65 6e74 6174 696f 6e73 206f mplementations o │ │ │ -000e43c0: 6620 7468 6520 3c63 6f64 653e 5665 6374 f the Vect │ │ │ -000e43d0: 6f72 3c2f 636f 6465 3e20 6d65 7468 6f64 or method │ │ │ -000e43e0: 7320 6172 653a 3c2f 703e 0a3c 6469 7620 s are:

.
Vector::Vecto │ │ │ -000e4420: 7228 293c 2f64 6976 3e0a 3c64 6976 2063 r()
.
{.
this-> │ │ │ -000e4460: 3b73 6f61 705f 6465 6661 756c 7428 4e55 ;soap_default(NU │ │ │ -000e4470: 4c4c 293b 3c2f 6469 763e 0a3c 6469 7620 LL);
.
}.
Vector::V │ │ │ -000e44b0: 6563 746f 7228 3c73 7061 6e20 636c 6173 ector(stru │ │ │ -000e44d0: 6374 3c2f 7370 616e 3e20 3c61 2063 6c61 ct soap *soap, int │ │ │ -000e4560: 206e 2920 3c2f 6469 763e 0a3c 6469 7620 n)
.
{.
this-&g │ │ │ -000e45a0: 743b 736f 6170 203d 203c 6120 636c 6173 t;soap = soap;
.
__ptr = so │ │ │ -000e4620: 6170 5f6e 6577 5f66 6c6f 6174 283c 6120 ap_new_float(soap, n) │ │ │ -000e4660: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
__s │ │ │ -000e4680: 697a 6520 3d20 6e3b 203c 2f64 6976 3e0a ize = n;
. │ │ │ -000e4690: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
__offset = 1 │ │ │ -000e46b0: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
} .
│ │ │ -000e4700: 666c 6f61 743c 2f73 7061 6e3e 2661 6d70 float& │ │ │ -000e4710: 3b20 5665 6374 6f72 3a3a 6f70 6572 6174 ; Vector::operat │ │ │ -000e4720: 6f72 5b5d 283c 7370 616e 2063 6c61 7373 or[](i │ │ │ -000e4740: 6e74 3c2f 7370 616e 3e20 6929 203c 2f64 nt i) .
{
. │ │ │ -000e4780: 2020 3c73 7061 6e20 636c 6173 733d 226b retu │ │ │ -000e47a0: 726e 3c2f 7370 616e 3e20 5f5f 7074 725b rn __ptr[ │ │ │ -000e47b0: 6920 2d20 5f5f 6f66 6673 6574 5d3b 203c i - __offset]; < │ │ │ -000e47c0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
}
. │ │ │ -000e47e0: 3c2f 6469 763e 3c21 2d2d 2066 7261 676d

An exa │ │ │ -000e4800: 6d70 6c65 2070 726f 6772 616d 2066 7261 mple program fra │ │ │ -000e4810: 676d 656e 7420 7468 6174 2073 6572 6961 gment that seria │ │ │ -000e4820: 6c69 7a65 7320 6120 7665 6374 6f72 206f lizes a vector o │ │ │ -000e4830: 6620 3320 656c 656d 656e 7473 3a3c 2f70 f 3 elements:

.
│ │ │ -000e4880: 7374 7275 6374 203c 2f73 7061 6e3e 3c61 struct soap *< │ │ │ -000e48c0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -000e48d0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ -000e48e0: 6874 6d6c 223e 736f 6170 3c2f 613e 203d html">soap = │ │ │ -000e48f0: 203c 6120 636c 6173 733d 2263 6f64 6522 soap_new();
.V │ │ │ -000e4970: 6563 746f 7220 7628 3c61 2063 6c61 7373 ector v(s │ │ │ -000e49a0: 6f61 703c 2f61 3e2c 2033 293b 3c2f 6469 oap, 3);.
v[1] = 1.0; │ │ │ -000e49d0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
v[2] = │ │ │ -000e49f0: 2032 2e30 3b20 3c2f 6469 763e 0a3c 6469 2.0;
.v │ │ │ -000e4a10: 5b33 5d20 3d20 332e 303b 203c 2f64 6976 [3] = 3.0;
.
soap_write_V │ │ │ -000e4a40: 6563 746f 7228 3c61 2063 6c61 7373 3d22 ector(soa │ │ │ -000e4a70: 703c 2f61 3e2c 2026 616d 703b 7629 3b3c p, &v);< │ │ │ -000e4a80: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
soa │ │ │ -000e4af0: 705f 6465 7374 726f 793c 2f61 3e28 3c61 p_destroy(soap);< │ │ │ -000e4b30: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>...< │ │ │ -000e4c90: 2f64 6976 3e3c 212d 2d20 6672 6167 6d65 /div>

The out │ │ │ -000e4cb0: 7075 7420 6973 2061 2070 6172 7469 616c put is a partial │ │ │ -000e4cc0: 6c79 2074 7261 6e73 6d69 7474 6564 2061 ly transmitted a │ │ │ -000e4cd0: 7272 6179 3a3c 2f70 3e0a 3c64 6976 2063 rray:

.
<SOAP-ENC:Array │ │ │ -000e4d40: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c SO │ │ │ -000e4d60: 4150 2d45 4e43 3a61 7272 6179 5479 7065 AP-ENC:arrayType │ │ │ -000e4d70: 3c2f 7370 616e 3e3d 3c73 7061 6e20 636c ="xsd:fl │ │ │ -000e4da0: 6f61 745b 345d 2671 756f 743b 3c2f 7370 oat[4]" SOAP-E │ │ │ -000e4dd0: 4e43 3a6f 6666 7365 743c 2f73 7061 6e3e NC:offset │ │ │ -000e4de0: 3d3c 7370 616e 2063 6c61 7373 3d22 7374 =&qu │ │ │ -000e4e00: 6f74 3b5b 315d 2671 756f 743b 3c2f 7370 ot;[1]">
.< │ │ │ -000e4e20: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -000e4e30: 3e20 2026 6c74 3b3c 7370 616e 2063 6c61 > <item> │ │ │ -000e4e60: 3126 6c74 3b2f 3c73 7061 6e20 636c 6173 1</ │ │ │ -000e4e80: 6974 656d 3c2f 7370 616e 3e26 6774 3b20 item> │ │ │ -000e4e90: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
<< │ │ │ -000e4eb0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -000e4ec0: 6f72 6474 7970 6522 3e69 7465 6d3c 2f73 ordtype">item>2</item>
.< │ │ │ -000e4f10: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -000e4f20: 3e20 2026 6c74 3b3c 7370 616e 2063 6c61 > <item> │ │ │ -000e4f50: 3326 6c74 3b2f 3c73 7061 6e20 636c 6173 3</ │ │ │ -000e4f70: 6974 656d 3c2f 7370 616e 3e26 6774 3b20 item> │ │ │ -000e4f80: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
</SOAP-ENC │ │ │ -000e4fc0: 3a41 7272 6179 3c2f 7370 616e 3e26 6774 :Array> │ │ │ -000e4fd0: 3b3c 2f64 6976 3e0a 3c2f 6469 763e 3c21 ;
.
│ │ │ -000e4ff0: 3c2f 6469 763e 3c70 3e4e 6f74 6520 7468

Note th │ │ │ -000e5000: 6174 203c 656d 3e3c 636f 6465 3e78 7364 at xsd │ │ │ -000e5010: 3a66 6c6f 6174 5b34 5d3c 2f63 6f64 653e :float[4] │ │ │ -000e5020: 3c2f 656d 3e20 6973 2074 6865 2074 7970 is the typ │ │ │ -000e5030: 6520 616e 6420 7368 6170 6520 6f66 2074 e and shape of t │ │ │ -000e5040: 6865 2065 6e63 6f64 6564 2061 7272 6179 he encoded array │ │ │ -000e5050: 2c20 7768 6963 6820 7374 6172 7473 2061 , which starts a │ │ │ -000e5060: 7420 6f66 6673 6574 2031 2061 6e64 2074 t offset 1 and t │ │ │ -000e5070: 6865 7265 666f 7265 2074 6865 2065 6c65 herefore the ele │ │ │ -000e5080: 6d65 6e74 2061 7420 3020 6973 206f 6d69 ment at 0 is omi │ │ │ -000e5090: 7474 6564 2e3c 2f70 3e0a 3c70 3ef0 9f94 tted.

.

... │ │ │ -000e50a0: 9d20 3c61 2068 7265 663d 2223 223e 4261 . Ba │ │ │ -000e50b0: 636b 2074 6f20 7461 626c 6520 6f66 2063 ck to table of c │ │ │ -000e50c0: 6f6e 7465 6e74 733c 2f61 3e3c 2f70 3e0a ontents

. │ │ │ -000e50d0: 3c68 333e 3c61 2063 6c61 7373 3d22 616e

.Nested on │ │ │ -000e5100: 652d 6469 6d65 6e73 696f 6e61 6c20 6479 e-dimensional dy │ │ │ -000e5110: 6e61 6d69 6320 534f 4150 2d65 6e63 6f64 namic SOAP-encod │ │ │ -000e5120: 6564 2061 7272 6179 733c 2f68 333e 0a3c ed arrays

.< │ │ │ -000e5130: 703e 4f6e 652d 6469 6d65 6e73 696f 6e61 p>One-dimensiona │ │ │ -000e5140: 6c20 534f 4150 2d65 6e63 6f64 6564 2064 l SOAP-encoded d │ │ │ -000e5150: 796e 616d 6963 2061 7272 6179 7320 6d61 ynamic arrays ma │ │ │ -000e5160: 7920 6265 206e 6573 7465 642e 2046 6f72 y be nested. For │ │ │ -000e5170: 2065 7861 6d70 6c65 2c20 7573 696e 6720 example, using │ │ │ -000e5180: 3c63 6f64 653e 636c 6173 7320 5665 6374 class Vect │ │ │ -000e5190: 6f72 3c2f 636f 6465 3e20 6465 636c 6172 or declar │ │ │ -000e51a0: 6564 2069 6e20 7468 6520 7072 6576 696f ed in the previo │ │ │ -000e51b0: 7573 2073 6563 7469 6f6e 2c20 3c63 6f64 us section, class Matrix is declare │ │ │ -000e51e0: 643a 3c2f 703e 0a3c 6469 7620 636c 6173 d:

.
< │ │ │ -000e5210: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ -000e5220: 656e 7422 3e2f 2f20 436f 6e74 656e 7473 ent">// Contents │ │ │ -000e5230: 206f 6620 6669 6c65 2026 7175 6f74 3b6d of file "m │ │ │ -000e5240: 6174 7269 782e 6826 7175 6f74 3b3a 203c atrix.h": < │ │ │ -000e5250: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
.< │ │ │ -000e5270: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -000e5280: 6f72 6422 3e63 6c61 7373 203c 2f73 7061 ord">class Matrix
. │ │ │ -000e52a0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
{ public │ │ │ -000e52d0: 3c2f 7370 616e 3e3a 203c 2f64 6976 3e0a :
. │ │ │ -000e52e0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
Vector *__ │ │ │ -000e5300: 7074 723b 203c 2f64 6976 3e0a 3c64 6976 ptr;
.
│ │ │ -000e5320: 2020 3c73 7061 6e20 636c 6173 733d 226b int< │ │ │ -000e5340: 2f73 7061 6e3e 205f 5f73 697a 653b 203c /span> __size; < │ │ │ -000e5350: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
int │ │ │ -000e5390: 205f 5f6f 6666 7365 743b 203c 2f64 6976 __offset;
.
Matrix() │ │ │ -000e53c0: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
M │ │ │ -000e53e0: 6174 7269 7828 3c73 7061 6e20 636c 6173 atrix(stru │ │ │ -000e5400: 6374 3c2f 7370 616e 3e20 3c61 2063 6c61 ct soap *soap, int │ │ │ -000e5490: 206e 2c20 3c73 7061 6e20 636c 6173 733d n, in │ │ │ -000e54b0: 743c 2f73 7061 6e3e 206d 293b 203c 2f64 t m); .
Vector │ │ │ -000e54e0: 2661 6d70 3b20 6f70 6572 6174 6f72 5b5d & operator[] │ │ │ -000e54f0: 283c 7370 616e 2063 6c61 7373 3d22 6b65 (int i);
│ │ │ -000e5520: 0a3c 6469 7620 636c 6173 733d 226c 696e .
str │ │ │ -000e5550: 7563 7420 3c2f 7370 616e 3e3c 6120 636c uct soap *soap;.
};
│ │ │ -000e5600: 0a3c 2f64 6976 3e3c 212d 2d20 6672 6167 .

The M │ │ │ -000e5620: 6174 7269 7820 7479 7065 2069 7320 6573 atrix type is es │ │ │ -000e5630: 7365 6e74 6961 6c6c 7920 616e 2061 7272 sentially an arr │ │ │ -000e5640: 6179 206f 6620 706f 696e 7465 7273 2074 ay of pointers t │ │ │ -000e5650: 6f20 6172 7261 7973 2077 6869 6368 206d o arrays which m │ │ │ -000e5660: 616b 6520 7570 2074 6865 2072 6f77 7320 ake up the rows │ │ │ -000e5670: 6f66 2061 206d 6174 7269 782e 2054 6865 of a matrix. The │ │ │ -000e5680: 2073 6572 6961 6c69 7a61 7469 6f6e 206f serialization o │ │ │ -000e5690: 6620 7468 6520 7477 6f2d 6469 6d65 6e73 f the two-dimens │ │ │ -000e56a0: 696f 6e61 6c20 6479 6e61 6d69 6320 6172 ional dynamic ar │ │ │ -000e56b0: 7261 7920 696e 2069 7320 6e65 7374 6564 ray in is nested │ │ │ -000e56c0: 2066 6f72 6d20 696e 2058 4d4c 2e3c 2f70 form in XML.

.

.... Back to ta │ │ │ -000e56f0: 626c 6520 6f66 2063 6f6e 7465 6e74 733c ble of contents< │ │ │ -000e5700: 2f61 3e3c 2f70 3e0a 3c68 333e 3c61 2063 /a>

.

.M │ │ │ -000e5730: 756c 7469 2d64 696d 656e 7369 6f6e 616c ulti-dimensional │ │ │ -000e5740: 2064 796e 616d 6963 2053 4f41 502d 656e dynamic SOAP-en │ │ │ -000e5750: 636f 6465 6420 6172 7261 7973 3c2f 6833 coded arrays

.

A special f │ │ │ -000e5770: 6f72 6d20 6f66 203c 636f 6465 3e73 7472 orm of str │ │ │ -000e5780: 7563 743c 2f63 6f64 653e 206f 7220 3c63 uct or class │ │ │ -000e57a0: 2069 7320 7573 6564 2074 6f20 6465 6669 is used to defi │ │ │ -000e57b0: 6e65 206d 756c 7469 2d64 696d 656e 7369 ne multi-dimensi │ │ │ -000e57c0: 6f6e 616c 2064 796e 616d 6963 2053 4f41 onal dynamic SOA │ │ │ -000e57d0: 502d 656e 636f 6465 6420 6172 7261 7973 P-encoded arrays │ │ │ -000e57e0: 2e20 4561 6368 2061 7272 6179 2068 6173 . Each array has │ │ │ -000e57f0: 2061 2070 6f69 6e74 6572 2076 6172 6961 a pointer varia │ │ │ -000e5800: 626c 6520 616e 6420 6120 6d65 6d62 6572 ble and a member │ │ │ -000e5810: 2074 6861 7420 7265 636f 7264 7320 7468 that records th │ │ │ -000e5820: 6520 6e75 6d62 6572 206f 6620 656c 656d e number of elem │ │ │ -000e5830: 656e 7473 2070 6572 2064 696d 656e 7369 ents per dimensi │ │ │ -000e5840: 6f6e 2e20 4120 3c63 6f64 653e 4b3c 2f63 on. A K-dimensional │ │ │ -000e5860: 2061 7272 6179 2069 7320 6465 636c 6172 array is declar │ │ │ -000e5870: 6564 2061 733a 3c2f 703e 0a3c 6469 7620 ed as:

.
struct │ │ │ -000e58c0: 3c2f 7370 616e 3e61 7272 6179 5f6e 616d array_nam │ │ │ -000e58d0: 6520 3c2f 6469 763e 0a3c 6469 7620 636c e
.
{.
Type *_ │ │ │ -000e5910: 5f70 7472 3b20 2020 2020 3c73 7061 6e20 _ptr; │ │ │ -000e5930: 2f2f 2070 6f69 6e74 6572 2074 6f20 6172 // pointer to ar │ │ │ -000e5940: 7261 7920 6f66 2065 6c65 6d65 6e74 7320 ray of elements │ │ │ -000e5950: 696e 206d 656d 6f72 793c 2f73 7061 6e3e in memory │ │ │ -000e5960: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
int __size[K]; < │ │ │ -000e59b0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ -000e59c0: 656e 7422 3e2f 2f20 6e75 6d62 6572 206f ent">// number o │ │ │ -000e59d0: 6620 656c 656d 656e 7473 2070 6572 2064 f elements per d │ │ │ -000e59e0: 696d 656e 7369 6f6e 3c2f 7370 616e 3e3c imension< │ │ │ -000e59f0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
int │ │ │ -000e5a30: 205f 5f6f 6666 7365 745b 4b5d 3b20 3c73 __offset[K]; // optional │ │ │ -000e5a60: 534f 4150 2031 2e31 2061 7272 6179 206f SOAP 1.1 array o │ │ │ -000e5a70: 6666 7365 743c 2f73 7061 6e3e 3c2f 6469 ffset.
... │ │ │ -000e5aa0: 2020 2020 2020 2020 2020 3c73 7061 6e20 │ │ │ -000e5ac0: 2f2f 2061 6e79 7468 696e 6720 7468 6174 // anything that │ │ │ -000e5ad0: 2066 6f6c 6c6f 7773 2068 6572 6520 7769 follows here wi │ │ │ -000e5ae0: 6c6c 2062 6520 6967 6e6f 7265 6420 3c2f ll be ignored
.
}; │ │ │ -000e5b10: 3c2f 6469 763e 0a3c 2f64 6976 3e3c 212d
.

where the array_name must be a non │ │ │ -000e5b60: 2d71 7561 6c69 6669 6564 206e 616d 6520 -qualified name │ │ │ -000e5b70: 616e 6420 3c63 6f64 653e 5479 7065 3c2f and Type is the typ │ │ │ -000e5b90: 6520 666f 7220 7468 6520 656c 656d 656e e for the elemen │ │ │ -000e5ba0: 7473 206f 6620 7468 6520 6172 7261 792e ts of the array. │ │ │ -000e5bb0: 2054 6865 203c 636f 6465 3e5f 5f70 7472 The __ptr │ │ │ -000e5bc0: 3c2f 636f 6465 3e20 6d65 6d62 6572 2070 member p │ │ │ -000e5bd0: 6f69 6e74 7320 746f 2074 6865 2061 7272 oints to the arr │ │ │ -000e5be0: 6179 2076 616c 7565 732e 2054 6865 203c ay values. The < │ │ │ -000e5bf0: 636f 6465 3e5f 5f73 697a 653c 2f63 6f64 code>__size array specifi │ │ │ -000e5c10: 6573 2074 6865 206e 756d 6265 7220 6f66 es the number of │ │ │ -000e5c20: 2061 7272 6179 2065 6c65 6d65 6e74 7320 array elements │ │ │ -000e5c30: 7065 7220 6469 6d65 6e73 696f 6e2e 2054 per dimension. T │ │ │ -000e5c40: 6865 203c 636f 6465 3e5f 5f6f 6666 7365 he __offse │ │ │ -000e5c50: 743c 2f63 6f64 653e 2061 7272 6179 2073 t array s │ │ │ -000e5c60: 7065 6369 6669 6573 2061 6e20 6f70 7469 pecifies an opti │ │ │ -000e5c70: 6f6e 616c 206f 6666 7365 7420 7065 7220 onal offset per │ │ │ -000e5c80: 6469 6d65 6e73 696f 6e2e 3c2f 703e 0a3c dimension.

.< │ │ │ -000e5c90: 703e 466f 7220 6578 616d 706c 652c 2074 p>For example, t │ │ │ -000e5ca0: 6865 2066 6f6c 6c6f 7769 6e67 2064 6563 he following dec │ │ │ -000e5cb0: 6c61 7261 7469 6f6e 2073 7065 6369 6669 laration specifi │ │ │ -000e5cc0: 6573 2061 206d 6174 7269 7820 636c 6173 es a matrix clas │ │ │ -000e5cd0: 733a 3c2f 703e 0a3c 6469 7620 636c 6173 s:

.
< │ │ │ -000e5d00: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -000e5d10: 6f72 6422 3e63 6c61 7373 203c 2f73 7061 ord">class Matrix
. │ │ │ -000e5d30: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
{ public │ │ │ -000e5d60: 3c2f 7370 616e 3e3a 203c 2f64 6976 3e0a :
. │ │ │ -000e5d70: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
│ │ │ -000e5da0: 666c 6f61 743c 2f73 7061 6e3e 202a 5f5f float *__ │ │ │ -000e5db0: 7074 723b 203c 2f64 6976 3e0a 3c64 6976 ptr;
.
│ │ │ -000e5dd0: 2020 3c73 7061 6e20 636c 6173 733d 226b int< │ │ │ -000e5df0: 2f73 7061 6e3e 205f 5f73 697a 655b 325d /span> __size[2] │ │ │ -000e5e00: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
< │ │ │ -000e5e20: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -000e5e30: 6f72 6474 7970 6522 3e69 6e74 3c2f 7370 ordtype">int __offset[2]; │ │ │ -000e5e50: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
}; .

By │ │ │ -000e5e90: 2063 6f6e 7472 6173 7420 746f 2074 6865 contrast to the │ │ │ -000e5ea0: 206d 6174 7269 7820 636c 6173 7320 6f66 matrix class of │ │ │ -000e5eb0: 2053 6563 7469 6f6e 203c 6120 636c 6173 Section │ │ │ -000e5ee0: 4e65 7374 6564 206f 6e65 2d64 696d 656e Nested one-dimen │ │ │ -000e5ef0: 7369 6f6e 616c 2064 796e 616d 6963 2053 sional dynamic S │ │ │ -000e5f00: 4f41 502d 656e 636f 6465 6420 6172 7261 OAP-encoded arra │ │ │ -000e5f10: 7973 3c2f 613e 2074 6861 7420 6465 6669 ys that defi │ │ │ -000e5f20: 6e65 7320 6120 6d61 7472 6978 2061 7320 nes a matrix as │ │ │ -000e5f30: 616e 2061 7272 6179 206f 6620 706f 696e an array of poin │ │ │ -000e5f40: 7465 7273 2074 6f20 6d61 7472 6978 2072 ters to matrix r │ │ │ -000e5f50: 6f77 732c 2074 6869 7320 636c 6173 7320 ows, this class │ │ │ -000e5f60: 6861 7320 6f6e 6520 706f 696e 7465 7220 has one pointer │ │ │ -000e5f70: 746f 2061 206d 6174 7269 7820 7374 6f72 to a matrix stor │ │ │ -000e5f80: 6564 2069 6e20 726f 772d 6d61 6a6f 7220 ed in row-major │ │ │ -000e5f90: 6f72 6465 722e 2054 6865 2073 697a 6520 order. The size │ │ │ -000e5fa0: 6f66 2074 6865 206d 6174 7269 7820 6973 of the matrix is │ │ │ -000e5fb0: 2064 6574 6572 6d69 6e65 6420 6279 2074 determined by t │ │ │ -000e5fc0: 6865 203c 636f 6465 3e5f 5f73 697a 653c he __size< │ │ │ -000e5fd0: 2f63 6f64 653e 206d 656d 6265 723a 203c /code> member: < │ │ │ -000e5fe0: 636f 6465 3e5f 5f73 697a 655b 305d 3c2f code>__size[0] holds the │ │ │ -000e6000: 6e75 6d62 6572 206f 6620 726f 7773 2061 number of rows a │ │ │ -000e6010: 6e64 203c 636f 6465 3e5f 5f73 697a 655b nd __size[ │ │ │ -000e6020: 315d 3c2f 636f 6465 3e20 686f 6c64 7320 1] holds │ │ │ -000e6030: 7468 6520 6e75 6d62 6572 206f 6620 636f the number of co │ │ │ -000e6040: 6c75 6d6e 7320 6f66 2074 6865 206d 6174 lumns of the mat │ │ │ -000e6050: 7269 782e 204c 696b 6577 6973 652c 203c rix. Likewise, < │ │ │ -000e6060: 636f 6465 3e5f 5f6f 6666 7365 745b 305d code>__offset[0] │ │ │ -000e6070: 3c2f 636f 6465 3e20 6973 2074 6865 2072 is the r │ │ │ -000e6080: 6f77 206f 6666 7365 7420 616e 6420 3c63 ow offset and __offset[1]< │ │ │ -000e60a0: 2f63 6f64 653e 2069 7320 7468 6520 636f /code> is the co │ │ │ -000e60b0: 6c75 6d6e 7320 6f66 6673 6574 2e3c 2f70 lumns offset.

.
WarningSOAP 1.2 does │ │ │ -000e6100: 6e6f 7420 7375 7070 6f72 7420 7061 7274 not support part │ │ │ -000e6110: 6961 6c6c 7920 7472 616e 736d 6974 7465 ially transmitte │ │ │ -000e6120: 6420 6172 7261 7973 2061 6e64 2074 6865 d arrays and the │ │ │ -000e6130: 203c 636f 6465 3e5f 5f6f 6666 7365 743c __offset< │ │ │ -000e6140: 2f63 6f64 653e 206d 656d 6265 7220 6f66 /code> member of │ │ │ -000e6150: 2061 2064 796e 616d 6963 2061 7272 6179 a dynamic array │ │ │ -000e6160: 2069 7320 6967 6e6f 7265 642e 3c2f 6464 is ignored.
.

.... < │ │ │ -000e6180: 6120 6872 6566 3d22 2322 3e42 6163 6b20 a href="#">Back │ │ │ -000e6190: 746f 2074 6162 6c65 206f 6620 636f 6e74 to table of cont │ │ │ -000e61a0: 656e 7473 3c2f 613e 3c2f 703e 0a3c 6833 ents

.

.Non-SOAP dynam │ │ │ -000e61e0: 6963 2061 7272 6179 733c 2f68 333e 0a3c ic arrays

.< │ │ │ -000e61f0: 703e 416e 2061 7272 6179 2069 7320 7365 p>An array is se │ │ │ -000e6200: 7269 616c 697a 6564 2061 7320 6120 7365 rialized as a se │ │ │ -000e6210: 7175 656e 6365 206f 6620 584d 4c20 656c quence of XML el │ │ │ -000e6220: 656d 656e 7473 2e20 4279 2063 6f6e 7472 ements. By contr │ │ │ -000e6230: 6173 742c 2061 2053 4f41 502d 656e 636f ast, a SOAP-enco │ │ │ -000e6240: 6465 6420 6172 7261 7920 6973 2073 6572 ded array is ser │ │ │ -000e6250: 6961 6c69 7a65 6420 6173 2061 6e20 656c ialized as an el │ │ │ -000e6260: 656d 656e 7420 7769 7468 2061 2073 6571 ement with a seq │ │ │ -000e6270: 7565 6e63 6520 6f66 2073 7562 2d65 6c65 uence of sub-ele │ │ │ -000e6280: 6d65 6e74 732c 2077 686f 7365 2074 6167 ments, whose tag │ │ │ -000e6290: 206e 616d 6573 2061 7265 2069 7272 656c names are irrel │ │ │ -000e62a0: 6576 616e 7420 746f 2074 6865 2053 4f41 evant to the SOA │ │ │ -000e62b0: 5020 7072 6f63 6573 736f 722c 2073 6565 P processor, see │ │ │ -000e62c0: 203c 6120 636c 6173 733d 2265 6c22 2068 One-dimens │ │ │ -000e62f0: 696f 6e61 6c20 6479 6e61 6d69 6320 534f ional dynamic SO │ │ │ -000e6300: 4150 2d65 6e63 6f64 6564 2061 7272 6179 AP-encoded array │ │ │ -000e6310: 733c 2f61 3e2e 3c2f 703e 0a3c 703e 416e s.

.

An │ │ │ -000e6320: 2061 7272 6179 2069 7320 6465 636c 6172 array is declar │ │ │ -000e6330: 6564 2069 6e20 616e 2069 6e74 6572 6661 ed in an interfa │ │ │ -000e6340: 6365 2068 6561 6465 7220 6669 6c65 2066 ce header file f │ │ │ -000e6350: 6f72 2073 6f61 7063 7070 3220 6173 2061 or soapcpp2 as a │ │ │ -000e6360: 2073 7472 7563 7420 6f72 2063 6c61 7373 struct or class │ │ │ -000e6370: 2077 6974 6820 6120 6e61 6d65 2074 6861 with a name tha │ │ │ -000e6380: 7420 6973 2071 7561 6c69 6669 6564 2077 t is qualified w │ │ │ -000e6390: 6974 6820 6120 6e61 6d65 7370 6163 6520 ith a namespace │ │ │ -000e63a0: 7072 6566 6978 2e20 5468 6572 6520 6172 prefix. There ar │ │ │ -000e63b0: 6520 7477 6f20 666f 726d 732e 2054 6865 e two forms. The │ │ │ -000e63c0: 2066 6972 7374 2066 6f72 6d20 6973 2073 first form is s │ │ │ -000e63d0: 696d 696c 6172 2074 6f20 7468 6520 534f imilar to the SO │ │ │ -000e63e0: 4150 2d65 6e63 6f64 6564 2061 7272 6179 AP-encoded array │ │ │ -000e63f0: 2064 6563 6c61 7261 7469 6f6e 2074 6861 declaration tha │ │ │ -000e6400: 7420 7772 6170 7320 7468 6520 3c63 6f64 t wraps the __ptr a │ │ │ -000e6420: 6e64 203c 636f 6465 3e5f 5f73 697a 653c nd __size< │ │ │ -000e6430: 2f63 6f64 653e 206d 656d 6265 7273 3a3c /code> members:< │ │ │ -000e6440: 2f70 3e0a 3c64 6976 2063 6c61 7373 3d22 /p>.

struct │ │ │ -000e6490: 7072 6566 6978 5f5f 6172 7261 795f 6e61 prefix__array_na │ │ │ -000e64a0: 6d65 203c 2f64 6976 3e0a 3c64 6976 2063 me
.
{.
Type * │ │ │ -000e64e0: 5f5f 7074 723b 2020 3c73 7061 6e20 636c __ptr; // │ │ │ -000e6500: 2070 6f69 6e74 6572 2074 6f20 6172 7261 pointer to arra │ │ │ -000e6510: 7920 6f66 2065 6c65 6d65 6e74 7320 696e y of elements in │ │ │ -000e6520: 206d 656d 6f72 793c 2f73 7061 6e3e 3c2f memory.
int │ │ │ -000e6570: 5f5f 7369 7a65 3b20 2020 3c73 7061 6e20 __size; │ │ │ -000e6590: 2f2f 206e 756d 6265 7220 6f66 2065 6c65 // number of ele │ │ │ -000e65a0: 6d65 6e74 7320 706f 696e 7465 6420 746f ments pointed to │ │ │ -000e65b0: 203c 2f73 7061 6e3e 3c2f 6469 763e 0a3c
.< │ │ │ -000e65c0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -000e65d0: 3e20 2020 202e 2e2e 2020 2020 2020 2020 > ... │ │ │ -000e65e0: 2020 203c 7370 616e 2063 6c61 7373 3d22 // anyt │ │ │ -000e6600: 6869 6e67 2074 6861 7420 666f 6c6c 6f77 hing that follow │ │ │ -000e6610: 7320 6865 7265 2077 696c 6c20 6265 2069 s here will be i │ │ │ -000e6620: 676e 6f72 6564 203c 2f73 7061 6e3e 3c2f gnored .
};
. │ │ │ -000e6650: 3c2f 6469 763e 3c21 2d2d 2066 7261 676d

The se │ │ │ -000e6670: 636f 6e64 2066 6f72 6d20 6973 206d 6f72 cond form is mor │ │ │ -000e6680: 6520 6765 6e65 7269 632c 2062 6563 6175 e generic, becau │ │ │ -000e6690: 7365 2074 6865 2061 7272 6179 2063 616e se the array can │ │ │ -000e66a0: 2062 6520 6465 636c 6172 6564 2061 6e79 be declared any │ │ │ -000e66b0: 7768 6572 6520 696e 2074 6865 2073 7472 where in the str │ │ │ -000e66c0: 7563 7420 6f72 2063 6c61 7373 2061 6e64 uct or class and │ │ │ -000e66d0: 206d 756c 7469 706c 6520 6172 7261 7973 multiple arrays │ │ │ -000e66e0: 2063 616e 2062 6520 7573 6564 2061 7320 can be used as │ │ │ -000e66f0: 6d65 6d62 6572 732c 2065 6163 6820 7769 members, each wi │ │ │ -000e6700: 7468 2061 203c 636f 6465 3e5f 5f73 697a th a __siz │ │ │ -000e6710: 653c 2f63 6f64 653e 206d 656d 6265 7220 e member │ │ │ -000e6720: 283c 636f 6465 3e5f 5f73 697a 654e 616d (__sizeNam │ │ │ -000e6730: 653c 2f63 6f64 653e 2069 7320 616c 736f e is also │ │ │ -000e6740: 2061 6c6c 6f77 6564 2920 7468 6174 2070 allowed) that p │ │ │ -000e6750: 7265 6365 6465 7320 6120 706f 696e 7465 recedes a pointe │ │ │ -000e6760: 7220 6d65 6d62 6572 3a3c 2f70 3e0a 3c64 r member:

.
stru │ │ │ -000e67b0: 6374 203c 2f73 7061 6e3e 7072 6566 6978 ct prefix │ │ │ -000e67c0: 5f5f 6172 7261 795f 6e61 6d65 203c 2f64 __array_name .
{
. │ │ │ -000e6800: 2020 2020 2e2e 2e20 2020 2020 2020 2020 ... │ │ │ -000e6810: 2020 2020 2020 2020 2020 3c73 7061 6e20 │ │ │ -000e6830: 2f2f 206f 7468 6572 206d 656d 6265 7273 // other members │ │ │ -000e6840: 2074 6861 7420 6172 6520 7365 7269 616c that are serial │ │ │ -000e6850: 697a 6564 3c2f 7370 616e 3e3c 2f64 6976 ized
.
int __s │ │ │ -000e68a0: 697a 655f 6f66 5f61 7272 6179 313b 203c ize_of_array1; < │ │ │ -000e68b0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ -000e68c0: 656e 7422 3e2f 2f20 6e75 6d62 6572 206f ent">// number o │ │ │ -000e68d0: 6620 656c 656d 656e 7473 2070 6f69 6e74 f elements point │ │ │ -000e68e0: 6564 2074 6f20 3c2f 7370 616e 3e3c 2f64 ed to .
Type1 │ │ │ -000e6910: 2a61 7272 6179 313b 2020 2020 2020 2020 *array1; │ │ │ -000e6920: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // pointer │ │ │ -000e6940: 2074 6f20 6172 7261 7920 6f66 2065 6c65 to array of ele │ │ │ -000e6950: 6d65 6e74 7320 696e 206d 656d 6f72 793c ments in memory< │ │ │ -000e6960: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
. │ │ │ -000e6980: 2020 202e 2e2e 2020 2020 2020 2020 2020 ... │ │ │ -000e6990: 2020 2020 2020 2020 203c 7370 616e 2063 / │ │ │ -000e69b0: 2f20 6f74 6865 7220 6d65 6d62 6572 7320 / other members │ │ │ -000e69c0: 7468 6174 2061 7265 2073 6572 6961 6c69 that are seriali │ │ │ -000e69d0: 7a65 643c 2f73 7061 6e3e 3c2f 6469 763e zed
│ │ │ -000e69e0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
int __si │ │ │ -000e6a20: 7a65 5f6f 665f 6172 7261 7931 3b20 3c73 ze_of_array1; // number of │ │ │ -000e6a50: 2065 6c65 6d65 6e74 7320 706f 696e 7465 elements pointe │ │ │ -000e6a60: 6420 746f 203c 2f73 7061 6e3e 3c2f 6469 d to .
Type2 * │ │ │ -000e6a90: 6172 7261 7932 3b20 2020 2020 2020 203c array2; < │ │ │ -000e6aa0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ -000e6ab0: 656e 7422 3e2f 2f20 706f 696e 7465 7220 ent">// pointer │ │ │ -000e6ac0: 746f 2061 7272 6179 206f 6620 656c 656d to array of elem │ │ │ -000e6ad0: 656e 7473 2069 6e20 6d65 6d6f 7279 3c2f ents in memory
.
│ │ │ -000e6b00: 2020 2e2e 2e20 2020 2020 2020 2020 2020 ... │ │ │ -000e6b10: 2020 2020 2020 2020 3c73 7061 6e20 636c // │ │ │ -000e6b30: 206f 7468 6572 206d 656d 6265 7273 2074 other members t │ │ │ -000e6b40: 6861 7420 6172 6520 7365 7269 616c 697a hat are serializ │ │ │ -000e6b50: 6564 3c2f 7370 616e 3e3c 2f64 6976 3e0a ed
. │ │ │ -000e6b60: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
};
.

Si │ │ │ -000e6ef0: 6e63 6520 322e 372e 3136 2069 7420 6973 nce 2.7.16 it is │ │ │ -000e6f00: 2061 6c73 6f20 706f 7373 6962 6c65 2074 also possible t │ │ │ -000e6f10: 6f20 7573 6520 6120 273c 636f 6465 3e24 o use a '$ │ │ │ -000e6f20: 3c2f 636f 6465 3e27 2061 7320 6120 7370 ' as a sp │ │ │ -000e6f30: 6563 6961 6c20 6d61 726b 6572 2074 6f20 ecial marker to │ │ │ -000e6f40: 616e 6e6f 7461 7465 2061 2073 697a 6520 annotate a size │ │ │ -000e6f50: 6d65 6d62 6572 2069 6e73 7465 6164 206f member instead o │ │ │ -000e6f60: 6620 7265 7175 6972 696e 6720 7468 6573 f requiring thes │ │ │ -000e6f70: 6520 6d65 6d62 6572 7320 746f 2073 7461 e members to sta │ │ │ -000e6f80: 7274 2077 6974 6820 3c63 6f64 653e 5f5f rt with __ │ │ │ -000e6f90: 7369 7a65 3c2f 636f 6465 3e3a 3c2f 703e size:

│ │ │ -000e6fa0: 0a3c 6469 7620 636c 6173 733d 2266 7261 .
s │ │ │ -000e6fe0: 7472 7563 7420 3c2f 7370 616e 3e6e 735f truct ns_ │ │ │ -000e6ff0: 5f4d 6170 203c 2f64 6976 3e0a 3c64 6976 _Map
.
{< │ │ │ -000e7010: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
$ int │ │ │ -000e7050: 2073 697a 653b 2020 3c73 7061 6e20 636c size; // │ │ │ -000e7070: 206e 756d 6265 7220 6f66 2070 6169 7273 number of pairs │ │ │ -000e7080: 203c 2f73 7061 6e3e 3c2f 6469 763e 0a3c
.< │ │ │ -000e7090: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -000e70a0: 3e20 2020 203c 7370 616e 2063 6c61 7373 > struc │ │ │ -000e70c0: 7420 3c2f 7370 616e 3e6e 735f 5f50 6169 t ns__Pai │ │ │ -000e70d0: 723c 2f64 6976 3e0a 3c64 6976 2063 6c61 r
.
{< │ │ │ -000e70f0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ -000e7110: 3c73 7061 6e20 636c 6173 733d 226b 6579 char *key;
.
char *val;
. │ │ │ -000e71a0: 2020 2020 7d20 2a70 6169 723b 2020 2020 } *pair; │ │ │ -000e71b0: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // array o │ │ │ -000e71d0: 6620 7061 6972 733c 2f73 7061 6e3e 3c2f f pairs.
};
. │ │ │ -000e7200: 3c2f 6469 763e 3c21 2d2d 2066 7261 676d

The ar │ │ │ -000e7220: 7261 7920 7769 6c6c 2062 6520 7365 7269 ray will be seri │ │ │ -000e7230: 616c 697a 6564 2069 6e20 584d 4c20 6173 alized in XML as │ │ │ -000e7240: 2061 2073 6571 7565 6e63 6520 6f66 2070 a sequence of p │ │ │ -000e7250: 6169 7273 3a3c 2f70 3e0a 3c64 6976 2063 airs:

.
<ns:Map& │ │ │ -000e72c0: 6774 3b20 3c2f 6469 763e 0a3c 6469 7620 gt;
.
& │ │ │ -000e72e0: 6c74 3b3c 7370 616e 2063 6c61 7373 3d22 lt;pai │ │ │ -000e7300: 723c 2f73 7061 6e3e 2667 743b 203c 2f64 r> .
<key>Joe< │ │ │ -000e7370: 2f73 7061 6e3e 266c 743b 2f3c 7370 616e /span></key& │ │ │ -000e73a0: 6774 3b20 3c2f 6469 763e 0a3c 6469 7620 gt;
.
│ │ │ -000e73c0: 2026 6c74 3b3c 7370 616e 2063 6c61 7373 <v │ │ │ -000e73e0: 616c 3c2f 7370 616e 3e26 6774 3b35 3535 al>555 │ │ │ -000e73f0: 2037 3720 3132 3334 266c 743b 2f3c 7370 77 1234</val>
. │ │ │ -000e7440: 2026 6c74 3b2f 3c73 7061 6e20 636c 6173 </ │ │ │ -000e7460: 7061 6972 3c2f 7370 616e 3e26 6774 3b20 pair> │ │ │ -000e7470: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
<< │ │ │ -000e7490: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -000e74a0: 6f72 6474 7970 6522 3e70 6169 723c 2f73 ordtype">pair>
. │ │ │ -000e74c0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
<key&g │ │ │ -000e7500: 743b 3c73 7061 6e20 636c 6173 733d 226b t;Susan</key> │ │ │ -000e7550: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
& │ │ │ -000e7570: 6c74 3b3c 7370 616e 2063 6c61 7373 3d22 lt;val │ │ │ -000e7590: 3c2f 7370 616e 3e26 6774 3b35 3535 2031 >555 1 │ │ │ -000e75a0: 3220 3637 3235 266c 743b 2f3c 7370 616e 2 6725</val& │ │ │ -000e75d0: 6774 3b20 3c2f 6469 763e 0a3c 6469 7620 gt;
.
& │ │ │ -000e75f0: 6c74 3b2f 3c73 7061 6e20 636c 6173 733d lt;/pa │ │ │ -000e7610: 6972 3c2f 7370 616e 3e26 6774 3b20 3c2f ir> .
<pair>
. │ │ │ -000e7680: 2020 2020 266c 743b 3c73 7061 6e20 636c <key> │ │ │ -000e76b0: 3c73 7061 6e20 636c 6173 733d 226b 6579 Pete</ │ │ │ -000e76f0: 6b65 793c 2f73 7061 6e3e 2667 743b 203c key> < │ │ │ -000e7700: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
< │ │ │ -000e7720: 3c73 7061 6e20 636c 6173 733d 226b 6579 val>555 99 4 │ │ │ -000e7750: 3332 3126 6c74 3b2f 3c73 7061 6e20 636c 321</val> │ │ │ -000e7780: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
< │ │ │ -000e77a0: 2f3c 7370 616e 2063 6c61 7373 3d22 6b65 /pair< │ │ │ -000e77c0: 2f73 7061 6e3e 2667 743b 203c 2f64 6976 /span>>
.
</ns:Map │ │ │ -000e7810: 2667 743b 3c2f 6469 763e 0a3c 2f64 6976 >
.
│ │ │ -000e7d80: 3c70 3e54 6865 2058 4d4c 2073 6572 6961

The XML seria │ │ │ -000e7d90: 6c69 7a61 7469 6f6e 206f 6620 616e 2065 lization of an e │ │ │ -000e7da0: 7861 6d70 6c65 203c 636f 6465 3e6e 735f xample ns_ │ │ │ -000e7db0: 5f43 6f6e 7461 6374 3c2f 636f 6465 3e20 _Contact │ │ │ -000e7dc0: 6973 3a3c 2f70 3e0a 3c64 6976 2063 6c61 is:

.
│ │ │ -000e7df0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
< │ │ │ -000e7e20: 6e73 3a43 6f6e 7461 6374 3c2f 7370 616e ns:Contact>
. │ │ │ -000e7e50: 2026 6c74 3b3c 7370 616e 2063 6c61 7373 <f │ │ │ -000e7e70: 6972 7374 4e61 6d65 3c2f 7370 616e 3e26 irstName& │ │ │ -000e7e80: 6774 3b3c 7370 616e 2063 6c61 7373 3d22 gt;Joe</firstName>
. │ │ │ -000e7ef0: 2020 266c 743b 3c73 7061 6e20 636c 6173 < │ │ │ -000e7f10: 6c61 7374 4e61 6d65 3c2f 7370 616e 3e26 lastName& │ │ │ -000e7f20: 6774 3b3c 7370 616e 2063 6c61 7373 3d22 gt;Smith</lastName>
.< │ │ │ -000e7f80: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -000e7f90: 3e20 2026 6c74 3b3c 7370 616e 2063 6c61 > <phoneNumber>555111222 │ │ │ -000e7fd0: 3226 6c74 3b2f 3c73 7061 6e20 636c 6173 2</ │ │ │ -000e7ff0: 7068 6f6e 654e 756d 6265 723c 2f73 7061 phoneNumber>
. │ │ │ -000e8020: 2020 266c 743b 3c73 7061 6e20 636c 6173 < │ │ │ -000e8040: 7068 6f6e 654e 756d 6265 723c 2f73 7061 phoneNumber>5551234567 │ │ │ -000e8060: 266c 743b 2f3c 7370 616e 2063 6c61 7373 </p │ │ │ -000e8080: 686f 6e65 4e75 6d62 6572 3c2f 7370 616e honeNumber>
. │ │ │ -000e80b0: 2026 6c74 3b3c 7370 616e 2063 6c61 7373 <p │ │ │ -000e80d0: 686f 6e65 4e75 6d62 6572 3c2f 7370 616e honeNumber>5552348901& │ │ │ -000e80f0: 6c74 3b2f 3c73 7061 6e20 636c 6173 733d lt;/ph │ │ │ -000e8110: 6f6e 654e 756d 6265 723c 2f73 7061 6e3e oneNumber │ │ │ -000e8120: 2667 743b 203c 2f64 6976 3e0a 3c64 6976 >
.
│ │ │ -000e8140: 266c 743b 3c73 7061 6e20 636c 6173 733d <em │ │ │ -000e8160: 6169 6c41 6464 7265 7373 3c2f 7370 616e ailAddress>Joe.S │ │ │ -000e8190: 6d69 7468 3c2f 7370 616e 3e40 3c73 7061 mith@mail.com</ │ │ │ -000e81e0: 656d 6169 6c41 6464 7265 7373 3c2f 7370 emailAddress>
.< │ │ │ -000e8200: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -000e8210: 3e20 2026 6c74 3b3c 7370 616e 2063 6c61 > <emailAddress
>Jo │ │ │ -000e8260: 653c 2f73 7061 6e3e 403c 7370 616e 2063 e@S │ │ │ -000e8280: 6d69 7468 2e63 6f6d 3c2f 7370 616e 3e26 mith.com& │ │ │ -000e8290: 6c74 3b2f 3c73 7061 6e20 636c 6173 733d lt;/em │ │ │ -000e82b0: 6169 6c41 6464 7265 7373 3c2f 7370 616e ailAddress>
.& │ │ │ -000e82e0: 6c74 3b2f 3c73 7061 6e20 636c 6173 733d lt;/ns │ │ │ -000e8300: 3a43 6f6e 7461 6374 3c2f 7370 616e 3e26 :Contact& │ │ │ -000e8310: 6774 3b3c 2f64 6976 3e0a 3c2f 6469 763e gt;
.
│ │ │ -000e8320: 3c21 2d2d 2066 7261 676d 656e 7420 2d2d

The u │ │ │ -000e8850: 7365 206f 6620 706f 696e 7465 7220 6d65 se of pointer me │ │ │ -000e8860: 6d62 6572 7320 7375 6368 2061 7320 666f mbers such as fo │ │ │ -000e8870: 7220 3c63 6f64 653e 6e61 6d65 3c2f 636f r name shown above │ │ │ -000e8890: 6973 2070 6f73 7369 626c 652c 2062 7574 is possible, but │ │ │ -000e88a0: 206e 6f74 2072 6571 7569 7265 642e 2041 not required. A │ │ │ -000e88b0: 6c73 6f20 3c63 6f64 653e 6d69 6e4f 6363 lso minOcc │ │ │ -000e88c0: 7572 7320 3a20 6d61 784f 6363 7572 733c urs : maxOccurs< │ │ │ -000e88d0: 2f63 6f64 653e 2061 6e64 203c 636f 6465 /code> and minOccurs length constra │ │ │ -000e8900: 696e 7473 2063 616e 2062 6520 7370 6563 ints can be spec │ │ │ -000e8910: 6966 6965 6420 6173 2073 686f 776e 2069 ified as shown i │ │ │ -000e8920: 6e20 7468 6520 6578 616d 706c 6520 6162 n the example ab │ │ │ -000e8930: 6f76 652e 2054 6865 2058 4d4c 2073 6368 ove. The XML sch │ │ │ -000e8940: 656d 6120 7468 6174 2063 6f72 7265 7370 ema that corresp │ │ │ -000e8950: 6f6e 6473 2074 6f20 7468 6520 3c63 6f64 onds to the ns__myClass type is:

.
< │ │ │ -000e89c0: 3c73 7061 6e20 636c 6173 733d 226b 6579 comple │ │ │ -000e89e0: 7854 7970 653c 2f73 7061 6e3e 203c 7370 xType name=< │ │ │ -000e8a10: 7370 616e 2063 6c61 7373 3d22 7374 7269 span class="stri │ │ │ -000e8a20: 6e67 6c69 7465 7261 6c22 3e26 7175 6f74 ngliteral">" │ │ │ -000e8a30: 3b6d 7943 6c61 7373 2671 756f 743b 3c2f ;myClass">
│ │ │ -000e8a50: 0a3c 6469 7620 636c 6173 733d 226c 696e .
<sequence>
. │ │ │ -000e8ab0: 2020 2020 266c 743b 3c73 7061 6e20 636c <element │ │ │ -000e8ae0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 name=& │ │ │ -000e8b20: 7175 6f74 3b6e 756d 6265 7226 7175 6f74 quot;number" │ │ │ -000e8b30: 3b3c 2f73 7061 6e3e 203c 7370 616e 2063 ; t │ │ │ -000e8b50: 7970 653c 2f73 7061 6e3e 3d3c 7370 616e ype="xsd │ │ │ -000e8b80: 3a69 6e74 2671 756f 743b 3c2f 7370 616e :int" minOccur │ │ │ -000e8bb0: 733c 2f73 7061 6e3e 3d3c 7370 616e 2063 s="1&quo │ │ │ -000e8be0: 743b 3c2f 7370 616e 3e20 3c73 7061 6e20 t; │ │ │ -000e8c00: 6d61 784f 6363 7572 733c 2f73 7061 6e3e maxOccurs │ │ │ -000e8c10: 3d3c 7370 616e 2063 6c61 7373 3d22 7374 =&qu │ │ │ -000e8c30: 6f74 3b31 3026 7175 6f74 3b3c 2f73 7061 ot;10"/>
.< │ │ │ -000e8c50: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -000e8c60: 3e20 2020 2026 6c74 3b3c 7370 616e 2063 > <element name= │ │ │ -000e8cd0: 2671 756f 743b 6e61 6d65 2671 756f 743b "name" │ │ │ -000e8ce0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c ty │ │ │ -000e8d00: 7065 3c2f 7370 616e 3e3d 3c73 7061 6e20 pe="xsd: │ │ │ -000e8d30: 7374 7269 6e67 2671 756f 743b 3c2f 7370 string" minOcc │ │ │ -000e8d60: 7572 733c 2f73 7061 6e3e 3d3c 7370 616e urs="2&q │ │ │ -000e8d90: 756f 743b 3c2f 7370 616e 3e20 3c73 7061 uot; maxOccurs=& │ │ │ -000e8de0: 7175 6f74 3b75 6e62 6f75 6e64 6564 2671 quot;unbounded&q │ │ │ -000e8df0: 756f 743b 3c2f 7370 616e 3e2f 2667 743b uot;/> │ │ │ -000e8e00: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
< │ │ │ -000e8e20: 2f3c 7370 616e 2063 6c61 7373 3d22 6b65 /seque │ │ │ -000e8e40: 6e63 653c 2f73 7061 6e3e 2667 743b 203c nce> < │ │ │ -000e8e50: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
</complexTy │ │ │ -000e8e90: 7065 3c2f 7370 616e 3e26 6774 3b3c 2f64 pe>.

You can als │ │ │ -000e8ed0: 6f20 696d 706c 656d 656e 7420 796f 7572 o implement your │ │ │ -000e8ee0: 206f 776e 2063 6f6e 7461 696e 6572 732e own containers. │ │ │ -000e8ef0: 2054 6865 2063 6f6e 7461 696e 6572 7320 The containers │ │ │ -000e8f00: 6d75 7374 2062 6520 636c 6173 7320 7465 must be class te │ │ │ -000e8f10: 6d70 6c61 7465 7320 616e 6420 7368 6f75 mplates and shou │ │ │ -000e8f20: 6c64 2064 6566 696e 6520 6120 666f 7277 ld define a forw │ │ │ -000e8f30: 6172 6420 6974 6572 6174 6f72 2074 7970 ard iterator typ │ │ │ -000e8f40: 652c 2061 6e64 2070 726f 7669 6465 2074 e, and provide t │ │ │ -000e8f50: 6865 2066 6f6c 6c6f 7769 6e67 206d 6574 he following met │ │ │ -000e8f60: 686f 6473 3a3c 2f70 3e0a 3c75 6c3e 0a3c hods:

.
    .< │ │ │ -000e8f70: 6c69 3e3c 636f 6465 3e76 6f69 6420 636c li>void cl │ │ │ -000e8f80: 6561 7228 293c 2f63 6f64 653e 2065 6d70 ear() emp │ │ │ -000e8f90: 7479 2074 6865 2063 6f6e 7461 696e 6572 ty the container │ │ │ -000e8fa0: 3b3c 2f6c 693e 0a3c 6c69 3e3c 636f 6465 ;.
  • iterator begin( │ │ │ -000e8fc0: 293c 2f63 6f64 653e 2072 6574 7572 6e20 ) return │ │ │ -000e8fd0: 6974 6572 6174 6f72 2074 6f20 6265 6769 iterator to begi │ │ │ -000e8fe0: 6e6e 696e 673b 3c2f 6c69 3e0a 3c6c 693e nning;
  • .
  • │ │ │ -000e8ff0: 3c63 6f64 653e 636f 6e73 745f 6974 6572 const_iter │ │ │ -000e9000: 6174 6f72 2062 6567 696e 2829 2063 6f6e ator begin() con │ │ │ -000e9010: 7374 3c2f 636f 6465 3e20 7265 7475 726e st return │ │ │ -000e9020: 2063 6f6e 7374 2069 7465 7261 746f 7220 const iterator │ │ │ -000e9030: 746f 2062 6567 696e 6e69 6e67 3b3c 2f6c to beginning;.
  • ite │ │ │ -000e9050: 7261 746f 7220 656e 6428 293c 2f63 6f64 rator end() return iterat │ │ │ -000e9070: 6f72 2074 6f20 656e 643b 3c2f 6c69 3e0a or to end;
  • . │ │ │ -000e9080: 3c6c 693e 3c63 6f64 653e 636f 6e73 745f
  • const_ │ │ │ -000e9090: 6974 6572 6174 6f72 2065 6e64 2829 2063 iterator end() c │ │ │ -000e90a0: 6f6e 7374 3c2f 636f 6465 3e20 7265 7475 onst retu │ │ │ -000e90b0: 726e 2063 6f6e 7374 2069 7465 7261 746f rn const iterato │ │ │ -000e90c0: 7220 746f 2065 6e64 3b3c 2f6c 693e 0a3c r to end;
  • .< │ │ │ -000e90d0: 6c69 3e3c 636f 6465 3e73 697a 655f 7420 li>size_t │ │ │ -000e90e0: 7369 7a65 2829 3c2f 636f 6465 3e20 7265 size() re │ │ │ -000e90f0: 7475 726e 2073 697a 653b 3c2f 6c69 3e0a turn size;. │ │ │ -000e9100: 3c6c 693e 3c63 6f64 653e 6974 6572 6174
  • iterat │ │ │ -000e9110: 6f72 2069 6e73 6572 7428 6974 6572 6174 or insert(iterat │ │ │ -000e9120: 6f72 2070 6f73 2c20 636f 6e73 745f 7265 or pos, const_re │ │ │ -000e9130: 6665 7265 6e63 6520 7661 6c29 3c2f 636f ference val) insert eleme │ │ │ -000e9150: 6e74 2e3c 2f6c 693e 0a3c 2f75 6c3e 0a3c nt.
  • .
.< │ │ │ -000e9160: 703e 5468 6520 3c63 6f64 653e 6974 6572 p>The iter │ │ │ -000e9170: 6174 6f72 3c2f 636f 6465 3e20 7368 6f75 ator shou │ │ │ -000e9180: 6c64 2062 6520 6120 666f 7277 6172 6420 ld be a forward │ │ │ -000e9190: 6974 6572 6174 6f72 2077 6974 6820 6120 iterator with a │ │ │ -000e91a0: 6465 7265 6665 7265 6e63 6520 6f70 6572 dereference oper │ │ │ -000e91b0: 6174 6f72 2074 6f20 6163 6365 7373 2074 ator to access t │ │ │ -000e91c0: 6865 2063 6f6e 7461 696e 6572 2773 2065 he container's e │ │ │ -000e91d0: 6c65 6d65 6e74 732c 2069 7420 6d75 7374 lements, it must │ │ │ -000e91e0: 2062 6520 636f 6d70 6172 6162 6c65 2028 be comparable ( │ │ │ -000e91f0: 6571 7561 6c2f 756e 6571 7561 6c29 2c20 equal/unequal), │ │ │ -000e9200: 616e 6420 6265 2070 7265 2d69 6e63 7265 and be pre-incre │ │ │ -000e9210: 6d65 6e74 6162 6c65 2028 3c63 6f64 653e mentable ( │ │ │ -000e9220: 2b2b 6974 3c2f 636f 6465 3e29 2e20 5468 ++it). Th │ │ │ -000e9230: 6520 636f 6e73 7420 6974 6572 6174 6f72 e const iterator │ │ │ -000e9240: 2069 7320 7573 6564 2062 7920 6974 7320 is used by its │ │ │ -000e9250: 736f 6170 6370 7032 2d67 656e 6572 6174 soapcpp2-generat │ │ │ -000e9260: 6564 2073 6572 6961 6c69 7a65 7220 746f ed serializer to │ │ │ -000e9270: 2073 656e 6420 6120 7365 7175 656e 6365 send a sequence │ │ │ -000e9280: 206f 6620 584d 4c20 656c 656d 656e 7420 of XML element │ │ │ -000e9290: 7661 6c75 6573 2e20 5468 6520 3c63 6f64 values. The insert │ │ │ -000e92b0: 6d65 7468 6f64 2069 7320 7573 6564 2074 method is used t │ │ │ -000e92c0: 6f20 706f 7075 6c61 7465 2061 2063 6f6e o populate a con │ │ │ -000e92d0: 7461 696e 6572 2077 6974 6820 3c63 6f64 tainer with Container::ite │ │ │ -000e92f0: 7261 746f 7220 6920 3d20 636f 6e74 6169 rator i = contai │ │ │ -000e9300: 6e65 722e 696e 7365 7274 2863 6f6e 7461 ner.insert(conta │ │ │ -000e9310: 696e 6572 2e65 6e64 2829 2c20 7661 6c29 iner.end(), val) │ │ │ -000e9320: 3c2f 636f 6465 3e2e 3c2f 703e 0a3c 703e .

.

│ │ │ -000e9330: 4865 7265 2069 7320 696e 2065 7861 6d70 Here is in examp │ │ │ -000e9340: 6c65 2063 6f6e 7461 696e 6572 2074 656d le container tem │ │ │ -000e9350: 706c 6174 6520 636c 6173 733a 3c2f 703e plate class:

│ │ │ -000e9360: 0a3c 6469 7620 636c 6173 733d 2266 7261 .
/ │ │ │ -000e93a0: 2f20 7369 6d70 6c65 5f76 6563 746f 722e / simple_vector. │ │ │ -000e93b0: 6820 3c2f 7370 616e 3e3c 2f64 6976 3e0a h
. │ │ │ -000e93c0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
template │ │ │ -000e93f0: 3c2f 7370 616e 3e20 266c 743b 3c73 7061 <class T │ │ │ -000e9420: 2667 743b 203c 2f64 6976 3e0a 3c64 6976 >
.
class simple_vector < │ │ │ -000e9470: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
{ │ │ │ -000e94a0: 7075 626c 6963 3c2f 7370 616e 3e3a 203c public: < │ │ │ -000e94b0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
typedef │ │ │ -000e94f0: 2054 2020 2020 2020 2020 2020 2020 2020 T │ │ │ -000e9500: 2020 2020 2020 2020 2076 616c 7565 5f74 value_t │ │ │ -000e9510: 7970 653b 203c 2f64 6976 3e0a 3c64 6976 ype;
.
│ │ │ -000e9530: 2020 3c73 7061 6e20 636c 6173 733d 226b typedef< │ │ │ -000e9550: 2f73 7061 6e3e 2076 616c 7565 5f74 7970 /span> value_typ │ │ │ -000e9560: 6520 2020 2020 2020 2020 2020 202a 2070 e * p │ │ │ -000e9570: 6f69 6e74 6572 3b20 3c2f 6469 763e 0a3c ointer;
.< │ │ │ -000e9580: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -000e9590: 3e20 2020 203c 7370 616e 2063 6c61 7373 > typed │ │ │ -000e95b0: 6566 3c2f 7370 616e 3e20 3c73 7061 6e20 ef │ │ │ -000e95d0: 636f 6e73 743c 2f73 7061 6e3e 2076 616c const val │ │ │ -000e95e0: 7565 5f74 7970 6520 2020 2020 202a 2063 ue_type * c │ │ │ -000e95f0: 6f6e 7374 5f70 6f69 6e74 6572 3b20 3c2f onst_pointer; .
typedef │ │ │ -000e9640: 7661 6c75 655f 7479 7065 2020 2020 2020 value_type │ │ │ -000e9650: 2020 2020 2020 2661 6d70 3b20 7265 6665 & refe │ │ │ -000e9660: 7265 6e63 653b 203c 2f64 6976 3e0a 3c64 rence;
. │ │ │ -000e9680: 2020 2020 3c73 7061 6e20 636c 6173 733d typede │ │ │ -000e96a0: 663c 2f73 7061 6e3e 203c 7370 616e 2063 f c │ │ │ -000e96c0: 6f6e 7374 3c2f 7370 616e 3e20 7661 6c75 onst valu │ │ │ -000e96d0: 655f 7479 7065 2020 2020 2020 2661 6d70 e_type & │ │ │ -000e96e0: 3b20 636f 6e73 745f 7265 6665 7265 6e63 ; const_referenc │ │ │ -000e96f0: 653b 203c 2f64 6976 3e0a 3c64 6976 2063 e;
.
│ │ │ -000e9710: 3c73 7061 6e20 636c 6173 733d 226b 6579 typedef pointer │ │ │ -000e9740: 2020 2020 2020 2020 2020 2020 2069 7465 ite │ │ │ -000e9750: 7261 746f 723b 203c 2f64 6976 3e0a 3c64 rator;
. │ │ │ -000e9770: 2020 2020 3c73 7061 6e20 636c 6173 733d typede │ │ │ -000e9790: 663c 2f73 7061 6e3e 2063 6f6e 7374 5f70 f const_p │ │ │ -000e97a0: 6f69 6e74 6572 2020 2020 2020 2020 2020 ointer │ │ │ -000e97b0: 2063 6f6e 7374 5f69 7465 7261 746f 723b const_iterator; │ │ │ -000e97c0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
protected:
.
│ │ │ -000e9820: 2069 7465 7261 746f 7220 2020 2020 2020 iterator │ │ │ +000dfad0: 7465 7261 6c22 3e50 2623 7832 3431 373b teral">P␗ │ │ │ +000dfae0: 5b7c 3c2f 7370 616e 3e3c 2f64 6976 3e0a [|
. │ │ │ +000dfaf0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
│ │ │ +000dfb20: 266c 743b 7220 6964 3d26 7175 6f74 3b3c <r id="< │ │ │ +000dfb30: 2f73 7061 6e3e 313c 7370 616e 2063 6c61 /span>1" xsi:ni │ │ │ +000dfb60: 6c3d 2671 756f 743b 3c2f 7370 616e 3e3c l="< │ │ │ +000dfb70: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +000dfb80: 6f72 6422 3e74 7275 653c 2f73 7061 6e3e ord">true │ │ │ +000dfb90: 2671 756f 743b 2f26 6774 3b3c 2f64 6976 "/>
.
</X>< │ │ │ +000dfbe0: 2f64 6976 3e0a 3c2f 6469 763e 3c21 2d2d /div>.

The deser │ │ │ +000dfc10: 6961 6c69 7a65 7220 7265 636f 6e73 7472 ializer reconstr │ │ │ +000dfc20: 7563 7473 2074 6865 2073 7472 7563 7420 ucts the struct │ │ │ +000dfc30: 3c63 6f64 653e 583c 2f63 6f64 653e 2066 X f │ │ │ +000dfc40: 726f 6d20 7468 6973 2066 6f72 6d20 6f66 rom this form of │ │ │ +000dfc50: 2058 4d4c 2c20 7468 6572 6562 7920 7072 XML, thereby pr │ │ │ +000dfc60: 6573 6572 7669 6e67 2074 6865 2069 6e74 eserving the int │ │ │ +000dfc70: 6567 7269 7479 206f 6620 7468 6520 6461 egrity of the da │ │ │ +000dfc80: 7461 2073 7472 7563 7475 7265 2073 6572 ta structure ser │ │ │ +000dfc90: 6961 6c69 7a65 642e 3c2f 703e 0a3c 703e ialized.

.

│ │ │ +000dfca0: 5768 656e 2074 6865 2064 6573 6572 6961 When the deseria │ │ │ +000dfcb0: 6c69 7a65 7220 656e 636f 756e 7465 7273 lizer encounters │ │ │ +000dfcc0: 2061 6e20 584d 4c20 656c 656d 656e 7420 an XML element │ │ │ +000dfcd0: 7468 6174 2068 6173 2061 203c 656d 3e3c that has a < │ │ │ +000dfce0: 636f 6465 3e78 7369 3a6e 696c 3d22 7472 code>xsi:nil="tr │ │ │ +000dfcf0: 7565 223c 2f63 6f64 653e 3c2f 656d 3e20 ue" │ │ │ +000dfd00: 6174 7472 6962 7574 6520 6275 7420 7468 attribute but th │ │ │ +000dfd10: 6520 636f 7272 6573 706f 6e64 696e 6720 e corresponding │ │ │ +000dfd20: 432f 432b 2b20 6461 7461 2069 7320 6e6f C/C++ data is no │ │ │ +000dfd30: 7420 6120 706f 696e 7465 7220 6f72 2072 t a pointer or r │ │ │ +000dfd40: 6566 6572 656e 6365 2c20 7468 6520 6465 eference, the de │ │ │ +000dfd50: 7365 7269 616c 697a 6572 2077 696c 6c20 serializer will │ │ │ +000dfd60: 7465 726d 696e 6174 6520 7769 7468 2061 terminate with a │ │ │ +000dfd70: 203c 636f 6465 3e23 534f 4150 5f4e 554c #SOAP_NUL │ │ │ +000dfd80: 4c3c 2f63 6f64 653e 2066 6175 6c74 2077 L fault w │ │ │ +000dfd90: 6865 6e20 7468 6520 3c63 6f64 653e 2353 hen the #S │ │ │ +000dfda0: 4f41 505f 584d 4c5f 5354 5249 4354 3c2f OAP_XML_STRICT flag is se │ │ │ +000dfdc0: 742e 3c2f 703e 0a3c 703e f09f 949d 203c t.

.

.... < │ │ │ +000dfdd0: 6120 6872 6566 3d22 2322 3e42 6163 6b20 a href="#">Back │ │ │ +000dfde0: 746f 2074 6162 6c65 206f 6620 636f 6e74 to table of cont │ │ │ +000dfdf0: 656e 7473 3c2f 613e 3c2f 703e 0a3c 6832 ents

.

.Void pointer s │ │ │ +000dfe30: 6572 6961 6c69 7a61 7469 6f6e 3c2f 6832 erialization

.

Void pointe │ │ │ +000dfe50: 7273 2028 3c63 6f64 653e 766f 6964 2a3c rs (void*< │ │ │ +000dfe60: 2f63 6f64 653e 2920 6361 6e6e 6f74 2062 /code>) cannot b │ │ │ +000dfe70: 6520 7365 7269 616c 697a 6564 2069 6e20 e serialized in │ │ │ +000dfe80: 584d 4c20 6265 6361 7573 6520 7468 6520 XML because the │ │ │ +000dfe90: 7479 7065 206f 6620 6461 7461 2072 6566 type of data ref │ │ │ +000dfea0: 6572 7265 6420 746f 2069 7320 756e 7479 erred to is unty │ │ │ +000dfeb0: 7065 642e 2054 6f20 656e 6162 6c65 2074 ped. To enable t │ │ │ +000dfec0: 6865 2073 6572 6961 6c69 7a61 7469 6f6e he serialization │ │ │ +000dfed0: 206f 6620 766f 6964 2070 6f69 6e74 6572 of void pointer │ │ │ +000dfee0: 7320 7468 6174 2061 7265 206d 656d 6265 s that are membe │ │ │ +000dfef0: 7273 206f 6620 7374 7275 6374 7320 616e rs of structs an │ │ │ +000dff00: 6420 636c 6173 7365 732c 2079 6f75 2063 d classes, you c │ │ │ +000dff10: 616e 2069 6e73 6572 7420 6120 3c63 6f64 an insert a int __type member right │ │ │ +000dff40: 2062 6566 6f72 6520 7468 6520 766f 6964 before the void │ │ │ +000dff50: 2070 6f69 6e74 6572 206d 656d 6265 722e pointer member. │ │ │ +000dff60: 2054 6865 203c 636f 6465 3e69 6e74 205f The int _ │ │ │ +000dff70: 5f74 7970 653c 2f63 6f64 653e 206d 656d _type mem │ │ │ +000dff80: 6265 7220 636f 6e74 6169 6e73 2072 756e ber contains run │ │ │ +000dff90: 2074 696d 6520 696e 666f 726d 6174 696f time informatio │ │ │ +000dffa0: 6e20 6f6e 2074 6865 2074 7970 6520 6f66 n on the type of │ │ │ +000dffb0: 2074 6865 2064 6174 6120 706f 696e 7465 the data pointe │ │ │ +000dffc0: 6420 746f 2062 7920 3c63 6f64 653e 766f d to by vo │ │ │ +000dffd0: 6964 2a3c 2f63 6f64 653e 206d 656d 6265 id* membe │ │ │ +000dffe0: 7220 696e 2061 2073 7472 7563 742f 636c r in a struct/cl │ │ │ +000dfff0: 6173 7320 746f 2065 6e61 626c 6520 7468 ass to enable th │ │ │ +000e0000: 6520 7365 7269 616c 697a 6174 696f 6e20 e serialization │ │ │ +000e0010: 6f66 2074 6869 7320 6461 7461 2e20 5468 of this data. Th │ │ │ +000e0020: 6520 3c63 6f64 653e 696e 7420 5f5f 7479 e int __ty │ │ │ +000e0030: 7065 3c2f 636f 6465 3e20 6d65 6d62 6572 pe member │ │ │ +000e0040: 2069 7320 7365 7420 746f 2061 203c 636f is set to a SOAP_TYPE_T value, whe │ │ │ +000e0070: 7265 203c 636f 6465 3e54 3c2f 636f 6465 re T is the name of │ │ │ +000e0090: 2061 2074 7970 652e 2054 6865 2073 6f61 a type. The soa │ │ │ +000e00a0: 7063 7070 3220 746f 6f6c 2067 656e 6572 pcpp2 tool gener │ │ │ +000e00b0: 6174 6573 2074 6865 203c 636f 6465 3e53 ates the S │ │ │ +000e00c0: 4f41 505f 5459 5045 5f54 3c2f 636f 6465 OAP_TYPE_T definitions in │ │ │ +000e00e0: 203c 656d 3e3c 636f 6465 3e73 6f61 7048 soapH │ │ │ +000e00f0: 2e68 3c2f 636f 6465 3e3c 2f65 6d3e 2061 .h a │ │ │ +000e0100: 6e64 2075 7365 7320 7468 656d 2069 6e74 nd uses them int │ │ │ +000e0110: 6572 6e61 6c6c 7920 746f 2075 6e69 7175 ernally to uniqu │ │ │ +000e0120: 656c 7920 6964 656e 7469 6679 2074 6865 ely identify the │ │ │ +000e0130: 2074 7970 6520 6f66 2065 6163 6820 6f62 type of each ob │ │ │ +000e0140: 6a65 6374 2e20 5468 6520 7479 7065 206e ject. The type n │ │ │ +000e0150: 616d 696e 6720 636f 6e76 656e 7469 6f6e aming convention │ │ │ +000e0160: 7320 6f75 746c 696e 6564 2069 6e20 5365 s outlined in Se │ │ │ +000e0170: 6374 696f 6e20 3c61 2063 6c61 7373 3d22 ction │ │ │ +000e01a0: 5365 7269 616c 697a 696e 6720 432f 432b Serializing C/C+ │ │ │ +000e01b0: 2b20 6461 7461 2074 6f20 584d 4c3c 2f61 + data to XML are used to de │ │ │ +000e01d0: 7465 726d 696e 6520 7468 6520 7479 7065 termine the type │ │ │ +000e01e0: 206e 616d 6520 666f 7220 3c63 6f64 653e name for │ │ │ +000e01f0: 543c 2f63 6f64 653e 2e20 5661 6c75 6573 T. Values │ │ │ +000e0200: 2073 6572 6961 6c69 7a65 6420 696e 2058 serialized in X │ │ │ +000e0210: 4d4c 2077 6974 6820 7468 6973 2061 7070 ML with this app │ │ │ +000e0220: 726f 6163 6820 616c 7761 7973 2063 6172 roach always car │ │ │ +000e0230: 7279 2074 6865 203c 656d 3e3c 636f 6465 ry the xsi:type │ │ │ +000e0250: 3c2f 656d 3e20 6174 7472 6962 7574 6520 attribute │ │ │ +000e0260: 696e 2058 4d4c 2074 6f20 696e 6469 6361 in XML to indica │ │ │ +000e0270: 7465 2074 6865 2074 7970 6520 6f66 2063 te the type of c │ │ │ +000e0280: 6f6e 7465 6e74 2073 6572 6961 6c69 7a65 ontent serialize │ │ │ +000e0290: 642e 3c2f 703e 0a3c 703e 4865 7265 2069 d.

.

Here i │ │ │ +000e02a0: 7320 616e 2065 7861 6d70 6c65 2074 6f20 s an example to │ │ │ +000e02b0: 696c 6c75 7374 7261 7465 2074 6865 2073 illustrate the s │ │ │ +000e02c0: 6572 6961 6c69 7a61 7469 6f6e 206f 6620 erialization of │ │ │ +000e02d0: 6120 3c63 6f64 653e 766f 6964 2a3c 2f63 a void* member in a │ │ │ +000e02f0: 2073 7472 7563 742f 636c 6173 733a 3c2f struct/class:.

struct n │ │ │ +000e0350: 735f 5f72 6563 6f72 6420 3c2f 6469 763e s__record
│ │ │ +000e0360: 0a3c 6469 7620 636c 6173 733d 226c 696e .
{
.
│ │ │ +000e0390: 203c 7370 616e 2063 6c61 7373 3d22 6b65 int __type; // the SOAP_ │ │ │ +000e03e0: 5459 5045 5f54 2070 6f69 6e74 6564 2074 TYPE_T pointed t │ │ │ +000e03f0: 6f20 6279 2076 616c 3c2f 7370 616e 3e3c o by val< │ │ │ +000e0400: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
void *val; / │ │ │ +000e0460: 2f20 7365 7269 616c 697a 6520 616e 7920 / serialize any │ │ │ +000e0470: 7479 7065 2069 6e20 656c 656d 656e 7420 type in element │ │ │ +000e0480: 266c 743b 7661 6c26 6774 3b3c 2f73 7061 <val>
.
};.

Th │ │ │ +000e04d0: 6520 3c63 6f64 653e 5f5f 7479 7065 3c2f e __type integer ca │ │ │ +000e04f0: 6e20 6265 2073 6574 2074 6f20 3020 6174 n be set to 0 at │ │ │ +000e0500: 2072 756e 2074 696d 6520 746f 206f 6d69 run time to omi │ │ │ +000e0510: 7420 7468 6520 7365 7269 616c 697a 6174 t the serializat │ │ │ +000e0520: 696f 6e20 6f66 2074 6865 2076 6f69 6420 ion of the void │ │ │ +000e0530: 706f 696e 7465 7220 6d65 6d62 6572 2e3c pointer member.< │ │ │ +000e0540: 2f70 3e0a 3c70 3e54 6865 2066 6f6c 6c6f /p>.

The follo │ │ │ +000e0550: 7769 6e67 2065 7861 6d70 6c65 2069 6c6c wing example ill │ │ │ +000e0560: 7573 7472 6174 6573 2074 6865 2069 6e69 ustrates the ini │ │ │ +000e0570: 7469 616c 697a 6174 696f 6e20 6f66 203c tialization of < │ │ │ +000e0580: 636f 6465 3e6d 7953 7472 7563 743c 2f63 code>myStruct with a void │ │ │ +000e05a0: 2070 6f69 6e74 6572 2074 6f20 616e 2069 pointer to an i │ │ │ +000e05b0: 6e74 3a3c 2f70 3e0a 3c64 6976 2063 6c61 nt:

.
│ │ │ +000e05e0: 3c73 7061 6e20 636c 6173 733d 226b 6579 struct ns__record S │ │ │ +000e0610: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
int │ │ │ +000e0650: 6e20 3d20 3132 333b 203c 2f64 6976 3e0a n = 123;
. │ │ │ +000e0660: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
S.val = (void │ │ │ +000e06a0: 2a29 2661 6d70 3b6e 3b20 3c2f 6469 763e *)&n;
│ │ │ +000e06b0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
S.__type = SO │ │ │ +000e06d0: 4150 5f54 5950 455f 696e 743b 203c 2f64 AP_TYPE_int; .

Th │ │ │ +000e0700: 6520 7365 7269 616c 697a 6564 206f 7574 e serialized out │ │ │ +000e0710: 7075 7420 6f66 203c 636f 6465 3e53 3c2f put of S contains t │ │ │ +000e0730: 6865 2069 6e74 6567 6572 2069 6e20 6974 he integer in it │ │ │ +000e0740: 7320 3c65 6d3e 3c63 6f64 653e 7661 6c3c s val< │ │ │ +000e0750: 2f63 6f64 653e 3c2f 656d 3e20 656c 656d /code> elem │ │ │ +000e0760: 656e 743a 3c2f 703e 0a3c 6469 7620 636c ent:

.
<ns:record>
.
│ │ │ +000e07f0: 266c 743b 3c73 7061 6e20 636c 6173 733d <va │ │ │ +000e0810: 6c3c 2f73 7061 6e3e 203c 7370 616e 2063 l x │ │ │ +000e0830: 7369 3a74 7970 653c 2f73 7061 6e3e 3d3c si:type=< │ │ │ +000e0840: 7370 616e 2063 6c61 7373 3d22 7374 7269 span class="stri │ │ │ +000e0850: 6e67 6c69 7465 7261 6c22 3e26 7175 6f74 ngliteral">" │ │ │ +000e0860: 3b78 7364 3a69 6e74 2671 756f 743b 3c2f ;xsd:int">123< │ │ │ +000e0880: 2f3c 7370 616e 2063 6c61 7373 3d22 6b65 /val>
. │ │ │ +000e08b0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
</ns:record>
.

The │ │ │ +000e0920: 2064 6573 6572 6961 6c69 7a65 7220 666f deserializer fo │ │ │ +000e0930: 7220 3c63 6f64 653e 6e73 5f5f 7265 636f r ns__reco │ │ │ +000e0940: 7264 3c2f 636f 6465 3e20 7769 6c6c 2061 rd will a │ │ │ +000e0950: 7574 6f6d 6174 6963 616c 6c79 2073 6574 utomatically set │ │ │ +000e0960: 2074 6865 203c 636f 6465 3e5f 5f74 7970 the __typ │ │ │ +000e0970: 653c 2f63 6f64 653e 2066 6965 6c64 2061 e field a │ │ │ +000e0980: 6e64 2076 6f69 6420 706f 696e 7465 7220 nd void pointer │ │ │ +000e0990: 7768 656e 2064 6573 6572 6961 6c69 7a69 when deserializi │ │ │ +000e09a0: 6e67 2074 6865 2064 6174 612c 2070 726f ng the data, pro │ │ │ +000e09b0: 7669 6465 6420 7468 6174 2074 6865 2058 vided that the X │ │ │ +000e09c0: 4d4c 2065 6c65 6d65 6e74 203c 656d 3e3c ML element < │ │ │ +000e09d0: 636f 6465 3e76 616c 3c2f 636f 6465 3e3c code>val< │ │ │ +000e09e0: 2f65 6d3e 2063 6172 7269 6573 2074 6865 /em> carries the │ │ │ +000e09f0: 203c 656d 3e3c 636f 6465 3e78 7369 3a74 xsi:t │ │ │ +000e0a00: 7970 653c 2f63 6f64 653e 3c2f 656d 3e20 ype │ │ │ +000e0a10: 6174 7472 6962 7574 6520 6672 6f6d 2077 attribute from w │ │ │ +000e0a20: 6869 6368 2069 7420 6361 6e20 6465 7465 hich it can dete │ │ │ +000e0a30: 726d 696e 6520 7468 6520 7479 7065 2e3c rmine the type.< │ │ │ +000e0a40: 2f70 3e0a 3c64 6c20 636c 6173 733d 2273 /p>.

Note
wh │ │ │ +000e0a70: 656e 2073 6572 6961 6c69 7a69 6e67 2073 en serializing s │ │ │ +000e0a80: 7472 696e 6773 2076 6961 2061 203c 636f trings via a void* │ │ │ +000e0aa0: 6d65 6d62 6572 2c20 7468 6520 3c63 6f64 member, the void* p │ │ │ +000e0ac0: 6f69 6e74 6572 206d 7573 7420 6469 7265 ointer must dire │ │ │ +000e0ad0: 6374 6c79 2070 6f69 6e74 2074 6f20 7468 ctly point to th │ │ │ +000e0ae0: 6520 7374 7269 6e67 2076 616c 7565 2072 e string value r │ │ │ +000e0af0: 6174 6865 7220 7468 616e 2069 6e64 6972 ather than indir │ │ │ +000e0b00: 6563 746c 7920 6173 2077 6974 6820 616c ectly as with al │ │ │ +000e0b10: 6c20 6f74 6865 7220 7479 7065 732e 2046 l other types. F │ │ │ +000e0b20: 6f72 2065 7861 6d70 6c65 3a3c 2f64 643e or example:
│ │ │ +000e0b30: 3c2f 646c 3e0a 3c64 6976 2063 6c61 7373
.
struct ns__record S; │ │ │ +000e0b90: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
S.val = │ │ │ +000e0bb0: 2028 3c73 7061 6e20 636c 6173 733d 226b (void │ │ │ +000e0bd0: 3c2f 7370 616e 3e2a 293c 7370 616e 2063 *)"Hello │ │ │ +000e0c00: 2671 756f 743b 3c2f 7370 616e 3e3b 203c "; < │ │ │ +000e0c10: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
S.__type │ │ │ +000e0c30: 203d 2053 4f41 505f 5459 5045 5f73 7472 = SOAP_TYPE_str │ │ │ +000e0c40: 696e 673b 203c 2f64 6976 3e0a 3c2f 6469 ing;
.

This is th │ │ │ +000e0c70: 6520 6361 7365 2066 6f72 2061 6c6c 2073 e case for all s │ │ │ +000e0c80: 7472 696e 672d 6261 7365 6420 7479 7065 tring-based type │ │ │ +000e0c90: 732c 2069 6e63 6c75 6469 6e67 2074 7970 s, including typ │ │ │ +000e0ca0: 6573 2064 6566 696e 6564 2077 6974 6820 es defined with │ │ │ +000e0cb0: 3c63 6f64 653e 7479 7065 6465 6620 6368 typedef ch │ │ │ +000e0cc0: 6172 2a3c 2f63 6f64 653e 2e3c 2f70 3e0a ar*.

. │ │ │ +000e0cd0: 3c70 3e59 6f75 206d 6179 2075 7365 2061

You may use a │ │ │ +000e0ce0: 6e20 6172 6269 7472 6172 7920 7375 6666 n arbitrary suff │ │ │ +000e0cf0: 6978 2077 6974 6820 7468 6520 3c63 6f64 ix with the __type │ │ │ +000e0d10: 6d65 6d62 6572 7320 746f 2068 616e 646c members to handl │ │ │ +000e0d20: 6520 6d75 6c74 6970 6c65 2076 6f69 6420 e multiple void │ │ │ +000e0d30: 706f 696e 7465 7273 2069 6e20 7374 7275 pointers in stru │ │ │ +000e0d40: 6374 732f 636c 6173 7365 732e 2046 6f72 cts/classes. For │ │ │ +000e0d50: 2065 7861 6d70 6c65 3a3c 2f70 3e0a 3c64 example:

.
stru │ │ │ +000e0da0: 6374 203c 2f73 7061 6e3e 6e73 5f5f 7265 ct ns__re │ │ │ +000e0db0: 636f 7264 203c 2f64 6976 3e0a 3c64 6976 cord
.
{< │ │ │ +000e0dd0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
int │ │ │ +000e0e10: 205f 5f74 7970 654f 6670 3b20 3c73 7061 __typeOfp; // the SOAP_TY │ │ │ +000e0e40: 5045 5f54 2070 6f69 6e74 6564 2074 6f20 PE_T pointed to │ │ │ +000e0e50: 6279 2070 203c 2f73 7061 6e3e 3c2f 6469 by p .
void * │ │ │ +000e0ea0: 703b 2020 2020 2020 203c 7370 616e 2063 p; / │ │ │ +000e0ec0: 2f20 656c 656d 656e 7420 266c 743b 7026 / element <p& │ │ │ +000e0ed0: 6774 3b3c 2f73 7061 6e3e 3c2f 6469 763e gt;
│ │ │ +000e0ee0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
int __ty │ │ │ +000e0f20: 7065 4f66 713b 203c 7370 616e 2063 6c61 peOfq; // │ │ │ +000e0f40: 7468 6520 534f 4150 5f54 5950 455f 5420 the SOAP_TYPE_T │ │ │ +000e0f50: 706f 696e 7465 6420 746f 2062 7920 7120 pointed to by q │ │ │ +000e0f60: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ +000e0f80: 2020 2020 3c73 7061 6e20 636c 6173 733d vo │ │ │ +000e0fa0: 6964 3c2f 7370 616e 3e20 2a71 3b20 2020 id *q; │ │ │ +000e0fb0: 2020 2020 3c73 7061 6e20 636c 6173 733d // ele │ │ │ +000e0fd0: 6d65 6e74 2026 6c74 3b71 2667 743b 3c2f ment <q>
.
}; │ │ │ +000e1000: 3c2f 6469 763e 0a3c 2f64 6976 3e3c 212d
.

Because service │ │ │ +000e1030: 206d 6574 686f 6420 7061 7261 6d65 7465 method paramete │ │ │ +000e1040: 7273 2061 7265 2073 746f 7265 6420 7769 rs are stored wi │ │ │ +000e1050: 7468 696e 2073 7472 7563 7473 2c20 796f thin structs, yo │ │ │ +000e1060: 7520 6361 6e20 7573 6520 3c63 6f64 653e u can use │ │ │ +000e1070: 5f5f 7479 7065 3c2f 636f 6465 3e20 616e __type an │ │ │ +000e1080: 6420 3c63 6f64 653e 766f 6964 2a3c 2f63 d void* parameters │ │ │ +000e10a0: 746f 2070 6173 7320 706f 6c79 6d6f 7270 to pass polymorp │ │ │ +000e10b0: 6869 6320 6172 6775 6d65 6e74 7320 7769 hic arguments wi │ │ │ +000e10c0: 7468 6f75 7420 6861 7669 6e67 2074 6f20 thout having to │ │ │ +000e10d0: 6465 6669 6e65 2061 2043 2b2b 2063 6c61 define a C++ cla │ │ │ +000e10e0: 7373 2068 6965 7261 7263 6879 2028 5365 ss hierarchy (Se │ │ │ +000e10f0: 6374 696f 6e20 3c61 2063 6c61 7373 3d22 ction │ │ │ +000e1120: 506f 6c79 6d6f 7270 6869 736d 2c20 6465 Polymorphism, de │ │ │ +000e1130: 7269 7665 6420 7479 7065 732c 2061 6e64 rived types, and │ │ │ +000e1140: 2064 796e 616d 6963 2062 696e 6469 6e67 dynamic binding │ │ │ +000e1150: 2069 6e20 432b 2b3c 2f61 3e20 292c 2070 in C++ ), p │ │ │ +000e1160: 726f 7669 6465 6420 7468 6174 203c 656d rovided that xsi:type< │ │ │ +000e1180: 2f63 6f64 653e 3c2f 656d 3e20 6174 7472 /code> attr │ │ │ +000e1190: 6962 7574 6573 2061 7265 2070 7265 7365 ibutes are prese │ │ │ +000e11a0: 6e74 2069 6e20 7468 6520 584d 4c20 656c nt in the XML el │ │ │ +000e11b0: 656d 656e 7473 2e20 466f 7220 6578 616d ements. For exam │ │ │ +000e11c0: 706c 653a 3c2f 703e 0a3c 6469 7620 636c ple:

.
< │ │ │ +000e11e0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +000e11f0: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >typedef │ │ │ +000e1230: 6368 6172 3c2f 7370 616e 3e20 2a78 7364 char *xsd │ │ │ +000e1240: 5f5f 7374 7269 6e67 3b20 3c2f 6469 763e __string;
│ │ │ +000e1250: 0a3c 6469 7620 636c 6173 733d 226c 696e .
typedef │ │ │ +000e1280: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c int xsd │ │ │ +000e12b0: 5f5f 696e 743b 203c 2f64 6976 3e0a 3c64 __int;
. │ │ │ +000e12d0: 3c73 7061 6e20 636c 6173 733d 226b 6579 typedef
f │ │ │ +000e1310: 6c6f 6174 3c2f 7370 616e 3e20 7873 645f loat xsd_ │ │ │ +000e1320: 5f66 6c6f 6174 3b20 3c2f 6469 763e 0a3c _float;
.< │ │ │ +000e1330: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +000e1340: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >enum ns__status { │ │ │ +000e1370: 6f6e 2c20 6f66 6620 7d3b 203c 2f64 6976 on, off };
.
struct │ │ │ +000e13b0: 203c 2f73 7061 6e3e 6e73 5f5f 7769 6467 ns__widg │ │ │ +000e13c0: 6574 3c2f 6469 763e 0a3c 6469 7620 636c et
.
{.
char * │ │ │ +000e1420: 6e61 6d65 3b3c 2f64 6976 3e0a 3c64 6976 name;
.
│ │ │ +000e1440: 2020 3c73 7061 6e20 636c 6173 733d 226b int< │ │ │ +000e1460: 2f73 7061 6e3e 2070 6172 743b 3c2f 6469 /span> part;.
};
. │ │ │ +000e14a0: 3c73 7061 6e20 636c 6173 733d 226b 6579 int ns__webmeth │ │ │ +000e14d0: 6f64 283c 7370 616e 2063 6c61 7373 3d22 od(int │ │ │ +000e14f0: 3c2f 7370 616e 3e20 5f5f 7479 7065 2c20 __type, │ │ │ +000e1500: 3c73 7061 6e20 636c 6173 733d 226b 6579 void *data, struct │ │ │ +000e1550: 206e 735f 5f77 6562 6d65 7468 6f64 5265 ns__webmethodRe │ │ │ +000e1560: 7370 6f6e 7365 207b 203c 7370 616e 2063 sponse { int __ │ │ │ +000e1590: 7479 7065 3b20 3c73 7061 6e20 636c 6173 type; │ │ │ +000e15b0: 766f 6964 3c2f 7370 616e 3e20 2a72 6574 void *ret │ │ │ +000e15c0: 7572 6e5f 3b20 7d20 2a6f 7574 293b 3c2f urn_; } *out);.

T │ │ │ +000e15f0: 6869 7320 6d65 7468 6f64 2068 6173 2061 his method has a │ │ │ +000e1600: 2070 6f6c 796d 6f72 7068 6963 2069 6e70 polymorphic inp │ │ │ +000e1610: 7574 2070 6172 616d 6574 6572 203c 636f ut parameter data a │ │ │ +000e1630: 6e64 2061 2070 6f6c 796d 6f72 7068 6963 nd a polymorphic │ │ │ +000e1640: 206f 7574 7075 7420 7061 7261 6d65 7465 output paramete │ │ │ +000e1650: 7220 3c63 6f64 653e 7265 7475 726e 5f3c r return_< │ │ │ +000e1660: 2f63 6f64 653e 2e20 5468 6520 3c63 6f64 /code>. The __type │ │ │ +000e1680: 7061 7261 6d65 7465 7273 2063 616e 2062 parameters can b │ │ │ +000e1690: 6520 6f6e 6520 6f66 203c 636f 6465 3e53 e one of S │ │ │ +000e16a0: 4f41 505f 5459 5045 5f78 7364 5f5f 7374 OAP_TYPE_xsd__st │ │ │ +000e16b0: 7269 6e67 3c2f 636f 6465 3e2c 203c 636f ring, SOAP_TYPE_xsd │ │ │ +000e16d0: 5f5f 696e 743c 2f63 6f64 653e 2c20 3c63 __int, SOAP_TYPE_xs │ │ │ +000e16f0: 645f 5f66 6c6f 6174 3c2f 636f 6465 3e2c d__float, │ │ │ +000e1700: 203c 636f 6465 3e53 4f41 505f 5459 5045 SOAP_TYPE │ │ │ +000e1710: 5f6e 735f 5f73 7461 7475 733c 2f63 6f64 _ns__status, or SOA │ │ │ +000e1730: 505f 5459 5045 5f6e 735f 5f77 6964 6765 P_TYPE_ns__widge │ │ │ +000e1740: 743c 2f63 6f64 653e 2e20 5468 6520 5753 t. The WS │ │ │ +000e1750: 444c 2061 6e64 2058 5344 2066 696c 6573 DL and XSD files │ │ │ +000e1760: 2070 726f 6475 6365 6420 6279 2074 6865 produced by the │ │ │ +000e1770: 2073 6f61 7063 7070 3220 746f 6f6c 2064 soapcpp2 tool d │ │ │ +000e1780: 6563 6c61 7265 2074 6865 203c 636f 6465 eclare the void* po │ │ │ +000e17a0: 6c79 6d6f 7270 6869 6320 6d65 6d62 6572 lymorphic member │ │ │ +000e17b0: 7320 6173 203c 656d 3e3c 636f 6465 3e78 s as x │ │ │ +000e17c0: 7364 3a61 6e79 5479 7065 3c2f 636f 6465 sd:anyType elements. │ │ │ +000e17e0: 3c2f 703e 0a3c 703e 546f 2064 6563 6c61

.

To decla │ │ │ +000e17f0: 7265 2061 2077 7261 7070 6572 2073 7472 re a wrapper str │ │ │ +000e1800: 7563 742f 636c 6173 7320 666f 7220 3c63 uct/class for void* │ │ │ +000e1820: 2070 6f69 6e74 6572 7320 616c 6c6f 7773 pointers allows │ │ │ +000e1830: 2075 7320 746f 2072 6575 7365 2074 6869 us to reuse thi │ │ │ +000e1840: 7320 6d65 6368 616e 6973 6d20 7768 656e s mechanism when │ │ │ +000e1850: 2077 6520 7573 6520 3c63 6f64 653e 5f5f we use __ │ │ │ +000e1860: 7365 6c66 3c2f 636f 6465 3e20 6173 2061 self as a │ │ │ +000e1870: 206d 656d 6265 7220 6e61 6d65 2074 6861 member name tha │ │ │ +000e1880: 7420 7265 6665 7273 2074 6f20 7468 6520 t refers to the │ │ │ +000e1890: 6375 7272 656e 7420 584d 4c20 656c 656d current XML elem │ │ │ +000e18a0: 656e 7420 7461 6720 6e61 6d65 3a3c 2f70 ent tag name:

.
│ │ │ +000e18f0: 7374 7275 6374 203c 2f73 7061 6e3e 5f5f struct __ │ │ │ +000e1900: 616e 7920 3c2f 6469 763e 0a3c 6469 7620 any
.
{.
int │ │ │ +000e1960: 5f5f 7479 7065 3b20 2020 3c73 7061 6e20 __type; │ │ │ +000e1980: 2f2f 2074 6865 2053 4f41 505f 5459 5045 // the SOAP_TYPE │ │ │ +000e1990: 5f54 2070 6f69 6e74 6564 2074 6f20 6279 _T pointed to by │ │ │ +000e19a0: 205f 5f73 656c 663c 2f73 7061 6e3e 3c2f __self.
void │ │ │ +000e19f0: 202a 5f5f 7365 6c66 3b20 3c73 7061 6e20 *__self; │ │ │ +000e1a10: 2f2f 2073 6572 6961 6c69 7a65 2061 6e79 // serialize any │ │ │ +000e1a20: 2074 7970 6520 6f66 2063 6f6e 7465 6e74 type of content │ │ │ +000e1a30: 206f 6620 7468 6520 6375 7272 656e 7420 of the current │ │ │ +000e1a40: 656c 656d 656e 743c 2f73 7061 6e3e 3c2f element.
};
. │ │ │ +000e1a70: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
struct < │ │ │ +000e1aa0: 2f73 7061 6e3e 6e73 5f5f 7265 636f 7264 /span>ns__record │ │ │ +000e1ab0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
{
│ │ │ +000e1ad0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
__any val │ │ │ +000e1af0: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
.
};.

The │ │ │ +000e1b30: 2066 6f6c 6c6f 7769 6e67 2065 7861 6d70 following examp │ │ │ +000e1b40: 6c65 2069 6c6c 7573 7472 6174 6573 2074 le illustrates t │ │ │ +000e1b50: 6865 2069 6e69 7469 616c 697a 6174 696f he initializatio │ │ │ +000e1b60: 6e20 6f66 203c 636f 6465 3e5f 5f6e 735f n of __ns_ │ │ │ +000e1b70: 5f72 6563 6f72 643c 2f63 6f64 653e 2077 _record w │ │ │ +000e1b80: 6974 6820 6120 766f 6964 2070 6f69 6e74 ith a void point │ │ │ +000e1b90: 6572 2074 6f20 616e 2069 6e74 3a3c 2f70 er to an int:

.
│ │ │ +000e1be0: 7374 7275 6374 203c 2f73 7061 6e3e 6e73 struct ns │ │ │ +000e1bf0: 5f5f 7265 636f 7264 2053 3b20 3c2f 6469 __record S; .
i │ │ │ +000e1c30: 6e74 3c2f 7370 616e 3e20 6e20 3d20 3132 nt n = 12 │ │ │ +000e1c40: 333b 203c 2f64 6976 3e0a 3c64 6976 2063 3;
.
S.va │ │ │ +000e1c60: 6c2e 5f5f 6974 656d 203d 2028 3c73 7061 l.__item = (void*)&n;
.
S.val.__type │ │ │ +000e1cc0: 203d 2053 4f41 505f 5459 5045 5f69 6e74 = SOAP_TYPE_int │ │ │ +000e1cd0: 3b20 3c2f 6469 763e 0a3c 2f64 6976 3e3c ;
.
< │ │ │ +000e1ce0: 212d 2d20 6672 6167 6d65 6e74 202d 2d3e !-- fragment --> │ │ │ +000e1cf0: 3c70 3e54 6865 2073 6572 6961 6c69 7a65

The serialize │ │ │ +000e1d00: 6420 6f75 7470 7574 206f 6620 3c63 6f64 d output of S conta │ │ │ +000e1d20: 696e 7320 7468 6520 696e 7465 6765 723a ins the integer: │ │ │ +000e1d30: 3c2f 703e 0a3c 6469 7620 636c 6173 733d

.
& │ │ │ +000e1d70: 6c74 3b3c 7370 616e 2063 6c61 7373 3d22 lt;ns: │ │ │ +000e1d90: 7265 636f 7264 3c2f 7370 616e 3e26 6774 record> │ │ │ +000e1da0: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
.
< │ │ │ +000e1dc0: 3c73 7061 6e20 636c 6173 733d 226b 6579 val xsi:t │ │ │ +000e1e00: 7970 653c 2f73 7061 6e3e 3d3c 7370 616e ype="xsd │ │ │ +000e1e30: 3a69 6e74 2671 756f 743b 3c2f 7370 616e :int">123</val>
.
&l │ │ │ +000e1e90: 743b 2f3c 7370 616e 2063 6c61 7373 3d22 t;/ns: │ │ │ +000e1eb0: 7265 636f 7264 3c2f 7370 616e 3e26 6774 record> │ │ │ +000e1ec0: 3b3c 2f64 6976 3e0a 3c2f 6469 763e 3c21 ;
.
│ │ │ +000e1ee0: 3c2f 6469 763e 3c70 3ef0 9f94 9d20 3c61

.... Back t │ │ │ +000e1f00: 6f20 7461 626c 6520 6f66 2063 6f6e 7465 o table of conte │ │ │ +000e1f10: 6e74 733c 2f61 3e3c 2f70 3e0a 3c68 323e nts

.

│ │ │ +000e1f20: 3c61 2063 6c61 7373 3d22 616e 6368 6f72 .Fixed-si │ │ │ +000e1f50: 7a65 2061 7272 6179 2073 6572 6961 6c69 ze array seriali │ │ │ +000e1f60: 7a61 7469 6f6e 3c2f 6832 3e0a 3c70 3e46 zation

.

F │ │ │ +000e1f70: 6978 6564 2073 697a 6520 6172 7261 7973 ixed size arrays │ │ │ +000e1f80: 2061 7265 2073 6572 6961 6c69 7a65 6420 are serialized │ │ │ +000e1f90: 6173 2072 6570 6574 6974 696f 6e73 206f as repetitions o │ │ │ +000e1fa0: 6620 3c65 6d3e 3c63 6f64 653e 6974 656d f item │ │ │ +000e1fb0: 3c2f 636f 6465 3e3c 2f65 6d3e 2065 6c65 ele │ │ │ +000e1fc0: 6d65 6e74 7320 7769 7468 2074 6865 2061 ments with the a │ │ │ +000e1fd0: 7272 6179 2076 616c 7565 7320 696e 2058 rray values in X │ │ │ +000e1fe0: 4d4c 2e20 4d75 6c74 692d 6469 6d65 6e73 ML. Multi-dimens │ │ │ +000e1ff0: 696f 6e61 6c20 6669 7865 6420 7369 7a65 ional fixed size │ │ │ +000e2000: 2061 7272 6179 7320 6172 6520 7365 7269 arrays are seri │ │ │ +000e2010: 616c 697a 6564 2061 7320 6e65 7374 6564 alized as nested │ │ │ +000e2020: 203c 656d 3e3c 636f 6465 3e69 7465 6d3c item< │ │ │ +000e2030: 2f63 6f64 653e 3c2f 656d 3e20 656c 656d /code> elem │ │ │ +000e2040: 656e 7473 2c20 7768 6572 6520 7468 6520 ents, where the │ │ │ +000e2050: 6f75 7465 7220 656c 656d 656e 7473 2061 outer elements a │ │ │ +000e2060: 7265 2061 7272 6179 732e 3c2f 703e 0a3c re arrays.

.< │ │ │ +000e2070: 703e 5468 6520 7365 7269 616c 697a 6174 p>The serializat │ │ │ +000e2080: 696f 6e20 6f66 2066 6978 6564 2d73 697a ion of fixed-siz │ │ │ +000e2090: 6520 6172 7261 7973 2073 7570 706f 7274 e arrays support │ │ │ +000e20a0: 7320 7468 6520 534f 4150 2052 5043 2065 s the SOAP RPC e │ │ │ +000e20b0: 6e63 6f64 696e 6720 6d75 6c74 692d 6469 ncoding multi-di │ │ │ +000e20c0: 6d65 6e73 696f 6e61 6c20 6172 7261 7920 mensional array │ │ │ +000e20d0: 666f 726d 6174 2061 7320 7765 6c6c 2061 format as well a │ │ │ +000e20e0: 7320 7061 7274 6961 6c6c 7920 7472 616e s partially tran │ │ │ +000e20f0: 736d 6974 7465 6420 616e 6420 7370 6172 smitted and spar │ │ │ +000e2100: 7365 2061 7272 6179 2066 6f72 6d61 7473 se array formats │ │ │ +000e2110: 2073 7461 6e64 6172 6469 7a65 6420 696e standardized in │ │ │ +000e2120: 2053 4f41 5020 312e 3120 616e 6420 312e SOAP 1.1 and 1. │ │ │ +000e2130: 322e 3c2f 703e 0a3c 703e 466f 7220 6578 2.

.

For ex │ │ │ +000e2140: 616d 706c 653a 3c2f 703e 0a3c 6469 7620 ample:

.
// Cont │ │ │ +000e2190: 656e 7473 206f 6620 6669 6c65 2026 7175 ents of file &qu │ │ │ +000e21a0: 6f74 3b66 6978 6564 2e68 2671 756f 743b ot;fixed.h" │ │ │ +000e21b0: 3a20 3c2f 7370 616e 3e3c 2f64 6976 3e0a :
. │ │ │ +000e21c0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
struct < │ │ │ +000e21f0: 2f73 7061 6e3e 4578 616d 706c 6520 3c2f /span>Example .
{
.< │ │ │ +000e2220: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +000e2230: 3e20 2020 203c 7370 616e 2063 6c61 7373 > f │ │ │ +000e2250: 6c6f 6174 3c2f 7370 616e 3e20 615b 335d loat a[3] │ │ │ +000e2260: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
};.

Th │ │ │ +000e22a0: 6973 2073 7065 6369 6669 6573 2061 2066 is specifies a f │ │ │ +000e22b0: 6978 6564 2d73 697a 6520 6172 7261 7920 ixed-size array │ │ │ +000e22c0: 7061 7274 206f 6620 7468 6520 3c63 6f64 part of the struct Example │ │ │ +000e22e0: 3c2f 636f 6465 3e2e 2054 6865 2073 6572 . The ser │ │ │ +000e22f0: 6961 6c69 7a65 6420 6f75 7470 7574 206f ialized output o │ │ │ +000e2300: 6620 6172 7261 7920 3c63 6f64 653e 613c f array a< │ │ │ +000e2310: 2f63 6f64 653e 2069 733a 3c2f 703e 0a3c /code> is:

.< │ │ │ +000e2320: 6469 7620 636c 6173 733d 2261 6c74 223e div class="alt"> │ │ │ +000e2330: 203c 6469 7620 636c 6173 733d 2266 7261
<a& │ │ │ +000e2380: 6774 3b3c 2f64 6976 3e0a 3c64 6976 2063 gt;
.
&l │ │ │ +000e23a0: 743b 3c73 7061 6e20 636c 6173 733d 226b t;item │ │ │ +000e23c0: 3c2f 7370 616e 3e26 6774 3b31 2e30 266c >1.0&l │ │ │ +000e23d0: 743b 2f3c 7370 616e 2063 6c61 7373 3d22 t;/ite │ │ │ +000e23f0: 6d3c 2f73 7061 6e3e 2667 743b 3c2f 6469 m>.
<item │ │ │ +000e2440: 2667 743b 322e 3026 6c74 3b2f 3c73 7061 >2.0</item>
.
│ │ │ +000e2490: 266c 743b 3c73 7061 6e20 636c 6173 733d <it │ │ │ +000e24b0: 656d 3c2f 7370 616e 3e26 6774 3b33 2e30 em>3.0 │ │ │ +000e24c0: 266c 743b 2f3c 7370 616e 2063 6c61 7373 </i │ │ │ +000e24e0: 7465 6d3c 2f73 7061 6e3e 2667 743b 3c2f tem>.
</a&g │ │ │ +000e2530: 743b 3c2f 6469 763e 0a3c 2f64 6976 3e3c t;
.
< │ │ │ +000e2540: 212d 2d20 6672 6167 6d65 6e74 202d 2d3e !-- fragment --> │ │ │ +000e2550: 203c 2f64 6976 3e3c 703e 416e 7920 6465

Any de │ │ │ +000e2560: 7365 7269 616c 697a 6564 2069 7465 6d73 serialized items │ │ │ +000e2570: 206f 6620 616e 2061 7272 6179 2074 6861 of an array tha │ │ │ +000e2580: 7420 646f 206e 6f74 2066 6974 2069 6e20 t do not fit in │ │ │ +000e2590: 7468 6520 6669 7865 6420 7369 7a65 2061 the fixed size a │ │ │ +000e25a0: 7272 6179 2c20 692e 652e 2061 7265 206f rray, i.e. are o │ │ │ +000e25b0: 7574 206f 6620 626f 756e 6473 2c20 6172 ut of bounds, ar │ │ │ +000e25c0: 6520 6967 6e6f 7265 6420 6279 2074 6865 e ignored by the │ │ │ +000e25d0: 2064 6573 6572 6961 6c69 7a65 7220 7768 deserializer wh │ │ │ +000e25e0: 656e 2074 6865 203c 636f 6465 3e23 534f en the #SO │ │ │ +000e25f0: 4150 5f43 5f4e 4f49 4f42 3c2f 636f 6465 AP_C_NOIOB flag is set, o │ │ │ +000e2610: 7468 6572 7769 7365 203c 636f 6465 3e23 therwise # │ │ │ +000e2620: 534f 4150 5f49 4f42 3c2f 636f 6465 3e20 SOAP_IOB │ │ │ +000e2630: 6572 726f 7273 2077 696c 6c20 6265 2067 errors will be g │ │ │ +000e2640: 656e 6572 6174 6564 2062 7920 7468 6520 enerated by the │ │ │ +000e2650: 6465 7365 7269 616c 697a 6572 2e3c 2f70 deserializer.

.

.... Back to ta │ │ │ +000e2680: 626c 6520 6f66 2063 6f6e 7465 6e74 733c ble of contents< │ │ │ +000e2690: 2f61 3e3c 2f70 3e0a 3c68 323e 3c61 2063 /a>

.

│ │ │ +000e26c0: 0a44 796e 616d 6963 2061 7272 6179 2073 .Dynamic array s │ │ │ +000e26d0: 6572 6961 6c69 7a61 7469 6f6e 3c2f 6832 erialization

.

Dynamic arr │ │ │ +000e26f0: 6179 7320 6172 6520 6d75 6368 206d 6f72 ays are much mor │ │ │ +000e2700: 6520 666c 6578 6962 6c65 2074 6861 6e20 e flexible than │ │ │ +000e2710: 6669 7865 642d 7369 7a65 2061 7272 6179 fixed-size array │ │ │ +000e2720: 732e 2044 796e 616d 6963 2061 7272 6179 s. Dynamic array │ │ │ +000e2730: 7320 6465 636c 6172 6564 2069 6e20 7468 s declared in th │ │ │ +000e2740: 6520 696e 7465 7266 6163 6520 6865 6164 e interface head │ │ │ +000e2750: 6572 2066 696c 6520 666f 7220 736f 6170 er file for soap │ │ │ +000e2760: 6370 7032 2061 7265 2061 2073 7065 6369 cpp2 are a speci │ │ │ +000e2770: 616c 2073 7472 7563 7420 6f72 2063 6c61 al struct or cla │ │ │ +000e2780: 7373 206f 7220 6172 6520 7061 7274 206f ss or are part o │ │ │ +000e2790: 6620 6120 7374 7275 6374 206f 7220 636c f a struct or cl │ │ │ +000e27a0: 6173 7320 7769 7468 2061 206d 656d 6265 ass with a membe │ │ │ +000e27b0: 7220 706f 696e 7469 6e67 2074 6f20 616e r pointing to an │ │ │ +000e27c0: 2061 7272 6179 206f 6620 656c 656d 656e array of elemen │ │ │ +000e27d0: 7473 2061 6e64 2061 206d 656d 6265 7220 ts and a member │ │ │ +000e27e0: 7468 6174 2073 746f 7265 7320 7468 6520 that stores the │ │ │ +000e27f0: 7369 7a65 206f 6620 7468 6520 6172 7261 size of the arra │ │ │ +000e2800: 792e 2044 796e 616d 6963 2061 7272 6179 y. Dynamic array │ │ │ +000e2810: 2061 6c6c 6f63 6174 696f 6e73 2061 7265 allocations are │ │ │ +000e2820: 2065 6173 7920 7573 696e 6720 7468 6520 easy using the │ │ │ +000e2830: 736f 6170 6370 702d 6765 6e65 7261 7465 soapcpp-generate │ │ │ +000e2840: 6420 3c63 6f64 653e 736f 6170 5f6e 6577 d soap_new │ │ │ +000e2850: 5f54 3c2f 636f 6465 3e20 6675 6e63 7469 _T functi │ │ │ +000e2860: 6f6e 7320 666f 7220 7479 7065 203c 636f ons for type T. Thi │ │ │ +000e2880: 7320 6675 6e63 7469 6f6e 2069 7320 7573 s function is us │ │ │ +000e2890: 6564 2074 6f20 616c 6c6f 6361 7465 2061 ed to allocate a │ │ │ +000e28a0: 6e20 6172 7261 7920 6f66 2076 616c 7565 n array of value │ │ │ +000e28b0: 7320 7768 6963 6820 6361 6e20 7468 656e s which can then │ │ │ +000e28c0: 2062 6520 6173 7369 676e 6564 2074 6f20 be assigned to │ │ │ +000e28d0: 7468 6520 706f 696e 7465 7220 6d65 6d62 the pointer memb │ │ │ +000e28e0: 6572 206f 6620 7468 6520 7374 7275 6374 er of the struct │ │ │ +000e28f0: 2f63 6c61 7373 2074 6861 7420 7374 6f72 /class that stor │ │ │ +000e2900: 6573 2074 6865 2061 7272 6179 2070 6f69 es the array poi │ │ │ +000e2910: 6e74 6572 2077 6974 6820 6974 7320 7369 nter with its si │ │ │ +000e2920: 7a65 2e3c 2f70 3e0a 3c70 3e54 6f20 6661 ze.

.

To fa │ │ │ +000e2930: 6369 6c69 7461 7465 2053 4f41 5020 5250 cilitate SOAP RP │ │ │ +000e2940: 4320 656e 636f 6469 6e67 2c20 534f 4150 C encoding, SOAP │ │ │ +000e2950: 2d65 6e63 6f64 6564 2061 7272 6179 7320 -encoded arrays │ │ │ +000e2960: 7265 7175 6972 6520 7370 6563 6961 6c20 require special │ │ │ +000e2970: 7472 6561 746d 656e 742e 2053 4f41 502d treatment. SOAP- │ │ │ +000e2980: 656e 636f 6465 6420 6172 7261 7973 2061 encoded arrays a │ │ │ +000e2990: 7265 2073 696e 676c 652d 206f 7220 6d75 re single- or mu │ │ │ +000e29a0: 6c74 692d 6469 6d65 6e73 696f 6e61 6c20 lti-dimensional │ │ │ +000e29b0: 6172 7261 7973 2077 6974 6820 626f 756e arrays with boun │ │ │ +000e29c0: 6473 2074 6861 7420 6170 7065 6172 2069 ds that appear i │ │ │ +000e29d0: 6e20 584d 4c2e 2054 6865 7365 2061 7272 n XML. These arr │ │ │ +000e29e0: 6179 7320 6d61 7920 616c 736f 2068 6176 ays may also hav │ │ │ +000e29f0: 6520 6f66 6673 6574 7320 7468 6174 2064 e offsets that d │ │ │ +000e2a00: 6966 6665 7220 6672 6f6d 207a 6572 6f2e iffer from zero. │ │ │ +000e2a10: 2054 6865 2069 6e74 656e 7420 6f66 2053 The intent of S │ │ │ +000e2a20: 4f41 502d 656e 636f 6465 6420 6172 7261 OAP-encoded arra │ │ │ +000e2a30: 7973 2069 7320 746f 2072 6570 6c69 6361 ys is to replica │ │ │ +000e2a40: 7465 206d 756c 7469 2d64 696d 656e 7369 te multi-dimensi │ │ │ +000e2a50: 6f6e 616c 2061 7272 6179 7320 636f 6d6d onal arrays comm │ │ │ +000e2a60: 6f6e 6c79 2066 6f75 6e64 2069 6e20 7072 only found in pr │ │ │ +000e2a70: 6f67 7261 6d6d 696e 6720 6c61 6e67 7561 ogramming langua │ │ │ +000e2a80: 6765 732e 3c2f 703e 0a3c 703e 486f 7765 ges.

.

Howe │ │ │ +000e2a90: 7665 722c 2058 4d4c 2061 6c73 6f20 7072 ver, XML also pr │ │ │ +000e2aa0: 6f76 6964 6573 2061 2073 696d 706c 6520 ovides a simple │ │ │ +000e2ab0: 7761 7920 746f 2072 6570 7265 7365 6e74 way to represent │ │ │ +000e2ac0: 2061 2073 6571 7565 6e63 6520 6f66 2076 a sequence of v │ │ │ +000e2ad0: 616c 7565 7320 7769 7468 2061 2073 6571 alues with a seq │ │ │ +000e2ae0: 7565 6e63 6520 6f66 2058 4d4c 2065 6c65 uence of XML ele │ │ │ +000e2af0: 6d65 6e74 732e 2054 6869 7320 6469 6666 ments. This diff │ │ │ +000e2b00: 6572 7320 6672 6f6d 2053 4f41 502d 656e ers from SOAP-en │ │ │ +000e2b10: 636f 6465 6420 6172 7261 7973 2069 6e20 coded arrays in │ │ │ +000e2b20: 7468 6174 2053 4f41 502d 656e 636f 6465 that SOAP-encode │ │ │ +000e2b30: 6420 6172 7261 7973 2061 7265 2065 6c65 d arrays are ele │ │ │ +000e2b40: 6d65 6e74 7320 7769 7468 206e 6573 7465 ments with neste │ │ │ +000e2b50: 6420 3c65 6d3e 3c63 6f64 653e 6974 656d d item │ │ │ +000e2b60: 3c2f 636f 6465 3e3c 2f65 6d3e 2065 6c65 ele │ │ │ +000e2b70: 6d65 6e74 7320 7769 7468 2076 616c 7565 ments with value │ │ │ +000e2b80: 732c 2074 686f 7567 6820 534f 4150 2064 s, though SOAP d │ │ │ +000e2b90: 6573 6572 6961 6c69 7a65 7273 206d 6179 eserializers may │ │ │ +000e2ba0: 2069 676e 6f72 6520 7468 6520 6e61 6d65 ignore the name │ │ │ +000e2bb0: 206f 6620 7468 6573 6520 656c 656d 656e of these elemen │ │ │ +000e2bc0: 7473 2077 6865 6e20 7061 7273 696e 6720 ts when parsing │ │ │ +000e2bd0: 584d 4c20 6173 2073 7461 7465 6420 696e XML as stated in │ │ │ +000e2be0: 2074 6865 2053 4f41 5020 7370 6563 6966 the SOAP specif │ │ │ +000e2bf0: 6963 6174 696f 6e73 2e3c 2f70 3e0a 3c70 ications.

.

Both SOAP-encod │ │ │ +000e2c10: 6564 2061 7272 6179 7320 616e 6420 7365 ed arrays and se │ │ │ +000e2c20: 7175 656e 6365 7320 6f66 2058 4d4c 2065 quences of XML e │ │ │ +000e2c30: 6c65 6d65 6e74 7320 6172 6520 7375 7070 lements are supp │ │ │ +000e2c40: 6f72 7465 6420 696e 2067 534f 4150 2c20 orted in gSOAP, │ │ │ +000e2c50: 7573 696e 6720 6479 6e61 6d69 6320 6172 using dynamic ar │ │ │ +000e2c60: 7261 7973 2061 6e64 2063 6f6e 7461 696e rays and contain │ │ │ +000e2c70: 6572 732e 2054 6865 2062 6173 6963 7320 ers. The basics │ │ │ +000e2c80: 7769 6c6c 2062 6520 6465 7363 7269 6265 will be describe │ │ │ +000e2c90: 6420 6e65 7874 2e20 466f 7220 6164 6469 d next. For addi │ │ │ +000e2ca0: 7469 6f6e 616c 2064 6574 6169 6c73 2c20 tional details, │ │ │ +000e2cb0: 7365 6520 7468 6520 3c61 2068 7265 663d see the C and C++ XM │ │ │ +000e2cf0: 4c20 4461 7461 2042 696e 6469 6e67 733c L Data Bindings< │ │ │ +000e2d00: 2f61 3e20 646f 6375 6d65 6e74 6174 696f /a> documentatio │ │ │ +000e2d10: 6e2e 3c2f 703e 0a3c 703e f09f 949d 203c n.

.

.... < │ │ │ +000e2d20: 6120 6872 6566 3d22 2322 3e42 6163 6b20 a href="#">Back │ │ │ +000e2d30: 746f 2074 6162 6c65 206f 6620 636f 6e74 to table of cont │ │ │ +000e2d40: 656e 7473 3c2f 613e 3c2f 703e 0a3c 6833 ents

.

.SOAP-en │ │ │ +000e2d80: 636f 6465 6420 6172 7261 7920 626f 756e coded array boun │ │ │ +000e2d90: 6473 3c2f 6833 3e0a 3c70 3e53 4f41 502d ds

.

SOAP- │ │ │ +000e2da0: 656e 636f 6465 6420 6172 7261 7973 2075 encoded arrays u │ │ │ +000e2db0: 7365 2074 6865 203c 656d 3e3c 636f 6465 se the SOAP-ENC:Array< │ │ │ +000e2dd0: 2f63 6f64 653e 3c2f 656d 3e20 6174 7472 /code> attr │ │ │ +000e2de0: 6962 7574 6520 696e 2058 4d4c 2074 6f20 ibute in XML to │ │ │ +000e2df0: 6964 656e 7469 6679 2074 6865 2061 7272 identify the arr │ │ │ +000e2e00: 6179 2061 6e64 2074 6865 203c 656d 3e3c ay and the < │ │ │ +000e2e10: 636f 6465 3e53 4f41 502d 454e 433a 6172 code>SOAP-ENC:ar │ │ │ +000e2e20: 7261 7954 7970 653c 2f63 6f64 653e 3c2f rayType attribute to │ │ │ +000e2e40: 2069 6465 6e74 6966 7920 7468 6520 6172 identify the ar │ │ │ +000e2e50: 7261 7920 6469 6d65 6e73 696f 6e61 6c69 ray dimensionali │ │ │ +000e2e60: 7479 2061 6e64 2069 7473 2073 697a 652e ty and its size. │ │ │ +000e2e70: 3c2f 703e 0a3c 703e 4173 2061 2073 6563

.

As a sec │ │ │ +000e2e80: 7572 6974 7920 6d65 6173 7572 6520 746f urity measure to │ │ │ +000e2e90: 2061 766f 6964 2064 656e 6961 6c20 6f66 avoid denial of │ │ │ +000e2ea0: 2073 6572 7669 6365 2061 7474 6163 6b73 service attacks │ │ │ +000e2eb0: 2062 6173 6564 206f 6e20 7365 6e64 696e based on sendin │ │ │ +000e2ec0: 6720 6120 6875 6765 2061 7272 6179 2073 g a huge array s │ │ │ +000e2ed0: 697a 6520 7661 6c75 6520 7573 696e 6720 ize value using │ │ │ +000e2ee0: 7468 6520 3c65 6d3e 3c63 6f64 653e 534f the SO │ │ │ +000e2ef0: 4150 2d45 4e43 3a61 7272 6179 5479 7065 AP-ENC:arrayType │ │ │ +000e2f00: 3c2f 636f 6465 3e3c 2f65 6d3e 2061 7474 att │ │ │ +000e2f10: 7269 6275 7465 2c20 7265 7175 6972 696e ribute, requirin │ │ │ +000e2f20: 6720 7468 6520 616c 6c6f 6361 7469 6f6e g the allocation │ │ │ +000e2f30: 206f 6620 6c61 7267 6520 6368 756e 6b73 of large chunks │ │ │ +000e2f40: 206f 6620 6d65 6d6f 7279 2c20 7468 6520 of memory, the │ │ │ +000e2f50: 746f 7461 6c20 6e75 6d62 6572 206f 6620 total number of │ │ │ +000e2f60: 6172 7261 7920 656c 656d 656e 7473 2073 array elements s │ │ │ +000e2f70: 6574 2062 7920 7468 6520 3c65 6d3e 3c63 et by the SOAP-ENC:arr │ │ │ +000e2f90: 6179 5479 7065 3c2f 636f 6465 3e3c 2f65 ayType attribute can │ │ │ +000e2fb0: 6e6f 7420 6578 6365 6564 203c 636f 6465 not exceed #SOAP_MAXARRAYS │ │ │ +000e2fd0: 495a 453c 2f63 6f64 653e 2c20 7768 6963 IZE, whic │ │ │ +000e2fe0: 6820 6973 2073 6574 2074 6f20 3130 3030 h is set to 1000 │ │ │ +000e2ff0: 3030 2062 7920 6465 6661 756c 742e 2054 00 by default. T │ │ │ +000e3000: 6869 7320 6c69 6d69 7420 6973 206e 6f74 his limit is not │ │ │ +000e3010: 2061 2068 6172 6420 6c69 6d69 7420 6f6e a hard limit on │ │ │ +000e3020: 2074 6865 206e 756d 6265 7220 6f66 2061 the number of a │ │ │ +000e3030: 7272 6179 2065 6c65 6d65 6e74 732c 2062 rray elements, b │ │ │ +000e3040: 7574 2072 6174 6865 7220 746f 2061 766f ut rather to avo │ │ │ +000e3050: 6964 2070 7265 2d61 6c6c 6f63 6174 696e id pre-allocatin │ │ │ +000e3060: 6720 6c61 7267 6520 6172 7261 7973 2061 g large arrays a │ │ │ +000e3070: 7320 7374 6174 6564 2e20 5468 6520 6861 s stated. The ha │ │ │ +000e3080: 7264 206c 696d 6974 206f 6e20 7468 6520 rd limit on the │ │ │ +000e3090: 6e75 6d62 6572 206f 6620 6172 7261 7920 number of array │ │ │ +000e30a0: 656c 656d 656e 7473 2072 6563 6569 7665 elements receive │ │ │ +000e30b0: 6420 6973 203c 636f 6465 3e3c 6120 636c d is soap::maxoccu │ │ │ +000e3180: 7273 3c2f 613e 3c2f 636f 6465 3e20 7768 rs wh │ │ │ +000e3190: 6963 6820 6973 2073 6574 2074 6f20 3c63 ich is set to #SOAP_MAXOCC │ │ │ +000e31b0: 5552 533c 2f63 6f64 653e 2062 7920 6465 URS by de │ │ │ +000e31c0: 6661 756c 742e 2042 7920 636f 6e74 7261 fault. By contra │ │ │ +000e31d0: 7374 2c20 7468 6520 3c63 6f64 653e 2353 st, the #S │ │ │ +000e31e0: 4f41 505f 4d41 5841 5252 4159 5349 5a45 OAP_MAXARRAYSIZE │ │ │ +000e31f0: 3c2f 636f 6465 3e20 6c69 6d69 7420 6f6e limit on │ │ │ +000e3200: 6c79 206e 6567 6174 6976 656c 7920 6166 ly negatively af │ │ │ +000e3210: 6665 6374 7320 6d75 6c74 692d 6469 6d65 fects multi-dime │ │ │ +000e3220: 6e73 696f 6e61 6c20 6172 7261 7973 2062 nsional arrays b │ │ │ +000e3230: 6563 6175 7365 2074 6865 2064 696d 656e ecause the dimen │ │ │ +000e3240: 7369 6f6e 616c 6974 7920 6f66 2074 6865 sionality of the │ │ │ +000e3250: 2072 6563 6569 7669 6e67 2061 7272 6179 receiving array │ │ │ +000e3260: 206d 6179 2062 6520 6c6f 7374 2077 6865 may be lost whe │ │ │ +000e3270: 6e20 7468 6520 6e75 6d62 6572 206f 6620 n the number of │ │ │ +000e3280: 656c 656d 656e 7473 2065 7863 6565 6473 elements exceeds │ │ │ +000e3290: 2031 3030 3030 302e 204f 6e65 2d64 696d 100000. One-dim │ │ │ +000e32a0: 656e 7369 6f6e 616c 2061 7272 6179 7320 ensional arrays │ │ │ +000e32b0: 6172 6520 6e6f 7420 6166 6665 6374 6564 are not affected │ │ │ +000e32c0: 2061 6e64 2070 6f70 756c 6174 6564 2061 and populated a │ │ │ +000e32d0: 6674 6572 2074 6869 7320 6c69 6d69 7420 fter this limit │ │ │ +000e32e0: 6279 2073 696d 706c 7920 6465 7365 7269 by simply deseri │ │ │ +000e32f0: 616c 697a 696e 6720 7468 6520 6172 7261 alizing the arra │ │ │ +000e3300: 7920 656c 656d 656e 7473 2072 6563 6569 y elements recei │ │ │ +000e3310: 7665 642e 3c2f 703e 0a3c 703e f09f 949d ved.

.

.... │ │ │ +000e3320: 203c 6120 6872 6566 3d22 2322 3e42 6163 Bac │ │ │ +000e3330: 6b20 746f 2074 6162 6c65 206f 6620 636f k to table of co │ │ │ +000e3340: 6e74 656e 7473 3c2f 613e 3c2f 703e 0a3c ntents

.< │ │ │ +000e3350: 6833 3e3c 6120 636c 6173 733d 2261 6e63 h3>< │ │ │ +000e3370: 2f61 3e0a 4f6e 652d 6469 6d65 6e73 696f /a>.One-dimensio │ │ │ +000e3380: 6e61 6c20 6479 6e61 6d69 6320 534f 4150 nal dynamic SOAP │ │ │ +000e3390: 2d65 6e63 6f64 6564 2061 7272 6179 733c -encoded arrays< │ │ │ +000e33a0: 2f68 333e 0a3c 703e 4120 7370 6563 6961 /h3>.

A specia │ │ │ +000e33b0: 6c20 666f 726d 206f 6620 7374 7275 6374 l form of struct │ │ │ +000e33c0: 206f 7220 636c 6173 7320 6973 2075 7365 or class is use │ │ │ +000e33d0: 6420 746f 2064 6566 696e 6520 6f6e 652d d to define one- │ │ │ +000e33e0: 6469 6d65 6e73 696f 6e61 6c20 6479 6e61 dimensional dyna │ │ │ +000e33f0: 6d69 6320 534f 4150 2d65 6e63 6f64 6564 mic SOAP-encoded │ │ │ +000e3400: 2061 7272 6179 7320 696e 2061 6e20 696e arrays in an in │ │ │ +000e3410: 7465 7266 6163 6520 6865 6164 6572 2066 terface header f │ │ │ +000e3420: 696c 6520 666f 7220 736f 6170 6370 7032 ile for soapcpp2 │ │ │ +000e3430: 2e20 4561 6368 2061 7272 6179 2068 6173 . Each array has │ │ │ +000e3440: 2061 2070 6f69 6e74 6572 2076 6172 6961 a pointer varia │ │ │ +000e3450: 626c 6520 616e 6420 6120 6d65 6d62 6572 ble and a member │ │ │ +000e3460: 2074 6861 7420 7265 636f 7264 7320 7468 that records th │ │ │ +000e3470: 6520 6e75 6d62 6572 206f 6620 656c 656d e number of elem │ │ │ +000e3480: 656e 7473 2074 6865 2070 6f69 6e74 6572 ents the pointer │ │ │ +000e3490: 2070 6f69 6e74 7320 746f 2069 6e20 6d65 points to in me │ │ │ +000e34a0: 6d6f 7279 2e3c 2f70 3e0a 3c70 3e54 6865 mory.

.

The │ │ │ +000e34b0: 2067 656e 6572 616c 2066 6f72 6d20 6f66 general form of │ │ │ +000e34c0: 2074 6865 2073 7472 7563 7420 6f72 2063 the struct or c │ │ │ +000e34d0: 6c61 7373 2064 6563 6c61 7261 7469 6f6e lass declaration │ │ │ +000e34e0: 2074 6861 7420 636f 6e74 6169 6e73 2061 that contains a │ │ │ +000e34f0: 206f 6e65 2d64 696d 656e 7369 6f6e 616c one-dimensional │ │ │ +000e3500: 2064 796e 616d 6963 2053 4f41 502d 656e dynamic SOAP-en │ │ │ +000e3510: 636f 6465 6420 6172 7261 7920 6973 3a3c coded array is:< │ │ │ +000e3520: 2f70 3e0a 3c64 6976 2063 6c61 7373 3d22 /p>.

struct │ │ │ +000e3570: 6172 7261 795f 6e61 6d65 203c 2f64 6976 array_name
.
{
.
│ │ │ +000e35b0: 2020 5479 7065 202a 5f5f 7074 723b 2020 Type *__ptr; │ │ │ +000e35c0: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // pointer │ │ │ +000e35e0: 2074 6f20 6172 7261 7920 6f66 2065 6c65 to array of ele │ │ │ +000e35f0: 6d65 6e74 7320 696e 206d 656d 6f72 793c ments in memory< │ │ │ +000e3600: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
. │ │ │ +000e3620: 2020 203c 7370 616e 2063 6c61 7373 3d22 int │ │ │ +000e3640: 3c2f 7370 616e 3e20 5f5f 7369 7a65 3b20 __size; │ │ │ +000e3650: 2020 3c73 7061 6e20 636c 6173 733d 2263 // numbe │ │ │ +000e3670: 7220 6f66 2065 6c65 6d65 6e74 7320 706f r of elements po │ │ │ +000e3680: 696e 7465 6420 746f 203c 2f73 7061 6e3e inted to │ │ │ +000e3690: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
int __offset; // optional SO │ │ │ +000e3700: 4150 2031 2e31 2061 7272 6179 206f 6666 AP 1.1 array off │ │ │ +000e3710: 7365 743c 2f73 7061 6e3e 3c2f 6469 763e set
│ │ │ +000e3720: 0a3c 6469 7620 636c 6173 733d 226c 696e .
... │ │ │ +000e3740: 2020 2020 203c 7370 616e 2063 6c61 7373 // an │ │ │ +000e3760: 7974 6869 6e67 2074 6861 7420 666f 6c6c ything that foll │ │ │ +000e3770: 6f77 7320 6865 7265 2077 696c 6c20 6265 ows here will be │ │ │ +000e3780: 2069 676e 6f72 6564 203c 2f73 7061 6e3e ignored │ │ │ +000e3790: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
};
.

wher │ │ │ +000e37d0: 6520 7468 6520 3c63 6f64 653e 6172 7261 e the arra │ │ │ +000e37e0: 795f 6e61 6d65 3c2f 636f 6465 3e20 6d75 y_name mu │ │ │ +000e37f0: 7374 2062 6520 6120 6e6f 6e2d 7175 616c st be a non-qual │ │ │ +000e3800: 6966 6965 6420 6e61 6d65 2061 6e64 203c ified name and < │ │ │ +000e3810: 636f 6465 3e54 7970 653c 2f63 6f64 653e code>Type │ │ │ +000e3820: 2069 7320 7468 6520 7479 7065 2066 6f72 is the type for │ │ │ +000e3830: 2074 6865 2065 6c65 6d65 6e74 7320 6f66 the elements of │ │ │ +000e3840: 2074 6865 2061 7272 6179 2e20 5468 6520 the array. The │ │ │ +000e3850: 3c63 6f64 653e 5f5f 7074 723c 2f63 6f64 __ptr member points │ │ │ +000e3870: 2074 6f20 7468 6520 6172 7261 7920 7661 to the array va │ │ │ +000e3880: 6c75 6573 2061 6e64 203c 636f 6465 3e5f lues and _ │ │ │ +000e3890: 5f73 697a 653c 2f63 6f64 653e 2069 7320 _size is │ │ │ +000e38a0: 7468 6520 6172 7261 7920 7369 7a65 2e20 the array size. │ │ │ +000e38b0: 5468 6520 3c63 6f64 653e 5f5f 6f66 6673 The __offs │ │ │ +000e38c0: 6574 3c2f 636f 6465 3e20 6d65 6d62 6572 et member │ │ │ +000e38d0: 2073 7065 6369 6669 6573 2061 6e20 6f70 specifies an op │ │ │ +000e38e0: 7469 6f6e 616c 2061 7272 6179 206f 6666 tional array off │ │ │ +000e38f0: 7365 742c 2077 6865 6e20 6e6f 6e7a 6572 set, when nonzer │ │ │ +000e3900: 6f2c 2073 6565 2053 6563 7469 6f6e 203c o, see Section < │ │ │ +000e3910: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ +000e3920: 663d 2269 6e64 6578 2e68 746d 6c23 6f6e f="index.html#on │ │ │ +000e3930: 6564 6f66 6673 6574 223e 4f6e 652d 6469 edoffset">One-di │ │ │ +000e3940: 6d65 6e73 696f 6e61 6c20 6479 6e61 6d69 mensional dynami │ │ │ +000e3950: 6320 534f 4150 2d65 6e63 6f64 6564 2061 c SOAP-encoded a │ │ │ +000e3960: 7272 6179 7320 7769 7468 206e 6f6e 2d7a rrays with non-z │ │ │ +000e3970: 6572 6f20 6f66 6673 6574 733c 2f61 3e2e ero offsets. │ │ │ +000e3980: 3c2f 703e 0a3c 703e 4966 2074 6865 203c

.

If the < │ │ │ +000e3990: 636f 6465 3e61 7272 6179 5f6e 616d 653c code>array_name< │ │ │ +000e39a0: 2f63 6f64 653e 2069 7320 7175 616c 6966 /code> is qualif │ │ │ +000e39b0: 6965 6420 7769 7468 2061 206e 616d 6573 ied with a names │ │ │ +000e39c0: 7061 6365 2070 7265 6669 7820 7468 656e pace prefix then │ │ │ +000e39d0: 2074 6865 2061 7272 6179 2069 7320 6e6f the array is no │ │ │ +000e39e0: 7420 6120 534f 4150 2d65 6e63 6f64 6564 t a SOAP-encoded │ │ │ +000e39f0: 2061 7272 6179 2062 7574 2072 6174 6865 array but rathe │ │ │ +000e3a00: 7220 7265 7072 6573 656e 7473 2061 2073 r represents a s │ │ │ +000e3a10: 6571 7565 6e63 6520 6f66 2058 4d4c 2065 equence of XML e │ │ │ +000e3a20: 6c65 6d65 6e74 732c 2073 6565 2053 6563 lements, see Sec │ │ │ +000e3a30: 7469 6f6e 203c 6120 636c 6173 733d 2265 tion Non-SO │ │ │ +000e3a60: 4150 2064 796e 616d 6963 2061 7272 6179 AP dynamic array │ │ │ +000e3a70: 733c 2f61 3e2e 3c2f 703e 0a3c 703e 5468 s.

.

Th │ │ │ +000e3a80: 6520 736f 6170 6370 7032 2d67 656e 6572 e soapcpp2-gener │ │ │ +000e3a90: 6174 6564 2064 6573 6572 6961 6c69 7a65 ated deserialize │ │ │ +000e3aa0: 7220 6f66 2061 206f 6e65 2d64 696d 656e r of a one-dimen │ │ │ +000e3ab0: 7369 6f6e 616c 2064 796e 616d 6963 2061 sional dynamic a │ │ │ +000e3ac0: 7272 6179 2063 616e 2064 6573 6572 6961 rray can deseria │ │ │ +000e3ad0: 6c69 7a65 2070 6172 7469 616c 6c79 2074 lize partially t │ │ │ +000e3ae0: 7261 6e73 6d69 7474 6564 2061 6e64 2f6f ransmitted and/o │ │ │ +000e3af0: 7220 534f 4150 2d65 6e63 6f64 6564 2073 r SOAP-encoded s │ │ │ +000e3b00: 7061 7273 6520 6172 7261 7973 2c20 616e parse arrays, an │ │ │ +000e3b10: 6420 6576 656e 206d 756c 7469 2d64 696d d even multi-dim │ │ │ +000e3b20: 656e 7369 6f6e 616c 2061 7272 6179 7320 ensional arrays │ │ │ +000e3b30: 7768 6963 6820 7769 6c6c 2062 6520 636f which will be co │ │ │ +000e3b40: 6c6c 6170 7365 6420 696e 746f 2061 206f llapsed into a o │ │ │ +000e3b50: 6e65 2d64 696d 656e 7369 6f6e 616c 2061 ne-dimensional a │ │ │ +000e3b60: 7272 6179 2077 6974 6820 726f 772d 6d61 rray with row-ma │ │ │ +000e3b70: 6a6f 7220 6f72 6465 7269 6e67 2e3c 2f70 jor ordering.

.
WarningSOAP 1.2 does │ │ │ +000e3bc0: 6e6f 7420 7375 7070 6f72 7420 7061 7274 not support part │ │ │ +000e3bd0: 6961 6c6c 7920 7472 616e 736d 6974 7465 ially transmitte │ │ │ +000e3be0: 6420 6172 7261 7973 2061 6e64 2074 6865 d arrays and the │ │ │ +000e3bf0: 203c 636f 6465 3e5f 5f6f 6666 7365 743c __offset< │ │ │ +000e3c00: 2f63 6f64 653e 206d 656d 6265 7220 6f66 /code> member of │ │ │ +000e3c10: 2061 2064 796e 616d 6963 2061 7272 6179 a dynamic array │ │ │ +000e3c20: 2069 7320 6967 6e6f 7265 642e 3c2f 6464 is ignored.
.

.... < │ │ │ +000e3c40: 6120 6872 6566 3d22 2322 3e42 6163 6b20 a href="#">Back │ │ │ +000e3c50: 746f 2074 6162 6c65 206f 6620 636f 6e74 to table of cont │ │ │ +000e3c60: 656e 7473 3c2f 613e 3c2f 703e 0a3c 6833 ents

.

.One-dime │ │ │ +000e3ca0: 6e73 696f 6e61 6c20 6479 6e61 6d69 6320 nsional dynamic │ │ │ +000e3cb0: 534f 4150 2d65 6e63 6f64 6564 2061 7272 SOAP-encoded arr │ │ │ +000e3cc0: 6179 7320 7769 7468 206e 6f6e 2d7a 6572 ays with non-zer │ │ │ +000e3cd0: 6f20 6f66 6673 6574 733c 2f68 333e 0a3c o offsets

.< │ │ │ +000e3ce0: 703e 5468 6520 6465 636c 6172 6174 696f p>The declaratio │ │ │ +000e3cf0: 6e20 6f66 2061 2064 796e 616d 6963 2061 n of a dynamic a │ │ │ +000e3d00: 7272 6179 2061 7320 6465 7363 7269 6265 rray as describe │ │ │ +000e3d10: 6420 696e 2053 6563 7469 6f6e 203c 6120 d in Section One-dimensiona │ │ │ +000e3d50: 6c20 6479 6e61 6d69 6320 534f 4150 2d65 l dynamic SOAP-e │ │ │ +000e3d60: 6e63 6f64 6564 2061 7272 6179 733c 2f61 ncoded arrays may include an │ │ │ +000e3d80: 203c 636f 6465 3e69 6e74 205f 5f6f 6666 int __off │ │ │ +000e3d90: 7365 743c 2f63 6f64 653e 206d 656d 6265 set membe │ │ │ +000e3da0: 722e 2057 6865 6e20 7365 7420 746f 2061 r. When set to a │ │ │ +000e3db0: 6e20 696e 7465 6765 7220 7661 6c75 652c n integer value, │ │ │ +000e3dc0: 2074 6865 2073 6572 6961 6c69 7a65 7220 the serializer │ │ │ +000e3dd0: 6f66 2074 6865 2064 796e 616d 6963 2061 of the dynamic a │ │ │ +000e3de0: 7272 6179 2077 696c 6c20 7573 6520 7468 rray will use th │ │ │ +000e3df0: 6973 206d 656d 6265 7220 6173 2074 6865 is member as the │ │ │ +000e3e00: 2073 7461 7274 2069 6e64 6578 206f 6620 start index of │ │ │ +000e3e10: 7468 6520 6172 7261 7920 616e 6420 7468 the array and th │ │ │ +000e3e20: 6520 534f 4150 2d65 6e63 6f64 6564 2061 e SOAP-encoded a │ │ │ +000e3e30: 7272 6179 206f 6666 7365 7420 6174 7472 rray offset attr │ │ │ +000e3e40: 6962 7574 6520 3c65 6d3e 3c63 6f64 653e ibute │ │ │ +000e3e50: 534f 4150 2d45 4e43 3a6f 6666 7365 743c SOAP-ENC:offset< │ │ │ +000e3e60: 2f63 6f64 653e 3c2f 656d 3e20 7769 6c6c /code> will │ │ │ +000e3e70: 2061 7070 6561 7220 696e 2074 6865 2058 appear in the X │ │ │ +000e3e80: 4d4c 206d 6573 7361 6765 2e20 4e6f 7465 ML message. Note │ │ │ +000e3e90: 2074 6861 7420 6172 7261 7920 6f66 6673 that array offs │ │ │ +000e3ea0: 6574 7320 6973 2061 2053 4f41 5020 312e ets is a SOAP 1. │ │ │ +000e3eb0: 3120 7370 6563 6966 6963 2066 6561 7475 1 specific featu │ │ │ +000e3ec0: 7265 2077 6869 6368 2069 7320 6e6f 7420 re which is not │ │ │ +000e3ed0: 7375 7070 6f72 7465 6420 696e 2053 4f41 supported in SOA │ │ │ +000e3ee0: 5020 312e 322e 3c2f 703e 0a3c 703e 466f P 1.2.

.

Fo │ │ │ +000e3ef0: 7220 6578 616d 706c 652c 2074 6865 2066 r example, the f │ │ │ +000e3f00: 6f6c 6c6f 7769 6e67 2068 6561 6465 7220 ollowing header │ │ │ +000e3f10: 6669 6c65 2064 6563 6c61 7265 7320 6120 file declares a │ │ │ +000e3f20: 6e75 6d65 7269 6320 3c63 6f64 653e 5665 numeric Ve │ │ │ +000e3f30: 6374 6f72 3c2f 636f 6465 3e20 636c 6173 ctor clas │ │ │ +000e3f40: 732c 2077 6869 6368 2069 7320 6120 6479 s, which is a dy │ │ │ +000e3f50: 6e61 6d69 6320 6172 7261 7920 6f66 2066 namic array of f │ │ │ +000e3f60: 6c6f 6174 696e 6720 706f 696e 7420 7661 loating point va │ │ │ +000e3f70: 6c75 6573 2077 6974 6820 616e 2069 6e64 lues with an ind │ │ │ +000e3f80: 6578 2074 6861 7420 7374 6172 7473 2061 ex that starts a │ │ │ +000e3f90: 7420 313a 3c2f 703e 0a3c 6469 7620 636c t 1:

.
< │ │ │ +000e3fb0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +000e3fc0: 3e3c 7370 616e 2063 6c61 7373 3d22 636f >// Conten │ │ │ +000e3fe0: 7473 206f 6620 6669 6c65 2026 7175 6f74 ts of file " │ │ │ +000e3ff0: 3b76 6563 746f 722e 6826 7175 6f74 3b3a ;vector.h": │ │ │ +000e4000: 203c 2f73 7061 6e3e 3c2f 6469 763e 0a3c
.< │ │ │ +000e4010: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +000e4020: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >class
Vector
.
{ publ │ │ │ +000e4080: 6963 3c2f 7370 616e 3e3a 3c2f 6469 763e ic:
│ │ │ +000e4090: 0a3c 6469 7620 636c 6173 733d 226c 696e .
float *_ │ │ │ +000e40d0: 5f70 7472 3b20 3c2f 6469 763e 0a3c 6469 _ptr;
. │ │ │ +000e40f0: 2020 203c 7370 616e 2063 6c61 7373 3d22 int │ │ │ +000e4110: 3c2f 7370 616e 3e20 5f5f 7369 7a65 3b20 __size; │ │ │ +000e4120: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
int __offset; .
Vector( │ │ │ +000e4190: 293b 3c2f 6469 763e 0a3c 6469 7620 636c );
.
V │ │ │ +000e41b0: 6563 746f 7228 3c73 7061 6e20 636c 6173 ector(stru │ │ │ +000e41d0: 6374 3c2f 7370 616e 3e20 3c61 2063 6c61 ct soap *, int n);
.
│ │ │ +000e4250: 2020 3c73 7061 6e20 636c 6173 733d 226b floa │ │ │ +000e4270: 743c 2f73 7061 6e3e 2661 6d70 3b20 6f70 t& op │ │ │ +000e4280: 6572 6174 6f72 5b5d 283c 7370 616e 2063 erator[](int i) │ │ │ +000e42b0: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
< │ │ │ +000e42d0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +000e42e0: 6f72 6422 3e73 7472 7563 7420 3c2f 7370 ord">struct soap *soa │ │ │ +000e4370: 703c 2f61 3e3b 3c2f 6469 763e 0a3c 6469 p;
.} │ │ │ +000e4390: 3b3c 2f64 6976 3e0a 3c2f 6469 763e 3c21 ;
.
< │ │ │ +000e43b0: 703e 5468 6520 696d 706c 656d 656e 7461 p>The implementa │ │ │ +000e43c0: 7469 6f6e 7320 6f66 2074 6865 203c 636f tions of the Vector │ │ │ +000e43e0: 206d 6574 686f 6473 2061 7265 3a3c 2f70 methods are:

.
Vector │ │ │ +000e4420: 3a3a 5665 6374 6f72 2829 3c2f 6469 763e ::Vector()
│ │ │ +000e4430: 0a3c 6469 7620 636c 6173 733d 226c 696e .
{
.
t │ │ │ +000e4460: 6869 732d 2667 743b 736f 6170 5f64 6566 his->soap_def │ │ │ +000e4470: 6175 6c74 284e 554c 4c29 3b3c 2f64 6976 ault(NULL);
.
}
.
Ve │ │ │ +000e44b0: 6374 6f72 3a3a 5665 6374 6f72 283c 7370 ctor::Vector(struct │ │ │ +000e44e0: 203c 6120 636c 6173 733d 2263 6f64 6522 soap │ │ │ +000e4510: 202a 3c61 2063 6c61 7373 3d22 636f 6465 *soap, int │ │ │ +000e4560: 3c2f 7370 616e 3e20 6e29 203c 2f64 6976 n)
.
{
.
│ │ │ +000e45a0: 7468 6973 2d26 6774 3b73 6f61 7020 3d20 this->soap = │ │ │ +000e45b0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap;
.
__p │ │ │ +000e4620: 7472 203d 2073 6f61 705f 6e65 775f 666c tr = soap_new_fl │ │ │ +000e4630: 6f61 7428 3c61 2063 6c61 7373 3d22 636f oat(soap< │ │ │ +000e4660: 2f61 3e2c 206e 293b 203c 2f64 6976 3e0a /a>, n);
. │ │ │ +000e4670: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
__size = n; │ │ │ +000e4690: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
__off │ │ │ +000e46b0: 7365 7420 3d20 313b 203c 2f64 6976 3e0a set = 1;
. │ │ │ +000e46c0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
}
.
float& Vector: │ │ │ +000e4720: 3a6f 7065 7261 746f 725b 5d28 3c73 7061 :operator[](int │ │ │ +000e4750: 2069 2920 3c2f 6469 763e 0a3c 6469 7620 i)
.
{.
return │ │ │ +000e47b0: 205f 5f70 7472 5b69 202d 205f 5f6f 6666 __ptr[i - __off │ │ │ +000e47c0: 7365 745d 3b20 3c2f 6469 763e 0a3c 6469 set];
.} │ │ │ +000e47e0: 3c2f 6469 763e 0a3c 2f64 6976 3e3c 212d
.

An example prog │ │ │ +000e4810: 7261 6d20 6672 6167 6d65 6e74 2074 6861 ram fragment tha │ │ │ +000e4820: 7420 7365 7269 616c 697a 6573 2061 2076 t serializes a v │ │ │ +000e4830: 6563 746f 7220 6f66 2033 2065 6c65 6d65 ector of 3 eleme │ │ │ +000e4840: 6e74 733a 3c2f 703e 0a3c 6469 7620 636c nts:

.
< │ │ │ +000e4860: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +000e4870: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >struct soap │ │ │ +000e48c0: 3c2f 613e 202a 3c61 2063 6c61 7373 3d22 *soa │ │ │ +000e48f0: 703c 2f61 3e20 3d20 3c61 2063 6c61 7373 p = soa │ │ │ +000e4950: 705f 6e65 773c 2f61 3e28 293b 203c 2f64 p_new(); .
Vector v(< │ │ │ +000e4980: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +000e4990: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ +000e49a0: 6874 6d6c 223e 736f 6170 3c2f 613e 2c20 html">soap, │ │ │ +000e49b0: 3329 3b3c 2f64 6976 3e0a 3c64 6976 2063 3);
.
v[1] │ │ │ +000e49d0: 203d 2031 2e30 3b20 3c2f 6469 763e 0a3c = 1.0;
.< │ │ │ +000e49e0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +000e49f0: 3e76 5b32 5d20 3d20 322e 303b 203c 2f64 >v[2] = 2.0; .
v[3] = 3.0 │ │ │ +000e4a20: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
soap_ │ │ │ +000e4a40: 7772 6974 655f 5665 6374 6f72 283c 6120 write_Vector(soap, &a │ │ │ +000e4a80: 6d70 3b76 293b 3c2f 6469 763e 0a3c 6469 mp;v);
.< │ │ │ +000e4aa0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +000e4ab0: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ +000e4ac0: 705f 5f63 6f6e 7465 7874 2e68 746d 6c23 p__context.html# │ │ │ +000e4ad0: 6761 6637 6430 3137 3631 3631 6539 6465 gaf7d0176161e9de │ │ │ +000e4ae0: 6633 3639 3831 6532 3466 6161 3139 3133 f36981e24faa1913 │ │ │ +000e4af0: 6439 223e 736f 6170 5f64 6573 7472 6f79 d9">soap_destroy │ │ │ +000e4b00: 3c2f 613e 283c 6120 636c 6173 733d 2263 (soap │ │ │ +000e4b30: 3c2f 613e 293b 3c2f 6469 763e 0a3c 6469 );
.< │ │ │ +000e4b50: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +000e4b60: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ +000e4b70: 705f 5f63 6f6e 7465 7874 2e68 746d 6c23 p__context.html# │ │ │ +000e4b80: 6761 3831 6130 3039 6165 3165 6138 3235 ga81a009ae1ea825 │ │ │ +000e4b90: 6130 3565 3532 3431 6532 6237 6138 6563 a05e5241e2b7a8ec │ │ │ +000e4ba0: 6539 223e 736f 6170 5f65 6e64 3c2f 613e e9">soap_end │ │ │ +000e4bb0: 283c 6120 636c 6173 733d 2263 6f64 6522 (soap │ │ │ +000e4be0: 293b 3c2f 6469 763e 0a3c 6469 7620 636c );
.
│ │ │ +000e4c50: 736f 6170 5f66 7265 653c 2f61 3e28 3c61 soap_free(soap);< │ │ │ +000e4c90: 2f64 6976 3e0a 3c2f 6469 763e 3c21 2d2d /div>.

│ │ │ +000e4cb0: 5468 6520 6f75 7470 7574 2069 7320 6120 The output is a │ │ │ +000e4cc0: 7061 7274 6961 6c6c 7920 7472 616e 736d partially transm │ │ │ +000e4cd0: 6974 7465 6420 6172 7261 793a 3c2f 703e itted array:

│ │ │ +000e4ce0: 0a3c 6469 7620 636c 6173 733d 2261 6c74 .
<< │ │ │ +000e4d20: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +000e4d30: 6f72 6474 7970 6522 3e53 4f41 502d 454e ordtype">SOAP-EN │ │ │ +000e4d40: 433a 4172 7261 793c 2f73 7061 6e3e 203c C:Array < │ │ │ +000e4d50: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +000e4d60: 6f72 6422 3e53 4f41 502d 454e 433a 6172 ord">SOAP-ENC:ar │ │ │ +000e4d70: 7261 7954 7970 653c 2f73 7061 6e3e 3d3c rayType=< │ │ │ +000e4d80: 7370 616e 2063 6c61 7373 3d22 7374 7269 span class="stri │ │ │ +000e4d90: 6e67 6c69 7465 7261 6c22 3e26 7175 6f74 ngliteral">" │ │ │ +000e4da0: 3b78 7364 3a66 6c6f 6174 5b34 5d26 7175 ;xsd:float[4]&qu │ │ │ +000e4db0: 6f74 3b3c 2f73 7061 6e3e 203c 7370 616e ot; SOAP-ENC:offset │ │ │ +000e4de0: 3c2f 7370 616e 3e3d 3c73 7061 6e20 636c ="[1]&qu │ │ │ +000e4e10: 6f74 3b3c 2f73 7061 6e3e 2667 743b 203c ot;> < │ │ │ +000e4e20: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
<item>1</item>
. │ │ │ +000e4eb0: 2020 266c 743b 3c73 7061 6e20 636c 6173 < │ │ │ +000e4ed0: 6974 656d 3c2f 7370 616e 3e26 6774 3b32 item>2 │ │ │ +000e4ee0: 266c 743b 2f3c 7370 616e 2063 6c61 7373 </i │ │ │ +000e4f00: 7465 6d3c 2f73 7061 6e3e 2667 743b 203c tem> < │ │ │ +000e4f10: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
<item>3</item>
. │ │ │ +000e4fa0: 266c 743b 2f3c 7370 616e 2063 6c61 7373 </S │ │ │ +000e4fc0: 4f41 502d 454e 433a 4172 7261 793c 2f73 OAP-ENC:Array>
.< │ │ │ +000e4fe0: 2f64 6976 3e3c 212d 2d20 6672 6167 6d65 /div>

│ │ │ +000e5000: 4e6f 7465 2074 6861 7420 3c65 6d3e 3c63 Note that xsd:float[4] │ │ │ +000e5020: 3c2f 636f 6465 3e3c 2f65 6d3e 2069 7320 is │ │ │ +000e5030: 7468 6520 7479 7065 2061 6e64 2073 6861 the type and sha │ │ │ +000e5040: 7065 206f 6620 7468 6520 656e 636f 6465 pe of the encode │ │ │ +000e5050: 6420 6172 7261 792c 2077 6869 6368 2073 d array, which s │ │ │ +000e5060: 7461 7274 7320 6174 206f 6666 7365 7420 tarts at offset │ │ │ +000e5070: 3120 616e 6420 7468 6572 6566 6f72 6520 1 and therefore │ │ │ +000e5080: 7468 6520 656c 656d 656e 7420 6174 2030 the element at 0 │ │ │ +000e5090: 2069 7320 6f6d 6974 7465 642e 3c2f 703e is omitted.

│ │ │ +000e50a0: 0a3c 703e f09f 949d 203c 6120 6872 6566 .

.... Back to tab │ │ │ +000e50c0: 6c65 206f 6620 636f 6e74 656e 7473 3c2f le of contents

.

.Ne │ │ │ +000e5100: 7374 6564 206f 6e65 2d64 696d 656e 7369 sted one-dimensi │ │ │ +000e5110: 6f6e 616c 2064 796e 616d 6963 2053 4f41 onal dynamic SOA │ │ │ +000e5120: 502d 656e 636f 6465 6420 6172 7261 7973 P-encoded arrays │ │ │ +000e5130: 3c2f 6833 3e0a 3c70 3e4f 6e65 2d64 696d

.

One-dim │ │ │ +000e5140: 656e 7369 6f6e 616c 2053 4f41 502d 656e ensional SOAP-en │ │ │ +000e5150: 636f 6465 6420 6479 6e61 6d69 6320 6172 coded dynamic ar │ │ │ +000e5160: 7261 7973 206d 6179 2062 6520 6e65 7374 rays may be nest │ │ │ +000e5170: 6564 2e20 466f 7220 6578 616d 706c 652c ed. For example, │ │ │ +000e5180: 2075 7369 6e67 203c 636f 6465 3e63 6c61 using cla │ │ │ +000e5190: 7373 2056 6563 746f 723c 2f63 6f64 653e ss Vector │ │ │ +000e51a0: 2064 6563 6c61 7265 6420 696e 2074 6865 declared in the │ │ │ +000e51b0: 2070 7265 7669 6f75 7320 7365 6374 696f previous sectio │ │ │ +000e51c0: 6e2c 203c 636f 6465 3e63 6c61 7373 204d n, class M │ │ │ +000e51d0: 6174 7269 783c 2f63 6f64 653e 2069 7320 atrix is │ │ │ +000e51e0: 6465 636c 6172 6564 3a3c 2f70 3e0a 3c64 declared:

.
// C │ │ │ +000e5230: 6f6e 7465 6e74 7320 6f66 2066 696c 6520 ontents of file │ │ │ +000e5240: 2671 756f 743b 6d61 7472 6978 2e68 2671 "matrix.h&q │ │ │ +000e5250: 756f 743b 3a20 3c2f 7370 616e 3e3c 2f64 uot;: .
clas │ │ │ +000e5290: 7320 3c2f 7370 616e 3e4d 6174 7269 7820 s Matrix │ │ │ +000e52a0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
{ public: │ │ │ +000e52e0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
Vec │ │ │ +000e5300: 746f 7220 2a5f 5f70 7472 3b20 3c2f 6469 tor *__ptr; .
int __ │ │ │ +000e5350: 7369 7a65 3b20 3c2f 6469 763e 0a3c 6469 size;
. │ │ │ +000e5370: 2020 203c 7370 616e 2063 6c61 7373 3d22 int │ │ │ +000e5390: 3c2f 7370 616e 3e20 5f5f 6f66 6673 6574 __offset │ │ │ +000e53a0: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
M │ │ │ +000e53c0: 6174 7269 7828 293b 203c 2f64 6976 3e0a atrix();
. │ │ │ +000e53d0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
Matrix(struct │ │ │ +000e5410: 203c 6120 636c 6173 733d 2263 6f64 6522 soap │ │ │ +000e5440: 202a 3c61 2063 6c61 7373 3d22 636f 6465 *soap, int │ │ │ +000e5490: 3c2f 7370 616e 3e20 6e2c 203c 7370 616e n, int │ │ │ +000e54c0: 6d29 3b20 3c2f 6469 763e 0a3c 6469 7620 m);
.
│ │ │ +000e54e0: 2056 6563 746f 7226 616d 703b 206f 7065 Vector& ope │ │ │ +000e54f0: 7261 746f 725b 5d28 3c73 7061 6e20 636c rator[](int i); │ │ │ +000e5520: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
..
}; │ │ │ +000e5600: 203c 2f64 6976 3e0a 3c2f 6469 763e 3c21
.
< │ │ │ +000e5620: 703e 5468 6520 4d61 7472 6978 2074 7970 p>The Matrix typ │ │ │ +000e5630: 6520 6973 2065 7373 656e 7469 616c 6c79 e is essentially │ │ │ +000e5640: 2061 6e20 6172 7261 7920 6f66 2070 6f69 an array of poi │ │ │ +000e5650: 6e74 6572 7320 746f 2061 7272 6179 7320 nters to arrays │ │ │ +000e5660: 7768 6963 6820 6d61 6b65 2075 7020 7468 which make up th │ │ │ +000e5670: 6520 726f 7773 206f 6620 6120 6d61 7472 e rows of a matr │ │ │ +000e5680: 6978 2e20 5468 6520 7365 7269 616c 697a ix. The serializ │ │ │ +000e5690: 6174 696f 6e20 6f66 2074 6865 2074 776f ation of the two │ │ │ +000e56a0: 2d64 696d 656e 7369 6f6e 616c 2064 796e -dimensional dyn │ │ │ +000e56b0: 616d 6963 2061 7272 6179 2069 6e20 6973 amic array in is │ │ │ +000e56c0: 206e 6573 7465 6420 666f 726d 2069 6e20 nested form in │ │ │ +000e56d0: 584d 4c2e 3c2f 703e 0a3c 703e f09f 949d XML.

.

.... │ │ │ +000e56e0: 203c 6120 6872 6566 3d22 2322 3e42 6163 Bac │ │ │ +000e56f0: 6b20 746f 2074 6162 6c65 206f 6620 636f k to table of co │ │ │ +000e5700: 6e74 656e 7473 3c2f 613e 3c2f 703e 0a3c ntents

.< │ │ │ +000e5710: 6833 3e3c 6120 636c 6173 733d 2261 6e63 h3>.Multi-dime │ │ │ +000e5740: 6e73 696f 6e61 6c20 6479 6e61 6d69 6320 nsional dynamic │ │ │ +000e5750: 534f 4150 2d65 6e63 6f64 6564 2061 7272 SOAP-encoded arr │ │ │ +000e5760: 6179 733c 2f68 333e 0a3c 703e 4120 7370 ays

.

A sp │ │ │ +000e5770: 6563 6961 6c20 666f 726d 206f 6620 3c63 ecial form of struct or class │ │ │ +000e57a0: 3c2f 636f 6465 3e20 6973 2075 7365 6420 is used │ │ │ +000e57b0: 746f 2064 6566 696e 6520 6d75 6c74 692d to define multi- │ │ │ +000e57c0: 6469 6d65 6e73 696f 6e61 6c20 6479 6e61 dimensional dyna │ │ │ +000e57d0: 6d69 6320 534f 4150 2d65 6e63 6f64 6564 mic SOAP-encoded │ │ │ +000e57e0: 2061 7272 6179 732e 2045 6163 6820 6172 arrays. Each ar │ │ │ +000e57f0: 7261 7920 6861 7320 6120 706f 696e 7465 ray has a pointe │ │ │ +000e5800: 7220 7661 7269 6162 6c65 2061 6e64 2061 r variable and a │ │ │ +000e5810: 206d 656d 6265 7220 7468 6174 2072 6563 member that rec │ │ │ +000e5820: 6f72 6473 2074 6865 206e 756d 6265 7220 ords the number │ │ │ +000e5830: 6f66 2065 6c65 6d65 6e74 7320 7065 7220 of elements per │ │ │ +000e5840: 6469 6d65 6e73 696f 6e2e 2041 203c 636f dimension. A K-dime │ │ │ +000e5860: 6e73 696f 6e61 6c20 6172 7261 7920 6973 nsional array is │ │ │ +000e5870: 2064 6563 6c61 7265 6420 6173 3a3c 2f70 declared as:

.
│ │ │ +000e58c0: 7374 7275 6374 203c 2f73 7061 6e3e 6172 struct ar │ │ │ +000e58d0: 7261 795f 6e61 6d65 203c 2f64 6976 3e0a ray_name
. │ │ │ +000e58e0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
{
.
│ │ │ +000e5910: 5479 7065 202a 5f5f 7074 723b 2020 2020 Type *__ptr; │ │ │ +000e5920: 203c 7370 616e 2063 6c61 7373 3d22 636f // pointe │ │ │ +000e5940: 7220 746f 2061 7272 6179 206f 6620 656c r to array of el │ │ │ +000e5950: 656d 656e 7473 2069 6e20 6d65 6d6f 7279 ements in memory │ │ │ +000e5960: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ +000e5980: 2020 2020 3c73 7061 6e20 636c 6173 733d in │ │ │ +000e59a0: 743c 2f73 7061 6e3e 205f 5f73 697a 655b t __size[ │ │ │ +000e59b0: 4b5d 3b20 2020 3c73 7061 6e20 636c 6173 K]; // n │ │ │ +000e59d0: 756d 6265 7220 6f66 2065 6c65 6d65 6e74 umber of element │ │ │ +000e59e0: 7320 7065 7220 6469 6d65 6e73 696f 6e3c s per dimension< │ │ │ +000e59f0: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
. │ │ │ +000e5a10: 2020 203c 7370 616e 2063 6c61 7373 3d22 int │ │ │ +000e5a30: 3c2f 7370 616e 3e20 5f5f 6f66 6673 6574 __offset │ │ │ +000e5a40: 5b4b 5d3b 203c 7370 616e 2063 6c61 7373 [K]; // op │ │ │ +000e5a60: 7469 6f6e 616c 2053 4f41 5020 312e 3120 tional SOAP 1.1 │ │ │ +000e5a70: 6172 7261 7920 6f66 6673 6574 3c2f 7370 array offset
.
│ │ │ +000e5aa0: 2e2e 2e20 2020 2020 2020 2020 2020 2020 ... │ │ │ +000e5ab0: 203c 7370 616e 2063 6c61 7373 3d22 636f // anythi │ │ │ +000e5ad0: 6e67 2074 6861 7420 666f 6c6c 6f77 7320 ng that follows │ │ │ +000e5ae0: 6865 7265 2077 696c 6c20 6265 2069 676e here will be ign │ │ │ +000e5af0: 6f72 6564 203c 2f73 7061 6e3e 3c2f 6469 ored .
};
.

where th │ │ │ +000e5b40: 6520 3c63 6f64 653e 6172 7261 795f 6e61 e array_na │ │ │ +000e5b50: 6d65 3c2f 636f 6465 3e20 6d75 7374 2062 me must b │ │ │ +000e5b60: 6520 6120 6e6f 6e2d 7175 616c 6966 6965 e a non-qualifie │ │ │ +000e5b70: 6420 6e61 6d65 2061 6e64 203c 636f 6465 d name and Type is │ │ │ +000e5b90: 7468 6520 7479 7065 2066 6f72 2074 6865 the type for the │ │ │ +000e5ba0: 2065 6c65 6d65 6e74 7320 6f66 2074 6865 elements of the │ │ │ +000e5bb0: 2061 7272 6179 2e20 5468 6520 3c63 6f64 array. The __ptr m │ │ │ +000e5bd0: 656d 6265 7220 706f 696e 7473 2074 6f20 ember points to │ │ │ +000e5be0: 7468 6520 6172 7261 7920 7661 6c75 6573 the array values │ │ │ +000e5bf0: 2e20 5468 6520 3c63 6f64 653e 5f5f 7369 . The __si │ │ │ +000e5c00: 7a65 3c2f 636f 6465 3e20 6172 7261 7920 ze array │ │ │ +000e5c10: 7370 6563 6966 6965 7320 7468 6520 6e75 specifies the nu │ │ │ +000e5c20: 6d62 6572 206f 6620 6172 7261 7920 656c mber of array el │ │ │ +000e5c30: 656d 656e 7473 2070 6572 2064 696d 656e ements per dimen │ │ │ +000e5c40: 7369 6f6e 2e20 5468 6520 3c63 6f64 653e sion. The │ │ │ +000e5c50: 5f5f 6f66 6673 6574 3c2f 636f 6465 3e20 __offset │ │ │ +000e5c60: 6172 7261 7920 7370 6563 6966 6965 7320 array specifies │ │ │ +000e5c70: 616e 206f 7074 696f 6e61 6c20 6f66 6673 an optional offs │ │ │ +000e5c80: 6574 2070 6572 2064 696d 656e 7369 6f6e et per dimension │ │ │ +000e5c90: 2e3c 2f70 3e0a 3c70 3e46 6f72 2065 7861 .

.

For exa │ │ │ +000e5ca0: 6d70 6c65 2c20 7468 6520 666f 6c6c 6f77 mple, the follow │ │ │ +000e5cb0: 696e 6720 6465 636c 6172 6174 696f 6e20 ing declaration │ │ │ +000e5cc0: 7370 6563 6966 6965 7320 6120 6d61 7472 specifies a matr │ │ │ +000e5cd0: 6978 2063 6c61 7373 3a3c 2f70 3e0a 3c64 ix class:

.
clas │ │ │ +000e5d20: 7320 3c2f 7370 616e 3e4d 6174 7269 7820 s Matrix │ │ │ +000e5d30: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
{ public: │ │ │ +000e5d70: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
float *__ptr; .
int __ │ │ │ +000e5e00: 7369 7a65 5b32 5d3b 203c 2f64 6976 3e0a size[2];
. │ │ │ +000e5e10: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
│ │ │ +000e5e40: 696e 743c 2f73 7061 6e3e 205f 5f6f 6666 int __off │ │ │ +000e5e50: 7365 745b 325d 3b20 3c2f 6469 763e 0a3c set[2];
.< │ │ │ +000e5e60: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +000e5e70: 3e7d 3b20 3c2f 6469 763e 0a3c 2f64 6976 >};
.

The second form │ │ │ +000e6680: 2069 7320 6d6f 7265 2067 656e 6572 6963 is more generic │ │ │ +000e6690: 2c20 6265 6361 7573 6520 7468 6520 6172 , because the ar │ │ │ +000e66a0: 7261 7920 6361 6e20 6265 2064 6563 6c61 ray can be decla │ │ │ +000e66b0: 7265 6420 616e 7977 6865 7265 2069 6e20 red anywhere in │ │ │ +000e66c0: 7468 6520 7374 7275 6374 206f 7220 636c the struct or cl │ │ │ +000e66d0: 6173 7320 616e 6420 6d75 6c74 6970 6c65 ass and multiple │ │ │ +000e66e0: 2061 7272 6179 7320 6361 6e20 6265 2075 arrays can be u │ │ │ +000e66f0: 7365 6420 6173 206d 656d 6265 7273 2c20 sed as members, │ │ │ +000e6700: 6561 6368 2077 6974 6820 6120 3c63 6f64 each with a __size │ │ │ +000e6720: 6d65 6d62 6572 2028 3c63 6f64 653e 5f5f member (__ │ │ │ +000e6730: 7369 7a65 4e61 6d65 3c2f 636f 6465 3e20 sizeName │ │ │ +000e6740: 6973 2061 6c73 6f20 616c 6c6f 7765 6429 is also allowed) │ │ │ +000e6750: 2074 6861 7420 7072 6563 6564 6573 2061 that precedes a │ │ │ +000e6760: 2070 6f69 6e74 6572 206d 656d 6265 723a pointer member: │ │ │ +000e6770: 3c2f 703e 0a3c 6469 7620 636c 6173 733d

.
struct prefix__array_n │ │ │ +000e67d0: 616d 6520 3c2f 6469 763e 0a3c 6469 7620 ame
.
{.
... │ │ │ +000e6810: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ +000e6820: 203c 7370 616e 2063 6c61 7373 3d22 636f // other │ │ │ +000e6840: 6d65 6d62 6572 7320 7468 6174 2061 7265 members that are │ │ │ +000e6850: 2073 6572 6961 6c69 7a65 643c 2f73 7061 serialized
.
< │ │ │ +000e6880: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +000e6890: 6f72 6474 7970 6522 3e69 6e74 3c2f 7370 ordtype">int __size_of_ar │ │ │ +000e68b0: 7261 7931 3b20 3c73 7061 6e20 636c 6173 ray1; // n │ │ │ +000e68d0: 756d 6265 7220 6f66 2065 6c65 6d65 6e74 umber of element │ │ │ +000e68e0: 7320 706f 696e 7465 6420 746f 203c 2f73 s pointed to
.
│ │ │ +000e6910: 2054 7970 6531 202a 6172 7261 7931 3b20 Type1 *array1; │ │ │ +000e6920: 2020 2020 2020 203c 7370 616e 2063 6c61 // │ │ │ +000e6940: 706f 696e 7465 7220 746f 2061 7272 6179 pointer to array │ │ │ +000e6950: 206f 6620 656c 656d 656e 7473 2069 6e20 of elements in │ │ │ +000e6960: 6d65 6d6f 7279 3c2f 7370 616e 3e3c 2f64 memory.
... │ │ │ +000e6990: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ +000e69a0: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // other m │ │ │ +000e69c0: 656d 6265 7273 2074 6861 7420 6172 6520 embers that are │ │ │ +000e69d0: 7365 7269 616c 697a 6564 3c2f 7370 616e serialized
.
int __size_of_arr │ │ │ +000e6a30: 6179 313b 203c 7370 616e 2063 6c61 7373 ay1; // nu │ │ │ +000e6a50: 6d62 6572 206f 6620 656c 656d 656e 7473 mber of elements │ │ │ +000e6a60: 2070 6f69 6e74 6564 2074 6f20 3c2f 7370 pointed to
.
│ │ │ +000e6a90: 5479 7065 3220 2a61 7272 6179 323b 2020 Type2 *array2; │ │ │ +000e6aa0: 2020 2020 2020 3c73 7061 6e20 636c 6173 // p │ │ │ +000e6ac0: 6f69 6e74 6572 2074 6f20 6172 7261 7920 ointer to array │ │ │ +000e6ad0: 6f66 2065 6c65 6d65 6e74 7320 696e 206d of elements in m │ │ │ +000e6ae0: 656d 6f72 793c 2f73 7061 6e3e 3c2f 6469 emory.
... │ │ │ +000e6b10: 2020 2020 2020 2020 2020 2020 2020 203c < │ │ │ +000e6b20: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ +000e6b30: 656e 7422 3e2f 2f20 6f74 6865 7220 6d65 ent">// other me │ │ │ +000e6b40: 6d62 6572 7320 7468 6174 2061 7265 2073 mbers that are s │ │ │ +000e6b50: 6572 6961 6c69 7a65 643c 2f73 7061 6e3e erialized │ │ │ +000e6b60: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
};
.

The │ │ │ +000e6ba0: 3c63 6f64 653e 5f5f 7369 7a65 3c2f 636f __size member shoul │ │ │ +000e6bc0: 6420 6265 2061 6e20 3c63 6f64 653e 696e d be an in │ │ │ +000e6bd0: 743c 2f63 6f64 653e 2074 7970 6520 616e t type an │ │ │ +000e6be0: 6420 6361 6e6e 6f74 2062 6520 6120 3c63 d cannot be a size_t type or other │ │ │ +000e6c10: 696e 7465 6765 7220 7479 7065 2e3c 2f70 integer type.

.

For example │ │ │ +000e6c30: 2c20 7765 2064 6566 696e 6520 6120 4d61 , we define a Ma │ │ │ +000e6c40: 7020 7374 7275 6374 7572 6520 7468 6174 p structure that │ │ │ +000e6c50: 2063 6f6e 7461 696e 7320 6120 7365 7175 contains a sequ │ │ │ +000e6c60: 656e 6365 206f 6620 6b65 792d 7661 6c20 ence of key-val │ │ │ +000e6c70: 7061 6972 733a 3c2f 703e 0a3c 6469 7620 pairs:

.
struct │ │ │ +000e6cc0: 3c2f 7370 616e 3e6e 735f 5f4d 6170 203c ns__Map < │ │ │ +000e6cd0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
{
. │ │ │ +000e6cf0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
│ │ │ +000e6d20: 696e 743c 2f73 7061 6e3e 205f 5f73 697a int __siz │ │ │ +000e6d30: 653b 203c 7370 616e 2063 6c61 7373 3d22 e; // numb │ │ │ +000e6d50: 6572 206f 6620 7061 6972 7320 3c2f 7370 er of pairs
.
│ │ │ +000e6d80: 3c73 7061 6e20 636c 6173 733d 226b 6579 struct ns__Pair.
{
│ │ │ +000e6dd0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
char │ │ │ +000e6e10: 202a 6b65 793b 3c2f 6469 763e 0a3c 6469 *key;
. │ │ │ +000e6e30: 2020 2020 2020 203c 7370 616e 2063 6c61 char *va │ │ │ +000e6e60: 6c3b 3c2f 6469 763e 0a3c 6469 7620 636c l;
.
} │ │ │ +000e6e80: 202a 7061 6972 3b20 2020 203c 7370 616e *pair; // array of pai │ │ │ +000e6eb0: 7273 3c2f 7370 616e 3e3c 2f64 6976 3e0a rs
. │ │ │ +000e6ec0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
};
.

The array will │ │ │ +000e7230: 6265 2073 6572 6961 6c69 7a65 6420 696e be serialized in │ │ │ +000e7240: 2058 4d4c 2061 7320 6120 7365 7175 656e XML as a sequen │ │ │ +000e7250: 6365 206f 6620 7061 6972 733a 3c2f 703e ce of pairs:

│ │ │ +000e7260: 0a3c 6469 7620 636c 6173 733d 2261 6c74 .
<< │ │ │ +000e72a0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +000e72b0: 6f72 6474 7970 6522 3e6e 733a 4d61 703c ordtype">ns:Map< │ │ │ +000e72c0: 2f73 7061 6e3e 2667 743b 203c 2f64 6976 /span>>
.
<pair& │ │ │ +000e7310: 6774 3b20 3c2f 6469 763e 0a3c 6469 7620 gt;
.
│ │ │ +000e7330: 2026 6c74 3b3c 7370 616e 2063 6c61 7373 <k │ │ │ +000e7350: 6579 3c2f 7370 616e 3e26 6774 3b3c 7370 ey>Joe< │ │ │ +000e7380: 3b2f 3c73 7061 6e20 636c 6173 733d 226b ;/key< │ │ │ +000e73a0: 2f73 7061 6e3e 2667 743b 203c 2f64 6976 /span>>
.
<val │ │ │ +000e73f0: 2667 743b 3535 3520 3737 2031 3233 3426 >555 77 1234& │ │ │ +000e7400: 6c74 3b2f 3c73 7061 6e20 636c 6173 733d lt;/va │ │ │ +000e7420: 6c3c 2f73 7061 6e3e 2667 743b 203c 2f64 l> .
</pair>
. │ │ │ +000e7490: 2020 266c 743b 3c73 7061 6e20 636c 6173 < │ │ │ +000e74b0: 7061 6972 3c2f 7370 616e 3e26 6774 3b20 pair> │ │ │ +000e74c0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
< │ │ │ +000e74e0: 3b3c 7370 616e 2063 6c61 7373 3d22 6b65 ;key>S │ │ │ +000e7520: 7573 616e 3c2f 7370 616e 3e26 6c74 3b2f usan</ │ │ │ +000e7530: 3c73 7061 6e20 636c 6173 733d 226b 6579 key>
. │ │ │ +000e7560: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
<val&g │ │ │ +000e75a0: 743b 3535 3520 3132 2036 3732 3526 6c74 t;555 12 6725< │ │ │ +000e75b0: 3b2f 3c73 7061 6e20 636c 6173 733d 226b ;/val< │ │ │ +000e75d0: 2f73 7061 6e3e 2667 743b 203c 2f64 6976 /span>>
.
</pair │ │ │ +000e7620: 2667 743b 203c 2f64 6976 3e0a 3c64 6976 >
.
│ │ │ +000e7640: 266c 743b 3c73 7061 6e20 636c 6173 733d <pa │ │ │ +000e7660: 6972 3c2f 7370 616e 3e26 6774 3b20 3c2f ir> .
<< │ │ │ +000e7690: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +000e76a0: 6f72 6474 7970 6522 3e6b 6579 3c2f 7370 ordtype">key>Pet │ │ │ +000e76d0: 653c 2f73 7061 6e3e 266c 743b 2f3c 7370 e</key>
. │ │ │ +000e7720: 2020 2026 6c74 3b3c 7370 616e 2063 6c61 <val>5 │ │ │ +000e7750: 3535 2039 3920 3433 3231 266c 743b 2f3c 55 99 4321</< │ │ │ +000e7760: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +000e7770: 6f72 6474 7970 6522 3e76 616c 3c2f 7370 ordtype">val>
.< │ │ │ +000e7790: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +000e77a0: 3e20 2026 6c74 3b2f 3c73 7061 6e20 636c > </pair> │ │ │ +000e77d0: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
</ │ │ │ +000e77f0: 3c73 7061 6e20 636c 6173 733d 226b 6579 ns:Map │ │ │ +000e7810: 3c2f 7370 616e 3e26 6774 3b3c 2f64 6976 >
.
│ │ │ +000e7840: 3c70 3e44 6573 6572 6961 6c69 7a61 7469

Deserializati │ │ │ +000e7850: 6f6e 2069 7320 6c65 7373 2065 6666 6963 on is less effic │ │ │ +000e7860: 6965 6e74 2063 6f6d 7061 7265 6420 746f ient compared to │ │ │ +000e7870: 2061 2053 4f41 502d 656e 636f 6465 6420 a SOAP-encoded │ │ │ +000e7880: 6172 7261 792c 2062 6563 6175 7365 2074 array, because t │ │ │ +000e7890: 6865 2073 697a 6520 6f66 2074 6865 2073 he size of the s │ │ │ +000e78a0: 6571 7565 6e63 6520 6973 206e 6f74 2070 equence is not p │ │ │ +000e78b0: 6172 7420 6f66 2074 6865 2053 4f41 5020 art of the SOAP │ │ │ +000e78c0: 656e 636f 6469 6e67 2e20 4275 6666 6572 encoding. Buffer │ │ │ +000e78d0: 696e 6720 6973 2075 7365 6420 6279 2074 ing is used by t │ │ │ +000e78e0: 6865 2064 6573 6572 6961 6c69 7a65 7220 he deserializer │ │ │ +000e78f0: 746f 2063 6f6c 6c65 6374 2074 6865 2065 to collect the e │ │ │ +000e7900: 6c65 6d65 6e74 7320 696e 206d 656d 6f72 lements in memor │ │ │ +000e7910: 792e 2057 6865 6e20 7468 6520 656e 6420 y. When the end │ │ │ +000e7920: 6f66 2074 6865 206c 6973 7420 6973 2072 of the list is r │ │ │ +000e7930: 6561 6368 6564 2c20 7468 6520 6275 6666 eached, the buff │ │ │ +000e7940: 6572 6564 2065 6c65 6d65 6e74 7320 6172 ered elements ar │ │ │ +000e7950: 6520 636f 7069 6564 2074 6f20 6120 6e65 e copied to a ne │ │ │ +000e7960: 776c 7920 616c 6c6f 6361 7465 6420 6d61 wly allocated ma │ │ │ +000e7970: 6e61 6765 6420 7370 6163 6520 6f6e 2074 naged space on t │ │ │ +000e7980: 6865 2068 6561 7020 666f 7220 7468 6520 he heap for the │ │ │ +000e7990: 6479 6e61 6d69 6320 6172 7261 792e 3c2f dynamic array..

Multiple a │ │ │ +000e79b0: 7272 6179 7320 6361 6e20 6265 2070 6172 rrays can be par │ │ │ +000e79c0: 7420 6f66 2061 2073 7472 7563 7420 6f72 t of a struct or │ │ │ +000e79d0: 2063 6c61 7373 2e20 466f 7220 6578 616d class. For exam │ │ │ +000e79e0: 706c 653a 3c2f 703e 0a3c 6469 7620 636c ple:

.
< │ │ │ +000e7a00: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +000e7a10: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >struct ns__Contact │ │ │ +000e7a40: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
{
.
char *f │ │ │ +000e7aa0: 6972 7374 4e61 6d65 3b20 3c2f 6469 763e irstName;
│ │ │ +000e7ab0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
char *la │ │ │ +000e7af0: 7374 4e61 6d65 3b20 3c2f 6469 763e 0a3c stName;
.< │ │ │ +000e7b00: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +000e7b10: 3e20 2024 203c 7370 616e 2063 6c61 7373 > $ i │ │ │ +000e7b30: 6e74 3c2f 7370 616e 3e20 6e50 686f 6e65 nt nPhone │ │ │ +000e7b40: 733b 2020 2020 2020 2020 2020 3c73 7061 s; // number of P │ │ │ +000e7b70: 686f 6e65 733c 2f73 7061 6e3e 3c2f 6469 hones.
ULONG │ │ │ +000e7bf0: 3634 3c2f 613e 202a 7068 6f6e 654e 756d 64 *phoneNum │ │ │ +000e7c00: 6265 723b 203c 7370 616e 2063 6c61 7373 ber; // ar │ │ │ +000e7c20: 7261 7920 6f66 2070 686f 6e65 206e 756d ray of phone num │ │ │ +000e7c30: 6265 7273 203c 2f73 7061 6e3e 3c2f 6469 bers .
$ int nE │ │ │ +000e7c80: 6d61 696c 733b 2020 2020 2020 2020 2020 mails; │ │ │ +000e7c90: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // number │ │ │ +000e7cb0: 6f66 2065 6d61 696c 7320 3c2f 7370 616e of emails
.
char **emailAddre │ │ │ +000e7d10: 7373 3b20 203c 7370 616e 2063 6c61 7373 ss; // ar │ │ │ +000e7d30: 7261 7920 6f66 2065 6d61 696c 2061 6464 ray of email add │ │ │ +000e7d40: 7265 7373 6573 203c 2f73 7061 6e3e 3c2f resses .
};
. │ │ │ +000e7d70: 3c2f 6469 763e 3c21 2d2d 2066 7261 676d

The XM │ │ │ +000e7d90: 4c20 7365 7269 616c 697a 6174 696f 6e20 L serialization │ │ │ +000e7da0: 6f66 2061 6e20 6578 616d 706c 6520 3c63 of an example ns__Contact< │ │ │ +000e7dc0: 2f63 6f64 653e 2069 733a 3c2f 703e 0a3c /code> is:

.< │ │ │ +000e7dd0: 6469 7620 636c 6173 733d 2261 6c74 223e div class="alt"> │ │ │ +000e7de0: 203c 6469 7620 636c 6173 733d 2266 7261
<ns:Contac │ │ │ +000e7e30: 743c 2f73 7061 6e3e 2667 743b 203c 2f64 t> .
<firstName< │ │ │ +000e7e80: 2f73 7061 6e3e 2667 743b 3c73 7061 6e20 /span>> │ │ │ +000e7ea0: 4a6f 653c 2f73 7061 6e3e 266c 743b 2f3c Joe</< │ │ │ +000e7eb0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +000e7ec0: 6f72 6474 7970 6522 3e66 6972 7374 4e61 ordtype">firstNa │ │ │ +000e7ed0: 6d65 3c2f 7370 616e 3e26 6774 3b20 3c2f me> .
<lastName< │ │ │ +000e7f20: 2f73 7061 6e3e 2667 743b 3c73 7061 6e20 /span>> │ │ │ +000e7f40: 536d 6974 683c 2f73 7061 6e3e 266c 743b Smith< │ │ │ +000e7f50: 2f3c 7370 616e 2063 6c61 7373 3d22 6b65 /lastN │ │ │ +000e7f70: 616d 653c 2f73 7061 6e3e 2667 743b 203c ame> < │ │ │ +000e7f80: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
<phoneNum │ │ │ +000e7fc0: 6265 723c 2f73 7061 6e3e 2667 743b 3535 ber>55 │ │ │ +000e7fd0: 3531 3131 3232 3232 266c 743b 2f3c 7370 51112222</phoneNumb │ │ │ +000e8000: 6572 3c2f 7370 616e 3e26 6774 3b20 3c2f er> .
<phoneNumb │ │ │ +000e8050: 6572 3c2f 7370 616e 3e26 6774 3b35 3535 er>555 │ │ │ +000e8060: 3132 3334 3536 3726 6c74 3b2f 3c73 7061 1234567</phoneNumbe │ │ │ +000e8090: 723c 2f73 7061 6e3e 2667 743b 203c 2f64 r> .
<phoneNumbe │ │ │ +000e80e0: 723c 2f73 7061 6e3e 2667 743b 3535 3532 r>5552 │ │ │ +000e80f0: 3334 3839 3031 266c 743b 2f3c 7370 616e 348901</phoneNumber │ │ │ +000e8120: 3c2f 7370 616e 3e26 6774 3b20 3c2f 6469 > .
<emailAddres │ │ │ +000e8170: 733c 2f73 7061 6e3e 2667 743b 3c73 7061 s>Joe.Smith@mail.co │ │ │ +000e81c0: 6d3c 2f73 7061 6e3e 266c 743b 2f3c 7370 m</emailAddr │ │ │ +000e81f0: 6573 733c 2f73 7061 6e3e 2667 743b 203c ess> < │ │ │ +000e8200: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
<emailAdd │ │ │ +000e8240: 7265 7373 3c2f 7370 616e 3e26 6774 3b3c ress>< │ │ │ +000e8250: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +000e8260: 6f72 6422 3e4a 6f65 3c2f 7370 616e 3e40 ord">Joe@ │ │ │ +000e8270: 3c73 7061 6e20 636c 6173 733d 226b 6579 Smith.com< │ │ │ +000e8290: 2f73 7061 6e3e 266c 743b 2f3c 7370 616e /span></emailAddres │ │ │ +000e82c0: 733c 2f73 7061 6e3e 2667 743b 203c 2f64 s> .
</ns:Contact< │ │ │ +000e8310: 2f73 7061 6e3e 2667 743b 3c2f 6469 763e /span>>
│ │ │ +000e8320: 0a3c 2f64 6976 3e3c 212d 2d20 6672 6167 .
< │ │ │ +000e8340: 703e 466f 7220 432b 2b2c 2061 2062 6574 p>For C++, a bet │ │ │ +000e8350: 7465 7220 616c 7465 726e 6174 6976 6520 ter alternative │ │ │ +000e8360: 746f 2061 7272 6179 7320 6172 6520 636f to arrays are co │ │ │ +000e8370: 6e74 6169 6e65 7273 2c20 7768 6963 6820 ntainers, which │ │ │ +000e8380: 6172 6520 6465 7363 7269 6265 6420 6e65 are described ne │ │ │ +000e8390: 7874 2e3c 2f70 3e0a 3c70 3ef0 9f94 9d20 xt.

.

.... │ │ │ +000e83a0: 3c61 2068 7265 663d 2223 223e 4261 636b Back │ │ │ +000e83b0: 2074 6f20 7461 626c 6520 6f66 2063 6f6e to table of con │ │ │ +000e83c0: 7465 6e74 733c 2f61 3e3c 2f70 3e0a 3c68 tents

..STL cont │ │ │ +000e8400: 6169 6e65 7273 3c2f 6833 3e0a 3c70 3e54 ainers.

T │ │ │ +000e8410: 6865 2053 544c 2063 6f6e 7461 696e 6572 he STL container │ │ │ +000e8420: 7320 3c63 6f64 653e 7374 643a 3a64 6571 s std::deq │ │ │ +000e8430: 7565 3c2f 636f 6465 3e2c 203c 636f 6465 ue, std::list, std::se │ │ │ +000e8460: 743c 2f63 6f64 653e 2c20 616e 6420 3c63 t, and std::vector< │ │ │ +000e8480: 2f63 6f64 653e 2061 7265 2073 6572 6961 /code> are seria │ │ │ +000e8490: 6c69 7a61 626c 6520 696e 2058 4d4c 2062 lizable in XML b │ │ │ +000e84a0: 7920 7468 6520 736f 6170 6370 7032 2d67 y the soapcpp2-g │ │ │ +000e84b0: 656e 6572 6174 6564 2073 6572 6961 6c69 enerated seriali │ │ │ +000e84c0: 7a65 7273 2e3c 2f70 3e0a 3c70 3e49 6e20 zers.

.

In │ │ │ +000e84d0: 6f72 6465 7220 746f 2075 7365 2063 6f6e order to use con │ │ │ +000e84e0: 7461 696e 6572 7320 696e 2061 6e20 696e tainers in an in │ │ │ +000e84f0: 7465 7266 6163 6520 6865 6164 6572 2066 terface header f │ │ │ +000e8500: 696c 6520 666f 7220 736f 6170 6370 7032 ile for soapcpp2 │ │ │ +000e8510: 2c20 696d 706f 7274 203c 656d 3e3c 636f , import stldeque.h, < │ │ │ +000e8540: 636f 6465 3e73 746c 6c69 7374 2e68 3c2f code>stllist.h, │ │ │ +000e8560: 3c63 6f64 653e 7374 6c73 6574 2e68 3c2f stlset.h, or < │ │ │ +000e8580: 656d 3e3c 636f 6465 3e73 746c 7665 6374 em>stlvect │ │ │ +000e8590: 6f72 2e68 3c2f 636f 6465 3e3c 2f65 6d3e or.h │ │ │ +000e85a0: 2074 6f20 656e 6162 6c65 203c 636f 6465 to enable std::deque, std::l │ │ │ +000e85d0: 6973 743c 2f63 6f64 653e 2c20 3c63 6f64 ist, std::set, and std │ │ │ +000e8600: 3a3a 7665 6374 6f72 3c2f 636f 6465 3e2c ::vector, │ │ │ +000e8610: 2072 6573 7065 6374 6976 656c 792e 2046 respectively. F │ │ │ +000e8620: 6f72 2065 7861 6d70 6c65 3a3c 2f70 3e0a or example:

. │ │ │ +000e8630: 3c64 6976 2063 6c61 7373 3d22 6672 6167
#import " │ │ │ +000e8680: 3b73 746c 7665 6374 6f72 2e68 2671 756f ;stlvector.h&quo │ │ │ +000e8690: 743b 3c2f 7370 616e 3e20 3c2f 6469 763e t;
│ │ │ +000e86a0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
class < │ │ │ +000e86d0: 2f73 7061 6e3e 6e73 5f5f 6d79 436c 6173 /span>ns__myClas │ │ │ +000e86e0: 7320 3c2f 6469 763e 0a3c 6469 7620 636c s
.
{ public │ │ │ +000e8720: 3a20 3c2f 6469 763e 0a3c 6469 7620 636c :
.
s │ │ │ +000e8740: 7464 3a3a 7665 6374 6f72 266c 743b 696e td::vector<in │ │ │ +000e8750: 7426 6774 3b20 2020 2020 2020 2020 206e t> n │ │ │ +000e8760: 756d 6265 7220 313a 3130 3b20 3c73 7061 umber 1:10; // 1 to 10 num │ │ │ +000e8790: 6265 7273 3c2f 7370 616e 3e3c 2f64 6976 bers
.
std::vec │ │ │ +000e87c0: 746f 7226 6c74 3b73 7464 3a3a 7374 7269 tor<std::stri │ │ │ +000e87d0: 6e67 2667 743b 202a 6e61 6d65 2020 2032 ng> *name 2 │ │ │ +000e87e0: 3b20 2020 203c 7370 616e 2063 6c61 7373 ; // mo │ │ │ +000e8800: 7265 2074 6861 6e20 3220 6e61 6d65 733c re than 2 names< │ │ │ +000e8810: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
.} │ │ │ +000e8830: 3b3c 2f64 6976 3e0a 3c2f 6469 763e 3c21 ;
.
< │ │ │ +000e8850: 703e 5468 6520 7573 6520 6f66 2070 6f69 p>The use of poi │ │ │ +000e8860: 6e74 6572 206d 656d 6265 7273 2073 7563 nter members suc │ │ │ +000e8870: 6820 6173 2066 6f72 203c 636f 6465 3e6e h as for n │ │ │ +000e8880: 616d 653c 2f63 6f64 653e 2073 686f 776e ame shown │ │ │ +000e8890: 2061 626f 7665 2069 7320 706f 7373 6962 above is possib │ │ │ +000e88a0: 6c65 2c20 6275 7420 6e6f 7420 7265 7175 le, but not requ │ │ │ +000e88b0: 6972 6564 2e20 416c 736f 203c 636f 6465 ired. Also minOccurs : max │ │ │ +000e88d0: 4f63 6375 7273 3c2f 636f 6465 3e20 616e Occurs an │ │ │ +000e88e0: 6420 3c63 6f64 653e 6d69 6e4f 6363 7572 d minOccur │ │ │ +000e88f0: 733c 2f63 6f64 653e 206c 656e 6774 6820 s length │ │ │ +000e8900: 636f 6e73 7472 6169 6e74 7320 6361 6e20 constraints can │ │ │ +000e8910: 6265 2073 7065 6369 6669 6564 2061 7320 be specified as │ │ │ +000e8920: 7368 6f77 6e20 696e 2074 6865 2065 7861 shown in the exa │ │ │ +000e8930: 6d70 6c65 2061 626f 7665 2e20 5468 6520 mple above. The │ │ │ +000e8940: 584d 4c20 7363 6865 6d61 2074 6861 7420 XML schema that │ │ │ +000e8950: 636f 7272 6573 706f 6e64 7320 746f 2074 corresponds to t │ │ │ +000e8960: 6865 203c 636f 6465 3e6e 735f 5f6d 7943 he ns__myC │ │ │ +000e8970: 6c61 7373 3c2f 636f 6465 3e20 7479 7065 lass type │ │ │ +000e8980: 2069 733a 3c2f 703e 0a3c 6469 7620 636c is:

.
<complexType name="myClass& │ │ │ +000e8a40: 7175 6f74 3b3c 2f73 7061 6e3e 2667 743b quot;> │ │ │ +000e8a50: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
< │ │ │ +000e8a70: 3c73 7061 6e20 636c 6173 733d 226b 6579 sequen │ │ │ +000e8a90: 6365 3c2f 7370 616e 3e26 6774 3b20 3c2f ce> .
<< │ │ │ +000e8ac0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +000e8ad0: 6f72 6474 7970 6522 3e65 6c65 6d65 6e74 ordtype">element │ │ │ +000e8ae0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c na │ │ │ +000e8b00: 6d65 3c2f 7370 616e 3e3d 3c73 7061 6e20 me="numb │ │ │ +000e8b30: 6572 2671 756f 743b 3c2f 7370 616e 3e20 er" │ │ │ +000e8b40: 3c73 7061 6e20 636c 6173 733d 226b 6579 type=&q │ │ │ +000e8b80: 756f 743b 7873 643a 696e 7426 7175 6f74 uot;xsd:int" │ │ │ +000e8b90: 3b3c 2f73 7061 6e3e 203c 7370 616e 2063 ; m │ │ │ +000e8bb0: 696e 4f63 6375 7273 3c2f 7370 616e 3e3d inOccurs= │ │ │ +000e8bc0: 3c73 7061 6e20 636c 6173 733d 2273 7472 &quo │ │ │ +000e8be0: 743b 3126 7175 6f74 3b3c 2f73 7061 6e3e t;1" │ │ │ +000e8bf0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 maxOccurs │ │ │ +000e8c10: 3c2f 7370 616e 3e3d 3c73 7061 6e20 636c ="10&quo │ │ │ +000e8c40: 743b 3c2f 7370 616e 3e2f 2667 743b 203c t;/> < │ │ │ +000e8c50: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
< │ │ │ +000e8c70: 3c73 7061 6e20 636c 6173 733d 226b 6579 elemen │ │ │ +000e8c90: 743c 2f73 7061 6e3e 203c 7370 616e 2063 t n │ │ │ +000e8cb0: 616d 653c 2f73 7061 6e3e 3d3c 7370 616e ame="nam │ │ │ +000e8ce0: 6526 7175 6f74 3b3c 2f73 7061 6e3e 203c e" < │ │ │ +000e8cf0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +000e8d00: 6f72 6422 3e74 7970 653c 2f73 7061 6e3e ord">type │ │ │ +000e8d10: 3d3c 7370 616e 2063 6c61 7373 3d22 7374 =&qu │ │ │ +000e8d30: 6f74 3b78 7364 3a73 7472 696e 6726 7175 ot;xsd:string&qu │ │ │ +000e8d40: 6f74 3b3c 2f73 7061 6e3e 203c 7370 616e ot; minOccurs=&q │ │ │ +000e8d90: 756f 743b 3226 7175 6f74 3b3c 2f73 7061 uot;2" maxOccu │ │ │ +000e8dc0: 7273 3c2f 7370 616e 3e3d 3c73 7061 6e20 rs="unbo │ │ │ +000e8df0: 756e 6465 6426 7175 6f74 3b3c 2f73 7061 unded"/>
.< │ │ │ +000e8e10: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +000e8e20: 3e20 2026 6c74 3b2f 3c73 7061 6e20 636c > </sequence>
.& │ │ │ +000e8e70: 6c74 3b2f 3c73 7061 6e20 636c 6173 733d lt;/co │ │ │ +000e8e90: 6d70 6c65 7854 7970 653c 2f73 7061 6e3e mplexType │ │ │ +000e8ea0: 2667 743b 3c2f 6469 763e 0a3c 2f64 6976 >
.

T │ │ │ -000eaa60: 6f20 656e 6162 6c65 2074 6865 2063 6f6e o enable the con │ │ │ -000eaa70: 7461 696e 6572 2c20 7765 2061 6464 2074 tainer, we add t │ │ │ -000eaa80: 6865 2066 6f6c 6c6f 7769 6e67 2074 776f he following two │ │ │ -000eaa90: 206c 696e 6573 2074 6f20 7468 6520 696e lines to the in │ │ │ -000eaaa0: 7465 7266 6163 6520 6865 6164 6572 2066 terface header f │ │ │ -000eaab0: 696c 6520 666f 7220 736f 6170 6370 7032 ile for soapcpp2 │ │ │ -000eaac0: 3a3c 2f70 3e0a 3c64 6976 2063 6c61 7373 :

.
#includ │ │ │ -000eab10: 6520 2671 756f 743b 7369 6d70 6c65 5665 e "simpleVe │ │ │ -000eab20: 6374 6f72 2e68 2671 756f 743b 3c2f 7370 ctor.h"
.
template <cla │ │ │ -000eab90: 7373 3c2f 7370 616e 3e20 5426 6774 3b20 ss T> │ │ │ -000eaba0: 3c73 7061 6e20 636c 6173 733d 226b 6579 class simpleVector; │ │ │ -000eabd0: 3c2f 6469 763e 0a3c 2f64 6976 3e3c 212d
.

The container c │ │ │ -000eac00: 6c61 7373 2069 7473 656c 6620 7368 6f75 lass itself shou │ │ │ -000eac10: 6c64 206e 6f74 2062 6520 6465 6669 6e65 ld not be define │ │ │ -000eac20: 6420 696e 2074 6865 2069 6e74 6572 6661 d in the interfa │ │ │ -000eac30: 6365 2068 6561 6465 7220 6669 6c65 2c20 ce header file, │ │ │ -000eac40: 6f6e 6c79 2074 6865 2074 656d 706c 6174 only the templat │ │ │ -000eac50: 6520 6465 636c 6172 6174 696f 6e20 7375 e declaration su │ │ │ -000eac60: 6666 6963 6573 2066 6f72 2073 6f61 7063 ffices for soapc │ │ │ -000eac70: 7070 3220 746f 2067 656e 6572 6174 6520 pp2 to generate │ │ │ -000eac80: 7365 7269 616c 697a 6572 732e 2052 6563 serializers. Rec │ │ │ -000eac90: 616c 6c20 7468 6174 2074 6865 203c 636f all that the #include directives ar │ │ │ -000eacc0: 6520 6e6f 7420 6578 6563 7574 6564 2062 e not executed b │ │ │ -000eacd0: 7920 736f 6170 6370 7032 2062 7574 2073 y soapcpp2 but s │ │ │ -000eace0: 696d 706c 7920 7061 7373 6564 206f 6e20 imply passed on │ │ │ -000eacf0: 746f 2074 6865 2067 656e 6572 6174 6564 to the generated │ │ │ -000ead00: 2073 6f75 7263 6520 636f 6465 2e20 5468 source code. Th │ │ │ -000ead10: 6973 2069 6e63 6c75 6465 2073 7065 6369 is include speci │ │ │ -000ead20: 6669 6573 2069 6e20 7468 6520 6765 6e65 fies in the gene │ │ │ -000ead30: 7261 7465 6420 736f 7572 6365 2063 6f64 rated source cod │ │ │ -000ead40: 6520 7768 6572 6520 7468 6520 636f 6e74 e where the cont │ │ │ -000ead50: 6169 6e65 7220 6973 2061 6374 7561 6c6c ainer is actuall │ │ │ -000ead60: 7920 6465 6669 6e65 642e 3c2f 703e 0a3c y defined.

.< │ │ │ -000ead70: 703e f09f 949d 203c 6120 6872 6566 3d22 p>.... Back to table │ │ │ -000ead90: 206f 6620 636f 6e74 656e 7473 3c2f 613e of contents │ │ │ -000eada0: 3c2f 703e 0a3c 6833 3e3c 6120 636c 6173

.

.Polymorph │ │ │ -000eade0: 6963 2064 796e 616d 6963 2061 7272 6179 ic dynamic array │ │ │ -000eadf0: 7320 616e 6420 6c69 7374 733c 2f68 333e s and lists

│ │ │ -000eae00: 0a3c 703e 506f 6c79 6d6f 7270 6869 6320 .

Polymorphic │ │ │ -000eae10: 6172 7261 7973 2c20 7468 6174 2069 732c arrays, that is, │ │ │ -000eae20: 2061 7272 6179 7320 6f66 2076 616c 7565 arrays of value │ │ │ -000eae30: 7320 6f66 2061 6e79 2074 7970 652c 2063 s of any type, c │ │ │ -000eae40: 616e 2062 6520 7365 7269 616c 697a 6564 an be serialized │ │ │ -000eae50: 2069 6e20 584d 4c20 7768 656e 2064 6563 in XML when dec │ │ │ -000eae60: 6c61 7265 6420 6173 2061 6e20 6172 7261 lared as an arra │ │ │ -000eae70: 7920 6f66 2070 6f69 6e74 6572 7320 746f y of pointers to │ │ │ -000eae80: 2061 2062 6173 6520 636c 6173 732e 2046 a base class. F │ │ │ -000eae90: 6f72 2065 7861 6d70 6c65 3a3c 2f70 3e0a or example:

. │ │ │ -000eaea0: 3c64 6976 2063 6c61 7373 3d22 6672 6167
cl │ │ │ -000eaee0: 6173 7320 3c2f 7370 616e 3e6e 735f 5f4f ass ns__O │ │ │ -000eaef0: 626a 6563 7420 3c2f 6469 763e 0a3c 6469 bject
.{ │ │ │ -000eaf10: 203c 7370 616e 2063 6c61 7373 3d22 6b65 public
:
. │ │ │ -000eaf50: 2020 202e 2e2e 203c 7370 616e 2063 6c61 ... // │ │ │ -000eaf70: 6d65 6d62 6572 7320 6f66 206e 735f 5f4f members of ns__O │ │ │ -000eaf80: 626a 6563 743c 2f73 7061 6e3e 3c2f 6469 bject.
};
.< │ │ │ -000eafb0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -000eafc0: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >class
ns__Data : < │ │ │ -000eaff0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -000eb000: 6f72 6422 3e70 7562 6c69 633c 2f73 7061 ord">public ns__Object .
{ p │ │ │ -000eb050: 7562 6c69 633c 2f73 7061 6e3e 3a20 3c2f ublic: .
... < │ │ │ -000eb080: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ -000eb090: 656e 7422 3e2f 2f20 6d65 6d62 6572 7320 ent">// members │ │ │ -000eb0a0: 6f66 206e 735f 5f44 6174 613c 2f73 7061 of ns__Data
.
}; .
cla │ │ │ -000eb100: 7373 203c 2f73 7061 6e3e 4172 7261 794f ss ArrayO │ │ │ -000eb110: 664f 626a 6563 7420 3c2f 6469 763e 0a3c fObject
.< │ │ │ -000eb120: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -000eb130: 3e7b 203c 7370 616e 2063 6c61 7373 3d22 >{ public< │ │ │ -000eb150: 2f73 7061 6e3e 3a20 3c2f 6469 763e 0a3c /span>:
.< │ │ │ -000eb160: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -000eb170: 3e20 2020 206e 735f 5f4f 626a 6563 7420 > ns__Object │ │ │ -000eb180: 2a2a 5f5f 7074 723b 203c 7370 616e 2063 **__ptr; / │ │ │ -000eb1a0: 2f20 706f 696e 7465 7220 746f 2061 7272 / pointer to arr │ │ │ -000eb1b0: 6179 206f 6620 706f 696e 7465 7273 2074 ay of pointers t │ │ │ -000eb1c0: 6f20 6261 7365 206f 7220 6465 7269 7665 o base or derive │ │ │ -000eb1d0: 6420 6f62 6a65 6374 7320 3c2f 7370 616e d objects
.
int __size; │ │ │ -000eb230: 2020 203c 7370 616e 2063 6c61 7373 3d22 // size │ │ │ -000eb250: 206f 6620 7468 6520 6172 7261 793c 2f73 of the array
.
}; │ │ │ -000eb280: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
c │ │ │ -000eb2b0: 6c61 7373 203c 2f73 7061 6e3e 6e73 5f5f lass ns__ │ │ │ -000eb2c0: 4f62 6a65 6374 7320 3c2f 6469 763e 0a3c Objects
.< │ │ │ -000eb2d0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -000eb2e0: 3e7b 203c 7370 616e 2063 6c61 7373 3d22 >{ public< │ │ │ -000eb300: 2f73 7061 6e3e 3a20 3c2f 6469 763e 0a3c /span>:
.< │ │ │ -000eb310: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -000eb320: 3e20 2020 2073 7464 3a3a 7665 6374 6f72 > std::vector │ │ │ -000eb330: 266c 743b 6e73 5f5f 4f62 6a65 6374 2667 <ns__Object&g │ │ │ -000eb340: 743b 206f 626a 6563 7473 3b20 3c73 7061 t; objects; // vector of b │ │ │ -000eb370: 6173 6520 6f72 2064 6572 6976 6564 206f ase or derived o │ │ │ -000eb380: 626a 6563 7473 203c 2f73 7061 6e3e 3c2f bjects .
};
. │ │ │ -000eb3b0: 3c2f 6469 763e 3c21 2d2d 2066 7261 676d

The po │ │ │ -000eb3d0: 696e 7465 7273 2069 6e20 7468 6520 6172 inters in the ar │ │ │ -000eb3e0: 7261 7920 6361 6e20 706f 696e 7420 746f ray can point to │ │ │ -000eb3f0: 2074 6865 203c 636f 6465 3e6e 735f 5f4f the ns__O │ │ │ -000eb400: 626a 6563 743c 2f63 6f64 653e 2062 6173 bject bas │ │ │ -000eb410: 6520 696e 7374 616e 6365 7320 6f72 203c e instances or < │ │ │ -000eb420: 636f 6465 3e6e 735f 5f44 6174 613c 2f63 code>ns__Data derived ins │ │ │ -000eb440: 7461 6e63 6573 2c20 7768 6963 6820 7769 tances, which wi │ │ │ -000eb450: 6c6c 2062 6520 7365 7269 616c 697a 6564 ll be serialized │ │ │ -000eb460: 2061 6363 6f72 6469 6e67 6c79 2069 6e20 accordingly in │ │ │ -000eb470: 584d 4c2e 2044 6572 6976 6564 2069 6e73 XML. Derived ins │ │ │ -000eb480: 7461 6e63 6573 2061 7265 2069 6e64 6963 tances are indic │ │ │ -000eb490: 6174 6564 2062 7920 3c65 6d3e 3c63 6f64 ated by xsi:type attribute │ │ │ -000eb4c0: 2069 6e20 584d 4c20 7769 7468 2074 6865 in XML with the │ │ │ -000eb4d0: 2071 7561 6c69 6669 6564 206e 616d 6520 qualified name │ │ │ -000eb4e0: 6f66 2074 6865 2063 6c61 7373 2c20 746f of the class, to │ │ │ -000eb4f0: 2064 6973 7469 6e67 7569 7368 2064 6572 distinguish der │ │ │ -000eb500: 6976 6564 2069 6e73 7461 6e63 6573 2066 ived instances f │ │ │ -000eb510: 726f 6d20 7468 6520 6261 7365 2069 6e73 rom the base ins │ │ │ -000eb520: 7461 6e63 6573 2e20 5769 7468 6f75 7420 tances. Without │ │ │ -000eb530: 7468 6973 2061 7474 7269 6275 7465 2074 this attribute t │ │ │ -000eb540: 6865 2064 6573 6572 6961 6c69 7a65 7220 he deserializer │ │ │ -000eb550: 7769 6c6c 206e 6f74 2069 6e73 7461 6e74 will not instant │ │ │ -000eb560: 6961 7465 2074 6865 2064 6572 6976 6564 iate the derived │ │ │ -000eb570: 2069 6e73 7461 6e63 6520 6275 7420 6120 instance but a │ │ │ -000eb580: 6261 7365 2069 6e73 7461 6e63 6520 7369 base instance si │ │ │ -000eb590: 6e63 6520 7468 6572 6520 6973 206e 6f20 nce there is no │ │ │ -000eb5a0: 6964 656e 7469 6679 696e 6720 696e 666f identifying info │ │ │ -000eb5b0: 726d 6174 696f 6e20 746f 2064 6973 7469 rmation to disti │ │ │ -000eb5c0: 6e67 7569 7368 2074 6865 2058 4d4c 2066 nguish the XML f │ │ │ -000eb5d0: 6f72 6d73 2065 7863 6570 7420 666f 7220 orms except for │ │ │ -000eb5e0: 7468 6520 3c65 6d3e 3c63 6f64 653e 7873 the xs │ │ │ -000eb5f0: 693a 7479 7065 3c2f 636f 6465 3e3c 2f65 i:type attribute.

.

Since we ca │ │ │ -000eb620: 6e6e 6f74 2075 7365 2064 796e 616d 6963 nnot use dynamic │ │ │ -000eb630: 2062 696e 6469 6e67 2074 6f20 7375 7070 binding to supp │ │ │ -000eb640: 6f72 7420 706f 6c79 6d6f 7270 6869 736d ort polymorphism │ │ │ -000eb650: 2069 6e20 432c 2061 6e6f 7468 6572 206d in C, another m │ │ │ -000eb660: 6563 6861 6e69 736d 2077 6520 6361 6e20 echanism we can │ │ │ -000eb670: 7573 6520 6973 2076 6f69 6420 706f 696e use is void poin │ │ │ -000eb680: 7465 7273 202e 2048 6572 6520 6973 2061 ters . Here is a │ │ │ -000eb690: 6e20 6578 616d 706c 6520 6f66 2061 2070 n example of a p │ │ │ -000eb6a0: 6f6c 796d 6f72 7068 6963 2053 4f41 502d olymorphic SOAP- │ │ │ -000eb6b0: 656e 636f 6465 6420 6172 7261 7920 3c63 encoded array ArrayOfObjec │ │ │ -000eb6d0: 743c 2f63 6f64 653e 2061 6e64 2061 206e t and a n │ │ │ -000eb6e0: 6f6e 2d53 4f41 5020 6479 6e61 6d69 6320 on-SOAP dynamic │ │ │ -000eb6f0: 6172 7261 7920 3c63 6f64 653e 6e73 5f5f array ns__ │ │ │ -000eb700: 4f62 6a65 6374 733c 2f63 6f64 653e 2074 Objects t │ │ │ -000eb710: 6861 7420 686f 6c64 2076 616c 7565 7320 hat hold values │ │ │ -000eb720: 6f66 2061 6e79 2073 6572 6961 6c69 7a61 of any serializa │ │ │ -000eb730: 626c 6520 7479 7065 3a3c 2f70 3e0a 3c64 ble type:

.
stru │ │ │ -000eb780: 6374 203c 2f73 7061 6e3e 5f5f 7772 6170 ct __wrap │ │ │ -000eb790: 7065 7220 3c2f 6469 763e 0a3c 6469 7620 per
.
{.
int │ │ │ -000eb7f0: 5f5f 7479 7065 3b20 2020 3c73 7061 6e20 __type; │ │ │ -000eb810: 2f2f 2069 6465 6e74 6966 7920 7468 6520 // identify the │ │ │ -000eb820: 7479 7065 2062 656c 6f77 2062 7920 534f type below by SO │ │ │ -000eb830: 4150 5f54 5950 455f 5420 3c2f 7370 616e AP_TYPE_T
.
void *__item; // pointer to │ │ │ -000eb8b0: 2064 6174 6120 6f66 2074 7970 6520 5420 data of type T │ │ │ -000eb8c0: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ -000eb8e0: 7d3b 203c 2f64 6976 3e0a 3c64 6976 2063 };
.
struct │ │ │ -000eb920: 4172 7261 794f 664f 626a 6563 7420 3c2f ArrayOfObject .
{
.< │ │ │ -000eb950: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -000eb960: 3e20 2020 203c 7370 616e 2063 6c61 7373 > struc │ │ │ -000eb980: 7420 3c2f 7370 616e 3e5f 5f77 7261 7070 t __wrapp │ │ │ -000eb990: 6572 202a 5f5f 7074 723b 203c 7370 616e er *__ptr; // pointer to a │ │ │ -000eb9c0: 7272 6179 3c2f 7370 616e 3e3c 2f64 6976 rray
.
int __s │ │ │ -000eba10: 697a 653b 2020 2020 2020 2020 2020 2020 ize; │ │ │ -000eba20: 2020 3c73 7061 6e20 636c 6173 733d 2263 // size │ │ │ -000eba40: 6f66 2074 6865 2061 7272 6179 3c2f 7370 of the array
.
}; < │ │ │ -000eba70: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
st │ │ │ -000ebaa0: 7275 6374 203c 2f73 7061 6e3e 6e73 5f5f ruct ns__ │ │ │ -000ebab0: 4f62 6a65 6374 7320 3c2f 6469 763e 0a3c Objects
.< │ │ │ -000ebac0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -000ebad0: 3e7b 3c2f 6469 763e 0a3c 6469 7620 636c >{
.
< │ │ │ -000ebaf0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -000ebb00: 6f72 6474 7970 6522 3e69 6e74 3c2f 7370 ordtype">int __size; │ │ │ -000ebb20: 2020 2020 2020 2020 2020 203c 7370 616e // size of the │ │ │ -000ebb50: 6172 7261 793c 2f73 7061 6e3e 3c2f 6469 array.
s │ │ │ -000ebb90: 7472 7563 7420 3c2f 7370 616e 3e5f 5f77 truct __w │ │ │ -000ebba0: 7261 7070 6572 202a 6f62 6a65 6374 733b rapper *objects; │ │ │ -000ebbb0: 203c 7370 616e 2063 6c61 7373 3d22 636f // pointe │ │ │ -000ebbd0: 7220 746f 2061 7272 6179 3c2f 7370 616e r to array
.
};.

Thi │ │ │ -000ebc20: 7320 6578 616d 706c 6520 7573 6573 2061 s example uses a │ │ │ -000ebc30: 6e20 2269 6e76 6973 6962 6c65 2220 7479 n "invisible" ty │ │ │ -000ebc40: 7065 203c 636f 6465 3e5f 5f77 7261 7070 pe __wrapp │ │ │ -000ebc50: 6572 3c2f 636f 6465 3e20 616e 6420 6d65 er and me │ │ │ -000ebc60: 6d62 6572 203c 636f 6465 3e5f 5f61 7272 mber __arr │ │ │ -000ebc70: 6179 3c2f 636f 6465 3e2c 2077 6869 6368 ay, which │ │ │ -000ebc80: 2073 7461 7274 2077 6974 6820 6120 646f start with a do │ │ │ -000ebc90: 7562 6c65 2075 6e64 6572 7363 6f72 652e uble underscore. │ │ │ -000ebca0: 2054 6865 7365 206e 616d 6573 2061 7265 These names are │ │ │ -000ebcb0: 206e 6576 6572 2076 6973 6962 6c65 2069 never visible i │ │ │ -000ebcc0: 6e20 7365 7269 616c 697a 6564 2058 4d4c n serialized XML │ │ │ -000ebcd0: 2e20 5468 6520 3c63 6f64 653e 5f5f 7479 . The __ty │ │ │ -000ebce0: 7065 3c2f 636f 6465 3e20 6d65 6d62 6572 pe member │ │ │ -000ebcf0: 206f 6620 3c63 6f64 653e 5f5f 7772 6170 of __wrap │ │ │ -000ebd00: 7065 723c 2f63 6f64 653e 2069 7320 6120 per is a │ │ │ -000ebd10: 3c63 6f64 653e 534f 4150 5f54 5950 455f SOAP_TYPE_ │ │ │ -000ebd20: 543c 2f63 6f64 653e 2076 616c 7565 2074 T value t │ │ │ -000ebd30: 6861 7420 6964 656e 7469 6669 6573 2074 hat identifies t │ │ │ -000ebd40: 6865 2074 7970 6520 3c63 6f64 653e 543c he type T< │ │ │ -000ebd50: 2f63 6f64 653e 2074 6861 7420 3c63 6f64 /code> that __item │ │ │ -000ebd70: 706f 696e 7473 2074 6f2c 2073 6565 2053 points to, see S │ │ │ -000ebd80: 6563 7469 6f6e 203c 6120 636c 6173 733d ection Void │ │ │ -000ebdb0: 2070 6f69 6e74 6572 2073 6572 6961 6c69 pointer seriali │ │ │ -000ebdc0: 7a61 7469 6f6e 3c2f 613e 2e3c 2f70 3e0a zation.

. │ │ │ -000ebdd0: 3c70 3ef0 9f94 9d20 3c61 2068 7265 663d

.... Back to tabl │ │ │ -000ebdf0: 6520 6f66 2063 6f6e 7465 6e74 733c 2f61 e of contents

.

│ │ │ -000ebe30: 0a48 6f77 2074 6f20 6368 616e 6765 2074 .How to change t │ │ │ -000ebe40: 6865 2074 6167 206e 616d 6573 206f 6620 he tag names of │ │ │ -000ebe50: 6172 7261 7920 6974 656d 2065 6c65 6d65 array item eleme │ │ │ -000ebe60: 6e74 733c 2f68 333e 0a3c 703e 5468 6520 nts

.

The │ │ │ -000ebe70: 6465 6661 756c 7420 584d 4c20 656c 656d default XML elem │ │ │ -000ebe80: 656e 7420 7461 6720 6e61 6d65 2066 6f72 ent tag name for │ │ │ -000ebe90: 2061 7272 6179 2065 6c65 6d65 6e74 7320 array elements │ │ │ -000ebea0: 6973 203c 656d 3e3c 636f 6465 3e69 7465 is ite │ │ │ -000ebeb0: 6d3c 2f63 6f64 653e 3c2f 656d 3e2c 2077 m, w │ │ │ -000ebec0: 6869 6368 2063 616e 2062 6520 6368 616e hich can be chan │ │ │ -000ebed0: 6765 642e 2054 6865 203c 636f 6465 3e5f ged. The _ │ │ │ -000ebee0: 5f70 7472 3c2f 636f 6465 3e20 6d65 6d62 _ptr memb │ │ │ -000ebef0: 6572 2069 6e20 6120 7374 7275 6374 206f er in a struct o │ │ │ -000ebf00: 7220 636c 6173 7320 6f66 2061 2064 796e r class of a dyn │ │ │ -000ebf10: 616d 6963 2061 7272 6179 206d 6179 2068 amic array may h │ │ │ -000ebf20: 6176 6520 616e 206f 7074 696f 6e61 6c20 ave an optional │ │ │ -000ebf30: 7375 6666 6978 2070 6172 7420 7468 6174 suffix part that │ │ │ -000ebf40: 2073 7065 6369 6669 6573 2074 6865 206e specifies the n │ │ │ -000ebf50: 616d 6520 6f66 2074 6865 2065 6c65 6d65 ame of the eleme │ │ │ -000ebf60: 6e74 2074 6167 2069 6e20 584d 4c2e 2054 nt tag in XML. T │ │ │ -000ebf70: 6861 7420 6973 2c20 7468 6520 7375 6666 hat is, the suff │ │ │ -000ebf80: 6978 2069 7320 7061 7274 206f 6620 7468 ix is part of th │ │ │ -000ebf90: 6520 3c63 6f64 653e 5f5f 7074 723c 2f63 e __ptr member name │ │ │ -000ebfb0: 3a3c 2f70 3e0a 3c64 6976 2063 6c61 7373 :

.
Ty │ │ │ -000ebfe0: 7065 202a 5f5f 7074 7261 7272 6179 5f65 pe *__ptrarray_e │ │ │ -000ebff0: 6c74 5f6e 616d 653c 2f64 6976 3e0a 3c2f lt_name
.

Consider │ │ │ -000ec020: 2066 6f72 2065 7861 6d70 6c65 3a3c 2f70 for example:

.
│ │ │ -000ec070: 7374 7275 6374 203c 2f73 7061 6e3e 4172 struct Ar │ │ │ -000ec080: 7261 794f 6673 7472 696e 6720 3c2f 6469 rayOfstring .
{
. │ │ │ -000ec0c0: 2020 203c 7370 616e 2063 6c61 7373 3d22 cha │ │ │ -000ec0e0: 723c 2f73 7061 6e3e 2a20 2a5f 5f70 7472 r* *__ptr │ │ │ -000ec0f0: 7374 7269 6e67 3b3c 2f64 6976 3e0a 3c64 string;
. │ │ │ -000ec110: 2020 2020 3c73 7061 6e20 636c 6173 733d in │ │ │ -000ec130: 743c 2f73 7061 6e3e 205f 5f73 697a 653b t __size; │ │ │ -000ec140: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
};
.

The │ │ │ -000ec180: 6172 7261 7920 6973 2073 6572 6961 6c69 array is seriali │ │ │ -000ec190: 7a65 6420 6173 3a3c 2f70 3e0a 3c64 6976 zed as:

.
<SOAP-ENC:Arr │ │ │ -000ec200: 6179 3c2f 7370 616e 3e20 3c73 7061 6e20 ay │ │ │ -000ec220: 534f 4150 2d45 4e43 3a61 7272 6179 5479 SOAP-ENC:arrayTy │ │ │ -000ec230: 7065 3c2f 7370 616e 3e3d 3c73 7061 6e20 pe="xsd: │ │ │ -000ec260: 7374 7269 6e67 5b32 5d26 7175 6f74 3b3c string[2]"< │ │ │ -000ec270: 2f73 7061 6e3e 2667 743b 203c 2f64 6976 /span>>
.
<string>Hello │ │ │ -000ec2e0: 3c2f 7370 616e 3e26 6c74 3b2f 3c73 7061 </string>
.< │ │ │ -000ec320: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -000ec330: 3e20 2026 6c74 3b3c 7370 616e 2063 6c61 > <string&g │ │ │ -000ec360: 743b 3c73 7061 6e20 636c 6173 733d 226b t;World
</string │ │ │ -000ec3b0: 2667 743b 203c 2f64 6976 3e0a 3c64 6976 >
.
&l │ │ │ -000ec3d0: 743b 2f3c 7370 616e 2063 6c61 7373 3d22 t;/SOA │ │ │ -000ec3f0: 502d 454e 433a 4172 7261 793c 2f73 7061 P-ENC:Array>
.

SO │ │ │ -000ec430: 4150 2031 2e31 2f31 2e32 2064 6f65 7320 AP 1.1/1.2 does │ │ │ -000ec440: 6e6f 7420 6d61 6e64 6174 6520 6120 7370 not mandate a sp │ │ │ -000ec450: 6563 6966 6963 2074 6167 206e 616d 6520 ecific tag name │ │ │ -000ec460: 666f 7220 534f 4150 2d65 6e63 6f64 6564 for SOAP-encoded │ │ │ -000ec470: 2061 7272 6179 2065 6c65 6d65 6e74 7320 array elements │ │ │ -000ec480: 616e 6420 7468 6520 736f 6170 6370 7032 and the soapcpp2 │ │ │ -000ec490: 2d67 656e 6572 6174 6564 2073 6572 6961 -generated seria │ │ │ -000ec4a0: 6c69 7a65 7273 2077 696c 6c20 6967 6e6f lizers will igno │ │ │ -000ec4b0: 7265 2074 6865 206e 616d 6520 7573 6564 re the name used │ │ │ -000ec4c0: 2074 6f20 6974 656d 697a 6520 534f 4150 to itemize SOAP │ │ │ -000ec4d0: 2d65 6e63 6f64 6564 2061 7272 6179 2076 -encoded array v │ │ │ -000ec4e0: 616c 7565 732e 3c2f 703e 0a3c 703e f09f alues.

.

.. │ │ │ -000ec4f0: 949d 203c 6120 6872 6566 3d22 2322 3e42 .. B │ │ │ -000ec500: 6163 6b20 746f 2074 6162 6c65 206f 6620 ack to table of │ │ │ -000ec510: 636f 6e74 656e 7473 3c2f 613e 3c2f 703e contents

│ │ │ -000ec520: 0a3c 6832 3e3c 6120 636c 6173 733d 2261 .

.ba │ │ │ -000ec550: 7365 3634 4269 6e61 7279 2073 6572 6961 se64Binary seria │ │ │ -000ec560: 6c69 7a61 7469 6f6e 3c2f 6832 3e0a 3c70 lization

.

The b │ │ │ -000ec580: 6173 6536 3442 696e 6172 793c 2f63 6f64 ase64Binary XSD type │ │ │ -000ec5a0: 2069 7320 696e 7472 6f64 7563 6564 2069 is introduced i │ │ │ -000ec5b0: 6e20 616e 2069 6e74 6572 6661 6365 2068 n an interface h │ │ │ -000ec5c0: 6561 6465 7220 6669 6c65 2066 6f72 2073 eader file for s │ │ │ -000ec5d0: 6f61 7063 7070 3220 7573 696e 6720 6120 oapcpp2 using a │ │ │ -000ec5e0: 7374 7275 6374 206f 7220 636c 6173 7320 struct or class │ │ │ -000ec5f0: 7468 6174 2063 6f6e 7461 696e 7320 616e that contains an │ │ │ -000ec600: 2061 7272 6179 206f 6620 3c63 6f64 653e array of │ │ │ -000ec610: 756e 7369 676e 6564 2063 6861 723c 2f63 unsigned char values:

│ │ │ -000ec630: 0a3c 6469 7620 636c 6173 733d 2266 7261 .
s │ │ │ -000ec670: 7472 7563 7420 3c2f 7370 616e 3e3c 6120 truct xsd__base64B │ │ │ -000ec6c0: 696e 6172 793c 2f61 3e20 3c2f 6469 763e inary
│ │ │ -000ec6d0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
{
.
│ │ │ -000ec700: 203c 7370 616e 2063 6c61 7373 3d22 6b65 unsig │ │ │ -000ec720: 6e65 643c 2f73 7061 6e3e 203c 7370 616e ned char │ │ │ -000ec750: 202a 3c61 2063 6c61 7373 3d22 636f 6465 *__ptr │ │ │ -000ec7b0: 3c2f 613e 3b20 3c2f 6469 763e 0a3c 6469 ;
. │ │ │ -000ec7d0: 2020 203c 7370 616e 2063 6c61 7373 3d22 int │ │ │ -000ec7f0: 3c2f 7370 616e 3e20 3c61 2063 6c61 7373 __size; .
};
.< │ │ │ -000ec880: 2f64 6976 3e3c 212d 2d20 6672 6167 6d65 /div>

The adv │ │ │ -000ec8a0: 616e 7461 6765 206f 6620 7468 6973 2073 antage of this s │ │ │ -000ec8b0: 7472 7563 7420 6f72 2063 6c61 7373 2069 truct or class i │ │ │ -000ec8c0: 7320 7468 6520 6162 696c 6974 7920 746f s the ability to │ │ │ -000ec8d0: 2073 6572 6961 6c69 7a65 7220 7261 7720 serializer raw │ │ │ -000ec8e0: 6269 6e61 7279 2064 6174 6120 6672 6f6d binary data from │ │ │ -000ec8f0: 206d 656d 6f72 792c 2073 696e 6365 2074 memory, since t │ │ │ -000ec900: 6865 2073 6f61 7063 7070 322d 6765 6e65 he soapcpp2-gene │ │ │ -000ec910: 7261 7465 6420 7365 7269 616c 697a 6572 rated serializer │ │ │ -000ec920: 2063 6f6e 7665 7274 7320 7468 6520 6269 converts the bi │ │ │ -000ec930: 6e61 7279 2064 6174 6120 746f 2f66 726f nary data to/fro │ │ │ -000ec940: 6d20 6261 7365 3634 2069 6e20 584d 4c2e m base64 in XML. │ │ │ -000ec950: 3c2f 703e 0a3c 703e 546f 2069 6e74 726f

.

To intro │ │ │ -000ec960: 6475 6365 2061 206e 6577 2058 4d4c 2073 duce a new XML s │ │ │ -000ec970: 6368 656d 6120 7479 7065 2064 6572 6976 chema type deriv │ │ │ -000ec980: 6564 2066 726f 6d20 3c65 6d3e 3c63 6f64 ed from base64Binary use t │ │ │ -000ec9b0: 6865 2073 616d 6520 7374 7275 6374 206f he same struct o │ │ │ -000ec9c0: 7220 636c 6173 7320 7374 7275 6374 7572 r class structur │ │ │ -000ec9d0: 652c 2062 7574 2077 6974 6820 616e 6f74 e, but with anot │ │ │ -000ec9e0: 6865 7220 6e61 6d65 2e20 466f 7220 6578 her name. For ex │ │ │ -000ec9f0: 616d 706c 653a 3c2f 703e 0a3c 6469 7620 ample:

.
struct │ │ │ -000eca40: 3c2f 7370 616e 3e6e 735f 5f62 696e 6172 ns__binar │ │ │ -000eca50: 793c 2f64 6976 3e0a 3c64 6976 2063 6c61 y
.
{
.
unsigned char │ │ │ -000ecad0: 3c2f 7370 616e 3e20 2a5f 5f70 7472 3b20 *__ptr; │ │ │ -000ecae0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
int __size;
│ │ │ -000ecb30: 0a3c 6469 7620 636c 6173 733d 226c 696e .
};
.

The result │ │ │ -000ecb70: 696e 6720 584d 4c20 7363 6865 6d61 2074 ing XML schema t │ │ │ -000ecb80: 7970 6520 6973 3a3c 2f70 3e0a 3c64 6976 ype is:

.
<simpleType name │ │ │ -000ecc10: 3c2f 7370 616e 3e3d 3c73 7061 6e20 636c ="binary │ │ │ -000ecc40: 2671 756f 743b 3c2f 7370 616e 3e26 6774 "> │ │ │ -000ecc50: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
.
< │ │ │ -000ecc70: 3c73 7061 6e20 636c 6173 733d 226b 6579 restri │ │ │ -000ecc90: 6374 696f 6e3c 2f73 7061 6e3e 203c 7370 ction base=< │ │ │ -000eccc0: 7370 616e 2063 6c61 7373 3d22 7374 7269 span class="stri │ │ │ -000eccd0: 6e67 6c69 7465 7261 6c22 3e26 7175 6f74 ngliteral">" │ │ │ -000ecce0: 3b78 7364 3a62 6173 6536 3442 696e 6172 ;xsd:base64Binar │ │ │ -000eccf0: 7926 7175 6f74 3b3c 2f73 7061 6e3e 2667 y"&g │ │ │ -000ecd00: 743b 3c2f 6469 763e 0a3c 6469 7620 636c t;
.
< │ │ │ -000ecd20: 3b2f 3c73 7061 6e20 636c 6173 733d 226b ;/rest │ │ │ -000ecd40: 7269 6374 696f 6e3c 2f73 7061 6e3e 2667 riction&g │ │ │ -000ecd50: 743b 3c2f 6469 763e 0a3c 6469 7620 636c t;
.
</ │ │ │ -000ecd70: 3c73 7061 6e20 636c 6173 733d 226b 6579 simple │ │ │ -000ecd90: 5479 7065 3c2f 7370 616e 3e26 6774 3b3c Type>< │ │ │ -000ecda0: 2f64 6976 3e0a 3c2f 6469 763e 3c21 2d2d /div>.

.... Back to │ │ │ -000ecde0: 7461 626c 6520 6f66 2063 6f6e 7465 6e74 table of content │ │ │ -000ecdf0: 733c 2f61 3e3c 2f70 3e0a 3c68 323e 3c61 s

.

< │ │ │ -000ece20: 2f61 3e0a 6865 7842 696e 6172 7920 7365 /a>.hexBinary se │ │ │ -000ece30: 7269 616c 697a 6174 696f 6e3c 2f68 323e rialization

│ │ │ -000ece40: 0a3c 703e 5468 6520 3c65 6d3e 3c63 6f64 .

The base64Binary XSD t │ │ │ -000ece70: 7970 6520 6973 2069 6e74 726f 6475 6365 ype is introduce │ │ │ -000ece80: 6420 696e 2061 6e20 696e 7465 7266 6163 d in an interfac │ │ │ -000ece90: 6520 6865 6164 6572 2066 696c 6520 666f e header file fo │ │ │ -000ecea0: 7220 736f 6170 6370 7032 2075 7369 6e67 r soapcpp2 using │ │ │ -000eceb0: 2061 2073 7472 7563 7420 6f72 2063 6c61 a struct or cla │ │ │ -000ecec0: 7373 2074 6861 7420 636f 6e74 6169 6e73 ss that contains │ │ │ -000eced0: 2061 6e20 6172 7261 7920 6f66 203c 636f an array of unsigned char │ │ │ -000ecef0: 3c2f 636f 6465 3e20 7661 6c75 6573 3a3c values:< │ │ │ -000ecf00: 2f70 3e0a 3c64 6976 2063 6c61 7373 3d22 /p>.

.
unsigned │ │ │ -000ecff0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c char *< │ │ │ -000ed020: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -000ed030: 7265 663d 2273 7472 7563 7478 7364 5f5f ref="structxsd__ │ │ │ -000ed040: 5f5f 6865 785f 6269 6e61 7279 2e68 746d __hex_binary.htm │ │ │ -000ed050: 6c23 6164 6164 6531 6362 6363 3863 3666 l#adade1cbcc8c6f │ │ │ -000ed060: 6632 3530 3337 3739 3466 3338 3934 3466 f25037794f38944f │ │ │ -000ed070: 3939 3922 3e5f 5f70 7472 3c2f 613e 3b20 999">__ptr; │ │ │ -000ed080: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
..
};< │ │ │ -000ed140: 2f64 6976 3e0a 3c2f 6469 763e 3c21 2d2d /div>.

│ │ │ -000ed160: 5468 6520 6164 7661 6e74 6167 6520 6f66 The advantage of │ │ │ -000ed170: 2074 6869 7320 7374 7275 6374 206f 7220 this struct or │ │ │ -000ed180: 636c 6173 7320 6973 2074 6865 2061 6269 class is the abi │ │ │ -000ed190: 6c69 7479 2074 6f20 7365 7269 616c 697a lity to serializ │ │ │ -000ed1a0: 6572 2072 6177 2062 696e 6172 7920 6461 er raw binary da │ │ │ -000ed1b0: 7461 2066 726f 6d20 6d65 6d6f 7279 2c20 ta from memory, │ │ │ -000ed1c0: 7369 6e63 6520 7468 6520 736f 6170 6370 since the soapcp │ │ │ -000ed1d0: 7032 2d67 656e 6572 6174 6564 2073 6572 p2-generated ser │ │ │ -000ed1e0: 6961 6c69 7a65 7220 636f 6e76 6572 7473 ializer converts │ │ │ -000ed1f0: 2074 6865 2062 696e 6172 7920 6461 7461 the binary data │ │ │ -000ed200: 2074 6f2f 6672 6f6d 2068 6578 6164 6563 to/from hexadec │ │ │ -000ed210: 696d 616c 2069 6e20 584d 4c2e 3c2f 703e imal in XML.

│ │ │ -000ed220: 0a3c 703e 4966 2061 2062 696e 6172 7920 .

If a binary │ │ │ -000ed230: 7479 7065 2073 7563 6820 6173 203c 636f type such as xsd__base64Bina │ │ │ -000ed2c0: 7279 3c2f 613e 3c2f 636f 6465 3e20 6973 ry is │ │ │ -000ed2d0: 2061 6c72 6561 6479 2064 6566 696e 6564 already defined │ │ │ -000ed2e0: 2c20 7468 656e 2077 6520 6361 6e20 7369 , then we can si │ │ │ -000ed2f0: 6d70 6c79 2075 7365 2061 203c 636f 6465 mply use a typedef │ │ │ -000ed310: 746f 2069 6e74 726f 6475 6365 2074 6865 to introduce the │ │ │ -000ed320: 2068 6578 2076 6172 6961 6e74 3a3c 2f70 hex variant:

.
│ │ │ -000ed370: 636c 6173 7320 3c2f 7370 616e 3e3c 6120 class xsd__base64B │ │ │ -000ed3c0: 696e 6172 793c 2f61 3e3c 2f64 6976 3e0a inary
. │ │ │ -000ed3d0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
{ public │ │ │ -000ed400: 3c2f 7370 616e 3e3a 203c 2f64 6976 3e0a :
. │ │ │ -000ed410: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
│ │ │ -000ed440: 756e 7369 676e 6564 3c2f 7370 616e 3e20 unsigned │ │ │ -000ed450: 3c73 7061 6e20 636c 6173 733d 226b 6579 char * │ │ │ -000ed4d0: 5f5f 7074 723c 2f61 3e3b 203c 2f64 6976 __ptr;
.
int __size │ │ │ -000ed580: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
}; .
typ │ │ │ -000ed5d0: 6564 6566 3c2f 7370 616e 3e20 3c61 2063 edef xsd__base64Bi │ │ │ -000ed620: 6e61 7279 3c2f 613e 203c 6120 636c 6173 nary xsd │ │ │ -000ed660: 5f5f 6865 7842 696e 6172 793c 2f61 3e3b __hexBinary; │ │ │ -000ed670: 203c 7370 616e 2063 6c61 7373 3d22 636f // serial │ │ │ -000ed690: 697a 6573 2069 6e74 6f20 6865 7820 636f izes into hex co │ │ │ -000ed6a0: 6e74 656e 743c 2f73 7061 6e3e 3c2f 6469 ntent.

Thi │ │ │ -000ed6d0: 7320 6c65 7473 2073 6f61 7063 7070 3220 s lets soapcpp2 │ │ │ -000ed6e0: 6765 6e65 7261 7465 203c 656d 3e3c 636f generate xsd:base64Bin │ │ │ -000ed700: 6172 793c 2f63 6f64 653e 3c2f 656d 3e20 ary │ │ │ -000ed710: 616e 6420 3c65 6d3e 3c63 6f64 653e 7873 and xs │ │ │ -000ed720: 643a 6865 7842 696e 6172 793c 2f63 6f64 d:hexBinary serializ │ │ │ -000ed740: 6572 732e 3c2f 703e 0a3c 703e f09f 949d ers.

.

.... │ │ │ -000ed750: 203c 6120 6872 6566 3d22 2322 3e42 6163 Bac │ │ │ -000ed760: 6b20 746f 2074 6162 6c65 206f 6620 636f k to table of co │ │ │ -000ed770: 6e74 656e 7473 3c2f 613e 3c2f 703e 0a3c ntents

.< │ │ │ -000ed780: 6832 3e3c 6120 636c 6173 733d 2261 6e63 h2>.SOAP RPC │ │ │ -000ed7b0: 656e 636f 6465 6420 7665 7273 7573 2064 encoded versus d │ │ │ -000ed7c0: 6f63 756d 656e 742f 6c69 7465 7261 6c20 ocument/literal │ │ │ -000ed7d0: 7374 796c 653c 2f68 323e 0a3c 703e 534f style.

SO │ │ │ -000ed7e0: 4150 2068 6173 2073 6576 6572 616c 2073 AP has several s │ │ │ -000ed7f0: 7479 6c65 733a 3c2f 703e 0a3c 756c 3e0a tyles:

.
.

To initialize a │ │ │ -00138bf0: 2073 7461 636b 2d61 6c6c 6f63 6174 6564 stack-allocated │ │ │ -00138c00: 203c 636f 6465 3e3c 6120 636c 6173 733d soap context with │ │ │ -00138c70: 696e 7075 7420 616e 6420 6f75 7470 7574 input and output │ │ │ -00138c80: 206d 6f64 6520 666c 6167 733a 3c2f 703e mode flags:

│ │ │ -00138c90: 0a3c 6469 7620 636c 6173 733d 2266 7261 .
void < │ │ │ -00138ce0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -00138cf0: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ -00138d00: 705f 5f63 6f6e 7465 7874 2e68 746d 6c23 p__context.html# │ │ │ -00138d10: 6761 6338 3731 3236 6333 6534 3564 3266 gac87126c3e45d2f │ │ │ -00138d20: 6461 3438 3865 3938 3332 6332 6464 3562 da488e9832c2dd5b │ │ │ -00138d30: 6531 223e 736f 6170 5f69 6e69 7431 3c2f e1">soap_init1(struct< │ │ │ -00138d60: 2f73 7061 6e3e 203c 6120 636c 6173 733d /span> so │ │ │ -00138d90: 6170 3c2f 613e 202a 3c61 2063 6c61 7373 ap *s │ │ │ -00138dc0: 6f61 703c 2f61 3e2c 203c 6120 636c 6173 oap, soap │ │ │ -00138e20: 5f6d 6f64 653c 2f61 3e20 696f 6d6f 6465 _mode iomode │ │ │ -00138e30: 293b 3c2f 6469 763e 0a3c 6469 7620 636c );
.
void │ │ │ -00138e70: 203c 6120 636c 6173 733d 2263 6f64 6522 soap_init2 │ │ │ -00138ed0: 3c2f 613e 283c 7370 616e 2063 6c61 7373 (struc │ │ │ -00138ef0: 743c 2f73 7061 6e3e 203c 6120 636c 6173 t │ │ │ -00138f20: 736f 6170 3c2f 613e 202a 3c61 2063 6c61 soap *soap, so │ │ │ -00138fb0: 6170 5f6d 6f64 653c 2f61 3e20 3c61 2063 ap_mode imode, │ │ │ -00139010: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap_mode │ │ │ -00139070: 203c 6120 636c 6173 733d 2263 6f64 6522 omode< │ │ │ -001390c0: 2f61 3e29 3b3c 2f64 6976 3e0a 3c64 6976 /a>);
.
void soap_i │ │ │ -001391b0: 6e69 7432 2873 7472 7563 7420 736f 6170 nit2(struct soap │ │ │ -001391c0: 202a 736f 6170 2c20 736f 6170 5f6d 6f64 *soap, soap_mod │ │ │ -001391d0: 6520 696e 7075 745f 6d6f 6465 2c20 736f e input_mode, so │ │ │ -001391e0: 6170 5f6d 6f64 6520 6f75 7470 7574 5f6d ap_mode output_m │ │ │ -001391f0: 6f64 6529 3c2f 6469 763e 3c64 6976 2063 ode)
Ini │ │ │ -00139210: 7469 616c 697a 6520 6120 7374 6163 6b2d tialize a stack- │ │ │ -00139220: 616c 6c6f 6361 7465 6420 736f 6170 2063 allocated soap c │ │ │ -00139230: 6f6e 7465 7874 2077 6974 6820 696e 7075 ontext with inpu │ │ │ -00139240: 7420 616e 6420 6f75 7470 7574 2073 6f61 t and output soa │ │ │ -00139250: 705f 6d6f 6465 2066 6c61 6773 2e3c 2f64 p_mode flags.
.
│ │ │ -00139270: 3c21 2d2d 2066 7261 676d 656e 7420 2d2d

For UDP me │ │ │ -0013dae0: 7373 6167 696e 672c 2075 7365 203c 636f ssaging, use #SOAP_IO_UDP< │ │ │ -0013db00: 2f63 6f64 653e 2e20 5365 6520 616c 736f /code>. See also │ │ │ -0013db10: 2053 6563 7469 6f6e 203c 6120 636c 6173 Section SOA │ │ │ -0013db40: 502f 584d 4c20 6f76 6572 2055 4450 3c2f P/XML over UDP. The context │ │ │ -0013db60: 666c 6167 7320 7468 6174 2063 616e 2062 flags that can b │ │ │ -0013db70: 6520 7365 7420 6174 2074 6865 2063 6c69 e set at the cli │ │ │ -0013db80: 656e 7420 7369 6465 2066 6f72 2055 4450 ent side for UDP │ │ │ -0013db90: 206d 6573 7361 6769 6e67 2061 7265 203c messaging are < │ │ │ -0013dba0: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>so │ │ │ -0013dc50: 6170 3a3a 6970 7634 5f6d 756c 7469 6361 ap::ipv4_multica │ │ │ -0013dc60: 7374 5f69 663c 2f61 3e3c 2f63 6f64 653e st_if │ │ │ -0013dc70: 2c20 3c63 6f64 653e 3c61 2063 6c61 7373 , soap::ipv4_mult │ │ │ -0013dd30: 6963 6173 745f 7474 6c3c 2f61 3e3c 2f63 icast_ttl, and │ │ │ -0013dd50: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap::ipv6_ │ │ │ -0013ddf0: 6d75 6c74 6963 6173 745f 6966 3c2f 613e multicast_if │ │ │ -0013de00: 3c2f 636f 6465 3e3a 3c2f 703e 0a3c 7461 :

...cont │ │ │ -0013de70: 6578 7420 666c 6167 2020 203c 2f74 683e ext flag │ │ │ -0013de80: 3c74 6820 636c 6173 733d 226d 6172 6b64 result .. │ │ │ -0013df00: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap::i │ │ │ -0013dfb0: 7076 345f 6d75 6c74 6963 6173 745f 6966 pv4_multicast_if │ │ │ -0013dfc0: 3c2f 613e 3c2f 636f 6465 3e20 2020 3c2f set s │ │ │ -0013e000: 6574 736f 636b 6f70 743c 2f63 6f64 653e etsockopt │ │ │ -0013e010: 206c 6576 656c 203c 636f 6465 3e49 5050 level IPP │ │ │ -0013e020: 524f 544f 5f49 503c 2f63 6f64 653e 2074 ROTO_IP t │ │ │ -0013e030: 6f20 3c63 6f64 653e 4950 5f4d 554c 5449 o IP_MULTI │ │ │ -0013e040: 4341 5354 5f49 463c 2f63 6f64 653e 2077 CAST_IF w │ │ │ -0013e050: 6974 6820 7661 6c75 6520 3c63 6f64 653e ith value │ │ │ -0013e060: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap::i │ │ │ -0013e110: 7076 345f 6d75 6c74 6963 6173 745f 6966 pv4_multicast_if │ │ │ -0013e120: 3c2f 613e 3c2f 636f 6465 3e20 7768 656e when │ │ │ -0013e130: 206e 6f6e 2d4e 554c 4c20 2020 203c 2f74 non-NULL ..soap: │ │ │ -0013e240: 3a69 7076 345f 6d75 6c74 6963 6173 745f :ipv4_multicast_ │ │ │ -0013e250: 7474 6c3c 2f61 3e3c 2f63 6f64 653e 2020 ttl │ │ │ -0013e260: 203c 2f74 643e 3c74 6420 636c 6173 733d set setsockopt level │ │ │ -0013e2b0: 4950 5052 4f54 4f5f 4950 3c2f 636f 6465 IPPROTO_IP to IP_MU │ │ │ -0013e2d0: 4c54 4943 4153 545f 5454 4c3c 2f63 6f64 LTICAST_TTL with value soa │ │ │ -0013e3a0: 703a 3a69 7076 345f 6d75 6c74 6963 6173 p::ipv4_multicas │ │ │ -0013e3b0: 745f 7474 6c3c 2f61 3e3c 2f63 6f64 653e t_ttl │ │ │ -0013e3c0: 2077 6865 6e20 6e6f 6e7a 6572 6f20 2020 when nonzero │ │ │ -0013e3d0: 203c 2f74 643e 3c2f 7472 3e0a 3c74 7220 ..< │ │ │ -0013e420: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soap:: │ │ │ -0013e4c0: 6970 7636 5f6d 756c 7469 6361 7374 5f69 ipv6_multicast_i │ │ │ -0013e4d0: 663c 2f61 3e3c 2f63 6f64 653e 2020 203c f
< │ │ │ -0013e4e0: 2f74 643e 3c74 6420 636c 6173 733d 226d /td>set │ │ │ -0013e510: 736f 636b 6164 6472 5f69 6e36 3a3a 7369 sockaddr_in6::si │ │ │ -0013e520: 6e36 5f73 636f 7065 5f69 643c 2f63 6f64 n6_scope_id to soap::ipv6_mult │ │ │ -0013e5e0: 6963 6173 745f 6966 3c2f 613e 3c2f 636f icast_if when nonzero │ │ │ -0013e600: 2020 203c 2f74 643e 3c2f 7472 3e0a 3c2f ..

.... < │ │ │ -0013e620: 6120 6872 6566 3d22 2322 3e42 6163 6b20 a href="#">Back │ │ │ -0013e630: 746f 2074 6162 6c65 206f 6620 636f 6e74 to table of cont │ │ │ -0013e640: 656e 7473 3c2f 613e 3c2f 703e 0a3c 6831 ents

.

.Run-time e │ │ │ -0013e680: 7272 6f72 2063 6f64 6573 3c2f 6831 3e0a rror codes

. │ │ │ -0013e690: 3c70 3e53 7461 7475 7320 6572 726f 7220

Status error │ │ │ -0013e6a0: 636f 6465 7320 6172 6520 696e 7465 6765 codes are intege │ │ │ -0013e6b0: 7220 7661 6c75 6573 2c20 7768 6963 6820 r values, which │ │ │ -0013e6c0: 6172 6520 7265 7475 726e 6564 2062 7920 are returned by │ │ │ -0013e6d0: 7468 6520 6753 4f41 5020 4150 4920 6675 the gSOAP API fu │ │ │ -0013e6e0: 6e63 7469 6f6e 732e 2054 6865 2066 756c nctions. The ful │ │ │ -0013e6f0: 6c20 6c69 7374 206f 6620 3c63 6f64 653e l list of │ │ │ -0013e700: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap_status │ │ │ -0013e7c0: 3c2f 636f 6465 3e20 6572 726f 7220 636f error co │ │ │ -0013e7d0: 6465 7320 6973 206c 6973 7465 6420 6265 des is listed be │ │ │ -0013e7e0: 6c6f 773a 3c2f 703e 0a3c 7461 626c 6520 low:

... │ │ │ -0013e890: 3c2f 7472 3e0a 3c74 7220 636c 6173 733d .. │ │ │ -0013e930: 3c2f 7472 3e0a 3c74 7220 636c 6173 733d .. │ │ │ -0013e9c0: 5468 6520 7365 7276 6963 6520 7265 7475 The service retu │ │ │ -0013e9d0: 726e 6564 2061 2053 4f41 5020 312e 3120 rned a SOAP 1.1 │ │ │ -0013e9e0: 636c 6965 6e74 2066 6175 6c74 202f 2053 client fault / S │ │ │ -0013e9f0: 4f41 5020 312e 3220 7365 6e64 6572 2066 OAP 1.2 sender f │ │ │ -0013ea00: 6175 6c74 2074 6f20 7468 6520 636c 6965 ault to the clie │ │ │ -0013ea10: 6e74 2020 2020 3c2f 7464 3e3c 2f74 723e nt │ │ │ -0013ea20: 0a3c 7472 2063 6c61 7373 3d22 6d61 726b ..< │ │ │ -0013eae0: 2f74 723e 0a3c 7472 2063 6c61 7373 3d22 /tr>.. │ │ │ -0013eb70: 416e 2048 5454 5020 4445 4c45 5445 2072 An HTTP DELETE r │ │ │ -0013eb80: 6571 7565 7374 2077 6173 2072 6563 6569 equest was recei │ │ │ -0013eb90: 7665 6420 6279 2074 6865 2073 6572 7669 ved by the servi │ │ │ -0013eba0: 6365 2062 7574 2074 6865 2044 454c 4554 ce but the DELET │ │ │ -0013ebb0: 4520 7265 7175 6573 7420 6361 6c6c 6261 E request callba │ │ │ -0013ebc0: 636b 203c 636f 6465 3e3c 6120 636c 6173 ck s │ │ │ -0013ec90: 6f61 703a 3a66 6465 6c3c 2f61 3e3c 2f63 oap::fdel is not impl │ │ │ -0013ecb0: 656d 656e 7465 642c 2073 6565 2053 6563 emented, see Sec │ │ │ -0013ecc0: 7469 6f6e 203c 6120 636c 6173 733d 2265 tion Fu │ │ │ -0013ecf0: 6e63 7469 6f6e 2063 616c 6c62 6163 6b73 nction callbacks │ │ │ -0013ed00: 2066 6f72 2063 7573 746f 6d69 7a65 6420 for customized │ │ │ -0013ed10: 492f 4f20 616e 6420 4854 5450 2068 616e I/O and HTTP han │ │ │ -0013ed20: 646c 696e 673c 2f61 3e20 2020 203c 2f74 dling .. │ │ │ -0013edc0: 456e 6420 6f66 2044 494d 4520 6174 7461 End of DIME atta │ │ │ -0013edd0: 6368 6d65 6e74 7320 7072 6f74 6f63 6f6c chments protocol │ │ │ -0013ede0: 2065 7272 6f72 2020 2020 3c2f 7464 3e3c error < │ │ │ -0013edf0: 2f74 723e 0a3c 7472 2063 6c61 7373 3d22 /tr>.. │ │ │ -0013ee80: 4449 4d45 2066 6f72 6d61 7474 696e 6720 DIME formatting │ │ │ -0013ee90: 6572 726f 7220 6f72 2044 494d 4520 6174 error or DIME at │ │ │ -0013eea0: 7461 6368 6d65 6e74 2073 697a 6520 6578 tachment size ex │ │ │ -0013eeb0: 6365 6564 7320 3c63 6f64 653e 2353 4f41 ceeds #SOA │ │ │ -0013eec0: 505f 4d41 5844 494d 4553 495a 453c 2f63 P_MAXDIMESIZE ...< │ │ │ -0013efe0: 7472 2063 6c61 7373 3d22 6d61 726b 646f tr class="markdo │ │ │ -0013eff0: 776e 5461 626c 6552 6f77 4576 656e 223e wnTableRowEven"> │ │ │ -0013f000: 0a3c 7464 2063 6c61 7373 3d22 6d61 726b ...< │ │ │ -0013f0b0: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ -0013f0c0: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ -0013f0d0: 3e3c 636f 6465 3e23 534f 4150 5f44 5550 >#SOAP_DUP │ │ │ -0013f0e0: 4c49 4341 5445 5f49 443c 2f63 6f64 653e LICATE_ID │ │ │ -0013f0f0: 2020 203c 2f74 643e 3c74 6420 636c 6173 .. │ │ │ -0013f1f0: 3c63 6f64 653e 2353 4f41 505f 454d 5054 #SOAP_EMPT │ │ │ -0013f200: 593c 2f63 6f64 653e 2020 203c 2f74 643e Y │ │ │ -0013f210: 3c74 6420 636c 6173 733d 226d 6172 6b64 .... │ │ │ -0013f390: 3c74 6420 636c 6173 733d 226d 6172 6b64 │ │ │ -0013f3d0: 3c74 6420 636c 6173 733d 226d 6172 6b64 ..< │ │ │ -0013f430: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ -0013f440: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ -0013f450: 3e3c 636f 6465 3e23 534f 4150 5f45 5252 >#SOAP_ERR │ │ │ -0013f460: 3c2f 636f 6465 3e20 2020 3c2f 7464 3e3c < │ │ │ -0013f470: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ -0013f480: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ -0013f490: 3e53 616d 6520 6173 203c 636f 6465 3e45 >Same as E │ │ │ -0013f4a0: 4f46 3c2f 636f 6465 3e2c 2062 7574 2069 OF, but i │ │ │ -0013f4b0: 6e64 6963 6174 6573 2061 6e20 756e 7370 ndicates an unsp │ │ │ -0013f4c0: 6563 6966 6965 6420 6572 726f 7220 2020 ecified error │ │ │ -0013f4d0: 203c 2f74 643e 3c2f 7472 3e0a 3c74 7220 .. │ │ │ -0013f520: 3c63 6f64 653e 2353 4f41 505f 4641 554c #SOAP_FAUL │ │ │ -0013f530: 543c 2f63 6f64 653e 2020 203c 2f74 643e T │ │ │ -0013f540: 3c74 6420 636c 6173 733d 226d 6172 6b64 .. │ │ │ -0013f810: 3c63 6f64 653e 2353 4f41 505f 4644 5f45 #SOAP_FD_E │ │ │ -0013f820: 5843 4545 4445 443c 2f63 6f64 653e 2020 XCEEDED │ │ │ -0013f830: 203c 2f74 643e 3c74 6420 636c 6173 733d .. │ │ │ -0013f8c0: 3c63 6f64 653e 2353 4f41 505f 4649 5845 #SOAP_FIXE │ │ │ -0013f8d0: 443c 2f63 6f64 653e 2020 203c 2f74 643e D │ │ │ -0013f8e0: 3c74 6420 636c 6173 733d 226d 6172 6b64 .... │ │ │ -0013fd80: 0a3c 7472 2063 6c61 7373 3d22 6d61 726b .... │ │ │ -0013fe80: 3c63 6f64 653e 2353 4f41 505f 4854 5450 #SOAP_HTTP │ │ │ -0013fe90: 5f4d 4554 484f 443c 2f63 6f64 653e 2020 _METHOD │ │ │ -0013fea0: 203c 2f74 643e 3c74 6420 636c 6173 733d .... │ │ │ -00140050: 584d 4c20 656c 656d 656e 7420 6f72 2061 XML element or a │ │ │ -00140060: 7474 7269 6275 7465 206c 656e 6774 6820 ttribute length │ │ │ -00140070: 7661 6c69 6461 7469 6f6e 2065 7272 6f72 validation error │ │ │ -00140080: 206f 7220 3c63 6f64 653e 2353 4f41 505f or #SOAP_ │ │ │ -00140090: 4d41 584c 454e 4754 483c 2f63 6f64 653e MAXLENGTH │ │ │ -001400a0: 2065 7863 6565 6465 6420 2020 203c 2f74 exceeded .... │ │ │ -00140210: 456e 6420 6f66 204d 494d 4520 6174 7461 End of MIME atta │ │ │ -00140220: 6368 6d65 6e74 7320 7072 6f74 6f63 6f6c chments protocol │ │ │ -00140230: 2065 7272 6f72 2020 2020 3c2f 7464 3e3c error < │ │ │ -00140240: 2f74 723e 0a3c 7472 2063 6c61 7373 3d22 /tr>...... │ │ │ -00140460: 3c74 6420 636c 6173 733d 226d 6172 6b64 .... │ │ │ -001406a0: 3c74 6420 636c 6173 733d 226d 6172 6b64 ... │ │ │ -00140800: 3c74 7220 636c 6173 733d 226d 6172 6b64 │ │ │ -00140820: 0a3c 7464 2063 6c61 7373 3d22 6d61 726b . │ │ │ -001408c0: 3c2f 7472 3e0a 3c74 7220 636c 6173 733d .. │ │ │ -00140950: 5468 6520 7365 7276 6963 6520 7265 7175 The service requ │ │ │ -00140960: 6573 7420 6469 7370 6174 6368 6572 2064 est dispatcher d │ │ │ -00140970: 6964 206e 6f74 2066 696e 6420 6120 6d61 id not find a ma │ │ │ -00140980: 7463 6869 6e67 2073 6572 7669 6365 206f tching service o │ │ │ -00140990: 7065 7261 7469 6f6e 2066 6f72 2061 2073 peration for a s │ │ │ -001409a0: 6572 7669 6365 2072 6571 7565 7374 2020 ervice request │ │ │ -001409b0: 2020 3c2f 7464 3e3c 2f74 723e 0a3c 7472 .. │ │ │ -00140a00: 3c63 6f64 653e 2353 4f41 505f 4e4f 5f54 #SOAP_NO_T │ │ │ -00140a10: 4147 3c2f 636f 6465 3e20 2020 3c2f 7464 AG .... │ │ │ -00140b90: 3c63 6f64 653e 2353 4f41 505f 4e55 4c4c #SOAP_NULL │ │ │ -00140ba0: 3c2f 636f 6465 3e20 2020 3c2f 7464 3e3c < │ │ │ -00140bb0: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ -00140bc0: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ -00140bd0: 3e58 4d4c 2065 6c65 6d65 6e74 2068 6173 >XML element has │ │ │ -00140be0: 2061 6e20 3c63 6f64 653e 7873 693a 6e69 an xsi:ni │ │ │ -00140bf0: 6c3c 2f63 6f64 653e 2061 7474 7269 6275 l attribu │ │ │ -00140c00: 7465 2077 6865 6e20 7468 6520 656c 656d te when the elem │ │ │ -00140c10: 656e 7420 6973 206e 6f74 206e 696c 6c61 ent is not nilla │ │ │ -00140c20: 626c 652c 2063 6175 7369 6e67 2061 2076 ble, causing a v │ │ │ -00140c30: 616c 6964 6174 696f 6e20 6572 726f 7220 alidation error │ │ │ -00140c40: 2020 203c 2f74 643e 3c2f 7472 3e0a 3c74 .. │ │ │ -00140c70: 3c74 6420 636c 6173 733d 226d 6172 6b64 . │ │ │ -00140d40: 3c74 7220 636c 6173 733d 226d 6172 6b64 │ │ │ -00140d60: 0a3c 7464 2063 6c61 7373 3d22 6d61 726b ....... │ │ │ -00141130: 3c74 6420 636c 6173 733d 226d 6172 6b64 .< │ │ │ -001411d0: 7472 2063 6c61 7373 3d22 6d61 726b 646f tr class="markdo │ │ │ -001411e0: 776e 5461 626c 6552 6f77 4f64 6422 3e0a wnTableRowOdd">. │ │ │ -001411f0: 3c74 6420 636c 6173 733d 226d 6172 6b64 .. │ │ │ -001414a0: 584d 4c20 6174 7472 6962 7574 6520 6973 XML attribute is │ │ │ -001414b0: 2072 6571 7569 7265 6420 6275 7420 6e6f required but no │ │ │ -001414c0: 7420 7072 6573 656e 7420 2020 203c 2f74 t present ..< │ │ │ -00141540: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ -00141550: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ -00141560: 3e41 6e20 5353 4c20 6572 726f 7220 6f63 >An SSL error oc │ │ │ -00141570: 6375 7272 6564 2020 2020 3c2f 7464 3e3c curred < │ │ │ -00141580: 2f74 723e 0a3c 7472 2063 6c61 7373 3d22 /tr>........ │ │ │ -00141860: 3c63 6f64 653e 2353 4f41 505f 5443 505f #SOAP_TCP_ │ │ │ -00141870: 4552 524f 523c 2f63 6f64 653e 2020 203c ERROR < │ │ │ -00141880: 2f74 643e 3c74 6420 636c 6173 733d 226d /td>.. │ │ │ -001419c0: 3c2f 7472 3e0a 3c74 7220 636c 6173 733d .... │ │ │ -00141c20: 3c2f 7472 3e0a 3c74 7220 636c 6173 733d .... │ │ │ -00141d00: 3c74 6420 636c 6173 733d 226d 6172 6b64 │ │ │ -00141db0: 0a3c 7472 2063 6c61 7373 3d22 6d61 726b ....

A stat │ │ │ -00141e70: 7573 2063 6f64 6520 6f66 203c 636f 6465 us code of #SOAP_OK │ │ │ -00141e90: 2028 7a65 726f 2920 6973 2072 6574 7572 (zero) is retur │ │ │ -00141ea0: 6e65 6420 6279 2061 2067 534f 4150 2041 ned by a gSOAP A │ │ │ -00141eb0: 5049 2066 756e 6374 696f 6e20 7768 656e PI function when │ │ │ -00141ec0: 2074 6865 2066 756e 6374 696f 6e20 6361 the function ca │ │ │ -00141ed0: 6c6c 2077 6173 2073 7563 6365 7373 6675 ll was successfu │ │ │ -00141ee0: 6c2c 206f 7468 6572 7769 7365 2061 206e l, otherwise a n │ │ │ -00141ef0: 6f6e 2d7a 6572 6f20 6572 726f 7220 636f on-zero error co │ │ │ -00141f00: 6465 2069 7320 7265 7475 726e 6564 2e20 de is returned. │ │ │ -00141f10: 5468 6520 7374 6174 7573 2065 7272 6f72 The status error │ │ │ -00141f20: 2063 6f64 6520 6973 2061 6c73 6f20 7374 code is also st │ │ │ -00141f30: 6f72 6564 2069 6e20 7468 6520 6375 7272 ored in the curr │ │ │ -00141f40: 656e 7420 3c63 6f64 653e 3c61 2063 6c61 ent soap context as │ │ │ -00141fb0: 203c 636f 6465 3e3c 6120 636c 6173 733d soa │ │ │ -00142060: 703a 3a65 7272 6f72 3c2f 613e 3c2f 636f p::error. For IO and │ │ │ -00142080: 736f 636b 6574 2d72 656c 6174 6564 2065 socket-related e │ │ │ -00142090: 7272 6f72 732c 2061 6c73 6f20 7468 6520 rrors, also the │ │ │ -001420a0: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 soap::errn │ │ │ -00142130: 756d 3c2f 613e 3c2f 636f 6465 3e20 7661 um va │ │ │ -00142140: 7269 6162 6c65 2069 7320 7365 7420 746f riable is set to │ │ │ -00142150: 2074 6865 203c 636f 6465 3e65 7272 6e6f the errno │ │ │ -00142160: 3c2f 636f 6465 3e20 7661 6c75 6520 6f66 value of │ │ │ -00142170: 2074 6865 2073 7973 7465 6d20 6572 726f the system erro │ │ │ -00142180: 7220 666f 7220 6578 616d 706c 6520 7768 r for example wh │ │ │ -00142190: 656e 2061 203c 636f 6465 3e23 534f 4150 en a #SOAP │ │ │ -001421a0: 5f45 4f46 3c2f 636f 6465 3e20 6572 726f _EOF erro │ │ │ -001421b0: 7220 6f63 6375 7272 6564 2e3c 2f70 3e0a r occurred.

. │ │ │ -001421c0: 3c70 3e54 6f20 6469 7370 6c61 7920 7468

To display th │ │ │ -001421d0: 6520 6572 726f 722c 2075 7365 203c 636f e error, use soap_pr │ │ │ -00142270: 696e 745f 6661 756c 7428 7374 7275 6374 int_fault(struct │ │ │ -00142280: 2073 6f61 7020 2a73 6f61 702c 2046 494c soap *soap, FIL │ │ │ -00142290: 4520 2a66 6429 3c2f 613e 3c2f 636f 6465 E *fd) where the curr │ │ │ -001422b0: 656e 7420 7661 6c75 6520 6f66 203c 636f ent value of soap::e │ │ │ -00142370: 7272 6f72 3c2f 613e 3c2f 636f 6465 3e20 rror │ │ │ -00142380: 6973 2075 7365 6420 6279 2074 6865 2066 is used by the f │ │ │ -00142390: 756e 6374 696f 6e20 746f 2070 7269 6e74 unction to print │ │ │ -001423a0: 2074 6865 2065 7272 6f72 2074 6f20 7468 the error to th │ │ │ -001423b0: 6520 7370 6563 6966 6965 6420 3c63 6f64 e specified fd file │ │ │ -001423d0: 2e20 416c 7465 726e 6174 6976 656c 792c . Alternatively, │ │ │ -001423e0: 2069 6e20 432b 2b20 796f 7520 6361 6e20 in C++ you can │ │ │ -001423f0: 7573 6520 3c63 6f64 653e 3c61 2063 6c61 use soap_stre │ │ │ -00142490: 616d 5f66 6175 6c74 2873 7472 7563 7420 am_fault(struct │ │ │ -001424a0: 736f 6170 202a 736f 6170 2c20 7374 643a soap *soap, std: │ │ │ -001424b0: 3a6f 7374 7265 616d 2661 6d70 3b20 6f73 :ostream& os │ │ │ -001424c0: 293c 2f61 3e3c 2f63 6f64 653e 2074 6f20 ) to │ │ │ -001424d0: 7072 696e 7420 7468 6520 6572 726f 7220 print the error │ │ │ -001424e0: 6f6e 2074 6865 2073 7065 6369 6669 6564 on the specified │ │ │ -001424f0: 203c 636f 6465 3e6f 733c 2f63 6f64 653e os │ │ │ -00142500: 206f 7574 7075 7420 7374 7265 616d 2e3c output stream.< │ │ │ -00142510: 2f70 3e0a 3c70 3e54 6f20 6469 7370 6c61 /p>.

To displa │ │ │ -00142520: 7920 7468 6520 6c6f 6361 7469 6f6e 206f y the location o │ │ │ -00142530: 6620 616e 2058 4d4c 2070 6172 7369 6e67 f an XML parsing │ │ │ -00142540: 2061 6e64 2076 616c 6964 6174 696f 6e20 and validation │ │ │ -00142550: 6572 726f 722c 2075 7365 203c 636f 6465 error, use s │ │ │ -00142600: 6f61 705f 7072 696e 745f 6661 756c 745f oap_print_fault_ │ │ │ -00142610: 6c6f 6361 7469 6f6e 2873 7472 7563 7420 location(struct │ │ │ -00142620: 736f 6170 202a 736f 6170 2c20 4649 4c45 soap *soap, FILE │ │ │ -00142630: 202a 6664 293c 2f61 3e3c 2f63 6f64 653e *fd) │ │ │ -00142640: 206f 7220 3c63 6f64 653e 3c61 2063 6c61 or soap_str │ │ │ -001426f0: 6561 6d5f 6661 756c 745f 6c6f 6361 7469 eam_fault_locati │ │ │ -00142700: 6f6e 2873 7472 7563 7420 736f 6170 202a on(struct soap * │ │ │ -00142710: 736f 6170 2c20 7374 643a 3a6f 7374 7265 soap, std::ostre │ │ │ -00142720: 616d 2661 6d70 3b20 6f73 293c 2f61 3e3c am& os)< │ │ │ -00142730: 2f63 6f64 653e 2074 6f20 7072 696e 7420 /code> to print │ │ │ -00142740: 7061 7274 206f 6620 7468 6520 584d 4c20 part of the XML │ │ │ -00142750: 7769 7468 2074 6865 2065 7272 6f72 206c with the error l │ │ │ -00142760: 6f63 6174 696f 6e20 6d61 726b 6564 2069 ocation marked i │ │ │ -00142770: 6e20 7468 6520 584d 4c20 6f75 7470 7574 n the XML output │ │ │ -00142780: 2e3c 2f70 3e0a 3c70 3e54 6f20 7361 7665 .

.

To save │ │ │ -00142790: 2074 6865 2065 7272 6f72 2069 6e20 6120 the error in a │ │ │ -001427a0: 7374 7269 6e67 2062 7566 6665 7220 3c63 string buffer buf[0...len- │ │ │ -001427c0: 315d 3c2f 636f 6465 3e2c 2075 7365 203c 1], use < │ │ │ -001427d0: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soap_sprint_fa │ │ │ -00142870: 756c 7428 7374 7275 6374 2073 6f61 702a ult(struct soap* │ │ │ -00142880: 2c20 6368 6172 202a 6275 662c 2073 697a , char *buf, siz │ │ │ -00142890: 655f 7420 6c65 6e29 3c2f 613e 3c2f 636f e_t len), where buf is p │ │ │ -001428c0: 6f70 756c 6174 6564 2077 6974 6820 7468 opulated with th │ │ │ -001428d0: 6520 6661 756c 7420 6d65 7373 6167 6520 e fault message │ │ │ -001428e0: 7465 726d 696e 6174 696e 6720 7769 7468 terminating with │ │ │ -001428f0: 2061 203c 636f 6465 3e5c 303c 2f63 6f64 a \0.

.

To de │ │ │ -00142910: 7465 726d 696e 6520 7468 6520 7479 7065 termine the type │ │ │ -00142920: 206f 6620 6572 726f 7220 7468 6174 206f of error that o │ │ │ -00142930: 6363 7572 7265 642c 2075 7365 3a3c 2f70 ccurred, use:

. │ │ │ -001435e0: 3c70 3e41 6e20 4854 5450 2073 7461 7475

An HTTP statu │ │ │ -001435f0: 7320 636f 6465 2069 7320 7265 7475 726e s code is return │ │ │ -00143600: 6564 2077 6865 6e20 7468 6520 636c 6965 ed when the clie │ │ │ -00143610: 6e74 2066 6169 6c73 2074 6f20 636f 6e6e nt fails to conn │ │ │ -00143620: 6563 7420 746f 2061 6e20 4854 5450 2073 ect to an HTTP s │ │ │ -00143630: 6572 7665 7220 616e 6420 7468 6520 4854 erver and the HT │ │ │ -00143640: 5450 2073 6572 7665 7220 7265 7370 6f6e TP server respon │ │ │ -00143650: 7365 2077 6974 6820 616e 2065 7272 6f72 se with an error │ │ │ -00143660: 2e20 5468 6520 6c69 7374 206f 6620 4854 . The list of HT │ │ │ -00143670: 5450 2073 7461 7475 7320 636f 6465 7320 TP status codes │ │ │ -00143680: 6973 2067 6976 656e 2062 656c 6f77 3a3c is given below:< │ │ │ -00143690: 2f70 3e0a 3c74 6162 6c65 2063 6c61 7373 /p>.

Error co │ │ │ -0013e850: 6465 2020 203c 2f74 683e 3c74 6820 636c de Desc │ │ │ -0013e880: 7269 7074 696f 6e20 2020 203c 2f74 683e ription
# │ │ │ -0013e8e0: 534f 4150 5f4f 4b3c 2f63 6f64 653e 2020 SOAP_OK │ │ │ -0013e8f0: 203c 2f74 643e 3c74 6420 636c 6173 733d No error │ │ │ -0013e920: 2028 7a65 726f 2920 2020 203c 2f74 643e (zero)
│ │ │ -0013e980: 2353 4f41 505f 434c 495f 4641 554c 543c #SOAP_CLI_FAULT< │ │ │ -0013e990: 2f63 6f64 653e 2020 203c 2f74 643e 3c74 /code>
#SOAP_ │ │ │ -0013ea70: 4441 5441 454e 434f 4449 4e47 554e 4b4e DATAENCODINGUNKN │ │ │ -0013ea80: 4f57 4e3c 2f63 6f64 653e 2020 203c 2f74 OWN SOAP 1.2 Dat │ │ │ -0013eac0: 6145 6e63 6f64 696e 6755 6e6b 6e6f 776e aEncodingUnknown │ │ │ -0013ead0: 2066 6175 6c74 2020 2020 3c2f 7464 3e3c fault
# │ │ │ -0013eb30: 534f 4150 5f44 454c 5f4d 4554 484f 443c SOAP_DEL_METHOD< │ │ │ -0013eb40: 2f63 6f64 653e 2020 203c 2f74 643e 3c74 /code>
#SOAP_DIME_END< │ │ │ -0013ed90: 2f63 6f64 653e 2020 203c 2f74 643e 3c74 /code>
# │ │ │ -0013ee40: 534f 4150 5f44 494d 455f 4552 524f 523c SOAP_DIME_ERROR< │ │ │ -0013ee50: 2f63 6f64 653e 2020 203c 2f74 643e 3c74 /code>
#SOA │ │ │ -0013ef30: 505f 4449 4d45 5f48 5245 463c 2f63 6f64 P_DIME_HREF DIME │ │ │ -0013ef70: 2061 7474 6163 686d 656e 7420 6861 7320 attachment has │ │ │ -0013ef80: 6e6f 2068 7265 6620 6672 6f6d 2053 4f41 no href from SOA │ │ │ -0013ef90: 5020 626f 6479 2061 6e64 206e 6f20 4449 P body and no DI │ │ │ -0013efa0: 4d45 2063 616c 6c62 6163 6b73 2077 6572 ME callbacks wer │ │ │ -0013efb0: 6520 6465 6669 6e65 6420 746f 2073 6176 e defined to sav │ │ │ -0013efc0: 6520 7468 6520 6174 7461 6368 6d65 6e74 e the attachment │ │ │ -0013efd0: 2020 2020 3c2f 7464 3e3c 2f74 723e 0a3c
#SOAP_D │ │ │ -0013f030: 494d 455f 4d49 534d 4154 4348 3c2f 636f IME_MISMATCH DIM │ │ │ -0013f070: 4520 7665 7273 696f 6e20 6572 726f 7220 E version error │ │ │ -0013f080: 2020 203c 2f74 643e 3c2f 7472 3e0a 3c74
XML el │ │ │ -0013f120: 656d 656e 7420 6861 7320 6475 706c 6963 ement has duplic │ │ │ -0013f130: 6174 6520 6964 2061 7474 7269 6275 7465 ate id attribute │ │ │ -0013f140: 2076 616c 7565 2028 6170 706c 6963 6162 value (applicab │ │ │ -0013f150: 6c65 2074 6f20 534f 4150 206d 756c 7469 le to SOAP multi │ │ │ -0013f160: 2d72 6566 2065 6e63 6f64 696e 6720 616e -ref encoding an │ │ │ -0013f170: 6420 3c63 6f64 653e 2353 4f41 505f 584d d #SOAP_XM │ │ │ -0013f180: 4c5f 4752 4150 483c 2f63 6f64 653e 2073 L_GRAPH s │ │ │ -0013f190: 6572 6961 6c69 7a61 7469 6f6e 2920 2020 erialization) │ │ │ -0013f1a0: 203c 2f74 643e 3c2f 7472 3e0a 3c74 7220
XML element or │ │ │ -0013f240: 2061 7474 7269 6275 7465 2069 7320 656d attribute is em │ │ │ -0013f250: 7074 7920 7768 656e 2061 2076 616c 7565 pty when a value │ │ │ -0013f260: 2069 7320 7265 7175 6972 6564 2020 2020 is required │ │ │ -0013f270: 3c2f 7464 3e3c 2f74 723e 0a3c 7472 2063
#SOAP_EOF Un │ │ │ -0013f300: 6578 7065 6374 6564 2065 6e64 206f 6620 expected end of │ │ │ -0013f310: 6669 6c65 2c20 6e6f 2069 6e70 7574 2c20 file, no input, │ │ │ -0013f320: 7472 616e 736d 6973 7369 6f6e 2069 6e74 transmission int │ │ │ -0013f330: 6572 7275 7074 6564 206f 7220 7469 6d65 errupted or time │ │ │ -0013f340: 6420 6f75 742c 2073 616d 6520 6173 203c d out, same as < │ │ │ -0013f350: 636f 6465 3e45 4f46 3c2f 636f 6465 3e20 code>EOF │ │ │ -0013f360: 2020 203c 2f74 643e 3c2f 7472 3e0a 3c74
#SOAP_EO │ │ │ -0013f3c0: 4d3c 2f63 6f64 653e 2020 203c 2f74 643e M Out of memory │ │ │ -0013f400: 2020 203c 2f74 643e 3c2f 7472 3e0a 3c74
The fault code │ │ │ -0013f570: 2074 6f20 6265 2072 6574 7572 6e65 6420 to be returned │ │ │ -0013f580: 6279 2061 2073 6572 7669 6365 206f 7065 by a service ope │ │ │ -0013f590: 7261 7469 6f6e 2077 6865 6e20 6361 6c6c ration when call │ │ │ -0013f5a0: 696e 6720 3c63 6f64 653e 3c61 2063 6c61 ing soap_sen │ │ │ -0013f650: 6465 725f 6661 756c 743c 2f61 3e3c 2f63 der_fault (client is │ │ │ -0013f670: 6174 2066 6175 6c74 2920 6f72 203c 636f at fault) or soap_receiver │ │ │ -0013f730: 5f66 6175 6c74 3c2f 613e 3c2f 636f 6465 _fault (server is at │ │ │ -0013f750: 6661 756c 7429 2c20 636c 6965 6e74 7320 fault), clients │ │ │ -0013f760: 7265 6365 6976 6520 7468 6520 6661 756c receive the faul │ │ │ -0013f770: 7420 6173 203c 636f 6465 3e23 534f 4150 t as #SOAP │ │ │ -0013f780: 5f43 4c49 5f46 4155 4c54 3c2f 636f 6465 _CLI_FAULT or #SOAP │ │ │ -0013f7a0: 5f53 5652 5f46 4155 4c54 3c2f 636f 6465 _SVR_FAULT respectively │ │ │ -0013f7c0: 2020 3c2f 7464 3e3c 2f74 723e 0a3c 7472
Too many │ │ │ -0013f860: 206f 7065 6e20 736f 636b 6574 7320 2020 open sockets │ │ │ -0013f870: 203c 2f74 643e 3c2f 7472 3e0a 3c74 7220
XML element or │ │ │ -0013f910: 2061 7474 7269 6275 7465 2076 616c 7565 attribute value │ │ │ -0013f920: 2069 7320 6669 7865 6420 616e 6420 7468 is fixed and th │ │ │ -0013f930: 6520 7061 7273 6564 2076 616c 7565 2064 e parsed value d │ │ │ -0013f940: 6f65 7320 6e6f 7420 6d61 7463 6820 7468 oes not match th │ │ │ -0013f950: 6520 6669 7865 6420 7661 6c75 6520 2020 e fixed value │ │ │ -0013f960: 203c 2f74 643e 3c2f 7472 3e0a 3c74 7220
< │ │ │ -0013f9b0: 636f 6465 3e23 534f 4150 5f47 4554 5f4d code>#SOAP_GET_M │ │ │ -0013f9c0: 4554 484f 443c 2f63 6f64 653e 2020 203c ETHOD < │ │ │ -0013f9d0: 2f74 643e 3c74 6420 636c 6173 733d 226d /td>An HTTP GE │ │ │ -0013fa00: 5420 7265 7175 6573 7420 7761 7320 7265 T request was re │ │ │ -0013fa10: 6365 6976 6564 2062 7920 7468 6520 7365 ceived by the se │ │ │ -0013fa20: 7276 6963 6520 6275 7420 7468 6520 4745 rvice but the GE │ │ │ -0013fa30: 5420 7265 7175 6573 7420 6361 6c6c 6261 T request callba │ │ │ -0013fa40: 636b 203c 636f 6465 3e3c 6120 636c 6173 ck soap: │ │ │ -0013fb10: 3a66 6765 743c 2f61 3e3c 2f63 6f64 653e :fget │ │ │ -0013fb20: 2069 7320 6e6f 7420 696d 706c 656d 656e is not implemen │ │ │ -0013fb30: 7465 642c 2073 6565 2053 6563 7469 6f6e ted, see Section │ │ │ -0013fb40: 7320 3c61 2063 6c61 7373 3d22 656c 2220 s How to imp │ │ │ -0013fb70: 6c65 6d65 6e74 2048 5454 5020 4745 542c lement HTTP GET, │ │ │ -0013fb80: 2050 5554 2c20 616e 6420 5041 5443 4820 PUT, and PATCH │ │ │ -0013fb90: 7365 7276 6963 6573 3c2f 613e 2061 6e64 services and │ │ │ -0013fba0: 203c 6120 636c 6173 733d 2265 6c22 2068 Functi │ │ │ -0013fbd0: 6f6e 2063 616c 6c62 6163 6b73 2066 6f72 on callbacks for │ │ │ -0013fbe0: 2063 7573 746f 6d69 7a65 6420 492f 4f20 customized I/O │ │ │ -0013fbf0: 616e 6420 4854 5450 2068 616e 646c 696e and HTTP handlin │ │ │ -0013fc00: 673c 2f61 3e20 2020 203c 2f74 643e 3c2f g
#S │ │ │ -0013fc60: 4f41 505f 4852 4546 3c2f 636f 6465 3e20 OAP_HREF │ │ │ -0013fc70: 2020 3c2f 7464 3e3c 7464 2063 6c61 7373 Referen │ │ │ -0013fca0: 6365 2074 6f20 6f62 6a65 6374 2069 6e20 ce to object in │ │ │ -0013fcb0: 584d 4c20 6964 656e 7469 6669 6564 2062 XML identified b │ │ │ -0013fcc0: 7920 6974 7320 6964 2061 7474 7269 6275 y its id attribu │ │ │ -0013fcd0: 7465 2069 7320 696e 636f 6d70 6174 6962 te is incompatib │ │ │ -0013fce0: 6c65 2077 6974 6820 7468 6520 6f62 6a65 le with the obje │ │ │ -0013fcf0: 6374 2072 6566 6572 7265 6420 746f 2062 ct referred to b │ │ │ -0013fd00: 7920 7468 6520 7265 6620 6f72 2068 7265 y the ref or hre │ │ │ -0013fd10: 6620 6174 7472 6962 7574 6520 2861 7070 f attribute (app │ │ │ -0013fd20: 6c69 6361 626c 6520 746f 2053 4f41 5020 licable to SOAP │ │ │ -0013fd30: 6d75 6c74 692d 7265 6620 656e 636f 6469 multi-ref encodi │ │ │ -0013fd40: 6e67 2061 6e64 203c 636f 6465 3e23 534f ng and #SO │ │ │ -0013fd50: 4150 5f58 4d4c 5f47 5241 5048 3c2f 636f AP_XML_GRAPH serializatio │ │ │ -0013fd70: 6e29 2020 2020 3c2f 7464 3e3c 2f74 723e n)
#SOAP_ │ │ │ -0013fdd0: 4854 5450 5f45 5252 4f52 3c2f 636f 6465 HTTP_ERROR An un │ │ │ -0013fe10: 7370 6563 6966 6965 6420 4854 5450 2065 specified HTTP e │ │ │ -0013fe20: 7272 6f72 206f 6363 7572 7265 6420 2020 rror occurred │ │ │ -0013fe30: 203c 2f74 643e 3c2f 7472 3e0a 3c74 7220
An HTTP │ │ │ -0013fed0: 7265 7175 6573 7420 7761 7320 7265 6365 request was rece │ │ │ -0013fee0: 6976 6564 2062 7920 7468 6520 7365 7276 ived by the serv │ │ │ -0013fef0: 6963 6520 7468 6174 2063 616e 6e6f 7420 ice that cannot │ │ │ -0013ff00: 6265 2068 616e 646c 6564 2020 2020 3c2f be handled
#SOAP_IOB SOAP │ │ │ -0013ffa0: 2061 7272 6179 2069 6e64 6578 206f 7574 array index out │ │ │ -0013ffb0: 206f 6620 626f 756e 6473 2020 2020 3c2f of bounds
#SOAP_LENGTH< │ │ │ -00140020: 2f63 6f64 653e 2020 203c 2f74 643e 3c74 /code>
#SOAP_LEVEL XML │ │ │ -00140140: 206e 6573 7469 6e67 2064 6570 7468 206c nesting depth l │ │ │ -00140150: 6576 656c 2065 7863 6565 6473 203c 636f evel exceeds #SOAP_MAXLEVE │ │ │ -00140170: 4c3c 2f63 6f64 653e 2020 2020 3c2f 7464 L
#SOAP_MIME_END< │ │ │ -001401e0: 2f63 6f64 653e 2020 203c 2f74 643e 3c74 /code>
#S │ │ │ -00140290: 4f41 505f 4d49 4d45 5f45 5252 4f52 3c2f OAP_MIME_ERROR M │ │ │ -001402d0: 494d 4520 6174 7461 6368 6d65 6e74 2070 IME attachment p │ │ │ -001402e0: 6172 7369 6e67 2065 7272 6f72 2020 2020 arsing error │ │ │ -001402f0: 3c2f 7464 3e3c 2f74 723e 0a3c 7472 2063
< │ │ │ -00140340: 636f 6465 3e23 534f 4150 5f4d 494d 455f code>#SOAP_MIME_ │ │ │ -00140350: 4852 4546 3c2f 636f 6465 3e20 2020 3c2f HREF MIME attach │ │ │ -00140390: 6d65 6e74 2068 6173 206e 6f20 6872 6566 ment has no href │ │ │ -001403a0: 2066 726f 6d20 534f 4150 2062 6f64 7920 from SOAP body │ │ │ -001403b0: 616e 6420 6e6f 204d 494d 4520 6361 6c6c and no MIME call │ │ │ -001403c0: 6261 636b 7320 7765 7265 2064 6566 696e backs were defin │ │ │ -001403d0: 6564 2074 6f20 7361 7665 2074 6865 2061 ed to save the a │ │ │ -001403e0: 7474 6163 686d 656e 7420 2020 203c 2f74 ttachment
#SOAP_MISSING_I │ │ │ -00140450: 443c 2f63 6f64 653e 2020 203c 2f74 643e D An XML element │ │ │ -00140490: 2077 6974 6820 6964 2061 7474 7269 6275 with id attribu │ │ │ -001404a0: 7465 2069 7320 6d69 7373 696e 6720 7468 te is missing th │ │ │ -001404b0: 6174 2073 686f 756c 6420 6d61 7463 6820 at should match │ │ │ -001404c0: 7468 6520 656c 656d 656e 7420 7769 7468 the element with │ │ │ -001404d0: 2068 7265 662f 7265 6620 6174 7472 6962 href/ref attrib │ │ │ -001404e0: 7574 6520 2861 7070 6c69 6361 626c 6520 ute (applicable │ │ │ -001404f0: 746f 2053 4f41 5020 6d75 6c74 692d 7265 to SOAP multi-re │ │ │ -00140500: 6620 656e 636f 6469 6e67 2061 6e64 203c f encoding and < │ │ │ -00140510: 636f 6465 3e23 534f 4150 5f58 4d4c 5f47 code>#SOAP_XML_G │ │ │ -00140520: 5241 5048 3c2f 636f 6465 3e20 7365 7269 RAPH seri │ │ │ -00140530: 616c 697a 6174 696f 6e29 2020 2020 3c2f alization)
#SOAP_MOE Mem │ │ │ -001405d0: 6f72 7920 6f76 6572 666c 6f77 206f 7220 ory overflow or │ │ │ -001405e0: 6d65 6d6f 7279 2063 6f72 7275 7074 696f memory corruptio │ │ │ -001405f0: 6e20 6572 726f 7220 2861 7070 6c69 6361 n error (applica │ │ │ -00140600: 626c 6520 696e 203c 636f 6465 3e23 4445 ble in #DE │ │ │ -00140610: 4255 473c 2f63 6f64 653e 206d 6f64 6520 BUG mode │ │ │ -00140620: 6f6e 6c79 2920 2020 203c 2f74 643e 3c2f only)
#SO │ │ │ -00140680: 4150 5f4d 5553 5455 4e44 4552 5354 414e AP_MUSTUNDERSTAN │ │ │ -00140690: 443c 2f63 6f64 653e 2020 203c 2f74 643e D An XML element │ │ │ -001406d0: 2069 7320 7072 6573 656e 7420 7769 7468 is present with │ │ │ -001406e0: 2061 206d 7573 7455 6e64 6572 7374 616e a mustUnderstan │ │ │ -001406f0: 6420 6174 7472 6962 7574 6520 7768 6963 d attribute whic │ │ │ -00140700: 6820 6d75 7374 2062 6520 756e 6465 7273 h must be unders │ │ │ -00140710: 746f 6f64 2062 7574 2069 7320 6e6f 7420 tood but is not │ │ │ -00140720: 6465 7365 7269 616c 697a 6564 2020 2020 deserialized │ │ │ -00140730: 3c2f 7464 3e3c 2f74 723e 0a3c 7472 2063
< │ │ │ -00140780: 636f 6465 3e23 534f 4150 5f4e 414d 4553 code>#SOAP_NAMES │ │ │ -00140790: 5041 4345 3c2f 636f 6465 3e20 2020 3c2f PACE XML namespa │ │ │ -001407d0: 6365 206e 616d 6520 6d69 736d 6174 6368 ce name mismatch │ │ │ -001407e0: 2076 616c 6964 6174 696f 6e20 6572 726f validation erro │ │ │ -001407f0: 7220 2020 203c 2f74 643e 3c2f 7472 3e0a r
#SOAP_N │ │ │ -00140850: 4f5f 4441 5441 3c2f 636f 6465 3e20 2020 O_DATA │ │ │ -00140860: 3c2f 7464 3e3c 7464 2063 6c61 7373 3d22 No data i │ │ │ -00140890: 6e20 7468 6520 4854 5450 2062 6f64 7920 n the HTTP body │ │ │ -001408a0: 6f66 2074 6865 206d 6573 7361 6765 2072 of the message r │ │ │ -001408b0: 6563 6569 7665 6420 2020 203c 2f74 643e eceived
│ │ │ -00140910: 2353 4f41 505f 4e4f 5f4d 4554 484f 443c #SOAP_NO_METHOD< │ │ │ -00140920: 2f63 6f64 653e 2020 203c 2f74 643e 3c74 /code>
No XML elemen │ │ │ -00140a50: 7420 7461 6720 7761 7320 666f 756e 6420 t tag was found │ │ │ -00140a60: 7768 656e 206f 6e65 2077 6173 2065 7870 when one was exp │ │ │ -00140a70: 6563 7465 6420 2020 203c 2f74 643e 3c2f ected
#S │ │ │ -00140ad0: 4f41 505f 4e54 4c4d 5f45 5252 4f52 3c2f OAP_NTLM_ERROR A │ │ │ -00140b10: 6e20 4e54 4c4d 2061 7574 6865 6e74 6963 n NTLM authentic │ │ │ -00140b20: 6174 696f 6e20 6861 6e64 7368 616b 6520 ation handshake │ │ │ -00140b30: 6572 726f 7220 6f63 6375 7272 6564 2020 error occurred │ │ │ -00140b40: 2020 3c2f 7464 3e3c 2f74 723e 0a3c 7472
#SOAP_OC │ │ │ -00140ca0: 4355 5253 3c2f 636f 6465 3e20 2020 3c2f CURS XML element │ │ │ -00140ce0: 206d 696e 4f63 6375 7273 206f 7220 6d61 minOccurs or ma │ │ │ -00140cf0: 784f 6363 7572 7320 7661 6c69 6461 7469 xOccurs validati │ │ │ -00140d00: 6f6e 2065 7272 6f72 206f 7220 3c63 6f64 on error or #SOAP_MAXOCCUR │ │ │ -00140d20: 533c 2f63 6f64 653e 2065 7863 6565 6465 S exceede │ │ │ -00140d30: 6420 2020 203c 2f74 643e 3c2f 7472 3e0a d
#SOAP_P │ │ │ -00140d90: 4154 4348 5f4d 4554 484f 443c 2f63 6f64 ATCH_METHOD An H │ │ │ -00140dd0: 5454 5020 5041 5443 4820 7265 7175 6573 TTP PATCH reques │ │ │ -00140de0: 7420 7761 7320 7265 6365 6976 6564 2062 t was received b │ │ │ -00140df0: 7920 7468 6520 7365 7276 6963 6520 6275 y the service bu │ │ │ -00140e00: 7420 7468 6520 5041 5443 4820 7265 7175 t the PATCH requ │ │ │ -00140e10: 6573 7420 6361 6c6c 6261 636b 203c 636f est callback soap::f │ │ │ -00140ef0: 7061 7463 683c 2f61 3e3c 2f63 6f64 653e patch │ │ │ -00140f00: 2069 7320 6e6f 7420 696d 706c 656d 656e is not implemen │ │ │ -00140f10: 7465 642c 2073 6565 2053 6563 7469 6f6e ted, see Section │ │ │ -00140f20: 203c 6120 636c 6173 733d 2265 6c22 2068 Functi │ │ │ -00140f50: 6f6e 2063 616c 6c62 6163 6b73 2066 6f72 on callbacks for │ │ │ -00140f60: 2063 7573 746f 6d69 7a65 6420 492f 4f20 customized I/O │ │ │ -00140f70: 616e 6420 4854 5450 2068 616e 646c 696e and HTTP handlin │ │ │ -00140f80: 673c 2f61 3e20 2020 203c 2f74 643e 3c2f g
#S │ │ │ -00140fe0: 4f41 505f 5041 5454 4552 4e3c 2f63 6f64 OAP_PATTERN XML │ │ │ -00141020: 656c 656d 656e 7420 6f72 2061 7474 7269 element or attri │ │ │ -00141030: 6275 7465 2076 616c 7565 2070 6174 7465 bute value patte │ │ │ -00141040: 726e 206d 6973 6d61 7463 6820 2020 203c rn mismatch < │ │ │ -00141050: 2f74 643e 3c2f 7472 3e0a 3c74 7220 636c /td>
#SOAP_PLUGIN_ │ │ │ -001410b0: 4552 524f 523c 2f63 6f64 653e 2020 203c ERROR < │ │ │ -001410c0: 2f74 643e 3c74 6420 636c 6173 733d 226d /td>Failed to │ │ │ -001410f0: 7265 6769 7374 6572 2070 6c75 6769 6e20 register plugin │ │ │ -00141100: 2020 203c 2f74 643e 3c2f 7472 3e0a 3c74
#SOAP_PR │ │ │ -00141160: 4f48 4942 4954 4544 3c2f 636f 6465 3e20 OHIBITED │ │ │ -00141170: 2020 3c2f 7464 3e3c 7464 2063 6c61 7373 XML att │ │ │ -001411a0: 7269 6275 7465 2069 7320 7072 6f68 6962 ribute is prohib │ │ │ -001411b0: 6974 6564 2062 7574 2070 7265 7365 6e74 ited but present │ │ │ -001411c0: 2020 2020 3c2f 7464 3e3c 2f74 723e 0a3c
#SOAP_PU │ │ │ -00141220: 545f 4d45 5448 4f44 3c2f 636f 6465 3e20 T_METHOD │ │ │ -00141230: 2020 3c2f 7464 3e3c 7464 2063 6c61 7373 An HTTP │ │ │ -00141260: 2050 5554 2072 6571 7565 7374 2077 6173 PUT request was │ │ │ -00141270: 2072 6563 6569 7665 6420 6279 2074 6865 received by the │ │ │ -00141280: 2073 6572 7669 6365 2062 7574 2074 6865 service but the │ │ │ -00141290: 2050 5554 2072 6571 7565 7374 2063 616c PUT request cal │ │ │ -001412a0: 6c62 6163 6b20 3c63 6f64 653e 3c61 2063 lback so │ │ │ -00141370: 6170 3a3a 6670 7574 3c2f 613e 3c2f 636f ap::fput is not imple │ │ │ -00141390: 6d65 6e74 6564 2c20 7365 6520 5365 6374 mented, see Sect │ │ │ -001413a0: 696f 6e20 3c61 2063 6c61 7373 3d22 656c ion Fun │ │ │ -001413d0: 6374 696f 6e20 6361 6c6c 6261 636b 7320 ction callbacks │ │ │ -001413e0: 666f 7220 6375 7374 6f6d 697a 6564 2049 for customized I │ │ │ -001413f0: 2f4f 2061 6e64 2048 5454 5020 6861 6e64 /O and HTTP hand │ │ │ -00141400: 6c69 6e67 3c2f 613e 2020 2020 3c2f 7464 ling
#SOAP_REQUIRED< │ │ │ -00141470: 2f63 6f64 653e 2020 203c 2f74 643e 3c74 /code>
#SOAP_SSL_ERROR │ │ │ -00141530: 3c2f 636f 6465 3e20 2020 3c2f 7464 3e3c
# │ │ │ -001415d0: 534f 4150 5f53 5652 5f46 4155 4c54 3c2f SOAP_SVR_FAULT T │ │ │ -00141610: 6865 2073 6572 7669 6365 2072 6574 7572 he service retur │ │ │ -00141620: 6e65 6420 6120 534f 4150 2031 2e31 2073 ned a SOAP 1.1 s │ │ │ -00141630: 6572 7665 7220 6661 756c 7420 6f72 2053 erver fault or S │ │ │ -00141640: 4f41 5020 312e 3220 7265 6365 6976 6572 OAP 1.2 receiver │ │ │ -00141650: 2066 6175 6c74 2074 6f20 7468 6520 636c fault to the cl │ │ │ -00141660: 6965 6e74 2020 2020 3c2f 7464 3e3c 2f74 ient
#SOA │ │ │ -001416c0: 505f 5359 4e54 4158 5f45 5252 4f52 3c2f P_SYNTAX_ERROR A │ │ │ -00141700: 6e20 584d 4c20 7379 6e74 6178 2065 7272 n XML syntax err │ │ │ -00141710: 6f72 206f 6363 7572 7265 6420 7768 696c or occurred whil │ │ │ -00141720: 6520 7061 7273 696e 6720 7468 6520 696e e parsing the in │ │ │ -00141730: 7075 7420 2020 203c 2f74 643e 3c2f 7472 put
#SOA │ │ │ -00141790: 505f 5441 475f 4d49 534d 4154 4348 3c2f P_TAG_MISMATCH X │ │ │ -001417d0: 4d4c 2065 6c65 6d65 6e74 2074 6167 2070 ML element tag p │ │ │ -001417e0: 6172 7365 6420 646f 6573 206e 6f74 206d arsed does not m │ │ │ -001417f0: 6174 6368 2061 6e79 7468 696e 6720 7468 atch anything th │ │ │ -00141800: 6174 2069 7320 6578 7065 6374 6564 2020 at is expected │ │ │ -00141810: 2020 3c2f 7464 3e3c 2f74 723e 0a3c 7472
A TCP/IP c │ │ │ -001418b0: 6f6e 6e65 6374 696f 6e20 6572 726f 7220 onnection error │ │ │ -001418c0: 6f63 6375 7272 6564 2020 2020 3c2f 7464 occurred
#SOAP_TYPE XML │ │ │ -00141960: 656c 656d 656e 7420 6f72 2061 7474 7269 element or attri │ │ │ -00141970: 6275 7465 2068 6173 2061 206d 6973 6d61 bute has a misma │ │ │ -00141980: 7463 6869 6e67 2074 7970 6520 6f72 2076 tching type or v │ │ │ -00141990: 616c 7565 2074 6861 7420 6973 2063 6175 alue that is cau │ │ │ -001419a0: 7369 6e67 2061 2076 616c 6964 6174 696f sing a validatio │ │ │ -001419b0: 6e20 6572 726f 7220 2020 203c 2f74 643e n error
# │ │ │ -00141a10: 534f 4150 5f55 4450 5f45 5252 4f52 3c2f SOAP_UDP_ERROR A │ │ │ -00141a50: 2055 4450 2f49 5020 636f 6e6e 6563 7469 UDP/IP connecti │ │ │ -00141a60: 6f6e 2065 7272 6f72 206f 6363 7572 7265 on error occurre │ │ │ -00141a70: 6420 6f72 2074 6865 206d 6573 7361 6765 d or the message │ │ │ -00141a80: 2074 6f6f 206c 6172 6765 2074 6f20 7374 too large to st │ │ │ -00141a90: 6f72 6520 696e 2061 2055 4450 2070 6163 ore in a UDP pac │ │ │ -00141aa0: 6b65 7420 2020 203c 2f74 643e 3c2f 7472 ket
#SOA │ │ │ -00141b00: 505f 5553 4552 5f45 5252 4f52 3c2f 636f P_USER_ERROR soap::user< │ │ │ -00141c00: 2f61 3e20 6e6f 7420 7365 7420 746f 206e /a> not set to n │ │ │ -00141c10: 6f6e 2d4e 554c 4c20 2020 203c 2f74 643e on-NULL
# │ │ │ -00141c70: 534f 4150 5f55 5446 5f45 5252 4f52 3c2f SOAP_UTF_ERROR A │ │ │ -00141cb0: 6e20 5554 462d 3820 6465 636f 6469 6e67 n UTF-8 decoding │ │ │ -00141cc0: 2065 7272 6f72 206f 6363 7572 7265 6420 error occurred │ │ │ -00141cd0: 2020 203c 2f74 643e 3c2f 7472 3e0a 3c74
#SOAP_VE │ │ │ -00141d30: 5253 494f 4e4d 4953 4d41 5443 483c 2f63 RSIONMISMATCH SO │ │ │ -00141d70: 4150 2076 6572 7369 6f6e 206d 6973 6d61 AP version misma │ │ │ -00141d80: 7463 6820 6f72 206e 6f20 534f 4150 206d tch or no SOAP m │ │ │ -00141d90: 6573 7361 6765 2069 7320 7265 6365 6976 essage is receiv │ │ │ -00141da0: 6564 2020 2020 3c2f 7464 3e3c 2f74 723e ed
#SOAP_ │ │ │ -00141e00: 5a4c 4942 5f45 5252 4f52 3c2f 636f 6465 ZLIB_ERROR A zli │ │ │ -00141e40: 6220 6572 726f 7220 6f63 6375 7272 6564 b error occurred │ │ │ -00141e50: 2020 203c 2f74 643e 3c2f 7472 3e0a 3c2f
. │ │ │ -001436d0: 0a3c 7468 2063 6c61 7373 3d22 6d61 726b .< │ │ │ -00143700: 7468 2063 6c61 7373 3d22 6d61 726b 646f th class="markdo │ │ │ -00143710: 776e 5461 626c 6548 6561 644e 6f6e 6522 wnTableHeadNone" │ │ │ -00143720: 3e44 6573 6372 6970 7469 6f6e 2020 2020 >Description │ │ │ -00143730: 3c2f 7468 3e3c 2f74 723e 0a3c 7472 2063 ......< │ │ │ -00143870: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ -00143880: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ -00143890: 3e32 3032 2020 203c 2f74 643e 3c74 6420 >202 < │ │ │ -001438d0: 2f74 723e 0a3c 7472 2063 6c61 7373 3d22 /tr>.... │ │ │ -001439c0: 3c74 6420 636c 6173 733d 226d 6172 6b64 .... │ │ │ -00143b10: 3c2f 7472 3e0a 3c74 7220 636c 6173 733d .. │ │ │ -00143ba0: 3c2f 7472 3e0a 3c74 7220 636c 6173 733d .. │ │ │ -00143c30: 3c2f 7472 3e0a 3c74 7220 636c 6173 733d .......< │ │ │ -00143dd0: 7472 2063 6c61 7373 3d22 6d61 726b 646f tr class="markdo │ │ │ -00143de0: 776e 5461 626c 6552 6f77 4f64 6422 3e0a wnTableRowOdd">. │ │ │ -00143df0: 3c74 6420 636c 6173 733d 226d 6172 6b64 .......< │ │ │ -00144000: 7472 2063 6c61 7373 3d22 6d61 726b 646f tr class="markdo │ │ │ -00144010: 776e 5461 626c 6552 6f77 4f64 6422 3e0a wnTableRowOdd">. │ │ │ -00144020: 3c74 6420 636c 6173 733d 226d 6172 6b64 .. │ │ │ -001440b0: 3c74 6420 636c 6173 733d 226d 6172 6b64 ...< │ │ │ -001441a0: 7472 2063 6c61 7373 3d22 6d61 726b 646f tr class="markdo │ │ │ -001441b0: 776e 5461 626c 6552 6f77 4576 656e 223e wnTableRowEven"> │ │ │ -001441c0: 0a3c 7464 2063 6c61 7373 3d22 6d61 726b . │ │ │ -00144210: 4d65 7468 6f64 204e 6f74 2041 6c6c 6f77 Method Not Allow │ │ │ -00144220: 6564 2020 2020 3c2f 7464 3e3c 2f74 723e ed │ │ │ -00144230: 0a3c 7472 2063 6c61 7373 3d22 6d61 726b ..< │ │ │ -00144280: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ -00144290: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ -001442a0: 3e4e 6f74 2041 6363 6570 7461 626c 6520 >Not Acceptable │ │ │ -001442b0: 2020 203c 2f74 643e 3c2f 7472 3e0a 3c74 .. │ │ │ -001442e0: 3c74 6420 636c 6173 733d 226d 6172 6b64 ...... │ │ │ -001444c0: 3c74 6420 636c 6173 733d 226d 6172 6b64 < │ │ │ -001444f0: 2f74 723e 0a3c 7472 2063 6c61 7373 3d22 /tr>.... │ │ │ -00144610: 3c2f 7472 3e0a 3c74 7220 636c 6173 733d ....< │ │ │ -001446d0: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ -001446e0: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ -001446f0: 3e34 3134 2020 203c 2f74 643e 3c74 6420 >414 .... │ │ │ -00144870: 3c2f 7472 3e0a 3c74 7220 636c 6173 733d ...... │ │ │ -001449e0: 3530 3120 2020 3c2f 7464 3e3c 7464 2063 501 ..< │ │ │ -00144ab0: 2f74 723e 0a3c 7472 2063 6c61 7373 3d22 /tr>....... │ │ │ -00144c70: 3c2f 7461 626c 653e 0a3c 703e 4854 5450
Code
20 │ │ │ -00143780: 3020 2020 3c2f 7464 3e3c 7464 2063 6c61 0 OK (n │ │ │ -001437b0: 6f20 6572 726f 7229 2020 2020 3c2f 7464 o error)
201 │ │ │ -00143810: 203c 2f74 643e 3c74 6420 636c 6173 733d Created │ │ │ -00143840: 2020 203c 2f74 643e 3c2f 7472 3e0a 3c74
Ac │ │ │ -001438c0: 6365 7074 6564 2020 2020 3c2f 7464 3e3c cepted
203 < │ │ │ -00143920: 2f74 643e 3c74 6420 636c 6173 733d 226d /td>Non-Author │ │ │ -00143950: 6974 6174 6976 6520 496e 666f 726d 6174 itative Informat │ │ │ -00143960: 696f 6e20 2020 203c 2f74 643e 3c2f 7472 ion
204 No Content │ │ │ -001439f0: 3c2f 7464 3e3c 2f74 723e 0a3c 7472 2063
2 │ │ │ -00143a40: 3035 2020 203c 2f74 643e 3c74 6420 636c 05 Rese │ │ │ -00143a70: 7420 436f 6e74 656e 7420 2020 203c 2f74 t Content
206 │ │ │ -00143ad0: 203c 2f74 643e 3c74 6420 636c 6173 733d Partial │ │ │ -00143b00: 436f 6e74 656e 7420 2020 203c 2f74 643e Content
300 │ │ │ -00143b60: 3c2f 7464 3e3c 7464 2063 6c61 7373 3d22 Multiple │ │ │ -00143b90: 4368 6f69 6365 7320 2020 203c 2f74 643e Choices
301 < │ │ │ -00143bf0: 2f74 643e 3c74 6420 636c 6173 733d 226d /td>Moved Perm │ │ │ -00143c20: 616e 656e 746c 7920 2020 203c 2f74 643e anently
302 │ │ │ -00143c80: 3c2f 7464 3e3c 7464 2063 6c61 7373 3d22 Found │ │ │ -00143cb0: 3c2f 7464 3e3c 2f74 723e 0a3c 7472 2063
30 │ │ │ -00143d00: 3320 2020 3c2f 7464 3e3c 7464 2063 6c61 3 See O │ │ │ -00143d30: 7468 6572 2020 2020 3c2f 7464 3e3c 2f74 ther
304 Not Modified │ │ │ -00143dc0: 2020 2020 3c2f 7464 3e3c 2f74 723e 0a3c
305 U │ │ │ -00143e40: 7365 2050 726f 7879 2020 2020 3c2f 7464 se Proxy
307 │ │ │ -00143ea0: 203c 2f74 643e 3c74 6420 636c 6173 733d Temporar │ │ │ -00143ed0: 7920 5265 6469 7265 6374 2020 2020 3c2f y Redirect
400 │ │ │ -00143f30: 2020 3c2f 7464 3e3c 7464 2063 6c61 7373 Bad Req │ │ │ -00143f60: 7565 7374 2020 2020 3c2f 7464 3e3c 2f74 uest
401 Unauthorized │ │ │ -00143ff0: 2020 2020 3c2f 7464 3e3c 2f74 723e 0a3c
402 P │ │ │ -00144070: 6179 6d65 6e74 2052 6571 7569 7265 6420 ayment Required │ │ │ -00144080: 2020 203c 2f74 643e 3c2f 7472 3e0a 3c74
403 F │ │ │ -00144100: 6f72 6269 6464 656e 2020 2020 3c2f 7464 orbidden
404 │ │ │ -00144160: 3c2f 7464 3e3c 7464 2063 6c61 7373 3d22 Not Found │ │ │ -00144190: 2020 2020 3c2f 7464 3e3c 2f74 723e 0a3c
405
406
407 P │ │ │ -00144330: 726f 7879 2041 7574 6865 6e74 6963 6174 roxy Authenticat │ │ │ -00144340: 696f 6e20 5265 7175 6972 6564 2020 2020 ion Required │ │ │ -00144350: 3c2f 7464 3e3c 2f74 723e 0a3c 7472 2063
40 │ │ │ -001443a0: 3820 2020 3c2f 7464 3e3c 7464 2063 6c61 8 Reque │ │ │ -001443d0: 7374 2054 696d 652d 6f75 7420 2020 203c st Time-out < │ │ │ -001443e0: 2f74 643e 3c2f 7472 3e0a 3c74 7220 636c /td>
40 │ │ │ -00144430: 3920 2020 3c2f 7464 3e3c 7464 2063 6c61 9 Confl │ │ │ -00144460: 6963 7420 2020 203c 2f74 643e 3c2f 7472 ict
410 Gone
411 < │ │ │ -00144540: 2f74 643e 3c74 6420 636c 6173 733d 226d /td>Length Req │ │ │ -00144570: 7569 7265 6420 2020 203c 2f74 643e 3c2f uired
412 Precondition │ │ │ -00144600: 2046 6169 6c65 6420 2020 203c 2f74 643e Failed
413 │ │ │ -00144660: 3c2f 7464 3e3c 7464 2063 6c61 7373 3d22 Request E │ │ │ -00144690: 6e74 6974 7920 546f 6f20 4c61 7267 6520 ntity Too Large │ │ │ -001446a0: 2020 203c 2f74 643e 3c2f 7472 3e0a 3c74
Re │ │ │ -00144720: 7175 6573 742d 5552 4920 546f 6f20 4c61 quest-URI Too La │ │ │ -00144730: 7267 6520 2020 203c 2f74 643e 3c2f 7472 rge
415 Unsupported M │ │ │ -001447c0: 6564 6961 2054 7970 6520 2020 203c 2f74 edia Type
416 │ │ │ -00144820: 203c 2f74 643e 3c74 6420 636c 6173 733d Requeste │ │ │ -00144850: 6420 7261 6e67 6520 6e6f 7420 7361 7469 d range not sati │ │ │ -00144860: 7366 6961 626c 6520 2020 203c 2f74 643e sfiable
417 │ │ │ -001448c0: 3c2f 7464 3e3c 7464 2063 6c61 7373 3d22 Expectati │ │ │ -001448f0: 6f6e 2046 6169 6c65 6420 2020 203c 2f74 on Failed
500 │ │ │ -00144950: 203c 2f74 643e 3c74 6420 636c 6173 733d Internal │ │ │ -00144980: 2053 6572 7665 7220 4572 726f 7220 2020 Server Error │ │ │ -00144990: 203c 2f74 643e 3c2f 7472 3e0a 3c74 7220
Not │ │ │ -00144a10: 2049 6d70 6c65 6d65 6e74 6564 2020 2020 Implemented │ │ │ -00144a20: 3c2f 7464 3e3c 2f74 723e 0a3c 7472 2063
50 │ │ │ -00144a70: 3220 2020 3c2f 7464 3e3c 7464 2063 6c61 2 Bad G │ │ │ -00144aa0: 6174 6577 6179 2020 2020 3c2f 7464 3e3c ateway
503 < │ │ │ -00144b00: 2f74 643e 3c74 6420 636c 6173 733d 226d /td>Service Un │ │ │ -00144b30: 6176 6169 6c61 626c 6520 2020 203c 2f74 available
504 │ │ │ -00144b90: 203c 2f74 643e 3c74 6420 636c 6173 733d Gateway │ │ │ -00144bc0: 5469 6d65 2d6f 7574 2020 2020 3c2f 7464 Time-out
505 │ │ │ -00144c20: 203c 2f74 643e 3c74 6420 636c 6173 733d HTTP Ver │ │ │ -00144c50: 7369 6f6e 206e 6f74 2073 7570 706f 7274 sion not support │ │ │ -00144c60: 6564 2020 203c 2f74 643e 3c2f 7472 3e0a ed
.

HTTP │ │ │ -00144c80: 2073 7461 7475 7320 636f 6465 2032 3030 status code 200 │ │ │ -00144c90: 2069 7320 6e6f 7420 666c 6167 6765 6420 is not flagged │ │ │ -00144ca0: 6173 2061 6e20 6572 726f 7220 6279 2074 as an error by t │ │ │ -00144cb0: 6865 2065 6e67 696e 652e 2053 7461 7475 he engine. Statu │ │ │ -00144cc0: 7320 636f 6465 7320 3230 3120 616e 6420 s codes 201 and │ │ │ -00144cd0: 3230 3220 6172 6520 696e 666f 726d 6174 202 are informat │ │ │ -00144ce0: 6976 6520 616e 6420 7368 6f75 6c64 206e ive and should n │ │ │ -00144cf0: 6f74 2062 6520 636f 6e73 6964 6572 6564 ot be considered │ │ │ -00144d00: 2065 7272 6f72 7320 6279 2074 6865 2061 errors by the a │ │ │ -00144d10: 7070 6c69 6361 7469 6f6e 206c 6f67 6963 pplication logic │ │ │ -00144d20: 2e3c 2f70 3e0a 3c70 3e53 6572 7665 722d .

.

Server- │ │ │ -00144d30: 7369 6465 2069 6d70 6c65 6d65 6e74 6174 side implementat │ │ │ -00144d40: 696f 6e73 206f 6620 7365 7276 6963 6520 ions of service │ │ │ -00144d50: 6f70 6572 6174 696f 6e73 2073 686f 756c operations shoul │ │ │ -00144d60: 6420 7265 7475 726e 203c 636f 6465 3e23 d return # │ │ │ -00144d70: 534f 4150 5f4f 4b3c 2f63 6f64 653e 2077 SOAP_OK w │ │ │ -00144d80: 6865 6e20 7468 6520 6f70 6572 6174 696f hen the operatio │ │ │ -00144d90: 6e20 7761 7320 7375 6363 6573 7366 756c n was successful │ │ │ -00144da0: 2c20 7768 6963 6820 7265 7475 726e 7320 , which returns │ │ │ -00144db0: 6120 2232 3030 204f 4b22 2048 5454 5020 a "200 OK" HTTP │ │ │ -00144dc0: 6865 6164 6572 2077 6974 6820 7468 6520 header with the │ │ │ -00144dd0: 584d 4c20 7265 7370 6f6e 7365 206d 6573 XML response mes │ │ │ -00144de0: 7361 6765 2e20 5365 7276 6572 2d73 6964 sage. Server-sid │ │ │ -00144df0: 6520 696d 706c 656d 656e 7461 7469 6f6e e implementation │ │ │ -00144e00: 7320 6f66 2073 6572 7669 6365 206f 7065 s of service ope │ │ │ -00144e10: 7261 7469 6f6e 7320 696e 2067 534f 4150 rations in gSOAP │ │ │ -00144e20: 206d 6179 2064 6972 6563 746c 7920 7265 may directly re │ │ │ -00144e30: 7475 726e 2061 6e20 4854 5450 2073 7461 turn an HTTP sta │ │ │ -00144e40: 7475 7320 636f 6465 2077 6865 6e20 616e tus code when an │ │ │ -00144e50: 2048 5454 502d 7265 6c61 7465 6420 6572 HTTP-related er │ │ │ -00144e60: 726f 7220 7368 6f75 6c64 2062 6520 7265 ror should be re │ │ │ -00144e70: 7475 726e 6564 2e20 466f 7220 6578 616d turned. For exam │ │ │ -00144e80: 706c 652c 203c 636f 6465 3e72 6574 7572 ple, retur │ │ │ -00144e90: 6e20 3430 343c 2f63 6f64 653e 2072 6574 n 404 ret │ │ │ -00144ea0: 7572 6e73 2022 3430 3420 4e6f 7420 466f urns "404 Not Fo │ │ │ -00144eb0: 756e 6422 2074 6f20 7468 6520 636c 6965 und" to the clie │ │ │ -00144ec0: 6e74 2061 6e64 2074 6865 203c 636f 6465 nt and the soap::err │ │ │ -00144f80: 6f72 3c2f 613e 3c2f 636f 6465 3e20 7661 or va │ │ │ -00144f90: 7269 6162 6c65 2069 7320 7365 7420 746f riable is set to │ │ │ -00144fa0: 2034 3034 2061 7420 7468 6520 636c 6965 404 at the clie │ │ │ -00144fb0: 6e74 2073 6964 652e 3c2f 703e 0a3c 703e nt side.

.

│ │ │ -00144fc0: 546f 2072 6574 7572 6e20 6120 534f 4150 To return a SOAP │ │ │ -00144fd0: 2046 6175 6c74 2066 726f 6d20 6120 7365 Fault from a se │ │ │ -00144fe0: 7276 6572 2d73 6964 6520 696d 706c 656d rver-side implem │ │ │ -00144ff0: 656e 7461 7469 6f6e 206f 6620 6120 7365 entation of a se │ │ │ -00145000: 7276 6963 6520 6f70 6572 6174 696f 6e2c rvice operation, │ │ │ -00145010: 2075 7365 206f 6e65 206f 6620 7468 6520 use one of the │ │ │ -00145020: 666f 6c6c 6f77 696e 6720 6675 6e63 7469 following functi │ │ │ -00145030: 6f6e 7320 746f 2070 6f70 756c 6174 6520 ons to populate │ │ │ -00145040: 7468 6520 534f 4150 2046 6175 6c74 206d the SOAP Fault m │ │ │ -00145050: 6573 7361 6765 3a3c 2f70 3e3c 756c 3e0a essage:

. │ │ │ -00145930: 3c70 3e41 2072 6563 6569 7665 7220 6572

A receiver er │ │ │ -00145940: 726f 7220 696e 6469 6361 7465 7320 7468 ror indicates th │ │ │ -00145950: 6174 2074 6865 2073 6572 7669 6365 2063 at the service c │ │ │ -00145960: 6f75 6c64 206e 6f74 2068 616e 646c 6520 ould not handle │ │ │ -00145970: 7468 6520 636c 6965 6e74 2072 6571 7565 the client reque │ │ │ -00145980: 7374 2c20 6275 7420 6974 2063 616e 2070 st, but it can p │ │ │ -00145990: 6f73 7369 626c 7920 7265 636f 7665 7220 ossibly recover │ │ │ -001459a0: 6672 6f6d 2074 6865 2065 7272 6f72 206c from the error l │ │ │ -001459b0: 6174 6572 2c20 666f 7220 6578 616d 706c ater, for exampl │ │ │ -001459c0: 6520 7768 656e 2072 6573 6f75 7263 6573 e when resources │ │ │ -001459d0: 2061 7265 2074 656d 706f 7261 7269 6c79 are temporarily │ │ │ -001459e0: 2075 6e61 7661 696c 6162 6c65 2e20 4120 unavailable. A │ │ │ -001459f0: 7365 6e64 6572 2065 7272 6f72 2069 6e64 sender error ind │ │ │ -00145a00: 6963 6174 6573 2074 6861 7420 7468 6520 icates that the │ │ │ -00145a10: 636c 6965 6e74 2072 6571 7565 7374 2069 client request i │ │ │ -00145a20: 7320 6661 756c 7479 2061 6e64 2073 2072 s faulty and s r │ │ │ -00145a30: 656a 6563 7465 6420 6279 2074 6865 2073 ejected by the s │ │ │ -00145a40: 6572 7669 6365 2e3c 2f70 3e0a 3c70 3e53 ervice.

.

S │ │ │ -00145a50: 6565 2053 6563 7469 6f6e 203c 6120 636c ee Section SOAP Fault proc │ │ │ -00145a90: 6573 7369 6e67 3c2f 613e 2066 6f72 206d essing for m │ │ │ -00145aa0: 6f72 6520 6465 7461 696c 7320 6f6e 2068 ore details on h │ │ │ -00145ab0: 6f77 2074 6f20 7573 6520 7468 6573 6520 ow to use these │ │ │ -00145ac0: 6675 6e63 7469 6f6e 732e 3c2f 703e 0a3c functions.

.< │ │ │ -00145ad0: 703e f09f 949d 203c 6120 6872 6566 3d22 p>.... Back to table │ │ │ -00145af0: 206f 6620 636f 6e74 656e 7473 3c2f 613e of contents │ │ │ -00145b00: 3c2f 703e 0a3c 6831 3e3c 6120 636c 6173

.

.Memo │ │ │ -00145b30: 7279 206d 616e 6167 656d 656e 743c 2f68 ry management.

Memory man │ │ │ -00145b50: 6167 656d 656e 7420 7769 7468 2067 534f agement with gSO │ │ │ -00145b60: 4150 2069 7320 6175 746f 6d61 7469 632e AP is automatic. │ │ │ -00145b70: 2054 6865 2065 6e67 696e 6520 636f 6e74 The engine cont │ │ │ -00145b80: 6578 7420 6d61 6e61 6765 7320 616c 6c20 ext manages all │ │ │ -00145b90: 6d65 6d6f 7279 2061 6c6c 6f63 6174 6564 memory allocated │ │ │ -00145ba0: 2074 6f20 7365 7269 616c 697a 6520 6461 to serialize da │ │ │ -00145bb0: 7461 2061 6e64 2066 6f72 2074 656d 706f ta and for tempo │ │ │ -00145bc0: 7261 7279 2073 746f 7261 6765 2e20 4465 rary storage. De │ │ │ -00145bd0: 7365 7269 616c 697a 6564 2064 6174 6120 serialized data │ │ │ -00145be0: 6973 2061 6c6c 6f63 6174 6564 2069 6e20 is allocated in │ │ │ -00145bf0: 6d61 6e61 6765 6420 6d65 6d6f 7279 2061 managed memory a │ │ │ -00145c00: 6e64 2064 6174 6120 7374 7275 6374 7572 nd data structur │ │ │ -00145c10: 6573 2063 616e 2062 6520 616c 6c6f 6361 es can be alloca │ │ │ -00145c20: 7465 6420 696e 206d 616e 6167 6564 206d ted in managed m │ │ │ -00145c30: 656d 6f72 7920 6279 2074 6865 2075 7365 emory by the use │ │ │ -00145c40: 7220 7768 656e 2064 6573 6972 6564 2075 r when desired u │ │ │ -00145c50: 7369 6e67 203c 636f 6465 3e73 6f61 705f sing soap_ │ │ │ -00145c60: 6e65 775f 543c 2f63 6f64 653e 2066 756e new_T fun │ │ │ -00145c70: 6374 696f 6e73 2067 656e 6572 6174 6564 ctions generated │ │ │ -00145c80: 2062 7920 736f 6170 6370 7032 2066 6f72 by soapcpp2 for │ │ │ -00145c90: 2065 6163 6820 7365 7269 616c 697a 6162 each serializab │ │ │ -00145ca0: 6c65 2074 7970 6520 3c63 6f64 653e 543c le type T< │ │ │ -00145cb0: 2f63 6f64 653e 2e20 416c 6c20 6d65 6d6f /code>. All memo │ │ │ -00145cc0: 7279 206d 616e 6167 6564 2062 7920 6120 ry managed by a │ │ │ -00145cd0: 636f 6e74 6578 7420 6973 2064 6561 6c6c context is deall │ │ │ -00145ce0: 6f63 6174 6564 2077 6974 6820 3c63 6f64 ocated with soap_destroy to dest │ │ │ -00145dc0: 726f 7920 6d61 6e61 6765 6420 432b 2b20 roy managed C++ │ │ │ -00145dd0: 6f62 6a65 6374 7320 616e 6420 3c63 6f64 objects and soap_end to del │ │ │ -00145ec0: 6574 6520 616c 6c20 6f74 6865 7220 6d61 ete all other ma │ │ │ -00145ed0: 6e61 6765 6420 6461 7461 2e20 5768 656e naged data. When │ │ │ -00145ee0: 2061 2063 6f6e 7465 7874 2069 7320 6669 a context is fi │ │ │ -00145ef0: 6e61 6c69 7a65 6420 6f72 2066 7265 6564 nalized or freed │ │ │ -00145f00: 2077 6974 6820 3c63 6f64 653e 3c61 2063 with │ │ │ -00145fd0: 736f 6170 5f64 6f6e 6528 7374 7275 6374 soap_done(struct │ │ │ -00145fe0: 2073 6f61 702a 293c 2f61 3e3c 2f63 6f64 soap*) and soa │ │ │ -001460a0: 705f 6672 6565 2873 7472 7563 7420 736f p_free(struct so │ │ │ -001460b0: 6170 2a29 3c2f 613e 3c2f 636f 6465 3e20 ap*) │ │ │ -001460c0: 7468 656e 206d 616e 6167 6564 206d 656d then managed mem │ │ │ -001460d0: 6f72 7920 6973 206e 6f74 2072 656c 6561 ory is not relea │ │ │ -001460e0: 7365 642c 2073 6f20 6974 2069 7320 696d sed, so it is im │ │ │ -001460f0: 706f 7274 616e 7420 746f 2063 616c 6c20 portant to call │ │ │ -00146100: 7468 6520 6465 616c 6c6f 6361 7469 6f6e the deallocation │ │ │ -00146110: 2066 756e 6374 696f 6e73 2066 6972 7374 functions first │ │ │ -00146120: 2e20 5468 6973 2077 6173 2064 6f6e 6520 . This was done │ │ │ -00146130: 746f 2061 6c6c 6f77 206d 616e 6167 6564 to allow managed │ │ │ -00146140: 2064 6174 6120 746f 206f 7574 6c69 7665 data to outlive │ │ │ -00146150: 2074 6865 2063 6f6e 7465 7874 2c20 7375 the context, su │ │ │ -00146160: 6368 2061 7320 6465 7365 7269 616c 697a ch as deserializ │ │ │ -00146170: 6564 206f 626a 6563 7473 2c20 6275 7420 ed objects, but │ │ │ -00146180: 7468 6973 2069 7320 7261 7265 6c79 2069 this is rarely i │ │ │ -00146190: 6620 6576 6572 2075 7365 6420 6265 6361 f ever used beca │ │ │ -001461a0: 7573 6520 6465 6c65 7469 6e67 2074 6865 use deleting the │ │ │ -001461b0: 206f 7574 6c69 7665 6420 6461 7461 2065 outlived data e │ │ │ -001461c0: 7870 6c69 6369 746c 7920 6973 2070 726f xplicitly is pro │ │ │ -001461d0: 6e65 2074 6f20 6d69 7374 616b 6573 2e3c ne to mistakes.< │ │ │ -001461e0: 2f70 3e0a 3c70 3e49 6620 796f 7520 7761 /p>.

If you wa │ │ │ -001461f0: 6e74 2074 6f20 6c65 7420 6465 7365 7269 nt to let deseri │ │ │ -00146200: 616c 697a 6564 2064 6174 6120 6f75 746c alized data outl │ │ │ -00146210: 6976 6520 6120 3c63 6f64 653e 3c61 2063 ive a soap │ │ │ -00146270: 3c2f 636f 6465 3e20 636f 6e74 6578 7420 context │ │ │ -00146280: 7468 6174 2079 6f75 2061 7265 2061 626f that you are abo │ │ │ -00146290: 7574 2074 6f20 6672 6565 2c20 7468 656e ut to free, then │ │ │ -001462a0: 2079 6f75 2063 616e 2064 656c 6567 6174 you can delegat │ │ │ -001462b0: 6520 6d61 6e61 6765 6d65 6e74 206f 6620 e management of │ │ │ -001462c0: 7468 6520 6461 7461 2074 6f20 616e 6f74 the data to anot │ │ │ -001462d0: 6865 7220 3c63 6f64 653e 3c61 2063 6c61 her soap context wi │ │ │ -00146340: 7468 203c 636f 6465 3e3c 6120 636c 6173 th soa │ │ │ -00146410: 705f 6465 6c65 6761 7465 5f64 656c 6574 p_delegate_delet │ │ │ -00146420: 696f 6e28 7374 7275 6374 2073 6f61 7020 ion(struct soap │ │ │ -00146430: 2a73 6f61 705f 6672 6f6d 2c20 7374 7275 *soap_from, stru │ │ │ -00146440: 6374 2073 6f61 7020 2a73 6f61 705f 746f ct soap *soap_to │ │ │ -00146450: 293c 2f61 3e3c 2f63 6f64 653e 2e20 5468 ). Th │ │ │ -00146460: 6973 206d 6f76 6573 2061 6c6c 2064 6573 is moves all des │ │ │ -00146470: 6572 6961 6c69 7a65 6420 616e 6420 7465 erialized and te │ │ │ -00146480: 6d70 6f72 6172 7920 6461 7461 2074 6f20 mporary data to │ │ │ -00146490: 7468 6520 6f74 6865 7220 3c63 6f64 653e the other │ │ │ -001464a0: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap │ │ │ -001464f0: 3c2f 613e 3c2f 636f 6465 3e20 636f 6e74 cont │ │ │ -00146500: 6578 7420 3c63 6f64 653e 736f 6170 5f74 ext soap_t │ │ │ -00146510: 6f3c 2f63 6f64 653e 2c20 7768 6963 6820 o, which │ │ │ -00146520: 7769 6c6c 2064 656c 6574 6520 6974 7320 will delete its │ │ │ -00146530: 6461 7461 2061 6e64 2061 6c6c 2074 6865 data and all the │ │ │ -00146540: 2064 656c 6567 6174 6564 2064 6174 6120 delegated data │ │ │ -00146550: 6974 2069 7320 7265 7370 6f6e 7369 626c it is responsibl │ │ │ -00146560: 6520 666f 7220 7768 656e 2079 6f75 2063 e for when you c │ │ │ -00146570: 616c 6c20 3c63 6f64 653e 3c61 2063 6c61 all soap_de │ │ │ -00146630: 7374 726f 793c 2f61 3e3c 2f63 6f64 653e stroy │ │ │ -00146640: 2061 6e64 203c 636f 6465 3e3c 6120 636c and s │ │ │ -00146710: 6f61 705f 656e 643c 2f61 3e3c 2f63 6f64 oap_end. This can be │ │ │ -00146730: 7061 7274 6963 756c 6172 6c79 2075 7365 particularly use │ │ │ -00146740: 6675 6c20 666f 7220 6d61 6b69 6e67 2063 ful for making c │ │ │ -00146750: 6c69 656e 7420 6361 6c6c 7320 696e 7369 lient calls insi │ │ │ -00146760: 6465 2061 2073 6572 7665 7220 6f70 6572 de a server oper │ │ │ -00146770: 6174 696f 6e2c 2069 2e65 2e20 6120 6d69 ation, i.e. a mi │ │ │ -00146780: 7865 6420 7365 7276 6572 2061 6e64 2063 xed server and c │ │ │ -00146790: 6c69 656e 742e 2054 6865 2063 6c69 656e lient. The clien │ │ │ -001467a0: 7420 6361 6c6c 2069 6e73 6964 6520 7468 t call inside th │ │ │ -001467b0: 6520 7365 7276 6572 206f 7065 7261 7469 e server operati │ │ │ -001467c0: 6f6e 2072 6571 7569 7265 7320 6120 6e65 on requires a ne │ │ │ -001467d0: 7720 3c63 6f64 653e 3c61 2063 6c61 7373 w soap context, e.g │ │ │ -00146840: 2e20 636f 7069 6564 2066 726f 6d20 7468 . copied from th │ │ │ -00146850: 6520 7365 7276 6572 2773 2077 6974 6820 e server's with │ │ │ -00146860: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 soap_copy. Before de │ │ │ -00146930: 7374 726f 7969 6e67 2074 6865 2063 6c69 stroying the cli │ │ │ -00146940: 656e 7420 636f 6e74 6578 7420 7769 7468 ent context with │ │ │ -00146950: 203c 636f 6465 3e3c 6120 636c 6173 733d soap_free │ │ │ -00146a00: 3c2f 613e 3c2f 636f 6465 3e2c 2074 6865 , the │ │ │ -00146a10: 2064 6174 6120 6361 6e20 6265 2064 656c data can be del │ │ │ -00146a20: 6567 6174 6564 2074 6f20 7468 6520 7365 egated to the se │ │ │ -00146a30: 7276 6572 2773 2063 6f6e 7465 7874 2077 rver's context w │ │ │ -00146a40: 6974 6820 3c63 6f64 653e 3c61 2063 6c61 ith so │ │ │ -00146b10: 6170 5f64 656c 6567 6174 655f 6465 6c65 ap_delegate_dele │ │ │ -00146b20: 7469 6f6e 3c2f 613e 3c2f 636f 6465 3e2e tion. │ │ │ -00146b30: 2053 6565 2066 6f72 2065 7861 6d70 6c65 See for example │ │ │ -00146b40: 203c 656d 3e3c 636f 6465 3e67 736f 6170 gsoap │ │ │ -00146b50: 2f73 616d 706c 6573 2f6d 6173 6875 702f /samples/mashup/ │ │ │ -00146b60: 6d61 7368 7570 7365 7276 6572 2e63 3c2f mashupserver.c in th │ │ │ -00146b80: 6520 6753 4f41 5020 736f 7572 6365 2063 e gSOAP source c │ │ │ -00146b90: 6f64 6520 7061 636b 6167 652e 3c2f 703e ode package.

│ │ │ -00146ba0: 0a3c 703e 5468 6520 6675 6e63 7469 6f6e .

The function │ │ │ -00146bb0: 7320 7265 6c61 7465 6420 746f 206d 656d s related to mem │ │ │ -00146bc0: 6f72 7920 6d61 6e61 6765 6d65 6e74 2062 ory management b │ │ │ -00146bd0: 7920 7468 6520 636f 6e74 6578 7420 6172 y the context ar │ │ │ -00146be0: 653a 3c2f 703e 0a3c 756c 3e0a 3c6c 693e e:

..

To help und │ │ │ -00148160: 6572 7374 616e 6420 7468 6520 6469 6666 erstand the diff │ │ │ -00148170: 6572 656e 6365 7320 6265 7477 6565 6e20 erences between │ │ │ -00148180: 6d61 6e61 6765 6420 6f62 6a65 6374 732c managed objects, │ │ │ -00148190: 206d 616e 6167 6564 2064 6174 612c 2061 managed data, a │ │ │ -001481a0: 6e64 206d 616e 6167 6564 2074 656d 706f nd managed tempo │ │ │ -001481b0: 7261 7279 2064 6174 613a 2074 656d 706f rary data: tempo │ │ │ -001481c0: 7261 7279 2064 6174 6120 6973 2063 7265 rary data is cre │ │ │ -001481d0: 6174 6564 2062 7920 7468 6520 656e 6769 ated by the engi │ │ │ -001481e0: 6e65 2074 6f20 6b65 6570 2074 7261 636b ne to keep track │ │ │ -001481f0: 206f 6620 7468 696e 6773 2c20 7375 6368 of things, such │ │ │ -00148200: 2061 7320 6861 7368 2074 6162 6c65 7320 as hash tables │ │ │ -00148210: 746f 206b 6565 7020 706f 696e 7465 7220 to keep pointer │ │ │ -00148220: 7265 6665 7265 6e63 6520 696e 666f 726d reference inform │ │ │ -00148230: 6174 696f 6e20 666f 7220 7365 7269 616c ation for serial │ │ │ -00148240: 697a 6174 696f 6e20 616e 6420 6861 7368 ization and hash │ │ │ -00148250: 2074 6162 6c65 7320 746f 206b 6565 7020 tables to keep │ │ │ -00148260: 584d 4c20 6964 2f68 7265 6620 696e 666f XML id/href info │ │ │ -00148270: 726d 6174 696f 6e20 666f 7220 6d75 6c74 rmation for mult │ │ │ -00148280: 692d 7265 6665 7265 6e63 6520 6f62 6a65 i-reference obje │ │ │ -00148290: 6374 2064 6573 6572 6961 6c69 7a61 7469 ct deserializati │ │ │ -001482a0: 6f6e 2e20 4465 7365 7269 616c 697a 6564 on. Deserialized │ │ │ -001482b0: 2064 6174 6120 6973 2061 6c6c 6f63 6174 data is allocat │ │ │ -001482c0: 6564 2062 7920 7468 6520 636f 6e74 6578 ed by the contex │ │ │ -001482d0: 7420 696e 206d 616e 6167 6564 206d 656d t in managed mem │ │ │ -001482e0: 6f72 7920 7768 656e 2063 6f6e 7374 7275 ory when constru │ │ │ -001482f0: 6374 696e 6720 6461 7461 2073 7472 7563 cting data struc │ │ │ -00148300: 7475 7265 7320 6279 2064 6573 6572 6961 tures by deseria │ │ │ -00148310: 6c69 7a69 6e67 2058 4d4c 2061 6e64 204a lizing XML and J │ │ │ -00148320: 534f 4e20 6d65 7373 6167 6573 2e20 4461 SON messages. Da │ │ │ -00148330: 7461 2069 7320 7374 6f72 6564 2069 6e20 ta is stored in │ │ │ -00148340: 6d65 6d6f 7279 206d 616e 6167 6564 2062 memory managed b │ │ │ -00148350: 7920 7468 6520 636f 6e74 6578 7420 7573 y the context us │ │ │ -00148360: 696e 6720 6361 6c6c 7320 746f 203c 636f ing calls to soap_malloc │ │ │ -00148420: 3c2f 613e 3c2f 636f 6465 3e20 746f 2061 to a │ │ │ -00148430: 6c6c 6f63 6174 6520 6865 6170 2073 7061 llocate heap spa │ │ │ -00148440: 6365 2077 6974 6820 3c63 6f64 653e 6d61 ce with ma │ │ │ -00148450: 6c6c 6f63 3c2f 636f 6465 3e2e 2041 2074 lloc. A t │ │ │ -00148460: 696e 7920 6269 7420 6d6f 7265 2073 7061 iny bit more spa │ │ │ -00148470: 6365 2069 7320 616c 6c6f 6361 7465 6420 ce is allocated │ │ │ -00148480: 746f 206b 6565 7020 7472 6163 6b20 6f66 to keep track of │ │ │ -00148490: 2074 6865 2061 6c6c 6f63 6174 696f 6e73 the allocations │ │ │ -001484a0: 2061 6e64 2074 6f20 6164 6420 6120 2263 and to add a "c │ │ │ -001484b0: 616e 6172 7922 2077 6f72 6420 746f 2064 anary" word to d │ │ │ -001484c0: 6574 6563 7420 6865 6170 206d 656d 6f72 etect heap memor │ │ │ -001484d0: 7920 6f76 6572 666c 6f77 732e 2048 6561 y overflows. Hea │ │ │ -001484e0: 7020 6d65 6d6f 7279 206f 7665 7266 6c6f p memory overflo │ │ │ -001484f0: 7773 2061 7265 2064 6574 6563 7465 6420 ws are detected │ │ │ -00148500: 7768 656e 2063 6f6e 7465 7874 2d6d 616e when context-man │ │ │ -00148510: 6167 6564 2064 6174 6120 6973 2064 6561 aged data is dea │ │ │ -00148520: 6c6c 6f63 6174 6564 2077 6974 6820 3c63 llocated with soap_end │ │ │ -00148600: 3c2f 613e 3c2f 636f 6465 3e2e 2043 2b2b . C++ │ │ │ -00148610: 206f 626a 6563 7473 2061 7265 2061 6c6c objects are all │ │ │ -00148620: 6f63 6174 6564 2077 6974 6820 3c63 6f64 ocated with new ins │ │ │ -00148640: 7465 6164 206f 6620 3c63 6f64 653e 6d61 tead of ma │ │ │ -00148650: 6c6c 6f63 3c2f 636f 6465 3e20 616e 6420 lloc and │ │ │ -00148660: 6172 6520 7472 6163 6b65 6420 6173 2077 are tracked as w │ │ │ -00148670: 656c 6c2e 2054 6865 7365 206f 626a 6563 ell. These objec │ │ │ -00148680: 7473 2061 7265 2064 6561 6c6c 6f63 6174 ts are deallocat │ │ │ -00148690: 6564 2077 6974 6820 3c63 6f64 653e 3c61 ed with soa │ │ │ -00148750: 705f 6465 7374 726f 793c 2f61 3e3c 2f63 p_destroy.

.

Whe │ │ │ -00148770: 6e20 7468 6520 6753 4f41 5020 6170 706c n the gSOAP appl │ │ │ -00148780: 6963 6174 696f 6e20 6973 2063 6f6d 7069 ication is compi │ │ │ -00148790: 6c65 6420 7769 7468 203c 623e 3c63 6f64 led with -DDEBUG │ │ │ -001487b0: 3c2f 623e 2075 7369 6e67 2074 6865 2063 using the c │ │ │ -001487c0: 6f6d 7069 6c65 2d74 696d 6520 666c 6167 ompile-time flag │ │ │ -001487d0: 203c 636f 6465 3e23 4445 4255 473c 2f63 #DEBUG, the engine │ │ │ -001487f0: 2072 6570 6f72 7473 206d 656d 6f72 7920 reports memory │ │ │ -00148800: 6c65 616b 7320 7768 6963 6820 6172 6520 leaks which are │ │ │ -00148810: 6465 7465 6374 6564 2062 7920 3c63 6f64 detected by soap_done< │ │ │ -001488f0: 2f61 3e3c 2f63 6f64 653e 2061 6e64 203c /a> and < │ │ │ -00148900: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soap_free. To im │ │ │ -001489c0: 7072 6f76 6520 7468 6520 6163 6375 7261 prove the accura │ │ │ -001489d0: 6379 206f 6620 6465 7465 6374 696f 6e2c cy of detection, │ │ │ -001489e0: 206e 6f20 6d65 6d6f 7279 2069 7320 6163 no memory is ac │ │ │ -001489f0: 7475 616c 6c79 2066 7265 6564 2075 6e74 tually freed unt │ │ │ -00148a00: 696c 203c 636f 6465 3e3c 6120 636c 6173 il soa │ │ │ -00148ad0: 705f 646f 6e65 3c2f 613e 3c2f 636f 6465 p_done or soap_ │ │ │ -00148b90: 6672 6565 3c2f 613e 3c2f 636f 6465 3e20 free │ │ │ -00148ba0: 6172 6520 6361 6c6c 6564 2074 6f20 6465 are called to de │ │ │ -00148bb0: 7465 6374 206d 656d 6f72 7920 6973 7375 tect memory issu │ │ │ -00148bc0: 6573 2c20 736f 2061 6e79 2063 616c 6c73 es, so any calls │ │ │ -00148bd0: 2074 6f20 3c63 6f64 653e 3c61 2063 6c61 to soap_de │ │ │ -00148c90: 7374 726f 793c 2f61 3e3c 2f63 6f64 653e stroy │ │ │ -00148ca0: 2061 6e64 203c 636f 6465 3e3c 6120 636c and s │ │ │ -00148d70: 6f61 705f 656e 643c 2f61 3e3c 2f63 6f64 oap_end are actually │ │ │ -00148d90: 6465 6665 7272 6564 2074 6f20 6265 2065 deferred to be e │ │ │ -00148da0: 7865 6375 7465 6420 7768 656e 2074 6865 xecuted when the │ │ │ -00148db0: 2063 6f6e 7465 7874 2066 696e 616c 697a context finaliz │ │ │ -00148dc0: 6573 2e3c 2f70 3e0a 3c70 3e57 6869 6c65 es.

.

While │ │ │ -00148dd0: 206d 656d 6f72 7920 6d61 6e61 6765 6d65 memory manageme │ │ │ -00148de0: 6e74 2069 6e20 6753 4f41 5020 6973 2061 nt in gSOAP is a │ │ │ -00148df0: 7574 6f6d 6174 6963 2c20 6974 2064 6f65 utomatic, it doe │ │ │ -00148e00: 7320 6e6f 7420 656e 666f 7263 6520 6974 s not enforce it │ │ │ -00148e10: 7320 6f77 6e20 6d65 6d6f 7279 206d 616e s own memory man │ │ │ -00148e20: 6167 656d 656e 7420 706f 6c69 6379 206f agement policy o │ │ │ -00148e30: 6e20 7468 6520 7573 6572 2e20 546f 206d n the user. To m │ │ │ -00148e40: 6f76 6520 6d61 6e61 6765 6420 6f62 6a65 ove managed obje │ │ │ -00148e50: 6374 7320 616e 6420 6461 7461 2069 6e74 cts and data int │ │ │ -00148e60: 6f20 756e 6d61 6e61 6765 6420 6865 6170 o unmanaged heap │ │ │ -00148e70: 2073 7061 6365 2c20 7468 6520 3c63 6f64 space, the soap_dup_T deep copy fu │ │ │ -00148ea0: 6e63 7469 6f6e 7320 6765 6e65 7261 7465 nctions generate │ │ │ -00148eb0: 6420 6279 203c 623e 3c63 6f64 653e 736f d by so │ │ │ -00148ec0: 6170 6370 7032 202d 4563 3c2f 636f 6465 apcpp2 -Ec option │ │ │ -00148ee0: 3c63 6f64 653e 2d45 633c 2f63 6f64 653e -Ec │ │ │ -00148ef0: 3c2f 623e 2063 616e 2062 6520 7573 6564 can be used │ │ │ -00148f00: 2e20 546f 2064 656c 6574 6520 6465 6570 . To delete deep │ │ │ -00148f10: 2063 6f70 6965 732c 2074 6865 203c 636f copies, the soap_del_T deep deleti │ │ │ -00148f40: 6f6e 2066 756e 6374 696f 6e73 2067 656e on functions gen │ │ │ -00148f50: 6572 6174 6564 2062 7920 3c62 3e3c 636f erated by soapcpp2 -Ed< │ │ │ -00148f70: 2f63 6f64 653e 3c2f 623e 206f 7074 696f /code> optio │ │ │ -00148f80: 6e20 3c62 3e3c 636f 6465 3e2d 4564 3c2f n -Ed can be │ │ │ -00148fa0: 2075 7365 642e 2041 6674 6572 2063 6f70 used. After cop │ │ │ -00148fb0: 7969 6e67 2074 6865 2075 7375 616c 203c ying the usual < │ │ │ -00148fc0: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soap_destroy │ │ │ -00149080: 3c2f 613e 3c2f 636f 6465 3e20 616e 6420 and │ │ │ -00149090: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 soap_e │ │ │ -00149160: 6e64 3c2f 613e 3c2f 636f 6465 3e20 6675 nd fu │ │ │ -00149170: 6e63 7469 6f6e 7320 7265 6d6f 7665 2074 nctions remove t │ │ │ -00149180: 6865 206d 616e 6167 6564 206f 7269 6769 he managed origi │ │ │ -00149190: 6e61 6c73 2e20 5365 6520 616c 736f 2053 nals. See also S │ │ │ -001491a0: 6563 7469 6f6e 203c 6120 636c 6173 733d ection Gene │ │ │ -001491d0: 7261 7469 6e67 2064 6565 7020 636f 7079 rating deep copy │ │ │ -001491e0: 2061 6e64 2064 656c 6574 696f 6e20 6675 and deletion fu │ │ │ -001491f0: 6e63 7469 6f6e 733c 2f61 3e2e 3c2f 703e nctions.

│ │ │ -00149200: 0a3c 703e 4675 7274 6865 726d 6f72 652c .

Furthermore, │ │ │ -00149210: 2074 6865 206d 656d 6f72 7920 616c 6c6f the memory allo │ │ │ -00149220: 6361 7469 6f6e 2066 756e 6374 696f 6e73 cation functions │ │ │ -00149230: 203c 636f 6465 3e6d 616c 6c6f 633c 2f63 malloc and n │ │ │ -00149250: 6577 3c2f 636f 6465 3e20 7573 6564 2062 ew used b │ │ │ -00149260: 7920 7468 6520 656e 6769 6e65 2069 6e74 y the engine int │ │ │ -00149270: 6572 6e61 6c6c 7920 6361 6e20 6265 2072 ernally can be r │ │ │ -00149280: 6570 6c61 6365 6420 7769 7468 206f 7468 eplaced with oth │ │ │ -00149290: 6572 2061 6c6c 6f63 6174 6f72 7320 6279 er allocators by │ │ │ -001492a0: 2064 6566 696e 696e 6720 3c63 6f64 653e defining │ │ │ -001492b0: 534f 4150 5f4d 414c 4c4f 433c 2f63 6f64 SOAP_MALLOC and SOA │ │ │ -001492d0: 505f 4652 4545 3c2f 636f 6465 3e20 746f P_FREE to │ │ │ -001492e0: 2072 6570 6c61 6365 203c 636f 6465 3e6d replace m │ │ │ -001492f0: 616c 6c6f 633c 2f63 6f64 653e 2061 6e64 alloc and │ │ │ -00149300: 203c 636f 6465 3e66 7265 653c 2f63 6f64 free, and define < │ │ │ -00149320: 636f 6465 3e53 4f41 505f 4e45 573c 2f63 code>SOAP_NEW, SOAP │ │ │ -00149340: 5f4e 4557 5f41 5252 4159 3c2f 636f 6465 _NEW_ARRAY, SOAP_PL │ │ │ -00149360: 4143 454d 454e 545f 4e45 573c 2f63 6f64 ACEMENT_NEW, and SO │ │ │ -00149380: 4150 5f44 454c 4554 453c 2f63 6f64 653e AP_DELETE │ │ │ -00149390: 2c20 3c63 6f64 653e 534f 4150 5f44 454c , SOAP_DEL │ │ │ -001493a0: 4554 455f 4152 5241 593c 2f63 6f64 653e ETE_ARRAY │ │ │ -001493b0: 2074 6f20 7265 706c 6163 6520 3c63 6f64 to replace new and │ │ │ -001493d0: 203c 636f 6465 3e64 656c 6574 653c 2f63 delete used by the │ │ │ -001493f0: 2065 6e67 696e 6520 746f 2061 6c6c 6f63 engine to alloc │ │ │ -00149400: 6174 6520 6d61 6e61 6765 6420 6d65 6d6f ate managed memo │ │ │ -00149410: 7279 2e20 4f6e 6520 6361 6e20 666f 7220 ry. One can for │ │ │ -00149420: 6578 616d 706c 6520 7573 6520 6120 6761 example use a ga │ │ │ -00149430: 7262 6167 6520 636f 6c6c 6563 746f 7220 rbage collector │ │ │ -00149440: 7769 7468 2067 534f 4150 2062 7920 6465 with gSOAP by de │ │ │ -00149450: 6669 6e69 6e67 2073 7569 7461 626c 6520 fining suitable │ │ │ -00149460: 7265 706c 6163 656d 656e 7473 2e3c 2f70 replacements.

.

More inform │ │ │ -00149480: 6174 696f 6e20 6f6e 206d 656d 6f72 7920 ation on memory │ │ │ -00149490: 6d61 6e61 6765 6d65 6e74 2063 616e 2062 management can b │ │ │ -001494a0: 6520 666f 756e 6420 696e 2074 6865 203c e found in the < │ │ │ -001494b0: 6120 6872 6566 3d22 2e2e 2f2e 2e2f 6461 a href="../../da │ │ │ -001494c0: 7461 6269 6e64 696e 672f 6874 6d6c 2f69 tabinding/html/i │ │ │ -001494d0: 6e64 6578 2e68 746d 6c22 3e43 2061 6e64 ndex.html">C and │ │ │ -001494e0: 2043 2b2b 2058 4d4c 2044 6174 6120 4269 C++ XML Data Bi │ │ │ -001494f0: 6e64 696e 6773 3c2f 613e 2064 6f63 756d ndings docum │ │ │ -00149500: 656e 7461 7469 6f6e 2074 6861 7420 6861 entation that ha │ │ │ -00149510: 7320 7365 7061 7261 7465 2073 6563 7469 s separate secti │ │ │ -00149520: 6f6e 7320 6f6e 206d 656d 6f72 7920 6d61 ons on memory ma │ │ │ -00149530: 6e61 6765 6d65 6e74 2069 6e20 4320 616e nagement in C an │ │ │ -00149540: 6420 696e 2043 2b2b 2e3c 2f70 3e0a 3c70 d in C++.

.

.... Back to table │ │ │ -00149570: 6f66 2063 6f6e 7465 6e74 733c 2f61 3e3c of contents< │ │ │ -00149580: 2f70 3e0a 3c68 313e 3c61 2063 6c61 7373 /p>.

. │ │ │ -001495b0: 496e 7472 612d 636c 6173 7320 6d65 6d6f Intra-class memo │ │ │ -001495c0: 7279 206d 616e 6167 656d 656e 743c 2f68 ry management.

When a cla │ │ │ -001495e0: 7373 203c 636f 6465 3e54 3c2f 636f 6465 ss T has a st │ │ │ -00149600: 7275 6374 2073 6f61 7020 2a20 543a 3a73 ruct soap * T::s │ │ │ -00149610: 6f61 703c 2f63 6f64 653e 206d 656d 6265 oap membe │ │ │ -00149620: 7220 6465 636c 6172 6564 2069 6e20 616e r declared in an │ │ │ -00149630: 2069 6e74 6572 6661 6365 2068 6561 6465 interface heade │ │ │ -00149640: 7220 6669 6c65 2066 6f72 2073 6f61 7063 r file for soapc │ │ │ -00149650: 7070 322c 2074 6865 6e20 7468 6973 206d pp2, then this m │ │ │ -00149660: 656d 6265 7220 7769 6c6c 2062 6520 7365 ember will be se │ │ │ -00149670: 7420 746f 2070 6f69 6e74 2074 6f20 7468 t to point to th │ │ │ -00149680: 6520 6375 7272 656e 7420 636f 6e74 6578 e current contex │ │ │ -00149690: 7420 6279 2074 6865 2064 6573 6572 6961 t by the deseria │ │ │ -001496a0: 6c69 7a65 7273 2061 6e64 2062 7920 7468 lizers and by th │ │ │ -001496b0: 6520 3c63 6f64 653e 736f 6170 5f64 6566 e soap_def │ │ │ -001496c0: 6175 6c74 3c2f 636f 6465 3e20 6d65 7468 ault meth │ │ │ -001496d0: 6f64 206f 6620 7468 6520 636c 6173 7320 od of the class │ │ │ -001496e0: 616e 6420 6279 2074 6865 203c 636f 6465 and by the soap_default_T< │ │ │ -00149700: 2f63 6f64 653e 2061 6e64 203c 636f 6465 /code> and soap_new_T functions for │ │ │ -00149730: 2074 6869 7320 636c 6173 7320 6e61 6d65 this class name │ │ │ -00149740: 6420 3c63 6f64 653e 543c 2f63 6f64 653e d T │ │ │ -00149750: 2e20 5468 6973 2073 696d 706c 6966 6965 . This simplifie │ │ │ -00149760: 7320 6d65 6d6f 7279 206d 616e 6167 656d s memory managem │ │ │ -00149770: 656e 7420 6279 2063 6c61 7373 206d 6574 ent by class met │ │ │ -00149780: 686f 6473 2074 6861 7420 616c 6c6f 6361 hods that alloca │ │ │ -00149790: 7465 2064 6174 6120 6173 736f 6369 6174 te data associat │ │ │ -001497a0: 6564 2077 6974 6820 7468 6520 636c 6173 ed with the clas │ │ │ -001497b0: 7320 696e 7374 616e 6365 2074 6861 7420 s instance that │ │ │ -001497c0: 6d75 7374 2062 6520 6d61 6e61 6765 6420 must be managed │ │ │ -001497d0: 6279 2074 6865 2063 6f6e 7465 7874 2e3c by the context.< │ │ │ -001497e0: 2f70 3e0a 3c70 3e43 6f6e 7369 6465 7220 /p>.

Consider │ │ │ -001497f0: 666f 7220 6578 616d 706c 6520 7468 6520 for example the │ │ │ -00149800: 666f 6c6c 6f77 696e 6720 636c 6173 7320 following class │ │ │ -00149810: 6465 636c 6172 6174 696f 6e3a 3c2f 703e declaration:

│ │ │ -00149820: 0a3c 6469 7620 636c 6173 733d 2266 7261 .
c │ │ │ -00149860: 6c61 7373 203c 2f73 7061 6e3e 436c 6173 lass Clas │ │ │ -00149870: 7320 3c2f 6469 763e 0a3c 6469 7620 636c s
.
{ public │ │ │ -001498b0: 3a3c 2f64 6976 3e0a 3c64 6976 2063 6c61 :
.
Cl │ │ │ -001498d0: 6173 7328 293b 3c2f 6469 763e 0a3c 6469 ass();
. │ │ │ -001498f0: 2020 207e 436c 6173 7328 293b 3c2f 6469 ~Class();.
s │ │ │ -00149930: 7472 7563 7420 3c2f 7370 616e 3e3c 6120 truct soap *soap; │ │ │ -001499c0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
char *name;
│ │ │ -00149a10: 0a3c 6469 7620 636c 6173 733d 226c 696e .
void set │ │ │ -00149a50: 4e61 6d65 283c 7370 616e 2063 6c61 7373 Name(const │ │ │ -00149a70: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c char *s │ │ │ -00149aa0: 293b 203c 2f64 6976 3e0a 3c64 6976 2063 );
.
│ │ │ -00149ac0: 3c73 7061 6e20 636c 6173 733d 226b 6579 char *getName() │ │ │ -00149af0: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
.
};.

Sin │ │ │ -00149b30: 6365 2074 6865 203c 636f 6465 3e6e 616d ce the nam │ │ │ -00149b40: 653c 2f63 6f64 653e 206d 656d 6265 7220 e member │ │ │ -00149b50: 6973 2061 2063 6861 7261 6374 6572 2070 is a character p │ │ │ -00149b60: 6f69 6e74 6572 2074 6f20 6120 7374 7269 ointer to a stri │ │ │ -00149b70: 6e67 2c20 7768 6572 6520 7368 6f75 6c64 ng, where should │ │ │ -00149b80: 2077 6520 616c 6c6f 6361 7465 2074 6869 we allocate thi │ │ │ -00149b90: 7320 7374 7269 6e67 3f20 496e 206d 6f73 s string? In mos │ │ │ -00149ba0: 7420 6361 7365 7320 7765 2077 696c 6c20 t cases we will │ │ │ -00149bb0: 6164 6420 6120 636f 6e73 7472 7563 746f add a constructo │ │ │ -00149bc0: 7220 7468 6174 2069 6e69 7469 616c 6c79 r that initially │ │ │ -00149bd0: 2073 6574 7320 3c63 6f64 653e 6e61 6d65 sets name │ │ │ -00149be0: 3c2f 636f 6465 3e20 746f 204e 554c 4c20 to NULL │ │ │ -00149bf0: 616e 6420 6120 6465 7374 7275 6374 6f72 and a destructor │ │ │ -00149c00: 2074 6861 7420 6465 6c65 7465 7320 3c63 that deletes name │ │ │ -00149c20: 7768 656e 206e 6f6e 2d4e 554c 4c2c 206c when non-NULL, l │ │ │ -00149c30: 696b 6520 736f 3a3c 2f70 3e0a 3c64 6976 ike so:

.
Class::Class │ │ │ -00149c70: 2829 203c 2f64 6976 3e0a 3c64 6976 2063 ()
.
{.
s │ │ │ -00149cd0: 6f61 703c 2f61 3e20 3d20 4e55 4c4c 3b3c oap = NULL;< │ │ │ -00149ce0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
name = │ │ │ -00149d00: 204e 554c 4c3b 3c2f 6469 763e 0a3c 6469 NULL;
.} │ │ │ -00149d20: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
Class: │ │ │ -00149d40: 3a7e 436c 6173 7328 2920 3c2f 6469 763e :~Class()
│ │ │ -00149d50: 0a3c 6469 7620 636c 6173 733d 226c 696e .
{
.
< │ │ │ -00149d80: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -00149d90: 6f72 6466 6c6f 7722 3e69 663c 2f73 7061 ordflow">if (name)
. │ │ │ -00149db0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
free(name) │ │ │ -00149dd0: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
.
}
.

Howe │ │ │ -00149e10: 7665 722c 2077 6865 6e20 696e 7374 616e ver, when instan │ │ │ -00149e20: 6365 7320 6f66 203c 636f 6465 3e43 6c61 ces of Cla │ │ │ -00149e30: 7373 3c2f 636f 6465 3e20 6172 6520 6465 ss are de │ │ │ -00149e40: 7365 7269 616c 697a 6564 2077 6520 6861 serialized we ha │ │ │ -00149e50: 7665 2061 2070 726f 626c 656d 2077 6974 ve a problem wit │ │ │ -00149e60: 6820 7468 6973 2061 7070 726f 6163 6820 h this approach │ │ │ -00149e70: 6265 6361 7573 6520 3c63 6f64 653e 6672 because fr │ │ │ -00149e80: 6565 286e 616d 6529 3c2f 636f 6465 3e20 ee(name) │ │ │ -00149e90: 6465 6c65 7465 7320 6120 6d61 6e61 6765 deletes a manage │ │ │ -00149ea0: 6420 7374 7269 6e67 2c20 7768 6963 6820 d string, which │ │ │ -00149eb0: 6973 206d 616e 6167 6564 2062 7920 7468 is managed by th │ │ │ -00149ec0: 6520 636f 6e74 6578 742e 2042 6563 6175 e context. Becau │ │ │ -00149ed0: 7365 2074 6865 2064 6573 6572 6961 6c69 se the deseriali │ │ │ -00149ee0: 7a65 7220 616c 736f 2073 6574 7320 7468 zer also sets th │ │ │ -00149ef0: 6520 3c63 6f64 653e 736f 6170 3c2f 636f e soap member of th │ │ │ -00149f10: 6973 2063 6c61 7373 2c20 7468 6572 6520 is class, there │ │ │ -00149f20: 6973 2061 6e20 6561 7379 2073 6f6c 7574 is an easy solut │ │ │ -00149f30: 696f 6e20 746f 2074 6869 7320 7072 6f62 ion to this prob │ │ │ -00149f40: 6c65 6d3a 3c2f 703e 0a3c 6469 7620 636c lem:

.
< │ │ │ -00149f60: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -00149f70: 3e43 6c61 7373 3a3a 7e43 6c61 7373 2829 >Class::~Class() │ │ │ -00149f80: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
{
.
│ │ │ -00149fd0: 6966 3c2f 7370 616e 3e20 2821 3c61 2063 if (!soap & │ │ │ -0014a010: 3b26 616d 703b 206e 616d 6529 3c2f 6469 ;& name).
free(na │ │ │ -0014a040: 6d65 293b 3c2f 6469 763e 0a3c 6469 7620 me);
.
}.

T │ │ │ -0014a080: 6869 7320 6f6e 6c79 2066 7265 6573 203c his only frees < │ │ │ -0014a090: 636f 6465 3e6e 616d 653c 2f63 6f64 653e code>name │ │ │ -0014a0a0: 2069 6620 7468 6520 3c63 6f64 653e 736f if the so │ │ │ -0014a0b0: 6170 3c2f 636f 6465 3e20 636f 6e74 6578 ap contex │ │ │ -0014a0c0: 7420 706f 696e 7465 7220 6d65 6d62 6572 t pointer member │ │ │ -0014a0d0: 2069 7320 4e55 4c4c 2c20 6d65 616e 696e is NULL, meanin │ │ │ -0014a0e0: 6720 7468 6174 2061 206d 616e 6167 6564 g that a managed │ │ │ -0014a0f0: 2073 7472 696e 6720 3c63 6f64 653e 6e61 string na │ │ │ -0014a100: 6d65 3c2f 636f 6465 3e20 7769 6c6c 2062 me will b │ │ │ -0014a110: 6520 6465 6c65 7465 6420 6173 2075 7375 e deleted as usu │ │ │ -0014a120: 616c 2077 6974 6820 7468 6520 6465 7365 al with the dese │ │ │ -0014a130: 7269 616c 697a 6564 2063 6c61 7373 2075 rialized class u │ │ │ -0014a140: 7369 6e67 203c 636f 6465 3e3c 6120 636c sing soap_d │ │ │ -0014a200: 6573 7472 6f79 3c2f 613e 3c2f 636f 6465 estroy and │ │ │ -0014a2e0: 736f 6170 5f65 6e64 3c2f 613e 3c2f 636f soap_end.

.

The │ │ │ -0014a300: 6f74 6865 7220 6d65 7468 6f64 7320 6172 other methods ar │ │ │ -0014a310: 6520 616c 736f 206d 6164 6520 636f 676e e also made cogn │ │ │ -0014a320: 697a 616e 7420 6f66 2074 6865 2070 7265 izant of the pre │ │ │ -0014a330: 7365 6e63 6520 6f66 2061 2063 6f6e 7465 sence of a conte │ │ │ -0014a340: 7874 3a3c 2f70 3e0a 3c64 6976 2063 6c61 xt:

.
│ │ │ -0014a370: 3c73 7061 6e20 636c 6173 733d 226b 6579 void Class::set │ │ │ -0014a3a0: 4e61 6d65 283c 7370 616e 2063 6c61 7373 Name(const │ │ │ -0014a3c0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c char *s │ │ │ -0014a3f0: 293c 2f64 6976 3e0a 3c64 6976 2063 6c61 )
.
{
.
│ │ │ -0014a440: 6966 3c2f 7370 616e 3e20 283c 6120 636c if (soap)
.
name = < │ │ │ -0014a4a0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -0014a4b0: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ -0014a4c0: 705f 5f63 6f6e 7465 7874 2e68 746d 6c23 p__context.html# │ │ │ -0014a4d0: 6761 3431 3734 3765 6631 3435 3636 3762 ga41747ef145667b │ │ │ -0014a4e0: 6466 6639 6336 3663 6464 3262 6338 3636 dff9c66cdd2bc866 │ │ │ -0014a4f0: 3533 223e 736f 6170 5f73 7472 6475 703c 53">soap_strdup< │ │ │ -0014a500: 2f61 3e28 3c61 2063 6c61 7373 3d22 636f /a>(soap< │ │ │ -0014a530: 2f61 3e2c 2073 293b 3c2f 6469 763e 0a3c /a>, s);
.< │ │ │ -0014a540: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -0014a550: 3e20 203c 7370 616e 2063 6c61 7373 3d22 > els │ │ │ -0014a570: 653c 2f73 7061 6e3e 3c2f 6469 763e 0a3c e
.< │ │ │ -0014a580: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -0014a590: 3e20 2020 206e 616d 6520 3d20 7374 7264 > name = strd │ │ │ -0014a5a0: 7570 2873 293b 3c2f 6469 763e 0a3c 6469 up(s);
.} │ │ │ -0014a5c0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
c │ │ │ -0014a5f0: 6f6e 7374 3c2f 7370 616e 3e20 3c73 7061 onst char *getName().
{
. │ │ │ -0014a660: 203c 7370 616e 2063 6c61 7373 3d22 6b65 retur │ │ │ -0014a680: 6e3c 2f73 7061 6e3e 206e 616d 653b 3c2f n name;.
}
.< │ │ │ -0014a6b0: 2f64 6976 3e3c 212d 2d20 6672 6167 6d65 /div>

Another │ │ │ -0014a6d0: 2061 7070 726f 6163 6820 6973 2074 6f20 approach is to │ │ │ -0014a6e0: 7573 6520 3c63 6f64 653e 3c61 2063 6c61 use so │ │ │ -0014a7b0: 6170 5f75 6e6c 696e 6b3c 2f61 3e3c 2f63 ap_unlink to unlink d │ │ │ -0014a7d0: 6174 6120 6d61 6e61 6765 6420 6279 2074 ata managed by t │ │ │ -0014a7e0: 6865 2063 6f6e 7465 7874 2061 6e64 206d he context and m │ │ │ -0014a7f0: 616b 6520 616c 6c20 616c 6c6f 6361 7469 ake all allocati │ │ │ -0014a800: 6f6e 7320 6578 706c 6963 6974 6c79 3a3c ons explicitly:< │ │ │ -0014a810: 2f70 3e0a 3c64 6976 2063 6c61 7373 3d22 /p>.

Clas │ │ │ -0014a840: 733a 3a7e 436c 6173 7328 2920 3c2f 6469 s::~Class() .
{
. │ │ │ -0014a880: 203c 7370 616e 2063 6c61 7373 3d22 6b65 if
(name)
.
{
. │ │ │ -0014a8e0: 2020 2020 3c61 2063 6c61 7373 3d22 636f soap_un │ │ │ -0014a940: 6c69 6e6b 3c2f 613e 283c 6120 636c 6173 link( │ │ │ -0014a970: 736f 6170 3c2f 613e 2c20 6e61 6d65 293b soap, name); │ │ │ -0014a980: 203c 7370 616e 2063 6c61 7373 3d22 636f // unlink │ │ │ -0014a9a0: 7320 7468 6520 6e61 6d65 2069 6620 736f s the name if so │ │ │ -0014a9b0: 6170 2069 7320 6e6f 6e2d 4e55 4c4c 3c2f ap is non-NULL
.
│ │ │ -0014a9e0: 2020 6672 6565 286e 616d 6529 3b3c 2f64 free(name);.
}
. │ │ │ -0014aa10: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
}
.
void Class::setName │ │ │ -0014aa70: 283c 7370 616e 2063 6c61 7373 3d22 6b65 (const ch │ │ │ -0014aab0: 6172 3c2f 7370 616e 3e20 2a73 293c 2f64 ar *s).
{
. │ │ │ -0014aaf0: 2020 6e61 6d65 203d 2073 7472 6475 7028 name = strdup( │ │ │ -0014ab00: 7329 3b3c 2f64 6976 3e0a 3c64 6976 2063 s);
.
}.
cons │ │ │ -0014ab50: 743c 2f73 7061 6e3e 203c 7370 616e 2063 t char * │ │ │ -0014ab80: 6765 744e 616d 6528 293c 2f64 6976 3e0a getName()
. │ │ │ -0014ab90: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
{
.
return name;
.
}
.
soa │ │ │ -0014acc0: 705f 756e 6c69 6e6b 3c2f 613e 3c2f 6469 p_unlink
int soap_u │ │ │ -0014acf0: 6e6c 696e 6b28 7374 7275 6374 2073 6f61 nlink(struct soa │ │ │ -0014ad00: 7020 2a73 6f61 702c 2063 6f6e 7374 2076 p *soap, const v │ │ │ -0014ad10: 6f69 6420 2a70 7472 293c 2f64 6976 3e3c oid *ptr)
< │ │ │ -0014ad20: 6469 7620 636c 6173 733d 2274 7464 6f63 div class="ttdoc │ │ │ -0014ad30: 223e 556e 6c69 6e6b 2061 2062 6c6f 636b ">Unlink a block │ │ │ -0014ad40: 206f 6620 6865 6170 206d 656d 6f72 7920 of heap memory │ │ │ -0014ad50: 6d61 6e61 6765 6420 6279 2074 6865 2073 managed by the s │ │ │ -0014ad60: 7065 6369 6669 6564 2073 6f61 7020 636f pecified soap co │ │ │ -0014ad70: 6e74 6578 742c 2074 6f20 7265 6c65 6173 ntext, to releas │ │ │ -0014ad80: 6520 7468 6520 6d65 6d6f 7279 2065 7870 e the memory exp │ │ │ -0014ad90: 6c69 6369 746c 792e 2e2e 3c2f 6469 763e licitly...
│ │ │ -0014ada0: 3c2f 6469 763e 0a3c 2f64 6976 3e3c 212d
.

The s │ │ │ -0014ae90: 6f61 705f 756e 6c69 6e6b 3c2f 613e 3c2f oap_unlink call unlin │ │ │ -0014aeb0: 6b73 2064 6174 6120 616e 6420 6f62 6a65 ks data and obje │ │ │ -0014aec0: 6374 7320 6672 6f6d 206d 616e 6167 6564 cts from managed │ │ │ -0014aed0: 206d 656d 6f72 792e 2049 6e20 7468 6973 memory. In this │ │ │ -0014aee0: 2077 6179 203c 636f 6465 3e3c 6120 636c way soap_d │ │ │ -0014afa0: 6573 7472 6f79 3c2f 613e 3c2f 636f 6465 estroy and │ │ │ -0014b080: 736f 6170 5f65 6e64 3c2f 613e 3c2f 636f soap_end can be calle │ │ │ -0014b0a0: 6420 6c61 7465 7220 6576 656e 2077 6865 d later even whe │ │ │ -0014b0b0: 6e20 7468 6973 2063 6c61 7373 2077 6173 n this class was │ │ │ -0014b0c0: 2064 6573 6572 6961 6c69 7a65 642e 3c2f deserialized..

.... Back to t │ │ │ -0014b0f0: 6162 6c65 206f 6620 636f 6e74 656e 7473 able of contents │ │ │ -0014b100: 3c2f 613e 3c2f 703e 0a3c 6831 3e3c 6120

.

.Debugging

.

To activate │ │ │ -0014b150: 2064 6562 7567 6769 6e67 2061 6e64 206d debugging and m │ │ │ -0014b160: 6573 7361 6765 206c 6f67 6769 6e67 2063 essage logging c │ │ │ -0014b170: 6f6d 7069 6c65 2074 6865 2073 6f75 7263 ompile the sourc │ │ │ -0014b180: 6520 636f 6465 2077 6974 6820 636f 6d70 e code with comp │ │ │ -0014b190: 696c 652d 7469 6d65 2066 6c61 6720 3c63 ile-time flag #DEBUG. Or when using │ │ │ -0014b1c0: 203c 623e 3c63 6f64 653e 2d6c 6773 6f61 -lgsoa │ │ │ -0014b1d0: 703c 2f63 6f64 653e 3c2f 623e 206f 7220 p or │ │ │ -0014b1e0: 3c62 3e3c 636f 6465 3e2d 6c67 736f 6170 -lgsoap │ │ │ -0014b1f0: 2b2b 3c2f 636f 6465 3e3c 2f62 3e20 7468 ++ th │ │ │ -0014b200: 656e 2072 6569 6e73 7461 6c6c 2067 534f en reinstall gSO │ │ │ -0014b210: 4150 2077 6974 6820 3c62 3e3c 636f 6465 AP with ./configure --e │ │ │ -0014b230: 6e61 626c 652d 6465 6275 673c 2f63 6f64 nable-debug and make< │ │ │ -0014b260: 2f62 3e2e 3c2f 703e 0a3c 703e 5768 656e /b>.

.

When │ │ │ -0014b270: 2079 6f75 7220 6753 4f41 5020 636c 6965 your gSOAP clie │ │ │ -0014b280: 6e74 206f 7220 7365 7276 6572 2061 7070 nt or server app │ │ │ -0014b290: 6c69 6361 7469 6f6e 7320 7275 6e2c 2074 lications run, t │ │ │ -0014b2a0: 6865 7920 7769 6c6c 206c 6f67 2074 6865 hey will log the │ │ │ -0014b2b0: 6972 2061 6374 6976 6974 7920 696e 2074 ir activity in t │ │ │ -0014b2c0: 6872 6565 2073 6570 6172 6174 6520 6669 hree separate fi │ │ │ -0014b2d0: 6c65 733a 3c2f 703e 0a3c 756c 3e0a 3c6c les:

.
    .SENT │ │ │ -0014b2f0: 2e6c 6f67 3c2f 636f 6465 3e3c 2f65 6d3e .log │ │ │ -0014b300: 2061 2063 6f6e 6361 7465 6e61 7469 6f6e a concatenation │ │ │ -0014b310: 206f 6620 616c 6c20 6d65 7373 6167 6573 of all messages │ │ │ -0014b320: 2073 656e 743c 2f6c 693e 0a3c 6c69 3e3c sent.
  • < │ │ │ -0014b330: 656d 3e3c 636f 6465 3e52 4543 562e 6c6f em>RECV.lo │ │ │ -0014b340: 673c 2f63 6f64 653e 3c2f 656d 3e20 6120 g a │ │ │ -0014b350: 636f 6e63 6174 656e 6174 696f 6e20 6f66 concatenation of │ │ │ -0014b360: 2061 6c6c 206d 6573 7361 6765 7320 7265 all messages re │ │ │ -0014b370: 6365 6976 6564 3c2f 6c69 3e0a 3c6c 693e ceived
  • .
  • │ │ │ -0014b380: 3c65 6d3e 3c63 6f64 653e 5445 5354 2e6c TEST.l │ │ │ -0014b390: 6f67 3c2f 636f 6465 3e3c 2f65 6d3e 2061 og a │ │ │ -0014b3a0: 206c 6f67 206f 6620 7468 6520 656e 6769 log of the engi │ │ │ -0014b3b0: 6e65 2773 206f 7065 7261 7469 6f6e 733c ne's operations< │ │ │ -0014b3c0: 2f6c 693e 0a3c 2f75 6c3e 0a3c 646c 2063 /li>.
.
Warni │ │ │ -0014b3f0: 6e67 3c2f 6474 3e3c 6464 3e54 6865 2067 ng
The g │ │ │ -0014b400: 534f 4150 2063 6c69 656e 7420 616e 6420 SOAP client and │ │ │ -0014b410: 7365 7276 6572 2061 7070 6c69 6361 7469 server applicati │ │ │ -0014b420: 6f6e 7320 7769 6c6c 2072 756e 2073 6c6f ons will run slo │ │ │ -0014b430: 7720 6475 6520 746f 2064 6562 7567 6769 w due to debuggi │ │ │ -0014b440: 6e67 2061 6e64 206d 6573 7361 6765 206c ng and message l │ │ │ -0014b450: 6f67 6769 6e67 2e3c 2f64 643e 3c2f 646c ogging.
.

You can set │ │ │ -0014b470: 206d 6163 726f 203c 636f 6465 3e23 4445 macro #DE │ │ │ -0014b480: 4255 475f 5354 414d 503c 2f63 6f64 653e BUG_STAMP │ │ │ -0014b490: 2069 6e73 7465 6164 206f 6620 3c63 6f64 instead of #DEBUG │ │ │ -0014b4b0: 746f 2061 6464 2074 696d 6520 7374 616d to add time stam │ │ │ -0014b4c0: 7073 2074 6f20 3c63 6f64 653e 5445 5354 ps to TEST │ │ │ -0014b4d0: 2e6c 6f67 3c2f 636f 6465 3e2e 2054 6869 .log. Thi │ │ │ -0014b4e0: 7320 776f 726b 7320 6f6e 2061 6c6c 206f s works on all o │ │ │ -0014b4f0: 7065 7261 7469 6e67 2073 7973 7465 6d73 perating systems │ │ │ -0014b500: 2073 7570 706f 7274 696e 6720 7468 6520 supporting the │ │ │ -0014b510: 3c63 6f64 653e 6765 7474 696d 656f 6664 gettimeofd │ │ │ -0014b520: 6179 3c2f 636f 6465 3e20 6675 6e63 7469 ay functi │ │ │ -0014b530: 6f6e 2e3c 2f70 3e0a 3c70 3e57 6865 6e20 on.

.

When │ │ │ -0014b540: 696e 7374 616c 6c69 6e67 2061 2043 4749 installing a CGI │ │ │ -0014b550: 2073 6572 7669 6365 2061 7070 6c69 6361 service applica │ │ │ -0014b560: 7469 6f6e 2063 6f6d 7069 6c65 6420 7769 tion compiled wi │ │ │ -0014b570: 7468 2064 6562 7567 6769 6e67 2065 6e61 th debugging ena │ │ │ -0014b580: 626c 6564 2c20 7468 6520 6c6f 6720 6669 bled, the log fi │ │ │ -0014b590: 6c65 7320 6d61 7920 736f 6d65 7469 6d65 les may sometime │ │ │ -0014b5a0: 7320 6e6f 7420 6265 2063 7265 6174 6564 s not be created │ │ │ -0014b5b0: 2064 7565 2074 6f20 6669 6c65 2061 6363 due to file acc │ │ │ -0014b5c0: 6573 7320 7065 726d 6973 7369 6f6e 2072 ess permission r │ │ │ -0014b5d0: 6573 7472 6963 7469 6f6e 7320 696d 706f estrictions impo │ │ │ -0014b5e0: 7365 6420 6f6e 2043 4749 2061 7070 6c69 sed on CGI appli │ │ │ -0014b5f0: 6361 7469 6f6e 732e 2054 6f20 6765 7420 cations. To get │ │ │ -0014b600: 6172 6f75 6e64 2074 6869 732c 2063 7265 around this, cre │ │ │ -0014b610: 6174 6520 656d 7074 7920 6c6f 6720 6669 ate empty log fi │ │ │ -0014b620: 6c65 7320 7769 7468 2075 6e69 7665 7273 les with univers │ │ │ -0014b630: 616c 2077 7269 7465 2070 6572 6d69 7373 al write permiss │ │ │ -0014b640: 696f 6e73 2e20 4265 2063 6172 6566 756c ions. Be careful │ │ │ -0014b650: 2061 626f 7574 2074 6865 2073 6563 7572 about the secur │ │ │ -0014b660: 6974 7920 696d 706c 6963 6174 696f 6e20 ity implication │ │ │ -0014b670: 6f66 2074 6869 732e 3c2f 703e 0a3c 703e of this.

.

│ │ │ -0014b680: 596f 7520 6361 6e20 6163 7475 616c 6c79 You can actually │ │ │ -0014b690: 2074 6573 7420 6120 4347 4920 7365 7276 test a CGI serv │ │ │ -0014b6a0: 6963 6520 6170 706c 6963 6174 696f 6e20 ice application │ │ │ -0014b6b0: 7769 7468 6f75 7420 6465 706c 6f79 696e without deployin │ │ │ -0014b6c0: 6720 6974 206f 6e20 7468 6520 5765 622e g it on the Web. │ │ │ -0014b6d0: 2054 6f20 646f 2074 6869 732c 2063 7265 To do this, cre │ │ │ -0014b6e0: 6174 6520 7468 6520 4347 4920 7365 7276 ate the CGI serv │ │ │ -0014b6f0: 6963 6520 6170 706c 6963 6174 696f 6e20 ice application │ │ │ -0014b700: 616e 6420 7365 6e64 2069 7420 6120 7265 and send it a re │ │ │ -0014b710: 7175 6573 7420 6d65 7373 6167 6520 7573 quest message us │ │ │ -0014b720: 696e 6720 7265 6469 7265 6374 696f 6e20 ing redirection │ │ │ -0014b730: 6173 2066 6f6c 6c6f 7773 3a20 3c2f 703e as follows:

│ │ │ -0014b740: 3c70 7265 2063 6c61 7373 3d22 6672 6167
./service.
│ │ │ -0014b760: 6367 6920 266c 743b 206e 732e 6164 642e  cgi < ns.add.
│ │ │ -0014b770: 7265 712e 786d 6c0a 3c2f 7072 653e 3c70  req.xml.

this should di │ │ │ -0014b790: 7370 6c61 7920 7468 6520 7365 7276 6963 splay the servic │ │ │ -0014b7a0: 6520 7265 7370 6f6e 7365 206f 6e20 7468 e response on th │ │ │ -0014b7b0: 6520 7465 726d 696e 616c 2c20 7768 6572 e terminal, wher │ │ │ -0014b7c0: 6520 3c65 6d3e 3c63 6f64 653e 6e73 2e61 e ns.a │ │ │ -0014b7d0: 6464 2e72 6571 2e78 6d6c 3c2f 636f 6465 dd.req.xml was gener │ │ │ -0014b7f0: 6174 6564 2062 7920 736f 6170 6370 7032 ated by soapcpp2 │ │ │ -0014b800: 206f 7220 6120 6d6f 6469 6669 6564 2076 or a modified v │ │ │ -0014b810: 6572 7369 6f6e 206f 6620 7468 6973 2066 ersion of this f │ │ │ -0014b820: 696c 652e 2059 6f75 2063 616e 2061 6c73 ile. You can als │ │ │ -0014b830: 6f20 7573 6520 6120 3c65 6d3e 3c63 6f64 o use a SENT.log file prod │ │ │ -0014b860: 7563 6564 2062 7920 6120 636c 6965 6e74 uced by a client │ │ │ -0014b870: 2061 7070 6c69 6361 7469 6f6e 2074 6f20 application to │ │ │ -0014b880: 7265 6469 7265 6374 2074 6f20 7468 6520 redirect to the │ │ │ -0014b890: 4347 4920 7365 7276 6963 6520 6170 706c CGI service appl │ │ │ -0014b8a0: 6963 6174 696f 6e2e 2059 6f75 2063 616e ication. You can │ │ │ -0014b8b0: 2061 6c73 6f20 7573 6520 7468 6520 6753 also use the gS │ │ │ -0014b8c0: 4f41 5020 3c61 2068 7265 663d 222e 2e2f OAP Tes │ │ │ -0014b8f0: 7420 4d65 7373 656e 6765 723c 2f61 3e20 t Messenger │ │ │ -0014b900: 6170 706c 6963 6174 696f 6e20 746f 2067 application to g │ │ │ -0014b910: 656e 6572 6174 6520 7261 6e64 6f6d 697a enerate randomiz │ │ │ -0014b920: 6564 206d 6573 7361 6765 7320 746f 2074 ed messages to t │ │ │ -0014b930: 6573 7420 796f 7572 2073 6572 7665 7273 est your servers │ │ │ -0014b940: 2e3c 2f70 3e0a 3c70 3e54 6865 2066 696c .

.

The fil │ │ │ -0014b950: 6520 6e61 6d65 7320 6f66 2074 6865 206c e names of the l │ │ │ -0014b960: 6f67 2066 696c 6573 2061 6e64 2074 6865 og files and the │ │ │ -0014b970: 206c 6f67 6769 6e67 2061 6374 6976 6974 logging activit │ │ │ -0014b980: 7920 6361 6e20 6265 2063 6f6e 7472 6f6c y can be control │ │ │ -0014b990: 6c65 6420 6174 2074 6865 2061 7070 6c69 led at the appli │ │ │ -0014b9a0: 6361 7469 6f6e 206c 6576 656c 2e20 5468 cation level. Th │ │ │ -0014b9b0: 6973 2061 6c6c 6f77 7320 7468 6520 6372 is allows the cr │ │ │ -0014b9c0: 6561 7469 6f6e 206f 6620 7365 7061 7261 eation of separa │ │ │ -0014b9d0: 7465 206c 6f67 2066 696c 6573 2062 7920 te log files by │ │ │ -0014b9e0: 7365 7061 7261 7465 2073 6572 7669 6365 separate service │ │ │ -0014b9f0: 732c 2063 6c69 656e 7473 2c20 616e 6420 s, clients, and │ │ │ -0014ba00: 7468 7265 6164 732e 2046 6f72 2065 7861 threads. For exa │ │ │ -0014ba10: 6d70 6c65 2c20 7468 6520 666f 6c6c 6f77 mple, the follow │ │ │ -0014ba20: 696e 6720 7365 7276 6963 6520 6c6f 6773 ing service logs │ │ │ -0014ba30: 2061 6c6c 206d 6573 7361 6765 7320 2862 all messages (b │ │ │ -0014ba40: 7574 206e 6f20 6465 6275 6720 6d65 7373 ut no debug mess │ │ │ -0014ba50: 6167 6573 2920 696e 2073 6570 6172 6174 ages) in separat │ │ │ -0014ba60: 6520 6469 7265 6374 6f72 6965 733a 3c2f e directories:.

struct < │ │ │ -0014bac0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -0014bad0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ -0014bae0: 6874 6d6c 223e 736f 6170 3c2f 613e 202a html">soap * │ │ │ -0014baf0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap │ │ │ -0014bb20: 3d20 3c61 2063 6c61 7373 3d22 636f 6465 = soap_new< │ │ │ -0014bb80: 2f61 3e28 293b 203c 2f64 6976 3e0a 3c64 /a>();
. │ │ │ -0014bba0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap_set_recv │ │ │ -0014bc00: 5f6c 6f67 6669 6c65 3c2f 613e 283c 6120 _logfile(soap, " │ │ │ -0014bc60: 6c6f 6773 2f72 6563 762f 7365 7276 6963 logs/recv/servic │ │ │ -0014bc70: 6531 322e 6c6f 6726 7175 6f74 3b3c 2f73 e12.log"); // │ │ │ -0014bca0: 6170 7065 6e64 2061 6c6c 206d 6573 7361 append all messa │ │ │ -0014bcb0: 6765 7320 7265 6365 6976 6564 2069 6e20 ges received in │ │ │ -0014bcc0: 2f6c 6f67 732f 7265 6376 2f73 6572 7669 /logs/recv/servi │ │ │ -0014bcd0: 6365 3132 2e6c 6f67 203c 2f73 7061 6e3e ce12.log │ │ │ -0014bce0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
soap │ │ │ -0014bd50: 5f73 6574 5f73 656e 745f 6c6f 6766 696c _set_sent_logfil │ │ │ -0014bd60: 653c 2f61 3e28 3c61 2063 6c61 7373 3d22 e(soa │ │ │ -0014bd90: 703c 2f61 3e2c 203c 7370 616e 2063 6c61 p, "logs/se │ │ │ -0014bdc0: 6e74 2f73 6572 7669 6365 3132 2e6c 6f67 nt/service12.log │ │ │ -0014bdd0: 2671 756f 743b 3c2f 7370 616e 3e29 3b20 "); │ │ │ -0014bde0: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // append │ │ │ -0014be00: 616c 6c20 6d65 7373 6167 6573 2073 656e all messages sen │ │ │ -0014be10: 7420 696e 202f 6c6f 6773 2f73 656e 742f t in /logs/sent/ │ │ │ -0014be20: 7365 7276 6963 6531 322e 6c6f 6720 3c2f service12.log
.
soap_set_test_l │ │ │ -0014beb0: 6f67 6669 6c65 3c2f 613e 283c 6120 636c ogfile(soap, NULL │ │ │ -0014bef0: 293b 2020 2020 2020 2020 2020 2020 2020 ); │ │ │ -0014bf00: 2020 2020 2020 2020 3c73 7061 6e20 636c // │ │ │ -0014bf20: 206e 6f20 6669 6c65 206e 616d 653a 2064 no file name: d │ │ │ -0014bf30: 6f20 6e6f 7420 7361 7665 2064 6562 7567 o not save debug │ │ │ -0014bf40: 206d 6573 7361 6765 7320 3c2f 7370 616e messages
..
soap_free(< │ │ │ -0014c0f0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -0014c100: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ -0014c110: 6874 6d6c 223e 736f 6170 3c2f 613e 293b html">soap); │ │ │ -0014c120: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
soap_set_rec │ │ │ -0014c1e0: 765f 6c6f 6766 696c 653c 2f61 3e3c 2f64 v_logfile
void soap │ │ │ -0014c210: 5f73 6574 5f72 6563 765f 6c6f 6766 696c _set_recv_logfil │ │ │ -0014c220: 6528 7374 7275 6374 2073 6f61 7020 2a73 e(struct soap *s │ │ │ -0014c230: 6f61 702c 2063 6f6e 7374 2063 6861 7220 oap, const char │ │ │ -0014c240: 2a6c 6f67 6669 6c65 293c 2f64 6976 3e3c *logfile)
< │ │ │ -0014c250: 6469 7620 636c 6173 733d 2274 7464 6f63 div class="ttdoc │ │ │ -0014c260: 223e 5370 6563 6966 7920 6120 6669 6c65 ">Specify a file │ │ │ -0014c270: 206e 616d 6520 746f 2073 6176 6520 6d65 name to save me │ │ │ -0014c280: 7373 6167 6573 2072 6563 6569 7665 642e ssages received. │ │ │ -0014c290: 3c2f 6469 763e 3c2f 6469 763e 0a3c 6469
. │ │ │ -0014c2f0: 3c64 6976 2063 6c61 7373 3d22 7474 6e61 . │ │ │ -0014c410: 3c64 6976 2063 6c61 7373 3d22 7474 6322
│ │ │ -0014c4f0: 766f 6964 2073 6f61 705f 7365 745f 7365 void soap_set_se │ │ │ -0014c500: 6e74 5f6c 6f67 6669 6c65 2873 7472 7563 nt_logfile(struc │ │ │ -0014c510: 7420 736f 6170 202a 736f 6170 2c20 636f t soap *soap, co │ │ │ -0014c520: 6e73 7420 6368 6172 202a 6c6f 6766 696c nst char *logfil │ │ │ -0014c530: 6529 3c2f 6469 763e 3c64 6976 2063 6c61 e)
Speci │ │ │ -0014c550: 6679 2061 2066 696c 6520 6e61 6d65 2074 fy a file name t │ │ │ -0014c560: 6f20 7361 7665 206d 6573 7361 6765 7320 o save messages │ │ │ -0014c570: 7365 6e74 2e3c 2f64 6976 3e3c 2f64 6976 sent.
.

Like │ │ │ -0014c5a0: 7769 7365 2c20 6d65 7373 6167 6573 2063 wise, messages c │ │ │ -0014c5b0: 616e 2062 6520 6c6f 6767 6564 2066 6f72 an be logged for │ │ │ -0014c5c0: 2069 6e64 6976 6964 7561 6c20 636c 6965 individual clie │ │ │ -0014c5d0: 6e74 2d73 6964 6520 7365 7276 6963 6520 nt-side service │ │ │ -0014c5e0: 6f70 6572 6174 696f 6e20 6361 6c6c 7320 operation calls │ │ │ -0014c5f0: 696e 2061 2063 6c69 656e 7420 6170 706c in a client appl │ │ │ -0014c600: 6963 6174 696f 6e2e 3c2f 703e 0a3c 703e ication.

.

│ │ │ -0014c610: 546f 206c 6f67 206d 6573 7361 6765 7320 To log messages │ │ │ -0014c620: 6d6f 7265 2065 6666 6963 6965 6e74 6c79 more efficiently │ │ │ -0014c630: 2c20 7573 6520 7468 6520 3c63 6f64 653e , use the │ │ │ -0014c640: 3c61 2063 6c61 7373 3d22 656c 2220 6872 logging plugin.

.

.... Back to ta │ │ │ -0014c700: 626c 6520 6f66 2063 6f6e 7465 6e74 733c ble of contents< │ │ │ -0014c710: 2f61 3e3c 2f70 3e0a 3c68 313e 3c61 2063 /a>

.

< │ │ │ -0014c740: 2f61 3e0a 4c69 6d69 7461 7469 6f6e 733c /a>.Limitations< │ │ │ -0014c750: 2f68 313e 0a3c 703e 4672 6f6d 2074 6865 /h1>.

From the │ │ │ -0014c760: 2070 6572 7370 6563 7469 7665 206f 6620 perspective of │ │ │ -0014c770: 7468 6520 432f 432b 2b20 6c61 6e67 7561 the C/C++ langua │ │ │ -0014c780: 6765 2c20 6120 6665 7720 432f 432b 2b20 ge, a few C/C++ │ │ │ -0014c790: 6c61 6e67 7561 6765 2066 6561 7475 7265 language feature │ │ │ -0014c7a0: 7320 6172 6520 6e6f 7420 7375 7070 6f72 s are not suppor │ │ │ -0014c7b0: 7465 6420 6279 2067 534f 4150 2061 6e64 ted by gSOAP and │ │ │ -0014c7c0: 2074 6865 7365 2066 6561 7475 7265 7320 these features │ │ │ -0014c7d0: 6361 6e6e 6f74 2062 6520 7573 6564 2069 cannot be used i │ │ │ -0014c7e0: 6e20 616e 2069 6e74 6572 6661 6365 2068 n an interface h │ │ │ -0014c7f0: 6561 6465 7220 6669 6c65 2066 6f72 2073 eader file for s │ │ │ -0014c800: 6f61 7063 7070 322e 3c2f 703e 0a3c 756c oapcpp2.

.
    .
  • STL: the s │ │ │ -0014c820: 6f61 7063 7070 3220 746f 6f6c 2073 7570 oapcpp2 tool sup │ │ │ -0014c830: 706f 7274 7320 7468 6520 7365 7269 616c ports the serial │ │ │ -0014c840: 697a 6174 696f 6e20 6f66 2043 2b2b 2073 ization of C++ s │ │ │ -0014c850: 7472 696e 6773 203c 636f 6465 3e73 7464 trings std │ │ │ -0014c860: 3a3a 7374 7269 6e67 3c2f 636f 6465 3e20 ::string │ │ │ -0014c870: 616e 6420 3c63 6f64 653e 7374 643a 3a77 and std::w │ │ │ -0014c880: 7374 7269 6e67 3c2f 636f 6465 3e20 616e string an │ │ │ -0014c890: 6420 7468 6520 636f 6e74 6169 6e65 7273 d the containers │ │ │ -0014c8a0: 203c 636f 6465 3e73 7464 3a3a 6465 7175 std::dequ │ │ │ -0014c8b0: 653c 2f63 6f64 653e 2c20 3c63 6f64 653e e, │ │ │ -0014c8c0: 7374 643a 3a6c 6973 743c 2f63 6f64 653e std::list │ │ │ -0014c8d0: 2c20 3c63 6f64 653e 7374 643a 3a76 6563 , std::vec │ │ │ -0014c8e0: 746f 723c 2f63 6f64 653e 2c20 616e 6420 tor, and │ │ │ -0014c8f0: 3c63 6f64 653e 7374 643a 3a73 6574 3c2f std::set, (see Sect │ │ │ -0014c910: 696f 6e20 3c61 2063 6c61 7373 3d22 656c ion ST │ │ │ -0014c940: 4c20 636f 6e74 6169 6e65 7273 3c2f 613e L containers │ │ │ -0014c950: 2029 2e20 416c 736f 203c 636f 6465 3e73 ). Also s │ │ │ -0014c960: 7464 3a3a 7368 6172 6564 5f70 7472 3c2f td::shared_ptr, std │ │ │ -0014c980: 3a3a 756e 6971 7565 5f70 7472 3c2f 636f ::unique_ptr, and s │ │ │ -0014c9a0: 7464 3a3a 6175 746f 5f70 7472 3c2f 636f td::auto_ptr are supporte │ │ │ -0014c9c0: 642e 204f 7468 6572 2053 544c 2074 7970 d. Other STL typ │ │ │ -0014c9d0: 6573 2061 7265 206e 6f74 2073 6572 6961 es are not seria │ │ │ -0014c9e0: 6c69 7a61 626c 652e 3c2f 6c69 3e0a 3c6c lizable.
  • .Templates: the │ │ │ -0014ca00: 2073 6f61 7063 7070 3220 746f 6f6c 2061 soapcpp2 tool a │ │ │ -0014ca10: 7373 756d 6573 2074 6861 7420 7465 6d70 ssumes that temp │ │ │ -0014ca20: 6c61 7465 7320 636c 6173 7365 7320 6861 lates classes ha │ │ │ -0014ca30: 7665 206f 6e6c 7920 6f6e 6520 7465 6d70 ve only one temp │ │ │ -0014ca40: 6c61 7465 2070 6172 616d 6574 6572 2074 late parameter t │ │ │ -0014ca50: 7970 6520 616e 6420 7468 6573 6520 7465 ype and these te │ │ │ -0014ca60: 6d70 6c61 7465 7320 6172 6520 636f 6e74 mplates are cont │ │ │ -0014ca70: 6169 6e65 7273 206f 6620 7661 6c75 6573 ainers of values │ │ │ -0014ca80: 206f 6620 7468 6973 2074 656d 706c 6174 of this templat │ │ │ -0014ca90: 6520 7061 7261 6d65 7465 7220 7479 7065 e parameter type │ │ │ -0014caa0: 2e20 5468 6973 2074 656d 706c 6174 6520 . This template │ │ │ -0014cab0: 636c 6173 7320 7368 6f75 6c64 2064 6566 class should def │ │ │ -0014cac0: 696e 6520 3c63 6f64 653e 6265 6769 6e28 ine begin( │ │ │ -0014cad0: 293c 2f63 6f64 653e 2c20 3c63 6f64 653e ), │ │ │ -0014cae0: 656e 6428 293c 2f63 6f64 653e 2c20 3c63 end(), size(), clear() │ │ │ -0014cb10: 3c2f 636f 6465 3e2c 2061 6e64 203c 636f , and insert() methods. │ │ │ -0014cb40: 0a3c 6c69 3e49 6e68 6572 6974 616e 6365 .
  • Inheritance │ │ │ -0014cb50: 3a20 7369 6e67 6c65 2063 6c61 7373 2069 : single class i │ │ │ -0014cb60: 6e68 6572 6974 616e 6365 2069 7320 7375 nheritance is su │ │ │ -0014cb70: 7070 6f72 7465 642e 3c2f 6c69 3e0a 3c6c pported.
  • .Abstract metho │ │ │ -0014cb90: 6473 3a20 6120 636c 6173 7320 6d75 7374 ds: a class must │ │ │ -0014cba0: 2062 6520 696e 7374 616e 7469 6162 6c65 be instantiable │ │ │ -0014cbb0: 2074 6f20 7375 7070 6f72 7420 7365 7269 to support seri │ │ │ -0014cbc0: 616c 697a 6174 696f 6e20 6f66 2074 6861 alization of tha │ │ │ -0014cbd0: 7420 636c 6173 732e 2041 6e20 6162 7374 t class. An abst │ │ │ -0014cbe0: 7261 6374 2063 6c61 7373 2077 6865 6e20 ract class when │ │ │ -0014cbf0: 7573 6564 2073 686f 756c 6420 6265 2064 used should be d │ │ │ -0014cc00: 6563 6c61 7265 6420 7472 616e 7369 656e eclared transien │ │ │ -0014cc10: 742c 2073 6565 2053 6563 7469 6f6e 203c t, see Section < │ │ │ -0014cc20: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ -0014cc30: 663d 2269 6e64 6578 2e68 746d 6c23 7472 f="index.html#tr │ │ │ -0014cc40: 616e 7369 656e 7422 3e54 7261 6e73 6965 ansient">Transie │ │ │ -0014cc50: 6e74 2064 6174 6120 7479 7065 733c 2f61 nt data types..
  • Dire │ │ │ -0014cc70: 6374 6976 6573 3a20 6469 7265 6374 6976 ctives: directiv │ │ │ -0014cc80: 6573 2061 6e64 2070 7261 676d 6173 2073 es and pragmas s │ │ │ -0014cc90: 7563 6820 6173 203c 636f 6465 3e23 696e uch as #in │ │ │ -0014cca0: 636c 7564 653c 2f63 6f64 653e 2061 6e64 clude and │ │ │ -0014ccb0: 203c 636f 6465 3e23 6465 6669 6e65 3c2f #define are moved │ │ │ -0014ccd0: 746f 2074 6865 2067 656e 6572 6174 6564 to the generated │ │ │ -0014cce0: 203c 656d 3e3c 636f 6465 3e73 6f61 7053 soapS │ │ │ -0014ccf0: 7475 622e 683c 2f63 6f64 653e 3c2f 656d tub.h source code by │ │ │ -0014cd10: 2073 6f61 7063 7070 322e 2054 6865 7365 soapcpp2. These │ │ │ -0014cd20: 2064 6972 6563 7469 7665 7320 6172 6520 directives are │ │ │ -0014cd30: 616c 6c20 706c 6163 6564 2061 7420 7468 all placed at th │ │ │ -0014cd40: 6520 746f 7020 6f66 2074 6861 7420 6669 e top of that fi │ │ │ -0014cd50: 6c65 2c20 7365 6520 3c61 2063 6c61 7373 le, see │ │ │ -0014cd80: 5468 6520 2369 6e63 6c75 6465 2061 6e64 The #include and │ │ │ -0014cd90: 2023 6465 6669 6e65 2064 6972 6563 7469 #define directi │ │ │ -0014cda0: 7665 733c 2f61 3e2e 2055 7365 2074 6865 ves. Use the │ │ │ -0014cdb0: 203c 636f 6465 3e23 696d 706f 7274 3c2f #import directive │ │ │ -0014cdd0: 746f 2069 6d70 6f72 7420 696e 7465 7266 to import interf │ │ │ -0014cde0: 6163 6520 6865 6164 6572 2066 696c 6573 ace header files │ │ │ -0014cdf0: 2069 6e74 6f20 6f74 6865 7220 696e 7465 into other inte │ │ │ -0014ce00: 7266 6163 6520 6865 6164 6572 2066 696c rface header fil │ │ │ -0014ce10: 6573 2c20 7365 6520 5365 6374 696f 6e20 es, see Section │ │ │ -0014ce20: 3c61 2063 6c61 7373 3d22 656c 2220 6872 The #impo │ │ │ -0014ce50: 7274 2064 6972 6563 7469 7665 3c2f 613e rt directive │ │ │ -0014ce60: 202e 3c2f 6c69 3e0a 3c6c 693e 4320 616e .
  • .
  • C an │ │ │ -0014ce70: 6420 432b 2b20 636f 6465 2073 7461 7465 d C++ code state │ │ │ -0014ce80: 6d65 6e74 733a 206e 6f20 636f 6465 2073 ments: no code s │ │ │ -0014ce90: 7461 7465 6d65 6e74 7320 6172 6520 616c tatements are al │ │ │ -0014cea0: 6c6f 7773 2069 6e20 696e 7465 7266 6163 lows in interfac │ │ │ -0014ceb0: 6520 6865 6164 6572 2066 696c 6573 2e20 e header files. │ │ │ -0014cec0: 436c 6173 7320 6d65 7468 6f64 7320 7368 Class methods sh │ │ │ -0014ced0: 6f75 6c64 2062 6520 6465 636c 6172 6564 ould be declared │ │ │ -0014cee0: 2077 6974 686f 7574 2063 6f64 6520 696e without code in │ │ │ -0014cef0: 203c 636f 6465 3e7b 3c2f 636f 6465 3e20 { │ │ │ -0014cf00: 616e 6420 3c63 6f64 653e 7d3c 2f63 6f64 and }. Also constru │ │ │ -0014cf20: 6374 6f72 2069 6e69 7469 616c 697a 6572 ctor initializer │ │ │ -0014cf30: 7320 6172 6520 6e6f 7420 616c 6c6f 7765 s are not allowe │ │ │ -0014cf40: 642e 2043 6c61 7373 206d 6574 686f 6420 d. Class method │ │ │ -0014cf50: 696d 706c 656d 656e 7461 7469 6f6e 7320 implementations │ │ │ -0014cf60: 7368 6f75 6c64 2062 6520 6465 6669 6e65 should be define │ │ │ -0014cf70: 6420 696e 2061 2073 6570 6172 6174 6520 d in a separate │ │ │ -0014cf80: 432b 2b20 736f 7572 6365 2066 696c 652e C++ source file. │ │ │ -0014cf90: 3c2f 6c69 3e0a 3c6c 693e 432b 2b20 7265
  • .
  • C++ re │ │ │ -0014cfa0: 6665 7265 6e63 6573 3a20 7468 6573 6520 ferences: these │ │ │ -0014cfb0: 6361 6e6e 6f74 2062 6520 7365 7269 616c cannot be serial │ │ │ -0014cfc0: 697a 6564 2c20 7573 6520 706f 696e 7465 ized, use pointe │ │ │ -0014cfd0: 7273 2069 6e73 7465 6164 2e3c 2f6c 693e rs instead.
  • │ │ │ -0014cfe0: 0a3c 2f75 6c3e 0a3c 703e 5468 6520 666f .
.

The fo │ │ │ -0014cff0: 6c6c 6f77 696e 6720 432f 432b 2b20 6461 llowing C/C++ da │ │ │ -0014d000: 7461 2074 7970 6573 2072 6571 7569 7265 ta types require │ │ │ -0014d010: 2073 6f6d 6520 6174 7465 6e74 696f 6e20 some attention │ │ │ -0014d020: 746f 2065 6e73 7572 6520 7468 6579 2063 to ensure they c │ │ │ -0014d030: 616e 2062 6520 7365 7269 616c 697a 6564 an be serialized │ │ │ -0014d040: 3a3c 2f70 3e0a 3c75 6c3e 0a3c 6c69 3e55 :

.
. │ │ │ -0014d6d0: 3c70 3ef0 9f94 9d20 3c61 2068 7265 663d

.... Back to tabl │ │ │ -0014d6f0: 6520 6f66 2063 6f6e 7465 6e74 733c 2f61 e of contents

.

.A │ │ │ -0014d730: 6476 616e 6365 6420 6665 6174 7572 6573 dvanced features │ │ │ -0014d740: 3c2f 6831 3e0a 3c70 3ef0 9f94 9d20 3c61

.

.... Back t │ │ │ -0014d760: 6f20 7461 626c 6520 6f66 2063 6f6e 7465 o table of conte │ │ │ -0014d770: 6e74 733c 2f61 3e3c 2f70 3e0a 3c68 323e nts

.

│ │ │ -0014d780: 3c61 2063 6c61 7373 3d22 616e 6368 6f72 │ │ │ -0014d7b0: 0a49 6e74 6572 6e61 7469 6f6e 616c 697a .Internationaliz │ │ │ -0014d7c0: 6174 696f 6e3c 2f68 323e 0a3c 703e 5265 ation

.

Re │ │ │ -0014d7d0: 6775 6c61 7220 382d 6269 7420 7374 7269 gular 8-bit stri │ │ │ -0014d7e0: 6e67 7320 6361 6e6e 6f74 2068 6f6c 6420 ngs cannot hold │ │ │ -0014d7f0: 7769 6465 2063 6861 7261 6374 6572 7320 wide characters │ │ │ -0014d800: 6f75 7473 6964 6520 6f66 2074 6865 2063 outside of the c │ │ │ -0014d810: 6861 7261 6374 6572 2072 616e 6765 205b haracter range [ │ │ │ -0014d820: 312c 3235 355d 2e20 4f66 2063 6f75 7273 1,255]. Of cours │ │ │ -0014d830: 6520 796f 7520 6361 6e20 7573 6520 7769 e you can use wi │ │ │ -0014d840: 6465 2073 7472 696e 6773 2069 6e73 7465 de strings inste │ │ │ -0014d850: 6164 206f 6620 382d 6269 7420 7374 7269 ad of 8-bit stri │ │ │ -0014d860: 6e67 7320 696e 2074 6865 2069 6e74 6572 ngs in the inter │ │ │ -0014d870: 6661 6365 2068 6561 6465 7220 6669 6c65 face header file │ │ │ -0014d880: 2066 6f72 2073 6f61 7063 7070 322e 2041 for soapcpp2. A │ │ │ -0014d890: 6c74 6572 6e61 7469 7665 6c79 2c20 7365 lternatively, se │ │ │ -0014d8a0: 7420 7468 6520 3c63 6f64 653e 2353 4f41 t the #SOA │ │ │ -0014d8b0: 505f 435f 5554 4653 5452 494e 473c 2f63 P_C_UTFSTRING mode flag t │ │ │ -0014d8d0: 6f20 656e 636f 6465 2077 6964 6520 6368 o encode wide ch │ │ │ -0014d8e0: 6172 6163 7465 7273 2069 6e20 382d 6269 aracters in 8-bi │ │ │ -0014d8f0: 7420 7374 7269 6e67 7320 696e 2055 5446 t strings in UTF │ │ │ -0014d900: 2d38 2066 6f72 6d61 742e 3c2f 703e 0a3c -8 format.

.< │ │ │ -0014d910: 703e 466f 7220 6578 616d 706c 652c 2074 p>For example, t │ │ │ -0014d920: 6865 203c 656d 3e3c 636f 6465 3e78 7364 he xsd │ │ │ -0014d930: 3a73 7472 696e 673c 2f63 6f64 653e 3c2f :string string schem │ │ │ -0014d950: 6120 7479 7065 2063 616e 2062 6520 6465 a type can be de │ │ │ -0014d960: 636c 6172 6564 2061 7320 6120 7769 6465 clared as a wide │ │ │ -0014d970: 2d63 6861 7261 6374 6572 2073 7472 696e -character strin │ │ │ -0014d980: 6720 616e 6420 7573 6564 2073 7562 7365 g and used subse │ │ │ -0014d990: 7175 656e 746c 793a 3c2f 703e 0a3c 6469 quently:

.
typed │ │ │ -0014d9e0: 6566 3c2f 7370 616e 3e20 3c73 7061 6e20 ef wchar_t *xsd__string; │ │ │ -0014da20: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
int n │ │ │ -0014da60: 735f 5f6d 794d 6574 686f 6428 7873 645f s__myMethod(xsd_ │ │ │ -0014da70: 5f73 7472 696e 6720 696e 7075 742c 2078 _string input, x │ │ │ -0014da80: 7364 5f5f 7374 7269 6e67 202a 6f75 7470 sd__string *outp │ │ │ -0014da90: 7574 293b 3c2f 6469 763e 0a3c 2f64 6976 ut);
.

│ │ │ -0014e040: 3c70 3e50 6c65 6173 6520 636f 6e73 756c

Please consul │ │ │ -0014e050: 7420 7468 6520 5554 462d 3820 7370 6563 t the UTF-8 spec │ │ │ -0014e060: 6966 6963 6174 696f 6e20 666f 7220 6465 ification for de │ │ │ -0014e070: 7461 696c 7320 6f6e 2074 6865 2055 5446 tails on the UTF │ │ │ -0014e080: 2d38 2066 6f72 6d61 7420 7768 656e 2070 -8 format when p │ │ │ -0014e090: 726f 6365 7373 696e 6720 382d 6269 7420 rocessing 8-bit │ │ │ -0014e0a0: 7374 7269 6e67 7320 7769 7468 2055 5446 strings with UTF │ │ │ -0014e0b0: 2d38 2063 6f6e 7465 6e74 2e20 4e6f 7465 -8 content. Note │ │ │ -0014e0c0: 2074 6861 7420 7468 6520 4153 4349 4920 that the ASCII │ │ │ -0014e0d0: 6368 6172 6163 7465 7220 7365 7420 5b31 character set [1 │ │ │ -0014e0e0: 2d31 3237 5d20 6973 2061 2073 7562 7365 -127] is a subse │ │ │ -0014e0f0: 7420 6f66 2055 5446 2d38 2e20 5468 6572 t of UTF-8. Ther │ │ │ -0014e100: 6566 6f72 652c 2077 6974 6820 7468 6520 efore, with the │ │ │ -0014e110: 3c63 6f64 653e 2353 4f41 505f 435f 5554 #SOAP_C_UT │ │ │ -0014e120: 4653 5452 494e 473c 2f63 6f64 653e 2066 FSTRING f │ │ │ -0014e130: 6c61 6720 7365 742c 2073 7472 696e 6773 lag set, strings │ │ │ -0014e140: 206d 6179 2068 6f6c 6420 4153 4349 4920 may hold ASCII │ │ │ -0014e150: 6368 6172 6163 7465 7220 6461 7461 2061 character data a │ │ │ -0014e160: 6e64 2055 5446 2d38 2065 7874 656e 7369 nd UTF-8 extensi │ │ │ -0014e170: 6f6e 732e 3c2f 703e 0a3c 703e 5365 6520 ons.

.

See │ │ │ -0014e180: 616c 736f 203c 6120 6872 6566 3d22 2e2e also C and C++ XML d │ │ │ -0014e1c0: 6174 6120 6269 6e64 696e 6773 3c2f 613e ata bindings │ │ │ -0014e1d0: 2064 6f63 756d 656e 7461 7469 6f6e 2066 documentation f │ │ │ -0014e1e0: 6f72 206d 6f72 6520 6465 7461 696c 7320 or more details │ │ │ -0014e1f0: 6f6e 2075 7369 6e67 203c 656d 3e3c 636f on using typemap.dat for w │ │ │ -0014e220: 7364 6c32 682e 3c2f 703e 0a3c 703e f09f sdl2h.

.

.. │ │ │ -0014e230: 949d 203c 6120 6872 6566 3d22 2322 3e42 .. B │ │ │ -0014e240: 6163 6b20 746f 2074 6162 6c65 206f 6620 ack to table of │ │ │ -0014e250: 636f 6e74 656e 7473 3c2f 613e 3c2f 703e contents

│ │ │ -0014e260: 0a3c 6832 3e3c 6120 636c 6173 733d 2261 .

.Dire │ │ │ -0014e290: 6374 6976 6573 3c2f 6832 3e0a 3c70 3e41 ctives

.

A │ │ │ -0014e2a0: 6e20 696e 7465 7266 6163 6520 6865 6164 n interface head │ │ │ -0014e2b0: 6572 2066 696c 6520 666f 7220 736f 6170 er file for soap │ │ │ -0014e2c0: 6370 7032 206d 6179 2069 6e63 6c75 6465 cpp2 may include │ │ │ -0014e2d0: 203c 636f 6465 3e2f 2f67 736f 6170 3c2f //gsoap directives │ │ │ -0014e2f0: 2074 6f20 636f 6e66 6967 7572 6520 6d65 to configure me │ │ │ -0014e300: 7373 6167 696e 6720 7072 6f74 6f63 6f6c ssaging protocol │ │ │ -0014e310: 7320 7375 6368 2061 7320 534f 4150 206f s such as SOAP o │ │ │ -0014e320: 7220 5245 5354 2c20 746f 2061 7373 6f63 r REST, to assoc │ │ │ -0014e330: 6961 7465 2053 4f41 5020 4865 6164 6572 iate SOAP Header │ │ │ -0014e340: 7320 616e 6420 4661 756c 7473 2077 6974 s and Faults wit │ │ │ -0014e350: 6820 6d65 7373 6167 6573 2c20 616e 6420 h messages, and │ │ │ -0014e360: 746f 2073 6574 2070 726f 7065 7274 6965 to set propertie │ │ │ -0014e370: 7320 6f66 2074 6865 2057 6562 2073 6572 s of the Web ser │ │ │ -0014e380: 7669 6365 2064 6566 696e 6564 2069 6e20 vice defined in │ │ │ -0014e390: 7468 6520 736f 6170 6370 7032 2d67 656e the soapcpp2-gen │ │ │ -0014e3a0: 6572 6174 6564 2057 5344 4c20 616e 6420 erated WSDL and │ │ │ -0014e3b0: 5853 4420 6669 6c65 732e 2044 6972 6563 XSD files. Direc │ │ │ -0014e3c0: 7469 7665 7320 666f 7220 736f 6170 6370 tives for soapcp │ │ │ -0014e3d0: 7032 2061 7265 2073 7065 6369 6669 6564 p2 are specified │ │ │ -0014e3e0: 2061 7320 3c63 6f64 653e 2f2f 6773 6f61 as //gsoa │ │ │ -0014e3f0: 703c 2f63 6f64 653e 2d63 6f6d 6d65 6e74 p-comment │ │ │ -0014e400: 7320 7468 6174 2061 7265 2070 726f 6365 s that are proce │ │ │ -0014e410: 7373 6564 2062 7920 736f 6170 6370 7032 ssed by soapcpp2 │ │ │ -0014e420: 2e3c 2f70 3e0a 3c68 333e 3c61 2063 6c61 .

.

.Service direc │ │ │ -0014e460: 7469 7665 733c 2f68 333e 0a3c 703e 4120 tives

.

A │ │ │ -0014e470: 7365 7276 6963 6520 6469 7265 6374 6976 service directiv │ │ │ -0014e480: 6520 6d75 7374 2073 7461 7274 2061 7420 e must start at │ │ │ -0014e490: 6120 6e65 7720 6c69 6e65 2061 6e64 2069 a new line and i │ │ │ -0014e4a0: 7320 6f66 2074 6865 2066 6f72 6d3a 3c2f s of the form:.

//gsoap <pre │ │ │ -0014e500: 6669 7826 6774 3b20 7365 7276 6963 6520 fix> service │ │ │ -0014e510: 266c 743b 7072 6f70 6572 7479 2667 743b <property> │ │ │ -0014e520: 3a20 266c 743b 7661 6c75 6526 6774 3b3c : <value>< │ │ │ -0014e530: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 2f64 /span>
.

where <prefix> │ │ │ -0014e570: 3b3c 2f63 6f64 653e 2069 7320 7468 6520 ; is the │ │ │ -0014e580: 584d 4c20 6e61 6d65 7370 6163 6520 7072 XML namespace pr │ │ │ -0014e590: 6566 6978 206f 6620 6120 7365 7276 6963 efix of a servic │ │ │ -0014e5a0: 6520 6269 6e64 696e 672e 2054 6865 203c e binding. The < │ │ │ -0014e5b0: 636f 6465 3e26 6c74 3b70 726f 7065 7274 code><propert │ │ │ -0014e5c0: 7926 6774 3b3c 2f63 6f64 653e 2061 6e64 y> and │ │ │ -0014e5d0: 203c 636f 6465 3e26 6c74 3b76 616c 7565 <value │ │ │ -0014e5e0: 2667 743b 3c2f 636f 6465 3e20 6669 656c > fiel │ │ │ -0014e5f0: 6473 2061 7265 206f 6e65 206f 6620 7468 ds are one of th │ │ │ -0014e600: 6520 666f 6c6c 6f77 696e 673a 3c2f 703e e following:

│ │ │ -0014e610: 0a3c 7461 626c 6520 636c 6173 733d 226d ..< │ │ │ -0014e630: 7472 2063 6c61 7373 3d22 6d61 726b 646f tr class="markdo │ │ │ -0014e640: 776e 5461 626c 6548 6561 6422 3e0a 3c74 wnTableHead">. │ │ │ -0014e670: 7072 6f70 6572 7479 2020 203c 2f74 683e property │ │ │ -0014e680: 3c74 6820 636c 6173 733d 226d 6172 6b64 │ │ │ -0014e6b0: 3c2f 7472 3e0a 3c74 7220 636c 6173 733d ...........< │ │ │ -0014ead0: 7472 2063 6c61 7373 3d22 6d61 726b 646f tr class="markdo │ │ │ -0014eae0: 776e 5461 626c 6552 6f77 4576 656e 223e wnTableRowEven"> │ │ │ -0014eaf0: 0a3c 7464 2063 6c61 7373 3d22 6d61 726b . │ │ │ -0014eb30: 3c74 6420 636c 6173 733d 226d 6172 6b64 ....... │ │ │ -0014ee30: 3c74 7220 636c 6173 733d 226d 6172 6b64 ... │ │ │ -0014ef30: 3c63 6f64 653e 7472 616e 7370 6f72 743c transport< │ │ │ -0014ef40: 2f63 6f64 653e 2020 203c 2f74 643e 3c74 /code> │ │ │ -0014ef70: 5552 4920 6465 636c 6172 6174 696f 6e20 URI declaration │ │ │ -0014ef80: 6f66 2074 6865 2074 7261 6e73 706f 7274 of the transport │ │ │ -0014ef90: 2c20 7573 7561 6c6c 7920 3c63 6f64 653e , usually │ │ │ -0014efa0: 3c61 2068 7265 663d 2268 7474 703a 2f2f h │ │ │ -0014efd0: 7474 703a 2f2f 7363 6865 6d61 732e 786d ttp://schemas.xm │ │ │ -0014efe0: 6c73 6f61 702e 6f72 672f 736f 6170 2f68 lsoap.org/soap/h │ │ │ -0014eff0: 7474 703c 2f61 3e3c 2f63 6f64 653e 2020 ttp │ │ │ -0014f000: 2020 3c2f 7464 3e3c 2f74 723e 0a3c 7472 ..< │ │ │ -0014f030: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ -0014f040: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ -0014f050: 3e3c 636f 6465 3e64 6566 696e 6974 696f >definitio │ │ │ -0014f060: 6e73 3c2f 636f 6465 3e20 2020 3c2f 7464 ns .. │ │ │ -0014f120: 3c74 6420 636c 6173 733d 226d 6172 6b64 │ │ │ -0014f190: 3c2f 7472 3e0a 3c74 7220 636c 6173 733d ...< │ │ │ -0014f290: 7472 2063 6c61 7373 3d22 6d61 726b 646f tr class="markdo │ │ │ -0014f2a0: 776e 5461 626c 6552 6f77 4f64 6422 3e0a wnTableRowOdd">. │ │ │ -0014f2b0: 3c74 6420 636c 6173 733d 226d 6172 6b64 │ │ │ -0014f2f0: 3c74 6420 636c 6173 733d 226d 6172 6b64 ........

The ser │ │ │ -0014f600: 7669 6365 203c 636f 6465 3e6e 616d 653c vice name< │ │ │ -0014f610: 2f63 6f64 653e 2061 6e64 203c 636f 6465 /code> and namespace properties are │ │ │ -0014f640: 2072 6571 7569 7265 6420 696e 206f 7264 required in ord │ │ │ -0014f650: 6572 2074 6f20 6765 6e65 7261 7465 2061 er to generate a │ │ │ -0014f660: 2076 616c 6964 2057 5344 4c20 7769 7468 valid WSDL with │ │ │ -0014f670: 2073 6f61 7063 7070 322e 2054 6865 206f soapcpp2. The o │ │ │ -0014f680: 7468 6572 2070 726f 7065 7274 6965 7320 ther properties │ │ │ -0014f690: 6172 6520 6f70 7469 6f6e 616c 2e3c 2f70 are optional.

.

The s │ │ │ -0014f6b0: 7479 6c65 3c2f 636f 6465 3e20 616e 6420 tyle and │ │ │ -0014f6c0: 3c63 6f64 653e 656e 636f 6469 6e67 3c2f encoding property d │ │ │ -0014f6e0: 6566 6175 6c74 7320 6172 6520 6368 616e efaults are chan │ │ │ -0014f6f0: 6765 6420 7769 7468 203c 623e 3c63 6f64 ged with soapcpp2 -e option │ │ │ -0014f720: 3c62 3e3c 636f 6465 3e2d 653c 2f63 6f64 -e to │ │ │ -0014f740: 7270 633c 2f63 6f64 653e 2061 6e64 203c rpc and < │ │ │ -0014f750: 636f 6465 3e65 6e63 6f64 6564 3c2f 636f code>encoded.

.

You │ │ │ -0014f770: 6361 6e20 6f76 6572 7269 6465 2074 6865 can override the │ │ │ -0014f780: 203c 636f 6465 3e70 6f72 743c 2f63 6f64 port endpoint URL │ │ │ -0014f7a0: 6174 2072 756e 7469 6d65 2069 6e20 7468 at runtime in th │ │ │ -0014f7b0: 6520 6175 746f 2d67 656e 6572 6174 6564 e auto-generated │ │ │ -0014f7c0: 203c 636f 6465 3e73 6f61 705f 6361 6c6c soap_call │ │ │ -0014f7d0: 5f70 7265 6669 785f 5f66 756e 633c 2f63 _prefix__func service cal │ │ │ -0014f7f0: 6c20 2843 2f43 2b2b 2063 6c69 656e 7420 l (C/C++ client │ │ │ -0014f800: 7369 6465 2920 616e 6420 696e 2074 6865 side) and in the │ │ │ -0014f810: 2043 2b2b 2070 726f 7879 2063 6c61 7373 C++ proxy class │ │ │ -0014f820: 2073 6572 7669 6365 2063 616c 6c2e 3c2f service call..

Protocol p │ │ │ -0014f840: 726f 7065 7274 7920 7661 6c75 6573 2061 roperty values a │ │ │ -0014f850: 7265 3a3c 2f70 3e0a 3c74 6162 6c65 2063 re:

.
value
n │ │ │ -0014e700: 616d 653c 2f63 6f64 653e 2020 203c 2f74 ame name of the │ │ │ -0014e740: 7365 7276 6963 652c 206f 7074 696f 6e61 service, optiona │ │ │ -0014e750: 6c6c 7920 666f 6c6c 6f77 6564 2062 7920 lly followed by │ │ │ -0014e760: 7465 7874 2064 6573 6372 6962 696e 6720 text describing │ │ │ -0014e770: 7468 6520 7365 7276 6963 6520 2020 203c the service < │ │ │ -0014e780: 2f74 643e 3c2f 7472 3e0a 3c74 7220 636c /td>
namespace UR │ │ │ -0014e810: 4920 6f66 2074 6865 2057 5344 4c20 7461 I of the WSDL ta │ │ │ -0014e820: 7267 6574 4e61 6d65 7370 6163 6520 2020 rgetNamespace │ │ │ -0014e830: 203c 2f74 643e 3c2f 7472 3e0a 3c74 7220
< │ │ │ -0014e880: 636f 6465 3e64 6f63 756d 656e 7461 7469 code>documentati │ │ │ -0014e890: 6f6e 3c2f 636f 6465 3e20 2020 3c2f 7464 on text describi │ │ │ -0014e8d0: 6e67 2074 6865 2073 6572 7669 6365 2028 ng the service ( │ │ │ -0014e8e0: 7365 6520 616c 736f 2074 6865 203c 636f see also the name p │ │ │ -0014e900: 726f 7065 7274 7929 2c20 6d75 6c74 6970 roperty), multip │ │ │ -0014e910: 6c65 2070 6572 6d69 7474 6564 2020 2020 le permitted │ │ │ -0014e920: 3c2f 7464 3e3c 2f74 723e 0a3c 7472 2063
< │ │ │ -0014e970: 636f 6465 3e64 6f63 3c2f 636f 6465 3e20 code>doc │ │ │ -0014e980: 2020 3c2f 7464 3e3c 7464 2063 6c61 7373 an alia │ │ │ -0014e9b0: 7320 666f 7220 7468 6520 3c63 6f64 653e s for the │ │ │ -0014e9c0: 646f 6375 6d65 6e74 6174 696f 6e3c 2f63 documentation property │ │ │ -0014e9e0: 203c 2f74 643e 3c2f 7472 3e0a 3c74 7220
< │ │ │ -0014ea30: 636f 6465 3e73 7479 6c65 3c2f 636f 6465 code>style document │ │ │ -0014ea80: 2028 6465 6661 756c 7429 2053 4f41 5020 (default) SOAP │ │ │ -0014ea90: 6d65 7373 6167 696e 6720 7374 796c 6520 messaging style │ │ │ -0014eaa0: 6f72 203c 636f 6465 3e72 7063 3c2f 636f or rpc for SOAP RPC │ │ │ -0014eac0: 2020 2020 3c2f 7464 3e3c 2f74 723e 0a3c
encodin │ │ │ -0014eb20: 673c 2f63 6f64 653e 2020 203c 2f74 643e g literal< │ │ │ -0014eb60: 2f63 6f64 653e 2028 6465 6661 756c 7429 /code> (default) │ │ │ -0014eb70: 2c20 3c63 6f64 653e 656e 636f 6465 643c , encoded< │ │ │ -0014eb80: 2f63 6f64 653e 2066 6f72 2053 4f41 5020 /code> for SOAP │ │ │ -0014eb90: 656e 636f 6469 6e67 2c20 6f72 2061 2063 encoding, or a c │ │ │ -0014eba0: 7573 746f 6d20 5552 4920 2020 203c 2f74 ustom URI
protocol │ │ │ -0014ec10: 2020 203c 2f74 643e 3c74 6420 636c 6173 specif │ │ │ -0014ec40: 6965 7320 534f 4150 206f 7220 5245 5354 ies SOAP or REST │ │ │ -0014ec50: 2c20 7365 6520 6265 6c6f 7720 2020 203c , see below < │ │ │ -0014ec60: 2f74 643e 3c2f 7472 3e0a 3c74 7220 636c /td>
port │ │ │ -0014ecc0: 2020 3c2f 7464 3e3c 7464 2063 6c61 7373 URL of │ │ │ -0014ecf0: 7468 6520 7365 7276 6963 6520 656e 6470 the service endp │ │ │ -0014ed00: 6f69 6e74 2c20 7573 7561 6c6c 7920 616e oint, usually an │ │ │ -0014ed10: 2068 7474 7020 6f72 2068 7474 7073 2061 http or https a │ │ │ -0014ed20: 6464 7265 7373 2c20 746f 2075 7365 2069 ddress, to use i │ │ │ -0014ed30: 6e20 7468 6520 5753 444c 2064 6566 696e n the WSDL defin │ │ │ -0014ed40: 6974 696f 6e73 2f73 6572 7669 6365 2f70 itions/service/p │ │ │ -0014ed50: 6f72 742f 6164 6472 6573 732f 406c 6f63 ort/address/@loc │ │ │ -0014ed60: 6174 696f 6e20 2020 203c 2f74 643e 3c2f ation
loc │ │ │ -0014edc0: 6174 696f 6e3c 2f63 6f64 653e 2020 203c ation < │ │ │ -0014edd0: 2f74 643e 3c74 6420 636c 6173 733d 226d /td>an alias f │ │ │ -0014ee00: 6f72 2074 6865 203c 636f 6465 3e70 6f72 or the por │ │ │ -0014ee10: 743c 2f63 6f64 653e 2070 726f 7065 7274 t propert │ │ │ -0014ee20: 7920 2020 203c 2f74 643e 3c2f 7472 3e0a y
endpoi │ │ │ -0014ee80: 6e74 3c2f 636f 6465 3e20 2020 3c2f 7464 nt an alias for │ │ │ -0014eec0: 7468 6520 3c63 6f64 653e 706f 7274 3c2f the port property │ │ │ -0014eee0: 2020 3c2f 7464 3e3c 2f74 723e 0a3c 7472
name of the W │ │ │ -0014f0a0: 5344 4c20 6465 6669 6e69 7469 6f6e 732f SDL definitions/ │ │ │ -0014f0b0: 406e 616d 6520 2020 203c 2f74 643e 3c2f @name
typ │ │ │ -0014f110: 653c 2f63 6f64 653e 2020 203c 2f74 643e e name of the WS │ │ │ -0014f150: 444c 2064 6566 696e 6974 696f 6e73 2f70 DL definitions/p │ │ │ -0014f160: 6f72 7454 7970 652f 406e 616d 6520 2857 ortType/@name (W │ │ │ -0014f170: 5344 4c32 2e30 2069 6e74 6572 6661 6365 SDL2.0 interface │ │ │ -0014f180: 2f40 6e61 6d65 2920 2020 203c 2f74 643e /@name)
│ │ │ -0014f1e0: 706f 7274 5479 7065 3c2f 636f 6465 3e20 portType │ │ │ -0014f1f0: 2020 3c2f 7464 3e3c 7464 2063 6c61 7373 an alia │ │ │ -0014f220: 7320 666f 7220 7468 6520 3c63 6f64 653e s for the │ │ │ -0014f230: 7479 7065 3c2f 636f 6465 3e20 7072 6f70 type prop │ │ │ -0014f240: 6572 7479 2028 3c63 6f64 653e 706f 7274 erty (port │ │ │ -0014f250: 5479 7065 3c2f 636f 6465 3e20 666f 6c6c Type foll │ │ │ -0014f260: 6f77 7320 534f 4150 2031 2e31 206e 616d ows SOAP 1.1 nam │ │ │ -0014f270: 696e 6720 636f 6e76 656e 7469 6f6e 7329 ing conventions) │ │ │ -0014f280: 2020 2020 3c2f 7464 3e3c 2f74 723e 0a3c
interfac │ │ │ -0014f2e0: 653c 2f63 6f64 653e 2020 203c 2f74 643e e an alias for t │ │ │ -0014f320: 6865 203c 636f 6465 3e74 7970 653c 2f63 he type property (< │ │ │ -0014f340: 636f 6465 3e69 6e74 6572 6661 6365 3c2f code>interface follows SO │ │ │ -0014f360: 4150 2031 2e32 206e 616d 696e 6720 636f AP 1.2 naming co │ │ │ -0014f370: 6e76 656e 7469 6f6e 7329 2020 2020 3c2f nventions)
binding name │ │ │ -0014f410: 6f66 2074 6865 2057 5344 4c20 6465 6669 of the WSDL defi │ │ │ -0014f420: 6e69 7469 6f6e 732f 6269 6e64 696e 672f nitions/binding/ │ │ │ -0014f430: 406e 616d 6520 2020 203c 2f74 643e 3c2f @name
por │ │ │ -0014f490: 744e 616d 653c 2f63 6f64 653e 2020 203c tName < │ │ │ -0014f4a0: 2f74 643e 3c74 6420 636c 6173 733d 226d /td>name of th │ │ │ -0014f4d0: 6520 5753 444c 2064 6566 696e 6974 696f e WSDL definitio │ │ │ -0014f4e0: 6e73 2f73 6572 7669 6365 2f70 6f72 742f ns/service/port/ │ │ │ -0014f4f0: 406e 616d 6520 2020 203c 2f74 643e 3c2f @name
ex │ │ │ -0014f550: 6563 7574 6162 6c65 3c2f 636f 6465 3e20 ecutable │ │ │ -0014f560: 2020 3c2f 7464 3e3c 7464 2063 6c61 7373 name of │ │ │ -0014f590: 2074 6865 2022 6578 6563 7574 6162 6c65 the "executable │ │ │ -0014f5a0: 2220 746f 2075 7365 2069 6e20 7468 6520 " to use in the │ │ │ -0014f5b0: 5753 444c 2064 6566 696e 6974 696f 6e73 WSDL definitions │ │ │ -0014f5c0: 2f73 6572 7669 6365 2f70 6f72 742f 6164 /service/port/ad │ │ │ -0014f5d0: 6472 6573 732f 406c 6f63 6174 696f 6e20 dress/@location │ │ │ -0014f5e0: 2020 3c2f 7464 3e3c 2f74 723e 0a3c 2f74
.... │ │ │ -0014f9c0: 3c2f 7472 3e0a 3c74 7220 636c 6173 733d .... │ │ │ -0014fb50: 0a3c 7472 2063 6c61 7373 3d22 6d61 726b ...... │ │ │ -0014fd40: 6f6e 652d 7761 7920 534f 4150 2031 2e32 one-way SOAP 1.2 │ │ │ -0014fd50: 2077 6974 6820 4854 5450 2047 4554 2020 with HTTP GET │ │ │ -0014fd60: 2020 3c2f 7464 3e3c 2f74 723e 0a3c 7472 .. │ │ │ -0014fdb0: 3c63 6f64 653e 4854 5450 3c2f 636f 6465 HTTP ....< │ │ │ -0014ff10: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ -0014ff20: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ -0014ff30: 3e3c 636f 6465 3e47 4554 3c2f 636f 6465 >GET .. │ │ │ -0014ffc0: 3c74 6420 636c 6173 733d 226d 6172 6b64 .< │ │ │ -00150050: 7472 2063 6c61 7373 3d22 6d61 726b 646f tr class="markdo │ │ │ -00150060: 776e 5461 626c 6552 6f77 4f64 6422 3e0a wnTableRowOdd">. │ │ │ -00150070: 3c74 6420 636c 6173 733d 226d 6172 6b64 .
protocol │ │ │ -0014f8c0: 7661 6c75 6520 2020 3c2f 7468 3e3c 7468 value d │ │ │ -0014f8f0: 6573 6372 6970 7469 6f6e 2020 2020 3c2f escription
SOAP │ │ │ -0014f960: 3c2f 7464 3e3c 7464 2063 6c61 7373 3d22 SOAP tran │ │ │ -0014f990: 7370 6f72 742c 2073 7570 706f 7274 696e sport, supportin │ │ │ -0014f9a0: 6720 626f 7468 2053 4f41 5020 312e 3120 g both SOAP 1.1 │ │ │ -0014f9b0: 616e 6420 312e 3220 2020 203c 2f74 643e and 1.2
│ │ │ -0014fa10: 534f 4150 312e 313c 2f63 6f64 653e 2020 SOAP1.1 │ │ │ -0014fa20: 203c 2f74 643e 3c74 6420 636c 6173 733d SOAP 1.1 │ │ │ -0014fa50: 2074 7261 6e73 706f 7274 2028 7361 6d65 transport (same │ │ │ -0014fa60: 2061 7320 3c63 6f64 653e 736f 6170 6370 as soapcp │ │ │ -0014fa70: 7032 202d 313c 2f63 6f64 653e 2920 2020 p2 -1) │ │ │ -0014fa80: 203c 2f74 643e 3c2f 7472 3e0a 3c74 7220
< │ │ │ -0014fad0: 636f 6465 3e53 4f41 5031 2e32 3c2f 636f code>SOAP1.2 SOA │ │ │ -0014fb10: 5020 312e 3220 7472 616e 7370 6f72 7420 P 1.2 transport │ │ │ -0014fb20: 2873 616d 6520 6173 203c 636f 6465 3e73 (same as s │ │ │ -0014fb30: 6f61 7063 7070 3220 2d32 3c2f 636f 6465 oapcpp2 -2)
SOAP- │ │ │ -0014fba0: 4745 543c 2f63 6f64 653e 2020 203c 2f74 GET one-way SOAP │ │ │ -0014fbe0: 2031 2e31 206f 7220 312e 3220 7769 7468 1.1 or 1.2 with │ │ │ -0014fbf0: 2048 5454 5020 4745 5420 2020 203c 2f74 HTTP GET
SOAP1.1-GET one │ │ │ -0014fc90: 2d77 6179 2053 4f41 5020 312e 3120 7769 -way SOAP 1.1 wi │ │ │ -0014fca0: 7468 2048 5454 5020 4745 5420 2020 203c th HTTP GET < │ │ │ -0014fcb0: 2f74 643e 3c2f 7472 3e0a 3c74 7220 636c /td>
SOAP1.2-GET< │ │ │ -0014fd10: 2f63 6f64 653e 2020 203c 2f74 643e 3c74 /code>
an al │ │ │ -0014fdf0: 6961 7320 666f 7220 3c63 6f64 653e 504f ias for PO │ │ │ -0014fe00: 5354 3c2f 636f 6465 3e20 2873 616d 6520 ST (same │ │ │ -0014fe10: 6173 203c 636f 6465 3e73 6f61 7063 7070 as soapcpp │ │ │ -0014fe20: 3220 2d30 3c2f 636f 6465 3e29 2020 2020 2 -0) │ │ │ -0014fe30: 3c2f 7464 3e3c 2f74 723e 0a3c 7472 2063
< │ │ │ -0014fe80: 636f 6465 3e50 4f53 543c 2f63 6f64 653e code>POST │ │ │ -0014fe90: 2020 203c 2f74 643e 3c74 6420 636c 6173 non-SO │ │ │ -0014fec0: 4150 2052 4553 5420 7072 6f74 6f63 6f6c AP REST protocol │ │ │ -0014fed0: 2077 6974 6820 4854 5450 2050 4f53 5420 with HTTP POST │ │ │ -0014fee0: 2020 203c 2f74 643e 3c2f 7472 3e0a 3c74
non-S │ │ │ -0014ff70: 4f41 5020 5245 5354 2070 726f 746f 636f OAP REST protoco │ │ │ -0014ff80: 6c20 7769 7468 2048 5454 5020 4745 5420 l with HTTP GET │ │ │ -0014ff90: 2020 203c 2f74 643e 3c2f 7472 3e0a 3c74
PUT non- │ │ │ -00150020: 534f 4150 2052 4553 5420 7072 6f74 6f63 SOAP REST protoc │ │ │ -00150030: 6f6c 2077 6974 6820 4854 5450 2050 5554 ol with HTTP PUT │ │ │ -00150040: 2020 2020 3c2f 7464 3e3c 2f74 723e 0a3c
DELETE n │ │ │ -001500d0: 6f6e 2d53 4f41 5020 5245 5354 2070 726f on-SOAP REST pro │ │ │ -001500e0: 746f 636f 6c20 7769 7468 2048 5454 5020 tocol with HTTP │ │ │ -001500f0: 4445 4c45 5445 2020 203c 2f74 643e 3c2f DELETE
.

│ │ │ -00150110: 5468 6520 3c63 6f64 653e 7072 6f74 6f63 The protoc │ │ │ -00150120: 6f6c 3c2f 636f 6465 3e20 7072 6f70 6572 ol proper │ │ │ -00150130: 7479 2069 7320 3c63 6f64 653e 534f 4150 ty is SOAP │ │ │ -00150140: 3c2f 636f 6465 3e20 6279 2064 6566 6175 by defau │ │ │ -00150150: 6c74 2e20 5468 6520 6465 6661 756c 7420 lt. The default │ │ │ -00150160: 6973 2063 6861 6e67 6564 2077 6974 6820 is changed with │ │ │ -00150170: 3c62 3e3c 636f 6465 3e73 6f61 7063 7070 soapcpp │ │ │ -00150180: 3220 2d31 3c2f 636f 6465 3e3c 2f62 3e20 2 -1 │ │ │ -00150190: 6f70 7469 6f6e 203c 623e 3c63 6f64 653e option │ │ │ -001501a0: 2d31 3c2f 636f 6465 3e3c 2f62 3e20 746f -1 to │ │ │ -001501b0: 2053 4f41 5020 312e 312c 203c 623e 3c63 SOAP 1.1, soapcpp2 -2< │ │ │ -001501d0: 2f63 6f64 653e 3c2f 623e 206f 7074 696f /code> optio │ │ │ -001501e0: 6e20 3c62 3e3c 636f 6465 3e2d 323c 2f63 n -2 to SOAP │ │ │ -00150200: 2031 2e32 2c20 616e 6420 6e6f 6e2d 534f 1.2, and non-SO │ │ │ -00150210: 4150 2052 4553 5420 7769 7468 203c 623e AP REST with │ │ │ -00150220: 3c63 6f64 653e 736f 6170 6370 7032 202d soapcpp2 - │ │ │ -00150230: 303c 2f63 6f64 653e 3c2f 623e 206f 7074 0 opt │ │ │ -00150240: 696f 6e20 3c62 3e3c 636f 6465 3e2d 303c ion -0< │ │ │ -00150250: 2f63 6f64 653e 3c2f 623e 3c2f 703e 0a3c /code>

.< │ │ │ -00150260: 703e 5468 6520 3c63 6f64 653e 4745 543c p>The GET< │ │ │ -00150270: 2f63 6f64 653e 2070 726f 746f 636f 6c73 /code> protocols │ │ │ -00150280: 2066 6f72 2053 4f41 5020 616e 6420 5245 for SOAP and RE │ │ │ -00150290: 5354 2072 6571 7569 7265 2074 6861 7420 ST require that │ │ │ -001502a0: 7468 6520 7365 7276 6963 6520 6f70 6572 the service oper │ │ │ -001502b0: 6174 696f 6e73 206f 6e6c 7920 7573 6520 ations only use │ │ │ -001502c0: 7072 696d 6974 6976 6520 7479 7065 7320 primitive types │ │ │ -001502d0: 7769 7468 2074 6865 6972 2069 6e70 7574 with their input │ │ │ -001502e0: 2070 6172 616d 6574 6572 732c 2062 6563 parameters, bec │ │ │ -001502f0: 6175 7365 2074 6865 7365 2070 6172 616d ause these param │ │ │ -00150300: 6574 6572 7320 6172 6520 656e 636f 6465 eters are encode │ │ │ -00150310: 6420 7769 7468 2074 6865 2055 524c 2061 d with the URL a │ │ │ -00150320: 7320 5552 4c20 7175 6572 7920 7661 6c75 s URL query valu │ │ │ -00150330: 6573 2e3c 2f70 3e0a 3c70 3e54 6f20 6c65 es.

.

To le │ │ │ -00150340: 7420 6469 7265 6374 6976 6573 2074 616b t directives tak │ │ │ -00150350: 6520 6566 6665 6374 2077 6974 6820 7365 e effect with se │ │ │ -00150360: 7276 6963 6520 6f70 6572 6174 696f 6e73 rvice operations │ │ │ -00150370: 2c20 796f 7520 7368 6f75 6c64 2062 696e , you should bin │ │ │ -00150380: 6420 7468 6520 7365 7276 6963 6520 6f70 d the service op │ │ │ -00150390: 6572 6174 696f 6e73 2074 6f20 7468 6520 erations to the │ │ │ -001503a0: 5753 444c 206e 616d 6573 7061 6365 206f WSDL namespace o │ │ │ -001503b0: 6620 6120 7365 7276 6963 6520 6279 2075 f a service by u │ │ │ -001503c0: 7369 6e67 2074 6865 206e 616d 6573 7061 sing the namespa │ │ │ -001503d0: 6365 2070 7265 6669 7820 6173 2070 6172 ce prefix as par │ │ │ -001503e0: 7420 6f66 2074 6865 2069 6465 6e74 6966 t of the identif │ │ │ -001503f0: 6965 7220 6e61 6d65 206f 6620 7468 6520 ier name of the │ │ │ -00150400: 6675 6e63 7469 6f6e 2074 6861 7420 6465 function that de │ │ │ -00150410: 6669 6e65 7320 7468 6520 7365 7276 6963 fines the servic │ │ │ -00150420: 6520 6f70 6572 6174 696f 6e3a 3c2f 703e e operation:

│ │ │ -00150430: 0a3c 6469 7620 636c 6173 733d 2266 7261 .
int pr │ │ │ -00150480: 6566 6978 5f5f 6675 6e63 2861 7267 312c efix__func(arg1, │ │ │ -00150490: 2061 7267 322c 202e 2e2e 2c20 6172 676e arg2, ..., argn │ │ │ -001504a0: 2c20 7265 7375 6c74 293b 3c2f 6469 763e , result);
│ │ │ -001504b0: 0a3c 2f64 6976 3e3c 212d 2d20 6672 6167 .

where │ │ │ -001504d0: 203c 636f 6465 3e70 7265 6669 783c 2f63 prefix can now be │ │ │ -001504f0: 7573 6564 2074 6f20 6c65 7420 6469 7265 used to let dire │ │ │ -00150500: 6374 6976 6573 2074 616b 6520 6566 6665 ctives take effe │ │ │ -00150510: 6374 206f 6e20 7468 6973 2073 6572 7669 ct on this servi │ │ │ -00150520: 6365 206f 7065 7261 7469 6f6e 2e3c 2f70 ce operation.

.

.... Back to ta │ │ │ -00150550: 626c 6520 6f66 2063 6f6e 7465 6e74 733c ble of contents< │ │ │ -00150560: 2f61 3e3c 2f70 3e0a 3c68 333e 3c61 2063 /a>

.

│ │ │ -00150590: 3c2f 613e 0a53 6572 7669 6365 206d 6574 .Service met │ │ │ -001505a0: 686f 6420 6469 7265 6374 6976 6573 3c2f hod directives.

Service p │ │ │ -001505c0: 726f 7065 7274 6965 7320 6172 6520 6170 roperties are ap │ │ │ -001505d0: 706c 6963 6162 6c65 2074 6f20 6120 7365 plicable to a se │ │ │ -001505e0: 7276 6963 6520 616e 6420 746f 2061 6c6c rvice and to all │ │ │ -001505f0: 206f 6620 6974 7320 6f70 6572 6174 696f of its operatio │ │ │ -00150600: 6e73 2e20 5365 7276 6963 6520 6d65 7468 ns. Service meth │ │ │ -00150610: 6f64 2064 6972 6563 7469 7665 7320 6172 od directives ar │ │ │ -00150620: 6520 7370 6563 6966 6963 616c 6c79 2061 e specifically a │ │ │ -00150630: 7070 6c69 6361 626c 6520 746f 2061 2073 pplicable to a s │ │ │ -00150640: 6572 7669 6365 206f 7065 7261 7469 6f6e ervice operation │ │ │ -00150650: 2e3c 2f70 3e0a 3c70 3e41 2073 6572 7669 .

.

A servi │ │ │ -00150660: 6365 206d 6574 686f 6420 6469 7265 6374 ce method direct │ │ │ -00150670: 6976 6520 6973 206f 6620 7468 6520 666f ive is of the fo │ │ │ -00150680: 726d 3a3c 2f70 3e0a 3c64 6976 2063 6c61 rm:

.
│ │ │ -001506b0: 3c73 7061 6e20 636c 6173 733d 2263 6f6d //gsoap &l │ │ │ -001506d0: 743b 7072 6566 6978 2667 743b 2073 6572 t;prefix> ser │ │ │ -001506e0: 7669 6365 206d 6574 686f 642d 266c 743b vice method-< │ │ │ -001506f0: 7072 6f70 6572 7479 2667 743b 3a20 266c property>: &l │ │ │ -00150700: 743b 6d65 7468 6f64 2667 743b 2026 6c74 t;method> < │ │ │ -00150710: 3b76 616c 7565 2667 743b 3c2f 7370 616e ;value>
.

< │ │ │ -00150740: 703e 7768 6572 6520 3c63 6f64 653e 266c p>where &l │ │ │ -00150750: 743b 7072 6566 6978 2667 743b 3c2f 636f t;prefix> is the XML n │ │ │ -00150770: 616d 6573 7061 6365 2070 7265 6669 7820 amespace prefix │ │ │ -00150780: 6f66 2061 2073 6572 7669 6365 2062 696e of a service bin │ │ │ -00150790: 6469 6e67 2061 6e64 203c 636f 6465 3e26 ding and & │ │ │ -001507a0: 6c74 3b6d 6574 686f 6426 6774 3b3c 2f63 lt;method> is the unqu │ │ │ -001507c0: 616c 6966 6965 6420 6e61 6d65 206f 6620 alified name of │ │ │ -001507d0: 6120 7365 7276 6963 6520 6f70 6572 6174 a service operat │ │ │ -001507e0: 696f 6e2e 2054 6865 203c 636f 6465 3e26 ion. The & │ │ │ -001507f0: 6c74 3b70 726f 7065 7274 7926 6774 3b3c lt;property>< │ │ │ -00150800: 2f63 6f64 653e 2061 6e64 203c 636f 6465 /code> and <value> fields are │ │ │ -00150830: 206f 6e65 206f 6620 7468 6520 666f 6c6c one of the foll │ │ │ -00150840: 6f77 696e 673a 3c2f 703e 0a3c 7461 626c owing:

...method │ │ │ -001508b0: 2070 726f 7065 7274 7920 2020 3c2f 7468 property value .. │ │ │ -00150940: 6d65 7468 6f64 2d64 6f63 756d 656e 7461 method-documenta │ │ │ -00150950: 7469 6f6e 3c2f 636f 6465 3e20 2020 3c2f tion text descri │ │ │ -00150990: 6269 6e67 2074 6865 2073 6572 7669 6365 bing the service │ │ │ -001509a0: 206f 7065 7261 7469 6f6e 2020 2020 3c2f operation ..method
│ │ │ -00150a10: 2020 203c 2f74 643e 3c74 6420 636c 6173 same a │ │ │ -00150a40: 7320 6162 6f76 652c 2073 686f 7274 6861 s above, shortha │ │ │ -00150a50: 6e64 2066 6f72 6d20 2020 203c 2f74 643e nd form │ │ │ -00150a60: 3c2f 7472 3e0a 3c74 7220 636c 6173 733d ..m │ │ │ -00150ab0: 6574 686f 642d 6163 7469 6f6e 3c2f 636f ethod-action "" or │ │ │ -00150b00: 5552 4920 534f 4150 4163 7469 6f6e 2048 URI SOAPAction H │ │ │ -00150b10: 5454 5020 6865 6164 6572 2c20 6f72 2055 TTP header, or U │ │ │ -00150b20: 524c 2071 7565 7279 2073 7472 696e 6720 RL query string │ │ │ -00150b30: 666f 7220 5245 5354 2070 726f 746f 636f for REST protoco │ │ │ -00150b40: 6c73 2020 2020 3c2f 7464 3e3c 2f74 723e ls │ │ │ -00150b50: 0a3c 7472 2063 6c61 7373 3d22 6d61 726b ..metho │ │ │ -00150ba0: 642d 696e 7075 742d 6163 7469 6f6e 3c2f d-input-action < │ │ │ -00150be0: 636f 6465 3e22 223c 2f63 6f64 653e 206f code>"" o │ │ │ -00150bf0: 7220 5552 4920 534f 4150 4163 7469 6f6e r URI SOAPAction │ │ │ -00150c00: 2048 5454 5020 6865 6164 6572 206f 6620 HTTP header of │ │ │ -00150c10: 7365 7276 6963 6520 7265 7175 6573 7420 service request │ │ │ -00150c20: 6d65 7373 6167 6573 2020 2020 3c2f 7464 messages .. │ │ │ -00150c80: 6d65 7468 6f64 2d6f 7574 7075 742d 6163 method-output-ac │ │ │ -00150c90: 7469 6f6e 3c2f 636f 6465 3e20 2020 3c2f tion "" or URI SOAP │ │ │ -00150ce0: 4163 7469 6f6e 2048 5454 5020 6865 6164 Action HTTP head │ │ │ -00150cf0: 6572 206f 6620 7365 7276 6963 6520 7265 er of service re │ │ │ -00150d00: 7370 6f6e 7365 206d 6573 7361 6765 7320 sponse messages │ │ │ -00150d10: 2020 203c 2f74 643e 3c2f 7472 3e0a 3c74 .. │ │ │ -00150d40: 3c74 6420 636c 6173 733d 226d 6172 6b64 method-f │ │ │ -00150d70: 6175 6c74 2d61 6374 696f 6e3c 2f63 6f64 ault-action "" or U │ │ │ -00150dc0: 5249 2053 4f41 5041 6374 696f 6e20 4854 RI SOAPAction HT │ │ │ -00150dd0: 5450 2068 6561 6465 7220 6f66 2073 6572 TP header of ser │ │ │ -00150de0: 7669 6365 2066 6175 6c74 206d 6573 7361 vice fault messa │ │ │ -00150df0: 6765 7320 2020 203c 2f74 643e 3c2f 7472 ges ..metho │ │ │ -00150e50: 642d 6865 6164 6572 2d70 6172 743c 2f63 d-header-part me │ │ │ -00150e90: 6d62 6572 206e 616d 6520 6f66 2074 6865 mber name of the │ │ │ -00150ea0: 203c 636f 6465 3e3c 6120 636c 6173 733d SOAP_ENV__Head │ │ │ -00150f10: 6572 3c2f 613e 3c2f 636f 6465 3e20 7374 er st │ │ │ -00150f20: 7275 6374 2075 7365 6420 696e 2053 4f41 ruct used in SOA │ │ │ -00150f30: 5020 4865 6164 6572 2020 2020 3c2f 7464 P Header ..method-input-he │ │ │ -00150fa0: 6164 6572 2d70 6172 743c 2f63 6f64 653e ader-part │ │ │ -00150fb0: 2020 203c 2f74 643e 3c74 6420 636c 6173 member │ │ │ -00150fe0: 206e 616d 6520 6f66 2074 6865 203c 636f name of the SO │ │ │ -00151050: 4150 5f45 4e56 5f5f 4865 6164 6572 3c2f AP_ENV__Header struct │ │ │ -00151070: 2075 7365 6420 696e 2053 4f41 5020 4865 used in SOAP He │ │ │ -00151080: 6164 6572 7320 6f66 2072 6571 7565 7374 aders of request │ │ │ -00151090: 7320 2020 203c 2f74 643e 3c2f 7472 3e0a s . │ │ │ -001510a0: 3c74 7220 636c 6173 733d 226d 6172 6b64 │ │ │ -001510c0: 0a3c 7464 2063 6c61 7373 3d22 6d61 726b .method- │ │ │ -001510f0: 6f75 7470 7574 2d68 6561 6465 722d 7061 output-header-pa │ │ │ -00151100: 7274 3c2f 636f 6465 3e20 2020 3c2f 7464 rt member name o │ │ │ -00151140: 6620 7468 6520 3c63 6f64 653e 3c61 2063 f the SOAP_ENV_ │ │ │ -001511b0: 5f48 6561 6465 723c 2f61 3e3c 2f63 6f64 _Header struct used i │ │ │ -001511d0: 6e20 534f 4150 2048 6561 6465 7273 206f n SOAP Headers o │ │ │ -001511e0: 6620 7265 7370 6f6e 7365 7320 2020 203c f responses < │ │ │ -001511f0: 2f74 643e 3c2f 7472 3e0a 3c74 7220 636c /td>..method-fault │ │ │ -00151250: 3c2f 636f 6465 3e20 2020 3c2f 7464 3e3c < │ │ │ -00151260: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ -00151270: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ -00151280: 3e74 7970 6520 6e61 6d65 206f 6620 6120 >type name of a │ │ │ -00151290: 7374 7275 6374 206f 7220 636c 6173 7320 struct or class │ │ │ -001512a0: 6d65 6d62 6572 2075 7365 6420 696e 203c member used in < │ │ │ -001512b0: 636f 6465 3e53 4f41 505f 454e 565f 5f44 code>SOAP_ENV__D │ │ │ -001512c0: 6574 6169 6c73 3c2f 636f 6465 3e20 7374 etails st │ │ │ -001512d0: 7275 6374 2020 2020 3c2f 7464 3e3c 2f74 ruct ..meth │ │ │ -00151330: 6f64 2d6d 696d 652d 7479 7065 3c2f 636f od-mime-type RES │ │ │ -00151370: 5420 636f 6e74 656e 7420 7479 7065 206f T content type o │ │ │ -00151380: 7220 534f 4150 204d 494d 4520 6174 7461 r SOAP MIME atta │ │ │ -00151390: 6368 6d65 6e74 2063 6f6e 7465 6e74 2074 chment content t │ │ │ -001513a0: 7970 6528 7329 2020 2020 3c2f 7464 3e3c ype(s) < │ │ │ -001513b0: 2f74 723e 0a3c 7472 2063 6c61 7373 3d22 /tr>..m │ │ │ -00151400: 6574 686f 642d 696e 7075 742d 6d69 6d65 ethod-input-mime │ │ │ -00151410: 2d74 7970 653c 2f63 6f64 653e 2020 203c -type < │ │ │ -00151420: 2f74 643e 3c74 6420 636c 6173 733d 226d /td>REST conte │ │ │ -00151450: 6e74 2074 7970 6520 6f72 2053 4f41 5020 nt type or SOAP │ │ │ -00151460: 4d49 4d45 2061 7474 6163 686d 656e 7420 MIME attachment │ │ │ -00151470: 636f 6e74 656e 7420 7479 7065 2873 2920 content type(s) │ │ │ -00151480: 6f66 2072 6571 7565 7374 206d 6573 7361 of request messa │ │ │ -00151490: 6765 2020 2020 3c2f 7464 3e3c 2f74 723e ge │ │ │ -001514a0: 0a3c 7472 2063 6c61 7373 3d22 6d61 726b ..method │ │ │ -001514f0: 2d6f 7574 7075 742d 6d69 6d65 2d74 7970 -output-mime-typ │ │ │ -00151500: 653c 2f63 6f64 653e 2020 203c 2f74 643e e │ │ │ -00151510: 3c74 6420 636c 6173 733d 226d 6172 6b64 REST content t │ │ │ -00151540: 7970 6520 6f72 2053 4f41 5020 4d49 4d45 ype or SOAP MIME │ │ │ -00151550: 2061 7474 6163 686d 656e 7420 636f 6e74 attachment cont │ │ │ -00151560: 656e 7420 7479 7065 2873 2920 6f66 2072 ent type(s) of r │ │ │ -00151570: 6573 706f 6e73 6520 6d65 7373 6167 6520 esponse message │ │ │ -00151580: 2020 203c 2f74 643e 3c2f 7472 3e0a 3c74 .. │ │ │ -001515b0: 3c74 6420 636c 6173 733d 226d 6172 6b64 method-s │ │ │ -001515e0: 7479 6c65 3c2f 636f 6465 3e20 2020 3c2f tyle docum │ │ │ -00151620: 656e 743c 2f63 6f64 653e 206f 7220 3c63 ent or rpc │ │ │ -00151640: 2020 3c2f 7464 3e3c 2f74 723e 0a3c 7472 .. │ │ │ -00151690: 3c63 6f64 653e 6d65 7468 6f64 2d65 6e63 method-enc │ │ │ -001516a0: 6f64 696e 673c 2f63 6f64 653e 2020 203c oding < │ │ │ -001516b0: 2f74 643e 3c74 6420 636c 6173 733d 226d /td>lite │ │ │ -001516e0: 7261 6c3c 2f63 6f64 653e 2c20 3c63 6f64 ral, encoded
│ │ │ -00151700: 2c20 6f72 2061 2063 7573 746f 6d20 5552 , or a custom UR │ │ │ -00151710: 4920 666f 7220 656e 636f 6469 6e67 5374 I for encodingSt │ │ │ -00151720: 796c 6520 6f66 206d 6573 7361 6765 7320 yle of messages │ │ │ -00151730: 2020 203c 2f74 643e 3c2f 7472 3e0a 3c74 .. │ │ │ -00151760: 3c74 6420 636c 6173 733d 226d 6172 6b64 method-r │ │ │ -00151790: 6573 706f 6e73 652d 656e 636f 6469 6e67 esponse-encoding │ │ │ -001517a0: 3c2f 636f 6465 3e20 2020 3c2f 7464 3e3c < │ │ │ -001517b0: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ -001517c0: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ -001517d0: 3e3c 636f 6465 3e6c 6974 6572 616c 3c2f >literal, enc │ │ │ -001517f0: 6f64 6564 3c2f 636f 6465 3e2c 206f 7220 oded, or │ │ │ -00151800: 6120 6375 7374 6f6d 2055 5249 2066 6f72 a custom URI for │ │ │ -00151810: 2065 6e63 6f64 696e 6753 7479 6c65 206f encodingStyle o │ │ │ -00151820: 6620 7265 7370 6f6e 7365 206d 6573 7361 f response messa │ │ │ -00151830: 6765 7320 2020 203c 2f74 643e 3c2f 7472 ges ..metho │ │ │ -00151890: 642d 7072 6f74 6f63 6f6c 3c2f 636f 6465 d-protocol SOAP │ │ │ -001518d0: 6f72 2052 4553 542c 2073 6565 203c 6120 or REST, see Servic │ │ │ -00151910: 6520 6469 7265 6374 6976 6573 3c2f 613e e directives │ │ │ -00151920: 2020 203c 2f74 643e 3c2f 7472 3e0a 3c2f ..

The method-heade │ │ │ -00151950: 722d 7061 7274 3c2f 636f 6465 3e20 7072 r-part pr │ │ │ -00151960: 6f70 6572 7469 6573 2063 616e 2062 6520 operties can be │ │ │ -00151970: 7265 7065 6174 6564 2066 6f72 2061 2073 repeated for a s │ │ │ -00151980: 6572 7669 6365 206f 7065 7261 7469 6f6e ervice operation │ │ │ -00151990: 2074 6f20 6465 636c 6172 6520 6d75 6c74 to declare mult │ │ │ -001519a0: 6970 6c65 2053 4f41 5020 4865 6164 6572 iple SOAP Header │ │ │ -001519b0: 2070 6172 7473 2074 6861 7420 7468 6520 parts that the │ │ │ -001519c0: 7365 7276 6963 6520 6f70 6572 6174 696f service operatio │ │ │ -001519d0: 6e20 7265 7175 6972 6573 2e20 596f 7520 n requires. You │ │ │ -001519e0: 6361 6e20 7573 6520 3c63 6f64 653e 6d65 can use me │ │ │ -001519f0: 7468 6f64 2d69 6e70 7574 2d68 6561 6465 thod-input-heade │ │ │ -00151a00: 722d 7061 7274 3c2f 636f 6465 3e20 616e r-part an │ │ │ -00151a10: 6420 3c63 6f64 653e 6d65 7468 6f64 2d6f d method-o │ │ │ -00151a20: 7574 7075 742d 6865 6164 6572 2d70 6172 utput-header-par │ │ │ -00151a30: 743c 2f63 6f64 653e 2074 6f20 6469 6666 t to diff │ │ │ -00151a40: 6572 656e 7469 6174 6520 6265 7477 6565 erentiate betwee │ │ │ -00151a50: 6e20 7265 7175 6573 7420 616e 6420 7265 n request and re │ │ │ -00151a60: 7370 6f6e 7365 206d 6573 7361 6765 732e sponse messages. │ │ │ -00151a70: 3c2f 703e 0a3c 703e 5468 6520 3c63 6f64

.

The method-fault property c │ │ │ -00151aa0: 616e 2062 6520 7265 7065 6174 6564 2066 an be repeated f │ │ │ -00151ab0: 6f72 2061 2073 6572 7669 6365 206f 7065 or a service ope │ │ │ -00151ac0: 7261 7469 6f6e 2074 6f20 6465 636c 6172 ration to declar │ │ │ -00151ad0: 6520 6d75 6c74 6970 6c65 2066 6175 6c74 e multiple fault │ │ │ -00151ae0: 7320 7468 6174 2074 6865 2073 6572 7669 s that the servi │ │ │ -00151af0: 6365 206f 7065 7261 7469 6f6e 206d 6179 ce operation may │ │ │ -00151b00: 2072 6574 7572 6e2e 3c2f 703e 0a3c 703e return.

.

│ │ │ -00151b10: 5468 6520 3c63 6f64 653e 6d65 7468 6f64 The method │ │ │ -00151b20: 2d61 6374 696f 6e3c 2f63 6f64 653e 2070 -action p │ │ │ -00151b30: 726f 7065 7274 7920 7365 7276 6573 2074 roperty serves t │ │ │ -00151b40: 776f 2070 7572 706f 7365 733a 3c2f 703e wo purposes:

│ │ │ -00151b50: 0a3c 6f6c 2074 7970 653d 2231 223e 0a3c .
    .< │ │ │ -00151b60: 6c69 3e54 6f20 7365 7420 7468 6520 534f li>To set the SO │ │ │ -00151b70: 4150 4163 7469 6f6e 2068 6561 6465 7220 APAction header │ │ │ -00151b80: 666f 7220 534f 4150 2070 726f 746f 636f for SOAP protoco │ │ │ -00151b90: 6c73 2c20 692e 652e 2073 6574 7320 7468 ls, i.e. sets th │ │ │ -00151ba0: 6520 6465 6669 6e69 7469 6f6e 732f 6269 e definitions/bi │ │ │ -00151bb0: 6e64 696e 672f 6f70 6572 6174 696f 6e2f nding/operation/ │ │ │ -00151bc0: 534f 4150 3a6f 7065 7261 7469 6f6e 2f40 SOAP:operation/@ │ │ │ -00151bd0: 736f 6170 4163 7469 6f6e 2e3c 2f6c 693e soapAction. │ │ │ -00151be0: 0a3c 6c69 3e54 6f20 7365 7420 7468 6520 .
  1. To set the │ │ │ -00151bf0: 5552 4c20 7175 6572 7920 7374 7269 6e67 URL query string │ │ │ -00151c00: 2066 6f72 2065 6e64 706f 696e 7473 2077 for endpoints w │ │ │ -00151c10: 6974 6820 5245 5354 2070 726f 746f 636f ith REST protoco │ │ │ -00151c20: 6c73 2c20 692e 652e 2073 6574 7320 7468 ls, i.e. sets th │ │ │ -00151c30: 6520 6465 6669 6e69 7469 6f6e 732f 6269 e definitions/bi │ │ │ -00151c40: 6e64 696e 672f 6f70 6572 6174 696f 6e2f nding/operation/ │ │ │ -00151c50: 4854 5450 3a6f 7065 7261 7469 6f6e 2f40 HTTP:operation/@ │ │ │ -00151c60: 6c6f 6361 7469 6f6e 2c20 7768 6963 6820 location, which │ │ │ -00151c70: 7370 6563 6966 6965 7320 6120 5552 4c20 specifies a URL │ │ │ -00151c80: 7175 6572 7920 7374 7269 6e67 2028 7374 query string (st │ │ │ -00151c90: 6172 7473 2077 6974 6820 6120 3c63 6f64 arts with a ?) to c │ │ │ -00151cb0: 6f6d 706c 6574 6520 7468 6520 7365 7276 omplete the serv │ │ │ -00151cc0: 6963 6520 656e 6470 6f69 6e74 2055 524c ice endpoint URL │ │ │ -00151cd0: 206f 7220 6578 7465 6e64 7320 7468 6520 or extends the │ │ │ -00151ce0: 656e 6470 6f69 6e74 2055 524c 2077 6974 endpoint URL wit │ │ │ -00151cf0: 6820 6120 6c6f 6361 6c20 7061 7468 2028 h a local path ( │ │ │ -00151d00: 7374 6172 7473 2077 6974 6820 6120 3c63 starts with a /)..
.

Use │ │ │ -00151d30: 203c 636f 6465 3e6d 6574 686f 642d 696e method-in │ │ │ -00151d40: 7075 742d 6163 7469 6f6e 3c2f 636f 6465 put-action and meth │ │ │ -00151d60: 6f64 2d6f 7574 7075 742d 6163 7469 6f6e od-output-action │ │ │ -00151d70: 3c2f 636f 6465 3e20 746f 2064 6966 6665 to diffe │ │ │ -00151d80: 7265 6e74 6961 7465 2074 6865 2053 4f41 rentiate the SOA │ │ │ -00151d90: 5041 6374 696f 6e20 6265 7477 6565 6e20 PAction between │ │ │ -00151da0: 534f 4150 2072 6571 7565 7374 2061 6e64 SOAP request and │ │ │ -00151db0: 2072 6573 706f 6e73 6520 6d65 7373 6167 response messag │ │ │ -00151dc0: 6573 2e3c 2f70 3e0a 3c70 3e59 6f75 2063 es.

.

You c │ │ │ -00151dd0: 616e 2061 6c77 6179 7320 6f76 6572 7269 an always overri │ │ │ -00151de0: 6465 2074 6865 2070 6f72 7420 656e 6470 de the port endp │ │ │ -00151df0: 6f69 6e74 2055 524c 2061 6e64 2061 6374 oint URL and act │ │ │ -00151e00: 696f 6e20 7661 6c75 6573 2061 7420 7275 ion values at ru │ │ │ -00151e10: 6e74 696d 6520 696e 2074 6865 2061 7574 ntime in the aut │ │ │ -00151e20: 6f2d 6765 6e65 7261 7465 6420 3c63 6f64 o-generated soap_call_pref │ │ │ -00151e40: 6978 5f5f 6675 6e63 3c2f 636f 6465 3e20 ix__func │ │ │ -00151e50: 7365 7276 6963 6520 6361 6c6c 2028 432f service call (C/ │ │ │ -00151e60: 432b 2b20 636c 6965 6e74 2073 6964 6529 C++ client side) │ │ │ -00151e70: 2061 6e64 2069 6e20 7468 6520 6175 746f and in the auto │ │ │ -00151e80: 2d67 656e 6572 6174 6564 2043 2b2b 2070 -generated C++ p │ │ │ -00151e90: 726f 7879 2063 6c61 7373 2073 6572 7669 roxy class servi │ │ │ -00151ea0: 6365 2063 616c 6c73 2e20 4120 7275 6e74 ce calls. A runt │ │ │ -00151eb0: 696d 6520 4e55 4c4c 2065 6e64 706f 696e ime NULL endpoin │ │ │ -00151ec0: 7420 5552 4c20 616e 642f 6f72 2061 6374 t URL and/or act │ │ │ -00151ed0: 696f 6e20 7573 6573 2074 6865 2064 6566 ion uses the def │ │ │ -00151ee0: 6175 6c74 7320 7365 7420 6279 2074 6865 aults set by the │ │ │ -00151ef0: 7365 2064 6972 6563 7469 7665 732e 3c2f se directives..

The │ │ │ -00151f10: 6d65 7468 6f64 2d6d 696d 652d 7479 7065 method-mime-type │ │ │ -00151f20: 3c2f 636f 6465 3e20 7072 6f70 6572 7479 property │ │ │ -00151f30: 2073 6572 7665 7320 7477 6f20 7075 7270 serves two purp │ │ │ -00151f40: 6f73 6573 3a3c 2f70 3e0a 3c6f 6c20 7479 oses:

.
    .
  1. To s │ │ │ -00151f60: 6574 2074 6865 2074 7970 6520 6f66 204d et the type of M │ │ │ -00151f70: 494d 452f 4d54 4f4d 2061 7474 6163 686d IME/MTOM attachm │ │ │ -00151f80: 656e 7473 2075 7365 6420 7769 7468 2053 ents used with S │ │ │ -00151f90: 4f41 5020 7072 6f74 6f63 6f6c 732e 204d OAP protocols. M │ │ │ -00151fa0: 756c 7469 706c 6520 6174 7461 6368 6d65 ultiple attachme │ │ │ -00151fb0: 6e74 2074 7970 6573 2063 616e 2062 6520 nt types can be │ │ │ -00151fc0: 6465 636c 6172 6564 2066 6f72 2061 2053 declared for a S │ │ │ -00151fd0: 4f41 5020 7365 7276 6963 6520 6f70 6572 OAP service oper │ │ │ -00151fe0: 6174 696f 6e2c 2069 2e65 2e20 6164 6473 ation, i.e. adds │ │ │ -00151ff0: 2064 6566 696e 6974 696f 6e73 2f62 696e definitions/bin │ │ │ -00152000: 6469 6e67 2f6f 7065 7261 7469 6f6e 2f69 ding/operation/i │ │ │ -00152010: 6e70 7574 2f4d 494d 453a 6d75 6c74 6970 nput/MIME:multip │ │ │ -00152020: 6172 7452 656c 6174 6564 2f4d 494d 453a artRelated/MIME: │ │ │ -00152030: 7061 7274 2f4d 494d 453a 636f 6e74 656e part/MIME:conten │ │ │ -00152040: 742f 4074 7970 6520 666f 7220 6561 6368 t/@type for each │ │ │ -00152050: 2074 7970 6520 7370 6563 6966 6965 642e type specified. │ │ │ -00152060: 3c2f 6c69 3e0a 3c6c 693e 546f 2073 6574
  2. .
  3. To set │ │ │ -00152070: 2074 6865 204d 494d 4520 7479 7065 206f the MIME type o │ │ │ -00152080: 6620 6120 5245 5354 206f 7065 7261 7469 f a REST operati │ │ │ -00152090: 6f6e 2e20 5468 6973 2072 6570 6c61 6365 on. This replace │ │ │ -001520a0: 7320 584d 4c20 6465 636c 6172 6564 2069 s XML declared i │ │ │ -001520b0: 6e20 5753 444c 2062 7920 6465 6669 6e69 n WSDL by defini │ │ │ -001520c0: 7469 6f6e 732f 6269 6e64 696e 672f 6f70 tions/binding/op │ │ │ -001520d0: 6572 6174 696f 6e2f 2869 6e70 7574 7c6f eration/(input|o │ │ │ -001520e0: 7574 7075 7429 2f4d 494d 453a 6d69 6d65 utput)/MIME:mime │ │ │ -001520f0: 586d 6c20 7769 7468 204d 494d 453a 636f Xml with MIME:co │ │ │ -00152100: 6e74 656e 742f 4074 7970 652e 2055 7365 ntent/@type. Use │ │ │ -00152110: 203c 636f 6465 3e61 7070 6c69 6361 7469 applicati │ │ │ -00152120: 6f6e 2f78 2d77 7777 2d66 6f72 6d2d 7572 on/x-www-form-ur │ │ │ -00152130: 6c65 6e63 6f64 6564 3c2f 636f 6465 3e20 lencoded │ │ │ -00152140: 7769 7468 2052 4553 5420 504f 5354 2061 with REST POST a │ │ │ -00152150: 6e64 2050 5554 2070 726f 746f 636f 6c73 nd PUT protocols │ │ │ -00152160: 2074 6f20 7365 6e64 2065 6e63 6f64 6564 to send encoded │ │ │ -00152170: 2066 6f72 6d20 6461 7461 2061 7574 6f6d form data autom │ │ │ -00152180: 6174 6963 616c 6c79 2069 6e73 7465 6164 atically instead │ │ │ -00152190: 206f 6620 584d 4c2e 204f 6e6c 7920 7072 of XML. Only pr │ │ │ -001521a0: 696d 6974 6976 6520 7479 7065 2076 616c imitive type val │ │ │ -001521b0: 7565 7320 6361 6e20 6265 2074 7261 6e73 ues can be trans │ │ │ -001521c0: 6d69 7474 6564 2077 6974 6820 666f 726d mitted with form │ │ │ -001521d0: 2064 6174 612c 2073 7563 6820 6173 206e data, such as n │ │ │ -001521e0: 756d 6265 7273 2061 6e64 2073 7472 696e umbers and strin │ │ │ -001521f0: 6773 2c20 692e 652e 206f 6e6c 7920 7479 gs, i.e. only ty │ │ │ -00152200: 7065 7320 7468 6174 2061 7265 206c 6567 pes that are leg │ │ │ -00152210: 616c 2074 6f20 7573 6520 6173 2061 7474 al to use as att │ │ │ -00152220: 7269 6275 7465 7320 6d65 6d62 6572 732e ributes members. │ │ │ -00152230: 3c2f 6c69 3e0a 3c2f 6f6c 3e0a 3c70 3e55
  4. .
.

U │ │ │ -00152240: 7365 203c 636f 6465 3e6d 6574 686f 642d se method- │ │ │ -00152250: 696e 7075 742d 6d69 6d65 2d74 7970 653c input-mime-type< │ │ │ -00152260: 2f63 6f64 653e 2061 6e64 203c 636f 6465 /code> and method-output-m │ │ │ -00152280: 696d 652d 7479 7065 3c2f 636f 6465 3e20 ime-type │ │ │ -00152290: 746f 2064 6966 6665 7265 6e74 6961 7465 to differentiate │ │ │ -001522a0: 2074 6865 2061 7474 6163 686d 656e 7420 the attachment │ │ │ -001522b0: 7479 7065 7320 6265 7477 6565 6e20 7265 types between re │ │ │ -001522c0: 7175 6573 7420 616e 6420 7265 7370 6f6e quest and respon │ │ │ -001522d0: 7365 206d 6573 7361 6765 732e 3c2f 703e se messages.

│ │ │ -001522e0: 0a3c 703e f09f 949d 203c 6120 6872 6566 .

.... Back to tab │ │ │ -00152300: 6c65 206f 6620 636f 6e74 656e 7473 3c2f le of contents

.

< │ │ │ -00152340: 2f61 3e0a 5363 6865 6d61 2064 6972 6563 /a>.Schema direc │ │ │ -00152350: 7469 7665 733c 2f68 333e 0a3c 703e 4120 tives

.

A │ │ │ -00152360: 7363 6865 6d61 2064 6972 6563 7469 7665 schema directive │ │ │ -00152370: 2069 7320 6f66 2074 6865 2066 6f72 6d3a is of the form: │ │ │ -00152380: 3c2f 703e 0a3c 6469 7620 636c 6173 733d

.
//gsoap <p │ │ │ -001523d0: 7265 6669 7826 6774 3b20 7363 6865 6d61 refix> schema │ │ │ -001523e0: 2026 6c74 3b70 726f 7065 7274 7926 6774 <property> │ │ │ -001523f0: 3b3a 2026 6c74 3b76 616c 7565 2667 743b ;: <value> │ │ │ -00152400: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c2f
.

where <prefix&g │ │ │ -00152440: 743b 3c2f 636f 6465 3e20 6973 2074 6865 t; is the │ │ │ -00152450: 2058 4d4c 206e 616d 6573 7061 6365 2070 XML namespace p │ │ │ -00152460: 7265 6669 7820 6f66 2061 2073 6368 656d refix of a schem │ │ │ -00152470: 612e 2054 6865 203c 636f 6465 3e26 6c74 a. The < │ │ │ -00152480: 3b70 726f 7065 7274 7926 6774 3b3c 2f63 ;property> and & │ │ │ -001524a0: 6c74 3b76 616c 7565 2667 743b 3c2f 636f lt;value> fields are o │ │ │ -001524c0: 6e65 206f 6620 7468 6520 666f 6c6c 6f77 ne of the follow │ │ │ -001524d0: 696e 673a 3c2f 703e 0a3c 7461 626c 6520 ing:

.....< │ │ │ -001525a0: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ -001525b0: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ -001525c0: 3e3c 636f 6465 3e6e 616d 6573 7061 6365 >namespace │ │ │ -001525d0: 3c2f 636f 6465 3e20 2020 3c2f 7464 3e3c < │ │ │ -001525e0: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ -001525f0: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ -00152600: 3e55 5249 206f 6620 7468 6520 5853 4420 >URI of the XSD │ │ │ -00152610: 7461 7267 6574 4e61 6d65 7370 6163 6520 targetNamespace │ │ │ -00152620: 2020 203c 2f74 643e 3c2f 7472 3e0a 3c74 .. │ │ │ -00152650: 3c74 6420 636c 6173 733d 226d 6172 6b64 .......... │ │ │ -00152b70: 3c74 6420 636c 6173 733d 226d 6172 6b64 ..

The namespace2 URI is a pat │ │ │ -00152c40: 7465 726e 2077 6974 6820 3c63 6f64 653e tern with │ │ │ -00152c50: 2a3c 2f63 6f64 653e 206d 6174 6368 696e * matchin │ │ │ -00152c60: 6720 616e 7920 7365 7175 656e 6365 206f g any sequence o │ │ │ -00152c70: 6620 6368 6172 6163 7465 7273 2061 6e64 f characters and │ │ │ -00152c80: 203c 636f 6465 3e2d 3c2f 636f 6465 3e20 - │ │ │ -00152c90: 6d61 7463 6869 6e67 2061 6e79 2063 6861 matching any cha │ │ │ -00152ca0: 7261 6374 6572 2e20 5468 6973 2070 6174 racter. This pat │ │ │ -00152cb0: 7465 726e 2069 6e73 7472 7563 7473 2074 tern instructs t │ │ │ -00152cc0: 6865 2058 4d4c 2070 6172 7365 7220 616e he XML parser an │ │ │ -00152cd0: 6420 7661 6c69 6461 746f 7220 746f 2061 d validator to a │ │ │ -00152ce0: 6c73 6f20 6163 6365 7074 2074 6865 2055 lso accept the U │ │ │ -00152cf0: 5249 2070 6174 7465 726e 2061 7320 6120 RI pattern as a │ │ │ -00152d00: 7661 6c69 6420 6e61 6d65 7370 6163 6520 valid namespace │ │ │ -00152d10: 666f 7220 7468 6520 7370 6563 6966 6965 for the specifie │ │ │ -00152d20: 6420 3c63 6f64 653e 266c 743b 7072 6566 d <pref │ │ │ -00152d30: 6978 2667 743b 3c2f 636f 6465 3e2e 3c2f ix>..

The │ │ │ -00152d50: 7479 7065 643c 2f63 6f64 653e 2070 726f typed pro │ │ │ -00152d60: 7065 7274 7920 6973 203c 636f 6465 3e6e perty is n │ │ │ -00152d70: 6f3c 2f63 6f64 653e 2062 7920 6465 6661 o by defa │ │ │ -00152d80: 756c 7420 616e 6420 6361 6e20 6265 2063 ult and can be c │ │ │ -00152d90: 6861 6e67 6564 2074 6f20 3c63 6f64 653e hanged to │ │ │ -00152da0: 7965 733c 2f63 6f64 653e 2077 6974 6820 yes with │ │ │ -00152db0: 3c62 3e3c 636f 6465 3e73 6f61 7063 7070 soapcpp │ │ │ -00152dc0: 3220 2d74 3c2f 636f 6465 3e3c 2f62 3e20 2 -t │ │ │ -00152dd0: 6f70 7469 6f6e 203c 623e 3c63 6f64 653e option │ │ │ -00152de0: 2d74 3c2f 636f 6465 3e3c 2f62 3e2e 3c2f -t..

.... Back to t │ │ │ -00152e10: 6162 6c65 206f 6620 636f 6e74 656e 7473 able of contents │ │ │ -00152e20: 3c2f 613e 3c2f 703e 0a3c 6833 3e3c 6120

.

.Schema typ │ │ │ -00152e60: 6520 6469 7265 6374 6976 6573 3c2f 6833 e directives

.

A schema ty │ │ │ -00152e80: 7065 2064 6972 6563 7469 7665 2069 7320 pe directive is │ │ │ -00152e90: 6f66 2074 6865 2066 6f72 6d3a 3c2f 703e of the form:

│ │ │ -00152ea0: 0a3c 6469 7620 636c 6173 733d 2266 7261 .
/ │ │ │ -00152ee0: 2f67 736f 6170 2026 6c74 3b70 7265 6669 /gsoap <prefi │ │ │ -00152ef0: 7826 6774 3b20 7363 6865 6d61 2074 7970 x> schema typ │ │ │ -00152f00: 652d 266c 743b 7072 6f70 6572 7479 2667 e-<property&g │ │ │ -00152f10: 743b 3a20 266c 743b 6e61 6d65 2667 743b t;: <name> │ │ │ -00152f20: 2026 6c74 3b76 616c 7565 2667 743b 3c2f <value>
.
//gsoap < │ │ │ -00152f70: 7072 6566 6978 2667 743b 2073 6368 656d prefix> schem │ │ │ -00152f80: 6120 7479 7065 2d26 6c74 3b70 726f 7065 a type-<prope │ │ │ -00152f90: 7274 7926 6774 3b3a 2026 6c74 3b6e 616d rty>: <nam │ │ │ -00152fa0: 6526 6774 3b3a 3a26 6c74 3b6d 656d 6265 e>::<membe │ │ │ -00152fb0: 7226 6774 3b20 266c 743b 7661 6c75 6526 r> <value& │ │ │ -00152fc0: 6774 3b3c 2f73 7061 6e3e 3c2f 6469 763e gt;
│ │ │ -00152fd0: 0a3c 2f64 6976 3e3c 212d 2d20 6672 6167 .

where │ │ │ -00152ff0: 203c 636f 6465 3e26 6c74 3b70 7265 6669 <prefi │ │ │ -00153000: 7826 6774 3b3c 2f63 6f64 653e 2069 7320 x> is │ │ │ -00153010: 7468 6520 584d 4c20 6e61 6d65 7370 6163 the XML namespac │ │ │ -00153020: 6520 7072 6566 6978 206f 6620 6120 7363 e prefix of a sc │ │ │ -00153030: 6865 6d61 2061 6e64 203c 636f 6465 3e26 hema and & │ │ │ -00153040: 6c74 3b6e 616d 6526 6774 3b3c 2f63 6f64 lt;name> is an unquali │ │ │ -00153060: 6669 6564 206e 616d 6520 6f66 2061 2043 fied name of a C │ │ │ -00153070: 2f43 2b2b 2074 7970 652c 2061 6e64 2074 /C++ type, and t │ │ │ -00153080: 6865 206f 7074 696f 6e61 6c20 3c63 6f64 he optional <member> │ │ │ -001530a0: 3c2f 636f 6465 3e20 6973 2061 2063 6c61 is a cla │ │ │ -001530b0: 7373 2f73 7472 7563 7420 6d65 6d62 6572 ss/struct member │ │ │ -001530c0: 7320 6f72 2065 6e75 6d20 636f 6e73 7461 s or enum consta │ │ │ -001530d0: 6e74 2e3c 2f70 3e0a 3c70 3e59 6f75 2063 nt.

.

You c │ │ │ -001530e0: 616e 2064 6573 6372 6962 6520 6120 7479 an describe a ty │ │ │ -001530f0: 7065 2077 6974 6820 6f6e 6520 6f66 2074 pe with one of t │ │ │ -00153100: 6865 2066 6f6c 6c6f 7769 6e67 3a3c 2f70 he following:

.
property │ │ │ -00152540: 2020 203c 2f74 683e 3c74 6820 636c 6173 value │ │ │ -00152570: 2020 203c 2f74 683e 3c2f 7472 3e0a 3c74
namespac │ │ │ -00152680: 6532 3c2f 636f 6465 3e20 2020 3c2f 7464 e2 alternate URI │ │ │ -001526c0: 2070 6174 7465 726e 2066 6f72 2074 6865 pattern for the │ │ │ -001526d0: 2058 5344 206e 616d 6573 7061 6365 2028 XSD namespace ( │ │ │ -001526e0: 692e 652e 2055 5249 2069 7320 616c 736f i.e. URI is also │ │ │ -001526f0: 2061 6363 6570 7465 6420 6279 2074 6865 accepted by the │ │ │ -00152700: 2058 4d4c 2070 6172 7365 7229 2020 2020 XML parser) │ │ │ -00152710: 3c2f 7464 3e3c 2f74 723e 0a3c 7472 2063
import URI o │ │ │ -001527a0: 6620 616e 2069 6d70 6f72 7465 6420 6e61 f an imported na │ │ │ -001527b0: 6d65 7370 6163 652c 2061 7320 616e 2061 mespace, as an a │ │ │ -001527c0: 6c74 6572 6e61 7469 7665 206f 7220 696e lternative or in │ │ │ -001527d0: 2061 6464 6974 696f 6e20 746f 203c 636f addition to namespace, adds │ │ │ -00152800: 7873 643a 696d 706f 7274 3c2f 636f 6465 xsd:import to the generat │ │ │ -00152820: 6564 2057 5344 4c20 616e 6420 5853 4420 ed WSDL and XSD │ │ │ -00152830: 6669 6c65 7320 2020 203c 2f74 643e 3c2f files
fo │ │ │ -00152890: 726d 3c2f 636f 6465 3e20 2020 3c2f 7464 rm unquali │ │ │ -001528d0: 6669 6564 3c2f 636f 6465 3e20 2864 6566 fied (def │ │ │ -001528e0: 6175 6c74 2920 6f72 203c 636f 6465 3e71 ault) or q │ │ │ -001528f0: 7561 6c69 6669 6564 3c2f 636f 6465 3e20 ualified │ │ │ -00152900: 6c6f 6361 6c20 656c 656d 656e 7420 616e local element an │ │ │ -00152910: 6420 6174 7472 6962 7574 6520 666f 726d d attribute form │ │ │ -00152920: 2064 6566 6175 6c74 7320 2020 203c 2f74 defaults
elementForm unqualified (default) │ │ │ -001529e0: 6f72 203c 636f 6465 3e71 7561 6c69 6669 or qualifi │ │ │ -001529f0: 6564 3c2f 636f 6465 3e20 6c6f 6361 6c20 ed local │ │ │ -00152a00: 656c 656d 656e 7420 666f 726d 2064 6566 element form def │ │ │ -00152a10: 6175 6c74 2020 2020 3c2f 7464 3e3c 2f74 ault
att │ │ │ -00152a70: 7269 6275 7465 466f 726d 3c2f 636f 6465 ributeForm unqualified (default) or │ │ │ -00152ad0: 203c 636f 6465 3e71 7561 6c69 6669 6564 qualified │ │ │ -00152ae0: 3c2f 636f 6465 3e20 6c6f 6361 6c20 6174 local at │ │ │ -00152af0: 7472 6962 7574 6520 666f 726d 2064 6566 tribute form def │ │ │ -00152b00: 6175 6c74 2020 2020 3c2f 7464 3e3c 2f74 ault
type │ │ │ -00152b60: 643c 2f63 6f64 653e 2020 203c 2f74 643e d no (default) or < │ │ │ -00152bb0: 636f 6465 3e79 6573 3c2f 636f 6465 3e20 code>yes │ │ │ -00152bc0: 666f 7220 7365 7269 616c 697a 6572 7320 for serializers │ │ │ -00152bd0: 746f 2061 6464 203c 636f 6465 3e78 7369 to add xsi │ │ │ -00152be0: 3a74 7970 653c 2f63 6f64 653e 2061 7474 :type att │ │ │ -00152bf0: 7269 6275 7465 7320 746f 2058 4d4c 2020 ributes to XML │ │ │ -00152c00: 203c 2f74 643e 3c2f 7472 3e0a 3c2f 7461
. │ │ │ -00153130: 3c74 7220 636c 6173 733d 226d 6172 6b64 .< │ │ │ -00153150: 7468 2063 6c61 7373 3d22 6d61 726b 646f th class="markdo │ │ │ -00153160: 776e 5461 626c 6548 6561 644e 6f6e 6522 wnTableHeadNone" │ │ │ -00153170: 3e74 7970 6520 7072 6f70 6572 7479 2020 >type property │ │ │ -00153180: 203c 2f74 683e 3c74 6820 636c 6173 733d .. │ │ │ -00153270: 3c2f 7472 3e0a 3c74 7220 636c 6173 733d ....

For exam │ │ │ -00153350: 706c 652c 2079 6f75 2063 616e 2061 6464 ple, you can add │ │ │ -00153360: 2061 2064 6573 6372 6970 7469 6f6e 2074 a description t │ │ │ -00153370: 6f20 616e 2065 6e75 6d65 7261 7469 6f6e o an enumeration │ │ │ -00153380: 3a3c 2f70 3e0a 3c64 6976 2063 6c61 7373 :

.
//gsoap ns s │ │ │ -001533d0: 6368 656d 6120 7479 7065 3a20 566f 7765 chema type: Vowe │ │ │ -001533e0: 6c73 2054 6865 206c 6574 7465 7273 2041 ls The letters A │ │ │ -001533f0: 2c20 452c 2049 2c20 4f2c 2055 2c20 616e , E, I, O, U, an │ │ │ -00153400: 6420 736f 6d65 7469 6d65 7320 593c 2f73 d sometimes Y
.
//gsoap ns sc │ │ │ -00153450: 6865 6d61 2074 7970 653a 2056 6f77 656c hema type: Vowel │ │ │ -00153460: 733a 3a59 2041 2076 6f77 656c 2c20 736f s::Y A vowel, so │ │ │ -00153470: 6d65 7469 6d65 733c 2f73 7061 6e3e 3c2f metimes.
enu │ │ │ -001534b0: 6d20 636c 6173 733c 2f73 7061 6e3e 206e m class n │ │ │ -001534c0: 735f 5f56 6f77 656c 7320 3a20 6368 6172 s__Vowels : char │ │ │ -001534d0: 207b 2041 203d 203c 7370 616e 2063 6c61 { A = 'A', E = 'E', I = 'I' │ │ │ -00153560: 3c2f 7370 616e 3e2c 204f 203d 203c 7370 , O = 'O │ │ │ -00153590: 393b 3c2f 7370 616e 3e2c 2055 203d 203c 9;, U = < │ │ │ -001535a0: 7370 616e 2063 6c61 7373 3d22 6368 6172 span class="char │ │ │ -001535b0: 6c69 7465 7261 6c22 3e26 2333 393b 5526 literal">'U& │ │ │ -001535c0: 2333 393b 3c2f 7370 616e 3e2c 2059 203d #39;, Y = │ │ │ -001535d0: 203c 7370 616e 2063 6c61 7373 3d22 6368 ' │ │ │ -001535f0: 5926 2333 393b 3c2f 7370 616e 3e20 7d3b Y' }; │ │ │ -00153600: 3c2f 6469 763e 0a3c 2f64 6976 3e3c 212d
.

This documented │ │ │ -00153630: 2065 6e75 6d65 7261 7469 6f6e 206d 6170 enumeration map │ │ │ -00153640: 7320 746f 2061 2073 696d 706c 6554 7970 s to a simpleTyp │ │ │ -00153650: 6520 7265 7374 7269 6374 696f 6e20 6f66 e restriction of │ │ │ -00153660: 203c 656d 3e3c 636f 6465 3e78 7364 3a73 xsd:s │ │ │ -00153670: 7472 696e 673c 2f63 6f64 653e 3c2f 656d tring in the soapcpp │ │ │ -00153690: 322d 6765 6e65 7261 7465 6420 7363 6865 2-generated sche │ │ │ -001536a0: 6d61 3a3c 2f70 3e0a 3c64 6976 2063 6c61 ma:

.
│ │ │ -001536d0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
< │ │ │ -00153700: 7369 6d70 6c65 5479 7065 3c2f 7370 616e simpleType name= │ │ │ -00153750: 2671 756f 743b 566f 7765 6c73 2671 756f "Vowels&quo │ │ │ -00153760: 743b 3c2f 7370 616e 3e26 6774 3b3c 2f64 t;>.
<annotation │ │ │ -001537b0: 3c2f 7370 616e 3e26 6774 3b3c 2f64 6976 >
.
<documentat │ │ │ -00153800: 696f 6e3c 2f73 7061 6e3e 2667 743b 3c73 ion>The < │ │ │ -00153830: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -00153840: 6f72 6422 3e6c 6574 7465 7273 3c2f 7370 ord">letters A, E, I, O, U, and somet │ │ │ -00153930: 696d 6573 3c2f 7370 616e 3e20 3c73 7061 imes Y</< │ │ │ -00153960: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -00153970: 6f72 6474 7970 6522 3e64 6f63 756d 656e ordtype">documen │ │ │ -00153980: 7461 7469 6f6e 3c2f 7370 616e 3e26 6774 tation> │ │ │ -00153990: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
.
< │ │ │ -001539b0: 2f3c 7370 616e 2063 6c61 7373 3d22 6b65 /annot │ │ │ -001539d0: 6174 696f 6e3c 2f73 7061 6e3e 2667 743b ation> │ │ │ -001539e0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
<< │ │ │ -00153a00: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -00153a10: 6f72 6474 7970 6522 3e72 6573 7472 6963 ordtype">restric │ │ │ -00153a20: 7469 6f6e 3c2f 7370 616e 3e20 3c73 7061 tion base=" │ │ │ -00153a70: 7873 643a 7374 7269 6e67 2671 756f 743b xsd:string" │ │ │ -00153a80: 3c2f 7370 616e 3e26 6774 3b3c 2f64 6976 >
.
<enumeratio │ │ │ -00153ad0: 6e3c 2f73 7061 6e3e 203c 7370 616e 2063 n v │ │ │ -00153af0: 616c 7565 3c2f 7370 616e 3e3d 3c73 7061 alue="A& │ │ │ -00153b20: 7175 6f74 3b3c 2f73 7061 6e3e 2f26 6774 quot;/> │ │ │ -00153b30: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
.
&l │ │ │ -00153b50: 743b 3c73 7061 6e20 636c 6173 733d 226b t;enum │ │ │ -00153b70: 6572 6174 696f 6e3c 2f73 7061 6e3e 203c eration < │ │ │ -00153b80: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -00153b90: 6f72 6422 3e76 616c 7565 3c2f 7370 616e ord">value=&q │ │ │ -00153bc0: 756f 743b 4526 7175 6f74 3b3c 2f73 7061 uot;E"/>
. │ │ │ -00153bf0: 2020 2020 266c 743b 3c73 7061 6e20 636c <enumeration
value │ │ │ -00153c40: 3c2f 7370 616e 3e3d 3c73 7061 6e20 636c ="I" │ │ │ -00153c70: 3b3c 2f73 7061 6e3e 2f26 6774 3b3c 2f64 ;/>.
<enumerat │ │ │ -00153cc0: 696f 6e3c 2f73 7061 6e3e 203c 7370 616e ion value=" │ │ │ -00153d10: 4f26 7175 6f74 3b3c 2f73 7061 6e3e 2f26 O"/& │ │ │ -00153d20: 6774 3b3c 2f64 6976 3e0a 3c64 6976 2063 gt;
.
│ │ │ -00153d40: 266c 743b 3c73 7061 6e20 636c 6173 733d <en │ │ │ -00153d60: 756d 6572 6174 696f 6e3c 2f73 7061 6e3e umeration │ │ │ -00153d70: 203c 7370 616e 2063 6c61 7373 3d22 6b65 value= │ │ │ -00153db0: 2671 756f 743b 5526 7175 6f74 3b3c 2f73 "U"/>
. │ │ │ -00153dd0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
<enumeration< │ │ │ -00153e10: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> val │ │ │ -00153e30: 7565 3c2f 7370 616e 3e3d 3c73 7061 6e20 ue="Y&qu │ │ │ -00153e60: 6f74 3b3c 2f73 7061 6e3e 2667 743b 3c2f ot;>.
< │ │ │ -00153e90: 3b3c 7370 616e 2063 6c61 7373 3d22 6b65 ;annot │ │ │ -00153eb0: 6174 696f 6e3c 2f73 7061 6e3e 2667 743b ation> │ │ │ -00153ec0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ -00153ee0: 2026 6c74 3b3c 7370 616e 2063 6c61 7373 <d │ │ │ -00153f00: 6f63 756d 656e 7461 7469 6f6e 3c2f 7370 ocumentation>A vowe │ │ │ -00153f50: 6c3c 2f73 7061 6e3e 2c20 3c73 7061 6e20 l, │ │ │ -00153f70: 736f 6d65 7469 6d65 733c 2f73 7061 6e3e sometimes │ │ │ -00153f80: 266c 743b 2f3c 7370 616e 2063 6c61 7373 </d │ │ │ -00153fa0: 6f63 756d 656e 7461 7469 6f6e 3c2f 7370 ocumentation>
. │ │ │ -00153fd0: 2020 2020 2020 266c 743b 2f3c 7370 616e </annotation< │ │ │ -00154000: 2f73 7061 6e3e 2667 743b 3c2f 6469 763e /span>>
│ │ │ -00154010: 0a3c 6469 7620 636c 6173 733d 226c 696e .
<enumeration │ │ │ -00154050: 3c2f 7370 616e 3e2f 2667 743b 3c2f 6469 />.
</restrictio │ │ │ -001540a0: 6e3c 2f73 7061 6e3e 2667 743b 3c2f 6469 n>.
</simpleType>
. │ │ │ -00154100: 3c2f 6469 763e 3c21 2d2d 2066 7261 676d

.... Back to table │ │ │ -00154140: 6f66 2063 6f6e 7465 6e74 733c 2f61 3e3c of contents< │ │ │ -00154150: 2f70 3e0a 3c68 333e 3c61 2063 6c61 7373 /p>.

.Ex │ │ │ -00154180: 616d 706c 653c 2f68 333e 0a3c 703e 5468 ample

.

Th │ │ │ -00154190: 6520 7573 6520 6f66 2064 6972 6563 7469 e use of directi │ │ │ -001541a0: 7665 7320 6973 2062 6573 7420 696c 6c75 ves is best illu │ │ │ -001541b0: 7374 7261 7465 6420 7769 7468 2061 6e20 strated with an │ │ │ -001541c0: 6578 616d 706c 652e 2054 6865 2065 7861 example. The exa │ │ │ -001541d0: 6d70 6c65 2075 7365 7320 6120 6879 706f mple uses a hypo │ │ │ -001541e0: 7468 6574 6963 616c 2073 746f 636b 2071 thetical stock q │ │ │ -001541f0: 756f 7465 2073 6572 7669 6365 2061 6e64 uote service and │ │ │ -00154200: 2065 7863 6861 6e67 6520 7261 7465 2073 exchange rate s │ │ │ -00154210: 6572 7669 6365 2c20 6163 7475 616c 2073 ervice, actual s │ │ │ -00154220: 6572 7669 6365 7320 7375 6368 2061 7320 ervices such as │ │ │ -00154230: 7468 6573 6520 6172 6520 6176 6169 6c61 these are availa │ │ │ -00154240: 626c 6520 666f 7220 6672 6565 206f 6e20 ble for free on │ │ │ -00154250: 7468 6520 7765 622e 3c2f 703e 0a3c 6469 the web.

.
//gso │ │ │ -001542a0: 6170 206e 7331 2073 6572 7669 6365 206e ap ns1 service n │ │ │ -001542b0: 616d 6573 7061 6365 3a20 2075 726e 3a47 amespace: urn:G │ │ │ -001542c0: 6574 5175 6f74 6520 3c2f 7370 616e 3e3c etQuote < │ │ │ -001542d0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
int ns1 │ │ │ -00154310: 5f5f 6765 7451 756f 7465 283c 7370 616e __getQuote(char │ │ │ -00154340: 202a 7379 6d62 6f6c 2c20 3c73 7061 6e20 *symbol, float │ │ │ -00154370: 2026 616d 703b 7265 7375 6c74 293b 203c &result); < │ │ │ -00154380: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
. │ │ │ -001543a0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
//gsoap │ │ │ -001543d0: 6e73 3220 7365 7276 6963 6520 6e61 6d65 ns2 service name │ │ │ -001543e0: 7370 6163 653a 2020 7572 6e3a 4375 7272 space: urn:Curr │ │ │ -001543f0: 656e 6379 4578 6368 616e 6765 203c 2f73 encyExchange
.
int ns2__getRate(< │ │ │ -00154450: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -00154460: 6f72 6474 7970 6522 3e63 6861 723c 2f73 ordtype">char *country1, │ │ │ -00154480: 3c73 7061 6e20 636c 6173 733d 226b 6579 char *country2, │ │ │ -001544b0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 float │ │ │ -001544d0: 3c2f 7370 616e 3e20 2661 6d70 3b72 6573 &res │ │ │ -001544e0: 756c 7429 3b20 3c2f 6469 763e 0a3c 6469 ult);
. │ │ │ -00154500: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
/ │ │ │ -00154530: 2f67 736f 6170 206e 7333 2073 6572 7669 /gsoap ns3 servi │ │ │ -00154540: 6365 206e 616d 653a 2020 2020 2020 2071 ce name: q │ │ │ -00154550: 756f 7465 7820 3c2f 7370 616e 3e3c 2f64 uotex .
//gs │ │ │ -00154590: 6f61 7020 6e73 3320 7365 7276 6963 6520 oap ns3 service │ │ │ -001545a0: 7374 796c 653a 2020 2020 2020 7270 6320 style: rpc │ │ │ -001545b0: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ -001545d0: 3c73 7061 6e20 636c 6173 733d 2263 6f6d //gsoap ns │ │ │ -001545f0: 3320 7365 7276 6963 6520 656e 636f 6469 3 service encodi │ │ │ -00154600: 6e67 3a20 2020 656e 636f 6465 6420 3c2f ng: encoded
.
//gsoap ns3 │ │ │ -00154650: 7365 7276 6963 6520 706f 7274 3a20 2020 service port: │ │ │ -00154660: 2020 2020 6874 7470 3a2f 2f77 7777 2e6d http://www.m │ │ │ -00154670: 7964 6f6d 6169 6e2e 636f 6d2f 7175 6f74 ydomain.com/quot │ │ │ -00154680: 6578 2e63 6769 203c 2f73 7061 6e3e 3c2f ex.cgi .
//g │ │ │ -001546c0: 736f 6170 206e 7333 2073 6572 7669 6365 soap ns3 service │ │ │ -001546d0: 206e 616d 6573 7061 6365 3a20 2075 726e namespace: urn │ │ │ -001546e0: 3a71 756f 7465 7820 3c2f 7370 616e 3e3c :quotex < │ │ │ -001546f0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
int ns3 │ │ │ -00154730: 5f5f 6765 7451 756f 7465 283c 7370 616e __getQuote(char │ │ │ -00154760: 202a 7379 6d62 6f6c 2c20 3c73 7061 6e20 *symbol, char │ │ │ -00154790: 2a63 6f75 6e74 7279 2c20 3c73 7061 6e20 *country, float │ │ │ -001547c0: 2026 616d 703b 7265 7375 6c74 293b 3c2f &result);.

T │ │ │ -001547f0: 6865 203c 656d 3e3c 636f 6465 3e71 756f he quo │ │ │ -00154800: 7465 782e 683c 2f63 6f64 653e 3c2f 656d tex.h example is a n │ │ │ -00154820: 6577 2057 6562 2053 6572 7669 6365 2063 ew Web Service c │ │ │ -00154830: 7265 6174 6564 2062 7920 636f 6d62 696e reated by combin │ │ │ -00154840: 696e 6720 7477 6f20 6578 6973 7469 6e67 ing two existing │ │ │ -00154850: 2057 6562 2053 6572 7669 6365 733a 2061 Web Services: a │ │ │ -00154860: 2053 746f 636b 2051 756f 7465 2073 6572 Stock Quote ser │ │ │ -00154870: 7669 6365 2061 6e64 2061 2043 7572 7265 vice and a Curre │ │ │ -00154880: 6e63 7920 4578 6368 616e 6765 2073 6572 ncy Exchange ser │ │ │ -00154890: 7669 6365 2e3c 2f70 3e0a 3c70 3e54 6865 vice.

.

The │ │ │ -001548a0: 206e 616d 6573 7061 6365 2070 7265 6669 namespace prefi │ │ │ -001548b0: 7820 3c63 6f64 653e 6e73 333c 2f63 6f64 x ns3 is used for t │ │ │ -001548d0: 6865 206e 6577 203c 636f 6465 3e71 756f he new quo │ │ │ -001548e0: 7465 783c 2f63 6f64 653e 2057 6562 2053 tex Web S │ │ │ -001548f0: 6572 7669 6365 2077 6974 6820 6e61 6d65 ervice with name │ │ │ -00154900: 7370 6163 6520 5552 4920 3c65 6d3e 3c63 space URI urn:quotex, serv │ │ │ -00154930: 6963 6520 6e61 6d65 203c 636f 6465 3e71 ice name q │ │ │ -00154940: 756f 7465 783c 2f63 6f64 653e 2c20 616e uotex, an │ │ │ -00154950: 6420 656e 6470 6f69 6e74 2070 6f72 7420 d endpoint port │ │ │ -00154960: 3c65 6d3e 3c63 6f64 653e 3c61 2068 7265 http://ww │ │ │ -001549a0: 772e 6d79 646f 6d61 696e 2e63 6f6d 2f71 w.mydomain.com/q │ │ │ -001549b0: 756f 7465 782e 6367 693c 2f61 3e3c 2f63 uotex.cgi.

.< │ │ │ -001549d0: 703e 5369 6e63 6520 7468 6520 6e65 7720 p>Since the new │ │ │ -001549e0: 5765 6220 5365 7276 6963 6520 696e 766f Web Service invo │ │ │ -001549f0: 6b65 7320 7468 6520 3c63 6f64 653e 6e73 kes the ns │ │ │ -00154a00: 315f 5f67 6574 5175 6f74 653c 2f63 6f64 1__getQuote and ns2 │ │ │ -00154a20: 5f5f 6765 7452 6174 653c 2f63 6f64 653e __getRate │ │ │ -00154a30: 2073 6572 7669 6365 206f 7065 7261 7469 service operati │ │ │ -00154a40: 6f6e 732c 2074 6865 2073 6572 7669 6365 ons, the service │ │ │ -00154a50: 206e 616d 6573 7061 6365 7320 616e 6420 namespaces and │ │ │ -00154a60: 6f74 6865 7220 6465 7461 696c 7320 7375 other details su │ │ │ -00154a70: 6368 2061 7320 7374 796c 6520 616e 6420 ch as style and │ │ │ -00154a80: 656e 636f 6469 6e67 206f 6620 7468 6573 encoding of thes │ │ │ -00154a90: 6520 6d65 7468 6f64 7320 6172 6520 6769 e methods are gi │ │ │ -00154aa0: 7665 6e20 6279 2064 6972 6563 7469 7665 ven by directive │ │ │ -00154ab0: 732e 2041 6674 6572 2069 6e76 6f6b 696e s. After invokin │ │ │ -00154ac0: 6720 7468 6520 736f 6170 6370 7032 2074 g the soapcpp2 t │ │ │ -00154ad0: 6f6f 6c20 6f6e 2074 6865 203c 656d 3e3c ool on the < │ │ │ -00154ae0: 636f 6465 3e71 756f 7465 782e 683c 2f63 code>quotex.h header │ │ │ -00154b00: 2066 696c 653a 203c 2f70 3e3c 7072 6520 file:

 soapcpp2 quote
│ │ │ -00154b30: 782e 680a 3c2f 7072 653e 3c70 3e20 7468  x.h.

th │ │ │ -00154b40: 6520 5753 444c 206f 6620 7468 6520 6e65 e WSDL of the ne │ │ │ -00154b50: 7720 3c63 6f64 653e 7175 6f74 6578 3c2f w quotex Web Servic │ │ │ -00154b70: 6520 6973 2073 6176 6564 2061 7320 3c65 e is saved as quotex.w │ │ │ -00154b90: 7364 6c3c 2f63 6f64 653e 3c2f 656d 3e2e sdl. │ │ │ -00154ba0: 2053 696e 6365 2074 6865 2073 6572 7669 Since the servi │ │ │ -00154bb0: 6365 206e 616d 652c 2065 6e64 706f 696e ce name, endpoin │ │ │ -00154bc0: 7420 706f 7274 2c20 616e 6420 6e61 6d65 t port, and name │ │ │ -00154bd0: 7370 6163 6520 5552 4920 7765 7265 2070 space URI were p │ │ │ -00154be0: 726f 7669 6465 6420 696e 2074 6865 2068 rovided in the h │ │ │ -00154bf0: 6561 6465 7220 6669 6c65 2c20 7468 6520 eader file, the │ │ │ -00154c00: 6765 6e65 7261 7465 6420 5753 444c 2066 generated WSDL f │ │ │ -00154c10: 696c 6520 6361 6e20 6265 2070 7562 6c69 ile can be publi │ │ │ -00154c20: 7368 6564 2074 6f67 6574 6865 7220 7769 shed together wi │ │ │ -00154c30: 7468 2074 6865 2063 6f6d 7069 6c65 6420 th the compiled │ │ │ -00154c40: 5765 6220 5365 7276 6963 6520 696e 7374 Web Service inst │ │ │ -00154c50: 616c 6c65 6420 6173 2061 2043 4749 2061 alled as a CGI a │ │ │ -00154c60: 7070 6c69 6361 7469 6f6e 2e3c 2f70 3e0a pplication.

. │ │ │ -00154c70: 3c70 3e54 6865 206e 616d 6573 7061 6365

The namespace │ │ │ -00154c80: 206d 6170 7069 6e67 2074 6162 6c65 2066 mapping table f │ │ │ -00154c90: 6f72 2074 6865 203c 656d 3e3c 636f 6465 or the quotex.cpp Web Serv │ │ │ -00154cc0: 6963 6520 696d 706c 656d 656e 7461 7469 ice implementati │ │ │ -00154cd0: 6f6e 2069 7320 7361 7665 6420 6173 203c on is saved as < │ │ │ -00154ce0: 656d 3e3c 636f 6465 3e71 756f 7465 782e em>quotex. │ │ │ -00154cf0: 6e73 6d61 703c 2f63 6f64 653e 3c2f 656d nsmap. This file can │ │ │ -00154d10: 2062 6520 6469 7265 6374 6c79 2069 6e63 be directly inc │ │ │ -00154d20: 6c75 6465 6420 696e 203c 656d 3e3c 636f luded in quotex.cpp instea │ │ │ -00154d50: 6420 6f66 2073 7065 6369 6669 6564 2062 d of specified b │ │ │ -00154d60: 7920 6861 6e64 2069 6e20 7468 6520 736f y hand in the so │ │ │ -00154d70: 7572 6365 206f 6620 3c65 6d3e 3c63 6f64 urce of quotex.cpp.

.

.... Back to table │ │ │ -00154dc0: 6f66 2063 6f6e 7465 6e74 733c 2f61 3e3c of contents< │ │ │ -00154dd0: 2f70 3e0a 3c68 323e 3c61 2063 6c61 7373 /p>.

.Tr │ │ │ -00154e00: 616e 7369 656e 7420 6461 7461 2074 7970 ansient data typ │ │ │ -00154e10: 6573 3c2f 6832 3e0a 3c70 3e54 6865 7265 es

.

There │ │ │ -00154e20: 2061 7265 2073 6974 7561 7469 6f6e 7320 are situations │ │ │ -00154e30: 7768 656e 2063 6572 7461 696e 2074 7970 when certain typ │ │ │ -00154e40: 6573 2068 6176 6520 746f 2062 6520 7573 es have to be us │ │ │ -00154e50: 6564 2069 6e20 616e 2069 6e74 6572 6661 ed in an interfa │ │ │ -00154e60: 6365 2068 6561 6465 7220 6669 6c65 2c20 ce header file, │ │ │ -00154e70: 6275 7420 7468 6520 7479 7065 7320 6172 but the types ar │ │ │ -00154e80: 6520 6e6f 7420 7365 7269 616c 697a 6162 e not serializab │ │ │ -00154e90: 6c65 2061 6e64 2074 6865 7265 666f 7265 le and therefore │ │ │ -00154ea0: 2068 6176 6520 746f 2062 6520 2269 6e76 have to be "inv │ │ │ -00154eb0: 6973 6962 6c65 2220 746f 2074 6865 2073 isible" to the s │ │ │ -00154ec0: 6f61 7063 7070 3220 746f 6f6c 2e20 5468 oapcpp2 tool. Th │ │ │ -00154ed0: 6573 6520 7479 7065 7320 6172 6520 6361 ese types are ca │ │ │ -00154ee0: 6c6c 6564 2074 7261 6e73 6965 6e74 2e3c lled transient.< │ │ │ -00154ef0: 2f70 3e0a 3c70 3e54 6869 7320 6665 6174 /p>.

This feat │ │ │ -00154f00: 7572 6520 6973 2075 7365 6675 6c20 7768 ure is useful wh │ │ │ -00154f10: 656e 2061 206c 6962 7261 7279 2074 7970 en a library typ │ │ │ -00154f20: 6520 6973 2075 7365 6420 696e 2074 6865 e is used in the │ │ │ -00154f30: 2069 6e74 6572 6661 6365 2068 6561 6465 interface heade │ │ │ -00154f40: 7220 6669 6c65 2061 7320 7061 7274 206f r file as part o │ │ │ -00154f50: 6620 6120 7374 7275 6374 206f 7220 636c f a struct or cl │ │ │ -00154f60: 6173 732c 2066 6f72 2065 7861 6d70 6c65 ass, for example │ │ │ -00154f70: 2074 6865 203c 636f 6465 3e46 494c 453c the FILE< │ │ │ -00154f80: 2f63 6f64 653e 2074 7970 6520 6f72 203c /code> type or < │ │ │ -00154f90: 636f 6465 3e73 7464 3a3a 6f73 7472 6561 code>std::ostrea │ │ │ -00154fa0: 6d3c 2f63 6f64 653e 2074 6861 7420 6172 m that ar │ │ │ -00154fb0: 6520 636c 6561 726c 7920 6e6f 7420 7365 e clearly not se │ │ │ -00154fc0: 7269 616c 697a 6162 6c65 2e20 4966 2074 rializable. If t │ │ │ -00154fd0: 6865 7365 2074 7970 6573 2061 7265 2069 hese types are i │ │ │ -00154fe0: 6e74 726f 6475 6365 6420 696e 2061 6e20 ntroduced in an │ │ │ -00154ff0: 696e 7465 7266 6163 6520 6865 6164 6572 interface header │ │ │ -00155000: 2066 696c 6520 7468 656e 2074 6865 7365 file then these │ │ │ -00155010: 2074 7970 6573 206d 7573 7420 6265 2064 types must be d │ │ │ -00155020: 6563 6c61 7265 6420 7472 616e 7369 656e eclared transien │ │ │ -00155030: 742e 204f 7468 6572 7769 7365 2c20 736f t. Otherwise, so │ │ │ -00155040: 6170 6370 7032 2077 696c 6c20 7468 726f apcpp2 will thro │ │ │ -00155050: 7720 616e 2065 7272 6f72 2e3c 2f70 3e0a w an error.

. │ │ │ -00155060: 3c70 3e54 6f20 6465 636c 6172 6520 6120

To declare a │ │ │ -00155070: 7472 616e 7369 656e 7420 7479 7065 2075 transient type u │ │ │ -00155080: 7365 203c 636f 6465 3e65 7874 6572 6e3c se extern< │ │ │ -00155090: 2f63 6f64 653e 2e20 466f 7220 6578 616d /code>. For exam │ │ │ -001550a0: 706c 653a 3c2f 703e 0a3c 6469 7620 636c ple:

.
< │ │ │ -001550c0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -001550d0: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >extern class │ │ │ -00155110: 203c 2f73 7061 6e3e 4649 4c45 3b3c 2f64 FILE;.

Ev │ │ │ -00155140: 656e 2074 686f 7567 6820 3c63 6f64 653e en though │ │ │ -00155150: 4649 4c45 3c2f 636f 6465 3e20 6973 206e FILE is n │ │ │ -00155160: 6f74 2061 2063 6c61 7373 2c20 7468 6973 ot a class, this │ │ │ -00155170: 2064 6563 6c61 7261 7469 6f6e 206d 6572 declaration mer │ │ │ -00155180: 656c 7920 696e 7472 6f64 7563 6573 2074 ely introduces t │ │ │ -00155190: 6865 203c 636f 6465 3e46 494c 453c 2f63 he FILE type name w │ │ │ -001551b0: 6974 686f 7574 2073 7065 6369 6679 696e ithout specifyin │ │ │ -001551c0: 6720 6974 7320 6465 7461 696c 732e 3c2f g its details..

In C we ca │ │ │ -001551e0: 6e20 7374 696c 6c20 7573 6520 7468 6520 n still use the │ │ │ -001551f0: 636c 6173 7320 6b65 7977 6f72 642c 2062 class keyword, b │ │ │ -00155200: 6563 6175 7365 206e 6f20 636f 6465 2069 ecause no code i │ │ │ -00155210: 7320 6765 6e65 7261 7465 6420 6279 2073 s generated by s │ │ │ -00155220: 6f61 7063 7070 3220 666f 7220 7468 6973 oapcpp2 for this │ │ │ -00155230: 2074 7261 6e73 6965 6e74 2074 7970 652e transient type. │ │ │ -00155240: 3c2f 703e 0a3c 703e 5765 2063 616e 2074

.

We can t │ │ │ -00155250: 6865 6e20 7573 6520 7468 6973 2074 7970 hen use this typ │ │ │ -00155260: 6520 656c 7365 7768 6572 652c 2066 6f72 e elsewhere, for │ │ │ -00155270: 2065 7861 6d70 6c65 3a3c 2f70 3e0a 3c64 example:

.
stru │ │ │ -001552c0: 6374 203c 2f73 7061 6e3e 6e73 5f5f 7265 ct ns__re │ │ │ -001552d0: 636f 7264 3c2f 6469 763e 0a3c 6469 7620 cord
.
{.
FILE │ │ │ -00155310: 2a66 643b 3c2f 6469 763e 0a3c 6469 7620 *fd;
.
│ │ │ -00155330: 203c 7370 616e 2063 6c61 7373 3d22 6b65 const ch │ │ │ -00155370: 6172 3c2f 7370 616e 3e20 2a6e 616d 653b ar *name; │ │ │ -00155380: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
};
.

Only │ │ │ -001553c0: 2074 6865 203c 636f 6465 3e6e 616d 653c the name< │ │ │ -001553d0: 2f63 6f64 653e 206d 656d 6265 7220 6973 /code> member is │ │ │ -001553e0: 2073 6572 6961 6c69 7a65 6420 6f66 203c serialized of < │ │ │ -001553f0: 636f 6465 3e6e 735f 5f72 6563 6f72 643c code>ns__record< │ │ │ -00155400: 2f63 6f64 653e 2e3c 2f70 3e0a 3c70 3e41 /code>.

.

A │ │ │ -00155410: 6e6f 7468 6572 2065 7861 6d70 6c65 3a3c nother example:< │ │ │ -00155420: 2f70 3e0a 3c64 6976 2063 6c61 7373 3d22 /p>.

extern │ │ │ -00155470: 3c73 7061 6e20 636c 6173 733d 226b 6579 class std::ostream; │ │ │ -001554a0: 203c 7370 616e 2063 6c61 7373 3d22 636f // std::o │ │ │ -001554c0: 7374 7265 616d 2063 616e 2623 3339 3b74 stream can't │ │ │ -001554d0: 2062 6520 7365 7269 616c 697a 6564 2c20 be serialized, │ │ │ -001554e0: 6275 7420 6e65 6564 2074 6f20 6265 2064 but need to be d │ │ │ -001554f0: 6563 6c61 7265 643c 2f73 7061 6e3e 3c2f eclared.
cla │ │ │ -00155530: 7373 203c 2f73 7061 6e3e 6e73 5f5f 6d79 ss ns__my │ │ │ -00155540: 436c 6173 7320 3c2f 6469 763e 0a3c 6469 Class
.{ │ │ │ -00155560: 203c 7370 616e 2063 6c61 7373 3d22 6b65 public:
.
│ │ │ -001555a0: 2020 3c73 7061 6e20 636c 6173 733d 226b virtual< │ │ │ -001555c0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> void pri │ │ │ -001555f0: 6e74 2873 7464 3a3a 6f73 7472 6561 6d20 nt(std::ostream │ │ │ -00155600: 2661 6d70 3b73 2920 3c73 7061 6e20 636c &s) co │ │ │ -00155620: 6e73 743c 2f73 7061 6e3e 3b20 3c73 7061 nst; // need ostrea │ │ │ -00155650: 6d20 6865 7265 203c 2f73 7061 6e3e 3c2f m here .
... < │ │ │ -00155680: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ -00155690: 656e 7422 3e2f 2f3c 2f73 7061 6e3e 3c2f ent">//.
};
. │ │ │ -001556c0: 3c2f 6469 763e 3c21 2d2d 2066 7261 676d

In oth │ │ │ -001556e0: 6572 2063 6173 6573 2077 6520 646f 2077 er cases we do w │ │ │ -001556f0: 616e 7420 746f 2064 6563 6c61 7265 2061 ant to declare a │ │ │ -00155700: 2074 7970 6520 7468 6174 2073 6f61 7063 type that soapc │ │ │ -00155710: 7070 3220 7368 6f75 6c64 2063 6f70 7920 pp2 should copy │ │ │ -00155720: 696e 746f 203c 656d 3e3c 636f 6465 3e73 into s │ │ │ -00155730: 6f61 7053 7475 622e 683c 2f63 6f64 653e oapStub.h │ │ │ -00155740: 3c2f 656d 3e20 666f 7220 7468 6520 6170 for the ap │ │ │ -00155750: 706c 6963 6174 696f 6e20 736f 7572 6365 plication source │ │ │ -00155760: 2063 6f64 652c 2062 7574 2077 6869 6368 code, but which │ │ │ -00155770: 2073 686f 756c 6420 6e6f 7420 6265 2073 should not be s │ │ │ -00155780: 6572 6961 6c69 7a61 626c 652e 2057 6520 erializable. We │ │ │ -00155790: 6361 6e20 7573 6520 3c63 6f64 653e 6578 can use ex │ │ │ -001557a0: 7465 726e 3c2f 636f 6465 3e20 666f 7220 tern for │ │ │ -001557b0: 7468 6973 206f 7220 7075 7420 7468 6520 this or put the │ │ │ -001557c0: 6465 636c 6172 6174 696f 6e20 696e 203c declaration in < │ │ │ -001557d0: 636f 6465 3e5b 3c2f 636f 6465 3e20 616e code>[ an │ │ │ -001557e0: 6420 3c63 6f64 653e 5d3c 2f63 6f64 653e d ] │ │ │ -001557f0: 2062 7261 636b 6574 733a 3c2f 703e 0a3c brackets:

.< │ │ │ -00155800: 6469 7620 636c 6173 733d 2266 7261 676d div class="fragm │ │ │ -00155810: 656e 7422 3e3c 6469 7620 636c 6173 733d ent">
[
. │ │ │ -00155830: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
class │ │ │ -00155860: 3c2f 7370 616e 3e6e 735f 5f6d 7942 6173 ns__myBas │ │ │ -00155870: 6520 3c73 7061 6e20 636c 6173 733d 2263 e // base │ │ │ -00155890: 636c 6173 7320 6e65 6564 206e 6f74 2062 class need not b │ │ │ -001558a0: 6520 7365 7269 616c 697a 6162 6c65 3c2f e serializable
.
│ │ │ -001558d0: 7b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 {
.
.. │ │ │ -001558f0: 2e20 3c73 7061 6e20 636c 6173 733d 2263 . // membe │ │ │ -00155910: 7273 3c2f 7370 616e 3e3c 2f64 6976 3e0a rs
. │ │ │ -00155920: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
};
. │ │ │ -00155950: 5d20 3c2f 6469 763e 0a3c 6469 7620 636c ]
.
class ns │ │ │ -00155990: 5f5f 6d79 4465 7269 7665 6420 3a20 6e73 __myDerived : ns │ │ │ -001559a0: 5f5f 6d79 4261 7365 203c 2f64 6976 3e0a __myBase
. │ │ │ -001559b0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
{
.
.. │ │ │ -001559e0: 2e20 3c73 7061 6e20 636c 6173 733d 2263 . // membe │ │ │ -00155a00: 7273 3c2f 7370 616e 3e3c 2f64 6976 3e0a rs
. │ │ │ -00155a10: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
};
.

We can use │ │ │ -00155a50: 203c 636f 6465 3e5b 3c2f 636f 6465 3e20 [ │ │ │ -00155a60: 616e 6420 3c63 6f64 653e 5d3c 2f63 6f64 and ] brackets for │ │ │ -00155a80: 7061 7274 7320 6f66 2074 6865 2063 6f64 parts of the cod │ │ │ -00155a90: 652c 2066 6f72 2065 7861 6d70 6c65 2074 e, for example t │ │ │ -00155aa0: 6f20 6d61 6b65 2073 6576 6572 616c 2063 o make several c │ │ │ -00155ab0: 6c61 7373 206d 656d 6265 7273 2074 7261 lass members tra │ │ │ -00155ac0: 6e73 6965 6e74 3a3c 2f70 3e0a 3c64 6976 nsient:

.
[ type │ │ │ -00155b10: 6465 663c 2f73 7061 6e3e 203c 7370 616e def int │ │ │ -00155b40: 7472 616e 7369 656e 7449 6e74 3b20 5d20 transientInt; ] │ │ │ -00155b50: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
c │ │ │ -00155b80: 6c61 7373 203c 2f73 7061 6e3e 6e73 5f5f lass ns__ │ │ │ -00155b90: 6d79 436c 6173 7320 3c2f 6469 763e 0a3c myClass
.< │ │ │ -00155ba0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -00155bb0: 3e7b 3c2f 6469 763e 0a3c 6469 7620 636c >{
.
int a; // wi │ │ │ -00155c10: 6c6c 2062 6520 7365 7269 616c 697a 6564 ll be serialized │ │ │ -00155c20: 203c 2f73 7061 6e3e 3c2f 6469 763e 0a3c
.< │ │ │ -00155c30: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -00155c40: 3e20 205b 203c 2f64 6976 3e0a 3c64 6976 > [
.
│ │ │ -00155c60: 3c73 7061 6e20 636c 6173 733d 226b 6579 int b; // │ │ │ -00155ca0: 2074 7261 6e73 6965 6e74 206d 656d 6265 transient membe │ │ │ -00155cb0: 7220 3c2f 7370 616e 3e3c 2f64 6976 3e0a r
. │ │ │ -00155cc0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
ch │ │ │ -00155cf0: 6172 3c2f 7370 616e 3e20 735b 3235 365d ar s[256] │ │ │ -00155d00: 3b20 3c73 7061 6e20 636c 6173 733d 2263 ; // trans │ │ │ -00155d20: 6965 6e74 206d 656d 6265 7220 3c2f 7370 ient member
.
] │ │ │ -00155d50: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
extern │ │ │ -00155d90: 3c73 7061 6e20 636c 6173 733d 226b 6579 float< │ │ │ -00155db0: 2f73 7061 6e3e 2064 3b20 3c73 7061 6e20 /span> d; │ │ │ -00155dd0: 2f2f 2074 7261 6e73 6965 6e74 2074 7970 // transient typ │ │ │ -00155de0: 6520 666c 6f61 7420 616e 6420 6d65 6d62 e float and memb │ │ │ -00155df0: 6572 3c2f 7370 616e 3e3c 2f64 6976 3e0a er
. │ │ │ -00155e00: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
ch │ │ │ -00155e30: 6172 3c2f 7370 616e 3e20 2a74 3b20 3c73 ar *t; // will be s │ │ │ -00155e60: 6572 6961 6c69 7a65 6420 3c2f 7370 616e erialized
.
tran │ │ │ -00155e90: 7369 656e 7449 6e74 202a 6e3b 203c 7370 sientInt *n; // transient │ │ │ -00155ec0: 7479 7065 2069 6e74 2061 6e64 206d 656d type int and mem │ │ │ -00155ed0: 6265 7220 3c2f 7370 616e 3e3c 2f64 6976 ber
.
[
.< │ │ │ -00155f00: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -00155f10: 3e20 203c 7370 616e 2063 6c61 7373 3d22 > virtual │ │ │ -00155f30: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c void me │ │ │ -00155f60: 7468 6f64 283c 7370 616e 2063 6c61 7373 thod(c │ │ │ -00155f80: 6861 723c 2f73 7061 6e3e 2062 7566 5b31 har buf[1 │ │ │ -00155f90: 3032 345d 293b 203c 7370 616e 2063 6c61 024]); // │ │ │ -00155fb0: 646f 6573 206e 6f74 2063 7265 6174 6520 does not create │ │ │ -00155fc0: 6120 6368 6172 5b31 3032 345d 2073 6572 a char[1024] ser │ │ │ -00155fd0: 6961 6c69 7a65 7220 3c2f 7370 616e 3e3c ializer < │ │ │ -00155fe0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
] .
};
.< │ │ │ -00156020: 2f64 6976 3e3c 212d 2d20 6672 6167 6d65 /div>

In this │ │ │ -00156040: 2065 7861 6d70 6c65 2c20 3c63 6f64 653e example, │ │ │ -00156050: 6e73 5f5f 6d79 436c 6173 733c 2f63 6f64 ns__myClass has three tra │ │ │ -00156070: 6e73 6965 6e74 206d 656d 6265 7273 3a20 nsient members: │ │ │ -00156080: 3c63 6f64 653e 623c 2f63 6f64 653e 2c20 b, │ │ │ -00156090: 3c63 6f64 653e 733c 2f63 6f64 653e 2c20 s, │ │ │ -001560a0: 616e 6420 3c63 6f64 653e 6e3c 2f63 6f64 and n which will no │ │ │ -001560c0: 7420 6265 2073 6572 6961 6c69 7a65 642e t be serialized. │ │ │ -001560d0: 204d 656d 6265 7220 3c63 6f64 653e 6e3c Member n< │ │ │ -001560e0: 2f63 6f64 653e 2069 7320 7472 616e 7369 /code> is transi │ │ │ -001560f0: 656e 7420 6265 6361 7573 6520 7468 6520 ent because the │ │ │ -00156100: 7479 7065 2069 7320 6465 636c 6172 6564 type is declared │ │ │ -00156110: 2077 6974 6869 6e20 6120 7472 616e 7369 within a transi │ │ │ -00156120: 656e 7420 626c 6f63 6b2e 2050 6f69 6e74 ent block. Point │ │ │ -00156130: 6572 732c 2072 6566 6572 656e 6365 732c ers, references, │ │ │ -00156140: 2061 6e64 2061 7272 6179 7320 6f66 2074 and arrays of t │ │ │ -00156150: 7261 6e73 6965 6e74 2074 7970 6573 2061 ransient types a │ │ │ -00156160: 7265 2074 7261 6e73 6965 6e74 2e20 5468 re transient. Th │ │ │ -00156170: 6520 7369 6e67 6c65 2063 6c61 7373 206d e single class m │ │ │ -00156180: 6574 686f 6420 6973 2065 6e63 6170 7375 ethod is encapsu │ │ │ -00156190: 6c61 7465 6420 7769 7468 696e 203c 636f lated within [ and │ │ │ -001561b0: 3c63 6f64 653e 5d3c 2f63 6f64 653e 2074 ] t │ │ │ -001561c0: 6f20 7072 6576 656e 7420 736f 6170 6370 o prevent soapcp │ │ │ -001561d0: 7032 2066 726f 6d20 6372 6561 7469 6e67 p2 from creating │ │ │ -001561e0: 2073 6572 6961 6c69 7a65 7273 2066 6f72 serializers for │ │ │ -001561f0: 2074 6865 203c 636f 6465 3e63 6861 725b the char[ │ │ │ -00156200: 3130 3234 5d3c 2f63 6f64 653e 2074 7970 1024] typ │ │ │ -00156210: 652e 3c2f 703e 0a3c 703e 5765 2061 6c73 e.

.

We als │ │ │ -00156220: 6f20 7573 6520 3c63 6f64 653e 5b3c 2f63 o use [ and ] │ │ │ -00156240: 3c2f 636f 6465 3e20 6272 6163 6b65 7473 brackets │ │ │ -00156250: 2074 6f20 696e 7472 6f64 7563 6520 6120 to introduce a │ │ │ -00156260: 7472 616e 7369 656e 7420 696e 7465 6765 transient intege │ │ │ -00156270: 7220 7479 7065 203c 636f 6465 3e74 7261 r type tra │ │ │ -00156280: 6e73 6965 6e74 496e 743c 2f63 6f64 653e nsientInt │ │ │ -00156290: 2075 7369 6e67 2061 2074 7970 6564 6566 using a typedef │ │ │ -001562a0: 2e20 5765 2063 616e 6e6f 7420 7573 6520 . We cannot use │ │ │ -001562b0: 3c63 6f64 653e 6578 7465 726e 3c2f 636f extern with t │ │ │ -001562d0: 7970 6564 6566 3c2f 636f 6465 3e20 6265 ypedef be │ │ │ -001562e0: 6361 7573 6520 7468 6973 2063 6f6e 7374 cause this const │ │ │ -001562f0: 7275 6374 2069 7320 7265 7365 7276 6564 ruct is reserved │ │ │ -00156300: 2066 6f72 2063 7573 746f 6d20 7365 7269 for custom seri │ │ │ -00156310: 616c 697a 6572 732e 3c2f 703e 0a3c 703e alizers.

.

│ │ │ -00156320: f09f 949d 203c 6120 6872 6566 3d22 2322 .... Back to table o │ │ │ -00156340: 6620 636f 6e74 656e 7473 3c2f 613e 3c2f f contents.

.Seri │ │ │ -00156380: 616c 697a 6174 696f 6e20 2261 7320 6973 alization "as is │ │ │ -00156390: 2220 6f66 2076 6f6c 6174 696c 6520 6461 " of volatile da │ │ │ -001563a0: 7461 2074 7970 6573 3c2f 6832 3e0a 3c70 ta types

.

Types declared │ │ │ -001563c0: 3c63 6f64 653e 766f 6c61 7469 6c65 3c2f volatile in an inte │ │ │ -001563e0: 7266 6163 6520 6865 6164 6572 2066 696c rface header fil │ │ │ -001563f0: 6520 6172 6520 7365 7269 616c 697a 6162 e are serializab │ │ │ -00156400: 6c65 2062 7574 206e 6f74 2063 6f70 6965 le but not copie │ │ │ -00156410: 6420 6279 2073 6f61 7063 7070 3220 746f d by soapcpp2 to │ │ │ -00156420: 203c 656d 3e3c 636f 6465 3e73 6f61 7053 soapS │ │ │ -00156430: 7475 622e 683c 2f63 6f64 653e 3c2f 656d tub.h. These types a │ │ │ -00156450: 7265 2074 7970 6963 616c 6c79 206c 6962 re typically lib │ │ │ -00156460: 7261 7279 2074 7970 6573 2074 6861 7420 rary types that │ │ │ -00156470: 6172 6520 696e 636c 7564 6564 2069 6e20 are included in │ │ │ -00156480: 7468 6520 736f 7572 6365 2063 6f64 6520 the source code │ │ │ -00156490: 616e 6420 7368 6f75 6c64 206e 6f74 2062 and should not b │ │ │ -001564a0: 6520 7265 6465 6669 6e65 6420 696e 2074 e redefined in t │ │ │ -001564b0: 6865 2061 7070 6c69 6361 7469 6f6e 2073 he application s │ │ │ -001564c0: 6f75 7263 6520 636f 6465 2e20 5765 2077 ource code. We w │ │ │ -001564d0: 616e 7420 746f 2073 6572 6961 6c69 7a65 ant to serialize │ │ │ -001564e0: 2074 6865 7365 206c 6962 7261 7279 2074 these library t │ │ │ -001564f0: 7970 6573 2022 6173 2069 7322 2077 6974 ypes "as is" wit │ │ │ -00156500: 686f 7574 2072 6564 6566 696e 696e 6720 hout redefining │ │ │ -00156510: 7468 656d 2e3c 2f70 3e0a 3c70 3e43 6f6e them.

.

Con │ │ │ -00156520: 7369 6465 7220 666f 7220 6578 616d 706c sider for exampl │ │ │ -00156530: 6520 3c63 6f64 653e 7374 7275 6374 2074 e struct t │ │ │ -00156540: 6d3c 2f63 6f64 653e 2c20 6465 636c 6172 m, declar │ │ │ -00156550: 6564 2069 6e20 3c65 6d3e 3c63 6f64 653e ed in │ │ │ -00156560: 7469 6d65 2e68 3c2f 636f 6465 3e3c 2f65 time.h. The structur │ │ │ -00156580: 6520 6d61 7920 6163 7475 616c 6c79 2076 e may actually v │ │ │ -00156590: 6172 7920 6265 7477 6565 6e20 706c 6174 ary between plat │ │ │ -001565a0: 666f 726d 732c 2062 7574 2074 6865 203c forms, but the < │ │ │ -001565b0: 636f 6465 3e74 6d3c 2f63 6f64 653e 2073 code>tm s │ │ │ -001565c0: 7472 7563 7475 7265 2069 6e63 6c75 6465 tructure include │ │ │ -001565d0: 7320 6174 206c 6561 7374 2074 6865 2066 s at least the f │ │ │ -001565e0: 6f6c 6c6f 7769 6e67 206d 656d 6265 7273 ollowing members │ │ │ -001565f0: 2061 7320 6465 636c 6172 6564 2069 6e20 as declared in │ │ │ -00156600: 7468 6520 666f 6c6c 6f77 696e 6720 696e the following in │ │ │ -00156610: 7465 7266 6163 6520 6865 6164 6572 2066 terface header f │ │ │ -00156620: 696c 6520 666f 7220 736f 6170 6370 7032 ile for soapcpp2 │ │ │ -00156630: 3a3c 2f70 3e0a 3c64 6976 2063 6c61 7373 :

.
#includ │ │ │ -00156680: 6520 266c 743b 7469 6d65 2e68 2667 743b e <time.h> │ │ │ -00156690: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ -001566b0: 3c73 7061 6e20 636c 6173 733d 226b 6579 volatile stru │ │ │ -001566f0: 6374 203c 2f73 7061 6e3e 746d 203c 2f64 ct tm .
{
. │ │ │ -00156730: 2020 2020 3c73 7061 6e20 636c 6173 733d in │ │ │ -00156750: 743c 2f73 7061 6e3e 2074 6d5f 7365 633b t tm_sec; │ │ │ -00156760: 2020 2020 2020 2020 203c 7370 616e 2063 / │ │ │ -00156780: 2a20 7365 636f 6e64 7320 2830 202d 2036 * seconds (0 - 6 │ │ │ -00156790: 3029 202a 2f3c 2f73 7061 6e3e 203c 2f64 0) */ .
int t │ │ │ -001567e0: 6d5f 6d69 6e3b 2020 2020 2020 2020 203c m_min; < │ │ │ -001567f0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ -00156800: 656e 7422 3e2f 2a20 6d69 6e75 7465 7320 ent">/* minutes │ │ │ -00156810: 2830 202d 2035 3929 202a 2f3c 2f73 7061 (0 - 59) */
.
│ │ │ -00156840: 3c73 7061 6e20 636c 6173 733d 226b 6579 int tm_hour; │ │ │ -00156870: 2020 2020 203c 7370 616e 2063 6c61 7373 /* ho │ │ │ -00156890: 7572 7320 2830 202d 2032 3329 202a 2f3c urs (0 - 23) */< │ │ │ -001568a0: 2f73 7061 6e3e 203c 2f64 6976 3e0a 3c64 /span>
. │ │ │ -001568c0: 2020 2020 3c73 7061 6e20 636c 6173 733d in │ │ │ -001568e0: 743c 2f73 7061 6e3e 2074 6d5f 6d64 6179 t tm_mday │ │ │ -001568f0: 3b20 2020 2020 2020 203c 7370 616e 2063 ; / │ │ │ -00156910: 2a20 6461 7920 6f66 206d 6f6e 7468 2028 * day of month ( │ │ │ -00156920: 3120 2d20 3331 2920 2a2f 3c2f 7370 616e 1 - 31) */
.
< │ │ │ -00156950: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -00156960: 6f72 6474 7970 6522 3e69 6e74 3c2f 7370 ordtype">int tm_mon; │ │ │ -00156980: 2020 2020 3c73 7061 6e20 636c 6173 733d /* mon │ │ │ -001569a0: 7468 206f 6620 7965 6172 2028 3020 2d20 th of year (0 - │ │ │ -001569b0: 3131 2920 2a2f 3c2f 7370 616e 3e20 3c2f 11) */ .
int │ │ │ -00156a00: 746d 5f79 6561 723b 2020 2020 2020 2020 tm_year; │ │ │ -00156a10: 3c73 7061 6e20 636c 6173 733d 2263 6f6d /* year - │ │ │ -00156a30: 3139 3030 202a 2f3c 2f73 7061 6e3e 203c 1900 */ < │ │ │ -00156a40: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
int │ │ │ -00156a80: 2074 6d5f 7764 6179 3b20 2020 2020 2020 tm_wday; │ │ │ -00156a90: 203c 7370 616e 2063 6c61 7373 3d22 636f /* day of │ │ │ -00156ab0: 2077 6565 6b20 2853 756e 6461 7920 3d20 week (Sunday = │ │ │ -00156ac0: 3029 202a 2f3c 2f73 7061 6e3e 203c 2f64 0) */ .
int t │ │ │ -00156b10: 6d5f 7964 6179 3b20 2020 2020 2020 203c m_yday; < │ │ │ -00156b20: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ -00156b30: 656e 7422 3e2f 2a20 6461 7920 6f66 2079 ent">/* day of y │ │ │ -00156b40: 6561 7220 2830 202d 2033 3635 2920 2a2f ear (0 - 365) */ │ │ │ -00156b50: 3c2f 7370 616e 3e20 3c2f 6469 763e 0a3c
.< │ │ │ -00156b60: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -00156b70: 3e20 2020 203c 7370 616e 2063 6c61 7373 > i │ │ │ -00156b90: 6e74 3c2f 7370 616e 3e20 746d 5f69 7364 nt tm_isd │ │ │ -00156ba0: 7374 3b20 2020 2020 2020 3c73 7061 6e20 st; │ │ │ -00156bc0: 2f2a 2069 7320 7375 6d6d 6572 2074 696d /* is summer tim │ │ │ -00156bd0: 6520 696e 2065 6666 6563 743f 202a 2f3c e in effect? */< │ │ │ -00156be0: 2f73 7061 6e3e 203c 2f64 6976 3e0a 3c64 /span>
. │ │ │ -00156c00: 2020 2020 3c73 7061 6e20 636c 6173 733d ch │ │ │ -00156c20: 6172 3c2f 7370 616e 3e20 2a74 6d5f 7a6f ar *tm_zo │ │ │ -00156c30: 6e65 3b20 2020 2020 2020 203c 7370 616e ne; /* abbreviation │ │ │ -00156c60: 206f 6620 7469 6d65 7a6f 6e65 206e 616d of timezone nam │ │ │ -00156c70: 6520 2a2f 3c2f 7370 616e 3e20 3c2f 6469 e */ .
long t │ │ │ -00156cc0: 6d5f 676d 746f 6666 3b20 2020 2020 203c m_gmtoff; < │ │ │ -00156cd0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ -00156ce0: 656e 7422 3e2f 2a20 6f66 6673 6574 2066 ent">/* offset f │ │ │ -00156cf0: 726f 6d20 5554 4320 696e 2073 6563 6f6e rom UTC in secon │ │ │ -00156d00: 6473 202a 2f3c 2f73 7061 6e3e 203c 2f64 ds */ .
};
.< │ │ │ -00156d30: 2f64 6976 3e3c 212d 2d20 6672 6167 6d65 /div>

By decl │ │ │ -00156d50: 6172 696e 6720 7374 7275 6374 203c 636f aring struct tm vol │ │ │ -00156d70: 6174 696c 652c 2073 6f61 7063 7070 3220 atile, soapcpp2 │ │ │ -00156d80: 646f 6573 206e 6f74 2072 6564 6566 696e does not redefin │ │ │ -00156d90: 6520 6974 2069 6e20 7468 6520 6f75 7470 e it in the outp │ │ │ -00156da0: 7574 2073 6f75 7263 6520 636f 6465 2e20 ut source code. │ │ │ -00156db0: 5468 6520 3c63 6f64 653e 2369 6e63 6c75 The #inclu │ │ │ -00156dc0: 6465 2026 6c74 3b74 696d 652e 6826 6774 de <time.h> │ │ │ -00156dd0: 3b3c 2f63 6f64 653e 2069 7320 636f 7069 ; is copi │ │ │ -00156de0: 6564 2074 6f20 7468 6520 736f 7572 6365 ed to the source │ │ │ -00156df0: 2063 6f64 6520 6f75 7470 7574 2e20 5765 code output. We │ │ │ -00156e00: 2063 616e 206e 6f77 2073 6572 6961 6c69 can now seriali │ │ │ -00156e10: 7a65 2074 6865 203c 636f 6465 3e74 6d3c ze the tm< │ │ │ -00156e20: 2f63 6f64 653e 2073 7472 7563 7475 7265 /code> structure │ │ │ -00156e30: 2e20 5468 6520 666f 6c6c 6f77 696e 6720 . The following │ │ │ -00156e40: 6578 616d 706c 6520 7365 7269 616c 697a example serializ │ │ │ -00156e50: 6573 2074 6865 206c 6f63 616c 2074 696d es the local tim │ │ │ -00156e60: 6520 7374 6f72 6564 2069 6e20 6120 3c63 e stored in a tm st │ │ │ -00156e80: 7275 6374 7572 6520 746f 2073 7464 6f75 ructure to stdou │ │ │ -00156e90: 743a 3c2f 703e 0a3c 6469 7620 636c 6173 t:

.
< │ │ │ -00156ec0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -00156ed0: 6f72 6422 3e73 7472 7563 7420 3c2f 7370 ord">struct soap *soap< │ │ │ -00156f40: 2f61 3e20 3d20 3c61 2063 6c61 7373 3d22 /a> = soap_ │ │ │ -00156fa0: 6e65 773c 2f61 3e28 293b 203c 2f64 6976 new();
.
time_t T = t │ │ │ -00156fd0: 696d 6528 4e55 4c4c 293b 203c 2f64 6976 ime(NULL);
.
struct │ │ │ -00157010: 203c 2f73 7061 6e3e 746d 202a 7420 3d20 tm *t = │ │ │ -00157020: 6c6f 6361 6c74 696d 6528 2661 6d70 3b54 localtime(&T │ │ │ -00157030: 293b 203c 2f64 6976 3e0a 3c64 6976 2063 );
.
soap │ │ │ -00157050: 5f77 7269 7465 5f74 6d28 3c61 2063 6c61 _write_tm(soap, t); < │ │ │ -00157090: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
soa │ │ │ -00157100: 705f 6465 7374 726f 793c 2f61 3e28 3c61 p_destroy(soap); │ │ │ -00157140: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.

It is │ │ │ -001572c0: 2061 6c73 6f20 706f 7373 6962 6c65 2074 also possible t │ │ │ -001572d0: 6f20 7365 7269 616c 697a 6520 7468 6520 o serialize the │ │ │ -001572e0: 3c63 6f64 653e 746d 3c2f 636f 6465 3e20 tm │ │ │ -001572f0: 6d65 6d62 6572 7320 6173 2058 4d4c 2061 members as XML a │ │ │ -00157300: 7474 7269 6275 7465 7320 6279 2064 6563 ttributes by dec │ │ │ -00157310: 6c61 7269 6e67 2074 6865 206d 656d 6265 laring the membe │ │ │ -00157320: 7273 2061 7320 6174 7472 6962 7574 6573 rs as attributes │ │ │ -00157330: 2077 6974 6820 7468 6520 3c63 6f64 653e with the │ │ │ -00157340: 403c 2f63 6f64 653e 2071 7561 6c69 6669 @ qualifi │ │ │ -00157350: 6572 2c20 7365 6520 5365 6374 696f 6e20 er, see Section │ │ │ -00157360: 3c61 2063 6c61 7373 3d22 656c 2220 6872 How t │ │ │ -00157390: 6f20 6465 636c 6172 6520 584d 4c20 6174 o declare XML at │ │ │ -001573a0: 7472 6962 7574 6573 3c2f 613e 202e 3c2f tributes ..

If you wan │ │ │ -001573c0: 7420 746f 2070 726f 6475 6365 2061 2073 t to produce a s │ │ │ -001573d0: 6368 656d 6120 6669 6c65 2c20 7361 7920 chema file, say │ │ │ -001573e0: 3c65 6d3e 3c63 6f64 653e 7469 6d65 2e78 time.x │ │ │ -001573f0: 7364 3c2f 636f 6465 3e3c 2f65 6d3e 2c20 sd, │ │ │ -00157400: 7468 6174 2064 6566 696e 6573 2061 6e20 that defines an │ │ │ -00157410: 584d 4c20 7363 6865 6d61 2061 6e64 206e XML schema and n │ │ │ -00157420: 616d 6573 7061 6365 2066 6f72 2074 6865 amespace for the │ │ │ -00157430: 203c 636f 6465 3e74 6d3c 2f63 6f64 653e tm │ │ │ -00157440: 2073 7472 7563 742c 2079 6f75 2063 616e struct, you can │ │ │ -00157450: 2061 6464 2061 203c 636f 6465 3e74 7970 add a typ │ │ │ -00157460: 6564 6566 3c2f 636f 6465 3e20 6465 636c edef decl │ │ │ -00157470: 6172 6174 696f 6e20 746f 2074 6865 2068 aration to the h │ │ │ -00157480: 6561 6465 7220 6669 6c65 3a3c 2f70 3e0a eader file:

. │ │ │ -00157490: 3c64 6976 2063 6c61 7373 3d22 6672 6167
#include < │ │ │ -001574e0: 7469 6d65 2e68 2667 743b 3c2f 7370 616e time.h>
.
│ │ │ -00157520: 766f 6c61 7469 6c65 3c2f 7370 616e 3e20 volatile │ │ │ -00157530: 3c73 7061 6e20 636c 6173 733d 226b 6579 struct tm
.{ │ │ │ -00157570: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
... │ │ │ -00157590: 203c 7370 616e 2063 6c61 7373 3d22 636f // see ab │ │ │ -001575b0: 6f76 653c 2f73 7061 6e3e 3c2f 6469 763e ove
│ │ │ -001575c0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
};
.
typedef struct │ │ │ -00157630: 3c2f 7370 616e 3e74 6d20 7469 6d65 5f5f tm time__ │ │ │ -00157640: 7374 7275 6374 5f74 6d3b 3c2f 6469 763e struct_tm;
│ │ │ -00157650: 0a3c 2f64 6976 3e3c 212d 2d20 6672 6167 .

or si │ │ │ -00157670: 6d70 6c79 2075 7365 2063 6f6c 6f6e 206e mply use colon n │ │ │ -00157680: 6f74 6174 696f 6e20 7369 6e63 6520 7765 otation since we │ │ │ -00157690: 206b 6565 7020 7468 6520 3c63 6f64 653e keep the │ │ │ -001576a0: 746d 3c2f 636f 6465 3e20 6e61 6d65 3a3c tm name:< │ │ │ -001576b0: 2f70 3e0a 3c64 6976 2063 6c61 7373 3d22 /p>.

#include │ │ │ -00157700: 266c 743b 7469 6d65 2e68 2667 743b 3c2f <time.h>
.
volatile struct │ │ │ -00157770: 203c 2f73 7061 6e3e 7469 6d65 3a74 6d20 time:tm │ │ │ -00157780: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
{
│ │ │ -001577a0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
int tm_s │ │ │ -001577e0: 6563 3b20 2020 2020 2020 2020 3c73 7061 ec; /* seconds (0 │ │ │ -00157810: 2d20 3630 2920 2a2f 3c2f 7370 616e 3e20 - 60) */ │ │ │ -00157820: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
int tm_min; │ │ │ -00157870: 2020 3c73 7061 6e20 636c 6173 733d 2263 /* minut │ │ │ -00157890: 6573 2028 3020 2d20 3539 2920 2a2f 3c2f es (0 - 59) */
. │ │ │ -001578c0: 2020 203c 7370 616e 2063 6c61 7373 3d22 int │ │ │ -001578e0: 3c2f 7370 616e 3e20 746d 5f68 6f75 723b tm_hour; │ │ │ -001578f0: 2020 2020 2020 2020 3c73 7061 6e20 636c /* │ │ │ -00157910: 2068 6f75 7273 2028 3020 2d20 3233 2920 hours (0 - 23) │ │ │ -00157920: 2a2f 3c2f 7370 616e 3e20 3c2f 6469 763e */
│ │ │ -00157930: 0a3c 6469 7620 636c 6173 733d 226c 696e .
int tm_m │ │ │ -00157970: 6461 793b 2020 2020 2020 2020 3c73 7061 day; /* day of mont │ │ │ -001579a0: 6820 2831 202d 2033 3129 202a 2f3c 2f73 h (1 - 31) */
.
│ │ │ -001579d0: 2020 3c73 7061 6e20 636c 6173 733d 226b int< │ │ │ -001579f0: 2f73 7061 6e3e 2074 6d5f 6d6f 6e3b 2020 /span> tm_mon; │ │ │ -00157a00: 2020 2020 2020 203c 7370 616e 2063 6c61 /* │ │ │ -00157a20: 6d6f 6e74 6820 6f66 2079 6561 7220 2830 month of year (0 │ │ │ -00157a30: 202d 2031 3129 202a 2f3c 2f73 7061 6e3e - 11) */ │ │ │ -00157a40: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
int tm_year; │ │ │ -00157a90: 2020 203c 7370 616e 2063 6c61 7373 3d22 /* year │ │ │ -00157ab0: 202d 2031 3930 3020 2a2f 3c2f 7370 616e - 1900 */
.
< │ │ │ -00157ae0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -00157af0: 6f72 6474 7970 6522 3e69 6e74 3c2f 7370 ordtype">int tm_wday; │ │ │ -00157b10: 2020 2020 3c73 7061 6e20 636c 6173 733d /* day │ │ │ -00157b30: 206f 6620 7765 656b 2028 5375 6e64 6179 of week (Sunday │ │ │ -00157b40: 203d 2030 2920 2a2f 3c2f 7370 616e 3e20 = 0) */ │ │ │ -00157b50: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
int tm_yday; │ │ │ -00157ba0: 2020 3c73 7061 6e20 636c 6173 733d 2263 /* day o │ │ │ -00157bc0: 6620 7965 6172 2028 3020 2d20 3336 3529 f year (0 - 365) │ │ │ -00157bd0: 202a 2f3c 2f73 7061 6e3e 203c 2f64 6976 */
.
int tm_ │ │ │ -00157c20: 6973 6473 743b 2020 2020 2020 203c 7370 isdst; /* is summer │ │ │ -00157c50: 7469 6d65 2069 6e20 6566 6665 6374 3f20 time in effect? │ │ │ -00157c60: 2a2f 3c2f 7370 616e 3e20 3c2f 6469 763e */
│ │ │ -00157c70: 0a3c 6469 7620 636c 6173 733d 226c 696e .
char *tm │ │ │ -00157cb0: 5f7a 6f6e 653b 2020 2020 2020 3c73 7061 _zone; /* abbreviatio │ │ │ -00157ce0: 6e20 6f66 2074 696d 657a 6f6e 6520 6e61 n of timezone na │ │ │ -00157cf0: 6d65 202a 2f3c 2f73 7061 6e3e 203c 2f64 me */ .
long │ │ │ -00157d40: 746d 5f67 6d74 6f66 663b 2020 2020 203c tm_gmtoff; < │ │ │ -00157d50: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ -00157d60: 656e 7422 3e2f 2a20 6f66 6673 6574 2066 ent">/* offset f │ │ │ -00157d70: 726f 6d20 5554 4320 696e 2073 6563 6f6e rom UTC in secon │ │ │ -00157d80: 6473 202a 2f3c 2f73 7061 6e3e 203c 2f64 ds */ .
};
.< │ │ │ -00157db0: 2f64 6976 3e3c 212d 2d20 6672 6167 6d65 /div>

We used │ │ │ -00157dd0: 2074 6865 2074 7970 6564 6566 206e 616d the typedef nam │ │ │ -00157de0: 6520 3c63 6f64 653e 7469 6d65 5f5f 7374 e time__st │ │ │ -00157df0: 7275 6374 5f74 6d3c 2f63 6f64 653e 2072 ruct_tm r │ │ │ -00157e00: 6174 6865 7220 7468 616e 203c 636f 6465 ather than time__tm │ │ │ -00157e20: 2c20 6265 6361 7573 6520 6120 7363 6865 , because a sche │ │ │ -00157e30: 6d61 206e 616d 6520 636c 6173 6820 7769 ma name clash wi │ │ │ -00157e40: 6c6c 206f 6363 7572 2066 6f72 2074 6865 ll occur for the │ │ │ -00157e50: 2066 6972 7374 2065 7861 6d70 6c65 2061 first example a │ │ │ -00157e60: 626f 7665 2074 6861 7420 6861 7320 3c63 bove that has tm al │ │ │ -00157e80: 7265 6164 7920 6465 636c 6172 6564 2061 ready declared a │ │ │ -00157e90: 7320 7365 7269 616c 697a 6162 6c65 2074 s serializable t │ │ │ -00157ea0: 7970 6520 696e 2074 6865 2073 6368 656d ype in the schem │ │ │ -00157eb0: 6120 6f66 2074 6865 2067 656e 6572 6174 a of the generat │ │ │ -00157ec0: 6564 2057 5344 4c2e 2054 6865 2073 6563 ed WSDL. The sec │ │ │ -00157ed0: 6f6e 6420 6578 616d 706c 6520 7769 7468 ond example with │ │ │ -00157ee0: 2074 6865 2063 6f6c 6f6e 206e 6f74 6174 the colon notat │ │ │ -00157ef0: 696f 6e20 6176 6f69 6473 2074 6869 7320 ion avoids this │ │ │ -00157f00: 616c 746f 6765 7468 6572 2e3c 2f70 3e0a altogether.

. │ │ │ -00157f10: 3c70 3ef0 9f94 9d20 3c61 2068 7265 663d

.... Back to tabl │ │ │ -00157f30: 6520 6f66 2063 6f6e 7465 6e74 733c 2f61 e of contents

.

.How │ │ │ -00157f70: 2074 6f20 6465 636c 6172 6520 6375 7374 to declare cust │ │ │ -00157f80: 6f6d 2073 6572 6961 6c69 7a65 7273 2061 om serializers a │ │ │ -00157f90: 6e64 2064 6573 6572 6961 6c69 7a65 7273 nd deserializers │ │ │ -00157fa0: 3c2f 6832 3e0a 3c70 3e59 6f75 2063 616e

.

You can │ │ │ -00157fb0: 2069 6d70 6c65 6d65 6e74 2079 6f75 7220 implement your │ │ │ -00157fc0: 6f77 6e20 6375 7374 6f6d 2073 6572 6961 own custom seria │ │ │ -00157fd0: 6c69 7a65 7273 2066 6f72 2064 6174 6120 lizers for data │ │ │ -00157fe0: 7479 7065 732e 2041 2063 7573 746f 6d20 types. A custom │ │ │ -00157ff0: 7365 7269 616c 697a 6572 2069 7320 6465 serializer is de │ │ │ -00158000: 636c 6172 6564 2069 6e20 616e 2069 6e74 clared in an int │ │ │ -00158010: 6572 6661 6365 2068 6561 6465 7220 6669 erface header fi │ │ │ -00158020: 6c65 2066 6f72 2073 6f61 7063 7070 3220 le for soapcpp2 │ │ │ -00158030: 7573 696e 6720 7468 6520 7061 6972 206f using the pair o │ │ │ -00158040: 6620 6b65 7977 6f72 6473 203c 636f 6465 f keywords extern typedef< │ │ │ -00158060: 2f63 6f64 653e 2e20 466f 7220 6578 616d /code>. For exam │ │ │ -00158070: 706c 653a 3c2f 703e 0a3c 6469 7620 636c ple:

.
< │ │ │ -00158090: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -001580a0: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >extern typed │ │ │ -001580e0: 6566 3c2f 7370 616e 3e20 3c73 7061 6e20 ef char │ │ │ -00158110: 2a4d 7944 6174 613b 203c 2f64 6976 3e0a *MyData;
. │ │ │ -00158120: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
struct < │ │ │ -00158150: 2f73 7061 6e3e 5361 6d70 6c65 203c 2f64 /span>Sample .
{
. │ │ │ -00158190: 2020 2020 4d79 4461 7461 2073 3b20 3c73 MyData s; // use custo │ │ │ -001581c0: 6d20 7365 7269 616c 697a 6572 2066 6f72 m serializer for │ │ │ -001581d0: 2074 6869 7320 6d65 6d62 6572 203c 2f73 this member
.
│ │ │ -00158200: 203c 7370 616e 2063 6c61 7373 3d22 6b65 char< │ │ │ -00158220: 2f73 7061 6e3e 202a 743b 2020 3c73 7061 /span> *t; // use auto-ge │ │ │ -00158250: 6e65 7261 7465 6420 7365 7269 616c 697a nerated serializ │ │ │ -00158260: 6572 3c2f 7370 616e 3e3c 2f64 6976 3e0a er
. │ │ │ -00158270: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
};
.

The f │ │ │ -00158850: 756e 6374 696f 6e20 7072 6f74 6f74 7970 unction prototyp │ │ │ -00158860: 6573 206f 6620 7468 6573 6520 6675 6e63 es of these func │ │ │ -00158870: 7469 6f6e 7320 6361 6e20 6265 2066 6f75 tions can be fou │ │ │ -00158880: 6e64 2069 6e20 7468 6520 736f 6170 6370 nd in the soapcp │ │ │ -00158890: 7032 2d67 656e 6572 6174 6564 203c 656d p2-generated soapH.h file. │ │ │ -001588c0: 3c2f 703e 0a3c 703e 466f 7220 6578 616d

.

For exam │ │ │ -001588d0: 706c 652c 2074 6865 2073 6572 6961 6c69 ple, the seriali │ │ │ -001588e0: 7a61 7469 6f6e 206f 6620 3c63 6f64 653e zation of │ │ │ -001588f0: 4d79 4461 7461 3c2f 636f 6465 3e20 6361 MyData ca │ │ │ -00158900: 6e20 6265 2064 6f6e 6520 7769 7468 2074 n be done with t │ │ │ -00158910: 6865 2066 6f6c 6c6f 7769 6e67 2063 6f64 he following cod │ │ │ -00158920: 653a 3c2f 703e 0a3c 6469 7620 636c 6173 e:

.
< │ │ │ -00158950: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -00158960: 6f72 6474 7970 6522 3e69 6e74 3c2f 7370 ordtype">int soap_seriali │ │ │ -00158980: 7a65 5f4d 7944 6174 6128 3c73 7061 6e20 ze_MyData( │ │ │ -001589a0: 7374 7275 6374 3c2f 7370 616e 3e20 3c61 struct soap *< │ │ │ -001589e0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -001589f0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ -00158a00: 6874 6d6c 223e 736f 6170 3c2f 613e 2c20 html">soap, │ │ │ -00158a10: 4d79 4461 7461 203c 7370 616e 2063 6c61 MyData con │ │ │ -00158a30: 7374 3c2f 7370 616e 3e2a 6129 203c 2f64 st*a) .
{
. │ │ │ -00158a70: 2020 3c73 7061 6e20 636c 6173 733d 2263 // no ne │ │ │ -00158a90: 6564 2074 6f20 6d61 726b 2074 6869 7320 ed to mark this │ │ │ -00158aa0: 6e6f 6465 2028 666f 7220 6d75 6c74 692d node (for multi- │ │ │ -00158ab0: 7265 6620 616e 6420 6379 636c 6520 6465 ref and cycle de │ │ │ -00158ac0: 7465 6374 696f 6e29 203c 2f73 7061 6e3e tection) │ │ │ -00158ad0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
return SOAP_OK;
.
}..
{
.
*a = NULL; │ │ │ -00158cb0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
}
.
in │ │ │ -00158d00: 743c 2f73 7061 6e3e 2073 6f61 705f 6f75 t soap_ou │ │ │ -00158d10: 745f 4d79 4461 7461 283c 7370 616e 2063 t_MyData(s │ │ │ -00158d30: 7472 7563 743c 2f73 7061 6e3e 203c 6120 truct soap *soap, < │ │ │ -00158da0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -00158db0: 6f72 6422 3e63 6f6e 7374 3c2f 7370 616e ord">const char │ │ │ -00158de0: 3c2f 7370 616e 3e20 2a74 6167 2c20 3c73 *tag, int id< │ │ │ -00158e30: 2f73 7061 6e3e 2c20 4d79 4461 7461 203c /span>, MyData < │ │ │ -00158e40: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -00158e50: 6f72 6422 3e63 6f6e 7374 3c2f 7370 616e ord">const*a, const │ │ │ -00158e80: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c char *t │ │ │ -00158eb0: 7970 6529 203c 2f64 6976 3e0a 3c64 6976 ype)
.
{< │ │ │ -00158ed0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
if (s │ │ │ -00158f10: 6f61 705f 656c 656d 656e 745f 6265 6769 oap_element_begi │ │ │ -00158f20: 6e5f 6f75 7428 3c61 2063 6c61 7373 3d22 n_out(soa │ │ │ -00158f50: 703c 2f61 3e2c 2074 6167 2c20 3c73 7061 p, tag, id, │ │ │ -00158f80: 2074 7970 6529 203c 7370 616e 2063 6c61 type) // │ │ │ -00158fa0: 7072 696e 7420 584d 4c20 6265 6769 6e6e print XML beginn │ │ │ -00158fb0: 696e 6720 7461 6720 3c2f 7370 616e 3e3c ing tag < │ │ │ -00158fc0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
|| so │ │ │ -00159030: 6170 5f73 656e 643c 2f61 3e28 3c61 2063 ap_send(soap, *a) │ │ │ -00159070: 203c 7370 616e 2063 6c61 7373 3d22 636f // just p │ │ │ -00159090: 7269 6e74 2074 6865 2073 7472 696e 6720 rint the string │ │ │ -001590a0: 286e 6f20 584d 4c20 636f 6e76 6572 7369 (no XML conversi │ │ │ -001590b0: 6f6e 2920 3c2f 7370 616e 3e3c 2f64 6976 on)
.
|| soap_e │ │ │ -001590e0: 6c65 6d65 6e74 5f65 6e64 5f6f 7574 283c lement_end_out(< │ │ │ -001590f0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -00159100: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ -00159110: 6874 6d6c 223e 736f 6170 3c2f 613e 2c20 html">soap, │ │ │ -00159120: 7461 6729 2920 3c73 7061 6e20 636c 6173 tag)) // p │ │ │ -00159140: 7269 6e74 2058 4d4c 2065 6e64 696e 6720 rint XML ending │ │ │ -00159150: 7461 6720 3c2f 7370 616e 3e3c 2f64 6976 tag
.
return │ │ │ -001591a0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap- │ │ │ -001591d0: 2667 743b 3c61 2063 6c61 7373 3d22 636f >err │ │ │ -00159220: 6f72 3c2f 613e 3b20 3c2f 6469 763e 0a3c or;
.< │ │ │ -00159230: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -00159240: 3e20 203c 7370 616e 2063 6c61 7373 3d22 > ret │ │ │ -00159260: 7572 6e3c 2f73 7061 6e3e 203c 6120 636c urn S │ │ │ -001592c0: 4f41 505f 4f4b 3c2f 613e 3b20 3c2f 6469 OAP_OK; .
}
. │ │ │ -00159300: 4d79 4461 7461 202a 2a73 6f61 705f 696e MyData **soap_in │ │ │ -00159310: 5f4d 7944 6174 6128 3c73 7061 6e20 636c _MyData(st │ │ │ -00159330: 7275 6374 3c2f 7370 616e 3e20 3c61 2063 ruct soap *soap, const │ │ │ -001593c0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 char< │ │ │ -001593e0: 2f73 7061 6e3e 202a 7461 672c 204d 7944 /span> *tag, MyD │ │ │ -001593f0: 6174 6120 2a61 2c20 3c73 7061 6e20 636c ata *a, co │ │ │ -00159410: 6e73 743c 2f73 7061 6e3e 203c 7370 616e nst char │ │ │ -00159440: 202a 7479 7065 2920 3c2f 6469 763e 0a3c *type)
.< │ │ │ -00159450: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -00159460: 3e7b 3c2f 6469 763e 0a3c 6469 7620 636c >{
.
if │ │ │ -001594a0: 2028 736f 6170 5f65 6c65 6d65 6e74 5f62 (soap_element_b │ │ │ -001594b0: 6567 696e 5f69 6e28 3c61 2063 6c61 7373 egin_in(s │ │ │ -001594e0: 6f61 703c 2f61 3e2c 2074 6167 2929 203c oap, tag)) < │ │ │ -001594f0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
return NULL;
│ │ │ -00159540: 0a3c 6469 7620 636c 6173 733d 226c 696e .
i │ │ │ -00159570: 663c 2f73 7061 6e3e 2028 2161 2920 3c2f f (!a) .
a = ( │ │ │ -001595a0: 4d79 4461 7461 2a29 3c61 2063 6c61 7373 MyData*)soa │ │ │ -00159600: 705f 6d61 6c6c 6f63 3c2f 613e 283c 6120 p_malloc(soap, sizeof(MyData)); .
if (soap-> │ │ │ -001596e0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 null)
.
│ │ │ -00159750: 2a61 203d 204e 554c 4c3b 203c 7370 616e *a = NULL; // xsi:nil elem │ │ │ -00159780: 656e 7420 3c2f 7370 616e 3e3c 2f64 6976 ent
.
│ │ │ -001597c0: 6966 3c2f 7370 616e 3e20 282a 3c61 2063 if (*soap-> │ │ │ -00159800: 7479 7065 2026 616d 703b 2661 6d70 3b20 type && │ │ │ -00159810: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap_match_tag │ │ │ -00159870: 3c2f 613e 283c 6120 636c 6173 733d 2263 (soap │ │ │ -001598a0: 3c2f 613e 2c20 3c61 2063 6c61 7373 3d22 , soa │ │ │ -001598d0: 703c 2f61 3e2d 2667 743b 7479 7065 2c20 p->type, │ │ │ -001598e0: 7479 7065 2929 203c 2f64 6976 3e0a 3c64 type))
. │ │ │ -00159900: 2020 7b3c 2f64 6976 3e0a 3c64 6976 2063 {
.
│ │ │ -00159920: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap- │ │ │ -00159950: 2667 743b 3c61 2063 6c61 7373 3d22 636f >err │ │ │ -001599a0: 6f72 3c2f 613e 203d 203c 6120 636c 6173 or = SOA │ │ │ -00159a00: 505f 5459 5045 3c2f 613e 3b20 3c2f 6469 P_TYPE; .
return │ │ │ -00159a50: 204e 554c 4c3b 203c 7370 616e 2063 6c61 NULL; // │ │ │ -00159a70: 7479 7065 206d 6973 6d61 7463 6820 3c2f type mismatch
.
│ │ │ -00159aa0: 7d20 3c2f 6469 763e 0a3c 6469 7620 636c }
.
if │ │ │ -00159ae0: 2028 2a3c 6120 636c 6173 733d 2263 6f64 (*soap->href) .
a = (M │ │ │ -00159b40: 7944 6174 612a 2a29 736f 6170 5f69 645f yData**)soap_id_ │ │ │ -00159b50: 666f 7277 6172 6428 3c61 2063 6c61 7373 forward(s │ │ │ -00159b80: 6f61 703c 2f61 3e2c 203c 6120 636c 6173 oap, │ │ │ -00159bb0: 736f 6170 3c2f 613e 2d26 6774 3b68 7265 soap->hre │ │ │ -00159bc0: 662c 2061 2c20 302c 2053 4f41 505f 5459 f, a, 0, SOAP_TY │ │ │ -00159bd0: 5045 5f4d 7944 6174 612c 2030 2c20 3c73 PE_MyData, 0, sizeof(MyData), 0, NU │ │ │ -00159c10: 4c4c 2c20 4e55 4c4c 2920 3c2f 6469 763e LL, NULL)
│ │ │ -00159c20: 0a3c 6469 7620 636c 6173 733d 226c 696e .
e │ │ │ -00159c50: 6c73 653c 2f73 7061 6e3e 203c 7370 616e lse if ( │ │ │ -00159c80: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap- │ │ │ -00159cb0: 2667 743b 3c61 2063 6c61 7373 3d22 636f >bod │ │ │ -00159d00: 793c 2f61 3e29 203c 2f64 6976 3e0a 3c64 y)
. │ │ │ -00159d20: 2020 7b3c 2f64 6976 3e0a 3c64 6976 2063 {
.
│ │ │ -00159d40: 3c73 7061 6e20 636c 6173 733d 226b 6579 char *s = soap_ │ │ │ -00159d70: 7661 6c75 6528 3c61 2063 6c61 7373 3d22 value(soa │ │ │ -00159da0: 703c 2f61 3e29 3b20 3c73 7061 6e20 636c p); // │ │ │ -00159dc0: 2066 696c 6c20 6275 6666 6572 203c 2f73 fill buffer
.
│ │ │ -00159df0: 202a 6120 3d20 283c 7370 616e 2063 6c61 *a = (char*)soap_malloc(soap, strlen(s)+1) │ │ │ -00159ec0: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
s │ │ │ -00159ee0: 7472 6370 7928 2a61 2c20 7329 3b20 3c2f trcpy(*a, s); .
}
.
│ │ │ -00159f40: 6966 3c2f 7370 616e 3e20 283c 6120 636c if (soap->< │ │ │ -00159f80: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -00159f90: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ -00159fa0: 6874 6d6c 2361 3362 3839 6631 3365 6365 html#a3b89f13ece │ │ │ -00159fb0: 3131 6439 6639 6236 6534 3862 6631 3566 11d9f9b6e48bf15f │ │ │ -00159fc0: 6634 3862 6536 223e 626f 6479 3c2f 613e f48be6">body │ │ │ -00159fd0: 2026 616d 703b 2661 6d70 3b20 736f 6170 && soap │ │ │ -00159fe0: 5f65 6c65 6d65 6e74 5f65 6e64 5f69 6e28 _element_end_in( │ │ │ -00159ff0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap, │ │ │ -0015a020: 2074 6167 2929 203c 2f64 6976 3e0a 3c64 tag))
. │ │ │ -0015a040: 2020 2020 3c73 7061 6e20 636c 6173 733d re │ │ │ -0015a060: 7475 726e 3c2f 7370 616e 3e20 4e55 4c4c turn NULL │ │ │ -0015a070: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
return a;
.< │ │ │ -0015a0c0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -0015a0d0: 3e7d 3c2f 6469 763e 0a3c 6469 7620 636c >}
.
# │ │ │ -0015a1b0: 6465 6669 6e65 2053 4f41 505f 5459 5045 define SOAP_TYPE │ │ │ -0015a1c0: 3c2f 6469 763e 3c64 6976 2063 6c61 7373
A soap_ │ │ │ -0015a1e0: 7374 6174 7573 2065 7272 6f72 2063 6f64 status error cod │ │ │ -0015a1f0: 653a 2058 4d4c 2065 6c65 6d65 6e74 206f e: XML element o │ │ │ -0015a200: 7220 6174 7472 6962 7574 6520 6861 7320 r attribute has │ │ │ -0015a210: 6120 6d69 736d 6174 6368 696e 6720 7479 a mismatching ty │ │ │ -0015a220: 7065 206f 7220 7661 6c75 6520 7468 6174 pe or value that │ │ │ -0015a230: 2069 7320 6361 7573 696e 6720 6120 2e2e is causing a .. │ │ │ -0015a240: 2e3c 2f64 6976 3e3c 6469 7620 636c 6173 .
Def │ │ │ -0015a260: 696e 6974 696f 6e3a 3c2f 623e 2073 7464 inition: std │ │ │ -0015a270: 736f 6170 322e 683a 3236 3037 3c2f 6469 soap2.h:2607
.
│ │ │ -0015a330: 736f 6170 5f73 656e 643c 2f61 3e3c 2f64 soap_send
int soap_ │ │ │ -0015a360: 7365 6e64 2873 7472 7563 7420 736f 6170 send(struct soap │ │ │ -0015a370: 202a 736f 6170 2c20 636f 6e73 7420 6368 *soap, const ch │ │ │ -0015a380: 6172 202a 7329 3c2f 6469 763e 3c64 6976 ar *s)
S │ │ │ -0015a3a0: 656e 6420 6120 7374 7269 6e67 2e3c 2f64 end a string.
.
│ │ │ -0015a420: 3c61 2068 7265 663d 2267 726f 7570 5f5f soap_match_ │ │ │ -0015a470: 7461 673c 2f61 3e3c 2f64 6976 3e3c 6469 tag
int soap_match_ │ │ │ -0015a4a0: 7461 6728 7374 7275 6374 2073 6f61 7020 tag(struct soap │ │ │ -0015a4b0: 2a73 6f61 702c 2063 6f6e 7374 2063 6861 *soap, const cha │ │ │ -0015a4c0: 7220 2a74 6167 312c 2063 6f6e 7374 2063 r *tag1, const c │ │ │ -0015a4d0: 6861 7220 2a74 6167 3229 3c2f 6469 763e har *tag2)
│ │ │ -0015a4e0: 3c64 6976 2063 6c61 7373 3d22 7474 646f
Match an XML │ │ │ -0015a500: 7461 6720 6e61 6d65 2e3c 2f64 6976 3e3c tag name.
< │ │ │ -0015a510: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
< │ │ │ -0015a560: 6469 7620 636c 6173 733d 2274 746e 616d div class="ttnam │ │ │ -0015a570: 6522 3e3c 6120 6872 6566 3d22 7374 7275 e">s │ │ │ -0015a5b0: 6f61 703a 3a62 6f64 793c 2f61 3e3c 2f64 oap::body
short bod │ │ │ -0015a5e0: 793c 2f64 6976 3e3c 6469 7620 636c 6173 y
The so │ │ │ -0015a600: 6170 3a3a 626f 6479 2066 6c61 6720 6973 ap::body flag is │ │ │ -0015a610: 2073 6574 2077 6865 6e20 616e 2065 6c65 set when an ele │ │ │ -0015a620: 6d65 6e74 2068 6173 2065 6c65 6d65 6e74 ment has element │ │ │ -0015a630: 2063 6f6e 7465 6e74 2064 7572 696e 6720 content during │ │ │ -0015a640: 584d 4c20 7061 7273 696e 6720 6f72 2077 XML parsing or w │ │ │ -0015a650: 6865 6e20 6120 4854 5450 206d 6573 732e hen a HTTP mess. │ │ │ -0015a660: 2e2e 3c2f 6469 763e 3c64 6976 2063 6c61 ..
De │ │ │ -0015a680: 6669 6e69 7469 6f6e 3a3c 2f62 3e20 7374 finition: st │ │ │ -0015a690: 6473 6f61 7032 2e68 3a32 3936 353c 2f64 dsoap2.h:2965
.
short │ │ │ -0015a770: 206e 756c 6c3c 2f64 6976 3e3c 6469 7620 null
Th │ │ │ -0015a790: 6520 736f 6170 3a3a 6e75 6c6c 2066 6c61 e soap::null fla │ │ │ -0015a7a0: 6720 6973 2073 6574 2077 6865 6e20 616e g is set when an │ │ │ -0015a7b0: 2065 6c65 6d65 6e74 2063 6172 7269 6573 element carries │ │ │ -0015a7c0: 2061 2078 7369 3a6e 696c 2061 7474 7269 a xsi:nil attri │ │ │ -0015a7d0: 6275 7465 2074 6861 7420 6973 2074 7275 bute that is tru │ │ │ -0015a7e0: 652e 3c2f 6469 763e 3c64 6976 2063 6c61 e.
De │ │ │ -0015a800: 6669 6e69 7469 6f6e 3a3c 2f62 3e20 7374 finition: st │ │ │ -0015a810: 6473 6f61 7032 2e68 3a32 3936 333c 2f64 dsoap2.h:2963
.
│ │ │ -0015a830: 3c21 2d2d 2066 7261 676d 656e 7420 2d2d

The foll │ │ │ -00168160: 6f77 696e 6720 6578 616d 706c 6520 696c owing example il │ │ │ -00168170: 6c75 7374 7261 7465 7320 6375 7374 6f6d lustrates custom │ │ │ -00168180: 697a 6564 2049 2f4f 2061 6e64 2048 5454 ized I/O and HTT │ │ │ -00168190: 5020 6865 6164 6572 2068 616e 646c 696e P header handlin │ │ │ -001681a0: 672e 2054 6865 2058 4d4c 206d 6573 7361 g. The XML messa │ │ │ -001681b0: 6765 2069 7320 7361 7665 6420 746f 2061 ge is saved to a │ │ │ -001681c0: 2066 696c 6520 746f 2064 656d 6f6e 7374 file to demonst │ │ │ -001681d0: 7261 7465 2049 2f4f 2061 6e64 2048 5454 rate I/O and HTT │ │ │ -001681e0: 5020 6361 6c6c 6261 636b 732e 2054 6865 P callbacks. The │ │ │ -001681f0: 2063 6c69 656e 7420 7072 6f78 7920 7468 client proxy th │ │ │ -00168200: 656e 2072 6561 6473 2074 6865 2066 696c en reads the fil │ │ │ -00168210: 6520 636f 6e74 656e 7473 2061 7320 7468 e contents as th │ │ │ -00168220: 6520 7365 7276 6963 6520 7265 7370 6f6e e service respon │ │ │ -00168230: 7365 2e20 546f 2070 6572 666f 726d 2074 se. To perform t │ │ │ -00168240: 6869 7320 7472 6963 6b2c 2074 6865 2073 his trick, the s │ │ │ -00168250: 6572 7669 6365 2072 6573 706f 6e73 6520 ervice response │ │ │ -00168260: 6861 7320 6578 6163 746c 7920 7468 6520 has exactly the │ │ │ -00168270: 7361 6d65 2073 7472 7563 7475 7265 2061 same structure a │ │ │ -00168280: 7320 7468 6520 7265 7175 6573 742e 2054 s the request. T │ │ │ -00168290: 6869 7320 6973 2064 6563 6c61 7265 6420 his is declared │ │ │ -001682a0: 6279 2074 6865 203c 636f 6465 3e73 7472 by the str │ │ │ -001682b0: 7563 7420 6e73 5f5f 7465 7374 3c2f 636f uct ns__test output param │ │ │ -001682d0: 6574 6572 2070 6172 7420 6f66 2074 6865 eter part of the │ │ │ -001682e0: 2073 6572 7669 6365 206f 7065 7261 7469 service operati │ │ │ -001682f0: 6f6e 2064 6563 6c61 7261 7469 6f6e 2e20 on declaration. │ │ │ -00168300: 5468 6973 2073 7472 7563 7420 7265 7365 This struct rese │ │ │ -00168310: 6d62 6c65 7320 7468 6520 7365 7276 6963 mbles the servic │ │ │ -00168320: 6520 7265 7175 6573 7420 2873 6565 2074 e request (see t │ │ │ -00168330: 6865 2067 656e 6572 6174 6564 203c 656d he generated soapStub. │ │ │ -00168350: 683c 2f63 6f64 653e 3c2f 656d 3e20 6669 h fi │ │ │ -00168360: 6c65 2067 656e 6572 6174 6564 2062 7920 le generated by │ │ │ -00168370: 736f 6170 6370 7032 2066 726f 6d20 7468 soapcpp2 from th │ │ │ -00168380: 6520 696e 7465 7266 6163 6520 6865 6164 e interface head │ │ │ -00168390: 6572 2066 696c 6520 696e 7075 7429 2e3c er file input).< │ │ │ -001683a0: 2f70 3e0a 3c70 3e54 6865 2069 6e74 6572 /p>.

The inter │ │ │ -001683b0: 6661 6365 2068 6561 6465 7220 6669 6c65 face header file │ │ │ -001683c0: 2066 6f72 2073 6f61 7063 7070 3220 6973 for soapcpp2 is │ │ │ -001683d0: 3a3c 2f70 3e0a 3c64 6976 2063 6c61 7373 :

.
//gsoap ns s │ │ │ -00168420: 6572 7669 6365 206e 616d 653a 2063 616c ervice name: cal │ │ │ -00168430: 6c62 6163 6b20 3c2f 7370 616e 3e3c 2f64 lback .
//gs │ │ │ -00168470: 6f61 7020 6e73 2073 6572 7669 6365 206e oap ns service n │ │ │ -00168480: 616d 6573 7061 6365 3a20 7572 6e3a 6361 amespace: urn:ca │ │ │ -00168490: 6c6c 6261 636b 203c 2f73 7061 6e3e 3c2f llback .
str │ │ │ -001684d0: 7563 7420 3c2f 7370 616e 3e6e 735f 5f70 uct ns__p │ │ │ -001684e0: 6572 736f 6e20 3c2f 6469 763e 0a3c 6469 erson
.{ │ │ │ -00168500: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
char *name;
│ │ │ -00168550: 0a3c 6469 7620 636c 6173 733d 226c 696e .
int age; │ │ │ -00168590: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
}; .
│ │ │ -001685e0: 696e 743c 2f73 7061 6e3e 206e 735f 5f74 int ns__t │ │ │ -001685f0: 6573 7428 3c73 7061 6e20 636c 6173 733d est(struct │ │ │ -00168610: 3c2f 7370 616e 3e20 6e73 5f5f 7065 7273 ns__pers │ │ │ -00168620: 6f6e 2069 6e2c 203c 7370 616e 2063 6c61 on in, str │ │ │ -00168640: 7563 743c 2f73 7061 6e3e 206e 735f 5f74 uct ns__t │ │ │ -00168650: 6573 7420 2661 6d70 3b6f 7574 293b 3c2f est &out);.

T │ │ │ -00168680: 6865 2063 6c69 656e 7420 7072 6f67 7261 he client progra │ │ │ -00168690: 6d20 6973 3a3c 2f70 3e0a 3c64 6976 2063 m is:

.
│ │ │ -001686b0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
#in │ │ │ -001686e0: 636c 7564 6520 2671 756f 743b 736f 6170 clude "soap │ │ │ -001686f0: 482e 6826 7175 6f74 3b3c 2f73 7061 6e3e H.h" │ │ │ -00168700: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
#include &q │ │ │ -00168740: 756f 743b 6e73 2e6e 736d 6170 2671 756f uot;ns.nsmap&quo │ │ │ -00168750: 743b 3c2f 7370 616e 3e20 3c2f 6469 763e t;
│ │ │ -00168760: 0a3c 6469 7620 636c 6173 733d 226c 696e .
.
S │ │ │ -001687e0: 4f41 505f 534f 434b 4554 3c2f 613e 206d OAP_SOCKET m │ │ │ -001687f0: 796f 7065 6e28 3c73 7061 6e20 636c 6173 yopen(stru │ │ │ -00168810: 6374 3c2f 7370 616e 3e20 3c61 2063 6c61 ct soap *soap, const < │ │ │ -001688a0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -001688b0: 6f72 6474 7970 6522 3e63 6861 723c 2f73 ordtype">char *endpoint, │ │ │ -001688d0: 3c73 7061 6e20 636c 6173 733d 226b 6579 const cha │ │ │ -00168910: 723c 2f73 7061 6e3e 202a 686f 7374 2c20 r *host, │ │ │ -00168920: 3c73 7061 6e20 636c 6173 733d 226b 6579 int port)
.
{
.
│ │ │ -00168980: 3c73 7061 6e20 636c 6173 733d 226b 6579 if (strncmp(end │ │ │ -001689b0: 706f 696e 742c 203c 7370 616e 2063 6c61 point, "file:&q │ │ │ -001689e0: 756f 743b 3c2f 7370 616e 3e2c 2035 2929 uot;, 5)) │ │ │ -001689f0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
{.
printf │ │ │ -00168a30: 283c 7370 616e 2063 6c61 7373 3d22 7374 (&qu │ │ │ -00168a50: 6f74 3b46 696c 6520 6e61 6d65 2065 7870 ot;File name exp │ │ │ -00168a60: 6563 7465 645c 6e26 7175 6f74 3b3c 2f73 ected\n");
. │ │ │ -00168a90: 2020 2020 3c73 7061 6e20 636c 6173 733d re │ │ │ -00168ab0: 7475 726e 3c2f 7370 616e 3e20 3c61 2063 turn SO │ │ │ -00168b10: 4150 5f49 4e56 414c 4944 5f53 4f43 4b45 AP_INVALID_SOCKE │ │ │ -00168b20: 543c 2f61 3e3b 203c 2f64 6976 3e0a 3c64 T;
. │ │ │ -00168b40: 2020 7d20 3c2f 6469 763e 0a3c 6469 7620 }
.
< │ │ │ -00168b60: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -00168b70: 6f72 6466 6c6f 7722 3e69 663c 2f73 7061 ordflow">if ((soap │ │ │ -00168bb0: 3c2f 613e 2d26 6774 3b3c 6120 636c 6173 ->sendfd = < │ │ │ -00168c10: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -00168c20: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ -00168c30: 6874 6d6c 223e 736f 6170 3c2f 613e 2d26 html">soap-& │ │ │ -00168c40: 6774 3b3c 6120 636c 6173 733d 2263 6f64 gt;recv │ │ │ -00168c90: 6664 3c2f 613e 203d 206f 7065 6e28 686f fd = open(ho │ │ │ -00168ca0: 7374 2c20 4f5f 5244 5752 7c4f 5f43 5245 st, O_RDWR|O_CRE │ │ │ -00168cb0: 4154 2c20 535f 4957 5553 527c 535f 4952 AT, S_IWUSR|S_IR │ │ │ -00168cc0: 5553 5229 2920 266c 743b 2030 2920 3c2f USR)) < 0) .
return SOAP_INVALI │ │ │ -00168d70: 445f 534f 434b 4554 3c2f 613e 3b20 3c2f D_SOCKET; .
return │ │ │ -00168dc0: 203c 6120 636c 6173 733d 2263 6f64 6522 soap │ │ │ -00168df0: 2d26 6774 3b3c 6120 636c 6173 733d 2263 ->se │ │ │ -00168e40: 6e64 6664 3c2f 613e 3b20 3c2f 6469 763e ndfd;
│ │ │ -00168e50: 0a3c 6469 7620 636c 6173 733d 226c 696e .
}
.
< │ │ │ -00168e80: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
void my │ │ │ -00168ec0: 636c 6f73 6528 3c73 7061 6e20 636c 6173 close(stru │ │ │ -00168ee0: 6374 3c2f 7370 616e 3e20 3c61 2063 6c61 ct soap *soap) .
{
. │ │ │ -00168f80: 203c 7370 616e 2063 6c61 7373 3d22 6b65 if (soa │ │ │ -00168fd0: 703c 2f61 3e2d 2667 743b 3c61 2063 6c61 p->sendfd &g │ │ │ -00169030: 743b 2032 2920 203c 7370 616e 2063 6c61 t; 2) // │ │ │ -00169050: 7374 696c 6c20 6f70 656e 3f20 3c2f 7370 still open?
.
│ │ │ -00169080: 636c 6f73 6528 3c61 2063 6c61 7373 3d22 close(soa │ │ │ -001690b0: 703c 2f61 3e2d 2667 743b 3c61 2063 6c61 p->sendfd); │ │ │ -00169110: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // then cl │ │ │ -00169130: 6f73 6520 6974 203c 2f73 7061 6e3e 3c2f ose it .
│ │ │ -00169180: 736f 6170 3c2f 613e 2d26 6774 3b3c 6120 soap->recvfd │ │ │ -001691e0: 203d 2030 3b20 2020 2020 203c 7370 616e = 0; // set back to │ │ │ -00169210: 7374 6469 6e20 3c2f 7370 616e 3e3c 2f64 stdin .
s │ │ │ -00169260: 6f61 703c 2f61 3e2d 2667 743b 3c61 2063 oap->sendfd │ │ │ -001692c0: 3d20 313b 2020 2020 2020 3c73 7061 6e20 = 1; │ │ │ -001692e0: 2f2f 2073 6574 2062 6163 6b20 746f 2073 // set back to s │ │ │ -001692f0: 7464 6f75 7420 3c2f 7370 616e 3e3c 2f64 tdout .
}
.< │ │ │ -00169320: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -00169330: 3e20 3c2f 6469 763e 0a3c 6469 7620 636c >
.
int │ │ │ -00169370: 6d79 706f 7374 283c 7370 616e 2063 6c61 mypost(str │ │ │ -00169390: 7563 743c 2f73 7061 6e3e 203c 6120 636c uct soap *soap, const │ │ │ -00169420: 3c73 7061 6e20 636c 6173 733d 226b 6579 char *endpoint, │ │ │ -00169450: 203c 7370 616e 2063 6c61 7373 3d22 6b65 const ch │ │ │ -00169490: 6172 3c2f 7370 616e 3e20 2a68 6f73 742c ar *host, │ │ │ -001694a0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 const ch │ │ │ -001694e0: 6172 3c2f 7370 616e 3e20 2a70 6174 682c ar *path, │ │ │ -001694f0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 const ch │ │ │ -00169530: 6172 3c2f 7370 616e 3e20 2a61 6374 696f ar *actio │ │ │ -00169540: 6e2c 203c 6120 636c 6173 733d 2263 6f64 n, ULONG64 │ │ │ -001695a0: 2063 6f75 6e74 2920 3c2f 6469 763e 0a3c count)
.< │ │ │ -001695b0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -001695c0: 3e7b 3c2f 6469 763e 0a3c 6469 7620 636c >{
.
. │ │ │ -00169730: 7d20 3c2f 6469 763e 0a3c 6469 7620 636c }
..
char buf[256]; .. │ │ │ -00169af0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
r │ │ │ -00169b20: 6574 7572 6e3c 2f73 7061 6e3e 203c 6120 eturn SOAP_OK; .
}
. │ │ │ -00169bb0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
.
int │ │ │ -00169c00: 206d 6169 6e28 2920 3c2f 6469 763e 0a3c main()
.< │ │ │ -00169c10: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -00169c20: 3e7b 3c2f 6469 763e 0a3c 6469 7620 636c >{
.
struct soap │ │ │ -00169c90: 203c 6120 636c 6173 733d 2263 6f64 6522 soap │ │ │ -00169cc0: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
struct ns__test r; .
st │ │ │ -00169d40: 7275 6374 203c 2f73 7061 6e3e 6e73 5f5f ruct ns__ │ │ │ -00169d50: 7065 7273 6f6e 2070 3b20 3c2f 6469 763e person p;
│ │ │ -00169d60: 0a3c 6469 7620 636c 6173 733d 226c 696e .
soap_i │ │ │ -00169dd0: 6e69 743c 2f61 3e28 2661 6d70 3b3c 6120 nit(&soap);.
p.name │ │ │ -00169e30: 3d20 3c73 7061 6e20 636c 6173 733d 2273 = &q │ │ │ -00169e50: 756f 743b 4a6f 686e 2044 6f65 2671 756f uot;John Doe&quo │ │ │ -00169e60: 743b 3c2f 7370 616e 3e3b 203c 2f64 6976 t;;
.
p.age = 99 │ │ │ -00169e90: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
soap.fopen = │ │ │ -00169f40: 6d79 6f70 656e 3b20 2020 3c73 7061 6e20 myopen; │ │ │ -00169f60: 2f2f 2075 7365 2063 7573 746f 6d20 6f70 // use custom op │ │ │ -00169f70: 656e 203c 2f73 7061 6e3e 3c2f 6469 763e en
│ │ │ -00169f80: 0a3c 6469 7620 636c 6173 733d 226c 696e .
soap │ │ │ -00169fc0: 3c2f 613e 2e3c 6120 636c 6173 733d 2263 .fpos │ │ │ -0016a020: 743c 2f61 3e20 3d20 6d79 706f 7374 3b20 t = mypost; │ │ │ -0016a030: 2020 3c73 7061 6e20 636c 6173 733d 2263 // use c │ │ │ -0016a050: 7573 746f 6d20 706f 7374 203c 2f73 7061 ustom post
.
soap.fparse = │ │ │ -0016a110: 206d 7970 6172 7365 3b20 3c73 7061 6e20 myparse; │ │ │ -0016a130: 2f2f 2075 7365 2063 7573 746f 6d20 7265 // use custom re │ │ │ -0016a140: 7370 6f6e 7365 2070 6172 7365 7220 3c2f sponse parser
.
│ │ │ -0016a170: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap. │ │ │ -0016a1a0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 fclose = myclose; // use custom │ │ │ -0016a230: 2063 6c6f 7365 203c 2f73 7061 6e3e 3c2f close .
soap_ca │ │ │ -0016a260: 6c6c 5f6e 735f 5f74 6573 7428 2661 6d70 ll_ns__test(& │ │ │ -0016a270: 3b3c 6120 636c 6173 733d 2263 6f64 6522 ;soap │ │ │ -0016a2a0: 2c20 3c73 7061 6e20 636c 6173 733d 2273 , &q │ │ │ -0016a2c0: 756f 743b 6669 6c65 3a2f 2f74 6573 742e uot;file://test. │ │ │ -0016a2d0: 786d 6c26 7175 6f74 3b3c 2f73 7061 6e3e xml" │ │ │ -0016a2e0: 2c20 3c73 7061 6e20 636c 6173 733d 2273 , &q │ │ │ -0016a300: 756f 743b 2671 756f 743b 3c2f 7370 616e uot;", p, r);
│ │ │ -0016a320: 0a3c 6469 7620 636c 6173 733d 226c 696e .
i │ │ │ -0016a350: 663c 2f73 7061 6e3e 2028 3c61 2063 6c61 f (soap.error) .
{
│ │ │ -0016a400: 0a3c 6469 7620 636c 6173 733d 226c 696e .
soap_p │ │ │ -0016a470: 7269 6e74 5f66 6175 6c74 3c2f 613e 2826 rint_fault(& │ │ │ -0016a480: 616d 703b 3c61 2063 6c61 7373 3d22 636f amp;soap< │ │ │ -0016a4b0: 2f61 3e2c 2073 7464 6f75 7429 3b20 3c2f /a>, stdout); .
exit( │ │ │ -0016a4e0: 4558 4954 5f46 4149 4c55 5245 293b 203c EXIT_FAILURE); < │ │ │ -0016a4f0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
} .
soap │ │ │ -0016a580: 5f64 6573 7472 6f79 3c2f 613e 2826 616d _destroy(&am │ │ │ -0016a590: 703b 3c61 2063 6c61 7373 3d22 636f 6465 p;soap);
.
soap_end( │ │ │ -0016a640: 2661 6d70 3b3c 6120 636c 6173 733d 2263 &soap │ │ │ -0016a670: 3c2f 613e 293b 203c 2f64 6976 3e0a 3c64 );
. │ │ │ -0016a690: 2020 3c61 2063 6c61 7373 3d22 636f 6465 soap_done │ │ │ -0016a6f0: 3c2f 613e 2826 616d 703b 3c61 2063 6c61 (&soap);
.
}
.
soap::fpost │ │ │ -0016a810: 3c2f 6469 763e 3c64 6976 2063 6c61 7373
int(* │ │ │ -0016a830: 6670 6f73 7429 2873 7472 7563 7420 736f fpost)(struct so │ │ │ -0016a840: 6170 202a 736f 6170 2c20 636f 6e73 7420 ap *soap, const │ │ │ -0016a850: 6368 6172 202a 656e 6470 6f69 6e74 2c20 char *endpoint, │ │ │ -0016a860: 636f 6e73 7420 6368 6172 202a 686f 7374 const char *host │ │ │ -0016a870: 2c20 696e 7420 706f 7274 2c20 636f 6e73 , int port, cons │ │ │ -0016a880: 7420 6368 6172 202a 7061 7468 2c20 636f t char *path, co │ │ │ -0016a890: 6e73 7420 6368 6172 202a 6163 7469 6f6e nst char *action │ │ │ -0016a8a0: 2c20 554c 4f4e 4736 3420 636f 756e 7429 , ULONG64 count) │ │ │ -0016a8b0: 3c2f 6469 763e 3c64 6976 2063 6c61 7373
Callbac │ │ │ -0016a8d0: 6b20 7468 6174 2070 6f70 756c 6174 6573 k that populates │ │ │ -0016a8e0: 2061 6e64 2074 6865 6e20 7365 6e64 7320 and then sends │ │ │ -0016a8f0: 4854 5450 2068 6561 6465 7273 2066 726f HTTP headers fro │ │ │ -0016a900: 6d20 7468 6520 636c 6965 6e74 2d73 6964 m the client-sid │ │ │ -0016a910: 6520 746f 2061 2063 6f6e 6e65 6374 6564 e to a connected │ │ │ -0016a920: 2048 5454 5020 7365 7276 6572 2e3c 2f64 HTTP server.
Definit │ │ │ -0016a950: 696f 6e3a 3c2f 623e 2073 7464 736f 6170 ion: stdsoap │ │ │ -0016a960: 322e 683a 3432 3230 3c2f 6469 763e 3c2f 2.h:4220
.
│ │ │ -0016a9e0: 3c61 2068 7265 663d 2267 726f 7570 5f5f soap:: │ │ │ -0016aa30: 6670 6172 7365 3c2f 613e 3c2f 6469 763e fparse
│ │ │ -0016aa40: 3c64 6976 2063 6c61 7373 3d22 7474 6465
int(* fparse │ │ │ -0016aa60: 2928 7374 7275 6374 2073 6f61 7020 2a73 )(struct soap *s │ │ │ -0016aa70: 6f61 7029 3c2f 6469 763e 3c64 6976 2063 oap)
Cal │ │ │ -0016aa90: 6c62 6163 6b20 7468 6174 2072 6561 6473 lback that reads │ │ │ -0016aaa0: 2061 6e64 2070 6172 7365 7320 4854 5450 and parses HTTP │ │ │ -0016aab0: 2061 6e64 204d 494d 4520 6865 6164 6572 and MIME header │ │ │ -0016aac0: 732e 3c2f 6469 763e 3c64 6976 2063 6c61 s.
De │ │ │ -0016aae0: 6669 6e69 7469 6f6e 3a3c 2f62 3e20 7374 finition: st │ │ │ -0016aaf0: 6473 6f61 7032 2e68 3a34 3235 303c 2f64 dsoap2.h:4250
.
int s │ │ │ -0016abe0: 6f61 705f 6765 746c 696e 6528 7374 7275 oap_getline(stru │ │ │ -0016abf0: 6374 2073 6f61 7020 2a73 6f61 702c 2063 ct soap *soap, c │ │ │ -0016ac00: 6861 7220 2a62 7566 2c20 696e 7420 6c65 har *buf, int le │ │ │ -0016ac10: 6e29 3c2f 6469 763e 3c64 6976 2063 6c61 n)
Get a │ │ │ -0016ac30: 2068 6561 6465 7220 6c69 6e65 2e3c 2f64 header line.
.
│ │ │ -0016ac50: 3c21 2d2d 2066 7261 676d 656e 7420 2d2d

│ │ │ -0016b9e0: 546f 2073 656c 6563 7469 7665 6c79 2074 To selectively t │ │ │ -0016b9f0: 6872 6f77 2061 6e20 6578 6365 7074 696f hrow an exceptio │ │ │ -0016ba00: 6e20 7768 656e 203c 656d 3e3c 636f 6465 n when mustUnderstand= │ │ │ -0016ba20: 2274 7275 6522 3c2f 636f 6465 3e3c 2f65 "true" SOAP Header e │ │ │ -0016ba40: 6c65 6d65 6e74 2069 7320 656e 636f 756e lement is encoun │ │ │ -0016ba50: 7465 7265 6420 6f72 2077 6865 6e20 616e tered or when an │ │ │ -0016ba60: 2075 6e6b 6e6f 776e 2065 6c65 6d65 6e74 unknown element │ │ │ -0016ba70: 2069 7320 656e 636f 756e 7465 7265 6420 is encountered │ │ │ -0016ba80: 6578 6365 7074 2066 6f72 2065 6c65 6d65 except for eleme │ │ │ -0016ba90: 6e74 203c 656d 3e3c 636f 6465 3e6e 733a nt ns: │ │ │ -0016baa0: 7879 7a3c 2f63 6f64 653e 3c2f 656d 3e2c xyz, │ │ │ -0016bab0: 2075 7365 3a3c 2f70 3e0a 3c64 6976 2063 use:

.
│ │ │ -0016bad0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
int< │ │ │ -0016bb00: 2f73 7061 6e3e 206d 6169 6e28 293c 2f64 /span> main().
{
. │ │ │ -0016bb40: 2020 3c73 7061 6e20 636c 6173 733d 226b struct < │ │ │ -0016bb60: 2f73 7061 6e3e 3c61 2063 6c61 7373 3d22 /span>soa │ │ │ -0016bb90: 703c 2f61 3e20 2a3c 6120 636c 6173 733d p *so │ │ │ -0016bbc0: 6170 3c2f 613e 203d 203c 6120 636c 6173 ap = so │ │ │ -0016bc20: 6170 5f6e 6577 3c2f 613e 2829 3b3c 2f64 ap_new();.
s │ │ │ -0016bc70: 6f61 703c 2f61 3e2d 2667 743b 3c61 2063 oap->fignore = │ │ │ -0016bce0: 2069 676e 6f72 653b 203c 2f64 6976 3e0a ignore;
. │ │ │ -0016bcf0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
... // │ │ │ -0016bd20: 2073 6f61 705f 6361 6c6c 5f6e 735f 5f77 soap_call_ns__w │ │ │ -0016bd30: 6562 6d65 7468 6f64 2873 6f61 702c 202e ebmethod(soap, . │ │ │ -0016bd40: 2e2e 2920 6f72 2073 6f61 705f 7365 7276 ..) or soap_serv │ │ │ -0016bd50: 6528 736f 6170 2920 3c2f 7370 616e 3e3c e(soap) < │ │ │ -0016bd60: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
}
. │ │ │ -0016bd80: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
.
int │ │ │ -0016bdd0: 2069 676e 6f72 6528 3c73 7061 6e20 636c ignore(st │ │ │ -0016bdf0: 7275 6374 3c2f 7370 616e 3e20 3c61 2063 ruct soap *soap, const │ │ │ -0016be80: 203c 7370 616e 2063 6c61 7373 3d22 6b65 char< │ │ │ -0016bea0: 2f73 7061 6e3e 202a 7461 6729 203c 2f64 /span> *tag) .
{
. │ │ │ -0016bee0: 2020 3c73 7061 6e20 636c 6173 733d 2263 // do no │ │ │ -0016bf00: 7420 6967 6e6f 7265 206d 7573 7455 6e64 t ignore mustUnd │ │ │ -0016bf10: 6572 7374 616e 643d 2671 756f 743b 7472 erstand="tr │ │ │ -0016bf20: 7565 2671 756f 743b 203c 2f73 7061 6e3e ue" │ │ │ -0016bf30: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
if ( │ │ │ -0016bf70: 213c 6120 636c 6173 733d 2263 6f64 6522 !soap │ │ │ -0016bfa0: 2d26 6774 3b3c 6120 636c 6173 733d 2263 ->mu │ │ │ -0016bff0: 7374 556e 6465 7273 7461 6e64 3c2f 613e stUnderstand │ │ │ -0016c000: 293c 2f64 6976 3e0a 3c64 6976 2063 6c61 )
.
{.
│ │ │ -0016c050: 2f2f 2074 6167 7320 266c 743b 6e73 3a73 // tags <ns:s │ │ │ -0016c060: 6f6d 6545 6c65 6d65 6e74 2667 743b 2063 omeElement> c │ │ │ -0016c070: 616e 2062 6520 7361 6665 6c79 2069 676e an be safely ign │ │ │ -0016c080: 6f72 6564 3c2f 7370 616e 3e3c 2f64 6976 ored
. │ │ │ -0016c210: 0a3c 6469 7620 636c 6173 733d 226c 696e .
return │ │ │ -0016c250: 203c 6120 636c 6173 733d 2263 6f64 6522 SOAP_OK │ │ │ -0016c2b0: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
.
}.
return │ │ │ -0016c310: 3c61 2063 6c61 7373 3d22 636f 6465 2220 SOAP_MUSTUND │ │ │ -0016c370: 4552 5354 414e 443c 2f61 3e3b 203c 2f64 ERSTAND; .
}
. │ │ │ -0016c3b0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
│ │ │ -0016c3e0: 7374 7275 6374 203c 2f73 7061 6e3e 3c61 struct Names │ │ │ -0016c420: 7061 6365 3c2f 613e 203c 6120 636c 6173 pace │ │ │ -0016c480: 6e61 6d65 7370 6163 6573 3c2f 613e 5b5d namespaces[] │ │ │ -0016c490: 203d 203c 2f64 6976 3e0a 3c64 6976 2063 =
.
{.
{ "SOAP │ │ │ -0016c4f0: 2d45 4e56 2671 756f 743b 3c2f 7370 616e -ENV", & │ │ │ -0016c520: 7175 6f74 3b68 7474 703a 2f2f 7363 6865 quot;http://sche │ │ │ -0016c530: 6d61 732e 786d 6c73 6f61 702e 6f72 672f mas.xmlsoap.org/ │ │ │ -0016c540: 736f 6170 2f65 6e76 656c 6f70 652f 2671 soap/envelope/&q │ │ │ -0016c550: 756f 743b 3c2f 7370 616e 3e20 7d2c 203c uot; }, < │ │ │ -0016c560: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
{ "SO │ │ │ -0016c5a0: 4150 2d45 4e43 2671 756f 743b 3c2f 7370 AP-ENC", "http://sc │ │ │ -0016c5e0: 6865 6d61 732e 786d 6c73 6f61 702e 6f72 hemas.xmlsoap.or │ │ │ -0016c5f0: 672f 736f 6170 2f65 6e63 6f64 696e 672f g/soap/encoding/ │ │ │ -0016c600: 2671 756f 743b 3c2f 7370 616e 3e20 7d2c " }, │ │ │ -0016c610: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
{ " │ │ │ -0016c650: 7873 6926 7175 6f74 3b3c 2f73 7061 6e3e xsi" │ │ │ -0016c660: 2c20 2020 2020 203c 7370 616e 2063 6c61 , "http:// │ │ │ -0016c690: 7777 772e 7733 2e6f 7267 2f32 3030 312f www.w3.org/2001/ │ │ │ -0016c6a0: 584d 4c53 6368 656d 612d 696e 7374 616e XMLSchema-instan │ │ │ -0016c6b0: 6365 2671 756f 743b 3c2f 7370 616e 3e20 ce" │ │ │ -0016c6c0: 7d2c 203c 2f64 6976 3e0a 3c64 6976 2063 },
.
{ │ │ │ -0016c6e0: 3c73 7061 6e20 636c 6173 733d 2273 7472 &quo │ │ │ -0016c700: 743b 7873 6426 7175 6f74 3b3c 2f73 7061 t;xsd", "http: │ │ │ -0016c740: 2f2f 7777 772e 7733 2e6f 7267 2f32 3030 //www.w3.org/200 │ │ │ -0016c750: 312f 584d 4c53 6368 656d 6126 7175 6f74 1/XMLSchema" │ │ │ -0016c760: 3b3c 2f73 7061 6e3e 207d 2c20 3c2f 6469 ; }, .
{ "ns&qu │ │ │ -0016c7b0: 6f74 3b3c 2f73 7061 6e3e 2c20 2020 2020 ot;, │ │ │ -0016c7c0: 2020 3c73 7061 6e20 636c 6173 733d 2273 &q │ │ │ -0016c7e0: 756f 743b 736f 6d65 2d55 5249 2671 756f uot;some-URI&quo │ │ │ -0016c7f0: 743b 3c2f 7370 616e 3e7d 2c20 3c73 7061 t;}, // binds " │ │ │ -0016c820: 3b6e 7326 7175 6f74 3b20 6e61 6d65 7370 ;ns" namesp │ │ │ -0016c830: 6163 6520 7072 6566 6978 2074 6f20 7363 ace prefix to sc │ │ │ -0016c840: 6865 6d61 2055 5249 3c2f 7370 616e 3e3c hema URI< │ │ │ -0016c850: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
{ NULL │ │ │ -0016c870: 2c20 4e55 4c4c 7d20 3c2f 6469 763e 0a3c , NULL}
.< │ │ │ -0016c880: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -0016c890: 3e5d 3b3c 2f64 6976 3e0a 3c64 6976 2063 >];
.
short mustU │ │ │ -0016c970: 6e64 6572 7374 616e 643c 2f64 6976 3e3c nderstand
< │ │ │ -0016c980: 6469 7620 636c 6173 733d 2274 7464 6f63 div class="ttdoc │ │ │ -0016c990: 223e 5468 6520 736f 6170 3a3a 6d75 7374 ">The soap::must │ │ │ -0016c9a0: 556e 6465 7273 7461 6e64 2066 6c61 6720 Understand flag │ │ │ -0016c9b0: 6973 2073 6574 2077 6865 6e20 6120 534f is set when a SO │ │ │ -0016c9c0: 4150 2048 6561 6465 7220 656c 656d 656e AP Header elemen │ │ │ -0016c9d0: 7420 6361 7272 6965 7320 6120 534f 4150 t carries a SOAP │ │ │ -0016c9e0: 2d45 4e56 3a6d 7573 7455 6e64 6572 7374 -ENV:mustUnderst │ │ │ -0016c9f0: 616e 6420 6174 742e 2e2e 3c2f 6469 763e and att...
│ │ │ -0016ca00: 3c64 6976 2063 6c61 7373 3d22 7474 6465
Definition │ │ │ -0016ca20: 3a3c 2f62 3e20 7374 6473 6f61 7032 2e68 : stdsoap2.h │ │ │ -0016ca30: 3a32 3936 313c 2f64 6976 3e3c 2f64 6976 :2961
.

Func │ │ │ -0016ca60: 7469 6f6e 203c 636f 6465 3e3c 6120 636c tion soap_m │ │ │ -0016cae0: 6174 6368 5f74 6167 3c2f 613e 3c2f 636f atch_tag compares two │ │ │ -0016cb00: 2074 6167 732e 2054 6865 2074 6869 7264 tags. The third │ │ │ -0016cb10: 2070 6172 616d 6574 6572 206d 6179 2062 parameter may b │ │ │ -0016cb20: 6520 6120 7061 7474 6572 6e20 7768 6572 e a pattern wher │ │ │ -0016cb30: 6520 3c63 6f64 653e 2a3c 2f63 6f64 653e e * │ │ │ -0016cb40: 2069 7320 6120 7769 6c64 6361 7264 2061 is a wildcard a │ │ │ -0016cb50: 6e64 203c 636f 6465 3e2d 3c2f 636f 6465 nd - is a single ch │ │ │ -0016cb70: 6172 6163 7465 7220 7769 6c64 6361 7264 aracter wildcard │ │ │ -0016cb80: 2e20 536f 2066 6f72 2065 7861 6d70 6c65 . So for example │ │ │ -0016cb90: 203c 636f 6465 3e73 6f61 705f 6d61 7463 soap_matc │ │ │ -0016cba0: 685f 7461 6728 736f 6170 2c20 7461 672c h_tag(soap, tag, │ │ │ -0016cbb0: 2022 6e73 3a2a 2229 3c2f 636f 6465 3e20 "ns:*") │ │ │ -0016cbc0: 7769 6c6c 206d 6174 6368 2061 6e79 2065 will match any e │ │ │ -0016cbd0: 6c65 6d65 6e74 2069 6e20 6e61 6d65 7370 lement in namesp │ │ │ -0016cbe0: 6163 6520 3c63 6f64 653e 6e73 3c2f 636f ace ns or when no n │ │ │ -0016cc00: 616d 6573 7061 6365 2070 7265 6669 7820 amespace prefix │ │ │ -0016cc10: 6973 2070 7265 7365 6e74 2069 6e20 7468 is present in th │ │ │ -0016cc20: 6520 584d 4c20 6d65 7373 6167 652e 3c2f e XML message..

The callba │ │ │ -0016cc40: 636b 2063 616e 2061 6c73 6f20 6265 2075 ck can also be u │ │ │ -0016cc50: 7365 6420 746f 206b 6565 7020 7472 6163 sed to keep trac │ │ │ -0016cc60: 6b20 6f66 2075 6e6b 6e6f 776e 2065 6c65 k of unknown ele │ │ │ -0016cc70: 6d65 6e74 7320 696e 2061 6e20 696e 7465 ments in an inte │ │ │ -0016cc80: 726e 616c 2064 6174 6120 7374 7275 6374 rnal data struct │ │ │ -0016cc90: 7572 6520 7375 6368 2061 7320 6120 6c69 ure such as a li │ │ │ -0016cca0: 7374 3a3c 2f70 3e0a 3c64 6976 2063 6c61 st:

.
│ │ │ -0016ccd0: 3c73 7061 6e20 636c 6173 733d 226b 6579 struct Unknown .
{
. │ │ │ -0016cd30: 203c 7370 616e 2063 6c61 7373 3d22 6b65 char< │ │ │ -0016cd50: 2f73 7061 6e3e 202a 7461 673b 203c 2f64 /span> *tag; .
st │ │ │ -0016cd90: 7275 6374 203c 2f73 7061 6e3e 556e 6b6e ruct Unkn │ │ │ -0016cda0: 6f77 6e20 2a6e 6578 743b 203c 2f64 6976 own *next;
.
};
. │ │ │ -0016cde0: 3c73 7061 6e20 636c 6173 733d 226b 6579 int
myignore(struct soap *soap, const< │ │ │ -0016ceb0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> char *ta │ │ │ -0016cee0: 6729 203c 2f64 6976 3e0a 3c64 6976 2063 g)
.
{.
char *s │ │ │ -0016cf40: 203d 2028 3c73 7061 6e20 636c 6173 733d = (ch │ │ │ -0016cf60: 6172 3c2f 7370 616e 3e2a 293c 6120 636c ar*) │ │ │ -0016cfc0: 736f 6170 5f6d 616c 6c6f 633c 2f61 3e28 soap_malloc( │ │ │ -0016cfd0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap, │ │ │ -0016d000: 2073 7472 6c65 6e28 7461 6729 2b31 293b strlen(tag)+1); │ │ │ -0016d010: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
struct │ │ │ -0016d050: 556e 6b6e 6f77 6e20 2a75 203d 2028 3c73 Unknown *u = (struct Unknown*) │ │ │ -0016d0e0: 736f 6170 5f6d 616c 6c6f 633c 2f61 3e28 soap_malloc( │ │ │ -0016d0f0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap, │ │ │ -0016d120: 203c 7370 616e 2063 6c61 7373 3d22 6b65 sizeof(struc │ │ │ -0016d160: 743c 2f73 7061 6e3e 2055 6e6b 6e6f 776e t Unknown │ │ │ -0016d170: 2929 3b20 3c2f 6469 763e 0a3c 6469 7620 ));
.
< │ │ │ -0016d190: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -0016d1a0: 6f72 6466 6c6f 7722 3e69 663c 2f73 7061 ordflow">if (s && │ │ │ -0016d1c0: 2075 2920 3c2f 6469 763e 0a3c 6469 7620 u)
.
{ │ │ │ -0016d1e0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
str │ │ │ -0016d200: 6370 7928 732c 2074 6167 293b 203c 2f64 cpy(s, tag); .
u-> │ │ │ -0016d230: 7461 6720 3d20 733b 203c 2f64 6976 3e0a tag = s;
. │ │ │ -0016d240: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
u->next │ │ │ -0016d260: 203d 2075 6c69 7374 3b20 3c2f 6469 763e = ulist;
│ │ │ -0016d270: 0a3c 6469 7620 636c 6173 733d 226c 696e .
ulist = u │ │ │ -0016d290: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
} < │ │ │ -0016d2b0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
}
│ │ │ -0016d2d0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
.
int main()
.< │ │ │ -0016d330: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -0016d340: 3e7b 3c2f 6469 763e 0a3c 6469 7620 636c >{
.
struct soap │ │ │ -0016d3b0: 202a 3c61 2063 6c61 7373 3d22 636f 6465 *soap< │ │ │ -0016d400: 2f61 3e3b 203c 2f64 6976 3e0a 3c64 6976 /a>;
.
│ │ │ -0016d420: 3c73 7061 6e20 636c 6173 733d 226b 6579 struct Unknown *uli │ │ │ -0016d450: 7374 203d 204e 554c 4c3b 203c 2f64 6976 st = NULL;
.
soap_ │ │ │ -0016d4d0: 696e 6974 3c2f 613e 2826 616d 703b 3c61 init(&soap); │ │ │ -0016d510: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
soap.fignore = │ │ │ -0016d5c0: 6d79 6967 6e6f 7265 3b20 3c2f 6469 763e myignore;
│ │ │ -0016d5d0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
... / │ │ │ -0016d600: 2f20 736f 6170 5f63 616c 6c5f 6e73 5f5f / soap_call_ns__ │ │ │ -0016d610: 7765 626d 6574 686f 6428 736f 6170 2c20 webmethod(soap, │ │ │ -0016d620: 2e2e 2e29 206f 7220 736f 6170 5f73 6572 ...) or soap_ser │ │ │ -0016d630: 7665 2873 6f61 7029 203c 2f73 7061 6e3e ve(soap) │ │ │ -0016d640: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
... < │ │ │ -0016d660: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ -0016d670: 656e 7422 3e2f 2f20 7072 696e 7420 7468 ent">// print th │ │ │ -0016d680: 6520 6c69 7374 206f 6620 756e 6b6e 6f77 e list of unknow │ │ │ -0016d690: 6e20 656c 656d 656e 7473 2073 746f 7265 n elements store │ │ │ -0016d6a0: 6420 696e 2075 6c69 7374 3c2f 7370 616e d in ulist
..< │ │ │ -0016d770: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -0016d780: 3e20 203c 6120 636c 6173 733d 2263 6f64 > soap_end │ │ │ -0016d7e0: 3c2f 613e 2826 616d 703b 3c61 2063 6c61 (&soap);
.
soap_ │ │ │ -0016d890: 646f 6e65 3c2f 613e 2826 616d 703b 3c61 done(&soap);< │ │ │ -0016d8d0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
}
. │ │ │ -0016d8f0: 3c2f 6469 763e 3c21 2d2d 2066 7261 676d

.... < │ │ │ -0016d910: 6120 6872 6566 3d22 2322 3e42 6163 6b20 a href="#">Back │ │ │ -0016d920: 746f 2074 6162 6c65 206f 6620 636f 6e74 to table of cont │ │ │ -0016d930: 656e 7473 3c2f 613e 3c2f 703e 0a3c 6832 ents

.

│ │ │ -0016d960: 3c2f 613e 0a48 6f77 2074 6f20 6861 6e64 .How to hand │ │ │ -0016d970: 6c65 2048 5454 5020 3330 3720 7465 6d70 le HTTP 307 temp │ │ │ -0016d980: 6f72 6172 7920 7265 6469 7265 6374 3c2f orary redirect.

The clien │ │ │ -0016d9a0: 742d 7369 6465 2068 616e 646c 696e 6720 t-side handling │ │ │ -0016d9b0: 6f66 2048 5454 5020 3330 3720 636f 6465 of HTTP 307 code │ │ │ -0016d9c0: 2022 5465 6d70 6f72 6172 7920 5265 6469 "Temporary Redi │ │ │ -0016d9d0: 7265 6374 2220 616e 6420 616e 7920 6f66 rect" and any of │ │ │ -0016d9e0: 2074 6865 2072 6564 6972 6563 7420 636f the redirect co │ │ │ -0016d9f0: 6465 7320 3330 312c 2033 3032 2c20 616e des 301, 302, an │ │ │ -0016da00: 6420 3330 3320 6172 6520 6e6f 7420 6175 d 303 are not au │ │ │ -0016da10: 746f 6d61 7465 642e 2043 6c69 656e 7420 tomated. Client │ │ │ -0016da20: 6170 706c 6963 6174 696f 6e20 6465 7665 application deve │ │ │ -0016da30: 6c6f 7065 7273 206d 6179 2077 616e 7420 lopers may want │ │ │ -0016da40: 746f 2063 6f6e 7369 6465 7220 6164 6469 to consider addi │ │ │ -0016da50: 6e67 2061 2066 6577 206c 696e 6573 206f ng a few lines o │ │ │ -0016da60: 6620 636f 6465 2074 6f20 7375 7070 6f72 f code to suppor │ │ │ -0016da70: 7420 7265 6469 7265 6374 732e 2049 7420 t redirects. It │ │ │ -0016da80: 7761 7320 6465 6369 6465 6420 6e6f 7420 was decided not │ │ │ -0016da90: 746f 2061 7574 6f6d 6174 6963 616c 6c79 to automatically │ │ │ -0016daa0: 2073 7570 706f 7274 2072 6564 6972 6563 support redirec │ │ │ -0016dab0: 7473 2066 6f72 2074 6865 2066 6f6c 6c6f ts for the follo │ │ │ -0016dac0: 7769 6e67 2072 6561 736f 6e73 3a3c 2f70 wing reasons:

.
    .
  • Redir │ │ │ -0016dae0: 6563 7469 6e67 2061 2073 6563 7572 6520 ecting a secure │ │ │ -0016daf0: 4854 5450 5320 6164 6472 6573 7320 746f HTTPS address to │ │ │ -0016db00: 2061 206e 6f6e 2d73 6563 7572 6520 4854 a non-secure HT │ │ │ -0016db10: 5450 2061 6464 7265 7373 2076 6961 2033 TP address via 3 │ │ │ -0016db20: 3037 2063 7265 6174 6573 2061 2073 6563 07 creates a sec │ │ │ -0016db30: 7572 6974 7920 7675 6c6e 6572 6162 696c urity vulnerabil │ │ │ -0016db40: 6974 792e 3c2f 6c69 3e0a 3c6c 693e 4379 ity.
  • .
  • Cy │ │ │ -0016db50: 636c 6963 2072 6564 6972 6563 7473 206d clic redirects m │ │ │ -0016db60: 7573 7420 6265 2064 6574 6563 7465 6420 ust be detected │ │ │ -0016db70: 2865 2e67 2e20 616c 6c6f 7769 6e67 206f (e.g. allowing o │ │ │ -0016db80: 6e6c 7920 6120 6c69 6d69 7465 6420 6e75 nly a limited nu │ │ │ -0016db90: 6d62 6572 206f 6620 7265 6469 7265 6374 mber of redirect │ │ │ -0016dba0: 206c 6576 656c 7329 2e3c 2f6c 693e 0a3c levels).
  • .< │ │ │ -0016dbb0: 6c69 3e52 6564 6972 6563 7469 6e67 2048 li>Redirecting H │ │ │ -0016dbc0: 5454 5020 504f 5354 2077 696c 6c20 7265 TTP POST will re │ │ │ -0016dbd0: 7375 6c74 2069 6e20 7265 2d73 6572 6961 sult in re-seria │ │ │ -0016dbe0: 6c69 7a61 7469 6f6e 2061 6e64 2072 652d lization and re- │ │ │ -0016dbf0: 706f 7374 206f 6620 7468 6520 656e 7469 post of the enti │ │ │ -0016dc00: 7265 2053 4f41 5020 7265 7175 6573 742e re SOAP request. │ │ │ -0016dc10: 2054 6865 2053 4f41 5020 7265 7175 6573 The SOAP reques │ │ │ -0016dc20: 7420 6d65 7373 6167 6520 6d75 7374 2062 t message must b │ │ │ -0016dc30: 6520 7265 2d70 6f73 7465 6420 696e 2069 e re-posted in i │ │ │ -0016dc40: 7473 2065 6e74 6972 6574 7920 7768 656e ts entirety when │ │ │ -0016dc50: 2072 652d 6973 7375 696e 6720 7468 6520 re-issuing the │ │ │ -0016dc60: 534f 4150 206f 7065 7261 7469 6f6e 2074 SOAP operation t │ │ │ -0016dc70: 6f20 6120 6e65 7720 6164 6472 6573 732e o a new address. │ │ │ -0016dc80: 3c2f 6c69 3e0a 3c2f 756c 3e0a 3c70 3e54 .
.

T │ │ │ -0016dc90: 6f20 696d 706c 656d 656e 7420 636c 6965 o implement clie │ │ │ -0016dca0: 6e74 2d73 6964 6520 3330 3720 7265 6469 nt-side 307 redi │ │ │ -0016dcb0: 7265 6374 2c20 6164 6420 7468 6520 666f rect, add the fo │ │ │ -0016dcc0: 6c6c 6f77 696e 6720 6c69 6e65 7320 6f66 llowing lines of │ │ │ -0016dcd0: 2063 6f64 653a 3c2f 703e 0a3c 6469 7620 code:

.
const │ │ │ -0016dd40: 6368 6172 3c2f 7370 616e 3e20 2a65 6e64 char *end │ │ │ -0016dd50: 706f 696e 7420 3d20 4e55 4c4c 3b20 3c73 point = NULL; // use defau │ │ │ -0016dd80: 6c74 2065 6e64 706f 696e 7420 6769 7665 lt endpoint give │ │ │ -0016dd90: 6e20 696e 2057 5344 4c20 6f72 2073 7065 n in WSDL or spe │ │ │ -0016dda0: 6369 6679 206f 6e65 2068 6572 653c 2f73 cify one here
.
int redirects = 10 │ │ │ -0016de00: 3b20 2020 2020 2020 2020 203c 7370 616e ; // max redirect │ │ │ -0016de30: 2063 6f75 6e74 203c 2f73 7061 6e3e 3c2f count .
while (r │ │ │ -0016de80: 6564 6972 6563 7473 2d2d 2920 3c2f 6469 edirects--) .
{
. │ │ │ -0016dec0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 if (soap_call_ │ │ │ -0016def0: 6e73 315f 5f6d 794d 6574 686f 6428 3c61 ns1__myMethod(soap, e │ │ │ -0016df30: 6e64 706f 696e 742c 202e 2e2e 2929 203c ndpoint, ...)) < │ │ │ -0016df40: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
{
.
if ((soap-&g │ │ │ -0016dfd0: 743b 3c61 2063 6c61 7373 3d22 636f 6465 t;error │ │ │ -0016e020: 3c2f 613e 2026 6774 3b3d 2033 3031 2026 >= 301 & │ │ │ -0016e030: 616d 703b 2661 6d70 3b20 3c61 2063 6c61 amp;& soap->error │ │ │ -0016e0c0: 2026 6c74 3b3d 2033 3033 2920 7c7c 203c <= 303) || < │ │ │ -0016e0d0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -0016e0e0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ -0016e0f0: 6874 6d6c 223e 736f 6170 3c2f 613e 2d26 html">soap-& │ │ │ -0016e100: 6774 3b3c 6120 636c 6173 733d 2263 6f64 gt;erro │ │ │ -0016e150: 723c 2f61 3e20 3d3d 2033 3037 2920 3c2f r == 307) .
{.
endpo │ │ │ -0016e1a0: 696e 7420 3d20 3c61 2063 6c61 7373 3d22 int = soap_ │ │ │ -0016e200: 7374 7264 7570 3c2f 613e 283c 6120 636c strdup(soap, soap-> │ │ │ -0016e270: 3c61 2063 6c61 7373 3d22 636f 6465 2220 endpoin │ │ │ -0016e2c0: 743c 2f61 3e29 3b20 3c73 7061 6e20 636c t); // │ │ │ -0016e2e0: 2065 6e64 706f 696e 7420 6672 6f6d 2048 endpoint from H │ │ │ -0016e2f0: 5454 5020 3330 312c 2033 3032 2c20 3330 TTP 301, 302, 30 │ │ │ -0016e300: 332c 2033 3037 204c 6f63 6174 696f 6e20 3, 307 Location │ │ │ -0016e310: 6865 6164 6572 203c 2f73 7061 6e3e 3c2f header .
}.
else < │ │ │ -0016e380: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
{.
... │ │ │ -0016e3c0: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // handle │ │ │ -0016e3e0: 6572 726f 7220 3c2f 7370 616e 3e3c 2f64 error .
break;
.
│ │ │ -0016e450: 207d 203c 2f64 6976 3e0a 3c64 6976 2063 }
.
} │ │ │ -0016e470: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
else │ │ │ -0016e4b0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
{.
break │ │ │ -0016e510: 3b20 3c73 7061 6e20 636c 6173 733d 2263 ; // all O │ │ │ -0016e530: 4b20 6e6f 773c 2f73 7061 6e3e 3c2f 6469 K now.
}
.< │ │ │ -0016e560: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -0016e570: 3e7d 3c2f 6469 763e 0a3c 2f64 6976 3e3c >}
.
< │ │ │ -0016e580: 212d 2d20 6672 6167 6d65 6e74 202d 2d3e !-- fragment --> │ │ │ -0016e590: 3c70 3ef0 9f94 9d20 3c61 2068 7265 663d

.... Back to tabl │ │ │ -0016e5b0: 6520 6f66 2063 6f6e 7465 6e74 733c 2f61 e of contents

.

.How to │ │ │ -0016e5f0: 2069 6d70 6c65 6d65 6e74 2048 5454 5020 implement HTTP │ │ │ -0016e600: 4745 542c 2050 5554 2c20 616e 6420 5041 GET, PUT, and PA │ │ │ -0016e610: 5443 4820 7365 7276 6963 6573 3c2f 6832 TCH services

.

To implemen │ │ │ -0016e630: 7420 4854 5450 2047 4554 2072 6571 7565 t HTTP GET reque │ │ │ -0016e640: 7374 2072 6573 706f 6e73 6573 2c20 6465 st responses, de │ │ │ -0016e650: 6669 6e65 2074 6865 203c 636f 6465 3e3c fine the < │ │ │ -0016e660: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ -0016e670: 663d 2267 726f 7570 5f5f 6772 6f75 705f f="group__group_ │ │ │ -0016e680: 5f63 616c 6c62 6163 6b73 2e68 746d 6c23 _callbacks.html# │ │ │ -0016e690: 6761 6530 3232 3230 3466 6637 3030 3464 gae022204ff7004d │ │ │ -0016e6a0: 6632 6435 6163 3965 3038 3363 6262 3562 f2d5ac9e083cbb5b │ │ │ -0016e6b0: 3136 2220 7469 746c 653d 2243 616c 6c62 16" title="Callb │ │ │ -0016e6c0: 6163 6b20 746f 2069 6d70 6c65 6d65 6e74 ack to implement │ │ │ -0016e6d0: 206c 6f67 6963 2061 7420 7468 6520 7365 logic at the se │ │ │ -0016e6e0: 7276 6572 2d73 6964 6520 746f 2073 6572 rver-side to ser │ │ │ -0016e6f0: 7665 2072 6573 706f 6e73 6573 2074 6f20 ve responses to │ │ │ -0016e700: 4854 5450 2047 4554 2072 6571 7565 7374 HTTP GET request │ │ │ -0016e710: 7320 6672 6f6d 2063 6c69 656e 7473 2e22 s from clients." │ │ │ -0016e720: 3e73 6f61 703a 3a66 6765 743c 2f61 3e3c >soap::fget< │ │ │ -0016e730: 2f63 6f64 653e 2063 616c 6c62 6163 6b20 /code> callback │ │ │ -0016e740: 6675 6e63 7469 6f6e 2e20 5468 6520 6361 function. The ca │ │ │ -0016e750: 6c6c 6261 636b 2069 7320 7265 7175 6972 llback is requir │ │ │ -0016e760: 6564 2074 6f20 7072 6f64 7563 6520 6120 ed to produce a │ │ │ -0016e770: 7265 7370 6f6e 7365 2074 6f20 7468 6520 response to the │ │ │ -0016e780: 7265 7175 6573 7420 696e 2074 6578 7475 request in textu │ │ │ -0016e790: 616c 2066 6f72 6d2c 2073 7563 6820 6173 al form, such as │ │ │ -0016e7a0: 2061 2057 6562 2070 6167 6520 6f72 2061 a Web page or a │ │ │ -0016e7b0: 6e20 584d 4c20 6f72 204a 534f 4e20 7265 n XML or JSON re │ │ │ -0016e7c0: 7370 6f6e 7365 2e3c 2f70 3e0a 3c70 3e59 sponse.

.

Y │ │ │ -0016e7d0: 6f75 2063 616e 2061 6c73 6f20 7573 6520 ou can also use │ │ │ -0016e7e0: 7468 6520 3c63 6f64 653e 3c61 2063 6c61 the http_ │ │ │ -0016e870: 6765 743c 2f61 3e3c 2f63 6f64 653e 2070 get p │ │ │ -0016e880: 6c75 6769 6e20 7768 6963 6820 6573 7365 lugin which esse │ │ │ -0016e890: 6e74 6961 6c6c 7920 7365 7473 2074 6865 ntially sets the │ │ │ -0016e8a0: 203c 636f 6465 3e3c 6120 636c 6173 733d soap::f │ │ │ -0016e970: 6765 743c 2f61 3e3c 2f63 6f64 653e 2063 get c │ │ │ -0016e980: 616c 6c62 6163 6b20 616e 6420 616c 736f allback and also │ │ │ -0016e990: 206b 6565 7073 2074 7261 636b 206f 6620 keeps track of │ │ │ -0016e9a0: 7468 6520 6e75 6d62 6572 206f 6620 4854 the number of HT │ │ │ -0016e9b0: 5450 2047 4554 2061 6e64 2050 4f53 5420 TP GET and POST │ │ │ -0016e9c0: 7265 7175 6573 7473 206d 6164 6520 6174 requests made at │ │ │ -0016e9d0: 2074 6865 2073 6572 7665 7220 7369 6465 the server side │ │ │ -0016e9e0: 2e3c 2f70 3e0a 3c70 3e54 6865 2066 6f6c .

.

The fol │ │ │ -0016e9f0: 6c6f 7769 6e67 2065 7861 6d70 6c65 2070 lowing example p │ │ │ -0016ea00: 726f 6475 6365 7320 6120 5765 6220 7061 roduces a Web pa │ │ │ -0016ea10: 6765 2075 706f 6e20 6120 4854 5450 2047 ge upon a HTTP G │ │ │ -0016ea20: 4554 2072 6571 7565 7374 2028 652e 672e ET request (e.g. │ │ │ -0016ea30: 2066 726f 6d20 6120 6272 6f77 7365 7229 from a browser) │ │ │ -0016ea40: 3a3c 2f70 3e0a 3c64 6976 2063 6c61 7373 :

.
int main()
. │ │ │ -0016eaa0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
{
. │ │ │ -0016ebc0: 0a3c 6469 7620 636c 6173 733d 226c 696e .. │ │ │ -0016ecd0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
... // │ │ │ -0016ed00: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ -0016ed20: 2020 3c61 2063 6c61 7373 3d22 636f 6465 soap_serve │ │ │ -0016ed80: 283c 6120 636c 6173 733d 2263 6f64 6522 (soap │ │ │ -0016edb0: 293b 203c 2f64 6976 3e0a 3c64 6976 2063 );
.
.. │ │ │ -0016edd0: 2e20 3c73 7061 6e20 636c 6173 733d 2263 . //
.
}
.
..{ │ │ │ -0016ef60: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
if ( │ │ │ -0016efa0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 │ │ │ -0016eff0: 736f 6170 5f72 6573 706f 6e73 653c 2f61 soap_response(soap, SOAP_HTML │ │ │ -0016f090: 2920 3c73 7061 6e20 636c 6173 733d 2263 ) // HTTP │ │ │ -0016f0b0: 7265 7370 6f6e 7365 2068 6561 6465 7220 response header │ │ │ -0016f0c0: 7769 7468 2074 6578 742f 6874 6d6c 203c with text/html < │ │ │ -0016f0d0: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
. │ │ │ -0016f0f0: 2020 7c7c 203c 6120 636c 6173 733d 2263 || soap_send(soap, │ │ │ -0016f1a0: 2671 756f 743b 266c 743b 4854 4d4c 2667 "<HTML&g │ │ │ -0016f1b0: 743b 4d79 2057 6562 2073 6572 7665 7220 t;My Web server │ │ │ -0016f1c0: 6973 206f 7065 7261 7469 6f6e 616c 2e26 is operational.& │ │ │ -0016f1d0: 6c74 3b2f 4854 4d4c 2667 743b 2671 756f lt;/HTML>&quo │ │ │ -0016f1e0: 743b 3c2f 7370 616e 3e29 3c2f 6469 763e t;)
│ │ │ -0016f1f0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
|| soap_en │ │ │ -0016f260: 645f 7365 6e64 3c2f 613e 283c 6120 636c d_send(soap))..
│ │ │ -0016f390: 3c73 7061 6e20 636c 6173 733d 226b 6579 return │ │ │ -0016f3b0: 3c2f 7370 616e 3e20 3c61 2063 6c61 7373 soap_clo │ │ │ -0016f410: 7365 736f 636b 3c2f 613e 283c 6120 636c sesock(soap);.
}
.
soap::fget │ │ │ -0016f530: 3c2f 6469 763e 3c64 6976 2063 6c61 7373
int(* │ │ │ -0016f550: 6667 6574 2928 7374 7275 6374 2073 6f61 fget)(struct soa │ │ │ -0016f560: 7020 2a73 6f61 7029 3c2f 6469 763e 3c64 p *soap)
Callback to imp │ │ │ -0016f590: 6c65 6d65 6e74 206c 6f67 6963 2061 7420 lement logic at │ │ │ -0016f5a0: 7468 6520 7365 7276 6572 2d73 6964 6520 the server-side │ │ │ -0016f5b0: 746f 2073 6572 7665 2072 6573 706f 6e73 to serve respons │ │ │ -0016f5c0: 6573 2074 6f20 4854 5450 2047 4554 2072 es to HTTP GET r │ │ │ -0016f5d0: 6571 7565 7374 7320 6672 6f6d 2063 6c69 equests from cli │ │ │ -0016f5e0: 656e 7473 2e3c 2f64 6976 3e3c 6469 7620 ents.
Definition: │ │ │ -0016f610: 2073 7464 736f 6170 322e 683a 3433 3330 stdsoap2.h:4330 │ │ │ -0016f620: 3c2f 6469 763e 3c2f 6469 763e 0a3c 6469
.soap_respons │ │ │ -0016f6e0: 653c 2f61 3e3c 2f64 6976 3e3c 6469 7620 e
i │ │ │ -0016f700: 6e74 2073 6f61 705f 7265 7370 6f6e 7365 nt soap_response │ │ │ -0016f710: 2873 7472 7563 7420 736f 6170 202a 736f (struct soap *so │ │ │ -0016f720: 6170 2c20 696e 7420 7374 6174 7573 293c ap, int status)< │ │ │ -0016f730: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
Initiali │ │ │ -0016f750: 7a65 2074 6865 2063 6f6e 7465 7874 2066 ze the context f │ │ │ -0016f760: 6f72 2073 6572 7665 722d 7369 6465 2073 or server-side s │ │ │ -0016f770: 656e 6469 6e67 2061 6e64 2073 656e 6420 ending and send │ │ │ -0016f780: 6120 4854 5450 2072 6573 706f 6e73 6520 a HTTP response │ │ │ -0016f790: 6865 6164 6572 2e3c 2f64 6976 3e3c 2f64 header.
.
soap_ │ │ │ -0016f850: 636c 6f73 6573 6f63 6b3c 2f61 3e3c 2f64 closesock
int soap_ │ │ │ -0016f880: 636c 6f73 6573 6f63 6b28 7374 7275 6374 closesock(struct │ │ │ -0016f890: 2073 6f61 7020 2a73 6f61 7029 3c2f 6469 soap *soap)
Close the s │ │ │ -0016f8c0: 6f63 6b65 7420 636f 6e6e 6563 7469 6f6e ocket connection │ │ │ -0016f8d0: 2e3c 2f64 6976 3e3c 2f64 6976 3e0a 3c64 .
.http_get
int h │ │ │ -0016f9b0: 7474 705f 6765 7428 7374 7275 6374 2073 ttp_get(struct s │ │ │ -0016f9c0: 6f61 7020 2a2c 2073 7472 7563 7420 736f oap *, struct so │ │ │ -0016f9d0: 6170 5f70 6c75 6769 6e20 2a2c 2076 6f69 ap_plugin *, voi │ │ │ -0016f9e0: 6420 2a29 3c2f 6469 763e 3c64 6976 2063 d *)
The │ │ │ -0016fa00: 2048 5454 5020 4745 5420 706c 7567 696e HTTP GET plugin │ │ │ -0016fa10: 2072 6567 6973 7472 6174 696f 6e20 6675 registration fu │ │ │ -0016fa20: 6e63 7469 6f6e 2e3c 2f64 6976 3e3c 2f64 nction.
.
#define SOAP_H │ │ │ -0016fb10: 544d 4c3c 2f64 6976 3e3c 6469 7620 636c TML
A sp │ │ │ -0016fb30: 6563 6961 6c20 736f 6170 5f73 7461 7475 ecial soap_statu │ │ │ -0016fb40: 7320 6572 726f 7220 636f 6465 2074 6f20 s error code to │ │ │ -0016fb50: 7369 676e 616c 2074 6861 7420 6120 6375 signal that a cu │ │ │ -0016fb60: 7374 6f6d 2048 5454 5020 7265 7370 6f6e stom HTTP respon │ │ │ -0016fb70: 7365 2069 7320 7072 6573 656e 7420 616e se is present an │ │ │ -0016fb80: 6420 6e6f 2048 5454 5020 7265 7370 6f6e d no HTTP respon │ │ │ -0016fb90: 732e 2e2e 3c2f 6469 763e 3c64 6976 2063 s...
│ │ │ -0016fbb0: 4465 6669 6e69 7469 6f6e 3a3c 2f62 3e20 Definition: │ │ │ -0016fbc0: 7374 6473 6f61 7032 2e68 3a32 3731 323c stdsoap2.h:2712< │ │ │ -0016fbd0: 2f64 6976 3e3c 2f64 6976 3e0a 3c64 6976 /div>
.
│ │ │ -0016fc40: 3c61 2068 7265 663d 2267 726f 7570 5f5f soap_end_send │ │ │ -0016fc90: 3c2f 613e 3c2f 6469 763e 3c64 6976 2063
in │ │ │ -0016fcb0: 7420 736f 6170 5f65 6e64 5f73 656e 6428 t soap_end_send( │ │ │ -0016fcc0: 7374 7275 6374 2073 6f61 7020 2a73 6f61 struct soap *soa │ │ │ -0016fcd0: 7029 3c2f 6469 763e 3c64 6976 2063 6c61 p)
Final │ │ │ -0016fcf0: 697a 6520 7468 6520 636f 6e74 6578 7420 ize the context │ │ │ -0016fd00: 6166 7465 7220 7365 6e64 696e 672e 3c2f after sending.
.

This │ │ │ -00171420: 6578 616d 706c 6520 7368 6f77 7320 686f example shows ho │ │ │ -00171430: 7720 6f6e 6520 7072 6564 6574 6572 6d69 w one predetermi │ │ │ -00171440: 6e65 6420 6669 6c65 2069 7320 7365 7276 ned file is serv │ │ │ -00171450: 6564 2e20 5468 6520 3c65 6d3e 3c63 6f64 ed. The gsoap/samples/ │ │ │ -00171470: 7765 6273 6572 7665 723c 2f63 6f64 653e webserver │ │ │ -00171480: 3c2f 656d 3e20 6465 6d6f 6e73 7472 6174 demonstrat │ │ │ -00171490: 6573 2068 6f77 2066 696c 6573 2073 686f es how files sho │ │ │ -001714a0: 756c 6420 6265 2073 6572 7665 6420 696e uld be served in │ │ │ -001714b0: 2067 656e 6572 616c 2c20 6279 2061 6464 general, by add │ │ │ -001714c0: 696e 6720 7468 6520 6e65 6365 7373 6172 ing the necessar │ │ │ -001714d0: 7920 6c6f 6769 6320 746f 2061 6464 206d y logic to add m │ │ │ -001714e0: 6564 6961 2074 7970 6573 2074 6f20 4854 edia types to HT │ │ │ -001714f0: 5450 2068 6561 6465 7273 2061 6e64 2074 TP headers and t │ │ │ -00171500: 6f20 7265 7374 7269 6374 2074 6865 2073 o restrict the s │ │ │ -00171510: 656c 6563 7469 6f6e 206f 6620 6669 6c65 election of file │ │ │ -00171520: 7320 7468 6174 2073 686f 756c 6420 6265 s that should be │ │ │ -00171530: 2073 6572 7665 642e 3c2f 703e 0a3c 646c served.

.
War │ │ │ -00171560: 6e69 6e67 3c2f 6474 3e3c 6464 3e57 6865 ning
Whe │ │ │ -00171570: 6e20 7365 7276 696e 6720 6669 6c65 7320 n serving files │ │ │ -00171580: 6173 2072 6573 706f 6e73 6573 2074 6f20 as responses to │ │ │ -00171590: 7265 7175 6573 7473 2c20 7765 206e 6565 requests, we nee │ │ │ -001715a0: 6420 746f 2062 6520 7661 7279 2063 6172 d to be vary car │ │ │ -001715b0: 6566 756c 2c20 6265 6361 7573 6520 7765 eful, because we │ │ │ -001715c0: 2064 6f6e 2774 2077 616e 7420 7265 7175 don't want requ │ │ │ -001715d0: 6573 7473 2074 6f20 736e 6f6f 7020 6172 ests to snoop ar │ │ │ -001715e0: 6f75 6e64 2069 6e20 6469 7265 6374 6f72 ound in director │ │ │ -001715f0: 6965 7320 616e 6420 7365 7276 6520 6669 ies and serve fi │ │ │ -00171600: 6c65 7320 7468 6174 2073 686f 756c 6420 les that should │ │ │ -00171610: 6265 2070 726f 7465 6374 6564 2066 726f be protected fro │ │ │ -00171620: 6d20 7075 626c 6963 2076 6965 772e 2054 m public view. T │ │ │ -00171630: 6865 7265 666f 7265 2c20 7768 656e 2061 herefore, when a │ │ │ -00171640: 6464 696e 6720 6c6f 6769 6320 746f 2073 dding logic to s │ │ │ -00171650: 6572 7665 2066 696c 6573 2c20 7765 206d erve files, we m │ │ │ -00171660: 7573 7420 7265 6a65 6374 2072 6571 7565 ust reject reque │ │ │ -00171670: 7374 2074 6861 7420 6861 7665 203c 636f st that have soap:: │ │ │ -00171710: 7061 7468 3c2f 613e 3c2f 636f 6465 3e20 path │ │ │ -00171720: 7661 6c75 6573 2077 6974 6820 6120 3c63 values with a / or │ │ │ -00171740: 6120 3c63 6f64 653e 5c3c 2f63 6f64 653e a \ │ │ │ -00171750: 2028 3c63 6f64 653e 3c61 2063 6c61 7373 (s │ │ │ -001717e0: 6f61 703a 3a70 6174 683c 2f61 3e3c 2f63 oap::path is a string │ │ │ -00171800: 2077 6974 6820 7468 6520 7061 7468 2070 with the path p │ │ │ -00171810: 6172 7420 6f66 2074 6865 2055 524c 2c20 art of the URL, │ │ │ -00171820: 7374 6172 7469 6e67 2077 6974 6820 6120 starting with a │ │ │ -00171830: 3c63 6f64 653e 2f3c 2f63 6f64 653e 292e /). │ │ │ -00171840: 2049 6620 7468 6573 6520 6172 6520 616c If these are al │ │ │ -00171850: 6c6f 7765 642c 2074 6865 6e20 7765 206d lowed, then we m │ │ │ -00171860: 7573 7420 6174 206c 6561 7374 2063 6865 ust at least che │ │ │ -00171870: 636b 2066 6f72 203c 636f 6465 3e2e 2e3c ck for ..< │ │ │ -00171880: 2f63 6f64 653e 2069 6e20 7468 6520 7061 /code> in the pa │ │ │ -00171890: 7468 2074 6f20 6176 6f69 6420 7265 7175 th to avoid requ │ │ │ -001718a0: 6573 7420 6672 6f6d 2073 6e6f 6f70 696e est from snoopin │ │ │ -001718b0: 6720 6172 6f75 6e64 2069 6e20 6869 6768 g around in high │ │ │ -001718c0: 6572 2064 6972 6563 746f 7269 6573 2061 er directories a │ │ │ -001718d0: 6c6c 2074 6865 2077 6179 2075 7020 746f ll the way up to │ │ │ -001718e0: 2074 6865 2072 6f6f 742e 3c2f 6464 3e3c the root.
< │ │ │ -001718f0: 2f64 6c3e 0a3c 703e 466f 7220 6120 6f6e /dl>.

For a on │ │ │ -00171900: 652d 7761 7920 534f 4150 2f58 4d4c 206d e-way SOAP/XML m │ │ │ -00171910: 6573 7361 6765 2c20 796f 7520 6361 6e20 essage, you can │ │ │ -00171920: 616c 736f 2072 6574 7572 6e20 6120 534f also return a SO │ │ │ -00171930: 4150 2f58 4d4c 2072 6573 706f 6e73 653a AP/XML response: │ │ │ -00171940: 3c2f 703e 0a3c 6469 7620 636c 6173 733d

.
int http_get(< │ │ │ -001719f0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -00171a00: 6f72 6422 3e73 7472 7563 743c 2f73 7061 ord">struct soap *soap< │ │ │ -00171a70: 2f61 3e29 203c 2f64 6976 3e0a 3c64 6976 /a>)
.
{< │ │ │ -00171a90: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
soap_r │ │ │ -00171b00: 6573 706f 6e73 653c 2f61 3e28 3c61 2063 esponse(soap, SOAP_OK); < │ │ │ -00171ba0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
return soap_send_ns1_ │ │ │ -00171bf0: 5f6d 7953 656e 644d 6574 686f 6452 6573 _mySendMethodRes │ │ │ -00171c00: 706f 6e73 6528 3c61 2063 6c61 7373 3d22 ponse(soa │ │ │ -00171c30: 703c 2f61 3e2c 203c 7370 616e 2063 6c61 p, ""< │ │ │ -00171c60: 2f73 7061 6e3e 2c20 4e55 4c4c 2c20 2e2e /span>, NULL, .. │ │ │ -00171c70: 2e20 7061 7261 6d73 202e 2e2e 293b 203c . params ...); < │ │ │ -00171c80: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
}
│ │ │ -00171ca0: 0a3c 2f64 6976 3e3c 212d 2d20 6672 6167 .

where │ │ │ -00171cc0: 203c 636f 6465 3e6e 7331 5f5f 6d79 5365 ns1__mySe │ │ │ -00171cd0: 6e64 4d65 7468 6f64 5265 7370 6f6e 7365 ndMethodResponse │ │ │ -00171ce0: 3c2f 636f 6465 3e20 6973 2061 206f 6e65 is a one │ │ │ -00171cf0: 2d77 6179 206d 6573 7361 6765 2064 6563 -way message dec │ │ │ -00171d00: 6c61 7265 6420 696e 2061 2069 6e74 6572 lared in a inter │ │ │ -00171d10: 6661 6365 2068 6561 6465 7220 6669 6c65 face header file │ │ │ -00171d20: 2061 733a 3c2f 703e 0a3c 6469 7620 636c as:

.
< │ │ │ -00171d40: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -00171d50: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >int ns1__mySen │ │ │ -00171d80: 644d 6574 686f 6452 6573 706f 6e73 6528 dMethodResponse( │ │ │ -00171d90: 2e2e 2e20 7061 7261 6d73 202e 2e2e 2c20 ... params ..., │ │ │ -00171da0: 3c73 7061 6e20 636c 6173 733d 226b 6579 void);
.

The gene │ │ │ -00171df0: 7261 7465 6420 3c65 6d3e 3c63 6f64 653e rated │ │ │ -00171e00: 736f 6170 436c 6965 6e74 2e63 7070 3c2f soapClient.cpp inclu │ │ │ -00171e20: 6465 7320 7468 6520 7365 6e64 696e 672d des the sending- │ │ │ -00171e30: 7369 6465 2073 7475 6220 6675 6e63 7469 side stub functi │ │ │ -00171e40: 6f6e 2e3c 2f70 3e0a 3c70 3e54 6865 2065 on.

.

The e │ │ │ -00171e50: 7861 6d70 6c65 7320 6162 6f76 6520 6172 xamples above ar │ │ │ -00171e60: 6520 666f 7220 4854 5450 2047 4554 2e20 e for HTTP GET. │ │ │ -00171e70: 546f 2069 6d70 6c65 6d65 6e74 2048 5454 To implement HTT │ │ │ -00171e80: 5020 5055 5420 616e 6420 5041 5443 4820 P PUT and PATCH │ │ │ -00171e90: 7365 7420 7468 6520 3c63 6f64 653e 3c61 set the │ │ │ -00171f60: 736f 6170 3a3a 6670 7574 3c2f 613e 3c2f soap::fput and │ │ │ -00171f80: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap::fpat │ │ │ -00172050: 6368 3c2f 613e 3c2f 636f 6465 3e20 6361 ch ca │ │ │ -00172060: 6c6c 6261 636b 2066 756e 6374 696f 6e73 llback functions │ │ │ -00172070: 206f 7220 7573 6520 7468 6520 3c63 6f64 or use the http_post plugin │ │ │ -00172120: 7768 6963 6820 6973 206d 6f72 6520 6361 which is more ca │ │ │ -00172130: 7061 626c 652e 3c2f 703e 0a3c 703e f09f pable.

.

.. │ │ │ -00172140: 949d 203c 6120 6872 6566 3d22 2322 3e42 .. B │ │ │ -00172150: 6163 6b20 746f 2074 6162 6c65 206f 6620 ack to table of │ │ │ -00172160: 636f 6e74 656e 7473 3c2f 613e 3c2f 703e contents

│ │ │ -00172170: 0a3c 6832 3e3c 6120 636c 6173 733d 2261 .

.TCP a │ │ │ -001721a0: 6e64 2048 5454 5020 6b65 6570 2d61 6c69 nd HTTP keep-ali │ │ │ -001721b0: 7665 3c2f 6832 3e0a 3c70 3e54 6f20 6163 ve

.

To ac │ │ │ -001721c0: 7469 7661 7465 2048 5454 5020 6b65 6570 tivate HTTP keep │ │ │ -001721d0: 2d61 6c69 7665 2c20 7365 7420 7468 6520 -alive, set the │ │ │ -001721e0: 3c63 6f64 653e 2353 4f41 505f 494f 5f4b #SOAP_IO_K │ │ │ -001721f0: 4545 5041 4c49 5645 3c2f 636f 6465 3e20 EEPALIVE │ │ │ -00172200: 666c 6167 2066 6f72 2062 6f74 6820 696e flag for both in │ │ │ -00172210: 7075 7420 616e 6420 6f75 7470 7574 206d put and output m │ │ │ -00172220: 6f64 6573 2c20 7365 6520 5365 6374 696f odes, see Sectio │ │ │ -00172230: 6e20 3c61 2063 6c61 7373 3d22 656c 2220 n Run-time │ │ │ -00172260: 2066 6c61 6773 3c2f 613e 202e 2046 6f72 flags . For │ │ │ -00172270: 2065 7861 6d70 6c65 3c2f 703e 0a3c 6469 example

. │ │ │ -00172330: 0a3c 6469 7620 636c 6173 733d 226c 696e ..< │ │ │ -00172450: 2f64 6976 3e3c 212d 2d20 6672 6167 6d65 /div>

When a │ │ │ -00172470: 636c 6965 6e74 206f 7220 6120 7365 7276 client or a serv │ │ │ -00172480: 6963 6520 636f 6d6d 756e 6963 6174 6573 ice communicates │ │ │ -00172490: 2077 6974 6820 616e 6f74 6865 7220 636c with another cl │ │ │ -001724a0: 6965 6e74 206f 7220 7365 7276 6963 6520 ient or service │ │ │ -001724b0: 7468 6174 2073 7570 706f 7274 7320 6b65 that supports ke │ │ │ -001724c0: 6570 2061 6c69 7665 2c20 7468 6520 3c63 ep alive, the soap::keep_ali │ │ │ -00172590: 7665 3c2f 613e 3c2f 636f 6465 3e20 7661 ve va │ │ │ -001725a0: 7269 6162 6c65 2077 696c 6c20 6265 2073 riable will be s │ │ │ -001725b0: 6574 2074 6f20 312c 206f 7468 6572 7769 et to 1, otherwi │ │ │ -001725c0: 7365 2069 7420 6973 2072 6573 6574 2074 se it is reset t │ │ │ -001725d0: 6f20 3020 696e 6469 6361 7469 6e67 2074 o 0 indicating t │ │ │ -001725e0: 6861 7420 7468 6520 6f74 6865 7220 7061 hat the other pa │ │ │ -001725f0: 7274 7920 7761 6e74 7320 746f 2063 6c6f rty wants to clo │ │ │ -00172600: 7365 2074 6865 2063 6f6e 6e65 6374 696f se the connectio │ │ │ -00172610: 6e2e 2054 6865 2063 6f6e 6e65 6374 696f n. The connectio │ │ │ -00172620: 6e20 6d61 7962 6520 7465 726d 696e 6174 n maybe terminat │ │ │ -00172630: 6564 206f 6e20 6569 7468 6572 2065 6e64 ed on either end │ │ │ -00172640: 2062 6566 6f72 6520 7468 6520 636f 6d6d before the comm │ │ │ -00172650: 756e 6963 6174 696f 6e20 636f 6d70 6c65 unication comple │ │ │ -00172660: 7465 642c 2066 6f72 2065 7861 6d70 6c65 ted, for example │ │ │ -00172670: 2077 6865 6e20 7468 6520 7365 7276 6572 when the server │ │ │ -00172680: 206b 6565 702d 616c 6976 6520 636f 6e6e keep-alive conn │ │ │ -00172690: 6563 7469 6f6e 2068 6173 2074 696d 6564 ection has timed │ │ │ -001726a0: 206f 7574 2e20 5468 6973 206d 6179 2067 out. This may g │ │ │ -001726b0: 656e 6572 6174 6520 6120 2242 726f 6b65 enerate a "Broke │ │ │ -001726c0: 6e20 5069 7065 2220 7369 676e 616c 206f n Pipe" signal o │ │ │ -001726d0: 6e20 556e 6978 2f4c 696e 7578 2070 6c61 n Unix/Linux pla │ │ │ -001726e0: 7466 6f72 6d73 2e20 5468 6973 2073 6967 tforms. This sig │ │ │ -001726f0: 6e61 6c20 6361 6e20 6265 2063 6175 6768 nal can be caugh │ │ │ -00172700: 7420 7769 7468 2061 2073 6967 6e61 6c20 t with a signal │ │ │ -00172710: 6861 6e64 6c65 723a 3c2f 703e 0a3c 6469 handler:

.
signal(SIGP │ │ │ -00172750: 4950 452c 2073 6967 7069 7065 5f68 616e IPE, sigpipe_han │ │ │ -00172760: 646c 6529 3b3c 2f64 6976 3e0a 3c2f 6469 dle);
.

where, for │ │ │ -00172790: 2065 7861 6d70 6c65 3a3c 2f70 3e0a 3c64 example:

.
│ │ │ -001727e0: 766f 6964 3c2f 7370 616e 3e20 7369 6770 void sigp │ │ │ -001727f0: 6970 655f 6861 6e64 6c65 283c 7370 616e ipe_handle(int │ │ │ -00172820: 7829 207b 207d 3c2f 6469 763e 0a3c 2f64 x) { }
.

Alternati │ │ │ -00172850: 7665 6c79 2c20 6272 6f6b 656e 2070 6970 vely, broken pip │ │ │ -00172860: 6573 2063 616e 2062 6520 6b65 7074 2073 es can be kept s │ │ │ -00172870: 696c 656e 7420 6279 2073 6574 7469 6e67 ilent by setting │ │ │ -00172880: 3a3c 2f70 3e0a 3c64 6976 2063 6c61 7373 :

.
soap.socket_fl │ │ │ -00172930: 6167 733c 2f61 3e20 3d20 4d53 475f 4e4f ags = MSG_NO │ │ │ -00172940: 5349 474e 414c 3b3c 2f64 6976 3e0a 3c64 SIGNAL;
.
soap::soc │ │ │ -001729f0: 6b65 745f 666c 6167 733c 2f61 3e3c 2f64 ket_flags
int socke │ │ │ -00172a20: 745f 666c 6167 733c 2f64 6976 3e3c 6469 t_flags
│ │ │ -00172a40: 5573 6572 2d64 6566 696e 6162 6c65 2073 User-definable s │ │ │ -00172a50: 6f63 6b65 7420 7365 6e64 2061 6e64 2072 ocket send and r │ │ │ -00172a60: 6563 7620 666c 6167 732c 2066 6f72 2065 ecv flags, for e │ │ │ -00172a70: 7861 6d70 6c65 2061 7373 6967 6e20 4d53 xample assign MS │ │ │ -00172a80: 475f 4e4f 5349 474e 414c 2074 6f20 6469 G_NOSIGNAL to di │ │ │ -00172a90: 7361 626c 6520 7369 6770 6970 6520 2874 sable sigpipe (t │ │ │ -00172aa0: 6865 2076 612e 2e2e 3c2f 6469 763e 3c64 he va...
Definition:< │ │ │ -00172ad0: 2f62 3e20 7374 6473 6f61 7032 2e68 3a33 /b> stdsoap2.h:3 │ │ │ -00172ae0: 3335 393c 2f64 6976 3e3c 2f64 6976 3e0a 359
. │ │ │ -00172af0: 3c2f 6469 763e 3c21 2d2d 2066 7261 676d

This s │ │ │ -00172b10: 6574 7469 6e67 2077 696c 6c20 6e6f 7420 etting will not │ │ │ -00172b20: 6765 6e65 7261 7465 2061 2053 4947 5049 generate a SIGPI │ │ │ -00172b30: 5045 2062 7574 2072 6561 642f 7772 6974 PE but read/writ │ │ │ -00172b40: 6520 6f70 6572 6174 696f 6e73 2072 6574 e operations ret │ │ │ -00172b50: 7572 6e20 3c63 6f64 653e 2353 4f41 505f urn #SOAP_ │ │ │ -00172b60: 454f 463c 2f63 6f64 653e 2069 6e73 7465 EOF inste │ │ │ -00172b70: 6164 2e20 4e6f 7465 2074 6861 7420 5769 ad. Note that Wi │ │ │ -00172b80: 6e64 6f77 7320 646f 6573 206e 6f74 2073 ndows does not s │ │ │ -00172b90: 7570 706f 7274 2073 6967 6e61 6c73 2061 upport signals a │ │ │ -00172ba0: 6e64 206c 6163 6b20 7468 6520 3c63 6f64 nd lack the MSG_NOSIGNAL flag.

. │ │ │ -00172bd0: 3c70 3e49 6620 7468 6520 636c 6965 6e74

If the client │ │ │ -00172be0: 2064 6f65 7320 6e6f 7420 636c 6f73 6520 does not close │ │ │ -00172bf0: 7468 6520 636f 6e6e 6563 7469 6f6e 2c20 the connection, │ │ │ -00172c00: 7468 6520 7365 7276 6572 2077 696c 6c20 the server will │ │ │ -00172c10: 7761 6974 2066 6f72 6576 6572 2077 6865 wait forever whe │ │ │ -00172c20: 6e20 6e6f 203c 636f 6465 3e3c 6120 636c n no soap::recv │ │ │ -00172ce0: 5f74 696d 656f 7574 3c2f 613e 3c2f 636f _timeout is specified │ │ │ -00172d00: 2c20 736f 2062 6520 6361 7265 6675 6c20 , so be careful │ │ │ -00172d10: 746f 2073 6574 2074 696d 656f 7574 732c to set timeouts, │ │ │ -00172d20: 2053 6565 2053 6563 7469 6f6e 203c 6120 See Section Timeout man │ │ │ -00172d60: 6167 656d 656e 7420 666f 7220 6e6f 6e2d agement for non- │ │ │ -00172d70: 626c 6f63 6b69 6e67 206f 7065 7261 7469 blocking operati │ │ │ -00172d80: 6f6e 733c 2f61 3e2e 2049 6e20 6164 6469 ons. In addi │ │ │ -00172d90: 7469 6f6e 2c20 6f74 6865 7220 636c 6965 tion, other clie │ │ │ -00172da0: 6e74 7320 7769 6c6c 2062 6520 6465 6e69 nts will be deni │ │ │ -00172db0: 6564 2073 6572 7669 6365 2061 7320 6c6f ed service as lo │ │ │ -00172dc0: 6e67 2061 7320 6120 636c 6965 6e74 206b ng as a client k │ │ │ -00172dd0: 6565 7073 2074 6865 2063 6f6e 6e65 6374 eeps the connect │ │ │ -00172de0: 696f 6e20 746f 2074 6865 2073 6572 7665 ion to the serve │ │ │ -00172df0: 7220 6f70 656e 2e20 546f 2070 7265 7665 r open. To preve │ │ │ -00172e00: 6e74 2074 6869 7320 6672 6f6d 2068 6170 nt this from hap │ │ │ -00172e10: 7065 6e69 6e67 2c20 7468 6520 7365 7276 pening, the serv │ │ │ -00172e20: 6963 6520 7368 6f75 6c64 2062 6520 6d75 ice should be mu │ │ │ -00172e30: 6c74 692d 7468 7265 6164 6564 2073 7563 lti-threaded suc │ │ │ -00172e40: 6820 7468 6174 2065 6163 6820 7468 7265 h that each thre │ │ │ -00172e50: 6164 2068 616e 646c 6573 2074 6865 2063 ad handles the c │ │ │ -00172e60: 6c69 656e 7420 636f 6e6e 6563 7469 6f6e lient connection │ │ │ -00172e70: 3a3c 2f70 3e0a 3c64 6976 2063 6c61 7373 :

.
int main(int arg │ │ │ -00172ef0: 632c 203c 7370 616e 2063 6c61 7373 3d22 c, cha │ │ │ -00172f10: 723c 2f73 7061 6e3e 202a 2a61 7267 7629 r **argv) │ │ │ -00172f20: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
{
.
stru │ │ │ -00172f70: 6374 203c 2f73 7061 6e3e 3c61 2063 6c61 ct soap soap, *tsoa │ │ │ -00172fe0: 703b 203c 2f64 6976 3e0a 3c64 6976 2063 p;
..< │ │ │ -00173070: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -00173080: 3e20 203c 7370 616e 2063 6c61 7373 3d22 > int │ │ │ -001730a0: 3c2f 7370 616e 3e20 6d2c 2073 3b20 3c2f m, s; ..< │ │ │ -00173240: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -00173250: 3e20 203c 6120 636c 6173 733d 2263 6f64 > soap.max_ │ │ │ -001732d0: 6b65 6570 5f61 6c69 7665 3c2f 613e 203d keep_alive = │ │ │ -001732e0: 2031 3030 3b20 3c73 7061 6e20 636c 6173 100; // a │ │ │ -00173300: 7420 6d6f 7374 2031 3030 2063 616c 6c73 t most 100 calls │ │ │ -00173310: 2070 6572 206b 6565 702d 616c 6976 6520 per keep-alive │ │ │ -00173320: 7365 7373 696f 6e20 3c2f 7370 616e 3e3c session < │ │ │ -00173330: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
soap.accept_timeou │ │ │ -001733d0: 743c 2f61 3e20 3d20 3630 303b 203c 7370 t = 600; // optional: │ │ │ -00173400: 6c65 7420 7365 7276 6572 2074 696d 6520 let server time │ │ │ -00173410: 6f75 7420 6166 7465 7220 7465 6e20 6d69 out after ten mi │ │ │ -00173420: 6e75 7465 7320 6f66 2069 6e61 6374 6976 nutes of inactiv │ │ │ -00173430: 6974 7920 3c2f 7370 616e 3e3c 2f64 6976 ity
.
m = soap_b │ │ │ -001734b0: 696e 643c 2f61 3e28 2661 6d70 3b3c 6120 ind(&soap, NU │ │ │ -001734f0: 4c4c 2c20 3138 3030 302c 2042 4143 4b4c LL, 18000, BACKL │ │ │ -00173500: 4f47 293b 203c 7370 616e 2063 6c61 7373 OG); // us │ │ │ -00173520: 6520 706f 7274 2031 3830 3030 206f 6e20 e port 18000 on │ │ │ -00173530: 7468 6520 6375 7272 656e 7420 6d61 6368 the current mach │ │ │ -00173540: 696e 6520 3c2f 7370 616e 3e3c 2f64 6976 ine
..< │ │ │ -00173600: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -00173610: 3e20 207b 3c2f 6469 763e 0a3c 6469 7620 > {
..< │ │ │ -001736e0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -001736f0: 3e20 2020 2065 7869 7428 4558 4954 5f46 > exit(EXIT_F │ │ │ -00173700: 4149 4c55 5245 293b 203c 2f64 6976 3e0a AILURE);
. │ │ │ -00173710: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
}
. │ │ │ -00173740: 2066 7072 696e 7466 2873 7464 6572 722c fprintf(stderr, │ │ │ -00173750: 203c 7370 616e 2063 6c61 7373 3d22 7374 &qu │ │ │ -00173770: 6f74 3b53 6f63 6b65 7420 636f 6e6e 6563 ot;Socket connec │ │ │ -00173780: 7469 6f6e 2073 7563 6365 7373 6675 6c20 tion successful │ │ │ -00173790: 2564 5c6e 2671 756f 743b 3c2f 7370 616e %d\n", m);
. │ │ │ -001737c0: 2020 3c73 7061 6e20 636c 6173 733d 226b for< │ │ │ -001737e0: 2f73 7061 6e3e 2028 3c61 2063 6c61 7373 /span> (count = 0; │ │ │ -00173840: 3c61 2063 6c61 7373 3d22 636f 6465 2220 count >= 0; count++ │ │ │ -001738f0: 2920 3c2f 6469 763e 0a3c 6469 7620 636c )
.
{.
soap.socket_flags │ │ │ -001739b0: 3c2f 613e 203d 204d 5347 5f4e 4f53 4947 = MSG_NOSIG │ │ │ -001739c0: 4e41 4c3b 203c 7370 616e 2063 6c61 7373 NAL; // us │ │ │ -001739e0: 6520 7468 6973 203c 2f73 7061 6e3e 3c2f e this .
soap.accept_flags │ │ │ -00173a90: 3c2f 613e 203d 2053 4f5f 4e4f 5349 4750 = SO_NOSIGP │ │ │ -00173aa0: 4950 453b 203c 7370 616e 2063 6c61 7373 IPE; // or │ │ │ -00173ac0: 2074 6869 7320 746f 2070 7265 7665 6e74 this to prevent │ │ │ -00173ad0: 2053 4947 5049 5045 203c 2f73 7061 6e3e SIGPIPE │ │ │ -00173ae0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
s = │ │ │ -00173b00: 203c 6120 636c 6173 733d 2263 6f64 6522 soap_accept │ │ │ -00173b60: 2826 616d 703b 3c61 2063 6c61 7373 3d22 (&soa │ │ │ -00173b90: 703c 2f61 3e29 3b20 3c2f 6469 763e 0a3c p);
.< │ │ │ -00173ba0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -00173bb0: 3e20 2020 203c 7370 616e 2063 6c61 7373 > i │ │ │ -00173bd0: 663c 2f73 7061 6e3e 2028 3c61 2063 6c61 f (soap │ │ │ -00173c30: 5f76 616c 6964 5f73 6f63 6b65 743c 2f61 _valid_socket(s))
. │ │ │ -00173c60: 2020 207b 3c2f 6469 763e 0a3c 6469 7620 {
.
│ │ │ -00173c80: 2020 2066 7072 696e 7466 2873 7464 6572 fprintf(stder │ │ │ -00173c90: 722c 203c 7370 616e 2063 6c61 7373 3d22 r, & │ │ │ -00173cb0: 7175 6f74 3b41 6363 6570 7420 736f 636b quot;Accept sock │ │ │ -00173cc0: 6574 2025 6420 636f 6e6e 6563 7469 6f6e et %d connection │ │ │ -00173cd0: 2066 726f 6d20 4950 2025 642e 2564 2e25 from IP %d.%d.% │ │ │ -00173ce0: 642e 2564 5c6e 2671 756f 743b 3c2f 7370 d.%d\n", s, (int)(< │ │ │ -00173d20: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -00173d30: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ -00173d40: 6874 6d6c 223e 736f 6170 3c2f 613e 2e3c html">soap.< │ │ │ -00173d50: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -00173d60: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ -00173d70: 6874 6d6c 2361 3435 3635 6130 6164 3465 html#a4565a0ad4e │ │ │ -00173d80: 6130 3861 6461 3732 3131 3535 6465 6438 a08ada721155ded8 │ │ │ -00173d90: 6538 3033 3666 223e 6970 3c2f 613e 2667 e8036f">ip&g │ │ │ -00173da0: 743b 2667 743b 3234 2926 616d 703b 3078 t;>24)&0x │ │ │ -00173db0: 4646 2c20 283c 7370 616e 2063 6c61 7373 FF, (i │ │ │ -00173dd0: 6e74 3c2f 7370 616e 3e29 283c 6120 636c nt)(soap.ip>&g │ │ │ -00173e60: 743b 3136 2926 616d 703b 3078 4646 2c20 t;16)&0xFF, │ │ │ -00173e70: 283c 7370 616e 2063 6c61 7373 3d22 6b65 (int)(so │ │ │ -00173ec0: 6170 3c2f 613e 2e3c 6120 636c 6173 733d ap. │ │ │ -00173f10: 6970 3c2f 613e 2667 743b 2667 743b 3829 ip>>8) │ │ │ -00173f20: 2661 6d70 3b30 7846 462c 2028 3c73 7061 &0xFF, (int │ │ │ -00173f50: 293c 6120 636c 6173 733d 2263 6f64 6522 )soap │ │ │ -00173f80: 2e3c 6120 636c 6173 733d 2263 6f64 6522 .ip │ │ │ -00173fd0: 2661 6d70 3b30 7846 4629 3b20 3c2f 6469 &0xFF); .
tsoap │ │ │ -00174000: 203d 203c 6120 636c 6173 733d 2263 6f64 = soap_cop │ │ │ -00174060: 793c 2f61 3e28 2661 6d70 3b3c 6120 636c y(&soap); .
if │ │ │ -001740e0: 2821 7473 6f61 7029 3c2f 6469 763e 0a3c (!tsoap)
.< │ │ │ -001740f0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -00174100: 3e20 2020 2020 2020 203c 6120 636c 6173 > soap_fo │ │ │ -00174160: 7263 655f 636c 6f73 6573 6f63 6b3c 2f61 rce_closesock(&so │ │ │ -001741a0: 6170 3c2f 613e 293b 3c2f 6469 763e 0a3c ap);
.< │ │ │ -001741b0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -001741c0: 3e20 2020 2020 203c 7370 616e 2063 6c61 > else.
while (THREAD │ │ │ -00174290: 5f43 5245 4154 453c 2f61 3e28 2661 6d70 _CREATE(& │ │ │ -001742a0: 3b74 6964 2c20 283c 7370 616e 2063 6c61 ;tid, (void*(*) │ │ │ -001742d0: 283c 7370 616e 2063 6c61 7373 3d22 6b65 (void< │ │ │ -001742f0: 2f73 7061 6e3e 2a29 2970 726f 6365 7373 /span>*))process │ │ │ -00174300: 5f72 6571 7565 7374 2c20 283c 7370 616e _request, (void │ │ │ -00174330: 2a29 7473 6f61 7029 293c 2f64 6976 3e0a *)tsoap))
. │ │ │ -00174340: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
slee │ │ │ -00174360: 7028 3129 3b20 3c73 7061 6e20 636c 6173 p(1); // f │ │ │ -00174380: 6169 6c65 642c 2074 7279 2061 6761 696e ailed, try again │ │ │ -00174390: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ -001743b0: 2020 2020 7d3c 2f64 6976 3e0a 3c64 6976 }
.
│ │ │ -001743d0: 2020 3c73 7061 6e20 636c 6173 733d 226b else │ │ │ -001743f0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c if (soap.errnum │ │ │ -001744a0: 2920 3c73 7061 6e20 636c 6173 733d 2263 ) // accep │ │ │ -001744c0: 7420 6661 696c 6564 2c20 7472 7920 6167 t failed, try ag │ │ │ -001744d0: 6169 6e20 6166 7465 7220 3120 7365 636f ain after 1 seco │ │ │ -001744e0: 6e64 3c2f 7370 616e 3e3c 2f64 6976 3e0a nd
. │ │ │ -001744f0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
{
. │ │ │ -00174520: 2020 2020 2020 3c61 2063 6c61 7373 3d22 soap_pr │ │ │ -00174580: 696e 745f 6661 756c 743c 2f61 3e28 2661 int_fault(&a │ │ │ -00174590: 6d70 3b3c 6120 636c 6173 733d 2263 6f64 mp;soap, stderr); .
slee │ │ │ -001745f0: 7028 3129 3b3c 2f64 6976 3e0a 3c64 6976 p(1);
.
│ │ │ -00174610: 2020 7d3c 2f64 6976 3e0a 3c64 6976 2063 }
.
│ │ │ -00174630: 3c73 7061 6e20 636c 6173 733d 226b 6579 else
.
│ │ │ -00174670: 2020 7b3c 2f64 6976 3e0a 3c64 6976 2063 {
.
│ │ │ -00174690: 2020 6670 7269 6e74 6628 7374 6465 7272 fprintf(stderr │ │ │ -001746a0: 2c20 3c73 7061 6e20 636c 6173 733d 2273 , &q │ │ │ -001746c0: 756f 743b 5365 7276 6572 2074 696d 6564 uot;Server timed │ │ │ -001746d0: 206f 7574 5c6e 2671 756f 743b 3c2f 7370 out\n");
.
│ │ │ -00174700: 2020 2020 3c73 7061 6e20 636c 6173 733d br │ │ │ -00174720: 6561 6b3c 2f73 7061 6e3e 3b20 3c2f 6469 eak; .
}
.
}
.< │ │ │ -00174770: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -00174780: 3e20 203c 7370 616e 2063 6c61 7373 3d22 > ret │ │ │ -001747a0: 7572 6e3c 2f73 7061 6e3e 2030 3b20 3c2f urn 0; .
}
. │ │ │ -001747d0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
.
void *process_reque │ │ │ -00174830: 7374 283c 7370 616e 2063 6c61 7373 3d22 st(voi │ │ │ -00174850: 643c 2f73 7061 6e3e 202a 7473 6f61 7029 d *tsoap) │ │ │ -00174860: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
{
.
. │ │ │ -00174950: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65 .
((struct soap │ │ │ -00174aa0: 2a29 3c61 2063 6c61 7373 3d22 636f 6465 *)soap)->recv_time │ │ │ -00174ae0: 6f75 7420 3d20 3630 3b20 3c73 7061 6e20 out = 60; │ │ │ -00174b00: 2f2f 2054 696d 656f 7574 2061 6674 6572 // Timeout after │ │ │ -00174b10: 2031 206d 696e 7574 6520 7374 616c 6c20 1 minute stall │ │ │ -00174b20: 6f6e 2072 6563 7620 3c2f 7370 616e 3e3c on recv < │ │ │ -00174b30: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
((struct │ │ │ -00174b70: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap* │ │ │ -00174ba0: 293c 6120 636c 6173 733d 2263 6f64 6522 )soap │ │ │ -00174bd0: 292d 2667 743b 7365 6e64 5f74 696d 656f )->send_timeo │ │ │ -00174be0: 7574 203d 2031 303b 203c 7370 616e 2063 ut = 10; / │ │ │ -00174c00: 2f20 5469 6d65 6f75 7420 6166 7465 7220 / Timeout after │ │ │ -00174c10: 3130 2073 6563 6f6e 6420 7374 616c 6c20 10 second stall │ │ │ -00174c20: 6f6e 2073 656e 6420 3c2f 7370 616e 3e3c on send < │ │ │ -00174c30: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>..
soap_ │ │ │ -00174d50: 6465 7374 726f 793c 2f61 3e28 3c61 2063 destroy(soap); .
so │ │ │ -00174e00: 6170 5f65 6e64 3c2f 613e 283c 6120 636c ap_end(soap); .
soa │ │ │ -00174eb0: 705f 6672 6565 3c2f 613e 283c 6120 636c p_free(soap); .
return │ │ │ -00174f30: 4e55 4c4c 3b20 3c2f 6469 763e 0a3c 6469 NULL;
.} │ │ │ -00174f50: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ -00174fa0: 3c64 6976 2063 6c61 7373 3d22 7474 6e61
│ │ │ -00174ff0: 736f 6170 3a3a 636f 756e 743c 2f61 3e3c soap::count< │ │ │ -00175000: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
ULONG64 │ │ │ -00175020: 2063 6f75 6e74 3c2f 6469 763e 3c64 6976 count
M │ │ │ -00175040: 6573 7361 6765 206c 656e 6774 6820 636f essage length co │ │ │ -00175050: 756e 7465 7220 7661 6c75 6520 6f66 2074 unter value of t │ │ │ -00175060: 6865 206d 6573 7361 6765 2072 6563 6569 he message recei │ │ │ -00175070: 7665 6420 616e 6420 636f 756e 7465 7220 ved and counter │ │ │ -00175080: 7661 6c75 6520 6f66 2074 6865 2048 5454 value of the HTT │ │ │ -00175090: 5020 636f 6e74 656e 7420 6c65 6e67 7468 P content length │ │ │ -001750a0: 2068 6561 2e2e 2e3c 2f64 6976 3e3c 6469 hea...
│ │ │ -001750c0: 3c62 3e44 6566 696e 6974 696f 6e3a 3c2f Definition: stdsoap2.h:42 │ │ │ -001750e0: 3034 3c2f 6469 763e 3c2f 6469 763e 0a3c 04
.< │ │ │ -001750f0: 6469 7620 636c 6173 733d 2274 7463 2220 div class="ttc" │ │ │ -00175100: 6964 3d22 6173 7472 7563 7473 6f61 705f id="astructsoap_ │ │ │ -00175110: 6874 6d6c 5f61 6439 3866 3132 6636 3032 html_ad98f12f602 │ │ │ -00175120: 6566 6464 6530 3439 6462 6433 3637 6134 efdde049dbd367a4 │ │ │ -00175130: 3365 3763 6230 223e 3c64 6976 2063 6c61 3e7cb0">
soap::ac │ │ │ -00175190: 6365 7074 5f66 6c61 6773 3c2f 613e 3c2f cept_flags
int acce │ │ │ -001751c0: 7074 5f66 6c61 6773 3c2f 6469 763e 3c64 pt_flags
User-definable │ │ │ -001751f0: 7365 7473 6f63 6b6f 7074 206c 6576 656c setsockopt level │ │ │ -00175200: 2053 4f4c 5f53 4f43 4b45 5420 666c 6167 SOL_SOCKET flag │ │ │ -00175210: 7320 2830 2062 7920 6465 6661 756c 7429 s (0 by default) │ │ │ -00175220: 2c20 7768 656e 206e 6f6e 7a65 726f 2073 , when nonzero s │ │ │ -00175230: 6574 7320 7468 6520 736f 6170 3a3a 736f ets the soap::so │ │ │ -00175240: 636b 6574 2066 2e2e 2e3c 2f64 6976 3e3c cket f...
< │ │ │ -00175250: 6469 7620 636c 6173 733d 2274 7464 6566 div class="ttdef │ │ │ -00175260: 223e 3c62 3e44 6566 696e 6974 696f 6e3a ">Definition: │ │ │ -00175270: 3c2f 623e 2073 7464 736f 6170 322e 683a stdsoap2.h: │ │ │ -00175280: 3334 3533 3c2f 6469 763e 3c2f 6469 763e 3453
│ │ │ -00175290: 0a3c 2f64 6976 3e3c 212d 2d20 6672 6167 .

A cli │ │ │ -001752b0: 656e 7420 6361 6c6c 2077 696c 6c20 6175 ent call will au │ │ │ -001752c0: 746f 6d61 7469 6361 6c6c 7920 6174 7465 tomatically atte │ │ │ -001752d0: 6d70 7420 746f 2072 652d 6573 7461 626c mpt to re-establ │ │ │ -001752e0: 6973 6820 6120 636f 6e6e 6563 7469 6f6e ish a connection │ │ │ -001752f0: 2074 6f20 6120 7365 7276 6572 2077 6865 to a server whe │ │ │ -00175300: 6e20 7468 6520 7365 7276 6572 2068 6173 n the server has │ │ │ -00175310: 2074 6572 6d69 6e61 7465 6420 7468 6520 terminated the │ │ │ -00175320: 636f 6e6e 6563 7469 6f6e 2066 6f72 2061 connection for a │ │ │ -00175330: 6e79 2072 6561 736f 6e2e 2054 6869 7320 ny reason. This │ │ │ -00175340: 7761 792c 2061 2073 6571 7565 6e63 6520 way, a sequence │ │ │ -00175350: 6f66 2063 616c 6c73 2063 616e 2062 6520 of calls can be │ │ │ -00175360: 6d61 6465 2074 6f20 7468 6520 7365 7276 made to the serv │ │ │ -00175370: 6572 2077 6869 6c65 206b 6565 7069 6e67 er while keeping │ │ │ -00175380: 2074 6865 2063 6f6e 6e65 6374 696f 6e20 the connection │ │ │ -00175390: 6f70 656e 2e20 436c 6965 6e74 2073 7475 open. Client stu │ │ │ -001753a0: 6220 6675 6e63 7469 6f6e 7320 706f 6c6c b functions poll │ │ │ -001753b0: 2074 6865 2073 6572 7665 7220 746f 2063 the server to c │ │ │ -001753c0: 6865 636b 2069 6620 7468 6520 636f 6e6e heck if the conn │ │ │ -001753d0: 6563 7469 6f6e 2069 7320 7374 696c 6c20 ection is still │ │ │ -001753e0: 6f70 656e 2e20 5768 656e 2074 6865 2063 open. When the c │ │ │ -001753f0: 6f6e 6e65 6374 696f 6e20 7761 7320 7465 onnection was te │ │ │ -00175400: 726d 696e 6174 6564 2062 7920 7468 6520 rminated by the │ │ │ -00175410: 7365 7276 6572 2c20 7468 6520 636c 6965 server, the clie │ │ │ -00175420: 6e74 2077 696c 6c20 6175 746f 6d61 7469 nt will automati │ │ │ -00175430: 6361 6c6c 7920 7265 636f 6e6e 6563 742e cally reconnect. │ │ │ -00175440: 203c 6272 2020 2f3e 0a3c 2f70 3e0a 3c70
.

.

A client may cl │ │ │ -00175460: 6561 7220 7468 6520 3c63 6f64 653e 2353 ear the #S │ │ │ -00175470: 4f41 505f 494f 5f4b 4545 5041 4c49 5645 OAP_IO_KEEPALIVE │ │ │ -00175480: 3c2f 636f 6465 3e20 666c 6167 206a 7573 flag jus │ │ │ -00175490: 7420 6265 666f 7265 2074 6865 206c 6173 t before the las │ │ │ -001754a0: 7420 6361 6c6c 2074 6f20 6120 7365 7276 t call to a serv │ │ │ -001754b0: 6572 2074 6f20 6c65 7420 7468 6520 7365 er to let the se │ │ │ -001754c0: 7276 6572 206b 6e6f 7720 6974 2077 616e rver know it wan │ │ │ -001754d0: 7473 2074 6f20 636c 6f73 6520 7468 6520 ts to close the │ │ │ -001754e0: 636f 6e6e 6563 7469 6f6e 2061 6674 6572 connection after │ │ │ -001754f0: 2074 6869 7320 6c61 7374 2063 616c 6c2e this last call. │ │ │ -00175500: 2054 6869 7320 7769 6c6c 2063 6c6f 7365 This will close │ │ │ -00175510: 2074 6865 2073 6f63 6b65 7420 6166 7465 the socket afte │ │ │ -00175520: 7220 7468 6520 6361 6c6c 2061 6e64 2061 r the call and a │ │ │ -00175530: 6c73 6f20 696e 666f 726d 7320 7468 6520 lso informs the │ │ │ -00175540: 7365 7276 6572 2074 6f20 6772 6163 6566 server to gracef │ │ │ -00175550: 756c 6c79 2063 6c6f 7365 2074 6865 2063 ully close the c │ │ │ -00175560: 6f6e 6e65 6374 696f 6e2e 3c2f 703e 0a3c onnection.

.< │ │ │ -00175570: 703e 5468 6520 636c 6965 6e74 2d73 6964 p>The client-sid │ │ │ -00175580: 6520 6361 6e20 616c 736f 2073 6574 2074 e can also set t │ │ │ -00175590: 6865 2054 4350 206b 6565 702d 616c 6976 he TCP keep-aliv │ │ │ -001755a0: 6520 736f 636b 6574 2070 726f 7065 7274 e socket propert │ │ │ -001755b0: 6965 732c 2075 7369 6e67 2074 6865 203c ies, using the < │ │ │ -001755c0: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soa │ │ │ -00175680: 703a 3a74 6370 5f6b 6565 705f 616c 6976 p::tcp_keep_aliv │ │ │ -00175690: 653c 2f61 3e3c 2f63 6f64 653e 2066 6c61 e
fla │ │ │ -001756a0: 6720 2873 6574 2074 6f20 3120 746f 2065 g (set to 1 to e │ │ │ -001756b0: 6e61 626c 6529 2c20 3c63 6f64 653e 3c61 nable), soa │ │ │ -00175760: 703a 3a74 6370 5f6b 6565 705f 6964 6c65 p::tcp_keep_idle │ │ │ -00175770: 3c2f 613e 3c2f 636f 6465 3e20 746f 2073 to s │ │ │ -00175780: 6574 2074 6865 203c 636f 6465 3e54 4350 et the TCP │ │ │ -00175790: 5f4b 4545 5049 444c 453c 2f63 6f64 653e _KEEPIDLE │ │ │ -001757a0: 2076 616c 7565 2c20 3c63 6f64 653e 3c61 value, so │ │ │ -00175850: 6170 3a3a 7463 705f 6b65 6570 5f69 6e74 ap::tcp_keep_int │ │ │ -00175860: 766c 3c2f 613e 3c2f 636f 6465 3e20 746f vl to │ │ │ -00175870: 2073 6574 2074 6865 203c 636f 6465 3e54 set the T │ │ │ -00175880: 4350 5f4b 4545 5049 4e54 564c 3c2f 636f CP_KEEPINTVL value, and < │ │ │ -001758a0: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soap::tcp_kee │ │ │ -00175950: 705f 636e 743c 2f61 3e3c 2f63 6f64 653e p_cnt │ │ │ -00175960: 2074 6f20 7365 7420 7468 6520 3c63 6f64 to set the TCP_KEEPCNT value.

. │ │ │ -00175990: 3c70 3e49 6620 6120 636c 6965 6e74 2069

If a client i │ │ │ -001759a0: 7320 696e 2074 6865 206d 6964 646c 6520 s in the middle │ │ │ -001759b0: 6f66 2073 6f61 7020 6361 6c6c 2074 6861 of soap call tha │ │ │ -001759c0: 7420 6d69 6768 7420 7461 6b65 2061 206c t might take a l │ │ │ -001759d0: 6f6e 6720 7469 6d65 2061 6e64 2074 6865 ong time and the │ │ │ -001759e0: 2073 6572 7665 7220 676f 6573 2061 7761 server goes awa │ │ │ -001759f0: 792f 646f 776e 2074 6865 2063 616c 6c65 y/down the calle │ │ │ -00175a00: 7220 646f 6573 206e 6f74 2067 6574 2061 r does not get a │ │ │ -00175a10: 6e79 2066 6565 6462 6163 6b20 756e 7469 ny feedback unti │ │ │ -00175a20: 6c20 7468 6520 3c63 6f64 653e 3c61 2063 l the soap::rec │ │ │ -00175ae0: 765f 7469 6d65 6f75 743c 2f61 3e3c 2f63 v_timeout is reached. │ │ │ -00175b00: 2045 6e61 626c 696e 6720 5443 5020 6b65 Enabling TCP ke │ │ │ -00175b10: 6570 2061 6c69 7665 206f 6e20 7379 7374 ep alive on syst │ │ │ -00175b20: 656d 7320 7468 6174 2073 7570 706f 7274 ems that support │ │ │ -00175b30: 2069 7420 616c 6c6f 7773 2066 6f72 2061 it allows for a │ │ │ -00175b40: 2066 6173 7465 7220 636f 6e6e 6563 7469 faster connecti │ │ │ -00175b50: 6f6e 2074 6561 7264 6f77 6e20 6465 7465 on teardown dete │ │ │ -00175b60: 6374 696f 6e20 666f 7220 6170 706c 6963 ction for applic │ │ │ -00175b70: 6174 696f 6e73 2074 6861 7420 6e65 6564 ations that need │ │ │ -00175b80: 2069 742e 3c2f 703e 0a3c 703e f09f 949d it.

.

.... │ │ │ -00175b90: 203c 6120 6872 6566 3d22 2322 3e42 6163 Bac │ │ │ -00175ba0: 6b20 746f 2074 6162 6c65 206f 6620 636f k to table of co │ │ │ -00175bb0: 6e74 656e 7473 3c2f 613e 3c2f 703e 0a3c ntents

.< │ │ │ -00175bc0: 6832 3e3c 6120 636c 6173 733d 2261 6e63 h2>.HTTP chun │ │ │ -00175bf0: 6b65 6420 7472 616e 7366 6572 2065 6e63 ked transfer enc │ │ │ -00175c00: 6f64 696e 673c 2f68 323e 0a3c 703e 4f75 oding

.

Ou │ │ │ -00175c10: 7462 6f75 6e64 2048 5454 5020 6d65 7373 tbound HTTP mess │ │ │ -00175c20: 6167 6573 2061 7265 206e 6f74 2063 6875 ages are not chu │ │ │ -00175c30: 6e6b 6564 2075 6e6c 6573 7320 7468 6520 nked unless the │ │ │ -00175c40: 3c63 6f64 653e 2353 4f41 505f 494f 5f43 #SOAP_IO_C │ │ │ -00175c50: 4855 4e4b 3c2f 636f 6465 3e20 666c 6167 HUNK flag │ │ │ -00175c60: 2069 7320 656e 6162 6c65 642e 2043 6875 is enabled. Chu │ │ │ -00175c70: 6e6b 696e 6720 6d61 7920 696d 7072 6f76 nking may improv │ │ │ -00175c80: 6520 7468 6520 7370 6565 6420 6f66 206d e the speed of m │ │ │ -00175c90: 6573 7361 6765 2073 656e 6469 6e67 2077 essage sending w │ │ │ -00175ca0: 6974 6820 4854 5450 2c20 6265 6361 7573 ith HTTP, becaus │ │ │ -00175cb0: 6520 7468 6520 6d65 7373 6167 6520 6c65 e the message le │ │ │ -00175cc0: 6e67 7468 2064 6f65 7320 6e6f 7420 6e65 ngth does not ne │ │ │ -00175cd0: 6564 2074 6f20 6265 2064 6574 6572 6d69 ed to be determi │ │ │ -00175ce0: 6e65 6420 696e 2061 6476 616e 6365 2066 ned in advance f │ │ │ -00175cf0: 6f72 2074 6865 2048 5454 5020 636f 6e74 or the HTTP cont │ │ │ -00175d00: 656e 7420 6c65 6e67 7468 2068 6561 6465 ent length heade │ │ │ -00175d10: 722e 3c2f 703e 0a3c 703e f09f 949d 203c r.

.

.... < │ │ │ -00175d20: 6120 6872 6566 3d22 2322 3e42 6163 6b20 a href="#">Back │ │ │ -00175d30: 746f 2074 6162 6c65 206f 6620 636f 6e74 to table of cont │ │ │ -00175d40: 656e 7473 3c2f 613e 3c2f 703e 0a3c 6832 ents

.

.HTTP buffe │ │ │ -00175d80: 7265 6420 7365 6e64 733c 2f68 323e 0a3c red sends

.< │ │ │ -00175d90: 703e 5468 6520 656e 7469 7265 206f 7574 p>The entire out │ │ │ -00175da0: 626f 756e 6420 6d65 7373 6167 6520 6361 bound message ca │ │ │ -00175db0: 6e20 6265 2073 746f 7265 6420 696e 2061 n be stored in a │ │ │ -00175dc0: 2062 7566 6665 7220 746f 2064 6574 6572 buffer to deter │ │ │ -00175dd0: 6d69 6e65 2074 6865 2048 5454 5020 636f mine the HTTP co │ │ │ -00175de0: 6e74 656e 7420 6c65 6e67 7468 2072 6174 ntent length rat │ │ │ -00175df0: 6865 7220 7468 616e 2074 6865 2074 776f her than the two │ │ │ -00175e00: 2d70 6861 7365 2065 6e63 6f64 696e 6720 -phase encoding │ │ │ -00175e10: 7573 6564 2062 7920 6753 4f41 5020 636c used by gSOAP cl │ │ │ -00175e20: 6965 6e74 2d73 6964 6520 7374 7562 2066 ient-side stub f │ │ │ -00175e30: 756e 6374 696f 6e73 2061 6e64 2073 6572 unctions and ser │ │ │ -00175e40: 7665 722d 7369 6465 2073 6b65 6c65 746f ver-side skeleto │ │ │ -00175e50: 6e20 6675 6e63 7469 6f6e 7320 6765 6e65 n functions gene │ │ │ -00175e60: 7261 7465 6420 6279 2073 6f61 7063 7070 rated by soapcpp │ │ │ -00175e70: 322c 2077 6869 6368 2070 6572 666f 726d 2, which perform │ │ │ -00175e80: 2061 2073 6570 6172 6174 6520 7061 7373 a separate pass │ │ │ -00175e90: 206f 7665 7220 7468 6520 6461 7461 2074 over the data t │ │ │ -00175ea0: 6f20 6465 7465 726d 696e 6520 7468 6520 o determine the │ │ │ -00175eb0: 6c65 6e67 7468 206f 6620 7468 6520 6f75 length of the ou │ │ │ -00175ec0: 7462 6f75 6e64 206d 6573 7361 6765 2e20 tbound message. │ │ │ -00175ed0: 5365 7474 696e 6720 7468 6520 666c 6167 Setting the flag │ │ │ -00175ee0: 203c 636f 6465 3e23 534f 4150 5f49 4f5f #SOAP_IO_ │ │ │ -00175ef0: 5354 4f52 453c 2f63 6f64 653e 2066 6f72 STORE for │ │ │ -00175f00: 2074 6865 206f 7574 7075 7420 6d6f 6465 the output mode │ │ │ -00175f10: 2077 696c 6c20 6275 6666 6572 2074 6865 will buffer the │ │ │ -00175f20: 2065 6e74 6972 6520 6d65 7373 6167 652e entire message. │ │ │ -00175f30: 2054 6869 7320 6d61 7920 6f72 206d 6179 This may or may │ │ │ -00175f40: 206e 6f74 2073 7065 6564 2075 7020 7468 not speed up th │ │ │ -00175f50: 6520 7472 616e 736d 6973 7369 6f6e 206f e transmission o │ │ │ -00175f60: 6620 6d65 7373 6167 6573 2c20 6465 7065 f messages, depe │ │ │ -00175f70: 6e64 696e 6720 6f6e 2074 6865 2063 6f6e nding on the con │ │ │ -00175f80: 7465 6e74 2c20 6275 7420 6d61 7920 7265 tent, but may re │ │ │ -00175f90: 7175 6972 6520 7369 676e 6966 6963 616e quire significan │ │ │ -00175fa0: 7420 7374 6f72 6167 6520 7370 6163 6520 t storage space │ │ │ -00175fb0: 746f 2068 6f6c 6420 6c61 7267 6520 6d65 to hold large me │ │ │ -00175fc0: 7373 6167 6573 2074 656d 706f 7261 7269 ssages temporari │ │ │ -00175fd0: 6c79 2e3c 2f70 3e0a 3c70 3ef0 9f94 9d20 ly.

.

.... │ │ │ -00175fe0: 3c61 2068 7265 663d 2223 223e 4261 636b Back │ │ │ -00175ff0: 2074 6f20 7461 626c 6520 6f66 2063 6f6e to table of con │ │ │ -00176000: 7465 6e74 733c 2f61 3e3c 2f70 3e0a 3c68 tents

..HTT │ │ │ -00176040: 5020 6175 7468 656e 7469 6361 7469 6f6e P authentication │ │ │ -00176050: 3c2f 6832 3e0a 3c70 3e54 6865 2066 6f6c .

The fol │ │ │ -00176060: 6c6f 7769 6e67 2073 6563 7469 6f6e 7320 lowing sections │ │ │ -00176070: 6578 706c 6169 6e20 686f 7720 746f 2061 explain how to a │ │ │ -00176080: 7574 6865 6e74 6963 6174 6520 7769 7468 uthenticate with │ │ │ -00176090: 2048 5454 5020 6265 6172 6572 2c20 6261 HTTP bearer, ba │ │ │ -001760a0: 7369 632c 2064 6967 6573 742c 2061 6e64 sic, digest, and │ │ │ -001760b0: 204e 544c 4d2e 2050 726f 7879 2061 7574 NTLM. Proxy aut │ │ │ -001760c0: 6865 6e74 6963 6174 696f 6e20 6973 2061 hentication is a │ │ │ -001760d0: 6c73 6f20 636f 7665 7265 642e 3c2f 703e lso covered.

│ │ │ -001760e0: 0a3c 703e 596f 7520 636f 756c 6420 616c .

You could al │ │ │ -001760f0: 736f 2075 7365 2074 6865 2057 696e 496e so use the WinIn │ │ │ -00176100: 6574 2070 6c75 6769 6e20 6176 6169 6c61 et plugin availa │ │ │ -00176110: 626c 6520 696e 2074 6865 203c 656d 3e3c ble in the < │ │ │ -00176120: 636f 6465 3e67 736f 6170 2f6d 6f64 5f67 code>gsoap/mod_g │ │ │ -00176130: 736f 6170 3c2f 636f 6465 3e3c 2f65 6d3e soap │ │ │ -00176140: 2064 6972 6563 746f 7279 206f 6620 7468 directory of th │ │ │ -00176150: 6520 6753 4f41 5020 736f 7572 6365 2063 e gSOAP source c │ │ │ -00176160: 6f64 6520 7061 636b 6167 6520 746f 2073 ode package to s │ │ │ -00176170: 696d 706c 6966 7920 496e 7465 726e 6574 implify Internet │ │ │ -00176180: 2061 6363 6573 7320 666f 7220 6753 4f41 access for gSOA │ │ │ -00176190: 5020 636c 6965 6e74 2061 7070 6c69 6361 P client applica │ │ │ -001761a0: 7469 6f6e 7320 616e 6420 6465 616c 2077 tions and deal w │ │ │ -001761b0: 6974 6820 656e 6372 7970 7469 6f6e 2c20 ith encryption, │ │ │ -001761c0: 7072 6f78 6965 732c 2061 6e64 2061 7574 proxies, and aut │ │ │ -001761d0: 6865 6e74 6963 6174 696f 6e2c 2073 6565 hentication, see │ │ │ -001761e0: 2074 6865 2067 534f 4150 203c 6120 6872 the gSOAP WinInet plugi │ │ │ -00176220: 6e3c 2f61 3e20 646f 6375 6d65 6e74 6174 n documentat │ │ │ -00176230: 696f 6e2e 3c2f 703e 0a3c 703e 5468 6520 ion.

.

The │ │ │ -00176240: 6753 4f41 5020 4355 524c 2070 6c75 6769 gSOAP CURL plugi │ │ │ -00176250: 6e20 6361 6e20 616c 736f 2062 6520 7573 n can also be us │ │ │ -00176260: 6564 2074 6f20 6465 7665 6c6f 7020 6753 ed to develop gS │ │ │ -00176270: 4f41 5020 636c 6965 6e74 2061 7070 6c69 OAP client appli │ │ │ -00176280: 6361 7469 6f6e 7320 616e 6420 4355 524c cations and CURL │ │ │ -00176290: 2069 6d70 6c65 6d65 6e74 7320 7661 7269 implements vari │ │ │ -001762a0: 6f75 7320 4854 5450 2061 7574 6865 6e74 ous HTTP authent │ │ │ -001762b0: 6963 6174 696f 6e20 6d65 7468 6f64 732c ication methods, │ │ │ -001762c0: 2073 6565 2074 6865 2067 534f 4150 203c see the gSOAP < │ │ │ -001762d0: 6120 6872 6566 3d22 2e2e 2f2e 2e2f 6375 a href="../../cu │ │ │ -001762e0: 726c 2f68 746d 6c2f 696e 6465 782e 6874 rl/html/index.ht │ │ │ -001762f0: 6d6c 223e 4355 524c 2070 6c75 6769 6e3c ml">CURL plugin< │ │ │ -00176300: 2f61 3e20 646f 6375 6d65 6e74 6174 696f /a> documentatio │ │ │ -00176310: 6e2e 3c2f 703e 0a3c 703e f09f 949d 203c n.

.

.... < │ │ │ -00176320: 6120 6872 6566 3d22 2322 3e42 6163 6b20 a href="#">Back │ │ │ -00176330: 746f 2074 6162 6c65 206f 6620 636f 6e74 to table of cont │ │ │ -00176340: 656e 7473 3c2f 613e 3c2f 703e 0a3c 6833 ents

.

.HTTP bearer au │ │ │ -00176390: 7468 656e 7469 6361 7469 6f6e 3c2f 6833 thentication

.

HTTP bearer │ │ │ -001763b0: 2061 7574 6865 6e74 6963 6174 696f 6e20 authentication │ │ │ -001763c0: 6973 2065 6e61 626c 6564 2061 7420 7468 is enabled at th │ │ │ -001763d0: 6520 636c 6965 6e74 2d73 6964 6520 6279 e client-side by │ │ │ -001763e0: 2073 6574 7469 6e67 2074 6865 203c 636f setting the soap: │ │ │ -001764b0: 3a62 6561 7265 723c 2f61 3e3c 2f63 6f64 :bearer string to the │ │ │ -001764d0: 2062 6561 7265 7220 746f 6b65 6e3a 3c2f bearer token:.

struct < │ │ │ -00176530: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -00176540: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ -00176550: 6874 6d6c 223e 736f 6170 3c2f 613e 202a html">soap * │ │ │ -00176560: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap │ │ │ -00176590: 3d20 3c61 2063 6c61 7373 3d22 636f 6465 = soap_new< │ │ │ -001765f0: 2f61 3e28 293b 203c 2f64 6976 3e0a 3c64 /a>();
. │ │ │ -00176610: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap- │ │ │ -00176640: 2667 743b 3c61 2063 6c61 7373 3d22 636f >bea │ │ │ -00176690: 7265 723c 2f61 3e20 3d20 3c73 7061 6e20 rer = "...& │ │ │ -001766c0: 7175 6f74 3b3c 2f73 7061 6e3e 3b20 3c2f quot;; .
if (soap │ │ │ -00176710: 5f63 616c 6c5f 6e73 5f5f 7765 626d 6574 _call_ns__webmet │ │ │ -00176720: 686f 6428 3c61 2063 6c61 7373 3d22 636f hod(soap< │ │ │ -00176750: 2f61 3e2c 202e 2e2e 2929 3c2f 6469 763e /a>, ...))
│ │ │ -00176760: 0a3c 6469 7620 636c 6173 733d 226c 696e .
... / │ │ │ -00176790: 2f20 6572 726f 723c 2f73 7061 6e3e 3c2f / error.
else.
... // OK.
soa │ │ │ -001768c0: 703a 3a62 6561 7265 723c 2f61 3e3c 2f64 p::bearer
const cha │ │ │ -001768f0: 7220 2a20 6265 6172 6572 3c2f 6469 763e r * bearer
│ │ │ -00176900: 3c64 6976 2063 6c61 7373 3d22 7474 646f
User-definabl │ │ │ -00176920: 6520 4854 5450 2061 7574 686f 7269 7a61 e HTTP authoriza │ │ │ -00176930: 7469 6f6e 2062 6561 7265 7220 746f 6b65 tion bearer toke │ │ │ -00176940: 6e20 7661 6c75 6520 746f 2062 6520 7365 n value to be se │ │ │ -00176950: 6e74 2062 7920 7468 6520 636c 6965 6e74 nt by the client │ │ │ -00176960: 2c20 7365 7276 6572 2073 6964 6520 7265 , server side re │ │ │ -00176970: 6365 6976 6573 2074 2e2e 2e3c 2f64 6976 ceives t...
Definitio │ │ │ -001769a0: 6e3a 3c2f 623e 2073 7464 736f 6170 322e n: stdsoap2. │ │ │ -001769b0: 683a 3337 3532 3c2f 6469 763e 3c2f 6469 h:3752
.

... │ │ │ -001769e0: 9d20 3c61 2068 7265 663d 2223 223e 4261 . Ba │ │ │ -001769f0: 636b 2074 6f20 7461 626c 6520 6f66 2063 ck to table of c │ │ │ -00176a00: 6f6e 7465 6e74 733c 2f61 3e3c 2f70 3e0a ontents

. │ │ │ -00176a10: 3c68 333e 3c61 2063 6c61 7373 3d22 616e

< │ │ │ -00176a40: 2f61 3e0a 4854 5450 2062 6173 6963 2061 /a>.HTTP basic a │ │ │ -00176a50: 7574 6865 6e74 6963 6174 696f 6e3c 2f68 uthentication.

HTTP basic │ │ │ -00176a70: 2061 7574 6865 6e74 6963 6174 696f 6e20 authentication │ │ │ -00176a80: 6973 2065 6e61 626c 6564 2061 7420 7468 is enabled at th │ │ │ -00176a90: 6520 636c 6965 6e74 2d73 6964 6520 6279 e client-side by │ │ │ -00176aa0: 2073 6574 7469 6e67 2074 6865 203c 636f setting the const char* < │ │ │ -00176ac0: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ -00176ad0: 663d 2273 7472 7563 7473 6f61 702e 6874 f="structsoap.ht │ │ │ -00176ae0: 6d6c 2361 3265 6465 3032 3039 3564 3938 ml#a2ede02095d98 │ │ │ -00176af0: 3934 3266 3463 3232 3066 6431 3762 3439 942f4c220fd17b49 │ │ │ -00176b00: 3537 3033 2220 7469 746c 653d 2255 7365 5703" title="Use │ │ │ -00176b10: 722d 6465 6669 6e61 626c 6520 4854 5450 r-definable HTTP │ │ │ -00176b20: 2061 6e64 204e 544c 4d20 6175 7468 6f72 and NTLM author │ │ │ -00176b30: 697a 6174 696f 6e20 7573 6572 2069 6420 ization user id │ │ │ -00176b40: 7374 7269 6e67 2066 6f72 2048 5454 5020 string for HTTP │ │ │ -00176b50: 6261 7369 6320 616e 6420 4e54 4c4d 2061 basic and NTLM a │ │ │ -00176b60: 7574 6865 6e74 6963 6174 696f 6e20 6279 uthentication by │ │ │ -00176b70: 2074 2e2e 2e22 3e73 6f61 703a 3a75 7365 t...">soap::use │ │ │ -00176b80: 7269 643c 2f61 3e3c 2f63 6f64 653e 2061 rid a │ │ │ -00176b90: 6e64 203c 636f 6465 3e63 6f6e 7374 2063 nd const c │ │ │ -00176ba0: 6861 722a 203c 6120 636c 6173 733d 2265 har* soa │ │ │ -00176c60: 703a 3a70 6173 7377 643c 2f61 3e3c 2f63 p::passwd strings to │ │ │ -00176c80: 6120 7573 6572 6e61 6d65 2061 6e64 2070 a username and p │ │ │ -00176c90: 6173 7377 6f72 642c 2072 6573 7065 6374 assword, respect │ │ │ -00176ca0: 6976 656c 792e 2041 2073 6572 7665 7220 ively. A server │ │ │ -00176cb0: 6d61 7920 7265 7175 6573 7420 7573 6572 may request user │ │ │ -00176cc0: 2061 7574 6865 6e74 6963 6174 696f 6e20 authentication │ │ │ -00176cd0: 616e 6420 6465 6e69 6573 2061 6363 6573 and denies acces │ │ │ -00176ce0: 7320 2848 5454 5020 3430 3120 6572 726f s (HTTP 401 erro │ │ │ -00176cf0: 7229 2077 6865 6e20 7468 6520 636c 6965 r) when the clie │ │ │ -00176d00: 6e74 2074 7269 6573 2074 6f20 636f 6e6e nt tries to conn │ │ │ -00176d10: 6563 7420 7769 7468 6f75 7420 4854 5450 ect without HTTP │ │ │ -00176d20: 2061 7574 6865 6e74 6963 6174 696f 6e20 authentication │ │ │ -00176d30: 286f 7220 7769 7468 2074 6865 2077 726f (or with the wro │ │ │ -00176d40: 6e67 2061 7574 6865 6e74 6963 6174 696f ng authenticatio │ │ │ -00176d50: 6e20 696e 666f 726d 6174 696f 6e29 2e3c n information).< │ │ │ -00176d60: 2f70 3e0a 3c70 3e42 6173 6963 2061 7574 /p>.

Basic aut │ │ │ -00176d70: 6865 6e74 6963 6174 696f 6e20 7368 6f75 hentication shou │ │ │ -00176d80: 6c64 206f 6e6c 7920 6265 2075 7365 6420 ld only be used │ │ │ -00176d90: 6f76 6572 2048 5454 5053 2c20 6265 6361 over HTTPS, beca │ │ │ -00176da0: 7573 6520 7468 6520 6372 6564 656e 7469 use the credenti │ │ │ -00176db0: 616c 7320 6172 6520 7365 6e74 2069 6e20 als are sent in │ │ │ -00176dc0: 7468 6520 636c 6561 7220 7769 7468 2048 the clear with H │ │ │ -00176dd0: 5454 502e 2053 6565 2053 6563 7469 6f6e TTP. See Section │ │ │ -00176de0: 203c 6120 636c 6173 733d 2265 6c22 2068 Th │ │ │ -00176e10: 6520 4854 5450 2064 6967 6573 7420 6175 e HTTP digest au │ │ │ -00176e20: 7468 656e 7469 6361 7469 6f6e 2070 6c75 thentication plu │ │ │ -00176e30: 6769 6e3c 2f61 3e20 746f 2075 7365 2074 gin to use t │ │ │ -00176e40: 6865 2048 5454 5020 6469 6765 7374 2070 he HTTP digest p │ │ │ -00176e50: 6c75 6769 6e20 7468 6174 2069 7320 7361 lugin that is sa │ │ │ -00176e60: 6665 2066 6f72 2061 7574 6865 6e74 6963 fe for authentic │ │ │ -00176e70: 6174 696f 6e20 6f76 6572 2048 5454 502e ation over HTTP. │ │ │ -00176e80: 3c2f 703e 0a3c 703e 4865 7265 2069 7320

.

Here is │ │ │ -00176e90: 616e 2065 7861 6d70 6c65 2063 6c69 656e an example clien │ │ │ -00176ea0: 7420 636f 6465 2066 7261 676d 656e 7420 t code fragment │ │ │ -00176eb0: 746f 2073 6574 2074 6865 2048 5454 5020 to set the HTTP │ │ │ -00176ec0: 6175 7468 656e 7469 6361 7469 6f6e 2075 authentication u │ │ │ -00176ed0: 7365 726e 616d 6520 616e 6420 7061 7373 sername and pass │ │ │ -00176ee0: 776f 7264 3a3c 2f70 3e0a 3c64 6976 2063 word:

.
│ │ │ -00176f00: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
struct < │ │ │ -00176f30: 2f73 7061 6e3e 3c61 2063 6c61 7373 3d22 /span>soa │ │ │ -00176f60: 703c 2f61 3e20 2a3c 6120 636c 6173 733d p *so │ │ │ -00176f90: 6170 3c2f 613e 203d 203c 6120 636c 6173 ap = so │ │ │ -00176ff0: 6170 5f6e 6577 3c2f 613e 2829 3b20 3c2f ap_new(); .
so │ │ │ -00177040: 6170 3c2f 613e 2d26 6774 3b3c 6120 636c ap->userid = │ │ │ -001770a0: 203c 7370 616e 2063 6c61 7373 3d22 7374 &qu │ │ │ -001770c0: 6f74 3b67 7565 7374 2671 756f 743b 3c2f ot;guest";
. │ │ │ -001770f0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap- │ │ │ -00177120: 2667 743b 3c61 2063 6c61 7373 3d22 636f >pas │ │ │ -00177170: 7377 643c 2f61 3e20 3d20 3c73 7061 6e20 swd = "visi │ │ │ -001771a0: 7426 7175 6f74 3b3c 2f73 7061 6e3e 3b20 t"; │ │ │ -001771b0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
if (so │ │ │ -001771f0: 6170 5f63 616c 6c5f 6e73 5f5f 7765 626d ap_call_ns__webm │ │ │ -00177200: 6574 686f 6428 3c61 2063 6c61 7373 3d22 ethod(soa │ │ │ -00177230: 703c 2f61 3e2c 202e 2e2e 2929 3c2f 6469 p, ...)).
... // error │ │ │ -00177280: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
else.
... // success
.
co │ │ │ -001773d0: 6e73 7420 6368 6172 202a 2070 6173 7377 nst char * passw │ │ │ -001773e0: 643c 2f64 6976 3e3c 6469 7620 636c 6173 d
User-d │ │ │ -00177400: 6566 696e 6162 6c65 2048 5454 5020 616e efinable HTTP an │ │ │ -00177410: 6420 4e54 4c4d 2061 7574 686f 7269 7a61 d NTLM authoriza │ │ │ -00177420: 7469 6f6e 2070 6173 7377 6f72 6420 7374 tion password st │ │ │ -00177430: 7269 6e67 2072 6571 7569 7265 6420 666f ring required fo │ │ │ -00177440: 7220 4854 5450 2062 6173 6963 2061 6e64 r HTTP basic and │ │ │ -00177450: 204e 544c 4d20 6175 7468 656e 7469 632e NTLM authentic. │ │ │ -00177460: 2e2e 3c2f 6469 763e 3c64 6976 2063 6c61 ..
De │ │ │ -00177480: 6669 6e69 7469 6f6e 3a3c 2f62 3e20 7374 finition: st │ │ │ -00177490: 6473 6f61 7032 2e68 3a33 3832 373c 2f64 dsoap2.h:3827
.< │ │ │ -00177650: 212d 2d20 6672 6167 6d65 6e74 202d 2d3e !-- fragment --> │ │ │ -00177660: 3c70 3e41 2063 6c69 656e 7420 534f 4150

A client SOAP │ │ │ -00177670: 2072 6571 7565 7374 2077 696c 6c20 6861 request will ha │ │ │ -00177680: 7665 2074 6865 2066 6f6c 6c6f 7769 6e67 ve the following │ │ │ -00177690: 2048 5454 5020 6865 6164 6572 3a20 3c2f HTTP header:

POST /XX
│ │ │ -001776c0: 5820 4854 5450 2f31 2e31 200a 486f 7374  X HTTP/1.1 .Host
│ │ │ -001776d0: 3a20 5959 5920 0a55 7365 722d 4167 656e  : YYY .User-Agen
│ │ │ -001776e0: 743a 2067 534f 4150 2f32 2e38 200a 436f  t: gSOAP/2.8 .Co
│ │ │ -001776f0: 6e74 656e 742d 5479 7065 3a20 7465 7874  ntent-Type: text
│ │ │ -00177700: 2f78 6d6c 3b20 6368 6172 7365 743d 7574  /xml; charset=ut
│ │ │ -00177710: 662d 3820 0a43 6f6e 7465 6e74 2d4c 656e  f-8 .Content-Len
│ │ │ -00177720: 6774 683a 205a 5a5a 200a 4175 7468 6f72  gth: ZZZ .Author
│ │ │ -00177730: 697a 6174 696f 6e3a 2042 6173 6963 205a  ization: Basic Z
│ │ │ -00177740: 3356 6c63 3351 365a 3356 6c63 3351 3d20  3Vlc3Q6Z3Vlc3Q= 
│ │ │ -00177750: 0a3c 2f70 7265 3e3c 703e 2041 2063 6c69  .

A cli │ │ │ -00177760: 656e 7420 6d75 7374 2073 6574 2074 6865 ent must set the │ │ │ -00177770: 203c 636f 6465 3e63 6f6e 7374 2063 6861 const cha │ │ │ -00177780: 722a 203c 6120 636c 6173 733d 2265 6c22 r* soap: │ │ │ -00177840: 3a75 7365 7269 643c 2f61 3e3c 2f63 6f64 :userid and con │ │ │ -00177860: 7374 2063 6861 722a 203c 6120 636c 6173 st char* soap::passwd strings │ │ │ -00177940: 2066 6f72 2065 6163 6820 6361 6c6c 2074 for each call t │ │ │ -00177950: 6861 7420 7265 7175 6972 6573 2063 6c69 hat requires cli │ │ │ -00177960: 656e 7420 6175 7468 656e 7469 6361 7469 ent authenticati │ │ │ -00177970: 6f6e 2e20 5468 6520 7374 7269 6e67 7320 on. The strings │ │ │ -00177980: 6172 6520 7265 7365 7420 6166 7465 7220 are reset after │ │ │ -00177990: 6561 6368 2073 7563 6365 7373 6675 6c20 each successful │ │ │ -001779a0: 6f72 2075 6e73 7563 6365 7373 6675 6c20 or unsuccessful │ │ │ -001779b0: 6361 6c6c 2e3c 2f70 3e0a 3c70 3e57 6865 call.

.

Whe │ │ │ -001779c0: 6e20 7072 6573 656e 742c 2074 6865 203c n present, the < │ │ │ -001779d0: 636f 6465 3e57 5757 2d41 7574 6865 6e74 code>WWW-Authent │ │ │ -001779e0: 6963 6174 653c 2f63 6f64 653e 2048 5454 icate HTT │ │ │ -001779f0: 5020 6865 6164 6572 2072 6574 7572 6e65 P header returne │ │ │ -00177a00: 6420 6279 2074 6865 2073 6572 7665 7220 d by the server │ │ │ -00177a10: 7769 7468 2074 6865 2061 7574 6865 6e74 with the authent │ │ │ -00177a20: 6963 6174 696f 6e20 7265 616c 6d20 6973 ication realm is │ │ │ -00177a30: 2073 746f 7265 6420 696e 2074 6865 2074 stored in the t │ │ │ -00177a40: 6865 203c 636f 6465 3e3c 6120 636c 6173 he soap::authrealm │ │ │ -00177b10: 3c2f 613e 3c2f 636f 6465 3e20 7374 7269 stri │ │ │ -00177b20: 6e67 2e20 5468 6973 2069 7320 7573 6566 ng. This is usef │ │ │ -00177b30: 756c 2066 6f72 2063 6c69 656e 7473 2074 ul for clients t │ │ │ -00177b40: 6f20 7573 6520 7468 6973 2064 6f6d 6169 o use this domai │ │ │ -00177b50: 6e20 696e 666f 726d 6174 696f 6e20 746f n information to │ │ │ -00177b60: 2072 6573 706f 6e64 2074 6f20 6175 7468 respond to auth │ │ │ -00177b70: 656e 7469 6361 7469 6f6e 2072 6571 7565 entication reque │ │ │ -00177b80: 7374 732e 3c2f 703e 0a3c 703e 4120 7374 sts.

.

A st │ │ │ -00177b90: 616e 642d 616c 6f6e 6520 6753 4f41 5020 and-alone gSOAP │ │ │ -00177ba0: 5765 6220 5365 7276 6963 6520 6170 706c Web Service appl │ │ │ -00177bb0: 6963 6174 696f 6e20 6361 6e20 656e 666f ication can enfo │ │ │ -00177bc0: 7263 6520 4854 5450 2061 7574 6865 6e74 rce HTTP authent │ │ │ -00177bd0: 6963 6174 696f 6e20 6f6e 2063 6c69 656e ication on clien │ │ │ -00177be0: 7473 2062 7920 6368 6563 6b69 6e67 2074 ts by checking t │ │ │ -00177bf0: 6865 203c 636f 6465 3e63 6f6e 7374 2063 he const c │ │ │ -00177c00: 6861 722a 203c 6120 636c 6173 733d 2265 har* soa │ │ │ -00177cc0: 703a 3a75 7365 7269 643c 2f61 3e3c 2f63 p::userid and c │ │ │ -00177ce0: 6f6e 7374 2063 6861 722a 203c 6120 636c onst char* soap::passwd< │ │ │ -00177db0: 2f61 3e3c 2f63 6f64 653e 2073 7472 696e /a> strin │ │ │ -00177dc0: 6773 2e20 5468 6573 6520 7374 7269 6e67 gs. These string │ │ │ -00177dd0: 7320 6172 6520 7365 7420 7768 656e 2061 s are set when a │ │ │ -00177de0: 2063 6c69 656e 7420 7265 7175 6573 7420 client request │ │ │ -00177df0: 636f 6e74 6169 6e73 2048 5454 5020 6175 contains HTTP au │ │ │ -00177e00: 7468 656e 7469 6361 7469 6f6e 2068 6561 thentication hea │ │ │ -00177e10: 6465 7273 2e20 5468 6520 7374 7269 6e67 ders. The string │ │ │ -00177e20: 7320 7368 6f75 6c64 2062 6520 6368 6563 s should be chec │ │ │ -00177e30: 6b65 6420 696e 2065 6163 6820 7365 7276 ked in each serv │ │ │ -00177e40: 6963 6520 6d65 7468 6f64 2028 7468 6174 ice method (that │ │ │ -00177e50: 2072 6571 7569 7265 7320 6175 7468 656e requires authen │ │ │ -00177e60: 7469 6361 7469 6f6e 2074 6f20 6578 6563 tication to exec │ │ │ -00177e70: 7574 6529 2e3c 2f70 3e0a 3c70 3e48 6572 ute).

.

Her │ │ │ -00177e80: 6520 6973 2061 6e20 6578 616d 706c 6520 e is an example │ │ │ -00177e90: 7365 7276 6963 6520 6d65 7468 6f64 2069 service method i │ │ │ -00177ea0: 6d70 6c65 6d65 6e74 6174 696f 6e20 7468 mplementation th │ │ │ -00177eb0: 6174 2065 6e66 6f72 6365 6420 636c 6965 at enforced clie │ │ │ -00177ec0: 6e74 2061 7574 6865 6e74 6963 6174 696f nt authenticatio │ │ │ -00177ed0: 6e3a 3c2f 703e 0a3c 6469 7620 636c 6173 n:

.
< │ │ │ -00177f00: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -00177f10: 6f72 6474 7970 6522 3e69 6e74 3c2f 7370 ordtype">int ns__webmetho │ │ │ -00177f30: 6428 3c73 7061 6e20 636c 6173 733d 226b d(struct soa │ │ │ -00177f80: 703c 2f61 3e20 2a3c 6120 636c 6173 733d p *so │ │ │ -00177fb0: 6170 3c2f 613e 2c20 2e2e 2e29 203c 2f64 ap, ...) .
{
. │ │ │ -00177ff0: 2020 3c73 7061 6e20 636c 6173 733d 226b if (!s │ │ │ -00178040: 6f61 703c 2f61 3e2d 2667 743b 3c61 2063 oap->userid< │ │ │ -001780a0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
|| !< │ │ │ -001780c0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -001780d0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ -001780e0: 6874 6d6c 223e 736f 6170 3c2f 613e 2d26 html">soap-& │ │ │ -001780f0: 6774 3b3c 6120 636c 6173 733d 2263 6f64 gt;pass │ │ │ -00178140: 7764 3c2f 613e 3c2f 6469 763e 0a3c 6469 wd
. │ │ │ -00178160: 2020 7c7c 2073 7472 636d 7028 3c61 2063 || strcmp(soap-> │ │ │ -001781a0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 userid< │ │ │ -001781f0: 2f61 3e2c 203c 7370 616e 2063 6c61 7373 /a>, "guest&quo │ │ │ -00178220: 743b 3c2f 7370 616e 3e29 3c2f 6469 763e t;)
│ │ │ -00178230: 0a3c 6469 7620 636c 6173 733d 226c 696e .
|| strcmp( │ │ │ -00178250: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap- │ │ │ -00178280: 2667 743b 3c61 2063 6c61 7373 3d22 636f >pas │ │ │ -001782d0: 7377 643c 2f61 3e2c 203c 7370 616e 2063 swd, "visit │ │ │ -00178300: 2671 756f 743b 3c2f 7370 616e 3e29 2920 ")) │ │ │ -00178310: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
{..< │ │ │ -00178460: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -00178470: 3e20 2020 203c 7370 616e 2063 6c61 7373 > r │ │ │ -00178490: 6574 7572 6e3c 2f73 7061 6e3e 2034 3031 eturn 401 │ │ │ -001784a0: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
}.
... // webmethod │ │ │ -00178500: 6c6f 6769 633c 2f73 7061 6e3e 3c2f 6469 logic.
return < │ │ │ -00178550: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -00178560: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ -00178570: 705f 5f65 7272 6f72 732e 6874 6d6c 2367 p__errors.html#g │ │ │ -00178580: 6133 6231 3061 3638 6633 3534 6633 3963 a3b10a68f354f39c │ │ │ -00178590: 6262 3066 6530 6430 3433 6164 3463 3763 bb0fe0d043ad4c7c │ │ │ -001785a0: 3022 3e53 4f41 505f 4f4b 3c2f 613e 3b3c 0">SOAP_OK;< │ │ │ -001785b0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
}
. │ │ │ -001785d0: 3c64 6976 2063 6c61 7373 3d22 7474 6322
soap::a │ │ │ -00178670: 7574 6872 6561 6c6d 3c2f 613e 3c2f 6469 uthrealm
const char │ │ │ -001786a0: 202a 2061 7574 6872 6561 6c6d 3c2f 6469 * authrealm
The HTTP an │ │ │ -001786d0: 6420 4e54 4c4d 2061 7574 686f 7269 7a61 d NTLM authoriza │ │ │ -001786e0: 7469 6f6e 2072 6561 6c6d 2f64 6f6d 6169 tion realm/domai │ │ │ -001786f0: 6e20 7374 7269 6e67 2072 6563 6569 7665 n string receive │ │ │ -00178700: 6420 6279 2074 6865 2063 6c69 656e 7420 d by the client │ │ │ -00178710: 7769 7468 2074 6865 2057 5757 2d41 7574 with the WWW-Aut │ │ │ -00178720: 6865 6e74 6963 6174 6520 2e2e 2e3c 2f64 henticate ...
Definit │ │ │ -00178750: 696f 6e3a 3c2f 623e 2073 7464 736f 6170 ion: stdsoap │ │ │ -00178760: 322e 683a 3338 3332 3c2f 6469 763e 3c2f 2.h:3832
.

W │ │ │ -00178790: 6865 6e20 7468 6520 6175 7468 656e 7469 hen the authenti │ │ │ -001787a0: 6361 7469 6f6e 2066 6169 6c73 2c20 7468 cation fails, th │ │ │ -001787b0: 6520 7365 7276 6963 6520 7265 7370 6f6e e service respon │ │ │ -001787c0: 7365 2077 6974 6820 6120 534f 4150 2046 se with a SOAP F │ │ │ -001787d0: 6175 6c74 206d 6573 7361 6765 2061 6e64 ault message and │ │ │ -001787e0: 2061 2048 5454 5020 6572 726f 7220 636f a HTTP error co │ │ │ -001787f0: 6465 2022 3430 3120 556e 6175 7468 6f72 de "401 Unauthor │ │ │ -00178800: 697a 6564 222e 2054 6865 2048 5454 5020 ized". The HTTP │ │ │ -00178810: 6572 726f 7220 636f 6465 7320 6172 6520 error codes are │ │ │ -00178820: 6465 7363 7269 6265 6420 696e 2053 6563 described in Sec │ │ │ -00178830: 7469 6f6e 203c 6120 636c 6173 733d 2265 tion Ru │ │ │ -00178860: 6e2d 7469 6d65 2065 7272 6f72 2063 6f64 n-time error cod │ │ │ -00178870: 6573 3c2f 613e 202e 3c2f 703e 0a3c 703e es .

.

│ │ │ -00178880: 546f 2072 6574 7572 6e20 6120 6e6f 6e2d To return a non- │ │ │ -00178890: 534f 4150 2065 7272 6f72 2c20 7573 653a SOAP error, use: │ │ │ -001788a0: 3c2f 703e 0a3c 6469 7620 636c 6173 733d

.
. │ │ │ -001789a0: 3c2f 6469 763e 3c21 2d2d 2066 7261 676d

.... < │ │ │ -001789c0: 6120 6872 6566 3d22 2322 3e42 6163 6b20 a href="#">Back │ │ │ -001789d0: 746f 2074 6162 6c65 206f 6620 636f 6e74 to table of cont │ │ │ -001789e0: 656e 7473 3c2f 613e 3c2f 703e 0a3c 6833 ents

.

. │ │ │ -00178a20: 4854 5450 204e 544c 4d20 6175 7468 656e HTTP NTLM authen │ │ │ -00178a30: 7469 6361 7469 6f6e 3c2f 6833 3e0a 3c70 tication

.

HTTP NTLM authe │ │ │ -00178a50: 6e74 6963 6174 696f 6e20 6973 2065 6e61 ntication is ena │ │ │ -00178a60: 626c 6564 2061 7420 7468 6520 636c 6965 bled at the clie │ │ │ -00178a70: 6e74 2d73 6964 6520 6279 2069 6e73 7461 nt-side by insta │ │ │ -00178a80: 6c6c 696e 6720 3c63 6f64 653e 6c69 626e lling libn │ │ │ -00178a90: 746c 6d3c 2f63 6f64 653e 2066 726f 6d20 tlm from │ │ │ -00178aa0: 3c61 2068 7265 663d 2268 7474 703a 2f2f http://w │ │ │ -00178ad0: 7777 2e6e 6f6e 676e 752e 6f72 672f 6c69 ww.nongnu.org/li │ │ │ -00178ae0: 626e 746c 6d3c 2f61 3e20 616e 6420 636f bntlm and co │ │ │ -00178af0: 6d70 696c 696e 6720 616c 6c20 7072 6f6a mpiling all proj │ │ │ -00178b00: 6563 7420 736f 7572 6365 2063 6f64 6573 ect source codes │ │ │ -00178b10: 2077 6974 6820 7468 6520 636f 6d70 696c with the compil │ │ │ -00178b20: 652d 7469 6d65 2066 6c61 6720 3c63 6f64 e-time flag #WITH_NTLM.

.

In y │ │ │ -00178b50: 6f75 7220 6170 706c 6963 6174 696f 6e20 our application │ │ │ -00178b60: 636f 6465 2073 6574 2074 6865 203c 636f code set the const char* < │ │ │ -00178b80: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ -00178b90: 663d 2273 7472 7563 7473 6f61 702e 6874 f="structsoap.ht │ │ │ -00178ba0: 6d6c 2361 3265 6465 3032 3039 3564 3938 ml#a2ede02095d98 │ │ │ -00178bb0: 3934 3266 3463 3232 3066 6431 3762 3439 942f4c220fd17b49 │ │ │ -00178bc0: 3537 3033 2220 7469 746c 653d 2255 7365 5703" title="Use │ │ │ -00178bd0: 722d 6465 6669 6e61 626c 6520 4854 5450 r-definable HTTP │ │ │ -00178be0: 2061 6e64 204e 544c 4d20 6175 7468 6f72 and NTLM author │ │ │ -00178bf0: 697a 6174 696f 6e20 7573 6572 2069 6420 ization user id │ │ │ -00178c00: 7374 7269 6e67 2066 6f72 2048 5454 5020 string for HTTP │ │ │ -00178c10: 6261 7369 6320 616e 6420 4e54 4c4d 2061 basic and NTLM a │ │ │ -00178c20: 7574 6865 6e74 6963 6174 696f 6e20 6279 uthentication by │ │ │ -00178c30: 2074 2e2e 2e22 3e73 6f61 703a 3a75 7365 t...">soap::use │ │ │ -00178c40: 7269 643c 2f61 3e3c 2f63 6f64 653e 2061 rid a │ │ │ -00178c50: 6e64 203c 636f 6465 3e63 6f6e 7374 2063 nd const c │ │ │ -00178c60: 6861 722a 203c 6120 636c 6173 733d 2265 har* soa │ │ │ -00178d20: 703a 3a70 6173 7377 643c 2f61 3e3c 2f63 p::passwd strings to │ │ │ -00178d40: 6120 7573 6572 6e61 6d65 2061 6e64 2070 a username and p │ │ │ -00178d50: 6173 7377 6f72 642e 2041 2073 6572 7665 assword. A serve │ │ │ -00178d60: 7220 6d61 7920 7265 7175 6573 7420 4e54 r may request NT │ │ │ -00178d70: 4c4d 2061 7574 6865 6e74 6963 6174 696f LM authenticatio │ │ │ -00178d80: 6e20 616e 6420 6465 6e69 6573 2061 6363 n and denies acc │ │ │ -00178d90: 6573 7320 2848 5454 5020 3430 3120 6175 ess (HTTP 401 au │ │ │ -00178da0: 7468 656e 7469 6361 7469 6f6e 2072 6571 thentication req │ │ │ -00178db0: 7569 7265 6420 6f72 2048 5454 5020 3430 uired or HTTP 40 │ │ │ -00178dc0: 3720 4854 5450 2070 726f 7879 2061 7574 7 HTTP proxy aut │ │ │ -00178dd0: 6865 6e74 6963 6174 696f 6e20 7265 7175 hentication requ │ │ │ -00178de0: 6972 6564 2920 7768 656e 2074 6865 2063 ired) when the c │ │ │ -00178df0: 6c69 656e 7420 7472 6965 7320 746f 2063 lient tries to c │ │ │ -00178e00: 6f6e 6e65 6374 2077 6974 686f 7574 2048 onnect without H │ │ │ -00178e10: 5454 5020 6175 7468 656e 7469 6361 7469 TTP authenticati │ │ │ -00178e20: 6f6e 2028 6f72 2077 6974 6820 7468 6520 on (or with the │ │ │ -00178e30: 7772 6f6e 6720 6175 7468 656e 7469 6361 wrong authentica │ │ │ -00178e40: 7469 6f6e 2069 6e66 6f72 6d61 7469 6f6e tion information │ │ │ -00178e50: 292e 3c2f 703e 0a3c 703e 4865 7265 2069 ).

.

Here i │ │ │ -00178e60: 7320 616e 2065 7861 6d70 6c65 2063 6c69 s an example cli │ │ │ -00178e70: 656e 7420 636f 6465 2066 7261 676d 656e ent code fragmen │ │ │ -00178e80: 7420 746f 2073 6574 2074 6865 204e 544c t to set the NTL │ │ │ -00178e90: 4d20 6175 7468 656e 7469 6361 7469 6f6e M authentication │ │ │ -00178ea0: 2075 7365 726e 616d 6520 616e 6420 7061 username and pa │ │ │ -00178eb0: 7373 776f 7264 3a3c 2f70 3e0a 3c64 6976 ssword:

.
. │ │ │ -00179040: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
if (soap_call │ │ │ -00179080: 5f6e 735f 5f77 6562 6d65 7468 6f64 283c _ns__webmethod(< │ │ │ -00179090: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -001790a0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ -001790b0: 6874 6d6c 223e 736f 6170 3c2f 613e 2c20 html">soap, │ │ │ -001790c0: 2e2e 2e29 2920 3c2f 6469 763e 0a3c 6469 ...))
.{ │ │ │ -001790e0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
if ( │ │ │ -00179120: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap- │ │ │ -00179150: 2667 743b 3c61 2063 6c61 7373 3d22 636f >err │ │ │ -001791a0: 6f72 3c2f 613e 203d 3d20 3430 3129 203c or == 401) < │ │ │ -001791b0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
{
.
s │ │ │ -00179210: 6f61 703c 2f61 3e2d 2667 743b 3c61 2063 oap->userid │ │ │ -00179270: 3d20 3c73 7061 6e20 636c 6173 733d 2273 = &q │ │ │ -00179290: 756f 743b 5a61 7068 6f64 2671 756f 743b uot;Zaphod" │ │ │ -001792a0: 3c2f 7370 616e 3e3b 203c 2f64 6976 3e0a ;
. │ │ │ -001792b0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
soa │ │ │ -001792f0: 703c 2f61 3e2d 2667 743b 3c61 2063 6c61 p->passwd = │ │ │ -00179350: 3c73 7061 6e20 636c 6173 733d 2273 7472 &quo │ │ │ -00179370: 743b 4265 6562 6c65 6272 6f78 2671 756f t;Beeblebrox&quo │ │ │ -00179380: 743b 3c2f 7370 616e 3e3b 203c 2f64 6976 t;;
.
if (soa │ │ │ -001793d0: 705f 6361 6c6c 5f6e 735f 5f77 6562 6d65 p_call_ns__webme │ │ │ -001793e0: 7468 6f64 283c 6120 636c 6173 733d 2263 thod(soap │ │ │ -00179410: 3c2f 613e 2c20 2e2e 2e29 2920 3c2f 6469 , ...)) .
... < │ │ │ -00179440: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ -00179450: 656e 7422 3e2f 2f20 6572 726f 723c 2f73 ent">// error
.
│ │ │ -00179480: 203c 7370 616e 2063 6c61 7373 3d22 6b65 else< │ │ │ -001794a0: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
. │ │ │ -001794c0: 2020 2020 202e 2e2e 203c 7370 616e 2063 ... / │ │ │ -001794e0: 2f20 7375 6363 6573 733c 2f73 7061 6e3e / success │ │ │ -001794f0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
}.
}
.

The follo │ │ │ -00179550: 7769 6e67 204e 544c 4d20 6861 6e64 7368 wing NTLM handsh │ │ │ -00179560: 616b 6520 6265 7477 6565 6e20 7468 6520 ake between the │ │ │ -00179570: 636c 6965 6e74 2043 2061 6e64 2073 6572 client C and ser │ │ │ -00179580: 7665 7220 5320 6973 2070 6572 666f 726d ver S is perform │ │ │ -00179590: 6564 3a20 3c2f 703e 3c70 7265 2063 6c61 ed:

1:
│ │ │ -001795b0: 2043 2020 2d2d 2667 743b 2053 2026 616d   C  --> S &am
│ │ │ -001795c0: 703b 2050 4f53 5420 2e2e 2e20 0a20 2020  p; POST ... .   
│ │ │ -001795d0: 2020 2020 2020 2020 2026 616d 703b 2043           & C
│ │ │ -001795e0: 6f6e 7465 6e74 2d54 7970 653a 2074 6578  ontent-Type: tex
│ │ │ -001795f0: 742f 786d 6c3b 2063 6861 7273 6574 3d75  t/xml; charset=u
│ │ │ -00179600: 7466 2d38 200a 0a32 3a20 4320 266c 743b  tf-8 ..2: C <
│ │ │ -00179610: 2d2d 2020 5320 2661 6d70 3b20 3430 3120  --  S & 401 
│ │ │ -00179620: 556e 6175 7468 6f72 697a 6564 200a 2020  Unauthorized .  
│ │ │ -00179630: 2020 2020 2020 2020 2020 2661 6d70 3b20            & 
│ │ │ -00179640: 5757 572d 4175 7468 656e 7469 6361 7465  WWW-Authenticate
│ │ │ -00179650: 3a20 4e54 4c4d 200a 0a33 3a20 4320 202d  : NTLM ..3: C  -
│ │ │ -00179660: 2d26 6774 3b20 5320 2661 6d70 3b20 4745  -> S & GE
│ │ │ -00179670: 5420 2e2e 2e20 0a20 2020 2020 2020 2020  T ... .         
│ │ │ -00179680: 2020 2026 616d 703b 2041 7574 686f 7269     & Authori
│ │ │ -00179690: 7a61 7469 6f6e 3a20 4e54 4c4d 2026 6c74  zation: NTLM <
│ │ │ -001796a0: 3b62 6173 6536 342d 656e 636f 6465 6420  ;base64-encoded 
│ │ │ -001796b0: 7479 7065 2d31 2d6d 6573 7361 6765 2667  type-1-message&g
│ │ │ -001796c0: 743b 200a 0a34 3a20 4320 266c 743b 2d2d  t; ..4: C <--
│ │ │ -001796d0: 2020 5320 2661 6d70 3b20 3430 3120 556e    S & 401 Un
│ │ │ -001796e0: 6175 7468 6f72 697a 6564 200a 2020 2020  authorized .    
│ │ │ -001796f0: 2020 2020 2020 2020 2661 6d70 3b20 5757          & WW
│ │ │ -00179700: 572d 4175 7468 656e 7469 6361 7465 3a20  W-Authenticate: 
│ │ │ -00179710: 4e54 4c4d 2026 6c74 3b62 6173 6536 342d  NTLM <base64-
│ │ │ -00179720: 656e 636f 6465 6420 7479 7065 2d32 2d6d  encoded type-2-m
│ │ │ -00179730: 6573 7361 6765 2667 743b 200a 0a35 3a20  essage> ..5: 
│ │ │ -00179740: 4320 202d 2d26 6774 3b20 5320 2661 6d70  C  --> S &
│ │ │ -00179750: 3b20 504f 5354 202e 2e2e 200a 2020 2020  ; POST ... .    
│ │ │ -00179760: 2020 2020 2020 2020 2661 6d70 3b20 436f          & Co
│ │ │ -00179770: 6e74 656e 742d 5479 7065 3a20 7465 7874  ntent-Type: text
│ │ │ -00179780: 2f78 6d6c 3b20 6368 6172 7365 743d 7574  /xml; charset=ut
│ │ │ -00179790: 662d 3820 0a20 2020 2020 2020 2020 2020  f-8 .           
│ │ │ -001797a0: 2026 616d 703b 2041 7574 686f 7269 7a61   & Authoriza
│ │ │ -001797b0: 7469 6f6e 3a20 4e54 4c4d 2026 6c74 3b62  tion: NTLM <b
│ │ │ -001797c0: 6173 6536 342d 656e 636f 6465 6420 7479  ase64-encoded ty
│ │ │ -001797d0: 7065 2d33 2d6d 6573 7361 6765 2667 743b  pe-3-message>
│ │ │ -001797e0: 200a 0a36 3a20 4320 266c 743b 2d2d 2020   ..6: C <--  
│ │ │ -001797f0: 5320 2661 6d70 3b20 3230 3020 4f4b 0a3c  S & 200 OK.<
│ │ │ -00179800: 2f70 7265 3e3c 703e 2077 6865 7265 2073  /pre>

where s │ │ │ -00179810: 7461 6765 7320 3120 616e 6420 3220 696e tages 1 and 2 in │ │ │ -00179820: 6469 6361 7465 7320 6120 636c 6965 6e74 dicates a client │ │ │ -00179830: 2061 7474 656d 7074 696e 6720 746f 2063 attempting to c │ │ │ -00179840: 6f6e 6e65 6374 2077 6974 686f 7574 2061 onnect without a │ │ │ -00179850: 7574 686f 7269 7a61 7469 6f6e 2069 6e66 uthorization inf │ │ │ -00179860: 6f72 6d61 7469 6f6e 2c20 7768 6963 6820 ormation, which │ │ │ -00179870: 6973 2074 6865 2066 6972 7374 206d 6574 is the first met │ │ │ -00179880: 686f 6420 6361 6c6c 2069 6e20 7468 6520 hod call in the │ │ │ -00179890: 636f 6465 2061 626f 7665 2e20 5374 6167 code above. Stag │ │ │ -001798a0: 6520 3320 746f 2036 2068 6170 7065 6e20 e 3 to 6 happen │ │ │ -001798b0: 7769 7468 2074 6865 2070 726f 7065 7220 with the proper │ │ │ -001798c0: 636c 6965 6e74 2061 7574 6865 6e74 6963 client authentic │ │ │ -001798d0: 6174 696f 6e20 7365 7420 7769 7468 203c ation set with < │ │ │ -001798e0: 636f 6465 3e63 6f6e 7374 2063 6861 722a code>const char* │ │ │ -001798f0: 203c 6120 636c 6173 733d 2265 6c22 2068 soap::u │ │ │ -001799b0: 7365 7269 643c 2f61 3e3c 2f63 6f64 653e serid │ │ │ -001799c0: 2061 6e64 203c 636f 6465 3e63 6f6e 7374 and const │ │ │ -001799d0: 2063 6861 722a 203c 6120 636c 6173 733d char* s │ │ │ -00179a90: 6f61 703a 3a70 6173 7377 643c 2f61 3e3c oap::passwd< │ │ │ -00179aa0: 2f63 6f64 653e 2e20 4f70 7469 6f6e 616c /code>. Optional │ │ │ -00179ab0: 6c79 2c20 7468 6520 3c63 6f64 653e 636f ly, the co │ │ │ -00179ac0: 6e73 7420 6368 6172 2a20 3c61 2063 6c61 nst char* soap::authreal │ │ │ -00179b90: 6d3c 2f61 3e3c 2f63 6f64 653e 2073 7472 m str │ │ │ -00179ba0: 696e 6720 7368 6f75 6c64 2062 6520 7365 ing should be se │ │ │ -00179bb0: 7420 6173 2077 656c 6c20 746f 2069 6e64 t as well to ind │ │ │ -00179bc0: 6963 6174 6520 7468 6520 646f 6d61 696e icate the domain │ │ │ -00179bd0: 2061 6363 6573 7365 6420 2874 6869 7320 accessed (this │ │ │ -00179be0: 7374 7269 6e67 2069 7320 6e6f 726d 616c string is normal │ │ │ -00179bf0: 6c79 2073 6574 2077 6865 6e20 7468 6520 ly set when the │ │ │ -00179c00: 7365 7276 6572 2072 6573 706f 6e64 7320 server responds │ │ │ -00179c10: 7769 7468 2048 5454 5020 3430 3120 736f with HTTP 401 so │ │ │ -00179c20: 2074 6865 2063 6c69 656e 7420 7265 6365 the client rece │ │ │ -00179c30: 6976 6573 2074 6869 7320 7365 7276 6572 ives this server │ │ │ -00179c40: 2064 6f6d 6169 6e20 696e 666f 726d 6174 domain informat │ │ │ -00179c50: 696f 6e29 2e20 4e54 4c4d 2061 7574 6865 ion). NTLM authe │ │ │ -00179c60: 6e74 6963 6174 6573 2063 6f6e 6e65 6374 nticates connect │ │ │ -00179c70: 696f 6e73 2c20 6e6f 7420 7265 7175 6573 ions, not reques │ │ │ -00179c80: 7473 2e20 5768 656e 2074 6865 2063 6f6e ts. When the con │ │ │ -00179c90: 6e65 6374 696f 6e20 6973 206b 6570 7420 nection is kept │ │ │ -00179ca0: 616c 6976 652c 2073 7562 7365 7175 656e alive, subsequen │ │ │ -00179cb0: 7420 6d65 7373 6167 6573 2063 616e 2062 t messages can b │ │ │ -00179cc0: 6520 6578 6368 616e 6765 6420 7769 7468 e exchanged with │ │ │ -00179cd0: 6f75 7420 7265 2d61 7574 6865 6e74 6963 out re-authentic │ │ │ -00179ce0: 6174 696f 6e2e 3c2f 703e 0a3c 703e 546f ation.

.

To │ │ │ -00179cf0: 2061 766f 6964 2074 6865 206f 7665 7268 avoid the overh │ │ │ -00179d00: 6561 6420 6f66 2074 6865 2066 6972 7374 ead of the first │ │ │ -00179d10: 2072 656a 6563 7465 6420 6361 6c6c 2c20 rejected call, │ │ │ -00179d20: 7573 653a 3c2f 703e 0a3c 6469 7620 636c use:

..< │ │ │ -00179ec0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -00179ed0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ -00179ee0: 6874 6d6c 223e 736f 6170 3c2f 613e 2d26 html">soap-& │ │ │ -00179ef0: 6774 3b3c 6120 636c 6173 733d 2263 6f64 gt;ntlm │ │ │ -00179f40: 5f63 6861 6c6c 656e 6765 3c2f 613e 203d _challenge = │ │ │ -00179f50: 203c 7370 616e 2063 6c61 7373 3d22 7374 &qu │ │ │ -00179f70: 6f74 3b26 7175 6f74 3b3c 2f73 7061 6e3e ot;" │ │ │ -00179f80: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
soap->< │ │ │ -00179fd0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -00179fe0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ -00179ff0: 6874 6d6c 2361 3265 6465 3032 3039 3564 html#a2ede02095d │ │ │ -0017a000: 3938 3934 3266 3463 3232 3066 6431 3762 98942f4c220fd17b │ │ │ -0017a010: 3439 3537 3033 223e 7573 6572 6964 3c2f 495703">userid = "Zaphod&qu │ │ │ -0017a050: 6f74 3b3c 2f73 7061 6e3e 3b20 3c2f 6469 ot;; .
soap │ │ │ -0017a0a0: 3c2f 613e 2d26 6774 3b3c 6120 636c 6173 ->passwd = < │ │ │ -0017a100: 7370 616e 2063 6c61 7373 3d22 7374 7269 span class="stri │ │ │ -0017a110: 6e67 6c69 7465 7261 6c22 3e26 7175 6f74 ngliteral">" │ │ │ -0017a120: 3b42 6565 626c 6562 726f 7826 7175 6f74 ;Beeblebrox" │ │ │ -0017a130: 3b3c 2f73 7061 6e3e 3b20 3c2f 6469 763e ;;
│ │ │ -0017a140: 0a3c 6469 7620 636c 6173 733d 226c 696e .
soap-> │ │ │ -0017a1d0: 6175 7468 7265 616c 6d3c 2f61 3e20 3d20 authrealm = │ │ │ -0017a1e0: 3c73 7061 6e20 636c 6173 733d 2273 7472 &quo │ │ │ -0017a200: 743b 5572 7361 2d4d 696e 6f72 2671 756f t;Ursa-Minor&quo │ │ │ -0017a210: 743b 3c2f 7370 616e 3e3b 203c 2f64 6976 t;;
.
if │ │ │ -0017a250: 3c2f 7370 616e 3e20 2873 6f61 705f 6361 (soap_ca │ │ │ -0017a260: 6c6c 5f6e 735f 5f77 6562 6d65 7468 6f64 ll_ns__webmethod │ │ │ -0017a270: 283c 6120 636c 6173 733d 2263 6f64 6522 (soap │ │ │ -0017a2a0: 2c20 2e2e 2e29 2920 3c2f 6469 763e 0a3c , ...))
.< │ │ │ -0017a2b0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -0017a2c0: 3e20 202e 2e2e 203c 7370 616e 2063 6c61 > ... // │ │ │ -0017a2e0: 6572 726f 723c 2f73 7061 6e3e 3c2f 6469 error.
e │ │ │ -0017a320: 6c73 653c 2f73 7061 6e3e 3c2f 6469 763e lse
│ │ │ -0017a330: 0a3c 6469 7620 636c 6173 733d 226c 696e .
... / │ │ │ -0017a360: 2f20 7375 6363 6573 733c 2f73 7061 6e3e / success │ │ │ -0017a370: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ -0017a3c0: 3c64 6976 2063 6c61 7373 3d22 7474 6e61 const char * n │ │ │ -0017a450: 746c 6d5f 6368 616c 6c65 6e67 653c 2f64 tlm_challenge
User-defin │ │ │ -0017a480: 6162 6c65 204e 544c 4d20 6175 7468 656e able NTLM authen │ │ │ -0017a490: 7469 6361 7469 6f6e 2063 6861 6c6c 656e tication challen │ │ │ -0017a4a0: 6765 206b 6579 2073 7472 696e 672e 3c2f ge key string.
Defini │ │ │ -0017a4d0: 7469 6f6e 3a3c 2f62 3e20 7374 6473 6f61 tion: stdsoa │ │ │ -0017a4e0: 7032 2e68 3a33 3837 383c 2f64 6976 3e3c p2.h:3878
< │ │ │ -0017a4f0: 2f64 6976 3e0a 3c2f 6469 763e 3c21 2d2d /div>.

│ │ │ -0017a510: 5768 656e 2074 6865 2061 7574 6865 6e74 When the authent │ │ │ -0017a520: 6963 6174 696f 6e20 6661 696c 7320 2873 ication fails (s │ │ │ -0017a530: 7461 6765 2031 2061 6e64 2032 292c 2074 tage 1 and 2), t │ │ │ -0017a540: 6865 2073 6572 7669 6365 2072 6573 706f he service respo │ │ │ -0017a550: 6e73 6520 7769 7468 2048 5454 5020 6572 nse with HTTP er │ │ │ -0017a560: 726f 7220 636f 6465 2022 3430 3120 556e ror code "401 Un │ │ │ -0017a570: 6175 7468 6f72 697a 6564 2220 616e 6420 authorized" and │ │ │ -0017a580: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 soap │ │ │ -0017a630: 3a3a 6572 726f 723c 2f61 3e3c 2f63 6f64 ::error is set to HTT │ │ │ -0017a650: 5020 636f 6465 2034 3031 2e3c 2f70 3e0a P code 401.

. │ │ │ -0017a660: 3c70 3ef0 9f94 9d20 3c61 2068 7265 663d

.... Back to tabl │ │ │ -0017a680: 6520 6f66 2063 6f6e 7465 6e74 733c 2f61 e of contents

.

.HT │ │ │ -0017a6d0: 5450 2070 726f 7879 204e 544c 4d20 6175 TP proxy NTLM au │ │ │ -0017a6e0: 7468 656e 7469 6361 7469 6f6e 3c2f 6833 thentication

.

For HTTP 40 │ │ │ -0017a700: 3720 5072 6f78 7920 4175 7468 656e 7469 7 Proxy Authenti │ │ │ -0017a710: 6361 7469 6f6e 2052 6571 7569 7265 6420 cation Required │ │ │ -0017a720: 7365 7420 7468 6520 3c63 6f64 653e 3c61 set the soa │ │ │ -0017a7e0: 703a 3a70 726f 7879 5f75 7365 7269 643c p::proxy_userid< │ │ │ -0017a7f0: 2f61 3e3c 2f63 6f64 653e 2061 6e64 203c /a> and < │ │ │ -0017a800: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soap::proxy │ │ │ -0017a8c0: 5f70 6173 7377 643c 2f61 3e3c 2f63 6f64 _passwd:

..
soap-&g │ │ │ -0017aaa0: 743b 3c61 2063 6c61 7373 3d22 636f 6465 t;proxy │ │ │ -0017aaf0: 5f68 6f73 743c 2f61 3e20 3d20 3c73 7061 _host = ".. │ │ │ -0017ab20: 2e26 7175 6f74 3b3c 2f73 7061 6e3e 3b20 ."; │ │ │ -0017ab30: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ -0017ab70: 736f 6170 3c2f 613e 2d26 6774 3b3c 6120 soap->proxy_port │ │ │ -0017abd0: 3c2f 613e 203d 202e 2e2e 3b20 3c2f 6469 = ...; .
i │ │ │ -0017ac10: 663c 2f73 7061 6e3e 2028 736f 6170 5f63 f (soap_c │ │ │ -0017ac20: 616c 6c5f 6e73 5f5f 7765 626d 6574 686f all_ns__webmetho │ │ │ -0017ac30: 6428 3c61 2063 6c61 7373 3d22 636f 6465 d(soap, ...))
. │ │ │ -0017ac70: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
{
.
if (soap-> │ │ │ -0017ad40: 6572 726f 723c 2f61 3e20 3d3d 2034 3037 error == 407 │ │ │ -0017ad50: 2920 3c2f 6469 763e 0a3c 6469 7620 636c )
.
{.
soap->< │ │ │ -0017adc0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -0017add0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ -0017ade0: 6874 6d6c 2361 3765 3765 3965 3964 3635 html#a7e7e9e9d65 │ │ │ -0017adf0: 6262 6136 3233 3732 3938 6366 3265 6437 bba6237298cf2ed7 │ │ │ -0017ae00: 6365 6335 3939 223e 7072 6f78 795f 7573 cec599">proxy_us │ │ │ -0017ae10: 6572 6964 3c2f 613e 203d 203c 7370 616e erid = "Zap │ │ │ -0017ae40: 686f 6426 7175 6f74 3b3c 2f73 7061 6e3e hod" │ │ │ -0017ae50: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
< │ │ │ -0017ae70: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -0017ae80: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ -0017ae90: 6874 6d6c 223e 736f 6170 3c2f 613e 2d26 html">soap-& │ │ │ -0017aea0: 6774 3b3c 6120 636c 6173 733d 2263 6f64 gt;prox │ │ │ -0017aef0: 795f 7061 7373 7764 3c2f 613e 203d 203c y_passwd = < │ │ │ -0017af00: 7370 616e 2063 6c61 7373 3d22 7374 7269 span class="stri │ │ │ -0017af10: 6e67 6c69 7465 7261 6c22 3e26 7175 6f74 ngliteral">" │ │ │ -0017af20: 3b42 6565 626c 6562 726f 7826 7175 6f74 ;Beeblebrox" │ │ │ -0017af30: 3b3c 2f73 7061 6e3e 3b20 3c2f 6469 763e ;;
│ │ │ -0017af40: 0a3c 6469 7620 636c 6173 733d 226c 696e .
so │ │ │ -0017af80: 6170 3c2f 613e 2d26 6774 3b3c 6120 636c ap->authrealm = │ │ │ -0017b000: 2671 756f 743b 5572 7361 2d4d 696e 6f72 "Ursa-Minor │ │ │ -0017b010: 2671 756f 743b 3c2f 7370 616e 3e3b 203c "; < │ │ │ -0017b020: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
if │ │ │ -0017b060: 2873 6f61 705f 6361 6c6c 5f6e 735f 5f77 (soap_call_ns__w │ │ │ -0017b070: 6562 6d65 7468 6f64 283c 6120 636c 6173 ebmethod( │ │ │ -0017b0a0: 736f 6170 3c2f 613e 2c20 2e2e 2e29 2920 soap, ...)) │ │ │ -0017b0b0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
. │ │ │ -0017b0d0: 2e2e 203c 7370 616e 2063 6c61 7373 3d22 .. // erro │ │ │ -0017b0f0: 723c 2f73 7061 6e3e 3c2f 6469 763e 0a3c r
.< │ │ │ -0017b100: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -0017b110: 3e20 2020 203c 7370 616e 2063 6c61 7373 > e │ │ │ -0017b130: 6c73 653c 2f73 7061 6e3e 3c2f 6469 763e lse
│ │ │ -0017b140: 0a3c 6469 7620 636c 6173 733d 226c 696e .
... // success
.
int proxy_port │ │ │ -0017b260: 3c2f 6469 763e 3c64 6976 2063 6c61 7373
User-de │ │ │ -0017b280: 6669 6e61 626c 6520 7072 6f78 7920 706f finable proxy po │ │ │ -0017b290: 7274 2077 6869 6368 2073 686f 756c 6420 rt which should │ │ │ -0017b2a0: 6265 2073 6574 2074 6f20 636f 6e6e 6563 be set to connec │ │ │ -0017b2b0: 7420 7468 726f 7567 6820 616e 2048 5454 t through an HTT │ │ │ -0017b2c0: 5020 7072 6f78 7920 2874 6865 2076 616c P proxy (the val │ │ │ -0017b2d0: 7565 2069 7320 3830 3830 2062 7920 2e2e ue is 8080 by .. │ │ │ -0017b2e0: 2e3c 2f64 6976 3e3c 6469 7620 636c 6173 .
Def │ │ │ -0017b300: 696e 6974 696f 6e3a 3c2f 623e 2073 7464 inition: std │ │ │ -0017b310: 736f 6170 322e 683a 3339 3036 3c2f 6469 soap2.h:3906
.
const char * p │ │ │ -0017b400: 726f 7879 5f75 7365 7269 643c 2f64 6976 roxy_userid
User-definab │ │ │ -0017b430: 6c65 2070 726f 7879 2061 7574 686f 7269 le proxy authori │ │ │ -0017b440: 7a61 7469 6f6e 2075 7365 7220 6964 2073 zation user id s │ │ │ -0017b450: 7472 696e 6720 746f 2061 7574 6865 6e74 tring to authent │ │ │ -0017b460: 6963 6174 6520 616e 6420 636f 6e6e 6563 icate and connec │ │ │ -0017b470: 7420 746f 2061 6e20 4854 5450 2070 726f t to an HTTP pro │ │ │ -0017b480: 7879 2e3c 2f64 6976 3e3c 6469 7620 636c xy.
D │ │ │ -0017b4a0: 6566 696e 6974 696f 6e3a 3c2f 623e 2073 efinition: s │ │ │ -0017b4b0: 7464 736f 6170 322e 683a 3339 3131 3c2f tdsoap2.h:3911
.
const char * p │ │ │ -0017b5a0: 726f 7879 5f68 6f73 743c 2f64 6976 3e3c roxy_host
< │ │ │ -0017b5b0: 6469 7620 636c 6173 733d 2274 7464 6f63 div class="ttdoc │ │ │ -0017b5c0: 223e 5573 6572 2d64 6566 696e 6162 6c65 ">User-definable │ │ │ -0017b5d0: 2070 726f 7879 2068 6f73 7420 6e61 6d65 proxy host name │ │ │ -0017b5e0: 2073 7472 696e 6720 7768 6963 6820 7368 string which sh │ │ │ -0017b5f0: 6f75 6c64 2062 6520 7365 7420 746f 2063 ould be set to c │ │ │ -0017b600: 6f6e 6e65 6374 2074 6872 6f75 6768 2061 onnect through a │ │ │ -0017b610: 6e20 4854 5450 2070 726f 7879 2e3c 2f64 n HTTP proxy.
Definit │ │ │ -0017b640: 696f 6e3a 3c2f 623e 2073 7464 736f 6170 ion: stdsoap │ │ │ -0017b650: 322e 683a 3339 3031 3c2f 6469 763e 3c2f 2.h:3901
.
co │ │ │ -0017b730: 6e73 7420 6368 6172 202a 2070 726f 7879 nst char * proxy │ │ │ -0017b740: 5f70 6173 7377 643c 2f64 6976 3e3c 6469 _passwd
│ │ │ -0017b760: 5573 6572 2d64 6566 696e 6162 6c65 2070 User-definable p │ │ │ -0017b770: 726f 7879 2061 7574 686f 7269 7a61 7469 roxy authorizati │ │ │ -0017b780: 6f6e 2070 6173 7377 6f72 6420 7374 7269 on password stri │ │ │ -0017b790: 6e67 2074 6f20 6175 7468 656e 7469 6361 ng to authentica │ │ │ -0017b7a0: 7465 2061 6e64 2063 6f6e 6e65 6374 2074 te and connect t │ │ │ -0017b7b0: 6f20 616e 2048 5454 5020 7072 6f78 792e o an HTTP proxy. │ │ │ -0017b7c0: 3c2f 6469 763e 3c64 6976 2063 6c61 7373
Defi │ │ │ -0017b7e0: 6e69 7469 6f6e 3a3c 2f62 3e20 7374 6473 nition: stds │ │ │ -0017b7f0: 6f61 7032 2e68 3a33 3931 363c 2f64 6976 oap2.h:3916
.
< │ │ │ -0017b820: 703e 546f 2061 766f 6964 2074 6865 206f p>To avoid the o │ │ │ -0017b830: 7665 7268 6561 6420 6f66 2074 6865 2066 verhead of the f │ │ │ -0017b840: 6972 7374 2072 656a 6563 7465 6420 6361 irst rejected ca │ │ │ -0017b850: 6c6c 2c20 7573 653a 3c2f 703e 0a3c 6469 ll, use:

.
struc │ │ │ -0017b8a0: 7420 3c2f 7370 616e 3e3c 6120 636c 6173 t │ │ │ -0017b8d0: 736f 6170 3c2f 613e 202a 3c61 2063 6c61 soap *soap = soap_new1(< │ │ │ -0017b970: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -0017b980: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ -0017b990: 705f 5f66 6c61 6773 2e68 746d 6c23 6761 p__flags.html#ga │ │ │ -0017b9a0: 3061 3436 3335 3733 3737 3332 6339 3132 0a4635737732c912 │ │ │ -0017b9b0: 3035 3866 6634 6462 6136 3638 6331 6232 058ff4dba668c1b2 │ │ │ -0017b9c0: 223e 534f 4150 5f49 4f5f 4b45 4550 414c ">SOAP_IO_KEEPAL │ │ │ -0017b9d0: 4956 453c 2f61 3e29 3b20 3c2f 6469 763e IVE);
│ │ │ -0017b9e0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
soap-> │ │ │ -0017ba70: 7072 6f78 795f 686f 7374 3c2f 613e 203d proxy_host = │ │ │ -0017ba80: 203c 7370 616e 2063 6c61 7373 3d22 7374 &qu │ │ │ -0017baa0: 6f74 3b2e 2e2e 2671 756f 743b 3c2f 7370 ot;...";
.
soap-&g │ │ │ -0017bb00: 743b 3c61 2063 6c61 7373 3d22 636f 6465 t;proxy │ │ │ -0017bb50: 5f70 6f72 743c 2f61 3e20 3d20 2e2e 2e3b _port = ...; │ │ │ -0017bb60: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
soap->proxy_use │ │ │ -0017bc00: 7269 643c 2f61 3e20 3d20 3c73 7061 6e20 rid = "Zaph │ │ │ -0017bc30: 6f64 2671 756f 743b 3c2f 7370 616e 3e3b od"; │ │ │ -0017bc40: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
soap->proxy_pas │ │ │ -0017bce0: 7377 643c 2f61 3e20 3d20 3c73 7061 6e20 swd = "Beeb │ │ │ -0017bd10: 6c65 6272 6f78 2671 756f 743b 3c2f 7370 lebrox";
.
soap-&g │ │ │ -0017bd70: 743b 3c61 2063 6c61 7373 3d22 636f 6465 t;authr │ │ │ -0017bdc0: 6561 6c6d 3c2f 613e 203d 203c 7370 616e ealm = "Urs │ │ │ -0017bdf0: 612d 4d69 6e6f 7226 7175 6f74 3b3c 2f73 a-Minor";
.< │ │ │ -0017be20: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -0017be30: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ -0017be40: 6874 6d6c 223e 736f 6170 3c2f 613e 2d26 html">soap-& │ │ │ -0017be50: 6774 3b3c 6120 636c 6173 733d 2263 6f64 gt;ntlm │ │ │ -0017bea0: 5f63 6861 6c6c 656e 6765 3c2f 613e 203d _challenge = │ │ │ -0017beb0: 203c 7370 616e 2063 6c61 7373 3d22 7374 &qu │ │ │ -0017bed0: 6f74 3b26 7175 6f74 3b3c 2f73 7061 6e3e ot;" │ │ │ -0017bee0: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
if ( │ │ │ -0017bf20: 736f 6170 5f63 616c 6c5f 6e73 5f5f 7765 soap_call_ns__we │ │ │ -0017bf30: 626d 6574 686f 6428 3c61 2063 6c61 7373 bmethod(s │ │ │ -0017bf60: 6f61 703c 2f61 3e2c 202e 2e2e 2929 203c oap, ...)) < │ │ │ -0017bf70: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
... // error
.
else
.
... │ │ │ -0017c010: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // success │ │ │ -0017c030: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c2f
.

.... Back to │ │ │ -0017c070: 2074 6162 6c65 206f 6620 636f 6e74 656e table of conten │ │ │ -0017c080: 7473 3c2f 613e 3c2f 703e 0a3c 6833 3e3c ts

.

< │ │ │ -0017c090: 6120 636c 6173 733d 2261 6e63 686f 7222 a class="anchor" │ │ │ -0017c0a0: 2069 643d 2270 726f 7879 6175 7468 656e id="proxyauthen │ │ │ -0017c0b0: 7469 6361 7469 6f6e 223e 3c2f 613e 0a48 tication">.H │ │ │ -0017c0c0: 5454 5020 7072 6f78 7920 6261 7369 6320 TTP proxy basic │ │ │ -0017c0d0: 6175 7468 656e 7469 6361 7469 6f6e 3c2f authentication.

HTTP prox │ │ │ -0017c0f0: 7920 6175 7468 656e 7469 6361 7469 6f6e y authentication │ │ │ -0017c100: 2028 6261 7369 6329 2069 7320 656e 6162 (basic) is enab │ │ │ -0017c110: 6c65 6420 6174 2074 6865 2063 6c69 656e led at the clien │ │ │ -0017c120: 742d 7369 6465 2062 7920 7365 7474 696e t-side by settin │ │ │ -0017c130: 6720 7468 6520 3c63 6f64 653e 3c61 2063 g the soap: │ │ │ -0017c1f0: 3a70 726f 7879 5f75 7365 7269 643c 2f61 :proxy_userid and soap::proxy_p │ │ │ -0017c2d0: 6173 7377 643c 2f61 3e3c 2f63 6f64 653e asswd │ │ │ -0017c2e0: 2073 7472 696e 6773 2074 6f20 6120 7573 strings to a us │ │ │ -0017c2f0: 6572 6e61 6d65 2061 6e64 2070 6173 7377 ername and passw │ │ │ -0017c300: 6f72 642c 2072 6573 7065 6374 6976 656c ord, respectivel │ │ │ -0017c310: 792e 2046 6f72 2065 7861 6d70 6c65 2c20 y. For example, │ │ │ -0017c320: 6120 7072 6f78 7920 7365 7276 6572 206d a proxy server m │ │ │ -0017c330: 6179 2072 6571 7565 7374 2075 7365 7220 ay request user │ │ │ -0017c340: 6175 7468 656e 7469 6361 7469 6f6e 2e20 authentication. │ │ │ -0017c350: 4f74 6865 7277 6973 652c 2061 6363 6573 Otherwise, acces │ │ │ -0017c360: 7320 6973 2064 656e 6965 6420 6279 2074 s is denied by t │ │ │ -0017c370: 6865 2070 726f 7879 2028 4854 5450 2034 he proxy (HTTP 4 │ │ │ -0017c380: 3037 2065 7272 6f72 292e 2045 7861 6d70 07 error). Examp │ │ │ -0017c390: 6c65 2063 6c69 656e 7420 636f 6465 2066 le client code f │ │ │ -0017c3a0: 7261 676d 656e 7420 746f 2073 6574 2070 ragment to set p │ │ │ -0017c3b0: 726f 7879 2073 6572 7665 722c 2075 7365 roxy server, use │ │ │ -0017c3c0: 726e 616d 652c 2061 6e64 2070 6173 7377 rname, and passw │ │ │ -0017c3d0: 6f72 643a 3c2f 703e 0a3c 6469 7620 636c ord:

.
< │ │ │ -0017c3f0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -0017c400: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >struct soap │ │ │ -0017c450: 3c2f 613e 202a 3c61 2063 6c61 7373 3d22 *soa │ │ │ -0017c480: 703c 2f61 3e20 3d20 3c61 2063 6c61 7373 p = soa │ │ │ -0017c4e0: 705f 6e65 773c 2f61 3e28 293b 203c 2f64 p_new(); .
soa │ │ │ -0017c530: 703c 2f61 3e2d 2667 743b 3c61 2063 6c61 p->proxy_host = │ │ │ -0017c5b0: 2671 756f 743b 7878 2e78 782e 7878 2e78 "xx.xx.xx.x │ │ │ -0017c5c0: 7826 7175 6f74 3b3c 2f73 7061 6e3e 3b20 x"; │ │ │ -0017c5d0: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // IP or d │ │ │ -0017c5f0: 6f6d 6169 6e20 3c2f 7370 616e 3e3c 2f64 omain . │ │ │ -0017c6b0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
soap-> │ │ │ -0017c740: 7072 6f78 795f 7573 6572 6964 3c2f 613e proxy_userid │ │ │ -0017c750: 203d 203c 7370 616e 2063 6c61 7373 3d22 = & │ │ │ -0017c770: 7175 6f74 3b67 7565 7374 2671 756f 743b quot;guest" │ │ │ -0017c780: 3c2f 7370 616e 3e3b 203c 2f64 6976 3e0a ;
. │ │ │ -0017c790: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
soap->p │ │ │ -0017c820: 726f 7879 5f70 6173 7377 643c 2f61 3e20 roxy_passwd │ │ │ -0017c830: 3d20 3c73 7061 6e20 636c 6173 733d 2273 = &q │ │ │ -0017c850: 756f 743b 6775 6573 7426 7175 6f74 3b3c uot;guest"< │ │ │ -0017c860: 2f73 7061 6e3e 3b20 3c2f 6469 763e 0a3c /span>;
.< │ │ │ -0017c870: 2f64 6976 3e3c 212d 2d20 6672 6167 6d65 /div>

A clien │ │ │ -0017c890: 7420 534f 4150 2072 6571 7565 7374 2077 t SOAP request w │ │ │ -0017c8a0: 696c 6c20 6861 7665 2074 6865 2066 6f6c ill have the fol │ │ │ -0017c8b0: 6c6f 7769 6e67 2048 5454 5020 6865 6164 lowing HTTP head │ │ │ -0017c8c0: 6572 3a20 3c2f 703e 3c70 7265 2063 6c61 er:

PO
│ │ │ -0017c8e0: 5354 202f 5858 5820 4854 5450 2f31 2e31  ST /XXX HTTP/1.1
│ │ │ -0017c8f0: 200a 486f 7374 3a20 5959 5920 0a55 7365   .Host: YYY .Use
│ │ │ -0017c900: 722d 4167 656e 743a 2067 534f 4150 2f32  r-Agent: gSOAP/2
│ │ │ -0017c910: 2e38 200a 436f 6e74 656e 742d 5479 7065  .8 .Content-Type
│ │ │ -0017c920: 3a20 7465 7874 2f78 6d6c 3b20 6368 6172  : text/xml; char
│ │ │ -0017c930: 7365 743d 7574 662d 3820 0a43 6f6e 7465  set=utf-8 .Conte
│ │ │ -0017c940: 6e74 2d4c 656e 6774 683a 205a 5a5a 200a  nt-Length: ZZZ .
│ │ │ -0017c950: 5072 6f78 792d 4175 7468 6f72 697a 6174  Proxy-Authorizat
│ │ │ -0017c960: 696f 6e3a 2042 6173 6963 205a 3356 6c63  ion: Basic Z3Vlc
│ │ │ -0017c970: 3351 365a 3356 6c63 3351 3d20 0a3c 2f70  3Q6Z3Vlc3Q= .

When X-Fo │ │ │ -0017c990: 7277 6172 6465 642d 466f 7220 6865 6164 rwarded-For head │ │ │ -0017c9a0: 6572 7320 6172 6520 7265 7475 726e 6564 ers are returned │ │ │ -0017c9b0: 2062 7920 7468 6520 7072 6f78 792c 2074 by the proxy, t │ │ │ -0017c9c0: 6865 2068 6561 6465 7220 6361 6e20 6265 he header can be │ │ │ -0017c9d0: 2061 6363 6573 7365 6420 696e 2074 6865 accessed in the │ │ │ -0017c9e0: 203c 636f 6465 3e3c 6120 636c 6173 733d so │ │ │ -0017ca70: 6170 3a3a 7072 6f78 795f 6672 6f6d 3c2f ap::proxy_from string │ │ │ -0017ca90: 2e3c 2f70 3e0a 3c70 3e54 6865 2043 4f4e .

.

The CON │ │ │ -0017caa0: 4e45 4354 206d 6574 686f 6420 6973 2075 NECT method is u │ │ │ -0017cab0: 7365 6420 666f 7220 4854 5450 2070 726f sed for HTTP pro │ │ │ -0017cac0: 7879 2061 7574 6865 6e74 6963 6174 696f xy authenticatio │ │ │ -0017cad0: 6e3a 203c 2f70 3e3c 7072 6520 636c 6173 n:

CON
│ │ │ -0017caf0: 4e45 4354 2073 6572 7665 722e 6578 616d  NECT server.exam
│ │ │ -0017cb00: 706c 652e 636f 6d3a 3830 2048 5454 502f  ple.com:80 HTTP/
│ │ │ -0017cb10: 312e 310a 3c2f 7072 653e 3c70 3e20 496e  1.1.

In │ │ │ -0017cb20: 2073 6f6d 6520 6361 7365 732c 2079 6f75 some cases, you │ │ │ -0017cb30: 2077 696c 6c20 6e6f 7469 6365 2074 6861 will notice tha │ │ │ -0017cb40: 7420 7468 6520 486f 7374 2048 5454 5020 t the Host HTTP │ │ │ -0017cb50: 6865 6164 6572 2075 7365 7320 7468 6520 header uses the │ │ │ -0017cb60: 434f 4e4e 4543 5420 7072 6f74 6f63 6f6c CONNECT protocol │ │ │ -0017cb70: 3a20 3c2f 703e 3c70 7265 2063 6c61 7373 :

CONN
│ │ │ -0017cb90: 4543 5420 7365 7276 6572 2e65 7861 6d70  ECT server.examp
│ │ │ -0017cba0: 6c65 2e63 6f6d 3a38 3020 4854 5450 2f31  le.com:80 HTTP/1
│ │ │ -0017cbb0: 2e31 200a 486f 7374 3a20 7365 7276 6572  .1 .Host: server
│ │ │ -0017cbc0: 2e65 7861 6d70 6c65 2e63 6f6d 3a38 300a  .example.com:80.
│ │ │ -0017cbd0: 3c2f 7072 653e 3c70 3e20 f09f 949d 203c  

.... < │ │ │ -0017cbe0: 6120 6872 6566 3d22 2322 3e42 6163 6b20 a href="#">Back │ │ │ -0017cbf0: 746f 2074 6162 6c65 206f 6620 636f 6e74 to table of cont │ │ │ -0017cc00: 656e 7473 3c2f 613e 3c2f 703e 0a3c 6832 ents

.

.Performance im │ │ │ -0017cc40: 7072 6f76 656d 656e 7420 7469 7073 3c2f provement tips.

Here are │ │ │ -0017cc60: 736f 6d65 2074 6970 7320 796f 7520 6361 some tips you ca │ │ │ -0017cc70: 6e20 7573 6520 746f 2073 7065 6564 2075 n use to speed u │ │ │ -0017cc80: 7020 6753 4f41 502e 2054 6865 2064 6566 p gSOAP. The def │ │ │ -0017cc90: 6175 6c74 2073 6574 7469 6e67 7320 6172 ault settings ar │ │ │ -0017cca0: 6520 6368 6f73 656e 2074 6f20 6d61 7869 e chosen to maxi │ │ │ -0017ccb0: 6d69 7a65 2070 6f72 7461 6269 6c69 7479 mize portability │ │ │ -0017ccc0: 2061 6e64 2063 6f6d 7061 7469 6269 6c69 and compatibili │ │ │ -0017ccd0: 7479 2e20 5468 6520 7365 7474 696e 6773 ty. The settings │ │ │ -0017cce0: 2063 616e 2062 6520 7477 6561 6b65 6420 can be tweaked │ │ │ -0017ccf0: 746f 206f 7074 696d 697a 6520 7468 6520 to optimize the │ │ │ -0017cd00: 7065 7266 6f72 6d61 6e63 6520 6173 2066 performance as f │ │ │ -0017cd10: 6f6c 6c6f 7773 3a3c 2f70 3e0a 3c75 6c3e ollows:

.

< │ │ │ -0017fac0: 212d 2d20 6672 6167 6d65 6e74 202d 2d3e !-- fragment --> │ │ │ -0017fad0: 3c70 3e57 6865 6e20 6120 7469 6d65 6f75

When a timeou │ │ │ -0017fae0: 7420 6f63 6375 7273 2069 6e20 7468 6520 t occurs in the │ │ │ -0017faf0: 7365 6e64 206f 7220 7265 6365 6976 6520 send or receive │ │ │ -0017fb00: 6f70 6572 6174 696f 6e73 2c20 6120 3c63 operations, a #SOAP_EOF exception w │ │ │ -0017fb30: 696c 6c20 6265 2072 6169 7365 6420 2822 ill be raised (" │ │ │ -0017fb40: 656e 6420 6f66 2066 696c 6520 6f72 206e end of file or n │ │ │ -0017fb50: 6f20 696e 7075 7422 292e 204e 6567 6174 o input"). Negat │ │ │ -0017fb60: 6976 6520 7469 6d65 6f75 7420 7661 6c75 ive timeout valu │ │ │ -0017fb70: 6573 206d 6561 7375 7265 2074 696d 656f es measure timeo │ │ │ -0017fb80: 7574 7320 696e 206d 6963 726f 7365 636f uts in microseco │ │ │ -0017fb90: 6e64 732c 2066 6f72 2065 7861 6d70 6c65 nds, for example │ │ │ -0017fba0: 3a3c 2f70 3e0a 3c64 6976 2063 6c61 7373 :

.
#define │ │ │ -0017fbf0: 2075 5365 6320 2a2d 3120 3c2f 7370 616e uSec *-1
.
#define mSe │ │ │ -0017fc40: 6320 2a2d 3130 3030 203c 2f73 7061 6e3e c *-1000 │ │ │ -0017fc50: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ -0017fc70: 0a3c 6469 7620 636c 6173 733d 226c 696e .
struct │ │ │ -0017fca0: 3c2f 7370 616e 3e3c 6120 636c 6173 733d so │ │ │ -0017fcd0: 6170 3c2f 613e 202a 3c61 2063 6c61 7373 ap *s │ │ │ -0017fd00: 6f61 703c 2f61 3e20 3d20 3c61 2063 6c61 oap = s │ │ │ -0017fd60: 6f61 705f 6e65 773c 2f61 3e28 293b 203c oap_new(); < │ │ │ -0017fd70: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>..
soap-> │ │ │ -0017fe70: 3c61 2063 6c61 7373 3d22 636f 6465 2220 send_ti │ │ │ -0017fec0: 6d65 6f75 743c 2f61 3e20 3d20 3230 206d meout = 20 m │ │ │ -0017fed0: 5365 633b 203c 2f64 6976 3e0a 3c64 6976 Sec;
.
soap-&g │ │ │ -0017ff20: 743b 3c61 2063 6c61 7373 3d22 636f 6465 t;recv_ │ │ │ -0017ff70: 7469 6d65 6f75 743c 2f61 3e20 3d20 3230 timeout = 20 │ │ │ -0017ff80: 206d 5365 633b 203c 2f64 6976 3e0a 3c64 mSec;
. │ │ │ -0017ffa0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap- │ │ │ -0017ffd0: 2667 743b 3c61 2063 6c61 7373 3d22 636f >rec │ │ │ -00180020: 765f 7469 6d65 6f75 743c 2f61 3e20 3d20 v_timeout = │ │ │ -00180030: 3130 3b3c 2f64 6976 3e0a 3c2f 6469 763e 10;
.
│ │ │ -00180040: 3c21 2d2d 2066 7261 676d 656e 7420 2d2d

.... < │ │ │ -00182180: 6120 6872 6566 3d22 2322 3e42 6163 6b20 a href="#">Back │ │ │ -00182190: 746f 2074 6162 6c65 206f 6620 636f 6e74 to table of cont │ │ │ -001821a0: 656e 7473 3c2f 613e 3c2f 703e 0a3c 6832 ents

.

.Ove │ │ │ -001821e0: 7272 6964 696e 6720 7468 6520 686f 7374 rriding the host │ │ │ -001821f0: 2061 6e64 2070 6f72 7420 746f 2063 6f6e and port to con │ │ │ -00182200: 6e65 6374 3c2f 6832 3e0a 3c70 3e54 6f20 nect

.

To │ │ │ -00182210: 6f76 6572 7269 6465 2074 6865 2068 6f73 override the hos │ │ │ -00182220: 7420 616e 6420 706f 7274 206f 6620 7468 t and port of th │ │ │ -00182230: 6520 636c 6965 6e74 2063 6f6e 6e65 6374 e client connect │ │ │ -00182240: 696e 6720 746f 2061 2073 6572 7665 722c ing to a server, │ │ │ -00182250: 2073 6574 203c 636f 6465 3e3c 6120 636c set soap::overrid │ │ │ -00182320: 655f 686f 7374 3c2f 613e 3c2f 636f 6465 e_host and soap::overri │ │ │ -00182400: 6465 5f70 6f72 743c 2f61 3e3c 2f63 6f64 de_port:

.
│ │ │ -00182440: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap- │ │ │ -00182470: 2667 743b 3c61 2063 6c61 7373 3d22 636f >ove │ │ │ -001824c0: 7272 6964 655f 686f 7374 3c2f 613e 203d rride_host = │ │ │ -001824d0: 203c 7370 616e 2063 6c61 7373 3d22 7374 &qu │ │ │ -001824f0: 6f74 3b65 7861 6d70 6c65 2e63 6f6d 2671 ot;example.com&q │ │ │ -00182500: 756f 743b 3c2f 7370 616e 3e3b 203c 7370 uot;; // host name │ │ │ -00182530: 6f72 2049 5020 6164 6472 6573 7320 3c2f or IP address
.
soap-&g │ │ │ -00182590: 743b 3c61 2063 6c61 7373 3d22 636f 6465 t;overr │ │ │ -001825e0: 6964 655f 706f 7274 3c2f 613e 203d 2038 ide_port = 8 │ │ │ -001825f0: 303b 2020 2020 2020 2020 2020 2020 3c73 0; // port numb │ │ │ -00182620: 6572 2074 6f20 7573 6520 7768 656e 206f er to use when o │ │ │ -00182630: 7665 7272 6964 696e 6720 7468 6520 6164 verriding the ad │ │ │ -00182640: 6472 6573 733c 2f73 7061 6e3e 3c2f 6469 dress.Definition:< │ │ │ -001827e0: 2f62 3e20 7374 6473 6f61 7032 2e68 3a34 /b> stdsoap2.h:4 │ │ │ -001827f0: 3035 343c 2f64 6976 3e3c 2f64 6976 3e0a 054
. │ │ │ -00182800: 3c64 6976 2063 6c61 7373 3d22 7474 6322
soap::o │ │ │ -001828a0: 7665 7272 6964 655f 706f 7274 3c2f 613e verride_port │ │ │ -001828b0: 3c2f 6469 763e 3c64 6976 2063 6c61 7373
int ov │ │ │ -001828d0: 6572 7269 6465 5f70 6f72 743c 2f64 6976 erride_port
User-definab │ │ │ -00182900: 6c65 2070 6f72 7420 6e75 6d62 6572 2074 le port number t │ │ │ -00182910: 6f20 6f76 6572 7269 6465 2074 6865 2070 o override the p │ │ │ -00182920: 6f72 7420 6164 6472 6573 7320 696e 2074 ort address in t │ │ │ -00182930: 6865 2048 5454 5020 6865 6164 6572 2077 he HTTP header w │ │ │ -00182940: 6865 6e20 636f 6e6e 6563 7469 6e67 2061 hen connecting a │ │ │ -00182950: 7420 7468 6520 636c 692e 2e2e 3c2f 6469 t the cli...
Definiti │ │ │ -00182980: 6f6e 3a3c 2f62 3e20 7374 6473 6f61 7032 on: stdsoap2 │ │ │ -00182990: 2e68 3a34 3035 393c 2f64 6976 3e3c 2f64 .h:4059
.

.. │ │ │ -001829c0: 949d 203c 6120 6872 6566 3d22 2322 3e42 .. B │ │ │ -001829d0: 6163 6b20 746f 2074 6162 6c65 206f 6620 ack to table of │ │ │ -001829e0: 636f 6e74 656e 7473 3c2f 613e 3c2f 703e contents

│ │ │ -001829f0: 0a3c 6832 3e3c 6120 636c 6173 733d 2261 .

.S │ │ │ -00182a20: 6563 7572 6520 5765 6220 7365 7276 6963 ecure Web servic │ │ │ -00182a30: 6573 2077 6974 6820 4854 5450 533c 2f68 es with HTTPS.

To enable │ │ │ -00182a50: 5353 4c20 666f 7220 7374 616e 642d 616c SSL for stand-al │ │ │ -00182a60: 6f6e 6520 6753 4f41 5020 5765 6220 7365 one gSOAP Web se │ │ │ -00182a70: 7276 6572 732c 2066 6972 7374 2069 6e73 rvers, first ins │ │ │ -00182a80: 7461 6c6c 204f 7065 6e53 534c 2061 6e64 tall OpenSSL and │ │ │ -00182a90: 2075 7365 206f 7074 696f 6e20 7468 6520 use option the │ │ │ -00182aa0: 636f 6d70 696c 652d 7469 6d65 2066 6c61 compile-time fla │ │ │ -00182ab0: 6720 3c63 6f64 653e 2357 4954 485f 4f50 g #WITH_OP │ │ │ -00182ac0: 454e 5353 4c3c 2f63 6f64 653e 2074 6f20 ENSSL to │ │ │ -00182ad0: 636f 6d70 696c 6520 7468 6520 736f 7572 compile the sour │ │ │ -00182ae0: 6365 7320 7769 7468 2079 6f75 7220 4320 ces with your C │ │ │ -00182af0: 6f72 2043 2b2b 2063 6f6d 7069 6c65 7220 or C++ compiler │ │ │ -00182b00: 286f 7220 7573 6520 7468 6520 636f 6d70 (or use the comp │ │ │ -00182b10: 696c 652d 7469 6d65 2066 6c61 6720 3c63 ile-time flag #WITH_GNUTLS │ │ │ -00182b30: 3c2f 636f 6465 3e20 6966 2079 6f75 2070 if you p │ │ │ -00182b40: 7265 6665 7220 474e 5554 4c53 292c 2066 refer GNUTLS), f │ │ │ -00182b50: 6f72 2065 7861 6d70 6c65 3a20 3c2f 703e or example:

│ │ │ -00182b60: 3c70 7265 2063 6c61 7373 3d22 6672 6167
 c++ -DWIT
│ │ │ -00182b80: 485f 4f50 454e 5353 4c20 2d6f 206d 7970  H_OPENSSL -o myp
│ │ │ -00182b90: 726f 6720 6d79 7072 6f67 2e63 7070 2073  rog myprog.cpp s
│ │ │ -00182ba0: 7464 736f 6170 322e 6370 7020 736f 6170  tdsoap2.cpp soap
│ │ │ -00182bb0: 432e 6370 7020 736f 6170 5365 7276 6572  C.cpp soapServer
│ │ │ -00182bc0: 2e63 7070 202d 6c73 736c 202d 6c63 7279  .cpp -lssl -lcry
│ │ │ -00182bd0: 7074 6f0a 3c2f 7072 653e 3c70 3e20 5769  pto.

Wi │ │ │ -00182be0: 7468 2047 4e55 544c 533a 203c 2f70 3e3c th GNUTLS:

< │ │ │ -00182bf0: 7072 6520 636c 6173 733d 2266 7261 676d pre class="fragm │ │ │ -00182c00: 656e 7422 3e20 632b 2b20 2d44 5749 5448 ent"> c++ -DWITH │ │ │ -00182c10: 5f47 4e55 544c 5320 2d6f 206d 7970 726f _GNUTLS -o mypro │ │ │ -00182c20: 6720 6d79 7072 6f67 2e63 7070 2073 7464 g myprog.cpp std │ │ │ -00182c30: 736f 6170 322e 6370 7020 736f 6170 432e soap2.cpp soapC. │ │ │ -00182c40: 6370 7020 736f 6170 5365 7276 6572 2e63 cpp soapServer.c │ │ │ -00182c50: 7070 202d 6c67 6e75 746c 7320 2d6c 6763 pp -lgnutls -lgc │ │ │ -00182c60: 7279 7074 202d 6c67 7067 2d65 7272 6f72 rypt -lgpg-error │ │ │ -00182c70: 0a3c 2f70 7265 3e3c 703e 2053 534c 2073 .

SSL s │ │ │ -00182c80: 7570 706f 7274 2066 6f72 2073 7461 6e64 upport for stand │ │ │ -00182c90: 2d61 6c6f 6e65 2067 534f 4150 2057 6562 -alone gSOAP Web │ │ │ -00182ca0: 2073 6572 7669 6365 7320 6973 2065 6e61 services is ena │ │ │ -00182cb0: 626c 6564 2062 7920 6361 6c6c 696e 6720 bled by calling │ │ │ -00182cc0: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 soap_ssl │ │ │ -00182d40: 5f61 6363 6570 743c 2f61 3e3c 2f63 6f64 _accept to perform th │ │ │ -00182d60: 6520 5353 4c2f 544c 5320 6861 6e64 7368 e SSL/TLS handsh │ │ │ -00182d70: 616b 6520 6166 7465 7220 3c63 6f64 653e ake after │ │ │ -00182d80: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap_ac │ │ │ -00182e00: 6365 7074 3c2f 613e 3c2f 636f 6465 3e2e cept. │ │ │ -00182e10: 2049 6e20 6164 6469 7469 6f6e 2c20 6120 In addition, a │ │ │ -00182e20: 6b65 7920 6669 6c65 2c20 6120 4341 2066 key file, a CA f │ │ │ -00182e30: 696c 6520 286f 7220 7061 7468 2074 6f20 ile (or path to │ │ │ -00182e40: 6365 7274 6966 6963 6174 6573 292c 2044 certificates), D │ │ │ -00182e50: 4820 6669 6c65 2028 6966 2052 5341 2069 H file (if RSA i │ │ │ -00182e60: 7320 6e6f 7420 7573 6564 292c 2061 6e64 s not used), and │ │ │ -00182e70: 2070 6173 7377 6f72 6420 6e65 6564 2074 password need t │ │ │ -00182e80: 6f20 6265 2073 7570 706c 6965 642e 2049 o be supplied. I │ │ │ -00182e90: 6e73 7472 7563 7469 6f6e 7320 6f6e 2068 nstructions on h │ │ │ -00182ea0: 6f77 2074 6f20 646f 2074 6869 7320 6361 ow to do this ca │ │ │ -00182eb0: 6e20 6265 2066 6f75 6e64 2069 6e20 7468 n be found in th │ │ │ -00182ec0: 6520 4f70 656e 5353 4c20 646f 6375 6d65 e OpenSSL docume │ │ │ -00182ed0: 6e74 6174 696f 6e20 3c61 2068 7265 663d ntation http:// │ │ │ -00182f00: 7777 772e 6f70 656e 7373 6c2e 6f72 673c www.openssl.org< │ │ │ -00182f10: 2f61 3e2e 2053 6565 2061 6c73 6f20 5365 /a>. See also Se │ │ │ -00182f20: 6374 696f 6e20 3c61 2063 6c61 7373 3d22 ction SSL ce │ │ │ -00182f50: 7274 6966 6963 6174 6573 2061 6e64 206b rtificates and k │ │ │ -00182f60: 6579 2066 696c 6573 3c2f 613e 202e 3c2f ey files ..

Let's take │ │ │ -00182f80: 2061 206c 6f6f 6b20 6174 2061 6e20 6578 a look at an ex │ │ │ -00182f90: 616d 706c 6520 5353 4c20 7365 6375 7265 ample SSL secure │ │ │ -00182fa0: 206d 756c 7469 2d74 6872 6561 6465 6420 multi-threaded │ │ │ -00182fb0: 7374 616e 642d 616c 6f6e 6520 534f 4150 stand-alone SOAP │ │ │ -00182fc0: 2057 6562 2053 6572 7669 6365 3a3c 2f70 Web Service:

.
int m │ │ │ -00183020: 6169 6e28 2920 3c2f 6469 763e 0a3c 6469 ain()
.{ │ │ │ -00183040: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
SOA │ │ │ -001830b0: 505f 534f 434b 4554 3c2f 613e 206d 2c20 P_SOCKET m, │ │ │ -001830c0: 733b 203c 2f64 6976 3e0a 3c64 6976 2063 s;
..< │ │ │ -00183150: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -00183160: 3e20 203c 7370 616e 2063 6c61 7373 3d22 > struct │ │ │ -00183180: 3c2f 7370 616e 3e3c 6120 636c 6173 733d so │ │ │ -001831b0: 6170 3c2f 613e 202a 3c61 2063 6c61 7373 ap *soap, *tsoa │ │ │ -00183210: 703b 203c 2f64 6976 3e0a 3c64 6976 2063 p;

.
s │ │ │ -00183280: 6f61 705f 7373 6c5f 696e 6974 3c2f 613e oap_ssl_init │ │ │ -00183290: 2829 3b20 3c73 7061 6e20 636c 6173 733d (); /* ini │ │ │ -001832b0: 7420 4f70 656e 5353 4c20 2873 6b69 7070 t OpenSSL (skipp │ │ │ -001832c0: 696e 6720 7468 6973 206f 7220 6361 6c6c ing this or call │ │ │ -001832d0: 696e 6720 6d75 6c74 6970 6c65 2074 696d ing multiple tim │ │ │ -001832e0: 6573 2069 7320 4f4b 2c20 7369 6e63 6520 es is OK, since │ │ │ -001832f0: 7468 6520 656e 6769 6e65 2077 696c 6c20 the engine will │ │ │ -00183300: 696e 6974 2053 534c 2061 7574 6f6d 6174 init SSL automat │ │ │ -00183310: 6963 616c 6c79 2920 2a2f 3c2f 7370 616e ically) */
.
/* soap_ssl_no │ │ │ -00183360: 696e 6974 2829 3b20 2a2f 3c2f 7370 616e init(); */ /* do no │ │ │ -00183390: 7420 696e 6974 204f 7065 6e53 534c 2028 t init OpenSSL ( │ │ │ -001833a0: 6966 2053 534c 2069 7320 616c 7265 6164 if SSL is alread │ │ │ -001833b0: 7920 696e 6974 6961 6c69 7a65 6420 656c y initialized el │ │ │ -001833c0: 7365 7768 6572 6520 696e 2074 6869 7320 sewhere in this │ │ │ -001833d0: 6170 706c 6963 6174 696f 6e29 202a 2f3c application) */< │ │ │ -001833e0: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
. │ │ │ -00183400: 203c 7370 616e 2063 6c61 7373 3d22 6b65 if
(CRYPTO_th │ │ │ -00183480: 7265 6164 5f73 6574 7570 3c2f 613e 2829 read_setup() │ │ │ -00183490: 2920 3c73 7061 6e20 636c 6173 733d 2263 ) /* OpenS │ │ │ -001834b0: 534c 2074 6872 6561 6420 6d75 7465 7820 SL thread mutex │ │ │ -001834c0: 7365 7475 7020 2a2f 3c2f 7370 616e 3e3c setup */< │ │ │ -001834d0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
{
.
fprintf( │ │ │ -00183510: 7374 6465 7272 2c20 3c73 7061 6e20 636c stderr, "Cannot │ │ │ -00183540: 2073 6574 7570 2074 6872 6561 6420 6d75 setup thread mu │ │ │ -00183550: 7465 785c 6e26 7175 6f74 3b3c 2f73 7061 tex\n");
.
│ │ │ -00183580: 2020 6578 6974 2845 5849 545f 4641 494c exit(EXIT_FAIL │ │ │ -00183590: 5552 4529 3b20 3c2f 6469 763e 0a3c 6469 URE);
. │ │ │ -001835b0: 207d 203c 2f64 6976 3e0a 3c64 6976 2063 }

.
soap = │ │ │ -00183600: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap_new();
.
│ │ │ -00183680: 3c73 7061 6e20 636c 6173 733d 226b 6579 if (soap_ssl_s │ │ │ -00183700: 6572 7665 725f 636f 6e74 6578 743c 2f61 erver_context(soap,
.
│ │ │ -00183760: 3c61 2063 6c61 7373 3d22 636f 6465 2220 SOAP_SSL_DEFAUL │ │ │ -001837c0: 543c 2f61 3e2c 203c 2f64 6976 3e0a 3c64 T,
. │ │ │ -001837e0: 2020 2020 3c73 7061 6e20 636c 6173 733d │ │ │ -00183800: 2671 756f 743b 7365 7276 6572 2e70 656d "server.pem │ │ │ -00183810: 2671 756f 743b 3c2f 7370 616e 3e2c 2020 ", │ │ │ -00183820: 2020 2020 3c73 7061 6e20 636c 6173 733d /* key │ │ │ -00183840: 6669 6c65 3a20 7265 7175 6972 6564 2077 file: required w │ │ │ -00183850: 6865 6e20 7365 7276 6572 206d 7573 7420 hen server must │ │ │ -00183860: 6175 7468 656e 7469 6361 7465 2074 6f20 authenticate to │ │ │ -00183870: 636c 6965 6e74 7320 2873 6565 2053 534c clients (see SSL │ │ │ -00183880: 2064 6f63 7320 6f6e 2068 6f77 2074 6f20 docs on how to │ │ │ -00183890: 6f62 7461 696e 2074 6869 7320 6669 6c65 obtain this file │ │ │ -001838a0: 2920 2a2f 3c2f 7370 616e 3e20 3c2f 6469 ) */ .
"passw │ │ │ -001838f0: 6f72 6426 7175 6f74 3b3c 2f73 7061 6e3e ord" │ │ │ -00183900: 2c20 2020 2020 2020 203c 7370 616e 2063 , / │ │ │ -00183920: 2a20 7061 7373 776f 7264 2074 6f20 7265 * password to re │ │ │ -00183930: 6164 2074 6865 206b 6579 2066 696c 6520 ad the key file │ │ │ -00183940: 286e 6f74 2075 7365 6420 7769 7468 2047 (not used with G │ │ │ -00183950: 4e55 544c 5329 202a 2f3c 2f73 7061 6e3e NUTLS) */ │ │ │ -00183960: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
" │ │ │ -001839a0: 6361 6365 7274 2e70 656d 2671 756f 743b cacert.pem" │ │ │ -001839b0: 3c2f 7370 616e 3e2c 2020 2020 2020 3c73 , /* optional │ │ │ -001839e0: 6361 6365 7274 2066 696c 6520 746f 2073 cacert file to s │ │ │ -001839f0: 746f 7265 2074 7275 7374 6564 2063 6572 tore trusted cer │ │ │ -00183a00: 7469 6669 6361 7465 7320 2a2f 3c2f 7370 tificates */
.
│ │ │ -00183a30: 204e 554c 4c2c 2020 2020 2020 2020 2020 NULL, │ │ │ -00183a40: 2020 2020 3c73 7061 6e20 636c 6173 733d /* opt │ │ │ -00183a60: 696f 6e61 6c20 6361 7061 7468 2074 6f20 ional capath to │ │ │ -00183a70: 6469 7265 6374 6f72 7920 7769 7468 2074 directory with t │ │ │ -00183a80: 7275 7374 6564 2063 6572 7469 6669 6361 rusted certifica │ │ │ -00183a90: 7465 7320 2a2f 3c2f 7370 616e 3e20 3c2f tes */ .
"dh5 │ │ │ -00183ae0: 3132 2e70 656d 2671 756f 743b 3c2f 7370 12.pem", /* DH file name │ │ │ -00183b20: 206f 7220 4448 206b 6579 206c 656e 2062 or DH key len b │ │ │ -00183b30: 6974 7320 286d 696e 696d 756d 2069 7320 its (minimum is │ │ │ -00183b40: 3531 322c 2065 2e67 2e20 2671 756f 743b 512, e.g. " │ │ │ -00183b50: 3531 3226 7175 6f74 3b29 2074 6f20 6765 512") to ge │ │ │ -00183b60: 6e65 7261 7465 2044 4820 7061 7261 6d2c nerate DH param, │ │ │ -00183b70: 2069 6620 4e55 4c4c 2075 7365 2052 5341 if NULL use RSA │ │ │ -00183b80: 202a 2f3c 2f73 7061 6e3e 203c 2f64 6976 */
.
NULL, │ │ │ -00183bb0: 2020 2020 2020 2020 2020 203c 7370 616e /* if randfile! │ │ │ -00183be0: 3d4e 554c 4c3a 2075 7365 2061 2066 696c =NULL: use a fil │ │ │ -00183bf0: 6520 7769 7468 2072 616e 646f 6d20 6461 e with random da │ │ │ -00183c00: 7461 2074 6f20 7365 6564 2072 616e 646f ta to seed rando │ │ │ -00183c10: 6d6e 6573 7320 2a2f 3c2f 7370 616e 3e20 mness */ │ │ │ -00183c20: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
NU │ │ │ -00183c40: 4c4c 2020 2020 2020 2020 2020 2020 2020 LL │ │ │ -00183c50: 203c 7370 616e 2063 6c61 7373 3d22 636f /* option │ │ │ -00183c70: 616c 2073 6572 7665 7220 6964 656e 7469 al server identi │ │ │ -00183c80: 6669 6361 7469 6f6e 2074 6f20 656e 6162 fication to enab │ │ │ -00183c90: 6c65 2053 534c 2073 6573 7369 6f6e 2063 le SSL session c │ │ │ -00183ca0: 6163 6869 6e67 2074 6f20 7370 6565 6420 aching to speed │ │ │ -00183cb0: 7570 2054 4c53 2028 6d75 7374 2062 6520 up TLS (must be │ │ │ -00183cc0: 6120 756e 6971 7565 206e 616d 6529 202a a unique name) * │ │ │ -00183cd0: 2f3c 2f73 7061 6e3e 3c2f 6469 763e 0a3c /
.< │ │ │ -00183ce0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -00183cf0: 3e20 2029 2920 3c2f 6469 763e 0a3c 6469 > ))
. │ │ │ -00183d10: 207b 3c2f 6469 763e 0a3c 6469 7620 636c {
.
< │ │ │ -00183d30: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -00183d40: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ -00183d50: 705f 5f66 6175 6c74 2e68 746d 6c23 6761 p__fault.html#ga │ │ │ -00183d60: 3933 3161 3461 6236 6466 3235 3533 6234 931a4ab6df2553b4 │ │ │ -00183d70: 3861 3063 3237 3066 3861 3061 3838 6166 8a0c270f8a0a88af │ │ │ -00183d80: 223e 736f 6170 5f70 7269 6e74 5f66 6175 ">soap_print_fau │ │ │ -00183d90: 6c74 3c2f 613e 283c 6120 636c 6173 733d lt(so │ │ │ -00183dc0: 6170 3c2f 613e 2c20 7374 6465 7272 293b ap, stderr); │ │ │ -00183dd0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
ex │ │ │ -00183df0: 6974 2845 5849 545f 4641 494c 5552 4529 it(EXIT_FAILURE) │ │ │ -00183e00: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
} < │ │ │ -00183e20: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
m = so │ │ │ -00183e90: 6170 5f62 696e 643c 2f61 3e28 3c61 2063 ap_bind(soap, NUL │ │ │ -00183ed0: 4c2c 2031 3830 3030 2c20 4241 434b 4c4f L, 18000, BACKLO │ │ │ -00183ee0: 4729 3b20 3c73 7061 6e20 636c 6173 733d G); /* use │ │ │ -00183f00: 2070 6f72 7420 3138 3030 3020 2a2f 3c2f port 18000 */
.
│ │ │ -00183f30: 3c73 7061 6e20 636c 6173 733d 226b 6579 if (!soap_val │ │ │ -00183fb0: 6964 5f73 6f63 6b65 743c 2f61 3e28 6d29 id_socket(m) │ │ │ -00183fc0: 2920 3c2f 6469 763e 0a3c 6469 7620 636c )
.
{.
so │ │ │ -00184050: 6170 5f70 7269 6e74 5f66 6175 6c74 3c2f ap_print_fault(soap, stderr); .
exit(E │ │ │ -001840c0: 5849 545f 4641 494c 5552 4529 3b20 3c2f XIT_FAILURE); .
}
.
fprintf(st │ │ │ -00184110: 6465 7272 2c20 3c73 7061 6e20 636c 6173 derr, "Socket c │ │ │ -00184140: 6f6e 6e65 6374 696f 6e20 7375 6363 6573 onnection succes │ │ │ -00184150: 7366 756c 3a20 6d61 7374 6572 2073 6f63 sful: master soc │ │ │ -00184160: 6b65 7420 3d20 2564 5c6e 2671 756f 743b ket = %d\n" │ │ │ -00184170: 3c2f 7370 616e 3e2c 206d 293b 203c 2f64 , m); .
while ( │ │ │ -001841c0: 3129 3c2f 6469 763e 0a3c 6469 7620 636c 1)
.
{..
fp │ │ │ -001842b0: 7269 6e74 6628 7374 6465 7272 2c20 3c73 rintf(stderr, " │ │ │ -001842e0: 536f 636b 6574 2063 6f6e 6e65 6374 696f Socket connectio │ │ │ -001842f0: 6e20 7375 6363 6573 7366 756c 3a20 736c n successful: sl │ │ │ -00184300: 6176 6520 736f 636b 6574 203d 2025 645c ave socket = %d\ │ │ │ -00184310: 6e26 7175 6f74 3b3c 2f73 7061 6e3e 2c20 n", │ │ │ -00184320: 7329 3b20 3c2f 6469 763e 0a3c 6469 7620 s);
.
│ │ │ -00184340: 203c 7370 616e 2063 6c61 7373 3d22 6b65 if (!soap_va │ │ │ -001843c0: 6c69 645f 736f 636b 6574 3c2f 613e 2873 lid_socket(s │ │ │ -001843d0: 2929 203c 2f64 6976 3e0a 3c64 6976 2063 ))
.
│ │ │ -001843f0: 7b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 {
.
│ │ │ -00184410: 3c73 7061 6e20 636c 6173 733d 226b 6579 if (soap │ │ │ -00184460: 3c2f 613e 2d26 6774 3b3c 6120 636c 6173 ->errnum) /* accept fa │ │ │ -001844e0: 696c 6564 2c20 7472 7920 6167 6169 6e20 iled, try again │ │ │ -001844f0: 6166 7465 7220 3120 7365 636f 6e64 202a after 1 second * │ │ │ -00184500: 2f3c 2f73 7061 6e3e 3c2f 6469 763e 0a3c /
.< │ │ │ -00184510: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -00184520: 3e20 2020 2020 207b 3c2f 6469 763e 0a3c > {
.< │ │ │ -00184530: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -00184540: 3e20 2020 2020 2020 203c 6120 636c 6173 > soap │ │ │ -001845a0: 5f70 7269 6e74 5f66 6175 6c74 3c2f 613e _print_fault │ │ │ -001845b0: 283c 6120 636c 6173 733d 2263 6f64 6522 (soap │ │ │ -001845e0: 2c20 7374 6465 7272 293b 203c 2f64 6976 , stderr);
.
slee │ │ │ -00184610: 7028 3129 3b3c 2f64 6976 3e0a 3c64 6976 p(1);
.
│ │ │ -00184630: 2020 2020 2020 3c73 7061 6e20 636c 6173 │ │ │ -00184650: 636f 6e74 696e 7565 3c2f 7370 616e 3e3b continue; │ │ │ -00184660: 203c 7370 616e 2063 6c61 7373 3d22 636f /* retry │ │ │ -00184680: 2a2f 3c2f 7370 616e 3e3c 2f64 6976 3e0a */
. │ │ │ -00184690: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
}
. │ │ │ -001846b0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
fprintf( │ │ │ -001846d0: 7374 6465 7272 2c20 3c73 7061 6e20 636c stderr, "Server │ │ │ -00184700: 2074 696d 6564 206f 7574 5c6e 2671 756f timed out\n&quo │ │ │ -00184710: 743b 3c2f 7370 616e 3e29 3b3c 2f64 6976 t;);
.
break │ │ │ -00184760: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
} │ │ │ -00184780: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
. │ │ │ -00184840: 0a3c 6469 7620 636c 6173 733d 226c 696e .
if (!tso │ │ │ -00184880: 6170 2920 3c2f 6469 763e 0a3c 6469 7620 ap)
.
│ │ │ -001848a0: 2020 203c 6120 636c 6173 733d 2263 6f64 soap_force_cl │ │ │ -00184900: 6f73 6573 6f63 6b3c 2f61 3e28 3c61 2063 osesock(soap);.
else< │ │ │ -00184980: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
while (THREA │ │ │ -00184a20: 445f 4352 4541 5445 3c2f 613e 2826 616d D_CREATE(&am │ │ │ -00184a30: 703b 7469 642c 2028 3c73 7061 6e20 636c p;tid, (void*(* │ │ │ -00184a60: 2928 3c73 7061 6e20 636c 6173 733d 226b )(void │ │ │ -00184a80: 3c2f 7370 616e 3e2a 2929 2661 6d70 3b70 *))&p │ │ │ -00184a90: 726f 6365 7373 5f72 6571 7565 7374 2c20 rocess_request, │ │ │ -00184aa0: 283c 7370 616e 2063 6c61 7373 3d22 6b65 (void< │ │ │ -00184ac0: 2f73 7061 6e3e 2a29 7473 6f61 7029 293c /span>*)tsoap))< │ │ │ -00184ad0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ -00184af0: 736c 6565 7028 3129 3b20 3c73 7061 6e20 sleep(1); │ │ │ -00184b10: 2f2a 2066 6169 6c65 642c 2074 7279 2061 /* failed, try a │ │ │ -00184b20: 6761 696e 202a 2f3c 2f73 7061 6e3e 3c2f gain */.
}
.
soap_ │ │ │ -00184bc0: 6672 6565 3c2f 613e 283c 6120 636c 6173 free( │ │ │ -00184bf0: 736f 6170 3c2f 613e 293b 203c 7370 616e soap); /* deallocates │ │ │ -00184c20: 5353 4c20 636f 6e74 6578 7420 2a2f 3c2f SSL context */
.
│ │ │ -00184c50: 3c61 2063 6c61 7373 3d22 636f 6465 2220 CRYPTO_thread_c │ │ │ -00184cb0: 6c65 616e 7570 3c2f 613e 2829 3b20 3c73 leanup(); /* OpenSSL t │ │ │ -00184ce0: 6872 6561 6420 6d75 7465 7820 636c 6561 hread mutex clea │ │ │ -00184cf0: 6e75 7020 2a2f 3c2f 7370 616e 3e3c 2f64 nup */.
return │ │ │ -00184d40: 303b 203c 2f64 6976 3e0a 3c64 6976 2063 0;
.
} < │ │ │ -00184d60: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
. │ │ │ -00184d80: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
void │ │ │ -00184db0: 3c2f 7370 616e 3e20 2a70 726f 6365 7373 *process │ │ │ -00184dc0: 5f72 6571 7565 7374 283c 7370 616e 2063 _request(void * │ │ │ -00184df0: 7473 6f61 7029 203c 2f64 6976 3e0a 3c64 tsoap)
. │ │ │ -00184e10: 7b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 {
.
struct │ │ │ -00184e50: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap │ │ │ -00184e80: 2a3c 6120 636c 6173 733d 2263 6f64 6522 *soap │ │ │ -00184eb0: 203d 2028 3c73 7061 6e20 636c 6173 733d = (struct │ │ │ -00184ed0: 203c 2f73 7061 6e3e 3c61 2063 6c61 7373 s │ │ │ -00184f00: 6f61 703c 2f61 3e2a 2974 736f 6170 3b3c oap*)tsoap;< │ │ │ -00184f10: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.. │ │ │ -00185010: 203c 7370 616e 2063 6c61 7373 3d22 6b65 if (soap_ssl_ │ │ │ -00185090: 6163 6365 7074 3c2f 613e 283c 6120 636c accept(soap)) .
soa │ │ │ -00185140: 705f 7072 696e 745f 6661 756c 743c 2f61 p_print_fault(soap, stderr); .
else ..
soap_ │ │ │ -001852f0: 6465 7374 726f 793c 2f61 3e28 3c61 2063 destroy(soap); .
so │ │ │ -001853a0: 6170 5f65 6e64 3c2f 613e 283c 6120 636c ap_end(soap); .
soa │ │ │ -00185450: 705f 6672 6565 3c2f 613e 283c 6120 636c p_free(soap);.
return N │ │ │ -001854d0: 554c 4c3b 203c 2f64 6976 3e0a 3c64 6976 ULL;
.
}< │ │ │ -001854f0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ -001855c0: 3c64 6976 2063 6c61 7373 3d22 7474 6465
int soap_ssl │ │ │ -001855e0: 5f73 6572 7665 725f 636f 6e74 6578 7428 _server_context( │ │ │ -001855f0: 7374 7275 6374 2073 6f61 7020 2a73 6f61 struct soap *soa │ │ │ -00185600: 702c 2073 6f61 705f 7373 6c5f 666c 6167 p, soap_ssl_flag │ │ │ -00185610: 7320 666c 6167 732c 2063 6f6e 7374 2063 s flags, const c │ │ │ -00185620: 6861 7220 2a6b 6579 6669 6c65 2c20 636f har *keyfile, co │ │ │ -00185630: 6e73 7420 6368 6172 202a 7061 7373 776f nst char *passwo │ │ │ -00185640: 7264 2c20 636f 6e73 7420 6368 6172 202a rd, const char * │ │ │ -00185650: 6361 6669 6c65 2c20 636f 6e73 7420 6368 cafile, const ch │ │ │ -00185660: 6172 202a 6361 7061 7468 2c20 636f 6e73 ar *capath, cons │ │ │ -00185670: 7420 6368 6172 202a 6468 6669 6c65 2c20 t char *dhfile, │ │ │ -00185680: 636f 6e73 7420 6368 6172 202a 7261 6e64 const char *rand │ │ │ -00185690: 6669 6c65 2c20 636f 6e73 7420 6368 6172 file, const char │ │ │ -001856a0: 202a 7369 6429 3c2f 6469 763e 3c64 6976 *sid)
I │ │ │ -001856c0: 6e69 7469 616c 697a 6520 7468 6520 7365 nitialize the se │ │ │ -001856d0: 7276 6572 2d73 6964 6520 5353 4c2f 544c rver-side SSL/TL │ │ │ -001856e0: 5320 636f 6e74 6578 742e 3c2f 6469 763e S context.
│ │ │ -001856f0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
void │ │ │ -001857d0: 736f 6170 5f73 736c 5f69 6e69 7428 766f soap_ssl_init(vo │ │ │ -001857e0: 6964 293c 2f64 6976 3e3c 6469 7620 636c id)
Init │ │ │ -00185800: 6961 6c69 7a65 2074 6865 2053 534c 2f54 ialize the SSL/T │ │ │ -00185810: 4c53 206c 6962 7261 7279 2e3c 2f64 6976 LS library.
.
# │ │ │ -00185900: 6465 6669 6e65 2053 4f41 505f 5353 4c5f define SOAP_SSL_ │ │ │ -00185910: 4445 4641 554c 543c 2f64 6976 3e3c 6469 DEFAULT
│ │ │ -00185930: 736f 6170 5f73 736c 5f66 6c61 6773 2066 soap_ssl_flags f │ │ │ -00185940: 6c61 6720 7769 7468 2023 534f 4150 5f53 lag with #SOAP_S │ │ │ -00185950: 534c 5f52 4551 5549 5245 5f53 4552 5645 SL_REQUIRE_SERVE │ │ │ -00185960: 525f 4155 5448 454e 5449 4341 5449 4f4e R_AUTHENTICATION │ │ │ -00185970: 2061 6e64 2023 534f 4150 5f54 4c53 7631 and #SOAP_TLSv1 │ │ │ -00185980: 2065 6e61 626c 6564 2062 7920 6465 6661 enabled by defa │ │ │ -00185990: 756c 743c 2f64 6976 3e3c 6469 7620 636c ult
D │ │ │ -001859b0: 6566 696e 6974 696f 6e3a 3c2f 623e 2073 efinition: s │ │ │ -001859c0: 7464 736f 6170 322e 683a 3538 3236 3c2f tdsoap2.h:5826
.
│ │ │ -00185a40: 3c61 2068 7265 663d 2267 726f 7570 5f5f CRYPTO_threa │ │ │ -00185a90: 645f 636c 6561 6e75 703c 2f61 3e3c 2f64 d_cleanup
int CRYPT │ │ │ -00185ac0: 4f5f 7468 7265 6164 5f63 6c65 616e 7570 O_thread_cleanup │ │ │ -00185ad0: 2829 3c2f 6469 763e 3c64 6976 2063 6c61 ()
Clean │ │ │ -00185af0: 7570 2066 756e 6374 696f 6e20 666f 7220 up function for │ │ │ -00185b00: 4f70 656e 5353 4c20 7665 7273 696f 6e73 OpenSSL versions │ │ │ -00185b10: 2070 7269 6f72 2074 6f20 312e 312e 312e prior to 1.1.1. │ │ │ -00185b20: 3c2f 6469 763e 3c2f 6469 763e 0a3c 6469
.soap_ssl_a │ │ │ -00185be0: 6363 6570 743c 2f61 3e3c 2f64 6976 3e3c ccept
< │ │ │ -00185bf0: 6469 7620 636c 6173 733d 2274 7464 6563 div class="ttdec │ │ │ -00185c00: 6922 3e69 6e74 2073 6f61 705f 7373 6c5f i">int soap_ssl_ │ │ │ -00185c10: 6163 6365 7074 2873 7472 7563 7420 736f accept(struct so │ │ │ -00185c20: 6170 202a 736f 6170 293c 2f64 6976 3e3c ap *soap)
< │ │ │ -00185c30: 6469 7620 636c 6173 733d 2274 7464 6f63 div class="ttdoc │ │ │ -00185c40: 223e 4163 6365 7074 2053 534c 2f54 4c53 ">Accept SSL/TLS │ │ │ -00185c50: 2063 6f6e 6e65 6374 696f 6e2e 3c2f 6469 connection.
.
< │ │ │ -00185d30: 6469 7620 636c 6173 733d 2274 7464 6563 div class="ttdec │ │ │ -00185d40: 6922 3e69 6e74 2043 5259 5054 4f5f 7468 i">int CRYPTO_th │ │ │ -00185d50: 7265 6164 5f73 6574 7570 2829 3c2f 6469 read_setup()
Setup funct │ │ │ -00185d80: 696f 6e20 666f 7220 4f70 656e 5353 4c20 ion for OpenSSL │ │ │ -00185d90: 7665 7273 696f 6e73 2070 7269 6f72 2074 versions prior t │ │ │ -00185da0: 6f20 312e 312e 3120 746f 2073 6574 206c o 1.1.1 to set l │ │ │ -00185db0: 6f63 6b73 2066 6f72 206d 756c 7469 2d74 ocks for multi-t │ │ │ -00185dc0: 6872 6561 6465 6420 5353 4c2f 544c 5320 hreaded SSL/TLS │ │ │ -00185dd0: 6170 706c 6963 6174 696f 2e2e 2e3c 2f64 applicatio...
.
│ │ │ -00185df0: 3c21 2d2d 2066 7261 676d 656e 7420 2d2d

wher │ │ │ -00186970: 652c 2066 6f72 2065 7861 6d70 6c65 3a3c e, for example:< │ │ │ -00186980: 2f70 3e0a 3c64 6976 2063 6c61 7373 3d22 /p>.

void sigpipe_handle │ │ │ -001869e0: 283c 7370 616e 2063 6c61 7373 3d22 6b65 (int x) { }.

By │ │ │ -00186a30: 6465 6661 756c 742c 2063 6c69 656e 7473 default, clients │ │ │ -00186a40: 2061 7265 206e 6f74 2072 6571 7569 7265 are not require │ │ │ -00186a50: 6420 746f 2061 7574 6865 6e74 6963 6174 d to authenticat │ │ │ -00186a60: 652e 2054 6f20 7265 7175 6972 6520 636c e. To require cl │ │ │ -00186a70: 6965 6e74 2061 7574 6865 6e74 6963 6174 ient authenticat │ │ │ -00186a80: 696f 6e20 7573 6520 7468 6520 666f 6c6c ion use the foll │ │ │ -00186a90: 6f77 696e 673a 3c2f 703e 0a3c 6469 7620 owing:

.
... │ │ │ -00186f10: 7d3c 2f64 6976 3e0a 3c64 6976 2063 6c61 }
.
#define SOA │ │ │ -00187010: 505f 5353 4c5f 5245 5155 4952 455f 434c P_SSL_REQUIRE_CL │ │ │ -00187020: 4945 4e54 5f41 5554 4845 4e54 4943 4154 IENT_AUTHENTICAT │ │ │ -00187030: 494f 4e3c 2f64 6976 3e3c 6469 7620 636c ION
soap │ │ │ -00187050: 5f73 736c 5f66 6c61 6773 2066 6c61 6720 _ssl_flags flag │ │ │ -00187060: 666f 7220 7365 7276 6572 7320 746f 2072 for servers to r │ │ │ -00187070: 6571 7569 7265 2063 6c69 656e 7473 2074 equire clients t │ │ │ -00187080: 6f20 6175 7468 656e 7469 6361 7465 2074 o authenticate t │ │ │ -00187090: 6f20 7365 7276 6572 7320 6475 7269 6e67 o servers during │ │ │ -001870a0: 2074 6865 2048 5454 5053 2068 616e 6473 the HTTPS hands │ │ │ -001870b0: 682e 2e2e 3c2f 6469 763e 3c64 6976 2063 h...
│ │ │ -001870d0: 4465 6669 6e69 7469 6f6e 3a3c 2f62 3e20 Definition: │ │ │ -001870e0: 7374 6473 6f61 7032 2e68 3a35 3835 343c stdsoap2.h:5854< │ │ │ -001870f0: 2f64 6976 3e3c 2f64 6976 3e0a 3c2f 6469 /div>
.

This requi │ │ │ -00187120: 7265 7320 6561 6368 2063 6c69 656e 7420 res each client │ │ │ -00187130: 746f 2061 7574 6865 6e74 6963 6174 6520 to authenticate │ │ │ -00187140: 7769 7468 2069 7473 2063 6572 7469 6669 with its certifi │ │ │ -00187150: 6361 7465 2c20 696e 2061 6464 6974 696f cate, in additio │ │ │ -00187160: 6e20 666f 7220 7468 6520 7365 7276 6572 n for the server │ │ │ -00187170: 2074 6f20 6175 7468 656e 7469 6361 7465 to authenticate │ │ │ -00187180: 2074 6f20 7468 6520 636c 6965 6e74 2e3c to the client.< │ │ │ -00187190: 2f70 3e0a 3c70 3e53 696e 6365 2072 656c /p>.

Since rel │ │ │ -001871a0: 6561 7365 2076 6572 7369 6f6e 2032 2e38 ease version 2.8 │ │ │ -001871b0: 2e32 302c 2053 534c 2076 3320 6973 2064 .20, SSL v3 is d │ │ │ -001871c0: 6973 6162 6c65 642e 2054 6f20 656e 6162 isabled. To enab │ │ │ -001871d0: 6c65 2053 534c 2076 3320 746f 6765 7468 le SSL v3 togeth │ │ │ -001871e0: 6572 2077 6974 6820 544c 5320 312e 3020 er with TLS 1.0 │ │ │ -001871f0: 616e 6420 6869 6768 6572 2c20 7573 6520 and higher, use │ │ │ -00187200: 3c63 6f64 653e 2353 4f41 505f 5353 4c76 #SOAP_SSLv │ │ │ -00187210: 335f 544c 5376 313c 2f63 6f64 653e 2077 3_TLSv1 w │ │ │ -00187220: 6974 6820 3c63 6f64 653e 3c61 2063 6c61 ith soa │ │ │ -001872b0: 705f 7373 6c5f 7365 7276 6572 5f63 6f6e p_ssl_server_con │ │ │ -001872c0: 7465 7874 3c2f 613e 3c2f 636f 6465 3e2e text. │ │ │ -001872d0: 2054 6f20 7573 6520 544c 5320 312e 3120 To use TLS 1.1 │ │ │ -001872e0: 616e 6420 312e 3220 7573 6520 3c63 6f64 and 1.2 use SOAP_TLSv1_1 | │ │ │ -00187300: 2053 4f41 505f 544c 5376 315f 323c 2f63 SOAP_TLSv1_2. To use TLS │ │ │ -00187320: 2031 2e32 206f 6e6c 7920 7573 6520 3c63 1.2 only use #SOAP_TLSv1_ │ │ │ -00187340: 323c 2f63 6f64 653e 2e20 546f 2075 7365 2. To use │ │ │ -00187350: 2053 534c 2076 3320 6f6e 6c79 2075 7365 SSL v3 only use │ │ │ -00187360: 203c 636f 6465 3e23 534f 4150 5f53 534c #SOAP_SSL │ │ │ -00187370: 7633 3c2f 636f 6465 3e2e 3c2f 703e 0a3c v3.

.< │ │ │ -00187380: 703e 5468 6520 3c63 6f64 653e 6361 6365 p>The cace │ │ │ -00187390: 7274 3c2f 636f 6465 3e20 6669 6c65 2061 rt file a │ │ │ -001873a0: 6e64 203c 636f 6465 3e63 6170 6174 683c nd capath< │ │ │ -001873b0: 2f63 6f64 653e 2061 7265 206f 7074 696f /code> are optio │ │ │ -001873c0: 6e61 6c2e 2045 6974 6865 7220 6f6e 6520 nal. Either one │ │ │ -001873d0: 6361 6e20 6265 2073 7065 6369 6669 6564 can be specified │ │ │ -001873e0: 2077 6865 6e20 636c 6965 6e74 7320 6d75 when clients mu │ │ │ -001873f0: 7374 2072 756e 206f 6e20 6e6f 6e2d 7472 st run on non-tr │ │ │ -00187400: 7573 7465 6420 7379 7374 656d 7320 283c usted systems (< │ │ │ -00187410: 636f 6465 3e63 6170 6174 683c 2f63 6f64 code>capath is not used w │ │ │ -00187430: 6974 6820 474e 5554 4c53 292e 2057 6520 ith GNUTLS). We │ │ │ -00187440: 7761 6e74 2074 6f20 6176 6f69 6420 7374 want to avoid st │ │ │ -00187450: 6f72 696e 6720 7472 7573 7465 6420 6365 oring trusted ce │ │ │ -00187460: 7274 6966 6963 6174 6573 2069 6e20 7468 rtificates in th │ │ │ -00187470: 6520 6465 6661 756c 7420 6c6f 6361 7469 e default locati │ │ │ -00187480: 6f6e 206f 6e20 7468 6520 6669 6c65 2073 on on the file s │ │ │ -00187490: 7973 7465 6d20 7768 656e 2074 6861 7420 ystem when that │ │ │ -001874a0: 6973 206e 6f74 2073 6563 7572 652e 2054 is not secure. T │ │ │ -001874b0: 6865 7265 666f 7265 2c20 6120 666c 6174 herefore, a flat │ │ │ -001874c0: 203c 656d 3e3c 636f 6465 3e63 6163 6572 cacer │ │ │ -001874d0: 742e 7065 6d3c 2f63 6f64 653e 3c2f 656d t.pem file or direct │ │ │ -001874f0: 6f72 7920 6361 6e20 6265 2073 7065 6369 ory can be speci │ │ │ -00187500: 6669 6564 2074 6f20 7374 6f72 6520 7472 fied to store tr │ │ │ -00187510: 7573 7465 6420 6365 7274 6966 6963 6174 usted certificat │ │ │ -00187520: 6573 2e3c 2f70 3e0a 3c70 3e54 6865 2067 es.

.

The g │ │ │ -00187530: 534f 4150 2070 6163 6b61 6765 2069 6e63 SOAP package inc │ │ │ -00187540: 6c75 6465 7320 6120 3c65 6d3e 3c63 6f64 ludes a cacerts.pem file w │ │ │ -00187570: 6974 6820 7468 6520 6365 7274 6966 6963 ith the certific │ │ │ -00187580: 6174 6573 206f 6620 616c 6c20 6365 7274 ates of all cert │ │ │ -00187590: 6966 6963 6174 6520 6175 7468 6f72 6974 ificate authorit │ │ │ -001875a0: 6965 732e 2059 6f75 2063 616e 2075 7365 ies. You can use │ │ │ -001875b0: 2074 6869 7320 6669 6c65 2074 6f20 7665 this file to ve │ │ │ -001875c0: 7269 6679 2074 6865 2061 7574 6865 6e74 rify the authent │ │ │ -001875d0: 6963 6174 696f 6e20 6f66 2073 6572 7665 ication of serve │ │ │ -001875e0: 7273 2074 6861 7420 7072 6f76 6964 6520 rs that provide │ │ │ -001875f0: 6365 7274 6966 6963 6174 6573 2069 7373 certificates iss │ │ │ -00187600: 7565 6420 6279 2074 6865 7365 2043 4173 ued by these CAs │ │ │ -00187610: 2e3c 2f70 3e0a 3c70 3e54 6865 203c 656d .

.

The cacert.pe │ │ │ -00187630: 6d3c 2f63 6f64 653e 3c2f 656d 3e2c 203c m, < │ │ │ -00187640: 656d 3e3c 636f 6465 3e63 6c69 656e 742e em>client. │ │ │ -00187650: 7065 6d3c 2f63 6f64 653e 3c2f 656d 3e2c pem, │ │ │ -00187660: 2061 6e64 203c 656d 3e3c 636f 6465 3e73 and s │ │ │ -00187670: 6572 7665 722e 7065 6d3c 2f63 6f64 653e erver.pem │ │ │ -00187680: 3c2f 656d 3e20 6669 6c65 7320 696e 2074 files in t │ │ │ -00187690: 6865 2067 534f 4150 2070 6163 6b61 6765 he gSOAP package │ │ │ -001876a0: 2061 7265 2065 7861 6d70 6c65 7320 6f66 are examples of │ │ │ -001876b0: 2073 656c 662d 7369 676e 6564 2063 6572 self-signed cer │ │ │ -001876c0: 7469 6669 6361 7465 732e 2054 6865 203c tificates. The < │ │ │ -001876d0: 656d 3e3c 636f 6465 3e63 6c69 656e 742e em>client. │ │ │ -001876e0: 7065 6d3c 2f63 6f64 653e 3c2f 656d 3e20 pem │ │ │ -001876f0: 616e 6420 3c65 6d3e 3c63 6f64 653e 7365 and se │ │ │ -00187700: 7276 6572 2e70 656d 3c2f 636f 6465 3e3c rver.pem< │ │ │ -00187710: 2f65 6d3e 2063 6f6e 7461 696e 2074 6865 /em> contain the │ │ │ -00187720: 2063 6c69 656e 742f 7365 7276 6572 2070 client/server p │ │ │ -00187730: 7269 7661 7465 206b 6579 2063 6f6e 6361 rivate key conca │ │ │ -00187740: 7465 6e61 7465 6420 7769 7468 2074 6865 tenated with the │ │ │ -00187750: 2063 6572 7469 6669 6361 7465 2e20 5468 certificate. Th │ │ │ -00187760: 6520 6b65 7966 696c 6573 2028 3c65 6d3e e keyfiles ( │ │ │ -00187770: 3c63 6f64 653e 636c 6965 6e74 2e70 656d client.pem │ │ │ -00187780: 3c2f 636f 6465 3e3c 2f65 6d3e 2061 6e64 and │ │ │ -00187790: 203c 656d 3e3c 636f 6465 3e73 6572 7665 serve │ │ │ -001877a0: 722e 7065 6d3c 2f63 6f64 653e 3c2f 656d r.pem) are created b │ │ │ -001877c0: 7920 636f 6e63 6174 656e 6174 696e 6720 y concatenating │ │ │ -001877d0: 7468 6520 7072 6976 6174 6520 6b65 7920 the private key │ │ │ -001877e0: 5045 4d20 7769 7468 2074 6865 2063 6572 PEM with the cer │ │ │ -001877f0: 7469 6669 6361 7465 2050 454d 2e20 5468 tificate PEM. Th │ │ │ -00187800: 6520 6b65 7966 696c 6520 7368 6f75 6c64 e keyfile should │ │ │ -00187810: 206e 6f74 2062 6520 7368 6172 6564 2077 not be shared w │ │ │ -00187820: 6974 6820 616e 7920 7061 7274 792e 2057 ith any party. W │ │ │ -00187830: 6974 6820 4f70 656e 5353 4c2c 2079 6f75 ith OpenSSL, you │ │ │ -00187840: 2063 616e 2065 6e63 7279 7074 2074 6865 can encrypt the │ │ │ -00187850: 206b 6579 6669 6c65 7320 7769 7468 2061 keyfiles with a │ │ │ -00187860: 2070 6173 7377 6f72 6420 746f 206f 6666 password to off │ │ │ -00187870: 6572 2073 6f6d 6520 7072 6f74 6563 7469 er some protecti │ │ │ -00187880: 6f6e 2061 6e64 2074 6865 2070 6173 7377 on and the passw │ │ │ -00187890: 6f72 6420 6973 2075 7365 6420 696e 2074 ord is used in t │ │ │ -001878a0: 6865 2063 6c69 656e 742f 7365 7276 6572 he client/server │ │ │ -001878b0: 2063 6f64 6520 746f 2072 6561 6420 7468 code to read th │ │ │ -001878c0: 6520 6b65 7966 696c 652e 2047 4e55 544c e keyfile. GNUTL │ │ │ -001878d0: 5320 646f 6573 206e 6f74 2073 7570 706f S does not suppo │ │ │ -001878e0: 7274 2074 6869 7320 6665 6174 7572 6520 rt this feature │ │ │ -001878f0: 616e 6420 6361 6e6e 6f74 2065 6e63 7279 and cannot encry │ │ │ -00187900: 7074 206f 7220 6465 6372 7970 7420 6120 pt or decrypt a │ │ │ -00187910: 6b65 7966 696c 652e 3c2f 703e 0a3c 646c keyfile.

.
War │ │ │ -00187940: 6e69 6e67 3c2f 6474 3e3c 6464 3e49 7420 ning
It │ │ │ -00187950: 6973 2069 6d70 6f72 7461 6e74 2074 6861 is important tha │ │ │ -00187960: 7420 7468 6520 3c63 6f64 653e 2357 4954 t the #WIT │ │ │ -00187970: 485f 4f50 454e 5353 4c3c 2f63 6f64 653e H_OPENSSL │ │ │ -00187980: 206d 6163 726f 206d 7573 7420 6265 2063 macro must be c │ │ │ -00187990: 6f6e 7369 7374 656e 746c 7920 6465 6669 onsistently defi │ │ │ -001879a0: 6e65 6420 746f 2063 6f6d 7069 6c65 2074 ned to compile t │ │ │ -001879b0: 6865 2073 6f75 7263 6573 2c20 7375 6368 he sources, such │ │ │ -001879c0: 2061 7320 3c65 6d3e 3c63 6f64 653e 6773 as gs │ │ │ -001879d0: 6f61 702f 7374 6473 6f61 7032 2e63 7070 oap/stdsoap2.cpp │ │ │ -001879e0: 3c2f 636f 6465 3e3c 2f65 6d3e 2c20 3c65 , soapC.cp │ │ │ -00187a00: 703c 2f63 6f64 653e 3c2f 656d 3e2c 203c p, < │ │ │ -00187a10: 656d 3e3c 636f 6465 3e73 6f61 7043 6c69 em>soapCli │ │ │ -00187a20: 656e 742e 6370 703c 2f63 6f64 653e 3c2f ent.cpp, s │ │ │ -00187a40: 6f61 7053 6572 7665 722e 6370 703c 2f63 oapServer.cpp, and a │ │ │ -00187a60: 6c6c 2061 7070 6c69 6361 7469 6f6e 2073 ll application s │ │ │ -00187a70: 6f75 7263 6573 2074 6861 7420 696e 636c ources that incl │ │ │ -00187a80: 7564 6520 3c65 6d3e 3c63 6f64 653e 6773 ude gs │ │ │ -00187a90: 6f61 702f 7374 6473 6f61 7032 2e68 3c2f oap/stdsoap2.h or soapH.h< │ │ │ -00187ac0: 2f63 6f64 653e 3c2f 656d 3e2e 2049 6620 /code>. If │ │ │ -00187ad0: 7468 6520 6d61 6372 6f73 2061 7265 206e the macros are n │ │ │ -00187ae0: 6f74 2063 6f6e 7369 7374 656e 746c 7920 ot consistently │ │ │ -00187af0: 7573 6564 2c20 7468 6520 6170 706c 6963 used, the applic │ │ │ -00187b00: 6174 696f 6e20 7769 6c6c 2063 7261 7368 ation will crash │ │ │ -00187b10: 2064 7565 2074 6f20 6120 6d69 736d 6174 due to a mismat │ │ │ -00187b20: 6368 6573 2069 6e20 7468 6520 6465 636c ches in the decl │ │ │ -00187b30: 6172 6174 696f 6e20 616e 6420 6163 6365 aration and acce │ │ │ -00187b40: 7373 206f 6620 7468 6520 3c63 6f64 653e ss of the │ │ │ -00187b50: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap │ │ │ -00187ba0: 3c2f 613e 3c2f 636f 6465 3e20 636f 6e74 cont │ │ │ -00187bb0: 6578 742e 3c2f 6464 3e3c 2f64 6c3e 0a3c ext.
.< │ │ │ -00187bc0: 703e 5365 6520 616c 736f 2041 5049 2064 p>See also API d │ │ │ -00187bd0: 6f63 756d 656e 7461 7469 6f6e 204d 6f64 ocumentation Mod │ │ │ -00187be0: 756c 6520 3c61 2063 6c61 7373 3d22 656c ule │ │ │ -00187c10: 5353 4c2f 544c 5320 636f 6e74 6578 7420 SSL/TLS context │ │ │ -00187c20: 616e 6420 6675 6e63 7469 6f6e 733c 2f61 and functions for more detai │ │ │ -00187c40: 6c73 206f 6e20 7468 6520 5353 4c2f 544c ls on the SSL/TL │ │ │ -00187c50: 5320 6675 6e63 7469 6f6e 732e 3c2f 703e S functions.

│ │ │ -00187c60: 0a3c 703e f09f 949d 203c 6120 6872 6566 .

.... Back to tab │ │ │ -00187c80: 6c65 206f 6620 636f 6e74 656e 7473 3c2f le of contents

.

│ │ │ -00187cc0: 3c2f 613e 0a53 6563 7572 6520 636c 6965 .Secure clie │ │ │ -00187cd0: 6e74 7320 7769 7468 2048 5454 5053 3c2f nts with HTTPS.

To utiliz │ │ │ -00187cf0: 6520 4854 5450 532f 5353 4c2c 2079 6f75 e HTTPS/SSL, you │ │ │ -00187d00: 206e 6565 6420 746f 2069 6e73 7461 6c6c need to install │ │ │ -00187d10: 2074 6865 204f 7065 6e53 534c 206c 6962 the OpenSSL lib │ │ │ -00187d20: 7261 7279 206f 6e20 796f 7572 2070 6c61 rary on your pla │ │ │ -00187d30: 7466 6f72 6d20 6f72 2047 4e55 544c 5320 tform or GNUTLS │ │ │ -00187d40: 666f 7220 6120 6c69 6768 742d 7765 6967 for a light-weig │ │ │ -00187d50: 6874 2053 534c 2f54 4c53 206c 6962 7261 ht SSL/TLS libra │ │ │ -00187d60: 7279 2e20 4166 7465 7220 696e 7374 616c ry. After instal │ │ │ -00187d70: 6c61 7469 6f6e 2c20 636f 6d70 696c 6520 lation, compile │ │ │ -00187d80: 616c 6c20 7468 6520 736f 7572 6365 7320 all the sources │ │ │ -00187d90: 6f66 2079 6f75 7220 6170 706c 6963 6174 of your applicat │ │ │ -00187da0: 696f 6e20 7769 7468 2063 6f6d 7069 6c65 ion with compile │ │ │ -00187db0: 2d74 696d 6520 666c 6167 203c 636f 6465 -time flag #WITH_OPENSSL (or │ │ │ -00187de0: 2357 4954 485f 474e 5554 4c53 3c2f 636f #WITH_GNUTLS when using G │ │ │ -00187e00: 4e55 544c 5329 2e20 466f 7220 6578 616d NUTLS). For exam │ │ │ -00187e10: 706c 6520 6f6e 204c 696e 7578 3a20 3c2f ple on Linux:

 c++ -DW
│ │ │ -00187e40: 4954 485f 4f50 454e 5353 4c20 6d79 636c  ITH_OPENSSL mycl
│ │ │ -00187e50: 6965 6e74 2e63 7070 2073 7464 736f 6170  ient.cpp stdsoap
│ │ │ -00187e60: 2e63 7070 2073 6f61 7043 2e63 7070 2073  .cpp soapC.cpp s
│ │ │ -00187e70: 6f61 7043 6c69 656e 742e 6370 7020 2d6c  oapClient.cpp -l
│ │ │ -00187e80: 7373 6c20 2d6c 6372 7970 746f 0a3c 2f70  ssl -lcrypto.

or Unix: │ │ │ -00187ea0: 3c2f 703e 3c70 7265 2063 6c61 7373 3d22

 c++ -
│ │ │ -00187ec0: 4457 4954 485f 4f50 454e 5353 4c20 6d79  DWITH_OPENSSL my
│ │ │ -00187ed0: 636c 6965 6e74 2e63 7070 2073 7464 736f  client.cpp stdso
│ │ │ -00187ee0: 6170 2e63 7070 2073 6f61 7043 2e63 7070  ap.cpp soapC.cpp
│ │ │ -00187ef0: 2073 6f61 7043 6c69 656e 742e 6370 7020   soapClient.cpp 
│ │ │ -00187f00: 2d6c 786e 6574 202d 6c73 6f63 6b65 7420  -lxnet -lsocket 
│ │ │ -00187f10: 2d6c 6e73 6c20 2d6c 7373 6c20 2d6c 6372  -lnsl -lssl -lcr
│ │ │ -00187f20: 7970 746f 0a3c 2f70 7265 3e3c 703e 206f  ypto.

o │ │ │ -00187f30: 7220 796f 7520 6361 6e20 6164 6420 7468 r you can add th │ │ │ -00187f40: 6520 666f 6c6c 6f77 696e 6720 6c69 6e65 e following line │ │ │ -00187f50: 2074 6f20 3c65 6d3e 3c63 6f64 653e 736f to so │ │ │ -00187f60: 6170 6465 6673 2e68 3c2f 636f 6465 3e3c apdefs.h< │ │ │ -00187f70: 2f65 6d3e 3a3c 2f70 3e0a 3c64 6976 2063 /em>:

.
│ │ │ -00187f90: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
#de │ │ │ -00187fc0: 6669 6e65 2057 4954 485f 4f50 454e 5353 fine WITH_OPENSS │ │ │ -00187fd0: 4c3c 2f73 7061 6e3e 3c2f 6469 763e 0a3c L
.< │ │ │ -00187fe0: 2f64 6976 3e3c 212d 2d20 6672 6167 6d65 /div>

and com │ │ │ -00188000: 7069 6c65 2077 6974 6820 636f 6d70 696c pile with compil │ │ │ -00188010: 652d 7469 6d65 2066 6c61 6720 3c63 6f64 e-time flag #WITH_SOAPDEFS │ │ │ -00188030: 5f48 3c2f 636f 6465 3e20 746f 2069 6e63 _H to inc │ │ │ -00188040: 6c75 6465 203c 656d 3e3c 636f 6465 3e73 lude s │ │ │ -00188050: 6f61 7064 6566 732e 683c 2f63 6f64 653e oapdefs.h │ │ │ -00188060: 3c2f 656d 3e20 696e 2079 6f75 7220 7072 in your pr │ │ │ -00188070: 6f6a 6563 742e 2041 6c74 6572 6e61 7469 oject. Alternati │ │ │ -00188080: 7665 6c79 2c20 636f 6d70 696c 6520 7769 vely, compile wi │ │ │ -00188090: 7468 2047 4e55 544c 533a 203c 2f70 3e3c th GNUTLS:

< │ │ │ -001880a0: 7072 6520 636c 6173 733d 2266 7261 676d pre class="fragm │ │ │ -001880b0: 656e 7422 3e20 632b 2b20 2d44 5749 5448 ent"> c++ -DWITH │ │ │ -001880c0: 5f47 4e55 544c 5320 6d79 636c 6965 6e74 _GNUTLS myclient │ │ │ -001880d0: 2e63 7070 2073 7464 736f 6170 2e63 7070 .cpp stdsoap.cpp │ │ │ -001880e0: 2073 6f61 7043 2e63 7070 2073 6f61 7043 soapC.cpp soapC │ │ │ -001880f0: 6c69 656e 742e 6370 7020 2d6c 676e 7574 lient.cpp -lgnut │ │ │ -00188100: 6c73 202d 6c67 6372 7970 7420 2d6c 6770 ls -lgcrypt -lgp │ │ │ -00188110: 672d 6572 726f 720a 3c2f 7072 653e 3c70 g-error.

A client progra │ │ │ -00188130: 6d20 7369 6d70 6c79 2075 7365 7320 7468 m simply uses th │ │ │ -00188140: 6520 7072 6566 6978 203c 656d 3e3c 636f e prefix https: │ │ │ -00188160: 3c2f 656d 3e20 696e 7374 6561 6420 6f66 instead of │ │ │ -00188170: 203c 656d 3e3c 636f 6465 3e68 7474 703a http: │ │ │ -00188180: 3c2f 636f 6465 3e3c 2f65 6d3e 2069 6e20 in │ │ │ -00188190: 7468 6520 656e 6470 6f69 6e74 2055 524c the endpoint URL │ │ │ -001881a0: 206f 6620 6120 7365 7276 6963 6520 6f70 of a service op │ │ │ -001881b0: 6572 6174 696f 6e20 6361 6c6c 2074 6f20 eration call to │ │ │ -001881c0: 6120 5765 6220 5365 7276 6963 6520 746f a Web Service to │ │ │ -001881d0: 2075 7365 2065 6e63 7279 7074 6564 2074 use encrypted t │ │ │ -001881e0: 7261 6e73 6665 7273 2028 6966 2074 6865 ransfers (if the │ │ │ -001881f0: 2073 6572 7669 6365 2073 7570 706f 7274 service support │ │ │ -00188200: 7320 4854 5450 5329 2e20 596f 7520 6e65 s HTTPS). You ne │ │ │ -00188210: 6564 2074 6f20 7370 6563 6966 7920 7468 ed to specify th │ │ │ -00188220: 6520 636c 6965 6e74 2d73 6964 6520 6b65 e client-side ke │ │ │ -00188230: 7920 6669 6c65 2061 6e64 2070 6173 7377 y file and passw │ │ │ -00188240: 6f72 6420 6f66 2074 6865 206b 6579 6669 ord of the keyfi │ │ │ -00188250: 6c65 3a3c 2f70 3e0a 3c64 6976 2063 6c61 le:

..
so │ │ │ -00188370: 6170 5f73 736c 5f69 6e69 743c 2f61 3e28 ap_ssl_init( │ │ │ -00188380: 293b 203c 7370 616e 2063 6c61 7373 3d22 ); /* init │ │ │ -001883a0: 204f 7065 6e53 534c 2028 736b 6970 7069 OpenSSL (skippi │ │ │ -001883b0: 6e67 2074 6869 7320 6f72 2063 616c 6c69 ng this or calli │ │ │ -001883c0: 6e67 206d 756c 7469 706c 6520 7469 6d65 ng multiple time │ │ │ -001883d0: 7320 6973 204f 4b2c 2073 696e 6365 2074 s is OK, since t │ │ │ -001883e0: 6865 2065 6e67 696e 6520 7769 6c6c 2069 he engine will i │ │ │ -001883f0: 6e69 7420 5353 4c20 6175 746f 6d61 7469 nit SSL automati │ │ │ -00188400: 6361 6c6c 7929 202a 2f3c 2f73 7061 6e3e cally) */ │ │ │ -00188410: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
/ │ │ │ -00188440: 2a20 736f 6170 5f73 736c 5f6e 6f69 6e69 * soap_ssl_noini │ │ │ -00188450: 7428 293b 202a 2f3c 2f73 7061 6e3e 203c t(); */ < │ │ │ -00188460: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ -00188470: 656e 7422 3e2f 2a20 646f 206e 6f74 2069 ent">/* do not i │ │ │ -00188480: 6e69 7420 4f70 656e 5353 4c20 2869 6620 nit OpenSSL (if │ │ │ -00188490: 5353 4c20 6973 2061 6c72 6561 6479 2069 SSL is already i │ │ │ -001884a0: 6e69 7469 616c 697a 6564 2065 6c73 6577 nitialized elsew │ │ │ -001884b0: 6865 7265 2069 6e20 7468 6973 2061 7070 here in this app │ │ │ -001884c0: 6c69 6361 7469 6f6e 2920 2a2f 3c2f 7370 lication) */
.
soap_init(& │ │ │ -00188550: 616d 703b 3c61 2063 6c61 7373 3d22 636f amp;soap< │ │ │ -00188580: 2f61 3e29 3b3c 2f64 6976 3e0a 3c64 6976 /a>);
.. │ │ │ -00188680: 203c 6120 636c 6173 733d 2263 6f64 6522 SOAP_SSL_DEFAU │ │ │ -001886e0: 4c54 3c2f 613e 2c20 3c2f 6469 763e 0a3c LT,

.< │ │ │ -001886f0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -00188700: 3e20 203c 7370 616e 2063 6c61 7373 3d22 > & │ │ │ -00188720: 7175 6f74 3b63 6c69 656e 742e 7065 6d26 quot;client.pem& │ │ │ -00188730: 7175 6f74 3b3c 2f73 7061 6e3e 2c20 2020 quot;, │ │ │ -00188740: 2020 2020 203c 7370 616e 2063 6c61 7373 /* ke │ │ │ -00188760: 7966 696c 653a 2072 6571 7569 7265 6420 yfile: required │ │ │ -00188770: 6f6e 6c79 2077 6865 6e20 636c 6965 6e74 only when client │ │ │ -00188780: 206d 7573 7420 6175 7468 656e 7469 6361 must authentica │ │ │ -00188790: 7465 2074 6f20 7365 7276 6572 2028 7365 te to server (se │ │ │ -001887a0: 6520 5353 4c20 646f 6373 206f 6e20 686f e SSL docs on ho │ │ │ -001887b0: 7720 746f 206f 6274 6169 6e20 7468 6973 w to obtain this │ │ │ -001887c0: 2066 696c 6529 202a 2f3c 2f73 7061 6e3e file) */ │ │ │ -001887d0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
"pa │ │ │ -00188810: 7373 776f 7264 2671 756f 743b 3c2f 7370 ssword", /* password │ │ │ -00188850: 746f 2072 6561 6420 7468 6520 6b65 7920 to read the key │ │ │ -00188860: 6669 6c65 2028 6e6f 7420 7573 6564 2077 file (not used w │ │ │ -00188870: 6974 6820 474e 5554 4c53 2920 2a2f 3c2f ith GNUTLS) */
. │ │ │ -001888a0: 203c 7370 616e 2063 6c61 7373 3d22 7374 &qu │ │ │ -001888c0: 6f74 3b63 6163 6572 7473 2e70 656d 2671 ot;cacerts.pem&q │ │ │ -001888d0: 756f 743b 3c2f 7370 616e 3e2c 2020 2020 uot;, │ │ │ -001888e0: 2020 203c 7370 616e 2063 6c61 7373 3d22 /* cace │ │ │ -00188900: 7274 2066 696c 6520 746f 2073 746f 7265 rt file to store │ │ │ -00188910: 2074 7275 7374 6564 2063 6572 7469 6669 trusted certifi │ │ │ -00188920: 6361 7465 7320 286e 6565 6465 6420 746f cates (needed to │ │ │ -00188930: 2076 6572 6966 7920 7365 7276 6572 2920 verify server) │ │ │ -00188940: 2a2f 3c2f 7370 616e 3e20 3c2f 6469 763e */
│ │ │ -00188950: 0a3c 6469 7620 636c 6173 733d 226c 696e .
NULL, │ │ │ -00188970: 2020 2020 2020 2020 2020 3c73 7061 6e20 │ │ │ -00188990: 2f2a 2063 6170 6174 6820 746f 2064 6972 /* capath to dir │ │ │ -001889a0: 6563 746f 7279 2077 6974 6820 7472 7573 ectory with trus │ │ │ -001889b0: 7465 6420 6365 7274 6966 6963 6174 6573 ted certificates │ │ │ -001889c0: 202a 2f3c 2f73 7061 6e3e 203c 2f64 6976 */
.
NULL │ │ │ -001889f0: 2020 203c 7370 616e 2063 6c61 7373 3d22 /* if r │ │ │ -00188a10: 616e 6466 696c 6521 3d4e 554c 4c3a 2075 andfile!=NULL: u │ │ │ -00188a20: 7365 2061 2066 696c 6520 7769 7468 2072 se a file with r │ │ │ -00188a30: 616e 646f 6d20 6461 7461 2074 6f20 7365 andom data to se │ │ │ -00188a40: 6564 2072 616e 646f 6d6e 6573 7320 2a2f ed randomness */ │ │ │ -00188a50: 3c2f 7370 616e 3e20 203c 2f64 6976 3e0a
. │ │ │ -00188a60: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
))
.
{< │ │ │ -00188a90: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>..
exit │ │ │ -00188b70: 2845 5849 545f 4641 494c 5552 4529 3b20 (EXIT_FAILURE); │ │ │ -00188b80: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
}
.
soap_call_ns │ │ │ -00188bc0: 5f5f 6d79 6d65 7468 6f64 2826 616d 703b __mymethod(& │ │ │ -00188bd0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap, │ │ │ -00188c00: 203c 7370 616e 2063 6c61 7373 3d22 7374 &qu │ │ │ -00188c20: 6f74 3b68 7474 7073 3a2f 2f64 6f6d 6169 ot;https://domai │ │ │ -00188c30: 6e2f 7061 7468 2f73 6563 7572 652e 6367 n/path/secure.cg │ │ │ -00188c40: 6926 7175 6f74 3b3c 2f73 7061 6e3e 2c20 i", │ │ │ -00188c50: 3c73 7061 6e20 636c 6173 733d 2273 7472 &quo │ │ │ -00188c70: 743b 2671 756f 743b 3c2f 7370 616e 3e2c t;", │ │ │ -00188c80: 202e 2e2e 293b 3c2f 6469 763e 0a3c 6469 ...);
.soap_ssl_c │ │ │ -00188d40: 6c69 656e 745f 636f 6e74 6578 743c 2f61 lient_context
int s │ │ │ -00188d70: 6f61 705f 7373 6c5f 636c 6965 6e74 5f63 oap_ssl_client_c │ │ │ -00188d80: 6f6e 7465 7874 2873 7472 7563 7420 736f ontext(struct so │ │ │ -00188d90: 6170 202a 736f 6170 2c20 736f 6170 5f73 ap *soap, soap_s │ │ │ -00188da0: 736c 5f66 6c61 6773 2066 6c61 6773 2c20 sl_flags flags, │ │ │ -00188db0: 636f 6e73 7420 6368 6172 202a 6b65 7966 const char *keyf │ │ │ -00188dc0: 696c 652c 2063 6f6e 7374 2063 6861 7220 ile, const char │ │ │ -00188dd0: 2a70 6173 7377 6f72 642c 2063 6f6e 7374 *password, const │ │ │ -00188de0: 2063 6861 7220 2a63 6166 696c 652c 2063 char *cafile, c │ │ │ -00188df0: 6f6e 7374 2063 6861 7220 2a63 6170 6174 onst char *capat │ │ │ -00188e00: 682c 2063 6f6e 7374 2063 6861 7220 2a72 h, const char *r │ │ │ -00188e10: 616e 6466 696c 6529 3c2f 6469 763e 3c64 andfile)
Initialize the │ │ │ -00188e40: 636c 6965 6e74 2d73 6964 6520 5353 4c2f client-side SSL/ │ │ │ -00188e50: 544c 5320 636f 6e74 6578 742e 3c2f 6469 TLS context.
.
< │ │ │ -00188e70: 212d 2d20 6672 6167 6d65 6e74 202d 2d3e !-- fragment --> │ │ │ -00188e80: 3c70 3e42 7920 6465 6661 756c 742c 2073

By default, s │ │ │ -00188e90: 6572 7665 7220 6175 7468 656e 7469 6361 erver authentica │ │ │ -00188ea0: 7469 6f6e 2069 7320 656e 6162 6c65 6420 tion is enabled │ │ │ -00188eb0: 616e 6420 7468 6520 3c65 6d3e 3c63 6f64 and the cacerts.pem or capath │ │ │ -00188ef0: 2028 6e6f 7420 7573 6564 2077 6974 6820 (not used with │ │ │ -00188f00: 474e 5554 4c53 2920 6d75 7374 2062 6520 GNUTLS) must be │ │ │ -00188f10: 7365 7420 736f 2074 6861 7420 7468 6520 set so that the │ │ │ -00188f20: 4341 2063 6572 7469 6669 6361 7465 7320 CA certificates │ │ │ -00188f30: 6f66 2074 6865 2073 6572 7665 7228 7329 of the server(s) │ │ │ -00188f40: 2061 7265 2061 6363 6573 7369 626c 6520 are accessible │ │ │ -00188f50: 6174 2072 756e 2074 696d 652e 2054 6865 at run time. The │ │ │ -00188f60: 203c 656d 3e3c 636f 6465 3e63 6163 6572 cacer │ │ │ -00188f70: 7473 2e70 656d 3c2f 636f 6465 3e3c 2f65 ts.pem file included │ │ │ -00188f90: 2069 6e20 7468 6520 6753 4f41 5020 736f in the gSOAP so │ │ │ -00188fa0: 7572 6365 2063 6f64 6520 7061 636b 6167 urce code packag │ │ │ -00188fb0: 6520 636f 6e74 6169 6e73 2074 6865 2063 e contains the c │ │ │ -00188fc0: 6572 7469 6669 6361 7465 7320 6f66 2063 ertificates of c │ │ │ -00188fd0: 6f6d 6d6f 6e20 4341 732e 2054 6869 7320 ommon CAs. This │ │ │ -00188fe0: 6669 6c65 206d 7573 7420 6265 2073 7570 file must be sup │ │ │ -00188ff0: 706c 6965 6420 7769 7468 2074 6865 2063 plied with the c │ │ │ -00189000: 6c69 656e 742c 2069 6620 7365 7276 6572 lient, if server │ │ │ -00189010: 2061 7574 6865 6e74 6963 6174 696f 6e20 authentication │ │ │ -00189020: 6973 2072 6571 7569 7265 642e 2041 6c74 is required. Alt │ │ │ -00189030: 6572 6e61 7469 7665 6c79 2c20 796f 7520 ernatively, you │ │ │ -00189040: 6361 6e20 7573 6520 7468 6520 3c65 6d3e can use the │ │ │ -00189050: 3c63 6f64 653e 6773 6f61 702f 706c 7567 gsoap/plug │ │ │ -00189060: 696e 2f63 6163 6572 7473 2e68 3c2f 636f in/cacerts.h and gsoap/plu │ │ │ -00189090: 6769 6e2f 6361 6365 7274 732e 633c 2f63 gin/cacerts.c code t │ │ │ -001890b0: 6f20 656d 6265 6420 4341 2063 6572 7469 o embed CA certi │ │ │ -001890c0: 6669 6361 7465 7320 696e 2079 6f75 7220 ficates in your │ │ │ -001890d0: 636c 6965 6e74 2063 6f64 652e 3c2f 703e client code.

│ │ │ -001890e0: 0a3c 703e 596f 7520 6361 6e20 7370 6563 .

You can spec │ │ │ -001890f0: 6966 7920 6120 6369 7068 6572 206c 6973 ify a cipher lis │ │ │ -00189100: 7420 746f 2075 7365 2077 6974 6820 544c t to use with TL │ │ │ -00189110: 5376 312e 3220 616e 6420 6265 6c6f 7720 Sv1.2 and below │ │ │ -00189120: 7769 7468 203c 636f 6465 3e53 534c 5f43 with SSL_C │ │ │ -00189130: 5458 5f73 6574 5f63 6970 6865 725f 6c69 TX_set_cipher_li │ │ │ -00189140: 7374 2873 6f61 702d 2667 743b 6374 782c st(soap->ctx, │ │ │ -00189150: 2022 2e2e 2e22 293c 2f63 6f64 653e 2077 "...") w │ │ │ -00189160: 6865 7265 203c 636f 6465 3e73 6f61 702d here soap- │ │ │ -00189170: 2667 743b 6374 783c 2f63 6f64 653e 2069 >ctx i │ │ │ -00189180: 7320 7468 6520 5353 4c20 636f 6e74 6578 s the SSL contex │ │ │ -00189190: 7420 6372 6561 7465 6420 6279 203c 636f t created by soap_ssl_c │ │ │ -00189230: 6c69 656e 745f 636f 6e74 6578 7428 293c lient_context()< │ │ │ -00189240: 2f61 3e3c 2f63 6f64 653e 2e20 4c69 6b65 /a>. Like │ │ │ -00189250: 7769 7365 2c20 7573 6520 3c63 6f64 653e wise, use │ │ │ -00189260: 5353 4c5f 4354 585f 7365 745f 6369 7068 SSL_CTX_set_ciph │ │ │ -00189270: 6572 7375 6974 6573 2873 6f61 702d 2667 ersuites(soap-&g │ │ │ -00189280: 743b 6374 782c 2022 2e2e 2e22 293c 2f63 t;ctx, "...") to configur │ │ │ -001892a0: 6520 7468 6520 6176 6169 6c61 626c 6520 e the available │ │ │ -001892b0: 544c 5376 312e 3320 6369 7068 6572 7375 TLSv1.3 ciphersu │ │ │ -001892c0: 6974 6573 2e3c 2f70 3e0a 3c70 3e57 6520 ites.

.

We │ │ │ -001892d0: 7265 6665 7220 746f 2074 6865 204f 7065 refer to the Ope │ │ │ -001892e0: 6e53 534c 2064 6f63 756d 656e 7461 7469 nSSL documentati │ │ │ -001892f0: 6f6e 2061 6e64 206d 616e 7561 6c20 7061 on and manual pa │ │ │ -00189300: 6765 7320 6f66 203c 636f 6465 3e53 534c ges of SSL │ │ │ -00189310: 5f43 5458 5f73 6574 5f63 6970 6865 725f _CTX_set_cipher_ │ │ │ -00189320: 6c69 7374 3c2f 636f 6465 3e20 616e 6420 list and │ │ │ -00189330: 3c63 6f64 653e 5353 4c5f 4354 585f 7365 SSL_CTX_se │ │ │ -00189340: 745f 6369 7068 6572 7375 6974 6573 3c2f t_ciphersuites for detail │ │ │ -00189360: 7320 6f6e 2074 6865 206c 6174 6573 7420 s on the latest │ │ │ -00189370: 6369 7068 6572 206c 6973 7473 2061 6e64 cipher lists and │ │ │ -00189380: 2073 7569 7465 7320 6176 6169 6c61 626c suites availabl │ │ │ -00189390: 6520 746f 2075 7365 2e3c 2f70 3e0a 3c70 e to use.

.

Other client-si │ │ │ -001893b0: 6465 2053 534c 206f 7074 696f 6e73 2061 de SSL options a │ │ │ -001893c0: 7265 203c 636f 6465 3e23 534f 4150 5f53 re #SOAP_S │ │ │ -001893d0: 534c 5f53 4b49 505f 484f 5354 5f43 4845 SL_SKIP_HOST_CHE │ │ │ -001893e0: 434b 3c2f 636f 6465 3e20 746f 2073 6b69 CK to ski │ │ │ -001893f0: 7020 7468 6520 686f 7374 206e 616d 6520 p the host name │ │ │ -00189400: 7665 7269 6669 6361 7469 6f6e 2063 6865 verification che │ │ │ -00189410: 636b 2061 6e64 203c 636f 6465 3e23 534f ck and #SO │ │ │ -00189420: 4150 5f53 534c 5f41 4c4c 4f57 5f45 5850 AP_SSL_ALLOW_EXP │ │ │ -00189430: 4952 4544 5f43 4552 5449 4649 4341 5445 IRED_CERTIFICATE │ │ │ -00189440: 3c2f 636f 6465 3e20 746f 2061 6c6c 6f77 to allow │ │ │ -00189450: 2063 6f6e 6e65 6374 696e 6720 746f 2061 connecting to a │ │ │ -00189460: 2068 6f73 7420 7769 7468 2061 6e20 6578 host with an ex │ │ │ -00189470: 7069 7265 6420 6365 7274 6966 6963 6174 pired certificat │ │ │ -00189480: 652e 2046 6f72 2065 7861 6d70 6c65 2c3c e. For example,< │ │ │ -00189490: 2f70 3e0a 3c64 6976 2063 6c61 7373 3d22 /p>.

struct │ │ │ -001894e0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap │ │ │ -00189510: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap; │ │ │ -00189540: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
soap_s │ │ │ -001895b0: 736c 5f69 6e69 743c 2f61 3e28 293b 203c sl_init(); < │ │ │ -001895c0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ -001895d0: 656e 7422 3e2f 2a20 696e 6974 204f 7065 ent">/* init Ope │ │ │ -001895e0: 6e53 534c 2028 736b 6970 7069 6e67 2074 nSSL (skipping t │ │ │ -001895f0: 6869 7320 6f72 2063 616c 6c69 6e67 206d his or calling m │ │ │ -00189600: 756c 7469 706c 6520 7469 6d65 7320 6973 ultiple times is │ │ │ -00189610: 204f 4b2c 2073 696e 6365 2074 6865 2065 OK, since the e │ │ │ -00189620: 6e67 696e 6520 7769 6c6c 2069 6e69 7420 ngine will init │ │ │ -00189630: 5353 4c20 6175 746f 6d61 7469 6361 6c6c SSL automaticall │ │ │ -00189640: 7929 202a 2f3c 2f73 7061 6e3e 3c2f 6469 y) */.
/* so │ │ │ -00189680: 6170 5f73 736c 5f6e 6f69 6e69 7428 293b ap_ssl_noinit(); │ │ │ -00189690: 202a 2f3c 2f73 7061 6e3e 203c 7370 616e */ /* do not init │ │ │ -001896c0: 4f70 656e 5353 4c20 2869 6620 5353 4c20 OpenSSL (if SSL │ │ │ -001896d0: 6973 2061 6c72 6561 6479 2069 6e69 7469 is already initi │ │ │ -001896e0: 616c 697a 6564 2065 6c73 6577 6865 7265 alized elsewhere │ │ │ -001896f0: 2069 6e20 7468 6973 2061 7070 6c69 6361 in this applica │ │ │ -00189700: 7469 6f6e 2920 2a2f 3c2f 7370 616e 3e3c tion) */< │ │ │ -00189710: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
soa │ │ │ -00189780: 705f 696e 6974 3c2f 613e 2826 616d 703b p_init(& │ │ │ -00189790: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap) │ │ │ -001897c0: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
.
if (< │ │ │ -00189800: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -00189810: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ -00189820: 705f 5f73 736c 2e68 746d 6c23 6761 3236 p__ssl.html#ga26 │ │ │ -00189830: 3963 3737 3332 6231 6364 6139 6463 3739 9c7732b1cda9dc79 │ │ │ -00189840: 6462 3038 6663 6266 3164 3534 3338 223e db08fcbf1d5438"> │ │ │ -00189850: 736f 6170 5f73 736c 5f63 6c69 656e 745f soap_ssl_client_ │ │ │ -00189860: 636f 6e74 6578 743c 2f61 3e28 2661 6d70 context(& │ │ │ -00189870: 3b3c 6120 636c 6173 733d 2263 6f64 6522 ;soap │ │ │ -001898a0: 2c20 3c2f 6469 763e 0a3c 6469 7620 636c ,
. │ │ │ -00189940: 0a3c 6469 7620 636c 6173 733d 226c 696e .. │ │ │ -001899e0: 207c 203c 6120 636c 6173 733d 2263 6f64 | SOAP_SSL_ALL │ │ │ -00189a40: 4f57 5f45 5850 4952 4544 5f43 4552 5449 OW_EXPIRED_CERTI │ │ │ -00189a50: 4649 4341 5445 3c2f 613e 2c20 3c2f 6469 FICATE, .
"client. │ │ │ -00189aa0: 7065 6d26 7175 6f74 3b3c 2f73 7061 6e3e pem" │ │ │ -00189ab0: 2c20 2020 2020 2020 203c 7370 616e 2063 , / │ │ │ -00189ad0: 2a20 6b65 7966 696c 653a 2072 6571 7569 * keyfile: requi │ │ │ -00189ae0: 7265 6420 6f6e 6c79 2077 6865 6e20 636c red only when cl │ │ │ -00189af0: 6965 6e74 206d 7573 7420 6175 7468 656e ient must authen │ │ │ -00189b00: 7469 6361 7465 2074 6f20 7365 7276 6572 ticate to server │ │ │ -00189b10: 2028 7365 6520 5353 4c20 646f 6373 206f (see SSL docs o │ │ │ -00189b20: 6e20 686f 7720 746f 206f 6274 6169 6e20 n how to obtain │ │ │ -00189b30: 7468 6973 2066 696c 6529 202a 2f3c 2f73 this file) */
.
│ │ │ -00189b60: 3c73 7061 6e20 636c 6173 733d 2273 7472 &quo │ │ │ -00189b80: 743b 7061 7373 776f 7264 2671 756f 743b t;password" │ │ │ -00189b90: 3c2f 7370 616e 3e2c 2020 2020 2020 2020 , │ │ │ -00189ba0: 2020 3c73 7061 6e20 636c 6173 733d 2263 /* passw │ │ │ -00189bc0: 6f72 6420 746f 2072 6561 6420 7468 6520 ord to read the │ │ │ -00189bd0: 6b65 7920 6669 6c65 2028 6e6f 7420 7573 key file (not us │ │ │ -00189be0: 6564 2077 6974 6820 474e 5554 4c53 2920 ed with GNUTLS) │ │ │ -00189bf0: 2a2f 3c2f 7370 616e 3e20 3c2f 6469 763e */
│ │ │ -00189c00: 0a3c 6469 7620 636c 6173 733d 226c 696e .
"cacerts.p │ │ │ -00189c40: 656d 2671 756f 743b 3c2f 7370 616e 3e2c em", │ │ │ -00189c50: 2020 2020 2020 203c 7370 616e 2063 6c61 /* │ │ │ -00189c70: 6361 6365 7274 2066 696c 6520 746f 2073 cacert file to s │ │ │ -00189c80: 746f 7265 2074 7275 7374 6564 2063 6572 tore trusted cer │ │ │ -00189c90: 7469 6669 6361 7465 7320 286e 6565 6465 tificates (neede │ │ │ -00189ca0: 6420 746f 2076 6572 6966 7920 7365 7276 d to verify serv │ │ │ -00189cb0: 6572 2920 2a2f 3c2f 7370 616e 3e3c 2f64 er) */.
NULL, │ │ │ -00189ce0: 2020 2020 2020 2020 2020 2020 203c 7370 /* capath to │ │ │ -00189d10: 6469 7265 6374 6f72 7920 7769 7468 2074 directory with t │ │ │ -00189d20: 7275 7374 6564 2063 6572 7469 6669 6361 rusted certifica │ │ │ -00189d30: 7465 7320 2a2f 3c2f 7370 616e 3e20 3c2f tes */ .
NULL │ │ │ -00189d60: 2020 2020 2020 3c73 7061 6e20 636c 6173 /* i │ │ │ -00189d80: 6620 7261 6e64 6669 6c65 213d 4e55 4c4c f randfile!=NULL │ │ │ -00189d90: 3a20 7573 6520 6120 6669 6c65 2077 6974 : use a file wit │ │ │ -00189da0: 6820 7261 6e64 6f6d 2064 6174 6120 746f h random data to │ │ │ -00189db0: 2073 6565 6420 7261 6e64 6f6d 6e65 7373 seed randomness │ │ │ -00189dc0: 202a 2f3c 2f73 7061 6e3e 2020 3c2f 6469 */ .
))
.< │ │ │ -00189df0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -00189e00: 3e7b 3c2f 6469 763e 0a3c 6469 7620 636c >{
..
e │ │ │ -00189ee0: 7869 7428 4558 4954 5f46 4149 4c55 5245 xit(EXIT_FAILURE │ │ │ -00189ef0: 293b 203c 2f64 6976 3e0a 3c64 6976 2063 );
.
} .. │ │ │ -0018a000: 3c64 6976 2063 6c61 7373 3d22 7474 6322
# │ │ │ -0018a0e0: 6465 6669 6e65 2053 4f41 505f 5353 4c5f define SOAP_SSL_ │ │ │ -0018a0f0: 534b 4950 5f48 4f53 545f 4348 4543 4b3c SKIP_HOST_CHECK< │ │ │ -0018a100: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
soap_ssl │ │ │ -0018a120: 5f66 6c61 6773 2066 6c61 6720 666f 7220 _flags flag for │ │ │ -0018a130: 636c 6965 6e74 7320 746f 2061 6c6c 6f77 clients to allow │ │ │ -0018a140: 2063 6c69 656e 7473 2074 6f20 736b 6970 clients to skip │ │ │ -0018a150: 2063 6f6d 6d6f 6e20 6e61 6d65 2063 6865 common name che │ │ │ -0018a160: 636b 7320 6167 6169 6e73 7420 7468 6520 cks against the │ │ │ -0018a170: 686f 7374 206e 616d 6520 6f66 202e 2e2e host name of ... │ │ │ -0018a180: 3c2f 6469 763e 3c64 6976 2063 6c61 7373
Defi │ │ │ -0018a1a0: 6e69 7469 6f6e 3a3c 2f62 3e20 7374 6473 nition: stds │ │ │ -0018a1b0: 6f61 7032 2e68 3a35 3836 383c 2f64 6976 oap2.h:5868
.
#define SOA │ │ │ -0018a2c0: 505f 5353 4c5f 5245 5155 4952 455f 5345 P_SSL_REQUIRE_SE │ │ │ -0018a2d0: 5256 4552 5f41 5554 4845 4e54 4943 4154 RVER_AUTHENTICAT │ │ │ -0018a2e0: 494f 4e3c 2f64 6976 3e3c 6469 7620 636c ION
soap │ │ │ -0018a300: 5f73 736c 5f66 6c61 6773 2066 6c61 6720 _ssl_flags flag │ │ │ -0018a310: 666f 7220 636c 6965 6e74 7320 746f 2072 for clients to r │ │ │ -0018a320: 6571 7569 7265 2073 6572 7665 7273 2074 equire servers t │ │ │ -0018a330: 6f20 6175 7468 656e 7469 6361 7465 2074 o authenticate t │ │ │ -0018a340: 6f20 636c 6965 6e74 7320 6475 7269 6e67 o clients during │ │ │ -0018a350: 2074 6865 2048 5454 5053 2068 616e 6473 the HTTPS hands │ │ │ -0018a360: 682e 2e2e 3c2f 6469 763e 3c64 6976 2063 h...
│ │ │ -0018a380: 4465 6669 6e69 7469 6f6e 3a3c 2f62 3e20 Definition: │ │ │ -0018a390: 7374 6473 6f61 7032 2e68 3a35 3836 323c stdsoap2.h:5862< │ │ │ -0018a3a0: 2f64 6976 3e3c 2f64 6976 3e0a 3c64 6976 /div>
.
#define SOA │ │ │ -0018a4a0: 505f 5353 4c5f 414c 4c4f 575f 4558 5049 P_SSL_ALLOW_EXPI │ │ │ -0018a4b0: 5245 445f 4345 5254 4946 4943 4154 453c RED_CERTIFICATE< │ │ │ -0018a4c0: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
soap_ssl │ │ │ -0018a4e0: 5f66 6c61 6773 2066 6c61 6720 7661 6c75 _flags flag valu │ │ │ -0018a4f0: 6520 746f 2061 6c6c 6f77 2073 656c 662d e to allow self- │ │ │ -0018a500: 7369 676e 6564 2061 6e64 2065 7870 6972 signed and expir │ │ │ -0018a510: 6564 2063 6572 7469 6669 6361 7465 7320 ed certificates │ │ │ -0018a520: 616e 6420 7468 6f73 6520 7769 7468 6f75 and those withou │ │ │ -0018a530: 7420 4352 4c20 746f 2062 6520 752e 2e2e t CRL to be u... │ │ │ -0018a540: 3c2f 6469 763e 3c64 6976 2063 6c61 7373
Defi │ │ │ -0018a560: 6e69 7469 6f6e 3a3c 2f62 3e20 7374 6473 nition: stds │ │ │ -0018a570: 6f61 7032 2e68 3a35 3833 323c 2f64 6976 oap2.h:5832
.
< │ │ │ -0018a5a0: 703e 466f 7220 7379 7374 656d 7320 6261 p>For systems ba │ │ │ -0018a5b0: 7365 6420 6f6e 204d 6963 726f 736f 6674 sed on Microsoft │ │ │ -0018a5c0: 2077 696e 646f 7773 2c20 7468 6520 5769 windows, the Wi │ │ │ -0018a5d0: 6e49 6e65 7420 6d6f 6475 6c65 2063 616e nInet module can │ │ │ -0018a5e0: 2062 6520 7573 6564 2069 6e73 7465 6164 be used instead │ │ │ -0018a5f0: 2c20 7365 6520 3c63 6f64 653e 6d6f 645f , see mod_ │ │ │ -0018a600: 6773 6f61 702f 6773 6f61 705f 7769 6e2f gsoap/gsoap_win/ │ │ │ -0018a610: 7769 6e69 6e65 743c 2f63 6f64 653e 2e3c wininet.< │ │ │ -0018a620: 2f70 3e0a 3c70 3e53 696e 6365 2072 656c /p>.

Since rel │ │ │ -0018a630: 6561 7365 2076 6572 7369 6f6e 2032 2e38 ease version 2.8 │ │ │ -0018a640: 2e32 3020 5353 4c20 7633 2069 7320 6469 .20 SSL v3 is di │ │ │ -0018a650: 7361 626c 6564 2e20 546f 2065 6e61 626c sabled. To enabl │ │ │ -0018a660: 6520 5353 4c20 7633 2074 6f67 6574 6865 e SSL v3 togethe │ │ │ -0018a670: 7220 7769 7468 2054 4c53 2031 2e30 2061 r with TLS 1.0 a │ │ │ -0018a680: 6e64 2068 6967 6865 722c 2075 7365 203c nd higher, use < │ │ │ -0018a690: 636f 6465 3e23 534f 4150 5f53 534c 7633 code>#SOAP_SSLv3 │ │ │ -0018a6a0: 5f54 4c53 7631 3c2f 636f 6465 3e20 7769 _TLSv1 wi │ │ │ -0018a6b0: 7468 203c 636f 6465 3e3c 6120 636c 6173 th soap │ │ │ -0018a740: 5f73 736c 5f73 6572 7665 725f 636f 6e74 _ssl_server_cont │ │ │ -0018a750: 6578 743c 2f61 3e3c 2f63 6f64 653e 2e20 ext. │ │ │ -0018a760: 546f 2075 7365 2054 4c53 2031 2e31 2061 To use TLS 1.1 a │ │ │ -0018a770: 6e64 2031 2e32 2075 7365 203c 636f 6465 nd 1.2 use SOAP_TLSv1_1 | │ │ │ -0018a790: 534f 4150 5f54 4c53 7631 5f32 3c2f 636f SOAP_TLSv1_2. To use TLS │ │ │ -0018a7b0: 312e 3220 6f6e 6c79 2075 7365 203c 636f 1.2 only use #SOAP_TLSv1_2 │ │ │ -0018a7d0: 3c2f 636f 6465 3e2e 2054 6f20 7573 6520 . To use │ │ │ -0018a7e0: 5353 4c20 7633 206f 6e6c 7920 7573 6520 SSL v3 only use │ │ │ -0018a7f0: 3c63 6f64 653e 2353 4f41 505f 5353 4c76 #SOAP_SSLv │ │ │ -0018a800: 333c 2f63 6f64 653e 2e3c 2f70 3e0a 3c70 3.

.

To disable serv │ │ │ -0018a820: 6572 2061 7574 6865 6e74 6963 6174 696f er authenticatio │ │ │ -0018a830: 6e20 666f 7220 7465 7374 696e 6720 7075 n for testing pu │ │ │ -0018a840: 7270 6f73 6573 2c20 7573 6520 7468 6520 rposes, use the │ │ │ -0018a850: 666f 6c6c 6f77 696e 673a 3c2f 703e 0a3c following:

.< │ │ │ -0018a860: 6469 7620 636c 6173 733d 2266 7261 676d div class="fragm │ │ │ -0018a870: 656e 7422 3e3c 6469 7620 636c 6173 733d ent">
if (soa │ │ │ -0018a900: 705f 7373 6c5f 636c 6965 6e74 5f63 6f6e p_ssl_client_con │ │ │ -0018a910: 7465 7874 3c2f 613e 2826 616d 703b 3c61 text(&soap, < │ │ │ -0018a950: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>..
NULL, .
NULL, .
NULL, .
NULL, < │ │ │ -0018aa60: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
NULL < │ │ │ -0018aa80: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
))
.
{
.
│ │ │ -0018aad0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap_print_fa │ │ │ -0018ab30: 756c 743c 2f61 3e28 2661 6d70 3b3c 6120 ult(&soap, st │ │ │ -0018ab70: 6465 7272 293b 203c 2f64 6976 3e0a 3c64 derr);
. │ │ │ -0018ab90: 2020 6578 6974 2845 5849 545f 4641 494c exit(EXIT_FAIL │ │ │ -0018aba0: 5552 4529 3b20 3c2f 6469 763e 0a3c 6469 URE);
.} │ │ │ -0018abc0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
SOAP_SSL_NO_AUT │ │ │ -0018ac80: 4845 4e54 4943 4154 494f 4e3c 2f61 3e3c HENTICATION< │ │ │ -0018ac90: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
#define │ │ │ -0018acb0: 2053 4f41 505f 5353 4c5f 4e4f 5f41 5554 SOAP_SSL_NO_AUT │ │ │ -0018acc0: 4845 4e54 4943 4154 494f 4e3c 2f64 6976 HENTICATION
soap_ssl_fla │ │ │ -0018acf0: 6773 2066 6c61 6720 7661 6c75 6520 746f gs flag value to │ │ │ -0018ad00: 2064 6973 6162 6c65 2061 7574 6865 6e74 disable authent │ │ │ -0018ad10: 6963 6174 696f 6e20 6f66 2074 6865 2070 ication of the p │ │ │ -0018ad20: 6565 723c 2f64 6976 3e3c 6469 7620 636c eer
D │ │ │ -0018ad40: 6566 696e 6974 696f 6e3a 3c2f 623e 2073 efinition: s │ │ │ -0018ad50: 7464 736f 6170 322e 683a 3538 3430 3c2f tdsoap2.h:5840
.

wher │ │ │ -0018aed0: 652c 2066 6f72 2065 7861 6d70 6c65 3a3c e, for example:< │ │ │ -0018aee0: 2f70 3e0a 3c64 6976 2063 6c61 7373 3d22 /p>.

void sigpipe_handle │ │ │ -0018af40: 283c 7370 616e 2063 6c61 7373 3d22 6b65 (int x) { }.
Warnin │ │ │ -0018afb0: 673c 2f64 743e 3c64 643e 4974 2069 7320 g
It is │ │ │ -0018afc0: 696d 706f 7274 616e 7420 7468 6174 2074 important that t │ │ │ -0018afd0: 6865 203c 636f 6465 3e23 5749 5448 5f4f he #WITH_O │ │ │ -0018afe0: 5045 4e53 534c 3c2f 636f 6465 3e20 6d61 PENSSL ma │ │ │ -0018aff0: 6372 6f20 6973 2063 6f6e 7369 7374 656e cro is consisten │ │ │ -0018b000: 746c 7920 6465 6669 6e65 6420 746f 2063 tly defined to c │ │ │ -0018b010: 6f6d 7069 6c65 2074 6865 2073 6f75 7263 ompile the sourc │ │ │ -0018b020: 6573 2c20 7375 6368 2061 7320 3c65 6d3e es, such as │ │ │ -0018b030: 3c63 6f64 653e 6773 6f61 702f 7374 6473 gsoap/stds │ │ │ -0018b040: 6f61 7032 2e63 7070 3c2f 636f 6465 3e3c oap2.cpp< │ │ │ -0018b050: 2f65 6d3e 2c20 3c65 6d3e 3c63 6f64 653e /em>, │ │ │ -0018b060: 736f 6170 432e 6370 703c 2f63 6f64 653e soapC.cpp │ │ │ -0018b070: 3c2f 656d 3e2c 203c 656d 3e3c 636f 6465 , soapClient.cpp< │ │ │ -0018b090: 2f63 6f64 653e 3c2f 656d 3e2c 203c 656d /code>, soapServe │ │ │ -0018b0b0: 722e 6370 703c 2f63 6f64 653e 3c2f 656d r.cpp, and all appli │ │ │ -0018b0d0: 6361 7469 6f6e 2073 6f75 7263 6573 2074 cation sources t │ │ │ -0018b0e0: 6861 7420 696e 636c 7564 6520 3c65 6d3e hat include │ │ │ -0018b0f0: 3c63 6f64 653e 6773 6f61 702f 7374 6473 gsoap/stds │ │ │ -0018b100: 6f61 7032 2e68 3c2f 636f 6465 3e3c 2f65 oap2.h or │ │ │ -0018b120: 736f 6170 482e 683c 2f63 6f64 653e 3c2f soapH.h. If the macr │ │ │ -0018b140: 6f73 2061 7265 206e 6f74 2063 6f6e 7369 os are not consi │ │ │ -0018b150: 7374 656e 746c 7920 7573 6564 2c20 7468 stently used, th │ │ │ -0018b160: 6520 6170 706c 6963 6174 696f 6e20 7769 e application wi │ │ │ -0018b170: 6c6c 2063 7261 7368 2064 7565 2074 6f20 ll crash due to │ │ │ -0018b180: 6120 6d69 736d 6174 6368 6573 2069 6e20 a mismatches in │ │ │ -0018b190: 7468 6520 6465 636c 6172 6174 696f 6e20 the declaration │ │ │ -0018b1a0: 616e 6420 6163 6365 7373 206f 6620 7468 and access of th │ │ │ -0018b1b0: 6520 3c63 6f64 653e 3c61 2063 6c61 7373 e soap context. Alt │ │ │ -0018b220: 6572 6e61 7469 7665 6c79 2c20 7573 6520 ernatively, use │ │ │ -0018b230: 6c69 6272 6172 7920 3c62 3e3c 636f 6465 library -lgsoapssl or -lgsoapssl++< │ │ │ -0018b270: 2f63 6f64 653e 3c2f 623e 2061 6e64 2063 /code> and c │ │ │ -0018b280: 6f6d 7069 6c65 2065 7665 7279 7468 696e ompile everythin │ │ │ -0018b290: 6720 656c 7365 2077 6974 6820 3c63 6f64 g else with #WITH_OPENSSL< │ │ │ -0018b2b0: 2f63 6f64 653e 2e3c 2f64 643e 0a3c 6464 /code>.
.
.Concurrent cli │ │ │ -0018b2d0: 656e 7420 6361 6c6c 7320 7769 7468 2074 ent calls with t │ │ │ -0018b2e0: 6872 6561 6473 2073 686f 756c 6420 7573 hreads should us │ │ │ -0018b2f0: 6520 7365 7061 7261 7465 203c 636f 6465 e separate soa │ │ │ -0018b350: 703c 2f61 3e3c 2f63 6f64 653e 2063 6f6e p con │ │ │ -0018b360: 7465 7874 7320 496e 2061 6464 6974 696f texts In additio │ │ │ -0018b370: 6e2c 2074 6865 2074 6872 6561 6420 696e n, the thread in │ │ │ -0018b380: 6974 6961 6c69 7a61 7469 6f6e 2063 6f64 itialization cod │ │ │ -0018b390: 6520 6469 7363 7573 7365 6420 696e 2053 e discussed in S │ │ │ -0018b3a0: 6563 7469 6f6e 203c 6120 636c 6173 733d ection Secure Web │ │ │ -0018b3e0: 7365 7276 6963 6573 2077 6974 6820 4854 services with HT │ │ │ -0018b3f0: 5450 533c 2f61 3e20 6d75 7374 2062 6520 TPS must be │ │ │ -0018b400: 7573 6564 2074 6f20 7072 6f70 6572 6c79 used to properly │ │ │ -0018b410: 2073 6574 7570 204f 7065 6e53 534c 2069 setup OpenSSL i │ │ │ -0018b420: 6e20 6120 6d75 6c74 692d 7468 7265 6164 n a multi-thread │ │ │ -0018b430: 6564 2063 6c69 656e 7420 6170 706c 6963 ed client applic │ │ │ -0018b440: 6174 696f 6e2e 3c2f 6464 3e3c 2f64 6c3e ation.
│ │ │ -0018b450: 0a3c 703e 5365 6520 616c 736f 2041 5049 .

See also API │ │ │ -0018b460: 2064 6f63 756d 656e 7461 7469 6f6e 204d documentation M │ │ │ -0018b470: 6f64 756c 6520 3c61 2063 6c61 7373 3d22 odule SSL/TLS contex │ │ │ -0018b4b0: 7420 616e 6420 6675 6e63 7469 6f6e 733c t and functions< │ │ │ -0018b4c0: 2f61 3e20 666f 7220 6d6f 7265 2064 6574 /a> for more det │ │ │ -0018b4d0: 6169 6c73 206f 6e20 7468 6520 5353 4c2f ails on the SSL/ │ │ │ -0018b4e0: 544c 5320 6675 6e63 7469 6f6e 732e 3c2f TLS functions..

You can al │ │ │ -0018b500: 736f 2075 7365 2074 6865 2057 696e 496e so use the WinIn │ │ │ -0018b510: 6574 2069 6e74 6572 6661 6365 2074 6f20 et interface to │ │ │ -0018b520: 6573 7461 626c 6973 6820 7365 6375 7265 establish secure │ │ │ -0018b530: 2048 5454 5053 2063 6f6e 6e65 6374 696f HTTPS connectio │ │ │ -0018b540: 6e73 206f 6e20 5769 6e64 6f77 7320 6d61 ns on Windows ma │ │ │ -0018b550: 6368 696e 6573 2c20 6176 6169 6c61 626c chines, availabl │ │ │ -0018b560: 6520 696e 2074 6865 203c 656d 3e3c 636f e in the gsoap/mod_gso │ │ │ -0018b580: 6170 3c2f 636f 6465 3e3c 2f65 6d3e 2064 ap d │ │ │ -0018b590: 6972 6563 746f 7279 206f 6620 7468 6520 irectory of the │ │ │ -0018b5a0: 6753 4f41 5020 736f 7572 6365 2063 6f64 gSOAP source cod │ │ │ -0018b5b0: 6520 7061 636b 6167 652c 2073 6565 2061 e package, see a │ │ │ -0018b5c0: 6c73 6f20 5365 6374 696f 6e20 3c61 2063 lso Section The Wi │ │ │ -0018b600: 6e49 6e65 7420 706c 7567 696e 3c2f 613e nInet plugin │ │ │ -0018b610: 2e20 4f72 2079 6f75 2063 616e 2075 7365 . Or you can use │ │ │ -0018b620: 2074 6865 2043 5552 4c20 706c 7567 696e the CURL plugin │ │ │ -0018b630: 2074 6f20 7573 6520 4355 524c 2074 6f20 to use CURL to │ │ │ -0018b640: 6573 7461 626c 6973 6820 7365 6375 7265 establish secure │ │ │ -0018b650: 2048 5454 5053 2063 6f6e 6e65 6374 696f HTTPS connectio │ │ │ -0018b660: 6e73 2c20 7365 6520 5365 6374 696f 6e20 ns, see Section │ │ │ -0018b670: 3c61 2063 6c61 7373 3d22 656c 2220 6872 The C │ │ │ -0018b6a0: 5552 4c20 706c 7567 696e 3c2f 613e 2e3c URL plugin.< │ │ │ -0018b6b0: 2f70 3e0a 3c70 3ef0 9f94 9d20 3c61 2068 /p>.

.... Back to │ │ │ -0018b6d0: 7461 626c 6520 6f66 2063 6f6e 7465 6e74 table of content │ │ │ -0018b6e0: 733c 2f61 3e3c 2f70 3e0a 3c68 323e 3c61 s

.

│ │ │ -0018b720: 3c2f 613e 0a53 534c 2061 7574 6865 6e74 .SSL authent │ │ │ -0018b730: 6963 6174 696f 6e20 6361 6c6c 6261 636b ication callback │ │ │ -0018b740: 733c 2f68 323e 0a3c 703e 5468 6520 3c63 s

.

The fsslauth callback fun │ │ │ -0018b770: 6374 696f 6e20 636f 6e74 726f 6c73 204f ction controls O │ │ │ -0018b780: 7065 6e53 534c 2f47 4e55 544c 5320 6175 penSSL/GNUTLS au │ │ │ -0018b790: 7468 656e 7469 6361 7469 6f6e 2069 6e69 thentication ini │ │ │ -0018b7a0: 7469 616c 697a 6174 696f 6e3a 3c2f 703e tialization:

│ │ │ -0018b7b0: 0a3c 756c 3e0a 3c6c 693e 3c63 6f64 653e .
.
ENGI │ │ │ -0018e2a0: 4e45 202a 653b 203c 2f64 6976 3e0a 3c64 NE *e;
. │ │ │ -0018e2c0: 2020 3c73 7061 6e20 636c 6173 733d 226b if (!(e = ENG │ │ │ -0018e2f0: 494e 455f 6279 5f69 6428 656e 6769 6e65 INE_by_id(engine │ │ │ -0018e300: 2929 2920 3c2f 6469 763e 0a3c 6469 7620 )))
.
│ │ │ -0018e320: 2066 7072 696e 7466 2873 7464 6572 722c fprintf(stderr, │ │ │ -0018e330: 203c 7370 616e 2063 6c61 7373 3d22 7374 &qu │ │ │ -0018e350: 6f74 3b45 7272 6f72 2066 696e 6469 6e67 ot;Error finding │ │ │ -0018e360: 2065 6e67 696e 6520 2573 5c6e 2671 756f engine %s\n&quo │ │ │ -0018e370: 743b 3c2f 7370 616e 3e2c 2065 6e67 696e t;, engin │ │ │ -0018e380: 6529 3b20 3c2f 6469 763e 0a3c 6469 7620 e);
.
< │ │ │ -0018e3a0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -0018e3b0: 6f72 6466 6c6f 7722 3e65 6c73 653c 2f73 ordflow">else i │ │ │ -0018e3e0: 663c 2f73 7061 6e3e 2028 2145 4e47 494e f (!ENGIN │ │ │ -0018e3f0: 455f 7365 745f 6465 6661 756c 7428 652c E_set_default(e, │ │ │ -0018e400: 2045 4e47 494e 455f 4d45 5448 4f44 5f41 ENGINE_METHOD_A │ │ │ -0018e410: 4c4c 2929 203c 2f64 6976 3e0a 3c64 6976 LL))
.
│ │ │ -0018e430: 2020 6670 7269 6e74 6628 7374 6465 7272 fprintf(stderr │ │ │ -0018e440: 2c20 3c73 7061 6e20 636c 6173 733d 2273 , &q │ │ │ -0018e460: 756f 743b 4572 726f 7220 7573 696e 6720 uot;Error using │ │ │ -0018e470: 656e 6769 6e65 2025 735c 6e26 7175 6f74 engine %s\n" │ │ │ -0018e480: 3b3c 2f73 7061 6e3e 2c20 656e 6769 6e65 ;, engine │ │ │ -0018e490: 293b 203c 2f64 6976 3e0a 3c64 6976 2063 );
.
.. │ │ │ -0018e4b0: 2e20 3c73 7061 6e20 636c 6173 733d 2263 . //
.
}
.

The │ │ │ -0018e510: 666f 6c6c 6f77 696e 6720 7461 626c 6520 following table │ │ │ -0018e520: 6c69 7374 7320 7468 6520 6e61 6d65 7320 lists the names │ │ │ -0018e530: 6f66 2074 6865 2068 6172 6477 6172 6520 of the hardware │ │ │ -0018e540: 616e 6420 736f 6674 7761 7265 2065 6e67 and software eng │ │ │ -0018e550: 696e 6573 3a3c 2f70 3e0a 3c74 6162 6c65 ines:

.

value │ │ │ -001531b0: 203c 2f74 683e 3c2f 7472 3e0a 3c74 7220
< │ │ │ -00153200: 636f 6465 3e74 7970 652d 646f 6375 6d65 code>type-docume │ │ │ -00153210: 6e74 6174 696f 6e3c 2f63 6f64 653e 2020 ntation │ │ │ -00153220: 203c 2f74 643e 3c74 6420 636c 6173 733d text des │ │ │ -00153250: 6372 6962 696e 6720 7468 6520 7363 6865 cribing the sche │ │ │ -00153260: 6d61 2074 7970 6520 2020 203c 2f74 643e ma type
│ │ │ -001532c0: 7479 7065 3c2f 636f 6465 3e20 2020 3c2f type an alias fo │ │ │ -00153300: 7220 7468 6520 3c63 6f64 653e 7479 7065 r the type │ │ │ -00153310: 2d64 6f63 756d 656e 7461 7469 6f6e 3c2f -documentation property │ │ │ -00153330: 203c 2f74 643e 3c2f 7472 3e0a 3c2f 7461
....< │ │ │ -0018e620: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ -0018e630: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ -0018e640: 3e3c 636f 6465 3e6f 7065 6e73 736c 3c2f >openssl │ │ │ -0018e6c0: 3c2f 7472 3e0a 3c74 7220 636c 6173 733d ...... │ │ │ -0018e880: 3c63 6f64 653e 6368 696c 3c2f 636f 6465 chil .... │ │ │ -0018e9c0: 3c74 6420 636c 6173 733d 226d 6172 6b64 ..... │ │ │ -0018eba0: 3c74 7220 636c 6173 733d 226d 6172 6b64 │ │ │ -0018ebc0: 0a3c 7464 2063 6c61 7373 3d22 6d61 726b . │ │ │ -0018ec00: 3c74 6420 636c 6173 733d 226d 6172 6b64 ..

.... < │ │ │ -0018ec60: 6120 6872 6566 3d22 2322 3e42 6163 6b20 a href="#">Back │ │ │ -0018ec70: 746f 2074 6162 6c65 206f 6620 636f 6e74 to table of cont │ │ │ -0018ec80: 656e 7473 3c2f 613e 3c2f 703e 0a3c 6832 ents

.

< │ │ │ -0018ecb0: 2f61 3e0a 5353 4c20 6f6e 2057 696e 646f /a>.SSL on Windo │ │ │ -0018ecc0: 7773 3c2f 6832 3e0a 3c70 3e53 6574 2074 ws

.

Set t │ │ │ -0018ecd0: 6865 2066 756c 6c20 7061 7468 2074 6f20 he full path to │ │ │ -0018ece0: 3c65 6d3e 3c63 6f64 653e 6c69 6273 736c libssl │ │ │ -0018ecf0: 2e6c 6962 3c2f 636f 6465 3e3c 2f65 6d3e .lib │ │ │ -0018ed00: 2061 6e64 203c 656d 3e3c 636f 6465 3e6c and l │ │ │ -0018ed10: 6962 6372 7970 746f 2e6c 6962 3c2f 636f ibcrypto.lib under t │ │ │ -0018ed30: 6865 204d 5356 432b 2b20 2250 726f 6a65 he MSVC++ "Proje │ │ │ -0018ed40: 6374 7322 206d 656e 752c 2074 6865 6e20 cts" menu, then │ │ │ -0018ed50: 6368 6f6f 7365 2022 4c69 6e6b 223a 2022 choose "Link": " │ │ │ -0018ed60: 4f62 6a65 6374 2f4d 6f64 756c 6573 222e Object/Modules". │ │ │ -0018ed70: 2050 6c65 6173 6520 6d61 6b65 2073 7572 Please make sur │ │ │ -0018ed80: 6520 3c65 6d3e 3c63 6f64 653e 6c69 6273 e libs │ │ │ -0018ed90: 736c 3332 2e64 6c6c 3c2f 636f 6465 3e3c sl32.dll< │ │ │ -0018eda0: 2f65 6d3e 2061 6e64 203c 656d 3e3c 636f /em> and libeay32.dll< │ │ │ -0018edc0: 2f63 6f64 653e 3c2f 656d 3e20 6361 6e20 /code> can │ │ │ -0018edd0: 6265 206c 6f61 6465 6420 6279 2079 6f75 be loaded by you │ │ │ -0018ede0: 7220 6170 706c 6963 6174 696f 6e73 2c20 r applications, │ │ │ -0018edf0: 7468 7573 2074 6865 7920 6d75 7374 2062 thus they must b │ │ │ -0018ee00: 6520 696e 7374 616c 6c65 6420 7072 6f70 e installed prop │ │ │ -0018ee10: 6572 6c79 206f 6e20 7468 6520 7461 7267 erly on the targ │ │ │ -0018ee20: 6574 206d 6163 6869 6e65 2e3c 2f70 3e0a et machine.

. │ │ │ -0018ee30: 3c70 3e49 6620 796f 7527 7265 2075 7369

If you're usi │ │ │ -0018ee40: 6e67 2063 6f6d 7069 6c61 7469 6f6e 2073 ng compilation s │ │ │ -0018ee50: 6574 7469 6e67 7320 7375 6368 2061 7320 ettings such as │ │ │ -0018ee60: 3c63 6f64 653e 2f4d 5464 3c2f 636f 6465 /MTd then link to t │ │ │ -0018ee80: 6865 2063 6f72 7265 6374 203c 656d 3e3c he correct < │ │ │ -0018ee90: 636f 6465 3e6c 6962 6561 7933 324d 5464 code>libeay32MTd │ │ │ -0018eea0: 2e6c 6962 3c2f 636f 6465 3e3c 2f65 6d3e .lib │ │ │ -0018eeb0: 2061 6e64 203c 656d 3e3c 636f 6465 3e73 and s │ │ │ -0018eec0: 736c 6561 7933 324d 5464 2e6c 6962 3c2f sleay32MTd.lib libra │ │ │ -0018eee0: 7269 6573 2e3c 2f70 3e0a 3c70 3e41 6c74 ries.

.

Alt │ │ │ -0018eef0: 6572 6e61 7469 7665 6c79 2c20 796f 7520 ernatively, you │ │ │ -0018ef00: 6361 6e20 7573 6520 7468 6520 5769 6e49 can use the WinI │ │ │ -0018ef10: 6e65 7420 696e 7465 7266 6163 6520 666f net interface fo │ │ │ -0018ef20: 7220 7365 6375 7265 2063 6f6e 6e65 6374 r secure connect │ │ │ -0018ef30: 696f 6e73 2c20 6176 6169 6c61 626c 6520 ions, available │ │ │ -0018ef40: 696e 2074 6865 203c 656d 3e3c 636f 6465 in the gsoap/mod_gsoap │ │ │ -0018ef60: 3c2f 636f 6465 3e3c 2f65 6d3e 2064 6972 dir │ │ │ -0018ef70: 6563 746f 7279 206f 6620 7468 6520 6753 ectory of the gS │ │ │ -0018ef80: 4f41 5020 7061 636b 6167 652c 2073 6565 OAP package, see │ │ │ -0018ef90: 2061 6c73 6f20 5365 6374 696f 6e20 3c61 also Section The │ │ │ -0018efd0: 5769 6e49 6e65 7420 706c 7567 696e 3c2f WinInet plugin. Or you can u │ │ │ -0018eff0: 7365 2074 6865 2043 5552 4c20 706c 7567 se the CURL plug │ │ │ -0018f000: 696e 2074 6f20 7573 6520 4355 524c 2066 in to use CURL f │ │ │ -0018f010: 6f72 2073 6563 7572 6520 636f 6e6e 6563 or secure connec │ │ │ -0018f020: 7469 6f6e 732c 2073 6565 2053 6563 7469 tions, see Secti │ │ │ -0018f030: 6f6e 203c 6120 636c 6173 733d 2265 6c22 on Th │ │ │ -0018f060: 6520 4355 524c 2070 6c75 6769 6e3c 2f61 e CURL plugin.

.

.... < │ │ │ -0018f080: 6120 6872 6566 3d22 2322 3e42 6163 6b20 a href="#">Back │ │ │ -0018f090: 746f 2074 6162 6c65 206f 6620 636f 6e74 to table of cont │ │ │ -0018f0a0: 656e 7473 3c2f 613e 3c2f 703e 0a3c 6832 ents

.

.Zlib co │ │ │ -0018f0e0: 6d70 7265 7373 696f 6e3c 2f68 323e 0a3c mpression

.< │ │ │ -0018f0f0: 703e 546f 2065 6e61 626c 6520 6465 666c p>To enable defl │ │ │ -0018f100: 6174 6520 616e 6420 677a 6970 2063 6f6d ate and gzip com │ │ │ -0018f110: 7072 6573 7369 6f6e 2077 6974 6820 5a6c pression with Zl │ │ │ -0018f120: 6962 2c20 696e 7374 616c 6c20 5a6c 6962 ib, install Zlib │ │ │ -0018f130: 2066 726f 6d20 3c61 2068 7265 663d 2268 from http://www.z │ │ │ -0018f160: 6c69 622e 6f72 673c 2f61 3e20 6966 206e lib.org if n │ │ │ -0018f170: 6f74 2061 6c72 6561 6479 2069 6e73 7461 ot already insta │ │ │ -0018f180: 6c6c 6564 206f 6e20 796f 7572 2073 7973 lled on your sys │ │ │ -0018f190: 7465 6d2e 2043 6f6d 7069 6c65 203c 656d tem. Compile gsoap/std │ │ │ -0018f1b0: 736f 6170 322e 6370 703c 2f63 6f64 653e soap2.cpp │ │ │ -0018f1c0: 3c2f 656d 3e20 286f 7220 3c65 6d3e 3c63 (or gsoap/stdsoa │ │ │ -0018f1e0: 7032 2e63 3c2f 636f 6465 3e3c 2f65 6d3e p2.c
│ │ │ -0018f1f0: 2920 616e 6420 616c 6c20 796f 7572 2073 ) and all your s │ │ │ -0018f200: 6f75 7263 6573 2074 6861 7420 696e 636c ources that incl │ │ │ -0018f210: 7564 6520 3c65 6d3e 3c63 6f64 653e 6773 ude gs │ │ │ -0018f220: 6f61 702f 7374 6473 6f61 7032 2e68 3c2f oap/stdsoap2.h or soapH.h< │ │ │ -0018f250: 2f63 6f64 653e 3c2f 656d 3e20 7769 7468 /code>
with │ │ │ -0018f260: 2063 6f6d 7069 6c65 2d74 696d 6520 666c compile-time fl │ │ │ -0018f270: 6167 203c 636f 6465 3e23 5749 5448 5f47 ag #WITH_G │ │ │ -0018f280: 5a49 503c 2f63 6f64 653e 2061 6e64 206c ZIP and l │ │ │ -0018f290: 696e 6b20 796f 7572 2063 6f64 6520 7769 ink your code wi │ │ │ -0018f2a0: 7468 2074 6865 205a 6c69 6220 6c69 6272 th the Zlib libr │ │ │ -0018f2b0: 6172 792c 2065 2e67 2e20 3c62 3e3c 636f ary, e.g. -lz on Unix/Linux │ │ │ -0018f2e0: 706c 6174 666f 726d 732e 3c2f 703e 0a3c platforms.

.< │ │ │ -0018f2f0: 703e 5468 6520 677a 6970 2063 6f6d 7072 p>The gzip compr │ │ │ -0018f300: 6573 7369 6f6e 2069 7320 6f72 7468 6f67 ession is orthog │ │ │ -0018f310: 6f6e 616c 2074 6f20 616c 6c20 7472 616e onal to all tran │ │ │ -0018f320: 7370 6f72 7420 656e 636f 6469 6e67 7320 sport encodings │ │ │ -0018f330: 7375 6368 2061 7320 4854 5450 2c20 5353 such as HTTP, SS │ │ │ -0018f340: 4c2c 2044 494d 452c 2061 6e64 2063 616e L, DIME, and can │ │ │ -0018f350: 2062 6520 7573 6564 2077 6974 6820 6f74 be used with ot │ │ │ -0018f360: 6865 7220 7472 616e 7370 6f72 7420 6c61 her transport la │ │ │ -0018f370: 7965 7273 2e20 596f 7520 6361 6e20 6576 yers. You can ev │ │ │ -0018f380: 656e 2073 6176 6520 616e 6420 6c6f 6164 en save and load │ │ │ -0018f390: 2063 6f6d 7072 6573 7365 6420 584d 4c20 compressed XML │ │ │ -0018f3a0: 6461 7461 2074 6f2f 6672 6f6d 2066 696c data to/from fil │ │ │ -0018f3b0: 6573 2e3c 2f70 3e0a 3c70 3e54 776f 2063 es.

.

Two c │ │ │ -0018f3c0: 6f6d 7072 6573 7369 6f6e 2066 6f72 6d61 ompression forma │ │ │ -0018f3d0: 7473 2061 7265 2073 7570 706f 7274 6564 ts are supported │ │ │ -0018f3e0: 2062 7920 7468 6520 656e 6769 6e65 3a20 by the engine: │ │ │ -0018f3f0: 6465 666c 6174 6520 616e 6420 677a 6970 deflate and gzip │ │ │ -0018f400: 2e20 5468 6520 677a 6970 2066 6f72 6d61 . The gzip forma │ │ │ -0018f410: 7420 6973 2075 7365 6420 6279 2064 6566 t is used by def │ │ │ -0018f420: 6175 6c74 2e20 5468 6520 677a 6970 2066 ault. The gzip f │ │ │ -0018f430: 6f72 6d61 7420 6861 7320 7365 7665 7261 ormat has severa │ │ │ -0018f440: 6c20 6265 6e65 6669 7473 206f 7665 7220 l benefits over │ │ │ -0018f450: 6465 666c 6174 652e 2046 6972 7374 6c79 deflate. Firstly │ │ │ -0018f460: 2c20 7468 6520 656e 6769 6e65 2061 7574 , the engine aut │ │ │ -0018f470: 6f6d 6174 6963 616c 6c79 2064 6574 6563 omatically detec │ │ │ -0018f480: 7473 2067 7a69 7020 636f 6d70 7265 7373 ts gzip compress │ │ │ -0018f490: 6564 2069 6e62 6f75 6e64 206d 6573 7361 ed inbound messa │ │ │ -0018f4a0: 6765 732c 2065 7665 6e20 7769 7468 6f75 ges, even withou │ │ │ -0018f4b0: 7420 4854 5450 2068 6561 6465 7273 2c20 t HTTP headers, │ │ │ -0018f4c0: 6279 2063 6865 636b 696e 6720 666f 7220 by checking for │ │ │ -0018f4d0: 7468 6520 7072 6573 656e 6365 206f 6620 the presence of │ │ │ -0018f4e0: 6120 677a 6970 2068 6561 6465 7220 696e a gzip header in │ │ │ -0018f4f0: 2074 6865 206d 6573 7361 6765 2063 6f6e the message con │ │ │ -0018f500: 7465 6e74 2e20 5365 636f 6e64 6c79 2c20 tent. Secondly, │ │ │ -0018f510: 677a 6970 2069 6e63 6c75 6465 7320 6120 gzip includes a │ │ │ -0018f520: 4352 4333 3220 6368 6563 6b73 756d 2074 CRC32 checksum t │ │ │ -0018f530: 6f20 656e 7375 7265 206d 6573 7361 6765 o ensure message │ │ │ -0018f540: 7320 6861 7665 2062 6565 6e20 636f 7272 s have been corr │ │ │ -0018f550: 6563 746c 7920 7265 6365 6976 6564 2e20 ectly received. │ │ │ -0018f560: 5468 6972 646c 792c 2067 7a69 7020 636f Thirdly, gzip co │ │ │ -0018f570: 6d70 7265 7373 6564 2063 6f6e 7465 6e74 mpressed content │ │ │ -0018f580: 2063 616e 2062 6520 6465 636f 6d70 7265 can be decompre │ │ │ -0018f590: 7373 6564 2077 6974 6820 6f74 6865 7220 ssed with other │ │ │ -0018f5a0: 636f 6d70 7265 7373 696f 6e20 736f 6674 compression soft │ │ │ -0018f5b0: 7761 7265 2c20 736f 2079 6f75 2063 616e ware, so you can │ │ │ -0018f5c0: 2064 6563 6f6d 7072 6573 7320 584d 4c20 decompress XML │ │ │ -0018f5d0: 6461 7461 2073 6176 6564 2062 7920 6120 data saved by a │ │ │ -0018f5e0: 6753 4f41 5020 6170 706c 6963 6174 696f gSOAP applicatio │ │ │ -0018f5f0: 6e20 696e 2067 7a69 7020 666f 726d 6174 n in gzip format │ │ │ -0018f600: 2e3c 2f70 3e0a 3c70 3e47 7a69 7020 636f .

.

Gzip co │ │ │ -0018f610: 6d70 7265 7373 696f 6e20 6973 2065 6e61 mpression is ena │ │ │ -0018f620: 626c 6564 2062 7920 636f 6d70 696c 696e bled by compilin │ │ │ -0018f630: 6720 7468 6520 736f 7572 6365 7320 7769 g the sources wi │ │ │ -0018f640: 7468 2063 6f6d 7069 6c65 2d74 696d 6520 th compile-time │ │ │ -0018f650: 666c 6167 203c 636f 6465 3e23 5749 5448 flag #WITH │ │ │ -0018f660: 5f47 5a49 503c 2f63 6f64 653e 2e20 546f _GZIP. To │ │ │ -0018f670: 2074 7261 6e73 6d69 7420 677a 6970 2063 transmit gzip c │ │ │ -0018f680: 6f6d 7072 6573 7365 6420 534f 4150 2f58 ompressed SOAP/X │ │ │ -0018f690: 4d4c 2064 6174 612c 2073 6574 2074 6865 ML data, set the │ │ │ -0018f6a0: 206f 7574 7075 7420 6d6f 6465 2066 6c61 output mode fla │ │ │ -0018f6b0: 6773 2074 6f20 3c63 6f64 653e 2353 4f41 gs to #SOA │ │ │ -0018f6c0: 505f 454e 435f 5a4c 4942 3c2f 636f 6465 P_ENC_ZLIB. For example:< │ │ │ -0018f6e0: 2f70 3e0a 3c64 6976 2063 6c61 7373 3d22 /p>.

.
if │ │ │ -0018f930: 3c2f 7370 616e 3e20 2873 6f61 705f 6361 (soap_ca │ │ │ -0018f940: 6c6c 5f6e 735f 5f6d 794d 6574 686f 6428 ll_ns__myMethod( │ │ │ -0018f950: 2661 6d70 3b3c 6120 636c 6173 733d 2263 &soap │ │ │ -0018f980: 3c2f 613e 2c20 2e2e 2e29 2920 3c2f 6469 , ...)) .
... // error │ │ │ -0018f9d0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
else.
... // success
.
soap_clr_omode │ │ │ -0018fad0: 3c2f 613e 2826 616d 703b 3c61 2063 6c61 (&soap, SO │ │ │ -0018fb60: 4150 5f45 4e43 5f5a 4c49 423c 2f61 3e29 AP_ENC_ZLIB) │ │ │ -0018fb70: 3b20 3c73 7061 6e20 636c 6173 733d 2263 ; // disab │ │ │ -0018fb90: 6c65 205a 6c69 6226 2333 393b 7320 677a le Zlib's gz │ │ │ -0018fba0: 6970 203c 2f73 7061 6e3e 3c2f 6469 763e ip
│ │ │ -0018fbb0: 0a3c 6469 7620 636c 6173 733d 2274 7463 .
SO │ │ │ -0018fc60: 4150 5f45 4e43 5f5a 4c49 423c 2f61 3e3c AP_ENC_ZLIB< │ │ │ -0018fc70: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
#define │ │ │ -0018fc90: 2053 4f41 505f 454e 435f 5a4c 4942 3c2f SOAP_ENC_ZLIB
soap_mode │ │ │ -0018fcc0: 2045 4e43 206f 7574 7075 7420 666c 6167 ENC output flag │ │ │ -0018fcd0: 2076 616c 7565 2074 6f20 636f 6d70 7265 value to compre │ │ │ -0018fce0: 7373 206d 6573 7361 6765 7320 7365 6e74 ss messages sent │ │ │ -0018fcf0: 2c20 7265 7175 6972 6573 207a 6c69 6220 , requires zlib │ │ │ -0018fd00: 656e 6162 6c65 6420 7769 7468 2063 6f6d enabled with com │ │ │ -0018fd10: 7069 6c65 2d74 696d 6520 666c 2e2e 2e3c pile-time fl...< │ │ │ -0018fd20: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
Defin │ │ │ -0018fd40: 6974 696f 6e3a 3c2f 623e 2073 7464 736f ition: stdso │ │ │ -0018fd50: 6170 322e 683a 3137 3838 3c2f 6469 763e ap2.h:1788
│ │ │ -0018fd60: 3c2f 6469 763e 0a3c 2f64 6976 3e3c 212d
.

This will send │ │ │ -0018fd90: 6120 636f 6d70 7265 7373 6564 2053 4f41 a compressed SOA │ │ │ -0018fda0: 502f 584d 4c20 7265 7175 6573 7420 746f P/XML request to │ │ │ -0018fdb0: 2061 2073 6572 7669 6365 2c20 7072 6f76 a service, prov │ │ │ -0018fdc0: 6964 6564 2074 6861 7420 5a6c 6962 2069 ided that Zlib i │ │ │ -0018fdd0: 7320 696e 7374 616c 6c65 6420 616e 6420 s installed and │ │ │ -0018fde0: 6c69 6e6b 6564 2077 6974 6820 7468 6520 linked with the │ │ │ -0018fdf0: 6170 706c 6963 6174 696f 6e20 616e 6420 application and │ │ │ -0018fe00: 7468 6520 636f 6d70 696c 652d 7469 6d65 the compile-time │ │ │ -0018fe10: 2066 6c61 6720 3c63 6f64 653e 2357 4954 flag #WIT │ │ │ -0018fe20: 485f 475a 4950 3c2f 636f 6465 3e20 6f70 H_GZIP op │ │ │ -0018fe30: 7469 6f6e 2077 6173 2075 7365 6420 746f tion was used to │ │ │ -0018fe40: 2063 6f6d 7069 6c65 2074 6865 2073 6f75 compile the sou │ │ │ -0018fe50: 7263 6573 2e20 5265 6365 6976 696e 6720 rces. Receiving │ │ │ -0018fe60: 636f 6d70 7265 7373 6564 2053 4f41 502f compressed SOAP/ │ │ │ -0018fe70: 584d 4c20 6f76 6572 2048 5454 5020 6569 XML over HTTP ei │ │ │ -0018fe80: 7468 6572 2069 6e20 677a 6970 206f 7220 ther in gzip or │ │ │ -0018fe90: 6465 666c 6174 6520 666f 726d 6174 7320 deflate formats │ │ │ -0018fea0: 6973 2061 7574 6f6d 6174 6963 2e20 5468 is automatic. Th │ │ │ -0018feb0: 6520 3c63 6f64 653e 2353 4f41 505f 454e e #SOAP_EN │ │ │ -0018fec0: 435f 5a4c 4942 3c2f 636f 6465 3e20 666c C_ZLIB fl │ │ │ -0018fed0: 6167 2064 6f65 7320 6e6f 7420 6861 7665 ag does not have │ │ │ -0018fee0: 2074 6f20 6265 2073 6574 2061 7420 7468 to be set at th │ │ │ -0018fef0: 6520 7365 7276 6572 2073 6964 6520 746f e server side to │ │ │ -0018ff00: 2061 6363 6570 7420 636f 6d70 7265 7373 accept compress │ │ │ -0018ff10: 6564 206d 6573 7361 6765 732e 2052 6561 ed messages. Rea │ │ │ -0018ff20: 6469 6e67 2061 6e64 2072 6563 6569 7669 ding and receivi │ │ │ -0018ff30: 6e67 2067 7a69 7020 636f 6d70 7265 7373 ng gzip compress │ │ │ -0018ff40: 6564 2053 4f41 502f 584d 4c20 7769 7468 ed SOAP/XML with │ │ │ -0018ff50: 6f75 7420 4854 5450 2068 6561 6465 7273 out HTTP headers │ │ │ -0018ff60: 2028 652e 672e 2077 6974 6820 6f74 6865 (e.g. with othe │ │ │ -0018ff70: 7220 7472 616e 7370 6f72 7420 7072 6f74 r transport prot │ │ │ -0018ff80: 6f63 6f6c 7329 2069 7320 616c 736f 2061 ocols) is also a │ │ │ -0018ff90: 7574 6f6d 6174 6963 2e3c 2f70 3e0a 3c70 utomatic.

.

To control the │ │ │ -0018ffb0: 6c65 7665 6c20 6f66 2063 6f6d 7072 6573 level of compres │ │ │ -0018ffc0: 7369 6f6e 2066 6f72 206f 7574 626f 756e sion for outboun │ │ │ -0018ffd0: 6420 6d65 7373 6167 6573 2c20 796f 7520 d messages, you │ │ │ -0018ffe0: 6361 6e20 7365 7420 7468 6520 3c63 6f64 can set the soap::z_le │ │ │ -001900b0: 7665 6c3c 2f61 3e3c 2f63 6f64 653e 2074 vel t │ │ │ -001900c0: 6f20 6120 7661 6c75 6520 6265 7477 6565 o a value betwee │ │ │ -001900d0: 6e20 3120 616e 6420 392c 2077 6865 7265 n 1 and 9, where │ │ │ -001900e0: 2031 2069 7320 7468 6520 6265 7374 2073 1 is the best s │ │ │ -001900f0: 7065 6564 2061 6e64 2039 2069 7320 7468 peed and 9 is th │ │ │ -00190100: 6520 6265 7374 2063 6f6d 7072 6573 7369 e best compressi │ │ │ -00190110: 6f6e 2028 6465 6661 756c 7420 6973 2036 on (default is 6 │ │ │ -00190120: 292e 2046 6f72 2065 7861 6d70 6c65 3c2f ). For example.

│ │ │ -001901b0: 736f 6170 5f69 6e69 743c 2f61 3e28 2661 soap_init(&a │ │ │ -001901c0: 6d70 3b3c 6120 636c 6173 733d 2263 6f64 mp;soap);
..
soap.z_level │ │ │ -001903b0: 203d 2039 3b20 3c73 7061 6e20 636c 6173 = 9; // b │ │ │ -001903d0: 6573 7420 636f 6d70 7265 7373 696f 6e20 est compression │ │ │ -001903e0: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
.unsigned short │ │ │ -001904c0: 207a 5f6c 6576 656c 3c2f 6469 763e 3c64 z_level
User-definable │ │ │ -001904f0: 636f 6d70 7265 7373 696f 6e20 6c65 7665 compression leve │ │ │ -00190500: 6c20 666f 7220 677a 6970 2063 6f6d 7072 l for gzip compr │ │ │ -00190510: 6573 7369 6f6e 2028 303d 6e6f 6e65 2c20 ession (0=none, │ │ │ -00190520: 313d 6661 7374 2074 6f20 393d 6265 7374 1=fast to 9=best │ │ │ -00190530: 2920 6465 6661 756c 7420 6c65 7665 6c20 ) default level │ │ │ -00190540: 6973 2036 2e3c 2f64 6976 3e3c 6469 7620 is 6.
Definition: │ │ │ -00190570: 2073 7464 736f 6170 322e 683a 3337 3034 stdsoap2.h:3704 │ │ │ -00190580: 3c2f 6469 763e 3c2f 6469 763e 0a3c 2f64
.

To verify │ │ │ -001905b0: 2061 6e64 206d 6f6e 6974 6f72 2063 6f6d and monitor com │ │ │ -001905c0: 7072 6573 7369 6f6e 2072 6174 6573 2c20 pression rates, │ │ │ -001905d0: 796f 7520 6361 6e20 7573 6520 7468 6520 you can use the │ │ │ -001905e0: 7661 6c75 6573 203c 636f 6465 3e3c 6120 values soap:: │ │ │ -001906a0: 7a5f 7261 7469 6f5f 696e 3c2f 613e 3c2f z_ratio_in and │ │ │ -001906c0: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap::z │ │ │ -00190770: 5f72 6174 696f 5f6f 7574 3c2f 613e 3c2f _ratio_out. These two │ │ │ -00190790: 2066 6c6f 6174 2076 616c 7565 7320 6c69 float values li │ │ │ -001907a0: 6520 6265 7477 6565 6e20 302e 3020 616e e between 0.0 an │ │ │ -001907b0: 6420 312e 3020 616e 6420 6578 7072 6573 d 1.0 and expres │ │ │ -001907c0: 7320 7468 6520 7261 7469 6f20 6f66 2074 s the ratio of t │ │ │ -001907d0: 6865 2063 6f6d 7072 6573 7365 6420 6d65 he compressed me │ │ │ -001907e0: 7373 6167 6520 6c65 6e67 7468 206f 7665 ssage length ove │ │ │ -001907f0: 7220 756e 636f 6d70 7265 7373 6564 206d r uncompressed m │ │ │ -00190800: 6573 7361 6765 206c 656e 6774 682e 3c2f essage length..

if ( │ │ │ -00190860: 736f 6170 5f63 616c 6c5f 6e73 5f5f 6d79 soap_call_ns__my │ │ │ -00190870: 4d65 7468 6f64 2826 616d 703b 3c61 2063 Method(&soap, ... │ │ │ -001908b0: 2929 3c2f 6469 763e 0a3c 6469 7620 636c ))
.
{.
... // error │ │ │ -00190910: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
}
│ │ │ -00190930: 0a3c 6469 7620 636c 6173 733d 226c 696e .
els │ │ │ -00190960: 653c 2f73 7061 6e3e 3c2f 6469 763e 0a3c e
.< │ │ │ -00190970: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -00190980: 3e7b 3c2f 6469 763e 0a3c 6469 7620 636c >{
.
pri │ │ │ -001909a0: 6e74 6628 3c73 7061 6e20 636c 6173 733d ntf( │ │ │ -001909c0: 2671 756f 743b 436f 6d70 7265 7373 696f "Compressio │ │ │ -001909d0: 6e20 7261 7469 6f3a 2025 6625 2520 2869 n ratio: %f%% (i │ │ │ -001909e0: 6e29 2025 6625 2520 286f 7574 295c 6e26 n) %f%% (out)\n& │ │ │ -001909f0: 7175 6f74 3b3c 2f73 7061 6e3e 2c20 3130 quot;, 10 │ │ │ -00190a00: 302a 3c61 2063 6c61 7373 3d22 636f 6465 0*soap.z_rat │ │ │ -00190a80: 696f 5f6f 7574 3c2f 613e 2c20 3130 302a io_out, 100* │ │ │ -00190a90: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap. │ │ │ -00190ac0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 z_ratio │ │ │ -00190b10: 5f69 6e3c 2f61 3e29 3b20 3c2f 6469 763e _in);
│ │ │ -00190b20: 0a3c 6469 7620 636c 6173 733d 226c 696e .
... / │ │ │ -00190b50: 2f20 7375 6363 6573 733c 2f73 7061 6e3e / success │ │ │ -00190b60: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
}
│ │ │ -00190b80: 0a3c 6469 7620 636c 6173 733d 2274 7463 .
soap:: │ │ │ -00190c20: 7a5f 7261 7469 6f5f 696e 3c2f 613e 3c2f z_ratio_in
float z_ │ │ │ -00190c50: 7261 7469 6f5f 696e 3c2f 6469 763e 3c64 ratio_in
The compression │ │ │ -00190c80: 2072 6174 696f 203d 2063 6f6d 7072 6573 ratio = compres │ │ │ -00190c90: 7365 642e 7369 7a65 2f75 6e63 6f6d 7072 sed.size/uncompr │ │ │ -00190ca0: 6573 7365 642e 7369 7a65 206f 6620 7468 essed.size of th │ │ │ -00190cb0: 6520 636f 6d70 7265 7373 6564 206d 6573 e compressed mes │ │ │ -00190cc0: 7361 6765 2072 6563 6569 7665 642e 3c2f sage received.
Defini │ │ │ -00190cf0: 7469 6f6e 3a3c 2f62 3e20 7374 6473 6f61 tion: stdsoa │ │ │ -00190d00: 7032 2e68 3a33 3730 393c 2f64 6976 3e3c p2.h:3709
< │ │ │ -00190d10: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
< │ │ │ -00190d60: 6469 7620 636c 6173 733d 2274 746e 616d div class="ttnam │ │ │ -00190d70: 6522 3e3c 6120 6872 6566 3d22 7374 7275 e">s │ │ │ -00190db0: 6f61 703a 3a7a 5f72 6174 696f 5f6f 7574 oap::z_ratio_out │ │ │ -00190dc0: 3c2f 613e 3c2f 6469 763e 3c64 6976 2063
fl │ │ │ -00190de0: 6f61 7420 7a5f 7261 7469 6f5f 6f75 743c oat z_ratio_out< │ │ │ -00190df0: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
The comp │ │ │ -00190e10: 7265 7373 696f 6e20 7261 7469 6f20 3d20 ression ratio = │ │ │ -00190e20: 636f 6d70 7265 7373 6564 2e73 697a 652f compressed.size/ │ │ │ -00190e30: 756e 636f 6d70 7265 7373 6564 2e73 697a uncompressed.siz │ │ │ -00190e40: 6520 6f66 2074 6865 2063 6f6d 7072 6573 e of the compres │ │ │ -00190e50: 7365 6420 6d65 7373 6167 6520 7365 6e74 sed message sent │ │ │ -00190e60: 2e3c 2f64 6976 3e3c 6469 7620 636c 6173 .
Def │ │ │ -00190e80: 696e 6974 696f 6e3a 3c2f 623e 2073 7464 inition: std │ │ │ -00190e90: 736f 6170 322e 683a 3337 3134 3c2f 6469 soap2.h:3714
.
< │ │ │ -00190eb0: 212d 2d20 6672 6167 6d65 6e74 202d 2d3e !-- fragment --> │ │ │ -00190ec0: 3c70 3e4e 6f74 653a 206c 6f77 6572 2072

Note: lower r │ │ │ -00190ed0: 6174 696f 7320 6d65 616e 2068 6967 6865 atios mean highe │ │ │ -00190ee0: 7220 636f 6d70 7265 7373 696f 6e20 7261 r compression ra │ │ │ -00190ef0: 7465 732e 3c2f 703e 0a3c 703e 436f 6d70 tes.

.

Comp │ │ │ -00190f00: 7265 7373 6564 2074 7261 6e73 6665 7273 ressed transfers │ │ │ -00190f10: 2072 6571 7569 7265 2062 7566 6665 7269 require bufferi │ │ │ -00190f20: 6e67 2074 6865 2065 6e74 6972 6520 6f75 ng the entire ou │ │ │ -00190f30: 7470 7574 206d 6573 7361 6765 2074 6f20 tput message to │ │ │ -00190f40: 6465 7465 726d 696e 6520 4854 5450 206d determine HTTP m │ │ │ -00190f50: 6573 7361 6765 206c 656e 6774 682e 2054 essage length. T │ │ │ -00190f60: 6869 7320 6d65 616e 7320 7468 6174 2074 his means that t │ │ │ -00190f70: 6865 203c 636f 6465 3e23 534f 4150 5f49 he #SOAP_I │ │ │ -00190f80: 4f5f 5354 4f52 453c 2f63 6f64 653e 2066 O_STORE f │ │ │ -00190f90: 6c61 6720 6973 2061 7574 6f6d 6174 6963 lag is automatic │ │ │ -00190fa0: 616c 6c79 2073 6574 2077 6865 6e20 7468 ally set when th │ │ │ -00190fb0: 6520 3c63 6f64 653e 2353 4f41 505f 454e e #SOAP_EN │ │ │ -00190fc0: 435f 5a4c 4942 3c2f 636f 6465 3e20 666c C_ZLIB fl │ │ │ -00190fd0: 6167 2069 7320 7365 7420 746f 2073 656e ag is set to sen │ │ │ -00190fe0: 6420 636f 6d70 7265 7373 6564 206d 6573 d compressed mes │ │ │ -00190ff0: 7361 6765 732e 2054 6865 2075 7365 206f sages. The use o │ │ │ -00191000: 6620 4854 5450 2063 6875 6e6b 696e 6720 f HTTP chunking │ │ │ -00191010: 7369 676e 6966 6963 616e 746c 7920 7265 significantly re │ │ │ -00191020: 6475 6365 7320 6d65 6d6f 7279 2075 7361 duces memory usa │ │ │ -00191030: 6765 2061 6e64 206d 6179 2073 7065 6564 ge and may speed │ │ │ -00191040: 2075 7020 7468 6520 7472 616e 736d 6973 up the transmis │ │ │ -00191050: 7369 6f6e 206f 6620 636f 6d70 7265 7373 sion of compress │ │ │ -00191060: 6564 2053 4f41 502f 584d 4c20 6d65 7373 ed SOAP/XML mess │ │ │ -00191070: 6167 6573 2e20 5468 6973 2069 7320 6163 ages. This is ac │ │ │ -00191080: 636f 6d70 6c69 7368 6564 2062 7920 7365 complished by se │ │ │ -00191090: 7474 696e 6720 7468 6520 3c63 6f64 653e tting the │ │ │ -001910a0: 2353 4f41 505f 494f 5f43 4855 4e4b 3c2f #SOAP_IO_CHUNK flag with │ │ │ -001910c0: 3c63 6f64 653e 2353 4f41 505f 454e 435f #SOAP_ENC_ │ │ │ -001910d0: 5a4c 4942 3c2f 636f 6465 3e20 666f 7220 ZLIB for │ │ │ -001910e0: 7468 6520 6f75 7470 7574 206d 6f64 652e the output mode. │ │ │ -001910f0: 2048 6f77 6576 6572 2c20 736f 6d65 2057 However, some W │ │ │ -00191100: 6562 2073 6572 7665 7273 2064 6f20 6e6f eb servers do no │ │ │ -00191110: 7420 6163 6365 7074 2048 5454 5020 6368 t accept HTTP ch │ │ │ -00191120: 756e 6b65 6420 7265 7175 6573 7420 6d65 unked request me │ │ │ -00191130: 7373 6167 6573 2028 6576 656e 2077 6865 ssages (even whe │ │ │ -00191140: 6e20 7468 6579 2072 6574 7572 6e20 4854 n they return HT │ │ │ -00191150: 5450 2063 6875 6e6b 6564 206d 6573 7361 TP chunked messa │ │ │ -00191160: 6765 7321 292e 2053 7461 6e64 2d61 6c6f ges!). Stand-alo │ │ │ -00191170: 6e65 2067 534f 4150 2073 6572 7669 6365 ne gSOAP service │ │ │ -00191180: 7320 616c 7761 7973 2061 6363 6570 7420 s always accept │ │ │ -00191190: 6368 756e 6b65 6420 7265 7175 6573 7420 chunked request │ │ │ -001911a0: 6d65 7373 6167 6573 2e3c 2f70 3e0a 3c70 messages.

.

To restrict the │ │ │ -001911c0: 2063 6f6d 7072 6573 7369 6f6e 2074 6f20 compression to │ │ │ -001911d0: 7468 6520 6465 666c 6174 6520 666f 726d the deflate form │ │ │ -001911e0: 6174 206f 6e6c 792c 2063 6f6d 7069 6c65 at only, compile │ │ │ -001911f0: 2074 6865 2073 6f75 7263 6573 2077 6974 the sources wit │ │ │ -00191200: 6820 7468 6520 636f 6d70 696c 652d 7469 h the compile-ti │ │ │ -00191210: 6d65 2066 6c61 6720 3c63 6f64 653e 2357 me flag #W │ │ │ -00191220: 4954 485f 5a4c 4942 3c2f 636f 6465 3e2e ITH_ZLIB. │ │ │ -00191230: 2054 6869 7320 6c69 6d69 7473 2063 6f6d This limits com │ │ │ -00191240: 7072 6573 7369 6f6e 2061 6e64 2064 6563 pression and dec │ │ │ -00191250: 6f6d 7072 6573 7369 6f6e 2074 6f20 7468 ompression to th │ │ │ -00191260: 6520 6465 666c 6174 6520 666f 726d 6174 e deflate format │ │ │ -00191270: 2e20 4f6e 6c79 2070 6c61 696e 2061 6e64 . Only plain and │ │ │ -00191280: 2064 6566 6c61 7465 6420 6d65 7373 6167 deflated messag │ │ │ -00191290: 6573 2063 616e 2062 6520 6578 6368 616e es can be exchan │ │ │ -001912a0: 6765 642c 2067 7a69 7020 6973 206e 6f74 ged, gzip is not │ │ │ -001912b0: 2073 7570 706f 7274 6564 2077 6974 6820 supported with │ │ │ -001912c0: 7468 6973 206f 7074 696f 6e2e 2052 6563 this option. Rec │ │ │ -001912d0: 6569 7669 6e67 2067 7a69 7020 636f 6d70 eiving gzip comp │ │ │ -001912e0: 7265 7373 6564 2063 6f6e 7465 6e74 2069 ressed content i │ │ │ -001912f0: 7320 6175 746f 6d61 7469 632c 2065 7665 s automatic, eve │ │ │ -00191300: 6e20 696e 2074 6865 2061 6273 656e 6365 n in the absence │ │ │ -00191310: 206f 6620 4854 5450 2068 6561 6465 7273 of HTTP headers │ │ │ -00191320: 2e20 5265 6365 6976 696e 6720 6465 666c . Receiving defl │ │ │ -00191330: 6174 6520 636f 6d70 7265 7373 6564 2063 ate compressed c │ │ │ -00191340: 6f6e 7465 6e74 2069 7320 6e6f 7420 6175 ontent is not au │ │ │ -00191350: 746f 6d61 7469 6320 696e 2074 6865 2061 tomatic in the a │ │ │ -00191360: 6273 656e 6365 206f 6620 4854 5450 2068 bsence of HTTP h │ │ │ -00191370: 6561 6465 7273 2061 6e64 2072 6571 7569 eaders and requi │ │ │ -00191380: 7265 7320 7468 6520 666c 6167 203c 636f res the flag #SOAP_ENC_ZLI │ │ │ -001913a0: 423c 2f63 6f64 653e 2074 6f20 6265 2073 B to be s │ │ │ -001913b0: 6574 2066 6f72 2074 6865 2069 6e70 7574 et for the input │ │ │ -001913c0: 206d 6f64 6520 746f 2064 6563 6f6d 7072 mode to decompr │ │ │ -001913d0: 6573 7320 6465 666c 6174 6564 2064 6174 ess deflated dat │ │ │ -001913e0: 612e 3c2f 703e 0a3c 646c 2063 6c61 7373 a.

.
Warning
It is imp │ │ │ -00191420: 6f72 7461 6e74 2074 6861 7420 7468 6520 ortant that the │ │ │ -00191430: 3c63 6f64 653e 2357 4954 485f 475a 4950 #WITH_GZIP │ │ │ -00191440: 3c2f 636f 6465 3e20 616e 6420 3c63 6f64 and #WITH_ZLIB macros must │ │ │ -00191470: 6265 2063 6f6e 7369 7374 656e 746c 7920 be consistently │ │ │ -00191480: 6465 6669 6e65 6420 746f 2063 6f6d 7069 defined to compi │ │ │ -00191490: 6c65 2074 6865 2073 6f75 7263 6573 2c20 le the sources, │ │ │ -001914a0: 7375 6368 2061 7320 3c65 6d3e 3c63 6f64 such as gsoap/stdsoap2 │ │ │ -001914c0: 2e63 7070 3c2f 636f 6465 3e3c 2f65 6d3e .cpp │ │ │ -001914d0: 2c20 3c65 6d3e 3c63 6f64 653e 736f 6170 , soap │ │ │ -001914e0: 432e 6370 703c 2f63 6f64 653e 3c2f 656d C.cpp, soa │ │ │ -00191500: 7043 6c69 656e 742e 6370 703c 2f63 6f64 pClient.cpp, soapServer.cp │ │ │ -00191530: 703c 2f63 6f64 653e 3c2f 656d 3e2c 2061 p, a │ │ │ -00191540: 6e64 2061 6c6c 2061 7070 6c69 6361 7469 nd all applicati │ │ │ -00191550: 6f6e 2073 6f75 7263 6573 2074 6861 7420 on sources that │ │ │ -00191560: 696e 636c 7564 6520 3c65 6d3e 3c63 6f64 include gsoap/stdsoap2 │ │ │ -00191580: 2e68 3c2f 636f 6465 3e3c 2f65 6d3e 206f .h o │ │ │ -00191590: 7220 3c65 6d3e 3c63 6f64 653e 736f 6170 r soap │ │ │ -001915a0: 482e 683c 2f63 6f64 653e 3c2f 656d 3e2e H.h. │ │ │ -001915b0: 2049 6620 7468 6520 6d61 6372 6f73 2061 If the macros a │ │ │ -001915c0: 7265 206e 6f74 2063 6f6e 7369 7374 656e re not consisten │ │ │ -001915d0: 746c 7920 7573 6564 2c20 7468 6520 6170 tly used, the ap │ │ │ -001915e0: 706c 6963 6174 696f 6e20 7769 6c6c 2063 plication will c │ │ │ -001915f0: 7261 7368 2064 7565 2074 6f20 6120 6d69 rash due to a mi │ │ │ -00191600: 736d 6174 6368 6573 2069 6e20 7468 6520 smatches in the │ │ │ -00191610: 6465 636c 6172 6174 696f 6e20 616e 6420 declaration and │ │ │ -00191620: 6163 6365 7373 206f 6620 7468 6520 3c63 access of the │ │ │ -00191680: 736f 6170 3c2f 613e 3c2f 636f 6465 3e20 soap │ │ │ -00191690: 636f 6e74 6578 742e 3c2f 6464 3e3c 2f64 context.
.

.... Back to t │ │ │ -001916c0: 6162 6c65 206f 6620 636f 6e74 656e 7473 able of contents │ │ │ -001916d0: 3c2f 613e 3c2f 703e 0a3c 6832 3e3c 6120

.

.Client-sid │ │ │ -00191710: 6520 636f 6f6b 6965 2073 7570 706f 7274 e cookie support │ │ │ -00191720: 3c2f 6832 3e0a 3c70 3e43 6c69 656e 742d

.

Client- │ │ │ -00191730: 7369 6465 2063 6f6f 6b69 6520 7375 7070 side cookie supp │ │ │ -00191740: 6f72 7420 6973 206f 7074 696f 6e61 6c2e ort is optional. │ │ │ -00191750: 2054 6f20 656e 6162 6c65 2063 6f6f 6b69 To enable cooki │ │ │ -00191760: 6520 7375 7070 6f72 742c 2063 6f6d 7069 e support, compi │ │ │ -00191770: 6c65 2061 6c6c 2073 6f75 7263 6573 2077 le all sources w │ │ │ -00191780: 6974 6820 7468 6520 636f 6d70 696c 652d ith the compile- │ │ │ -00191790: 7469 6d65 2066 6c61 6720 3c63 6f64 653e time flag │ │ │ -001917a0: 2357 4954 485f 434f 4f4b 4945 533c 2f63 #WITH_COOKIES, for exampl │ │ │ -001917c0: 653a 203c 2f70 3e3c 7072 6520 636c 6173 e:

 c+
│ │ │ -001917e0: 2b20 2d44 5749 5448 5f43 4f4f 4b49 4553  + -DWITH_COOKIES
│ │ │ -001917f0: 202d 6f20 6d79 636c 6965 6e74 2073 7464   -o myclient std
│ │ │ -00191800: 736f 6170 322e 6370 7020 736f 6170 432e  soap2.cpp soapC.
│ │ │ -00191810: 6370 7020 736f 6170 436c 6965 6e74 2e63  cpp soapClient.c
│ │ │ -00191820: 7070 0a3c 2f70 7265 3e3c 703e 206f 7220  pp.

or │ │ │ -00191830: 6164 6420 7468 6520 666f 6c6c 6f77 696e add the followin │ │ │ -00191840: 6720 6c69 6e65 2074 6f20 3c65 6d3e 3c63 g line to stdsoap.h:

.< │ │ │ -00191870: 6469 7620 636c 6173 733d 2266 7261 676d div class="fragm │ │ │ -00191880: 656e 7422 3e3c 6469 7620 636c 6173 733d ent">
#define WITH_C │ │ │ -001918c0: 4f4f 4b49 4553 3c2f 7370 616e 3e3c 2f64 OOKIES.

Cl │ │ │ -001918f0: 6965 6e74 2d73 6964 6520 636f 6f6b 6965 ient-side cookie │ │ │ -00191900: 2073 7570 706f 7274 2069 7320 6675 6c6c support is full │ │ │ -00191910: 7920 6175 746f 6d61 7469 632e 2053 6f20 y automatic. So │ │ │ -00191920: 6a75 7374 2063 6f6d 7069 6c65 203c 656d just compile gsoap/std │ │ │ -00191940: 736f 6170 322e 6370 703c 2f63 6f64 653e soap2.cpp │ │ │ -00191950: 3c2f 656d 3e20 7769 7468 2074 6865 2063 with the c │ │ │ -00191960: 6f6d 7069 6c65 2d74 696d 6520 666c 6167 ompile-time flag │ │ │ -00191970: 203c 636f 6465 3e23 5749 5448 5f43 4f4f #WITH_COO │ │ │ -00191980: 4b49 4553 3c2f 636f 6465 3e20 746f 2065 KIES to e │ │ │ -00191990: 6e61 626c 6520 636f 6f6b 6965 2d62 6173 nable cookie-bas │ │ │ -001919a0: 6564 2073 6573 7369 6f6e 2063 6f6e 7472 ed session contr │ │ │ -001919b0: 6f6c 2069 6e20 796f 7572 2063 6c69 656e ol in your clien │ │ │ -001919c0: 742e 3c2f 703e 0a3c 703e 4120 636f 6f6b t.

.

A cook │ │ │ -001919d0: 6965 2073 746f 7265 2077 6974 6820 636f ie store with co │ │ │ -001919e0: 6f6b 6965 7320 6973 206b 6570 7420 616e okies is kept an │ │ │ -001919f0: 6420 7265 7475 726e 6564 2074 6f20 7468 d returned to th │ │ │ -00191a00: 6520 6170 7072 6f70 7269 6174 6520 7365 e appropriate se │ │ │ -00191a10: 7276 6572 7320 7768 656e 2074 6865 2063 rvers when the c │ │ │ -00191a20: 6c69 656e 7420 636f 6e6e 6563 7473 2074 lient connects t │ │ │ -00191a30: 6f20 7468 6573 6520 7365 7276 6572 732e o these servers. │ │ │ -00191a40: 2043 6f6f 6b69 6573 2061 7265 206e 6f74 Cookies are not │ │ │ -00191a50: 2061 7574 6f6d 6174 6963 616c 6c79 2073 automatically s │ │ │ -00191a60: 6176 6564 2074 6f20 6120 6669 6c65 2062 aved to a file b │ │ │ -00191a70: 7920 6120 636c 6965 6e74 2e20 416e 2065 y a client. An e │ │ │ -00191a80: 7861 6d70 6c65 2063 6f6f 6b69 6520 6669 xample cookie fi │ │ │ -00191a90: 6c65 206d 616e 6167 6572 2069 7320 696e le manager is in │ │ │ -00191aa0: 636c 7564 6564 2061 7320 616e 2065 7874 cluded as an ext │ │ │ -00191ab0: 7261 7320 696e 2074 6865 2067 534f 4150 ras in the gSOAP │ │ │ -00191ac0: 2070 6163 6b61 6765 2e20 596f 7520 6361 package. You ca │ │ │ -00191ad0: 6e20 7265 6d6f 7665 2061 6c6c 2063 6f6f n remove all coo │ │ │ -00191ae0: 6b69 6573 2066 726f 6d20 6120 3c63 6f64 kies from a so │ │ │ -00191b40: 6170 3c2f 613e 3c2f 636f 6465 3e20 636f ap co │ │ │ -00191b50: 6e74 6578 7420 6279 2063 616c 6c69 6e67 ntext by calling │ │ │ -00191b60: 203c 636f 6465 3e73 6f61 705f 6672 6565 soap_free │ │ │ -00191b70: 5f63 6f6f 6b69 6573 2873 6f61 7029 3c2f _cookies(soap), which als │ │ │ -00191b90: 6f20 6861 7070 656e 7320 7768 656e 2079 o happens when y │ │ │ -00191ba0: 6f75 2063 616c 6c20 3c63 6f64 653e 736f ou call so │ │ │ -00191bb0: 6170 5f64 6f6e 6528 736f 6170 293c 2f63 ap_done(soap).

.

To │ │ │ -00191bd0: 6176 6f69 6420 2263 6f6f 6b69 6520 7374 avoid "cookie st │ │ │ -00191be0: 6f72 6d73 2220 6361 7573 6564 2062 7920 orms" caused by │ │ │ -00191bf0: 6d61 6c69 6369 6f75 7320 7365 7276 6572 malicious server │ │ │ -00191c00: 7320 7468 6174 2072 6574 7572 6e20 616e s that return an │ │ │ -00191c10: 2075 6e72 6561 736f 6e61 626c 6520 616d unreasonable am │ │ │ -00191c20: 6f75 6e74 206f 6620 636f 6f6b 6965 732c ount of cookies, │ │ │ -00191c30: 2067 534f 4150 2063 6c69 656e 7473 2f73 gSOAP clients/s │ │ │ -00191c40: 6572 7665 7273 2061 7265 206c 696d 6974 ervers are limit │ │ │ -00191c50: 6564 2074 6f20 6120 636f 6f6b 6965 2073 ed to a cookie s │ │ │ -00191c60: 746f 7265 2073 697a 6520 6f66 203c 636f tore size of soap: │ │ │ -00191d30: 3a63 6f6f 6b69 655f 6d61 783c 2f61 3e3c :cookie_max< │ │ │ -00191d40: 2f63 6f64 653e 2074 6861 7420 7468 6520 /code> that the │ │ │ -00191d50: 7573 6572 2063 616e 2063 6861 6e67 652c user can change, │ │ │ -00191d60: 2066 6f72 2065 7861 6d70 6c65 3a3c 2f70 for example:

.
│ │ │ -00191db0: 7374 7275 6374 203c 2f73 7061 6e3e 3c61 struct soap *< │ │ │ -00191df0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -00191e00: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ -00191e10: 6874 6d6c 223e 736f 6170 3c2f 613e 203d html">soap = │ │ │ -00191e20: 203c 6120 636c 6173 733d 2263 6f64 6522 soap_new();
.< │ │ │ -00191ea0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -00191eb0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ -00191ec0: 6874 6d6c 223e 736f 6170 3c2f 613e 2d26 html">soap-& │ │ │ -00191ed0: 6774 3b3c 6120 636c 6173 733d 2263 6f64 gt;cook │ │ │ -00191f20: 6965 5f6d 6178 3c2f 613e 203d 2031 303b ie_max = 10; │ │ │ -00191f30: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ -00191f80: 3c64 6976 2063 6c61 7373 3d22 7474 6e61
in │ │ │ -00192000: 7420 636f 6f6b 6965 5f6d 6178 3c2f 6469 t cookie_max
User-defina │ │ │ -00192030: 626c 6520 6d61 7869 6d75 6d20 6e75 6d62 ble maximum numb │ │ │ -00192040: 6572 206f 6620 6163 7469 7665 2063 6f6f er of active coo │ │ │ -00192050: 6b69 6573 2061 6c6c 6f77 6564 2074 6f20 kies allowed to │ │ │ -00192060: 6265 2073 6574 2077 6974 6820 736f 6170 be set with soap │ │ │ -00192070: 5f73 6574 5f63 6f6f 6b69 6520 6265 666f _set_cookie befo │ │ │ -00192080: 7265 2063 6f6f 6b69 6520 2e2e 2e3c 2f64 re cookie ...
Definit │ │ │ -001920b0: 696f 6e3a 3c2f 623e 2073 7464 736f 6170 ion: stdsoap │ │ │ -001920c0: 322e 683a 3239 3733 3c2f 6469 763e 3c2f 2.h:2973
.

T │ │ │ -001920f0: 6865 2063 6f6f 6b69 6520 7374 6f72 6520 he cookie store │ │ │ -00192100: 6973 2061 206c 696e 6b65 6420 6c69 7374 is a linked list │ │ │ -00192110: 206f 6620 3c63 6f64 653e 3c61 2063 6c61 of soap_cookie │ │ │ -00192170: 3c2f 636f 6465 3e20 7374 7275 6374 7572 structur │ │ │ -00192180: 6573 2070 6f69 6e74 6564 2074 6f20 6279 es pointed to by │ │ │ -00192190: 203c 636f 6465 3e3c 6120 636c 6173 733d soap::cookie │ │ │ -00192220: 733c 2f61 3e3c 2f63 6f64 653e 2e3c 2f70 s.

.

Since the c │ │ │ -00192240: 6f6f 6b69 6520 7374 6f72 6520 6973 206c ookie store is l │ │ │ -00192250: 696e 6b65 6420 746f 2074 6865 2063 7572 inked to the cur │ │ │ -00192260: 7265 6e74 203c 636f 6465 3e3c 6120 636c rent soap< │ │ │ -001922c0: 2f63 6f64 653e 2063 6f6e 7465 7874 2c20 /code> context, │ │ │ -001922d0: 616e 6420 6561 6368 2074 6872 6561 6420 and each thread │ │ │ -001922e0: 6d75 7374 2075 7365 2069 7473 206f 776e must use its own │ │ │ -001922f0: 2063 6f6e 7465 7874 2c20 6561 6368 2074 context, each t │ │ │ -00192300: 6872 6561 6420 616c 736f 2068 6173 2069 hread also has i │ │ │ -00192310: 7473 206f 776e 2063 6f6f 6b69 6520 7374 ts own cookie st │ │ │ -00192320: 6f72 652e 3c2f 703e 0a3c 703e f09f 949d ore.

.

.... │ │ │ -00192330: 203c 6120 6872 6566 3d22 2322 3e42 6163 Bac │ │ │ -00192340: 6b20 746f 2074 6162 6c65 206f 6620 636f k to table of co │ │ │ -00192350: 6e74 656e 7473 3c2f 613e 3c2f 703e 0a3c ntents

.< │ │ │ -00192360: 6832 3e3c 6120 636c 6173 733d 2261 6e63 h2>.Serv │ │ │ -00192390: 6572 2d73 6964 6520 636f 6f6b 6965 2073 er-side cookie s │ │ │ -001923a0: 7570 706f 7274 3c2f 6832 3e0a 3c70 3e54 upport.

T │ │ │ -001923b0: 6869 7320 6665 6174 7572 6520 6973 206e his feature is n │ │ │ -001923c0: 6f74 2072 6563 6f6d 6d65 6e64 6564 2074 ot recommended t │ │ │ -001923d0: 6f20 696d 706c 656d 656e 7420 7374 6174 o implement stat │ │ │ -001923e0: 6520 696e 2073 7461 6e64 2d61 6c6f 6e65 e in stand-alone │ │ │ -001923f0: 2073 6572 7665 7273 2e20 436f 6f6b 6965 servers. Cookie │ │ │ -00192400: 7320 6d61 7920 7265 7175 6972 6520 6120 s may require a │ │ │ -00192410: 6661 6972 2061 6d6f 756e 7420 6f66 2070 fair amount of p │ │ │ -00192420: 726f 6365 7373 696e 6720 6f76 6572 6865 rocessing overhe │ │ │ -00192430: 6164 2061 6e64 2061 7265 206e 6f74 2069 ad and are not i │ │ │ -00192440: 6e20 6661 6374 206e 6565 6465 6420 746f n fact needed to │ │ │ -00192450: 2069 6d70 6c65 6d65 6e74 2073 7461 7465 implement state │ │ │ -00192460: 6675 6c20 7365 7276 6963 6573 2c20 7768 ful services, wh │ │ │ -00192470: 6963 6820 6973 2074 7970 6963 616c 6c79 ich is typically │ │ │ -00192480: 2070 6572 666f 726d 6564 2077 6974 6820 performed with │ │ │ -00192490: 7365 7373 696f 6e20 4944 7320 696e 2058 session IDs in X │ │ │ -001924a0: 4d4c 2f4a 534f 4e20 6d65 7373 6167 6573 ML/JSON messages │ │ │ -001924b0: 206f 7220 6279 2070 6173 7369 6e67 2074 or by passing t │ │ │ -001924c0: 6865 2073 6573 7369 6f6e 2049 4473 2076 he session IDs v │ │ │ -001924d0: 6961 2074 6865 2055 524c 2e3c 2f70 3e0a ia the URL.

. │ │ │ -001924e0: 3c70 3e53 6572 7665 722d 7369 6465 2063

Server-side c │ │ │ -001924f0: 6f6f 6b69 6520 7375 7070 6f72 7420 6973 ookie support is │ │ │ -00192500: 206f 7074 696f 6e61 6c2e 2054 6f20 656e optional. To en │ │ │ -00192510: 6162 6c65 2063 6f6f 6b69 6520 7375 7070 able cookie supp │ │ │ -00192520: 6f72 742c 2063 6f6d 7069 6c65 2061 6c6c ort, compile all │ │ │ -00192530: 2073 6f75 7263 6573 2077 6974 6820 636f sources with co │ │ │ -00192540: 6d70 696c 652d 7469 6d65 2066 6c61 6720 mpile-time flag │ │ │ -00192550: 3c63 6f64 653e 2357 4954 485f 434f 4f4b #WITH_COOK │ │ │ -00192560: 4945 533c 2f63 6f64 653e 3a20 3c2f 703e IES:

│ │ │ -00192570: 3c70 7265 2063 6c61 7373 3d22 6672 6167
 c++ -DWIT
│ │ │ -00192590: 485f 434f 4f4b 4945 5320 2d6f 206d 7973  H_COOKIES -o mys
│ │ │ -001925a0: 6572 7665 7220 2e2e 2e0a 3c2f 7072 653e  erver ....
│ │ │ -001925b0: 3c70 3e20 5365 6520 4150 4920 646f 6375

See API docu │ │ │ -001925c0: 6d65 6e74 6174 696f 6e20 4d6f 6475 6c65 mentation Module │ │ │ -001925d0: 203c 6120 636c 6173 733d 2265 6c22 2068 HTTP cookie fun │ │ │ -00192610: 6374 696f 6e73 3c2f 613e 2066 6f72 2074 ctions for t │ │ │ -00192620: 6865 2063 6f6f 6b69 6520 4150 4920 6675 he cookie API fu │ │ │ -00192630: 6e63 7469 6f6e 732e 2053 6565 2074 6865 nctions. See the │ │ │ -00192640: 203c 6120 6872 6566 3d22 2e2e 2f2e 2e2f HTTP s │ │ │ -00192670: 6573 7369 6f6e 7320 706c 7567 696e 3c2f essions plugin for HTTP sess │ │ │ -00192690: 696f 6e20 6d61 6e61 6765 6d65 6e74 2077 ion management w │ │ │ -001926a0: 6974 6820 636f 6f6b 6965 7320 7468 6174 ith cookies that │ │ │ -001926b0: 2069 7320 7265 7175 6972 6564 2066 6f72 is required for │ │ │ -001926c0: 2073 6572 7665 722d 7369 6465 2073 6573 server-side ses │ │ │ -001926d0: 7369 6f6e 2063 6f6e 7472 6f6c 2e20 5468 sion control. Th │ │ │ -001926e0: 6520 3c63 6f64 653e 2357 4954 485f 434f e #WITH_CO │ │ │ -001926f0: 4f4b 4945 533c 2f63 6f64 653e 2066 6c61 OKIES fla │ │ │ -00192700: 6720 6973 2075 7365 6c65 7373 2077 6974 g is useless wit │ │ │ -00192710: 686f 7574 2073 6572 7665 722d 7369 6465 hout server-side │ │ │ -00192720: 2073 6573 7369 6f6e 206d 616e 6167 656d session managem │ │ │ -00192730: 656e 7420 616e 6420 636f 6e74 726f 6c2e ent and control. │ │ │ -00192740: 3c2f 703e 0a3c 703e 4865 7265 2069 7320

.

Here is │ │ │ -00192750: 616e 206f 7665 7276 6965 7720 6f66 2074 an overview of t │ │ │ -00192760: 6865 2063 6f6f 6b69 6520 4150 4920 6675 he cookie API fu │ │ │ -00192770: 6e63 7469 6f6e 733a 3c2f 703e 0a3c 756c nctions:

.
.

T │ │ │ -00195230: 6865 2066 6f6c 6c6f 7769 6e67 2076 6172 he following var │ │ │ -00195240: 6961 626c 6573 206f 6620 7468 6520 3c63 iables of the │ │ │ -001952a0: 736f 6170 3c2f 613e 3c2f 636f 6465 3e20 soap │ │ │ -001952b0: 636f 6e74 6578 7420 6172 6520 7573 6564 context are used │ │ │ -001952c0: 2074 6f20 6465 6669 6e65 2074 6865 2063 to define the c │ │ │ -001952d0: 7572 7265 6e74 2064 6f6d 6169 6e20 616e urrent domain an │ │ │ -001952e0: 6420 7061 7468 3a3c 2f70 3e0a 3c75 6c3e d path:

.
    │ │ │ -001952f0: 0a3c 6c69 3e3c 636f 6465 3e63 6f6e 7374 .
  • const │ │ │ -00195300: 2063 6861 7220 2a20 3c61 2063 6c61 7373 char * soap:: │ │ │ -001953b0: 636f 6f6b 6965 5f64 6f6d 6169 6e3c 2f61 cookie_domain should │ │ │ -001953d0: 6265 2073 6574 2074 6f20 7468 6520 646f be set to the do │ │ │ -001953e0: 6d61 696e 2028 686f 7374 2920 6f66 2074 main (host) of t │ │ │ -001953f0: 6865 2073 6572 7669 6365 3c2f 6c69 3e0a he service
  • . │ │ │ -00195400: 3c6c 693e 3c63 6f64 653e 636f 6e73 7420
  • const │ │ │ -00195410: 6368 6172 202a 203c 6120 636c 6173 733d char * soap::coo │ │ │ -001954c0: 6b69 655f 7061 7468 3c2f 613e 3c2f 636f kie_path may be set t │ │ │ -001954e0: 6f20 7468 6520 6465 6661 756c 7420 7061 o the default pa │ │ │ -001954f0: 7468 2074 6f20 7468 6520 7365 7276 6963 th to the servic │ │ │ -00195500: 653c 2f6c 693e 0a3c 6c69 3e3c 636f 6465 e
  • .
  • int soa │ │ │ -001955d0: 703a 3a63 6f6f 6b69 655f 6d61 783c 2f61 p::cookie_max maximum │ │ │ -001955f0: 2063 6f6f 6b69 6520 6461 7461 6261 7365 cookie database │ │ │ -00195600: 2073 697a 6520 2864 6566 6175 6c74 3d33 size (default=3 │ │ │ -00195610: 3229 3c2f 6c69 3e0a 3c2f 756c 3e0a 3c70 2)
  • .
.

The soap: │ │ │ -001956d0: 3a63 6f6f 6b69 655f 7061 7468 3c2f 613e :cookie_path │ │ │ -001956e0: 3c2f 636f 6465 3e20 7661 6c75 6520 6973 value is │ │ │ -001956f0: 2075 7365 6420 746f 2066 696c 7465 7220 used to filter │ │ │ -00195700: 636f 6f6b 6965 7320 696e 7465 6e64 6564 cookies intended │ │ │ -00195710: 2066 6f72 2074 6869 7320 7365 7276 6963 for this servic │ │ │ -00195720: 6520 6163 636f 7264 696e 6720 746f 2074 e according to t │ │ │ -00195730: 6865 2070 6174 6820 7072 6566 6978 2072 he path prefix r │ │ │ -00195740: 756c 6573 206f 7574 6c69 6e65 6420 696e ules outlined in │ │ │ -00195750: 2052 4643 3231 3039 2e3c 2f70 3e0a 3c70 RFC2109.

.

The following e │ │ │ -00195770: 7861 6d70 6c65 2073 6572 7665 7220 6164 xample server ad │ │ │ -00195780: 6f70 7473 2063 6f6f 6b69 6573 2066 6f72 opts cookies for │ │ │ -00195790: 2073 6573 7369 6f6e 2063 6f6e 7472 6f6c session control │ │ │ -001957a0: 3a3c 2f70 3e0a 3c64 6976 2063 6c61 7373 :

.
int main()
│ │ │ -00195800: 0a3c 6469 7620 636c 6173 733d 226c 696e .
{
.
< │ │ │ -00195830: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -00195840: 6f72 6422 3e73 7472 7563 7420 3c2f 7370 ord">struct soap soap;
.
< │ │ │ -001958d0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -001958e0: 6f72 6474 7970 6522 3e69 6e74 3c2f 7370 ordtype">int m, s;
│ │ │ -00195900: 0a3c 6469 7620 636c 6173 733d 226c 696e .
soap_i │ │ │ -00195970: 6e69 743c 2f61 3e28 2661 6d70 3b3c 6120 nit(&soap); < │ │ │ -001959b0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
soap.cookie_domain │ │ │ -00195a50: 3c2f 613e 203d 203c 7370 616e 2063 6c61 = "...&quo │ │ │ -00195a80: 743b 3c2f 7370 616e 3e3b 203c 2f64 6976 t;;
.
soa │ │ │ -00195ad0: 703c 2f61 3e2e 3c61 2063 6c61 7373 3d22 p.c │ │ │ -00195b20: 6f6f 6b69 655f 7061 7468 3c2f 613e 203d ookie_path = │ │ │ -00195b30: 203c 7370 616e 2063 6c61 7373 3d22 7374 &qu │ │ │ -00195b50: 6f74 3b2f 2671 756f 743b 3c2f 7370 616e ot;/"; // the │ │ │ -00195b80: 7061 7468 2077 6869 6368 2069 7320 7573 path which is us │ │ │ -00195b90: 6564 2074 6f20 6669 6c74 6572 2f73 6574 ed to filter/set │ │ │ -00195ba0: 2063 6f6f 6b69 6573 2077 6974 6820 7468 cookies with th │ │ │ -00195bb0: 6973 2064 6573 7469 6e61 7469 6f6e 203c is destination < │ │ │ -00195bc0: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
. │ │ │ -00195be0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 if
(argc < │ │ │ -00195c10: 3229 203c 2f64 6976 3e0a 3c64 6976 2063 2)
.
{< │ │ │ -00195c30: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
soap_getenv_coo │ │ │ -00195cb0: 6b69 6573 3c2f 613e 2826 616d 703b 3c61 kies(&soap); │ │ │ -00195cf0: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // CGI app │ │ │ -00195d10: 3a20 6772 6162 2063 6f6f 6b69 6573 2066 : grab cookies f │ │ │ -00195d20: 726f 6d20 2623 3339 3b48 5454 505f 434f rom 'HTTP_CO │ │ │ -00195d30: 4f4b 4945 2623 3339 3b20 656e 7620 7661 OKIE' env va │ │ │ -00195d40: 7220 3c2f 7370 616e 3e3c 2f64 6976 3e0a r
. │ │ │ -00195d50: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
soap_serve │ │ │ -00195dc0: 3c2f 613e 2826 616d 703b 3c61 2063 6c61 (&soap); .
}
. │ │ │ -00195e20: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
el │ │ │ -00195e50: 7365 3c2f 7370 616e 3e20 3c2f 6469 763e se
│ │ │ -00195e60: 0a3c 6469 7620 636c 6173 733d 226c 696e .
{
. │ │ │ -00195e90: 2020 206d 203d 203c 6120 636c 6173 733d m = soap_bind │ │ │ -00195ef0: 3c2f 613e 2826 616d 703b 3c61 2063 6c61 (&soap, NULL, │ │ │ -00195f30: 2061 746f 6928 6172 6776 5b31 5d29 2c20 atoi(argv[1]), │ │ │ -00195f40: 3130 293b 203c 7370 616e 2063 6c61 7373 10); // sm │ │ │ -00195f60: 616c 6c20 4241 434b 4c4f 4720 666f 7220 all BACKLOG for │ │ │ -00195f70: 6974 6572 6174 6976 6520 7365 7276 6572 iterative server │ │ │ -00195f80: 733c 2f73 7061 6e3e 3c2f 6469 763e 0a3c s
.< │ │ │ -00195f90: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -00195fa0: 3e20 2020 203c 7370 616e 2063 6c61 7373 > i │ │ │ -00195fc0: 663c 2f73 7061 6e3e 2028 213c 6120 636c f (!soa │ │ │ -00196020: 705f 7661 6c69 645f 736f 636b 6574 3c2f p_valid_socket(m))
. │ │ │ -00196050: 2020 2020 2020 6578 6974 2845 5849 545f exit(EXIT_ │ │ │ -00196060: 4641 494c 5552 4529 3b20 3c2f 6469 763e FAILURE);
│ │ │ -00196070: 0a3c 6469 7620 636c 6173 733d 226c 696e .
for (int i = 1; ; i++) │ │ │ -001960e0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
{..< │ │ │ -001961c0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -001961d0: 3e20 2020 2020 203c 7370 616e 2063 6c61 > if (!s │ │ │ -00196250: 6f61 705f 7661 6c69 645f 736f 636b 6574 oap_valid_socket │ │ │ -00196260: 3c2f 613e 2873 2929 203c 2f64 6976 3e0a (s))
. │ │ │ -00196270: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
exit(E │ │ │ -00196290: 5849 545f 4641 494c 5552 4529 3b20 3c2f XIT_FAILURE); .
soa │ │ │ -00196310: 705f 7365 7276 653c 2f61 3e28 2661 6d70 p_serve(& │ │ │ -00196320: 3b3c 6120 636c 6173 733d 2263 6f64 6522 ;soap │ │ │ -00196350: 293b 203c 2f64 6976 3e0a 3c64 6976 2063 );
. │ │ │ -00196410: 0a3c 6469 7620 636c 6173 733d 226c 696e .
so │ │ │ -00196480: 6170 5f66 7265 655f 636f 6f6b 6965 733c ap_free_cookies< │ │ │ -00196490: 2f61 3e28 2661 6d70 3b3c 6120 636c 6173 /a>(& │ │ │ -001964c0: 736f 6170 3c2f 613e 293b 203c 7370 616e soap); // remove all o │ │ │ -001964f0: 6c64 2063 6f6f 6b69 6573 2066 726f 6d20 ld cookies from │ │ │ -00196500: 6461 7461 6261 7365 2073 6f20 6e6f 2069 database so no i │ │ │ -00196510: 6e74 6572 6665 7265 6e63 6520 6f63 6375 nterference occu │ │ │ -00196520: 7273 2077 6974 6820 7468 6520 6172 7269 rs with the arri │ │ │ -00196530: 7661 6c20 6f66 206e 6577 2063 6f6f 6b69 val of new cooki │ │ │ -00196540: 6573 203c 2f73 7061 6e3e 3c2f 6469 763e es
│ │ │ -00196550: 0a3c 6469 7620 636c 6173 733d 226c 696e .
}
. │ │ │ -00196570: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
}
. │ │ │ -001965a0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 retur │ │ │ -001965c0: 6e3c 2f73 7061 6e3e 2030 3b20 3c2f 6469 n 0; .
}
. │ │ │ -00196600: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
int n │ │ │ -00196640: 735f 5f77 6562 6d65 7468 6f64 283c 7370 s__webmethod(struct │ │ │ -00196670: 203c 6120 636c 6173 733d 2263 6f64 6522 soap │ │ │ -001966a0: 202a 3c61 2063 6c61 7373 3d22 636f 6465 *soap, ...)
.< │ │ │ -001966e0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -001966f0: 3e7b 3c2f 6469 763e 0a3c 6469 7620 636c >{
.
const │ │ │ -00196730: 3c73 7061 6e20 636c 6173 733d 226b 6579 char *cookie_va │ │ │ -00196760: 6c75 6520 3d20 3c61 2063 6c61 7373 3d22 lue = soap_ │ │ │ -001967c0: 636f 6f6b 6965 5f76 616c 7565 3c2f 613e cookie_value │ │ │ -001967d0: 283c 6120 636c 6173 733d 2263 6f64 6522 (soap │ │ │ -00196800: 2c20 3c73 7061 6e20 636c 6173 733d 2273 , &q │ │ │ -00196820: 756f 743b 636f 6f6b 6965 5f6e 616d 6526 uot;cookie_name& │ │ │ -00196830: 7175 6f74 3b3c 2f73 7061 6e3e 2c20 4e55 quot;, NU │ │ │ -00196840: 4c4c 2c20 4e55 4c4c 293b 3c2f 6469 763e LL, NULL);
│ │ │ -00196850: 0a3c 6469 7620 636c 6173 733d 226c 696e .
i │ │ │ -00196880: 663c 2f73 7061 6e3e 2028 2163 6f6f 6b69 f (!cooki │ │ │ -00196890: 655f 7661 6c75 6529 2020 2020 2020 2020 e_value) │ │ │ -001968a0: 2020 2020 2020 2020 3c73 7061 6e20 636c // │ │ │ -001968c0: 2063 6f6f 6b69 6520 7265 7475 726e 6564 cookie returned │ │ │ -001968d0: 2062 7920 636c 6965 6e74 3f20 3c2f 7370 by client?
.
│ │ │ -00196900: 636f 6f6b 6965 5f76 616c 7565 203d 203c cookie_value = < │ │ │ -00196910: 7370 616e 2063 6c61 7373 3d22 7374 7269 span class="stri │ │ │ -00196920: 6e67 6c69 7465 7261 6c22 3e26 7175 6f74 ngliteral">" │ │ │ -00196930: 3b69 6e69 7469 616c 5f76 616c 7565 2671 ;initial_value&q │ │ │ -00196940: 756f 743b 3c2f 7370 616e 3e3b 203c 7370 uot;; // no: set in │ │ │ -00196970: 6974 6961 6c20 636f 6f6b 6965 2076 616c itial cookie val │ │ │ -00196980: 7565 203c 2f73 7061 6e3e 3c2f 6469 763e ue
│ │ │ -00196990: 0a3c 6469 7620 636c 6173 733d 226c 696e .
e │ │ │ -001969c0: 6c73 653c 2f73 7061 6e3e 203c 2f64 6976 lse
.
... │ │ │ -001969f0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ -00196a00: 2020 2020 2020 2020 3c73 7061 6e20 636c // │ │ │ -00196a20: 2079 6573 3a20 6d6f 6469 6679 2074 6865 yes: modify the │ │ │ -00196a30: 2063 6f6f 6b69 6520 7661 6c75 6520 746f cookie value to │ │ │ -00196a40: 2072 6566 6c65 6374 2074 6865 206e 6577 reflect the new │ │ │ -00196a50: 2073 7461 7465 3c2f 7370 616e 3e3c 2f64 state.
soa │ │ │ -00196ad0: 705f 7365 745f 636f 6f6b 6965 3c2f 613e p_set_cookie │ │ │ -00196ae0: 283c 6120 636c 6173 733d 2263 6f64 6522 (soap │ │ │ -00196b10: 2c20 3c73 7061 6e20 636c 6173 733d 2273 , &q │ │ │ -00196b30: 756f 743b 636f 6f6b 6965 5f6e 616d 6526 uot;cookie_name& │ │ │ -00196b40: 7175 6f74 3b3c 2f73 7061 6e3e 2c20 636f quot;, co │ │ │ -00196b50: 6f6b 6965 5f76 616c 7565 2c20 4e55 4c4c okie_value, NULL │ │ │ -00196b60: 2c20 4e55 4c4c 293b 203c 2f64 6976 3e0a , NULL);
. │ │ │ -00196b70: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
soap_se │ │ │ -00196be0: 745f 636f 6f6b 6965 5f65 7870 6972 653c t_cookie_expire< │ │ │ -00196bf0: 2f61 3e28 3c61 2063 6c61 7373 3d22 636f /a>(soap< │ │ │ -00196c20: 2f61 3e2c 203c 7370 616e 2063 6c61 7373 /a>, "cookie_na │ │ │ -00196c50: 6d65 2671 756f 743b 3c2f 7370 616e 3e2c me", │ │ │ -00196c60: 2036 302c 204e 554c 4c2c 204e 554c 4c29 60, NULL, NULL) │ │ │ -00196c70: 3b20 3c73 7061 6e20 636c 6173 733d 2263 ; // cooki │ │ │ -00196c90: 6520 6578 7069 7265 7320 696e 2036 3020 e expires in 60 │ │ │ -00196ca0: 7365 636f 6e64 7320 3c2f 7370 616e 3e3c seconds < │ │ │ -00196cb0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>..
}.
│ │ │ -00196e40: 3c64 6976 2063 6c61 7373 3d22 7474 6465
const char * │ │ │ -00196e60: 2073 6f61 705f 636f 6f6b 6965 5f76 616c soap_cookie_val │ │ │ -00196e70: 7565 2873 7472 7563 7420 736f 6170 202a ue(struct soap * │ │ │ -00196e80: 736f 6170 2c20 636f 6e73 7420 6368 6172 soap, const char │ │ │ -00196e90: 202a 6e61 6d65 2c20 636f 6e73 7420 6368 *name, const ch │ │ │ -00196ea0: 6172 202a 646f 6d61 696e 2c20 636f 6e73 ar *domain, cons │ │ │ -00196eb0: 7420 6368 6172 202a 7061 7468 293c 2f64 t char *path)
Get cookie │ │ │ -00196ee0: 2076 616c 7565 2e3c 2f64 6976 3e3c 2f64 value.
.
struct soap_co │ │ │ -00196fe0: 6f6b 6965 202a 2073 6f61 705f 7365 745f okie * soap_set_ │ │ │ -00196ff0: 636f 6f6b 6965 2873 7472 7563 7420 736f cookie(struct so │ │ │ -00197000: 6170 202a 736f 6170 2c20 636f 6e73 7420 ap *soap, const │ │ │ -00197010: 6368 6172 202a 6e61 6d65 2c20 636f 6e73 char *name, cons │ │ │ -00197020: 7420 6368 6172 202a 7661 6c75 652c 2063 t char *value, c │ │ │ -00197030: 6f6e 7374 2063 6861 7220 2a64 6f6d 6169 onst char *domai │ │ │ -00197040: 6e2c 2063 6f6e 7374 2063 6861 7220 2a70 n, const char *p │ │ │ -00197050: 6174 6829 3c2f 6469 763e 3c64 6976 2063 ath)
Add │ │ │ -00197070: 2061 2063 6f6f 6b69 652e 3c2f 6469 763e a cookie.
│ │ │ -00197080: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ -001970f0: 3c61 2068 7265 663d 2267 726f 7570 5f5f soap_get │ │ │ -00197140: 656e 765f 636f 6f6b 6965 733c 2f61 3e3c env_cookies< │ │ │ -00197150: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
int soa │ │ │ -00197170: 705f 6765 7465 6e76 5f63 6f6f 6b69 6573 p_getenv_cookies │ │ │ -00197180: 2873 7472 7563 7420 736f 6170 202a 736f (struct soap *so │ │ │ -00197190: 6170 293c 2f64 6976 3e3c 6469 7620 636c ap)
Get │ │ │ -001971b0: 636f 6f6b 6965 7320 6672 6f6d 2074 6865 cookies from the │ │ │ -001971c0: 2048 5454 505f 434f 4f4b 4945 2065 6e76 HTTP_COOKIE env │ │ │ -001971d0: 6972 6f6e 6d65 6e74 2076 6172 6961 626c ironment variabl │ │ │ -001971e0: 652e 3c2f 6469 763e 3c2f 6469 763e 0a3c e.
.< │ │ │ -001971f0: 6469 7620 636c 6173 733d 2274 7463 2220 div class="ttc" │ │ │ -00197200: 6964 3d22 6167 726f 7570 5f5f 6772 6f75 id="agroup__grou │ │ │ -00197210: 705f 5f63 6f6f 6b69 6573 5f68 746d 6c5f p__cookies_html_ │ │ │ -00197220: 6761 6366 3539 6563 3139 3161 3363 3730 gacf59ec191a3c70 │ │ │ -00197230: 3132 6464 3631 3731 6637 6462 3364 3263 12dd6171f7db3d2c │ │ │ -00197240: 3662 223e 3c64 6976 2063 6c61 7373 3d22 6b">
v │ │ │ -001972d0: 6f69 6420 736f 6170 5f66 7265 655f 636f oid soap_free_co │ │ │ -001972e0: 6f6b 6965 7328 7374 7275 6374 2073 6f61 okies(struct soa │ │ │ -001972f0: 7020 2a73 6f61 7029 3c2f 6469 763e 3c64 p *soap)
Free cookies.
.
│ │ │ -00197380: 3c64 6976 2063 6c61 7373 3d22 7474 6e61
│ │ │ -00197410: 696e 7420 736f 6170 5f73 6574 5f63 6f6f int soap_set_coo │ │ │ -00197420: 6b69 655f 6578 7069 7265 2873 7472 7563 kie_expire(struc │ │ │ -00197430: 7420 736f 6170 202a 736f 6170 2c20 636f t soap *soap, co │ │ │ -00197440: 6e73 7420 6368 6172 202a 6e61 6d65 2c20 nst char *name, │ │ │ -00197450: 6c6f 6e67 206d 6178 6167 652c 2063 6f6e long maxage, con │ │ │ -00197460: 7374 2063 6861 7220 2a64 6f6d 6169 6e2c st char *domain, │ │ │ -00197470: 2063 6f6e 7374 2063 6861 7220 2a70 6174 const char *pat │ │ │ -00197480: 6829 3c2f 6469 763e 3c64 6976 2063 6c61 h)
Set c │ │ │ -001974a0: 6f6f 6b69 6520 6578 7069 7261 7469 6f6e ookie expiration │ │ │ -001974b0: 2e3c 2f64 6976 3e3c 2f64 6976 3e0a 3c64 .
.
soap::coo │ │ │ -00197560: 6b69 655f 646f 6d61 696e 3c2f 613e 3c2f kie_domain
const ch │ │ │ -00197590: 6172 202a 2063 6f6f 6b69 655f 646f 6d61 ar * cookie_doma │ │ │ -001975a0: 696e 3c2f 6469 763e 3c64 6976 2063 6c61 in
User- │ │ │ -001975c0: 6465 6669 6e61 626c 6520 7374 7269 6e67 definable string │ │ │ -001975d0: 2074 6861 7420 7370 6563 6966 6965 7320 that specifies │ │ │ -001975e0: 7468 6520 4854 5450 2063 6f6f 6b69 6520 the HTTP cookie │ │ │ -001975f0: 646f 6d61 696e 206f 6620 7468 6520 7275 domain of the ru │ │ │ -00197600: 6e6e 696e 6720 7365 7276 6572 2e3c 2f64 nning server.
Definit │ │ │ -00197630: 696f 6e3a 3c2f 623e 2073 7464 736f 6170 ion: stdsoap │ │ │ -00197640: 322e 683a 3239 3639 3c2f 6469 763e 3c2f 2.h:2969
.

│ │ │ -00197800: f09f 949d 203c 6120 6872 6566 3d22 2322 .... Back to table o │ │ │ -00197820: 6620 636f 6e74 656e 7473 3c2f 613e 3c2f f contents.

. │ │ │ -00197860: 436f 6e6e 6563 7469 6e67 2063 6c69 656e Connecting clien │ │ │ -00197870: 7473 2074 6872 6f75 6768 2070 726f 7879 ts through proxy │ │ │ -00197880: 2073 6572 7665 7273 3c2f 6832 3e0a 3c70 servers

.

When a client n │ │ │ -001978a0: 6565 6473 2074 6f20 636f 6e6e 6563 7420 eeds to connect │ │ │ -001978b0: 746f 2061 2057 6562 2053 6572 7669 6365 to a Web Service │ │ │ -001978c0: 2074 6872 6f75 6768 2061 2070 726f 7879 through a proxy │ │ │ -001978d0: 2073 6572 7665 722c 2073 6574 2074 6865 server, set the │ │ │ -001978e0: 203c 636f 6465 3e3c 6120 636c 6173 733d soap::proxy_ho │ │ │ -001979a0: 7374 3c2f 613e 3c2f 636f 6465 3e20 7374 st st │ │ │ -001979b0: 7269 6e67 2061 6e64 203c 636f 6465 3e3c ring and < │ │ │ -001979c0: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ -001979d0: 663d 2273 7472 7563 7473 6f61 702e 6874 f="structsoap.ht │ │ │ -001979e0: 6d6c 2361 3033 3735 3534 6664 3263 6635 ml#a037554fd2cf5 │ │ │ -001979f0: 3466 6239 6136 6435 3332 3662 3131 6338 4fb9a6d5326b11c8 │ │ │ -00197a00: 6666 6130 2220 7469 746c 653d 2255 7365 ffa0" title="Use │ │ │ -00197a10: 722d 6465 6669 6e61 626c 6520 7072 6f78 r-definable prox │ │ │ -00197a20: 7920 706f 7274 2077 6869 6368 2073 686f y port which sho │ │ │ -00197a30: 756c 6420 6265 2073 6574 2074 6f20 636f uld be set to co │ │ │ -00197a40: 6e6e 6563 7420 7468 726f 7567 6820 616e nnect through an │ │ │ -00197a50: 2048 5454 5020 7072 6f78 7920 2874 6865 HTTP proxy (the │ │ │ -00197a60: 2076 616c 7565 2069 7320 3830 3830 2062 value is 8080 b │ │ │ -00197a70: 7920 2e2e 2e22 3e73 6f61 703a 3a70 726f y ...">soap::pro │ │ │ -00197a80: 7879 5f70 6f72 743c 2f61 3e3c 2f63 6f64 xy_port integer attri │ │ │ -00197aa0: 6275 7465 7320 6f66 2074 6865 2063 7572 butes of the cur │ │ │ -00197ab0: 7265 6e74 203c 636f 6465 3e3c 6120 636c rent soap< │ │ │ -00197b10: 2f63 6f64 653e 2063 6f6e 7465 7874 2074 /code> context t │ │ │ -00197b20: 6f20 7468 6520 7072 6f78 7927 7320 686f o the proxy's ho │ │ │ -00197b30: 7374 206e 616d 6520 616e 6420 706f 7274 st name and port │ │ │ -00197b40: 2c20 7265 7370 6563 7469 7665 6c79 2e20 , respectively. │ │ │ -00197b50: 466f 7220 6578 616d 706c 653a 3c2f 703e For example:

│ │ │ -00197b60: 0a3c 6469 7620 636c 6173 733d 2266 7261 .
s │ │ │ -00197ba0: 7472 7563 7420 3c2f 7370 616e 3e3c 6120 truct soap soap; .
soap │ │ │ -00197c80: 5f69 6e69 743c 2f61 3e28 2661 6d70 3b3c _init(&< │ │ │ -00197c90: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -00197ca0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ -00197cb0: 6874 6d6c 223e 736f 6170 3c2f 613e 293b html">soap); │ │ │ -00197cc0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
soap.proxy_host = │ │ │ -00197d80: 2671 756f 743b 7072 6f78 7968 6f73 746e "proxyhostn │ │ │ -00197d90: 616d 6526 7175 6f74 3b3c 2f73 7061 6e3e ame" │ │ │ -00197da0: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
..
if │ │ │ -00197e80: 3c2f 7370 616e 3e20 2873 6f61 705f 6361 (soap_ca │ │ │ -00197e90: 6c6c 5f6e 735f 5f77 6562 6d65 7468 6f64 ll_ns__webmethod │ │ │ -00197ea0: 2826 616d 703b 3c61 2063 6c61 7373 3d22 (&soa │ │ │ -00197ed0: 703c 2f61 3e2c 203c 7370 616e 2063 6c61 p, "http:// │ │ │ -00197f00: 686f 7374 3a70 6f72 742f 7061 7468 2671 host:port/path&q │ │ │ -00197f10: 756f 743b 3c2f 7370 616e 3e2c 203c 7370 uot;, "a │ │ │ -00197f40: 6374 696f 6e26 7175 6f74 3b3c 2f73 7061 ction", ...))
│ │ │ -00197f60: 0a3c 6469 7620 636c 6173 733d 226c 696e .
soap_pri │ │ │ -00197fd0: 6e74 5f66 6175 6c74 3c2f 613e 2826 616d nt_fault(&am │ │ │ -00197fe0: 703b 3c61 2063 6c61 7373 3d22 636f 6465 p;soap, stderr); .
e │ │ │ -00198050: 6c73 653c 2f73 7061 6e3e 203c 2f64 6976 lse
.
... │ │ │ -00198090: 2f2f 2073 7563 6365 7373 3c2f 7370 616e // success
.
< │ │ │ -001980c0: 703e 5468 6520 636f 6e74 6578 7420 6174 p>The context at │ │ │ -001980d0: 7472 6962 7574 6573 203c 636f 6465 3e3c tributes < │ │ │ -001980e0: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ -001980f0: 663d 2273 7472 7563 7473 6f61 702e 6874 f="structsoap.ht │ │ │ -00198100: 6d6c 2361 6331 3732 6264 3930 3139 6166 ml#ac172bd9019af │ │ │ -00198110: 6565 6262 3336 3335 6233 6139 6637 3261 eebb3635b3a9f72a │ │ │ -00198120: 3931 3031 2220 7469 746c 653d 2255 7365 9101" title="Use │ │ │ -00198130: 722d 6465 6669 6e61 626c 6520 7072 6f78 r-definable prox │ │ │ -00198140: 7920 686f 7374 206e 616d 6520 7374 7269 y host name stri │ │ │ -00198150: 6e67 2077 6869 6368 2073 686f 756c 6420 ng which should │ │ │ -00198160: 6265 2073 6574 2074 6f20 636f 6e6e 6563 be set to connec │ │ │ -00198170: 7420 7468 726f 7567 6820 616e 2048 5454 t through an HTT │ │ │ -00198180: 5020 7072 6f78 792e 223e 736f 6170 3a3a P proxy.">soap:: │ │ │ -00198190: 7072 6f78 795f 686f 7374 3c2f 613e 3c2f proxy_host and │ │ │ -001981b0: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap::pr │ │ │ -00198270: 6f78 795f 706f 7274 3c2f 613e 3c2f 636f oxy_port keep their v │ │ │ -00198290: 616c 7565 7320 7468 726f 7567 6820 6120 alues through a │ │ │ -001982a0: 7365 7175 656e 6365 206f 6620 7365 7276 sequence of serv │ │ │ -001982b0: 6963 6520 6f70 6572 6174 696f 6e20 6361 ice operation ca │ │ │ -001982c0: 6c6c 732c 2073 6f20 7468 6579 206f 6e6c lls, so they onl │ │ │ -001982d0: 7920 6e65 6564 2074 6f20 6265 2073 6574 y need to be set │ │ │ -001982e0: 206f 6e63 652e 3c2f 703e 0a3c 703e 5768 once.

.

Wh │ │ │ -001982f0: 656e 2058 2d46 6f72 7761 7264 6564 2d46 en X-Forwarded-F │ │ │ -00198300: 6f72 2068 6561 6465 7273 2061 7265 2072 or headers are r │ │ │ -00198310: 6574 7572 6e65 6420 6279 2074 6865 2070 eturned by the p │ │ │ -00198320: 726f 7879 2c20 7468 6520 6865 6164 6572 roxy, the header │ │ │ -00198330: 2063 616e 2062 6520 6163 6365 7373 6564 can be accessed │ │ │ -00198340: 2069 6e20 7468 6520 3c63 6f64 653e 3c61 in the soap::proxy │ │ │ -001983e0: 5f66 726f 6d3c 2f61 3e3c 2f63 6f64 653e _from │ │ │ -001983f0: 2073 7472 696e 672e 3c2f 703e 0a3c 703e string.

.

│ │ │ -00198400: 5365 6520 616c 736f 2053 6563 7469 6f6e See also Section │ │ │ -00198410: 7320 3c61 2063 6c61 7373 3d22 656c 2220 s HTTP proxy │ │ │ -00198450: 2062 6173 6963 2061 7574 6865 6e74 6963 basic authentic │ │ │ -00198460: 6174 696f 6e3c 2f61 3e20 616e 6420 3c61 ation and HTTP proxy │ │ │ -001984b0: 204e 544c 4d20 6175 7468 656e 7469 6361 NTLM authentica │ │ │ -001984c0: 7469 6f6e 3c2f 613e 2e3c 2f70 3e0a 3c70 tion.

.

.... Back to table │ │ │ -001984f0: 6f66 2063 6f6e 7465 6e74 733c 2f61 3e3c of contents< │ │ │ -00198500: 2f70 3e0a 3c68 323e 3c61 2063 6c61 7373 /p>.

.Bind befor │ │ │ -00198540: 6520 636f 6e6e 6563 7420 616e 6420 7365 e connect and se │ │ │ -00198550: 7474 696e 6720 7468 6520 636c 6965 6e74 tting the client │ │ │ -00198560: 2069 6e74 6572 6661 6365 2061 6464 7265 interface addre │ │ │ -00198570: 7373 3c2f 6832 3e0a 3c70 3e54 6f20 6269 ss

.

To bi │ │ │ -00198580: 6e64 2074 6865 2063 6c69 656e 7420 746f nd the client to │ │ │ -00198590: 2061 2070 6f72 7420 6265 666f 7265 2063 a port before c │ │ │ -001985a0: 6f6e 6e65 6374 2c20 7365 7420 7468 6520 onnect, set the │ │ │ -001985b0: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 soa │ │ │ -00198660: 703a 3a63 6c69 656e 745f 706f 7274 3c2f p::client_port to a n │ │ │ -00198680: 6f6e 2d6e 6567 6174 6976 6520 706f 7274 on-negative port │ │ │ -00198690: 206e 756d 6265 723a 3c2f 703e 0a3c 6469 number:

..
soap->client_po │ │ │ -00198850: 7274 3c2f 613e 203d 202e 2e2e 3b20 3c73 rt = ...; // non-negat │ │ │ -00198880: 6976 6520 706f 7274 206e 756d 6265 7220 ive port number │ │ │ -00198890: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ -001988b0: 3c73 7061 6e20 636c 6173 733d 226b 6579 if (soap_call_n │ │ │ -001988e0: 735f 5f77 6562 6d65 7468 6f64 283c 6120 s__webmethod(soap, " │ │ │ -00198940: 6874 7470 3a2f 2f68 6f73 743a 706f 7274 http://host:port │ │ │ -00198950: 2f70 6174 6826 7175 6f74 3b3c 2f73 7061 /path", │ │ │ -00198980: 2671 756f 743b 6163 7469 6f6e 2671 756f "action&quo │ │ │ -00198990: 743b 3c2f 7370 616e 3e2c 202e 2e2e 2929 t;, ...)) │ │ │ -001989a0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
... │ │ │ -001989c0: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // error
.
else
.
. │ │ │ -00198a40: 2e2e 203c 7370 616e 2063 6c61 7373 3d22 .. // succ │ │ │ -00198a60: 6573 733c 2f73 7061 6e3e 3c2f 6469 763e ess
│ │ │ -00198a70: 0a3c 6469 7620 636c 6173 733d 2274 7463 .
soap:: │ │ │ -00198b10: 636c 6965 6e74 5f70 6f72 743c 2f61 3e3c client_port< │ │ │ -00198b20: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
int cli │ │ │ -00198b40: 656e 745f 706f 7274 3c2f 6469 763e 3c64 ent_port
User-definable │ │ │ -00198b70: 636c 6965 6e74 2070 6f72 7420 746f 2062 client port to b │ │ │ -00198b80: 696e 6420 746f 2062 6566 6f72 6520 636f ind to before co │ │ │ -00198b90: 6e6e 6563 7469 6e67 2074 6f20 6120 7365 nnecting to a se │ │ │ -00198ba0: 7276 6572 2c20 7768 656e 206e 6f6e 2d6e rver, when non-n │ │ │ -00198bb0: 6567 6174 6976 652e 3c2f 6469 763e 3c64 egative.
Definition:< │ │ │ -00198be0: 2f62 3e20 7374 6473 6f61 7032 2e68 3a33 /b> stdsoap2.h:3 │ │ │ -00198bf0: 3639 303c 2f64 6976 3e3c 2f64 6976 3e0a 690
. │ │ │ -00198c00: 3c2f 6469 763e 3c21 2d2d 2066 7261 676d

This p │ │ │ -00198c20: 6f72 7420 6e75 6d62 6572 2069 7320 7573 ort number is us │ │ │ -00198c30: 6564 206f 6e6c 7920 6f6e 6365 2061 6e64 ed only once and │ │ │ -00198c40: 2072 6573 6574 2074 6f20 2d31 2028 6469 reset to -1 (di │ │ │ -00198c50: 7361 626c 6564 292e 2053 6574 2069 7420 sabled). Set it │ │ │ -00198c60: 6167 6169 6e20 666f 7220 7468 6520 6e65 again for the ne │ │ │ -00198c70: 7874 2063 616c 6c2e 3c2f 703e 0a3c 703e xt call.

.

│ │ │ -00198c80: 546f 2073 6574 2061 2063 6c69 656e 7420 To set a client │ │ │ -00198c90: 696e 7465 7266 6163 6520 6164 6472 6573 interface addres │ │ │ -00198ca0: 7320 666f 7220 7468 6520 636f 6e6e 6563 s for the connec │ │ │ -00198cb0: 7469 6f6e 2074 6861 7420 6973 2061 6e20 tion that is an │ │ │ -00198cc0: 4950 2061 6464 7265 7373 206f 6620 7468 IP address of th │ │ │ -00198cd0: 6520 636c 6965 6e74 3a3c 2f70 3e0a 3c64 e client:

.
stru │ │ │ -00198d20: 6374 203c 2f73 7061 6e3e 3c61 2063 6c61 ct soap *soap = soap_new() │ │ │ -00198df0: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
soap->< │ │ │ -00198e40: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -00198e50: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ -00198e60: 6874 6d6c 2361 6136 3630 3236 6263 6430 html#aa66026bcd0 │ │ │ -00198e70: 3939 6438 3864 3434 6339 3835 6234 3939 99d88d44c985b499 │ │ │ -00198e80: 3238 6130 3564 223e 636c 6965 6e74 5f69 28a05d">client_i │ │ │ -00198e90: 6e74 6572 6661 6365 3c2f 613e 203d 203c nterface = < │ │ │ -00198ea0: 7370 616e 2063 6c61 7373 3d22 7374 7269 span class="stri │ │ │ -00198eb0: 6e67 6c69 7465 7261 6c22 3e26 7175 6f74 ngliteral">" │ │ │ -00198ec0: 3b2e 2e2e 2671 756f 743b 3c2f 7370 616e ;..."; // IP a │ │ │ -00198ef0: 6464 7265 7373 203c 2f73 7061 6e3e 3c2f ddress ..< │ │ │ -00199010: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -00199020: 3e20 202e 2e2e 203c 7370 616e 2063 6c61 > ... // │ │ │ -00199040: 6572 726f 723c 2f73 7061 6e3e 3c2f 6469 error.
e │ │ │ -00199080: 6c73 653c 2f73 7061 6e3e 203c 2f64 6976 lse
.
... │ │ │ -001990c0: 2f2f 2073 7563 6365 7373 3c2f 7370 616e // success
.
const char │ │ │ -001991b0: 2a20 636c 6965 6e74 5f69 6e74 6572 6661 * client_interfa │ │ │ -001991c0: 6365 3c2f 6469 763e 3c64 6976 2063 6c61 ce
User- │ │ │ -001991e0: 6465 6669 6e61 626c 6520 636c 6965 6e74 definable client │ │ │ -001991f0: 2069 6e74 6572 6661 6365 2061 6464 7265 interface addre │ │ │ -00199200: 7373 2074 6f20 6f76 6572 7269 6465 2077 ss to override w │ │ │ -00199210: 6865 6e20 636f 6e6e 6563 7469 6e67 2074 hen connecting t │ │ │ -00199220: 6f20 6120 7365 7276 6572 2c20 7768 656e o a server, when │ │ │ -00199230: 206e 6f6e 2d4e 554c 4c20 2857 696e 646f non-NULL (Windo │ │ │ -00199240: 2e2e 2e3c 2f64 6976 3e3c 6469 7620 636c ...
D │ │ │ -00199260: 6566 696e 6974 696f 6e3a 3c2f 623e 2073 efinition: s │ │ │ -00199270: 7464 736f 6170 322e 683a 3336 3939 3c2f tdsoap2.h:3699
.

to < │ │ │ -00199510: 656d 3e3c 636f 6465 3e67 736f 6170 2f73 em>gsoap/s │ │ │ -00199520: 7464 736f 6170 322e 683c 2f63 6f64 653e tdsoap2.h │ │ │ -00199530: 3c2f 656d 3e20 616e 6420 7265 636f 6d70 and recomp │ │ │ -00199540: 696c 6520 7468 6520 7072 6f6a 6563 7420 ile the project │ │ │ -00199550: 636f 6465 2e3c 2f70 3e0a 3c64 6c20 636c code.

.
Warnin │ │ │ -00199580: 673c 2f64 743e 3c64 643e 446f 206e 6f74 g
Do not │ │ │ -00199590: 206c 696e 6b20 6167 6169 6e73 7420 7468 link against th │ │ │ -001995a0: 6520 3c65 6d3e 3c63 6f64 653e 6773 6f61 e gsoa │ │ │ -001995b0: 702f 6c69 6267 736f 6170 2a3c 2f63 6f64 p/libgsoap* librarie │ │ │ -001995d0: 7320 6173 2074 6865 7365 2061 7265 206e s as these are n │ │ │ -001995e0: 6f74 2073 7569 7461 626c 6520 666f 7220 ot suitable for │ │ │ -001995f0: 4661 7374 4347 492e 2043 6f6d 7069 6c65 FastCGI. Compile │ │ │ -00199600: 203c 656d 3e3c 636f 6465 3e67 736f 6170 gsoap │ │ │ -00199610: 2f73 7464 736f 6170 322e 633c 2f63 6f64 /stdsoap2.c (or │ │ │ -00199630: 3c63 6f64 653e 6773 6f61 702f 7374 6473 gsoap/stds │ │ │ -00199640: 6f61 7032 2e63 7070 3c2f 636f 6465 3e3c oap2.cpp< │ │ │ -00199650: 2f65 6d3e 2920 696e 7374 6561 642e 3c2f /em>) instead.
.

.... │ │ │ -00199670: 203c 6120 6872 6566 3d22 2322 3e42 6163 Bac │ │ │ -00199680: 6b20 746f 2074 6162 6c65 206f 6620 636f k to table of co │ │ │ -00199690: 6e74 656e 7473 3c2f 613e 3c2f 703e 0a3c ntents

.< │ │ │ -001996a0: 6832 3e3c 6120 636c 6173 733d 2261 6e63 h2>< │ │ │ -001996c0: 2f61 3e0a 486f 7720 746f 206d 696e 696d /a>.How to minim │ │ │ -001996d0: 697a 6520 6170 706c 6963 6174 696f 6e20 ize application │ │ │ -001996e0: 6d65 6d6f 7279 2066 6f6f 7470 7269 6e74 memory footprint │ │ │ -001996f0: 3c2f 6832 3e0a 3c70 3e54 6f20 636f 6d70 .

To comp │ │ │ -00199700: 696c 6520 6753 4f41 5020 6170 706c 6963 ile gSOAP applic │ │ │ -00199710: 6174 696f 6e73 2069 6e74 656e 6465 6420 ations intended │ │ │ -00199720: 666f 7220 736d 616c 6c20 6d65 6d6f 7279 for small memory │ │ │ -00199730: 2064 6576 6963 6573 2c20 796f 7520 6d61 devices, you ma │ │ │ -00199740: 7920 7761 6e74 2074 6f20 7265 6d6f 7665 y want to remove │ │ │ -00199750: 2061 6c6c 206e 6f6e 2d65 7373 656e 7469 all non-essenti │ │ │ -00199760: 616c 2066 6561 7475 7265 7320 7468 6174 al features that │ │ │ -00199770: 2063 6f6e 7375 6d65 2070 7265 6369 6f75 consume preciou │ │ │ -00199780: 7320 636f 6465 2061 6e64 2064 6174 6120 s code and data │ │ │ -00199790: 7370 6163 652e 2054 6f20 646f 2074 6869 space. To do thi │ │ │ -001997a0: 732c 2063 6f6d 7069 6c65 2074 6865 2073 s, compile the s │ │ │ -001997b0: 6f75 7263 6520 636f 6465 2066 696c 6573 ource code files │ │ │ -001997c0: 2077 6974 6820 7468 6520 636f 6d70 696c with the compil │ │ │ -001997d0: 652d 7469 6d65 2066 6c61 6720 3c63 6f64 e-time flag #WITH_LEAN (i.e. │ │ │ -00199800: 2364 6566 696e 6520 5749 5448 5f4c 4541 #define WITH_LEA │ │ │ -00199810: 4e3c 2f63 6f64 653e 2920 746f 2072 656d N) to rem │ │ │ -00199820: 6f76 6520 6d61 6e79 206e 6f6e 2d65 7373 ove many non-ess │ │ │ -00199830: 656e 7469 616c 2066 6561 7475 7265 732e ential features. │ │ │ -00199840: 2054 6865 2066 6561 7475 7265 7320 7468 The features th │ │ │ -00199850: 6174 2077 696c 6c20 6265 2064 6973 6162 at will be disab │ │ │ -00199860: 6c65 6420 6172 653a 3c2f 703e 0a3c 756c led are:

.
│ │ │ -0019a1a0: 0a3c 703e 5573 6520 7468 6520 636f 6d70 .

Use the comp │ │ │ -0019a1b0: 696c 652d 7469 6d65 2066 6c61 6720 3c63 ile-time flag #WITH_LEANER │ │ │ -0019a1d0: 3c2f 636f 6465 3e20 746f 206d 616b 6520 to make │ │ │ -0019a1e0: 7468 6520 6578 6563 7574 6162 6c65 2065 the executable e │ │ │ -0019a1f0: 7665 6e20 736d 616c 6c65 7220 6279 2072 ven smaller by r │ │ │ -0019a200: 656d 6f76 696e 6720 4449 4d45 2061 6e64 emoving DIME and │ │ │ -0019a210: 204d 494d 4520 6174 7461 6368 6d65 6e74 MIME attachment │ │ │ -0019a220: 2068 616e 646c 696e 672c 203c 636f 6465 handling, #LONG64 │ │ │ -0019a240: 2836 3420 6269 7429 2073 6572 6961 6c69 (64 bit) seriali │ │ │ -0019a250: 7a61 7469 6f6e 2c20 3c63 6f64 653e 7763 zation, wc │ │ │ -0019a260: 6861 725f 742a 3c2f 636f 6465 3e20 7365 har_t* se │ │ │ -0019a270: 7269 616c 697a 6174 696f 6e2c 2061 6e64 rialization, and │ │ │ -0019a280: 2073 7570 706f 7274 2066 6f72 2058 4d4c support for XML │ │ │ -0019a290: 2044 4f4d 206f 7065 7261 7469 6f6e 732e DOM operations. │ │ │ -0019a2a0: 204e 6f74 6520 7468 6174 2044 494d 452f Note that DIME/ │ │ │ -0019a2b0: 4d49 4d45 2061 7474 6163 686d 656e 7473 MIME attachments │ │ │ -0019a2c0: 2061 7265 206e 6f74 2065 7373 656e 7469 are not essenti │ │ │ -0019a2d0: 616c 2074 6f20 6163 6869 6576 6520 534f al to achieve SO │ │ │ -0019a2e0: 4150 2f58 4d4c 2069 6e74 6572 6f70 6572 AP/XML interoper │ │ │ -0019a2f0: 6162 696c 6974 792e 2044 494d 4520 6174 ability. DIME at │ │ │ -0019a300: 7461 6368 6d65 6e74 7320 6172 6520 6120 tachments are a │ │ │ -0019a310: 636f 6e76 656e 6965 6e74 2077 6179 2074 convenient way t │ │ │ -0019a320: 6f20 6578 6368 616e 6765 206e 6f6e 2d74 o exchange non-t │ │ │ -0019a330: 6578 742d 6261 7365 6420 2869 2e65 2e20 ext-based (i.e. │ │ │ -0019a340: 6269 6e61 7279 2920 636f 6e74 656e 742c binary) content, │ │ │ -0019a350: 2062 7574 2061 7265 206e 6f74 2072 6571 but are not req │ │ │ -0019a360: 7569 7265 6420 666f 7220 6261 7369 6320 uired for basic │ │ │ -0019a370: 534f 4150 2f58 4d4c 2069 6e74 6572 6f70 SOAP/XML interop │ │ │ -0019a380: 6572 6162 696c 6974 792e 2041 7474 6163 erability. Attac │ │ │ -0019a390: 686d 656e 7420 7265 7175 6972 656d 656e hment requiremen │ │ │ -0019a3a0: 7473 2061 7265 2070 7265 6469 6374 6162 ts are predictab │ │ │ -0019a3b0: 6c65 2e20 5468 6174 2069 732c 2061 7070 le. That is, app │ │ │ -0019a3c0: 6c69 6361 7469 6f6e 7320 776f 6e27 7420 lications won't │ │ │ -0019a3d0: 7375 6464 656e 6c79 2064 6563 6964 6520 suddenly decide │ │ │ -0019a3e0: 746f 2075 7365 2044 494d 4520 6f72 204d to use DIME or M │ │ │ -0019a3f0: 494d 4520 696e 7374 6561 6420 6f66 2058 IME instead of X │ │ │ -0019a400: 4d4c 2074 6f20 6578 6368 616e 6765 2063 ML to exchange c │ │ │ -0019a410: 6f6e 7465 6e74 2e3c 2f70 3e0a 3c70 3e49 ontent.

.

I │ │ │ -0019a420: 7420 6973 2073 6166 6520 746f 2074 7279 t is safe to try │ │ │ -0019a430: 2074 6f20 636f 6d70 696c 6520 796f 7572 to compile your │ │ │ -0019a440: 2061 7070 6c69 6361 7469 6f6e 2077 6974 application wit │ │ │ -0019a450: 6820 7468 6520 636f 6d70 696c 652d 7469 h the compile-ti │ │ │ -0019a460: 6d65 2066 6c61 6720 3c63 6f64 653e 2357 me flag #W │ │ │ -0019a470: 4954 485f 4c45 414e 3c2f 636f 6465 3e2c ITH_LEAN, │ │ │ -0019a480: 2070 726f 7669 6465 6420 7468 6174 2079 provided that y │ │ │ -0019a490: 6f75 7220 6170 706c 6963 6174 696f 6e20 our application │ │ │ -0019a4a0: 646f 6573 206e 6f74 2072 656c 7920 6f6e does not rely on │ │ │ -0019a4b0: 2049 2f4f 2074 696d 656f 7574 732e 2057 I/O timeouts. W │ │ │ -0019a4c0: 6865 6e20 6e6f 206c 696e 6b61 6765 2065 hen no linkage e │ │ │ -0019a4d0: 7272 6f72 206f 6363 7572 7320 696e 2074 rror occurs in t │ │ │ -0019a4e0: 6865 2063 6f6d 7069 6c61 7469 6f6e 2070 he compilation p │ │ │ -0019a4f0: 726f 6365 7373 2c20 6974 2069 7320 7361 rocess, it is sa │ │ │ -0019a500: 6665 2074 6f20 6173 7375 6d65 2074 6861 fe to assume tha │ │ │ -0019a510: 7420 796f 7572 2061 7070 6c69 6361 7469 t your applicati │ │ │ -0019a520: 6f6e 2077 696c 6c20 7275 6e20 6a75 7374 on will run just │ │ │ -0019a530: 2066 696e 652e 3c2f 703e 0a3c 703e f09f fine.

.

.. │ │ │ -0019a540: 949d 203c 6120 6872 6566 3d22 2322 3e42 .. B │ │ │ -0019a550: 6163 6b20 746f 2074 6162 6c65 206f 6620 ack to table of │ │ │ -0019a560: 636f 6e74 656e 7473 3c2f 613e 3c2f 703e contents

│ │ │ -0019a570: 0a3c 6832 3e3c 6120 636c 6173 733d 2261 .

.How to rem │ │ │ -0019a5a0: 6f76 6520 7468 6520 4253 4420 736f 636b ove the BSD sock │ │ │ -0019a5b0: 6574 206c 6962 7261 7279 2072 6571 7569 et library requi │ │ │ -0019a5c0: 7265 6d65 6e74 3c2f 6832 3e0a 3c70 3e54 rement

.

T │ │ │ -0019a5d0: 6865 203c 656d 3e3c 636f 6465 3e67 736f he gso │ │ │ -0019a5e0: 6170 2f73 7464 736f 6170 322e 633c 2f63 ap/stdsoap2.c and gsoap/st │ │ │ -0019a610: 6473 6f61 7032 2e63 7070 3c2f 636f 6465 dsoap2.cpp libraries │ │ │ -0019a630: 2073 686f 756c 6420 6265 206c 696e 6b65 should be linke │ │ │ -0019a640: 6420 7769 7468 2061 2042 5344 2073 6f63 d with a BSD soc │ │ │ -0019a650: 6b65 7420 6c69 6272 6172 7920 696e 2074 ket library in t │ │ │ -0019a660: 6865 2070 726f 6a65 6374 2062 7569 6c64 he project build │ │ │ -0019a670: 2e20 546f 2072 656d 6f76 6520 7468 6520 . To remove the │ │ │ -0019a680: 6e65 6564 2074 6f20 6c69 6e6b 2061 2073 need to link a s │ │ │ -0019a690: 6f63 6b65 7420 6c69 6272 6172 792c 2079 ocket library, y │ │ │ -0019a6a0: 6f75 2063 616e 2063 6f6d 7069 6c65 203c ou can compile < │ │ │ -0019a6b0: 656d 3e3c 636f 6465 3e67 736f 6170 2f73 em>gsoap/s │ │ │ -0019a6c0: 7464 736f 6170 322e 633c 2f63 6f64 653e tdsoap2.c │ │ │ -0019a6d0: 3c2f 656d 3e20 2866 6f72 2043 2920 616e (for C) an │ │ │ -0019a6e0: 6420 3c65 6d3e 3c63 6f64 653e 6773 6f61 d gsoa │ │ │ -0019a6f0: 702f 7374 6473 6f61 7032 2e63 7070 3c2f p/stdsoap2.cpp (for │ │ │ -0019a710: 432b 2b29 2077 6974 6820 7468 6520 7468 C++) with the th │ │ │ -0019a720: 6520 636f 6d70 696c 652d 7469 6d65 2066 e compile-time f │ │ │ -0019a730: 6c61 6720 3c63 6f64 653e 2357 4954 485f lag #WITH_ │ │ │ -0019a740: 4e4f 494f 3c2f 636f 6465 3e20 6d61 6372 NOIO macr │ │ │ -0019a750: 6f20 7365 7420 2869 2e65 2e20 3c63 6f64 o set (i.e. #define WITH_N │ │ │ -0019a770: 4f49 4f3c 2f63 6f64 653e 292e 2054 6869 OIO). Thi │ │ │ -0019a780: 7320 7265 6d6f 7665 7320 7468 6520 6465 s removes the de │ │ │ -0019a790: 7065 6e64 656e 6379 206f 6e20 7468 6520 pendency on the │ │ │ -0019a7a0: 4253 4420 736f 636b 6574 2041 5049 2c20 BSD socket API, │ │ │ -0019a7b0: 494f 2073 7472 6561 6d73 2c20 3c63 6f64 IO streams, FILE ty │ │ │ -0019a7d0: 7065 2c20 616e 6420 3c63 6f64 653e 6572 pe, and er │ │ │ -0019a7e0: 726e 6f3c 2f63 6f64 653e 2e3c 2f70 3e0a rno.

. │ │ │ -0019a7f0: 3c70 3e59 6f75 2073 686f 756c 6420 6465

You should de │ │ │ -0019a800: 6669 6e65 2063 616c 6c62 6163 6b73 2074 fine callbacks t │ │ │ -0019a810: 6f20 7265 706c 6163 6520 7468 6520 6d69 o replace the mi │ │ │ -0019a820: 7373 696e 6720 736f 636b 6574 2073 7461 ssing socket sta │ │ │ -0019a830: 636b 2e20 546f 2064 6f20 736f 2c20 6164 ck. To do so, ad │ │ │ -0019a840: 6420 746f 2079 6f75 7220 636f 6465 2074 d to your code t │ │ │ -0019a850: 6865 2066 6f6c 6c6f 7769 6e67 2064 6566 he following def │ │ │ -0019a860: 696e 6974 696f 6e73 3a3c 2f70 3e0a 3c64 initions:

.
stru │ │ │ -0019a8b0: 6374 203c 2f73 7061 6e3e 3c61 2063 6c61 ct soap soap;
.
soap_in │ │ │ -0019a990: 6974 3c2f 613e 2826 616d 703b 3c61 2063 it(&soap); .
/* │ │ │ -0019aa00: 6673 656e 6420 6973 2075 7365 6420 746f fsend is used to │ │ │ -0019aa10: 2074 7261 6e73 6d69 7420 6461 7461 2069 transmit data i │ │ │ -0019aa20: 6e20 626c 6f63 6b73 202a 2f3c 2f73 7061 n blocks */
.
soap.fsend = m │ │ │ -0019aae0: 795f 7365 6e64 3b20 3c2f 6469 763e 0a3c y_send;
.< │ │ │ -0019aaf0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -0019ab00: 3e3c 7370 616e 2063 6c61 7373 3d22 636f >/* frecv │ │ │ -0019ab20: 6973 2075 7365 6420 746f 2072 6563 6569 is used to recei │ │ │ -0019ab30: 7665 2064 6174 6120 696e 2062 6c6f 636b ve data in block │ │ │ -0019ab40: 7320 2a2f 3c2f 7370 616e 3e20 3c2f 6469 s */ ..
│ │ │ -0019ac30: 2f2a 2066 6f70 656e 2069 7320 7573 6564 /* fopen is used │ │ │ -0019ac40: 2074 6f20 636f 6e6e 6563 7420 2a2f 3c2f to connect */
.< │ │ │ -0019ac70: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -0019ac80: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ -0019ac90: 6874 6d6c 223e 736f 6170 3c2f 613e 2e3c html">soap.< │ │ │ -0019aca0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -0019acb0: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ -0019acc0: 705f 5f63 616c 6c62 6163 6b73 2e68 746d p__callbacks.htm │ │ │ -0019acd0: 6c23 6761 3962 3439 3835 6562 3561 3538 l#ga9b4985eb5a58 │ │ │ -0019ace0: 3866 3463 3136 6164 3838 6566 3763 6133 8f4c16ad88ef7ca3 │ │ │ -0019acf0: 3239 6463 223e 666f 7065 6e3c 2f61 3e20 29dc">fopen │ │ │ -0019ad00: 3d20 6d79 5f74 6370 5f63 6f6e 6e65 6374 = my_tcp_connect │ │ │ -0019ad10: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
/* fclose is us │ │ │ -0019ad50: 6564 2074 6f20 6469 7363 6f6e 6e65 6374 ed to disconnect │ │ │ -0019ad60: 202a 2f3c 2f73 7061 6e3e 203c 2f64 6976 */
..
/* fcl │ │ │ -0019ae60: 6f73 6573 6f63 6b65 7420 6973 2075 7365 osesocket is use │ │ │ -0019ae70: 6420 6f6e 6c79 2074 6f20 636c 6f73 6520 d only to close │ │ │ -0019ae80: 7468 6520 6d61 7374 6572 2073 6f63 6b65 the master socke │ │ │ -0019ae90: 7420 696e 2061 2073 6572 7665 7220 7570 t in a server up │ │ │ -0019aea0: 6f6e 2073 6f61 705f 646f 6e65 2829 202a on soap_done() * │ │ │ -0019aeb0: 2f3c 2f73 7061 6e3e 203c 2f64 6976 3e0a /
. │ │ │ -0019aec0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
soap.fcloses │ │ │ -0019af60: 6f63 6b65 743c 2f61 3e20 3d20 6d79 5f74 ocket = my_t │ │ │ -0019af70: 6370 5f63 6c6f 7365 736f 636b 6574 3b20 cp_closesocket; │ │ │ -0019af80: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
/ │ │ │ -0019afb0: 2a20 6673 6875 7464 6f77 6e73 6f63 6b65 * fshutdownsocke │ │ │ -0019afc0: 7420 6973 2075 7365 6420 6166 7465 7220 t is used after │ │ │ -0019afd0: 636f 6d70 6c65 7469 6e67 2061 2073 656e completing a sen │ │ │ -0019afe0: 6420 6f70 6572 6174 696f 6e20 746f 2073 d operation to s │ │ │ -0019aff0: 656e 6420 5443 5020 4649 4e20 2a2f 3c2f end TCP FIN */
.< │ │ │ -0019b020: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -0019b030: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ -0019b040: 6874 6d6c 223e 736f 6170 3c2f 613e 2e3c html">soap.< │ │ │ -0019b050: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -0019b060: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ -0019b070: 705f 5f63 616c 6c62 6163 6b73 2e68 746d p__callbacks.htm │ │ │ -0019b080: 6c23 6761 3531 6530 3964 6466 3736 3961 l#ga51e09ddf769a │ │ │ -0019b090: 3264 6463 6438 3734 6662 3665 3666 6235 2ddcd874fb6e6fb5 │ │ │ -0019b0a0: 3238 3964 223e 6673 6875 7464 6f77 6e73 289d">fshutdowns │ │ │ -0019b0b0: 6f63 6b65 743c 2f61 3e20 3d20 6d79 5f74 ocket = my_t │ │ │ -0019b0c0: 6370 5f73 6875 7464 6f77 6e73 6f63 6b65 cp_shutdownsocke │ │ │ -0019b0d0: 743b 203c 2f64 6976 3e0a 3c64 6976 2063 t;
.
/* setting fpo │ │ │ -0019b110: 6c6c 2069 7320 6f70 7469 6f6e 616c 2c20 ll is optional, │ │ │ -0019b120: 6c65 6176 6520 6974 204e 554c 4c20 746f leave it NULL to │ │ │ -0019b130: 206f 6d69 7420 706f 6c6c 696e 6720 7468 omit polling th │ │ │ -0019b140: 6520 7365 7276 6572 202a 2f3c 2f73 7061 e server */
.
soap.fpoll = m │ │ │ -0019b200: 795f 706f 6c6c 3b20 3c2f 6469 763e 0a3c y_poll;
.< │ │ │ -0019b210: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -0019b220: 3e3c 7370 616e 2063 6c61 7373 3d22 636f >/* faccep │ │ │ -0019b240: 7420 6973 2075 7365 6420 6f6e 6c79 2062 t is used only b │ │ │ -0019b250: 7920 6120 7365 7276 6572 2061 7070 6c69 y a server appli │ │ │ -0019b260: 6361 7469 6f6e 202a 2f3c 2f73 7061 6e3e cation */ │ │ │ -0019b270: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
soap.faccept = m │ │ │ -0019b320: 795f 6163 6365 7074 3b3c 2f64 6976 3e0a y_accept;
. │ │ │ -0019b330: 3c64 6976 2063 6c61 7373 3d22 7474 6322
in │ │ │ -0019b410: 7428 2a20 6670 6f6c 6c29 2873 7472 7563 t(* fpoll)(struc │ │ │ -0019b420: 7420 736f 6170 202a 736f 6170 293c 2f64 t soap *soap)
Callback t │ │ │ -0019b450: 6861 7420 626c 6f63 6b73 2075 6e74 696c hat blocks until │ │ │ -0019b460: 2061 6374 6976 6974 7920 6973 2064 6574 activity is det │ │ │ -0019b470: 6563 7465 6420 6f6e 2074 6865 2073 6f61 ected on the soa │ │ │ -0019b480: 703a 3a73 6f63 6b65 7420 6f72 2073 6f61 p::socket or soa │ │ │ -0019b490: 703a 3a6d 6173 7465 7220 736f 636b 6574 p::master socket │ │ │ -0019b4a0: 2c2e 2e2e 3c2f 6469 763e 3c64 6976 2063 ,...
│ │ │ -0019b4c0: 4465 6669 6e69 7469 6f6e 3a3c 2f62 3e20 Definition: │ │ │ -0019b4d0: 7374 6473 6f61 7032 2e68 3a34 3539 343c stdsoap2.h:4594< │ │ │ -0019b4e0: 2f64 6976 3e3c 2f64 6976 3e0a 3c64 6976 /div>
.
int(* fclosesoc │ │ │ -0019b5e0: 6b65 7429 2873 7472 7563 7420 736f 6170 ket)(struct soap │ │ │ -0019b5f0: 202a 736f 6170 2c20 534f 4150 5f53 4f43 *soap, SOAP_SOC │ │ │ -0019b600: 4b45 5420 736f 636b 293c 2f64 6976 3e3c KET sock)
< │ │ │ -0019b610: 6469 7620 636c 6173 733d 2274 7464 6f63 div class="ttdoc │ │ │ -0019b620: 223e 4361 6c6c 6261 636b 2074 6861 7420 ">Callback that │ │ │ -0019b630: 636c 6f73 6573 2061 2067 6976 656e 2073 closes a given s │ │ │ -0019b640: 6f63 6b65 742e 3c2f 6469 763e 3c64 6976 ocket.
< │ │ │ -0019b660: 623e 4465 6669 6e69 7469 6f6e 3a3c 2f62 b>Definition: stdsoap2.h:457 │ │ │ -0019b680: 303c 2f64 6976 3e3c 2f64 6976 3e0a 3c64 0
.
soap::fshutdo │ │ │ -0019b750: 776e 736f 636b 6574 3c2f 613e 3c2f 6469 wnsocket
int(* fshu │ │ │ -0019b780: 7464 6f77 6e73 6f63 6b65 7429 2873 7472 tdownsocket)(str │ │ │ -0019b790: 7563 7420 736f 6170 202a 736f 6170 2c20 uct soap *soap, │ │ │ -0019b7a0: 534f 4150 5f53 4f43 4b45 5420 736f 636b SOAP_SOCKET sock │ │ │ -0019b7b0: 2c20 696e 7420 686f 7729 3c2f 6469 763e , int how)
│ │ │ -0019b7c0: 3c64 6976 2063 6c61 7373 3d22 7474 646f
Callback that │ │ │ -0019b7e0: 2073 6875 7473 2064 6f77 6e20 6120 6769 shuts down a gi │ │ │ -0019b7f0: 7665 6e20 736f 636b 6574 2e3c 2f64 6976 ven socket.
Definitio │ │ │ -0019b820: 6e3a 3c2f 623e 2073 7464 736f 6170 322e n: stdsoap2. │ │ │ -0019b830: 683a 3435 3833 3c2f 6469 763e 3c2f 6469 h:4583
.
< │ │ │ -0019b910: 6469 7620 636c 6173 733d 2274 7464 6563 div class="ttdec │ │ │ -0019b920: 6922 3e53 4f41 505f 534f 434b 4554 282a i">SOAP_SOCKET(* │ │ │ -0019b930: 2066 6163 6365 7074 2928 7374 7275 6374 faccept)(struct │ │ │ -0019b940: 2073 6f61 7020 2a73 6f61 702c 2053 4f41 soap *soap, SOA │ │ │ -0019b950: 505f 534f 434b 4554 2073 6f63 6b2c 2073 P_SOCKET sock, s │ │ │ -0019b960: 7472 7563 7420 736f 636b 6164 6472 202a truct sockaddr * │ │ │ -0019b970: 6164 6472 2c20 696e 7420 2a6c 656e 293c addr, int *len)< │ │ │ -0019b980: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
Callback │ │ │ -0019b9a0: 2074 6861 7420 7761 6974 7320 666f 7220 that waits for │ │ │ -0019b9b0: 616e 6420 6163 6365 7074 7320 6120 736f and accepts a so │ │ │ -0019b9c0: 636b 6574 2063 6f6e 6e65 6374 696f 6e20 cket connection │ │ │ -0019b9d0: 7265 7175 6573 7465 6420 6279 2061 2063 requested by a c │ │ │ -0019b9e0: 6c69 656e 742e 3c2f 6469 763e 3c64 6976 lient.
< │ │ │ -0019ba00: 623e 4465 6669 6e69 7469 6f6e 3a3c 2f62 b>Definition: stdsoap2.h:450 │ │ │ -0019ba20: 393c 2f64 6976 3e3c 2f64 6976 3e0a 3c2f 9
.

These fu │ │ │ -0019ba50: 6e63 7469 6f6e 7320 7368 6f75 6c64 2070 nctions should p │ │ │ -0019ba60: 726f 7669 6465 2061 206d 696e 696d 616c rovide a minimal │ │ │ -0019ba70: 2069 6e70 7574 2f6f 7574 7075 7420 7374 input/output st │ │ │ -0019ba80: 6163 6b20 283c 636f 6465 3e3c 6120 636c ack (soap::frecv< │ │ │ -0019bb30: 2f61 3e3c 2f63 6f64 653e 2061 6e64 203c /a> and < │ │ │ -0019bb40: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>s │ │ │ -0019bbd0: 6f61 703a 3a66 7365 6e64 3c2f 613e 3c2f oap::fsend) to read/w │ │ │ -0019bbf0: 7269 7465 2058 4d4c 2061 6e64 2073 6f63 rite XML and soc │ │ │ -0019bc00: 6b65 742d 6c69 6b65 2073 7461 636b 2028 ket-like stack ( │ │ │ -0019bc10: 7468 6520 6f74 6865 7220 6675 6e63 7469 the other functi │ │ │ -0019bc20: 6f6e 7329 2077 6865 6e20 6465 7665 6c6f ons) when develo │ │ │ -0019bc30: 7069 6e67 2063 6c69 656e 7420 616e 6420 ping client and │ │ │ -0019bc40: 7365 7276 6572 2061 7070 6c69 6361 7469 server applicati │ │ │ -0019bc50: 6f6e 732e 3c2f 703e 0a3c 703e 5365 6520 ons.

.

See │ │ │ -0019bc60: 5365 6374 696f 6e20 3c61 2063 6c61 7373 Section Function callba │ │ │ -0019bca0: 636b 7320 666f 7220 6375 7374 6f6d 697a cks for customiz │ │ │ -0019bcb0: 6564 2049 2f4f 2061 6e64 2048 5454 5020 ed I/O and HTTP │ │ │ -0019bcc0: 6861 6e64 6c69 6e67 3c2f 613e 2066 6f72 handling for │ │ │ -0019bcd0: 206d 6f72 6520 6465 7461 696c 7320 6f6e more details on │ │ │ -0019bce0: 2074 6865 2075 7365 206f 6620 7468 6573 the use of thes │ │ │ -0019bcf0: 6520 6361 6c6c 6261 636b 732e 2041 6c6c e callbacks. All │ │ │ -0019bd00: 2063 616c 6c62 6163 6b20 6675 6e63 7469 callback functi │ │ │ -0019bd10: 6f6e 2070 6f69 6e74 6572 7320 7368 6f75 on pointers shou │ │ │ -0019bd20: 6c64 2062 6520 6e6f 6e2d 4e55 4c4c 2c20 ld be non-NULL, │ │ │ -0019bd30: 6578 6365 7074 203c 636f 6465 3e3c 6120 except soap::f │ │ │ -0019be00: 706f 6c6c 3c2f 613e 3c2f 636f 6465 3e2e poll. │ │ │ -0019be10: 3c2f 703e 0a3c 703e 596f 7520 6361 6e6e

.

You cann │ │ │ -0019be20: 6f74 2075 7365 203c 636f 6465 3e3c 6120 ot use soap_print_fa │ │ │ -0019bec0: 756c 743c 2f61 3e3c 2f63 6f64 653e 2061 ult a │ │ │ -0019bed0: 6e64 203c 636f 6465 3e3c 6120 636c 6173 nd soap_prin │ │ │ -0019bf80: 745f 6661 756c 745f 6c6f 6361 7469 6f6e t_fault_location │ │ │ -0019bf90: 3c2f 613e 3c2f 636f 6465 3e20 746f 2070 to p │ │ │ -0019bfa0: 7269 6e74 2065 7272 6f72 2064 6961 676e rint error diagn │ │ │ -0019bfb0: 6f73 7469 6373 2e20 496e 7374 6561 642c ostics. Instead, │ │ │ -0019bfc0: 2074 6865 2076 616c 7565 206f 6620 3c63 the value of soap:: │ │ │ -0019c080: 6572 726f 723c 2f61 3e3c 2f63 6f64 653e error │ │ │ -0019c090: 2c20 7768 6963 6820 636f 6e74 6169 6e73 , which contains │ │ │ -0019c0a0: 2074 6865 2067 534f 4150 2065 7272 6f72 the gSOAP error │ │ │ -0019c0b0: 2063 6f64 652c 2063 616e 2062 6520 7573 code, can be us │ │ │ -0019c0c0: 6564 2074 6f20 6465 7465 726d 696e 6520 ed to determine │ │ │ -0019c0d0: 7468 6520 6361 7573 6520 6f66 2061 2066 the cause of a f │ │ │ -0019c0e0: 6175 6c74 2e3c 2f70 3e0a 3c70 3ef0 9f94 ault.

.

... │ │ │ -0019c0f0: 9d20 3c61 2068 7265 663d 2223 223e 4261 . Ba │ │ │ -0019c100: 636b 2074 6f20 7461 626c 6520 6f66 2063 ck to table of c │ │ │ -0019c110: 6f6e 7465 6e74 733c 2f61 3e3c 2f70 3e0a ontents

. │ │ │ -0019c120: 3c68 323e 3c61 2063 6c61 7373 3d22 616e

.How to c │ │ │ -0019c150: 6f6d 6269 6e65 206d 756c 7469 706c 6520 ombine multiple │ │ │ -0019c160: 636c 6965 6e74 2061 6e64 2073 6572 7665 client and serve │ │ │ -0019c170: 7220 696d 706c 656d 656e 7461 7469 6f6e r implementation │ │ │ -0019c180: 7320 696e 746f 206f 6e65 2065 7865 6375 s into one execu │ │ │ -0019c190: 7461 626c 653c 2f68 323e 0a3c 703e 5468 table

.

Th │ │ │ -0019c1a0: 6520 7773 646c 3268 2074 6f6f 6c20 6361 e wsdl2h tool ca │ │ │ -0019c1b0: 6e20 6265 2075 7365 6420 746f 2069 6d70 n be used to imp │ │ │ -0019c1c0: 6f72 7420 6d75 6c74 6970 6c65 2057 5344 ort multiple WSD │ │ │ -0019c1d0: 4c73 2061 6e64 2073 6368 656d 6173 2061 Ls and schemas a │ │ │ -0019c1e0: 7420 6f6e 6365 2e20 5468 6520 7365 7276 t once. The serv │ │ │ -0019c1f0: 6963 6520 6465 6669 6e69 7469 6f6e 7320 ice definitions │ │ │ -0019c200: 6172 6520 636f 6d62 696e 6564 2069 6e20 are combined in │ │ │ -0019c210: 6f6e 6520 6865 6164 6572 2066 696c 6520 one header file │ │ │ -0019c220: 746f 2062 6520 7061 7273 6564 2062 7920 to be parsed by │ │ │ -0019c230: 736f 6170 6370 7032 2e20 4974 2069 7320 soapcpp2. It is │ │ │ -0019c240: 696d 706f 7274 616e 7420 746f 2061 7373 important to ass │ │ │ -0019c250: 6967 6e20 6e61 6d65 7370 6163 6520 7072 ign namespace pr │ │ │ -0019c260: 6566 6978 6573 2074 6f20 6e61 6d65 7370 efixes to namesp │ │ │ -0019c270: 6163 6520 5552 4973 2075 7369 6e67 2074 ace URIs using t │ │ │ -0019c280: 6865 203c 656d 3e3c 636f 6465 3e74 7970 he typ │ │ │ -0019c290: 656d 6170 2e64 6174 3c2f 636f 6465 3e3c emap.dat< │ │ │ -0019c2a0: 2f65 6d3e 2066 696c 652e 204f 7468 6572 /em> file. Other │ │ │ -0019c2b0: 7769 7365 2c20 7773 646c 3268 2077 696c wise, wsdl2h wil │ │ │ -0019c2c0: 6c20 6173 7369 676e 206e 616d 6573 7061 l assign namespa │ │ │ -0019c2d0: 6365 2070 7265 6669 7865 7320 3c63 6f64 ce prefixes ns1, ns2, │ │ │ -0019c300: 616e 6420 736f 206f 6e20 746f 2074 6865 and so on to the │ │ │ -0019c310: 2073 6572 7669 6365 206f 7065 7261 7469 service operati │ │ │ -0019c320: 6f6e 7320 616e 6420 7363 6865 6d61 2074 ons and schema t │ │ │ -0019c330: 7970 6573 2e20 5468 7573 2c20 616e 7920 ypes. Thus, any │ │ │ -0019c340: 6368 616e 6765 2074 6f20 6120 5753 444c change to a WSDL │ │ │ -0019c350: 206f 7220 7363 6865 6d61 206d 6179 2072 or schema may r │ │ │ -0019c360: 6573 756c 7420 696e 2061 206e 6577 2070 esult in a new p │ │ │ -0019c370: 7265 6669 7820 6173 7369 676e 6d65 6e74 refix assignment │ │ │ -0019c380: 2e20 466f 7220 6d6f 7265 2064 6574 6169 . For more detai │ │ │ -0019c390: 6c73 2c20 706c 6561 7365 2073 6565 2053 ls, please see S │ │ │ -0019c3a0: 6563 7469 6f6e 203c 6120 636c 6173 733d ection C │ │ │ -0019c3d0: 7573 746f 6d69 7a69 6e67 2058 4d4c 2064 ustomizing XML d │ │ │ -0019c3e0: 6174 6120 6269 6e64 696e 6773 2077 6974 ata bindings wit │ │ │ -0019c3f0: 6820 7468 6520 7479 7065 6d61 702e 6461 h the typemap.da │ │ │ -0019c400: 7420 6669 6c65 3c2f 613e 202e 3c2f 703e t file .

│ │ │ -0019c410: 0a3c 703e 416e 6f74 6865 7220 6170 7072 .

Another appr │ │ │ -0019c420: 6f61 6368 2074 6f20 636f 6d62 696e 6520 oach to combine │ │ │ -0019c430: 6d75 6c74 6970 6c65 2063 6c69 656e 7420 multiple client │ │ │ -0019c440: 616e 6420 7365 7276 6963 6520 6170 706c and service appl │ │ │ -0019c450: 6963 6174 696f 6e73 2069 6e74 6f20 6f6e ications into on │ │ │ -0019c460: 6520 6578 6563 7574 6162 6c65 2069 7320 e executable is │ │ │ -0019c470: 6279 2075 7369 6e67 2043 2b2b 206e 616d by using C++ nam │ │ │ -0019c480: 6573 7061 6365 7320 746f 2073 7472 7563 espaces to struc │ │ │ -0019c490: 7475 7261 6c6c 7920 7365 7061 7261 7465 turally separate │ │ │ -0019c4a0: 2074 6865 2064 6566 696e 6974 696f 6e73 the definitions │ │ │ -0019c4b0: 2e20 5468 6973 2069 7320 6175 746f 6d61 . This is automa │ │ │ -0019c4c0: 7465 6420 7769 7468 203c 6120 6872 6566 ted with │ │ │ -0019c4e0: 3c63 6f64 653e 7773 646c 3268 202d 7120 wsdl2h -q │ │ │ -0019c4f0: 6e61 6d65 3c2f 636f 6465 3e3c 2f62 3e20 name │ │ │ -0019c500: 6f70 7469 6f6e 203c 623e 3c63 6f64 653e option │ │ │ -0019c510: 2d71 206e 616d 653c 2f63 6f64 653e 3c2f -q name. Or by cr │ │ │ -0019c530: 6561 7469 6e67 206c 6962 7261 7269 6573 eating libraries │ │ │ -0019c540: 2069 6e20 4320 666f 7220 7468 6520 636c in C for the cl │ │ │ -0019c550: 6965 6e74 2f73 6572 7665 7220 6f62 6a65 ient/server obje │ │ │ -0019c560: 6374 7320 6173 2065 7870 6c61 696e 6564 cts as explained │ │ │ -0019c570: 2069 6e20 7375 6273 6571 7565 6e74 2073 in subsequent s │ │ │ -0019c580: 6563 7469 6f6e 733c 2f70 3e0a 3c70 3e42 ections

.

B │ │ │ -0019c590: 6f74 6820 6170 7072 6f61 6368 6573 2061 oth approaches a │ │ │ -0019c5a0: 7265 2064 656d 6f6e 7374 7261 7465 6420 re demonstrated │ │ │ -0019c5b0: 6279 2065 7861 6d70 6c65 7320 696e 2074 by examples in t │ │ │ -0019c5c0: 6865 2067 534f 4150 2073 6f75 7263 6520 he gSOAP source │ │ │ -0019c5d0: 636f 6465 2070 6163 6b61 6765 2c20 7468 code package, th │ │ │ -0019c5e0: 6520 3c65 6d3e 3c63 6f64 653e 6773 6f61 e gsoa │ │ │ -0019c5f0: 702f 7361 6d70 6c65 732f 6c69 6e6b 3c2f p/samples/link (C on │ │ │ -0019c610: 6c79 2920 616e 6420 3c65 6d3e 3c63 6f64 ly) and gsoap/samples/ │ │ │ -0019c630: 6c69 6e6b 2b2b 3c2f 636f 6465 3e3c 2f65 link++ (C++ with C++ │ │ │ -0019c650: 206e 616d 6573 7061 6365 7329 2065 7861 namespaces) exa │ │ │ -0019c660: 6d70 6c65 732e 3c2f 703e 0a3c 703e f09f mples.

.

.. │ │ │ -0019c670: 949d 203c 6120 6872 6566 3d22 2322 3e42 .. B │ │ │ -0019c680: 6163 6b20 746f 2074 6162 6c65 206f 6620 ack to table of │ │ │ -0019c690: 636f 6e74 656e 7473 3c2f 613e 3c2f 703e contents

│ │ │ -0019c6a0: 0a3c 6832 3e3c 6120 636c 6173 733d 2261 .

.H │ │ │ -0019c6d0: 6f77 2074 6f20 6275 696c 6420 6120 636c ow to build a cl │ │ │ -0019c6e0: 6965 6e74 206f 7220 7365 7276 6572 2069 ient or server i │ │ │ -0019c6f0: 6e20 6120 432b 2b20 636f 6465 206e 616d n a C++ code nam │ │ │ -0019c700: 6573 7061 6365 3c2f 6832 3e0a 3c70 3e59 espace

.

Y │ │ │ -0019c710: 6f75 2063 616e 2075 7365 2061 2043 2b2b ou can use a C++ │ │ │ -0019c720: 2063 6f64 6520 6e61 6d65 7370 6163 6520 code namespace │ │ │ -0019c730: 6f66 2079 6f75 7220 6368 6f69 6365 2069 of your choice i │ │ │ -0019c740: 6e20 796f 7572 2069 6e74 6572 6661 6365 n your interface │ │ │ -0019c750: 2068 6561 6465 7220 6669 6c65 2074 6f20 header file to │ │ │ -0019c760: 6275 696c 6420 6120 636c 6965 6e74 206f build a client o │ │ │ -0019c770: 7220 7365 7276 6572 2069 6e20 7468 6174 r server in that │ │ │ -0019c780: 2043 2b2b 206e 616d 6573 7061 6365 2e20 C++ namespace. │ │ │ -0019c790: 496e 2074 6869 7320 7761 792c 2079 6f75 In this way, you │ │ │ -0019c7a0: 2063 616e 2063 7265 6174 6520 6d75 6c74 can create mult │ │ │ -0019c7b0: 6970 6c65 2063 6c69 656e 7473 2061 6e64 iple clients and │ │ │ -0019c7c0: 2073 6572 7665 7273 2074 6861 7420 6361 servers that ca │ │ │ -0019c7d0: 6e20 6265 2063 6f6d 6269 6e65 6420 616e n be combined an │ │ │ -0019c7e0: 6420 6c69 6e6b 6564 2074 6f67 6574 6865 d linked togethe │ │ │ -0019c7f0: 7220 7769 7468 6f75 7420 636f 6e66 6c69 r without confli │ │ │ -0019c800: 6374 732c 2077 6869 6368 2069 7320 6578 cts, which is ex │ │ │ -0019c810: 706c 6169 6e65 6420 696e 206d 6f72 6520 plained in more │ │ │ -0019c820: 6465 7461 696c 2069 6e20 7468 6520 6e65 detail in the ne │ │ │ -0019c830: 7874 2073 6563 7469 6f6e 2028 7768 6963 xt section (whic │ │ │ -0019c840: 6820 616c 736f 2073 686f 7773 2061 6e20 h also shows an │ │ │ -0019c850: 6578 616d 706c 6520 636f 6d62 696e 696e example combinin │ │ │ -0019c860: 6720 7477 6f20 636c 6965 6e74 206c 6962 g two client lib │ │ │ -0019c870: 7261 7269 6573 2064 6566 696e 6564 2069 raries defined i │ │ │ -0019c880: 6e20 7477 6f20 432b 2b20 636f 6465 206e n two C++ code n │ │ │ -0019c890: 616d 6573 7061 6365 7329 2e3c 2f70 3e0a amespaces).

. │ │ │ -0019c8a0: 3c70 3e55 7365 203c 6120 6872 6566 3d22

Use wsdl2h -q na │ │ │ -0019c8d0: 6d65 3c2f 636f 6465 3e3c 2f62 3e20 6f70 me op │ │ │ -0019c8e0: 7469 6f6e 203c 623e 3c63 6f64 653e 2d71 tion -q │ │ │ -0019c8f0: 206e 616d 653c 2f63 6f64 653e 3c2f 623e name │ │ │ -0019c900: 3c2f 613e 2074 6f20 6765 6e65 7261 7465 to generate │ │ │ -0019c910: 2064 6566 696e 6974 696f 6e73 2069 6e20 definitions in │ │ │ -0019c920: 7468 6520 432b 2b20 3c63 6f64 653e 6e61 the C++ na │ │ │ -0019c930: 6d65 3c2f 636f 6465 3e20 6e61 6d65 7370 me namesp │ │ │ -0019c940: 6163 652e 2054 6869 7320 6f70 7469 6f6e ace. This option │ │ │ -0019c950: 2063 616e 2061 6c73 6f20 6265 2075 7365 can also be use │ │ │ -0019c960: 6420 696e 2063 6f6d 6269 6e61 7469 6f6e d in combination │ │ │ -0019c970: 2077 6974 6820 432b 2b20 7072 6f78 7920 with C++ proxy │ │ │ -0019c980: 616e 6420 7365 7276 6572 206f 626a 6563 and server objec │ │ │ -0019c990: 7420 6765 6e65 7261 7469 6f6e 2c20 7573 t generation, us │ │ │ -0019c9a0: 696e 6720 3c62 3e3c 636f 6465 3e73 6f61 ing soa │ │ │ -0019c9b0: 7063 7070 3220 2d6a 3c2f 636f 6465 3e3c pcpp2 -j< │ │ │ -0019c9c0: 2f62 3e20 6f70 7469 6f6e 203c 623e 3c63 /b> option -j or option < │ │ │ -0019c9f0: 636f 6465 3e2d 693c 2f63 6f64 653e 3c2f code>-i).

.

At m │ │ │ -0019ca10: 6f73 7420 6f6e 6520 6e61 6d65 7370 6163 ost one namespac │ │ │ -0019ca20: 6520 6361 6e20 6265 2064 6566 696e 6564 e can be defined │ │ │ -0019ca30: 2066 6f72 2074 6865 2065 6e74 6972 6520 for the entire │ │ │ -0019ca40: 696e 7465 7266 6163 6520 6865 6164 6572 interface header │ │ │ -0019ca50: 2066 696c 6520 666f 7220 736f 6170 6370 file for soapcp │ │ │ -0019ca60: 7032 2e20 5468 6520 432b 2b20 6e61 6d65 p2. The C++ name │ │ │ -0019ca70: 7370 6163 6520 6d75 7374 2063 6f6d 706c space must compl │ │ │ -0019ca80: 6574 656c 7920 656e 6361 7073 756c 6174 etely encapsulat │ │ │ -0019ca90: 6520 7468 6520 656e 7469 7265 2063 6f6e e the entire con │ │ │ -0019caa0: 7465 6e74 7320 6f66 2074 6865 2068 6561 tents of the hea │ │ │ -0019cab0: 6465 7220 6669 6c65 3a3c 2f70 3e0a 3c64 der file:

.
name │ │ │ -0019cb00: 7370 6163 6520 3c2f 7370 616e 3e4e 616d space Nam │ │ │ -0019cb10: 6573 7061 6365 4e61 6d65 207b 3c2f 6469 espaceName {.
... interface header file co │ │ │ -0019cb70: 6e74 656e 7473 202e 2e2e 203c 2f64 6976 ntents ...
.
}
.

When compi │ │ │ -0019cbc0: 6c69 6e67 2074 6869 7320 696e 7465 7266 ling this interf │ │ │ -0019cbd0: 6163 6520 6865 6164 6572 2066 696c 6520 ace header file │ │ │ -0019cbe0: 7769 7468 2074 6865 2073 6f61 7063 7070 with the soapcpp │ │ │ -0019cbf0: 3220 746f 6f6c 2c20 616c 6c20 7479 7065 2 tool, all type │ │ │ -0019cc00: 2064 6566 696e 6974 696f 6e73 2c20 7468 definitions, th │ │ │ -0019cc10: 6520 7365 7269 616c 697a 6572 7320 666f e serializers fo │ │ │ -0019cc20: 7220 7468 6573 6520 7479 7065 732c 2061 r these types, a │ │ │ -0019cc30: 6e64 2074 6865 2073 7475 6220 616e 6420 nd the stub and │ │ │ -0019cc40: 736b 656c 6574 6f6e 2066 756e 6374 696f skeleton functio │ │ │ -0019cc50: 6e73 2077 696c 6c20 6265 2070 6c61 6365 ns will be place │ │ │ -0019cc60: 6420 696e 2074 6869 7320 6e61 6d65 7370 d in this namesp │ │ │ -0019cc70: 6163 652e 2054 6865 2058 4d4c 206e 616d ace. The XML nam │ │ │ -0019cc80: 6573 7061 6365 206d 6170 7069 6e67 2074 espace mapping t │ │ │ -0019cc90: 6162 6c65 2028 7361 7665 6420 696e 2061 able (saved in a │ │ │ -0019cca0: 203c 656d 3e3c 636f 6465 3e2e 6e73 6d61 .nsma │ │ │ -0019ccb0: 703c 2f63 6f64 653e 3c2f 656d 3e20 6669 p fi │ │ │ -0019ccc0: 6c65 2920 7769 6c6c 206e 6f74 2062 6520 le) will not be │ │ │ -0019ccd0: 706c 6163 6564 2069 6e20 7468 6520 636f placed in the co │ │ │ -0019cce0: 6465 206e 616d 6573 7061 6365 2074 6f20 de namespace to │ │ │ -0019ccf0: 616c 6c6f 7720 6974 2074 6f20 6265 206c allow it to be l │ │ │ -0019cd00: 696e 6b65 6420 6173 2061 2067 6c6f 6261 inked as a globa │ │ │ -0019cd10: 6c20 6f62 6a65 6374 2e20 596f 7520 6361 l object. You ca │ │ │ -0019cd20: 6e20 7573 6520 3c62 3e3c 636f 6465 3e73 n use s │ │ │ -0019cd30: 6f61 7063 7070 3220 2d6e 3c2f 636f 6465 oapcpp2 -n option │ │ │ -0019cd50: 3c63 6f64 653e 2d6e 3c2f 636f 6465 3e3c -n< │ │ │ -0019cd60: 2f62 3e20 746f 2063 7265 6174 6520 6c6f /b> to create lo │ │ │ -0019cd70: 6361 6c20 584d 4c20 6e61 6d65 7370 6163 cal XML namespac │ │ │ -0019cd80: 6520 7461 626c 6573 2c20 7365 6520 5365 e tables, see Se │ │ │ -0019cd90: 6374 696f 6e20 3c61 2063 6c61 7373 3d22 ction soapcpp2 o │ │ │ -0019cdd0: 7074 696f 6e73 3c2f 613e 2028 6275 7420 ptions (but │ │ │ -0019cde0: 7265 6d65 6d62 6572 2074 6861 7420 796f remember that yo │ │ │ -0019cdf0: 7520 6578 706c 6963 6974 6c79 206e 6565 u explicitly nee │ │ │ -0019ce00: 6420 746f 2069 6e69 7469 616c 697a 6520 d to initialize │ │ │ -0019ce10: 7468 6520 6e61 6d65 7370 6163 6573 2074 the namespaces t │ │ │ -0019ce20: 6f20 706f 696e 7420 746f 2061 2074 6162 o point to a tab │ │ │ -0019ce30: 6c65 2061 7420 7275 6e20 7469 6d65 2075 le at run time u │ │ │ -0019ce40: 7369 6e67 203c 636f 6465 3e3c 6120 636c sing soap_ │ │ │ -0019cf10: 7365 745f 6e61 6d65 7370 6163 6573 3c2f set_namespaces). The │ │ │ -0019cf30: 6765 6e65 7261 7465 6420 6669 6c65 7320 generated files │ │ │ -0019cf40: 6172 6520 7072 6566 6978 6564 2077 6974 are prefixed wit │ │ │ -0019cf50: 6820 7468 6520 636f 6465 206e 616d 6573 h the code names │ │ │ -0019cf60: 7061 6365 206e 616d 6520 696e 7374 6561 pace name instea │ │ │ -0019cf70: 6420 6f66 2074 6865 2075 7375 616c 203c d of the usual < │ │ │ -0019cf80: 656d 3e3c 636f 6465 3e73 6f61 703c 2f63 em>soap file n │ │ │ -0019cfa0: 616d 6520 7072 6566 6978 2074 6f20 656e ame prefix to en │ │ │ -0019cfb0: 6162 6c65 206d 756c 7469 706c 6520 636c able multiple cl │ │ │ -0019cfc0: 6965 6e74 2f73 6572 7665 7220 636f 6465 ient/server code │ │ │ -0019cfd0: 7320 746f 2062 6520 6275 696c 6420 696e s to be build in │ │ │ -0019cfe0: 2074 6865 2073 616d 6520 7072 6f6a 6563 the same projec │ │ │ -0019cff0: 7420 6469 7265 6374 6f72 792e 3c2f 703e t directory.

│ │ │ -0019d000: 0a3c 703e 4265 6361 7573 6520 7468 6520 .

Because the │ │ │ -0019d010: 534f 4150 2048 6561 6465 7220 616e 6420 SOAP Header and │ │ │ -0019d020: 4661 756c 7420 7365 7269 616c 697a 6572 Fault serializer │ │ │ -0019d030: 7320 7769 6c6c 2061 6c73 6f20 6265 2070 s will also be p │ │ │ -0019d040: 6c61 6365 6420 696e 2074 6865 206e 616d laced in the nam │ │ │ -0019d050: 6573 7061 6365 2c20 7468 6579 2063 616e espace, they can │ │ │ -0019d060: 6e6f 7420 6265 2063 616c 6c65 6420 6672 not be called fr │ │ │ -0019d070: 6f6d 2074 6865 203c 656d 3e3c 636f 6465 om the gsoap/stdsoap2. │ │ │ -0019d090: 6370 703c 2f63 6f64 653e 3c2f 656d 3e20 cpp │ │ │ -0019d0a0: 7275 6e20 7469 6d65 206c 6962 7261 7279 run time library │ │ │ -0019d0b0: 2063 6f64 6520 616e 6420 6172 6520 7468 code and are th │ │ │ -0019d0c0: 6572 6566 6f72 6520 7265 6e64 6572 6564 erefore rendered │ │ │ -0019d0d0: 2075 6e75 7361 626c 652e 2054 6865 7265 unusable. There │ │ │ -0019d0e0: 666f 7265 2c20 7468 6573 6520 7365 7269 fore, these seri │ │ │ -0019d0f0: 616c 697a 6572 7320 6172 6520 6e6f 7420 alizers are not │ │ │ -0019d100: 636f 6d70 696c 6564 2061 7420 616c 6c20 compiled at all │ │ │ -0019d110: 2865 6e66 6f72 6365 6420 7769 7468 203c (enforced with < │ │ │ -0019d120: 636f 6465 3e23 6465 6669 6e65 2057 4954 code>#define WIT │ │ │ -0019d130: 485f 4e4f 474c 4f42 414c 3c2f 636f 6465 H_NOGLOBAL). To add SOAP │ │ │ -0019d150: 4865 6164 6572 2061 6e64 2046 6175 6c74 Header and Fault │ │ │ -0019d160: 2073 6572 6961 6c69 7a65 7273 2c20 796f serializers, yo │ │ │ -0019d170: 7520 6d75 7374 2063 6f6d 7069 6c65 2074 u must compile t │ │ │ -0019d180: 6865 6d20 7365 7061 7261 7465 6c79 2061 hem separately a │ │ │ -0019d190: 7320 666f 6c6c 6f77 732e 2046 6972 7374 s follows. First │ │ │ -0019d1a0: 2c20 6372 6561 7465 2061 206e 6577 2068 , create a new h │ │ │ -0019d1b0: 6561 6465 7220 6669 6c65 203c 656d 3e3c eader file < │ │ │ -0019d1c0: 636f 6465 3e65 6e76 2e68 3c2f 636f 6465 code>env.h with the │ │ │ -0019d1e0: 534f 4150 2048 6561 6465 7220 3c63 6f64 SOAP Header SOA │ │ │ -0019d250: 505f 454e 565f 5f48 6561 6465 723c 2f61 P_ENV__Header and SOA │ │ │ -0019d270: 5020 4661 756c 7420 3c63 6f64 653e 3c61 P Fault SOAP_ENV_ │ │ │ -0019d2e0: 5f46 6175 6c74 3c2f 613e 3c2f 636f 6465 _Fault structures, in │ │ │ -0019d300: 636c 7564 696e 6720 3c63 6f64 653e 3c61 cluding S │ │ │ -0019d370: 4f41 505f 454e 565f 5f44 6574 6169 6c3c OAP_ENV__Detail< │ │ │ -0019d380: 2f61 3e3c 2f63 6f64 653e 2069 6620 7468 /a> if th │ │ │ -0019d390: 6973 2073 7472 7563 7475 7265 2063 6f6e is structure con │ │ │ -0019d3a0: 7461 696e 7320 6d65 6d62 6572 7320 7468 tains members th │ │ │ -0019d3b0: 6174 2061 7265 2073 6572 6961 6c69 7a65 at are serialize │ │ │ -0019d3c0: 6420 6173 2066 6175 6c74 2064 6574 6169 d as fault detai │ │ │ -0019d3d0: 6c73 2e20 596f 7520 6361 6e20 6c65 6176 ls. You can leav │ │ │ -0019d3e0: 6520 7468 6973 2068 6561 6465 7220 6669 e this header fi │ │ │ -0019d3f0: 6c65 2065 6d70 7479 2069 6620 796f 7520 le empty if you │ │ │ -0019d400: 7761 6e74 2074 6f20 7573 6520 7468 6520 want to use the │ │ │ -0019d410: 6465 6661 756c 7420 534f 4150 2048 6561 default SOAP Hea │ │ │ -0019d420: 6465 7220 616e 6420 4661 756c 742e 2048 der and Fault. H │ │ │ -0019d430: 6f77 6576 6572 2c20 6966 2053 4f41 5020 owever, if SOAP │ │ │ -0019d440: 4865 6164 6572 7320 6172 6520 7265 7175 Headers are requ │ │ │ -0019d450: 6972 6564 2074 6865 6e20 796f 7520 6361 ired then you ca │ │ │ -0019d460: 6e6e 6f74 206c 6561 7665 2074 6865 203c nnot leave the < │ │ │ -0019d470: 636f 6465 3e3c 6120 636c 6173 733d 2265 code> │ │ │ -0019d4d0: 534f 4150 5f45 4e56 5f5f 4865 6164 6572 SOAP_ENV__Header │ │ │ -0019d4e0: 3c2f 613e 3c2f 636f 6465 3e20 7374 7275 stru │ │ │ -0019d4f0: 6374 7572 6520 656d 7074 792e 2046 6f72 cture empty. For │ │ │ -0019d500: 2065 7861 6d70 6c65 2c20 7468 6520 5753 example, the WS │ │ │ -0019d510: 2d41 6464 7265 7373 696e 6720 616e 6420 -Addressing and │ │ │ -0019d520: 5753 2d53 6563 7572 6974 7920 706c 7567 WS-Security plug │ │ │ -0019d530: 696e 7320 7265 7175 6972 6520 534f 4150 ins require SOAP │ │ │ -0019d540: 2048 6561 6465 7273 2077 6869 6368 2063 Headers which c │ │ │ -0019d550: 616e 2062 6520 696d 706f 7274 6564 2062 an be imported b │ │ │ -0019d560: 7920 6164 6469 6e67 203c 636f 6465 3e23 y adding # │ │ │ -0019d570: 696d 706f 7274 2022 7773 6135 2e68 223c import "wsa5.h"< │ │ │ -0019d580: 2f63 6f64 653e 2061 6e64 203c 636f 6465 /code> and #import "wsse.h │ │ │ -0019d5a0: 223c 2f63 6f64 653e 2c20 7265 7370 6563 ", respec │ │ │ -0019d5b0: 7469 7665 6c79 2074 6f20 3c65 6d3e 3c63 tively to env.h │ │ │ -0019d5d0: 3c2f 656d 3e2e 2054 6865 6e20 636f 6d70 . Then comp │ │ │ -0019d5e0: 696c 6520 7468 6973 2068 6561 6465 7220 ile this header │ │ │ -0019d5f0: 6669 6c65 2077 6974 683a 203c 2f70 3e3c file with:

< │ │ │ -0019d600: 7072 6520 636c 6173 733d 2266 7261 676d pre class="fragm │ │ │ -0019d610: 656e 7422 3e20 736f 6170 6370 7032 202d ent"> soapcpp2 - │ │ │ -0019d620: 7065 6e76 2065 6e76 2e68 0a3c 2f70 7265 penv env.h.

The generat │ │ │ -0019d640: 6564 203c 656d 3e3c 636f 6465 3e65 6e76 ed env │ │ │ -0019d650: 432e 6370 703c 2f63 6f64 653e 3c2f 656d C.cpp file holds the │ │ │ -0019d670: 2053 4f41 5020 4865 6164 6572 2061 6e64 SOAP Header and │ │ │ -0019d680: 2046 6175 6c74 2073 6572 6961 6c69 7a65 Fault serialize │ │ │ -0019d690: 7273 2061 6e64 2079 6f75 2063 616e 206c rs and you can l │ │ │ -0019d6a0: 696e 6b20 7468 6973 2066 696c 6520 7769 ink this file wi │ │ │ -0019d6b0: 7468 2079 6f75 7220 636c 6965 6e74 2061 th your client a │ │ │ -0019d6c0: 6e64 2073 6572 7665 7220 6170 706c 6963 nd server applic │ │ │ -0019d6d0: 6174 696f 6e73 2e3c 2f70 3e0a 3c70 3ef0 ations.

.

. │ │ │ -0019d6e0: 9f94 9d20 3c61 2068 7265 663d 2223 223e ... │ │ │ -0019d6f0: 4261 636b 2074 6f20 7461 626c 6520 6f66 Back to table of │ │ │ -0019d700: 2063 6f6e 7465 6e74 733c 2f61 3e3c 2f70 contents

.

.How to │ │ │ -0019d740: 6372 6561 7465 2063 6c69 656e 742f 7365 create client/se │ │ │ -0019d750: 7276 6572 206c 6962 7261 7269 6573 3c2f rver libraries.

The soapc │ │ │ -0019d770: 7070 3220 746f 6f6c 2070 726f 6475 6365 pp2 tool produce │ │ │ -0019d780: 7320 3c65 6d3e 3c63 6f64 653e 736f 6170 s soap │ │ │ -0019d790: 436c 6965 6e74 4c69 622e 6370 703c 2f63 ClientLib.cpp and soapServ │ │ │ -0019d7c0: 6572 4c69 622e 6370 703c 2f63 6f64 653e erLib.cpp │ │ │ -0019d7d0: 3c2f 656d 3e20 736f 7572 6365 2063 6f64 source cod │ │ │ -0019d7e0: 6520 6669 6c65 7320 7468 6174 2061 7265 e files that are │ │ │ -0019d7f0: 2073 7065 6369 6669 6361 6c6c 7920 696e specifically in │ │ │ -0019d800: 7465 6e64 6564 2066 6f72 2062 7569 6c64 tended for build │ │ │ -0019d810: 696e 6720 7374 6174 6963 206f 7220 6479 ing static or dy │ │ │ -0019d820: 6e61 6d69 6320 636c 6965 6e74 2061 6e64 namic client and │ │ │ -0019d830: 2073 6572 7665 7220 6c69 6272 6172 6965 server librarie │ │ │ -0019d840: 7320 696e 2043 206f 7220 432b 2b2e 2054 s in C or C++. T │ │ │ -0019d850: 6865 7365 2066 696c 6573 2065 7870 6f72 hese files expor │ │ │ -0019d860: 7420 7468 6520 7374 7562 2061 6e64 2073 t the stub and s │ │ │ -0019d870: 6b65 6c65 746f 6e20 6675 6e63 7469 6f6e keleton function │ │ │ -0019d880: 732c 2062 7574 206b 6565 7020 616c 6c20 s, but keep all │ │ │ -0019d890: 7365 7269 616c 697a 6174 696f 6e20 636f serialization co │ │ │ -0019d8a0: 6465 2073 7461 7469 632c 2074 6875 7320 de static, thus │ │ │ -0019d8b0: 6869 6464 656e 2074 6f20 6176 6f69 6420 hidden to avoid │ │ │ -0019d8c0: 6c69 6e6b 2073 796d 626f 6c20 636f 6e66 link symbol conf │ │ │ -0019d8d0: 6c69 6374 7320 7768 656e 2063 6f6d 6269 licts when combi │ │ │ -0019d8e0: 6e69 6e67 206d 756c 7469 706c 6520 636c ning multiple cl │ │ │ -0019d8f0: 6965 6e74 7320 616e 6420 7365 7276 6963 ients and servic │ │ │ -0019d900: 6573 2069 6e74 6f20 6f6e 6520 6578 6563 es into one exec │ │ │ -0019d910: 7574 6162 6c65 2e20 4e6f 7465 2074 6861 utable. Note tha │ │ │ -0019d920: 7420 6974 2069 7320 6661 7220 7369 6d70 t it is far simp │ │ │ -0019d930: 6c65 7220 746f 2075 7365 2074 6865 2077 ler to use the w │ │ │ -0019d940: 7364 6c32 6820 746f 6f6c 206f 6e20 6d75 sdl2h tool on mu │ │ │ -0019d950: 6c74 6970 6c65 2057 5344 4c20 6669 6c65 ltiple WSDL file │ │ │ -0019d960: 7320 746f 2067 656e 6572 6174 6520 6120 s to generate a │ │ │ -0019d970: 6865 6164 6572 2066 696c 6520 7468 6174 header file that │ │ │ -0019d980: 2063 6f6d 6269 6e65 7320 616c 6c20 7365 combines all se │ │ │ -0019d990: 7276 6963 6520 6465 6669 6e69 7469 6f6e rvice definition │ │ │ -0019d9a0: 732e 2048 6f77 6576 6572 2c20 7468 6520 s. However, the │ │ │ -0019d9b0: 6170 7072 6f61 6368 2070 7265 7365 6e74 approach present │ │ │ -0019d9c0: 6564 2069 6e20 7468 6973 2073 6563 7469 ed in this secti │ │ │ -0019d9d0: 6f6e 2069 7320 7573 6566 756c 2077 6865 on is useful whe │ │ │ -0019d9e0: 6e20 6372 6561 7469 6e67 2028 6479 6e61 n creating (dyna │ │ │ -0019d9f0: 6d69 6329 206c 6962 7261 7269 6573 2066 mic) libraries f │ │ │ -0019da00: 6f72 2063 6c69 656e 7420 616e 6420 7365 or client and se │ │ │ -0019da10: 7276 6572 206f 626a 6563 7473 2c20 7375 rver objects, su │ │ │ -0019da20: 6368 2061 7320 444c 4c73 2061 7320 6465 ch as DLLs as de │ │ │ -0019da30: 7363 7269 6265 6420 696e 2053 6563 7469 scribed in Secti │ │ │ -0019da40: 6f6e 203c 6120 636c 6173 733d 2265 6c22 on How to cr │ │ │ -0019da70: 6561 7465 2044 4c4c 733c 2f61 3e20 2e3c eate DLLs .< │ │ │ -0019da80: 2f70 3e0a 3c64 6c20 636c 6173 733d 2273 /p>.

Note
On │ │ │ -0019dab0: 6520 6d61 6a6f 7220 6469 7361 6476 616e e major disadvan │ │ │ -0019dac0: 7461 6765 206f 6620 7468 6520 6170 7072 tage of the appr │ │ │ -0019dad0: 6f61 6368 2070 7265 7365 6e74 6564 2068 oach presented h │ │ │ -0019dae0: 6572 6520 6973 2074 6861 7420 7468 6520 ere is that the │ │ │ -0019daf0: 7365 7269 616c 697a 6572 2066 756e 6374 serializer funct │ │ │ -0019db00: 696f 6e73 2061 7265 206e 6f20 6c6f 6e67 ions are no long │ │ │ -0019db10: 6572 2061 6363 6573 7369 626c 6520 696e er accessible in │ │ │ -0019db20: 2074 6865 2075 7365 7227 7320 736f 7572 the user's sour │ │ │ -0019db30: 6365 2063 6f64 652c 2062 6563 6175 7365 ce code, because │ │ │ -0019db40: 2073 6572 6961 6c69 7a65 7273 2077 696c serializers wil │ │ │ -0019db50: 6c20 6265 2063 6f6e 7665 7274 6564 2074 l be converted t │ │ │ -0019db60: 6f20 7374 6174 6963 2066 756e 6374 696f o static functio │ │ │ -0019db70: 6e73 2028 746f 2062 6520 7573 6564 2062 ns (to be used b │ │ │ -0019db80: 7920 7468 6520 6765 6e65 7261 7465 6420 y the generated │ │ │ -0019db90: 7374 7562 2061 6e64 2073 6b65 6c65 746f stub and skeleto │ │ │ -0019dba0: 6e20 6675 6e63 7469 6f6e 7320 6f6e 6c79 n functions only │ │ │ -0019dbb0: 292e 2046 6f72 2065 7861 6d70 6c65 2c20 ). For example, │ │ │ -0019dbc0: 6675 6e63 7469 6f6e 7320 7375 6368 2061 functions such a │ │ │ -0019dbd0: 7320 3c63 6f64 653e 736f 6170 5f6e 6577 s soap_new │ │ │ -0019dbe0: 5f54 3c2f 636f 6465 3e2c 203c 636f 6465 _T, soap_default_T< │ │ │ -0019dc00: 2f63 6f64 653e 2c20 3c63 6f64 653e 736f /code>, so │ │ │ -0019dc10: 6170 5f77 7269 7465 5f54 3c2f 636f 6465 ap_write_T, soap_re │ │ │ -0019dc30: 6164 5f54 3c2f 636f 6465 3e2c 203c 636f ad_T, soap_put_T, and │ │ │ -0019dc60: 736f 6170 5f67 6574 5f54 3c2f 636f 6465 soap_get_T cannot be used │ │ │ -0019dc80: 2061 6e79 206c 6f6e 6765 722e 3c2f 6464 any longer.
.

Using │ │ │ -0019dca0: 432b 2b20 6e61 6d65 7370 6163 6573 2069 C++ namespaces i │ │ │ -0019dcb0: 7320 6120 6265 7474 6572 2061 6c74 6572 s a better alter │ │ │ -0019dcc0: 6e61 7469 7665 2077 6865 6e20 6275 696c native when buil │ │ │ -0019dcd0: 6469 6e67 2061 7070 6c69 6361 7469 6f6e ding application │ │ │ -0019dce0: 7320 696e 2043 2b2b 2074 6861 7420 636f s in C++ that co │ │ │ -0019dcf0: 6d62 696e 6520 6d75 6c74 6970 6c65 2063 mbine multiple c │ │ │ -0019dd00: 6c69 656e 7473 2061 6e64 2073 6572 7669 lients and servi │ │ │ -0019dd10: 6365 732e 2054 6f20 6275 696c 6420 6d75 ces. To build mu │ │ │ -0019dd20: 6c74 6970 6c65 206c 6962 7261 7269 6573 ltiple libraries │ │ │ -0019dd30: 2c20 796f 7520 6361 6e20 6465 6669 6e65 , you can define │ │ │ -0019dd40: 2061 2043 2b2b 206e 616d 6573 7061 6365 a C++ namespace │ │ │ -0019dd50: 2069 6e20 796f 7572 2068 6561 6465 7220 in your header │ │ │ -0019dd60: 6669 6c65 2077 6974 6820 3c62 3e3c 636f file with soapcpp2 -qna │ │ │ -0019dd80: 6d65 3c2f 636f 6465 3e3c 2f62 3e20 6f70 me op │ │ │ -0019dd90: 7469 6f6e 203c 623e 3c63 6f64 653e 2d71 tion -q │ │ │ -0019dda0: 6e61 6d65 3c2f 636f 6465 3e3c 2f62 3e2c name, │ │ │ -0019ddb0: 2073 6565 2053 6563 7469 6f6e 203c 6120 see Section How t │ │ │ -0019ddf0: 6f20 6275 696c 6420 6120 636c 6965 6e74 o build a client │ │ │ -0019de00: 206f 7220 7365 7276 6572 2069 6e20 6120 or server in a │ │ │ -0019de10: 432b 2b20 636f 6465 206e 616d 6573 7061 C++ code namespa │ │ │ -0019de20: 6365 3c2f 613e 2066 6f72 2064 6574 6169 ce for detai │ │ │ -0019de30: 6c73 2e3c 2f70 3e0a 3c70 3e46 6f72 2043 ls.

.

For C │ │ │ -0019de40: 2c20 796f 7520 6361 6e20 7573 6520 3c62 , you can use soapcpp2 │ │ │ -0019de60: 2d63 202d 7020 6e61 6d65 3c2f 636f 6465 -c -p name option │ │ │ -0019de80: 3c63 6f64 653e 2d70 206e 616d 653c 2f63 -p name to rena │ │ │ -0019dea0: 6d65 2074 6865 2067 656e 6572 6174 6564 me the generated │ │ │ -0019deb0: 203c 656d 3e3c 636f 6465 3e73 6f61 7043 soapC │ │ │ -0019dec0: 6c69 656e 744c 6962 2e63 3c2f 636f 6465 lientLib.c and < │ │ │ -0019dee0: 636f 6465 3e73 6f61 7053 6572 7665 724c code>soapServerL │ │ │ -0019def0: 6962 2e63 3c2f 636f 6465 3e3c 2f65 6d3e ib.c │ │ │ -0019df00: 2028 616e 6420 6173 736f 6369 6174 6564 (and associated │ │ │ -0019df10: 2920 6669 6c65 732e 2054 6865 203c 623e ) files. The │ │ │ -0019df20: 3c63 6f64 653e 2d70 206e 616d 653c 2f63 -p name option │ │ │ -0019df40: 7370 6563 6966 6965 7320 7468 6520 6669 specifies the fi │ │ │ -0019df50: 6c65 203c 656d 3e3c 636f 6465 3e6e 616d le nam │ │ │ -0019df60: 653c 2f63 6f64 653e 3c2f 656d 3e20 7072 e pr │ │ │ -0019df70: 6566 6978 2074 6f20 7265 706c 6163 6520 efix to replace │ │ │ -0019df80: 7468 6520 3c65 6d3e 3c63 6f64 653e 736f the so │ │ │ -0019df90: 6170 3c2f 636f 6465 3e3c 2f65 6d3e 2066 ap f │ │ │ -0019dfa0: 696c 6520 6e61 6d65 2070 7265 6669 782e ile name prefix. │ │ │ -0019dfb0: 3c2f 703e 0a3c 703e 5468 6520 656e 6769

.

The engi │ │ │ -0019dfc0: 6e65 2064 6f65 7320 6e6f 7420 6465 6669 ne does not defi │ │ │ -0019dfd0: 6e65 2053 4f41 5020 4865 6164 6572 2061 ne SOAP Header a │ │ │ -0019dfe0: 6e64 2046 6175 6c74 2073 6572 6961 6c69 nd Fault seriali │ │ │ -0019dff0: 7a65 7273 2074 6861 7420 7468 6520 656e zers that the en │ │ │ -0019e000: 6769 6e65 206e 6565 6473 2e20 5765 2074 gine needs. We t │ │ │ -0019e010: 6865 7265 666f 7265 2061 6464 2053 4f41 herefore add SOA │ │ │ -0019e020: 5020 4865 6164 6572 2061 6e64 2046 6175 P Header and Fau │ │ │ -0019e030: 6c74 2073 6572 6961 6c69 7a65 7273 2c20 lt serializers, │ │ │ -0019e040: 7768 6963 6820 6172 6520 636f 6d70 696c which are compil │ │ │ -0019e050: 6564 2073 6570 6172 6174 656c 7920 6173 ed separately as │ │ │ -0019e060: 2066 6f6c 6c6f 7773 2e20 4669 7273 742c follows. First, │ │ │ -0019e070: 2063 7265 6174 6520 6120 6e65 7720 6865 create a new he │ │ │ -0019e080: 6164 6572 2066 696c 6520 3c65 6d3e 3c63 ader file env.h │ │ │ -0019e0a0: 3c2f 656d 3e20 7769 7468 2074 6865 2053 with the S │ │ │ -0019e0b0: 4f41 5020 4865 6164 6572 203c 636f 6465 OAP Header SOAP │ │ │ -0019e120: 5f45 4e56 5f5f 4865 6164 6572 3c2f 613e _ENV__Header │ │ │ -0019e130: 3c2f 636f 6465 3e20 616e 6420 534f 4150 and SOAP │ │ │ -0019e140: 2046 6175 6c74 203c 636f 6465 3e3c 6120 Fault SOAP_ENV__ │ │ │ -0019e1b0: 4661 756c 743c 2f61 3e3c 2f63 6f64 653e Fault │ │ │ -0019e1c0: 2073 7472 7563 7475 7265 732c 2069 6e63 structures, inc │ │ │ -0019e1d0: 6c75 6469 6e67 203c 636f 6465 3e3c 6120 luding SO │ │ │ -0019e240: 4150 5f45 4e56 5f5f 4465 7461 696c 3c2f AP_ENV__Detail if thi │ │ │ -0019e260: 7320 7374 7275 6374 7572 6520 636f 6e74 s structure cont │ │ │ -0019e270: 6169 6e73 206d 656d 6265 7273 2074 6861 ains members tha │ │ │ -0019e280: 7420 6172 6520 7365 7269 616c 697a 6564 t are serialized │ │ │ -0019e290: 2061 7320 6661 756c 7420 6465 7461 696c as fault detail │ │ │ -0019e2a0: 732e 2059 6f75 2063 616e 206c 6561 7665 s. You can leave │ │ │ -0019e2b0: 2074 6869 7320 6865 6164 6572 2066 696c this header fil │ │ │ -0019e2c0: 6520 656d 7074 7920 6966 2079 6f75 2077 e empty if you w │ │ │ -0019e2d0: 616e 7420 746f 2075 7365 2074 6865 2064 ant to use the d │ │ │ -0019e2e0: 6566 6175 6c74 2053 4f41 5020 4865 6164 efault SOAP Head │ │ │ -0019e2f0: 6572 2061 6e64 2046 6175 6c74 2e20 486f er and Fault. Ho │ │ │ -0019e300: 7765 7665 722c 2069 6620 534f 4150 2048 wever, if SOAP H │ │ │ -0019e310: 6561 6465 7273 2061 7265 2072 6571 7569 eaders are requi │ │ │ -0019e320: 7265 6420 7468 656e 2079 6f75 2063 616e red then you can │ │ │ -0019e330: 6e6f 7420 6c65 6176 6520 7468 6520 3c63 not leave the S │ │ │ -0019e3a0: 4f41 505f 454e 565f 5f48 6561 6465 723c OAP_ENV__Header< │ │ │ -0019e3b0: 2f61 3e3c 2f63 6f64 653e 2073 7472 7563 /a> struc │ │ │ -0019e3c0: 7475 7265 2065 6d70 7479 2e20 466f 7220 ture empty. For │ │ │ -0019e3d0: 6578 616d 706c 652c 2074 6865 2057 532d example, the WS- │ │ │ -0019e3e0: 4164 6472 6573 7369 6e67 2061 6e64 2057 Addressing and W │ │ │ -0019e3f0: 532d 5365 6375 7269 7479 2070 6c75 6769 S-Security plugi │ │ │ -0019e400: 6e73 2072 6571 7569 7265 2053 4f41 5020 ns require SOAP │ │ │ -0019e410: 4865 6164 6572 7320 7768 6963 6820 6361 Headers which ca │ │ │ -0019e420: 6e20 6265 2069 6d70 6f72 7465 6420 6279 n be imported by │ │ │ -0019e430: 2061 6464 696e 6720 3c63 6f64 653e 2369 adding #i │ │ │ -0019e440: 6d70 6f72 7420 2277 7361 352e 6822 3c2f mport "wsa5.h" and │ │ │ -0019e460: 2369 6d70 6f72 7420 2277 7373 652e 6822 #import "wsse.h" │ │ │ -0019e470: 3c2f 636f 6465 3e2c 2072 6573 7065 6374 , respect │ │ │ -0019e480: 6976 656c 7920 746f 203c 656d 3e3c 636f ively to env.h< │ │ │ -0019e4a0: 2f65 6d3e 2e20 5468 656e 2063 6f6d 7069 /em>. Then compi │ │ │ -0019e4b0: 6c65 2074 6869 7320 6865 6164 6572 2066 le this header f │ │ │ -0019e4c0: 696c 6520 7769 7468 3a20 3c2f 703e 3c70 ile with:

soapcpp2 -p │ │ │ -0019e4f0: 656e 7620 656e 762e 680a 3c2f 7072 653e env env.h. │ │ │ -0019e500: 3c70 3e20 5468 6520 6765 6e65 7261 7465

The generate │ │ │ -0019e510: 6420 3c65 6d3e 3c63 6f64 653e 656e 7643 d envC │ │ │ -0019e520: 2e63 7070 3c2f 636f 6465 3e3c 2f65 6d3e .cpp │ │ │ -0019e530: 2066 696c 6520 686f 6c64 7320 7468 6520 file holds the │ │ │ -0019e540: 534f 4150 2048 6561 6465 7220 616e 6420 SOAP Header and │ │ │ -0019e550: 4661 756c 7420 7365 7269 616c 697a 6572 Fault serializer │ │ │ -0019e560: 7320 616e 6420 796f 7520 6361 6e20 6372 s and you can cr │ │ │ -0019e570: 6561 7465 2061 2028 6479 6e61 6d69 6329 eate a (dynamic) │ │ │ -0019e580: 206c 6962 7261 7279 2066 6f72 2069 7420 library for it │ │ │ -0019e590: 746f 206c 696e 6b20 6974 2077 6974 6820 to link it with │ │ │ -0019e5a0: 796f 7572 2063 6c69 656e 7420 616e 6420 your client and │ │ │ -0019e5b0: 7365 7276 6572 2061 7070 6c69 6361 7469 server applicati │ │ │ -0019e5c0: 6f6e 732e 3c2f 703e 0a3c 703e 596f 7520 ons.

.

You │ │ │ -0019e5d0: 7368 6f75 6c64 2074 6865 6e20 636f 6d70 should then comp │ │ │ -0019e5e0: 696c 6520 7468 6520 3c65 6d3e 3c63 6f64 ile the gsoap/stdsoap2 │ │ │ -0019e600: 2e63 7070 3c2f 636f 6465 3e3c 2f65 6d3e .cpp │ │ │ -0019e610: 206c 6962 7261 7279 2077 6974 6820 7468 library with th │ │ │ -0019e620: 6520 636f 6d70 696c 652d 7469 6d65 203c e compile-time < │ │ │ -0019e630: 636f 6465 3e23 5749 5448 5f4e 4f4e 414d code>#WITH_NONAM │ │ │ -0019e640: 4553 5041 4345 533c 2f63 6f64 653e 2066 ESPACES f │ │ │ -0019e650: 6c61 673a 203c 2f70 3e3c 7072 6520 636c lag:

 
│ │ │ -0019e670: 632b 2b20 2d44 5749 5448 5f4e 4f4e 414d  c++ -DWITH_NONAM
│ │ │ -0019e680: 4553 5041 4345 5320 2d63 2073 7464 736f  ESPACES -c stdso
│ │ │ -0019e690: 6170 322e 6370 700a 3c2f 7072 653e 3c70  ap2.cpp.

This omits the │ │ │ -0019e6b0: 2072 6566 6572 656e 6365 2074 6f20 7468 reference to th │ │ │ -0019e6c0: 6520 676c 6f62 616c 206e 616d 6573 7061 e global namespa │ │ │ -0019e6d0: 6365 7320 7461 626c 652c 2077 6869 6368 ces table, which │ │ │ -0019e6e0: 2069 7320 6e6f 7768 6572 6520 746f 2062 is nowhere to b │ │ │ -0019e6f0: 6520 6465 6669 6e65 6420 7369 6e63 6520 e defined since │ │ │ -0019e700: 7765 2077 696c 6c20 7573 6520 584d 4c20 we will use XML │ │ │ -0019e710: 6e61 6d65 7370 6163 6573 2066 6f72 2065 namespaces for e │ │ │ -0019e720: 6163 6820 636c 6965 6e74 2f73 6572 7669 ach client/servi │ │ │ -0019e730: 6365 2073 6570 6172 6174 656c 792e 2054 ce separately. T │ │ │ -0019e740: 6865 7265 666f 7265 2c20 796f 7520 6d75 herefore, you mu │ │ │ -0019e750: 7374 2065 7870 6c69 6369 746c 7920 7365 st explicitly se │ │ │ -0019e760: 7420 7468 6520 6e61 6d65 7370 6163 6573 t the namespaces │ │ │ -0019e770: 2076 616c 7565 206f 6620 7468 6520 3c63 value of the │ │ │ -0019e7d0: 736f 6170 3c2f 613e 3c2f 636f 6465 3e20 soap │ │ │ -0019e7e0: 636f 6e74 6578 7420 696e 2079 6f75 7220 context in your │ │ │ -0019e7f0: 636f 6465 2065 7665 7279 2074 696d 6520 code every time │ │ │ -0019e800: 6166 7465 7220 696e 6974 6961 6c69 7a61 after initializa │ │ │ -0019e810: 7469 6f6e 206f 6620 7468 6520 3c63 6f64 tion of the so │ │ │ -0019e870: 6170 3c2f 613e 3c2f 636f 6465 3e20 636f ap co │ │ │ -0019e880: 6e74 6578 7420 7769 7468 2074 6865 203c ntext with the < │ │ │ -0019e890: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soap_set_na │ │ │ -0019e960: 6d65 7370 6163 6573 2873 7472 7563 7420 mespaces(struct │ │ │ -0019e970: 736f 6170 2a2c 2063 6f6e 7374 2073 7472 soap*, const str │ │ │ -0019e980: 7563 7420 4e61 6d65 7370 6163 652a 293c uct Namespace*)< │ │ │ -0019e990: 2f61 3e3c 2f63 6f64 653e 2066 756e 6374 /a> funct │ │ │ -0019e9a0: 696f 6e2e 3c2f 703e 0a3c 703e 466f 7220 ion.

.

For │ │ │ -0019e9b0: 6578 616d 706c 652c 2073 7570 706f 7365 example, suppose │ │ │ -0019e9c0: 2077 6520 6861 7665 2074 776f 2063 6c69 we have two cli │ │ │ -0019e9d0: 656e 7473 2064 6566 696e 6564 2069 6e20 ents defined in │ │ │ -0019e9e0: 6865 6164 6572 2066 696c 6573 203c 656d header files client1.h │ │ │ -0019ea00: 3c2f 636f 6465 3e3c 2f65 6d3e 2061 6e64 and │ │ │ -0019ea10: 203c 656d 3e3c 636f 6465 3e63 6c69 656e clien │ │ │ -0019ea20: 7432 2e68 3c2f 636f 6465 3e3c 2f65 6d3e t2.h │ │ │ -0019ea30: 2e20 5765 2066 6972 7374 2067 656e 6572 . We first gener │ │ │ -0019ea40: 6174 6520 7468 6520 3c65 6d3e 3c63 6f64 ate the envH.h< │ │ │ -0019ea60: 2f65 6d3e 2066 696c 6520 666f 7220 7468 /em> file for th │ │ │ -0019ea70: 6520 534f 4150 2048 6561 6465 7220 616e e SOAP Header an │ │ │ -0019ea80: 6420 4661 756c 7420 6465 6669 6e69 7469 d Fault definiti │ │ │ -0019ea90: 6f6e 733a 203c 2f70 3e3c 7072 6520 636c ons:

 
│ │ │ -0019eab0: 736f 6170 6370 7032 202d 6320 2d70 656e  soapcpp2 -c -pen
│ │ │ -0019eac0: 7620 656e 762e 680a 3c2f 7072 653e 3c70  v env.h.

Then we genera │ │ │ -0019eae0: 7465 2074 6865 2063 6f64 6520 666f 7220 te the code for │ │ │ -0019eaf0: 636c 6965 6e74 3120 616e 6420 636c 6965 client1 and clie │ │ │ -0019eb00: 6e74 323a 203c 2f70 3e3c 7072 6520 636c nt2:

 
│ │ │ -0019eb20: 736f 6170 6370 7032 202d 6320 2d6e 202d  soapcpp2 -c -n -
│ │ │ -0019eb30: 706d 7943 6c69 656e 7431 2063 6c69 656e  pmyClient1 clien
│ │ │ -0019eb40: 7431 2e68 0a20 736f 6170 6370 7032 202d  t1.h. soapcpp2 -
│ │ │ -0019eb50: 6320 2d6e 202d 706d 7943 6c69 656e 7432  c -n -pmyClient2
│ │ │ -0019eb60: 2063 6c69 656e 7432 2e68 0a3c 2f70 7265   client2.h.

This genera │ │ │ -0019eb80: 7465 7320 3c65 6d3e 3c63 6f64 653e 6d79 tes my │ │ │ -0019eb90: 436c 6965 6e74 3143 6c69 656e 744c 6962 Client1ClientLib │ │ │ -0019eba0: 2e63 3c2f 636f 6465 3e3c 2f65 6d3e 2061 .c a │ │ │ -0019ebb0: 6e64 203c 656d 3e3c 636f 6465 3e6d 7943 nd myC │ │ │ -0019ebc0: 6c69 656e 7432 436c 6965 6e74 4c69 622e lient2ClientLib. │ │ │ -0019ebd0: 633c 2f63 6f64 653e 3c2f 656d 3e20 2861 c (a │ │ │ -0019ebe0: 6d6f 6e67 2073 6576 6572 616c 206f 7468 mong several oth │ │ │ -0019ebf0: 6572 2066 696c 6573 292e 2054 6865 7365 er files). These │ │ │ -0019ec00: 2074 776f 2066 696c 6573 2073 686f 756c two files shoul │ │ │ -0019ec10: 6420 6265 2063 6f6d 7069 6c65 6420 616e d be compiled an │ │ │ -0019ec20: 6420 6c69 6e6b 6564 2077 6974 6820 796f d linked with yo │ │ │ -0019ec30: 7572 2061 7070 6c69 6361 7469 6f6e 2e20 ur application. │ │ │ -0019ec40: 5468 6520 736f 7572 6365 2063 6f64 6520 The source code │ │ │ -0019ec50: 6f66 2079 6f75 7220 6170 706c 6963 6174 of your applicat │ │ │ -0019ec60: 696f 6e20 7368 6f75 6c64 2069 6e63 6c75 ion should inclu │ │ │ -0019ec70: 6465 2074 6865 2067 656e 6572 6174 6564 de the generated │ │ │ -0019ec80: 203c 656d 3e3c 636f 6465 3e65 6e76 482e envH. │ │ │ -0019ec90: 683c 2f63 6f64 653e 3c2f 656d 3e2c 203c h, < │ │ │ -0019eca0: 656d 3e3c 636f 6465 3e6d 7943 6c69 656e em>myClien │ │ │ -0019ecb0: 7431 482e 683c 2f63 6f64 653e 3c2f 656d t1H.h, myC │ │ │ -0019ecd0: 6c69 656e 7432 2e68 3c2f 636f 6465 3e3c lient2.h< │ │ │ -0019ece0: 2f65 6d3e 2066 696c 6573 2061 6e64 203c /em> files and < │ │ │ -0019ecf0: 656d 3e3c 636f 6465 3e6d 7943 6c69 656e em>myClien │ │ │ -0019ed00: 7431 2e6e 736d 6170 3c2f 636f 6465 3e3c t1.nsmap< │ │ │ -0019ed10: 2f65 6d3e 2c20 3c65 6d3e 3c63 6f64 653e /em>, │ │ │ -0019ed20: 6d79 436c 6965 6e74 322e 6e73 6d61 703c myClient2.nsmap< │ │ │ -0019ed30: 2f63 6f64 653e 3c2f 656d 3e20 6669 6c65 /code> file │ │ │ -0019ed40: 733a 3c2f 703e 0a3c 6469 7620 636c 6173 s:

.
< │ │ │ -0019ed70: 7370 616e 2063 6c61 7373 3d22 7072 6570 span class="prep │ │ │ -0019ed80: 726f 6365 7373 6f72 223e 2369 6e63 6c75 rocessor">#inclu │ │ │ -0019ed90: 6465 2026 7175 6f74 3b6d 7943 6c69 656e de "myClien │ │ │ -0019eda0: 7431 482e 6826 7175 6f74 3b3c 2f73 7061 t1H.h" // incl │ │ │ -0019edd0: 7564 6520 636c 6965 6e74 2031 2073 7475 ude client 1 stu │ │ │ -0019ede0: 6273 203c 2f73 7061 6e3e 3c2f 6469 763e bs
│ │ │ -0019edf0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
#i │ │ │ -0019ee20: 6e63 6c75 6465 2026 7175 6f74 3b6d 7943 nclude "myC │ │ │ -0019ee30: 6c69 656e 7432 482e 6826 7175 6f74 3b3c lient2H.h"< │ │ │ -0019ee40: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> // │ │ │ -0019ee60: 696e 636c 7564 6520 636c 6965 6e74 2032 include client 2 │ │ │ -0019ee70: 2073 7475 6273 203c 2f73 7061 6e3e 3c2f stubs .
#include " │ │ │ -0019eec0: 3b65 6e76 482e 6826 7175 6f74 3b3c 2f73 ;envH.h"
.
.. │ │ │ -0019eef0: 2e20 3c73 7061 6e20 636c 6173 733d 2263 . //
.
#include &q │ │ │ -0019ef50: 756f 743b 6d79 436c 6965 6e74 3148 2e6e uot;myClient1H.n │ │ │ -0019ef60: 736d 6170 2671 756f 743b 3c2f 7370 616e smap" // inclu │ │ │ -0019ef90: 6465 2063 6c69 656e 7420 3120 6e73 6d61 de client 1 nsma │ │ │ -0019efa0: 7020 3c2f 7370 616e 3e3c 2f64 6976 3e0a p
. │ │ │ -0019efb0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
#in │ │ │ -0019efe0: 636c 7564 6520 2671 756f 743b 6d79 436c clude "myCl │ │ │ -0019eff0: 6965 6e74 3248 2e6e 736d 6170 2671 756f ient2H.nsmap&quo │ │ │ -0019f000: 743b 3c2f 7370 616e 3e20 3c73 7061 6e20 t; │ │ │ -0019f020: 2f2f 2069 6e63 6c75 6465 2063 6c69 656e // include clien │ │ │ -0019f030: 7420 3220 6e73 6d61 7020 3c2f 7370 616e t 2 nsmap
.
.
struct │ │ │ -0019f090: 203c 2f73 7061 6e3e 3c61 2063 6c61 7373 s │ │ │ -0019f0c0: 6f61 703c 2f61 3e20 2a3c 6120 636c 6173 oap * │ │ │ -0019f0f0: 736f 6170 3c2f 613e 203d 203c 6120 636c soap = │ │ │ -0019f150: 736f 6170 5f6e 6577 3c2f 613e 2829 3b3c soap_new();< │ │ │ -0019f160: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
s │ │ │ -0019f1d0: 6f61 705f 7365 745f 6e61 6d65 7370 6163 oap_set_namespac │ │ │ -0019f1e0: 6573 3c2f 613e 283c 6120 636c 6173 733d es(so │ │ │ -0019f210: 6170 3c2f 613e 2c20 6d79 436c 6965 6e74 ap, myClient │ │ │ -0019f220: 315f 6e61 6d65 7370 6163 6573 293b 203c 1_namespaces); < │ │ │ -0019f230: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
... // make Client │ │ │ -0019f270: 2031 2069 6e76 6f63 6174 696f 6e73 3c2f 1 invocations
.
.. │ │ │ -0019f2a0: 2e20 3c73 7061 6e20 636c 6173 733d 2263 . //
.
soap_set_namesp │ │ │ -0019f340: 6163 6573 3c2f 613e 283c 6120 636c 6173 aces( │ │ │ -0019f370: 736f 6170 3c2f 613e 2c20 6d79 436c 6965 soap, myClie │ │ │ -0019f380: 6e74 325f 6e61 6d65 7370 6163 6573 293b nt2_namespaces); │ │ │ -0019f390: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
... // make Clie │ │ │ -0019f3d0: 6e74 2032 2069 6e76 6f63 6174 696f 6e73 nt 2 invocations │ │ │ -0019f3e0: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c2f
.

It is im │ │ │ -0019f410: 706f 7274 616e 7420 746f 2075 7365 203c portant to use < │ │ │ -0019f420: 623e 3c63 6f64 653e 736f 6170 6370 7032 b>soapcpp2 │ │ │ -0019f430: 202d 6e3c 2f63 6f64 653e 3c2f 623e 206f -n o │ │ │ -0019f440: 7074 696f 6e20 3c62 3e3c 636f 6465 3e2d ption - │ │ │ -0019f450: 6e3c 2f63 6f64 653e 3c2f 623e 2c20 7365 n, se │ │ │ -0019f460: 6520 5365 6374 696f 6e20 3c61 2063 6c61 e Section soapcp │ │ │ -0019f4a0: 7032 206f 7074 696f 6e73 3c2f 613e 2c20 p2 options, │ │ │ -0019f4b0: 746f 2072 656e 616d 6520 7468 6520 6e61 to rename the na │ │ │ -0019f4c0: 6d65 7370 6163 6520 7461 626c 6573 2073 mespace tables s │ │ │ -0019f4d0: 6f20 7765 2063 616e 2069 6e63 6c75 6465 o we can include │ │ │ -0019f4e0: 2074 6865 6d20 616c 6c20 7769 7468 6f75 them all withou │ │ │ -0019f4f0: 7420 7275 6e6e 696e 6720 696e 746f 2072 t running into r │ │ │ -0019f500: 6564 6566 696e 6974 696f 6e73 2e3c 2f70 edefinitions.

.
N │ │ │ -0019f530: 6f74 653c 2f64 743e 3c64 643e 4c69 6e6b ote
Link │ │ │ -0019f540: 2063 6f6e 666c 6963 7473 206d 6179 2073 conflicts may s │ │ │ -0019f550: 7469 6c6c 206f 6363 7572 2069 6e20 7468 till occur in th │ │ │ -0019f560: 6520 756e 6c69 6b65 6c79 2073 6974 7561 e unlikely situa │ │ │ -0019f570: 7469 6f6e 2074 6861 7420 6964 656e 7469 tion that identi │ │ │ -0019f580: 6361 6c20 7365 7276 6963 6520 6f70 6572 cal service oper │ │ │ -0019f590: 6174 696f 6e20 6e61 6d65 7320 6172 6520 ation names are │ │ │ -0019f5a0: 6465 6669 6e65 6420 696e 2074 776f 206f defined in two o │ │ │ -0019f5b0: 7220 6d6f 7265 2073 7475 6220 6f72 2073 r more stub or s │ │ │ -0019f5c0: 6b65 6c65 746f 6e20 6675 6e63 7469 6f6e keleton function │ │ │ -0019f5d0: 7320 7768 656e 2074 6865 7365 206d 6574 s when these met │ │ │ -0019f5e0: 686f 6473 2073 6861 7265 2074 6865 2073 hods share the s │ │ │ -0019f5f0: 616d 6520 584d 4c20 6e61 6d65 7370 6163 ame XML namespac │ │ │ -0019f600: 6520 7072 6566 6978 2e3c 2f64 643e 3c2f e prefix.
.

.... Back to │ │ │ -0019f630: 7461 626c 6520 6f66 2063 6f6e 7465 6e74 table of content │ │ │ -0019f640: 733c 2f61 3e3c 2f70 3e0a 3c68 333e 3c61 s

.

< │ │ │ -0019f670: 2f61 3e0a 432b 2b20 6578 616d 706c 6573 /a>.C++ examples │ │ │ -0019f680: 3c2f 6833 3e0a 3c70 3e41 7320 616e 2065

.

As an e │ │ │ -0019f690: 7861 6d70 6c65 2077 6520 7769 6c6c 2062 xample we will b │ │ │ -0019f6a0: 7569 6c64 2061 2044 656c 6179 6564 2053 uild a Delayed S │ │ │ -0019f6b0: 746f 636b 2051 756f 7465 2063 6c69 656e tock Quote clien │ │ │ -0019f6c0: 7420 6c69 6272 6172 7920 616e 6420 6120 t library and a │ │ │ -0019f6d0: 4375 7272 656e 6379 2045 7863 6861 6e67 Currency Exchang │ │ │ -0019f6e0: 6520 5261 7465 2063 6c69 656e 7420 6c69 e Rate client li │ │ │ -0019f6f0: 6272 6172 792e 3c2f 703e 0a3c 703e 4669 brary.

.

Fi │ │ │ -0019f700: 7273 742c 2077 6520 6372 6561 7465 2061 rst, we create a │ │ │ -0019f710: 6e20 656d 7074 7920 6865 6164 6572 2066 n empty header f │ │ │ -0019f720: 696c 6520 3c65 6d3e 3c63 6f64 653e 656e ile en │ │ │ -0019f730: 762e 683c 2f63 6f64 653e 3c2f 656d 3e2c v.h, │ │ │ -0019f740: 2077 6869 6368 206d 6179 2062 6520 656d which may be em │ │ │ -0019f750: 7074 7920 6f72 2073 686f 756c 6420 636f pty or should co │ │ │ -0019f760: 6e74 6169 6e20 534f 4150 2048 6561 6465 ntain SOAP Heade │ │ │ -0019f770: 7220 616e 6420 4661 756c 7420 6465 6669 r and Fault defi │ │ │ -0019f780: 6e69 7469 6f6e 7320 6173 2065 7870 6c61 nitions as expla │ │ │ -0019f790: 696e 6564 2069 6e20 5365 6374 696f 6e20 ined in Section │ │ │ -0019f7a0: 3c61 2063 6c61 7373 3d22 656c 2220 6872 How to cr │ │ │ -0019f7d0: 6561 7465 2063 6c69 656e 742f 7365 7276 eate client/serv │ │ │ -0019f7e0: 6572 206c 6962 7261 7269 6573 3c2f 613e er libraries │ │ │ -0019f7f0: 2c20 616e 6420 636f 6d70 696c 6520 6974 , and compile it │ │ │ -0019f800: 2061 7320 666f 6c6c 6f77 733a 203c 2f70 as follows:

 soapcpp2
│ │ │ -0019f830: 202d 7065 6e76 2065 6e76 2e68 0a20 632b   -penv env.h. c+
│ │ │ -0019f840: 2b20 2d63 2065 6e76 432e 6370 700a 3c2f  + -c envC.cpp.

We also │ │ │ -0019f860: 636f 6d70 696c 6520 3c65 6d3e 3c63 6f64 compile gsoap/stdsoap2 │ │ │ -0019f880: 2e63 7070 3c2f 636f 6465 3e3c 2f65 6d3e .cpp │ │ │ -0019f890: 2077 6974 686f 7574 206e 616d 6573 7061 without namespa │ │ │ -0019f8a0: 6365 733a 203c 2f70 3e3c 7072 6520 636c ces:

 
│ │ │ -0019f8c0: 632b 2b20 2d63 202d 4457 4954 485f 4e4f  c++ -c -DWITH_NO
│ │ │ -0019f8d0: 4e41 4d45 5350 4143 4553 2073 7464 736f  NAMESPACES stdso
│ │ │ -0019f8e0: 6170 322e 6370 700a 3c2f 7072 653e 3c70  ap2.cpp.

If you do not │ │ │ -0019f900: 7573 6520 3c63 6f64 653e 2357 4954 485f use #WITH_ │ │ │ -0019f910: 4e4f 4e41 4d45 5350 4143 4553 3c2f 636f NONAMESPACES then you wil │ │ │ -0019f930: 6c20 6765 7420 616e 2075 6e72 6573 6f6c l get an unresol │ │ │ -0019f940: 7665 6420 6c69 6e6b 2065 7272 6f72 2066 ved link error f │ │ │ -0019f950: 6f72 2074 6865 2067 6c6f 6261 6c20 3c63 or the global namespaces table. You │ │ │ -0019f980: 2063 616e 2064 6566 696e 6520 6120 6475 can define a du │ │ │ -0019f990: 6d6d 7920 7461 626c 6520 746f 2061 766f mmy table to avo │ │ │ -0019f9a0: 6964 2068 6176 696e 6720 746f 2072 6563 id having to rec │ │ │ -0019f9b0: 6f6d 7069 6c65 203c 656d 3e3c 636f 6465 ompile gsoap/stdsoap2. │ │ │ -0019f9d0: 6370 703c 2f63 6f64 653e 3c2f 656d 3e2e cpp. │ │ │ -0019f9e0: 3c2f 703e 0a3c 703e 5365 636f 6e64 2c20

.

Second, │ │ │ -0019f9f0: 7765 2063 7265 6174 6520 7468 6520 4465 we create the De │ │ │ -0019fa00: 6c61 7965 6420 5374 6f63 6b20 5175 6f74 layed Stock Quot │ │ │ -0019fa10: 6520 6865 6164 6572 2066 696c 6520 7370 e header file sp │ │ │ -0019fa20: 6563 6966 6963 6174 696f 6e2c 2077 6869 ecification, whi │ │ │ -0019fa30: 6368 206d 6179 2062 6520 6f62 7461 696e ch may be obtain │ │ │ -0019fa40: 6564 2075 7369 6e67 2074 6865 2057 5344 ed using the WSD │ │ │ -0019fa50: 4c20 696d 706f 7274 6572 2e20 4966 2079 L importer. If y │ │ │ -0019fa60: 6f75 2077 616e 7420 746f 2075 7365 2043 ou want to use C │ │ │ -0019fa70: 2b2b 206e 616d 6573 7061 6365 7320 7468 ++ namespaces th │ │ │ -0019fa80: 656e 2079 6f75 206e 6565 6420 746f 206d en you need to m │ │ │ -0019fa90: 616e 7561 6c6c 7920 6164 6420 7468 6520 anually add the │ │ │ -0019faa0: 3c63 6f64 653e 6e61 6d65 7370 6163 653c namespace< │ │ │ -0019fab0: 2f63 6f64 653e 2064 6563 6c61 7261 7469 /code> declarati │ │ │ -0019fac0: 6f6e 2074 6f20 7468 6520 6765 6e65 7261 on to the genera │ │ │ -0019fad0: 7465 6420 6865 6164 6572 2066 696c 653a ted header file: │ │ │ -0019fae0: 3c2f 703e 0a3c 6469 7620 636c 6173 733d

.
namespace quote {
.
.
//gsoap ns s │ │ │ -0019fb90: 6572 7669 6365 206e 616d 653a 2053 6572 ervice name: Ser │ │ │ -0019fba0: 7669 6365 203c 2f73 7061 6e3e 3c2f 6469 vice .
//gso │ │ │ -0019fbe0: 6170 206e 7320 7365 7276 6963 6520 7374 ap ns service st │ │ │ -0019fbf0: 796c 653a 2072 7063 203c 2f73 7061 6e3e yle: rpc │ │ │ -0019fc00: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
/ │ │ │ -0019fc30: 2f67 736f 6170 206e 7320 7365 7276 6963 /gsoap ns servic │ │ │ -0019fc40: 6520 656e 636f 6469 6e67 3a20 656e 636f e encoding: enco │ │ │ -0019fc50: 6465 6420 3c2f 7370 616e 3e3c 2f64 6976 ded
.
//gsoa │ │ │ -0019fc90: 7020 6e73 2073 6572 7669 6365 206c 6f63 p ns service loc │ │ │ -0019fca0: 6174 696f 6e3a 2068 7474 703a 2f2f 7365 ation: http://se │ │ │ -0019fcb0: 7276 6963 6573 2e78 6d65 7468 6f64 732e rvices.xmethods. │ │ │ -0019fcc0: 6e65 742f 736f 6170 203c 2f73 7061 6e3e net/soap │ │ │ -0019fcd0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
/ │ │ │ -0019fd00: 2f67 736f 6170 206e 7320 7363 6865 6d61 /gsoap ns schema │ │ │ -0019fd10: 206e 616d 6573 7061 6365 3a20 7572 6e3a namespace: urn: │ │ │ -0019fd20: 786d 6574 686f 6473 2d64 656c 6179 6564 xmethods-delayed │ │ │ -0019fd30: 2d71 756f 7465 7320 3c2f 7370 616e 3e3c -quotes < │ │ │ -0019fd40: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
// │ │ │ -0019fd70: 6773 6f61 7020 6e73 2073 6572 7669 6365 gsoap ns service │ │ │ -0019fd80: 206d 6574 686f 642d 6163 7469 6f6e 3a20 method-action: │ │ │ -0019fd90: 6765 7451 756f 7465 2026 7175 6f74 3b26 getQuote "& │ │ │ -0019fda0: 7175 6f74 3b20 3c2f 7370 616e 3e3c 2f64 quot; .
│ │ │ -0019fde0: 696e 743c 2f73 7061 6e3e 206e 735f 5f67 int ns__g │ │ │ -0019fdf0: 6574 5175 6f74 6528 3c73 7061 6e20 636c etQuote(char *s │ │ │ -0019fe20: 796d 626f 6c2c 203c 7370 616e 2063 6c61 ymbol, float &a │ │ │ -0019fe50: 6d70 3b52 6573 756c 7429 3b20 3c2f 6469 mp;Result); .
.} │ │ │ -0019fe90: 203c 7370 616e 2063 6c61 7373 3d22 636f // namesp │ │ │ -0019feb0: 6163 6520 7175 6f74 653c 2f73 7061 6e3e ace quote │ │ │ -0019fec0: 3c2f 6469 763e 0a3c 2f64 6976 3e3c 212d
.

We then compile │ │ │ -0019fef0: 2069 7420 6173 2061 206c 6962 7261 7279 it as a library │ │ │ -0019ff00: 2061 6e64 2077 6520 7573 6520 6f70 7469 and we use opti │ │ │ -0019ff10: 6f6e 203c 623e 3c63 6f64 653e 2d6e 3c2f on -n to pre │ │ │ -0019ff30: 6669 7820 7468 6520 6765 6e65 7261 7465 fix the generate │ │ │ -0019ff40: 6420 6669 6c65 7320 616e 6420 746f 2072 d files and to r │ │ │ -0019ff50: 656e 616d 6520 7468 6520 6e61 6d65 7370 ename the namesp │ │ │ -0019ff60: 6163 6520 7461 626c 6520 746f 2061 766f ace table to avo │ │ │ -0019ff70: 6964 206c 696e 6b20 636f 6e66 6c69 6374 id link conflict │ │ │ -0019ff80: 7320 6c61 7465 723a 203c 2f70 3e3c 7072 s later:

soapcpp2 -n │ │ │ -0019ffb0: 7175 6f74 652e 680a 2063 2b2b 202d 6320 quote.h. c++ -c │ │ │ -0019ffc0: 7175 6f74 6543 6c69 656e 744c 6962 2e63 quoteClientLib.c │ │ │ -0019ffd0: 7070 0a3c 2f70 7265 3e3c 703e 2049 6620 pp.

If │ │ │ -0019ffe0: 796f 7520 646f 6e27 7420 7761 6e74 2074 you don't want t │ │ │ -0019fff0: 6f20 7573 6520 6120 432b 2b20 636f 6465 o use a C++ code │ │ │ -001a0000: 206e 616d 6573 7061 6365 2c20 796f 7520 namespace, you │ │ │ -001a0010: 7368 6f75 6c64 2063 6f6d 7069 6c65 203c should compile < │ │ │ -001a0020: 656d 3e3c 636f 6465 3e71 756f 7465 2e68 em>quote.h │ │ │ -001a0030: 3c2f 636f 6465 3e3c 2f65 6d3e 2022 6173 "as │ │ │ -001a0040: 2069 7322 2077 6974 6820 6f70 7469 6f6e is" with option │ │ │ -001a0050: 203c 623e 3c63 6f64 653e 2d70 7175 6f74 -pquot │ │ │ -001a0060: 653c 2f63 6f64 653e 3c2f 623e 3a20 3c2f e:

 soapcpp
│ │ │ -001a0090: 3220 2d6e 202d 7071 756f 7465 2071 756f  2 -n -pquote quo
│ │ │ -001a00a0: 7465 2e68 0a20 632b 2b20 2d63 2071 756f  te.h. c++ -c quo
│ │ │ -001a00b0: 7465 436c 6965 6e74 4c69 622e 6370 700a  teClientLib.cpp.
│ │ │ -001a00c0: 3c2f 7072 653e 3c70 3e20 5468 6972 642c  

Third, │ │ │ -001a00d0: 2077 6520 6372 6561 7465 2074 6865 2043 we create the C │ │ │ -001a00e0: 7572 7265 6e63 7920 4578 6368 616e 6765 urrency Exchange │ │ │ -001a00f0: 2052 6174 6520 6865 6164 6572 2066 696c Rate header fil │ │ │ -001a0100: 6520 7370 6563 6966 6963 6174 696f 6e3a e specification: │ │ │ -001a0110: 3c2f 703e 0a3c 6469 7620 636c 6173 733d

.
namespace rate {
│ │ │ -001a0170: 0a3c 6469 7620 636c 6173 733d 226c 696e .
.
//gsoap ns se │ │ │ -001a01c0: 7276 6963 6520 6e61 6d65 3a20 5365 7276 rvice name: Serv │ │ │ -001a01d0: 6963 6520 3c2f 7370 616e 3e3c 2f64 6976 ice
.
//gsoa │ │ │ -001a0210: 7020 6e73 2073 6572 7669 6365 2073 7479 p ns service sty │ │ │ -001a0220: 6c65 3a20 7270 6320 3c2f 7370 616e 3e3c le: rpc < │ │ │ -001a0230: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
// │ │ │ -001a0260: 6773 6f61 7020 6e73 2073 6572 7669 6365 gsoap ns service │ │ │ -001a0270: 2065 6e63 6f64 696e 673a 2065 6e63 6f64 encoding: encod │ │ │ -001a0280: 6564 203c 2f73 7061 6e3e 3c2f 6469 763e ed
│ │ │ -001a0290: 0a3c 6469 7620 636c 6173 733d 226c 696e .
//gsoap │ │ │ -001a02c0: 206e 7320 7365 7276 6963 6520 6c6f 6361 ns service loca │ │ │ -001a02d0: 7469 6f6e 3a20 6874 7470 3a2f 2f73 6572 tion: http://ser │ │ │ -001a02e0: 7669 6365 732e 786d 6574 686f 6473 2e6e vices.xmethods.n │ │ │ -001a02f0: 6574 2f73 6f61 7020 3c2f 7370 616e 3e3c et/soap < │ │ │ -001a0300: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
// │ │ │ -001a0330: 6773 6f61 7020 6e73 2073 6368 656d 6120 gsoap ns schema │ │ │ -001a0340: 6e61 6d65 7370 6163 653a 2075 726e 3a78 namespace: urn:x │ │ │ -001a0350: 6d65 7468 6f64 732d 4375 7272 656e 6379 methods-Currency │ │ │ -001a0360: 4578 6368 616e 6765 203c 2f73 7061 6e3e Exchange │ │ │ -001a0370: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
/ │ │ │ -001a03a0: 2f67 736f 6170 206e 7320 7365 7276 6963 /gsoap ns servic │ │ │ -001a03b0: 6520 6d65 7468 6f64 2d61 6374 696f 6e3a e method-action: │ │ │ -001a03c0: 2067 6574 5261 7465 2026 7175 6f74 3b26 getRate "& │ │ │ -001a03d0: 7175 6f74 3b20 3c2f 7370 616e 3e3c 2f64 quot; .
│ │ │ -001a0410: 696e 743c 2f73 7061 6e3e 206e 735f 5f67 int ns__g │ │ │ -001a0420: 6574 5261 7465 283c 7370 616e 2063 6c61 etRate(char *co │ │ │ -001a0450: 756e 7472 7931 2c20 3c73 7061 6e20 636c untry1, char *c │ │ │ -001a0480: 6f75 6e74 7279 322c 203c 7370 616e 2063 ountry2, float │ │ │ -001a04b0: 2661 6d70 3b52 6573 756c 7429 3b20 3c2f &Result); .
.< │ │ │ -001a04e0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -001a04f0: 3e7d 203c 7370 616e 2063 6c61 7373 3d22 >} // name │ │ │ -001a0510: 7370 6163 6520 7261 7465 3c2f 7370 616e space rate
.
< │ │ │ -001a0540: 703e 5369 6d69 6c61 7220 746f 2074 6865 p>Similar to the │ │ │ -001a0550: 2051 756f 7465 2065 7861 6d70 6c65 2061 Quote example a │ │ │ -001a0560: 626f 7665 2c20 7765 2067 656e 6572 6174 bove, we generat │ │ │ -001a0570: 6520 736f 7572 6365 2063 6f64 6520 7573 e source code us │ │ │ -001a0580: 696e 6720 6f70 7469 6f6e 203c 623e 3c63 ing option -n
to prefix the │ │ │ -001a05b0: 6765 6e65 7261 7465 6420 6669 6c65 7320 generated files │ │ │ -001a05c0: 616e 6420 746f 2072 656e 616d 6520 7468 and to rename th │ │ │ -001a05d0: 6520 6e61 6d65 7370 6163 6520 7461 626c e namespace tabl │ │ │ -001a05e0: 6520 746f 2061 766f 6964 206c 696e 6b20 e to avoid link │ │ │ -001a05f0: 636f 6e66 6c69 6374 733a 203c 2f70 3e3c conflicts:

< │ │ │ -001a0600: 7072 6520 636c 6173 733d 2266 7261 676d pre class="fragm │ │ │ -001a0610: 656e 7422 3e20 736f 6170 6370 7032 202d ent"> soapcpp2 - │ │ │ -001a0620: 6e20 7261 7465 2e68 0a3c 2f70 7265 3e3c n rate.h.< │ │ │ -001a0630: 703e 2046 6f75 7274 682c 2077 6520 7573 p> Fourth, we us │ │ │ -001a0640: 6520 7468 6520 6765 6e65 7261 7465 6420 e the generated │ │ │ -001a0650: 736f 7572 6365 2063 6f64 6520 6c69 6272 source code libr │ │ │ -001a0660: 6172 6965 7320 7769 7468 2074 6865 206d aries with the m │ │ │ -001a0670: 6169 6e20 7072 6f67 7261 6d2e 3c2f 703e ain program.

│ │ │ -001a0680: 0a3c 6469 7620 636c 6173 733d 2266 7261 .
#include &qu │ │ │ -001a06d0: 6f74 3b71 756f 7465 482e 682e 6826 7175 ot;quoteH.h.h&qu │ │ │ -001a06e0: 6f74 3b3c 2f73 7061 6e3e 3c2f 6469 763e ot;
│ │ │ -001a06f0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
#i │ │ │ -001a0720: 6e63 6c75 6465 2026 7175 6f74 3b72 6174 nclude "rat │ │ │ -001a0730: 6548 2e68 2e68 2671 756f 743b 3c2f 7370 eH.h.h"
.
#include │ │ │ -001a0780: 2671 756f 743b 7175 6f74 652e 6e73 6d61 "quote.nsma │ │ │ -001a0790: 7026 7175 6f74 3b3c 2f73 7061 6e3e 3c2f p".
#include " │ │ │ -001a07e0: 3b72 6174 652e 6e73 6d61 7026 7175 6f74 ;rate.nsmap" │ │ │ -001a07f0: 3b3c 2f73 7061 6e3e 3c2f 6469 763e 0a3c ;
.< │ │ │ -001a0800: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -001a0810: 3e20 3c2f 6469 763e 0a3c 6469 7620 636c >
.
int │ │ │ -001a0850: 6d61 696e 283c 7370 616e 2063 6c61 7373 main(i │ │ │ -001a0870: 6e74 3c2f 7370 616e 3e20 6172 6763 2c20 nt argc, │ │ │ -001a0880: 3c73 7061 6e20 636c 6173 733d 226b 6579 char *argv[]) < │ │ │ -001a08b0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
{
. │ │ │ -001a08d0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
if │ │ │ -001a0900: 3c2f 7370 616e 3e20 2861 7267 6320 266c (argc &l │ │ │ -001a0910: 743b 3d20 3129 203c 2f64 6976 3e0a 3c64 t;= 1)
. │ │ │ -001a0930: 2020 7b3c 2f64 6976 3e0a 3c64 6976 2063 {
.
│ │ │ -001a0950: 7374 643a 3a63 6572 7220 266c 743b 266c std::cerr <&l │ │ │ -001a0960: 743b 203c 7370 616e 2063 6c61 7373 3d22 t; & │ │ │ -001a0980: 7175 6f74 3b55 7361 6765 3a20 6d61 696e quot;Usage: main │ │ │ -001a0990: 2074 6963 6b65 7220 5b63 7572 7265 6e63 ticker [currenc │ │ │ -001a09a0: 795d 2671 756f 743b 3c2f 7370 616e 3e20 y]" │ │ │ -001a09b0: 266c 743b 266c 743b 2073 7464 3a3a 656e << std::en │ │ │ -001a09c0: 646c 203c 2f64 6976 3e0a 3c64 6976 2063 dl
.
│ │ │ -001a09e0: 6578 6974 2845 5849 545f 4641 494c 5552 exit(EXIT_FAILUR │ │ │ -001a09f0: 4529 3b20 3c2f 6469 763e 0a3c 6469 7620 E);
.
} │ │ │ -001a0a10: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
struct │ │ │ -001a0a50: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap │ │ │ -001a0a80: 2a3c 6120 636c 6173 733d 2263 6f64 6522 *soap │ │ │ -001a0ab0: 203d 203c 6120 636c 6173 733d 2263 6f64 = soap_new │ │ │ -001a0b10: 3c2f 613e 2829 3b3c 2f64 6976 3e0a 3c64 ();
. │ │ │ -001a0b30: 2020 3c73 7061 6e20 636c 6173 733d 226b floa │ │ │ -001a0b50: 743c 2f73 7061 6e3e 2071 3b20 3c2f 6469 t q; . │ │ │ -001a0c30: 0a3c 6469 7620 636c 6173 733d 226c 696e .
i │ │ │ -001a0c60: 663c 2f73 7061 6e3e 2028 736f 6170 5f63 f (soap_c │ │ │ -001a0c70: 616c 6c5f 6e73 5f5f 6765 7451 756f 7465 all_ns__getQuote │ │ │ -001a0c80: 283c 6120 636c 6173 733d 2263 6f64 6522 (soap │ │ │ -001a0cb0: 2c20 4e55 4c4c 2c20 4e55 4c4c 2c20 6172 , NULL, NULL, ar │ │ │ -001a0cc0: 6776 5b31 5d2c 2071 2929 203c 7370 616e gv[1], q)) // get quote
.
│ │ │ -001a0d10: 7b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 {
..
}.
else .
{
. │ │ │ -001a0e50: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
│ │ │ -001a0e80: 6966 3c2f 7370 616e 3e20 2861 7267 6320 if (argc │ │ │ -001a0e90: 2667 743b 2032 2920 3c2f 6469 763e 0a3c > 2)
.< │ │ │ -001a0ea0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -001a0eb0: 3e20 2020 207b 3c2f 6469 763e 0a3c 6469 > {
. │ │ │ -001a0ed0: 2020 2020 203c 7370 616e 2063 6c61 7373 f │ │ │ -001a0ef0: 6c6f 6174 3c2f 7370 616e 3e20 723b 203c loat r; < │ │ │ -001a0f00: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
soap_set_na │ │ │ -001a0f80: 6d65 7370 6163 6573 3c2f 613e 283c 6120 mespaces(soap, ra │ │ │ -001a0fc0: 7465 5f6e 616d 6573 7061 6365 7329 3b20 te_namespaces); │ │ │ -001a0fd0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
< │ │ │ -001a0ff0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -001a1000: 6f72 6466 6c6f 7722 3e69 663c 2f73 7061 ordflow">if (soap_call_ns │ │ │ -001a1020: 5f5f 6765 7452 6174 6528 3c61 2063 6c61 __getRate(soap, NULL, │ │ │ -001a1060: 204e 554c 4c2c 203c 7370 616e 2063 6c61 NULL, "us" │ │ │ -001a1090: 3b3c 2f73 7061 6e3e 2c20 6172 6776 5b32 ;, argv[2 │ │ │ -001a10a0: 5d2c 2072 2929 203c 7370 616e 2063 6c61 ], r)) // │ │ │ -001a10c0: 6765 7420 7261 7465 2069 6e20 5553 2064 get rate in US d │ │ │ -001a10d0: 6f6c 6c61 7273 203c 2f73 7061 6e3e 3c2f ollars .
< │ │ │ -001a1100: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -001a1110: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ -001a1120: 705f 5f66 6175 6c74 2e68 746d 6c23 6761 p__fault.html#ga │ │ │ -001a1130: 3933 3161 3461 6236 6466 3235 3533 6234 931a4ab6df2553b4 │ │ │ -001a1140: 3861 3063 3237 3066 3861 3061 3838 6166 8a0c270f8a0a88af │ │ │ -001a1150: 223e 736f 6170 5f70 7269 6e74 5f66 6175 ">soap_print_fau │ │ │ -001a1160: 6c74 3c2f 613e 283c 6120 636c 6173 733d lt(so │ │ │ -001a1190: 6170 3c2f 613e 2c20 7374 6465 7272 293b ap, stderr); │ │ │ -001a11a0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
│ │ │ -001a11c0: 3c73 7061 6e20 636c 6173 733d 226b 6579 else
. │ │ │ -001a1200: 2020 2020 2020 2071 202a 3d20 723b 203c q *= r; < │ │ │ -001a1210: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ -001a1220: 656e 7422 3e2f 2f20 636f 6e76 6572 7420 ent">// convert │ │ │ -001a1230: 7468 6520 7175 6f74 6520 3c2f 7370 616e the quote
.
} │ │ │ -001a1260: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
std │ │ │ -001a1280: 3a3a 636f 7574 2026 6c74 3b26 6c74 3b20 ::cout << │ │ │ -001a1290: 6172 6776 5b31 5d20 266c 743b 266c 743b argv[1] << │ │ │ -001a12a0: 203c 7370 616e 2063 6c61 7373 3d22 7374 &qu │ │ │ -001a12c0: 6f74 3b3a 2026 7175 6f74 3b3c 2f73 7061 ot;: " << q &l │ │ │ -001a12e0: 743b 266c 743b 2073 7464 3a3a 656e 646c t;< std::endl │ │ │ -001a12f0: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
} < │ │ │ -001a1310: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
s │ │ │ -001a1380: 6f61 705f 6465 7374 726f 793c 2f61 3e28 oap_destroy( │ │ │ -001a1390: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap) │ │ │ -001a13c0: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
.
soap_end(soap);< │ │ │ -001a1470: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
s │ │ │ -001a14e0: 6f61 705f 6672 6565 3c2f 613e 283c 6120 oap_free(soap);.
return │ │ │ -001a1560: 2030 3b20 3c2f 6469 763e 0a3c 6469 7620 0;
.
}.

C │ │ │ -001a15a0: 6f6d 7069 6c65 2061 6e64 206c 696e 6b20 ompile and link │ │ │ -001a15b0: 7468 6973 2061 7070 6c69 6361 7469 6f6e this application │ │ │ -001a15c0: 2077 6974 6820 3c65 6d3e 3c63 6f64 653e with │ │ │ -001a15d0: 7374 6473 6f61 7032 2e6f 3c2f 636f 6465 stdsoap2.o, envC.o< │ │ │ -001a1600: 2f65 6d3e 2c20 3c65 6d3e 3c63 6f64 653e /em>, │ │ │ -001a1610: 7175 6f74 6553 6572 7665 7250 726f 7879 quoteServerProxy │ │ │ -001a1620: 2e6f 3c2f 636f 6465 3e3c 2f65 6d3e 2c20 .o, │ │ │ -001a1630: 616e 6420 3c65 6d3e 3c63 6f64 653e 7261 and ra │ │ │ -001a1640: 7465 5365 7276 6572 5072 6f78 792e 6f3c teServerProxy.o< │ │ │ -001a1650: 2f63 6f64 653e 3c2f 656d 3e2e 3c2f 703e /code>.

│ │ │ -001a1660: 0a3c 703e 496e 7374 6561 6420 6f66 2074 .

Instead of t │ │ │ -001a1670: 6865 2067 656e 6572 6174 6564 203c 636f he generated soap_call_web │ │ │ -001a1690: 6d65 7468 6f64 3c2f 636f 6465 3e20 7374 method st │ │ │ -001a16a0: 7562 2066 756e 6374 696f 6e73 2079 6f75 ub functions you │ │ │ -001a16b0: 2063 616e 2061 6c73 6f20 7573 6520 3c62 can also use soapcpp2 │ │ │ -001a16d0: 2d6a 3c2f 636f 6465 3e3c 2f62 3e20 6f70 -j op │ │ │ -001a16e0: 7469 6f6e 203c 623e 3c63 6f64 653e 2d6a tion -j │ │ │ -001a16f0: 3c2f 636f 6465 3e3c 2f62 3e20 6f72 206f or o │ │ │ -001a1700: 7074 696f 6e20 3c62 3e3c 636f 6465 3e2d ption - │ │ │ -001a1710: 693c 2f63 6f64 653e 3c2f 623e 2074 6f20 i to │ │ │ -001a1720: 6765 6e65 7261 7465 2043 2b2b 2070 726f generate C++ pro │ │ │ -001a1730: 7879 2063 6c61 7373 6573 2e3c 2f70 3e0a xy classes.

. │ │ │ -001a1740: 3c70 3e54 6f20 636f 6d70 696c 6520 7365

To compile se │ │ │ -001a1750: 7276 6572 2069 7320 7665 7279 2073 696d rver is very sim │ │ │ -001a1760: 696c 6172 2e20 466f 7220 6578 616d 706c ilar. For exampl │ │ │ -001a1770: 652c 2061 7373 756d 6520 7468 6174 2077 e, assume that w │ │ │ -001a1780: 6520 6e65 6564 2074 6f20 696d 706c 656d e need to implem │ │ │ -001a1790: 656e 7420 6120 6361 6c63 756c 6174 6f72 ent a calculator │ │ │ -001a17a0: 2073 6572 7669 6365 2061 6e64 2077 6520 service and we │ │ │ -001a17b0: 7761 6e74 2074 6f20 6372 6561 7465 2061 want to create a │ │ │ -001a17c0: 206c 6962 7261 7279 2066 6f72 2069 742e library for it. │ │ │ -001a17d0: 3c2f 703e 0a3c 6469 7620 636c 6173 733d

.
namespace calc {
│ │ │ -001a1830: 0a3c 6469 7620 636c 6173 733d 226c 696e .
.
//gsoap ns se │ │ │ -001a1880: 7276 6963 6520 6e61 6d65 3a20 4361 6c63 rvice name: Calc │ │ │ -001a1890: 203c 2f73 7061 6e3e 3c2f 6469 763e 0a3c
.< │ │ │ -001a18a0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -001a18b0: 3e3c 7370 616e 2063 6c61 7373 3d22 636f >//gsoap n │ │ │ -001a18d0: 7320 7365 7276 6963 6520 7374 796c 653a s service style: │ │ │ -001a18e0: 2072 7063 203c 2f73 7061 6e3e 3c2f 6469 rpc .
//gso │ │ │ -001a1920: 6170 206e 7320 7365 7276 6963 6520 656e ap ns service en │ │ │ -001a1930: 636f 6469 6e67 3a20 656e 636f 6465 6420 coding: encoded │ │ │ -001a1940: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ -001a1960: 3c73 7061 6e20 636c 6173 733d 2263 6f6d //gsoap ns │ │ │ -001a1980: 2073 6572 7669 6365 206c 6f63 6174 696f service locatio │ │ │ -001a1990: 6e3a 2068 7474 703a 2f2f 7777 772e 6373 n: http://www.cs │ │ │ -001a19a0: 2e66 7375 2e65 6475 2f7e 656e 6765 6c65 .fsu.edu/~engele │ │ │ -001a19b0: 6e2f 6361 6c63 2e63 6769 203c 2f73 7061 n/calc.cgi
.
//gsoap ns sche │ │ │ -001a1a00: 6d61 206e 616d 6573 7061 6365 3a20 7572 ma namespace: ur │ │ │ -001a1a10: 6e3a 6361 6c63 203c 2f73 7061 6e3e 3c2f n:calc .
int ns__ │ │ │ -001a1a60: 6164 6428 3c73 7061 6e20 636c 6173 733d add(do │ │ │ -001a1a80: 7562 6c65 3c2f 7370 616e 3e20 612c 203c uble a, < │ │ │ -001a1a90: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -001a1aa0: 6f72 6474 7970 6522 3e64 6f75 626c 653c ordtype">double< │ │ │ -001a1ab0: 2f73 7061 6e3e 2062 2c20 3c73 7061 6e20 /span> b, double &result); │ │ │ -001a1af0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
int ns │ │ │ -001a1b30: 5f5f 7375 6228 3c73 7061 6e20 636c 6173 __sub( │ │ │ -001a1b50: 646f 7562 6c65 3c2f 7370 616e 3e20 612c double a, │ │ │ -001a1b60: 203c 7370 616e 2063 6c61 7373 3d22 6b65 doubl │ │ │ -001a1b80: 653c 2f73 7061 6e3e 2062 2c20 3c73 7061 e b, double &result) │ │ │ -001a1bc0: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
int │ │ │ -001a1c00: 6e73 5f5f 6d75 6c28 3c73 7061 6e20 636c ns__mul(double │ │ │ -001a1c30: 612c 203c 7370 616e 2063 6c61 7373 3d22 a, dou │ │ │ -001a1c50: 626c 653c 2f73 7061 6e3e 2062 2c20 3c73 ble b, double &resul │ │ │ -001a1c90: 7429 3b20 3c2f 6469 763e 0a3c 6469 7620 t);
.
int ns__div(double a, d │ │ │ -001a1d20: 6f75 626c 653c 2f73 7061 6e3e 2062 2c20 ouble b, │ │ │ -001a1d30: 3c73 7061 6e20 636c 6173 733d 226b 6579 double │ │ │ -001a1d50: 3c2f 7370 616e 3e20 2661 6d70 3b72 6573 &res │ │ │ -001a1d60: 756c 7429 3b20 3c2f 6469 763e 0a3c 6469 ult);
. │ │ │ -001a1d80: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
} // namespace ca │ │ │ -001a1dc0: 6c63 3c2f 7370 616e 3e3c 2f64 6976 3e0a lc
. │ │ │ -001a1dd0: 3c2f 6469 763e 3c21 2d2d 2066 7261 676d

We gen │ │ │ -001a1df0: 6572 6174 6520 636f 6465 3a20 3c2f 703e erate code:

│ │ │ -001a1e00: 3c70 7265 2063 6c61 7373 3d22 6672 6167
 soapcpp2 
│ │ │ -001a1e20: 2d6a 202d 6e20 6361 6c63 2e68 0a3c 2f70  -j -n calc.h.

Here we u │ │ │ -001a1e40: 7365 6420 6f70 7469 6f6e 203c 623e 3c63 sed option -j to generate a │ │ │ -001a1e70: 432b 2b20 7365 7276 6963 6520 636c 6173 C++ service clas │ │ │ -001a1e80: 7320 3c65 6d3e 3c63 6f64 653e 6361 6c63 s calc │ │ │ -001a1e90: 4361 6c63 5365 7276 6963 652e 683c 2f63 CalcService.h and calcCalc │ │ │ -001a1ec0: 5365 7276 6963 652e 6370 703c 2f63 6f64 Service.cpp. The eff │ │ │ -001a1ee0: 6563 7420 6f66 2074 6865 203c 623e 3c63 ect of the -n option is that │ │ │ -001a1f10: 2069 7420 6372 6561 7465 7320 6c6f 6361 it creates loca │ │ │ -001a1f20: 6c20 6e61 6d65 7370 6163 6520 7461 626c l namespace tabl │ │ │ -001a1f30: 6573 2061 6e64 2075 7365 7320 3c65 6d3e es and uses │ │ │ -001a1f40: 3c63 6f64 653e 6361 6c63 3c2f 636f 6465 calc to prefix │ │ │ -001a1f60: 2074 6865 2067 656e 6572 6174 6564 2066 the generated f │ │ │ -001a1f70: 696c 6573 2e3c 2f70 3e0a 3c64 6976 2063 iles.

.
│ │ │ -001a1f90: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
#in │ │ │ -001a1fc0: 636c 7564 6520 2671 756f 743b 6361 6c63 clude "calc │ │ │ -001a1fd0: 4361 6c63 5365 7276 6963 652e 6826 7175 CalcService.h&qu │ │ │ -001a1fe0: 6f74 3b3c 2f73 7061 6e3e 3c2f 6469 763e ot;
│ │ │ -001a1ff0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
#i │ │ │ -001a2020: 6e63 6c75 6465 2026 7175 6f74 3b63 616c nclude "cal │ │ │ -001a2030: 632e 6e73 6d61 7026 7175 6f74 3b3c 2f73 c.nsmap"
.
.
int main │ │ │ -001a20a0: 2829 3c2f 6469 763e 0a3c 6469 7620 636c ()
.
{.
calc::Cal │ │ │ -001a20e0: 6320 6361 6c63 3b20 3c2f 6469 763e 0a3c c calc;
.< │ │ │ -001a20f0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -001a2100: 3e20 202e 2e2e 203c 7370 616e 2063 6c61 > ... //< │ │ │ -001a2120: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
. │ │ │ -001a2140: 2063 616c 632e 7365 7276 6528 293b 203c calc.serve(); < │ │ │ -001a2150: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ -001a2160: 656e 7422 3e2f 2f20 6361 6c6c 7320 7265 ent">// calls re │ │ │ -001a2170: 7175 6573 7420 6469 7370 6174 6368 6572 quest dispatcher │ │ │ -001a2180: 2074 6f20 696e 766f 6b65 206f 6e65 206f to invoke one o │ │ │ -001a2190: 6620 7468 6520 6675 6e63 7469 6f6e 7320 f the functions │ │ │ -001a21a0: 6265 6c6f 7720 3c2f 7370 616e 3e3c 2f64 below .
... //
.
}
.
< │ │ │ -001a2220: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
int cal │ │ │ -001a2260: 633a 3a43 616c 633a 3a61 6464 283c 7370 c::Calc::add(double a, double │ │ │ -001a22c0: 622c 203c 7370 616e 2063 6c61 7373 3d22 b, dou │ │ │ -001a22e0: 626c 653c 2f73 7061 6e3e 2026 616d 703b ble & │ │ │ -001a22f0: 7265 7375 6c74 293c 2f64 6976 3e0a 3c64 result)
. │ │ │ -001a2310: 7b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 {
.
resu │ │ │ -001a2330: 6c74 203d 2061 202b 2062 3b3c 2f64 6976 lt = a + b;
.
│ │ │ -001a2370: 7265 7475 726e 3c2f 7370 616e 3e20 3c61 return SOAP_OK;.
}
. │ │ │ -001a2400: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
.
int │ │ │ -001a2450: 2063 616c 633a 3a43 616c 633a 3a73 7562 calc::Calc::sub │ │ │ -001a2460: 283c 7370 616e 2063 6c61 7373 3d22 6b65 (doubl │ │ │ -001a2480: 653c 2f73 7061 6e3e 2061 2c20 3c73 7061 e a, double b, double & │ │ │ -001a24e0: 616d 703b 7265 7375 6c74 293c 2f64 6976 amp;result)
.
{
.
│ │ │ -001a2520: 7265 7375 6c74 203d 2061 202d 2062 3b3c result = a - b;< │ │ │ -001a2530: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
return SOAP_OK;
.
} .
. │ │ │ -001a2620: 3c73 7061 6e20 636c 6173 733d 226b 6579 int
calc::Calc: │ │ │ -001a2650: 3a6d 756c 283c 7370 616e 2063 6c61 7373 :mul(d │ │ │ -001a2670: 6f75 626c 653c 2f73 7061 6e3e 2061 2c20 ouble a, │ │ │ -001a2680: 3c73 7061 6e20 636c 6173 733d 226b 6579 double │ │ │ -001a26a0: 3c2f 7370 616e 3e20 622c 203c 7370 616e b, double &result)< │ │ │ -001a26e0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
{
. │ │ │ -001a2700: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
result = a * │ │ │ -001a2720: 2062 3b3c 2f64 6976 3e0a 3c64 6976 2063 b;
..} │ │ │ -001a27e0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
.
in │ │ │ -001a2830: 743c 2f73 7061 6e3e 2063 616c 633a 3a43 t calc::C │ │ │ -001a2840: 616c 633a 3a64 6976 283c 7370 616e 2063 alc::div(double │ │ │ -001a2870: 2061 2c20 3c73 7061 6e20 636c 6173 733d a, do │ │ │ -001a2890: 7562 6c65 3c2f 7370 616e 3e20 622c 203c uble b, < │ │ │ -001a28a0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -001a28b0: 6f72 6474 7970 6522 3e64 6f75 626c 653c ordtype">double< │ │ │ -001a28c0: 2f73 7061 6e3e 2026 616d 703b 7265 7375 /span> &resu │ │ │ -001a28d0: 6c74 293c 2f64 6976 3e0a 3c64 6976 2063 lt)
.
{.
result = │ │ │ -001a2910: 2061 202f 2062 3b3c 2f64 6976 3e0a 3c64 a / b;
. │ │ │ -001a2930: 2020 3c73 7061 6e20 636c 6173 733d 226b retu │ │ │ -001a2950: 726e 3c2f 7370 616e 3e20 3c61 2063 6c61 rn SO │ │ │ -001a29b0: 4150 5f4f 4b3c 2f61 3e3b 3c2f 6469 763e AP_OK;
│ │ │ -001a29c0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
}
.

The exampl │ │ │ -001a2a00: 6520 6162 6f76 6520 7365 7276 6573 2072 e above serves r │ │ │ -001a2a10: 6571 7565 7374 7320 6f76 6572 2073 7464 equests over std │ │ │ -001a2a20: 696e 2f6f 7574 2e20 5573 6520 7468 6520 in/out. Use the │ │ │ -001a2a30: 6269 6e64 2061 6e64 2061 6363 6570 7420 bind and accept │ │ │ -001a2a40: 6361 6c6c 7320 746f 2063 7265 6174 6520 calls to create │ │ │ -001a2a50: 6120 7374 616e 642d 616c 6f6e 6520 7365 a stand-alone se │ │ │ -001a2a60: 7276 6572 2074 6f20 7365 7276 6963 6520 rver to service │ │ │ -001a2a70: 696e 626f 756e 6420 7265 7175 6573 7473 inbound requests │ │ │ -001a2a80: 206f 7665 7220 736f 636b 6574 732c 2073 over sockets, s │ │ │ -001a2a90: 6565 2053 6563 7469 6f6e 203c 6120 636c ee Section How to cr │ │ │ -001a2ad0: 6561 7465 2061 2073 7461 6e64 2d61 6c6f eate a stand-alo │ │ │ -001a2ae0: 6e65 2073 6572 7665 723c 2f61 3e20 2e3c ne server .< │ │ │ -001a2af0: 2f70 3e0a 3c70 3ef0 9f94 9d20 3c61 2068 /p>.

.... Back to │ │ │ -001a2b10: 7461 626c 6520 6f66 2063 6f6e 7465 6e74 table of content │ │ │ -001a2b20: 733c 2f61 3e3c 2f70 3e0a 3c68 333e 3c61 s

.

< │ │ │ -001a2b50: 2f61 3e0a 4320 6578 616d 706c 6573 3c2f /a>.C examples.

This is t │ │ │ -001a2b70: 6865 2073 616d 6520 6578 616d 706c 6520 he same example │ │ │ -001a2b80: 6173 2061 626f 7665 2c20 6275 7420 7468 as above, but th │ │ │ -001a2b90: 6520 636c 6965 6e74 7320 6172 6520 6275 e clients are bu │ │ │ -001a2ba0: 696c 6420 696e 2043 2e3c 2f70 3e0a 3c70 ild in C.

.

We create a env.h that co │ │ │ -001a2be0: 6e74 6169 6e73 2074 6865 206a 6f69 6e74 ntains the joint │ │ │ -001a2bf0: 2053 4f41 5020 4865 6164 6572 2061 6e64 SOAP Header and │ │ │ -001a2c00: 2053 4f41 5020 4661 756c 7420 6465 6669 SOAP Fault defi │ │ │ -001a2c10: 6e69 7469 6f6e 732e 2059 6f75 206d 6179 nitions. You may │ │ │ -001a2c20: 2068 6176 6520 746f 2063 6f70 792d 7061 have to copy-pa │ │ │ -001a2c30: 7374 6520 7468 6573 6520 6672 6f6d 2074 ste these from t │ │ │ -001a2c40: 6865 206f 7468 6572 2068 6561 6465 7220 he other header │ │ │ -001a2c50: 6669 6c65 732e 2054 6865 6e2c 2063 6f6d files. Then, com │ │ │ -001a2c60: 7069 6c65 2069 7420 6173 2066 6f6c 6c6f pile it as follo │ │ │ -001a2c70: 7773 3a20 3c2f 703e 3c70 7265 2063 6c61 ws:

 s
│ │ │ -001a2c90: 6f61 7063 7070 3220 2d63 202d 7065 6e76  oapcpp2 -c -penv
│ │ │ -001a2ca0: 2065 6e76 2e68 0a20 6363 202d 6320 656e   env.h. cc -c en
│ │ │ -001a2cb0: 7643 2e63 0a3c 2f70 7265 3e3c 703e 2057  vC.c.

W │ │ │ -001a2cc0: 6520 616c 736f 2063 6f6d 7069 6c65 203c e also compile < │ │ │ -001a2cd0: 656d 3e3c 636f 6465 3e67 736f 6170 2f73 em>gsoap/s │ │ │ -001a2ce0: 7464 736f 6170 322e 633c 2f63 6f64 653e tdsoap2.c │ │ │ -001a2cf0: 3c2f 656d 3e20 7769 7468 6f75 7420 6e61 without na │ │ │ -001a2d00: 6d65 7370 6163 6573 3a20 3c2f 703e 3c70 mespaces:

cc -c -DWIT │ │ │ -001a2d30: 485f 4e4f 4e41 4d45 5350 4143 4553 2073 H_NONAMESPACES s │ │ │ -001a2d40: 7464 736f 6170 322e 630a 3c2f 7072 653e tdsoap2.c.

│ │ │ -001a2d50: 3c70 3e20 5365 636f 6e64 2c20 7765 2063

Second, we c │ │ │ -001a2d60: 7265 6174 6520 7468 6520 4465 6c61 7965 reate the Delaye │ │ │ -001a2d70: 6420 5374 6f63 6b20 5175 6f74 6520 6865 d Stock Quote he │ │ │ -001a2d80: 6164 6572 2066 696c 6520 7370 6563 6966 ader file specif │ │ │ -001a2d90: 6963 6174 696f 6e2c 2077 6869 6368 206d ication, which m │ │ │ -001a2da0: 6179 2062 6520 6f62 7461 696e 6564 2075 ay be obtained u │ │ │ -001a2db0: 7369 6e67 2074 6865 2057 5344 4c20 696d sing the WSDL im │ │ │ -001a2dc0: 706f 7274 6572 2e3c 2f70 3e0a 3c64 6976 porter.

.
//gsoa │ │ │ -001a2e10: 7020 6e73 2073 6572 7669 6365 206e 616d p ns service nam │ │ │ -001a2e20: 653a 2053 6572 7669 6365 203c 2f73 7061 e: Service
.
//gsoap ns serv │ │ │ -001a2e70: 6963 6520 7374 796c 653a 2072 7063 203c ice style: rpc < │ │ │ -001a2e80: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
.< │ │ │ -001a2ea0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ -001a2eb0: 656e 7422 3e2f 2f67 736f 6170 206e 7320 ent">//gsoap ns │ │ │ -001a2ec0: 7365 7276 6963 6520 656e 636f 6469 6e67 service encoding │ │ │ -001a2ed0: 3a20 656e 636f 6465 6420 3c2f 7370 616e : encoded
.
│ │ │ -001a2f10: 2f2f 6773 6f61 7020 6e73 2073 6572 7669 //gsoap ns servi │ │ │ -001a2f20: 6365 206c 6f63 6174 696f 6e3a 2068 7474 ce location: htt │ │ │ -001a2f30: 703a 2f2f 7365 7276 6963 6573 2e78 6d65 p://services.xme │ │ │ -001a2f40: 7468 6f64 732e 6e65 742f 736f 6170 203c thods.net/soap < │ │ │ -001a2f50: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
.< │ │ │ -001a2f70: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ -001a2f80: 656e 7422 3e2f 2f67 736f 6170 206e 7320 ent">//gsoap ns │ │ │ -001a2f90: 7363 6865 6d61 206e 616d 6573 7061 6365 schema namespace │ │ │ -001a2fa0: 3a20 7572 6e3a 786d 6574 686f 6473 2d64 : urn:xmethods-d │ │ │ -001a2fb0: 656c 6179 6564 2d71 756f 7465 7320 3c2f elayed-quotes
.
//gsoap ns s │ │ │ -001a3000: 6572 7669 6365 206d 6574 686f 642d 6163 ervice method-ac │ │ │ -001a3010: 7469 6f6e 3a20 6765 7451 756f 7465 2026 tion: getQuote & │ │ │ -001a3020: 7175 6f74 3b26 7175 6f74 3b20 3c2f 7370 quot;"
.
int │ │ │ -001a3070: 206e 735f 5f67 6574 5175 6f74 6528 3c73 ns__getQuote(char *symbol, float *Result);.

We │ │ │ -001a3100: 2063 6f6d 7069 6c65 2069 7420 6173 2061 compile it as a │ │ │ -001a3110: 206c 6962 7261 7279 2061 6e64 2077 6520 library and we │ │ │ -001a3120: 7573 6520 6f70 7469 6f6e 7320 3c62 3e3c use options < │ │ │ -001a3130: 636f 6465 3e2d 6e3c 2f63 6f64 653e 3c2f code>-n and │ │ │ -001a3150: 2d70 7175 6f74 653c 2f63 6f64 653e 3c2f -pquote to prefix the │ │ │ -001a3170: 2067 656e 6572 6174 6564 2066 696c 6573 generated files │ │ │ -001a3180: 2061 6e64 2074 6f20 7265 6e61 6d65 2074 and to rename t │ │ │ -001a3190: 6865 206e 616d 6573 7061 6365 2074 6162 he namespace tab │ │ │ -001a31a0: 6c65 2074 6f20 6176 6f69 6420 6c69 6e6b le to avoid link │ │ │ -001a31b0: 2063 6f6e 666c 6963 7473 3a20 3c2f 703e conflicts:

│ │ │ -001a31c0: 3c70 7265 2063 6c61 7373 3d22 6672 6167
 soapcpp2 
│ │ │ -001a31e0: 2d63 202d 6e20 2d70 7175 6f74 6520 7175  -c -n -pquote qu
│ │ │ -001a31f0: 6f74 652e 680a 2063 6320 2d63 2071 756f  ote.h. cc -c quo
│ │ │ -001a3200: 7465 436c 6965 6e74 4c69 622e 630a 3c2f  teClientLib.c.

Third, w │ │ │ -001a3220: 6520 6372 6561 7465 2074 6865 2043 7572 e create the Cur │ │ │ -001a3230: 7265 6e63 7920 4578 6368 616e 6765 2052 rency Exchange R │ │ │ -001a3240: 6174 6520 6865 6164 6572 2066 696c 6520 ate header file │ │ │ -001a3250: 7370 6563 6966 6963 6174 696f 6e3a 3c2f specification:.

//gsoap ns serv │ │ │ -001a32b0: 6963 6520 6e61 6d65 3a20 5365 7276 6963 ice name: Servic │ │ │ -001a32c0: 6520 3c2f 7370 616e 3e3c 2f64 6976 3e0a e
. │ │ │ -001a32d0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
//gsoap │ │ │ -001a3300: 6e73 2073 6572 7669 6365 2073 7479 6c65 ns service style │ │ │ -001a3310: 3a20 7270 6320 3c2f 7370 616e 3e3c 2f64 : rpc .
//gs │ │ │ -001a3350: 6f61 7020 6e73 2073 6572 7669 6365 2065 oap ns service e │ │ │ -001a3360: 6e63 6f64 696e 673a 2065 6e63 6f64 6564 ncoding: encoded │ │ │ -001a3370: 203c 2f73 7061 6e3e 3c2f 6469 763e 0a3c
.< │ │ │ -001a3380: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -001a3390: 3e3c 7370 616e 2063 6c61 7373 3d22 636f >//gsoap n │ │ │ -001a33b0: 7320 7365 7276 6963 6520 6c6f 6361 7469 s service locati │ │ │ -001a33c0: 6f6e 3a20 6874 7470 3a2f 2f73 6572 7669 on: http://servi │ │ │ -001a33d0: 6365 732e 786d 6574 686f 6473 2e6e 6574 ces.xmethods.net │ │ │ -001a33e0: 2f73 6f61 7020 3c2f 7370 616e 3e3c 2f64 /soap .
//gs │ │ │ -001a3420: 6f61 7020 6e73 2073 6368 656d 6120 6e61 oap ns schema na │ │ │ -001a3430: 6d65 7370 6163 653a 2075 726e 3a78 6d65 mespace: urn:xme │ │ │ -001a3440: 7468 6f64 732d 4375 7272 656e 6379 4578 thods-CurrencyEx │ │ │ -001a3450: 6368 616e 6765 203c 2f73 7061 6e3e 3c2f change .
//g │ │ │ -001a3490: 736f 6170 206e 7320 7365 7276 6963 6520 soap ns service │ │ │ -001a34a0: 6d65 7468 6f64 2d61 6374 696f 6e3a 2067 method-action: g │ │ │ -001a34b0: 6574 5261 7465 2026 7175 6f74 3b26 7175 etRate "&qu │ │ │ -001a34c0: 6f74 3b20 3c2f 7370 616e 3e3c 2f64 6976 ot;
.
in │ │ │ -001a3500: 743c 2f73 7061 6e3e 206e 735f 5f67 6574 t ns__get │ │ │ -001a3510: 5261 7465 283c 7370 616e 2063 6c61 7373 Rate(c │ │ │ -001a3530: 6861 723c 2f73 7061 6e3e 202a 636f 756e har *coun │ │ │ -001a3540: 7472 7931 2c20 3c73 7061 6e20 636c 6173 try1, │ │ │ -001a3560: 6368 6172 3c2f 7370 616e 3e20 2a63 6f75 char *cou │ │ │ -001a3570: 6e74 7279 322c 203c 7370 616e 2063 6c61 ntry2, float *R │ │ │ -001a35a0: 6573 756c 7429 3b3c 2f64 6976 3e0a 3c2f esult);
.

We compi │ │ │ -001a35d0: 6c65 2069 7420 6173 2061 206c 6962 7261 le it as a libra │ │ │ -001a35e0: 7279 2061 6e64 2077 6520 7573 6520 6f70 ry and we use op │ │ │ -001a35f0: 7469 6f6e 7320 3c62 3e3c 636f 6465 3e2d tions - │ │ │ -001a3600: 6e3c 2f63 6f64 653e 3c2f 623e 2061 6e64 n and │ │ │ -001a3610: 203c 623e 3c63 6f64 653e 2d70 7261 7465 -prate │ │ │ -001a3620: 3c2f 636f 6465 3e3c 2f62 3e20 746f 2070 to p │ │ │ -001a3630: 7265 6669 7820 7468 6520 6765 6e65 7261 refix the genera │ │ │ -001a3640: 7465 6420 6669 6c65 7320 616e 6420 746f ted files and to │ │ │ -001a3650: 2072 656e 616d 6520 7468 6520 6e61 6d65 rename the name │ │ │ -001a3660: 7370 6163 6520 7461 626c 6520 746f 2061 space table to a │ │ │ -001a3670: 766f 6964 206c 696e 6b20 636f 6e66 6c69 void link confli │ │ │ -001a3680: 6374 733a 203c 2f70 3e3c 7072 6520 636c cts:

 
│ │ │ -001a36a0: 736f 6170 6370 7032 202d 6320 2d6e 202d  soapcpp2 -c -n -
│ │ │ -001a36b0: 7072 6174 6520 7261 7465 2e68 0a20 6363  prate rate.h. cc
│ │ │ -001a36c0: 202d 6320 7261 7465 436c 6965 6e74 4c69   -c rateClientLi
│ │ │ -001a36d0: 622e 630a 3c2f 7072 653e 3c70 3e20 5468  b.c.

Th │ │ │ -001a36e0: 6520 6d61 696e 2070 726f 6772 616d 2069 e main program i │ │ │ -001a36f0: 733a 3c2f 703e 0a3c 6469 7620 636c 6173 s:

.
< │ │ │ -001a3720: 7370 616e 2063 6c61 7373 3d22 7072 6570 span class="prep │ │ │ -001a3730: 726f 6365 7373 6f72 223e 2369 6e63 6c75 rocessor">#inclu │ │ │ -001a3740: 6465 2026 7175 6f74 3b71 756f 7465 482e de "quoteH. │ │ │ -001a3750: 6826 7175 6f74 3b3c 2f73 7061 6e3e 3c2f h".
#include " │ │ │ -001a37a0: 3b72 6174 6548 2e68 2671 756f 743b 3c2f ;rateH.h"
.
#includ │ │ │ -001a37f0: 6520 2671 756f 743b 7175 6f74 652e 6e73 e "quote.ns │ │ │ -001a3800: 6d61 7026 7175 6f74 3b3c 2f73 7061 6e3e map" │ │ │ -001a3810: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
#include &qu │ │ │ -001a3850: 6f74 3b72 6174 652e 6e73 6d61 7026 7175 ot;rate.nsmap&qu │ │ │ -001a3860: 6f74 3b3c 2f73 7061 6e3e 3c2f 6469 763e ot;
│ │ │ -001a3870: 0a3c 6469 7620 636c 6173 733d 226c 696e .
.
int main(int argc │ │ │ -001a38f0: 2c20 3c73 7061 6e20 636c 6173 733d 226b , char │ │ │ -001a3910: 3c2f 7370 616e 3e20 2a61 7267 765b 5d29 *argv[]) │ │ │ -001a3920: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
{
.
│ │ │ -001a3970: 6966 3c2f 7370 616e 3e20 2861 7267 6320 if (argc │ │ │ -001a3980: 266c 743b 3d20 3129 203c 2f64 6976 3e0a <= 1)
. │ │ │ -001a3990: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
{
.
│ │ │ -001a39c0: 2020 6670 7269 6e74 6628 7374 6465 7272 fprintf(stderr │ │ │ -001a39d0: 2c20 3c73 7061 6e20 636c 6173 733d 2273 , &q │ │ │ -001a39f0: 756f 743b 5573 6167 653a 206d 6169 6e20 uot;Usage: main │ │ │ -001a3a00: 7469 636b 6572 205b 6375 7272 656e 6379 ticker [currency │ │ │ -001a3a10: 5d5c 6e26 7175 6f74 3b3c 2f73 7061 6e3e ]\n" │ │ │ -001a3a20: 293b 203c 2f64 6976 3e0a 3c64 6976 2063 );
.
│ │ │ -001a3a40: 6578 6974 2845 5849 545f 4641 494c 5552 exit(EXIT_FAILUR │ │ │ -001a3a50: 4529 3b20 3c2f 6469 763e 0a3c 6469 7620 E);
.
} │ │ │ -001a3a70: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
struct │ │ │ -001a3ab0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap │ │ │ -001a3ae0: 2a3c 6120 636c 6173 733d 2263 6f64 6522 *soap │ │ │ -001a3b10: 203d 203c 6120 636c 6173 733d 2263 6f64 = soap_new │ │ │ -001a3b70: 3c2f 613e 2829 3b20 3c2f 6469 763e 0a3c ();
.< │ │ │ -001a3b80: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -001a3b90: 3e20 203c 7370 616e 2063 6c61 7373 3d22 > flo │ │ │ -001a3bb0: 6174 3c2f 7370 616e 3e20 713b 203c 2f64 at q; ..
│ │ │ -001a3cc0: 6966 3c2f 7370 616e 3e20 2873 6f61 705f if (soap_ │ │ │ -001a3cd0: 6361 6c6c 5f6e 735f 5f67 6574 5175 6f74 call_ns__getQuot │ │ │ -001a3ce0: 6528 3c61 2063 6c61 7373 3d22 636f 6465 e(soap, NULL, NULL, a │ │ │ -001a3d20: 7267 765b 315d 2c20 2661 6d70 3b71 2929 rgv[1], &q)) │ │ │ -001a3d30: 203c 7370 616e 2063 6c61 7373 3d22 636f // get qu │ │ │ -001a3d50: 6f74 6520 3c2f 7370 616e 3e3c 2f64 6976 ote
.
soap_ │ │ │ -001a3dd0: 7072 696e 745f 6661 756c 743c 2f61 3e28 print_fault( │ │ │ -001a3de0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap, │ │ │ -001a3e10: 2073 7464 6572 7229 3b20 3c2f 6469 763e stderr);
│ │ │ -001a3e20: 0a3c 6469 7620 636c 6173 733d 226c 696e .
e │ │ │ -001a3e50: 6c73 653c 2f73 7061 6e3e 203c 2f64 6976 lse
.
{
. │ │ │ -001a3e90: 2020 2020 3c73 7061 6e20 636c 6173 733d if │ │ │ -001a3eb0: 3c2f 7370 616e 3e20 2861 7267 6320 2667 (argc &g │ │ │ -001a3ec0: 743b 2032 2920 3c2f 6469 763e 0a3c 6469 t; 2)
. │ │ │ -001a3ee0: 2020 207b 3c2f 6469 763e 0a3c 6469 7620 {
.
│ │ │ -001a3f00: 2020 203c 6120 636c 6173 733d 2263 6f64 soap_s │ │ │ -001a3f60: 6574 5f6e 616d 6573 7061 6365 733c 2f61 et_namespaces(soap, rate_namespac │ │ │ -001a3fb0: 6573 293b 203c 2f64 6976 3e0a 3c64 6976 es);
.
│ │ │ -001a3fd0: 2020 2020 3c73 7061 6e20 636c 6173 733d fl │ │ │ -001a3ff0: 6f61 743c 2f73 7061 6e3e 2072 3b20 3c2f oat r; .
if │ │ │ -001a4040: 2028 736f 6170 5f63 616c 6c5f 6e73 5f5f (soap_call_ns__ │ │ │ -001a4050: 6765 7452 6174 6528 3c61 2063 6c61 7373 getRate(s │ │ │ -001a4080: 6f61 703c 2f61 3e2c 204e 554c 4c2c 204e oap, NULL, N │ │ │ -001a4090: 554c 4c2c 203c 7370 616e 2063 6c61 7373 ULL, "us"< │ │ │ -001a40c0: 2f73 7061 6e3e 2c20 6172 6776 5b32 5d2c /span>, argv[2], │ │ │ -001a40d0: 2026 616d 703b 7229 2920 3c73 7061 6e20 &r)) │ │ │ -001a40f0: 2f2f 2067 6574 2072 6174 6520 696e 2055 // get rate in U │ │ │ -001a4100: 5320 646f 6c6c 6172 7320 3c2f 7370 616e S dollars
.
│ │ │ -001a4130: 2020 3c61 2063 6c61 7373 3d22 636f 6465 soap_print_ │ │ │ -001a4190: 6661 756c 743c 2f61 3e28 3c61 2063 6c61 fault(soap, stder │ │ │ -001a41d0: 7229 3b20 3c2f 6469 763e 0a3c 6469 7620 r);
.
│ │ │ -001a41f0: 2020 203c 7370 616e 2063 6c61 7373 3d22 els │ │ │ -001a4210: 653c 2f73 7061 6e3e 203c 2f64 6976 3e0a e
. │ │ │ -001a4220: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
q *= r │ │ │ -001a4240: 3b20 3c73 7061 6e20 636c 6173 733d 2263 ; // conve │ │ │ -001a4260: 7274 2074 6865 2071 756f 7465 203c 2f73 rt the quote
.
│ │ │ -001a4290: 207d 203c 2f64 6976 3e0a 3c64 6976 2063 }
.
│ │ │ -001a42b0: 7072 696e 7466 283c 7370 616e 2063 6c61 printf("%s: %f │ │ │ -001a42e0: 5c6e 2671 756f 743b 3c2f 7370 616e 3e2c \n", │ │ │ -001a42f0: 2061 7267 765b 315d 2c20 7129 3b20 3c2f argv[1], q); .
}
.
soap_ │ │ │ -001a4390: 6465 7374 726f 793c 2f61 3e28 3c61 2063 destroy(soap);.. │ │ │ -001a4530: 0a3c 6469 7620 636c 6173 733d 226c 696e .
r │ │ │ -001a4560: 6574 7572 6e3c 2f73 7061 6e3e 2030 3b20 eturn 0; │ │ │ -001a4570: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
}
│ │ │ -001a4590: 0a3c 2f64 6976 3e3c 212d 2d20 6672 6167 .

Compi │ │ │ -001a45b0: 6c65 2061 6e64 206c 696e 6b20 7468 6973 le and link this │ │ │ -001a45c0: 2061 7070 6c69 6361 7469 6f6e 2077 6974 application wit │ │ │ -001a45d0: 6820 3c65 6d3e 3c63 6f64 653e 7374 6473 h stds │ │ │ -001a45e0: 6f61 7032 2e6f 3c2f 636f 6465 3e3c 2f65 oap2.o, en │ │ │ -001a4600: 7643 2e6f 3c2f 636f 6465 3e3c 2f65 6d3e vC.o │ │ │ -001a4610: 2c20 3c65 6d3e 3c63 6f64 653e 7175 6f74 , quot │ │ │ -001a4620: 6543 6c69 656e 744c 6962 2e6f 3c2f 636f eClientLib.o, and rateClie │ │ │ -001a4650: 6e74 4c69 622e 6f3c 2f63 6f64 653e 3c2f ntLib.o.

.

.... │ │ │ -001a4670: 203c 6120 6872 6566 3d22 2322 3e42 6163 Bac │ │ │ -001a4680: 6b20 746f 2074 6162 6c65 206f 6620 636f k to table of co │ │ │ -001a4690: 6e74 656e 7473 3c2f 613e 3c2f 703e 0a3c ntents

.< │ │ │ -001a46a0: 6833 3e3c 6120 636c 6173 733d 2261 6e63 h3>.How to │ │ │ -001a46d0: 6368 6169 6e20 4320 7365 7276 6963 6573 chain C services │ │ │ -001a46e0: 2074 6f20 6163 6365 7074 206d 6573 7361 to accept messa │ │ │ -001a46f0: 6765 7320 6f6e 2074 6865 2073 616d 6520 ges on the same │ │ │ -001a4700: 706f 7274 3c2f 6833 3e0a 3c70 3e57 6865 port

.

Whe │ │ │ -001a4710: 6e20 636f 6d62 696e 696e 6720 6d75 6c74 n combining mult │ │ │ -001a4720: 6970 6c65 2073 6572 7669 6365 7320 696e iple services in │ │ │ -001a4730: 746f 206f 6e65 2061 7070 6c69 6361 7469 to one applicati │ │ │ -001a4740: 6f6e 2c20 796f 7520 6361 6e20 7275 6e20 on, you can run │ │ │ -001a4750: 7773 646c 3268 206f 6e20 6d75 6c74 6970 wsdl2h on multip │ │ │ -001a4760: 6c65 2057 5344 4c73 2074 6f20 6765 6e65 le WSDLs to gene │ │ │ -001a4770: 7261 7465 2074 6865 2073 696e 676c 6520 rate the single │ │ │ -001a4780: 616c 6c2d 696e 636c 7573 6976 6520 7365 all-inclusive se │ │ │ -001a4790: 7276 6963 6520 6465 6669 6e69 7469 6f6e rvice definition │ │ │ -001a47a0: 7320 696e 7465 7266 6163 6520 6865 6164 s interface head │ │ │ -001a47b0: 6572 2066 696c 6520 666f 7220 736f 6170 er file for soap │ │ │ -001a47c0: 6370 7032 2e20 5468 6973 2068 6561 6465 cpp2. This heade │ │ │ -001a47d0: 7220 6669 6c65 2069 7320 7468 656e 2070 r file is then p │ │ │ -001a47e0: 726f 6365 7373 6564 2077 6974 6820 736f rocessed with so │ │ │ -001a47f0: 6170 6370 7032 2074 6f20 6765 6e65 7261 apcpp2 to genera │ │ │ -001a4800: 7465 2073 6b65 6c65 746f 6e20 6675 6e63 te skeleton func │ │ │ -001a4810: 7469 6f6e 7320 696e 2043 2e3c 2f70 3e0a tions in C.

. │ │ │ -001a4820: 3c70 3e57 6861 7420 6966 2077 6520 6765

What if we ge │ │ │ -001a4830: 6e65 7261 7465 206d 756c 7469 706c 6520 nerate multiple │ │ │ -001a4840: 7365 7276 6963 6573 2c20 6561 6368 2066 services, each f │ │ │ -001a4850: 726f 6d20 6120 5753 444c 2073 6570 6172 rom a WSDL separ │ │ │ -001a4860: 6174 656c 792c 2061 6e64 2077 616e 7420 ately, and want │ │ │ -001a4870: 746f 2064 6570 6c6f 7920 7468 656d 206f to deploy them o │ │ │ -001a4880: 6e20 7468 6520 7361 6d65 2070 6f72 743f n the same port? │ │ │ -001a4890: 2054 6869 7320 7265 7175 6972 6573 206c This requires l │ │ │ -001a48a0: 6973 7465 6e69 6e67 2074 6f20 7468 6520 istening to the │ │ │ -001a48b0: 7361 6d65 2070 6f72 7420 616e 6420 7468 same port and th │ │ │ -001a48c0: 656e 2063 6861 696e 696e 6720 7468 6520 en chaining the │ │ │ -001a48d0: 7365 7276 6963 6520 6469 7370 6174 6368 service dispatch │ │ │ -001a48e0: 6573 2073 6f20 7468 6174 2065 6163 6820 es so that each │ │ │ -001a48f0: 7365 7276 6963 6520 6361 6e20 7365 7276 service can serv │ │ │ -001a4900: 6520 6120 7265 7175 6573 742e 3c2f 703e e a request.

│ │ │ -001a4910: 0a3c 703e 4669 7273 7420 7765 2063 7265 .

First we cre │ │ │ -001a4920: 6174 6520 6120 3c65 6d3e 3c63 6f64 653e ate a │ │ │ -001a4930: 656e 762e 683c 2f63 6f64 653e 3c2f 656d env.h that contains │ │ │ -001a4950: 7468 6520 6a6f 696e 7420 534f 4150 2048 the joint SOAP H │ │ │ -001a4960: 6561 6465 7220 616e 6420 534f 4150 2046 eader and SOAP F │ │ │ -001a4970: 6175 6c74 2064 6566 696e 6974 696f 6e73 ault definitions │ │ │ -001a4980: 2c20 666f 7220 6578 616d 706c 6520 6279 , for example by │ │ │ -001a4990: 2063 6f70 792d 7061 7374 696e 6720 7468 copy-pasting th │ │ │ -001a49a0: 6573 6520 6672 6f6d 2074 6865 206f 7468 ese from the oth │ │ │ -001a49b0: 6572 2068 6561 6465 7220 6669 6c65 7320 er header files │ │ │ -001a49c0: 6765 6e65 7261 7465 6420 6279 2077 7364 generated by wsd │ │ │ -001a49d0: 6c32 682e 204f 7220 7468 6973 2066 696c l2h. Or this fil │ │ │ -001a49e0: 6520 6973 2065 6d70 7479 2069 6620 6e6f e is empty if no │ │ │ -001a49f0: 2073 7065 6369 616c 697a 6564 2053 4f41 specialized SOA │ │ │ -001a4a00: 5020 4865 6164 6572 7320 616e 6420 4661 P Headers and Fa │ │ │ -001a4a10: 756c 7473 2061 7265 2075 7365 642e 2057 ults are used. W │ │ │ -001a4a20: 6520 636f 6d70 696c 6520 6974 2061 7320 e compile it as │ │ │ -001a4a30: 666f 6c6c 6f77 733a 203c 2f70 3e3c 7072 follows:

soapcpp2 -c │ │ │ -001a4a60: 2d70 656e 7620 656e 762e 680a 2063 6320 -penv env.h. cc │ │ │ -001a4a70: 2d63 2065 6e76 432e 630a 3c2f 7072 653e -c envC.c. │ │ │ -001a4a80: 3c70 3e20 5765 2061 6c73 6f20 636f 6d70

We also comp │ │ │ -001a4a90: 696c 6520 3c65 6d3e 3c63 6f64 653e 6773 ile gs │ │ │ -001a4aa0: 6f61 702f 7374 6473 6f61 7032 2e63 3c2f oap/stdsoap2.c witho │ │ │ -001a4ac0: 7574 206e 616d 6573 7061 6365 733a 203c ut namespaces: < │ │ │ -001a4ad0: 2f70 3e3c 7072 6520 636c 6173 733d 2266 /p>

 cc -c 
│ │ │ -001a4af0: 2d44 5749 5448 5f4e 4f4e 414d 4553 5041  -DWITH_NONAMESPA
│ │ │ -001a4b00: 4345 5320 7374 6473 6f61 7032 2e63 0a3c  CES stdsoap2.c.<
│ │ │ -001a4b10: 2f70 7265 3e3c 703e 2053 6179 2066 6f72  /pre>

Say for │ │ │ -001a4b20: 2065 7861 6d70 6c65 2074 6861 7420 7765 example that we │ │ │ -001a4b30: 2068 6176 6520 6120 7365 7276 6963 6520 have a service │ │ │ -001a4b40: 6465 6669 6e69 7469 6f6e 2069 6e20 3c65 definition in quote.h< │ │ │ -001a4b60: 2f63 6f64 653e 3c2f 656d 3e2e 2057 6520 /code>. We │ │ │ -001a4b70: 636f 6d70 696c 6520 6974 2061 7320 6120 compile it as a │ │ │ -001a4b80: 6c69 6272 6172 7920 616e 6420 7765 2075 library and we u │ │ │ -001a4b90: 7365 206f 7074 696f 6e73 203c 623e 3c63 se options -n and - │ │ │ -001a4bc0: 7071 756f 7465 3c2f 636f 6465 3e3c 2f62 pquote to prefix the │ │ │ -001a4be0: 6765 6e65 7261 7465 6420 6669 6c65 7320 generated files │ │ │ -001a4bf0: 616e 6420 746f 2072 656e 616d 6520 7468 and to rename th │ │ │ -001a4c00: 6520 6e61 6d65 7370 6163 6520 7461 626c e namespace tabl │ │ │ -001a4c10: 6520 746f 2061 766f 6964 206c 696e 6b20 e to avoid link │ │ │ -001a4c20: 636f 6e66 6c69 6374 733a 203c 2f70 3e3c conflicts:

< │ │ │ -001a4c30: 7072 6520 636c 6173 733d 2266 7261 676d pre class="fragm │ │ │ -001a4c40: 656e 7422 3e20 736f 6170 6370 7032 202d ent"> soapcpp2 - │ │ │ -001a4c50: 6320 2d6e 202d 7071 756f 7465 2071 756f c -n -pquote quo │ │ │ -001a4c60: 7465 2e68 0a20 6363 202d 6320 7175 6f74 te.h. cc -c quot │ │ │ -001a4c70: 6543 6c69 656e 744c 6962 2e63 0a3c 2f70 eClientLib.c.

We do the │ │ │ -001a4c90: 2073 616d 6520 666f 7220 6120 7365 7276 same for a serv │ │ │ -001a4ca0: 6963 6520 6465 6669 6e69 7469 6f6e 2069 ice definition i │ │ │ -001a4cb0: 6e20 3c65 6d3e 3c63 6f64 653e 7261 7465 n rate │ │ │ -001a4cc0: 2e68 3c2f 636f 6465 3e3c 2f65 6d3e 3a20 .h: │ │ │ -001a4cd0: 3c2f 703e 3c70 7265 2063 6c61 7373 3d22

 soapc
│ │ │ -001a4cf0: 7070 3220 2d63 202d 6e20 2d70 7261 7465  pp2 -c -n -prate
│ │ │ -001a4d00: 2072 6174 652e 680a 2063 6320 2d63 2072   rate.h. cc -c r
│ │ │ -001a4d10: 6174 6543 6c69 656e 744c 6962 2e63 0a3c  ateClientLib.c.<
│ │ │ -001a4d20: 2f70 7265 3e3c 703e 2054 6f20 7365 7276  /pre>

To serv │ │ │ -001a4d30: 6520 626f 7468 2074 6865 2071 756f 7465 e both the quote │ │ │ -001a4d40: 2061 6e64 2072 6174 6520 7365 7276 6963 and rate servic │ │ │ -001a4d50: 6573 206f 6e20 7468 6520 7361 6d65 2070 es on the same p │ │ │ -001a4d60: 6f72 742c 2077 6520 6368 6169 6e20 7468 ort, we chain th │ │ │ -001a4d70: 6520 7365 7276 6963 6520 6469 7370 6174 e service dispat │ │ │ -001a4d80: 6368 6572 7320 6173 2066 6f6c 6c6f 7773 chers as follows │ │ │ -001a4d90: 3a3c 2f70 3e0a 3c64 6976 2063 6c61 7373 :

.
#includ │ │ │ -001a4de0: 6520 2671 756f 743b 7175 6f74 6548 2e68 e "quoteH.h │ │ │ -001a4df0: 2671 756f 743b 3c2f 7370 616e 3e3c 2f64 ".
#include " │ │ │ -001a4e40: 7261 7465 482e 6826 7175 6f74 3b3c 2f73 rateH.h"
.
#include │ │ │ -001a4e90: 2026 7175 6f74 3b71 756f 7465 2e6e 736d "quote.nsm │ │ │ -001a4ea0: 6170 2671 756f 743b 3c2f 7370 616e 3e3c ap"< │ │ │ -001a4eb0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
#include &quo │ │ │ -001a4ef0: 743b 7261 7465 2e6e 736d 6170 2671 756f t;rate.nsmap&quo │ │ │ -001a4f00: 743b 3c2f 7370 616e 3e3c 2f64 6976 3e0a t;
. │ │ │ -001a4f10: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
.
struct │ │ │ -001a4f60: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap │ │ │ -001a4f90: 2a3c 6120 636c 6173 733d 2263 6f64 6522 *soap │ │ │ -001a4fc0: 203d 203c 6120 636c 6173 733d 2263 6f64 = soap_new │ │ │ -001a5020: 3c2f 613e 2829 3b20 3c2f 6469 763e 0a3c ();
.< │ │ │ -001a5030: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -001a5040: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >if
(soap_val │ │ │ -001a50c0: 6964 5f73 6f63 6b65 743c 2f61 3e28 3c61 id_socket(so │ │ │ -001a5120: 6170 5f62 696e 643c 2f61 3e28 3c61 2063 ap_bind(soap, NUL │ │ │ -001a5160: 4c2c 2038 3038 302c 2031 3029 2929 203c L, 8080, 10))) < │ │ │ -001a5170: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ -001a5180: 656e 7422 3e2f 2f20 736d 616c 6c20 4241 ent">// small BA │ │ │ -001a5190: 434b 4c4f 4720 666f 7220 6974 6572 6174 CKLOG for iterat │ │ │ -001a51a0: 6976 6520 7365 7276 6572 733c 2f73 7061 ive servers
.
{.
while (1 │ │ │ -001a5210: 293c 2f64 6976 3e0a 3c64 6976 2063 6c61 )
.
{.
if (< │ │ │ -001a5270: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -001a5280: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ -001a5290: 705f 5f73 6f61 702e 6874 6d6c 2367 6161 p__soap.html#gaa │ │ │ -001a52a0: 6165 3837 3437 6634 6364 6163 6565 3537 ae8747f4cdacee57 │ │ │ -001a52b0: 3538 3735 6333 6132 3438 3864 3939 6322 5875c3a2488d99c" │ │ │ -001a52c0: 3e73 6f61 705f 7661 6c69 645f 736f 636b >soap_valid_sock │ │ │ -001a52d0: 6574 3c2f 613e 283c 6120 636c 6173 733d et(soap_acce │ │ │ -001a5330: 7074 3c2f 613e 283c 6120 636c 6173 733d pt(so │ │ │ -001a5360: 6170 3c2f 613e 2929 293c 2f64 6976 3e0a ap)))
. │ │ │ -001a5370: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
{
. │ │ │ -001a53a0: 2020 2020 2020 3c73 7061 6e20 636c 6173 │ │ │ -001a53c0: 6966 3c2f 7370 616e 3e20 283c 6120 636c if (soap_ │ │ │ -001a5420: 6265 6769 6e5f 7365 7276 653c 2f61 3e28 begin_serve( │ │ │ -001a5430: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap) │ │ │ -001a5460: 2920 3c2f 6469 763e 0a3c 6469 7620 636c )
.
│ │ │ -001a5480: 207b 3c2f 6469 763e 0a3c 6469 7620 636c {
.
│ │ │ -001a54a0: 2020 203c 6120 636c 6173 733d 2263 6f64 soap_print │ │ │ -001a5500: 5f66 6175 6c74 3c2f 613e 283c 6120 636c _fault(soap, stde │ │ │ -001a5540: 7272 293b 203c 2f64 6976 3e0a 3c64 6976 rr);
.
│ │ │ -001a5560: 2020 2020 2020 3c73 7061 6e20 636c 6173 │ │ │ -001a5580: 636f 6e74 696e 7565 3c2f 7370 616e 3e3b continue; │ │ │ -001a5590: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
} │ │ │ -001a55b0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
< │ │ │ -001a55d0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -001a55e0: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ -001a55f0: 705f 5f6e 616d 6573 7061 6365 2e68 746d p__namespace.htm │ │ │ -001a5600: 6c23 6761 3565 6339 3133 6163 6363 3730 l#ga5ec913accc70 │ │ │ -001a5610: 3563 6361 3332 3936 6162 3735 6261 6539 5cca3296ab75bae9 │ │ │ -001a5620: 3535 6135 223e 736f 6170 5f73 6574 5f6e 55a5">soap_set_n │ │ │ -001a5630: 616d 6573 7061 6365 733c 2f61 3e28 3c61 amespaces(soap, q │ │ │ -001a5670: 756f 7465 5f6e 616d 6573 7061 6365 7329 uote_namespaces) │ │ │ -001a5680: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
.
│ │ │ -001a56a0: 3c73 7061 6e20 636c 6173 733d 226b 6579 if (quote_serve │ │ │ -001a56d0: 5f72 6571 7565 7374 283c 6120 636c 6173 _request( │ │ │ -001a5700: 736f 6170 3c2f 613e 2920 3d3d 203c 6120 soap) == SOAP_NO_METHOD< │ │ │ -001a5770: 2f61 3e29 203c 2f64 6976 3e0a 3c64 6976 /a>)
.
│ │ │ -001a5790: 2020 2020 7b3c 2f64 6976 3e0a 3c64 6976 {
.
. │ │ │ -001a5880: 2020 2020 2020 2020 3c73 7061 6e20 636c if (rat │ │ │ -001a58b0: 655f 7365 7276 655f 7265 7175 6573 7428 e_serve_request( │ │ │ -001a58c0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap) │ │ │ -001a58f0: 293c 2f64 6976 3e0a 3c64 6976 2063 6c61 )
.
│ │ │ -001a5910: 2020 2020 3c61 2063 6c61 7373 3d22 636f soap_send_fa │ │ │ -001a5970: 756c 743c 2f61 3e28 3c61 2063 6c61 7373 ult(s │ │ │ -001a59a0: 6f61 703c 2f61 3e29 3b20 3c73 7061 6e20 oap); │ │ │ -001a59c0: 2f2f 2073 656e 6420 6661 756c 7420 746f // send fault to │ │ │ -001a59d0: 2063 6c69 656e 7420 3c2f 7370 616e 3e3c client < │ │ │ -001a59e0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
} │ │ │ -001a5a00: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
< │ │ │ -001a5a20: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -001a5a30: 6f72 6466 6c6f 7722 3e65 6c73 653c 2f73 ordflow">else i │ │ │ -001a5a60: 663c 2f73 7061 6e3e 2028 3c61 2063 6c61 f (soap->error │ │ │ -001a5af0: 2920 3c2f 6469 763e 0a3c 6469 7620 636c )
.
│ │ │ -001a5b10: 207b 3c2f 6469 763e 0a3c 6469 7620 636c {
.
│ │ │ -001a5b30: 2020 203c 6120 636c 6173 733d 2263 6f64 soap_send_fau │ │ │ -001a5b90: 6c74 3c2f 613e 283c 6120 636c 6173 733d lt(so │ │ │ -001a5bc0: 6170 3c2f 613e 293b 203c 7370 616e 2063 ap); / │ │ │ -001a5be0: 2f20 7365 6e64 2066 6175 6c74 2074 6f20 / send fault to │ │ │ -001a5bf0: 636c 6965 6e74 203c 2f73 7061 6e3e 3c2f client .
}.
}.
else < │ │ │ -001a5c80: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -001a5c90: 6f72 6466 6c6f 7722 3e69 663c 2f73 7061 ordflow">if (soap< │ │ │ -001a5cd0: 2f61 3e2d 2667 743b 3c61 2063 6c61 7373 /a>->errnum) // accept fai │ │ │ -001a5d50: 6c65 642c 2074 7279 2061 6761 696e 2061 led, try again a │ │ │ -001a5d60: 6674 6572 2031 2073 6563 6f6e 643c 2f73 fter 1 second
.
│ │ │ -001a5d90: 207b 3c2f 6469 763e 0a3c 6469 7620 636c {
.
│ │ │ -001a5db0: 203c 6120 636c 6173 733d 2263 6f64 6522 soap_print_f │ │ │ -001a5e10: 6175 6c74 3c2f 613e 283c 6120 636c 6173 ault( │ │ │ -001a5e40: 736f 6170 3c2f 613e 2c20 7374 6465 7272 soap, stderr │ │ │ -001a5e50: 293b 203c 2f64 6976 3e0a 3c64 6976 2063 );
.
│ │ │ -001a5e70: 2020 736c 6565 7028 3129 3b3c 2f64 6976 sleep(1);
.
}
│ │ │ -001a5ea0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
else.
{
│ │ │ -001a5f00: 0a3c 6469 7620 636c 6173 733d 226c 696e .
fprintf │ │ │ -001a5f20: 2873 7464 6572 722c 203c 7370 616e 2063 (stderr, "serve │ │ │ -001a5f50: 7220 7469 6d65 6420 6f75 745c 6e26 7175 r timed out\n&qu │ │ │ -001a5f60: 6f74 3b3c 2f73 7061 6e3e 293b 203c 2f64 ot;); .
break;
.
│ │ │ -001a5fd0: 207d 3c2f 6469 763e 0a3c 6469 7620 636c }
.
< │ │ │ -001a5ff0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -001a6000: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ -001a6010: 705f 5f63 6f6e 7465 7874 2e68 746d 6c23 p__context.html# │ │ │ -001a6020: 6761 6637 6430 3137 3631 3631 6539 6465 gaf7d0176161e9de │ │ │ -001a6030: 6633 3639 3831 6532 3466 6161 3139 3133 f36981e24faa1913 │ │ │ -001a6040: 6439 223e 736f 6170 5f64 6573 7472 6f79 d9">soap_destroy │ │ │ -001a6050: 3c2f 613e 283c 6120 636c 6173 733d 2263 (soap │ │ │ -001a6080: 3c2f 613e 293b 203c 2f64 6976 3e0a 3c64 );
. │ │ │ -001a60a0: 2020 2020 3c61 2063 6c61 7373 3d22 636f soap_en │ │ │ -001a6100: 643c 2f61 3e28 3c61 2063 6c61 7373 3d22 d(soa │ │ │ -001a6130: 703c 2f61 3e29 3b20 3c2f 6469 763e 0a3c p);
.< │ │ │ -001a6140: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -001a6150: 3e20 207d 3c2f 6469 763e 0a3c 6469 7620 > }
.
}.
soap │ │ │ -001a61e0: 5f64 6573 7472 6f79 3c2f 613e 283c 6120 _destroy(soap); < │ │ │ -001a6220: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.

This c │ │ │ -001a63a0: 6861 696e 696e 6720 6361 6e20 6265 2061 haining can be a │ │ │ -001a63b0: 7262 6974 7261 7269 6c79 2064 6565 702e rbitrarily deep. │ │ │ -001a63c0: 2057 6865 6e20 7468 6520 7072 6576 696f When the previo │ │ │ -001a63d0: 7573 2072 6571 7565 7374 2066 6169 6c73 us request fails │ │ │ -001a63e0: 2077 6974 6820 6120 3c63 6f64 653e 2353 with a #S │ │ │ -001a63f0: 4f41 505f 4e4f 5f4d 4554 484f 443c 2f63 OAP_NO_METHOD then next r │ │ │ -001a6410: 6571 7565 7374 2064 6973 7061 7463 6865 equest dispatche │ │ │ -001a6420: 7220 6361 6e20 6265 2074 7269 6564 2e3c r can be tried.< │ │ │ -001a6430: 2f70 3e0a 3c70 3e54 6865 2073 6572 7665 /p>.

The serve │ │ │ -001a6440: 7220 7368 6f75 6c64 2061 6c73 6f20 6465 r should also de │ │ │ -001a6450: 6669 6e65 2074 6865 2073 6572 7669 6365 fine the service │ │ │ -001a6460: 206f 7065 7261 7469 6f6e 733a 3c2f 703e operations:

│ │ │ -001a6470: 0a3c 6469 7620 636c 6173 733d 2266 7261 .
int ns │ │ │ -001a64c0: 5f5f 6765 7451 756f 7465 283c 7370 616e __getQuote(struct < │ │ │ -001a64f0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -001a6500: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ -001a6510: 6874 6d6c 223e 736f 6170 3c2f 613e 202a html">soap * │ │ │ -001a6520: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap, │ │ │ -001a6550: 203c 7370 616e 2063 6c61 7373 3d22 6b65 char< │ │ │ -001a6570: 2f73 7061 6e3e 202a 7379 6d62 6f6c 2c20 /span> *symbol, │ │ │ -001a6580: 3c73 7061 6e20 636c 6173 733d 226b 6579 float< │ │ │ -001a65a0: 2f73 7061 6e3e 202a 5265 7375 6c74 293b /span> *Result); │ │ │ -001a65b0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
{
.
*Result = │ │ │ -001a65f0: 2e2e 2e20 3b20 3c2f 6469 763e 0a3c 6469 ... ;
. │ │ │ -001a6610: 203c 7370 616e 2063 6c61 7373 3d22 6b65 retur │ │ │ -001a6630: 6e3c 2f73 7061 6e3e 203c 6120 636c 6173 n SOA │ │ │ -001a6690: 505f 4f4b 3c2f 613e 3b20 3c2f 6469 763e P_OK;
│ │ │ -001a66a0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
}
.
< │ │ │ -001a66d0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
int ns_ │ │ │ -001a6710: 5f67 6574 5261 7465 283c 7370 616e 2063 _getRate(s │ │ │ -001a6730: 7472 7563 743c 2f73 7061 6e3e 203c 6120 truct soap *soap, < │ │ │ -001a67a0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -001a67b0: 6f72 6474 7970 6522 3e63 6861 723c 2f73 ordtype">char *country1, │ │ │ -001a67d0: 3c73 7061 6e20 636c 6173 733d 226b 6579 char *country2, │ │ │ -001a6800: 203c 7370 616e 2063 6c61 7373 3d22 6b65 float │ │ │ -001a6820: 3c2f 7370 616e 3e20 2a52 6573 756c 7429 *Result) │ │ │ -001a6830: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
{.
*Result = │ │ │ -001a6870: 202e 2e2e 203b 203c 2f64 6976 3e0a 3c64 ... ;
. │ │ │ -001a6890: 2020 3c73 7061 6e20 636c 6173 733d 226b retu │ │ │ -001a68b0: 726e 3c2f 7370 616e 3e20 3c61 2063 6c61 rn SO │ │ │ -001a6910: 4150 5f4f 4b3c 2f61 3e3b 203c 2f64 6976 AP_OK;
.
}
.

However, t │ │ │ -001a6960: 6865 2077 6869 6c65 206c 6f6f 7020 6974 he while loop it │ │ │ -001a6970: 6572 6174 6573 2066 6f72 2065 6163 6820 erates for each │ │ │ -001a6980: 6e65 7720 636f 6e6e 6563 7469 6f6e 2074 new connection t │ │ │ -001a6990: 6861 7420 6973 2065 7374 6162 6c69 7368 hat is establish │ │ │ -001a69a0: 6564 2077 6974 6820 3c63 6f64 653e 3c61 ed with soap_acce │ │ │ -001a6a30: 7074 3c2f 613e 3c2f 636f 6465 3e20 616e pt an │ │ │ -001a6a40: 6420 646f 6573 206e 6f74 2061 6c6c 6f77 d does not allow │ │ │ -001a6a50: 2066 6f72 2048 5454 5020 6b65 6570 2d61 for HTTP keep-a │ │ │ -001a6a60: 6c69 7665 2063 6f6e 6e65 6374 696f 6e73 live connections │ │ │ -001a6a70: 2074 6f20 7065 7273 6973 742e 2046 6f72 to persist. For │ │ │ -001a6a80: 206f 7572 2066 696e 616c 2069 6d70 726f our final impro │ │ │ -001a6a90: 7665 6d65 6e74 2077 6520 7761 6e74 2074 vement we want t │ │ │ -001a6aa0: 6f20 7375 7070 6f72 7420 4854 5450 206b o support HTTP k │ │ │ -001a6ab0: 6565 702d 616c 6976 6520 636f 6e6e 6563 eep-alive connec │ │ │ -001a6ac0: 7469 6f6e 7320 7468 6174 2072 6571 7569 tions that requi │ │ │ -001a6ad0: 7265 206c 6f6f 7069 6e67 206f 7665 7220 re looping over │ │ │ -001a6ae0: 7468 6520 7365 7276 6963 6520 6469 7370 the service disp │ │ │ -001a6af0: 6174 6368 6573 2075 6e74 696c 2074 6865 atches until the │ │ │ -001a6b00: 2063 6f6e 6e65 6374 696f 6e20 636c 6f73 connection clos │ │ │ -001a6b10: 6573 206f 6e20 6569 7468 6572 2065 6e64 es on either end │ │ │ -001a6b20: 2c20 6166 7465 7220 7768 6963 6820 7765 , after which we │ │ │ -001a6b30: 2072 6573 756d 6520 7468 6520 6f75 7465 resume the oute │ │ │ -001a6b40: 7220 6c6f 6f70 2e20 5468 6520 7265 7375 r loop. The resu │ │ │ -001a6b50: 6c74 696e 6720 636f 6465 2069 7320 7665 lting code is ve │ │ │ -001a6b60: 7279 2063 6c6f 7365 2074 6f20 7468 6520 ry close to the │ │ │ -001a6b70: 736f 6170 6370 7032 2d67 656e 6572 6174 soapcpp2-generat │ │ │ -001a6b80: 6564 203c 636f 6465 3e3c 6120 636c 6173 ed soap_ser │ │ │ -001a6c00: 7665 3c2f 613e 3c2f 636f 6465 3e20 636f ve co │ │ │ -001a6c10: 6465 2061 6e64 2074 6865 203c 636f 6465 de and the serve se │ │ │ -001a6c30: 7276 6963 6520 636c 6173 7320 6d65 7468 rvice class meth │ │ │ -001a6c40: 6f64 732c 2077 6974 6820 7468 6520 6164 ods, with the ad │ │ │ -001a6c50: 6469 7469 6f6e 206f 6620 7468 6520 6368 dition of the ch │ │ │ -001a6c60: 6169 6e20 6f66 2073 6572 7669 6365 2064 ain of service d │ │ │ -001a6c70: 6973 7061 7463 6865 7320 696e 2074 6865 ispatches in the │ │ │ -001a6c80: 206c 6f6f 7020 626f 6479 3a3c 2f70 3e0a loop body:

. │ │ │ -001a6c90: 3c64 6976 2063 6c61 7373 3d22 6672 6167
#include &quo │ │ │ -001a6ce0: 743b 7175 6f74 6548 2e68 2671 756f 743b t;quoteH.h" │ │ │ -001a6cf0: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ -001a6d10: 3c73 7061 6e20 636c 6173 733d 2270 7265 #incl │ │ │ -001a6d30: 7564 6520 2671 756f 743b 7261 7465 482e ude "rateH. │ │ │ -001a6d40: 6826 7175 6f74 3b3c 2f73 7061 6e3e 3c2f h".
#include " │ │ │ -001a6d90: 3b71 756f 7465 2e6e 736d 6170 2671 756f ;quote.nsmap&quo │ │ │ -001a6da0: 743b 3c2f 7370 616e 3e3c 2f64 6976 3e0a t;
. │ │ │ -001a6db0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
#in │ │ │ -001a6de0: 636c 7564 6520 2671 756f 743b 7261 7465 clude "rate │ │ │ -001a6df0: 2e6e 736d 6170 2671 756f 743b 3c2f 7370 .nsmap"
.
.
stru │ │ │ -001a6e50: 6374 203c 2f73 7061 6e3e 3c61 2063 6c61 ct soap *soap = soap_new() │ │ │ -001a6f20: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
if ( │ │ │ -001a6f60: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap_valid_soc │ │ │ -001a6fc0: 6b65 743c 2f61 3e28 3c61 2063 6c61 7373 ket(soap_bin │ │ │ -001a7020: 643c 2f61 3e28 3c61 2063 6c61 7373 3d22 d(soa │ │ │ -001a7050: 703c 2f61 3e2c 204e 554c 4c2c 2038 3038 p, NULL, 808 │ │ │ -001a7060: 302c 2031 3029 2929 203c 7370 616e 2063 0, 10))) / │ │ │ -001a7080: 2f20 736d 616c 6c20 4241 434b 4c4f 4720 / small BACKLOG │ │ │ -001a7090: 666f 7220 6974 6572 6174 6976 6520 7365 for iterative se │ │ │ -001a70a0: 7276 6572 733c 2f73 7061 6e3e 3c2f 6469 rvers.
{
. │ │ │ -001a70e0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 while │ │ │ -001a7100: 3c2f 7370 616e 3e20 2831 293c 2f64 6976 (1)
.
{
. │ │ │ -001a7140: 2020 2020 3c73 7061 6e20 636c 6173 733d if │ │ │ -001a7160: 3c2f 7370 616e 3e20 283c 6120 636c 6173 (soap_ │ │ │ -001a71c0: 7661 6c69 645f 736f 636b 6574 3c2f 613e valid_socket │ │ │ -001a71d0: 283c 6120 636c 6173 733d 2263 6f64 6522 (soap_accept │ │ │ -001a7230: 283c 6120 636c 6173 733d 2263 6f64 6522 (soap │ │ │ -001a7260: 2929 293c 2f64 6976 3e0a 3c64 6976 2063 )))
.
│ │ │ -001a7280: 7b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 {
.
│ │ │ -001a72a0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap- │ │ │ -001a72d0: 2667 743b 3c61 2063 6c61 7373 3d22 636f >kee │ │ │ -001a7320: 705f 616c 6976 653c 2f61 3e20 3d20 3c61 p_alive = soap-&g │ │ │ -001a7360: 743b 3c61 2063 6c61 7373 3d22 636f 6465 t;max_k │ │ │ -001a73b0: 6565 705f 616c 6976 653c 2f61 3e20 2b20 eep_alive + │ │ │ -001a73c0: 313b 203c 7370 616e 2063 6c61 7373 3d22 1; // max │ │ │ -001a73e0: 6b65 6570 2d61 6c69 7665 2069 7465 7261 keep-alive itera │ │ │ -001a73f0: 7469 6f6e 733c 2f73 7061 6e3e 3c2f 6469 tions.
do.
{.
< │ │ │ -001a7480: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -001a7490: 6f72 6466 6c6f 7722 3e69 663c 2f73 7061 ordflow">if ((soap │ │ │ -001a74d0: 3c2f 613e 2d26 6774 3b3c 6120 636c 6173 ->keep_alive │ │ │ -001a7530: 2026 6774 3b20 3029 2026 616d 703b 2661 > 0) &&a │ │ │ -001a7540: 6d70 3b20 283c 6120 636c 6173 733d 2263 mp; (soap │ │ │ -001a7570: 3c2f 613e 2d26 6774 3b3c 6120 636c 6173 ->max_keep_alive │ │ │ -001a75d0: 3c2f 613e 2026 6774 3b20 3029 293c 2f64 > 0)).
│ │ │ -001a7600: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap- │ │ │ -001a7630: 2667 743b 3c61 2063 6c61 7373 3d22 636f >kee │ │ │ -001a7680: 705f 616c 6976 653c 2f61 3e2d 2d3b 3c2f p_alive--;.
< │ │ │ -001a76b0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -001a76c0: 6f72 6466 6c6f 7722 3e69 663c 2f73 7061 ordflow">if (soap_begin_s │ │ │ -001a7730: 6572 7665 3c2f 613e 283c 6120 636c 6173 erve( │ │ │ -001a7760: 736f 6170 3c2f 613e 2929 3c2f 6469 763e soap))
│ │ │ -001a7770: 0a3c 6469 7620 636c 6173 733d 226c 696e ..
break; │ │ │ -001a7a00: 2020 2020 2020 2020 2020 2020 203c 7370 // an error o │ │ │ -001a7a30: 6363 7572 7265 643c 2f73 7061 6e3e 3c2f ccurred.
} │ │ │ -001a7a60: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ -001a7a80: 203c 6120 636c 6173 733d 2263 6f64 6522 soap_set │ │ │ -001a7ae0: 5f6e 616d 6573 7061 6365 733c 2f61 3e28 _namespaces( │ │ │ -001a7af0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap, │ │ │ -001a7b20: 2071 756f 7465 5f6e 616d 6573 7061 6365 quote_namespace │ │ │ -001a7b30: 7329 3b3c 2f64 6976 3e0a 3c64 6976 2063 s);
.
│ │ │ -001a7b50: 2020 2020 3c73 7061 6e20 636c 6173 733d if │ │ │ -001a7b70: 3c2f 7370 616e 3e20 2871 756f 7465 5f73 (quote_s │ │ │ -001a7b80: 6572 7665 5f72 6571 7565 7374 283c 6120 erve_request(soap) == │ │ │ -001a7bc0: 203c 6120 636c 6173 733d 2263 6f64 6522 SOAP_NO_MET │ │ │ -001a7c20: 484f 443c 2f61 3e29 203c 2f64 6976 3e0a HOD)
. │ │ │ -001a7c30: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
{
.
soap_set_na │ │ │ -001a7cd0: 6d65 7370 6163 6573 3c2f 613e 283c 6120 mespaces(soap, ra │ │ │ -001a7d10: 7465 5f6e 616d 6573 7061 6365 7329 3b3c te_namespaces);< │ │ │ -001a7d20: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ -001a7d40: 2020 3c73 7061 6e20 636c 6173 733d 226b if (rate_serv │ │ │ -001a7d70: 655f 7265 7175 6573 7428 3c61 2063 6c61 e_request(soap))
..
} ..
│ │ │ -001a7fd0: 2020 207b 3c2f 6469 763e 0a3c 6469 7620 {
.
│ │ │ -001a7ff0: 2020 2020 2020 203c 6120 636c 6173 733d soap_send │ │ │ -001a8050: 5f66 6175 6c74 3c2f 613e 283c 6120 636c _fault(soap); // send fault │ │ │ -001a80b0: 2074 6f20 636c 6965 6e74 203c 2f73 7061 to client
.
│ │ │ -001a80e0: 2020 207d 3c2f 6469 763e 0a3c 6469 7620 }
.
│ │ │ -001a8100: 2020 2020 203c 6120 636c 6173 733d 2263 soap_d │ │ │ -001a8160: 6573 7472 6f79 3c2f 613e 283c 6120 636c estroy(soap); .
soap_end( │ │ │ -001a8220: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap) │ │ │ -001a8250: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
│ │ │ -001a8270: 207d 203c 7370 616e 2063 6c61 7373 3d22 } whi │ │ │ -001a8290: 6c65 3c2f 7370 616e 3e20 283c 6120 636c le (soap->< │ │ │ -001a82d0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -001a82e0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ -001a82f0: 6874 6d6c 2361 3364 3933 6261 3936 3862 html#a3d93ba968b │ │ │ -001a8300: 6235 3833 3733 6635 3838 3431 3737 6137 b58373f5884177a7 │ │ │ -001a8310: 6563 3064 3833 223e 6b65 6570 5f61 6c69 ec0d83">keep_ali │ │ │ -001a8320: 7665 3c2f 613e 293b 3c2f 6469 763e 0a3c ve);
.< │ │ │ -001a8330: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -001a8340: 3e20 2020 207d 3c2f 6469 763e 0a3c 6469 > }
. │ │ │ -001a8360: 2020 203c 7370 616e 2063 6c61 7373 3d22 els │ │ │ -001a8380: 653c 2f73 7061 6e3e 203c 7370 616e 2063 e if (soap-&g │ │ │ -001a83e0: 743b 3c61 2063 6c61 7373 3d22 636f 6465 t;errnu │ │ │ -001a8430: 6d3c 2f61 3e29 203c 7370 616e 2063 6c61 m) // │ │ │ -001a8450: 6163 6365 7074 2066 6169 6c65 642c 2074 accept failed, t │ │ │ -001a8460: 7279 2061 6761 696e 2061 6674 6572 2031 ry again after 1 │ │ │ -001a8470: 2073 6563 6f6e 643c 2f73 7061 6e3e 3c2f second.
{..
│ │ │ -001a8620: 2020 2066 7072 696e 7466 2873 7464 6572 fprintf(stder │ │ │ -001a8630: 722c 203c 7370 616e 2063 6c61 7373 3d22 r, & │ │ │ -001a8650: 7175 6f74 3b73 6572 7665 7220 7469 6d65 quot;server time │ │ │ -001a8660: 6420 6f75 745c 6e26 7175 6f74 3b3c 2f73 d out\n");
. │ │ │ -001a8690: 2020 2020 2020 3c73 7061 6e20 636c 6173 │ │ │ -001a86b0: 6272 6561 6b3c 2f73 7061 6e3e 3b20 3c2f break; .
}.
so │ │ │ -001a8750: 6170 5f64 6573 7472 6f79 3c2f 613e 283c ap_destroy(< │ │ │ -001a8760: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -001a8770: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ -001a8780: 6874 6d6c 223e 736f 6170 3c2f 613e 293b html">soap); │ │ │ -001a8790: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
soap_end( │ │ │ -001a8810: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap) │ │ │ -001a8840: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
}.
}
.< │ │ │ -001a8880: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -001a8890: 3e3c 6120 636c 6173 733d 2263 6f64 6522 >soap_destr │ │ │ -001a88f0: 6f79 3c2f 613e 283c 6120 636c 6173 733d oy(so │ │ │ -001a8920: 6170 3c2f 613e 293b 203c 2f64 6976 3e0a ap);
. │ │ │ -001a8930: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65 .< │ │ │ -001a89f0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -001a8a00: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ -001a8a10: 705f 5f63 6f6e 7465 7874 2e68 746d 6c23 p__context.html# │ │ │ -001a8a20: 6761 3537 3130 3863 6134 3638 3131 3836 ga57108ca4681186 │ │ │ -001a8a30: 6535 3862 3562 3138 3963 3335 3238 6631 e58b5b189c3528f1 │ │ │ -001a8a40: 3061 223e 736f 6170 5f66 7265 653c 2f61 0a">soap_free(soap);
.
│ │ │ -001a8a90: 3c21 2d2d 2066 7261 676d 656e 7420 2d2d

wh │ │ │ -001aa360: 6572 6520 7468 6520 3c63 6f64 653e 6e61 ere the na │ │ │ -001aa370: 6d65 7370 6163 6573 5b5d 3c2f 636f 6465 mespaces[] table should b │ │ │ -001aa390: 6520 6465 6669 6e65 6420 696e 2074 6865 e defined in the │ │ │ -001aa3a0: 2063 6c69 656e 742f 7365 7276 6572 2073 client/server s │ │ │ -001aa3b0: 6f75 7263 652e 2054 6865 7365 2074 6162 ource. These tab │ │ │ -001aa3c0: 6c65 7320 6172 6520 6765 6e65 7261 7465 les are generate │ │ │ -001aa3d0: 6420 696e 2074 6865 203c 656d 3e3c 636f d in the .nsmap │ │ │ -001aa3f0: 3c2f 656d 3e20 6669 6c65 732e 2054 6865 files. The │ │ │ -001aa400: 2074 6162 6c65 7320 6172 6520 7265 6e61 tables are rena │ │ │ -001aa410: 6d65 6420 666f 7220 636f 6e76 656e 6965 med for convenie │ │ │ -001aa420: 6e63 6520 7573 696e 6720 3c62 3e3c 636f nce using soapcpp2 -n option │ │ │ -001aa450: 203c 623e 3c63 6f64 653e 2d6e 3c2f 636f -n, see Sec │ │ │ -001aa470: 7469 6f6e 203c 6120 636c 6173 733d 2265 tion soapcpp2 op │ │ │ -001aa4b0: 7469 6f6e 733c 2f61 3e20 2e3c 2f70 3e0a tions .

. │ │ │ -001aa4c0: 3c70 3ef0 9f94 9d20 3c61 2068 7265 663d

.... Back to tabl │ │ │ -001aa4e0: 6520 6f66 2063 6f6e 7465 6e74 733c 2f61 e of contents

.

.How │ │ │ -001aa520: 2074 6f20 6275 696c 6420 6d6f 6475 6c65 to build module │ │ │ -001aa530: 7320 616e 6420 6c69 6272 6172 6965 7320 s and libraries │ │ │ -001aa540: 7769 7468 2074 6865 2023 6d6f 6475 6c65 with the #module │ │ │ -001aa550: 2064 6972 6563 7469 7665 3c2f 6832 3e0a directive

. │ │ │ -001aa560: 3c70 3e54 6865 203c 636f 6465 3e23 6d6f

The #mo │ │ │ -001aa570: 6475 6c65 3c2f 636f 6465 3e20 6469 7265 dule dire │ │ │ -001aa580: 6374 6976 6520 6973 2075 7365 6420 746f ctive is used to │ │ │ -001aa590: 2062 7569 6c64 206d 6f64 756c 6573 2077 build modules w │ │ │ -001aa5a0: 6974 6820 736f 6170 6370 7032 2e20 4120 ith soapcpp2. A │ │ │ -001aa5b0: 6c69 6272 6172 7920 6361 6e20 6265 2062 library can be b │ │ │ -001aa5c0: 7569 6c74 2066 726f 6d20 6120 6d6f 6475 uilt from a modu │ │ │ -001aa5d0: 6c65 2061 6e64 206c 696e 6b65 6420 7769 le and linked wi │ │ │ -001aa5e0: 7468 206d 756c 7469 706c 6520 5765 6220 th multiple Web │ │ │ -001aa5f0: 7365 7276 6963 6573 2061 7070 6c69 6361 services applica │ │ │ -001aa600: 7469 6f6e 732e 2054 6865 2064 6972 6563 tions. The direc │ │ │ -001aa610: 7469 7665 2073 686f 756c 6420 6170 7065 tive should appe │ │ │ -001aa620: 6172 2061 7420 7468 6520 746f 7020 6f66 ar at the top of │ │ │ -001aa630: 2074 6865 2069 6e74 6572 6661 6365 2068 the interface h │ │ │ -001aa640: 6561 6465 7220 6669 6c65 2066 6f72 2073 eader file for s │ │ │ -001aa650: 6f61 7063 7070 3220 616e 6420 6861 7320 oapcpp2 and has │ │ │ -001aa660: 7468 6520 666f 6c6c 6f77 696e 6720 666f the following fo │ │ │ -001aa670: 726d 6174 733a 3c2f 703e 0a3c 6469 7620 rmats:

.
#m │ │ │ -001aa6c0: 6f64 756c 6520 2671 756f 743b 6e61 6d65 odule "name │ │ │ -001aa6d0: 2671 756f 743b 3c2f 7370 616e 3e20 3c2f " .

a │ │ │ -001aa700: 6e64 3c2f 703e 0a3c 6469 7620 636c 6173 nd

.
< │ │ │ -001aa730: 7370 616e 2063 6c61 7373 3d22 7072 6570 span class="prep │ │ │ -001aa740: 726f 6365 7373 6f72 223e 236d 6f64 756c rocessor">#modul │ │ │ -001aa750: 6520 2671 756f 743b 6e61 6d65 2671 756f e "name&quo │ │ │ -001aa760: 743b 3c2f 7370 616e 3e20 2671 756f 743b t; " │ │ │ -001aa770: 6675 6c6c 6e61 6d65 2671 756f 743b 3c2f fullname".

w │ │ │ -001aa7a0: 6865 7265 2074 6865 203c 636f 6465 3e6e here the n │ │ │ -001aa7b0: 616d 653c 2f63 6f64 653e 206d 7573 7420 ame must │ │ │ -001aa7c0: 6265 2061 2075 6e69 7175 6520 7368 6f72 be a unique shor │ │ │ -001aa7d0: 7420 6e61 6d65 2066 6f72 2074 6865 206d t name for the m │ │ │ -001aa7e0: 6f64 756c 652e 2054 6865 206e 616d 6520 odule. The name │ │ │ -001aa7f0: 6973 2063 6173 6520 696e 7365 6e73 6974 is case insensit │ │ │ -001aa800: 6976 6520 616e 6420 6d75 7374 206e 6f74 ive and must not │ │ │ -001aa810: 2065 7863 6565 6420 3420 6368 6172 6163 exceed 4 charac │ │ │ -001aa820: 7465 7273 2069 6e20 6c65 6e67 7468 2e20 ters in length. │ │ │ -001aa830: 5468 6520 3c63 6f64 653e 6675 6c6c 6e61 The fullna │ │ │ -001aa840: 6d65 3c2f 636f 6465 3e2c 2077 6865 6e20 me, when │ │ │ -001aa850: 7072 6573 656e 742c 2072 6570 7265 7365 present, represe │ │ │ -001aa860: 6e74 7320 7468 6520 6675 6c6c 206e 616d nts the full nam │ │ │ -001aa870: 6520 6f66 2074 6865 206d 6f64 756c 6520 e of the module │ │ │ -001aa880: 616e 6420 6973 2075 7365 6420 746f 2070 and is used to p │ │ │ -001aa890: 7265 6669 7820 7468 6520 6675 6e63 7469 refix the functi │ │ │ -001aa8a0: 6f6e 206e 616d 6573 206f 6620 7468 6520 on names of the │ │ │ -001aa8b0: 6765 6e65 7261 7465 6420 7365 7269 616c generated serial │ │ │ -001aa8c0: 697a 6572 7320 7265 706c 6163 696e 6720 izers replacing │ │ │ -001aa8d0: 7468 6520 7573 7561 6c20 3c63 6f64 653e the usual │ │ │ -001aa8e0: 736f 6170 3c2f 636f 6465 3e20 7072 6566 soap pref │ │ │ -001aa8f0: 6978 2e20 4966 2061 6273 656e 742c 2074 ix. If absent, t │ │ │ -001aa900: 6865 2073 686f 7274 206e 616d 6520 6973 he short name is │ │ │ -001aa910: 2075 7365 6420 746f 2070 7265 6669 7820 used to prefix │ │ │ -001aa920: 7468 6520 6675 6e63 7469 6f6e 206e 616d the function nam │ │ │ -001aa930: 6573 206f 6620 7468 6520 7365 7269 616c es of the serial │ │ │ -001aa940: 697a 6572 732e 3c2f 703e 0a3c 703e 5468 izers.

.

Th │ │ │ -001aa950: 6520 7265 7374 206f 6620 7468 6520 636f e rest of the co │ │ │ -001aa960: 6e74 656e 7420 6f66 2074 6865 2069 6e74 ntent of the int │ │ │ -001aa970: 6572 6661 6365 2068 6561 6465 7220 6669 erface header fi │ │ │ -001aa980: 6c65 2069 6e63 6c75 6465 7320 7479 7065 le includes type │ │ │ -001aa990: 2064 6563 6c61 7261 7469 6f6e 7320 616e declarations an │ │ │ -001aa9a0: 6420 6f70 7469 6f6e 616c 6c79 2074 6865 d optionally the │ │ │ -001aa9b0: 2064 6563 6c61 7261 7469 6f6e 7320 6f66 declarations of │ │ │ -001aa9c0: 2073 6572 7669 6365 206f 7065 7261 7469 service operati │ │ │ -001aa9d0: 6f6e 7320 616e 6420 534f 4150 2048 6561 ons and SOAP Hea │ │ │ -001aa9e0: 6465 7273 2061 6e64 2046 6175 6c74 7320 ders and Faults │ │ │ -001aa9f0: 7468 6174 2061 7265 2075 6e69 7665 7273 that are univers │ │ │ -001aaa00: 616c 6c79 2075 7365 6420 6279 2053 4f41 ally used by SOA │ │ │ -001aaa10: 5020 7365 7276 6963 6573 2c20 7768 656e P services, when │ │ │ -001aaa20: 2061 7070 6c69 6361 626c 652e 2057 6865 applicable. Whe │ │ │ -001aaa30: 6e20 7468 6520 736f 6170 6370 7032 2074 n the soapcpp2 t │ │ │ -001aaa40: 6f6f 6c20 7072 6f63 6573 7365 7320 7468 ool processes th │ │ │ -001aaa50: 6520 6865 6164 6572 2066 696c 6520 6d6f e header file mo │ │ │ -001aaa60: 6475 6c65 2c20 6974 2077 696c 6c20 6765 dule, it will ge │ │ │ -001aaa70: 6e65 7261 7465 2074 6865 2073 6f75 7263 nerate the sourc │ │ │ -001aaa80: 6520 636f 6465 7320 666f 7220 6120 6c69 e codes for a li │ │ │ -001aaa90: 6272 6172 792e 2054 6865 2057 6562 2073 brary. The Web s │ │ │ -001aaaa0: 6572 7669 6365 7320 6170 706c 6963 6174 ervices applicat │ │ │ -001aaab0: 696f 6e20 7468 6174 2075 7365 7320 7468 ion that uses th │ │ │ -001aaac0: 6520 6c69 6272 6172 7920 7368 6f75 6c64 e library should │ │ │ -001aaad0: 2075 7365 2061 2068 6561 6465 7220 6669 use a header fi │ │ │ -001aaae0: 6c65 2074 6861 7420 696d 706f 7274 7320 le that imports │ │ │ -001aaaf0: 7468 6520 6d6f 6475 6c65 2077 6974 6820 the module with │ │ │ -001aab00: 7468 6520 3c63 6f64 653e 2369 6d70 6f72 the #impor │ │ │ -001aab10: 743c 2f63 6f64 653e 2064 6972 6563 7469 t directi │ │ │ -001aab20: 7665 2c20 666f 7220 6578 616d 706c 653a ve, for example: │ │ │ -001aab30: 3c2f 703e 0a3c 6469 7620 636c 6173 733d

.
/* Contents o │ │ │ -001aab80: 6620 6669 6c65 2026 7175 6f74 3b6d 6f64 f file "mod │ │ │ -001aab90: 756c 652e 6826 7175 6f74 3b20 2a2f 3c2f ule.h" */
.< │ │ │ -001aabc0: 7370 616e 2063 6c61 7373 3d22 7072 6570 span class="prep │ │ │ -001aabd0: 726f 6365 7373 6f72 223e 236d 6f64 756c rocessor">#modul │ │ │ -001aabe0: 6520 2671 756f 743b 7465 7374 2671 756f e "test&quo │ │ │ -001aabf0: 743b 3c2f 7370 616e 3e3c 2f64 6976 3e0a t;
. │ │ │ -001aac00: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
.
// types and t │ │ │ -001aac50: 7970 6564 6566 7320 6265 636f 6d65 206d ypedefs become m │ │ │ -001aac60: 6f64 756c 652d 7370 6563 6966 6963 3c2f odule-specific
.
typedef LONG64 │ │ │ -001aad10: 7873 645f 5f6c 6f6e 673b 3c2f 6469 763e xsd__long;
│ │ │ -001aad20: 0a3c 6469 7620 636c 6173 733d 226c 696e .
cha │ │ │ -001aad50: 723c 2f73 7061 6e3e 2a3b 3c2f 6469 763e r*;
│ │ │ -001aad60: 0a3c 6469 7620 636c 6173 733d 226c 696e .
.
// a module-s │ │ │ -001aadb0: 7065 6369 6669 6320 7374 7275 6374 3c2f pecific struct
.
struct ns__S
.< │ │ │ -001aae10: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -001aae20: 3e7b 3c2f 6469 763e 0a3c 6469 7620 636c >{
.
. │ │ │ -001aae40: 2e2e 203c 7370 616e 2063 6c61 7373 3d22 .. // memb │ │ │ -001aae60: 6572 733c 2f73 7061 6e3e 3c2f 6469 763e ers
│ │ │ -001aae70: 0a3c 6469 7620 636c 6173 733d 226c 696e .
};
.

The module.h data bi │ │ │ -001aaed0: 6e64 696e 6720 696e 7465 7266 6163 6520 nding interface │ │ │ -001aaee0: 6865 6164 6572 2066 696c 6520 666f 7220 header file for │ │ │ -001aaef0: 736f 6170 6370 7032 2064 6563 6c61 7265 soapcpp2 declare │ │ │ -001aaf00: 7320 6d6f 6475 6c65 2d73 7065 6369 6669 s module-specifi │ │ │ -001aaf10: 6320 7365 7269 616c 697a 6162 6c65 2074 c serializable t │ │ │ -001aaf20: 7970 6573 203c 636f 6465 3e4c 4f4e 4736 ypes LONG6 │ │ │ -001aaf30: 343c 2f63 6f64 653e 2c20 3c63 6f64 653e 4, │ │ │ -001aaf40: 7873 645f 5f6c 6f6e 673c 2f63 6f64 653e xsd__long │ │ │ -001aaf50: 2c20 3c63 6f64 653e 6368 6172 2a3c 2f63 , char*, and a struct ns__S. The modul │ │ │ -001aaf90: 6520 6e61 6d65 2069 7320 2274 6573 7422 e name is "test" │ │ │ -001aafa0: 2c20 736f 2074 6865 2073 6f61 7063 7070 , so the soapcpp │ │ │ -001aafb0: 3220 746f 6f6c 2070 726f 6475 6365 7320 2 tool produces │ │ │ -001aafc0: 6120 3c65 6d3e 3c63 6f64 653e 7465 7374 a test │ │ │ -001aafd0: 432e 6370 703c 2f63 6f64 653e 3c2f 656d C.cpp file with the │ │ │ -001aaff0: 584d 4c20 7365 7269 616c 697a 6572 7320 XML serializers │ │ │ -001ab000: 666f 7220 7468 6573 6520 7479 7065 732e for these types. │ │ │ -001ab010: 2054 6865 203c 656d 3e3c 636f 6465 3e74 The t │ │ │ -001ab020: 6573 7443 2e63 7070 3c2f 636f 6465 3e3c estC.cpp< │ │ │ -001ab030: 2f65 6d3e 2064 6174 6120 6269 6e64 696e /em> data bindin │ │ │ -001ab040: 6720 696d 706c 656d 656e 7461 7469 6f6e g implementation │ │ │ -001ab050: 2073 6f75 7263 6520 636f 6465 2063 616e source code can │ │ │ -001ab060: 2062 6520 7365 7061 7261 7465 6c79 2063 be separately c │ │ │ -001ab070: 6f6d 7069 6c65 6420 616e 6420 6c69 6e6b ompiled and link │ │ │ -001ab080: 6564 2077 6974 6820 616e 2061 7070 6c69 ed with an appli │ │ │ -001ab090: 6361 7469 6f6e 2e20 4966 2073 6572 7669 cation. If servi │ │ │ -001ab0a0: 6365 206f 7065 7261 7469 6f6e 7320 6172 ce operations ar │ │ │ -001ab0b0: 6520 6465 636c 6172 6564 2069 6e20 7468 e declared in th │ │ │ -001ab0c0: 6520 696e 7465 7266 6163 6520 6865 6164 e interface head │ │ │ -001ab0d0: 6572 2066 696c 6520 6173 2066 756e 6374 er file as funct │ │ │ -001ab0e0: 696f 6e20 7072 6f74 6f74 7970 6573 2c20 ion prototypes, │ │ │ -001ab0f0: 7765 2061 6c73 6f20 6765 7420 3c65 6d3e we also get │ │ │ -001ab100: 3c63 6f64 653e 7465 7374 436c 6965 6e74 testClient │ │ │ -001ab110: 2e63 7070 3c2f 636f 6465 3e3c 2f65 6d3e .cpp │ │ │ -001ab120: 2063 6c69 656e 7420 7374 7562 2066 756e client stub fun │ │ │ -001ab130: 6374 696f 6e73 2061 6e64 203c 656d 3e3c ctions and < │ │ │ -001ab140: 636f 6465 3e74 6573 7453 6572 7665 722e code>testServer. │ │ │ -001ab150: 6370 703c 2f63 6f64 653e 3c2f 656d 3e20 cpp │ │ │ -001ab160: 7365 7276 6572 2073 6b65 6c65 746f 6e20 server skeleton │ │ │ -001ab170: 6675 6e63 7469 6f6e 732e 3c2f 703e 0a3c functions.

.< │ │ │ -001ab180: 703e 5468 6572 6520 6172 6520 736f 6d65 p>There are some │ │ │ -001ab190: 206c 696d 6974 6174 696f 6e73 2066 6f72 limitations for │ │ │ -001ab1a0: 206d 6f64 756c 6520 696d 706f 7274 733a module imports: │ │ │ -001ab1b0: 3c2f 703e 0a3c 756c 3e0a 3c6c 693e 4120

.
    .
  • A │ │ │ -001ab1c0: 6d6f 6475 6c65 206d 7573 7420 6265 2069 module must be i │ │ │ -001ab1d0: 6d70 6f72 7465 6420 696e 746f 2061 6e6f mported into ano │ │ │ -001ab1e0: 7468 6572 2069 6e74 6572 6661 6365 2068 ther interface h │ │ │ -001ab1f0: 6561 6465 7220 746f 2075 7365 2074 6865 eader to use the │ │ │ -001ab200: 206d 6f64 756c 6527 7320 7479 7065 2064 module's type d │ │ │ -001ab210: 6566 696e 6974 696f 6e73 2e3c 2f6c 693e efinitions.
  • │ │ │ -001ab220: 0a3c 6c69 3e57 6865 6e20 6d75 6c74 6970 .
  • When multip │ │ │ -001ab230: 6c65 206d 6f64 756c 6573 2061 7265 2069 le modules are i │ │ │ -001ab240: 6d70 6f72 7465 642c 2074 6865 2074 7970 mported, the typ │ │ │ -001ab250: 6573 2074 6861 7420 7468 6579 2064 6563 es that they dec │ │ │ -001ab260: 6c61 7265 206d 7573 7420 6265 2064 6563 lare must be dec │ │ │ -001ab270: 6c61 7265 6420 696e 206f 6e65 206d 6f64 lared in one mod │ │ │ -001ab280: 756c 6520 6f6e 6c79 2074 6f20 6176 6f69 ule only to avoi │ │ │ -001ab290: 6420 6e61 6d65 2063 6c61 7368 6573 2061 d name clashes a │ │ │ -001ab2a0: 6e64 206c 696e 6b20 6572 726f 7273 2e20 nd link errors. │ │ │ -001ab2b0: 596f 7520 6361 6e6e 6f74 2063 7265 6174 You cannot creat │ │ │ -001ab2c0: 6520 7477 6f20 6d6f 6475 6c65 7320 7468 e two modules th │ │ │ -001ab2d0: 6174 2064 6563 6c61 7265 206f 7220 7573 at declare or us │ │ │ -001ab2e0: 6520 7468 6520 7361 6d65 2074 7970 6520 e the same type │ │ │ -001ab2f0: 616e 6420 696d 706f 7274 2074 6865 7365 and import these │ │ │ -001ab300: 206d 6f64 756c 6573 2073 6570 6172 6174 modules separat │ │ │ -001ab310: 656c 7920 696e 746f 2061 6e6f 7468 6572 ely into another │ │ │ -001ab320: 2068 6561 6465 7220 6669 6c65 2e20 5768 header file. Wh │ │ │ -001ab330: 656e 2075 7369 6e67 206d 6f64 756c 6573 en using modules │ │ │ -001ab340: 2c20 636f 6e73 6964 6572 2063 7265 6174 , consider creat │ │ │ -001ab350: 696e 6720 6120 6d6f 6475 6c65 2068 6965 ing a module hie │ │ │ -001ab360: 7261 7263 6879 2073 7563 6820 7468 6174 rarchy such that │ │ │ -001ab370: 2074 7970 6573 2061 7265 2064 6563 6c61 types are decla │ │ │ -001ab380: 7265 6420 6f6e 6c79 206f 6e63 6520 616e red only once an │ │ │ -001ab390: 6420 6279 206f 6e6c 7920 6f6e 6520 6d6f d by only one mo │ │ │ -001ab3a0: 6475 6c65 2077 6865 6e20 7468 6573 6520 dule when these │ │ │ -001ab3b0: 6d6f 6475 6c65 7320 6d75 7374 2062 6520 modules must be │ │ │ -001ab3c0: 6c69 6e6b 6564 2e3c 2f6c 693e 0a3c 2f75 linked.
  • ..

    With modul │ │ │ -001ab3e0: 6573 2c20 7468 6520 736f 7572 6365 2063 es, the source c │ │ │ -001ab3f0: 6f64 6520 7365 7269 616c 697a 6572 7320 ode serializers │ │ │ -001ab400: 666f 7220 7468 6520 7479 7065 7320 6465 for the types de │ │ │ -001ab410: 6669 6e65 6420 696e 2074 6865 206d 6f64 fined in the mod │ │ │ -001ab420: 756c 6573 2061 7265 2067 656e 6572 6174 ules are generat │ │ │ -001ab430: 6564 2077 6974 6820 736f 6170 6370 7032 ed with soapcpp2 │ │ │ -001ab440: 2073 6570 6172 6174 656c 792e 2046 6f72 separately. For │ │ │ -001ab450: 2065 7861 6d70 6c65 2c20 6173 7375 6d65 example, assume │ │ │ -001ab460: 2074 6861 7420 7765 2068 6176 6520 6120 that we have a │ │ │ -001ab470: 6d6f 6475 6c65 203c 656d 3e3c 636f 6465 module module.h │ │ │ -001ab490: 3c2f 656d 3e3a 3c2f 703e 0a3c 6469 7620 :

    .
    /* Cont │ │ │ -001ab4e0: 656e 7473 206f 6620 6669 6c65 2026 7175 ents of file &qu │ │ │ -001ab4f0: 6f74 3b6d 6f64 756c 652e 6826 7175 6f74 ot;module.h" │ │ │ -001ab500: 3b20 2a2f 3c2f 7370 616e 3e3c 2f64 6976 ; */
    .
    # │ │ │ -001ab540: 6d6f 6475 6c65 2026 7175 6f74 3b74 6573 module "tes │ │ │ -001ab550: 7426 7175 6f74 3b3c 2f73 7061 6e3e 3c2f t".
    .< │ │ │ -001ab580: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -001ab590: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >struct ns__S
    │ │ │ -001ab5c0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    {
    .
    │ │ │ -001ab5f0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 char< │ │ │ -001ab610: 2f73 7061 6e3e 202a 6e61 6d65 3b3c 2f64 /span> *name;.
    int a │ │ │ -001ab660: 6d6f 756e 743b 3c2f 6469 763e 0a3c 6469 mount;
    .} │ │ │ -001ab680: 3b3c 2f64 6976 3e0a 3c2f 6469 763e 3c21 ;
    .
    < │ │ │ -001ab6a0: 703e 616e 6420 6120 6865 6164 6572 2066 p>and a header f │ │ │ -001ab6b0: 696c 6520 3c65 6d3e 3c63 6f64 653e 6578 ile ex │ │ │ -001ab6c0: 616d 706c 652e 683c 2f63 6f64 653e 3c2f ample.h that uses it │ │ │ -001ab6e0: 3a3c 2f70 3e0a 3c64 6976 2063 6c61 7373 :

    .
    /* Contents │ │ │ -001ab730: 6f66 2066 696c 6520 2671 756f 743b 6578 of file "ex │ │ │ -001ab740: 616d 706c 652e 6826 7175 6f74 3b20 2a2f ample.h" */ │ │ │ -001ab750: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ -001ab770: 3c73 7061 6e20 636c 6173 733d 2270 7265 #impo │ │ │ -001ab790: 7274 2026 7175 6f74 3b6d 6f64 756c 652e rt "module. │ │ │ -001ab7a0: 6826 7175 6f74 3b3c 2f73 7061 6e3e 3c2f h".
    .< │ │ │ -001ab7d0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -001ab7e0: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >int ns__webmet │ │ │ -001ab810: 686f 6428 3c73 7061 6e20 636c 6173 733d hod(const< │ │ │ -001ab830: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> char *co │ │ │ -001ab860: 6465 2c20 3c73 7061 6e20 636c 6173 733d de, struct │ │ │ -001ab880: 3c2f 7370 616e 3e20 6e73 5f5f 5320 2a72 ns__S *r │ │ │ -001ab890: 6563 6f72 642c 203c 7370 616e 2063 6c61 ecord, int *res │ │ │ -001ab8c0: 756c 7429 3b20 2020 203c 2f64 6976 3e0a ult);
    . │ │ │ -001ab8d0: 3c2f 6469 763e 3c21 2d2d 2066 7261 676d

The mo │ │ │ -001ab8f0: 6475 6c65 2069 7320 636f 6d70 696c 6564 dule is compiled │ │ │ -001ab900: 2061 7320 666f 6c6c 6f77 733a 203c 2f70 as follows:

soapcpp2 
│ │ │ -001ab930: 6d6f 6475 6c65 312e 680a 3c2f 7072 653e  module1.h.
│ │ │ -001ab940: 3c70 3e20 5468 6973 2067 656e 6572 6174

This generat │ │ │ -001ab950: 6573 2074 6865 2066 696c 6573 203c 656d es the files testStub. │ │ │ -001ab970: 683c 2f63 6f64 653e 3c2f 656d 3e2c 203c h, < │ │ │ -001ab980: 656d 3e3c 636f 6465 3e74 6573 7448 2e68 em>testH.h │ │ │ -001ab990: 3c2f 636f 6465 3e3c 2f65 6d3e 2c20 616e , an │ │ │ -001ab9a0: 6420 3c65 6d3e 3c63 6f64 653e 7465 7374 d test │ │ │ -001ab9b0: 432e 6370 703c 2f63 6f64 653e 3c2f 656d C.cpp with serialize │ │ │ -001ab9d0: 7273 2066 6f72 203c 636f 6465 3e73 7472 rs for str │ │ │ -001ab9e0: 7563 7420 6e73 5f5f 533c 2f63 6f64 653e uct ns__S │ │ │ -001ab9f0: 2062 7574 2061 6c73 6f20 666f 7220 3c63 but also for char* │ │ │ -001aba10: 2061 6e64 203c 636f 6465 3e69 6e74 3c2f and int.

.

Ru │ │ │ -001aba30: 6e6e 696e 6720 736f 6170 6370 7032 206f nning soapcpp2 o │ │ │ -001aba40: 6e20 3c65 6d3e 3c63 6f64 653e 6578 616d n exam │ │ │ -001aba50: 706c 652e 683c 2f63 6f64 653e 3c2f 656d ple.h imports the mo │ │ │ -001aba70: 6475 6c65 2064 6566 696e 6974 696f 6e73 dule definitions │ │ │ -001aba80: 2c20 6275 7420 646f 6573 206e 6f74 2067 , but does not g │ │ │ -001aba90: 656e 6572 6174 6520 7365 7269 616c 697a enerate serializ │ │ │ -001abaa0: 6572 7320 666f 7220 3c63 6f64 653e 7374 ers for st │ │ │ -001abab0: 7275 6374 206e 735f 5f53 3c2f 636f 6465 ruct ns__S, char* and │ │ │ -001abae0: 696e 743c 2f63 6f64 653e 2073 696e 6365 int since │ │ │ -001abaf0: 2074 6865 7365 2061 7265 2064 6566 696e these are defin │ │ │ -001abb00: 6564 2062 7920 3c65 6d3e 3c63 6f64 653e ed by │ │ │ -001abb10: 6d6f 6475 6c65 2e68 3c2f 636f 6465 3e3c module.h< │ │ │ -001abb20: 2f65 6d3e 3a20 3c2f 703e 3c70 7265 2063 /em>:

│ │ │ -001abb40: 736f 6170 6370 7032 202d 434c 2065 7861  soapcpp2 -CL exa
│ │ │ -001abb50: 6d70 6c65 2e68 0a3c 2f70 7265 3e3c 703e  mple.h.

│ │ │ -001abb60: 2041 6e20 6578 616d 706c 6520 636c 6965 An example clie │ │ │ -001abb70: 6e74 2061 7070 6c69 6361 7469 6f6e 2074 nt application t │ │ │ -001abb80: 6861 7420 6361 6c6c 7320 7468 6520 636c hat calls the cl │ │ │ -001abb90: 6965 6e74 2073 7475 6220 6675 6e63 7469 ient stub functi │ │ │ -001abba0: 6f6e 3a3c 2f70 3e0a 3c64 6976 2063 6c61 on:

.
│ │ │ -001abbd0: 3c73 7061 6e20 636c 6173 733d 2270 7265 #incl │ │ │ -001abbf0: 7564 6520 2671 756f 743b 736f 6170 482e ude "soapH. │ │ │ -001abc00: 6826 7175 6f74 3b3c 2f73 7061 6e3e 3c2f h".
#include " │ │ │ -001abc50: 3b6e 732e 6e73 6d61 7026 7175 6f74 3b3c ;ns.nsmap"< │ │ │ -001abc60: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
. │ │ │ -001abc80: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
int ma │ │ │ -001abcc0: 696e 2829 3c2f 6469 763e 0a3c 6469 7620 in()
.
{.
s │ │ │ -001abd10: 7472 7563 7420 3c2f 7370 616e 3e3c 6120 truct soap *soap = │ │ │ -001abd80: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap_new();
.
< │ │ │ -001abe00: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -001abe10: 6f72 6422 3e73 7472 7563 7420 3c2f 7370 ord">struct ns__S s;
.
soap_defau │ │ │ -001abe50: 6c74 5f6e 735f 5f53 283c 6120 636c 6173 lt_ns__S( │ │ │ -001abe80: 736f 6170 3c2f 613e 2c20 2661 6d70 3b73 soap, &s │ │ │ -001abe90: 293b 3c2f 6469 763e 0a3c 6469 7620 636c );
.
s.n │ │ │ -001abeb0: 616d 6520 3d20 3c61 2063 6c61 7373 3d22 ame = soap_ │ │ │ -001abf10: 7374 7264 7570 3c2f 613e 283c 6120 636c strdup(soap, "na │ │ │ -001abf70: 6d65 2671 756f 743b 3c2f 7370 616e 3e29 me") │ │ │ -001abf80: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
.
s.am │ │ │ -001abfa0: 6f75 6e74 203d 2031 3234 3b3c 2f64 6976 ount = 124;
.
│ │ │ -001abfe0: 696e 743c 2f73 7061 6e3e 206e 3b3c 2f64 int n;.
if (soa │ │ │ -001ac030: 705f 6361 6c6c 5f6e 735f 5f77 6562 6d65 p_call_ns__webme │ │ │ -001ac040: 7468 6f64 283c 6120 636c 6173 733d 2263 thod(soap │ │ │ -001ac070: 3c2f 613e 2c20 656e 6470 6f69 6e74 2c20 , endpoint, │ │ │ -001ac080: 4e55 4c4c 2c20 3c73 7061 6e20 636c 6173 NULL, "code&quo │ │ │ -001ac0b0: 743b 3c2f 7370 616e 3e2c 2026 616d 703b t;, & │ │ │ -001ac0c0: 732c 2026 616d 703b 6e29 293c 2f64 6976 s, &n))
.
soap_ │ │ │ -001ac140: 7072 696e 745f 6661 756c 743c 2f61 3e28 print_fault( │ │ │ -001ac150: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap, │ │ │ -001ac180: 2073 7464 6572 7229 3b3c 2f64 6976 3e0a stderr);
. │ │ │ -001ac190: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
el │ │ │ -001ac1c0: 7365 3c2f 7370 616e 3e3c 2f64 6976 3e0a se
. │ │ │ -001ac1d0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
printf("O │ │ │ -001ac210: 4b20 6e20 3d20 2564 5c6e 2671 756f 743b K n = %d\n" │ │ │ -001ac220: 3c2f 7370 616e 3e2c 206e 293b 3c2f 6469 , n);.
soap │ │ │ -001ac2a0: 5f64 6573 7472 6f79 3c2f 613e 283c 6120 _destroy(soap);.
so │ │ │ -001ac350: 6170 5f65 6e64 3c2f 613e 283c 6120 636c ap_end(soap);..
}
.

We compile │ │ │ -001ac480: 2074 6869 7320 6578 616d 706c 6520 6173 this example as │ │ │ -001ac490: 2066 6f6c 6c6f 7773 3a20 3c2f 703e 3c70 follows:

c++ -o examp │ │ │ -001ac4c0: 6c65 2065 7861 6d70 6c65 2e63 7070 2074 le example.cpp t │ │ │ -001ac4d0: 6573 7443 2e63 7070 2073 6f61 7043 2e63 estC.cpp soapC.c │ │ │ -001ac4e0: 7070 2073 6f61 7043 6c69 656e 742e 6370 pp soapClient.cp │ │ │ -001ac4f0: 7020 7374 6473 6f61 7032 2e63 7070 0a3c p stdsoap2.cpp.< │ │ │ -001ac500: 2f70 7265 3e3c 703e 204d 6f64 756c 6573 /pre>

Modules │ │ │ -001ac510: 206d 6179 2068 656c 7020 746f 2064 6566 may help to def │ │ │ -001ac520: 696e 6520 6120 6d6f 6475 6c61 7220 6869 ine a modular hi │ │ │ -001ac530: 6572 6172 6368 7920 6f66 206c 6962 7261 erarchy of libra │ │ │ -001ac540: 7269 6573 2077 6974 6820 7265 7573 6162 ries with reusab │ │ │ -001ac550: 6c65 2073 6572 6961 6c69 7a61 626c 6520 le serializable │ │ │ -001ac560: 7479 7065 732e 3c2f 703e 0a3c 703e f09f types.

.

.. │ │ │ -001ac570: 949d 203c 6120 6872 6566 3d22 2322 3e42 .. B │ │ │ -001ac580: 6163 6b20 746f 2074 6162 6c65 206f 6620 ack to table of │ │ │ -001ac590: 636f 6e74 656e 7473 3c2f 613e 3c2f 703e contents

│ │ │ -001ac5a0: 0a3c 6832 3e3c 6120 636c 6173 733d 2261 .

.Plugins │ │ │ -001ac5d0: 2c20 6d6f 6475 6c65 732c 2061 6e64 2065 , modules, and e │ │ │ -001ac5e0: 7874 656e 7369 6f6e 733c 2f68 323e 0a3c xtensions

.< │ │ │ -001ac5f0: 703e 506c 7567 696e 7320 6f66 6665 7220 p>Plugins offer │ │ │ -001ac600: 6120 636f 6e76 656e 6965 6e74 2065 7874 a convenient ext │ │ │ -001ac610: 656e 7369 6f6e 206d 6563 6861 6e69 736d ension mechanism │ │ │ -001ac620: 2066 6f72 2074 6865 2067 534f 4150 2074 for the gSOAP t │ │ │ -001ac630: 6f6f 6c6b 6974 2062 7920 6578 7465 6e64 oolkit by extend │ │ │ -001ac640: 696e 6720 7468 6520 6361 7061 6269 6c69 ing the capabili │ │ │ -001ac650: 7469 6573 206f 6620 6974 7320 656e 6769 ties of its engi │ │ │ -001ac660: 6e65 2e20 5768 656e 2074 6865 2070 6c75 ne. When the plu │ │ │ -001ac670: 6769 6e20 7265 6769 7374 6572 7320 7769 gin registers wi │ │ │ -001ac680: 7468 2074 6865 2067 534f 4150 2065 6e67 th the gSOAP eng │ │ │ -001ac690: 696e 652c 2069 7420 6861 7320 6675 6c6c ine, it has full │ │ │ -001ac6a0: 2061 6363 6573 7320 746f 2074 6865 2072 access to the r │ │ │ -001ac6b0: 756e 2d74 696d 6520 7365 7474 696e 6773 un-time settings │ │ │ -001ac6c0: 2061 6e64 2074 6865 2065 6e67 696e 6527 and the engine' │ │ │ -001ac6d0: 7320 6675 6e63 7469 6f6e 2063 616c 6c62 s function callb │ │ │ -001ac6e0: 6163 6b73 2e20 5570 6f6e 2072 6567 6973 acks. Upon regis │ │ │ -001ac6f0: 7472 792c 2074 6865 2070 6c75 6769 6e27 try, the plugin' │ │ │ -001ac700: 7320 6c6f 6361 6c20 6461 7461 2069 7320 s local data is │ │ │ -001ac710: 6173 736f 6369 6174 6564 2077 6974 6820 associated with │ │ │ -001ac720: 7468 6520 3c63 6f64 653e 3c61 2063 6c61 the soap context. B │ │ │ -001ac790: 7920 6f76 6572 7269 6469 6e67 2074 6865 y overriding the │ │ │ -001ac7a0: 2063 616c 6c62 6163 6b73 2077 6974 6820 callbacks with │ │ │ -001ac7b0: 7468 6520 706c 7567 696e 2773 2063 616c the plugin's cal │ │ │ -001ac7c0: 6c62 6163 6b73 2c20 7468 6520 706c 7567 lbacks, the plug │ │ │ -001ac7d0: 696e 2065 7874 656e 6473 206f 7220 6d6f in extends or mo │ │ │ -001ac7e0: 6469 6669 6573 2074 6865 2065 6e67 696e difies the engin │ │ │ -001ac7f0: 6527 7320 6361 7061 6269 6c69 7469 6573 e's capabilities │ │ │ -001ac800: 2e20 5468 6520 6c6f 6361 6c20 706c 7567 . The local plug │ │ │ -001ac810: 696e 2064 6174 6120 6361 6e20 6265 2061 in data can be a │ │ │ -001ac820: 6363 6573 7365 6420 7468 726f 7567 6820 ccessed through │ │ │ -001ac830: 6120 6c6f 6f6b 7570 2066 756e 6374 696f a lookup functio │ │ │ -001ac840: 6e2c 2075 7375 616c 6c79 2069 6e76 6f6b n, usually invok │ │ │ -001ac850: 6564 2077 6974 6869 6e20 6120 6361 6c6c ed within a call │ │ │ -001ac860: 6261 636b 2066 756e 6374 696f 6e20 746f back function to │ │ │ -001ac870: 2061 6363 6573 7320 7468 6520 706c 7567 access the plug │ │ │ -001ac880: 696e 2064 6174 612e 2054 6865 2072 6567 in data. The reg │ │ │ -001ac890: 6973 7472 7920 616e 6420 6c6f 6f6b 7570 istry and lookup │ │ │ -001ac8a0: 2066 756e 6374 696f 6e73 2061 7265 3a3c functions are:< │ │ │ -001ac8b0: 2f70 3e0a 3c64 6976 2063 6c61 7373 3d22 /p>.
int │ │ │ -001ac900: 203c 6120 636c 6173 733d 2263 6f64 6522 soap_regist │ │ │ -001ac960: 6572 5f70 6c75 6769 6e5f 6172 673c 2f61 er_plugin_arg(struct soa │ │ │ -001ac9c0: 703c 2f61 3e20 2a3c 6120 636c 6173 733d p *so │ │ │ -001ac9f0: 6170 3c2f 613e 2c20 3c73 7061 6e20 636c ap, int (*f │ │ │ -001aca20: 6372 6561 7465 2928 3c73 7061 6e20 636c create)(st │ │ │ -001aca40: 7275 6374 3c2f 7370 616e 3e20 3c61 2063 ruct soap *soap, struct soap_plugin *p │ │ │ -001acae0: 2c20 3c73 7061 6e20 636c 6173 733d 226b , void │ │ │ -001acb00: 3c2f 7370 616e 3e20 2a61 7267 292c 203c *arg), < │ │ │ -001acb10: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -001acb20: 6f72 6474 7970 6522 3e76 6f69 643c 2f73 ordtype">void *arg)
│ │ │ -001acb40: 0a3c 6469 7620 636c 6173 733d 2274 7463 .
│ │ │ -001acbf0: 736f 6170 5f72 6567 6973 7465 725f 706c soap_register_pl │ │ │ -001acc00: 7567 696e 5f61 7267 3c2f 613e 3c2f 6469 ugin_arg
int soap_r │ │ │ -001acc30: 6567 6973 7465 725f 706c 7567 696e 5f61 egister_plugin_a │ │ │ -001acc40: 7267 2873 7472 7563 7420 736f 6170 202a rg(struct soap * │ │ │ -001acc50: 736f 6170 2c20 696e 7428 2a66 6372 6561 soap, int(*fcrea │ │ │ -001acc60: 7465 2928 7374 7275 6374 2073 6f61 7020 te)(struct soap │ │ │ -001acc70: 2a2c 2073 7472 7563 7420 736f 6170 5f70 *, struct soap_p │ │ │ -001acc80: 6c75 6769 6e20 2a2c 2076 6f69 6420 2a29 lugin *, void *) │ │ │ -001acc90: 2c20 766f 6964 202a 6172 6729 3c2f 6469 , void *arg)
Register a │ │ │ -001accc0: 706c 7567 696e 2077 6974 6820 616e 2061 plugin with an a │ │ │ -001accd0: 7267 756d 656e 742e 3c2f 6469 763e 3c2f rgument.
.
v │ │ │ -001acd40: 6f69 643c 2f73 7061 6e3e 2a20 736f 6170 oid* soap │ │ │ -001acd50: 5f6c 6f6f 6b75 705f 706c 7567 696e 283c _lookup_plugin(< │ │ │ -001acd60: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -001acd70: 6f72 6422 3e73 7472 7563 743c 2f73 7061 ord">struct soap*, const │ │ │ -001acdd0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c char*); │ │ │ -001ace00: 3c2f 6469 763e 0a3c 2f64 6976 3e3c 212d
.

The soap_copy< │ │ │ -001acee0: 2f61 3e3c 2f63 6f64 653e 2066 756e 6374 /a> funct │ │ │ -001acef0: 696f 6e20 7265 7475 726e 7320 6120 6e65 ion returns a ne │ │ │ -001acf00: 7720 6479 6e61 6d69 6361 6c6c 7920 616c w dynamically al │ │ │ -001acf10: 6c6f 6361 7465 6420 3c63 6f64 653e 3c61 located soap contex │ │ │ -001acf80: 7420 7468 6174 2069 7320 6120 636f 7079 t that is a copy │ │ │ -001acf90: 206f 6620 616e 6f74 6865 722c 2073 7563 of another, suc │ │ │ -001acfa0: 6820 7468 6174 206e 6f20 6461 7461 2069 h that no data i │ │ │ -001acfb0: 7320 7368 6172 6564 2062 6574 7765 656e s shared between │ │ │ -001acfc0: 2074 6865 2063 6f70 7920 616e 6420 7468 the copy and th │ │ │ -001acfd0: 6520 6f72 6967 696e 616c 2063 6f6e 7465 e original conte │ │ │ -001acfe0: 7874 2e20 5468 6520 3c63 6f64 653e 3c61 xt. The soap_co │ │ │ -001ad0a0: 7079 3c2f 613e 3c2f 636f 6465 3e20 6675 py fu │ │ │ -001ad0b0: 6e63 7469 6f6e 2069 6e76 6f6b 6573 2074 nction invokes t │ │ │ -001ad0c0: 6865 2063 6f70 7920 6675 6e63 7469 6f6e he copy function │ │ │ -001ad0d0: 7320 6f66 2074 6865 2072 6567 6973 7465 s of the registe │ │ │ -001ad0e0: 7265 6420 706c 7567 696e 7320 746f 2063 red plugins to c │ │ │ -001ad0f0: 6f70 7920 7468 6520 706c 7567 696e 7327 opy the plugins' │ │ │ -001ad100: 206c 6f63 616c 2064 6174 612e 2054 6865 local data. The │ │ │ -001ad110: 203c 636f 6465 3e3c 6120 636c 6173 733d soap_ │ │ │ -001ad1e0: 646f 6e65 3c2f 613e 3c2f 636f 6465 3e20 done │ │ │ -001ad1f0: 616e 6420 3c63 6f64 653e 3c61 2063 6c61 and soap_f │ │ │ -001ad2a0: 7265 653c 2f61 3e3c 2f63 6f64 653e 2066 ree f │ │ │ -001ad2b0: 756e 6374 696f 6e73 2064 652d 7265 6769 unctions de-regi │ │ │ -001ad2c0: 7374 6572 7320 616c 6c20 706c 7567 696e sters all plugin │ │ │ -001ad2d0: 2e3c 2f70 3e0a 3c70 3e54 6865 2066 6f6c .

.

The fol │ │ │ -001ad2e0: 6c6f 7720 6578 616d 706c 6520 6f76 6572 low example over │ │ │ -001ad2f0: 7269 6465 7320 7468 6520 7365 6e64 2061 rides the send a │ │ │ -001ad300: 6e64 2072 6563 6569 7665 2063 616c 6c62 nd receive callb │ │ │ -001ad310: 6163 6b73 2074 6f20 636f 7079 2061 6c6c acks to copy all │ │ │ -001ad320: 206d 6573 7361 6765 7320 7468 6174 2061 messages that a │ │ │ -001ad330: 7265 2073 656e 7420 616e 6420 7265 6365 re sent and rece │ │ │ -001ad340: 6976 6564 2074 6f20 7468 6520 7465 726d ived to the term │ │ │ -001ad350: 696e 616c 2028 7374 6465 7272 292e 3c2f inal (stderr)..

First, we │ │ │ -001ad370: 7772 6974 6520 6120 6865 6164 6572 2066 write a header f │ │ │ -001ad380: 696c 6520 3c65 6d3e 3c63 6f64 653e 706c ile pl │ │ │ -001ad390: 7567 696e 2e68 3c2f 636f 6465 3e3c 2f65 ugin.h to define the │ │ │ -001ad3b0: 206c 6f63 616c 2070 6c75 6769 6e20 6461 local plugin da │ │ │ -001ad3c0: 7461 2073 7472 7563 7475 7265 2873 2920 ta structure(s) │ │ │ -001ad3d0: 616e 6420 7765 2064 6566 696e 6520 6120 and we define a │ │ │ -001ad3e0: 676c 6f62 616c 206e 616d 6520 746f 2069 global name to i │ │ │ -001ad3f0: 6465 6e74 6966 7920 7468 6520 706c 7567 dentify the plug │ │ │ -001ad400: 696e 3a3c 2f70 3e0a 3c64 6976 2063 6c61 in:

.
│ │ │ -001ad430: 3c73 7061 6e20 636c 6173 733d 2270 7265 #incl │ │ │ -001ad450: 7564 6520 2671 756f 743b 3c61 2063 6c61 ude "stdsoap2.h │ │ │ -001ad490: 2671 756f 743b 3c2f 7370 616e 3e20 3c2f " .
#define PLUGIN │ │ │ -001ad4e0: 5f49 4420 2671 756f 743b 504c 5547 494e _ID "PLUGIN │ │ │ -001ad4f0: 2d31 2e30 2671 756f 743b 3c2f 7370 616e -1.0" // some │ │ │ -001ad520: 6e61 6d65 2074 6f20 6964 656e 7469 6679 name to identify │ │ │ -001ad530: 2070 6c75 6769 6e20 3c2f 7370 616e 3e3c plugin < │ │ │ -001ad540: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
. │ │ │ -001ad560: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
struct < │ │ │ -001ad590: 2f73 7061 6e3e 706c 7567 696e 5f64 6174 /span>plugin_dat │ │ │ -001ad5a0: 6120 3c73 7061 6e20 636c 6173 733d 2263 a // local │ │ │ -001ad5c0: 2070 6c75 6769 6e20 6461 7461 203c 2f73 plugin data
.
{.
int (*f │ │ │ -001ad610: 7365 6e64 2928 3c73 7061 6e20 636c 6173 send)(stru │ │ │ -001ad630: 6374 203c 2f73 7061 6e3e 3c61 2063 6c61 ct soap*, const < │ │ │ -001ad690: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -001ad6a0: 6f72 6474 7970 6522 3e63 6861 723c 2f73 ordtype">char*, size_t); │ │ │ -001ad6c0: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // to save │ │ │ -001ad6e0: 2061 6e64 2075 7365 2073 656e 6420 6361 and use send ca │ │ │ -001ad6f0: 6c6c 6261 636b 203c 2f73 7061 6e3e 3c2f llback .
size_t │ │ │ -001ad720: 282a 3c61 2063 6c61 7373 3d22 636f 6465 (*frecv)(struct │ │ │ -001ad7a0: 203c 2f73 7061 6e3e 3c61 2063 6c61 7373 s │ │ │ -001ad7d0: 6f61 703c 2f61 3e2a 2c20 3c73 7061 6e20 oap*, char* │ │ │ -001ad800: 2c20 7369 7a65 5f74 293b 203c 7370 616e , size_t); // to save and │ │ │ -001ad830: 7573 6520 7265 6376 2063 616c 6c62 6163 use recv callbac │ │ │ -001ad840: 6b20 3c2f 7370 616e 3e3c 2f64 6976 3e0a k
. │ │ │ -001ad850: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
};
.
int plugin( │ │ │ -001ad8c0: 7374 7275 6374 3c2f 7370 616e 3e20 3c61 struct soap *< │ │ │ -001ad900: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -001ad910: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ -001ad920: 6874 6d6c 223e 736f 6170 3c2f 613e 2c20 html">soap, │ │ │ -001ad930: 3c73 7061 6e20 636c 6173 733d 226b 6579 struct soap_plugin │ │ │ -001ad960: 2a70 6c75 6769 6e2c 203c 7370 616e 2063 *plugin, void * │ │ │ -001ad990: 6172 6729 3b3c 2f64 6976 3e0a 3c64 6976 arg);
.
This f │ │ │ -001ada20: 696c 6520 6465 6669 6e65 7320 7468 6520 ile defines the │ │ │ -001ada30: 636f 6d6d 6f6e 206d 6163 726f 732c 2074 common macros, t │ │ │ -001ada40: 7970 6573 2061 6e64 2066 756e 6374 696f ypes and functio │ │ │ -001ada50: 6e73 206f 6620 7468 6520 6753 4f41 5020 ns of the gSOAP │ │ │ -001ada60: 4150 4920 6772 6f75 7065 6420 6279 206d API grouped by m │ │ │ -001ada70: 6f64 756c 6573 3c2f 6469 763e 3c2f 6469 odules
.

The │ │ │ -001adaa0: 6e2c 2077 6520 7772 6974 6520 7468 6520 n, we write the │ │ │ -001adab0: 706c 7567 696e 2072 6567 6973 7472 7920 plugin registry │ │ │ -001adac0: 6675 6e63 7469 6f6e 2061 6e64 2074 6865 function and the │ │ │ -001adad0: 2063 616c 6c62 6163 6b73 3a3c 2f70 3e0a callbacks:

. │ │ │ -001adae0: 3c64 6976 2063 6c61 7373 3d22 6672 6167
#include &quo │ │ │ -001adb30: 743b 706c 7567 696e 2e68 2671 756f 743b t;plugin.h" │ │ │ -001adb40: 3c2f 7370 616e 3e20 3c2f 6469 763e 0a3c
.< │ │ │ -001adb50: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -001adb60: 3e20 3c2f 6469 763e 0a3c 6469 7620 636c >
.
static < │ │ │ -001adba0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -001adbb0: 6f72 6422 3e63 6f6e 7374 3c2f 7370 616e ord">const char │ │ │ -001adbe0: 3c2f 7370 616e 3e20 706c 7567 696e 5f69 plugin_i │ │ │ -001adbf0: 645b 5d20 3d20 504c 5547 494e 5f49 443b d[] = PLUGIN_ID; │ │ │ -001adc00: 203c 7370 616e 2063 6c61 7373 3d22 636f // the pl │ │ │ -001adc20: 7567 696e 2069 6420 3c2f 7370 616e 3e3c ugin id < │ │ │ -001adc30: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
st │ │ │ -001adc60: 6174 6963 3c2f 7370 616e 3e20 3c73 7061 atic int │ │ │ -001adc90: 2070 6c75 6769 6e5f 696e 6974 283c 7370 plugin_init(struct │ │ │ -001adcc0: 203c 6120 636c 6173 733d 2263 6f64 6522 soap │ │ │ -001adcf0: 202a 3c61 2063 6c61 7373 3d22 636f 6465 *soap, struct< │ │ │ -001add40: 2f73 7061 6e3e 2070 6c75 6769 6e5f 6461 /span> plugin_da │ │ │ -001add50: 7461 202a 6461 7461 293b 203c 2f64 6976 ta *data);
.
static │ │ │ -001add90: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c int plu │ │ │ -001addc0: 6769 6e5f 636f 7079 283c 7370 616e 2063 gin_copy(s │ │ │ -001adde0: 7472 7563 743c 2f73 7061 6e3e 203c 6120 truct soap *soap, < │ │ │ -001ade50: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -001ade60: 6f72 6422 3e73 7472 7563 743c 2f73 7061 ord">struct soap_plugin * │ │ │ -001ade80: 6473 742c 203c 7370 616e 2063 6c61 7373 dst, struc │ │ │ -001adea0: 743c 2f73 7061 6e3e 2073 6f61 705f 706c t soap_pl │ │ │ -001adeb0: 7567 696e 202a 7372 6329 3b20 3c2f 6469 ugin *src); .
stati │ │ │ -001adef0: 633c 2f73 7061 6e3e 203c 7370 616e 2063 c void p │ │ │ -001adf20: 6c75 6769 6e5f 6465 6c65 7465 283c 7370 lugin_delete(struct │ │ │ -001adf50: 203c 6120 636c 6173 733d 2263 6f64 6522 soap │ │ │ -001adf80: 202a 3c61 2063 6c61 7373 3d22 636f 6465 *soap, struct< │ │ │ -001adfd0: 2f73 7061 6e3e 2073 6f61 705f 706c 7567 /span> soap_plug │ │ │ -001adfe0: 696e 202a 7029 3b20 3c2f 6469 763e 0a3c in *p);
.< │ │ │ -001adff0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -001ae000: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >static
i │ │ │ -001ae040: 6e74 3c2f 7370 616e 3e20 706c 7567 696e nt plugin │ │ │ -001ae050: 5f73 656e 6428 3c73 7061 6e20 636c 6173 _send(stru │ │ │ -001ae070: 6374 3c2f 7370 616e 3e20 3c61 2063 6c61 ct soap *soap, const < │ │ │ -001ae100: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -001ae110: 6f72 6474 7970 6522 3e63 6861 723c 2f73 ordtype">char *b │ │ │ -001ae170: 7566 3c2f 613e 2c20 3c73 7061 6e20 636c uf, size_t │ │ │ -001ae1a0: 6c65 6e29 3b20 3c2f 6469 763e 0a3c 6469 len);
.< │ │ │ -001ae1c0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -001ae1d0: 6f72 6422 3e73 7461 7469 633c 2f73 7061 ord">static siz │ │ │ -001ae200: 655f 743c 2f73 7061 6e3e 2070 6c75 6769 e_t plugi │ │ │ -001ae210: 6e5f 7265 6376 283c 7370 616e 2063 6c61 n_recv(str │ │ │ -001ae230: 7563 743c 2f73 7061 6e3e 203c 6120 636c uct soap *soap, char *buf │ │ │ -001ae310: 3c2f 613e 2c20 3c73 7061 6e20 636c 6173 , │ │ │ -001ae330: 7369 7a65 5f74 3c2f 7370 616e 3e20 6c65 size_t le │ │ │ -001ae340: 6e29 3b20 3c2f 6469 763e 0a3c 6469 7620 n);
.
.
// │ │ │ -001ae390: 7468 6520 7265 6769 7374 7279 2066 756e the registry fun │ │ │ -001ae3a0: 6374 696f 6e3a 203c 2f73 7061 6e3e 3c2f ction: .
int plug │ │ │ -001ae3f0: 696e 283c 7370 616e 2063 6c61 7373 3d22 in(struct< │ │ │ -001ae410: 2f73 7061 6e3e 203c 6120 636c 6173 733d /span> so │ │ │ -001ae440: 6170 3c2f 613e 202a 3c61 2063 6c61 7373 ap *s │ │ │ -001ae470: 6f61 703c 2f61 3e2c 203c 7370 616e 2063 oap, s │ │ │ -001ae490: 7472 7563 743c 2f73 7061 6e3e 2073 6f61 truct soa │ │ │ -001ae4a0: 705f 706c 7567 696e 202a 702c 203c 7370 p_plugin *p, void *arg)
. │ │ │ -001ae4e0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
{
.
p- │ │ │ -001ae510: 2667 743b 6964 203d 2070 6c75 6769 6e5f >id = plugin_ │ │ │ -001ae520: 6964 3b20 3c2f 6469 763e 0a3c 6469 7620 id;
.
p │ │ │ -001ae540: 2d26 6774 3b64 6174 6120 3d20 283c 7370 ->data = (void*)malloc(sizeof(< │ │ │ -001ae5a0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -001ae5b0: 6f72 6422 3e73 7472 7563 743c 2f73 7061 ord">struct plugin_data)) │ │ │ -001ae5d0: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
p-& │ │ │ -001ae5f0: 6774 3b66 636f 7079 203d 2070 6c75 6769 gt;fcopy = plugi │ │ │ -001ae600: 6e5f 636f 7079 3b20 3c73 7061 6e20 636c n_copy; /* │ │ │ -001ae620: 206f 7074 696f 6e61 6c3a 2077 6865 6e20 optional: when │ │ │ -001ae630: 7365 7420 7468 6520 706c 7567 696e 206d set the plugin m │ │ │ -001ae640: 7573 7420 636f 7079 2069 7473 206c 6f63 ust copy its loc │ │ │ -001ae650: 616c 2064 6174 6120 2a2f 3c2f 7370 616e al data */
.
p-&g │ │ │ -001ae680: 743b 6664 656c 6574 6520 3d20 706c 7567 t;fdelete = plug │ │ │ -001ae690: 696e 5f64 656c 6574 653b 203c 2f64 6976 in_delete;
.
│ │ │ -001ae6d0: 6966 3c2f 7370 616e 3e20 2870 2d26 6774 if (p-> │ │ │ -001ae6e0: 3b64 6174 6129 203c 2f64 6976 3e0a 3c64 ;data)
. │ │ │ -001ae700: 2020 7b3c 2f64 6976 3e0a 3c64 6976 2063 {
.
│ │ │ -001ae720: 3c73 7061 6e20 636c 6173 733d 226b 6579 if (plugin_init │ │ │ -001ae750: 283c 6120 636c 6173 733d 2263 6f64 6522 (soap │ │ │ -001ae780: 2c20 283c 7370 616e 2063 6c61 7373 3d22 , (struct< │ │ │ -001ae7a0: 2f73 7061 6e3e 2070 6c75 6769 6e5f 6461 /span> plugin_da │ │ │ -001ae7b0: 7461 2a29 702d 2667 743b 6461 7461 2929 ta*)p->data)) │ │ │ -001ae7c0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
{< │ │ │ -001ae7e0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
fr │ │ │ -001ae800: 6565 2870 2d26 6774 3b64 6174 6129 3b20 ee(p->data); │ │ │ -001ae810: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // error: │ │ │ -001ae830: 636f 756c 6420 6e6f 7420 696e 6974 203c could not init < │ │ │ -001ae840: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
. │ │ │ -001ae860: 2020 2020 203c 7370 616e 2063 6c61 7373 r │ │ │ -001ae880: 6574 7572 6e3c 2f73 7061 6e3e 203c 6120 eturn SOAP_EOM; < │ │ │ -001ae8f0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ -001ae900: 656e 7422 3e2f 2f20 7265 7475 726e 2065 ent">// return e │ │ │ -001ae910: 7272 6f72 203c 2f73 7061 6e3e 3c2f 6469 rror .
}
.
}
. │ │ │ -001ae970: 2020 3c73 7061 6e20 636c 6173 733d 226b retu │ │ │ -001ae990: 726e 3c2f 7370 616e 3e20 3c61 2063 6c61 rn SO │ │ │ -001ae9f0: 4150 5f4f 4b3c 2f61 3e3b 203c 2f64 6976 AP_OK;
.
}
. │ │ │ -001aea30: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
..
{
.
│ │ │ -001aeb90: 6461 7461 2d26 6774 3b66 7365 6e64 203d data->fsend = │ │ │ -001aeba0: 203c 6120 636c 6173 733d 2263 6f64 6522 soap │ │ │ -001aebd0: 2d26 6774 3b3c 6120 636c 6173 733d 2263 ->fsen │ │ │ -001aec30: 643c 2f61 3e3b 203c 7370 616e 2063 6c61 d; // │ │ │ -001aec50: 7361 7665 206f 6c64 2072 6563 7620 6361 save old recv ca │ │ │ -001aec60: 6c6c 6261 636b 203c 2f73 7061 6e3e 3c2f llback .
data-&g │ │ │ -001aec90: 743b 6672 6563 7620 3d20 3c61 2063 6c61 t;frecv = soap->frecv; │ │ │ -001aed30: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // save ol │ │ │ -001aed50: 6420 7365 6e64 2063 616c 6c62 6163 6b20 d send callback │ │ │ -001aed60: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ -001aed80: 2020 3c61 2063 6c61 7373 3d22 636f 6465 soap->fse │ │ │ -001aee10: 6e64 3c2f 613e 203d 2070 6c75 6769 6e5f nd = plugin_ │ │ │ -001aee20: 7365 6e64 3b20 3c73 7061 6e20 636c 6173 send; // r │ │ │ -001aee40: 6570 6c61 6365 2073 656e 6420 6361 6c6c eplace send call │ │ │ -001aee50: 6261 636b 2077 6974 6820 6e65 7720 3c2f back with new
.
│ │ │ -001aee80: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap- │ │ │ -001aeeb0: 2667 743b 3c61 2063 6c61 7373 3d22 636f >frecv │ │ │ -001aef10: 3c2f 613e 203d 2070 6c75 6769 6e5f 7265 = plugin_re │ │ │ -001aef20: 6376 3b20 3c73 7061 6e20 636c 6173 733d cv; // rep │ │ │ -001aef40: 6c61 6365 2072 6563 7620 6361 6c6c 6261 lace recv callba │ │ │ -001aef50: 636b 2077 6974 6820 6e65 7720 3c2f 7370 ck with new
.. │ │ │ -001af020: 7d20 3c2f 6469 763e 0a3c 6469 7620 636c }
.
.
// co │ │ │ -001af070: 7079 2070 6c75 6769 6e20 6461 7461 2c20 py plugin data, │ │ │ -001af080: 6361 6c6c 6564 2062 7920 736f 6170 5f63 called by soap_c │ │ │ -001af090: 6f70 7928 293c 2f73 7061 6e3e 3c2f 6469 opy().
// Th │ │ │ -001af0d0: 6973 2069 7320 696d 706f 7274 616e 743a is is important: │ │ │ -001af0e0: 2077 6520 6e65 6564 2061 2064 6565 7020 we need a deep │ │ │ -001af0f0: 636f 7079 2074 6f20 6176 6f69 6420 6461 copy to avoid da │ │ │ -001af100: 7461 2073 6861 7269 6e67 2062 7920 7477 ta sharing by tw │ │ │ -001af110: 6f20 636f 6e74 6578 7473 203c 2f73 7061 o contexts
.
static < │ │ │ -001af160: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -001af170: 6f72 6474 7970 6522 3e69 6e74 3c2f 7370 ordtype">int plugin_copy( │ │ │ -001af190: 3c73 7061 6e20 636c 6173 733d 226b 6579 struct soap< │ │ │ -001af1e0: 2f61 3e20 2a3c 6120 636c 6173 733d 2263 /a> *soap │ │ │ -001af210: 3c2f 613e 2c20 3c73 7061 6e20 636c 6173 , stru │ │ │ -001af230: 6374 3c2f 7370 616e 3e20 736f 6170 5f70 ct soap_p │ │ │ -001af240: 6c75 6769 6e20 2a64 7374 2c20 3c73 7061 lugin *dst, struct │ │ │ -001af270: 736f 6170 5f70 6c75 6769 6e20 2a73 7263 soap_plugin *src │ │ │ -001af280: 2920 3c2f 6469 763e 0a3c 6469 7620 636c )
.
{.
if (!(ds │ │ │ -001af2e0: 742d 2667 743b 6461 7461 203d 2028 3c73 t->data = (struct plugin_data*)m │ │ │ -001af320: 616c 6c6f 6328 3c73 7061 6e20 636c 6173 alloc(size │ │ │ -001af340: 6f66 3c2f 7370 616e 3e28 3c73 7061 6e20 of( │ │ │ -001af360: 7374 7275 6374 3c2f 7370 616e 3e20 706c struct pl │ │ │ -001af370: 7567 696e 5f64 6174 6129 2929 2920 3c2f ugin_data)))) ..
│ │ │ -001af440: 2a64 7374 2d26 6774 3b64 6174 6120 3d20 *dst->data = │ │ │ -001af450: 2a73 7263 2d26 6774 3b64 6174 613b 203c *src->data; < │ │ │ -001af460: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>..
} .
.< │ │ │ -001af540: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -001af550: 3e3c 7370 616e 2063 6c61 7373 3d22 636f >// plugin │ │ │ -001af570: 2064 656c 6574 696f 6e2c 2063 616c 6c65 deletion, calle │ │ │ -001af580: 6420 6279 2073 6f61 705f 646f 6e65 2829 d by soap_done() │ │ │ -001af590: 203c 2f73 7061 6e3e 3c2f 6469 763e 0a3c
.< │ │ │ -001af5a0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -001af5b0: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >static
v │ │ │ -001af5f0: 6f69 643c 2f73 7061 6e3e 2070 6c75 6769 oid plugi │ │ │ -001af600: 6e5f 6465 6c65 7465 283c 7370 616e 2063 n_delete(s │ │ │ -001af620: 7472 7563 743c 2f73 7061 6e3e 203c 6120 truct soap *soap, < │ │ │ -001af690: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -001af6a0: 6f72 6422 3e73 7472 7563 743c 2f73 7061 ord">struct soap_plugin * │ │ │ -001af6c0: 7029 203c 2f64 6976 3e0a 3c64 6976 2063 p)
.
{.
free(p-& │ │ │ -001af700: 6774 3b64 6174 6129 3b20 3c73 7061 6e20 gt;data); │ │ │ -001af720: 2f2f 2066 7265 6520 616c 6c6f 6361 7465 // free allocate │ │ │ -001af730: 6420 706c 7567 696e 2064 6174 6120 3c2f d plugin data
.
} │ │ │ -001af760: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ -001af780: 0a3c 6469 7620 636c 6173 733d 226c 696e .
// the │ │ │ -001af7b0: 6e65 7720 7365 6e64 2063 616c 6c62 6163 new send callbac │ │ │ -001af7c0: 6b20 3c2f 7370 616e 3e3c 2f64 6976 3e0a k
. │ │ │ -001af7d0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
static │ │ │ -001af820: 696e 743c 2f73 7061 6e3e 2070 6c75 6769 int plugi │ │ │ -001af830: 6e5f 7365 6e64 283c 7370 616e 2063 6c61 n_send(str │ │ │ -001af850: 7563 743c 2f73 7061 6e3e 203c 6120 636c uct soap *soap, const │ │ │ -001af8e0: 3c73 7061 6e20 636c 6173 733d 226b 6579 char * │ │ │ -001af950: 6275 663c 2f61 3e2c 203c 7370 616e 2063 buf, size_t │ │ │ -001af980: 206c 656e 2920 3c2f 6469 763e 0a3c 6469 len)
.{ │ │ │ -001af9a0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
struct p │ │ │ -001af9e0: 6c75 6769 6e5f 6461 7461 202a 6461 7461 lugin_data *data │ │ │ -001af9f0: 203d 2028 3c73 7061 6e20 636c 6173 733d = (struct │ │ │ -001afa10: 203c 2f73 7061 6e3e 706c 7567 696e 5f64 plugin_d │ │ │ -001afa20: 6174 612a 2973 6f61 705f 6c6f 6f6b 7570 ata*)soap_lookup │ │ │ -001afa30: 5f70 6c75 6769 6e28 3c61 2063 6c61 7373 _plugin(s │ │ │ -001afa60: 6f61 703c 2f61 3e2c 2070 6c75 6769 6e5f oap, plugin_ │ │ │ -001afa70: 6964 293b 203c 7370 616e 2063 6c61 7373 id); // fe │ │ │ -001afa90: 7463 6820 706c 7567 696e 2623 3339 3b73 tch plugin's │ │ │ -001afaa0: 206c 6f63 616c 2064 6174 6120 3c2f 7370 local data
.
fw │ │ │ -001afad0: 7269 7465 2862 7566 2c20 6c65 6e2c 2031 rite(buf, len, 1 │ │ │ -001afae0: 2c20 7374 6465 7272 293b 203c 7370 616e , stderr); // write messag │ │ │ -001afb10: 6520 746f 2073 7464 6572 7220 3c2f 7370 e to stderr
.
return data->f │ │ │ -001afb70: 7365 6e64 283c 6120 636c 6173 733d 2263 send(soap │ │ │ -001afba0: 3c2f 613e 2c20 6275 662c 206c 656e 293b , buf, len); │ │ │ -001afbb0: 203c 7370 616e 2063 6c61 7373 3d22 636f // pass d │ │ │ -001afbd0: 6174 6120 6f6e 2074 6f20 6f6c 6420 7365 ata on to old se │ │ │ -001afbe0: 6e64 2063 616c 6c62 6163 6b20 3c2f 7370 nd callback
.
} .
.< │ │ │ -001afc30: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -001afc40: 3e3c 7370 616e 2063 6c61 7373 3d22 636f >// the ne │ │ │ -001afc60: 7720 7265 6365 6976 6520 6361 6c6c 6261 w receive callba │ │ │ -001afc70: 636b 203c 2f73 7061 6e3e 3c2f 6469 763e ck
│ │ │ -001afc80: 0a3c 6469 7620 636c 6173 733d 226c 696e .
static< │ │ │ -001afcb0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> size_t p │ │ │ -001afce0: 6c75 6769 6e5f 7265 6376 283c 7370 616e lugin_recv(struct < │ │ │ -001afd10: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -001afd20: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ -001afd30: 6874 6d6c 223e 736f 6170 3c2f 613e 202a html">soap * │ │ │ -001afd40: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap, │ │ │ -001afd70: 203c 7370 616e 2063 6c61 7373 3d22 6b65 char< │ │ │ -001afd90: 2f73 7061 6e3e 202a 6275 662c 203c 7370 /span> *buf, size_t len)
│ │ │ -001afdd0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
{
.
< │ │ │ -001afe00: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -001afe10: 6f72 6422 3e73 7472 7563 7420 3c2f 7370 ord">struct plugin_data * │ │ │ -001afe30: 6461 7461 203d 2028 3c73 7061 6e20 636c data = (st │ │ │ -001afe50: 7275 6374 203c 2f73 7061 6e3e 706c 7567 ruct plug │ │ │ -001afe60: 696e 5f64 6174 612a 2973 6f61 705f 6c6f in_data*)soap_lo │ │ │ -001afe70: 6f6b 7570 5f70 6c75 6769 6e28 3c61 2063 okup_plugin(soap, plu │ │ │ -001afeb0: 6769 6e5f 6964 293b 203c 7370 616e 2063 gin_id); / │ │ │ -001afed0: 2f20 6665 7463 6820 706c 7567 696e 2623 / fetch plugin&# │ │ │ -001afee0: 3339 3b73 206c 6f63 616c 2064 6174 6120 39;s local data │ │ │ -001afef0: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ -001aff10: 2020 3c73 7061 6e20 636c 6173 733d 226b size │ │ │ -001aff30: 5f74 3c2f 7370 616e 3e20 7265 7320 3d20 _t res = │ │ │ -001aff40: 6461 7461 2d26 6774 3b66 7265 6376 283c data->frecv(< │ │ │ -001aff50: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -001aff60: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ -001aff70: 6874 6d6c 223e 736f 6170 3c2f 613e 2c20 html">soap, │ │ │ -001aff80: 6275 662c 206c 656e 293b 203c 7370 616e buf, len); // get data fro │ │ │ -001affb0: 6d20 6f6c 6420 7265 6376 2063 616c 6c62 m old recv callb │ │ │ -001affc0: 6163 6b20 3c2f 7370 616e 3e3c 2f64 6976 ack
.
fwrite(buf │ │ │ -001afff0: 2c20 7265 732c 2031 2c20 7374 6465 7272 , res, 1, stderr │ │ │ -001b0000: 293b 203c 2f64 6976 3e0a 3c64 6976 2063 );
.
return res;
.
}
.
│ │ │ -001b00c0: 3c64 6976 2063 6c61 7373 3d22 7474 6e61 #define SOAP_EO │ │ │ -001b0150: 4d3c 2f64 6976 3e3c 6469 7620 636c 6173 M
A soap │ │ │ -001b0170: 5f73 7461 7475 7320 6572 726f 7220 636f _status error co │ │ │ -001b0180: 6465 3a20 6f75 7420 6f66 206d 656d 6f72 de: out of memor │ │ │ -001b0190: 792e 3c2f 6469 763e 3c64 6976 2063 6c61 y.
De │ │ │ -001b01b0: 6669 6e69 7469 6f6e 3a3c 2f62 3e20 7374 finition: st │ │ │ -001b01c0: 6473 6f61 7032 2e68 3a32 3337 313c 2f64 dsoap2.h:2371
.
│ │ │ -001b01e0: 3c21 2d2d 2066 7261 676d 656e 7420 2d2d

│ │ │ -001b0e90: 546f 2070 6173 7320 6120 3c63 6f64 653e To pass a │ │ │ -001b0ea0: 766f 6964 2a3c 2f63 6f64 653e 2061 7267 void* arg │ │ │ -001b0eb0: 756d 656e 7420 746f 2074 6865 2070 6c75 ument to the plu │ │ │ -001b0ec0: 6769 6e27 7320 7265 6769 7374 7279 2066 gin's registry f │ │ │ -001b0ed0: 756e 6374 696f 6e20 7573 653a 3c2f 703e unction use:

│ │ │ -001b0ee0: 0a3c 6469 7620 636c 6173 733d 2266 7261 .
s │ │ │ -001b0f20: 7472 7563 7420 3c2f 7370 616e 3e3c 6120 truct soap *soap = │ │ │ -001b0f90: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap_new();
.
soap_register_ │ │ │ -001b1070: 706c 7567 696e 5f61 7267 3c2f 613e 283c plugin_arg(< │ │ │ -001b1080: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -001b1090: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ -001b10a0: 6874 6d6c 223e 736f 6170 3c2f 613e 2c20 html">soap, │ │ │ -001b10b0: 706c 7567 696e 2c20 6172 6729 3b20 3c2f plugin, arg); .

A │ │ │ -001b10e0: 6464 6974 696f 6e61 6c20 646f 6375 6d65 dditional docume │ │ │ -001b10f0: 6e74 6174 696f 6e20 666f 7220 7468 6520 ntation for the │ │ │ -001b1100: 6772 6f77 696e 6720 6e75 6d62 6572 206f growing number o │ │ │ -001b1110: 6620 6753 4f41 5020 706c 7567 696e 7320 f gSOAP plugins │ │ │ -001b1120: 6361 6e20 6265 2066 6f75 6e64 2061 7420 can be found at │ │ │ -001b1130: 3c61 2068 7265 663d 2268 7474 7073 3a2f https://ww │ │ │ -001b1160: 772e 6765 6e69 7669 612e 636f 6d2f 646f w.genivia.com/do │ │ │ -001b1170: 633c 2f61 3e2e 2041 206e 756d 6265 7220 c. A number │ │ │ -001b1180: 6f66 2065 7861 6d70 6c65 2070 6c75 6769 of example plugi │ │ │ -001b1190: 6e73 2061 7265 2069 6e63 6c75 6465 6420 ns are included │ │ │ -001b11a0: 696e 2074 6865 2067 534f 4150 2073 6f75 in the gSOAP sou │ │ │ -001b11b0: 7263 6520 636f 6465 2070 6163 6b61 6765 rce code package │ │ │ -001b11c0: 2773 203c 656d 3e3c 636f 6465 3e67 736f 's gso │ │ │ -001b11d0: 6170 2f70 6c75 6769 6e3c 2f63 6f64 653e ap/plugin │ │ │ -001b11e0: 3c2f 656d 3e20 6469 7265 6374 6f72 792e directory. │ │ │ -001b11f0: 2053 6f6d 6520 6f66 2074 6865 7365 2070 Some of these p │ │ │ -001b1200: 6c75 6769 6e73 2061 7265 2064 6973 6375 lugins are discu │ │ │ -001b1210: 7373 6564 2069 6e20 7468 6520 6e65 7874 ssed in the next │ │ │ -001b1220: 2073 6563 7469 6f6e 732e 3c2f 703e 0a3c sections.

.< │ │ │ -001b1230: 703e 5365 6520 616c 736f 2041 5049 2064 p>See also API d │ │ │ -001b1240: 6f63 756d 656e 7461 7469 6f6e 204d 6f64 ocumentation Mod │ │ │ -001b1250: 756c 6520 3c61 2063 6c61 7373 3d22 656c ule Plugins and p │ │ │ -001b1290: 6c75 6769 6e20 7265 6769 7374 7279 2066 lugin registry f │ │ │ -001b12a0: 756e 6374 696f 6e73 3c2f 613e 202e 3c2f unctions ..

.... Back to t │ │ │ -001b12d0: 6162 6c65 206f 6620 636f 6e74 656e 7473 able of contents │ │ │ -001b12e0: 3c2f 613e 3c2f 703e 0a3c 6833 3e3c 6120

.

.DOM │ │ │ -001b1310: 2041 5049 206f 7665 7276 6965 773c 2f68 API overview.

The DOM AP │ │ │ -001b1330: 4920 6973 206e 6f74 2061 2070 6c75 6769 I is not a plugi │ │ │ -001b1340: 6e2c 2062 7574 2061 6e20 6578 7465 6e73 n, but an extens │ │ │ -001b1350: 696f 6e20 7468 6174 2070 726f 7669 6465 ion that provide │ │ │ -001b1360: 7320 6120 444f 4d20 4150 4920 6173 2061 s a DOM API as a │ │ │ -001b1370: 2073 6570 6172 6174 6520 736f 7572 6365 separate source │ │ │ -001b1380: 2063 6f64 6520 6669 6c65 2074 6f20 636f code file to co │ │ │ -001b1390: 6d70 696c 6520 616e 6420 6c69 6e6b 2077 mpile and link w │ │ │ -001b13a0: 6974 6820 6753 4f41 5020 6170 706c 6963 ith gSOAP applic │ │ │ -001b13b0: 6174 696f 6e73 2074 6f20 656e 6162 6c65 ations to enable │ │ │ -001b13c0: 6420 7468 6520 6753 4f41 5020 444f 4d2e d the gSOAP DOM. │ │ │ -001b13d0: 2058 4d4c 2044 4f4d 2070 726f 6365 7373 XML DOM process │ │ │ -001b13e0: 696e 6720 6973 206f 7074 696f 6e61 6c2c ing is optional, │ │ │ -001b13f0: 2061 6e64 2065 6e61 626c 6564 2077 6974 and enabled wit │ │ │ -001b1400: 6820 3c61 2068 7265 663d 2223 7773 646c h w │ │ │ -001b1420: 7364 6c32 6820 2d64 3c2f 636f 6465 3e3c sdl2h -d< │ │ │ -001b1430: 2f62 3e20 6f70 7469 6f6e 203c 623e 3c63 /b> option -d to generat │ │ │ -001b1460: 6520 444f 4d20 7374 7275 6374 7572 6573 e DOM structures │ │ │ -001b1470: 2066 6f72 203c 656d 3e3c 636f 6465 3e78 for x │ │ │ -001b1480: 7364 3a61 6e79 5479 7065 3c2f 636f 6465 sd:anyType, xsd:any │ │ │ -001b14b0: 3c2f 656d 3e2c 2061 6e64 203c 656d 3e3c , and < │ │ │ -001b14c0: 636f 6465 3e78 7364 3a61 6e79 4174 7472 code>xsd:anyAttr │ │ │ -001b14d0: 6962 7574 653c 2f63 6f64 653e 3c2f 656d ibute schema compone │ │ │ -001b14f0: 6e74 732c 2077 6869 6368 2061 7265 2065 nts, which are e │ │ │ -001b1500: 6e61 626c 6564 2077 6974 6820 3c63 6f64 nabled with #import "dom.h │ │ │ -001b1520: 223c 2f63 6f64 653e 2069 6e20 616e 2069 " in an i │ │ │ -001b1530: 6e74 6572 6661 6365 2068 6561 6465 7220 nterface header │ │ │ -001b1540: 6669 6c65 2066 6f72 2073 6f61 7063 7070 file for soapcpp │ │ │ -001b1550: 322e 2054 6869 7320 696d 706f 7274 7320 2. This imports │ │ │ -001b1560: 3c65 6d3e 3c63 6f64 653e 6773 6f61 702f gsoap/ │ │ │ -001b1570: 696d 706f 7274 2f64 6f6d 2e68 3c2f 636f import/dom.h. Then c │ │ │ -001b1590: 6f6d 7069 6c65 203c 656d 3e3c 636f 6465 ompile gsoap/dom.c for C o │ │ │ -001b15c0: 7220 3c65 6d3e 3c63 6f64 653e 6773 6f61 r gsoa │ │ │ -001b15d0: 702f 646f 6d2e 6370 703c 2f63 6f64 653e p/dom.cpp │ │ │ -001b15e0: 3c2f 656d 3e20 666f 7220 432b 2b20 7769 for C++ wi │ │ │ -001b15f0: 7468 2079 6f75 7220 6170 706c 6963 6174 th your applicat │ │ │ -001b1600: 696f 6e2e 3c2f 703e 0a3c 703e 546f 2075 ion.

.

To u │ │ │ -001b1610: 7365 2074 6865 2044 4f4d 2041 5049 2077 se the DOM API w │ │ │ -001b1620: 6974 6820 5765 6220 7365 7276 6963 6573 ith Web services │ │ │ -001b1630: 2c20 6164 6420 3c63 6f64 653e 2369 6d70 , add #imp │ │ │ -001b1640: 6f72 7420 2264 6f6d 2e68 223c 2f63 6f64 ort "dom.h" to the interf │ │ │ -001b1660: 6163 6520 6865 6164 6572 2066 696c 6520 ace header file │ │ │ -001b1670: 6f72 2075 7365 203c 6120 6872 6566 3d22 or use wsdl2h -d option │ │ │ -001b16b0: 3c62 3e3c 636f 6465 3e2d 643c 2f63 6f64 -d:

. │ │ │ -001b16d0: 3c64 6976 2063 6c61 7373 3d22 6672 6167
#import " │ │ │ -001b1720: 3b64 6f6d 2e68 2671 756f 743b 3c2f 7370 ;dom.h"
.
│ │ │ -001b1740: 3c21 2d2d 2066 7261 676d 656e 7420 2d2d

│ │ │ -001b1cd0: 546f 206d 616e 6970 756c 6174 6520 7468 To manipulate th │ │ │ -001b1ce0: 6520 444f 4d20 656c 656d 656e 7473 2061 e DOM elements a │ │ │ -001b1cf0: 6e64 2061 7474 7269 6275 7465 7320 7765 nd attributes we │ │ │ -001b1d00: 2075 7365 2074 6865 2044 4f4d 2041 5049 use the DOM API │ │ │ -001b1d10: 2066 756e 6374 696f 6e73 2064 6f63 756d functions docum │ │ │ -001b1d20: 656e 7465 6420 696e 2074 6865 2067 534f ented in the gSO │ │ │ -001b1d30: 4150 203c 6120 6872 6566 3d22 2e2e 2f2e AP XML DOM A │ │ │ -001b1d60: 5049 2064 6f63 756d 656e 7461 7469 6f6e PI documentation │ │ │ -001b1d70: 3c2f 613e 2e3c 2f70 3e0a 3c70 3ef0 9f94 .

.

... │ │ │ -001b1d80: 9d20 3c61 2068 7265 663d 2223 223e 4261 . Ba │ │ │ -001b1d90: 636b 2074 6f20 7461 626c 6520 6f66 2063 ck to table of c │ │ │ -001b1da0: 6f6e 7465 6e74 733c 2f61 3e3c 2f70 3e0a ontents

. │ │ │ -001b1db0: 3c68 333e 3c61 2063 6c61 7373 3d22 616e

.Th │ │ │ -001b1de0: 6520 6d65 7373 6167 6520 6c6f 6767 696e e message loggin │ │ │ -001b1df0: 6720 706c 7567 696e 3c2f 6833 3e0a 3c70 g plugin

.

The message logging plugin │ │ │ -001b1eb0: 6361 6e20 6265 2075 7365 6420 746f 2073 can be used to s │ │ │ -001b1ec0: 656c 6563 7469 7665 6c79 206c 6f67 2069 electively log i │ │ │ -001b1ed0: 6e62 6f75 6e64 2061 6e64 206f 7574 626f nbound and outbo │ │ │ -001b1ee0: 756e 6420 6d65 7373 6167 6573 2074 6f20 und messages to │ │ │ -001b1ef0: 6120 6669 6c65 206f 7220 7374 7265 616d a file or stream │ │ │ -001b1f00: 2e20 4974 2061 6c73 6f20 6b65 6570 7320 . It also keeps │ │ │ -001b1f10: 6163 6365 7373 2073 7461 7469 7374 6963 access statistic │ │ │ -001b1f20: 7320 746f 206c 6f67 2074 6865 2074 6f74 s to log the tot │ │ │ -001b1f30: 616c 206e 756d 6265 7220 6f66 2062 7974 al number of byt │ │ │ -001b1f40: 6573 2073 656e 7420 616e 6420 7265 6365 es sent and rece │ │ │ -001b1f50: 6976 6564 2e3c 2f70 3e0a 3c70 3e54 6f20 ived.

.

To │ │ │ -001b1f60: 7573 6520 7468 6520 706c 7567 696e 2c20 use the plugin, │ │ │ -001b1f70: 636f 6d70 696c 6520 616e 6420 6c69 6e6b compile and link │ │ │ -001b1f80: 2079 6f75 7220 6170 706c 6963 6174 696f your applicatio │ │ │ -001b1f90: 6e20 7769 7468 203c 656d 3e3c 636f 6465 n with logging.c located i │ │ │ -001b1fc0: 6e20 7468 6520 3c65 6d3e 3c63 6f64 653e n the │ │ │ -001b1fd0: 6773 6f61 702f 706c 7567 696e 3c2f 636f gsoap/plugin directo │ │ │ -001b1ff0: 7279 206f 6620 7468 6520 6753 4f41 5020 ry of the gSOAP │ │ │ -001b2000: 7061 636b 6167 652e 2054 6f20 656e 6162 package. To enab │ │ │ -001b2010: 6c65 2074 6865 2070 6c75 6769 6e20 696e le the plugin in │ │ │ -001b2020: 2079 6f75 7220 636f 6465 2c20 7265 6769 your code, regi │ │ │ -001b2030: 7374 6572 2074 6865 2070 6c75 6769 6e20 ster the plugin │ │ │ -001b2040: 616e 6420 7365 7420 7468 6520 7374 7265 and set the stre │ │ │ -001b2050: 616d 7320 6173 2066 6f6c 6c6f 7773 3a3c ams as follows:< │ │ │ -001b2060: 2f70 3e0a 3c64 6976 2063 6c61 7373 3d22 /p>.

#include │ │ │ -001b20b0: 2671 756f 743b 6c6f 6767 696e 672e 6826 "logging.h& │ │ │ -001b20c0: 7175 6f74 3b3c 2f73 7061 6e3e 203c 2f64 quot; .
. │ │ │ -001b2100: 3c73 7061 6e20 636c 6173 733d 226b 6579 struct
soap< │ │ │ -001b2150: 2f61 3e20 2a3c 6120 636c 6173 733d 2263 /a> *soap │ │ │ -001b2180: 3c2f 613e 203d 203c 6120 636c 6173 733d = soap │ │ │ -001b21e0: 5f6e 6577 3c2f 613e 2829 3b3c 2f64 6976 _new();
.
si │ │ │ -001b2220: 7a65 5f74 3c2f 7370 616e 3e20 6279 7465 ze_t byte │ │ │ -001b2230: 735f 696e 3b20 3c2f 6469 763e 0a3c 6469 s_in;
.< │ │ │ -001b2250: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -001b2260: 6f72 6474 7970 6522 3e73 697a 655f 743c ordtype">size_t< │ │ │ -001b2270: 2f73 7061 6e3e 2062 7974 6573 5f6f 7574 /span> bytes_out │ │ │ -001b2280: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
if ( │ │ │ -001b22c0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap_registe │ │ │ -001b2320: 725f 706c 7567 696e 3c2f 613e 283c 6120 r_plugin(soap, logging)) < │ │ │ -001b23c0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
... // failed to │ │ │ -001b2400: 2072 6567 6973 7465 7220 3c2f 7370 616e register
.
... //...
... │ │ │ -001b25f0: 203c 7370 616e 2063 6c61 7373 3d22 636f // proces │ │ │ -001b2610: 7320 6d65 7373 6167 6573 3c2f 7370 616e s messages
.
soa │ │ │ -001b2690: 705f 7365 745f 6c6f 6767 696e 675f 696e p_set_logging_in │ │ │ -001b26a0: 626f 756e 643c 2f61 3e28 3c61 2063 6c61 bound(soap, NULL) │ │ │ -001b26e0: 3b20 3c73 7061 6e20 636c 6173 733d 2263 ; // disab │ │ │ -001b2700: 6c65 206c 6f67 6769 6e67 203c 2f73 7061 le logging
.
so │ │ │ -001b2780: 6170 5f73 6574 5f6c 6f67 6769 6e67 5f6f ap_set_logging_o │ │ │ -001b2790: 7574 626f 756e 643c 2f61 3e28 3c61 2063 utbound(soap, NUL │ │ │ -001b27d0: 4c29 3b20 3c73 7061 6e20 636c 6173 733d L); // dis │ │ │ -001b27f0: 6162 6c65 206c 6f67 6769 6e67 203c 2f73 able logging
.
│ │ │ -001b2870: 736f 6170 5f6c 6f67 6769 6e67 5f73 7461 soap_logging_sta │ │ │ -001b2880: 7473 3c2f 613e 283c 6120 636c 6173 733d ts(so │ │ │ -001b28b0: 6170 3c2f 613e 2c20 2661 6d70 3b62 7974 ap, &byt │ │ │ -001b28c0: 6573 5f6f 7574 2c20 2661 6d70 3b62 7974 es_out, &byt │ │ │ -001b28d0: 6573 5f69 6e29 3b3c 2f64 6976 3e0a 3c64 es_in);
. │ │ │ -001b28f0: 2e2e 2e20 3c73 7061 6e20 636c 6173 733d ... //
.
s │ │ │ -001b2980: 6f61 705f 7265 7365 745f 6c6f 6767 696e oap_reset_loggin │ │ │ -001b2990: 675f 7374 6174 733c 2f61 3e28 3c61 2063 g_stats(soap);.
soap_set_loggin │ │ │ -001b2a90: 675f 6f75 7462 6f75 6e64 3c2f 613e 3c2f g_outbound
void soa │ │ │ -001b2ac0: 705f 7365 745f 6c6f 6767 696e 675f 6f75 p_set_logging_ou │ │ │ -001b2ad0: 7462 6f75 6e64 2873 7472 7563 7420 736f tbound(struct so │ │ │ -001b2ae0: 6170 202a 736f 6170 2c20 4649 4c45 202a ap *soap, FILE * │ │ │ -001b2af0: 6664 293c 2f64 6976 3e3c 6469 7620 636c fd)
Spec │ │ │ -001b2b10: 6966 7920 6f75 7462 6f75 6e64 206d 6573 ify outbound mes │ │ │ -001b2b20: 7361 6765 206c 6f67 6769 6e67 2077 6974 sage logging wit │ │ │ -001b2b30: 6820 7468 6520 6c6f 6767 696e 6720 706c h the logging pl │ │ │ -001b2b40: 7567 696e 2e3c 2f64 6976 3e3c 2f64 6976 ugin.
.
void soap_r │ │ │ -001b2c40: 6573 6574 5f6c 6f67 6769 6e67 5f73 7461 eset_logging_sta │ │ │ -001b2c50: 7473 2873 7472 7563 7420 736f 6170 202a ts(struct soap * │ │ │ -001b2c60: 736f 6170 293c 2f64 6976 3e3c 6469 7620 soap)
Re │ │ │ -001b2c80: 7365 7420 6d65 7373 6167 696e 6720 7374 set messaging st │ │ │ -001b2c90: 6174 6973 7469 6373 2077 6974 6820 7468 atistics with th │ │ │ -001b2ca0: 6520 6c6f 6767 696e 6720 706c 7567 696e e logging plugin │ │ │ -001b2cb0: 2e3c 2f64 6976 3e3c 2f64 6976 3e0a 3c64 .
.
void │ │ │ -001b2da0: 736f 6170 5f6c 6f67 6769 6e67 5f73 7461 soap_logging_sta │ │ │ -001b2db0: 7473 2873 7472 7563 7420 736f 6170 202a ts(struct soap * │ │ │ -001b2dc0: 736f 6170 2c20 7369 7a65 5f74 202a 7365 soap, size_t *se │ │ │ -001b2dd0: 6e74 2c20 7369 7a65 5f74 202a 7265 6376 nt, size_t *recv │ │ │ -001b2de0: 293c 2f64 6976 3e3c 6469 7620 636c 6173 )
Collec │ │ │ -001b2e00: 7420 6d65 7373 6167 696e 6720 7374 6174 t messaging stat │ │ │ -001b2e10: 6973 7469 6373 2077 6974 6820 7468 6520 istics with the │ │ │ -001b2e20: 6c6f 6767 696e 6720 706c 7567 696e 2e3c logging plugin.< │ │ │ -001b2e30: 2f64 6976 3e3c 2f64 6976 3e0a 3c64 6976 /div>
.
< │ │ │ -001b2e90: 6469 7620 636c 6173 733d 2274 746e 616d div class="ttnam │ │ │ -001b2ea0: 6522 3e3c 6120 6872 6566 3d22 6772 6f75 e">soap_se │ │ │ -001b2ef0: 745f 6c6f 6767 696e 675f 696e 626f 756e t_logging_inboun │ │ │ -001b2f00: 643c 2f61 3e3c 2f64 6976 3e3c 6469 7620 d
v │ │ │ -001b2f20: 6f69 6420 736f 6170 5f73 6574 5f6c 6f67 oid soap_set_log │ │ │ -001b2f30: 6769 6e67 5f69 6e62 6f75 6e64 2873 7472 ging_inbound(str │ │ │ -001b2f40: 7563 7420 736f 6170 202a 736f 6170 2c20 uct soap *soap, │ │ │ -001b2f50: 4649 4c45 202a 6664 293c 2f64 6976 3e3c FILE *fd)
< │ │ │ -001b2f60: 6469 7620 636c 6173 733d 2274 7464 6f63 div class="ttdoc │ │ │ -001b2f70: 223e 5370 6563 6966 7920 696e 626f 756e ">Specify inboun │ │ │ -001b2f80: 6420 6d65 7373 6167 6520 6c6f 6767 696e d message loggin │ │ │ -001b2f90: 6720 7769 7468 2074 6865 206c 6f67 6769 g with the loggi │ │ │ -001b2fa0: 6e67 2070 6c75 6769 6e2e 3c2f 6469 763e ng plugin.
│ │ │ -001b2fb0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
logging< │ │ │ -001b3070: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
int log │ │ │ -001b3090: 6769 6e67 2873 7472 7563 7420 736f 6170 ging(struct soap │ │ │ -001b30a0: 202a 2c20 7374 7275 6374 2073 6f61 705f *, struct soap_ │ │ │ -001b30b0: 706c 7567 696e 202a 2c20 766f 6964 202a plugin *, void * │ │ │ -001b30c0: 293c 2f64 6976 3e3c 6469 7620 636c 6173 )
The lo │ │ │ -001b30e0: 6767 696e 6720 706c 7567 696e 2072 6567 gging plugin reg │ │ │ -001b30f0: 6973 7472 6174 696f 6e20 6675 6e63 7469 istration functi │ │ │ -001b3100: 6f6e 2e3c 2f64 6976 3e3c 2f64 6976 3e0a on.
. │ │ │ -001b3110: 3c2f 6469 763e 3c21 2d2d 2066 7261 676d

If you │ │ │ -001b3130: 2075 7365 203c 636f 6465 3e3c 6120 636c use soap_copy< │ │ │ -001b31f0: 2f61 3e3c 2f63 6f64 653e 2074 6f20 636f /a> to co │ │ │ -001b3200: 7079 2074 6865 203c 636f 6465 3e3c 6120 py the soap context │ │ │ -001b3270: 2077 6974 6820 7468 6520 706c 7567 696e with the plugin │ │ │ -001b3280: 2c20 7468 6520 706c 7567 696e 2773 2073 , the plugin's s │ │ │ -001b3290: 7461 7465 2077 696c 6c20 6265 2073 6861 tate will be sha │ │ │ -001b32a0: 7265 6420 6279 2074 6865 2063 6f70 792e red by the copy. │ │ │ -001b32b0: 2054 6865 2070 6c75 6769 6e20 6973 2074 The plugin is t │ │ │ -001b32c0: 6872 6561 642d 7361 6665 2c20 6275 7420 hread-safe, but │ │ │ -001b32d0: 646f 6573 206e 6f74 2075 7365 2061 206c does not use a l │ │ │ -001b32e0: 6f63 6b20 746f 2070 726f 7465 6374 2074 ock to protect t │ │ │ -001b32f0: 6865 2069 6e74 6572 6e61 6c20 7374 6174 he internal stat │ │ │ -001b3300: 6973 7469 6373 2063 6f75 6e74 6572 7320 istics counters │ │ │ -001b3310: 746f 2065 6e73 7572 6520 7468 6520 7370 to ensure the sp │ │ │ -001b3320: 6565 6420 6f66 206d 6573 7361 6769 6e67 eed of messaging │ │ │ -001b3330: 2069 7320 6e6f 7420 636f 6d70 726f 6d69 is not compromi │ │ │ -001b3340: 7365 642c 206d 6561 6e69 6e67 2074 6861 sed, meaning tha │ │ │ -001b3350: 7420 796f 7520 7368 6f75 6c64 206e 6f74 t you should not │ │ │ -001b3360: 2066 756c 6c79 2072 656c 7920 6f6e 2074 fully rely on t │ │ │ -001b3370: 6865 2073 7461 7469 7374 6963 7320 746f he statistics to │ │ │ -001b3380: 2062 6520 3130 3025 2061 6363 7572 6174 be 100% accurat │ │ │ -001b3390: 6520 666f 7220 6d75 6c74 692d 7468 7265 e for multi-thre │ │ │ -001b33a0: 6164 6564 2073 6572 7669 6365 732e 3c2f aded services..

See also < │ │ │ -001b33c0: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>logging< │ │ │ -001b3450: 2f61 3e3c 2f63 6f64 653e 2e3c 2f70 3e0a /a>.

. │ │ │ -001b3460: 3c70 3ef0 9f94 9d20 3c61 2068 7265 663d

.... Back to tabl │ │ │ -001b3480: 6520 6f66 2063 6f6e 7465 6e74 733c 2f61 e of contents

.

.RESTful s │ │ │ -001b34d0: 6572 7665 722d 7369 6465 2041 5049 2077 erver-side API w │ │ │ -001b34e0: 6974 6820 7468 6520 4854 5450 2047 4554 ith the HTTP GET │ │ │ -001b34f0: 2070 6c75 6769 6e3c 2f68 333e 0a3c 703e plugin

.

│ │ │ -001b3500: 5365 7276 6572 2d73 6964 6520 7573 6520 Server-side use │ │ │ -001b3510: 6f66 2052 4553 5466 756c 2048 5454 5020 of RESTful HTTP │ │ │ -001b3520: 4745 5420 6f70 6572 6174 696f 6e73 2069 GET operations i │ │ │ -001b3530: 7320 7375 7070 6f72 7465 6420 7769 7468 s supported with │ │ │ -001b3540: 2074 6865 203c 636f 6465 3e3c 6120 636c the http │ │ │ -001b35d0: 5f67 6574 3c2f 613e 3c2f 636f 6465 3e20 _get │ │ │ -001b35e0: 4854 5450 2047 4554 2070 6c75 6769 6e20 HTTP GET plugin │ │ │ -001b35f0: 3c65 6d3e 3c63 6f64 653e 6773 6f61 702f gsoap/ │ │ │ -001b3600: 706c 7567 696e 2f68 7474 7067 6574 2e63 plugin/httpget.c │ │ │ -001b3610: 3c2f 636f 6465 3e3c 2f65 6d3e 2e3c 2f70 .

.

The HTTP GE │ │ │ -001b3630: 5420 706c 7567 696e 2061 6c6c 6f77 7320 T plugin allows │ │ │ -001b3640: 796f 7572 2073 6572 7665 7220 746f 2068 your server to h │ │ │ -001b3650: 616e 646c 6520 5245 5354 6675 6c20 4854 andle RESTful HT │ │ │ -001b3660: 5450 2047 4554 2072 6571 7565 7374 7320 TP GET requests │ │ │ -001b3670: 616e 6420 6174 2074 6865 2073 616d 6520 and at the same │ │ │ -001b3680: 7469 6d65 2073 7469 6c6c 2073 6572 7665 time still serve │ │ │ -001b3690: 2053 4f41 502d 6261 7365 6420 504f 5354 SOAP-based POST │ │ │ -001b36a0: 2072 6571 7565 7374 732e 2054 6865 2070 requests. The p │ │ │ -001b36b0: 6c75 6769 6e20 7072 6f76 6964 6573 2073 lugin provides s │ │ │ -001b36c0: 7570 706f 7274 2074 6f20 636c 6965 6e74 upport to client │ │ │ -001b36d0: 2061 7070 6c69 6361 7469 6f6e 7320 746f applications to │ │ │ -001b36e0: 2069 7373 7565 2048 5454 5020 4745 5420 issue HTTP GET │ │ │ -001b36f0: 6f70 6572 6174 696f 6e73 2074 6f20 6120 operations to a │ │ │ -001b3700: 7365 7276 6572 2e3c 2f70 3e0a 3c70 3e4e server.

.

N │ │ │ -001b3710: 6f74 6520 7468 6174 2048 5454 5020 4745 ote that HTTP GE │ │ │ -001b3720: 5420 7265 7175 6573 7473 2063 616e 2061 T requests can a │ │ │ -001b3730: 6c73 6f20 6265 2068 616e 646c 6564 2061 lso be handled a │ │ │ -001b3740: 7420 7468 6520 7365 7276 6572 2073 6964 t the server sid │ │ │ -001b3750: 6520 7769 7468 2074 6865 203c 636f 6465 e with the soap::fget callbac │ │ │ -001b3840: 6b2c 2073 6565 2053 6563 7469 6f6e 203c k, see Section < │ │ │ -001b3850: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ -001b3860: 663d 2269 6e64 6578 2e68 746d 6c23 6361 f="index.html#ca │ │ │ -001b3870: 6c6c 6261 636b 223e 4675 6e63 7469 6f6e llback">Function │ │ │ -001b3880: 2063 616c 6c62 6163 6b73 2066 6f72 2063 callbacks for c │ │ │ -001b3890: 7573 746f 6d69 7a65 6420 492f 4f20 616e ustomized I/O an │ │ │ -001b38a0: 6420 4854 5450 2068 616e 646c 696e 673c d HTTP handling< │ │ │ -001b38b0: 2f61 3e20 2e20 486f 7765 7665 722c 2074 /a> . However, t │ │ │ -001b38c0: 6865 2048 5454 5020 4745 5420 706c 7567 he HTTP GET plug │ │ │ -001b38d0: 696e 2061 6c73 6f20 6b65 6570 7320 7374 in also keeps st │ │ │ -001b38e0: 6174 6973 7469 6373 206f 6e20 7468 6520 atistics on the │ │ │ -001b38f0: 6e75 6d62 6572 206f 6620 7375 6363 6573 number of succes │ │ │ -001b3900: 7366 756c 2050 4f53 5420 616e 6420 4745 sful POST and GE │ │ │ -001b3910: 5420 6578 6368 616e 6765 7320 616e 6420 T exchanges and │ │ │ -001b3920: 6661 696c 6564 206f 7065 7261 7469 6f6e failed operation │ │ │ -001b3930: 7320 2848 5454 5020 6661 756c 7473 2c20 s (HTTP faults, │ │ │ -001b3940: 534f 4150 2046 6175 6c74 732c 2065 7463 SOAP Faults, etc │ │ │ -001b3950: 2e29 2e20 4974 2061 6c73 6f20 6b65 6570 .). It also keep │ │ │ -001b3960: 7320 6869 7420 6869 7374 6f67 7261 6d73 s hit histograms │ │ │ -001b3970: 2061 6363 756d 756c 6174 6564 2066 6f72 accumulated for │ │ │ -001b3980: 2075 7020 746f 2061 2079 6561 7220 6f66 up to a year of │ │ │ -001b3990: 2072 756e 6e69 6e67 2074 696d 652e 3c2f running time..

To use the │ │ │ -001b39b0: 203c 636f 6465 3e3c 6120 636c 6173 733d http_get │ │ │ -001b3a40: 3c2f 613e 3c2f 636f 6465 3e20 706c 7567 plug │ │ │ -001b3a50: 696e 2c20 636f 6d70 696c 6520 616e 6420 in, compile and │ │ │ -001b3a60: 6c69 6e6b 2079 6f75 7220 6170 706c 6963 link your applic │ │ │ -001b3a70: 6174 696f 6e20 7769 7468 203c 656d 3e3c ation with < │ │ │ -001b3a80: 636f 6465 3e68 7474 7067 6574 2e63 3c2f code>httpget.c locat │ │ │ -001b3aa0: 6564 2069 6e20 7468 6520 3c65 6d3e 3c63 ed in the gsoap/plugin │ │ │ -001b3ac0: 3c2f 636f 6465 3e3c 2f65 6d3e 2064 6972 dir │ │ │ -001b3ad0: 6563 746f 7279 206f 6620 7468 6520 6753 ectory of the gS │ │ │ -001b3ae0: 4f41 5020 7061 636b 6167 652e 2054 6f20 OAP package. To │ │ │ -001b3af0: 656e 6162 6c65 2074 6865 2070 6c75 6769 enable the plugi │ │ │ -001b3b00: 6e20 696e 2079 6f75 7220 636f 6465 2c20 n in your code, │ │ │ -001b3b10: 7265 6769 7374 6572 2074 6865 2070 6c75 register the plu │ │ │ -001b3b20: 6769 6e20 7769 7468 2079 6f75 7220 4854 gin with your HT │ │ │ -001b3b30: 5450 2047 4554 2068 616e 646c 6572 2066 TP GET handler f │ │ │ -001b3b40: 756e 6374 696f 6e20 6173 2066 6f6c 6c6f unction as follo │ │ │ -001b3b50: 7773 3a3c 2f70 3e0a 3c64 6976 2063 6c61 ws:

.
│ │ │ -001b3b80: 3c73 7061 6e20 636c 6173 733d 2270 7265 #incl │ │ │ -001b3ba0: 7564 6520 2671 756f 743b 6874 7470 6765 ude "httpge │ │ │ -001b3bb0: 742e 6826 7175 6f74 3b3c 2f73 7061 6e3e t.h" │ │ │ -001b3bc0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ -001b3be0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
int │ │ │ -001b3c10: 3c2f 7370 616e 3e20 6d61 696e 2829 3c2f main().
{
.< │ │ │ -001b3c40: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -001b3c50: 3e20 203c 7370 616e 2063 6c61 7373 3d22 > struct │ │ │ -001b3c70: 3c2f 7370 616e 3e3c 6120 636c 6173 733d so │ │ │ -001b3ca0: 6170 3c2f 613e 202a 3c61 2063 6c61 7373 ap *s │ │ │ -001b3cd0: 6f61 703c 2f61 3e20 3d20 3c61 2063 6c61 oap = s │ │ │ -001b3d30: 6f61 705f 6e65 773c 2f61 3e28 293b 3c2f oap_new();.
if (soap_register_ │ │ │ -001b3de0: 706c 7567 696e 5f61 7267 3c2f 613e 283c plugin_arg(< │ │ │ -001b3df0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -001b3e00: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ -001b3e10: 6874 6d6c 223e 736f 6170 3c2f 613e 2c20 html">soap, │ │ │ -001b3e20: 3c61 2063 6c61 7373 3d22 636f 6465 2220 │ │ │ -001b3e70: 6874 7470 5f67 6574 3c2f 613e 2c20 283c http_get, (< │ │ │ -001b3e80: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -001b3e90: 6f72 6474 7970 6522 3e76 6f69 643c 2f73 ordtype">void*)my_http_ge │ │ │ -001b3eb0: 745f 6861 6e64 6c65 7229 2920 3c2f 6469 t_handler)) .
soap │ │ │ -001b3f30: 5f70 7269 6e74 5f66 6175 6c74 3c2f 613e _print_fault │ │ │ -001b3f40: 283c 6120 636c 6173 733d 2263 6f64 6522 (soap │ │ │ -001b3f70: 2c20 7374 6465 7272 293b 203c 7370 616e , stderr); // failed to re │ │ │ -001b3fa0: 6769 7374 6572 203c 2f73 7061 6e3e 3c2f gister .
... //.
str │ │ │ -001b4020: 7563 7420 3c2f 7370 616e 3e68 7474 705f uct http_ │ │ │ -001b4030: 6765 745f 6461 7461 202a 6874 7470 6765 get_data *httpge │ │ │ -001b4040: 7464 6174 613b 203c 2f64 6976 3e0a 3c64 tdata;
. │ │ │ -001b4060: 2020 6874 7470 6765 7464 6174 6120 3d20 httpgetdata = │ │ │ -001b4070: 283c 7370 616e 2063 6c61 7373 3d22 6b65 (struct http_get_da │ │ │ -001b40a0: 7461 2a29 736f 6170 5f6c 6f6f 6b75 705f ta*)soap_lookup_ │ │ │ -001b40b0: 706c 7567 696e 283c 6120 636c 6173 733d plugin(so │ │ │ -001b40e0: 6170 3c2f 613e 2c20 6874 7470 5f67 6574 ap, http_get │ │ │ -001b40f0: 5f69 6429 3b20 3c2f 6469 763e 0a3c 6469 _id);
. │ │ │ -001b4110: 203c 7370 616e 2063 6c61 7373 3d22 6b65 if (!httpgetda │ │ │ -001b4140: 7461 2920 3c2f 6469 763e 0a3c 6469 7620 ta)
.
│ │ │ -001b4160: 202e 2e2e 203c 7370 616e 2063 6c61 7373 ... // if │ │ │ -001b4180: 2074 6865 2070 6c75 6769 6e20 7265 6769 the plugin regi │ │ │ -001b4190: 7374 6572 6564 204f 4b2c 2074 6865 7265 stered OK, there │ │ │ -001b41a0: 2069 7320 6365 7274 6169 6e6c 7920 6461 is certainly da │ │ │ -001b41b0: 7461 2062 7574 2063 616e 2623 3339 3b74 ta but can't │ │ │ -001b41c0: 2068 7572 7420 746f 2063 6865 636b 203c hurt to check < │ │ │ -001b41d0: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
. │ │ │ -001b41f0: 202e 2e2e 203c 7370 616e 2063 6c61 7373 ... // pr │ │ │ -001b4210: 6f63 6573 7320 6d65 7373 6167 6573 3c2f ocess messages
.
│ │ │ -001b4240: 3c73 7061 6e20 636c 6173 733d 226b 6579 size_t │ │ │ -001b4260: 3c2f 7370 616e 3e20 6765 745f 6f6b 203d get_ok = │ │ │ -001b4270: 2068 7474 7067 6574 6461 7461 2d26 6774 httpgetdata-> │ │ │ -001b4280: 3b73 7461 745f 6765 743b 203c 2f64 6976 ;stat_get;
.
│ │ │ -001b42c0: 7369 7a65 5f74 3c2f 7370 616e 3e20 706f size_t po │ │ │ -001b42d0: 7374 5f6f 6b20 3d20 6874 7470 6765 7464 st_ok = httpgetd │ │ │ -001b42e0: 6174 612d 2667 743b 7374 6174 5f70 6f73 ata->stat_pos │ │ │ -001b42f0: 743b 203c 2f64 6976 3e0a 3c64 6976 2063 t;
.
size_t errors = h │ │ │ -001b4340: 7474 7067 6574 6461 7461 2d26 6774 3b73 ttpgetdata->s │ │ │ -001b4350: 7461 745f 6661 696c 3b20 3c2f 6469 763e tat_fail;
│ │ │ -001b4360: 0a3c 6469 7620 636c 6173 733d 226c 696e .
time_t now │ │ │ -001b4380: 3d20 7469 6d65 284e 554c 4c29 3b20 3c2f = time(NULL); .
s │ │ │ -001b43c0: 7472 7563 7420 3c2f 7370 616e 3e74 6d20 truct tm │ │ │ -001b43d0: 2a54 3b20 3c2f 6469 763e 0a3c 6469 7620 *T;
.
T │ │ │ -001b43f0: 203d 206c 6f63 616c 7469 6d65 2826 616d = localtime(&am │ │ │ -001b4400: 703b 6e6f 7729 3b20 3c2f 6469 763e 0a3c p;now);
.< │ │ │ -001b4410: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -001b4420: 3e20 203c 7370 616e 2063 6c61 7373 3d22 > siz │ │ │ -001b4440: 655f 743c 2f73 7061 6e3e 2068 6974 7374 e_t hitst │ │ │ -001b4450: 6869 736d 696e 7574 6520 3d20 6874 7470 hisminute = http │ │ │ -001b4460: 6765 7464 6174 612d 2667 743b 6869 7374 getdata->hist │ │ │ -001b4470: 5f6d 696e 5b54 2d26 6774 3b74 6d5f 6d69 _min[T->tm_mi │ │ │ -001b4480: 6e5d 3b20 3c2f 6469 763e 0a3c 6469 7620 n];
.
< │ │ │ -001b44a0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -001b44b0: 6f72 6474 7970 6522 3e73 697a 655f 743c ordtype">size_t< │ │ │ -001b44c0: 2f73 7061 6e3e 2068 6974 7374 6869 7368 /span> hitsthish │ │ │ -001b44d0: 6f75 7220 3d20 6874 7470 6765 7464 6174 our = httpgetdat │ │ │ -001b44e0: 612d 2667 743b 6869 7374 5f68 6f75 725b a->hist_hour[ │ │ │ -001b44f0: 542d 2667 743b 746d 5f68 6f75 725d 3b20 T->tm_hour]; │ │ │ -001b4500: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
size_t hitstoday = h │ │ │ -001b4550: 7474 7067 6574 6461 7461 2d26 6774 3b68 ttpgetdata->h │ │ │ -001b4560: 6973 745f 6461 795b 542d 2667 743b 746d ist_day[T->tm │ │ │ -001b4570: 5f79 6461 795d 3b3c 2f64 6976 3e0a 3c64 _yday];
. │ │ │ -001b4590: 7d3c 2f64 6976 3e0a 3c2f 6469 763e 3c21 }
.
< │ │ │ -001b45b0: 703e 416e 2048 5454 5020 4745 5420 6861 p>An HTTP GET ha │ │ │ -001b45c0: 6e64 6c65 7220 6361 6e20 7369 6d70 6c79 ndler can simply │ │ │ -001b45d0: 2070 726f 6475 6365 2073 6f6d 6520 4854 produce some HT │ │ │ -001b45e0: 4d4c 2063 6f6e 7465 6e74 2c20 6f72 2061 ML content, or a │ │ │ -001b45f0: 6e79 206f 7468 6572 2074 7970 6520 6f66 ny other type of │ │ │ -001b4600: 2063 6f6e 7465 6e74 2062 7920 7365 6e64 content by send │ │ │ -001b4610: 696e 6720 6461 7461 2075 7369 6e67 203c ing data using < │ │ │ -001b4620: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soap_ │ │ │ -001b46d0: 7265 7370 6f6e 7365 3c2f 613e 3c2f 636f response:

.
< │ │ │ -001b4700: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -001b4710: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >int my_http_ge │ │ │ -001b4740: 745f 6861 6e64 6c65 7228 3c73 7061 6e20 t_handler( │ │ │ -001b4760: 7374 7275 6374 3c2f 7370 616e 3e20 3c61 struct soap *< │ │ │ -001b47a0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -001b47b0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ -001b47c0: 6874 6d6c 223e 736f 6170 3c2f 613e 2920 html">soap) │ │ │ -001b47d0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
{
│ │ │ -001b47f0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
soap │ │ │ -001b4830: 3c2f 613e 2d26 6774 3b3c 6120 636c 6173 ->http_content = "text/html │ │ │ -001b48c0: 2671 756f 743b 3c2f 7370 616e 3e3b 203c "; < │ │ │ -001b48d0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>..
|| < │ │ │ -001b4a20: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -001b4a30: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ -001b4a40: 705f 5f69 6f2e 6874 6d6c 2367 6137 3731 p__io.html#ga771 │ │ │ -001b4a50: 3266 3562 6333 3631 3237 3035 3061 3131 2f5bc36127050a11 │ │ │ -001b4a60: 6164 3939 3564 3035 3933 6264 6322 3e73 ad995d0593bdc">s │ │ │ -001b4a70: 6f61 705f 7365 6e64 3c2f 613e 283c 6120 oap_send(soap, " │ │ │ -001b4ad0: 266c 743b 6874 6d6c 2667 743b 4865 6c6c <html>Hell │ │ │ -001b4ae0: 6f26 6c74 3b2f 6874 6d6c 2667 743b 2671 o</html>&q │ │ │ -001b4af0: 756f 743b 3c2f 7370 616e 3e29 3c2f 6469 uot;).
|| soap_ │ │ │ -001b4b70: 656e 645f 7365 6e64 3c2f 613e 283c 6120 end_send(soap).. │ │ │ -001b4ca0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 retur │ │ │ -001b4cc0: 6e3c 2f73 7061 6e3e 203c 6120 636c 6173 n SOA │ │ │ -001b4d20: 505f 4f4b 3c2f 613e 3b20 3c73 7061 6e20 P_OK; │ │ │ -001b4d40: 2f2f 2072 6574 7572 6e20 534f 4150 5f4f // return SOAP_O │ │ │ -001b4d50: 4b20 6f72 2048 5454 5020 6572 726f 7220 K or HTTP error │ │ │ -001b4d60: 636f 6465 2c20 652e 672e 2034 3034 203c code, e.g. 404 < │ │ │ -001b4d70: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
.} │ │ │ -001b4d90: 3c2f 6469 763e 0a3c 2f64 6976 3e3c 212d
.

If you use soa │ │ │ -001b4e70: 705f 636f 7079 3c2f 613e 3c2f 636f 6465 p_copy to copy the │ │ │ -001b4ee0: 736f 6170 3c2f 613e 3c2f 636f 6465 3e20 soap │ │ │ -001b4ef0: 636f 6e74 6578 7420 7769 7468 2074 6865 context with the │ │ │ -001b4f00: 2070 6c75 6769 6e2c 2074 6865 2070 6c75 plugin, the plu │ │ │ -001b4f10: 6769 6e27 7320 6461 7461 2077 696c 6c20 gin's data will │ │ │ -001b4f20: 6265 2073 6861 7265 6420 6279 2074 6865 be shared by the │ │ │ -001b4f30: 2063 6f70 792e 2054 6865 7265 666f 7265 copy. Therefore │ │ │ -001b4f40: 2c20 7468 6520 7374 6174 6973 7469 6373 , the statistics │ │ │ -001b4f50: 2061 7265 206e 6f74 2031 3030 2520 6775 are not 100% gu │ │ │ -001b4f60: 6172 616e 7465 6564 2074 6f20 6265 2061 aranteed to be a │ │ │ -001b4f70: 6363 7572 6174 6520 666f 7220 6d75 6c74 ccurate for mult │ │ │ -001b4f80: 692d 7468 7265 6164 6564 2073 6572 7669 i-threaded servi │ │ │ -001b4f90: 6365 7320 7369 6e63 6520 7261 6365 2063 ces since race c │ │ │ -001b4fa0: 6f6e 6469 7469 6f6e 7320 6f6e 2074 6865 onditions on the │ │ │ -001b4fb0: 2063 6f75 6e74 6572 7320 6d61 7920 6f63 counters may oc │ │ │ -001b4fc0: 6375 722e 204d 7574 6578 2069 7320 6e6f cur. Mutex is no │ │ │ -001b4fd0: 7420 7573 6564 2074 6f20 7570 6461 7465 t used to update │ │ │ -001b4fe0: 2074 6865 2063 6f75 6e74 6572 7320 746f the counters to │ │ │ -001b4ff0: 2061 766f 6964 2069 6e74 726f 6475 6369 avoid introduci │ │ │ -001b5000: 6e67 2065 7870 656e 7369 7665 2073 796e ng expensive syn │ │ │ -001b5010: 6368 726f 6e69 7a61 7469 6f6e 2070 6f69 chronization poi │ │ │ -001b5020: 6e74 732e 2049 6620 3130 3025 2073 6572 nts. If 100% ser │ │ │ -001b5030: 7665 722d 7369 6465 2061 6363 7572 6163 ver-side accurac │ │ │ -001b5040: 7920 6973 2072 6571 7569 7265 642c 2061 y is required, a │ │ │ -001b5050: 6464 206d 7574 6578 2061 7420 7468 6520 dd mutex at the │ │ │ -001b5060: 706f 696e 7473 2069 6e64 6963 6174 6564 points indicated │ │ │ -001b5070: 2069 6e20 7468 6520 3c65 6d3e 3c63 6f64 in the httpget.c code.

.

The client- │ │ │ -001b50b0: 7369 6465 2075 7365 206f 6620 4854 5450 side use of HTTP │ │ │ -001b50c0: 2047 4554 2069 7320 7072 6f76 6964 6564 GET is provided │ │ │ -001b50d0: 2062 7920 7468 6520 3c63 6f64 653e 3c61 by the soap_GET operation. │ │ │ -001b5170: 2054 6f20 7265 6365 6976 6520 6120 534f To receive a SO │ │ │ -001b5180: 4150 2f58 4d4c 2028 7265 7370 6f6e 7365 AP/XML (response │ │ │ -001b5190: 2920 6d65 7373 6167 6520 3c65 6d3e 3c63 ) message ns:methodRes │ │ │ -001b51b0: 706f 6e73 653c 2f63 6f64 653e 3c2f 656d ponse, use:

.
in │ │ │ -001b5210: 743c 2f73 7061 6e3e 206d 6169 6e28 293c t main()< │ │ │ -001b5220: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
{
. │ │ │ -001b5240: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
struct │ │ │ -001b5270: 203c 2f73 7061 6e3e 3c61 2063 6c61 7373 s │ │ │ -001b52a0: 6f61 703c 2f61 3e20 2a3c 6120 636c 6173 oap * │ │ │ -001b52d0: 736f 6170 3c2f 613e 203d 203c 6120 636c soap = │ │ │ -001b5330: 736f 6170 5f6e 6577 3c2f 613e 2829 3b3c soap_new();< │ │ │ -001b5340: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
if (< │ │ │ -001b5380: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -001b5390: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ -001b53a0: 705f 5f69 6f2e 6874 6d6c 2367 6139 3533 p__io.html#ga953 │ │ │ -001b53b0: 6264 6565 3765 6266 3234 3262 3035 3638 bdee7ebf242b0568 │ │ │ -001b53c0: 3334 6535 3539 3230 3739 6165 3922 3e73 34e5592079ae9">s │ │ │ -001b53d0: 6f61 705f 4745 543c 2f61 3e28 3c61 2063 oap_GET(soap, endpoint, NULL))
.
... // error
.
else if (soap_recv │ │ │ -001b5520: 5f6e 735f 5f77 6562 6d65 7468 6f64 5265 _ns__webmethodRe │ │ │ -001b5530: 7370 6f6e 7365 283c 6120 636c 6173 733d sponse(so │ │ │ -001b5560: 6170 3c2f 613e 2c20 2e2e 2e29 2920 3c2f ap, ...)) .
... < │ │ │ -001b5590: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ -001b55a0: 656e 7422 3e2f 2f20 6572 726f 723c 2f73 ent">// error
.
< │ │ │ -001b55d0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -001b55e0: 6f72 6466 6c6f 7722 3e65 6c73 653c 2f73 ordflow">else
.
│ │ │ -001b5610: 2020 2e2e 2e20 3c73 7061 6e20 636c 6173 ... // s │ │ │ -001b5630: 7563 6365 7373 3c2f 7370 616e 3e3c 2f64 uccess.
soap_ │ │ │ -001b56b0: 6465 7374 726f 793c 2f61 3e28 3c61 2063 destroy(soap); ...< │ │ │ -001b5850: 6469 7620 636c 6173 733d 2274 7463 2220 div class="ttc" │ │ │ -001b5860: 6964 3d22 6167 726f 7570 5f5f 6772 6f75 id="agroup__grou │ │ │ -001b5870: 705f 5f69 6f5f 6874 6d6c 5f67 6139 3533 p__io_html_ga953 │ │ │ -001b5880: 6264 6565 3765 6266 3234 3262 3035 3638 bdee7ebf242b0568 │ │ │ -001b5890: 3334 6535 3539 3230 3739 6165 3922 3e3c 34e5592079ae9">< │ │ │ -001b58a0: 6469 7620 636c 6173 733d 2274 746e 616d div class="ttnam │ │ │ -001b58b0: 6522 3e3c 6120 6872 6566 3d22 6772 6f75 e">soap_GET
.
< │ │ │ -001b59c0: 703e 546f 2072 6563 6569 7665 2061 6e79 p>To receive any │ │ │ -001b59d0: 2048 5454 5020 426f 6479 2064 6174 6120 HTTP Body data │ │ │ -001b59e0: 696e 746f 2061 2062 7566 6665 722c 2075 into a buffer, u │ │ │ -001b59f0: 7365 3a3c 2f70 3e0a 3c64 6976 2063 6c61 se:

.
│ │ │ -001b5a20: 3c73 7061 6e20 636c 6173 733d 226b 6579 int main()
.
{
.
.
│ │ │ -001b5ba0: 6368 6172 3c2f 7370 616e 3e20 2a72 6573 char *res │ │ │ -001b5bb0: 706f 6e73 6520 3d20 4e55 4c4c 3b20 3c2f ponse = NULL; .
size_t │ │ │ -001b5c00: 2072 6573 706f 6e73 655f 6c65 6e3b 3c2f response_len;..< │ │ │ -001b5d40: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -001b5d50: 3e20 2020 7c7c 2028 7265 7370 6f6e 7365 > || (response │ │ │ -001b5d60: 203d 203c 6120 636c 6173 733d 2263 6f64 = soap_http_get │ │ │ -001b5dc0: 5f62 6f64 793c 2f61 3e28 3c61 2063 6c61 _body(soap, & │ │ │ -001b5e00: 7265 7370 6f6e 7365 5f6c 656e 2929 203d response_len)) = │ │ │ -001b5e10: 3d20 4e55 4c4c 3c2f 6469 763e 0a3c 6469 = NULL
. │ │ │ -001b5e30: 2020 7c7c 203c 6120 636c 6173 733d 2263 || soap_end_re │ │ │ -001b5e90: 6376 3c2f 613e 2826 616d 703b 3c61 2063 cv(&soap)).
... // error
.
else
.
│ │ │ -001b5f70: 2e2e 2e20 3c73 7061 6e20 636c 6173 733d ... // use │ │ │ -001b5f90: 2074 6865 2072 6573 706f 6e73 6520 7374 the response st │ │ │ -001b5fa0: 7269 6e67 2028 4e55 4c4c 2069 6e64 6963 ring (NULL indic │ │ │ -001b5fb0: 6174 6573 206e 6f20 626f 6479 206f 7220 ates no body or │ │ │ -001b5fc0: 6572 726f 7229 3c2f 7370 616e 3e3c 2f64 error).
soa │ │ │ -001b6040: 705f 6465 7374 726f 793c 2f61 3e28 2661 p_destroy(&a │ │ │ -001b6050: 6d70 3b3c 6120 636c 6173 733d 2263 6f64 mp;soap);
.. │ │ │ -001b6140: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
│ │ │ -001b62e0: 696e 7420 736f 6170 5f65 6e64 5f72 6563 int soap_end_rec │ │ │ -001b62f0: 7628 7374 7275 6374 2073 6f61 7020 2a73 v(struct soap *s │ │ │ -001b6300: 6f61 7029 3c2f 6469 763e 3c64 6976 2063 oap)
Fin │ │ │ -001b6320: 616c 697a 6520 7468 6520 636f 6e74 6578 alize the contex │ │ │ -001b6330: 7420 6166 7465 7220 7265 6365 6976 696e t after receivin │ │ │ -001b6340: 672e 3c2f 6469 763e 3c2f 6469 763e 0a3c g.
.< │ │ │ -001b6350: 6469 7620 636c 6173 733d 2274 7463 2220 div class="ttc" │ │ │ -001b6360: 6964 3d22 6167 726f 7570 5f5f 6772 6f75 id="agroup__grou │ │ │ -001b6370: 705f 5f69 6f5f 6874 6d6c 5f67 6165 3263 p__io_html_gae2c │ │ │ -001b6380: 6433 3766 3837 3564 3333 3134 6565 6333 d37f875d3314eec3 │ │ │ -001b6390: 3134 6238 3732 3365 3266 6664 3822 3e3c 14b8723e2ffd8">< │ │ │ -001b63a0: 6469 7620 636c 6173 733d 2274 746e 616d div class="ttnam │ │ │ -001b63b0: 6522 3e3c 6120 6872 6566 3d22 6772 6f75 e">soap_http_ │ │ │ -001b6400: 6765 745f 626f 6479 3c2f 613e 3c2f 6469 get_body
char * soa │ │ │ -001b6430: 705f 6874 7470 5f67 6574 5f62 6f64 7928 p_http_get_body( │ │ │ -001b6440: 7374 7275 6374 2073 6f61 7020 2a73 6f61 struct soap *soa │ │ │ -001b6450: 702c 2073 697a 655f 7420 2a6c 656e 293c p, size_t *len)< │ │ │ -001b6460: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
Get the │ │ │ -001b6480: 4854 5450 2062 6f64 7920 6d65 7373 6167 HTTP body messag │ │ │ -001b6490: 6520 6173 2061 2073 7472 696e 672e 3c2f e as a string.
.

│ │ │ -001b6d90: 4e6f 7465 2074 6861 7420 3c63 6f64 653e Note that │ │ │ -001b6da0: 2a3c 2f63 6f64 653e 2061 6e64 203c 636f * and - can │ │ │ -001b6dc0: 6265 2075 7365 6420 6173 2077 696c 6463 be used as wildc │ │ │ -001b6dd0: 6172 6473 2074 6f20 6d61 7463 6820 616e ards to match an │ │ │ -001b6de0: 7920 7465 7874 2061 6e64 2061 6e79 2063 y text and any c │ │ │ -001b6df0: 6861 7261 6374 6572 2c20 7265 7370 6563 haracter, respec │ │ │ -001b6e00: 7469 7665 6c79 2e20 4d65 6469 6120 7479 tively. Media ty │ │ │ -001b6e10: 7065 7320 6d61 7920 6861 7665 206f 7074 pes may have opt │ │ │ -001b6e20: 696f 6e61 6c20 7061 7261 6d65 7465 7273 ional parameters │ │ │ -001b6e30: 2061 6674 6572 203c 636f 6465 3e3b 3c2f after ; such as charset and bou │ │ │ -001b6e70: 6e64 6172 793c 2f63 6f64 653e 2e20 5468 ndary. Th │ │ │ -001b6e80: 6573 6520 7061 7261 6d65 7465 7273 2063 ese parameters c │ │ │ -001b6e90: 616e 2062 6520 6d61 7463 6865 6420 6279 an be matched by │ │ │ -001b6ea0: 2074 6865 206d 6564 6961 2074 7970 6520 the media type │ │ │ -001b6eb0: 7061 7474 6572 6e73 2069 6e20 7468 6520 patterns in the │ │ │ -001b6ec0: 7461 626c 652e 2050 6174 7465 726e 7320 table. Patterns │ │ │ -001b6ed0: 7468 6174 2061 7265 206d 6f72 6520 7370 that are more sp │ │ │ -001b6ee0: 6563 6966 6963 206d 7573 7420 7072 6563 ecific must prec │ │ │ -001b6ef0: 6564 6520 7061 7474 6572 6e73 2074 6861 ede patterns tha │ │ │ -001b6f00: 7420 6172 6520 6c65 7373 2073 7065 6369 t are less speci │ │ │ -001b6f10: 6669 6320 696e 2074 6865 2074 6162 6c65 fic in the table │ │ │ -001b6f20: 2e20 466f 7220 6578 616d 706c 652c 203c . For example, < │ │ │ -001b6f30: 636f 6465 3e22 7465 7874 2f78 6d6c 3b2a code>"text/xml;* │ │ │ -001b6f40: 6368 6172 7365 743d 7574 662d 382a 223c charset=utf-8*"< │ │ │ -001b6f50: 2f63 6f64 653e 206d 7573 7420 7072 6563 /code> must prec │ │ │ -001b6f60: 6564 6520 3c63 6f64 653e 2274 6578 742f ede "text/ │ │ │ -001b6f70: 786d 6c22 3c2f 636f 6465 3e20 7768 6963 xml" whic │ │ │ -001b6f80: 6820 6d75 7374 2070 7265 6365 6465 203c h must precede < │ │ │ -001b6f90: 636f 6465 3e22 7465 7874 2f2a 223c 2f63 code>"text/*". Note that │ │ │ -001b6fb0: 3c63 6f64 653e 2274 6578 742f 786d 6c22 "text/xml" │ │ │ -001b6fc0: 3c2f 636f 6465 3e20 616c 736f 206d 6174 also mat │ │ │ -001b6fd0: 6368 6573 2061 6e79 2070 6172 616d 6574 ches any paramet │ │ │ -001b6fe0: 6572 7320 6f66 2074 6865 206d 6564 6961 ers of the media │ │ │ -001b6ff0: 2074 7970 6520 6f66 2074 6865 206d 6573 type of the mes │ │ │ -001b7000: 7361 6765 2072 6576 6569 7665 642c 2073 sage reveived, s │ │ │ -001b7010: 7563 6820 6173 203c 636f 6465 3e22 7465 uch as "te │ │ │ -001b7020: 7874 2f78 6d6c 3b20 6368 6172 7365 743d xt/xml; charset= │ │ │ -001b7030: 7574 662d 3822 3c2f 636f 6465 3e20 286f utf-8" (o │ │ │ -001b7040: 6e6c 7920 7369 6e63 6520 6753 4f41 5020 nly since gSOAP │ │ │ -001b7050: 7665 7273 696f 6e20 322e 382e 3735 292e version 2.8.75). │ │ │ -001b7060: 3c2f 703e 0a3c 703e 5468 6520 6861 6e64

.

The hand │ │ │ -001b7070: 6c65 7273 2061 7265 2066 756e 6374 696f lers are functio │ │ │ -001b7080: 6e73 2074 6861 7420 7769 6c6c 2062 6520 ns that will be │ │ │ -001b7090: 696e 766f 6b65 6420 7768 656e 2061 2050 invoked when a P │ │ │ -001b70a0: 4f53 5465 6420 7265 7175 6573 7420 6d65 OSTed request me │ │ │ -001b70b0: 7373 6167 6520 6d61 7463 6869 6e67 206d ssage matching m │ │ │ -001b70c0: 6564 6961 2074 7970 6520 6973 2073 656e edia type is sen │ │ │ -001b70d0: 7420 746f 2074 6865 2073 6572 7665 722e t to the server. │ │ │ -001b70e0: 3c2f 703e 0a3c 703e 416e 2065 7861 6d70

.

An examp │ │ │ -001b70f0: 6c65 2069 6d61 6765 2068 616e 646c 6572 le image handler │ │ │ -001b7100: 2074 6861 7420 6368 6563 6b73 2074 6865 that checks the │ │ │ -001b7110: 2073 7065 6369 6669 6320 696d 6167 6520 specific image │ │ │ -001b7120: 7479 7065 3a3c 2f70 3e0a 3c64 6976 2063 type:

.
│ │ │ -001b7140: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
int< │ │ │ -001b7170: 2f73 7061 6e3e 2069 6d61 6765 5f68 616e /span> image_han │ │ │ -001b7180: 646c 6572 283c 7370 616e 2063 6c61 7373 dler(struc │ │ │ -001b71a0: 743c 2f73 7061 6e3e 203c 6120 636c 6173 t │ │ │ -001b71d0: 736f 6170 3c2f 613e 202a 3c61 2063 6c61 soap *soap)
.
{
.
│ │ │ -001b7240: 3c73 7061 6e20 636c 6173 733d 226b 6579 const cha │ │ │ -001b7280: 723c 2f73 7061 6e3e 202a 6275 663b 203c r *buf; < │ │ │ -001b7290: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
size_t len;
. │ │ │ -001b72f0: 2020 3c73 7061 6e20 636c 6173 733d 2263 // if ne │ │ │ -001b7310: 6365 7373 6172 792c 2063 6865 636b 2074 cessary, check t │ │ │ -001b7320: 7970 6520 696e 2073 6f61 702d 2667 743b ype in soap-> │ │ │ -001b7330: 6874 7470 5f63 6f6e 7465 6e74 203c 2f73 http_content
.
< │ │ │ -001b7360: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -001b7370: 6f72 6466 6c6f 7722 3e69 663c 2f73 7061 ordflow">if (soap< │ │ │ -001b73b0: 2f61 3e2d 2667 743b 3c61 2063 6c61 7373 /a>->http_content && ! │ │ │ -001b7470: 736f 6170 5f74 6167 5f63 6d70 3c2f 613e soap_tag_cmp │ │ │ -001b7480: 283c 6120 636c 6173 733d 2263 6f64 6522 (soap │ │ │ -001b74b0: 2d26 6774 3b3c 6120 636c 6173 733d 2263 ->ht │ │ │ -001b7500: 7470 5f63 6f6e 7465 6e74 3c2f 613e 2c20 tp_content, │ │ │ -001b7510: 3c73 7061 6e20 636c 6173 733d 2273 7472 &quo │ │ │ -001b7530: 743b 696d 6167 652f 6769 6626 7175 6f74 t;image/gif" │ │ │ -001b7540: 3b3c 2f73 7061 6e3e 2920 3c2f 6469 763e ;)
│ │ │ -001b7550: 0a3c 6469 7620 636c 6173 733d 226c 696e .
return 4 │ │ │ -001b7590: 3034 3b20 3c73 7061 6e20 636c 6173 733d 04; // HTT │ │ │ -001b75b0: 5020 6572 726f 7220 3430 3420 3c2f 7370 P error 404
.
if │ │ │ -001b75e0: 2028 2862 7566 203d 203c 6120 636c 6173 ((buf = soap_ht │ │ │ -001b7640: 7470 5f67 6574 5f62 6f64 793c 2f61 3e28 tp_get_body( │ │ │ -001b7650: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap, │ │ │ -001b7680: 2026 616d 703b 6c65 6e29 2920 3d3d 204e &len)) == N │ │ │ -001b7690: 554c 4c29 3c2f 6469 763e 0a3c 6469 7620 ULL)
.
│ │ │ -001b76b0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 retur │ │ │ -001b76d0: 6e3c 2f73 7061 6e3e 203c 6120 636c 6173 n │ │ │ -001b7700: 736f 6170 3c2f 613e 2d26 6774 3b3c 6120 soap->error; │ │ │ -001b7760: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
// ... now pro │ │ │ -001b77a0: 6365 7373 2069 6d61 6765 2069 6e20 6275 cess image in bu │ │ │ -001b77b0: 6620 3c2f 7370 616e 3e3c 2f64 6976 3e0a f
. │ │ │ -001b77c0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
// rep │ │ │ -001b77f0: 6c79 2077 6974 6820 656d 7074 7920 4854 ly with empty HT │ │ │ -001b7800: 5450 2032 3030 204f 4b20 7265 7370 6f6e TP 200 OK respon │ │ │ -001b7810: 7365 3a20 3c2f 7370 616e 3e3c 2f64 6976 se:
.
│ │ │ -001b7850: 7265 7475 726e 3c2f 7370 616e 3e20 3c61 return so │ │ │ -001b78b0: 6170 5f73 656e 645f 656d 7074 795f 7265 ap_send_empty_re │ │ │ -001b78c0: 7370 6f6e 7365 3c2f 613e 283c 6120 636c sponse(soap, 200) │ │ │ -001b7900: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
}.
so │ │ │ -001b79d0: 6170 5f74 6167 5f63 6d70 3c2f 613e 3c2f ap_tag_cmp
int soap │ │ │ -001b7a00: 5f74 6167 5f63 6d70 2863 6f6e 7374 2063 _tag_cmp(const c │ │ │ -001b7a10: 6861 7220 2a73 7472 696e 672c 2063 6f6e har *string, con │ │ │ -001b7a20: 7374 2063 6861 7220 2a70 6174 7465 726e st char *pattern │ │ │ -001b7a30: 293c 2f64 6976 3e3c 6469 7620 636c 6173 )
Compar │ │ │ -001b7a50: 6520 7374 7269 6e67 2074 6f20 6120 7061 e string to a pa │ │ │ -001b7a60: 7474 6572 6e2e 3c2f 6469 763e 3c2f 6469 ttern.
.

The │ │ │ -001b7a90: 2061 626f 7665 2065 7861 6d70 6c65 2072 above example r │ │ │ -001b7aa0: 6574 7572 6e73 2048 5454 5020 4f4b 2e20 eturns HTTP OK. │ │ │ -001b7ab0: 4966 2063 6f6e 7465 6e74 2069 7320 7375 If content is su │ │ │ -001b7ac0: 7070 6f73 6564 2074 6f20 6265 2072 6574 pposed to be ret │ │ │ -001b7ad0: 7572 6e65 642c 2074 6865 6e20 7573 653a urned, then use: │ │ │ -001b7ae0: 3c2f 703e 0a3c 6469 7620 636c 6173 733d

.
struct soap │ │ │ -001b7b60: 202a 3c61 2063 6c61 7373 3d22 636f 6465 *soap = soap_ne │ │ │ -001b7bf0: 773c 2f61 3e28 293b 3c2f 6469 763e 0a3c w();
.< │ │ │ -001b7c00: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -001b7c10: 3e2e 2e2e 203c 7370 616e 2063 6c61 7373 >... //
.
soap-> │ │ │ -001b7c80: 3b3c 6120 636c 6173 733d 2263 6f64 6522 ;http_c │ │ │ -001b7cd0: 6f6e 7465 6e74 3c2f 613e 203d 203c 7370 ontent = "i │ │ │ -001b7d00: 6d61 6765 2f6a 7065 6726 7175 6f74 3b3c mage/jpeg"< │ │ │ -001b7d10: 2f73 7061 6e3e 3b20 3c73 7061 6e20 636c /span>; // │ │ │ -001b7d30: 2061 206a 7065 6720 696d 6167 6520 746f a jpeg image to │ │ │ -001b7d40: 2072 6574 7572 6e20 6261 636b 203c 2f73 return back
..< │ │ │ -001b7ed0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -001b7ee0: 3e20 7c7c 203c 6120 636c 6173 733d 2263 > || soap_send_r │ │ │ -001b7f40: 6177 3c2f 613e 283c 6120 636c 6173 733d aw(so │ │ │ -001b7f70: 6170 3c2f 613e 2c20 3c61 2063 6c61 7373 ap, buf, len) < │ │ │ -001b7fd0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ -001b7fe0: 656e 7422 3e2f 2f20 7365 6e64 2069 6d61 ent">// send ima │ │ │ -001b7ff0: 6765 203c 2f73 7061 6e3e 3c2f 6469 763e ge
│ │ │ -001b8000: 0a3c 6469 7620 636c 6173 733d 226c 696e .. │ │ │ -001b80b0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
re │ │ │ -001b80e0: 7475 726e 3c2f 7370 616e 3e20 3c61 2063 turn soap │ │ │ -001b8140: 5f63 6c6f 7365 736f 636b 3c2f 613e 283c _closesock(< │ │ │ -001b8150: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -001b8160: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ -001b8170: 6874 6d6c 223e 736f 6170 3c2f 613e 293b html">soap); │ │ │ -001b8180: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
return │ │ │ -001b81c0: 203c 6120 636c 6173 733d 2263 6f64 6522 SOAP_OK │ │ │ -001b8220: 3b3c 2f64 6976 3e0a 3c2f 6469 763e 3c21 ;
.
< │ │ │ -001b8240: 703e 466f 7220 636c 6965 6e74 2061 7070 p>For client app │ │ │ -001b8250: 6c69 6361 7469 6f6e 7320 746f 2075 7365 lications to use │ │ │ -001b8260: 2048 5454 5020 504f 5354 2c20 7573 6520 HTTP POST, use │ │ │ -001b8270: 7468 6520 3c63 6f64 653e 3c61 2063 6c61 the soa │ │ │ -001b82f0: 705f 504f 5354 3c2f 613e 3c2f 636f 6465 p_POST operation:

│ │ │ -001b8310: 0a3c 6469 7620 636c 6173 733d 2266 7261 .
s │ │ │ -001b8350: 7472 7563 7420 3c2f 7370 616e 3e3c 6120 truct soap *soap = │ │ │ -001b83c0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap_new();
.
... │ │ │ -001b8440: 203c 7370 616e 2063 6c61 7373 3d22 636f // │ │ │ -001b8460: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
char * │ │ │ -001b84a0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 buf │ │ │ -001b84f0: 3b20 3c73 7061 6e20 636c 6173 733d 2263 ; // holds │ │ │ -001b8510: 2074 6865 2048 5454 5020 7265 7175 6573 the HTTP reques │ │ │ -001b8520: 742f 7265 7370 6f6e 7365 2062 6f64 7920 t/response body │ │ │ -001b8530: 6461 7461 203c 2f73 7061 6e3e 3c2f 6469 data .
s │ │ │ -001b8570: 697a 655f 743c 2f73 7061 6e3e 206c 656e ize_t len │ │ │ -001b8580: 3b20 3c73 7061 6e20 636c 6173 733d 2263 ; // lengt │ │ │ -001b85a0: 6820 6f66 2064 6174 6120 3c2f 7370 616e h of data
.
... // populate │ │ │ -001b85f0: 6275 6620 616e 6420 6c65 6e20 7769 7468 buf and len with │ │ │ -001b8600: 206d 6573 7361 6765 2074 6f20 7365 6e64 message to send │ │ │ -001b8610: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ -001b8630: 3c73 7061 6e20 636c 6173 733d 226b 6579 if (soap_POST(soap, │ │ │ -001b8700: 2671 756f 743b 5552 4c26 7175 6f74 3b3c "URL"< │ │ │ -001b8710: 2f73 7061 6e3e 2c20 3c73 7061 6e20 636c /span>, "SOAP a │ │ │ -001b8740: 6374 696f 6e20 6f72 204e 554c 4c26 7175 ction or NULL&qu │ │ │ -001b8750: 6f74 3b3c 2f73 7061 6e3e 2c20 3c73 7061 ot;, "me │ │ │ -001b8780: 6469 6120 7479 7065 2671 756f 743b 3c2f dia type")
. │ │ │ -001b87b0: 207c 7c20 3c61 2063 6c61 7373 3d22 636f || soap_send_ra │ │ │ -001b8810: 773c 2f61 3e28 3c61 2063 6c61 7373 3d22 w(soa │ │ │ -001b8840: 703c 2f61 3e2c 203c 6120 636c 6173 733d p, │ │ │ -001b8890: 6275 663c 2f61 3e2c 206c 656e 293b 203c buf, len); < │ │ │ -001b88a0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
|| soap │ │ │ -001b8910: 5f65 6e64 5f73 656e 643c 2f61 3e28 3c61 _end_send(soap)) │ │ │ -001b8950: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
... // error
.
if │ │ │ -001b89d0: 283c 6120 636c 6173 733d 2263 6f64 6522 (soap_begin_recv │ │ │ -001b8a30: 3c2f 613e 2826 616d 703b 3c61 2063 6c61 (&soap)
.. │ │ │ -001b8ba0: 7c7c 203c 6120 636c 6173 733d 2263 6f64 || soap_end_recv │ │ │ -001b8c00: 3c2f 613e 2826 616d 703b 3c61 2063 6c61 (&soap)) .
... // error │ │ │ -001b8c80: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
/ │ │ │ -001b8cb0: 2f20 2e2e 2e20 7573 6520 6275 665b 302e / ... use buf[0. │ │ │ -001b8cc0: 2e6c 656e 2d31 5d20 3c2f 7370 616e 3e3c .len-1] < │ │ │ -001b8cd0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
soa │ │ │ -001b8d40: 705f 6465 7374 726f 793c 2f61 3e28 3c61 p_destroy(soap);< │ │ │ -001b8d80: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>...< │ │ │ -001b8ee0: 6469 7620 636c 6173 733d 2274 7463 2220 div class="ttc" │ │ │ -001b8ef0: 6964 3d22 6167 726f 7570 5f5f 6772 6f75 id="agroup__grou │ │ │ -001b8f00: 705f 5f69 6f5f 6874 6d6c 5f67 6166 3463 p__io_html_gaf4c │ │ │ -001b8f10: 6535 3338 3934 3466 3635 6163 3937 6438 e538944f65ac97d8 │ │ │ -001b8f20: 3262 6665 6161 3933 3435 6334 3222 3e3c 2bfeaa9345c42">< │ │ │ -001b8f30: 6469 7620 636c 6173 733d 2274 746e 616d div class="ttnam │ │ │ -001b8f40: 6522 3e3c 6120 6872 6566 3d22 6772 6f75 e">soap_begin │ │ │ -001b8f90: 5f72 6563 763c 2f61 3e3c 2f64 6976 3e3c _recv
< │ │ │ -001b8fa0: 6469 7620 636c 6173 733d 2274 7464 6563 div class="ttdec │ │ │ -001b8fb0: 6922 3e69 6e74 2073 6f61 705f 6265 6769 i">int soap_begi │ │ │ -001b8fc0: 6e5f 7265 6376 2873 7472 7563 7420 736f n_recv(struct so │ │ │ -001b8fd0: 6170 202a 736f 6170 293c 2f64 6976 3e3c ap *soap)
< │ │ │ -001b8fe0: 6469 7620 636c 6173 733d 2274 7464 6f63 div class="ttdoc │ │ │ -001b8ff0: 223e 496e 6974 6961 6c69 7a65 2074 6865 ">Initialize the │ │ │ -001b9000: 2063 6f6e 7465 7874 2066 6f72 2072 6563 context for rec │ │ │ -001b9010: 6569 7669 6e67 2e3c 2f64 6976 3e3c 2f64 eiving.
.
int soap_POST( │ │ │ -001b9100: 7374 7275 6374 2073 6f61 7020 2a73 6f61 struct soap *soa │ │ │ -001b9110: 702c 2063 6f6e 7374 2063 6861 7220 2a65 p, const char *e │ │ │ -001b9120: 6e64 706f 696e 742c 2063 6f6e 7374 2063 ndpoint, const c │ │ │ -001b9130: 6861 7220 2a61 6374 696f 6e2c 2063 6f6e har *action, con │ │ │ -001b9140: 7374 2063 6861 7220 2a74 7970 6529 3c2f st char *type)
HTTP POST │ │ │ -001b9170: 2063 6f6e 7465 6e74 2074 6f20 7365 7276 content to serv │ │ │ -001b9180: 6572 2e3c 2f64 6976 3e3c 2f64 6976 3e0a er.
. │ │ │ -001b9190: 3c2f 6469 763e 3c21 2d2d 2066 7261 676d

Simila │ │ │ -001b91b0: 726c 792c 203c 636f 6465 3e3c 6120 636c rly, soa │ │ │ -001b9230: 705f 5055 543c 2f61 3e3c 2f63 6f64 653e p_PUT │ │ │ -001b9240: 2c20 3c63 6f64 653e 3c61 2063 6c61 7373 , soap │ │ │ -001b92c0: 5f50 4154 4348 3c2f 613e 3c2f 636f 6465 _PATCH, and soap_DELETE< │ │ │ -001b9360: 2f61 3e3c 2f63 6f64 653e 2063 6f6d 6d61 /a> comma │ │ │ -001b9370: 6e64 7320 6172 6520 7072 6f76 6964 6564 nds are provided │ │ │ -001b9380: 2066 6f72 2050 5554 2c20 5041 5443 482c for PUT, PATCH, │ │ │ -001b9390: 2061 6e64 2044 454c 4554 4520 6861 6e64 and DELETE hand │ │ │ -001b93a0: 6c69 6e67 2e3c 2f70 3e0a 3c70 3e54 6f20 ling.

.

To │ │ │ -001b93b0: 7375 7070 6f72 7420 4854 5450 2070 6970 support HTTP pip │ │ │ -001b93c0: 656c 696e 696e 6720 7765 2075 7365 2074 elining we use t │ │ │ -001b93d0: 6865 203c 636f 6465 3e3c 6120 636c 6173 he http_pipe plugin, wh │ │ │ -001b9480: 6963 6820 6361 6e20 6265 2075 7365 6420 ich can be used │ │ │ -001b9490: 6174 2074 6865 2073 6572 7665 7220 7369 at the server si │ │ │ -001b94a0: 6465 2074 6f20 656e 6162 6c65 2048 5454 de to enable HTT │ │ │ -001b94b0: 5020 7069 7065 6c69 6e69 6e67 2061 7574 P pipelining aut │ │ │ -001b94c0: 6f6d 6174 6963 616c 6c79 2c20 7768 656e omatically, when │ │ │ -001b94d0: 2072 6567 6973 7465 7265 642e 2054 6865 registered. The │ │ │ -001b94e0: 2070 6c75 6769 6e20 6361 6e20 616c 736f plugin can also │ │ │ -001b94f0: 2062 6520 7573 6564 2061 7420 7468 6520 be used at the │ │ │ -001b9500: 636c 6965 6e74 2073 6964 652c 2074 686f client side, tho │ │ │ -001b9510: 7567 6820 7468 6973 2069 7320 6f6e 6c79 ugh this is only │ │ │ -001b9520: 206e 6563 6573 7361 7279 2069 6e20 7363 necessary in sc │ │ │ -001b9530: 656e 6172 696f 7320 7468 6174 2072 6571 enarios that req │ │ │ -001b9540: 7569 7265 2074 6865 2063 6c69 656e 7420 uire the client │ │ │ -001b9550: 746f 2072 6563 6569 7665 206d 756c 7469 to receive multi │ │ │ -001b9560: 706c 6520 6d65 7373 6167 6573 2077 6974 ple messages wit │ │ │ -001b9570: 686f 7574 2069 6e74 6572 6d69 7474 656e hout intermitten │ │ │ -001b9580: 6420 7365 6e64 732c 2069 2e65 2e20 6d75 d sends, i.e. mu │ │ │ -001b9590: 6c74 6970 6c65 2073 656e 6473 2066 6f6c ltiple sends fol │ │ │ -001b95a0: 6c6f 7765 6420 6279 206d 756c 7469 706c lowed by multipl │ │ │ -001b95b0: 6520 7265 6365 6976 6573 2062 7920 7468 e receives by th │ │ │ -001b95c0: 6520 7361 6d65 2074 6872 6561 6420 7573 e same thread us │ │ │ -001b95d0: 696e 6720 7468 6520 7361 6d65 203c 636f ing the same s │ │ │ -001b9630: 6f61 703c 2f61 3e3c 2f63 6f64 653e 2063 oap c │ │ │ -001b9640: 6f6e 7465 7874 2e20 486f 7765 7665 722c ontext. However, │ │ │ -001b9650: 2063 6c69 656e 7473 2073 686f 756c 6420 clients should │ │ │ -001b9660: 7573 6520 6d75 6c74 6970 6c65 2074 6872 use multiple thr │ │ │ -001b9670: 6561 6473 2077 6865 6e20 4854 5450 2070 eads when HTTP p │ │ │ -001b9680: 6970 656c 696e 696e 6720 6973 2075 7365 ipelining is use │ │ │ -001b9690: 6420 746f 2070 7265 7665 6e74 2062 6c6f d to prevent blo │ │ │ -001b96a0: 636b 696e 672e 2053 6565 2074 6865 203c cking. See the < │ │ │ -001b96b0: 656d 3e3c 636f 6465 3e67 736f 6170 2f73 em>gsoap/s │ │ │ -001b96c0: 616d 706c 6573 2f61 7379 6e63 3c2f 636f amples/async folder │ │ │ -001b96e0: 696e 2074 6865 2067 534f 4150 2070 6163 in the gSOAP pac │ │ │ -001b96f0: 6b61 6765 2066 6f72 2065 7870 6c61 6e61 kage for explana │ │ │ -001b9700: 7469 6f6e 2061 6e64 2065 7861 6d70 6c65 tion and example │ │ │ -001b9710: 732e 3c2f 703e 0a3c 703e 5365 6520 616c s.

.

See al │ │ │ -001b9720: 736f 203c 636f 6465 3e3c 6120 636c 6173 so http_ │ │ │ -001b97b0: 706f 7374 3c2f 613e 3c2f 636f 6465 3e20 post │ │ │ -001b97c0: 616e 6420 3c63 6f64 653e 3c61 2063 6c61 and http_pipe< │ │ │ -001b9860: 2f63 6f64 653e 2e3c 2f70 3e0a 3c70 3ef0 /code>.

.

. │ │ │ -001b9870: 9f94 9d20 3c61 2068 7265 663d 2223 223e ... │ │ │ -001b9880: 4261 636b 2074 6f20 7461 626c 6520 6f66 Back to table of │ │ │ -001b9890: 2063 6f6e 7465 6e74 733c 2f61 3e3c 2f70 contents

.

.T │ │ │ -001b98d0: 6865 2048 5454 5020 6469 6765 7374 2061 he HTTP digest a │ │ │ -001b98e0: 7574 6865 6e74 6963 6174 696f 6e20 706c uthentication pl │ │ │ -001b98f0: 7567 696e 3c2f 6833 3e0a 3c70 3e54 6865 ugin

.

The │ │ │ -001b9900: 2048 5454 5020 6469 6765 7374 2061 7574 HTTP digest aut │ │ │ -001b9910: 6865 6e74 6963 6174 696f 6e20 706c 7567 hentication plug │ │ │ -001b9920: 696e 2065 6e61 626c 6573 2061 206d 6f72 in enables a mor │ │ │ -001b9930: 6520 7365 6375 7265 2061 7574 6865 6e74 e secure authent │ │ │ -001b9940: 6963 6174 696f 6e20 7363 6865 6d65 2063 ication scheme c │ │ │ -001b9950: 6f6d 7061 7265 6420 746f 2062 6173 6963 ompared to basic │ │ │ -001b9960: 2061 7574 6865 6e74 6963 6174 696f 6e2e authentication. │ │ │ -001b9970: 2048 5454 5020 6261 7369 6320 6175 7468 HTTP basic auth │ │ │ -001b9980: 656e 7469 6361 7469 6f6e 2073 656e 6473 entication sends │ │ │ -001b9990: 2075 6e65 6e63 7279 7074 6564 2075 7365 unencrypted use │ │ │ -001b99a0: 7269 6473 2061 6e64 2070 6173 7377 6f72 rids and passwor │ │ │ -001b99b0: 6473 206f 7665 7220 7468 6520 6e65 742c ds over the net, │ │ │ -001b99c0: 2077 6869 6c65 2064 6967 6573 7420 6175 while digest au │ │ │ -001b99d0: 7468 656e 7469 6361 7469 6f6e 2064 6f65 thentication doe │ │ │ -001b99e0: 7320 6e6f 7420 6578 6368 616e 6765 2070 s not exchange p │ │ │ -001b99f0: 6173 7377 6f72 6473 2062 7574 2065 7863 asswords but exc │ │ │ -001b9a00: 6861 6e67 6573 2063 6865 636b 7375 6d73 hanges checksums │ │ │ -001b9a10: 206f 6620 7061 7373 776f 7264 7320 2861 of passwords (a │ │ │ -001b9a20: 6e64 206f 7468 6572 2064 6174 6120 7375 nd other data su │ │ │ -001b9a30: 6368 2061 7320 6e6f 6e63 6573 2074 6f20 ch as nonces to │ │ │ -001b9a40: 6176 6f69 6420 7265 706c 6179 2061 7474 avoid replay att │ │ │ -001b9a50: 6163 6b73 292e 2046 6f72 206d 6f72 6520 acks). For more │ │ │ -001b9a60: 6465 7461 696c 732c 2070 6c65 6173 6520 details, please │ │ │ -001b9a70: 7365 6520 5246 4320 3236 3137 2e3c 2f70 see RFC 2617.

.

The HTTP di │ │ │ -001b9a90: 6765 7374 2061 7574 6865 6e74 6963 6174 gest authenticat │ │ │ -001b9aa0: 696f 6e20 6361 6e20 6265 2075 7365 6420 ion can be used │ │ │ -001b9ab0: 6e65 7874 2074 6f20 7468 6520 6275 696c next to the buil │ │ │ -001b9ac0: 742d 696e 2062 6173 6963 2061 7574 6865 t-in basic authe │ │ │ -001b9ad0: 6e74 6963 6174 696f 6e2c 206f 7220 6261 ntication, or ba │ │ │ -001b9ae0: 7369 6320 6175 7468 656e 7469 6361 7469 sic authenticati │ │ │ -001b9af0: 6f6e 2063 616e 2062 6520 7265 6a65 6374 on can be reject │ │ │ -001b9b00: 6564 2074 6f20 7469 6768 7465 6e20 7365 ed to tighten se │ │ │ -001b9b10: 6375 7269 7479 2e20 5468 6520 7365 7276 curity. The serv │ │ │ -001b9b20: 6572 206d 7573 7420 6861 7665 2061 2064 er must have a d │ │ │ -001b9b30: 6174 6162 6173 6520 7769 7468 2075 7365 atabase with use │ │ │ -001b9b40: 7269 6427 7320 616e 6420 7061 7373 776f rid's and passwo │ │ │ -001b9b50: 7264 7320 2869 6e20 706c 6169 6e20 7465 rds (in plain te │ │ │ -001b9b60: 7874 2066 6f72 6d29 2e20 5468 6520 636c xt form). The cl │ │ │ -001b9b70: 6965 6e74 2c20 7768 656e 2063 6861 6c6c ient, when chall │ │ │ -001b9b80: 656e 6765 6420 6279 2074 6865 2073 6572 enged by the ser │ │ │ -001b9b90: 7665 722c 2063 6865 636b 7320 7468 6520 ver, checks the │ │ │ -001b9ba0: 6175 7468 656e 7469 6361 7469 6f6e 2072 authentication r │ │ │ -001b9bb0: 6561 6c6d 2070 726f 7669 6465 6420 6279 ealm provided by │ │ │ -001b9bc0: 2074 6865 2073 6572 7665 7220 616e 6420 the server and │ │ │ -001b9bd0: 7365 7473 2074 6865 2075 7365 7269 6420 sets the userid │ │ │ -001b9be0: 616e 6420 7061 7373 776f 7264 7320 666f and passwords fo │ │ │ -001b9bf0: 7220 6469 6765 7374 2061 7574 6865 6e74 r digest authent │ │ │ -001b9c00: 6963 6174 696f 6e2e 2054 6865 2063 6c69 ication. The cli │ │ │ -001b9c10: 656e 7420 6170 706c 6963 6174 696f 6e20 ent application │ │ │ -001b9c20: 6361 6e20 7465 6d70 6f72 6172 696c 7920 can temporarily │ │ │ -001b9c30: 7374 6f72 6520 7468 6520 7573 6572 6964 store the userid │ │ │ -001b9c40: 2061 6e64 2070 6173 7377 6f72 6420 666f and password fo │ │ │ -001b9c50: 7220 6120 7365 7175 656e 6365 206f 6620 r a sequence of │ │ │ -001b9c60: 6d65 7373 6167 6520 6578 6368 616e 6765 message exchange │ │ │ -001b9c70: 7320 7769 7468 2074 6865 2073 6572 7665 s with the serve │ │ │ -001b9c80: 722c 2077 6869 6368 2069 7320 6661 7374 r, which is fast │ │ │ -001b9c90: 6572 2074 6861 6e20 7265 7065 6174 6564 er than repeated │ │ │ -001b9ca0: 2061 7574 686f 7269 7a61 7469 6f6e 2063 authorization c │ │ │ -001b9cb0: 6861 6c6c 656e 6765 7320 616e 6420 6175 hallenges and au │ │ │ -001b9cc0: 7468 656e 7469 6361 7469 6f6e 2072 6573 thentication res │ │ │ -001b9cd0: 706f 6e73 6573 2e3c 2f70 3e0a 3c70 3e41 ponses.

.

A │ │ │ -001b9ce0: 7420 7468 6520 636c 6965 6e74 2073 6964 t the client sid │ │ │ -001b9cf0: 652c 2074 6865 2070 6c75 6769 6e20 6973 e, the plugin is │ │ │ -001b9d00: 2072 6567 6973 7465 7265 6420 616e 6420 registered and │ │ │ -001b9d10: 7365 7276 6963 6520 696e 766f 6361 7469 service invocati │ │ │ -001b9d20: 6f6e 7320 6172 6520 6368 6563 6b65 6420 ons are checked │ │ │ -001b9d30: 666f 7220 6175 7468 6f72 697a 6174 696f for authorizatio │ │ │ -001b9d40: 6e20 6368 616c 6c65 6e67 6573 2028 4854 n challenges (HT │ │ │ -001b9d50: 5450 2065 7272 6f72 2063 6f64 6520 3430 TP error code 40 │ │ │ -001b9d60: 3129 2e20 5768 656e 2074 6865 2073 6572 1). When the ser │ │ │ -001b9d70: 7665 7220 6368 616c 6c65 6e67 6573 2074 ver challenges t │ │ │ -001b9d80: 6865 2063 6c69 656e 742c 2074 6865 2063 he client, the c │ │ │ -001b9d90: 6c69 656e 7420 7368 6f75 6c64 2073 6574 lient should set │ │ │ -001b9da0: 2074 6865 2075 7365 7269 6420 616e 6420 the userid and │ │ │ -001b9db0: 7061 7373 776f 7264 2061 6e64 2072 6574 password and ret │ │ │ -001b9dc0: 7279 2074 6865 2069 6e76 6f63 6174 696f ry the invocatio │ │ │ -001b9dd0: 6e2e 2054 6865 2063 6c69 656e 7420 6361 n. The client ca │ │ │ -001b9de0: 6e20 6465 7465 726d 696e 6520 7468 6520 n determine the │ │ │ -001b9df0: 7573 6572 6964 2061 6e64 2070 6173 7377 userid and passw │ │ │ -001b9e00: 6f72 6420 6261 7365 6420 6f6e 2074 6865 ord based on the │ │ │ -001b9e10: 2061 7574 6865 6e74 6963 6174 696f 6e20 authentication │ │ │ -001b9e20: 7265 616c 6d20 7061 7274 206f 6620 7468 realm part of th │ │ │ -001b9e30: 6520 7365 7276 6572 2773 2063 6861 6c6c e server's chall │ │ │ -001b9e40: 656e 6765 2e20 5468 6520 6175 7468 656e enge. The authen │ │ │ -001b9e50: 7469 6361 7469 6f6e 2069 6e66 6f72 6d61 tication informa │ │ │ -001b9e60: 7469 6f6e 2063 616e 2062 6520 7465 6d70 tion can be temp │ │ │ -001b9e70: 6f72 6172 696c 7920 7361 7665 6420 666f orarily saved fo │ │ │ -001b9e80: 7220 6d75 6c74 6970 6c65 2069 6e76 6f63 r multiple invoc │ │ │ -001b9e90: 6174 696f 6e73 2e3c 2f70 3e0a 3c70 3e43 ations.

.

C │ │ │ -001b9ea0: 6c69 656e 742d 7369 6465 2065 7861 6d70 lient-side examp │ │ │ -001b9eb0: 6c65 3a3c 2f70 3e0a 3c64 6976 2063 6c61 le:

.
│ │ │ -001b9ee0: 3c73 7061 6e20 636c 6173 733d 2270 7265 #incl │ │ │ -001b9f00: 7564 6520 2671 756f 743b 6874 7470 6461 ude "httpda │ │ │ -001b9f10: 2e68 2671 756f 743b 3c2f 7370 616e 3e20 .h" │ │ │ -001b9f20: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ -001b9f40: 0a3c 6469 7620 636c 6173 733d 226c 696e .
int │ │ │ -001b9f70: 3c2f 7370 616e 3e20 6d61 696e 2829 3c2f main().
{
.< │ │ │ -001b9fa0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -001b9fb0: 3e20 203c 7370 616e 2063 6c61 7373 3d22 > struct │ │ │ -001b9fd0: 3c2f 7370 616e 3e3c 6120 636c 6173 733d so │ │ │ -001ba000: 6170 3c2f 613e 202a 3c61 2063 6c61 7373 ap *s │ │ │ -001ba030: 6f61 703c 2f61 3e20 3d20 3c61 2063 6c61 oap = s │ │ │ -001ba090: 6f61 705f 6e65 773c 2f61 3e28 293b 3c2f oap_new();.
if soap_register_p │ │ │ -001ba140: 6c75 6769 6e3c 2f61 3e28 3c61 2063 6c61 lugin(soap, http_ │ │ │ -001ba180: 6461 2929 203c 2f64 6976 3e0a 3c64 6976 da))
.
│ │ │ -001ba1a0: 2020 6578 6974 2845 5849 545f 4641 494c exit(EXIT_FAIL │ │ │ -001ba1b0: 5552 4529 3b20 3c73 7061 6e20 636c 6173 URE); // f │ │ │ -001ba1d0: 6169 6c65 6420 746f 2072 6567 6973 7465 ailed to registe │ │ │ -001ba1e0: 7220 3c2f 7370 616e 3e3c 2f64 6976 3e0a r
. │ │ │ -001ba1f0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
if │ │ │ -001ba220: 3c2f 7370 616e 3e20 2873 6f61 705f 6361 (soap_ca │ │ │ -001ba230: 6c6c 5f6e 735f 5f77 6562 6d65 7468 6f64 ll_ns__webmethod │ │ │ -001ba240: 283c 6120 636c 6173 733d 2263 6f64 6522 (soap │ │ │ -001ba270: 2c20 2e2e 2e29 2920 3c2f 6469 763e 0a3c , ...))
.< │ │ │ -001ba280: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -001ba290: 3e20 207b 3c2f 6469 763e 0a3c 6469 7620 > {
.
│ │ │ -001ba2b0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 if (soa │ │ │ -001ba300: 703c 2f61 3e2d 2667 743b 3c61 2063 6c61 p->error == │ │ │ -001ba360: 3430 3129 203c 7370 616e 2063 6c61 7373 401) // ch │ │ │ -001ba380: 616c 6c65 6e67 653a 2048 5454 5020 6175 allenge: HTTP au │ │ │ -001ba390: 7468 656e 7469 6361 7469 6f6e 2072 6571 thentication req │ │ │ -001ba3a0: 7569 7265 6420 3c2f 7370 616e 3e3c 2f64 uired .
{
.
if (! │ │ │ -001ba410: 7374 7263 6d70 283c 6120 636c 6173 733d strcmp(so │ │ │ -001ba440: 6170 3c2f 613e 2d26 6774 3b3c 6120 636c ap->authrealm, auth │ │ │ -001ba4f0: 7265 616c 6d3c 2f61 3e29 2920 3c73 7061 realm)) // optionally │ │ │ -001ba520: 6465 7465 726d 696e 6520 6175 7468 656e determine authen │ │ │ -001ba530: 7469 6361 7469 6f6e 2072 6561 6c6d 3c2f tication realm
.
│ │ │ -001ba560: 2020 2020 7b3c 2f64 6976 3e0a 3c64 6976 {
.
│ │ │ -001ba580: 2020 2020 2020 3c73 7061 6e20 636c 6173 stru │ │ │ -001ba5a0: 6374 203c 2f73 7061 6e3e 6874 7470 5f64 ct http_d │ │ │ -001ba5b0: 615f 696e 666f 2069 6e66 6f3b 203c 7370 a_info info; // to store u │ │ │ -001ba5e0: 7365 7269 6420 616e 6420 7061 7373 7764 serid and passwd │ │ │ -001ba5f0: 203c 2f73 7061 6e3e 3c2f 6469 763e 0a3c
.< │ │ │ -001ba600: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -001ba610: 3e20 2020 2020 2020 2068 7474 705f 6461 > http_da │ │ │ -001ba620: 5f73 6176 6528 3c61 2063 6c61 7373 3d22 _save(soa │ │ │ -001ba650: 703c 2f61 3e2c 2026 616d 703b 696e 666f p, &info │ │ │ -001ba660: 2c20 6175 7468 7265 616c 6d2c 2075 7365 , authrealm, use │ │ │ -001ba670: 7269 642c 2070 6173 7377 6429 3b20 3c73 rid, passwd); // set useri │ │ │ -001ba6a0: 6420 616e 6420 7061 7373 7764 2066 6f72 d and passwd for │ │ │ -001ba6b0: 2074 6869 7320 7265 616c 6d3c 2f73 7061 this realm
.
│ │ │ -001ba6e0: 2020 203c 7370 616e 2063 6c61 7373 3d22 if< │ │ │ -001ba700: 2f73 7061 6e3e 2028 736f 6170 5f63 616c /span> (soap_cal │ │ │ -001ba710: 6c5f 6e73 5f5f 7765 626d 6574 686f 6428 l_ns__webmethod( │ │ │ -001ba720: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap, │ │ │ -001ba750: 202e 2e2e 2929 203c 7370 616e 2063 6c61 ...)) // │ │ │ -001ba770: 7265 7472 7920 3c2f 7370 616e 3e3c 2f64 retry .
{< │ │ │ -001ba7a0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ -001ba7c0: 2020 2e2e 2e20 3c73 7061 6e20 636c 6173 ... //
.
│ │ │ -001ba800: 2020 2020 2020 2020 3c61 2063 6c61 7373 soa │ │ │ -001ba860: 705f 656e 643c 2f61 3e28 3c61 2063 6c61 p_end(soap); // userid and │ │ │ -001ba8c0: 7061 7373 7764 2077 6572 6520 6465 616c passwd were deal │ │ │ -001ba8d0: 6c6f 6361 7465 6420 3c2f 7370 616e 3e3c located < │ │ │ -001ba8e0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ -001ba900: 2020 6874 7470 5f64 615f 7265 7374 6f72 http_da_restor │ │ │ -001ba910: 6528 3c61 2063 6c61 7373 3d22 636f 6465 e(soap, &info); < │ │ │ -001ba950: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ -001ba960: 656e 7422 3e2f 2f20 7265 7374 6f72 6520 ent">// restore │ │ │ -001ba970: 7573 6572 6964 2061 6e64 2070 6173 7377 userid and passw │ │ │ -001ba980: 6420 3c2f 7370 616e 3e3c 2f64 6976 3e0a d
. │ │ │ -001ba990: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
if │ │ │ -001ba9d0: 2821 736f 6170 5f63 616c 6c5f 6e73 5f5f (!soap_call_ns__ │ │ │ -001ba9e0: 7765 626d 6574 686f 6428 3c61 2063 6c61 webmethod(soap, ...)) │ │ │ -001baa20: 203c 7370 616e 2063 6c61 7373 3d22 636f // anothe │ │ │ -001baa40: 7220 6361 6c6c 203c 2f73 7061 6e3e 3c2f r call .
│ │ │ -001baa70: 2020 202e 2e2e 203c 7370 616e 2063 6c61 ... //< │ │ │ -001baa90: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
. │ │ │ -001baab0: 2020 2020 2020 207d 3c2f 6469 763e 0a3c }
.< │ │ │ -001baac0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -001baad0: 3e20 2020 2020 207d 3c2f 6469 763e 0a3c > }
.< │ │ │ -001baae0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -001baaf0: 3e20 2020 207d 3c2f 6469 763e 0a3c 6469 > }
. │ │ │ -001bab10: 207d 3c2f 6469 763e 0a3c 6469 7620 636c }
.
htt │ │ │ -001bab30: 705f 6461 5f72 656c 6561 7365 283c 6120 p_da_release(soap, &a │ │ │ -001bab70: 6d70 3b69 6e66 6f29 3b20 3c73 7061 6e20 mp;info); │ │ │ -001bab90: 2f2f 2074 6f20 7265 6d6f 7665 2061 6c6c // to remove all │ │ │ -001baba0: 2075 7365 7269 6420 616e 6420 7061 7373 userid and pass │ │ │ -001babb0: 7764 3c2f 7370 616e 3e3c 2f64 6976 3e0a wd
. │ │ │ -001babc0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65 .. │ │ │ -001bad20: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65 .< │ │ │ -001badd0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -001bade0: 3e7d 3c2f 6469 763e 0a3c 2f64 6976 3e3c >}
.
< │ │ │ -001badf0: 212d 2d20 6672 6167 6d65 6e74 202d 2d3e !-- fragment --> │ │ │ -001bae00: 3c70 3e54 6869 7320 636f 6465 2073 7570

This code sup │ │ │ -001bae10: 706f 7274 7320 626f 7468 2062 6173 6963 ports both basic │ │ │ -001bae20: 2061 6e64 2064 6967 6573 7420 6175 7468 and digest auth │ │ │ -001bae30: 656e 7469 6361 7469 6f6e 2e3c 2f70 3e0a entication.

. │ │ │ -001bae40: 3c70 3e54 6865 2073 6572 7665 7220 6361

The server ca │ │ │ -001bae50: 6e20 6368 616c 6c65 6e67 6520 6120 636c n challenge a cl │ │ │ -001bae60: 6965 6e74 2075 7369 6e67 2048 5454 5020 ient using HTTP │ │ │ -001bae70: 636f 6465 2034 3031 2e20 5769 7468 2074 code 401. With t │ │ │ -001bae80: 6865 2070 6c75 6769 6e2c 2048 5454 5020 he plugin, HTTP │ │ │ -001bae90: 6469 6765 7374 2061 7574 6865 6e74 6963 digest authentic │ │ │ -001baea0: 6174 696f 6e20 6368 616c 6c65 6e67 6573 ation challenges │ │ │ -001baeb0: 2061 7265 2073 656e 642e 2057 6974 686f are send. Witho │ │ │ -001baec0: 7574 2074 6865 2070 6c75 6769 6e2c 2062 ut the plugin, b │ │ │ -001baed0: 6173 6963 2061 7574 6865 6e74 6963 6174 asic authenticat │ │ │ -001baee0: 696f 6e20 6368 616c 6c65 6e67 6573 2061 ion challenges a │ │ │ -001baef0: 7265 2073 656e 642e 3c2f 703e 0a3c 703e re send.

.

│ │ │ -001baf00: 4561 6368 2073 6572 7665 7220 6d65 7468 Each server meth │ │ │ -001baf10: 6f64 2063 616e 2069 6d70 6c65 6d65 6e74 od can implement │ │ │ -001baf20: 2061 7574 6865 6e74 6963 6174 696f 6e20 authentication │ │ │ -001baf30: 6173 2064 6573 6972 6564 2061 6e64 206d as desired and m │ │ │ -001baf40: 6179 2065 6e66 6f72 6365 2064 6967 6573 ay enforce diges │ │ │ -001baf50: 7420 6175 7468 656e 7469 6361 7469 6f6e t authentication │ │ │ -001baf60: 206f 7220 6d61 7920 616c 736f 2061 6363 or may also acc │ │ │ -001baf70: 6570 7420 6261 7369 6320 6175 7468 656e ept basic authen │ │ │ -001baf80: 7469 6361 7469 6f6e 2072 6573 706f 6e73 tication respons │ │ │ -001baf90: 6573 2e20 546f 2076 6572 6966 7920 6469 es. To verify di │ │ │ -001bafa0: 6765 7374 2061 7574 6865 6e74 6963 6174 gest authenticat │ │ │ -001bafb0: 696f 6e20 7265 7370 6f6e 7365 732c 2074 ion responses, t │ │ │ -001bafc0: 6865 2073 6572 7665 7220 7368 6f75 6c64 he server should │ │ │ -001bafd0: 2063 6f6d 7075 7465 2061 6e64 2063 6f6d compute and com │ │ │ -001bafe0: 7061 7265 2074 6865 2063 6865 636b 7375 pare the checksu │ │ │ -001baff0: 6d73 2075 7369 6e67 2074 6865 2070 6c75 ms using the plu │ │ │ -001bb000: 6769 6e27 7320 3c63 6f64 653e 6874 7470 gin's http │ │ │ -001bb010: 5f64 615f 7665 7269 6679 5f70 6f73 743c _da_verify_post< │ │ │ -001bb020: 2f63 6f64 653e 2066 756e 6374 696f 6e20 /code> function │ │ │ -001bb030: 666f 7220 4854 5450 2050 4f53 5420 7265 for HTTP POST re │ │ │ -001bb040: 7175 6573 7473 2028 616e 6420 3c63 6f64 quests (and http_da_verify │ │ │ -001bb060: 5f67 6574 3c2f 636f 6465 3e20 666f 7220 _get for │ │ │ -001bb070: 4854 5450 2047 4554 2072 6571 7565 7374 HTTP GET request │ │ │ -001bb080: 7320 7769 7468 2074 6865 2048 5454 5020 s with the HTTP │ │ │ -001bb090: 4745 5420 706c 7567 696e 2920 6173 2066 GET plugin) as f │ │ │ -001bb0a0: 6f6c 6c6f 7773 3a3c 2f70 3e0a 3c64 6976 ollows:

.
# │ │ │ -001bb0f0: 696e 636c 7564 6520 2671 756f 743b 6874 include "ht │ │ │ -001bb100: 7470 6461 2e68 2671 756f 743b 3c2f 7370 tpda.h"
.
.
int main │ │ │ -001bb170: 2829 3c2f 6469 763e 0a3c 6469 7620 636c ()
.
{.
str │ │ │ -001bb1c0: 7563 7420 3c2f 7370 616e 3e3c 6120 636c uct soap *soap = soap_new( │ │ │ -001bb290: 293b 3c2f 6469 763e 0a3c 6469 7620 636c );
.
if │ │ │ -001bb2d0: 2028 3c61 2063 6c61 7373 3d22 636f 6465 (soap_regis │ │ │ -001bb330: 7465 725f 706c 7567 696e 3c2f 613e 283c ter_plugin(< │ │ │ -001bb340: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -001bb350: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ -001bb360: 6874 6d6c 223e 736f 6170 3c2f 613e 2c20 html">soap, │ │ │ -001bb370: 6874 7470 5f64 6129 2920 3c2f 6469 763e http_da))
│ │ │ -001bb380: 0a3c 6469 7620 636c 6173 733d 226c 696e .
exit(EXIT │ │ │ -001bb3a0: 5f46 4149 4c55 5245 293b 203c 7370 616e _FAILURE); // failed to re │ │ │ -001bb3d0: 6769 7374 6572 203c 2f73 7061 6e3e 3c2f gister .
... // use soap_b │ │ │ -001bb420: 696e 6420 616e 6420 736f 6170 5f61 6363 ind and soap_acc │ │ │ -001bb430: 6570 7420 696e 2061 2028 6d75 6c74 692d ept in a (multi- │ │ │ -001bb440: 7468 7265 6164 6564 2920 7365 7276 6963 threaded) servic │ │ │ -001bb450: 6520 6c6f 6f70 3c2f 7370 616e 3e3c 2f64 e loop.
if (soa │ │ │ -001bb4f0: 705f 7365 7276 653c 2f61 3e28 3c61 2063 p_serve(soap))..
... │ │ │ -001bb620: 2f2f 3c2f 7370 616e 3e3c 2f64 6976 3e0a //
. │ │ │ -001bb630: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65 .. │ │ │ -001bb790: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65 .< │ │ │ -001bb840: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -001bb850: 3e7d 3c2f 6469 763e 0a3c 6469 7620 636c >}
.
.
i │ │ │ -001bb8a0: 6e74 3c2f 7370 616e 3e20 6e73 5f5f 7765 nt ns__we │ │ │ -001bb8b0: 626d 6574 686f 6428 3c73 7061 6e20 636c bmethod(st │ │ │ -001bb8d0: 7275 6374 3c2f 7370 616e 3e20 3c61 2063 ruct soap *soap, .. │ │ │ -001bb940: 2e29 203c 2f64 6976 3e0a 3c64 6976 2063 .)
.
{.
if (soap-> │ │ │ -001bb9d0: 3b3c 6120 636c 6173 733d 2263 6f64 6522 ;userid │ │ │ -001bba20: 3c2f 613e 2026 616d 703b 2661 6d70 3b20 && │ │ │ -001bba30: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap- │ │ │ -001bba60: 2667 743b 3c61 2063 6c61 7373 3d22 636f >pas │ │ │ -001bbab0: 7377 643c 2f61 3e29 203c 7370 616e 2063 swd) / │ │ │ -001bbad0: 2f20 636c 6965 6e74 2075 7365 6420 6261 / client used ba │ │ │ -001bbae0: 7369 6320 6175 7468 656e 7469 6361 7469 sic authenticati │ │ │ -001bbaf0: 6f6e 203c 2f73 7061 6e3e 3c2f 6469 763e on
│ │ │ -001bbb00: 0a3c 6469 7620 636c 6173 733d 226c 696e .
{
. │ │ │ -001bbb30: 2020 203c 7370 616e 2063 6c61 7373 3d22 // may │ │ │ -001bbb50: 6465 6369 6465 206e 6f74 2074 6f20 6861 decide not to ha │ │ │ -001bbb60: 6e64 6c65 2c20 6275 7420 6966 206f 6b20 ndle, but if ok │ │ │ -001bbb70: 7468 656e 2067 6f20 6168 6561 6420 616e then go ahead an │ │ │ -001bbb80: 6420 636f 6d70 6172 6520 696e 666f 3a20 d compare info: │ │ │ -001bbb90: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ -001bbbb0: 2020 2020 3c73 7061 6e20 636c 6173 733d if │ │ │ -001bbbd0: 3c2f 7370 616e 3e20 2821 7374 7263 6d70 (!strcmp │ │ │ -001bbbe0: 283c 6120 636c 6173 733d 2263 6f64 6522 (soap │ │ │ -001bbc10: 2d26 6774 3b3c 6120 636c 6173 733d 2263 ->us │ │ │ -001bbc60: 6572 6964 3c2f 613e 2c20 3c61 2063 6c61 erid, userid) & │ │ │ -001bbcc0: 616d 703b 2661 6d70 3b20 2173 7472 636d amp;& !strcm │ │ │ -001bbcd0: 7028 3c61 2063 6c61 7373 3d22 636f 6465 p(soap->p │ │ │ -001bbd50: 6173 7377 643c 2f61 3e2c 203c 6120 636c asswd, passwd)) │ │ │ -001bbdb0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
{< │ │ │ -001bbdd0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
.. │ │ │ -001bbdf0: 2e20 3c73 7061 6e20 636c 6173 733d 2263 . // handl │ │ │ -001bbe10: 6520 7265 7175 6573 743c 2f73 7061 6e3e e request │ │ │ -001bbe20: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
< │ │ │ -001bbe40: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -001bbe50: 6f72 6466 6c6f 7722 3e72 6574 7572 6e3c ordflow">return< │ │ │ -001bbe60: 2f73 7061 6e3e 203c 6120 636c 6173 733d /span> SOAP_ │ │ │ -001bbec0: 4f4b 3c2f 613e 3b20 3c2f 6469 763e 0a3c OK;
.< │ │ │ -001bbed0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -001bbee0: 3e20 2020 207d 203c 2f64 6976 3e0a 3c64 > }
. │ │ │ -001bbf00: 2020 7d20 3c2f 6469 763e 0a3c 6469 7620 }
.
< │ │ │ -001bbf20: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -001bbf30: 6f72 6466 6c6f 7722 3e65 6c73 653c 2f73 ordflow">else i │ │ │ -001bbf60: 663c 2f73 7061 6e3e 2028 3c61 2063 6c61 f (soap->authrealm │ │ │ -001bbff0: 3c2f 613e 2026 616d 703b 2661 6d70 3b20 && │ │ │ -001bc000: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap- │ │ │ -001bc030: 2667 743b 3c61 2063 6c61 7373 3d22 636f >use │ │ │ -001bc080: 7269 643c 2f61 3e29 203c 7370 616e 2063 rid) / │ │ │ -001bc0a0: 2f20 4469 6765 7374 2061 7574 6865 6e74 / Digest authent │ │ │ -001bc0b0: 6963 6174 696f 6e20 3c2f 7370 616e 3e3c ication < │ │ │ -001bc0c0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
{
.
passwd = .. │ │ │ -001bc150: 2e3b 203c 7370 616e 2063 6c61 7373 3d22 .; // data │ │ │ -001bc170: 6261 7365 206c 6f6f 6b75 7020 6f6e 2075 base lookup on u │ │ │ -001bc180: 7365 7269 6420 616e 6420 6175 7468 7265 serid and authre │ │ │ -001bc190: 616c 6d20 746f 2066 696e 6420 7061 7373 alm to find pass │ │ │ -001bc1a0: 7764 203c 2f73 7061 6e3e 3c2f 6469 763e wd
│ │ │ -001bc1b0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
if (!str │ │ │ -001bc1f0: 636d 7028 3c61 2063 6c61 7373 3d22 636f cmp(soap< │ │ │ -001bc220: 2f61 3e2d 2667 743b 3c61 2063 6c61 7373 /a>->authrealm, │ │ │ -001bc280: 3c61 2063 6c61 7373 3d22 636f 6465 2220 authrea │ │ │ -001bc2d0: 6c6d 3c2f 613e 2920 2661 6d70 3b26 616d lm) &&am │ │ │ -001bc2e0: 703b 2021 7374 7263 6d70 283c 6120 636c p; !strcmp(soap->< │ │ │ -001bc320: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -001bc330: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ -001bc340: 6874 6d6c 2361 3265 6465 3032 3039 3564 html#a2ede02095d │ │ │ -001bc350: 3938 3934 3266 3463 3232 3066 6431 3762 98942f4c220fd17b │ │ │ -001bc360: 3439 3537 3033 223e 7573 6572 6964 3c2f 495703">userid, use │ │ │ -001bc3c0: 7269 643c 2f61 3e29 2920 3c2f 6469 763e rid))
│ │ │ -001bc3d0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
{
.< │ │ │ -001bc3f0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -001bc400: 3e20 2020 2020 203c 7370 616e 2063 6c61 > if (!htt │ │ │ -001bc430: 705f 6461 5f76 6572 6966 795f 706f 7374 p_da_verify_post │ │ │ -001bc440: 283c 6120 636c 6173 733d 2263 6f64 6522 (soap │ │ │ -001bc470: 2c20 3c61 2063 6c61 7373 3d22 636f 6465 , passw │ │ │ -001bc4c0: 643c 2f61 3e29 2920 3c2f 6469 763e 0a3c d))
.< │ │ │ -001bc4d0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -001bc4e0: 3e20 2020 2020 207b 3c2f 6469 763e 0a3c > {
.< │ │ │ -001bc4f0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -001bc500: 3e20 2020 2020 2020 202e 2e2e 203c 7370 > ... // handle req │ │ │ -001bc530: 7565 7374 3c2f 7370 616e 3e3c 2f64 6976 uest
..
│ │ │ -001bc600: 2020 2020 7d20 3c2f 6469 763e 0a3c 6469 }
. │ │ │ -001bc620: 2020 207d 203c 2f64 6976 3e0a 3c64 6976 }
.
│ │ │ -001bc640: 7d20 3c2f 6469 763e 0a3c 6469 7620 636c }
.
soap-> │ │ │ -001bc690: 3b3c 6120 636c 6173 733d 2263 6f64 6522 ;authre │ │ │ -001bc6e0: 616c 6d3c 2f61 3e20 3d20 3c61 2063 6c61 alm = authrealm │ │ │ -001bc740: 3b20 3c73 7061 6e20 636c 6173 733d 2263 ; // set r │ │ │ -001bc760: 6561 6c6d 2066 6f72 2063 6861 6c6c 656e ealm for challen │ │ │ -001bc770: 6765 203c 2f73 7061 6e3e 3c2f 6469 763e ge
│ │ │ -001bc780: 0a3c 6469 7620 636c 6173 733d 226c 696e .
r │ │ │ -001bc7b0: 6574 7572 6e3c 2f73 7061 6e3e 2034 3031 eturn 401 │ │ │ -001bc7c0: 3b20 3c73 7061 6e20 636c 6173 733d 2263 ; // Not a │ │ │ -001bc7e0: 7574 686f 7269 7a65 642c 2063 6861 6c6c uthorized, chall │ │ │ -001bc7f0: 656e 6765 2064 6967 6573 7420 6175 7468 enge digest auth │ │ │ -001bc800: 656e 7469 6361 7469 6f6e 203c 2f73 7061 entication
.
}.

For │ │ │ -001bc850: 206d 6f72 6520 6465 7461 696c 732c 2069 more details, i │ │ │ -001bc860: 6e63 6c75 6469 6e67 2068 6f77 2074 6f20 ncluding how to │ │ │ -001bc870: 636f 6e66 6967 7572 6520 4854 5450 2044 configure HTTP D │ │ │ -001bc880: 6967 6573 7420 6175 7468 656e 7469 6361 igest authentica │ │ │ -001bc890: 7469 6f6e 2066 6f72 2070 726f 7869 6573 tion for proxies │ │ │ -001bc8a0: 2c20 7365 6520 7468 6520 3c61 2068 7265 , see the HTTP digest au │ │ │ -001bc8e0: 7468 656e 7469 6361 7469 6f6e 2070 6c75 thentication plu │ │ │ -001bc8f0: 6769 6e3c 2f61 3e20 646f 6375 6d65 6e74 gin document │ │ │ -001bc900: 6174 696f 6e2e 3c2f 703e 0a3c 703e f09f ation.

.

.. │ │ │ -001bc910: 949d 203c 6120 6872 6566 3d22 2322 3e42 .. B │ │ │ -001bc920: 6163 6b20 746f 2074 6162 6c65 206f 6620 ack to table of │ │ │ -001bc930: 636f 6e74 656e 7473 3c2f 613e 3c2f 703e contents

│ │ │ -001bc940: 0a3c 6833 3e3c 6120 636c 6173 733d 2261 .

. │ │ │ -001bc970: 5468 6520 4854 5450 2073 6573 7369 6f6e The HTTP session │ │ │ -001bc980: 7320 706c 7567 696e 3c2f 6833 3e0a 3c70 s plugin

.

The plugin code │ │ │ -001bc9a0: 2069 7320 6c6f 6361 7465 6420 696e 2074 is located in t │ │ │ -001bc9b0: 6865 203c 656d 3e3c 636f 6465 3e67 736f he gso │ │ │ -001bc9c0: 6170 2f70 6c75 6769 6e3c 2f63 6f64 653e ap/plugin │ │ │ -001bc9d0: 3c2f 656d 3e20 6469 7265 6374 6f72 7920 directory │ │ │ -001bc9e0: 636f 6e74 6169 6e69 6e67 203c 656d 3e3c containing < │ │ │ -001bc9f0: 636f 6465 3e73 6573 7369 6f6e 732e 683c code>sessions.h< │ │ │ -001bca00: 2f63 6f64 653e 3c2f 656d 3e20 616e 6420 /code> and │ │ │ -001bca10: 3c65 6d3e 3c63 6f64 653e 7365 7373 696f sessio │ │ │ -001bca20: 6e73 2e63 3c2f 636f 6465 3e3c 2f65 6d3e ns.c │ │ │ -001bca30: 2e3c 2f70 3e0a 3c70 3e46 6f72 206d 6f72 .

.

For mor │ │ │ -001bca40: 6520 6465 7461 696c 732c 2073 6565 2074 e details, see t │ │ │ -001bca50: 6865 203c 6120 6872 6566 3d22 2e2e 2f2e he HTTP │ │ │ -001bca80: 2073 6573 7369 6f6e 7320 706c 7567 696e sessions plugin │ │ │ -001bca90: 3c2f 613e 2064 6f63 756d 656e 7461 7469 documentati │ │ │ -001bcaa0: 6f6e 2e3c 2f70 3e0a 3c70 3ef0 9f94 9d20 on.

.

.... │ │ │ -001bcab0: 3c61 2068 7265 663d 2223 223e 4261 636b Back │ │ │ -001bcac0: 2074 6f20 7461 626c 6520 6f66 2063 6f6e to table of con │ │ │ -001bcad0: 7465 6e74 733c 2f61 3e3c 2f70 3e0a 3c68 tents

..The A │ │ │ -001bcb10: 7061 6368 6520 6d6f 6475 6c65 2070 6c75 pache module plu │ │ │ -001bcb20: 6769 6e3c 2f68 333e 0a3c 703e 5468 6520 gin

.

The │ │ │ -001bcb30: 706c 7567 696e 2063 6f64 6520 6973 206c plugin code is l │ │ │ -001bcb40: 6f63 6174 6564 2069 6e20 7468 6520 3c65 ocated in the gsoap/mo │ │ │ -001bcb60: 645f 6773 6f61 702f 6d6f 645f 6773 6f61 d_gsoap/mod_gsoa │ │ │ -001bcb70: 702d 302e 392f 6170 6163 6865 5f32 303c p-0.9/apache_20< │ │ │ -001bcb80: 2f63 6f64 653e 3c2f 656d 3e20 6469 7265 /code> dire │ │ │ -001bcb90: 6374 6f72 792e 3c2f 703e 0a3c 703e 466f ctory.

.

Fo │ │ │ -001bcba0: 7220 6d6f 7265 2064 6574 6169 6c73 2c20 r more details, │ │ │ -001bcbb0: 7365 6520 7468 6520 3c61 2068 7265 663d see the A │ │ │ -001bcbe0: 7061 6368 6520 6d6f 6475 6c65 3c2f 613e pache module │ │ │ -001bcbf0: 2064 6f63 756d 656e 7461 7469 6f6e 2e3c documentation.< │ │ │ -001bcc00: 2f70 3e0a 3c70 3ef0 9f94 9d20 3c61 2068 /p>.

.... Back to │ │ │ -001bcc20: 7461 626c 6520 6f66 2063 6f6e 7465 6e74 table of content │ │ │ -001bcc30: 733c 2f61 3e3c 2f70 3e0a 3c68 333e 3c61 s

.

.The ISAPI │ │ │ -001bcc70: 6578 7465 6e73 696f 6e20 706c 7567 696e extension plugin │ │ │ -001bcc80: 3c2f 6833 3e0a 3c70 3e54 6865 2070 6c75

.

The plu │ │ │ -001bcc90: 6769 6e20 636f 6465 2069 7320 6c6f 6361 gin code is loca │ │ │ -001bcca0: 7465 6420 696e 2074 6865 203c 656d 3e3c ted in the < │ │ │ -001bccb0: 636f 6465 3e67 736f 6170 2f6d 6f64 5f67 code>gsoap/mod_g │ │ │ -001bccc0: 736f 6170 2f67 736f 6170 5f77 696e 2f69 soap/gsoap_win/i │ │ │ -001bccd0: 7361 7069 3c2f 636f 6465 3e3c 2f65 6d3e sapi │ │ │ -001bcce0: 2064 6972 6563 746f 7279 2e3c 2f70 3e0a directory.

. │ │ │ -001bccf0: 3c70 3e46 6f72 206d 6f72 6520 6465 7461

For more deta │ │ │ -001bcd00: 696c 732c 2073 6565 2074 6865 203c 6120 ils, see the ISAPI extensi │ │ │ -001bcd40: 6f6e 3c2f 613e 2064 6f63 756d 656e 7461 on documenta │ │ │ -001bcd50: 7469 6f6e 2e3c 2f70 3e0a 3c70 3ef0 9f94 tion.

.

... │ │ │ -001bcd60: 9d20 3c61 2068 7265 663d 2223 223e 4261 . Ba │ │ │ -001bcd70: 636b 2074 6f20 7461 626c 6520 6f66 2063 ck to table of c │ │ │ -001bcd80: 6f6e 7465 6e74 733c 2f61 3e3c 2f70 3e0a ontents

. │ │ │ -001bcd90: 3c68 333e 3c61 2063 6c61 7373 3d22 616e

.The C │ │ │ -001bcdc0: 5552 4c20 706c 7567 696e 3c2f 6833 3e0a URL plugin

. │ │ │ -001bcdd0: 3c70 3e54 6865 2070 6c75 6769 6e20 636f

The plugin co │ │ │ -001bcde0: 6465 2069 7320 6c6f 6361 7465 6420 696e de is located in │ │ │ -001bcdf0: 2074 6865 203c 656d 3e3c 636f 6465 3e67 the g │ │ │ -001bce00: 736f 6170 2f70 6c75 6769 6e3c 2f63 6f64 soap/plugin director │ │ │ -001bce20: 7920 636f 6e74 6169 6e69 6e67 203c 656d y containing curlapi.h │ │ │ -001bce40: 3c2f 636f 6465 3e3c 2f65 6d3e 2061 6e64 and │ │ │ -001bce50: 203c 656d 3e3c 636f 6465 3e63 7572 6c61 curla │ │ │ -001bce60: 7069 2e63 3c2f 636f 6465 3e3c 2f65 6d3e pi.c │ │ │ -001bce70: 2e3c 2f70 3e0a 3c70 3e46 6f72 206d 6f72 .

.

For mor │ │ │ -001bce80: 6520 6465 7461 696c 732c 2073 6565 2074 e details, see t │ │ │ -001bce90: 6865 203c 6120 6872 6566 3d22 2e2e 2f2e he CURL plu │ │ │ -001bcec0: 6769 6e3c 2f61 3e20 646f 6375 6d65 6e74 gin document │ │ │ -001bced0: 6174 696f 6e2e 3c2f 703e 0a3c 703e f09f ation.

.

.. │ │ │ -001bcee0: 949d 203c 6120 6872 6566 3d22 2322 3e42 .. B │ │ │ -001bcef0: 6163 6b20 746f 2074 6162 6c65 206f 6620 ack to table of │ │ │ -001bcf00: 636f 6e74 656e 7473 3c2f 613e 3c2f 703e contents

│ │ │ -001bcf10: 0a3c 6833 3e3c 6120 636c 6173 733d 2261 .

.T │ │ │ -001bcf40: 6865 2057 696e 496e 6574 2070 6c75 6769 he WinInet plugi │ │ │ -001bcf50: 6e3c 2f68 333e 0a3c 703e 5468 6520 706c n

.

The pl │ │ │ -001bcf60: 7567 696e 2063 6f64 6520 6973 206c 6f63 ugin code is loc │ │ │ -001bcf70: 6174 6564 2069 6e20 7468 6520 3c65 6d3e ated in the │ │ │ -001bcf80: 3c63 6f64 653e 6773 6f61 702f 6d6f 645f gsoap/mod_ │ │ │ -001bcf90: 6773 6f61 702f 6773 6f61 705f 7769 6e2f gsoap/gsoap_win/ │ │ │ -001bcfa0: 7769 6e69 6e65 743c 2f63 6f64 653e 3c2f wininet directory..

For more d │ │ │ -001bcfd0: 6574 6169 6c73 2c20 7365 6520 7468 6520 etails, see the │ │ │ -001bcfe0: 3c61 2068 7265 663d 222e 2e2f 2e2e 2f77 WinInet │ │ │ -001bd010: 706c 7567 696e 3c2f 613e 2064 6f63 756d plugin docum │ │ │ -001bd020: 656e 7461 7469 6f6e 2e3c 2f70 3e0a 3c70 entation.

.

.... Back to table │ │ │ -001bd050: 6f66 2063 6f6e 7465 6e74 733c 2f61 3e3c of contents< │ │ │ -001bd060: 2f70 3e0a 3c68 333e 3c61 2063 6c61 7373 /p>.

.Th │ │ │ -001bd090: 6520 5753 2d41 6464 7265 7373 696e 6720 e WS-Addressing │ │ │ -001bd0a0: 706c 7567 696e 3c2f 6833 3e0a 3c70 3e54 plugin

.

T │ │ │ -001bd0b0: 6865 2070 6c75 6769 6e20 636f 6465 2069 he plugin code i │ │ │ -001bd0c0: 7320 6c6f 6361 7465 6420 696e 2074 6865 s located in the │ │ │ -001bd0d0: 203c 656d 3e3c 636f 6465 3e67 736f 6170 gsoap │ │ │ -001bd0e0: 2f70 6c75 6769 6e3c 2f63 6f64 653e 3c2f /plugin directory co │ │ │ -001bd100: 6e74 6169 6e69 6e67 203c 656d 3e3c 636f ntaining wsaapi.h and │ │ │ -001bd130: 3c63 6f64 653e 7773 6161 7069 2e63 3c2f wsaapi.c (to b │ │ │ -001bd150: 6520 7573 6564 2069 6e20 4320 616e 6420 e used in C and │ │ │ -001bd160: 432b 2b29 2e3c 2f70 3e0a 3c70 3e54 6f20 C++).

.

To │ │ │ -001bd170: 656e 6162 6c65 2057 532d 4164 6472 6573 enable WS-Addres │ │ │ -001bd180: 7369 6e67 2032 3030 3520 2861 6e64 2073 sing 2005 (and s │ │ │ -001bd190: 7570 706f 7274 2066 6f72 2038 2f32 3030 upport for 8/200 │ │ │ -001bd1a0: 3429 2c20 7468 6520 7365 7276 6963 6520 4), the service │ │ │ -001bd1b0: 6465 6669 6e69 7469 6f6e 7320 6865 6164 definitions head │ │ │ -001bd1c0: 6572 2066 696c 6520 666f 7220 736f 6170 er file for soap │ │ │ -001bd1d0: 6370 7032 2073 686f 756c 6420 696e 636c cpp2 should incl │ │ │ -001bd1e0: 7564 6520 7468 6520 666f 6c6c 6f77 696e ude the followin │ │ │ -001bd1f0: 6720 696d 706f 7274 733a 3c2f 703e 0a3c g imports:

.< │ │ │ -001bd200: 6469 7620 636c 6173 733d 2266 7261 676d div class="fragm │ │ │ -001bd210: 656e 7422 3e3c 6469 7620 636c 6173 733d ent">
#import " │ │ │ -001bd250: 696d 706f 7274 2f77 7361 352e 6826 7175 import/wsa5.h&qu │ │ │ -001bd260: 6f74 3b3c 2f73 7061 6e3e 3c2f 6469 763e ot;
│ │ │ -001bd270: 0a3c 2f64 6976 3e3c 212d 2d20 6672 6167 .

This │ │ │ -001bd290: 696d 706f 7274 7320 7468 6520 534f 4150 imports the SOAP │ │ │ -001bd2a0: 2068 6561 6465 7220 656c 656d 656e 7473 header elements │ │ │ -001bd2b0: 2072 6571 7569 7265 6420 6279 2057 532d required by WS- │ │ │ -001bd2c0: 4164 6472 6573 7369 6e67 2e3c 2f70 3e0a Addressing.

. │ │ │ -001bd2d0: 3c70 3e46 6f72 206d 6f72 6520 6465 7461

For more deta │ │ │ -001bd2e0: 696c 732c 2073 6565 2074 6865 203c 6120 ils, see the WS-Addressing p │ │ │ -001bd320: 6c75 6769 6e3c 2f61 3e20 646f 6375 6d65 lugin docume │ │ │ -001bd330: 6e74 6174 696f 6e2e 3c2f 703e 0a3c 703e ntation.

.

│ │ │ -001bd340: f09f 949d 203c 6120 6872 6566 3d22 2322 .... Back to table o │ │ │ -001bd360: 6620 636f 6e74 656e 7473 3c2f 613e 3c2f f contents.

.Th │ │ │ -001bd3a0: 6520 5753 2d52 656c 6961 626c 654d 6573 e WS-ReliableMes │ │ │ -001bd3b0: 7361 6769 6e67 2070 6c75 6769 6e3c 2f68 saging plugin.

The plugin │ │ │ -001bd3d0: 2063 6f64 6520 6973 206c 6f63 6174 6564 code is located │ │ │ -001bd3e0: 2069 6e20 7468 6520 3c65 6d3e 3c63 6f64 in the gsoap/plugin direc │ │ │ -001bd410: 746f 7279 2063 6f6e 7461 696e 696e 6720 tory containing │ │ │ -001bd420: 3c65 6d3e 3c63 6f64 653e 7773 726d 6170 wsrmap │ │ │ -001bd430: 692e 683c 2f63 6f64 653e 3c2f 656d 3e20 i.h │ │ │ -001bd440: 616e 6420 3c65 6d3e 3c63 6f64 653e 7773 and ws │ │ │ -001bd450: 726d 6170 692e 633c 2f63 6f64 653e 3c2f rmapi.c (to be used │ │ │ -001bd470: 696e 2043 2061 6e64 2043 2b2b 292e 3c2f in C and C++)..

Also neede │ │ │ -001bd490: 6420 6172 6520 3c65 6d3e 3c63 6f64 653e d are │ │ │ -001bd4a0: 7468 7265 6164 732e 683c 2f63 6f64 653e threads.h │ │ │ -001bd4b0: 3c2f 656d 3e20 616e 6420 3c65 6d3e 3c63 and threads.c for mu │ │ │ -001bd4e0: 6c74 692d 7468 7265 6164 696e 6720 616e lti-threading an │ │ │ -001bd4f0: 6420 6c6f 636b 696e 6720 7375 7070 6f72 d locking suppor │ │ │ -001bd500: 742e 3c2f 703e 0a3c 703e 546f 2065 6e61 t.

.

To ena │ │ │ -001bd510: 626c 6520 5753 2d52 656c 6961 626c 654d ble WS-ReliableM │ │ │ -001bd520: 6573 7361 6769 6e67 2c20 7468 6520 7365 essaging, the se │ │ │ -001bd530: 7276 6963 6520 6465 6669 6e69 7469 6f6e rvice definition │ │ │ -001bd540: 7320 6865 6164 6572 2066 696c 6520 666f s header file fo │ │ │ -001bd550: 7220 736f 6170 6370 7032 2073 686f 756c r soapcpp2 shoul │ │ │ -001bd560: 6420 696e 636c 7564 6520 7468 6520 666f d include the fo │ │ │ -001bd570: 6c6c 6f77 696e 6720 696d 706f 7274 733a llowing imports: │ │ │ -001bd580: 3c2f 703e 0a3c 6469 7620 636c 6173 733d

.
#import │ │ │ -001bd5d0: 2671 756f 743b 696d 706f 7274 2f77 7372 "import/wsr │ │ │ -001bd5e0: 6d2e 6826 7175 6f74 3b3c 2f73 7061 6e3e m.h" │ │ │ -001bd5f0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
#import &qu │ │ │ -001bd630: 6f74 3b69 6d70 6f72 742f 7773 6135 2e68 ot;import/wsa5.h │ │ │ -001bd640: 2671 756f 743b 3c2f 7370 616e 3e3c 2f64 ".

Th │ │ │ -001bd670: 6973 2069 6d70 6f72 7473 2074 6865 2053 is imports the S │ │ │ -001bd680: 4f41 5020 6865 6164 6572 2065 6c65 6d65 OAP header eleme │ │ │ -001bd690: 6e74 7320 7265 7175 6972 6564 2062 7920 nts required by │ │ │ -001bd6a0: 5753 2d52 656c 6961 626c 654d 6573 7361 WS-ReliableMessa │ │ │ -001bd6b0: 6769 6e67 2e3c 2f70 3e0a 3c70 3e46 6f72 ging.

.

For │ │ │ -001bd6c0: 206d 6f72 6520 6465 7461 696c 732c 2073 more details, s │ │ │ -001bd6d0: 6565 2074 6865 203c 6120 6872 6566 3d22 ee the WS- │ │ │ -001bd700: 5265 6c69 6162 6c65 4d65 7373 6167 696e ReliableMessagin │ │ │ -001bd710: 6720 706c 7567 696e 3c2f 613e 2064 6f63 g plugin doc │ │ │ -001bd720: 756d 656e 7461 7469 6f6e 2e3c 2f70 3e0a umentation.

. │ │ │ -001bd730: 3c70 3ef0 9f94 9d20 3c61 2068 7265 663d

.... Back to tabl │ │ │ -001bd750: 6520 6f66 2063 6f6e 7465 6e74 733c 2f61 e of contents

.

│ │ │ -001bd790: 0a54 6865 2057 532d 5365 6375 7269 7479 .The WS-Security │ │ │ -001bd7a0: 2070 6c75 6769 6e3c 2f68 333e 0a3c 703e plugin

.

│ │ │ -001bd7b0: 5468 6520 706c 7567 696e 2063 6f64 6520 The plugin code │ │ │ -001bd7c0: 6973 206c 6f63 6174 6564 2069 6e20 7468 is located in th │ │ │ -001bd7d0: 6520 3c65 6d3e 3c63 6f64 653e 6773 6f61 e gsoa │ │ │ -001bd7e0: 702f 706c 7567 696e 3c2f 636f 6465 3e3c p/plugin< │ │ │ -001bd7f0: 2f65 6d3e 2064 6972 6563 746f 7279 2063 /em> directory c │ │ │ -001bd800: 6f6e 7461 696e 696e 6720 3c65 6d3e 3c63 ontaining wsseapi.h and wsseapi. │ │ │ -001bd840: 633c 2f63 6f64 653e 3c2f 656d 3e20 2874 c (t │ │ │ -001bd850: 6f20 6265 2075 7365 6420 696e 2043 2061 o be used in C a │ │ │ -001bd860: 6e64 2043 2b2b 292e 3c2f 703e 0a3c 703e nd C++).

.

│ │ │ -001bd870: 416c 736f 206e 6565 6465 6420 6172 653a Also needed are: │ │ │ -001bd880: 203c 656d 3e3c 636f 6465 3e73 6d64 6576 smdev │ │ │ -001bd890: 702e 683c 2f63 6f64 653e 3c2f 656d 3e20 p.h │ │ │ -001bd8a0: 616e 6420 3c65 6d3e 3c63 6f64 653e 736d and sm │ │ │ -001bd8b0: 6465 7670 2e63 3c2f 636f 6465 3e3c 2f65 devp.c for streaming │ │ │ -001bd8d0: 2058 4d4c 2073 6967 6e61 7475 7265 2061 XML signature a │ │ │ -001bd8e0: 6e64 206d 6573 7361 6765 2064 6967 6573 nd message diges │ │ │ -001bd8f0: 7420 656e 6769 6e65 2c20 3c65 6d3e 3c63 t engine, mecevp.h and mecevp.c< │ │ │ -001bd930: 2f63 6f64 653e 3c2f 656d 3e20 666f 7220 /code> for │ │ │ -001bd940: 7468 6520 7374 7265 616d 696e 6720 584d the streaming XM │ │ │ -001bd950: 4c20 656e 6372 7970 7469 6f6e 2065 6e67 L encryption eng │ │ │ -001bd960: 696e 652c 203c 656d 3e3c 636f 6465 3e74 ine, t │ │ │ -001bd970: 6872 6561 6473 2e68 3c2f 636f 6465 3e3c hreads.h< │ │ │ -001bd980: 2f65 6d3e 2061 6e64 203c 656d 3e3c 636f /em> and threads.c for mul │ │ │ -001bd9b0: 7469 2d74 6872 6561 6469 6e67 2061 6e64 ti-threading and │ │ │ -001bd9c0: 206c 6f63 6b69 6e67 2073 7570 706f 7274 locking support │ │ │ -001bd9d0: 2e3c 2f70 3e0a 3c70 3e54 6f20 656e 6162 .

.

To enab │ │ │ -001bd9e0: 6c65 2057 532d 5365 6375 7269 7479 2c20 le WS-Security, │ │ │ -001bd9f0: 7468 6520 7365 7276 6963 6520 6465 6669 the service defi │ │ │ -001bda00: 6e69 7469 6f6e 7320 6865 6164 6572 2066 nitions header f │ │ │ -001bda10: 696c 6520 666f 7220 736f 6170 6370 7032 ile for soapcpp2 │ │ │ -001bda20: 2073 686f 756c 6420 696e 636c 7564 6520 should include │ │ │ -001bda30: 7468 6520 666f 6c6c 6f77 696e 6720 696d the following im │ │ │ -001bda40: 706f 7274 733a 3c2f 703e 0a3c 6469 7620 ports:

.
#i │ │ │ -001bda90: 6d70 6f72 7420 2671 756f 743b 696d 706f mport "impo │ │ │ -001bdaa0: 7274 2f77 7373 652e 6826 7175 6f74 3b3c rt/wsse.h"< │ │ │ -001bdab0: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 2f64 /span>
.

This impo │ │ │ -001bdae0: 7274 7320 7468 6520 534f 4150 2068 6561 rts the SOAP hea │ │ │ -001bdaf0: 6465 7220 656c 656d 656e 7473 2072 6571 der elements req │ │ │ -001bdb00: 7569 7265 6420 6279 2057 532d 5365 6375 uired by WS-Secu │ │ │ -001bdb10: 7269 7479 2e3c 2f70 3e0a 3c70 3e46 6f72 rity.

.

For │ │ │ -001bdb20: 206d 6f72 6520 6465 7461 696c 732c 2073 more details, s │ │ │ -001bdb30: 6565 2074 6865 203c 6120 6872 6566 3d22 ee the WS-Se │ │ │ -001bdb60: 6375 7269 7479 2070 6c75 6769 6e3c 2f61 curity plugin documentation. │ │ │ -001bdb80: 3c2f 703e 0a3c 703e f09f 949d 203c 6120

.

.... Back to │ │ │ -001bdba0: 2074 6162 6c65 206f 6620 636f 6e74 656e table of conten │ │ │ -001bdbb0: 7473 3c2f 613e 3c2f 703e 0a3c 6833 3e3c ts

.

< │ │ │ -001bdbc0: 6120 636c 6173 733d 2261 6e63 686f 7222 a class="anchor" │ │ │ -001bdbd0: 2069 643d 2277 7364 6470 6c75 6769 6e22 id="wsddplugin" │ │ │ -001bdbe0: 3e3c 2f61 3e0a 5468 6520 5753 2d44 6973 >.The WS-Dis │ │ │ -001bdbf0: 636f 7665 7279 2070 6c75 6769 6e3c 2f68 covery plugin.

Basically, │ │ │ -001bdc10: 2074 6f20 6164 6420 5753 2d44 6973 636f to add WS-Disco │ │ │ -001bdc20: 7665 7279 2073 7570 706f 7274 2074 6865 very support the │ │ │ -001bdc30: 2066 6f6c 6c6f 7769 6e67 2065 7665 6e74 following event │ │ │ -001bdc40: 2068 616e 646c 6572 7320 6d75 7374 2062 handlers must b │ │ │ -001bdc50: 6520 6465 6669 6e65 6420 616e 6420 6c69 e defined and li │ │ │ -001bdc60: 6e6b 6564 3a3c 2f70 3e0a 3c64 6976 2063 nked:

.
│ │ │ -001bdc80: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
void │ │ │ -001bdcb0: 3c2f 7370 616e 3e20 7773 6464 5f65 7665 wsdd_eve │ │ │ -001bdcc0: 6e74 5f48 656c 6c6f 283c 7370 616e 2063 nt_Hello(s │ │ │ -001bdce0: 7472 7563 743c 2f73 7061 6e3e 203c 6120 truct soap *soap, < │ │ │ -001bdd50: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
unsigned int< │ │ │ -001bddb0: 2f73 7061 6e3e 2049 6e73 7461 6e63 6549 /span> InstanceI │ │ │ -001bddc0: 642c 203c 2f64 6976 3e0a 3c64 6976 2063 d,
.
const < │ │ │ -001bde00: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -001bde10: 6f72 6474 7970 6522 3e63 6861 723c 2f73 ordtype">char *SequenceId │ │ │ -001bde30: 2c20 3c2f 6469 763e 0a3c 6469 7620 636c ,
.
unsigned i │ │ │ -001bde90: 6e74 3c2f 7370 616e 3e20 4d65 7373 6167 nt Messag │ │ │ -001bdea0: 654e 756d 6265 722c 203c 2f64 6976 3e0a eNumber,
. │ │ │ -001bdeb0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
const c │ │ │ -001bdf00: 6861 723c 2f73 7061 6e3e 202a 4d65 7373 har *Mess │ │ │ -001bdf10: 6167 6549 442c 203c 2f64 6976 3e0a 3c64 ageID,
. │ │ │ -001bdf30: 3c73 7061 6e20 636c 6173 733d 226b 6579 const cha │ │ │ -001bdf70: 723c 2f73 7061 6e3e 202a 5265 6c61 7465 r *Relate │ │ │ -001bdf80: 7354 6f2c 203c 2f64 6976 3e0a 3c64 6976 sTo,
.
const │ │ │ -001bdfc0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 char< │ │ │ -001bdfe0: 2f73 7061 6e3e 202a 456e 6470 6f69 6e74 /span> *Endpoint │ │ │ -001bdff0: 5265 6665 7265 6e63 652c 203c 2f64 6976 Reference,
.
const< │ │ │ -001be030: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> char *Ty │ │ │ -001be060: 7065 732c 203c 2f64 6976 3e0a 3c64 6976 pes,
.
const │ │ │ -001be0a0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 char< │ │ │ -001be0c0: 2f73 7061 6e3e 202a 5363 6f70 6573 2c20 /span> *Scopes, │ │ │ -001be0d0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
c │ │ │ -001be100: 6f6e 7374 3c2f 7370 616e 3e20 3c73 7061 onst char *MatchBy, .
const │ │ │ -001be170: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c char *X │ │ │ -001be1a0: 4164 6472 732c 203c 2f64 6976 3e0a 3c64 Addrs,
. │ │ │ -001be1c0: 3c73 7061 6e20 636c 6173 733d 226b 6579 unsign │ │ │ -001be1e0: 6564 3c2f 7370 616e 3e20 3c73 7061 6e20 ed int M │ │ │ -001be210: 6574 6164 6174 6156 6572 7369 6f6e 293c etadataVersion)< │ │ │ -001be220: 2f64 6976 3e0a 3c2f 6469 763e 3c21 2d2d /div>.
v │ │ │ -001be280: 6f69 643c 2f73 7061 6e3e 2077 7364 645f oid wsdd_ │ │ │ -001be290: 6576 656e 745f 4279 6528 3c73 7061 6e20 event_Bye( │ │ │ -001be2b0: 7374 7275 6374 3c2f 7370 616e 3e20 3c61 struct soap *< │ │ │ -001be2f0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ -001be300: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ -001be310: 6874 6d6c 223e 736f 6170 3c2f 613e 2c20 html">soap, │ │ │ -001be320: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
unsigned int │ │ │ -001be380: 3c2f 7370 616e 3e20 496e 7374 616e 6365 Instance │ │ │ -001be390: 4964 2c20 3c2f 6469 763e 0a3c 6469 7620 Id,
.
const │ │ │ -001be3d0: 3c73 7061 6e20 636c 6173 733d 226b 6579 char *SequenceI │ │ │ -001be400: 642c 203c 2f64 6976 3e0a 3c64 6976 2063 d,
.
unsigned │ │ │ -001be460: 696e 743c 2f73 7061 6e3e 204d 6573 7361 int Messa │ │ │ -001be470: 6765 4e75 6d62 6572 2c20 3c2f 6469 763e geNumber,
│ │ │ -001be480: 0a3c 6469 7620 636c 6173 733d 226c 696e .
const │ │ │ -001be4d0: 6368 6172 3c2f 7370 616e 3e20 2a4d 6573 char *Mes │ │ │ -001be4e0: 7361 6765 4944 2c20 3c2f 6469 763e 0a3c sageID,
.< │ │ │ -001be4f0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -001be500: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >const ch │ │ │ -001be540: 6172 3c2f 7370 616e 3e20 2a52 656c 6174 ar *Relat │ │ │ -001be550: 6573 546f 2c20 3c2f 6469 763e 0a3c 6469 esTo,
.< │ │ │ -001be570: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -001be580: 6f72 6422 3e63 6f6e 7374 3c2f 7370 616e ord">const char │ │ │ -001be5b0: 3c2f 7370 616e 3e20 2a45 6e64 706f 696e *Endpoin │ │ │ -001be5c0: 7452 6566 6572 656e 6365 2c20 3c2f 6469 tReference, .
const │ │ │ -001be600: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c char *T │ │ │ -001be630: 7970 6573 2c20 3c2f 6469 763e 0a3c 6469 ypes,
.< │ │ │ -001be650: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -001be660: 6f72 6422 3e63 6f6e 7374 3c2f 7370 616e ord">const char │ │ │ -001be690: 3c2f 7370 616e 3e20 2a53 636f 7065 732c *Scopes, │ │ │ -001be6a0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61

.
│ │ │ -001be6d0: 636f 6e73 743c 2f73 7061 6e3e 203c 7370 const char *MatchBy, .
cons │ │ │ -001be740: 743c 2f73 7061 6e3e 203c 7370 616e 2063 t char * │ │ │ -001be770: 5841 6464 7273 2c20 3c2f 6469 763e 0a3c XAddrs,
.< │ │ │ -001be780: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -001be790: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >unsig │ │ │ -001be7b0: 6e65 643c 2f73 7061 6e3e 203c 7370 616e ned int │ │ │ -001be7e0: 4d65 7461 6461 7461 5665 7273 696f 6e29 MetadataVersion) │ │ │ -001be7f0: 3c2f 6469 763e 0a3c 2f64 6976 3e3c 212d
.
soap_wsdd_ │ │ │ -001be840: 6d6f 6465 2077 7364 645f 6576 656e 745f mode wsdd_event_ │ │ │ -001be850: 5072 6f62 6528 3c73 7061 6e20 636c 6173 Probe(stru │ │ │ -001be870: 6374 3c2f 7370 616e 3e20 3c61 2063 6c61 ct soap *soap, .
const │ │ │ -001be910: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c char *M │ │ │ -001be940: 6573 7361 6765 4944 2c20 3c2f 6469 763e essageID,
│ │ │ -001be950: 0a3c 6469 7620 636c 6173 733d 226c 696e .
const │ │ │ -001be9a0: 6368 6172 3c2f 7370 616e 3e20 2a52 6570 char *Rep │ │ │ -001be9b0: 6c79 546f 2c20 3c2f 6469 763e 0a3c 6469 lyTo,
.< │ │ │ -001be9d0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -001be9e0: 6f72 6422 3e63 6f6e 7374 3c2f 7370 616e ord">const char │ │ │ -001bea10: 3c2f 7370 616e 3e20 2a54 7970 6573 2c20 *Types, │ │ │ -001bea20: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
c │ │ │ -001bea50: 6f6e 7374 3c2f 7370 616e 3e20 3c73 7061 onst char *Scopes,
.
const< │ │ │ -001beac0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> char *Ma │ │ │ -001beaf0: 7463 6842 792c 203c 2f64 6976 3e0a 3c64 tchBy,
. │ │ │ -001beb10: 3c73 7061 6e20 636c 6173 733d 226b 6579 struct wsdd__ProbeM │ │ │ -001beb40: 6174 6368 6573 5479 7065 202a 5072 6f62 atchesType *Prob │ │ │ -001beb50: 654d 6174 6368 6573 293c 2f64 6976 3e0a eMatches)

. │ │ │ -001beb60: 3c2f 6469 763e 3c21 2d2d 2066 7261 676d
< │ │ │ -001beba0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -001bebb0: 6f72 6474 7970 6522 3e76 6f69 643c 2f73 ordtype">void wsdd_event_ │ │ │ -001bebd0: 5072 6f62 654d 6174 6368 6573 283c 7370 ProbeMatches(struct │ │ │ -001bec00: 203c 6120 636c 6173 733d 2263 6f64 6522 soap │ │ │ -001bec30: 202a 3c61 2063 6c61 7373 3d22 636f 6465 *soap,
.
unsigned │ │ │ -001becc0: 696e 743c 2f73 7061 6e3e 2049 6e73 7461 int Insta │ │ │ -001becd0: 6e63 6549 642c 203c 2f64 6976 3e0a 3c64 nceId,
. │ │ │ -001becf0: 3c73 7061 6e20 636c 6173 733d 226b 6579 const cha │ │ │ -001bed30: 723c 2f73 7061 6e3e 202a 5365 7175 656e r *Sequen │ │ │ -001bed40: 6365 4964 2c20 3c2f 6469 763e 0a3c 6469 ceId,
.< │ │ │ -001bed60: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -001bed70: 6f72 6474 7970 6522 3e75 6e73 6967 6e65 ordtype">unsigne │ │ │ -001bed80: 643c 2f73 7061 6e3e 203c 7370 616e 2063 d int Me │ │ │ -001bedb0: 7373 6167 654e 756d 6265 722c 203c 2f64 ssageNumber, .
cons │ │ │ -001bedf0: 743c 2f73 7061 6e3e 203c 7370 616e 2063 t char * │ │ │ -001bee20: 4d65 7373 6167 6549 442c 203c 2f64 6976 MessageID,
.
const< │ │ │ -001bee60: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> char *Re │ │ │ -001bee90: 6c61 7465 7354 6f2c 203c 2f64 6976 3e0a latesTo,
. │ │ │ -001beea0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
struct wsdd__Prob │ │ │ -001beee0: 654d 6174 6368 6573 5479 7065 202a 5072 eMatchesType *Pr │ │ │ -001beef0: 6f62 654d 6174 6368 6573 293c 2f64 6976 obeMatches)
.
< │ │ │ -001bef30: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -001bef40: 3e73 6f61 705f 7773 6464 5f6d 6f64 6520 >soap_wsdd_mode │ │ │ -001bef50: 7773 6464 5f65 7665 6e74 5f52 6573 6f6c wsdd_event_Resol │ │ │ -001bef60: 7665 283c 7370 616e 2063 6c61 7373 3d22 ve(struct< │ │ │ -001bef80: 2f73 7061 6e3e 203c 6120 636c 6173 733d /span> so │ │ │ -001befb0: 6170 3c2f 613e 202a 3c61 2063 6c61 7373 ap *s │ │ │ -001befe0: 6f61 703c 2f61 3e2c 203c 2f64 6976 3e0a oap,
. │ │ │ -001beff0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
const c │ │ │ -001bf040: 6861 723c 2f73 7061 6e3e 202a 4d65 7373 har *Mess │ │ │ -001bf050: 6167 6549 442c 203c 2f64 6976 3e0a 3c64 ageID,
. │ │ │ -001bf070: 3c73 7061 6e20 636c 6173 733d 226b 6579 const cha │ │ │ -001bf0b0: 723c 2f73 7061 6e3e 202a 5265 706c 7954 r *ReplyT │ │ │ -001bf0c0: 6f2c 203c 2f64 6976 3e0a 3c64 6976 2063 o,
.
const < │ │ │ -001bf100: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -001bf110: 6f72 6474 7970 6522 3e63 6861 723c 2f73 ordtype">char *EndpointRe │ │ │ -001bf130: 6665 7265 6e63 652c 203c 2f64 6976 3e0a ference,
. │ │ │ -001bf140: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
struct wsdd__Reso │ │ │ -001bf180: 6c76 654d 6174 6368 6573 5479 7065 202a lveMatchesType * │ │ │ -001bf190: 5265 736f 6c76 654d 6174 6368 6573 293c ResolveMatches)< │ │ │ -001bf1a0: 2f64 6976 3e0a 3c2f 6469 763e 3c21 2d2d /div>.
v │ │ │ -001bf200: 6f69 643c 2f73 7061 6e3e 2077 7364 645f oid wsdd_ │ │ │ -001bf210: 6576 656e 745f 5265 736f 6c76 654d 6174 event_ResolveMat │ │ │ -001bf220: 6368 6573 283c 7370 616e 2063 6c61 7373 ches(struc │ │ │ -001bf240: 743c 2f73 7061 6e3e 203c 6120 636c 6173 t │ │ │ -001bf270: 736f 6170 3c2f 613e 202a 3c61 2063 6c61 soap *soap,
.
un │ │ │ -001bf2e0: 7369 676e 6564 3c2f 7370 616e 3e20 3c73 signed int InstanceId, < │ │ │ -001bf320: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
co │ │ │ -001bf350: 6e73 743c 2f73 7061 6e3e 203c 7370 616e nst char │ │ │ -001bf380: 202a 5365 7175 656e 6365 4964 2c20 3c2f *SequenceId, .
unsigned │ │ │ -001bf3d0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 int MessageNum │ │ │ -001bf400: 6265 722c 203c 2f64 6976 3e0a 3c64 6976 ber,
.
const │ │ │ -001bf440: 203c 7370 616e 2063 6c61 7373 3d22 6b65 char< │ │ │ -001bf460: 2f73 7061 6e3e 202a 4d65 7373 6167 6549 /span> *MessageI │ │ │ -001bf470: 442c 203c 2f64 6976 3e0a 3c64 6976 2063 D,
.
const < │ │ │ -001bf4b0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ -001bf4c0: 6f72 6474 7970 6522 3e63 6861 723c 2f73 ordtype">char *RelatesTo, │ │ │ -001bf4e0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
│ │ │ -001bf510: 636f 6e73 743c 2f73 7061 6e3e 203c 7370 const char *EndpointRefe │ │ │ -001bf550: 7265 6e63 652c 203c 2f64 6976 3e0a 3c64 rence,
. │ │ │ -001bf570: 3c73 7061 6e20 636c 6173 733d 226b 6579 const cha │ │ │ -001bf5b0: 723c 2f73 7061 6e3e 202a 5479 7065 732c r *Types, │ │ │ -001bf5c0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
│ │ │ -001bf5f0: 636f 6e73 743c 2f73 7061 6e3e 203c 7370 const char *Scopes, .
const │ │ │ -001bf660: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c char *M │ │ │ -001bf690: 6174 6368 4279 2c20 3c2f 6469 763e 0a3c atchBy,
.< │ │ │ -001bf6a0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ -001bf6b0: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >const
ch │ │ │ -001bf6f0: 6172 3c2f 7370 616e 3e20 2a58 4164 6472 ar *XAddr │ │ │ -001bf700: 732c 203c 2f64 6976 3e0a 3c64 6976 2063 s,
.
unsigned │ │ │ -001bf760: 696e 743c 2f73 7061 6e3e 204d 6574 6164 int Metad │ │ │ -001bf770: 6174 6156 6572 7369 6f6e 293c 2f64 6976 ataVersion)
.

Thes │ │ │ -001bf7a0: 6520 6576 656e 7420 6861 6e64 6c65 7273 e event handlers │ │ │ -001bf7b0: 2077 696c 6c20 6265 2069 6e76 6f6b 6564 will be invoked │ │ │ -001bf7c0: 2077 6865 6e20 696e 626f 756e 6420 5753 when inbound WS │ │ │ -001bf7d0: 2d44 6973 636f 7665 7279 206d 6573 7361 -Discovery messa │ │ │ -001bf7e0: 6765 7320 6172 7269 7665 2075 7369 6e67 ges arrive using │ │ │ -001bf7f0: 3a3c 2f70 3e0a 3c64 6976 2063 6c61 7373 :

.
if (!soap_valid │ │ │ -001bf8a0: 5f73 6f63 6b65 743c 2f61 3e28 3c61 2063 _socket(soap │ │ │ -001bf900: 5f62 696e 643c 2f61 3e28 3c61 2063 6c61 _bind(soap, NULL, │ │ │ -001bf940: 203c 6120 636c 6173 733d 2263 6f64 6522 port, BACKLOG))) < │ │ │ -001bf9a0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
... // error
.
< │ │ │ -001bfac0: 212d 2d20 6672 6167 6d65 6e74 202d 2d3e !-- fragment --> │ │ │ -001bfad0: 3c70 3e77 6869 6368 2077 696c 6c20 6c69

which will li │ │ │ -001bfae0: 7374 656e 2066 6f72 203c 636f 6465 3e74 sten for t │ │ │ -001bfaf0: 696d 656f 7574 3c2f 636f 6465 3e20 7365 imeout se │ │ │ -001bfb00: 636f 6e64 7320 746f 2069 6e62 6f75 6e64 conds to inbound │ │ │ -001bfb10: 2057 532d 4469 7363 6f76 6572 7920 6d65 WS-Discovery me │ │ │ -001bfb20: 7373 6167 6573 206f 6e20 6120 706f 7274 ssages on a port │ │ │ -001bfb30: 2061 6e64 2064 6973 7061 7463 6865 7320 and dispatches │ │ │ -001bfb40: 7468 656d 2074 6f20 7468 6520 6576 656e them to the even │ │ │ -001bfb50: 7420 6861 6e64 6c65 7273 2e20 4120 6e65 t handlers. A ne │ │ │ -001bfb60: 6761 7469 7665 203c 636f 6465 3e74 696d gative tim │ │ │ -001bfb70: 656f 7574 3c2f 636f 6465 3e20 7661 6c75 eout valu │ │ │ -001bfb80: 6520 7370 6563 6966 6965 7320 7468 6520 e specifies the │ │ │ -001bfb90: 7469 6d65 6f75 7420 696e 206d 6963 726f timeout in micro │ │ │ -001bfba0: 7365 636f 6e64 732e 3c2f 703e 0a3c 703e seconds.

.

│ │ │ -001bfbb0: 466f 7220 6d6f 7265 2064 6574 6169 6c73 For more details │ │ │ -001bfbc0: 2c20 7365 6520 7468 6520 3c61 2068 7265 , see the │ │ │ -001bfbf0: 5753 2d44 6973 636f 7665 7279 2070 6c75 WS-Discovery plu │ │ │ -001bfc00: 6769 6e3c 2f61 3e20 646f 6375 6d65 6e74 gin document │ │ │ -001bfc10: 6174 696f 6e2e 3c2f 703e 0a3c 6831 3e3c ation.

.

< │ │ │ -001bfc20: 6120 636c 6173 733d 2261 6e63 686f 7222 a class="anchor" │ │ │ -001bfc30: 2069 643d 2263 6f70 7972 6967 6874 223e id="copyright"> │ │ │ -001bfc40: 3c2f 613e 0a43 6f70 7972 6967 6874 3c2f .Copyright.

Copyr │ │ │ -001bfc60: 6967 6874 2028 6329 2032 3030 302d 3230 ight (c) 2000-20 │ │ │ -001bfc70: 3230 2c20 526f 6265 7274 2041 2e20 7661 20, Robert A. va │ │ │ -001bfc80: 6e20 456e 6765 6c65 6e2c 2047 656e 6976 n Engelen, Geniv │ │ │ -001bfc90: 6961 2049 6e63 2e3c 6272 2020 2f3e 0a41 ia Inc.
.A │ │ │ -001bfca0: 6c6c 2072 6967 6874 7320 7265 7365 7276 ll rights reserv │ │ │ -001bfcb0: 6564 2e3c 2f65 6d3e 203c 2f70 3e0a 3c2f ed.

.

.
..
.Copyr │ │ │ -001bfd40: 6967 6874 2028 4329 2032 3032 312c 2052 ight (C) 2021, R │ │ │ -001bfd50: 6f62 6572 7420 7661 6e20 456e 6765 6c65 obert van Engele │ │ │ -001bfd60: 6e2c 2047 656e 6976 6961 2049 6e63 2e2c n, Genivia Inc., │ │ │ -001bfd70: 2041 6c6c 2052 6967 6874 7320 5265 7365 All Rights Rese │ │ │ -001bfd80: 7276 6564 2e0a 3c2f 6164 6472 6573 733e rved..
│ │ │ -001bfd90: 0a3c 6164 6472 6573 7320 636c 6173 733d .
│ │ │ -001bfdb0: 0a43 6f6e 7665 7274 6564 206f 6e20 4d6f .Converted on Mo │ │ │ -001bfdc0: 6e20 4d61 7220 3820 3230 3231 2031 333a n Mar 8 2021 13: │ │ │ -001bfdd0: 3036 3a32 3320 6279 203c 6120 7461 7267 06:23 by Doxygen │ │ │ -001bfe20: 2031 2e39 2e31 3c2f 736d 616c 6c3e 3c2f 1.9.1.
.. │ │ │ -001bfe70: 3c2f 626f 6479 3e0a 3c2f 6874 6d6c 3e0a .. │ │ │ +00101d70: 2020 2020 2020 2020 2020 2020 3c73 7061 // no other XM │ │ │ +00101da0: 4c20 6461 7461 203c 2f73 7061 6e3e 3c2f L data .
}
. │ │ │ +00101dd0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
else │ │ │ +00101e00: 3c2f 7370 616e 3e20 3c2f 6469 763e 0a3c
.< │ │ │ +00101e10: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +00101e20: 3e7b 3c2f 6469 763e 0a3c 6469 7620 636c >{
.
soap-> │ │ │ +00101e70: 3b3c 6120 636c 6173 733d 2263 6f64 6522 ;fault< │ │ │ +00101ec0: 2f61 3e2d 2667 743b 3c61 2063 6c61 7373 /a>->detail = soap_new_SOA │ │ │ +00101f40: 505f 454e 565f 5f44 6574 6169 6c28 3c61 P_ENV__Detail(soap, - │ │ │ +00101f80: 3129 3b20 3c2f 6469 763e 0a3c 6469 7620 1);
.
< │ │ │ +00101fa0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +00101fb0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ +00101fc0: 6874 6d6c 223e 736f 6170 3c2f 613e 2d26 html">soap-& │ │ │ +00101fd0: 6774 3b3c 6120 636c 6173 733d 2263 6f64 gt;faul │ │ │ +00102020: 743c 2f61 3e2d 2667 743b 3c61 2063 6c61 t->detail< │ │ │ +00102090: 2f61 3e2d 2667 743b 3c61 2063 6c61 7373 /a>->__type = SOAP_TYPE_n │ │ │ +00102110: 7331 5f5f 6d79 5374 6163 6b44 6174 6154 s1__myStackDataT │ │ │ +00102120: 7970 653b 203c 7370 616e 2063 6c61 7373 ype; // st │ │ │ +00102140: 6163 6b20 7479 7065 203c 2f73 7061 6e3e ack type │ │ │ +00102150: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
soap->< │ │ │ +001021a0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +001021b0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ +001021c0: 6874 6d6c 2361 3932 3065 3238 3430 6162 html#a920e2840ab │ │ │ +001021d0: 3263 3831 3633 3738 3035 3930 3232 6463 2c816378059022dc │ │ │ +001021e0: 6664 3936 6530 223e 6661 756c 743c 2f61 fd96e0">fault->detail- │ │ │ +00102260: 2667 743b 3c61 2063 6c61 7373 3d22 636f >fault = │ │ │ +001022d0: 7370 3b20 2020 2020 2020 2020 2020 2020 sp; │ │ │ +001022e0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ +001022f0: 203c 7370 616e 2063 6c61 7373 3d22 636f // point │ │ │ +00102310: 746f 2073 7461 636b 203c 2f73 7061 6e3e to stack │ │ │ +00102320: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
soap->< │ │ │ +00102370: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +00102380: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ +00102390: 6874 6d6c 2361 3932 3065 3238 3430 6162 html#a920e2840ab │ │ │ +001023a0: 3263 3831 3633 3738 3035 3930 3232 6463 2c816378059022dc │ │ │ +001023b0: 6664 3936 6530 223e 6661 756c 743c 2f61 fd96e0">fault->detail- │ │ │ +00102430: 2667 743b 3c61 2063 6c61 7373 3d22 636f >__any = │ │ │ +001024a0: 4e55 4c4c 3b20 2020 2020 2020 2020 2020 NULL; │ │ │ +001024b0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ +001024c0: 203c 7370 616e 2063 6c61 7373 3d22 636f // no oth │ │ │ +001024e0: 6572 2058 4d4c 2064 6174 6120 3c2f 7370 er XML data
.
} .
return < │ │ │ +00102550: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +00102560: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ +00102570: 705f 5f65 7272 6f72 732e 6874 6d6c 2367 p__errors.html#g │ │ │ +00102580: 6166 3237 6431 6631 3031 3330 6534 6461 af27d1f10130e4da │ │ │ +00102590: 3038 3039 3735 3731 3161 3731 3932 6630 080975711a7192f0 │ │ │ +001025a0: 3722 3e53 4f41 505f 4641 554c 543c 2f61 7">SOAP_FAULT; // retu │ │ │ +001025d0: 726e 2066 726f 6d20 7365 7276 6963 6520 rn from service │ │ │ +001025e0: 6f70 6572 6174 696f 6e20 6361 6c6c 2077 operation call w │ │ │ +001025f0: 6974 6820 7468 6520 6661 756c 743c 2f73 ith the fault
.
s │ │ │ +001026d0: 686f 7274 2076 6572 7369 6f6e 3c2f 6469 hort version
SOAP versio │ │ │ +00102700: 6e20 2830 203d 206e 6f20 534f 4150 2c20 n (0 = no SOAP, │ │ │ +00102710: 3120 3d20 534f 4150 2031 2e31 2c20 3220 1 = SOAP 1.1, 2 │ │ │ +00102720: 3d20 534f 4150 2031 2e32 293c 2f64 6976 = SOAP 1.2)
Definitio │ │ │ +00102750: 6e3a 3c2f 623e 2073 7464 736f 6170 322e n: stdsoap2. │ │ │ +00102760: 683a 3238 3531 3c2f 6469 763e 3c2f 6469 h:2851
.

Her │ │ │ +00102790: 652c 203c 636f 6465 3e3c 6120 636c 6173 e, soap_re │ │ │ +00102840: 6365 6976 6572 5f66 6175 6c74 3c2f 613e ceiver_fault │ │ │ +00102850: 3c2f 636f 6465 3e20 616c 6c6f 6361 7465 allocate │ │ │ +00102860: 7320 6120 6661 756c 7420 7374 7275 6374 s a fault struct │ │ │ +00102870: 2074 6865 6e20 7765 2073 6574 2074 6865 then we set the │ │ │ +00102880: 2053 4f41 5020 4661 756c 7420 6465 7461 SOAP Fault deta │ │ │ +00102890: 696c 7320 6173 2073 686f 776e 2e3c 2f70 ils as shown.

.

Note that S │ │ │ +001028b0: 4f41 5020 312e 3220 7375 7070 6f72 7473 OAP 1.2 supports │ │ │ +001028c0: 206e 6573 7465 6420 6661 756c 7420 7375 nested fault su │ │ │ +001028d0: 622d 636f 6465 732e 2054 6865 7365 2063 b-codes. These c │ │ │ +001028e0: 616e 2062 6520 7365 7420 6173 2066 6f6c an be set as fol │ │ │ +001028f0: 6c6f 7773 3a3c 2f70 3e0a 3c64 6976 2063 lows:

.
│ │ │ +00102910: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
struct < │ │ │ +00102940: 2f73 7061 6e3e 3c61 2063 6c61 7373 3d22 /span>SOAP_ENV__Code │ │ │ +00102990: 3c2f 613e 202a 7375 6263 6f64 6531 203d *subcode1 = │ │ │ +001029a0: 2073 6f61 705f 6e65 775f 534f 4150 5f45 soap_new_SOAP_E │ │ │ +001029b0: 4e56 5f5f 436f 6465 283c 6120 636c 6173 NV__Code( │ │ │ +001029e0: 736f 6170 3c2f 613e 293b 3c2f 6469 763e soap);
│ │ │ +001029f0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
struct │ │ │ +00102a20: 3c2f 7370 616e 3e3c 6120 636c 6173 733d SOAP_ENV__Cod │ │ │ +00102a70: 653c 2f61 3e20 2a73 7562 636f 6465 3220 e *subcode2 │ │ │ +00102a80: 3d20 736f 6170 5f6e 6577 5f53 4f41 505f = soap_new_SOAP_ │ │ │ +00102a90: 454e 565f 5f43 6f64 6528 3c61 2063 6c61 ENV__Code(soap);
.
soap_send │ │ │ +00102b40: 6572 5f66 6175 6c74 3c2f 613e 283c 6120 er_fault(soap, " │ │ │ +00102ba0: 5468 6520 7265 7175 6573 7465 6420 7072 The requested pr │ │ │ +00102bb0: 6f66 696c 6520 746f 6b65 6e20 5072 6f66 ofile token Prof │ │ │ +00102bc0: 696c 6554 6f6b 656e 2064 6f65 7320 6e6f ileToken does no │ │ │ +00102bd0: 7420 6578 6973 742e 2671 756f 743b 3c2f t exist.", NULL); .
subcode1- │ │ │ +00102c10: 2667 743b 3c61 2063 6c61 7373 3d22 636f >SOAP_ENV__Valu │ │ │ +00102c80: 653c 2f61 3e20 3d20 283c 7370 616e 2063 e = (char*) │ │ │ +00102cb0: 3c73 7061 6e20 636c 6173 733d 2273 7472 &quo │ │ │ +00102cd0: 743b 7465 723a 496e 7661 6c69 6441 7267 t;ter:InvalidArg │ │ │ +00102ce0: 7326 7175 6f74 3b3c 2f73 7061 6e3e 3b20 s"; │ │ │ +00102cf0: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // a QName │ │ │ +00102d10: 2076 616c 7565 3c2f 7370 616e 3e3c 2f64 value.
subcode1-& │ │ │ +00102d40: 6774 3b3c 6120 636c 6173 733d 2263 6f64 gt;SOAP_ENV__Subco │ │ │ +00102db0: 6465 3c2f 613e 203d 2073 7562 636f 6465 de = subcode │ │ │ +00102dc0: 323b 3c2f 6469 763e 0a3c 6469 7620 636c 2;
.
subco │ │ │ +00102de0: 6465 322d 2667 743b 3c61 2063 6c61 7373 de2->SOAP_ENV__ │ │ │ +00102e50: 5661 6c75 653c 2f61 3e20 3d20 283c 7370 Value = (char*) │ │ │ +00102ea0: 2671 756f 743b 7465 723a 4e6f 5072 6f66 "ter:NoProf │ │ │ +00102eb0: 696c 6526 7175 6f74 3b3c 2f73 7061 6e3e ile" │ │ │ +00102ec0: 3b20 3c73 7061 6e20 636c 6173 733d 2263 ; // a QNa │ │ │ +00102ee0: 6d65 2076 616c 7565 3c2f 7370 616e 3e3c me value< │ │ │ +00102ef0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
subcode2 │ │ │ +00102f10: 2d26 6774 3b3c 6120 636c 6173 733d 2263 ->SOAP_ENV__Sub │ │ │ +00102f80: 636f 6465 3c2f 613e 203d 204e 554c 4c3b code = NULL; │ │ │ +00102f90: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.. │ │ │ +00103130: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
retu │ │ │ +00103160: 726e 3c2f 7370 616e 3e20 3c61 2063 6c61 rn SO │ │ │ +001031c0: 4150 5f46 4155 4c54 3c2f 613e 3b3c 2f64 AP_FAULT;.

Th │ │ │ +001031f0: 6973 2070 726f 6475 6365 733a 3c2f 703e is produces:

│ │ │ +00103200: 0a3c 6469 7620 636c 6173 733d 2261 6c74 .
<< │ │ │ +00103240: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +00103250: 6f72 6474 7970 6522 3e53 4f41 502d 454e ordtype">SOAP-EN │ │ │ +00103260: 563a 4661 756c 743c 2f73 7061 6e3e 2667 V:Fault&g │ │ │ +00103270: 743b 3c2f 6469 763e 0a3c 6469 7620 636c t;
.
< │ │ │ +00103290: 3b3c 7370 616e 2063 6c61 7373 3d22 6b65 ;SOAP- │ │ │ +001032b0: 454e 563a 436f 6465 3c2f 7370 616e 3e26 ENV:Code& │ │ │ +001032c0: 6774 3b3c 2f64 6976 3e0a 3c64 6976 2063 gt;
.
│ │ │ +001032e0: 266c 743b 3c73 7061 6e20 636c 6173 733d <SO │ │ │ +00103300: 4150 2d45 4e56 3a56 616c 7565 3c2f 7370 AP-ENV:Value>SOA │ │ │ +00103330: 502d 454e 563a 5365 6e64 6572 3c2f 7370 P-ENV:Sender</SOAP-ENV:Value │ │ │ +00103370: 3c2f 7370 616e 3e26 6774 3b3c 2f64 6976 >
.
<SOAP-ENV:S │ │ │ +001033c0: 7562 636f 6465 3c2f 7370 616e 3e26 6774 ubcode> │ │ │ +001033d0: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
.
│ │ │ +001033f0: 266c 743b 3c73 7061 6e20 636c 6173 733d <SO │ │ │ +00103410: 4150 2d45 4e56 3a56 616c 7565 3c2f 7370 AP-ENV:Value>ter │ │ │ +00103440: 3a49 6e76 616c 6964 4172 6773 3c2f 7370 :InvalidArgs</SOAP-ENV:Value │ │ │ +00103480: 3c2f 7370 616e 3e26 6774 3b3c 2f64 6976 >
.
<SOAP-ENV │ │ │ +001034d0: 3a53 7562 636f 6465 3c2f 7370 616e 3e26 :Subcode& │ │ │ +001034e0: 6774 3b3c 2f64 6976 3e0a 3c64 6976 2063 gt;
.
│ │ │ +00103500: 2020 2020 266c 743b 3c73 7061 6e20 636c <SOAP-ENV:Value │ │ │ +00103530: 3c2f 7370 616e 3e26 6774 3b3c 7370 616e >ter:NoProfile </SOAP-ENV:Va │ │ │ +00103590: 6c75 653c 2f73 7061 6e3e 2667 743b 3c2f lue>.
< │ │ │ +001035c0: 3b2f 3c73 7061 6e20 636c 6173 733d 226b ;/SOAP │ │ │ +001035e0: 2d45 4e56 3a53 7562 636f 6465 3c2f 7370 -ENV:Subcode>
. │ │ │ +00103610: 2020 2020 266c 743b 2f3c 7370 616e 2063 </SOAP-ENV:Subc │ │ │ +00103640: 6f64 653c 2f73 7061 6e3e 2667 743b 3c2f ode>.
</SOAP-ENV │ │ │ +00103690: 3a43 6f64 653c 2f73 7061 6e3e 2667 743b :Code> │ │ │ +001036a0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
<< │ │ │ +001036c0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +001036d0: 6f72 6474 7970 6522 3e53 4f41 502d 454e ordtype">SOAP-EN │ │ │ +001036e0: 563a 5265 6173 6f6e 3c2f 7370 616e 3e26 V:Reason& │ │ │ +001036f0: 6774 3b3c 2f64 6976 3e0a 3c64 6976 2063 gt;
.
│ │ │ +00103710: 266c 743b 3c73 7061 6e20 636c 6173 733d <SO │ │ │ +00103730: 4150 2d45 4e56 3a54 6578 743c 2f73 7061 AP-ENV:Text xml:lan │ │ │ +00103760: 673c 2f73 7061 6e3e 3d3c 7370 616e 2063 g="en&qu │ │ │ +00103790: 6f74 3b3c 2f73 7061 6e3e 2667 743b 3c73 ot;>The < │ │ │ +001037c0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +001037d0: 6f72 6422 3e72 6571 7565 7374 6564 3c2f ord">requested prof │ │ │ +00103800: 696c 653c 2f73 7061 6e3e 203c 7370 616e ile token ProfileToken │ │ │ +00103850: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c do │ │ │ +00103870: 6573 3c2f 7370 616e 3e20 3c73 7061 6e20 es │ │ │ +00103890: 6e6f 743c 2f73 7061 6e3e 203c 7370 616e not exist.&l │ │ │ +001038c0: 743b 2f3c 7370 616e 2063 6c61 7373 3d22 t;/SOA │ │ │ +001038e0: 502d 454e 563a 5465 7874 3c2f 7370 616e P-ENV:Text>
.
│ │ │ +00103910: 266c 743b 2f3c 7370 616e 2063 6c61 7373 </S │ │ │ +00103930: 4f41 502d 454e 563a 5265 6173 6f6e 3c2f OAP-ENV:Reason>
. │ │ │ +00103950: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
</SOAP-ENV:Fault< │ │ │ +00103990: 2f73 7061 6e3e 2667 743b 3c2f 6469 763e /span>>
│ │ │ +001039a0: 0a3c 2f64 6976 3e3c 212d 2d20 6672 6167 .
< │ │ │ +001039c0: 703e 5365 7276 6963 6520 6f70 6572 6174 p>Service operat │ │ │ +001039d0: 696f 6e73 2069 6d70 6c65 6d65 6e74 6174 ions implementat │ │ │ +001039e0: 696f 6e20 696e 2061 2057 6562 2073 6572 ion in a Web ser │ │ │ +001039f0: 7669 6365 2061 7070 6c69 6361 7469 6f6e vice application │ │ │ +00103a00: 2063 616e 2072 6574 7572 6e20 7661 7269 can return vari │ │ │ +00103a10: 6f75 7320 534f 4150 2046 6175 6c74 7320 ous SOAP Faults │ │ │ +00103a20: 6375 7374 6f6d 697a 6564 2069 6e20 7468 customized in th │ │ │ +00103a30: 6973 2077 6179 2e3c 2f70 3e0a 3c70 3e53 is way.

.

S │ │ │ +00103a40: 4f41 5020 4661 756c 7420 7374 7275 6374 OAP Fault struct │ │ │ +00103a50: 7572 6573 2061 7265 2064 6563 6c61 7265 ures are declare │ │ │ +00103a60: 6420 3c63 6f64 653e 6d75 7461 626c 653c d mutable< │ │ │ +00103a70: 2f63 6f64 653e 2c20 7768 6963 6820 6d65 /code>, which me │ │ │ +00103a80: 616e 7320 7468 6174 2072 652d 6465 636c ans that re-decl │ │ │ +00103a90: 6172 6174 696f 6e73 206f 6620 7468 6520 arations of the │ │ │ +00103aa0: 7374 7275 6374 7572 6573 2061 7265 2070 structures are p │ │ │ +00103ab0: 6572 6d69 7474 6564 2061 6e64 2061 6464 ermitted and add │ │ │ +00103ac0: 6974 696f 6e61 6c20 6d65 6d62 6572 7320 itional members │ │ │ +00103ad0: 6172 6520 636f 6c6c 6563 7465 6420 696e are collected in │ │ │ +00103ae0: 746f 206f 6e65 2066 696e 616c 2073 7472 to one final str │ │ │ +00103af0: 7563 7475 7265 2062 7920 7468 6520 736f ucture by the so │ │ │ +00103b00: 6170 6370 7032 2074 6f6f 6c2e 3c2f 703e apcpp2 tool.

│ │ │ +00103b10: 0a3c 703e 466f 7220 616e 2065 7861 6d70 .

For an examp │ │ │ +00103b20: 6c65 2074 6861 7420 7573 6564 2074 6865 le that used the │ │ │ +00103b30: 2053 4f41 5020 4661 756c 7420 6465 7461 SOAP Fault deta │ │ │ +00103b40: 696c 2073 7472 7563 7475 7265 3a3c 2f70 il structure:

.
│ │ │ +00103b90: 7374 7275 6374 203c 2f73 7061 6e3e 3c61 struct SOAP │ │ │ +00103be0: 5f45 4e56 5f5f 4465 7461 696c 3c2f 613e _ENV__Detail │ │ │ +00103bf0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
{
.
co │ │ │ +00103c40: 6e73 743c 2f73 7061 6e3e 203c 7370 616e nst char │ │ │ +00103c70: 202a 665f 5f69 6e76 616c 6964 3b3c 2f64 *f__invalid;.
│ │ │ +00103cb0: 636f 6e73 743c 2f73 7061 6e3e 203c 7370 const char *f__unavailab │ │ │ +00103cf0: 6c65 3b3c 2f64 6976 3e0a 3c64 6976 2063 le;
.
│ │ │ +00103d10: 3c73 7061 6e20 636c 6173 733d 226b 6579 int __type; │ │ │ +00103da0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
void *fault;.
_X │ │ │ +00103ec0: 4d4c 3c2f 613e 203c 6120 636c 6173 733d ML __any │ │ │ +00103f30: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
.
}; .
//gs │ │ │ +00103f80: 6f61 7020 6e73 2073 6572 7669 6365 206d oap ns service m │ │ │ +00103f90: 6574 686f 642d 6661 756c 743a 206c 6f67 ethod-fault: log │ │ │ +00103fa0: 696e 2066 5f5f 696e 7661 6c69 6420 3c2f in f__invalid
.
//gsoap ns s │ │ │ +00103ff0: 6572 7669 6365 206d 6574 686f 642d 6661 ervice method-fa │ │ │ +00104000: 756c 743a 206c 6f67 696e 2066 5f5f 756e ult: login f__un │ │ │ +00104010: 6176 6169 6c61 626c 6520 3c2f 7370 616e available
.
int n │ │ │ +00104060: 735f 5f6c 6f67 696e 282e 2e2e 293b 3c2f s__login(...);.

S │ │ │ +00104090: 6565 2061 6c73 6f20 4150 4920 646f 6375 ee also API docu │ │ │ +001040a0: 6d65 6e74 6174 696f 6e20 4d6f 6475 6c65 mentation Module │ │ │ +001040b0: 203c 6120 636c 6173 733d 2265 6c22 2068 F │ │ │ +001040e0: 6175 6c74 2073 7472 7563 7475 7265 2061 ault structure a │ │ │ +001040f0: 6e64 2066 756e 6374 696f 6e73 3c2f 613e nd functions │ │ │ +00104100: 2e3c 2f70 3e0a 3c70 3ef0 9f94 9d20 3c61 .

.

.... Back t │ │ │ +00104120: 6f20 7461 626c 6520 6f66 2063 6f6e 7465 o table of conte │ │ │ +00104130: 6e74 733c 2f61 3e3c 2f70 3e0a 3c68 313e nts

.

│ │ │ +00104140: 3c61 2063 6c61 7373 3d22 616e 6368 6f72 │ │ │ +00104160: 0a4d 494d 4520 6174 7461 6368 6d65 6e74 .MIME attachment │ │ │ +00104170: 733c 2f68 313e 0a3c 703e 5468 6520 6753 s

.

The gS │ │ │ +00104180: 4f41 5020 746f 6f6c 6b69 7420 7375 7070 OAP toolkit supp │ │ │ +00104190: 6f72 7473 204d 494d 4520 6174 7461 6368 orts MIME attach │ │ │ +001041a0: 6d65 6e74 7320 6173 2070 6572 2053 4f41 ments as per SOA │ │ │ +001041b0: 5020 7769 7468 2041 7474 6163 686d 656e P with Attachmen │ │ │ +001041c0: 7473 2028 5377 4129 2073 7065 6369 6669 ts (SwA) specifi │ │ │ +001041d0: 6361 7469 6f6e 203c 6120 6872 6566 3d22 cation http://ww │ │ │ +00104210: 772e 7733 2e6f 7267 2f54 522f 534f 4150 w.w3.org/TR/SOAP │ │ │ +00104220: 2d61 7474 6163 686d 656e 7473 3c2f 613e -attachments │ │ │ +00104230: 2e3c 2f70 3e0a 3c70 3e4d 544f 4d20 6174 .

.

MTOM at │ │ │ +00104240: 7461 6368 6d65 6e74 7320 7468 6174 2061 tachments that a │ │ │ +00104250: 7265 2065 7373 656e 7469 616c 6c79 204d re essentially M │ │ │ +00104260: 494d 4520 6174 7461 6368 6d65 6e74 7320 IME attachments │ │ │ +00104270: 7468 6174 2063 6f6e 666f 726d 2074 6f20 that conform to │ │ │ +00104280: 7468 6520 4d54 4f4d 2073 7065 6369 6669 the MTOM specifi │ │ │ +00104290: 6361 7469 6f6e 203c 6120 6872 6566 3d22 cation http://www.w3. │ │ │ +001042d0: 6f72 672f 5452 2f73 6f61 7031 322d 6d74 org/TR/soap12-mt │ │ │ +001042e0: 6f6d 3c2f 613e 2061 7265 2061 6c73 6f20 om are also │ │ │ +001042f0: 7375 7070 6f72 7465 6420 7768 6963 6820 supported which │ │ │ +00104300: 6172 6520 7468 6520 7072 6566 6572 7265 are the preferre │ │ │ +00104310: 6420 7761 7920 746f 2069 6e63 6c75 6465 d way to include │ │ │ +00104320: 204d 494d 4520 6174 7461 6368 6d65 6e74 MIME attachment │ │ │ +00104330: 7320 7769 7468 2053 4f41 5020 6d65 7373 s with SOAP mess │ │ │ +00104340: 6167 6573 2c20 7365 6520 5365 6374 696f ages, see Sectio │ │ │ +00104350: 6e20 3c61 2063 6c61 7373 3d22 656c 2220 n MTOM atta │ │ │ +00104380: 6368 6d65 6e74 733c 2f61 3e2e 3c2f 703e chments.

│ │ │ +00104390: 0a3c 703e 496e 2074 6865 2066 6f6c 6c6f .

In the follo │ │ │ +001043a0: 7769 6e67 2064 6973 6375 7373 696f 6e2c wing discussion, │ │ │ +001043b0: 204d 494d 4520 6174 7461 6368 6d65 6e74 MIME attachment │ │ │ +001043c0: 2064 6174 6120 6973 2061 7373 756d 6564 data is assumed │ │ │ +001043d0: 2074 6f20 6265 2072 6573 6964 656e 7420 to be resident │ │ │ +001043e0: 696e 206d 656d 6f72 7920 666f 7220 7365 in memory for se │ │ │ +001043f0: 6e64 696e 6720 6f70 6572 6174 696f 6e73 nding operations │ │ │ +00104400: 2061 6e64 204d 494d 4520 6174 7461 6368 and MIME attach │ │ │ +00104410: 6d65 6e74 7320 7265 6365 6976 6564 2077 ments received w │ │ │ +00104420: 696c 6c20 6265 2073 746f 7265 6420 696e ill be stored in │ │ │ +00104430: 206d 656d 6f72 7920 6d61 6e61 6765 6420 memory managed │ │ │ +00104440: 6279 2074 6865 2063 6f6e 7465 7874 2e20 by the context. │ │ │ +00104450: 4d54 4f4d 2061 6e64 2044 494d 4520 6174 MTOM and DIME at │ │ │ +00104460: 7461 6368 6d65 6e74 7320 6f6e 2074 6865 tachments on the │ │ │ +00104470: 206f 7468 6572 2068 616e 6420 6361 6e20 other hand can │ │ │ +00104480: 6265 2073 7472 6561 6d65 6420 616e 6420 be streamed and │ │ │ +00104490: 7468 6572 6566 6f72 6520 4d54 4f4d 2f44 therefore MTOM/D │ │ │ +001044a0: 494d 4520 6174 7461 6368 6d65 6e74 2064 IME attachment d │ │ │ +001044b0: 6174 6120 646f 6573 206e 6f74 206e 6565 ata does not nee │ │ │ +001044c0: 6420 746f 2062 6520 7374 6f72 6564 2069 d to be stored i │ │ │ +001044d0: 6e20 6d65 6d6f 7279 2c20 7365 6520 5365 n memory, see Se │ │ │ +001044e0: 6374 696f 6e73 203c 6120 636c 6173 733d ctions DIME │ │ │ +00104510: 2061 7474 6163 686d 656e 7473 3c2f 613e attachments │ │ │ +00104520: 2061 6e64 203c 6120 636c 6173 733d 2265 and MTOM a │ │ │ +00104550: 7474 6163 686d 656e 7473 3c2f 613e 202e ttachments . │ │ │ +00104560: 3c2f 703e 0a3c 703e 5472 616e 736d 6974

.

Transmit │ │ │ +00104570: 7469 6e67 206d 756c 7469 7061 7274 2f72 ting multipart/r │ │ │ +00104580: 656c 6174 6564 204d 494d 4520 6174 7461 elated MIME atta │ │ │ +00104590: 6368 6d65 6e74 7320 7769 7468 2061 2053 chments with a S │ │ │ +001045a0: 4f41 502f 584d 4c20 6d65 7373 6167 6520 OAP/XML message │ │ │ +001045b0: 6973 2061 6363 6f6d 706c 6973 6865 6420 is accomplished │ │ │ +001045c0: 7769 7468 2074 776f 2066 756e 6374 696f with two functio │ │ │ +001045d0: 6e73 2c20 3c63 6f64 653e 3c61 2063 6c61 ns, soap_ │ │ │ +00104650: 7365 745f 6d69 6d65 3c2f 613e 3c2f 636f set_mime and soap_set_mi │ │ │ +00104700: 6d65 5f61 7474 6163 686d 656e 743c 2f61 me_attachment. The fi │ │ │ +00104720: 7273 7420 6675 6e63 7469 6f6e 2069 7320 rst function is │ │ │ +00104730: 666f 7220 696e 6974 6961 6c69 7a61 7469 for initializati │ │ │ +00104740: 6f6e 2070 7572 706f 7365 7320 616e 6420 on purposes and │ │ │ +00104750: 7468 6520 6c61 7474 6572 2066 756e 6374 the latter funct │ │ │ +00104760: 696f 6e20 6973 2075 7365 6420 746f 2073 ion is used to s │ │ │ +00104770: 7065 6369 6679 206d 6574 6120 6461 7461 pecify meta data │ │ │ +00104780: 2061 6e64 2063 6f6e 7465 6e74 2064 6174 and content dat │ │ │ +00104790: 6120 666f 7220 6561 6368 2061 7474 6163 a for each attac │ │ │ +001047a0: 686d 656e 742e 3c2f 703e 0a3c 703e 5365 hment.

.

Se │ │ │ +001047b0: 6520 616c 736f 2041 5049 2064 6f63 756d e also API docum │ │ │ +001047c0: 656e 7461 7469 6f6e 204d 6f64 756c 6520 entation Module │ │ │ +001047d0: 3c61 2063 6c61 7373 3d22 656c 2220 6872 MIM │ │ │ +00104800: 4520 6174 7461 6368 6d65 6e74 2066 756e E attachment fun │ │ │ +00104810: 6374 696f 6e73 3c2f 613e 2e3c 2f70 3e0a ctions.

. │ │ │ +00104820: 3c70 3ef0 9f94 9d20 3c61 2068 7265 663d

.... Back to tabl │ │ │ +00104840: 6520 6f66 2063 6f6e 7465 6e74 733c 2f61 e of contents

.

│ │ │ +00104880: 0a53 656e 6469 6e67 2061 2063 6f6c 6c65 .Sending a colle │ │ │ +00104890: 6374 696f 6e20 6f66 204d 494d 4520 6174 ction of MIME at │ │ │ +001048a0: 7461 6368 6d65 6e74 7320 2853 7741 293c tachments (SwA)< │ │ │ +001048b0: 2f68 323e 0a3c 703e 5468 6520 666f 6c6c /h2>.

The foll │ │ │ +001048c0: 6f77 696e 6720 6675 6e63 7469 6f6e 7320 owing functions │ │ │ +001048d0: 6172 6520 7573 6564 2074 6f20 7365 7420 are used to set │ │ │ +001048e0: 7570 2061 2063 6f6c 6c65 6374 696f 6e20 up a collection │ │ │ +001048f0: 6f66 206d 756c 7469 7061 7274 2f72 656c of multipart/rel │ │ │ +00104900: 6174 6564 204d 494d 4520 6174 7461 6368 ated MIME attach │ │ │ +00104910: 6d65 6e74 7320 666f 7220 7472 616e 736d ments for transm │ │ │ +00104920: 6973 7369 6f6e 2077 6974 6820 6120 534f ission with a SO │ │ │ +00104930: 4150 206f 7220 584d 4c20 6d65 7373 6167 AP or XML messag │ │ │ +00104940: 652e 3c2f 703e 0a3c 756c 3e0a 3c6c 693e e.

.
.

When p │ │ │ +00105740: 726f 7669 6469 6e67 2061 204d 494d 4520 roviding a MIME │ │ │ +00105750: 626f 756e 6461 7279 2077 6974 6820 3c63 boundary with soap_set_mi │ │ │ +001057e0: 6d65 3c2f 613e 3c2f 636f 6465 3e2c 2079 me, y │ │ │ +001057f0: 6f75 2068 6176 6520 746f 206d 616b 6520 ou have to make │ │ │ +00105800: 7375 7265 2074 6865 2062 6f75 6e64 6172 sure the boundar │ │ │ +00105810: 7920 6361 6e6e 6f74 206d 6174 6368 2061 y cannot match a │ │ │ +00105820: 6e79 2070 6172 7473 206f 6620 7468 6520 ny parts of the │ │ │ +00105830: 6d65 7373 6167 6520 616e 6420 6174 7461 message and atta │ │ │ +00105840: 6368 6d65 6e74 7320 7468 6174 2079 6f75 chments that you │ │ │ +00105850: 2061 7265 2073 656e 6469 6e67 2c20 6265 are sending, be │ │ │ +00105860: 6361 7573 6520 7468 6520 626f 756e 6461 cause the bounda │ │ │ +00105870: 7279 2064 656c 696e 6561 7465 7320 7468 ry delineates th │ │ │ +00105880: 6520 6174 7461 6368 6d65 6e74 732e 3c2f e attachments..

The intern │ │ │ +001058a0: 616c 206c 6973 7420 6f66 2061 7474 6163 al list of attac │ │ │ +001058b0: 686d 656e 7473 2073 7065 6369 6669 6564 hments specified │ │ │ +001058c0: 2077 6974 6820 3c63 6f64 653e 3c61 2063 with soap_set_mime │ │ │ +00105960: 5f61 7474 6163 686d 656e 743c 2f61 3e3c _attachment< │ │ │ +00105970: 2f63 6f64 653e 2069 7320 6465 7374 726f /code> is destro │ │ │ +00105980: 7965 6420 7769 7468 203c 636f 6465 3e3c yed with < │ │ │ +00105990: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ +001059a0: 663d 2267 726f 7570 5f5f 6772 6f75 705f f="group__group_ │ │ │ +001059b0: 5f63 6f6e 7465 7874 2e68 746d 6c23 6761 _context.html#ga │ │ │ +001059c0: 3831 6130 3039 6165 3165 6138 3235 6130 81a009ae1ea825a0 │ │ │ +001059d0: 3565 3532 3431 6532 6237 6138 6563 6539 5e5241e2b7a8ece9 │ │ │ +001059e0: 2220 7469 746c 653d 2244 656c 6574 6520 " title="Delete │ │ │ +001059f0: 616c 6c20 6461 7461 2066 726f 6d20 6865 all data from he │ │ │ +00105a00: 6170 206d 656d 6f72 7920 6d61 6e61 6765 ap memory manage │ │ │ +00105a10: 6420 6279 2074 6865 2073 7065 6369 6669 d by the specifi │ │ │ +00105a20: 6564 2073 6f61 7020 636f 6e74 6578 7420 ed soap context │ │ │ +00105a30: 616e 6420 7265 6c65 6173 6520 7468 6520 and release the │ │ │ +00105a40: 6672 6565 6420 6d65 6d6f 7279 2062 2e2e freed memory b.. │ │ │ +00105a50: 2e22 3e73 6f61 705f 656e 643c 2f61 3e3c .">soap_end< │ │ │ +00105a60: 2f63 6f64 653e 206f 7220 7768 656e 2061 /code> or when a │ │ │ +00105a70: 206d 6573 7361 6765 2069 7320 7265 6365 message is rece │ │ │ +00105a80: 6976 6564 2e20 5468 6572 6566 6f72 652c ived. Therefore, │ │ │ +00105a90: 2063 616c 6c20 3c63 6f64 653e 3c61 2063 call soap_set_mime │ │ │ +00105b30: 5f61 7474 6163 686d 656e 743c 2f61 3e3c _attachment< │ │ │ +00105b40: 2f63 6f64 653e 2074 6f20 7365 7420 6174 /code> to set at │ │ │ +00105b50: 7461 6368 6d65 6e74 7320 6265 666f 7265 tachments before │ │ │ +00105b60: 2073 656e 6469 6e67 2061 206d 6573 7361 sending a messa │ │ │ +00105b70: 6765 2e3c 2f70 3e0a 3c70 3e54 6865 2066 ge.

.

The f │ │ │ +00105b80: 6f6c 6c6f 7769 6e67 2065 7861 6d70 6c65 ollowing example │ │ │ +00105b90: 2073 686f 7773 2068 6f77 2061 206d 756c shows how a mul │ │ │ +00105ba0: 7469 7061 7274 2f72 656c 6174 6564 2048 tipart/related H │ │ │ +00105bb0: 5454 5020 6d65 7373 6167 6520 7769 7468 TTP message with │ │ │ +00105bc0: 2074 6872 6565 204d 494d 4520 6174 7461 three MIME atta │ │ │ +00105bd0: 6368 6d65 6e74 7320 6973 2073 6574 2075 chments is set u │ │ │ +00105be0: 7020 616e 6420 7472 616e 736d 6974 7465 p and transmitte │ │ │ +00105bf0: 6420 746f 2061 2073 6572 7665 722e 2049 d to a server. I │ │ │ +00105c00: 6e20 7468 6973 2065 7861 6d70 6c65 2077 n this example w │ │ │ +00105c10: 6520 6c65 7420 7468 6520 6d65 7373 6167 e let the messag │ │ │ +00105c20: 6520 626f 6479 2072 6566 6572 2074 6f20 e body refer to │ │ │ +00105c30: 7468 6520 6174 7461 6368 6d65 6e74 7320 the attachments │ │ │ +00105c40: 7573 696e 6720 584d 4c20 3c65 6d3e 3c63 using XML href< │ │ │ +00105c60: 2f65 6d3e 2061 7474 7269 6275 7465 732e /em> attributes. │ │ │ +00105c70: 2054 6865 203c 636f 6465 3e73 7472 7563 The struc │ │ │ +00105c80: 7420 636c 6169 6d5f 5f66 6f72 6d3c 2f63 t claim__form data type i │ │ │ +00105ca0: 6e63 6c75 6465 7320 6120 6465 6669 6e69 ncludes a defini │ │ │ +00105cb0: 7469 6f6e 206f 6620 6120 3c63 6f64 653e tion of a │ │ │ +00105cc0: 6872 6566 3c2f 636f 6465 3e20 6174 7472 href attr │ │ │ +00105cd0: 6962 7574 6520 666f 7220 7468 6973 2070 ibute for this p │ │ │ +00105ce0: 7572 706f 7365 2e3c 2f70 3e0a 3c64 6976 urpose.

.
struct │ │ │ +00105d30: 203c 2f73 7061 6e3e 636c 6169 6d5f 5f66 claim__f │ │ │ +00105d40: 6f72 6d20 666f 726d 312c 2066 6f72 6d32 orm form1, form2 │ │ │ +00105d50: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
form1 │ │ │ +00105d70: 2e68 7265 6620 3d20 3c73 7061 6e20 636c .href = "cid:cl │ │ │ +00105da0: 6169 6d30 3631 3430 3061 2e74 6966 6640 aim061400a.tiff@ │ │ │ +00105db0: 636c 6169 6d69 6e67 2d69 742e 636f 6d26 claiming-it.com& │ │ │ +00105dc0: 7175 6f74 3b3c 2f73 7061 6e3e 3b20 3c2f quot;; .
form2.hre │ │ │ +00105df0: 6620 3d20 3c73 7061 6e20 636c 6173 733d f = │ │ │ +00105e10: 2671 756f 743b 6369 643a 636c 6169 6d30 "cid:claim0 │ │ │ +00105e20: 3631 3430 3061 2e6a 7065 6740 636c 6169 61400a.jpeg@clai │ │ │ +00105e30: 6d69 6e67 2d69 742e 636f 6d26 7175 6f74 ming-it.com" │ │ │ +00105e40: 3b3c 2f73 7061 6e3e 3b20 3c2f 6469 763e ;;
│ │ │ +00105e50: 0a3c 6469 7620 636c 6173 733d 226c 696e .
/* init │ │ │ +00105e80: 6961 6c69 7a65 2061 6e64 2065 6e61 626c ialize and enabl │ │ │ +00105e90: 6520 4d49 4d45 202a 2f3c 2f73 7061 6e3e e MIME */ │ │ │ +00105ea0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
soap │ │ │ +00105f10: 5f73 6574 5f6d 696d 653c 2f61 3e28 3c61 _set_mime(soap, N │ │ │ +00105f50: 554c 4c2c 203c 7370 616e 2063 6c61 7373 ULL, "<claim │ │ │ +00105f80: 3036 3134 3030 612e 786d 6c40 636c 6169 061400a.xml@clai │ │ │ +00105f90: 6d69 6e67 2d69 742e 636f 6d26 6774 3b26 ming-it.com>& │ │ │ +00105fa0: 7175 6f74 3b3c 2f73 7061 6e3e 293b 203c quot;); < │ │ │ +00105fb0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
/* │ │ │ +00105fe0: 2061 6464 2061 2062 6173 6536 3420 656e add a base64 en │ │ │ +00105ff0: 636f 6465 6420 7469 6666 2069 6d61 6765 coded tiff image │ │ │ +00106000: 2028 7469 6666 496d 6167 6520 706f 696e (tiffImage poin │ │ │ +00106010: 7473 2074 6f20 6261 7365 3634 2064 6174 ts to base64 dat │ │ │ +00106020: 6129 202a 2f3c 2f73 7061 6e3e 203c 2f64 a) */ ..< │ │ │ +00106240: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ +00106250: 656e 7422 3e2f 2a20 6164 6420 6120 7261 ent">/* add a ra │ │ │ +00106260: 7720 6269 6e61 7279 206a 7065 6720 696d w binary jpeg im │ │ │ +00106270: 6167 6520 286a 7065 6749 6d61 6765 2070 age (jpegImage p │ │ │ +00106280: 6f69 6e74 7320 746f 2072 6177 2064 6174 oints to raw dat │ │ │ +00106290: 6129 202a 2f3c 2f73 7061 6e3e 203c 2f64 a) */ ..< │ │ │ +001064b0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ +001064c0: 656e 7422 3e2f 2a20 7365 6e64 2074 6865 ent">/* send the │ │ │ +001064d0: 2066 6f72 6d73 2061 7320 4d49 4d45 2061 forms as MIME a │ │ │ +001064e0: 7474 6163 686d 656e 7473 2077 6974 6820 ttachments with │ │ │ +001064f0: 7468 6973 2069 6e76 6f63 6174 696f 6e20 this invocation │ │ │ +00106500: 2a2f 3c2f 7370 616e 3e20 3c2f 6469 763e */
│ │ │ +00106510: 0a3c 6469 7620 636c 6173 733d 226c 696e ..
.. │ │ │ +001065d0: 2e20 3c73 7061 6e20 636c 6173 733d 2263 . // an er │ │ │ +001065f0: 726f 7220 6f63 6375 7272 6564 203c 2f73 ror occurred
.
else
.
.. │ │ │ +00106660: 2e20 3c73 7061 6e20 636c 6173 733d 2263 . // proce │ │ │ +00106680: 7373 2074 6865 2072 6573 706f 6e73 653c ss the response< │ │ │ +00106690: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
.< │ │ │ +001066b0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +001066c0: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ +001066d0: 705f 5f6d 696d 652e 6874 6d6c 2367 6138 p__mime.html#ga8 │ │ │ +001066e0: 3163 6564 6232 3436 3730 6562 6461 3438 1cedb24670ebda48 │ │ │ +001066f0: 6137 3936 3739 6434 3638 3232 3131 6622 a79679d4682211f" │ │ │ +00106700: 3e73 6f61 705f 636c 725f 6d69 6d65 3c2f >soap_clr_mime(soap);
.
int │ │ │ +00106830: 736f 6170 5f73 6574 5f6d 696d 655f 6174 soap_set_mime_at │ │ │ +00106840: 7461 6368 6d65 6e74 2873 7472 7563 7420 tachment(struct │ │ │ +00106850: 736f 6170 202a 736f 6170 2c20 636f 6e73 soap *soap, cons │ │ │ +00106860: 7420 6368 6172 202a 7074 722c 2073 697a t char *ptr, siz │ │ │ +00106870: 655f 7420 7369 7a65 2c20 656e 756d 2073 e_t size, enum s │ │ │ +00106880: 6f61 705f 6d69 6d65 5f65 6e63 6f64 696e oap_mime_encodin │ │ │ +00106890: 6720 656e 636f 6469 6e67 2c20 636f 6e73 g encoding, cons │ │ │ +001068a0: 7420 6368 6172 202a 7479 7065 2c20 636f t char *type, co │ │ │ +001068b0: 6e73 7420 6368 6172 202a 6964 2c20 636f nst char *id, co │ │ │ +001068c0: 6e73 7420 6368 6172 202a 6c6f 6361 7469 nst char *locati │ │ │ +001068d0: 6f6e 2c20 636f 6e73 7420 6368 6172 202a on, const char * │ │ │ +001068e0: 6465 7363 7269 7074 696f 6e29 3c2f 6469 description)
Add a MIME │ │ │ +00106910: 6174 7461 6368 6d65 6e74 2074 6f20 7468 attachment to th │ │ │ +00106920: 6520 534f 4150 2f58 4d4c 206d 6573 7361 e SOAP/XML messa │ │ │ +00106930: 6765 2e3c 2f64 6976 3e3c 2f64 6976 3e0a ge.
. │ │ │ +00106940: 3c64 6976 2063 6c61 7373 3d22 7474 6322
soap_ │ │ │ +001069f0: 636c 725f 6d69 6d65 3c2f 613e 3c2f 6469 clr_mime
void soap_ │ │ │ +00106a20: 636c 725f 6d69 6d65 2873 7472 7563 7420 clr_mime(struct │ │ │ +00106a30: 736f 6170 202a 736f 6170 293c 2f64 6976 soap *soap)
Disable MIME │ │ │ +00106a60: 2061 7474 6163 686d 656e 7473 2e3c 2f64 attachments.
.
│ │ │ +00106ae0: 3c61 2068 7265 663d 2267 726f 7570 5f5f soap_set_mi │ │ │ +00106b30: 6d65 3c2f 613e 3c2f 6469 763e 3c64 6976 me
│ │ │ +00106b50: 696e 7420 736f 6170 5f73 6574 5f6d 696d int soap_set_mim │ │ │ +00106b60: 6528 7374 7275 6374 2073 6f61 7020 2a73 e(struct soap *s │ │ │ +00106b70: 6f61 702c 2063 6f6e 7374 2063 6861 7220 oap, const char │ │ │ +00106b80: 2a62 6f75 6e64 6172 792c 2063 6f6e 7374 *boundary, const │ │ │ +00106b90: 2063 6861 7220 2a73 7461 7274 293c 2f64 char *start)
Enable MIM │ │ │ +00106bc0: 4520 6174 7461 6368 6d65 6e74 732e 3c2f E attachments.
.
< │ │ │ +00106c50: 6469 7620 636c 6173 733d 2274 746e 616d div class="ttnam │ │ │ +00106c60: 6522 3e3c 6120 6872 6566 3d22 6772 6f75 e">SOAP_M │ │ │ +00106cd0: 494d 455f 4241 5345 3634 3c2f 613e 3c2f IME_BASE64
@ SOAP_M │ │ │ +00106d00: 494d 455f 4241 5345 3634 3c2f 6469 763e IME_BASE64
│ │ │ +00106d10: 3c64 6976 2063 6c61 7373 3d22 7474 646f
data is forma │ │ │ +00106d30: 7474 6564 2069 6e20 6261 7365 3634 3c2f tted in base64
Defini │ │ │ +00106d60: 7469 6f6e 3a3c 2f62 3e20 7374 6473 6f61 tion: stdsoa │ │ │ +00106d70: 7032 2e68 3a31 3032 3239 3c2f 6469 763e p2.h:10229
│ │ │ +00106d80: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
< │ │ │ +00106e10: 6120 6872 6566 3d22 6772 6f75 705f 5f67 a href="group__g │ │ │ +00106e20: 726f 7570 5f5f 6d69 6d65 2e68 746d 6c23 roup__mime.html# │ │ │ +00106e30: 6767 6133 6665 6337 3633 3364 6130 3762 gga3fec7633da07b │ │ │ +00106e40: 6666 3262 6635 6664 3633 3330 6265 6631 ff2bf5fd6330bef1 │ │ │ +00106e50: 3834 3461 3938 3066 3039 3335 3939 6463 844a980f093599dc │ │ │ +00106e60: 3239 3736 3766 6364 6330 6439 3037 3233 29767fcdc0d90723 │ │ │ +00106e70: 6464 6131 223e 534f 4150 5f4d 494d 455f dda1">SOAP_MIME_ │ │ │ +00106e80: 4249 4e41 5259 3c2f 613e 3c2f 6469 763e BINARY
│ │ │ +00106e90: 3c64 6976 2063 6c61 7373 3d22 7474 6465
@ SOAP_MIME_ │ │ │ +00106eb0: 4249 4e41 5259 3c2f 6469 763e 3c64 6976 BINARY
b │ │ │ +00106ed0: 696e 6172 7920 7261 7720 6461 7461 2063 inary raw data c │ │ │ +00106ee0: 6f6e 7465 6e74 3c2f 6469 763e 3c64 6976 ontent
< │ │ │ +00106f00: 623e 4465 6669 6e69 7469 6f6e 3a3c 2f62 b>Definition: stdsoap2.h:102 │ │ │ +00106f20: 3237 3c2f 6469 763e 3c2f 6469 763e 0a3c 27
.< │ │ │ +00106f30: 2f64 6976 3e3c 212d 2d20 6672 6167 6d65 /div>

The claim__form struct is │ │ │ +00106f70: 6465 636c 6172 6564 2069 6e20 7468 6520 declared in the │ │ │ +00106f80: 696e 7465 7266 6163 6520 6865 6164 6572 interface header │ │ │ +00106f90: 2066 696c 6520 6173 3a3c 2f70 3e0a 3c64 file as:

.
stru │ │ │ +00106fe0: 6374 203c 2f73 7061 6e3e 636c 6169 6d5f ct claim_ │ │ │ +00106ff0: 5f66 6f72 6d20 3c2f 6469 763e 0a3c 6469 _form
.{ │ │ │ +00107010: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
@ char *href;
│ │ │ +00107060: 0a3c 6469 7620 636c 6173 733d 226c 696e .
};
.

The claim │ │ │ +001070a0: 666f 726d 7320 696e 2074 6865 206d 6573 forms in the mes │ │ │ +001070b0: 7361 6765 2063 6f6e 7369 7374 206f 6620 sage consist of │ │ │ +001070c0: 3c65 6d3e 3c63 6f64 653e 6872 6566 3c2f hrefs to t │ │ │ +001070e0: 6865 2063 6c61 696d 2066 6f72 6d73 2061 he claim forms a │ │ │ +001070f0: 7474 6163 6865 642e 2054 6865 2075 7365 ttached. The use │ │ │ +00107100: 206f 6620 3c65 6d3e 3c63 6f64 653e 6872 of hr │ │ │ +00107110: 6566 3c2f 636f 6465 3e3c 2f65 6d3e 206f ef o │ │ │ +00107120: 7220 6f74 6865 7220 6174 7472 6962 7574 r other attribut │ │ │ +00107130: 6573 2066 6f72 2072 6566 6572 7269 6e67 es for referring │ │ │ +00107140: 2074 6f20 7468 6520 4d49 4d45 2061 7474 to the MIME att │ │ │ +00107150: 6163 686d 656e 7473 2069 7320 6f70 7469 achments is opti │ │ │ +00107160: 6f6e 616c 2061 6363 6f72 6469 6e67 2074 onal according t │ │ │ +00107170: 6f20 7468 6520 5377 4120 7374 616e 6461 o the SwA standa │ │ │ +00107180: 7264 2e20 4d54 4f4d 206f 6e20 7468 6520 rd. MTOM on the │ │ │ +00107190: 6f74 6865 7220 6861 6e64 206d 616e 6461 other hand manda │ │ │ +001071a0: 7465 7320 7468 6520 7573 6520 6f66 203c tes the use of < │ │ │ +001071b0: 656d 3e3c 636f 6465 3e68 7265 663c 2f63 em>href with X │ │ │ +001071d0: 4f50 2065 6c65 6d65 6e74 732e 3c2f 703e OP elements.

│ │ │ +001071e0: 0a3c 703e 546f 2061 7373 6f63 6961 7465 .

To associate │ │ │ +001071f0: 204d 494d 4520 6174 7461 6368 6d65 6e74 MIME attachment │ │ │ +00107200: 7320 7769 7468 2074 6865 2072 6571 7565 s with the reque │ │ │ +00107210: 7374 2061 6e64 2072 6573 706f 6e73 6520 st and response │ │ │ +00107220: 6f66 2061 2073 6572 7669 6365 206f 7065 of a service ope │ │ │ +00107230: 7261 7469 6f6e 2069 6e20 7468 6520 6765 ration in the ge │ │ │ +00107240: 6e65 7261 7465 6420 5753 444c 2c20 706c nerated WSDL, pl │ │ │ +00107250: 6561 7365 2073 6565 2053 6563 7469 6f6e ease see Section │ │ │ +00107260: 203c 6120 636c 6173 733d 2265 6c22 2068 Genera │ │ │ +00107290: 7469 6e67 204d 756c 7469 7061 7274 5265 ting MultipartRe │ │ │ +001072a0: 6c61 7465 6420 4d49 4d45 2061 7474 6163 lated MIME attac │ │ │ +001072b0: 686d 656e 7420 6269 6e64 696e 6773 2069 hment bindings i │ │ │ +001072c0: 6e20 5753 444c 3c2f 613e 202e 3c2f 703e n WSDL .

│ │ │ +001072d0: 0a3c 703e 5468 6520 7365 7276 6572 2d73 .

The server-s │ │ │ +001072e0: 6964 6520 636f 6465 2074 6f20 7472 616e ide code to tran │ │ │ +001072f0: 736d 6974 204d 494d 4520 6174 7461 6368 smit MIME attach │ │ │ +00107300: 6d65 6e74 7320 6261 636b 2074 6f20 6120 ments back to a │ │ │ +00107310: 636c 6965 6e74 3a3c 2f70 3e0a 3c64 6976 client:

.
in │ │ │ +00107360: 743c 2f73 7061 6e3e 2063 6c61 696d 5f5f t claim__ │ │ │ +00107370: 696e 7375 7261 6e63 655f 636c 6169 6d5f insurance_claim_ │ │ │ +00107380: 6175 746f 283c 7370 616e 2063 6c61 7373 auto(struc │ │ │ +001073a0: 743c 2f73 7061 6e3e 203c 6120 636c 6173 t │ │ │ +001073d0: 736f 6170 3c2f 613e 202a 3c61 2063 6c61 soap *soap, ...) │ │ │ +00107410: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
{
│ │ │ +00107430: 0a3c 6469 7620 636c 6173 733d 226c 696e .
const │ │ │ +00107460: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c char *h │ │ │ +00107490: 746d 6c44 6f63 203d 202e 2e2e 3b20 3c73 tmlDoc = ...; // an HTML m │ │ │ +001074c0: 6573 7361 6765 2074 6f20 7365 6e64 2061 essage to send a │ │ │ +001074d0: 7320 616e 2061 7474 6163 686d 656e 743c s an attachment< │ │ │ +001074e0: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
. │ │ │ +00107500: 203c 6120 636c 6173 733d 2263 6f64 6522 soap_set_mime │ │ │ +00107560: 3c2f 613e 283c 6120 636c 6173 733d 2263 (soap │ │ │ +00107590: 3c2f 613e 2c20 4e55 4c4c 2c20 4e55 4c4c , NULL, NULL │ │ │ +001075a0: 293b 203c 7370 616e 2063 6c61 7373 3d22 ); // enab │ │ │ +001075c0: 6c65 204d 494d 453c 2f73 7061 6e3e 3c2f le MIME.
/ │ │ │ +00107600: 2f20 6164 6420 6120 4854 4d4c 2064 6f63 / add a HTML doc │ │ │ +00107610: 756d 656e 7420 2868 746d 6c44 6f63 2070 ument (htmlDoc p │ │ │ +00107620: 6f69 6e74 7320 746f 2064 6174 612c 2077 oints to data, w │ │ │ +00107630: 6865 7265 2074 6865 2048 544d 4c20 646f here the HTML do │ │ │ +00107640: 6320 6973 2073 746f 7265 6420 696e 2063 c is stored in c │ │ │ +00107650: 6f6d 706c 6961 6e63 6520 7769 7468 2037 ompliance with 7 │ │ │ +00107660: 6269 7420 656e 636f 6469 6e67 2052 4643 bit encoding RFC │ │ │ +00107670: 3230 3435 2920 3c2f 7370 616e 3e3c 2f64 2045) .
if (s │ │ │ +00107710: 6f61 705f 7365 745f 6d69 6d65 5f61 7474 oap_set_mime_att │ │ │ +00107720: 6163 686d 656e 743c 2f61 3e28 3c61 2063 achment(soap, htm │ │ │ +00107760: 6c44 6f63 2c20 7374 726c 656e 2868 746d lDoc, strlen(htm │ │ │ +00107770: 6c44 6f63 292c 203c 6120 636c 6173 733d lDoc), SOAP_ │ │ │ +001077f0: 4d49 4d45 5f37 4249 543c 2f61 3e2c 203c MIME_7BIT, < │ │ │ +00107800: 7370 616e 2063 6c61 7373 3d22 7374 7269 span class="stri │ │ │ +00107810: 6e67 6c69 7465 7261 6c22 3e26 7175 6f74 ngliteral">" │ │ │ +00107820: 3b74 6578 742f 6874 6d6c 2671 756f 743b ;text/html" │ │ │ +00107830: 3c2f 7370 616e 3e2c 203c 7370 616e 2063 , "<c │ │ │ +00107860: 6c61 696d 3036 3134 3030 612e 6874 6d6c laim061400a.html │ │ │ +00107870: 4063 6c61 696d 696e 672d 6974 2e63 6f6d @claiming-it.com │ │ │ +00107880: 2667 743b 2671 756f 743b 3c2f 7370 616e >", NULL, NULL)) │ │ │ +001078a0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
{.
soap_ │ │ │ +00107930: 636c 725f 6d69 6d65 3c2f 613e 283c 6120 clr_mime(soap); < │ │ │ +00107970: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ +00107980: 656e 7422 3e2f 2f20 646f 6e26 2333 393b ent">// don' │ │ │ +00107990: 7420 7761 6e74 2066 6175 6c74 2077 6974 t want fault wit │ │ │ +001079a0: 6820 6174 7461 6368 6d65 6e74 7320 3c2f h attachments
.
│ │ │ +001079d0: 2020 3c73 7061 6e20 636c 6173 733d 226b retu │ │ │ +001079f0: 726e 3c2f 7370 616e 3e20 3c61 2063 6c61 rn soap->error │ │ │ +00107a80: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
} < │ │ │ +00107aa0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
return SOAP_OK;
.
}.
@ │ │ │ +00107c80: 2053 4f41 505f 4d49 4d45 5f37 4249 543c SOAP_MIME_7BIT< │ │ │ +00107c90: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
7 bit da │ │ │ +00107cb0: 7461 2063 6f6e 7465 6e74 3c2f 6469 763e ta content
│ │ │ +00107cc0: 3c64 6976 2063 6c61 7373 3d22 7474 6465
Definition │ │ │ +00107ce0: 3a3c 2f62 3e20 7374 6473 6f61 7032 2e68 : stdsoap2.h │ │ │ +00107cf0: 3a31 3032 3235 3c2f 6469 763e 3c2f 6469 :10225
.

... │ │ │ +00107d20: 9d20 3c61 2068 7265 663d 2223 223e 4261 . Ba │ │ │ +00107d30: 636b 2074 6f20 7461 626c 6520 6f66 2063 ck to table of c │ │ │ +00107d40: 6f6e 7465 6e74 733c 2f61 3e3c 2f70 3e0a ontents

. │ │ │ +00107d50: 3c68 323e 3c61 2063 6c61 7373 3d22 616e

.Ret │ │ │ +00107d80: 7269 6576 696e 6720 6120 636f 6c6c 6563 rieving a collec │ │ │ +00107d90: 7469 6f6e 206f 6620 4d49 4d45 2f4d 544f tion of MIME/MTO │ │ │ +00107da0: 4d20 6174 7461 6368 6d65 6e74 7320 2853 M attachments (S │ │ │ +00107db0: 7741 293c 2f68 323e 0a3c 703e 4d49 4d45 wA)

.

MIME │ │ │ +00107dc0: 2061 7474 6163 686d 656e 7473 2061 7265 attachments are │ │ │ +00107dd0: 2061 7574 6f6d 6174 6963 616c 6c79 2070 automatically p │ │ │ +00107de0: 6172 7365 6420 616e 6420 7374 6f72 6564 arsed and stored │ │ │ +00107df0: 2069 6e20 6d65 6d6f 7279 206d 616e 6167 in memory manag │ │ │ +00107e00: 6564 2062 7920 7468 6520 3c63 6f64 653e ed by the │ │ │ +00107e10: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap │ │ │ +00107e60: 3c2f 613e 3c2f 636f 6465 3e20 636f 6e74 cont │ │ │ +00107e70: 6578 742e 2041 6674 6572 2072 6563 6569 ext. After recei │ │ │ +00107e80: 7669 6e67 2061 2073 6574 206f 6620 4d49 ving a set of MI │ │ │ +00107e90: 4d45 2f4d 544f 4d20 6174 7461 6368 6d65 ME/MTOM attachme │ │ │ +00107ea0: 6e74 732c 2065 6974 6865 7220 6174 2074 nts, either at t │ │ │ +00107eb0: 6865 2063 6c69 656e 742d 7369 6465 206f he client-side o │ │ │ +00107ec0: 7220 7468 6520 7365 7276 6572 2d73 6964 r the server-sid │ │ │ +00107ed0: 652c 2074 6865 206c 6973 7420 6f66 204d e, the list of M │ │ │ +00107ee0: 494d 452f 4d54 4f4d 2061 7474 6163 686d IME/MTOM attachm │ │ │ +00107ef0: 656e 7473 2063 616e 2062 6520 7472 6176 ents can be trav │ │ │ +00107f00: 6572 7365 6420 746f 2065 7874 7261 6374 ersed to extract │ │ │ +00107f10: 206d 6574 6120 6461 7461 2061 6e64 2074 meta data and t │ │ │ +00107f20: 6865 2061 7474 6163 686d 656e 7420 636f he attachment co │ │ │ +00107f30: 6e74 656e 742e 2054 6865 2066 6972 7374 ntent. The first │ │ │ +00107f40: 2061 7474 6163 686d 656e 7420 696e 2074 attachment in t │ │ │ +00107f50: 6865 2063 6f6c 6c65 6374 696f 6e20 6f66 he collection of │ │ │ +00107f60: 204d 494d 452f 4d54 4f4d 2061 7474 6163 MIME/MTOM attac │ │ │ +00107f70: 686d 656e 7473 2061 6c77 6179 7320 636f hments always co │ │ │ +00107f80: 6e74 6169 6e73 206d 6574 6120 6461 7461 ntains meta data │ │ │ +00107f90: 2061 626f 7574 2074 6865 2053 4f41 5020 about the SOAP │ │ │ +00107fa0: 6d65 7373 6167 6520 6974 7365 6c66 2028 message itself ( │ │ │ +00107fb0: 6265 6361 7573 6520 7468 6520 534f 4150 because the SOAP │ │ │ +00107fc0: 206d 6573 7361 6765 2077 6173 2070 726f message was pro │ │ │ +00107fd0: 6365 7373 6564 2074 6865 2061 7474 6163 cessed the attac │ │ │ +00107fe0: 686d 656e 7420 646f 6573 206e 6f74 2063 hment does not c │ │ │ +00107ff0: 6f6e 7461 696e 2061 6e79 2075 7365 6675 ontain any usefu │ │ │ +00108000: 6c20 6461 7461 292e 3c2f 703e 0a3c 703e l data).

.

│ │ │ +00108010: 546f 2074 7261 7665 7273 6520 7468 6520 To traverse the │ │ │ +00108020: 6c69 7374 206f 6620 4d49 4d45 2061 7474 list of MIME att │ │ │ +00108030: 6163 686d 656e 7473 2069 6e20 432c 2079 achments in C, y │ │ │ +00108040: 6f75 2075 7365 2061 206c 6f6f 7020 7369 ou use a loop si │ │ │ +00108050: 6d69 6c61 7220 746f 3a3c 2f70 3e0a 3c64 milar to:

.
│ │ │ +001080a0: 696e 743c 2f73 7061 6e3e 206e 203d 2030 int n = 0 │ │ │ +001080b0: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
.
│ │ │ +001080e0: 7374 7275 6374 203c 2f73 7061 6e3e 3c61 struct │ │ │ +00108120: 736f 6170 5f6d 756c 7469 7061 7274 3c2f soap_multipart *attachment;< │ │ │ +00108140: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
for (at │ │ │ +00108180: 7461 6368 6d65 6e74 203d 203c 6120 636c tachment = soap->< │ │ │ +001081c0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +001081d0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ +001081e0: 6874 6d6c 2361 6632 6634 6462 6436 6637 html#af2f4dbd6f7 │ │ │ +001081f0: 3366 3139 6631 6265 6561 6133 6137 6539 3f19f1beeaa3a7e9 │ │ │ +00108200: 6439 6363 3263 223e 6d69 6d65 3c2f 613e d9cc2c">mime │ │ │ +00108210: 2e3c 6120 636c 6173 733d 2263 6f64 6522 . │ │ │ +00108260: 6c69 7374 3c2f 613e 3b20 6174 7461 6368 list; attach │ │ │ +00108270: 6d65 6e74 3b20 6174 7461 6368 6d65 6e74 ment; attachment │ │ │ +00108280: 203d 2061 7474 6163 686d 656e 742d 2667 = attachment-&g │ │ │ +00108290: 743b 3c61 2063 6c61 7373 3d22 636f 6465 t;next)< │ │ │ +001082f0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
{
. │ │ │ +00108310: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
++n;
.< │ │ │ +00108330: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +00108340: 3e20 2070 7269 6e74 6628 3c73 7061 6e20 > printf("Part │ │ │ +00108370: 2025 643a 5c6e 2671 756f 743b 3c2f 7370 %d:\n", n);
.< │ │ │ +00108390: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +001083a0: 3e20 2070 7269 6e74 6628 3c73 7061 6e20 > printf("ptr │ │ │ +001083d0: 2020 2020 2020 203d 2570 5c6e 2671 756f =%p\n&quo │ │ │ +001083e0: 743b 3c2f 7370 616e 3e2c 2061 7474 6163 t;, attac │ │ │ +001083f0: 686d 656e 742d 2667 743b 3c61 2063 6c61 hment->pt │ │ │ +00108450: 723c 2f61 3e29 3b3c 2f64 6976 3e0a 3c64 r);
. │ │ │ +00108470: 2020 7072 696e 7466 283c 7370 616e 2063 printf("size │ │ │ +001084a0: 2020 2020 2020 3d25 756c 5c6e 2671 756f =%ul\n&quo │ │ │ +001084b0: 743b 3c2f 7370 616e 3e2c 2061 7474 6163 t;, attac │ │ │ +001084c0: 686d 656e 742d 2667 743b 3c61 2063 6c61 hment->si │ │ │ +00108520: 7a65 3c2f 613e 293b 3c2f 6469 763e 0a3c ze);
.< │ │ │ +00108530: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +00108540: 3e20 2070 7269 6e74 6628 3c73 7061 6e20 > printf("id │ │ │ +00108570: 2020 2020 2020 203d 2573 5c6e 2671 756f =%s\n&quo │ │ │ +00108580: 743b 3c2f 7370 616e 3e2c 2061 7474 6163 t;, attac │ │ │ +00108590: 686d 656e 742d 2667 743b 3c61 2063 6c61 hment->id │ │ │ +001085f0: 3c2f 613e 203f 2061 7474 6163 686d 656e ? attachmen │ │ │ +00108600: 742d 2667 743b 3c61 2063 6c61 7373 3d22 t->id │ │ │ +00108660: 203a 203c 7370 616e 2063 6c61 7373 3d22 : & │ │ │ +00108680: 7175 6f74 3b26 7175 6f74 3b3c 2f73 7061 quot;");
.
p │ │ │ +001086b0: 7269 6e74 6628 3c73 7061 6e20 636c 6173 rintf("type │ │ │ +001086e0: 2020 203d 2573 5c6e 2671 756f 743b 3c2f =%s\n", attachmen │ │ │ +00108700: 742d 2667 743b 3c61 2063 6c61 7373 3d22 t->type ? attachment- │ │ │ +00108770: 2667 743b 3c61 2063 6c61 7373 3d22 636f >type │ │ │ +001087d0: 203a 203c 7370 616e 2063 6c61 7373 3d22 : & │ │ │ +001087f0: 7175 6f74 3b26 7175 6f74 3b3c 2f73 7061 quot;");
.
p │ │ │ +00108820: 7269 6e74 6628 3c73 7061 6e20 636c 6173 rintf("location │ │ │ +00108850: 2020 203d 2573 5c6e 2671 756f 743b 3c2f =%s\n", attachmen │ │ │ +00108870: 742d 2667 743b 3c61 2063 6c61 7373 3d22 t->locati │ │ │ +001088d0: 6f6e 3c2f 613e 203f 2061 7474 6163 686d on ? attachm │ │ │ +001088e0: 656e 742d 2667 743b 3c61 2063 6c61 7373 ent->loca │ │ │ +00108940: 7469 6f6e 3c2f 613e 203a 203c 7370 616e tion : "&qu │ │ │ +00108970: 6f74 3b3c 2f73 7061 6e3e 293b 3c2f 6469 ot;);.
printf(" │ │ │ +001089c0: 6465 7363 7269 7074 696f 6e3d 2573 5c6e description=%s\n │ │ │ +001089d0: 2671 756f 743b 3c2f 7370 616e 3e2c 2061 ", a │ │ │ +001089e0: 7474 6163 686d 656e 742d 2667 743b 3c61 ttachment->description ? attachment-& │ │ │ +00108a60: 6774 3b3c 6120 636c 6173 733d 2263 6f64 gt;descripti │ │ │ +00108ac0: 6f6e 3c2f 613e 203a 203c 7370 616e 2063 on : "" │ │ │ +00108af0: 3b3c 2f73 7061 6e3e 293b 3c2f 6469 763e ;);
│ │ │ +00108b00: 0a3c 6469 7620 636c 6173 733d 226c 696e .
}
..< │ │ │ +00108d10: 6469 7620 636c 6173 733d 2274 7464 6f63 div class="ttdoc │ │ │ +00108d20: 223e 4449 4d45 2f4d 494d 452f 4d54 4f4d ">DIME/MIME/MTOM │ │ │ +00108d30: 2061 7474 6163 686d 656e 7420 6461 7461 attachment data │ │ │ +00108d40: 2072 6563 6569 7665 6420 6279 2074 6865 received by the │ │ │ +00108d50: 2065 6e67 696e 652e 3c2f 6469 763e 3c64 engine.
Definition:< │ │ │ +00108d80: 2f62 3e20 7374 6473 6f61 7032 2e68 3a31 /b> stdsoap2.h:1 │ │ │ +00108d90: 3034 3330 3c2f 6469 763e 3c2f 6469 763e 0430
│ │ │ +00108da0: 0a3c 6469 7620 636c 6173 733d 2274 7463 .
DIME │ │ │ +00108eb0: 2f4d 494d 452f 4d54 4f4d 2074 7970 6520 /MIME/MTOM type │ │ │ +00108ec0: 284d 494d 4520 7479 7065 2066 6f72 6d61 (MIME type forma │ │ │ +00108ed0: 7429 3c2f 6469 763e 3c64 6976 2063 6c61 t)
De │ │ │ +00108ef0: 6669 6e69 7469 6f6e 3a3c 2f62 3e20 7374 finition: st │ │ │ +00108f00: 6473 6f61 7032 2e68 3a31 3034 3335 3c2f dsoap2.h:10435
.
< │ │ │ +00108f70: 6469 7620 636c 6173 733d 2274 746e 616d div class="ttnam │ │ │ +00108f80: 6522 3e3c 6120 6872 6566 3d22 7374 7275 e">soap_m │ │ │ +00108fd0: 756c 7469 7061 7274 3a3a 6e65 7874 3c2f ultipart::next
next attachment │ │ │ +00109040: 2069 6e20 7468 6520 6c69 6e6b 6564 206c in the linked l │ │ │ +00109050: 6973 743c 2f64 6976 3e3c 6469 7620 636c ist
.
│ │ │ +001090f0: 3c64 6976 2063 6c61 7373 3d22 7474 6e61
cons │ │ │ +00109180: 7420 6368 6172 202a 2070 7472 3c2f 6469 t char * ptr
points to r │ │ │ +001091b0: 6177 2064 6174 6120 636f 6e74 656e 743c aw data content< │ │ │ +001091c0: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
Defin │ │ │ +001091e0: 6974 696f 6e3a 3c2f 623e 2073 7464 736f ition: stdso │ │ │ +001091f0: 6170 322e 683a 3130 3433 323c 2f64 6976 ap2.h:10432
.
│ │ │ +001092f0: 636f 6e73 7420 6368 6172 202a 2064 6573 const char * des │ │ │ +00109300: 6372 6970 7469 6f6e 3c2f 6469 763e 3c64 cription
MIME Content-De │ │ │ +00109330: 7363 7269 7074 696f 6e20 286f 7074 696f scription (optio │ │ │ +00109340: 6e61 6c29 3c2f 6469 763e 3c64 6976 2063 nal)
│ │ │ +00109360: 4465 6669 6e69 7469 6f6e 3a3c 2f62 3e20 Definition: │ │ │ +00109370: 7374 6473 6f61 7032 2e68 3a31 3034 3339 stdsoap2.h:10439 │ │ │ +00109380: 3c2f 6469 763e 3c2f 6469 763e 0a3c 6469
..
co │ │ │ +001095f0: 6e73 7420 6368 6172 202a 206c 6f63 6174 nst char * locat │ │ │ +00109600: 696f 6e3c 2f64 6976 3e3c 6469 7620 636c ion
MIME │ │ │ +00109620: 2043 6f6e 7465 6e74 2d4c 6f63 6174 696f Content-Locatio │ │ │ +00109630: 6e20 286f 7074 696f 6e61 6c29 3c2f 6469 n (optional)
Definiti │ │ │ +00109660: 6f6e 3a3c 2f62 3e20 7374 6473 6f61 7032 on: stdsoap2 │ │ │ +00109670: 2e68 3a31 3034 3338 3c2f 6469 763e 3c2f .h:10438
.
soap_multipa │ │ │ +00109740: 7274 3a3a 7369 7a65 3c2f 613e 3c2f 6469 rt::size
size_t siz │ │ │ +00109770: 653c 2f64 6976 3e3c 6469 7620 636c 6173 e
size o │ │ │ +00109790: 6620 6461 7461 2063 6f6e 7465 6e74 3c2f f data content
Defini │ │ │ +001097c0: 7469 6f6e 3a3c 2f62 3e20 7374 6473 6f61 tion: stdsoa │ │ │ +001097d0: 7032 2e68 3a31 3034 3333 3c2f 6469 763e p2.h:10433
│ │ │ +001097e0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ +00109830: 3c64 6976 2063 6c61 7373 3d22 7474 6e61
│ │ │ +00109880: 736f 6170 3a3a 6d69 6d65 3c2f 613e 3c2f soap::mime
struct s │ │ │ +001098b0: 6f61 705f 6d69 6d65 206d 696d 653c 2f64 oap_mime mime
MIME attac │ │ │ +001098e0: 686d 656e 7473 2072 6563 6569 7665 642e hments received. │ │ │ +001098f0: 3c2f 6469 763e 3c64 6976 2063 6c61 7373
Defi │ │ │ +00109910: 6e69 7469 6f6e 3a3c 2f62 3e20 7374 6473 nition: stds │ │ │ +00109920: 6f61 7032 2e68 3a34 3138 393c 2f64 6976 oap2.h:4189
.
< │ │ │ +00109950: 703e 432b 2b20 7072 6f67 7261 6d6d 6572 p>C++ programmer │ │ │ +00109960: 7320 6361 6e20 7573 6520 616e 2069 7465 s can use an ite │ │ │ +00109970: 7261 746f 7220 696e 7374 6561 643a 3c2f rator instead:.
int │ │ │ +001099d0: 6e20 3d20 303b 3c2f 6469 763e 0a3c 6469 n = 0;
.< │ │ │ +001099f0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +00109a00: 6f72 6466 6c6f 7722 3e66 6f72 3c2f 7370 ordflow">for (soap_mu │ │ │ +00109a70: 6c74 6970 6172 743a 3a69 7465 7261 746f ltipart::iterato │ │ │ +00109a80: 723c 2f61 3e20 6920 3d20 3c61 2063 6c61 r i = soap->mime. │ │ │ +00109b10: 3c61 2063 6c61 7373 3d22 636f 6465 2220 b │ │ │ +00109b60: 6567 696e 3c2f 613e 2829 3b20 6920 213d egin(); i != │ │ │ +00109b70: 203c 6120 636c 6173 733d 2263 6f64 6522 soap │ │ │ +00109ba0: 2d26 6774 3b3c 6120 636c 6173 733d 2263 ->mi │ │ │ +00109bf0: 6d65 3c2f 613e 2e3c 6120 636c 6173 733d me.end(); │ │ │ +00109c50: 202b 2b69 293c 2f64 6976 3e0a 3c64 6976 ++i)
.
{< │ │ │ +00109c70: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
++n;.
printf( │ │ │ +00109cb0: 3c73 7061 6e20 636c 6173 733d 2273 7472 &quo │ │ │ +00109cd0: 743b 5061 7274 2025 643a 5c6e 2671 756f t;Part %d:\n&quo │ │ │ +00109ce0: 743b 3c2f 7370 616e 3e2c 206e 293b 3c2f t;, n);.
printf( │ │ │ +00109d10: 3c73 7061 6e20 636c 6173 733d 2273 7472 &quo │ │ │ +00109d30: 743b 7074 7220 2020 2020 2020 203d 2570 t;ptr =%p │ │ │ +00109d40: 5c6e 2671 756f 743b 3c2f 7370 616e 3e2c \n", │ │ │ +00109d50: 2069 2d26 6774 3b70 7472 293b 3c2f 6469 i->ptr);.
... // etc.
}
.< │ │ │ +00109dc0: 6469 7620 636c 6173 733d 2274 7463 2220 div class="ttc" │ │ │ +00109dd0: 6964 3d22 6173 7472 7563 7473 6f61 705f id="astructsoap_ │ │ │ +00109de0: 5f6d 696d 655f 6874 6d6c 5f61 6539 3966 _mime_html_ae99f │ │ │ +00109df0: 6131 3963 3564 3234 3035 3161 3439 3562 a19c5d24051a495b │ │ │ +00109e00: 3739 6130 3234 6133 6635 6639 223e 3c64 79a024a3f5f9">soap_mime::b │ │ │ +00109e70: 6567 696e 3c2f 613e 3c2f 6469 763e 3c64 egin
soap_multipart │ │ │ +00109ea0: 3a3a 6974 6572 6174 6f72 2062 6567 696e ::iterator begin │ │ │ +00109eb0: 2829 3c2f 6469 763e 3c64 6976 2063 6c61 ()
C++ o │ │ │ +00109ed0: 6e6c 793a 2061 6e20 6974 6572 6174 6f72 nly: an iterator │ │ │ +00109ee0: 206f 7665 7220 736f 6170 5f6d 756c 7469 over soap_multi │ │ │ +00109ef0: 7061 7274 2061 7474 6163 686d 656e 7473 part attachments │ │ │ +00109f00: 2e3c 2f64 6976 3e3c 2f64 6976 3e0a 3c64 .
.soap_mime::en │ │ │ +00109fc0: 643c 2f61 3e3c 2f64 6976 3e3c 6469 7620 d
s │ │ │ +00109fe0: 6f61 705f 6d75 6c74 6970 6172 743a 3a69 oap_multipart::i │ │ │ +00109ff0: 7465 7261 746f 7220 656e 6428 293c 2f64 terator end()
C++ only: │ │ │ +0010a020: 616e 2069 7465 7261 746f 7220 6f76 6572 an iterator over │ │ │ +0010a030: 2073 6f61 705f 6d75 6c74 6970 6172 7420 soap_multipart │ │ │ +0010a040: 6174 7461 6368 6d65 6e74 732e 3c2f 6469 attachments.
.
so │ │ │ +0010a140: 6170 5f6d 756c 7469 7061 7274 5f69 7465 ap_multipart_ite │ │ │ +0010a150: 7261 746f 7220 6974 6572 6174 6f72 3c2f rator iterator
C++ only: │ │ │ +0010a180: 2061 6e20 6974 6572 6174 6f72 206f 7665 an iterator ove │ │ │ +0010a190: 7220 736f 6170 5f6d 756c 7469 7061 7274 r soap_multipart │ │ │ +0010a1a0: 2061 7474 6163 686d 656e 7473 2e3c 2f64 attachments.
Definit │ │ │ +0010a1d0: 696f 6e3a 3c2f 623e 2073 7464 736f 6170 ion: stdsoap │ │ │ +0010a1e0: 322e 683a 3130 3434 313c 2f64 6976 3e3c 2.h:10441
< │ │ │ +0010a1f0: 2f64 6976 3e0a 3c2f 6469 763e 3c21 2d2d /div>.

│ │ │ +0010a210: 4e6f 7465 3a20 6b65 6570 2069 6e20 6d69 Note: keep in mi │ │ │ +0010a220: 6e64 2074 6861 7420 7468 6520 6669 7273 nd that the firs │ │ │ +0010a230: 7420 6174 7461 6368 6d65 6e74 2069 7320 t attachment is │ │ │ +0010a240: 6173 736f 6369 6174 6564 2077 6974 6820 associated with │ │ │ +0010a250: 7468 6520 534f 4150 206d 6573 7361 6765 the SOAP message │ │ │ +0010a260: 2061 6e64 2079 6f75 206d 6179 2077 616e and you may wan │ │ │ +0010a270: 7420 746f 2069 676e 6f72 6520 6974 2e3c t to ignore it.< │ │ │ +0010a280: 2f70 3e0a 3c70 3e41 2063 616c 6c20 746f /p>.

A call to │ │ │ +0010a290: 203c 636f 6465 3e3c 6120 636c 6173 733d soap_ │ │ │ +0010a360: 656e 643c 2f61 3e3c 2f63 6f64 653e 2072 end r │ │ │ +0010a370: 656d 6f76 6573 2061 6c6c 206f 6620 7468 emoves all of th │ │ │ +0010a380: 6520 7265 6365 6976 6564 204d 494d 4520 e received MIME │ │ │ +0010a390: 6461 7461 2e20 546f 2070 7265 7365 7276 data. To preserv │ │ │ +0010a3a0: 6520 616e 2061 7474 6163 686d 656e 7420 e an attachment │ │ │ +0010a3b0: 696e 206d 656d 6f72 792c 2075 7365 203c in memory, use < │ │ │ +0010a3c0: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soap_un │ │ │ +0010a490: 6c69 6e6b 3c2f 613e 3c2f 636f 6465 3e20 link │ │ │ +0010a4a0: 6f6e 2074 6865 203c 636f 6465 3e70 7472 on the ptr │ │ │ +0010a4b0: 3c2f 636f 6465 3e20 6d65 6d62 6572 206f member o │ │ │ +0010a4c0: 6620 7468 6520 3c63 6f64 653e 3c61 2063 f the soap_ │ │ │ +0010a540: 6d75 6c74 6970 6172 743c 2f61 3e3c 2f63 multipart struct. The │ │ │ +0010a560: 203c 636f 6465 3e3c 6120 636c 6173 733d soap_ │ │ │ +0010a630: 756e 6c69 6e6b 3c2f 613e 3c2f 636f 6465 unlink function can b │ │ │ +0010a650: 6520 7573 6564 2074 6f20 7072 6576 656e e used to preven │ │ │ +0010a660: 7420 6465 616c 6c6f 6361 7469 6f6e 206f t deallocation o │ │ │ +0010a670: 6620 6465 7365 7269 616c 697a 6564 2064 f deserialized d │ │ │ +0010a680: 6174 612e 3c2f 703e 0a3c 703e f09f 949d ata.

.

.... │ │ │ +0010a690: 203c 6120 6872 6566 3d22 2322 3e42 6163 Bac │ │ │ +0010a6a0: 6b20 746f 2074 6162 6c65 206f 6620 636f k to table of co │ │ │ +0010a6b0: 6e74 656e 7473 3c2f 613e 3c2f 703e 0a3c ntents

.< │ │ │ +0010a6c0: 6831 3e3c 6120 636c 6173 733d 2261 6e63 h1>< │ │ │ +0010a6e0: 2f61 3e0a 4449 4d45 2061 7474 6163 686d /a>.DIME attachm │ │ │ +0010a6f0: 656e 7473 3c2f 6831 3e0a 3c70 3e41 7070 ents

.

App │ │ │ +0010a700: 6c69 6361 7469 6f6e 7320 6465 7665 6c6f lications develo │ │ │ +0010a710: 7065 6420 7769 7468 2074 6865 2067 534f ped with the gSO │ │ │ +0010a720: 4150 2074 6f6f 6c73 2063 616e 2074 7261 AP tools can tra │ │ │ +0010a730: 6e73 6d69 7420 6269 6e61 7279 2044 494d nsmit binary DIM │ │ │ +0010a740: 4520 6174 7461 6368 6d65 6e74 7320 7374 E attachments st │ │ │ +0010a750: 6f72 6564 2069 6e20 6d65 6d6f 7279 206f ored in memory o │ │ │ +0010a760: 7220 696e 2073 7472 6561 6d69 6e67 206d r in streaming m │ │ │ +0010a770: 6f64 6520 6279 2066 6574 6368 696e 6720 ode by fetching │ │ │ +0010a780: 6461 7461 2066 726f 6d20 6120 7265 736f data from a reso │ │ │ +0010a790: 7572 6365 206f 7220 7365 6e64 696e 6720 urce or sending │ │ │ +0010a7a0: 6461 7461 2074 6f20 6120 7265 736f 7572 data to a resour │ │ │ +0010a7b0: 6365 2075 7369 6e67 2063 616c 6c62 6163 ce using callbac │ │ │ +0010a7c0: 6b20 6675 6e63 7469 6f6e 732e 2054 6865 k functions. The │ │ │ +0010a7d0: 206d 6178 696d 756d 2044 494d 4520 6174 maximum DIME at │ │ │ +0010a7e0: 7461 6368 6d65 6e74 2073 697a 6520 6973 tachment size is │ │ │ +0010a7f0: 206c 696d 6974 6564 2074 6f20 3820 4d42 limited to 8 MB │ │ │ +0010a800: 2062 7920 6465 6661 756c 7420 6173 2073 by default as s │ │ │ +0010a810: 6574 2077 6974 6820 3c63 6f64 653e 2353 et with #S │ │ │ +0010a820: 4f41 505f 4d41 5844 494d 4553 495a 453c OAP_MAXDIMESIZE< │ │ │ +0010a830: 2f63 6f64 653e 2e20 5468 6973 206c 696d /code>. This lim │ │ │ +0010a840: 6974 2063 616e 2062 6520 6368 616e 6765 it can be change │ │ │ +0010a850: 6420 6173 206e 6565 6465 642e 2057 6974 d as needed. Wit │ │ │ +0010a860: 6820 7374 7265 616d 696e 6720 4449 4d45 h streaming DIME │ │ │ +0010a870: 2075 7369 6e67 2063 616c 6c62 6163 6b20 using callback │ │ │ +0010a880: 6675 6e63 7469 6f6e 732c 2064 6174 6120 functions, data │ │ │ +0010a890: 6861 6e64 6c65 7273 2061 7265 2075 7365 handlers are use │ │ │ +0010a8a0: 6420 746f 2070 6173 7320 7468 6520 6461 d to pass the da │ │ │ +0010a8b0: 7461 2074 6f20 616e 6420 6672 6f6d 2061 ta to and from a │ │ │ +0010a8c0: 2072 6573 6f75 7263 6520 6672 6f6d 2077 resource from w │ │ │ +0010a8d0: 6869 6368 2074 6f20 6665 7463 6820 7468 hich to fetch th │ │ │ +0010a8e0: 6520 6461 7461 2074 6f20 7365 6e64 206f e data to send o │ │ │ +0010a8f0: 7220 6461 7461 2074 6f20 7374 6f72 652c r data to store, │ │ │ +0010a900: 2073 7563 6820 6173 2061 2066 696c 6520 such as a file │ │ │ +0010a910: 6f72 2064 6576 6963 652e 2053 6565 2053 or device. See S │ │ │ +0010a920: 6563 7469 6f6e 203c 6120 636c 6173 733d ection Streaming D │ │ │ +0010a960: 494d 453c 2f61 3e20 2e3c 2f70 3e0a 3c70 IME .

.

For details on │ │ │ +0010a980: 4449 4d45 2061 7474 6163 686d 656e 7473 DIME attachments │ │ │ +0010a990: 2c20 7365 6520 3c61 2068 7265 663d 2268 , see http://msdn.mi │ │ │ +0010aa00: 6372 6f73 6f66 742e 636f 6d2f 6c69 6272 crosoft.com/libr │ │ │ +0010aa10: 6172 792f 656e 2d75 732f 646e 676c 6f62 ary/en-us/dnglob │ │ │ +0010aa20: 7370 6563 2f68 746d 6c2f 6472 6166 742d spec/html/draft- │ │ │ +0010aa30: 6e69 656c 7365 6e2d 6469 6d65 2d30 322e nielsen-dime-02. │ │ │ +0010aa40: 7478 743c 2f61 3e3c 2f70 3e0a 3c70 3e53 txt

.

S │ │ │ +0010aa50: 6565 2061 6c73 6f20 4150 4920 646f 6375 ee also API docu │ │ │ +0010aa60: 6d65 6e74 6174 696f 6e20 4d6f 6475 6c65 mentation Module │ │ │ +0010aa70: 203c 6120 636c 6173 733d 2265 6c22 2068 DI │ │ │ +0010aaa0: 4d45 2061 7474 6163 686d 656e 7420 6675 ME attachment fu │ │ │ +0010aab0: 6e63 7469 6f6e 733c 2f61 3e2e 3c2f 703e nctions.

│ │ │ +0010aac0: 0a3c 703e f09f 949d 203c 6120 6872 6566 .

.... Back to tab │ │ │ +0010aae0: 6c65 206f 6620 636f 6e74 656e 7473 3c2f le of contents

.

.Sending a col │ │ │ +0010ab30: 6c65 6374 696f 6e20 6f66 2044 494d 4520 lection of DIME │ │ │ +0010ab40: 6174 7461 6368 6d65 6e74 733c 2f68 323e attachments

│ │ │ +0010ab50: 0a3c 703e 5468 6520 666f 6c6c 6f77 696e .

The followin │ │ │ +0010ab60: 6720 6675 6e63 7469 6f6e 7320 6361 6e20 g functions can │ │ │ +0010ab70: 6265 2075 7365 6420 746f 2065 7870 6c69 be used to expli │ │ │ +0010ab80: 6369 746c 7920 7365 7420 7570 2061 2063 citly set up a c │ │ │ +0010ab90: 6f6c 6c65 6374 696f 6e20 6f66 2044 494d ollection of DIM │ │ │ +0010aba0: 4520 6174 7461 6368 6d65 6e74 7320 666f E attachments fo │ │ │ +0010abb0: 7220 7472 616e 736d 6973 7369 6f6e 2077 r transmission w │ │ │ +0010abc0: 6974 6820 6120 6d65 7373 6167 652e 2054 ith a message. T │ │ │ +0010abd0: 6865 7365 2061 7474 6163 686d 656e 7473 hese attachments │ │ │ +0010abe0: 2063 616e 2062 6520 7374 7265 616d 6564 can be streamed │ │ │ +0010abf0: 2c20 6173 2064 6573 6372 6962 6564 2069 , as described i │ │ │ +0010ac00: 6e20 5365 6374 696f 6e20 3c61 2063 6c61 n Section Streamin │ │ │ +0010ac40: 6720 4449 4d45 3c2f 613e 202e 2057 6974 g DIME . Wit │ │ │ +0010ac50: 686f 7574 2073 7472 6561 6d69 6e67 2c20 hout streaming, │ │ │ +0010ac60: 6561 6368 2061 7474 6163 686d 656e 7420 each attachment │ │ │ +0010ac70: 6d75 7374 2072 6566 6572 2074 6f20 6120 must refer to a │ │ │ +0010ac80: 626c 6f63 6b20 6f66 2064 6174 6120 696e block of data in │ │ │ +0010ac90: 206d 656d 6f72 792e 3c2f 703e 0a3c 756c memory.

.
    .
  • void │ │ │ +0010acb0: 203c 6120 636c 6173 733d 2265 6c22 2068 soap_set_dime( │ │ │ +0010ad30: 7374 7275 6374 2073 6f61 7020 2a73 6f61 struct soap *soa │ │ │ +0010ad40: 7029 3c2f 613e 3c2f 636f 6465 3e20 5468 p) Th │ │ │ +0010ad50: 6973 2066 756e 6374 696f 6e20 656e 6162 is function enab │ │ │ +0010ad60: 6c65 7320 7365 6e64 696e 6720 4449 4d45 les sending DIME │ │ │ +0010ad70: 2061 7474 6163 686d 656e 7473 2e20 5468 attachments. Th │ │ │ +0010ad80: 6973 2066 756e 6374 696f 6e20 6973 2067 is function is g │ │ │ +0010ad90: 656e 6572 616c 6c79 206e 6f74 2072 6571 enerally not req │ │ │ +0010ada0: 7569 7265 6420 6265 6361 7573 6520 4449 uired because DI │ │ │ +0010adb0: 4d45 2061 7474 6163 686d 656e 7473 2061 ME attachments a │ │ │ +0010adc0: 7265 2061 7574 6f6d 6174 6963 616c 6c79 re automatically │ │ │ +0010add0: 2064 6574 6563 7465 6420 6173 203c 636f detected as xsd__base64Bina │ │ │ +0010ae60: 7279 3c2f 613e 3c2f 636f 6465 3e20 616e ry an │ │ │ +0010ae70: 6420 3c63 6f64 653e 3c61 2063 6c61 7373 d _x │ │ │ +0010aee0: 6f70 5f5f 496e 636c 7564 653c 2f61 3e3c op__Include< │ │ │ +0010aef0: 2f63 6f64 653e 2073 7472 7563 7475 7265 /code> structure │ │ │ +0010af00: 7320 696e 2074 6865 2064 6174 6120 746f s in the data to │ │ │ +0010af10: 2073 6572 6961 6c69 7a65 2061 7320 616e serialize as an │ │ │ +0010af20: 2058 4d4c 206d 6573 7361 6765 2077 6974 XML message wit │ │ │ +0010af30: 6820 7468 6520 6174 7461 6368 6d65 6e74 h the attachment │ │ │ +0010af40: 7320 6175 746f 6d61 7469 6361 6c6c 7920 s automatically │ │ │ +0010af50: 6164 6465 6420 6f72 2044 494d 4520 6174 added or DIME at │ │ │ +0010af60: 7461 6368 6d65 6e74 7320 6361 6e20 6265 tachments can be │ │ │ +0010af70: 2065 7870 6c69 6369 746c 7920 6164 6465 explicitly adde │ │ │ +0010af80: 6420 7769 7468 203c 636f 6465 3e3c 6120 d with soap_set_dim │ │ │ +0010b020: 655f 6174 7461 6368 6d65 6e74 3c2f 613e e_attachment │ │ │ +0010b030: 3c2f 636f 6465 3e2e 3c2f 6c69 3e0a 3c6c .
  • .int soap │ │ │ +0010b050: 5f73 6574 5f64 696d 655f 6174 7461 6368 _set_dime_attach │ │ │ +0010b060: 6d65 6e74 2873 7472 7563 7420 736f 6170 ment(struct soap │ │ │ +0010b070: 202a 736f 6170 2c20 6368 6172 202a 7074 *soap, char *pt │ │ │ +0010b080: 722c 2073 697a 655f 7420 7369 7a65 2c20 r, size_t size, │ │ │ +0010b090: 636f 6e73 7420 6368 6172 202a 7479 7065 const char *type │ │ │ +0010b0a0: 2c20 636f 6e73 7420 6368 6172 202a 6964 , const char *id │ │ │ +0010b0b0: 2c20 756e 7369 676e 6564 2073 686f 7274 , unsigned short │ │ │ +0010b0c0: 206f 7074 7970 652c 2063 6f6e 7374 2063 optype, const c │ │ │ +0010b0d0: 6861 7220 2a6f 7074 696f 6e29 3c2f 636f har *option) This functio │ │ │ +0010b0f0: 6e20 6164 6473 2061 2044 494d 4520 6174 n adds a DIME at │ │ │ +0010b100: 7461 6368 6d65 6e74 2074 6f20 7468 6520 tachment to the │ │ │ +0010b110: 584d 4c20 6d65 7373 6167 6520 746f 2073 XML message to s │ │ │ +0010b120: 656e 642e 2054 6865 2073 7065 6369 6669 end. The specifi │ │ │ +0010b130: 6564 203c 636f 6465 3e70 7472 3c2f 636f ed ptr points to th │ │ │ +0010b150: 6520 6461 7461 2074 6f20 7365 6e64 206f e data to send o │ │ │ +0010b160: 6620 6c65 6e67 7468 2073 7065 6369 6669 f length specifi │ │ │ +0010b170: 6564 2062 7920 3c63 6f64 653e 7369 7a65 ed by size │ │ │ +0010b180: 3c2f 636f 6465 3e2e 2054 6865 203c 636f . The type p │ │ │ +0010b1a0: 6172 616d 6574 6572 2069 6e64 6963 6174 arameter indicat │ │ │ +0010b1b0: 6573 2074 6865 204d 494d 4520 7479 7065 es the MIME type │ │ │ +0010b1c0: 206f 6620 7468 6520 6461 7461 206f 7220 of the data or │ │ │ +0010b1d0: 6361 6e20 6265 204e 554c 4c2e 2054 6865 can be NULL. The │ │ │ +0010b1e0: 203c 636f 6465 3e69 643c 2f63 6f64 653e id │ │ │ +0010b1f0: 2070 6172 616d 6574 6572 2075 6e69 7175 parameter uniqu │ │ │ +0010b200: 656c 7920 6964 656e 7469 6669 6573 2074 ely identifies t │ │ │ +0010b210: 6865 2061 7474 6163 686d 656e 7420 696e he attachment in │ │ │ +0010b220: 2074 6865 206d 6573 7361 6765 2c20 7768 the message, wh │ │ │ +0010b230: 6963 6820 6361 6e20 6265 206f 6d69 7474 ich can be omitt │ │ │ +0010b240: 6564 2062 7920 7370 6563 6966 7969 6e67 ed by specifying │ │ │ +0010b250: 204e 554c 4c2e 2054 6865 203c 636f 6465 NULL. The option p │ │ │ +0010b270: 6172 616d 6574 6572 2069 7320 616e 206f arameter is an o │ │ │ +0010b280: 7074 696f 6e20 7375 6368 2061 7320 6120 ption such as a │ │ │ +0010b290: 6465 7363 7269 7074 696f 6e20 6f66 2074 description of t │ │ │ +0010b2a0: 6865 2064 6174 6120 616e 6420 3c63 6f64 he data and optype │ │ │ +0010b2c0: 6973 2061 2075 7365 722d 6465 6669 6e65 is a user-define │ │ │ +0010b2d0: 6420 6f70 7469 6f6e 2074 7970 6520 2861 d option type (a │ │ │ +0010b2e0: 7320 7065 7220 4449 4d45 206f 7074 696f s per DIME optio │ │ │ +0010b2f0: 6e20 7370 6563 6966 6963 6174 696f 6e20 n specification │ │ │ +0010b300: 666f 726d 6174 292e 2054 6865 203c 636f format). The ptr pa │ │ │ +0010b320: 7261 6d65 7465 7220 6d75 7374 2062 6520 rameter must be │ │ │ +0010b330: 7065 7273 6973 7465 6e74 2e20 5468 6520 persistent. The │ │ │ +0010b340: 3c63 6f64 653e 7074 723c 2f63 6f64 653e ptr │ │ │ +0010b350: 2070 6172 616d 6574 6572 2070 6173 7365 parameter passe │ │ │ +0010b360: 6420 746f 2074 6869 7320 6675 6e63 7469 d to this functi │ │ │ +0010b370: 6f6e 206d 7573 7420 6265 2070 6572 7369 on must be persi │ │ │ +0010b380: 7374 656e 7420 696e 206d 656d 6f72 7920 stent in memory │ │ │ +0010b390: 756e 7469 6c20 7468 6520 6174 7461 6368 until the attach │ │ │ +0010b3a0: 6d65 6e74 2077 6173 2073 656e 742e 2052 ment was sent. R │ │ │ +0010b3b0: 6574 7572 6e73 203c 636f 6465 3e23 534f eturns #SO │ │ │ +0010b3c0: 4150 5f4f 4b3c 2f63 6f64 653e 206f 7220 AP_OK or │ │ │ +0010b3d0: 6120 3c63 6f64 653e 3c61 2063 6c61 7373 a soap_st │ │ │ +0010b490: 6174 7573 3c2f 613e 3c2f 636f 6465 3e20 atus │ │ │ +0010b4a0: 6572 726f 7220 636f 6465 2e3c 2f6c 693e error code. │ │ │ +0010b4b0: 0a3c 6c69 3e3c 636f 6465 3e76 6f69 6420 .
  • void │ │ │ +0010b4c0: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap_clr_dime( │ │ │ +0010b540: 7374 7275 6374 2073 6f61 7020 2a73 6f61 struct soap *soa │ │ │ +0010b550: 7029 3c2f 613e 3c2f 636f 6465 3e20 5468 p) Th │ │ │ +0010b560: 6973 2066 756e 6374 696f 6e20 6469 7361 is function disa │ │ │ +0010b570: 626c 6573 2044 494d 4520 6174 7461 6368 bles DIME attach │ │ │ +0010b580: 6d65 6e74 732c 2075 6e6c 6573 7320 7468 ments, unless th │ │ │ +0010b590: 6520 6461 7461 2074 6f20 7365 7269 616c e data to serial │ │ │ +0010b5a0: 697a 6520 6173 2061 6e20 584d 4c20 6d65 ize as an XML me │ │ │ +0010b5b0: 7373 6167 6520 636f 6e74 6169 6e73 2061 ssage contains a │ │ │ +0010b5c0: 7474 6163 686d 656e 7473 2064 6566 696e ttachments defin │ │ │ +0010b5d0: 6564 2062 7920 3c63 6f64 653e 3c61 2063 ed by xsd__b │ │ │ +0010b650: 6173 6536 3442 696e 6172 793c 2f61 3e3c ase64Binary< │ │ │ +0010b660: 2f63 6f64 653e 2061 6e64 203c 636f 6465 /code> and _xop__Inc │ │ │ +0010b6e0: 6c75 6465 3c2f 613e 3c2f 636f 6465 3e20 lude │ │ │ +0010b6f0: 7374 7275 6374 7572 6573 2e3c 2f6c 693e structures.
  • │ │ │ +0010b700: 0a3c 2f75 6c3e 0a3c 703e 5468 6573 6520 .
.

These │ │ │ +0010b710: 6675 6e63 7469 6f6e 7320 616c 6c6f 7720 functions allow │ │ │ +0010b720: 4449 4d45 2061 7474 6163 686d 656e 7473 DIME attachments │ │ │ +0010b730: 2074 6f20 6265 2061 6464 6564 2074 6f20 to be added to │ │ │ +0010b740: 534f 4150 206d 6573 7361 6765 7320 7769 SOAP messages wi │ │ │ +0010b750: 7468 6f75 7420 7265 7175 6972 696e 6720 thout requiring │ │ │ +0010b760: 6d65 7373 6167 6520 626f 6479 2072 6566 message body ref │ │ │ +0010b770: 6572 656e 6365 732e 2054 6869 7320 6973 erences. This is │ │ │ +0010b780: 2061 6c73 6f20 7265 6665 7272 6564 2074 also referred t │ │ │ +0010b790: 6f20 6173 2074 6865 206f 7065 6e20 4449 o as the open DI │ │ │ +0010b7a0: 4d45 2061 7474 6163 686d 656e 7420 7374 ME attachment st │ │ │ +0010b7b0: 796c 652e 2054 6865 2063 6c6f 7365 6420 yle. The closed │ │ │ +0010b7c0: 6174 7461 6368 6d65 6e74 2073 7479 6c65 attachment style │ │ │ +0010b7d0: 2072 6571 7569 7265 7320 616c 6c20 4449 requires all DI │ │ │ +0010b7e0: 4d45 2061 7474 6163 686d 656e 7473 2074 ME attachments t │ │ │ +0010b7f0: 6f20 6265 2072 6566 6572 656e 6365 6420 o be referenced │ │ │ +0010b800: 6672 6f6d 2074 6865 2053 4f41 5020 6d65 from the SOAP me │ │ │ +0010b810: 7373 6167 6520 626f 6479 2077 6974 6820 ssage body with │ │ │ +0010b820: 3c65 6d3e 3c63 6f64 653e 6872 6566 3c2f href (or s │ │ │ +0010b840: 696d 696c 6172 2920 7265 6665 7265 6e63 imilar) referenc │ │ │ +0010b850: 6573 2e20 466f 7220 7468 6520 636c 6f73 es. For the clos │ │ │ +0010b860: 6564 2073 7479 6c65 2c20 6753 4f41 5020 ed style, gSOAP │ │ │ +0010b870: 7375 7070 6f72 7473 2061 6e20 6175 746f supports an auto │ │ │ +0010b880: 6d61 7469 6320 6269 6e61 7279 2064 6174 matic binary dat │ │ │ +0010b890: 6120 7365 7269 616c 697a 6174 696f 6e20 a serialization │ │ │ +0010b8a0: 6d65 7468 6f64 2c20 7365 6520 5365 6374 method, see Sect │ │ │ +0010b8b0: 696f 6e20 3c61 2063 6c61 7373 3d22 656c ion S │ │ │ +0010b8e0: 6572 6961 6c69 7a69 6e67 2062 696e 6172 erializing binar │ │ │ +0010b8f0: 7920 6461 7461 2077 6974 6820 4449 4d45 y data with DIME │ │ │ +0010b900: 2061 7474 6163 686d 656e 7473 3c2f 613e attachments │ │ │ +0010b910: 202e 3c2f 703e 0a3c 703e f09f 949d 203c .

.

.... < │ │ │ +0010b920: 6120 6872 6566 3d22 2322 3e42 6163 6b20 a href="#">Back │ │ │ +0010b930: 746f 2074 6162 6c65 206f 6620 636f 6e74 to table of cont │ │ │ +0010b940: 656e 7473 3c2f 613e 3c2f 703e 0a3c 6832 ents

.

.Retri │ │ │ +0010b980: 6576 696e 6720 6120 636f 6c6c 6563 7469 eving a collecti │ │ │ +0010b990: 6f6e 206f 6620 4449 4d45 2061 7474 6163 on of DIME attac │ │ │ +0010b9a0: 686d 656e 7473 3c2f 6832 3e0a 3c70 3e44 hments

.

D │ │ │ +0010b9b0: 494d 4520 6174 7461 6368 6d65 6e74 7320 IME attachments │ │ │ +0010b9c0: 6172 6520 6175 746f 6d61 7469 6361 6c6c are automaticall │ │ │ +0010b9d0: 7920 7061 7273 6564 2061 6e64 2073 746f y parsed and sto │ │ │ +0010b9e0: 7265 6420 696e 206d 656d 6f72 7920 286f red in memory (o │ │ │ +0010b9f0: 7220 7061 7373 6564 2074 6f20 7468 6520 r passed to the │ │ │ +0010ba00: 7374 7265 616d 696e 6720 6861 6e64 6c65 streaming handle │ │ │ +0010ba10: 7273 2076 6961 2074 6865 2044 494d 4520 rs via the DIME │ │ │ +0010ba20: 6361 6c6c 6261 636b 2066 756e 6374 696f callback functio │ │ │ +0010ba30: 6e73 2077 6865 6e20 6465 6669 6e65 6429 ns when defined) │ │ │ +0010ba40: 2e20 4166 7465 7220 7265 6365 6976 696e . After receivin │ │ │ +0010ba50: 6720 6120 7365 7420 6f66 2044 494d 4520 g a set of DIME │ │ │ +0010ba60: 6174 7461 6368 6d65 6e74 732c 2065 6974 attachments, eit │ │ │ +0010ba70: 6865 7220 6174 2074 6865 2063 6c69 656e her at the clien │ │ │ +0010ba80: 742d 7369 6465 206f 7220 7468 6520 7365 t-side or the se │ │ │ +0010ba90: 7276 6572 2d73 6964 652c 2074 6865 206c rver-side, the l │ │ │ +0010baa0: 6973 7420 6f66 2044 494d 4520 6174 7461 ist of DIME atta │ │ │ +0010bab0: 6368 6d65 6e74 7320 6361 6e20 6265 2074 chments can be t │ │ │ +0010bac0: 7261 7665 7273 6564 2074 6f20 6578 7472 raversed to extr │ │ │ +0010bad0: 6163 7420 6d65 7461 2064 6174 6120 616e act meta data an │ │ │ +0010bae0: 6420 7468 6520 6174 7461 6368 6d65 6e74 d the attachment │ │ │ +0010baf0: 2063 6f6e 7465 6e74 2e3c 2f70 3e0a 3c70 content.

.

To traverse the │ │ │ +0010bb10: 206c 6973 7420 6f66 2044 494d 4520 6174 list of DIME at │ │ │ +0010bb20: 7461 6368 6d65 6e74 7320 696e 2043 2c20 tachments in C, │ │ │ +0010bb30: 796f 7520 7573 6520 6120 6c6f 6f70 2073 you use a loop s │ │ │ +0010bb40: 696d 696c 6172 2074 6f3a 3c2f 703e 0a3c imilar to:

.< │ │ │ +0010bb50: 6469 7620 636c 6173 733d 2266 7261 676d div class="fragm │ │ │ +0010bb60: 656e 7422 3e3c 6469 7620 636c 6173 733d ent">
int n = │ │ │ +0010bba0: 303b 3c2f 6469 763e 0a3c 6469 7620 636c 0;
.
struct < │ │ │ +0010bbe0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +0010bbf0: 7265 663d 2273 7472 7563 7473 6f61 705f ref="structsoap_ │ │ │ +0010bc00: 5f6d 756c 7469 7061 7274 2e68 746d 6c22 _multipart.html" │ │ │ +0010bc10: 3e73 6f61 705f 6d75 6c74 6970 6172 743c >soap_multipart< │ │ │ +0010bc20: 2f61 3e20 2a61 7474 6163 686d 656e 743b /a> *attachment; │ │ │ +0010bc30: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
for (a │ │ │ +0010bc70: 7474 6163 686d 656e 7420 3d20 3c61 2063 ttachment = soap-> │ │ │ +0010bcb0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 dime.list; attac │ │ │ +0010bd60: 686d 656e 743b 2061 7474 6163 686d 656e hment; attachmen │ │ │ +0010bd70: 7420 3d20 6174 7461 6368 6d65 6e74 2d26 t = attachment-& │ │ │ +0010bd80: 6774 3b3c 6120 636c 6173 733d 2263 6f64 gt;next) │ │ │ +0010bde0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
{
│ │ │ +0010be00: 0a3c 6469 7620 636c 6173 733d 226c 696e .
++n;
. │ │ │ +0010be20: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
printf("Par │ │ │ +0010be60: 7420 2564 3a5c 6e26 7175 6f74 3b3c 2f73 t %d:\n", n);
. │ │ │ +0010be80: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
printf("ptr │ │ │ +0010bec0: 2020 2020 2020 2020 3d25 705c 6e26 7175 =%p\n&qu │ │ │ +0010bed0: 6f74 3b3c 2f73 7061 6e3e 2c20 6174 7461 ot;, atta │ │ │ +0010bee0: 6368 6d65 6e74 2d26 6774 3b3c 6120 636c chment->p │ │ │ +0010bf40: 7472 3c2f 613e 293b 3c2f 6469 763e 0a3c tr);
.< │ │ │ +0010bf50: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +0010bf60: 3e20 2070 7269 6e74 6628 3c73 7061 6e20 > printf("size │ │ │ +0010bf90: 2020 2020 2020 203d 2575 6c5c 6e26 7175 =%ul\n&qu │ │ │ +0010bfa0: 6f74 3b3c 2f73 7061 6e3e 2c20 6174 7461 ot;, atta │ │ │ +0010bfb0: 6368 6d65 6e74 2d26 6774 3b3c 6120 636c chment->s │ │ │ +0010c010: 697a 653c 2f61 3e29 3b3c 2f64 6976 3e0a ize);
. │ │ │ +0010c020: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
printf("id │ │ │ +0010c060: 2020 2020 2020 2020 3d25 735c 6e26 7175 =%s\n&qu │ │ │ +0010c070: 6f74 3b3c 2f73 7061 6e3e 2c20 6174 7461 ot;, atta │ │ │ +0010c080: 6368 6d65 6e74 2d26 6774 3b3c 6120 636c chment->i │ │ │ +0010c0e0: 643c 2f61 3e20 3f20 6174 7461 6368 6d65 d ? attachme │ │ │ +0010c0f0: 6e74 2d26 6774 3b3c 6120 636c 6173 733d nt->id : │ │ │ +0010c170: 2671 756f 743b 2671 756f 743b 3c2f 7370 "");
.
│ │ │ +0010c1a0: 7072 696e 7466 283c 7370 616e 2063 6c61 printf("type │ │ │ +0010c1d0: 2020 2020 3d25 735c 6e26 7175 6f74 3b3c =%s\n"< │ │ │ +0010c1e0: 2f73 7061 6e3e 2c20 6174 7461 6368 6d65 /span>, attachme │ │ │ +0010c1f0: 6e74 2d26 6774 3b3c 6120 636c 6173 733d nt->type< │ │ │ +0010c250: 2f61 3e20 3f20 6174 7461 6368 6d65 6e74 /a> ? attachment │ │ │ +0010c260: 2d26 6774 3b3c 6120 636c 6173 733d 2263 ->type : │ │ │ +0010c2e0: 2671 756f 743b 2671 756f 743b 3c2f 7370 "");
.
}< │ │ │ +0010c310: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
soap_ │ │ │ +0010c3c0: 6469 6d65 3a3a 6c69 7374 3c2f 613e 3c2f dime::list
struct s │ │ │ +0010c3f0: 6f61 705f 6d75 6c74 6970 6172 7420 2a20 oap_multipart * │ │ │ +0010c400: 6c69 7374 3c2f 6469 763e 3c64 6976 2063 list
lis │ │ │ +0010c420: 7420 6f66 2044 494d 4520 6174 7461 6368 t of DIME attach │ │ │ +0010c430: 6d65 6e74 7320 7265 6365 6976 6564 3c2f ments received
Defini │ │ │ +0010c460: 7469 6f6e 3a3c 2f62 3e20 7374 6473 6f61 tion: stdsoa │ │ │ +0010c470: 7032 2e68 3a39 3937 313c 2f64 6976 3e3c p2.h:9971
< │ │ │ +0010c480: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
< │ │ │ +0010c4d0: 6469 7620 636c 6173 733d 2274 746e 616d div class="ttnam │ │ │ +0010c4e0: 6522 3e3c 6120 6872 6566 3d22 7374 7275 e">s │ │ │ +0010c520: 6f61 703a 3a64 696d 653c 2f61 3e3c 2f64 oap::dime
struct so │ │ │ +0010c550: 6170 5f64 696d 6520 6469 6d65 3c2f 6469 ap_dime dime
DIME attach │ │ │ +0010c580: 6d65 6e74 7320 7265 6365 6976 6564 2e3c ments received.< │ │ │ +0010c590: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
Defin │ │ │ +0010c5b0: 6974 696f 6e3a 3c2f 623e 2073 7464 736f ition: stdso │ │ │ +0010c5c0: 6170 322e 683a 3431 3834 3c2f 6469 763e ap2.h:4184
│ │ │ +0010c5d0: 3c2f 6469 763e 0a3c 2f64 6976 3e3c 212d
.

C++ programmers │ │ │ +0010c600: 2063 616e 2075 7365 2061 6e20 6974 6572 can use an iter │ │ │ +0010c610: 6174 6f72 2069 6e73 7465 6164 3a3c 2f70 ator instead:

.
int n │ │ │ +0010c670: 203d 2030 3b3c 2f64 6976 3e0a 3c64 6976 = 0;
.
for (soap_mul │ │ │ +0010c710: 7469 7061 7274 3a3a 6974 6572 6174 6f72 tipart::iterator │ │ │ +0010c720: 3c2f 613e 2069 203d 203c 6120 636c 6173 i = │ │ │ +0010c750: 736f 6170 3c2f 613e 2d26 6774 3b3c 6120 soap->dime.< │ │ │ +0010c7b0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +0010c7c0: 7265 663d 2273 7472 7563 7473 6f61 705f ref="structsoap_ │ │ │ +0010c7d0: 5f64 696d 652e 6874 6d6c 2361 3466 6530 _dime.html#a4fe0 │ │ │ +0010c7e0: 6435 3234 6366 6639 6532 6534 3637 3438 d524cff9e2e46748 │ │ │ +0010c7f0: 3764 6261 3138 6464 3631 6638 223e 6265 7dba18dd61f8">be │ │ │ +0010c800: 6769 6e3c 2f61 3e28 293b 2069 2021 3d20 gin(); i != │ │ │ +0010c810: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap- │ │ │ +0010c840: 2667 743b 3c61 2063 6c61 7373 3d22 636f >dim │ │ │ +0010c890: 653c 2f61 3e2e 3c61 2063 6c61 7373 3d22 e.end(); │ │ │ +0010c8f0: 2b2b 6929 3c2f 6469 763e 0a3c 6469 7620 ++i)
.
{.
++n;.
printf(< │ │ │ +0010c950: 7370 616e 2063 6c61 7373 3d22 7374 7269 span class="stri │ │ │ +0010c960: 6e67 6c69 7465 7261 6c22 3e26 7175 6f74 ngliteral">" │ │ │ +0010c970: 3b50 6172 7420 2564 3a5c 6e26 7175 6f74 ;Part %d:\n" │ │ │ +0010c980: 3b3c 2f73 7061 6e3e 2c20 6e29 3b3c 2f64 ;, n);.
printf(< │ │ │ +0010c9b0: 7370 616e 2063 6c61 7373 3d22 7374 7269 span class="stri │ │ │ +0010c9c0: 6e67 6c69 7465 7261 6c22 3e26 7175 6f74 ngliteral">" │ │ │ +0010c9d0: 3b70 7472 2020 2020 2020 2020 3d25 705c ;ptr =%p\ │ │ │ +0010c9e0: 6e26 7175 6f74 3b3c 2f73 7061 6e3e 2c20 n", │ │ │ +0010c9f0: 692d 2667 743b 7074 7229 3b3c 2f64 6976 i->ptr);
.
... │ │ │ +0010ca30: 2f2f 2065 7463 3c2f 7370 616e 3e3c 2f64 // etc.
}
.soap_dime::be │ │ │ +0010cb10: 6769 6e3c 2f61 3e3c 2f64 6976 3e3c 6469 gin
soap_multipart: │ │ │ +0010cb40: 3a69 7465 7261 746f 7220 6265 6769 6e28 :iterator begin( │ │ │ +0010cb50: 293c 2f64 6976 3e3c 6469 7620 636c 6173 )
C++ on │ │ │ +0010cb70: 6c79 3a20 616e 2069 7465 7261 746f 7220 ly: an iterator │ │ │ +0010cb80: 6f76 6572 2073 6f61 705f 6d75 6c74 6970 over soap_multip │ │ │ +0010cb90: 6172 7420 6174 7461 6368 6d65 6e74 732e art attachments. │ │ │ +0010cba0: 3c2f 6469 763e 3c2f 6469 763e 0a3c 6469
.
│ │ │ +0010cc10: 3c61 2068 7265 663d 2273 7472 7563 7473 soap_dime::end │ │ │ +0010cc60: 3c2f 613e 3c2f 6469 763e 3c64 6976 2063
so │ │ │ +0010cc80: 6170 5f6d 756c 7469 7061 7274 3a3a 6974 ap_multipart::it │ │ │ +0010cc90: 6572 6174 6f72 2065 6e64 2829 3c2f 6469 erator end()
C++ only: a │ │ │ +0010ccc0: 6e20 6974 6572 6174 6f72 206f 7665 7220 n iterator over │ │ │ +0010ccd0: 736f 6170 5f6d 756c 7469 7061 7274 2061 soap_multipart a │ │ │ +0010cce0: 7474 6163 686d 656e 7473 2e3c 2f64 6976 ttachments.
.
< │ │ │ +0010cd10: 703e 5468 6520 3c63 6f64 653e 6f70 7469 p>The opti │ │ │ +0010cd20: 6f6e 733c 2f63 6f64 653e 206d 656d 6265 ons membe │ │ │ +0010cd30: 7220 6973 2061 7661 696c 6162 6c65 2061 r is available a │ │ │ +0010cd40: 7320 7765 6c6c 2c20 6275 7420 6e6f 7420 s well, but not │ │ │ +0010cd50: 7368 6f77 6e20 696e 2074 6865 2063 6f64 shown in the cod │ │ │ +0010cd60: 6520 6162 6f76 652e 2054 6865 203c 636f e above. The options
content is for │ │ │ +0010cd90: 6d61 7474 6564 2061 6363 6f72 6469 6e67 matted according │ │ │ +0010cda0: 2074 6f20 7468 6520 4449 4d45 2073 7065 to the DIME spe │ │ │ +0010cdb0: 6369 6669 6361 7469 6f6e 3a20 7468 6520 cification: the │ │ │ +0010cdc0: 6669 7273 7420 7477 6f20 6279 7465 7320 first two bytes │ │ │ +0010cdd0: 6172 6520 7265 7365 7276 6564 2066 6f72 are reserved for │ │ │ +0010cde0: 2074 6865 206f 7074 696f 6e20 7479 7065 the option type │ │ │ +0010cdf0: 2c20 7468 6520 6e65 7874 2074 776f 2062 , the next two b │ │ │ +0010ce00: 7974 6573 2073 746f 7265 2074 6865 2073 ytes store the s │ │ │ +0010ce10: 697a 6520 6f66 2074 6865 206f 7074 696f ize of the optio │ │ │ +0010ce20: 6e20 6461 7461 2c20 666f 6c6c 6f77 6564 n data, followed │ │ │ +0010ce30: 2062 7920 7468 6520 2862 696e 6172 7929 by the (binary) │ │ │ +0010ce40: 206f 7074 696f 6e20 6461 7461 2e3c 2f70 option data.

.

A call to < │ │ │ +0010ce60: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soap_en │ │ │ +0010cf30: 643c 2f61 3e3c 2f63 6f64 653e 2072 656d d rem │ │ │ +0010cf40: 6f76 6573 2061 6c6c 206f 6620 7468 6520 oves all of the │ │ │ +0010cf50: 7265 6365 6976 6564 2044 494d 4520 6461 received DIME da │ │ │ +0010cf60: 7461 2e20 546f 2070 7265 7365 7276 6520 ta. To preserve │ │ │ +0010cf70: 616e 2061 7474 6163 686d 656e 7420 696e an attachment in │ │ │ +0010cf80: 206d 656d 6f72 792c 2075 7365 203c 636f memory, use soap_unli │ │ │ +0010d060: 6e6b 3c2f 613e 3c2f 636f 6465 3e20 6f6e nk on │ │ │ +0010d070: 2074 6865 203c 636f 6465 3e70 7472 3c2f the ptr member of │ │ │ +0010d090: 7468 6520 3c63 6f64 653e 3c61 2063 6c61 the soap_mu │ │ │ +0010d110: 6c74 6970 6172 743c 2f61 3e3c 2f63 6f64 ltipart struct. The < │ │ │ +0010d130: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soap_un │ │ │ +0010d200: 6c69 6e6b 3c2f 613e 3c2f 636f 6465 3e20 link │ │ │ +0010d210: 6675 6e63 7469 6f6e 2063 616e 2062 6520 function can be │ │ │ +0010d220: 7573 6564 2074 6f20 7072 6576 656e 7420 used to prevent │ │ │ +0010d230: 6465 616c 6c6f 6361 7469 6f6e 206f 6620 deallocation of │ │ │ +0010d240: 6465 7365 7269 616c 697a 6564 2064 6174 deserialized dat │ │ │ +0010d250: 612e 3c2f 703e 0a3c 703e f09f 949d 203c a.

.

.... < │ │ │ +0010d260: 6120 6872 6566 3d22 2322 3e42 6163 6b20 a href="#">Back │ │ │ +0010d270: 746f 2074 6162 6c65 206f 6620 636f 6e74 to table of cont │ │ │ +0010d280: 656e 7473 3c2f 613e 3c2f 703e 0a3c 6832 ents

.

.Serializ │ │ │ +0010d2c0: 696e 6720 6269 6e61 7279 2064 6174 6120 ing binary data │ │ │ +0010d2d0: 7769 7468 2044 494d 4520 6174 7461 6368 with DIME attach │ │ │ +0010d2e0: 6d65 6e74 733c 2f68 323e 0a3c 703e 4269 ments

.

Bi │ │ │ +0010d2f0: 6e61 7279 2064 6174 6120 7374 6f72 6564 nary data stored │ │ │ +0010d300: 2069 6e20 6578 7465 6e64 6564 203c 636f in extended xsd__base64Bina │ │ │ +0010d390: 7279 3c2f 613e 3c2f 636f 6465 3e20 616e ry an │ │ │ +0010d3a0: 6420 3c63 6f64 653e 3c61 2063 6c61 7373 d │ │ │ +0010d410: 7873 645f 5f68 6578 4269 6e61 7279 3c2f xsd__hexBinary types │ │ │ +0010d430: 6361 6e20 6265 2073 6572 6961 6c69 7a65 can be serialize │ │ │ +0010d440: 6420 616e 6420 6465 7365 7269 616c 697a d and deserializ │ │ │ +0010d450: 6564 2061 7320 4449 4d45 2061 7474 6163 ed as DIME attac │ │ │ +0010d460: 686d 656e 7473 2077 6865 6e20 6f6e 6520 hments when one │ │ │ +0010d470: 6f72 206d 6f72 6520 6f66 2074 6865 2065 or more of the e │ │ │ +0010d480: 7874 7261 206d 656d 6265 7273 203c 636f xtra members id, type, │ │ │ +0010d4b0: 2061 6e64 203c 636f 6465 3e6f 7074 696f and optio │ │ │ +0010d4c0: 6e73 3c2f 636f 6465 3e20 6172 6520 6e6f ns are no │ │ │ +0010d4d0: 6e2d 4e55 4c4c 2e20 5468 6573 6520 6174 n-NULL. These at │ │ │ +0010d4e0: 7461 6368 6d65 6e74 7320 7769 6c6c 2062 tachments will b │ │ │ +0010d4f0: 6520 6175 746f 6d61 7469 6361 6c6c 7920 e automatically │ │ │ +0010d500: 7472 616e 736d 6974 7465 6420 7072 696f transmitted prio │ │ │ +0010d510: 7220 746f 2074 6865 2073 6571 7565 6e63 r to the sequenc │ │ │ +0010d520: 6520 6f66 2073 6563 6f6e 6461 7279 2044 e of secondary D │ │ │ +0010d530: 494d 4520 6174 7461 6368 6d65 6e74 7320 IME attachments │ │ │ +0010d540: 6465 6669 6e65 6420 6279 2074 6865 2075 defined by the u │ │ │ +0010d550: 7365 7220 7769 7468 203c 636f 6465 3e3c ser with < │ │ │ +0010d560: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ +0010d570: 663d 2267 726f 7570 5f5f 6772 6f75 705f f="group__group_ │ │ │ +0010d580: 5f64 696d 652e 6874 6d6c 2367 6137 3432 _dime.html#ga742 │ │ │ +0010d590: 6639 3638 3438 3137 3465 3237 6266 6338 f96848174e27bfc8 │ │ │ +0010d5a0: 6466 3734 3235 6238 3730 6634 6222 2074 df7425b870f4b" t │ │ │ +0010d5b0: 6974 6c65 3d22 4164 6420 6120 4449 4d45 itle="Add a DIME │ │ │ +0010d5c0: 2061 7474 6163 686d 656e 7420 746f 2074 attachment to t │ │ │ +0010d5d0: 6865 2053 4f41 502f 584d 4c20 6d65 7373 he SOAP/XML mess │ │ │ +0010d5e0: 6167 652e 223e 736f 6170 5f73 6574 5f64 age.">soap_set_d │ │ │ +0010d5f0: 696d 655f 6174 7461 6368 6d65 6e74 3c2f ime_attachment as exp │ │ │ +0010d610: 6c61 696e 6564 2069 6e20 7468 6520 7072 lained in the pr │ │ │ +0010d620: 6576 696f 7573 2073 6563 7469 6f6e 2e20 evious section. │ │ │ +0010d630: 5468 6520 7365 7269 616c 697a 6174 696f The serializatio │ │ │ +0010d640: 6e20 7072 6f63 6573 7320 6973 2061 7574 n process is aut │ │ │ +0010d650: 6f6d 6174 6564 2066 6f72 2053 4f41 5020 omated for SOAP │ │ │ +0010d660: 656e 636f 6465 6420 6d65 7373 6167 6573 encoded messages │ │ │ +0010d670: 2061 6e64 2044 494d 4520 6174 7461 6368 and DIME attach │ │ │ +0010d680: 6d65 6e74 7320 7769 6c6c 2062 6520 7365 ments will be se │ │ │ +0010d690: 6e64 2065 7665 6e20 7768 656e 203c 636f nd even when soap_set_dim │ │ │ +0010d720: 653c 2f61 3e3c 2f63 6f64 653e 206f 7220 e or │ │ │ +0010d730: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 soa │ │ │ +0010d7c0: 705f 7365 745f 6469 6d65 5f61 7474 6163 p_set_dime_attac │ │ │ +0010d7d0: 686d 656e 743c 2f61 3e3c 2f63 6f64 653e hment │ │ │ +0010d7e0: 2061 7265 206e 6f74 2075 7365 642e 2046 are not used. F │ │ │ +0010d7f0: 6f72 206e 6f6e 2d53 4f41 502d 656e 636f or non-SOAP-enco │ │ │ +0010d800: 6465 6420 6d65 7373 6167 6573 2073 7563 ded messages suc │ │ │ +0010d810: 6820 6173 2064 6f63 756d 656e 742f 6c69 h as document/li │ │ │ +0010d820: 7465 7261 6c20 6d65 7373 6167 6573 2079 teral messages y │ │ │ +0010d830: 6f75 206d 7573 7420 7374 696c 6c20 6361 ou must still ca │ │ │ +0010d840: 6c6c 203c 636f 6465 3e3c 6120 636c 6173 ll soap_s │ │ │ +0010d8c0: 6574 5f64 696d 653c 2f61 3e3c 2f63 6f64 et_dime to enable sen │ │ │ +0010d8e0: 6469 6e67 206d 6573 7361 6765 7320 7769 ding messages wi │ │ │ +0010d8f0: 7468 2061 7474 6163 686d 656e 7473 2e3c th attachments.< │ │ │ +0010d900: 2f70 3e0a 3c70 3e54 6f20 656e 6162 6c65 /p>.

To enable │ │ │ +0010d910: 2073 6572 6961 6c69 7a61 7469 6f6e 206f serialization o │ │ │ +0010d920: 6620 7468 6520 6461 7461 2061 7320 4449 f the data as DI │ │ │ +0010d930: 4d45 2061 7474 6163 686d 656e 7473 2069 ME attachments i │ │ │ +0010d940: 6e73 7465 6164 206f 6620 696e 6c69 6e65 nstead of inline │ │ │ +0010d950: 2062 6173 6536 342c 2077 6520 6578 7465 base64, we exte │ │ │ +0010d960: 6e64 2074 6865 203c 636f 6465 3e3c 6120 nd the xsd__ │ │ │ +0010d9e0: 6261 7365 3634 4269 6e61 7279 3c2f 613e base64Binary │ │ │ +0010d9f0: 3c2f 636f 6465 3e20 7479 7065 2077 6974 type wit │ │ │ +0010da00: 6820 7468 7265 6520 6164 6469 7469 6f6e h three addition │ │ │ +0010da10: 616c 206d 656d 6265 7273 3a3c 2f70 3e0a al members:

. │ │ │ +0010da20: 3c64 6976 2063 6c61 7373 3d22 6672 6167
st │ │ │ +0010da60: 7275 6374 203c 2f73 7061 6e3e 3c61 2063 ruct xsd__base64Bi │ │ │ +0010dab0: 6e61 7279 3c2f 613e 203c 2f64 6976 3e0a nary
. │ │ │ +0010dac0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
{
.
│ │ │ +0010daf0: 3c73 7061 6e20 636c 6173 733d 226b 6579 unsign │ │ │ +0010db10: 6564 3c2f 7370 616e 3e20 3c73 7061 6e20 ed char │ │ │ +0010db40: 2a3c 6120 636c 6173 733d 2263 6f64 6522 *__ptr< │ │ │ +0010dba0: 2f61 3e3b 203c 2f64 6976 3e0a 3c64 6976 /a>;
.
│ │ │ +0010dbc0: 2020 3c73 7061 6e20 636c 6173 733d 226b int< │ │ │ +0010dbe0: 2f73 7061 6e3e 203c 6120 636c 6173 733d /span> │ │ │ +0010dc40: 5f5f 7369 7a65 3c2f 613e 3b20 3c2f 6469 __size; .
char * │ │ │ +0010dc90: 3c61 2063 6c61 7373 3d22 636f 6465 2220 id; │ │ │ +0010dcf0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
..< │ │ │ +0010dda0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +0010ddb0: 3e20 2020 203c 7370 616e 2063 6c61 7373 > c │ │ │ +0010ddd0: 6861 723c 2f73 7061 6e3e 202a 3c61 2063 har *options │ │ │ +0010de40: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
};.
char * opti │ │ │ +0010df60: 6f6e 733c 2f64 6976 3e3c 6469 7620 636c ons
extr │ │ │ +0010df80: 6120 6d65 6d62 6572 3a20 4449 4d45 206f a member: DIME o │ │ │ +0010df90: 7074 696f 6e73 206f 7220 6120 6465 7363 ptions or a desc │ │ │ +0010dfa0: 7269 7074 696f 6e20 6f66 2074 6865 204d ription of the M │ │ │ +0010dfb0: 494d 4520 6174 7461 6368 6d65 6e74 206f IME attachment o │ │ │ +0010dfc0: 7220 4e55 4c4c 3c2f 6469 763e 3c64 6976 r NULL
< │ │ │ +0010dfe0: 623e 4465 6669 6e69 7469 6f6e 3a3c 2f62 b>Definition: stdsoap2.h:984 │ │ │ +0010e000: 323c 2f64 6976 3e3c 2f64 6976 3e0a 3c64 2
.
xsd__base │ │ │ +0010e0d0: 3634 4269 6e61 7279 3a3a 6964 3c2f 613e 64Binary::id │ │ │ +0010e0e0: 3c2f 6469 763e 3c64 6976 2063 6c61 7373
char * │ │ │ +0010e100: 2069 643c 2f64 6976 3e3c 6469 7620 636c id
extr │ │ │ +0010e120: 6120 6d65 6d62 6572 3a20 4e55 4c4c 2074 a member: NULL t │ │ │ +0010e130: 6f20 6765 6e65 7261 7465 2061 6e20 6964 o generate an id │ │ │ +0010e140: 206f 7220 6173 7369 676e 2074 6869 7320 or assign this │ │ │ +0010e150: 6d65 6d62 6572 2076 6172 6961 626c 6520 member variable │ │ │ +0010e160: 6120 756e 6971 7565 2055 5549 443c 2f64 a unique UUID
Definit │ │ │ +0010e190: 696f 6e3a 3c2f 623e 2073 7464 736f 6170 ion: stdsoap │ │ │ +0010e1a0: 322e 683a 3938 3430 3c2f 6469 763e 3c2f 2.h:9840
.< │ │ │ +0010e290: 6469 7620 636c 6173 733d 2274 7464 6563 div class="ttdec │ │ │ +0010e2a0: 6922 3e63 6861 7220 2a20 7479 7065 3c2f i">char * type
extra mem │ │ │ +0010e2d0: 6265 723a 204d 494d 4520 7479 7065 206f ber: MIME type o │ │ │ +0010e2e0: 6620 7468 6520 6461 7461 3c2f 6469 763e f the data
│ │ │ +0010e2f0: 3c64 6976 2063 6c61 7373 3d22 7474 6465
Definition │ │ │ +0010e310: 3a3c 2f62 3e20 7374 6473 6f61 7032 2e68 : stdsoap2.h │ │ │ +0010e320: 3a39 3834 313c 2f64 6976 3e3c 2f64 6976 :9841
.

The │ │ │ +0010e350: 3c63 6f64 653e 6964 3c2f 636f 6465 3e20 id │ │ │ +0010e360: 6d65 6d62 6572 2069 7320 666f 7220 6174 member is for at │ │ │ +0010e370: 7461 6368 6d65 6e74 2072 6566 6572 656e tachment referen │ │ │ +0010e380: 6369 6e67 2c20 7479 7069 6361 6c6c 7920 cing, typically │ │ │ +0010e390: 6120 636f 6e74 656e 7420 6964 2028 4349 a content id (CI │ │ │ +0010e3a0: 4429 206f 7220 6120 5555 4944 2077 6869 D) or a UUID whi │ │ │ +0010e3b0: 6368 2063 616e 2062 6520 6f62 7461 696e ch can be obtain │ │ │ +0010e3c0: 6564 2077 6974 6820 3c63 6f64 653e 3c61 ed with s │ │ │ +0010e450: 6f61 705f 7261 6e64 5f75 7569 643c 2f61 oap_rand_uuid, a type me │ │ │ +0010e480: 6d62 6572 2069 7320 7573 6564 2074 6f20 mber is used to │ │ │ +0010e490: 7370 6563 6966 7920 7468 6520 4d49 4d45 specify the MIME │ │ │ +0010e4a0: 2074 7970 6520 6f66 2074 6865 2064 6174 type of the dat │ │ │ +0010e4b0: 612c 2074 6865 203c 636f 6465 3e6f 7074 a, the opt │ │ │ +0010e4c0: 696f 6e73 3c2f 636f 6465 3e20 6d65 6d62 ions memb │ │ │ +0010e4d0: 6572 2069 7320 7573 6564 2074 6f20 7069 er is used to pi │ │ │ +0010e4e0: 6767 792d 6261 636b 2061 6464 6974 696f ggy-back additio │ │ │ +0010e4f0: 6e61 6c20 696e 666f 726d 6174 696f 6e20 nal information │ │ │ +0010e500: 7769 7468 2061 2044 494d 4520 6174 7461 with a DIME atta │ │ │ +0010e510: 6368 6d65 6e74 2e20 5468 6520 6f72 6465 chment. The orde │ │ │ +0010e520: 7220 6f66 2074 6865 2064 6563 6c61 7261 r of the declara │ │ │ +0010e530: 7469 6f6e 206f 6620 7468 6520 6d65 6d62 tion of the memb │ │ │ +0010e540: 6572 7320 6973 2073 6967 6e69 6669 6361 ers is significa │ │ │ +0010e550: 6e74 2e20 496e 2061 6464 6974 696f 6e2c nt. In addition, │ │ │ +0010e560: 206e 6f20 6f74 6865 7220 6d65 6d62 6572 no other member │ │ │ +0010e570: 7320 6f72 206d 6574 686f 6473 206d 6179 s or methods may │ │ │ +0010e580: 2062 6520 6465 636c 6172 6564 2062 6566 be declared bef │ │ │ +0010e590: 6f72 6520 616e 7920 6f66 2074 6865 7365 ore any of these │ │ │ +0010e5a0: 206d 656d 6265 7273 2069 6e20 7468 6520 members in the │ │ │ +0010e5b0: 7374 7275 6374 2f63 6c61 7373 2c20 6275 struct/class, bu │ │ │ +0010e5c0: 7420 6164 6469 7469 6f6e 616c 206d 656d t additional mem │ │ │ +0010e5d0: 6265 7273 2061 6e64 206d 6574 686f 6473 bers and methods │ │ │ +0010e5e0: 206d 6179 2061 7070 6561 7220 6166 7465 may appear afte │ │ │ +0010e5f0: 7220 7468 6520 6d65 6d62 6572 2064 6563 r the member dec │ │ │ +0010e600: 6c61 7261 7469 6f6e 732e 2054 6865 2065 larations. The e │ │ │ +0010e610: 7874 656e 6465 6420 3c63 6f64 653e 3c61 xtended xsd__hexBi │ │ │ +0010e690: 6e61 7279 3c2f 613e 3c2f 636f 6465 3e20 nary │ │ │ +0010e6a0: 7479 7065 2069 7320 7369 6d69 6c61 722e type is similar. │ │ │ +0010e6b0: 3c2f 703e 0a3c 703e 5468 6520 3c63 6f64

.

The id and │ │ │ +0010e6d0: 3c63 6f64 653e 7479 7065 3c2f 636f 6465 type members contai │ │ │ +0010e6f0: 6e20 7465 7874 2e20 5468 6520 7365 7420 n text. The set │ │ │ +0010e700: 7468 6520 4449 4d45 2d73 7065 6369 6669 the DIME-specifi │ │ │ +0010e710: 6320 6f70 7469 6f6e 7320 6d65 6d62 6572 c options member │ │ │ +0010e720: 2c20 796f 7520 6361 6e20 7573 6520 7468 , you can use th │ │ │ +0010e730: 6520 3c63 6f64 653e 3c61 2063 6c61 7373 e soap_dime │ │ │ +0010e7b0: 5f6f 7074 696f 6e3c 2f61 3e3c 2f63 6f64 _option function char *soap_dim │ │ │ +0010e7e0: 655f 6f70 7469 6f6e 2873 7472 7563 7420 e_option(struct │ │ │ +0010e7f0: 736f 6170 202a 736f 6170 2c20 756e 7369 soap *soap, unsi │ │ │ +0010e800: 676e 6564 2073 686f 7274 2074 7970 652c gned short type, │ │ │ +0010e810: 2063 6f6e 7374 2063 6861 7220 2a6f 7074 const char *opt │ │ │ +0010e820: 696f 6e29 3c2f 636f 6465 3e2e 3c2f 703e ion).

│ │ │ +0010e830: 0a3c 703e 5468 6973 2066 756e 6374 696f .

This functio │ │ │ +0010e840: 6e20 7265 7475 726e 7320 6120 7374 7269 n returns a stri │ │ │ +0010e850: 6e67 2077 6974 6820 7468 6973 2065 6e63 ng with this enc │ │ │ +0010e860: 6f64 696e 672e 2046 6f72 2065 7861 6d70 oding. For examp │ │ │ +0010e870: 6c65 3c2f 703e 0a3c 6469 7620 636c 6173 le

.
< │ │ │ +0010e8a0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +0010e8b0: 6f72 6422 3e73 7472 7563 7420 3c2f 7370 ord">struct xsd__b │ │ │ +0010e900: 6173 6536 3442 696e 6172 793c 2f61 3e20 ase64Binary │ │ │ +0010e910: 696d 6167 653b 203c 2f64 6976 3e0a 3c64 image;
. │ │ │ +0010e930: 696d 6167 652e 3c61 2063 6c61 7373 3d22 image._ │ │ │ +0010e990: 5f70 7472 3c2f 613e 203d 202e 2e2e 3b20 _ptr = ...; │ │ │ +0010e9a0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
image._ │ │ │ +0010e9c0: 5f73 697a 6520 3d20 2e2e 2e3b 203c 2f64 _size = ...; .
image.id = │ │ │ +0010e9f0: 203c 7370 616e 2063 6c61 7373 3d22 7374 &qu │ │ │ +0010ea10: 6f74 3b75 7569 643a 3039 3233 3335 3233 ot;uuid:09233523 │ │ │ +0010ea20: 2d33 3435 622d 3433 3531 2d62 3632 332d -345b-4351-b623- │ │ │ +0010ea30: 3564 7366 3335 7367 7335 6436 2671 756f 5dsf35sgs5d6&quo │ │ │ +0010ea40: 743b 3c2f 7370 616e 3e3b 203c 2f64 6976 t;;
.
image.type = │ │ │ +0010ea70: 203c 7370 616e 2063 6c61 7373 3d22 7374 &qu │ │ │ +0010ea90: 6f74 3b69 6d61 6765 2f6a 7065 6726 7175 ot;image/jpeg&qu │ │ │ +0010eaa0: 6f74 3b3c 2f73 7061 6e3e 3b20 3c2f 6469 ot;; .
image.optio │ │ │ +0010ead0: 6e73 203d 203c 6120 636c 6173 733d 2263 ns = soap_dime │ │ │ +0010eb30: 5f6f 7074 696f 6e3c 2f61 3e28 3c61 2063 _option(soap, 0, │ │ │ +0010eb70: 3c73 7061 6e20 636c 6173 733d 2273 7472 &quo │ │ │ +0010eb90: 743b 4d79 2077 6564 6469 6e67 2070 6963 t;My wedding pic │ │ │ +0010eba0: 7475 7265 2671 756f 743b 3c2f 7370 616e ture");
.
│ │ │ +0010ec20: 3c61 2068 7265 663d 2267 726f 7570 5f5f soap_dime_o │ │ │ +0010ec70: 7074 696f 6e3c 2f61 3e3c 2f64 6976 3e3c ption
< │ │ │ +0010ec80: 6469 7620 636c 6173 733d 2274 7464 6563 div class="ttdec │ │ │ +0010ec90: 6922 3e63 6861 7220 2a20 736f 6170 5f64 i">char * soap_d │ │ │ +0010eca0: 696d 655f 6f70 7469 6f6e 2873 7472 7563 ime_option(struc │ │ │ +0010ecb0: 7420 736f 6170 202a 736f 6170 2c20 756e t soap *soap, un │ │ │ +0010ecc0: 7369 676e 6564 2073 686f 7274 206f 7074 signed short opt │ │ │ +0010ecd0: 7970 652c 2063 6f6e 7374 2063 6861 7220 ype, const char │ │ │ +0010ece0: 2a6f 7074 696f 6e29 3c2f 6469 763e 3c64 *option)
Creates a DIME │ │ │ +0010ed10: 6f70 7469 6f6e 2e3c 2f64 6976 3e3c 2f64 option.
.

Wh │ │ │ +0010ed40: 656e 2065 6974 6865 7220 7468 6520 3c63 en either the id or │ │ │ +0010ed60: 203c 636f 6465 3e74 7970 653c 2f63 6f64 type member values │ │ │ +0010ed80: 2061 7265 206e 6f6e 2d4e 554c 4c20 6174 are non-NULL at │ │ │ +0010ed90: 2072 756e 2074 696d 652c 2074 6865 2064 run time, the d │ │ │ +0010eda0: 6174 6120 7769 6c6c 2062 6520 7365 7269 ata will be seri │ │ │ +0010edb0: 616c 697a 6564 2061 7320 6120 4449 4d45 alized as a DIME │ │ │ +0010edc0: 2061 7474 6163 686d 656e 742e 3c2f 703e attachment.

│ │ │ +0010edd0: 0a3c 703e 5468 6520 534f 4150 2f58 4d4c .

The SOAP/XML │ │ │ +0010ede0: 206d 6573 7361 6765 2072 6566 6572 7320 message refers │ │ │ +0010edf0: 746f 2074 6865 2061 7474 6163 686d 656e to the attachmen │ │ │ +0010ee00: 7473 2075 7369 6e67 203c 656d 3e3c 636f ts using href attributes. │ │ │ +0010ee30: 5468 6973 2067 656e 6572 616c 6c79 2077 This generally w │ │ │ +0010ee40: 6f72 6b73 2077 696c 6c20 7769 7468 2053 orks will with S │ │ │ +0010ee50: 4f41 5020 5250 4320 656e 636f 6465 6420 OAP RPC encoded │ │ │ +0010ee60: 6d65 7373 6167 696e 672c 2062 6563 6175 messaging, becau │ │ │ +0010ee70: 7365 203c 656d 3e3c 636f 6465 3e68 7265 se hre │ │ │ +0010ee80: 663c 2f63 6f64 653e 3c2f 656d 3e20 6174 f at │ │ │ +0010ee90: 7472 6962 7574 6573 2061 7265 2070 6572 tributes are per │ │ │ +0010eea0: 6d69 7474 6564 2e20 486f 7765 7665 722c mitted. However, │ │ │ +0010eeb0: 2077 6974 6820 646f 6375 6d65 6e74 2f6c with document/l │ │ │ +0010eec0: 6974 6572 616c 2073 7479 6c65 2074 6865 iteral style the │ │ │ +0010eed0: 2072 6566 6572 656e 6369 6e67 206d 6563 referencing mec │ │ │ +0010eee0: 6861 6e69 736d 206d 7573 7420 6265 2065 hanism must be e │ │ │ +0010eef0: 7870 6c69 6369 746c 7920 6465 6669 6e65 xplicitly define │ │ │ +0010ef00: 6420 696e 2074 6865 2073 6368 656d 6120 d in the schema │ │ │ +0010ef10: 6f66 2074 6865 2062 696e 6172 7920 7479 of the binary ty │ │ │ +0010ef20: 7065 2e20 5468 6572 6566 6f72 652c 204d pe. Therefore, M │ │ │ +0010ef30: 544f 4d20 6973 2074 6865 2070 7265 6665 TOM is the prefe │ │ │ +0010ef40: 7272 6564 2061 7474 6163 686d 656e 7420 rred attachment │ │ │ +0010ef50: 6d65 6368 616e 6973 6d20 666f 7220 646f mechanism for do │ │ │ +0010ef60: 6375 6d65 6e74 2f6c 6974 6572 616c 2073 cument/literal s │ │ │ +0010ef70: 7479 6c65 206d 6573 7361 6769 6e67 2e3c tyle messaging.< │ │ │ +0010ef80: 2f70 3e0a 3c70 3e54 6865 2064 6563 6c61 /p>.

The decla │ │ │ +0010ef90: 7261 7469 6f6e 206f 6620 616e 2065 7874 ration of an ext │ │ │ +0010efa0: 656e 6465 6420 6269 6e61 7279 2074 7970 ended binary typ │ │ │ +0010efb0: 6520 696e 2074 6865 2069 6e74 6572 6661 e in the interfa │ │ │ +0010efc0: 6365 2068 6561 6465 7220 6669 6c65 2066 ce header file f │ │ │ +0010efd0: 6f72 2073 6f61 7063 7070 3220 6973 3a3c or soapcpp2 is:< │ │ │ +0010efe0: 2f70 3e0a 3c64 6976 2063 6c61 7373 3d22 /p>.

struct │ │ │ +0010f030: 6e73 5f5f 6d79 4269 6e61 7279 4461 7461 ns__myBinaryData │ │ │ +0010f040: 5479 7065 203c 2f64 6976 3e0a 3c64 6976 Type
.
{< │ │ │ +0010f060: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
unsigned │ │ │ +0010f0c0: 6368 6172 3c2f 7370 616e 3e20 2a5f 5f70 char *__p │ │ │ +0010f0d0: 7472 3b20 3c2f 6469 763e 0a3c 6469 7620 tr;
.
│ │ │ +0010f0f0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 int __size; .
char │ │ │ +0010f160: 202a 6964 3b20 3c2f 6469 763e 0a3c 6469 *id;
. │ │ │ +0010f180: 2020 203c 7370 616e 2063 6c61 7373 3d22 cha │ │ │ +0010f1a0: 723c 2f73 7061 6e3e 202a 7479 7065 3b20 r *type; │ │ │ +0010f1b0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
char *options; .
};
.< │ │ │ +0010f220: 2f64 6976 3e3c 212d 2d20 6672 6167 6d65 /div>

C++ pro │ │ │ +0010f240: 6772 616d 6d65 7273 2063 616e 2075 7365 grammers can use │ │ │ +0010f250: 2069 6e68 6572 6974 616e 6365 2069 6e73 inheritance ins │ │ │ +0010f260: 7465 6164 206f 6620 7465 7874 7561 6c20 tead of textual │ │ │ +0010f270: 6578 7465 6e73 696f 6e20 7265 7175 6972 extension requir │ │ │ +0010f280: 6564 2069 6e20 433a 3c2f 703e 0a3c 6469 ed in C:

..
{ │ │ │ +0010f340: 3c73 7061 6e20 636c 6173 733d 226b 6579 public:
.
│ │ │ +0010f380: 203c 7370 616e 2063 6c61 7373 3d22 6b65 unsig │ │ │ +0010f3a0: 6e65 643c 2f73 7061 6e3e 203c 7370 616e ned char │ │ │ +0010f3d0: 202a 3c61 2063 6c61 7373 3d22 636f 6465 *__ptr │ │ │ +0010f430: 3c2f 613e 3b20 3c2f 6469 763e 0a3c 6469 ;
. │ │ │ +0010f450: 2020 203c 7370 616e 2063 6c61 7373 3d22 int │ │ │ +0010f470: 3c2f 7370 616e 3e20 3c61 2063 6c61 7373 __size; .
};
. │ │ │ +0010f500: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
class ns__myBinar │ │ │ +0010f540: 7944 6174 6154 7970 6520 3a20 3c73 7061 yDataType : public │ │ │ +0010f570: 3c61 2063 6c61 7373 3d22 636f 6465 2220 xsd__base │ │ │ +0010f5b0: 3634 4269 6e61 7279 3c2f 613e 203c 2f64 64Binary .
{ pu │ │ │ +0010f5f0: 626c 6963 3c2f 7370 616e 3e3a 3c2f 6469 blic:.
char * │ │ │ +0010f640: 6964 3b20 3c2f 6469 763e 0a3c 6469 7620 id;
.
│ │ │ +0010f660: 203c 7370 616e 2063 6c61 7373 3d22 6b65 char< │ │ │ +0010f680: 2f73 7061 6e3e 202a 7479 7065 3b20 3c2f /span> *type; .
char │ │ │ +0010f6d0: 202a 6f70 7469 6f6e 733b 203c 2f64 6976 *options;
.
};
.

This defi │ │ │ +0010f720: 6e65 7320 616e 2065 7874 656e 7369 6f6e nes an extension │ │ │ +0010f730: 206f 6620 3c65 6d3e 3c63 6f64 653e 7873 of xs │ │ │ +0010f740: 643a 6261 7365 3634 4269 6e61 7279 3c2f d:base64Binary, such │ │ │ +0010f760: 2074 6861 7420 7468 6520 6461 7461 2063 that the data c │ │ │ +0010f770: 616e 2062 6520 7365 7269 616c 697a 6564 an be serialized │ │ │ +0010f780: 2061 7320 4449 4d45 2061 7474 6163 686d as DIME attachm │ │ │ +0010f790: 656e 7473 2075 7369 6e67 203c 656d 3e3c ents using < │ │ │ +0010f7a0: 636f 6465 3e68 7265 663c 2f63 6f64 653e code>href │ │ │ +0010f7b0: 3c2f 656d 3e20 6174 7472 6962 7574 6573 attributes │ │ │ +0010f7c0: 2066 6f72 2072 6566 6572 656e 6369 6e67 for referencing │ │ │ +0010f7d0: 2e20 5768 656e 2061 2064 6966 6665 7265 . When a differe │ │ │ +0010f7e0: 6e74 2061 7474 7269 6275 7465 2069 7320 nt attribute is │ │ │ +0010f7f0: 746f 2062 6520 7573 6564 2c20 7468 6973 to be used, this │ │ │ +0010f800: 206d 7573 7420 6265 2065 7870 6c69 6369 must be explici │ │ │ +0010f810: 746c 7920 6465 6669 6e65 643a 3c2f 703e tly defined:

│ │ │ +0010f820: 0a3c 6469 7620 636c 6173 733d 2266 7261 .
/ │ │ │ +0010f860: 2f67 736f 6170 2057 5372 6566 2073 6368 /gsoap WSref sch │ │ │ +0010f870: 656d 6120 696d 706f 7274 3a20 6874 7470 ema import: http │ │ │ +0010f880: 3a2f 2f73 6368 656d 6173 2e78 6d6c 736f ://schemas.xmlso │ │ │ +0010f890: 6170 2e6f 7267 2f77 732f 3230 3032 2f30 ap.org/ws/2002/0 │ │ │ +0010f8a0: 342f 7265 6665 7265 6e63 652f 203c 2f73 4/reference/
.
struct ns__myBinaryDat │ │ │ +0010f900: 6154 7970 6520 3c2f 6469 763e 0a3c 6469 aType
.{ │ │ │ +0010f920: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
unsigned< │ │ │ +0010f960: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> char *__ │ │ │ +0010f990: 7074 723b 203c 2f64 6976 3e0a 3c64 6976 ptr;
.
│ │ │ +0010f9b0: 2020 3c73 7061 6e20 636c 6173 733d 226b int< │ │ │ +0010f9d0: 2f73 7061 6e3e 205f 5f73 697a 653b 203c /span> __size; < │ │ │ +0010f9e0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
char *id;
. │ │ │ +0010fa40: 2020 2020 3c73 7061 6e20 636c 6173 733d ch │ │ │ +0010fa60: 6172 3c2f 7370 616e 3e20 2a74 7970 653b ar *type; │ │ │ +0010fa70: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
char *options; .
@ char │ │ │ +0010fb00: 202a 5753 7265 665f 5f6c 6f63 6174 696f *WSref__locatio │ │ │ +0010fb10: 6e3b 203c 2f64 6976 3e0a 3c64 6976 2063 n;
.
};.

T │ │ │ +0010fb50: 6865 2065 7861 6d70 6c65 2061 626f 7665 he example above │ │ │ +0010fb60: 2075 7365 7320 7468 6520 3c65 6d3e 3c63 uses the location attribu │ │ │ +0010fb90: 7465 2064 6566 696e 6564 2069 6e20 7468 te defined in th │ │ │ +0010fba0: 6520 636f 6e74 656e 7420 7265 6665 7265 e content refere │ │ │ +0010fbb0: 6e63 6520 7363 6865 6d61 2c20 6173 2064 nce schema, as d │ │ │ +0010fbc0: 6566 696e 6564 2069 6e20 6f6e 6520 6f66 efined in one of │ │ │ +0010fbd0: 2074 6865 2076 656e 646f 7227 7320 7370 the vendor's sp │ │ │ +0010fbe0: 6563 6966 6963 2057 5344 4c20 6578 7465 ecific WSDL exte │ │ │ +0010fbf0: 6e73 696f 6e73 2066 6f72 2044 494d 4520 nsions for DIME │ │ │ +0010fc00: 3c61 2068 7265 663d 2268 7474 703a 2f2f http://www. │ │ │ +0010fc60: 676f 7464 6f74 6e65 742e 636f 6d2f 7465 gotdotnet.com/te │ │ │ +0010fc70: 616d 2f78 6d6c 5f77 7373 7065 6373 2f64 am/xml_wsspecs/d │ │ │ +0010fc80: 696d 652f 5753 444c 2d45 7874 656e 7369 ime/WSDL-Extensi │ │ │ +0010fc90: 6f6e 2d66 6f72 2d44 494d 452e 6874 6d3c on-for-DIME.htm< │ │ │ +0010fca0: 2f61 3e2e 3c2f 703e 0a3c 703e 5768 656e /a>.

.

When │ │ │ +0010fcb0: 2072 6563 6569 7669 6e67 2044 494d 4520 receiving DIME │ │ │ +0010fcc0: 6174 7461 6368 6d65 6e74 732c 2074 6865 attachments, the │ │ │ +0010fcd0: 2044 494d 4520 6d65 7461 2064 6174 6120 DIME meta data │ │ │ +0010fce0: 616e 6420 6269 6e61 7279 2063 6f6e 7465 and binary conte │ │ │ +0010fcf0: 6e74 2061 7265 2073 746f 7265 6420 696e nt are stored in │ │ │ +0010fd00: 2074 6865 2073 7065 6369 6669 6564 203c the specified < │ │ │ +0010fd10: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>xsd__base64Bi │ │ │ +0010fd90: 6e61 7279 3c2f 613e 3c2f 636f 6465 3e20 nary │ │ │ +0010fda0: 616e 6420 3c63 6f64 653e 3c61 2063 6c61 and xsd__hexBinary │ │ │ +0010fe20: 3c2f 613e 3c2f 636f 6465 3e20 6269 6e61 bina │ │ │ +0010fe30: 7279 2064 6174 6120 7479 7065 7320 6f6e ry data types on │ │ │ +0010fe40: 6c79 2077 6865 6e20 7468 6520 584d 4c20 ly when the XML │ │ │ +0010fe50: 7061 7274 7320 6f66 2074 6865 206d 6573 parts of the mes │ │ │ +0010fe60: 7361 6765 2075 7365 7320 3c65 6d3e 3c63 sage uses href< │ │ │ +0010fe80: 2f65 6d3e 2061 7474 7269 6275 7465 7320 /em> attributes │ │ │ +0010fe90: 746f 2072 6566 6572 2074 6f20 7468 6573 to refer to thes │ │ │ +0010fea0: 6520 6174 7461 6368 6d65 6e74 732e 2049 e attachments. I │ │ │ +0010feb0: 6620 736f 2c20 7468 6520 6269 6e61 7279 f so, the binary │ │ │ +0010fec0: 2064 6174 6120 7479 7065 203c 636f 6465 data type __ptr an │ │ │ +0010fee0: 6420 3c63 6f64 653e 5f5f 7369 7a65 3c2f d __size members ar │ │ │ +0010ff00: 6520 7365 7420 746f 2074 6865 206c 6f63 e set to the loc │ │ │ +0010ff10: 6174 696f 6e20 696e 206d 656d 6f72 7920 ation in memory │ │ │ +0010ff20: 6f66 2074 6865 2061 7474 6163 686d 656e of the attachmen │ │ │ +0010ff30: 7420 6461 7461 2061 6e64 206c 656e 6774 t data and lengt │ │ │ +0010ff40: 682c 2072 6573 7065 6374 6976 656c 792e h, respectively. │ │ │ +0010ff50: 3c2f 703e 0a3c 703e 4d65 7373 6167 6573

.

Messages │ │ │ +0010ff60: 206d 6179 2063 6f6e 7461 696e 2062 696e may contain bin │ │ │ +0010ff70: 6172 7920 6461 7461 2074 6861 7420 7265 ary data that re │ │ │ +0010ff80: 6665 7265 6e63 6573 2065 7874 6572 6e61 ferences externa │ │ │ +0010ff90: 6c20 7265 736f 7572 6365 7320 6e6f 7420 l resources not │ │ │ +0010ffa0: 7072 6f76 6964 6564 2061 7320 6174 7461 provided as atta │ │ │ +0010ffb0: 6368 6d65 6e74 732e 2049 6e20 7468 6174 chments. In that │ │ │ +0010ffc0: 2063 6173 652c 2074 6865 203c 636f 6465 case, the __ptr me │ │ │ +0010ffe0: 6d62 6572 2069 7320 4e55 4c4c 2061 6e64 mber is NULL and │ │ │ +0010fff0: 2074 6865 203c 636f 6465 3e69 643c 2f63 the id member refe │ │ │ +00110010: 7273 2074 6f20 7468 6520 6578 7465 726e rs to the extern │ │ │ +00110020: 616c 2064 6174 6120 736f 7572 6365 2e3c al data source.< │ │ │ +00110030: 2f70 3e0a 3c70 3e54 6865 203c 636f 6465 /p>.

The dime_id_format< │ │ │ +00110050: 2f63 6f64 653e 2061 7474 7269 6275 7465 /code> attribute │ │ │ +00110060: 206f 6620 7468 6520 6375 7272 656e 7420 of the current │ │ │ +00110070: 636f 6e74 6578 7420 6361 6e20 6265 2073 context can be s │ │ │ +00110080: 6574 2074 6f20 7468 6520 6465 6661 756c et to the defaul │ │ │ +00110090: 7420 666f 726d 6174 206f 6620 4449 4d45 t format of DIME │ │ │ +001100a0: 2069 6420 6d65 6d62 6572 732e 2054 6865 id members. The │ │ │ +001100b0: 2066 6f72 6d61 7420 7374 7269 6e67 206d format string m │ │ │ +001100c0: 7573 7420 636f 6e74 6169 6e20 6120 3c63 ust contain a d for │ │ │ +001100e0: 6d61 7420 7370 6563 6966 6965 7220 286f mat specifier (o │ │ │ +001100f0: 7220 616e 7920 6f74 6865 7220 3c63 6f64 r any other int-bas │ │ │ +00110110: 6564 2066 6f72 6d61 7420 7370 6563 6966 ed format specif │ │ │ +00110120: 6965 7229 2e20 5468 6520 7661 6c75 6520 ier). The value │ │ │ +00110130: 6f66 2074 6869 7320 7370 6563 6966 6965 of this specifie │ │ │ +00110140: 7220 6973 2061 206e 6f6e 2d6e 6567 6174 r is a non-negat │ │ │ +00110150: 6976 6520 696e 7465 6765 722c 2077 6974 ive integer, wit │ │ │ +00110160: 6820 7a65 726f 2062 6569 6e67 2074 6865 h zero being the │ │ │ +00110170: 2076 616c 7565 206f 6620 7468 6520 4449 value of the DI │ │ │ +00110180: 4d45 2061 7474 6163 686d 656e 7420 6964 ME attachment id │ │ │ +00110190: 2066 6f72 2074 6865 2053 4f41 5020 6d65 for the SOAP me │ │ │ +001101a0: 7373 6167 652e 2046 6f72 2065 7861 6d70 ssage. For examp │ │ │ +001101b0: 6c65 2c3c 2f70 3e0a 3c64 6976 2063 6c61 le,

.
.
soap< │ │ │ +00110310: 2f61 3e2d 2667 743b 3c61 2063 6c61 7373 /a>->dime_id_format< │ │ │ +00110370: 2f61 3e20 3d20 3c73 7061 6e20 636c 6173 /a> = "id-%x&qu │ │ │ +001103a0: 6f74 3b3c 2f73 7061 6e3e 3b20 3c2f 6469 ot;; .
co │ │ │ +00110480: 6e73 7420 6368 6172 202a 2064 696d 655f nst char * dime_ │ │ │ +00110490: 6964 5f66 6f72 6d61 743c 2f64 6976 3e3c id_format
< │ │ │ +001104a0: 6469 7620 636c 6173 733d 2274 7464 6f63 div class="ttdoc │ │ │ +001104b0: 223e 5573 6572 2d64 6566 696e 6162 6c65 ">User-definable │ │ │ +001104c0: 2066 6f72 6d61 7420 7374 7269 6e67 2074 format string t │ │ │ +001104d0: 6f20 6765 6e65 7261 7465 2044 494d 4520 o generate DIME │ │ │ +001104e0: 636f 6e74 656e 7420 4944 732e 3c2f 6469 content IDs.
Definiti │ │ │ +00110510: 6f6e 3a3c 2f62 3e20 7374 6473 6f61 7032 on: stdsoap2 │ │ │ +00110520: 2e68 3a34 3137 323c 2f64 6976 3e3c 2f64 .h:4172
.

As │ │ │ +00110550: 2061 2072 6573 756c 742c 2061 6c6c 2061 a result, all a │ │ │ +00110560: 7474 6163 686d 656e 7473 2077 6974 6820 ttachments with │ │ │ +00110570: 6120 4e55 4c4c 203c 636f 6465 3e69 643c a NULL id< │ │ │ +00110580: 2f63 6f64 653e 206d 656d 6265 7220 7769 /code> member wi │ │ │ +00110590: 6c6c 2075 7365 2061 2061 7574 6f2d 6765 ll use a auto-ge │ │ │ +001105a0: 6e65 7261 7465 6420 6964 2076 616c 7565 nerated id value │ │ │ +001105b0: 2062 6173 6564 206f 6e20 7468 6520 666f based on the fo │ │ │ +001105c0: 726d 6174 2073 7472 696e 672e 3c2f 703e rmat string.

│ │ │ +001105d0: 0a3c 646c 2063 6c61 7373 3d22 7365 6374 .
Warning
Care must be ta │ │ │ +00110610: 6b65 6e20 6e6f 7420 746f 2069 6e74 726f ken not to intro │ │ │ +00110620: 6475 6365 2064 7570 6c69 6361 7465 2063 duce duplicate c │ │ │ +00110630: 6f6e 7465 6e74 2069 6420 7661 6c75 6573 ontent id values │ │ │ +00110640: 2c20 7768 656e 2061 7373 6967 6e69 6e67 , when assigning │ │ │ +00110650: 2063 6f6e 7465 6e74 2069 6420 7661 6c75 content id valu │ │ │ +00110660: 6573 2074 6f20 7468 6520 6964 206d 656d es to the id mem │ │ │ +00110670: 6265 7273 206f 6620 4449 4d45 2065 7874 bers of DIME ext │ │ │ +00110680: 656e 6465 6420 6269 6e61 7279 2064 6174 ended binary dat │ │ │ +00110690: 6120 7479 7065 732e 2043 6f6e 7465 6e74 a types. Content │ │ │ +001106a0: 2069 6473 206d 7573 7420 6265 2075 6e69 ids must be uni │ │ │ +001106b0: 7175 652e 3c2f 6464 3e3c 2f64 6c3e 0a3c que.
.< │ │ │ +001106c0: 703e f09f 949d 203c 6120 6872 6566 3d22 p>.... Back to table │ │ │ +001106e0: 206f 6620 636f 6e74 656e 7473 3c2f 613e of contents │ │ │ +001106f0: 3c2f 703e 0a3c 6832 3e3c 6120 636c 6173

.

.Streaming DIM │ │ │ +00110730: 453c 2f68 323e 0a3c 703e 5374 7265 616d E

.

Stream │ │ │ +00110740: 696e 6720 4449 4d45 2069 7320 6163 6869 ing DIME is achi │ │ │ +00110750: 6576 6564 2077 6974 6820 6361 6c6c 6261 eved with callba │ │ │ +00110760: 636b 2066 756e 6374 696f 6e73 2074 6f20 ck functions to │ │ │ +00110770: 6665 7463 6820 616e 6420 7374 6f72 6520 fetch and store │ │ │ +00110780: 6461 7461 2064 7572 696e 6720 7472 616e data during tran │ │ │ +00110790: 736d 6973 7369 6f6e 2e20 5468 7265 6520 smission. Three │ │ │ +001107a0: 6675 6e63 7469 6f6e 2063 616c 6c62 6163 function callbac │ │ │ +001107b0: 6b73 2066 6f72 2073 7472 6561 6d69 6e67 ks for streaming │ │ │ +001107c0: 2044 494d 4520 6f75 7470 7574 2061 6e64 DIME output and │ │ │ +001107d0: 2074 6872 6565 2063 616c 6c62 6163 6b73 three callbacks │ │ │ +001107e0: 2066 6f72 2073 7472 6561 6d69 6e67 2044 for streaming D │ │ │ +001107f0: 494d 4520 696e 7075 7420 6172 6520 6176 IME input are av │ │ │ +00110800: 6169 6c61 626c 652e 3c2f 703e 0a3c 756c ailable.

.
    .
  • void │ │ │ +00110820: 202a 282a 736f 6170 2e66 6469 6d65 7265 *(*soap.fdimere │ │ │ +00110830: 6164 6f70 656e 2928 7374 7275 6374 2073 adopen)(struct s │ │ │ +00110840: 6f61 7020 2a73 6f61 702c 2076 6f69 6420 oap *soap, void │ │ │ +00110850: 2a68 616e 646c 652c 2063 6f6e 7374 2063 *handle, const c │ │ │ +00110860: 6861 7220 2a69 642c 2063 6f6e 7374 2063 har *id, const c │ │ │ +00110870: 6861 7220 2a74 7970 652c 2063 6f6e 7374 har *type, const │ │ │ +00110880: 2063 6861 7220 2a6f 7074 696f 6e73 293c char *options)< │ │ │ +00110890: 2f63 6f64 653e 2054 6869 7320 6361 6c6c /code> This call │ │ │ +001108a0: 6261 636b 2069 7320 6361 6c6c 6564 2062 back is called b │ │ │ +001108b0: 7920 7468 6520 656e 6769 6e65 2074 6f20 y the engine to │ │ │ +001108c0: 7374 6172 7420 7365 6e64 696e 6720 6120 start sending a │ │ │ +001108d0: 7374 7265 616d 696e 6720 4449 4d45 2061 streaming DIME a │ │ │ +001108e0: 7474 6163 686d 656e 742e 2054 6869 7320 ttachment. This │ │ │ +001108f0: 6361 6c6c 6261 636b 206f 7065 6e73 2061 callback opens a │ │ │ +00110900: 2073 7472 6561 6d20 746f 2073 7461 7274 stream to start │ │ │ +00110910: 2072 6561 6469 6e67 2074 6865 2061 7474 reading the att │ │ │ +00110920: 6163 686d 656e 7420 6461 7461 2074 6f20 achment data to │ │ │ +00110930: 7365 6e64 2e20 5468 6520 6163 7475 616c send. The actual │ │ │ +00110940: 2064 6174 6120 7374 7265 616d 2077 696c data stream wil │ │ │ +00110950: 6c20 6265 2072 6561 6420 696e 2063 6875 l be read in chu │ │ │ +00110960: 6e6b 7320 7573 696e 6720 7468 6520 3c63 nks using the soap::fdimer │ │ │ +00110a10: 6561 643c 2f61 3e3c 2f63 6f64 653e 2063 ead c │ │ │ +00110a20: 616c 6c62 6163 6b20 756e 7469 6c20 6e6f allback until no │ │ │ +00110a30: 206d 6f72 6520 6461 7461 2069 7320 6176 more data is av │ │ │ +00110a40: 6169 6c61 626c 6520 616e 6420 7468 6520 ailable and the │ │ │ +00110a50: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 soa │ │ │ +00110af0: 703a 3a66 6469 6d65 7265 6164 636c 6f73 p::fdimereadclos │ │ │ +00110b00: 653c 2f61 3e3c 2f63 6f64 653e 2063 616c e cal │ │ │ +00110b10: 6c62 6163 6b20 6973 2063 616c 6c65 6420 lback is called │ │ │ +00110b20: 746f 2063 6c6f 7365 2074 6865 2073 7472 to close the str │ │ │ +00110b30: 6561 6d2e 2054 6865 203c 636f 6465 3e68 eam. The h │ │ │ +00110b40: 616e 646c 653c 2f63 6f64 653e 2070 6172 andle par │ │ │ +00110b50: 616d 6574 6572 2063 6f6e 7461 696e 7320 ameter contains │ │ │ +00110b60: 7468 6520 7661 6c75 6520 6f66 2074 6865 the value of the │ │ │ +00110b70: 203c 636f 6465 3e5f 5f70 7472 3c2f 636f __ptr member varia │ │ │ +00110b90: 626c 6520 6f66 2074 6865 2061 7474 6163 ble of the attac │ │ │ +00110ba0: 686d 656e 7420 7374 7275 6374 2f63 6c61 hment struct/cla │ │ │ +00110bb0: 7373 2077 6974 6820 6461 7461 2028 652e ss with data (e. │ │ │ +00110bc0: 672e 203c 636f 6465 3e3c 6120 636c 6173 g. xsd__base │ │ │ +00110c40: 3634 4269 6e61 7279 3c2f 613e 3c2f 636f 64Binary or _xop__Include │ │ │ +00110cd0: 3c2f 613e 3c2f 636f 6465 3e20 7769 7468 with │ │ │ +00110ce0: 203c 636f 6465 3e5f 5f70 7472 3c2f 636f __ptr, __siz │ │ │ +00110d00: 653c 2f63 6f64 653e 2c20 3c63 6f64 653e e, │ │ │ +00110d10: 6964 3c2f 636f 6465 3e2c 203c 636f 6465 id, type and │ │ │ +00110d30: 203c 636f 6465 3e6f 7074 696f 6e73 3c2f options members), │ │ │ +00110d50: 7768 6963 6820 7368 6f75 6c64 2062 6520 which should be │ │ │ +00110d60: 6120 706f 696e 7465 7220 746f 2073 7065 a pointer to spe │ │ │ +00110d70: 6369 6669 6320 696e 666f 726d 6174 696f cific informatio │ │ │ +00110d80: 6e20 7375 6368 2061 7320 6120 6669 6c65 n such as a file │ │ │ +00110d90: 2064 6573 6372 6970 746f 7220 6f72 2061 descriptor or a │ │ │ +00110da0: 2070 6f69 6e74 6572 2074 6f20 6120 736f pointer to a so │ │ │ +00110db0: 6d65 2061 7070 6c69 6361 7469 6f6e 2d73 me application-s │ │ │ +00110dc0: 7065 6369 6669 6320 6461 7461 2074 6f20 pecific data to │ │ │ +00110dd0: 6265 2070 6173 7365 6420 746f 2074 6869 be passed to thi │ │ │ +00110de0: 7320 6361 6c6c 6261 636b 2e20 426f 7468 s callback. Both │ │ │ +00110df0: 2074 6865 203c 636f 6465 3e5f 5f70 7472 the __ptr │ │ │ +00110e00: 3c2f 636f 6465 3e20 616e 6420 3c63 6f64 and __size │ │ │ +00110e20: 6d65 6d62 6572 7320 6f66 2074 6865 2061 members of the a │ │ │ +00110e30: 7474 6163 686d 656e 7420 7374 7275 6374 ttachment struct │ │ │ +00110e40: 2f63 6c61 7373 2073 686f 756c 6420 6861 /class should ha │ │ │ +00110e50: 7665 2062 6565 6e20 7365 7420 6279 2074 ve been set by t │ │ │ +00110e60: 6865 2061 7070 6c69 6361 7469 6f6e 2070 he application p │ │ │ +00110e70: 7269 6f72 2074 6f20 7468 6520 7365 7269 rior to the seri │ │ │ +00110e80: 616c 697a 6174 696f 6e20 6f66 2074 6865 alization of the │ │ │ +00110e90: 206d 6573 7361 6765 2077 6974 6820 6174 message with at │ │ │ +00110ea0: 7461 6368 6d65 6e74 732e 2049 6620 7468 tachments. If th │ │ │ +00110eb0: 6520 3c63 6f64 653e 5f5f 7369 7a65 3c2f e __size is zero an │ │ │ +00110ed0: 6420 4854 5450 2063 6875 6e6b 696e 6720 d HTTP chunking │ │ │ +00110ee0: 6973 2065 6e61 626c 6564 2028 7769 7468 is enabled (with │ │ │ +00110ef0: 203c 636f 6465 3e23 534f 4150 5f49 4f5f #SOAP_IO_ │ │ │ +00110f00: 4348 554e 4b3c 2f63 6f64 653e 292c 2074 CHUNK), t │ │ │ +00110f10: 6865 6e20 6368 756e 6b65 6420 4449 4d45 hen chunked DIME │ │ │ +00110f20: 2061 7474 6163 686d 656e 7473 2061 7265 attachments are │ │ │ +00110f30: 2073 656e 742c 2073 6565 203c 636f 6465 sent, see soap::fdimeread │ │ │ +00110fe0: 3c2f 613e 3c2f 636f 6465 3e2e 2054 6865 . The │ │ │ +00110ff0: 203c 636f 6465 3e69 643c 2f63 6f64 653e id │ │ │ +00111000: 2c20 3c63 6f64 653e 7479 7065 3c2f 636f , type and op │ │ │ +00111020: 7469 6f6e 733c 2f63 6f64 653e 2070 6172 tions par │ │ │ +00111030: 616d 6574 6572 7320 6172 6520 7468 6520 ameters are the │ │ │ +00111040: 3c63 6f64 653e 6964 3c2f 636f 6465 3e20 id │ │ │ +00111050: 286f 7074 696f 6e61 6c20 4944 292c 203c (optional ID), < │ │ │ +00111060: 636f 6465 3e74 7970 653c 2f63 6f64 653e code>type │ │ │ +00111070: 2028 6120 4d49 4d45 2074 7970 6529 2061 (a MIME type) a │ │ │ +00111080: 6e64 203c 636f 6465 3e6f 7074 696f 6e73 nd options │ │ │ +00111090: 3c2f 636f 6465 3e20 2844 494d 4520 6f70 (DIME op │ │ │ +001110a0: 7469 6f6e 7320 6172 6520 7365 7420 7769 tions are set wi │ │ │ +001110b0: 7468 203c 636f 6465 3e3c 6120 636c 6173 th soap_dim │ │ │ +00111130: 655f 6f70 7469 6f6e 3c2f 613e 3c2f 636f e_option) of the atta │ │ │ +00111150: 6368 6d65 6e74 2073 7472 7563 742f 636c chment struct/cl │ │ │ +00111160: 6173 732c 2072 6573 7065 6374 6976 656c ass, respectivel │ │ │ +00111170: 792c 206f 6620 7768 6963 6820 6174 206c y, of which at l │ │ │ +00111180: 6561 7374 206f 6e65 206d 656d 6265 7220 east one member │ │ │ +00111190: 7368 6f75 6c64 2062 6520 6e6f 6e2d 4e55 should be non-NU │ │ │ +001111a0: 4c4c 2e20 5468 6520 6361 6c6c 6261 636b LL. The callback │ │ │ +001111b0: 2073 686f 756c 6420 7265 7475 726e 2074 should return t │ │ │ +001111c0: 6865 203c 636f 6465 3e68 616e 646c 653c he handle< │ │ │ +001111d0: 2f63 6f64 653e 2070 6172 616d 6574 6572 /code> parameter │ │ │ +001111e0: 2076 616c 7565 206f 7220 616e 6f74 6865 value or anothe │ │ │ +001111f0: 7220 706f 696e 7465 7220 7661 6c75 652c r pointer value, │ │ │ +00111200: 2077 6869 6368 2069 7320 7061 7373 6564 which is passed │ │ │ +00111210: 2061 7320 7468 6520 6e65 7720 3c63 6f64 as the new handle │ │ │ +00111230: 7061 7261 6d65 7465 7220 746f 203c 636f parameter to soap::fdimere │ │ │ +001112e0: 6164 3c2f 613e 3c2f 636f 6465 3e20 616e ad an │ │ │ +001112f0: 6420 3c63 6f64 653e 3c61 2063 6c61 7373 d s │ │ │ +00111390: 6f61 703a 3a66 6469 6d65 7265 6164 636c oap::fdimereadcl │ │ │ +001113a0: 6f73 653c 2f61 3e3c 2f63 6f64 653e 2063 ose c │ │ │ +001113b0: 616c 6c62 6163 6b73 2e20 5768 656e 2061 allbacks. When a │ │ │ +001113c0: 6e20 6572 726f 7220 6f63 6375 7272 6564 n error occurred │ │ │ +001113d0: 2069 6e20 7468 6973 2063 616c 6c62 6163 in this callbac │ │ │ +001113e0: 6b2c 2074 6865 2063 616c 6c62 6163 6b20 k, the callback │ │ │ +001113f0: 7368 6f75 6c64 2072 6574 7572 6e20 4e55 should return NU │ │ │ +00111400: 4c4c 2061 6e64 2073 6574 203c 636f 6465 LL and set soap::err │ │ │ +001114c0: 6f72 3c2f 613e 3c2f 636f 6465 3e20 746f or to │ │ │ +001114d0: 2061 6e20 6572 726f 7220 636f 6465 2c20 an error code, │ │ │ +001114e0: 652e 672e 2075 7369 6e67 203c 636f 6465 e.g. using soap_receiver_f │ │ │ +001115a0: 6175 6c74 3c2f 613e 3c2f 636f 6465 3e2e ault. │ │ │ +001115b0: 2054 6865 2063 616c 6c62 6163 6b20 6d61 The callback ma │ │ │ +001115c0: 7920 7265 7475 726e 204e 554c 4c20 616e y return NULL an │ │ │ +001115d0: 6420 7365 7420 3c63 6f64 653e 3c61 2063 d set soap::error to #SOAP_OK when this spec │ │ │ +001116c0: 6966 6963 2044 494d 4520 6174 7461 6368 ific DIME attach │ │ │ +001116d0: 6d65 6e74 2073 686f 756c 6420 6e6f 7420 ment should not │ │ │ +001116e0: 746f 2062 6520 7374 7265 616d 6564 2061 to be streamed a │ │ │ +001116f0: 6e64 2074 6865 2065 6e67 696e 6520 7769 nd the engine wi │ │ │ +00111700: 6c6c 2073 696d 706c 7920 736b 6970 2069 ll simply skip i │ │ │ +00111710: 742e 3c2f 6c69 3e0a 3c6c 693e 3c63 6f64 t.
  • .
  • size_t (*soap. │ │ │ +00111730: 6664 696d 6572 6561 6429 2873 7472 7563 fdimeread)(struc │ │ │ +00111740: 7420 736f 6170 202a 736f 6170 2c20 766f t soap *soap, vo │ │ │ +00111750: 6964 202a 6861 6e64 6c65 2c20 6368 6172 id *handle, char │ │ │ +00111760: 202a 6275 662c 2073 697a 655f 7420 6c65 *buf, size_t le │ │ │ +00111770: 6e29 3c2f 636f 6465 3e20 5468 6973 2063 n) This c │ │ │ +00111780: 616c 6c62 6163 6b20 6973 2063 616c 6c65 allback is calle │ │ │ +00111790: 6420 6279 2074 6865 2065 6e67 696e 6520 d by the engine │ │ │ +001117a0: 746f 2072 6561 6420 6120 6368 756e 6b20 to read a chunk │ │ │ +001117b0: 6f66 2061 7474 6163 686d 656e 7420 6461 of attachment da │ │ │ +001117c0: 7461 2074 6f20 7472 616e 736d 6974 2e20 ta to transmit. │ │ │ +001117d0: 5468 6520 3c63 6f64 653e 6861 6e64 6c65 The handle │ │ │ +001117e0: 3c2f 636f 6465 3e20 7061 7261 6d65 7465 paramete │ │ │ +001117f0: 7220 636f 6e74 6169 6e73 2074 6865 2068 r contains the h │ │ │ +00111800: 616e 646c 6520 7265 7475 726e 6564 2062 andle returned b │ │ │ +00111810: 7920 7468 6520 3c63 6f64 653e 3c61 2063 y the soap::fdimere │ │ │ +001118c0: 6164 6f70 656e 3c2f 613e 3c2f 636f 6465 adopen callback. The │ │ │ +001118e0: 3c63 6f64 653e 6275 663c 2f63 6f64 653e buf │ │ │ +001118f0: 2070 6172 616d 6574 6572 2069 7320 7468 parameter is th │ │ │ +00111900: 6520 6275 6666 6572 206f 6620 6c65 6e67 e buffer of leng │ │ │ +00111910: 7468 203c 636f 6465 3e6c 656e 3c2f 636f th len into which a │ │ │ +00111930: 2063 6875 6e6b 206f 6620 6461 7461 2073 chunk of data s │ │ │ +00111940: 686f 756c 6420 6265 2077 7269 7474 656e hould be written │ │ │ +00111950: 2062 7920 7468 6520 6361 6c6c 6261 636b by the callback │ │ │ +00111960: 2e20 5468 6520 6163 7475 616c 2061 6d6f . The actual amo │ │ │ +00111970: 756e 7420 6f66 2064 6174 6120 7772 6974 unt of data writ │ │ │ +00111980: 7465 6e20 696e 746f 2074 6865 2062 7566 ten into the buf │ │ │ +00111990: 6665 7220 6d61 7920 6265 206c 6573 7320 fer may be less │ │ │ +001119a0: 7468 616e 203c 636f 6465 3e6c 656e 3c2f than len and this a │ │ │ +001119c0: 6374 7561 6c20 616d 6f75 6e74 2073 686f ctual amount sho │ │ │ +001119d0: 756c 6420 6265 2072 6574 7572 6e65 6420 uld be returned │ │ │ +001119e0: 6279 2074 6865 2063 616c 6c62 6163 6b2e by the callback. │ │ │ +001119f0: 2041 2072 6574 7572 6e20 7661 6c75 6520 A return value │ │ │ +00111a00: 6f66 207a 6572 6f20 696e 6469 6361 7465 of zero indicate │ │ │ +00111a10: 7320 616e 2065 7272 6f72 2061 6e64 203c s an error and < │ │ │ +00111a20: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soap: │ │ │ +00111ad0: 3a65 7272 6f72 3c2f 613e 3c2f 636f 6465 :error should be set. │ │ │ +00111af0: 2054 6865 203c 636f 6465 3e5f 5f73 697a The __siz │ │ │ +00111b00: 653c 2f63 6f64 653e 206d 656d 6265 7220 e member │ │ │ +00111b10: 7661 7269 6162 6c65 206f 6620 7468 6520 variable of the │ │ │ +00111b20: 6174 7461 6368 6d65 6e74 2073 7472 7563 attachment struc │ │ │ +00111b30: 742f 636c 6173 7320 7769 7468 2064 6174 t/class with dat │ │ │ +00111b40: 6120 2865 2e67 2e20 3c63 6f64 653e 3c61 a (e.g. xsd_ │ │ │ +00111bc0: 5f62 6173 6536 3442 696e 6172 793c 2f61 _base64Binary or _xop__In │ │ │ +00111c50: 636c 7564 653c 2f61 3e3c 2f63 6f64 653e clude │ │ │ +00111c60: 2077 6974 6820 3c63 6f64 653e 5f5f 7074 with __pt │ │ │ +00111c70: 723c 2f63 6f64 653e 2c20 3c63 6f64 653e r, │ │ │ +00111c80: 5f5f 7369 7a65 3c2f 636f 6465 3e2c 203c __size, < │ │ │ +00111c90: 636f 6465 3e69 643c 2f63 6f64 653e 2c20 code>id, │ │ │ +00111ca0: 3c63 6f64 653e 7479 7065 3c2f 636f 6465 type and opti │ │ │ +00111cc0: 6f6e 733c 2f63 6f64 653e 206d 656d 6265 ons membe │ │ │ +00111cd0: 7273 2920 7368 6f75 6c64 2062 6520 7365 rs) should be se │ │ │ +00111ce0: 7420 6279 2074 6865 2061 7070 6c69 6361 t by the applica │ │ │ +00111cf0: 7469 6f6e 2070 7269 6f72 2074 6f20 7468 tion prior to th │ │ │ +00111d00: 6520 7365 7269 616c 697a 6174 696f 6e20 e serialization │ │ │ +00111d10: 6f66 2074 6865 206d 6573 7361 6765 2077 of the message w │ │ │ +00111d20: 6974 6820 6174 7461 6368 6d65 6e74 732e ith attachments. │ │ │ +00111d30: 2054 6865 2076 616c 7565 206f 6620 3c63 The value of __size indicates the │ │ │ +00111d60: 746f 7461 6c20 7369 7a65 206f 6620 7468 total size of th │ │ │ +00111d70: 6520 6174 7461 6368 6d65 6e74 2064 6174 e attachment dat │ │ │ +00111d80: 6120 746f 2062 6520 7472 616e 736d 6974 a to be transmit │ │ │ +00111d90: 7465 642e 2049 6620 7468 6520 3c63 6f64 ted. If the __size │ │ │ +00111db0: 6d65 6d62 6572 2076 6172 6961 626c 6520 member variable │ │ │ +00111dc0: 6973 207a 6572 6f20 616e 6420 4854 5450 is zero and HTTP │ │ │ +00111dd0: 2063 6875 6e6b 696e 6720 6973 2065 6e61 chunking is ena │ │ │ +00111de0: 626c 6564 2028 7769 7468 203c 636f 6465 bled (with #SOAP_IO_CHUNK< │ │ │ +00111e00: 2f63 6f64 653e 292c 2074 6865 6e20 4449 /code>), then DI │ │ │ +00111e10: 4d45 2063 6875 6e6b 6564 2074 7261 6e73 ME chunked trans │ │ │ +00111e20: 6665 7273 2061 7265 2061 6374 6976 6174 fers are activat │ │ │ +00111e30: 6564 2062 7920 7468 6520 656e 6769 6e65 ed by the engine │ │ │ +00111e40: 2c20 7768 6963 6820 6973 206d 6f72 6520 , which is more │ │ │ +00111e50: 666c 6578 6962 6c65 2073 696e 6365 2074 flexible since t │ │ │ +00111e60: 6865 2061 7474 6163 686d 656e 7420 6461 he attachment da │ │ │ +00111e70: 7461 2073 697a 6520 646f 6573 206e 6f74 ta size does not │ │ │ +00111e80: 206e 6565 6420 746f 2062 6520 6465 7465 need to be dete │ │ │ +00111e90: 726d 696e 6564 2069 6e20 6164 7661 6e63 rmined in advanc │ │ │ +00111ea0: 652e 2054 6f20 7573 6520 4449 4d45 2063 e. To use DIME c │ │ │ +00111eb0: 6875 6e6b 6564 2074 7261 6e73 6665 7273 hunked transfers │ │ │ +00111ec0: 2c20 656e 6162 6c65 2048 5454 5020 6368 , enable HTTP ch │ │ │ +00111ed0: 756e 6b69 6e67 2077 6974 6820 3c63 6f64 unking with #SOAP_IO_CHUNK │ │ │ +00111ef0: 3c2f 636f 6465 3e20 2861 6c73 6f20 3c63 (also #SOAP_IO_STO │ │ │ +00111f10: 5245 3c2f 636f 6465 3e20 6361 6e20 6265 RE can be │ │ │ +00111f20: 2075 7365 642c 2062 7574 2074 6869 7320 used, but this │ │ │ +00111f30: 6275 6666 6572 7320 7468 6520 656e 7469 buffers the enti │ │ │ +00111f40: 7265 206d 6573 7361 6765 2069 6e20 6d65 re message in me │ │ │ +00111f50: 6d6f 7279 2062 6566 6f72 6520 7472 616e mory before tran │ │ │ +00111f60: 736d 6973 7369 6f6e 2920 616e 6420 7365 smission) and se │ │ │ +00111f70: 7420 7468 6520 3c63 6f64 653e 5f5f 7369 t the __si │ │ │ +00111f80: 7a65 3c2f 636f 6465 3e20 6d65 6d62 6572 ze member │ │ │ +00111f90: 2076 6172 6961 626c 6520 6f66 2074 6865 variable of the │ │ │ +00111fa0: 2061 7474 6163 686d 656e 7420 7374 7275 attachment stru │ │ │ +00111fb0: 6374 2f63 6c61 7373 2074 6f20 7a65 726f ct/class to zero │ │ │ +00111fc0: 2e20 5768 656e 2044 494d 4520 6174 7461 . When DIME atta │ │ │ +00111fd0: 6368 6d65 6e74 2063 6875 6e6b 696e 6720 chment chunking │ │ │ +00111fe0: 6973 2065 6e61 626c 6564 2c20 7468 6973 is enabled, this │ │ │ +00111ff0: 2063 616c 6c62 6163 6b20 7368 6f75 6c64 callback should │ │ │ +00112000: 2063 6f6d 706c 6574 656c 7920 6669 6c6c completely fill │ │ │ +00112010: 2074 6865 203c 636f 6465 3e62 7566 3c2f the buf buffer wit │ │ │ +00112030: 6820 3c63 6f64 653e 6c65 6e3c 2f63 6f64 h len bytes unless │ │ │ +00112050: 7468 6520 6c61 7374 2064 6174 6120 6368 the last data ch │ │ │ +00112060: 756e 6b20 6973 2072 6561 6368 6564 2061 unk is reached a │ │ │ +00112070: 6e64 2066 6577 6572 2062 7974 6573 2061 nd fewer bytes a │ │ │ +00112080: 7265 2072 6574 7572 6e65 642e 3c2f 6c69 re returned.
  • .
  • void │ │ │ +001120a0: 2028 2a73 6f61 702e 6664 696d 6572 6561 (*soap.fdimerea │ │ │ +001120b0: 6463 6c6f 7365 2928 7374 7275 6374 2073 dclose)(struct s │ │ │ +001120c0: 6f61 7020 2a73 6f61 702c 2076 6f69 6420 oap *soap, void │ │ │ +001120d0: 2a68 616e 646c 6529 3c2f 636f 6465 3e20 *handle) │ │ │ +001120e0: 5468 6973 2063 616c 6c62 6163 6b20 6973 This callback is │ │ │ +001120f0: 2063 616c 6c65 6420 6279 2074 6865 2065 called by the e │ │ │ +00112100: 6e67 696e 6520 746f 2063 6c6f 7365 2074 ngine to close t │ │ │ +00112110: 6865 2044 494d 4520 6174 7461 6368 6d65 he DIME attachme │ │ │ +00112120: 6e74 2073 7472 6561 6d20 6166 7465 7220 nt stream after │ │ │ +00112130: 7265 6164 696e 672e 2054 6865 203c 636f reading. The handle │ │ │ +00112150: 2070 6172 616d 6574 6572 2063 6f6e 7461 parameter conta │ │ │ +00112160: 696e 7320 7468 6520 6861 6e64 6c65 2072 ins the handle r │ │ │ +00112170: 6574 7572 6e65 6420 6279 2074 6865 203c eturned by the < │ │ │ +00112180: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soap │ │ │ +00112220: 3a3a 6664 696d 6572 6561 646f 7065 6e3c ::fdimereadopen< │ │ │ +00112230: 2f61 3e3c 2f63 6f64 653e 2063 616c 6c62 /a> callb │ │ │ +00112240: 6163 6b2e 3c2f 6c69 3e0a 3c6c 693e 3c63 ack.
  • .
  • void *(*soap │ │ │ +00112260: 2e66 6469 6d65 7772 6974 656f 7065 6e29 .fdimewriteopen) │ │ │ +00112270: 2873 7472 7563 7420 736f 6170 202a 736f (struct soap *so │ │ │ +00112280: 6170 2c20 636f 6e73 7420 6368 6172 202a ap, const char * │ │ │ +00112290: 6964 2c20 636f 6e73 7420 6368 6172 202a id, const char * │ │ │ +001122a0: 7479 7065 2c20 636f 6e73 7420 6368 6172 type, const char │ │ │ +001122b0: 202a 6f70 7469 6f6e 7329 3c2f 636f 6465 *options) Called by the │ │ │ +001122d0: 746f 2073 7461 7274 2072 6563 6569 7669 to start receivi │ │ │ +001122e0: 6e67 2061 2073 7472 6561 6d69 6e67 2044 ng a streaming D │ │ │ +001122f0: 494d 4520 6174 7461 6368 6d65 6e74 2e20 IME attachment. │ │ │ +00112300: 5468 6973 2063 616c 6c62 6163 6b20 6f70 This callback op │ │ │ +00112310: 656e 7320 6120 7374 7265 616d 2074 6f20 ens a stream to │ │ │ +00112320: 7374 6172 7420 7772 6974 696e 6720 7468 start writing th │ │ │ +00112330: 6520 6174 7461 6368 6d65 6e74 2064 6174 e attachment dat │ │ │ +00112340: 6120 7265 6365 6976 6564 2e20 5468 6520 a received. The │ │ │ +00112350: 6163 7475 616c 2064 6174 6120 7374 7265 actual data stre │ │ │ +00112360: 616d 2077 696c 6c20 6265 2077 7269 7474 am will be writt │ │ │ +00112370: 656e 2069 6e20 6368 756e 6b73 2075 7369 en in chunks usi │ │ │ +00112380: 6e67 2074 6865 203c 636f 6465 3e3c 6120 ng the so │ │ │ +00112420: 6170 3a3a 6664 696d 6577 7269 7465 3c2f ap::fdimewrite callba │ │ │ +00112440: 636b 2075 6e74 696c 206e 6f20 6d6f 7265 ck until no more │ │ │ +00112450: 2064 6174 6120 6973 2061 7661 696c 6162 data is availab │ │ │ +00112460: 6c65 2061 6e64 2074 6865 203c 636f 6465 le and the soap::fd │ │ │ +00112510: 696d 6577 7269 7465 636c 6f73 653c 2f61 imewriteclose callbac │ │ │ +00112530: 6b20 6973 2063 616c 6c65 6420 746f 2063 k is called to c │ │ │ +00112540: 6c6f 7365 2074 6865 2073 7472 6561 6d2e lose the stream. │ │ │ +00112550: 2054 6865 203c 636f 6465 3e69 643c 2f63 The id, type │ │ │ +00112570: 3c2f 636f 6465 3e20 616e 6420 3c63 6f64 and options │ │ │ +00112590: 2070 6172 616d 6574 6572 7320 6172 6520 parameters are │ │ │ +001125a0: 7468 6520 3c63 6f64 653e 6964 3c2f 636f the id, type< │ │ │ +001125c0: 2f63 6f64 653e 2061 6e64 203c 636f 6465 /code> and options │ │ │ +001125e0: 6f66 2074 6865 2061 7474 6163 686d 656e of the attachmen │ │ │ +001125f0: 7420 7374 7275 6374 2f63 6c61 7373 2028 t struct/class ( │ │ │ +00112600: 652e 672e 203c 636f 6465 3e3c 6120 636c e.g. xsd__ba │ │ │ +00112680: 7365 3634 4269 6e61 7279 3c2f 613e 3c2f se64Binary or < │ │ │ +001126a0: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ +001126b0: 663d 2273 7472 7563 745f 5f78 6f70 5f5f f="struct__xop__ │ │ │ +001126c0: 5f5f 5f69 6e63 6c75 6465 2e68 746d 6c22 ___include.html" │ │ │ +001126d0: 2074 6974 6c65 3d22 584f 5020 696e 636c title="XOP incl │ │ │ +001126e0: 7564 6520 7374 7275 6374 7572 6520 7769 ude structure wi │ │ │ +001126f0: 7468 2061 7474 6163 686d 656e 7420 6461 th attachment da │ │ │ +00112700: 7461 2e22 3e5f 786f 705f 5f49 6e63 6c75 ta.">_xop__Inclu │ │ │ +00112710: 6465 3c2f 613e 3c2f 636f 6465 3e20 7769 de wi │ │ │ +00112720: 7468 203c 636f 6465 3e5f 5f70 7472 3c2f th __ptr, __s │ │ │ +00112740: 697a 653c 2f63 6f64 653e 2c20 3c63 6f64 ize, id, type a │ │ │ +00112770: 6e64 203c 636f 6465 3e6f 7074 696f 6e73 nd options │ │ │ +00112780: 3c2f 636f 6465 3e20 6d65 6d62 6572 7329 members) │ │ │ +00112790: 2c20 7265 7370 6563 7469 7665 6c79 2e20 , respectively. │ │ │ +001127a0: 5468 6520 6361 6c6c 6261 636b 2073 686f The callback sho │ │ │ +001127b0: 756c 6420 7265 7475 726e 2061 2068 616e uld return a han │ │ │ +001127c0: 646c 652c 2077 6869 6368 2069 7320 7061 dle, which is pa │ │ │ +001127d0: 7373 6564 2074 6f20 7468 6520 3c63 6f64 ssed to the soap::fdimewr │ │ │ +00112880: 6974 653c 2f61 3e3c 2f63 6f64 653e 2061 ite a │ │ │ +00112890: 6e64 203c 636f 6465 3e3c 6120 636c 6173 nd │ │ │ +00112930: 736f 6170 3a3a 6664 696d 6577 7269 7465 soap::fdimewrite │ │ │ +00112940: 636c 6f73 653c 2f61 3e3c 2f63 6f64 653e close │ │ │ +00112950: 2063 616c 6c62 6163 6b73 2e20 5468 6520 callbacks. The │ │ │ +00112960: 3c63 6f64 653e 5f5f 7074 723c 2f63 6f64 __ptr member variab │ │ │ +00112980: 6c65 206f 6620 7468 6520 6174 7461 6368 le of the attach │ │ │ +00112990: 6d65 6e74 2073 7472 7563 742f 636c 6173 ment struct/clas │ │ │ +001129a0: 7320 6973 2073 6574 2062 7920 7468 6520 s is set by the │ │ │ +001129b0: 656e 6769 6e65 2074 6f20 7468 6520 7661 engine to the va │ │ │ +001129c0: 6c75 6520 6f66 2074 6869 7320 6861 6e64 lue of this hand │ │ │ +001129d0: 6c65 2e20 5468 6520 3c63 6f64 653e 5f5f le. The __ │ │ │ +001129e0: 7369 7a65 3c2f 636f 6465 3e20 6d65 6d62 size memb │ │ │ +001129f0: 6572 2076 6172 6961 626c 6520 6973 2073 er variable is s │ │ │ +00112a00: 6574 2074 6f20 7468 6520 7369 7a65 206f et to the size o │ │ │ +00112a10: 6620 7468 6520 6174 7461 6368 6d65 6e74 f the attachment │ │ │ +00112a20: 2072 6563 6569 7665 642e 2054 6865 206d received. The m │ │ │ +00112a30: 6178 696d 756d 2044 494d 4520 6174 7461 aximum DIME atta │ │ │ +00112a40: 6368 6d65 6e74 2073 697a 6520 7265 6365 chment size rece │ │ │ +00112a50: 6976 6564 2069 7320 6c69 6d69 7465 6420 ived is limited │ │ │ +00112a60: 6279 203c 636f 6465 3e23 534f 4150 5f4d by #SOAP_M │ │ │ +00112a70: 4158 4449 4d45 5349 5a45 3c2f 636f 6465 AXDIMESIZE.
  • .
  • int (*soap.fdi │ │ │ +00112aa0: 6d65 7772 6974 6529 2873 7472 7563 7420 mewrite)(struct │ │ │ +00112ab0: 736f 6170 202a 736f 6170 2c20 766f 6964 soap *soap, void │ │ │ +00112ac0: 202a 6861 6e64 6c65 2c20 636f 6e73 7420 *handle, const │ │ │ +00112ad0: 6368 6172 202a 6275 662c 2073 697a 655f char *buf, size_ │ │ │ +00112ae0: 7420 6c65 6e29 3c2f 636f 6465 3e20 5468 t len) Th │ │ │ +00112af0: 6973 2063 616c 6c62 6163 6b20 6973 2063 is callback is c │ │ │ +00112b00: 616c 6c65 6420 6279 2074 6865 2065 6e67 alled by the eng │ │ │ +00112b10: 696e 6520 746f 2077 7269 7465 2061 2063 ine to write a c │ │ │ +00112b20: 6875 6e6b 206f 6620 6174 7461 6368 6d65 hunk of attachme │ │ │ +00112b30: 6e74 2064 6174 6120 7265 6365 6976 6564 nt data received │ │ │ +00112b40: 2e20 5468 6520 3c63 6f64 653e 6861 6e64 . The hand │ │ │ +00112b50: 6c65 3c2f 636f 6465 3e20 7061 7261 6d65 le parame │ │ │ +00112b60: 7465 7220 636f 6e74 6169 6e73 2074 6865 ter contains the │ │ │ +00112b70: 2068 616e 646c 6520 7265 7475 726e 6564 handle returned │ │ │ +00112b80: 2062 7920 7468 6520 3c63 6f64 653e 3c61 by the soap::fdime │ │ │ +00112c30: 7772 6974 656f 7065 6e3c 2f61 3e3c 2f63 writeopen callback. T │ │ │ +00112c50: 6865 203c 636f 6465 3e62 7566 3c2f 636f he buf parameter co │ │ │ +00112c70: 6e74 6169 6e73 2074 6865 2064 6174 6120 ntains the data │ │ │ +00112c80: 6f66 206c 656e 6774 6820 3c63 6f64 653e of length │ │ │ +00112c90: 6c65 6e3c 2f63 6f64 653e 2e20 5265 7475 len. Retu │ │ │ +00112ca0: 726e 7320 3c63 6f64 653e 2353 4f41 505f rns #SOAP_ │ │ │ +00112cb0: 4f4b 3c2f 636f 6465 3e20 6f72 2061 203c OK or a < │ │ │ +00112cc0: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soap_statu │ │ │ +00112d80: 733c 2f61 3e3c 2f63 6f64 653e 2028 696e s (in │ │ │ +00112d90: 7429 2065 7272 6f72 2063 6f64 652e 3c2f t) error code..
  • vo │ │ │ +00112db0: 6964 2028 2a73 6f61 702e 6664 696d 6577 id (*soap.fdimew │ │ │ +00112dc0: 7269 7465 636c 6f73 6529 2873 7472 7563 riteclose)(struc │ │ │ +00112dd0: 7420 736f 6170 202a 736f 6170 2c20 766f t soap *soap, vo │ │ │ +00112de0: 6964 202a 6861 6e64 6c65 293c 2f63 6f64 id *handle) This callback │ │ │ +00112e00: 2069 7320 6361 6c6c 6564 2062 7920 7468 is called by th │ │ │ +00112e10: 6520 656e 6769 6e65 2074 6f20 636c 6f73 e engine to clos │ │ │ +00112e20: 6520 7468 6520 4449 4d45 2061 7474 6163 e the DIME attac │ │ │ +00112e30: 686d 656e 7420 7374 7265 616d 2061 6674 hment stream aft │ │ │ +00112e40: 6572 2077 7269 7469 6e67 2e20 5468 6520 er writing. The │ │ │ +00112e50: 3c63 6f64 653e 6861 6e64 6c65 3c2f 636f handle parameter co │ │ │ +00112e70: 6e74 6169 6e73 2074 6865 2068 616e 646c ntains the handl │ │ │ +00112e80: 6520 7265 7475 726e 6564 2062 7920 7468 e returned by th │ │ │ +00112e90: 6520 3c63 6f64 653e 3c61 2063 6c61 7373 e s │ │ │ +00112f30: 6f61 703a 3a66 6469 6d65 7772 6974 656f oap::fdimewriteo │ │ │ +00112f40: 7065 6e3c 2f61 3e3c 2f63 6f64 653e 2063 pen c │ │ │ +00112f50: 616c 6c62 6163 6b2e 3c2f 6c69 3e0a 3c2f allback.
  • ..

    In additi │ │ │ +00112f70: 6f6e 2c20 6120 3c63 6f64 653e 766f 6964 on, a void │ │ │ +00112f80: 2a20 3c61 2063 6c61 7373 3d22 656c 2220 * soap:: │ │ │ +00113040: 7573 6572 3c2f 613e 3c2f 636f 6465 3e20 user │ │ │ +00113050: 6d65 6d62 6572 2069 7320 6176 6169 6c61 member is availa │ │ │ +00113060: 626c 6520 746f 2070 6173 7320 7573 6572 ble to pass user │ │ │ +00113070: 2d64 6566 696e 6564 2064 6174 6120 746f -defined data to │ │ │ +00113080: 2074 6865 2063 616c 6c62 6163 6b73 2e20 the callbacks. │ │ │ +00113090: 5468 6973 2077 6179 2c20 796f 7520 6361 This way, you ca │ │ │ +001130a0: 6e20 7365 7420 3c63 6f64 653e 766f 6964 n set void │ │ │ +001130b0: 2a20 3c61 2063 6c61 7373 3d22 656c 2220 * soap:: │ │ │ +00113170: 7573 6572 3c2f 613e 3c2f 636f 6465 3e20 user │ │ │ +00113180: 746f 2070 6f69 6e74 2074 6f20 6170 706c to point to appl │ │ │ +00113190: 6963 6174 696f 6e20 6461 7461 2074 6861 ication data tha │ │ │ +001131a0: 7420 7468 6520 6361 6c6c 6261 636b 7320 t the callbacks │ │ │ +001131b0: 6e65 6564 2073 7563 6820 6173 2061 2066 need such as a f │ │ │ +001131c0: 696c 6520 6e61 6d65 2066 6f72 2065 7861 ile name for exa │ │ │ +001131d0: 6d70 6c65 2e3c 2f70 3e0a 3c70 3e54 6865 mple.

    .

    The │ │ │ +001131e0: 2066 6f6c 6c6f 7769 6e67 2065 7861 6d70 following examp │ │ │ +001131f0: 6c65 2069 6c6c 7573 7472 6174 6573 2074 le illustrates t │ │ │ +00113200: 6865 2063 6c69 656e 742d 7369 6465 2069 he client-side i │ │ │ +00113210: 6e69 7469 616c 697a 6174 696f 6e20 6f66 nitialization of │ │ │ +00113220: 2061 6e20 696d 6167 6520 6174 7461 6368 an image attach │ │ │ +00113230: 6d65 6e74 2073 7472 7563 7420 746f 2073 ment struct to s │ │ │ +00113240: 7472 6561 6d20 6120 6669 6c65 2069 6e74 tream a file int │ │ │ +00113250: 6f20 6120 4449 4d45 2061 7474 6163 686d o a DIME attachm │ │ │ +00113260: 656e 743a 3c2f 703e 0a3c 6469 7620 636c ent:

    .
    < │ │ │ +00113280: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +00113290: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >int main() .
    {
    . │ │ │ +001132f0: 2020 3c73 7061 6e20 636c 6173 733d 226b struct < │ │ │ +00113310: 2f73 7061 6e3e 3c61 2063 6c61 7373 3d22 /span>soa │ │ │ +00113340: 703c 2f61 3e20 3c61 2063 6c61 7373 3d22 p soa │ │ │ +00113370: 703c 2f61 3e3b 203c 2f64 6976 3e0a 3c64 p;
    . │ │ │ +00113390: 2020 3c73 7061 6e20 636c 6173 733d 226b struct < │ │ │ +001133b0: 2f73 7061 6e3e 3c61 2063 6c61 7373 3d22 /span>xsd │ │ │ +001133f0: 5f5f 6261 7365 3634 4269 6e61 7279 3c2f __base64Binary image;
│ │ │ +00113410: 0a3c 6469 7620 636c 6173 733d 226c 696e .
FILE *fd; < │ │ │ +00113430: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ +00113460: 7374 7275 6374 203c 2f73 7061 6e3e 7374 struct st │ │ │ +00113470: 6174 2073 623b 203c 2f64 6976 3e0a 3c64 at sb;
. │ │ │ +00113490: 2020 3c61 2063 6c61 7373 3d22 636f 6465
soap_init │ │ │ +001134f0: 3c2f 613e 2826 616d 703b 3c61 2063 6c61 (&soap); .
if (!fst │ │ │ +00113570: 6174 2866 696c 656e 6f28 6664 292c 2026 at(fileno(fd), & │ │ │ +00113580: 616d 703b 7362 2920 2661 6d70 3b26 616d amp;sb) &&am │ │ │ +00113590: 703b 2073 622e 7374 5f73 697a 6520 2667 p; sb.st_size &g │ │ │ +001135a0: 743b 2030 2920 3c2f 6469 763e 0a3c 6469 t; 0)
. │ │ │ +001135c0: 207b 3c2f 6469 763e 0a3c 6469 7620 636c {
.
< │ │ │ +001135e0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ +001135f0: 656e 7422 3e2f 2f20 6265 6361 7573 6520 ent">// because │ │ │ +00113600: 7765 2063 616e 2067 6574 2074 6865 206c we can get the l │ │ │ +00113610: 656e 6774 6820 6f66 2074 6865 2066 696c ength of the fil │ │ │ +00113620: 652c 2077 6520 6361 6e20 7374 7265 616d e, we can stream │ │ │ +00113630: 2069 7420 3c2f 7370 616e 3e3c 2f64 6976 it
.
s │ │ │ +00113680: 6f61 703c 2f61 3e2e 3c61 2063 6c61 7373 oap.f │ │ │ +001136e0: 6469 6d65 7265 6164 6f70 656e 3c2f 613e dimereadopen │ │ │ +001136f0: 203d 2064 696d 655f 7265 6164 5f6f 7065 = dime_read_ope │ │ │ +00113700: 6e3b 203c 2f64 6976 3e0a 3c64 6976 2063 n;
.
│ │ │ +00113720: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap. │ │ │ +00113750: 3c61 2063 6c61 7373 3d22 636f 6465 2220 fdimeread │ │ │ +001137b0: 636c 6f73 653c 2f61 3e20 3d20 6469 6d65 close = dime │ │ │ +001137c0: 5f72 6561 645f 636c 6f73 653b 203c 2f64 _read_close; .
soap.fdimeread = │ │ │ +00113880: 2064 696d 655f 7265 6164 3b20 3c2f 6469 dime_read; .
image._ │ │ │ +001138b0: 5f70 7472 203d 2028 3c73 7061 6e20 636c _ptr = (unsigned char │ │ │ +00113900: 3c2f 7370 616e 3e2a 2966 643b 203c 7370 *)fd; // must set t │ │ │ +00113930: 6f20 6e6f 6e2d 4e55 4c4c 2028 7468 6973 o non-NULL (this │ │ │ +00113940: 2069 7320 6f75 7220 6664 2068 616e 646c is our fd handl │ │ │ +00113950: 6520 7768 6963 6820 7765 206e 6565 6420 e which we need │ │ │ +00113960: 696e 2074 6865 2063 616c 6c62 6163 6b73 in the callbacks │ │ │ +00113970: 2920 3c2f 7370 616e 3e3c 2f64 6976 3e0a )
. │ │ │ +00113980: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
image.__si │ │ │ +001139a0: 7a65 203d 2073 622e 7374 5f73 697a 653b ze = sb.st_size; │ │ │ +001139b0: 203c 7370 616e 2063 6c61 7373 3d22 636f // must s │ │ │ +001139d0: 6574 2073 697a 6520 3c2f 7370 616e 3e3c et size < │ │ │ +001139e0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
} .
else .
{
. │ │ │ +00113a60: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
// d │ │ │ +00113a90: 6f6e 2623 3339 3b74 206b 6e6f 7720 7468 on't know th │ │ │ +00113aa0: 6520 7369 7a65 2c20 736f 2062 7566 6665 e size, so buffe │ │ │ +00113ab0: 7220 6974 203c 2f73 7061 6e3e 3c2f 6469 r it .
size_t │ │ │ +00113b00: 2069 3b20 3c2f 6469 763e 0a3c 6469 7620 i;
.
│ │ │ +00113b20: 203c 7370 616e 2063 6c61 7373 3d22 6b65 int c;
. │ │ │ +00113b50: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
image.__pt │ │ │ +00113b70: 7220 3d20 283c 7370 616e 2063 6c61 7373 r = (u │ │ │ +00113b90: 6e73 6967 6e65 643c 2f73 7061 6e3e 203c nsigned < │ │ │ +00113ba0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +00113bb0: 6f72 6474 7970 6522 3e63 6861 723c 2f73 ordtype">char*)soap_ │ │ │ +00113c20: 6d61 6c6c 6f63 3c2f 613e 2826 616d 703b malloc(& │ │ │ +00113c30: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap, │ │ │ +00113c60: 204d 4158 5f46 494c 455f 5349 5a45 293b MAX_FILE_SIZE); │ │ │ +00113c70: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
for (i = 0; i < │ │ │ +00113cc0: 3b20 4d41 585f 4649 4c45 5f53 495a 453b ; MAX_FILE_SIZE; │ │ │ +00113cd0: 2069 2b2b 2920 3c2f 6469 763e 0a3c 6469 i++)
. │ │ │ +00113cf0: 2020 207b 3c2f 6469 763e 0a3c 6469 7620 {
.
│ │ │ +00113d10: 2020 203c 7370 616e 2063 6c61 7373 3d22 if< │ │ │ +00113d30: 2f73 7061 6e3e 2028 2863 203d 2066 6765 /span> ((c = fge │ │ │ +00113d40: 7463 2866 6429 2920 3d3d 2045 4f46 2920 tc(fd)) == EOF) │ │ │ +00113d50: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ +00113d70: 203c 7370 616e 2063 6c61 7373 3d22 6b65 break │ │ │ +00113d90: 3c2f 7370 616e 3e3b 203c 2f64 6976 3e0a ;
. │ │ │ +00113da0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
image.__ │ │ │ +00113dc0: 7074 725b 695d 203d 2063 3b20 3c2f 6469 ptr[i] = c; .
}
.
fclose(f │ │ │ +00113e10: 6429 3b20 3c2f 6469 763e 0a3c 6469 7620 d);
.
│ │ │ +00113e30: 2069 6d61 6765 2e5f 5f73 697a 6520 3d20 image.__size = │ │ │ +00113e40: 693b 203c 2f64 6976 3e0a 3c64 6976 2063 i;
.
} │ │ │ +00113e60: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
image │ │ │ +00113e80: 2e74 7970 6520 3d20 3c73 7061 6e20 636c .type = "image/ │ │ │ +00113eb0: 6a70 6567 2671 756f 743b 3c2f 7370 616e jpeg";
.
im │ │ │ +00113ee0: 6167 652e 6f70 7469 6f6e 7320 3d20 3c61 age.options = │ │ │ +00113f40: 736f 6170 5f64 696d 655f 6f70 7469 6f6e soap_dime_option │ │ │ +00113f50: 3c2f 613e 2826 616d 703b 3c61 2063 6c61 (&soap, 0, " │ │ │ +00113fb0: 4d79 2070 6963 7475 7265 2671 756f 743b My picture" │ │ │ +00113fc0: 3c2f 7370 616e 3e29 3b20 3c2f 6469 763e );
│ │ │ +00113fd0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
i │ │ │ +00114000: 663c 2f73 7061 6e3e 2028 736f 6170 5f63 f (soap_c │ │ │ +00114010: 616c 6c5f 6e73 5f5f 7765 626d 6574 686f all_ns__webmetho │ │ │ +00114020: 6428 2661 6d70 3b3c 6120 636c 6173 733d d(&so │ │ │ +00114050: 6170 3c2f 613e 2c20 2e2e 2e29 293c 2f64 ap, ...)).
... // error
.
else
.
│ │ │ +00114100: 2e2e 2e20 3c73 7061 6e20 636c 6173 733d ... // suc │ │ │ +00114120: 6365 7373 3c2f 7370 616e 3e3c 2f64 6976 cess
.
}
. │ │ │ +00114160: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
void * │ │ │ +001141a0: 6469 6d65 5f72 6561 645f 6f70 656e 283c dime_read_open(< │ │ │ +001141b0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +001141c0: 6f72 6422 3e73 7472 7563 743c 2f73 7061 ord">struct soap *soap< │ │ │ +00114230: 2f61 3e2c 203c 7370 616e 2063 6c61 7373 /a>, v │ │ │ +00114250: 6f69 643c 2f73 7061 6e3e 202a 6861 6e64 oid *hand │ │ │ +00114260: 6c65 2c20 3c73 7061 6e20 636c 6173 733d le, const< │ │ │ +00114280: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> char *id, const │ │ │ +00114310: 6368 6172 3c2f 7370 616e 3e20 2a74 7970 char *typ │ │ │ +00114320: 652c 203c 7370 616e 2063 6c61 7373 3d22 e, const │ │ │ +00114360: 6368 6172 3c2f 7370 616e 3e20 2a6f 7074 char *opt │ │ │ +00114370: 696f 6e73 2920 3c2f 6469 763e 0a3c 6469 ions)
.{ │ │ │ +00114390: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
return handle;
.
}
. │ │ │ +00114410: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
..
{.
fclose( │ │ │ +00114550: 2846 494c 452a 2968 616e 646c 6529 3b20 (FILE*)handle); │ │ │ +00114560: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
}
.
.
size_t dime_read( │ │ │ +001145e0: 3c73 7061 6e20 636c 6173 733d 226b 6579 struct soap< │ │ │ +00114630: 2f61 3e20 2a3c 6120 636c 6173 733d 2263 /a> *soap │ │ │ +00114660: 3c2f 613e 2c20 3c73 7061 6e20 636c 6173 , │ │ │ +00114680: 766f 6964 3c2f 7370 616e 3e20 2a68 616e void *han │ │ │ +00114690: 646c 652c 203c 7370 616e 2063 6c61 7373 dle, c │ │ │ +001146b0: 6861 723c 2f73 7061 6e3e 202a 6275 662c har *buf, │ │ │ +001146c0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 size_ │ │ │ +001146e0: 743c 2f73 7061 6e3e 206c 656e 2920 3c2f t len) .
{
.< │ │ │ +00114710: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +00114720: 3e20 203c 7370 616e 2063 6c61 7373 3d22 > ret │ │ │ +00114740: 7572 6e3c 2f73 7061 6e3e 2066 7265 6164 urn fread │ │ │ +00114750: 2862 7566 2c20 312c 206c 656e 2c20 2846 (buf, 1, len, (F │ │ │ +00114760: 494c 452a 2968 616e 646c 6529 3b20 3c2f ILE*)handle); .
}
.< │ │ │ +00114790: 6469 7620 636c 6173 733d 2274 7463 2220 div class="ttc" │ │ │ +001147a0: 6964 3d22 6167 726f 7570 5f5f 6772 6f75 id="agroup__grou │ │ │ +001147b0: 705f 5f63 616c 6c62 6163 6b73 5f68 746d p__callbacks_htm │ │ │ +001147c0: 6c5f 6761 3036 3834 3535 6365 3431 3762 l_ga068455ce417b │ │ │ +001147d0: 6464 6231 3633 3664 3464 3536 3565 3065 ddb1636d4d565e0e │ │ │ +001147e0: 6266 3536 223e 3c64 6976 2063 6c61 7373 bf56">
void *(* fd │ │ │ +00114880: 696d 6572 6561 646f 7065 6e29 2873 7472 imereadopen)(str │ │ │ +00114890: 7563 7420 736f 6170 202a 736f 6170 2c20 uct soap *soap, │ │ │ +001148a0: 766f 6964 202a 6861 6e64 6c65 2c20 636f void *handle, co │ │ │ +001148b0: 6e73 7420 6368 6172 202a 6964 2c20 636f nst char *id, co │ │ │ +001148c0: 6e73 7420 6368 6172 202a 7479 7065 2c20 nst char *type, │ │ │ +001148d0: 636f 6e73 7420 6368 6172 202a 6f70 7469 const char *opti │ │ │ +001148e0: 6f6e 7329 3c2f 6469 763e 3c64 6976 2063 ons)
Cal │ │ │ +00114900: 6c62 6163 6b20 746f 206f 7065 6e20 6120 lback to open a │ │ │ +00114910: 7374 7265 616d 696e 6720 4449 4d45 2061 streaming DIME a │ │ │ +00114920: 7474 6163 686d 656e 7420 666f 7220 7265 ttachment for re │ │ │ +00114930: 6164 696e 672e 3c2f 6469 763e 3c64 6976 ading.
< │ │ │ +00114950: 623e 4465 6669 6e69 7469 6f6e 3a3c 2f62 b>Definition: stdsoap2.h:469 │ │ │ +00114970: 343c 2f64 6976 3e3c 2f64 6976 3e0a 3c64 4
.
void(* fdim │ │ │ +00114a70: 6572 6561 6463 6c6f 7365 2928 7374 7275 ereadclose)(stru │ │ │ +00114a80: 6374 2073 6f61 7020 2a73 6f61 702c 2076 ct soap *soap, v │ │ │ +00114a90: 6f69 6420 2a68 616e 646c 6529 3c2f 6469 oid *handle)
Callback to │ │ │ +00114ac0: 2063 6c6f 7365 2061 2044 494d 4520 6174 close a DIME at │ │ │ +00114ad0: 7461 6368 6d65 6e74 2073 7472 6561 6d20 tachment stream │ │ │ +00114ae0: 6166 7465 7220 7265 6164 696e 672e 3c2f after reading.
Defini │ │ │ +00114b10: 7469 6f6e 3a3c 2f62 3e20 7374 6473 6f61 tion: stdsoa │ │ │ +00114b20: 7032 2e68 3a34 3733 393c 2f64 6976 3e3c p2.h:4739
< │ │ │ +00114b30: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
soap: │ │ │ +00114bf0: 3a66 6469 6d65 7265 6164 3c2f 613e 3c2f :fdimeread
size_t(* │ │ │ +00114c20: 2066 6469 6d65 7265 6164 2928 7374 7275 fdimeread)(stru │ │ │ +00114c30: 6374 2073 6f61 7020 2a73 6f61 702c 2076 ct soap *soap, v │ │ │ +00114c40: 6f69 6420 2a68 616e 646c 652c 2063 6861 oid *handle, cha │ │ │ +00114c50: 7220 2a62 7566 2c20 7369 7a65 5f74 206c r *buf, size_t l │ │ │ +00114c60: 656e 293c 2f64 6976 3e3c 6469 7620 636c en)
Call │ │ │ +00114c80: 6261 636b 2074 6f20 7265 6164 2064 6174 back to read dat │ │ │ +00114c90: 6120 696e 2061 2044 494d 4520 6174 7461 a in a DIME atta │ │ │ +00114ca0: 6368 6d65 6e74 2073 7472 6561 6d2e 3c2f chment stream.
Defini │ │ │ +00114cd0: 7469 6f6e 3a3c 2f62 3e20 7374 6473 6f61 tion: stdsoa │ │ │ +00114ce0: 7032 2e68 3a34 3732 343c 2f64 6976 3e3c p2.h:4724
< │ │ │ +00114cf0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
< │ │ │ +00114d60: 6120 6872 6566 3d22 6772 6f75 705f 5f67 a href="group__g │ │ │ +00114d70: 726f 7570 5f5f 636f 6e74 6578 742e 6874 roup__context.ht │ │ │ +00114d80: 6d6c 2367 6162 6135 3536 3731 3065 3031 ml#gaba556710e01 │ │ │ +00114d90: 3066 6565 6232 3231 3165 6434 3362 3562 0feeb2211ed43b5b │ │ │ +00114da0: 6630 3539 6322 3e73 6f61 705f 6d61 6c6c f059c">soap_mall │ │ │ +00114db0: 6f63 3c2f 613e 3c2f 6469 763e 3c64 6976 oc
│ │ │ +00114dd0: 766f 6964 202a 2073 6f61 705f 6d61 6c6c void * soap_mall │ │ │ +00114de0: 6f63 2873 7472 7563 7420 736f 6170 202a oc(struct soap * │ │ │ +00114df0: 736f 6170 2c20 7369 7a65 5f74 206c 656e soap, size_t len │ │ │ +00114e00: 293c 2f64 6976 3e3c 6469 7620 636c 6173 )
Alloca │ │ │ +00114e20: 7465 2061 2062 6c6f 636b 206f 6620 6865 te a block of he │ │ │ +00114e30: 6170 206d 656d 6f72 7920 6d61 6e61 6765 ap memory manage │ │ │ +00114e40: 6420 6279 2074 6865 2073 7065 6369 6669 d by the specifi │ │ │ +00114e50: 6564 2073 6f61 7020 636f 6e74 6578 742e ed soap context. │ │ │ +00114e60: 3c2f 6469 763e 3c2f 6469 763e 0a3c 2f64
.

The follo │ │ │ +00114e90: 7769 6e67 2065 7861 6d70 6c65 2069 6c6c wing example ill │ │ │ +00114ea0: 7573 7472 6174 6573 2074 6865 2073 7472 ustrates the str │ │ │ +00114eb0: 6561 6d69 6e67 206f 6620 6120 4449 4d45 eaming of a DIME │ │ │ +00114ec0: 2061 7474 6163 686d 656e 7420 696e 746f attachment into │ │ │ +00114ed0: 2061 2066 696c 6520 6279 2061 2063 6c69 a file by a cli │ │ │ +00114ee0: 656e 743a 3c2f 703e 0a3c 6469 7620 636c ent:

.
< │ │ │ +00114f00: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +00114f10: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >int main() .
{
. │ │ │ +00114f70: 2020 3c73 7061 6e20 636c 6173 733d 226b struct < │ │ │ +00114f90: 2f73 7061 6e3e 3c61 2063 6c61 7373 3d22 /span>soa │ │ │ +00114fc0: 703c 2f61 3e20 3c61 2063 6c61 7373 3d22 p soa │ │ │ +00114ff0: 703c 2f61 3e3b 203c 2f64 6976 3e0a 3c64 p;
. │ │ │ +00115010: 2020 3c61 2063 6c61 7373 3d22 636f 6465 soap_init │ │ │ +00115070: 3c2f 613e 2826 616d 703b 3c61 2063 6c61 (&soap); .
so │ │ │ +001150f0: 6170 3c2f 613e 2e3c 6120 636c 6173 733d ap.fd │ │ │ +00115150: 696d 6577 7269 7465 6f70 656e 3c2f 613e imewriteopen │ │ │ +00115160: 203d 2064 696d 655f 7772 6974 655f 6f70 = dime_write_op │ │ │ +00115170: 656e 3b20 3c2f 6469 763e 0a3c 6469 7620 en;
.
< │ │ │ +00115190: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +001151a0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ +001151b0: 6874 6d6c 223e 736f 6170 3c2f 613e 2e3c html">soap.< │ │ │ +001151c0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +001151d0: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ +001151e0: 705f 5f63 616c 6c62 6163 6b73 2e68 746d p__callbacks.htm │ │ │ +001151f0: 6c23 6761 3165 6130 6361 3035 3236 6334 l#ga1ea0ca0526c4 │ │ │ +00115200: 6363 6261 3032 6563 3532 6636 3265 3036 ccba02ec52f62e06 │ │ │ +00115210: 3738 6139 223e 6664 696d 6577 7269 7465 78a9">fdimewrite │ │ │ +00115220: 636c 6f73 653c 2f61 3e20 3d20 6469 6d65 close = dime │ │ │ +00115230: 5f77 7269 7465 5f63 6c6f 7365 3b20 3c2f _write_close; .
│ │ │ +00115280: 736f 6170 3c2f 613e 2e3c 6120 636c 6173 soap. │ │ │ +001152e0: 6664 696d 6577 7269 7465 3c2f 613e 203d fdimewrite = │ │ │ +001152f0: 2064 696d 655f 7772 6974 653b 203c 2f64 dime_write; .
if (soa │ │ │ +00115340: 705f 6361 6c6c 5f6e 735f 5f77 6562 6d65 p_call_ns__webme │ │ │ +00115350: 7468 6f64 2826 616d 703b 3c61 2063 6c61 thod(&soap, ...)) │ │ │ +00115390: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
... │ │ │ +001153b0: 203c 7370 616e 2063 6c61 7373 3d22 636f // error< │ │ │ +001153d0: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
. │ │ │ +001153f0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 else< │ │ │ +00115410: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
. │ │ │ +00115430: 2020 202e 2e2e 203c 7370 616e 2063 6c61 ... // │ │ │ +00115450: 7375 6363 6573 733c 2f73 7061 6e3e 3c2f success.
}
. │ │ │ +00115480: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
.
void *dime_write_op │ │ │ +001154e0: 656e 283c 7370 616e 2063 6c61 7373 3d22 en(struct< │ │ │ +00115500: 2f73 7061 6e3e 203c 6120 636c 6173 733d /span> so │ │ │ +00115530: 6170 3c2f 613e 202a 3c61 2063 6c61 7373 ap *s │ │ │ +00115560: 6f61 703c 2f61 3e2c 203c 7370 616e 2063 oap, c │ │ │ +00115580: 6f6e 7374 3c2f 7370 616e 3e20 3c73 7061 onst char *id< │ │ │ +001155d0: 2f73 7061 6e3e 2c20 3c73 7061 6e20 636c /span>, co │ │ │ +001155f0: 6e73 743c 2f73 7061 6e3e 203c 7370 616e nst char │ │ │ +00115620: 202a 7479 7065 2c20 3c73 7061 6e20 636c *type, co │ │ │ +00115640: 6e73 743c 2f73 7061 6e3e 203c 7370 616e nst char │ │ │ +00115670: 202a 6f70 7469 6f6e 7329 203c 2f64 6976 *options)
.
{
.
│ │ │ +001156b0: 4649 4c45 202a 6861 6e64 6c65 203d 203c FILE *handle = < │ │ │ +001156c0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +001156d0: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ +001156e0: 705f 5f63 616c 6c62 6163 6b73 2e68 746d p__callbacks.htm │ │ │ +001156f0: 6c23 6761 3962 3439 3835 6562 3561 3538 l#ga9b4985eb5a58 │ │ │ +00115700: 3866 3463 3136 6164 3838 6566 3763 6133 8f4c16ad88ef7ca3 │ │ │ +00115710: 3239 6463 223e 666f 7065 6e3c 2f61 3e28 29dc">fopen( │ │ │ +00115720: 3c73 7061 6e20 636c 6173 733d 2273 7472 &quo │ │ │ +00115740: 743b 736f 6d65 6669 6c65 2671 756f 743b t;somefile" │ │ │ +00115750: 3c2f 7370 616e 3e2c 203c 7370 616e 2063 , "wb&qu │ │ │ +00115780: 6f74 3b3c 2f73 7061 6e3e 293b 203c 2f64 ot;); .
if (!ha │ │ │ +001157d0: 6e64 6c65 2920 3c2f 6469 763e 0a3c 6469 ndle)
. │ │ │ +001157f0: 207b 3c2f 6469 763e 0a3c 6469 7620 636c {
.
< │ │ │ +00115810: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +00115820: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ +00115830: 6874 6d6c 223e 736f 6170 3c2f 613e 2d26 html">soap-& │ │ │ +00115840: 6774 3b3c 6120 636c 6173 733d 2263 6f64 gt;erro │ │ │ +00115890: 723c 2f61 3e20 3d20 3c61 2063 6c61 7373 r = SOAP │ │ │ +001158f0: 5f45 4f46 3c2f 613e 3b20 3c2f 6469 763e _EOF;
│ │ │ +00115900: 0a3c 6469 7620 636c 6173 733d 226c 696e .
so │ │ │ +00115940: 6170 3c2f 613e 2d26 6774 3b3c 6120 636c ap->errnum = │ │ │ +001159a0: 2065 7272 6e6f 3b20 3c73 7061 6e20 636c errno; // │ │ │ +001159c0: 2067 6574 2072 6561 736f 6e20 3c2f 7370 get reason
.
} │ │ │ +001159f0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
return (vo │ │ │ +00115a50: 6964 3c2f 7370 616e 3e2a 2968 616e 646c id*)handl │ │ │ +00115a60: 653b 203c 2f64 6976 3e0a 3c64 6976 2063 e;
.
} .
.< │ │ │ +00115aa0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +00115ab0: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >void< │ │ │ +00115ad0: 2f73 7061 6e3e 2064 696d 655f 7772 6974 /span> dime_writ │ │ │ +00115ae0: 655f 636c 6f73 6528 3c73 7061 6e20 636c e_close(st │ │ │ +00115b00: 7275 6374 3c2f 7370 616e 3e20 3c61 2063 ruct soap *soap, void *handle) .
{
. │ │ │ +00115bd0: 2020 3c61 2063 6c61 7373 3d22 636f 6465 fclose< │ │ │ +00115c30: 2f61 3e28 2846 494c 452a 2968 616e 646c /a>((FILE*)handl │ │ │ +00115c40: 6529 3b20 3c2f 6469 763e 0a3c 6469 7620 e);
.
} < │ │ │ +00115c60: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
. │ │ │ +00115c80: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
int< │ │ │ +00115cb0: 2f73 7061 6e3e 2064 696d 655f 7772 6974 /span> dime_writ │ │ │ +00115cc0: 6528 3c73 7061 6e20 636c 6173 733d 226b e(struct soa │ │ │ +00115d10: 703c 2f61 3e20 2a3c 6120 636c 6173 733d p *so │ │ │ +00115d40: 6170 3c2f 613e 2c20 3c73 7061 6e20 636c ap, void *h │ │ │ +00115d70: 616e 646c 652c 203c 7370 616e 2063 6c61 andle, con │ │ │ +00115d90: 7374 3c2f 7370 616e 3e20 3c73 7061 6e20 st char │ │ │ +00115dc0: 2a3c 6120 636c 6173 733d 2263 6f64 6522 *buf, siz │ │ │ +00115e30: 655f 743c 2f73 7061 6e3e 206c 656e 2920 e_t len) │ │ │ +00115e40: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
{
│ │ │ +00115e60: 0a3c 6469 7620 636c 6173 733d 226c 696e .
s │ │ │ +00115e90: 697a 655f 743c 2f73 7061 6e3e 206e 7772 ize_t nwr │ │ │ +00115ea0: 6974 7465 6e3b 203c 2f64 6976 3e0a 3c64 itten;
. │ │ │ +00115ec0: 2020 3c73 7061 6e20 636c 6173 733d 226b whil │ │ │ +00115ee0: 653c 2f73 7061 6e3e 2028 6c65 6e29 203c e (len) < │ │ │ +00115ef0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
{
.
nwritten │ │ │ +00115f30: 203d 2066 7772 6974 6528 3c61 2063 6c61 = fwrite(buf, 1, l │ │ │ +00115f90: 656e 2c20 2846 494c 452a 2968 616e 646c en, (FILE*)handl │ │ │ +00115fa0: 6529 3b20 3c2f 6469 763e 0a3c 6469 7620 e);
.
│ │ │ +00115fc0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 if (!nwritten) │ │ │ +00115ff0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
{< │ │ │ +00116010: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
soap-&g │ │ │ +00116060: 743b 3c61 2063 6c61 7373 3d22 636f 6465 t;errnu │ │ │ +001160b0: 6d3c 2f61 3e20 3d20 6572 726e 6f3b 203c m = errno; < │ │ │ +001160c0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ +001160d0: 656e 7422 3e2f 2f20 6765 7420 7265 6173 ent">// get reas │ │ │ +001160e0: 6f6e 203c 2f73 7061 6e3e 3c2f 6469 763e on
│ │ │ +001160f0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
return │ │ │ +00116130: 203c 6120 636c 6173 733d 2263 6f64 6522 SOAP_EOF;
.
│ │ │ +001161b0: 7d20 3c2f 6469 763e 0a3c 6469 7620 636c }
.
l │ │ │ +001161d0: 656e 202d 3d20 6e77 7269 7474 656e 3b20 en -= nwritten; │ │ │ +001161e0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
buf += │ │ │ +00116250: 206e 7772 6974 7465 6e3b 203c 2f64 6976 nwritten;
.
}
.< │ │ │ +00116280: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +00116290: 3e20 203c 7370 616e 2063 6c61 7373 3d22 > ret │ │ │ +001162b0: 7572 6e3c 2f73 7061 6e3e 203c 6120 636c urn S │ │ │ +00116310: 4f41 505f 4f4b 3c2f 613e 3b20 3c2f 6469 OAP_OK; .
}
.
│ │ │ +00116420: 696e 7428 2a20 6664 696d 6577 7269 7465 int(* fdimewrite │ │ │ +00116430: 2928 7374 7275 6374 2073 6f61 7020 2a73 )(struct soap *s │ │ │ +00116440: 6f61 702c 2076 6f69 6420 2a2c 2063 6f6e oap, void *, con │ │ │ +00116450: 7374 2063 6861 7220 2a2c 2073 697a 655f st char *, size_ │ │ │ +00116460: 7429 3c2f 6469 763e 3c64 6976 2063 6c61 t)
Callb │ │ │ +00116480: 6163 6b20 746f 2077 7269 7465 2064 6174 ack to write dat │ │ │ +00116490: 6120 696e 2061 2044 494d 4520 6174 7461 a in a DIME atta │ │ │ +001164a0: 6368 6d65 6e74 2073 7472 6561 6d2e 3c2f chment stream.
Defini │ │ │ +001164d0: 7469 6f6e 3a3c 2f62 3e20 7374 6473 6f61 tion: stdsoa │ │ │ +001164e0: 7032 2e68 3a34 3832 323c 2f64 6976 3e3c p2.h:4822
< │ │ │ +001164f0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
vo │ │ │ +001165e0: 6964 282a 2066 6469 6d65 7772 6974 6563 id(* fdimewritec │ │ │ +001165f0: 6c6f 7365 2928 7374 7275 6374 2073 6f61 lose)(struct soa │ │ │ +00116600: 7020 2a73 6f61 702c 2076 6f69 6420 2a68 p *soap, void *h │ │ │ +00116610: 616e 646c 6529 3c2f 6469 763e 3c64 6976 andle)
C │ │ │ +00116630: 616c 6c62 6163 6b20 746f 2063 6c6f 7365 allback to close │ │ │ +00116640: 2061 2044 494d 4520 6174 7461 6368 6d65 a DIME attachme │ │ │ +00116650: 6e74 2073 7472 6561 6d20 6166 7465 7220 nt stream after │ │ │ +00116660: 7772 6974 696e 672e 3c2f 6469 763e 3c64 writing.
Definition:< │ │ │ +00116690: 2f62 3e20 7374 6473 6f61 7032 2e68 3a34 /b> stdsoap2.h:4 │ │ │ +001166a0: 3833 333c 2f64 6976 3e3c 2f64 6976 3e0a 833
. │ │ │ +001166b0: 3c64 6976 2063 6c61 7373 3d22 7474 6322
soap::fdime │ │ │ +00116770: 7772 6974 656f 7065 6e3c 2f61 3e3c 2f64 writeopen
void *(* │ │ │ +001167a0: 6664 696d 6577 7269 7465 6f70 656e 2928 fdimewriteopen)( │ │ │ +001167b0: 7374 7275 6374 2073 6f61 7020 2a73 6f61 struct soap *soa │ │ │ +001167c0: 702c 2063 6f6e 7374 2063 6861 7220 2a69 p, const char *i │ │ │ +001167d0: 642c 2063 6f6e 7374 2063 6861 7220 2a74 d, const char *t │ │ │ +001167e0: 7970 652c 2063 6f6e 7374 2063 6861 7220 ype, const char │ │ │ +001167f0: 2a6f 7074 696f 6e73 293c 2f64 6976 3e3c *options)
< │ │ │ +00116800: 6469 7620 636c 6173 733d 2274 7464 6f63 div class="ttdoc │ │ │ +00116810: 223e 4361 6c6c 6261 636b 2074 6f20 6f70 ">Callback to op │ │ │ +00116820: 656e 2061 2073 7472 6561 6d69 6e67 2044 en a streaming D │ │ │ +00116830: 494d 4520 6174 7461 6368 6d65 6e74 2066 IME attachment f │ │ │ +00116840: 6f72 2077 7269 7469 6e67 2e3c 2f64 6976 or writing.
Definitio │ │ │ +00116870: 6e3a 3c2f 623e 2073 7464 736f 6170 322e n: stdsoap2. │ │ │ +00116880: 683a 3438 3130 3c2f 6469 763e 3c2f 6469 h:4810
.
SOAP_SOCKET(* f │ │ │ +00116980: 6f70 656e 2928 7374 7275 6374 2073 6f61 open)(struct soa │ │ │ +00116990: 7020 2a73 6f61 702c 2063 6f6e 7374 2063 p *soap, const c │ │ │ +001169a0: 6861 7220 2a65 6e64 706f 696e 742c 2063 har *endpoint, c │ │ │ +001169b0: 6f6e 7374 2063 6861 7220 2a68 6f73 742c onst char *host, │ │ │ +001169c0: 2069 6e74 2070 6f72 7429 3c2f 6469 763e int port)
│ │ │ +001169d0: 3c64 6976 2063 6c61 7373 3d22 7474 646f
Callback that │ │ │ +001169f0: 206f 7065 6e73 2061 2073 6f63 6b65 7420 opens a socket │ │ │ +00116a00: 636f 6e6e 6563 7469 6f6e 2074 6f20 6120 connection to a │ │ │ +00116a10: 7365 7276 6572 2065 6e64 706f 696e 742e server endpoint. │ │ │ +00116a20: 3c2f 6469 763e 3c64 6976 2063 6c61 7373
Defi │ │ │ +00116a40: 6e69 7469 6f6e 3a3c 2f62 3e20 7374 6473 nition: stds │ │ │ +00116a50: 6f61 7032 2e68 3a34 3439 353c 2f64 6976 oap2.h:4495
.
< │ │ │ +00116ac0: 6469 7620 636c 6173 733d 2274 746e 616d div class="ttnam │ │ │ +00116ad0: 6522 3e3c 6120 6872 6566 3d22 6772 6f75 e">soa │ │ │ +00116b20: 703a 3a66 636c 6f73 653c 2f61 3e3c 2f64 p::fclose
int(* fcl │ │ │ +00116b50: 6f73 6529 2873 7472 7563 7420 736f 6170 ose)(struct soap │ │ │ +00116b60: 202a 736f 6170 293c 2f64 6976 3e3c 6469 *soap)
│ │ │ +00116b80: 4361 6c6c 6261 636b 2074 6861 7420 636c Callback that cl │ │ │ +00116b90: 6f73 6573 2074 6865 2063 7572 7265 6e74 oses the current │ │ │ +00116ba0: 2073 6f63 6b65 7420 636f 6e6e 6563 7469 socket connecti │ │ │ +00116bb0: 6f6e 2e3c 2f64 6976 3e3c 6469 7620 636c on.
D │ │ │ +00116bd0: 6566 696e 6974 696f 6e3a 3c2f 623e 2073 efinition: s │ │ │ +00116be0: 7464 736f 6170 322e 683a 3435 3230 3c2f tdsoap2.h:4520
.
< │ │ │ +00116c50: 6469 7620 636c 6173 733d 2274 746e 616d div class="ttnam │ │ │ +00116c60: 6522 3e3c 6120 6872 6566 3d22 6772 6f75 e">SOAP_E │ │ │ +00116cb0: 4f46 3c2f 613e 3c2f 6469 763e 3c64 6976 OF
│ │ │ +00116cd0: 2364 6566 696e 6520 534f 4150 5f45 4f46 #define SOAP_EOF │ │ │ +00116ce0: 3c2f 6469 763e 3c64 6976 2063 6c61 7373
A soap_ │ │ │ +00116d00: 7374 6174 7573 2065 7272 6f72 2063 6f64 status error cod │ │ │ +00116d10: 653a 2075 6e65 7870 6563 7465 6420 656e e: unexpected en │ │ │ +00116d20: 6420 6f66 2066 696c 652c 206e 6f20 696e d of file, no in │ │ │ +00116d30: 7075 742c 2074 7261 6e73 6d69 7373 696f put, transmissio │ │ │ +00116d40: 6e20 696e 7465 7272 7570 7465 6420 6f72 n interrupted or │ │ │ +00116d50: 2074 696d 6564 206f 7574 2028 7361 2e2e timed out (sa.. │ │ │ +00116d60: 2e3c 2f64 6976 3e3c 6469 7620 636c 6173 .
Def │ │ │ +00116d80: 696e 6974 696f 6e3a 3c2f 623e 2073 7464 inition: std │ │ │ +00116d90: 736f 6170 322e 683a 3233 3635 3c2f 6469 soap2.h:2365
.
< │ │ │ +00116db0: 212d 2d20 6672 6167 6d65 6e74 202d 2d3e !-- fragment --> │ │ │ +00116dc0: 3c70 3e4d 6573 7361 6765 2063 6f6d 7072

Message compr │ │ │ +00116dd0: 6573 7369 6f6e 2077 6974 6820 3c63 6f64 ession with #SOAP_ENC_ZLIB │ │ │ +00116df0: 3c2f 636f 6465 3e20 6361 6e20 6265 2075 can be u │ │ │ +00116e00: 7365 6420 7769 7468 2044 494d 4520 746f sed with DIME to │ │ │ +00116e10: 2063 6f6d 7072 6573 7320 7468 6520 656e compress the en │ │ │ +00116e20: 7469 7265 206d 6573 7361 6765 2e20 486f tire message. Ho │ │ │ +00116e30: 7765 7665 722c 2063 6f6d 7072 6573 7369 wever, compressi │ │ │ +00116e40: 6f6e 2072 6571 7569 7265 7320 6275 6666 on requires buff │ │ │ +00116e50: 6572 696e 6720 746f 2064 6574 6572 6d69 ering to determi │ │ │ +00116e60: 6e65 2074 6865 2048 5454 5020 636f 6e74 ne the HTTP cont │ │ │ +00116e70: 656e 7420 6c65 6e67 7468 2068 6561 6465 ent length heade │ │ │ +00116e80: 722c 2077 6869 6368 2063 616e 6365 6c73 r, which cancels │ │ │ +00116e90: 2074 6865 2062 656e 6566 6974 7320 6f66 the benefits of │ │ │ +00116ea0: 2073 7472 6561 6d69 6e67 2044 494d 452e streaming DIME. │ │ │ +00116eb0: 2054 6f20 6176 6f69 6420 7468 6973 2c20 To avoid this, │ │ │ +00116ec0: 796f 7520 7368 6f75 6c64 2075 7365 2063 you should use c │ │ │ +00116ed0: 6875 6e6b 6564 2048 5454 5020 2877 6974 hunked HTTP (wit │ │ │ +00116ee0: 6820 7468 6520 6f75 7470 7574 2d6d 6f64 h the output-mod │ │ │ +00116ef0: 6520 3c63 6f64 653e 2353 4f41 505f 494f e #SOAP_IO │ │ │ +00116f00: 5f43 4855 4e4b 3c2f 636f 6465 3e20 666c _CHUNK fl │ │ │ +00116f10: 6167 2920 7769 7468 2063 6f6d 7072 6573 ag) with compres │ │ │ +00116f20: 7369 6f6e 2061 6e64 2073 7472 6561 6d69 sion and streami │ │ │ +00116f30: 6e67 2044 494d 452e 2041 7420 7468 6520 ng DIME. At the │ │ │ +00116f40: 7365 7276 6572 2073 6964 652c 2077 6865 server side, whe │ │ │ +00116f50: 6e20 796f 7520 7365 7420 3c63 6f64 653e n you set │ │ │ +00116f60: 2353 4f41 505f 494f 5f43 4855 4e4b 3c2f #SOAP_IO_CHUNK before cal │ │ │ +00116f80: 6c69 6e67 203c 636f 6465 3e3c 6120 636c ling soap_s │ │ │ +00117000: 6572 7665 3c2f 613e 3c2f 636f 6465 3e2c erve, │ │ │ +00117010: 2074 6865 2065 6e67 696e 6520 7769 6c6c the engine will │ │ │ +00117020: 2061 7574 6f6d 6174 6963 616c 6c79 2072 automatically r │ │ │ +00117030: 6576 6572 7420 746f 2062 7566 6665 7269 evert to bufferi │ │ │ +00117040: 6e67 2028 3c63 6f64 653e 2353 4f41 505f ng (#SOAP_ │ │ │ +00117050: 494f 5f53 544f 5245 3c2f 636f 6465 3e20 IO_STORE │ │ │ +00117060: 666c 6167 2069 7320 7365 7429 2e20 596f flag is set). Yo │ │ │ +00117070: 7520 6361 6e20 6368 6563 6b20 7468 6973 u can check this │ │ │ +00117080: 2066 6c61 6720 7769 7468 203c 636f 6465 flag with (soap->omode │ │ │ +001170a0: 2026 616d 703b 2053 4f41 505f 494f 2920 & SOAP_IO) │ │ │ +001170b0: 3d3d 2053 4f41 505f 494f 5f43 4855 4e4b == SOAP_IO_CHUNK │ │ │ +001170c0: 3c2f 636f 6465 3e20 746f 2073 6565 2069 to see i │ │ │ +001170d0: 6620 7468 6520 636c 6965 6e74 2061 6363 f the client acc │ │ │ +001170e0: 6570 7473 2063 6875 6e6b 696e 672e 204d epts chunking. M │ │ │ +001170f0: 6f72 6520 696e 666f 726d 6174 696f 6e20 ore information │ │ │ +00117100: 6162 6f75 7420 7374 7265 616d 696e 6720 about streaming │ │ │ +00117110: 6368 756e 6b65 6420 4449 4d45 2063 616e chunked DIME can │ │ │ +00117120: 2062 6520 666f 756e 6420 696e 2053 6563 be found in Sec │ │ │ +00117130: 7469 6f6e 203c 6120 636c 6173 733d 2265 tion Streaming chun │ │ │ +00117170: 6b65 6420 4449 4d45 3c2f 613e 202e 3c2f ked DIME ..

< │ │ │ +001171a0: 6474 3e57 6172 6e69 6e67 3c2f 6474 3e3c dt>Warning< │ │ │ +001171b0: 6464 3e54 6865 203c 636f 6465 3e6f 7074 dd>The opt │ │ │ +001171c0: 696f 6e73 3c2f 636f 6465 3e20 6d65 6d62 ions memb │ │ │ +001171d0: 6572 2069 7320 6120 4449 4d45 2d73 7065 er is a DIME-spe │ │ │ +001171e0: 6369 6669 6320 6461 7461 2073 7472 7563 cific data struc │ │ │ +001171f0: 7475 7265 2c20 636f 6e73 6973 7469 6e67 ture, consisting │ │ │ +00117200: 206f 6620 6120 3420 6279 7465 2068 6561 of a 4 byte hea │ │ │ +00117210: 6465 7220 636f 6e74 6169 6e69 6e67 2074 der containing t │ │ │ +00117220: 6865 206f 7074 696f 6e20 7479 7065 2069 he option type i │ │ │ +00117230: 6e66 6f20 2868 6920 6279 7465 2c20 6c6f nfo (hi byte, lo │ │ │ +00117240: 2062 7974 6529 2c20 6f70 7469 6f6e 2073 byte), option s │ │ │ +00117250: 7472 696e 6720 6c65 6e67 7468 2028 6869 tring length (hi │ │ │ +00117260: 2062 7974 652c 206c 6f20 6279 7465 292c byte, lo byte), │ │ │ +00117270: 2066 6f6c 6c6f 7765 6420 6279 2061 206e followed by a n │ │ │ +00117280: 6f6e 2d27 5c30 2720 7465 726d 696e 6174 on-'\0' terminat │ │ │ +00117290: 6564 2073 7472 696e 672e 2054 6865 2044 ed string. The D │ │ │ +001172a0: 494d 4520 6861 6e64 6c65 7220 7265 636f IME handler reco │ │ │ +001172b0: 676e 697a 6573 206f 6e65 206f 7074 696f gnizes one optio │ │ │ +001172c0: 6e20 6174 206d 6f73 742e 3c2f 6464 3e3c n at most.< │ │ │ +001172d0: 2f64 6c3e 0a3c 703e f09f 949d 203c 6120 /dl>.

.... Back to │ │ │ +001172f0: 2074 6162 6c65 206f 6620 636f 6e74 656e table of conten │ │ │ +00117300: 7473 3c2f 613e 3c2f 703e 0a3c 6832 3e3c ts

.

< │ │ │ +00117310: 6120 636c 6173 733d 2261 6e63 686f 7222 a class="anchor" │ │ │ +00117320: 2069 643d 2264 696d 6563 6875 6e6b 696e id="dimechunkin │ │ │ +00117330: 6722 3e3c 2f61 3e0a 5374 7265 616d 696e g">.Streamin │ │ │ +00117340: 6720 6368 756e 6b65 6420 4449 4d45 3c2f g chunked DIME.

To send D │ │ │ +00117360: 494d 4520 6174 7461 6368 6d65 6e74 732c IME attachments, │ │ │ +00117370: 2074 6865 2061 7474 6163 686d 656e 7420 the attachment │ │ │ +00117380: 7369 7a65 7320 6d75 7374 2062 6520 6465 sizes must be de │ │ │ +00117390: 7465 726d 696e 6564 2069 6e20 6164 7661 termined in adva │ │ │ +001173a0: 6e63 6520 746f 2063 616c 6375 6c61 7465 nce to calculate │ │ │ +001173b0: 2048 5454 5020 6d65 7373 6167 6520 6c65 HTTP message le │ │ │ +001173c0: 6e67 7468 2072 6571 7569 7265 6420 746f ngth required to │ │ │ +001173d0: 2073 7472 6561 6d20 4449 4d45 206f 7665 stream DIME ove │ │ │ +001173e0: 7220 4854 5450 2e20 486f 7765 7665 722c r HTTP. However, │ │ │ +001173f0: 2063 6875 6e6b 6564 2044 494d 4520 746f chunked DIME to │ │ │ +00117400: 6765 7468 6572 2077 6974 6820 6368 756e gether with chun │ │ │ +00117410: 6b65 6420 4854 5450 2063 616e 2062 6520 ked HTTP can be │ │ │ +00117420: 7573 6564 2074 6f20 6f6d 6974 2074 6869 used to omit thi │ │ │ +00117430: 7320 7374 6570 2e20 4669 7273 7420 7365 s step. First se │ │ │ +00117440: 7420 7468 6520 3c63 6f64 653e 2353 4f41 t the #SOA │ │ │ +00117450: 505f 494f 5f43 4855 4e4b 3c2f 636f 6465 P_IO_CHUNK flag. Then, to │ │ │ +00117470: 2073 7472 6561 6d20 6368 756e 6b65 6420 stream chunked │ │ │ +00117480: 4449 4d45 2c20 7365 7420 7468 6520 3c63 DIME, set the __size member of an a │ │ │ +001174b0: 7474 6163 686d 656e 7420 746f 207a 6572 ttachment to zer │ │ │ +001174c0: 6f20 616e 6420 656e 6162 6c65 2044 494d o and enable DIM │ │ │ +001174d0: 4520 6368 756e 6b69 6e67 2e20 5468 6520 E chunking. The │ │ │ +001174e0: 4449 4d45 203c 636f 6465 3e3c 6120 636c DIME soap: │ │ │ +00117580: 3a66 6469 6d65 7265 6164 3c2f 613e 3c2f :fdimeread callback t │ │ │ +001175a0: 6865 6e20 6665 7463 6865 7320 6461 7461 hen fetches data │ │ │ +001175b0: 2069 6e20 6368 756e 6b73 2061 6e64 2069 in chunks and i │ │ │ +001175c0: 7420 6973 2069 6d70 6f72 7461 6e74 2074 t is important t │ │ │ +001175d0: 6f20 6669 6c6c 2074 6865 2065 6e74 6972 o fill the entir │ │ │ +001175e0: 6520 6275 6666 6572 2075 6e6c 6573 7320 e buffer unless │ │ │ +001175f0: 7468 6520 656e 6420 6f66 2074 6865 2064 the end of the d │ │ │ +00117600: 6174 6120 6861 7320 6265 656e 2072 6561 ata has been rea │ │ │ +00117610: 6368 6564 2061 6e64 2074 6865 206c 6173 ched and the las │ │ │ +00117620: 7420 6368 756e 6b20 6973 2074 6f20 6265 t chunk is to be │ │ │ +00117630: 2073 656e 642e 2054 6861 7420 6973 2c20 send. That is, │ │ │ +00117640: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 soap::fdim │ │ │ +001176e0: 6572 6561 643c 2f61 3e3c 2f63 6f64 653e eread │ │ │ +001176f0: 2073 686f 756c 6420 7265 7475 726e 2074 should return t │ │ │ +00117700: 6865 2076 616c 7565 206f 6620 7468 6520 he value of the │ │ │ +00117710: 6c61 7374 203c 636f 6465 3e6c 656e 3c2f last len parameter │ │ │ +00117730: 616e 6420 6669 6c6c 2074 6865 2065 6e74 and fill the ent │ │ │ +00117740: 6972 6520 6275 6666 6572 203c 636f 6465 ire buffer buf for │ │ │ +00117760: 616c 6c20 6368 756e 6b73 2065 7863 6570 all chunks excep │ │ │ +00117770: 7420 7468 6520 6c61 7374 2e20 466f 7220 t the last. For │ │ │ +00117780: 7468 6520 6c61 7374 2069 7420 7265 7475 the last it retu │ │ │ +00117790: 726e 7320 302e 3c2f 703e 0a3c 703e 596f rns 0.

.

Yo │ │ │ +001177a0: 7520 6361 6e20 616c 736f 2075 7365 2074 u can also use t │ │ │ +001177b0: 6865 203c 636f 6465 3e23 534f 4150 5f49 he #SOAP_I │ │ │ +001177c0: 4f5f 5354 4f52 453c 2f63 6f64 653e 2066 O_STORE f │ │ │ +001177d0: 6c61 672c 2062 7574 2074 6861 7420 6361 lag, but that ca │ │ │ +001177e0: 6e63 656c 7320 7468 6520 6265 6e65 6669 ncels the benefi │ │ │ +001177f0: 7473 206f 6620 7374 7265 616d 696e 6720 ts of streaming │ │ │ +00117800: 4449 4d45 2e3c 2f70 3e0a 3c70 3ef0 9f94 DIME.

.

... │ │ │ +00117810: 9d20 3c61 2068 7265 663d 2223 223e 4261 . Ba │ │ │ +00117820: 636b 2074 6f20 7461 626c 6520 6f66 2063 ck to table of c │ │ │ +00117830: 6f6e 7465 6e74 733c 2f61 3e3c 2f70 3e0a ontents

. │ │ │ +00117840: 3c68 323e 3c61 2063 6c61 7373 3d22 616e

.WSDL bi │ │ │ +00117870: 6e64 696e 6773 2066 6f72 2044 494d 4520 ndings for DIME │ │ │ +00117880: 6174 7461 6368 6d65 6e74 733c 2f68 323e attachments

│ │ │ +00117890: 0a3c 703e 5468 6520 7773 646c 3268 2074 .

The wsdl2h t │ │ │ +001178a0: 6f6f 6c20 7265 636f 676e 697a 6573 2044 ool recognizes D │ │ │ +001178b0: 494d 4520 6174 7461 6368 6d65 6e74 7320 IME attachments │ │ │ +001178c0: 616e 6420 7072 6f64 7563 6573 2061 6e20 and produces an │ │ │ +001178d0: 616e 6e6f 7461 7465 6420 6865 6164 6572 annotated header │ │ │ +001178e0: 2066 696c 652e 2042 6f74 6820 6f70 656e file. Both open │ │ │ +001178f0: 2061 6e64 2063 6c6f 7365 6420 6c61 796f and closed layo │ │ │ +00117900: 7574 7320 6172 6520 7375 7070 6f72 7465 uts are supporte │ │ │ +00117910: 6420 666f 7220 7472 616e 736d 6974 7469 d for transmitti │ │ │ +00117920: 6e67 2044 494d 4520 6174 7461 6368 6d65 ng DIME attachme │ │ │ +00117930: 6e74 732e 2046 6f72 2063 6c6f 7365 6420 nts. For closed │ │ │ +00117940: 666f 726d 6174 732c 2061 6c6c 2044 494d formats, all DIM │ │ │ +00117950: 4520 6174 7461 6368 6d65 6e74 7320 6d75 E attachments mu │ │ │ +00117960: 7374 2062 6520 7265 6665 7265 6e63 6564 st be referenced │ │ │ +00117970: 2066 726f 6d20 7468 6520 534f 4150 206d from the SOAP m │ │ │ +00117980: 6573 7361 6765 2c20 652e 672e 2075 7369 essage, e.g. usi │ │ │ +00117990: 6e67 2068 7265 6673 2077 6974 6820 534f ng hrefs with SO │ │ │ +001179a0: 4150 2065 6e63 6f64 696e 6720 616e 6420 AP encoding and │ │ │ +001179b0: 7573 696e 6720 7468 6520 6170 706c 6963 using the applic │ │ │ +001179c0: 6174 696f 6e2d 7370 6563 6966 6963 2072 ation-specific r │ │ │ +001179d0: 6566 6572 656e 6365 2061 7474 7269 6275 eference attribu │ │ │ +001179e0: 7465 2069 6e63 6c75 6465 6420 696e 2074 te included in t │ │ │ +001179f0: 6865 203c 636f 6465 3e3c 6120 636c 6173 he xsd__base │ │ │ +00117a70: 3634 4269 6e61 7279 3c2f 613e 3c2f 636f 64Binary struct or cl │ │ │ +00117a90: 6173 7320 666f 7220 646f 6375 6d65 6e74 ass for document │ │ │ +00117aa0: 2f6c 6974 6572 616c 206d 6573 7361 6769 /literal messagi │ │ │ +00117ab0: 6e67 2e3c 2f70 3e0a 3c70 3e54 6865 2073 ng.

.

The s │ │ │ +00117ac0: 6f61 7063 7070 3220 746f 6f6c 2064 6f65 oapcpp2 tool doe │ │ │ +00117ad0: 7320 6e6f 7420 7072 6f64 7563 6520 6120 s not produce a │ │ │ +00117ae0: 5753 444c 2077 6974 6820 4449 4d45 2065 WSDL with DIME e │ │ │ +00117af0: 7874 656e 7369 6f6e 732e 2044 494d 4520 xtensions. DIME │ │ │ +00117b00: 6973 2061 6e20 6f6c 6465 7220 6269 6e61 is an older bina │ │ │ +00117b10: 7279 2066 6f72 6d61 7420 7468 6174 2068 ry format that h │ │ │ +00117b20: 6173 206e 6f20 5753 444c 2070 726f 746f as no WSDL proto │ │ │ +00117b30: 636f 6c20 7375 7070 6f72 742c 2075 6e6c col support, unl │ │ │ +00117b40: 696b 6520 4d49 4d45 2061 6e64 204d 544f ike MIME and MTO │ │ │ +00117b50: 4d2e 3c2f 703e 0a3c 703e f09f 949d 203c M.

.

.... < │ │ │ +00117b60: 6120 6872 6566 3d22 2322 3e42 6163 6b20 a href="#">Back │ │ │ +00117b70: 746f 2074 6162 6c65 206f 6620 636f 6e74 to table of cont │ │ │ +00117b80: 656e 7473 3c2f 613e 3c2f 703e 0a3c 6831 ents

.

.MTOM attachmen │ │ │ +00117bc0: 7473 3c2f 6831 3e0a 3c70 3e4d 544f 4d20 ts

.

MTOM │ │ │ +00117bd0: 284d 6573 7361 6765 2054 7261 6e73 6d69 (Message Transmi │ │ │ +00117be0: 7373 696f 6e20 4f70 7469 6d69 7a61 7469 ssion Optimizati │ │ │ +00117bf0: 6f6e 204d 6563 6861 6e69 736d 2920 6973 on Mechanism) is │ │ │ +00117c00: 2061 2072 656c 6174 6976 656c 7920 6e65 a relatively ne │ │ │ +00117c10: 7720 666f 726d 6174 2066 6f72 2074 7261 w format for tra │ │ │ +00117c20: 6e73 6d69 7474 696e 6720 6174 7461 6368 nsmitting attach │ │ │ +00117c30: 6d65 6e74 7320 7769 7468 2053 4f41 5020 ments with SOAP │ │ │ +00117c40: 6d65 7373 6167 6573 2028 7365 6520 3c61 messages (see http:// │ │ │ +00117c80: 7777 772e 7733 2e6f 7267 2f54 522f 736f www.w3.org/TR/so │ │ │ +00117c90: 6170 3132 2d6d 746f 6d3c 2f61 3e29 2e20 ap12-mtom). │ │ │ +00117ca0: 4d54 4f4d 2061 7474 6163 686d 656e 7473 MTOM attachments │ │ │ +00117cb0: 2061 7265 2065 7373 656e 7469 616c 6c79 are essentially │ │ │ +00117cc0: 204d 494d 4520 6174 7461 6368 6d65 6e74 MIME attachment │ │ │ +00117cd0: 7320 7769 7468 2073 7461 6e64 6172 6469 s with standardi │ │ │ +00117ce0: 7a65 6420 6d65 6368 616e 6973 6d73 2066 zed mechanisms f │ │ │ +00117cf0: 6f72 2063 726f 7373 2072 6566 6572 656e or cross referen │ │ │ +00117d00: 6369 6e67 2061 7474 6163 686d 656e 7473 cing attachments │ │ │ +00117d10: 2066 726f 6d20 7468 6520 534f 4150 2062 from the SOAP b │ │ │ +00117d20: 6f64 792c 2077 6869 6368 2069 7320 6162 ody, which is ab │ │ │ +00117d30: 7365 6e74 2069 6e20 2870 6c61 696e 2920 sent in (plain) │ │ │ +00117d40: 4d49 4d45 2061 7474 6163 686d 656e 7473 MIME attachments │ │ │ +00117d50: 2061 6e64 206f 7074 696f 6e61 6c20 7769 and optional wi │ │ │ +00117d60: 7468 2044 494d 4520 6174 7461 6368 6d65 th DIME attachme │ │ │ +00117d70: 6e74 732e 3c2f 703e 0a3c 703e 556e 6c69 nts.

.

Unli │ │ │ +00117d80: 6b65 2074 6865 206e 616d 6520 7375 6767 ke the name sugg │ │ │ +00117d90: 6573 7473 2c20 7468 6520 7370 6565 6420 ests, the speed │ │ │ +00117da0: 6279 2077 6869 6368 2061 7474 6163 6865 by which attache │ │ │ +00117db0: 6420 6461 7461 2069 7320 7472 616e 736d d data is transm │ │ │ +00117dc0: 6974 7465 6420 6973 206e 6f74 2069 6e63 itted is not inc │ │ │ +00117dd0: 7265 6173 6564 2063 6f6d 7061 7265 6420 reased compared │ │ │ +00117de0: 746f 204d 494d 452c 2044 494d 452c 206f to MIME, DIME, o │ │ │ +00117df0: 7220 6576 656e 2058 4d4c 2065 6e63 6f64 r even XML encod │ │ │ +00117e00: 6564 2062 6173 6536 3420 6461 7461 2c20 ed base64 data, │ │ │ +00117e10: 6265 6361 7573 6520 7468 6520 7065 7266 because the perf │ │ │ +00117e20: 6f72 6d61 6e63 6520 6469 6666 6572 656e ormance differen │ │ │ +00117e30: 6365 7320 7768 656e 2075 7369 6e67 2067 ces when using g │ │ │ +00117e40: 534f 4150 2077 696c 6c20 6265 2073 6d61 SOAP will be sma │ │ │ +00117e50: 6c6c 2e20 5468 6520 6164 7661 6e74 6167 ll. The advantag │ │ │ +00117e60: 6520 6f66 2074 6865 2066 6f72 6d61 7420 e of the format │ │ │ +00117e70: 6973 2074 6865 2073 7461 6e64 6172 6469 is the standardi │ │ │ +00117e80: 7a65 6420 6174 7461 6368 6d65 6e74 2072 zed attachment r │ │ │ +00117e90: 6566 6572 656e 6365 206d 6563 6861 6e69 eference mechani │ │ │ +00117ea0: 736d 2c20 7768 6963 6820 7368 6f75 6c64 sm, which should │ │ │ +00117eb0: 2069 6d70 726f 7665 2069 6e74 6572 6f70 improve interop │ │ │ +00117ec0: 6572 6162 696c 6974 792e 3c2f 703e 0a3c erability.

.< │ │ │ +00117ed0: 703e 5468 6520 4d54 4f4d 2073 7065 6369 p>The MTOM speci │ │ │ +00117ee0: 6669 6361 7469 6f6e 206d 616e 6461 7465 fication mandate │ │ │ +00117ef0: 7320 534f 4150 2031 2e32 2061 6e64 2074 s SOAP 1.2 and t │ │ │ +00117f00: 6865 2075 7365 206f 6620 7468 6520 584f he use of the XO │ │ │ +00117f10: 5020 6e61 6d65 7370 6163 652e 2054 6865 P namespace. The │ │ │ +00117f20: 2058 4f50 2049 6e63 6c75 6465 2065 6c65 XOP Include ele │ │ │ +00117f30: 6d65 6e74 203c 656d 3e3c 636f 6465 3e78 ment x │ │ │ +00117f40: 6f70 3a49 6e63 6c75 6465 3c2f 636f 6465 op:Include is define │ │ │ +00117f60: 6420 696e 2074 6865 2069 6e74 6572 6661 d in the interfa │ │ │ +00117f70: 6365 2068 6561 6465 7220 6669 6c65 2061 ce header file a │ │ │ +00117f80: 7320 6120 3c63 6f64 653e 3c61 2063 6c61 s a │ │ │ +00117ff0: 5f78 6f70 5f5f 496e 636c 7564 653c 2f61 _xop__Include struct │ │ │ +00118010: 6f72 2063 6c61 7373 2c20 7468 6174 2069 or class, that i │ │ │ +00118020: 7320 7573 6564 2074 6f20 7265 6665 7265 s used to refere │ │ │ +00118030: 6e63 6520 6174 7461 6368 6d65 6e74 2873 nce attachment(s │ │ │ +00118040: 2920 6672 6f6d 2074 6865 2053 4f41 5020 ) from the SOAP │ │ │ +00118050: 6d65 7373 6167 6520 626f 6479 2e3c 2f70 message body.

.

Because ref │ │ │ +00118070: 6572 656e 6365 7320 6672 6f6d 2077 6974 erences from wit │ │ │ +00118080: 6869 6e20 7468 6520 534f 4150 206d 6573 hin the SOAP mes │ │ │ +00118090: 7361 6765 2062 6f64 7920 746f 2061 7474 sage body to att │ │ │ +001180a0: 6163 686d 656e 7473 2061 7265 206d 616e achments are man │ │ │ +001180b0: 6461 746f 7279 2077 6974 6820 4d54 4f4d datory with MTOM │ │ │ +001180c0: 2c20 7468 6520 696d 706c 656d 656e 7461 , the implementa │ │ │ +001180d0: 7469 6f6e 206f 6620 7468 6520 7365 7269 tion of the seri │ │ │ +001180e0: 616c 697a 6174 696f 6e20 616e 6420 6465 alization and de │ │ │ +001180f0: 7365 7269 616c 697a 6174 696f 6e20 6f66 serialization of │ │ │ +00118100: 204d 544f 4d20 4d49 4d45 2061 7474 6163 MTOM MIME attac │ │ │ +00118110: 686d 656e 7473 2075 7365 7320 7468 6520 hments uses the │ │ │ +00118120: 6578 7465 6e64 6564 2062 696e 6172 7920 extended binary │ │ │ +00118130: 7479 7065 2063 6f6d 7061 7261 626c 6520 type comparable │ │ │ +00118140: 746f 2044 494d 4520 7375 7070 6f72 742e to DIME support. │ │ │ +00118150: 2054 6869 7320 6269 6e61 7279 2074 7970 This binary typ │ │ │ +00118160: 6520 6973 2070 7265 6465 6669 6e65 6420 e is predefined │ │ │ +00118170: 696e 2074 6865 203c 656d 3e3c 636f 6465 in the import/xop.h file:< │ │ │ +001181a0: 2f70 3e0a 3c64 6976 2063 6c61 7373 3d22 /p>.

//gsoap xop sc │ │ │ +001181f0: 6865 6d61 2069 6d70 6f72 743a 2068 7474 hema import: htt │ │ │ +00118200: 703a 2f2f 7777 772e 7733 2e6f 7267 2f32 p://www.w3.org/2 │ │ │ +00118210: 3030 342f 3038 2f78 6f70 2f69 6e63 6c75 004/08/xop/inclu │ │ │ +00118220: 6465 203c 2f73 7061 6e3e 3c2f 6469 763e de
│ │ │ +00118230: 0a3c 6469 7620 636c 6173 733d 226c 696e .
struct │ │ │ +00118260: 3c2f 7370 616e 3e3c 6120 636c 6173 733d _xop_ │ │ │ +001182a0: 5f49 6e63 6c75 6465 3c2f 613e 203c 2f64 _Include .
{
. │ │ │ +001182e0: 2020 2020 3c73 7061 6e20 636c 6173 733d un │ │ │ +00118300: 7369 676e 6564 3c2f 7370 616e 3e20 3c73 signed char *__ptr │ │ │ +00118390: 3c2f 613e 3b20 3c2f 6469 763e 0a3c 6469 ;
. │ │ │ +001183b0: 2020 203c 7370 616e 2063 6c61 7373 3d22 int │ │ │ +001183d0: 3c2f 7370 616e 3e20 3c61 2063 6c61 7373 __ │ │ │ +00118430: 7369 7a65 3c2f 613e 3b20 3c2f 6469 763e size;
│ │ │ +00118440: 0a3c 6469 7620 636c 6173 733d 226c 696e .
char *id; .
char * │ │ │ +00118520: 3c61 2063 6c61 7373 3d22 636f 6465 2220 type; │ │ │ +00118580: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.. │ │ │ +00118640: 7d3b 203c 2f64 6976 3e0a 3c64 6976 2063 };
.
typedef │ │ │ +00118680: 203c 7370 616e 2063 6c61 7373 3d22 6b65 struct _xop__I │ │ │ +001186e0: 6e63 6c75 6465 3c2f 613e 203c 6120 636c nclude _ │ │ │ +00118720: 786f 705f 5f49 6e63 6c75 6465 3c2f 613e xop__Include │ │ │ +00118730: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
.
│ │ │ +00118780: 3c61 2068 7265 663d 2273 7472 7563 745f _xop__Inc │ │ │ +001187b0: 6c75 6465 3c2f 613e 3c2f 6469 763e 3c64 lude
XOP include str │ │ │ +001187e0: 7563 7475 7265 2077 6974 6820 6174 7461 ucture with atta │ │ │ +001187f0: 6368 6d65 6e74 2064 6174 612e 3c2f 6469 chment data.
Definiti │ │ │ +00118820: 6f6e 3a3c 2f62 3e20 7374 6473 6f61 7032 on: stdsoap2 │ │ │ +00118830: 2e68 3a39 3838 333c 2f64 6976 3e3c 2f64 .h:9883
.
_xop__Inc │ │ │ +00118900: 6c75 6465 3a3a 7479 7065 3c2f 613e 3c2f lude::type
char * t │ │ │ +00118930: 7970 653c 2f64 6976 3e3c 6469 7620 636c ype
MIME │ │ │ +00118950: 2074 7970 6520 6f66 2074 6865 2064 6174 type of the dat │ │ │ +00118960: 612e 3c2f 6469 763e 3c64 6976 2063 6c61 a.
De │ │ │ +00118980: 6669 6e69 7469 6f6e 3a3c 2f62 3e20 7374 finition: st │ │ │ +00118990: 6473 6f61 7032 2e68 3a39 3838 373c 2f64 dsoap2.h:9887
..< │ │ │ +00118cc0: 6469 7620 636c 6173 733d 2274 7463 2220 div class="ttc" │ │ │ +00118cd0: 6964 3d22 6173 7472 7563 745f 5f78 6f70 id="astruct__xop │ │ │ +00118ce0: 5f5f 5f5f 5f69 6e63 6c75 6465 5f68 746d _____include_htm │ │ │ +00118cf0: 6c5f 6139 3262 6537 6134 3563 6132 3832 l_a92be7a45ca282 │ │ │ +00118d00: 6665 6565 3361 3533 6665 6466 3563 3361 feee3a53fedf5c3a │ │ │ +00118d10: 3430 3522 3e3c 6469 7620 636c 6173 733d 405">
int __size< │ │ │ +00118db0: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
size of │ │ │ +00118dd0: 7468 6520 6269 6e61 7279 2064 6174 613c the binary data< │ │ │ +00118de0: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
Defin │ │ │ +00118e00: 6974 696f 6e3a 3c2f 623e 2073 7464 736f ition: stdso │ │ │ +00118e10: 6170 322e 683a 3938 3835 3c2f 6469 763e ap2.h:9885
│ │ │ +00118e20: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
.
< │ │ │ +00118fb0: 703e 5468 6520 6164 6469 7469 6f6e 616c p>The additional │ │ │ +00118fc0: 203c 636f 6465 3e69 643c 2f63 6f64 653e id │ │ │ +00118fd0: 2c20 3c63 6f64 653e 7479 7065 3c2f 636f , type, and o │ │ │ +00118ff0: 7074 696f 6e3c 2f63 6f64 653e 206d 656d ption mem │ │ │ +00119000: 6265 7273 2065 6e61 626c 6520 4d54 4f4d bers enable MTOM │ │ │ +00119010: 2061 7474 6163 686d 656e 7473 2066 6f72 attachments for │ │ │ +00119020: 2074 6865 2064 6174 6120 706f 696e 7465 the data pointe │ │ │ +00119030: 6420 746f 2062 7920 3c63 6f64 653e 5f5f d to by __ │ │ │ +00119040: 7074 723c 2f63 6f64 653e 206f 6620 7369 ptr of si │ │ │ +00119050: 7a65 203c 636f 6465 3e5f 5f73 697a 653c ze __size< │ │ │ +00119060: 2f63 6f64 653e 2e20 5468 6520 7072 6f63 /code>. The proc │ │ │ +00119070: 6573 7320 666f 7220 7365 6e64 696e 6720 ess for sending │ │ │ +00119080: 616e 6420 7265 6365 6976 696e 6720 4d54 and receiving MT │ │ │ +00119090: 4f4d 2058 4f50 2061 7474 6163 686d 656e OM XOP attachmen │ │ │ +001190a0: 7473 2069 7320 6675 6c6c 7920 6175 746f ts is fully auto │ │ │ +001190b0: 6d61 7465 642e 2054 6865 203c 636f 6465 mated. The id membe │ │ │ +001190d0: 7220 7265 6665 7265 6e63 6573 2074 6865 r references the │ │ │ +001190e0: 2061 7474 6163 686d 656e 742c 2074 7970 attachment, typ │ │ │ +001190f0: 6963 616c 6c79 2061 2063 6f6e 7465 6e74 ically a content │ │ │ +00119100: 2069 6420 4349 4420 6f72 2055 5549 4420 id CID or UUID │ │ │ +00119110: 7768 6963 6820 6361 6e20 6265 206f 6274 which can be obt │ │ │ +00119120: 6169 6e65 6420 7769 7468 203c 636f 6465 ained with soap_rand_uuid │ │ │ +001191c0: 3c2f 613e 3c2f 636f 6465 3e2e 2057 6865 . Whe │ │ │ +001191d0: 6e20 7365 7420 746f 204e 554c 4c2c 2061 n set to NULL, a │ │ │ +001191e0: 2075 6e69 7175 6520 4349 4420 6973 2061 unique CID is a │ │ │ +001191f0: 7574 6f6d 6174 6963 616c 6c79 2075 7365 utomatically use │ │ │ +00119200: 642e 2054 6865 203c 636f 6465 3e74 7970 d. The typ │ │ │ +00119210: 653c 2f63 6f64 653e 2066 6965 6c64 2073 e field s │ │ │ +00119220: 7065 6369 6669 6573 2074 6865 2072 6571 pecifies the req │ │ │ +00119230: 7569 7265 6420 4d49 4d45 2074 7970 6520 uired MIME type │ │ │ +00119240: 6f66 2074 6865 2062 696e 6172 7920 6461 of the binary da │ │ │ +00119250: 7461 2c20 616e 6420 7468 6520 6f70 7469 ta, and the opti │ │ │ +00119260: 6f6e 616c 203c 636f 6465 3e6f 7074 696f onal optio │ │ │ +00119270: 6e73 3c2f 636f 6465 3e20 6d65 6d62 6572 ns member │ │ │ +00119280: 2063 616e 2062 6520 7573 6564 2074 6f20 can be used to │ │ │ +00119290: 7069 6767 792d 6261 636b 2064 6573 6372 piggy-back descr │ │ │ +001192a0: 6970 7469 7665 2074 6578 7420 7769 7468 iptive text with │ │ │ +001192b0: 2061 6e20 6174 7461 6368 6d65 6e74 2e20 an attachment. │ │ │ +001192c0: 5468 6520 6f72 6465 7220 6f66 2074 6865 The order of the │ │ │ +001192d0: 2064 6563 6c61 7261 7469 6f6e 206f 6620 declaration of │ │ │ +001192e0: 7468 6520 6d65 6d62 6572 7320 6973 2073 the members is s │ │ │ +001192f0: 6967 6e69 6669 6361 6e74 2e3c 2f70 3e0a ignificant.

. │ │ │ +00119300: 3c70 3e59 6f75 2063 616e 2069 6d70 6f72

You can impor │ │ │ +00119310: 7420 3c65 6d3e 3c63 6f64 653e 786f 702e t xop. │ │ │ +00119320: 683c 2f63 6f64 653e 3c2f 656d 3e20 696e h in │ │ │ +00119330: 2079 6f75 7220 696e 7465 7266 6163 6520 your interface │ │ │ +00119340: 6865 6164 6572 2066 696c 6520 746f 2075 header file to u │ │ │ +00119350: 7365 2074 6865 204d 544f 4d20 6174 7461 se the MTOM atta │ │ │ +00119360: 6368 6d65 6e74 732c 2066 6f72 2065 7861 chments, for exa │ │ │ +00119370: 6d70 6c65 3a3c 2f70 3e0a 3c64 6976 2063 mple:

.
│ │ │ +00119390: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
#im │ │ │ +001193c0: 706f 7274 2026 7175 6f74 3b69 6d70 6f72 port "impor │ │ │ +001193d0: 742f 786f 702e 6826 7175 6f74 3b3c 2f73 t/xop.h"
.
#import │ │ │ +00119420: 2026 7175 6f74 3b69 6d70 6f72 742f 786d "import/xm │ │ │ +00119430: 696d 6535 2e68 2671 756f 743b 3c2f 7370 ime5.h"
.
#import │ │ │ +00119480: 2671 756f 743b 696d 706f 7274 2f73 6f61 "import/soa │ │ │ +00119490: 7031 322e 6826 7175 6f74 3b3c 2f73 7061 p12.h"
.
/* alternative │ │ │ +001194e0: 6c79 2c20 7769 7468 6f75 7420 7468 6520 ly, without the │ │ │ +001194f0: 696d 706f 7274 2061 626f 7665 2c20 7573 import above, us │ │ │ +00119500: 653a 203c 2f73 7061 6e3e 3c2f 6469 763e e:
│ │ │ +00119510: 0a3c 6469 7620 636c 6173 733d 226c 696e .
//gsoap │ │ │ +00119540: 2053 4f41 502d 454e 5620 7363 6865 6d61 SOAP-ENV schema │ │ │ +00119550: 206e 616d 6573 7061 6365 3a20 6874 7470 namespace: http │ │ │ +00119560: 3a2f 2f77 7777 2e77 332e 6f72 672f 3230 ://www.w3.org/20 │ │ │ +00119570: 3033 2f30 352f 736f 6170 2d65 6e76 656c 03/05/soap-envel │ │ │ +00119580: 6f70 6520 3c2f 7370 616e 3e3c 2f64 6976 ope
.
//gsoa │ │ │ +001195c0: 7020 534f 4150 2d45 4e43 2073 6368 656d p SOAP-ENC schem │ │ │ +001195d0: 6120 6e61 6d65 7370 6163 653a 2068 7474 a namespace: htt │ │ │ +001195e0: 703a 2f2f 7777 772e 7733 2e6f 7267 2f32 p://www.w3.org/2 │ │ │ +001195f0: 3030 332f 3035 2f73 6f61 702d 656e 636f 003/05/soap-enco │ │ │ +00119600: 6469 6e67 203c 2f73 7061 6e3e 3c2f 6469 ding .
*/
.
< │ │ │ +00119660: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
// │ │ │ +00119690: 6773 6f61 7020 7820 7363 6865 6d61 206e gsoap x schema n │ │ │ +001196a0: 616d 6573 7061 6365 3a20 6874 7470 3a2f amespace: http:/ │ │ │ +001196b0: 2f6d 792e 6669 7273 742e 6d74 6f6d 2e6e /my.first.mtom.n │ │ │ +001196c0: 6574 203c 2f73 7061 6e3e 3c2f 6469 763e et
│ │ │ +001196d0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
struct │ │ │ +00119700: 3c2f 7370 616e 3e78 5f5f 6d79 4461 7461 x__myData │ │ │ +00119710: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
{
.
_xop │ │ │ +00119780: 5f5f 496e 636c 7564 653c 2f61 3e20 786f __Include xo │ │ │ +00119790: 705f 5f49 6e63 6c75 6465 3b20 3c73 7061 p__Include; // attachment │ │ │ +001197c0: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ +001197e0: 2020 4020 3c73 7061 6e20 636c 6173 733d @ ch │ │ │ +00119800: 6172 3c2f 7370 616e 3e20 2a78 6d69 6d65 ar *xmime │ │ │ +00119810: 355f 5f63 6f6e 7465 6e74 5479 7065 3b20 5__contentType; │ │ │ +00119820: 203c 7370 616e 2063 6c61 7373 3d22 636f // and it │ │ │ +00119840: 7320 636f 6e74 656e 7454 7970 6520 3c2f s contentType
.
}; │ │ │ +00119870: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
int x │ │ │ +001198b0: 5f5f 6d79 4d54 4f4d 7465 7374 283c 7370 __myMTOMtest(struct │ │ │ +001198e0: 2078 5f5f 6d79 4461 7461 202a 696e 2c20 x__myData *in, │ │ │ +001198f0: 3c73 7061 6e20 636c 6173 733d 226b 6579 struct x__myData *o │ │ │ +00119920: 7574 293b 3c2f 6469 763e 0a3c 2f64 6976 ut);
.

With │ │ │ +00119da0: 6f75 7420 7468 6973 2066 6c61 672c 2074 out this flag, t │ │ │ +00119db0: 6865 2061 7474 6163 686d 656e 7473 2077 he attachments w │ │ │ +00119dc0: 696c 6c20 6265 2074 7261 6e73 6d69 7474 ill be transmitt │ │ │ +00119dd0: 6564 2069 6e20 4449 4d45 2066 6f72 6d61 ed in DIME forma │ │ │ +00119de0: 742c 2077 6869 6368 2069 7320 6e6f 7420 t, which is not │ │ │ +00119df0: 7768 6174 2077 6520 7761 6e74 2e20 4966 what we want. If │ │ │ +00119e00: 2079 6f75 7220 6375 7272 656e 7420 636c your current cl │ │ │ +00119e10: 6965 6e74 7320 616e 6420 7365 7276 6963 ients and servic │ │ │ +00119e20: 6573 2061 7265 2062 6173 6564 206f 6e20 es are based on │ │ │ +00119e30: 6e6f 6e2d 7374 7265 616d 696e 6720 4449 non-streaming DI │ │ │ +00119e40: 4d45 2061 7474 6163 686d 656e 7473 2075 ME attachments u │ │ │ +00119e50: 7369 6e67 2074 6865 2053 4f41 5020 626f sing the SOAP bo │ │ │ +00119e60: 6479 2072 6566 6572 656e 6365 206d 6563 dy reference mec │ │ │ +00119e70: 6861 6e69 736d 2028 7468 7573 2c20 7769 hanism (thus, wi │ │ │ +00119e80: 7468 6f75 7420 7573 696e 6720 7468 6520 thout using the │ │ │ +00119e90: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 soa │ │ │ +00119f20: 705f 7365 745f 6469 6d65 5f61 7474 6163 p_set_dime_attac │ │ │ +00119f30: 686d 656e 743c 2f61 3e3c 2f63 6f64 653e hment │ │ │ +00119f40: 2066 756e 6374 696f 6e29 206f 7220 706c function) or pl │ │ │ +00119f50: 6169 6e20 6261 7365 3634 2062 696e 6172 ain base64 binar │ │ │ +00119f60: 7920 584d 4c20 6461 7461 2065 6c65 6d65 y XML data eleme │ │ │ +00119f70: 6e74 732c 2069 7420 6973 2076 6572 7920 nts, it is very │ │ │ +00119f80: 6561 7379 2074 6f20 6164 6f70 7420 4d54 easy to adopt MT │ │ │ +00119f90: 4f4d 2062 7920 7265 6e61 6d69 6e67 2074 OM by renaming t │ │ │ +00119fa0: 6865 2062 696e 6172 7920 7479 7065 7320 he binary types │ │ │ +00119fb0: 746f 203c 636f 6465 3e78 6f70 5f5f 496e to xop__In │ │ │ +00119fc0: 636c 7564 653c 2f63 6f64 653e 2061 6e64 clude and │ │ │ +00119fd0: 2075 7369 6e67 2074 6865 203c 636f 6465 using the #SOAP_ENC_MTOM< │ │ │ +00119ff0: 2f63 6f64 653e 2066 6c61 6720 7769 7468 /code> flag with │ │ │ +0011a000: 2074 6865 2053 4f41 5020 312e 3220 6e61 the SOAP 1.2 na │ │ │ +0011a010: 6d65 7370 6163 652e 3c2f 703e 0a3c 703e mespace.

.

│ │ │ +0011a020: 5365 6520 616c 736f 2041 5049 2064 6f63 See also API doc │ │ │ +0011a030: 756d 656e 7461 7469 6f6e 204d 6f64 756c umentation Modul │ │ │ +0011a040: 6520 3c61 2063 6c61 7373 3d22 656c 2220 e M │ │ │ +0011a070: 494d 4520 6174 7461 6368 6d65 6e74 2066 IME attachment f │ │ │ +0011a080: 756e 6374 696f 6e73 3c2f 613e 2e3c 2f70 unctions.

.

.... Back to ta │ │ │ +0011a0b0: 626c 6520 6f66 2063 6f6e 7465 6e74 733c ble of contents< │ │ │ +0011a0c0: 2f61 3e3c 2f70 3e0a 3c68 323e 3c61 2063 /a>

.

│ │ │ +0011a0f0: 0a47 656e 6572 6174 696e 6720 4d75 6c74 .Generating Mult │ │ │ +0011a100: 6970 6172 7452 656c 6174 6564 204d 494d ipartRelated MIM │ │ │ +0011a110: 4520 6174 7461 6368 6d65 6e74 2062 696e E attachment bin │ │ │ +0011a120: 6469 6e67 7320 696e 2057 5344 4c3c 2f68 dings in WSDL.

To generat │ │ │ +0011a140: 6520 6d75 6c74 6970 6172 7452 656c 6174 e multipartRelat │ │ │ +0011a150: 6564 2062 696e 6469 6e67 7320 696e 2074 ed bindings in t │ │ │ +0011a160: 6865 2057 5344 4c20 6669 6c65 2069 6e64 he WSDL file ind │ │ │ +0011a170: 6963 6174 696e 6720 7468 6520 7573 6520 icating the use │ │ │ +0011a180: 6f66 204d 494d 4520 6174 7461 6368 6d65 of MIME attachme │ │ │ +0011a190: 6e74 732c 2075 7365 3a3c 2f70 3e0a 3c64 nts, use:

.
//gs │ │ │ +0011a1e0: 6f61 7020 266c 743b 7072 6566 6978 2667 oap <prefix&g │ │ │ +0011a1f0: 743b 2073 6572 7669 6365 206d 6574 686f t; service metho │ │ │ +0011a200: 642d 6d69 6d65 2d74 7970 653a 202e 2e2e d-mime-type: ... │ │ │ +0011a210: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c2f
.

This dir │ │ │ +0011a240: 6563 7469 7665 2064 6972 6563 7469 7665 ective directive │ │ │ +0011a250: 2063 616e 2062 6520 7265 7065 6174 6564 can be repeated │ │ │ +0011a260: 2066 6f72 2065 6163 6820 6174 7461 6368 for each attach │ │ │ +0011a270: 6d65 6e74 2079 6f75 2077 616e 7420 746f ment you want to │ │ │ +0011a280: 2061 7373 6f63 6961 7465 2077 6974 6820 associate with │ │ │ +0011a290: 6120 6d65 7468 6f64 2773 2072 6571 7565 a method's reque │ │ │ +0011a2a0: 7374 2061 6e64 2072 6573 706f 6e73 6520 st and response │ │ │ +0011a2b0: 6d65 7373 6167 652e 2073 6565 2061 6c73 message. see als │ │ │ +0011a2c0: 6f20 5365 6374 696f 6e20 3c61 2063 6c61 o Section Directives< │ │ │ +0011a300: 2f61 3e20 2e3c 2f70 3e0a 3c70 3e46 6f72 /a> .

.

For │ │ │ +0011a310: 2065 7861 6d70 6c65 3a3c 2f70 3e0a 3c64 example:

.
#import "i │ │ │ +0011a370: 6d70 6f72 742f 786f 702e 6826 7175 6f74 mport/xop.h" │ │ │ +0011a380: 3b3c 2f73 7061 6e3e 203c 2f64 6976 3e0a ;
. │ │ │ +0011a390: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
#im │ │ │ +0011a3c0: 706f 7274 2026 7175 6f74 3b69 6d70 6f72 port "impor │ │ │ +0011a3d0: 742f 786d 696d 6535 2e68 2671 756f 743b t/xmime5.h" │ │ │ +0011a3e0: 3c2f 7370 616e 3e20 3c2f 6469 763e 0a3c
.< │ │ │ +0011a3f0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +0011a400: 3e3c 7370 616e 2063 6c61 7373 3d22 7072 >#imp │ │ │ +0011a420: 6f72 7420 2671 756f 743b 696d 706f 7274 ort "import │ │ │ +0011a430: 2f73 6f61 7031 322e 6826 7175 6f74 3b3c /soap12.h"< │ │ │ +0011a440: 2f73 7061 6e3e 203c 2f64 6976 3e0a 3c64 /span>

. │ │ │ +0011a460: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
│ │ │ +0011a490: 2f2f 6773 6f61 7020 7820 7363 6865 6d61 //gsoap x schema │ │ │ +0011a4a0: 206e 616d 6573 7061 6365 3a20 6874 7470 namespace: http │ │ │ +0011a4b0: 3a2f 2f6d 792e 6669 7273 742e 6d74 6f6d ://my.first.mtom │ │ │ +0011a4c0: 2e6e 6574 203c 2f73 7061 6e3e 3c2f 6469 .net .
struc │ │ │ +0011a500: 7420 3c2f 7370 616e 3e78 5f5f 6d79 4461 t x__myDa │ │ │ +0011a510: 7461 203c 2f64 6976 3e0a 3c64 6976 2063 ta
.
{.
_x │ │ │ +0011a580: 6f70 5f5f 496e 636c 7564 653c 2f61 3e20 op__Include │ │ │ +0011a590: 786f 705f 5f49 6e63 6c75 6465 3b20 3c73 xop__Include; // attachmen │ │ │ +0011a5c0: 7420 3c2f 7370 616e 3e3c 2f64 6976 3e0a t
. │ │ │ +0011a5d0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
@ │ │ │ +0011a600: 6368 6172 3c2f 7370 616e 3e20 2a78 6d69 char *xmi │ │ │ +0011a610: 6d65 355f 5f63 6f6e 7465 6e74 5479 7065 me5__contentType │ │ │ +0011a620: 3b20 203c 7370 616e 2063 6c61 7373 3d22 ; // and │ │ │ +0011a640: 6974 7320 636f 6e74 656e 7454 7970 6520 its contentType │ │ │ +0011a650: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ +0011a670: 7d3b 203c 2f64 6976 3e0a 3c64 6976 2063 };
.
//gsoap x serv │ │ │ +0011a6b0: 6963 6520 6d65 7468 6f64 2d6d 696d 652d ice method-mime- │ │ │ +0011a6c0: 7479 7065 3a20 6d79 4d54 4f4d 7465 7374 type: myMTOMtest │ │ │ +0011a6d0: 2074 6578 742f 786d 6c20 3c2f 7370 616e text/xml
.
int x │ │ │ +0011a720: 5f5f 6d79 4d54 4f4d 7465 7374 283c 7370 __myMTOMtest(struct │ │ │ +0011a750: 2078 5f5f 6d79 4461 7461 202a 696e 2c20 x__myData *in, │ │ │ +0011a760: 3c73 7061 6e20 636c 6173 733d 226b 6579 struct x__myData *o │ │ │ +0011a790: 7574 293b 3c2f 6469 763e 0a3c 2f64 6976 ut);
.

│ │ │ +0011aa30: 5369 6d69 6c61 726c 792c 2074 6f20 6269 Similarly, to bi │ │ │ +0011aa40: 6e64 2061 7474 6163 686d 656e 7473 206f nd attachments o │ │ │ +0011aa50: 6e6c 7920 746f 2074 6865 2072 6573 706f nly to the respo │ │ │ +0011aa60: 6e73 6520 6d65 7373 6167 6520 6f66 2061 nse message of a │ │ │ +0011aa70: 6e20 6f70 6572 6174 696f 6e2c 2075 7365 n operation, use │ │ │ +0011aa80: 3a3c 2f70 3e0a 3c64 6976 2063 6c61 7373 :

.
//gsoap < │ │ │ +0011aad0: 7072 6566 6978 2667 743b 2073 6572 7669 prefix> servi │ │ │ +0011aae0: 6365 206d 6574 686f 642d 6f75 7470 7574 ce method-output │ │ │ +0011aaf0: 2d6d 696d 652d 7479 7065 3a20 2e2e 2e3c -mime-type: ...< │ │ │ +0011ab00: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 2f64 /span>
.

The wsdl2 │ │ │ +0011ab30: 6820 746f 6f6c 2072 6563 6f67 6e69 7a65 h tool recognize │ │ │ +0011ab40: 7320 4d49 4d45 2061 7474 6163 686d 656e s MIME attachmen │ │ │ +0011ab50: 7473 2061 6e64 2070 726f 6475 6365 7320 ts and produces │ │ │ +0011ab60: 616e 2061 6e6e 6f74 6174 6564 2068 6561 an annotated hea │ │ │ +0011ab70: 6465 7220 6669 6c65 2e3c 2f70 3e0a 3c70 der file.

.

You can repeat │ │ │ +0011ab90: 7468 6573 6520 6469 7265 6374 6976 6573 these directives │ │ │ +0011aba0: 2066 6f72 2061 6c6c 206d 756c 7469 7061 for all multipa │ │ │ +0011abb0: 7274 5265 6c61 7465 6420 4d49 4d45 2061 rtRelated MIME a │ │ │ +0011abc0: 7474 6163 686d 656e 7473 2079 6f75 2077 ttachments you w │ │ │ +0011abd0: 616e 7420 746f 2061 7373 6f63 6961 7465 ant to associate │ │ │ +0011abe0: 2077 6974 6820 7468 6520 7365 7276 6963 with the servic │ │ │ +0011abf0: 6520 6f70 6572 6174 696f 6e20 696e 7075 e operation inpu │ │ │ +0011ac00: 7420 616e 6420 6f75 7470 7574 2e3c 2f70 t and output.

.

.... Back to ta │ │ │ +0011ac30: 626c 6520 6f66 2063 6f6e 7465 6e74 733c ble of contents< │ │ │ +0011ac40: 2f61 3e3c 2f70 3e0a 3c68 323e 3c61 2063 /a>

.

.Sen │ │ │ +0011ac80: 6469 6e67 2061 6e64 2072 6563 6569 7669 ding and receivi │ │ │ +0011ac90: 6e67 204d 544f 4d20 6174 7461 6368 6d65 ng MTOM attachme │ │ │ +0011aca0: 6e74 733c 2f68 323e 0a3c 703e 4120 7265 nts

.

A re │ │ │ +0011acb0: 6365 6976 6572 206d 7573 7420 6265 2069 ceiver must be i │ │ │ +0011acc0: 6e66 6f72 6d65 6420 746f 2072 6563 6f67 nformed to recog │ │ │ +0011acd0: 6e69 7a65 204d 544f 4d20 6174 7461 6368 nize MTOM attach │ │ │ +0011ace0: 6d65 6e74 7320 6279 2073 6574 7469 6e67 ments by setting │ │ │ +0011acf0: 2074 6865 203c 636f 6465 3e23 534f 4150 the #SOAP │ │ │ +0011ad00: 5f45 4e43 5f4d 544f 4d3c 2f63 6f64 653e _ENC_MTOM │ │ │ +0011ad10: 2066 6c61 6720 6f66 2074 6865 203c 636f flag of the s │ │ │ +0011ad70: 6f61 703c 2f61 3e3c 2f63 6f64 653e 2063 oap c │ │ │ +0011ad80: 6f6e 7465 7874 2e20 4f74 6865 7277 6973 ontext. Otherwis │ │ │ +0011ad90: 652c 2074 6865 2072 6567 756c 6172 204d e, the regular M │ │ │ +0011ada0: 494d 4520 6174 7461 6368 6d65 6e74 206d IME attachment m │ │ │ +0011adb0: 6563 6861 6e69 736d 2028 5377 4129 2077 echanism (SwA) w │ │ │ +0011adc0: 696c 6c20 6265 2075 7365 6420 746f 2073 ill be used to s │ │ │ +0011add0: 746f 7265 2061 7474 6163 686d 656e 7473 tore attachments │ │ │ +0011ade0: 2e3c 2f70 3e0a 3c70 3e57 6865 6e20 7573 .

.

When us │ │ │ +0011adf0: 696e 6720 7773 646c 3268 2074 6f20 6275 ing wsdl2h to bu │ │ │ +0011ae00: 696c 6420 636c 6965 6e74 7320 616e 642f ild clients and/ │ │ │ +0011ae10: 6f72 2073 6572 7669 6365 732c 2079 6f75 or services, you │ │ │ +0011ae20: 2073 686f 756c 6420 7573 6520 7468 6520 should use the │ │ │ +0011ae30: 3c65 6d3e 3c63 6f64 653e 7479 7065 6d61 typema │ │ │ +0011ae40: 702e 6461 743c 2f63 6f64 653e 3c2f 656d p.dat file included │ │ │ +0011ae60: 696e 2074 6865 2067 534f 4150 2073 6f75 in the gSOAP sou │ │ │ +0011ae70: 7263 6520 636f 6465 2070 6163 6b61 6765 rce code package │ │ │ +0011ae80: 2e20 5468 6520 3c65 6d3e 3c63 6f64 653e . The │ │ │ +0011ae90: 7479 7065 6d61 702e 6461 743c 2f63 6f64 typemap.dat file def │ │ │ +0011aeb0: 696e 6573 2074 6865 2058 4f50 206e 616d ines the XOP nam │ │ │ +0011aec0: 6573 7061 6365 2061 6e64 2058 4d4c 204d espace and XML M │ │ │ +0011aed0: 494d 4520 6e61 6d65 7370 6163 6573 2061 IME namespaces a │ │ │ +0011aee0: 7320 696d 706f 7274 6564 206e 616d 6573 s imported names │ │ │ +0011aef0: 7061 6365 733a 203c 2f70 3e3c 7072 6520 paces:

xop    = <ht
│ │ │ +0011af20: 7470 3a2f 2f77 7777 2e77 332e 6f72 672f  tp://www.w3.org/
│ │ │ +0011af30: 3230 3034 2f30 382f 786f 702f 696e 636c  2004/08/xop/incl
│ │ │ +0011af40: 7564 6526 6774 3b20 0a78 6d69 6d65 3520  ude> .xmime5 
│ │ │ +0011af50: 3d20 266c 743b 6874 7470 3a2f 2f77 7777  = <http://www
│ │ │ +0011af60: 2e77 332e 6f72 672f 3230 3035 2f30 352f  .w3.org/2005/05/
│ │ │ +0011af70: 786d 6c6d 696d 6526 6774 3b20 0a78 6d69  xmlmime> .xmi
│ │ │ +0011af80: 6d65 3420 3d20 266c 743b 6874 7470 3a2f  me4 = <http:/
│ │ │ +0011af90: 2f77 7777 2e77 332e 6f72 672f 3230 3034  /www.w3.org/2004
│ │ │ +0011afa0: 2f31 312f 786d 6c6d 696d 6526 6774 3b0a  /11/xmlmime>.
│ │ │ +0011afb0: 3c2f 7072 653e 3c70 3e20 5468 6520 7773  

The ws │ │ │ +0011afc0: 646c 3268 2074 6f6f 6c20 7573 6573 2074 dl2h tool uses t │ │ │ +0011afd0: 6865 203c 656d 3e3c 636f 6465 3e74 7970 he typ │ │ │ +0011afe0: 656d 6170 2e64 6174 3c2f 636f 6465 3e3c emap.dat< │ │ │ +0011aff0: 2f65 6d3e 2066 696c 6520 746f 2063 6f6e /em> file to con │ │ │ +0011b000: 7665 7274 2057 5344 4c20 696e 746f 2061 vert WSDL into a │ │ │ +0011b010: 6e20 696e 7465 7266 6163 6520 6865 6164 n interface head │ │ │ +0011b020: 6572 2066 696c 652e 2049 6e20 7468 6973 er file. In this │ │ │ +0011b030: 2063 6173 6520 7765 2064 6f6e 2774 2077 case we don't w │ │ │ +0011b040: 616e 7420 7468 6520 7773 646c 3268 2074 ant the wsdl2h t │ │ │ +0011b050: 6f6f 6c20 746f 2072 6561 6420 7468 6520 ool to read the │ │ │ +0011b060: 584f 5020 7363 6865 6d61 2061 6e64 2074 XOP schema and t │ │ │ +0011b070: 7261 6e73 6c61 7465 2069 742c 2073 696e ranslate it, sin │ │ │ +0011b080: 6365 2077 6520 6861 7665 2061 2070 7265 ce we have a pre │ │ │ +0011b090: 2d64 6566 696e 6564 203c 636f 6465 3e3c -defined < │ │ │ +0011b0a0: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ +0011b0b0: 663d 2273 7472 7563 745f 5f78 6f70 5f5f f="struct__xop__ │ │ │ +0011b0c0: 5f5f 5f69 6e63 6c75 6465 2e68 746d 6c22 ___include.html" │ │ │ +0011b0d0: 2074 6974 6c65 3d22 584f 5020 696e 636c title="XOP incl │ │ │ +0011b0e0: 7564 6520 7374 7275 6374 7572 6520 7769 ude structure wi │ │ │ +0011b0f0: 7468 2061 7474 6163 686d 656e 7420 6461 th attachment da │ │ │ +0011b100: 7461 2e22 3e5f 786f 705f 5f49 6e63 6c75 ta.">_xop__Inclu │ │ │ +0011b110: 6465 3c2f 613e 3c2f 636f 6465 3e20 656c de el │ │ │ +0011b120: 656d 656e 7420 746f 2068 616e 646c 6520 ement to handle │ │ │ +0011b130: 584f 5020 666f 7220 4d54 4f4d 2e20 5468 XOP for MTOM. Th │ │ │ +0011b140: 6973 203c 636f 6465 3e3c 6120 636c 6173 is _ │ │ │ +0011b1b0: 786f 705f 5f49 6e63 6c75 6465 3c2f 613e xop__Include │ │ │ +0011b1c0: 3c2f 636f 6465 3e20 656c 656d 656e 7420 element │ │ │ +0011b1d0: 6973 2064 6566 696e 6564 2069 6e20 3c65 is defined in xop.h. There │ │ │ +0011b200: 666f 7265 2c20 7468 6520 6269 6e64 696e fore, the bindin │ │ │ +0011b210: 6773 2073 686f 776e 2061 626f 7665 2077 gs shown above w │ │ │ +0011b220: 696c 6c20 6e6f 7420 7472 616e 736c 6174 ill not translat │ │ │ +0011b230: 6520 7468 6520 584f 5020 616e 6420 584d e the XOP and XM │ │ │ +0011b240: 4c20 4d49 4d45 2073 6368 656d 6173 2074 L MIME schemas t │ │ │ +0011b250: 6f20 636f 6465 2c20 6275 7420 6765 6e65 o code, but gene │ │ │ +0011b260: 7261 7465 7320 3c63 6f64 653e 2369 6d70 rates #imp │ │ │ +0011b270: 6f72 743c 2f63 6f64 653e 2073 7461 7465 ort state │ │ │ +0011b280: 6d65 6e74 7320 696e 7374 6561 6420 696e ments instead in │ │ │ +0011b290: 2074 6865 2067 656e 6572 6174 6564 2069 the generated i │ │ │ +0011b2a0: 6e74 6572 6661 6365 2068 6561 6465 7220 nterface header │ │ │ +0011b2b0: 6669 6c65 3a3c 2f70 3e0a 3c64 6976 2063 file:

.
│ │ │ +0011b2d0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
#im │ │ │ +0011b300: 706f 7274 2026 7175 6f74 3b78 6f70 2e68 port "xop.h │ │ │ +0011b310: 2671 756f 743b 3c2f 7370 616e 3e20 3c2f " .
#import " │ │ │ +0011b360: 786d 696d 6535 2e68 2671 756f 743b 3c2f xmime5.h"
.

The │ │ │ +0011b3a0: 2369 6d70 6f72 743c 2f63 6f64 653e 2073 #import s │ │ │ +0011b3b0: 7461 7465 6d65 6e74 7320 6172 6520 6f6e tatements are on │ │ │ +0011b3c0: 6c79 2061 6464 6564 2066 6f72 2074 686f ly added for tho │ │ │ +0011b3d0: 7365 206e 616d 6573 7061 6365 7320 7468 se namespaces th │ │ │ +0011b3e0: 6174 2061 7265 2061 6374 7561 6c6c 7920 at are actually │ │ │ +0011b3f0: 7573 6564 2e3c 2f70 3e0a 3c70 3e4c 6574 used.

.

Let │ │ │ +0011b400: 2773 2074 616b 6520 6120 6c6f 6f6b 2061 's take a look a │ │ │ +0011b410: 7420 616e 2065 7861 6d70 6c65 2e20 5468 t an example. Th │ │ │ +0011b420: 6520 7773 646c 3268 2069 6d70 6f72 7465 e wsdl2h importe │ │ │ +0011b430: 7220 6765 6e65 7261 7465 7320 6120 6865 r generates a he │ │ │ +0011b440: 6164 6572 2066 696c 6520 7769 7468 203c ader file with < │ │ │ +0011b450: 636f 6465 3e23 696d 706f 7274 2022 786f code>#import "xo │ │ │ +0011b460: 702e 6822 3c2f 636f 6465 3e20 6672 6f6d p.h" from │ │ │ +0011b470: 2061 2057 5344 4c20 7468 6174 2072 6566 a WSDL that ref │ │ │ +0011b480: 6572 656e 6365 7320 584f 502c 2066 6f72 erences XOP, for │ │ │ +0011b490: 2065 7861 6d70 6c65 3a3c 2f70 3e0a 3c64 example:

.
#import "x │ │ │ +0011b4f0: 6f70 2e68 2671 756f 743b 3c2f 7370 616e op.h"
.
#import &q │ │ │ +0011b540: 756f 743b 786d 696d 6535 2e68 2671 756f uot;xmime5.h&quo │ │ │ +0011b550: 743b 3c2f 7370 616e 3e20 3c2f 6469 763e t;
│ │ │ +0011b560: 0a3c 6469 7620 636c 6173 733d 226c 696e .
struct │ │ │ +0011b590: 3c2f 7370 616e 3e6e 735f 5f44 6174 6120 ns__Data │ │ │ +0011b5a0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
{
│ │ │ +0011b5c0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
_xop_ │ │ │ +0011b610: 5f49 6e63 6c75 6465 3c2f 613e 2078 6f70 _Include xop │ │ │ +0011b620: 5f5f 496e 636c 7564 653b 203c 2f64 6976 __Include;
.
@ char *x │ │ │ +0011b670: 6d69 6d65 355f 5f63 6f6e 7465 6e74 5479 mime5__contentTy │ │ │ +0011b680: 7065 3b20 203c 2f64 6976 3e0a 3c64 6976 pe;
.
}; │ │ │ +0011b6a0: 3c2f 6469 763e 0a3c 2f64 6976 3e3c 212d
.

Suppose the WSD │ │ │ +0011b6d0: 4c20 6465 6669 6e65 7320 616e 206f 7065 L defines an ope │ │ │ +0011b6e0: 7261 7469 6f6e 3a3c 2f70 3e0a 3c64 6976 ration:

.
in │ │ │ +0011b730: 743c 2f73 7061 6e3e 206e 735f 5f65 6368 t ns__ech │ │ │ +0011b740: 6f44 6174 6128 3c73 7061 6e20 636c 6173 oData(stru │ │ │ +0011b760: 6374 3c2f 7370 616e 3e20 6e73 5f5f 4461 ct ns__Da │ │ │ +0011b770: 7461 202a 696e 2c20 3c73 7061 6e20 636c ta *in, st │ │ │ +0011b790: 7275 6374 3c2f 7370 616e 3e20 6e73 5f5f ruct ns__ │ │ │ +0011b7a0: 4461 7461 202a 6f75 7429 3b3c 2f64 6976 Data *out);
.

Afte │ │ │ +0011b7d0: 7220 6765 6e65 7261 7469 6e67 2074 6865 r generating the │ │ │ +0011b7e0: 2073 7475 6220 6675 6e63 7469 6f6e 7320 stub functions │ │ │ +0011b7f0: 7769 7468 2074 6865 2073 6f61 7063 7070 with the soapcpp │ │ │ +0011b800: 3220 746f 6f6c 2c20 7765 2063 616e 2069 2 tool, we can i │ │ │ +0011b810: 6e76 6f6b 6520 7468 6520 7374 7562 2061 nvoke the stub a │ │ │ +0011b820: 7420 7468 6520 636c 6965 6e74 2073 6964 t the client sid │ │ │ +0011b830: 6520 7769 7468 3a3c 2f70 3e0a 3c64 6976 e with:

.
.
struct ns__Data data; │ │ │ +0011ba00: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
data.x │ │ │ +0011ba20: 6f70 5f5f 496e 636c 7564 652e 5f5f 7074 op__Include.__pt │ │ │ +0011ba30: 7220 3d20 283c 7370 616e 2063 6c61 7373 r = (u │ │ │ +0011ba50: 6e73 6967 6e65 643c 2f73 7061 6e3e 203c nsigned < │ │ │ +0011ba60: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +0011ba70: 6f72 6474 7970 6522 3e63 6861 723c 2f73 ordtype">char*)"<b> │ │ │ +0011bab0: 3b48 656c 6c6f 2077 6f72 6c64 2126 6c74 ;Hello world!< │ │ │ +0011bac0: 3b2f 6226 6774 3b26 7175 6f74 3b3c 2f73 ;/b>";
.d │ │ │ +0011baf0: 6174 612e 786f 705f 5f49 6e63 6c75 6465 ata.xop__Include │ │ │ +0011bb00: 2e5f 5f73 697a 6520 3d20 3230 3b20 3c2f .__size = 20; .
data.xop_ │ │ │ +0011bb30: 5f49 6e63 6c75 6465 2e69 6420 3d20 4e55 _Include.id = NU │ │ │ +0011bb40: 4c4c 3b20 2020 2020 2020 2020 2020 203c LL; < │ │ │ +0011bb50: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ +0011bb60: 656e 7422 3e2f 2f20 4349 4420 6175 746f ent">// CID auto │ │ │ +0011bb70: 6d61 7469 6361 6c6c 7920 6765 6e65 7261 matically genera │ │ │ +0011bb80: 7465 6420 6279 2065 6e67 696e 6520 3c2f ted by engine
.
da │ │ │ +0011bbb0: 7461 2e78 6f70 5f5f 496e 636c 7564 652e ta.xop__Include. │ │ │ +0011bbc0: 7479 7065 203d 203c 7370 616e 2063 6c61 type = "text/ht │ │ │ +0011bbf0: 6d6c 2671 756f 743b 3c2f 7370 616e 3e3b ml"; │ │ │ +0011bc00: 2020 203c 7370 616e 2063 6c61 7373 3d22 // MIME │ │ │ +0011bc20: 2074 7970 6520 3c2f 7370 616e 3e3c 2f64 type .
data.xop__ │ │ │ +0011bc50: 496e 636c 7564 652e 6f70 7469 6f6e 7320 Include.options │ │ │ +0011bc60: 3d20 4e55 4c4c 3b20 2020 2020 2020 3c73 = NULL; // no descri │ │ │ +0011bc90: 7074 6976 6520 696e 666f 2061 6464 6564 ptive info added │ │ │ +0011bca0: 203c 2f73 7061 6e3e 3c2f 6469 763e 0a3c
.< │ │ │ +0011bcb0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +0011bcc0: 3e64 6174 612e 786d 696d 6535 5f5f 636f >data.xmime5__co │ │ │ +0011bcd0: 6e74 656e 7454 7970 6520 3d20 3c73 7061 ntentType = "te │ │ │ +0011bd00: 7874 2f68 746d 6c26 7175 6f74 3b3c 2f73 xt/html"; // M │ │ │ +0011bd30: 494d 4520 7479 7065 203c 2f73 7061 6e3e IME type │ │ │ +0011bd40: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
if (so │ │ │ +0011bd80: 6170 5f63 616c 6c5f 6e73 5f5f 6563 686f ap_call_ns__echo │ │ │ +0011bd90: 4461 7461 283c 6120 636c 6173 733d 2263 Data(soap │ │ │ +0011bdc0: 3c2f 613e 2c20 656e 6470 6f69 6e74 2c20 , endpoint, │ │ │ +0011bdd0: 6163 7469 6f6e 2c20 2661 6d70 3b64 6174 action, &dat │ │ │ +0011bde0: 612c 2026 616d 703b 6461 7461 2929 3c2f a, &data)).
soap │ │ │ +0011be60: 5f70 7269 6e74 5f66 6175 6c74 3c2f 613e _print_fault │ │ │ +0011be70: 283c 6120 636c 6173 733d 2263 6f64 6522 (soap │ │ │ +0011bea0: 2c20 7374 6465 7272 293b 3c2f 6469 763e , stderr);
│ │ │ +0011beb0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
els │ │ │ +0011bee0: 653c 2f73 7061 6e3e 203c 2f64 6976 3e0a e
. │ │ │ +0011bef0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
printf("Got │ │ │ +0011bf30: 2064 6174 615c 6e26 7175 6f74 3b3c 2f73 data\n");
. │ │ │ +0011bf60: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap_destro │ │ │ +0011bfc0: 793c 2f61 3e28 3c61 2063 6c61 7373 3d22 y(soa │ │ │ +0011bff0: 703c 2f61 3e29 3b3c 2f64 6976 3e0a 3c64 p);
. │ │ │ +0011c010: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap_end(soap);
.
soap_free(< │ │ │ +0011c120: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +0011c130: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ +0011c140: 6874 6d6c 223e 736f 6170 3c2f 613e 293b html">soap); │ │ │ +0011c150: 3c2f 6469 763e 0a3c 2f64 6976 3e3c 212d
.

Note that the < │ │ │ +0011c180: 636f 6465 3e78 6f70 5f5f 496e 636c 7564 code>xop__Includ │ │ │ +0011c190: 652e 7479 7065 3c2f 636f 6465 3e20 6d65 e.type me │ │ │ +0011c1a0: 6d62 6572 206d 7573 7420 6265 2073 6574 mber must be set │ │ │ +0011c1b0: 2074 6f20 7472 616e 736d 6974 204d 544f to transmit MTO │ │ │ +0011c1c0: 4d20 6174 7461 6368 6d65 6e74 732c 206f M attachments, o │ │ │ +0011c1d0: 7468 6572 7769 7365 2069 6e6c 696e 6520 therwise inline │ │ │ +0011c1e0: 6261 7365 3634 2058 4d4c 2077 696c 6c20 base64 XML will │ │ │ +0011c1f0: 6265 2073 656e 742e 3c2f 703e 0a3c 703e be sent.

.

│ │ │ +0011c200: 4174 2074 6865 2073 6572 7665 7220 7369 At the server si │ │ │ +0011c210: 6465 2c20 7765 2073 686f 7720 616e 2065 de, we show an e │ │ │ +0011c220: 7861 6d70 6c65 206f 6620 616e 206f 7065 xample of an ope │ │ │ +0011c230: 7261 7469 6f6e 2068 616e 646c 6572 2074 ration handler t │ │ │ +0011c240: 6861 7420 6a75 7374 2063 6f70 6965 7320 hat just copies │ │ │ +0011c250: 7468 6520 696e 7075 7420 6461 7461 2074 the input data t │ │ │ +0011c260: 6f20 6f75 7470 7574 3a3c 2f70 3e0a 3c64 o output:

.
│ │ │ +0011c2b0: 696e 743c 2f73 7061 6e3e 206e 735f 5f65 int ns__e │ │ │ +0011c2c0: 6368 6f44 6174 6128 3c73 7061 6e20 636c choData(st │ │ │ +0011c2e0: 7275 6374 3c2f 7370 616e 3e20 3c61 2063 ruct soap *soap, struct ns__Data *in, │ │ │ +0011c380: 3c73 7061 6e20 636c 6173 733d 226b 6579 struct ns__data *ou │ │ │ +0011c3b0: 7429 203c 2f64 6976 3e0a 3c64 6976 2063 t)
.
{.
*out = * │ │ │ +0011c3f0: 696e 3b20 3c2f 6469 763e 0a3c 6469 7620 in;
.
< │ │ │ +0011c410: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +0011c420: 6f72 6466 6c6f 7722 3e72 6574 7572 6e3c ordflow">return< │ │ │ +0011c430: 2f73 7061 6e3e 203c 6120 636c 6173 733d /span> SOAP_ │ │ │ +0011c490: 4f4b 3c2f 613e 3b20 3c2f 6469 763e 0a3c OK;
.< │ │ │ +0011c4a0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +0011c4b0: 3e7d 3c2f 6469 763e 0a3c 2f64 6976 3e3c >}
.
< │ │ │ +0011c4c0: 212d 2d20 6672 6167 6d65 6e74 202d 2d3e !-- fragment --> │ │ │ +0011c4d0: 3c70 3e54 6865 2073 6572 7665 7220 6d75

The server mu │ │ │ +0011c4e0: 7374 2075 7365 2074 6865 203c 636f 6465 st use the #SOAP_ENC_MTOM< │ │ │ +0011c500: 2f63 6f64 653e 2066 6c61 6720 746f 2069 /code> flag to i │ │ │ +0011c510: 6e69 7469 616c 697a 6520 7468 6520 3c63 nitialize the │ │ │ +0011c570: 736f 6170 3c2f 613e 3c2f 636f 6465 3e20 soap │ │ │ +0011c580: 636f 6e74 6578 7420 746f 2072 6563 6569 context to recei │ │ │ +0011c590: 7665 2061 6e64 2073 656e 6420 4d54 4f4d ve and send MTOM │ │ │ +0011c5a0: 2061 7474 6163 686d 656e 7473 2e3c 2f70 attachments.

.

.... Back to ta │ │ │ +0011c5d0: 626c 6520 6f66 2063 6f6e 7465 6e74 733c ble of contents< │ │ │ +0011c5e0: 2f61 3e3c 2f70 3e0a 3c68 323e 3c61 2063 /a>

.

.Streaming │ │ │ +0011c620: 4d49 4d45 2f4d 544f 4d3c 2f68 323e 0a3c MIME/MTOM

.< │ │ │ +0011c630: 703e 5374 7265 616d 696e 6720 4d49 4d45 p>Streaming MIME │ │ │ +0011c640: 2f4d 544f 4d20 6973 2061 6368 6965 7665 /MTOM is achieve │ │ │ +0011c650: 6420 7769 7468 2063 616c 6c62 6163 6b20 d with callback │ │ │ +0011c660: 6675 6e63 7469 6f6e 7320 746f 2066 6574 functions to fet │ │ │ +0011c670: 6368 2061 6e64 2073 746f 7265 2064 6174 ch and store dat │ │ │ +0011c680: 6120 6475 7269 6e67 2074 7261 6e73 6d69 a during transmi │ │ │ +0011c690: 7373 696f 6e2e 2054 6872 6565 2066 756e ssion. Three fun │ │ │ +0011c6a0: 6374 696f 6e20 6361 6c6c 6261 636b 7320 ction callbacks │ │ │ +0011c6b0: 666f 7220 7374 7265 616d 696e 6720 4d49 for streaming MI │ │ │ +0011c6c0: 4d45 2f4d 544f 4d20 6f75 7470 7574 2061 ME/MTOM output a │ │ │ +0011c6d0: 6e64 2074 6872 6565 2063 616c 6c62 6163 nd three callbac │ │ │ +0011c6e0: 6b73 2066 6f72 2073 7472 6561 6d69 6e67 ks for streaming │ │ │ +0011c6f0: 204d 494d 452f 4d54 4f4d 2069 6e70 7574 MIME/MTOM input │ │ │ +0011c700: 2061 7265 2061 7661 696c 6162 6c65 2e3c are available.< │ │ │ +0011c710: 2f70 3e0a 3c75 6c3e 0a3c 6c69 3e3c 636f /p>.
    .
  • void *(*soap. │ │ │ +0011c730: 666d 696d 6572 6561 646f 7065 6e29 2873 fmimereadopen)(s │ │ │ +0011c740: 7472 7563 7420 736f 6170 202a 736f 6170 truct soap *soap │ │ │ +0011c750: 2c20 766f 6964 202a 6861 6e64 6c65 2c20 , void *handle, │ │ │ +0011c760: 636f 6e73 7420 6368 6172 202a 6964 2c20 const char *id, │ │ │ +0011c770: 636f 6e73 7420 6368 6172 202a 7479 7065 const char *type │ │ │ +0011c780: 2c20 636f 6e73 7420 6368 6172 202a 6465 , const char *de │ │ │ +0011c790: 7363 7269 7074 696f 6e29 3c2f 636f 6465 scription) This callback │ │ │ +0011c7b0: 6973 2063 616c 6c65 6420 6279 2074 6865 is called by the │ │ │ +0011c7c0: 2065 6e67 696e 6520 746f 2073 7461 7274 engine to start │ │ │ +0011c7d0: 2073 656e 6469 6e67 2061 2073 7472 6561 sending a strea │ │ │ +0011c7e0: 6d69 6e67 204d 494d 452f 4d54 4f4d 2061 ming MIME/MTOM a │ │ │ +0011c7f0: 7474 6163 686d 656e 742e 2054 6869 7320 ttachment. This │ │ │ +0011c800: 6361 6c6c 6261 636b 206f 7065 6e73 2061 callback opens a │ │ │ +0011c810: 2073 7472 6561 6d20 746f 2073 7461 7274 stream to start │ │ │ +0011c820: 2072 6561 6469 6e67 2074 6865 2061 7474 reading the att │ │ │ +0011c830: 6163 686d 656e 7420 6461 7461 2074 6f20 achment data to │ │ │ +0011c840: 7365 6e64 2e20 5468 6520 6163 7475 616c send. The actual │ │ │ +0011c850: 2064 6174 6120 7374 7265 616d 2077 696c data stream wil │ │ │ +0011c860: 6c20 6265 2072 6561 6420 696e 2063 6875 l be read in chu │ │ │ +0011c870: 6e6b 7320 7573 696e 6720 7468 6520 3c63 nks using the soap::f │ │ │ +0011c920: 6d69 6d65 7265 6164 3c2f 613e 3c2f 636f mimeread callback unt │ │ │ +0011c940: 696c 206e 6f20 6d6f 7265 2064 6174 6120 il no more data │ │ │ +0011c950: 6973 2061 7661 696c 6162 6c65 2061 6e64 is available and │ │ │ +0011c960: 2074 6865 203c 636f 6465 3e3c 6120 636c the soap::fmi │ │ │ +0011ca10: 6d65 7265 6164 636c 6f73 653c 2f61 3e3c mereadclose< │ │ │ +0011ca20: 2f63 6f64 653e 2063 616c 6c62 6163 6b20 /code> callback │ │ │ +0011ca30: 6973 2063 616c 6c65 6420 746f 2063 6c6f is called to clo │ │ │ +0011ca40: 7365 2074 6865 2073 7472 6561 6d2e 2054 se the stream. T │ │ │ +0011ca50: 6865 203c 636f 6465 3e68 616e 646c 653c he handle< │ │ │ +0011ca60: 2f63 6f64 653e 2070 6172 616d 6574 6572 /code> parameter │ │ │ +0011ca70: 2063 6f6e 7461 696e 7320 7468 6520 7661 contains the va │ │ │ +0011ca80: 6c75 6520 6f66 2074 6865 203c 636f 6465 lue of the __ptr me │ │ │ +0011caa0: 6d62 6572 2076 6172 6961 626c 6520 6f66 mber variable of │ │ │ +0011cab0: 2074 6865 2061 7474 6163 686d 656e 7420 the attachment │ │ │ +0011cac0: 7374 7275 6374 2f63 6c61 7373 2077 6974 struct/class wit │ │ │ +0011cad0: 6820 6461 7461 2028 652e 672e 203c 636f h data (e.g. xsd__base64Bina │ │ │ +0011cb60: 7279 3c2f 613e 3c2f 636f 6465 3e20 6f72 ry or │ │ │ +0011cb70: 203c 636f 6465 3e3c 6120 636c 6173 733d _xo │ │ │ +0011cbe0: 705f 5f49 6e63 6c75 6465 3c2f 613e 3c2f p__Include with __ptr, < │ │ │ +0011cc10: 636f 6465 3e5f 5f73 697a 653c 2f63 6f64 code>__size, id, type< │ │ │ +0011cc40: 2f63 6f64 653e 2061 6e64 203c 636f 6465 /code> and options │ │ │ +0011cc60: 6d65 6d62 6572 7329 2c20 7768 6963 6820 members), which │ │ │ +0011cc70: 7368 6f75 6c64 2062 6520 6120 706f 696e should be a poin │ │ │ +0011cc80: 7465 7220 746f 2073 7065 6369 6669 6320 ter to specific │ │ │ +0011cc90: 696e 666f 726d 6174 696f 6e20 7375 6368 information such │ │ │ +0011cca0: 2061 7320 6120 6669 6c65 2064 6573 6372 as a file descr │ │ │ +0011ccb0: 6970 746f 7220 6f72 2061 2070 6f69 6e74 iptor or a point │ │ │ +0011ccc0: 6572 2074 6f20 6120 736f 6d65 2061 7070 er to a some app │ │ │ +0011ccd0: 6c69 6361 7469 6f6e 2d73 7065 6369 6669 lication-specifi │ │ │ +0011cce0: 6320 6461 7461 2074 6f20 6265 2070 6173 c data to be pas │ │ │ +0011ccf0: 7365 6420 746f 2074 6869 7320 6361 6c6c sed to this call │ │ │ +0011cd00: 6261 636b 2e20 426f 7468 2074 6865 203c back. Both the < │ │ │ +0011cd10: 636f 6465 3e5f 5f70 7472 3c2f 636f 6465 code>__ptr and __si │ │ │ +0011cd30: 7a65 3c2f 636f 6465 3e20 6d65 6d62 6572 ze member │ │ │ +0011cd40: 7320 6f66 2074 6865 2061 7474 6163 686d s of the attachm │ │ │ +0011cd50: 656e 7420 7374 7275 6374 2f63 6c61 7373 ent struct/class │ │ │ +0011cd60: 2073 686f 756c 6420 6861 7665 2062 6565 should have bee │ │ │ +0011cd70: 6e20 7365 7420 6279 2074 6865 2061 7070 n set by the app │ │ │ +0011cd80: 6c69 6361 7469 6f6e 2070 7269 6f72 2074 lication prior t │ │ │ +0011cd90: 6f20 7468 6520 7365 7269 616c 697a 6174 o the serializat │ │ │ +0011cda0: 696f 6e20 6f66 2074 6865 206d 6573 7361 ion of the messa │ │ │ +0011cdb0: 6765 2077 6974 6820 6174 7461 6368 6d65 ge with attachme │ │ │ +0011cdc0: 6e74 732e 2049 6620 7468 6520 3c63 6f64 nts. If the __size │ │ │ +0011cde0: 6973 207a 6572 6f20 616e 6420 4854 5450 is zero and HTTP │ │ │ +0011cdf0: 2063 6875 6e6b 696e 6720 6973 2065 6e61 chunking is ena │ │ │ +0011ce00: 626c 6564 2028 7769 7468 203c 636f 6465 bled (with #SOAP_IO_CHUNK< │ │ │ +0011ce20: 2f63 6f64 653e 292c 2074 6865 6e20 6368 /code>), then ch │ │ │ +0011ce30: 756e 6b65 6420 4d49 4d45 2f4d 544f 4d20 unked MIME/MTOM │ │ │ +0011ce40: 6174 7461 6368 6d65 6e74 7320 6172 6520 attachments are │ │ │ +0011ce50: 7365 6e74 2c20 7365 6520 3c63 6f64 653e sent, see │ │ │ +0011ce60: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap::fmime │ │ │ +0011cf00: 7265 6164 3c2f 613e 3c2f 636f 6465 3e2e read. │ │ │ +0011cf10: 2054 6865 203c 636f 6465 3e69 643c 2f63 The id, type │ │ │ +0011cf30: 3c2f 636f 6465 3e20 616e 6420 3c63 6f64 and options │ │ │ +0011cf50: 2070 6172 616d 6574 6572 7320 6172 6520 parameters are │ │ │ +0011cf60: 7468 6520 3c63 6f64 653e 6964 3c2f 636f the id (an optional │ │ │ +0011cf80: 2049 4429 2c20 3c63 6f64 653e 7479 7065 ID), type │ │ │ +0011cf90: 3c2f 636f 6465 3e20 2861 204d 494d 4520 (a MIME │ │ │ +0011cfa0: 7479 7065 2920 616e 6420 3c63 6f64 653e type) and │ │ │ +0011cfb0: 6f70 7469 6f6e 733c 2f63 6f64 653e 2028 options ( │ │ │ +0011cfc0: 6120 6465 7363 7269 7074 6976 6520 7374 a descriptive st │ │ │ +0011cfd0: 7269 6e67 2920 6f66 2074 6865 2061 7474 ring) of the att │ │ │ +0011cfe0: 6163 686d 656e 7420 7374 7275 6374 2f63 achment struct/c │ │ │ +0011cff0: 6c61 7373 2c20 7265 7370 6563 7469 7665 lass, respective │ │ │ +0011d000: 6c79 2c20 6f66 2077 6869 6368 2061 7420 ly, of which at │ │ │ +0011d010: 6c65 6173 7420 6f6e 6520 6d65 6d62 6572 least one member │ │ │ +0011d020: 2073 686f 756c 6420 6265 206e 6f6e 2d4e should be non-N │ │ │ +0011d030: 554c 4c2e 2054 6865 2063 616c 6c62 6163 ULL. The callbac │ │ │ +0011d040: 6b20 7368 6f75 6c64 2072 6574 7572 6e20 k should return │ │ │ +0011d050: 7468 6520 3c63 6f64 653e 6861 6e64 6c65 the handle │ │ │ +0011d060: 3c2f 636f 6465 3e20 7061 7261 6d65 7465 paramete │ │ │ +0011d070: 7220 7661 6c75 6520 6f72 2061 6e6f 7468 r value or anoth │ │ │ +0011d080: 6572 2070 6f69 6e74 6572 2076 616c 7565 er pointer value │ │ │ +0011d090: 2c20 7768 6963 6820 6973 2070 6173 7365 , which is passe │ │ │ +0011d0a0: 6420 6173 2074 6865 206e 6577 203c 636f d as the new handle │ │ │ +0011d0c0: 2070 6172 616d 6574 6572 2074 6f20 3c63 parameter to soap::f │ │ │ +0011d170: 6d69 6d65 7265 6164 3c2f 613e 3c2f 636f mimeread and soap:: │ │ │ +0011d230: 666d 696d 6572 6561 6463 6c6f 7365 3c2f fmimereadclose callba │ │ │ +0011d250: 636b 732e 2057 6865 6e20 616e 2065 7272 cks. When an err │ │ │ +0011d260: 6f72 206f 6363 7572 7265 6420 696e 2074 or occurred in t │ │ │ +0011d270: 6869 7320 6361 6c6c 6261 636b 2c20 7468 his callback, th │ │ │ +0011d280: 6520 6361 6c6c 6261 636b 2073 686f 756c e callback shoul │ │ │ +0011d290: 6420 7265 7475 726e 204e 554c 4c20 616e d return NULL an │ │ │ +0011d2a0: 6420 7365 7420 3c63 6f64 653e 3c61 2063 d set soap::error to an e │ │ │ +0011d370: 7272 6f72 2063 6f64 652c 2065 2e67 2e20 rror code, e.g. │ │ │ +0011d380: 7573 696e 6720 3c63 6f64 653e 3c61 2063 using soap │ │ │ +0011d430: 5f72 6563 6569 7665 725f 6661 756c 743c _receiver_fault< │ │ │ +0011d440: 2f61 3e3c 2f63 6f64 653e 2e20 5468 6520 /a>. The │ │ │ +0011d450: 6361 6c6c 6261 636b 206d 6179 2072 6574 callback may ret │ │ │ +0011d460: 7572 6e20 4e55 4c4c 2061 6e64 2073 6574 urn NULL and set │ │ │ +0011d470: 203c 636f 6465 3e3c 6120 636c 6173 733d soa │ │ │ +0011d520: 703a 3a65 7272 6f72 3c2f 613e 3c2f 636f p::error to #SO │ │ │ +0011d540: 4150 5f4f 4b3c 2f63 6f64 653e 2077 6865 AP_OK whe │ │ │ +0011d550: 6e20 7468 6973 2073 7065 6369 6669 6320 n this specific │ │ │ +0011d560: 4d49 4d45 2f4d 544f 4d20 6174 7461 6368 MIME/MTOM attach │ │ │ +0011d570: 6d65 6e74 2073 686f 756c 6420 6e6f 7420 ment should not │ │ │ +0011d580: 746f 2062 6520 7374 7265 616d 6564 2061 to be streamed a │ │ │ +0011d590: 6e64 2074 6865 2065 6e67 696e 6520 7769 nd the engine wi │ │ │ +0011d5a0: 6c6c 2073 696d 706c 7920 736b 6970 2069 ll simply skip i │ │ │ +0011d5b0: 742e 3c2f 6c69 3e0a 3c6c 693e 3c63 6f64 t.
  • .
  • size_t (*soap. │ │ │ +0011d5d0: 666d 696d 6572 6561 6429 2873 7472 7563 fmimeread)(struc │ │ │ +0011d5e0: 7420 736f 6170 202a 736f 6170 2c20 766f t soap *soap, vo │ │ │ +0011d5f0: 6964 202a 6861 6e64 6c65 2c20 6368 6172 id *handle, char │ │ │ +0011d600: 202a 6275 662c 2073 697a 655f 7420 6c65 *buf, size_t le │ │ │ +0011d610: 6e29 3c2f 636f 6465 3e20 5468 6973 2063 n) This c │ │ │ +0011d620: 616c 6c62 6163 6b20 6973 2063 616c 6c65 allback is calle │ │ │ +0011d630: 6420 6279 2074 6865 2065 6e67 696e 6520 d by the engine │ │ │ +0011d640: 746f 2072 6561 6420 6120 6368 756e 6b20 to read a chunk │ │ │ +0011d650: 6f66 2061 7474 6163 686d 656e 7420 6461 of attachment da │ │ │ +0011d660: 7461 2074 6f20 7472 616e 736d 6974 2e20 ta to transmit. │ │ │ +0011d670: 5468 6520 3c63 6f64 653e 6861 6e64 6c65 The handle │ │ │ +0011d680: 3c2f 636f 6465 3e20 7061 7261 6d65 7465 paramete │ │ │ +0011d690: 7220 636f 6e74 6169 6e73 2074 6865 2068 r contains the h │ │ │ +0011d6a0: 616e 646c 6520 7265 7475 726e 6564 2062 andle returned b │ │ │ +0011d6b0: 7920 7468 6520 3c63 6f64 653e 3c61 2063 y the soap::fm │ │ │ +0011d760: 696d 6572 6561 646f 7065 6e3c 2f61 3e3c imereadopen< │ │ │ +0011d770: 2f63 6f64 653e 2063 616c 6c62 6163 6b2e /code> callback. │ │ │ +0011d780: 2054 6865 203c 636f 6465 3e62 7566 3c2f The buf parameter │ │ │ +0011d7a0: 6973 2074 6865 2062 7566 6665 7220 6f66 is the buffer of │ │ │ +0011d7b0: 206c 656e 6774 6820 3c63 6f64 653e 6c65 length le │ │ │ +0011d7c0: 6e3c 2f63 6f64 653e 2069 6e74 6f20 7768 n into wh │ │ │ +0011d7d0: 6963 6820 6120 6368 756e 6b20 6f66 2064 ich a chunk of d │ │ │ +0011d7e0: 6174 6120 7368 6f75 6c64 2062 6520 7772 ata should be wr │ │ │ +0011d7f0: 6974 7465 6e20 6279 2074 6865 2063 616c itten by the cal │ │ │ +0011d800: 6c62 6163 6b2e 2054 6865 2061 6374 7561 lback. The actua │ │ │ +0011d810: 6c20 616d 6f75 6e74 206f 6620 6461 7461 l amount of data │ │ │ +0011d820: 2077 7269 7474 656e 2069 6e74 6f20 7468 written into th │ │ │ +0011d830: 6520 6275 6666 6572 206d 6179 2062 6520 e buffer may be │ │ │ +0011d840: 6c65 7373 2074 6861 6e20 3c63 6f64 653e less than │ │ │ +0011d850: 6c65 6e3c 2f63 6f64 653e 2061 6e64 2074 len and t │ │ │ +0011d860: 6869 7320 6163 7475 616c 2061 6d6f 756e his actual amoun │ │ │ +0011d870: 7420 7368 6f75 6c64 2062 6520 7265 7475 t should be retu │ │ │ +0011d880: 726e 6564 2062 7920 7468 6520 6361 6c6c rned by the call │ │ │ +0011d890: 6261 636b 2e20 4120 7265 7475 726e 2076 back. A return v │ │ │ +0011d8a0: 616c 7565 206f 6620 7a65 726f 2069 6e64 alue of zero ind │ │ │ +0011d8b0: 6963 6174 6573 2061 6e20 6572 726f 7220 icates an error │ │ │ +0011d8c0: 616e 6420 3c63 6f64 653e 3c61 2063 6c61 and │ │ │ +0011d970: 736f 6170 3a3a 6572 726f 723c 2f61 3e3c soap::error< │ │ │ +0011d980: 2f63 6f64 653e 2073 686f 756c 6420 6265 /code> should be │ │ │ +0011d990: 2073 6574 2e20 5468 6520 3c63 6f64 653e set. The │ │ │ +0011d9a0: 5f5f 7369 7a65 3c2f 636f 6465 3e20 6d65 __size me │ │ │ +0011d9b0: 6d62 6572 2076 6172 6961 626c 6520 6f66 mber variable of │ │ │ +0011d9c0: 2074 6865 2061 7474 6163 686d 656e 7420 the attachment │ │ │ +0011d9d0: 7374 7275 6374 2f63 6c61 7373 2077 6974 struct/class wit │ │ │ +0011d9e0: 6820 6461 7461 2028 652e 672e 203c 636f h data (e.g. xsd__base64Bina │ │ │ +0011da70: 7279 3c2f 613e 3c2f 636f 6465 3e20 6f72 ry or │ │ │ +0011da80: 203c 636f 6465 3e3c 6120 636c 6173 733d _xo │ │ │ +0011daf0: 705f 5f49 6e63 6c75 6465 3c2f 613e 3c2f p__Include with __ptr, < │ │ │ +0011db20: 636f 6465 3e5f 5f73 697a 653c 2f63 6f64 code>__size, id, type< │ │ │ +0011db50: 2f63 6f64 653e 2061 6e64 203c 636f 6465 /code> and options │ │ │ +0011db70: 6d65 6d62 6572 7329 2073 686f 756c 6420 members) should │ │ │ +0011db80: 6265 2073 6574 2062 7920 7468 6520 6170 be set by the ap │ │ │ +0011db90: 706c 6963 6174 696f 6e20 7072 696f 7220 plication prior │ │ │ +0011dba0: 746f 2074 6865 2073 6572 6961 6c69 7a61 to the serializa │ │ │ +0011dbb0: 7469 6f6e 206f 6620 7468 6520 6d65 7373 tion of the mess │ │ │ +0011dbc0: 6167 6520 7769 7468 2061 7474 6163 686d age with attachm │ │ │ +0011dbd0: 656e 7473 2e20 5468 6520 7661 6c75 6520 ents. The value │ │ │ +0011dbe0: 6f66 203c 636f 6465 3e5f 5f73 697a 653c of __size< │ │ │ +0011dbf0: 2f63 6f64 653e 2069 6e64 6963 6174 6573 /code> indicates │ │ │ +0011dc00: 2074 6865 2074 6f74 616c 2073 697a 6520 the total size │ │ │ +0011dc10: 6f66 2074 6865 2061 7474 6163 686d 656e of the attachmen │ │ │ +0011dc20: 7420 6461 7461 2074 6f20 6265 2074 7261 t data to be tra │ │ │ +0011dc30: 6e73 6d69 7474 6564 2e20 4966 2074 6865 nsmitted. If the │ │ │ +0011dc40: 203c 636f 6465 3e5f 5f73 697a 653c 2f63 __size member vari │ │ │ +0011dc60: 6162 6c65 2069 7320 7a65 726f 2061 6e64 able is zero and │ │ │ +0011dc70: 2048 5454 5020 6368 756e 6b69 6e67 2069 HTTP chunking i │ │ │ +0011dc80: 7320 656e 6162 6c65 6420 2877 6974 6820 s enabled (with │ │ │ +0011dc90: 3c63 6f64 653e 2353 4f41 505f 494f 5f43 #SOAP_IO_C │ │ │ +0011dca0: 4855 4e4b 3c2f 636f 6465 3e29 2c20 7468 HUNK), th │ │ │ +0011dcb0: 656e 204d 494d 452f 4d54 4f4d 2063 6875 en MIME/MTOM chu │ │ │ +0011dcc0: 6e6b 6564 2074 7261 6e73 6665 7273 2061 nked transfers a │ │ │ +0011dcd0: 7265 2061 6374 6976 6174 6564 2062 7920 re activated by │ │ │ +0011dce0: 7468 6520 656e 6769 6e65 2c20 7768 6963 the engine, whic │ │ │ +0011dcf0: 6820 6973 206d 6f72 6520 666c 6578 6962 h is more flexib │ │ │ +0011dd00: 6c65 2073 696e 6365 2074 6865 2061 7474 le since the att │ │ │ +0011dd10: 6163 686d 656e 7420 6461 7461 2073 697a achment data siz │ │ │ +0011dd20: 6520 646f 6573 206e 6f74 206e 6565 6420 e does not need │ │ │ +0011dd30: 746f 2062 6520 6465 7465 726d 696e 6564 to be determined │ │ │ +0011dd40: 2069 6e20 6164 7661 6e63 652e 2054 6f20 in advance. To │ │ │ +0011dd50: 7573 6520 4d49 4d45 2f4d 544f 4d20 6368 use MIME/MTOM ch │ │ │ +0011dd60: 756e 6b65 6420 7472 616e 7366 6572 732c unked transfers, │ │ │ +0011dd70: 2065 6e61 626c 6520 4854 5450 2063 6875 enable HTTP chu │ │ │ +0011dd80: 6e6b 696e 6720 7769 7468 203c 636f 6465 nking with #SOAP_IO_CHUNK< │ │ │ +0011dda0: 2f63 6f64 653e 2028 616c 736f 203c 636f /code> (also #SOAP_IO_STOR │ │ │ +0011ddc0: 453c 2f63 6f64 653e 2063 616e 2062 6520 E can be │ │ │ +0011ddd0: 7573 6564 2c20 6275 7420 7468 6973 2062 used, but this b │ │ │ +0011dde0: 7566 6665 7273 2074 6865 2065 6e74 6972 uffers the entir │ │ │ +0011ddf0: 6520 6d65 7373 6167 6520 696e 206d 656d e message in mem │ │ │ +0011de00: 6f72 7920 6265 666f 7265 2074 7261 6e73 ory before trans │ │ │ +0011de10: 6d69 7373 696f 6e29 2061 6e64 2073 6574 mission) and set │ │ │ +0011de20: 2074 6865 203c 636f 6465 3e5f 5f73 697a the __siz │ │ │ +0011de30: 653c 2f63 6f64 653e 206d 656d 6265 7220 e member │ │ │ +0011de40: 7661 7269 6162 6c65 206f 6620 7468 6520 variable of the │ │ │ +0011de50: 6174 7461 6368 6d65 6e74 2073 7472 7563 attachment struc │ │ │ +0011de60: 742f 636c 6173 7320 746f 207a 6572 6f2e t/class to zero. │ │ │ +0011de70: 2057 6865 6e20 4d49 4d45 2f4d 544f 4d20 When MIME/MTOM │ │ │ +0011de80: 6174 7461 6368 6d65 6e74 2063 6875 6e6b attachment chunk │ │ │ +0011de90: 696e 6720 6973 2065 6e61 626c 6564 2c20 ing is enabled, │ │ │ +0011dea0: 7468 6973 2063 616c 6c62 6163 6b20 7368 this callback sh │ │ │ +0011deb0: 6f75 6c64 2063 6f6d 706c 6574 656c 7920 ould completely │ │ │ +0011dec0: 6669 6c6c 2074 6865 203c 636f 6465 3e62 fill the b │ │ │ +0011ded0: 7566 3c2f 636f 6465 3e20 6275 6666 6572 uf buffer │ │ │ +0011dee0: 2077 6974 6820 3c63 6f64 653e 6c65 6e3c with len< │ │ │ +0011def0: 2f63 6f64 653e 2062 7974 6573 2075 6e6c /code> bytes unl │ │ │ +0011df00: 6573 7320 7468 6520 6c61 7374 2064 6174 ess the last dat │ │ │ +0011df10: 6120 6368 756e 6b20 6973 2072 6561 6368 a chunk is reach │ │ │ +0011df20: 6564 2061 6e64 2066 6577 6572 2062 7974 ed and fewer byt │ │ │ +0011df30: 6573 2061 7265 2072 6574 7572 6e65 642e es are returned. │ │ │ +0011df40: 3c2f 6c69 3e0a 3c6c 693e 3c63 6f64 653e
  • .
  • │ │ │ +0011df50: 766f 6964 2028 2a73 6f61 702e 666d 696d void (*soap.fmim │ │ │ +0011df60: 6572 6561 6463 6c6f 7365 2928 7374 7275 ereadclose)(stru │ │ │ +0011df70: 6374 2073 6f61 7020 2a73 6f61 702c 2076 ct soap *soap, v │ │ │ +0011df80: 6f69 6420 2a68 616e 646c 6529 3c2f 636f oid *handle) This callbac │ │ │ +0011dfa0: 6b20 6973 2063 616c 6c65 6420 6279 2074 k is called by t │ │ │ +0011dfb0: 6865 2065 6e67 696e 6520 746f 2063 6c6f he engine to clo │ │ │ +0011dfc0: 7365 2074 6865 204d 494d 452f 4d54 4f4d se the MIME/MTOM │ │ │ +0011dfd0: 2061 7474 6163 686d 656e 7420 7374 7265 attachment stre │ │ │ +0011dfe0: 616d 2061 6674 6572 2072 6561 6469 6e67 am after reading │ │ │ +0011dff0: 2e20 5468 6520 3c63 6f64 653e 6861 6e64 . The hand │ │ │ +0011e000: 6c65 3c2f 636f 6465 3e20 7061 7261 6d65 le parame │ │ │ +0011e010: 7465 7220 636f 6e74 6169 6e73 2074 6865 ter contains the │ │ │ +0011e020: 2068 616e 646c 6520 7265 7475 726e 6564 handle returned │ │ │ +0011e030: 2062 7920 7468 6520 3c63 6f64 653e 3c61 by the soap:: │ │ │ +0011e0e0: 666d 696d 6572 6561 646f 7065 6e3c 2f61 fmimereadopen callbac │ │ │ +0011e100: 6b2e 3c2f 6c69 3e0a 3c6c 693e 3c63 6f64 k.
  • .
  • void *(*soap.f │ │ │ +0011e120: 6d69 6d65 7772 6974 656f 7065 6e29 2873 mimewriteopen)(s │ │ │ +0011e130: 7472 7563 7420 736f 6170 202a 736f 6170 truct soap *soap │ │ │ +0011e140: 2c20 766f 6964 202a 6861 6e64 6c65 2c20 , void *handle, │ │ │ +0011e150: 636f 6e73 7420 6368 6172 202a 6964 2c20 const char *id, │ │ │ +0011e160: 636f 6e73 7420 6368 6172 202a 7479 7065 const char *type │ │ │ +0011e170: 2c20 636f 6e73 7420 6368 6172 202a 6465 , const char *de │ │ │ +0011e180: 7363 7269 7074 696f 6e2c 2065 6e75 6d20 scription, enum │ │ │ +0011e190: 736f 6170 5f6d 696d 655f 656e 636f 6469 soap_mime_encodi │ │ │ +0011e1a0: 6e67 2065 6e63 6f64 696e 6729 3c2f 636f ng encoding) Called by th │ │ │ +0011e1c0: 6520 746f 2073 7461 7274 2072 6563 6569 e to start recei │ │ │ +0011e1d0: 7669 6e67 2061 2073 7472 6561 6d69 6e67 ving a streaming │ │ │ +0011e1e0: 204d 494d 452f 4d54 4f4d 2061 7474 6163 MIME/MTOM attac │ │ │ +0011e1f0: 686d 656e 742e 2054 6869 7320 6361 6c6c hment. This call │ │ │ +0011e200: 6261 636b 206f 7065 6e73 2061 2073 7472 back opens a str │ │ │ +0011e210: 6561 6d20 746f 2073 7461 7274 2077 7269 eam to start wri │ │ │ +0011e220: 7469 6e67 2074 6865 2061 7474 6163 686d ting the attachm │ │ │ +0011e230: 656e 7420 6461 7461 2072 6563 6569 7665 ent data receive │ │ │ +0011e240: 642e 2054 6865 2061 6374 7561 6c20 6461 d. The actual da │ │ │ +0011e250: 7461 2073 7472 6561 6d20 7769 6c6c 2062 ta stream will b │ │ │ +0011e260: 6520 7772 6974 7465 6e20 696e 2063 6875 e written in chu │ │ │ +0011e270: 6e6b 7320 7573 696e 6720 7468 6520 3c63 nks using the soap::fmime │ │ │ +0011e320: 7772 6974 653c 2f61 3e3c 2f63 6f64 653e write │ │ │ +0011e330: 2063 616c 6c62 6163 6b20 756e 7469 6c20 callback until │ │ │ +0011e340: 6e6f 206d 6f72 6520 6461 7461 2069 7320 no more data is │ │ │ +0011e350: 6176 6169 6c61 626c 6520 616e 6420 7468 available and th │ │ │ +0011e360: 6520 3c63 6f64 653e 3c61 2063 6c61 7373 e soap::fmimew │ │ │ +0011e410: 7269 7465 636c 6f73 653c 2f61 3e3c 2f63 riteclose callback is │ │ │ +0011e430: 2063 616c 6c65 6420 746f 2063 6c6f 7365 called to close │ │ │ +0011e440: 2074 6865 2073 7472 6561 6d2e 2054 6865 the stream. The │ │ │ +0011e450: 203c 636f 6465 3e69 643c 2f63 6f64 653e id │ │ │ +0011e460: 2c20 3c63 6f64 653e 7479 7065 3c2f 636f , type and op │ │ │ +0011e480: 7469 6f6e 733c 2f63 6f64 653e 2070 6172 tions par │ │ │ +0011e490: 616d 6574 6572 7320 6172 6520 7468 6520 ameters are the │ │ │ +0011e4a0: 3c63 6f64 653e 6964 3c2f 636f 6465 3e2c id, │ │ │ +0011e4b0: 203c 636f 6465 3e74 7970 653c 2f63 6f64 type and opt │ │ │ +0011e4d0: 696f 6e73 3c2f 636f 6465 3e20 6f66 2074 ions of t │ │ │ +0011e4e0: 6865 2061 7474 6163 686d 656e 7420 7374 he attachment st │ │ │ +0011e4f0: 7275 6374 2f63 6c61 7373 2028 652e 672e ruct/class (e.g. │ │ │ +0011e500: 203c 636f 6465 3e3c 6120 636c 6173 733d xsd__base64 │ │ │ +0011e580: 4269 6e61 7279 3c2f 613e 3c2f 636f 6465 Binary or _xop__Include with < │ │ │ +0011e620: 636f 6465 3e5f 5f70 7472 3c2f 636f 6465 code>__ptr, __size< │ │ │ +0011e640: 2f63 6f64 653e 2c20 3c63 6f64 653e 6964 /code>, id │ │ │ +0011e650: 3c2f 636f 6465 3e2c 203c 636f 6465 3e74 , t │ │ │ +0011e660: 7970 653c 2f63 6f64 653e 2061 6e64 203c ype and < │ │ │ +0011e670: 636f 6465 3e6f 7074 696f 6e73 3c2f 636f code>options members), re │ │ │ +0011e690: 7370 6563 7469 7665 6c79 2e20 5468 6520 spectively. The │ │ │ +0011e6a0: 6361 6c6c 6261 636b 2073 686f 756c 6420 callback should │ │ │ +0011e6b0: 7265 7475 726e 2061 2068 616e 646c 652c return a handle, │ │ │ +0011e6c0: 2077 6869 6368 2069 7320 7061 7373 6564 which is passed │ │ │ +0011e6d0: 2074 6f20 7468 6520 3c63 6f64 653e 3c61 to the s │ │ │ +0011e770: 6f61 703a 3a66 6d69 6d65 7772 6974 653c oap::fmimewrite< │ │ │ +0011e780: 2f61 3e3c 2f63 6f64 653e 2061 6e64 203c /a> and < │ │ │ +0011e790: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soap::fmimewrit │ │ │ +0011e840: 6563 6c6f 7365 3c2f 613e 3c2f 636f 6465 eclose callbacks. The │ │ │ +0011e860: 203c 636f 6465 3e5f 5f70 7472 3c2f 636f __ptr member varia │ │ │ +0011e880: 626c 6520 6f66 2074 6865 2061 7474 6163 ble of the attac │ │ │ +0011e890: 686d 656e 7420 7374 7275 6374 2f63 6c61 hment struct/cla │ │ │ +0011e8a0: 7373 2069 7320 7365 7420 6279 2074 6865 ss is set by the │ │ │ +0011e8b0: 2065 6e67 696e 6520 746f 2074 6865 2076 engine to the v │ │ │ +0011e8c0: 616c 7565 206f 6620 7468 6973 2068 616e alue of this han │ │ │ +0011e8d0: 646c 652e 2054 6865 203c 636f 6465 3e5f dle. The _ │ │ │ +0011e8e0: 5f73 697a 653c 2f63 6f64 653e 206d 656d _size mem │ │ │ +0011e8f0: 6265 7220 7661 7269 6162 6c65 2069 7320 ber variable is │ │ │ +0011e900: 7365 7420 746f 2074 6865 2073 697a 6520 set to the size │ │ │ +0011e910: 6f66 2074 6865 2061 7474 6163 686d 656e of the attachmen │ │ │ +0011e920: 7420 7265 6365 6976 6564 2e3c 2f6c 693e t received.
  • │ │ │ +0011e930: 0a3c 6c69 3e3c 636f 6465 3e69 6e74 2028 .
  • int ( │ │ │ +0011e940: 2a73 6f61 702e 666d 696d 6577 7269 7465 *soap.fmimewrite │ │ │ +0011e950: 2928 7374 7275 6374 2073 6f61 7020 2a73 )(struct soap *s │ │ │ +0011e960: 6f61 702c 2076 6f69 6420 2a68 616e 646c oap, void *handl │ │ │ +0011e970: 652c 2063 6f6e 7374 2063 6861 7220 2a62 e, const char *b │ │ │ +0011e980: 7566 2c20 7369 7a65 5f74 206c 656e 293c uf, size_t len)< │ │ │ +0011e990: 2f63 6f64 653e 2054 6869 7320 6361 6c6c /code> This call │ │ │ +0011e9a0: 6261 636b 2069 7320 6361 6c6c 6564 2062 back is called b │ │ │ +0011e9b0: 7920 7468 6520 656e 6769 6e65 2074 6f20 y the engine to │ │ │ +0011e9c0: 7772 6974 6520 6120 6368 756e 6b20 6f66 write a chunk of │ │ │ +0011e9d0: 2061 7474 6163 686d 656e 7420 6461 7461 attachment data │ │ │ +0011e9e0: 2072 6563 6569 7665 642e 2054 6865 203c received. The < │ │ │ +0011e9f0: 636f 6465 3e68 616e 646c 653c 2f63 6f64 code>handle parameter con │ │ │ +0011ea10: 7461 696e 7320 7468 6520 6861 6e64 6c65 tains the handle │ │ │ +0011ea20: 2072 6574 7572 6e65 6420 6279 2074 6865 returned by the │ │ │ +0011ea30: 203c 636f 6465 3e3c 6120 636c 6173 733d soap::fmimewr │ │ │ +0011eae0: 6974 656f 7065 6e3c 2f61 3e3c 2f63 6f64 iteopen callback. The │ │ │ +0011eb00: 203c 636f 6465 3e62 7566 3c2f 636f 6465 buf parameter cont │ │ │ +0011eb20: 6169 6e73 2074 6865 2064 6174 6120 6f66 ains the data of │ │ │ +0011eb30: 206c 656e 6774 6820 3c63 6f64 653e 6c65 length le │ │ │ +0011eb40: 6e3c 2f63 6f64 653e 2e20 5265 7475 726e n. Return │ │ │ +0011eb50: 7320 3c63 6f64 653e 2353 4f41 505f 4f4b s #SOAP_OK │ │ │ +0011eb60: 3c2f 636f 6465 3e20 6f72 2061 203c 636f or a soap_status< │ │ │ +0011ec30: 2f61 3e3c 2f63 6f64 653e 2028 696e 7429 /a> (int) │ │ │ +0011ec40: 2065 7272 6f72 2063 6f64 652e 3c2f 6c69 error code.
  • .
  • void │ │ │ +0011ec60: 2028 2a73 6f61 702e 666d 696d 6577 7269 (*soap.fmimewri │ │ │ +0011ec70: 7465 636c 6f73 6529 2873 7472 7563 7420 teclose)(struct │ │ │ +0011ec80: 736f 6170 202a 736f 6170 2c20 766f 6964 soap *soap, void │ │ │ +0011ec90: 202a 6861 6e64 6c65 293c 2f63 6f64 653e *handle) │ │ │ +0011eca0: 2054 6869 7320 6361 6c6c 6261 636b 2069 This callback i │ │ │ +0011ecb0: 7320 6361 6c6c 6564 2062 7920 7468 6520 s called by the │ │ │ +0011ecc0: 656e 6769 6e65 2074 6f20 636c 6f73 6520 engine to close │ │ │ +0011ecd0: 7468 6520 4d49 4d45 2f4d 544f 4d20 6174 the MIME/MTOM at │ │ │ +0011ece0: 7461 6368 6d65 6e74 2073 7472 6561 6d20 tachment stream │ │ │ +0011ecf0: 6166 7465 7220 7772 6974 696e 672e 2054 after writing. T │ │ │ +0011ed00: 6865 203c 636f 6465 3e68 616e 646c 653c he handle< │ │ │ +0011ed10: 2f63 6f64 653e 2070 6172 616d 6574 6572 /code> parameter │ │ │ +0011ed20: 2063 6f6e 7461 696e 7320 7468 6520 6861 contains the ha │ │ │ +0011ed30: 6e64 6c65 2072 6574 7572 6e65 6420 6279 ndle returned by │ │ │ +0011ed40: 2074 6865 203c 636f 6465 3e3c 6120 636c the soap::fmi │ │ │ +0011edf0: 6d65 7772 6974 656f 7065 6e3c 2f61 3e3c mewriteopen< │ │ │ +0011ee00: 2f63 6f64 653e 2063 616c 6c62 6163 6b2e /code> callback. │ │ │ +0011ee10: 3c2f 6c69 3e0a 3c2f 756c 3e0a 3c70 3e49
  • .
.

I │ │ │ +0011ee20: 6e20 6164 6469 7469 6f6e 2c20 6120 3c63 n addition, a void* soap::user │ │ │ +0011ef00: 3c2f 636f 6465 3e20 6d65 6d62 6572 2069 member i │ │ │ +0011ef10: 7320 6176 6169 6c61 626c 6520 746f 2070 s available to p │ │ │ +0011ef20: 6173 7320 7573 6572 2d64 6566 696e 6564 ass user-defined │ │ │ +0011ef30: 2064 6174 6120 746f 2074 6865 2063 616c data to the cal │ │ │ +0011ef40: 6c62 6163 6b73 2e20 5468 6973 2077 6179 lbacks. This way │ │ │ +0011ef50: 2c20 796f 7520 6361 6e20 7365 7420 3c63 , you can set void* soap::user │ │ │ +0011f030: 3c2f 636f 6465 3e20 746f 2070 6f69 6e74 to point │ │ │ +0011f040: 2074 6f20 6170 706c 6963 6174 696f 6e20 to application │ │ │ +0011f050: 6461 7461 2074 6861 7420 7468 6520 6361 data that the ca │ │ │ +0011f060: 6c6c 6261 636b 7320 6e65 6564 2073 7563 llbacks need suc │ │ │ +0011f070: 6820 6173 2061 2066 696c 6520 6e61 6d65 h as a file name │ │ │ +0011f080: 2066 6f72 2065 7861 6d70 6c65 2e3c 2f70 for example.

.

The followi │ │ │ +0011f0a0: 6e67 2065 7861 6d70 6c65 2069 6c6c 7573 ng example illus │ │ │ +0011f0b0: 7472 6174 6573 2074 6865 2063 6c69 656e trates the clien │ │ │ +0011f0c0: 742d 7369 6465 2069 6e69 7469 616c 697a t-side initializ │ │ │ +0011f0d0: 6174 696f 6e20 6f66 2061 6e20 696d 6167 ation of an imag │ │ │ +0011f0e0: 6520 6174 7461 6368 6d65 6e74 2073 7472 e attachment str │ │ │ +0011f0f0: 7563 7420 746f 2073 7472 6561 6d20 6120 uct to stream a │ │ │ +0011f100: 6669 6c65 2069 6e74 6f20 6120 4d54 4f4d file into a MTOM │ │ │ +0011f110: 2061 7474 6163 686d 656e 7420 7769 7468 attachment with │ │ │ +0011f120: 6f75 7420 4854 5450 2063 6875 6e6b 696e out HTTP chunkin │ │ │ +0011f130: 6720 2848 5454 5020 7374 7265 616d 696e g (HTTP streamin │ │ │ +0011f140: 6720 6368 756e 6b65 6420 4d54 4f4d 2074 g chunked MTOM t │ │ │ +0011f150: 7261 6e73 6665 7220 6973 2070 7265 7365 ransfer is prese │ │ │ +0011f160: 6e74 6564 2069 6e20 5365 6374 696f 6e20 nted in Section │ │ │ +0011f170: 3c61 2063 6c61 7373 3d22 656c 2220 6872 Str │ │ │ +0011f1a0: 6561 6d69 6e67 2063 6875 6e6b 6564 204d eaming chunked M │ │ │ +0011f1b0: 494d 452f 4d54 4f4d 3c2f 613e 2029 3a3c IME/MTOM ):< │ │ │ +0011f1c0: 2f70 3e0a 3c64 6976 2063 6c61 7373 3d22 /p>.

int │ │ │ +0011f210: 206d 6169 6e28 2920 3c2f 6469 763e 0a3c main()
.< │ │ │ +0011f220: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +0011f230: 3e7b 3c2f 6469 763e 0a3c 6469 7620 636c >{
.
struct soap │ │ │ +0011f2a0: 203c 6120 636c 6173 733d 2263 6f64 6522 soap │ │ │ +0011f2d0: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
struct xsd__bas │ │ │ +0011f350: 6536 3442 696e 6172 793c 2f61 3e20 696d e64Binary im │ │ │ +0011f360: 6167 653b 203c 2f64 6976 3e0a 3c64 6976 age;
.
│ │ │ +0011f380: 4649 4c45 202a 6664 3b20 3c2f 6469 763e FILE *fd;
│ │ │ +0011f390: 0a3c 6469 7620 636c 6173 733d 226c 696e .
struc │ │ │ +0011f3c0: 7420 3c2f 7370 616e 3e73 7461 7420 7362 t stat sb │ │ │ +0011f3d0: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
soap_init1 │ │ │ +0011f450: 2826 616d 703b 3c61 2063 6c61 7373 3d22 (&soa │ │ │ +0011f480: 703c 2f61 3e2c 203c 6120 636c 6173 733d p, SOAP_E │ │ │ +0011f4e0: 4e43 5f4d 544f 4d3c 2f61 3e29 3b20 3c73 NC_MTOM); // mandatory │ │ │ +0011f510: 2074 6f20 656e 6162 6c65 204d 544f 4d20 to enable MTOM │ │ │ +0011f520: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ +0011f540: 2020 3c73 7061 6e20 636c 6173 733d 226b if (!fstat(fi │ │ │ +0011f570: 6c65 6e6f 2866 6429 2c20 2661 6d70 3b73 leno(fd), &s │ │ │ +0011f580: 6229 2026 616d 703b 2661 6d70 3b20 7362 b) && sb │ │ │ +0011f590: 2e73 745f 7369 7a65 2026 6774 3b20 3029 .st_size > 0) │ │ │ +0011f5a0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
{.
│ │ │ +0011f5f0: 2f2f 2062 6563 6175 7365 2077 6520 6361 // because we ca │ │ │ +0011f600: 6e20 6765 7420 7468 6520 6c65 6e67 7468 n get the length │ │ │ +0011f610: 206f 6620 7468 6520 6669 6c65 2c20 7765 of the file, we │ │ │ +0011f620: 2063 616e 2073 7472 6561 6d20 6974 2077 can stream it w │ │ │ +0011f630: 6974 686f 7574 2063 6875 6e6b 696e 6720 ithout chunking │ │ │ +0011f640: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ +0011f660: 2020 2020 3c61 2063 6c61 7373 3d22 636f soap< │ │ │ +0011f690: 2f61 3e2e 3c61 2063 6c61 7373 3d22 636f /a>.fmime │ │ │ +0011f6f0: 7265 6164 6f70 656e 3c2f 613e 203d 206d readopen = m │ │ │ +0011f700: 696d 655f 7265 6164 5f6f 7065 6e3b 203c ime_read_open; < │ │ │ +0011f710: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
soap.fmimereadclos │ │ │ +0011f7c0: 653c 2f61 3e20 3d20 6d69 6d65 5f72 6561 e = mime_rea │ │ │ +0011f7d0: 645f 636c 6f73 653b 203c 2f64 6976 3e0a d_close;
. │ │ │ +0011f7e0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65 .< │ │ │ +0011f8a0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +0011f8b0: 3e20 2020 2069 6d61 6765 2e5f 5f70 7472 > image.__ptr │ │ │ +0011f8c0: 203d 2028 3c73 7061 6e20 636c 6173 733d = (un │ │ │ +0011f8e0: 7369 676e 6564 3c2f 7370 616e 3e20 3c73 signed char*)fd; / │ │ │ +0011f930: 2f20 6d75 7374 2073 6574 2074 6f20 6e6f / must set to no │ │ │ +0011f940: 6e2d 4e55 4c4c 2028 7468 6973 2069 7320 n-NULL (this is │ │ │ +0011f950: 6f75 7220 6664 2068 616e 646c 6520 7768 our fd handle wh │ │ │ +0011f960: 6963 6820 7765 206e 6565 6420 696e 2074 ich we need in t │ │ │ +0011f970: 6865 2063 616c 6c62 6163 6b73 2920 3c2f he callbacks)
.
│ │ │ +0011f9a0: 2020 696d 6167 652e 5f5f 7369 7a65 203d image.__size = │ │ │ +0011f9b0: 2073 622e 7374 5f73 697a 653b 203c 7370 sb.st_size; // must set s │ │ │ +0011f9e0: 697a 6520 3c2f 7370 616e 3e3c 2f64 6976 ize
.
}
.< │ │ │ +0011fa10: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +0011fa20: 3e20 203c 7370 616e 2063 6c61 7373 3d22 > els │ │ │ +0011fa40: 653c 2f73 7061 6e3e 203c 2f64 6976 3e0a e

. │ │ │ +0011fa50: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
{
.
│ │ │ +0011fa80: 2020 3c73 7061 6e20 636c 6173 733d 2263 // don&# │ │ │ +0011faa0: 3339 3b74 206b 6e6f 7720 7468 6520 7369 39;t know the si │ │ │ +0011fab0: 7a65 2c20 736f 2062 7566 6665 7220 6974 ze, so buffer it │ │ │ +0011fac0: 203c 2f73 7061 6e3e 3c2f 6469 763e 0a3c
.< │ │ │ +0011fad0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +0011fae0: 3e20 2020 203c 7370 616e 2063 6c61 7373 > s │ │ │ +0011fb00: 697a 655f 743c 2f73 7061 6e3e 2069 3b20 ize_t i; │ │ │ +0011fb10: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
int c;
.
│ │ │ +0011fb70: 2020 696d 6167 652e 5f5f 7074 7220 3d20 image.__ptr = │ │ │ +0011fb80: 283c 7370 616e 2063 6c61 7373 3d22 6b65 (unsig │ │ │ +0011fba0: 6e65 643c 2f73 7061 6e3e 203c 7370 616e ned char │ │ │ +0011fbd0: 2a29 3c61 2063 6c61 7373 3d22 636f 6465 *)soap_mall │ │ │ +0011fc30: 6f63 3c2f 613e 2826 616d 703b 3c61 2063 oc(&soap, MAX │ │ │ +0011fc70: 5f46 494c 455f 5349 5a45 293b 203c 2f64 _FILE_SIZE); .
for ( │ │ │ +0011fcc0: 6920 3d20 303b 2069 2026 6c74 3b20 4d41 i = 0; i < MA │ │ │ +0011fcd0: 585f 4649 4c45 5f53 495a 453b 2069 2b2b X_FILE_SIZE; i++ │ │ │ +0011fce0: 2920 3c2f 6469 763e 0a3c 6469 7620 636c )
.
{ │ │ │ +0011fd00: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
< │ │ │ +0011fd20: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +0011fd30: 6f72 6466 6c6f 7722 3e69 663c 2f73 7061 ordflow">if ((c = fgetc(f │ │ │ +0011fd50: 6429 2920 3d3d 2045 4f46 2920 3c2f 6469 d)) == EOF) .
break;
.
│ │ │ +0011fdc0: 2020 2020 696d 6167 652e 5f5f 7074 725b image.__ptr[ │ │ │ +0011fdd0: 695d 203d 2063 3b20 3c2f 6469 763e 0a3c i] = c;
.< │ │ │ +0011fde0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +0011fdf0: 3e20 2020 207d 203c 2f64 6976 3e0a 3c64 > }
. │ │ │ +0011fe10: 2020 2020 6663 6c6f 7365 2866 6429 3b20 fclose(fd); │ │ │ +0011fe20: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
ima │ │ │ +0011fe40: 6765 2e5f 5f73 697a 6520 3d20 693b 203c ge.__size = i; < │ │ │ +0011fe50: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
} .
image.typ │ │ │ +0011fe90: 6520 3d20 3c73 7061 6e20 636c 6173 733d e = │ │ │ +0011feb0: 2671 756f 743b 696d 6167 652f 6a70 6567 "image/jpeg │ │ │ +0011fec0: 2671 756f 743b 3c2f 7370 616e 3e3b 203c "; < │ │ │ +0011fed0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ +0011fee0: 656e 7422 3e2f 2f20 4d49 4d45 2074 7970 ent">// MIME typ │ │ │ +0011fef0: 6520 3c2f 7370 616e 3e3c 2f64 6976 3e0a e
. │ │ │ +0011ff00: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
image.option │ │ │ +0011ff20: 7320 3d20 3c73 7061 6e20 636c 6173 733d s = │ │ │ +0011ff40: 2671 756f 743b 5468 6973 2069 7320 6d79 "This is my │ │ │ +0011ff50: 2070 6963 7475 7265 2671 756f 743b 3c2f picture"; // │ │ │ +0011ff80: 6465 7363 7269 7074 696f 6e20 6f66 206f description of o │ │ │ +0011ff90: 626a 6563 7420 3c2f 7370 616e 3e3c 2f64 bject .
if (soa │ │ │ +0011ffe0: 705f 6361 6c6c 5f6e 735f 5f77 6562 6d65 p_call_ns__webme │ │ │ +0011fff0: 7468 6f64 2826 616d 703b 3c61 2063 6c61 thod(&soap, ...)) │ │ │ +00120030: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
... │ │ │ +00120050: 203c 7370 616e 2063 6c61 7373 3d22 636f // error< │ │ │ +00120070: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
. │ │ │ +00120090: 203c 7370 616e 2063 6c61 7373 3d22 6b65 else< │ │ │ +001200b0: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
. │ │ │ +001200d0: 2020 202e 2e2e 203c 7370 616e 2063 6c61 ... // │ │ │ +001200f0: 7375 6363 6573 733c 2f73 7061 6e3e 3c2f success.
}
. │ │ │ +00120120: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
.
void *mime_read_ope │ │ │ +00120180: 6e28 3c73 7061 6e20 636c 6173 733d 226b n(struct soa │ │ │ +001201d0: 703c 2f61 3e20 2a3c 6120 636c 6173 733d p *so │ │ │ +00120200: 6170 3c2f 613e 2c20 3c73 7061 6e20 636c ap, void *h │ │ │ +00120230: 616e 646c 652c 203c 7370 616e 2063 6c61 andle, con │ │ │ +00120250: 7374 3c2f 7370 616e 3e20 3c73 7061 6e20 st char │ │ │ +00120280: 2a3c 7370 616e 2063 6c61 7373 3d22 6b65 *id, cons │ │ │ +001202c0: 743c 2f73 7061 6e3e 203c 7370 616e 2063 t char * │ │ │ +001202f0: 7479 7065 2c20 3c73 7061 6e20 636c 6173 type, cons │ │ │ +00120310: 743c 2f73 7061 6e3e 203c 7370 616e 2063 t char * │ │ │ +00120340: 6465 7363 7269 7074 696f 6e29 203c 2f64 description) .
{
. │ │ │ +00120380: 2020 3c73 7061 6e20 636c 6173 733d 226b retu │ │ │ +001203a0: 726e 3c2f 7370 616e 3e20 6861 6e64 6c65 rn handle │ │ │ +001203b0: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
} .
. │ │ │ +00120400: 3c73 7061 6e20 636c 6173 733d 226b 6579 void mime_read_ │ │ │ +00120430: 636c 6f73 6528 3c73 7061 6e20 636c 6173 close(stru │ │ │ +00120450: 6374 3c2f 7370 616e 3e20 3c61 2063 6c61 ct soap *soap, void *handle)
.
{
.
│ │ │ +00120520: 6663 6c6f 7365 2828 4649 4c45 2a29 6861 fclose((FILE*)ha │ │ │ +00120530: 6e64 6c65 293b 203c 2f64 6976 3e0a 3c64 ndle);
. │ │ │ +00120550: 7d20 3c2f 6469 763e 0a3c 6469 7620 636c }
.
.
s │ │ │ +001205a0: 697a 655f 743c 2f73 7061 6e3e 206d 696d ize_t mim │ │ │ +001205b0: 655f 7265 6164 283c 7370 616e 2063 6c61 e_read(str │ │ │ +001205d0: 7563 743c 2f73 7061 6e3e 203c 6120 636c uct soap *soap, void *handle, char *buf, size_t │ │ │ +001206c0: 6c65 6e29 203c 2f64 6976 3e0a 3c64 6976 len)
.
{< │ │ │ +001206e0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
return fread(buf, 1, │ │ │ +00120730: 6c65 6e2c 2028 4649 4c45 2a29 6861 6e64 len, (FILE*)hand │ │ │ +00120740: 6c65 293b 203c 2f64 6976 3e0a 3c64 6976 le);
..
vo │ │ │ +00120a30: 6964 282a 2066 6d69 6d65 7265 6164 636c id(* fmimereadcl │ │ │ +00120a40: 6f73 6529 2873 7472 7563 7420 736f 6170 ose)(struct soap │ │ │ +00120a50: 202a 736f 6170 2c20 766f 6964 202a 6861 *soap, void *ha │ │ │ +00120a60: 6e64 6c65 293c 2f64 6976 3e3c 6469 7620 ndle)
Ca │ │ │ +00120a80: 6c6c 6261 636b 2074 6f20 636c 6f73 6520 llback to close │ │ │ +00120a90: 6120 4d49 4d45 2f4d 544f 4d20 6174 7461 a MIME/MTOM atta │ │ │ +00120aa0: 6368 6d65 6e74 2073 7472 6561 6d20 6166 chment stream af │ │ │ +00120ab0: 7465 7220 7265 6164 696e 672e 3c2f 6469 ter reading.
Definiti │ │ │ +00120ae0: 6f6e 3a3c 2f62 3e20 7374 6473 6f61 7032 on: stdsoap2 │ │ │ +00120af0: 2e68 3a34 3932 393c 2f64 6976 3e3c 2f64 .h:4929
.
< │ │ │ +00120b70: 6120 6872 6566 3d22 6772 6f75 705f 5f67 a href="group__g │ │ │ +00120b80: 726f 7570 5f5f 6361 6c6c 6261 636b 732e roup__callbacks. │ │ │ +00120b90: 6874 6d6c 2367 6166 6634 3061 3163 6136 html#gaff40a1ca6 │ │ │ +00120ba0: 6662 6630 3735 6235 3463 6362 6634 3739 fbf075b54ccbf479 │ │ │ +00120bb0: 3030 3963 6537 3422 3e73 6f61 703a 3a66 009ce74">soap::f │ │ │ +00120bc0: 6d69 6d65 7265 6164 3c2f 613e 3c2f 6469 mimeread
size_t(* f │ │ │ +00120bf0: 6d69 6d65 7265 6164 2928 7374 7275 6374 mimeread)(struct │ │ │ +00120c00: 2073 6f61 7020 2a73 6f61 702c 2076 6f69 soap *soap, voi │ │ │ +00120c10: 6420 2a68 616e 646c 652c 2063 6861 7220 d *handle, char │ │ │ +00120c20: 2a62 7566 2c20 7369 7a65 5f74 206c 656e *buf, size_t len │ │ │ +00120c30: 293c 2f64 6976 3e3c 6469 7620 636c 6173 )
Callba │ │ │ +00120c50: 636b 2074 6f20 7265 6164 2064 6174 6120 ck to read data │ │ │ +00120c60: 696e 2061 204d 494d 452f 4d54 4f4d 2061 in a MIME/MTOM a │ │ │ +00120c70: 7474 6163 686d 656e 7420 7374 7265 616d ttachment stream │ │ │ +00120c80: 2e3c 2f64 6976 3e3c 6469 7620 636c 6173 .
Def │ │ │ +00120ca0: 696e 6974 696f 6e3a 3c2f 623e 2073 7464 inition: std │ │ │ +00120cb0: 736f 6170 322e 683a 3439 3134 3c2f 6469 soap2.h:4914
.
< │ │ │ +00120cd0: 212d 2d20 6672 6167 6d65 6e74 202d 2d3e !-- fragment --> │ │ │ +00120ce0: 3c70 3e54 6865 2066 6f6c 6c6f 7769 6e67

The following │ │ │ +00120cf0: 2065 7861 6d70 6c65 2069 6c6c 7573 7472 example illustr │ │ │ +00120d00: 6174 6573 2074 6865 2073 7472 6561 6d69 ates the streami │ │ │ +00120d10: 6e67 206f 6620 6120 4d49 4d45 2f4d 544f ng of a MIME/MTO │ │ │ +00120d20: 4d20 6174 7461 6368 6d65 6e74 2069 6e74 M attachment int │ │ │ +00120d30: 6f20 6120 6669 6c65 2062 7920 6120 636c o a file by a cl │ │ │ +00120d40: 6965 6e74 3a3c 2f70 3e0a 3c64 6976 2063 ient:

.
│ │ │ +00120d60: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
int< │ │ │ +00120d90: 2f73 7061 6e3e 206d 6169 6e28 2920 3c2f /span> main() .
{
.< │ │ │ +00120dc0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +00120dd0: 3e20 203c 7370 616e 2063 6c61 7373 3d22 > struct │ │ │ +00120df0: 3c2f 7370 616e 3e3c 6120 636c 6173 733d so │ │ │ +00120e20: 6170 3c2f 613e 203c 6120 636c 6173 733d ap so │ │ │ +00120e50: 6170 3c2f 613e 3b20 3c2f 6469 763e 0a3c ap;
.< │ │ │ +00120e60: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +00120e70: 3e20 203c 6120 636c 6173 733d 2263 6f64 > soap_ini │ │ │ +00120ed0: 743c 2f61 3e28 2661 6d70 3b3c 6120 636c t(&soap); ..
│ │ │ +00120ff0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap. │ │ │ +00121020: 3c61 2063 6c61 7373 3d22 636f 6465 2220 fmimewrit │ │ │ +00121080: 6563 6c6f 7365 3c2f 613e 203d 206d 696d eclose = mim │ │ │ +00121090: 655f 7772 6974 655f 636c 6f73 653b 203c e_write_close; < │ │ │ +001210a0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
soap.fmimewrite │ │ │ +00121150: 3d20 6d69 6d65 5f77 7269 7465 3b20 3c2f = mime_write; .
if (so │ │ │ +001211a0: 6170 5f63 616c 6c5f 6e73 5f5f 7765 626d ap_call_ns__webm │ │ │ +001211b0: 6574 686f 6428 2661 6d70 3b3c 6120 636c ethod(&soap, ...) │ │ │ +001211f0: 293c 2f64 6976 3e0a 3c64 6976 2063 6c61 )
.
.. │ │ │ +00121210: 2e20 3c73 7061 6e20 636c 6173 733d 2263 . // error │ │ │ +00121230: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ +00121250: 2020 3c73 7061 6e20 636c 6173 733d 226b else │ │ │ +00121270: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ +00121290: 2020 2020 2e2e 2e20 3c73 7061 6e20 636c ... // │ │ │ +001212b0: 2073 7563 6365 7373 3c2f 7370 616e 3e3c success< │ │ │ +001212c0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
}
│ │ │ +001212e0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
.
void *mime_write_o │ │ │ +00121340: 7065 6e28 3c73 7061 6e20 636c 6173 733d pen(struct │ │ │ +00121360: 3c2f 7370 616e 3e20 3c61 2063 6c61 7373 s │ │ │ +00121390: 6f61 703c 2f61 3e20 2a3c 6120 636c 6173 oap * │ │ │ +001213c0: 736f 6170 3c2f 613e 2c20 3c73 7061 6e20 soap, │ │ │ +001213e0: 636f 6e73 743c 2f73 7061 6e3e 203c 7370 const char *id │ │ │ +00121430: 3c2f 7370 616e 3e2c 203c 7370 616e 2063 , c │ │ │ +00121450: 6f6e 7374 3c2f 7370 616e 3e20 3c73 7061 onst char *type, c │ │ │ +001214a0: 6f6e 7374 3c2f 7370 616e 3e20 3c73 7061 onst char *description, │ │ │ +001214e0: 3c73 7061 6e20 636c 6173 733d 226b 6579 enum soap_mime_en │ │ │ +00121560: 636f 6469 6e67 3c2f 613e 2065 6e63 6f64 coding encod │ │ │ +00121570: 696e 6729 203c 2f64 6976 3e0a 3c64 6976 ing)
.
{< │ │ │ +00121590: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
FILE * │ │ │ +001215b0: 6861 6e64 6c65 203d 203c 6120 636c 6173 handle = │ │ │ +00121610: 666f 7065 6e3c 2f61 3e28 3c73 7061 6e20 fopen("some │ │ │ +00121640: 6669 6c65 2671 756f 743b 3c2f 7370 616e file", & │ │ │ +00121670: 7175 6f74 3b77 6226 7175 6f74 3b3c 2f73 quot;wb");
. │ │ │ +001216a0: 2020 3c73 7061 6e20 636c 6173 733d 2263 // We ig │ │ │ +001216c0: 6e6f 7265 2074 6865 204d 494d 4520 636f nore the MIME co │ │ │ +001216d0: 6e74 656e 7420 7472 616e 7366 6572 2065 ntent transfer e │ │ │ +001216e0: 6e63 6f64 696e 6720 6865 7265 2c20 6275 ncoding here, bu │ │ │ +001216f0: 7420 7368 6f75 6c64 2063 6865 636b 203c t should check < │ │ │ +00121700: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
. │ │ │ +00121720: 203c 7370 616e 2063 6c61 7373 3d22 6b65 if (!handle) < │ │ │ +00121750: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
{
.
s │ │ │ +001217b0: 6f61 703c 2f61 3e2d 2667 743b 3c61 2063 oap->error = │ │ │ +00121810: 203c 6120 636c 6173 733d 2263 6f64 6522 SOAP_EOF;
.
│ │ │ +00121890: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap- │ │ │ +001218c0: 2667 743b 3c61 2063 6c61 7373 3d22 636f >err │ │ │ +00121910: 6e75 6d3c 2f61 3e20 3d20 6572 726e 6f3b num = errno; │ │ │ +00121920: 203c 7370 616e 2063 6c61 7373 3d22 636f // get re │ │ │ +00121940: 6173 6f6e 203c 2f73 7061 6e3e 3c2f 6469 ason .
}
. │ │ │ +00121970: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
re │ │ │ +001219a0: 7475 726e 3c2f 7370 616e 3e20 283c 7370 turn (void*)handle; .
}
. │ │ │ +00121a10: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
void │ │ │ +00121a50: 6d69 6d65 5f77 7269 7465 5f63 6c6f 7365 mime_write_close │ │ │ +00121a60: 283c 7370 616e 2063 6c61 7373 3d22 6b65 (struct soap │ │ │ +00121ab0: 3c2f 613e 202a 3c61 2063 6c61 7373 3d22 *soa │ │ │ +00121ae0: 703c 2f61 3e2c 203c 7370 616e 2063 6c61 p, void *ha │ │ │ +00121b10: 6e64 6c65 2920 3c2f 6469 763e 0a3c 6469 ndle)
.{ │ │ │ +00121b30: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
fclose((FI │ │ │ +00121bb0: 4c45 2a29 6861 6e64 6c65 293b 203c 2f64 LE*)handle); .
}
.< │ │ │ +00121be0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +00121bf0: 3e20 3c2f 6469 763e 0a3c 6469 7620 636c >
.
int │ │ │ +00121c30: 6d69 6d65 5f77 7269 7465 283c 7370 616e mime_write(struct < │ │ │ +00121c60: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +00121c70: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ +00121c80: 6874 6d6c 223e 736f 6170 3c2f 613e 202a html">soap * │ │ │ +00121c90: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap, │ │ │ +00121cc0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 void< │ │ │ +00121ce0: 2f73 7061 6e3e 202a 6861 6e64 6c65 2c20 /span> *handle, │ │ │ +00121cf0: 3c73 7061 6e20 636c 6173 733d 226b 6579 const cha │ │ │ +00121d30: 723c 2f73 7061 6e3e 202a 3c61 2063 6c61 r *buf, size_t len)
. │ │ │ +00121dc0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
{
.
size_t nwritten; │ │ │ +00121e20: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
while (len)
.< │ │ │ +00121e70: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +00121e80: 3e20 207b 3c2f 6469 763e 0a3c 6469 7620 > {
..
│ │ │ +00122080: 2020 3c73 7061 6e20 636c 6173 733d 226b retu │ │ │ +001220a0: 726e 3c2f 7370 616e 3e20 3c61 2063 6c61 rn SO │ │ │ +00122100: 4150 5f45 4f46 3c2f 613e 3b20 3c2f 6469 AP_EOF; .
}
.
len -= n │ │ │ +00122150: 7772 6974 7465 6e3b 203c 2f64 6976 3e0a written;
. │ │ │ +00122160: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
b │ │ │ +001221c0: 7566 3c2f 613e 202b 3d20 6e77 7269 7474 uf += nwritt │ │ │ +001221d0: 656e 3b20 3c2f 6469 763e 0a3c 6469 7620 en;
.
} │ │ │ +001221f0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
..
}< │ │ │ +001222b0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
vo │ │ │ +001223a0: 6964 282a 2066 6d69 6d65 7772 6974 6563 id(* fmimewritec │ │ │ +001223b0: 6c6f 7365 2928 7374 7275 6374 2073 6f61 lose)(struct soa │ │ │ +001223c0: 7020 2a73 6f61 702c 2076 6f69 6420 2a68 p *soap, void *h │ │ │ +001223d0: 616e 646c 6529 3c2f 6469 763e 3c64 6976 andle)
C │ │ │ +001223f0: 616c 6c62 6163 6b20 746f 2063 6c6f 7365 allback to close │ │ │ +00122400: 2061 204d 494d 452f 4d54 4f4d 2061 7474 a MIME/MTOM att │ │ │ +00122410: 6163 686d 656e 7420 7374 7265 616d 2061 achment stream a │ │ │ +00122420: 6674 6572 2077 7269 7469 6e67 2e3c 2f64 fter writing.
Definit │ │ │ +00122450: 696f 6e3a 3c2f 623e 2073 7464 736f 6170 ion: stdsoap │ │ │ +00122460: 322e 683a 3530 3230 3c2f 6469 763e 3c2f 2.h:5020
.
│ │ │ +001224e0: 3c61 2068 7265 663d 2267 726f 7570 5f5f soap:: │ │ │ +00122530: 666d 696d 6577 7269 7465 3c2f 613e 3c2f fmimewrite
int(* fm │ │ │ +00122560: 696d 6577 7269 7465 2928 7374 7275 6374 imewrite)(struct │ │ │ +00122570: 2073 6f61 7020 2a73 6f61 702c 2076 6f69 soap *soap, voi │ │ │ +00122580: 6420 2a68 616e 646c 652c 2063 6f6e 7374 d *handle, const │ │ │ +00122590: 2063 6861 7220 2a62 7566 2c20 7369 7a65 char *buf, size │ │ │ +001225a0: 5f74 206c 656e 293c 2f64 6976 3e3c 6469 _t len)
│ │ │ +001225c0: 4361 6c6c 6261 636b 2074 6f20 7772 6974 Callback to writ │ │ │ +001225d0: 6520 6461 7461 2069 6e20 6120 4d49 4d45 e data in a MIME │ │ │ +001225e0: 2061 7474 6163 686d 656e 7420 7374 7265 attachment stre │ │ │ +001225f0: 616d 2e3c 2f64 6976 3e3c 6469 7620 636c am.
D │ │ │ +00122610: 6566 696e 6974 696f 6e3a 3c2f 623e 2073 efinition: s │ │ │ +00122620: 7464 736f 6170 322e 683a 3530 3039 3c2f tdsoap2.h:5009
.
void *(* fmime │ │ │ +00122730: 7772 6974 656f 7065 6e29 2873 7472 7563 writeopen)(struc │ │ │ +00122740: 7420 736f 6170 202a 736f 6170 2c20 766f t soap *soap, vo │ │ │ +00122750: 6964 202a 6861 6e64 6c65 2c20 636f 6e73 id *handle, cons │ │ │ +00122760: 7420 6368 6172 202a 6964 2c20 636f 6e73 t char *id, cons │ │ │ +00122770: 7420 6368 6172 202a 7479 7065 2c20 636f t char *type, co │ │ │ +00122780: 6e73 7420 6368 6172 202a 6465 7363 7269 nst char *descri │ │ │ +00122790: 7074 696f 6e2c 2065 6e75 6d20 736f 6170 ption, enum soap │ │ │ +001227a0: 5f6d 696d 655f 656e 636f 6469 6e67 2065 _mime_encoding e │ │ │ +001227b0: 6e63 6f64 696e 6729 3c2f 6469 763e 3c64 ncoding)
Callback to ope │ │ │ +001227e0: 6e20 6120 7374 7265 616d 696e 6720 4d49 n a streaming MI │ │ │ +001227f0: 4d45 2f4d 544f 4d20 6174 7461 6368 6d65 ME/MTOM attachme │ │ │ +00122800: 6e74 2066 6f72 2077 7269 7469 6e67 2e3c nt for writing.< │ │ │ +00122810: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
Defin │ │ │ +00122830: 6974 696f 6e3a 3c2f 623e 2073 7464 736f ition: stdso │ │ │ +00122840: 6170 322e 683a 3439 3938 3c2f 6469 763e ap2.h:4998
│ │ │ +00122850: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
soap_mime_enco │ │ │ +00122940: 6469 6e67 3c2f 6469 763e 3c64 6976 2063 ding
RFC │ │ │ +00122960: 3230 3435 204d 494d 4520 636f 6e74 656e 2045 MIME conten │ │ │ +00122970: 7420 7472 616e 7366 6572 2065 6e63 6f64 t transfer encod │ │ │ +00122980: 696e 6773 2e3c 2f64 6976 3e3c 6469 7620 ings.
Definition: │ │ │ +001229b0: 2073 7464 736f 6170 322e 683a 3130 3232 stdsoap2.h:1022 │ │ │ +001229c0: 333c 2f64 6976 3e3c 2f64 6976 3e0a 3c2f 3
.

Message │ │ │ +001229f0: 636f 6d70 7265 7373 696f 6e20 7769 7468 compression with │ │ │ +00122a00: 203c 636f 6465 3e23 534f 4150 5f45 4e43 #SOAP_ENC │ │ │ +00122a10: 5f5a 4c49 423c 2f63 6f64 653e 2063 616e _ZLIB can │ │ │ +00122a20: 2062 6520 7573 6564 2077 6974 6820 4d49 be used with MI │ │ │ +00122a30: 4d45 2074 6f20 636f 6d70 7265 7373 2074 ME to compress t │ │ │ +00122a40: 6865 2065 6e74 6972 6520 6d65 7373 6167 he entire messag │ │ │ +00122a50: 652e 2048 6f77 6576 6572 2c20 636f 6d70 e. However, comp │ │ │ +00122a60: 7265 7373 696f 6e20 7265 7175 6972 6573 ression requires │ │ │ +00122a70: 2062 7566 6665 7269 6e67 2074 6f20 6465 buffering to de │ │ │ +00122a80: 7465 726d 696e 6520 7468 6520 4854 5450 termine the HTTP │ │ │ +00122a90: 2063 6f6e 7465 6e74 206c 656e 6774 6820 content length │ │ │ +00122aa0: 6865 6164 6572 2c20 7768 6963 6820 6361 header, which ca │ │ │ +00122ab0: 6e63 656c 7320 7468 6520 6265 6e65 6669 ncels the benefi │ │ │ +00122ac0: 7473 206f 6620 7374 7265 616d 696e 6720 ts of streaming │ │ │ +00122ad0: 4d49 4d45 2e20 546f 2061 766f 6964 2074 MIME. To avoid t │ │ │ +00122ae0: 6869 732c 2079 6f75 2073 686f 756c 6420 his, you should │ │ │ +00122af0: 7573 6520 6368 756e 6b65 6420 4854 5450 use chunked HTTP │ │ │ +00122b00: 2028 7769 7468 2074 6865 206f 7574 7075 (with the outpu │ │ │ +00122b10: 742d 6d6f 6465 203c 636f 6465 3e23 534f t-mode #SO │ │ │ +00122b20: 4150 5f49 4f5f 4348 554e 4b3c 2f63 6f64 AP_IO_CHUNK flag) with co │ │ │ +00122b40: 6d70 7265 7373 696f 6e20 616e 6420 7374 mpression and st │ │ │ +00122b50: 7265 616d 696e 6720 4d49 4d45 2e20 4174 reaming MIME. At │ │ │ +00122b60: 2074 6865 2073 6572 7665 7220 7369 6465 the server side │ │ │ +00122b70: 2c20 7768 656e 2079 6f75 2073 6574 203c , when you set < │ │ │ +00122b80: 636f 6465 3e23 534f 4150 5f49 4f5f 4348 code>#SOAP_IO_CH │ │ │ +00122b90: 554e 4b3c 2f63 6f64 653e 2062 6566 6f72 UNK befor │ │ │ +00122ba0: 6520 6361 6c6c 696e 6720 3c63 6f64 653e e calling │ │ │ +00122bb0: 3c61 2063 6c61 7373 3d22 656c 2220 6872 s │ │ │ +00122c20: 6f61 705f 7365 7276 653c 2f61 3e3c 2f63 oap_serve, the engine │ │ │ +00122c40: 2077 696c 6c20 6175 746f 6d61 7469 6361 will automatica │ │ │ +00122c50: 6c6c 7920 7265 7665 7274 2074 6f20 6275 lly revert to bu │ │ │ +00122c60: 6666 6572 696e 6720 283c 636f 6465 3e23 ffering (# │ │ │ +00122c70: 534f 4150 5f49 4f5f 5354 4f52 453c 2f63 SOAP_IO_STORE flag is set │ │ │ +00122c90: 292e 2059 6f75 2063 616e 2063 6865 636b ). You can check │ │ │ +00122ca0: 2074 6869 7320 666c 6167 2077 6974 6820 this flag with │ │ │ +00122cb0: 3c63 6f64 653e 2873 6f61 702d 2667 743b (soap-> │ │ │ +00122cc0: 6f6d 6f64 6520 2661 6d70 3b20 534f 4150 omode & SOAP │ │ │ +00122cd0: 5f49 4f29 203d 3d20 534f 4150 5f49 4f5f _IO) == SOAP_IO_ │ │ │ +00122ce0: 4348 554e 4b3c 2f63 6f64 653e 2074 6f20 CHUNK to │ │ │ +00122cf0: 7365 6520 6966 2074 6865 2063 6c69 656e see if the clien │ │ │ +00122d00: 7420 6163 6365 7074 7320 6368 756e 6b69 t accepts chunki │ │ │ +00122d10: 6e67 2e20 4d6f 7265 2069 6e66 6f72 6d61 ng. More informa │ │ │ +00122d20: 7469 6f6e 2061 626f 7574 2073 7472 6561 tion about strea │ │ │ +00122d30: 6d69 6e67 2063 6875 6e6b 6564 204d 494d ming chunked MIM │ │ │ +00122d40: 4520 6361 6e20 6265 2066 6f75 6e64 2069 E can be found i │ │ │ +00122d50: 6e20 5365 6374 696f 6e20 3c61 2063 6c61 n Section Streaming │ │ │ +00122d90: 2063 6875 6e6b 6564 204d 494d 452f 4d54 chunked MIME/MT │ │ │ +00122da0: 4f4d 3c2f 613e 202e 2e3c 2f70 3e0a 3c70 OM ..

.

Note that the e │ │ │ +00122dc0: 7861 6d70 6c65 2061 626f 7665 2066 6f72 xample above for │ │ │ +00122dd0: 203c 636f 6465 3e6d 696d 655f 7265 6164 mime_read │ │ │ +00122de0: 3c2f 636f 6465 3e20 7573 6573 2061 2068 uses a h │ │ │ +00122df0: 616e 646c 6520 7468 6174 2070 6f69 6e74 andle that point │ │ │ +00122e00: 7320 746f 2074 6865 206f 7065 6e20 6669 s to the open fi │ │ │ +00122e10: 6c65 203c 636f 6465 3e46 494c 452a 3c2f le FILE*. The simpl │ │ │ +00122e30: 6520 6578 616d 706c 6520 6162 6f76 6520 e example above │ │ │ +00122e40: 6973 206e 6f74 2072 6563 6f6d 6d65 6e64 is not recommend │ │ │ +00122e50: 6564 2077 6865 6e20 7468 6520 706c 6174 ed when the plat │ │ │ +00122e60: 666f 726d 2069 6d70 6f73 6573 2061 206c form imposes a l │ │ │ +00122e70: 696d 6974 206f 6e20 7468 6520 6e75 6d62 imit on the numb │ │ │ +00122e80: 6572 206f 6620 6f70 656e 2066 696c 6520 er of open file │ │ │ +00122e90: 6465 7363 7269 7074 6f72 732e 2059 6f75 descriptors. You │ │ │ +00122ea0: 2063 616e 2075 7365 2074 6865 2068 616e can use the han │ │ │ +00122eb0: 646c 6520 746f 2070 6173 7320 616c 6f6e dle to pass alon │ │ │ +00122ec0: 6720 6d6f 7265 2069 6e66 6f72 6d61 7469 g more informati │ │ │ +00122ed0: 6f6e 2074 6861 6e20 6a75 7374 2074 6865 on than just the │ │ │ +00122ee0: 2066 696c 6520 6465 7363 7269 7074 6f72 file descriptor │ │ │ +00122ef0: 2e20 536f 2066 6f72 2065 7861 6d70 6c65 . So for example │ │ │ +00122f00: 2c20 7768 656e 2074 6865 206e 756d 6265 , when the numbe │ │ │ +00122f10: 7220 6f66 206f 7065 6e20 6669 6c65 2064 r of open file d │ │ │ +00122f20: 6573 6372 6970 746f 7273 2069 7320 6c69 escriptors is li │ │ │ +00122f30: 6d69 7465 6420 6f6e 2079 6f75 7220 706c mited on your pl │ │ │ +00122f40: 6174 666f 726d 2c20 796f 7520 7368 6f75 atform, you shou │ │ │ +00122f50: 6c64 206c 6574 2074 6865 2068 616e 646c ld let the handl │ │ │ +00122f60: 6520 706f 696e 7420 746f 2061 2073 7472 e point to a str │ │ │ +00122f70: 7563 7475 7265 2077 6974 6820 6669 6c65 ucture with file │ │ │ +00122f80: 2d72 656c 6174 6564 2069 6e66 6f72 6d61 -related informa │ │ │ +00122f90: 7469 6f6e 2e20 5468 6520 432b 2b20 6578 tion. The C++ ex │ │ │ +00122fa0: 616d 706c 6520 6265 6c6f 7720 696c 6c75 ample below illu │ │ │ +00122fb0: 7374 7261 7465 7320 7468 6973 3a3c 2f70 strates this:

.
file.x │ │ │ +00122ff0: 6f70 5f5f 496e 636c 7564 6520 3d20 736f op__Include = so │ │ │ +00123000: 6170 5f6e 6577 5f5f 786f 705f 5f49 6e63 ap_new__xop__Inc │ │ │ +00123010: 6c75 6465 283c 6120 636c 6173 733d 2263 lude(soap │ │ │ +00123040: 3c2f 613e 293b 203c 2f64 6976 3e0a 3c64 );
. │ │ │ +00123060: 6669 6c65 2e78 6f70 5f5f 496e 636c 7564 file.xop__Includ │ │ │ +00123070: 652d 2667 743b 6964 203d 204e 554c 4c3b e->id = NULL; │ │ │ +00123080: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
file.x │ │ │ +001230a0: 6f70 5f5f 496e 636c 7564 652d 2667 743b op__Include-> │ │ │ +001230b0: 7479 7065 203d 2074 7970 653b 203c 2f64 type = type; .
file.xop__ │ │ │ +001230e0: 496e 636c 7564 652d 2667 743b 6f70 7469 Include->opti │ │ │ +001230f0: 6f6e 7320 3d20 4e55 4c4c 3b20 3c2f 6469 ons = NULL; .
.f │ │ │ +00123130: 696c 652e 786d 696d 6535 5f5f 636f 6e74 ile.xmime5__cont │ │ │ +00123140: 656e 7454 7970 6520 3d20 7479 7065 3b20 entType = type; │ │ │ +00123150: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
file.fi │ │ │ +00123170: 6c65 6e61 6d65 203d 2066 696c 656e 616d lename = filenam │ │ │ +00123180: 653b 203c 2f64 6976 3e0a 3c64 6976 2063 e;
.
.
// T │ │ │ +001231d0: 6865 206f 626a 6563 7420 686f 6c64 696e he object holdin │ │ │ +001231e0: 6720 616c 6c20 696e 666f 726d 6174 696f g all informatio │ │ │ +001231f0: 6e20 746f 2072 6561 6420 6461 7461 203c n to read data < │ │ │ +00123200: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
.F │ │ │ +00123220: 696c 6553 7472 6561 6d49 6e20 2a69 6e73 ileStreamIn *ins │ │ │ +00123230: 203d 203c 7370 616e 2063 6c61 7373 3d22 = new FileStreamIn │ │ │ +00123260: 2865 7272 6f72 6861 6e64 6c65 7229 3b20 (errorhandler); │ │ │ +00123270: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
ins-> │ │ │ +00123290: 3b73 6574 4669 6c65 5061 7468 283c 6120 ;setFilePath(path); │ │ │ +001232f0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
ins-&g │ │ │ +00123310: 743b 7365 7446 696c 654e 616d 6528 6669 t;setFileName(fi │ │ │ +00123320: 6c65 6e61 6d65 293b 203c 2f64 6976 3e0a lename);
. │ │ │ +00123330: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
.
file │ │ │ +00123360: 2e78 6f70 5f5f 496e 636c 7564 652d 2667 .xop__Include-&g │ │ │ +00123370: 743b 5f5f 7369 7a65 203d 2073 697a 653b t;__size = size; │ │ │ +00123380: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
file.x │ │ │ +001233a0: 6f70 5f5f 496e 636c 7564 652d 2667 743b op__Include-> │ │ │ +001233b0: 5f5f 7074 7220 3d20 283c 7370 616e 2063 __ptr = (unsigned cha │ │ │ +00123400: 723c 2f73 7061 6e3e 2a29 696e 733b 3c2f r*)ins;.
so │ │ │ +001234b0: 6170 3a3a 7061 7468 3c2f 613e 3c2f 6469 ap::path
char path[ │ │ │ +001234e0: 534f 4150 5f54 4147 4c45 4e5d 3c2f 6469 SOAP_TAGLEN]
The client │ │ │ +00123510: 7265 7175 6573 7420 7061 7468 2061 7320 request path as │ │ │ +00123520: 7265 6365 6976 6564 206f 6e20 7468 6520 received on the │ │ │ +00123530: 7365 7276 6572 2073 6964 652e 3c2f 6469 server side.
Definiti │ │ │ +00123560: 6f6e 3a3c 2f62 3e20 7374 6473 6f61 7032 on: stdsoap2 │ │ │ +00123570: 2e68 3a34 3033 323c 2f64 6976 3e3c 2f64 .h:4032
.

To │ │ │ +001235a0: 2072 6561 6420 7468 6520 4d54 4f4d 2064 read the MTOM d │ │ │ +001235b0: 6174 6120 666f 7220 7472 616e 736d 6973 ata for transmis │ │ │ +001235c0: 7369 6f6e 3a3c 2f70 3e0a 3c64 6976 2063 sion:

.
│ │ │ +001235e0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
void │ │ │ +00123610: 3c2f 7370 616e 3e20 2a6d 696d 655f 7265 *mime_re │ │ │ +00123620: 6164 5f6f 7065 6e28 3c73 7061 6e20 636c ad_open(st │ │ │ +00123640: 7275 6374 3c2f 7370 616e 3e20 3c61 2063 ruct soap *soap, void *handle, const │ │ │ +00123700: 3c73 7061 6e20 636c 6173 733d 226b 6579 char *id, const < │ │ │ +00123770: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +00123780: 6f72 6474 7970 6522 3e63 6861 723c 2f73 ordtype">char *type, const < │ │ │ +001237c0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +001237d0: 6f72 6474 7970 6522 3e63 6861 723c 2f73 ordtype">char *descriptio │ │ │ +001237f0: 6e29 203c 2f64 6976 3e0a 3c64 6976 2063 n)
.
{.
if (!ha │ │ │ +00123850: 6e64 6c65 2920 3c2f 6469 763e 0a3c 6469 ndle)
. │ │ │ +00123870: 2020 203c 7370 616e 2063 6c61 7373 3d22 ret │ │ │ +00123890: 7572 6e3c 2f73 7061 6e3e 204e 554c 4c3b urn NULL; │ │ │ +001238a0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
File │ │ │ +001238c0: 5374 7265 616d 496e 202a 696e 7320 3d20 StreamIn *ins = │ │ │ +001238d0: 2846 696c 6553 7472 6561 6d49 6e2a 2968 (FileStreamIn*)h │ │ │ +001238e0: 616e 646c 653b 203c 2f64 6976 3e0a 3c64 andle;
. │ │ │ +00123900: 2020 3c73 7061 6e20 636c 6173 733d 226b if (!ins-> │ │ │ +00123930: 6f70 656e 2829 2920 3c2f 6469 763e 0a3c open())
.< │ │ │ +00123940: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +00123950: 3e20 207b 3c2f 6469 763e 0a3c 6469 7620 > {
.
│ │ │ +00123970: 203c 6120 636c 6173 733d 2263 6f64 6522 soap │ │ │ +001239a0: 2d26 6774 3b3c 6120 636c 6173 733d 2263 ->er │ │ │ +001239f0: 726f 723c 2f61 3e20 3d20 3c61 2063 6c61 ror = SO │ │ │ +00123a50: 4150 5f45 5252 3c2f 613e 3b20 3c2f 6469 AP_ERR; .
return │ │ │ +00123aa0: 204e 554c 4c3b 203c 2f64 6976 3e0a 3c64 NULL;
. │ │ │ +00123ac0: 2020 7d20 3c2f 6469 763e 0a3c 6469 7620 }
.
< │ │ │ +00123ae0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +00123af0: 6f72 6466 6c6f 7722 3e72 6574 7572 6e3c ordflow">return< │ │ │ +00123b00: 2f73 7061 6e3e 2068 616e 646c 653b 203c /span> handle; < │ │ │ +00123b10: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
}
│ │ │ +00123b30: 0a3c 6469 7620 636c 6173 733d 226c 696e .
voi │ │ │ +00123b60: 643c 2f73 7061 6e3e 206d 696d 655f 7265 d mime_re │ │ │ +00123b70: 6164 5f63 6c6f 7365 283c 7370 616e 2063 ad_close(s │ │ │ +00123b90: 7472 7563 743c 2f73 7061 6e3e 203c 6120 truct soap *soap, < │ │ │ +00123c00: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +00123c10: 6f72 6474 7970 6522 3e76 6f69 643c 2f73 ordtype">void *handle) .
{
.< │ │ │ +00123c50: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +00123c60: 3e20 203c 7370 616e 2063 6c61 7373 3d22 > if< │ │ │ +00123c80: 2f73 7061 6e3e 2028 2168 616e 646c 6529 /span> (!handle) │ │ │ +00123c90: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
return;
. │ │ │ +00123cf0: 2020 4669 6c65 5374 7265 616d 496e 202a FileStreamIn * │ │ │ +00123d00: 696e 7320 3d20 2846 696c 6553 7472 6561 ins = (FileStrea │ │ │ +00123d10: 6d49 6e2a 2968 616e 646c 653b 203c 2f64 mIn*)handle; .
de │ │ │ +00123d50: 6c65 7465 3c2f 7370 616e 3e20 696e 733b lete ins; │ │ │ +00123d60: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
} .
s │ │ │ +00123db0: 697a 655f 743c 2f73 7061 6e3e 206d 696d ize_t mim │ │ │ +00123dc0: 655f 7265 6164 283c 7370 616e 2063 6c61 e_read(str │ │ │ +00123de0: 7563 743c 2f73 7061 6e3e 203c 6120 636c uct soap *soap, void *handle, char *buf< │ │ │ +00123ef0: 2f61 3e2c 203c 7370 616e 2063 6c61 7373 /a>, s │ │ │ +00123f10: 697a 655f 743c 2f73 7061 6e3e 206c 656e ize_t len │ │ │ +00123f20: 2920 3c2f 6469 763e 0a3c 6469 7620 636c )
.
{.
if (!han │ │ │ +00123f80: 646c 6529 203c 2f64 6976 3e0a 3c64 6976 dle)
.
│ │ │ +00123fa0: 2020 3c73 7061 6e20 636c 6173 733d 226b retu │ │ │ +00123fc0: 726e 3c2f 7370 616e 3e20 303b 203c 2f64 rn 0; .
FileStre │ │ │ +00123ff0: 616d 496e 202a 696e 7320 3d20 2846 696c amIn *ins = (Fil │ │ │ +00124000: 6553 7472 6561 6d49 6e2a 2968 616e 646c eStreamIn*)handl │ │ │ +00124010: 653b 203c 2f64 6976 3e0a 3c64 6976 2063 e;
.
size_t nread = in │ │ │ +00124060: 732d 2667 743b 7265 6164 283c 6120 636c s->read(buf, len │ │ │ +001240c0: 293b 203c 2f64 6976 3e0a 3c64 6976 2063 );
.
if (ins->strea │ │ │ +00124110: 6d45 7272 6f72 2829 2920 3c2f 6469 763e mError())
│ │ │ +00124120: 0a3c 6469 7620 636c 6173 733d 226c 696e .
{
. │ │ │ +00124150: 2020 203c 6120 636c 6173 733d 2263 6f64 soap-> │ │ │ +001241d0: 6572 726f 723c 2f61 3e20 3d20 696e 732d error = ins- │ │ │ +001241e0: 2667 743b 7374 7265 616d 4572 726f 7228 >streamError( │ │ │ +001241f0: 293b 203c 2f64 6976 3e0a 3c64 6976 2063 );
.
│ │ │ +00124210: 3c73 7061 6e20 636c 6173 733d 226b 6579 return │ │ │ +00124230: 3c2f 7370 616e 3e20 303b 203c 2f64 6976 0;
.
}
.< │ │ │ +00124260: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +00124270: 3e20 203c 7370 616e 2063 6c61 7373 3d22 > ret │ │ │ +00124290: 7572 6e3c 2f73 7061 6e3e 206e 7265 6164 urn nread │ │ │ +001242a0: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
}.
SOAP_ERR
#define │ │ │ +001243a0: 534f 4150 5f45 5252 3c2f 6469 763e 3c64 SOAP_ERR
A soap_status e │ │ │ +001243d0: 7272 6f72 2063 6f64 653a 2061 6e20 756e rror code: an un │ │ │ +001243e0: 7370 6563 6966 6965 6420 6572 726f 7220 specified error │ │ │ +001243f0: 6f63 6375 7272 6564 2e3c 2f64 6976 3e3c occurred.
< │ │ │ +00124400: 6469 7620 636c 6173 733d 2274 7464 6566 div class="ttdef │ │ │ +00124410: 223e 3c62 3e44 6566 696e 6974 696f 6e3a ">Definition: │ │ │ +00124420: 3c2f 623e 2073 7464 736f 6170 322e 683a stdsoap2.h: │ │ │ +00124430: 3233 3734 3c2f 6469 763e 3c2f 6469 763e 2374
│ │ │ +00124440: 0a3c 2f64 6976 3e3c 212d 2d20 6672 6167 .

.... │ │ │ +00124460: 3c61 2068 7265 663d 2223 223e 4261 636b Back │ │ │ +00124470: 2074 6f20 7461 626c 6520 6f66 2063 6f6e to table of con │ │ │ +00124480: 7465 6e74 733c 2f61 3e3c 2f70 3e0a 3c68 tents

.. │ │ │ +001244c0: 5265 6469 7265 6374 696e 6720 696e 626f Redirecting inbo │ │ │ +001244d0: 756e 6420 4d49 4d45 2f4d 544f 4d20 7374 und MIME/MTOM st │ │ │ +001244e0: 7265 616d 7320 6261 7365 6420 6f6e 2053 reams based on S │ │ │ +001244f0: 4f41 5020 626f 6479 2063 6f6e 7465 6e74 OAP body content │ │ │ +00124500: 3c2f 6832 3e0a 3c70 3e57 6865 6e20 6974 .

When it │ │ │ +00124510: 2069 7320 7072 6566 6572 6162 6c65 206f is preferable o │ │ │ +00124520: 7220 7265 7175 6972 6564 2074 6f20 7265 r required to re │ │ │ +00124530: 6469 7265 6374 2069 6e62 6f75 6e64 204d direct inbound M │ │ │ +00124540: 494d 452f 4d54 4f4d 2061 7474 6163 686d IME/MTOM attachm │ │ │ +00124550: 656e 7420 7374 7265 616d 7320 6261 7365 ent streams base │ │ │ +00124560: 6420 6f6e 2053 4f41 5020 6d65 7373 6167 d on SOAP messag │ │ │ +00124570: 6520 626f 6479 2063 6f6e 7465 6e74 2c20 e body content, │ │ │ +00124580: 7768 6572 6520 666f 7220 6578 616d 706c where for exampl │ │ │ +00124590: 6520 7468 6520 6e61 6d65 7320 6f66 2074 e the names of t │ │ │ +001245a0: 6865 2072 6573 6f75 7263 6573 2061 7265 he resources are │ │ │ +001245b0: 206c 6973 7465 6420 696e 2074 6865 2053 listed in the S │ │ │ +001245c0: 4f41 5020 6d65 7373 6167 6520 626f 6479 OAP message body │ │ │ +001245d0: 2c20 616e 2061 6c74 6572 6e61 7469 7665 , an alternative │ │ │ +001245e0: 206d 6563 6861 6e69 736d 206d 7573 7420 mechanism must │ │ │ +001245f0: 6265 2075 7365 6420 746f 2068 616e 646c be used to handl │ │ │ +00124600: 6520 7468 6520 6174 7461 6368 6d65 6e74 e the attachment │ │ │ +00124610: 732e 2054 6869 7320 6d65 6368 616e 6973 s. This mechanis │ │ │ +00124620: 6d20 6361 6e20 6265 2075 7365 6420 6174 m can be used at │ │ │ +00124630: 2074 6865 2063 6c69 656e 7420 616e 6420 the client and │ │ │ +00124640: 7365 7276 6572 2073 6964 652e 3c2f 703e server side.

│ │ │ +00124650: 0a3c 703e 4265 6361 7573 6520 7468 6520 .

Because the │ │ │ +00124660: 726f 7574 696e 6720 6f66 2074 6865 2073 routing of the s │ │ │ +00124670: 7472 6561 6d73 2069 7320 6163 636f 6d70 treams is accomp │ │ │ +00124680: 6c69 7368 6564 2077 6974 6820 6578 706c lished with expl │ │ │ +00124690: 6963 6974 2066 756e 6374 696f 6e20 6361 icit function ca │ │ │ +001246a0: 6c6c 732c 2074 6869 7320 6d65 7468 6f64 lls, this method │ │ │ +001246b0: 2073 686f 756c 6420 6f6e 6c79 2062 6520 should only be │ │ │ +001246c0: 7573 6564 2077 6865 6e20 7265 7175 6972 used when requir │ │ │ +001246d0: 6564 2061 6e64 2073 686f 756c 6420 6e6f ed and should no │ │ │ +001246e0: 7420 6265 2063 6f6e 7369 6465 7265 6420 t be considered │ │ │ +001246f0: 6f70 7469 6f6e 616c 2e20 5468 6174 2069 optional. That i │ │ │ +00124700: 732c 2077 6865 6e20 796f 7520 656e 6162 s, when you enab │ │ │ +00124710: 6c65 2074 6869 7320 6d65 7468 6f64 2c20 le this method, │ │ │ +00124720: 796f 7520 6d75 7374 2063 6865 636b 2066 you must check f │ │ │ +00124730: 6f72 2070 656e 6469 6e67 204d 494d 452f or pending MIME/ │ │ │ +00124740: 4d54 4f4d 2061 7474 6163 686d 656e 7473 MTOM attachments │ │ │ +00124750: 2061 6e64 2068 616e 646c 6520 7468 656d and handle them │ │ │ +00124760: 2061 7070 726f 7072 6961 7465 6c79 2e20 appropriately. │ │ │ +00124770: 5468 6973 2069 7320 7472 7565 2065 7665 This is true eve │ │ │ +00124780: 6e20 7768 656e 2079 6f75 2064 6f6e 2774 n when you don't │ │ │ +00124790: 2065 7870 6563 7420 4d49 4d45 2f4d 544f expect MIME/MTO │ │ │ +001247a0: 4d20 6174 7461 6368 6d65 6e74 7320 696e M attachments in │ │ │ +001247b0: 2074 6865 2070 6179 6c6f 6164 2c20 6265 the payload, be │ │ │ +001247c0: 6361 7573 6520 7468 6520 7065 6572 206d cause the peer m │ │ │ +001247d0: 6179 2074 7269 636b 2079 6f75 2062 7920 ay trick you by │ │ │ +001247e0: 7365 6e64 696e 6720 6174 7461 6368 6d65 sending attachme │ │ │ +001247f0: 6e74 7320 616e 7977 6179 2061 6e64 2079 nts anyway and y │ │ │ +00124800: 6f75 2073 686f 756c 6420 6265 2070 7265 ou should be pre │ │ │ +00124810: 7061 7265 6420 746f 2061 6363 6570 7420 pared to accept │ │ │ +00124820: 6f72 2072 656a 6563 7420 7468 656d 2e3c or reject them.< │ │ │ +00124830: 2f70 3e0a 3c70 3e54 6865 2065 7870 6c69 /p>.

The expli │ │ │ +00124840: 6369 7420 4d49 4d45 2f4d 544f 4d20 7374 cit MIME/MTOM st │ │ │ +00124850: 7265 616d 696e 6720 6d65 6368 616e 6973 reaming mechanis │ │ │ +00124860: 6d20 636f 6e73 6973 7473 206f 6620 7468 m consists of th │ │ │ +00124870: 7265 6520 4150 4920 6675 6e63 7469 6f6e ree API function │ │ │ +00124880: 733a 3c2f 703e 0a3c 756c 3e0a 3c6c 693e s:

.
.

Exampl │ │ │ +00125270: 6520 636c 6965 6e74 2069 6e20 433a 3c2f e client in C:.

struct < │ │ │ +001252d0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +001252e0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ +001252f0: 6874 6d6c 223e 736f 6170 3c2f 613e 202a html">soap * │ │ │ +00125300: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap │ │ │ +00125330: 3d20 3c61 2063 6c61 7373 3d22 636f 6465 = soap_new1 │ │ │ +00125390: 3c2f 613e 283c 6120 636c 6173 733d 2263 (SOAP_ENC │ │ │ +001253f0: 5f4d 544f 4d3c 2f61 3e29 3b20 3c2f 6469 _MTOM); .
soap_post │ │ │ +00125470: 5f63 6865 636b 5f6d 696d 655f 6174 7461 _check_mime_atta │ │ │ +00125480: 6368 6d65 6e74 733c 2f61 3e28 3c61 2063 chments(soap); .
if (soap │ │ │ +00125500: 5f63 616c 6c5f 6e73 5f5f 6d79 4d65 7468 _call_ns__myMeth │ │ │ +00125510: 6f64 283c 6120 636c 6173 733d 2263 6f64 od(soap, ...))
│ │ │ +00125550: 0a3c 6469 7620 636c 6173 733d 226c 696e .
{
.
.
}.. │ │ │ +001257b0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
{
.
│ │ │ +001257e0: 2020 3c73 7061 6e20 636c 6173 733d 2263 // attac │ │ │ +00125800: 686d 656e 7473 2061 7265 2070 7265 7365 hments are prese │ │ │ +00125810: 6e74 2c20 6368 616e 6e65 6c20 6973 2073 nt, channel is s │ │ │ +00125820: 7469 6c6c 206f 7065 6e20 3c2f 7370 616e till open
.
do
.
{< │ │ │ +00125890: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
.. │ │ │ +001258b0: 2e20 3c73 7061 6e20 636c 6173 733d 2263 . // get d │ │ │ +001258d0: 6174 6120 2623 3339 3b68 616e 646c 6526 ata 'handle& │ │ │ +001258e0: 2333 393b 2066 726f 6d20 534f 4150 2072 #39; from SOAP r │ │ │ +001258f0: 6573 706f 6e73 6520 616e 6420 7061 7373 esponse and pass │ │ │ +00125900: 2074 6f20 6361 6c6c 6261 636b 7320 3c2f to callbacks
.
│ │ │ +00125930: 2020 2020 2e2e 2e20 3c73 7061 6e20 636c ... // │ │ │ +00125950: 2073 6574 2074 6865 2066 6d69 6d65 2063 set the fmime c │ │ │ +00125960: 616c 6c62 6163 6b73 2c20 6966 206e 6565 allbacks, if nee │ │ │ +00125970: 6465 6420 3c2f 7370 616e 3e3c 2f64 6976 ded
.
│ │ │ +001259b0: 7374 7275 6374 203c 2f73 7061 6e3e 3c61 struct │ │ │ +001259f0: 736f 6170 5f6d 756c 7469 7061 7274 3c2f soap_multipart *content = │ │ │ +00125a60: 736f 6170 5f72 6563 765f 6d69 6d65 5f61 soap_recv_mime_a │ │ │ +00125a70: 7474 6163 686d 656e 743c 2f61 3e28 3c61 ttachment(soap, ( │ │ │ +00125ab0: 3c73 7061 6e20 636c 6173 733d 226b 6579 void*)handle); │ │ │ +00125ae0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
p │ │ │ +00125b00: 7269 6e74 6628 3c73 7061 6e20 636c 6173 rintf("Received │ │ │ +00125b30: 2061 7474 6163 686d 656e 7420 7769 7468 attachment with │ │ │ +00125b40: 2069 643d 2573 2061 6e64 2074 7970 653d id=%s and type= │ │ │ +00125b50: 2573 5c6e 2671 756f 743b 3c2f 7370 616e %s\n", content->< │ │ │ +00125b70: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +00125b80: 7265 663d 2273 7472 7563 7473 6f61 705f ref="structsoap_ │ │ │ +00125b90: 5f6d 756c 7469 7061 7274 2e68 746d 6c23 _multipart.html# │ │ │ +00125ba0: 6164 3062 6364 3739 6234 3061 3162 6331 ad0bcd79b40a1bc1 │ │ │ +00125bb0: 6463 3133 6663 3334 3334 3737 6635 3536 dc13fc343477f556 │ │ │ +00125bc0: 3422 3e69 643c 2f61 3e3f 636f 6e74 656e 4">id?conten │ │ │ +00125bd0: 742d 2667 743b 3c61 2063 6c61 7373 3d22 t->id │ │ │ +00125c30: 3a3c 7370 616e 2063 6c61 7373 3d22 7374 :&qu │ │ │ +00125c50: 6f74 3b26 7175 6f74 3b3c 2f73 7061 6e3e ot;" │ │ │ +00125c60: 2c20 636f 6e74 656e 742d 2667 743b 3c61 , content->type?conte │ │ │ +00125cd0: 6e74 2d26 6774 3b3c 6120 636c 6173 733d nt->type< │ │ │ +00125d30: 2f61 3e3a 3c73 7061 6e20 636c 6173 733d /a>: │ │ │ +00125d50: 2671 756f 743b 2671 756f 743b 3c2f 7370 "");
. │ │ │ +00125d80: 2020 207d 203c 7370 616e 2063 6c61 7373 } w │ │ │ +00125da0: 6869 6c65 3c2f 7370 616e 3e20 2863 6f6e hile (con │ │ │ +00125db0: 7465 6e74 293b 203c 2f64 6976 3e0a 3c64 tent);
. │ │ │ +00125dd0: 2020 2020 3c73 7061 6e20 636c 6173 733d if │ │ │ +00125df0: 3c2f 7370 616e 3e20 283c 6120 636c 6173 ( │ │ │ +00125e20: 736f 6170 3c2f 613e 2d26 6774 3b3c 6120 soap->error) │ │ │ +00125e80: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
│ │ │ +00125ea0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap_print_fa │ │ │ +00125f00: 756c 743c 2f61 3e28 3c61 2063 6c61 7373 ult(s │ │ │ +00125f30: 6f61 703c 2f61 3e2c 2073 7464 6572 7229 oap, stderr) │ │ │ +00125f40: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
}.
}
. │ │ │ +00125f80: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65 │ │ │ +00126030: 0a3c 6469 7620 636c 6173 733d 226c 696e .. │ │ │ +001260f0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap_free(soap);
.. │ │ │ +00126300: 3c64 6976 2063 6c61 7373 3d22 7474 6322
soap_ │ │ │ +001263b0: 706f 7374 5f63 6865 636b 5f6d 696d 655f post_check_mime_ │ │ │ +001263c0: 6174 7461 6368 6d65 6e74 733c 2f61 3e3c attachments< │ │ │ +001263d0: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
int soa │ │ │ +001263f0: 705f 706f 7374 5f63 6865 636b 5f6d 696d p_post_check_mim │ │ │ +00126400: 655f 6174 7461 6368 6d65 6e74 7328 7374 e_attachments(st │ │ │ +00126410: 7275 6374 2073 6f61 7020 2a73 6f61 7029 ruct soap *soap) │ │ │ +00126420: 3c2f 6469 763e 3c64 6976 2063 6c61 7373
Enable │ │ │ +00126440: 706f 7374 2d70 726f 6365 7373 696e 6720 post-processing │ │ │ +00126450: 6f66 204d 494d 452f 4d54 4f4d 2061 7474 of MIME/MTOM att │ │ │ +00126460: 6163 686d 656e 7473 2e3c 2f64 6976 3e3c achments.
< │ │ │ +00126470: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
soap_check_mime │ │ │ +00126530: 5f61 7474 6163 686d 656e 7473 3c2f 613e _attachments │ │ │ +00126540: 3c2f 6469 763e 3c64 6976 2063 6c61 7373
int so │ │ │ +00126560: 6170 5f63 6865 636b 5f6d 696d 655f 6174 ap_check_mime_at │ │ │ +00126570: 7461 6368 6d65 6e74 7328 7374 7275 6374 tachments(struct │ │ │ +00126580: 2073 6f61 7020 2a73 6f61 7029 3c2f 6469 soap *soap)
Check for a │ │ │ +001265b0: 204d 494d 452f 4d54 4f4d 2061 7474 6163 MIME/MTOM attac │ │ │ +001265c0: 686d 656e 742e 3c2f 6469 763e 3c2f 6469 hment.
.

The │ │ │ +001265f0: 2073 6572 7665 722d 7369 6465 2073 6572 server-side ser │ │ │ +00126600: 7669 6365 206f 7065 7261 7469 6f6e 7320 vice operations │ │ │ +00126610: 6172 6520 696d 706c 656d 656e 7465 6420 are implemented │ │ │ +00126620: 6173 2075 7375 616c 2c20 6275 7420 7769 as usual, but wi │ │ │ +00126630: 7468 2061 6464 6974 696f 6e61 6c20 6368 th additional ch │ │ │ +00126640: 6563 6b73 2066 6f72 204d 494d 452f 4d54 ecks for MIME/MT │ │ │ +00126650: 4f4d 2061 7474 6163 686d 656e 7473 3a3c OM attachments:< │ │ │ +00126660: 2f70 3e0a 3c64 6976 2063 6c61 7373 3d22 /p>.

int │ │ │ +001266b0: 206d 6169 6e28 293c 2f64 6976 3e0a 3c64 main()
. │ │ │ +001266d0: 7b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 {
.
struct │ │ │ +00126710: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap │ │ │ +00126740: 2a3c 6120 636c 6173 733d 2263 6f64 6522 *soap │ │ │ +00126770: 203d 203c 6120 636c 6173 733d 2263 6f64 = soap_new │ │ │ +001267d0: 313c 2f61 3e28 3c61 2063 6c61 7373 3d22 1(SOAP_EN │ │ │ +00126830: 435f 4d54 4f4d 3c2f 613e 293b 203c 2f64 C_MTOM); .
soap_p │ │ │ +001268b0: 6f73 745f 6368 6563 6b5f 6d69 6d65 5f61 ost_check_mime_a │ │ │ +001268c0: 7474 6163 686d 656e 7473 3c2f 613e 283c ttachments(< │ │ │ +001268d0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +001268e0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ +001268f0: 6874 6d6c 223e 736f 6170 3c2f 613e 293b html">soap); │ │ │ +00126900: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
soap │ │ │ +00126970: 5f73 6572 7665 3c2f 613e 283c 6120 636c _serve(soap); .
}
. │ │ │ +001269e0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
int n │ │ │ +00126a20: 735f 5f6d 794d 6574 686f 6428 3c73 7061 s__myMethod(struct │ │ │ +00126a50: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap │ │ │ +00126a80: 2a3c 6120 636c 6173 733d 2263 6f64 6522 *soap │ │ │ +00126ab0: 2c20 2e2e 2e29 203c 2f64 6976 3e0a 3c64 , ...)
. │ │ │ +00126ad0: 7b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 {
.
... │ │ │ +00126af0: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // server- │ │ │ +00126b10: 7369 6465 2070 726f 6365 7373 696e 6720 side processing │ │ │ +00126b20: 6c6f 6769 6320 3c2f 7370 616e 3e3c 2f64 logic .
if (s │ │ │ +00126bc0: 6f61 705f 6368 6563 6b5f 6d69 6d65 5f61 oap_check_mime_a │ │ │ +00126bd0: 7474 6163 686d 656e 7473 3c2f 613e 283c ttachments(< │ │ │ +00126be0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +00126bf0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ +00126c00: 6874 6d6c 223e 736f 6170 3c2f 613e 2929 html">soap)) │ │ │ +00126c10: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
{.
/ │ │ │ +00126c60: 2f20 6174 7461 6368 6d65 6e74 7320 6172 / attachments ar │ │ │ +00126c70: 6520 7072 6573 656e 742c 2063 6861 6e6e e present, chann │ │ │ +00126c80: 656c 2069 7320 7374 696c 6c20 6f70 656e el is still open │ │ │ +00126c90: 203c 2f73 7061 6e3e 3c2f 6469 763e 0a3c
.< │ │ │ +00126ca0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +00126cb0: 3e20 2020 203c 7370 616e 2063 6c61 7373 > d │ │ │ +00126cd0: 6f3c 2f73 7061 6e3e 203c 2f64 6976 3e0a o
. │ │ │ +00126ce0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
{
. │ │ │ +00126d10: 2020 2020 2020 2e2e 2e20 3c73 7061 6e20 ... │ │ │ +00126d30: 2f2f 2067 6574 2064 6174 6120 2623 3339 // get data ' │ │ │ +00126d40: 3b68 616e 646c 6526 2333 393b 2066 726f ;handle' fro │ │ │ +00126d50: 6d20 534f 4150 2072 6571 7565 7374 2061 m SOAP request a │ │ │ +00126d60: 6e64 2070 6173 7320 746f 2063 616c 6c62 nd pass to callb │ │ │ +00126d70: 6163 6b73 203c 2f73 7061 6e3e 3c2f 6469 acks .
... < │ │ │ +00126da0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ +00126db0: 656e 7422 3e2f 2f20 7365 7420 7468 6520 ent">// set the │ │ │ +00126dc0: 666d 696d 6520 6361 6c6c 6261 636b 732c fmime callbacks, │ │ │ +00126dd0: 2069 6620 6e65 6564 6564 203c 2f73 7061 if needed
.
│ │ │ +00126e00: 203c 7370 616e 2063 6c61 7373 3d22 6b65 struct soap_mult │ │ │ +00126e60: 6970 6172 743c 2f61 3e20 2a63 6f6e 7465 ipart *conte │ │ │ +00126e70: 6e74 203d 203c 6120 636c 6173 733d 2263 nt = soap_recv │ │ │ +00126ed0: 5f6d 696d 655f 6174 7461 6368 6d65 6e74 _mime_attachment │ │ │ +00126ee0: 3c2f 613e 283c 6120 636c 6173 733d 2263 (soap │ │ │ +00126f10: 3c2f 613e 2c20 283c 7370 616e 2063 6c61 , (void*)ha │ │ │ +00126f40: 6e64 6c65 293b 203c 2f64 6976 3e0a 3c64 ndle);
. │ │ │ +00126f60: 2020 2020 2020 7072 696e 7466 283c 7370 printf("R │ │ │ +00126f90: 6563 6569 7665 6420 6174 7461 6368 6d65 eceived attachme │ │ │ +00126fa0: 6e74 2077 6974 6820 6964 3d25 7320 616e nt with id=%s an │ │ │ +00126fb0: 6420 7479 7065 3d25 735c 6e26 7175 6f74 d type=%s\n" │ │ │ +00126fc0: 3b3c 2f73 7061 6e3e 2c20 636f 6e74 656e ;, conten │ │ │ +00126fd0: 742d 2667 743b 3c61 2063 6c61 7373 3d22 t->id │ │ │ +00127030: 3f63 6f6e 7465 6e74 2d26 6774 3b3c 6120 ?content->id:"" │ │ │ +001270c0: 3c2f 7370 616e 3e2c 2063 6f6e 7465 6e74 , content │ │ │ +001270d0: 2d26 6774 3b3c 6120 636c 6173 733d 2263 ->type?content->type:"&qu │ │ │ +001271c0: 6f74 3b3c 2f73 7061 6e3e 293b 203c 2f64 ot;); .
} while (content); .
if ( │ │ │ +00127260: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap- │ │ │ +00127290: 2667 743b 3c61 2063 6c61 7373 3d22 636f >err │ │ │ +001272e0: 6f72 3c2f 613e 2920 3c2f 6469 763e 0a3c or)
.< │ │ │ +001272f0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +00127300: 3e20 2020 2020 203c 7370 616e 2063 6c61 > return < │ │ │ +00127330: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +00127340: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ +00127350: 6874 6d6c 223e 736f 6170 3c2f 613e 2d26 html">soap-& │ │ │ +00127360: 6774 3b3c 6120 636c 6173 733d 2263 6f64 gt;erro │ │ │ +001273b0: 723c 2f61 3e3b 203c 2f64 6976 3e0a 3c64 r;
. │ │ │ +001273d0: 2020 7d20 3c2f 6469 763e 0a3c 6469 7620 }
.
. │ │ │ +001273f0: 2e2e 203c 7370 616e 2063 6c61 7373 3d22 .. // serv │ │ │ +00127410: 6572 2d73 6964 6520 7072 6f63 6573 7369 er-side processi │ │ │ +00127420: 6e67 206c 6f67 6963 203c 2f73 7061 6e3e ng logic │ │ │ +00127430: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
return SOAP_OK;
.
}.

. │ │ │ +00127510: 9f94 9d20 3c61 2068 7265 663d 2223 223e ... │ │ │ +00127520: 4261 636b 2074 6f20 7461 626c 6520 6f66 Back to table of │ │ │ +00127530: 2063 6f6e 7465 6e74 733c 2f61 3e3c 2f70 contents

.

.S │ │ │ +00127570: 7472 6561 6d69 6e67 2063 6875 6e6b 6564 treaming chunked │ │ │ +00127580: 204d 494d 452f 4d54 4f4d 3c2f 6832 3e0a MIME/MTOM

. │ │ │ +00127590: 3c70 3e54 6f20 7365 6e64 204d 494d 452f

To send MIME/ │ │ │ +001275a0: 4d54 4f4d 2061 7474 6163 686d 656e 7473 MTOM attachments │ │ │ +001275b0: 2c20 7468 6520 6174 7461 6368 6d65 6e74 , the attachment │ │ │ +001275c0: 2073 697a 6573 206d 7573 7420 6265 2064 sizes must be d │ │ │ +001275d0: 6574 6572 6d69 6e65 6420 696e 2061 6476 etermined in adv │ │ │ +001275e0: 616e 6365 2074 6f20 6361 6c63 756c 6174 ance to calculat │ │ │ +001275f0: 6520 4854 5450 206d 6573 7361 6765 206c e HTTP message l │ │ │ +00127600: 656e 6774 6820 7265 7175 6972 6564 2074 ength required t │ │ │ +00127610: 6f20 7374 7265 616d 204d 494d 452f 4d54 o stream MIME/MT │ │ │ +00127620: 4f4d 206f 7665 7220 4854 5450 2e20 486f OM over HTTP. Ho │ │ │ +00127630: 7765 7665 722c 2063 6875 6e6b 6564 204d wever, chunked M │ │ │ +00127640: 494d 452f 4d54 4f4d 2074 6f67 6574 6865 IME/MTOM togethe │ │ │ +00127650: 7220 7769 7468 2063 6875 6e6b 6564 2048 r with chunked H │ │ │ +00127660: 5454 5020 6361 6e20 6265 2075 7365 6420 TTP can be used │ │ │ +00127670: 746f 206f 6d69 7420 7468 6973 2073 7465 to omit this ste │ │ │ +00127680: 702e 2046 6972 7374 2073 6574 2074 6865 p. First set the │ │ │ +00127690: 203c 636f 6465 3e23 534f 4150 5f49 4f5f #SOAP_IO_ │ │ │ +001276a0: 4348 554e 4b3c 2f63 6f64 653e 2066 6c61 CHUNK fla │ │ │ +001276b0: 672e 2054 6865 6e2c 2074 6f20 7374 7265 g. Then, to stre │ │ │ +001276c0: 616d 2063 6875 6e6b 6564 204d 494d 452f am chunked MIME/ │ │ │ +001276d0: 4d54 4f4d 2c20 7365 7420 7468 6520 3c63 MTOM, set the __size member of an a │ │ │ +00127700: 7474 6163 686d 656e 7420 746f 207a 6572 ttachment to zer │ │ │ +00127710: 6f20 616e 6420 656e 6162 6c65 204d 494d o and enable MIM │ │ │ +00127720: 452f 4d54 4f4d 2063 6875 6e6b 696e 672e E/MTOM chunking. │ │ │ +00127730: 2054 6865 204d 494d 452f 4d54 4f4d 203c The MIME/MTOM < │ │ │ +00127740: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soap:: │ │ │ +001277e0: 666d 696d 6572 6561 643c 2f61 3e3c 2f63 fmimeread callback th │ │ │ +00127800: 656e 2066 6574 6368 6573 2064 6174 6120 en fetches data │ │ │ +00127810: 696e 2063 6875 6e6b 7320 616e 6420 6974 in chunks and it │ │ │ +00127820: 2069 7320 696d 706f 7274 616e 7420 746f is important to │ │ │ +00127830: 2066 696c 6c20 7468 6520 656e 7469 7265 fill the entire │ │ │ +00127840: 2062 7566 6665 7220 756e 6c65 7373 2074 buffer unless t │ │ │ +00127850: 6865 2065 6e64 206f 6620 7468 6520 6461 he end of the da │ │ │ +00127860: 7461 2068 6173 2062 6565 6e20 7265 6163 ta has been reac │ │ │ +00127870: 6865 6420 616e 6420 7468 6520 6c61 7374 hed and the last │ │ │ +00127880: 2063 6875 6e6b 2069 7320 746f 2062 6520 chunk is to be │ │ │ +00127890: 7365 6e64 2e20 5468 6174 2069 732c 203c send. That is, < │ │ │ +001278a0: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soap:: │ │ │ +00127940: 666d 696d 6572 6561 643c 2f61 3e3c 2f63 fmimeread should retu │ │ │ +00127960: 726e 2074 6865 2076 616c 7565 206f 6620 rn the value of │ │ │ +00127970: 7468 6520 6c61 7374 203c 636f 6465 3e6c the last l │ │ │ +00127980: 656e 3c2f 636f 6465 3e20 7061 7261 6d65 en parame │ │ │ +00127990: 7465 7220 616e 6420 6669 6c6c 2074 6865 ter and fill the │ │ │ +001279a0: 2065 6e74 6972 6520 6275 6666 6572 203c entire buffer < │ │ │ +001279b0: 636f 6465 3e62 7566 3c2f 636f 6465 3e20 code>buf │ │ │ +001279c0: 666f 7220 616c 6c20 6368 756e 6b73 2065 for all chunks e │ │ │ +001279d0: 7863 6570 7420 7468 6520 6c61 7374 2e20 xcept the last. │ │ │ +001279e0: 466f 7220 7468 6520 6c61 7374 2069 7420 For the last it │ │ │ +001279f0: 7265 7475 726e 7320 302e 3c2f 703e 0a3c returns 0.

.< │ │ │ +00127a00: 703e f09f 949d 203c 6120 6872 6566 3d22 p>.... Back to table │ │ │ +00127a20: 206f 6620 636f 6e74 656e 7473 3c2f 613e of contents │ │ │ +00127a30: 3c2f 703e 0a3c 6831 3e3c 6120 636c 6173

.

.SOAP/XM │ │ │ +00127a60: 4c20 6f76 6572 2055 4450 3c2f 6831 3e0a L over UDP

. │ │ │ +00127a70: 3c70 3e55 4450 2069 7320 6120 7369 6d70

UDP is a simp │ │ │ +00127a80: 6c65 2c20 756e 7265 6c69 6162 6c65 2064 le, unreliable d │ │ │ +00127a90: 6174 6167 7261 6d20 7072 6f74 6f63 6f6c atagram protocol │ │ │ +00127aa0: 3a20 5544 5020 736f 636b 6574 7320 6172 : UDP sockets ar │ │ │ +00127ab0: 6520 636f 6e6e 6563 7469 6f6e 6c65 7373 e connectionless │ │ │ +00127ac0: 2e20 5544 5020 6164 6472 6573 7320 666f . UDP address fo │ │ │ +00127ad0: 726d 6174 7320 6172 6520 6964 656e 7469 rmats are identi │ │ │ +00127ae0: 6361 6c20 746f 2074 686f 7365 2075 7365 cal to those use │ │ │ +00127af0: 6420 6279 2054 4350 2e20 496e 2070 6172 d by TCP. In par │ │ │ +00127b00: 7469 6375 6c61 7220 5544 5020 7072 6f76 ticular UDP prov │ │ │ +00127b10: 6964 6573 2061 2070 6f72 7420 6964 656e ides a port iden │ │ │ +00127b20: 7469 6669 6572 2069 6e20 6164 6469 7469 tifier in additi │ │ │ +00127b30: 6f6e 2074 6f20 7468 6520 6e6f 726d 616c on to the normal │ │ │ +00127b40: 2049 6e74 6572 6e65 7420 6164 6472 6573 Internet addres │ │ │ +00127b50: 7320 666f 726d 6174 2e20 5468 6520 5544 s format. The UD │ │ │ +00127b60: 5020 706f 7274 2073 7061 6365 2069 7320 P port space is │ │ │ +00127b70: 7365 7061 7261 7465 2066 726f 6d20 7468 separate from th │ │ │ +00127b80: 6520 5443 5020 706f 7274 2073 7061 6365 e TCP port space │ │ │ +00127b90: 2028 692e 652e 2061 2055 4450 2070 6f72 (i.e. a UDP por │ │ │ +00127ba0: 7420 6d61 7920 6e6f 7420 6265 2022 636f t may not be "co │ │ │ +00127bb0: 6e6e 6563 7465 6422 2074 6f20 6120 5443 nnected" to a TC │ │ │ +00127bc0: 5020 706f 7274 292e 2049 6e20 6164 6469 P port). In addi │ │ │ +00127bd0: 7469 6f6e 2062 726f 6164 6361 7374 2070 tion broadcast p │ │ │ +00127be0: 6163 6b65 7473 206d 6179 2062 6520 7365 ackets may be se │ │ │ +00127bf0: 6e74 2028 6173 7375 6d69 6e67 2074 6865 nt (assuming the │ │ │ +00127c00: 2075 6e64 6572 6c79 696e 6720 6e65 7477 underlying netw │ │ │ +00127c10: 6f72 6b20 7375 7070 6f72 7473 2074 6869 ork supports thi │ │ │ +00127c20: 7329 2062 7920 7573 696e 6720 6120 7265 s) by using a re │ │ │ +00127c30: 7365 7276 6564 2022 6272 6f61 6463 6173 served "broadcas │ │ │ +00127c40: 740a 6164 6472 6573 7322 3b20 7468 6973 t.address"; this │ │ │ +00127c50: 2061 6464 7265 7373 2069 7320 6e65 7477 address is netw │ │ │ +00127c60: 6f72 6b20 696e 7465 7266 6163 6520 6465 ork interface de │ │ │ +00127c70: 7065 6e64 656e 742e 3c2f 703e 0a3c 703e pendent.

.

│ │ │ +00127c80: 436c 6965 6e74 2d73 6964 6520 6d65 7373 Client-side mess │ │ │ +00127c90: 6167 6573 2077 6974 6820 534f 4150 2d6f ages with SOAP-o │ │ │ +00127ca0: 7665 722d 5544 5020 656e 6470 6f69 6e74 ver-UDP endpoint │ │ │ +00127cb0: 2055 524c 7320 283c 636f 6465 3e73 6f61 URLs (soa │ │ │ +00127cc0: 702e 7564 703a 2f2f 2e2e 2e3c 2f63 6f64 p.udp://...) are automati │ │ │ +00127ce0: 6361 6c6c 7920 7472 616e 736d 6974 7465 cally transmitte │ │ │ +00127cf0: 6420 6173 2064 6174 6167 7261 6d73 2e20 d as datagrams. │ │ │ +00127d00: 5365 7276 6572 2d73 6964 6520 6170 706c Server-side appl │ │ │ +00127d10: 6963 6174 696f 6e73 2073 686f 756c 6420 ications should │ │ │ +00127d20: 7365 7420 7468 6520 3c63 6f64 653e 2353 set the #S │ │ │ +00127d30: 4f41 505f 494f 5f55 4450 3c2f 636f 6465 OAP_IO_UDP mode flag to a │ │ │ +00127d50: 6363 6570 7420 5544 5020 7265 7175 6573 ccept UDP reques │ │ │ +00127d60: 7473 2c20 652e 672e 2075 7369 6e67 203c ts, e.g. using < │ │ │ +00127d70: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soap_new1< │ │ │ +00127e30: 2f63 6f64 653e 2c20 3c63 6f64 653e 3c61 /code>, soap_i │ │ │ +00127ef0: 6e69 7431 3c2f 613e 3c2f 636f 6465 3e2c nit1, │ │ │ +00127f00: 206f 7220 3c63 6f64 653e 3c61 2063 6c61 or soap_set_mo │ │ │ +00127fb0: 6465 3c2f 613e 3c2f 636f 6465 3e2e 3c2f de..

The maximu │ │ │ +00127fd0: 6d20 6d65 7373 6167 6520 6c65 6e67 7468 m message length │ │ │ +00127fe0: 2066 6f72 2064 6174 6167 7261 6d20 7061 for datagram pa │ │ │ +00127ff0: 636b 6574 7320 6973 2072 6573 7472 6963 ckets is restric │ │ │ +00128000: 7465 6420 6279 2074 6865 2062 7566 6665 ted by the buffe │ │ │ +00128010: 7220 7369 7a65 203c 636f 6465 3e23 534f r size #SO │ │ │ +00128020: 4150 5f42 5546 4c45 4e3c 2f63 6f64 653e AP_BUFLEN │ │ │ +00128030: 2c20 7768 6963 6820 6973 2036 3535 3336 , which is 65536 │ │ │ +00128040: 2062 7920 6465 6661 756c 742c 2075 6e6c by default, unl │ │ │ +00128050: 6573 7320 636f 6d70 696c 6564 2077 6974 ess compiled wit │ │ │ +00128060: 6820 3c63 6f64 653e 2357 4954 485f 4c45 h #WITH_LE │ │ │ +00128070: 414e 3c2f 636f 6465 3e20 746f 2073 7570 AN to sup │ │ │ +00128080: 706f 7274 2073 6d61 6c6c 2d73 6361 6c65 port small-scale │ │ │ +00128090: 2065 6d62 6564 6465 6420 7379 7374 656d embedded system │ │ │ +001280a0: 732e 2046 6f72 2055 4450 2074 7261 6e73 s. For UDP trans │ │ │ +001280b0: 706f 7274 203c 636f 6465 3e23 534f 4150 port #SOAP │ │ │ +001280c0: 5f42 5546 4c45 4e3c 2f63 6f64 653e 206d _BUFLEN m │ │ │ +001280d0: 7573 7420 6e6f 7420 6578 6365 6564 2074 ust not exceed t │ │ │ +001280e0: 6865 206d 6178 696d 756d 2055 4450 2070 he maximum UDP p │ │ │ +001280f0: 6163 6b65 7420 7369 7a65 2036 3535 3336 acket size 65536 │ │ │ +00128100: 2028 7468 6520 7369 7a65 206f 6620 6461 (the size of da │ │ │ +00128110: 7461 6772 616d 206d 6573 7361 6765 7320 tagram messages │ │ │ +00128120: 6973 2063 6f6e 7374 7261 696e 6564 2062 is constrained b │ │ │ +00128130: 7920 7468 6520 5544 5020 7061 636b 6574 y the UDP packet │ │ │ +00128140: 2073 697a 6520 325e 3136 3d36 3535 3336 size 2^16=65536 │ │ │ +00128150: 2061 7320 7065 7220 5544 5020 7374 616e as per UDP stan │ │ │ +00128160: 6461 7264 292e 2059 6f75 2063 616e 2075 dard). You can u │ │ │ +00128170: 7365 2063 6f6d 7072 6573 7369 6f6e 2077 se compression w │ │ │ +00128180: 6974 6820 3c63 6f64 653e 2353 4f41 505f ith #SOAP_ │ │ │ +00128190: 454e 435f 5a4c 4942 3c2f 636f 6465 3e20 ENC_ZLIB │ │ │ +001281a0: 746f 2072 6564 7563 6520 7468 6520 6d65 to reduce the me │ │ │ +001281b0: 7373 6167 6520 7369 7a65 2c20 6275 7420 ssage size, but │ │ │ +001281c0: 6e6f 7465 2074 6861 7420 636f 6d70 7265 note that compre │ │ │ +001281d0: 7373 6564 2053 4f41 502d 6f76 6572 2d55 ssed SOAP-over-U │ │ │ +001281e0: 4450 2069 7320 6120 6753 4f41 502d 7370 DP is a gSOAP-sp │ │ │ +001281f0: 6563 6966 6963 2066 6561 7475 7265 2062 ecific feature b │ │ │ +00128200: 6563 6175 7365 2069 7420 6973 206e 6f74 ecause it is not │ │ │ +00128210: 2070 6172 7420 6f66 2074 6865 2053 4f41 part of the SOA │ │ │ +00128220: 502d 6f76 6572 2d55 4450 2073 7065 6369 P-over-UDP speci │ │ │ +00128230: 6669 6361 7469 6f6e 2e3c 2f70 3e0a 3c70 fication.

.

The SOAP-over-U │ │ │ +00128250: 4450 2073 7065 6369 6669 6361 7469 6f6e DP specification │ │ │ +00128260: 2072 656c 6965 7320 6f6e 2057 532d 4164 relies on WS-Ad │ │ │ +00128270: 6472 6573 7369 6e67 2e20 5468 6520 3c65 dressing. The wsa.h file i │ │ │ +001282a0: 6e20 7468 6520 3c63 6f64 653e 696d 706f n the impo │ │ │ +001282b0: 7274 3c2f 636f 6465 3e20 6469 7265 6374 rt direct │ │ │ +001282c0: 6f72 7920 6465 6669 6e65 7320 7468 6520 ory defines the │ │ │ +001282d0: 5753 2d41 6464 7265 7373 696e 6720 656c WS-Addressing el │ │ │ +001282e0: 656d 656e 7473 2066 6f72 2063 6c69 656e ements for clien │ │ │ +001282f0: 7420 616e 6420 7365 7276 6572 2061 7070 t and server app │ │ │ +00128300: 6c69 6361 7469 6f6e 732e 3c2f 703e 0a3c lications.

.< │ │ │ +00128310: 703e 5468 6520 6753 4f41 5020 696d 706c p>The gSOAP impl │ │ │ +00128320: 656d 656e 7461 7469 6f6e 2063 6f6e 666f ementation confo │ │ │ +00128330: 726d 7320 746f 2074 6865 2053 4f41 502d rms to the SOAP- │ │ │ +00128340: 6f76 6572 2d55 4450 2072 6571 7569 7265 over-UDP require │ │ │ +00128350: 6d65 6e74 733a 3c2f 703e 0a3c 756c 3e0a ments:

.
    . │ │ │ +00128360: 3c6c 693e 534f 4150 2d6f 7665 722d 5544
  • SOAP-over-UD │ │ │ +00128370: 5020 7365 7276 6572 2065 6e64 706f 696e P server endpoin │ │ │ +00128380: 7420 5552 4c20 666f 726d 6174 3a20 3c65 t URL format: soap.udp │ │ │ +001283a0: 3a2f 2f68 6f73 743a 706f 7274 2f70 6174 ://host:port/pat │ │ │ +001283b0: 683c 2f63 6f64 653e 3c2f 656d 3e3c 2f6c h.
  • Support o │ │ │ +001283d0: 6e65 2d77 6179 206d 6573 7361 6765 2d65 ne-way message-e │ │ │ +001283e0: 7863 6861 6e67 6520 7061 7474 6572 6e20 xchange pattern │ │ │ +001283f0: 284d 4550 2920 7768 6572 6520 6120 534f (MEP) where a SO │ │ │ +00128400: 4150 2065 6e76 656c 6f70 6520 6973 2063 AP envelope is c │ │ │ +00128410: 6172 7269 6564 2069 6e20 6120 7573 6572 arried in a user │ │ │ +00128420: 2064 6174 6167 7261 6d2e 3c2f 6c69 3e0a datagram.
  • . │ │ │ +00128430: 3c6c 693e 5375 7070 6f72 7420 7265 7175
  • Support requ │ │ │ +00128440: 6573 742d 7265 7370 6f6e 7365 206d 6573 est-response mes │ │ │ +00128450: 7361 6765 2d65 7863 6861 6e67 6520 7061 sage-exchange pa │ │ │ +00128460: 7474 6572 6e20 284d 4550 2920 7768 6572 ttern (MEP) wher │ │ │ +00128470: 6520 534f 4150 2065 6e76 656c 6f70 6573 e SOAP envelopes │ │ │ +00128480: 2061 7265 2063 6172 7269 6564 2069 6e20 are carried in │ │ │ +00128490: 7573 6572 2064 6174 6167 7261 6d73 2e3c user datagrams.< │ │ │ +001284a0: 2f6c 693e 0a3c 6c69 3e53 7570 706f 7274 /li>.
  • Support │ │ │ +001284b0: 206d 756c 7469 6361 7374 2074 7261 6e73 multicast trans │ │ │ +001284c0: 6d69 7373 696f 6e20 6f66 2053 4f41 5020 mission of SOAP │ │ │ +001284d0: 656e 7665 6c6f 7065 7320 6361 7272 6965 envelopes carrie │ │ │ +001284e0: 6420 696e 2075 7365 7220 6461 7461 6772 d in user datagr │ │ │ +001284f0: 616d 732e 3c2f 6c69 3e0a 3c6c 693e 5375 ams.
  • .
  • Su │ │ │ +00128500: 7070 6f72 7420 626f 7468 2053 4f41 5020 pport both SOAP │ │ │ +00128510: 312e 3120 616e 6420 534f 4150 2031 2e32 1.1 and SOAP 1.2 │ │ │ +00128520: 2065 6e76 656c 6f70 6573 2e3c 2f6c 693e envelopes.
  • │ │ │ +00128530: 0a3c 2f75 6c3e 0a3c 703e 5468 6520 666f .
.

The fo │ │ │ +00128540: 6c6c 6f77 696e 6720 6164 6469 7469 6f6e llowing addition │ │ │ +00128550: 616c 2066 6561 7475 7265 7320 6172 6520 al features are │ │ │ +00128560: 616c 736f 2061 7661 696c 6162 6c65 2c20 also available, │ │ │ +00128570: 6275 7420 6172 6520 6e6f 7420 7375 7070 but are not supp │ │ │ +00128580: 6f72 7465 6420 6279 2074 6865 2053 4f41 orted by the SOA │ │ │ +00128590: 502d 6f76 6572 2d55 4450 2073 7065 6369 P-over-UDP speci │ │ │ +001285a0: 6669 6361 7469 6f6e 3a3c 2f70 3e0a 3c75 fication:

..
  • Zlib/gzip │ │ │ +001285c0: 206d 6573 7361 6765 2063 6f6d 7072 6573 message compres │ │ │ +001285d0: 7369 6f6e 2028 7573 6520 636f 6d70 696c sion (use compil │ │ │ +001285e0: 652d 7469 6d65 2066 6c61 6720 3c63 6f64 e-time flag #WITH_GZIP).
  • .
  • S │ │ │ +00128610: 4f41 5020 7769 7468 2044 494d 4520 6174 OAP with DIME at │ │ │ +00128620: 7461 6368 6d65 6e74 7320 6f76 6572 2055 tachments over U │ │ │ +00128630: 4450 2e3c 2f6c 693e 0a3c 6c69 3e53 4f41 DP.
  • .
  • SOA │ │ │ +00128640: 5020 7769 7468 204d 494d 452f 4d54 4f4d P with MIME/MTOM │ │ │ +00128650: 2061 7474 6163 686d 656e 7473 206f 7665 attachments ove │ │ │ +00128660: 7220 5544 502e 3c2f 6c69 3e0a 3c6c 693e r UDP.
  • .
  • │ │ │ +00128670: 5375 7070 6f72 7420 666f 7220 4950 7636 Support for IPv6 │ │ │ +00128680: 2028 7573 6520 636f 6d70 696c 652d 7469 (use compile-ti │ │ │ +00128690: 6d65 2066 6c61 6720 3c63 6f64 653e 2357 me flag #W │ │ │ +001286a0: 4954 485f 4950 5636 3c2f 636f 6465 3e29 ITH_IPV6) │ │ │ +001286b0: 3c2f 6c69 3e0a 3c2f 756c 3e0a 3c70 3ef0
  • ..

    . │ │ │ +001286c0: 9f94 9d20 3c61 2068 7265 663d 2223 223e ... │ │ │ +001286d0: 4261 636b 2074 6f20 7461 626c 6520 6f66 Back to table of │ │ │ +001286e0: 2063 6f6e 7465 6e74 733c 2f61 3e3c 2f70 contents

    .

    .Using W │ │ │ +00128720: 532d 4164 6472 6573 7369 6e67 2077 6974 S-Addressing wit │ │ │ +00128730: 6820 534f 4150 2d6f 7665 722d 5544 503c h SOAP-over-UDP< │ │ │ +00128740: 2f68 323e 0a3c 703e 4120 534f 4150 2d6f /h2>.

    A SOAP-o │ │ │ +00128750: 7665 722d 5544 5020 6170 706c 6963 6174 ver-UDP applicat │ │ │ +00128760: 696f 6e20 6d61 7920 7573 6520 5753 2d41 ion may use WS-A │ │ │ +00128770: 6464 7265 7373 696e 6720 746f 2063 6f6e ddressing to con │ │ │ +00128780: 7472 6f6c 206d 6573 7361 6765 2064 656c trol message del │ │ │ +00128790: 6976 6572 7920 6173 2070 6572 2053 4f41 ivery as per SOA │ │ │ +001287a0: 502d 6f76 6572 2d55 4450 2073 7065 6369 P-over-UDP speci │ │ │ +001287b0: 6669 6361 7469 6f6e 2e3c 2f70 3e0a 3c70 fication.

    .

    The w │ │ │ +001287d0: 7361 2e68 3c2f 636f 6465 3e3c 2f65 6d3e sa.h │ │ │ +001287e0: 2066 696c 6520 696e 2074 6865 203c 636f file in the import │ │ │ +00128800: 2064 6972 6563 746f 7279 2064 6566 696e directory defin │ │ │ +00128810: 6573 2074 6865 2057 532d 4164 6472 6573 es the WS-Addres │ │ │ +00128820: 7369 6e67 2065 6c65 6d65 6e74 732e 2054 sing elements. T │ │ │ +00128830: 6f20 696e 636c 7564 6520 7468 6520 5753 o include the WS │ │ │ +00128840: 2d41 6464 7265 7373 696e 6720 656c 656d -Addressing elem │ │ │ +00128850: 656e 7473 2069 6e20 7468 6520 534f 4150 ents in the SOAP │ │ │ +00128860: 2048 6561 6465 7220 666f 7220 6d65 7373 Header for mess │ │ │ +00128870: 6167 696e 672c 2061 2057 532d 4164 6472 aging, a WS-Addr │ │ │ +00128880: 6573 7369 6e67 2063 6170 6162 6c65 203c essing capable < │ │ │ +00128890: 636f 6465 3e3c 6120 636c 6173 733d 2265 code> │ │ │ +001288f0: 534f 4150 5f45 4e56 5f5f 4865 6164 6572 SOAP_ENV__Header │ │ │ +00128900: 3c2f 613e 3c2f 636f 6465 3e20 7374 7275 stru │ │ │ +00128910: 6374 2073 686f 756c 6420 6265 2064 6566 ct should be def │ │ │ +00128920: 696e 6564 2069 6e20 796f 7572 2068 6561 ined in your hea │ │ │ +00128930: 6465 7220 6669 6c65 2062 7920 696d 706f der file by impo │ │ │ +00128940: 7274 696e 6720 3c65 6d3e 3c63 6f64 653e rting │ │ │ +00128950: 6773 6f61 702f 696d 706f 7274 2f77 7361 gsoap/import/wsa │ │ │ +00128960: 2e68 3c2f 636f 6465 3e3c 2f65 6d3e 206f .h o │ │ │ +00128970: 7220 3c65 6d3e 3c63 6f64 653e 6773 6f61 r gsoa │ │ │ +00128980: 702f 696d 706f 7274 2f77 7361 352e 683c p/import/wsa5.h< │ │ │ +00128990: 2f63 6f64 653e 3c2f 656d 3e3a 3c2f 703e /code>:

    │ │ │ +001289a0: 0a3c 6469 7620 636c 6173 733d 2266 7261 .
    #import &quo │ │ │ +001289f0: 743b 7773 612e 6826 7175 6f74 3b3c 2f73 t;wsa.h"
    .

    We also in │ │ │ +00128a30: 636c 7564 6564 2061 203c 636f 6465 3e2f cluded a / │ │ │ +00128a40: 2f67 736f 6170 2077 7361 2073 6368 656d /gsoap wsa schem │ │ │ +00128a50: 6120 696d 706f 7274 3a3c 2f63 6f64 653e a import: │ │ │ +00128a60: 2064 6972 6563 7469 7665 2069 6e20 7468 directive in th │ │ │ +00128a70: 6520 3c65 6d3e 3c63 6f64 653e 7773 612e e wsa. │ │ │ +00128a80: 683c 2f63 6f64 653e 3c2f 656d 3e20 6669 h fi │ │ │ +00128a90: 6c65 2074 6f20 656e 6162 6c65 2074 6865 le to enable the │ │ │ +00128aa0: 2067 656e 6572 6174 696f 6e20 6f66 2057 generation of W │ │ │ +00128ab0: 5344 4c20 7370 6563 6966 6963 6174 696f SDL specificatio │ │ │ +00128ac0: 6e73 2074 6861 7420 696d 706f 7274 2028 ns that import ( │ │ │ +00128ad0: 696e 7374 6561 6420 6f66 2069 6e63 6c75 instead of inclu │ │ │ +00128ae0: 6465 7329 2074 6865 2057 532d 4164 6472 des) the WS-Addr │ │ │ +00128af0: 6573 7369 6e67 2065 6c65 6d65 6e74 732e essing elements. │ │ │ +00128b00: 204e 6f74 6520 7468 6174 2074 6865 203c Note that the < │ │ │ +00128b10: 636f 6465 3e2f 2f67 736f 6170 6f70 7420 code>//gsoapopt │ │ │ +00128b20: 773c 2f63 6f64 653e 2064 6972 6563 7469 w directi │ │ │ +00128b30: 7665 2028 7768 6963 6820 6164 6473 206f ve (which adds o │ │ │ +00128b40: 7074 696f 6e20 3c62 3e3c 636f 6465 3e2d ption - │ │ │ +00128b50: 773c 2f63 6f64 653e 3c2f 623e 2074 6f20 w to │ │ │ +00128b60: 7275 6e20 3c62 3e3c 636f 6465 3e73 6f61 run soa │ │ │ +00128b70: 7063 7070 3220 2d77 3c2f 636f 6465 3e3c pcpp2 -w< │ │ │ +00128b80: 2f62 3e29 206d 7573 7420 6e6f 7420 6265 /b>) must not be │ │ │ +00128b90: 2070 7265 7365 6e74 2069 6e20 796f 7572 present in your │ │ │ +00128ba0: 2068 6561 6465 7220 6669 6c65 2074 6f20 header file to │ │ │ +00128bb0: 656e 6162 6c65 2057 5344 4c20 6765 6e65 enable WSDL gene │ │ │ +00128bc0: 7261 7469 6f6e 2e3c 2f70 3e0a 3c70 3e4f ration.

    .

    O │ │ │ +00128bd0: 6e65 2d77 6179 2053 4f41 502d 6f76 6572 ne-way SOAP-over │ │ │ +00128be0: 2d55 4450 206d 6573 7361 6765 7320 2873 -UDP messages (s │ │ │ +00128bf0: 6565 2053 6563 7469 6f6e 203c 6120 636c ee Section Asynchronous │ │ │ +00128c30: 6f6e 652d 7761 7920 6d65 7373 6167 6520 one-way message │ │ │ +00128c40: 7061 7373 696e 673c 2f61 3e20 2920 7368 passing ) sh │ │ │ +00128c50: 6f75 6c64 2062 6520 6465 636c 6172 6564 ould be declared │ │ │ +00128c60: 2074 6f20 696e 636c 7564 6520 7468 6520 to include the │ │ │ +00128c70: 3c65 6d3e 3c63 6f64 653e 7773 613a 4d65 wsa:Me │ │ │ +00128c80: 7373 6167 6549 443c 2f63 6f64 653e 3c2f ssageID, w │ │ │ +00128ca0: 7361 3a54 6f3c 2f63 6f64 653e 3c2f 656d sa:To, and wsa:Action elements │ │ │ +00128ce0: 2069 6e20 7468 6520 534f 4150 2048 6561 in the SOAP Hea │ │ │ +00128cf0: 6465 7220 6f66 2074 6865 2072 6571 7565 der of the reque │ │ │ +00128d00: 7374 206d 6573 7361 6765 2061 7320 666f st message as fo │ │ │ +00128d10: 6c6c 6f77 733a 3c2f 703e 0a3c 6469 7620 llows:

    .
    //gsoap │ │ │ +00128d60: 206e 7320 7365 7276 6963 6520 6d65 7468 ns service meth │ │ │ +00128d70: 6f64 2d68 6561 6465 722d 7061 7274 3a20 od-header-part: │ │ │ +00128d80: 2020 2020 2020 2020 2073 656e 6453 7472 sendStr │ │ │ +00128d90: 696e 6720 7773 615f 5f4d 6573 7361 6765 ing wsa__Message │ │ │ +00128da0: 4944 203c 2f73 7061 6e3e 3c2f 6469 763e ID
    │ │ │ +00128db0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    //gsoap │ │ │ +00128de0: 206e 7320 7365 7276 6963 6520 6d65 7468 ns service meth │ │ │ +00128df0: 6f64 2d68 6561 6465 722d 7061 7274 3a20 od-header-part: │ │ │ +00128e00: 2020 2020 2020 2020 2073 656e 6453 7472 sendStr │ │ │ +00128e10: 696e 6720 7773 615f 5f54 6f20 3c2f 7370 ing wsa__To
    .
    //gsoap ns ser │ │ │ +00128e60: 7669 6365 206d 6574 686f 642d 6865 6164 vice method-head │ │ │ +00128e70: 6572 2d70 6172 743a 2020 2020 2020 2020 er-part: │ │ │ +00128e80: 2020 7365 6e64 5374 7269 6e67 2077 7361 sendString wsa │ │ │ +00128e90: 5f5f 4163 7469 6f6e 203c 2f73 7061 6e3e __Action │ │ │ +00128ea0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    int ns │ │ │ +00128ee0: 5f5f 7365 6e64 5374 7269 6e67 283c 7370 __sendString(char *str, void); │ │ │ +00128f40: 3c2f 6469 763e 0a3c 2f64 6976 3e3c 212d
    .

    Request-respons │ │ │ +00128f70: 6520 534f 4150 2d6f 7665 722d 5544 5020 e SOAP-over-UDP │ │ │ +00128f80: 6d65 7373 6167 6573 2073 686f 756c 6420 messages should │ │ │ +00128f90: 6265 2064 6563 6c61 7265 6420 746f 2069 be declared to i │ │ │ +00128fa0: 6e63 6c75 6465 2074 6865 203c 656d 3e3c nclude the < │ │ │ +00128fb0: 636f 6465 3e77 7361 3a4d 6573 7361 6765 code>wsa:Message │ │ │ +00128fc0: 4944 3c2f 636f 6465 3e3c 2f65 6d3e 2c20 ID, │ │ │ +00128fd0: 3c65 6d3e 3c63 6f64 653e 7773 613a 546f wsa:To │ │ │ +00128fe0: 3c2f 636f 6465 3e3c 2f65 6d3e 2c20 3c65 , wsa:Acti │ │ │ +00129000: 6f6e 3c2f 636f 6465 3e3c 2f65 6d3e 2c20 on, │ │ │ +00129010: 616e 6420 3c65 6d3e 3c63 6f64 653e 7773 and ws │ │ │ +00129020: 613a 5265 706c 7954 6f3c 2f63 6f64 653e a:ReplyTo │ │ │ +00129030: 3c2f 656d 3e20 656c 656d 656e 7473 2069 elements i │ │ │ +00129040: 6e20 7468 6520 534f 4150 2048 6561 6465 n the SOAP Heade │ │ │ +00129050: 7220 6f66 2074 6865 2072 6571 7565 7374 r of the request │ │ │ +00129060: 206d 6573 7361 6765 2c20 616e 6420 7468 message, and th │ │ │ +00129070: 6520 7468 6520 3c65 6d3e 3c63 6f64 653e e the │ │ │ +00129080: 7773 613a 4d65 7373 6167 6549 443c 2f63 wsa:MessageID, < │ │ │ +001290a0: 636f 6465 3e77 7361 3a54 6f3c 2f63 6f64 code>wsa:To, wsa:Action, and < │ │ │ +001290e0: 656d 3e3c 636f 6465 3e77 7361 3a52 656c em>wsa:Rel │ │ │ +001290f0: 6174 6573 546f 3c2f 636f 6465 3e3c 2f65 atesTo elements in t │ │ │ +00129110: 6865 2053 4f41 5020 4865 6164 6572 206f he SOAP Header o │ │ │ +00129120: 6620 7468 6520 7265 7370 6f6e 7365 206d f the response m │ │ │ +00129130: 6573 7361 6765 3a3c 2f70 3e0a 3c64 6976 essage:

    .
    //gsoa │ │ │ +00129180: 7020 6e73 2073 6572 7669 6365 206d 6574 p ns service met │ │ │ +00129190: 686f 642d 6865 6164 6572 2d70 6172 743a hod-header-part: │ │ │ +001291a0: 2020 2020 2020 2020 2020 6563 686f 5374 echoSt │ │ │ +001291b0: 7269 6e67 2077 7361 5f5f 4d65 7373 6167 ring wsa__Messag │ │ │ +001291c0: 6549 4420 3c2f 7370 616e 3e3c 2f64 6976 eID
    .
    //gsoa │ │ │ +00129200: 7020 6e73 2073 6572 7669 6365 206d 6574 p ns service met │ │ │ +00129210: 686f 642d 6865 6164 6572 2d70 6172 743a hod-header-part: │ │ │ +00129220: 2020 2020 2020 2020 2020 6563 686f 5374 echoSt │ │ │ +00129230: 7269 6e67 2077 7361 5f5f 546f 203c 2f73 ring wsa__To
    .
    //gsoap ns se │ │ │ +00129280: 7276 6963 6520 6d65 7468 6f64 2d68 6561 rvice method-hea │ │ │ +00129290: 6465 722d 7061 7274 3a20 2020 2020 2020 der-part: │ │ │ +001292a0: 2020 2065 6368 6f53 7472 696e 6720 7773 echoString ws │ │ │ +001292b0: 615f 5f41 6374 696f 6e20 3c2f 7370 616e a__Action
    .
    │ │ │ +001292f0: 2f2f 6773 6f61 7020 6e73 2073 6572 7669 //gsoap ns servi │ │ │ +00129300: 6365 206d 6574 686f 642d 696e 7075 742d ce method-input- │ │ │ +00129310: 6865 6164 6572 2d70 6172 743a 2020 2020 header-part: │ │ │ +00129320: 6563 686f 5374 7269 6e67 2077 7361 5f5f echoString wsa__ │ │ │ +00129330: 5265 706c 7954 6f20 3c2f 7370 616e 3e3c ReplyTo < │ │ │ +00129340: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    // │ │ │ +00129370: 6773 6f61 7020 6e73 2073 6572 7669 6365 gsoap ns service │ │ │ +00129380: 206d 6574 686f 642d 6f75 7470 7574 2d68 method-output-h │ │ │ +00129390: 6561 6465 722d 7061 7274 3a20 2020 6563 eader-part: ec │ │ │ +001293a0: 686f 5374 7269 6e67 2077 7361 5f5f 5265 hoString wsa__Re │ │ │ +001293b0: 6c61 7465 7354 6f20 3c2f 7370 616e 3e3c latesTo < │ │ │ +001293c0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    int ns_ │ │ │ +00129400: 5f65 6368 6f53 7472 696e 6728 3c73 7061 _echoString(char *str, char ** │ │ │ +00129460: 7265 7329 3b3c 2f64 6976 3e0a 3c2f 6469 res);
    .

    For the co │ │ │ +00129490: 6e74 656e 7420 7265 7175 6972 656d 656e ntent requiremen │ │ │ +001294a0: 7473 206f 6620 7468 6573 6520 656c 656d ts of these elem │ │ │ +001294b0: 656e 7473 2c20 706c 6561 7365 2063 6f6e ents, please con │ │ │ +001294c0: 7375 6c74 2074 6865 2053 4f41 502d 6f76 sult the SOAP-ov │ │ │ +001294d0: 6572 2d55 4450 2073 7065 6369 6669 6361 er-UDP specifica │ │ │ +001294e0: 7469 6f6e 2061 6e64 2f6f 7220 7265 6164 tion and/or read │ │ │ +001294f0: 2074 6865 206e 6578 7420 7365 6374 696f the next sectio │ │ │ +00129500: 6e73 2065 7870 6c61 696e 696e 6720 534f ns explaining SO │ │ │ +00129510: 4150 2d6f 7665 722d 5544 5020 756e 6963 AP-over-UDP unic │ │ │ +00129520: 6173 742c 206d 756c 7469 6361 7374 2c20 ast, multicast, │ │ │ +00129530: 6f6e 652d 7761 792c 2061 6e64 2072 6571 one-way, and req │ │ │ +00129540: 7565 7374 2d72 6573 706f 6e73 6520 636c uest-response cl │ │ │ +00129550: 6965 6e74 2061 6e64 2073 6572 7665 7220 ient and server │ │ │ +00129560: 6170 706c 6963 6174 696f 6e73 2e3c 2f70 applications.

    .

    .... Back to ta │ │ │ +00129590: 626c 6520 6f66 2063 6f6e 7465 6e74 733c ble of contents< │ │ │ +001295a0: 2f61 3e3c 2f70 3e0a 3c68 333e 3c61 2063 /a>

    .

    . │ │ │ +001295d0: 436c 6965 6e74 2d73 6964 6520 6f6e 652d Client-side one- │ │ │ +001295e0: 7761 7920 5544 5020 756e 6963 6173 743c way UDP unicast< │ │ │ +001295f0: 2f68 333e 0a3c 703e 5468 6973 2065 7861 /h3>.

    This exa │ │ │ +00129600: 6d70 6c65 2061 7373 756d 6573 2074 6861 mple assumes tha │ │ │ +00129610: 7420 7468 6520 696e 7465 7266 6163 6520 t the interface │ │ │ +00129620: 6865 6164 6572 2066 696c 6520 696e 636c header file incl │ │ │ +00129630: 7564 6573 2074 6865 2053 4f41 5020 4865 udes the SOAP He │ │ │ +00129640: 6164 6572 2077 6974 6820 5753 2d41 6464 ader with WS-Add │ │ │ +00129650: 7265 7373 696e 6720 656c 656d 656e 7473 ressing elements │ │ │ +00129660: 2c20 7365 6520 3c61 2063 6c61 7373 3d22 , see │ │ │ +00129690: 5468 6520 5753 2d41 6464 7265 7373 696e The WS-Addressin │ │ │ +001296a0: 6720 706c 7567 696e 3c2f 613e 2c20 616e g plugin, an │ │ │ +001296b0: 6420 7468 6520 3c63 6f64 653e 6e73 5f5f d the ns__ │ │ │ +001296c0: 7365 6e64 5374 7269 6e67 3c2f 636f 6465 sendString function discu │ │ │ +001296e0: 7373 6564 2069 6e20 5365 6374 696f 6e20 ssed in Section │ │ │ +001296f0: 3c61 2063 6c61 7373 3d22 656c 2220 6872 Using WS- │ │ │ +00129720: 4164 6472 6573 7369 6e67 2077 6974 6820 Addressing with │ │ │ +00129730: 534f 4150 2d6f 7665 722d 5544 503c 2f61 SOAP-over-UDP.

    .
    < │ │ │ +00129770: 7370 616e 2063 6c61 7373 3d22 7072 6570 span class="prep │ │ │ +00129780: 726f 6365 7373 6f72 223e 2369 6e63 6c75 rocessor">#inclu │ │ │ +00129790: 6465 2026 7175 6f74 3b70 6c75 6769 6e2f de "plugin/ │ │ │ +001297a0: 7773 6161 7069 2e68 2671 756f 743b 3c2f wsaapi.h"
    .
    < │ │ │ +001297d0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    st │ │ │ +00129800: 7275 6374 203c 2f73 7061 6e3e 3c61 2063 ruct soap soap; .
    soap_ │ │ │ +001298e0: 696e 6974 3c2f 613e 2826 616d 703b 3c61 init(&soap); │ │ │ +00129920: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    ..< │ │ │ +00129a00: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +00129a10: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ +00129a20: 6874 6d6c 223e 736f 6170 3c2f 613e 2e3c html">soap.< │ │ │ +00129a30: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +00129a40: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ +00129a50: 6874 6d6c 2361 3731 3162 6233 6135 3364 html#a711bb3a53d │ │ │ +00129a60: 6537 6363 3632 3432 3965 3464 3361 3265 e7cc62429e4d3a2e │ │ │ +00129a70: 3062 3534 3734 223e 7365 6e64 5f74 696d 0b5474">send_tim │ │ │ +00129a80: 656f 7574 3c2f 613e 203d 2035 3b20 3c73 eout = 5; // 5 seconds │ │ │ +00129ab0: 206d 6178 2073 6f63 6b65 7420 6465 6c61 max socket dela │ │ │ +00129ac0: 7920 3c2f 7370 616e 3e3c 2f64 6976 3e0a y
    . │ │ │ +00129ad0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    // set u │ │ │ +00129b00: 7020 5753 2d41 6464 7265 7373 696e 6720 p WS-Addressing │ │ │ +00129b10: 6865 6164 6572 3c2f 7370 616e 3e3c 2f64 header.
    soap_wsa_r │ │ │ +00129b40: 6571 7565 7374 2826 616d 703b 3c61 2063 equest(&soap, "m │ │ │ +00129ba0: 6573 7361 6765 2049 4426 7175 6f74 3b3c essage ID"< │ │ │ +00129bb0: 2f73 7061 6e3e 2c20 3c73 7061 6e20 636c /span>, "endpoi │ │ │ +00129be0: 6e74 2671 756f 743b 3c2f 7370 616e 3e2c nt", │ │ │ +00129bf0: 203c 7370 616e 2063 6c61 7373 3d22 7374 &qu │ │ │ +00129c10: 6f74 3b53 4f41 5020 6163 7469 6f6e 2671 ot;SOAP action&q │ │ │ +00129c20: 756f 743b 3c2f 7370 616e 3e29 3b3c 2f64 uot;);.
    // S │ │ │ +00129c60: 656e 6420 7468 6520 6d65 7373 6167 6520 end the message │ │ │ +00129c70: 6f76 6572 2055 4450 3a20 3c2f 7370 616e over UDP:
    .
    if (s │ │ │ +00129cc0: 6f61 705f 7365 6e64 5f6e 735f 5f65 6368 oap_send_ns__ech │ │ │ +00129cd0: 6f53 7472 696e 6728 2661 6d70 3b3c 6120 oString(&soap, " │ │ │ +00129d30: 736f 6170 2e75 6470 3a2f 2f65 6e64 706f soap.udp://endpo │ │ │ +00129d40: 696e 7426 7175 6f74 3b3c 2f73 7061 6e3e int" │ │ │ +00129d50: 2c20 3c73 7061 6e20 636c 6173 733d 2273 , &q │ │ │ +00129d70: 756f 743b 534f 4150 2061 6374 696f 6e26 uot;SOAP action& │ │ │ +00129d80: 7175 6f74 3b3c 2f73 7061 6e3e 2c20 3c73 quot;, " │ │ │ +00129db0: 6865 6c6c 6f20 776f 726c 6421 2671 756f hello world!&quo │ │ │ +00129dc0: 743b 3c2f 7370 616e 3e29 2920 3c2f 6469 t;)) ... │ │ │ +00129f70: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65 │ │ │ +0012a020: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    soap_don │ │ │ +0012a090: 653c 2f61 3e28 2661 6d70 3b3c 6120 636c e(&soap);.
    │ │ │ +0012a1a0: 3c64 6976 2063 6c61 7373 3d22 7474 6465
    int soap_reg │ │ │ +0012a1c0: 6973 7465 725f 706c 7567 696e 2873 7472 ister_plugin(str │ │ │ +0012a1d0: 7563 7420 736f 6170 202a 736f 6170 2c20 uct soap *soap, │ │ │ +0012a1e0: 696e 7428 2a66 6372 6561 7465 2928 7374 int(*fcreate)(st │ │ │ +0012a1f0: 7275 6374 2073 6f61 7020 2a2c 2073 7472 ruct soap *, str │ │ │ +0012a200: 7563 7420 736f 6170 5f70 6c75 6769 6e20 uct soap_plugin │ │ │ +0012a210: 2a2c 2076 6f69 6420 2a29 293c 2f64 6976 *, void *))
    Register a p │ │ │ +0012a240: 6c75 6769 6e2e 3c2f 6469 763e 3c2f 6469 lugin.
    .

    ... │ │ │ +0012a270: 9d20 3c61 2068 7265 663d 2223 223e 4261 . Ba │ │ │ +0012a280: 636b 2074 6f20 7461 626c 6520 6f66 2063 ck to table of c │ │ │ +0012a290: 6f6e 7465 6e74 733c 2f61 3e3c 2f70 3e0a ontents

    . │ │ │ +0012a2a0: 3c68 333e 3c61 2063 6c61 7373 3d22 616e

    .Client │ │ │ +0012a2d0: 2d73 6964 6520 6f6e 652d 7761 7920 5544 -side one-way UD │ │ │ +0012a2e0: 5020 6d75 6c74 6963 6173 743c 2f68 333e P multicast

    │ │ │ +0012a2f0: 0a3c 703e 5468 6973 2065 7861 6d70 6c65 .

    This example │ │ │ +0012a300: 2069 7320 7369 6d69 6c61 7220 746f 2074 is similar to t │ │ │ +0012a310: 6865 206f 6e65 2d77 6179 2075 6e69 6361 he one-way unica │ │ │ +0012a320: 7374 2065 7861 6d70 6c65 2064 6973 6375 st example discu │ │ │ +0012a330: 7373 6564 2061 626f 7665 2c20 6275 7420 ssed above, but │ │ │ +0012a340: 7573 6573 2061 2062 726f 6164 6361 7374 uses a broadcast │ │ │ +0012a350: 2061 6464 7265 7373 2061 6e64 2074 6865 address and the │ │ │ +0012a360: 203c 636f 6465 3e53 4f5f 4252 4f41 4443 SO_BROADC │ │ │ +0012a370: 4153 543c 2f63 6f64 653e 2073 6f63 6b65 AST socke │ │ │ +0012a380: 7420 6f70 7469 6f6e 3a3c 2f70 3e0a 3c64 t option:

    .
    #include " │ │ │ +0012a3e0: 706c 7567 696e 2f77 7361 6170 692e 6826 plugin/wsaapi.h& │ │ │ +0012a3f0: 7175 6f74 3b3c 2f73 7061 6e3e 3c2f 6469 quot;.
    .< │ │ │ +0012a430: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +0012a440: 6f72 6422 3e73 7472 7563 7420 3c2f 7370 ord">struct soap soap;
    .
    in_ │ │ │ +0012a4d0: 6164 6472 5f74 2061 6464 7220 3d20 696e addr_t addr = in │ │ │ +0012a4e0: 6574 5f61 6464 7228 3c73 7061 6e20 636c et_addr("1.2.3. │ │ │ +0012a510: 3426 7175 6f74 3b3c 2f73 7061 6e3e 293b 4"); │ │ │ +0012a520: 203c 7370 616e 2063 6c61 7373 3d22 636f // option │ │ │ +0012a540: 616c 203c 2f73 7061 6e3e 3c2f 6469 763e al
    │ │ │ +0012a550: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    soap_ini │ │ │ +0012a5c0: 743c 2f61 3e28 2661 6d70 3b3c 6120 636c t(&soap); ..
    soap.send_timeou │ │ │ +0012a760: 743c 2f61 3e20 3d20 353b 203c 7370 616e t = 5; // 5 seconds ma │ │ │ +0012a790: 7820 736f 636b 6574 2064 656c 6179 3c2f x socket delay
    .
    soap.connect_f │ │ │ +0012a840: 6c61 6773 3c2f 613e 203d 2053 4f5f 4252 lags = SO_BR │ │ │ +0012a850: 4f41 4443 4153 543b 203c 7370 616e 2063 OADCAST; / │ │ │ +0012a870: 2f20 7265 7175 6972 6564 2066 6f72 2062 / required for b │ │ │ +0012a880: 726f 6164 6361 7374 203c 2f73 7061 6e3e roadcast │ │ │ +0012a890: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    │ │ │ +0012a8d0: 736f 6170 3c2f 613e 2e3c 6120 636c 6173 soap.ipv4_multicast │ │ │ +0012a930: 5f69 663c 2f61 3e20 3d20 2661 6d70 3b61 _if = &a │ │ │ +0012a940: 6464 723b 203c 7370 616e 2063 6c61 7373 ddr; // op │ │ │ +0012a960: 7469 6f6e 616c 2066 6f72 2049 5076 343a tional for IPv4: │ │ │ +0012a970: 2073 6565 2073 6574 736f 636b 6f70 7420 see setsockopt │ │ │ +0012a980: 4950 5052 4f54 4f5f 4950 2049 505f 4d55 IPPROTO_IP IP_MU │ │ │ +0012a990: 4c54 4943 4153 545f 4946 203c 2f73 7061 LTICAST_IF
    .
    soap.ipv6_multica │ │ │ +0012aa40: 7374 5f69 663c 2f61 3e20 3d20 6164 6472 st_if = addr │ │ │ +0012aa50: 3b20 3c73 7061 6e20 636c 6173 733d 2263 ; // optio │ │ │ +0012aa70: 6e61 6c20 666f 7220 4950 7636 3a20 6d75 nal for IPv6: mu │ │ │ +0012aa80: 6c74 6963 6173 7420 7369 6e36 5f73 636f lticast sin6_sco │ │ │ +0012aa90: 7065 5f69 6420 3c2f 7370 616e 3e3c 2f64 pe_id .
    soa │ │ │ +0012aae0: 703c 2f61 3e2e 3c61 2063 6c61 7373 3d22 p.i │ │ │ +0012ab30: 7076 345f 6d75 6c74 6963 6173 745f 7474 pv4_multicast_tt │ │ │ +0012ab40: 6c3c 2f61 3e20 3d20 313b 203c 7370 616e l = 1; // optional, se │ │ │ +0012ab70: 6520 7365 7473 6f63 6b6f 7074 2049 5050 e setsockopt IPP │ │ │ +0012ab80: 524f 544f 5f49 502c 2049 505f 4d55 4c54 ROTO_IP, IP_MULT │ │ │ +0012ab90: 4943 4153 545f 5454 4c20 3c2f 7370 616e ICAST_TTL
    .
    │ │ │ +0012abd0: 2f2f 2073 6574 2075 7020 5753 2d41 6464 // set up WS-Add │ │ │ +0012abe0: 7265 7373 696e 6720 6865 6164 6572 3c2f ressing header
    ..
    // Send the │ │ │ +0012ad40: 6d65 7373 6167 6520 6f76 6572 2055 4450 message over UDP │ │ │ +0012ad50: 2074 6f20 6120 6272 6f61 6463 6173 7420 to a broadcast │ │ │ +0012ad60: 6164 6472 6573 733a 203c 2f73 7061 6e3e address: │ │ │ +0012ad70: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    if (so │ │ │ +0012adb0: 6170 5f73 656e 645f 6e73 5f5f 6563 686f ap_send_ns__echo │ │ │ +0012adc0: 5374 7269 6e67 2826 616d 703b 3c61 2063 String(&soap, "s │ │ │ +0012ae20: 6f61 702e 7564 703a 2f2f 656e 6470 6f69 oap.udp://endpoi │ │ │ +0012ae30: 6e74 2671 756f 743b 3c2f 7370 616e 3e2c nt", │ │ │ +0012ae40: 203c 7370 616e 2063 6c61 7373 3d22 7374 &qu │ │ │ +0012ae60: 6f74 3b53 4f41 5020 6163 7469 6f6e 2671 ot;SOAP action&q │ │ │ +0012ae70: 756f 743b 3c2f 7370 616e 3e2c 203c 7370 uot;, "h │ │ │ +0012aea0: 656c 6c6f 2077 6f72 6c64 2126 7175 6f74 ello world!" │ │ │ +0012aeb0: 3b3c 2f73 7061 6e3e 2929 203c 2f64 6976 ;))
    . │ │ │ +0012afb0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    soap_des │ │ │ +0012b020: 7472 6f79 3c2f 613e 2826 616d 703b 3c61 troy(&soap);< │ │ │ +0012b060: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    soa │ │ │ +0012b0d0: 705f 656e 643c 2f61 3e28 2661 6d70 3b3c p_end(&< │ │ │ +0012b0e0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +0012b0f0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ +0012b100: 6874 6d6c 223e 736f 6170 3c2f 613e 293b html">soap); │ │ │ +0012b110: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    so │ │ │ +0012b180: 6170 5f64 6f6e 653c 2f61 3e28 2661 6d70 ap_done(& │ │ │ +0012b190: 3b3c 6120 636c 6173 733d 2263 6f64 6522 ;soap │ │ │ +0012b1c0: 293b 3c2f 6469 763e 0a3c 6469 7620 636c );
    .
    soap::ipv6_mul │ │ │ +0012b270: 7469 6361 7374 5f69 663c 2f61 3e3c 2f64 ticast_if
    unsigned │ │ │ +0012b2a0: 696e 7420 6970 7636 5f6d 756c 7469 6361 int ipv6_multica │ │ │ +0012b2b0: 7374 5f69 663c 2f64 6976 3e3c 6469 7620 st_if
    Us │ │ │ +0012b2d0: 6572 2d64 6566 696e 6162 6c65 2076 616c er-definable val │ │ │ +0012b2e0: 7565 2074 6f20 7365 7420 736f 636b 6164 ue to set sockad │ │ │ +0012b2f0: 6472 5f69 6e36 3a3a 7369 6e36 5f73 636f dr_in6::sin6_sco │ │ │ +0012b300: 7065 5f69 6420 7768 656e 206e 6f6e 7a65 pe_id when nonze │ │ │ +0012b310: 726f 2e3c 2f64 6976 3e3c 6469 7620 636c ro.
    D │ │ │ +0012b330: 6566 696e 6974 696f 6e3a 3c2f 623e 2073 efinition: s │ │ │ +0012b340: 7464 736f 6170 322e 683a 3335 3932 3c2f tdsoap2.h:3592
    .
    int connect │ │ │ +0012b430: 5f66 6c61 6773 3c2f 6469 763e 3c64 6976 _flags
    U │ │ │ +0012b450: 7365 722d 6465 6669 6e61 626c 6520 7365 ser-definable se │ │ │ +0012b460: 7473 6f63 6b6f 7074 206c 6576 656c 2053 tsockopt level S │ │ │ +0012b470: 4f4c 5f53 4f43 4b45 5420 666c 6167 7320 OL_SOCKET flags │ │ │ +0012b480: 7768 656e 2063 6f6e 6e65 6374 696e 6720 when connecting │ │ │ +0012b490: 736f 6170 3a3a 736f 636b 6574 2074 6f20 soap::socket to │ │ │ +0012b4a0: 6120 7365 7276 6572 2028 7468 6520 7661 a server (the va │ │ │ +0012b4b0: 6c75 6520 2e2e 2e3c 2f64 6976 3e3c 6469 lue ...
    │ │ │ +0012b4d0: 3c62 3e44 6566 696e 6974 696f 6e3a 3c2f Definition: stdsoap2.h:33 │ │ │ +0012b4f0: 3737 3c2f 6469 763e 3c2f 6469 763e 0a3c 77
    .< │ │ │ +0012b500: 6469 7620 636c 6173 733d 2274 7463 2220 div class="ttc" │ │ │ +0012b510: 6964 3d22 6173 7472 7563 7473 6f61 705f id="astructsoap_ │ │ │ +0012b520: 6874 6d6c 5f61 6135 6661 6137 3633 3034 html_aa5faa76304 │ │ │ +0012b530: 3235 6138 6162 3830 3138 6630 6232 6434 25a8ab8018f0b2d4 │ │ │ +0012b540: 6430 6331 3864 223e 3c64 6976 2063 6c61 d0c18d">
    un │ │ │ +0012b5d0: 7369 676e 6564 2063 6861 7220 6970 7634 signed char ipv4 │ │ │ +0012b5e0: 5f6d 756c 7469 6361 7374 5f74 746c 3c2f _multicast_ttl
    User-defi │ │ │ +0012b610: 6e61 626c 6520 7661 6c75 6520 746f 2073 nable value to s │ │ │ +0012b620: 6574 2073 6574 736f 636b 6f70 7420 6c65 et setsockopt le │ │ │ +0012b630: 7665 6c20 4950 5052 4f54 4f5f 4950 2074 vel IPPROTO_IP t │ │ │ +0012b640: 6f20 4950 5f4d 554c 5449 4341 5354 5f54 o IP_MULTICAST_T │ │ │ +0012b650: 544c 2077 6865 6e20 6e6f 6e7a 6572 6f2e TL when nonzero. │ │ │ +0012b660: 3c2f 6469 763e 3c64 6976 2063 6c61 7373
    Defi │ │ │ +0012b680: 6e69 7469 6f6e 3a3c 2f62 3e20 7374 6473 nition: stds │ │ │ +0012b690: 6f61 7032 2e68 3a33 3632 303c 2f64 6976 oap2.h:3620
    .
    soap::ipv4_mult │ │ │ +0012b750: 6963 6173 745f 6966 3c2f 613e 3c2f 6469 icast_if
    char * ipv │ │ │ +0012b780: 345f 6d75 6c74 6963 6173 745f 6966 3c2f 4_multicast_if
    User-defi │ │ │ +0012b7b0: 6e61 626c 6520 7661 6c75 6520 746f 2073 nable value to s │ │ │ +0012b7c0: 6574 2073 6574 736f 636b 6f70 7420 6c65 et setsockopt le │ │ │ +0012b7d0: 7665 6c20 4950 5052 4f54 4f5f 4950 2074 vel IPPROTO_IP t │ │ │ +0012b7e0: 6f20 4950 5f4d 554c 5449 4341 5354 5f49 o IP_MULTICAST_I │ │ │ +0012b7f0: 4620 7768 656e 206e 6f6e 2d4e 554c 4c2e F when non-NULL. │ │ │ +0012b800: 3c2f 6469 763e 3c64 6976 2063 6c61 7373
    Defi │ │ │ +0012b820: 6e69 7469 6f6e 3a3c 2f62 3e20 7374 6473 nition: stds │ │ │ +0012b830: 6f61 7032 2e68 3a33 3539 393c 2f64 6976 oap2.h:3599
    .
    < │ │ │ +0012b860: 703e 506c 6561 7365 2072 6566 6572 2074 p>Please refer t │ │ │ +0012b870: 6f20 7468 6520 736f 636b 6574 206f 7074 o the socket opt │ │ │ +0012b880: 696f 6e73 2066 6f72 203c 636f 6465 3e49 ions for I │ │ │ +0012b890: 5050 524f 544f 5f49 503c 2f63 6f64 653e PPROTO_IP │ │ │ +0012b8a0: 203c 636f 6465 3e49 505f 4d55 4c54 4943 IP_MULTIC │ │ │ +0012b8b0: 4153 545f 4946 3c2f 636f 6465 3e20 746f AST_IF to │ │ │ +0012b8c0: 2073 7065 6369 6679 2074 6865 2064 6566 specify the def │ │ │ +0012b8d0: 6175 6c74 2069 6e74 6572 6661 6365 2066 ault interface f │ │ │ +0012b8e0: 6f72 206d 756c 7469 6361 7374 2064 6174 or multicast dat │ │ │ +0012b8f0: 6167 7261 6d73 2074 6f20 6265 2073 656e agrams to be sen │ │ │ +0012b900: 7420 6672 6f6d 2e20 5468 6973 2069 7320 t from. This is │ │ │ +0012b910: 6120 3c63 6f64 653e 7374 7275 6374 2069 a struct i │ │ │ +0012b920: 6e5f 6164 6472 3c2f 636f 6465 3e20 283c n_addr (< │ │ │ +0012b930: 636f 6465 3e69 6e5f 6164 6472 5f74 3c2f code>in_addr_t for │ │ │ +0012b950: 7369 6e36 5f73 636f 7065 5f69 643c 2f63 sin6_scope_id) interface │ │ │ +0012b970: 7661 6c75 652e 204f 7468 6572 7769 7365 value. Otherwise │ │ │ +0012b980: 2c20 7468 6520 6465 6661 756c 7420 696e , the default in │ │ │ +0012b990: 7465 7266 6163 6520 7365 7420 6279 2074 terface set by t │ │ │ +0012b9a0: 6865 2073 7973 7465 6d20 6164 6d69 6e69 he system admini │ │ │ +0012b9b0: 7374 7261 746f 7220 7769 6c6c 2062 6520 strator will be │ │ │ +0012b9c0: 7573 6564 2028 6966 2061 6e79 292e 3c2f used (if any)..

    Please ref │ │ │ +0012b9e0: 6572 2074 6f20 7468 6520 736f 636b 6574 er to the socket │ │ │ +0012b9f0: 206f 7074 696f 6e73 2066 6f72 203c 636f options for IPPROTO_IP IP_MU │ │ │ +0012ba20: 4c54 4943 4153 545f 5454 4c3c 2f63 6f64 LTICAST_TTL to limit the │ │ │ +0012ba40: 6c69 6665 7469 6d65 206f 6620 7468 6520 lifetime of the │ │ │ +0012ba50: 7061 636b 6574 2e20 4d75 6c74 6963 6173 packet. Multicas │ │ │ +0012ba60: 7420 6461 7461 6772 616d 7320 6172 6520 t datagrams are │ │ │ +0012ba70: 7365 6e74 2077 6974 6820 6120 6465 6661 sent with a defa │ │ │ +0012ba80: 756c 7420 7661 6c75 6520 6f66 2031 2c20 ult value of 1, │ │ │ +0012ba90: 746f 2070 7265 7665 6e74 2074 6865 6d20 to prevent them │ │ │ +0012baa0: 746f 2062 6520 666f 7277 6172 6465 6420 to be forwarded │ │ │ +0012bab0: 6265 796f 6e64 2074 6865 206c 6f63 616c beyond the local │ │ │ +0012bac0: 206e 6574 776f 726b 2e20 5468 6973 2070 network. This p │ │ │ +0012bad0: 6172 616d 6574 6572 2063 616e 2062 6520 arameter can be │ │ │ +0012bae0: 7365 7420 6265 7477 6565 6e20 3120 746f set between 1 to │ │ │ +0012baf0: 2032 3535 2e3c 2f70 3e0a 3c70 3ef0 9f94 255.

    .

    ... │ │ │ +0012bb00: 9d20 3c61 2068 7265 663d 2223 223e 4261 . Ba │ │ │ +0012bb10: 636b 2074 6f20 7461 626c 6520 6f66 2063 ck to table of c │ │ │ +0012bb20: 6f6e 7465 6e74 733c 2f61 3e3c 2f70 3e0a ontents

    . │ │ │ +0012bb30: 3c68 333e 3c61 2063 6c61 7373 3d22 616e

    .Client-si │ │ │ +0012bb70: 6465 2072 6571 7565 7374 2d72 6573 706f de request-respo │ │ │ +0012bb80: 6e73 6520 5544 5020 756e 6963 6173 743c nse UDP unicast< │ │ │ +0012bb90: 2f68 333e 0a3c 703e 5468 6973 2065 7861 /h3>.

    This exa │ │ │ +0012bba0: 6d70 6c65 2061 7373 756d 6573 2074 6861 mple assumes tha │ │ │ +0012bbb0: 7420 7468 6520 696e 7465 7266 6163 6520 t the interface │ │ │ +0012bbc0: 6865 6164 6572 2066 696c 6520 666f 7220 header file for │ │ │ +0012bbd0: 736f 6170 6370 7032 2069 6e63 6c75 6465 soapcpp2 include │ │ │ +0012bbe0: 7320 7468 6520 534f 4150 2048 6561 6465 s the SOAP Heade │ │ │ +0012bbf0: 7220 7769 7468 2057 532d 4164 6472 6573 r with WS-Addres │ │ │ +0012bc00: 7369 6e67 2065 6c65 6d65 6e74 7320 696d sing elements im │ │ │ +0012bc10: 706f 7274 6564 2077 6974 6820 3c63 6f64 ported with #import "wsa.h │ │ │ +0012bc30: 223c 2f63 6f64 653e 2061 6e64 2074 6865 " and the │ │ │ +0012bc40: 203c 636f 6465 3e6e 735f 5f65 6368 6f53 ns__echoS │ │ │ +0012bc50: 7472 696e 673c 2f63 6f64 653e 2066 756e tring fun │ │ │ +0012bc60: 6374 696f 6e20 6469 7363 7573 7365 6420 ction discussed │ │ │ +0012bc70: 696e 2053 6563 7469 6f6e 203c 6120 636c in Section Using WS-Addre │ │ │ +0012bcb0: 7373 696e 6720 7769 7468 2053 4f41 502d ssing with SOAP- │ │ │ +0012bcc0: 6f76 6572 2d55 4450 3c2f 613e 202e 3c2f over-UDP ..

    #include & │ │ │ +0012bd20: 7175 6f74 3b70 6c75 6769 6e2f 7773 6161 quot;plugin/wsaa │ │ │ +0012bd30: 7069 2e68 2671 756f 743b 3c2f 7370 616e pi.h"
    .
    .. │ │ │ +0012be00: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    struct < │ │ │ +0012be30: 2f73 7061 6e3e 7773 615f 5f45 6e64 706f /span>wsa__Endpo │ │ │ +0012be40: 696e 7452 6566 6572 656e 6365 5479 7065 intReferenceType │ │ │ +0012be50: 2072 6570 6c79 546f 3b20 3c73 7061 6e20 replyTo; │ │ │ +0012be70: 2f2f 2028 616e 6f6e 796d 6f75 7329 2072 // (anonymous) r │ │ │ +0012be80: 6570 6c79 2061 6464 7265 7373 203c 2f73 eply address
    .
    char *res; / │ │ │ +0012bef0: 2f20 7365 7276 6572 2072 6573 706f 6e73 / server respons │ │ │ +0012bf00: 6520 3c2f 7370 616e 3e3c 2f64 6976 3e0a e
    . │ │ │ +0012bf10: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    soap_init │ │ │ +0012bf80: 3c2f 613e 2826 616d 703b 3c61 2063 6c61 (&soap); ..
    soap.send_timeout │ │ │ +0012c120: 3c2f 613e 203d 2035 3b20 3c73 7061 6e20 = 5; │ │ │ +0012c140: 2f2f 2035 2073 6563 6f6e 6473 206d 6178 // 5 seconds max │ │ │ +0012c150: 2073 6f63 6b65 7420 6465 6c61 7920 3c2f socket delay
    .
    soap.recv_time │ │ │ +0012c200: 6f75 743c 2f61 3e20 3d20 353b 203c 7370 out = 5; // 5 seconds │ │ │ +0012c230: 6d61 7820 736f 636b 6574 2064 656c 6179 max socket delay │ │ │ +0012c240: 203c 2f73 7061 6e3e 3c2f 6469 763e 0a3c
    .< │ │ │ +0012c250: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +0012c260: 3e3c 7370 616e 2063 6c61 7373 3d22 636f >// set up │ │ │ +0012c280: 2057 532d 4164 6472 6573 7369 6e67 2068 WS-Addressing h │ │ │ +0012c290: 6561 6465 723c 2f73 7061 6e3e 3c2f 6469 eader.
    soap_wsa_re │ │ │ +0012c2c0: 7175 6573 7428 2661 6d70 3b3c 6120 636c quest(&soap, "me │ │ │ +0012c320: 7373 6167 6520 4944 2671 756f 743b 3c2f ssage ID", "endpoin │ │ │ +0012c360: 7426 7175 6f74 3b3c 2f73 7061 6e3e 2c20 t", │ │ │ +0012c370: 3c73 7061 6e20 636c 6173 733d 2273 7472 &quo │ │ │ +0012c390: 743b 534f 4150 2061 6374 696f 6e26 7175 t;SOAP action&qu │ │ │ +0012c3a0: 6f74 3b3c 2f73 7061 6e3e 293b 3c2f 6469 ot;);.
    soap_wsa_ad │ │ │ +0012c3d0: 645f 5265 706c 7954 6f28 2661 6d70 3b3c d_ReplyTo(&< │ │ │ +0012c3e0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +0012c3f0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ +0012c400: 6874 6d6c 223e 736f 6170 3c2f 613e 2c20 html">soap, │ │ │ +0012c410: 4e55 4c4c 293b 203c 7370 616e 2063 6c61 NULL); // │ │ │ +0012c430: 616e 6f6e 796d 6f75 7320 5265 706c 7954 anonymous ReplyT │ │ │ +0012c440: 6f20 6164 6472 6573 733c 2f73 7061 6e3e o address │ │ │ +0012c450: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    / │ │ │ +0012c480: 2f20 5365 6e64 2061 6e64 2072 6563 6569 / Send and recei │ │ │ +0012c490: 7665 206d 6573 7361 6765 7320 6f76 6572 ve messages over │ │ │ +0012c4a0: 2055 4450 3a20 3c2f 7370 616e 3e3c 2f64 UDP: .
    │ │ │ +0012c4e0: 6966 3c2f 7370 616e 3e20 2873 6f61 705f if (soap_ │ │ │ +0012c4f0: 6361 6c6c 5f6e 735f 5f65 6368 6f53 7472 call_ns__echoStr │ │ │ +0012c500: 696e 6728 2661 6d70 3b3c 6120 636c 6173 ing(& │ │ │ +0012c530: 736f 6170 3c2f 613e 2c20 3c73 7061 6e20 soap, "soap │ │ │ +0012c560: 2e75 6470 3a2f 2f65 6e64 706f 696e 7420 .udp://endpoint │ │ │ +0012c570: 2671 756f 743b 3c2f 7370 616e 3e53 4f41 "SOA │ │ │ +0012c580: 5020 6163 7469 6f6e 3c73 7061 6e20 636c P action", &quo │ │ │ +0012c5b0: 743b 3c2f 7370 616e 3e68 656c 6c6f 2077 t;hello w │ │ │ +0012c5c0: 6f72 6c64 213c 7370 616e 2063 6c61 7373 orld!", &re │ │ │ +0012c5f0: 7329 2920 3c2f 7370 616e 3e3c 2f64 6976 s))
    .
    │ │ │ +0012c630: 7b3c 2f73 7061 6e3e 3c2f 6469 763e 0a3c {
    .< │ │ │ +0012c640: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +0012c650: 3e3c 7370 616e 2063 6c61 7373 3d22 7374 > i │ │ │ +0012c670: 6620 2873 6f61 702e 6572 726f 7220 3d3d f (soap.error == │ │ │ +0012c680: 2053 4f41 505f 454f 4620 2661 6d70 3b26 SOAP_EOF && │ │ │ +0012c690: 616d 703b 2073 6f61 702e 6572 726e 756d amp; soap.errnum │ │ │ +0012c6a0: 203d 3d20 3029 203c 2f73 7061 6e3e 3c2f == 0) .
    ... // Ti │ │ │ +0012c6f0: 6d65 6f75 743a 206e 6f20 7265 7370 6f6e meout: no respon │ │ │ +0012c700: 7365 2066 726f 6d20 7365 7276 6572 2028 se from server ( │ │ │ +0012c710: 6d65 7373 6167 6520 616c 7265 6164 7920 message already │ │ │ +0012c720: 6465 6c69 7665 7265 643f 2920 3c2f 7370 delivered?)
    .
    else < │ │ │ +0012c770: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    .< │ │ │ +0012c790: 7370 616e 2063 6c61 7373 3d22 7374 7269 span class="stri │ │ │ +0012c7a0: 6e67 6c69 7465 7261 6c22 3e20 2020 2073 ngliteral"> s │ │ │ +0012c7b0: 6f61 705f 7072 696e 745f 6661 756c 7428 oap_print_fault( │ │ │ +0012c7c0: 2661 6d70 3b73 6f61 702c 2073 7464 6572 &soap, stder │ │ │ +0012c7d0: 7229 3b20 3c2f 7370 616e 3e3c 2f64 6976 r);
    .
    │ │ │ +0012c810: 7d20 3c2f 7370 616e 3e3c 2f64 6976 3e0a }
    . │ │ │ +0012c820: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    el │ │ │ +0012c850: 7365 203c 2f73 7061 6e3e 3c2f 6469 763e se
    │ │ │ +0012c860: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    │ │ │ +0012c890: 202e 2e2e 202f 2f20 5544 5020 7365 7276 ... // UDP serv │ │ │ +0012c8a0: 6572 2072 6573 706f 6e73 6520 6973 2073 er response is s │ │ │ +0012c8b0: 746f 7265 6420 696e 2026 2333 393b 7265 tored in 're │ │ │ +0012c8c0: 7326 2333 393b 203c 2f73 7061 6e3e 3c2f s' .
    // check SOAP │ │ │ +0012c910: 2068 6561 6465 7220 7265 6365 6976 6564 header received │ │ │ +0012c920: 2c20 6966 2061 7070 6c69 6361 626c 6520 , if applicable │ │ │ +0012c930: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ +0012c950: 3c73 7061 6e20 636c 6173 733d 2273 7472 chec │ │ │ +0012c970: 6b5f 6865 6164 6572 2826 616d 703b 736f k_header(&so │ │ │ +0012c980: 6170 2e68 6561 6465 7229 3b20 3c2f 7370 ap.header);
    .
    soap_des │ │ │ +0012c9d0: 7472 6f79 2826 616d 703b 736f 6170 293b troy(&soap); │ │ │ +0012c9e0: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ +0012ca00: 3c73 7061 6e20 636c 6173 733d 2273 7472 soap │ │ │ +0012ca20: 5f65 6e64 2826 616d 703b 736f 6170 293b _end(&soap); │ │ │ +0012ca30: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ +0012ca50: 3c73 7061 6e20 636c 6173 733d 2273 7472 soap │ │ │ +0012ca70: 5f64 6f6e 6528 2661 6d70 3b73 6f61 7029 _done(&soap) │ │ │ +0012ca80: 3b3c 2f73 7061 6e3e 3c2f 6469 763e 0a3c ;
    .< │ │ │ +0012ca90: 2f64 6976 3e3c 212d 2d20 6672 6167 6d65 /div>

    .... Back t │ │ │ +0012cac0: 6f20 7461 626c 6520 6f66 2063 6f6e 7465 o table of conte │ │ │ +0012cad0: 6e74 733c 2f61 3e3c 2f70 3e0a 3c68 333e nts

    .

    │ │ │ +0012cae0: 3c61 2063 6c61 7373 3d22 616e 6368 6f72 │ │ │ +0012cb10: 3c2f 613e 0a43 6c69 656e 742d 7369 6465 .Client-side │ │ │ +0012cb20: 2072 6571 7565 7374 2d72 6573 706f 6e73 request-respons │ │ │ +0012cb30: 6520 6d75 6c74 6963 6173 743c 2f68 333e e multicast

    │ │ │ +0012cb40: 0a3c 703e 5468 6973 2065 7861 6d70 6c65 .

    This example │ │ │ +0012cb50: 2069 7320 7369 6d69 6c61 7220 746f 2074 is similar to t │ │ │ +0012cb60: 6865 2072 6571 7565 7374 2d72 6573 706f he request-respo │ │ │ +0012cb70: 6e73 6520 756e 6963 6173 7420 6578 616d nse unicast exam │ │ │ +0012cb80: 706c 6520 6469 7363 7573 7365 6420 6162 ple discussed ab │ │ │ +0012cb90: 6f76 652c 2062 7574 2075 7365 7320 6120 ove, but uses a │ │ │ +0012cba0: 6272 6f61 6463 6173 7420 6164 6472 6573 broadcast addres │ │ │ +0012cbb0: 7320 616e 6420 7468 6520 3c63 6f64 653e s and the │ │ │ +0012cbc0: 534f 5f42 524f 4144 4341 5354 3c2f 636f SO_BROADCAST socket optio │ │ │ +0012cbe0: 6e2e 2042 6563 6175 7365 2077 6520 6578 n. Because we ex │ │ │ +0012cbf0: 7065 6374 2074 6f20 7265 6365 6976 6520 pect to receive │ │ │ +0012cc00: 6d75 6c74 6970 6c65 2072 6573 706f 6e73 multiple respons │ │ │ +0012cc10: 6573 2c20 7765 2061 6c73 6f20 6e65 6564 es, we also need │ │ │ +0012cc20: 2074 6f20 7573 6520 7365 7061 7261 7465 to use separate │ │ │ +0012cc30: 2072 6571 7565 7374 2d72 6573 706f 6e73 request-respons │ │ │ +0012cc40: 6520 6d65 7373 6167 6573 2074 6f20 7365 e messages to se │ │ │ +0012cc50: 6e64 206f 6e65 2072 6571 7565 7374 2061 nd one request a │ │ │ +0012cc60: 6e64 2063 6f6e 7375 6d65 206d 756c 7469 nd consume multi │ │ │ +0012cc70: 706c 6520 7265 7370 6f6e 7365 732e 2049 ple responses. I │ │ │ +0012cc80: 6e20 7468 6973 2065 7861 6d70 6c65 2077 n this example w │ │ │ +0012cc90: 6520 6465 6669 6e65 6420 6120 3c63 6f64 e defined a bcastString request and │ │ │ +0012ccc0: 2061 203c 636f 6465 3e62 6361 7374 5374 a bcastSt │ │ │ +0012ccd0: 7269 6e67 5265 7370 6f6e 7365 3c2f 636f ringResponse response mes │ │ │ +0012ccf0: 7361 6765 2c20 7768 6963 6820 6172 6520 sage, which are │ │ │ +0012cd00: 6573 7365 6e74 6961 6c6c 7920 6465 636c essentially decl │ │ │ +0012cd10: 6172 6564 2061 7320 6f6e 652d 7761 7920 ared as one-way │ │ │ +0012cd20: 6d65 7373 6167 6573 2069 6e20 7468 6520 messages in the │ │ │ +0012cd30: 6865 6164 6572 2066 696c 653a 3c2f 703e header file:

    │ │ │ +0012cd40: 0a3c 6469 7620 636c 6173 733d 2266 7261 .
    / │ │ │ +0012cd80: 2f67 736f 6170 206e 7320 7365 7276 6963 /gsoap ns servic │ │ │ +0012cd90: 6520 6d65 7468 6f64 2d68 6561 6465 722d e method-header- │ │ │ +0012cda0: 7061 7274 3a20 2020 2020 2020 2020 2062 part: b │ │ │ +0012cdb0: 6361 7374 5374 7269 6e67 2077 7361 5f5f castString wsa__ │ │ │ +0012cdc0: 4d65 7373 6167 6549 4420 3c2f 7370 616e MessageID
    .
    │ │ │ +0012ce00: 2f2f 6773 6f61 7020 6e73 2073 6572 7669 //gsoap ns servi │ │ │ +0012ce10: 6365 206d 6574 686f 642d 6865 6164 6572 ce method-header │ │ │ +0012ce20: 2d70 6172 743a 2020 2020 2020 2020 2020 -part: │ │ │ +0012ce30: 6263 6173 7453 7472 696e 6720 7773 615f bcastString wsa_ │ │ │ +0012ce40: 5f54 6f20 3c2f 7370 616e 3e3c 2f64 6976 _To
    .
    //gsoa │ │ │ +0012ce80: 7020 6e73 2073 6572 7669 6365 206d 6574 p ns service met │ │ │ +0012ce90: 686f 642d 6865 6164 6572 2d70 6172 743a hod-header-part: │ │ │ +0012cea0: 2020 2020 2020 2020 2020 6263 6173 7453 bcastS │ │ │ +0012ceb0: 7472 696e 6720 7773 615f 5f41 6374 696f tring wsa__Actio │ │ │ +0012cec0: 6e20 3c2f 7370 616e 3e3c 2f64 6976 3e0a n
    . │ │ │ +0012ced0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    //gsoap │ │ │ +0012cf00: 6e73 2073 6572 7669 6365 206d 6574 686f ns service metho │ │ │ +0012cf10: 642d 6865 6164 6572 2d70 6172 743a 2020 d-header-part: │ │ │ +0012cf20: 2020 2020 2020 2020 6263 6173 7453 7472 bcastStr │ │ │ +0012cf30: 696e 6720 7773 615f 5f52 6570 6c79 546f ing wsa__ReplyTo │ │ │ +0012cf40: 203c 2f73 7061 6e3e 3c2f 6469 763e 0a3c
    .< │ │ │ +0012cf50: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +0012cf60: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >int ns__bcastS │ │ │ +0012cf90: 7472 696e 6728 3c73 7061 6e20 636c 6173 tring( │ │ │ +0012cfb0: 6368 6172 3c2f 7370 616e 3e20 2a73 7472 char *str │ │ │ +0012cfc0: 2c20 3c73 7061 6e20 636c 6173 733d 226b , void │ │ │ +0012cfe0: 3c2f 7370 616e 3e29 3b20 3c2f 6469 763e );
    │ │ │ +0012cff0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    //gsoap │ │ │ +0012d020: 206e 7320 7365 7276 6963 6520 6d65 7468 ns service meth │ │ │ +0012d030: 6f64 2d68 6561 6465 722d 7061 7274 3a20 od-header-part: │ │ │ +0012d040: 2020 2020 2020 2020 2062 6361 7374 5374 bcastSt │ │ │ +0012d050: 7269 6e67 5265 7370 6f6e 7365 2077 7361 ringResponse wsa │ │ │ +0012d060: 5f5f 4d65 7373 6167 6549 4420 3c2f 7370 __MessageID
    .
    //gsoap ns ser │ │ │ +0012d0b0: 7669 6365 206d 6574 686f 642d 6865 6164 vice method-head │ │ │ +0012d0c0: 6572 2d70 6172 743a 2020 2020 2020 2020 er-part: │ │ │ +0012d0d0: 2020 6263 6173 7453 7472 696e 6752 6573 bcastStringRes │ │ │ +0012d0e0: 706f 6e73 6520 7773 615f 5f54 6f20 3c2f ponse wsa__To
    .
    //gsoap ns s │ │ │ +0012d130: 6572 7669 6365 206d 6574 686f 642d 6865 ervice method-he │ │ │ +0012d140: 6164 6572 2d70 6172 743a 2020 2020 2020 ader-part: │ │ │ +0012d150: 2020 2020 6263 6173 7453 7472 696e 6752 bcastStringR │ │ │ +0012d160: 6573 706f 6e73 6520 7773 615f 5f41 6374 esponse wsa__Act │ │ │ +0012d170: 696f 6e20 3c2f 7370 616e 3e3c 2f64 6976 ion
    .
    //gsoa │ │ │ +0012d1b0: 7020 6e73 2073 6572 7669 6365 206d 6574 p ns service met │ │ │ +0012d1c0: 686f 642d 6865 6164 6572 2d70 6172 743a hod-header-part: │ │ │ +0012d1d0: 2020 2020 2020 2020 2020 6263 6173 7453 bcastS │ │ │ +0012d1e0: 7472 696e 6752 6573 706f 6e73 6520 7773 tringResponse ws │ │ │ +0012d1f0: 615f 5f52 656c 6174 6573 546f 203c 2f73 a__RelatesTo
    .
    int ns__bcastStrin │ │ │ +0012d250: 6752 6573 706f 6e73 6528 3c73 7061 6e20 gResponse(char │ │ │ +0012d280: 2a72 6573 2c20 3c73 7061 6e20 636c 6173 *res, │ │ │ +0012d2a0: 766f 6964 3c2f 7370 616e 3e29 3b3c 2f64 void);.

    To │ │ │ +0012d2d0: 206f 6274 6169 6e20 7265 7370 6f6e 7365 obtain response │ │ │ +0012d2e0: 206f 6e65 2d77 6179 206f 7065 7261 7469 one-way operati │ │ │ +0012d2f0: 6f6e 732c 2075 7365 203c 6120 6872 6566 ons, use │ │ │ +0012d310: 3c63 6f64 653e 7773 646c 3268 202d 623c wsdl2h -b< │ │ │ +0012d320: 2f63 6f64 653e 3c2f 623e 206f 7074 696f /code> optio │ │ │ +0012d330: 6e20 3c62 3e3c 636f 6465 3e2d 623c 2f63 n -b.

    .

    The client │ │ │ +0012d360: 636f 6465 2069 6e63 6c75 6465 7320 6120 code includes a │ │ │ +0012d370: 6c6f 6f70 2074 6f20 7265 6365 6976 6520 loop to receive │ │ │ +0012d380: 7265 7370 6f6e 7365 206d 6573 7361 6765 response message │ │ │ +0012d390: 7320 756e 7469 6c20 6120 7469 6d65 6f75 s until a timeou │ │ │ +0012d3a0: 7420 6f63 6375 7273 3a3c 2f70 3e0a 3c64 t occurs:

    .
    #include " │ │ │ +0012d400: 706c 7567 696e 2f77 7361 6170 692e 6826 plugin/wsaapi.h& │ │ │ +0012d410: 7175 6f74 3b3c 2f73 7061 6e3e 3c2f 6469 quot;.
    .< │ │ │ +0012d450: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +0012d460: 6f72 6422 3e73 7472 7563 7420 3c2f 7370 ord">struct soap soap;
    .
    struct S │ │ │ +0012d550: 4f41 505f 454e 565f 5f48 6561 6465 723c OAP_ENV__Header< │ │ │ +0012d560: 2f61 3e20 6865 6164 6572 3b20 3c2f 6469 /a> header; .
    struc │ │ │ +0012d5a0: 7420 3c2f 7370 616e 3e77 7361 5f5f 456e t wsa__En │ │ │ +0012d5b0: 6470 6f69 6e74 5265 6665 7265 6e63 6554 dpointReferenceT │ │ │ +0012d5c0: 7970 6520 7265 706c 7954 6f3b 203c 2f64 ype replyTo; .
    │ │ │ +0012d600: 6368 6172 3c2f 7370 616e 3e20 2a72 6573 char *res │ │ │ +0012d610: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
    .
    │ │ │ +0012d680: 736f 6170 5f69 6e69 743c 2f61 3e28 2661 soap_init(&a │ │ │ +0012d690: 6d70 3b3c 6120 636c 6173 733d 2263 6f64 mp;soap);
    .
    soap_register_ │ │ │ +0012d740: 706c 7567 696e 3c2f 613e 2826 616d 703b plugin(& │ │ │ +0012d750: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap, │ │ │ +0012d780: 2073 6f61 705f 7773 6129 3b3c 2f64 6976 soap_wsa);
    .
    soap< │ │ │ +0012d7d0: 2f61 3e2e 3c61 2063 6c61 7373 3d22 636f /a>.con │ │ │ +0012d820: 6e65 6374 5f66 6c61 6773 3c2f 613e 203d nect_flags = │ │ │ +0012d830: 2053 4f5f 4252 4f41 4443 4153 543b 203c SO_BROADCAST; < │ │ │ +0012d840: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    s │ │ │ +0012d880: 6f61 703c 2f61 3e2e 3c61 2063 6c61 7373 oap.send_timeout = 5; // │ │ │ +0012d900: 3520 7365 636f 6e64 7320 6d61 7820 736f 5 seconds max so │ │ │ +0012d910: 636b 6574 2064 656c 6179 203c 2f73 7061 cket delay
    .
    soap.recv_timeout │ │ │ +0012d9c0: 3c2f 613e 203d 2035 3b20 3c73 7061 6e20 = 5; │ │ │ +0012d9e0: 2f2f 2035 2073 6563 6f6e 6473 206d 6178 // 5 seconds max │ │ │ +0012d9f0: 2073 6f63 6b65 7420 6465 6c61 7920 3c2f socket delay
    .
    // set up WS │ │ │ +0012da40: 2d41 6464 7265 7373 696e 6720 6865 6164 -Addressing head │ │ │ +0012da50: 6572 3c2f 7370 616e 3e3c 2f64 6976 3e0a er
    . │ │ │ +0012da60: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    soap_wsa_reque │ │ │ +0012da80: 7374 2826 616d 703b 3c61 2063 6c61 7373 st(&s │ │ │ +0012dab0: 6f61 703c 2f61 3e2c 203c 7370 616e 2063 oap, "messa │ │ │ +0012dae0: 6765 2049 4426 7175 6f74 3b3c 2f73 7061 ge ID", │ │ │ +0012db10: 2671 756f 743b 656e 6470 6f69 6e74 2671 "endpoint&q │ │ │ +0012db20: 756f 743b 3c2f 7370 616e 3e2c 203c 7370 uot;, "S │ │ │ +0012db50: 4f41 5020 6163 7469 6f6e 2671 756f 743b OAP action" │ │ │ +0012db60: 3c2f 7370 616e 3e29 3b3c 2f64 6976 3e0a );
    . │ │ │ +0012db70: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    soap_wsa_add_R │ │ │ +0012db90: 6570 6c79 546f 2826 616d 703b 3c61 2063 eplyTo(&soap, NUL │ │ │ +0012dbd0: 4c29 3b20 3c73 7061 6e20 636c 6173 733d L); // ano │ │ │ +0012dbf0: 6e79 6d6f 7573 2052 6570 6c79 546f 2061 nymous ReplyTo a │ │ │ +0012dc00: 6464 7265 7373 3c2f 7370 616e 3e3c 2f64 ddress.
    │ │ │ +0012dc40: 6966 3c2f 7370 616e 3e20 2873 6f61 705f if (soap_ │ │ │ +0012dc50: 7365 6e64 5f6e 735f 5f62 6361 7374 5374 send_ns__bcastSt │ │ │ +0012dc60: 7269 6e67 2826 616d 703b 3c61 2063 6c61 ring(&soap, "soa │ │ │ +0012dcc0: 702e 7564 703a 2f2f 656e 6470 6f69 6e74 p.udp://endpoint │ │ │ +0012dcd0: 2671 756f 743b 3c2f 7370 616e 3e2c 203c ", < │ │ │ +0012dce0: 7370 616e 2063 6c61 7373 3d22 7374 7269 span class="stri │ │ │ +0012dcf0: 6e67 6c69 7465 7261 6c22 3e26 7175 6f74 ngliteral">" │ │ │ +0012dd00: 3b53 4f41 5020 6163 7469 6f6e 2671 756f ;SOAP action&quo │ │ │ +0012dd10: 743b 3c2f 7370 616e 3e2c 203c 7370 616e t;, "hel │ │ │ +0012dd40: 6c6f 2077 6f72 6c64 2126 7175 6f74 3b3c lo world!"< │ │ │ +0012dd50: 2f73 7061 6e3e 2929 203c 2f64 6976 3e0a /span>))
    . │ │ │ +0012dd60: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    {
    .
    soap_print_faul │ │ │ +0012ddf0: 743c 2f61 3e28 2661 6d70 3b3c 6120 636c t(&soap, stde │ │ │ +0012de30: 7272 293b 203c 2f64 6976 3e0a 3c64 6976 rr);
    .
    }< │ │ │ +0012de50: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    else .
    {
    .< │ │ │ +0012deb0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +0012dec0: 3e20 203c 7370 616e 2063 6c61 7373 3d22 > whi │ │ │ +0012dee0: 6c65 3c2f 7370 616e 3e20 2831 293c 2f64 le (1).
    {
    . │ │ │ +0012df10: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    │ │ │ +0012df40: 6966 3c2f 7370 616e 3e20 2873 6f61 705f if (soap_ │ │ │ +0012df50: 7265 6376 5f6e 735f 5f62 6361 7374 5374 recv_ns__bcastSt │ │ │ +0012df60: 7269 6e67 5265 7370 6f6e 7365 2826 616d ringResponse(&am │ │ │ +0012df70: 703b 3c61 2063 6c61 7373 3d22 636f 6465 p;soap, &res)) .
    break;
    .
    │ │ │ +0012e010: 2020 2e2e 2e20 3c73 7061 6e20 636c 6173 ... // G │ │ │ +0012e030: 6f74 2072 6573 706f 6e73 6520 2623 3339 ot response ' │ │ │ +0012e040: 3b72 6573 2623 3339 3b20 6672 6f6d 2061 ;res' from a │ │ │ +0012e050: 2073 6572 7665 7220 3c2f 7370 616e 3e3c server < │ │ │ +0012e060: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    } .
    if (soap.error = │ │ │ +0012e140: 3d20 3c61 2063 6c61 7373 3d22 636f 6465 = SOAP_EOF && soap.errnum == 0)
    .< │ │ │ +0012e240: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +0012e250: 3e20 2020 202e 2e2e 203c 7370 616e 2063 > ... / │ │ │ +0012e270: 2f20 5469 6d65 6f75 743a 206e 6f20 6d6f / Timeout: no mo │ │ │ +0012e280: 7265 206d 6573 7361 6765 7320 7265 6365 re messages rece │ │ │ +0012e290: 6976 6564 203c 2f73 7061 6e3e 3c2f 6469 ived .
    else ..
    } .
    soap_d │ │ │ +0012e430: 6573 7472 6f79 3c2f 613e 2826 616d 703b estroy(& │ │ │ +0012e440: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap) │ │ │ +0012e470: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
    .
    s │ │ │ +0012e4e0: 6f61 705f 656e 643c 2f61 3e28 2661 6d70 oap_end(& │ │ │ +0012e4f0: 3b3c 6120 636c 6173 733d 2263 6f64 6522 ;soap │ │ │ +0012e520: 293b 3c2f 6469 763e 0a3c 6469 7620 636c );
    .
    │ │ │ +0012e590: 736f 6170 5f64 6f6e 653c 2f61 3e28 2661 soap_done(&a │ │ │ +0012e5a0: 6d70 3b3c 6120 636c 6173 733d 2263 6f64 mp;soap);
    .
    │ │ │ +00130880: 3c70 3e54 6865 2073 6572 7665 7220 6269

    The server bi │ │ │ +00130890: 6e64 7320 746f 2061 2068 6f73 7420 616e nds to a host an │ │ │ +001308a0: 6420 706f 7274 2061 6e64 2061 6363 6570 d port and accep │ │ │ +001308b0: 7473 206d 6573 7361 6765 7320 696e 2061 ts messages in a │ │ │ +001308c0: 206c 6f6f 702e 2042 6563 6175 7365 2055 loop. Because U │ │ │ +001308d0: 4450 2064 6f65 7320 6e6f 7420 6861 7665 DP does not have │ │ │ +001308e0: 2074 6865 2065 7175 6976 616c 656e 7420 the equivalent │ │ │ +001308f0: 6f66 2061 6e20 6163 6365 7074 2c20 7468 of an accept, th │ │ │ +00130900: 6520 6d65 7373 6167 6573 2063 616e 6e6f e messages canno │ │ │ +00130910: 7420 6265 2064 6973 7061 7463 6865 6420 t be dispatched │ │ │ +00130920: 746f 2074 6872 6561 6473 2e20 496e 7374 to threads. Inst │ │ │ +00130930: 6561 6420 7468 6520 3c63 6f64 653e 3c61 ead the soa │ │ │ +001309b0: 705f 7365 7276 653c 2f61 3e3c 2f63 6f64 p_serve waits for a m │ │ │ +001309d0: 6573 7361 6765 2061 6e64 2069 6d6d 6564 essage and immed │ │ │ +001309e0: 6961 7465 6c79 2061 6363 6570 7473 2069 iately accepts i │ │ │ +001309f0: 742e 2059 6f75 2063 616e 2075 7365 2061 t. You can use a │ │ │ +00130a00: 2072 6563 6569 7665 2074 696d 656f 7574 receive timeout │ │ │ +00130a10: 2076 616c 7565 2066 6f72 203c 636f 6465 value for soap │ │ │ +00130ad0: 3a3a 7265 6376 5f74 696d 656f 7574 3c2f ::recv_timeout to mak │ │ │ +00130af0: 6520 3c63 6f64 653e 3c61 2063 6c61 7373 e soap_serv │ │ │ +00130b70: 653c 2f61 3e3c 2f63 6f64 653e 206e 6f6e e non │ │ │ +00130b80: 2d62 6c6f 636b 696e 672e 3c2f 703e 0a3c -blocking.

    .< │ │ │ +00130b90: 703e 546f 206f 6274 6169 6e20 7265 7370 p>To obtain resp │ │ │ +00130ba0: 6f6e 7365 206f 6e65 2d77 6179 206f 7065 onse one-way ope │ │ │ +00130bb0: 7261 7469 6f6e 7320 6672 6f6d 2061 2057 rations from a W │ │ │ +00130bc0: 5344 4c2c 2075 7365 203c 6120 6872 6566 SDL, use │ │ │ +00130be0: 3c63 6f64 653e 7773 646c 3268 202d 623c wsdl2h -b< │ │ │ +00130bf0: 2f63 6f64 653e 3c2f 623e 206f 7074 696f /code> optio │ │ │ +00130c00: 6e20 3c62 3e3c 636f 6465 3e2d 623c 2f63 n -b. Th │ │ │ +00130c20: 6973 2070 726f 6475 6365 7320 6164 6469 is produces addi │ │ │ +00130c30: 7469 6f6e 616c 206f 6e65 2d77 6179 206f tional one-way o │ │ │ +00130c40: 7065 7261 7469 6f6e 7320 746f 2073 7570 perations to sup │ │ │ +00130c50: 706f 7274 2061 7379 6e63 6872 6f6e 6f75 port asynchronou │ │ │ +00130c60: 7320 6861 6e64 6c69 6e67 206f 6620 7265 s handling of re │ │ │ +00130c70: 7370 6f6e 7365 206d 6573 7361 6765 7320 sponse messages │ │ │ +00130c80: 696e 2074 6865 2073 616d 6520 7761 7920 in the same way │ │ │ +00130c90: 7265 7175 6573 7473 2061 7265 2068 616e requests are han │ │ │ +00130ca0: 646c 6564 2e3c 2f70 3e0a 3c70 3ef0 9f94 dled.

    .

    ... │ │ │ +00130cb0: 9d20 3c61 2068 7265 663d 2223 223e 4261 . Ba │ │ │ +00130cc0: 636b 2074 6f20 7461 626c 6520 6f66 2063 ck to table of c │ │ │ +00130cd0: 6f6e 7465 6e74 733c 2f61 3e3c 2f70 3e0a ontents

    . │ │ │ +00130ce0: 3c68 333e 3c61 2063 6c61 7373 3d22 616e

    │ │ │ +00130d10: 3c2f 613e 0a53 4f41 502d 6f76 6572 2d55 .SOAP-over-U │ │ │ +00130d20: 4450 206d 756c 7469 6361 7374 2072 6563 DP multicast rec │ │ │ +00130d30: 6569 7669 6e67 2073 6572 7665 723c 2f68 eiving server.

    For UDP mu │ │ │ +00130d50: 6c74 6963 6173 7420 7375 7070 6f72 742c lticast support, │ │ │ +00130d60: 2066 6f6c 6c6f 7720 7468 6520 7375 6767 follow the sugg │ │ │ +00130d70: 6573 7469 6f6e 7320 696e 2053 6563 7469 estions in Secti │ │ │ +00130d80: 6f6e 203c 6120 636c 6173 733d 2265 6c22 on S │ │ │ +00130db0: 4f41 502d 6f76 6572 2d55 4450 2073 6572 OAP-over-UDP ser │ │ │ +00130dc0: 7665 723c 2f61 3e20 616e 6420 6368 616e ver and chan │ │ │ +00130dd0: 6765 2074 6865 2069 6e69 7469 616c 697a ge the initializ │ │ │ +00130de0: 6174 696f 6e20 7061 7274 7320 6f66 2074 ation parts of t │ │ │ +00130df0: 6865 2063 6f64 6520 746f 2065 6e61 626c he code to enabl │ │ │ +00130e00: 6520 5544 5020 6d75 6c74 6963 6173 7420 e UDP multicast │ │ │ +00130e10: 706f 7274 2062 696e 6469 6e67 2062 7920 port binding by │ │ │ +00130e20: 746f 2074 656c 6c69 6e67 2074 6865 206b to telling the k │ │ │ +00130e30: 6572 6e65 6c20 7768 6963 6820 6d75 6c74 ernel which mult │ │ │ +00130e40: 6963 6173 7420 6772 6f75 7073 2079 6f75 icast groups you │ │ │ +00130e50: 2061 7265 2069 6e74 6572 6573 7465 6420 are interested │ │ │ +00130e60: 696e 3a3c 2f70 3e0a 3c64 6976 2063 6c61 in:

    .
    │ │ │ +00130e90: 3c73 7061 6e20 636c 6173 733d 2270 7265 #incl │ │ │ +00130eb0: 7564 6520 2671 756f 743b 706c 7567 696e ude "plugin │ │ │ +00130ec0: 2f77 7361 6170 692e 6826 7175 6f74 3b3c /wsaapi.h"< │ │ │ +00130ed0: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    . │ │ │ +00130ef0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173

    .
    int ma │ │ │ +00130f30: 696e 2829 203c 2f64 6976 3e0a 3c64 6976 in()
    .
    {< │ │ │ +00130f50: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    │ │ │ +00130f80: 7374 7275 6374 203c 2f73 7061 6e3e 3c61 struct soap soap; < │ │ │ +00130ff0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    │ │ │ +00131020: 7374 7275 6374 203c 2f73 7061 6e3e 6970 struct ip │ │ │ +00131030: 5f6d 7265 7120 6d63 6173 743b 203c 2f64 _mreq mcast; .
    soa │ │ │ +001310b0: 705f 696e 6974 313c 2f61 3e28 2661 6d70 p_init1(& │ │ │ +001310c0: 3b3c 6120 636c 6173 733d 2263 6f64 6522 ;soap │ │ │ +001310f0: 2c20 3c61 2063 6c61 7373 3d22 636f 6465 , SOAP_IO_UDP │ │ │ +00131150: 3c2f 613e 293b 203c 2f64 6976 3e0a 3c64 );
    . │ │ │ +00131170: 2020 3c61 2063 6c61 7373 3d22 636f 6465 soap_regis │ │ │ +001311d0: 7465 725f 706c 7567 696e 3c2f 613e 2826 ter_plugin(& │ │ │ +001311e0: 616d 703b 3c61 2063 6c61 7373 3d22 636f amp;soap< │ │ │ +00131210: 2f61 3e2c 2073 6f61 705f 7773 6129 3b3c /a>, soap_wsa);< │ │ │ +00131220: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    if (! │ │ │ +00131260: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap_valid_soc │ │ │ +001312c0: 6b65 743c 2f61 3e28 3c61 2063 6c61 7373 ket(soap_bin │ │ │ +00131320: 643c 2f61 3e28 2661 6d70 3b3c 6120 636c d(&soap, host │ │ │ +00131360: 2c20 706f 7274 2c20 4241 434b 4c4f 4729 , port, BACKLOG) │ │ │ +00131370: 2929 203c 2f64 6976 3e0a 3c64 6976 2063 ))
    .
    {< │ │ │ +00131390: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>..
    │ │ │ +00131470: 6578 6974 2845 5849 545f 4641 494c 5552 exit(EXIT_FAILUR │ │ │ +00131480: 4529 3b20 3c2f 6469 763e 0a3c 6469 7620 E);
    .
    } │ │ │ +001314a0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    mcas │ │ │ +001314c0: 742e 696d 725f 6d75 6c74 6961 6464 722e t.imr_multiaddr. │ │ │ +001314d0: 735f 6164 6472 203d 2069 6e65 745f 6164 s_addr = inet_ad │ │ │ +001314e0: 6472 2870 7574 2049 5020 6d75 6c74 6963 dr(put IP multic │ │ │ +001314f0: 6173 7420 6164 6472 6573 7320 6f66 2067 ast address of g │ │ │ +00131500: 726f 7570 2068 6572 6529 3b20 3c2f 6469 roup here); .
    mcast.imr │ │ │ +00131530: 5f69 6e74 6572 6661 6365 2e73 5f61 6464 _interface.s_add │ │ │ +00131540: 7220 3d20 6874 6f6e 6c28 494e 4144 4452 r = htonl(INADDR │ │ │ +00131550: 5f41 4e59 293b 203c 2f64 6976 3e0a 3c64 _ANY);
    . │ │ │ +00131570: 2020 3c73 7061 6e20 636c 6173 733d 226b if (setsockop │ │ │ +001315a0: 7428 3c61 2063 6c61 7373 3d22 636f 6465 t(soap.maste │ │ │ +00131620: 723c 2f61 3e2c 2049 5050 524f 544f 5f49 r, IPPROTO_I │ │ │ +00131630: 502c 2049 505f 4144 445f 4d45 4d42 4552 P, IP_ADD_MEMBER │ │ │ +00131640: 5348 4950 2c20 2661 6d70 3b6d 6361 7374 SHIP, &mcast │ │ │ +00131650: 2c20 3c73 7061 6e20 636c 6173 733d 226b , sizeof(mcast))< │ │ │ +00131680: 3b30 2920 3c2f 6469 763e 0a3c 6469 7620 ;0)
    .
    │ │ │ +001316a0: 202e 2e2e 203c 7370 616e 2063 6c61 7373 ... // er │ │ │ +001316c0: 726f 723c 2f73 7061 6e3e 3c2f 6469 763e ror
    │ │ │ +001316d0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    ... / │ │ │ +00131700: 2f3c 2f73 7061 6e3e 3c2f 6469 763e 0a3c /
    .< │ │ │ +00131710: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +00131720: 3e20 203c 6120 636c 6173 733d 2263 6f64 > soap_des │ │ │ +00131780: 7472 6f79 3c2f 613e 2826 616d 703b 3c61 troy(&soap);< │ │ │ +001317c0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    s │ │ │ +00131830: 6f61 705f 656e 643c 2f61 3e28 2661 6d70 oap_end(& │ │ │ +00131840: 3b3c 6120 636c 6173 733d 2263 6f64 6522 ;soap │ │ │ +00131870: 293b 3c2f 6469 763e 0a3c 6469 7620 636c );
    .
    soap_done( │ │ │ +001318f0: 2661 6d70 3b3c 6120 636c 6173 733d 2263 &soap │ │ │ +00131920: 3c2f 613e 293b 3c2f 6469 763e 0a3c 6469 );
    .} │ │ │ +00131940: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    │ │ │ +00131990: 3c64 6976 2063 6c61 7373 3d22 7474 6e61
    │ │ │ +001319e0: 736f 6170 3a3a 6d61 7374 6572 3c2f 613e soap::master │ │ │ +001319f0: 3c2f 6469 763e 3c64 6976 2063 6c61 7373
    SOAP_S │ │ │ +00131a10: 4f43 4b45 5420 6d61 7374 6572 3c2f 6469 OCKET master
    The socket │ │ │ +00131a40: 7365 7420 6279 2073 6f61 705f 6269 6e64 set by soap_bind │ │ │ +00131a50: 2028 6f72 2074 6865 2043 2b2b 2073 6572 (or the C++ ser │ │ │ +00131a60: 7669 6365 2063 6c61 7373 2062 696e 6420 vice class bind │ │ │ +00131a70: 6d65 7468 6f64 2920 746f 2073 6572 7665 method) to serve │ │ │ +00131a80: 2061 7320 7468 6520 6d61 7374 6572 2073 as the master s │ │ │ +00131a90: 6f63 6b65 7420 626f 756e 2e2e 2e3c 2f64 ocket boun...
    Definit │ │ │ +00131ac0: 696f 6e3a 3c2f 623e 2073 7464 736f 6170 ion: stdsoap │ │ │ +00131ad0: 322e 683a 3330 3233 3c2f 6469 763e 3c2f 2.h:3023
    .

    . │ │ │ +00131b00: 9f94 9d20 3c61 2068 7265 663d 2223 223e ... │ │ │ +00131b10: 4261 636b 2074 6f20 7461 626c 6520 6f66 Back to table of │ │ │ +00131b20: 2063 6f6e 7465 6e74 733c 2f61 3e3c 2f70 contents

    .

    . │ │ │ +00131b60: 436f 6d70 696c 652d 7469 6d65 2066 6c61 Compile-time fla │ │ │ +00131b70: 6773 3c2f 6831 3e0a 3c70 3e54 6865 2066 gs

    .

    The f │ │ │ +00131b80: 6f6c 6c6f 7769 6e67 206d 6163 726f 7320 ollowing macros │ │ │ +00131b90: 6172 6520 6465 6669 6e65 6420 696e 2074 are defined in t │ │ │ +00131ba0: 6865 2041 5049 2064 6f63 756d 656e 7461 he API documenta │ │ │ +00131bb0: 7469 6f6e 204d 6f64 756c 6520 3c61 2063 tion Module WITH_MA │ │ │ +00131bf0: 4352 4f20 636f 6d70 696c 652d 7469 6d65 CRO compile-time │ │ │ +00131c00: 2066 6c61 6773 3c2f 613e 2e20 5468 6573 flags. Thes │ │ │ +00131c10: 6520 6d61 6372 6f73 2061 7265 2075 7365 e macros are use │ │ │ +00131c20: 6420 746f 2065 6e61 626c 6520 6f72 2064 d to enable or d │ │ │ +00131c30: 6973 6162 6c65 2066 6561 7475 7265 7320 isable features │ │ │ +00131c40: 6173 2073 7065 6369 6669 6564 2062 656c as specified bel │ │ │ +00131c50: 6f77 2c20 6279 2063 6f6d 7069 6c69 6e67 ow, by compiling │ │ │ +00131c60: 2073 6f75 7263 6520 636f 6465 2066 696c source code fil │ │ │ +00131c70: 6573 2077 6974 6820 636f 6d70 696c 6572 es with compiler │ │ │ +00131c80: 206f 7074 696f 6e20 3c62 3e3c 636f 6465 option -D t │ │ │ +00131ca0: 6f20 7365 7420 7468 6520 6d61 6372 6f3a o set the macro: │ │ │ +00131cb0: 3c2f 703e 0a3c 7461 626c 6520 636c 6173

    .

    engine │ │ │ -0018e5c0: 2020 3c2f 7468 3e3c 7468 2063 6c61 7373 result │ │ │ -0018e5f0: 2020 203c 2f74 683e 3c2f 7472 3e0a 3c74
    T │ │ │ -0018e680: 6865 2064 6566 6175 6c74 2073 6f66 7477 he default softw │ │ │ -0018e690: 6172 6520 656e 6769 6e65 2066 6f72 2063 are engine for c │ │ │ -0018e6a0: 7279 7074 6f67 7261 7068 6963 206f 7065 ryptographic ope │ │ │ -0018e6b0: 7261 7469 6f6e 7320 2020 203c 2f74 643e rations
    │ │ │ -0018e710: 6f70 656e 6273 645f 6465 765f 6372 7970 openbsd_dev_cryp │ │ │ -0018e720: 746f 3c2f 636f 6465 3e20 2020 3c2f 7464 to OpenBSD suppo │ │ │ -0018e760: 7274 7320 6b65 726e 656c 206c 6576 656c rts kernel level │ │ │ -0018e770: 2063 7279 7074 6f67 7261 7068 7920 2020 cryptography │ │ │ -0018e780: 203c 2f74 643e 3c2f 7472 3e0a 3c74 7220
    < │ │ │ -0018e7d0: 636f 6465 3e63 7377 6966 743c 2f63 6f64 code>cswift Cryp │ │ │ -0018e810: 746f 5377 6966 7420 6163 6365 6c65 7261 toSwift accelera │ │ │ -0018e820: 7469 6f6e 2068 6172 6477 6172 6520 2020 tion hardware │ │ │ -0018e830: 203c 2f74 643e 3c2f 7472 3e0a 3c74 7220
    nCiph │ │ │ -0018e8c0: 6572 2043 4849 4c20 6163 6365 6c65 7261 er CHIL accelera │ │ │ -0018e8d0: 7469 6f6e 2068 6172 6477 6172 6520 2020 tion hardware │ │ │ -0018e8e0: 203c 2f74 643e 3c2f 7472 3e0a 3c74 7220
    < │ │ │ -0018e930: 636f 6465 3e61 7461 6c6c 613c 2f63 6f64 code>atalla Comp │ │ │ -0018e970: 6171 2041 7461 6c6c 6120 6163 6365 6c65 aq Atalla accele │ │ │ -0018e980: 7261 7469 6f6e 2068 6172 6477 6172 6520 ration hardware │ │ │ -0018e990: 2020 203c 2f74 643e 3c2f 7472 3e0a 3c74
    nuron Nu │ │ │ -0018ea20: 726f 6e20 6163 6365 6c65 7261 7469 6f6e ron acceleration │ │ │ -0018ea30: 2068 6172 6477 6172 6520 2020 203c 2f74 hardware
    ubsec │ │ │ -0018eaa0: 3c2f 7464 3e3c 7464 2063 6c61 7373 3d22 Broadcom │ │ │ -0018ead0: 7542 5365 6320 6163 6365 6c65 7261 7469 uBSec accelerati │ │ │ -0018eae0: 6f6e 2068 6172 6477 6172 6520 2020 203c on hardware < │ │ │ -0018eaf0: 2f74 643e 3c2f 7472 3e0a 3c74 7220 636c /td>
    aep │ │ │ -0018eb50: 203c 2f74 643e 3c74 6420 636c 6173 733d Aep acce │ │ │ -0018eb80: 6c65 7261 7469 6f6e 2068 6172 6477 6172 leration hardwar │ │ │ -0018eb90: 6520 2020 203c 2f74 643e 3c2f 7472 3e0a e
    surewar │ │ │ -0018ebf0: 653c 2f63 6f64 653e 2020 203c 2f74 643e e SureWare accel │ │ │ -0018ec30: 6572 6174 696f 6e20 6861 7264 7761 7265 eration hardware │ │ │ -0018ec40: 2020 203c 2f74 643e 3c2f 7472 3e0a 3c2f
    ........ │ │ │ +00132030: 3c2f 7472 3e0a 3c74 7220 636c 6173 733d .. │ │ │ +00132150: 0a3c 7472 2063 6c61 7373 3d22 6d61 726b ..< │ │ │ +00132270: 2f74 723e 0a3c 7472 2063 6c61 7373 3d22 /tr>.... │ │ │ +001323f0: 656e 6162 6c65 7320 4854 5450 2063 6f6f enables HTTP coo │ │ │ +00132400: 6b69 6573 2c20 7365 6520 5365 6374 696f kies, see Sectio │ │ │ +00132410: 6e73 203c 6120 636c 6173 733d 2265 6c22 ns │ │ │ +00132440: 436c 6965 6e74 2d73 6964 6520 636f 6f6b Client-side cook │ │ │ +00132450: 6965 2073 7570 706f 7274 3c2f 613e 2061 ie support a │ │ │ +00132460: 6e64 203c 6120 636c 6173 733d 2265 6c22 nd │ │ │ +00132490: 5365 7276 6572 2d73 6964 6520 636f 6f6b Server-side cook │ │ │ +001324a0: 6965 2073 7570 706f 7274 3c2f 613e 2020 ie support │ │ │ +001324b0: 2020 3c2f 7464 3e3c 2f74 723e 0a3c 7472 ..< │ │ │ +001324e0: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ +001324f0: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ +00132500: 3e3c 636f 6465 3e23 5749 5448 5f49 4e53 >#WITH_INS │ │ │ +00132510: 4543 5552 455f 434f 4f4b 4945 533c 2f63 ECURE_COOKIES │ │ │ +001325c0: 0a3c 7472 2063 6c61 7373 3d22 6d61 726b ........... │ │ │ +00132ae0: 3c74 7220 636c 6173 733d 226d 6172 6b64 ..... │ │ │ +00132cf0: 3c74 6420 636c 6173 733d 226d 6172 6b64 ..< │ │ │ +00132da0: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ +00132db0: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ +00132dc0: 3e3c 636f 6465 3e23 5749 5448 5f4e 4f5f >#WITH_NO_ │ │ │ +00132dd0: 435f 4c4f 4341 4c45 3c2f 636f 6465 3e20 C_LOCALE │ │ │ +00132de0: 2020 3c2f 7464 3e3c 7464 2063 6c61 7373 │ │ │ +00132e50: 0a3c 7472 2063 6c61 7373 3d22 6d61 726b .... │ │ │ +00132fc0: 3c63 6f64 653e 2357 4954 485f 444f 4d3c #WITH_DOM< │ │ │ +00132fd0: 2f63 6f64 653e 2020 203c 2f74 643e 3c74 /code> │ │ │ +00133000: 656e 6162 6c65 2044 4f4d 2070 6172 7369 enable DOM parsi │ │ │ +00133010: 6e67 2069 6e20 7468 6520 656e 6769 6e65 ng in the engine │ │ │ +00133020: 2c20 7265 7175 6972 6564 2062 7920 7468 , required by th │ │ │ +00133030: 6520 5753 2d53 6563 7572 6974 7920 706c e WS-Security pl │ │ │ +00133040: 7567 696e 2020 2020 3c2f 7464 3e3c 2f74 ugin ... │ │ │ +00133150: 3c74 7220 636c 6173 733d 226d 6172 6b64 │ │ │ +00133170: 0a3c 7464 2063 6c61 7373 3d22 6d61 726b . │ │ │ +00133230: 3c2f 7472 3e0a 3c74 7220 636c 6173 733d .... │ │ │ +001333d0: 3c74 6420 636c 6173 733d 226d 6172 6b64 │ │ │ +00133470: 3c2f 7472 3e0a 3c74 7220 636c 6173 733d .. │ │ │ +00133530: 3c2f 7472 3e0a 3c74 7220 636c 6173 733d ... │ │ │ +00133610: 3c74 7220 636c 6173 733d 226d 6172 6b64 . │ │ │ +00133680: 3c74 6420 636c 6173 733d 226d 6172 6b64 .. │ │ │ +00133730: 3c63 6f64 653e 2357 4954 485f 4e4f 454d #WITH_NOEM │ │ │ +00133740: 5054 5953 5452 5543 543c 2f63 6f64 653e PTYSTRUCT │ │ │ +00133750: 2020 203c 2f74 643e 3c74 6420 636c 6173 < │ │ │ +001337c0: 2f74 723e 0a3c 7472 2063 6c61 7373 3d22 /tr>....< │ │ │ +00133b10: 2f74 723e 0a3c 7472 2063 6c61 7373 3d22 /tr>........< │ │ │ +00133e60: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ +00133e70: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ +00133e80: 3e3c 636f 6465 3e23 5749 5448 5f43 4153 >#WITH_CAS │ │ │ +00133e90: 4549 4e53 454e 5349 5449 5645 5441 4753 EINSENSITIVETAGS │ │ │ +00133ea0: 3c2f 636f 6465 3e20 2020 3c2f 7464 3e3c < │ │ │ +00133eb0: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ +00133ec0: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ +00133ed0: 3e65 6e61 626c 6573 2063 6173 6520 696e >enables case in │ │ │ +00133ee0: 7365 6e73 6974 6976 6520 584d 4c20 7061 sensitive XML pa │ │ │ +00133ef0: 7273 696e 6720 2020 203c 2f74 643e 3c2f rsing .... │ │ │ +00134090: 3c74 6420 636c 6173 733d 226d 6172 6b64 .. │ │ │ +00134290: 3c2f 7472 3e0a 3c2f 7461 626c 653e 0a3c .
    define result
    #SOAPDEFS_H th │ │ │ +00131de0: 6520 6865 6164 6572 2066 696c 6520 746f e header file to │ │ │ +00131df0: 2069 6e63 6c75 6465 2c20 6966 2064 6966 include, if dif │ │ │ +00131e00: 6665 7265 6e74 2066 726f 6d20 3c63 6f64 ferent from soapdefs.h
    #WIT │ │ │ +00131e80: 485f 534f 4150 4445 4653 5f48 3c2f 636f H_SOAPDEFS_H inc │ │ │ +00131ec0: 6c75 6465 7320 7468 6520 3c63 6f64 653e ludes the │ │ │ +00131ed0: 736f 6170 6465 6673 2e68 3c2f 636f 6465 soapdefs.h file for custo │ │ │ +00131ef0: 6d20 7365 7474 696e 6773 2c20 7365 6520 m settings, see │ │ │ +00131f00: 5365 6374 696f 6e20 3c61 2063 6c61 7373 Section Using the soapd │ │ │ +00131f40: 6566 732e 6820 6865 6164 6572 2066 696c efs.h header fil │ │ │ +00131f50: 653c 2f61 3e20 2020 203c 2f74 643e 3c2f e
    #WI │ │ │ +00131fb0: 5448 5f43 4f4d 5041 543c 2f63 6f64 653e TH_COMPAT │ │ │ +00131fc0: 2020 203c 2f74 643e 3c74 6420 636c 6173 remove │ │ │ +00131ff0: 7320 6465 7065 6e64 656e 6379 206f 6e20 s dependency on │ │ │ +00132000: 432b 2b20 7374 7265 616d 206c 6962 7261 C++ stream libra │ │ │ +00132010: 7269 6573 2061 6e64 2043 2b2b 2065 7863 ries and C++ exc │ │ │ +00132020: 6570 7469 6f6e 7320 2020 203c 2f74 643e eptions
    │ │ │ +00132080: 2357 4954 485f 4c45 414e 3c2f 636f 6465 #WITH_LEAN creat │ │ │ +001320c0: 6573 2061 2073 6d61 6c6c 2d66 6f6f 7470 es a small-footp │ │ │ +001320d0: 7269 6e74 2065 7865 6375 7461 626c 652c rint executable, │ │ │ +001320e0: 2073 6565 2053 6563 7469 6f6e 203c 6120 see Section How to minimiz │ │ │ +00132120: 6520 6170 706c 6963 6174 696f 6e20 6d65 e application me │ │ │ +00132130: 6d6f 7279 2066 6f6f 7470 7269 6e74 3c2f mory footprint
    #WITH_ │ │ │ +001321a0: 4c45 414e 4552 3c2f 636f 6465 3e20 2020 LEANER │ │ │ +001321b0: 3c2f 7464 3e3c 7464 2063 6c61 7373 3d22 creates a │ │ │ +001321e0: 6e20 6576 656e 2073 6d61 6c6c 6572 2066 n even smaller f │ │ │ +001321f0: 6f6f 7470 7269 6e74 2065 7865 6375 7461 ootprint executa │ │ │ +00132200: 626c 652c 2073 6565 2053 6563 7469 6f6e ble, see Section │ │ │ +00132210: 203c 6120 636c 6173 733d 2265 6c22 2068 How to min │ │ │ +00132240: 696d 697a 6520 6170 706c 6963 6174 696f imize applicatio │ │ │ +00132250: 6e20 6d65 6d6f 7279 2066 6f6f 7470 7269 n memory footpri │ │ │ +00132260: 6e74 3c2f 613e 2020 2020 3c2f 7464 3e3c nt
    # │ │ │ +001322c0: 5749 5448 5f46 4153 543c 2f63 6f64 653e WITH_FAST │ │ │ +001322d0: 2020 203c 2f74 643e 3c74 6420 636c 6173 use fa │ │ │ +00132300: 7374 6572 206d 656d 6f72 7920 616c 6c6f ster memory allo │ │ │ +00132310: 6361 7469 6f6e 2077 6865 6e20 7573 6564 cation when used │ │ │ +00132320: 2077 6974 6820 3c63 6f64 653e 2357 4954 with #WIT │ │ │ +00132330: 485f 4c45 414e 3c2f 636f 6465 3e20 6f72 H_LEAN or │ │ │ +00132340: 203c 636f 6465 3e23 5749 5448 5f4c 4541 #WITH_LEA │ │ │ +00132350: 4e45 523c 2f63 6f64 653e 2020 2020 3c2f NER
    #WITH_COOKIES< │ │ │ +001323c0: 2f63 6f64 653e 2020 203c 2f74 643e 3c74 /code>
    en │ │ │ +00132550: 6162 6c65 7320 4854 5450 2063 6f6f 6b69 ables HTTP cooki │ │ │ +00132560: 6573 2061 6e64 2061 6c6c 6f77 7320 636f es and allows co │ │ │ +00132570: 6f6b 6965 7320 7769 7468 2074 6865 6972 okies with their │ │ │ +00132580: 2053 6563 7572 6520 666c 6167 2073 6574 Secure flag set │ │ │ +00132590: 2074 6f20 6265 2073 656e 7420 6f76 6572 to be sent over │ │ │ +001325a0: 2069 6e73 6563 7572 6520 6368 616e 6e65 insecure channe │ │ │ +001325b0: 6c73 2020 2020 3c2f 7464 3e3c 2f74 723e ls
    #WITH_ │ │ │ +00132610: 4950 5636 3c2f 636f 6465 3e20 2020 3c2f IPV6 enables IPv │ │ │ +00132650: 3620 7375 7070 6f72 7420 2020 203c 2f74 6 support
    #WITH_IPV6_V6O │ │ │ +001326c0: 4e4c 593c 2f63 6f64 653e 2020 203c 2f74 NLY enables IPv6 │ │ │ +00132700: 2073 7570 706f 7274 2077 6974 6820 4950 support with IP │ │ │ +00132710: 7636 2d6f 6e6c 7920 7365 7276 6572 206f v6-only server o │ │ │ +00132720: 7074 696f 6e20 2020 203c 2f74 643e 3c2f ption
    #WI │ │ │ +00132780: 5448 5f4f 5045 4e53 534c 3c2f 636f 6465 TH_OPENSSL enabl │ │ │ +001327c0: 6573 204f 7065 6e53 534c 2c20 7365 6520 es OpenSSL, see │ │ │ +001327d0: 5365 6374 696f 6e73 203c 6120 636c 6173 Sections Secure cl │ │ │ +00132810: 6965 6e74 7320 7769 7468 2048 5454 5053 ients with HTTPS │ │ │ +00132820: 3c2f 613e 2061 6e64 203c 6120 636c 6173 and Secure We │ │ │ +00132860: 6220 7365 7276 6963 6573 2077 6974 6820 b services with │ │ │ +00132870: 4854 5450 533c 2f61 3e20 2020 203c 2f74 HTTPS
    #WITH_GNUTLS e │ │ │ +00132910: 6e61 626c 6573 2047 4e55 544c 532c 2073 nables GNUTLS, s │ │ │ +00132920: 6565 2053 6563 7469 6f6e 7320 3c61 2063 ee Sections Secure │ │ │ +00132960: 2063 6c69 656e 7473 2077 6974 6820 4854 clients with HT │ │ │ +00132970: 5450 533c 2f61 3e20 616e 6420 3c61 2063 TPS and Secure │ │ │ +001329b0: 2057 6562 2073 6572 7669 6365 7320 7769 Web services wi │ │ │ +001329c0: 7468 2048 5454 5053 3c2f 613e 2020 2020 th HTTPS │ │ │ +001329d0: 3c2f 7464 3e3c 2f74 723e 0a3c 7472 2063
    #WITH_GZIP e │ │ │ +00132a60: 6e61 626c 6573 2067 7a69 7020 616e 6420 nables gzip and │ │ │ +00132a70: 6465 666c 6174 6520 636f 6d70 7265 7373 deflate compress │ │ │ +00132a80: 696f 6e2c 2073 6565 2053 6563 7469 6f6e ion, see Section │ │ │ +00132a90: 203c 6120 636c 6173 733d 2265 6c22 2068 Zli │ │ │ +00132ac0: 6220 636f 6d70 7265 7373 696f 6e3c 2f61 b compression
    #WITH_ │ │ │ +00132b30: 5a4c 4942 3c2f 636f 6465 3e20 2020 3c2f ZLIB enables def │ │ │ +00132b70: 6c61 7465 2063 6f6d 7072 6573 7369 6f6e late compression │ │ │ +00132b80: 206f 6e6c 792c 2073 6565 2053 6563 7469 only, see Secti │ │ │ +00132b90: 6f6e 203c 6120 636c 6173 733d 2265 6c22 on Z │ │ │ +00132bc0: 6c69 6220 636f 6d70 7265 7373 696f 6e3c lib compression< │ │ │ +00132bd0: 2f61 3e20 2020 203c 2f74 643e 3c2f 7472 /a>
    #WITH │ │ │ +00132c30: 5f4e 544c 4d3c 2f63 6f64 653e 2020 203c _NTLM < │ │ │ +00132c40: 2f74 643e 3c74 6420 636c 6173 733d 226d /td>enables NT │ │ │ +00132c70: 4c4d 2073 7570 706f 7274 2020 2020 3c2f LM support
    #WITH_C_LOCAL │ │ │ +00132ce0: 453c 2f63 6f64 653e 2020 203c 2f74 643e E force the use │ │ │ +00132d20: 6c6f 6361 6c65 2066 756e 6374 696f 6e73 locale functions │ │ │ +00132d30: 2077 6865 6e20 6176 6169 6c61 626c 6520 when available │ │ │ +00132d40: 746f 2065 6e73 7572 6520 6c6f 6361 6c65 to ensure locale │ │ │ +00132d50: 2d69 6e64 6570 656e 6465 6e74 206e 756d -independent num │ │ │ +00132d60: 6265 7220 636f 6e76 6572 7369 6f6e 7320 ber conversions │ │ │ +00132d70: 2020 203c 2f74 643e 3c2f 7472 3e0a 3c74
    remove │ │ │ +00132e10: 7468 6520 7573 6520 6f66 206c 6f63 616c the use of local │ │ │ +00132e20: 6520 6675 6e63 7469 6f6e 7320 746f 2069 e functions to i │ │ │ +00132e30: 6d70 726f 7665 2070 6f72 7461 6269 6c69 mprove portabili │ │ │ +00132e40: 7479 2020 2020 3c2f 7464 3e3c 2f74 723e ty
    #WITH │ │ │ +00132ea0: 5f49 4e43 4c55 4445 5f58 4c4f 4341 4c45 _INCLUDE_XLOCALE │ │ │ +00132eb0: 5f48 3c2f 636f 6465 3e20 2020 3c2f 7464 _H force the inc │ │ │ +00132ef0: 6c75 7369 6f6e 206f 6620 3c63 6f64 653e lusion of │ │ │ +00132f00: 266c 743b 786c 6f63 616c 652e 6826 6774 <xlocale.h> │ │ │ +00132f10: 3b3c 2f63 6f64 653e 2074 6f20 6465 6669 ; to defi │ │ │ +00132f20: 6e65 203c 636f 6465 3e6c 6f63 616c 655f ne locale_ │ │ │ +00132f30: 743c 2f63 6f64 653e 2061 6e64 203c 636f t and _l fun │ │ │ +00132f50: 6374 696f 6e73 2c20 746f 2069 6d70 726f ctions, to impro │ │ │ +00132f60: 7665 2070 6f72 7461 6269 6c69 7479 2020 ve portability │ │ │ +00132f70: 2020 3c2f 7464 3e3c 2f74 723e 0a3c 7472
    #WI │ │ │ +001330a0: 5448 5f52 4550 4c41 4345 5f49 4c4c 4547 TH_REPLACE_ILLEG │ │ │ +001330b0: 414c 5f55 5446 383c 2f63 6f64 653e 2020 AL_UTF8 │ │ │ +001330c0: 203c 2f74 643e 3c74 6420 636c 6173 733d enable s │ │ │ +001330f0: 7472 6963 7420 5554 462d 382c 2072 6570 trict UTF-8, rep │ │ │ +00133100: 6c61 6365 7320 5554 462d 3820 636f 6e74 laces UTF-8 cont │ │ │ +00133110: 656e 7420 7468 6174 2069 7320 6f75 7473 ent that is outs │ │ │ +00133120: 6964 6520 7468 6520 616c 6c6f 7765 6420 ide the allowed │ │ │ +00133130: 7261 6e67 6520 7769 7468 2055 2b46 4646 range with U+FFF │ │ │ +00133140: 4420 2020 203c 2f74 643e 3c2f 7472 3e0a D
    #WITH_F │ │ │ +001331a0: 4153 5443 4749 3c2f 636f 6465 3e20 2020 ASTCGI │ │ │ +001331b0: 3c2f 7464 3e3c 7464 2063 6c61 7373 3d22 enables F │ │ │ +001331e0: 6173 7443 4749 2c20 7365 6520 5365 6374 astCGI, see Sect │ │ │ +001331f0: 696f 6e20 3c61 2063 6c61 7373 3d22 656c ion Fast │ │ │ +00133220: 4347 493c 2f61 3e20 2020 203c 2f74 643e CGI
    │ │ │ +00133280: 2357 4954 485f 4e4f 494f 3c2f 636f 6465 #WITH_NOIO remov │ │ │ +001332c0: 6573 2049 4f20 6f70 6572 6174 696f 6e73 es IO operations │ │ │ +001332d0: 2c20 746f 2065 6c69 6d69 6e61 7465 2074 , to eliminate t │ │ │ +001332e0: 6865 2075 7365 206f 6620 4253 4420 736f he use of BSD so │ │ │ +001332f0: 636b 6574 732c 2073 6565 2053 6563 7469 ckets, see Secti │ │ │ +00133300: 6f6e 203c 6120 636c 6173 733d 2265 6c22 on How to r │ │ │ +00133330: 656d 6f76 6520 7468 6520 4253 4420 736f emove the BSD so │ │ │ +00133340: 636b 6574 206c 6962 7261 7279 2072 6571 cket library req │ │ │ +00133350: 7569 7265 6d65 6e74 3c2f 613e 2020 2020 uirement │ │ │ +00133360: 3c2f 7464 3e3c 2f74 723e 0a3c 7472 2063
    #WITH_NOIDRE │ │ │ +001333c0: 463c 2f63 6f64 653e 2020 203c 2f74 643e F removes id and │ │ │ +00133400: 2068 7265 662f 7265 6620 6d75 6c74 692d href/ref multi- │ │ │ +00133410: 7265 6665 7265 6e63 6520 6461 7461 2c20 reference data, │ │ │ +00133420: 6d6f 7265 2061 6767 7265 7373 6976 6520 more aggressive │ │ │ +00133430: 7468 616e 2075 7369 6e67 2074 6865 203c than using the < │ │ │ +00133440: 636f 6465 3e23 534f 4150 5f58 4d4c 5f54 code>#SOAP_XML_T │ │ │ +00133450: 5245 453c 2f63 6f64 653e 2072 756e 7469 REE runti │ │ │ +00133460: 6d65 2066 6c61 6720 2020 203c 2f74 643e me flag
    │ │ │ +001334c0: 2357 4954 485f 4e4f 4854 5450 3c2f 636f #WITH_NOHTTP rem │ │ │ +00133500: 6f76 6573 2074 6865 2048 5454 5020 7374 oves the HTTP st │ │ │ +00133510: 6163 6b20 746f 2072 6564 7563 6520 636f ack to reduce co │ │ │ +00133520: 6465 2073 697a 6520 2020 203c 2f74 643e de size
    # │ │ │ +00133580: 5749 5448 5f4e 4f5a 4f4e 453c 2f63 6f64 WITH_NOZONE disa │ │ │ +001335c0: 626c 6573 2061 6e64 2069 676e 6f72 6573 bles and ignores │ │ │ +001335d0: 2074 6865 2074 696d 657a 6f6e 6520 696e the timezone in │ │ │ +001335e0: 203c 636f 6465 3e78 7364 3a64 6174 6554 xsd:dateT │ │ │ +001335f0: 696d 653c 2f63 6f64 653e 2076 616c 7565 ime value │ │ │ +00133600: 7320 2020 203c 2f74 643e 3c2f 7472 3e0a s
    #WITH_ │ │ │ +00133660: 4e4f 454d 5054 594e 414d 4553 5041 4345 NOEMPTYNAMESPACE │ │ │ +00133670: 533c 2f63 6f64 653e 2020 203c 2f74 643e S disables xmlns │ │ │ +001336b0: 3d22 2220 6465 6661 756c 7420 656d 7074 ="" default empt │ │ │ +001336c0: 7920 6e61 6d65 7370 6163 6573 2066 726f y namespaces fro │ │ │ +001336d0: 6d20 584d 4c20 6d65 7373 6167 6573 2020 m XML messages │ │ │ +001336e0: 2020 3c2f 7464 3e3c 2f74 723e 0a3c 7472
    insert │ │ │ +00133780: 7320 6120 6475 6d6d 7920 6d65 6d62 6572 s a dummy member │ │ │ +00133790: 2069 6e20 656d 7074 7920 7374 7275 6374 in empty struct │ │ │ +001337a0: 7320 746f 2061 6c6c 6f77 2063 6f6d 7069 s to allow compi │ │ │ +001337b0: 6c61 7469 6f6e 2020 2020 3c2f 7464 3e3c lation
    # │ │ │ +00133810: 5749 5448 5f4e 4f47 4c4f 4241 4c3c 2f63 WITH_NOGLOBAL om │ │ │ +00133850: 6974 2053 4f41 5020 4865 6164 6572 2061 it SOAP Header a │ │ │ +00133860: 6e64 2046 6175 6c74 2073 6572 6961 6c69 nd Fault seriali │ │ │ +00133870: 7a61 7469 6f6e 2063 6f64 652c 2070 7265 zation code, pre │ │ │ +00133880: 7665 6e74 7320 6475 706c 6963 6174 6520 vents duplicate │ │ │ +00133890: 6465 6669 6e69 7469 6f6e 7320 7769 7468 definitions with │ │ │ +001338a0: 2067 656e 6572 6174 6564 2073 6f61 7058 generated soapX │ │ │ +001338b0: 595a 4c69 6220 636f 6465 2020 2020 3c2f YZLib code
    #WITH_NONAMESP │ │ │ +00133920: 4143 4553 3c2f 636f 6465 3e20 2020 3c2f ACES disables de │ │ │ +00133960: 7065 6e64 656e 6365 206f 6e20 676c 6f62 pendence on glob │ │ │ +00133970: 616c 203c 636f 6465 3e6e 616d 6573 7061 al namespa │ │ │ +00133980: 6365 733c 2f63 6f64 653e 2074 6162 6c65 ces table │ │ │ +00133990: 2c20 6120 7461 626c 6520 6d75 7374 2062 , a table must b │ │ │ +001339a0: 6520 7365 7420 6578 706c 6963 6974 6c79 e set explicitly │ │ │ +001339b0: 2077 6974 6820 3c63 6f64 653e 3c61 2063 with soap │ │ │ +00133a80: 5f73 6574 5f6e 616d 6573 7061 6365 733c _set_namespaces< │ │ │ +00133a90: 2f61 3e3c 2f63 6f64 653e 2073 6565 2061 /a> see a │ │ │ +00133aa0: 6c73 6f20 5365 6374 696f 6e20 3c61 2063 lso Section XML namespac │ │ │ +00133ae0: 6573 2061 6e64 2074 6865 206e 616d 6573 es and the names │ │ │ +00133af0: 7061 6365 206d 6170 7069 6e67 2074 6162 pace mapping tab │ │ │ +00133b00: 6c65 3c2f 613e 2020 2020 3c2f 7464 3e3c le
    # │ │ │ +00133b60: 5749 5448 5f43 4441 5441 3c2f 636f 6465 WITH_CDATA retai │ │ │ +00133ba0: 6e73 2074 6865 2070 6172 7365 6420 4344 ns the parsed CD │ │ │ +00133bb0: 4154 4120 7365 6374 696f 6e73 2069 6e20 ATA sections in │ │ │ +00133bc0: 6c69 7465 7261 6c20 584d 4c20 7374 7269 literal XML stri │ │ │ +00133bd0: 6e67 7320 2020 203c 2f74 643e 3c2f 7472 ngs
    #WITH │ │ │ +00133c30: 5f50 5552 455f 5649 5254 5541 4c3c 2f63 _PURE_VIRTUAL en │ │ │ +00133c70: 6162 6c65 7320 432b 2b20 6162 7374 7261 ables C++ abstra │ │ │ +00133c80: 6374 2073 6572 7669 6365 2063 6c61 7373 ct service class │ │ │ +00133c90: 6573 2077 6974 6820 7075 7265 2076 6972 es with pure vir │ │ │ +00133ca0: 7475 616c 206d 6574 686f 6473 2c20 7265 tual methods, re │ │ │ +00133cb0: 7175 6972 6573 2073 6f61 7063 7070 3220 quires soapcpp2 │ │ │ +00133cc0: 6f70 7469 6f6e 203c 636f 6465 3e2d 693c option -i< │ │ │ +00133cd0: 2f63 6f64 653e 206f 7220 3c63 6f64 653e /code> or │ │ │ +00133ce0: 2d6a 3c2f 636f 6465 3e20 2020 203c 2f74 -j
    #WITH_DEFAULT_ │ │ │ +00133d50: 5649 5254 5541 4c3c 2f63 6f64 653e 2020 VIRTUAL │ │ │ +00133d60: 203c 2f74 643e 3c74 6420 636c 6173 733d enables │ │ │ +00133d90: 432b 2b20 6261 7365 2073 6572 7669 6365 C++ base service │ │ │ +00133da0: 2063 6c61 7373 6573 2077 6974 6820 6465 classes with de │ │ │ +00133db0: 6661 756c 7420 7669 7274 7561 6c20 6d65 fault virtual me │ │ │ +00133dc0: 7468 6f64 7320 7265 7475 726e 696e 6720 thods returning │ │ │ +00133dd0: 6661 756c 7420 3c63 6f64 653e 2353 4f41 fault #SOA │ │ │ +00133de0: 505f 4e4f 5f4d 4554 484f 443c 2f63 6f64 P_NO_METHOD, requires soa │ │ │ +00133e00: 7063 7070 3220 6f70 7469 6f6e 203c 636f pcpp2 option -i or │ │ │ +00133e20: 3c63 6f64 653e 2d6a 3c2f 636f 6465 3e20 -j │ │ │ +00133e30: 2020 203c 2f74 643e 3c2f 7472 3e0a 3c74
    #W │ │ │ +00133f50: 4954 485f 534f 434b 4554 5f43 4c4f 5345 ITH_SOCKET_CLOSE │ │ │ +00133f60: 5f4f 4e5f 4558 4954 3c2f 636f 6465 3e20 _ON_EXIT │ │ │ +00133f70: 2020 3c2f 7464 3e3c 7464 2063 6c61 7373 prevent │ │ │ +00133fa0: 7320 6120 7365 7276 6572 2070 6f72 7420 s a server port │ │ │ +00133fb0: 6672 6f6d 2073 7461 7969 6e67 2069 6e20 from staying in │ │ │ +00133fc0: 6c69 7374 656e 696e 6720 6d6f 6465 2061 listening mode a │ │ │ +00133fd0: 6674 6572 2065 7869 7420 6279 2069 6e74 fter exit by int │ │ │ +00133fe0: 6572 6e61 6c6c 7920 7365 7474 696e 6720 ernally setting │ │ │ +00133ff0: 3c63 6f64 653e 6663 6e74 6c28 736f 636b fcntl(sock │ │ │ +00134000: 2c20 465f 5345 5446 442c 2046 445f 434c , F_SETFD, FD_CL │ │ │ +00134010: 4f45 5845 4329 3c2f 636f 6465 3e20 2020 OEXEC) │ │ │ +00134020: 203c 2f74 643e 3c2f 7472 3e0a 3c74 7220
    < │ │ │ +00134070: 636f 6465 3e23 5749 5448 5f54 4350 4649 code>#WITH_TCPFI │ │ │ +00134080: 4e3c 2f63 6f64 653e 2020 203c 2f74 643e N enables TCP FI │ │ │ +001340c0: 4e20 6166 7465 7220 7365 6e64 7320 7768 N after sends wh │ │ │ +001340d0: 656e 2073 6f63 6b65 7420 6973 2072 6561 en socket is rea │ │ │ +001340e0: 6479 2074 6f20 636c 6f73 6520 2020 203c dy to close < │ │ │ +001340f0: 2f74 643e 3c2f 7472 3e0a 3c74 7220 636c /td>
    #WITH_SELF_P │ │ │ +00134150: 4950 453c 2f63 6f64 653e 2020 203c 2f74 IPE enables a "s │ │ │ +00134190: 656c 6620 7069 7065 2220 746f 2065 6e61 elf pipe" to ena │ │ │ +001341a0: 626c 6520 7468 6520 3c63 6f64 653e 3c61 ble the soap_close_ │ │ │ +00134250: 636f 6e6e 6563 7469 6f6e 3c2f 613e 3c2f connection function ( │ │ │ +00134270: 6753 4f41 5020 322e 382e 3731 206f 7220 gSOAP 2.8.71 or │ │ │ +00134280: 6772 6561 7465 7229 2020 203c 2f74 643e greater)
    .< │ │ │ +001342a0: 703e 5468 6520 666f 6c6c 6f77 696e 6720 p>The following │ │ │ +001342b0: 7375 6273 6574 206f 6620 6d61 6372 6f73 subset of macros │ │ │ +001342c0: 2061 7265 2064 6566 696e 6564 2069 6e20 are defined in │ │ │ +001342d0: 7468 6520 4150 4920 646f 6375 6d65 6e74 the API document │ │ │ +001342e0: 6174 696f 6e20 4d6f 6475 6c65 203c 6120 ation Module SOAP_M │ │ │ +00134320: 4143 524f 2063 6f6d 7069 6c65 2d74 696d ACRO compile-tim │ │ │ +00134330: 6520 7661 6c75 6573 3c2f 613e 2e20 5468 e values. Th │ │ │ +00134340: 6573 6520 6d61 6372 6f73 2061 7265 2075 ese macros are u │ │ │ +00134350: 7365 6420 746f 2065 6e61 626c 6520 6f72 sed to enable or │ │ │ +00134360: 2064 6973 6162 6c65 2066 6561 7475 7265 disable feature │ │ │ +00134370: 7320 6173 2073 7065 6369 6669 6564 2062 s as specified b │ │ │ +00134380: 656c 6f77 2c20 6279 2063 6f6d 7069 6c69 elow, by compili │ │ │ +00134390: 6e67 2073 6f75 7263 6520 636f 6465 2066 ng source code f │ │ │ +001343a0: 696c 6573 2077 6974 6820 636f 6d70 696c iles with compil │ │ │ +001343b0: 6572 206f 7074 696f 6e20 3c62 3e3c 636f er option -D │ │ │ +001343d0: 2074 6f20 7365 7420 7468 6520 6d61 6372 to set the macr │ │ │ +001343e0: 6f3a 3c2f 703e 0a3c 7461 626c 6520 636c o:

    ..... │ │ │ +001344f0: 3c74 6420 636c 6173 733d 226d 6172 6b64 .. │ │ │ +00134690: 3c2f 7472 3e0a 3c74 7220 636c 6173 733d ....< │ │ │ +00134770: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ +00134780: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ +00134790: 3e3c 636f 6465 3e23 534f 4150 5f54 4147 >#SOAP_TAG │ │ │ +001347a0: 4c45 4e3c 2f63 6f64 653e 2020 203c 2f74 LEN.. │ │ │ +00134890: 7468 6520 6d61 7869 6d75 6d20 6c65 6e67 the maximum leng │ │ │ +001348a0: 7468 206f 6620 7465 6d70 6f72 6172 7920 th of temporary │ │ │ +001348b0: 7374 7269 6e67 2076 616c 7565 732c 2073 string values, s │ │ │ +001348c0: 686f 7274 2073 7472 696e 6773 2061 6e64 hort strings and │ │ │ +001348d0: 2062 7269 6566 2065 7272 6f72 206d 6573 brief error mes │ │ │ +001348e0: 7361 6765 7320 2020 203c 2f74 643e 3c2f sages ..< │ │ │ +00134960: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ +00134970: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ +00134980: 3e74 6865 206d 6178 696d 756d 2073 697a >the maximum siz │ │ │ +00134990: 6520 6f66 2061 2062 6c6f 636b 206f 6620 e of a block of │ │ │ +001349a0: 6d65 6d6f 7279 2074 6861 7420 3c63 6f64 memory that malloc │ │ │ +001349c0: 6361 6e20 616c 6c6f 6361 7465 2020 2020 can allocate │ │ │ +001349d0: 3c2f 7464 3e3c 2f74 723e 0a3c 7472 2063 .... │ │ │ +00134b00: 3c63 6f64 653e 2353 4f41 505f 4d41 5844 #SOAP_MAXD │ │ │ +00134b10: 494d 4553 495a 453c 2f63 6f64 653e 2020 IMESIZE │ │ │ +00134b20: 203c 2f74 643e 3c74 6420 636c 6173 733d .. │ │ │ +00134bf0: 3c74 6420 636c 6173 733d 226d 6172 6b64 .. │ │ │ +00134d40: 3c2f 7472 3e0a 3c74 7220 636c 6173 733d .. │ │ │ +00134db0: 3c74 6420 636c 6173 733d 226d 6172 6b64 .... │ │ │ +00135030: 6d61 7869 6d75 6d20 584d 4c20 6e65 7374 maximum XML nest │ │ │ +00135040: 696e 6720 6465 7074 6820 6c65 7665 6c20 ing depth level │ │ │ +00135050: 7065 726d 6974 7465 6420 6279 2074 6865 permitted by the │ │ │ +00135060: 2058 4d4c 2070 6172 7365 7220 2020 203c XML parser < │ │ │ +00135070: 2f74 643e 3c2f 7472 3e0a 3c74 7220 636c /td>..< │ │ │ +00135190: 2f74 723e 0a3c 7472 2063 6c61 7373 3d22 /tr>....< │ │ │ +001352a0: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ +001352b0: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ +001352c0: 3e3c 636f 6465 3e23 534f 4150 5f50 5552 >#SOAP_PUR │ │ │ +001352d0: 455f 5649 5254 5541 4c3c 2f63 6f64 653e E_VIRTUAL │ │ │ +001352e0: 2020 203c 2f74 643e 3c74 6420 636c 6173 . │ │ │ +00135360: 3c74 7220 636c 6173 733d 226d 6172 6b64 │ │ │ +00135380: 0a3c 7464 2063 6c61 7373 3d22 6d61 726b ... │ │ │ +00135540: 3c2f 7472 3e0a 3c74 7220 636c 6173 733d ...... │ │ │ +001357f0: 3c2f 7472 3e0a 3c74 7220 636c 6173 733d ....
    Warning
    It is impor │ │ │ +00135a00: 7461 6e74 2074 6861 7420 616e 7920 6f66 tant that any of │ │ │ +00135a10: 2074 6865 7365 206d 6163 726f 7320 7768 these macros wh │ │ │ +00135a20: 656e 2064 6566 696e 6564 2073 686f 756c en defined shoul │ │ │ +00135a30: 6420 6265 2063 6f6e 7369 7374 656e 746c d be consistentl │ │ │ +00135a40: 7920 6465 6669 6e65 6420 7768 656e 2063 y defined when c │ │ │ +00135a50: 6f6d 7069 6c69 6e67 2073 6f75 7263 6520 ompiling source │ │ │ +00135a60: 636f 6465 2066 696c 6573 2c20 7375 6368 code files, such │ │ │ +00135a70: 2061 7320 3c65 6d3e 3c63 6f64 653e 6773 as gs │ │ │ +00135a80: 6f61 702f 7374 6473 6f61 7032 2e63 7070 oap/stdsoap2.cpp │ │ │ +00135a90: 3c2f 636f 6465 3e3c 2f65 6d3e 2c20 3c65 , soapC.cp │ │ │ +00135ab0: 703c 2f63 6f64 653e 3c2f 656d 3e2c 203c p, < │ │ │ +00135ac0: 656d 3e3c 636f 6465 3e73 6f61 7043 6c69 em>soapCli │ │ │ +00135ad0: 656e 742e 6370 703c 2f63 6f64 653e 3c2f ent.cpp, s │ │ │ +00135af0: 6f61 7053 6572 7665 722e 6370 703c 2f63 oapServer.cpp, and a │ │ │ +00135b10: 6c6c 2061 7070 6c69 6361 7469 6f6e 2073 ll application s │ │ │ +00135b20: 6f75 7263 6520 636f 6465 2066 696c 6573 ource code files │ │ │ +00135b30: 2074 6861 7420 696e 636c 7564 6520 3c65 that include gsoap/st │ │ │ +00135b50: 6473 6f61 7032 2e68 3c2f 636f 6465 3e3c dsoap2.h< │ │ │ +00135b60: 2f65 6d3e 206f 7220 3c65 6d3e 3c63 6f64 /em> or soapH.h │ │ │ +00135b80: 3c2f 656d 3e2e 2049 6620 7468 6520 6d61 . If the ma │ │ │ +00135b90: 6372 6f73 2061 7265 206e 6f74 2063 6f6e cros are not con │ │ │ +00135ba0: 7369 7374 656e 746c 7920 6465 6669 6e65 sistently define │ │ │ +00135bb0: 6420 6174 2063 6f6d 7069 6c65 2074 696d d at compile tim │ │ │ +00135bc0: 6520 7468 656e 2074 6865 2061 7070 6c69 e then the appli │ │ │ +00135bd0: 6361 7469 6f6e 2077 696c 6c20 6c69 6b65 cation will like │ │ │ +00135be0: 6c79 2063 7261 7368 2064 7565 2074 6f20 ly crash due to │ │ │ +00135bf0: 6120 6d69 736d 6174 6368 6573 2069 6e20 a mismatches in │ │ │ +00135c00: 7468 6520 6465 636c 6172 6174 696f 6e20 the declaration │ │ │ +00135c10: 616e 6420 7573 6520 6f66 2074 6865 203c and use of the < │ │ │ +00135c20: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soap │ │ │ +00135c80: 2063 6f6e 7465 7874 2074 6861 7420 6973 context that is │ │ │ +00135c90: 2063 7573 746f 6d69 7a65 6420 6279 2074 customized by t │ │ │ +00135ca0: 6865 7365 2066 6c61 6773 2e3c 2f64 643e hese flags.
    │ │ │ +00135cb0: 3c2f 646c 3e0a 3c70 3ef0 9f94 9d20 3c61
    .

    .... Back t │ │ │ +00135cd0: 6f20 7461 626c 6520 6f66 2063 6f6e 7465 o table of conte │ │ │ +00135ce0: 6e74 733c 2f61 3e3c 2f70 3e0a 3c68 323e nts

    .

    │ │ │ +00135cf0: 3c61 2063 6c61 7373 3d22 616e 6368 6f72 │ │ │ +00135d10: 3c2f 613e 0a55 7369 6e67 2074 6865 2073 .Using the s │ │ │ +00135d20: 6f61 7064 6566 732e 6820 6865 6164 6572 oapdefs.h header │ │ │ +00135d30: 2066 696c 653c 2f68 323e 0a3c 703e 5468 file

    .

    Th │ │ │ +00135d40: 6520 3c65 6d3e 3c63 6f64 653e 736f 6170 e soap │ │ │ +00135d50: 6465 6673 2e68 3c2f 636f 6465 3e3c 2f65 defs.h header file i │ │ │ +00135d70: 7320 696e 636c 7564 6564 2069 6e20 3c65 s included in gsoap/st │ │ │ +00135d90: 6473 6f61 7032 2e68 3c2f 636f 6465 3e3c dsoap2.h< │ │ │ +00135da0: 2f65 6d3e 2077 6865 6e20 636f 6d70 696c /em> when compil │ │ │ +00135db0: 696e 6720 7769 7468 2063 6f6d 7069 6c65 ing with compile │ │ │ +00135dc0: 2d74 696d 6520 666c 6167 203c 636f 6465 -time flag #WITH_SOAPDEFS_ │ │ │ +00135de0: 483c 2f63 6f64 653e 3a20 3c2f 703e 3c70 H:

    c++ -D WITH │ │ │ +00135e10: 5f53 4f41 5044 4546 535f 4820 2d63 2073 _SOAPDEFS_H -c s │ │ │ +00135e20: 7464 736f 6170 322e 6370 700a 3c2f 7072 tdsoap2.cpp.

    The soapdefs.h file │ │ │ +00135e60: 616c 6c6f 7773 2075 7365 7273 2074 6f20 allows users to │ │ │ +00135e70: 696e 636c 7564 6520 6465 6669 6e69 7469 include definiti │ │ │ +00135e80: 6f6e 7320 616e 6420 6164 6420 696e 636c ons and add incl │ │ │ +00135e90: 7564 6573 2077 6974 686f 7574 2072 6571 udes without req │ │ │ +00135ea0: 7569 7269 6e67 2063 6861 6e67 6573 2074 uiring changes t │ │ │ +00135eb0: 6f20 3c65 6d3e 3c63 6f64 653e 6773 6f61 o gsoa │ │ │ +00135ec0: 702f 7374 6473 6f61 7032 2e68 3c2f 636f p/stdsoap2.h. You ca │ │ │ +00135ee0: 6e20 616c 736f 2073 7065 6369 6679 2074 n also specify t │ │ │ +00135ef0: 6865 2068 6561 6465 7220 6669 6c65 206e he header file n │ │ │ +00135f00: 616d 6520 746f 2069 6e63 6c75 6465 2061 ame to include a │ │ │ +00135f10: 7320 6120 6d61 6372 6f20 3c63 6f64 653e s a macro │ │ │ +00135f20: 534f 4150 4445 4653 5f48 3c2f 636f 6465 SOAPDEFS_H to override th │ │ │ +00135f40: 6520 6e61 6d65 203c 656d 3e3c 636f 6465 e name soapdefs.h:

    c++ -D SOAPD │ │ │ +00135f90: 4546 535f 483d 6d79 6465 6673 2e68 202d EFS_H=mydefs.h - │ │ │ +00135fa0: 6320 7374 6473 6f61 7032 2e63 7070 0a3c c stdsoap2.cpp.< │ │ │ +00135fb0: 2f70 7265 3e3c 703e 2046 6f72 2065 7861 /pre>

    For exa │ │ │ +00135fc0: 6d70 6c65 2c3c 2f70 3e0a 3c64 6976 2063 mple,

    .
    │ │ │ +00135fe0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    // Conte │ │ │ +00136010: 6e74 7320 6f66 2066 696c 6520 2671 756f nts of file &quo │ │ │ +00136020: 743b 736f 6170 6465 6673 2e68 2671 756f t;soapdefs.h&quo │ │ │ +00136030: 743b 3c2f 7370 616e 3e3c 2f64 6976 3e0a t;
    . │ │ │ +00136040: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    #in │ │ │ +00136070: 636c 7564 6520 266c 743b 6f73 7472 6561 clude <ostrea │ │ │ +00136080: 6d26 6774 3b3c 2f73 7061 6e3e 203c 2f64 m> .

    Th │ │ │ +001360b0: 6520 666f 6c6c 6f77 696e 6720 6865 6164 e following head │ │ │ +001360c0: 6572 2066 696c 6520 666f 7220 736f 6170 er file for soap │ │ │ +001360d0: 6370 7032 2072 6566 6572 7320 746f 203c cpp2 refers to < │ │ │ +001360e0: 636f 6465 3e73 7464 3a3a 6f73 7472 6561 code>std::ostrea │ │ │ +001360f0: 6d3c 2f63 6f64 653e 2077 6974 686f 7574 m without │ │ │ +00136100: 2073 6f61 7063 7070 3220 7468 726f 7769 soapcpp2 throwi │ │ │ +00136110: 6e67 2065 7272 6f72 732c 2062 7920 7573 ng errors, by us │ │ │ +00136120: 696e 6720 3c63 6f64 653e 6578 7465 726e ing extern │ │ │ +00136130: 3c2f 636f 6465 3e20 746f 2064 6563 6c61 to decla │ │ │ +00136140: 7265 203c 636f 6465 3e63 6c61 7373 2073 re class s │ │ │ +00136150: 7464 3a3a 6f73 7472 6561 6d3c 2f63 6f64 td::ostream:

    .
    │ │ │ +00136190: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // std::os │ │ │ +001361b0: 7472 6561 6d20 6361 6e26 2333 393b 7420 tream can't │ │ │ +001361c0: 6265 2073 6572 6961 6c69 7a65 642c 2062 be serialized, b │ │ │ +001361d0: 7574 206e 6565 6420 746f 2062 6520 6465 ut need to be de │ │ │ +001361e0: 636c 6172 6564 2074 6f20 6d61 6b65 2069 clared to make i │ │ │ +001361f0: 7420 7669 7369 626c 6520 746f 2067 534f t visible to gSO │ │ │ +00136200: 4150 203c 2f73 7061 6e3e 3c2f 6469 763e AP
    │ │ │ +00136210: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    extern< │ │ │ +00136240: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> cla │ │ │ +00136260: 7373 203c 2f73 7061 6e3e 7374 643a 3a6f ss std::o │ │ │ +00136270: 7374 7265 616d 3b3c 2f64 6976 3e0a 3c64 stream;
    . │ │ │ +00136290: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    │ │ │ +001362c0: 636c 6173 7320 3c2f 7370 616e 3e6e 735f class ns_ │ │ │ +001362d0: 5f6d 7943 6c61 7373 203c 2f64 6976 3e0a _myClass
    . │ │ │ +001362e0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    { public │ │ │ +00136310: 3c2f 7370 616e 3e3a 3c2f 6469 763e 0a3c :
    .< │ │ │ +00136320: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +00136330: 3e20 2020 203c 7370 616e 2063 6c61 7373 > virtu │ │ │ +00136350: 616c 3c2f 7370 616e 3e20 3c73 7061 6e20 al void │ │ │ +00136380: 7072 696e 7428 7374 643a 3a6f 7374 7265 print(std::ostre │ │ │ +00136390: 616d 2026 616d 703b 7329 203c 7370 616e am &s) const; < │ │ │ +001363c0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ +001363d0: 656e 7422 3e2f 2f20 7765 206e 6565 6420 ent">// we need │ │ │ +001363e0: 7374 643a 3a6f 7374 7265 616d 2068 6572 std::ostream her │ │ │ +001363f0: 6520 3c2f 7370 616e 3e3c 2f64 6976 3e0a e . │ │ │ +00136400: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    ... │ │ │ +00136430: 2f2f 3c2f 7370 616e 3e3c 2f64 6976 3e0a //
    . │ │ │ +00136440: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    };
    .

    To initi │ │ │ +00138bf0: 616c 697a 6520 6120 7374 6163 6b2d 616c alize a stack-al │ │ │ +00138c00: 6c6f 6361 7465 6420 3c63 6f64 653e 3c61 located soap contex │ │ │ +00138c70: 7420 7769 7468 2069 6e70 7574 2061 6e64 t with input and │ │ │ +00138c80: 206f 7574 7075 7420 6d6f 6465 2066 6c61 output mode fla │ │ │ +00138c90: 6773 3a3c 2f70 3e0a 3c64 6976 2063 6c61 gs:

    .
    │ │ │ +00138cc0: 3c73 7061 6e20 636c 6173 733d 226b 6579 void soap_ │ │ │ +00138d40: 696e 6974 313c 2f61 3e28 3c73 7061 6e20 init1( │ │ │ +00138d60: 7374 7275 6374 3c2f 7370 616e 3e20 3c61 struct soap *< │ │ │ +00138da0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +00138db0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ +00138dc0: 6874 6d6c 223e 736f 6170 3c2f 613e 2c20 html">soap, │ │ │ +00138dd0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap_mode │ │ │ +00138e30: 2069 6f6d 6f64 6529 3b3c 2f64 6976 3e0a iomode);
    . │ │ │ +00138e40: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65

    To se │ │ │ +00139290: 7420 616e 6420 636c 6561 7220 6d6f 6465 t and clear mode │ │ │ +001392a0: 2066 6c61 6773 2075 7365 3a3c 2f70 3e0a flags use:

    . │ │ │ +001392b0: 3c64 6976 2063 6c61 7373 3d22 6672 6167
    void soap_set_mode │ │ │ +00139360: 3c2f 613e 283c 7370 616e 2063 6c61 7373 (struc │ │ │ +00139380: 743c 2f73 7061 6e3e 203c 6120 636c 6173 t │ │ │ +001393b0: 736f 6170 3c2f 613e 202a 3c61 2063 6c61 soap *soap, so │ │ │ +00139440: 6170 5f6d 6f64 653c 2f61 3e20 696f 6d6f ap_mode iomo │ │ │ +00139450: 6465 293b 203c 7370 616e 2063 6c61 7373 de); // se │ │ │ +00139470: 7420 696e 7075 7420 616e 6420 6f75 7470 t input and outp │ │ │ +00139480: 7574 206d 6f64 6520 666c 6167 733c 2f73 ut mode flags
    .
    void soap_set │ │ │ +00139530: 5f69 6d6f 6465 3c2f 613e 283c 7370 616e _imode(struct < │ │ │ +00139560: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +00139570: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ +00139580: 6874 6d6c 223e 736f 6170 3c2f 613e 202a html">soap * │ │ │ +00139590: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap, │ │ │ +001395c0: 203c 6120 636c 6173 733d 2263 6f64 6522 soap_mode imode │ │ │ +00139670: 3c2f 613e 293b 203c 7370 616e 2063 6c61 ); // │ │ │ +00139690: 7365 7420 696e 7075 7420 6d6f 6465 2066 set input mode f │ │ │ +001396a0: 6c61 6773 3c2f 7370 616e 3e3c 2f64 6976 lags
    ..
    void soap_clr_ │ │ │ +00139960: 6d6f 6465 3c2f 613e 283c 7370 616e 2063 mode(s │ │ │ +00139980: 7472 7563 743c 2f73 7061 6e3e 203c 6120 truct soap *soap, < │ │ │ +001399f0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +00139a00: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ +00139a10: 705f 5f66 6c61 6773 2e68 746d 6c23 6761 p__flags.html#ga │ │ │ +00139a20: 3732 6230 3439 3163 3963 6266 3230 3731 72b0491c9cbf2071 │ │ │ +00139a30: 6630 6339 3663 3764 3239 6237 3139 6262 f0c96c7d29b719bb │ │ │ +00139a40: 223e 736f 6170 5f6d 6f64 653c 2f61 3e20 ">soap_mode │ │ │ +00139a50: 696f 6d6f 6465 293b 203c 7370 616e 2063 iomode); / │ │ │ +00139a70: 2f20 636c 6561 7220 696e 7075 7420 616e / clear input an │ │ │ +00139a80: 6420 6f75 7470 7574 206d 6f64 6520 666c d output mode fl │ │ │ +00139a90: 6167 733c 2f73 7061 6e3e 3c2f 6469 763e ags
    │ │ │ +00139aa0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    voi │ │ │ +00139ad0: 643c 2f73 7061 6e3e 203c 6120 636c 6173 d so │ │ │ +00139b30: 6170 5f63 6c72 5f69 6d6f 6465 3c2f 613e ap_clr_imode │ │ │ +00139b40: 283c 7370 616e 2063 6c61 7373 3d22 6b65 (struct soap │ │ │ +00139b90: 3c2f 613e 202a 3c61 2063 6c61 7373 3d22 *soa │ │ │ +00139bc0: 703c 2f61 3e2c 203c 6120 636c 6173 733d p, soap_m │ │ │ +00139c20: 6f64 653c 2f61 3e20 3c61 2063 6c61 7373 ode imode); // clear inpu │ │ │ +00139ca0: 7420 6d6f 6465 2066 6c61 6773 3c2f 7370 t mode flags
    .
    void soap_clr_ │ │ │ +00139d50: 6f6d 6f64 653c 2f61 3e28 3c73 7061 6e20 omode( │ │ │ +00139d70: 7374 7275 6374 3c2f 7370 616e 3e20 3c61 struct soap *< │ │ │ +00139db0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +00139dc0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ +00139dd0: 6874 6d6c 223e 736f 6170 3c2f 613e 2c20 html">soap, │ │ │ +00139de0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap_mode │ │ │ +00139e40: 203c 6120 636c 6173 733d 2263 6f64 6522 omode< │ │ │ +00139e90: 2f61 3e29 3b20 3c73 7061 6e20 636c 6173 /a>); // c │ │ │ +00139eb0: 6c65 6172 206f 7574 7075 7420 6d6f 6465 lear output mode │ │ │ +00139ec0: 2066 6c61 6773 3c2f 7370 616e 3e3c 2f64 flags.
    │ │ │ +00139fb0: 766f 6964 2073 6f61 705f 636c 725f 6d6f void soap_clr_mo │ │ │ +00139fc0: 6465 2873 7472 7563 7420 736f 6170 202a de(struct soap * │ │ │ +00139fd0: 736f 6170 2c20 736f 6170 5f6d 6f64 6520 soap, soap_mode │ │ │ +00139fe0: 696e 7075 745f 616e 645f 6f75 7470 7574 input_and_output │ │ │ +00139ff0: 5f6d 6f64 6529 3c2f 6469 763e 3c64 6976 _mode)
    C │ │ │ +0013a010: 6c65 6172 2069 6e70 7574 2061 6e64 206f lear input and o │ │ │ +0013a020: 7574 7075 7420 736f 6170 5f6d 6f64 6520 utput soap_mode │ │ │ +0013a030: 666c 6167 7320 6f66 2074 6865 2067 6976 flags of the giv │ │ │ +0013a040: 656e 2073 6f61 7020 636f 6e74 6578 742e en soap context. │ │ │ +0013a050: 3c2f 6469 763e 3c2f 6469 763e 0a3c 6469
    .
    so │ │ │ +0013a110: 6170 5f63 6c72 5f69 6d6f 6465 3c2f 613e ap_clr_imode │ │ │ +0013a120: 3c2f 6469 763e 3c64 6976 2063 6c61 7373
    void s │ │ │ +0013a140: 6f61 705f 636c 725f 696d 6f64 6528 7374 oap_clr_imode(st │ │ │ +0013a150: 7275 6374 2073 6f61 7020 2a73 6f61 702c ruct soap *soap, │ │ │ +0013a160: 2073 6f61 705f 6d6f 6465 2069 6e70 7574 soap_mode input │ │ │ +0013a170: 5f6d 6f64 6529 3c2f 6469 763e 3c64 6976 _mode)
    C │ │ │ +0013a190: 6c65 6172 2069 6e70 7574 2073 6f61 705f lear input soap_ │ │ │ +0013a1a0: 6d6f 6465 2066 6c61 6773 206f 6620 7468 mode flags of th │ │ │ +0013a1b0: 6520 6769 7665 6e20 736f 6170 2063 6f6e e given soap con │ │ │ +0013a1c0: 7465 7874 2e3c 2f64 6976 3e3c 2f64 6976 text.
    .
    v │ │ │ +0013a2b0: 6f69 6420 736f 6170 5f63 6c72 5f6f 6d6f oid soap_clr_omo │ │ │ +0013a2c0: 6465 2873 7472 7563 7420 736f 6170 202a de(struct soap * │ │ │ +0013a2d0: 736f 6170 2c20 736f 6170 5f6d 6f64 6520 soap, soap_mode │ │ │ +0013a2e0: 6f75 7470 7574 5f6d 6f64 6529 3c2f 6469 output_mode)
    Clear outpu │ │ │ +0013a310: 7420 736f 6170 5f6d 6f64 6520 666c 6167 t soap_mode flag │ │ │ +0013a320: 7320 6f66 2074 6865 2067 6976 656e 2073 s of the given s │ │ │ +0013a330: 6f61 7020 636f 6e74 6578 742e 3c2f 6469 oap context.
    .
    soap_s │ │ │ +0013a400: 6574 5f69 6d6f 6465 3c2f 613e 3c2f 6469 et_imode
    void soap_ │ │ │ +0013a430: 7365 745f 696d 6f64 6528 7374 7275 6374 set_imode(struct │ │ │ +0013a440: 2073 6f61 7020 2a73 6f61 702c 2073 6f61 soap *soap, soa │ │ │ +0013a450: 705f 6d6f 6465 2069 6e70 7574 5f6d 6f64 p_mode input_mod │ │ │ +0013a460: 6529 3c2f 6469 763e 3c64 6976 2063 6c61 e)
    Set i │ │ │ +0013a480: 6e70 7574 2073 6f61 705f 6d6f 6465 2066 nput soap_mode f │ │ │ +0013a490: 6c61 6773 206f 6620 7468 6520 6769 7665 lags of the give │ │ │ +0013a4a0: 6e20 736f 6170 2063 6f6e 7465 7874 2e3c n soap context.< │ │ │ +0013a4b0: 2f64 6976 3e3c 2f64 6976 3e0a 3c64 6976 /div>
    .
    soa │ │ │ +0013a570: 705f 7365 745f 6f6d 6f64 653c 2f61 3e3c p_set_omode< │ │ │ +0013a580: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
    void so │ │ │ +0013a5a0: 6170 5f73 6574 5f6f 6d6f 6465 2873 7472 ap_set_omode(str │ │ │ +0013a5b0: 7563 7420 736f 6170 202a 736f 6170 2c20 uct soap *soap, │ │ │ +0013a5c0: 736f 6170 5f6d 6f64 6520 6f75 7470 7574 soap_mode output │ │ │ +0013a5d0: 5f6d 6f64 6529 3c2f 6469 763e 3c64 6976 _mode)
    S │ │ │ +0013a5f0: 6574 206f 7574 7075 7420 736f 6170 5f6d et output soap_m │ │ │ +0013a600: 6f64 6520 666c 6167 7320 6f66 2074 6865 ode flags of the │ │ │ +0013a610: 2067 6976 656e 2073 6f61 7020 636f 6e74 given soap cont │ │ │ +0013a620: 6578 742e 3c2f 6469 763e 3c2f 6469 763e ext.
    │ │ │ +0013a630: 0a3c 2f64 6976 3e3c 212d 2d20 6672 6167 .
    Note
    The #SOA │ │ │ +0013a680: 505f 584d 4c5f 5452 4545 3c2f 636f 6465 P_XML_TREE mode flag can │ │ │ +0013a6a0: 6265 2075 7365 6420 746f 2069 6d70 726f be used to impro │ │ │ +0013a6b0: 7665 2069 6e74 6572 6f70 6572 6162 696c ve interoperabil │ │ │ +0013a6c0: 6974 7920 7769 7468 2053 4f41 5020 696d ity with SOAP im │ │ │ +0013a6d0: 706c 656d 656e 7461 7469 6f6e 7320 7468 plementations th │ │ │ +0013a6e0: 6174 2061 7265 206e 6f74 2066 756c 6c79 at are not fully │ │ │ +0013a6f0: 2053 4f41 5020 312e 312f 312e 3220 5250 SOAP 1.1/1.2 RP │ │ │ +0013a700: 4320 656e 636f 6469 6e67 2063 6f6d 706c C encoding compl │ │ │ +0013a710: 6961 6e74 2077 6974 6820 7265 7370 6563 iant with respec │ │ │ +0013a720: 7420 746f 2070 726f 6365 7373 696e 6720 t to processing │ │ │ +0013a730: 6964 2d68 7265 662f 7265 6620 6174 7472 id-href/ref attr │ │ │ +0013a740: 6962 7574 6573 2e20 486f 7765 7665 722c ibutes. However, │ │ │ +0013a750: 2074 7265 6520 7365 7269 616c 697a 6174 tree serializat │ │ │ +0013a760: 696f 6e20 7769 6c6c 2064 7570 6c69 6361 ion will duplica │ │ │ +0013a770: 7465 2064 6174 6120 7768 656e 2074 6869 te data when thi │ │ │ +0013a780: 7320 6461 7461 2069 7320 636f 2d72 6566 s data is co-ref │ │ │ +0013a790: 6572 656e 6365 642e 2043 7963 6c65 7320 erenced. Cycles │ │ │ +0013a7a0: 6172 6520 6465 7465 6374 6564 2061 6e64 are detected and │ │ │ +0013a7b0: 2062 726f 6b65 6e20 746f 2061 766f 6964 broken to avoid │ │ │ +0013a7c0: 2069 6e66 696e 6974 6520 7365 7269 616c infinite serial │ │ │ +0013a7d0: 697a 6174 696f 6e2e 3c2f 6464 3e3c 2f64 ization..

    In additio │ │ │ +0013a7f0: 6e20 746f 2074 6865 2063 6f6e 7465 7874 n to the context │ │ │ +0013a800: 206d 6f64 6520 666c 6167 732c 2074 6865 mode flags, the │ │ │ +0013a810: 2066 6f6c 6c6f 7769 6e67 2063 6f6e 7465 following conte │ │ │ +0013a820: 7874 2066 6c61 6773 2063 616e 2062 6520 xt flags can be │ │ │ +0013a830: 7573 6564 2074 6f20 7365 7420 3c63 6f64 used to set setsockopt level │ │ │ +0013a860: 534f 4c5f 534f 434b 4554 3c2f 636f 6465 SOL_SOCKET options when s │ │ │ +0013a880: 6f63 6b65 7473 2061 7265 2063 7265 6174 ockets are creat │ │ │ +0013a890: 6564 2c20 7468 6f75 6768 2073 6f6d 6520 ed, though some │ │ │ +0013a8a0: 6f70 7469 6f6e 7320 6d61 7920 6e6f 7420 options may not │ │ │ +0013a8b0: 6265 2061 7070 6c69 6361 626c 6520 746f be applicable to │ │ │ +0013a8c0: 2079 6f75 7220 6f70 6572 6174 696e 6720 your operating │ │ │ +0013a8d0: 7379 7374 656d 3a3c 2f70 3e0a 3c74 6162 system:

    ..
    ... │ │ │ +0013a9e0: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 so │ │ │ +0013aaa0: 6170 3a3a 636f 6e6e 6563 745f 666c 6167 ap::connect_flag │ │ │ +0013aab0: 733c 2f61 3e3c 2f63 6f64 653e 203d 203c s = < │ │ │ +0013aac0: 636f 6465 3e53 4f5f 4e4f 5349 4750 4950 code>SO_NOSIGPIP │ │ │ +0013aad0: 453c 2f63 6f64 653e 2020 203c 2f74 643e E │ │ │ +0013aae0: 3c74 6420 636c 6173 733d 226d 6172 6b64 │ │ │ +0013ab20: 0a3c 7472 2063 6c61 7373 3d22 6d61 726b ... │ │ │ +0013ace0: 3c74 7220 636c 6173 733d 226d 6172 6b64 │ │ │ +0013ad00: 0a3c 7464 2063 6c61 7373 3d22 6d61 726b ..< │ │ │ +0013aea0: 7472 2063 6c61 7373 3d22 6d61 726b 646f tr class="markdo │ │ │ +0013aeb0: 776e 5461 626c 6552 6f77 4576 656e 223e wnTableRowEven"> │ │ │ +0013aec0: 0a3c 7464 2063 6c61 7373 3d22 6d61 726b . │ │ │ +0013afe0: 3c74 6420 636c 6173 733d 226d 6172 6b64 ...... │ │ │ +0013b5a0: 3c74 6420 636c 6173 733d 226d 6172 6b64 .< │ │ │ +0013b620: 7472 2063 6c61 7373 3d22 6d61 726b 646f tr class="markdo │ │ │ +0013b630: 776e 5461 626c 6552 6f77 4576 656e 223e wnTableRowEven"> │ │ │ +0013b640: 0a3c 7464 2063 6c61 7373 3d22 6d61 726b .< │ │ │ +0013b760: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ +0013b770: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ +0013b780: 3e73 6574 7320 7365 7276 6572 2d73 6964 >sets server-sid │ │ │ +0013b790: 6520 6c69 6e67 6572 2074 696d 6520 746f e linger time to │ │ │ +0013b7a0: 2074 6865 2076 616c 7565 206f 6620 3c63 the value of soap │ │ │ +0013b870: 3a3a 6c69 6e67 6572 5f74 696d 653c 2f61 ::linger_time .. │ │ │ +0013ba30: 3c2f 7472 3e0a 3c74 7220 636c 6173 733d .. │ │ │ +0013bbe0: 0a3c 7472 2063 6c61 7373 3d22 6d61 726b ....

    For exam │ │ │ +0013bd90: 706c 652c 2077 6865 6e20 3c63 6f64 653e ple, when │ │ │ +0013bda0: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap::ac │ │ │ +0013be60: 6365 7074 5f66 6c61 6773 3c2f 613e 3c2f cept_flags is set to │ │ │ +0013be80: 3c63 6f64 653e 2853 4f5f 4e4f 5349 4750 (SO_NOSIGP │ │ │ +0013be90: 4950 4520 7c20 534f 5f4c 494e 4745 5229 IPE | SO_LINGER) │ │ │ +0013bea0: 3c2f 636f 6465 3e20 7468 6973 2064 6973 this dis │ │ │ +0013beb0: 6162 6c65 7320 5349 4750 4950 4520 7369 ables SIGPIPE si │ │ │ +0013bec0: 676e 616c 7320 616e 6420 7365 7420 6c69 gnals and set li │ │ │ +0013bed0: 6e67 6572 2074 696d 6520 7661 6c75 6520 nger time value │ │ │ +0013bee0: 6769 7665 6e20 6279 203c 636f 6465 3e3c given by < │ │ │ +0013bef0: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ +0013bf00: 663d 2273 7472 7563 7473 6f61 702e 6874 f="structsoap.ht │ │ │ +0013bf10: 6d6c 2361 3066 3464 3032 3530 3533 6664 ml#a0f4d025053fd │ │ │ +0013bf20: 6537 3732 3136 6130 6361 3637 3430 3737 e77216a0ca674077 │ │ │ +0013bf30: 3139 3864 2220 7469 746c 653d 2255 7365 198d" title="Use │ │ │ +0013bf40: 722d 6465 6669 6e61 626c 6520 6c69 6e67 r-definable ling │ │ │ +0013bf50: 6572 2074 696d 6520 7661 6c75 652c 2072 er time value, r │ │ │ +0013bf60: 6571 7569 7265 7320 7468 6520 534f 5f4c equires the SO_L │ │ │ +0013bf70: 494e 4745 5220 7365 7473 6f63 6b6f 7074 INGER setsockopt │ │ │ +0013bf80: 2066 6c61 6720 7661 6c75 6520 746f 2062 flag value to b │ │ │ +0013bf90: 6520 6173 7369 676e 6564 2074 6f20 736f e assigned to so │ │ │ +0013bfa0: 6170 2e2e 2e22 3e73 6f61 703a 3a6c 696e ap...">soap::lin │ │ │ +0013bfb0: 6765 725f 7469 6d65 3c2f 613e 3c2f 636f ger_time, which is ze │ │ │ +0013bfd0: 726f 2062 7920 6465 6661 756c 742e 3c2f ro by default..

    The │ │ │ +0013bff0: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap::so │ │ │ +0013c0b0: 636b 6574 5f66 6c61 6773 3c2f 613e 3c2f cket_flags context fl │ │ │ +0013c0d0: 6167 2063 616e 2062 6520 7573 6564 2074 ag can be used t │ │ │ +0013c0e0: 6f20 7061 7373 206f 7074 696f 6e73 2074 o pass options t │ │ │ +0013c0f0: 6f20 7468 6520 3c63 6f64 653e 266c 743b o the < │ │ │ +0013c100: 7379 732f 736f 636b 6574 2e68 2667 743b sys/socket.h> │ │ │ +0013c110: 3c2f 636f 6465 3e20 3c63 6f64 653e 7365 se │ │ │ +0013c120: 6e64 3c2f 636f 6465 3e2c 203c 636f 6465 nd, sendto, │ │ │ +0013c140: 3c63 6f64 653e 7265 6376 3c2f 636f 6465 recv, and rec │ │ │ +0013c160: 7666 726f 6d3c 2f63 6f64 653e 2063 616c vfrom cal │ │ │ +0013c170: 6c73 206d 6164 6520 6279 2074 6865 2065 ls made by the e │ │ │ +0013c180: 6e67 696e 652c 2074 686f 7567 6820 736f ngine, though so │ │ │ +0013c190: 6d65 206f 7074 696f 6e73 206d 6179 206e me options may n │ │ │ +0013c1a0: 6f74 2062 6520 6170 706c 6963 6162 6c65 ot be applicable │ │ │ +0013c1b0: 2074 6f20 796f 7572 206f 7065 7261 7469 to your operati │ │ │ +0013c1c0: 6e67 2073 7973 7465 6d3a 3c2f 703e 0a3c ng system:

    .< │ │ │ +0013c1d0: 7461 626c 6520 636c 6173 733d 226d 6172 table class="mar │ │ │ +0013c1e0: 6b64 6f77 6e54 6162 6c65 223e 0a3c 7472 kdownTable">.
    ...< │ │ │ +0013c2b0: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ +0013c2c0: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ +0013c2d0: 3e3c 636f 6465 3e3c 6120 636c 6173 733d >s │ │ │ +0013c390: 6f61 703a 3a73 6f63 6b65 745f 666c 6167 oap::socket_flag │ │ │ +0013c3a0: 733c 2f61 3e3c 2f63 6f64 653e 203d 203c s = < │ │ │ +0013c3b0: 636f 6465 3e4d 5347 5f4e 4f53 4947 4e41 code>MSG_NOSIGNA │ │ │ +0013c3c0: 4c3c 2f63 6f64 653e 2020 203c 2f74 643e L │ │ │ +0013c3d0: 3c74 6420 636c 6173 733d 226d 6172 6b64 │ │ │ +0013c410: 0a3c 7472 2063 6c61 7373 3d22 6d61 726b .. │ │ │ +0013c5b0: 0a3c 2f74 6162 6c65 3e0a 3c70 3e46 7572 .
    define < │ │ │ +00134450: 2f74 683e 3c74 6820 636c 6173 733d 226d /th>result │ │ │ +00134480: 3c2f 7468 3e3c 2f74 723e 0a3c 7472 2063
    #SOAP_NOTHRO │ │ │ +001344e0: 573c 2f63 6f64 653e 2020 203c 2f74 643e W expands to (std::nothrow │ │ │ +00134530: 293c 2f63 6f64 653e 2074 6f20 7072 6576 ) to prev │ │ │ +00134540: 656e 7420 6d65 6d6f 7279 2061 6c6c 6f63 ent memory alloc │ │ │ +00134550: 6174 696f 6e20 6578 6365 7074 696f 6e73 ation exceptions │ │ │ +00134560: 2028 3c63 6f64 653e 2353 4f41 505f 454f (#SOAP_EO │ │ │ +00134570: 4d3c 2f63 6f64 653e 2069 7320 7573 6564 M is used │ │ │ +00134580: 2069 6e73 7465 6164 292c 2074 6869 7320 instead), this │ │ │ +00134590: 6d61 6372 6f20 6361 6e20 6265 2063 6861 macro can be cha │ │ │ +001345a0: 6e67 6564 2020 2020 3c2f 7464 3e3c 2f74 nged
    #SO │ │ │ +00134600: 4150 5f42 5546 4c45 4e3c 2f63 6f64 653e AP_BUFLEN │ │ │ +00134610: 2020 203c 2f74 643e 3c74 6420 636c 6173 the le │ │ │ +00134640: 6e67 7468 206f 6620 7468 6520 696e 7465 ngth of the inte │ │ │ +00134650: 726e 616c 206d 6573 7361 6765 2062 7566 rnal message buf │ │ │ +00134660: 6665 722c 2069 6d70 6163 7473 2063 6f6d fer, impacts com │ │ │ +00134670: 6d75 6e69 6361 7469 6f6e 7320 7065 7266 munications perf │ │ │ +00134680: 6f72 6d61 6e63 6520 2020 203c 2f74 643e ormance
    # │ │ │ +001346e0: 534f 4150 5f48 4452 4c45 4e3c 2f63 6f64 SOAP_HDRLEN the │ │ │ +00134720: 6d61 7869 6d75 6d20 6c65 6e67 7468 206f maximum length o │ │ │ +00134730: 6620 4854 5450 2068 6561 6465 7273 2020 f HTTP headers │ │ │ +00134740: 2020 3c2f 7464 3e3c 2f74 723e 0a3c 7472
    the maximum │ │ │ +001347e0: 6c65 6e67 7468 206f 6620 584d 4c20 7461 length of XML ta │ │ │ +001347f0: 6773 2061 6e64 2055 524c 7320 2020 203c gs and URLs < │ │ │ +00134800: 2f74 643e 3c2f 7472 3e0a 3c74 7220 636c /td>
    #SOAP_TMPLEN< │ │ │ +00134860: 2f63 6f64 653e 2020 203c 2f74 643e 3c74 /code>
    #S │ │ │ +00134940: 4f41 505f 4d41 5841 4c4c 4f43 5349 5a45 OAP_MAXALLOCSIZE │ │ │ +00134950: 3c2f 636f 6465 3e20 2020 3c2f 7464 3e3c
    #SOAP_MAXARR │ │ │ +00134a30: 4159 5349 5a45 3c2f 636f 6465 3e20 2020 AYSIZE │ │ │ +00134a40: 3c2f 7464 3e3c 7464 2063 6c61 7373 3d22 the maxim │ │ │ +00134a70: 756d 2061 6c6c 6f63 6174 696f 6e20 7468 um allocation th │ │ │ +00134a80: 7265 7368 6f6c 6420 746f 2070 7265 2d61 reshold to pre-a │ │ │ +00134a90: 6c6c 6f63 6174 6520 534f 4150 2061 7272 llocate SOAP arr │ │ │ +00134aa0: 6179 7320 696e 206d 656d 6f72 7920 2020 ays in memory │ │ │ +00134ab0: 203c 2f74 643e 3c2f 7472 3e0a 3c74 7220
    the maxi │ │ │ +00134b50: 6d75 6d20 4449 4d45 2061 7474 6163 686d mum DIME attachm │ │ │ +00134b60: 656e 7420 7369 7a65 2061 6c6c 6f77 6564 ent size allowed │ │ │ +00134b70: 2074 6f20 7265 6365 6976 6520 2020 203c to receive < │ │ │ +00134b80: 2f74 643e 3c2f 7472 3e0a 3c74 7220 636c /td>
    #SOAP_MAXEINT │ │ │ +00134be0: 523c 2f63 6f64 653e 2020 203c 2f74 643e R maximum number │ │ │ +00134c20: 206f 6620 4549 4e54 5220 696e 7465 7272 of EINTR interr │ │ │ +00134c30: 7570 7473 2074 6f20 6967 6e6f 7265 2077 upts to ignore w │ │ │ +00134c40: 6869 6c65 2070 6f6c 6c69 6e67 2061 2073 hile polling a s │ │ │ +00134c50: 6f63 6b65 7420 666f 7220 7065 6e64 696e ocket for pendin │ │ │ +00134c60: 6720 6163 7469 7669 7479 2020 2020 3c2f g activity
    #SOAP_MAXINFL │ │ │ +00134cd0: 4154 4553 495a 453c 2f63 6f64 653e 2020 ATESIZE │ │ │ +00134ce0: 203c 2f74 643e 3c74 6420 636c 6173 733d trusted │ │ │ +00134d10: 696e 666c 6174 6564 2063 6f6e 7465 6e74 inflated content │ │ │ +00134d20: 2073 697a 6520 2831 204d 4220 6279 2064 size (1 MB by d │ │ │ +00134d30: 6566 6175 6c74 2920 2020 203c 2f74 643e efault)
    # │ │ │ +00134d90: 534f 4150 5f4d 4158 4b45 4550 414c 4956 SOAP_MAXKEEPALIV │ │ │ +00134da0: 453c 2f63 6f64 653e 2020 203c 2f74 643e E maximum iterat │ │ │ +00134de0: 696f 6e73 2069 6e20 7468 6520 3c63 6f64 ions in the soap_serve< │ │ │ +00134e70: 2f63 6f64 653e 206c 6f6f 7020 6f6e 2048 /code> loop on H │ │ │ +00134e80: 5454 5020 6b65 6570 2d61 6c69 7665 2063 TTP keep-alive c │ │ │ +00134e90: 6f6e 6e65 6374 696f 6e73 2020 2020 3c2f onnections
    #SOAP_MAXLENG │ │ │ +00134f00: 5448 3c2f 636f 6465 3e20 2020 3c2f 7464 TH maximum strin │ │ │ +00134f40: 6720 636f 6e74 656e 7420 6c65 6e67 7468 g content length │ │ │ +00134f50: 2066 6f72 2073 7472 696e 6773 206e 6f74 for strings not │ │ │ +00134f60: 2061 6c72 6561 6479 2063 6f6e 7374 7261 already constra │ │ │ +00134f70: 696e 6564 2062 7920 584d 4c20 7363 6865 ined by XML sche │ │ │ +00134f80: 6d61 2076 616c 6964 6174 696f 6e20 636f ma validation co │ │ │ +00134f90: 6e73 7472 6169 6e74 7320 2020 203c 2f74 nstraints
    #SOAP_MAXLEVEL< │ │ │ +00135000: 2f63 6f64 653e 2020 203c 2f74 643e 3c74 /code>
    #SOAP_MAXOCC │ │ │ +001350d0: 5552 533c 2f63 6f64 653e 2020 203c 2f74 URS maximum numb │ │ │ +00135110: 6572 206f 6620 6172 7261 7920 6f72 2063 er of array or c │ │ │ +00135120: 6f6e 7461 696e 6572 2065 6c65 6d65 6e74 ontainer element │ │ │ +00135130: 7320 666f 7220 636f 6e74 6169 6e65 7273 s for containers │ │ │ +00135140: 2074 6861 7420 6172 6520 6e6f 7420 616c that are not al │ │ │ +00135150: 7265 6164 7920 636f 6e73 7472 6169 6e65 ready constraine │ │ │ +00135160: 6420 6279 2058 4d4c 2073 6368 656d 6120 d by XML schema │ │ │ +00135170: 7661 6c69 6461 7469 6f6e 2063 6f6e 7374 validation const │ │ │ +00135180: 7261 696e 7473 2020 2020 3c2f 7464 3e3c raints
    #S │ │ │ +001351e0: 4f41 505f 4d49 4e44 4546 4c41 5445 5241 OAP_MINDEFLATERA │ │ │ +001351f0: 5449 4f3c 2f63 6f64 653e 2020 203c 2f74 TIO trusted defl │ │ │ +00135230: 6174 696f 6e20 7261 7469 6f20 6166 7465 ation ratio afte │ │ │ +00135240: 7220 3c63 6f64 653e 2353 4f41 505f 4d41 r #SOAP_MA │ │ │ +00135250: 5849 4e46 4c41 5445 5349 5a45 3c2f 636f XINFLATESIZE is reached │ │ │ +00135270: 2020 3c2f 7464 3e3c 2f74 723e 0a3c 7472
    set to │ │ │ +00135310: 203c 636f 6465 3e3d 2030 3c2f 636f 6465 = 0 when #WI │ │ │ +00135330: 5448 5f50 5552 455f 5649 5254 5541 4c3c TH_PURE_VIRTUAL< │ │ │ +00135340: 2f63 6f64 653e 2069 7320 6465 6669 6e65 /code> is define │ │ │ +00135350: 6420 2020 203c 2f74 643e 3c2f 7472 3e0a d
    #SOAP_S │ │ │ +001353b0: 534c 5f52 5341 5f42 4954 533c 2f63 6f64 SL_RSA_BITS leng │ │ │ +001353f0: 7468 206f 6620 7468 6520 5253 4120 6b65 th of the RSA ke │ │ │ +00135400: 7920 2832 3034 3820 6279 2064 6566 6175 y (2048 by defau │ │ │ +00135410: 6c74 2920 2020 203c 2f74 643e 3c2f 7472 lt)
    #SOA │ │ │ +00135470: 505f 554e 4b4e 4f57 4e5f 4348 4152 3c2f P_UNKNOWN_CHAR a │ │ │ +001354b0: 6e20 3820 6269 7420 696e 7465 6765 7220 n 8 bit integer │ │ │ +001354c0: 7468 6174 2072 6570 7265 7365 6e74 7320 that represents │ │ │ +001354d0: 6120 6368 6172 6163 7465 7220 7468 6174 a character that │ │ │ +001354e0: 2063 6f75 6c64 206e 6f74 2062 6520 636f could not be co │ │ │ +001354f0: 6e76 6572 7465 6420 746f 2061 6e20 4153 nverted to an AS │ │ │ +00135500: 4349 4920 6368 6172 2c20 692e 652e 2077 CII char, i.e. w │ │ │ +00135510: 6865 6e20 636f 6e76 6572 7469 6e67 2061 hen converting a │ │ │ +00135520: 6e20 584d 4c20 556e 6963 6f64 6520 6368 n XML Unicode ch │ │ │ +00135530: 6172 6163 7465 7220 2020 203c 2f74 643e aracter
    # │ │ │ +00135590: 534f 4150 5f55 4e4b 4e4f 574e 5f55 4e49 SOAP_UNKNOWN_UNI │ │ │ +001355a0: 434f 4445 5f43 4841 523c 2f63 6f64 653e CODE_CHAR │ │ │ +001355b0: 2020 203c 2f74 643e 3c74 6420 636c 6173 intege │ │ │ +001355e0: 7220 556e 6963 6f64 6520 7661 6c75 6520 r Unicode value │ │ │ +001355f0: 7265 7072 6573 656e 7469 6e67 2061 2063 representing a c │ │ │ +00135600: 6861 7261 6374 6572 2074 6861 7420 7265 haracter that re │ │ │ +00135610: 706c 6163 6573 2061 6e20 696e 7661 6c69 places an invali │ │ │ +00135620: 6420 556e 6963 6f64 6520 636f 6465 2070 d Unicode code p │ │ │ +00135630: 6f69 6e74 2020 2020 3c2f 7464 3e3c 2f74 oint
    #SO │ │ │ +00135690: 4150 5f4c 4f4e 475f 464f 524d 4154 3c2f AP_LONG_FORMAT m │ │ │ +001356d0: 6163 726f 2074 6861 7420 7265 7072 6573 acro that repres │ │ │ +001356e0: 656e 7473 2074 6865 203c 636f 6465 3e23 ents the # │ │ │ +001356f0: 4c4f 4e47 3634 3c2f 636f 6465 3e20 7072 LONG64 pr │ │ │ +00135700: 696e 7466 2025 2d66 6f72 6d61 7420 2020 intf %-format │ │ │ +00135710: 203c 2f74 643e 3c2f 7472 3e0a 3c74 7220
    < │ │ │ +00135760: 636f 6465 3e23 534f 4150 5f55 4c4f 4e47 code>#SOAP_ULONG │ │ │ +00135770: 5f46 4f52 4d41 543c 2f63 6f64 653e 2020 _FORMAT │ │ │ +00135780: 203c 2f74 643e 3c74 6420 636c 6173 733d macro th │ │ │ +001357b0: 6174 2072 6570 7265 7365 6e74 7320 7468 at represents th │ │ │ +001357c0: 6520 3c63 6f64 653e 2355 4c4f 4e47 3634 e #ULONG64 │ │ │ +001357d0: 3c2f 636f 6465 3e20 7072 696e 7466 2025 printf % │ │ │ +001357e0: 2d66 6f72 6d61 7420 2020 203c 2f74 643e -format
    │ │ │ +00135840: 2353 4f41 505f 494e 5641 4c49 445f 534f #SOAP_INVALID_SO │ │ │ +00135850: 434b 4554 3c2f 636f 6465 3e20 2020 3c2f CKET portable in │ │ │ +00135890: 7661 6c69 6420 736f 636b 6574 2076 616c valid socket val │ │ │ +001358a0: 7565 2c20 6361 6e20 616c 736f 2075 7365 ue, can also use │ │ │ +001358b0: 203c 636f 6465 3e23 3c61 2063 6c61 7373 #soap_valid_ │ │ │ +00135970: 736f 636b 6574 2873 6f63 6b29 3c2f 613e socket(sock) │ │ │ +00135980: 3c2f 636f 6465 3e20 746f 2063 6865 636b to check │ │ │ +00135990: 2069 6620 3c63 6f64 653e 736f 636b 3c2f if sock is valid │ │ │ +001359b0: 203c 2f74 643e 3c2f 7472 3e0a 3c2f 7461
    conte │ │ │ +0013a940: 7874 2066 6c61 6720 7769 7468 2073 6574 xt flag with set │ │ │ +0013a950: 736f 636b 6f70 7420 6f70 7469 6f6e 2020 sockopt option │ │ │ +0013a960: 203c 2f74 683e 3c74 6820 636c 6173 733d result │ │ │ +0013a990: 2020 3c2f 7468 3e3c 2f74 723e 0a3c 7472
    disables SIGPI │ │ │ +0013ab10: 5045 2020 2020 3c2f 7464 3e3c 2f74 723e PE
    soap::connect │ │ │ +0013ac30: 5f66 6c61 6773 3c2f 613e 3c2f 636f 6465 _flags = SO_DEB │ │ │ +0013ac50: 5547 3c2f 636f 6465 3e20 2020 3c2f 7464 UG turns on reco │ │ │ +0013ac90: 7264 696e 6720 6f66 2064 6562 7567 6769 rding of debuggi │ │ │ +0013aca0: 6e67 2069 6e66 6f72 6d61 7469 6f6e 2069 ng information i │ │ │ +0013acb0: 6e20 7468 6520 756e 6465 726c 7969 6e67 n the underlying │ │ │ +0013acc0: 2070 726f 746f 636f 6c20 6d6f 6475 6c65 protocol module │ │ │ +0013acd0: 7320 2020 203c 2f74 643e 3c2f 7472 3e0a s
    soap::connect_f │ │ │ +0013adf0: 6c61 6773 3c2f 613e 3c2f 636f 6465 3e20 lags │ │ │ +0013ae00: 3d20 3c63 6f64 653e 534f 5f42 524f 4144 = SO_BROAD │ │ │ +0013ae10: 4341 5354 3c2f 636f 6465 3e20 2020 3c2f CAST permits sen │ │ │ +0013ae50: 6469 6e67 206f 6620 6272 6f61 6463 6173 ding of broadcas │ │ │ +0013ae60: 7420 6d65 7373 6167 6573 2c20 666f 7220 t messages, for │ │ │ +0013ae70: 6578 616d 706c 6520 7769 7468 2055 4450 example with UDP │ │ │ +0013ae80: 2c20 7768 656e 2070 6572 6d69 7474 6564 , when permitted │ │ │ +0013ae90: 2020 2020 3c2f 7464 3e3c 2f74 723e 0a3c
    soap::connect_f │ │ │ +0013afb0: 6c61 6773 3c2f 613e 3c2f 636f 6465 3e20 lags │ │ │ +0013afc0: 3d20 3c63 6f64 653e 534f 5f4c 494e 4745 = SO_LINGE │ │ │ +0013afd0: 523c 2f63 6f64 653e 2020 203c 2f74 643e R sets client-si │ │ │ +0013b010: 6465 206c 696e 6765 7220 7469 6d65 2074 de linger time t │ │ │ +0013b020: 6f20 7468 6520 7661 6c75 6520 6f66 203c o the value of < │ │ │ +0013b030: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soa │ │ │ +0013b0f0: 703a 3a6c 696e 6765 725f 7469 6d65 3c2f p::linger_time
    soap::c │ │ │ +0013b220: 6f6e 6e65 6374 5f66 6c61 6773 3c2f 613e onnect_flags │ │ │ +0013b230: 3c2f 636f 6465 3e20 3d20 3c63 6f64 653e = │ │ │ +0013b240: 534f 5f44 4f4e 5452 4f55 5445 3c2f 636f SO_DONTROUTE ena │ │ │ +0013b280: 626c 6573 2072 6f75 7469 6e67 2062 7970 bles routing byp │ │ │ +0013b290: 6173 7320 666f 7220 6f75 7467 6f69 6e67 ass for outgoing │ │ │ +0013b2a0: 206d 6573 7361 6765 7320 2020 203c 2f74 messages
    soap:: │ │ │ +0013b3c0: 6163 6365 7074 5f66 6c61 6773 3c2f 613e accept_flags │ │ │ +0013b3d0: 3c2f 636f 6465 3e20 3d20 3c63 6f64 653e = │ │ │ +0013b3e0: 534f 5f4e 4f53 4947 5049 5045 3c2f 636f SO_NOSIGPIPE dis │ │ │ +0013b420: 6162 6c65 7320 5349 4750 4950 4520 2863 ables SIGPIPE (c │ │ │ +0013b430: 6865 636b 2079 6f75 7220 4f53 2c20 7468 heck your OS, th │ │ │ +0013b440: 6973 2069 7320 6e6f 7420 706f 7274 6162 is is not portab │ │ │ +0013b450: 6c65 2920 2020 203c 2f74 643e 3c2f 7472 le)
    soap::accept_ │ │ │ +0013b570: 666c 6167 733c 2f61 3e3c 2f63 6f64 653e flags │ │ │ +0013b580: 203d 203c 636f 6465 3e53 4f5f 4445 4255 = SO_DEBU │ │ │ +0013b590: 473c 2f63 6f64 653e 2020 203c 2f74 643e G turns on recor │ │ │ +0013b5d0: 6469 6e67 206f 6620 6465 6275 6767 696e ding of debuggin │ │ │ +0013b5e0: 6720 696e 666f 726d 6174 696f 6e20 696e g information in │ │ │ +0013b5f0: 2074 6865 2075 6e64 6572 6c79 696e 6720 the underlying │ │ │ +0013b600: 7072 6f74 6f63 6f6c 206d 6f64 756c 6573 protocol modules │ │ │ +0013b610: 2020 2020 3c2f 7464 3e3c 2f74 723e 0a3c
    soap::accept_fl │ │ │ +0013b730: 6167 733c 2f61 3e3c 2f63 6f64 653e 203d ags = │ │ │ +0013b740: 203c 636f 6465 3e53 4f5f 4c49 4e47 4552 SO_LINGER │ │ │ +0013b750: 3c2f 636f 6465 3e20 2020 3c2f 7464 3e3c
    │ │ │ +0013b8e0: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap::ac │ │ │ +0013b9a0: 6365 7074 5f66 6c61 6773 3c2f 613e 3c2f cept_flags = SO │ │ │ +0013b9c0: 5f44 4f4e 5452 4f55 5445 3c2f 636f 6465 _DONTROUTE enabl │ │ │ +0013ba00: 6573 2072 6f75 7469 6e67 2062 7970 6173 es routing bypas │ │ │ +0013ba10: 7320 666f 7220 6f75 7467 6f69 6e67 206d s for outgoing m │ │ │ +0013ba20: 6573 7361 6765 7320 2020 203c 2f74 643e essages
    │ │ │ +0013ba80: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap::bi │ │ │ +0013bb40: 6e64 5f66 6c61 6773 3c2f 613e 3c2f 636f nd_flags = SO_R │ │ │ +0013bb60: 4555 5345 4144 4452 3c2f 636f 6465 3e20 EUSEADDR │ │ │ +0013bb70: 2020 3c2f 7464 3e3c 7464 2063 6c61 7373 enables │ │ │ +0013bba0: 206c 6f63 616c 2061 6464 7265 7373 2072 local address r │ │ │ +0013bbb0: 6575 7365 2069 6d6d 6564 6961 7465 6c79 euse immediately │ │ │ +0013bbc0: 2c20 7573 6520 7769 7468 2063 6175 7469 , use with cauti │ │ │ +0013bbd0: 6f6e 2020 2020 3c2f 7464 3e3c 2f74 723e on
    soap::bind_fla │ │ │ +0013bcf0: 6773 3c2f 613e 3c2f 636f 6465 3e20 3d20 gs = │ │ │ +0013bd00: 3c63 6f64 653e 534f 5f52 4555 5345 504f SO_REUSEPO │ │ │ +0013bd10: 5254 3c2f 636f 6465 3e20 2020 3c2f 7464 RT enables dupli │ │ │ +0013bd50: 6361 7465 2061 6464 7265 7373 2061 6e64 cate address and │ │ │ +0013bd60: 2070 6f72 7420 6269 6e64 696e 6773 2020 port bindings │ │ │ +0013bd70: 203c 2f74 643e 3c2f 7472 3e0a 3c2f 7461
    co │ │ │ +0013c230: 6e74 6578 7420 666c 6167 2077 6974 6820 ntext flag with │ │ │ +0013c240: 7365 6e74 2f72 6563 7620 666c 6167 7320 sent/recv flags │ │ │ +0013c250: 2020 3c2f 7468 3e3c 7468 2063 6c61 7373 result │ │ │ +0013c280: 2020 203c 2f74 683e 3c2f 7472 3e0a 3c74
    disables SIGPI │ │ │ +0013c400: 5045 2020 2020 3c2f 7464 3e3c 2f74 723e PE
    soap::socket_ │ │ │ +0013c520: 666c 6167 733c 2f61 3e3c 2f63 6f64 653e flags │ │ │ +0013c530: 203d 203c 636f 6465 3e4d 5347 5f44 4f4e = MSG_DON │ │ │ +0013c540: 5452 4f55 5445 3c2f 636f 6465 3e20 2020 TROUTE │ │ │ +0013c550: 3c2f 7464 3e3c 7464 2063 6c61 7373 3d22 enables r │ │ │ +0013c580: 6f75 7469 6e67 2062 7970 6173 7320 666f outing bypass fo │ │ │ +0013c590: 7220 6f75 7467 6f69 6e67 206d 6573 7361 r outgoing messa │ │ │ +0013c5a0: 6765 7320 2020 3c2f 7464 3e3c 2f74 723e ges
    .

    Fur │ │ │ +0013c5c0: 7468 6572 6d6f 7265 2c20 7468 6520 3c63 thermore, the setsockopt level SOL_SOCKET options SO_SNDBUF and SO_ │ │ │ +0013c630: 5243 5642 5546 3c2f 636f 6465 3e20 6172 RCVBUF ar │ │ │ +0013c640: 6520 7365 7420 7468 6520 656e 6769 6e65 e set the engine │ │ │ +0013c650: 2077 6865 6e20 3c63 6f64 653e 3c61 2063 when soap::sndbuf< │ │ │ +0013c710: 2f61 3e3c 2f63 6f64 653e 2061 6e64 203c /a> and < │ │ │ +0013c720: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soap │ │ │ +0013c7d0: 3a3a 7263 7662 7566 3c2f 613e 3c2f 636f ::rcvbuf are set to a │ │ │ +0013c7f0: 206e 6f6e 7a65 726f 2076 616c 7565 2e20 nonzero value. │ │ │ +0013c800: 5468 6520 6465 6661 756c 7420 7661 6c75 The default valu │ │ │ +0013c810: 6520 6973 203c 636f 6465 3e23 534f 4150 e is #SOAP │ │ │ +0013c820: 5f42 5546 4c45 4e3c 2f63 6f64 653e 2c20 _BUFLEN, │ │ │ +0013c830: 7768 6963 6820 6973 2074 6865 2073 616d which is the sam │ │ │ +0013c840: 6520 7369 7a65 2075 7365 6420 6279 2074 e size used by t │ │ │ +0013c850: 6865 2069 6e74 6572 6e61 6c20 6275 6666 he internal buff │ │ │ +0013c860: 6572 203c 636f 6465 3e3c 6120 636c 6173 er soap::buf to send an │ │ │ +0013c940: 6420 7265 6365 6976 6520 6d65 7373 6167 d receive messag │ │ │ +0013c950: 6573 2e20 4120 7a65 726f 2076 616c 7565 es. A zero value │ │ │ +0013c960: 206f 6d69 7473 2074 6865 2069 6e74 6572 omits the inter │ │ │ +0013c970: 6e61 6c20 3c63 6f64 653e 7365 7473 6f63 nal setsoc │ │ │ +0013c980: 6b6f 7074 3c2f 636f 6465 3e20 6361 6c6c kopt call │ │ │ +0013c990: 2074 6f20 7365 7420 7468 6573 6520 6f70 to set these op │ │ │ +0013c9a0: 7469 6f6e 732e 2053 6574 7469 6e67 2074 tions. Setting t │ │ │ +0013c9b0: 6865 7365 2076 616c 7565 7320 746f 207a hese values to z │ │ │ +0013c9c0: 6572 6f20 6163 7469 7661 7465 7320 6175 ero activates au │ │ │ +0013c9d0: 746f 2d74 756e 696e 6720 7769 7468 204c to-tuning with L │ │ │ +0013c9e0: 696e 7578 2032 2e34 2061 6e64 2067 7265 inux 2.4 and gre │ │ │ +0013c9f0: 6174 6572 2e3c 2f70 3e0a 3c70 3e54 6865 ater.

    .

    The │ │ │ +0013ca00: 203c 636f 6465 3e73 6574 736f 636b 6f70 setsockop │ │ │ +0013ca10: 743c 2f63 6f64 653e 206c 6576 656c 203c t level < │ │ │ +0013ca20: 636f 6465 3e53 4f4c 5f53 4f43 4b45 543c code>SOL_SOCKET< │ │ │ +0013ca30: 2f63 6f64 653e 206f 7074 696f 6e20 3c63 /code> option SO_KEEPALIVE │ │ │ +0013ca50: 3c2f 636f 6465 3e20 6973 2073 6574 2077 is set w │ │ │ +0013ca60: 6865 6e20 6b65 6570 2d61 6c69 7665 2069 hen keep-alive i │ │ │ +0013ca70: 7320 656e 6162 6c65 6420 7769 7468 2063 s enabled with c │ │ │ +0013ca80: 6f6e 7465 7874 2066 6c61 6720 3c63 6f64 ontext flag #SOAP_IO_KEEPA │ │ │ +0013caa0: 4c49 5645 3c2f 636f 6465 3e20 6f72 2077 LIVE or w │ │ │ +0013cab0: 6865 6e20 3c63 6f64 653e 3c61 2063 6c61 hen soap::tcp_keep │ │ │ +0013cb80: 5f61 6c69 7665 3c2f 613e 3c2f 636f 6465 _alive is nonzero. Wi │ │ │ +0013cba0: 7468 203c 636f 6465 3e3c 6120 636c 6173 th soap::tcp_keep_ │ │ │ +0013cc70: 616c 6976 653c 2f61 3e3c 2f63 6f64 653e alive │ │ │ +0013cc80: 2061 6464 6974 696f 6e61 6c20 6f70 7469 additional opti │ │ │ +0013cc90: 6f6e 7320 6361 6e20 6265 2073 7065 6369 ons can be speci │ │ │ +0013cca0: 6669 6564 2077 6974 6820 3c63 6f64 653e fied with │ │ │ +0013ccb0: 3c61 2063 6c61 7373 3d22 656c 2220 6872 s │ │ │ +0013cd50: 6f61 703a 3a74 6370 5f6b 6565 705f 6964 oap::tcp_keep_id │ │ │ +0013cd60: 6c65 3c2f 613e 3c2f 636f 6465 3e2c 203c le, < │ │ │ +0013cd70: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soap::tcp_k │ │ │ +0013ce20: 6565 705f 696e 7476 6c3c 2f61 3e3c 2f63 eep_intvl, and │ │ │ +0013ce40: 3c61 2063 6c61 7373 3d22 656c 2220 6872 so │ │ │ +0013cee0: 6170 3a3a 7463 705f 6b65 6570 5f63 6e74 ap::tcp_keep_cnt │ │ │ +0013cef0: 3c2f 613e 3c2f 636f 6465 3e2e 2046 6f72 . For │ │ │ +0013cf00: 2065 7861 6d70 6c65 3a3c 2f70 3e0a 3c64 example:

    .
    stru │ │ │ +0013cf50: 6374 203c 2f73 7061 6e3e 3c61 2063 6c61 ct soap *soap = soap_new() │ │ │ +0013d020: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
    .
    soap->tcp_keep_ │ │ │ +0013d0c0: 616c 6976 653c 2f61 3e20 3d20 313b 2020 alive = 1; │ │ │ +0013d0d0: 203c 7370 616e 2063 6c61 7373 3d22 636f // setsoc │ │ │ +0013d0f0: 6b6f 7074 2053 4f5f 4b45 4550 414c 4956 kopt SO_KEEPALIV │ │ │ +0013d100: 453c 2f73 7061 6e3e 3c2f 6469 763e 0a3c E
    .< │ │ │ +0013d110: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +0013d120: 3e3c 6120 636c 6173 733d 2263 6f64 6522 >soap │ │ │ +0013d150: 2d26 6774 3b3c 6120 636c 6173 733d 2263 ->tc │ │ │ +0013d1a0: 705f 6b65 6570 5f69 646c 653c 2f61 3e20 p_keep_idle │ │ │ +0013d1b0: 3d20 3330 3b20 2020 3c73 7061 6e20 636c = 30; // │ │ │ +0013d1d0: 2074 696d 6520 696e 2073 6563 6f6e 6473 time in seconds │ │ │ +0013d1e0: 2074 6865 2063 6f6e 6e65 6374 696f 6e20 the connection │ │ │ +0013d1f0: 6e65 6564 7320 746f 2072 656d 6169 6e20 needs to remain │ │ │ +0013d200: 6964 6c65 2062 6566 6f72 6520 5443 5020 idle before TCP │ │ │ +0013d210: 7374 6172 7473 2073 656e 6469 6e67 206b starts sending k │ │ │ +0013d220: 6565 7061 6c69 7665 2070 726f 6265 733c eepalive probes< │ │ │ +0013d230: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    .< │ │ │ +0013d250: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +0013d260: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ +0013d270: 6874 6d6c 223e 736f 6170 3c2f 613e 2d26 html">soap-& │ │ │ +0013d280: 6774 3b3c 6120 636c 6173 733d 2263 6f64 gt;tcp_ │ │ │ +0013d2d0: 6b65 6570 5f69 6e74 766c 3c2f 613e 203d keep_intvl = │ │ │ +0013d2e0: 2031 3230 3b20 3c73 7061 6e20 636c 6173 120; // t │ │ │ +0013d300: 696d 6520 696e 2073 6563 6f6e 6473 2062 ime in seconds b │ │ │ +0013d310: 6574 7765 656e 2069 6e64 6976 6964 7561 etween individua │ │ │ +0013d320: 6c20 6b65 6570 616c 6976 6520 7072 6f62 l keepalive prob │ │ │ +0013d330: 6573 3c2f 7370 616e 3e3c 2f64 6976 3e0a es

    . │ │ │ +0013d340: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    soap->t │ │ │ +0013d3d0: 6370 5f6b 6565 705f 636e 743c 2f61 3e20 cp_keep_cnt │ │ │ +0013d3e0: 3d20 353b 2020 2020 203c 7370 616e 2063 = 5; / │ │ │ +0013d400: 2f20 6d61 7869 6d75 6d20 6e75 6d62 6572 / maximum number │ │ │ +0013d410: 206f 6620 6b65 6570 616c 6976 6520 7072 of keepalive pr │ │ │ +0013d420: 6f62 6573 2054 4350 2073 686f 756c 6420 obes TCP should │ │ │ +0013d430: 7365 6e64 2062 6566 6f72 6520 6472 6f70 send before drop │ │ │ +0013d440: 7069 6e67 2074 6865 2063 6f6e 6e65 6374 ping the connect │ │ │ +0013d450: 696f 6e3c 2f73 7061 6e3e 3c2f 6469 763e ion
    │ │ │ +0013d460: 0a3c 6469 7620 636c 6173 733d 2274 7463 .
    soap:: │ │ │ +0013d500: 7463 705f 6b65 6570 5f63 6e74 3c2f 613e tcp_keep_cnt │ │ │ +0013d510: 3c2f 6469 763e 3c64 6976 2063 6c61 7373
    unsign │ │ │ +0013d530: 6564 2069 6e74 2074 6370 5f6b 6565 705f ed int tcp_keep_ │ │ │ +0013d540: 636e 743c 2f64 6976 3e3c 6469 7620 636c cnt
    User │ │ │ +0013d560: 2d64 6566 696e 6162 6c65 2076 616c 7565 -definable value │ │ │ +0013d570: 2074 6f20 7365 7420 5443 505f 4b45 4550 to set TCP_KEEP │ │ │ +0013d580: 434e 5420 7365 7473 6f63 6b6f 7074 2028 CNT setsockopt ( │ │ │ +0013d590: 7468 6520 7661 6c75 6520 6973 2030 2062 the value is 0 b │ │ │ +0013d5a0: 7920 6465 6661 756c 7429 3c2f 6469 763e y default)
    │ │ │ +0013d5b0: 3c64 6976 2063 6c61 7373 3d22 7474 6465
    Definition │ │ │ +0013d5d0: 3a3c 2f62 3e20 7374 6473 6f61 7032 2e68 : stdsoap2.h │ │ │ +0013d5e0: 3a33 3538 343c 2f64 6976 3e3c 2f64 6976 :3584
    .
    < │ │ │ +0013d650: 6120 6872 6566 3d22 7374 7275 6374 736f a href="structso │ │ │ +0013d660: 6170 2e68 746d 6c23 6138 3232 6162 6133 ap.html#a822aba3 │ │ │ +0013d670: 6537 6165 3734 6661 3836 3237 3763 3638 e7ae74fa86277c68 │ │ │ +0013d680: 3335 3639 6638 3061 6522 3e73 6f61 703a 3569f80ae">soap: │ │ │ +0013d690: 3a74 6370 5f6b 6565 705f 696e 7476 6c3c :tcp_keep_intvl< │ │ │ +0013d6a0: 2f61 3e3c 2f64 6976 3e3c 6469 7620 636c /a>
    uns │ │ │ +0013d6c0: 6967 6e65 6420 696e 7420 7463 705f 6b65 igned int tcp_ke │ │ │ +0013d6d0: 6570 5f69 6e74 766c 3c2f 6469 763e 3c64 ep_intvl
    User-definable │ │ │ +0013d700: 7661 6c75 6520 746f 2073 6574 2054 4350 value to set TCP │ │ │ +0013d710: 5f4b 4545 5049 4e54 564c 2073 6574 736f _KEEPINTVL setso │ │ │ +0013d720: 636b 6f70 7420 2874 6865 2076 616c 7565 ckopt (the value │ │ │ +0013d730: 2069 7320 3020 6279 2064 6566 6175 6c74 is 0 by default │ │ │ +0013d740: 293c 2f64 6976 3e3c 6469 7620 636c 6173 )
    Def │ │ │ +0013d760: 696e 6974 696f 6e3a 3c2f 623e 2073 7464 inition: std │ │ │ +0013d770: 736f 6170 322e 683a 3335 3539 3c2f 6469 soap2.h:3559
    .
    < │ │ │ +0013d840: 6469 7620 636c 6173 733d 2274 7464 6563 div class="ttdec │ │ │ +0013d850: 6922 3e75 6e73 6967 6e65 6420 696e 7420 i">unsigned int │ │ │ +0013d860: 7463 705f 6b65 6570 5f69 646c 653c 2f64 tcp_keep_idle
    User-defin │ │ │ +0013d890: 6162 6c65 2076 616c 7565 2074 6f20 7365 able value to se │ │ │ +0013d8a0: 7420 5443 505f 4b45 4550 4944 4c45 2073 t TCP_KEEPIDLE s │ │ │ +0013d8b0: 6574 736f 636b 6f70 7420 2874 6865 2076 etsockopt (the v │ │ │ +0013d8c0: 616c 7565 2069 7320 3020 6279 2064 6566 alue is 0 by def │ │ │ +0013d8d0: 6175 6c74 293c 2f64 6976 3e3c 6469 7620 ault)
    Definition: │ │ │ +0013d900: 2073 7464 736f 6170 322e 683a 3335 3334 stdsoap2.h:3534 │ │ │ +0013d910: 3c2f 6469 763e 3c2f 6469 763e 0a3c 6469
    .
    soap::tcp_ │ │ │ +0013d9c0: 6b65 6570 5f61 6c69 7665 3c2f 613e 3c2f keep_alive
    int tcp_ │ │ │ +0013d9f0: 6b65 6570 5f61 6c69 7665 3c2f 6469 763e keep_alive
    │ │ │ +0013da00: 3c64 6976 2063 6c61 7373 3d22 7474 646f
    User-definabl │ │ │ +0013da20: 6520 7661 6c75 6520 746f 2073 6574 2053 e value to set S │ │ │ +0013da30: 4f5f 4b45 4550 414c 4956 4520 7365 7473 O_KEEPALIVE sets │ │ │ +0013da40: 6f63 6b6f 7074 2028 3020 6279 2064 6566 ockopt (0 by def │ │ │ +0013da50: 6175 6c74 2075 6e6c 6573 7320 7468 6520 ault unless the │ │ │ +0013da60: 2353 4f41 505f 494f 5f4b 4545 5041 4c49 #SOAP_IO_KEEPALI │ │ │ +0013da70: 5645 206d 6f64 6520 2e2e 2e3c 2f64 6976 VE mode ...
    Definitio │ │ │ +0013daa0: 6e3a 3c2f 623e 2073 7464 736f 6170 322e n: stdsoap2. │ │ │ +0013dab0: 683a 3335 3039 3c2f 6469 763e 3c2f 6469 h:3509
    .

    For │ │ │ +0013dae0: 2055 4450 206d 6573 7361 6769 6e67 2c20 UDP messaging, │ │ │ +0013daf0: 7573 6520 3c63 6f64 653e 2353 4f41 505f use #SOAP_ │ │ │ +0013db00: 494f 5f55 4450 3c2f 636f 6465 3e2e 2053 IO_UDP. S │ │ │ +0013db10: 6565 2061 6c73 6f20 5365 6374 696f 6e20 ee also Section │ │ │ +0013db20: 3c61 2063 6c61 7373 3d22 656c 2220 6872 SOAP/XML ove │ │ │ +0013db50: 7220 5544 503c 2f61 3e2e 2054 6865 2063 r UDP. The c │ │ │ +0013db60: 6f6e 7465 7874 2066 6c61 6773 2074 6861 ontext flags tha │ │ │ +0013db70: 7420 6361 6e20 6265 2073 6574 2061 7420 t can be set at │ │ │ +0013db80: 7468 6520 636c 6965 6e74 2073 6964 6520 the client side │ │ │ +0013db90: 666f 7220 5544 5020 6d65 7373 6167 696e for UDP messagin │ │ │ +0013dba0: 6720 6172 6520 3c63 6f64 653e 3c61 2063 g are soap::ipv4_ │ │ │ +0013dc60: 6d75 6c74 6963 6173 745f 6966 3c2f 613e multicast_if │ │ │ +0013dc70: 3c2f 636f 6465 3e2c 203c 636f 6465 3e3c , < │ │ │ +0013dc80: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ +0013dc90: 663d 2273 7472 7563 7473 6f61 702e 6874 f="structsoap.ht │ │ │ +0013dca0: 6d6c 2361 6135 6661 6137 3633 3034 3235 ml#aa5faa7630425 │ │ │ +0013dcb0: 6138 6162 3830 3138 6630 6232 6434 6430 a8ab8018f0b2d4d0 │ │ │ +0013dcc0: 6331 3864 2220 7469 746c 653d 2255 7365 c18d" title="Use │ │ │ +0013dcd0: 722d 6465 6669 6e61 626c 6520 7661 6c75 r-definable valu │ │ │ +0013dce0: 6520 746f 2073 6574 2073 6574 736f 636b e to set setsock │ │ │ +0013dcf0: 6f70 7420 6c65 7665 6c20 4950 5052 4f54 opt level IPPROT │ │ │ +0013dd00: 4f5f 4950 2074 6f20 4950 5f4d 554c 5449 O_IP to IP_MULTI │ │ │ +0013dd10: 4341 5354 5f54 544c 2077 6865 6e20 6e6f CAST_TTL when no │ │ │ +0013dd20: 6e7a 6572 6f2e 223e 736f 6170 3a3a 6970 nzero.">soap::ip │ │ │ +0013dd30: 7634 5f6d 756c 7469 6361 7374 5f74 746c v4_multicast_ttl │ │ │ +0013dd40: 3c2f 613e 3c2f 636f 6465 3e2c 2061 6e64 , and │ │ │ +0013dd50: 203c 636f 6465 3e3c 6120 636c 6173 733d soap │ │ │ +0013ddf0: 3a3a 6970 7636 5f6d 756c 7469 6361 7374 ::ipv6_multicast │ │ │ +0013de00: 5f69 663c 2f61 3e3c 2f63 6f64 653e 3a3c _if:< │ │ │ +0013de10: 2f70 3e0a 3c74 6162 6c65 2063 6c61 7373 /p>.. │ │ │ +0013de50: 0a3c 7468 2063 6c61 7373 3d22 6d61 726b ...< │ │ │ +0013dee0: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ +0013def0: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ +0013df00: 3e3c 636f 6465 3e3c 6120 636c 6173 733d > │ │ │ +0013dfb0: 736f 6170 3a3a 6970 7634 5f6d 756c 7469 soap::ipv4_multi │ │ │ +0013dfc0: 6361 7374 5f69 663c 2f61 3e3c 2f63 6f64 cast_if .< │ │ │ +0013e150: 7472 2063 6c61 7373 3d22 6d61 726b 646f tr class="markdo │ │ │ +0013e160: 776e 5461 626c 6552 6f77 4576 656e 223e wnTableRowEven"> │ │ │ +0013e170: 0a3c 7464 2063 6c61 7373 3d22 6d61 726b ...< │ │ │ +0013e610: 2f74 723e 0a3c 2f74 6162 6c65 3e0a 3c70 /tr>.
    context flag │ │ │ +0013de80: 2020 3c2f 7468 3e3c 7468 2063 6c61 7373 result │ │ │ +0013deb0: 2020 203c 2f74 683e 3c2f 7472 3e0a 3c74
    set │ │ │ +0013e000: 3c63 6f64 653e 7365 7473 6f63 6b6f 7074 setsockopt │ │ │ +0013e010: 3c2f 636f 6465 3e20 6c65 7665 6c20 3c63 level IPPROTO_IP to I │ │ │ +0013e040: 505f 4d55 4c54 4943 4153 545f 4946 3c2f P_MULTICAST_IF with value │ │ │ +0013e060: 203c 636f 6465 3e3c 6120 636c 6173 733d │ │ │ +0013e110: 736f 6170 3a3a 6970 7634 5f6d 756c 7469 soap::ipv4_multi │ │ │ +0013e120: 6361 7374 5f69 663c 2f61 3e3c 2f63 6f64 cast_if when non-NULL │ │ │ +0013e140: 2020 2020 3c2f 7464 3e3c 2f74 723e 0a3c
    soap::ipv4_mul │ │ │ +0013e250: 7469 6361 7374 5f74 746c 3c2f 613e 3c2f ticast_ttl s │ │ │ +0013e290: 6574 203c 636f 6465 3e73 6574 736f 636b et setsock │ │ │ +0013e2a0: 6f70 743c 2f63 6f64 653e 206c 6576 656c opt level │ │ │ +0013e2b0: 203c 636f 6465 3e49 5050 524f 544f 5f49 IPPROTO_I │ │ │ +0013e2c0: 503c 2f63 6f64 653e 2074 6f20 3c63 6f64 P to IP_MULTICAST_T │ │ │ +0013e2e0: 544c 3c2f 636f 6465 3e20 7769 7468 2076 TL with v │ │ │ +0013e2f0: 616c 7565 203c 636f 6465 3e3c 6120 636c alue soap::ipv4_m │ │ │ +0013e3b0: 756c 7469 6361 7374 5f74 746c 3c2f 613e ulticast_ttl │ │ │ +0013e3c0: 3c2f 636f 6465 3e20 7768 656e 206e 6f6e when non │ │ │ +0013e3d0: 7a65 726f 2020 2020 3c2f 7464 3e3c 2f74 zero
    soap::ipv6_mult │ │ │ +0013e4d0: 6963 6173 745f 6966 3c2f 613e 3c2f 636f icast_if set │ │ │ +0013e510: 203c 636f 6465 3e73 6f63 6b61 6464 725f sockaddr_ │ │ │ +0013e520: 696e 363a 3a73 696e 365f 7363 6f70 655f in6::sin6_scope_ │ │ │ +0013e530: 6964 3c2f 636f 6465 3e20 746f 203c 636f id to soap::ip │ │ │ +0013e5e0: 7636 5f6d 756c 7469 6361 7374 5f69 663c v6_multicast_if< │ │ │ +0013e5f0: 2f61 3e3c 2f63 6f64 653e 2077 6865 6e20 /a> when │ │ │ +0013e600: 6e6f 6e7a 6572 6f20 2020 3c2f 7464 3e3c nonzero
    .

    .... Back to table │ │ │ +0013e640: 6f66 2063 6f6e 7465 6e74 733c 2f61 3e3c of contents< │ │ │ +0013e650: 2f70 3e0a 3c68 313e 3c61 2063 6c61 7373 /p>.

    .Run │ │ │ +0013e680: 2d74 696d 6520 6572 726f 7220 636f 6465 -time error code │ │ │ +0013e690: 733c 2f68 313e 0a3c 703e 5374 6174 7573 s

    .

    Status │ │ │ +0013e6a0: 2065 7272 6f72 2063 6f64 6573 2061 7265 error codes are │ │ │ +0013e6b0: 2069 6e74 6567 6572 2076 616c 7565 732c integer values, │ │ │ +0013e6c0: 2077 6869 6368 2061 7265 2072 6574 7572 which are retur │ │ │ +0013e6d0: 6e65 6420 6279 2074 6865 2067 534f 4150 ned by the gSOAP │ │ │ +0013e6e0: 2041 5049 2066 756e 6374 696f 6e73 2e20 API functions. │ │ │ +0013e6f0: 5468 6520 6675 6c6c 206c 6973 7420 6f66 The full list of │ │ │ +0013e700: 203c 636f 6465 3e3c 6120 636c 6173 733d soap_sta │ │ │ +0013e7c0: 7475 733c 2f61 3e3c 2f63 6f64 653e 2065 tus e │ │ │ +0013e7d0: 7272 6f72 2063 6f64 6573 2069 7320 6c69 rror codes is li │ │ │ +0013e7e0: 7374 6564 2062 656c 6f77 3a3c 2f70 3e0a sted below:

    . │ │ │ +0013e7f0: 3c74 6162 6c65 2063 6c61 7373 3d22 6d61 .... │ │ │ +0013e8e0: 3c63 6f64 653e 2353 4f41 505f 4f4b 3c2f #SOAP_OK ..< │ │ │ +0013e960: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ +0013e970: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ +0013e980: 3e3c 636f 6465 3e23 534f 4150 5f43 4c49 >#SOAP_CLI │ │ │ +0013e990: 5f46 4155 4c54 3c2f 636f 6465 3e20 2020 _FAULT │ │ │ +0013e9a0: 3c2f 7464 3e3c 7464 2063 6c61 7373 3d22 .... │ │ │ +0013eb30: 3c63 6f64 653e 2353 4f41 505f 4445 4c5f #SOAP_DEL_ │ │ │ +0013eb40: 4d45 5448 4f44 3c2f 636f 6465 3e20 2020 METHOD │ │ │ +0013eb50: 3c2f 7464 3e3c 7464 2063 6c61 7373 3d22 .< │ │ │ +0013ed40: 7472 2063 6c61 7373 3d22 6d61 726b 646f tr class="markdo │ │ │ +0013ed50: 776e 5461 626c 6552 6f77 4f64 6422 3e0a wnTableRowOdd">. │ │ │ +0013ed60: 3c74 6420 636c 6173 733d 226d 6172 6b64 .. │ │ │ +0013ee40: 3c63 6f64 653e 2353 4f41 505f 4449 4d45 #SOAP_DIME │ │ │ +0013ee50: 5f45 5252 4f52 3c2f 636f 6465 3e20 2020 _ERROR │ │ │ +0013ee60: 3c2f 7464 3e3c 7464 2063 6c61 7373 3d22 .. │ │ │ +0013efe0: 3c2f 7472 3e0a 3c74 7220 636c 6173 733d ..< │ │ │ +0013f090: 2f74 723e 0a3c 7472 2063 6c61 7373 3d22 /tr>..< │ │ │ +0013f100: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ +0013f110: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ +0013f120: 3e58 4d4c 2065 6c65 6d65 6e74 2068 6173 >XML element has │ │ │ +0013f130: 2064 7570 6c69 6361 7465 2069 6420 6174 duplicate id at │ │ │ +0013f140: 7472 6962 7574 6520 7661 6c75 6520 2861 tribute value (a │ │ │ +0013f150: 7070 6c69 6361 626c 6520 746f 2053 4f41 pplicable to SOA │ │ │ +0013f160: 5020 6d75 6c74 692d 7265 6620 656e 636f P multi-ref enco │ │ │ +0013f170: 6469 6e67 2061 6e64 203c 636f 6465 3e23 ding and # │ │ │ +0013f180: 534f 4150 5f58 4d4c 5f47 5241 5048 3c2f SOAP_XML_GRAPH serializat │ │ │ +0013f1a0: 696f 6e29 2020 2020 3c2f 7464 3e3c 2f74 ion) ....< │ │ │ +0013f370: 2f74 723e 0a3c 7472 2063 6c61 7373 3d22 /tr>..< │ │ │ +0013f410: 2f74 723e 0a3c 7472 2063 6c61 7373 3d22 /tr>............ │ │ │ +0013fca0: 5265 6665 7265 6e63 6520 746f 206f 626a Reference to obj │ │ │ +0013fcb0: 6563 7420 696e 2058 4d4c 2069 6465 6e74 ect in XML ident │ │ │ +0013fcc0: 6966 6965 6420 6279 2069 7473 2069 6420 ified by its id │ │ │ +0013fcd0: 6174 7472 6962 7574 6520 6973 2069 6e63 attribute is inc │ │ │ +0013fce0: 6f6d 7061 7469 626c 6520 7769 7468 2074 ompatible with t │ │ │ +0013fcf0: 6865 206f 626a 6563 7420 7265 6665 7272 he object referr │ │ │ +0013fd00: 6564 2074 6f20 6279 2074 6865 2072 6566 ed to by the ref │ │ │ +0013fd10: 206f 7220 6872 6566 2061 7474 7269 6275 or href attribu │ │ │ +0013fd20: 7465 2028 6170 706c 6963 6162 6c65 2074 te (applicable t │ │ │ +0013fd30: 6f20 534f 4150 206d 756c 7469 2d72 6566 o SOAP multi-ref │ │ │ +0013fd40: 2065 6e63 6f64 696e 6720 616e 6420 3c63 encoding and #SOAP_XML_GR │ │ │ +0013fd60: 4150 483c 2f63 6f64 653e 2073 6572 6961 APH seria │ │ │ +0013fd70: 6c69 7a61 7469 6f6e 2920 2020 203c 2f74 lization) .. │ │ │ +0013fdf0: 3c74 6420 636c 6173 733d 226d 6172 6b64 ... │ │ │ +0013ff20: 3c74 7220 636c 6173 733d 226d 6172 6b64 │ │ │ +0013ff40: 0a3c 7464 2063 6c61 7373 3d22 6d61 726b .. │ │ │ +0013ffd0: 3c74 7220 636c 6173 733d 226d 6172 6b64 ..< │ │ │ +001400c0: 7472 2063 6c61 7373 3d22 6d61 726b 646f tr class="markdo │ │ │ +001400d0: 776e 5461 626c 6552 6f77 4f64 6422 3e0a wnTableRowOdd">. │ │ │ +001400e0: 3c74 6420 636c 6173 733d 226d 6172 6b64 .. │ │ │ +001401b0: 3c74 6420 636c 6173 733d 226d 6172 6b64 .....< │ │ │ +00140400: 7472 2063 6c61 7373 3d22 6d61 726b 646f tr class="markdo │ │ │ +00140410: 776e 5461 626c 6552 6f77 4f64 6422 3e0a wnTableRowOdd">. │ │ │ +00140420: 3c74 6420 636c 6173 733d 226d 6172 6b64 . │ │ │ +00140550: 3c74 7220 636c 6173 733d 226d 6172 6b64 .........< │ │ │ +001408f0: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ +00140900: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ +00140910: 3e3c 636f 6465 3e23 534f 4150 5f4e 4f5f >#SOAP_NO_ │ │ │ +00140920: 4d45 5448 4f44 3c2f 636f 6465 3e20 2020 METHOD │ │ │ +00140930: 3c2f 7464 3e3c 7464 2063 6c61 7373 3d22 ......< │ │ │ +00140c50: 2f74 723e 0a3c 7472 2063 6c61 7373 3d22 /tr>...... │ │ │ +00141060: 0a3c 7472 2063 6c61 7373 3d22 6d61 726b ..< │ │ │ +00141110: 2f74 723e 0a3c 7472 2063 6c61 7373 3d22 /tr>.. │ │ │ +001411a0: 584d 4c20 6174 7472 6962 7574 6520 6973 XML attribute is │ │ │ +001411b0: 2070 726f 6869 6269 7465 6420 6275 7420 prohibited but │ │ │ +001411c0: 7072 6573 656e 7420 2020 203c 2f74 643e present │ │ │ +001411d0: 3c2f 7472 3e0a 3c74 7220 636c 6173 733d .. │ │ │ +00141260: 416e 2048 5454 5020 5055 5420 7265 7175 An HTTP PUT requ │ │ │ +00141270: 6573 7420 7761 7320 7265 6365 6976 6564 est was received │ │ │ +00141280: 2062 7920 7468 6520 7365 7276 6963 6520 by the service │ │ │ +00141290: 6275 7420 7468 6520 5055 5420 7265 7175 but the PUT requ │ │ │ +001412a0: 6573 7420 6361 6c6c 6261 636b 203c 636f est callback soap::fput< │ │ │ +00141380: 2f61 3e3c 2f63 6f64 653e 2069 7320 6e6f /a> is no │ │ │ +00141390: 7420 696d 706c 656d 656e 7465 642c 2073 t implemented, s │ │ │ +001413a0: 6565 2053 6563 7469 6f6e 203c 6120 636c ee Section Function cal │ │ │ +001413e0: 6c62 6163 6b73 2066 6f72 2063 7573 746f lbacks for custo │ │ │ +001413f0: 6d69 7a65 6420 492f 4f20 616e 6420 4854 mized I/O and HT │ │ │ +00141400: 5450 2068 616e 646c 696e 673c 2f61 3e20 TP handling │ │ │ +00141410: 2020 203c 2f74 643e 3c2f 7472 3e0a 3c74 .. │ │ │ +00141440: 3c74 6420 636c 6173 733d 226d 6172 6b64 .< │ │ │ +001414e0: 7472 2063 6c61 7373 3d22 6d61 726b 646f tr class="markdo │ │ │ +001414f0: 776e 5461 626c 6552 6f77 4f64 6422 3e0a wnTableRowOdd">. │ │ │ +00141500: 3c74 6420 636c 6173 733d 226d 6172 6b64 .. │ │ │ +001415d0: 3c63 6f64 653e 2353 4f41 505f 5356 525f #SOAP_SVR_ │ │ │ +001415e0: 4641 554c 543c 2f63 6f64 653e 2020 203c FAULT < │ │ │ +001415f0: 2f74 643e 3c74 6420 636c 6173 733d 226d /td>........ │ │ │ +00141900: 3c74 6420 636c 6173 733d 226d 6172 6b64 .. │ │ │ +00141a10: 3c63 6f64 653e 2353 4f41 505f 5544 505f #SOAP_UDP_ │ │ │ +00141a20: 4552 524f 523c 2f63 6f64 653e 2020 203c ERROR < │ │ │ +00141a30: 2f74 643e 3c74 6420 636c 6173 733d 226d /td>.... │ │ │ +00141c70: 3c63 6f64 653e 2353 4f41 505f 5554 465f #SOAP_UTF_ │ │ │ +00141c80: 4552 524f 523c 2f63 6f64 653e 2020 203c ERROR < │ │ │ +00141c90: 2f74 643e 3c74 6420 636c 6173 733d 226d /td>< │ │ │ +00141ce0: 2f74 723e 0a3c 7472 2063 6c61 7373 3d22 /tr>.... │ │ │ +00141e20: 3c74 6420 636c 6173 733d 226d 6172 6b64 < │ │ │ +00141e60: 2f74 723e 0a3c 2f74 6162 6c65 3e0a 3c70 /tr>.
    E │ │ │ +0013e850: 7272 6f72 2063 6f64 6520 2020 3c2f 7468 rror code Description │ │ │ +0013e890: 2020 3c2f 7468 3e3c 2f74 723e 0a3c 7472
    N │ │ │ +0013e920: 6f20 6572 726f 7220 287a 6572 6f29 2020 o error (zero) │ │ │ +0013e930: 2020 3c2f 7464 3e3c 2f74 723e 0a3c 7472
    The servi │ │ │ +0013e9d0: 6365 2072 6574 7572 6e65 6420 6120 534f ce returned a SO │ │ │ +0013e9e0: 4150 2031 2e31 2063 6c69 656e 7420 6661 AP 1.1 client fa │ │ │ +0013e9f0: 756c 7420 2f20 534f 4150 2031 2e32 2073 ult / SOAP 1.2 s │ │ │ +0013ea00: 656e 6465 7220 6661 756c 7420 746f 2074 ender fault to t │ │ │ +0013ea10: 6865 2063 6c69 656e 7420 2020 203c 2f74 he client
    #SOAP_DATAENCOD │ │ │ +0013ea80: 494e 4755 4e4b 4e4f 574e 3c2f 636f 6465 INGUNKNOWN SOAP │ │ │ +0013eac0: 312e 3220 4461 7461 456e 636f 6469 6e67 1.2 DataEncoding │ │ │ +0013ead0: 556e 6b6e 6f77 6e20 6661 756c 7420 2020 Unknown fault │ │ │ +0013eae0: 203c 2f74 643e 3c2f 7472 3e0a 3c74 7220
    An HTTP D │ │ │ +0013eb80: 454c 4554 4520 7265 7175 6573 7420 7761 ELETE request wa │ │ │ +0013eb90: 7320 7265 6365 6976 6564 2062 7920 7468 s received by th │ │ │ +0013eba0: 6520 7365 7276 6963 6520 6275 7420 7468 e service but th │ │ │ +0013ebb0: 6520 4445 4c45 5445 2072 6571 7565 7374 e DELETE request │ │ │ +0013ebc0: 2063 616c 6c62 6163 6b20 3c63 6f64 653e callback │ │ │ +0013ebd0: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap::fdel │ │ │ +0013eca0: 3c2f 613e 3c2f 636f 6465 3e20 6973 206e is n │ │ │ +0013ecb0: 6f74 2069 6d70 6c65 6d65 6e74 6564 2c20 ot implemented, │ │ │ +0013ecc0: 7365 6520 5365 6374 696f 6e20 3c61 2063 see Section Function ca │ │ │ +0013ed00: 6c6c 6261 636b 7320 666f 7220 6375 7374 llbacks for cust │ │ │ +0013ed10: 6f6d 697a 6564 2049 2f4f 2061 6e64 2048 omized I/O and H │ │ │ +0013ed20: 5454 5020 6861 6e64 6c69 6e67 3c2f 613e TTP handling │ │ │ +0013ed30: 2020 2020 3c2f 7464 3e3c 2f74 723e 0a3c
    #SOAP_DI │ │ │ +0013ed90: 4d45 5f45 4e44 3c2f 636f 6465 3e20 2020 ME_END │ │ │ +0013eda0: 3c2f 7464 3e3c 7464 2063 6c61 7373 3d22 End of DI │ │ │ +0013edd0: 4d45 2061 7474 6163 686d 656e 7473 2070 ME attachments p │ │ │ +0013ede0: 726f 746f 636f 6c20 6572 726f 7220 2020 rotocol error │ │ │ +0013edf0: 203c 2f74 643e 3c2f 7472 3e0a 3c74 7220
    DIME form │ │ │ +0013ee90: 6174 7469 6e67 2065 7272 6f72 206f 7220 atting error or │ │ │ +0013eea0: 4449 4d45 2061 7474 6163 686d 656e 7420 DIME attachment │ │ │ +0013eeb0: 7369 7a65 2065 7863 6565 6473 203c 636f size exceeds #SOAP_MAXDIME │ │ │ +0013eed0: 5349 5a45 3c2f 636f 6465 3e20 2020 203c SIZE < │ │ │ +0013eee0: 2f74 643e 3c2f 7472 3e0a 3c74 7220 636c /td>
    #SOAP_DIME_HR │ │ │ +0013ef40: 4546 3c2f 636f 6465 3e20 2020 3c2f 7464 EF DIME attachme │ │ │ +0013ef80: 6e74 2068 6173 206e 6f20 6872 6566 2066 nt has no href f │ │ │ +0013ef90: 726f 6d20 534f 4150 2062 6f64 7920 616e rom SOAP body an │ │ │ +0013efa0: 6420 6e6f 2044 494d 4520 6361 6c6c 6261 d no DIME callba │ │ │ +0013efb0: 636b 7320 7765 7265 2064 6566 696e 6564 cks were defined │ │ │ +0013efc0: 2074 6f20 7361 7665 2074 6865 2061 7474 to save the att │ │ │ +0013efd0: 6163 686d 656e 7420 2020 203c 2f74 643e achment
    │ │ │ +0013f030: 2353 4f41 505f 4449 4d45 5f4d 4953 4d41 #SOAP_DIME_MISMA │ │ │ +0013f040: 5443 483c 2f63 6f64 653e 2020 203c 2f74 TCH DIME version │ │ │ +0013f080: 2065 7272 6f72 2020 2020 3c2f 7464 3e3c error
    #S │ │ │ +0013f0e0: 4f41 505f 4455 504c 4943 4154 455f 4944 OAP_DUPLICATE_ID │ │ │ +0013f0f0: 3c2f 636f 6465 3e20 2020 3c2f 7464 3e3c
    #SO │ │ │ +0013f200: 4150 5f45 4d50 5459 3c2f 636f 6465 3e20 AP_EMPTY │ │ │ +0013f210: 2020 3c2f 7464 3e3c 7464 2063 6c61 7373 XML ele │ │ │ +0013f240: 6d65 6e74 206f 7220 6174 7472 6962 7574 ment or attribut │ │ │ +0013f250: 6520 6973 2065 6d70 7479 2077 6865 6e20 e is empty when │ │ │ +0013f260: 6120 7661 6c75 6520 6973 2072 6571 7569 a value is requi │ │ │ +0013f270: 7265 6420 2020 203c 2f74 643e 3c2f 7472 red
    #SOAP │ │ │ +0013f2d0: 5f45 4f46 3c2f 636f 6465 3e20 2020 3c2f _EOF Unexpected │ │ │ +0013f310: 656e 6420 6f66 2066 696c 652c 206e 6f20 end of file, no │ │ │ +0013f320: 696e 7075 742c 2074 7261 6e73 6d69 7373 input, transmiss │ │ │ +0013f330: 696f 6e20 696e 7465 7272 7570 7465 6420 ion interrupted │ │ │ +0013f340: 6f72 2074 696d 6564 206f 7574 2c20 7361 or timed out, sa │ │ │ +0013f350: 6d65 2061 7320 3c63 6f64 653e 454f 463c me as EOF< │ │ │ +0013f360: 2f63 6f64 653e 2020 2020 3c2f 7464 3e3c /code>
    # │ │ │ +0013f3c0: 534f 4150 5f45 4f4d 3c2f 636f 6465 3e20 SOAP_EOM │ │ │ +0013f3d0: 2020 3c2f 7464 3e3c 7464 2063 6c61 7373 Out of │ │ │ +0013f400: 6d65 6d6f 7279 2020 2020 3c2f 7464 3e3c memory
    #S │ │ │ +0013f460: 4f41 505f 4552 523c 2f63 6f64 653e 2020 OAP_ERR │ │ │ +0013f470: 203c 2f74 643e 3c74 6420 636c 6173 733d Same as │ │ │ +0013f4a0: 3c63 6f64 653e 454f 463c 2f63 6f64 653e EOF │ │ │ +0013f4b0: 2c20 6275 7420 696e 6469 6361 7465 7320 , but indicates │ │ │ +0013f4c0: 616e 2075 6e73 7065 6369 6669 6564 2065 an unspecified e │ │ │ +0013f4d0: 7272 6f72 2020 2020 3c2f 7464 3e3c 2f74 rror
    #SO │ │ │ +0013f530: 4150 5f46 4155 4c54 3c2f 636f 6465 3e20 AP_FAULT │ │ │ +0013f540: 2020 3c2f 7464 3e3c 7464 2063 6c61 7373 The fau │ │ │ +0013f570: 6c74 2063 6f64 6520 746f 2062 6520 7265 lt code to be re │ │ │ +0013f580: 7475 726e 6564 2062 7920 6120 7365 7276 turned by a serv │ │ │ +0013f590: 6963 6520 6f70 6572 6174 696f 6e20 7768 ice operation wh │ │ │ +0013f5a0: 656e 2063 616c 6c69 6e67 203c 636f 6465 en calling s │ │ │ +0013f650: 6f61 705f 7365 6e64 6572 5f66 6175 6c74 oap_sender_fault │ │ │ +0013f660: 3c2f 613e 3c2f 636f 6465 3e20 2863 6c69 (cli │ │ │ +0013f670: 656e 7420 6973 2061 7420 6661 756c 7429 ent is at fault) │ │ │ +0013f680: 206f 7220 3c63 6f64 653e 3c61 2063 6c61 or soap_r │ │ │ +0013f730: 6563 6569 7665 725f 6661 756c 743c 2f61 eceiver_fault (server │ │ │ +0013f750: 2069 7320 6174 2066 6175 6c74 292c 2063 is at fault), c │ │ │ +0013f760: 6c69 656e 7473 2072 6563 6569 7665 2074 lients receive t │ │ │ +0013f770: 6865 2066 6175 6c74 2061 7320 3c63 6f64 he fault as #SOAP_CLI_FAUL │ │ │ +0013f790: 543c 2f63 6f64 653e 206f 7220 3c63 6f64 T or #SOAP_SVR_FAUL │ │ │ +0013f7b0: 543c 2f63 6f64 653e 2072 6573 7065 6374 T respect │ │ │ +0013f7c0: 6976 656c 7920 2020 203c 2f74 643e 3c2f ively
    #SO │ │ │ +0013f820: 4150 5f46 445f 4558 4345 4544 4544 3c2f AP_FD_EXCEEDED T │ │ │ +0013f860: 6f6f 206d 616e 7920 6f70 656e 2073 6f63 oo many open soc │ │ │ +0013f870: 6b65 7473 2020 2020 3c2f 7464 3e3c 2f74 kets
    #SO │ │ │ +0013f8d0: 4150 5f46 4958 4544 3c2f 636f 6465 3e20 AP_FIXED │ │ │ +0013f8e0: 2020 3c2f 7464 3e3c 7464 2063 6c61 7373 XML ele │ │ │ +0013f910: 6d65 6e74 206f 7220 6174 7472 6962 7574 ment or attribut │ │ │ +0013f920: 6520 7661 6c75 6520 6973 2066 6978 6564 e value is fixed │ │ │ +0013f930: 2061 6e64 2074 6865 2070 6172 7365 6420 and the parsed │ │ │ +0013f940: 7661 6c75 6520 646f 6573 206e 6f74 206d value does not m │ │ │ +0013f950: 6174 6368 2074 6865 2066 6978 6564 2076 atch the fixed v │ │ │ +0013f960: 616c 7565 2020 2020 3c2f 7464 3e3c 2f74 alue
    #SOA │ │ │ +0013f9c0: 505f 4745 545f 4d45 5448 4f44 3c2f 636f P_GET_METHOD An │ │ │ +0013fa00: 4854 5450 2047 4554 2072 6571 7565 7374 HTTP GET request │ │ │ +0013fa10: 2077 6173 2072 6563 6569 7665 6420 6279 was received by │ │ │ +0013fa20: 2074 6865 2073 6572 7669 6365 2062 7574 the service but │ │ │ +0013fa30: 2074 6865 2047 4554 2072 6571 7565 7374 the GET request │ │ │ +0013fa40: 2063 616c 6c62 6163 6b20 3c63 6f64 653e callback │ │ │ +0013fa50: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap::fget │ │ │ +0013fb20: 3c2f 636f 6465 3e20 6973 206e 6f74 2069 is not i │ │ │ +0013fb30: 6d70 6c65 6d65 6e74 6564 2c20 7365 6520 mplemented, see │ │ │ +0013fb40: 5365 6374 696f 6e73 203c 6120 636c 6173 Sections How │ │ │ +0013fb70: 2074 6f20 696d 706c 656d 656e 7420 4854 to implement HT │ │ │ +0013fb80: 5450 2047 4554 2c20 5055 542c 2061 6e64 TP GET, PUT, and │ │ │ +0013fb90: 2050 4154 4348 2073 6572 7669 6365 733c PATCH services< │ │ │ +0013fba0: 2f61 3e20 616e 6420 3c61 2063 6c61 7373 /a> and Function callba │ │ │ +0013fbe0: 636b 7320 666f 7220 6375 7374 6f6d 697a cks for customiz │ │ │ +0013fbf0: 6564 2049 2f4f 2061 6e64 2048 5454 5020 ed I/O and HTTP │ │ │ +0013fc00: 6861 6e64 6c69 6e67 3c2f 613e 2020 2020 handling │ │ │ +0013fc10: 3c2f 7464 3e3c 2f74 723e 0a3c 7472 2063
    < │ │ │ +0013fc60: 636f 6465 3e23 534f 4150 5f48 5245 463c code>#SOAP_HREF< │ │ │ +0013fc70: 2f63 6f64 653e 2020 203c 2f74 643e 3c74 /code>
    #SOAP_HTTP_ERRO │ │ │ +0013fde0: 523c 2f63 6f64 653e 2020 203c 2f74 643e R An unspecified │ │ │ +0013fe20: 2048 5454 5020 6572 726f 7220 6f63 6375 HTTP error occu │ │ │ +0013fe30: 7272 6564 2020 2020 3c2f 7464 3e3c 2f74 rred
    #SO │ │ │ +0013fe90: 4150 5f48 5454 505f 4d45 5448 4f44 3c2f AP_HTTP_METHOD A │ │ │ +0013fed0: 6e20 4854 5450 2072 6571 7565 7374 2077 n HTTP request w │ │ │ +0013fee0: 6173 2072 6563 6569 7665 6420 6279 2074 as received by t │ │ │ +0013fef0: 6865 2073 6572 7669 6365 2074 6861 7420 he service that │ │ │ +0013ff00: 6361 6e6e 6f74 2062 6520 6861 6e64 6c65 cannot be handle │ │ │ +0013ff10: 6420 2020 203c 2f74 643e 3c2f 7472 3e0a d
    #SOAP_I │ │ │ +0013ff70: 4f42 3c2f 636f 6465 3e20 2020 3c2f 7464 OB SOAP array in │ │ │ +0013ffb0: 6465 7820 6f75 7420 6f66 2062 6f75 6e64 dex out of bound │ │ │ +0013ffc0: 7320 2020 203c 2f74 643e 3c2f 7472 3e0a s
    #SOAP_ │ │ │ +00140020: 4c45 4e47 5448 3c2f 636f 6465 3e20 2020 LENGTH │ │ │ +00140030: 3c2f 7464 3e3c 7464 2063 6c61 7373 3d22 XML eleme │ │ │ +00140060: 6e74 206f 7220 6174 7472 6962 7574 6520 nt or attribute │ │ │ +00140070: 6c65 6e67 7468 2076 616c 6964 6174 696f length validatio │ │ │ +00140080: 6e20 6572 726f 7220 6f72 203c 636f 6465 n error or #SOAP_MAXLENGTH │ │ │ +001400a0: 3c2f 636f 6465 3e20 6578 6365 6564 6564 exceeded │ │ │ +001400b0: 2020 2020 3c2f 7464 3e3c 2f74 723e 0a3c
    #SOAP_LE │ │ │ +00140110: 5645 4c3c 2f63 6f64 653e 2020 203c 2f74 VEL XML nesting │ │ │ +00140150: 6465 7074 6820 6c65 7665 6c20 6578 6365 depth level exce │ │ │ +00140160: 6564 7320 3c63 6f64 653e 2353 4f41 505f eds #SOAP_ │ │ │ +00140170: 4d41 584c 4556 454c 3c2f 636f 6465 3e20 MAXLEVEL │ │ │ +00140180: 2020 203c 2f74 643e 3c2f 7472 3e0a 3c74
    #SOAP_MI │ │ │ +001401e0: 4d45 5f45 4e44 3c2f 636f 6465 3e20 2020 ME_END │ │ │ +001401f0: 3c2f 7464 3e3c 7464 2063 6c61 7373 3d22 End of MI │ │ │ +00140220: 4d45 2061 7474 6163 686d 656e 7473 2070 ME attachments p │ │ │ +00140230: 726f 746f 636f 6c20 6572 726f 7220 2020 rotocol error │ │ │ +00140240: 203c 2f74 643e 3c2f 7472 3e0a 3c74 7220
    < │ │ │ +00140290: 636f 6465 3e23 534f 4150 5f4d 494d 455f code>#SOAP_MIME_ │ │ │ +001402a0: 4552 524f 523c 2f63 6f64 653e 2020 203c ERROR < │ │ │ +001402b0: 2f74 643e 3c74 6420 636c 6173 733d 226d /td>MIME attac │ │ │ +001402e0: 686d 656e 7420 7061 7273 696e 6720 6572 hment parsing er │ │ │ +001402f0: 726f 7220 2020 203c 2f74 643e 3c2f 7472 ror
    #SOA │ │ │ +00140350: 505f 4d49 4d45 5f48 5245 463c 2f63 6f64 P_MIME_HREF MIME │ │ │ +00140390: 2061 7474 6163 686d 656e 7420 6861 7320 attachment has │ │ │ +001403a0: 6e6f 2068 7265 6620 6672 6f6d 2053 4f41 no href from SOA │ │ │ +001403b0: 5020 626f 6479 2061 6e64 206e 6f20 4d49 P body and no MI │ │ │ +001403c0: 4d45 2063 616c 6c62 6163 6b73 2077 6572 ME callbacks wer │ │ │ +001403d0: 6520 6465 6669 6e65 6420 746f 2073 6176 e defined to sav │ │ │ +001403e0: 6520 7468 6520 6174 7461 6368 6d65 6e74 e the attachment │ │ │ +001403f0: 2020 2020 3c2f 7464 3e3c 2f74 723e 0a3c
    #SOAP_MI │ │ │ +00140450: 5353 494e 475f 4944 3c2f 636f 6465 3e20 SSING_ID │ │ │ +00140460: 2020 3c2f 7464 3e3c 7464 2063 6c61 7373 An XML │ │ │ +00140490: 656c 656d 656e 7420 7769 7468 2069 6420 element with id │ │ │ +001404a0: 6174 7472 6962 7574 6520 6973 206d 6973 attribute is mis │ │ │ +001404b0: 7369 6e67 2074 6861 7420 7368 6f75 6c64 sing that should │ │ │ +001404c0: 206d 6174 6368 2074 6865 2065 6c65 6d65 match the eleme │ │ │ +001404d0: 6e74 2077 6974 6820 6872 6566 2f72 6566 nt with href/ref │ │ │ +001404e0: 2061 7474 7269 6275 7465 2028 6170 706c attribute (appl │ │ │ +001404f0: 6963 6162 6c65 2074 6f20 534f 4150 206d icable to SOAP m │ │ │ +00140500: 756c 7469 2d72 6566 2065 6e63 6f64 696e ulti-ref encodin │ │ │ +00140510: 6720 616e 6420 3c63 6f64 653e 2353 4f41 g and #SOA │ │ │ +00140520: 505f 584d 4c5f 4752 4150 483c 2f63 6f64 P_XML_GRAPH serialization │ │ │ +00140540: 2920 2020 203c 2f74 643e 3c2f 7472 3e0a )
    #SOAP_ │ │ │ +001405a0: 4d4f 453c 2f63 6f64 653e 2020 203c 2f74 MOE Memory overf │ │ │ +001405e0: 6c6f 7720 6f72 206d 656d 6f72 7920 636f low or memory co │ │ │ +001405f0: 7272 7570 7469 6f6e 2065 7272 6f72 2028 rruption error ( │ │ │ +00140600: 6170 706c 6963 6162 6c65 2069 6e20 3c63 applicable in #DEBUG mode only) │ │ │ +00140630: 3c2f 7464 3e3c 2f74 723e 0a3c 7472 2063
    #SOAP_MUSTUN │ │ │ +00140690: 4445 5253 5441 4e44 3c2f 636f 6465 3e20 DERSTAND │ │ │ +001406a0: 2020 3c2f 7464 3e3c 7464 2063 6c61 7373 An XML │ │ │ +001406d0: 656c 656d 656e 7420 6973 2070 7265 7365 element is prese │ │ │ +001406e0: 6e74 2077 6974 6820 6120 6d75 7374 556e nt with a mustUn │ │ │ +001406f0: 6465 7273 7461 6e64 2061 7474 7269 6275 derstand attribu │ │ │ +00140700: 7465 2077 6869 6368 206d 7573 7420 6265 te which must be │ │ │ +00140710: 2075 6e64 6572 7374 6f6f 6420 6275 7420 understood but │ │ │ +00140720: 6973 206e 6f74 2064 6573 6572 6961 6c69 is not deseriali │ │ │ +00140730: 7a65 6420 2020 203c 2f74 643e 3c2f 7472 zed
    #SOA │ │ │ +00140790: 505f 4e41 4d45 5350 4143 453c 2f63 6f64 P_NAMESPACE XML │ │ │ +001407d0: 6e61 6d65 7370 6163 6520 6e61 6d65 206d namespace name m │ │ │ +001407e0: 6973 6d61 7463 6820 7661 6c69 6461 7469 ismatch validati │ │ │ +001407f0: 6f6e 2065 7272 6f72 2020 2020 3c2f 7464 on error
    │ │ │ +00140850: 2353 4f41 505f 4e4f 5f44 4154 413c 2f63 #SOAP_NO_DATA No │ │ │ +00140890: 2064 6174 6120 696e 2074 6865 2048 5454 data in the HTT │ │ │ +001408a0: 5020 626f 6479 206f 6620 7468 6520 6d65 P body of the me │ │ │ +001408b0: 7373 6167 6520 7265 6365 6976 6564 2020 ssage received │ │ │ +001408c0: 2020 3c2f 7464 3e3c 2f74 723e 0a3c 7472
    The servi │ │ │ +00140960: 6365 2072 6571 7565 7374 2064 6973 7061 ce request dispa │ │ │ +00140970: 7463 6865 7220 6469 6420 6e6f 7420 6669 tcher did not fi │ │ │ +00140980: 6e64 2061 206d 6174 6368 696e 6720 7365 nd a matching se │ │ │ +00140990: 7276 6963 6520 6f70 6572 6174 696f 6e20 rvice operation │ │ │ +001409a0: 666f 7220 6120 7365 7276 6963 6520 7265 for a service re │ │ │ +001409b0: 7175 6573 7420 2020 203c 2f74 643e 3c2f quest
    #SO │ │ │ +00140a10: 4150 5f4e 4f5f 5441 473c 2f63 6f64 653e AP_NO_TAG │ │ │ +00140a20: 2020 203c 2f74 643e 3c74 6420 636c 6173 No XML │ │ │ +00140a50: 2065 6c65 6d65 6e74 2074 6167 2077 6173 element tag was │ │ │ +00140a60: 2066 6f75 6e64 2077 6865 6e20 6f6e 6520 found when one │ │ │ +00140a70: 7761 7320 6578 7065 6374 6564 2020 2020 was expected │ │ │ +00140a80: 3c2f 7464 3e3c 2f74 723e 0a3c 7472 2063
    < │ │ │ +00140ad0: 636f 6465 3e23 534f 4150 5f4e 544c 4d5f code>#SOAP_NTLM_ │ │ │ +00140ae0: 4552 524f 523c 2f63 6f64 653e 2020 203c ERROR < │ │ │ +00140af0: 2f74 643e 3c74 6420 636c 6173 733d 226d /td>An NTLM au │ │ │ +00140b20: 7468 656e 7469 6361 7469 6f6e 2068 616e thentication han │ │ │ +00140b30: 6473 6861 6b65 2065 7272 6f72 206f 6363 dshake error occ │ │ │ +00140b40: 7572 7265 6420 2020 203c 2f74 643e 3c2f urred
    #SO │ │ │ +00140ba0: 4150 5f4e 554c 4c3c 2f63 6f64 653e 2020 AP_NULL │ │ │ +00140bb0: 203c 2f74 643e 3c74 6420 636c 6173 733d XML elem │ │ │ +00140be0: 656e 7420 6861 7320 616e 203c 636f 6465 ent has an xsi:nil │ │ │ +00140c00: 6174 7472 6962 7574 6520 7768 656e 2074 attribute when t │ │ │ +00140c10: 6865 2065 6c65 6d65 6e74 2069 7320 6e6f he element is no │ │ │ +00140c20: 7420 6e69 6c6c 6162 6c65 2c20 6361 7573 t nillable, caus │ │ │ +00140c30: 696e 6720 6120 7661 6c69 6461 7469 6f6e ing a validation │ │ │ +00140c40: 2065 7272 6f72 2020 2020 3c2f 7464 3e3c error
    # │ │ │ +00140ca0: 534f 4150 5f4f 4343 5552 533c 2f63 6f64 SOAP_OCCURS XML │ │ │ +00140ce0: 656c 656d 656e 7420 6d69 6e4f 6363 7572 element minOccur │ │ │ +00140cf0: 7320 6f72 206d 6178 4f63 6375 7273 2076 s or maxOccurs v │ │ │ +00140d00: 616c 6964 6174 696f 6e20 6572 726f 7220 alidation error │ │ │ +00140d10: 6f72 203c 636f 6465 3e23 534f 4150 5f4d or #SOAP_M │ │ │ +00140d20: 4158 4f43 4355 5253 3c2f 636f 6465 3e20 AXOCCURS │ │ │ +00140d30: 6578 6365 6564 6564 2020 2020 3c2f 7464 exceeded
    │ │ │ +00140d90: 2353 4f41 505f 5041 5443 485f 4d45 5448 #SOAP_PATCH_METH │ │ │ +00140da0: 4f44 3c2f 636f 6465 3e20 2020 3c2f 7464 OD An HTTP PATCH │ │ │ +00140de0: 2072 6571 7565 7374 2077 6173 2072 6563 request was rec │ │ │ +00140df0: 6569 7665 6420 6279 2074 6865 2073 6572 eived by the ser │ │ │ +00140e00: 7669 6365 2062 7574 2074 6865 2050 4154 vice but the PAT │ │ │ +00140e10: 4348 2072 6571 7565 7374 2063 616c 6c62 CH request callb │ │ │ +00140e20: 6163 6b20 3c63 6f64 653e 3c61 2063 6c61 ack │ │ │ +00140ef0: 736f 6170 3a3a 6670 6174 6368 3c2f 613e soap::fpatch │ │ │ +00140f00: 3c2f 636f 6465 3e20 6973 206e 6f74 2069 is not i │ │ │ +00140f10: 6d70 6c65 6d65 6e74 6564 2c20 7365 6520 mplemented, see │ │ │ +00140f20: 5365 6374 696f 6e20 3c61 2063 6c61 7373 Section Function callba │ │ │ +00140f60: 636b 7320 666f 7220 6375 7374 6f6d 697a cks for customiz │ │ │ +00140f70: 6564 2049 2f4f 2061 6e64 2048 5454 5020 ed I/O and HTTP │ │ │ +00140f80: 6861 6e64 6c69 6e67 3c2f 613e 2020 2020 handling │ │ │ +00140f90: 3c2f 7464 3e3c 2f74 723e 0a3c 7472 2063
    < │ │ │ +00140fe0: 636f 6465 3e23 534f 4150 5f50 4154 5445 code>#SOAP_PATTE │ │ │ +00140ff0: 524e 3c2f 636f 6465 3e20 2020 3c2f 7464 RN XML element o │ │ │ +00141030: 7220 6174 7472 6962 7574 6520 7661 6c75 r attribute valu │ │ │ +00141040: 6520 7061 7474 6572 6e20 6d69 736d 6174 e pattern mismat │ │ │ +00141050: 6368 2020 2020 3c2f 7464 3e3c 2f74 723e ch
    #SOAP_ │ │ │ +001410b0: 504c 5547 494e 5f45 5252 4f52 3c2f 636f PLUGIN_ERROR Fai │ │ │ +001410f0: 6c65 6420 746f 2072 6567 6973 7465 7220 led to register │ │ │ +00141100: 706c 7567 696e 2020 2020 3c2f 7464 3e3c plugin
    # │ │ │ +00141160: 534f 4150 5f50 524f 4849 4249 5445 443c SOAP_PROHIBITED< │ │ │ +00141170: 2f63 6f64 653e 2020 203c 2f74 643e 3c74 /code>
    # │ │ │ +00141220: 534f 4150 5f50 5554 5f4d 4554 484f 443c SOAP_PUT_METHOD< │ │ │ +00141230: 2f63 6f64 653e 2020 203c 2f74 643e 3c74 /code>
    #SOAP_RE │ │ │ +00141470: 5155 4952 4544 3c2f 636f 6465 3e20 2020 QUIRED │ │ │ +00141480: 3c2f 7464 3e3c 7464 2063 6c61 7373 3d22 XML attri │ │ │ +001414b0: 6275 7465 2069 7320 7265 7175 6972 6564 bute is required │ │ │ +001414c0: 2062 7574 206e 6f74 2070 7265 7365 6e74 but not present │ │ │ +001414d0: 2020 2020 3c2f 7464 3e3c 2f74 723e 0a3c
    #SOAP_SS │ │ │ +00141530: 4c5f 4552 524f 523c 2f63 6f64 653e 2020 L_ERROR │ │ │ +00141540: 203c 2f74 643e 3c74 6420 636c 6173 733d An SSL e │ │ │ +00141570: 7272 6f72 206f 6363 7572 7265 6420 2020 rror occurred │ │ │ +00141580: 203c 2f74 643e 3c2f 7472 3e0a 3c74 7220
    The servic │ │ │ +00141620: 6520 7265 7475 726e 6564 2061 2053 4f41 e returned a SOA │ │ │ +00141630: 5020 312e 3120 7365 7276 6572 2066 6175 P 1.1 server fau │ │ │ +00141640: 6c74 206f 7220 534f 4150 2031 2e32 2072 lt or SOAP 1.2 r │ │ │ +00141650: 6563 6569 7665 7220 6661 756c 7420 746f eceiver fault to │ │ │ +00141660: 2074 6865 2063 6c69 656e 7420 2020 203c the client < │ │ │ +00141670: 2f74 643e 3c2f 7472 3e0a 3c74 7220 636c /td>
    #SOAP_SYNTAX_ │ │ │ +001416d0: 4552 524f 523c 2f63 6f64 653e 2020 203c ERROR < │ │ │ +001416e0: 2f74 643e 3c74 6420 636c 6173 733d 226d /td>An XML syn │ │ │ +00141710: 7461 7820 6572 726f 7220 6f63 6375 7272 tax error occurr │ │ │ +00141720: 6564 2077 6869 6c65 2070 6172 7369 6e67 ed while parsing │ │ │ +00141730: 2074 6865 2069 6e70 7574 2020 2020 3c2f the input
    #SOAP_TAG_MIS │ │ │ +001417a0: 4d41 5443 483c 2f63 6f64 653e 2020 203c MATCH < │ │ │ +001417b0: 2f74 643e 3c74 6420 636c 6173 733d 226d /td>XML elemen │ │ │ +001417e0: 7420 7461 6720 7061 7273 6564 2064 6f65 t tag parsed doe │ │ │ +001417f0: 7320 6e6f 7420 6d61 7463 6820 616e 7974 s not match anyt │ │ │ +00141800: 6869 6e67 2074 6861 7420 6973 2065 7870 hing that is exp │ │ │ +00141810: 6563 7465 6420 2020 203c 2f74 643e 3c2f ected
    #SO │ │ │ +00141870: 4150 5f54 4350 5f45 5252 4f52 3c2f 636f AP_TCP_ERROR A T │ │ │ +001418b0: 4350 2f49 5020 636f 6e6e 6563 7469 6f6e CP/IP connection │ │ │ +001418c0: 2065 7272 6f72 206f 6363 7572 7265 6420 error occurred │ │ │ +001418d0: 2020 203c 2f74 643e 3c2f 7472 3e0a 3c74
    #SOAP_TY │ │ │ +00141930: 5045 3c2f 636f 6465 3e20 2020 3c2f 7464 PE XML element o │ │ │ +00141970: 7220 6174 7472 6962 7574 6520 6861 7320 r attribute has │ │ │ +00141980: 6120 6d69 736d 6174 6368 696e 6720 7479 a mismatching ty │ │ │ +00141990: 7065 206f 7220 7661 6c75 6520 7468 6174 pe or value that │ │ │ +001419a0: 2069 7320 6361 7573 696e 6720 6120 7661 is causing a va │ │ │ +001419b0: 6c69 6461 7469 6f6e 2065 7272 6f72 2020 lidation error │ │ │ +001419c0: 2020 3c2f 7464 3e3c 2f74 723e 0a3c 7472
    A UDP/IP c │ │ │ +00141a60: 6f6e 6e65 6374 696f 6e20 6572 726f 7220 onnection error │ │ │ +00141a70: 6f63 6375 7272 6564 206f 7220 7468 6520 occurred or the │ │ │ +00141a80: 6d65 7373 6167 6520 746f 6f20 6c61 7267 message too larg │ │ │ +00141a90: 6520 746f 2073 746f 7265 2069 6e20 6120 e to store in a │ │ │ +00141aa0: 5544 5020 7061 636b 6574 2020 2020 3c2f UDP packet
    #SOAP_USER_ER │ │ │ +00141b10: 524f 523c 2f63 6f64 653e 2020 203c 2f74 ROR soap │ │ │ +00141c00: 3a3a 7573 6572 3c2f 613e 206e 6f74 2073 ::user not s │ │ │ +00141c10: 6574 2074 6f20 6e6f 6e2d 4e55 4c4c 2020 et to non-NULL │ │ │ +00141c20: 2020 3c2f 7464 3e3c 2f74 723e 0a3c 7472
    An UTF-8 d │ │ │ +00141cc0: 6563 6f64 696e 6720 6572 726f 7220 6f63 ecoding error oc │ │ │ +00141cd0: 6375 7272 6564 2020 2020 3c2f 7464 3e3c curred
    # │ │ │ +00141d30: 534f 4150 5f56 4552 5349 4f4e 4d49 534d SOAP_VERSIONMISM │ │ │ +00141d40: 4154 4348 3c2f 636f 6465 3e20 2020 3c2f ATCH SOAP versio │ │ │ +00141d80: 6e20 6d69 736d 6174 6368 206f 7220 6e6f n mismatch or no │ │ │ +00141d90: 2053 4f41 5020 6d65 7373 6167 6520 6973 SOAP message is │ │ │ +00141da0: 2072 6563 6569 7665 6420 2020 203c 2f74 received
    #SOAP_ZLIB_ERRO │ │ │ +00141e10: 523c 2f63 6f64 653e 2020 203c 2f74 643e R A zlib error o │ │ │ +00141e50: 6363 7572 7265 6420 2020 3c2f 7464 3e3c ccurred
    .

    A status code o │ │ │ +00141e80: 6620 3c63 6f64 653e 2353 4f41 505f 4f4b f #SOAP_OK │ │ │ +00141e90: 3c2f 636f 6465 3e20 287a 6572 6f29 2069 (zero) i │ │ │ +00141ea0: 7320 7265 7475 726e 6564 2062 7920 6120 s returned by a │ │ │ +00141eb0: 6753 4f41 5020 4150 4920 6675 6e63 7469 gSOAP API functi │ │ │ +00141ec0: 6f6e 2077 6865 6e20 7468 6520 6675 6e63 on when the func │ │ │ +00141ed0: 7469 6f6e 2063 616c 6c20 7761 7320 7375 tion call was su │ │ │ +00141ee0: 6363 6573 7366 756c 2c20 6f74 6865 7277 ccessful, otherw │ │ │ +00141ef0: 6973 6520 6120 6e6f 6e2d 7a65 726f 2065 ise a non-zero e │ │ │ +00141f00: 7272 6f72 2063 6f64 6520 6973 2072 6574 rror code is ret │ │ │ +00141f10: 7572 6e65 642e 2054 6865 2073 7461 7475 urned. The statu │ │ │ +00141f20: 7320 6572 726f 7220 636f 6465 2069 7320 s error code is │ │ │ +00141f30: 616c 736f 2073 746f 7265 6420 696e 2074 also stored in t │ │ │ +00141f40: 6865 2063 7572 7265 6e74 203c 636f 6465 he current soa │ │ │ +00141fa0: 703c 2f61 3e3c 2f63 6f64 653e 2063 6f6e p con │ │ │ +00141fb0: 7465 7874 2061 7320 3c63 6f64 653e 3c61 text as soap::error< │ │ │ +00142070: 2f61 3e3c 2f63 6f64 653e 2e20 466f 7220 /a>. For │ │ │ +00142080: 494f 2061 6e64 2073 6f63 6b65 742d 7265 IO and socket-re │ │ │ +00142090: 6c61 7465 6420 6572 726f 7273 2c20 616c lated errors, al │ │ │ +001420a0: 736f 2074 6865 203c 636f 6465 3e3c 6120 so the soa │ │ │ +00142130: 703a 3a65 7272 6e75 6d3c 2f61 3e3c 2f63 p::errnum variable is │ │ │ +00142150: 2073 6574 2074 6f20 7468 6520 3c63 6f64 set to the errno v │ │ │ +00142170: 616c 7565 206f 6620 7468 6520 7379 7374 alue of the syst │ │ │ +00142180: 656d 2065 7272 6f72 2066 6f72 2065 7861 em error for exa │ │ │ +00142190: 6d70 6c65 2077 6865 6e20 6120 3c63 6f64 mple when a #SOAP_EOF error occurre │ │ │ +001421c0: 642e 3c2f 703e 0a3c 703e 546f 2064 6973 d.

    .

    To dis │ │ │ +001421d0: 706c 6179 2074 6865 2065 7272 6f72 2c20 play the error, │ │ │ +001421e0: 7573 6520 3c63 6f64 653e 3c61 2063 6c61 use │ │ │ +00142270: 736f 6170 5f70 7269 6e74 5f66 6175 6c74 soap_print_fault │ │ │ +00142280: 2873 7472 7563 7420 736f 6170 202a 736f (struct soap *so │ │ │ +00142290: 6170 2c20 4649 4c45 202a 6664 293c 2f61 ap, FILE *fd) where t │ │ │ +001422b0: 6865 2063 7572 7265 6e74 2076 616c 7565 he current value │ │ │ +001422c0: 206f 6620 3c63 6f64 653e 3c61 2063 6c61 of │ │ │ +00142370: 736f 6170 3a3a 6572 726f 723c 2f61 3e3c soap::error< │ │ │ +00142380: 2f63 6f64 653e 2069 7320 7573 6564 2062 /code> is used b │ │ │ +00142390: 7920 7468 6520 6675 6e63 7469 6f6e 2074 y the function t │ │ │ +001423a0: 6f20 7072 696e 7420 7468 6520 6572 726f o print the erro │ │ │ +001423b0: 7220 746f 2074 6865 2073 7065 6369 6669 r to the specifi │ │ │ +001423c0: 6564 203c 636f 6465 3e66 643c 2f63 6f64 ed fd file. Alterna │ │ │ +001423e0: 7469 7665 6c79 2c20 696e 2043 2b2b 2079 tively, in C++ y │ │ │ +001423f0: 6f75 2063 616e 2075 7365 203c 636f 6465 ou can use so │ │ │ +00142490: 6170 5f73 7472 6561 6d5f 6661 756c 7428 ap_stream_fault( │ │ │ +001424a0: 7374 7275 6374 2073 6f61 7020 2a73 6f61 struct soap *soa │ │ │ +001424b0: 702c 2073 7464 3a3a 6f73 7472 6561 6d26 p, std::ostream& │ │ │ +001424c0: 616d 703b 206f 7329 3c2f 613e 3c2f 636f amp; os) to print the │ │ │ +001424e0: 2065 7272 6f72 206f 6e20 7468 6520 7370 error on the sp │ │ │ +001424f0: 6563 6966 6965 6420 3c63 6f64 653e 6f73 ecified os │ │ │ +00142500: 3c2f 636f 6465 3e20 6f75 7470 7574 2073 output s │ │ │ +00142510: 7472 6561 6d2e 3c2f 703e 0a3c 703e 546f tream.

    .

    To │ │ │ +00142520: 2064 6973 706c 6179 2074 6865 206c 6f63 display the loc │ │ │ +00142530: 6174 696f 6e20 6f66 2061 6e20 584d 4c20 ation of an XML │ │ │ +00142540: 7061 7273 696e 6720 616e 6420 7661 6c69 parsing and vali │ │ │ +00142550: 6461 7469 6f6e 2065 7272 6f72 2c20 7573 dation error, us │ │ │ +00142560: 6520 3c63 6f64 653e 3c61 2063 6c61 7373 e soap_print │ │ │ +00142610: 5f66 6175 6c74 5f6c 6f63 6174 696f 6e28 _fault_location( │ │ │ +00142620: 7374 7275 6374 2073 6f61 7020 2a73 6f61 struct soap *soa │ │ │ +00142630: 702c 2046 494c 4520 2a66 6429 3c2f 613e p, FILE *fd) │ │ │ +00142640: 3c2f 636f 6465 3e20 6f72 203c 636f 6465 or s │ │ │ +001426f0: 6f61 705f 7374 7265 616d 5f66 6175 6c74 oap_stream_fault │ │ │ +00142700: 5f6c 6f63 6174 696f 6e28 7374 7275 6374 _location(struct │ │ │ +00142710: 2073 6f61 7020 2a73 6f61 702c 2073 7464 soap *soap, std │ │ │ +00142720: 3a3a 6f73 7472 6561 6d26 616d 703b 206f ::ostream& o │ │ │ +00142730: 7329 3c2f 613e 3c2f 636f 6465 3e20 746f s) to │ │ │ +00142740: 2070 7269 6e74 2070 6172 7420 6f66 2074 print part of t │ │ │ +00142750: 6865 2058 4d4c 2077 6974 6820 7468 6520 he XML with the │ │ │ +00142760: 6572 726f 7220 6c6f 6361 7469 6f6e 206d error location m │ │ │ +00142770: 6172 6b65 6420 696e 2074 6865 2058 4d4c arked in the XML │ │ │ +00142780: 206f 7574 7075 742e 3c2f 703e 0a3c 703e output.

    .

    │ │ │ +00142790: 546f 2073 6176 6520 7468 6520 6572 726f To save the erro │ │ │ +001427a0: 7220 696e 2061 2073 7472 696e 6720 6275 r in a string bu │ │ │ +001427b0: 6666 6572 203c 636f 6465 3e62 7566 5b30 ffer buf[0 │ │ │ +001427c0: 2e2e 2e6c 656e 2d31 5d3c 2f63 6f64 653e ...len-1] │ │ │ +001427d0: 2c20 7573 6520 3c63 6f64 653e 3c61 2063 , use soap_sp │ │ │ +00142870: 7269 6e74 5f66 6175 6c74 2873 7472 7563 rint_fault(struc │ │ │ +00142880: 7420 736f 6170 2a2c 2063 6861 7220 2a62 t soap*, char *b │ │ │ +00142890: 7566 2c20 7369 7a65 5f74 206c 656e 293c uf, size_t len)< │ │ │ +001428a0: 2f61 3e3c 2f63 6f64 653e 2c20 7768 6572 /a>, wher │ │ │ +001428b0: 6520 3c63 6f64 653e 6275 663c 2f63 6f64 e buf is populated │ │ │ +001428d0: 7769 7468 2074 6865 2066 6175 6c74 206d with the fault m │ │ │ +001428e0: 6573 7361 6765 2074 6572 6d69 6e61 7469 essage terminati │ │ │ +001428f0: 6e67 2077 6974 6820 6120 3c63 6f64 653e ng with a │ │ │ +00142900: 5c30 3c2f 636f 6465 3e2e 3c2f 703e 0a3c \0.

    .< │ │ │ +00142910: 703e 546f 2064 6574 6572 6d69 6e65 2074 p>To determine t │ │ │ +00142920: 6865 2074 7970 6520 6f66 2065 7272 6f72 he type of error │ │ │ +00142930: 2074 6861 7420 6f63 6375 7272 6564 2c20 that occurred, │ │ │ +00142940: 7573 653a 3c2f 703e 3c75 6c3e 0a3c 6c69 use:

    .

    An HTT │ │ │ +001435f0: 5020 7374 6174 7573 2063 6f64 6520 6973 P status code is │ │ │ +00143600: 2072 6574 7572 6e65 6420 7768 656e 2074 returned when t │ │ │ +00143610: 6865 2063 6c69 656e 7420 6661 696c 7320 he client fails │ │ │ +00143620: 746f 2063 6f6e 6e65 6374 2074 6f20 616e to connect to an │ │ │ +00143630: 2048 5454 5020 7365 7276 6572 2061 6e64 HTTP server and │ │ │ +00143640: 2074 6865 2048 5454 5020 7365 7276 6572 the HTTP server │ │ │ +00143650: 2072 6573 706f 6e73 6520 7769 7468 2061 response with a │ │ │ +00143660: 6e20 6572 726f 722e 2054 6865 206c 6973 n error. The lis │ │ │ +00143670: 7420 6f66 2048 5454 5020 7374 6174 7573 t of HTTP status │ │ │ +00143680: 2063 6f64 6573 2069 7320 6769 7665 6e20 codes is given │ │ │ +00143690: 6265 6c6f 773a 3c2f 703e 0a3c 7461 626c below:

    ...Code │ │ │ +00143700: 203c 2f74 683e 3c74 6820 636c 6173 733d Descript │ │ │ +00143730: 696f 6e20 2020 203c 2f74 683e 3c2f 7472 ion ..200 │ │ │ +00143790: 3c74 6420 636c 6173 733d 226d 6172 6b64 OK (no error) │ │ │ +001437c0: 2020 203c 2f74 643e 3c2f 7472 3e0a 3c74 .. │ │ │ +001437f0: 3c74 6420 636c 6173 733d 226d 6172 6b64 201 C │ │ │ +00143840: 7265 6174 6564 2020 2020 3c2f 7464 3e3c reated < │ │ │ +00143850: 2f74 723e 0a3c 7472 2063 6c61 7373 3d22 /tr>..202 Accepted │ │ │ +001438d0: 203c 2f74 643e 3c2f 7472 3e0a 3c74 7220 .. │ │ │ +00143920: 3230 3320 2020 3c2f 7464 3e3c 7464 2063 203 Non │ │ │ +00143950: 2d41 7574 686f 7269 7461 7469 7665 2049 -Authoritative I │ │ │ +00143960: 6e66 6f72 6d61 7469 6f6e 2020 2020 3c2f nformation ..204 │ │ │ +001439c0: 2020 3c2f 7464 3e3c 7464 2063 6c61 7373 No Cont │ │ │ +001439f0: 656e 7420 2020 203c 2f74 643e 3c2f 7472 ent ..205 Reset Content │ │ │ +00143a80: 2020 2020 3c2f 7464 3e3c 2f74 723e 0a3c .< │ │ │ +00143a90: 7472 2063 6c61 7373 3d22 6d61 726b 646f tr class="markdo │ │ │ +00143aa0: 776e 5461 626c 6552 6f77 4f64 6422 3e0a wnTableRowOdd">. │ │ │ +00143ab0: 3c74 6420 636c 6173 733d 226d 6172 6b64 206 P │ │ │ +00143b00: 6172 7469 616c 2043 6f6e 7465 6e74 2020 artial Content │ │ │ +00143b10: 2020 3c2f 7464 3e3c 2f74 723e 0a3c 7472 ..< │ │ │ +00143b40: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ +00143b50: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ +00143b60: 3e33 3030 2020 203c 2f74 643e 3c74 6420 >300 Mu │ │ │ +00143b90: 6c74 6970 6c65 2043 686f 6963 6573 2020 ltiple Choices │ │ │ +00143ba0: 2020 3c2f 7464 3e3c 2f74 723e 0a3c 7472 .. │ │ │ +00143bf0: 3330 3120 2020 3c2f 7464 3e3c 7464 2063 301 Mov │ │ │ +00143c20: 6564 2050 6572 6d61 6e65 6e74 6c79 2020 ed Permanently │ │ │ +00143c30: 2020 3c2f 7464 3e3c 2f74 723e 0a3c 7472 ..< │ │ │ +00143c60: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ +00143c70: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ +00143c80: 3e33 3032 2020 203c 2f74 643e 3c74 6420 >302 Fo │ │ │ +00143cb0: 756e 6420 2020 203c 2f74 643e 3c2f 7472 und ..303 │ │ │ +00143d10: 3c74 6420 636c 6173 733d 226d 6172 6b64 See Other < │ │ │ +00143d40: 2f74 643e 3c2f 7472 3e0a 3c74 7220 636c /td>..30 │ │ │ +00143d90: 3420 2020 3c2f 7464 3e3c 7464 2063 6c61 4 Not M │ │ │ +00143dc0: 6f64 6966 6965 6420 2020 203c 2f74 643e odified │ │ │ +00143dd0: 3c2f 7472 3e0a 3c74 7220 636c 6173 733d ..305 < │ │ │ +00143e20: 2f74 643e 3c74 6420 636c 6173 733d 226d /td>Use Proxy │ │ │ +00143e50: 2020 203c 2f74 643e 3c2f 7472 3e0a 3c74 .. │ │ │ +00143e80: 3c74 6420 636c 6173 733d 226d 6172 6b64 307 T │ │ │ +00143ed0: 656d 706f 7261 7279 2052 6564 6972 6563 emporary Redirec │ │ │ +00143ee0: 7420 2020 203c 2f74 643e 3c2f 7472 3e0a t . │ │ │ +00143ef0: 3c74 7220 636c 6173 733d 226d 6172 6b64 │ │ │ +00143f10: 0a3c 7464 2063 6c61 7373 3d22 6d61 726b .400 │ │ │ +00143f60: 4261 6420 5265 7175 6573 7420 2020 203c Bad Request < │ │ │ +00143f70: 2f74 643e 3c2f 7472 3e0a 3c74 7220 636c /td>..40 │ │ │ +00143fc0: 3120 2020 3c2f 7464 3e3c 7464 2063 6c61 1 Unaut │ │ │ +00143ff0: 686f 7269 7a65 6420 2020 203c 2f74 643e horized │ │ │ +00144000: 3c2f 7472 3e0a 3c74 7220 636c 6173 733d ..402 < │ │ │ +00144050: 2f74 643e 3c74 6420 636c 6173 733d 226d /td>Payment Re │ │ │ +00144080: 7175 6972 6564 2020 2020 3c2f 7464 3e3c quired < │ │ │ +00144090: 2f74 723e 0a3c 7472 2063 6c61 7373 3d22 /tr>..403 < │ │ │ +001440e0: 2f74 643e 3c74 6420 636c 6173 733d 226d /td>Forbidden │ │ │ +00144110: 2020 203c 2f74 643e 3c2f 7472 3e0a 3c74 ..< │ │ │ +00144140: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ +00144150: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ +00144160: 3e34 3034 2020 203c 2f74 643e 3c74 6420 >404 No │ │ │ +00144190: 7420 466f 756e 6420 2020 203c 2f74 643e t Found │ │ │ +001441a0: 3c2f 7472 3e0a 3c74 7220 636c 6173 733d ..405 │ │ │ +001441f0: 3c2f 7464 3e3c 7464 2063 6c61 7373 3d22 Method No │ │ │ +00144220: 7420 416c 6c6f 7765 6420 2020 203c 2f74 t Allowed ..406 │ │ │ +00144280: 203c 2f74 643e 3c74 6420 636c 6173 733d Not Acce │ │ │ +001442b0: 7074 6162 6c65 2020 2020 3c2f 7464 3e3c ptable < │ │ │ +001442c0: 2f74 723e 0a3c 7472 2063 6c61 7373 3d22 /tr>..407 < │ │ │ +00144310: 2f74 643e 3c74 6420 636c 6173 733d 226d /td>Proxy Auth │ │ │ +00144340: 656e 7469 6361 7469 6f6e 2052 6571 7569 entication Requi │ │ │ +00144350: 7265 6420 2020 203c 2f74 643e 3c2f 7472 red ..408 │ │ │ +001443b0: 3c74 6420 636c 6173 733d 226d 6172 6b64 Request Time-o │ │ │ +001443e0: 7574 2020 2020 3c2f 7464 3e3c 2f74 723e ut │ │ │ +001443f0: 0a3c 7472 2063 6c61 7373 3d22 6d61 726b ..409 │ │ │ +00144440: 3c74 6420 636c 6173 733d 226d 6172 6b64 Conflict ..410 │ │ │ +001444c0: 2020 3c2f 7464 3e3c 7464 2063 6c61 7373 Gone │ │ │ +001444f0: 203c 2f74 643e 3c2f 7472 3e0a 3c74 7220 .. │ │ │ +00144540: 3431 3120 2020 3c2f 7464 3e3c 7464 2063 411 Len │ │ │ +00144570: 6774 6820 5265 7175 6972 6564 2020 2020 gth Required │ │ │ +00144580: 3c2f 7464 3e3c 2f74 723e 0a3c 7472 2063 ..41 │ │ │ +001445d0: 3220 2020 3c2f 7464 3e3c 7464 2063 6c61 2 Preco │ │ │ +00144600: 6e64 6974 696f 6e20 4661 696c 6564 2020 ndition Failed │ │ │ +00144610: 2020 3c2f 7464 3e3c 2f74 723e 0a3c 7472 ..< │ │ │ +00144640: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ +00144650: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ +00144660: 3e34 3133 2020 203c 2f74 643e 3c74 6420 >413 Re │ │ │ +00144690: 7175 6573 7420 456e 7469 7479 2054 6f6f quest Entity Too │ │ │ +001446a0: 204c 6172 6765 2020 2020 3c2f 7464 3e3c Large < │ │ │ +001446b0: 2f74 723e 0a3c 7472 2063 6c61 7373 3d22 /tr>..414 Request-URI │ │ │ +00144730: 2054 6f6f 204c 6172 6765 2020 2020 3c2f Too Large ..415 │ │ │ +00144790: 2020 203c 2f74 643e 3c74 6420 636c 6173 Unsupp │ │ │ +001447c0: 6f72 7465 6420 4d65 6469 6120 5479 7065 orted Media Type │ │ │ +001447d0: 2020 2020 3c2f 7464 3e3c 2f74 723e 0a3c .< │ │ │ +001447e0: 7472 2063 6c61 7373 3d22 6d61 726b 646f tr class="markdo │ │ │ +001447f0: 776e 5461 626c 6552 6f77 4f64 6422 3e0a wnTableRowOdd">. │ │ │ +00144800: 3c74 6420 636c 6173 733d 226d 6172 6b64 416 R │ │ │ +00144850: 6571 7565 7374 6564 2072 616e 6765 206e equested range n │ │ │ +00144860: 6f74 2073 6174 6973 6669 6162 6c65 2020 ot satisfiable │ │ │ +00144870: 2020 3c2f 7464 3e3c 2f74 723e 0a3c 7472 ..< │ │ │ +001448a0: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ +001448b0: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ +001448c0: 3e34 3137 2020 203c 2f74 643e 3c74 6420 >417 Ex │ │ │ +001448f0: 7065 6374 6174 696f 6e20 4661 696c 6564 pectation Failed │ │ │ +00144900: 2020 2020 3c2f 7464 3e3c 2f74 723e 0a3c .< │ │ │ +00144910: 7472 2063 6c61 7373 3d22 6d61 726b 646f tr class="markdo │ │ │ +00144920: 776e 5461 626c 6552 6f77 4f64 6422 3e0a wnTableRowOdd">. │ │ │ +00144930: 3c74 6420 636c 6173 733d 226d 6172 6b64 500 I │ │ │ +00144980: 6e74 6572 6e61 6c20 5365 7276 6572 2045 nternal Server E │ │ │ +00144990: 7272 6f72 2020 2020 3c2f 7464 3e3c 2f74 rror ..501 Not Implemen │ │ │ +00144a20: 7465 6420 2020 203c 2f74 643e 3c2f 7472 ted ..502 │ │ │ +00144a80: 3c74 6420 636c 6173 733d 226d 6172 6b64 Bad Gateway │ │ │ +00144ab0: 203c 2f74 643e 3c2f 7472 3e0a 3c74 7220 .. │ │ │ +00144b00: 3530 3320 2020 3c2f 7464 3e3c 7464 2063 503 Ser │ │ │ +00144b30: 7669 6365 2055 6e61 7661 696c 6162 6c65 vice Unavailable │ │ │ +00144b40: 2020 2020 3c2f 7464 3e3c 2f74 723e 0a3c .< │ │ │ +00144b50: 7472 2063 6c61 7373 3d22 6d61 726b 646f tr class="markdo │ │ │ +00144b60: 776e 5461 626c 6552 6f77 4f64 6422 3e0a wnTableRowOdd">. │ │ │ +00144b70: 3c74 6420 636c 6173 733d 226d 6172 6b64 504 G │ │ │ +00144bc0: 6174 6577 6179 2054 696d 652d 6f75 7420 ateway Time-out │ │ │ +00144bd0: 2020 203c 2f74 643e 3c2f 7472 3e0a 3c74 .. │ │ │ +00144c00: 3c74 6420 636c 6173 733d 226d 6172 6b64 505 H │ │ │ +00144c50: 5454 5020 5665 7273 696f 6e20 6e6f 7420 TTP Version not │ │ │ +00144c60: 7375 7070 6f72 7465 6420 2020 3c2f 7464 supported .. │ │ │ +00144c80: 3c70 3e48 5454 5020 7374 6174 7573 2063

    HTTP status c │ │ │ +00144c90: 6f64 6520 3230 3020 6973 206e 6f74 2066 ode 200 is not f │ │ │ +00144ca0: 6c61 6767 6564 2061 7320 616e 2065 7272 lagged as an err │ │ │ +00144cb0: 6f72 2062 7920 7468 6520 656e 6769 6e65 or by the engine │ │ │ +00144cc0: 2e20 5374 6174 7573 2063 6f64 6573 2032 . Status codes 2 │ │ │ +00144cd0: 3031 2061 6e64 2032 3032 2061 7265 2069 01 and 202 are i │ │ │ +00144ce0: 6e66 6f72 6d61 7469 7665 2061 6e64 2073 nformative and s │ │ │ +00144cf0: 686f 756c 6420 6e6f 7420 6265 2063 6f6e hould not be con │ │ │ +00144d00: 7369 6465 7265 6420 6572 726f 7273 2062 sidered errors b │ │ │ +00144d10: 7920 7468 6520 6170 706c 6963 6174 696f y the applicatio │ │ │ +00144d20: 6e20 6c6f 6769 632e 3c2f 703e 0a3c 703e n logic.

    .

    │ │ │ +00144d30: 5365 7276 6572 2d73 6964 6520 696d 706c Server-side impl │ │ │ +00144d40: 656d 656e 7461 7469 6f6e 7320 6f66 2073 ementations of s │ │ │ +00144d50: 6572 7669 6365 206f 7065 7261 7469 6f6e ervice operation │ │ │ +00144d60: 7320 7368 6f75 6c64 2072 6574 7572 6e20 s should return │ │ │ +00144d70: 3c63 6f64 653e 2353 4f41 505f 4f4b 3c2f #SOAP_OK when the o │ │ │ +00144d90: 7065 7261 7469 6f6e 2077 6173 2073 7563 peration was suc │ │ │ +00144da0: 6365 7373 6675 6c2c 2077 6869 6368 2072 cessful, which r │ │ │ +00144db0: 6574 7572 6e73 2061 2022 3230 3020 4f4b eturns a "200 OK │ │ │ +00144dc0: 2220 4854 5450 2068 6561 6465 7220 7769 " HTTP header wi │ │ │ +00144dd0: 7468 2074 6865 2058 4d4c 2072 6573 706f th the XML respo │ │ │ +00144de0: 6e73 6520 6d65 7373 6167 652e 2053 6572 nse message. Ser │ │ │ +00144df0: 7665 722d 7369 6465 2069 6d70 6c65 6d65 ver-side impleme │ │ │ +00144e00: 6e74 6174 696f 6e73 206f 6620 7365 7276 ntations of serv │ │ │ +00144e10: 6963 6520 6f70 6572 6174 696f 6e73 2069 ice operations i │ │ │ +00144e20: 6e20 6753 4f41 5020 6d61 7920 6469 7265 n gSOAP may dire │ │ │ +00144e30: 6374 6c79 2072 6574 7572 6e20 616e 2048 ctly return an H │ │ │ +00144e40: 5454 5020 7374 6174 7573 2063 6f64 6520 TTP status code │ │ │ +00144e50: 7768 656e 2061 6e20 4854 5450 2d72 656c when an HTTP-rel │ │ │ +00144e60: 6174 6564 2065 7272 6f72 2073 686f 756c ated error shoul │ │ │ +00144e70: 6420 6265 2072 6574 7572 6e65 642e 2046 d be returned. F │ │ │ +00144e80: 6f72 2065 7861 6d70 6c65 2c20 3c63 6f64 or example, return 404 returns "404 │ │ │ +00144eb0: 204e 6f74 2046 6f75 6e64 2220 746f 2074 Not Found" to t │ │ │ +00144ec0: 6865 2063 6c69 656e 7420 616e 6420 7468 he client and th │ │ │ +00144ed0: 6520 3c63 6f64 653e 3c61 2063 6c61 7373 e so │ │ │ +00144f80: 6170 3a3a 6572 726f 723c 2f61 3e3c 2f63 ap::error variable is │ │ │ +00144fa0: 2073 6574 2074 6f20 3430 3420 6174 2074 set to 404 at t │ │ │ +00144fb0: 6865 2063 6c69 656e 7420 7369 6465 2e3c he client side.< │ │ │ +00144fc0: 2f70 3e0a 3c70 3e54 6f20 7265 7475 726e /p>.

    To return │ │ │ +00144fd0: 2061 2053 4f41 5020 4661 756c 7420 6672 a SOAP Fault fr │ │ │ +00144fe0: 6f6d 2061 2073 6572 7665 722d 7369 6465 om a server-side │ │ │ +00144ff0: 2069 6d70 6c65 6d65 6e74 6174 696f 6e20 implementation │ │ │ +00145000: 6f66 2061 2073 6572 7669 6365 206f 7065 of a service ope │ │ │ +00145010: 7261 7469 6f6e 2c20 7573 6520 6f6e 6520 ration, use one │ │ │ +00145020: 6f66 2074 6865 2066 6f6c 6c6f 7769 6e67 of the following │ │ │ +00145030: 2066 756e 6374 696f 6e73 2074 6f20 706f functions to po │ │ │ +00145040: 7075 6c61 7465 2074 6865 2053 4f41 5020 pulate the SOAP │ │ │ +00145050: 4661 756c 7420 6d65 7373 6167 653a 3c2f Fault message:

    .

    A rece │ │ │ +00145940: 6976 6572 2065 7272 6f72 2069 6e64 6963 iver error indic │ │ │ +00145950: 6174 6573 2074 6861 7420 7468 6520 7365 ates that the se │ │ │ +00145960: 7276 6963 6520 636f 756c 6420 6e6f 7420 rvice could not │ │ │ +00145970: 6861 6e64 6c65 2074 6865 2063 6c69 656e handle the clien │ │ │ +00145980: 7420 7265 7175 6573 742c 2062 7574 2069 t request, but i │ │ │ +00145990: 7420 6361 6e20 706f 7373 6962 6c79 2072 t can possibly r │ │ │ +001459a0: 6563 6f76 6572 2066 726f 6d20 7468 6520 ecover from the │ │ │ +001459b0: 6572 726f 7220 6c61 7465 722c 2066 6f72 error later, for │ │ │ +001459c0: 2065 7861 6d70 6c65 2077 6865 6e20 7265 example when re │ │ │ +001459d0: 736f 7572 6365 7320 6172 6520 7465 6d70 sources are temp │ │ │ +001459e0: 6f72 6172 696c 7920 756e 6176 6169 6c61 orarily unavaila │ │ │ +001459f0: 626c 652e 2041 2073 656e 6465 7220 6572 ble. A sender er │ │ │ +00145a00: 726f 7220 696e 6469 6361 7465 7320 7468 ror indicates th │ │ │ +00145a10: 6174 2074 6865 2063 6c69 656e 7420 7265 at the client re │ │ │ +00145a20: 7175 6573 7420 6973 2066 6175 6c74 7920 quest is faulty │ │ │ +00145a30: 616e 6420 7320 7265 6a65 6374 6564 2062 and s rejected b │ │ │ +00145a40: 7920 7468 6520 7365 7276 6963 652e 3c2f y the service..

    See Sectio │ │ │ +00145a60: 6e20 3c61 2063 6c61 7373 3d22 656c 2220 n SOAP Fau │ │ │ +00145a90: 6c74 2070 726f 6365 7373 696e 673c 2f61 lt processing for more detai │ │ │ +00145ab0: 6c73 206f 6e20 686f 7720 746f 2075 7365 ls on how to use │ │ │ +00145ac0: 2074 6865 7365 2066 756e 6374 696f 6e73 these functions │ │ │ +00145ad0: 2e3c 2f70 3e0a 3c70 3ef0 9f94 9d20 3c61 .

    .

    .... Back t │ │ │ +00145af0: 6f20 7461 626c 6520 6f66 2063 6f6e 7465 o table of conte │ │ │ +00145b00: 6e74 733c 2f61 3e3c 2f70 3e0a 3c68 313e nts

    .

    │ │ │ +00145b10: 3c61 2063 6c61 7373 3d22 616e 6368 6f72 .Memory manage │ │ │ +00145b40: 6d65 6e74 3c2f 6831 3e0a 3c70 3e4d 656d ment

    .

    Mem │ │ │ +00145b50: 6f72 7920 6d61 6e61 6765 6d65 6e74 2077 ory management w │ │ │ +00145b60: 6974 6820 6753 4f41 5020 6973 2061 7574 ith gSOAP is aut │ │ │ +00145b70: 6f6d 6174 6963 2e20 5468 6520 656e 6769 omatic. The engi │ │ │ +00145b80: 6e65 2063 6f6e 7465 7874 206d 616e 6167 ne context manag │ │ │ +00145b90: 6573 2061 6c6c 206d 656d 6f72 7920 616c es all memory al │ │ │ +00145ba0: 6c6f 6361 7465 6420 746f 2073 6572 6961 located to seria │ │ │ +00145bb0: 6c69 7a65 2064 6174 6120 616e 6420 666f lize data and fo │ │ │ +00145bc0: 7220 7465 6d70 6f72 6172 7920 7374 6f72 r temporary stor │ │ │ +00145bd0: 6167 652e 2044 6573 6572 6961 6c69 7a65 age. Deserialize │ │ │ +00145be0: 6420 6461 7461 2069 7320 616c 6c6f 6361 d data is alloca │ │ │ +00145bf0: 7465 6420 696e 206d 616e 6167 6564 206d ted in managed m │ │ │ +00145c00: 656d 6f72 7920 616e 6420 6461 7461 2073 emory and data s │ │ │ +00145c10: 7472 7563 7475 7265 7320 6361 6e20 6265 tructures can be │ │ │ +00145c20: 2061 6c6c 6f63 6174 6564 2069 6e20 6d61 allocated in ma │ │ │ +00145c30: 6e61 6765 6420 6d65 6d6f 7279 2062 7920 naged memory by │ │ │ +00145c40: 7468 6520 7573 6572 2077 6865 6e20 6465 the user when de │ │ │ +00145c50: 7369 7265 6420 7573 696e 6720 3c63 6f64 sired using soap_new_T functions ge │ │ │ +00145c80: 6e65 7261 7465 6420 6279 2073 6f61 7063 nerated by soapc │ │ │ +00145c90: 7070 3220 666f 7220 6561 6368 2073 6572 pp2 for each ser │ │ │ +00145ca0: 6961 6c69 7a61 626c 6520 7479 7065 203c ializable type < │ │ │ +00145cb0: 636f 6465 3e54 3c2f 636f 6465 3e2e 2041 code>T. A │ │ │ +00145cc0: 6c6c 206d 656d 6f72 7920 6d61 6e61 6765 ll memory manage │ │ │ +00145cd0: 6420 6279 2061 2063 6f6e 7465 7874 2069 d by a context i │ │ │ +00145ce0: 7320 6465 616c 6c6f 6361 7465 6420 7769 s deallocated wi │ │ │ +00145cf0: 7468 203c 636f 6465 3e3c 6120 636c 6173 th soap_des │ │ │ +00145db0: 7472 6f79 3c2f 613e 3c2f 636f 6465 3e20 troy │ │ │ +00145dc0: 746f 2064 6573 7472 6f79 206d 616e 6167 to destroy manag │ │ │ +00145dd0: 6564 2043 2b2b 206f 626a 6563 7473 2061 ed C++ objects a │ │ │ +00145de0: 6e64 203c 636f 6465 3e3c 6120 636c 6173 nd soa │ │ │ +00145eb0: 705f 656e 643c 2f61 3e3c 2f63 6f64 653e p_end │ │ │ +00145ec0: 2074 6f20 6465 6c65 7465 2061 6c6c 206f to delete all o │ │ │ +00145ed0: 7468 6572 206d 616e 6167 6564 2064 6174 ther managed dat │ │ │ +00145ee0: 612e 2057 6865 6e20 6120 636f 6e74 6578 a. When a contex │ │ │ +00145ef0: 7420 6973 2066 696e 616c 697a 6564 206f t is finalized o │ │ │ +00145f00: 7220 6672 6565 6420 7769 7468 203c 636f r freed with soap_done │ │ │ +00145fe0: 2873 7472 7563 7420 736f 6170 2a29 3c2f (struct soap*) and soap_free(st │ │ │ +001460b0: 7275 6374 2073 6f61 702a 293c 2f61 3e3c ruct soap*)< │ │ │ +001460c0: 2f63 6f64 653e 2074 6865 6e20 6d61 6e61 /code> then mana │ │ │ +001460d0: 6765 6420 6d65 6d6f 7279 2069 7320 6e6f ged memory is no │ │ │ +001460e0: 7420 7265 6c65 6173 6564 2c20 736f 2069 t released, so i │ │ │ +001460f0: 7420 6973 2069 6d70 6f72 7461 6e74 2074 t is important t │ │ │ +00146100: 6f20 6361 6c6c 2074 6865 2064 6561 6c6c o call the deall │ │ │ +00146110: 6f63 6174 696f 6e20 6675 6e63 7469 6f6e ocation function │ │ │ +00146120: 7320 6669 7273 742e 2054 6869 7320 7761 s first. This wa │ │ │ +00146130: 7320 646f 6e65 2074 6f20 616c 6c6f 7720 s done to allow │ │ │ +00146140: 6d61 6e61 6765 6420 6461 7461 2074 6f20 managed data to │ │ │ +00146150: 6f75 746c 6976 6520 7468 6520 636f 6e74 outlive the cont │ │ │ +00146160: 6578 742c 2073 7563 6820 6173 2064 6573 ext, such as des │ │ │ +00146170: 6572 6961 6c69 7a65 6420 6f62 6a65 6374 erialized object │ │ │ +00146180: 732c 2062 7574 2074 6869 7320 6973 2072 s, but this is r │ │ │ +00146190: 6172 656c 7920 6966 2065 7665 7220 7573 arely if ever us │ │ │ +001461a0: 6564 2062 6563 6175 7365 2064 656c 6574 ed because delet │ │ │ +001461b0: 696e 6720 7468 6520 6f75 746c 6976 6564 ing the outlived │ │ │ +001461c0: 2064 6174 6120 6578 706c 6963 6974 6c79 data explicitly │ │ │ +001461d0: 2069 7320 7072 6f6e 6520 746f 206d 6973 is prone to mis │ │ │ +001461e0: 7461 6b65 732e 3c2f 703e 0a3c 703e 4966 takes.

    .

    If │ │ │ +001461f0: 2079 6f75 2077 616e 7420 746f 206c 6574 you want to let │ │ │ +00146200: 2064 6573 6572 6961 6c69 7a65 6420 6461 deserialized da │ │ │ +00146210: 7461 206f 7574 6c69 7665 2061 203c 636f ta outlive a s │ │ │ +00146270: 6f61 703c 2f61 3e3c 2f63 6f64 653e 2063 oap c │ │ │ +00146280: 6f6e 7465 7874 2074 6861 7420 796f 7520 ontext that you │ │ │ +00146290: 6172 6520 6162 6f75 7420 746f 2066 7265 are about to fre │ │ │ +001462a0: 652c 2074 6865 6e20 796f 7520 6361 6e20 e, then you can │ │ │ +001462b0: 6465 6c65 6761 7465 206d 616e 6167 656d delegate managem │ │ │ +001462c0: 656e 7420 6f66 2074 6865 2064 6174 6120 ent of the data │ │ │ +001462d0: 746f 2061 6e6f 7468 6572 203c 636f 6465 to another soa │ │ │ +00146330: 703c 2f61 3e3c 2f63 6f64 653e 2063 6f6e p con │ │ │ +00146340: 7465 7874 2077 6974 6820 3c63 6f64 653e text with │ │ │ +00146350: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap_delegat │ │ │ +00146420: 655f 6465 6c65 7469 6f6e 2873 7472 7563 e_deletion(struc │ │ │ +00146430: 7420 736f 6170 202a 736f 6170 5f66 726f t soap *soap_fro │ │ │ +00146440: 6d2c 2073 7472 7563 7420 736f 6170 202a m, struct soap * │ │ │ +00146450: 736f 6170 5f74 6f29 3c2f 613e 3c2f 636f soap_to). This moves │ │ │ +00146470: 616c 6c20 6465 7365 7269 616c 697a 6564 all deserialized │ │ │ +00146480: 2061 6e64 2074 656d 706f 7261 7279 2064 and temporary d │ │ │ +00146490: 6174 6120 746f 2074 6865 206f 7468 6572 ata to the other │ │ │ +001464a0: 203c 636f 6465 3e3c 6120 636c 6173 733d soap context soap_to, │ │ │ +00146520: 2077 6869 6368 2077 696c 6c20 6465 6c65 which will dele │ │ │ +00146530: 7465 2069 7473 2064 6174 6120 616e 6420 te its data and │ │ │ +00146540: 616c 6c20 7468 6520 6465 6c65 6761 7465 all the delegate │ │ │ +00146550: 6420 6461 7461 2069 7420 6973 2072 6573 d data it is res │ │ │ +00146560: 706f 6e73 6962 6c65 2066 6f72 2077 6865 ponsible for whe │ │ │ +00146570: 6e20 796f 7520 6361 6c6c 203c 636f 6465 n you call │ │ │ +00146630: 736f 6170 5f64 6573 7472 6f79 3c2f 613e soap_destroy │ │ │ +00146640: 3c2f 636f 6465 3e20 616e 6420 3c63 6f64 and soap_end. This │ │ │ +00146730: 6361 6e20 6265 2070 6172 7469 6375 6c61 can be particula │ │ │ +00146740: 726c 7920 7573 6566 756c 2066 6f72 206d rly useful for m │ │ │ +00146750: 616b 696e 6720 636c 6965 6e74 2063 616c aking client cal │ │ │ +00146760: 6c73 2069 6e73 6964 6520 6120 7365 7276 ls inside a serv │ │ │ +00146770: 6572 206f 7065 7261 7469 6f6e 2c20 692e er operation, i. │ │ │ +00146780: 652e 2061 206d 6978 6564 2073 6572 7665 e. a mixed serve │ │ │ +00146790: 7220 616e 6420 636c 6965 6e74 2e20 5468 r and client. Th │ │ │ +001467a0: 6520 636c 6965 6e74 2063 616c 6c20 696e e client call in │ │ │ +001467b0: 7369 6465 2074 6865 2073 6572 7665 7220 side the server │ │ │ +001467c0: 6f70 6572 6174 696f 6e20 7265 7175 6972 operation requir │ │ │ +001467d0: 6573 2061 206e 6577 203c 636f 6465 3e3c es a new < │ │ │ +001467e0: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ +001467f0: 663d 2273 7472 7563 7473 6f61 702e 6874 f="structsoap.ht │ │ │ +00146800: 6d6c 2220 7469 746c 653d 2243 6f6e 7465 ml" title="Conte │ │ │ +00146810: 7874 2077 6974 6820 7468 6520 656e 6769 xt with the engi │ │ │ +00146820: 6e65 2073 7461 7465 2e22 3e73 6f61 703c ne state.">soap< │ │ │ +00146830: 2f61 3e3c 2f63 6f64 653e 2063 6f6e 7465 /a> conte │ │ │ +00146840: 7874 2c20 652e 672e 2063 6f70 6965 6420 xt, e.g. copied │ │ │ +00146850: 6672 6f6d 2074 6865 2073 6572 7665 7227 from the server' │ │ │ +00146860: 7320 7769 7468 203c 636f 6465 3e3c 6120 s with soap_cop │ │ │ +00146920: 793c 2f61 3e3c 2f63 6f64 653e 2e20 4265 y. Be │ │ │ +00146930: 666f 7265 2064 6573 7472 6f79 696e 6720 fore destroying │ │ │ +00146940: 7468 6520 636c 6965 6e74 2063 6f6e 7465 the client conte │ │ │ +00146950: 7874 2077 6974 6820 3c63 6f64 653e 3c61 xt with so │ │ │ +00146a00: 6170 5f66 7265 653c 2f61 3e3c 2f63 6f64 ap_free, the data can │ │ │ +00146a20: 2062 6520 6465 6c65 6761 7465 6420 746f be delegated to │ │ │ +00146a30: 2074 6865 2073 6572 7665 7227 7320 636f the server's co │ │ │ +00146a40: 6e74 6578 7420 7769 7468 203c 636f 6465 ntext with soap_delega │ │ │ +00146b20: 7465 5f64 656c 6574 696f 6e3c 2f61 3e3c te_deletion< │ │ │ +00146b30: 2f63 6f64 653e 2e20 5365 6520 666f 7220 /code>. See for │ │ │ +00146b40: 6578 616d 706c 6520 3c65 6d3e 3c63 6f64 example gsoap/samples/ │ │ │ +00146b60: 6d61 7368 7570 2f6d 6173 6875 7073 6572 mashup/mashupser │ │ │ +00146b70: 7665 722e 633c 2f63 6f64 653e 3c2f 656d ver.c in the gSOAP s │ │ │ +00146b90: 6f75 7263 6520 636f 6465 2070 6163 6b61 ource code packa │ │ │ +00146ba0: 6765 2e3c 2f70 3e0a 3c70 3e54 6865 2066 ge.

    .

    The f │ │ │ +00146bb0: 756e 6374 696f 6e73 2072 656c 6174 6564 unctions related │ │ │ +00146bc0: 2074 6f20 6d65 6d6f 7279 206d 616e 6167 to memory manag │ │ │ +00146bd0: 656d 656e 7420 6279 2074 6865 2063 6f6e ement by the con │ │ │ +00146be0: 7465 7874 2061 7265 3a3c 2f70 3e0a 3c75 text are:

    ..
  • voi │ │ │ +00146c00: 6420 2a20 3c61 2063 6c61 7373 3d22 656c d * soap_mallo │ │ │ +00146cb0: 6328 7374 7275 6374 2073 6f61 7020 2a73 c(struct soap *s │ │ │ +00146cc0: 6f61 702c 2073 697a 655f 7420 6e29 3c2f oap, size_t n) return │ │ │ +00146ce0: 2070 6f69 6e74 6572 2074 6f20 3c63 6f64 pointer to n bytes │ │ │ +00146d00: 206f 6620 6d61 6e61 6765 6420 6d65 6d6f of managed memo │ │ │ +00146d10: 7279 2e3c 2f6c 693e 0a3c 6c69 3e3c 636f ry.
  • .
  • char * soap_strdu │ │ │ +00146db0: 7028 7374 7275 6374 2073 6f61 7020 2a73 p(struct soap *s │ │ │ +00146dc0: 6f61 702c 2063 6f6e 7374 2063 6861 7220 oap, const char │ │ │ +00146dd0: 2a73 293c 2f61 3e3c 2f63 6f64 653e 2072 *s) r │ │ │ +00146de0: 6574 7572 6e20 706f 696e 7465 7220 746f eturn pointer to │ │ │ +00146df0: 2064 7570 6c69 6361 7465 206f 6620 7374 duplicate of st │ │ │ +00146e00: 7269 6e67 203c 636f 6465 3e73 3c2f 636f ring s in managed m │ │ │ +00146e20: 656d 6f72 792e 3c2f 6c69 3e0a 3c6c 693e emory.
  • .
  • │ │ │ +00146e30: 3c63 6f64 653e 6368 6172 202a 203c 6120 char * so │ │ │ +00146ec0: 6170 5f77 7374 7264 7570 2873 7472 7563 ap_wstrdup(struc │ │ │ +00146ed0: 7420 736f 6170 202a 736f 6170 2c20 636f t soap *soap, co │ │ │ +00146ee0: 6e73 7420 7763 6861 725f 7420 2a73 293c nst wchar_t *s)< │ │ │ +00146ef0: 2f61 3e3c 2f63 6f64 653e 2072 6574 7572 /a> retur │ │ │ +00146f00: 6e20 706f 696e 7465 7220 746f 2064 7570 n pointer to dup │ │ │ +00146f10: 6c69 6361 7465 206f 6620 7374 7269 6e67 licate of string │ │ │ +00146f20: 203c 636f 6465 3e73 3c2f 636f 6465 3e20 s │ │ │ +00146f30: 696e 206d 616e 6167 6564 206d 656d 6f72 in managed memor │ │ │ +00146f40: 792e 3c2f 6c69 3e0a 3c6c 693e 3c63 6f64 y.
  • .
  • T * soap_new_T │ │ │ +00146f60: 2873 7472 7563 7420 736f 6170 202a 736f (struct soap *so │ │ │ +00146f70: 6170 293c 2f63 6f64 653e 2061 6c6c 6f63 ap) alloc │ │ │ +00146f80: 6174 6573 2061 6e64 2064 6566 6175 6c74 ates and default │ │ │ +00146f90: 2d69 6e69 7469 616c 697a 6573 2064 6174 -initializes dat │ │ │ +00146fa0: 6120 6f66 2074 7970 6520 3c63 6f64 653e a of type │ │ │ +00146fb0: 543c 2f63 6f64 653e 2c20 432b 2b20 6f6e T, C++ on │ │ │ +00146fc0: 6c79 2e3c 2f6c 693e 0a3c 6c69 3e3c 636f ly.
  • .
  • T * soap_new_ │ │ │ +00146fe0: 5428 7374 7275 6374 2073 6f61 7020 2a73 T(struct soap *s │ │ │ +00146ff0: 6f61 702c 2069 6e74 206e 293c 2f63 6f64 oap, int n) allocates and │ │ │ +00147010: 2064 6566 6175 6c74 2d69 6e69 7469 616c default-initial │ │ │ +00147020: 697a 6573 2061 6e64 2061 7272 6179 206f izes and array o │ │ │ +00147030: 6620 7479 7065 203c 636f 6465 3e54 3c2f f type T, where n = -1 │ │ │ +00147060: 2061 6c6c 6f63 6174 6573 2061 2073 696e allocates a sin │ │ │ +00147070: 676c 6520 6e6f 6e2d 6172 7261 7920 7661 gle non-array va │ │ │ +00147080: 6c75 652e 3c2f 6c69 3e0a 3c6c 693e 3c63 lue.
  • .
  • T * soap_new │ │ │ +001470a0: 5f73 6574 5f54 2873 7472 7563 7420 736f _set_T(struct so │ │ │ +001470b0: 6170 202a 736f 6170 2c20 6d31 2c20 2e2e ap *soap, m1, .. │ │ │ +001470c0: 2e2c 206d 6e29 3c2f 636f 6465 3e20 616c ., mn) al │ │ │ +001470d0: 6c6f 6361 7465 7320 6120 7374 7275 6374 locates a struct │ │ │ +001470e0: 206f 7220 636c 6173 7320 3c63 6f64 653e or class │ │ │ +001470f0: 543c 2f63 6f64 653e 2061 6e64 2069 6e69 T and ini │ │ │ +00147100: 7469 616c 697a 6573 2069 7473 206d 656d tializes its mem │ │ │ +00147110: 6265 7273 2077 6974 6820 7468 6520 7661 bers with the va │ │ │ +00147120: 6c75 6573 203c 636f 6465 3e6d 313c 2f63 lues m1 to mn │ │ │ +00147140: 3c2f 636f 6465 3e2e 3c2f 6c69 3e0a 3c6c .
  • .T * soap │ │ │ +00147160: 5f6e 6577 5f72 6571 5f54 2873 7472 7563 _new_req_T(struc │ │ │ +00147170: 7420 736f 6170 202a 736f 6170 2c20 6d31 t soap *soap, m1 │ │ │ +00147180: 2c20 2e2e 2e2c 206d 6e29 3c2f 636f 6465 , ..., mn) allocates a st │ │ │ +001471a0: 7275 6374 206f 7220 636c 6173 7320 3c63 ruct or class T and │ │ │ +001471c0: 2069 6e69 7469 616c 697a 6573 2069 7473 initializes its │ │ │ +001471d0: 2072 6571 7569 7265 6420 6d65 6d62 6572 required member │ │ │ +001471e0: 7320 7769 7468 2074 6865 2076 616c 7565 s with the value │ │ │ +001471f0: 7320 3c63 6f64 653e 6d31 3c2f 636f 6465 s m1 to mn, required m │ │ │ +00147220: 6561 6e73 206e 6f6e 2d6f 7074 696f 6e61 eans non-optiona │ │ │ +00147230: 6c20 6d65 6d62 6572 2061 7320 7265 7175 l member as requ │ │ │ +00147240: 6972 6564 2062 7920 584d 4c20 7661 6c69 ired by XML vali │ │ │ +00147250: 6461 7469 6f6e 2077 6865 6e20 7468 6973 dation when this │ │ │ +00147260: 2064 6174 6120 6973 2073 6572 6961 6c69 data is seriali │ │ │ +00147270: 7a65 6420 696e 2058 4d4c 2e3c 2f6c 693e zed in XML. │ │ │ +00147280: 0a3c 6c69 3e3c 636f 6465 3e76 6f69 6420 .
  • void │ │ │ +00147290: 3c61 2063 6c61 7373 3d22 656c 2220 6872 s │ │ │ +00147340: 6f61 705f 6465 7374 726f 7928 7374 7275 oap_destroy(stru │ │ │ +00147350: 6374 2073 6f61 7020 2a73 6f61 7029 3c2f ct soap *soap) delete │ │ │ +00147370: 7320 616c 6c20 636f 6e74 6578 742d 6d61 s all context-ma │ │ │ +00147380: 6e61 6765 6420 432b 2b20 6f62 6a65 6374 naged C++ object │ │ │ +00147390: 7320 616e 6420 6d75 7374 2062 6520 6361 s and must be ca │ │ │ +001473a0: 6c6c 6564 2062 6566 6f72 6520 3c63 6f64 lled before soap_end.
  • . │ │ │ +00147490: 3c6c 693e 3c63 6f64 653e 766f 6964 203c
  • void < │ │ │ +001474a0: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ +001474b0: 663d 2267 726f 7570 5f5f 6772 6f75 705f f="group__group_ │ │ │ +001474c0: 5f63 6f6e 7465 7874 2e68 746d 6c23 6761 _context.html#ga │ │ │ +001474d0: 3831 6130 3039 6165 3165 6138 3235 6130 81a009ae1ea825a0 │ │ │ +001474e0: 3565 3532 3431 6532 6237 6138 6563 6539 5e5241e2b7a8ece9 │ │ │ +001474f0: 2220 7469 746c 653d 2244 656c 6574 6520 " title="Delete │ │ │ +00147500: 616c 6c20 6461 7461 2066 726f 6d20 6865 all data from he │ │ │ +00147510: 6170 206d 656d 6f72 7920 6d61 6e61 6765 ap memory manage │ │ │ +00147520: 6420 6279 2074 6865 2073 7065 6369 6669 d by the specifi │ │ │ +00147530: 6564 2073 6f61 7020 636f 6e74 6578 7420 ed soap context │ │ │ +00147540: 616e 6420 7265 6c65 6173 6520 7468 6520 and release the │ │ │ +00147550: 6672 6565 6420 6d65 6d6f 7279 2062 2e2e freed memory b.. │ │ │ +00147560: 2e22 3e73 6f61 705f 656e 6428 7374 7275 .">soap_end(stru │ │ │ +00147570: 6374 2073 6f61 7020 2a73 6f61 7029 3c2f ct soap *soap) delete │ │ │ +00147590: 7320 7465 6d70 6f72 6172 7920 6461 7461 s temporary data │ │ │ +001475a0: 2061 6e64 2061 6c6c 2064 6573 6572 6961 and all deseria │ │ │ +001475b0: 6c69 7a65 6420 6461 7461 2065 7863 6570 lized data excep │ │ │ +001475c0: 7420 432b 2b20 6f62 6a65 6374 732c 2073 t C++ objects, s │ │ │ +001475d0: 6565 2061 626f 7665 2e3c 2f6c 693e 0a3c ee above.
  • .< │ │ │ +001475e0: 6c69 3e3c 636f 6465 3e76 6f69 6420 3c61 li>void
    │ │ │ +00147660: 736f 6170 5f66 7265 655f 7465 6d70 2873 soap_free_temp(s │ │ │ +00147670: 7472 7563 7420 736f 6170 202a 736f 6170 truct soap *soap │ │ │ +00147680: 293c 2f61 3e3c 2f63 6f64 653e 2064 656c ) del │ │ │ +00147690: 6574 6573 2074 656d 706f 7261 7279 2064 etes temporary d │ │ │ +001476a0: 6174 6120 6275 7420 6c65 6176 6573 2064 ata but leaves d │ │ │ +001476b0: 6573 6572 6961 6c69 7a65 6420 636f 6e74 eserialized cont │ │ │ +001476c0: 6578 742d 6d61 6e61 6765 6420 6461 7461 ext-managed data │ │ │ +001476d0: 2069 6e74 6163 742e 3c2f 6c69 3e0a 3c6c intact..void soap_dealloc(st │ │ │ +001477c0: 7275 6374 2073 6f61 7020 2a73 6f61 702c ruct soap *soap, │ │ │ +001477d0: 2076 6f69 6420 2a70 293c 2f61 3e3c 2f63 void *p) deallocates │ │ │ +001477f0: 2063 6f6e 7465 7874 2d6d 616e 6167 6564 context-managed │ │ │ +00147800: 206f 626a 6563 7473 206f 7220 6461 7461 objects or data │ │ │ +00147810: 2061 7420 6c6f 6361 7469 6f6e 203c 636f at location p in m │ │ │ +00147830: 656d 6f72 792e 3c2f 6c69 3e0a 3c6c 693e emory..
  • │ │ │ +00147840: 3c63 6f64 653e 696e 7420 3c61 2063 6c61 int so │ │ │ +00147910: 6170 5f75 6e6c 696e 6b28 7374 7275 6374 ap_unlink(struct │ │ │ +00147920: 2073 6f61 7020 2a73 6f61 702c 2063 6f6e soap *soap, con │ │ │ +00147930: 7374 2076 6f69 6420 2a70 293c 2f61 3e3c st void *p)< │ │ │ +00147940: 2f63 6f64 653e 2075 6e6c 696e 6b20 6f62 /code> unlink ob │ │ │ +00147950: 6a65 6374 206f 7220 6461 7461 2061 7420 ject or data at │ │ │ +00147960: 6c6f 6361 7469 6f6e 203c 636f 6465 3e70 location p │ │ │ +00147970: 3c2f 636f 6465 3e20 6672 6f6d 206d 616e from man │ │ │ +00147980: 6167 656d 656e 7420 6279 2074 6865 2063 agement by the c │ │ │ +00147990: 6f6e 7465 7874 2c20 7468 6973 206f 626a ontext, this obj │ │ │ +001479a0: 6563 7420 6f72 2064 6174 6120 6d75 7374 ect or data must │ │ │ +001479b0: 2062 6520 6465 616c 6c6f 6361 7465 6420 be deallocated │ │ │ +001479c0: 6279 2074 6865 2075 7365 722e 3c2f 6c69 by the user.
  • .
  • void │ │ │ +001479e0: 203c 6120 636c 6173 733d 2265 6c22 2068 soap_done(s │ │ │ +00147ab0: 7472 7563 7420 736f 6170 202a 736f 6170 truct soap *soap │ │ │ +00147ac0: 293c 2f61 3e3c 2f63 6f64 653e 2066 696e ) fin │ │ │ +00147ad0: 616c 697a 6573 2074 6865 2063 6f6e 7465 alizes the conte │ │ │ +00147ae0: 7874 2062 7574 2064 6f65 7320 6e6f 7420 xt but does not │ │ │ +00147af0: 6465 6c65 7465 2061 6e79 206d 616e 6167 delete any manag │ │ │ +00147b00: 6564 206f 626a 6563 7473 206f 7220 6461 ed objects or da │ │ │ +00147b10: 7461 2e3c 2f6c 693e 0a3c 6c69 3e3c 636f ta.
  • .
  • void soap_fre │ │ │ +00147bd0: 6528 7374 7275 6374 2073 6f61 7020 2a73 e(struct soap *s │ │ │ +00147be0: 6f61 7029 3c2f 613e 3c2f 636f 6465 3e20 oap) │ │ │ +00147bf0: 6669 6e61 6c69 7a65 7320 616e 6420 6672 finalizes and fr │ │ │ +00147c00: 6565 7320 7468 6520 636f 6e74 6578 7420 ees the context │ │ │ +00147c10: 2863 6f6e 7465 7874 7320 616c 6c6f 6361 (contexts alloca │ │ │ +00147c20: 7465 6420 7769 7468 203c 636f 6465 3e3c ted with < │ │ │ +00147c30: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ +00147c40: 663d 2267 726f 7570 5f5f 6772 6f75 705f f="group__group_ │ │ │ +00147c50: 5f63 6f6e 7465 7874 2e68 746d 6c23 6761 _context.html#ga │ │ │ +00147c60: 3837 6332 3034 3838 6232 6463 3638 3061 87c20488b2dc680a │ │ │ +00147c70: 6161 3736 3839 6231 6430 3234 3938 3963 aa7689b1d024989c │ │ │ +00147c80: 2220 7469 746c 653d 2241 6c6c 6f63 6174 " title="Allocat │ │ │ +00147c90: 6520 616e 6420 696e 6974 6961 6c69 7a65 e and initialize │ │ │ +00147ca0: 2061 206e 6577 2073 6f61 7020 636f 6e74 a new soap cont │ │ │ +00147cb0: 6578 742e 223e 736f 6170 5f6e 6577 3c2f ext.">soap_new or so │ │ │ +00147d80: 6170 5f63 6f70 793c 2f61 3e3c 2f63 6f64 ap_copy) but does not │ │ │ +00147da0: 2064 656c 6574 6520 616e 7920 6d61 6e61 delete any mana │ │ │ +00147db0: 6765 6420 6f62 6a65 6374 7320 6f72 2064 ged objects or d │ │ │ +00147dc0: 6174 612e 3c2f 6c69 3e0a 3c6c 693e 3c63 ata.
  • .
  • void soa │ │ │ +00147ea0: 705f 6465 6c65 6761 7465 5f64 656c 6574 p_delegate_delet │ │ │ +00147eb0: 696f 6e28 7374 7275 6374 2073 6f61 7020 ion(struct soap │ │ │ +00147ec0: 2a73 6f61 705f 6672 6f6d 2c20 7374 7275 *soap_from, stru │ │ │ +00147ed0: 6374 2073 6f61 7020 2a73 6f61 705f 746f ct soap *soap_to │ │ │ +00147ee0: 293c 2f61 3e3c 2f63 6f64 653e 206d 6f76 ) mov │ │ │ +00147ef0: 6573 2061 6c6c 2043 2b2b 206f 626a 6563 es all C++ objec │ │ │ +00147f00: 7473 2c20 6461 7461 2c20 616e 6420 7465 ts, data, and te │ │ │ +00147f10: 6d70 6f72 6172 7920 6461 7461 206d 616e mporary data man │ │ │ +00147f20: 6167 6564 2062 7920 7468 6520 3c63 6f64 aged by the soap_from context to an │ │ │ +00147f50: 6f74 6865 7220 636f 6e74 6578 7420 3c63 other context soap_to, which manage │ │ │ +00147f80: 7320 7468 6520 6461 7461 2075 6e74 696c s the data until │ │ │ +00147f90: 2064 656c 6574 6564 2077 6974 6820 3c63 deleted with soap_destroy< │ │ │ +00148060: 2f61 3e3c 2f63 6f64 653e 2061 6e64 203c /a> and < │ │ │ +00148070: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soap_en │ │ │ +00148140: 643c 2f61 3e3c 2f63 6f64 653e 2e3c 2f6c d...

    To h │ │ │ +00148160: 656c 7020 756e 6465 7273 7461 6e64 2074 elp understand t │ │ │ +00148170: 6865 2064 6966 6665 7265 6e63 6573 2062 he differences b │ │ │ +00148180: 6574 7765 656e 206d 616e 6167 6564 206f etween managed o │ │ │ +00148190: 626a 6563 7473 2c20 6d61 6e61 6765 6420 bjects, managed │ │ │ +001481a0: 6461 7461 2c20 616e 6420 6d61 6e61 6765 data, and manage │ │ │ +001481b0: 6420 7465 6d70 6f72 6172 7920 6461 7461 d temporary data │ │ │ +001481c0: 3a20 7465 6d70 6f72 6172 7920 6461 7461 : temporary data │ │ │ +001481d0: 2069 7320 6372 6561 7465 6420 6279 2074 is created by t │ │ │ +001481e0: 6865 2065 6e67 696e 6520 746f 206b 6565 he engine to kee │ │ │ +001481f0: 7020 7472 6163 6b20 6f66 2074 6869 6e67 p track of thing │ │ │ +00148200: 732c 2073 7563 6820 6173 2068 6173 6820 s, such as hash │ │ │ +00148210: 7461 626c 6573 2074 6f20 6b65 6570 2070 tables to keep p │ │ │ +00148220: 6f69 6e74 6572 2072 6566 6572 656e 6365 ointer reference │ │ │ +00148230: 2069 6e66 6f72 6d61 7469 6f6e 2066 6f72 information for │ │ │ +00148240: 2073 6572 6961 6c69 7a61 7469 6f6e 2061 serialization a │ │ │ +00148250: 6e64 2068 6173 6820 7461 626c 6573 2074 nd hash tables t │ │ │ +00148260: 6f20 6b65 6570 2058 4d4c 2069 642f 6872 o keep XML id/hr │ │ │ +00148270: 6566 2069 6e66 6f72 6d61 7469 6f6e 2066 ef information f │ │ │ +00148280: 6f72 206d 756c 7469 2d72 6566 6572 656e or multi-referen │ │ │ +00148290: 6365 206f 626a 6563 7420 6465 7365 7269 ce object deseri │ │ │ +001482a0: 616c 697a 6174 696f 6e2e 2044 6573 6572 alization. Deser │ │ │ +001482b0: 6961 6c69 7a65 6420 6461 7461 2069 7320 ialized data is │ │ │ +001482c0: 616c 6c6f 6361 7465 6420 6279 2074 6865 allocated by the │ │ │ +001482d0: 2063 6f6e 7465 7874 2069 6e20 6d61 6e61 context in mana │ │ │ +001482e0: 6765 6420 6d65 6d6f 7279 2077 6865 6e20 ged memory when │ │ │ +001482f0: 636f 6e73 7472 7563 7469 6e67 2064 6174 constructing dat │ │ │ +00148300: 6120 7374 7275 6374 7572 6573 2062 7920 a structures by │ │ │ +00148310: 6465 7365 7269 616c 697a 696e 6720 584d deserializing XM │ │ │ +00148320: 4c20 616e 6420 4a53 4f4e 206d 6573 7361 L and JSON messa │ │ │ +00148330: 6765 732e 2044 6174 6120 6973 2073 746f ges. Data is sto │ │ │ +00148340: 7265 6420 696e 206d 656d 6f72 7920 6d61 red in memory ma │ │ │ +00148350: 6e61 6765 6420 6279 2074 6865 2063 6f6e naged by the con │ │ │ +00148360: 7465 7874 2075 7369 6e67 2063 616c 6c73 text using calls │ │ │ +00148370: 2074 6f20 3c63 6f64 653e 3c61 2063 6c61 to soap │ │ │ +00148420: 5f6d 616c 6c6f 633c 2f61 3e3c 2f63 6f64 _malloc to allocate h │ │ │ +00148440: 6561 7020 7370 6163 6520 7769 7468 203c eap space with < │ │ │ +00148450: 636f 6465 3e6d 616c 6c6f 633c 2f63 6f64 code>malloc. A tiny bit m │ │ │ +00148470: 6f72 6520 7370 6163 6520 6973 2061 6c6c ore space is all │ │ │ +00148480: 6f63 6174 6564 2074 6f20 6b65 6570 2074 ocated to keep t │ │ │ +00148490: 7261 636b 206f 6620 7468 6520 616c 6c6f rack of the allo │ │ │ +001484a0: 6361 7469 6f6e 7320 616e 6420 746f 2061 cations and to a │ │ │ +001484b0: 6464 2061 2022 6361 6e61 7279 2220 776f dd a "canary" wo │ │ │ +001484c0: 7264 2074 6f20 6465 7465 6374 2068 6561 rd to detect hea │ │ │ +001484d0: 7020 6d65 6d6f 7279 206f 7665 7266 6c6f p memory overflo │ │ │ +001484e0: 7773 2e20 4865 6170 206d 656d 6f72 7920 ws. Heap memory │ │ │ +001484f0: 6f76 6572 666c 6f77 7320 6172 6520 6465 overflows are de │ │ │ +00148500: 7465 6374 6564 2077 6865 6e20 636f 6e74 tected when cont │ │ │ +00148510: 6578 742d 6d61 6e61 6765 6420 6461 7461 ext-managed data │ │ │ +00148520: 2069 7320 6465 616c 6c6f 6361 7465 6420 is deallocated │ │ │ +00148530: 7769 7468 203c 636f 6465 3e3c 6120 636c with s │ │ │ +00148600: 6f61 705f 656e 643c 2f61 3e3c 2f63 6f64 oap_end. C++ objects │ │ │ +00148620: 6172 6520 616c 6c6f 6361 7465 6420 7769 are allocated wi │ │ │ +00148630: 7468 203c 636f 6465 3e6e 6577 3c2f 636f th new instead of < │ │ │ +00148650: 636f 6465 3e6d 616c 6c6f 633c 2f63 6f64 code>malloc and are track │ │ │ +00148670: 6564 2061 7320 7765 6c6c 2e20 5468 6573 ed as well. Thes │ │ │ +00148680: 6520 6f62 6a65 6374 7320 6172 6520 6465 e objects are de │ │ │ +00148690: 616c 6c6f 6361 7465 6420 7769 7468 203c allocated with < │ │ │ +001486a0: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soap_destroy │ │ │ +00148760: 3c2f 613e 3c2f 636f 6465 3e2e 3c2f 703e .

    │ │ │ +00148770: 0a3c 703e 5768 656e 2074 6865 2067 534f .

    When the gSO │ │ │ +00148780: 4150 2061 7070 6c69 6361 7469 6f6e 2069 AP application i │ │ │ +00148790: 7320 636f 6d70 696c 6564 2077 6974 6820 s compiled with │ │ │ +001487a0: 3c62 3e3c 636f 6465 3e2d 4444 4542 5547 -DDEBUG │ │ │ +001487b0: 3c2f 636f 6465 3e3c 2f62 3e20 7573 696e usin │ │ │ +001487c0: 6720 7468 6520 636f 6d70 696c 652d 7469 g the compile-ti │ │ │ +001487d0: 6d65 2066 6c61 6720 3c63 6f64 653e 2344 me flag #D │ │ │ +001487e0: 4542 5547 3c2f 636f 6465 3e2c 2074 6865 EBUG, the │ │ │ +001487f0: 2065 6e67 696e 6520 7265 706f 7274 7320 engine reports │ │ │ +00148800: 6d65 6d6f 7279 206c 6561 6b73 2077 6869 memory leaks whi │ │ │ +00148810: 6368 2061 7265 2064 6574 6563 7465 6420 ch are detected │ │ │ +00148820: 6279 203c 636f 6465 3e3c 6120 636c 6173 by soa │ │ │ +001488f0: 705f 646f 6e65 3c2f 613e 3c2f 636f 6465 p_done and soap │ │ │ +001489b0: 5f66 7265 653c 2f61 3e3c 2f63 6f64 653e _free │ │ │ +001489c0: 2e20 546f 2069 6d70 726f 7665 2074 6865 . To improve the │ │ │ +001489d0: 2061 6363 7572 6163 7920 6f66 2064 6574 accuracy of det │ │ │ +001489e0: 6563 7469 6f6e 2c20 6e6f 206d 656d 6f72 ection, no memor │ │ │ +001489f0: 7920 6973 2061 6374 7561 6c6c 7920 6672 y is actually fr │ │ │ +00148a00: 6565 6420 756e 7469 6c20 3c63 6f64 653e eed until │ │ │ +00148a10: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap_done or soap_free< │ │ │ +00148ba0: 2f63 6f64 653e 2061 7265 2063 616c 6c65 /code> are calle │ │ │ +00148bb0: 6420 746f 2064 6574 6563 7420 6d65 6d6f d to detect memo │ │ │ +00148bc0: 7279 2069 7373 7565 732c 2073 6f20 616e ry issues, so an │ │ │ +00148bd0: 7920 6361 6c6c 7320 746f 203c 636f 6465 y calls to │ │ │ +00148c90: 736f 6170 5f64 6573 7472 6f79 3c2f 613e soap_destroy │ │ │ +00148ca0: 3c2f 636f 6465 3e20 616e 6420 3c63 6f64 and soap_end are ac │ │ │ +00148d90: 7475 616c 6c79 2064 6566 6572 7265 6420 tually deferred │ │ │ +00148da0: 746f 2062 6520 6578 6563 7574 6564 2077 to be executed w │ │ │ +00148db0: 6865 6e20 7468 6520 636f 6e74 6578 7420 hen the context │ │ │ +00148dc0: 6669 6e61 6c69 7a65 732e 3c2f 703e 0a3c finalizes.

    .< │ │ │ +00148dd0: 703e 5768 696c 6520 6d65 6d6f 7279 206d p>While memory m │ │ │ +00148de0: 616e 6167 656d 656e 7420 696e 2067 534f anagement in gSO │ │ │ +00148df0: 4150 2069 7320 6175 746f 6d61 7469 632c AP is automatic, │ │ │ +00148e00: 2069 7420 646f 6573 206e 6f74 2065 6e66 it does not enf │ │ │ +00148e10: 6f72 6365 2069 7473 206f 776e 206d 656d orce its own mem │ │ │ +00148e20: 6f72 7920 6d61 6e61 6765 6d65 6e74 2070 ory management p │ │ │ +00148e30: 6f6c 6963 7920 6f6e 2074 6865 2075 7365 olicy on the use │ │ │ +00148e40: 722e 2054 6f20 6d6f 7665 206d 616e 6167 r. To move manag │ │ │ +00148e50: 6564 206f 626a 6563 7473 2061 6e64 2064 ed objects and d │ │ │ +00148e60: 6174 6120 696e 746f 2075 6e6d 616e 6167 ata into unmanag │ │ │ +00148e70: 6564 2068 6561 7020 7370 6163 652c 2074 ed heap space, t │ │ │ +00148e80: 6865 203c 636f 6465 3e73 6f61 705f 6475 he soap_du │ │ │ +00148e90: 705f 543c 2f63 6f64 653e 2064 6565 7020 p_T deep │ │ │ +00148ea0: 636f 7079 2066 756e 6374 696f 6e73 2067 copy functions g │ │ │ +00148eb0: 656e 6572 6174 6564 2062 7920 3c62 3e3c enerated by < │ │ │ +00148ec0: 636f 6465 3e73 6f61 7063 7070 3220 2d45 code>soapcpp2 -E │ │ │ +00148ed0: 633c 2f63 6f64 653e 3c2f 623e 206f 7074 c
    opt │ │ │ +00148ee0: 696f 6e20 3c62 3e3c 636f 6465 3e2d 4563 ion -Ec │ │ │ +00148ef0: 3c2f 636f 6465 3e3c 2f62 3e20 6361 6e20 can │ │ │ +00148f00: 6265 2075 7365 642e 2054 6f20 6465 6c65 be used. To dele │ │ │ +00148f10: 7465 2064 6565 7020 636f 7069 6573 2c20 te deep copies, │ │ │ +00148f20: 7468 6520 3c63 6f64 653e 736f 6170 5f64 the soap_d │ │ │ +00148f30: 656c 5f54 3c2f 636f 6465 3e20 6465 6570 el_T deep │ │ │ +00148f40: 2064 656c 6574 696f 6e20 6675 6e63 7469 deletion functi │ │ │ +00148f50: 6f6e 7320 6765 6e65 7261 7465 6420 6279 ons generated by │ │ │ +00148f60: 203c 623e 3c63 6f64 653e 736f 6170 6370 soapcp │ │ │ +00148f70: 7032 202d 4564 3c2f 636f 6465 3e3c 2f62 p2 -Ed option -Ed │ │ │ +00148fa0: 2063 616e 2062 6520 7573 6564 2e20 4166 can be used. Af │ │ │ +00148fb0: 7465 7220 636f 7079 696e 6720 7468 6520 ter copying the │ │ │ +00148fc0: 7573 7561 6c20 3c63 6f64 653e 3c61 2063 usual soap_ │ │ │ +00149080: 6465 7374 726f 793c 2f61 3e3c 2f63 6f64 destroy and soap_end functions r │ │ │ +00149180: 656d 6f76 6520 7468 6520 6d61 6e61 6765 emove the manage │ │ │ +00149190: 6420 6f72 6967 696e 616c 732e 2053 6565 d originals. See │ │ │ +001491a0: 2061 6c73 6f20 5365 6374 696f 6e20 3c61 also Section Generating de │ │ │ +001491e0: 6570 2063 6f70 7920 616e 6420 6465 6c65 ep copy and dele │ │ │ +001491f0: 7469 6f6e 2066 756e 6374 696f 6e73 3c2f tion functions.

    .

    Furth │ │ │ +00149210: 6572 6d6f 7265 2c20 7468 6520 6d65 6d6f ermore, the memo │ │ │ +00149220: 7279 2061 6c6c 6f63 6174 696f 6e20 6675 ry allocation fu │ │ │ +00149230: 6e63 7469 6f6e 7320 3c63 6f64 653e 6d61 nctions ma │ │ │ +00149240: 6c6c 6f63 3c2f 636f 6465 3e20 616e 6420 lloc and │ │ │ +00149250: 3c63 6f64 653e 6e65 773c 2f63 6f64 653e new │ │ │ +00149260: 2075 7365 6420 6279 2074 6865 2065 6e67 used by the eng │ │ │ +00149270: 696e 6520 696e 7465 726e 616c 6c79 2063 ine internally c │ │ │ +00149280: 616e 2062 6520 7265 706c 6163 6564 2077 an be replaced w │ │ │ +00149290: 6974 6820 6f74 6865 7220 616c 6c6f 6361 ith other alloca │ │ │ +001492a0: 746f 7273 2062 7920 6465 6669 6e69 6e67 tors by defining │ │ │ +001492b0: 203c 636f 6465 3e53 4f41 505f 4d41 4c4c SOAP_MALL │ │ │ +001492c0: 4f43 3c2f 636f 6465 3e20 616e 6420 3c63 OC and SOAP_FREE to replace │ │ │ +001492f0: 3c63 6f64 653e 6d61 6c6c 6f63 3c2f 636f malloc and fr │ │ │ +00149310: 6565 3c2f 636f 6465 3e2c 2061 6e64 2064 ee, and d │ │ │ +00149320: 6566 696e 6520 3c63 6f64 653e 534f 4150 efine SOAP │ │ │ +00149330: 5f4e 4557 3c2f 636f 6465 3e2c 203c 636f _NEW, SOAP_NEW_ARRA │ │ │ +00149350: 593c 2f63 6f64 653e 2c20 3c63 6f64 653e Y, │ │ │ +00149360: 534f 4150 5f50 4c41 4345 4d45 4e54 5f4e SOAP_PLACEMENT_N │ │ │ +00149370: 4557 3c2f 636f 6465 3e2c 2061 6e64 203c EW, and < │ │ │ +00149380: 636f 6465 3e53 4f41 505f 4445 4c45 5445 code>SOAP_DELETE │ │ │ +00149390: 3c2f 636f 6465 3e2c 203c 636f 6465 3e53 , S │ │ │ +001493a0: 4f41 505f 4445 4c45 5445 5f41 5252 4159 OAP_DELETE_ARRAY │ │ │ +001493b0: 3c2f 636f 6465 3e20 746f 2072 6570 6c61 to repla │ │ │ +001493c0: 6365 203c 636f 6465 3e6e 6577 3c2f 636f ce new and de │ │ │ +001493e0: 6c65 7465 3c2f 636f 6465 3e20 7573 6564 lete used │ │ │ +001493f0: 2062 7920 7468 6520 656e 6769 6e65 2074 by the engine t │ │ │ +00149400: 6f20 616c 6c6f 6361 7465 206d 616e 6167 o allocate manag │ │ │ +00149410: 6564 206d 656d 6f72 792e 204f 6e65 2063 ed memory. One c │ │ │ +00149420: 616e 2066 6f72 2065 7861 6d70 6c65 2075 an for example u │ │ │ +00149430: 7365 2061 2067 6172 6261 6765 2063 6f6c se a garbage col │ │ │ +00149440: 6c65 6374 6f72 2077 6974 6820 6753 4f41 lector with gSOA │ │ │ +00149450: 5020 6279 2064 6566 696e 696e 6720 7375 P by defining su │ │ │ +00149460: 6974 6162 6c65 2072 6570 6c61 6365 6d65 itable replaceme │ │ │ +00149470: 6e74 732e 3c2f 703e 0a3c 703e 4d6f 7265 nts.

    .

    More │ │ │ +00149480: 2069 6e66 6f72 6d61 7469 6f6e 206f 6e20 information on │ │ │ +00149490: 6d65 6d6f 7279 206d 616e 6167 656d 656e memory managemen │ │ │ +001494a0: 7420 6361 6e20 6265 2066 6f75 6e64 2069 t can be found i │ │ │ +001494b0: 6e20 7468 6520 3c61 2068 7265 663d 222e n the C and C++ XML │ │ │ +001494f0: 4461 7461 2042 696e 6469 6e67 733c 2f61 Data Bindings documentation │ │ │ +00149510: 7468 6174 2068 6173 2073 6570 6172 6174 that has separat │ │ │ +00149520: 6520 7365 6374 696f 6e73 206f 6e20 6d65 e sections on me │ │ │ +00149530: 6d6f 7279 206d 616e 6167 656d 656e 7420 mory management │ │ │ +00149540: 696e 2043 2061 6e64 2069 6e20 432b 2b2e in C and in C++. │ │ │ +00149550: 3c2f 703e 0a3c 703e f09f 949d 203c 6120

    .

    .... Back to │ │ │ +00149570: 2074 6162 6c65 206f 6620 636f 6e74 656e table of conten │ │ │ +00149580: 7473 3c2f 613e 3c2f 703e 0a3c 6831 3e3c ts

    .

    < │ │ │ +00149590: 6120 636c 6173 733d 2261 6e63 686f 7222 a class="anchor" │ │ │ +001495a0: 2069 643d 2263 6c61 7373 6d65 6d6f 7279 id="classmemory │ │ │ +001495b0: 223e 3c2f 613e 0a49 6e74 7261 2d63 6c61 ">.Intra-cla │ │ │ +001495c0: 7373 206d 656d 6f72 7920 6d61 6e61 6765 ss memory manage │ │ │ +001495d0: 6d65 6e74 3c2f 6831 3e0a 3c70 3e57 6865 ment

    .

    Whe │ │ │ +001495e0: 6e20 6120 636c 6173 7320 3c63 6f64 653e n a class │ │ │ +001495f0: 543c 2f63 6f64 653e 2068 6173 2061 203c T has a < │ │ │ +00149600: 636f 6465 3e73 7472 7563 7420 736f 6170 code>struct soap │ │ │ +00149610: 202a 2054 3a3a 736f 6170 3c2f 636f 6465 * T::soap member declare │ │ │ +00149630: 6420 696e 2061 6e20 696e 7465 7266 6163 d in an interfac │ │ │ +00149640: 6520 6865 6164 6572 2066 696c 6520 666f e header file fo │ │ │ +00149650: 7220 736f 6170 6370 7032 2c20 7468 656e r soapcpp2, then │ │ │ +00149660: 2074 6869 7320 6d65 6d62 6572 2077 696c this member wil │ │ │ +00149670: 6c20 6265 2073 6574 2074 6f20 706f 696e l be set to poin │ │ │ +00149680: 7420 746f 2074 6865 2063 7572 7265 6e74 t to the current │ │ │ +00149690: 2063 6f6e 7465 7874 2062 7920 7468 6520 context by the │ │ │ +001496a0: 6465 7365 7269 616c 697a 6572 7320 616e deserializers an │ │ │ +001496b0: 6420 6279 2074 6865 203c 636f 6465 3e73 d by the s │ │ │ +001496c0: 6f61 705f 6465 6661 756c 743c 2f63 6f64 oap_default method of the │ │ │ +001496e0: 2063 6c61 7373 2061 6e64 2062 7920 7468 class and by th │ │ │ +001496f0: 6520 3c63 6f64 653e 736f 6170 5f64 6566 e soap_def │ │ │ +00149700: 6175 6c74 5f54 3c2f 636f 6465 3e20 616e ault_T an │ │ │ +00149710: 6420 3c63 6f64 653e 736f 6170 5f6e 6577 d soap_new │ │ │ +00149720: 5f54 3c2f 636f 6465 3e20 6675 6e63 7469 _T functi │ │ │ +00149730: 6f6e 7320 666f 7220 7468 6973 2063 6c61 ons for this cla │ │ │ +00149740: 7373 206e 616d 6564 203c 636f 6465 3e54 ss named T │ │ │ +00149750: 3c2f 636f 6465 3e2e 2054 6869 7320 7369 . This si │ │ │ +00149760: 6d70 6c69 6669 6573 206d 656d 6f72 7920 mplifies memory │ │ │ +00149770: 6d61 6e61 6765 6d65 6e74 2062 7920 636c management by cl │ │ │ +00149780: 6173 7320 6d65 7468 6f64 7320 7468 6174 ass methods that │ │ │ +00149790: 2061 6c6c 6f63 6174 6520 6461 7461 2061 allocate data a │ │ │ +001497a0: 7373 6f63 6961 7465 6420 7769 7468 2074 ssociated with t │ │ │ +001497b0: 6865 2063 6c61 7373 2069 6e73 7461 6e63 he class instanc │ │ │ +001497c0: 6520 7468 6174 206d 7573 7420 6265 206d e that must be m │ │ │ +001497d0: 616e 6167 6564 2062 7920 7468 6520 636f anaged by the co │ │ │ +001497e0: 6e74 6578 742e 3c2f 703e 0a3c 703e 436f ntext.

    .

    Co │ │ │ +001497f0: 6e73 6964 6572 2066 6f72 2065 7861 6d70 nsider for examp │ │ │ +00149800: 6c65 2074 6865 2066 6f6c 6c6f 7769 6e67 le the following │ │ │ +00149810: 2063 6c61 7373 2064 6563 6c61 7261 7469 class declarati │ │ │ +00149820: 6f6e 3a3c 2f70 3e0a 3c64 6976 2063 6c61 on:

    .
    │ │ │ +00149850: 3c73 7061 6e20 636c 6173 733d 226b 6579 class Class
    . │ │ │ +00149880: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    { public │ │ │ +001498b0: 3c2f 7370 616e 3e3a 3c2f 6469 763e 0a3c :
    .< │ │ │ +001498c0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +001498d0: 3e20 2020 2043 6c61 7373 2829 3b3c 2f64 > Class();.
    ~Class │ │ │ +00149900: 2829 3b3c 2f64 6976 3e0a 3c64 6976 2063 ();
    .
    . │ │ │ +001499e0: 2020 2020 3c73 7061 6e20 636c 6173 733d ch │ │ │ +00149a00: 6172 3c2f 7370 616e 3e20 2a6e 616d 653b ar *name; │ │ │ +00149a10: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
  • .
    void setName(const < │ │ │ +00149a80: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +00149a90: 6f72 6474 7970 6522 3e63 6861 723c 2f73 ordtype">char *s);
    │ │ │ +00149ab0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    char *ge │ │ │ +00149af0: 744e 616d 6528 293b 3c2f 6469 763e 0a3c tName();
    .< │ │ │ +00149b00: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +00149b10: 3e7d 3b3c 2f64 6976 3e0a 3c2f 6469 763e >};
    .
    │ │ │ +00149b20: 3c21 2d2d 2066 7261 676d 656e 7420 2d2d │ │ │ +00149e10: 3c70 3e48 6f77 6576 6572 2c20 7768 656e

    However, when │ │ │ +00149e20: 2069 6e73 7461 6e63 6573 206f 6620 3c63 instances of Class │ │ │ +00149e40: 2061 7265 2064 6573 6572 6961 6c69 7a65 are deserialize │ │ │ +00149e50: 6420 7765 2068 6176 6520 6120 7072 6f62 d we have a prob │ │ │ +00149e60: 6c65 6d20 7769 7468 2074 6869 7320 6170 lem with this ap │ │ │ +00149e70: 7072 6f61 6368 2062 6563 6175 7365 203c proach because < │ │ │ +00149e80: 636f 6465 3e66 7265 6528 6e61 6d65 293c code>free(name)< │ │ │ +00149e90: 2f63 6f64 653e 2064 656c 6574 6573 2061 /code> deletes a │ │ │ +00149ea0: 206d 616e 6167 6564 2073 7472 696e 672c managed string, │ │ │ +00149eb0: 2077 6869 6368 2069 7320 6d61 6e61 6765 which is manage │ │ │ +00149ec0: 6420 6279 2074 6865 2063 6f6e 7465 7874 d by the context │ │ │ +00149ed0: 2e20 4265 6361 7573 6520 7468 6520 6465 . Because the de │ │ │ +00149ee0: 7365 7269 616c 697a 6572 2061 6c73 6f20 serializer also │ │ │ +00149ef0: 7365 7473 2074 6865 203c 636f 6465 3e73 sets the s │ │ │ +00149f00: 6f61 703c 2f63 6f64 653e 206d 656d 6265 oap membe │ │ │ +00149f10: 7220 6f66 2074 6869 7320 636c 6173 732c r of this class, │ │ │ +00149f20: 2074 6865 7265 2069 7320 616e 2065 6173 there is an eas │ │ │ +00149f30: 7920 736f 6c75 7469 6f6e 2074 6f20 7468 y solution to th │ │ │ +00149f40: 6973 2070 726f 626c 656d 3a3c 2f70 3e0a is problem:

    . │ │ │ +00149f50: 3c64 6976 2063 6c61 7373 3d22 6672 6167
    Class::~ │ │ │ +00149f80: 436c 6173 7328 2920 3c2f 6469 763e 0a3c Class()
    .< │ │ │ +00149f90: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +00149fa0: 3e7b 3c2f 6469 763e 0a3c 6469 7620 636c >{
    .
    if │ │ │ +00149fe0: 2028 213c 6120 636c 6173 733d 2263 6f64 (!soap && na │ │ │ +0014a020: 6d65 293c 2f64 6976 3e0a 3c64 6976 2063 me)
    .
    │ │ │ +0014a040: 6672 6565 286e 616d 6529 3b3c 2f64 6976 free(name);
    .
    }
    .

    This only │ │ │ +0014a090: 6672 6565 7320 3c63 6f64 653e 6e61 6d65 frees name │ │ │ +0014a0a0: 3c2f 636f 6465 3e20 6966 2074 6865 203c if the < │ │ │ +0014a0b0: 636f 6465 3e73 6f61 703c 2f63 6f64 653e code>soap │ │ │ +0014a0c0: 2063 6f6e 7465 7874 2070 6f69 6e74 6572 context pointer │ │ │ +0014a0d0: 206d 656d 6265 7220 6973 204e 554c 4c2c member is NULL, │ │ │ +0014a0e0: 206d 6561 6e69 6e67 2074 6861 7420 6120 meaning that a │ │ │ +0014a0f0: 6d61 6e61 6765 6420 7374 7269 6e67 203c managed string < │ │ │ +0014a100: 636f 6465 3e6e 616d 653c 2f63 6f64 653e code>name │ │ │ +0014a110: 2077 696c 6c20 6265 2064 656c 6574 6564 will be deleted │ │ │ +0014a120: 2061 7320 7573 7561 6c20 7769 7468 2074 as usual with t │ │ │ +0014a130: 6865 2064 6573 6572 6961 6c69 7a65 6420 he deserialized │ │ │ +0014a140: 636c 6173 7320 7573 696e 6720 3c63 6f64 class using soap_destroy and soap_end< │ │ │ +0014a2f0: 2f61 3e3c 2f63 6f64 653e 2e3c 2f70 3e0a /a>.

    . │ │ │ +0014a300: 3c70 3e54 6865 206f 7468 6572 206d 6574

    The other met │ │ │ +0014a310: 686f 6473 2061 7265 2061 6c73 6f20 6d61 hods are also ma │ │ │ +0014a320: 6465 2063 6f67 6e69 7a61 6e74 206f 6620 de cognizant of │ │ │ +0014a330: 7468 6520 7072 6573 656e 6365 206f 6620 the presence of │ │ │ +0014a340: 6120 636f 6e74 6578 743a 3c2f 703e 0a3c a context:

    .< │ │ │ +0014a350: 6469 7620 636c 6173 733d 2266 7261 676d div class="fragm │ │ │ +0014a360: 656e 7422 3e3c 6469 7620 636c 6173 733d ent">
    void Cla │ │ │ +0014a3a0: 7373 3a3a 7365 744e 616d 6528 3c73 7061 ss::setName(const < │ │ │ +0014a3d0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +0014a3e0: 6f72 6474 7970 6522 3e63 6861 723c 2f73 ordtype">char *s)
    .< │ │ │ +0014a400: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +0014a410: 3e7b 3c2f 6469 763e 0a3c 6469 7620 636c >{
    ..
    n │ │ │ +0014a4a0: 616d 6520 3d20 3c61 2063 6c61 7373 3d22 ame = soap_ │ │ │ +0014a500: 7374 7264 7570 3c2f 613e 283c 6120 636c strdup(soap, s);< │ │ │ +0014a540: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    else< │ │ │ +0014a580: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    name │ │ │ +0014a5a0: 203d 2073 7472 6475 7028 7329 3b3c 2f64 = strdup(s);.
    }
    . │ │ │ +0014a5e0: 3c73 7061 6e20 636c 6173 733d 226b 6579 const cha │ │ │ +0014a620: 723c 2f73 7061 6e3e 202a 6765 744e 616d r *getNam │ │ │ +0014a630: 6528 293c 2f64 6976 3e0a 3c64 6976 2063 e()
    .
    {.
    return │ │ │ +0014a690: 6e61 6d65 3b3c 2f64 6976 3e0a 3c64 6976 name;
    .
    }< │ │ │ +0014a6b0: 2f64 6976 3e0a 3c2f 6469 763e 3c21 2d2d /div>.

    │ │ │ +0014a6d0: 416e 6f74 6865 7220 6170 7072 6f61 6368 Another approach │ │ │ +0014a6e0: 2069 7320 746f 2075 7365 203c 636f 6465 is to use soap_unlink │ │ │ +0014a7c0: 3c2f 613e 3c2f 636f 6465 3e20 746f 2075 to u │ │ │ +0014a7d0: 6e6c 696e 6b20 6461 7461 206d 616e 6167 nlink data manag │ │ │ +0014a7e0: 6564 2062 7920 7468 6520 636f 6e74 6578 ed by the contex │ │ │ +0014a7f0: 7420 616e 6420 6d61 6b65 2061 6c6c 2061 t and make all a │ │ │ +0014a800: 6c6c 6f63 6174 696f 6e73 2065 7870 6c69 llocations expli │ │ │ +0014a810: 6369 746c 793a 3c2f 703e 0a3c 6469 7620 citly:

    .
    Class::~Class │ │ │ +0014a850: 2829 203c 2f64 6976 3e0a 3c64 6976 2063 ()
    .
    {.
    if (nam │ │ │ +0014a8b0: 6529 3c2f 6469 763e 0a3c 6469 7620 636c e)
    .
    {.
    │ │ │ +0014a940: 736f 6170 5f75 6e6c 696e 6b3c 2f61 3e28 soap_unlink( │ │ │ +0014a950: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap, │ │ │ +0014a980: 206e 616d 6529 3b20 3c73 7061 6e20 636c name); // │ │ │ +0014a9a0: 2075 6e6c 696e 6b73 2074 6865 206e 616d unlinks the nam │ │ │ +0014a9b0: 6520 6966 2073 6f61 7020 6973 206e 6f6e e if soap is non │ │ │ +0014a9c0: 2d4e 554c 4c3c 2f73 7061 6e3e 3c2f 6469 -NULL.
    free(na │ │ │ +0014a9f0: 6d65 293b 3c2f 6469 763e 0a3c 6469 7620 me);
    .
    } │ │ │ +0014aa10: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    }
    │ │ │ +0014aa30: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    voi │ │ │ +0014aa60: 643c 2f73 7061 6e3e 2043 6c61 7373 3a3a d Class:: │ │ │ +0014aa70: 7365 744e 616d 6528 3c73 7061 6e20 636c setName(co │ │ │ +0014aa90: 6e73 743c 2f73 7061 6e3e 203c 7370 616e nst char │ │ │ +0014aac0: 202a 7329 3c2f 6469 763e 0a3c 6469 7620 *s)
    .
    {.
    name = │ │ │ +0014ab00: 7374 7264 7570 2873 293b 3c2f 6469 763e strdup(s);
    │ │ │ +0014ab10: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    }
    .
    const │ │ │ +0014ab60: 3c73 7061 6e20 636c 6173 733d 226b 6579 char *getName() │ │ │ +0014ab90: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    {
    │ │ │ +0014abb0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    r │ │ │ +0014abe0: 6574 7572 6e3c 2f73 7061 6e3e 206e 616d eturn nam │ │ │ +0014abf0: 653b 3c2f 6469 763e 0a3c 6469 7620 636c e;
    .
    }..

    The soap_unlin │ │ │ +0014aea0: 6b3c 2f61 3e3c 2f63 6f64 653e 2063 616c k cal │ │ │ +0014aeb0: 6c20 756e 6c69 6e6b 7320 6461 7461 2061 l unlinks data a │ │ │ +0014aec0: 6e64 206f 626a 6563 7473 2066 726f 6d20 nd objects from │ │ │ +0014aed0: 6d61 6e61 6765 6420 6d65 6d6f 7279 2e20 managed memory. │ │ │ +0014aee0: 496e 2074 6869 7320 7761 7920 3c63 6f64 In this way soap_destroy and soap_end< │ │ │ +0014b090: 2f61 3e3c 2f63 6f64 653e 2063 616e 2062 /a> can b │ │ │ +0014b0a0: 6520 6361 6c6c 6564 206c 6174 6572 2065 e called later e │ │ │ +0014b0b0: 7665 6e20 7768 656e 2074 6869 7320 636c ven when this cl │ │ │ +0014b0c0: 6173 7320 7761 7320 6465 7365 7269 616c ass was deserial │ │ │ +0014b0d0: 697a 6564 2e3c 2f70 3e0a 3c70 3ef0 9f94 ized.

    .

    ... │ │ │ +0014b0e0: 9d20 3c61 2068 7265 663d 2223 223e 4261 . Ba │ │ │ +0014b0f0: 636b 2074 6f20 7461 626c 6520 6f66 2063 ck to table of c │ │ │ +0014b100: 6f6e 7465 6e74 733c 2f61 3e3c 2f70 3e0a ontents

    . │ │ │ +0014b110: 3c68 313e 3c61 2063 6c61 7373 3d22 616e

    .Debugg │ │ │ +0014b140: 696e 673c 2f68 313e 0a3c 703e 546f 2061 ing

    .

    To a │ │ │ +0014b150: 6374 6976 6174 6520 6465 6275 6767 696e ctivate debuggin │ │ │ +0014b160: 6720 616e 6420 6d65 7373 6167 6520 6c6f g and message lo │ │ │ +0014b170: 6767 696e 6720 636f 6d70 696c 6520 7468 gging compile th │ │ │ +0014b180: 6520 736f 7572 6365 2063 6f64 6520 7769 e source code wi │ │ │ +0014b190: 7468 2063 6f6d 7069 6c65 2d74 696d 6520 th compile-time │ │ │ +0014b1a0: 666c 6167 203c 636f 6465 3e23 4445 4255 flag #DEBU │ │ │ +0014b1b0: 473c 2f63 6f64 653e 2e20 4f72 2077 6865 G. Or whe │ │ │ +0014b1c0: 6e20 7573 696e 6720 3c62 3e3c 636f 6465 n using -lgsoap< │ │ │ +0014b1e0: 2f62 3e20 6f72 203c 623e 3c63 6f64 653e /b> or │ │ │ +0014b1f0: 2d6c 6773 6f61 702b 2b3c 2f63 6f64 653e -lgsoap++ │ │ │ +0014b200: 3c2f 623e 2074 6865 6e20 7265 696e 7374 then reinst │ │ │ +0014b210: 616c 6c20 6753 4f41 5020 7769 7468 203c all gSOAP with < │ │ │ +0014b220: 623e 3c63 6f64 653e 2e2f 636f 6e66 6967 b>./config │ │ │ +0014b230: 7572 6520 2d2d 656e 6162 6c65 2d64 6562 ure --enable-deb │ │ │ +0014b240: 7567 3c2f 636f 6465 3e3c 2f62 3e20 616e ug an │ │ │ +0014b250: 6420 3c62 3e3c 636f 6465 3e6d 616b 653c d make< │ │ │ +0014b260: 2f63 6f64 653e 3c2f 623e 2e3c 2f70 3e0a /code>.

    . │ │ │ +0014b270: 3c70 3e57 6865 6e20 796f 7572 2067 534f

    When your gSO │ │ │ +0014b280: 4150 2063 6c69 656e 7420 6f72 2073 6572 AP client or ser │ │ │ +0014b290: 7665 7220 6170 706c 6963 6174 696f 6e73 ver applications │ │ │ +0014b2a0: 2072 756e 2c20 7468 6579 2077 696c 6c20 run, they will │ │ │ +0014b2b0: 6c6f 6720 7468 6569 7220 6163 7469 7669 log their activi │ │ │ +0014b2c0: 7479 2069 6e20 7468 7265 6520 7365 7061 ty in three sepa │ │ │ +0014b2d0: 7261 7465 2066 696c 6573 3a3c 2f70 3e0a rate files:

    . │ │ │ +0014b2e0: 3c75 6c3e 0a3c 6c69 3e3c 656d 3e3c 636f
      .
    • SENT.log a concat │ │ │ +0014b310: 656e 6174 696f 6e20 6f66 2061 6c6c 206d enation of all m │ │ │ +0014b320: 6573 7361 6765 7320 7365 6e74 3c2f 6c69 essages sent
    • .
    • │ │ │ +0014b340: 5245 4356 2e6c 6f67 3c2f 636f 6465 3e3c RECV.log< │ │ │ +0014b350: 2f65 6d3e 2061 2063 6f6e 6361 7465 6e61 /em> a concatena │ │ │ +0014b360: 7469 6f6e 206f 6620 616c 6c20 6d65 7373 tion of all mess │ │ │ +0014b370: 6167 6573 2072 6563 6569 7665 643c 2f6c ages received.
    • TEST.log │ │ │ +0014b3a0: 3c2f 656d 3e20 6120 6c6f 6720 6f66 2074 a log of t │ │ │ +0014b3b0: 6865 2065 6e67 696e 6527 7320 6f70 6572 he engine's oper │ │ │ +0014b3c0: 6174 696f 6e73 3c2f 6c69 3e0a 3c2f 756c ations
    • .
    .
    WarningThe gSOAP clie │ │ │ +0014b410: 6e74 2061 6e64 2073 6572 7665 7220 6170 nt and server ap │ │ │ +0014b420: 706c 6963 6174 696f 6e73 2077 696c 6c20 plications will │ │ │ +0014b430: 7275 6e20 736c 6f77 2064 7565 2074 6f20 run slow due to │ │ │ +0014b440: 6465 6275 6767 696e 6720 616e 6420 6d65 debugging and me │ │ │ +0014b450: 7373 6167 6520 6c6f 6767 696e 672e 3c2f ssage logging.
    .

    You │ │ │ +0014b470: 6361 6e20 7365 7420 6d61 6372 6f20 3c63 can set macro #DEBUG_STAMP │ │ │ +0014b490: 3c2f 636f 6465 3e20 696e 7374 6561 6420 instead │ │ │ +0014b4a0: 6f66 203c 636f 6465 3e23 4445 4255 473c of #DEBUG< │ │ │ +0014b4b0: 2f63 6f64 653e 2074 6f20 6164 6420 7469 /code> to add ti │ │ │ +0014b4c0: 6d65 2073 7461 6d70 7320 746f 203c 636f me stamps to TEST.log. This works o │ │ │ +0014b4f0: 6e20 616c 6c20 6f70 6572 6174 696e 6720 n all operating │ │ │ +0014b500: 7379 7374 656d 7320 7375 7070 6f72 7469 systems supporti │ │ │ +0014b510: 6e67 2074 6865 203c 636f 6465 3e67 6574 ng the get │ │ │ +0014b520: 7469 6d65 6f66 6461 793c 2f63 6f64 653e timeofday │ │ │ +0014b530: 2066 756e 6374 696f 6e2e 3c2f 703e 0a3c function.

    .< │ │ │ +0014b540: 703e 5768 656e 2069 6e73 7461 6c6c 696e p>When installin │ │ │ +0014b550: 6720 6120 4347 4920 7365 7276 6963 6520 g a CGI service │ │ │ +0014b560: 6170 706c 6963 6174 696f 6e20 636f 6d70 application comp │ │ │ +0014b570: 696c 6564 2077 6974 6820 6465 6275 6767 iled with debugg │ │ │ +0014b580: 696e 6720 656e 6162 6c65 642c 2074 6865 ing enabled, the │ │ │ +0014b590: 206c 6f67 2066 696c 6573 206d 6179 2073 log files may s │ │ │ +0014b5a0: 6f6d 6574 696d 6573 206e 6f74 2062 6520 ometimes not be │ │ │ +0014b5b0: 6372 6561 7465 6420 6475 6520 746f 2066 created due to f │ │ │ +0014b5c0: 696c 6520 6163 6365 7373 2070 6572 6d69 ile access permi │ │ │ +0014b5d0: 7373 696f 6e20 7265 7374 7269 6374 696f ssion restrictio │ │ │ +0014b5e0: 6e73 2069 6d70 6f73 6564 206f 6e20 4347 ns imposed on CG │ │ │ +0014b5f0: 4920 6170 706c 6963 6174 696f 6e73 2e20 I applications. │ │ │ +0014b600: 546f 2067 6574 2061 726f 756e 6420 7468 To get around th │ │ │ +0014b610: 6973 2c20 6372 6561 7465 2065 6d70 7479 is, create empty │ │ │ +0014b620: 206c 6f67 2066 696c 6573 2077 6974 6820 log files with │ │ │ +0014b630: 756e 6976 6572 7361 6c20 7772 6974 6520 universal write │ │ │ +0014b640: 7065 726d 6973 7369 6f6e 732e 2042 6520 permissions. Be │ │ │ +0014b650: 6361 7265 6675 6c20 6162 6f75 7420 7468 careful about th │ │ │ +0014b660: 6520 7365 6375 7269 7479 2069 6d70 6c69 e security impli │ │ │ +0014b670: 6361 7469 6f6e 206f 6620 7468 6973 2e3c cation of this.< │ │ │ +0014b680: 2f70 3e0a 3c70 3e59 6f75 2063 616e 2061 /p>.

    You can a │ │ │ +0014b690: 6374 7561 6c6c 7920 7465 7374 2061 2043 ctually test a C │ │ │ +0014b6a0: 4749 2073 6572 7669 6365 2061 7070 6c69 GI service appli │ │ │ +0014b6b0: 6361 7469 6f6e 2077 6974 686f 7574 2064 cation without d │ │ │ +0014b6c0: 6570 6c6f 7969 6e67 2069 7420 6f6e 2074 eploying it on t │ │ │ +0014b6d0: 6865 2057 6562 2e20 546f 2064 6f20 7468 he Web. To do th │ │ │ +0014b6e0: 6973 2c20 6372 6561 7465 2074 6865 2043 is, create the C │ │ │ +0014b6f0: 4749 2073 6572 7669 6365 2061 7070 6c69 GI service appli │ │ │ +0014b700: 6361 7469 6f6e 2061 6e64 2073 656e 6420 cation and send │ │ │ +0014b710: 6974 2061 2072 6571 7565 7374 206d 6573 it a request mes │ │ │ +0014b720: 7361 6765 2075 7369 6e67 2072 6564 6972 sage using redir │ │ │ +0014b730: 6563 7469 6f6e 2061 7320 666f 6c6c 6f77 ection as follow │ │ │ +0014b740: 733a 203c 2f70 3e3c 7072 6520 636c 6173 s:

    ./s
    │ │ │ +0014b760: 6572 7669 6365 2e63 6769 2026 6c74 3b20  ervice.cgi < 
    │ │ │ +0014b770: 6e73 2e61 6464 2e72 6571 2e78 6d6c 0a3c  ns.add.req.xml.<
    │ │ │ +0014b780: 2f70 7265 3e3c 703e 2074 6869 7320 7368  /pre>

    this sh │ │ │ +0014b790: 6f75 6c64 2064 6973 706c 6179 2074 6865 ould display the │ │ │ +0014b7a0: 2073 6572 7669 6365 2072 6573 706f 6e73 service respons │ │ │ +0014b7b0: 6520 6f6e 2074 6865 2074 6572 6d69 6e61 e on the termina │ │ │ +0014b7c0: 6c2c 2077 6865 7265 203c 656d 3e3c 636f l, where ns.add.req.xm │ │ │ +0014b7e0: 6c3c 2f63 6f64 653e 3c2f 656d 3e20 7761 l wa │ │ │ +0014b7f0: 7320 6765 6e65 7261 7465 6420 6279 2073 s generated by s │ │ │ +0014b800: 6f61 7063 7070 3220 6f72 2061 206d 6f64 oapcpp2 or a mod │ │ │ +0014b810: 6966 6965 6420 7665 7273 696f 6e20 6f66 ified version of │ │ │ +0014b820: 2074 6869 7320 6669 6c65 2e20 596f 7520 this file. You │ │ │ +0014b830: 6361 6e20 616c 736f 2075 7365 2061 203c can also use a < │ │ │ +0014b840: 656d 3e3c 636f 6465 3e53 454e 542e 6c6f em>SENT.lo │ │ │ +0014b850: 673c 2f63 6f64 653e 3c2f 656d 3e20 6669 g fi │ │ │ +0014b860: 6c65 2070 726f 6475 6365 6420 6279 2061 le produced by a │ │ │ +0014b870: 2063 6c69 656e 7420 6170 706c 6963 6174 client applicat │ │ │ +0014b880: 696f 6e20 746f 2072 6564 6972 6563 7420 ion to redirect │ │ │ +0014b890: 746f 2074 6865 2043 4749 2073 6572 7669 to the CGI servi │ │ │ +0014b8a0: 6365 2061 7070 6c69 6361 7469 6f6e 2e20 ce application. │ │ │ +0014b8b0: 596f 7520 6361 6e20 616c 736f 2075 7365 You can also use │ │ │ +0014b8c0: 2074 6865 2067 534f 4150 203c 6120 6872 the gSOAP Test Messeng │ │ │ +0014b900: 6572 3c2f 613e 2061 7070 6c69 6361 7469 er applicati │ │ │ +0014b910: 6f6e 2074 6f20 6765 6e65 7261 7465 2072 on to generate r │ │ │ +0014b920: 616e 646f 6d69 7a65 6420 6d65 7373 6167 andomized messag │ │ │ +0014b930: 6573 2074 6f20 7465 7374 2079 6f75 7220 es to test your │ │ │ +0014b940: 7365 7276 6572 732e 3c2f 703e 0a3c 703e servers.

    .

    │ │ │ +0014b950: 5468 6520 6669 6c65 206e 616d 6573 206f The file names o │ │ │ +0014b960: 6620 7468 6520 6c6f 6720 6669 6c65 7320 f the log files │ │ │ +0014b970: 616e 6420 7468 6520 6c6f 6767 696e 6720 and the logging │ │ │ +0014b980: 6163 7469 7669 7479 2063 616e 2062 6520 activity can be │ │ │ +0014b990: 636f 6e74 726f 6c6c 6564 2061 7420 7468 controlled at th │ │ │ +0014b9a0: 6520 6170 706c 6963 6174 696f 6e20 6c65 e application le │ │ │ +0014b9b0: 7665 6c2e 2054 6869 7320 616c 6c6f 7773 vel. This allows │ │ │ +0014b9c0: 2074 6865 2063 7265 6174 696f 6e20 6f66 the creation of │ │ │ +0014b9d0: 2073 6570 6172 6174 6520 6c6f 6720 6669 separate log fi │ │ │ +0014b9e0: 6c65 7320 6279 2073 6570 6172 6174 6520 les by separate │ │ │ +0014b9f0: 7365 7276 6963 6573 2c20 636c 6965 6e74 services, client │ │ │ +0014ba00: 732c 2061 6e64 2074 6872 6561 6473 2e20 s, and threads. │ │ │ +0014ba10: 466f 7220 6578 616d 706c 652c 2074 6865 For example, the │ │ │ +0014ba20: 2066 6f6c 6c6f 7769 6e67 2073 6572 7669 following servi │ │ │ +0014ba30: 6365 206c 6f67 7320 616c 6c20 6d65 7373 ce logs all mess │ │ │ +0014ba40: 6167 6573 2028 6275 7420 6e6f 2064 6562 ages (but no deb │ │ │ +0014ba50: 7567 206d 6573 7361 6765 7329 2069 6e20 ug messages) in │ │ │ +0014ba60: 7365 7061 7261 7465 2064 6972 6563 746f separate directo │ │ │ +0014ba70: 7269 6573 3a3c 2f70 3e0a 3c64 6976 2063 ries:

    .
    │ │ │ +0014ba90: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    struct < │ │ │ +0014bac0: 2f73 7061 6e3e 3c61 2063 6c61 7373 3d22 /span>soa │ │ │ +0014baf0: 703c 2f61 3e20 2a3c 6120 636c 6173 733d p *so │ │ │ +0014bb20: 6170 3c2f 613e 203d 203c 6120 636c 6173 ap = so │ │ │ +0014bb80: 6170 5f6e 6577 3c2f 613e 2829 3b20 3c2f ap_new(); .. │ │ │ +0014bd00: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap_set_sent │ │ │ +0014bd60: 5f6c 6f67 6669 6c65 3c2f 613e 283c 6120 _logfile(soap, " │ │ │ +0014bdc0: 6c6f 6773 2f73 656e 742f 7365 7276 6963 logs/sent/servic │ │ │ +0014bdd0: 6531 322e 6c6f 6726 7175 6f74 3b3c 2f73 e12.log"); // │ │ │ +0014be00: 6170 7065 6e64 2061 6c6c 206d 6573 7361 append all messa │ │ │ +0014be10: 6765 7320 7365 6e74 2069 6e20 2f6c 6f67 ges sent in /log │ │ │ +0014be20: 732f 7365 6e74 2f73 6572 7669 6365 3132 s/sent/service12 │ │ │ +0014be30: 2e6c 6f67 203c 2f73 7061 6e3e 3c2f 6469 .log .
    soap_set │ │ │ +0014beb0: 5f74 6573 745f 6c6f 6766 696c 653c 2f61 _test_logfile(soap, NULL); │ │ │ +0014bf00: 2020 2020 2020 2020 2020 2020 2020 203c < │ │ │ +0014bf10: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ +0014bf20: 656e 7422 3e2f 2f20 6e6f 2066 696c 6520 ent">// no file │ │ │ +0014bf30: 6e61 6d65 3a20 646f 206e 6f74 2073 6176 name: do not sav │ │ │ +0014bf40: 6520 6465 6275 6720 6d65 7373 6167 6573 e debug messages │ │ │ +0014bf50: 203c 2f73 7061 6e3e 3c2f 6469 763e 0a3c
    .< │ │ │ +0014bf60: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +0014bf70: 3e2e 2e2e 203c 7370 616e 2063 6c61 7373 >... //
    .
    soa │ │ │ +0014c000: 705f 7365 7276 653c 2f61 3e28 3c61 2063 p_serve(soap); .
    ... //
    │ │ │ +0014c080: 0a3c 6469 7620 636c 6173 733d 226c 696e ..
    vo │ │ │ +0014c210: 6964 2073 6f61 705f 7365 745f 7265 6376 id soap_set_recv │ │ │ +0014c220: 5f6c 6f67 6669 6c65 2873 7472 7563 7420 _logfile(struct │ │ │ +0014c230: 736f 6170 202a 736f 6170 2c20 636f 6e73 soap *soap, cons │ │ │ +0014c240: 7420 6368 6172 202a 6c6f 6766 696c 6529 t char *logfile) │ │ │ +0014c250: 3c2f 6469 763e 3c64 6976 2063 6c61 7373
    Specify │ │ │ +0014c270: 2061 2066 696c 6520 6e61 6d65 2074 6f20 a file name to │ │ │ +0014c280: 7361 7665 206d 6573 7361 6765 7320 7265 save messages re │ │ │ +0014c290: 6365 6976 6564 2e3c 2f64 6976 3e3c 2f64 ceived.
    .
    │ │ │ +0014c370: 3c64 6976 2063 6c61 7373 3d22 7474 6465
    void soap_se │ │ │ +0014c390: 745f 7465 7374 5f6c 6f67 6669 6c65 2873 t_test_logfile(s │ │ │ +0014c3a0: 7472 7563 7420 736f 6170 202a 736f 6170 truct soap *soap │ │ │ +0014c3b0: 2c20 636f 6e73 7420 6368 6172 202a 6c6f , const char *lo │ │ │ +0014c3c0: 6766 696c 6529 3c2f 6469 763e 3c64 6976 gfile)
    S │ │ │ +0014c3e0: 7065 6369 6679 2061 2066 696c 6520 6e61 pecify a file na │ │ │ +0014c3f0: 6d65 2074 6f20 7361 7665 2064 6562 7567 me to save debug │ │ │ +0014c400: 6769 6e67 2069 6e66 6f2e 3c2f 6469 763e ging info.
    │ │ │ +0014c410: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    soap_set_sen │ │ │ +0014c4d0: 745f 6c6f 6766 696c 653c 2f61 3e3c 2f64 t_logfile
    void soap │ │ │ +0014c500: 5f73 6574 5f73 656e 745f 6c6f 6766 696c _set_sent_logfil │ │ │ +0014c510: 6528 7374 7275 6374 2073 6f61 7020 2a73 e(struct soap *s │ │ │ +0014c520: 6f61 702c 2063 6f6e 7374 2063 6861 7220 oap, const char │ │ │ +0014c530: 2a6c 6f67 6669 6c65 293c 2f64 6976 3e3c *logfile)
    < │ │ │ +0014c540: 6469 7620 636c 6173 733d 2274 7464 6f63 div class="ttdoc │ │ │ +0014c550: 223e 5370 6563 6966 7920 6120 6669 6c65 ">Specify a file │ │ │ +0014c560: 206e 616d 6520 746f 2073 6176 6520 6d65 name to save me │ │ │ +0014c570: 7373 6167 6573 2073 656e 742e 3c2f 6469 ssages sent.
    .
    < │ │ │ +0014c590: 212d 2d20 6672 6167 6d65 6e74 202d 2d3e !-- fragment --> │ │ │ +0014c5a0: 3c70 3e4c 696b 6577 6973 652c 206d 6573

    Likewise, mes │ │ │ +0014c5b0: 7361 6765 7320 6361 6e20 6265 206c 6f67 sages can be log │ │ │ +0014c5c0: 6765 6420 666f 7220 696e 6469 7669 6475 ged for individu │ │ │ +0014c5d0: 616c 2063 6c69 656e 742d 7369 6465 2073 al client-side s │ │ │ +0014c5e0: 6572 7669 6365 206f 7065 7261 7469 6f6e ervice operation │ │ │ +0014c5f0: 2063 616c 6c73 2069 6e20 6120 636c 6965 calls in a clie │ │ │ +0014c600: 6e74 2061 7070 6c69 6361 7469 6f6e 2e3c nt application.< │ │ │ +0014c610: 2f70 3e0a 3c70 3e54 6f20 6c6f 6720 6d65 /p>.

    To log me │ │ │ +0014c620: 7373 6167 6573 206d 6f72 6520 6566 6669 ssages more effi │ │ │ +0014c630: 6369 656e 746c 792c 2075 7365 2074 6865 ciently, use the │ │ │ +0014c640: 203c 636f 6465 3e3c 6120 636c 6173 733d loggin │ │ │ +0014c6d0: 673c 2f61 3e3c 2f63 6f64 653e 2070 6c75 g plu │ │ │ +0014c6e0: 6769 6e2e 3c2f 703e 0a3c 703e f09f 949d gin.

    .

    .... │ │ │ +0014c6f0: 203c 6120 6872 6566 3d22 2322 3e42 6163 Bac │ │ │ +0014c700: 6b20 746f 2074 6162 6c65 206f 6620 636f k to table of co │ │ │ +0014c710: 6e74 656e 7473 3c2f 613e 3c2f 703e 0a3c ntents

    .< │ │ │ +0014c720: 6831 3e3c 6120 636c 6173 733d 2261 6e63 h1>.Limit │ │ │ +0014c750: 6174 696f 6e73 3c2f 6831 3e0a 3c70 3e46 ations.

    F │ │ │ +0014c760: 726f 6d20 7468 6520 7065 7273 7065 6374 rom the perspect │ │ │ +0014c770: 6976 6520 6f66 2074 6865 2043 2f43 2b2b ive of the C/C++ │ │ │ +0014c780: 206c 616e 6775 6167 652c 2061 2066 6577 language, a few │ │ │ +0014c790: 2043 2f43 2b2b 206c 616e 6775 6167 6520 C/C++ language │ │ │ +0014c7a0: 6665 6174 7572 6573 2061 7265 206e 6f74 features are not │ │ │ +0014c7b0: 2073 7570 706f 7274 6564 2062 7920 6753 supported by gS │ │ │ +0014c7c0: 4f41 5020 616e 6420 7468 6573 6520 6665 OAP and these fe │ │ │ +0014c7d0: 6174 7572 6573 2063 616e 6e6f 7420 6265 atures cannot be │ │ │ +0014c7e0: 2075 7365 6420 696e 2061 6e20 696e 7465 used in an inte │ │ │ +0014c7f0: 7266 6163 6520 6865 6164 6572 2066 696c rface header fil │ │ │ +0014c800: 6520 666f 7220 736f 6170 6370 7032 2e3c e for soapcpp2.< │ │ │ +0014c810: 2f70 3e0a 3c75 6c3e 0a3c 6c69 3e53 544c /p>.

      .
    • STL │ │ │ +0014c820: 3a20 7468 6520 736f 6170 6370 7032 2074 : the soapcpp2 t │ │ │ +0014c830: 6f6f 6c20 7375 7070 6f72 7473 2074 6865 ool supports the │ │ │ +0014c840: 2073 6572 6961 6c69 7a61 7469 6f6e 206f serialization o │ │ │ +0014c850: 6620 432b 2b20 7374 7269 6e67 7320 3c63 f C++ strings std::string< │ │ │ +0014c870: 2f63 6f64 653e 2061 6e64 203c 636f 6465 /code> and std::wstring and the con │ │ │ +0014c8a0: 7461 696e 6572 7320 3c63 6f64 653e 7374 tainers st │ │ │ +0014c8b0: 643a 3a64 6571 7565 3c2f 636f 6465 3e2c d::deque, │ │ │ +0014c8c0: 203c 636f 6465 3e73 7464 3a3a 6c69 7374 std::list │ │ │ +0014c8d0: 3c2f 636f 6465 3e2c 203c 636f 6465 3e73 , s │ │ │ +0014c8e0: 7464 3a3a 7665 6374 6f72 3c2f 636f 6465 td::vector, and std │ │ │ +0014c900: 3a3a 7365 743c 2f63 6f64 653e 2c20 2873 ::set, (s │ │ │ +0014c910: 6565 2053 6563 7469 6f6e 203c 6120 636c ee Section STL contain │ │ │ +0014c950: 6572 733c 2f61 3e20 292e 2041 6c73 6f20 ers ). Also │ │ │ +0014c960: 3c63 6f64 653e 7374 643a 3a73 6861 7265 std::share │ │ │ +0014c970: 645f 7074 723c 2f63 6f64 653e 2c20 3c63 d_ptr, std::unique_ │ │ │ +0014c990: 7074 723c 2f63 6f64 653e 2c20 616e 6420 ptr, and │ │ │ +0014c9a0: 3c63 6f64 653e 7374 643a 3a61 7574 6f5f std::auto_ │ │ │ +0014c9b0: 7074 723c 2f63 6f64 653e 2061 7265 2073 ptr are s │ │ │ +0014c9c0: 7570 706f 7274 6564 2e20 4f74 6865 7220 upported. Other │ │ │ +0014c9d0: 5354 4c20 7479 7065 7320 6172 6520 6e6f STL types are no │ │ │ +0014c9e0: 7420 7365 7269 616c 697a 6162 6c65 2e3c t serializable.< │ │ │ +0014c9f0: 2f6c 693e 0a3c 6c69 3e54 656d 706c 6174 /li>.
    • Templat │ │ │ +0014ca00: 6573 3a20 7468 6520 736f 6170 6370 7032 es: the soapcpp2 │ │ │ +0014ca10: 2074 6f6f 6c20 6173 7375 6d65 7320 7468 tool assumes th │ │ │ +0014ca20: 6174 2074 656d 706c 6174 6573 2063 6c61 at templates cla │ │ │ +0014ca30: 7373 6573 2068 6176 6520 6f6e 6c79 206f sses have only o │ │ │ +0014ca40: 6e65 2074 656d 706c 6174 6520 7061 7261 ne template para │ │ │ +0014ca50: 6d65 7465 7220 7479 7065 2061 6e64 2074 meter type and t │ │ │ +0014ca60: 6865 7365 2074 656d 706c 6174 6573 2061 hese templates a │ │ │ +0014ca70: 7265 2063 6f6e 7461 696e 6572 7320 6f66 re containers of │ │ │ +0014ca80: 2076 616c 7565 7320 6f66 2074 6869 7320 values of this │ │ │ +0014ca90: 7465 6d70 6c61 7465 2070 6172 616d 6574 template paramet │ │ │ +0014caa0: 6572 2074 7970 652e 2054 6869 7320 7465 er type. This te │ │ │ +0014cab0: 6d70 6c61 7465 2063 6c61 7373 2073 686f mplate class sho │ │ │ +0014cac0: 756c 6420 6465 6669 6e65 203c 636f 6465 uld define begin(), │ │ │ +0014cae0: 203c 636f 6465 3e65 6e64 2829 3c2f 636f end(), size( │ │ │ +0014cb00: 293c 2f63 6f64 653e 2c20 3c63 6f64 653e ), │ │ │ +0014cb10: 636c 6561 7228 293c 2f63 6f64 653e 2c20 clear(), │ │ │ +0014cb20: 616e 6420 3c63 6f64 653e 696e 7365 7274 and insert │ │ │ +0014cb30: 2829 3c2f 636f 6465 3e20 6d65 7468 6f64 () method │ │ │ +0014cb40: 732e 3c2f 6c69 3e0a 3c6c 693e 496e 6865 s.
    • .
    • Inhe │ │ │ +0014cb50: 7269 7461 6e63 653a 2073 696e 676c 6520 ritance: single │ │ │ +0014cb60: 636c 6173 7320 696e 6865 7269 7461 6e63 class inheritanc │ │ │ +0014cb70: 6520 6973 2073 7570 706f 7274 6564 2e3c e is supported.< │ │ │ +0014cb80: 2f6c 693e 0a3c 6c69 3e41 6273 7472 6163 /li>.
    • Abstrac │ │ │ +0014cb90: 7420 6d65 7468 6f64 733a 2061 2063 6c61 t methods: a cla │ │ │ +0014cba0: 7373 206d 7573 7420 6265 2069 6e73 7461 ss must be insta │ │ │ +0014cbb0: 6e74 6961 626c 6520 746f 2073 7570 706f ntiable to suppo │ │ │ +0014cbc0: 7274 2073 6572 6961 6c69 7a61 7469 6f6e rt serialization │ │ │ +0014cbd0: 206f 6620 7468 6174 2063 6c61 7373 2e20 of that class. │ │ │ +0014cbe0: 416e 2061 6273 7472 6163 7420 636c 6173 An abstract clas │ │ │ +0014cbf0: 7320 7768 656e 2075 7365 6420 7368 6f75 s when used shou │ │ │ +0014cc00: 6c64 2062 6520 6465 636c 6172 6564 2074 ld be declared t │ │ │ +0014cc10: 7261 6e73 6965 6e74 2c20 7365 6520 5365 ransient, see Se │ │ │ +0014cc20: 6374 696f 6e20 3c61 2063 6c61 7373 3d22 ction │ │ │ +0014cc50: 5472 616e 7369 656e 7420 6461 7461 2074 Transient data t │ │ │ +0014cc60: 7970 6573 3c2f 613e 2e3c 2f6c 693e 0a3c ypes.
    • .< │ │ │ +0014cc70: 6c69 3e44 6972 6563 7469 7665 733a 2064 li>Directives: d │ │ │ +0014cc80: 6972 6563 7469 7665 7320 616e 6420 7072 irectives and pr │ │ │ +0014cc90: 6167 6d61 7320 7375 6368 2061 7320 3c63 agmas such as #include and #d │ │ │ +0014ccc0: 6566 696e 653c 2f63 6f64 653e 2061 7265 efine are │ │ │ +0014ccd0: 206d 6f76 6564 2074 6f20 7468 6520 6765 moved to the ge │ │ │ +0014cce0: 6e65 7261 7465 6420 3c65 6d3e 3c63 6f64 nerated soapStub.h source │ │ │ +0014cd10: 636f 6465 2062 7920 736f 6170 6370 7032 code by soapcpp2 │ │ │ +0014cd20: 2e20 5468 6573 6520 6469 7265 6374 6976 . These directiv │ │ │ +0014cd30: 6573 2061 7265 2061 6c6c 2070 6c61 6365 es are all place │ │ │ +0014cd40: 6420 6174 2074 6865 2074 6f70 206f 6620 d at the top of │ │ │ +0014cd50: 7468 6174 2066 696c 652c 2073 6565 203c that file, see < │ │ │ +0014cd60: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ +0014cd70: 663d 2269 6e64 6578 2e68 746d 6c23 7072 f="index.html#pr │ │ │ +0014cd80: 6167 6d61 7322 3e54 6865 2023 696e 636c agmas">The #incl │ │ │ +0014cd90: 7564 6520 616e 6420 2364 6566 696e 6520 ude and #define │ │ │ +0014cda0: 6469 7265 6374 6976 6573 3c2f 613e 2e20 directives. │ │ │ +0014cdb0: 5573 6520 7468 6520 3c63 6f64 653e 2369 Use the #i │ │ │ +0014cdc0: 6d70 6f72 743c 2f63 6f64 653e 2064 6972 mport dir │ │ │ +0014cdd0: 6563 7469 7665 2074 6f20 696d 706f 7274 ective to import │ │ │ +0014cde0: 2069 6e74 6572 6661 6365 2068 6561 6465 interface heade │ │ │ +0014cdf0: 7220 6669 6c65 7320 696e 746f 206f 7468 r files into oth │ │ │ +0014ce00: 6572 2069 6e74 6572 6661 6365 2068 6561 er interface hea │ │ │ +0014ce10: 6465 7220 6669 6c65 732c 2073 6565 2053 der files, see S │ │ │ +0014ce20: 6563 7469 6f6e 203c 6120 636c 6173 733d ection Th │ │ │ +0014ce50: 6520 2369 6d70 6f72 7420 6469 7265 6374 e #import direct │ │ │ +0014ce60: 6976 653c 2f61 3e20 2e3c 2f6c 693e 0a3c ive ..< │ │ │ +0014ce70: 6c69 3e43 2061 6e64 2043 2b2b 2063 6f64 li>C and C++ cod │ │ │ +0014ce80: 6520 7374 6174 656d 656e 7473 3a20 6e6f e statements: no │ │ │ +0014ce90: 2063 6f64 6520 7374 6174 656d 656e 7473 code statements │ │ │ +0014cea0: 2061 7265 2061 6c6c 6f77 7320 696e 2069 are allows in i │ │ │ +0014ceb0: 6e74 6572 6661 6365 2068 6561 6465 7220 nterface header │ │ │ +0014cec0: 6669 6c65 732e 2043 6c61 7373 206d 6574 files. Class met │ │ │ +0014ced0: 686f 6473 2073 686f 756c 6420 6265 2064 hods should be d │ │ │ +0014cee0: 6563 6c61 7265 6420 7769 7468 6f75 7420 eclared without │ │ │ +0014cef0: 636f 6465 2069 6e20 3c63 6f64 653e 7b3c code in {< │ │ │ +0014cf00: 2f63 6f64 653e 2061 6e64 203c 636f 6465 /code> and }. Also │ │ │ +0014cf20: 636f 6e73 7472 7563 746f 7220 696e 6974 constructor init │ │ │ +0014cf30: 6961 6c69 7a65 7273 2061 7265 206e 6f74 ializers are not │ │ │ +0014cf40: 2061 6c6c 6f77 6564 2e20 436c 6173 7320 allowed. Class │ │ │ +0014cf50: 6d65 7468 6f64 2069 6d70 6c65 6d65 6e74 method implement │ │ │ +0014cf60: 6174 696f 6e73 2073 686f 756c 6420 6265 ations should be │ │ │ +0014cf70: 2064 6566 696e 6564 2069 6e20 6120 7365 defined in a se │ │ │ +0014cf80: 7061 7261 7465 2043 2b2b 2073 6f75 7263 parate C++ sourc │ │ │ +0014cf90: 6520 6669 6c65 2e3c 2f6c 693e 0a3c 6c69 e file..
    • C++ references: │ │ │ +0014cfb0: 2074 6865 7365 2063 616e 6e6f 7420 6265 these cannot be │ │ │ +0014cfc0: 2073 6572 6961 6c69 7a65 642c 2075 7365 serialized, use │ │ │ +0014cfd0: 2070 6f69 6e74 6572 7320 696e 7374 6561 pointers instea │ │ │ +0014cfe0: 642e 3c2f 6c69 3e0a 3c2f 756c 3e0a 3c70 d.
    • .
    .

    The following C │ │ │ +0014d000: 2f43 2b2b 2064 6174 6120 7479 7065 7320 /C++ data types │ │ │ +0014d010: 7265 7175 6972 6520 736f 6d65 2061 7474 require some att │ │ │ +0014d020: 656e 7469 6f6e 2074 6f20 656e 7375 7265 ention to ensure │ │ │ +0014d030: 2074 6865 7920 6361 6e20 6265 2073 6572 they can be ser │ │ │ +0014d040: 6961 6c69 7a65 643a 3c2f 703e 0a3c 756c ialized:

    ..

    .... < │ │ │ +0014d6e0: 6120 6872 6566 3d22 2322 3e42 6163 6b20 a href="#">Back │ │ │ +0014d6f0: 746f 2074 6162 6c65 206f 6620 636f 6e74 to table of cont │ │ │ +0014d700: 656e 7473 3c2f 613e 3c2f 703e 0a3c 6831 ents

    .

    .Advanced f │ │ │ +0014d740: 6561 7475 7265 733c 2f68 313e 0a3c 703e eatures

    .

    │ │ │ +0014d750: f09f 949d 203c 6120 6872 6566 3d22 2322 .... Back to table o │ │ │ +0014d770: 6620 636f 6e74 656e 7473 3c2f 613e 3c2f f contents.

    .Internat │ │ │ +0014d7c0: 696f 6e61 6c69 7a61 7469 6f6e 3c2f 6832 ionalization

    .

    Regular 8-b │ │ │ +0014d7e0: 6974 2073 7472 696e 6773 2063 616e 6e6f it strings canno │ │ │ +0014d7f0: 7420 686f 6c64 2077 6964 6520 6368 6172 t hold wide char │ │ │ +0014d800: 6163 7465 7273 206f 7574 7369 6465 206f acters outside o │ │ │ +0014d810: 6620 7468 6520 6368 6172 6163 7465 7220 f the character │ │ │ +0014d820: 7261 6e67 6520 5b31 2c32 3535 5d2e 204f range [1,255]. O │ │ │ +0014d830: 6620 636f 7572 7365 2079 6f75 2063 616e f course you can │ │ │ +0014d840: 2075 7365 2077 6964 6520 7374 7269 6e67 use wide string │ │ │ +0014d850: 7320 696e 7374 6561 6420 6f66 2038 2d62 s instead of 8-b │ │ │ +0014d860: 6974 2073 7472 696e 6773 2069 6e20 7468 it strings in th │ │ │ +0014d870: 6520 696e 7465 7266 6163 6520 6865 6164 e interface head │ │ │ +0014d880: 6572 2066 696c 6520 666f 7220 736f 6170 er file for soap │ │ │ +0014d890: 6370 7032 2e20 416c 7465 726e 6174 6976 cpp2. Alternativ │ │ │ +0014d8a0: 656c 792c 2073 6574 2074 6865 203c 636f ely, set the #SOAP_C_UTFST │ │ │ +0014d8c0: 5249 4e47 3c2f 636f 6465 3e20 6d6f 6465 RING mode │ │ │ +0014d8d0: 2066 6c61 6720 746f 2065 6e63 6f64 6520 flag to encode │ │ │ +0014d8e0: 7769 6465 2063 6861 7261 6374 6572 7320 wide characters │ │ │ +0014d8f0: 696e 2038 2d62 6974 2073 7472 696e 6773 in 8-bit strings │ │ │ +0014d900: 2069 6e20 5554 462d 3820 666f 726d 6174 in UTF-8 format │ │ │ +0014d910: 2e3c 2f70 3e0a 3c70 3e46 6f72 2065 7861 .

    .

    For exa │ │ │ +0014d920: 6d70 6c65 2c20 7468 6520 3c65 6d3e 3c63 mple, the xsd:string strin │ │ │ +0014d950: 6720 7363 6865 6d61 2074 7970 6520 6361 g schema type ca │ │ │ +0014d960: 6e20 6265 2064 6563 6c61 7265 6420 6173 n be declared as │ │ │ +0014d970: 2061 2077 6964 652d 6368 6172 6163 7465 a wide-characte │ │ │ +0014d980: 7220 7374 7269 6e67 2061 6e64 2075 7365 r string and use │ │ │ +0014d990: 6420 7375 6273 6571 7565 6e74 6c79 3a3c d subsequently:< │ │ │ +0014d9a0: 2f70 3e0a 3c64 6976 2063 6c61 7373 3d22 /p>.

    typedef │ │ │ +0014d9f0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 wchar │ │ │ +0014da10: 5f74 3c2f 7370 616e 3e20 2a78 7364 5f5f _t *xsd__ │ │ │ +0014da20: 7374 7269 6e67 3b20 3c2f 6469 763e 0a3c string;
    .< │ │ │ +0014da30: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +0014da40: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >int ns__myMeth │ │ │ +0014da70: 6f64 2878 7364 5f5f 7374 7269 6e67 2069 od(xsd__string i │ │ │ +0014da80: 6e70 7574 2c20 7873 645f 5f73 7472 696e nput, xsd__strin │ │ │ +0014da90: 6720 2a6f 7574 7075 7429 3b3c 2f64 6976 g *output);
    .

    To d │ │ │ +0014dac0: 6f20 736f 2061 7574 6f6d 6174 6963 616c o so automatical │ │ │ +0014dad0: 6c79 2077 6974 6820 7773 646c 3268 2c20 ly with wsdl2h, │ │ │ +0014dae0: 6564 6974 203c 656d 3e3c 636f 6465 3e74 edit t │ │ │ +0014daf0: 7970 656d 6170 2e64 6174 3c2f 636f 6465 ypemap.dat and add t │ │ │ +0014db10: 6865 206c 696e 653a 203c 2f70 3e3c 7072 he line:

    xsd__string = │ │ │ +0014db40: 207c 2077 6368 6172 5f74 2a20 7c20 7763 | wchar_t* | wc │ │ │ +0014db50: 6861 725f 742a 0a3c 2f70 7265 3e3c 703e har_t*.

    │ │ │ +0014db60: 206f 7220 666f 7220 432b 2b3a 203c 2f70 or for C++:

    xsd__stri
    │ │ │ +0014db90: 6e67 203d 207c 2073 7464 3a3a 7773 7472  ng = | std::wstr
    │ │ │ +0014dba0: 696e 6720 7c20 7374 643a 3a77 7374 7269  ing | std::wstri
    │ │ │ +0014dbb0: 6e67 2a0a 3c2f 7072 653e 3c70 3e20 416c  ng*.

    Al │ │ │ +0014dbc0: 7465 726e 6174 6976 656c 792c 2038 2d62 ternatively, 8-b │ │ │ +0014dbd0: 6974 2073 7472 696e 6773 2063 616e 2068 it strings can h │ │ │ +0014dbe0: 6f6c 6420 5554 462d 3820 666f 726d 6174 old UTF-8 format │ │ │ +0014dbf0: 7465 6420 7769 6465 2063 6861 7261 6374 ted wide charact │ │ │ +0014dc00: 6572 7320 7768 656e 2074 6865 203c 636f ers when the #SOAP_C_UTFST │ │ │ +0014dc20: 5249 4e47 3c2f 636f 6465 3e20 666c 6167 RING flag │ │ │ +0014dc30: 2069 7320 656e 6162 6c65 642c 2073 6565 is enabled, see │ │ │ +0014dc40: 2053 6563 7469 6f6e 203c 6120 636c 6173 Section R │ │ │ +0014dc70: 756e 2d74 696d 6520 666c 6167 733c 2f61 un-time flags . The applicat │ │ │ +0014dc90: 696f 6e20 6973 2072 6573 706f 6e73 6962 ion is responsib │ │ │ +0014dca0: 6c65 2066 6f72 2066 696c 6c69 6e67 2072 le for filling r │ │ │ +0014dcb0: 6567 756c 6172 2073 7472 696e 6773 2077 egular strings w │ │ │ +0014dcc0: 6974 6820 5554 462d 3820 636f 6e74 656e ith UTF-8 conten │ │ │ +0014dcd0: 742e 3c2f 703e 0a3c 703e 416c 736f 2074 t.

    .

    Also t │ │ │ +0014dce0: 6865 203c 636f 6465 3e23 534f 4150 5f43 he #SOAP_C │ │ │ +0014dcf0: 5f4d 4253 5452 494e 473c 2f63 6f64 653e _MBSTRING │ │ │ +0014dd00: 2066 6c61 6720 6361 6e20 6265 2075 7365 flag can be use │ │ │ +0014dd10: 6420 746f 2061 6374 6976 6174 6520 6d75 d to activate mu │ │ │ +0014dd20: 6c74 6962 7974 6520 6368 6172 6163 7465 ltibyte characte │ │ │ +0014dd30: 7220 7375 7070 6f72 7420 7573 696e 6720 r support using │ │ │ +0014dd40: 7468 6520 6375 7272 656e 7420 6c6f 6361 the current loca │ │ │ +0014dd50: 6c65 2e20 4d75 6c74 6962 7974 6520 7375 le. Multibyte su │ │ │ +0014dd60: 7070 6f72 7420 6465 7065 6e64 7320 6f6e pport depends on │ │ │ +0014dd70: 2074 6865 206c 6f63 616c 6520 7365 7474 the locale sett │ │ │ +0014dd80: 696e 6773 2066 6f72 2064 6561 6c69 6e67 ings for dealing │ │ │ +0014dd90: 2077 6974 6820 6578 7465 6e64 6564 206e with extended n │ │ │ +0014dda0: 6174 7572 616c 206c 616e 6775 6167 6520 atural language │ │ │ +0014ddb0: 656e 636f 6469 6e67 732e 3c2f 703e 0a3c encodings.

    .< │ │ │ +0014ddc0: 703e 426f 7468 2038 2d62 6974 2073 7472 p>Both 8-bit str │ │ │ +0014ddd0: 696e 6773 2061 6e64 2077 6964 652d 6368 ings and wide-ch │ │ │ +0014dde0: 6172 6163 7465 7220 7374 7269 6e67 7320 aracter strings │ │ │ +0014ddf0: 6361 6e20 6265 2075 7365 6420 746f 6765 can be used toge │ │ │ +0014de00: 7468 6572 2077 6974 6869 6e20 616e 2061 ther within an a │ │ │ +0014de10: 7070 6c69 6361 7469 6f6e 2e20 466f 7220 pplication. For │ │ │ +0014de20: 6578 616d 706c 652c 2074 6865 2066 6f6c example, the fol │ │ │ +0014de30: 6c6f 7769 6e67 2068 6561 6465 7220 6669 lowing header fi │ │ │ +0014de40: 6c65 2064 6563 6c61 7261 7469 6f6e 2069 le declaration i │ │ │ +0014de50: 6e74 726f 6475 6365 7320 7477 6f20 7374 ntroduces two st │ │ │ +0014de60: 7269 6e67 2073 6368 656d 6120 7479 7065 ring schema type │ │ │ +0014de70: 733a 3c2f 703e 0a3c 6469 7620 636c 6173 s:

    .
    < │ │ │ +0014dea0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +0014deb0: 6f72 6422 3e74 7970 6564 6566 3c2f 7370 ord">typedef wc │ │ │ +0014dee0: 6861 725f 743c 2f73 7061 6e3e 202a 7873 har_t *xs │ │ │ +0014def0: 645f 5f73 7472 696e 673b 203c 2f64 6976 d__string;
    .
    typede │ │ │ +0014df30: 663c 2f73 7061 6e3e 203c 7370 616e 2063 f char * │ │ │ +0014df60: 7873 645f 5f73 7472 696e 675f 3b20 3c73 xsd__string_; // trailing │ │ │ +0014df90: 2623 3339 3b5f 2623 3339 3b20 6176 6f69 '_' avoi │ │ │ +0014dfa0: 6473 206e 616d 6520 636c 6173 6820 3c2f ds name clash
    .
    int ns__myMethod( │ │ │ +0014e000: 7873 645f 5f73 7472 696e 6720 696e 7075 xsd__string inpu │ │ │ +0014e010: 742c 2078 7364 5f5f 7374 7269 6e67 5f20 t, xsd__string_ │ │ │ +0014e020: 2a6f 7574 7075 7429 3b3c 2f64 6976 3e0a *output);
    . │ │ │ +0014e030: 3c2f 6469 763e 3c21 2d2d 2066 7261 676d

    Please │ │ │ +0014e050: 2063 6f6e 7375 6c74 2074 6865 2055 5446 consult the UTF │ │ │ +0014e060: 2d38 2073 7065 6369 6669 6361 7469 6f6e -8 specification │ │ │ +0014e070: 2066 6f72 2064 6574 6169 6c73 206f 6e20 for details on │ │ │ +0014e080: 7468 6520 5554 462d 3820 666f 726d 6174 the UTF-8 format │ │ │ +0014e090: 2077 6865 6e20 7072 6f63 6573 7369 6e67 when processing │ │ │ +0014e0a0: 2038 2d62 6974 2073 7472 696e 6773 2077 8-bit strings w │ │ │ +0014e0b0: 6974 6820 5554 462d 3820 636f 6e74 656e ith UTF-8 conten │ │ │ +0014e0c0: 742e 204e 6f74 6520 7468 6174 2074 6865 t. Note that the │ │ │ +0014e0d0: 2041 5343 4949 2063 6861 7261 6374 6572 ASCII character │ │ │ +0014e0e0: 2073 6574 205b 312d 3132 375d 2069 7320 set [1-127] is │ │ │ +0014e0f0: 6120 7375 6273 6574 206f 6620 5554 462d a subset of UTF- │ │ │ +0014e100: 382e 2054 6865 7265 666f 7265 2c20 7769 8. Therefore, wi │ │ │ +0014e110: 7468 2074 6865 203c 636f 6465 3e23 534f th the #SO │ │ │ +0014e120: 4150 5f43 5f55 5446 5354 5249 4e47 3c2f AP_C_UTFSTRING flag set, │ │ │ +0014e140: 7374 7269 6e67 7320 6d61 7920 686f 6c64 strings may hold │ │ │ +0014e150: 2041 5343 4949 2063 6861 7261 6374 6572 ASCII character │ │ │ +0014e160: 2064 6174 6120 616e 6420 5554 462d 3820 data and UTF-8 │ │ │ +0014e170: 6578 7465 6e73 696f 6e73 2e3c 2f70 3e0a extensions.

    . │ │ │ +0014e180: 3c70 3e53 6565 2061 6c73 6f20 3c61 2068

    See also C and C+ │ │ │ +0014e1c0: 2b20 584d 4c20 6461 7461 2062 696e 6469 + XML data bindi │ │ │ +0014e1d0: 6e67 733c 2f61 3e20 646f 6375 6d65 6e74 ngs document │ │ │ +0014e1e0: 6174 696f 6e20 666f 7220 6d6f 7265 2064 ation for more d │ │ │ +0014e1f0: 6574 6169 6c73 206f 6e20 7573 696e 6720 etails on using │ │ │ +0014e200: 3c65 6d3e 3c63 6f64 653e 7479 7065 6d61 typema │ │ │ +0014e210: 702e 6461 743c 2f63 6f64 653e 3c2f 656d p.dat for wsdl2h.

    .

    .... Back to ta │ │ │ +0014e250: 626c 6520 6f66 2063 6f6e 7465 6e74 733c ble of contents< │ │ │ +0014e260: 2f61 3e3c 2f70 3e0a 3c68 323e 3c61 2063 /a>

    .

    .Directives.

    An interfa │ │ │ +0014e2b0: 6365 2068 6561 6465 7220 6669 6c65 2066 ce header file f │ │ │ +0014e2c0: 6f72 2073 6f61 7063 7070 3220 6d61 7920 or soapcpp2 may │ │ │ +0014e2d0: 696e 636c 7564 6520 3c63 6f64 653e 2f2f include // │ │ │ +0014e2e0: 6773 6f61 703c 2f63 6f64 653e 2064 6972 gsoap dir │ │ │ +0014e2f0: 6563 7469 7665 7320 746f 2063 6f6e 6669 ectives to confi │ │ │ +0014e300: 6775 7265 206d 6573 7361 6769 6e67 2070 gure messaging p │ │ │ +0014e310: 726f 746f 636f 6c73 2073 7563 6820 6173 rotocols such as │ │ │ +0014e320: 2053 4f41 5020 6f72 2052 4553 542c 2074 SOAP or REST, t │ │ │ +0014e330: 6f20 6173 736f 6369 6174 6520 534f 4150 o associate SOAP │ │ │ +0014e340: 2048 6561 6465 7273 2061 6e64 2046 6175 Headers and Fau │ │ │ +0014e350: 6c74 7320 7769 7468 206d 6573 7361 6765 lts with message │ │ │ +0014e360: 732c 2061 6e64 2074 6f20 7365 7420 7072 s, and to set pr │ │ │ +0014e370: 6f70 6572 7469 6573 206f 6620 7468 6520 operties of the │ │ │ +0014e380: 5765 6220 7365 7276 6963 6520 6465 6669 Web service defi │ │ │ +0014e390: 6e65 6420 696e 2074 6865 2073 6f61 7063 ned in the soapc │ │ │ +0014e3a0: 7070 322d 6765 6e65 7261 7465 6420 5753 pp2-generated WS │ │ │ +0014e3b0: 444c 2061 6e64 2058 5344 2066 696c 6573 DL and XSD files │ │ │ +0014e3c0: 2e20 4469 7265 6374 6976 6573 2066 6f72 . Directives for │ │ │ +0014e3d0: 2073 6f61 7063 7070 3220 6172 6520 7370 soapcpp2 are sp │ │ │ +0014e3e0: 6563 6966 6965 6420 6173 203c 636f 6465 ecified as //gsoap- │ │ │ +0014e400: 636f 6d6d 656e 7473 2074 6861 7420 6172 comments that ar │ │ │ +0014e410: 6520 7072 6f63 6573 7365 6420 6279 2073 e processed by s │ │ │ +0014e420: 6f61 7063 7070 322e 3c2f 703e 0a3c 6833 oapcpp2.

    .

    .Servic │ │ │ +0014e460: 6520 6469 7265 6374 6976 6573 3c2f 6833 e directives

    .

    A service d │ │ │ +0014e480: 6972 6563 7469 7665 206d 7573 7420 7374 irective must st │ │ │ +0014e490: 6172 7420 6174 2061 206e 6577 206c 696e art at a new lin │ │ │ +0014e4a0: 6520 616e 6420 6973 206f 6620 7468 6520 e and is of the │ │ │ +0014e4b0: 666f 726d 3a3c 2f70 3e0a 3c64 6976 2063 form:

    .
    │ │ │ +0014e4d0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    //gsoap │ │ │ +0014e500: 266c 743b 7072 6566 6978 2667 743b 2073 <prefix> s │ │ │ +0014e510: 6572 7669 6365 2026 6c74 3b70 726f 7065 ervice <prope │ │ │ +0014e520: 7274 7926 6774 3b3a 2026 6c74 3b76 616c rty>: <val │ │ │ +0014e530: 7565 2667 743b 3c2f 7370 616e 3e3c 2f64 ue>.

    wh │ │ │ +0014e560: 6572 6520 3c63 6f64 653e 266c 743b 7072 ere <pr │ │ │ +0014e570: 6566 6978 2667 743b 3c2f 636f 6465 3e20 efix> │ │ │ +0014e580: 6973 2074 6865 2058 4d4c 206e 616d 6573 is the XML names │ │ │ +0014e590: 7061 6365 2070 7265 6669 7820 6f66 2061 pace prefix of a │ │ │ +0014e5a0: 2073 6572 7669 6365 2062 696e 6469 6e67 service binding │ │ │ +0014e5b0: 2e20 5468 6520 3c63 6f64 653e 266c 743b . The < │ │ │ +0014e5c0: 7072 6f70 6572 7479 2667 743b 3c2f 636f property> and &l │ │ │ +0014e5e0: 743b 7661 6c75 6526 6774 3b3c 2f63 6f64 t;value> fields are on │ │ │ +0014e600: 6520 6f66 2074 6865 2066 6f6c 6c6f 7769 e of the followi │ │ │ +0014e610: 6e67 3a3c 2f70 3e0a 3c74 6162 6c65 2063 ng:

    ..... │ │ │ +0014e700: 3c63 6f64 653e 6e61 6d65 3c2f 636f 6465 name │ │ │ +0014e790: 0a3c 7472 2063 6c61 7373 3d22 6d61 726b ...... │ │ │ +0014e9b0: 616e 2061 6c69 6173 2066 6f72 2074 6865 an alias for the │ │ │ +0014e9c0: 203c 636f 6465 3e64 6f63 756d 656e 7461 documenta │ │ │ +0014e9d0: 7469 6f6e 3c2f 636f 6465 3e20 7072 6f70 tion prop │ │ │ +0014e9e0: 6572 7479 2020 2020 3c2f 7464 3e3c 2f74 erty .. │ │ │ +0014ea50: 3c74 6420 636c 6173 733d 226d 6172 6b64 │ │ │ +0014ead0: 3c2f 7472 3e0a 3c74 7220 636c 6173 733d ...< │ │ │ +0014ebc0: 7472 2063 6c61 7373 3d22 6d61 726b 646f tr class="markdo │ │ │ +0014ebd0: 776e 5461 626c 6552 6f77 4f64 6422 3e0a wnTableRowOdd">. │ │ │ +0014ebe0: 3c74 6420 636c 6173 733d 226d 6172 6b64 < │ │ │ +0014ec20: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ +0014ec30: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ +0014ec40: 3e73 7065 6369 6669 6573 2053 4f41 5020 >specifies SOAP │ │ │ +0014ec50: 6f72 2052 4553 542c 2073 6565 2062 656c or REST, see bel │ │ │ +0014ec60: 6f77 2020 2020 3c2f 7464 3e3c 2f74 723e ow │ │ │ +0014ec70: 0a3c 7472 2063 6c61 7373 3d22 6d61 726b .. │ │ │ +0014ecf0: 5552 4c20 6f66 2074 6865 2073 6572 7669 URL of the servi │ │ │ +0014ed00: 6365 2065 6e64 706f 696e 742c 2075 7375 ce endpoint, usu │ │ │ +0014ed10: 616c 6c79 2061 6e20 6874 7470 206f 7220 ally an http or │ │ │ +0014ed20: 6874 7470 7320 6164 6472 6573 732c 2074 https address, t │ │ │ +0014ed30: 6f20 7573 6520 696e 2074 6865 2057 5344 o use in the WSD │ │ │ +0014ed40: 4c20 6465 6669 6e69 7469 6f6e 732f 7365 L definitions/se │ │ │ +0014ed50: 7276 6963 652f 706f 7274 2f61 6464 7265 rvice/port/addre │ │ │ +0014ed60: 7373 2f40 6c6f 6361 7469 6f6e 2020 2020 ss/@location │ │ │ +0014ed70: 3c2f 7464 3e3c 2f74 723e 0a3c 7472 2063 ............< │ │ │ +0014f1c0: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ +0014f1d0: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ +0014f1e0: 3e3c 636f 6465 3e70 6f72 7454 7970 653c >portType< │ │ │ +0014f1f0: 2f63 6f64 653e 2020 203c 2f74 643e 3c74 /code> │ │ │ +0014f220: 616e 2061 6c69 6173 2066 6f72 2074 6865 an alias for the │ │ │ +0014f230: 203c 636f 6465 3e74 7970 653c 2f63 6f64 type property (portType follows SOAP │ │ │ +0014f270: 312e 3120 6e61 6d69 6e67 2063 6f6e 7665 1.1 naming conve │ │ │ +0014f280: 6e74 696f 6e73 2920 2020 203c 2f74 643e ntions) │ │ │ +0014f290: 3c2f 7472 3e0a 3c74 7220 636c 6173 733d ... │ │ │ +0014f390: 3c74 7220 636c 6173 733d 226d 6172 6b64 . │ │ │ +0014f3f0: 3c74 6420 636c 6173 733d 226d 6172 6b64 .... │ │ │ +0014f590: 6e61 6d65 206f 6620 7468 6520 2265 7865 name of the "exe │ │ │ +0014f5a0: 6375 7461 626c 6522 2074 6f20 7573 6520 cutable" to use │ │ │ +0014f5b0: 696e 2074 6865 2057 5344 4c20 6465 6669 in the WSDL defi │ │ │ +0014f5c0: 6e69 7469 6f6e 732f 7365 7276 6963 652f nitions/service/ │ │ │ +0014f5d0: 706f 7274 2f61 6464 7265 7373 2f40 6c6f port/address/@lo │ │ │ +0014f5e0: 6361 7469 6f6e 2020 203c 2f74 643e 3c2f cation .
    property │ │ │ +0014e680: 2020 3c2f 7468 3e3c 7468 2063 6c61 7373 value │ │ │ +0014e6b0: 2020 3c2f 7468 3e3c 2f74 723e 0a3c 7472
    name │ │ │ +0014e740: 6f66 2074 6865 2073 6572 7669 6365 2c20 of the service, │ │ │ +0014e750: 6f70 7469 6f6e 616c 6c79 2066 6f6c 6c6f optionally follo │ │ │ +0014e760: 7765 6420 6279 2074 6578 7420 6465 7363 wed by text desc │ │ │ +0014e770: 7269 6269 6e67 2074 6865 2073 6572 7669 ribing the servi │ │ │ +0014e780: 6365 2020 2020 3c2f 7464 3e3c 2f74 723e ce
    names │ │ │ +0014e7e0: 7061 6365 3c2f 636f 6465 3e20 2020 3c2f pace URI of the │ │ │ +0014e820: 5753 444c 2074 6172 6765 744e 616d 6573 WSDL targetNames │ │ │ +0014e830: 7061 6365 2020 2020 3c2f 7464 3e3c 2f74 pace
    docu │ │ │ +0014e890: 6d65 6e74 6174 696f 6e3c 2f63 6f64 653e mentation │ │ │ +0014e8a0: 2020 203c 2f74 643e 3c74 6420 636c 6173 text d │ │ │ +0014e8d0: 6573 6372 6962 696e 6720 7468 6520 7365 escribing the se │ │ │ +0014e8e0: 7276 6963 6520 2873 6565 2061 6c73 6f20 rvice (see also │ │ │ +0014e8f0: 7468 6520 3c63 6f64 653e 6e61 6d65 3c2f the name property), │ │ │ +0014e910: 206d 756c 7469 706c 6520 7065 726d 6974 multiple permit │ │ │ +0014e920: 7465 6420 2020 203c 2f74 643e 3c2f 7472 ted
    doc< │ │ │ +0014e980: 2f63 6f64 653e 2020 203c 2f74 643e 3c74 /code>
    styl │ │ │ +0014ea40: 653c 2f63 6f64 653e 2020 203c 2f74 643e e document │ │ │ +0014ea80: 3c2f 636f 6465 3e20 2864 6566 6175 6c74 (default │ │ │ +0014ea90: 2920 534f 4150 206d 6573 7361 6769 6e67 ) SOAP messaging │ │ │ +0014eaa0: 2073 7479 6c65 206f 7220 3c63 6f64 653e style or │ │ │ +0014eab0: 7270 633c 2f63 6f64 653e 2066 6f72 2053 rpc for S │ │ │ +0014eac0: 4f41 5020 5250 4320 2020 203c 2f74 643e OAP RPC
    │ │ │ +0014eb20: 656e 636f 6469 6e67 3c2f 636f 6465 3e20 encoding │ │ │ +0014eb30: 2020 3c2f 7464 3e3c 7464 2063 6c61 7373 l │ │ │ +0014eb60: 6974 6572 616c 3c2f 636f 6465 3e20 2864 iteral (d │ │ │ +0014eb70: 6566 6175 6c74 292c 203c 636f 6465 3e65 efault), e │ │ │ +0014eb80: 6e63 6f64 6564 3c2f 636f 6465 3e20 666f ncoded fo │ │ │ +0014eb90: 7220 534f 4150 2065 6e63 6f64 696e 672c r SOAP encoding, │ │ │ +0014eba0: 206f 7220 6120 6375 7374 6f6d 2055 5249 or a custom URI │ │ │ +0014ebb0: 2020 2020 3c2f 7464 3e3c 2f74 723e 0a3c
    protocol │ │ │ +0014ec10: 3c2f 636f 6465 3e20 2020 3c2f 7464 3e3c
    port< │ │ │ +0014ecc0: 2f63 6f64 653e 2020 203c 2f74 643e 3c74 /code>
    location an │ │ │ +0014ee00: 616c 6961 7320 666f 7220 7468 6520 3c63 alias for the port │ │ │ +0014ee20: 7072 6f70 6572 7479 2020 2020 3c2f 7464 property
    endpoint │ │ │ +0014ee90: 2020 203c 2f74 643e 3c74 6420 636c 6173 an ali │ │ │ +0014eec0: 6173 2066 6f72 2074 6865 203c 636f 6465 as for the port pro │ │ │ +0014eee0: 7065 7274 7920 2020 203c 2f74 643e 3c2f perty
    tra │ │ │ +0014ef40: 6e73 706f 7274 3c2f 636f 6465 3e20 2020 nsport │ │ │ +0014ef50: 3c2f 7464 3e3c 7464 2063 6c61 7373 3d22 URI decla │ │ │ +0014ef80: 7261 7469 6f6e 206f 6620 7468 6520 7472 ration of the tr │ │ │ +0014ef90: 616e 7370 6f72 742c 2075 7375 616c 6c79 ansport, usually │ │ │ +0014efa0: 203c 636f 6465 3e3c 6120 6872 6566 3d22 http://sch │ │ │ +0014efe0: 656d 6173 2e78 6d6c 736f 6170 2e6f 7267 emas.xmlsoap.org │ │ │ +0014eff0: 2f73 6f61 702f 6874 7470 3c2f 613e 3c2f /soap/http
    de │ │ │ +0014f060: 6669 6e69 7469 6f6e 733c 2f63 6f64 653e finitions │ │ │ +0014f070: 2020 203c 2f74 643e 3c74 6420 636c 6173 name o │ │ │ +0014f0a0: 6620 7468 6520 5753 444c 2064 6566 696e f the WSDL defin │ │ │ +0014f0b0: 6974 696f 6e73 2f40 6e61 6d65 2020 2020 itions/@name │ │ │ +0014f0c0: 3c2f 7464 3e3c 2f74 723e 0a3c 7472 2063
    type │ │ │ +0014f120: 2020 3c2f 7464 3e3c 7464 2063 6c61 7373 name of │ │ │ +0014f150: 2074 6865 2057 5344 4c20 6465 6669 6e69 the WSDL defini │ │ │ +0014f160: 7469 6f6e 732f 706f 7274 5479 7065 2f40 tions/portType/@ │ │ │ +0014f170: 6e61 6d65 2028 5753 444c 322e 3020 696e name (WSDL2.0 in │ │ │ +0014f180: 7465 7266 6163 652f 406e 616d 6529 2020 terface/@name) │ │ │ +0014f190: 2020 3c2f 7464 3e3c 2f74 723e 0a3c 7472
    i │ │ │ +0014f2e0: 6e74 6572 6661 6365 3c2f 636f 6465 3e20 nterface │ │ │ +0014f2f0: 2020 3c2f 7464 3e3c 7464 2063 6c61 7373 an alia │ │ │ +0014f320: 7320 666f 7220 7468 6520 3c63 6f64 653e s for the │ │ │ +0014f330: 7479 7065 3c2f 636f 6465 3e20 7072 6f70 type prop │ │ │ +0014f340: 6572 7479 2028 3c63 6f64 653e 696e 7465 erty (inte │ │ │ +0014f350: 7266 6163 653c 2f63 6f64 653e 2066 6f6c rface fol │ │ │ +0014f360: 6c6f 7773 2053 4f41 5020 312e 3220 6e61 lows SOAP 1.2 na │ │ │ +0014f370: 6d69 6e67 2063 6f6e 7665 6e74 696f 6e73 ming conventions │ │ │ +0014f380: 2920 2020 203c 2f74 643e 3c2f 7472 3e0a )
    bindin │ │ │ +0014f3e0: 673c 2f63 6f64 653e 2020 203c 2f74 643e g name of the WS │ │ │ +0014f420: 444c 2064 6566 696e 6974 696f 6e73 2f62 DL definitions/b │ │ │ +0014f430: 696e 6469 6e67 2f40 6e61 6d65 2020 2020 inding/@name │ │ │ +0014f440: 3c2f 7464 3e3c 2f74 723e 0a3c 7472 2063
    portName nam │ │ │ +0014f4d0: 6520 6f66 2074 6865 2057 5344 4c20 6465 e of the WSDL de │ │ │ +0014f4e0: 6669 6e69 7469 6f6e 732f 7365 7276 6963 finitions/servic │ │ │ +0014f4f0: 652f 706f 7274 2f40 6e61 6d65 2020 2020 e/port/@name │ │ │ +0014f500: 3c2f 7464 3e3c 2f74 723e 0a3c 7472 2063
    < │ │ │ +0014f550: 636f 6465 3e65 7865 6375 7461 626c 653c code>executable< │ │ │ +0014f560: 2f63 6f64 653e 2020 203c 2f74 643e 3c74 /code>
    .

    │ │ │ +0014f600: 5468 6520 7365 7276 6963 6520 3c63 6f64 The service name an │ │ │ +0014f620: 6420 3c63 6f64 653e 6e61 6d65 7370 6163 d namespac │ │ │ +0014f630: 653c 2f63 6f64 653e 2070 726f 7065 7274 e propert │ │ │ +0014f640: 6965 7320 6172 6520 7265 7175 6972 6564 ies are required │ │ │ +0014f650: 2069 6e20 6f72 6465 7220 746f 2067 656e in order to gen │ │ │ +0014f660: 6572 6174 6520 6120 7661 6c69 6420 5753 erate a valid WS │ │ │ +0014f670: 444c 2077 6974 6820 736f 6170 6370 7032 DL with soapcpp2 │ │ │ +0014f680: 2e20 5468 6520 6f74 6865 7220 7072 6f70 . The other prop │ │ │ +0014f690: 6572 7469 6573 2061 7265 206f 7074 696f erties are optio │ │ │ +0014f6a0: 6e61 6c2e 3c2f 703e 0a3c 703e 5468 6520 nal.

    .

    The │ │ │ +0014f6b0: 3c63 6f64 653e 7374 796c 653c 2f63 6f64 style and enc │ │ │ +0014f6d0: 6f64 696e 673c 2f63 6f64 653e 2070 726f oding pro │ │ │ +0014f6e0: 7065 7274 7920 6465 6661 756c 7473 2061 perty defaults a │ │ │ +0014f6f0: 7265 2063 6861 6e67 6564 2077 6974 6820 re changed with │ │ │ +0014f700: 3c62 3e3c 636f 6465 3e73 6f61 7063 7070 soapcpp │ │ │ +0014f710: 3220 2d65 3c2f 636f 6465 3e3c 2f62 3e20 2 -e │ │ │ +0014f720: 6f70 7469 6f6e 203c 623e 3c63 6f64 653e option │ │ │ +0014f730: 2d65 3c2f 636f 6465 3e3c 2f62 3e20 746f -e to │ │ │ +0014f740: 203c 636f 6465 3e72 7063 3c2f 636f 6465 rpc and enco │ │ │ +0014f760: 6465 643c 2f63 6f64 653e 2e3c 2f70 3e0a ded.

    . │ │ │ +0014f770: 3c70 3e59 6f75 2063 616e 206f 7665 7272

    You can overr │ │ │ +0014f780: 6964 6520 7468 6520 3c63 6f64 653e 706f ide the po │ │ │ +0014f790: 7274 3c2f 636f 6465 3e20 656e 6470 6f69 rt endpoi │ │ │ +0014f7a0: 6e74 2055 524c 2061 7420 7275 6e74 696d nt URL at runtim │ │ │ +0014f7b0: 6520 696e 2074 6865 2061 7574 6f2d 6765 e in the auto-ge │ │ │ +0014f7c0: 6e65 7261 7465 6420 3c63 6f64 653e 736f nerated so │ │ │ +0014f7d0: 6170 5f63 616c 6c5f 7072 6566 6978 5f5f ap_call_prefix__ │ │ │ +0014f7e0: 6675 6e63 3c2f 636f 6465 3e20 7365 7276 func serv │ │ │ +0014f7f0: 6963 6520 6361 6c6c 2028 432f 432b 2b20 ice call (C/C++ │ │ │ +0014f800: 636c 6965 6e74 2073 6964 6529 2061 6e64 client side) and │ │ │ +0014f810: 2069 6e20 7468 6520 432b 2b20 7072 6f78 in the C++ prox │ │ │ +0014f820: 7920 636c 6173 7320 7365 7276 6963 6520 y class service │ │ │ +0014f830: 6361 6c6c 2e3c 2f70 3e0a 3c70 3e50 726f call.

    .

    Pro │ │ │ +0014f840: 746f 636f 6c20 7072 6f70 6572 7479 2076 tocol property v │ │ │ +0014f850: 616c 7565 7320 6172 653a 3c2f 703e 0a3c alues are:

    .< │ │ │ +0014f860: 7461 626c 6520 636c 6173 733d 226d 6172 table class="mar │ │ │ +0014f870: 6b64 6f77 6e54 6162 6c65 223e 0a3c 7472 kdownTable">..pr │ │ │ +0014f8c0: 6f74 6f63 6f6c 2076 616c 7565 2020 203c otocol value < │ │ │ +0014f8d0: 2f74 683e 3c74 6820 636c 6173 733d 226d /th>descriptio │ │ │ +0014f900: 6e20 2020 203c 2f74 683e 3c2f 7472 3e0a n . │ │ │ +0014f910: 3c74 7220 636c 6173 733d 226d 6172 6b64 │ │ │ +0014f930: 0a3c 7464 2063 6c61 7373 3d22 6d61 726b .SOAP SO │ │ │ +0014f990: 4150 2074 7261 6e73 706f 7274 2c20 7375 AP transport, su │ │ │ +0014f9a0: 7070 6f72 7469 6e67 2062 6f74 6820 534f pporting both SO │ │ │ +0014f9b0: 4150 2031 2e31 2061 6e64 2031 2e32 2020 AP 1.1 and 1.2 │ │ │ +0014f9c0: 2020 3c2f 7464 3e3c 2f74 723e 0a3c 7472 ..< │ │ │ +0014f9f0: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ +0014fa00: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ +0014fa10: 3e3c 636f 6465 3e53 4f41 5031 2e31 3c2f >SOAP1.1 S │ │ │ +0014fa50: 4f41 5020 312e 3120 7472 616e 7370 6f72 OAP 1.1 transpor │ │ │ +0014fa60: 7420 2873 616d 6520 6173 203c 636f 6465 t (same as soapcpp2 -1) ..SOAP │ │ │ +0014fae0: 312e 323c 2f63 6f64 653e 2020 203c 2f74 1.2 SOAP 1.2 tra │ │ │ +0014fb20: 6e73 706f 7274 2028 7361 6d65 2061 7320 nsport (same as │ │ │ +0014fb30: 3c63 6f64 653e 736f 6170 6370 7032 202d soapcpp2 - │ │ │ +0014fb40: 323c 2f63 6f64 653e 2920 2020 203c 2f74 2) ..SOAP-GET one-w │ │ │ +0014fbe0: 6179 2053 4f41 5020 312e 3120 6f72 2031 ay SOAP 1.1 or 1 │ │ │ +0014fbf0: 2e32 2077 6974 6820 4854 5450 2047 4554 .2 with HTTP GET │ │ │ +0014fc00: 2020 2020 3c2f 7464 3e3c 2f74 723e 0a3c .< │ │ │ +0014fc10: 7472 2063 6c61 7373 3d22 6d61 726b 646f tr class="markdo │ │ │ +0014fc20: 776e 5461 626c 6552 6f77 4f64 6422 3e0a wnTableRowOdd">. │ │ │ +0014fc30: 3c74 6420 636c 6173 733d 226d 6172 6b64 SOAP1.1- │ │ │ +0014fc60: 4745 543c 2f63 6f64 653e 2020 203c 2f74 GET one-way SOAP │ │ │ +0014fca0: 2031 2e31 2077 6974 6820 4854 5450 2047 1.1 with HTTP G │ │ │ +0014fcb0: 4554 2020 2020 3c2f 7464 3e3c 2f74 723e ET │ │ │ +0014fcc0: 0a3c 7472 2063 6c61 7373 3d22 6d61 726b ..SOAP1 │ │ │ +0014fd10: 2e32 2d47 4554 3c2f 636f 6465 3e20 2020 .2-GET │ │ │ +0014fd20: 3c2f 7464 3e3c 7464 2063 6c61 7373 3d22 one-way S │ │ │ +0014fd50: 4f41 5020 312e 3220 7769 7468 2048 5454 OAP 1.2 with HTT │ │ │ +0014fd60: 5020 4745 5420 2020 203c 2f74 643e 3c2f P GET ..HTT │ │ │ +0014fdc0: 503c 2f63 6f64 653e 2020 203c 2f74 643e P │ │ │ +0014fdd0: 3c74 6420 636c 6173 733d 226d 6172 6b64 an alias for < │ │ │ +0014fe00: 636f 6465 3e50 4f53 543c 2f63 6f64 653e code>POST │ │ │ +0014fe10: 2028 7361 6d65 2061 7320 3c63 6f64 653e (same as │ │ │ +0014fe20: 736f 6170 6370 7032 202d 303c 2f63 6f64 soapcpp2 -0) ..POST │ │ │ +0014fe90: 3c2f 636f 6465 3e20 2020 3c2f 7464 3e3c < │ │ │ +0014fea0: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ +0014feb0: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ +0014fec0: 3e6e 6f6e 2d53 4f41 5020 5245 5354 2070 >non-SOAP REST p │ │ │ +0014fed0: 726f 746f 636f 6c20 7769 7468 2048 5454 rotocol with HTT │ │ │ +0014fee0: 5020 504f 5354 2020 2020 3c2f 7464 3e3c P POST < │ │ │ +0014fef0: 2f74 723e 0a3c 7472 2063 6c61 7373 3d22 /tr>..GE │ │ │ +0014ff40: 543c 2f63 6f64 653e 2020 203c 2f74 643e T │ │ │ +0014ff50: 3c74 6420 636c 6173 733d 226d 6172 6b64 non-SOAP REST │ │ │ +0014ff80: 7072 6f74 6f63 6f6c 2077 6974 6820 4854 protocol with HT │ │ │ +0014ff90: 5450 2047 4554 2020 2020 3c2f 7464 3e3c TP GET < │ │ │ +0014ffa0: 2f74 723e 0a3c 7472 2063 6c61 7373 3d22 /tr>..P │ │ │ +0014fff0: 5554 3c2f 636f 6465 3e20 2020 3c2f 7464 UT non-SOAP REST │ │ │ +00150030: 2070 726f 746f 636f 6c20 7769 7468 2048 protocol with H │ │ │ +00150040: 5454 5020 5055 5420 2020 203c 2f74 643e TTP PUT │ │ │ +00150050: 3c2f 7472 3e0a 3c74 7220 636c 6173 733d ..D │ │ │ +001500a0: 454c 4554 453c 2f63 6f64 653e 2020 203c ELETE < │ │ │ +001500b0: 2f74 643e 3c74 6420 636c 6173 733d 226d /td>non-SOAP R │ │ │ +001500e0: 4553 5420 7072 6f74 6f63 6f6c 2077 6974 EST protocol wit │ │ │ +001500f0: 6820 4854 5450 2044 454c 4554 4520 2020 h HTTP DELETE │ │ │ +00150100: 3c2f 7464 3e3c 2f74 723e 0a3c 2f74 6162 ..

    The protocol │ │ │ +00150130: 2070 726f 7065 7274 7920 6973 203c 636f property is SOAP b │ │ │ +00150150: 7920 6465 6661 756c 742e 2054 6865 2064 y default. The d │ │ │ +00150160: 6566 6175 6c74 2069 7320 6368 616e 6765 efault is change │ │ │ +00150170: 6420 7769 7468 203c 623e 3c63 6f64 653e d with │ │ │ +00150180: 736f 6170 6370 7032 202d 313c 2f63 6f64 soapcpp2 -1 option -1 │ │ │ +001501b0: 3c2f 623e 2074 6f20 534f 4150 2031 2e31 to SOAP 1.1 │ │ │ +001501c0: 2c20 3c62 3e3c 636f 6465 3e73 6f61 7063 , soapc │ │ │ +001501d0: 7070 3220 2d32 3c2f 636f 6465 3e3c 2f62 pp2 -2 option -2 │ │ │ +00150200: 746f 2053 4f41 5020 312e 322c 2061 6e64 to SOAP 1.2, and │ │ │ +00150210: 206e 6f6e 2d53 4f41 5020 5245 5354 2077 non-SOAP REST w │ │ │ +00150220: 6974 6820 3c62 3e3c 636f 6465 3e73 6f61 ith soa │ │ │ +00150230: 7063 7070 3220 2d30 3c2f 636f 6465 3e3c pcpp2 -0< │ │ │ +00150240: 2f62 3e20 6f70 7469 6f6e 203c 623e 3c63 /b> option -0

    .

    The GET pr │ │ │ +00150280: 6f74 6f63 6f6c 7320 666f 7220 534f 4150 otocols for SOAP │ │ │ +00150290: 2061 6e64 2052 4553 5420 7265 7175 6972 and REST requir │ │ │ +001502a0: 6520 7468 6174 2074 6865 2073 6572 7669 e that the servi │ │ │ +001502b0: 6365 206f 7065 7261 7469 6f6e 7320 6f6e ce operations on │ │ │ +001502c0: 6c79 2075 7365 2070 7269 6d69 7469 7665 ly use primitive │ │ │ +001502d0: 2074 7970 6573 2077 6974 6820 7468 6569 types with thei │ │ │ +001502e0: 7220 696e 7075 7420 7061 7261 6d65 7465 r input paramete │ │ │ +001502f0: 7273 2c20 6265 6361 7573 6520 7468 6573 rs, because thes │ │ │ +00150300: 6520 7061 7261 6d65 7465 7273 2061 7265 e parameters are │ │ │ +00150310: 2065 6e63 6f64 6564 2077 6974 6820 7468 encoded with th │ │ │ +00150320: 6520 5552 4c20 6173 2055 524c 2071 7565 e URL as URL que │ │ │ +00150330: 7279 2076 616c 7565 732e 3c2f 703e 0a3c ry values.

    .< │ │ │ +00150340: 703e 546f 206c 6574 2064 6972 6563 7469 p>To let directi │ │ │ +00150350: 7665 7320 7461 6b65 2065 6666 6563 7420 ves take effect │ │ │ +00150360: 7769 7468 2073 6572 7669 6365 206f 7065 with service ope │ │ │ +00150370: 7261 7469 6f6e 732c 2079 6f75 2073 686f rations, you sho │ │ │ +00150380: 756c 6420 6269 6e64 2074 6865 2073 6572 uld bind the ser │ │ │ +00150390: 7669 6365 206f 7065 7261 7469 6f6e 7320 vice operations │ │ │ +001503a0: 746f 2074 6865 2057 5344 4c20 6e61 6d65 to the WSDL name │ │ │ +001503b0: 7370 6163 6520 6f66 2061 2073 6572 7669 space of a servi │ │ │ +001503c0: 6365 2062 7920 7573 696e 6720 7468 6520 ce by using the │ │ │ +001503d0: 6e61 6d65 7370 6163 6520 7072 6566 6978 namespace prefix │ │ │ +001503e0: 2061 7320 7061 7274 206f 6620 7468 6520 as part of the │ │ │ +001503f0: 6964 656e 7469 6669 6572 206e 616d 6520 identifier name │ │ │ +00150400: 6f66 2074 6865 2066 756e 6374 696f 6e20 of the function │ │ │ +00150410: 7468 6174 2064 6566 696e 6573 2074 6865 that defines the │ │ │ +00150420: 2073 6572 7669 6365 206f 7065 7261 7469 service operati │ │ │ +00150430: 6f6e 3a3c 2f70 3e0a 3c64 6976 2063 6c61 on:

    .
    │ │ │ +00150460: 3c73 7061 6e20 636c 6173 733d 226b 6579 int prefix__fun │ │ │ +00150490: 6328 6172 6731 2c20 6172 6732 2c20 2e2e c(arg1, arg2, .. │ │ │ +001504a0: 2e2c 2061 7267 6e2c 2072 6573 756c 7429 ., argn, result) │ │ │ +001504b0: 3b3c 2f64 6976 3e0a 3c2f 6469 763e 3c21 ;
    .
    < │ │ │ +001504d0: 703e 7768 6572 6520 3c63 6f64 653e 7072 p>where pr │ │ │ +001504e0: 6566 6978 3c2f 636f 6465 3e20 6361 6e20 efix can │ │ │ +001504f0: 6e6f 7720 6265 2075 7365 6420 746f 206c now be used to l │ │ │ +00150500: 6574 2064 6972 6563 7469 7665 7320 7461 et directives ta │ │ │ +00150510: 6b65 2065 6666 6563 7420 6f6e 2074 6869 ke effect on thi │ │ │ +00150520: 7320 7365 7276 6963 6520 6f70 6572 6174 s service operat │ │ │ +00150530: 696f 6e2e 3c2f 703e 0a3c 703e f09f 949d ion.

    .

    .... │ │ │ +00150540: 203c 6120 6872 6566 3d22 2322 3e42 6163 Bac │ │ │ +00150550: 6b20 746f 2074 6162 6c65 206f 6620 636f k to table of co │ │ │ +00150560: 6e74 656e 7473 3c2f 613e 3c2f 703e 0a3c ntents

    .< │ │ │ +00150570: 6833 3e3c 6120 636c 6173 733d 2261 6e63 h3>.Serv │ │ │ +001505a0: 6963 6520 6d65 7468 6f64 2064 6972 6563 ice method direc │ │ │ +001505b0: 7469 7665 733c 2f68 333e 0a3c 703e 5365 tives

    .

    Se │ │ │ +001505c0: 7276 6963 6520 7072 6f70 6572 7469 6573 rvice properties │ │ │ +001505d0: 2061 7265 2061 7070 6c69 6361 626c 6520 are applicable │ │ │ +001505e0: 746f 2061 2073 6572 7669 6365 2061 6e64 to a service and │ │ │ +001505f0: 2074 6f20 616c 6c20 6f66 2069 7473 206f to all of its o │ │ │ +00150600: 7065 7261 7469 6f6e 732e 2053 6572 7669 perations. Servi │ │ │ +00150610: 6365 206d 6574 686f 6420 6469 7265 6374 ce method direct │ │ │ +00150620: 6976 6573 2061 7265 2073 7065 6369 6669 ives are specifi │ │ │ +00150630: 6361 6c6c 7920 6170 706c 6963 6162 6c65 cally applicable │ │ │ +00150640: 2074 6f20 6120 7365 7276 6963 6520 6f70 to a service op │ │ │ +00150650: 6572 6174 696f 6e2e 3c2f 703e 0a3c 703e eration.

    .

    │ │ │ +00150660: 4120 7365 7276 6963 6520 6d65 7468 6f64 A service method │ │ │ +00150670: 2064 6972 6563 7469 7665 2069 7320 6f66 directive is of │ │ │ +00150680: 2074 6865 2066 6f72 6d3a 3c2f 703e 0a3c the form:

    .< │ │ │ +00150690: 6469 7620 636c 6173 733d 2266 7261 676d div class="fragm │ │ │ +001506a0: 656e 7422 3e3c 6469 7620 636c 6173 733d ent">
    //g │ │ │ +001506d0: 736f 6170 2026 6c74 3b70 7265 6669 7826 soap <prefix& │ │ │ +001506e0: 6774 3b20 7365 7276 6963 6520 6d65 7468 gt; service meth │ │ │ +001506f0: 6f64 2d26 6c74 3b70 726f 7065 7274 7926 od-<property& │ │ │ +00150700: 6774 3b3a 2026 6c74 3b6d 6574 686f 6426 gt;: <method& │ │ │ +00150710: 6774 3b20 266c 743b 7661 6c75 6526 6774 gt; <value> │ │ │ +00150720: 3b3c 2f73 7061 6e3e 3c2f 6469 763e 0a3c ;
    .< │ │ │ +00150730: 2f64 6976 3e3c 212d 2d20 6672 6167 6d65 /div>

    where < │ │ │ +00150750: 636f 6465 3e26 6c74 3b70 7265 6669 7826 code><prefix& │ │ │ +00150760: 6774 3b3c 2f63 6f64 653e 2069 7320 7468 gt; is th │ │ │ +00150770: 6520 584d 4c20 6e61 6d65 7370 6163 6520 e XML namespace │ │ │ +00150780: 7072 6566 6978 206f 6620 6120 7365 7276 prefix of a serv │ │ │ +00150790: 6963 6520 6269 6e64 696e 6720 616e 6420 ice binding and │ │ │ +001507a0: 3c63 6f64 653e 266c 743b 6d65 7468 6f64 <method │ │ │ +001507b0: 2667 743b 3c2f 636f 6465 3e20 6973 2074 > is t │ │ │ +001507c0: 6865 2075 6e71 7561 6c69 6669 6564 206e he unqualified n │ │ │ +001507d0: 616d 6520 6f66 2061 2073 6572 7669 6365 ame of a service │ │ │ +001507e0: 206f 7065 7261 7469 6f6e 2e20 5468 6520 operation. The │ │ │ +001507f0: 3c63 6f64 653e 266c 743b 7072 6f70 6572 <proper │ │ │ +00150800: 7479 2667 743b 3c2f 636f 6465 3e20 616e ty> an │ │ │ +00150810: 6420 3c63 6f64 653e 266c 743b 7661 6c75 d <valu │ │ │ +00150820: 6526 6774 3b3c 2f63 6f64 653e 2066 6965 e> fie │ │ │ +00150830: 6c64 7320 6172 6520 6f6e 6520 6f66 2074 lds are one of t │ │ │ +00150840: 6865 2066 6f6c 6c6f 7769 6e67 3a3c 2f70 he following:

    .. │ │ │ +00150870: 3c74 7220 636c 6173 733d 226d 6172 6b64 .< │ │ │ +00150890: 7468 2063 6c61 7373 3d22 6d61 726b 646f th class="markdo │ │ │ +001508a0: 776e 5461 626c 6548 6561 644e 6f6e 6522 wnTableHeadNone" │ │ │ +001508b0: 3e6d 6574 686f 6420 7072 6f70 6572 7479 >method property │ │ │ +001508c0: 2020 203c 2f74 683e 3c74 6820 636c 6173 ..< │ │ │ +00150920: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ +00150930: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ +00150940: 3e3c 636f 6465 3e6d 6574 686f 642d 646f >method-do │ │ │ +00150950: 6375 6d65 6e74 6174 696f 6e3c 2f63 6f64 cumentation . │ │ │ +001509c0: 3c74 7220 636c 6173 733d 226d 6172 6b64 .< │ │ │ +00150a20: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ +00150a30: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ +00150a40: 3e73 616d 6520 6173 2061 626f 7665 2c20 >same as above, │ │ │ +00150a50: 7368 6f72 7468 616e 6420 666f 726d 2020 shorthand form │ │ │ +00150a60: 2020 3c2f 7464 3e3c 2f74 723e 0a3c 7472 .. │ │ │ +00150ab0: 3c63 6f64 653e 6d65 7468 6f64 2d61 6374 method-act │ │ │ +00150ac0: 696f 6e3c 2f63 6f64 653e 2020 203c 2f74 ion ....< │ │ │ +00150c60: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ +00150c70: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ +00150c80: 3e3c 636f 6465 3e6d 6574 686f 642d 6f75 >method-ou │ │ │ +00150c90: 7470 7574 2d61 6374 696f 6e3c 2f63 6f64 tput-action < │ │ │ +00150d20: 2f74 723e 0a3c 7472 2063 6c61 7373 3d22 /tr>...... │ │ │ +00150f70: 3c74 6420 636c 6173 733d 226d 6172 6b64 < │ │ │ +00150fc0: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ +00150fd0: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ +00150fe0: 3e6d 656d 6265 7220 6e61 6d65 206f 6620 >member name of │ │ │ +00150ff0: 7468 6520 3c63 6f64 653e 3c61 2063 6c61 the SOAP_ENV__H │ │ │ +00151060: 6561 6465 723c 2f61 3e3c 2f63 6f64 653e eader │ │ │ +00151070: 2073 7472 7563 7420 7573 6564 2069 6e20 struct used in │ │ │ +00151080: 534f 4150 2048 6561 6465 7273 206f 6620 SOAP Headers of │ │ │ +00151090: 7265 7175 6573 7473 2020 2020 3c2f 7464 requests .. │ │ │ +00151200: 0a3c 7472 2063 6c61 7373 3d22 6d61 726b ...... │ │ │ +00151400: 3c63 6f64 653e 6d65 7468 6f64 2d69 6e70 method-inp │ │ │ +00151410: 7574 2d6d 696d 652d 7479 7065 3c2f 636f ut-mime-type ..< │ │ │ +00151590: 2f74 723e 0a3c 7472 2063 6c61 7373 3d22 /tr>....< │ │ │ +00151740: 2f74 723e 0a3c 7472 2063 6c61 7373 3d22 /tr>.... │ │ │ +001518b0: 3c74 6420 636c 6173 733d 226d 6172 6b64 < │ │ │ +00151930: 2f74 723e 0a3c 2f74 6162 6c65 3e0a 3c70 /tr>.
    value │ │ │ +001508f0: 2020 203c 2f74 683e 3c2f 7472 3e0a 3c74
    text │ │ │ +00150990: 2064 6573 6372 6962 696e 6720 7468 6520 describing the │ │ │ +001509a0: 7365 7276 6963 6520 6f70 6572 6174 696f service operatio │ │ │ +001509b0: 6e20 2020 203c 2f74 643e 3c2f 7472 3e0a n
    method │ │ │ +00150a10: 3c2f 636f 6465 3e20 2020 3c2f 7464 3e3c
    "" or URI SOAPA │ │ │ +00150b10: 6374 696f 6e20 4854 5450 2068 6561 6465 ction HTTP heade │ │ │ +00150b20: 722c 206f 7220 5552 4c20 7175 6572 7920 r, or URL query │ │ │ +00150b30: 7374 7269 6e67 2066 6f72 2052 4553 5420 string for REST │ │ │ +00150b40: 7072 6f74 6f63 6f6c 7320 2020 203c 2f74 protocols
    method-input-a │ │ │ +00150bb0: 6374 696f 6e3c 2f63 6f64 653e 2020 203c ction < │ │ │ +00150bc0: 2f74 643e 3c74 6420 636c 6173 733d 226d /td>"" or URI SOA │ │ │ +00150c00: 5041 6374 696f 6e20 4854 5450 2068 6561 PAction HTTP hea │ │ │ +00150c10: 6465 7220 6f66 2073 6572 7669 6365 2072 der of service r │ │ │ +00150c20: 6571 7565 7374 206d 6573 7361 6765 7320 equest messages │ │ │ +00150c30: 2020 203c 2f74 643e 3c2f 7472 3e0a 3c74
    "" or U │ │ │ +00150ce0: 5249 2053 4f41 5041 6374 696f 6e20 4854 RI SOAPAction HT │ │ │ +00150cf0: 5450 2068 6561 6465 7220 6f66 2073 6572 TP header of ser │ │ │ +00150d00: 7669 6365 2072 6573 706f 6e73 6520 6d65 vice response me │ │ │ +00150d10: 7373 6167 6573 2020 2020 3c2f 7464 3e3c ssages
    m │ │ │ +00150d70: 6574 686f 642d 6661 756c 742d 6163 7469 ethod-fault-acti │ │ │ +00150d80: 6f6e 3c2f 636f 6465 3e20 2020 3c2f 7464 on "" or URI SOAPAc │ │ │ +00150dd0: 7469 6f6e 2048 5454 5020 6865 6164 6572 tion HTTP header │ │ │ +00150de0: 206f 6620 7365 7276 6963 6520 6661 756c of service faul │ │ │ +00150df0: 7420 6d65 7373 6167 6573 2020 2020 3c2f t messages
    method-header- │ │ │ +00150e60: 7061 7274 3c2f 636f 6465 3e20 2020 3c2f part member name │ │ │ +00150ea0: 206f 6620 7468 6520 3c63 6f64 653e 3c61 of the SOAP_EN │ │ │ +00150f10: 565f 5f48 6561 6465 723c 2f61 3e3c 2f63 V__Header struct used │ │ │ +00150f30: 2069 6e20 534f 4150 2048 6561 6465 7220 in SOAP Header │ │ │ +00150f40: 2020 203c 2f74 643e 3c2f 7472 3e0a 3c74
    method-i │ │ │ +00150fa0: 6e70 7574 2d68 6561 6465 722d 7061 7274 nput-header-part │ │ │ +00150fb0: 3c2f 636f 6465 3e20 2020 3c2f 7464 3e3c
    │ │ │ +001510f0: 6d65 7468 6f64 2d6f 7574 7075 742d 6865 method-output-he │ │ │ +00151100: 6164 6572 2d70 6172 743c 2f63 6f64 653e ader-part │ │ │ +00151110: 2020 203c 2f74 643e 3c74 6420 636c 6173 member │ │ │ +00151140: 206e 616d 6520 6f66 2074 6865 203c 636f name of the SO │ │ │ +001511b0: 4150 5f45 4e56 5f5f 4865 6164 6572 3c2f AP_ENV__Header struct │ │ │ +001511d0: 2075 7365 6420 696e 2053 4f41 5020 4865 used in SOAP He │ │ │ +001511e0: 6164 6572 7320 6f66 2072 6573 706f 6e73 aders of respons │ │ │ +001511f0: 6573 2020 2020 3c2f 7464 3e3c 2f74 723e es
    metho │ │ │ +00151250: 642d 6661 756c 743c 2f63 6f64 653e 2020 d-fault │ │ │ +00151260: 203c 2f74 643e 3c74 6420 636c 6173 733d type nam │ │ │ +00151290: 6520 6f66 2061 2073 7472 7563 7420 6f72 e of a struct or │ │ │ +001512a0: 2063 6c61 7373 206d 656d 6265 7220 7573 class member us │ │ │ +001512b0: 6564 2069 6e20 3c63 6f64 653e 534f 4150 ed in SOAP │ │ │ +001512c0: 5f45 4e56 5f5f 4465 7461 696c 733c 2f63 _ENV__Details struct < │ │ │ +001512e0: 2f74 643e 3c2f 7472 3e0a 3c74 7220 636c /td>
    method-mime-t │ │ │ +00151340: 7970 653c 2f63 6f64 653e 2020 203c 2f74 ype REST content │ │ │ +00151380: 2074 7970 6520 6f72 2053 4f41 5020 4d49 type or SOAP MI │ │ │ +00151390: 4d45 2061 7474 6163 686d 656e 7420 636f ME attachment co │ │ │ +001513a0: 6e74 656e 7420 7479 7065 2873 2920 2020 ntent type(s) │ │ │ +001513b0: 203c 2f74 643e 3c2f 7472 3e0a 3c74 7220
    RES │ │ │ +00151450: 5420 636f 6e74 656e 7420 7479 7065 206f T content type o │ │ │ +00151460: 7220 534f 4150 204d 494d 4520 6174 7461 r SOAP MIME atta │ │ │ +00151470: 6368 6d65 6e74 2063 6f6e 7465 6e74 2074 chment content t │ │ │ +00151480: 7970 6528 7329 206f 6620 7265 7175 6573 ype(s) of reques │ │ │ +00151490: 7420 6d65 7373 6167 6520 2020 203c 2f74 t message
    method-output-m │ │ │ +00151500: 696d 652d 7479 7065 3c2f 636f 6465 3e20 ime-type │ │ │ +00151510: 2020 3c2f 7464 3e3c 7464 2063 6c61 7373 REST co │ │ │ +00151540: 6e74 656e 7420 7479 7065 206f 7220 534f ntent type or SO │ │ │ +00151550: 4150 204d 494d 4520 6174 7461 6368 6d65 AP MIME attachme │ │ │ +00151560: 6e74 2063 6f6e 7465 6e74 2074 7970 6528 nt content type( │ │ │ +00151570: 7329 206f 6620 7265 7370 6f6e 7365 206d s) of response m │ │ │ +00151580: 6573 7361 6765 2020 2020 3c2f 7464 3e3c essage
    m │ │ │ +001515e0: 6574 686f 642d 7374 796c 653c 2f63 6f64 ethod-style document or rpc
    met │ │ │ +001516a0: 686f 642d 656e 636f 6469 6e67 3c2f 636f hod-encoding literal, encoded │ │ │ +00151700: 3c2f 636f 6465 3e2c 206f 7220 6120 6375 , or a cu │ │ │ +00151710: 7374 6f6d 2055 5249 2066 6f72 2065 6e63 stom URI for enc │ │ │ +00151720: 6f64 696e 6753 7479 6c65 206f 6620 6d65 odingStyle of me │ │ │ +00151730: 7373 6167 6573 2020 2020 3c2f 7464 3e3c ssages
    m │ │ │ +00151790: 6574 686f 642d 7265 7370 6f6e 7365 2d65 ethod-response-e │ │ │ +001517a0: 6e63 6f64 696e 673c 2f63 6f64 653e 2020 ncoding │ │ │ +001517b0: 203c 2f74 643e 3c74 6420 636c 6173 733d li │ │ │ +001517e0: 7465 7261 6c3c 2f63 6f64 653e 2c20 3c63 teral, encoded, or a custom │ │ │ +00151810: 5552 4920 666f 7220 656e 636f 6469 6e67 URI for encoding │ │ │ +00151820: 5374 796c 6520 6f66 2072 6573 706f 6e73 Style of respons │ │ │ +00151830: 6520 6d65 7373 6167 6573 2020 2020 3c2f e messages
    method-protoco │ │ │ +001518a0: 6c3c 2f63 6f64 653e 2020 203c 2f74 643e l SOAP or REST, │ │ │ +001518e0: 7365 6520 3c61 2063 6c61 7373 3d22 656c see Service directi │ │ │ +00151920: 7665 733c 2f61 3e20 2020 3c2f 7464 3e3c ves
    .

    The metho │ │ │ +00151950: 642d 6865 6164 6572 2d70 6172 743c 2f63 d-header-part properties │ │ │ +00151970: 6361 6e20 6265 2072 6570 6561 7465 6420 can be repeated │ │ │ +00151980: 666f 7220 6120 7365 7276 6963 6520 6f70 for a service op │ │ │ +00151990: 6572 6174 696f 6e20 746f 2064 6563 6c61 eration to decla │ │ │ +001519a0: 7265 206d 756c 7469 706c 6520 534f 4150 re multiple SOAP │ │ │ +001519b0: 2048 6561 6465 7220 7061 7274 7320 7468 Header parts th │ │ │ +001519c0: 6174 2074 6865 2073 6572 7669 6365 206f at the service o │ │ │ +001519d0: 7065 7261 7469 6f6e 2072 6571 7569 7265 peration require │ │ │ +001519e0: 732e 2059 6f75 2063 616e 2075 7365 203c s. You can use < │ │ │ +001519f0: 636f 6465 3e6d 6574 686f 642d 696e 7075 code>method-inpu │ │ │ +00151a00: 742d 6865 6164 6572 2d70 6172 743c 2f63 t-header-part and m │ │ │ +00151a20: 6574 686f 642d 6f75 7470 7574 2d68 6561 ethod-output-hea │ │ │ +00151a30: 6465 722d 7061 7274 3c2f 636f 6465 3e20 der-part │ │ │ +00151a40: 746f 2064 6966 6665 7265 6e74 6961 7465 to differentiate │ │ │ +00151a50: 2062 6574 7765 656e 2072 6571 7565 7374 between request │ │ │ +00151a60: 2061 6e64 2072 6573 706f 6e73 6520 6d65 and response me │ │ │ +00151a70: 7373 6167 6573 2e3c 2f70 3e0a 3c70 3e54 ssages.

    .

    T │ │ │ +00151a80: 6865 203c 636f 6465 3e6d 6574 686f 642d he method- │ │ │ +00151a90: 6661 756c 743c 2f63 6f64 653e 2070 726f fault pro │ │ │ +00151aa0: 7065 7274 7920 6361 6e20 6265 2072 6570 perty can be rep │ │ │ +00151ab0: 6561 7465 6420 666f 7220 6120 7365 7276 eated for a serv │ │ │ +00151ac0: 6963 6520 6f70 6572 6174 696f 6e20 746f ice operation to │ │ │ +00151ad0: 2064 6563 6c61 7265 206d 756c 7469 706c declare multipl │ │ │ +00151ae0: 6520 6661 756c 7473 2074 6861 7420 7468 e faults that th │ │ │ +00151af0: 6520 7365 7276 6963 6520 6f70 6572 6174 e service operat │ │ │ +00151b00: 696f 6e20 6d61 7920 7265 7475 726e 2e3c ion may return.< │ │ │ +00151b10: 2f70 3e0a 3c70 3e54 6865 203c 636f 6465 /p>.

    The method-action property s │ │ │ +00151b40: 6572 7665 7320 7477 6f20 7075 7270 6f73 erves two purpos │ │ │ +00151b50: 6573 3a3c 2f70 3e0a 3c6f 6c20 7479 7065 es:

    .
      .
    1. To set │ │ │ +00151b70: 2074 6865 2053 4f41 5041 6374 696f 6e20 the SOAPAction │ │ │ +00151b80: 6865 6164 6572 2066 6f72 2053 4f41 5020 header for SOAP │ │ │ +00151b90: 7072 6f74 6f63 6f6c 732c 2069 2e65 2e20 protocols, i.e. │ │ │ +00151ba0: 7365 7473 2074 6865 2064 6566 696e 6974 sets the definit │ │ │ +00151bb0: 696f 6e73 2f62 696e 6469 6e67 2f6f 7065 ions/binding/ope │ │ │ +00151bc0: 7261 7469 6f6e 2f53 4f41 503a 6f70 6572 ration/SOAP:oper │ │ │ +00151bd0: 6174 696f 6e2f 4073 6f61 7041 6374 696f ation/@soapActio │ │ │ +00151be0: 6e2e 3c2f 6c69 3e0a 3c6c 693e 546f 2073 n.
    2. .
    3. To s │ │ │ +00151bf0: 6574 2074 6865 2055 524c 2071 7565 7279 et the URL query │ │ │ +00151c00: 2073 7472 696e 6720 666f 7220 656e 6470 string for endp │ │ │ +00151c10: 6f69 6e74 7320 7769 7468 2052 4553 5420 oints with REST │ │ │ +00151c20: 7072 6f74 6f63 6f6c 732c 2069 2e65 2e20 protocols, i.e. │ │ │ +00151c30: 7365 7473 2074 6865 2064 6566 696e 6974 sets the definit │ │ │ +00151c40: 696f 6e73 2f62 696e 6469 6e67 2f6f 7065 ions/binding/ope │ │ │ +00151c50: 7261 7469 6f6e 2f48 5454 503a 6f70 6572 ration/HTTP:oper │ │ │ +00151c60: 6174 696f 6e2f 406c 6f63 6174 696f 6e2c ation/@location, │ │ │ +00151c70: 2077 6869 6368 2073 7065 6369 6669 6573 which specifies │ │ │ +00151c80: 2061 2055 524c 2071 7565 7279 2073 7472 a URL query str │ │ │ +00151c90: 696e 6720 2873 7461 7274 7320 7769 7468 ing (starts with │ │ │ +00151ca0: 2061 203c 636f 6465 3e3f 3c2f 636f 6465 a ?) to complete t │ │ │ +00151cc0: 6865 2073 6572 7669 6365 2065 6e64 706f he service endpo │ │ │ +00151cd0: 696e 7420 5552 4c20 6f72 2065 7874 656e int URL or exten │ │ │ +00151ce0: 6473 2074 6865 2065 6e64 706f 696e 7420 ds the endpoint │ │ │ +00151cf0: 5552 4c20 7769 7468 2061 206c 6f63 616c URL with a local │ │ │ +00151d00: 2070 6174 6820 2873 7461 7274 7320 7769 path (starts wi │ │ │ +00151d10: 7468 2061 203c 636f 6465 3e2f 3c2f 636f th a /).
    4. .
    │ │ │ +00151d30: 0a3c 703e 5573 6520 3c63 6f64 653e 6d65 .

    Use me │ │ │ +00151d40: 7468 6f64 2d69 6e70 7574 2d61 6374 696f thod-input-actio │ │ │ +00151d50: 6e3c 2f63 6f64 653e 2061 6e64 203c 636f n and method-output │ │ │ +00151d70: 2d61 6374 696f 6e3c 2f63 6f64 653e 2074 -action t │ │ │ +00151d80: 6f20 6469 6666 6572 656e 7469 6174 6520 o differentiate │ │ │ +00151d90: 7468 6520 534f 4150 4163 7469 6f6e 2062 the SOAPAction b │ │ │ +00151da0: 6574 7765 656e 2053 4f41 5020 7265 7175 etween SOAP requ │ │ │ +00151db0: 6573 7420 616e 6420 7265 7370 6f6e 7365 est and response │ │ │ +00151dc0: 206d 6573 7361 6765 732e 3c2f 703e 0a3c messages.

    .< │ │ │ +00151dd0: 703e 596f 7520 6361 6e20 616c 7761 7973 p>You can always │ │ │ +00151de0: 206f 7665 7272 6964 6520 7468 6520 706f override the po │ │ │ +00151df0: 7274 2065 6e64 706f 696e 7420 5552 4c20 rt endpoint URL │ │ │ +00151e00: 616e 6420 6163 7469 6f6e 2076 616c 7565 and action value │ │ │ +00151e10: 7320 6174 2072 756e 7469 6d65 2069 6e20 s at runtime in │ │ │ +00151e20: 7468 6520 6175 746f 2d67 656e 6572 6174 the auto-generat │ │ │ +00151e30: 6564 203c 636f 6465 3e73 6f61 705f 6361 ed soap_ca │ │ │ +00151e40: 6c6c 5f70 7265 6669 785f 5f66 756e 633c ll_prefix__func< │ │ │ +00151e50: 2f63 6f64 653e 2073 6572 7669 6365 2063 /code> service c │ │ │ +00151e60: 616c 6c20 2843 2f43 2b2b 2063 6c69 656e all (C/C++ clien │ │ │ +00151e70: 7420 7369 6465 2920 616e 6420 696e 2074 t side) and in t │ │ │ +00151e80: 6865 2061 7574 6f2d 6765 6e65 7261 7465 he auto-generate │ │ │ +00151e90: 6420 432b 2b20 7072 6f78 7920 636c 6173 d C++ proxy clas │ │ │ +00151ea0: 7320 7365 7276 6963 6520 6361 6c6c 732e s service calls. │ │ │ +00151eb0: 2041 2072 756e 7469 6d65 204e 554c 4c20 A runtime NULL │ │ │ +00151ec0: 656e 6470 6f69 6e74 2055 524c 2061 6e64 endpoint URL and │ │ │ +00151ed0: 2f6f 7220 6163 7469 6f6e 2075 7365 7320 /or action uses │ │ │ +00151ee0: 7468 6520 6465 6661 756c 7473 2073 6574 the defaults set │ │ │ +00151ef0: 2062 7920 7468 6573 6520 6469 7265 6374 by these direct │ │ │ +00151f00: 6976 6573 2e3c 2f70 3e0a 3c70 3e54 6865 ives.

    .

    The │ │ │ +00151f10: 203c 636f 6465 3e6d 6574 686f 642d 6d69 method-mi │ │ │ +00151f20: 6d65 2d74 7970 653c 2f63 6f64 653e 2070 me-type p │ │ │ +00151f30: 726f 7065 7274 7920 7365 7276 6573 2074 roperty serves t │ │ │ +00151f40: 776f 2070 7572 706f 7365 733a 3c2f 703e wo purposes:

    │ │ │ +00151f50: 0a3c 6f6c 2074 7970 653d 2231 223e 0a3c .
      .< │ │ │ +00151f60: 6c69 3e54 6f20 7365 7420 7468 6520 7479 li>To set the ty │ │ │ +00151f70: 7065 206f 6620 4d49 4d45 2f4d 544f 4d20 pe of MIME/MTOM │ │ │ +00151f80: 6174 7461 6368 6d65 6e74 7320 7573 6564 attachments used │ │ │ +00151f90: 2077 6974 6820 534f 4150 2070 726f 746f with SOAP proto │ │ │ +00151fa0: 636f 6c73 2e20 4d75 6c74 6970 6c65 2061 cols. Multiple a │ │ │ +00151fb0: 7474 6163 686d 656e 7420 7479 7065 7320 ttachment types │ │ │ +00151fc0: 6361 6e20 6265 2064 6563 6c61 7265 6420 can be declared │ │ │ +00151fd0: 666f 7220 6120 534f 4150 2073 6572 7669 for a SOAP servi │ │ │ +00151fe0: 6365 206f 7065 7261 7469 6f6e 2c20 692e ce operation, i. │ │ │ +00151ff0: 652e 2061 6464 7320 6465 6669 6e69 7469 e. adds definiti │ │ │ +00152000: 6f6e 732f 6269 6e64 696e 672f 6f70 6572 ons/binding/oper │ │ │ +00152010: 6174 696f 6e2f 696e 7075 742f 4d49 4d45 ation/input/MIME │ │ │ +00152020: 3a6d 756c 7469 7061 7274 5265 6c61 7465 :multipartRelate │ │ │ +00152030: 642f 4d49 4d45 3a70 6172 742f 4d49 4d45 d/MIME:part/MIME │ │ │ +00152040: 3a63 6f6e 7465 6e74 2f40 7479 7065 2066 :content/@type f │ │ │ +00152050: 6f72 2065 6163 6820 7479 7065 2073 7065 or each type spe │ │ │ +00152060: 6369 6669 6564 2e3c 2f6c 693e 0a3c 6c69 cified..
    1. To set the MIME │ │ │ +00152080: 2074 7970 6520 6f66 2061 2052 4553 5420 type of a REST │ │ │ +00152090: 6f70 6572 6174 696f 6e2e 2054 6869 7320 operation. This │ │ │ +001520a0: 7265 706c 6163 6573 2058 4d4c 2064 6563 replaces XML dec │ │ │ +001520b0: 6c61 7265 6420 696e 2057 5344 4c20 6279 lared in WSDL by │ │ │ +001520c0: 2064 6566 696e 6974 696f 6e73 2f62 696e definitions/bin │ │ │ +001520d0: 6469 6e67 2f6f 7065 7261 7469 6f6e 2f28 ding/operation/( │ │ │ +001520e0: 696e 7075 747c 6f75 7470 7574 292f 4d49 input|output)/MI │ │ │ +001520f0: 4d45 3a6d 696d 6558 6d6c 2077 6974 6820 ME:mimeXml with │ │ │ +00152100: 4d49 4d45 3a63 6f6e 7465 6e74 2f40 7479 MIME:content/@ty │ │ │ +00152110: 7065 2e20 5573 6520 3c63 6f64 653e 6170 pe. Use ap │ │ │ +00152120: 706c 6963 6174 696f 6e2f 782d 7777 772d plication/x-www- │ │ │ +00152130: 666f 726d 2d75 726c 656e 636f 6465 643c form-urlencoded< │ │ │ +00152140: 2f63 6f64 653e 2077 6974 6820 5245 5354 /code> with REST │ │ │ +00152150: 2050 4f53 5420 616e 6420 5055 5420 7072 POST and PUT pr │ │ │ +00152160: 6f74 6f63 6f6c 7320 746f 2073 656e 6420 otocols to send │ │ │ +00152170: 656e 636f 6465 6420 666f 726d 2064 6174 encoded form dat │ │ │ +00152180: 6120 6175 746f 6d61 7469 6361 6c6c 7920 a automatically │ │ │ +00152190: 696e 7374 6561 6420 6f66 2058 4d4c 2e20 instead of XML. │ │ │ +001521a0: 4f6e 6c79 2070 7269 6d69 7469 7665 2074 Only primitive t │ │ │ +001521b0: 7970 6520 7661 6c75 6573 2063 616e 2062 ype values can b │ │ │ +001521c0: 6520 7472 616e 736d 6974 7465 6420 7769 e transmitted wi │ │ │ +001521d0: 7468 2066 6f72 6d20 6461 7461 2c20 7375 th form data, su │ │ │ +001521e0: 6368 2061 7320 6e75 6d62 6572 7320 616e ch as numbers an │ │ │ +001521f0: 6420 7374 7269 6e67 732c 2069 2e65 2e20 d strings, i.e. │ │ │ +00152200: 6f6e 6c79 2074 7970 6573 2074 6861 7420 only types that │ │ │ +00152210: 6172 6520 6c65 6761 6c20 746f 2075 7365 are legal to use │ │ │ +00152220: 2061 7320 6174 7472 6962 7574 6573 206d as attributes m │ │ │ +00152230: 656d 6265 7273 2e3c 2f6c 693e 0a3c 2f6f embers.
    2. ..

      Use │ │ │ +00152250: 6d65 7468 6f64 2d69 6e70 7574 2d6d 696d method-input-mim │ │ │ +00152260: 652d 7479 7065 3c2f 636f 6465 3e20 616e e-type an │ │ │ +00152270: 6420 3c63 6f64 653e 6d65 7468 6f64 2d6f d method-o │ │ │ +00152280: 7574 7075 742d 6d69 6d65 2d74 7970 653c utput-mime-type< │ │ │ +00152290: 2f63 6f64 653e 2074 6f20 6469 6666 6572 /code> to differ │ │ │ +001522a0: 656e 7469 6174 6520 7468 6520 6174 7461 entiate the atta │ │ │ +001522b0: 6368 6d65 6e74 2074 7970 6573 2062 6574 chment types bet │ │ │ +001522c0: 7765 656e 2072 6571 7565 7374 2061 6e64 ween request and │ │ │ +001522d0: 2072 6573 706f 6e73 6520 6d65 7373 6167 response messag │ │ │ +001522e0: 6573 2e3c 2f70 3e0a 3c70 3ef0 9f94 9d20 es.

      .

      .... │ │ │ +001522f0: 3c61 2068 7265 663d 2223 223e 4261 636b Back │ │ │ +00152300: 2074 6f20 7461 626c 6520 6f66 2063 6f6e to table of con │ │ │ +00152310: 7465 6e74 733c 2f61 3e3c 2f70 3e0a 3c68 tents

      ..Schem │ │ │ +00152350: 6120 6469 7265 6374 6976 6573 3c2f 6833 a directives.

      A schema di │ │ │ +00152370: 7265 6374 6976 6520 6973 206f 6620 7468 rective is of th │ │ │ +00152380: 6520 666f 726d 3a3c 2f70 3e0a 3c64 6976 e form:

      .
      //gsoa │ │ │ +001523d0: 7020 266c 743b 7072 6566 6978 2667 743b p <prefix> │ │ │ +001523e0: 2073 6368 656d 6120 266c 743b 7072 6f70 schema <prop │ │ │ +001523f0: 6572 7479 2667 743b 3a20 266c 743b 7661 erty>: <va │ │ │ +00152400: 6c75 6526 6774 3b3c 2f73 7061 6e3e 3c2f lue>.

      w │ │ │ +00152430: 6865 7265 203c 636f 6465 3e26 6c74 3b70 here <p │ │ │ +00152440: 7265 6669 7826 6774 3b3c 2f63 6f64 653e refix> │ │ │ +00152450: 2069 7320 7468 6520 584d 4c20 6e61 6d65 is the XML name │ │ │ +00152460: 7370 6163 6520 7072 6566 6978 206f 6620 space prefix of │ │ │ +00152470: 6120 7363 6865 6d61 2e20 5468 6520 3c63 a schema. The <property │ │ │ +00152490: 2667 743b 3c2f 636f 6465 3e20 616e 6420 > and │ │ │ +001524a0: 3c63 6f64 653e 266c 743b 7661 6c75 6526 <value& │ │ │ +001524b0: 6774 3b3c 2f63 6f64 653e 2066 6965 6c64 gt; field │ │ │ +001524c0: 7320 6172 6520 6f6e 6520 6f66 2074 6865 s are one of the │ │ │ +001524d0: 2066 6f6c 6c6f 7769 6e67 3a3c 2f70 3e0a following:

      . │ │ │ +001524e0: 3c74 6162 6c65 2063 6c61 7373 3d22 6d61 ..< │ │ │ +00152550: 7468 2063 6c61 7373 3d22 6d61 726b 646f th class="markdo │ │ │ +00152560: 776e 5461 626c 6548 6561 644e 6f6e 6522 wnTableHeadNone" │ │ │ +00152570: 3e76 616c 7565 2020 2020 3c2f 7468 3e3c >value < │ │ │ +00152580: 2f74 723e 0a3c 7472 2063 6c61 7373 3d22 /tr>..< │ │ │ +00152630: 2f74 723e 0a3c 7472 2063 6c61 7373 3d22 /tr>.... │ │ │ +00152780: 3c74 6420 636c 6173 733d 226d 6172 6b64 ...< │ │ │ +00152940: 7472 2063 6c61 7373 3d22 6d61 726b 646f tr class="markdo │ │ │ +00152950: 776e 5461 626c 6552 6f77 4f64 6422 3e0a wnTableRowOdd">. │ │ │ +00152960: 3c74 6420 636c 6173 733d 226d 6172 6b64 .. │ │ │ +00152a90: 3c74 6420 636c 6173 733d 226d 6172 6b64 ...
      p │ │ │ +00152540: 726f 7065 7274 7920 2020 3c2f 7468 3e3c roperty
      na │ │ │ +001525d0: 6d65 7370 6163 653c 2f63 6f64 653e 2020 mespace │ │ │ +001525e0: 203c 2f74 643e 3c74 6420 636c 6173 733d URI of t │ │ │ +00152610: 6865 2058 5344 2074 6172 6765 744e 616d he XSD targetNam │ │ │ +00152620: 6573 7061 6365 2020 2020 3c2f 7464 3e3c espace
      n │ │ │ +00152680: 616d 6573 7061 6365 323c 2f63 6f64 653e amespace2 │ │ │ +00152690: 2020 203c 2f74 643e 3c74 6420 636c 6173 altern │ │ │ +001526c0: 6174 6520 5552 4920 7061 7474 6572 6e20 ate URI pattern │ │ │ +001526d0: 666f 7220 7468 6520 5853 4420 6e61 6d65 for the XSD name │ │ │ +001526e0: 7370 6163 6520 2869 2e65 2e20 5552 4920 space (i.e. URI │ │ │ +001526f0: 6973 2061 6c73 6f20 6163 6365 7074 6564 is also accepted │ │ │ +00152700: 2062 7920 7468 6520 584d 4c20 7061 7273 by the XML pars │ │ │ +00152710: 6572 2920 2020 203c 2f74 643e 3c2f 7472 er)
      impor │ │ │ +00152770: 743c 2f63 6f64 653e 2020 203c 2f74 643e t URI of an impo │ │ │ +001527b0: 7274 6564 206e 616d 6573 7061 6365 2c20 rted namespace, │ │ │ +001527c0: 6173 2061 6e20 616c 7465 726e 6174 6976 as an alternativ │ │ │ +001527d0: 6520 6f72 2069 6e20 6164 6469 7469 6f6e e or in addition │ │ │ +001527e0: 2074 6f20 3c63 6f64 653e 6e61 6d65 7370 to namesp │ │ │ +001527f0: 6163 653c 2f63 6f64 653e 2c20 6164 6473 ace, adds │ │ │ +00152800: 203c 636f 6465 3e78 7364 3a69 6d70 6f72 xsd:impor │ │ │ +00152810: 743c 2f63 6f64 653e 2074 6f20 7468 6520 t to the │ │ │ +00152820: 6765 6e65 7261 7465 6420 5753 444c 2061 generated WSDL a │ │ │ +00152830: 6e64 2058 5344 2066 696c 6573 2020 2020 nd XSD files │ │ │ +00152840: 3c2f 7464 3e3c 2f74 723e 0a3c 7472 2063
      < │ │ │ +00152890: 636f 6465 3e66 6f72 6d3c 2f63 6f64 653e code>form │ │ │ +001528a0: 2020 203c 2f74 643e 3c74 6420 636c 6173 │ │ │ +001528d0: 756e 7175 616c 6966 6965 643c 2f63 6f64 unqualified (default) or │ │ │ +001528f0: 3c63 6f64 653e 7175 616c 6966 6965 643c qualified< │ │ │ +00152900: 2f63 6f64 653e 206c 6f63 616c 2065 6c65 /code> local ele │ │ │ +00152910: 6d65 6e74 2061 6e64 2061 7474 7269 6275 ment and attribu │ │ │ +00152920: 7465 2066 6f72 6d20 6465 6661 756c 7473 te form defaults │ │ │ +00152930: 2020 2020 3c2f 7464 3e3c 2f74 723e 0a3c
      elementF │ │ │ +00152990: 6f72 6d3c 2f63 6f64 653e 2020 203c 2f74 orm unqual │ │ │ +001529d0: 6966 6965 643c 2f63 6f64 653e 2028 6465 ified (de │ │ │ +001529e0: 6661 756c 7429 206f 7220 3c63 6f64 653e fault) or │ │ │ +001529f0: 7175 616c 6966 6965 643c 2f63 6f64 653e qualified │ │ │ +00152a00: 206c 6f63 616c 2065 6c65 6d65 6e74 2066 local element f │ │ │ +00152a10: 6f72 6d20 6465 6661 756c 7420 2020 203c orm default < │ │ │ +00152a20: 2f74 643e 3c2f 7472 3e0a 3c74 7220 636c /td>
      attributeFor │ │ │ +00152a80: 6d3c 2f63 6f64 653e 2020 203c 2f74 643e m unqualif │ │ │ +00152ac0: 6965 643c 2f63 6f64 653e 2028 6465 6661 ied (defa │ │ │ +00152ad0: 756c 7429 206f 7220 3c63 6f64 653e 7175 ult) or qu │ │ │ +00152ae0: 616c 6966 6965 643c 2f63 6f64 653e 206c alified l │ │ │ +00152af0: 6f63 616c 2061 7474 7269 6275 7465 2066 ocal attribute f │ │ │ +00152b00: 6f72 6d20 6465 6661 756c 7420 2020 203c orm default < │ │ │ +00152b10: 2f74 643e 3c2f 7472 3e0a 3c74 7220 636c /td>
      typed │ │ │ +00152b70: 2020 3c2f 7464 3e3c 7464 2063 6c61 7373 n │ │ │ +00152ba0: 6f3c 2f63 6f64 653e 2028 6465 6661 756c o (defaul │ │ │ +00152bb0: 7429 206f 7220 3c63 6f64 653e 7965 733c t) or yes< │ │ │ +00152bc0: 2f63 6f64 653e 2066 6f72 2073 6572 6961 /code> for seria │ │ │ +00152bd0: 6c69 7a65 7273 2074 6f20 6164 6420 3c63 lizers to add xsi:type attributes t │ │ │ +00152c00: 6f20 584d 4c20 2020 3c2f 7464 3e3c 2f74 o XML
      .

      T │ │ │ +00152c20: 6865 203c 636f 6465 3e6e 616d 6573 7061 he namespa │ │ │ +00152c30: 6365 323c 2f63 6f64 653e 2055 5249 2069 ce2 URI i │ │ │ +00152c40: 7320 6120 7061 7474 6572 6e20 7769 7468 s a pattern with │ │ │ +00152c50: 203c 636f 6465 3e2a 3c2f 636f 6465 3e20 * │ │ │ +00152c60: 6d61 7463 6869 6e67 2061 6e79 2073 6571 matching any seq │ │ │ +00152c70: 7565 6e63 6520 6f66 2063 6861 7261 6374 uence of charact │ │ │ +00152c80: 6572 7320 616e 6420 3c63 6f64 653e 2d3c ers and -< │ │ │ +00152c90: 2f63 6f64 653e 206d 6174 6368 696e 6720 /code> matching │ │ │ +00152ca0: 616e 7920 6368 6172 6163 7465 722e 2054 any character. T │ │ │ +00152cb0: 6869 7320 7061 7474 6572 6e20 696e 7374 his pattern inst │ │ │ +00152cc0: 7275 6374 7320 7468 6520 584d 4c20 7061 ructs the XML pa │ │ │ +00152cd0: 7273 6572 2061 6e64 2076 616c 6964 6174 rser and validat │ │ │ +00152ce0: 6f72 2074 6f20 616c 736f 2061 6363 6570 or to also accep │ │ │ +00152cf0: 7420 7468 6520 5552 4920 7061 7474 6572 t the URI patter │ │ │ +00152d00: 6e20 6173 2061 2076 616c 6964 206e 616d n as a valid nam │ │ │ +00152d10: 6573 7061 6365 2066 6f72 2074 6865 2073 espace for the s │ │ │ +00152d20: 7065 6369 6669 6564 203c 636f 6465 3e26 pecified & │ │ │ +00152d30: 6c74 3b70 7265 6669 7826 6774 3b3c 2f63 lt;prefix>.

      .

      The │ │ │ +00152d50: 203c 636f 6465 3e74 7970 6564 3c2f 636f typed property is │ │ │ +00152d70: 3c63 6f64 653e 6e6f 3c2f 636f 6465 3e20 no │ │ │ +00152d80: 6279 2064 6566 6175 6c74 2061 6e64 2063 by default and c │ │ │ +00152d90: 616e 2062 6520 6368 616e 6765 6420 746f an be changed to │ │ │ +00152da0: 203c 636f 6465 3e79 6573 3c2f 636f 6465 yes with │ │ │ +00152dc0: 736f 6170 6370 7032 202d 743c 2f63 6f64 soapcpp2 -t option -t │ │ │ +00152df0: 3c2f 623e 2e3c 2f70 3e0a 3c70 3ef0 9f94 .

      .

      ... │ │ │ +00152e00: 9d20 3c61 2068 7265 663d 2223 223e 4261 . Ba │ │ │ +00152e10: 636b 2074 6f20 7461 626c 6520 6f66 2063 ck to table of c │ │ │ +00152e20: 6f6e 7465 6e74 733c 2f61 3e3c 2f70 3e0a ontents

      . │ │ │ +00152e30: 3c68 333e 3c61 2063 6c61 7373 3d22 616e

      .Sch │ │ │ +00152e60: 656d 6120 7479 7065 2064 6972 6563 7469 ema type directi │ │ │ +00152e70: 7665 733c 2f68 333e 0a3c 703e 4120 7363 ves

      .

      A sc │ │ │ +00152e80: 6865 6d61 2074 7970 6520 6469 7265 6374 hema type direct │ │ │ +00152e90: 6976 6520 6973 206f 6620 7468 6520 666f ive is of the fo │ │ │ +00152ea0: 726d 3a3c 2f70 3e0a 3c64 6976 2063 6c61 rm:

      .
      │ │ │ +00152ed0: 3c73 7061 6e20 636c 6173 733d 2263 6f6d //gsoap &l │ │ │ +00152ef0: 743b 7072 6566 6978 2667 743b 2073 6368 t;prefix> sch │ │ │ +00152f00: 656d 6120 7479 7065 2d26 6c74 3b70 726f ema type-<pro │ │ │ +00152f10: 7065 7274 7926 6774 3b3a 2026 6c74 3b6e perty>: <n │ │ │ +00152f20: 616d 6526 6774 3b20 266c 743b 7661 6c75 ame> <valu │ │ │ +00152f30: 6526 6774 3b3c 2f73 7061 6e3e 3c2f 6469 e>.
      //gso │ │ │ +00152f70: 6170 2026 6c74 3b70 7265 6669 7826 6774 ap <prefix> │ │ │ +00152f80: 3b20 7363 6865 6d61 2074 7970 652d 266c ; schema type-&l │ │ │ +00152f90: 743b 7072 6f70 6572 7479 2667 743b 3a20 t;property>: │ │ │ +00152fa0: 266c 743b 6e61 6d65 2667 743b 3a3a 266c <name>::&l │ │ │ +00152fb0: 743b 6d65 6d62 6572 2667 743b 2026 6c74 t;member> < │ │ │ +00152fc0: 3b76 616c 7565 2667 743b 3c2f 7370 616e ;value>
      .
      < │ │ │ +00152ff0: 703e 7768 6572 6520 3c63 6f64 653e 266c p>where &l │ │ │ +00153000: 743b 7072 6566 6978 2667 743b 3c2f 636f t;prefix> is the XML n │ │ │ +00153020: 616d 6573 7061 6365 2070 7265 6669 7820 amespace prefix │ │ │ +00153030: 6f66 2061 2073 6368 656d 6120 616e 6420 of a schema and │ │ │ +00153040: 3c63 6f64 653e 266c 743b 6e61 6d65 2667 <name&g │ │ │ +00153050: 743b 3c2f 636f 6465 3e20 6973 2061 6e20 t; is an │ │ │ +00153060: 756e 7175 616c 6966 6965 6420 6e61 6d65 unqualified name │ │ │ +00153070: 206f 6620 6120 432f 432b 2b20 7479 7065 of a C/C++ type │ │ │ +00153080: 2c20 616e 6420 7468 6520 6f70 7469 6f6e , and the option │ │ │ +00153090: 616c 203c 636f 6465 3e26 6c74 3b6d 656d al <mem │ │ │ +001530a0: 6265 7226 6774 3b3c 2f63 6f64 653e 2069 ber> i │ │ │ +001530b0: 7320 6120 636c 6173 732f 7374 7275 6374 s a class/struct │ │ │ +001530c0: 206d 656d 6265 7273 206f 7220 656e 756d members or enum │ │ │ +001530d0: 2063 6f6e 7374 616e 742e 3c2f 703e 0a3c constant.

      .< │ │ │ +001530e0: 703e 596f 7520 6361 6e20 6465 7363 7269 p>You can descri │ │ │ +001530f0: 6265 2061 2074 7970 6520 7769 7468 206f be a type with o │ │ │ +00153100: 6e65 206f 6620 7468 6520 666f 6c6c 6f77 ne of the follow │ │ │ +00153110: 696e 673a 3c2f 703e 0a3c 7461 626c 6520 ing:

      .......< │ │ │ +001532a0: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ +001532b0: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ +001532c0: 3e3c 636f 6465 3e74 7970 653c 2f63 6f64 >type .
      type pro │ │ │ +00153180: 7065 7274 7920 2020 3c2f 7468 3e3c 7468 perty v │ │ │ +001531b0: 616c 7565 2020 2020 3c2f 7468 3e3c 2f74 alue
      type │ │ │ +00153210: 2d64 6f63 756d 656e 7461 7469 6f6e 3c2f -documentation t │ │ │ +00153250: 6578 7420 6465 7363 7269 6269 6e67 2074 ext describing t │ │ │ +00153260: 6865 2073 6368 656d 6120 7479 7065 2020 he schema type │ │ │ +00153270: 2020 3c2f 7464 3e3c 2f74 723e 0a3c 7472
      an a │ │ │ +00153300: 6c69 6173 2066 6f72 2074 6865 203c 636f lias for the type-document │ │ │ +00153320: 6174 696f 6e3c 2f63 6f64 653e 2070 726f ation pro │ │ │ +00153330: 7065 7274 7920 2020 3c2f 7464 3e3c 2f74 perty
      .

      F │ │ │ +00153350: 6f72 2065 7861 6d70 6c65 2c20 796f 7520 or example, you │ │ │ +00153360: 6361 6e20 6164 6420 6120 6465 7363 7269 can add a descri │ │ │ +00153370: 7074 696f 6e20 746f 2061 6e20 656e 756d ption to an enum │ │ │ +00153380: 6572 6174 696f 6e3a 3c2f 703e 0a3c 6469 eration:

      .
      //gso │ │ │ +001533d0: 6170 206e 7320 7363 6865 6d61 2074 7970 ap ns schema typ │ │ │ +001533e0: 653a 2056 6f77 656c 7320 5468 6520 6c65 e: Vowels The le │ │ │ +001533f0: 7474 6572 7320 412c 2045 2c20 492c 204f tters A, E, I, O │ │ │ +00153400: 2c20 552c 2061 6e64 2073 6f6d 6574 696d , U, and sometim │ │ │ +00153410: 6573 2059 3c2f 7370 616e 3e3c 2f64 6976 es Y
      .
      //gsoa │ │ │ +00153450: 7020 6e73 2073 6368 656d 6120 7479 7065 p ns schema type │ │ │ +00153460: 3a20 566f 7765 6c73 3a3a 5920 4120 766f : Vowels::Y A vo │ │ │ +00153470: 7765 6c2c 2073 6f6d 6574 696d 6573 3c2f wel, sometimes
      .
      enum class ns__Vowels │ │ │ +001534d0: 203a 2063 6861 7220 7b20 4120 3d20 3c73 : char { A = 'A&# │ │ │ +00153500: 3339 3b3c 2f73 7061 6e3e 2c20 4520 3d20 39;, E = │ │ │ +00153510: 3c73 7061 6e20 636c 6173 733d 2263 6861 'E │ │ │ +00153530: 2623 3339 3b3c 2f73 7061 6e3e 2c20 4920 ', I │ │ │ +00153540: 3d20 3c73 7061 6e20 636c 6173 733d 2263 = ' │ │ │ +00153560: 3b49 2623 3339 3b3c 2f73 7061 6e3e 2c20 ;I', │ │ │ +00153570: 4f20 3d20 3c73 7061 6e20 636c 6173 733d O = &# │ │ │ +00153590: 3339 3b4f 2623 3339 3b3c 2f73 7061 6e3e 39;O' │ │ │ +001535a0: 2c20 5520 3d20 3c73 7061 6e20 636c 6173 , U = │ │ │ +001535c0: 2623 3339 3b55 2623 3339 3b3c 2f73 7061 'U', Y = 'Y' };
      .

      This doc │ │ │ +00153630: 756d 656e 7465 6420 656e 756d 6572 6174 umented enumerat │ │ │ +00153640: 696f 6e20 6d61 7073 2074 6f20 6120 7369 ion maps to a si │ │ │ +00153650: 6d70 6c65 5479 7065 2072 6573 7472 6963 mpleType restric │ │ │ +00153660: 7469 6f6e 206f 6620 3c65 6d3e 3c63 6f64 tion of xsd:string in the │ │ │ +00153690: 736f 6170 6370 7032 2d67 656e 6572 6174 soapcpp2-generat │ │ │ +001536a0: 6564 2073 6368 656d 613a 3c2f 703e 0a3c ed schema:

      .< │ │ │ +001536b0: 6469 7620 636c 6173 733d 2261 6c74 223e div class="alt"> │ │ │ +001536c0: 203c 6469 7620 636c 6173 733d 2266 7261
      <simpleTyp │ │ │ +00153710: 653c 2f73 7061 6e3e 203c 7370 616e 2063 e n │ │ │ +00153730: 616d 653c 2f73 7061 6e3e 3d3c 7370 616e ame="Vow │ │ │ +00153760: 656c 7326 7175 6f74 3b3c 2f73 7061 6e3e els" │ │ │ +00153770: 2667 743b 3c2f 6469 763e 0a3c 6469 7620 >
      .
      & │ │ │ +00153790: 6c74 3b3c 7370 616e 2063 6c61 7373 3d22 lt;ann │ │ │ +001537b0: 6f74 6174 696f 6e3c 2f73 7061 6e3e 2667 otation&g │ │ │ +001537c0: 743b 3c2f 6469 763e 0a3c 6469 7620 636c t;
      .
      & │ │ │ +001537e0: 6c74 3b3c 7370 616e 2063 6c61 7373 3d22 lt;doc │ │ │ +00153800: 756d 656e 7461 7469 6f6e 3c2f 7370 616e umentation>The lett │ │ │ +00153850: 6572 733c 2f73 7061 6e3e 203c 7370 616e ers A, E, I, O, U, and sometimes Y</ │ │ │ +00153980: 646f 6375 6d65 6e74 6174 696f 6e3c 2f73 documentation>
      .< │ │ │ +001539a0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +001539b0: 3e20 2026 6c74 3b2f 3c73 7061 6e20 636c > </annotation>
      . │ │ │ +00153a00: 2020 266c 743b 3c73 7061 6e20 636c 6173 < │ │ │ +00153a20: 7265 7374 7269 6374 696f 6e3c 2f73 7061 restriction base
      ="xsd:strin │ │ │ +00153a80: 6726 7175 6f74 3b3c 2f73 7061 6e3e 2667 g"&g │ │ │ +00153a90: 743b 3c2f 6469 763e 0a3c 6469 7620 636c t;
      .
      & │ │ │ +00153ab0: 6c74 3b3c 7370 616e 2063 6c61 7373 3d22 lt;enu │ │ │ +00153ad0: 6d65 7261 7469 6f6e 3c2f 7370 616e 3e20 meration │ │ │ +00153ae0: 3c73 7061 6e20 636c 6173 733d 226b 6579 value=& │ │ │ +00153b20: 7175 6f74 3b41 2671 756f 743b 3c2f 7370 quot;A"/>
      .< │ │ │ +00153b40: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +00153b50: 3e20 2020 2026 6c74 3b3c 7370 616e 2063 > <enumeration valu │ │ │ +00153ba0: 653c 2f73 7061 6e3e 3d3c 7370 616e 2063 e="E&quo │ │ │ +00153bd0: 743b 3c2f 7370 616e 3e2f 2667 743b 3c2f t;/>.
      << │ │ │ +00153c00: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +00153c10: 6f72 6474 7970 6522 3e65 6e75 6d65 7261 ordtype">enumera │ │ │ +00153c20: 7469 6f6e 3c2f 7370 616e 3e20 3c73 7061 tion value=< │ │ │ +00153c50: 7370 616e 2063 6c61 7373 3d22 7374 7269 span class="stri │ │ │ +00153c60: 6e67 6c69 7465 7261 6c22 3e26 7175 6f74 ngliteral">" │ │ │ +00153c70: 3b49 2671 756f 743b 3c2f 7370 616e 3e2f ;I"/ │ │ │ +00153c80: 2667 743b 3c2f 6469 763e 0a3c 6469 7620 >
      .
      │ │ │ +00153ca0: 2026 6c74 3b3c 7370 616e 2063 6c61 7373 <e │ │ │ +00153cc0: 6e75 6d65 7261 7469 6f6e 3c2f 7370 616e numeration value="O"/>
      │ │ │ +00153d30: 0a3c 6469 7620 636c 6173 733d 226c 696e .
      <enumeration │ │ │ +00153d70: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c va │ │ │ +00153d90: 6c75 653c 2f73 7061 6e3e 3d3c 7370 616e lue="U&q │ │ │ +00153dc0: 756f 743b 3c2f 7370 616e 3e2f 2667 743b uot;/> │ │ │ +00153dd0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
      .
      < │ │ │ +00153df0: 3b3c 7370 616e 2063 6c61 7373 3d22 6b65 ;enume │ │ │ +00153e10: 7261 7469 6f6e 3c2f 7370 616e 3e20 3c73 ration value │ │ │ +00153e40: 3d3c 7370 616e 2063 6c61 7373 3d22 7374 =&qu │ │ │ +00153e60: 6f74 3b59 2671 756f 743b 3c2f 7370 616e ot;Y">
      .
      │ │ │ +00153e90: 2020 2020 266c 743b 3c73 7061 6e20 636c <annotation>
      . │ │ │ +00153ee0: 2020 2020 2020 2020 266c 743b 3c73 7061 <documentat │ │ │ +00153f10: 696f 6e3c 2f73 7061 6e3e 2667 743b 3c73 ion
      >A vowel, │ │ │ +00153f60: 203c 7370 616e 2063 6c61 7373 3d22 6b65 sometimes │ │ │ +00153f80: 3c2f 7370 616e 3e26 6c74 3b2f 3c73 7061 </documentat │ │ │ +00153fb0: 696f 6e3c 2f73 7061 6e3e 2667 743b 3c2f ion>.
      < │ │ │ +00153fe0: 3b2f 3c73 7061 6e20 636c 6173 733d 226b ;/anno │ │ │ +00154000: 7461 7469 6f6e 3c2f 7370 616e 3e26 6774 tation> │ │ │ +00154010: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
      .
      &l │ │ │ +00154030: 743b 3c73 7061 6e20 636c 6173 733d 226b t;enum │ │ │ +00154050: 6572 6174 696f 6e3c 2f73 7061 6e3e 2f26 eration/& │ │ │ +00154060: 6774 3b3c 2f64 6976 3e0a 3c64 6976 2063 gt;
      .
      &l │ │ │ +00154080: 743b 2f3c 7370 616e 2063 6c61 7373 3d22 t;/res │ │ │ +001540a0: 7472 6963 7469 6f6e 3c2f 7370 616e 3e26 triction& │ │ │ +001540b0: 6774 3b3c 2f64 6976 3e0a 3c64 6976 2063 gt;
      .
      < │ │ │ +001540d0: 2f3c 7370 616e 2063 6c61 7373 3d22 6b65 /simpl │ │ │ +001540f0: 6554 7970 653c 2f73 7061 6e3e 2667 743b eType> │ │ │ +00154100: 3c2f 6469 763e 0a3c 2f64 6976 3e3c 212d
      .
    < │ │ │ +00154120: 2f64 6976 3e3c 703e f09f 949d 203c 6120 /div>

    .... Back to │ │ │ +00154140: 2074 6162 6c65 206f 6620 636f 6e74 656e table of conten │ │ │ +00154150: 7473 3c2f 613e 3c2f 703e 0a3c 6833 3e3c ts

    .

    < │ │ │ +00154160: 6120 636c 6173 733d 2261 6e63 686f 7222 a class="anchor" │ │ │ +00154170: 2069 643d 2265 7861 6d70 6c65 3132 223e id="example12"> │ │ │ +00154180: 3c2f 613e 0a45 7861 6d70 6c65 3c2f 6833 .Example

    .

    The use of │ │ │ +001541a0: 6469 7265 6374 6976 6573 2069 7320 6265 directives is be │ │ │ +001541b0: 7374 2069 6c6c 7573 7472 6174 6564 2077 st illustrated w │ │ │ +001541c0: 6974 6820 616e 2065 7861 6d70 6c65 2e20 ith an example. │ │ │ +001541d0: 5468 6520 6578 616d 706c 6520 7573 6573 The example uses │ │ │ +001541e0: 2061 2068 7970 6f74 6865 7469 6361 6c20 a hypothetical │ │ │ +001541f0: 7374 6f63 6b20 7175 6f74 6520 7365 7276 stock quote serv │ │ │ +00154200: 6963 6520 616e 6420 6578 6368 616e 6765 ice and exchange │ │ │ +00154210: 2072 6174 6520 7365 7276 6963 652c 2061 rate service, a │ │ │ +00154220: 6374 7561 6c20 7365 7276 6963 6573 2073 ctual services s │ │ │ +00154230: 7563 6820 6173 2074 6865 7365 2061 7265 uch as these are │ │ │ +00154240: 2061 7661 696c 6162 6c65 2066 6f72 2066 available for f │ │ │ +00154250: 7265 6520 6f6e 2074 6865 2077 6562 2e3c ree on the web.< │ │ │ +00154260: 2f70 3e0a 3c64 6976 2063 6c61 7373 3d22 /p>.

    //gsoap ns1 se │ │ │ +001542b0: 7276 6963 6520 6e61 6d65 7370 6163 653a rvice namespace: │ │ │ +001542c0: 2020 7572 6e3a 4765 7451 756f 7465 203c urn:GetQuote < │ │ │ +001542d0: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    .< │ │ │ +001542f0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +00154300: 6f72 6474 7970 6522 3e69 6e74 3c2f 7370 ordtype">int ns1__getQuot │ │ │ +00154320: 6528 3c73 7061 6e20 636c 6173 733d 226b e(char │ │ │ +00154340: 3c2f 7370 616e 3e20 2a73 796d 626f 6c2c *symbol, │ │ │ +00154350: 203c 7370 616e 2063 6c61 7373 3d22 6b65 float │ │ │ +00154370: 3c2f 7370 616e 3e20 2661 6d70 3b72 6573 &res │ │ │ +00154380: 756c 7429 3b20 3c2f 6469 763e 0a3c 6469 ult);
    . │ │ │ +001543a0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    / │ │ │ +001543d0: 2f67 736f 6170 206e 7332 2073 6572 7669 /gsoap ns2 servi │ │ │ +001543e0: 6365 206e 616d 6573 7061 6365 3a20 2075 ce namespace: u │ │ │ +001543f0: 726e 3a43 7572 7265 6e63 7945 7863 6861 rn:CurrencyExcha │ │ │ +00154400: 6e67 6520 3c2f 7370 616e 3e3c 2f64 6976 nge
    .
    in │ │ │ +00154440: 743c 2f73 7061 6e3e 206e 7332 5f5f 6765 t ns2__ge │ │ │ +00154450: 7452 6174 6528 3c73 7061 6e20 636c 6173 tRate( │ │ │ +00154470: 6368 6172 3c2f 7370 616e 3e20 2a63 6f75 char *cou │ │ │ +00154480: 6e74 7279 312c 203c 7370 616e 2063 6c61 ntry1, char *co │ │ │ +001544b0: 756e 7472 7932 2c20 3c73 7061 6e20 636c untry2, float & │ │ │ +001544e0: 616d 703b 7265 7375 6c74 293b 203c 2f64 amp;result); .
    . │ │ │ +00154520: 3c73 7061 6e20 636c 6173 733d 2263 6f6d //gsoap ns │ │ │ +00154540: 3320 7365 7276 6963 6520 6e61 6d65 3a20 3 service name: │ │ │ +00154550: 2020 2020 2020 7175 6f74 6578 203c 2f73 quotex
    .
    //gsoap ns3 s │ │ │ +001545a0: 6572 7669 6365 2073 7479 6c65 3a20 2020 ervice style: │ │ │ +001545b0: 2020 2072 7063 203c 2f73 7061 6e3e 3c2f rpc .
    //g │ │ │ +001545f0: 736f 6170 206e 7333 2073 6572 7669 6365 soap ns3 service │ │ │ +00154600: 2065 6e63 6f64 696e 673a 2020 2065 6e63 encoding: enc │ │ │ +00154610: 6f64 6564 203c 2f73 7061 6e3e 3c2f 6469 oded .
    //gso │ │ │ +00154650: 6170 206e 7333 2073 6572 7669 6365 2070 ap ns3 service p │ │ │ +00154660: 6f72 743a 2020 2020 2020 2068 7474 703a ort: http: │ │ │ +00154670: 2f2f 7777 772e 6d79 646f 6d61 696e 2e63 //www.mydomain.c │ │ │ +00154680: 6f6d 2f71 756f 7465 782e 6367 6920 3c2f om/quotex.cgi
    .
    //gsoap ns3 │ │ │ +001546d0: 7365 7276 6963 6520 6e61 6d65 7370 6163 service namespac │ │ │ +001546e0: 653a 2020 7572 6e3a 7175 6f74 6578 203c e: urn:quotex < │ │ │ +001546f0: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    .< │ │ │ +00154710: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +00154720: 6f72 6474 7970 6522 3e69 6e74 3c2f 7370 ordtype">int ns3__getQuot │ │ │ +00154740: 6528 3c73 7061 6e20 636c 6173 733d 226b e(char │ │ │ +00154760: 3c2f 7370 616e 3e20 2a73 796d 626f 6c2c *symbol, │ │ │ +00154770: 203c 7370 616e 2063 6c61 7373 3d22 6b65 char< │ │ │ +00154790: 2f73 7061 6e3e 202a 636f 756e 7472 792c /span> *country, │ │ │ +001547a0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 float │ │ │ +001547c0: 3c2f 7370 616e 3e20 2661 6d70 3b72 6573 &res │ │ │ +001547d0: 756c 7429 3b3c 2f64 6976 3e0a 3c2f 6469 ult);
    .

    The quotex.h example │ │ │ +00154820: 2069 7320 6120 6e65 7720 5765 6220 5365 is a new Web Se │ │ │ +00154830: 7276 6963 6520 6372 6561 7465 6420 6279 rvice created by │ │ │ +00154840: 2063 6f6d 6269 6e69 6e67 2074 776f 2065 combining two e │ │ │ +00154850: 7869 7374 696e 6720 5765 6220 5365 7276 xisting Web Serv │ │ │ +00154860: 6963 6573 3a20 6120 5374 6f63 6b20 5175 ices: a Stock Qu │ │ │ +00154870: 6f74 6520 7365 7276 6963 6520 616e 6420 ote service and │ │ │ +00154880: 6120 4375 7272 656e 6379 2045 7863 6861 a Currency Excha │ │ │ +00154890: 6e67 6520 7365 7276 6963 652e 3c2f 703e nge service.

    │ │ │ +001548a0: 0a3c 703e 5468 6520 6e61 6d65 7370 6163 .

    The namespac │ │ │ +001548b0: 6520 7072 6566 6978 203c 636f 6465 3e6e e prefix n │ │ │ +001548c0: 7333 3c2f 636f 6465 3e20 6973 2075 7365 s3 is use │ │ │ +001548d0: 6420 666f 7220 7468 6520 6e65 7720 3c63 d for the new quotex Web Service wi │ │ │ +00154900: 7468 206e 616d 6573 7061 6365 2055 5249 th namespace URI │ │ │ +00154910: 203c 656d 3e3c 636f 6465 3e75 726e 3a71 urn:q │ │ │ +00154920: 756f 7465 783c 2f63 6f64 653e 3c2f 656d uotex, service name │ │ │ +00154940: 3c63 6f64 653e 7175 6f74 6578 3c2f 636f quotex, and endpoin │ │ │ +00154960: 7420 706f 7274 203c 656d 3e3c 636f 6465 t port ht │ │ │ +001549a0: 7470 3a2f 2f77 7777 2e6d 7964 6f6d 6169 tp://www.mydomai │ │ │ +001549b0: 6e2e 636f 6d2f 7175 6f74 6578 2e63 6769 n.com/quotex.cgi │ │ │ +001549c0: 3c2f 613e 3c2f 636f 6465 3e3c 2f65 6d3e │ │ │ +001549d0: 2e3c 2f70 3e0a 3c70 3e53 696e 6365 2074 .

    .

    Since t │ │ │ +001549e0: 6865 206e 6577 2057 6562 2053 6572 7669 he new Web Servi │ │ │ +001549f0: 6365 2069 6e76 6f6b 6573 2074 6865 203c ce invokes the < │ │ │ +00154a00: 636f 6465 3e6e 7331 5f5f 6765 7451 756f code>ns1__getQuo │ │ │ +00154a10: 7465 3c2f 636f 6465 3e20 616e 6420 3c63 te and ns2__getRate │ │ │ +00154a30: 3c2f 636f 6465 3e20 7365 7276 6963 6520 service │ │ │ +00154a40: 6f70 6572 6174 696f 6e73 2c20 7468 6520 operations, the │ │ │ +00154a50: 7365 7276 6963 6520 6e61 6d65 7370 6163 service namespac │ │ │ +00154a60: 6573 2061 6e64 206f 7468 6572 2064 6574 es and other det │ │ │ +00154a70: 6169 6c73 2073 7563 6820 6173 2073 7479 ails such as sty │ │ │ +00154a80: 6c65 2061 6e64 2065 6e63 6f64 696e 6720 le and encoding │ │ │ +00154a90: 6f66 2074 6865 7365 206d 6574 686f 6473 of these methods │ │ │ +00154aa0: 2061 7265 2067 6976 656e 2062 7920 6469 are given by di │ │ │ +00154ab0: 7265 6374 6976 6573 2e20 4166 7465 7220 rectives. After │ │ │ +00154ac0: 696e 766f 6b69 6e67 2074 6865 2073 6f61 invoking the soa │ │ │ +00154ad0: 7063 7070 3220 746f 6f6c 206f 6e20 7468 pcpp2 tool on th │ │ │ +00154ae0: 6520 3c65 6d3e 3c63 6f64 653e 7175 6f74 e quot │ │ │ +00154af0: 6578 2e68 3c2f 636f 6465 3e3c 2f65 6d3e ex.h │ │ │ +00154b00: 2068 6561 6465 7220 6669 6c65 3a20 3c2f header file:

     soapcpp
    │ │ │ +00154b30: 3220 7175 6f74 6578 2e68 0a3c 2f70 7265  2 quotex.h.

    the WSDL of │ │ │ +00154b50: 2074 6865 206e 6577 203c 636f 6465 3e71 the new q │ │ │ +00154b60: 756f 7465 783c 2f63 6f64 653e 2057 6562 uotex Web │ │ │ +00154b70: 2053 6572 7669 6365 2069 7320 7361 7665 Service is save │ │ │ +00154b80: 6420 6173 203c 656d 3e3c 636f 6465 3e71 d as q │ │ │ +00154b90: 756f 7465 782e 7773 646c 3c2f 636f 6465 uotex.wsdl. Since th │ │ │ +00154bb0: 6520 7365 7276 6963 6520 6e61 6d65 2c20 e service name, │ │ │ +00154bc0: 656e 6470 6f69 6e74 2070 6f72 742c 2061 endpoint port, a │ │ │ +00154bd0: 6e64 206e 616d 6573 7061 6365 2055 5249 nd namespace URI │ │ │ +00154be0: 2077 6572 6520 7072 6f76 6964 6564 2069 were provided i │ │ │ +00154bf0: 6e20 7468 6520 6865 6164 6572 2066 696c n the header fil │ │ │ +00154c00: 652c 2074 6865 2067 656e 6572 6174 6564 e, the generated │ │ │ +00154c10: 2057 5344 4c20 6669 6c65 2063 616e 2062 WSDL file can b │ │ │ +00154c20: 6520 7075 626c 6973 6865 6420 746f 6765 e published toge │ │ │ +00154c30: 7468 6572 2077 6974 6820 7468 6520 636f ther with the co │ │ │ +00154c40: 6d70 696c 6564 2057 6562 2053 6572 7669 mpiled Web Servi │ │ │ +00154c50: 6365 2069 6e73 7461 6c6c 6564 2061 7320 ce installed as │ │ │ +00154c60: 6120 4347 4920 6170 706c 6963 6174 696f a CGI applicatio │ │ │ +00154c70: 6e2e 3c2f 703e 0a3c 703e 5468 6520 6e61 n.

    .

    The na │ │ │ +00154c80: 6d65 7370 6163 6520 6d61 7070 696e 6720 mespace mapping │ │ │ +00154c90: 7461 626c 6520 666f 7220 7468 6520 3c65 table for the quotex.c │ │ │ +00154cb0: 7070 3c2f 636f 6465 3e3c 2f65 6d3e 2057 pp W │ │ │ +00154cc0: 6562 2053 6572 7669 6365 2069 6d70 6c65 eb Service imple │ │ │ +00154cd0: 6d65 6e74 6174 696f 6e20 6973 2073 6176 mentation is sav │ │ │ +00154ce0: 6564 2061 7320 3c65 6d3e 3c63 6f64 653e ed as │ │ │ +00154cf0: 7175 6f74 6578 2e6e 736d 6170 3c2f 636f quotex.nsmap. This f │ │ │ +00154d10: 696c 6520 6361 6e20 6265 2064 6972 6563 ile can be direc │ │ │ +00154d20: 746c 7920 696e 636c 7564 6564 2069 6e20 tly included in │ │ │ +00154d30: 3c65 6d3e 3c63 6f64 653e 7175 6f74 6578 quotex │ │ │ +00154d40: 2e63 7070 3c2f 636f 6465 3e3c 2f65 6d3e .cpp │ │ │ +00154d50: 2069 6e73 7465 6164 206f 6620 7370 6563 instead of spec │ │ │ +00154d60: 6966 6965 6420 6279 2068 616e 6420 696e ified by hand in │ │ │ +00154d70: 2074 6865 2073 6f75 7263 6520 6f66 203c the source of < │ │ │ +00154d80: 656d 3e3c 636f 6465 3e71 756f 7465 782e em>quotex. │ │ │ +00154d90: 6370 703c 2f63 6f64 653e 3c2f 656d 3e2e cpp. │ │ │ +00154da0: 3c2f 703e 0a3c 703e f09f 949d 203c 6120

    .

    .... Back to │ │ │ +00154dc0: 2074 6162 6c65 206f 6620 636f 6e74 656e table of conten │ │ │ +00154dd0: 7473 3c2f 613e 3c2f 703e 0a3c 6832 3e3c ts

    .

    < │ │ │ +00154de0: 6120 636c 6173 733d 2261 6e63 686f 7222 a class="anchor" │ │ │ +00154df0: 2069 643d 2274 7261 6e73 6965 6e74 223e id="transient"> │ │ │ +00154e00: 3c2f 613e 0a54 7261 6e73 6965 6e74 2064 .Transient d │ │ │ +00154e10: 6174 6120 7479 7065 733c 2f68 323e 0a3c ata types

    .< │ │ │ +00154e20: 703e 5468 6572 6520 6172 6520 7369 7475 p>There are situ │ │ │ +00154e30: 6174 696f 6e73 2077 6865 6e20 6365 7274 ations when cert │ │ │ +00154e40: 6169 6e20 7479 7065 7320 6861 7665 2074 ain types have t │ │ │ +00154e50: 6f20 6265 2075 7365 6420 696e 2061 6e20 o be used in an │ │ │ +00154e60: 696e 7465 7266 6163 6520 6865 6164 6572 interface header │ │ │ +00154e70: 2066 696c 652c 2062 7574 2074 6865 2074 file, but the t │ │ │ +00154e80: 7970 6573 2061 7265 206e 6f74 2073 6572 ypes are not ser │ │ │ +00154e90: 6961 6c69 7a61 626c 6520 616e 6420 7468 ializable and th │ │ │ +00154ea0: 6572 6566 6f72 6520 6861 7665 2074 6f20 erefore have to │ │ │ +00154eb0: 6265 2022 696e 7669 7369 626c 6522 2074 be "invisible" t │ │ │ +00154ec0: 6f20 7468 6520 736f 6170 6370 7032 2074 o the soapcpp2 t │ │ │ +00154ed0: 6f6f 6c2e 2054 6865 7365 2074 7970 6573 ool. These types │ │ │ +00154ee0: 2061 7265 2063 616c 6c65 6420 7472 616e are called tran │ │ │ +00154ef0: 7369 656e 742e 3c2f 703e 0a3c 703e 5468 sient.

    .

    Th │ │ │ +00154f00: 6973 2066 6561 7475 7265 2069 7320 7573 is feature is us │ │ │ +00154f10: 6566 756c 2077 6865 6e20 6120 6c69 6272 eful when a libr │ │ │ +00154f20: 6172 7920 7479 7065 2069 7320 7573 6564 ary type is used │ │ │ +00154f30: 2069 6e20 7468 6520 696e 7465 7266 6163 in the interfac │ │ │ +00154f40: 6520 6865 6164 6572 2066 696c 6520 6173 e header file as │ │ │ +00154f50: 2070 6172 7420 6f66 2061 2073 7472 7563 part of a struc │ │ │ +00154f60: 7420 6f72 2063 6c61 7373 2c20 666f 7220 t or class, for │ │ │ +00154f70: 6578 616d 706c 6520 7468 6520 3c63 6f64 example the FILE ty │ │ │ +00154f90: 7065 206f 7220 3c63 6f64 653e 7374 643a pe or std: │ │ │ +00154fa0: 3a6f 7374 7265 616d 3c2f 636f 6465 3e20 :ostream │ │ │ +00154fb0: 7468 6174 2061 7265 2063 6c65 6172 6c79 that are clearly │ │ │ +00154fc0: 206e 6f74 2073 6572 6961 6c69 7a61 626c not serializabl │ │ │ +00154fd0: 652e 2049 6620 7468 6573 6520 7479 7065 e. If these type │ │ │ +00154fe0: 7320 6172 6520 696e 7472 6f64 7563 6564 s are introduced │ │ │ +00154ff0: 2069 6e20 616e 2069 6e74 6572 6661 6365 in an interface │ │ │ +00155000: 2068 6561 6465 7220 6669 6c65 2074 6865 header file the │ │ │ +00155010: 6e20 7468 6573 6520 7479 7065 7320 6d75 n these types mu │ │ │ +00155020: 7374 2062 6520 6465 636c 6172 6564 2074 st be declared t │ │ │ +00155030: 7261 6e73 6965 6e74 2e20 4f74 6865 7277 ransient. Otherw │ │ │ +00155040: 6973 652c 2073 6f61 7063 7070 3220 7769 ise, soapcpp2 wi │ │ │ +00155050: 6c6c 2074 6872 6f77 2061 6e20 6572 726f ll throw an erro │ │ │ +00155060: 722e 3c2f 703e 0a3c 703e 546f 2064 6563 r.

    .

    To dec │ │ │ +00155070: 6c61 7265 2061 2074 7261 6e73 6965 6e74 lare a transient │ │ │ +00155080: 2074 7970 6520 7573 6520 3c63 6f64 653e type use │ │ │ +00155090: 6578 7465 726e 3c2f 636f 6465 3e2e 2046 extern. F │ │ │ +001550a0: 6f72 2065 7861 6d70 6c65 3a3c 2f70 3e0a or example:

    . │ │ │ +001550b0: 3c64 6976 2063 6c61 7373 3d22 6672 6167
    ex │ │ │ +001550f0: 7465 726e 3c2f 7370 616e 3e20 3c73 7061 tern class F │ │ │ +00155120: 494c 453b 3c2f 6469 763e 0a3c 2f64 6976 ILE;
    .
    │ │ │ +001553c0: 3c70 3e4f 6e6c 7920 7468 6520 3c63 6f64

    Only the name me │ │ │ +001553e0: 6d62 6572 2069 7320 7365 7269 616c 697a mber is serializ │ │ │ +001553f0: 6564 206f 6620 3c63 6f64 653e 6e73 5f5f ed of ns__ │ │ │ +00155400: 7265 636f 7264 3c2f 636f 6465 3e2e 3c2f record..

    Another ex │ │ │ +00155420: 616d 706c 653a 3c2f 703e 0a3c 6469 7620 ample:

    .
    extern< │ │ │ +00155470: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> cla │ │ │ +00155490: 7373 203c 2f73 7061 6e3e 7374 643a 3a6f ss std::o │ │ │ +001554a0: 7374 7265 616d 3b20 3c73 7061 6e20 636c stream; // │ │ │ +001554c0: 2073 7464 3a3a 6f73 7472 6561 6d20 6361 std::ostream ca │ │ │ +001554d0: 6e26 2333 393b 7420 6265 2073 6572 6961 n't be seria │ │ │ +001554e0: 6c69 7a65 642c 2062 7574 206e 6565 6420 lized, but need │ │ │ +001554f0: 746f 2062 6520 6465 636c 6172 6564 3c2f to be declared
    .
    class ns__myClass .
    { pu │ │ │ +00155580: 626c 6963 3c2f 7370 616e 3e3a 3c2f 6469 blic:.
    v │ │ │ +001555c0: 6972 7475 616c 3c2f 7370 616e 3e20 3c73 irtual void print(std::o │ │ │ +00155600: 7374 7265 616d 2026 616d 703b 7329 203c stream &s) < │ │ │ +00155610: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +00155620: 6f72 6422 3e63 6f6e 7374 3c2f 7370 616e ord">const; // need │ │ │ +00155650: 206f 7374 7265 616d 2068 6572 6520 3c2f ostream here
    .
    │ │ │ +00155680: 2020 2e2e 2e20 3c73 7061 6e20 636c 6173 ... //
    .
    }; │ │ │ +001556c0: 3c2f 6469 763e 0a3c 2f64 6976 3e3c 212d
    .

    In other cases │ │ │ +001556f0: 7765 2064 6f20 7761 6e74 2074 6f20 6465 we do want to de │ │ │ +00155700: 636c 6172 6520 6120 7479 7065 2074 6861 clare a type tha │ │ │ +00155710: 7420 736f 6170 6370 7032 2073 686f 756c t soapcpp2 shoul │ │ │ +00155720: 6420 636f 7079 2069 6e74 6f20 3c65 6d3e d copy into │ │ │ +00155730: 3c63 6f64 653e 736f 6170 5374 7562 2e68 soapStub.h │ │ │ +00155740: 3c2f 636f 6465 3e3c 2f65 6d3e 2066 6f72 for │ │ │ +00155750: 2074 6865 2061 7070 6c69 6361 7469 6f6e the application │ │ │ +00155760: 2073 6f75 7263 6520 636f 6465 2c20 6275 source code, bu │ │ │ +00155770: 7420 7768 6963 6820 7368 6f75 6c64 206e t which should n │ │ │ +00155780: 6f74 2062 6520 7365 7269 616c 697a 6162 ot be serializab │ │ │ +00155790: 6c65 2e20 5765 2063 616e 2075 7365 203c le. We can use < │ │ │ +001557a0: 636f 6465 3e65 7874 6572 6e3c 2f63 6f64 code>extern for this or p │ │ │ +001557c0: 7574 2074 6865 2064 6563 6c61 7261 7469 ut the declarati │ │ │ +001557d0: 6f6e 2069 6e20 3c63 6f64 653e 5b3c 2f63 on in [ and ] │ │ │ +001557f0: 3c2f 636f 6465 3e20 6272 6163 6b65 7473 brackets │ │ │ +00155800: 3a3c 2f70 3e0a 3c64 6976 2063 6c61 7373 :

    .
    [ │ │ │ +00155830: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    class ns │ │ │ +00155870: 5f5f 6d79 4261 7365 203c 7370 616e 2063 __myBase / │ │ │ +00155890: 2f20 6261 7365 2063 6c61 7373 206e 6565 / base class nee │ │ │ +001558a0: 6420 6e6f 7420 6265 2073 6572 6961 6c69 d not be seriali │ │ │ +001558b0: 7a61 626c 653c 2f73 7061 6e3e 3c2f 6469 zable.
    {
    .< │ │ │ +001558e0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +001558f0: 3e20 2020 202e 2e2e 203c 7370 616e 2063 > ... / │ │ │ +00155910: 2f20 6d65 6d62 6572 733c 2f73 7061 6e3e / members │ │ │ +00155920: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    }; .
    ]
    . │ │ │ +00155960: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    class ns__myDeriv │ │ │ +001559a0: 6564 203a 206e 735f 5f6d 7942 6173 6520 ed : ns__myBase │ │ │ +001559b0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    {
    │ │ │ +001559d0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    ... / │ │ │ +00155a00: 2f20 6d65 6d62 6572 733c 2f73 7061 6e3e / members │ │ │ +00155a10: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    }; .

    We │ │ │ +00155a50: 6361 6e20 7573 6520 3c63 6f64 653e 5b3c can use [< │ │ │ +00155a60: 2f63 6f64 653e 2061 6e64 203c 636f 6465 /code> and ] bracke │ │ │ +00155a80: 7473 2066 6f72 2070 6172 7473 206f 6620 ts for parts of │ │ │ +00155a90: 7468 6520 636f 6465 2c20 666f 7220 6578 the code, for ex │ │ │ +00155aa0: 616d 706c 6520 746f 206d 616b 6520 7365 ample to make se │ │ │ +00155ab0: 7665 7261 6c20 636c 6173 7320 6d65 6d62 veral class memb │ │ │ +00155ac0: 6572 7320 7472 616e 7369 656e 743a 3c2f ers transient:.

    [ typedef int< │ │ │ +00155b40: 2f73 7061 6e3e 2074 7261 6e73 6965 6e74 /span> transient │ │ │ +00155b50: 496e 743b 205d 203c 2f64 6976 3e0a 3c64 Int; ]
    . │ │ │ +00155b70: 3c73 7061 6e20 636c 6173 733d 226b 6579 class ns__myClass < │ │ │ +00155ba0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    {
    . │ │ │ +00155bc0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    in │ │ │ +00155bf0: 743c 2f73 7061 6e3e 2061 3b20 3c73 7061 t a; // will be ser │ │ │ +00155c20: 6961 6c69 7a65 6420 3c2f 7370 616e 3e3c ialized < │ │ │ +00155c30: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    [ .
    int b; < │ │ │ +00155c90: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ +00155ca0: 656e 7422 3e2f 2f20 7472 616e 7369 656e ent">// transien │ │ │ +00155cb0: 7420 6d65 6d62 6572 203c 2f73 7061 6e3e t member │ │ │ +00155cc0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    char │ │ │ +00155d00: 2073 5b32 3536 5d3b 203c 7370 616e 2063 s[256]; / │ │ │ +00155d20: 2f20 7472 616e 7369 656e 7420 6d65 6d62 / transient memb │ │ │ +00155d30: 6572 203c 2f73 7061 6e3e 3c2f 6469 763e er
    │ │ │ +00155d40: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    ]
    .< │ │ │ +00155d60: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +00155d70: 3e20 203c 7370 616e 2063 6c61 7373 3d22 > extern< │ │ │ +00155d90: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> float d; │ │ │ +00155dc0: 203c 7370 616e 2063 6c61 7373 3d22 636f // transi │ │ │ +00155de0: 656e 7420 7479 7065 2066 6c6f 6174 2061 ent type float a │ │ │ +00155df0: 6e64 206d 656d 6265 723c 2f73 7061 6e3e nd member │ │ │ +00155e00: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    char │ │ │ +00155e40: 202a 743b 203c 7370 616e 2063 6c61 7373 *t; // wi │ │ │ +00155e60: 6c6c 2062 6520 7365 7269 616c 697a 6564 ll be serialized │ │ │ +00155e70: 203c 2f73 7061 6e3e 3c2f 6469 763e 0a3c
    .< │ │ │ +00155e80: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +00155e90: 3e20 2074 7261 6e73 6965 6e74 496e 7420 > transientInt │ │ │ +00155ea0: 2a6e 3b20 3c73 7061 6e20 636c 6173 733d *n; // tra │ │ │ +00155ec0: 6e73 6965 6e74 2074 7970 6520 696e 7420 nsient type int │ │ │ +00155ed0: 616e 6420 6d65 6d62 6572 203c 2f73 7061 and member
    .
    [ < │ │ │ +00155f00: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    │ │ │ +00155f30: 7669 7274 7561 6c3c 2f73 7061 6e3e 203c virtual < │ │ │ +00155f40: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +00155f50: 6f72 6474 7970 6522 3e76 6f69 643c 2f73 ordtype">void method(char buf[1024]); // does not │ │ │ +00155fc0: 6372 6561 7465 2061 2063 6861 725b 3130 create a char[10 │ │ │ +00155fd0: 3234 5d20 7365 7269 616c 697a 6572 203c 24] serializer < │ │ │ +00155fe0: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    . │ │ │ +00156000: 205d 2020 3c2f 6469 763e 0a3c 6469 7620 ]
    .
    };< │ │ │ +00156020: 2f64 6976 3e0a 3c2f 6469 763e 3c21 2d2d /div>.

    │ │ │ +00156040: 496e 2074 6869 7320 6578 616d 706c 652c In this example, │ │ │ +00156050: 203c 636f 6465 3e6e 735f 5f6d 7943 6c61 ns__myCla │ │ │ +00156060: 7373 3c2f 636f 6465 3e20 6861 7320 7468 ss has th │ │ │ +00156070: 7265 6520 7472 616e 7369 656e 7420 6d65 ree transient me │ │ │ +00156080: 6d62 6572 733a 203c 636f 6465 3e62 3c2f mbers: b, s, and n which │ │ │ +001560c0: 7769 6c6c 206e 6f74 2062 6520 7365 7269 will not be seri │ │ │ +001560d0: 616c 697a 6564 2e20 4d65 6d62 6572 203c alized. Member < │ │ │ +001560e0: 636f 6465 3e6e 3c2f 636f 6465 3e20 6973 code>n is │ │ │ +001560f0: 2074 7261 6e73 6965 6e74 2062 6563 6175 transient becau │ │ │ +00156100: 7365 2074 6865 2074 7970 6520 6973 2064 se the type is d │ │ │ +00156110: 6563 6c61 7265 6420 7769 7468 696e 2061 eclared within a │ │ │ +00156120: 2074 7261 6e73 6965 6e74 2062 6c6f 636b transient block │ │ │ +00156130: 2e20 506f 696e 7465 7273 2c20 7265 6665 . Pointers, refe │ │ │ +00156140: 7265 6e63 6573 2c20 616e 6420 6172 7261 rences, and arra │ │ │ +00156150: 7973 206f 6620 7472 616e 7369 656e 7420 ys of transient │ │ │ +00156160: 7479 7065 7320 6172 6520 7472 616e 7369 types are transi │ │ │ +00156170: 656e 742e 2054 6865 2073 696e 676c 6520 ent. The single │ │ │ +00156180: 636c 6173 7320 6d65 7468 6f64 2069 7320 class method is │ │ │ +00156190: 656e 6361 7073 756c 6174 6564 2077 6974 encapsulated wit │ │ │ +001561a0: 6869 6e20 3c63 6f64 653e 5b3c 2f63 6f64 hin [ and ] to prevent │ │ │ +001561d0: 2073 6f61 7063 7070 3220 6672 6f6d 2063 soapcpp2 from c │ │ │ +001561e0: 7265 6174 696e 6720 7365 7269 616c 697a reating serializ │ │ │ +001561f0: 6572 7320 666f 7220 7468 6520 3c63 6f64 ers for the char[1024] type.

    .

    We also use [ and │ │ │ +00156240: 3c63 6f64 653e 5d3c 2f63 6f64 653e 2062 ] b │ │ │ +00156250: 7261 636b 6574 7320 746f 2069 6e74 726f rackets to intro │ │ │ +00156260: 6475 6365 2061 2074 7261 6e73 6965 6e74 duce a transient │ │ │ +00156270: 2069 6e74 6567 6572 2074 7970 6520 3c63 integer type transientInt │ │ │ +00156290: 3c2f 636f 6465 3e20 7573 696e 6720 6120 using a │ │ │ +001562a0: 7479 7065 6465 662e 2057 6520 6361 6e6e typedef. We cann │ │ │ +001562b0: 6f74 2075 7365 203c 636f 6465 3e65 7874 ot use ext │ │ │ +001562c0: 6572 6e3c 2f63 6f64 653e 2077 6974 6820 ern with │ │ │ +001562d0: 3c63 6f64 653e 7479 7065 6465 663c 2f63 typedef because thi │ │ │ +001562f0: 7320 636f 6e73 7472 7563 7420 6973 2072 s construct is r │ │ │ +00156300: 6573 6572 7665 6420 666f 7220 6375 7374 eserved for cust │ │ │ +00156310: 6f6d 2073 6572 6961 6c69 7a65 7273 2e3c om serializers.< │ │ │ +00156320: 2f70 3e0a 3c70 3ef0 9f94 9d20 3c61 2068 /p>.

    .... Back to │ │ │ +00156340: 7461 626c 6520 6f66 2063 6f6e 7465 6e74 table of content │ │ │ +00156350: 733c 2f61 3e3c 2f70 3e0a 3c68 323e 3c61 s

    .

    .Serialization │ │ │ +00156390: 2022 6173 2069 7322 206f 6620 766f 6c61 "as is" of vola │ │ │ +001563a0: 7469 6c65 2064 6174 6120 7479 7065 733c tile data types< │ │ │ +001563b0: 2f68 323e 0a3c 703e 5479 7065 7320 6465 /h2>.

    Types de │ │ │ +001563c0: 636c 6172 6564 203c 636f 6465 3e76 6f6c clared vol │ │ │ +001563d0: 6174 696c 653c 2f63 6f64 653e 2069 6e20 atile in │ │ │ +001563e0: 616e 2069 6e74 6572 6661 6365 2068 6561 an interface hea │ │ │ +001563f0: 6465 7220 6669 6c65 2061 7265 2073 6572 der file are ser │ │ │ +00156400: 6961 6c69 7a61 626c 6520 6275 7420 6e6f ializable but no │ │ │ +00156410: 7420 636f 7069 6564 2062 7920 736f 6170 t copied by soap │ │ │ +00156420: 6370 7032 2074 6f20 3c65 6d3e 3c63 6f64 cpp2 to soapStub.h. These │ │ │ +00156450: 7479 7065 7320 6172 6520 7479 7069 6361 types are typica │ │ │ +00156460: 6c6c 7920 6c69 6272 6172 7920 7479 7065 lly library type │ │ │ +00156470: 7320 7468 6174 2061 7265 2069 6e63 6c75 s that are inclu │ │ │ +00156480: 6465 6420 696e 2074 6865 2073 6f75 7263 ded in the sourc │ │ │ +00156490: 6520 636f 6465 2061 6e64 2073 686f 756c e code and shoul │ │ │ +001564a0: 6420 6e6f 7420 6265 2072 6564 6566 696e d not be redefin │ │ │ +001564b0: 6564 2069 6e20 7468 6520 6170 706c 6963 ed in the applic │ │ │ +001564c0: 6174 696f 6e20 736f 7572 6365 2063 6f64 ation source cod │ │ │ +001564d0: 652e 2057 6520 7761 6e74 2074 6f20 7365 e. We want to se │ │ │ +001564e0: 7269 616c 697a 6520 7468 6573 6520 6c69 rialize these li │ │ │ +001564f0: 6272 6172 7920 7479 7065 7320 2261 7320 brary types "as │ │ │ +00156500: 6973 2220 7769 7468 6f75 7420 7265 6465 is" without rede │ │ │ +00156510: 6669 6e69 6e67 2074 6865 6d2e 3c2f 703e fining them.

    │ │ │ +00156520: 0a3c 703e 436f 6e73 6964 6572 2066 6f72 .

    Consider for │ │ │ +00156530: 2065 7861 6d70 6c65 203c 636f 6465 3e73 example s │ │ │ +00156540: 7472 7563 7420 746d 3c2f 636f 6465 3e2c truct tm, │ │ │ +00156550: 2064 6563 6c61 7265 6420 696e 203c 656d declared in time.h. The s │ │ │ +00156580: 7472 7563 7475 7265 206d 6179 2061 6374 tructure may act │ │ │ +00156590: 7561 6c6c 7920 7661 7279 2062 6574 7765 ually vary betwe │ │ │ +001565a0: 656e 2070 6c61 7466 6f72 6d73 2c20 6275 en platforms, bu │ │ │ +001565b0: 7420 7468 6520 3c63 6f64 653e 746d 3c2f t the tm structure │ │ │ +001565d0: 696e 636c 7564 6573 2061 7420 6c65 6173 includes at leas │ │ │ +001565e0: 7420 7468 6520 666f 6c6c 6f77 696e 6720 t the following │ │ │ +001565f0: 6d65 6d62 6572 7320 6173 2064 6563 6c61 members as decla │ │ │ +00156600: 7265 6420 696e 2074 6865 2066 6f6c 6c6f red in the follo │ │ │ +00156610: 7769 6e67 2069 6e74 6572 6661 6365 2068 wing interface h │ │ │ +00156620: 6561 6465 7220 6669 6c65 2066 6f72 2073 eader file for s │ │ │ +00156630: 6f61 7063 7070 323a 3c2f 703e 0a3c 6469 oapcpp2:

    .
    │ │ │ +00156680: 2369 6e63 6c75 6465 2026 6c74 3b74 696d #include <tim │ │ │ +00156690: 652e 6826 6774 3b3c 2f73 7061 6e3e 3c2f e.h>.
    vol │ │ │ +001566d0: 6174 696c 653c 2f73 7061 6e3e 203c 7370 atile struct tm
    .
    {.
    int │ │ │ +00156760: 746d 5f73 6563 3b20 2020 2020 2020 2020 tm_sec; │ │ │ +00156770: 3c73 7061 6e20 636c 6173 733d 2263 6f6d /* seconds │ │ │ +00156790: 2028 3020 2d20 3630 2920 2a2f 3c2f 7370 (0 - 60) */
    .
    │ │ │ +001567c0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 int tm_min; │ │ │ +001567f0: 2020 2020 2020 3c73 7061 6e20 636c 6173 /* m │ │ │ +00156810: 696e 7574 6573 2028 3020 2d20 3539 2920 inutes (0 - 59) │ │ │ +00156820: 2a2f 3c2f 7370 616e 3e20 3c2f 6469 763e */
    │ │ │ +00156830: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    int tm_h │ │ │ +00156870: 6f75 723b 2020 2020 2020 2020 3c73 7061 our; /* hours (0 - │ │ │ +001568a0: 3233 2920 2a2f 3c2f 7370 616e 3e20 3c2f 23) */ .
    int │ │ │ +001568f0: 746d 5f6d 6461 793b 2020 2020 2020 2020 tm_mday; │ │ │ +00156900: 3c73 7061 6e20 636c 6173 733d 2263 6f6d /* day of │ │ │ +00156920: 6d6f 6e74 6820 2831 202d 2033 3129 202a month (1 - 31) * │ │ │ +00156930: 2f3c 2f73 7061 6e3e 203c 2f64 6976 3e0a /
    . │ │ │ +00156940: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    │ │ │ +00156970: 696e 743c 2f73 7061 6e3e 2074 6d5f 6d6f int tm_mo │ │ │ +00156980: 6e3b 2020 2020 2020 2020 203c 7370 616e n; /* month of yea │ │ │ +001569b0: 7220 2830 202d 2031 3129 202a 2f3c 2f73 r (0 - 11) */
    .
    │ │ │ +001569e0: 2020 3c73 7061 6e20 636c 6173 733d 226b int< │ │ │ +00156a00: 2f73 7061 6e3e 2074 6d5f 7965 6172 3b20 /span> tm_year; │ │ │ +00156a10: 2020 2020 2020 203c 7370 616e 2063 6c61 /* │ │ │ +00156a30: 7965 6172 202d 2031 3930 3020 2a2f 3c2f year - 1900 */
    . │ │ │ +00156a60: 2020 203c 7370 616e 2063 6c61 7373 3d22 int │ │ │ +00156a80: 3c2f 7370 616e 3e20 746d 5f77 6461 793b tm_wday; │ │ │ +00156a90: 2020 2020 2020 2020 3c73 7061 6e20 636c /* │ │ │ +00156ab0: 2064 6179 206f 6620 7765 656b 2028 5375 day of week (Su │ │ │ +00156ac0: 6e64 6179 203d 2030 2920 2a2f 3c2f 7370 nday = 0) */
    .
    │ │ │ +00156af0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 int tm_yday; │ │ │ +00156b20: 2020 2020 2020 3c73 7061 6e20 636c 6173 /* d │ │ │ +00156b40: 6179 206f 6620 7965 6172 2028 3020 2d20 ay of year (0 - │ │ │ +00156b50: 3336 3529 202a 2f3c 2f73 7061 6e3e 203c 365) */ < │ │ │ +00156b60: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    int │ │ │ +00156ba0: 2074 6d5f 6973 6473 743b 2020 2020 2020 tm_isdst; │ │ │ +00156bb0: 203c 7370 616e 2063 6c61 7373 3d22 636f /* is sum │ │ │ +00156bd0: 6d65 7220 7469 6d65 2069 6e20 6566 6665 mer time in effe │ │ │ +00156be0: 6374 3f20 2a2f 3c2f 7370 616e 3e20 3c2f ct? */ .
    char │ │ │ +00156c30: 202a 746d 5f7a 6f6e 653b 2020 2020 2020 *tm_zone; │ │ │ +00156c40: 2020 3c73 7061 6e20 636c 6173 733d 2263 /* abbre │ │ │ +00156c60: 7669 6174 696f 6e20 6f66 2074 696d 657a viation of timez │ │ │ +00156c70: 6f6e 6520 6e61 6d65 202a 2f3c 2f73 7061 one name */
    .
    │ │ │ +00156ca0: 3c73 7061 6e20 636c 6173 733d 226b 6579 long tm_gmtoff; │ │ │ +00156cd0: 2020 2020 2020 3c73 7061 6e20 636c 6173 /* o │ │ │ +00156cf0: 6666 7365 7420 6672 6f6d 2055 5443 2069 ffset from UTC i │ │ │ +00156d00: 6e20 7365 636f 6e64 7320 2a2f 3c2f 7370 n seconds */
    .
    };< │ │ │ +00156d30: 2f64 6976 3e0a 3c2f 6469 763e 3c21 2d2d /div>.

    │ │ │ +00156d50: 4279 2064 6563 6c61 7269 6e67 2073 7472 By declaring str │ │ │ +00156d60: 7563 7420 3c63 6f64 653e 746d 3c2f 636f uct tm volatile, so │ │ │ +00156d80: 6170 6370 7032 2064 6f65 7320 6e6f 7420 apcpp2 does not │ │ │ +00156d90: 7265 6465 6669 6e65 2069 7420 696e 2074 redefine it in t │ │ │ +00156da0: 6865 206f 7574 7075 7420 736f 7572 6365 he output source │ │ │ +00156db0: 2063 6f64 652e 2054 6865 203c 636f 6465 code. The #include <ti │ │ │ +00156dd0: 6d65 2e68 2667 743b 3c2f 636f 6465 3e20 me.h> │ │ │ +00156de0: 6973 2063 6f70 6965 6420 746f 2074 6865 is copied to the │ │ │ +00156df0: 2073 6f75 7263 6520 636f 6465 206f 7574 source code out │ │ │ +00156e00: 7075 742e 2057 6520 6361 6e20 6e6f 7720 put. We can now │ │ │ +00156e10: 7365 7269 616c 697a 6520 7468 6520 3c63 serialize the tm st │ │ │ +00156e30: 7275 6374 7572 652e 2054 6865 2066 6f6c ructure. The fol │ │ │ +00156e40: 6c6f 7769 6e67 2065 7861 6d70 6c65 2073 lowing example s │ │ │ +00156e50: 6572 6961 6c69 7a65 7320 7468 6520 6c6f erializes the lo │ │ │ +00156e60: 6361 6c20 7469 6d65 2073 746f 7265 6420 cal time stored │ │ │ +00156e70: 696e 2061 203c 636f 6465 3e74 6d3c 2f63 in a tm structure t │ │ │ +00156e90: 6f20 7374 646f 7574 3a3c 2f70 3e0a 3c64 o stdout:

    .
    stru │ │ │ +00156ee0: 6374 203c 2f73 7061 6e3e 3c61 2063 6c61 ct soap *soap = soap_new() │ │ │ +00156fb0: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
    .
    time_ │ │ │ +00156fd0: 7420 5420 3d20 7469 6d65 284e 554c 4c29 t T = time(NULL) │ │ │ +00156fe0: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
    .
    struct t │ │ │ +00157020: 6d20 2a74 203d 206c 6f63 616c 7469 6d65 m *t = localtime │ │ │ +00157030: 2826 616d 703b 5429 3b20 3c2f 6469 763e (&T);
    │ │ │ +00157040: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    soap_write_tm │ │ │ +00157060: 283c 6120 636c 6173 733d 2263 6f64 6522 (soap │ │ │ +00157090: 2c20 7429 3b20 3c2f 6469 763e 0a3c 6469 , t);
    .< │ │ │ +001570b0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +001570c0: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ +001570d0: 705f 5f63 6f6e 7465 7874 2e68 746d 6c23 p__context.html# │ │ │ +001570e0: 6761 6637 6430 3137 3631 3631 6539 6465 gaf7d0176161e9de │ │ │ +001570f0: 6633 3639 3831 6532 3466 6161 3139 3133 f36981e24faa1913 │ │ │ +00157100: 6439 223e 736f 6170 5f64 6573 7472 6f79 d9">soap_destroy │ │ │ +00157110: 3c2f 613e 283c 6120 636c 6173 733d 2263 (soap │ │ │ +00157140: 3c2f 613e 293b 203c 2f64 6976 3e0a 3c64 );
    . │ │ │ +00157160: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap_end(soap);
    .
    soap_free( │ │ │ +00157270: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap) │ │ │ +001572a0: 3b3c 2f64 6976 3e0a 3c2f 6469 763e 3c21 ;
    .
    < │ │ │ +001572c0: 703e 4974 2069 7320 616c 736f 2070 6f73 p>It is also pos │ │ │ +001572d0: 7369 626c 6520 746f 2073 6572 6961 6c69 sible to seriali │ │ │ +001572e0: 7a65 2074 6865 203c 636f 6465 3e74 6d3c ze the tm< │ │ │ +001572f0: 2f63 6f64 653e 206d 656d 6265 7273 2061 /code> members a │ │ │ +00157300: 7320 584d 4c20 6174 7472 6962 7574 6573 s XML attributes │ │ │ +00157310: 2062 7920 6465 636c 6172 696e 6720 7468 by declaring th │ │ │ +00157320: 6520 6d65 6d62 6572 7320 6173 2061 7474 e members as att │ │ │ +00157330: 7269 6275 7465 7320 7769 7468 2074 6865 ributes with the │ │ │ +00157340: 203c 636f 6465 3e40 3c2f 636f 6465 3e20 @ │ │ │ +00157350: 7175 616c 6966 6965 722c 2073 6565 2053 qualifier, see S │ │ │ +00157360: 6563 7469 6f6e 203c 6120 636c 6173 733d ection How to declare │ │ │ +001573a0: 2058 4d4c 2061 7474 7269 6275 7465 733c XML attributes< │ │ │ +001573b0: 2f61 3e20 2e3c 2f70 3e0a 3c70 3e49 6620 /a> .

    .

    If │ │ │ +001573c0: 796f 7520 7761 6e74 2074 6f20 7072 6f64 you want to prod │ │ │ +001573d0: 7563 6520 6120 7363 6865 6d61 2066 696c uce a schema fil │ │ │ +001573e0: 652c 2073 6179 203c 656d 3e3c 636f 6465 e, say time.xsd │ │ │ +00157400: 3c2f 656d 3e2c 2074 6861 7420 6465 6669 , that defi │ │ │ +00157410: 6e65 7320 616e 2058 4d4c 2073 6368 656d nes an XML schem │ │ │ +00157420: 6120 616e 6420 6e61 6d65 7370 6163 6520 a and namespace │ │ │ +00157430: 666f 7220 7468 6520 3c63 6f64 653e 746d for the tm │ │ │ +00157440: 3c2f 636f 6465 3e20 7374 7275 6374 2c20 struct, │ │ │ +00157450: 796f 7520 6361 6e20 6164 6420 6120 3c63 you can add a typedef declaration t │ │ │ +00157480: 6f20 7468 6520 6865 6164 6572 2066 696c o the header fil │ │ │ +00157490: 653a 3c2f 703e 0a3c 6469 7620 636c 6173 e:

    .
    < │ │ │ +001574c0: 7370 616e 2063 6c61 7373 3d22 7072 6570 span class="prep │ │ │ +001574d0: 726f 6365 7373 6f72 223e 2369 6e63 6c75 rocessor">#inclu │ │ │ +001574e0: 6465 2026 6c74 3b74 696d 652e 6826 6774 de <time.h> │ │ │ +001574f0: 3b3c 2f73 7061 6e3e 3c2f 6469 763e 0a3c ;
    .< │ │ │ +00157500: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +00157510: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >volatile< │ │ │ +00157530: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> str │ │ │ +00157550: 7563 7420 3c2f 7370 616e 3e74 6d3c 2f64 uct tm.
    {
    . │ │ │ +00157590: 2020 2020 2e2e 2e20 3c73 7061 6e20 636c ... // │ │ │ +001575b0: 2073 6565 2061 626f 7665 3c2f 7370 616e see above
    .
    };.
    typed │ │ │ +00157610: 6566 3c2f 7370 616e 3e20 3c73 7061 6e20 ef │ │ │ +00157630: 7374 7275 6374 203c 2f73 7061 6e3e 746d struct tm │ │ │ +00157640: 2074 696d 655f 5f73 7472 7563 745f 746d time__struct_tm │ │ │ +00157650: 3b3c 2f64 6976 3e0a 3c2f 6469 763e 3c21 ;
    .
    < │ │ │ +00157670: 703e 6f72 2073 696d 706c 7920 7573 6520 p>or simply use │ │ │ +00157680: 636f 6c6f 6e20 6e6f 7461 7469 6f6e 2073 colon notation s │ │ │ +00157690: 696e 6365 2077 6520 6b65 6570 2074 6865 ince we keep the │ │ │ +001576a0: 203c 636f 6465 3e74 6d3c 2f63 6f64 653e tm │ │ │ +001576b0: 206e 616d 653a 3c2f 703e 0a3c 6469 7620 name:

    .
    #i │ │ │ +00157700: 6e63 6c75 6465 2026 6c74 3b74 696d 652e nclude <time. │ │ │ +00157710: 6826 6774 3b3c 2f73 7061 6e3e 3c2f 6469 h>.
    volat │ │ │ +00157750: 696c 653c 2f73 7061 6e3e 203c 7370 616e ile struct t │ │ │ +00157780: 696d 653a 746d 203c 2f64 6976 3e0a 3c64 ime:tm
    . │ │ │ +001577a0: 7b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 {
    .
    int tm_sec; │ │ │ +001577f0: 2020 203c 7370 616e 2063 6c61 7373 3d22 /* seco │ │ │ +00157810: 6e64 7320 2830 202d 2036 3029 202a 2f3c nds (0 - 60) */< │ │ │ +00157820: 2f73 7061 6e3e 203c 2f64 6976 3e0a 3c64 /span>
    . │ │ │ +00157840: 2020 2020 3c73 7061 6e20 636c 6173 733d in │ │ │ +00157860: 743c 2f73 7061 6e3e 2074 6d5f 6d69 6e3b t tm_min; │ │ │ +00157870: 2020 2020 2020 2020 203c 7370 616e 2063 / │ │ │ +00157890: 2a20 6d69 6e75 7465 7320 2830 202d 2035 * minutes (0 - 5 │ │ │ +001578a0: 3929 202a 2f3c 2f73 7061 6e3e 203c 2f64 9) */ .
    int t │ │ │ +001578f0: 6d5f 686f 7572 3b20 2020 2020 2020 203c m_hour; < │ │ │ +00157900: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ +00157910: 656e 7422 3e2f 2a20 686f 7572 7320 2830 ent">/* hours (0 │ │ │ +00157920: 202d 2032 3329 202a 2f3c 2f73 7061 6e3e - 23) */ │ │ │ +00157930: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    int tm_mday; │ │ │ +00157980: 2020 203c 7370 616e 2063 6c61 7373 3d22 /* day │ │ │ +001579a0: 6f66 206d 6f6e 7468 2028 3120 2d20 3331 of month (1 - 31 │ │ │ +001579b0: 2920 2a2f 3c2f 7370 616e 3e20 3c2f 6469 ) */ .
    int tm │ │ │ +00157a00: 5f6d 6f6e 3b20 2020 2020 2020 2020 3c73 _mon; /* month of │ │ │ +00157a30: 7965 6172 2028 3020 2d20 3131 2920 2a2f year (0 - 11) */ │ │ │ +00157a40: 3c2f 7370 616e 3e20 3c2f 6469 763e 0a3c
    .< │ │ │ +00157a50: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +00157a60: 3e20 2020 203c 7370 616e 2063 6c61 7373 > i │ │ │ +00157a80: 6e74 3c2f 7370 616e 3e20 746d 5f79 6561 nt tm_yea │ │ │ +00157a90: 723b 2020 2020 2020 2020 3c73 7061 6e20 r; │ │ │ +00157ab0: 2f2a 2079 6561 7220 2d20 3139 3030 202a /* year - 1900 * │ │ │ +00157ac0: 2f3c 2f73 7061 6e3e 203c 2f64 6976 3e0a /
    . │ │ │ +00157ad0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    │ │ │ +00157b00: 696e 743c 2f73 7061 6e3e 2074 6d5f 7764 int tm_wd │ │ │ +00157b10: 6179 3b20 2020 2020 2020 203c 7370 616e ay; /* day of week │ │ │ +00157b40: 2853 756e 6461 7920 3d20 3029 202a 2f3c (Sunday = 0) */< │ │ │ +00157b50: 2f73 7061 6e3e 203c 2f64 6976 3e0a 3c64 /span>
    . │ │ │ +00157b70: 2020 2020 3c73 7061 6e20 636c 6173 733d in │ │ │ +00157b90: 743c 2f73 7061 6e3e 2074 6d5f 7964 6179 t tm_yday │ │ │ +00157ba0: 3b20 2020 2020 2020 203c 7370 616e 2063 ; / │ │ │ +00157bc0: 2a20 6461 7920 6f66 2079 6561 7220 2830 * day of year (0 │ │ │ +00157bd0: 202d 2033 3635 2920 2a2f 3c2f 7370 616e - 365) */
    .
    < │ │ │ +00157c00: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +00157c10: 6f72 6474 7970 6522 3e69 6e74 3c2f 7370 ordtype">int tm_isdst; │ │ │ +00157c30: 2020 2020 3c73 7061 6e20 636c 6173 733d /* is │ │ │ +00157c50: 7375 6d6d 6572 2074 696d 6520 696e 2065 summer time in e │ │ │ +00157c60: 6666 6563 743f 202a 2f3c 2f73 7061 6e3e ffect? */ │ │ │ +00157c70: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    char *tm_zone; │ │ │ +00157cc0: 2020 203c 7370 616e 2063 6c61 7373 3d22 /* abbr │ │ │ +00157ce0: 6576 6961 7469 6f6e 206f 6620 7469 6d65 eviation of time │ │ │ +00157cf0: 7a6f 6e65 206e 616d 6520 2a2f 3c2f 7370 zone name */
    .
    │ │ │ +00157d20: 203c 7370 616e 2063 6c61 7373 3d22 6b65 long< │ │ │ +00157d40: 2f73 7061 6e3e 2074 6d5f 676d 746f 6666 /span> tm_gmtoff │ │ │ +00157d50: 3b20 2020 2020 3c73 7061 6e20 636c 6173 ; /* o │ │ │ +00157d70: 6666 7365 7420 6672 6f6d 2055 5443 2069 ffset from UTC i │ │ │ +00157d80: 6e20 7365 636f 6e64 7320 2a2f 3c2f 7370 n seconds */
    .
    };< │ │ │ +00157db0: 2f64 6976 3e0a 3c2f 6469 763e 3c21 2d2d /div>.

    │ │ │ +00157dd0: 5765 2075 7365 6420 7468 6520 7479 7065 We used the type │ │ │ +00157de0: 6465 6620 6e61 6d65 203c 636f 6465 3e74 def name t │ │ │ +00157df0: 696d 655f 5f73 7472 7563 745f 746d 3c2f ime__struct_tm rather tha │ │ │ +00157e10: 6e20 3c63 6f64 653e 7469 6d65 5f5f 746d n time__tm │ │ │ +00157e20: 3c2f 636f 6465 3e2c 2062 6563 6175 7365 , because │ │ │ +00157e30: 2061 2073 6368 656d 6120 6e61 6d65 2063 a schema name c │ │ │ +00157e40: 6c61 7368 2077 696c 6c20 6f63 6375 7220 lash will occur │ │ │ +00157e50: 666f 7220 7468 6520 6669 7273 7420 6578 for the first ex │ │ │ +00157e60: 616d 706c 6520 6162 6f76 6520 7468 6174 ample above that │ │ │ +00157e70: 2068 6173 203c 636f 6465 3e74 6d3c 2f63 has tm already dec │ │ │ +00157e90: 6c61 7265 6420 6173 2073 6572 6961 6c69 lared as seriali │ │ │ +00157ea0: 7a61 626c 6520 7479 7065 2069 6e20 7468 zable type in th │ │ │ +00157eb0: 6520 7363 6865 6d61 206f 6620 7468 6520 e schema of the │ │ │ +00157ec0: 6765 6e65 7261 7465 6420 5753 444c 2e20 generated WSDL. │ │ │ +00157ed0: 5468 6520 7365 636f 6e64 2065 7861 6d70 The second examp │ │ │ +00157ee0: 6c65 2077 6974 6820 7468 6520 636f 6c6f le with the colo │ │ │ +00157ef0: 6e20 6e6f 7461 7469 6f6e 2061 766f 6964 n notation avoid │ │ │ +00157f00: 7320 7468 6973 2061 6c74 6f67 6574 6865 s this altogethe │ │ │ +00157f10: 722e 3c2f 703e 0a3c 703e f09f 949d 203c r.

    .
    ex │ │ │ +001580c0: 7465 726e 3c2f 7370 616e 3e20 3c73 7061 tern typedef │ │ │ +001580f0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 char< │ │ │ +00158110: 2f73 7061 6e3e 202a 4d79 4461 7461 3b20 /span> *MyData; │ │ │ +00158120: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    s │ │ │ +00158150: 7472 7563 7420 3c2f 7370 616e 3e53 616d truct Sam │ │ │ +00158160: 706c 6520 3c2f 6469 763e 0a3c 6469 7620 ple
    .
    {.
    MyDat │ │ │ +001581a0: 6120 733b 203c 7370 616e 2063 6c61 7373 a s; // us │ │ │ +001581c0: 6520 6375 7374 6f6d 2073 6572 6961 6c69 e custom seriali │ │ │ +001581d0: 7a65 7220 666f 7220 7468 6973 206d 656d zer for this mem │ │ │ +001581e0: 6265 7220 3c2f 7370 616e 3e3c 2f64 6976 ber
    .
    char *t │ │ │ +00158230: 3b20 203c 7370 616e 2063 6c61 7373 3d22 ; // use │ │ │ +00158250: 6175 746f 2d67 656e 6572 6174 6564 2073 auto-generated s │ │ │ +00158260: 6572 6961 6c69 7a65 723c 2f73 7061 6e3e erializer │ │ │ +00158270: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    };
    .

    Then │ │ │ +001582b0: 2070 726f 7669 6465 2074 6865 2066 6f6c provide the fol │ │ │ +001582c0: 6c6f 7769 6e67 2066 756e 6374 696f 6e73 lowing functions │ │ │ +001582d0: 2066 6f72 2065 6163 6820 3c63 6f64 653e for each │ │ │ +001582e0: 6578 7465 726e 2074 7970 6564 6566 3c2f extern typedef declares t │ │ │ +00158300: 7970 6520 3c63 6f64 653e 543c 2f63 6f64 ype T:

    .
    .
    void soap_default │ │ │ +00158470: 5f54 283c 7370 616e 2063 6c61 7373 3d22 _T(struct< │ │ │ +00158490: 2f73 7061 6e3e 203c 6120 636c 6173 733d /span> so │ │ │ +001584c0: 6170 3c2f 613e 202a 3c61 2063 6c61 7373 ap *s │ │ │ +001584f0: 6f61 703c 2f61 3e2c 2054 202a 6129 3b3c oap, T *a);< │ │ │ +00158500: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    int soa │ │ │ +00158540: 705f 6f75 745f 5428 3c73 7061 6e20 636c p_out_T(st │ │ │ +00158560: 7275 6374 3c2f 7370 616e 3e20 3c61 2063 ruct soap *soap, const │ │ │ +001585f0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 char< │ │ │ +00158610: 2f73 7061 6e3e 202a 7461 672c 203c 7370 /span> *tag, int id, con │ │ │ +00158680: 7374 3c2f 7370 616e 3e20 5420 2a61 2c20 st T *a, │ │ │ +00158690: 3c73 7061 6e20 636c 6173 733d 226b 6579 const cha │ │ │ +001586d0: 723c 2f73 7061 6e3e 202a 7479 7065 293b r *type); │ │ │ +001586e0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    T *soap │ │ │ +00158700: 5f69 6e5f 5428 3c73 7061 6e20 636c 6173 _in_T(stru │ │ │ +00158720: 6374 3c2f 7370 616e 3e20 3c61 2063 6c61 ct soap *soap, const < │ │ │ +001587b0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +001587c0: 6f72 6474 7970 6522 3e63 6861 723c 2f73 ordtype">char *tag, T *a, │ │ │ +001587e0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 const ch │ │ │ +00158820: 6172 3c2f 7370 616e 3e20 2a74 7970 6529 ar *type) │ │ │ +00158830: 3b3c 2f64 6976 3e0a 3c2f 6469 763e 3c21 ;
    .
    < │ │ │ +00158850: 703e 5468 6520 6675 6e63 7469 6f6e 2070 p>The function p │ │ │ +00158860: 726f 746f 7479 7065 7320 6f66 2074 6865 rototypes of the │ │ │ +00158870: 7365 2066 756e 6374 696f 6e73 2063 616e se functions can │ │ │ +00158880: 2062 6520 666f 756e 6420 696e 2074 6865 be found in the │ │ │ +00158890: 2073 6f61 7063 7070 322d 6765 6e65 7261 soapcpp2-genera │ │ │ +001588a0: 7465 6420 3c65 6d3e 3c63 6f64 653e 736f ted so │ │ │ +001588b0: 6170 482e 683c 2f63 6f64 653e 3c2f 656d apH.h file.

    .

    F │ │ │ +001588d0: 6f72 2065 7861 6d70 6c65 2c20 7468 6520 or example, the │ │ │ +001588e0: 7365 7269 616c 697a 6174 696f 6e20 6f66 serialization of │ │ │ +001588f0: 203c 636f 6465 3e4d 7944 6174 613c 2f63 MyData can be done │ │ │ +00158910: 2077 6974 6820 7468 6520 666f 6c6c 6f77 with the follow │ │ │ +00158920: 696e 6720 636f 6465 3a3c 2f70 3e0a 3c64 ing code:

    .
    │ │ │ +00158970: 696e 743c 2f73 7061 6e3e 2073 6f61 705f int soap_ │ │ │ +00158980: 7365 7269 616c 697a 655f 4d79 4461 7461 serialize_MyData │ │ │ +00158990: 283c 7370 616e 2063 6c61 7373 3d22 6b65 (struct soap │ │ │ +001589e0: 3c2f 613e 202a 3c61 2063 6c61 7373 3d22 *soa │ │ │ +00158a10: 703c 2f61 3e2c 204d 7944 6174 6120 3c73 p, MyData const │ │ │ +00158a40: 2a61 2920 3c2f 6469 763e 0a3c 6469 7620 *a)
    .
    {.
    / │ │ │ +00158a90: 2f20 6e6f 206e 6565 6420 746f 206d 6172 / no need to mar │ │ │ +00158aa0: 6b20 7468 6973 206e 6f64 6520 2866 6f72 k this node (for │ │ │ +00158ab0: 206d 756c 7469 2d72 6566 2061 6e64 2063 multi-ref and c │ │ │ +00158ac0: 7963 6c65 2064 6574 6563 7469 6f6e 2920 ycle detection) │ │ │ +00158ad0: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ +00158af0: 2020 3c73 7061 6e20 636c 6173 733d 226b retu │ │ │ +00158b10: 726e 3c2f 7370 616e 3e20 3c61 2063 6c61 rn SO │ │ │ +00158b70: 4150 5f4f 4b3c 2f61 3e3b 3c2f 6469 763e AP_OK;
    │ │ │ +00158b80: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    }
    .
    void soap_default_ │ │ │ +00158be0: 4d79 4461 7461 283c 7370 616e 2063 6c61 MyData(str │ │ │ +00158c00: 7563 743c 2f73 7061 6e3e 203c 6120 636c uct soap *soap, MyD │ │ │ +00158c70: 6174 6120 2a61 2920 3c2f 6469 763e 0a3c ata *a)
    .< │ │ │ +00158c80: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +00158c90: 3e7b 3c2f 6469 763e 0a3c 6469 7620 636c >{
    .
    *a │ │ │ +00158cb0: 3d20 4e55 4c4c 3b3c 2f64 6976 3e0a 3c64 = NULL;
    . │ │ │ +00158cd0: 7d20 3c2f 6469 763e 0a3c 6469 7620 636c }

    .... < │ │ │ +00157f20: 6120 6872 6566 3d22 2322 3e42 6163 6b20 a href="#">Back │ │ │ +00157f30: 746f 2074 6162 6c65 206f 6620 636f 6e74 to table of cont │ │ │ +00157f40: 656e 7473 3c2f 613e 3c2f 703e 0a3c 6832 ents

    .

    < │ │ │ +00157f70: 2f61 3e0a 486f 7720 746f 2064 6563 6c61 /a>.How to decla │ │ │ +00157f80: 7265 2063 7573 746f 6d20 7365 7269 616c re custom serial │ │ │ +00157f90: 697a 6572 7320 616e 6420 6465 7365 7269 izers and deseri │ │ │ +00157fa0: 616c 697a 6572 733c 2f68 323e 0a3c 703e alizers

    .

    │ │ │ +00157fb0: 596f 7520 6361 6e20 696d 706c 656d 656e You can implemen │ │ │ +00157fc0: 7420 796f 7572 206f 776e 2063 7573 746f t your own custo │ │ │ +00157fd0: 6d20 7365 7269 616c 697a 6572 7320 666f m serializers fo │ │ │ +00157fe0: 7220 6461 7461 2074 7970 6573 2e20 4120 r data types. A │ │ │ +00157ff0: 6375 7374 6f6d 2073 6572 6961 6c69 7a65 custom serialize │ │ │ +00158000: 7220 6973 2064 6563 6c61 7265 6420 696e r is declared in │ │ │ +00158010: 2061 6e20 696e 7465 7266 6163 6520 6865 an interface he │ │ │ +00158020: 6164 6572 2066 696c 6520 666f 7220 736f ader file for so │ │ │ +00158030: 6170 6370 7032 2075 7369 6e67 2074 6865 apcpp2 using the │ │ │ +00158040: 2070 6169 7220 6f66 206b 6579 776f 7264 pair of keyword │ │ │ +00158050: 7320 3c63 6f64 653e 6578 7465 726e 2074 s extern t │ │ │ +00158060: 7970 6564 6566 3c2f 636f 6465 3e2e 2046 ypedef. F │ │ │ +00158070: 6f72 2065 7861 6d70 6c65 3a3c 2f70 3e0a or example:

    . │ │ │ +00158080: 3c64 6976 2063 6c61 7373 3d22 6672 6167

    .
    int │ │ │ +00158d10: 736f 6170 5f6f 7574 5f4d 7944 6174 6128 soap_out_MyData( │ │ │ +00158d20: 3c73 7061 6e20 636c 6173 733d 226b 6579 struct soap< │ │ │ +00158d70: 2f61 3e20 2a3c 6120 636c 6173 733d 2263 /a> *soap │ │ │ +00158da0: 3c2f 613e 2c20 3c73 7061 6e20 636c 6173 , cons │ │ │ +00158dc0: 743c 2f73 7061 6e3e 203c 7370 616e 2063 t char * │ │ │ +00158df0: 7461 672c 203c 7370 616e 2063 6c61 7373 tag, i │ │ │ +00158e10: 6e74 3c2f 7370 616e 3e20 3c73 7061 6e20 nt id, M │ │ │ +00158e40: 7944 6174 6120 3c73 7061 6e20 636c 6173 yData cons │ │ │ +00158e60: 743c 2f73 7061 6e3e 2a61 2c20 3c73 7061 t*a, const < │ │ │ +00158e90: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +00158ea0: 6f72 6474 7970 6522 3e63 6861 723c 2f73 ordtype">char *type) .
    {
    . │ │ │ +00158ef0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 if
    (soap_eleme │ │ │ +00158f20: 6e74 5f62 6567 696e 5f6f 7574 283c 6120 nt_begin_out(soap, ta │ │ │ +00158f60: 672c 203c 7370 616e 2063 6c61 7373 3d22 g, id< │ │ │ +00158f80: 2f73 7061 6e3e 2c20 7479 7065 2920 3c73 /span>, type) // print XML │ │ │ +00158fb0: 2062 6567 696e 6e69 6e67 2074 6167 203c beginning tag < │ │ │ +00158fc0: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    . │ │ │ +00158fe0: 2020 7c7c 203c 6120 636c 6173 733d 2263 || soap_send(soap, *a) // │ │ │ +00159090: 206a 7573 7420 7072 696e 7420 7468 6520 just print the │ │ │ +001590a0: 7374 7269 6e67 2028 6e6f 2058 4d4c 2063 string (no XML c │ │ │ +001590b0: 6f6e 7665 7273 696f 6e29 203c 2f73 7061 onversion)
    ..
    < │ │ │ +00159180: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +00159190: 6f72 6466 6c6f 7722 3e72 6574 7572 6e3c ordflow">return< │ │ │ +001591a0: 2f73 7061 6e3e 203c 6120 636c 6173 733d /span> so │ │ │ +001591d0: 6170 3c2f 613e 2d26 6774 3b3c 6120 636c ap->error; < │ │ │ +00159230: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    return SOAP_OK;
    .
    } .
    MyData ** │ │ │ +00159310: 736f 6170 5f69 6e5f 4d79 4461 7461 283c soap_in_MyData(< │ │ │ +00159320: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +00159330: 6f72 6422 3e73 7472 7563 743c 2f73 7061 ord">struct soap *soap< │ │ │ +001593a0: 2f61 3e2c 203c 7370 616e 2063 6c61 7373 /a>, const │ │ │ +001593c0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c char *t │ │ │ +001593f0: 6167 2c20 4d79 4461 7461 202a 612c 203c ag, MyData *a, < │ │ │ +00159400: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +00159410: 6f72 6422 3e63 6f6e 7374 3c2f 7370 616e ord">const char │ │ │ +00159440: 3c2f 7370 616e 3e20 2a74 7970 6529 203c *type) < │ │ │ +00159450: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    {
    . │ │ │ +00159470: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    . │ │ │ +00159510: 2020 203c 7370 616e 2063 6c61 7373 3d22 ret │ │ │ +00159530: 7572 6e3c 2f73 7061 6e3e 204e 554c 4c3b urn NULL; │ │ │ +00159540: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    if │ │ │ +00159580: 2821 6129 203c 2f64 6976 3e0a 3c64 6976 (!a)
    .
    │ │ │ +001595a0: 2020 6120 3d20 284d 7944 6174 612a 293c a = (MyData*)< │ │ │ +001595b0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +001595c0: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ +001595d0: 705f 5f63 6f6e 7465 7874 2e68 746d 6c23 p__context.html# │ │ │ +001595e0: 6761 6261 3535 3637 3130 6530 3130 6665 gaba556710e010fe │ │ │ +001595f0: 6562 3232 3131 6564 3433 6235 6266 3035 eb2211ed43b5bf05 │ │ │ +00159600: 3963 223e 736f 6170 5f6d 616c 6c6f 633c 9c">soap_malloc< │ │ │ +00159610: 2f61 3e28 3c61 2063 6c61 7373 3d22 636f /a>(soap< │ │ │ +00159640: 2f61 3e2c 203c 7370 616e 2063 6c61 7373 /a>, sizeo │ │ │ +00159660: 663c 2f73 7061 6e3e 284d 7944 6174 6129 f(MyData) │ │ │ +00159670: 293b 203c 2f64 6976 3e0a 3c64 6976 2063 );
    . │ │ │ +00159740: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    *a = NULL │ │ │ +00159760: 3b20 3c73 7061 6e20 636c 6173 733d 2263 ; // xsi:n │ │ │ +00159780: 696c 2065 6c65 6d65 6e74 203c 2f73 7061 il element
    .
    if │ │ │ +001597d0: 2028 2a3c 6120 636c 6173 733d 2263 6f64 (*soap->type & │ │ │ +00159810: 3b26 616d 703b 203c 6120 636c 6173 733d ;& soap_ma │ │ │ +00159870: 7463 685f 7461 673c 2f61 3e28 3c61 2063 tch_tag(soap, soap-> │ │ │ +001598e0: 3b74 7970 652c 2074 7970 6529 2920 3c2f ;type, type)) .
    {
    │ │ │ +00159910: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    so │ │ │ +00159950: 6170 3c2f 613e 2d26 6774 3b3c 6120 636c ap->error = │ │ │ +001599b0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 SOAP_TYPE;
    .
    │ │ │ +00159a30: 3c73 7061 6e20 636c 6173 733d 226b 6579 return │ │ │ +00159a50: 3c2f 7370 616e 3e20 4e55 4c4c 3b20 3c73 NULL; // type mism │ │ │ +00159a80: 6174 6368 203c 2f73 7061 6e3e 3c2f 6469 atch .
    }
    . │ │ │ +00159ab0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    if │ │ │ +00159ae0: 3c2f 7370 616e 3e20 282a 3c61 2063 6c61 (*soap->hr │ │ │ +00159b20: 6566 2920 3c2f 6469 763e 0a3c 6469 7620 ef)
    .
    │ │ │ +00159b40: 2061 203d 2028 4d79 4461 7461 2a2a 2973 a = (MyData**)s │ │ │ +00159b50: 6f61 705f 6964 5f66 6f72 7761 7264 283c oap_id_forward(< │ │ │ +00159b60: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +00159b70: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ +00159b80: 6874 6d6c 223e 736f 6170 3c2f 613e 2c20 html">soap, │ │ │ +00159b90: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap- │ │ │ +00159bc0: 2667 743b 6872 6566 2c20 612c 2030 2c20 >href, a, 0, │ │ │ +00159bd0: 534f 4150 5f54 5950 455f 4d79 4461 7461 SOAP_TYPE_MyData │ │ │ +00159be0: 2c20 302c 203c 7370 616e 2063 6c61 7373 , 0, sizeo │ │ │ +00159c00: 663c 2f73 7061 6e3e 284d 7944 6174 6129 f(MyData) │ │ │ +00159c10: 2c20 302c 204e 554c 4c2c 204e 554c 4c29 , 0, NULL, NULL) │ │ │ +00159c20: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    else if (so │ │ │ +00159cb0: 6170 3c2f 613e 2d26 6774 3b3c 6120 636c ap->body) .
    {
    │ │ │ +00159d30: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    char *s │ │ │ +00159d70: 3d20 736f 6170 5f76 616c 7565 283c 6120 = soap_value(soap); < │ │ │ +00159db0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ +00159dc0: 656e 7422 3e2f 2f20 6669 6c6c 2062 7566 ent">// fill buf │ │ │ +00159dd0: 6665 7220 3c2f 7370 616e 3e3c 2f64 6976 fer
    .
    *a = (char*)soap_m │ │ │ +00159e80: 616c 6c6f 633c 2f61 3e28 3c61 2063 6c61 alloc(soap, strle │ │ │ +00159ec0: 6e28 7329 2b31 293b 203c 2f64 6976 3e0a n(s)+1);
    . │ │ │ +00159ed0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    strcpy(*a, │ │ │ +00159ef0: 2073 293b 203c 2f64 6976 3e0a 3c64 6976 s);
    .
    │ │ │ +00159f10: 7d20 3c2f 6469 763e 0a3c 6469 7620 636c }
    .
    if │ │ │ +00159f50: 2028 3c61 2063 6c61 7373 3d22 636f 6465 (soap->b │ │ │ +00159fd0: 6f64 793c 2f61 3e20 2661 6d70 3b26 616d ody &&am │ │ │ +00159fe0: 703b 2073 6f61 705f 656c 656d 656e 745f p; soap_element_ │ │ │ +00159ff0: 656e 645f 696e 283c 6120 636c 6173 733d end_in(so │ │ │ +0015a020: 6170 3c2f 613e 2c20 7461 6729 2920 3c2f ap, tag)) .
    return NULL;
    . │ │ │ +0015a080: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    re │ │ │ +0015a0b0: 7475 726e 3c2f 7370 616e 3e20 613b 203c turn a; < │ │ │ +0015a0c0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    }
    . │ │ │ +0015a0e0: 3c64 6976 2063 6c61 7373 3d22 7474 6322
    S │ │ │ +0015a190: 4f41 505f 5459 5045 3c2f 613e 3c2f 6469 OAP_TYPE
    #define SO │ │ │ +0015a1c0: 4150 5f54 5950 453c 2f64 6976 3e3c 6469 AP_TYPE
    │ │ │ +0015a1e0: 4120 736f 6170 5f73 7461 7475 7320 6572 A soap_status er │ │ │ +0015a1f0: 726f 7220 636f 6465 3a20 584d 4c20 656c ror code: XML el │ │ │ +0015a200: 656d 656e 7420 6f72 2061 7474 7269 6275 ement or attribu │ │ │ +0015a210: 7465 2068 6173 2061 206d 6973 6d61 7463 te has a mismatc │ │ │ +0015a220: 6869 6e67 2074 7970 6520 6f72 2076 616c hing type or val │ │ │ +0015a230: 7565 2074 6861 7420 6973 2063 6175 7369 ue that is causi │ │ │ +0015a240: 6e67 2061 202e 2e2e 3c2f 6469 763e 3c64 ng a ...
    Definition:< │ │ │ +0015a270: 2f62 3e20 7374 6473 6f61 7032 2e68 3a32 /b> stdsoap2.h:2 │ │ │ +0015a280: 3630 373c 2f64 6976 3e3c 2f64 6976 3e0a 607
    . │ │ │ +0015a290: 3c64 6976 2063 6c61 7373 3d22 7474 6322
    │ │ │ +0015a2e0: 3c64 6976 2063 6c61 7373 3d22 7474 6e61
    in │ │ │ +0015a360: 7420 736f 6170 5f73 656e 6428 7374 7275 t soap_send(stru │ │ │ +0015a370: 6374 2073 6f61 7020 2a73 6f61 702c 2063 ct soap *soap, c │ │ │ +0015a380: 6f6e 7374 2063 6861 7220 2a73 293c 2f64 onst char *s)
    Send a str │ │ │ +0015a3b0: 696e 672e 3c2f 6469 763e 3c2f 6469 763e ing.
    │ │ │ +0015a3c0: 0a3c 6469 7620 636c 6173 733d 2274 7463 .
    soap │ │ │ +0015a470: 5f6d 6174 6368 5f74 6167 3c2f 613e 3c2f _match_tag
    int soap │ │ │ +0015a4a0: 5f6d 6174 6368 5f74 6167 2873 7472 7563 _match_tag(struc │ │ │ +0015a4b0: 7420 736f 6170 202a 736f 6170 2c20 636f t soap *soap, co │ │ │ +0015a4c0: 6e73 7420 6368 6172 202a 7461 6731 2c20 nst char *tag1, │ │ │ +0015a4d0: 636f 6e73 7420 6368 6172 202a 7461 6732 const char *tag2 │ │ │ +0015a4e0: 293c 2f64 6976 3e3c 6469 7620 636c 6173 )
    Match │ │ │ +0015a500: 616e 2058 4d4c 2074 6167 206e 616d 652e an XML tag name. │ │ │ +0015a510: 3c2f 6469 763e 3c2f 6469 763e 0a3c 6469
    .
    sh │ │ │ +0015a5e0: 6f72 7420 626f 6479 3c2f 6469 763e 3c64 ort body
    The soap::body │ │ │ +0015a610: 666c 6167 2069 7320 7365 7420 7768 656e flag is set when │ │ │ +0015a620: 2061 6e20 656c 656d 656e 7420 6861 7320 an element has │ │ │ +0015a630: 656c 656d 656e 7420 636f 6e74 656e 7420 element content │ │ │ +0015a640: 6475 7269 6e67 2058 4d4c 2070 6172 7369 during XML parsi │ │ │ +0015a650: 6e67 206f 7220 7768 656e 2061 2048 5454 ng or when a HTT │ │ │ +0015a660: 5020 6d65 7373 2e2e 2e3c 2f64 6976 3e3c P mess...
    < │ │ │ +0015a670: 6469 7620 636c 6173 733d 2274 7464 6566 div class="ttdef │ │ │ +0015a680: 223e 3c62 3e44 6566 696e 6974 696f 6e3a ">Definition: │ │ │ +0015a690: 3c2f 623e 2073 7464 736f 6170 322e 683a stdsoap2.h: │ │ │ +0015a6a0: 3239 3635 3c2f 6469 763e 3c2f 6469 763e 2965
    │ │ │ +0015a6b0: 0a3c 6469 7620 636c 6173 733d 2274 7463 .
    short null
    The soap::n │ │ │ +0015a7a0: 756c 6c20 666c 6167 2069 7320 7365 7420 ull flag is set │ │ │ +0015a7b0: 7768 656e 2061 6e20 656c 656d 656e 7420 when an element │ │ │ +0015a7c0: 6361 7272 6965 7320 6120 7873 693a 6e69 carries a xsi:ni │ │ │ +0015a7d0: 6c20 6174 7472 6962 7574 6520 7468 6174 l attribute that │ │ │ +0015a7e0: 2069 7320 7472 7565 2e3c 2f64 6976 3e3c is true.
    < │ │ │ +0015a7f0: 6469 7620 636c 6173 733d 2274 7464 6566 div class="ttdef │ │ │ +0015a800: 223e 3c62 3e44 6566 696e 6974 696f 6e3a ">Definition: │ │ │ +0015a810: 3c2f 623e 2073 7464 736f 6170 322e 683a stdsoap2.h: │ │ │ +0015a820: 3239 3633 3c2f 6469 763e 3c2f 6469 763e 2963
    │ │ │ +0015a830: 0a3c 2f64 6976 3e3c 212d 2d20 6672 6167 .

    More │ │ │ +0015a850: 696e 666f 726d 6174 696f 6e20 6f6e 2063 information on c │ │ │ +0015a860: 7573 746f 6d20 7365 7269 616c 697a 6174 ustom serializat │ │ │ +0015a870: 696f 6e20 6973 2061 7661 696c 6162 6c65 ion is available │ │ │ +0015a880: 2069 6e20 7468 6520 6753 4f41 5020 736f in the gSOAP so │ │ │ +0015a890: 7572 6365 2063 6f64 6520 7061 636b 6167 urce code packag │ │ │ +0015a8a0: 6520 696e 2074 6865 203c 656d 3e3c 636f e in the gsoap/custom< │ │ │ +0015a8c0: 2f63 6f64 653e 3c2f 656d 3e20 6469 7265 /code> dire │ │ │ +0015a8d0: 6374 6f72 792c 2077 6865 7265 2079 6f75 ctory, where you │ │ │ +0015a8e0: 2063 616e 2061 6c73 6f20 6669 6e64 2073 can also find s │ │ │ +0015a8f0: 6576 6572 616c 2063 7573 746f 6d20 7365 everal custom se │ │ │ +0015a900: 7269 616c 697a 6572 7320 746f 2075 7365 rializers to use │ │ │ +0015a910: 2077 6974 6820 796f 7572 2070 726f 6a65 with your proje │ │ │ +0015a920: 6374 732e 3c2f 703e 0a3c 703e f09f 949d cts.

    .

    .... │ │ │ +0015a930: 203c 6120 6872 6566 3d22 2322 3e42 6163 Bac │ │ │ +0015a940: 6b20 746f 2074 6162 6c65 206f 6620 636f k to table of co │ │ │ +0015a950: 6e74 656e 7473 3c2f 613e 3c2f 703e 0a3c ntents

    .< │ │ │ +0015a960: 6832 3e3c 6120 636c 6173 733d 2261 6e63 h2>.Function │ │ │ +0015a990: 2063 616c 6c62 6163 6b73 2066 6f72 2063 callbacks for c │ │ │ +0015a9a0: 7573 746f 6d69 7a65 6420 492f 4f20 616e ustomized I/O an │ │ │ +0015a9b0: 6420 4854 5450 2068 616e 646c 696e 673c d HTTP handling< │ │ │ +0015a9c0: 2f68 323e 0a3c 703e 5468 6520 666f 6c6c /h2>.

    The foll │ │ │ +0015a9d0: 6f77 696e 6720 6c69 7374 206f 6620 6675 owing list of fu │ │ │ +0015a9e0: 6e63 7469 6f6e 7320 6361 6e20 6265 2075 nctions can be u │ │ │ +0015a9f0: 7365 6420 666f 7220 6375 7374 6f6d 697a sed for customiz │ │ │ +0015aa00: 6564 2048 5454 5020 6861 6e64 6c69 6e67 ed HTTP handling │ │ │ +0015aa10: 2061 6e64 2049 2f4f 2e3c 2f70 3e0a 3c70 and I/O.

    .

    See also API do │ │ │ +0015aa30: 6375 6d65 6e74 6174 696f 6e20 4d6f 6475 cumentation Modu │ │ │ +0015aa40: 6c65 203c 6120 636c 6173 733d 2265 6c22 le Callback fu │ │ │ +0015aa80: 6e63 7469 6f6e 733c 2f61 3e2e 3c2f 703e nctions.

    │ │ │ +0015aa90: 0a3c 703e 546f 2072 6573 6574 2074 6865 .

    To reset the │ │ │ +0015aaa0: 2063 616c 6c62 6163 6b20 6675 6e63 7469 callback functi │ │ │ +0015aab0: 6f6e 7320 746f 2074 6865 2069 6e74 6572 ons to the inter │ │ │ +0015aac0: 6e61 6c20 6675 6e63 7469 6f6e 7320 6f66 nal functions of │ │ │ +0015aad0: 2074 6865 2065 6e67 696e 652c 2075 7365 the engine, use │ │ │ +0015aae0: 203c 636f 6465 3e3c 6120 636c 6173 733d soap_ │ │ │ +0015abb0: 646f 6e65 3c2f 613e 3c2f 636f 6465 3e20 done │ │ │ +0015abc0: 666f 6c6c 6f77 6564 2062 7920 3c63 6f64 followed by soap_ini │ │ │ +0015ac60: 743c 2f61 3e3c 2f63 6f64 653e 2e20 5468 t. Th │ │ │ +0015ac70: 6973 2072 652d 696e 6974 6961 6c69 7a65 is re-initialize │ │ │ +0015ac80: 7320 7468 6520 3c63 6f64 653e 3c61 2063 s the soap │ │ │ +0015ace0: 3c2f 636f 6465 3e20 636f 6e74 6578 742c context, │ │ │ +0015acf0: 2072 656d 6f76 6573 2061 6c6c 2070 6c75 removes all plu │ │ │ +0015ad00: 6769 6e73 2c20 616e 6420 7265 7365 7473 gins, and resets │ │ │ +0015ad10: 2066 756e 6374 696f 6e20 6361 6c6c 6261 function callba │ │ │ +0015ad20: 636b 732e 3c2f 703e 0a3c 6833 3e3c 6120 cks.

    .

    .fpost

    │ │ │ +0015ad60: 0a3c 703e 3c63 6f64 653e 696e 7420 283c .

    int (< │ │ │ +0015ad70: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ +0015ad80: 663d 2267 726f 7570 5f5f 6772 6f75 705f f="group__group_ │ │ │ +0015ad90: 5f63 616c 6c62 6163 6b73 2e68 746d 6c23 _callbacks.html# │ │ │ +0015ada0: 6761 3738 6432 6235 3434 3062 3333 6433 ga78d2b5440b33d3 │ │ │ +0015adb0: 3838 3262 3539 3563 6138 6366 6465 6334 882b595ca8cfdec4 │ │ │ +0015adc0: 3235 2220 7469 746c 653d 2243 616c 6c62 25" title="Callb │ │ │ +0015add0: 6163 6b20 7468 6174 2070 6f70 756c 6174 ack that populat │ │ │ +0015ade0: 6573 2061 6e64 2074 6865 6e20 7365 6e64 es and then send │ │ │ +0015adf0: 7320 4854 5450 2068 6561 6465 7273 2066 s HTTP headers f │ │ │ +0015ae00: 726f 6d20 7468 6520 636c 6965 6e74 2d73 rom the client-s │ │ │ +0015ae10: 6964 6520 746f 2061 2063 6f6e 6e65 6374 ide to a connect │ │ │ +0015ae20: 6564 2048 5454 5020 7365 7276 6572 2e22 ed HTTP server." │ │ │ +0015ae30: 3e73 6f61 703a 3a66 706f 7374 3c2f 613e >soap::fpost │ │ │ +0015ae40: 2928 7374 7275 6374 2073 6f61 7020 2a73 )(struct soap *s │ │ │ +0015ae50: 6f61 702c 2063 6f6e 7374 2063 6861 7220 oap, const char │ │ │ +0015ae60: 2a65 6e64 706f 696e 742c 2063 6f6e 7374 *endpoint, const │ │ │ +0015ae70: 2063 6861 7220 2a68 6f73 742c 2069 6e74 char *host, int │ │ │ +0015ae80: 2070 6f72 742c 2063 6f6e 7374 2063 6861 port, const cha │ │ │ +0015ae90: 7220 2a70 6174 682c 2063 6f6e 7374 2063 r *path, const c │ │ │ +0015aea0: 6861 7220 2a61 6374 696f 6e2c 2055 4c4f har *action, ULO │ │ │ +0015aeb0: 4e47 3634 2063 6f75 6e74 293c 2f63 6f64 NG64 count)

    .

    This c │ │ │ +0015aed0: 616c 6c62 6163 6b20 6973 2063 616c 6c65 allback is calle │ │ │ +0015aee0: 6420 6174 2074 6865 2073 6572 7665 7220 d at the server │ │ │ +0015aef0: 7369 6465 2062 7920 7468 6520 656e 6769 side by the engi │ │ │ +0015af00: 6e65 2074 6f20 7365 6e64 2074 6865 2048 ne to send the H │ │ │ +0015af10: 5454 5020 6865 6164 6572 7320 746f 2074 TTP headers to t │ │ │ +0015af20: 6865 2063 6f6e 6e65 6374 6564 2063 6c69 he connected cli │ │ │ +0015af30: 656e 742e 2054 6865 2070 6172 616d 6574 ent. The paramet │ │ │ +0015af40: 6572 203c 636f 6465 3e73 7461 7475 733c er status< │ │ │ +0015af50: 2f63 6f64 653e 2073 686f 756c 6420 6265 /code> should be │ │ │ +0015af60: 2061 6e20 4854 5450 2073 7461 7475 7320 an HTTP status │ │ │ +0015af70: 6572 726f 7220 636f 6465 206f 7220 3c63 error code or #SOAP_OK (200 OK) or │ │ │ +0015afa0: 3c63 6f64 653e 2353 4f41 505f 4854 4d4c #SOAP_HTML │ │ │ +0015afb0: 3c2f 636f 6465 3e20 6f72 203c 636f 6465 or #SOAP_FILE. Using │ │ │ +0015afe0: 2353 4f41 505f 4854 4d4c 3c2f 636f 6465 #SOAP_HTML sets the conte │ │ │ +0015b000: 6e74 2d74 7970 6520 6865 6164 6572 2074 nt-type header t │ │ │ +0015b010: 6f20 3c63 6f64 653e 7465 7874 2f68 746d o text/htm │ │ │ +0015b020: 6c3b 2063 6861 7273 6574 3d75 7466 2d38 l; charset=utf-8 │ │ │ +0015b030: 3c2f 636f 6465 3e2e 2055 7369 6e67 203c . Using < │ │ │ +0015b040: 636f 6465 3e23 534f 4150 5f46 494c 453c code>#SOAP_FILE< │ │ │ +0015b050: 2f63 6f64 653e 2073 6574 7320 7468 6520 /code> sets the │ │ │ +0015b060: 636f 6e74 656e 742d 7479 7065 2068 6561 content-type hea │ │ │ +0015b070: 6465 7220 746f 2074 6865 2076 616c 7565 der to the value │ │ │ +0015b080: 206f 6620 3c63 6f64 653e 3c61 2063 6c61 of soap::http_con │ │ │ +0015b150: 7465 6e74 3c2f 613e 3c2f 636f 6465 3e2e tent. │ │ │ +0015b160: 2045 7874 7261 2048 5454 5020 6865 6164 Extra HTTP head │ │ │ +0015b170: 6572 7320 6172 6520 6164 6465 6420 7768 ers are added wh │ │ │ +0015b180: 656e 203c 636f 6465 3e3c 6120 636c 6173 en soap::ht │ │ │ +0015b240: 7470 5f65 7874 7261 5f68 6561 6465 723c tp_extra_header< │ │ │ +0015b250: 2f61 3e3c 2f63 6f64 653e 2069 7320 7365 /a> is se │ │ │ +0015b260: 7420 746f 206f 6e65 206f 7220 6d6f 7265 t to one or more │ │ │ +0015b270: 2068 6561 6465 7220 6c69 6e65 7320 7365 header lines se │ │ │ +0015b280: 7061 7261 7465 6420 6279 2043 524c 462e parated by CRLF. │ │ │ +0015b290: 2057 6865 6e20 7265 6465 6669 6e69 6e67 When redefining │ │ │ +0015b2a0: 2074 6869 7320 6361 6c6c 6261 636b 2c20 this callback, │ │ │ +0015b2b0: 7573 6520 6675 6e63 7469 6f6e 203c 636f use function soap_sen │ │ │ +0015b330: 643c 2f61 3e3c 2f63 6f64 653e 2074 6f20 d to │ │ │ +0015b340: 7772 6974 6520 7468 6520 6865 6164 6572 write the header │ │ │ +0015b350: 2063 6f6e 7465 6e74 732e 2052 6574 7572 contents. Retur │ │ │ +0015b360: 6e73 203c 636f 6465 3e23 534f 4150 5f4f ns #SOAP_O │ │ │ +0015b370: 4b3c 2f63 6f64 653e 206f 7220 6120 3c63 K or a soap_status │ │ │ +0015b440: 3c2f 613e 3c2f 636f 6465 3e20 6572 726f erro │ │ │ +0015b450: 7220 636f 6465 2e20 5468 6520 6275 696c r code. The buil │ │ │ +0015b460: 742d 696e 2066 756e 6374 696f 6e20 6173 t-in function as │ │ │ +0015b470: 7369 676e 6564 2074 6f20 3c63 6f64 653e signed to │ │ │ +0015b480: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soa │ │ │ +0015b540: 703a 3a66 7265 7370 6f6e 7365 3c2f 613e p::fresponse │ │ │ +0015b550: 3c2f 636f 6465 3e20 6973 203c 636f 6465 is http_response.

    .

    < │ │ │ +0015b580: 6120 636c 6173 733d 2261 6e63 686f 7222 a class="anchor" │ │ │ +0015b590: 2069 643d 2261 7574 6f74 6f63 5f6d 6432 id="autotoc_md2 │ │ │ +0015b5a0: 3922 3e3c 2f61 3e0a 6672 6573 706f 6e73 9">.frespons │ │ │ +0015b5b0: 653c 2f68 333e 0a3c 703e 3c63 6f64 653e e

    .

    │ │ │ +0015b5c0: 696e 7420 283c 6120 636c 6173 733d 2265 int (soap::frespons │ │ │ +0015b690: 653c 2f61 3e29 2873 7472 7563 7420 736f e)(struct so │ │ │ +0015b6a0: 6170 202a 736f 6170 2c20 696e 7420 736f ap *soap, int so │ │ │ +0015b6b0: 6170 5f65 7272 6f72 5f63 6f64 652c 2055 ap_error_code, U │ │ │ +0015b6c0: 4c4f 4e47 3634 2063 6f75 6e74 293c 2f63 LONG64 count)

    .

    This │ │ │ +0015b6e0: 2063 616c 6c62 6163 6b20 6973 2063 616c callback is cal │ │ │ +0015b6f0: 6c65 6420 6174 2074 6865 2073 6572 7665 led at the serve │ │ │ +0015b700: 7220 7369 6465 2062 7920 7468 6520 656e r side by the en │ │ │ +0015b710: 6769 6e65 2074 6f20 7365 6e64 2074 6865 gine to send the │ │ │ +0015b720: 2048 5454 5020 6865 6164 6572 7320 746f HTTP headers to │ │ │ +0015b730: 2074 6865 2063 6f6e 6e65 6374 6564 2063 the connected c │ │ │ +0015b740: 6c69 656e 742e 2054 6865 2070 6172 616d lient. The param │ │ │ +0015b750: 6574 6572 203c 636f 6465 3e73 7461 7475 eter statu │ │ │ +0015b760: 733c 2f63 6f64 653e 2073 686f 756c 6420 s should │ │ │ +0015b770: 6265 2061 6e20 4854 5450 2073 7461 7475 be an HTTP statu │ │ │ +0015b780: 7320 6572 726f 7220 636f 6465 206f 7220 s error code or │ │ │ +0015b790: 3c63 6f64 653e 2353 4f41 505f 4f4b 3c2f #SOAP_OK (200 OK) o │ │ │ +0015b7b0: 7220 3c63 6f64 653e 2353 4f41 505f 4854 r #SOAP_HT │ │ │ +0015b7c0: 4d4c 3c2f 636f 6465 3e20 6f72 203c 636f ML or #SOAP_FILE. Using #SOAP_HTML sets the con │ │ │ +0015b810: 7465 6e74 2d74 7970 6520 6865 6164 6572 tent-type header │ │ │ +0015b820: 2074 6f20 3c63 6f64 653e 7465 7874 2f68 to text/h │ │ │ +0015b830: 746d 6c3b 2063 6861 7273 6574 3d75 7466 tml; charset=utf │ │ │ +0015b840: 2d38 3c2f 636f 6465 3e2e 2055 7369 6e67 -8. Using │ │ │ +0015b850: 203c 636f 6465 3e23 534f 4150 5f46 494c #SOAP_FIL │ │ │ +0015b860: 453c 2f63 6f64 653e 2073 6574 7320 7468 E sets th │ │ │ +0015b870: 6520 636f 6e74 656e 742d 7479 7065 2068 e content-type h │ │ │ +0015b880: 6561 6465 7220 746f 2074 6865 2076 616c eader to the val │ │ │ +0015b890: 7565 206f 6620 3c63 6f64 653e 3c61 2063 ue of soap::http_c │ │ │ +0015b960: 6f6e 7465 6e74 3c2f 613e 3c2f 636f 6465 ontent. Extra HTTP he │ │ │ +0015b980: 6164 6572 7320 6172 6520 6164 6465 6420 aders are added │ │ │ +0015b990: 7768 656e 203c 636f 6465 3e3c 6120 636c when soap:: │ │ │ +0015ba50: 6874 7470 5f65 7874 7261 5f68 6561 6465 http_extra_heade │ │ │ +0015ba60: 723c 2f61 3e3c 2f63 6f64 653e 2069 7320 r is │ │ │ +0015ba70: 7365 7420 746f 206f 6e65 206f 7220 6d6f set to one or mo │ │ │ +0015ba80: 7265 2068 6561 6465 7220 6c69 6e65 7320 re header lines │ │ │ +0015ba90: 7365 7061 7261 7465 6420 6279 2043 524c separated by CRL │ │ │ +0015baa0: 462e 2057 6865 6e20 7265 6465 6669 6e69 F. When redefini │ │ │ +0015bab0: 6e67 2074 6869 7320 6361 6c6c 6261 636b ng this callback │ │ │ +0015bac0: 2c20 7573 6520 6675 6e63 7469 6f6e 203c , use function < │ │ │ +0015bad0: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soap_s │ │ │ +0015bb40: 656e 643c 2f61 3e3c 2f63 6f64 653e 2074 end t │ │ │ +0015bb50: 6f20 7772 6974 6520 7468 6520 6865 6164 o write the head │ │ │ +0015bb60: 6572 2063 6f6e 7465 6e74 732e 2052 6574 er contents. Ret │ │ │ +0015bb70: 7572 6e73 203c 636f 6465 3e23 534f 4150 urns #SOAP │ │ │ +0015bb80: 5f4f 4b3c 2f63 6f64 653e 206f 7220 6120 _OK or a │ │ │ +0015bb90: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 soap_stat │ │ │ +0015bc50: 7573 3c2f 613e 3c2f 636f 6465 3e20 6572 us er │ │ │ +0015bc60: 726f 7220 636f 6465 2e20 5468 6520 6275 ror code. The bu │ │ │ +0015bc70: 696c 742d 696e 2066 756e 6374 696f 6e20 ilt-in function │ │ │ +0015bc80: 6173 7369 676e 6564 2074 6f20 3c63 6f64 assigned to s │ │ │ +0015bd50: 6f61 703a 3a66 7265 7370 6f6e 7365 3c2f oap::fresponse is http_response │ │ │ +0015bd80: 3c2f 636f 6465 3e2e 3c2f 703e 0a3c 6833 .

    .

    .fposth │ │ │ +0015bdc0: 6472 3c2f 6833 3e0a 3c70 3e3c 636f 6465 dr

    .

    int (soap::fposth │ │ │ +0015be80: 6472 3c2f 613e 2928 7374 7275 6374 2073 dr)(struct s │ │ │ +0015be90: 6f61 7020 2a73 6f61 702c 2063 6f6e 7374 oap *soap, const │ │ │ +0015bea0: 2063 6861 7220 2a6b 6579 2c20 636f 6e73 char *key, cons │ │ │ +0015beb0: 7420 6368 6172 202a 7661 6c29 3c2f 636f t char *val)

    .

    This │ │ │ +0015bed0: 6361 6c6c 6261 636b 2069 7320 6361 6c6c callback is call │ │ │ +0015bee0: 6564 2062 7920 3c63 6f64 653e 3c61 2063 ed by so │ │ │ +0015bfb0: 6170 3a3a 6670 6f73 743c 2f61 3e3c 2f63 ap::fpost and < │ │ │ +0015bfd0: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ +0015bfe0: 663d 2267 726f 7570 5f5f 6772 6f75 705f f="group__group_ │ │ │ +0015bff0: 5f63 616c 6c62 6163 6b73 2e68 746d 6c23 _callbacks.html# │ │ │ +0015c000: 6761 3364 3865 3865 3262 3761 6437 6631 ga3d8e8e2b7ad7f1 │ │ │ +0015c010: 6163 3939 3563 3238 3762 3361 3966 3637 ac995c287b3a9f67 │ │ │ +0015c020: 6139 2220 7469 746c 653d 2243 616c 6c62 a9" title="Callb │ │ │ +0015c030: 6163 6b20 7468 6174 2070 6f70 756c 6174 ack that populat │ │ │ +0015c040: 6573 2061 6e64 2074 6865 6e20 7365 6e64 es and then send │ │ │ +0015c050: 7320 4854 5450 2068 6561 6465 7273 2066 s HTTP headers f │ │ │ +0015c060: 726f 6d20 7468 6520 7365 7276 6572 2d73 rom the server-s │ │ │ +0015c070: 6964 6520 746f 2061 2063 6f6e 6e65 6374 ide to a connect │ │ │ +0015c080: 6564 2063 6c69 656e 742e 223e 736f 6170 ed client.">soap │ │ │ +0015c090: 3a3a 6672 6573 706f 6e73 653c 2f61 3e3c ::fresponse< │ │ │ +0015c0a0: 2f63 6f64 653e 2074 6f20 7365 6e64 2061 /code> to send a │ │ │ +0015c0b0: 6e20 4854 5450 2068 6561 6465 7220 7769 n HTTP header wi │ │ │ +0015c0c0: 7468 2061 206b 6579 2061 6e64 2061 6e20 th a key and an │ │ │ +0015c0d0: 6f70 7469 6f6e 616c 2076 616c 7565 2e20 optional value. │ │ │ +0015c0e0: 5265 7475 726e 7320 3c63 6f64 653e 2353 Returns #S │ │ │ +0015c0f0: 4f41 505f 4f4b 3c2f 636f 6465 3e20 6f72 OAP_OK or │ │ │ +0015c100: 2061 203c 636f 6465 3e3c 6120 636c 6173 a soap_s │ │ │ +0015c1c0: 7461 7475 733c 2f61 3e3c 2f63 6f64 653e tatus │ │ │ +0015c1d0: 2028 696e 7429 2065 7272 6f72 2063 6f64 (int) error cod │ │ │ +0015c1e0: 652e 2054 6865 2062 7569 6c74 2d69 6e20 e. The built-in │ │ │ +0015c1f0: 6675 6e63 7469 6f6e 2061 7373 6967 6e65 function assigne │ │ │ +0015c200: 6420 746f 203c 636f 6465 3e3c 6120 636c d to soap::f │ │ │ +0015c2b0: 706f 7374 6864 723c 2f61 3e3c 2f63 6f64 posthdr is http │ │ │ +0015c2d0: 5f70 6f73 745f 6865 6164 6572 3c2f 636f _post_header.

    .

    .fparse

    .

    int ( │ │ │ +0015c330: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap::fparse< │ │ │ +0015c3d0: 2f61 3e29 2873 7472 7563 7420 736f 6170 /a>)(struct soap │ │ │ +0015c3e0: 202a 736f 6170 293c 2f63 6f64 653e 3c2f *soap).

    This callb │ │ │ +0015c400: 6163 6b20 6973 2063 616c 6c65 6420 6279 ack is called by │ │ │ +0015c410: 2074 6865 2065 6e67 696e 6520 2861 7320 the engine (as │ │ │ +0015c420: 6120 636c 6965 6e74 206f 7220 7365 7276 a client or serv │ │ │ +0015c430: 6572 2920 746f 2072 6561 6420 616e 6420 er) to read and │ │ │ +0015c440: 7061 7273 6520 4854 5450 2068 6561 6465 parse HTTP heade │ │ │ +0015c450: 7273 206f 7220 4d49 4d45 2068 6561 6465 rs or MIME heade │ │ │ +0015c460: 7273 2e20 5768 656e 2072 6564 6566 696e rs. When redefin │ │ │ +0015c470: 6564 2c20 7468 6973 2066 756e 6374 696f ed, this functio │ │ │ +0015c480: 6e20 7368 6f75 6c64 2061 7420 7265 6164 n should at read │ │ │ +0015c490: 206f 7220 736b 6970 2074 6865 2065 6e74 or skip the ent │ │ │ +0015c4a0: 6972 6520 4854 5450 2068 6561 6465 7220 ire HTTP header │ │ │ +0015c4b0: 746f 2072 6561 6368 2074 6865 206d 6573 to reach the mes │ │ │ +0015c4c0: 7361 6765 2062 6f64 792e 2046 756e 6374 sage body. Funct │ │ │ +0015c4d0: 696f 6e20 3c63 6f64 653e 3c61 2063 6c61 ion soap_getline< │ │ │ +0015c550: 2f61 3e3c 2f63 6f64 653e 2069 7320 7573 /a> is us │ │ │ +0015c560: 6564 2062 7920 7468 6973 2063 616c 6c62 ed by this callb │ │ │ +0015c570: 6163 6b20 746f 2072 6561 6420 6561 6368 ack to read each │ │ │ +0015c580: 2068 6561 6465 7220 6c69 6e65 2069 6e74 header line int │ │ │ +0015c590: 6f20 616e 2069 6e74 6572 6e61 6c20 6275 o an internal bu │ │ │ +0015c5a0: 6666 6572 203c 636f 6465 3e3c 6120 636c ffer soap::msgbuf< │ │ │ +0015c670: 2f61 3e3c 2f63 6f64 653e 2077 6974 6820 /a> with │ │ │ +0015c680: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 s │ │ │ +0015c6f0: 6f61 705f 6765 746c 696e 653c 2f61 3e28 oap_getline( │ │ │ +0015c700: 736f 6170 2c20 736f 6170 2d26 6774 3b6d soap, soap->m │ │ │ +0015c710: 7367 6275 662c 2073 697a 656f 6628 736f sgbuf, sizeof(so │ │ │ +0015c720: 6170 2d26 6774 3b6d 7367 6275 6629 293c ap->msgbuf))< │ │ │ +0015c730: 2f63 6f64 653e 2e20 5265 7475 726e 7320 /code>. Returns │ │ │ +0015c740: 3c63 6f64 653e 2353 4f41 505f 4f4b 3c2f #SOAP_OK, or a gSOA │ │ │ +0015c760: 5020 6572 726f 7220 636f 6465 2e20 5468 P error code. Th │ │ │ +0015c770: 6520 6275 696c 742d 696e 2066 756e 6374 e built-in funct │ │ │ +0015c780: 696f 6e20 6173 7369 676e 6564 2074 6f20 ion assigned to │ │ │ +0015c790: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 soap::f │ │ │ +0015c830: 7061 7273 653c 2f61 3e3c 2f63 6f64 653e parse │ │ │ +0015c840: 2069 7320 3c63 6f64 653e 6874 7470 5f70 is http_p │ │ │ +0015c850: 6172 7365 3c2f 636f 6465 3e2e 3c2f 703e arse.

    │ │ │ +0015c860: 0a3c 6833 3e3c 6120 636c 6173 733d 2261 .

    .fp │ │ │ +0015c890: 6172 7365 6864 723c 2f68 333e 0a3c 703e arsehdr

    .

    │ │ │ +0015c8a0: 3c63 6f64 653e 696e 7420 283c 6120 636c int (soap::fparsehdr │ │ │ +0015c960: 3c2f 613e 2928 7374 7275 6374 2073 6f61 )(struct soa │ │ │ +0015c970: 7020 2a73 6f61 702c 2063 6f6e 7374 2063 p *soap, const c │ │ │ +0015c980: 6861 7220 2a6b 6579 2c20 636f 6e73 7420 har *key, const │ │ │ +0015c990: 6368 6172 202a 7661 6c29 3c2f 636f 6465 char *val)

    .

    This ca │ │ │ +0015c9b0: 6c6c 6261 636b 2069 7320 6361 6c6c 6564 llback is called │ │ │ +0015c9c0: 2062 7920 3c63 6f64 653e 3c61 2063 6c61 by soa │ │ │ +0015ca60: 703a 3a66 7061 7273 653c 2f61 3e3c 2f63 p::fparse, consumes a │ │ │ +0015ca80: 6e20 4854 5450 2068 6561 6465 7220 7468 n HTTP header th │ │ │ +0015ca90: 6174 2069 7320 7370 6c69 7420 696e 2061 at is split in a │ │ │ +0015caa0: 206b 6579 2d76 616c 7565 2070 6169 7220 key-value pair │ │ │ +0015cab0: 616e 6420 7570 6461 7465 7320 7468 6520 and updates the │ │ │ +0015cac0: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 soap context state │ │ │ +0015cb30: 6163 636f 7264 696e 676c 792e 2054 6865 accordingly. The │ │ │ +0015cb40: 2063 6f6e 7465 7874 2069 7320 7570 6461 context is upda │ │ │ +0015cb50: 7465 6420 7769 7468 2074 6865 2048 5454 ted with the HTT │ │ │ +0015cb60: 5020 6865 6164 6572 2069 6e66 6f72 6d61 P header informa │ │ │ +0015cb70: 7469 6f6e 2072 6563 6569 7665 642c 2062 tion received, b │ │ │ +0015cb80: 7574 2048 5454 5020 6865 6164 6572 7320 ut HTTP headers │ │ │ +0015cb90: 6172 6520 6e6f 7420 6c69 7465 7261 6c6c are not literall │ │ │ +0015cba0: 7920 7265 7461 696e 6564 2062 7920 7468 y retained by th │ │ │ +0015cbb0: 6520 656e 6769 6e65 2e20 5265 7475 726e e engine. Return │ │ │ +0015cbc0: 7320 3c63 6f64 653e 2353 4f41 505f 4f4b s #SOAP_OK │ │ │ +0015cbd0: 3c2f 636f 6465 3e20 6f72 203c 636f 6465 or #SOAP_STOP to prevent fu │ │ │ +0015cc00: 7274 6865 7220 7265 6164 696e 6720 6f66 rther reading of │ │ │ +0015cc10: 2074 6865 2048 5454 5020 626f 6479 2c20 the HTTP body, │ │ │ +0015cc20: 6f72 2061 203c 636f 6465 3e3c 6120 636c or a soap │ │ │ +0015cce0: 5f73 7461 7475 733c 2f61 3e3c 2f63 6f64 _status (int) error c │ │ │ +0015cd00: 6f64 652e 2054 6865 2062 7569 6c74 2d69 ode. The built-i │ │ │ +0015cd10: 6e20 6675 6e63 7469 6f6e 2061 7373 6967 n function assig │ │ │ +0015cd20: 6e65 6420 746f 203c 636f 6465 3e3c 6120 ned to soap::fparseh │ │ │ +0015cde0: 6472 3c2f 613e 3c2f 636f 6465 3e20 6973 dr is │ │ │ +0015cdf0: 203c 636f 6465 3e68 7474 705f 7061 7273 http_pars │ │ │ +0015ce00: 655f 6865 6164 6572 3c2f 636f 6465 3e2e e_header. │ │ │ +0015ce10: 3c2f 703e 0a3c 6833 3e3c 6120 636c 6173

    .

    .fget

    .

    < │ │ │ +0015ce50: 636f 6465 3e69 6e74 2028 3c61 2063 6c61 code>int (soap │ │ │ +0015cf20: 3a3a 6667 6574 3c2f 613e 2928 7374 7275 ::fget)(stru │ │ │ +0015cf30: 6374 2073 6f61 7020 2a73 6f61 7029 3c2f ct soap *soap)

    .

    Thi │ │ │ +0015cf50: 7320 6361 6c6c 6261 636b 2069 7320 6361 s callback is ca │ │ │ +0015cf60: 6c6c 6564 2062 7920 7468 6520 7365 7276 lled by the serv │ │ │ +0015cf70: 6963 6520 6469 7370 6174 6368 6572 2077 ice dispatcher w │ │ │ +0015cf80: 6865 6e20 616e 2048 5454 5020 4745 5420 hen an HTTP GET │ │ │ +0015cf90: 7265 7175 6573 7420 6973 2070 656e 6469 request is pendi │ │ │ +0015cfa0: 6e67 2e20 5265 6465 6669 6e65 2074 6869 ng. Redefine thi │ │ │ +0015cfb0: 7320 6361 6c6c 6261 636b 2074 6f20 7265 s callback to re │ │ │ +0015cfc0: 7370 6f6e 6420 746f 2048 5454 5020 4745 spond to HTTP GE │ │ │ +0015cfd0: 5420 7265 7175 6573 7473 2077 6974 6820 T requests with │ │ │ +0015cfe0: 636f 6e74 656e 742c 2073 6565 2074 6865 content, see the │ │ │ +0015cff0: 203c 636f 6465 3e3c 6120 636c 6173 733d http_get │ │ │ +0015d080: 3c2f 613e 3c2f 636f 6465 3e20 4854 5450 HTTP │ │ │ +0015d090: 2047 4554 2070 6c75 6769 6e20 666f 7220 GET plugin for │ │ │ +0015d0a0: 6d6f 7265 2064 6574 6169 6c73 2e20 5265 more details. Re │ │ │ +0015d0b0: 7475 726e 7320 3c63 6f64 653e 2353 4f41 turns #SOA │ │ │ +0015d0c0: 505f 4f4b 3c2f 636f 6465 3e20 6f72 2061 P_OK or a │ │ │ +0015d0d0: 203c 636f 6465 3e3c 6120 636c 6173 733d soap_sta │ │ │ +0015d190: 7475 733c 2f61 3e3c 2f63 6f64 653e 2028 tus ( │ │ │ +0015d1a0: 696e 7429 2065 7272 6f72 2063 6f64 652e int) error code. │ │ │ +0015d1b0: 2054 6865 2062 7569 6c74 2d69 6e20 6675 The built-in fu │ │ │ +0015d1c0: 6e63 7469 6f6e 2061 7373 6967 6e65 6420 nction assigned │ │ │ +0015d1d0: 746f 203c 636f 6465 3e3c 6120 636c 6173 to soap: │ │ │ +0015d2a0: 3a66 6765 743c 2f61 3e3c 2f63 6f64 653e :fget │ │ │ +0015d2b0: 2069 7320 7468 6520 696e 7465 726e 616c is the internal │ │ │ +0015d2c0: 2073 7461 7469 6320 6675 6e63 7469 6f6e static function │ │ │ +0015d2d0: 203c 636f 6465 3e68 7474 705f 6765 743c http_get< │ │ │ +0015d2e0: 2f63 6f64 653e 2074 6861 7420 7265 7475 /code> that retu │ │ │ +0015d2f0: 726e 7320 7468 6520 3c63 6f64 653e 2353 rns the #S │ │ │ +0015d300: 4f41 505f 4745 545f 4d45 5448 4f44 3c2f OAP_GET_METHOD error.

    │ │ │ +0015d320: 0a3c 6833 3e3c 6120 636c 6173 733d 2261 .

    .fp │ │ │ +0015d350: 7574 3c2f 6833 3e0a 3c70 3e3c 636f 6465 ut

    .

    int (soap::fp │ │ │ +0015d430: 7574 3c2f 613e 2928 7374 7275 6374 2073 ut)(struct s │ │ │ +0015d440: 6f61 7020 2a73 6f61 7029 3c2f 636f 6465 oap *soap)

    .

    This ca │ │ │ +0015d460: 6c6c 6261 636b 2069 7320 6361 6c6c 6564 llback is called │ │ │ +0015d470: 2062 7920 7468 6520 7365 7276 6963 6520 by the service │ │ │ +0015d480: 6469 7370 6174 6368 6572 2077 6865 6e20 dispatcher when │ │ │ +0015d490: 616e 2048 5454 5020 5055 5420 7265 7175 an HTTP PUT requ │ │ │ +0015d4a0: 6573 7420 6973 2070 656e 6469 6e67 2e20 est is pending. │ │ │ +0015d4b0: 5265 6465 6669 6e65 2074 6869 7320 6361 Redefine this ca │ │ │ +0015d4c0: 6c6c 6261 636b 2074 6f20 7265 7370 6f6e llback to respon │ │ │ +0015d4d0: 6420 746f 2048 5454 5020 5055 5420 7265 d to HTTP PUT re │ │ │ +0015d4e0: 7175 6573 7473 2c20 7365 6520 7468 6520 quests, see the │ │ │ +0015d4f0: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 http_pos │ │ │ +0015d580: 743c 2f61 3e3c 2f63 6f64 653e 2048 5454 t HTT │ │ │ +0015d590: 5020 504f 5354 2070 6c75 6769 6e20 666f P POST plugin fo │ │ │ +0015d5a0: 7220 6d6f 7265 2064 6574 6169 6c73 2e20 r more details. │ │ │ +0015d5b0: 5265 7475 726e 7320 3c63 6f64 653e 2353 Returns #S │ │ │ +0015d5c0: 4f41 505f 4f4b 3c2f 636f 6465 3e20 6f72 OAP_OK or │ │ │ +0015d5d0: 2061 203c 636f 6465 3e3c 6120 636c 6173 a soap_s │ │ │ +0015d690: 7461 7475 733c 2f61 3e3c 2f63 6f64 653e tatus │ │ │ +0015d6a0: 2065 7272 6f72 2063 6f64 652e 2054 6865 error code. The │ │ │ +0015d6b0: 2062 7569 6c74 2d69 6e20 6675 6e63 7469 built-in functi │ │ │ +0015d6c0: 6f6e 2061 7373 6967 6e65 6420 746f 203c on assigned to < │ │ │ +0015d6d0: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soap::fpu │ │ │ +0015d7a0: 743c 2f61 3e3c 2f63 6f64 653e 2069 7320 t is │ │ │ +0015d7b0: 7468 6520 696e 7465 726e 616c 2073 7461 the internal sta │ │ │ +0015d7c0: 7469 6320 6675 6e63 7469 6f6e 203c 636f tic function http_put that returns │ │ │ +0015d7f0: 7468 6520 3c63 6f64 653e 2353 4f41 505f the #SOAP_ │ │ │ +0015d800: 5055 545f 4d45 5448 4f44 3c2f 636f 6465 PUT_METHOD error.

    .

    .fpatch │ │ │ +0015d850: 3c2f 6833 3e0a 3c70 3e3c 636f 6465 3e69

    .

    i │ │ │ +0015d860: 6e74 2028 3c61 2063 6c61 7373 3d22 656c nt (soap:: │ │ │ +0015d930: 6670 6174 6368 3c2f 613e 2928 7374 7275 fpatch)(stru │ │ │ +0015d940: 6374 2073 6f61 7020 2a73 6f61 7029 3c2f ct soap *soap)

    .

    Thi │ │ │ +0015d960: 7320 6361 6c6c 6261 636b 2069 7320 6361 s callback is ca │ │ │ +0015d970: 6c6c 6564 2062 7920 7468 6520 7365 7276 lled by the serv │ │ │ +0015d980: 6963 6520 6469 7370 6174 6368 6572 2077 ice dispatcher w │ │ │ +0015d990: 6865 6e20 616e 2048 5454 5020 5041 5443 hen an HTTP PATC │ │ │ +0015d9a0: 4820 7265 7175 6573 7420 6973 2070 656e H request is pen │ │ │ +0015d9b0: 6469 6e67 2e20 5265 6465 6669 6e65 2074 ding. Redefine t │ │ │ +0015d9c0: 6869 7320 6361 6c6c 6261 636b 2074 6f20 his callback to │ │ │ +0015d9d0: 7265 7370 6f6e 6420 746f 2048 5454 5020 respond to HTTP │ │ │ +0015d9e0: 5041 5443 4820 7265 7175 6573 7473 2c20 PATCH requests, │ │ │ +0015d9f0: 7365 6520 7468 6520 3c63 6f64 653e 3c61 see the │ │ │ +0015da80: 6874 7470 5f70 6f73 743c 2f61 3e3c 2f63 http_post HTTP POST p │ │ │ +0015daa0: 6c75 6769 6e20 666f 7220 6d6f 7265 2064 lugin for more d │ │ │ +0015dab0: 6574 6169 6c73 2e20 5265 7475 726e 7320 etails. Returns │ │ │ +0015dac0: 3c63 6f64 653e 2353 4f41 505f 4f4b 3c2f #SOAP_OK or a soap_status error c │ │ │ +0015dbb0: 6f64 652e 2054 6865 2062 7569 6c74 2d69 ode. The built-i │ │ │ +0015dbc0: 6e20 6675 6e63 7469 6f6e 2061 7373 6967 n function assig │ │ │ +0015dbd0: 6e65 6420 746f 203c 636f 6465 3e3c 6120 ned to soap::fpatch< │ │ │ +0015dcb0: 2f61 3e3c 2f63 6f64 653e 2069 7320 7468 /a> is th │ │ │ +0015dcc0: 6520 696e 7465 726e 616c 2073 7461 7469 e internal stati │ │ │ +0015dcd0: 6320 6675 6e63 7469 6f6e 203c 636f 6465 c function http_patch that returns │ │ │ +0015dd00: 7468 6520 3c63 6f64 653e 2353 4f41 505f the #SOAP_ │ │ │ +0015dd10: 5041 5443 485f 4d45 5448 4f44 3c2f 636f PATCH_METHOD error.

    .< │ │ │ +0015dd30: 6833 3e3c 6120 636c 6173 733d 2261 6e63 h3>.fdel │ │ │ +0015dd60: 3c2f 6833 3e0a 3c70 3e3c 636f 6465 3e69 .

    i │ │ │ +0015dd70: 6e74 2028 3c61 2063 6c61 7373 3d22 656c nt (soap:: │ │ │ +0015de40: 6664 656c 3c2f 613e 2928 7374 7275 6374 fdel)(struct │ │ │ +0015de50: 2073 6f61 7020 2a73 6f61 7029 3c2f 636f soap *soap)

    .

    This │ │ │ +0015de70: 6361 6c6c 6261 636b 2069 7320 6361 6c6c callback is call │ │ │ +0015de80: 6564 2062 7920 7468 6520 7365 7276 6963 ed by the servic │ │ │ +0015de90: 6520 6469 7370 6174 6368 6572 2077 6865 e dispatcher whe │ │ │ +0015dea0: 6e20 616e 2048 5454 5020 4445 4c45 5445 n an HTTP DELETE │ │ │ +0015deb0: 2072 6571 7565 7374 2069 7320 7065 6e64 request is pend │ │ │ +0015dec0: 696e 672e 2052 6564 6566 696e 6520 7468 ing. Redefine th │ │ │ +0015ded0: 6973 2063 616c 6c62 6163 6b20 746f 2072 is callback to r │ │ │ +0015dee0: 6573 706f 6e64 2074 6f20 4854 5450 2044 espond to HTTP D │ │ │ +0015def0: 454c 4554 4520 7265 7175 6573 7473 2c20 ELETE requests, │ │ │ +0015df00: 7365 6520 7468 6520 3c63 6f64 653e 3c61 see the │ │ │ +0015df90: 6874 7470 5f70 6f73 743c 2f61 3e3c 2f63 http_post HTTP POST p │ │ │ +0015dfb0: 6c75 6769 6e20 666f 7220 6d6f 7265 2064 lugin for more d │ │ │ +0015dfc0: 6574 6169 6c73 2e20 5265 7475 726e 7320 etails. Returns │ │ │ +0015dfd0: 3c63 6f64 653e 2353 4f41 505f 4f4b 3c2f #SOAP_OK or a soap_status (int) e │ │ │ +0015e0c0: 7272 6f72 2063 6f64 652e 2054 6865 2062 rror code. The b │ │ │ +0015e0d0: 7569 6c74 2d69 6e20 6675 6e63 7469 6f6e uilt-in function │ │ │ +0015e0e0: 2061 7373 6967 6e65 6420 746f 203c 636f assigned to soap::f │ │ │ +0015e1c0: 6465 6c3c 2f61 3e3c 2f63 6f64 653e 2069 del i │ │ │ +0015e1d0: 7320 7468 6520 696e 7465 726e 616c 2073 s the internal s │ │ │ +0015e1e0: 7461 7469 6320 6675 6e63 7469 6f6e 203c tatic function < │ │ │ +0015e1f0: 636f 6465 3e68 7474 705f 6465 6c3c 2f63 code>http_del that return │ │ │ +0015e210: 7320 7468 6520 3c63 6f64 653e 2353 4f41 s the #SOA │ │ │ +0015e220: 505f 4445 4c5f 4d45 5448 4f44 3c2f 636f P_DEL_METHOD error.

    .< │ │ │ +0015e240: 6833 3e3c 6120 636c 6173 733d 2261 6e63 h3>.fopt │ │ │ +0015e270: 3c2f 6833 3e0a 3c70 3e3c 636f 6465 3e69 .

    i │ │ │ +0015e280: 6e74 2028 3c61 2063 6c61 7373 3d22 656c nt (soap:: │ │ │ +0015e350: 666f 7074 3c2f 613e 2928 7374 7275 6374 fopt)(struct │ │ │ +0015e360: 2073 6f61 7020 2a73 6f61 7029 3c2f 636f soap *soap)

    .

    Calle │ │ │ +0015e380: 6420 6279 2074 6865 2073 6572 7669 6365 d by the service │ │ │ +0015e390: 2064 6973 7061 7463 6865 7220 7768 656e dispatcher when │ │ │ +0015e3a0: 2061 6e20 4854 5450 204f 5054 494f 4e20 an HTTP OPTION │ │ │ +0015e3b0: 7265 7175 6573 7420 6973 2070 656e 6469 request is pendi │ │ │ +0015e3c0: 6e67 2e20 5265 6465 6669 6e65 2074 6869 ng. Redefine thi │ │ │ +0015e3d0: 7320 6361 6c6c 6261 636b 2074 6f20 7265 s callback to re │ │ │ +0015e3e0: 7370 6f6e 6420 746f 2048 5454 5020 4f50 spond to HTTP OP │ │ │ +0015e3f0: 5449 4f4e 2072 6571 7565 7374 732c 2073 TION requests, s │ │ │ +0015e400: 6565 2074 6865 203c 636f 6465 3e3c 6120 ee the h │ │ │ +0015e490: 7474 705f 706f 7374 3c2f 613e 3c2f 636f ttp_post HTTP POST pl │ │ │ +0015e4b0: 7567 696e 2066 6f72 206d 6f72 6520 6465 ugin for more de │ │ │ +0015e4c0: 7461 696c 732e 2052 6574 7572 6e73 203c tails. Returns < │ │ │ +0015e4d0: 636f 6465 3e23 534f 4150 5f4f 4b3c 2f63 code>#SOAP_OK or a │ │ │ +0015e4f0: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap_status │ │ │ +0015e5b0: 3c2f 636f 6465 3e20 2869 6e74 2920 6572 (int) er │ │ │ +0015e5c0: 726f 7220 636f 6465 2e20 5468 6520 6275 ror code. The bu │ │ │ +0015e5d0: 696c 742d 696e 2066 756e 6374 696f 6e20 ilt-in function │ │ │ +0015e5e0: 6173 7369 676e 6564 2074 6f20 3c63 6f64 assigned to soap::fo │ │ │ +0015e6c0: 7074 3c2f 613e 3c2f 636f 6465 3e20 6973 pt is │ │ │ +0015e6d0: 2074 6865 2069 6e74 6572 6e61 6c20 7374 the internal st │ │ │ +0015e6e0: 6174 6963 2066 756e 6374 696f 6e20 3c63 atic function http_200 that returns │ │ │ +0015e710: 2048 5454 5020 3230 3020 4f4b 2e3c 2f70 HTTP 200 OK.

    .

    .f │ │ │ +0015e750: 6865 6164 3c2f 6833 3e0a 3c70 3e3c 636f head

    .

    int (soap: │ │ │ +0015e830: 3a66 6865 6164 3c2f 613e 2928 7374 7275 :fhead)(stru │ │ │ +0015e840: 6374 2073 6f61 7020 2a73 6f61 7029 3c2f ct soap *soap)

    .

    Thi │ │ │ +0015e860: 7320 6361 6c6c 6261 636b 2069 7320 6361 s callback is ca │ │ │ +0015e870: 6c6c 6564 2062 7920 7468 6520 7365 7276 lled by the serv │ │ │ +0015e880: 6963 6520 6469 7370 6174 6368 6572 2077 ice dispatcher w │ │ │ +0015e890: 6865 6e20 616e 2048 5454 5020 4845 4144 hen an HTTP HEAD │ │ │ +0015e8a0: 2072 6571 7565 7374 2069 7320 7065 6e64 request is pend │ │ │ +0015e8b0: 696e 672e 2052 6564 6566 696e 6520 7468 ing. Redefine th │ │ │ +0015e8c0: 6973 2063 616c 6c62 6163 6b20 746f 2072 is callback to r │ │ │ +0015e8d0: 6573 706f 6e64 2074 6f20 4854 5450 2048 espond to HTTP H │ │ │ +0015e8e0: 4541 4420 7265 7175 6573 7473 206d 6f72 EAD requests mor │ │ │ +0015e8f0: 6520 7370 6563 6966 6963 616c 6c79 2e20 e specifically. │ │ │ +0015e900: 5265 7475 726e 7320 3c63 6f64 653e 2353 Returns #S │ │ │ +0015e910: 4f41 505f 4f4b 3c2f 636f 6465 3e20 6f72 OAP_OK or │ │ │ +0015e920: 2061 203c 636f 6465 3e3c 6120 636c 6173 a soap_s │ │ │ +0015e9e0: 7461 7475 733c 2f61 3e3c 2f63 6f64 653e tatus │ │ │ +0015e9f0: 2028 696e 7429 2065 7272 6f72 2063 6f64 (int) error cod │ │ │ +0015ea00: 652e 2054 6865 2062 7569 6c74 2d69 6e20 e. The built-in │ │ │ +0015ea10: 6675 6e63 7469 6f6e 2061 7373 6967 6e65 function assigne │ │ │ +0015ea20: 6420 746f 203c 636f 6465 3e3c 6120 636c d to so │ │ │ +0015eaf0: 6170 3a3a 6668 6561 643c 2f61 3e3c 2f63 ap::fhead is the inte │ │ │ +0015eb10: 726e 616c 2073 7461 7469 6320 6675 6e63 rnal static func │ │ │ +0015eb20: 7469 6f6e 203c 636f 6465 3e68 7474 705f tion http_ │ │ │ +0015eb30: 3230 303c 2f63 6f64 653e 2074 6861 7420 200 that │ │ │ +0015eb40: 7265 7475 726e 7320 4854 5450 2032 3030 returns HTTP 200 │ │ │ +0015eb50: 204f 4b2e 3c2f 703e 0a3c 6833 3e3c 6120 OK.

    .

    .fform

    │ │ │ +0015eb90: 0a3c 703e 3c63 6f64 653e 696e 7420 283c .

    int (< │ │ │ +0015eba0: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ +0015ebb0: 663d 2267 726f 7570 5f5f 6772 6f75 705f f="group__group_ │ │ │ +0015ebc0: 5f63 616c 6c62 6163 6b73 2e68 746d 6c23 _callbacks.html# │ │ │ +0015ebd0: 6761 3035 3263 6466 3133 6533 3832 6234 ga052cdf13e382b4 │ │ │ +0015ebe0: 6166 3364 3136 3132 3839 3535 3534 3636 af3d161289555466 │ │ │ +0015ebf0: 3731 2220 7469 746c 653d 2243 616c 6c62 71" title="Callb │ │ │ +0015ec00: 6163 6b20 746f 2069 6d70 6c65 6d65 6e74 ack to implement │ │ │ +0015ec10: 206c 6f67 6963 2061 7420 7468 6520 7365 logic at the se │ │ │ +0015ec20: 7276 6572 2d73 6964 6520 746f 2068 616e rver-side to han │ │ │ +0015ec30: 646c 6520 4854 4d4c 2066 6f72 6d73 2c20 dle HTML forms, │ │ │ +0015ec40: 7375 6368 2061 7320 646f 6e65 2062 7920 such as done by │ │ │ +0015ec50: 7468 6520 6361 6c6c 6261 636b 7320 7072 the callbacks pr │ │ │ +0015ec60: 2e2e 2e22 3e73 6f61 703a 3a66 666f 726d ...">soap::fform │ │ │ +0015ec70: 3c2f 613e 2928 7374 7275 6374 2073 6f61 )(struct soa │ │ │ +0015ec80: 7020 2a73 6f61 7029 3c2f 636f 6465 3e3c p *soap)< │ │ │ +0015ec90: 2f70 3e0a 3c70 3e54 6869 7320 6361 6c6c /p>.

    This call │ │ │ +0015eca0: 6261 636b 2069 7320 6361 6c6c 6564 2062 back is called b │ │ │ +0015ecb0: 7920 7468 6520 4854 5450 2046 4f52 4d20 y the HTTP FORM │ │ │ +0015ecc0: 6861 6e64 6c65 7220 706c 7567 696e 2074 handler plugin t │ │ │ +0015ecd0: 6f20 7061 7273 6520 4854 4d4c 2066 6f72 o parse HTML for │ │ │ +0015ece0: 6d73 2072 6563 6569 7665 6420 7769 7468 ms received with │ │ │ +0015ecf0: 2048 5454 5020 504f 5354 2061 6e64 2050 HTTP POST and P │ │ │ +0015ed00: 5554 2072 6571 7565 7374 732c 2073 6565 UT requests, see │ │ │ +0015ed10: 2074 6865 203c 636f 6465 3e3b 3a68 7474 the ;:htt │ │ │ +0015ed20: 705f 666f 726d 3c2f 636f 6465 3e20 4854 p_form HT │ │ │ +0015ed30: 5450 2046 4f52 4d20 706c 7567 696e 2066 TP FORM plugin f │ │ │ +0015ed40: 6f72 206d 6f72 6520 6465 7461 696c 732e or more details. │ │ │ +0015ed50: 2054 6865 2048 5454 5020 626f 6479 2077 The HTTP body w │ │ │ +0015ed60: 6974 6820 7468 6520 666f 726d 2064 6174 ith the form dat │ │ │ +0015ed70: 6120 7368 6f75 6c64 2062 6520 7061 7273 a should be pars │ │ │ +0015ed80: 6564 2062 7920 7468 6973 2063 616c 6c62 ed by this callb │ │ │ +0015ed90: 6163 6b2c 206f 7468 6572 7769 7365 2048 ack, otherwise H │ │ │ +0015eda0: 5454 5020 6b65 6570 2d61 6c69 7665 206d TTP keep-alive m │ │ │ +0015edb0: 6573 7361 6765 7320 7769 6c6c 2065 6e64 essages will end │ │ │ +0015edc0: 2075 7020 6f75 7420 6f66 2073 796e 6320 up out of sync │ │ │ +0015edd0: 6173 2061 2072 6573 756c 7420 6f66 2074 as a result of t │ │ │ +0015ede0: 6865 2063 7572 7265 6e74 2070 6f73 6974 he current posit │ │ │ +0015edf0: 696f 6e20 6e6f 7420 6265 696e 6720 6164 ion not being ad │ │ │ +0015ee00: 7661 6e63 6564 2074 6f20 7468 6520 656e vanced to the en │ │ │ +0015ee10: 6420 6f66 2074 6865 2048 5454 5020 626f d of the HTTP bo │ │ │ +0015ee20: 6479 2e20 5265 7475 726e 7320 3c63 6f64 dy. Returns #SOAP_OK or a so │ │ │ +0015ef00: 6170 5f73 7461 7475 733c 2f61 3e3c 2f63 ap_status (int) error │ │ │ +0015ef20: 2063 6f64 652e 204e 6f20 6275 696c 742d code. No built- │ │ │ +0015ef30: 696e 2066 756e 6374 696f 6e20 6973 2061 in function is a │ │ │ +0015ef40: 7373 6967 6e65 6420 746f 203c 636f 6465 ssigned to soap::ffo │ │ │ +0015f020: 726d 3c2f 613e 3c2f 636f 6465 3e2e 3c2f rm..

    . │ │ │ +0015f060: 6668 6561 6465 723c 2f68 333e 0a3c 703e fheader

    .

    │ │ │ +0015f070: 3c63 6f64 653e 696e 7420 283c 6120 636c int (soap::fheader)(struct soap │ │ │ +0015f160: 2a73 6f61 7029 3c2f 636f 6465 3e3c 2f70 *soap)

    .

    This callba │ │ │ +0015f180: 636b 2069 7320 6361 6c6c 6564 2069 6d6d ck is called imm │ │ │ +0015f190: 6564 6961 7465 6c79 2061 6674 6572 2070 ediately after p │ │ │ +0015f1a0: 6172 7369 6e67 2061 2053 4f41 5020 4865 arsing a SOAP He │ │ │ +0015f1b0: 6164 6572 2069 6e74 6f20 7468 6520 3c63 ader into the soap │ │ │ +0015f280: 3a3a 6865 6164 6572 3c2f 613e 3c2f 636f ::header structure. T │ │ │ +0015f2a0: 6865 2053 4f41 5020 4865 6164 6572 2073 he SOAP Header s │ │ │ +0015f2b0: 7472 7563 7475 7265 203c 636f 6465 3e3c tructure < │ │ │ +0015f2c0: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ +0015f2d0: 663d 2273 7472 7563 7473 6f61 702e 6874 f="structsoap.ht │ │ │ +0015f2e0: 6d6c 2361 6330 3931 6466 6534 6530 3162 ml#ac091dfe4e01b │ │ │ +0015f2f0: 3661 3038 3264 3931 3663 3338 3165 3730 6a082d916c381e70 │ │ │ +0015f300: 3036 6261 2220 7469 746c 653d 2254 6865 06ba" title="The │ │ │ +0015f310: 2073 6f61 703a 3a68 6561 6465 7220 706f soap::header po │ │ │ +0015f320: 696e 7473 2074 6f20 6120 534f 4150 5f45 ints to a SOAP_E │ │ │ +0015f330: 4e56 5f5f 4865 6164 6572 2073 7472 7563 NV__Header struc │ │ │ +0015f340: 7475 7265 2077 6974 6820 7468 6520 534f ture with the SO │ │ │ +0015f350: 4150 2048 6561 6465 7220 7468 6174 2077 AP Header that w │ │ │ +0015f360: 6173 2072 6563 6569 7665 6420 6f72 2074 as received or t │ │ │ +0015f370: 6861 2e2e 2e22 3e73 6f61 703a 3a68 6561 ha...">soap::hea │ │ │ +0015f380: 6465 723c 2f61 3e3c 2f63 6f64 653e 2063 der c │ │ │ +0015f390: 616e 2062 6520 696e 7370 6563 7465 6420 an be inspected │ │ │ +0015f3a0: 6279 2074 6869 7320 6675 6e63 7469 6f6e by this function │ │ │ +0015f3b0: 2061 6e64 2076 6572 6966 6965 6420 6f72 and verified or │ │ │ +0015f3c0: 2072 656a 6563 7465 6420 6265 666f 7265 rejected before │ │ │ +0015f3d0: 2074 6865 2072 6573 7420 6f66 2074 6865 the rest of the │ │ │ +0015f3e0: 206d 6573 7361 6765 2077 6974 6820 7468 message with th │ │ │ +0015f3f0: 6520 534f 4150 2042 6f64 7920 6973 2063 e SOAP Body is c │ │ │ +0015f400: 6f6e 7375 6d65 642e 2052 6574 7572 6e73 onsumed. Returns │ │ │ +0015f410: 203c 636f 6465 3e23 534f 4150 5f4f 4b3c #SOAP_OK< │ │ │ +0015f420: 2f63 6f64 653e 206f 7220 6120 3c63 6f64 /code> or a soap_status (int) │ │ │ +0015f500: 6572 726f 7220 636f 6465 2e20 4e6f 2062 error code. No b │ │ │ +0015f510: 7569 6c74 2d69 6e20 6675 6e63 7469 6f6e uilt-in function │ │ │ +0015f520: 2069 7320 6173 7369 676e 6564 2074 6f20 is assigned to │ │ │ +0015f530: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 soap │ │ │ +0015f600: 3a3a 6668 6561 6465 723c 2f61 3e3c 2f63 ::fheader.

    .

    .fignore.

    int │ │ │ +0015f660: 2028 3c61 2063 6c61 7373 3d22 656c 2220 (soap::fi │ │ │ +0015f730: 676e 6f72 653c 2f61 3e29 2873 7472 7563 gnore)(struc │ │ │ +0015f740: 7420 736f 6170 202a 736f 6170 2c20 636f t soap *soap, co │ │ │ +0015f750: 6e73 7420 6368 6172 202a 7461 6729 3c2f nst char *tag)

    .

    Thi │ │ │ +0015f770: 7320 6361 6c6c 6261 636b 2069 7320 6361 s callback is ca │ │ │ +0015f780: 6c6c 6564 2077 6865 6e20 616e 2075 6e72 lled when an unr │ │ │ +0015f790: 6563 6f67 6e69 7a65 6420 584d 4c20 656c ecognized XML el │ │ │ +0015f7a0: 656d 656e 7420 7761 7320 656e 636f 756e ement was encoun │ │ │ +0015f7b0: 7465 7265 6420 6f6e 2074 6865 2069 6e70 tered on the inp │ │ │ +0015f7c0: 7574 2074 6861 7420 636f 756c 6420 6265 ut that could be │ │ │ +0015f7d0: 2069 676e 6f72 6564 2064 6570 656e 6469 ignored dependi │ │ │ +0015f7e0: 6e67 206f 6e20 736f 6d65 2073 7065 6369 ng on some speci │ │ │ +0015f7f0: 6669 6564 206c 6f67 6963 2e20 5468 6520 fied logic. The │ │ │ +0015f800: 3c63 6f64 653e 7461 673c 2f63 6f64 653e tag │ │ │ +0015f810: 2070 6172 616d 6574 6572 2069 7320 7468 parameter is th │ │ │ +0015f820: 6520 6f66 6665 6e64 696e 6720 584d 4c20 e offending XML │ │ │ +0015f830: 656c 656d 656e 7420 7461 6720 6e61 6d65 element tag name │ │ │ +0015f840: 2073 7472 696e 672e 2054 6865 2063 616c string. The cal │ │ │ +0015f850: 6c62 6163 6b20 7368 6f75 6c64 2072 6574 lback should ret │ │ │ +0015f860: 7572 6e20 3c63 6f64 653e 2353 4f41 505f urn #SOAP_ │ │ │ +0015f870: 4f4b 3c2f 636f 6465 3e20 746f 2069 676e OK to ign │ │ │ +0015f880: 6f72 6520 7468 6520 656c 656d 656e 7420 ore the element │ │ │ +0015f890: 6f72 2072 6574 7572 6e20 616e 203c 636f or return an soap_status< │ │ │ +0015f960: 2f61 3e3c 2f63 6f64 653e 2065 7272 6f72 /a> error │ │ │ +0015f970: 2063 6f64 6520 7375 6368 2061 7320 3c63 code such as #SOAP_TAG_MI │ │ │ +0015f990: 534d 4154 4348 3c2f 636f 6465 3e20 746f SMATCH to │ │ │ +0015f9a0: 2074 7269 6767 6572 2061 2076 616c 6964 trigger a valid │ │ │ +0015f9b0: 6174 696f 6e20 6572 726f 722e 2054 6869 ation error. Thi │ │ │ +0015f9c0: 7320 6361 6c6c 6261 636b 2061 6c73 6f20 s callback also │ │ │ +0015f9d0: 6f76 6572 7269 6465 7320 3c63 6f64 653e overrides │ │ │ +0015f9e0: 6d75 7374 556e 6465 7273 7461 6e64 3c2f mustUnderstand attributes │ │ │ +0015fa00: 206f 6e20 756e 7265 636f 676e 697a 6564 on unrecognized │ │ │ +0015fa10: 2053 4f41 5020 4865 6164 6572 2065 6c65 SOAP Header ele │ │ │ +0015fa20: 6d65 6e74 7320 7468 6174 206e 6f72 6d61 ments that norma │ │ │ +0015fa30: 6c6c 7920 7261 6973 6520 6661 756c 7473 lly raise faults │ │ │ +0015fa40: 2e20 4974 2069 7320 7374 726f 6e67 6c79 . It is strongly │ │ │ +0015fa50: 2072 6563 6f6d 6d65 6e64 6564 2074 6861 recommended tha │ │ │ +0015fa60: 7420 7468 6520 6361 6c6c 6261 636b 2072 t the callback r │ │ │ +0015fa70: 6574 7572 6e73 203c 636f 6465 3e23 534f eturns #SO │ │ │ +0015fa80: 4150 5f4d 5553 5455 4e44 4552 5354 414e AP_MUSTUNDERSTAN │ │ │ +0015fa90: 443c 2f63 6f64 653e 2077 6865 6e20 3c63 D when soap │ │ │ +0015fb60: 3a3a 6d75 7374 556e 6465 7273 7461 6e64 ::mustUnderstand │ │ │ +0015fb70: 3c2f 613e 3c2f 636f 6465 3e20 213d 203c != < │ │ │ +0015fb80: 636f 6465 3e30 3c2f 636f 6465 3e2e 2052 code>0. R │ │ │ +0015fb90: 6574 7572 6e73 203c 636f 6465 3e23 534f eturns #SO │ │ │ +0015fba0: 4150 5f4f 4b3c 2f63 6f64 653e 206f 7220 AP_OK or │ │ │ +0015fbb0: 6120 3c63 6f64 653e 3c61 2063 6c61 7373 a soap_st │ │ │ +0015fc70: 6174 7573 3c2f 613e 3c2f 636f 6465 3e20 atus │ │ │ +0015fc80: 2869 6e74 2920 6572 726f 7220 636f 6465 (int) error code │ │ │ +0015fc90: 2e20 4e6f 2062 7569 6c74 2d69 6e20 6675 . No built-in fu │ │ │ +0015fca0: 6e63 7469 6f6e 2069 7320 6173 7369 676e nction is assign │ │ │ +0015fcb0: 6564 2074 6f20 3c63 6f64 653e 3c61 2063 ed to soap::fignore< │ │ │ +0015fd90: 2f61 3e3c 2f63 6f64 653e 2e3c 2f70 3e0a /a>.

    . │ │ │ +0015fda0: 3c68 333e 3c61 2063 6c61 7373 3d22 616e

    .fsv │ │ │ +0015fdd0: 616c 6964 6174 653c 2f68 333e 0a3c 703e alidate

    .

    │ │ │ +0015fde0: 3c63 6f64 653e 696e 7420 283c 6120 636c int (soap::fsvalidat │ │ │ +0015fe90: 653c 2f61 3e29 2873 7472 7563 7420 736f e)(struct so │ │ │ +0015fea0: 6170 202a 736f 6170 2c20 636f 6e73 7420 ap *soap, const │ │ │ +0015feb0: 6368 6172 202a 7061 7474 6572 6e2c 2063 char *pattern, c │ │ │ +0015fec0: 6f6e 7374 2063 6861 7220 2a73 7472 696e onst char *strin │ │ │ +0015fed0: 6729 3c2f 636f 6465 3e3c 2f70 3e0a 3c70 g)

    .

    This callback i │ │ │ +0015fef0: 7320 6361 6c6c 6564 2074 6f20 7661 6c69 s called to vali │ │ │ +0015ff00: 6461 7465 2061 2073 7472 696e 6720 6167 date a string ag │ │ │ +0015ff10: 6169 6e73 7420 616e 2058 4d4c 2072 6567 ainst an XML reg │ │ │ +0015ff20: 6578 2070 6174 7465 726e 2e20 5061 7474 ex pattern. Patt │ │ │ +0015ff30: 6572 6e73 2075 7365 2058 4d4c 2073 6368 erns use XML sch │ │ │ +0015ff40: 656d 6120 7265 6765 7820 7379 6e74 6178 ema regex syntax │ │ │ +0015ff50: 2e20 5468 6973 2063 616c 6c62 6163 6b20 . This callback │ │ │ +0015ff60: 616c 6c6f 7773 2075 7365 722d 6465 6669 allows user-defi │ │ │ +0015ff70: 6e65 6420 7061 7474 6572 6e20 7661 6c69 ned pattern vali │ │ │ +0015ff80: 6461 7469 6f6e 2074 6861 7420 6973 206e dation that is n │ │ │ +0015ff90: 6f72 6d61 6c6c 7920 6469 7361 626c 6564 ormally disabled │ │ │ +0015ffa0: 2e20 5265 7475 726e 7320 3c63 6f64 653e . Returns │ │ │ +0015ffb0: 2353 4f41 505f 4f4b 3c2f 636f 6465 3e20 #SOAP_OK │ │ │ +0015ffc0: 7768 656e 2074 6865 2073 7472 696e 6720 when the string │ │ │ +0015ffd0: 6d61 7463 6865 7320 7468 6520 7061 7474 matches the patt │ │ │ +0015ffe0: 6572 6e20 6f72 203c 636f 6465 3e23 534f ern or #SO │ │ │ +0015fff0: 4150 5f54 5950 453c 2f63 6f64 653e 2077 AP_TYPE w │ │ │ +00160000: 6865 6e20 7468 6520 7374 7269 6e67 2064 hen the string d │ │ │ +00160010: 6f65 7320 6e6f 7420 6d61 7463 682e 204e oes not match. N │ │ │ +00160020: 6f20 6275 696c 742d 696e 2066 756e 6374 o built-in funct │ │ │ +00160030: 696f 6e20 6973 2061 7373 6967 6e65 6420 ion is assigned │ │ │ +00160040: 746f 203c 636f 6465 3e3c 6120 636c 6173 to s │ │ │ +001600e0: 6f61 703a 3a66 7376 616c 6964 6174 653c oap::fsvalidate< │ │ │ +001600f0: 2f61 3e3c 2f63 6f64 653e 2e3c 2f70 3e0a /a>.

    . │ │ │ +00160100: 3c68 333e 3c61 2063 6c61 7373 3d22 616e

    .fwv │ │ │ +00160130: 616c 6964 6174 653c 2f68 333e 0a3c 703e alidate

    .

    │ │ │ +00160140: 3c63 6f64 653e 696e 7420 283c 6120 636c int (soap::fwva │ │ │ +001601f0: 6c69 6461 7465 3c2f 613e 2928 7374 7275 lidate)(stru │ │ │ +00160200: 6374 2073 6f61 7020 2a73 6f61 702c 2063 ct soap *soap, c │ │ │ +00160210: 6f6e 7374 2063 6861 7220 2a70 6174 7465 onst char *patte │ │ │ +00160220: 726e 2c20 636f 6e73 7420 7763 6861 725f rn, const wchar_ │ │ │ +00160230: 7420 2a73 7472 696e 6729 3c2f 636f 6465 t *string) This callback │ │ │ +00160250: 6973 2063 616c 6c65 6420 746f 2076 616c is called to val │ │ │ +00160260: 6964 6174 6520 6120 7769 6465 2073 7472 idate a wide str │ │ │ +00160270: 696e 6720 6167 6169 6e73 7420 616e 2058 ing against an X │ │ │ +00160280: 4d4c 2072 6567 6578 2070 6174 7465 726e ML regex pattern │ │ │ +00160290: 2e20 5061 7474 6572 6e73 2075 7365 2058 . Patterns use X │ │ │ +001602a0: 4d4c 2073 6368 656d 6120 7265 6765 7820 ML schema regex │ │ │ +001602b0: 7379 6e74 6178 2e20 5468 6973 2063 616c syntax. This cal │ │ │ +001602c0: 6c62 6163 6b20 616c 6c6f 7773 2075 7365 lback allows use │ │ │ +001602d0: 722d 6465 6669 6e65 6420 7061 7474 6572 r-defined patter │ │ │ +001602e0: 6e20 7661 6c69 6461 7469 6f6e 2074 6861 n validation tha │ │ │ +001602f0: 7420 6973 206e 6f72 6d61 6c6c 7920 6469 t is normally di │ │ │ +00160300: 7361 626c 6564 2e20 5265 7475 726e 7320 sabled. Returns │ │ │ +00160310: 3c63 6f64 653e 2353 4f41 505f 4f4b 3c2f #SOAP_OK when the s │ │ │ +00160330: 7472 696e 6720 6d61 7463 6865 7320 7468 tring matches th │ │ │ +00160340: 6520 7061 7474 6572 6e20 6f72 203c 636f e pattern or #SOAP_TYPE when the st │ │ │ +00160370: 7269 6e67 2064 6f65 7320 6e6f 7420 6d61 ring does not ma │ │ │ +00160380: 7463 682e 204e 6f20 6275 696c 742d 696e tch. No built-in │ │ │ +00160390: 2066 756e 6374 696f 6e20 6973 2061 7373 function is ass │ │ │ +001603a0: 6967 6e65 6420 746f 203c 636f 6465 3e3c igned to < │ │ │ +001603b0: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ +001603c0: 663d 2267 726f 7570 5f5f 6772 6f75 705f f="group__group_ │ │ │ +001603d0: 5f63 616c 6c62 6163 6b73 2e68 746d 6c23 _callbacks.html# │ │ │ +001603e0: 6761 3161 3338 3336 3662 3562 3834 3733 ga1a38366b5b8473 │ │ │ +001603f0: 3037 3133 6334 3563 6361 6461 3834 6533 0713c45ccada84e3 │ │ │ +00160400: 6361 2220 7469 746c 653d 2243 616c 6c62 ca" title="Callb │ │ │ +00160410: 6163 6b20 746f 2076 616c 6964 6174 6520 ack to validate │ │ │ +00160420: 7769 6465 2073 7472 696e 6773 2061 6761 wide strings aga │ │ │ +00160430: 696e 7374 2058 4d4c 2072 6567 6578 2070 inst XML regex p │ │ │ +00160440: 6174 7465 726e 732e 223e 736f 6170 3a3a atterns.">soap:: │ │ │ +00160450: 6677 7661 6c69 6461 7465 3c2f 613e 3c2f fwvalidate.

    .

    < │ │ │ +00160470: 6120 636c 6173 733d 2261 6e63 686f 7222 a class="anchor" │ │ │ +00160480: 2069 643d 2261 7574 6f74 6f63 5f6d 6434 id="autotoc_md4 │ │ │ +00160490: 3422 3e3c 2f61 3e0a 6673 6574 6572 726f 4">.fseterro │ │ │ +001604a0: 723c 2f68 333e 0a3c 703e 3c63 6f64 653e r

    .

    │ │ │ +001604b0: 766f 6964 2028 3c61 2063 6c61 7373 3d22 void (soap::fs │ │ │ +00160560: 6574 6572 726f 723c 2f61 3e29 2873 7472 eterror)(str │ │ │ +00160570: 7563 7420 736f 6170 202a 736f 6170 2c20 uct soap *soap, │ │ │ +00160580: 636f 6e73 7420 6368 6172 202a 2a63 6f64 const char **cod │ │ │ +00160590: 652c 2063 6f6e 7374 2063 6861 7220 2a2a e, const char ** │ │ │ +001605a0: 7374 7269 6e67 293c 2f63 6f64 653e 3c2f string).

    This callb │ │ │ +001605c0: 6163 6b20 6973 2063 616c 6c65 6420 6279 ack is called by │ │ │ +001605d0: 2074 6865 2065 6e67 696e 6520 7768 656e the engine when │ │ │ +001605e0: 2061 6e20 6572 726f 7220 6973 2072 6169 an error is rai │ │ │ +001605f0: 7365 6420 746f 2061 6c6c 6f77 2069 6e73 sed to allow ins │ │ │ +00160600: 7065 6374 696f 6e20 6f72 206f 7665 7272 pection or overr │ │ │ +00160610: 6964 696e 6720 6f66 2074 6865 2066 6175 iding of the fau │ │ │ +00160620: 6c74 2063 6f64 6520 6f72 2066 6175 6c74 lt code or fault │ │ │ +00160630: 2073 7472 696e 6720 6d65 7373 6167 6573 string messages │ │ │ +00160640: 2062 6566 6f72 6520 7468 6520 6572 726f before the erro │ │ │ +00160650: 7220 6973 2072 6570 6f72 7465 6420 6f72 r is reported or │ │ │ +00160660: 2074 7261 6e73 6d69 7474 6564 2e20 4e6f transmitted. No │ │ │ +00160670: 2062 7569 6c74 2d69 6e20 6675 6e63 7469 built-in functi │ │ │ +00160680: 6f6e 2069 7320 6173 7369 676e 6564 2074 on is assigned t │ │ │ +00160690: 6f20 3c63 6f64 653e 3c61 2063 6c61 7373 o soap:: │ │ │ +00160740: 6673 6574 6572 726f 723c 2f61 3e3c 2f63 fseterror.

    .

    .fopen

    .

    SOAP_ │ │ │ +001607a0: 534f 434b 4554 2028 3c61 2063 6c61 7373 SOCKET (soap::fopen)(struct soap │ │ │ +00160860: 2a73 6f61 702c 2063 6f6e 7374 2063 6861 *soap, const cha │ │ │ +00160870: 7220 2a65 6e64 706f 696e 742c 2063 6f6e r *endpoint, con │ │ │ +00160880: 7374 2063 6861 7220 2a68 6f73 742c 2069 st char *host, i │ │ │ +00160890: 6e74 2070 6f72 7429 3c2f 636f 6465 3e3c nt port)< │ │ │ +001608a0: 2f70 3e0a 3c70 3e54 6869 7320 6361 6c6c /p>.

    This call │ │ │ +001608b0: 6261 636b 2069 7320 6361 6c6c 6564 2062 back is called b │ │ │ +001608c0: 7920 7468 6520 656e 6769 6e65 2061 7420 y the engine at │ │ │ +001608d0: 7468 6520 636c 6965 6e74 2d73 6964 6520 the client-side │ │ │ +001608e0: 6279 203c 636f 6465 3e3c 6120 636c 6173 by soap_connect │ │ │ +00160970: 3c2f 613e 3c2f 636f 6465 3e20 6f72 203c or < │ │ │ +00160980: 636f 6465 3e3c 6120 636c 6173 733d 2265 code> │ │ │ +001609f0: 736f 6170 5f63 6f6e 6e65 6374 5f63 6f6d soap_connect_com │ │ │ +00160a00: 6d61 6e64 3c2f 613e 3c2f 636f 6465 3e20 mand │ │ │ +00160a10: 746f 206f 7065 6e20 6120 5443 5020 6f72 to open a TCP or │ │ │ +00160a20: 2055 4450 2063 6f6e 6e65 6374 696f 6e20 UDP connection │ │ │ +00160a30: 746f 2061 2073 6572 7665 7220 7370 6563 to a server spec │ │ │ +00160a40: 6966 6965 6420 6174 2061 6e20 656e 6470 ified at an endp │ │ │ +00160a50: 6f69 6e74 2e20 5061 7261 6d65 7465 7273 oint. Parameters │ │ │ +00160a60: 203c 636f 6465 3e68 6f73 743c 2f63 6f64 host and por │ │ │ +00160a80: 743c 2f63 6f64 653e 2061 7265 206d 6963 t are mic │ │ │ +00160a90: 726f 2d70 6172 7365 6420 6672 6f6d 203c ro-parsed from < │ │ │ +00160aa0: 636f 6465 3e65 6e64 706f 696e 743c 2f63 code>endpoint before bein │ │ │ +00160ac0: 6720 7061 7373 6564 2074 6f20 3c63 6f64 g passed to soa │ │ │ +00160b70: 703a 3a66 6f70 656e 3c2f 613e 3c2f 636f p::fopen. Returns a v │ │ │ +00160b90: 616c 6964 2073 6f63 6b65 7420 6f72 203c alid socket or < │ │ │ +00160ba0: 636f 6465 3e23 534f 4150 5f49 4e56 414c code>#SOAP_INVAL │ │ │ +00160bb0: 4944 5f53 4f43 4b45 543c 2f63 6f64 653e ID_SOCKET │ │ │ +00160bc0: 2077 6974 6820 6120 3c63 6f64 653e 3c61 with a soap::error< │ │ │ +00160c80: 2f61 3e3c 2f63 6f64 653e 2073 6574 2074 /a> set t │ │ │ +00160c90: 6f20 6120 3c63 6f64 653e 3c61 2063 6c61 o a soap_ │ │ │ +00160d50: 7374 6174 7573 3c2f 613e 3c2f 636f 6465 status (int) error co │ │ │ +00160d70: 6465 2061 6e64 203c 636f 6465 3e3c 6120 de and soa │ │ │ +00160e00: 703a 3a65 7272 6e75 6d3c 2f61 3e3c 2f63 p::errnum set to errno o │ │ │ +00160e30: 6620 7468 6520 636f 6e6e 6563 7469 6f6e f the connection │ │ │ +00160e40: 2066 6169 6c75 7265 2e20 5468 6520 6275 failure. The bu │ │ │ +00160e50: 696c 742d 696e 2066 756e 6374 696f 6e20 ilt-in function │ │ │ +00160e60: 6173 7369 676e 6564 2074 6f20 3c63 6f64 assigned to soa │ │ │ +00160f10: 703a 3a66 6f70 656e 3c2f 613e 3c2f 636f p::fopen is tcp │ │ │ +00160f30: 5f63 6f6e 6e65 6374 3c2f 636f 6465 3e2e _connect. │ │ │ +00160f40: 3c2f 703e 0a3c 6833 3e3c 6120 636c 6173

    .

    .faccept

    .< │ │ │ +00160f80: 703e 3c63 6f64 653e 534f 4150 5f53 4f43 p>SOAP_SOC │ │ │ +00160f90: 4b45 5420 283c 6120 636c 6173 733d 2265 KET (soap::faccept)(struct soap │ │ │ +00161060: 2a73 6f61 702c 2053 4f41 505f 534f 434b *soap, SOAP_SOCK │ │ │ +00161070: 4554 2073 2c20 7374 7275 6374 2073 6f63 ET s, struct soc │ │ │ +00161080: 6b61 6464 7220 2a61 2c20 696e 7420 2a6e kaddr *a, int *n │ │ │ +00161090: 293c 2f63 6f64 653e 3c2f 703e 0a3c 703e )

    .

    │ │ │ +001610a0: 5468 6973 2063 616c 6c62 6163 6b20 6973 This callback is │ │ │ +001610b0: 2063 616c 6c65 6420 6279 203c 636f 6465 called by soap_a │ │ │ +00161140: 6363 6570 743c 2f61 3e3c 2f63 6f64 653e ccept │ │ │ +00161150: 2028 6f72 2074 6865 2043 2b2b 2073 6572 (or the C++ ser │ │ │ +00161160: 7669 6365 2063 6c61 7373 203c 636f 6465 vice class accept m │ │ │ +00161180: 6574 686f 6429 2074 6f20 7761 6974 2066 ethod) to wait f │ │ │ +00161190: 6f72 2061 6e64 2061 6363 6570 7420 6120 or and accept a │ │ │ +001611a0: 736f 636b 6574 2063 6f6e 6e65 6374 696f socket connectio │ │ │ +001611b0: 6e20 7265 7175 6573 7465 6420 6279 2061 n requested by a │ │ │ +001611c0: 2063 6c69 656e 742e 2052 6574 7572 6e73 client. Returns │ │ │ +001611d0: 2061 2076 616c 6964 2073 6f63 6b65 7420 a valid socket │ │ │ +001611e0: 6f72 203c 636f 6465 3e23 534f 4150 5f49 or #SOAP_I │ │ │ +001611f0: 4e56 414c 4944 5f53 4f43 4b45 543c 2f63 NVALID_SOCKET when an err │ │ │ +00161210: 6f72 206f 6363 7572 7265 6420 616e 6420 or occurred and │ │ │ +00161220: 7365 7473 203c 636f 6465 3e3c 6120 636c sets soap::error │ │ │ +001612e0: 3c2f 636f 6465 3e20 746f 2061 203c 636f to a soap_status< │ │ │ +001613b0: 2f61 3e3c 2f63 6f64 653e 2076 616c 7565 /a> value │ │ │ +001613c0: 2e20 5468 6520 6275 696c 742d 696e 2066 . The built-in f │ │ │ +001613d0: 756e 6374 696f 6e20 6173 7369 676e 6564 unction assigned │ │ │ +001613e0: 2074 6f20 3c63 6f64 653e 3c61 2063 6c61 to soap::facc │ │ │ +001614a0: 6570 743c 2f61 3e3c 2f63 6f64 653e 2069 ept i │ │ │ +001614b0: 7320 3c63 6f64 653e 7463 705f 6163 6365 s tcp_acce │ │ │ +001614c0: 7074 3c2f 636f 6465 3e2e 3c2f 703e 0a3c pt.

    .< │ │ │ +001614d0: 6833 3e3c 6120 636c 6173 733d 2261 6e63 h3>.fclo │ │ │ +00161500: 7365 3c2f 6833 3e0a 3c70 3e3c 636f 6465 se

    .

    int (soap::fcl │ │ │ +001615b0: 6f73 653c 2f61 3e29 2873 7472 7563 7420 ose)(struct │ │ │ +001615c0: 736f 6170 202a 736f 6170 293c 2f63 6f64 soap *soap)

    .

    This c │ │ │ +001615e0: 616c 6c62 6163 6b20 6973 2063 616c 6c65 allback is calle │ │ │ +001615f0: 6420 6279 2074 6865 2065 6e67 696e 6520 d by the engine │ │ │ +00161600: 6174 2074 6865 2063 6c69 656e 742d 7369 at the client-si │ │ │ +00161610: 6465 2074 6f20 636c 6f73 6520 7468 6520 de to close the │ │ │ +00161620: 6375 7272 656e 7420 736f 636b 6574 2063 current socket c │ │ │ +00161630: 6f6e 6e65 6374 696f 6e20 6265 666f 7265 onnection before │ │ │ +00161640: 2061 206e 6577 2073 6f63 6b65 7420 636f a new socket co │ │ │ +00161650: 6e6e 6563 7469 6f6e 2069 7320 6573 7461 nnection is esta │ │ │ +00161660: 626c 6973 6865 642e 2054 6869 7320 6361 blished. This ca │ │ │ +00161670: 6c6c 6261 636b 206d 6179 2062 6520 6361 llback may be ca │ │ │ +00161680: 6c6c 6564 206d 756c 7469 706c 6520 7469 lled multiple ti │ │ │ +00161690: 6d65 7320 2865 2e67 2e20 6279 2074 6865 mes (e.g. by the │ │ │ +001616a0: 2065 6e67 696e 6520 616e 6420 6279 2070 engine and by p │ │ │ +001616b0: 6c75 6769 6e73 2920 746f 2063 6c6f 7365 lugins) to close │ │ │ +001616c0: 2074 6865 2073 616d 6520 736f 636b 6574 the same socket │ │ │ +001616d0: 203c 636f 6465 3e3c 6120 636c 6173 733d s │ │ │ +00161790: 6f61 703a 3a73 6f63 6b65 743c 2f61 3e3c oap::socket< │ │ │ +001617a0: 2f63 6f64 653e 2e20 4368 6563 6b73 2069 /code>. Checks i │ │ │ +001617b0: 6e74 6572 6e61 6c6c 7920 6966 203c 636f nternally if soap: │ │ │ +00161880: 3a73 6f63 6b65 743c 2f61 3e3c 2f63 6f64 :socket == #SOA │ │ │ +001618a0: 505f 494e 5641 4c49 445f 534f 434b 4554 P_INVALID_SOCKET │ │ │ +001618b0: 3c2f 636f 6465 3e20 6265 666f 7265 2063 before c │ │ │ +001618c0: 6c6f 7369 6e67 2c20 7768 6963 6820 6d65 losing, which me │ │ │ +001618d0: 616e 7320 7468 6174 2074 6865 2073 6f63 ans that the soc │ │ │ +001618e0: 6b65 7420 7761 7320 616c 7265 6164 7920 ket was already │ │ │ +001618f0: 636c 6f73 6564 2e20 5265 7475 726e 7320 closed. Returns │ │ │ +00161900: 3c63 6f64 653e 2353 4f41 505f 4f4b 3c2f #SOAP_OK or a soap_status (int) e │ │ │ +001619f0: 7272 6f72 2063 6f64 652e 2054 6865 2062 rror code. The b │ │ │ +00161a00: 7569 6c74 2d69 6e20 6675 6e63 7469 6f6e uilt-in function │ │ │ +00161a10: 2061 7373 6967 6e65 6420 746f 203c 636f assigned to soap::fclose │ │ │ +00161ac0: 3c2f 613e 3c2f 636f 6465 3e20 6973 203c is < │ │ │ +00161ad0: 636f 6465 3e74 6370 5f64 6973 636f 6e6e code>tcp_disconn │ │ │ +00161ae0: 6563 743c 2f63 6f64 653e 2e3c 2f70 3e0a ect.

    . │ │ │ +00161af0: 3c68 333e 3c61 2063 6c61 7373 3d22 616e

    .fre │ │ │ +00161b20: 736f 6c76 653c 2f68 333e 0a3c 703e 3c63 solve

    .

    int (soap::fresolve< │ │ │ +00161be0: 2f61 3e29 2873 7472 7563 7420 736f 6170 /a>)(struct soap │ │ │ +00161bf0: 202a 736f 6170 2c20 636f 6e73 7420 6368 *soap, const ch │ │ │ +00161c00: 6172 202a 6164 6472 2c20 7374 7275 6374 ar *addr, struct │ │ │ +00161c10: 2069 6e5f 6164 6472 202a 696e 6164 6472 in_addr *inaddr │ │ │ +00161c20: 293c 2f63 6f64 653e 3c2f 703e 0a3c 703e )

    .

    │ │ │ +00161c30: 5468 6973 2063 616c 6c62 6163 6b20 6973 This callback is │ │ │ +00161c40: 2063 616c 6c65 6420 6279 203c 636f 6465 called by soap_bind< │ │ │ +00161cd0: 2f63 6f64 653e 2028 6f72 2074 6865 2043 /code> (or the C │ │ │ +00161ce0: 2b2b 2073 6572 7669 6365 2063 6c61 7373 ++ service class │ │ │ +00161cf0: 203c 636f 6465 3e62 696e 643c 2f63 6f64 bind method) at th │ │ │ +00161d10: 6520 7365 7276 6572 2d73 6964 6520 616e e server-side an │ │ │ +00161d20: 6420 6279 203c 636f 6465 3e3c 6120 636c d by soap_conne │ │ │ +00161db0: 6374 3c2f 613e 3c2f 636f 6465 3e20 6f72 ct or │ │ │ +00161dc0: 203c 636f 6465 3e3c 6120 636c 6173 733d soap_connect_c │ │ │ +00161e40: 6f6d 6d61 6e64 3c2f 613e 3c2f 636f 6465 ommand at the client- │ │ │ +00161e60: 7369 6465 2077 6974 6820 6120 686f 7374 side with a host │ │ │ +00161e70: 203c 636f 6465 3e6e 616d 653c 2f63 6f64 name parameter to │ │ │ +00161e90: 7265 736f 6c76 6520 746f 2061 6464 7265 resolve to addre │ │ │ +00161ea0: 7373 203c 636f 6465 3e69 6e61 6464 723c ss inaddr< │ │ │ +00161eb0: 2f63 6f64 653e 2062 7920 6164 6472 6573 /code> by addres │ │ │ +00161ec0: 7320 7472 616e 736c 6174 696f 6e2e 2057 s translation. W │ │ │ +00161ed0: 6865 6e20 7375 6363 6573 7366 756c 2073 hen successful s │ │ │ +00161ee0: 6574 7320 7061 7261 6d65 7465 7220 3c63 ets parameter inaddr and returns #SOAP_OK or a < │ │ │ +00161f30: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ +00161f40: 663d 2267 726f 7570 5f5f 6772 6f75 705f f="group__group_ │ │ │ +00161f50: 5f65 7272 6f72 732e 6874 6d6c 2367 6163 _errors.html#gac │ │ │ +00161f60: 3065 6164 6638 6637 3262 6163 6235 6234 0eadf8f72bacb5b4 │ │ │ +00161f70: 3162 3735 3062 6561 6563 6130 3434 3422 1b750beaeca0444" │ │ │ +00161f80: 2074 6974 6c65 3d22 5374 6174 7573 2061 title="Status a │ │ │ +00161f90: 6e64 2065 7272 6f72 2063 6f64 6573 2061 nd error codes a │ │ │ +00161fa0: 7265 2069 6e74 2076 616c 7565 732c 2061 re int values, a │ │ │ +00161fb0: 207a 6572 6f20 7661 6c75 6520 6f72 2023 zero value or # │ │ │ +00161fc0: 534f 4150 5f4f 4b20 2830 2920 6d65 616e SOAP_OK (0) mean │ │ │ +00161fd0: 7320 6e6f 2065 7272 6f72 2c2e 2e2e 223e s no error,..."> │ │ │ +00161fe0: 736f 6170 5f73 7461 7475 733c 2f61 3e3c soap_status< │ │ │ +00161ff0: 2f63 6f64 653e 2028 696e 7429 2065 7272 /code> (int) err │ │ │ +00162000: 6f72 2063 6f64 652e 2054 6865 2062 7569 or code. The bui │ │ │ +00162010: 6c74 2d69 6e20 6675 6e63 7469 6f6e 2061 lt-in function a │ │ │ +00162020: 7373 6967 6e65 6420 746f 203c 636f 6465 ssigned to soap::f │ │ │ +001620d0: 7265 736f 6c76 653c 2f61 3e3c 2f63 6f64 resolve is tcp_ │ │ │ +001620f0: 6765 7468 6f73 743c 2f63 6f64 653e 2e3c gethost.< │ │ │ +00162100: 2f70 3e0a 3c68 333e 3c61 2063 6c61 7373 /p>.

    │ │ │ +00162130: 0a66 636f 6e6e 6563 743c 2f68 333e 0a3c .fconnect

    .< │ │ │ +00162140: 703e 3c63 6f64 653e 696e 7420 283c 6120 p>int (soap::f │ │ │ +001621f0: 636f 6e6e 6563 743c 2f61 3e29 2873 7472 connect)(str │ │ │ +00162200: 7563 7420 736f 6170 202a 736f 6170 2c20 uct soap *soap, │ │ │ +00162210: 636f 6e73 7420 6368 6172 202a 656e 6470 const char *endp │ │ │ +00162220: 6f69 6e74 2c20 636f 6e73 7420 6368 6172 oint, const char │ │ │ +00162230: 202a 686f 7374 2c20 696e 7420 706f 7274 *host, int port │ │ │ +00162240: 293c 2f63 6f64 653e 3c2f 703e 0a3c 703e )

    .

    │ │ │ +00162250: 5468 6973 2063 616c 6c62 6163 6b20 6973 This callback is │ │ │ +00162260: 2063 616c 6c65 6420 6279 2074 6865 2065 called by the e │ │ │ +00162270: 6e67 696e 6520 746f 206f 7074 696f 6e61 ngine to optiona │ │ │ +00162280: 6c6c 7920 6f76 6572 7269 6465 2063 6c69 lly override cli │ │ │ +00162290: 656e 742d 7369 6465 2063 6f6e 6e65 6374 ent-side connect │ │ │ +001622a0: 696e 672e 2054 6865 2070 6172 616d 6574 ing. The paramet │ │ │ +001622b0: 6572 7320 3c63 6f64 653e 686f 7374 3c2f ers host and │ │ │ +001622d0: 706f 7274 3c2f 636f 6465 3e20 7765 7265 port were │ │ │ +001622e0: 206d 6963 726f 2d70 6172 7365 6420 6672 micro-parsed fr │ │ │ +001622f0: 6f6d 2074 6865 203c 636f 6465 3e65 6e64 om the end │ │ │ +00162300: 706f 696e 743c 2f63 6f64 653e 2070 7269 point pri │ │ │ +00162310: 6f72 2074 6f20 7061 7373 696e 6720 7468 or to passing th │ │ │ +00162320: 656d 2074 6f20 7468 6973 2063 616c 6c62 em to this callb │ │ │ +00162330: 6163 6b2e 2052 6574 7572 6e73 203c 636f ack. Returns #SOAP_OK or a s │ │ │ +00162410: 6f61 705f 7374 6174 7573 3c2f 613e 3c2f oap_status (int) erro │ │ │ +00162430: 7220 636f 6465 2e20 4e6f 2062 7569 6c74 r code. No built │ │ │ +00162440: 2d69 6e20 6675 6e63 7469 6f6e 2069 7320 -in function is │ │ │ +00162450: 6173 7369 676e 6564 2074 6f20 3c63 6f64 assigned to so │ │ │ +00162500: 6170 3a3a 6663 6f6e 6e65 6374 3c2f 613e ap::fconnect │ │ │ +00162510: 3c2f 636f 6465 3e2e 3c2f 703e 0a3c 6833 .

    .

    .fdisco │ │ │ +00162550: 6e6e 6563 743c 2f68 333e 0a3c 703e 3c63 nnect

    .

    int (so │ │ │ +00162600: 6170 3a3a 6664 6973 636f 6e6e 6563 743c ap::fdisconnect< │ │ │ +00162610: 2f61 3e29 2873 7472 7563 7420 736f 6170 /a>)(struct soap │ │ │ +00162620: 202a 736f 6170 293c 2f63 6f64 653e 3c2f *soap).

    This callb │ │ │ +00162640: 6163 6b20 6973 2063 616c 6c65 6420 6279 ack is called by │ │ │ +00162650: 2074 6865 2065 6e67 696e 6520 3c63 6f64 the engine soap_closes │ │ │ +001626e0: 6f63 6b3c 2f61 3e3c 2f63 6f64 653e 2062 ock b │ │ │ +001626f0: 6566 6f72 6520 7468 6520 3c63 6f64 653e efore the │ │ │ +00162700: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap::fclose callbac │ │ │ +001627b0: 6b20 6973 2063 616c 6c65 6420 746f 2073 k is called to s │ │ │ +001627c0: 6875 7464 6f77 6e2f 6469 7363 6f6e 6e65 hutdown/disconne │ │ │ +001627d0: 6374 2e20 5265 7475 726e 7320 3c63 6f64 ct. Returns #SOAP_OK or a so │ │ │ +001628b0: 6170 5f73 7461 7475 733c 2f61 3e3c 2f63 ap_status (int) error │ │ │ +001628d0: 2063 6f64 652e 204e 6f20 6275 696c 742d code. No built- │ │ │ +001628e0: 696e 2066 756e 6374 696f 6e20 6973 2061 in function is a │ │ │ +001628f0: 7373 6967 6e65 6420 746f 203c 636f 6465 ssigned to soap::fdis │ │ │ +001629a0: 636f 6e6e 6563 743c 2f61 3e3c 2f63 6f64 connect.

    .

    │ │ │ +001629e0: 3c2f 613e 0a66 636c 6f73 6573 6f63 6b65 .fclosesocke │ │ │ +001629f0: 743c 2f68 333e 0a3c 703e 3c63 6f64 653e t

    .

    │ │ │ +00162a00: 696e 7420 283c 6120 636c 6173 733d 2265 int (soap::fcl │ │ │ +00162a90: 6f73 6573 6f63 6b65 743c 2f61 3e29 2873 osesocket)(s │ │ │ +00162aa0: 7472 7563 7420 736f 6170 202a 736f 6170 truct soap *soap │ │ │ +00162ab0: 2c20 534f 4150 5f53 4f43 4b45 5420 736f , SOAP_SOCKET so │ │ │ +00162ac0: 636b 293c 2f63 6f64 653e 3c2f 703e 0a3c ck)

    .< │ │ │ +00162ad0: 703e 5468 6973 2063 616c 6c62 6163 6b20 p>This callback │ │ │ +00162ae0: 6973 2063 616c 6c65 6420 746f 2063 6c6f is called to clo │ │ │ +00162af0: 7365 2061 2073 6f63 6b65 7420 6279 2074 se a socket by t │ │ │ +00162b00: 6865 2065 6e67 696e 652e 2052 6574 7572 he engine. Retur │ │ │ +00162b10: 6e73 203c 636f 6465 3e23 534f 4150 5f4f ns #SOAP_O │ │ │ +00162b20: 4b3c 2f63 6f64 653e 206f 7220 6120 3c63 K or a soap_status │ │ │ +00162bf0: 3c2f 613e 3c2f 636f 6465 3e20 2869 6e74
    (int │ │ │ +00162c00: 2920 6572 726f 7220 636f 6465 2e20 5468 ) error code. Th │ │ │ +00162c10: 6520 6275 696c 742d 696e 2066 756e 6374 e built-in funct │ │ │ +00162c20: 696f 6e20 6173 7369 676e 6564 2074 6f20 ion assigned to │ │ │ +00162c30: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 soap::fc │ │ │ +00162cc0: 6c6f 7365 736f 636b 6574 3c2f 613e 3c2f losesocket is t │ │ │ +00162ce0: 6370 5f63 6c6f 7365 736f 636b 6574 3c2f cp_closesocket.

    .

    < │ │ │ +00162d00: 6120 636c 6173 733d 2261 6e63 686f 7222 a class="anchor" │ │ │ +00162d10: 2069 643d 2261 7574 6f74 6f63 5f6d 6435 id="autotoc_md5 │ │ │ +00162d20: 3222 3e3c 2f61 3e0a 6673 6875 7464 6f77 2">.fshutdow │ │ │ +00162d30: 6e73 6f63 6b65 743c 2f68 333e 0a3c 703e nsocket

    .

    │ │ │ +00162d40: 3c63 6f64 653e 696e 7420 283c 6120 636c int (soap::fshutdown │ │ │ +00162de0: 736f 636b 6574 3c2f 613e 2928 7374 7275 socket)(stru │ │ │ +00162df0: 6374 2073 6f61 7020 2a73 6f61 702c 2053 ct soap *soap, S │ │ │ +00162e00: 4f41 505f 534f 434b 4554 2073 6f63 6b2c OAP_SOCKET sock, │ │ │ +00162e10: 2069 6e74 2068 6f77 293c 2f63 6f64 653e int how) │ │ │ +00162e20: 3c2f 703e 0a3c 703e 5468 6973 2063 616c

    .

    This cal │ │ │ +00162e30: 6c62 6163 6b20 6973 2063 616c 6c65 6420 lback is called │ │ │ +00162e40: 746f 2073 6875 7420 646f 776e 2061 2073 to shut down a s │ │ │ +00162e50: 6f63 6b65 7420 6279 2074 6865 2065 6e67 ocket by the eng │ │ │ +00162e60: 696e 652e 2052 6574 7572 6e73 203c 636f ine. Returns #SOAP_OK or a s │ │ │ +00162f40: 6f61 705f 7374 6174 7573 3c2f 613e 3c2f oap_status (int) erro │ │ │ +00162f60: 7220 636f 6465 2e20 5468 6520 6275 696c r code. The buil │ │ │ +00162f70: 742d 696e 2066 756e 6374 696f 6e20 6173 t-in function as │ │ │ +00162f80: 7369 676e 6564 2074 6f20 3c63 6f64 653e signed to │ │ │ +00162f90: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap::fshu │ │ │ +00163020: 7464 6f77 6e73 6f63 6b65 743c 2f61 3e3c tdownsocket< │ │ │ +00163030: 2f63 6f64 653e 2069 7320 3c63 6f64 653e /code> is │ │ │ +00163040: 7463 705f 7368 7574 646f 776e 736f 636b tcp_shutdownsock │ │ │ +00163050: 6574 3c2f 636f 6465 3e2e 3c2f 703e 0a3c et.

    .< │ │ │ +00163060: 6833 3e3c 6120 636c 6173 733d 2261 6e63 h3>.fpol │ │ │ +00163090: 6c3c 2f68 333e 0a3c 703e 3c63 6f64 653e l.

    │ │ │ +001630a0: 696e 7420 283c 6120 636c 6173 733d 2265 int (soap::fpoll │ │ │ +00163170: 2928 7374 7275 6374 2073 6f61 7020 2a73 )(struct soap *s │ │ │ +00163180: 6f61 7029 3c2f 636f 6465 3e3c 2f70 3e0a oap)

    . │ │ │ +00163190: 3c70 3e54 6869 7320 6361 6c6c 6261 636b

    This callback │ │ │ +001631a0: 2069 7320 6361 6c6c 6564 2062 7920 7468 is called by th │ │ │ +001631b0: 6520 656e 6769 6e65 2074 6f20 7761 6974 e engine to wait │ │ │ +001631c0: 2066 6f72 2061 6374 6976 6974 7920 6f6e for activity on │ │ │ +001631d0: 2074 6865 203c 636f 6465 3e3c 6120 636c the soap::socket< │ │ │ +001632a0: 2f61 3e3c 2f63 6f64 653e 206f 7220 3c63 /a> or soap │ │ │ +00163370: 3a3a 6d61 7374 6572 3c2f 613e 3c2f 636f ::master socket using │ │ │ +00163390: 203c 636f 6465 3e70 6f6c 6c3c 2f63 6f64 poll or sele │ │ │ +001633b0: 6374 3c2f 636f 6465 3e2e 2054 696d 6573 ct. Times │ │ │ +001633c0: 206f 7574 2077 6865 6e20 3c63 6f64 653e out when │ │ │ +001633d0: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap::se │ │ │ +00163480: 6e64 5f74 696d 656f 7574 3c2f 613e 3c2f nd_timeout or < │ │ │ +001634a0: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ +001634b0: 663d 2273 7472 7563 7473 6f61 702e 6874 f="structsoap.ht │ │ │ +001634c0: 6d6c 2361 6335 6435 6662 3932 6666 6664 ml#ac5d5fb92fffd │ │ │ +001634d0: 6137 3234 6363 6233 6230 3338 6432 6262 a724ccb3b038d2bb │ │ │ +001634e0: 3233 3838 2220 7469 746c 653d 2255 7365 2388" title="Use │ │ │ +001634f0: 722d 6465 6669 6e61 626c 6520 7469 6d65 r-definable time │ │ │ +00163500: 6f75 7420 746f 2072 6563 6569 7665 2061 out to receive a │ │ │ +00163510: 2070 6163 6b65 7420 6f66 2064 6174 612c packet of data, │ │ │ +00163520: 2070 6f73 6974 6976 6520 7469 6d65 6f75 positive timeou │ │ │ +00163530: 7420 7661 6c75 6573 2061 7265 2073 6563 t values are sec │ │ │ +00163540: 6f6e 6473 2c2e 2e2e 223e 736f 6170 3a3a onds,...">soap:: │ │ │ +00163550: 7265 6376 5f74 696d 656f 7574 3c2f 613e recv_timeout │ │ │ +00163560: 3c2f 636f 6465 3e20 6172 6520 6e6f 6e7a are nonz │ │ │ +00163570: 6572 6f2e 2052 6574 7572 6e73 203c 636f ero. Returns #SOAP_OK or a s │ │ │ +00163650: 6f61 705f 7374 6174 7573 3c2f 613e 3c2f oap_status (int) erro │ │ │ +00163670: 7220 636f 6465 2e20 5468 6520 6275 696c r code. The buil │ │ │ +00163680: 742d 696e 2066 756e 6374 696f 6e20 6173 t-in function as │ │ │ +00163690: 7369 676e 6564 2074 6f20 3c63 6f64 653e signed to │ │ │ +001636a0: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap │ │ │ +00163760: 3a3a 6670 6f6c 6c3c 2f61 3e3c 2f63 6f64 ::fpoll is soap │ │ │ +00163780: 5f70 6f6c 6c3c 2f63 6f64 653e 2e3c 2f70 _poll.

    .

    .f │ │ │ +001637c0: 7265 6376 3c2f 6833 3e0a 3c70 3e3c 636f recv

    .

    size_t (soap::frecv< │ │ │ +00163880: 2f61 3e29 2873 7472 7563 7420 736f 6170 /a>)(struct soap │ │ │ +00163890: 202a 736f 6170 2c20 6368 6172 202a 6275 *soap, char *bu │ │ │ +001638a0: 662c 2073 697a 655f 7420 6c65 6e29 3c2f f, size_t len)

    .

    Thi │ │ │ +001638c0: 7320 6361 6c6c 6261 636b 2069 7320 6361 s callback is ca │ │ │ +001638d0: 6c6c 6564 2062 7920 7468 6520 656e 6769 lled by the engi │ │ │ +001638e0: 6e65 2074 6f20 7265 6365 6976 6520 286f ne to receive (o │ │ │ +001638f0: 7220 7265 6164 2920 6461 7461 2069 6e74 r read) data int │ │ │ +00163900: 6f20 6120 7370 6563 6966 6965 6420 6275 o a specified bu │ │ │ +00163910: 6666 6572 203c 636f 6465 3e62 7566 3c2f ffer buf and │ │ │ +00163930: 6c65 6e3c 2f63 6f64 653e 2e20 5468 6520 len. The │ │ │ +00163940: 736f 7572 6365 2066 6f72 2074 6865 2064 source for the d │ │ │ +00163950: 6174 6120 746f 2072 6561 6420 6279 2074 ata to read by t │ │ │ +00163960: 6869 7320 6361 6c6c 6261 636b 2069 7320 his callback is │ │ │ +00163970: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 so │ │ │ +00163a30: 6170 3a3a 6973 3c2f 613e 3c2f 636f 6465 ap::is when non-NULL, │ │ │ +00163a50: 203c 636f 6465 3e3c 6120 636c 6173 733d s │ │ │ +00163b10: 6f61 703a 3a73 6f63 6b65 743c 2f61 3e3c oap::socket< │ │ │ +00163b20: 2f63 6f64 653e 2077 6865 6e20 7661 6c69 /code> when vali │ │ │ +00163b30: 642c 206f 7220 3c63 6f64 653e 3c61 2063 d, or soap::recvfd │ │ │ +00163c00: 3c2f 613e 3c2f 636f 6465 3e2e 2052 6574 . Ret │ │ │ +00163c10: 7572 6e73 203c 636f 6465 3e23 534f 4150 urns #SOAP │ │ │ +00163c20: 5f4f 4b3c 2f63 6f64 653e 206f 7220 6120 _OK or a │ │ │ +00163c30: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 soap_stat │ │ │ +00163cf0: 7573 3c2f 613e 3c2f 636f 6465 3e20 2869 us (i │ │ │ +00163d00: 6e74 2920 6572 726f 7220 636f 6465 2e20 nt) error code. │ │ │ +00163d10: 5468 6520 6275 696c 742d 696e 2066 756e The built-in fun │ │ │ +00163d20: 6374 696f 6e20 6173 7369 676e 6564 2074 ction assigned t │ │ │ +00163d30: 6f20 3c63 6f64 653e 3c61 2063 6c61 7373 o soap::frecv │ │ │ +00163de0: 3c2f 636f 6465 3e20 6973 203c 636f 6465 is frecv..

    . │ │ │ +00163e30: 6673 656e 643c 2f68 333e 0a3c 703e 3c63 fsend

    .

    int (soap::fsend)(struct soap │ │ │ +00163ef0: 2a73 6f61 702c 2063 6f6e 7374 2063 6861 *soap, const cha │ │ │ +00163f00: 7220 2a62 7566 2c20 7369 7a65 5f74 206c r *buf, size_t l │ │ │ +00163f10: 656e 293c 2f63 6f64 653e 3c2f 703e 0a3c en)

    .< │ │ │ +00163f20: 703e 5468 6973 2063 616c 6c62 6163 6b20 p>This callback │ │ │ +00163f30: 6973 2063 616c 6c65 6420 6279 2074 6865 is called by the │ │ │ +00163f40: 2065 6e67 696e 6520 746f 2073 656e 6420 engine to send │ │ │ +00163f50: 286f 7220 7772 6974 6529 2064 6174 6120 (or write) data │ │ │ +00163f60: 7370 6563 6966 6965 6420 6279 203c 636f specified by data
    b │ │ │ +00163f80: 7974 6573 206f 6620 6c65 6e67 7468 203c ytes of length < │ │ │ +00163f90: 636f 6465 3e6c 656e 3c2f 636f 6465 3e2e code>len
    . │ │ │ +00163fa0: 2054 6865 2073 696e 6b20 666f 7220 7468 The sink for th │ │ │ +00163fb0: 6520 6461 7461 2074 6f20 6265 2073 656e e data to be sen │ │ │ +00163fc0: 7420 746f 2069 7320 7479 7069 6361 6c6c t to is typicall │ │ │ +00163fd0: 7920 3c63 6f64 653e 3c61 2063 6c61 7373 y │ │ │ +00164090: 736f 6170 3a3a 736f 636b 6574 3c2f 613e soap::socket │ │ │ +001640a0: 3c2f 636f 6465 3e2c 203c 636f 6465 3e3c , < │ │ │ +001640b0: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ +001640c0: 663d 2273 7472 7563 7473 6f61 702e 6874 f="structsoap.ht │ │ │ +001640d0: 6d6c 2361 3230 3064 3731 6139 3031 6364 ml#a200d71a901cd │ │ │ +001640e0: 6335 6339 6161 3032 3134 3065 3964 3233 c5c9aa02140e9d23 │ │ │ +001640f0: 3639 6239 2220 7469 746c 653d 2254 6865 69b9" title="The │ │ │ +00164100: 2066 696c 6520 6465 7363 7269 7074 6f72 file descriptor │ │ │ +00164110: 2074 6f20 7772 6974 6520 6461 7461 2074 to write data t │ │ │ +00164120: 6f20 7768 656e 206e 6f20 736f 636b 6574 o when no socket │ │ │ +00164130: 2063 6f6d 6d75 6e69 6361 7469 6f6e 7320 communications │ │ │ +00164140: 6172 6520 7365 7420 2873 6f61 703a 3a73 are set (soap::s │ │ │ +00164150: 6f63 6b65 7420 3d3d 2023 534f 4150 5f49 ocket == #SOAP_I │ │ │ +00164160: 4e56 2e2e 2e22 3e73 6f61 703a 3a73 656e NV...">soap::sen │ │ │ +00164170: 6466 643c 2f61 3e3c 2f63 6f64 653e 206f dfd o │ │ │ +00164180: 7220 3c63 6f64 653e 3c61 2063 6c61 7373 r │ │ │ +00164240: 736f 6170 3a3a 6f73 3c2f 613e 3c2f 636f soap::os. Returns #SOAP_OK or a s │ │ │ +00164330: 6f61 705f 7374 6174 7573 3c2f 613e 3c2f oap_status (int) erro │ │ │ +00164350: 7220 636f 6465 2e20 5468 6520 6275 696c r code. The buil │ │ │ +00164360: 742d 696e 2066 756e 6374 696f 6e20 6173 t-in function as │ │ │ +00164370: 7369 676e 6564 2074 6f20 3c63 6f64 653e signed to │ │ │ +00164380: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap:: │ │ │ +00164410: 6673 656e 643c 2f61 3e3c 2f63 6f64 653e fsend │ │ │ +00164420: 2069 7320 3c63 6f64 653e 6673 656e 643c is fsend< │ │ │ +00164430: 2f63 6f64 653e 2e3c 2f70 3e0a 3c68 333e /code>.

    .

    │ │ │ +00164440: 3c61 2063 6c61 7373 3d22 616e 6368 6f72 .fserver │ │ │ +00164470: 6c6f 6f70 3c2f 6833 3e0a 3c70 3e3c 636f loop

    .

    int (so │ │ │ +00164550: 6170 3a3a 6673 6572 7665 6c6f 6f70 3c2f ap::fserveloop)(struct soap │ │ │ +00164570: 2a73 6f61 7029 3c2f 636f 6465 3e3c 2f70 *soap)

    .

    This callba │ │ │ +00164590: 636b 2069 7320 6361 6c6c 6564 2061 6674 ck is called aft │ │ │ +001645a0: 6572 2065 6163 6820 7375 6363 6573 7366 er each successf │ │ │ +001645b0: 756c 2063 6f6d 706c 6574 696f 6e20 6f66 ul completion of │ │ │ +001645c0: 2061 2073 6572 7665 7220 6f70 6572 6174 a server operat │ │ │ +001645d0: 696f 6e20 696e 2074 6865 2073 6572 7665 ion in the serve │ │ │ +001645e0: 7220 6c6f 6f70 2e20 4578 6563 7574 6573 r loop. Executes │ │ │ +001645f0: 2069 6d6d 6564 6961 7465 6c79 2061 6674 immediately aft │ │ │ +00164600: 6572 2073 656e 6469 6e67 2074 6865 2072 er sending the r │ │ │ +00164610: 6573 706f 6e73 6520 746f 2061 2063 6c69 esponse to a cli │ │ │ +00164620: 656e 7420 616e 6420 6265 666f 7265 2074 ent and before t │ │ │ +00164630: 6865 206e 6578 7420 6b65 6570 2d61 6c69 he next keep-ali │ │ │ +00164640: 7665 2073 6572 7665 7220 6c6f 6f70 2069 ve server loop i │ │ │ +00164650: 7465 7261 7469 6f6e 2077 6865 6e20 656e teration when en │ │ │ +00164660: 6162 6c65 6420 7769 7468 203c 636f 6465 abled with #SOAP_IO_KEEPAL │ │ │ +00164680: 4956 453c 2f63 6f64 653e 2e20 5468 6973 IVE. This │ │ │ +00164690: 2063 616c 6c62 6163 6b20 6361 6e20 6265 callback can be │ │ │ +001646a0: 2075 7365 6420 746f 2072 6563 6c61 696d used to reclaim │ │ │ +001646b0: 2072 6573 6f75 7263 6573 2069 6e20 7468 resources in th │ │ │ +001646c0: 6520 6b65 6570 2d61 6c69 7665 2073 6572 e keep-alive ser │ │ │ +001646d0: 7665 7220 6c6f 6f70 2c20 666f 7220 6578 ver loop, for ex │ │ │ +001646e0: 616d 706c 6520 6d61 6e61 6765 6420 6d65 ample managed me │ │ │ +001646f0: 6d6f 7279 2063 616e 2062 6520 7265 636c mory can be recl │ │ │ +00164700: 6169 6d65 6420 6279 2063 616c 6c69 6e67 aimed by calling │ │ │ +00164710: 203c 636f 6465 3e3c 6120 636c 6173 733d soap_destr │ │ │ +001647d0: 6f79 3c2f 613e 3c2f 636f 6465 3e20 616e oy an │ │ │ +001647e0: 6420 3c63 6f64 653e 3c61 2063 6c61 7373 d soap │ │ │ +001648b0: 5f65 6e64 3c2f 613e 3c2f 636f 6465 3e20 _end │ │ │ +001648c0: 696e 2074 6861 7420 6f72 6465 7220 616e in that order an │ │ │ +001648d0: 6420 616c 6c20 6465 7365 7269 616c 697a d all deserializ │ │ │ +001648e0: 6564 2061 6e64 206f 7468 6572 2064 796e ed and other dyn │ │ │ +001648f0: 616d 6963 616c 6c79 2d61 6c6c 6f63 6174 amically-allocat │ │ │ +00164900: 6564 2064 6174 6120 6d61 6e61 6765 6420 ed data managed │ │ │ +00164910: 6279 2074 6865 2063 6f6e 7465 7874 2077 by the context w │ │ │ +00164920: 696c 6c20 6265 2064 6561 6c6c 6f63 6174 ill be deallocat │ │ │ +00164930: 6564 2e20 5265 7475 726e 7320 3c63 6f64 ed. Returns #SOAP_OK or a so │ │ │ +00164a10: 6170 5f73 7461 7475 733c 2f61 3e3c 2f63 ap_status (int) error │ │ │ +00164a30: 2063 6f64 652e 204e 6f20 6275 696c 742d code. No built- │ │ │ +00164a40: 696e 2066 756e 6374 696f 6e20 6973 2061 in function is a │ │ │ +00164a50: 7373 6967 6e65 6420 746f 203c 636f 6465 ssigned to soap::fse │ │ │ +00164b30: 7276 656c 6f6f 703c 2f61 3e3c 2f63 6f64 rveloop.

    .

    │ │ │ +00164b70: 3c2f 613e 0a66 6d61 6c6c 6f63 3c2f 6833 .fmalloc

    .

    void │ │ │ +00164b90: 283c 6120 636c 6173 733d 2265 6c22 2068 (soa │ │ │ +00164c30: 703a 3a66 6d61 6c6c 6f63 3c2f 613e 2928 p::fmalloc)( │ │ │ +00164c40: 7374 7275 6374 2073 6f61 7020 2a73 6f61 struct soap *soa │ │ │ +00164c50: 702c 2073 697a 655f 7420 7369 7a65 293c p, size_t size)< │ │ │ +00164c60: 2f63 6f64 653e 3c2f 703e 0a3c 703e 5468 /code>

    .

    Th │ │ │ +00164c70: 6973 2063 616c 6c62 6163 6b20 6361 6e20 is callback can │ │ │ +00164c80: 6265 2075 7365 6420 746f 206f 7665 7272 be used to overr │ │ │ +00164c90: 6964 6520 6d65 6d6f 7279 2061 6c6c 6f63 ide memory alloc │ │ │ +00164ca0: 6174 696f 6e20 616e 6420 6d61 6e61 6765 ation and manage │ │ │ +00164cb0: 6d65 6e74 2064 6f6e 6520 6279 203c 636f ment done by soap_malloc │ │ │ +00164d70: 3c2f 613e 3c2f 636f 6465 3e20 696e 2043 in C │ │ │ +00164d80: 2e20 4d65 6d6f 7279 2061 6c6c 6f63 6174 . Memory allocat │ │ │ +00164d90: 6564 2076 6961 2074 6869 7320 6361 6c6c ed via this call │ │ │ +00164da0: 6261 636b 2077 696c 6c20 6e6f 7420 6265 back will not be │ │ │ +00164db0: 206d 616e 6167 6564 2061 6e64 206e 6f74 managed and not │ │ │ +00164dc0: 2062 6520 6175 746f 6d61 7469 6361 6c6c be automaticall │ │ │ +00164dd0: 7920 7265 6c65 6173 6564 2062 7920 7468 y released by th │ │ │ +00164de0: 6520 656e 6769 6e65 2e20 496e 7374 6561 e engine. Instea │ │ │ +00164df0: 642c 2074 6865 2061 7070 6c69 6361 7469 d, the applicati │ │ │ +00164e00: 6f6e 2075 7369 6e67 2074 6869 7320 6361 on using this ca │ │ │ +00164e10: 6c6c 6261 636b 2073 686f 756c 6420 7265 llback should re │ │ │ +00164e20: 6c65 6173 6520 616c 6c6f 6361 7465 6420 lease allocated │ │ │ +00164e30: 6d65 6d6f 7279 2e20 416c 6c20 616c 6c6f memory. All allo │ │ │ +00164e40: 6361 7469 6f6e 7320 646f 6e65 2062 7920 cations done by │ │ │ +00164e50: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 soap_mal │ │ │ +00164f00: 6c6f 633c 2f61 3e3c 2f63 6f64 653e 2061 loc a │ │ │ +00164f10: 7265 2072 6570 6c61 6365 6420 7769 7468 re replaced with │ │ │ +00164f20: 2061 2063 616c 6c20 746f 203c 636f 6465 a call to soa │ │ │ +00164fd0: 703a 3a66 6d61 6c6c 6f63 3c2f 613e 3c2f p::fmalloc. However, │ │ │ +00164ff0: 6e6f 206f 7468 6572 2061 6c6c 6f63 6174 no other allocat │ │ │ +00165000: 696f 6e73 2c20 7375 6368 2061 7320 3c63 ions, such as soap_ │ │ │ +001650a0: 6e65 773c 2f61 3e3c 2f63 6f64 653e 2061 new a │ │ │ +001650b0: 6e64 203c 636f 6465 3e73 6f61 705f 6e65 nd soap_ne │ │ │ +001650c0: 775f 543c 2f63 6f64 653e 2066 6f72 2043 w_T for C │ │ │ +001650d0: 2b2b 2063 6c61 7373 6573 203c 636f 6465 ++ classes T are af │ │ │ +001650f0: 6665 6374 6564 2c20 6265 6361 7573 6520 fected, because │ │ │ +00165100: 6f62 6a65 6374 7320 6172 6520 616c 6c6f objects are allo │ │ │ +00165110: 6361 7465 6420 6469 6666 6572 656e 746c cated differentl │ │ │ +00165120: 792e 2054 6869 7320 6361 6c6c 6261 636b y. This callback │ │ │ +00165130: 2069 7320 7468 6572 6566 6f72 6520 6e6f is therefore no │ │ │ +00165140: 7420 7573 6566 756c 2066 6f72 2043 2b2b t useful for C++ │ │ │ +00165150: 2061 7070 6c69 6361 7469 6f6e 732e 2052 applications. R │ │ │ +00165160: 6574 7572 6e73 2061 2070 6f69 6e74 6572 eturns a pointer │ │ │ +00165170: 2074 6f20 6479 6e61 6d69 6361 6c6c 7920 to dynamically │ │ │ +00165180: 616c 6c6f 6361 7465 6420 6d65 6d6f 7279 allocated memory │ │ │ +00165190: 206f 7220 4e55 4c4c 206f 6e20 6661 696c or NULL on fail │ │ │ +001651a0: 7572 6520 746f 2061 6c6c 6f63 6174 652e ure to allocate. │ │ │ +001651b0: 204e 6f20 6275 696c 742d 696e 2066 756e No built-in fun │ │ │ +001651c0: 6374 696f 6e20 6973 2061 7373 6967 6e65 ction is assigne │ │ │ +001651d0: 6420 746f 203c 636f 6465 3e3c 6120 636c d to soap::fma │ │ │ +00165280: 6c6c 6f63 3c2f 613e 3c2f 636f 6465 3e2e lloc. │ │ │ +00165290: 3c2f 703e 0a3c 646c 2063 6c61 7373 3d22

    .
    Warning
    Deprecated │ │ │ +001652d0: 7369 6e63 6520 322e 382e 3732 2e20 4465 since 2.8.72. De │ │ │ +001652e0: 6669 6e65 203c 636f 6465 3e23 534f 4150 fine #SOAP │ │ │ +001652f0: 5f4d 414c 4c4f 433c 2f63 6f64 653e 2061 _MALLOC a │ │ │ +00165300: 6e64 203c 636f 6465 3e23 534f 4150 5f46 nd #SOAP_F │ │ │ +00165310: 5245 453c 2f63 6f64 653e 2069 6e73 7465 REE inste │ │ │ +00165320: 6164 2e3c 2f64 643e 3c2f 646c 3e0a 3c68 ad.
    ..user │ │ │ +00165360: 7661 7269 6162 6c65 3c2f 6833 3e0a 3c70 variable.

    A void* < │ │ │ +00165380: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ +00165390: 663d 2273 7472 7563 7473 6f61 702e 6874 f="structsoap.ht │ │ │ +001653a0: 6d6c 2361 3865 6233 3563 3034 3335 3961 ml#a8eb35c04359a │ │ │ +001653b0: 3536 3763 3062 3565 3236 3634 6633 6639 567c0b5e2664f3f9 │ │ │ +001653c0: 3464 3562 2220 7469 746c 653d 2255 7365 4d5b" title="Use │ │ │ +001653d0: 722d 6465 6669 6e61 626c 6520 7661 7269 r-definable vari │ │ │ +001653e0: 6162 6c65 2074 6861 7420 6d61 7920 706f able that may po │ │ │ +001653f0: 696e 7420 746f 2075 7365 722d 7370 6563 int to user-spec │ │ │ +00165400: 6966 6965 6420 6461 7461 206f 6620 616e ified data of an │ │ │ +00165410: 7920 7479 7065 2074 6f20 7061 7373 2074 y type to pass t │ │ │ +00165420: 6865 2064 6174 6120 7468 726f 7567 6820 he data through │ │ │ +00165430: 746f 2e2e 2e22 3e73 6f61 703a 3a75 7365 to...">soap::use │ │ │ +00165440: 723c 2f61 3e3c 2f63 6f64 653e 2076 6172 r var │ │ │ +00165450: 6961 626c 6520 6973 2061 7661 696c 6162 iable is availab │ │ │ +00165460: 6c65 2074 6f20 7061 7373 2075 7365 722d le to pass user- │ │ │ +00165470: 6465 6669 6e65 6420 6461 7461 2074 6f20 defined data to │ │ │ +00165480: 7468 6520 6361 6c6c 6261 636b 732e 3c2f the callbacks..

    . │ │ │ +001654c0: 4578 616d 706c 6573 3c2f 6833 3e0a 3c70 Examples

    .

    The following e │ │ │ +001654e0: 7861 6d70 6c65 2075 7365 7320 492f 4f20 xample uses I/O │ │ │ +001654f0: 6361 6c6c 6261 636b 7320 666f 7220 6375 callbacks for cu │ │ │ +00165500: 7374 6f6d 697a 6564 2073 6572 6961 6c69 stomized seriali │ │ │ +00165510: 7a61 7469 6f6e 206f 6620 6461 7461 2069 zation of data i │ │ │ +00165520: 6e74 6f20 6120 6669 7865 642d 7369 7a65 nto a fixed-size │ │ │ +00165530: 2062 7566 6665 7220 616e 6420 6465 7365 buffer and dese │ │ │ +00165540: 7269 616c 697a 6174 696f 6e20 6261 636b rialization back │ │ │ +00165550: 2069 6e74 6f20 6120 6461 7461 2073 7472 into a data str │ │ │ +00165560: 7563 7475 7265 3a3c 2f70 3e0a 3c64 6976 ucture:

    .
    ch │ │ │ +001655b0: 6172 3c2f 7370 616e 3e20 6275 665b 3130 ar buf[10 │ │ │ +001655c0: 3030 305d 3b20 3c73 7061 6e20 636c 6173 000]; // X │ │ │ +001655e0: 4d4c 2062 7566 6665 7220 3c2f 7370 616e ML buffer
    .
    int l │ │ │ +00165630: 656e 3120 3d20 303b 2020 2020 3c73 7061 en1 = 0; // #chars writ │ │ │ +00165660: 7465 6e20 3c2f 7370 616e 3e3c 2f64 6976 ten
    .
    in │ │ │ +001656a0: 743c 2f73 7061 6e3e 206c 656e 3220 3d20 t len2 = │ │ │ +001656b0: 303b 2020 2020 3c73 7061 6e20 636c 6173 0; // # │ │ │ +001656d0: 6368 6172 7320 7265 6164 203c 2f73 7061 chars read
    .
    .
    // my │ │ │ +00165730: 7365 6e64 3a20 7075 7420 584d 4c20 696e send: put XML in │ │ │ +00165740: 2062 7566 5b5d 203c 2f73 7061 6e3e 3c2f buf[] .
    int myse │ │ │ +00165790: 6e64 283c 7370 616e 2063 6c61 7373 3d22 nd(struct< │ │ │ +001657b0: 2f73 7061 6e3e 203c 6120 636c 6173 733d /span> so │ │ │ +001657e0: 6170 3c2f 613e 202a 3c61 2063 6c61 7373 ap *s │ │ │ +00165810: 6f61 703c 2f61 3e2c 203c 7370 616e 2063 oap, c │ │ │ +00165830: 6f6e 7374 3c2f 7370 616e 3e20 3c73 7061 onst char *s, │ │ │ +00165880: 7369 7a65 5f74 3c2f 7370 616e 3e20 6e29 size_t n) │ │ │ +00165890: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    {
    .
    │ │ │ +001658e0: 6966 3c2f 7370 616e 3e20 286c 656e 3120 if (len1 │ │ │ +001658f0: 2b20 6e20 2667 743b 203c 7370 616e 2063 + n > s │ │ │ +00165910: 697a 656f 663c 2f73 7061 6e3e 2862 7566 izeof(buf │ │ │ +00165920: 2929 203c 2f64 6976 3e0a 3c64 6976 2063 ))
    .
    │ │ │ +00165940: 3c73 7061 6e20 636c 6173 733d 226b 6579 return │ │ │ +00165960: 3c2f 7370 616e 3e20 3c61 2063 6c61 7373 SOAP │ │ │ +001659c0: 5f45 4f46 3c2f 613e 3b20 3c2f 6469 763e _EOF;
    │ │ │ +001659d0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    strcpy(buf │ │ │ +001659f0: 2b20 6c65 6e31 2c20 7329 3b20 3c2f 6469 + len1, s); .
    len1 += n │ │ │ +00165a20: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
    .
    .} │ │ │ +00165ae0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    .
    // myr │ │ │ +00165b30: 6563 763a 2067 6574 2058 4d4c 2066 726f ecv: get XML fro │ │ │ +00165b40: 6d20 6275 665b 5d20 3c2f 7370 616e 3e3c m buf[] < │ │ │ +00165b50: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    size_t │ │ │ +00165b90: 6d79 7265 6376 283c 7370 616e 2063 6c61 myrecv(str │ │ │ +00165bb0: 7563 743c 2f73 7061 6e3e 203c 6120 636c uct soap *soap, char *s, size_t n │ │ │ +00165c70: 2920 3c2f 6469 763e 0a3c 6469 7620 636c )
    .
    {.
    if (len2 │ │ │ +00165cd0: 202b 206e 2026 6774 3b20 6c65 6e31 2920 + n > len1) │ │ │ +00165ce0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    n = │ │ │ +00165d00: 206c 656e 3120 2d20 6c65 6e32 3b20 3c2f len1 - len2; .
    strncpy │ │ │ +00165d30: 2873 2c20 6275 6620 2b20 6c65 6e32 2c20 (s, buf + len2, │ │ │ +00165d40: 6e29 3b20 3c2f 6469 763e 0a3c 6469 7620 n);
    .
    l │ │ │ +00165d60: 656e 3220 2b3d 206e 3b20 3c2f 6469 763e en2 += n;
    │ │ │ +00165d70: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    r │ │ │ +00165da0: 6574 7572 6e3c 2f73 7061 6e3e 206e 3b20 eturn n; │ │ │ +00165db0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    }
    .
    .
    int main()
    │ │ │ +00165e30: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    {
    .
    < │ │ │ +00165e60: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +00165e70: 6f72 6422 3e73 7472 7563 7420 3c2f 7370 ord">struct soap soap;
    .
    < │ │ │ +00165f00: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +00165f10: 6f72 6422 3e73 7472 7563 7420 3c2f 7370 ord">struct ns__person p; │ │ │ +00165f30: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    soap_init1( │ │ │ +00165fb0: 2661 6d70 3b3c 6120 636c 6173 733d 2263 &soap │ │ │ +00165fe0: 3c2f 613e 2c20 3c61 2063 6c61 7373 3d22 , SOAP_XM │ │ │ +00166040: 4c5f 5452 4545 3c2f 613e 293b 203c 2f64 L_TREE); .
    len1 = l │ │ │ +00166070: 656e 3220 3d20 303b 2020 2020 203c 7370 en2 = 0; // reset buff │ │ │ +001660a0: 6572 2070 6f69 6e74 6572 7320 3c2f 7370 er pointers
    .
    p. │ │ │ +001660d0: 6e61 6d65 203d 203c 7370 616e 2063 6c61 name = "John Do │ │ │ +00166100: 6526 7175 6f74 3b3c 2f73 7061 6e3e 3b20 e"; │ │ │ +00166110: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    p.age │ │ │ +00166130: 203d 2032 353b 203c 2f64 6976 3e0a 3c64 = 25;
    . │ │ │ +00166150: 2020 3c61 2063 6c61 7373 3d22 636f 6465 soap.fsend = mysend; // assign cal │ │ │ +00166210: 6c62 6163 6b20 3c2f 7370 616e 3e3c 2f64 lback .
    s │ │ │ +00166260: 6f61 703c 2f61 3e2e 3c61 2063 6c61 7373 oap.f │ │ │ +001662c0: 7265 6376 3c2f 613e 203d 206d 7972 6563 recv = myrec │ │ │ +001662d0: 763b 203c 7370 616e 2063 6c61 7373 3d22 v; // assi │ │ │ +001662f0: 676e 2063 616c 6c62 6163 6b20 3c2f 7370 gn callback
    .
    if (soap_write_ns │ │ │ +00166350: 5f5f 7065 7273 6f6e 2826 616d 703b 3c61 __person(&soap, & │ │ │ +00166390: 616d 703b 7029 293c 2f64 6976 3e0a 3c64 amp;p))
    . │ │ │ +001663b0: 2020 7b3c 2f64 6976 3e0a 3c64 6976 2063 {
    .
    │ │ │ +001663d0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap_print_fa │ │ │ +00166430: 756c 743c 2f61 3e28 2661 6d70 3b3c 6120 ult(&soap, st │ │ │ +00166470: 646f 7574 293b 203c 2f64 6976 3e0a 3c64 dout);
    . │ │ │ +00166490: 2020 2020 6578 6974 2845 5849 545f 4641 exit(EXIT_FA │ │ │ +001664a0: 494c 5552 4529 3b20 3c2f 6469 763e 0a3c ILURE);
    .< │ │ │ +001664b0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +001664c0: 3e20 207d 203c 2f64 6976 3e0a 3c64 6976 > }
    .
    │ │ │ +001664e0: 3c73 7061 6e20 636c 6173 733d 226b 6579 if (soap_read_n │ │ │ +00166510: 735f 5f50 6572 736f 6e28 2661 6d70 3b3c s__Person(&< │ │ │ +00166520: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +00166530: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ +00166540: 6874 6d6c 223e 736f 6170 3c2f 613e 2c20 html">soap, │ │ │ +00166550: 2661 6d70 3b70 2929 3c2f 6469 763e 0a3c &p))
    .< │ │ │ +00166560: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +00166570: 3e20 207b 3c2f 6469 763e 0a3c 6469 7620 > {
    .
    │ │ │ +00166590: 203c 6120 636c 6173 733d 2263 6f64 6522 soap_print_f │ │ │ +001665f0: 6175 6c74 3c2f 613e 2826 616d 703b 3c61 ault(&soap, s │ │ │ +00166630: 7464 6f75 7429 3b20 3c2f 6469 763e 0a3c tdout);
    .< │ │ │ +00166640: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +00166650: 3e20 2020 2065 7869 7428 4558 4954 5f46 > exit(EXIT_F │ │ │ +00166660: 4149 4c55 5245 293b 203c 2f64 6976 3e0a AILURE);
    . │ │ │ +00166670: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    }
    . │ │ │ +001666a0: 203c 6120 636c 6173 733d 2263 6f64 6522 soap_destr │ │ │ +00166700: 6f79 3c2f 613e 2826 616d 703b 3c61 2063 oy(&soap); .
    so │ │ │ +001667b0: 6170 5f65 6e64 3c2f 613e 2826 616d 703b ap_end(& │ │ │ +001667c0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap) │ │ │ +001667f0: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
    .
    soap_done( │ │ │ +00166870: 2661 6d70 3b3c 6120 636c 6173 733d 2263 &soap │ │ │ +001668a0: 3c2f 613e 293b 3c2f 6469 763e 0a3c 6469 );
    .} │ │ │ +001668c0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    size_t(* fr │ │ │ +001669b0: 6563 7629 2873 7472 7563 7420 736f 6170 ecv)(struct soap │ │ │ +001669c0: 202a 736f 6170 2c20 6368 6172 202a 6275 *soap, char *bu │ │ │ +001669d0: 662c 2073 697a 655f 7420 6c65 6e29 3c2f f, size_t len)
    Callback │ │ │ +00166a00: 7468 6174 2072 6563 6569 7665 7320 6279 that receives by │ │ │ +00166a10: 7465 7320 6f66 2064 6174 6120 696e 746f tes of data into │ │ │ +00166a20: 2074 6865 2067 6976 656e 2062 7566 6665 the given buffe │ │ │ +00166a30: 722e 3c2f 6469 763e 3c64 6976 2063 6c61 r.
    De │ │ │ +00166a50: 6669 6e69 7469 6f6e 3a3c 2f62 3e20 7374 finition: st │ │ │ +00166a60: 6473 6f61 7032 2e68 3a34 3630 373c 2f64 dsoap2.h:4607
    .
    s │ │ │ +00166b30: 6f61 703a 3a66 7365 6e64 3c2f 613e 3c2f oap::fsend
    int(* fs │ │ │ +00166b60: 656e 6429 2873 7472 7563 7420 736f 6170 end)(struct soap │ │ │ +00166b70: 202a 736f 6170 2c20 636f 6e73 7420 6368 *soap, const ch │ │ │ +00166b80: 6172 202a 6461 7461 2c20 7369 7a65 5f74 ar *data, size_t │ │ │ +00166b90: 206c 656e 293c 2f64 6976 3e3c 6469 7620 len)
    Ca │ │ │ +00166bb0: 6c6c 6261 636b 2074 6861 7420 7365 6e64 llback that send │ │ │ +00166bc0: 7320 7468 6520 6769 7665 6e20 6279 7465 s the given byte │ │ │ +00166bd0: 7320 6f66 2064 6174 612e 3c2f 6469 763e s of data.
    │ │ │ +00166be0: 3c64 6976 2063 6c61 7373 3d22 7474 6465
    Definition │ │ │ +00166c00: 3a3c 2f62 3e20 7374 6473 6f61 7032 2e68 : stdsoap2.h │ │ │ +00166c10: 3a34 3632 303c 2f64 6976 3e3c 2f64 6976 :4620
    .

    A fi │ │ │ +00166c40: 7865 642d 7369 7a65 2062 7566 6665 7220 xed-size buffer │ │ │ +00166c50: 746f 2073 746f 7265 2074 6865 206f 7574 to store the out │ │ │ +00166c60: 626f 756e 6420 6d65 7373 6167 6520 7365 bound message se │ │ │ +00166c70: 6e74 2069 7320 6e6f 7420 666c 6578 6962 nt is not flexib │ │ │ +00166c80: 6c65 2074 6f20 6861 6e64 6c65 206c 6172 le to handle lar │ │ │ +00166c90: 6765 2063 6f6e 7465 6e74 2e20 546f 2073 ge content. To s │ │ │ +00166ca0: 746f 7265 2074 6865 206d 6573 7361 6765 tore the message │ │ │ +00166cb0: 2069 6e20 616e 2065 7870 616e 6469 6e67 in an expanding │ │ │ +00166cc0: 2062 7566 6665 723a 3c2f 703e 0a3c 6469 buffer:

    .
    struc │ │ │ +00166d10: 7420 3c2f 7370 616e 3e62 7566 6665 7220 t buffer │ │ │ +00166d20: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    {
    │ │ │ +00166d40: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    s │ │ │ +00166d70: 697a 655f 743c 2f73 7061 6e3e 206c 656e ize_t len │ │ │ +00166d80: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
    .
    size_t max;
    │ │ │ +00166dd0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    c │ │ │ +00166e00: 6861 723c 2f73 7061 6e3e 202a 6275 663b har *buf; │ │ │ +00166e10: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    }; .
    . │ │ │ +00166e60: 3c73 7061 6e20 636c 6173 733d 226b 6579 int
    main() .
    {
    . │ │ │ +00166ec0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 struct soap │ │ │ +00166f10: 3c2f 613e 203c 6120 636c 6173 733d 2263 soap │ │ │ +00166f40: 3c2f 613e 3b20 3c2f 6469 763e 0a3c 6469 ;
    . │ │ │ +00166f60: 203c 7370 616e 2063 6c61 7373 3d22 6b65 struct ns__person │ │ │ +00166f90: 703b 203c 2f64 6976 3e0a 3c64 6976 2063 p;
    .
    struct buffer *h = ma │ │ │ +00166fe0: 6c6c 6f63 283c 7370 616e 2063 6c61 7373 lloc(sizeo │ │ │ +00167000: 663c 2f73 7061 6e3e 283c 7370 616e 2063 f(s │ │ │ +00167020: 7472 7563 743c 2f73 7061 6e3e 2062 7566 truct buf │ │ │ +00167030: 6665 7229 293b 203c 2f64 6976 3e0a 3c64 fer));
    . │ │ │ +00167050: 2020 682d 2667 743b 6c65 6e20 3d20 303b h->len = 0; │ │ │ +00167060: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    h-&g │ │ │ +00167080: 743b 6d61 7820 3d20 303b 203c 2f64 6976 t;max = 0;
    .
    h->buf │ │ │ +001670b0: 3d20 4e55 4c4c 3b20 3c2f 6469 763e 0a3c = NULL;
    .< │ │ │ +001670c0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +001670d0: 3e20 203c 6120 636c 6173 733d 2263 6f64 > soap_ini │ │ │ +00167130: 7431 3c2f 613e 2826 616d 703b 3c61 2063 t1(&soap, │ │ │ +001671c0: 534f 4150 5f58 4d4c 5f54 5245 453c 2f61 SOAP_XML_TREE);
    .
    < │ │ │ +001671f0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +00167200: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ +00167210: 6874 6d6c 223e 736f 6170 3c2f 613e 2e3c html">soap.< │ │ │ +00167220: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +00167230: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ +00167240: 6874 6d6c 2361 3865 6233 3563 3034 3335 html#a8eb35c0435 │ │ │ +00167250: 3961 3536 3763 3062 3565 3236 3634 6633 9a567c0b5e2664f3 │ │ │ +00167260: 6639 3464 3562 223e 7573 6572 3c2f 613e f94d5b">user │ │ │ +00167270: 203d 2028 3c73 7061 6e20 636c 6173 733d = (vo │ │ │ +00167290: 6964 3c2f 7370 616e 3e2a 2968 3b20 3c73 id*)h; // pass buff │ │ │ +001672c0: 6572 2061 7320 6120 6861 6e64 6c65 2074 er as a handle t │ │ │ +001672d0: 6f20 7468 6520 6361 6c6c 6261 636b 203c o the callback < │ │ │ +001672e0: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    . │ │ │ +00167300: 203c 6120 636c 6173 733d 2263 6f64 6522 soap │ │ │ +00167330: 2e3c 6120 636c 6173 733d 2263 6f64 6522 .fsend = mysend; // assign cal │ │ │ +001673c0: 6c62 6163 6b20 3c2f 7370 616e 3e3c 2f64 lback .
    if (soa │ │ │ +00167410: 705f 7772 6974 655f 6e73 5f5f 7065 7273 p_write_ns__pers │ │ │ +00167420: 6f6e 2826 616d 703b 3c61 2063 6c61 7373 on(&s │ │ │ +00167450: 6f61 703c 2f61 3e2c 2026 616d 703b 7029 oap, &p) │ │ │ +00167460: 293c 2f64 6976 3e0a 3c64 6976 2063 6c61 )
    .
    {..
    ex │ │ │ +00167560: 6974 2845 5849 545f 4641 494c 5552 4529 it(EXIT_FAILURE) │ │ │ +00167570: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
    .
    } < │ │ │ +00167590: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    if (h │ │ │ +001675d0: 2d26 6774 3b6c 656e 2920 3c2f 6469 763e ->len)
    │ │ │ +001675e0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    {
    . │ │ │ +00167610: 2020 202e 2e2e 203c 7370 616e 2063 6c61 ... // │ │ │ +00167630: 7573 6520 682d 2667 743b 6275 665b 302e use h->buf[0. │ │ │ +00167640: 2e68 2d26 6774 3b6c 656e 2d31 5d20 636f .h->len-1] co │ │ │ +00167650: 6e74 656e 7420 3c2f 7370 616e 3e3c 2f64 ntent .
    │ │ │ +00167690: 2f2f 2074 6865 6e20 636c 6561 6e75 703a // then cleanup: │ │ │ +001676a0: 203c 2f73 7061 6e3e 3c2f 6469 763e 0a3c
    .< │ │ │ +001676b0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +001676c0: 3e20 2020 2068 2d26 6774 3b6c 656e 203d > h->len = │ │ │ +001676d0: 2030 3b20 3c2f 6469 763e 0a3c 6469 7620 0;
    .
    │ │ │ +001676f0: 2068 2d26 6774 3b6d 6178 203d 2030 3b20 h->max = 0; │ │ │ +00167700: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    fre │ │ │ +00167720: 6528 682d 2667 743b 6275 6629 3b20 3c2f e(h->buf); .
    h-> │ │ │ +00167750: 3b62 7566 203d 204e 554c 4c3b 203c 2f64 ;buf = NULL; .
    }
    │ │ │ +00167780: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    soap_d │ │ │ +001677f0: 6573 7472 6f79 3c2f 613e 2826 616d 703b estroy(& │ │ │ +00167800: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap) │ │ │ +00167830: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
    .
    soap_end(& │ │ │ +001678b0: 616d 703b 3c61 2063 6c61 7373 3d22 636f amp;soap< │ │ │ +001678e0: 2f61 3e29 3b20 3c2f 6469 763e 0a3c 6469 /a>);
    . │ │ │ +00167900: 203c 6120 636c 6173 733d 2263 6f64 6522 soap_done< │ │ │ +00167960: 2f61 3e28 2661 6d70 3b3c 6120 636c 6173 /a>(& │ │ │ +00167990: 736f 6170 3c2f 613e 293b 3c2f 6469 763e soap);
    │ │ │ +001679a0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    }
    .
    < │ │ │ +001679d0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    int mys │ │ │ +00167a10: 656e 6428 3c73 7061 6e20 636c 6173 733d end(struct │ │ │ +00167a30: 3c2f 7370 616e 3e20 3c61 2063 6c61 7373 s │ │ │ +00167a60: 6f61 703c 2f61 3e20 2a3c 6120 636c 6173 oap * │ │ │ +00167a90: 736f 6170 3c2f 613e 2c20 3c73 7061 6e20 soap, │ │ │ +00167ab0: 636f 6e73 743c 2f73 7061 6e3e 203c 7370 const char *s, size_t n │ │ │ +00167b10: 2920 3c2f 6469 763e 0a3c 6469 7620 636c )
    .
    {.
    str │ │ │ +00167b60: 7563 7420 3c2f 7370 616e 3e62 7566 6665 uct buffe │ │ │ +00167b70: 7220 2a68 203d 2028 3c73 7061 6e20 636c r *h = (st │ │ │ +00167b90: 7275 6374 203c 2f73 7061 6e3e 6275 6666 ruct buff │ │ │ +00167ba0: 6572 2a29 3c61 2063 6c61 7373 3d22 636f er*)soap< │ │ │ +00167bd0: 2f61 3e2d 2667 743b 3c61 2063 6c61 7373 /a>->user; // get buffer t │ │ │ +00167c50: 6872 6f75 6768 2068 616e 646c 6520 3c2f hrough handle
    .
    │ │ │ +00167c80: 3c73 7061 6e20 636c 6173 733d 226b 6579 int m = h->m │ │ │ +00167cb0: 6178 2c20 6b20 3d20 682d 2667 743b 6c65 ax, k = h->le │ │ │ +00167cc0: 6e20 2b20 6e3b 203c 2f64 6976 3e0a 3c64 n + n;
    . │ │ │ +00167ce0: 2020 3c73 7061 6e20 636c 6173 733d 2263 // need │ │ │ +00167d00: 746f 2069 6e63 7265 6173 6520 7370 6163 to increase spac │ │ │ +00167d10: 653f 203c 2f73 7061 6e3e 3c2f 6469 763e e?
    │ │ │ +00167d20: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    if (m == 0) │ │ │ +00167d40: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    m │ │ │ +00167d60: 3d20 3130 3234 3b20 3c2f 6469 763e 0a3c = 1024;
    .< │ │ │ +00167d70: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +00167d80: 3e20 203c 7370 616e 2063 6c61 7373 3d22 > els │ │ │ +00167da0: 653c 2f73 7061 6e3e 203c 2f64 6976 3e0a e
    . │ │ │ +00167db0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    │ │ │ +00167de0: 7768 696c 653c 2f73 7061 6e3e 2028 6b20 while (k │ │ │ +00167df0: 2667 743b 3d20 6d29 203c 2f64 6976 3e0a >= m)
    . │ │ │ +00167e00: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    m *= 2; │ │ │ +00167e20: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    if ( │ │ │ +00167e60: 6d20 213d 2068 2d26 6774 3b6d 6178 2920 m != h->max) │ │ │ +00167e70: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    {.
    char * │ │ │ +00167ed0: 6275 6620 3d20 6d61 6c6c 6f63 286d 293b buf = malloc(m); │ │ │ +00167ee0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    me │ │ │ +00167f00: 6d63 7079 2862 7566 2c20 682d 2667 743b mcpy(buf, h-> │ │ │ +00167f10: 6275 662c 2068 2d26 6774 3b6c 656e 293b buf, h->len); │ │ │ +00167f20: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    h- │ │ │ +00167f40: 2667 743b 6d61 7820 3d20 6d3b 203c 2f64 >max = m; .
    if (h │ │ │ +00167f90: 2d26 6774 3b62 7566 2920 3c2f 6469 763e ->buf)
    │ │ │ +00167fa0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    free(h- │ │ │ +00167fc0: 2667 743b 6275 6629 3b20 3c2f 6469 763e >buf);
    │ │ │ +00167fd0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    h->buf │ │ │ +00167ff0: 203d 2062 7566 3b20 3c2f 6469 763e 0a3c = buf;
    .< │ │ │ +00168000: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +00168010: 3e20 207d 203c 2f64 6976 3e0a 3c64 6976 > }
    .
    │ │ │ +00168030: 6d65 6d63 7079 2868 2d26 6774 3b62 7566 memcpy(h->buf │ │ │ +00168040: 202b 2068 2d26 6774 3b6c 656e 2c20 732c + h->len, s, │ │ │ +00168050: 206e 293b 203c 2f64 6976 3e0a 3c64 6976 n);
    .
    │ │ │ +00168070: 682d 2667 743b 6c65 6e20 2b3d 206e 3b20 h->len += n; │ │ │ +00168080: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    return SOAP_OK;
    .
    }.

    T │ │ │ +00168160: 6865 2066 6f6c 6c6f 7769 6e67 2065 7861 he following exa │ │ │ +00168170: 6d70 6c65 2069 6c6c 7573 7472 6174 6573 mple illustrates │ │ │ +00168180: 2063 7573 746f 6d69 7a65 6420 492f 4f20 customized I/O │ │ │ +00168190: 616e 6420 4854 5450 2068 6561 6465 7220 and HTTP header │ │ │ +001681a0: 6861 6e64 6c69 6e67 2e20 5468 6520 584d handling. The XM │ │ │ +001681b0: 4c20 6d65 7373 6167 6520 6973 2073 6176 L message is sav │ │ │ +001681c0: 6564 2074 6f20 6120 6669 6c65 2074 6f20 ed to a file to │ │ │ +001681d0: 6465 6d6f 6e73 7472 6174 6520 492f 4f20 demonstrate I/O │ │ │ +001681e0: 616e 6420 4854 5450 2063 616c 6c62 6163 and HTTP callbac │ │ │ +001681f0: 6b73 2e20 5468 6520 636c 6965 6e74 2070 ks. The client p │ │ │ +00168200: 726f 7879 2074 6865 6e20 7265 6164 7320 roxy then reads │ │ │ +00168210: 7468 6520 6669 6c65 2063 6f6e 7465 6e74 the file content │ │ │ +00168220: 7320 6173 2074 6865 2073 6572 7669 6365 s as the service │ │ │ +00168230: 2072 6573 706f 6e73 652e 2054 6f20 7065 response. To pe │ │ │ +00168240: 7266 6f72 6d20 7468 6973 2074 7269 636b rform this trick │ │ │ +00168250: 2c20 7468 6520 7365 7276 6963 6520 7265 , the service re │ │ │ +00168260: 7370 6f6e 7365 2068 6173 2065 7861 6374 sponse has exact │ │ │ +00168270: 6c79 2074 6865 2073 616d 6520 7374 7275 ly the same stru │ │ │ +00168280: 6374 7572 6520 6173 2074 6865 2072 6571 cture as the req │ │ │ +00168290: 7565 7374 2e20 5468 6973 2069 7320 6465 uest. This is de │ │ │ +001682a0: 636c 6172 6564 2062 7920 7468 6520 3c63 clared by the struct ns__t │ │ │ +001682c0: 6573 743c 2f63 6f64 653e 206f 7574 7075 est outpu │ │ │ +001682d0: 7420 7061 7261 6d65 7465 7220 7061 7274 t parameter part │ │ │ +001682e0: 206f 6620 7468 6520 7365 7276 6963 6520 of the service │ │ │ +001682f0: 6f70 6572 6174 696f 6e20 6465 636c 6172 operation declar │ │ │ +00168300: 6174 696f 6e2e 2054 6869 7320 7374 7275 ation. This stru │ │ │ +00168310: 6374 2072 6573 656d 626c 6573 2074 6865 ct resembles the │ │ │ +00168320: 2073 6572 7669 6365 2072 6571 7565 7374 service request │ │ │ +00168330: 2028 7365 6520 7468 6520 6765 6e65 7261 (see the genera │ │ │ +00168340: 7465 6420 3c65 6d3e 3c63 6f64 653e 736f ted so │ │ │ +00168350: 6170 5374 7562 2e68 3c2f 636f 6465 3e3c apStub.h< │ │ │ +00168360: 2f65 6d3e 2066 696c 6520 6765 6e65 7261 /em> file genera │ │ │ +00168370: 7465 6420 6279 2073 6f61 7063 7070 3220 ted by soapcpp2 │ │ │ +00168380: 6672 6f6d 2074 6865 2069 6e74 6572 6661 from the interfa │ │ │ +00168390: 6365 2068 6561 6465 7220 6669 6c65 2069 ce header file i │ │ │ +001683a0: 6e70 7574 292e 3c2f 703e 0a3c 703e 5468 nput).

    .

    Th │ │ │ +001683b0: 6520 696e 7465 7266 6163 6520 6865 6164 e interface head │ │ │ +001683c0: 6572 2066 696c 6520 666f 7220 736f 6170 er file for soap │ │ │ +001683d0: 6370 7032 2069 733a 3c2f 703e 0a3c 6469 cpp2 is:

    .
    //gso │ │ │ +00168420: 6170 206e 7320 7365 7276 6963 6520 6e61 ap ns service na │ │ │ +00168430: 6d65 3a20 6361 6c6c 6261 636b 203c 2f73 me: callback
    .
    //gsoap ns se │ │ │ +00168480: 7276 6963 6520 6e61 6d65 7370 6163 653a rvice namespace: │ │ │ +00168490: 2075 726e 3a63 616c 6c62 6163 6b20 3c2f urn:callback
    .
    struct ns__person .
    {
    . │ │ │ +00168520: 2020 2020 3c73 7061 6e20 636c 6173 733d ch │ │ │ +00168540: 6172 3c2f 7370 616e 3e20 2a6e 616d 653b ar *name; │ │ │ +00168550: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    int age;
    .< │ │ │ +001685a0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +001685b0: 3e7d 3b20 3c2f 6469 763e 0a3c 6469 7620 >};
    .
    int ns__test(struct n │ │ │ +00168620: 735f 5f70 6572 736f 6e20 696e 2c20 3c73 s__person in, struct ns__test & │ │ │ +00168660: 6f75 7429 3b3c 2f64 6976 3e0a 3c2f 6469 out);
    .

    The client │ │ │ +00168690: 2070 726f 6772 616d 2069 733a 3c2f 703e program is:

    │ │ │ +001686a0: 0a3c 6469 7620 636c 6173 733d 2266 7261 .
    #include &qu │ │ │ +001686f0: 6f74 3b73 6f61 7048 2e68 2671 756f 743b ot;soapH.h" │ │ │ +00168700: 3c2f 7370 616e 3e20 3c2f 6469 763e 0a3c
    .< │ │ │ +00168710: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +00168720: 3e3c 7370 616e 2063 6c61 7373 3d22 7072 >#inc │ │ │ +00168740: 6c75 6465 2026 7175 6f74 3b6e 732e 6e73 lude "ns.ns │ │ │ +00168750: 6d61 7026 7175 6f74 3b3c 2f73 7061 6e3e map" │ │ │ +00168760: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    .
    SOAP_SOCKE │ │ │ +001687f0: 543c 2f61 3e20 6d79 6f70 656e 283c 7370 T myopen(struct │ │ │ +00168820: 203c 6120 636c 6173 733d 2263 6f64 6522 soap │ │ │ +00168850: 202a 3c61 2063 6c61 7373 3d22 636f 6465 *soap, const │ │ │ +001688c0: 6368 6172 3c2f 7370 616e 3e20 2a65 6e64 char *end │ │ │ +001688d0: 706f 696e 742c 203c 7370 616e 2063 6c61 point, con │ │ │ +001688f0: 7374 3c2f 7370 616e 3e20 3c73 7061 6e20 st char │ │ │ +00168920: 2a68 6f73 742c 203c 7370 616e 2063 6c61 *host, int port │ │ │ +00168950: 2920 3c2f 6469 763e 0a3c 6469 7620 636c )
    .
    {.
    if (strn │ │ │ +001689b0: 636d 7028 656e 6470 6f69 6e74 2c20 3c73 cmp(endpoint, " │ │ │ +001689e0: 6669 6c65 3a26 7175 6f74 3b3c 2f73 7061 file:", 5))
    .< │ │ │ +00168a00: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +00168a10: 3e20 207b 3c2f 6469 763e 0a3c 6469 7620 > {
    .
    │ │ │ +00168a30: 2070 7269 6e74 6628 3c73 7061 6e20 636c printf("File n │ │ │ +00168a60: 616d 6520 6578 7065 6374 6564 5c6e 2671 ame expected\n&q │ │ │ +00168a70: 756f 743b 3c2f 7370 616e 3e29 3b20 3c2f uot;); .
    return SOAP_INVALI │ │ │ +00168b20: 445f 534f 434b 4554 3c2f 613e 3b20 3c2f D_SOCKET; .
    }
    .
    │ │ │ +00168b80: 6966 3c2f 7370 616e 3e20 2828 3c61 2063 if ((soap-> │ │ │ +00168bc0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 sendfd< │ │ │ +00168c10: 2f61 3e20 3d20 3c61 2063 6c61 7373 3d22 /a> = soa │ │ │ +00168c40: 703c 2f61 3e2d 2667 743b 3c61 2063 6c61 p->recvfd = │ │ │ +00168ca0: 6f70 656e 2868 6f73 742c 204f 5f52 4457 open(host, O_RDW │ │ │ +00168cb0: 527c 4f5f 4352 4541 542c 2053 5f49 5755 R|O_CREAT, S_IWU │ │ │ +00168cc0: 5352 7c53 5f49 5255 5352 2929 2026 6c74 SR|S_IRUSR)) < │ │ │ +00168cd0: 3b20 3029 203c 2f64 6976 3e0a 3c64 6976 ; 0)
    .
    │ │ │ +00168cf0: 2020 3c73 7061 6e20 636c 6173 733d 226b retu │ │ │ +00168d10: 726e 3c2f 7370 616e 3e20 3c61 2063 6c61 rn SOAP │ │ │ +00168d70: 5f49 4e56 414c 4944 5f53 4f43 4b45 543c _INVALID_SOCKET< │ │ │ +00168d80: 2f61 3e3b 203c 2f64 6976 3e0a 3c64 6976 /a>;
    ..
    } .
    .< │ │ │ +00168ea0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +00168eb0: 6f72 6474 7970 6522 3e76 6f69 643c 2f73 ordtype">void
    myclose(struct │ │ │ +00168ef0: 203c 6120 636c 6173 733d 2263 6f64 6522 soap │ │ │ +00168f20: 202a 3c61 2063 6c61 7373 3d22 636f 6465 *soap)
    .
    {.
    if (soap-> │ │ │ +00168fe0: 3b3c 6120 636c 6173 733d 2263 6f64 6522 ;sendfd │ │ │ +00169030: 3c2f 613e 2026 6774 3b20 3229 2020 3c73 > 2) // still ope │ │ │ +00169060: 6e3f 203c 2f73 7061 6e3e 3c2f 6469 763e n?
    │ │ │ +00169070: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    close(soap-> │ │ │ +001690c0: 3b3c 6120 636c 6173 733d 2263 6f64 6522 ;sendfd │ │ │ +00169110: 3c2f 613e 293b 203c 7370 616e 2063 6c61 ); // │ │ │ +00169130: 7468 656e 2063 6c6f 7365 2069 7420 3c2f then close it
    .
    │ │ │ +00169160: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap- │ │ │ +00169190: 2667 743b 3c61 2063 6c61 7373 3d22 636f >rec │ │ │ +001691e0: 7666 643c 2f61 3e20 3d20 303b 2020 2020 vfd = 0; │ │ │ +001691f0: 2020 3c73 7061 6e20 636c 6173 733d 2263 // set b │ │ │ +00169210: 6163 6b20 746f 2073 7464 696e 203c 2f73 ack to stdin
    .
    < │ │ │ +00169240: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +00169250: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ +00169260: 6874 6d6c 223e 736f 6170 3c2f 613e 2d26 html">soap-& │ │ │ +00169270: 6774 3b3c 6120 636c 6173 733d 2263 6f64 gt;send │ │ │ +001692c0: 6664 3c2f 613e 203d 2031 3b20 2020 2020 fd = 1; │ │ │ +001692d0: 203c 7370 616e 2063 6c61 7373 3d22 636f // set ba │ │ │ +001692f0: 636b 2074 6f20 7374 646f 7574 203c 2f73 ck to stdout
    .
    } < │ │ │ +00169320: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    . │ │ │ +00169340: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    int< │ │ │ +00169370: 2f73 7061 6e3e 206d 7970 6f73 7428 3c73 /span> mypost(struct soap *soap, const< │ │ │ +00169420: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> char *en │ │ │ +00169450: 6470 6f69 6e74 2c20 3c73 7061 6e20 636c dpoint, co │ │ │ +00169470: 6e73 743c 2f73 7061 6e3e 203c 7370 616e nst char │ │ │ +001694a0: 202a 686f 7374 2c20 3c73 7061 6e20 636c *host, co │ │ │ +001694c0: 6e73 743c 2f73 7061 6e3e 203c 7370 616e nst char │ │ │ +001694f0: 202a 7061 7468 2c20 3c73 7061 6e20 636c *path, co │ │ │ +00169510: 6e73 743c 2f73 7061 6e3e 203c 7370 616e nst char │ │ │ +00169540: 202a 6163 7469 6f6e 2c20 3c61 2063 6c61 *action, ULON │ │ │ +001695a0: 4736 343c 2f61 3e20 636f 756e 7429 203c G64 count) < │ │ │ +001695b0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    {
    . │ │ │ +001695d0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    re │ │ │ +00169600: 7475 726e 3c2f 7370 616e 3e20 3c61 2063 turn soap │ │ │ +00169660: 5f73 656e 643c 2f61 3e28 3c61 2063 6c61 _send(soap, "Cus │ │ │ +001696c0: 746f 6d2d 6765 6e65 7261 7465 6420 6669 tom-generated fi │ │ │ +001696d0: 6c65 5c6e 2671 756f 743b 3c2f 7370 616e le\n"); // wri │ │ │ +00169700: 7465 7320 746f 2073 6f61 702d 2667 743b tes to soap-> │ │ │ +00169710: 7365 6e64 6664 203c 2f73 7061 6e3e 3c2f sendfd .
    }
    . │ │ │ +00169740: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    .
    int │ │ │ +00169790: 206d 7970 6172 7365 283c 7370 616e 2063 myparse(s │ │ │ +001697b0: 7472 7563 743c 2f73 7061 6e3e 203c 6120 truct soap *soap) < │ │ │ +00169820: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    {
    . │ │ │ +00169840: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    ch │ │ │ +00169870: 6172 3c2f 7370 616e 3e20 6275 665b 3235 ar buf[25 │ │ │ +00169880: 365d 3b20 3c2f 6469 763e 0a3c 6469 7620 6];
    .
    < │ │ │ +001698a0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +001698b0: 6f72 6466 6c6f 7722 3e69 663c 2f73 7061 ordflow">if (lseek(soap->recvfd, 0, SEEK_SET) │ │ │ +00169960: 266c 743b 2030 207c 7c20 3c61 2063 6c61 < 0 || soap_g │ │ │ +001699c0: 6574 6c69 6e65 3c2f 613e 283c 6120 636c etline(soap, buf, │ │ │ +00169a00: 2032 3536 2929 203c 7370 616e 2063 6c61 256)) // │ │ │ +00169a20: 676f 2074 6f20 6265 6769 6e20 616e 6420 go to begin and │ │ │ +00169a30: 736b 6970 2063 7573 746f 6d20 6865 6164 skip custom head │ │ │ +00169a40: 6572 203c 2f73 7061 6e3e 3c2f 6469 763e er
    │ │ │ +00169a50: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    return < │ │ │ +00169a90: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +00169aa0: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ +00169ab0: 705f 5f65 7272 6f72 732e 6874 6d6c 2367 p__errors.html#g │ │ │ +00169ac0: 6132 3234 6232 6332 6238 3330 3133 3566 a224b2c2b830135f │ │ │ +00169ad0: 3132 6235 3335 3336 6631 3839 6234 6562 12b53536f189b4eb │ │ │ +00169ae0: 6422 3e53 4f41 505f 454f 463c 2f61 3e3b d">SOAP_EOF; │ │ │ +00169af0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    ..
    } │ │ │ +00169bb0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    │ │ │ +00169bd0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    int │ │ │ +00169c00: 3c2f 7370 616e 3e20 6d61 696e 2829 203c main() < │ │ │ +00169c10: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    {
    . │ │ │ +00169c30: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    . │ │ │ +00169cd0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    struct │ │ │ +00169d00: 203c 2f73 7061 6e3e 6e73 5f5f 7465 7374 ns__test │ │ │ +00169d10: 2072 3b20 3c2f 6469 763e 0a3c 6469 7620 r;
    .
    < │ │ │ +00169d30: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +00169d40: 6f72 6422 3e73 7472 7563 7420 3c2f 7370 ord">struct ns__person p; │ │ │ +00169d60: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    soap_init(& │ │ │ +00169de0: 616d 703b 3c61 2063 6c61 7373 3d22 636f amp;soap< │ │ │ +00169e10: 2f61 3e29 3b3c 2f64 6976 3e0a 3c64 6976 /a>);
    .
    │ │ │ +00169e30: 702e 6e61 6d65 203d 203c 7370 616e 2063 p.name = "John │ │ │ +00169e60: 446f 6526 7175 6f74 3b3c 2f73 7061 6e3e Doe" │ │ │ +00169e70: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
    .
    p.a │ │ │ +00169e90: 6765 203d 2039 393b 203c 2f64 6976 3e0a ge = 99;
    . │ │ │ +00169ea0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    soap< │ │ │ +00169ee0: 2f61 3e2e 3c61 2063 6c61 7373 3d22 636f /a>.fopen │ │ │ +00169f40: 3c2f 613e 203d 206d 796f 7065 6e3b 2020 = myopen; │ │ │ +00169f50: 203c 7370 616e 2063 6c61 7373 3d22 636f // use cu │ │ │ +00169f70: 7374 6f6d 206f 7065 6e20 3c2f 7370 616e stom open
    .
    soap.fpost = m │ │ │ +0016a030: 7970 6f73 743b 2020 203c 7370 616e 2063 ypost; / │ │ │ +0016a050: 2f20 7573 6520 6375 7374 6f6d 2070 6f73 / use custom pos │ │ │ +0016a060: 7420 3c2f 7370 616e 3e3c 2f64 6976 3e0a t
    . │ │ │ +0016a070: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    soap< │ │ │ +0016a0b0: 2f61 3e2e 3c61 2063 6c61 7373 3d22 636f /a>.fpars │ │ │ +0016a110: 653c 2f61 3e20 3d20 6d79 7061 7273 653b e = myparse; │ │ │ +0016a120: 203c 7370 616e 2063 6c61 7373 3d22 636f // use cu │ │ │ +0016a140: 7374 6f6d 2072 6573 706f 6e73 6520 7061 stom response pa │ │ │ +0016a150: 7273 6572 203c 2f73 7061 6e3e 3c2f 6469 rser .
    so │ │ │ +0016a1a0: 6170 3c2f 613e 2e3c 6120 636c 6173 733d ap.fc │ │ │ +0016a200: 6c6f 7365 3c2f 613e 203d 206d 7963 6c6f lose = myclo │ │ │ +0016a210: 7365 3b20 3c73 7061 6e20 636c 6173 733d se; // use │ │ │ +0016a230: 2063 7573 746f 6d20 636c 6f73 6520 3c2f custom close
    .
    │ │ │ +0016a260: 736f 6170 5f63 616c 6c5f 6e73 5f5f 7465 soap_call_ns__te │ │ │ +0016a270: 7374 2826 616d 703b 3c61 2063 6c61 7373 st(&s │ │ │ +0016a2a0: 6f61 703c 2f61 3e2c 203c 7370 616e 2063 oap, "file: │ │ │ +0016a2d0: 2f2f 7465 7374 2e78 6d6c 2671 756f 743b //test.xml" │ │ │ +0016a2e0: 3c2f 7370 616e 3e2c 203c 7370 616e 2063 , "" │ │ │ +0016a310: 3b3c 2f73 7061 6e3e 2c20 702c 2072 293b ;, p, r); │ │ │ +0016a320: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    if │ │ │ +0016a360: 283c 6120 636c 6173 733d 2263 6f64 6522 (soap │ │ │ +0016a390: 2e3c 6120 636c 6173 733d 2263 6f64 6522 .error< │ │ │ +0016a3e0: 2f61 3e29 203c 2f64 6976 3e0a 3c64 6976 /a>)
    .
    │ │ │ +0016a400: 7b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 {
    .
    soap_print_faul │ │ │ +0016a480: 743c 2f61 3e28 2661 6d70 3b3c 6120 636c t(&soap, stdo │ │ │ +0016a4c0: 7574 293b 203c 2f64 6976 3e0a 3c64 6976 ut);
    .
    │ │ │ +0016a4e0: 2020 6578 6974 2845 5849 545f 4641 494c exit(EXIT_FAIL │ │ │ +0016a4f0: 5552 4529 3b20 3c2f 6469 763e 0a3c 6469 URE);
    . │ │ │ +0016a510: 207d 203c 2f64 6976 3e0a 3c64 6976 2063 }
    . │ │ │ +0016a5d0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    soap_e │ │ │ +0016a640: 6e64 3c2f 613e 2826 616d 703b 3c61 2063 nd(&soap); .
    so │ │ │ +0016a6f0: 6170 5f64 6f6e 653c 2f61 3e28 2661 6d70 ap_done(& │ │ │ +0016a700: 3b3c 6120 636c 6173 733d 2263 6f64 6522 ;soap │ │ │ +0016a730: 293b 3c2f 6469 763e 0a3c 6469 7620 636c );
    .
    }.
    int(* fpost)(st │ │ │ +0016a840: 7275 6374 2073 6f61 7020 2a73 6f61 702c ruct soap *soap, │ │ │ +0016a850: 2063 6f6e 7374 2063 6861 7220 2a65 6e64 const char *end │ │ │ +0016a860: 706f 696e 742c 2063 6f6e 7374 2063 6861 point, const cha │ │ │ +0016a870: 7220 2a68 6f73 742c 2069 6e74 2070 6f72 r *host, int por │ │ │ +0016a880: 742c 2063 6f6e 7374 2063 6861 7220 2a70 t, const char *p │ │ │ +0016a890: 6174 682c 2063 6f6e 7374 2063 6861 7220 ath, const char │ │ │ +0016a8a0: 2a61 6374 696f 6e2c 2055 4c4f 4e47 3634 *action, ULONG64 │ │ │ +0016a8b0: 2063 6f75 6e74 293c 2f64 6976 3e3c 6469 count)
    │ │ │ +0016a8d0: 4361 6c6c 6261 636b 2074 6861 7420 706f Callback that po │ │ │ +0016a8e0: 7075 6c61 7465 7320 616e 6420 7468 656e pulates and then │ │ │ +0016a8f0: 2073 656e 6473 2048 5454 5020 6865 6164 sends HTTP head │ │ │ +0016a900: 6572 7320 6672 6f6d 2074 6865 2063 6c69 ers from the cli │ │ │ +0016a910: 656e 742d 7369 6465 2074 6f20 6120 636f ent-side to a co │ │ │ +0016a920: 6e6e 6563 7465 6420 4854 5450 2073 6572 nnected HTTP ser │ │ │ +0016a930: 7665 722e 3c2f 6469 763e 3c64 6976 2063 ver.
    │ │ │ +0016a950: 4465 6669 6e69 7469 6f6e 3a3c 2f62 3e20 Definition: │ │ │ +0016a960: 7374 6473 6f61 7032 2e68 3a34 3232 303c stdsoap2.h:4220< │ │ │ +0016a970: 2f64 6976 3e3c 2f64 6976 3e0a 3c64 6976 /div>
    .
    int(* │ │ │ +0016aa60: 2066 7061 7273 6529 2873 7472 7563 7420 fparse)(struct │ │ │ +0016aa70: 736f 6170 202a 736f 6170 293c 2f64 6976 soap *soap)
    Callback tha │ │ │ +0016aaa0: 7420 7265 6164 7320 616e 6420 7061 7273 t reads and pars │ │ │ +0016aab0: 6573 2048 5454 5020 616e 6420 4d49 4d45 es HTTP and MIME │ │ │ +0016aac0: 2068 6561 6465 7273 2e3c 2f64 6976 3e3c headers.
    < │ │ │ +0016aad0: 6469 7620 636c 6173 733d 2274 7464 6566 div class="ttdef │ │ │ +0016aae0: 223e 3c62 3e44 6566 696e 6974 696f 6e3a ">Definition: │ │ │ +0016aaf0: 3c2f 623e 2073 7464 736f 6170 322e 683a stdsoap2.h: │ │ │ +0016ab00: 3432 3530 3c2f 6469 763e 3c2f 6469 763e 4250
    │ │ │ +0016ab10: 0a3c 6469 7620 636c 6173 733d 2274 7463 .
    int soap_getli │ │ │ +0016abf0: 6e65 2873 7472 7563 7420 736f 6170 202a ne(struct soap * │ │ │ +0016ac00: 736f 6170 2c20 6368 6172 202a 6275 662c soap, char *buf, │ │ │ +0016ac10: 2069 6e74 206c 656e 293c 2f64 6976 3e3c int len)
    < │ │ │ +0016ac20: 6469 7620 636c 6173 733d 2274 7464 6f63 div class="ttdoc │ │ │ +0016ac30: 223e 4765 7420 6120 6865 6164 6572 206c ">Get a header l │ │ │ +0016ac40: 696e 652e 3c2f 6469 763e 3c2f 6469 763e ine.
    │ │ │ +0016ac50: 0a3c 2f64 6976 3e3c 212d 2d20 6672 6167 .

    SOAP │ │ │ +0016ac70: 312e 312f 312e 3220 5250 4320 656e 636f 1.1/1.2 RPC enco │ │ │ +0016ac80: 6469 6e67 2073 7065 6369 6669 6573 2074 ding specifies t │ │ │ +0016ac90: 6861 7420 534f 4150 2f58 4d4c 2065 6c65 hat SOAP/XML ele │ │ │ +0016aca0: 6d65 6e74 7320 6d61 7920 6265 2069 676e ments may be ign │ │ │ +0016acb0: 6f72 6564 2077 6865 6e20 7072 6573 656e ored when presen │ │ │ +0016acc0: 7420 696e 2061 2053 4f41 5020 7061 796c t in a SOAP payl │ │ │ +0016acd0: 6f61 6420 6f6e 2074 6865 2072 6563 6569 oad on the recei │ │ │ +0016ace0: 7669 6e67 2073 6964 652e 2048 6f77 6576 ving side. Howev │ │ │ +0016acf0: 6572 2c20 646f 6375 6d65 6e74 2f6c 6974 er, document/lit │ │ │ +0016ad00: 6572 616c 2073 7479 6c65 206d 6573 7361 eral style messa │ │ │ +0016ad10: 6769 6e67 2076 616c 6964 6174 6573 2058 ging validates X │ │ │ +0016ad20: 4d4c 206d 6573 7361 6765 7320 616e 6420 ML messages and │ │ │ +0016ad30: 6578 7472 6120 656c 656d 656e 7473 2063 extra elements c │ │ │ +0016ad40: 616e 6e6f 7420 6a75 7374 2062 6520 6967 annot just be ig │ │ │ +0016ad50: 6e6f 7265 6420 6173 2073 7563 682e 2057 nored as such. W │ │ │ +0016ad60: 6974 6820 534f 4150 2064 6f63 756d 656e ith SOAP documen │ │ │ +0016ad70: 742f 6c69 7465 7261 6c20 7374 796c 6520 t/literal style │ │ │ +0016ad80: 6974 2069 7320 7265 636f 6d6d 656e 6465 it is recommende │ │ │ +0016ad90: 6420 746f 2065 6e61 626c 6520 7468 6520 d to enable the │ │ │ +0016ada0: 3c63 6f64 653e 2353 4f41 505f 584d 4c5f #SOAP_XML_ │ │ │ +0016adb0: 5354 5249 4354 3c2f 636f 6465 3e20 6d6f STRICT mo │ │ │ +0016adc0: 6465 2066 6c61 672e 2057 6974 6820 534f de flag. With SO │ │ │ +0016add0: 4150 2052 5043 2065 6e63 6f64 696e 672c AP RPC encoding, │ │ │ +0016ade0: 2074 6865 2065 6e67 696e 6520 6967 6e6f the engine igno │ │ │ +0016adf0: 7265 7320 584d 4c20 656c 656d 656e 7473 res XML elements │ │ │ +0016ae00: 2074 6861 7420 6172 6520 756e 6b6e 6f77 that are unknow │ │ │ +0016ae10: 6e20 6279 2064 6566 6175 6c74 2c20 756e n by default, un │ │ │ +0016ae20: 6c65 7373 2074 6865 2058 4d4c 2061 7474 less the XML att │ │ │ +0016ae30: 7269 6275 7465 203c 656d 3e3c 636f 6465 ribute mustUnderstand= │ │ │ +0016ae50: 2274 7275 6522 3c2f 636f 6465 3e3c 2f65 "true" is present in │ │ │ +0016ae70: 2074 6865 2058 4d4c 2065 6c65 6d65 6e74 the XML element │ │ │ +0016ae80: 2e20 4974 206d 6179 2062 6520 756e 6465 . It may be unde │ │ │ +0016ae90: 7369 7261 626c 6520 666f 7220 656c 656d sirable for elem │ │ │ +0016aea0: 656e 7473 2074 6f20 6265 2069 676e 6f72 ents to be ignor │ │ │ +0016aeb0: 6564 2077 6865 6e20 7468 6520 6f75 7463 ed when the outc │ │ │ +0016aec0: 6f6d 6520 6f66 2074 6865 206f 6d69 7373 ome of the omiss │ │ │ +0016aed0: 696f 6e20 6973 2075 6e63 6572 7461 696e ion is uncertain │ │ │ +0016aee0: 2e20 5468 6520 3c63 6f64 653e 3c61 2063 . The soap::fignore< │ │ │ +0016afc0: 2f61 3e3c 2f63 6f64 653e 2063 616c 6c62 /a> callb │ │ │ +0016afd0: 6163 6b20 6361 6e20 6265 2073 6574 2074 ack can be set t │ │ │ +0016afe0: 6f20 6120 6675 6e63 7469 6f6e 2074 6861 o a function tha │ │ │ +0016aff0: 7420 7265 7475 726e 7320 3c63 6f64 653e t returns │ │ │ +0016b000: 2353 4f41 505f 4f4b 3c2f 636f 6465 3e20 #SOAP_OK │ │ │ +0016b010: 696e 2063 6173 6520 7468 6520 656c 656d in case the elem │ │ │ +0016b020: 656e 7420 6361 6e20 6265 2073 6166 656c ent can be safel │ │ │ +0016b030: 7920 6967 6e6f 7265 642c 206f 7220 3c63 y ignored, or #SOAP_MUSTUN │ │ │ +0016b050: 4445 5253 5441 4e44 3c2f 636f 6465 3e20 DERSTAND │ │ │ +0016b060: 746f 2074 6872 6f77 2061 6e20 6578 6365 to throw an exce │ │ │ +0016b070: 7074 696f 6e2c 206f 7220 746f 2070 6572 ption, or to per │ │ │ +0016b080: 666f 726d 2073 6f6d 6520 6170 706c 6963 form some applic │ │ │ +0016b090: 6174 696f 6e2d 7370 6563 6966 6963 2061 ation-specific a │ │ │ +0016b0a0: 6374 696f 6e2e 2046 6f72 2065 7861 6d70 ction. For examp │ │ │ +0016b0b0: 6c65 2c20 746f 2074 6872 6f77 2061 6e20 le, to throw an │ │ │ +0016b0c0: 6578 6365 7074 696f 6e20 6173 2073 6f6f exception as soo │ │ │ +0016b0d0: 6e20 6173 2061 6e20 756e 6b6e 6f77 6e20 n as an unknown │ │ │ +0016b0e0: 656c 656d 656e 7420 6973 2065 6e63 6f75 element is encou │ │ │ +0016b0f0: 6e74 6572 6564 206f 6e20 7468 6520 696e ntered on the in │ │ │ +0016b100: 7075 742c 2075 7365 3a3c 2f70 3e0a 3c64 put, use:

    .
    │ │ │ +0016b150: 696e 743c 2f73 7061 6e3e 206d 6169 6e28 int main( │ │ │ +0016b160: 293c 2f64 6976 3e0a 3c64 6976 2063 6c61 )
    .
    {
    .
    stru │ │ │ +0016b1b0: 6374 203c 2f73 7061 6e3e 3c61 2063 6c61 ct soap *soap = soap_new() │ │ │ +0016b280: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
    .
    soap-> │ │ │ +0016b2d0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 fignore = myignore; < │ │ │ +0016b340: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    ... // soap_call │ │ │ +0016b380: 5f6e 735f 5f77 6562 6d65 7468 6f64 2873 _ns__webmethod(s │ │ │ +0016b390: 6f61 702c 202e 2e2e 2920 6f72 2073 6f61 oap, ...) or soa │ │ │ +0016b3a0: 705f 7365 7276 6528 736f 6170 2920 3c2f p_serve(soap)
    .
    }< │ │ │ +0016b3d0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    . │ │ │ +0016b3f0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    .
    {< │ │ │ +0016b520: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    return SOAP_MUSTU │ │ │ +0016b5c0: 4e44 4552 5354 414e 443c 2f61 3e3b 203c NDERSTAND; < │ │ │ +0016b5d0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ +0016b5e0: 656e 7422 3e2f 2f20 6e65 7665 7220 736b ent">// never sk │ │ │ +0016b5f0: 6970 2065 6c65 6d65 6e74 7320 2873 6563 ip elements (sec │ │ │ +0016b600: 7572 6529 203c 2f73 7061 6e3e 3c2f 6469 ure) .
    }
    .
    in │ │ │ +0016b710: 7428 2a20 6669 676e 6f72 6529 2873 7472 t(* fignore)(str │ │ │ +0016b720: 7563 7420 736f 6170 202a 736f 6170 2c20 uct soap *soap, │ │ │ +0016b730: 636f 6e73 7420 6368 6172 202a 7461 6729 const char *tag) │ │ │ +0016b740: 3c2f 6469 763e 3c64 6976 2063 6c61 7373
    Callbac │ │ │ +0016b760: 6b20 746f 2063 6174 6368 2075 6e72 6563 k to catch unrec │ │ │ +0016b770: 6f67 6e69 7a65 6420 584d 4c20 656c 656d ognized XML elem │ │ │ +0016b780: 656e 7473 2061 6e64 206f 7665 7272 6964 ents and overrid │ │ │ +0016b790: 6573 2023 534f 4150 5f58 4d4c 5f53 5452 es #SOAP_XML_STR │ │ │ +0016b7a0: 4943 5420 7661 6c69 6461 7469 6f6e 2065 ICT validation e │ │ │ +0016b7b0: 7272 6f72 7320 666f 7220 7468 6573 2e2e rrors for thes.. │ │ │ +0016b7c0: 2e3c 2f64 6976 3e3c 6469 7620 636c 6173 .
    Def │ │ │ +0016b7e0: 696e 6974 696f 6e3a 3c2f 623e 2073 7464 inition: std │ │ │ +0016b7f0: 736f 6170 322e 683a 3434 3433 3c2f 6469 soap2.h:4443
    .
    SOAP_MUS │ │ │ +0016b8c0: 5455 4e44 4552 5354 414e 443c 2f61 3e3c TUNDERSTAND< │ │ │ +0016b8d0: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
    #define │ │ │ +0016b8f0: 2053 4f41 505f 4d55 5354 554e 4445 5253 SOAP_MUSTUNDERS │ │ │ +0016b900: 5441 4e44 3c2f 6469 763e 3c64 6976 2063 TAND
    A s │ │ │ +0016b920: 6f61 705f 7374 6174 7573 2065 7272 6f72 oap_status error │ │ │ +0016b930: 2063 6f64 653a 2061 6e20 584d 4c20 656c code: an XML el │ │ │ +0016b940: 656d 656e 7420 6973 2070 7265 7365 6e74 ement is present │ │ │ +0016b950: 2077 6974 6820 6120 6d75 7374 556e 6465 with a mustUnde │ │ │ +0016b960: 7273 7461 6e64 2061 7474 7269 6275 7465 rstand attribute │ │ │ +0016b970: 2077 6869 6368 206d 7573 7420 6265 2075 which must be u │ │ │ +0016b980: 6e64 2e2e 2e3c 2f64 6976 3e3c 6469 7620 nd...
    Definition: │ │ │ +0016b9b0: 2073 7464 736f 6170 322e 683a 3234 3930 stdsoap2.h:2490 │ │ │ +0016b9c0: 3c2f 6469 763e 3c2f 6469 763e 0a3c 2f64
    .

    To select │ │ │ +0016b9f0: 6976 656c 7920 7468 726f 7720 616e 2065 ively throw an e │ │ │ +0016ba00: 7863 6570 7469 6f6e 2077 6865 6e20 3c65 xception when mustUnde │ │ │ +0016ba20: 7273 7461 6e64 3d22 7472 7565 223c 2f63 rstand="true" SOAP H │ │ │ +0016ba40: 6561 6465 7220 656c 656d 656e 7420 6973 eader element is │ │ │ +0016ba50: 2065 6e63 6f75 6e74 6572 6564 206f 7220 encountered or │ │ │ +0016ba60: 7768 656e 2061 6e20 756e 6b6e 6f77 6e20 when an unknown │ │ │ +0016ba70: 656c 656d 656e 7420 6973 2065 6e63 6f75 element is encou │ │ │ +0016ba80: 6e74 6572 6564 2065 7863 6570 7420 666f ntered except fo │ │ │ +0016ba90: 7220 656c 656d 656e 7420 3c65 6d3e 3c63 r element ns:xyz, use:

    │ │ │ +0016bac0: 0a3c 6469 7620 636c 6173 733d 2266 7261 .
    int ma │ │ │ +0016bb10: 696e 2829 3c2f 6469 763e 0a3c 6469 7620 in()
    .
    {.
    s │ │ │ +0016bb60: 7472 7563 7420 3c2f 7370 616e 3e3c 6120 truct soap *soap = │ │ │ +0016bbd0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap_new();
    .
    < │ │ │ +0016bc50: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +0016bc60: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ +0016bc70: 6874 6d6c 223e 736f 6170 3c2f 613e 2d26 html">soap-& │ │ │ +0016bc80: 6774 3b3c 6120 636c 6173 733d 2263 6f64 gt;fignor │ │ │ +0016bce0: 653c 2f61 3e20 3d20 6967 6e6f 7265 3b20 e = ignore; │ │ │ +0016bcf0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    ... < │ │ │ +0016bd10: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ +0016bd20: 656e 7422 3e2f 2f20 736f 6170 5f63 616c ent">// soap_cal │ │ │ +0016bd30: 6c5f 6e73 5f5f 7765 626d 6574 686f 6428 l_ns__webmethod( │ │ │ +0016bd40: 736f 6170 2c20 2e2e 2e29 206f 7220 736f soap, ...) or so │ │ │ +0016bd50: 6170 5f73 6572 7665 2873 6f61 7029 203c ap_serve(soap) < │ │ │ +0016bd60: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    .} │ │ │ +0016bd80: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    │ │ │ +0016bda0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    int │ │ │ +0016bdd0: 3c2f 7370 616e 3e20 6967 6e6f 7265 283c ignore(< │ │ │ +0016bde0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +0016bdf0: 6f72 6422 3e73 7472 7563 743c 2f73 7061 ord">struct soap *soap< │ │ │ +0016be60: 2f61 3e2c 203c 7370 616e 2063 6c61 7373 /a>, const │ │ │ +0016be80: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c char *t │ │ │ +0016beb0: 6167 2920 3c2f 6469 763e 0a3c 6469 7620 ag)
    ..< │ │ │ +0016c010: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +0016c020: 3e20 207b 3c2f 6469 763e 0a3c 6469 7620 > {
    .
    │ │ │ +0016c040: 203c 7370 616e 2063 6c61 7373 3d22 636f // tags & │ │ │ +0016c060: 6c74 3b6e 733a 736f 6d65 456c 656d 656e lt;ns:someElemen │ │ │ +0016c070: 7426 6774 3b20 6361 6e20 6265 2073 6166 t> can be saf │ │ │ +0016c080: 656c 7920 6967 6e6f 7265 643c 2f73 7061 ely ignored
    .
    < │ │ │ +0016c0b0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +0016c0c0: 6f72 6466 6c6f 7722 3e69 663c 2f73 7061 ordflow">if (soap_match │ │ │ +0016c130: 5f74 6167 3c2f 613e 283c 6120 636c 6173 _tag( │ │ │ +0016c160: 736f 6170 3c2f 613e 2c20 7461 672c 203c soap, tag, < │ │ │ +0016c170: 7370 616e 2063 6c61 7373 3d22 7374 7269 span class="stri │ │ │ +0016c180: 6e67 6c69 7465 7261 6c22 3e26 7175 6f74 ngliteral">" │ │ │ +0016c190: 3b6e 733a 736f 6d65 456c 656d 656e 7426 ;ns:someElement& │ │ │ +0016c1a0: 7175 6f74 3b3c 2f73 7061 6e3e 2920 3d3d quot;) == │ │ │ +0016c1b0: 203c 6120 636c 6173 733d 2263 6f64 6522 SOAP_OK │ │ │ +0016c210: 293c 2f64 6976 3e0a 3c64 6976 2063 6c61 )
    .
    │ │ │ +0016c230: 3c73 7061 6e20 636c 6173 733d 226b 6579 return │ │ │ +0016c250: 3c2f 7370 616e 3e20 3c61 2063 6c61 7373 SOAP │ │ │ +0016c2b0: 5f4f 4b3c 2f61 3e3b 3c2f 6469 763e 0a3c _OK;
    .< │ │ │ +0016c2c0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +0016c2d0: 3e20 207d 3c2f 6469 763e 0a3c 6469 7620 > }
    .
    < │ │ │ +0016c2f0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +0016c300: 6f72 6466 6c6f 7722 3e72 6574 7572 6e3c ordflow">return< │ │ │ +0016c310: 2f73 7061 6e3e 203c 6120 636c 6173 733d /span> SOAP_ │ │ │ +0016c370: 4d55 5354 554e 4445 5253 5441 4e44 3c2f MUSTUNDERSTAND;
    . │ │ │ +0016c4a0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    {
    .
    { │ │ │ +0016c4d0: 203c 7370 616e 2063 6c61 7373 3d22 7374 &qu │ │ │ +0016c4f0: 6f74 3b53 4f41 502d 454e 5626 7175 6f74 ot;SOAP-ENV" │ │ │ +0016c500: 3b3c 2f73 7061 6e3e 2c20 3c73 7061 6e20 ;, "http │ │ │ +0016c530: 3a2f 2f73 6368 656d 6173 2e78 6d6c 736f ://schemas.xmlso │ │ │ +0016c540: 6170 2e6f 7267 2f73 6f61 702f 656e 7665 ap.org/soap/enve │ │ │ +0016c550: 6c6f 7065 2f26 7175 6f74 3b3c 2f73 7061 lope/" },
    . │ │ │ +0016c580: 207b 203c 7370 616e 2063 6c61 7373 3d22 { & │ │ │ +0016c5a0: 7175 6f74 3b53 4f41 502d 454e 4326 7175 quot;SOAP-ENC&qu │ │ │ +0016c5b0: 6f74 3b3c 2f73 7061 6e3e 2c20 3c73 7061 ot;, "ht │ │ │ +0016c5e0: 7470 3a2f 2f73 6368 656d 6173 2e78 6d6c tp://schemas.xml │ │ │ +0016c5f0: 736f 6170 2e6f 7267 2f73 6f61 702f 656e soap.org/soap/en │ │ │ +0016c600: 636f 6469 6e67 2f26 7175 6f74 3b3c 2f73 coding/"
    },
    .< │ │ │ +0016c620: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +0016c630: 3e20 207b 203c 7370 616e 2063 6c61 7373 > { "xsi" │ │ │ +0016c660: 3c2f 7370 616e 3e2c 2020 2020 2020 3c73 , " │ │ │ +0016c690: 6874 7470 3a2f 2f77 7777 2e77 332e 6f72 http://www.w3.or │ │ │ +0016c6a0: 672f 3230 3031 2f58 4d4c 5363 6865 6d61 g/2001/XMLSchema │ │ │ +0016c6b0: 2d69 6e73 7461 6e63 6526 7175 6f74 3b3c -instance"< │ │ │ +0016c6c0: 2f73 7061 6e3e 207d 2c20 3c2f 6469 763e /span> },
    │ │ │ +0016c6d0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    { "xsd&quo │ │ │ +0016c710: 743b 3c2f 7370 616e 3e2c 2020 2020 2020 t;, │ │ │ +0016c720: 3c73 7061 6e20 636c 6173 733d 2273 7472 &quo │ │ │ +0016c740: 743b 6874 7470 3a2f 2f77 7777 2e77 332e t;http://www.w3. │ │ │ +0016c750: 6f72 672f 3230 3031 2f58 4d4c 5363 6865 org/2001/XMLSche │ │ │ +0016c760: 6d61 2671 756f 743b 3c2f 7370 616e 3e20 ma" │ │ │ +0016c770: 7d2c 203c 2f64 6976 3e0a 3c64 6976 2063 },
    .
    { │ │ │ +0016c790: 3c73 7061 6e20 636c 6173 733d 2273 7472 &quo │ │ │ +0016c7b0: 743b 6e73 2671 756f 743b 3c2f 7370 616e t;ns", "some- │ │ │ +0016c7f0: 5552 4926 7175 6f74 3b3c 2f73 7061 6e3e URI" │ │ │ +0016c800: 7d2c 203c 7370 616e 2063 6c61 7373 3d22 }, // bind │ │ │ +0016c820: 7320 2671 756f 743b 6e73 2671 756f 743b s "ns" │ │ │ +0016c830: 206e 616d 6573 7061 6365 2070 7265 6669 namespace prefi │ │ │ +0016c840: 7820 746f 2073 6368 656d 6120 5552 493c x to schema URI< │ │ │ +0016c850: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    . │ │ │ +0016c870: 207b 204e 554c 4c2c 204e 554c 4c7d 203c { NULL, NULL} < │ │ │ +0016c880: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    ];
    │ │ │ +0016c8a0: 0a3c 6469 7620 636c 6173 733d 2274 7463 .< │ │ │ +0016ca50: 212d 2d20 6672 6167 6d65 6e74 202d 2d3e !-- fragment --> │ │ │ +0016ca60: 3c70 3e46 756e 6374 696f 6e20 3c63 6f64

    Function soap_match_tag< │ │ │ +0016caf0: 2f61 3e3c 2f63 6f64 653e 2063 6f6d 7061 /a> compa │ │ │ +0016cb00: 7265 7320 7477 6f20 7461 6773 2e20 5468 res two tags. Th │ │ │ +0016cb10: 6520 7468 6972 6420 7061 7261 6d65 7465 e third paramete │ │ │ +0016cb20: 7220 6d61 7920 6265 2061 2070 6174 7465 r may be a patte │ │ │ +0016cb30: 726e 2077 6865 7265 203c 636f 6465 3e2a rn where * │ │ │ +0016cb40: 3c2f 636f 6465 3e20 6973 2061 2077 696c is a wil │ │ │ +0016cb50: 6463 6172 6420 616e 6420 3c63 6f64 653e dcard and │ │ │ +0016cb60: 2d3c 2f63 6f64 653e 2069 7320 6120 7369 - is a si │ │ │ +0016cb70: 6e67 6c65 2063 6861 7261 6374 6572 2077 ngle character w │ │ │ +0016cb80: 696c 6463 6172 642e 2053 6f20 666f 7220 ildcard. So for │ │ │ +0016cb90: 6578 616d 706c 6520 3c63 6f64 653e 736f example so │ │ │ +0016cba0: 6170 5f6d 6174 6368 5f74 6167 2873 6f61 ap_match_tag(soa │ │ │ +0016cbb0: 702c 2074 6167 2c20 226e 733a 2a22 293c p, tag, "ns:*")< │ │ │ +0016cbc0: 2f63 6f64 653e 2077 696c 6c20 6d61 7463 /code> will matc │ │ │ +0016cbd0: 6820 616e 7920 656c 656d 656e 7420 696e h any element in │ │ │ +0016cbe0: 206e 616d 6573 7061 6365 203c 636f 6465 namespace ns or wh │ │ │ +0016cc00: 656e 206e 6f20 6e61 6d65 7370 6163 6520 en no namespace │ │ │ +0016cc10: 7072 6566 6978 2069 7320 7072 6573 656e prefix is presen │ │ │ +0016cc20: 7420 696e 2074 6865 2058 4d4c 206d 6573 t in the XML mes │ │ │ +0016cc30: 7361 6765 2e3c 2f70 3e0a 3c70 3e54 6865 sage.

    .

    The │ │ │ +0016cc40: 2063 616c 6c62 6163 6b20 6361 6e20 616c callback can al │ │ │ +0016cc50: 736f 2062 6520 7573 6564 2074 6f20 6b65 so be used to ke │ │ │ +0016cc60: 6570 2074 7261 636b 206f 6620 756e 6b6e ep track of unkn │ │ │ +0016cc70: 6f77 6e20 656c 656d 656e 7473 2069 6e20 own elements in │ │ │ +0016cc80: 616e 2069 6e74 6572 6e61 6c20 6461 7461 an internal data │ │ │ +0016cc90: 2073 7472 7563 7475 7265 2073 7563 6820 structure such │ │ │ +0016cca0: 6173 2061 206c 6973 743a 3c2f 703e 0a3c as a list:

    .< │ │ │ +0016ccb0: 6469 7620 636c 6173 733d 2266 7261 676d div class="fragm │ │ │ +0016ccc0: 656e 7422 3e3c 6469 7620 636c 6173 733d ent">
    str │ │ │ +0016ccf0: 7563 7420 3c2f 7370 616e 3e55 6e6b 6e6f uct Unkno │ │ │ +0016cd00: 776e 203c 2f64 6976 3e0a 3c64 6976 2063 wn
    .
    {.
    char *t │ │ │ +0016cd60: 6167 3b20 3c2f 6469 763e 0a3c 6469 7620 ag;
    .
    < │ │ │ +0016cd80: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +0016cd90: 6f72 6422 3e73 7472 7563 7420 3c2f 7370 ord">struct Unknown *next │ │ │ +0016cdb0: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
    .
    }; . │ │ │ +0016cef0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    {
    .
    < │ │ │ +0016cf20: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +0016cf30: 6f72 6474 7970 6522 3e63 6861 723c 2f73 ordtype">char *s = (char │ │ │ +0016cf70: 2a29 3c61 2063 6c61 7373 3d22 636f 6465 *)soap_mall │ │ │ +0016cfd0: 6f63 3c2f 613e 283c 6120 636c 6173 733d oc(so │ │ │ +0016d000: 6170 3c2f 613e 2c20 7374 726c 656e 2874 ap, strlen(t │ │ │ +0016d010: 6167 292b 3129 3b20 3c2f 6469 763e 0a3c ag)+1);
    .< │ │ │ +0016d020: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +0016d030: 3e20 203c 7370 616e 2063 6c61 7373 3d22 > struct │ │ │ +0016d050: 3c2f 7370 616e 3e55 6e6b 6e6f 776e 202a Unknown * │ │ │ +0016d060: 7520 3d20 283c 7370 616e 2063 6c61 7373 u = (struc │ │ │ +0016d080: 7420 3c2f 7370 616e 3e55 6e6b 6e6f 776e t Unknown │ │ │ +0016d090: 2a29 3c61 2063 6c61 7373 3d22 636f 6465 *)soap_mall │ │ │ +0016d0f0: 6f63 3c2f 613e 283c 6120 636c 6173 733d oc(so │ │ │ +0016d120: 6170 3c2f 613e 2c20 3c73 7061 6e20 636c ap, si │ │ │ +0016d140: 7a65 6f66 3c2f 7370 616e 3e28 3c73 7061 zeof(struct │ │ │ +0016d170: 556e 6b6e 6f77 6e29 293b 203c 2f64 6976 Unknown));
    .
    │ │ │ +0016d1b0: 6966 3c2f 7370 616e 3e20 2873 2026 616d if (s &am │ │ │ +0016d1c0: 703b 2661 6d70 3b20 7529 203c 2f64 6976 p;& u)
    .
    {
    . │ │ │ +0016d200: 2020 2020 7374 7263 7079 2873 2c20 7461 strcpy(s, ta │ │ │ +0016d210: 6729 3b20 3c2f 6469 763e 0a3c 6469 7620 g);
    .
    │ │ │ +0016d230: 2075 2d26 6774 3b74 6167 203d 2073 3b20 u->tag = s; │ │ │ +0016d240: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    u-& │ │ │ +0016d260: 6774 3b6e 6578 7420 3d20 756c 6973 743b gt;next = ulist; │ │ │ +0016d270: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    ul │ │ │ +0016d290: 6973 7420 3d20 753b 203c 2f64 6976 3e0a ist = u;
    . │ │ │ +0016d2a0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    }
    .} │ │ │ +0016d2d0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    .
    in │ │ │ +0016d320: 743c 2f73 7061 6e3e 206d 6169 6e28 293c t main()< │ │ │ +0016d330: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    {
    . │ │ │ +0016d350: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    struct │ │ │ +0016d380: 203c 2f73 7061 6e3e 3c61 2063 6c61 7373 s │ │ │ +0016d3b0: 6f61 703c 2f61 3e20 2a3c 6120 636c 6173 oap *soap; .
    str │ │ │ +0016d440: 7563 7420 3c2f 7370 616e 3e55 6e6b 6e6f uct Unkno │ │ │ +0016d450: 776e 202a 756c 6973 7420 3d20 4e55 4c4c wn *ulist = NULL │ │ │ +0016d460: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
    .
    soap_init( │ │ │ +0016d4e0: 2661 6d70 3b3c 6120 636c 6173 733d 2263 &soap │ │ │ +0016d510: 3c2f 613e 293b 203c 2f64 6976 3e0a 3c64 );
    . │ │ │ +0016d530: 2020 3c61 2063 6c61 7373 3d22 636f 6465 soap.fignore │ │ │ +0016d5c0: 3c2f 613e 203d 206d 7969 676e 6f72 653b = myignore; │ │ │ +0016d5d0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    ... │ │ │ +0016d5f0: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // soap_ca │ │ │ +0016d610: 6c6c 5f6e 735f 5f77 6562 6d65 7468 6f64 ll_ns__webmethod │ │ │ +0016d620: 2873 6f61 702c 202e 2e2e 2920 6f72 2073 (soap, ...) or s │ │ │ +0016d630: 6f61 705f 7365 7276 6528 736f 6170 2920 oap_serve(soap) │ │ │ +0016d640: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ +0016d660: 2020 2e2e 2e20 3c73 7061 6e20 636c 6173 ... // p │ │ │ +0016d680: 7269 6e74 2074 6865 206c 6973 7420 6f66 rint the list of │ │ │ +0016d690: 2075 6e6b 6e6f 776e 2065 6c65 6d65 6e74 unknown element │ │ │ +0016d6a0: 7320 7374 6f72 6564 2069 6e20 756c 6973 s stored in ulis │ │ │ +0016d6b0: 743c 2f73 7061 6e3e 3c2f 6469 763e 0a3c t
    .< │ │ │ +0016d6c0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +0016d6d0: 3e20 203c 6120 636c 6173 733d 2263 6f64 > soap_des │ │ │ +0016d730: 7472 6f79 3c2f 613e 2826 616d 703b 3c61 troy(&soap);< │ │ │ +0016d770: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    s │ │ │ +0016d7e0: 6f61 705f 656e 643c 2f61 3e28 2661 6d70 oap_end(& │ │ │ +0016d7f0: 3b3c 6120 636c 6173 733d 2263 6f64 6522 ;soap │ │ │ +0016d820: 293b 3c2f 6469 763e 0a3c 6469 7620 636c );
    .
    soap_done( │ │ │ +0016d8a0: 2661 6d70 3b3c 6120 636c 6173 733d 2263 &soap │ │ │ +0016d8d0: 3c2f 613e 293b 3c2f 6469 763e 0a3c 6469 );
    .} │ │ │ +0016d8f0: 3c2f 6469 763e 0a3c 2f64 6976 3e3c 212d
    .

    .... Back to table │ │ │ +0016d930: 6f66 2063 6f6e 7465 6e74 733c 2f61 3e3c of contents< │ │ │ +0016d940: 2f70 3e0a 3c68 323e 3c61 2063 6c61 7373 /p>.

    .How │ │ │ +0016d970: 746f 2068 616e 646c 6520 4854 5450 2033 to handle HTTP 3 │ │ │ +0016d980: 3037 2074 656d 706f 7261 7279 2072 6564 07 temporary red │ │ │ +0016d990: 6972 6563 743c 2f68 323e 0a3c 703e 5468 irect

    .

    Th │ │ │ +0016d9a0: 6520 636c 6965 6e74 2d73 6964 6520 6861 e client-side ha │ │ │ +0016d9b0: 6e64 6c69 6e67 206f 6620 4854 5450 2033 ndling of HTTP 3 │ │ │ +0016d9c0: 3037 2063 6f64 6520 2254 656d 706f 7261 07 code "Tempora │ │ │ +0016d9d0: 7279 2052 6564 6972 6563 7422 2061 6e64 ry Redirect" and │ │ │ +0016d9e0: 2061 6e79 206f 6620 7468 6520 7265 6469 any of the redi │ │ │ +0016d9f0: 7265 6374 2063 6f64 6573 2033 3031 2c20 rect codes 301, │ │ │ +0016da00: 3330 322c 2061 6e64 2033 3033 2061 7265 302, and 303 are │ │ │ +0016da10: 206e 6f74 2061 7574 6f6d 6174 6564 2e20 not automated. │ │ │ +0016da20: 436c 6965 6e74 2061 7070 6c69 6361 7469 Client applicati │ │ │ +0016da30: 6f6e 2064 6576 656c 6f70 6572 7320 6d61 on developers ma │ │ │ +0016da40: 7920 7761 6e74 2074 6f20 636f 6e73 6964 y want to consid │ │ │ +0016da50: 6572 2061 6464 696e 6720 6120 6665 7720 er adding a few │ │ │ +0016da60: 6c69 6e65 7320 6f66 2063 6f64 6520 746f lines of code to │ │ │ +0016da70: 2073 7570 706f 7274 2072 6564 6972 6563 support redirec │ │ │ +0016da80: 7473 2e20 4974 2077 6173 2064 6563 6964 ts. It was decid │ │ │ +0016da90: 6564 206e 6f74 2074 6f20 6175 746f 6d61 ed not to automa │ │ │ +0016daa0: 7469 6361 6c6c 7920 7375 7070 6f72 7420 tically support │ │ │ +0016dab0: 7265 6469 7265 6374 7320 666f 7220 7468 redirects for th │ │ │ +0016dac0: 6520 666f 6c6c 6f77 696e 6720 7265 6173 e following reas │ │ │ +0016dad0: 6f6e 733a 3c2f 703e 0a3c 756c 3e0a 3c6c ons:

    .
      .Redirecting a │ │ │ +0016daf0: 7365 6375 7265 2048 5454 5053 2061 6464 secure HTTPS add │ │ │ +0016db00: 7265 7373 2074 6f20 6120 6e6f 6e2d 7365 ress to a non-se │ │ │ +0016db10: 6375 7265 2048 5454 5020 6164 6472 6573 cure HTTP addres │ │ │ +0016db20: 7320 7669 6120 3330 3720 6372 6561 7465 s via 307 create │ │ │ +0016db30: 7320 6120 7365 6375 7269 7479 2076 756c s a security vul │ │ │ +0016db40: 6e65 7261 6269 6c69 7479 2e3c 2f6c 693e nerability. │ │ │ +0016db50: 0a3c 6c69 3e43 7963 6c69 6320 7265 6469 .
    • Cyclic redi │ │ │ +0016db60: 7265 6374 7320 6d75 7374 2062 6520 6465 rects must be de │ │ │ +0016db70: 7465 6374 6564 2028 652e 672e 2061 6c6c tected (e.g. all │ │ │ +0016db80: 6f77 696e 6720 6f6e 6c79 2061 206c 696d owing only a lim │ │ │ +0016db90: 6974 6564 206e 756d 6265 7220 6f66 2072 ited number of r │ │ │ +0016dba0: 6564 6972 6563 7420 6c65 7665 6c73 292e edirect levels). │ │ │ +0016dbb0: 3c2f 6c69 3e0a 3c6c 693e 5265 6469 7265
    • .
    • Redire │ │ │ +0016dbc0: 6374 696e 6720 4854 5450 2050 4f53 5420 cting HTTP POST │ │ │ +0016dbd0: 7769 6c6c 2072 6573 756c 7420 696e 2072 will result in r │ │ │ +0016dbe0: 652d 7365 7269 616c 697a 6174 696f 6e20 e-serialization │ │ │ +0016dbf0: 616e 6420 7265 2d70 6f73 7420 6f66 2074 and re-post of t │ │ │ +0016dc00: 6865 2065 6e74 6972 6520 534f 4150 2072 he entire SOAP r │ │ │ +0016dc10: 6571 7565 7374 2e20 5468 6520 534f 4150 equest. The SOAP │ │ │ +0016dc20: 2072 6571 7565 7374 206d 6573 7361 6765 request message │ │ │ +0016dc30: 206d 7573 7420 6265 2072 652d 706f 7374 must be re-post │ │ │ +0016dc40: 6564 2069 6e20 6974 7320 656e 7469 7265 ed in its entire │ │ │ +0016dc50: 7479 2077 6865 6e20 7265 2d69 7373 7569 ty when re-issui │ │ │ +0016dc60: 6e67 2074 6865 2053 4f41 5020 6f70 6572 ng the SOAP oper │ │ │ +0016dc70: 6174 696f 6e20 746f 2061 206e 6577 2061 ation to a new a │ │ │ +0016dc80: 6464 7265 7373 2e3c 2f6c 693e 0a3c 2f75 ddress.
    • ..

      To impleme │ │ │ +0016dca0: 6e74 2063 6c69 656e 742d 7369 6465 2033 nt client-side 3 │ │ │ +0016dcb0: 3037 2072 6564 6972 6563 742c 2061 6464 07 redirect, add │ │ │ +0016dcc0: 2074 6865 2066 6f6c 6c6f 7769 6e67 206c the following l │ │ │ +0016dcd0: 696e 6573 206f 6620 636f 6465 3a3c 2f70 ines of code:

      .
      │ │ │ +0016dd20: 636f 6e73 743c 2f73 7061 6e3e 203c 7370 const char *endpoint = N │ │ │ +0016dd60: 554c 4c3b 203c 7370 616e 2063 6c61 7373 ULL; // us │ │ │ +0016dd80: 6520 6465 6661 756c 7420 656e 6470 6f69 e default endpoi │ │ │ +0016dd90: 6e74 2067 6976 656e 2069 6e20 5753 444c nt given in WSDL │ │ │ +0016dda0: 206f 7220 7370 6563 6966 7920 6f6e 6520 or specify one │ │ │ +0016ddb0: 6865 7265 3c2f 7370 616e 3e3c 2f64 6976 here
      .
      in │ │ │ +0016ddf0: 743c 2f73 7061 6e3e 2072 6564 6972 6563 t redirec │ │ │ +0016de00: 7473 203d 2031 303b 2020 2020 2020 2020 ts = 10; │ │ │ +0016de10: 2020 3c73 7061 6e20 636c 6173 733d 2263 // max r │ │ │ +0016de30: 6564 6972 6563 7420 636f 756e 7420 3c2f edirect count
      .
      while (redirects- │ │ │ +0016de90: 2d29 203c 2f64 6976 3e0a 3c64 6976 2063 -)
      .
      {.
      if (soa │ │ │ +0016def0: 705f 6361 6c6c 5f6e 7331 5f5f 6d79 4d65 p_call_ns1__myMe │ │ │ +0016df00: 7468 6f64 283c 6120 636c 6173 733d 2263 thod(soap │ │ │ +0016df30: 3c2f 613e 2c20 656e 6470 6f69 6e74 2c20 , endpoint, │ │ │ +0016df40: 2e2e 2e29 2920 3c2f 6469 763e 0a3c 6469 ...))
      . │ │ │ +0016df60: 207b 3c2f 6469 763e 0a3c 6469 7620 636c {
      .
      < │ │ │ +0016df80: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +0016df90: 6f72 6466 6c6f 7722 3e69 663c 2f73 7061 ordflow">if ((soap │ │ │ +0016dfd0: 3c2f 613e 2d26 6774 3b3c 6120 636c 6173 ->error > │ │ │ +0016e030: 3d20 3330 3120 2661 6d70 3b26 616d 703b = 301 && │ │ │ +0016e040: 203c 6120 636c 6173 733d 2263 6f64 6522 soap │ │ │ +0016e070: 2d26 6774 3b3c 6120 636c 6173 733d 2263 ->er │ │ │ +0016e0c0: 726f 723c 2f61 3e20 266c 743b 3d20 3330 ror <= 30 │ │ │ +0016e0d0: 3329 207c 7c20 3c61 2063 6c61 7373 3d22 3) || soa │ │ │ +0016e100: 703c 2f61 3e2d 2667 743b 3c61 2063 6c61 p->error == │ │ │ +0016e160: 3330 3729 203c 2f64 6976 3e0a 3c64 6976 307)
      .
      │ │ │ +0016e180: 2020 7b3c 2f64 6976 3e0a 3c64 6976 2063 {
      .
      │ │ │ +0016e1a0: 2020 656e 6470 6f69 6e74 203d 203c 6120 endpoint = soap_strdup(soap, soap-> │ │ │ +0016e2c0: 656e 6470 6f69 6e74 3c2f 613e 293b 203c endpoint); < │ │ │ +0016e2d0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ +0016e2e0: 656e 7422 3e2f 2f20 656e 6470 6f69 6e74 ent">// endpoint │ │ │ +0016e2f0: 2066 726f 6d20 4854 5450 2033 3031 2c20 from HTTP 301, │ │ │ +0016e300: 3330 322c 2033 3033 2c20 3330 3720 4c6f 302, 303, 307 Lo │ │ │ +0016e310: 6361 7469 6f6e 2068 6561 6465 7220 3c2f cation header
      .
      │ │ │ +0016e340: 2020 7d3c 2f64 6976 3e0a 3c64 6976 2063 }
      .
      │ │ │ +0016e360: 3c73 7061 6e20 636c 6173 733d 226b 6579 else
      . │ │ │ +0016e3a0: 2020 207b 3c2f 6469 763e 0a3c 6469 7620 {
      .
      │ │ │ +0016e3c0: 2020 202e 2e2e 203c 7370 616e 2063 6c61 ... // │ │ │ +0016e3e0: 6861 6e64 6c65 2065 7272 6f72 203c 2f73 handle error
      .
      │ │ │ +0016e410: 2020 203c 7370 616e 2063 6c61 7373 3d22 bre │ │ │ +0016e430: 616b 3c2f 7370 616e 3e3b 203c 2f64 6976 ak;
      .
      }
      │ │ │ +0016e460: 0a3c 6469 7620 636c 6173 733d 226c 696e .
      }
      . │ │ │ +0016e490: 2020 3c73 7061 6e20 636c 6173 733d 226b else │ │ │ +0016e4b0: 3c2f 7370 616e 3e20 3c2f 6469 763e 0a3c
    .< │ │ │ +0016e4c0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +0016e4d0: 3e20 207b 3c2f 6469 763e 0a3c 6469 7620 > {
    .
    │ │ │ +0016e4f0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 break │ │ │ +0016e510: 3c2f 7370 616e 3e3b 203c 7370 616e 2063 ; / │ │ │ +0016e530: 2f20 616c 6c20 4f4b 206e 6f77 3c2f 7370 / all OK now
    .
    }< │ │ │ +0016e560: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    }
    . │ │ │ +0016e580: 3c2f 6469 763e 3c21 2d2d 2066 7261 676d

    .... < │ │ │ +0016e5a0: 6120 6872 6566 3d22 2322 3e42 6163 6b20 a href="#">Back │ │ │ +0016e5b0: 746f 2074 6162 6c65 206f 6620 636f 6e74 to table of cont │ │ │ +0016e5c0: 656e 7473 3c2f 613e 3c2f 703e 0a3c 6832 ents

    .

    │ │ │ +0016e5f0: 0a48 6f77 2074 6f20 696d 706c 656d 656e .How to implemen │ │ │ +0016e600: 7420 4854 5450 2047 4554 2c20 5055 542c t HTTP GET, PUT, │ │ │ +0016e610: 2061 6e64 2050 4154 4348 2073 6572 7669 and PATCH servi │ │ │ +0016e620: 6365 733c 2f68 323e 0a3c 703e 546f 2069 ces

    .

    To i │ │ │ +0016e630: 6d70 6c65 6d65 6e74 2048 5454 5020 4745 mplement HTTP GE │ │ │ +0016e640: 5420 7265 7175 6573 7420 7265 7370 6f6e T request respon │ │ │ +0016e650: 7365 732c 2064 6566 696e 6520 7468 6520 ses, define the │ │ │ +0016e660: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 soap::fg │ │ │ +0016e730: 6574 3c2f 613e 3c2f 636f 6465 3e20 6361 et ca │ │ │ +0016e740: 6c6c 6261 636b 2066 756e 6374 696f 6e2e llback function. │ │ │ +0016e750: 2054 6865 2063 616c 6c62 6163 6b20 6973 The callback is │ │ │ +0016e760: 2072 6571 7569 7265 6420 746f 2070 726f required to pro │ │ │ +0016e770: 6475 6365 2061 2072 6573 706f 6e73 6520 duce a response │ │ │ +0016e780: 746f 2074 6865 2072 6571 7565 7374 2069 to the request i │ │ │ +0016e790: 6e20 7465 7874 7561 6c20 666f 726d 2c20 n textual form, │ │ │ +0016e7a0: 7375 6368 2061 7320 6120 5765 6220 7061 such as a Web pa │ │ │ +0016e7b0: 6765 206f 7220 616e 2058 4d4c 206f 7220 ge or an XML or │ │ │ +0016e7c0: 4a53 4f4e 2072 6573 706f 6e73 652e 3c2f JSON response..

    You can al │ │ │ +0016e7e0: 736f 2075 7365 2074 6865 203c 636f 6465 so use the http_get plugin whi │ │ │ +0016e890: 6368 2065 7373 656e 7469 616c 6c79 2073 ch essentially s │ │ │ +0016e8a0: 6574 7320 7468 6520 3c63 6f64 653e 3c61 ets the │ │ │ +0016e970: 736f 6170 3a3a 6667 6574 3c2f 613e 3c2f soap::fget callback a │ │ │ +0016e990: 6e64 2061 6c73 6f20 6b65 6570 7320 7472 nd also keeps tr │ │ │ +0016e9a0: 6163 6b20 6f66 2074 6865 206e 756d 6265 ack of the numbe │ │ │ +0016e9b0: 7220 6f66 2048 5454 5020 4745 5420 616e r of HTTP GET an │ │ │ +0016e9c0: 6420 504f 5354 2072 6571 7565 7374 7320 d POST requests │ │ │ +0016e9d0: 6d61 6465 2061 7420 7468 6520 7365 7276 made at the serv │ │ │ +0016e9e0: 6572 2073 6964 652e 3c2f 703e 0a3c 703e er side.

    .

    │ │ │ +0016e9f0: 5468 6520 666f 6c6c 6f77 696e 6720 6578 The following ex │ │ │ +0016ea00: 616d 706c 6520 7072 6f64 7563 6573 2061 ample produces a │ │ │ +0016ea10: 2057 6562 2070 6167 6520 7570 6f6e 2061 Web page upon a │ │ │ +0016ea20: 2048 5454 5020 4745 5420 7265 7175 6573 HTTP GET reques │ │ │ +0016ea30: 7420 2865 2e67 2e20 6672 6f6d 2061 2062 t (e.g. from a b │ │ │ +0016ea40: 726f 7773 6572 293a 3c2f 703e 0a3c 6469 rowser):

    .
    i │ │ │ +0016ea90: 6e74 3c2f 7370 616e 3e20 6d61 696e 2829 nt main() │ │ │ +0016eaa0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    {
    │ │ │ +0016eac0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    struc │ │ │ +0016eaf0: 7420 3c2f 7370 616e 3e3c 6120 636c 6173 t │ │ │ +0016eb20: 736f 6170 3c2f 613e 202a 3c61 2063 6c61 soap *soap = soap_new(); │ │ │ +0016ebc0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    soap-> │ │ │ +0016ec10: 3c61 2063 6c61 7373 3d22 636f 6465 2220 fget │ │ │ +0016ec70: 3d20 3c61 2063 6c61 7373 3d22 636f 6465 = http_get; │ │ │ +0016ecd0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    ... < │ │ │ +0016ecf0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ +0016ed00: 656e 7422 3e2f 2f3c 2f73 7061 6e3e 3c2f ent">//. │ │ │ +0016edc0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    ... / │ │ │ +0016edf0: 2f3c 2f73 7061 6e3e 3c2f 6469 763e 0a3c /
    .< │ │ │ +0016ee00: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +0016ee10: 3e7d 3c2f 6469 763e 0a3c 6469 7620 636c >}
    .
    .
    i │ │ │ +0016ee60: 6e74 3c2f 7370 616e 3e20 3c61 2063 6c61 nt http_g │ │ │ +0016eec0: 6574 3c2f 613e 283c 7370 616e 2063 6c61 et(str │ │ │ +0016eee0: 7563 743c 2f73 7061 6e3e 203c 6120 636c uct soap *soap) .
    {
    . │ │ │ +0016ef80: 2020 3c73 7061 6e20 636c 6173 733d 226b if (soap_resp │ │ │ +0016f000: 6f6e 7365 3c2f 613e 283c 6120 636c 6173 onse( │ │ │ +0016f030: 736f 6170 3c2f 613e 2c20 3c61 2063 6c61 soap, SOAP_H │ │ │ +0016f090: 544d 4c3c 2f61 3e29 203c 7370 616e 2063 TML) / │ │ │ +0016f0b0: 2f20 4854 5450 2072 6573 706f 6e73 6520 / HTTP response │ │ │ +0016f0c0: 6865 6164 6572 2077 6974 6820 7465 7874 header with text │ │ │ +0016f0d0: 2f68 746d 6c20 3c2f 7370 616e 3e3c 2f64 /html .
    || soap │ │ │ +0016f150: 5f73 656e 643c 2f61 3e28 3c61 2063 6c61 _send(soap, "< │ │ │ +0016f1b0: 3b48 544d 4c26 6774 3b4d 7920 5765 6220 ;HTML>My Web │ │ │ +0016f1c0: 7365 7276 6572 2069 7320 6f70 6572 6174 server is operat │ │ │ +0016f1d0: 696f 6e61 6c2e 266c 743b 2f48 544d 4c26 ional.</HTML& │ │ │ +0016f1e0: 6774 3b26 7175 6f74 3b3c 2f73 7061 6e3e gt;" │ │ │ +0016f1f0: 293c 2f64 6976 3e0a 3c64 6976 2063 6c61 )
    .
    || │ │ │ +0016f210: 3c61 2063 6c61 7373 3d22 636f 6465 2220 │ │ │ +0016f260: 736f 6170 5f65 6e64 5f73 656e 643c 2f61 soap_end_send(soap))
    .
    │ │ │ +0016f2c0: 3c73 7061 6e20 636c 6173 733d 226b 6579 return │ │ │ +0016f2e0: 3c2f 7370 616e 3e20 3c61 2063 6c61 7373 soap_clo │ │ │ +0016f340: 7365 736f 636b 3c2f 613e 283c 6120 636c sesock(soap);.
    return < │ │ │ +0016f3c0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +0016f3d0: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ +0016f3e0: 705f 5f69 6f2e 6874 6d6c 2367 6130 3664 p__io.html#ga06d │ │ │ +0016f3f0: 3539 3039 3461 6661 3364 6636 6231 6239 59094afa3df6b1b9 │ │ │ +0016f400: 6636 6232 6262 3438 3432 3037 6322 3e73 f6b2bb484207c">s │ │ │ +0016f410: 6f61 705f 636c 6f73 6573 6f63 6b3c 2f61 oap_closesock(soap);
    .
    }.
    < │ │ │ +0016f4e0: 6120 6872 6566 3d22 6772 6f75 705f 5f67 a href="group__g │ │ │ +0016f4f0: 726f 7570 5f5f 6361 6c6c 6261 636b 732e roup__callbacks. │ │ │ +0016f500: 6874 6d6c 2367 6165 3032 3232 3034 6666 html#gae022204ff │ │ │ +0016f510: 3730 3034 6466 3264 3561 6339 6530 3833 7004df2d5ac9e083 │ │ │ +0016f520: 6362 6235 6231 3622 3e73 6f61 703a 3a66 cbb5b16">soap::f │ │ │ +0016f530: 6765 743c 2f61 3e3c 2f64 6976 3e3c 6469 get
    int(* fget)(str │ │ │ +0016f560: 7563 7420 736f 6170 202a 736f 6170 293c uct soap *soap)< │ │ │ +0016f570: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
    Callback │ │ │ +0016f590: 2074 6f20 696d 706c 656d 656e 7420 6c6f to implement lo │ │ │ +0016f5a0: 6769 6320 6174 2074 6865 2073 6572 7665 gic at the serve │ │ │ +0016f5b0: 722d 7369 6465 2074 6f20 7365 7276 6520 r-side to serve │ │ │ +0016f5c0: 7265 7370 6f6e 7365 7320 746f 2048 5454 responses to HTT │ │ │ +0016f5d0: 5020 4745 5420 7265 7175 6573 7473 2066 P GET requests f │ │ │ +0016f5e0: 726f 6d20 636c 6965 6e74 732e 3c2f 6469 rom clients.
    Definiti │ │ │ +0016f610: 6f6e 3a3c 2f62 3e20 7374 6473 6f61 7032 on: stdsoap2 │ │ │ +0016f620: 2e68 3a34 3333 303c 2f64 6976 3e3c 2f64 .h:4330
    .
    soap_ │ │ │ +0016f6e0: 7265 7370 6f6e 7365 3c2f 613e 3c2f 6469 response
    int soap_r │ │ │ +0016f710: 6573 706f 6e73 6528 7374 7275 6374 2073 esponse(struct s │ │ │ +0016f720: 6f61 7020 2a73 6f61 702c 2069 6e74 2073 oap *soap, int s │ │ │ +0016f730: 7461 7475 7329 3c2f 6469 763e 3c64 6976 tatus)
    I │ │ │ +0016f750: 6e69 7469 616c 697a 6520 7468 6520 636f nitialize the co │ │ │ +0016f760: 6e74 6578 7420 666f 7220 7365 7276 6572 ntext for server │ │ │ +0016f770: 2d73 6964 6520 7365 6e64 696e 6720 616e -side sending an │ │ │ +0016f780: 6420 7365 6e64 2061 2048 5454 5020 7265 d send a HTTP re │ │ │ +0016f790: 7370 6f6e 7365 2068 6561 6465 722e 3c2f sponse header.
    .
    < │ │ │ +0016f810: 6120 6872 6566 3d22 6772 6f75 705f 5f67 a href="group__g │ │ │ +0016f820: 726f 7570 5f5f 696f 2e68 746d 6c23 6761 roup__io.html#ga │ │ │ +0016f830: 3036 6435 3930 3934 6166 6133 6466 3662 06d59094afa3df6b │ │ │ +0016f840: 3162 3966 3662 3262 6234 3834 3230 3763 1b9f6b2bb484207c │ │ │ +0016f850: 223e 736f 6170 5f63 6c6f 7365 736f 636b ">soap_closesock │ │ │ +0016f860: 3c2f 613e 3c2f 6469 763e 3c64 6976 2063
    in │ │ │ +0016f880: 7420 736f 6170 5f63 6c6f 7365 736f 636b t soap_closesock │ │ │ +0016f890: 2873 7472 7563 7420 736f 6170 202a 736f (struct soap *so │ │ │ +0016f8a0: 6170 293c 2f64 6976 3e3c 6469 7620 636c ap)
    Clos │ │ │ +0016f8c0: 6520 7468 6520 736f 636b 6574 2063 6f6e e the socket con │ │ │ +0016f8d0: 6e65 6374 696f 6e2e 3c2f 6469 763e 3c2f nection.
    .
    int http_get(s │ │ │ +0016f9c0: 7472 7563 7420 736f 6170 202a 2c20 7374 truct soap *, st │ │ │ +0016f9d0: 7275 6374 2073 6f61 705f 706c 7567 696e ruct soap_plugin │ │ │ +0016f9e0: 202a 2c20 766f 6964 202a 293c 2f64 6976 *, void *)
    The HTTP GET │ │ │ +0016fa10: 2070 6c75 6769 6e20 7265 6769 7374 7261 plugin registra │ │ │ +0016fa20: 7469 6f6e 2066 756e 6374 696f 6e2e 3c2f tion function.
    .
    < │ │ │ +0016faa0: 6120 6872 6566 3d22 6772 6f75 705f 5f67 a href="group__g │ │ │ +0016fab0: 726f 7570 5f5f 696f 2e68 746d 6c23 6761 roup__io.html#ga │ │ │ +0016fac0: 3137 6364 6332 3837 6464 3931 3665 3564 17cdc287dd916e5d │ │ │ +0016fad0: 3262 3334 3637 6363 6563 3137 3764 3561 2b3467ccec177d5a │ │ │ +0016fae0: 223e 534f 4150 5f48 544d 4c3c 2f61 3e3c ">SOAP_HTML< │ │ │ +0016faf0: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
    #define │ │ │ +0016fb10: 2053 4f41 505f 4854 4d4c 3c2f 6469 763e SOAP_HTML
    │ │ │ +0016fb20: 3c64 6976 2063 6c61 7373 3d22 7474 646f
    A special soa │ │ │ +0016fb40: 705f 7374 6174 7573 2065 7272 6f72 2063 p_status error c │ │ │ +0016fb50: 6f64 6520 746f 2073 6967 6e61 6c20 7468 ode to signal th │ │ │ +0016fb60: 6174 2061 2063 7573 746f 6d20 4854 5450 at a custom HTTP │ │ │ +0016fb70: 2072 6573 706f 6e73 6520 6973 2070 7265 response is pre │ │ │ +0016fb80: 7365 6e74 2061 6e64 206e 6f20 4854 5450 sent and no HTTP │ │ │ +0016fb90: 2072 6573 706f 6e73 2e2e 2e3c 2f64 6976 respons...
    Definitio │ │ │ +0016fbc0: 6e3a 3c2f 623e 2073 7464 736f 6170 322e n: stdsoap2. │ │ │ +0016fbd0: 683a 3237 3132 3c2f 6469 763e 3c2f 6469 h:2712
    .
    int soap_en │ │ │ +0016fcc0: 645f 7365 6e64 2873 7472 7563 7420 736f d_send(struct so │ │ │ +0016fcd0: 6170 202a 736f 6170 293c 2f64 6976 3e3c ap *soap)
    < │ │ │ +0016fce0: 6469 7620 636c 6173 733d 2274 7464 6f63 div class="ttdoc │ │ │ +0016fcf0: 223e 4669 6e61 6c69 7a65 2074 6865 2063 ">Finalize the c │ │ │ +0016fd00: 6f6e 7465 7874 2061 6674 6572 2073 656e ontext after sen │ │ │ +0016fd10: 6469 6e67 2e3c 2f64 6976 3e3c 2f64 6976 ding.
    .

    The │ │ │ +0016fd40: 6578 616d 706c 6520 6265 6c6f 7720 7072 example below pr │ │ │ +0016fd50: 6f64 7563 6573 2061 2057 5344 4c20 6669 oduces a WSDL fi │ │ │ +0016fd60: 6c65 2075 706f 6e20 6120 4854 5450 2047 le upon a HTTP G │ │ │ +0016fd70: 4554 2077 6974 6820 7061 7468 203c 636f ET with path ?wsdl: │ │ │ +0016fd90: 3c2f 703e 0a3c 6469 7620 636c 6173 733d

    .
    int http_get(< │ │ │ +0016fe40: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +0016fe50: 6f72 6422 3e73 7472 7563 743c 2f73 7061 ord">struct soap *soap< │ │ │ +0016fec0: 2f61 3e29 203c 2f64 6976 3e0a 3c64 6976 /a>)
    .
    {< │ │ │ +0016fee0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    FILE * │ │ │ +0016ff00: 6664 203d 204e 554c 4c3b 3c2f 6469 763e fd = NULL;
    │ │ │ +0016ff10: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    c │ │ │ +0016ff40: 6861 723c 2f73 7061 6e3e 202a 7320 3d20 har *s = │ │ │ +0016ff50: 7374 7263 6872 283c 6120 636c 6173 733d strchr(so │ │ │ +0016ff80: 6170 3c2f 613e 2d26 6774 3b3c 6120 636c ap->path, '?&# │ │ │ +00170000: 3339 3b3c 2f73 7061 6e3e 293b 203c 2f64 39;); .
    if (!s │ │ │ +00170050: 7c7c 2073 7472 636d 7028 732c 203c 7370 || strcmp(s, "? │ │ │ +00170080: 7773 646c 2671 756f 743b 3c2f 7370 616e wsdl"))
    .
    │ │ │ +001700b0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 retur │ │ │ +001700d0: 6e3c 2f73 7061 6e3e 203c 6120 636c 6173 n SOA │ │ │ +00170130: 505f 4745 545f 4d45 5448 4f44 3c2f 613e P_GET_METHOD │ │ │ +00170140: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
    .
    fd │ │ │ +00170160: 3d20 3c61 2063 6c61 7373 3d22 636f 6465 = fopen(& │ │ │ +001701e0: 7175 6f74 3b6d 7973 6572 7669 6365 2e77 quot;myservice.w │ │ │ +001701f0: 7364 6c26 7175 6f74 3b3c 2f73 7061 6e3e sdl" │ │ │ +00170200: 2c20 3c73 7061 6e20 636c 6173 733d 2273 , &q │ │ │ +00170220: 756f 743b 7262 2671 756f 743b 3c2f 7370 uot;rb"); // o │ │ │ +00170250: 7065 6e20 5753 444c 2066 696c 6520 746f pen WSDL file to │ │ │ +00170260: 2063 6f70 7920 3c2f 7370 616e 3e3c 2f64 copy .
    if (!fd │ │ │ +001702b0: 2920 3c2f 6469 763e 0a3c 6469 7620 636c )
    .
    < │ │ │ +001702d0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +001702e0: 6f72 6466 6c6f 7722 3e72 6574 7572 6e3c ordflow">return< │ │ │ +001702f0: 2f73 7061 6e3e 2034 3034 3b20 3c73 7061 /span> 404; // return HTTP │ │ │ +00170320: 206e 6f74 2066 6f75 6e64 2065 7272 6f72 not found error │ │ │ +00170330: 203c 2f73 7061 6e3e 3c2f 6469 763e 0a3c
    .< │ │ │ +00170340: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +00170350: 3e20 203c 6120 636c 6173 733d 2263 6f64 >
    soap-> │ │ │ +001703d0: 6874 7470 5f63 6f6e 7465 6e74 3c2f 613e http_content │ │ │ +001703e0: 203d 203c 7370 616e 2063 6c61 7373 3d22 = & │ │ │ +00170400: 7175 6f74 3b74 6578 742f 786d 6c26 7175 quot;text/xml&qu │ │ │ +00170410: 6f74 3b3c 2f73 7061 6e3e 3b20 3c73 7061 ot;; // HTTP header │ │ │ +00170440: 2077 6974 6820 7465 7874 2f78 6d6c 2063 with text/xml c │ │ │ +00170450: 6f6e 7465 6e74 203c 2f73 7061 6e3e 3c2f ontent .
    if (so │ │ │ +001704f0: 6170 5f72 6573 706f 6e73 653c 2f61 3e28 ap_response( │ │ │ +00170500: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap, │ │ │ +00170530: 203c 6120 636c 6173 733d 2263 6f64 6522 SOAP_FILE) │ │ │ +00170590: 3d3d 203c 6120 636c 6173 733d 2263 6f64 == SOAP_OK)
    .
    {< │ │ │ +00170610: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    while (1)
    . │ │ │ +00170670: 2020 207b 3c2f 6469 763e 0a3c 6469 7620 {
    .
    .
    │ │ │ +00170820: 2020 203c 7370 616e 2063 6c61 7373 3d22 if< │ │ │ +00170840: 2f73 7061 6e3e 2028 2172 207c 7c20 3c61 /span> (!r || so │ │ │ +001708a0: 6170 5f73 656e 645f 7261 773c 2f61 3e28 ap_send_raw( │ │ │ +001708b0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap, │ │ │ +001708e0: 203c 6120 636c 6173 733d 2263 6f64 6522 soap │ │ │ +00170910: 2d26 6774 3b3c 6120 636c 6173 733d 2263 ->tm │ │ │ +00170960: 7062 7566 3c2f 613e 2c20 7229 2920 3c2f pbuf, r)) .
    < │ │ │ +00170990: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +001709a0: 6f72 6466 6c6f 7722 3e62 7265 616b 3c2f ordflow">break;
    . │ │ │ +001709d0: 2020 207d 203c 2f64 6976 3e0a 3c64 6976 }
    .
    │ │ │ +001709f0: 7d3c 2f64 6976 3e0a 3c64 6976 2063 6c61 }
    .
    fclose(fd │ │ │ +00170a70: 293b 203c 2f64 6976 3e0a 3c64 6976 2063 );
    .
    so │ │ │ +00170ae0: 6170 5f65 6e64 5f73 656e 643c 2f61 3e28 ap_end_send( │ │ │ +00170af0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap) │ │ │ +00170b20: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
    ..< │ │ │ +00170c00: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +00170c10: 3e7d 3c2f 6469 763e 0a3c 6469 7620 636c >}
    .
    #define SOA │ │ │ +00170d00: 505f 4745 545f 4d45 5448 4f44 3c2f 6469 P_GET_METHOD
    A soap_stat │ │ │ +00170d30: 7573 2065 7272 6f72 2063 6f64 653a 2061 us error code: a │ │ │ +00170d40: 6e20 4854 5450 2047 4554 2072 6571 7565 n HTTP GET reque │ │ │ +00170d50: 7374 2077 6173 2072 6563 6569 7665 6420 st was received │ │ │ +00170d60: 6279 2074 6865 2073 6572 7669 6365 2062 by the service b │ │ │ +00170d70: 7574 2074 6865 2047 4554 2072 6571 7565 ut the GET reque │ │ │ +00170d80: 7374 2063 616c 6c62 6163 2e2e 2e3c 2f64 st callbac...
    Definit │ │ │ +00170db0: 696f 6e3a 3c2f 623e 2073 7464 736f 6170 ion: stdsoap │ │ │ +00170dc0: 322e 683a 3233 3937 3c2f 6469 763e 3c2f 2.h:2397
    .
    < │ │ │ +00170e90: 6469 7620 636c 6173 733d 2274 7464 6563 div class="ttdec │ │ │ +00170ea0: 6922 3e23 6465 6669 6e65 2053 4f41 505f i">#define SOAP_ │ │ │ +00170eb0: 4649 4c45 3c2f 6469 763e 3c64 6976 2063 FILE
    A s │ │ │ +00170ed0: 7065 6369 616c 2073 6f61 705f 7374 6174 pecial soap_stat │ │ │ +00170ee0: 7573 2065 7272 6f72 2063 6f64 6520 746f us error code to │ │ │ +00170ef0: 2073 6967 6e61 6c20 7468 6174 2061 2063 signal that a c │ │ │ +00170f00: 7573 746f 6d20 6669 6c65 2d62 6173 6564 ustom file-based │ │ │ +00170f10: 2048 5454 5020 7265 7370 6f6e 7365 2069 HTTP response i │ │ │ +00170f20: 7320 7072 6573 656e 7420 616e 6420 6e6f s present and no │ │ │ +00170f30: 2048 2e2e 2e3c 2f64 6976 3e3c 6469 7620 H...
    Definition: │ │ │ +00170f60: 2073 7464 736f 6170 322e 683a 3237 3139 stdsoap2.h:2719 │ │ │ +00170f70: 3c2f 6469 763e 3c2f 6469 763e 0a3c 6469
    .soap_send_ra │ │ │ +00171030: 773c 2f61 3e3c 2f64 6976 3e3c 6469 7620 w
    i │ │ │ +00171050: 6e74 2073 6f61 705f 7365 6e64 5f72 6177 nt soap_send_raw │ │ │ +00171060: 2873 7472 7563 7420 736f 6170 202a 736f (struct soap *so │ │ │ +00171070: 6170 2c20 636f 6e73 7420 6368 6172 202a ap, const char * │ │ │ +00171080: 732c 2073 697a 655f 7420 6e29 3c2f 6469 s, size_t n)
    Send raw by │ │ │ +001710b0: 7465 732e 3c2f 6469 763e 3c2f 6469 763e tes.
    │ │ │ +001710c0: 0a3c 6469 7620 636c 6173 733d 2274 7463 .
    │ │ │ +00171170: 3c64 6976 2063 6c61 7373 3d22 7474 6465
    char tmpbuf[ │ │ │ +00171190: 534f 4150 5f54 4d50 4c45 4e5d 3c2f 6469 SOAP_TMPLEN]
    Internal bu │ │ │ +001711c0: 6666 6572 2074 6f20 686f 6c64 2074 656d ffer to hold tem │ │ │ +001711d0: 706f 7261 7279 2073 7472 696e 6773 2073 porary strings s │ │ │ +001711e0: 7563 6820 6173 2073 7472 696e 6720 7265 uch as string re │ │ │ +001711f0: 7072 6573 656e 7461 7469 6f6e 7320 6f66 presentations of │ │ │ +00171200: 2070 7269 6d69 7469 7665 2076 616c 7565 primitive value │ │ │ +00171210: 732c 2e2e 2e3c 2f64 6976 3e3c 6469 7620 s,...
    Definition: │ │ │ +00171240: 2073 7464 736f 6170 322e 683a 3431 3939 stdsoap2.h:4199 │ │ │ +00171250: 3c2f 6469 763e 3c2f 6469 763e 0a3c 6469
    .
    soap::http │ │ │ +00171300: 5f63 6f6e 7465 6e74 3c2f 613e 3c2f 6469 _content
    const char │ │ │ +00171330: 202a 2068 7474 705f 636f 6e74 656e 743c * http_content< │ │ │ +00171340: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
    String w │ │ │ +00171360: 6974 6820 4854 5450 2063 6f6e 7465 6e74 ith HTTP content │ │ │ +00171370: 2074 7970 6520 6865 6164 6572 2076 616c type header val │ │ │ +00171380: 7565 2072 6563 6569 7665 642c 2063 616e ue received, can │ │ │ +00171390: 2061 6c73 6f20 6265 2061 7373 6967 6e65 also be assigne │ │ │ +001713a0: 6420 746f 2073 7065 6369 6679 2061 2063 d to specify a c │ │ │ +001713b0: 6f6e 7465 6e74 2074 7970 6520 682e 2e2e ontent type h... │ │ │ +001713c0: 3c2f 6469 763e 3c64 6976 2063 6c61 7373
    Defi │ │ │ +001713e0: 6e69 7469 6f6e 3a3c 2f62 3e20 7374 6473 nition: stds │ │ │ +001713f0: 6f61 7032 2e68 3a32 3938 303c 2f64 6976 oap2.h:2980
    .
    < │ │ │ +00171420: 703e 5468 6973 2065 7861 6d70 6c65 2073 p>This example s │ │ │ +00171430: 686f 7773 2068 6f77 206f 6e65 2070 7265 hows how one pre │ │ │ +00171440: 6465 7465 726d 696e 6564 2066 696c 6520 determined file │ │ │ +00171450: 6973 2073 6572 7665 642e 2054 6865 203c is served. The < │ │ │ +00171460: 656d 3e3c 636f 6465 3e67 736f 6170 2f73 em>gsoap/s │ │ │ +00171470: 616d 706c 6573 2f77 6562 7365 7276 6572 amples/webserver │ │ │ +00171480: 3c2f 636f 6465 3e3c 2f65 6d3e 2064 656d dem │ │ │ +00171490: 6f6e 7374 7261 7465 7320 686f 7720 6669 onstrates how fi │ │ │ +001714a0: 6c65 7320 7368 6f75 6c64 2062 6520 7365 les should be se │ │ │ +001714b0: 7276 6564 2069 6e20 6765 6e65 7261 6c2c rved in general, │ │ │ +001714c0: 2062 7920 6164 6469 6e67 2074 6865 206e by adding the n │ │ │ +001714d0: 6563 6573 7361 7279 206c 6f67 6963 2074 ecessary logic t │ │ │ +001714e0: 6f20 6164 6420 6d65 6469 6120 7479 7065 o add media type │ │ │ +001714f0: 7320 746f 2048 5454 5020 6865 6164 6572 s to HTTP header │ │ │ +00171500: 7320 616e 6420 746f 2072 6573 7472 6963 s and to restric │ │ │ +00171510: 7420 7468 6520 7365 6c65 6374 696f 6e20 t the selection │ │ │ +00171520: 6f66 2066 696c 6573 2074 6861 7420 7368 of files that sh │ │ │ +00171530: 6f75 6c64 2062 6520 7365 7276 6564 2e3c ould be served.< │ │ │ +00171540: 2f70 3e0a 3c64 6c20 636c 6173 733d 2273 /p>.
    │ │ │ +00171560: 3c64 743e 5761 726e 696e 673c 2f64 743e
    Warning
    │ │ │ +00171570: 3c64 643e 5768 656e 2073 6572 7669 6e67
    When serving │ │ │ +00171580: 2066 696c 6573 2061 7320 7265 7370 6f6e files as respon │ │ │ +00171590: 7365 7320 746f 2072 6571 7565 7374 732c ses to requests, │ │ │ +001715a0: 2077 6520 6e65 6564 2074 6f20 6265 2076 we need to be v │ │ │ +001715b0: 6172 7920 6361 7265 6675 6c2c 2062 6563 ary careful, bec │ │ │ +001715c0: 6175 7365 2077 6520 646f 6e27 7420 7761 ause we don't wa │ │ │ +001715d0: 6e74 2072 6571 7565 7374 7320 746f 2073 nt requests to s │ │ │ +001715e0: 6e6f 6f70 2061 726f 756e 6420 696e 2064 noop around in d │ │ │ +001715f0: 6972 6563 746f 7269 6573 2061 6e64 2073 irectories and s │ │ │ +00171600: 6572 7665 2066 696c 6573 2074 6861 7420 erve files that │ │ │ +00171610: 7368 6f75 6c64 2062 6520 7072 6f74 6563 should be protec │ │ │ +00171620: 7465 6420 6672 6f6d 2070 7562 6c69 6320 ted from public │ │ │ +00171630: 7669 6577 2e20 5468 6572 6566 6f72 652c view. Therefore, │ │ │ +00171640: 2077 6865 6e20 6164 6469 6e67 206c 6f67 when adding log │ │ │ +00171650: 6963 2074 6f20 7365 7276 6520 6669 6c65 ic to serve file │ │ │ +00171660: 732c 2077 6520 6d75 7374 2072 656a 6563 s, we must rejec │ │ │ +00171670: 7420 7265 7175 6573 7420 7468 6174 2068 t request that h │ │ │ +00171680: 6176 6520 3c63 6f64 653e 3c61 2063 6c61 ave soap::path< │ │ │ +00171720: 2f63 6f64 653e 2076 616c 7565 7320 7769 /code> values wi │ │ │ +00171730: 7468 2061 203c 636f 6465 3e2f 3c2f 636f th a / or a \ │ │ │ +00171750: 3c2f 636f 6465 3e20 283c 636f 6465 3e3c (< │ │ │ +00171760: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ +00171770: 663d 2273 7472 7563 7473 6f61 702e 6874 f="structsoap.ht │ │ │ +00171780: 6d6c 2361 3363 3262 6432 3832 3231 3436 ml#a3c2bd2822146 │ │ │ +00171790: 6138 6363 6361 3230 6638 6632 3137 6332 a8ccca20f8f217c2 │ │ │ +001717a0: 6633 3039 2220 7469 746c 653d 2254 6865 f309" title="The │ │ │ +001717b0: 2063 6c69 656e 7420 7265 7175 6573 7420 client request │ │ │ +001717c0: 7061 7468 2061 7320 7265 6365 6976 6564 path as received │ │ │ +001717d0: 206f 6e20 7468 6520 7365 7276 6572 2073 on the server s │ │ │ +001717e0: 6964 652e 223e 736f 6170 3a3a 7061 7468 ide.">soap::path │ │ │ +001717f0: 3c2f 613e 3c2f 636f 6465 3e20 6973 2061 is a │ │ │ +00171800: 2073 7472 696e 6720 7769 7468 2074 6865 string with the │ │ │ +00171810: 2070 6174 6820 7061 7274 206f 6620 7468 path part of th │ │ │ +00171820: 6520 5552 4c2c 2073 7461 7274 696e 6720 e URL, starting │ │ │ +00171830: 7769 7468 2061 203c 636f 6465 3e2f 3c2f with a /). If these │ │ │ +00171850: 2061 7265 2061 6c6c 6f77 6564 2c20 7468 are allowed, th │ │ │ +00171860: 656e 2077 6520 6d75 7374 2061 7420 6c65 en we must at le │ │ │ +00171870: 6173 7420 6368 6563 6b20 666f 7220 3c63 ast check for .. in │ │ │ +00171890: 2074 6865 2070 6174 6820 746f 2061 766f the path to avo │ │ │ +001718a0: 6964 2072 6571 7565 7374 2066 726f 6d20 id request from │ │ │ +001718b0: 736e 6f6f 7069 6e67 2061 726f 756e 6420 snooping around │ │ │ +001718c0: 696e 2068 6967 6865 7220 6469 7265 6374 in higher direct │ │ │ +001718d0: 6f72 6965 7320 616c 6c20 7468 6520 7761 ories all the wa │ │ │ +001718e0: 7920 7570 2074 6f20 7468 6520 726f 6f74 y up to the root │ │ │ +001718f0: 2e3c 2f64 643e 3c2f 646c 3e0a 3c70 3e46 .
    .

    F │ │ │ +00171900: 6f72 2061 206f 6e65 2d77 6179 2053 4f41 or a one-way SOA │ │ │ +00171910: 502f 584d 4c20 6d65 7373 6167 652c 2079 P/XML message, y │ │ │ +00171920: 6f75 2063 616e 2061 6c73 6f20 7265 7475 ou can also retu │ │ │ +00171930: 726e 2061 2053 4f41 502f 584d 4c20 7265 rn a SOAP/XML re │ │ │ +00171940: 7370 6f6e 7365 3a3c 2f70 3e0a 3c64 6976 sponse:

    .
    in │ │ │ +00171990: 743c 2f73 7061 6e3e 203c 6120 636c 6173 t http_ge │ │ │ +001719f0: 743c 2f61 3e28 3c73 7061 6e20 636c 6173 t(stru │ │ │ +00171a10: 6374 3c2f 7370 616e 3e20 3c61 2063 6c61 ct soap *soap) .
    {
    . │ │ │ +00171ab0: 203c 6120 636c 6173 733d 2263 6f64 6522 soap_response(soap, SOAP_OK< │ │ │ +00171ba0: 2f61 3e29 3b20 3c2f 6469 763e 0a3c 6469 /a>);
    . │ │ │ +00171bc0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 retur │ │ │ +00171be0: 6e3c 2f73 7061 6e3e 2073 6f61 705f 7365 n soap_se │ │ │ +00171bf0: 6e64 5f6e 7331 5f5f 6d79 5365 6e64 4d65 nd_ns1__mySendMe │ │ │ +00171c00: 7468 6f64 5265 7370 6f6e 7365 283c 6120 thodResponse(soap, " │ │ │ +00171c60: 2671 756f 743b 3c2f 7370 616e 3e2c 204e ", N │ │ │ +00171c70: 554c 4c2c 202e 2e2e 2070 6172 616d 7320 ULL, ... params │ │ │ +00171c80: 2e2e 2e29 3b20 3c2f 6469 763e 0a3c 6469 ...);
    .} │ │ │ +00171ca0: 203c 2f64 6976 3e0a 3c2f 6469 763e 3c21
    .
    < │ │ │ +00171cc0: 703e 7768 6572 6520 3c63 6f64 653e 6e73 p>where ns │ │ │ +00171cd0: 315f 5f6d 7953 656e 644d 6574 686f 6452 1__mySendMethodR │ │ │ +00171ce0: 6573 706f 6e73 653c 2f63 6f64 653e 2069 esponse i │ │ │ +00171cf0: 7320 6120 6f6e 652d 7761 7920 6d65 7373 s a one-way mess │ │ │ +00171d00: 6167 6520 6465 636c 6172 6564 2069 6e20 age declared in │ │ │ +00171d10: 6120 696e 7465 7266 6163 6520 6865 6164 a interface head │ │ │ +00171d20: 6572 2066 696c 6520 6173 3a3c 2f70 3e0a er file as:

    . │ │ │ +00171d30: 3c64 6976 2063 6c61 7373 3d22 6672 6167
    int ns1 │ │ │ +00171d80: 5f5f 6d79 5365 6e64 4d65 7468 6f64 5265 __mySendMethodRe │ │ │ +00171d90: 7370 6f6e 7365 282e 2e2e 2070 6172 616d sponse(... param │ │ │ +00171da0: 7320 2e2e 2e2c 203c 7370 616e 2063 6c61 s ..., void);.

    T │ │ │ +00171df0: 6865 2067 656e 6572 6174 6564 203c 656d he generated soapClien │ │ │ +00171e10: 742e 6370 703c 2f63 6f64 653e 3c2f 656d t.cpp includes the s │ │ │ +00171e30: 656e 6469 6e67 2d73 6964 6520 7374 7562 ending-side stub │ │ │ +00171e40: 2066 756e 6374 696f 6e2e 3c2f 703e 0a3c function.

    .< │ │ │ +00171e50: 703e 5468 6520 6578 616d 706c 6573 2061 p>The examples a │ │ │ +00171e60: 626f 7665 2061 7265 2066 6f72 2048 5454 bove are for HTT │ │ │ +00171e70: 5020 4745 542e 2054 6f20 696d 706c 656d P GET. To implem │ │ │ +00171e80: 656e 7420 4854 5450 2050 5554 2061 6e64 ent HTTP PUT and │ │ │ +00171e90: 2050 4154 4348 2073 6574 2074 6865 203c PATCH set the < │ │ │ +00171ea0: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soap::fpu │ │ │ +00171f70: 743c 2f61 3e3c 2f63 6f64 653e 2061 6e64 t
    and │ │ │ +00171f80: 203c 636f 6465 3e3c 6120 636c 6173 733d soa │ │ │ +00172050: 703a 3a66 7061 7463 683c 2f61 3e3c 2f63 p::fpatch callback fu │ │ │ +00172070: 6e63 7469 6f6e 7320 6f72 2075 7365 2074 nctions or use t │ │ │ +00172080: 6865 203c 636f 6465 3e3c 6120 636c 6173 he http_ │ │ │ +00172110: 706f 7374 3c2f 613e 3c2f 636f 6465 3e20 post │ │ │ +00172120: 706c 7567 696e 2077 6869 6368 2069 7320 plugin which is │ │ │ +00172130: 6d6f 7265 2063 6170 6162 6c65 2e3c 2f70 more capable.

    .

    .... Back to ta │ │ │ +00172160: 626c 6520 6f66 2063 6f6e 7465 6e74 733c ble of contents< │ │ │ +00172170: 2f61 3e3c 2f70 3e0a 3c68 323e 3c61 2063 /a>

    .

    .TCP and HTTP k │ │ │ +001721b0: 6565 702d 616c 6976 653c 2f68 323e 0a3c eep-alive

    .< │ │ │ +001721c0: 703e 546f 2061 6374 6976 6174 6520 4854 p>To activate HT │ │ │ +001721d0: 5450 206b 6565 702d 616c 6976 652c 2073 TP keep-alive, s │ │ │ +001721e0: 6574 2074 6865 203c 636f 6465 3e23 534f et the #SO │ │ │ +001721f0: 4150 5f49 4f5f 4b45 4550 414c 4956 453c AP_IO_KEEPALIVE< │ │ │ +00172200: 2f63 6f64 653e 2066 6c61 6720 666f 7220 /code> flag for │ │ │ +00172210: 626f 7468 2069 6e70 7574 2061 6e64 206f both input and o │ │ │ +00172220: 7574 7075 7420 6d6f 6465 732c 2073 6565 utput modes, see │ │ │ +00172230: 2053 6563 7469 6f6e 203c 6120 636c 6173 Section R │ │ │ +00172260: 756e 2d74 696d 6520 666c 6167 733c 2f61 un-time flags . For example< │ │ │ +00172280: 2f70 3e0a 3c64 6976 2063 6c61 7373 3d22 /p>.
    struct │ │ │ +001722d0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap │ │ │ +00172300: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap; │ │ │ +00172330: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    s │ │ │ +001723a0: 6f61 705f 696e 6974 313c 2f61 3e28 2661 oap_init1(&a │ │ │ +001723b0: 6d70 3b3c 6120 636c 6173 733d 2263 6f64 mp;soap, SOAP_IO_K │ │ │ +00172440: 4545 5041 4c49 5645 3c2f 613e 293b 203c EEPALIVE); < │ │ │ +00172450: 2f64 6976 3e0a 3c2f 6469 763e 3c21 2d2d /div>.

    │ │ │ +00172470: 5768 656e 2061 2063 6c69 656e 7420 6f72 When a client or │ │ │ +00172480: 2061 2073 6572 7669 6365 2063 6f6d 6d75 a service commu │ │ │ +00172490: 6e69 6361 7465 7320 7769 7468 2061 6e6f nicates with ano │ │ │ +001724a0: 7468 6572 2063 6c69 656e 7420 6f72 2073 ther client or s │ │ │ +001724b0: 6572 7669 6365 2074 6861 7420 7375 7070 ervice that supp │ │ │ +001724c0: 6f72 7473 206b 6565 7020 616c 6976 652c orts keep alive, │ │ │ +001724d0: 2074 6865 203c 636f 6465 3e3c 6120 636c the soap::k │ │ │ +00172590: 6565 705f 616c 6976 653c 2f61 3e3c 2f63 eep_alive variable wi │ │ │ +001725b0: 6c6c 2062 6520 7365 7420 746f 2031 2c20 ll be set to 1, │ │ │ +001725c0: 6f74 6865 7277 6973 6520 6974 2069 7320 otherwise it is │ │ │ +001725d0: 7265 7365 7420 746f 2030 2069 6e64 6963 reset to 0 indic │ │ │ +001725e0: 6174 696e 6720 7468 6174 2074 6865 206f ating that the o │ │ │ +001725f0: 7468 6572 2070 6172 7479 2077 616e 7473 ther party wants │ │ │ +00172600: 2074 6f20 636c 6f73 6520 7468 6520 636f to close the co │ │ │ +00172610: 6e6e 6563 7469 6f6e 2e20 5468 6520 636f nnection. The co │ │ │ +00172620: 6e6e 6563 7469 6f6e 206d 6179 6265 2074 nnection maybe t │ │ │ +00172630: 6572 6d69 6e61 7465 6420 6f6e 2065 6974 erminated on eit │ │ │ +00172640: 6865 7220 656e 6420 6265 666f 7265 2074 her end before t │ │ │ +00172650: 6865 2063 6f6d 6d75 6e69 6361 7469 6f6e he communication │ │ │ +00172660: 2063 6f6d 706c 6574 6564 2c20 666f 7220 completed, for │ │ │ +00172670: 6578 616d 706c 6520 7768 656e 2074 6865 example when the │ │ │ +00172680: 2073 6572 7665 7220 6b65 6570 2d61 6c69 server keep-ali │ │ │ +00172690: 7665 2063 6f6e 6e65 6374 696f 6e20 6861 ve connection ha │ │ │ +001726a0: 7320 7469 6d65 6420 6f75 742e 2054 6869 s timed out. Thi │ │ │ +001726b0: 7320 6d61 7920 6765 6e65 7261 7465 2061 s may generate a │ │ │ +001726c0: 2022 4272 6f6b 656e 2050 6970 6522 2073 "Broken Pipe" s │ │ │ +001726d0: 6967 6e61 6c20 6f6e 2055 6e69 782f 4c69 ignal on Unix/Li │ │ │ +001726e0: 6e75 7820 706c 6174 666f 726d 732e 2054 nux platforms. T │ │ │ +001726f0: 6869 7320 7369 676e 616c 2063 616e 2062 his signal can b │ │ │ +00172700: 6520 6361 7567 6874 2077 6974 6820 6120 e caught with a │ │ │ +00172710: 7369 676e 616c 2068 616e 646c 6572 3a3c signal handler:< │ │ │ +00172720: 2f70 3e0a 3c64 6976 2063 6c61 7373 3d22 /p>.

    sign │ │ │ +00172750: 616c 2853 4947 5049 5045 2c20 7369 6770 al(SIGPIPE, sigp │ │ │ +00172760: 6970 655f 6861 6e64 6c65 293b 3c2f 6469 ipe_handle);.

    whe │ │ │ +00172790: 7265 2c20 666f 7220 6578 616d 706c 653a re, for example: │ │ │ +001727a0: 3c2f 703e 0a3c 6469 7620 636c 6173 733d

    .
    void sigpipe_handl │ │ │ +00172800: 6528 3c73 7061 6e20 636c 6173 733d 226b e(int< │ │ │ +00172820: 2f73 7061 6e3e 2078 2920 7b20 7d3c 2f64 /span> x) { }.

    Al │ │ │ +00172850: 7465 726e 6174 6976 656c 792c 2062 726f ternatively, bro │ │ │ +00172860: 6b65 6e20 7069 7065 7320 6361 6e20 6265 ken pipes can be │ │ │ +00172870: 206b 6570 7420 7369 6c65 6e74 2062 7920 kept silent by │ │ │ +00172880: 7365 7474 696e 673a 3c2f 703e 0a3c 6469 setting:

    .
    soap │ │ │ +001728e0: 3c2f 613e 2e3c 6120 636c 6173 733d 2263 .so │ │ │ +00172930: 636b 6574 5f66 6c61 6773 3c2f 613e 203d cket_flags = │ │ │ +00172940: 204d 5347 5f4e 4f53 4947 4e41 4c3b 3c2f MSG_NOSIGNAL;.
    in │ │ │ +00172a20: 7420 736f 636b 6574 5f66 6c61 6773 3c2f t socket_flags
    User-defi │ │ │ +00172a50: 6e61 626c 6520 736f 636b 6574 2073 656e nable socket sen │ │ │ +00172a60: 6420 616e 6420 7265 6376 2066 6c61 6773 d and recv flags │ │ │ +00172a70: 2c20 666f 7220 6578 616d 706c 6520 6173 , for example as │ │ │ +00172a80: 7369 676e 204d 5347 5f4e 4f53 4947 4e41 sign MSG_NOSIGNA │ │ │ +00172a90: 4c20 746f 2064 6973 6162 6c65 2073 6967 L to disable sig │ │ │ +00172aa0: 7069 7065 2028 7468 6520 7661 2e2e 2e3c pipe (the va...< │ │ │ +00172ab0: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
    Defin │ │ │ +00172ad0: 6974 696f 6e3a 3c2f 623e 2073 7464 736f ition: stdso │ │ │ +00172ae0: 6170 322e 683a 3333 3539 3c2f 6469 763e ap2.h:3359
    │ │ │ +00172af0: 3c2f 6469 763e 0a3c 2f64 6976 3e3c 212d
    .

    This setting wi │ │ │ +00172b20: 6c6c 206e 6f74 2067 656e 6572 6174 6520 ll not generate │ │ │ +00172b30: 6120 5349 4750 4950 4520 6275 7420 7265 a SIGPIPE but re │ │ │ +00172b40: 6164 2f77 7269 7465 206f 7065 7261 7469 ad/write operati │ │ │ +00172b50: 6f6e 7320 7265 7475 726e 203c 636f 6465 ons return #SOAP_EOF instead. Note │ │ │ +00172b80: 7468 6174 2057 696e 646f 7773 2064 6f65 that Windows doe │ │ │ +00172b90: 7320 6e6f 7420 7375 7070 6f72 7420 7369 s not support si │ │ │ +00172ba0: 676e 616c 7320 616e 6420 6c61 636b 2074 gnals and lack t │ │ │ +00172bb0: 6865 203c 636f 6465 3e4d 5347 5f4e 4f53 he MSG_NOS │ │ │ +00172bc0: 4947 4e41 4c3c 2f63 6f64 653e 2066 6c61 IGNAL fla │ │ │ +00172bd0: 672e 3c2f 703e 0a3c 703e 4966 2074 6865 g.

    .

    If the │ │ │ +00172be0: 2063 6c69 656e 7420 646f 6573 206e 6f74 client does not │ │ │ +00172bf0: 2063 6c6f 7365 2074 6865 2063 6f6e 6e65 close the conne │ │ │ +00172c00: 6374 696f 6e2c 2074 6865 2073 6572 7665 ction, the serve │ │ │ +00172c10: 7220 7769 6c6c 2077 6169 7420 666f 7265 r will wait fore │ │ │ +00172c20: 7665 7220 7768 656e 206e 6f20 3c63 6f64 ver when no soa │ │ │ +00172ce0: 703a 3a72 6563 765f 7469 6d65 6f75 743c p::recv_timeout< │ │ │ +00172cf0: 2f61 3e3c 2f63 6f64 653e 2069 7320 7370 /a> is sp │ │ │ +00172d00: 6563 6966 6965 642c 2073 6f20 6265 2063 ecified, so be c │ │ │ +00172d10: 6172 6566 756c 2074 6f20 7365 7420 7469 areful to set ti │ │ │ +00172d20: 6d65 6f75 7473 2c20 5365 6520 5365 6374 meouts, See Sect │ │ │ +00172d30: 696f 6e20 3c61 2063 6c61 7373 3d22 656c ion Time │ │ │ +00172d60: 6f75 7420 6d61 6e61 6765 6d65 6e74 2066 out management f │ │ │ +00172d70: 6f72 206e 6f6e 2d62 6c6f 636b 696e 6720 or non-blocking │ │ │ +00172d80: 6f70 6572 6174 696f 6e73 3c2f 613e 2e20 operations. │ │ │ +00172d90: 496e 2061 6464 6974 696f 6e2c 206f 7468 In addition, oth │ │ │ +00172da0: 6572 2063 6c69 656e 7473 2077 696c 6c20 er clients will │ │ │ +00172db0: 6265 2064 656e 6965 6420 7365 7276 6963 be denied servic │ │ │ +00172dc0: 6520 6173 206c 6f6e 6720 6173 2061 2063 e as long as a c │ │ │ +00172dd0: 6c69 656e 7420 6b65 6570 7320 7468 6520 lient keeps the │ │ │ +00172de0: 636f 6e6e 6563 7469 6f6e 2074 6f20 7468 connection to th │ │ │ +00172df0: 6520 7365 7276 6572 206f 7065 6e2e 2054 e server open. T │ │ │ +00172e00: 6f20 7072 6576 656e 7420 7468 6973 2066 o prevent this f │ │ │ +00172e10: 726f 6d20 6861 7070 656e 696e 672c 2074 rom happening, t │ │ │ +00172e20: 6865 2073 6572 7669 6365 2073 686f 756c he service shoul │ │ │ +00172e30: 6420 6265 206d 756c 7469 2d74 6872 6561 d be multi-threa │ │ │ +00172e40: 6465 6420 7375 6368 2074 6861 7420 6561 ded such that ea │ │ │ +00172e50: 6368 2074 6872 6561 6420 6861 6e64 6c65 ch thread handle │ │ │ +00172e60: 7320 7468 6520 636c 6965 6e74 2063 6f6e s the client con │ │ │ +00172e70: 6e65 6374 696f 6e3a 3c2f 703e 0a3c 6469 nection:

    .
    i │ │ │ +00172ec0: 6e74 3c2f 7370 616e 3e20 6d61 696e 283c nt main(< │ │ │ +00172ed0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +00172ee0: 6f72 6474 7970 6522 3e69 6e74 3c2f 7370 ordtype">int argc, char │ │ │ +00172f20: 2a2a 6172 6776 2920 3c2f 6469 763e 0a3c **argv)
    .< │ │ │ +00172f30: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +00172f40: 3e7b 3c2f 6469 763e 0a3c 6469 7620 636c >{
    .
    struct soap │ │ │ +00172fb0: 203c 6120 636c 6173 733d 2263 6f64 6522 soap │ │ │ +00172fe0: 2c20 2a74 736f 6170 3b20 3c2f 6469 763e , *tsoap;
    │ │ │ +00172ff0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    THREAD │ │ │ +00173060: 5f54 5950 453c 2f61 3e20 7469 643b 203c _TYPE tid; < │ │ │ +00173070: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    int m │ │ │ +001730b0: 2c20 733b 203c 2f64 6976 3e0a 3c64 6976 , s;
    .
    │ │ │ +001730d0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap_init2< │ │ │ +00173130: 2f61 3e28 2661 6d70 3b3c 6120 636c 6173 /a>(& │ │ │ +00173160: 736f 6170 3c2f 613e 2c20 3c61 2063 6c61 soap, SOA │ │ │ +001731c0: 505f 494f 5f4b 4545 5041 4c49 5645 3c2f P_IO_KEEPALIVE, SOAP_IO_K │ │ │ +00173230: 4545 5041 4c49 5645 3c2f 613e 293b 203c EEPALIVE); < │ │ │ +00173240: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    soap.max_keep_aliv │ │ │ +001732e0: 653c 2f61 3e20 3d20 3130 303b 203c 7370 e = 100; // at most 10 │ │ │ +00173310: 3020 6361 6c6c 7320 7065 7220 6b65 6570 0 calls per keep │ │ │ +00173320: 2d61 6c69 7665 2073 6573 7369 6f6e 203c -alive session < │ │ │ +00173330: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    . │ │ │ +00173350: 203c 6120 636c 6173 733d 2263 6f64 6522 soap │ │ │ +00173380: 2e3c 6120 636c 6173 733d 2263 6f64 6522 .accept │ │ │ +001733d0: 5f74 696d 656f 7574 3c2f 613e 203d 2036 _timeout = 6 │ │ │ +001733e0: 3030 3b20 3c73 7061 6e20 636c 6173 733d 00; // opt │ │ │ +00173400: 696f 6e61 6c3a 206c 6574 2073 6572 7665 ional: let serve │ │ │ +00173410: 7220 7469 6d65 206f 7574 2061 6674 6572 r time out after │ │ │ +00173420: 2074 656e 206d 696e 7574 6573 206f 6620 ten minutes of │ │ │ +00173430: 696e 6163 7469 7669 7479 203c 2f73 7061 inactivity
    ..
    if │ │ │ +00173590: 2028 213c 6120 636c 6173 733d 2263 6f64 (!soap_valid_ │ │ │ +001735f0: 736f 636b 6574 3c2f 613e 286d 2929 203c socket(m)) < │ │ │ +00173600: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    {
    .
    soap_ │ │ │ +00173690: 7072 696e 745f 6661 756c 743c 2f61 3e28 print_fault( │ │ │ +001736a0: 2661 6d70 3b3c 6120 636c 6173 733d 2263 &soap │ │ │ +001736d0: 3c2f 613e 2c20 7374 6465 7272 293b 203c , stderr); < │ │ │ +001736e0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    exit │ │ │ +00173700: 2845 5849 545f 4641 494c 5552 4529 3b20 (EXIT_FAILURE); │ │ │ +00173710: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    } .
    fprintf( │ │ │ +00173750: 7374 6465 7272 2c20 3c73 7061 6e20 636c stderr, "Socket │ │ │ +00173780: 2063 6f6e 6e65 6374 696f 6e20 7375 6363 connection succ │ │ │ +00173790: 6573 7366 756c 2025 645c 6e26 7175 6f74 essful %d\n" │ │ │ +001737a0: 3b3c 2f73 7061 6e3e 2c20 6d29 3b20 3c2f ;, m); .
    for (< │ │ │ +001737f0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +00173800: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ +00173810: 6874 6d6c 2361 3430 3764 6165 3462 6338 html#a407dae4bc8 │ │ │ +00173820: 3464 3065 3762 3830 3964 3531 6133 6238 4d0e7b809d51a3b8 │ │ │ +00173830: 3739 3865 3063 223e 636f 756e 743c 2f61 798e0c">count = 0; │ │ │ +00173890: 636f 756e 743c 2f61 3e20 2667 743b 3d20 count >= │ │ │ +001738a0: 303b 203c 6120 636c 6173 733d 2263 6f64 0; coun │ │ │ +001738f0: 743c 2f61 3e2b 2b29 203c 2f64 6976 3e0a t++)
    . │ │ │ +00173900: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    {
    .
    │ │ │ +00173930: 2020 3c61 2063 6c61 7373 3d22 636f 6465 soap.socke │ │ │ +001739b0: 745f 666c 6167 733c 2f61 3e20 3d20 4d53 t_flags = MS │ │ │ +001739c0: 475f 4e4f 5349 474e 414c 3b20 3c73 7061 G_NOSIGNAL; // use this
    .
    │ │ │ +00173a10: 2020 3c61 2063 6c61 7373 3d22 636f 6465 soap.accep │ │ │ +00173a90: 745f 666c 6167 733c 2f61 3e20 3d20 534f t_flags = SO │ │ │ +00173aa0: 5f4e 4f53 4947 5049 5045 3b20 3c73 7061 _NOSIGPIPE; // or this to │ │ │ +00173ad0: 7072 6576 656e 7420 5349 4750 4950 4520 prevent SIGPIPE │ │ │ +00173ae0: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ +00173b00: 2020 2020 7320 3d20 3c61 2063 6c61 7373 s = soap_acc │ │ │ +00173b60: 6570 743c 2f61 3e28 2661 6d70 3b3c 6120 ept(&soap); < │ │ │ +00173ba0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    if │ │ │ +00173be0: 283c 6120 636c 6173 733d 2263 6f64 6522 (soap_valid_so │ │ │ +00173c40: 636b 6574 3c2f 613e 2873 2929 203c 2f64 cket(s)) .
    {
    .
    fprint │ │ │ +00173c90: 6628 7374 6465 7272 2c20 3c73 7061 6e20 f(stderr, "Acce │ │ │ +00173cc0: 7074 2073 6f63 6b65 7420 2564 2063 6f6e pt socket %d con │ │ │ +00173cd0: 6e65 6374 696f 6e20 6672 6f6d 2049 5020 nection from IP │ │ │ +00173ce0: 2564 2e25 642e 2564 2e25 645c 6e26 7175 %d.%d.%d.%d\n&qu │ │ │ +00173cf0: 6f74 3b3c 2f73 7061 6e3e 2c20 732c 2028 ot;, s, ( │ │ │ +00173d00: 3c73 7061 6e20 636c 6173 733d 226b 6579 int)(soa │ │ │ +00173d50: 703c 2f61 3e2e 3c61 2063 6c61 7373 3d22 p.i │ │ │ +00173da0: 703c 2f61 3e26 6774 3b26 6774 3b32 3429 p>>24) │ │ │ +00173db0: 2661 6d70 3b30 7846 462c 2028 3c73 7061 &0xFF, (int │ │ │ +00173de0: 2928 3c61 2063 6c61 7373 3d22 636f 6465 )(soap.ip>>16)& │ │ │ +00173e70: 3b30 7846 462c 2028 3c73 7061 6e20 636c ;0xFF, (int)(soap.ip> │ │ │ +00173f20: 3b26 6774 3b38 2926 616d 703b 3078 4646 ;>8)&0xFF │ │ │ +00173f30: 2c20 283c 7370 616e 2063 6c61 7373 3d22 , (int │ │ │ +00173f50: 3c2f 7370 616e 3e29 3c61 2063 6c61 7373 )s │ │ │ +00173f80: 6f61 703c 2f61 3e2e 3c61 2063 6c61 7373 oap.ip&0xFF │ │ │ +00173fe0: 293b 203c 2f64 6976 3e0a 3c64 6976 2063 );
    .
    │ │ │ +00174000: 2020 7473 6f61 7020 3d20 3c61 2063 6c61 tsoap = s │ │ │ +00174060: 6f61 705f 636f 7079 3c2f 613e 2826 616d oap_copy(&am │ │ │ +00174070: 703b 3c61 2063 6c61 7373 3d22 636f 6465 p;soap);
    .
    │ │ │ +001740c0: 2020 203c 7370 616e 2063 6c61 7373 3d22 if< │ │ │ +001740e0: 2f73 7061 6e3e 2028 2174 736f 6170 293c /span> (!tsoap)< │ │ │ +001740f0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    │ │ │ +00174110: 3c61 2063 6c61 7373 3d22 636f 6465 2220 │ │ │ +00174160: 736f 6170 5f66 6f72 6365 5f63 6c6f 7365 soap_force_close │ │ │ +00174170: 736f 636b 3c2f 613e 2826 616d 703b 3c61 sock(&soap);< │ │ │ +001741b0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    else
    ..
    │ │ │ +00174360: 2020 2073 6c65 6570 2831 293b 203c 7370 sleep(1); // failed, tr │ │ │ +00174390: 7920 6167 6169 6e3c 2f73 7061 6e3e 3c2f y again.
    }.
    else < │ │ │ +00174400: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +00174410: 6f72 6466 6c6f 7722 3e69 663c 2f73 7061 ordflow">if (soap< │ │ │ +00174450: 2f61 3e2e 3c61 2063 6c61 7373 3d22 636f /a>.err │ │ │ +001744a0: 6e75 6d3c 2f61 3e29 203c 7370 616e 2063 num) / │ │ │ +001744c0: 2f20 6163 6365 7074 2066 6169 6c65 642c / accept failed, │ │ │ +001744d0: 2074 7279 2061 6761 696e 2061 6674 6572 try again after │ │ │ +001744e0: 2031 2073 6563 6f6e 643c 2f73 7061 6e3e 1 second │ │ │ +001744f0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    {..
    │ │ │ +001745f0: 2020 2073 6c65 6570 2831 293b 3c2f 6469 sleep(1);.
    }
    │ │ │ +00174620: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    else.
    {
    │ │ │ +00174680: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    fprintf │ │ │ +001746a0: 2873 7464 6572 722c 203c 7370 616e 2063 (stderr, "Serve │ │ │ +001746d0: 7220 7469 6d65 6420 6f75 745c 6e26 7175 r timed out\n&qu │ │ │ +001746e0: 6f74 3b3c 2f73 7061 6e3e 293b 3c2f 6469 ot;);.
    break;
    .
    │ │ │ +00174750: 7d20 3c2f 6469 763e 0a3c 6469 7620 636c }
    .
    } < │ │ │ +00174770: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    return 0;
    .
    } │ │ │ +001747d0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    │ │ │ +001747f0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    voi │ │ │ +00174820: 643c 2f73 7061 6e3e 202a 7072 6f63 6573 d *proces │ │ │ +00174830: 735f 7265 7175 6573 7428 3c73 7061 6e20 s_request(void │ │ │ +00174860: 2a74 736f 6170 2920 3c2f 6469 763e 0a3c *tsoap)
    .< │ │ │ +00174870: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +00174880: 3e7b 3c2f 6469 763e 0a3c 6469 7620 636c >{
    .
    struct *soap = (struc │ │ │ +00174910: 7420 3c2f 7370 616e 3e3c 6120 636c 6173 t │ │ │ +00174940: 736f 6170 3c2f 613e 2a29 7473 6f61 703b soap*)tsoap; │ │ │ +00174950: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .. │ │ │ +00174a50: 2020 2828 3c73 7061 6e20 636c 6173 733d ((struct │ │ │ +00174a70: 203c 2f73 7061 6e3e 3c61 2063 6c61 7373 s │ │ │ +00174aa0: 6f61 703c 2f61 3e2a 293c 6120 636c 6173 oap*) │ │ │ +00174ad0: 736f 6170 3c2f 613e 292d 2667 743b 7265 soap)->re │ │ │ +00174ae0: 6376 5f74 696d 656f 7574 203d 2036 303b cv_timeout = 60; │ │ │ +00174af0: 203c 7370 616e 2063 6c61 7373 3d22 636f // Timeou │ │ │ +00174b10: 7420 6166 7465 7220 3120 6d69 6e75 7465 t after 1 minute │ │ │ +00174b20: 2073 7461 6c6c 206f 6e20 7265 6376 203c stall on recv < │ │ │ +00174b30: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    . │ │ │ +00174b50: 2028 283c 7370 616e 2063 6c61 7373 3d22 ((struct │ │ │ +00174b70: 3c2f 7370 616e 3e3c 6120 636c 6173 733d so │ │ │ +00174ba0: 6170 3c2f 613e 2a29 3c61 2063 6c61 7373 ap*)s │ │ │ +00174bd0: 6f61 703c 2f61 3e29 2d26 6774 3b73 656e oap)->sen │ │ │ +00174be0: 645f 7469 6d65 6f75 7420 3d20 3130 3b20 d_timeout = 10; │ │ │ +00174bf0: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // Timeout │ │ │ +00174c10: 2061 6674 6572 2031 3020 7365 636f 6e64 after 10 second │ │ │ +00174c20: 2073 7461 6c6c 206f 6e20 7365 6e64 203c stall on send < │ │ │ +00174c30: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    . │ │ │ +00174c50: 203c 6120 636c 6173 733d 2263 6f64 6522 soap_serve( │ │ │ +00174cb0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap) │ │ │ +00174ce0: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
    ...
    < │ │ │ +00174e60: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +00174e70: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ +00174e80: 705f 5f63 6f6e 7465 7874 2e68 746d 6c23 p__context.html# │ │ │ +00174e90: 6761 3537 3130 3863 6134 3638 3131 3836 ga57108ca4681186 │ │ │ +00174ea0: 6535 3862 3562 3138 3963 3335 3238 6631 e58b5b189c3528f1 │ │ │ +00174eb0: 3061 223e 736f 6170 5f66 7265 653c 2f61 0a">soap_free(soap);
    .
    < │ │ │ +00174f10: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +00174f20: 6f72 6466 6c6f 7722 3e72 6574 7572 6e3c ordflow">return< │ │ │ +00174f30: 2f73 7061 6e3e 204e 554c 4c3b 203c 2f64 /span> NULL; .
    }
    .
    │ │ │ +00175020: 554c 4f4e 4736 3420 636f 756e 743c 2f64 ULONG64 count
    Message le │ │ │ +00175050: 6e67 7468 2063 6f75 6e74 6572 2076 616c ngth counter val │ │ │ +00175060: 7565 206f 6620 7468 6520 6d65 7373 6167 ue of the messag │ │ │ +00175070: 6520 7265 6365 6976 6564 2061 6e64 2063 e received and c │ │ │ +00175080: 6f75 6e74 6572 2076 616c 7565 206f 6620 ounter value of │ │ │ +00175090: 7468 6520 4854 5450 2063 6f6e 7465 6e74 the HTTP content │ │ │ +001750a0: 206c 656e 6774 6820 6865 612e 2e2e 3c2f length hea...
    Defini │ │ │ +001750d0: 7469 6f6e 3a3c 2f62 3e20 7374 6473 6f61 tion: stdsoa │ │ │ +001750e0: 7032 2e68 3a34 3230 343c 2f64 6976 3e3c p2.h:4204
    < │ │ │ +001750f0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    < │ │ │ +00175140: 6469 7620 636c 6173 733d 2274 746e 616d div class="ttnam │ │ │ +00175150: 6522 3e3c 6120 6872 6566 3d22 7374 7275 e">s │ │ │ +00175190: 6f61 703a 3a61 6363 6570 745f 666c 6167 oap::accept_flag │ │ │ +001751a0: 733c 2f61 3e3c 2f64 6976 3e3c 6469 7620 s
    i │ │ │ +001751c0: 6e74 2061 6363 6570 745f 666c 6167 733c nt accept_flags< │ │ │ +001751d0: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
    User-def │ │ │ +001751f0: 696e 6162 6c65 2073 6574 736f 636b 6f70 inable setsockop │ │ │ +00175200: 7420 6c65 7665 6c20 534f 4c5f 534f 434b t level SOL_SOCK │ │ │ +00175210: 4554 2066 6c61 6773 2028 3020 6279 2064 ET flags (0 by d │ │ │ +00175220: 6566 6175 6c74 292c 2077 6865 6e20 6e6f efault), when no │ │ │ +00175230: 6e7a 6572 6f20 7365 7473 2074 6865 2073 nzero sets the s │ │ │ +00175240: 6f61 703a 3a73 6f63 6b65 7420 662e 2e2e oap::socket f... │ │ │ +00175250: 3c2f 6469 763e 3c64 6976 2063 6c61 7373
    Defi │ │ │ +00175270: 6e69 7469 6f6e 3a3c 2f62 3e20 7374 6473 nition: stds │ │ │ +00175280: 6f61 7032 2e68 3a33 3435 333c 2f64 6976 oap2.h:3453
    .
    < │ │ │ +001752b0: 703e 4120 636c 6965 6e74 2063 616c 6c20 p>A client call │ │ │ +001752c0: 7769 6c6c 2061 7574 6f6d 6174 6963 616c will automatical │ │ │ +001752d0: 6c79 2061 7474 656d 7074 2074 6f20 7265 ly attempt to re │ │ │ +001752e0: 2d65 7374 6162 6c69 7368 2061 2063 6f6e -establish a con │ │ │ +001752f0: 6e65 6374 696f 6e20 746f 2061 2073 6572 nection to a ser │ │ │ +00175300: 7665 7220 7768 656e 2074 6865 2073 6572 ver when the ser │ │ │ +00175310: 7665 7220 6861 7320 7465 726d 696e 6174 ver has terminat │ │ │ +00175320: 6564 2074 6865 2063 6f6e 6e65 6374 696f ed the connectio │ │ │ +00175330: 6e20 666f 7220 616e 7920 7265 6173 6f6e n for any reason │ │ │ +00175340: 2e20 5468 6973 2077 6179 2c20 6120 7365 . This way, a se │ │ │ +00175350: 7175 656e 6365 206f 6620 6361 6c6c 7320 quence of calls │ │ │ +00175360: 6361 6e20 6265 206d 6164 6520 746f 2074 can be made to t │ │ │ +00175370: 6865 2073 6572 7665 7220 7768 696c 6520 he server while │ │ │ +00175380: 6b65 6570 696e 6720 7468 6520 636f 6e6e keeping the conn │ │ │ +00175390: 6563 7469 6f6e 206f 7065 6e2e 2043 6c69 ection open. Cli │ │ │ +001753a0: 656e 7420 7374 7562 2066 756e 6374 696f ent stub functio │ │ │ +001753b0: 6e73 2070 6f6c 6c20 7468 6520 7365 7276 ns poll the serv │ │ │ +001753c0: 6572 2074 6f20 6368 6563 6b20 6966 2074 er to check if t │ │ │ +001753d0: 6865 2063 6f6e 6e65 6374 696f 6e20 6973 he connection is │ │ │ +001753e0: 2073 7469 6c6c 206f 7065 6e2e 2057 6865 still open. Whe │ │ │ +001753f0: 6e20 7468 6520 636f 6e6e 6563 7469 6f6e n the connection │ │ │ +00175400: 2077 6173 2074 6572 6d69 6e61 7465 6420 was terminated │ │ │ +00175410: 6279 2074 6865 2073 6572 7665 722c 2074 by the server, t │ │ │ +00175420: 6865 2063 6c69 656e 7420 7769 6c6c 2061 he client will a │ │ │ +00175430: 7574 6f6d 6174 6963 616c 6c79 2072 6563 utomatically rec │ │ │ +00175440: 6f6e 6e65 6374 2e20 3c62 7220 202f 3e0a onnect.
    . │ │ │ +00175450: 3c2f 703e 0a3c 703e 4120 636c 6965 6e74

    .

    A client │ │ │ +00175460: 206d 6179 2063 6c65 6172 2074 6865 203c may clear the < │ │ │ +00175470: 636f 6465 3e23 534f 4150 5f49 4f5f 4b45 code>#SOAP_IO_KE │ │ │ +00175480: 4550 414c 4956 453c 2f63 6f64 653e 2066 EPALIVE f │ │ │ +00175490: 6c61 6720 6a75 7374 2062 6566 6f72 6520 lag just before │ │ │ +001754a0: 7468 6520 6c61 7374 2063 616c 6c20 746f the last call to │ │ │ +001754b0: 2061 2073 6572 7665 7220 746f 206c 6574 a server to let │ │ │ +001754c0: 2074 6865 2073 6572 7665 7220 6b6e 6f77 the server know │ │ │ +001754d0: 2069 7420 7761 6e74 7320 746f 2063 6c6f it wants to clo │ │ │ +001754e0: 7365 2074 6865 2063 6f6e 6e65 6374 696f se the connectio │ │ │ +001754f0: 6e20 6166 7465 7220 7468 6973 206c 6173 n after this las │ │ │ +00175500: 7420 6361 6c6c 2e20 5468 6973 2077 696c t call. This wil │ │ │ +00175510: 6c20 636c 6f73 6520 7468 6520 736f 636b l close the sock │ │ │ +00175520: 6574 2061 6674 6572 2074 6865 2063 616c et after the cal │ │ │ +00175530: 6c20 616e 6420 616c 736f 2069 6e66 6f72 l and also infor │ │ │ +00175540: 6d73 2074 6865 2073 6572 7665 7220 746f ms the server to │ │ │ +00175550: 2067 7261 6365 6675 6c6c 7920 636c 6f73 gracefully clos │ │ │ +00175560: 6520 7468 6520 636f 6e6e 6563 7469 6f6e e the connection │ │ │ +00175570: 2e3c 2f70 3e0a 3c70 3e54 6865 2063 6c69 .

    .

    The cli │ │ │ +00175580: 656e 742d 7369 6465 2063 616e 2061 6c73 ent-side can als │ │ │ +00175590: 6f20 7365 7420 7468 6520 5443 5020 6b65 o set the TCP ke │ │ │ +001755a0: 6570 2d61 6c69 7665 2073 6f63 6b65 7420 ep-alive socket │ │ │ +001755b0: 7072 6f70 6572 7469 6573 2c20 7573 696e properties, usin │ │ │ +001755c0: 6720 7468 6520 3c63 6f64 653e 3c61 2063 g the soap::tcp_ke │ │ │ +00175690: 6570 5f61 6c69 7665 3c2f 613e 3c2f 636f ep_alive flag (set to │ │ │ +001756b0: 2031 2074 6f20 656e 6162 6c65 292c 203c 1 to enable), < │ │ │ +001756c0: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soap::tcp_ke │ │ │ +00175770: 6570 5f69 646c 653c 2f61 3e3c 2f63 6f64 ep_idle to set the TCP_KEEPIDLE │ │ │ +001757a0: 3c2f 636f 6465 3e20 7661 6c75 652c 203c value, < │ │ │ +001757b0: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soap::tcp_k │ │ │ +00175860: 6565 705f 696e 7476 6c3c 2f61 3e3c 2f63 eep_intvl to set the │ │ │ +00175880: 3c63 6f64 653e 5443 505f 4b45 4550 494e TCP_KEEPIN │ │ │ +00175890: 5456 4c3c 2f63 6f64 653e 2076 616c 7565 TVL value │ │ │ +001758a0: 2c20 616e 6420 3c63 6f64 653e 3c61 2063 , and soap:: │ │ │ +00175950: 7463 705f 6b65 6570 5f63 6e74 3c2f 613e tcp_keep_cnt │ │ │ +00175960: 3c2f 636f 6465 3e20 746f 2073 6574 2074 to set t │ │ │ +00175970: 6865 203c 636f 6465 3e54 4350 5f4b 4545 he TCP_KEE │ │ │ +00175980: 5043 4e54 3c2f 636f 6465 3e20 7661 6c75 PCNT valu │ │ │ +00175990: 652e 3c2f 703e 0a3c 703e 4966 2061 2063 e.

    .

    If a c │ │ │ +001759a0: 6c69 656e 7420 6973 2069 6e20 7468 6520 lient is in the │ │ │ +001759b0: 6d69 6464 6c65 206f 6620 736f 6170 2063 middle of soap c │ │ │ +001759c0: 616c 6c20 7468 6174 206d 6967 6874 2074 all that might t │ │ │ +001759d0: 616b 6520 6120 6c6f 6e67 2074 696d 6520 ake a long time │ │ │ +001759e0: 616e 6420 7468 6520 7365 7276 6572 2067 and the server g │ │ │ +001759f0: 6f65 7320 6177 6179 2f64 6f77 6e20 7468 oes away/down th │ │ │ +00175a00: 6520 6361 6c6c 6572 2064 6f65 7320 6e6f e caller does no │ │ │ +00175a10: 7420 6765 7420 616e 7920 6665 6564 6261 t get any feedba │ │ │ +00175a20: 636b 2075 6e74 696c 2074 6865 203c 636f ck until the so │ │ │ +00175ae0: 6170 3a3a 7265 6376 5f74 696d 656f 7574 ap::recv_timeout │ │ │ +00175af0: 3c2f 613e 3c2f 636f 6465 3e20 6973 2072 is r │ │ │ +00175b00: 6561 6368 6564 2e20 456e 6162 6c69 6e67 eached. Enabling │ │ │ +00175b10: 2054 4350 206b 6565 7020 616c 6976 6520 TCP keep alive │ │ │ +00175b20: 6f6e 2073 7973 7465 6d73 2074 6861 7420 on systems that │ │ │ +00175b30: 7375 7070 6f72 7420 6974 2061 6c6c 6f77 support it allow │ │ │ +00175b40: 7320 666f 7220 6120 6661 7374 6572 2063 s for a faster c │ │ │ +00175b50: 6f6e 6e65 6374 696f 6e20 7465 6172 646f onnection teardo │ │ │ +00175b60: 776e 2064 6574 6563 7469 6f6e 2066 6f72 wn detection for │ │ │ +00175b70: 2061 7070 6c69 6361 7469 6f6e 7320 7468 applications th │ │ │ +00175b80: 6174 206e 6565 6420 6974 2e3c 2f70 3e0a at need it.

    . │ │ │ +00175b90: 3c70 3ef0 9f94 9d20 3c61 2068 7265 663d

    .... Back to tabl │ │ │ +00175bb0: 6520 6f66 2063 6f6e 7465 6e74 733c 2f61 e of contents

    .

    .HT │ │ │ +00175bf0: 5450 2063 6875 6e6b 6564 2074 7261 6e73 TP chunked trans │ │ │ +00175c00: 6665 7220 656e 636f 6469 6e67 3c2f 6832 fer encoding

    .

    Outbound HT │ │ │ +00175c20: 5450 206d 6573 7361 6765 7320 6172 6520 TP messages are │ │ │ +00175c30: 6e6f 7420 6368 756e 6b65 6420 756e 6c65 not chunked unle │ │ │ +00175c40: 7373 2074 6865 203c 636f 6465 3e23 534f ss the #SO │ │ │ +00175c50: 4150 5f49 4f5f 4348 554e 4b3c 2f63 6f64 AP_IO_CHUNK flag is enabl │ │ │ +00175c70: 6564 2e20 4368 756e 6b69 6e67 206d 6179 ed. Chunking may │ │ │ +00175c80: 2069 6d70 726f 7665 2074 6865 2073 7065 improve the spe │ │ │ +00175c90: 6564 206f 6620 6d65 7373 6167 6520 7365 ed of message se │ │ │ +00175ca0: 6e64 696e 6720 7769 7468 2048 5454 502c nding with HTTP, │ │ │ +00175cb0: 2062 6563 6175 7365 2074 6865 206d 6573 because the mes │ │ │ +00175cc0: 7361 6765 206c 656e 6774 6820 646f 6573 sage length does │ │ │ +00175cd0: 206e 6f74 206e 6565 6420 746f 2062 6520 not need to be │ │ │ +00175ce0: 6465 7465 726d 696e 6564 2069 6e20 6164 determined in ad │ │ │ +00175cf0: 7661 6e63 6520 666f 7220 7468 6520 4854 vance for the HT │ │ │ +00175d00: 5450 2063 6f6e 7465 6e74 206c 656e 6774 TP content lengt │ │ │ +00175d10: 6820 6865 6164 6572 2e3c 2f70 3e0a 3c70 h header.

    .

    .... Back to table │ │ │ +00175d40: 6f66 2063 6f6e 7465 6e74 733c 2f61 3e3c of contents< │ │ │ +00175d50: 2f70 3e0a 3c68 323e 3c61 2063 6c61 7373 /p>.

    .HTT │ │ │ +00175d80: 5020 6275 6666 6572 6564 2073 656e 6473 P buffered sends │ │ │ +00175d90: 3c2f 6832 3e0a 3c70 3e54 6865 2065 6e74

    .

    The ent │ │ │ +00175da0: 6972 6520 6f75 7462 6f75 6e64 206d 6573 ire outbound mes │ │ │ +00175db0: 7361 6765 2063 616e 2062 6520 7374 6f72 sage can be stor │ │ │ +00175dc0: 6564 2069 6e20 6120 6275 6666 6572 2074 ed in a buffer t │ │ │ +00175dd0: 6f20 6465 7465 726d 696e 6520 7468 6520 o determine the │ │ │ +00175de0: 4854 5450 2063 6f6e 7465 6e74 206c 656e HTTP content len │ │ │ +00175df0: 6774 6820 7261 7468 6572 2074 6861 6e20 gth rather than │ │ │ +00175e00: 7468 6520 7477 6f2d 7068 6173 6520 656e the two-phase en │ │ │ +00175e10: 636f 6469 6e67 2075 7365 6420 6279 2067 coding used by g │ │ │ +00175e20: 534f 4150 2063 6c69 656e 742d 7369 6465 SOAP client-side │ │ │ +00175e30: 2073 7475 6220 6675 6e63 7469 6f6e 7320 stub functions │ │ │ +00175e40: 616e 6420 7365 7276 6572 2d73 6964 6520 and server-side │ │ │ +00175e50: 736b 656c 6574 6f6e 2066 756e 6374 696f skeleton functio │ │ │ +00175e60: 6e73 2067 656e 6572 6174 6564 2062 7920 ns generated by │ │ │ +00175e70: 736f 6170 6370 7032 2c20 7768 6963 6820 soapcpp2, which │ │ │ +00175e80: 7065 7266 6f72 6d20 6120 7365 7061 7261 perform a separa │ │ │ +00175e90: 7465 2070 6173 7320 6f76 6572 2074 6865 te pass over the │ │ │ +00175ea0: 2064 6174 6120 746f 2064 6574 6572 6d69 data to determi │ │ │ +00175eb0: 6e65 2074 6865 206c 656e 6774 6820 6f66 ne the length of │ │ │ +00175ec0: 2074 6865 206f 7574 626f 756e 6420 6d65 the outbound me │ │ │ +00175ed0: 7373 6167 652e 2053 6574 7469 6e67 2074 ssage. Setting t │ │ │ +00175ee0: 6865 2066 6c61 6720 3c63 6f64 653e 2353 he flag #S │ │ │ +00175ef0: 4f41 505f 494f 5f53 544f 5245 3c2f 636f OAP_IO_STORE for the outp │ │ │ +00175f10: 7574 206d 6f64 6520 7769 6c6c 2062 7566 ut mode will buf │ │ │ +00175f20: 6665 7220 7468 6520 656e 7469 7265 206d fer the entire m │ │ │ +00175f30: 6573 7361 6765 2e20 5468 6973 206d 6179 essage. This may │ │ │ +00175f40: 206f 7220 6d61 7920 6e6f 7420 7370 6565 or may not spee │ │ │ +00175f50: 6420 7570 2074 6865 2074 7261 6e73 6d69 d up the transmi │ │ │ +00175f60: 7373 696f 6e20 6f66 206d 6573 7361 6765 ssion of message │ │ │ +00175f70: 732c 2064 6570 656e 6469 6e67 206f 6e20 s, depending on │ │ │ +00175f80: 7468 6520 636f 6e74 656e 742c 2062 7574 the content, but │ │ │ +00175f90: 206d 6179 2072 6571 7569 7265 2073 6967 may require sig │ │ │ +00175fa0: 6e69 6669 6361 6e74 2073 746f 7261 6765 nificant storage │ │ │ +00175fb0: 2073 7061 6365 2074 6f20 686f 6c64 206c space to hold l │ │ │ +00175fc0: 6172 6765 206d 6573 7361 6765 7320 7465 arge messages te │ │ │ +00175fd0: 6d70 6f72 6172 696c 792e 3c2f 703e 0a3c mporarily.

    .< │ │ │ +00175fe0: 703e f09f 949d 203c 6120 6872 6566 3d22 p>.... Back to table │ │ │ +00176000: 206f 6620 636f 6e74 656e 7473 3c2f 613e of contents │ │ │ +00176010: 3c2f 703e 0a3c 6832 3e3c 6120 636c 6173

    .

    < │ │ │ +00176040: 2f61 3e0a 4854 5450 2061 7574 6865 6e74 /a>.HTTP authent │ │ │ +00176050: 6963 6174 696f 6e3c 2f68 323e 0a3c 703e ication

    .

    │ │ │ +00176060: 5468 6520 666f 6c6c 6f77 696e 6720 7365 The following se │ │ │ +00176070: 6374 696f 6e73 2065 7870 6c61 696e 2068 ctions explain h │ │ │ +00176080: 6f77 2074 6f20 6175 7468 656e 7469 6361 ow to authentica │ │ │ +00176090: 7465 2077 6974 6820 4854 5450 2062 6561 te with HTTP bea │ │ │ +001760a0: 7265 722c 2062 6173 6963 2c20 6469 6765 rer, basic, dige │ │ │ +001760b0: 7374 2c20 616e 6420 4e54 4c4d 2e20 5072 st, and NTLM. Pr │ │ │ +001760c0: 6f78 7920 6175 7468 656e 7469 6361 7469 oxy authenticati │ │ │ +001760d0: 6f6e 2069 7320 616c 736f 2063 6f76 6572 on is also cover │ │ │ +001760e0: 6564 2e3c 2f70 3e0a 3c70 3e59 6f75 2063 ed.

    .

    You c │ │ │ +001760f0: 6f75 6c64 2061 6c73 6f20 7573 6520 7468 ould also use th │ │ │ +00176100: 6520 5769 6e49 6e65 7420 706c 7567 696e e WinInet plugin │ │ │ +00176110: 2061 7661 696c 6162 6c65 2069 6e20 7468 available in th │ │ │ +00176120: 6520 3c65 6d3e 3c63 6f64 653e 6773 6f61 e gsoa │ │ │ +00176130: 702f 6d6f 645f 6773 6f61 703c 2f63 6f64 p/mod_gsoap director │ │ │ +00176150: 7920 6f66 2074 6865 2067 534f 4150 2073 y of the gSOAP s │ │ │ +00176160: 6f75 7263 6520 636f 6465 2070 6163 6b61 ource code packa │ │ │ +00176170: 6765 2074 6f20 7369 6d70 6c69 6679 2049 ge to simplify I │ │ │ +00176180: 6e74 6572 6e65 7420 6163 6365 7373 2066 nternet access f │ │ │ +00176190: 6f72 2067 534f 4150 2063 6c69 656e 7420 or gSOAP client │ │ │ +001761a0: 6170 706c 6963 6174 696f 6e73 2061 6e64 applications and │ │ │ +001761b0: 2064 6561 6c20 7769 7468 2065 6e63 7279 deal with encry │ │ │ +001761c0: 7074 696f 6e2c 2070 726f 7869 6573 2c20 ption, proxies, │ │ │ +001761d0: 616e 6420 6175 7468 656e 7469 6361 7469 and authenticati │ │ │ +001761e0: 6f6e 2c20 7365 6520 7468 6520 6753 4f41 on, see the gSOA │ │ │ +001761f0: 5020 3c61 2068 7265 663d 222e 2e2f 2e2e P WinIne │ │ │ +00176220: 7420 706c 7567 696e 3c2f 613e 2064 6f63 t plugin doc │ │ │ +00176230: 756d 656e 7461 7469 6f6e 2e3c 2f70 3e0a umentation.

    . │ │ │ +00176240: 3c70 3e54 6865 2067 534f 4150 2043 5552

    The gSOAP CUR │ │ │ +00176250: 4c20 706c 7567 696e 2063 616e 2061 6c73 L plugin can als │ │ │ +00176260: 6f20 6265 2075 7365 6420 746f 2064 6576 o be used to dev │ │ │ +00176270: 656c 6f70 2067 534f 4150 2063 6c69 656e elop gSOAP clien │ │ │ +00176280: 7420 6170 706c 6963 6174 696f 6e73 2061 t applications a │ │ │ +00176290: 6e64 2043 5552 4c20 696d 706c 656d 656e nd CURL implemen │ │ │ +001762a0: 7473 2076 6172 696f 7573 2048 5454 5020 ts various HTTP │ │ │ +001762b0: 6175 7468 656e 7469 6361 7469 6f6e 206d authentication m │ │ │ +001762c0: 6574 686f 6473 2c20 7365 6520 7468 6520 ethods, see the │ │ │ +001762d0: 6753 4f41 5020 3c61 2068 7265 663d 222e gSOAP CURL │ │ │ +00176300: 706c 7567 696e 3c2f 613e 2064 6f63 756d plugin docum │ │ │ +00176310: 656e 7461 7469 6f6e 2e3c 2f70 3e0a 3c70 entation.

    .

    .... Back to table │ │ │ +00176340: 6f66 2063 6f6e 7465 6e74 733c 2f61 3e3c of contents< │ │ │ +00176350: 2f70 3e0a 3c68 333e 3c61 2063 6c61 7373 /p>.

    .HTTP be │ │ │ +00176390: 6172 6572 2061 7574 6865 6e74 6963 6174 arer authenticat │ │ │ +001763a0: 696f 6e3c 2f68 333e 0a3c 703e 4854 5450 ion

    .

    HTTP │ │ │ +001763b0: 2062 6561 7265 7220 6175 7468 656e 7469 bearer authenti │ │ │ +001763c0: 6361 7469 6f6e 2069 7320 656e 6162 6c65 cation is enable │ │ │ +001763d0: 6420 6174 2074 6865 2063 6c69 656e 742d d at the client- │ │ │ +001763e0: 7369 6465 2062 7920 7365 7474 696e 6720 side by setting │ │ │ +001763f0: 7468 6520 3c63 6f64 653e 3c61 2063 6c61 the soap::bearer string │ │ │ +001764d0: 2074 6f20 7468 6520 6265 6172 6572 2074 to the bearer t │ │ │ +001764e0: 6f6b 656e 3a3c 2f70 3e0a 3c64 6976 2063 oken:

    .
    │ │ │ +00176500: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    struct < │ │ │ +00176530: 2f73 7061 6e3e 3c61 2063 6c61 7373 3d22 /span>soa │ │ │ +00176560: 703c 2f61 3e20 2a3c 6120 636c 6173 733d p *so │ │ │ +00176590: 6170 3c2f 613e 203d 203c 6120 636c 6173 ap = so │ │ │ +001765f0: 6170 5f6e 6577 3c2f 613e 2829 3b20 3c2f ap_new(); .
    so │ │ │ +00176640: 6170 3c2f 613e 2d26 6774 3b3c 6120 636c ap->bearer = │ │ │ +001766a0: 203c 7370 616e 2063 6c61 7373 3d22 7374 &qu │ │ │ +001766c0: 6f74 3b2e 2e2e 2671 756f 743b 3c2f 7370 ot;...";
    .
    if (soap_call_ns_ │ │ │ +00176720: 5f77 6562 6d65 7468 6f64 283c 6120 636c _webmethod(soap, ...) │ │ │ +00176760: 293c 2f64 6976 3e0a 3c64 6976 2063 6c61 )
    .
    ... │ │ │ +00176780: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // error
    .
    else
    .
    .. │ │ │ +00176800: 2e20 3c73 7061 6e20 636c 6173 733d 2263 . // OK
    .
    co │ │ │ +001768f0: 6e73 7420 6368 6172 202a 2062 6561 7265 nst char * beare │ │ │ +00176900: 723c 2f64 6976 3e3c 6469 7620 636c 6173 r
    User-d │ │ │ +00176920: 6566 696e 6162 6c65 2048 5454 5020 6175 efinable HTTP au │ │ │ +00176930: 7468 6f72 697a 6174 696f 6e20 6265 6172 thorization bear │ │ │ +00176940: 6572 2074 6f6b 656e 2076 616c 7565 2074 er token value t │ │ │ +00176950: 6f20 6265 2073 656e 7420 6279 2074 6865 o be sent by the │ │ │ +00176960: 2063 6c69 656e 742c 2073 6572 7665 7220 client, server │ │ │ +00176970: 7369 6465 2072 6563 6569 7665 7320 742e side receives t. │ │ │ +00176980: 2e2e 3c2f 6469 763e 3c64 6976 2063 6c61 ..
    De │ │ │ +001769a0: 6669 6e69 7469 6f6e 3a3c 2f62 3e20 7374 finition: st │ │ │ +001769b0: 6473 6f61 7032 2e68 3a33 3735 323c 2f64 dsoap2.h:3752
    .
    │ │ │ +001769d0: 3c21 2d2d 2066 7261 676d 656e 7420 2d2d

    A clie │ │ │ +00177670: 6e74 2053 4f41 5020 7265 7175 6573 7420 nt SOAP request │ │ │ +00177680: 7769 6c6c 2068 6176 6520 7468 6520 666f will have the fo │ │ │ +00177690: 6c6c 6f77 696e 6720 4854 5450 2068 6561 llowing HTTP hea │ │ │ +001776a0: 6465 723a 203c 2f70 3e3c 7072 6520 636c der:

    P
    │ │ │ +001776c0: 4f53 5420 2f58 5858 2048 5454 502f 312e  OST /XXX HTTP/1.
    │ │ │ +001776d0: 3120 0a48 6f73 743a 2059 5959 200a 5573  1 .Host: YYY .Us
    │ │ │ +001776e0: 6572 2d41 6765 6e74 3a20 6753 4f41 502f  er-Agent: gSOAP/
    │ │ │ +001776f0: 322e 3820 0a43 6f6e 7465 6e74 2d54 7970  2.8 .Content-Typ
    │ │ │ +00177700: 653a 2074 6578 742f 786d 6c3b 2063 6861  e: text/xml; cha
    │ │ │ +00177710: 7273 6574 3d75 7466 2d38 200a 436f 6e74  rset=utf-8 .Cont
    │ │ │ +00177720: 656e 742d 4c65 6e67 7468 3a20 5a5a 5a20  ent-Length: ZZZ 
    │ │ │ +00177730: 0a41 7574 686f 7269 7a61 7469 6f6e 3a20  .Authorization: 
    │ │ │ +00177740: 4261 7369 6320 5a33 566c 6333 5136 5a33  Basic Z3Vlc3Q6Z3
    │ │ │ +00177750: 566c 6333 513d 200a 3c2f 7072 653e 3c70  Vlc3Q= .

    A client must │ │ │ +00177770: 7365 7420 7468 6520 3c63 6f64 653e 636f set the co │ │ │ +00177780: 6e73 7420 6368 6172 2a20 3c61 2063 6c61 nst char* soap::userid and const char* │ │ │ +00177870: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap::pa │ │ │ +00177930: 7373 7764 3c2f 613e 3c2f 636f 6465 3e20 sswd │ │ │ +00177940: 7374 7269 6e67 7320 666f 7220 6561 6368 strings for each │ │ │ +00177950: 2063 616c 6c20 7468 6174 2072 6571 7569 call that requi │ │ │ +00177960: 7265 7320 636c 6965 6e74 2061 7574 6865 res client authe │ │ │ +00177970: 6e74 6963 6174 696f 6e2e 2054 6865 2073 ntication. The s │ │ │ +00177980: 7472 696e 6773 2061 7265 2072 6573 6574 trings are reset │ │ │ +00177990: 2061 6674 6572 2065 6163 6820 7375 6363 after each succ │ │ │ +001779a0: 6573 7366 756c 206f 7220 756e 7375 6363 essful or unsucc │ │ │ +001779b0: 6573 7366 756c 2063 616c 6c2e 3c2f 703e essful call.

    │ │ │ +001779c0: 0a3c 703e 5768 656e 2070 7265 7365 6e74 .

    When present │ │ │ +001779d0: 2c20 7468 6520 3c63 6f64 653e 5757 572d , the WWW- │ │ │ +001779e0: 4175 7468 656e 7469 6361 7465 3c2f 636f Authenticate HTTP header │ │ │ +00177a00: 7265 7475 726e 6564 2062 7920 7468 6520 returned by the │ │ │ +00177a10: 7365 7276 6572 2077 6974 6820 7468 6520 server with the │ │ │ +00177a20: 6175 7468 656e 7469 6361 7469 6f6e 2072 authentication r │ │ │ +00177a30: 6561 6c6d 2069 7320 7374 6f72 6564 2069 ealm is stored i │ │ │ +00177a40: 6e20 7468 6520 7468 6520 3c63 6f64 653e n the the │ │ │ +00177a50: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap::au │ │ │ +00177b10: 7468 7265 616c 6d3c 2f61 3e3c 2f63 6f64 threalm string. This │ │ │ +00177b30: 6973 2075 7365 6675 6c20 666f 7220 636c is useful for cl │ │ │ +00177b40: 6965 6e74 7320 746f 2075 7365 2074 6869 ients to use thi │ │ │ +00177b50: 7320 646f 6d61 696e 2069 6e66 6f72 6d61 s domain informa │ │ │ +00177b60: 7469 6f6e 2074 6f20 7265 7370 6f6e 6420 tion to respond │ │ │ +00177b70: 746f 2061 7574 6865 6e74 6963 6174 696f to authenticatio │ │ │ +00177b80: 6e20 7265 7175 6573 7473 2e3c 2f70 3e0a n requests.

    . │ │ │ +00177b90: 3c70 3e41 2073 7461 6e64 2d61 6c6f 6e65

    A stand-alone │ │ │ +00177ba0: 2067 534f 4150 2057 6562 2053 6572 7669 gSOAP Web Servi │ │ │ +00177bb0: 6365 2061 7070 6c69 6361 7469 6f6e 2063 ce application c │ │ │ +00177bc0: 616e 2065 6e66 6f72 6365 2048 5454 5020 an enforce HTTP │ │ │ +00177bd0: 6175 7468 656e 7469 6361 7469 6f6e 206f authentication o │ │ │ +00177be0: 6e20 636c 6965 6e74 7320 6279 2063 6865 n clients by che │ │ │ +00177bf0: 636b 696e 6720 7468 6520 3c63 6f64 653e cking the │ │ │ +00177c00: 636f 6e73 7420 6368 6172 2a20 3c61 2063 const char* soap::userid │ │ │ +00177cd0: 3c2f 613e 3c2f 636f 6465 3e20 616e 6420 and │ │ │ +00177ce0: 3c63 6f64 653e 636f 6e73 7420 6368 6172 const char │ │ │ +00177cf0: 2a20 3c61 2063 6c61 7373 3d22 656c 2220 * soap:: │ │ │ +00177db0: 7061 7373 7764 3c2f 613e 3c2f 636f 6465 passwd strings. These │ │ │ +00177dd0: 2073 7472 696e 6773 2061 7265 2073 6574 strings are set │ │ │ +00177de0: 2077 6865 6e20 6120 636c 6965 6e74 2072 when a client r │ │ │ +00177df0: 6571 7565 7374 2063 6f6e 7461 696e 7320 equest contains │ │ │ +00177e00: 4854 5450 2061 7574 6865 6e74 6963 6174 HTTP authenticat │ │ │ +00177e10: 696f 6e20 6865 6164 6572 732e 2054 6865 ion headers. The │ │ │ +00177e20: 2073 7472 696e 6773 2073 686f 756c 6420 strings should │ │ │ +00177e30: 6265 2063 6865 636b 6564 2069 6e20 6561 be checked in ea │ │ │ +00177e40: 6368 2073 6572 7669 6365 206d 6574 686f ch service metho │ │ │ +00177e50: 6420 2874 6861 7420 7265 7175 6972 6573 d (that requires │ │ │ +00177e60: 2061 7574 6865 6e74 6963 6174 696f 6e20 authentication │ │ │ +00177e70: 746f 2065 7865 6375 7465 292e 3c2f 703e to execute).

    │ │ │ +00177e80: 0a3c 703e 4865 7265 2069 7320 616e 2065 .

    Here is an e │ │ │ +00177e90: 7861 6d70 6c65 2073 6572 7669 6365 206d xample service m │ │ │ +00177ea0: 6574 686f 6420 696d 706c 656d 656e 7461 ethod implementa │ │ │ +00177eb0: 7469 6f6e 2074 6861 7420 656e 666f 7263 tion that enforc │ │ │ +00177ec0: 6564 2063 6c69 656e 7420 6175 7468 656e ed client authen │ │ │ +00177ed0: 7469 6361 7469 6f6e 3a3c 2f70 3e0a 3c64 tication:

    .
    │ │ │ +00177f20: 696e 743c 2f73 7061 6e3e 206e 735f 5f77 int ns__w │ │ │ +00177f30: 6562 6d65 7468 6f64 283c 7370 616e 2063 ebmethod(s │ │ │ +00177f50: 7472 7563 743c 2f73 7061 6e3e 203c 6120 truct soap *soap, . │ │ │ +00177fc0: 2e2e 2920 3c2f 6469 763e 0a3c 6469 7620 ..)
    .
    {.
    if (!< │ │ │ +00178020: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +00178030: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ +00178040: 6874 6d6c 223e 736f 6170 3c2f 613e 2d26 html">soap-& │ │ │ +00178050: 6774 3b3c 6120 636c 6173 733d 2263 6f64 gt;user │ │ │ +001780a0: 6964 3c2f 613e 3c2f 6469 763e 0a3c 6469 id
    . │ │ │ +001780c0: 2020 7c7c 2021 3c61 2063 6c61 7373 3d22 || !soa │ │ │ +001780f0: 703c 2f61 3e2d 2667 743b 3c61 2063 6c61 p->passwd.
    || strc │ │ │ +00178170: 6d70 283c 6120 636c 6173 733d 2263 6f64 mp(soap-> │ │ │ +001781f0: 7573 6572 6964 3c2f 613e 2c20 3c73 7061 userid, "gu │ │ │ +00178220: 6573 7426 7175 6f74 3b3c 2f73 7061 6e3e est" │ │ │ +00178230: 293c 2f64 6976 3e0a 3c64 6976 2063 6c61 )
    .
    || │ │ │ +00178250: 7374 7263 6d70 283c 6120 636c 6173 733d strcmp(so │ │ │ +00178280: 6170 3c2f 613e 2d26 6774 3b3c 6120 636c ap->passwd, │ │ │ +001782e0: 3c73 7061 6e20 636c 6173 733d 2273 7472 &quo │ │ │ +00178300: 743b 7669 7369 7426 7175 6f74 3b3c 2f73 t;visit"))
    . │ │ │ +00178330: 2020 7b3c 2f64 6976 3e0a 3c64 6976 2063 {
    .
    │ │ │ +00178350: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap- │ │ │ +00178380: 2667 743b 3c61 2063 6c61 7373 3d22 636f >aut │ │ │ +001783d0: 6872 6561 6c6d 3c2f 613e 203d 203c 7370 hrealm = ". │ │ │ +00178400: 2e2e 2671 756f 743b 3c2f 7370 616e 3e3b .."; │ │ │ +00178410: 203c 7370 616e 2063 6c61 7373 3d22 636f // domain │ │ │ +00178430: 2072 6561 6c6d 2061 6363 6573 7365 6420 realm accessed │ │ │ +00178440: 286f 7074 696f 6e61 6c2c 204e 554c 4c20 (optional, NULL │ │ │ +00178450: 746f 206f 6d69 7429 3c2f 7370 616e 3e3c to omit)< │ │ │ +00178460: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    return 401;
    . │ │ │ +001784b0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    }
    .
    │ │ │ +001784e0: 2e2e 2e20 3c73 7061 6e20 636c 6173 733d ... // web │ │ │ +00178500: 6d65 7468 6f64 206c 6f67 6963 3c2f 7370 method logic
    ..} │ │ │ +001785d0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    │ │ │ +00178620: 3c64 6976 2063 6c61 7373 3d22 7474 6e61 .

    When the a │ │ │ +001787a0: 7574 6865 6e74 6963 6174 696f 6e20 6661 uthentication fa │ │ │ +001787b0: 696c 732c 2074 6865 2073 6572 7669 6365 ils, the service │ │ │ +001787c0: 2072 6573 706f 6e73 6520 7769 7468 2061 response with a │ │ │ +001787d0: 2053 4f41 5020 4661 756c 7420 6d65 7373 SOAP Fault mess │ │ │ +001787e0: 6167 6520 616e 6420 6120 4854 5450 2065 age and a HTTP e │ │ │ +001787f0: 7272 6f72 2063 6f64 6520 2234 3031 2055 rror code "401 U │ │ │ +00178800: 6e61 7574 686f 7269 7a65 6422 2e20 5468 nauthorized". Th │ │ │ +00178810: 6520 4854 5450 2065 7272 6f72 2063 6f64 e HTTP error cod │ │ │ +00178820: 6573 2061 7265 2064 6573 6372 6962 6564 es are described │ │ │ +00178830: 2069 6e20 5365 6374 696f 6e20 3c61 2063 in Section Run-time er │ │ │ +00178870: 726f 7220 636f 6465 733c 2f61 3e20 2e3c ror codes .< │ │ │ +00178880: 2f70 3e0a 3c70 3e54 6f20 7265 7475 726e /p>.

    To return │ │ │ +00178890: 2061 206e 6f6e 2d53 4f41 5020 6572 726f a non-SOAP erro │ │ │ +001788a0: 722c 2075 7365 3a3c 2f70 3e0a 3c64 6976 r, use:

    .

    .... Back to table │ │ │ +001789e0: 6f66 2063 6f6e 7465 6e74 733c 2f61 3e3c of contents< │ │ │ +001789f0: 2f70 3e0a 3c68 333e 3c61 2063 6c61 7373 /p>.

    .HTTP NTLM │ │ │ +00178a30: 2061 7574 6865 6e74 6963 6174 696f 6e3c authentication< │ │ │ +00178a40: 2f68 333e 0a3c 703e 4854 5450 204e 544c /h3>.

    HTTP NTL │ │ │ +00178a50: 4d20 6175 7468 656e 7469 6361 7469 6f6e M authentication │ │ │ +00178a60: 2069 7320 656e 6162 6c65 6420 6174 2074 is enabled at t │ │ │ +00178a70: 6865 2063 6c69 656e 742d 7369 6465 2062 he client-side b │ │ │ +00178a80: 7920 696e 7374 616c 6c69 6e67 203c 636f y installing libntlm from h │ │ │ +00178ad0: 7474 703a 2f2f 7777 772e 6e6f 6e67 6e75 ttp://www.nongnu │ │ │ +00178ae0: 2e6f 7267 2f6c 6962 6e74 6c6d 3c2f 613e .org/libntlm │ │ │ +00178af0: 2061 6e64 2063 6f6d 7069 6c69 6e67 2061 and compiling a │ │ │ +00178b00: 6c6c 2070 726f 6a65 6374 2073 6f75 7263 ll project sourc │ │ │ +00178b10: 6520 636f 6465 7320 7769 7468 2074 6865 e codes with the │ │ │ +00178b20: 2063 6f6d 7069 6c65 2d74 696d 6520 666c compile-time fl │ │ │ +00178b30: 6167 203c 636f 6465 3e23 5749 5448 5f4e ag #WITH_N │ │ │ +00178b40: 544c 4d3c 2f63 6f64 653e 2e3c 2f70 3e0a TLM.

    . │ │ │ +00178b50: 3c70 3e49 6e20 796f 7572 2061 7070 6c69

    In your appli │ │ │ +00178b60: 6361 7469 6f6e 2063 6f64 6520 7365 7420 cation code set │ │ │ +00178b70: 7468 6520 3c63 6f64 653e 636f 6e73 7420 the const │ │ │ +00178b80: 6368 6172 2a20 3c61 2063 6c61 7373 3d22 char* so │ │ │ +00178c40: 6170 3a3a 7573 6572 6964 3c2f 613e 3c2f ap::userid and │ │ │ +00178c60: 636f 6e73 7420 6368 6172 2a20 3c61 2063 const char* soap::passwd │ │ │ +00178d30: 3c2f 613e 3c2f 636f 6465 3e20 7374 7269 stri │ │ │ +00178d40: 6e67 7320 746f 2061 2075 7365 726e 616d ngs to a usernam │ │ │ +00178d50: 6520 616e 6420 7061 7373 776f 7264 2e20 e and password. │ │ │ +00178d60: 4120 7365 7276 6572 206d 6179 2072 6571 A server may req │ │ │ +00178d70: 7565 7374 204e 544c 4d20 6175 7468 656e uest NTLM authen │ │ │ +00178d80: 7469 6361 7469 6f6e 2061 6e64 2064 656e tication and den │ │ │ +00178d90: 6965 7320 6163 6365 7373 2028 4854 5450 ies access (HTTP │ │ │ +00178da0: 2034 3031 2061 7574 6865 6e74 6963 6174 401 authenticat │ │ │ +00178db0: 696f 6e20 7265 7175 6972 6564 206f 7220 ion required or │ │ │ +00178dc0: 4854 5450 2034 3037 2048 5454 5020 7072 HTTP 407 HTTP pr │ │ │ +00178dd0: 6f78 7920 6175 7468 656e 7469 6361 7469 oxy authenticati │ │ │ +00178de0: 6f6e 2072 6571 7569 7265 6429 2077 6865 on required) whe │ │ │ +00178df0: 6e20 7468 6520 636c 6965 6e74 2074 7269 n the client tri │ │ │ +00178e00: 6573 2074 6f20 636f 6e6e 6563 7420 7769 es to connect wi │ │ │ +00178e10: 7468 6f75 7420 4854 5450 2061 7574 6865 thout HTTP authe │ │ │ +00178e20: 6e74 6963 6174 696f 6e20 286f 7220 7769 ntication (or wi │ │ │ +00178e30: 7468 2074 6865 2077 726f 6e67 2061 7574 th the wrong aut │ │ │ +00178e40: 6865 6e74 6963 6174 696f 6e20 696e 666f hentication info │ │ │ +00178e50: 726d 6174 696f 6e29 2e3c 2f70 3e0a 3c70 rmation).

    .

    Here is an exam │ │ │ +00178e70: 706c 6520 636c 6965 6e74 2063 6f64 6520 ple client code │ │ │ +00178e80: 6672 6167 6d65 6e74 2074 6f20 7365 7420 fragment to set │ │ │ +00178e90: 7468 6520 4e54 4c4d 2061 7574 6865 6e74 the NTLM authent │ │ │ +00178ea0: 6963 6174 696f 6e20 7573 6572 6e61 6d65 ication username │ │ │ +00178eb0: 2061 6e64 2070 6173 7377 6f72 643a 3c2f and password:.

    struct < │ │ │ +00178f10: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +00178f20: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ +00178f30: 6874 6d6c 223e 736f 6170 3c2f 613e 202a html">soap * │ │ │ +00178f40: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap │ │ │ +00178f70: 3d20 3c61 2063 6c61 7373 3d22 636f 6465 = soap_new1 │ │ │ +00178fd0: 3c2f 613e 283c 6120 636c 6173 733d 2263 (SOAP_IO_ │ │ │ +00179030: 4b45 4550 414c 4956 453c 2f61 3e29 3b20 KEEPALIVE); │ │ │ +00179040: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    if (so │ │ │ +00179080: 6170 5f63 616c 6c5f 6e73 5f5f 7765 626d ap_call_ns__webm │ │ │ +00179090: 6574 686f 6428 3c61 2063 6c61 7373 3d22 ethod(soa │ │ │ +001790c0: 703c 2f61 3e2c 202e 2e2e 2929 203c 2f64 p, ...)) .
    {
    . │ │ │ +00179100: 2020 3c73 7061 6e20 636c 6173 733d 226b if (so │ │ │ +00179150: 6170 3c2f 613e 2d26 6774 3b3c 6120 636c ap->error == │ │ │ +001791b0: 2034 3031 2920 3c2f 6469 763e 0a3c 6469 401)
    . │ │ │ +001791d0: 207b 3c2f 6469 763e 0a3c 6469 7620 636c {
    .
    < │ │ │ +001791f0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +00179200: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ +00179210: 6874 6d6c 223e 736f 6170 3c2f 613e 2d26 html">soap-& │ │ │ +00179220: 6774 3b3c 6120 636c 6173 733d 2263 6f64 gt;user │ │ │ +00179270: 6964 3c2f 613e 203d 203c 7370 616e 2063 id = "Zapho │ │ │ +001792a0: 6426 7175 6f74 3b3c 2f73 7061 6e3e 3b20 d"; │ │ │ +001792b0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    soap-> │ │ │ +00179300: 3b3c 6120 636c 6173 733d 2263 6f64 6522 ;passwd │ │ │ +00179350: 3c2f 613e 203d 203c 7370 616e 2063 6c61 = "Beebleb │ │ │ +00179380: 726f 7826 7175 6f74 3b3c 2f73 7061 6e3e rox" │ │ │ +00179390: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
    .
    < │ │ │ +001793b0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ +001793c0: 6f72 6466 6c6f 7722 3e69 663c 2f73 7061 ordflow">if (soap_call_ns │ │ │ +001793e0: 5f5f 7765 626d 6574 686f 6428 3c61 2063 __webmethod(soap, ... │ │ │ +00179420: 2929 203c 2f64 6976 3e0a 3c64 6976 2063 ))
    .
    │ │ │ +00179440: 2020 2e2e 2e20 3c73 7061 6e20 636c 6173 ... // e │ │ │ +00179460: 7272 6f72 3c2f 7370 616e 3e3c 2f64 6976 rror
    .
    else.
    ... │ │ │ +001794d0: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // success │ │ │ +001794f0: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ +00179510: 2020 7d3c 2f64 6976 3e0a 3c64 6976 2063 }
    .
    }.

    Th │ │ │ +00179550: 6520 666f 6c6c 6f77 696e 6720 4e54 4c4d e following NTLM │ │ │ +00179560: 2068 616e 6473 6861 6b65 2062 6574 7765 handshake betwe │ │ │ +00179570: 656e 2074 6865 2063 6c69 656e 7420 4320 en the client C │ │ │ +00179580: 616e 6420 7365 7276 6572 2053 2069 7320 and server S is │ │ │ +00179590: 7065 7266 6f72 6d65 643a 203c 2f70 3e3c performed:

    < │ │ │ +001795a0: 7072 6520 636c 6173 733d 2266 7261 676d pre class="fragm │ │ │ +001795b0: 656e 7422 3e31 3a20 4320 202d 2d26 6774 ent">1: C --> │ │ │ +001795c0: 3b20 5320 2661 6d70 3b20 504f 5354 202e ; S & POST . │ │ │ +001795d0: 2e2e 200a 2020 2020 2020 2020 2020 2020 .. . │ │ │ +001795e0: 2661 6d70 3b20 436f 6e74 656e 742d 5479 & Content-Ty │ │ │ +001795f0: 7065 3a20 7465 7874 2f78 6d6c 3b20 6368 pe: text/xml; ch │ │ │ +00179600: 6172 7365 743d 7574 662d 3820 0a0a 323a arset=utf-8 ..2: │ │ │ +00179610: 2043 2026 6c74 3b2d 2d20 2053 2026 616d C <-- S &am │ │ │ +00179620: 703b 2034 3031 2055 6e61 7574 686f 7269 p; 401 Unauthori │ │ │ +00179630: 7a65 6420 0a20 2020 2020 2020 2020 2020 zed . │ │ │ +00179640: 2026 616d 703b 2057 5757 2d41 7574 6865 & WWW-Authe │ │ │ +00179650: 6e74 6963 6174 653a 204e 544c 4d20 0a0a nticate: NTLM .. │ │ │ +00179660: 333a 2043 2020 2d2d 2667 743b 2053 2026 3: C --> S & │ │ │ +00179670: 616d 703b 2047 4554 202e 2e2e 200a 2020 amp; GET ... . │ │ │ +00179680: 2020 2020 2020 2020 2020 2661 6d70 3b20 & │ │ │ +00179690: 4175 7468 6f72 697a 6174 696f 6e3a 204e Authorization: N │ │ │ +001796a0: 544c 4d20 266c 743b 6261 7365 3634 2d65 TLM <base64-e │ │ │ +001796b0: 6e63 6f64 6564 2074 7970 652d 312d 6d65 ncoded type-1-me │ │ │ +001796c0: 7373 6167 6526 6774 3b20 0a0a 343a 2043 ssage> ..4: C │ │ │ +001796d0: 2026 6c74 3b2d 2d20 2053 2026 616d 703b <-- S & │ │ │ +001796e0: 2034 3031 2055 6e61 7574 686f 7269 7a65 401 Unauthorize │ │ │ +001796f0: 6420 0a20 2020 2020 2020 2020 2020 2026 d . & │ │ │ +00179700: 616d 703b 2057 5757 2d41 7574 6865 6e74 amp; WWW-Authent │ │ │ +00179710: 6963 6174 653a 204e 544c 4d20 266c 743b icate: NTLM < │ │ │ +00179720: 6261 7365 3634 2d65 6e63 6f64 6564 2074 base64-encoded t │ │ │ +00179730: 7970 652d 322d 6d65 7373 6167 6526 6774 ype-2-message> │ │ │ +00179740: 3b20 0a0a 353a 2043 2020 2d2d 2667 743b ; ..5: C --> │ │ │ +00179750: 2053 2026 616d 703b 2050 4f53 5420 2e2e S & POST .. │ │ │ +00179760: 2e20 0a20 2020 2020 2020 2020 2020 2026 . . & │ │ │ +00179770: 616d 703b 2043 6f6e 7465 6e74 2d54 7970 amp; Content-Typ │ │ │ +00179780: 653a 2074 6578 742f 786d 6c3b 2063 6861 e: text/xml; cha │ │ │ +00179790: 7273 6574 3d75 7466 2d38 200a 2020 2020 rset=utf-8 . │ │ │ +001797a0: 2020 2020 2020 2020 2661 6d70 3b20 4175 & Au │ │ │ +001797b0: 7468 6f72 697a 6174 696f 6e3a 204e 544c thorization: NTL │ │ │ +001797c0: 4d20 266c 743b 6261 7365 3634 2d65 6e63 M <base64-enc │ │ │ +001797d0: 6f64 6564 2074 7970 652d 332d 6d65 7373 oded type-3-mess │ │ │ +001797e0: 6167 6526 6774 3b20 0a0a 363a 2043 2026 age> ..6: C & │ │ │ +001797f0: 6c74 3b2d 2d20 2053 2026 616d 703b 2032 lt;-- S & 2 │ │ │ +00179800: 3030 204f 4b0a 3c2f 7072 653e 3c70 3e20 00 OK.

    │ │ │ +00179810: 7768 6572 6520 7374 6167 6573 2031 2061 where stages 1 a │ │ │ +00179820: 6e64 2032 2069 6e64 6963 6174 6573 2061 nd 2 indicates a │ │ │ +00179830: 2063 6c69 656e 7420 6174 7465 6d70 7469 client attempti │ │ │ +00179840: 6e67 2074 6f20 636f 6e6e 6563 7420 7769 ng to connect wi │ │ │ +00179850: 7468 6f75 7420 6175 7468 6f72 697a 6174 thout authorizat │ │ │ +00179860: 696f 6e20 696e 666f 726d 6174 696f 6e2c ion information, │ │ │ +00179870: 2077 6869 6368 2069 7320 7468 6520 6669 which is the fi │ │ │ +00179880: 7273 7420 6d65 7468 6f64 2063 616c 6c20 rst method call │ │ │ +00179890: 696e 2074 6865 2063 6f64 6520 6162 6f76 in the code abov │ │ │ +001798a0: 652e 2053 7461 6765 2033 2074 6f20 3620 e. Stage 3 to 6 │ │ │ +001798b0: 6861 7070 656e 2077 6974 6820 7468 6520 happen with the │ │ │ +001798c0: 7072 6f70 6572 2063 6c69 656e 7420 6175 proper client au │ │ │ +001798d0: 7468 656e 7469 6361 7469 6f6e 2073 6574 thentication set │ │ │ +001798e0: 2077 6974 6820 3c63 6f64 653e 636f 6e73 with cons │ │ │ +001798f0: 7420 6368 6172 2a20 3c61 2063 6c61 7373 t char* │ │ │ +001799b0: 736f 6170 3a3a 7573 6572 6964 3c2f 613e soap::userid │ │ │ +001799c0: 3c2f 636f 6465 3e20 616e 6420 3c63 6f64 and const char* soap::pass │ │ │ +00179aa0: 7764 3c2f 613e 3c2f 636f 6465 3e2e 204f wd. O │ │ │ +00179ab0: 7074 696f 6e61 6c6c 792c 2074 6865 203c ptionally, the < │ │ │ +00179ac0: 636f 6465 3e63 6f6e 7374 2063 6861 722a code>const char* │ │ │ +00179ad0: 203c 6120 636c 6173 733d 2265 6c22 2068 soap::a │ │ │ +00179b90: 7574 6872 6561 6c6d 3c2f 613e 3c2f 636f uthrealm string shoul │ │ │ +00179bb0: 6420 6265 2073 6574 2061 7320 7765 6c6c d be set as well │ │ │ +00179bc0: 2074 6f20 696e 6469 6361 7465 2074 6865 to indicate the │ │ │ +00179bd0: 2064 6f6d 6169 6e20 6163 6365 7373 6564 domain accessed │ │ │ +00179be0: 2028 7468 6973 2073 7472 696e 6720 6973 (this string is │ │ │ +00179bf0: 206e 6f72 6d61 6c6c 7920 7365 7420 7768 normally set wh │ │ │ +00179c00: 656e 2074 6865 2073 6572 7665 7220 7265 en the server re │ │ │ +00179c10: 7370 6f6e 6473 2077 6974 6820 4854 5450 sponds with HTTP │ │ │ +00179c20: 2034 3031 2073 6f20 7468 6520 636c 6965 401 so the clie │ │ │ +00179c30: 6e74 2072 6563 6569 7665 7320 7468 6973 nt receives this │ │ │ +00179c40: 2073 6572 7665 7220 646f 6d61 696e 2069 server domain i │ │ │ +00179c50: 6e66 6f72 6d61 7469 6f6e 292e 204e 544c nformation). NTL │ │ │ +00179c60: 4d20 6175 7468 656e 7469 6361 7465 7320 M authenticates │ │ │ +00179c70: 636f 6e6e 6563 7469 6f6e 732c 206e 6f74 connections, not │ │ │ +00179c80: 2072 6571 7565 7374 732e 2057 6865 6e20 requests. When │ │ │ +00179c90: 7468 6520 636f 6e6e 6563 7469 6f6e 2069 the connection i │ │ │ +00179ca0: 7320 6b65 7074 2061 6c69 7665 2c20 7375 s kept alive, su │ │ │ +00179cb0: 6273 6571 7565 6e74 206d 6573 7361 6765 bsequent message │ │ │ +00179cc0: 7320 6361 6e20 6265 2065 7863 6861 6e67 s can be exchang │ │ │ +00179cd0: 6564 2077 6974 686f 7574 2072 652d 6175 ed without re-au │ │ │ +00179ce0: 7468 656e 7469 6361 7469 6f6e 2e3c 2f70 thentication.

    .

    To avoid th │ │ │ +00179d00: 6520 6f76 6572 6865 6164 206f 6620 7468 e overhead of th │ │ │ +00179d10: 6520 6669 7273 7420 7265 6a65 6374 6564 e first rejected │ │ │ +00179d20: 2063 616c 6c2c 2075 7365 3a3c 2f70 3e0a call, use:

    . │ │ │ +00179d30: 3c64 6976 2063 6c61 7373 3d22 6672 6167
    st │ │ │ +00179d70: 7275 6374 203c 2f73 7061 6e3e 3c61 2063 ruct soap *soap = < │ │ │ +00179de0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +00179df0: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ +00179e00: 705f 5f63 6f6e 7465 7874 2e68 746d 6c23 p__context.html# │ │ │ +00179e10: 6761 3531 6364 6531 3338 3233 3465 6437 ga51cde138234ed7 │ │ │ +00179e20: 6563 3863 3465 3235 6264 6636 3431 3836 ec8c4e25bdf64186 │ │ │ +00179e30: 3538 223e 736f 6170 5f6e 6577 313c 2f61 58">soap_new1(SOAP_IO_KEE │ │ │ +00179ea0: 5041 4c49 5645 3c2f 613e 293b 203c 2f64 PALIVE); .. │ │ │ +00179f90: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    soap->u │ │ │ +0017a020: 7365 7269 643c 2f61 3e20 3d20 3c73 7061 serid = "Za │ │ │ +0017a050: 7068 6f64 2671 756f 743b 3c2f 7370 616e phod";
    ..
    soap->authrealm │ │ │ +0017a1e0: 3c2f 613e 203d 203c 7370 616e 2063 6c61 = "Ursa-Mi │ │ │ +0017a210: 6e6f 7226 7175 6f74 3b3c 2f73 7061 6e3e nor" │ │ │ +0017a220: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
    .
    if ( │ │ │ +0017a260: 736f 6170 5f63 616c 6c5f 6e73 5f5f 7765 soap_call_ns__we │ │ │ +0017a270: 626d 6574 686f 6428 3c61 2063 6c61 7373 bmethod(s │ │ │ +0017a2a0: 6f61 703c 2f61 3e2c 202e 2e2e 2929 203c oap, ...)) < │ │ │ +0017a2b0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    ... // error
    .
    else
    .
    ... │ │ │ +0017a350: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // success │ │ │ +0017a370: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    .
    soap::ntl │ │ │ +0017a420: 6d5f 6368 616c 6c65 6e67 653c 2f61 3e3c m_challenge< │ │ │ +0017a430: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
    const c │ │ │ +0017a450: 6861 7220 2a20 6e74 6c6d 5f63 6861 6c6c har * ntlm_chall │ │ │ +0017a460: 656e 6765 3c2f 6469 763e 3c64 6976 2063 enge
    Use │ │ │ +0017a480: 722d 6465 6669 6e61 626c 6520 4e54 4c4d r-definable NTLM │ │ │ +0017a490: 2061 7574 6865 6e74 6963 6174 696f 6e20 authentication │ │ │ +0017a4a0: 6368 616c 6c65 6e67 6520 6b65 7920 7374 challenge key st │ │ │ +0017a4b0: 7269 6e67 2e3c 2f64 6976 3e3c 6469 7620 ring.
    Definition: │ │ │ +0017a4e0: 2073 7464 736f 6170 322e 683a 3338 3738 stdsoap2.h:3878 │ │ │ +0017a4f0: 3c2f 6469 763e 3c2f 6469 763e 0a3c 2f64
    .

    When the │ │ │ +0017a520: 6175 7468 656e 7469 6361 7469 6f6e 2066 authentication f │ │ │ +0017a530: 6169 6c73 2028 7374 6167 6520 3120 616e ails (stage 1 an │ │ │ +0017a540: 6420 3229 2c20 7468 6520 7365 7276 6963 d 2), the servic │ │ │ +0017a550: 6520 7265 7370 6f6e 7365 2077 6974 6820 e response with │ │ │ +0017a560: 4854 5450 2065 7272 6f72 2063 6f64 6520 HTTP error code │ │ │ +0017a570: 2234 3031 2055 6e61 7574 686f 7269 7a65 "401 Unauthorize │ │ │ +0017a580: 6422 2061 6e64 203c 636f 6465 3e3c 6120 d" and soap::error is set │ │ │ +0017a650: 2074 6f20 4854 5450 2063 6f64 6520 3430 to HTTP code 40 │ │ │ +0017a660: 312e 3c2f 703e 0a3c 703e f09f 949d 203c 1.

    .

    .... < │ │ │ +0017a670: 6120 6872 6566 3d22 2322 3e42 6163 6b20 a href="#">Back │ │ │ +0017a680: 746f 2074 6162 6c65 206f 6620 636f 6e74 to table of cont │ │ │ +0017a690: 656e 7473 3c2f 613e 3c2f 703e 0a3c 6833 ents

    .

    │ │ │ +0017a6d0: 3c2f 613e 0a48 5454 5020 7072 6f78 7920 .HTTP proxy │ │ │ +0017a6e0: 4e54 4c4d 2061 7574 6865 6e74 6963 6174 NTLM authenticat │ │ │ +0017a6f0: 696f 6e3c 2f68 333e 0a3c 703e 466f 7220 ion

    .

    For │ │ │ +0017a700: 4854 5450 2034 3037 2050 726f 7879 2041 HTTP 407 Proxy A │ │ │ +0017a710: 7574 6865 6e74 6963 6174 696f 6e20 5265 uthentication Re │ │ │ +0017a720: 7175 6972 6564 2073 6574 2074 6865 203c quired set the < │ │ │ +0017a730: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soap::proxy_ │ │ │ +0017a7f0: 7573 6572 6964 3c2f 613e 3c2f 636f 6465 userid and soap │ │ │ +0017a8c0: 3a3a 7072 6f78 795f 7061 7373 7764 3c2f ::proxy_passwd:

    .< │ │ │ +0017a8e0: 6469 7620 636c 6173 733d 2266 7261 676d div class="fragm │ │ │ +0017a8f0: 656e 7422 3e3c 6469 7620 636c 6173 733d ent">
    str │ │ │ +0017a920: 7563 7420 3c2f 7370 616e 3e3c 6120 636c uct soap *soap = soap_new1 │ │ │ +0017a9f0: 283c 6120 636c 6173 733d 2263 6f64 6522 (SOAP_IO_KEEP │ │ │ +0017aa50: 414c 4956 453c 2f61 3e29 3b20 3c2f 6469 ALIVE); .
    soap │ │ │ +0017aaa0: 3c2f 613e 2d26 6774 3b3c 6120 636c 6173 ->proxy_host │ │ │ +0017ab00: 203d 203c 7370 616e 2063 6c61 7373 3d22 = & │ │ │ +0017ab20: 7175 6f74 3b2e 2e2e 2671 756f 743b 3c2f quot;...";
    . │ │ │ +0017ab50: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap- │ │ │ +0017ab80: 2667 743b 3c61 2063 6c61 7373 3d22 636f >pro │ │ │ +0017abd0: 7879 5f70 6f72 743c 2f61 3e20 3d20 2e2e xy_port = .. │ │ │ +0017abe0: 2e3b 203c 2f64 6976 3e0a 3c64 6976 2063 .;
    .
    if │ │ │ +0017ac20: 2873 6f61 705f 6361 6c6c 5f6e 735f 5f77 (soap_call_ns__w │ │ │ +0017ac30: 6562 6d65 7468 6f64 283c 6120 636c 6173 ebmethod( │ │ │ +0017ac60: 736f 6170 3c2f 613e 2c20 2e2e 2e29 2920 soap, ...)) │ │ │ +0017ac70: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    {
    │ │ │ +0017ac90: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    i │ │ │ +0017acc0: 663c 2f73 7061 6e3e 2028 3c61 2063 6c61 f (soap->error │ │ │ +0017ad50: 203d 3d20 3430 3729 203c 2f64 6976 3e0a == 407)
    . │ │ │ +0017ad60: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    {
    .
    │ │ │ +0017ad90: 2020 3c61 2063 6c61 7373 3d22 636f 6465 soap->p │ │ │ +0017ae10: 726f 7879 5f75 7365 7269 643c 2f61 3e20 roxy_userid │ │ │ +0017ae20: 3d20 3c73 7061 6e20 636c 6173 733d 2273 = &q │ │ │ +0017ae40: 756f 743b 5a61 7068 6f64 2671 756f 743b uot;Zaphod" │ │ │ +0017ae50: 3c2f 7370 616e 3e3b 203c 2f64 6976 3e0a ;
    . │ │ │ +0017ae60: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65 .
    soap-&g │ │ │ +0017af90: 743b 3c61 2063 6c61 7373 3d22 636f 6465 t;authr │ │ │ +0017afe0: 6561 6c6d 3c2f 613e 203d 203c 7370 616e ealm = "Urs │ │ │ +0017b010: 612d 4d69 6e6f 7226 7175 6f74 3b3c 2f73 a-Minor";
    . │ │ │ +0017b040: 2020 203c 7370 616e 2063 6c61 7373 3d22 if< │ │ │ +0017b060: 2f73 7061 6e3e 2028 736f 6170 5f63 616c /span> (soap_cal │ │ │ +0017b070: 6c5f 6e73 5f5f 7765 626d 6574 686f 6428 l_ns__webmethod( │ │ │ +0017b080: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap, │ │ │ +0017b0b0: 202e 2e2e 2929 203c 2f64 6976 3e0a 3c64 ...))
    . │ │ │ +0017b0d0: 2020 2020 2020 2e2e 2e20 3c73 7061 6e20 ... │ │ │ +0017b0f0: 2f2f 2065 7272 6f72 3c2f 7370 616e 3e3c // error< │ │ │ +0017b100: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    else
    .
    │ │ │ +0017b160: 2e2e 2e20 3c73 7061 6e20 636c 6173 733d ... // suc │ │ │ +0017b180: 6365 7373 3c2f 7370 616e 3e3c 2f64 6976 cess
    .
    < │ │ │ +0017b1f0: 6120 6872 6566 3d22 7374 7275 6374 736f a href="structso │ │ │ +0017b200: 6170 2e68 746d 6c23 6130 3337 3535 3466 ap.html#a037554f │ │ │ +0017b210: 6432 6366 3534 6662 3961 3664 3533 3236 d2cf54fb9a6d5326 │ │ │ +0017b220: 6231 3163 3866 6661 3022 3e73 6f61 703a b11c8ffa0">soap: │ │ │ +0017b230: 3a70 726f 7879 5f70 6f72 743c 2f61 3e3c :proxy_port< │ │ │ +0017b240: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
    int pro │ │ │ +0017b260: 7879 5f70 6f72 743c 2f64 6976 3e3c 6469 xy_port
    │ │ │ +0017b280: 5573 6572 2d64 6566 696e 6162 6c65 2070 User-definable p │ │ │ +0017b290: 726f 7879 2070 6f72 7420 7768 6963 6820 roxy port which │ │ │ +0017b2a0: 7368 6f75 6c64 2062 6520 7365 7420 746f should be set to │ │ │ +0017b2b0: 2063 6f6e 6e65 6374 2074 6872 6f75 6768 connect through │ │ │ +0017b2c0: 2061 6e20 4854 5450 2070 726f 7879 2028 an HTTP proxy ( │ │ │ +0017b2d0: 7468 6520 7661 6c75 6520 6973 2038 3038 the value is 808 │ │ │ +0017b2e0: 3020 6279 202e 2e2e 3c2f 6469 763e 3c64 0 by ...
    Definition:< │ │ │ +0017b310: 2f62 3e20 7374 6473 6f61 7032 2e68 3a33 /b> stdsoap2.h:3 │ │ │ +0017b320: 3930 363c 2f64 6976 3e3c 2f64 6976 3e0a 906
    . │ │ │ +0017b330: 3c64 6976 2063 6c61 7373 3d22 7474 6322
    soap::p │ │ │ +0017b3d0: 726f 7879 5f75 7365 7269 643c 2f61 3e3c roxy_userid< │ │ │ +0017b3e0: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
    const c │ │ │ +0017b400: 6861 7220 2a20 7072 6f78 795f 7573 6572 har * proxy_user │ │ │ +0017b410: 6964 3c2f 6469 763e 3c64 6976 2063 6c61 id
    User- │ │ │ +0017b430: 6465 6669 6e61 626c 6520 7072 6f78 7920 definable proxy │ │ │ +0017b440: 6175 7468 6f72 697a 6174 696f 6e20 7573 authorization us │ │ │ +0017b450: 6572 2069 6420 7374 7269 6e67 2074 6f20 er id string to │ │ │ +0017b460: 6175 7468 656e 7469 6361 7465 2061 6e64 authenticate and │ │ │ +0017b470: 2063 6f6e 6e65 6374 2074 6f20 616e 2048 connect to an H │ │ │ +0017b480: 5454 5020 7072 6f78 792e 3c2f 6469 763e TTP proxy.
    │ │ │ +0017b490: 3c64 6976 2063 6c61 7373 3d22 7474 6465
    Definition │ │ │ +0017b4b0: 3a3c 2f62 3e20 7374 6473 6f61 7032 2e68 : stdsoap2.h │ │ │ +0017b4c0: 3a33 3931 313c 2f64 6976 3e3c 2f64 6976 :3911
    .
    < │ │ │ +0017b530: 6120 6872 6566 3d22 7374 7275 6374 736f a href="structso │ │ │ +0017b540: 6170 2e68 746d 6c23 6163 3137 3262 6439 ap.html#ac172bd9 │ │ │ +0017b550: 3031 3961 6665 6562 6233 3633 3562 3361 019afeebb3635b3a │ │ │ +0017b560: 3966 3732 6139 3130 3122 3e73 6f61 703a 9f72a9101">soap: │ │ │ +0017b570: 3a70 726f 7879 5f68 6f73 743c 2f61 3e3c :proxy_host< │ │ │ +0017b580: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
    const c │ │ │ +0017b5a0: 6861 7220 2a20 7072 6f78 795f 686f 7374 har * proxy_host │ │ │ +0017b5b0: 3c2f 6469 763e 3c64 6976 2063 6c61 7373
    User-de │ │ │ +0017b5d0: 6669 6e61 626c 6520 7072 6f78 7920 686f finable proxy ho │ │ │ +0017b5e0: 7374 206e 616d 6520 7374 7269 6e67 2077 st name string w │ │ │ +0017b5f0: 6869 6368 2073 686f 756c 6420 6265 2073 hich should be s │ │ │ +0017b600: 6574 2074 6f20 636f 6e6e 6563 7420 7468 et to connect th │ │ │ +0017b610: 726f 7567 6820 616e 2048 5454 5020 7072 rough an HTTP pr │ │ │ +0017b620: 6f78 792e 3c2f 6469 763e 3c64 6976 2063 oxy.
    │ │ │ +0017b640: 4465 6669 6e69 7469 6f6e 3a3c 2f62 3e20 Definition: │ │ │ +0017b650: 7374 6473 6f61 7032 2e68 3a33 3930 313c stdsoap2.h:3901< │ │ │ +0017b660: 2f64 6976 3e3c 2f64 6976 3e0a 3c64 6976 /div>
    .
    const char │ │ │ +0017b740: 2a20 7072 6f78 795f 7061 7373 7764 3c2f * proxy_passwd
    User-defi │ │ │ +0017b770: 6e61 626c 6520 7072 6f78 7920 6175 7468 nable proxy auth │ │ │ +0017b780: 6f72 697a 6174 696f 6e20 7061 7373 776f orization passwo │ │ │ +0017b790: 7264 2073 7472 696e 6720 746f 2061 7574 rd string to aut │ │ │ +0017b7a0: 6865 6e74 6963 6174 6520 616e 6420 636f henticate and co │ │ │ +0017b7b0: 6e6e 6563 7420 746f 2061 6e20 4854 5450 nnect to an HTTP │ │ │ +0017b7c0: 2070 726f 7879 2e3c 2f64 6976 3e3c 6469 proxy.
    │ │ │ +0017b7e0: 3c62 3e44 6566 696e 6974 696f 6e3a 3c2f Definition: stdsoap2.h:39 │ │ │ +0017b800: 3136 3c2f 6469 763e 3c2f 6469 763e 0a3c 16
    .< │ │ │ +0017b810: 2f64 6976 3e3c 212d 2d20 6672 6167 6d65 /div>

    To avoi │ │ │ +0017b830: 6420 7468 6520 6f76 6572 6865 6164 206f d the overhead o │ │ │ +0017b840: 6620 7468 6520 6669 7273 7420 7265 6a65 f the first reje │ │ │ +0017b850: 6374 6564 2063 616c 6c2c 2075 7365 3a3c cted call, use:< │ │ │ +0017b860: 2f70 3e0a 3c64 6976 2063 6c61 7373 3d22 /p>.

    struct │ │ │ +0017b8b0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap │ │ │ +0017b8e0: 2a3c 6120 636c 6173 733d 2263 6f64 6522 *soap │ │ │ +0017b910: 203d 203c 6120 636c 6173 733d 2263 6f64 = soap_new │ │ │ +0017b970: 313c 2f61 3e28 3c61 2063 6c61 7373 3d22 1(SOAP_IO │ │ │ +0017b9d0: 5f4b 4545 5041 4c49 5645 3c2f 613e 293b _KEEPALIVE); │ │ │ +0017b9e0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    soap->proxy_hos │ │ │ +0017ba80: 743c 2f61 3e20 3d20 3c73 7061 6e20 636c t = "...&qu │ │ │ +0017bab0: 6f74 3b3c 2f73 7061 6e3e 3b20 3c2f 6469 ot;; .
    soap │ │ │ +0017bb00: 3c2f 613e 2d26 6774 3b3c 6120 636c 6173 ->proxy_port │ │ │ +0017bb60: 203d 202e 2e2e 3b20 3c2f 6469 763e 0a3c = ...;
    .< │ │ │ +0017bb70: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +0017bb80: 3e3c 6120 636c 6173 733d 2263 6f64 6522 >soap │ │ │ +0017bbb0: 2d26 6774 3b3c 6120 636c 6173 733d 2263 ->pr │ │ │ +0017bc00: 6f78 795f 7573 6572 6964 3c2f 613e 203d oxy_userid = │ │ │ +0017bc10: 203c 7370 616e 2063 6c61 7373 3d22 7374 &qu │ │ │ +0017bc30: 6f74 3b5a 6170 686f 6426 7175 6f74 3b3c ot;Zaphod"< │ │ │ +0017bc40: 2f73 7061 6e3e 3b20 3c2f 6469 763e 0a3c /span>;
    .< │ │ │ +0017bc50: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +0017bc60: 3e3c 6120 636c 6173 733d 2263 6f64 6522 >soap │ │ │ +0017bc90: 2d26 6774 3b3c 6120 636c 6173 733d 2263 ->pr │ │ │ +0017bce0: 6f78 795f 7061 7373 7764 3c2f 613e 203d oxy_passwd = │ │ │ +0017bcf0: 203c 7370 616e 2063 6c61 7373 3d22 7374 &qu │ │ │ +0017bd10: 6f74 3b42 6565 626c 6562 726f 7826 7175 ot;Beeblebrox&qu │ │ │ +0017bd20: 6f74 3b3c 2f73 7061 6e3e 3b20 3c2f 6469 ot;; .
    soap │ │ │ +0017bd70: 3c2f 613e 2d26 6774 3b3c 6120 636c 6173 ->authrealm │ │ │ +0017bdd0: 3d20 3c73 7061 6e20 636c 6173 733d 2273 = &q │ │ │ +0017bdf0: 756f 743b 5572 7361 2d4d 696e 6f72 2671 uot;Ursa-Minor&q │ │ │ +0017be00: 756f 743b 3c2f 7370 616e 3e3b 203c 2f64 uot;; .. │ │ │ +0017bef0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    if (soap_call │ │ │ +0017bf30: 5f6e 735f 5f77 6562 6d65 7468 6f64 283c _ns__webmethod(< │ │ │ +0017bf40: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +0017bf50: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ +0017bf60: 6874 6d6c 223e 736f 6170 3c2f 613e 2c20 html">soap, │ │ │ +0017bf70: 2e2e 2e29 2920 3c2f 6469 763e 0a3c 6469 ...))
    . │ │ │ +0017bf90: 202e 2e2e 203c 7370 616e 2063 6c61 7373 ... // er │ │ │ +0017bfb0: 726f 723c 2f73 7061 6e3e 3c2f 6469 763e ror
    │ │ │ +0017bfc0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    els │ │ │ +0017bff0: 653c 2f73 7061 6e3e 3c2f 6469 763e 0a3c e
    .< │ │ │ +0017c000: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +0017c010: 3e20 202e 2e2e 203c 7370 616e 2063 6c61 > ... // │ │ │ +0017c030: 7375 6363 6573 733c 2f73 7061 6e3e 3c2f success.

    . │ │ │ +0017c060: 9f94 9d20 3c61 2068 7265 663d 2223 223e ... │ │ │ +0017c070: 4261 636b 2074 6f20 7461 626c 6520 6f66 Back to table of │ │ │ +0017c080: 2063 6f6e 7465 6e74 733c 2f61 3e3c 2f70 contents

    .

    .HTTP proxy │ │ │ +0017c0d0: 2062 6173 6963 2061 7574 6865 6e74 6963 basic authentic │ │ │ +0017c0e0: 6174 696f 6e3c 2f68 333e 0a3c 703e 4854 ation

    .

    HT │ │ │ +0017c0f0: 5450 2070 726f 7879 2061 7574 6865 6e74 TP proxy authent │ │ │ +0017c100: 6963 6174 696f 6e20 2862 6173 6963 2920 ication (basic) │ │ │ +0017c110: 6973 2065 6e61 626c 6564 2061 7420 7468 is enabled at th │ │ │ +0017c120: 6520 636c 6965 6e74 2d73 6964 6520 6279 e client-side by │ │ │ +0017c130: 2073 6574 7469 6e67 2074 6865 203c 636f setting the soap::proxy_us │ │ │ +0017c200: 6572 6964 3c2f 613e 3c2f 636f 6465 3e20 erid │ │ │ +0017c210: 616e 6420 3c63 6f64 653e 3c61 2063 6c61 and soap:: │ │ │ +0017c2d0: 7072 6f78 795f 7061 7373 7764 3c2f 613e proxy_passwd │ │ │ +0017c2e0: 3c2f 636f 6465 3e20 7374 7269 6e67 7320 strings │ │ │ +0017c2f0: 746f 2061 2075 7365 726e 616d 6520 616e to a username an │ │ │ +0017c300: 6420 7061 7373 776f 7264 2c20 7265 7370 d password, resp │ │ │ +0017c310: 6563 7469 7665 6c79 2e20 466f 7220 6578 ectively. For ex │ │ │ +0017c320: 616d 706c 652c 2061 2070 726f 7879 2073 ample, a proxy s │ │ │ +0017c330: 6572 7665 7220 6d61 7920 7265 7175 6573 erver may reques │ │ │ +0017c340: 7420 7573 6572 2061 7574 6865 6e74 6963 t user authentic │ │ │ +0017c350: 6174 696f 6e2e 204f 7468 6572 7769 7365 ation. Otherwise │ │ │ +0017c360: 2c20 6163 6365 7373 2069 7320 6465 6e69 , access is deni │ │ │ +0017c370: 6564 2062 7920 7468 6520 7072 6f78 7920 ed by the proxy │ │ │ +0017c380: 2848 5454 5020 3430 3720 6572 726f 7229 (HTTP 407 error) │ │ │ +0017c390: 2e20 4578 616d 706c 6520 636c 6965 6e74 . Example client │ │ │ +0017c3a0: 2063 6f64 6520 6672 6167 6d65 6e74 2074 code fragment t │ │ │ +0017c3b0: 6f20 7365 7420 7072 6f78 7920 7365 7276 o set proxy serv │ │ │ +0017c3c0: 6572 2c20 7573 6572 6e61 6d65 2c20 616e er, username, an │ │ │ +0017c3d0: 6420 7061 7373 776f 7264 3a3c 2f70 3e0a d password:

    . │ │ │ +0017c3e0: 3c64 6976 2063 6c61 7373 3d22 6672 6167
    st │ │ │ +0017c420: 7275 6374 203c 2f73 7061 6e3e 3c61 2063 ruct soap *soap = < │ │ │ +0017c490: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +0017c4a0: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ +0017c4b0: 705f 5f63 6f6e 7465 7874 2e68 746d 6c23 p__context.html# │ │ │ +0017c4c0: 6761 3837 6332 3034 3838 6232 6463 3638 ga87c20488b2dc68 │ │ │ +0017c4d0: 3061 6161 3736 3839 6231 6430 3234 3938 0aaa7689b1d02498 │ │ │ +0017c4e0: 3963 223e 736f 6170 5f6e 6577 3c2f 613e 9c">soap_new │ │ │ +0017c4f0: 2829 3b20 3c2f 6469 763e 0a3c 6469 7620 ();
    .
    soap-> │ │ │ +0017c540: 3b3c 6120 636c 6173 733d 2263 6f64 6522 ;proxy_ │ │ │ +0017c590: 686f 7374 3c2f 613e 203d 203c 7370 616e host = "xx. │ │ │ +0017c5c0: 7878 2e78 782e 7878 2671 756f 743b 3c2f xx.xx.xx"; // │ │ │ +0017c5f0: 4950 206f 7220 646f 6d61 696e 203c 2f73 IP or domain
    .
    soap-> │ │ │ +0017c650: 3b3c 6120 636c 6173 733d 2263 6f64 6522 ;proxy_ │ │ │ +0017c6a0: 706f 7274 3c2f 613e 203d 2038 3038 303b port = 8080; │ │ │ +0017c6b0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    soap->proxy_use │ │ │ +0017c750: 7269 643c 2f61 3e20 3d20 3c73 7061 6e20 rid = "gues │ │ │ +0017c780: 7426 7175 6f74 3b3c 2f73 7061 6e3e 3b20 t"; │ │ │ +0017c790: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    │ │ │ +0017c7d0: 736f 6170 3c2f 613e 2d26 6774 3b3c 6120 soap->proxy_pass │ │ │ +0017c830: 7764 3c2f 613e 203d 203c 7370 616e 2063 wd = "guest │ │ │ +0017c860: 2671 756f 743b 3c2f 7370 616e 3e3b 203c "; < │ │ │ +0017c870: 2f64 6976 3e0a 3c2f 6469 763e 3c21 2d2d /div>.

    │ │ │ +0017c890: 4120 636c 6965 6e74 2053 4f41 5020 7265 A client SOAP re │ │ │ +0017c8a0: 7175 6573 7420 7769 6c6c 2068 6176 6520 quest will have │ │ │ +0017c8b0: 7468 6520 666f 6c6c 6f77 696e 6720 4854 the following HT │ │ │ +0017c8c0: 5450 2068 6561 6465 723a 203c 2f70 3e3c TP header:

    < │ │ │ +0017c8d0: 7072 6520 636c 6173 733d 2266 7261 676d pre class="fragm │ │ │ +0017c8e0: 656e 7422 3e50 4f53 5420 2f58 5858 2048 ent">POST /XXX H │ │ │ +0017c8f0: 5454 502f 312e 3120 0a48 6f73 743a 2059 TTP/1.1 .Host: Y │ │ │ +0017c900: 5959 200a 5573 6572 2d41 6765 6e74 3a20 YY .User-Agent: │ │ │ +0017c910: 6753 4f41 502f 322e 3820 0a43 6f6e 7465 gSOAP/2.8 .Conte │ │ │ +0017c920: 6e74 2d54 7970 653a 2074 6578 742f 786d nt-Type: text/xm │ │ │ +0017c930: 6c3b 2063 6861 7273 6574 3d75 7466 2d38 l; charset=utf-8 │ │ │ +0017c940: 200a 436f 6e74 656e 742d 4c65 6e67 7468 .Content-Length │ │ │ +0017c950: 3a20 5a5a 5a20 0a50 726f 7879 2d41 7574 : ZZZ .Proxy-Aut │ │ │ +0017c960: 686f 7269 7a61 7469 6f6e 3a20 4261 7369 horization: Basi │ │ │ +0017c970: 6320 5a33 566c 6333 5136 5a33 566c 6333 c Z3Vlc3Q6Z3Vlc3 │ │ │ +0017c980: 513d 200a 3c2f 7072 653e 3c70 3e20 5768 Q= .

    Wh │ │ │ +0017c990: 656e 2058 2d46 6f72 7761 7264 6564 2d46 en X-Forwarded-F │ │ │ +0017c9a0: 6f72 2068 6561 6465 7273 2061 7265 2072 or headers are r │ │ │ +0017c9b0: 6574 7572 6e65 6420 6279 2074 6865 2070 eturned by the p │ │ │ +0017c9c0: 726f 7879 2c20 7468 6520 6865 6164 6572 roxy, the header │ │ │ +0017c9d0: 2063 616e 2062 6520 6163 6365 7373 6564 can be accessed │ │ │ +0017c9e0: 2069 6e20 7468 6520 3c63 6f64 653e 3c61 in the soap::proxy │ │ │ +0017ca80: 5f66 726f 6d3c 2f61 3e3c 2f63 6f64 653e _from │ │ │ +0017ca90: 2073 7472 696e 672e 3c2f 703e 0a3c 703e string.

    .

    │ │ │ +0017caa0: 5468 6520 434f 4e4e 4543 5420 6d65 7468 The CONNECT meth │ │ │ +0017cab0: 6f64 2069 7320 7573 6564 2066 6f72 2048 od is used for H │ │ │ +0017cac0: 5454 5020 7072 6f78 7920 6175 7468 656e TTP proxy authen │ │ │ +0017cad0: 7469 6361 7469 6f6e 3a20 3c2f 703e 3c70 tication:

    CONNECT serv │ │ │ +0017cb00: 6572 2e65 7861 6d70 6c65 2e63 6f6d 3a38 er.example.com:8 │ │ │ +0017cb10: 3020 4854 5450 2f31 2e31 0a3c 2f70 7265 0 HTTP/1.1.

    In some cas │ │ │ +0017cb30: 6573 2c20 796f 7520 7769 6c6c 206e 6f74 es, you will not │ │ │ +0017cb40: 6963 6520 7468 6174 2074 6865 2048 6f73 ice that the Hos │ │ │ +0017cb50: 7420 4854 5450 2068 6561 6465 7220 7573 t HTTP header us │ │ │ +0017cb60: 6573 2074 6865 2043 4f4e 4e45 4354 2070 es the CONNECT p │ │ │ +0017cb70: 726f 746f 636f 6c3a 203c 2f70 3e3c 7072 rotocol:

    CONNECT serve │ │ │ +0017cba0: 722e 6578 616d 706c 652e 636f 6d3a 3830 r.example.com:80 │ │ │ +0017cbb0: 2048 5454 502f 312e 3120 0a48 6f73 743a HTTP/1.1 .Host: │ │ │ +0017cbc0: 2073 6572 7665 722e 6578 616d 706c 652e server.example. │ │ │ +0017cbd0: 636f 6d3a 3830 0a3c 2f70 7265 3e3c 703e com:80.

    │ │ │ +0017cbe0: 20f0 9f94 9d20 3c61 2068 7265 663d 2223 .... Back to table │ │ │ +0017cc00: 6f66 2063 6f6e 7465 6e74 733c 2f61 3e3c of contents< │ │ │ +0017cc10: 2f70 3e0a 3c68 323e 3c61 2063 6c61 7373 /p>.

    .Perform │ │ │ +0017cc40: 616e 6365 2069 6d70 726f 7665 6d65 6e74 ance improvement │ │ │ +0017cc50: 2074 6970 733c 2f68 323e 0a3c 703e 4865 tips

    .

    He │ │ │ +0017cc60: 7265 2061 7265 2073 6f6d 6520 7469 7073 re are some tips │ │ │ +0017cc70: 2079 6f75 2063 616e 2075 7365 2074 6f20 you can use to │ │ │ +0017cc80: 7370 6565 6420 7570 2067 534f 4150 2e20 speed up gSOAP. │ │ │ +0017cc90: 5468 6520 6465 6661 756c 7420 7365 7474 The default sett │ │ │ +0017cca0: 696e 6773 2061 7265 2063 686f 7365 6e20 ings are chosen │ │ │ +0017ccb0: 746f 206d 6178 696d 697a 6520 706f 7274 to maximize port │ │ │ +0017ccc0: 6162 696c 6974 7920 616e 6420 636f 6d70 ability and comp │ │ │ +0017ccd0: 6174 6962 696c 6974 792e 2054 6865 2073 atibility. The s │ │ │ +0017cce0: 6574 7469 6e67 7320 6361 6e20 6265 2074 ettings can be t │ │ │ +0017ccf0: 7765 616b 6564 2074 6f20 6f70 7469 6d69 weaked to optimi │ │ │ +0017cd00: 7a65 2074 6865 2070 6572 666f 726d 616e ze the performan │ │ │ +0017cd10: 6365 2061 7320 666f 6c6c 6f77 733a 3c2f ce as follows:.

      .
    • Incr │ │ │ +0017cd30: 6561 7365 2074 6865 2062 7566 6665 7220 ease the buffer │ │ │ +0017cd40: 7369 7a65 203c 636f 6465 3e23 534f 4150 size #SOAP │ │ │ +0017cd50: 5f42 5546 4c45 4e3c 2f63 6f64 653e 2062 _BUFLEN b │ │ │ +0017cd60: 7920 6368 616e 6769 6e67 2074 6865 203c y changing the < │ │ │ +0017cd70: 636f 6465 3e23 534f 4150 5f42 5546 4c45 code>#SOAP_BUFLE │ │ │ +0017cd80: 4e3c 2f63 6f64 653e 206d 6163 726f 2069 N macro i │ │ │ +0017cd90: 6e20 3c65 6d3e 3c63 6f64 653e 6773 6f61 n gsoa │ │ │ +0017cda0: 702f 7374 6473 6f61 7032 2e68 3c2f 636f p/stdsoap2.h. Use bu │ │ │ +0017cdc0: 6666 6572 2073 697a 6520 325e 3138 3d32 ffer size 2^18=2 │ │ │ +0017cdd0: 3632 3134 3420 666f 7220 6578 616d 706c 62144 for exampl │ │ │ +0017cde0: 652e 3c2f 6c69 3e0a 3c6c 693e 5573 6520 e.
    • .
    • Use │ │ │ +0017cdf0: 4854 5450 206b 6565 702d 616c 6976 6520 HTTP keep-alive │ │ │ +0017ce00: 6174 2074 6865 2063 6c69 656e 742d 7369 at the client-si │ │ │ +0017ce10: 6465 2c20 7365 6520 5365 6374 696f 6e20 de, see Section │ │ │ +0017ce20: 3c61 2063 6c61 7373 3d22 656c 2220 6872 TCP an │ │ │ +0017ce50: 6420 4854 5450 206b 6565 702d 616c 6976 d HTTP keep-aliv │ │ │ +0017ce60: 653c 2f61 3e20 2c20 7768 656e 2074 6865 e , when the │ │ │ +0017ce70: 2063 6c69 656e 7420 6e65 6564 7320 746f client needs to │ │ │ +0017ce80: 206d 616b 6520 6120 7365 7269 6573 206f make a series o │ │ │ +0017ce90: 6620 6361 6c6c 7320 746f 2074 6865 2073 f calls to the s │ │ │ +0017cea0: 616d 6520 7365 7276 6572 2e20 5365 7276 ame server. Serv │ │ │ +0017ceb0: 6572 2d73 6964 6520 6b65 6570 2d61 6c69 er-side keep-ali │ │ │ +0017cec0: 7665 2073 7570 706f 7274 2063 616e 2067 ve support can g │ │ │ +0017ced0: 7265 6174 6c79 2069 6d70 726f 7665 2070 reatly improve p │ │ │ +0017cee0: 6572 666f 726d 616e 6365 206f 6620 626f erformance of bo │ │ │ +0017cef0: 7468 2063 6c69 656e 7420 616e 6420 7365 th client and se │ │ │ +0017cf00: 7276 6572 2e20 4275 7420 6265 2061 7761 rver. But be awa │ │ │ +0017cf10: 7265 2074 6861 7420 636c 6965 6e74 7320 re that clients │ │ │ +0017cf20: 616e 6420 7365 7276 6963 6573 2075 6e64 and services und │ │ │ +0017cf30: 6572 2055 6e69 782f 4c69 6e75 7820 7265 er Unix/Linux re │ │ │ +0017cf40: 7175 6972 6520 7369 676e 616c 2068 616e quire signal han │ │ │ +0017cf50: 646c 6572 7320 746f 2063 6174 6368 2064 dlers to catch d │ │ │ +0017cf60: 726f 7070 6564 2063 6f6e 6e65 6374 696f ropped connectio │ │ │ +0017cf70: 6e73 2e3c 2f6c 693e 0a3c 6c69 3e55 7365 ns.
    • .
    • Use │ │ │ +0017cf80: 2048 5454 5020 6368 756e 6b65 6420 7472 HTTP chunked tr │ │ │ +0017cf90: 616e 7366 6572 732c 2073 6565 2053 6563 ansfers, see Sec │ │ │ +0017cfa0: 7469 6f6e 203c 6120 636c 6173 733d 2265 tion HTT │ │ │ +0017cfd0: 5020 6368 756e 6b65 6420 7472 616e 7366 P chunked transf │ │ │ +0017cfe0: 6572 2065 6e63 6f64 696e 673c 2f61 3e20 er encoding │ │ │ +0017cff0: 2e3c 2f6c 693e 0a3c 6c69 3e44 6f20 6e6f .
    • .
    • Do no │ │ │ +0017d000: 7420 7573 6520 677a 6970 2063 6f6d 7072 t use gzip compr │ │ │ +0017d010: 6573 7369 6f6e 2c20 7369 6e63 6520 7468 ession, since th │ │ │ +0017d020: 6520 6f76 6572 6865 6164 206f 6620 636f e overhead of co │ │ │ +0017d030: 6d70 7265 7373 696f 6e20 6973 2074 7970 mpression is typ │ │ │ +0017d040: 6963 616c 6c79 2068 6967 6865 7220 7468 ically higher th │ │ │ +0017d050: 616e 2074 6865 2062 616e 6477 6964 7468 an the bandwidth │ │ │ +0017d060: 2067 6169 6e73 2e3c 2f6c 693e 0a3c 6c69 gains.
    • .
    • Set the # │ │ │ +0017d080: 534f 4150 5f58 4d4c 5f54 5245 453c 2f63 SOAP_XML_TREE flag to dis │ │ │ +0017d0a0: 6162 6c65 2069 642d 7265 6620 6d75 6c74 able id-ref mult │ │ │ +0017d0b0: 692d 7265 6620 6f62 6a65 6374 2073 6572 i-ref object ser │ │ │ +0017d0c0: 6961 6c69 7a61 7469 6f6e 2e20 5468 6973 ialization. This │ │ │ +0017d0d0: 2062 6f6f 7374 7320 7065 7266 6f72 6d61 boosts performa │ │ │ +0017d0e0: 6e63 6520 7369 676e 6966 6963 616e 746c nce significantl │ │ │ +0017d0f0: 7920 616e 6420 776f 726b 7320 7769 7468 y and works with │ │ │ +0017d100: 2053 4f41 5020 646f 6375 6d65 6e74 2f6c SOAP document/l │ │ │ +0017d110: 6974 6572 616c 2073 7479 6c65 2028 692e iteral style (i. │ │ │ +0017d120: 652e 206e 6f20 6964 2d72 6566 2067 7261 e. no id-ref gra │ │ │ +0017d130: 7068 2073 6572 6961 6c69 7a61 7469 6f6e ph serialization │ │ │ +0017d140: 2061 7320 7265 7175 6972 6564 2077 6974 as required wit │ │ │ +0017d150: 6820 534f 4150 2065 6e63 6f64 696e 6720 h SOAP encoding │ │ │ +0017d160: 7374 796c 6529 2e20 446f 206e 6f74 2075 style). Do not u │ │ │ +0017d170: 7365 2074 6869 7320 666f 7220 534f 4150 se this for SOAP │ │ │ +0017d180: 2052 5043 2065 6e63 6f64 6564 206d 6573 RPC encoded mes │ │ │ +0017d190: 7361 6769 6e67 2e3c 2f6c 693e 0a3c 6c69 saging.
    • .
    • Compile gsoap/stdsoap │ │ │ +0017d1c0: 322e 633c 2f63 6f64 653e 3c2f 656d 3e20 2.c │ │ │ +0017d1d0: 616e 6420 3c65 6d3e 3c63 6f64 653e 6773 and gs │ │ │ +0017d1e0: 6f61 702f 7374 6473 6f61 7032 2e63 7070 oap/stdsoap2.cpp │ │ │ +0017d1f0: 3c2f 636f 6465 3e3c 2f65 6d3e 2061 6e64 and │ │ │ +0017d200: 2061 6c6c 206f 7468 6572 2073 6f75 7263 all other sourc │ │ │ +0017d210: 6520 636f 6465 7320 7769 7468 2074 6865 e codes with the │ │ │ +0017d220: 2063 6f6d 7069 6c65 2074 696d 6520 666c compile time fl │ │ │ +0017d230: 6167 203c 636f 6465 3e23 5749 5448 5f4e ag #WITH_N │ │ │ +0017d240: 4f49 4452 4546 3c2f 636f 6465 3e20 746f OIDREF to │ │ │ +0017d250: 2069 6d70 726f 7665 2070 6572 666f 726d improve perform │ │ │ +0017d260: 616e 6365 2065 7665 6e20 6265 7474 6572 ance even better │ │ │ +0017d270: 2062 7920 7065 726d 616e 656e 746c 7920 by permanently │ │ │ +0017d280: 6469 7361 626c 696e 6720 6964 2d72 6566 disabling id-ref │ │ │ +0017d290: 206d 756c 7469 2d72 6566 206f 626a 6563 multi-ref objec │ │ │ +0017d2a0: 7420 7365 7269 616c 697a 6174 696f 6e2e t serialization. │ │ │ +0017d2b0: 2044 6f20 6e6f 7420 7573 6520 7468 6973 Do not use this │ │ │ +0017d2c0: 2066 6f72 2053 4f41 5020 5250 4320 656e for SOAP RPC en │ │ │ +0017d2d0: 636f 6465 6420 6d65 7373 6167 696e 672e coded messaging. │ │ │ +0017d2e0: 3c2f 6c69 3e0a 3c6c 693e 446f 206e 6f74
    • .
    • Do not │ │ │ +0017d2f0: 2075 7365 2044 4542 5547 206d 6f64 652c use DEBUG mode, │ │ │ +0017d300: 2073 696e 6365 2074 6865 206f 7665 7268 since the overh │ │ │ +0017d310: 6561 6420 6f66 206c 6f67 6769 6e67 2069 ead of logging i │ │ │ +0017d320: 7320 7369 676e 6966 6963 616e 742e 3c2f s significant..
    .

    ... │ │ │ +0017d340: 9d20 3c61 2068 7265 663d 2223 223e 4261 . Ba │ │ │ +0017d350: 636b 2074 6f20 7461 626c 6520 6f66 2063 ck to table of c │ │ │ +0017d360: 6f6e 7465 6e74 733c 2f61 3e3c 2f70 3e0a ontents

    . │ │ │ +0017d370: 3c68 323e 3c61 2063 6c61 7373 3d22 616e

    .Safety gu │ │ │ +0017d3a0: 6172 6473 3c2f 6832 3e0a 3c70 3e54 6865 ards

    .

    The │ │ │ +0017d3b0: 2066 6f6c 6c6f 7769 6e67 2073 6574 7469 following setti │ │ │ +0017d3c0: 6e67 7320 6172 6520 696d 706f 7274 616e ngs are importan │ │ │ +0017d3d0: 7420 746f 2065 6e73 7572 6520 7468 6174 t to ensure that │ │ │ +0017d3e0: 2058 4d4c 206d 6573 7361 6769 6e67 2069 XML messaging i │ │ │ +0017d3f0: 7320 7361 6665 2062 7920 6465 6669 6e69 s safe by defini │ │ │ +0017d400: 6e67 2072 6561 736f 6e61 626c 6520 584d ng reasonable XM │ │ │ +0017d410: 4c20 6d65 7373 6167 6520 7265 7374 7269 L message restri │ │ │ +0017d420: 6374 696f 6e73 2e20 416c 736f 206d 6573 ctions. Also mes │ │ │ +0017d430: 7361 6769 6e67 2074 696d 656f 7574 7320 saging timeouts │ │ │ +0017d440: 7368 6f75 6c64 2062 6520 7365 7420 6173 should be set as │ │ │ +0017d450: 2065 7870 6c61 696e 6564 2069 6e20 5365 explained in Se │ │ │ +0017d460: 6374 696f 6e20 3c61 2063 6c61 7373 3d22 ction Ti │ │ │ +0017d490: 6d65 6f75 7420 6d61 6e61 6765 6d65 6e74 meout management │ │ │ +0017d4a0: 2066 6f72 206e 6f6e 2d62 6c6f 636b 696e for non-blockin │ │ │ +0017d4b0: 6720 6f70 6572 6174 696f 6e73 3c2f 613e g operations │ │ │ +0017d4c0: 2e3c 2f70 3e0a 3c70 3e54 6865 2058 4d4c .

    .

    The XML │ │ │ +0017d4d0: 2070 6172 7365 7220 6973 2063 6f6e 6669 parser is confi │ │ │ +0017d4e0: 6775 7265 6420 746f 2072 6573 7472 6963 gured to restric │ │ │ +0017d4f0: 7420 7468 6520 584d 4c20 6e65 7374 696e t the XML nestin │ │ │ +0017d500: 6720 6465 7074 6820 6c65 7665 6c20 746f g depth level to │ │ │ +0017d510: 203c 636f 6465 3e23 534f 4150 5f4d 4158 #SOAP_MAX │ │ │ +0017d520: 4c45 5645 4c3c 2f63 6f64 653e 2061 6e64 LEVEL and │ │ │ +0017d530: 2072 6573 7472 6963 7473 2074 6865 2072 restricts the r │ │ │ +0017d540: 6570 6561 7465 6420 6f63 6375 7272 656e epeated occurren │ │ │ +0017d550: 6365 206f 6620 656c 656d 656e 7473 2074 ce of elements t │ │ │ +0017d560: 6861 7420 6172 6520 6465 7365 7269 616c hat are deserial │ │ │ +0017d570: 697a 6564 2069 6e74 6f20 6172 7261 7973 ized into arrays │ │ │ +0017d580: 2061 6e64 2063 6f6e 7461 696e 6572 7320 and containers │ │ │ +0017d590: 6279 203c 636f 6465 3e23 534f 4150 5f4d by #SOAP_M │ │ │ +0017d5a0: 4158 4f43 4355 5253 3c2f 636f 6465 3e2e AXOCCURS. │ │ │ +0017d5b0: 2054 6865 7365 206d 6163 726f 7320 6361 These macros ca │ │ │ +0017d5c0: 6e20 6265 2063 6861 6e67 6564 2c20 6275 n be changed, bu │ │ │ +0017d5d0: 7420 796f 7520 6361 6e20 616c 736f 2063 t you can also c │ │ │ +0017d5e0: 6861 6e67 6520 7468 6520 666f 6c6c 6f77 hange the follow │ │ │ +0017d5f0: 696e 6720 636f 6e74 6578 7420 6174 7472 ing context attr │ │ │ +0017d600: 6962 7574 6573 2061 7420 7275 6e2d 7469 ibutes at run-ti │ │ │ +0017d610: 6d65 2c20 652e 672e 2074 6f20 656e 6861 me, e.g. to enha │ │ │ +0017d620: 6e63 6520 7468 6520 7361 6665 7479 2066 nce the safety f │ │ │ +0017d630: 6f72 2073 7065 6369 6669 6320 7365 7276 or specific serv │ │ │ +0017d640: 6963 6520 616e 642f 6f72 2063 6c69 656e ice and/or clien │ │ │ +0017d650: 7420 6f70 6572 6174 696f 6e73 3a3c 2f70 t operations:

    .
      .
    • soap::m │ │ │ +0017d730: 6178 6c65 7665 6c3c 2f61 3e3c 2f63 6f64 axlevel restricts the │ │ │ +0017d750: 2058 4d4c 206e 6573 7469 6e67 2064 6570 XML nesting dep │ │ │ +0017d760: 7468 206c 6576 656c 2c20 7768 6572 6520 th level, where │ │ │ +0017d770: 7468 6520 6465 6661 756c 7420 7661 6c75 the default valu │ │ │ +0017d780: 6520 6973 203c 636f 6465 3e23 534f 4150 e is #SOAP │ │ │ +0017d790: 5f4d 4158 4c45 5645 4c3c 2f63 6f64 653e _MAXLEVEL │ │ │ +0017d7a0: 203d 2031 3030 3030 2e3c 2f6c 693e 0a3c = 10000.
    • .< │ │ │ +0017d7b0: 6c69 3e3c 636f 6465 3e3c 6120 636c 6173 li>soap::maxoccurs │ │ │ +0017d880: 3c2f 613e 3c2f 636f 6465 3e20 7265 7374 rest │ │ │ +0017d890: 7269 6374 7320 7468 6520 6e75 6d62 6572 ricts the number │ │ │ +0017d8a0: 206f 6620 7265 7065 6174 6564 206f 6363 of repeated occ │ │ │ +0017d8b0: 7572 7265 6e63 6573 206f 6620 656c 656d urrences of elem │ │ │ +0017d8c0: 656e 7473 2074 6861 7420 6172 6520 6465 ents that are de │ │ │ +0017d8d0: 7365 7269 616c 697a 6564 2069 6e74 6f20 serialized into │ │ │ +0017d8e0: 6172 7261 7973 2061 6e64 2073 7472 7563 arrays and struc │ │ │ +0017d8f0: 7473 2c20 7768 6572 6520 7468 6520 6465 ts, where the de │ │ │ +0017d900: 6661 756c 7420 7661 6c75 6520 6973 203c fault value is < │ │ │ +0017d910: 636f 6465 3e23 534f 4150 5f4d 4158 4f43 code>#SOAP_MAXOC │ │ │ +0017d920: 4355 5253 3c2f 636f 6465 3e20 3d20 3130 CURS = 10 │ │ │ +0017d930: 3030 3030 2e3c 2f6c 693e 0a3c 6c69 3e3c 0000..
    • < │ │ │ +0017d940: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soap::ma │ │ │ +0017da00: 786c 656e 6774 683c 2f61 3e3c 2f63 6f64 xlength restricts the │ │ │ +0017da20: 206c 656e 6774 6820 6f66 2073 7472 696e length of strin │ │ │ +0017da30: 6773 2064 6573 6572 6961 6c69 7a65 6420 gs deserialized │ │ │ +0017da40: 6672 6f6d 2058 4d4c 2e20 4120 7a65 726f from XML. A zero │ │ │ +0017da50: 206f 7220 6e65 6761 7469 7665 2076 616c or negative val │ │ │ +0017da60: 7565 2069 7320 756e 7265 7374 7269 6374 ue is unrestrict │ │ │ +0017da70: 6564 206c 656e 6774 682e 2057 6865 6e20 ed length. When │ │ │ +0017da80: 7265 7374 7269 6374 6564 2c20 7468 6520 restricted, the │ │ │ +0017da90: 584d 4c20 7363 6865 6d61 2076 616c 6964 XML schema valid │ │ │ +0017daa0: 6174 696f 6e20 6d61 784c 656e 6774 6820 ation maxLength │ │ │ +0017dab0: 7461 6b65 7320 7072 6563 6564 656e 6365 takes precedence │ │ │ +0017dac0: 206f 7665 7220 7468 6973 206c 656e 6774 over this lengt │ │ │ +0017dad0: 6820 7265 7374 7269 6374 696f 6e2e 2053 h restriction. S │ │ │ +0017dae0: 6f20 7365 7474 696e 6720 6120 736d 616c o setting a smal │ │ │ +0017daf0: 6c65 7220 7661 6c75 6520 7769 6c6c 206e ler value will n │ │ │ +0017db00: 6f74 2069 6e74 6572 6665 7265 2077 6974 ot interfere wit │ │ │ +0017db10: 6820 7468 6520 584d 4c20 7661 6c69 6461 h the XML valida │ │ │ +0017db20: 7469 6f6e 2072 756c 6573 2e20 5468 6520 tion rules. The │ │ │ +0017db30: 6465 6661 756c 7420 7661 6c75 6520 6973 default value is │ │ │ +0017db40: 203c 636f 6465 3e23 534f 4150 5f4d 4158 #SOAP_MAX │ │ │ +0017db50: 4c45 4e47 5448 3c2f 636f 6465 3e20 3d20 LENGTH = │ │ │ +0017db60: 302e 204e 6f74 6520 7468 6174 2073 7472 0. Note that str │ │ │ +0017db70: 696e 6720 6c65 6e67 7468 2069 7320 6578 ing length is ex │ │ │ +0017db80: 7072 6573 7365 6420 696e 206e 756d 6265 pressed in numbe │ │ │ +0017db90: 7220 6f66 2063 6861 7261 6374 6572 732c r of characters, │ │ │ +0017dba0: 206e 6f74 2062 7974 6573 2e20 536f 2055 not bytes. So U │ │ │ +0017dbb0: 5446 2d38 2065 6e63 6f64 696e 6773 2061 TF-8 encodings a │ │ │ +0017dbc0: 7265 206e 6f74 2074 7275 6e63 6174 6564 re not truncated │ │ │ +0017dbd0: 2e3c 2f6c 693e 0a3c 6c69 3e3c 636f 6465 .
    • .
    • soap::r │ │ │ +0017dca0: 6563 765f 6d61 786c 656e 6774 683c 2f61 ecv_maxlength the max │ │ │ +0017dcc0: 696d 756d 206c 656e 6774 6820 6f66 206d imum length of m │ │ │ +0017dcd0: 6573 7361 6765 7320 7265 6365 6976 6564 essages received │ │ │ +0017dce0: 2c20 3247 4220 6279 2064 6566 6175 6c74 , 2GB by default │ │ │ +0017dcf0: 2e3c 2f6c 693e 0a3c 2f75 6c3e 0a3c 703e .
    • .
    .

    │ │ │ +0017dd00: 584d 4c20 7363 6865 6d61 2076 616c 6964 XML schema valid │ │ │ +0017dd10: 6174 696f 6e20 636f 6e73 7472 6169 6e74 ation constraint │ │ │ +0017dd20: 7320 6172 6520 656e 666f 7263 6564 2077 s are enforced w │ │ │ +0017dd30: 6974 6820 7468 6520 3c63 6f64 653e 2353 ith the #S │ │ │ +0017dd40: 4f41 505f 584d 4c5f 5354 5249 4354 3c2f OAP_XML_STRICT context fl │ │ │ +0017dd60: 6167 2e20 5468 6520 7363 6865 6d61 206d ag. The schema m │ │ │ +0017dd70: 6178 4c65 6e67 7468 2076 616c 6964 6174 axLength validat │ │ │ +0017dd80: 696f 6e20 636f 6e73 7472 6169 6e74 206f ion constraint o │ │ │ +0017dd90: 7665 7272 756c 6573 2074 6865 203c 636f verrules the soap::maxl │ │ │ +0017de60: 656e 6774 683c 2f61 3e3c 2f63 6f64 653e ength │ │ │ +0017de70: 2067 7561 7264 2e20 5468 6520 7363 6865 guard. The sche │ │ │ +0017de80: 6d61 206d 6178 4f63 6375 7273 2076 616c ma maxOccurs val │ │ │ +0017de90: 6964 6174 696f 6e20 636f 6e73 7472 6169 idation constrai │ │ │ +0017dea0: 6e74 2064 6f65 7320 6e6f 7420 6f76 6572 nt does not over │ │ │ +0017deb0: 7275 6c65 2074 6865 203c 636f 6465 3e3c rule the < │ │ │ +0017dec0: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ +0017ded0: 663d 2273 7472 7563 7473 6f61 702e 6874 f="structsoap.ht │ │ │ +0017dee0: 6d6c 2361 3030 6263 3230 6164 3131 3030 ml#a00bc20ad1100 │ │ │ +0017def0: 6635 3830 6131 3733 6261 3635 3165 3035 f580a173ba651e05 │ │ │ +0017df00: 6263 6239 2220 7469 746c 653d 2255 7365 bcb9" title="Use │ │ │ +0017df10: 722d 6465 6669 6e61 626c 6520 6d61 7869 r-definable maxi │ │ │ +0017df20: 6d75 6d20 6172 7261 7920 616e 6420 636f mum array and co │ │ │ +0017df30: 6e74 6169 6e65 7220 7369 7a65 2028 6d61 ntainer size (ma │ │ │ +0017df40: 7869 6d75 6d20 6974 656d 206f 6363 7572 ximum item occur │ │ │ +0017df50: 7265 6e63 6520 636f 6e73 7472 6169 6e74 rence constraint │ │ │ +0017df60: 2920 6173 2070 6172 7365 6420 6672 6f6d ) as parsed from │ │ │ +0017df70: 2058 2e2e 2e22 3e73 6f61 703a 3a6d 6178 X...">soap::max │ │ │ +0017df80: 6f63 6375 7273 3c2f 613e 3c2f 636f 6465 occurs guard, so arra │ │ │ +0017dfa0: 7973 2061 6e64 2063 6f6e 7461 696e 6572 ys and container │ │ │ +0017dfb0: 7320 6172 6520 616c 7761 7973 2072 6573 s are always res │ │ │ +0017dfc0: 7472 6963 7465 6420 696e 206c 656e 6774 tricted in lengt │ │ │ +0017dfd0: 6820 6279 2074 6869 7320 6775 6172 642e h by this guard. │ │ │ +0017dfe0: 3c2f 703e 0a3c 703e 4f74 6865 7220 636f

    .

    Other co │ │ │ +0017dff0: 6d70 696c 652d 7469 6d65 2063 6f6e 6669 mpile-time confi │ │ │ +0017e000: 6775 7261 7469 6f6e 2073 6574 7469 6e67 guration setting │ │ │ +0017e010: 7320 6172 653a 3c2f 703e 0a3c 756c 3e0a s are:

    .
      . │ │ │ +0017e020: 3c6c 693e 3c63 6f64 653e 2353 4f41 505f
    • #SOAP_ │ │ │ +0017e030: 4d41 5841 4c4c 4f43 5349 5a45 3c2f 636f MAXALLOCSIZE the maximum │ │ │ +0017e050: 7369 7a65 206f 6620 6120 626c 6f63 6b20 size of a block │ │ │ +0017e060: 6f66 206d 656d 6f72 7920 7468 6174 203c of memory that < │ │ │ +0017e070: 636f 6465 3e6d 616c 6c6f 633c 2f63 6f64 code>malloc can allocate. │ │ │ +0017e090: 3c2f 6c69 3e0a 3c6c 693e 3c63 6f64 653e
    • .
    • │ │ │ +0017e0a0: 2353 4f41 505f 4d41 5841 5252 4159 5349 #SOAP_MAXARRAYSI │ │ │ +0017e0b0: 5a45 3c2f 636f 6465 3e20 7468 6520 6d61 ZE the ma │ │ │ +0017e0c0: 7869 6d75 6d20 616c 6c6f 6361 7469 6f6e ximum allocation │ │ │ +0017e0d0: 2074 6872 6573 686f 6c64 2074 6f20 7072 threshold to pr │ │ │ +0017e0e0: 652d 616c 6c6f 6361 7465 2053 4f41 5020 e-allocate SOAP │ │ │ +0017e0f0: 6172 7261 7973 2069 6e20 6d65 6d6f 7279 arrays in memory │ │ │ +0017e100: 2e3c 2f6c 693e 0a3c 6c69 3e3c 636f 6465 .
    • .
    • #SOAP_MAXDIMESI │ │ │ +0017e120: 5a45 3c2f 636f 6465 3e20 7468 6520 6d61 ZE the ma │ │ │ +0017e130: 7869 6d75 6d20 4449 4d45 2061 7474 6163 ximum DIME attac │ │ │ +0017e140: 686d 656e 7420 7369 7a65 2061 6c6c 6f77 hment size allow │ │ │ +0017e150: 6564 2074 6f20 7265 6365 6976 652e 3c2f ed to receive..
    • #S │ │ │ +0017e170: 4f41 505f 4d41 5845 494e 5452 3c2f 636f OAP_MAXEINTR maximum numb │ │ │ +0017e190: 6572 206f 6620 4549 4e54 5220 696e 7465 er of EINTR inte │ │ │ +0017e1a0: 7272 7570 7473 2074 6f20 6967 6e6f 7265 rrupts to ignore │ │ │ +0017e1b0: 2077 6869 6c65 2070 6f6c 6c69 6e67 2061 while polling a │ │ │ +0017e1c0: 2073 6f63 6b65 7420 666f 7220 7065 6e64 socket for pend │ │ │ +0017e1d0: 696e 6720 6163 7469 7669 7479 2e3c 2f6c ing activity..
    .

    .... │ │ │ +0017e1f0: 203c 6120 6872 6566 3d22 2322 3e42 6163 Bac │ │ │ +0017e200: 6b20 746f 2074 6162 6c65 206f 6620 636f k to table of co │ │ │ +0017e210: 6e74 656e 7473 3c2f 613e 3c2f 703e 0a3c ntents

    .< │ │ │ +0017e220: 6832 3e3c 6120 636c 6173 733d 2261 6e63 h2>.Timeout m │ │ │ +0017e250: 616e 6167 656d 656e 7420 666f 7220 6e6f anagement for no │ │ │ +0017e260: 6e2d 626c 6f63 6b69 6e67 206f 7065 7261 n-blocking opera │ │ │ +0017e270: 7469 6f6e 733c 2f68 323e 0a3c 703e 536f tions

    .

    So │ │ │ +0017e280: 636b 6574 2063 6f6e 6e65 6374 2c20 6163 cket connect, ac │ │ │ +0017e290: 6365 7074 2c20 7365 6e64 2c20 616e 6420 cept, send, and │ │ │ +0017e2a0: 7265 6365 6976 6520 7469 6d65 6f75 7420 receive timeout │ │ │ +0017e2b0: 7661 6c75 6573 2063 616e 2062 6520 7365 values can be se │ │ │ +0017e2c0: 7420 746f 206d 616e 6167 6520 736f 636b t to manage sock │ │ │ +0017e2d0: 6574 2063 6f6d 6d75 6e69 6361 7469 6f6e et communication │ │ │ +0017e2e0: 2074 696d 656f 7574 732e 2054 6865 203c timeouts. The < │ │ │ +0017e2f0: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soa │ │ │ +0017e3b0: 703a 3a63 6f6e 6e65 6374 5f74 696d 656f p::connect_timeo │ │ │ +0017e3c0: 7574 3c2f 613e 3c2f 636f 6465 3e2c 203c ut, < │ │ │ +0017e3d0: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soa │ │ │ +0017e490: 703a 3a61 6363 6570 745f 7469 6d65 6f75 p::accept_timeou │ │ │ +0017e4a0: 743c 2f61 3e3c 2f63 6f64 653e 2c20 3c63 t, soap │ │ │ +0017e560: 3a3a 7365 6e64 5f74 696d 656f 7574 3c2f ::send_timeout, soap │ │ │ +0017e630: 3a3a 7265 6376 5f74 696d 656f 7574 3c2f ::recv_timeout and soap::tr │ │ │ +0017e710: 616e 7366 6572 5f74 696d 656f 7574 3c2f ansfer_timeout contex │ │ │ +0017e730: 7420 6174 7472 6962 7574 6573 206f 6620 t attributes of │ │ │ +0017e740: 7468 6520 6375 7272 656e 7420 636f 6e74 the current cont │ │ │ +0017e750: 6578 7420 3c63 6f64 653e 3c61 2063 6c61 ext soap can be set │ │ │ +0017e7c0: 2074 6f20 7468 6520 6170 7072 6f70 7269 to the appropri │ │ │ +0017e7d0: 6174 6520 7573 6572 2d64 6566 696e 6564 ate user-defined │ │ │ +0017e7e0: 2073 6f63 6b65 7420 7365 6e64 2c20 7265 socket send, re │ │ │ +0017e7f0: 6365 6976 652c 2061 6e64 2061 6363 6570 ceive, and accep │ │ │ +0017e800: 7420 7469 6d65 6f75 7420 7661 6c75 6573 t timeout values │ │ │ +0017e810: 2e20 4120 706f 7369 7469 7665 2076 616c . A positive val │ │ │ +0017e820: 7565 206d 6561 7375 7265 7320 7468 6520 ue measures the │ │ │ +0017e830: 7469 6d65 6f75 7420 696e 2073 6563 6f6e timeout in secon │ │ │ +0017e840: 6473 2e20 4120 6e65 6761 7469 7665 2074 ds. A negative t │ │ │ +0017e850: 696d 656f 7574 2076 616c 7565 206d 6561 imeout value mea │ │ │ +0017e860: 7375 7265 7320 7468 6520 7469 6d65 6f75 sures the timeou │ │ │ +0017e870: 7420 696e 206d 6963 726f 7365 636f 6e64 t in microsecond │ │ │ +0017e880: 7320 2831 305e 2d36 2073 6563 292e 3c2f s (10^-6 sec)..

    The │ │ │ +0017e8a0: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap::co │ │ │ +0017e960: 6e6e 6563 745f 7469 6d65 6f75 743c 2f61 nnect_timeout specifi │ │ │ +0017e980: 6573 2074 6865 2074 696d 656f 7574 2066 es the timeout f │ │ │ +0017e990: 6f72 203c 636f 6465 3e73 6f61 705f 6361 or soap_ca │ │ │ +0017e9a0: 6c6c 5f6e 735f 5f77 6562 6d65 7468 6f64 ll_ns__webmethod │ │ │ +0017e9b0: 3c2f 636f 6465 3e20 7374 7562 2066 756e stub fun │ │ │ +0017e9c0: 6374 696f 6e20 6361 6c6c 7320 616e 6420 ction calls and │ │ │ +0017e9d0: 666f 7220 432b 2b20 7072 6f78 7920 636c for C++ proxy cl │ │ │ +0017e9e0: 6173 7320 6361 6c6c 732e 3c2f 703e 0a3c ass calls.

    .< │ │ │ +0017e9f0: 703e 5468 6520 3c63 6f64 653e 3c61 2063 p>The soap::accept │ │ │ +0017eac0: 5f74 696d 656f 7574 3c2f 613e 3c2f 636f _timeout specifies th │ │ │ +0017eae0: 6520 7469 6d65 6f75 7420 666f 7220 3c63 e timeout for soa │ │ │ +0017eb70: 705f 6163 6365 7074 3c2f 613e 3c2f 636f p_accept calls.

    .< │ │ │ +0017eb90: 703e 5468 6520 3c63 6f64 653e 3c61 2063 p>The soap::send_t │ │ │ +0017ec50: 696d 656f 7574 3c2f 613e 3c2f 636f 6465 imeout and soap::rec │ │ │ +0017ed20: 765f 7469 6d65 6f75 743c 2f61 3e3c 2f63 v_timeout
    specify the │ │ │ +0017ed40: 2074 696d 656f 7574 2066 6f72 206e 6f6e timeout for non │ │ │ +0017ed50: 2d62 6c6f 636b 696e 6720 736f 636b 6574 -blocking socket │ │ │ +0017ed60: 2049 2f4f 206f 7065 7261 7469 6f6e 732e I/O operations. │ │ │ +0017ed70: 2054 6869 7320 6973 2074 6865 206d 6178 This is the max │ │ │ +0017ed80: 696d 756d 2064 656c 6179 206f 6e20 7468 imum delay on th │ │ │ +0017ed90: 6520 736f 636b 6574 206f 7065 7261 7469 e socket operati │ │ │ +0017eda0: 6f6e 2070 6572 6d69 7474 6564 2e3c 2f70 on permitted.

    .

    The < │ │ │ +0017edc0: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ +0017edd0: 663d 2273 7472 7563 7473 6f61 702e 6874 f="structsoap.ht │ │ │ +0017ede0: 6d6c 2361 6663 6631 6432 3336 6430 3532 ml#afcf1d236d052 │ │ │ +0017edf0: 3537 3931 3232 6637 3835 6437 3633 3963 579122f785d7639c │ │ │ +0017ee00: 3433 6337 2220 7469 746c 653d 2255 7365 43c7" title="Use │ │ │ +0017ee10: 722d 6465 6669 6e61 626c 6520 7469 6d65 r-definable time │ │ │ +0017ee20: 6f75 7420 746f 2073 656e 6420 6f72 2072 out to send or r │ │ │ +0017ee30: 6563 6569 7665 2061 6e20 656e 7469 7265 eceive an entire │ │ │ +0017ee40: 206d 6573 7361 6765 2c20 706f 7369 7469 message, positi │ │ │ +0017ee50: 7665 2074 696d 656f 7574 2076 616c 7565 ve timeout value │ │ │ +0017ee60: 7320 6172 6520 7365 636f 6e64 732c 2e2e s are seconds,.. │ │ │ +0017ee70: 2e22 3e73 6f61 703a 3a74 7261 6e73 6665 .">soap::transfe │ │ │ +0017ee80: 725f 7469 6d65 6f75 743c 2f61 3e3c 2f63 r_timeout is new sinc │ │ │ +0017eea0: 6520 322e 382e 3438 2061 6e64 206c 696d e 2.8.48 and lim │ │ │ +0017eeb0: 6974 7320 7468 6520 7469 6d65 2061 206d its the time a m │ │ │ +0017eec0: 6573 7361 6765 2073 656e 6420 616e 6420 essage send and │ │ │ +0017eed0: 6120 6d65 7373 6167 6520 7265 6365 6976 a message receiv │ │ │ +0017eee0: 6520 6f70 6572 6174 696f 6e20 6361 6e20 e operation can │ │ │ +0017eef0: 7461 6b65 2e20 5468 6973 2076 616c 7565 take. This value │ │ │ +0017ef00: 2073 686f 756c 6420 6265 2075 7365 6420 should be used │ │ │ +0017ef10: 696e 2063 6f6d 6269 6e61 7469 6f6e 2077 in combination w │ │ │ +0017ef20: 6974 6820 3c63 6f64 653e 3c61 2063 6c61 ith soap::send_tim │ │ │ +0017efe0: 656f 7574 3c2f 613e 3c2f 636f 6465 3e20 eout │ │ │ +0017eff0: 616e 6420 3c63 6f64 653e 3c61 2063 6c61 and soap::recv_ │ │ │ +0017f0b0: 7469 6d65 6f75 743c 2f61 3e3c 2f63 6f64 timeout for accurate │ │ │ +0017f0d0: 7469 6d65 6f75 7420 636f 6e74 726f 6c2e timeout control. │ │ │ +0017f0e0: 2054 6865 203c 636f 6465 3e3c 6120 636c The soap::recv_ma │ │ │ +0017f1b0: 786c 656e 6774 683c 2f61 3e3c 2f63 6f64 xlength value when no │ │ │ +0017f1d0: 6e2d 7a65 726f 206c 696d 6974 7320 7468 n-zero limits th │ │ │ +0017f1e0: 6520 6c65 6e67 7468 206f 6620 6d65 7373 e length of mess │ │ │ +0017f1f0: 6167 6573 2074 6861 7420 6361 6e20 6265 ages that can be │ │ │ +0017f200: 2072 6563 6569 7665 6420 696e 2062 7974 received in byt │ │ │ +0017f210: 6573 2069 6e20 746f 7461 6c20 696e 2064 es in total in d │ │ │ +0017f220: 6563 6f6d 7072 6573 7365 6420 666f 726d ecompressed form │ │ │ +0017f230: 2028 6d65 7373 6167 6520 6c65 6e67 7468 (message length │ │ │ +0017f240: 2069 6e63 6c75 6465 7320 4854 5450 2068 includes HTTP h │ │ │ +0017f250: 6561 6465 7273 2061 6e64 2048 5454 5020 eaders and HTTP │ │ │ +0017f260: 6368 756e 6b20 7369 7a65 2066 6965 6c64 chunk size field │ │ │ +0017f270: 7329 2e20 5468 6520 7661 6c75 6520 6f66 s). The value of │ │ │ +0017f280: 203c 636f 6465 3e3c 6120 636c 6173 733d s │ │ │ +0017f340: 6f61 703a 3a72 6563 765f 6d61 786c 656e oap::recv_maxlen │ │ │ +0017f350: 6774 683c 2f61 3e3c 2f63 6f64 653e 2069 gth i │ │ │ +0017f360: 7320 3247 4220 6279 2064 6566 6175 6c74 s 2GB by default │ │ │ +0017f370: 2e3c 2f70 3e0a 3c70 3e45 7861 6d70 6c65 .

    .

    Example │ │ │ +0017f380: 3a3c 2f70 3e0a 3c64 6976 2063 6c61 7373 :

    .
    │ │ │ +0017f4a0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    soap-> │ │ │ +0017f530: 7365 6e64 5f74 696d 656f 7574 3c2f 613e send_timeout │ │ │ +0017f540: 203d 2031 303b 203c 2f64 6976 3e0a 3c64 = 10;
    . │ │ │ +0017f560: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap- │ │ │ +0017f590: 2667 743b 3c61 2063 6c61 7373 3d22 636f >rec │ │ │ +0017f5e0: 765f 7469 6d65 6f75 743c 2f61 3e20 3d20 v_timeout = │ │ │ +0017f5f0: 3130 3b20 3c2f 6469 763e 0a3c 6469 7620 10;
    .
    soap-> │ │ │ +0017f640: 3b3c 6120 636c 6173 733d 2263 6f64 6522 ;recv_t │ │ │ +0017f690: 696d 656f 7574 3c2f 613e 203d 2036 303b imeout = 60; │ │ │ +0017f6a0: 203c 2f64 6976 3e0a 3c2f 6469 763e 3c21
    .
    < │ │ │ +0017f6c0: 703e 5468 6973 2077 696c 6c20 7265 7375 p>This will resu │ │ │ +0017f6d0: 6c74 2069 6e20 6120 7469 6d65 6f75 7420 lt in a timeout │ │ │ +0017f6e0: 6966 206e 6f20 6461 7461 2063 616e 2062 if no data can b │ │ │ +0017f6f0: 6520 7365 6e64 2069 6e20 3130 2073 6563 e send in 10 sec │ │ │ +0017f700: 6f6e 6473 2061 6e64 206e 6f20 6461 7461 onds and no data │ │ │ +0017f710: 2069 7320 7265 6365 6976 6564 2077 6974 is received wit │ │ │ +0017f720: 6869 6e20 3130 2073 6563 6f6e 6473 2061 hin 10 seconds a │ │ │ +0017f730: 6674 6572 2069 6e69 7469 6174 696e 6720 fter initiating │ │ │ +0017f740: 6120 7365 6e64 206f 7220 7265 6365 6976 a send or receiv │ │ │ +0017f750: 6520 6f70 6572 6174 696f 6e20 6f76 6572 e operation over │ │ │ +0017f760: 2074 6865 2073 6f63 6b65 742e 2041 2076 the socket. A v │ │ │ +0017f770: 616c 7565 206f 6620 7a65 726f 2064 6973 alue of zero dis │ │ │ +0017f780: 6162 6c65 7320 7469 6d65 6f75 742c 2066 ables timeout, f │ │ │ +0017f790: 6f72 2065 7861 6d70 6c65 3a3c 2f70 3e0a or example:

    . │ │ │ +0017f7a0: 3c64 6976 2063 6c61 7373 3d22 6672 6167
    st │ │ │ +0017f7e0: 7275 6374 203c 2f73 7061 6e3e 3c61 2063 ruct soap *soap = < │ │ │ +0017f850: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +0017f860: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ +0017f870: 705f 5f63 6f6e 7465 7874 2e68 746d 6c23 p__context.html# │ │ │ +0017f880: 6761 3837 6332 3034 3838 6232 6463 3638 ga87c20488b2dc68 │ │ │ +0017f890: 3061 6161 3736 3839 6231 6430 3234 3938 0aaa7689b1d02498 │ │ │ +0017f8a0: 3963 223e 736f 6170 5f6e 6577 3c2f 613e 9c">soap_new │ │ │ +0017f8b0: 2829 3b20 3c2f 6469 763e 0a3c 6469 7620 ();
    .
    soap-> │ │ │ +0017f900: 3b3c 6120 636c 6173 733d 2263 6f64 6522 ;send_t │ │ │ +0017f950: 696d 656f 7574 3c2f 613e 203d 2030 3b20 imeout = 0; │ │ │ +0017f960: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .

    When a │ │ │ +0017fae0: 2074 696d 656f 7574 206f 6363 7572 7320 timeout occurs │ │ │ +0017faf0: 696e 2074 6865 2073 656e 6420 6f72 2072 in the send or r │ │ │ +0017fb00: 6563 6569 7665 206f 7065 7261 7469 6f6e eceive operation │ │ │ +0017fb10: 732c 2061 203c 636f 6465 3e23 534f 4150 s, a #SOAP │ │ │ +0017fb20: 5f45 4f46 3c2f 636f 6465 3e20 6578 6365 _EOF exce │ │ │ +0017fb30: 7074 696f 6e20 7769 6c6c 2062 6520 7261 ption will be ra │ │ │ +0017fb40: 6973 6564 2028 2265 6e64 206f 6620 6669 ised ("end of fi │ │ │ +0017fb50: 6c65 206f 7220 6e6f 2069 6e70 7574 2229 le or no input") │ │ │ +0017fb60: 2e20 4e65 6761 7469 7665 2074 696d 656f . Negative timeo │ │ │ +0017fb70: 7574 2076 616c 7565 7320 6d65 6173 7572 ut values measur │ │ │ +0017fb80: 6520 7469 6d65 6f75 7473 2069 6e20 6d69 e timeouts in mi │ │ │ +0017fb90: 6372 6f73 6563 6f6e 6473 2c20 666f 7220 croseconds, for │ │ │ +0017fba0: 6578 616d 706c 653a 3c2f 703e 0a3c 6469 example:

    .
    │ │ │ +0017fbf0: 2364 6566 696e 6520 7553 6563 202a 2d31 #define uSec *-1 │ │ │ +0017fc00: 203c 2f73 7061 6e3e 3c2f 6469 763e 0a3c
    .< │ │ │ +0017fc10: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +0017fc20: 3e3c 7370 616e 2063 6c61 7373 3d22 7072 >#def │ │ │ +0017fc40: 696e 6520 6d53 6563 202a 2d31 3030 3020 ine mSec *-1000 │ │ │ +0017fc50: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ +0017fc70: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    │ │ │ +0017fca0: 7374 7275 6374 203c 2f73 7061 6e3e 3c61 struct soap *< │ │ │ +0017fce0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +0017fcf0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ +0017fd00: 6874 6d6c 223e 736f 6170 3c2f 613e 203d html">soap = │ │ │ +0017fd10: 203c 6120 636c 6173 733d 2263 6f64 6522 soap_new();
    .< │ │ │ +0017fd90: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +0017fda0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ +0017fdb0: 6874 6d6c 223e 736f 6170 3c2f 613e 2d26 html">soap-& │ │ │ +0017fdc0: 6774 3b3c 6120 636c 6173 733d 2263 6f64 gt;acce │ │ │ +0017fe10: 7074 5f74 696d 656f 7574 3c2f 613e 203d pt_timeout = │ │ │ +0017fe20: 2031 3020 7553 6563 3b20 3c2f 6469 763e 10 uSec;
    │ │ │ +0017fe30: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    soap-> │ │ │ +0017fec0: 7365 6e64 5f74 696d 656f 7574 3c2f 613e send_timeout │ │ │ +0017fed0: 203d 2032 3020 6d53 6563 3b20 3c2f 6469 = 20 mSec; .
    Warning< │ │ │ +00180080: 2f64 743e 3c64 643e 4d61 6e79 204c 696e /dt>
    Many Lin │ │ │ +00180090: 7578 2076 6572 7369 6f6e 7320 646f 206e ux versions do n │ │ │ +001800a0: 6f74 2073 7570 706f 7274 206e 6f6e 2d62 ot support non-b │ │ │ +001800b0: 6c6f 636b 696e 6720 3c63 6f64 653e 636f locking co │ │ │ +001800c0: 6e6e 6563 7428 293c 2f63 6f64 653e 2e20 nnect(). │ │ │ +001800d0: 5468 6572 6566 6f72 652c 2073 6574 7469 Therefore, setti │ │ │ +001800e0: 6e67 203c 636f 6465 3e3c 6120 636c 6173 ng soap::connect_t │ │ │ +001801b0: 696d 656f 7574 3c2f 613e 3c2f 636f 6465 imeout for non-blocki │ │ │ +001801d0: 6e67 203c 636f 6465 3e73 6f61 705f 6361 ng soap_ca │ │ │ +001801e0: 6c6c 5f6e 735f 5f77 6562 6d65 7468 6f64 ll_ns__webmethod │ │ │ +001801f0: 3c2f 636f 6465 3e20 6361 6c6c 7320 6d61 calls ma │ │ │ +00180200: 7920 6e6f 7420 776f 726b 2075 6e64 6572 y not work under │ │ │ +00180210: 204c 696e 7578 2e3c 2f64 643e 0a3c 6464 Linux.
    .
    .Interrupts (EI │ │ │ +00180230: 4e54 5229 2063 616e 2061 6666 6563 7420 NTR) can affect │ │ │ +00180240: 7468 6520 626c 6f63 6b69 6e67 2074 696d the blocking tim │ │ │ +00180250: 6520 696e 2049 2f4f 206f 7065 7261 7469 e in I/O operati │ │ │ +00180260: 6f6e 732e 2054 6865 206d 6178 696d 756d ons. The maximum │ │ │ +00180270: 206e 756d 6265 7220 6f66 2045 494e 5452 number of EINTR │ │ │ +00180280: 2074 6861 7420 7769 6c6c 206e 6f74 2074 that will not t │ │ │ +00180290: 7269 6767 6572 2061 6e20 6572 726f 7220 rigger an error │ │ │ +001802a0: 6973 2073 6574 2062 7920 3c63 6f64 653e is set by │ │ │ +001802b0: 2353 4f41 505f 4d41 5845 494e 5452 3c2f #SOAP_MAXEINTR in gsoap/stdsoap │ │ │ +001802e0: 322e 683c 2f63 6f64 653e 3c2f 656d 3e2c 2.h, │ │ │ +001802f0: 2077 6869 6368 2069 7320 3130 2062 7920 which is 10 by │ │ │ +00180300: 6465 6661 756c 742e 2045 6163 6820 4549 default. Each EI │ │ │ +00180310: 4e54 5220 6d61 7920 696e 6372 6561 7365 NTR may increase │ │ │ +00180320: 2074 6865 2062 6c6f 636b 696e 6720 7469 the blocking ti │ │ │ +00180330: 6d65 2062 7920 7570 2074 6f20 6f6e 6520 me by up to one │ │ │ +00180340: 7365 636f 6e64 2c20 7570 2074 6f20 3c63 second, up to #SOAP_MAXEIN │ │ │ +00180360: 5452 3c2f 636f 6465 3e20 7365 636f 6e64 TR second │ │ │ +00180370: 7320 746f 7461 6c2e 3c2f 6464 3e3c 2f64 s total.
    .

    .... Back to t │ │ │ +001803a0: 6162 6c65 206f 6620 636f 6e74 656e 7473 able of contents │ │ │ +001803b0: 3c2f 613e 3c2f 703e 0a3c 6832 3e3c 6120

    .

    < │ │ │ +001803e0: 2f61 3e0a 436c 6f73 696e 6720 636f 6e6e /a>.Closing conn │ │ │ +001803f0: 6563 7469 6f6e 7320 6279 2066 6f72 6365 ections by force │ │ │ +00180400: 3c2f 6832 3e0a 3c70 3e54 6f20 636c 6f73

    .

    To clos │ │ │ +00180410: 6520 6120 736f 636b 6574 2063 6f6e 6e65 e a socket conne │ │ │ +00180420: 6374 696f 6e20 6279 2066 6f72 6365 2c20 ction by force, │ │ │ +00180430: 796f 7520 6361 6e20 7573 6520 3c63 6f64 you can use soap_force_clo │ │ │ +00180450: 7365 736f 636b 2873 6f61 7029 3c2f 636f sesock(soap), which close │ │ │ +00180470: 7320 7468 6520 636f 6e6e 6563 7469 6f6e s the connection │ │ │ +00180480: 2072 6567 6172 646c 6573 7320 6966 206b regardless if k │ │ │ +00180490: 6565 702d 616c 6976 6520 6973 2061 6374 eep-alive is act │ │ │ +001804a0: 6976 652e 2042 7920 636f 6e74 7261 7374 ive. By contrast │ │ │ +001804b0: 2c20 3c63 6f64 653e 736f 6170 5f63 6c6f , soap_clo │ │ │ +001804c0: 7365 736f 636b 2873 6f61 7029 3c2f 636f sesock(soap) only closes │ │ │ +001804e0: 7468 6520 636f 6e6e 6563 7469 6f6e 2077 the connection w │ │ │ +001804f0: 6865 6e20 6b65 6570 2d61 6c69 7665 2069 hen keep-alive i │ │ │ +00180500: 7320 6e6f 7420 6163 7469 7665 2e3c 2f70 s not active.

    .

    To force-cl │ │ │ +00180520: 6f73 6520 6120 636f 6e6e 6563 7469 6f6e ose a connection │ │ │ +00180530: 2066 726f 6d20 616e 6f74 6865 7220 7468 from another th │ │ │ +00180540: 7265 6164 2c20 636f 6d70 696c 6520 7374 read, compile st │ │ │ +00180550: 6473 6f61 7032 2e63 206f 7220 7374 6473 dsoap2.c or stds │ │ │ +00180560: 6f61 7032 2e63 7070 2061 6e64 2079 6f75 oap2.cpp and you │ │ │ +00180570: 7220 7072 6f6a 6563 7420 736f 7572 6365 r project source │ │ │ +00180580: 2063 6f64 6520 7769 7468 203c 636f 6465 code with #WITH_SELF_PIPE │ │ │ +001805a0: 3c2f 636f 6465 3e20 746f 2065 6e61 626c to enabl │ │ │ +001805b0: 6520 7468 6973 2066 6561 7475 7265 2e20 e this feature. │ │ │ +001805c0: 5573 6520 3c63 6f64 653e 736f 6170 5f63 Use soap_c │ │ │ +001805d0: 6c6f 7365 5f63 6f6e 6e65 6374 696f 6e28 lose_connection( │ │ │ +001805e0: 736f 6170 293c 2f63 6f64 653e 206f 6e20 soap) on │ │ │ +001805f0: 7468 6520 3c63 6f64 653e 3c61 2063 6c61 the soap context th │ │ │ +00180660: 6174 206d 7573 7420 636c 6f73 652e 2059 at must close. Y │ │ │ +00180670: 6f75 2063 616e 206d 616b 6520 7468 6973 ou can make this │ │ │ +00180680: 2063 616c 6c20 6672 6f6d 2061 6e6f 7468 call from anoth │ │ │ +00180690: 6572 2074 6872 6561 6420 616e 6420 7061 er thread and pa │ │ │ +001806a0: 7373 2074 6865 203c 636f 6465 3e3c 6120 ss the soap context │ │ │ +00180710: 2074 6f20 7468 6973 2066 756e 6374 696f to this functio │ │ │ +00180720: 6e20 6f66 2074 6865 2074 6872 6561 6420 n of the thread │ │ │ +00180730: 7468 6174 206d 7573 7420 636c 6f73 6520 that must close │ │ │ +00180740: 636f 6e6e 6563 7469 6f6e 732e 3c2f 703e connections.

    │ │ │ +00180750: 0a3c 703e f09f 949d 203c 6120 6872 6566 .

    .... Back to tab │ │ │ +00180770: 6c65 206f 6620 636f 6e74 656e 7473 3c2f le of contents

    .

    │ │ │ +001807b0: 0a53 6f63 6b65 7420 6f70 7469 6f6e 7320 .Socket options │ │ │ +001807c0: 616e 6420 666c 6167 733c 2f68 323e 0a3c and flags

    .< │ │ │ +001807d0: 703e 536f 636b 6574 2063 6f6d 6d75 6e69 p>Socket communi │ │ │ +001807e0: 6361 7469 6f6e 7320 6361 6e20 6265 2063 cations can be c │ │ │ +001807f0: 6f6e 7472 6f6c 6c65 6420 7769 7468 2073 ontrolled with s │ │ │ +00180800: 6f63 6b65 7420 6f70 7469 6f6e 7320 616e ocket options an │ │ │ +00180810: 6420 666c 6167 732e 2054 6865 203c 636f d flags. The s │ │ │ +00180870: 6f61 703c 2f61 3e3c 2f63 6f64 653e 2063 oap
    c │ │ │ +00180880: 6f6e 7465 7874 2066 6c61 6773 2061 7265 ontext flags are │ │ │ +00180890: 3a3c 2f70 3e0a 3c75 6c3e 0a3c 6c69 3e3c :

    .
      .
    • < │ │ │ +001808a0: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soa │ │ │ +00180960: 703a 3a73 6f63 6b65 745f 666c 6167 733c p::socket_flags< │ │ │ +00180970: 2f61 3e3c 2f63 6f64 653e 2074 6f20 7365 /a> to se │ │ │ +00180980: 7420 666c 6167 7320 666f 7220 7468 6520 t flags for the │ │ │ +00180990: 736f 636b 6574 203c 636f 6465 3e73 656e socket sen │ │ │ +001809a0: 643c 2f63 6f64 653e 2061 6e64 203c 636f d and recv c │ │ │ +001809c0: 616c 6c73 2e3c 2f6c 693e 0a3c 6c69 3e3c alls.
    • .
    • < │ │ │ +001809d0: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soa │ │ │ +00180a90: 703a 3a63 6f6e 6e65 6374 5f66 6c61 6773 p::connect_flags │ │ │ +00180aa0: 3c2f 613e 3c2f 636f 6465 3e20 746f 2073 to s │ │ │ +00180ab0: 6574 2063 6c69 656e 742d 7369 6465 203c et client-side < │ │ │ +00180ac0: 636f 6465 3e73 6574 736f 636b 6f70 743c code>setsockopt< │ │ │ +00180ad0: 2f63 6f64 653e 203c 636f 6465 3e53 4f4c /code> SOL │ │ │ +00180ae0: 5f53 4f43 4b45 543c 2f63 6f64 653e 2073 _SOCKET s │ │ │ +00180af0: 6f63 6b65 7420 6f70 7469 6f6e 7320 7768 ocket options wh │ │ │ +00180b00: 656e 2063 6f6e 6e65 6374 696e 672e 3c2f en connecting..
    • soap::bind │ │ │ +00180be0: 5f66 6c61 6773 3c2f 613e 3c2f 636f 6465 _flags to set server- │ │ │ +00180c00: 7369 6465 203c 636f 6465 3e73 6574 736f side setso │ │ │ +00180c10: 636b 6f70 743c 2f63 6f64 653e 203c 636f ckopt SOL_SOCKET socket opti │ │ │ +00180c40: 6f6e 7320 7768 656e 2065 7865 6375 7469 ons when executi │ │ │ +00180c50: 6e67 203c 636f 6465 3e3c 6120 636c 6173 ng soap_b │ │ │ +00180cd0: 696e 643c 2f61 3e3c 2f63 6f64 653e 2e3c ind.< │ │ │ +00180ce0: 2f6c 693e 0a3c 6c69 3e3c 636f 6465 3e3c /li>.
    • < │ │ │ +00180cf0: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ +00180d00: 663d 2273 7472 7563 7473 6f61 702e 6874 f="structsoap.ht │ │ │ +00180d10: 6d6c 2361 3930 6530 3430 3237 6561 3965 ml#a90e04027ea9e │ │ │ +00180d20: 6661 3236 6535 3530 6635 3433 3861 6239 fa26e550f5438ab9 │ │ │ +00180d30: 6633 6436 2220 7469 746c 653d 2255 7365 f3d6" title="Use │ │ │ +00180d40: 722d 6465 6669 6e61 626c 6520 666c 6167 r-definable flag │ │ │ +00180d50: 2c20 7768 656e 206e 6f6e 7a65 726f 2065 , when nonzero e │ │ │ +00180d60: 6e61 626c 6573 2049 5050 524f 544f 5f49 nables IPPROTO_I │ │ │ +00180d70: 5056 3620 7365 7473 6f63 6b6f 7074 2049 PV6 setsockopt I │ │ │ +00180d80: 5056 365f 5636 4f4e 4c59 2077 6865 6e20 PV6_V6ONLY when │ │ │ +00180d90: 6269 6e64 696e 6720 7468 6520 736f 6170 binding the soap │ │ │ +00180da0: 3a3a 2e2e 2e22 3e73 6f61 703a 3a62 696e ::...">soap::bin │ │ │ +00180db0: 645f 7636 6f6e 6c79 3c2f 613e 3c2f 636f d_v6only set to 1 to │ │ │ +00180dd0: 7365 7420 3c63 6f64 653e 7365 7473 6f63 set setsoc │ │ │ +00180de0: 6b6f 7074 3c2f 636f 6465 3e20 3c63 6f64 kopt IPPROTO_IPV6 IPV6 │ │ │ +00180e10: 5f56 364f 4e4c 593c 2f63 6f64 653e 2e3c _V6ONLY.< │ │ │ +00180e20: 2f6c 693e 0a3c 6c69 3e3c 636f 6465 3e3c /li>.
    • < │ │ │ +00180e30: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ +00180e40: 663d 2273 7472 7563 7473 6f61 702e 6874 f="structsoap.ht │ │ │ +00180e50: 6d6c 2361 6439 3866 3132 6636 3032 6566 ml#ad98f12f602ef │ │ │ +00180e60: 6464 6530 3439 6462 6433 3637 6134 3365 dde049dbd367a43e │ │ │ +00180e70: 3763 6230 2220 7469 746c 653d 2255 7365 7cb0" title="Use │ │ │ +00180e80: 722d 6465 6669 6e61 626c 6520 7365 7473 r-definable sets │ │ │ +00180e90: 6f63 6b6f 7074 206c 6576 656c 2053 4f4c ockopt level SOL │ │ │ +00180ea0: 5f53 4f43 4b45 5420 666c 6167 7320 2830 _SOCKET flags (0 │ │ │ +00180eb0: 2062 7920 6465 6661 756c 7429 2c20 7768 by default), wh │ │ │ +00180ec0: 656e 206e 6f6e 7a65 726f 2073 6574 7320 en nonzero sets │ │ │ +00180ed0: 7468 6520 736f 6170 3a3a 736f 636b 6574 the soap::socket │ │ │ +00180ee0: 2066 2e2e 2e22 3e73 6f61 703a 3a61 6363 f...">soap::acc │ │ │ +00180ef0: 6570 745f 666c 6167 733c 2f61 3e3c 2f63 ept_flags to set flag │ │ │ +00180f10: 7320 746f 2074 6865 203c 636f 6465 3e73 s to the s │ │ │ +00180f20: 6574 736f 636b 6f70 743c 2f63 6f64 653e etsockopt │ │ │ +00180f30: 2073 6f63 6b65 7420 6f70 7469 6f6e 7320 socket options │ │ │ +00180f40: 7768 656e 2065 7865 6375 7469 6e67 203c when executing < │ │ │ +00180f50: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>so │ │ │ +00180fd0: 6170 5f61 6363 6570 743c 2f61 3e3c 2f63 ap_accept.
    • .
    │ │ │ +00180ff0: 0a3c 703e 5365 6520 7468 6520 6f70 6572 .

    See the oper │ │ │ +00181000: 6174 696e 6720 7379 7374 656d 206d 616e ating system man │ │ │ +00181010: 7561 6c20 7061 6765 7320 6f66 203c 636f ual pages of send a │ │ │ +00181030: 6e64 203c 636f 6465 3e72 6563 763c 2f63 nd recv for < │ │ │ +00181050: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ +00181060: 663d 2273 7472 7563 7473 6f61 702e 6874 f="structsoap.ht │ │ │ +00181070: 6d6c 2361 6165 3365 6565 3737 3164 3863 ml#aae3eee771d8c │ │ │ +00181080: 3430 3331 6433 3064 3463 6137 3633 3365 4031d30d4ca7633e │ │ │ +00181090: 6466 3966 2220 7469 746c 653d 2255 7365 df9f" title="Use │ │ │ +001810a0: 722d 6465 6669 6e61 626c 6520 736f 636b r-definable sock │ │ │ +001810b0: 6574 2073 656e 6420 616e 6420 7265 6376 et send and recv │ │ │ +001810c0: 2066 6c61 6773 2c20 666f 7220 6578 616d flags, for exam │ │ │ +001810d0: 706c 6520 6173 7369 676e 204d 5347 5f4e ple assign MSG_N │ │ │ +001810e0: 4f53 4947 4e41 4c20 746f 2064 6973 6162 OSIGNAL to disab │ │ │ +001810f0: 6c65 2073 6967 7069 7065 2028 7468 6520 le sigpipe (the │ │ │ +00181100: 7661 2e2e 2e22 3e73 6f61 703a 3a73 6f63 va...">soap::soc │ │ │ +00181110: 6b65 745f 666c 6167 733c 2f61 3e3c 2f63 ket_flags values and │ │ │ +00181130: 7365 6520 7468 6520 6f70 6572 6174 696e see the operatin │ │ │ +00181140: 6720 7379 7374 656d 206d 616e 7561 6c20 g system manual │ │ │ +00181150: 7061 6765 7320 6f66 203c 636f 6465 3e73 pages of s │ │ │ +00181160: 6574 736f 636b 6f70 743c 2f63 6f64 653e etsockopt │ │ │ +00181170: 2066 6f72 203c 636f 6465 3e3c 6120 636c for soap::connect │ │ │ +00181240: 5f66 6c61 6773 3c2f 613e 3c2f 636f 6465 _flags, soap::bind_flag │ │ │ +00181320: 733c 2f61 3e3c 2f63 6f64 653e 2c20 616e s, an │ │ │ +00181330: 6420 3c63 6f64 653e 3c61 2063 6c61 7373 d │ │ │ +001813f0: 736f 6170 3a3a 6163 6365 7074 5f66 6c61 soap::accept_fla │ │ │ +00181400: 6773 3c2f 613e 3c2f 636f 6465 3e20 286c gs (l │ │ │ +00181410: 6576 656c 203c 636f 6465 3e53 4f4c 5f53 evel SOL_S │ │ │ +00181420: 4f43 4b45 543c 2f63 6f64 653e 2920 7661 OCKET) va │ │ │ +00181430: 6c75 6573 2e20 5468 6573 6520 3c63 6f64 lues. These SO_ soc │ │ │ +00181450: 6b65 7420 6f70 7469 6f6e 2066 6c61 6773 ket option flags │ │ │ +00181460: 2028 7365 6520 3c63 6f64 653e 7365 7473 (see sets │ │ │ +00181470: 6f63 6b6f 7074 3c2f 636f 6465 3e20 6d61 ockopt ma │ │ │ +00181480: 6e75 616c 2070 6167 6573 2920 6361 6e20 nual pages) can │ │ │ +00181490: 6265 2062 6974 2d77 6973 6520 6f72 2d65 be bit-wise or-e │ │ │ +001814a0: 6420 746f 2073 6574 206d 756c 7469 706c d to set multipl │ │ │ +001814b0: 6520 736f 636b 6574 206f 7074 696f 6e73 e socket options │ │ │ +001814c0: 2061 7420 6f6e 6365 2e3c 2f70 3e0a 3c70 at once.

    .

    The client-side │ │ │ +001814e0: 2066 6c61 6720 3c63 6f64 653e 3c61 2063 flag soap::connec │ │ │ +001815b0: 745f 666c 6167 733c 2f61 3e3c 2f63 6f64 t_flags = SO_LI │ │ │ +001815d0: 4e47 4552 3c2f 636f 6465 3e20 6973 2073 NGER is s │ │ │ +001815e0: 7570 706f 7274 6564 2077 6974 6820 7661 upported with va │ │ │ +001815f0: 6c75 6573 203c 636f 6465 3e6c 5f6f 6e6f lues l_ono │ │ │ +00181600: 6666 3c2f 636f 6465 3e20 3d20 3120 616e ff = 1 an │ │ │ +00181610: 6420 3c63 6f64 653e 6c5f 6c69 6e67 6572 d l_linger │ │ │ +00181620: 3c2f 636f 6465 3e20 3d20 3c63 6f64 653e = │ │ │ +00181630: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap::li │ │ │ +001816f0: 6e67 6572 5f74 696d 653c 2f61 3e3c 2f63 nger_time. The │ │ │ +00181710: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap::li │ │ │ +001817d0: 6e67 6572 5f74 696d 653c 2f61 3e3c 2f63 nger_time determines │ │ │ +001817f0: 7468 6520 7761 6974 2074 696d 6520 2874 the wait time (t │ │ │ +00181800: 6865 2074 696d 6520 7265 736f 6c75 7469 he time resoluti │ │ │ +00181810: 6f6e 2069 7320 7379 7374 656d 2064 6570 on is system dep │ │ │ +00181820: 656e 6465 6e74 2c20 7468 6f75 6768 2061 endent, though a │ │ │ +00181830: 6363 6f72 6469 6e67 2074 6f20 736f 6d65 ccording to some │ │ │ +00181840: 2065 7870 6572 7473 206f 6e6c 7920 7a65 experts only ze │ │ │ +00181850: 726f 2061 6e64 206e 6f6e 7a65 726f 2076 ro and nonzero v │ │ │ +00181860: 616c 7565 7320 6d61 7474 6572 292e 2054 alues matter). T │ │ │ +00181870: 6865 206c 696e 6765 7220 6f70 7469 6f6e he linger option │ │ │ +00181880: 2063 616e 2062 6520 7573 6564 2074 6f20 can be used to │ │ │ +00181890: 6d61 6e61 6765 2074 6865 206e 756d 6265 manage the numbe │ │ │ +001818a0: 7220 6f66 2063 6f6e 6e65 6374 696f 6e73 r of connections │ │ │ +001818b0: 2074 6861 7420 7265 6d61 696e 2069 6e20 that remain in │ │ │ +001818c0: 3c63 6f64 653e 5449 4d45 5f57 4149 543c TIME_WAIT< │ │ │ +001818d0: 2f63 6f64 653e 2073 7461 7465 2061 7420 /code> state at │ │ │ +001818e0: 7468 6520 7365 7276 6572 2073 6964 652e the server side. │ │ │ +001818f0: 3c2f 703e 0a3c 703e 466f 7220 6578 616d

    .

    For exam │ │ │ +00181900: 706c 652c 2074 6f20 6469 7361 626c 6520 ple, to disable │ │ │ +00181910: 5349 4750 4950 4520 7369 676e 616c 7320 SIGPIPE signals │ │ │ +00181920: 6f6e 2055 6e69 782f 4c69 6e75 7820 706c on Unix/Linux pl │ │ │ +00181930: 6174 666f 726d 7320 7573 653a 203c 636f atforms use: soap: │ │ │ +00181a00: 3a73 6f63 6b65 745f 666c 6167 733c 2f61 :socket_flags = MSG_NOSIGNAL and/or soap:: │ │ │ +00181b00: 636f 6e6e 6563 745f 666c 6167 733c 2f61 connect_flags = SO_NOSIGPIPE (i.e. clien │ │ │ +00181b40: 742d 7369 6465 2063 6f6e 6e65 6374 2920 t-side connect) │ │ │ +00181b50: 6465 7065 6e64 696e 6720 6f6e 2079 6f75 depending on you │ │ │ +00181b60: 7220 706c 6174 666f 726d 2e3c 2f70 3e0a r platform.

    . │ │ │ +00181b70: 3c70 3e55 7365 203c 636f 6465 3e3c 6120

    Use soap::bind_ │ │ │ +00181c40: 666c 6167 733c 2f61 3e3c 2f63 6f64 653e flags │ │ │ +00181c50: 203d 203c 636f 6465 3e53 4f5f 5245 5553 = SO_REUS │ │ │ +00181c60: 4541 4444 523c 2f63 6f64 653e 2074 6f20 EADDR to │ │ │ +00181c70: 656e 6162 6c65 2073 6572 7665 722d 7369 enable server-si │ │ │ +00181c80: 6465 2070 6f72 7420 7265 7573 6520 616e de port reuse an │ │ │ +00181c90: 6420 6c6f 6361 6c20 706f 7274 2073 6861 d local port sha │ │ │ +00181ca0: 7269 6e67 2028 6275 7420 6265 2061 7761 ring (but be awa │ │ │ +00181cb0: 7265 206f 6620 7468 6520 706f 7373 6962 re of the possib │ │ │ +00181cc0: 6c65 2073 6563 7572 6974 7920 696d 706c le security impl │ │ │ +00181cd0: 6963 6174 696f 6e73 2073 7563 6820 6173 ications such as │ │ │ +00181ce0: 2070 6f72 7420 6869 6a61 636b 696e 6729 port hijacking) │ │ │ +00181cf0: 2e3c 2f70 3e0a 3c70 3e4e 6f74 6520 7468 .

    .

    Note th │ │ │ +00181d00: 6174 2079 6f75 2068 6176 6520 6163 6365 at you have acce │ │ │ +00181d10: 7373 2074 6f20 7468 6520 3c63 6f64 653e ss to the │ │ │ +00181d20: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap │ │ │ +00181d70: 3c2f 613e 2d26 6774 3b6d 6173 7465 723c ->master< │ │ │ +00181d80: 2f63 6f64 653e 2073 6f63 6b65 7420 7661 /code> socket va │ │ │ +00181d90: 6c75 6520 7265 7475 726e 6564 2062 7920 lue returned by │ │ │ +00181da0: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 soap_bind │ │ │ +00181e20: 3c2f 613e 3c2f 636f 6465 3e20 736f 2079 so y │ │ │ +00181e30: 6f75 2063 616e 2073 6574 206d 756c 7469 ou can set multi │ │ │ +00181e40: 706c 6520 736f 636b 6574 206f 7074 696f ple socket optio │ │ │ +00181e50: 6e73 2062 7920 6361 6c6c 696e 6720 3c63 ns by calling setsockopt as follows │ │ │ +00181e80: 3a3c 2f70 3e0a 3c64 6976 2063 6c61 7373 :

    .
    . │ │ │ +00182020: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    if (soap_va │ │ │ +001820b0: 6c69 645f 736f 636b 6574 3c2f 613e 2873 lid_socket(s │ │ │ +001820c0: 6f63 6b29 2920 3c2f 6469 763e 0a3c 6469 ock))
    .{ │ │ │ +001820e0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    setso │ │ │ +00182100: 636b 6f70 7428 736f 636b 2c20 2e2e 2e2c ckopt(sock, ..., │ │ │ +00182110: 202e 2e2e 2c20 2e2e 2e2c 202e 2e2e 293b ..., ..., ...); │ │ │ +00182120: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    setso │ │ │ +00182140: 636b 6f70 7428 736f 636b 2c20 2e2e 2e2c ckopt(sock, ..., │ │ │ +00182150: 202e 2e2e 2c20 2e2e 2e2c 202e 2e2e 293b ..., ..., ...); │ │ │ +00182160: 3c2f 6469 763e 0a3c 2f64 6976 3e3c 212d
    .

    .... Back to table │ │ │ +001821a0: 6f66 2063 6f6e 7465 6e74 733c 2f61 3e3c of contents< │ │ │ +001821b0: 2f70 3e0a 3c68 323e 3c61 2063 6c61 7373 /p>.

    < │ │ │ +001821e0: 2f61 3e0a 4f76 6572 7269 6469 6e67 2074 /a>.Overriding t │ │ │ +001821f0: 6865 2068 6f73 7420 616e 6420 706f 7274 he host and port │ │ │ +00182200: 2074 6f20 636f 6e6e 6563 743c 2f68 323e to connect

    │ │ │ +00182210: 0a3c 703e 546f 206f 7665 7272 6964 6520 .

    To override │ │ │ +00182220: 7468 6520 686f 7374 2061 6e64 2070 6f72 the host and por │ │ │ +00182230: 7420 6f66 2074 6865 2063 6c69 656e 7420 t of the client │ │ │ +00182240: 636f 6e6e 6563 7469 6e67 2074 6f20 6120 connecting to a │ │ │ +00182250: 7365 7276 6572 2c20 7365 7420 3c63 6f64 server, set soap:: │ │ │ +00182320: 6f76 6572 7269 6465 5f68 6f73 743c 2f61 override_host and soap: │ │ │ +00182400: 3a6f 7665 7272 6964 655f 706f 7274 3c2f :override_port:

    .< │ │ │ +00182420: 6469 7620 636c 6173 733d 2266 7261 676d div class="fragm │ │ │ +00182430: 656e 7422 3e3c 6469 7620 636c 6173 733d ent">
    so │ │ │ +00182470: 6170 3c2f 613e 2d26 6774 3b3c 6120 636c ap->override_hos │ │ │ +001824d0: 743c 2f61 3e20 3d20 3c73 7061 6e20 636c t = "exampl │ │ │ +00182500: 652e 636f 6d26 7175 6f74 3b3c 2f73 7061 e.com"; // hos │ │ │ +00182530: 7420 6e61 6d65 206f 7220 4950 2061 6464 t name or IP add │ │ │ +00182540: 7265 7373 203c 2f73 7061 6e3e 3c2f 6469 ress ..
    │ │ │ +00182710: 3c64 6976 2063 6c61 7373 3d22 7474 6465
    const char * │ │ │ +00182730: 206f 7665 7272 6964 655f 686f 7374 3c2f override_host
    User-defi │ │ │ +00182760: 6e61 626c 6520 7374 7269 6e67 2074 6f20 nable string to │ │ │ +00182770: 6f76 6572 7269 6465 2074 6865 2068 6f73 override the hos │ │ │ +00182780: 7420 6e61 6d65 206f 7220 4950 2061 6464 t name or IP add │ │ │ +00182790: 7265 7373 2069 6e20 7468 6520 4854 5450 ress in the HTTP │ │ │ +001827a0: 2068 6561 6465 7220 7768 656e 2063 6f6e header when con │ │ │ +001827b0: 6e65 6374 696e 6720 6174 2074 2e2e 2e3c necting at t...< │ │ │ +001827c0: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
    Defin │ │ │ +001827e0: 6974 696f 6e3a 3c2f 623e 2073 7464 736f ition: stdso │ │ │ +001827f0: 6170 322e 683a 3430 3534 3c2f 6469 763e ap2.h:4054
    │ │ │ +00182800: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    │ │ │ +00182850: 3c64 6976 2063 6c61 7373 3d22 7474 6e61 int override_po │ │ │ +001828e0: 7274 3c2f 6469 763e 3c64 6976 2063 6c61 rt
    User- │ │ │ +00182900: 6465 6669 6e61 626c 6520 706f 7274 206e definable port n │ │ │ +00182910: 756d 6265 7220 746f 206f 7665 7272 6964 umber to overrid │ │ │ +00182920: 6520 7468 6520 706f 7274 2061 6464 7265 e the port addre │ │ │ +00182930: 7373 2069 6e20 7468 6520 4854 5450 2068 ss in the HTTP h │ │ │ +00182940: 6561 6465 7220 7768 656e 2063 6f6e 6e65 eader when conne │ │ │ +00182950: 6374 696e 6720 6174 2074 6865 2063 6c69 cting at the cli │ │ │ +00182960: 2e2e 2e3c 2f64 6976 3e3c 6469 7620 636c ...
    D │ │ │ +00182980: 6566 696e 6974 696f 6e3a 3c2f 623e 2073 efinition: s │ │ │ +00182990: 7464 736f 6170 322e 683a 3430 3539 3c2f tdsoap2.h:4059
    .

    The < │ │ │ +00185e10: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soap_ssl │ │ │ +00185ea0: 5f73 6572 7665 725f 636f 6e74 6578 743c _server_context< │ │ │ +00185eb0: 2f61 3e3c 2f63 6f64 653e 2066 756e 6374 /a> funct │ │ │ +00185ec0: 696f 6e20 696e 6974 6961 6c69 7a65 7320 ion initializes │ │ │ +00185ed0: 7468 6520 7365 7276 6572 2d73 6964 6520 the server-side │ │ │ +00185ee0: 5353 4c20 636f 6e74 6578 742e 2054 6865 SSL context. The │ │ │ +00185ef0: 203c 656d 3e3c 636f 6465 3e73 6572 7665 serve │ │ │ +00185f00: 722e 7065 6d3c 2f63 6f64 653e 3c2f 656d r.pem key file is th │ │ │ +00185f20: 6520 7365 7276 6572 2773 2070 7269 7661 e server's priva │ │ │ +00185f30: 7465 206b 6579 2063 6f6e 6361 7465 6e61 te key concatena │ │ │ +00185f40: 7465 6420 7769 7468 2069 7473 2063 6572 ted with its cer │ │ │ +00185f50: 7469 6669 6361 7465 2e20 5468 6520 3c65 tificate. The cacert.p │ │ │ +00185f70: 656d 3c2f 636f 6465 3e3c 2f65 6d3e 2069 em i │ │ │ +00185f80: 7320 7573 6564 2074 6f20 6175 7468 656e s used to authen │ │ │ +00185f90: 7469 6361 7465 2063 6c69 656e 7473 2061 ticate clients a │ │ │ +00185fa0: 6e64 2063 6f6e 7461 696e 7320 7468 6520 nd contains the │ │ │ +00185fb0: 636c 6965 6e74 2063 6572 7469 6669 6361 client certifica │ │ │ +00185fc0: 7465 732e 2041 6c74 6572 6e61 7469 7665 tes. Alternative │ │ │ +00185fd0: 6c79 2061 2064 6972 6563 746f 7279 206e ly a directory n │ │ │ +00185fe0: 616d 6520 6361 6e20 6265 2073 7065 6369 ame can be speci │ │ │ +00185ff0: 6669 6564 2e20 5468 6973 2064 6972 6563 fied. This direc │ │ │ +00186000: 746f 7279 2069 7320 6173 7375 6d65 6420 tory is assumed │ │ │ +00186010: 746f 2063 6f6e 7461 696e 2074 6865 2063 to contain the c │ │ │ +00186020: 6572 7469 6669 6361 7465 732e 2054 6865 ertificates. The │ │ │ +00186030: 203c 656d 3e3c 636f 6465 3e64 6835 3132 dh512 │ │ │ +00186040: 2e70 656d 3c2f 636f 6465 3e3c 2f65 6d3e .pem │ │ │ +00186050: 2066 696c 6520 7370 6563 6966 6965 7320 file specifies │ │ │ +00186060: 7468 6174 2044 4820 7769 6c6c 2062 6520 that DH will be │ │ │ +00186070: 7573 6564 2066 6f72 206b 6579 2061 6772 used for key agr │ │ │ +00186080: 6565 6d65 6e74 2069 6e73 7465 6164 206f eement instead o │ │ │ +00186090: 6620 5253 412e 2041 206e 756d 6572 6963 f RSA. A numeric │ │ │ +001860a0: 2076 616c 7565 2067 7265 6174 6572 2074 value greater t │ │ │ +001860b0: 6861 6e20 3531 3220 6361 6e20 6265 2070 han 512 can be p │ │ │ +001860c0: 726f 7669 6465 6420 696e 7374 6561 6420 rovided instead │ │ │ +001860d0: 6173 2061 2073 7472 696e 6720 636f 6e73 as a string cons │ │ │ +001860e0: 7461 6e74 2028 652e 672e 203c 636f 6465 tant (e.g. "512") t │ │ │ +00186100: 6f20 616c 6c6f 7720 7468 6520 656e 6769 o allow the engi │ │ │ +00186110: 6e65 2074 6f20 6765 6e65 7261 7465 2074 ne to generate t │ │ │ +00186120: 6865 2044 4820 7061 7261 6d65 7465 7273 he DH parameters │ │ │ +00186130: 206f 6e20 7468 6520 666c 7920 2874 6869 on the fly (thi │ │ │ +00186140: 7320 6361 6e20 7461 6b65 2061 2077 6869 s can take a whi │ │ │ +00186150: 6c65 2920 7261 7468 6572 2074 6861 6e20 le) rather than │ │ │ +00186160: 7265 7472 6965 7669 6e67 2074 6865 6d20 retrieving them │ │ │ +00186170: 6672 6f6d 2061 2066 696c 652e 2054 6865 from a file. The │ │ │ +00186180: 2072 616e 6466 696c 6520 656e 7472 7920 randfile entry │ │ │ +00186190: 6361 6e20 6265 2075 7365 6420 746f 2073 can be used to s │ │ │ +001861a0: 6565 6420 7468 6520 5052 4e47 2e20 5468 eed the PRNG. Th │ │ │ +001861b0: 6520 6c61 7374 2065 6e74 7279 2065 6e61 e last entry ena │ │ │ +001861c0: 626c 6520 7365 7276 6572 2d73 6964 6520 ble server-side │ │ │ +001861d0: 7365 7373 696f 6e20 6361 6368 696e 6720 session caching │ │ │ +001861e0: 746f 2073 7065 6564 2075 7020 544c 532e to speed up TLS. │ │ │ +001861f0: 2041 2075 6e69 7175 6520 7365 7276 6572 A unique server │ │ │ +00186200: 206e 616d 6520 6973 2072 6571 7569 7265 name is require │ │ │ +00186210: 642e 3c2f 703e 0a3c 703e 596f 7520 6361 d.

    .

    You ca │ │ │ +00186220: 6e20 7370 6563 6966 7920 6120 6369 7068 n specify a ciph │ │ │ +00186230: 6572 206c 6973 7420 746f 2075 7365 2077 er list to use w │ │ │ +00186240: 6974 6820 544c 5376 312e 3220 616e 6420 ith TLSv1.2 and │ │ │ +00186250: 6265 6c6f 7720 7769 7468 203c 636f 6465 below with SSL_CTX_set_cip │ │ │ +00186270: 6865 725f 6c69 7374 2873 6f61 702d 2667 her_list(soap-&g │ │ │ +00186280: 743b 6374 782c 2022 2e2e 2e22 293c 2f63 t;ctx, "...") where soap->ctx is the SSL │ │ │ +001862c0: 636f 6e74 6578 7420 6372 6561 7465 6420 context created │ │ │ +001862d0: 6279 203c 636f 6465 3e3c 6120 636c 6173 by soap │ │ │ +00186360: 5f73 736c 5f73 6572 7665 725f 636f 6e74 _ssl_server_cont │ │ │ +00186370: 6578 7428 293c 2f61 3e3c 2f63 6f64 653e ext() │ │ │ +00186380: 2e20 4c69 6b65 7769 7365 2c20 7573 6520 . Likewise, use │ │ │ +00186390: 3c63 6f64 653e 5353 4c5f 4354 585f 7365 SSL_CTX_se │ │ │ +001863a0: 745f 6369 7068 6572 7375 6974 6573 2873 t_ciphersuites(s │ │ │ +001863b0: 6f61 702d 2667 743b 6374 782c 2022 2e2e oap->ctx, ".. │ │ │ +001863c0: 2e22 293c 2f63 6f64 653e 2074 6f20 636f .") to co │ │ │ +001863d0: 6e66 6967 7572 6520 7468 6520 6176 6169 nfigure the avai │ │ │ +001863e0: 6c61 626c 6520 544c 5376 312e 3320 6369 lable TLSv1.3 ci │ │ │ +001863f0: 7068 6572 7375 6974 6573 2e3c 2f70 3e0a phersuites.

    . │ │ │ +00186400: 3c70 3e57 6520 7265 6665 7220 746f 2074

    We refer to t │ │ │ +00186410: 6865 204f 7065 6e53 534c 2064 6f63 756d he OpenSSL docum │ │ │ +00186420: 656e 7461 7469 6f6e 2061 6e64 206d 616e entation and man │ │ │ +00186430: 7561 6c20 7061 6765 7320 6f66 203c 636f ual pages of SSL_CTX_set_c │ │ │ +00186450: 6970 6865 725f 6c69 7374 3c2f 636f 6465 ipher_list and SSL_ │ │ │ +00186470: 4354 585f 7365 745f 6369 7068 6572 7375 CTX_set_ciphersu │ │ │ +00186480: 6974 6573 3c2f 636f 6465 3e20 666f 7220 ites for │ │ │ +00186490: 6465 7461 696c 7320 6f6e 2074 6865 206c details on the l │ │ │ +001864a0: 6174 6573 7420 6369 7068 6572 206c 6973 atest cipher lis │ │ │ +001864b0: 7473 2061 6e64 2073 7569 7465 7320 6176 ts and suites av │ │ │ +001864c0: 6169 6c61 626c 6520 746f 2075 7365 2e3c ailable to use.< │ │ │ +001864d0: 2f70 3e0a 3c70 3e54 6865 2047 4e55 544c /p>.

    The GNUTL │ │ │ +001864e0: 5320 6d75 7465 7820 6c6f 636b 2073 6574 S mutex lock set │ │ │ +001864f0: 7570 2069 7320 6175 746f 6d61 7469 6361 up is automatica │ │ │ +00186500: 6c6c 7920 7065 7266 6f72 6d65 6420 696e lly performed in │ │ │ +00186510: 2074 6865 2065 6e67 696e 652c 2062 7574 the engine, but │ │ │ +00186520: 206f 6e6c 7920 7768 656e 2050 4f53 4958 only when POSIX │ │ │ +00186530: 2074 6872 6561 6473 2061 7265 2064 6574 threads are det │ │ │ +00186540: 6563 7465 6420 616e 6420 6176 6169 6c61 ected and availa │ │ │ +00186550: 626c 652e 3c2f 703e 0a3c 703e 416c 6c20 ble.

    .

    All │ │ │ +00186560: 4f70 656e 5353 4c20 7665 7273 696f 6e73 OpenSSL versions │ │ │ +00186570: 2070 7269 6f72 2074 6f20 312e 312e 3020 prior to 1.1.0 │ │ │ +00186580: 7265 7175 6972 6520 6d75 7465 7820 6c6f require mutex lo │ │ │ +00186590: 636b 7320 746f 2062 6520 6578 706c 6963 cks to be explic │ │ │ +001865a0: 6974 6c79 2073 6574 2075 7020 696e 2079 itly set up in y │ │ │ +001865b0: 6f75 7220 636f 6465 2066 6f72 206d 756c our code for mul │ │ │ +001865c0: 7469 2d74 6872 6561 6465 6420 6170 706c ti-threaded appl │ │ │ +001865d0: 6963 6174 696f 6e73 2062 7920 6361 6c6c ications by call │ │ │ +001865e0: 696e 6720 3c63 6f64 653e 3c61 2063 6c61 ing CRYPTO │ │ │ +001866b0: 5f74 6872 6561 645f 7365 7475 7028 293c _thread_setup()< │ │ │ +001866c0: 2f61 3e3c 2f63 6f64 653e 2061 6e64 203c /a> and < │ │ │ +001866d0: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>CRYPTO_thread_ │ │ │ +00186770: 636c 6561 6e75 7028 293c 2f61 3e3c 2f63 cleanup() as was show │ │ │ +00186790: 6e20 696e 2074 6865 2063 6f64 6520 6162 n in the code ab │ │ │ +001867a0: 6f76 652e 204f 7065 6e53 534c 2031 2e31 ove. OpenSSL 1.1 │ │ │ +001867b0: 2e30 2061 6e64 2067 7265 6174 6572 2064 .0 and greater d │ │ │ +001867c0: 6f65 7320 6e6f 7420 7265 7175 6972 6520 oes not require │ │ │ +001867d0: 7468 6573 6520 6c6f 636b 7320 746f 2062 these locks to b │ │ │ +001867e0: 6520 7365 7420 7570 2e20 4966 2079 6f75 e set up. If you │ │ │ +001867f0: 2061 7265 206e 6f74 2073 7572 6520 7768 are not sure wh │ │ │ +00186800: 6963 6820 7665 7273 696f 6e20 6f66 204f ich version of O │ │ │ +00186810: 7065 6e53 534c 2079 6f75 206d 6179 2062 penSSL you may b │ │ │ +00186820: 6520 7573 696e 6720 7769 7468 2079 6f75 e using with you │ │ │ +00186830: 7220 6d75 6c74 692d 7468 7265 6164 6564 r multi-threaded │ │ │ +00186840: 2061 7070 6c69 6361 7469 6f6e 2c20 7468 application, th │ │ │ +00186850: 656e 2073 6574 2075 7020 7468 6520 6c6f en set up the lo │ │ │ +00186860: 636b 732e 3c2f 703e 0a3c 703e 466f 7220 cks.

    .

    For │ │ │ +00186870: 556e 6978 2061 6e64 204c 696e 7578 2c20 Unix and Linux, │ │ │ +00186880: 6d61 6b65 2073 7572 6520 796f 7520 6861 make sure you ha │ │ │ +00186890: 7665 2073 6967 6e61 6c20 6861 6e64 6c65 ve signal handle │ │ │ +001868a0: 7273 2073 6574 2069 6e20 796f 7572 2073 rs set in your s │ │ │ +001868b0: 6572 7669 6365 2061 6e64 2f6f 7220 636c ervice and/or cl │ │ │ +001868c0: 6965 6e74 2061 7070 6c69 6361 7469 6f6e ient application │ │ │ +001868d0: 7320 746f 2063 6174 6368 2062 726f 6b65 s to catch broke │ │ │ +001868e0: 6e20 636f 6e6e 6563 7469 6f6e 7320 283c n connections (< │ │ │ +001868f0: 636f 6465 3e53 4947 5049 5045 3c2f 636f code>SIGPIPE):

    .
    │ │ │ +00186920: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    signal(SIGPIPE │ │ │ +00186940: 2c20 7369 6770 6970 655f 6861 6e64 6c65 , sigpipe_handle │ │ │ +00186950: 293b 3c2f 6469 763e 0a3c 2f64 6976 3e3c );
    .
    < │ │ │ +00186960: 212d 2d20 6672 6167 6d65 6e74 202d 2d3e !-- fragment --> │ │ │ +00186970: 3c70 3e77 6865 7265 2c20 666f 7220 6578

    where, for ex │ │ │ +00186980: 616d 706c 653a 3c2f 703e 0a3c 6469 7620 ample:

    .
    voi │ │ │ +001869d0: 643c 2f73 7061 6e3e 2073 6967 7069 7065 d sigpipe │ │ │ +001869e0: 5f68 616e 646c 6528 3c73 7061 6e20 636c _handle(int x) │ │ │ +00186a10: 7b20 7d3c 2f64 6976 3e0a 3c2f 6469 763e { }
    .
    │ │ │ +00186a20: 3c21 2d2d 2066 7261 676d 656e 7420 2d2d

    Thi │ │ │ +00187120: 7320 7265 7175 6972 6573 2065 6163 6820 s requires each │ │ │ +00187130: 636c 6965 6e74 2074 6f20 6175 7468 656e client to authen │ │ │ +00187140: 7469 6361 7465 2077 6974 6820 6974 7320 ticate with its │ │ │ +00187150: 6365 7274 6966 6963 6174 652c 2069 6e20 certificate, in │ │ │ +00187160: 6164 6469 7469 6f6e 2066 6f72 2074 6865 addition for the │ │ │ +00187170: 2073 6572 7665 7220 746f 2061 7574 6865 server to authe │ │ │ +00187180: 6e74 6963 6174 6520 746f 2074 6865 2063 nticate to the c │ │ │ +00187190: 6c69 656e 742e 3c2f 703e 0a3c 703e 5369 lient.

    .

    Si │ │ │ +001871a0: 6e63 6520 7265 6c65 6173 6520 7665 7273 nce release vers │ │ │ +001871b0: 696f 6e20 322e 382e 3230 2c20 5353 4c20 ion 2.8.20, SSL │ │ │ +001871c0: 7633 2069 7320 6469 7361 626c 6564 2e20 v3 is disabled. │ │ │ +001871d0: 546f 2065 6e61 626c 6520 5353 4c20 7633 To enable SSL v3 │ │ │ +001871e0: 2074 6f67 6574 6865 7220 7769 7468 2054 together with T │ │ │ +001871f0: 4c53 2031 2e30 2061 6e64 2068 6967 6865 LS 1.0 and highe │ │ │ +00187200: 722c 2075 7365 203c 636f 6465 3e23 534f r, use #SO │ │ │ +00187210: 4150 5f53 534c 7633 5f54 4c53 7631 3c2f AP_SSLv3_TLSv1 with soap_ssl_ser │ │ │ +001872c0: 7665 725f 636f 6e74 6578 743c 2f61 3e3c ver_context< │ │ │ +001872d0: 2f63 6f64 653e 2e20 546f 2075 7365 2054 /code>. To use T │ │ │ +001872e0: 4c53 2031 2e31 2061 6e64 2031 2e32 2075 LS 1.1 and 1.2 u │ │ │ +001872f0: 7365 203c 636f 6465 3e53 4f41 505f 544c se SOAP_TL │ │ │ +00187300: 5376 315f 3120 7c20 534f 4150 5f54 4c53 Sv1_1 | SOAP_TLS │ │ │ +00187310: 7631 5f32 3c2f 636f 6465 3e2e 2054 6f20 v1_2. To │ │ │ +00187320: 7573 6520 544c 5320 312e 3220 6f6e 6c79 use TLS 1.2 only │ │ │ +00187330: 2075 7365 203c 636f 6465 3e23 534f 4150 use #SOAP │ │ │ +00187340: 5f54 4c53 7631 5f32 3c2f 636f 6465 3e2e _TLSv1_2. │ │ │ +00187350: 2054 6f20 7573 6520 5353 4c20 7633 206f To use SSL v3 o │ │ │ +00187360: 6e6c 7920 7573 6520 3c63 6f64 653e 2353 nly use #S │ │ │ +00187370: 4f41 505f 5353 4c76 333c 2f63 6f64 653e OAP_SSLv3 │ │ │ +00187380: 2e3c 2f70 3e0a 3c70 3e54 6865 203c 636f .

    .

    The cacert │ │ │ +001873a0: 2066 696c 6520 616e 6420 3c63 6f64 653e file and │ │ │ +001873b0: 6361 7061 7468 3c2f 636f 6465 3e20 6172 capath ar │ │ │ +001873c0: 6520 6f70 7469 6f6e 616c 2e20 4569 7468 e optional. Eith │ │ │ +001873d0: 6572 206f 6e65 2063 616e 2062 6520 7370 er one can be sp │ │ │ +001873e0: 6563 6966 6965 6420 7768 656e 2063 6c69 ecified when cli │ │ │ +001873f0: 656e 7473 206d 7573 7420 7275 6e20 6f6e ents must run on │ │ │ +00187400: 206e 6f6e 2d74 7275 7374 6564 2073 7973 non-trusted sys │ │ │ +00187410: 7465 6d73 2028 3c63 6f64 653e 6361 7061 tems (capa │ │ │ +00187420: 7468 3c2f 636f 6465 3e20 6973 206e 6f74 th is not │ │ │ +00187430: 2075 7365 6420 7769 7468 2047 4e55 544c used with GNUTL │ │ │ +00187440: 5329 2e20 5765 2077 616e 7420 746f 2061 S). We want to a │ │ │ +00187450: 766f 6964 2073 746f 7269 6e67 2074 7275 void storing tru │ │ │ +00187460: 7374 6564 2063 6572 7469 6669 6361 7465 sted certificate │ │ │ +00187470: 7320 696e 2074 6865 2064 6566 6175 6c74 s in the default │ │ │ +00187480: 206c 6f63 6174 696f 6e20 6f6e 2074 6865 location on the │ │ │ +00187490: 2066 696c 6520 7379 7374 656d 2077 6865 file system whe │ │ │ +001874a0: 6e20 7468 6174 2069 7320 6e6f 7420 7365 n that is not se │ │ │ +001874b0: 6375 7265 2e20 5468 6572 6566 6f72 652c cure. Therefore, │ │ │ +001874c0: 2061 2066 6c61 7420 3c65 6d3e 3c63 6f64 a flat cacert.pem file or │ │ │ +001874f0: 2064 6972 6563 746f 7279 2063 616e 2062 directory can b │ │ │ +00187500: 6520 7370 6563 6966 6965 6420 746f 2073 e specified to s │ │ │ +00187510: 746f 7265 2074 7275 7374 6564 2063 6572 tore trusted cer │ │ │ +00187520: 7469 6669 6361 7465 732e 3c2f 703e 0a3c tificates.

    .< │ │ │ +00187530: 703e 5468 6520 6753 4f41 5020 7061 636b p>The gSOAP pack │ │ │ +00187540: 6167 6520 696e 636c 7564 6573 2061 203c age includes a < │ │ │ +00187550: 656d 3e3c 636f 6465 3e63 6163 6572 7473 em>cacerts │ │ │ +00187560: 2e70 656d 3c2f 636f 6465 3e3c 2f65 6d3e .pem │ │ │ +00187570: 2066 696c 6520 7769 7468 2074 6865 2063 file with the c │ │ │ +00187580: 6572 7469 6669 6361 7465 7320 6f66 2061 ertificates of a │ │ │ +00187590: 6c6c 2063 6572 7469 6669 6361 7465 2061 ll certificate a │ │ │ +001875a0: 7574 686f 7269 7469 6573 2e20 596f 7520 uthorities. You │ │ │ +001875b0: 6361 6e20 7573 6520 7468 6973 2066 696c can use this fil │ │ │ +001875c0: 6520 746f 2076 6572 6966 7920 7468 6520 e to verify the │ │ │ +001875d0: 6175 7468 656e 7469 6361 7469 6f6e 206f authentication o │ │ │ +001875e0: 6620 7365 7276 6572 7320 7468 6174 2070 f servers that p │ │ │ +001875f0: 726f 7669 6465 2063 6572 7469 6669 6361 rovide certifica │ │ │ +00187600: 7465 7320 6973 7375 6564 2062 7920 7468 tes issued by th │ │ │ +00187610: 6573 6520 4341 732e 3c2f 703e 0a3c 703e ese CAs.

    .

    │ │ │ +00187620: 5468 6520 3c65 6d3e 3c63 6f64 653e 6361 The ca │ │ │ +00187630: 6365 7274 2e70 656d 3c2f 636f 6465 3e3c cert.pem< │ │ │ +00187640: 2f65 6d3e 2c20 3c65 6d3e 3c63 6f64 653e /em>, │ │ │ +00187650: 636c 6965 6e74 2e70 656d 3c2f 636f 6465 client.pem, and │ │ │ +00187670: 3c63 6f64 653e 7365 7276 6572 2e70 656d server.pem │ │ │ +00187680: 3c2f 636f 6465 3e3c 2f65 6d3e 2066 696c fil │ │ │ +00187690: 6573 2069 6e20 7468 6520 6753 4f41 5020 es in the gSOAP │ │ │ +001876a0: 7061 636b 6167 6520 6172 6520 6578 616d package are exam │ │ │ +001876b0: 706c 6573 206f 6620 7365 6c66 2d73 6967 ples of self-sig │ │ │ +001876c0: 6e65 6420 6365 7274 6966 6963 6174 6573 ned certificates │ │ │ +001876d0: 2e20 5468 6520 3c65 6d3e 3c63 6f64 653e . The │ │ │ +001876e0: 636c 6965 6e74 2e70 656d 3c2f 636f 6465 client.pem and < │ │ │ +00187700: 636f 6465 3e73 6572 7665 722e 7065 6d3c code>server.pem< │ │ │ +00187710: 2f63 6f64 653e 3c2f 656d 3e20 636f 6e74 /code> cont │ │ │ +00187720: 6169 6e20 7468 6520 636c 6965 6e74 2f73 ain the client/s │ │ │ +00187730: 6572 7665 7220 7072 6976 6174 6520 6b65 erver private ke │ │ │ +00187740: 7920 636f 6e63 6174 656e 6174 6564 2077 y concatenated w │ │ │ +00187750: 6974 6820 7468 6520 6365 7274 6966 6963 ith the certific │ │ │ +00187760: 6174 652e 2054 6865 206b 6579 6669 6c65 ate. The keyfile │ │ │ +00187770: 7320 283c 656d 3e3c 636f 6465 3e63 6c69 s (cli │ │ │ +00187780: 656e 742e 7065 6d3c 2f63 6f64 653e 3c2f ent.pem and server.pem) are cr │ │ │ +001877c0: 6561 7465 6420 6279 2063 6f6e 6361 7465 eated by concate │ │ │ +001877d0: 6e61 7469 6e67 2074 6865 2070 7269 7661 nating the priva │ │ │ +001877e0: 7465 206b 6579 2050 454d 2077 6974 6820 te key PEM with │ │ │ +001877f0: 7468 6520 6365 7274 6966 6963 6174 6520 the certificate │ │ │ +00187800: 5045 4d2e 2054 6865 206b 6579 6669 6c65 PEM. The keyfile │ │ │ +00187810: 2073 686f 756c 6420 6e6f 7420 6265 2073 should not be s │ │ │ +00187820: 6861 7265 6420 7769 7468 2061 6e79 2070 hared with any p │ │ │ +00187830: 6172 7479 2e20 5769 7468 204f 7065 6e53 arty. With OpenS │ │ │ +00187840: 534c 2c20 796f 7520 6361 6e20 656e 6372 SL, you can encr │ │ │ +00187850: 7970 7420 7468 6520 6b65 7966 696c 6573 ypt the keyfiles │ │ │ +00187860: 2077 6974 6820 6120 7061 7373 776f 7264 with a password │ │ │ +00187870: 2074 6f20 6f66 6665 7220 736f 6d65 2070 to offer some p │ │ │ +00187880: 726f 7465 6374 696f 6e20 616e 6420 7468 rotection and th │ │ │ +00187890: 6520 7061 7373 776f 7264 2069 7320 7573 e password is us │ │ │ +001878a0: 6564 2069 6e20 7468 6520 636c 6965 6e74 ed in the client │ │ │ +001878b0: 2f73 6572 7665 7220 636f 6465 2074 6f20 /server code to │ │ │ +001878c0: 7265 6164 2074 6865 206b 6579 6669 6c65 read the keyfile │ │ │ +001878d0: 2e20 474e 5554 4c53 2064 6f65 7320 6e6f . GNUTLS does no │ │ │ +001878e0: 7420 7375 7070 6f72 7420 7468 6973 2066 t support this f │ │ │ +001878f0: 6561 7475 7265 2061 6e64 2063 616e 6e6f eature and canno │ │ │ +00187900: 7420 656e 6372 7970 7420 6f72 2064 6563 t encrypt or dec │ │ │ +00187910: 7279 7074 2061 206b 6579 6669 6c65 2e3c rypt a keyfile.< │ │ │ +00187920: 2f70 3e0a 3c64 6c20 636c 6173 733d 2273 /p>.

    │ │ │ +00187940: 3c64 743e 5761 726e 696e 673c 2f64 743e
    Warning
    │ │ │ +00187950: 3c64 643e 4974 2069 7320 696d 706f 7274
    It is import │ │ │ +00187960: 616e 7420 7468 6174 2074 6865 203c 636f ant that the #WITH_OPENSSL │ │ │ +00187980: 3c2f 636f 6465 3e20 6d61 6372 6f20 6d75 macro mu │ │ │ +00187990: 7374 2062 6520 636f 6e73 6973 7465 6e74 st be consistent │ │ │ +001879a0: 6c79 2064 6566 696e 6564 2074 6f20 636f ly defined to co │ │ │ +001879b0: 6d70 696c 6520 7468 6520 736f 7572 6365 mpile the source │ │ │ +001879c0: 732c 2073 7563 6820 6173 203c 656d 3e3c s, such as < │ │ │ +001879d0: 636f 6465 3e67 736f 6170 2f73 7464 736f code>gsoap/stdso │ │ │ +001879e0: 6170 322e 6370 703c 2f63 6f64 653e 3c2f ap2.cpp, s │ │ │ +00187a00: 6f61 7043 2e63 7070 3c2f 636f 6465 3e3c oapC.cpp< │ │ │ +00187a10: 2f65 6d3e 2c20 3c65 6d3e 3c63 6f64 653e /em>, │ │ │ +00187a20: 736f 6170 436c 6965 6e74 2e63 7070 3c2f soapClient.cpp, │ │ │ +00187a40: 3c63 6f64 653e 736f 6170 5365 7276 6572 soapServer │ │ │ +00187a50: 2e63 7070 3c2f 636f 6465 3e3c 2f65 6d3e .cpp │ │ │ +00187a60: 2c20 616e 6420 616c 6c20 6170 706c 6963 , and all applic │ │ │ +00187a70: 6174 696f 6e20 736f 7572 6365 7320 7468 ation sources th │ │ │ +00187a80: 6174 2069 6e63 6c75 6465 203c 656d 3e3c at include < │ │ │ +00187a90: 636f 6465 3e67 736f 6170 2f73 7464 736f code>gsoap/stdso │ │ │ +00187aa0: 6170 322e 683c 2f63 6f64 653e 3c2f 656d ap2.h or s │ │ │ +00187ac0: 6f61 7048 2e68 3c2f 636f 6465 3e3c 2f65 oapH.h. If the macro │ │ │ +00187ae0: 7320 6172 6520 6e6f 7420 636f 6e73 6973 s are not consis │ │ │ +00187af0: 7465 6e74 6c79 2075 7365 642c 2074 6865 tently used, the │ │ │ +00187b00: 2061 7070 6c69 6361 7469 6f6e 2077 696c application wil │ │ │ +00187b10: 6c20 6372 6173 6820 6475 6520 746f 2061 l crash due to a │ │ │ +00187b20: 206d 6973 6d61 7463 6865 7320 696e 2074 mismatches in t │ │ │ +00187b30: 6865 2064 6563 6c61 7261 7469 6f6e 2061 he declaration a │ │ │ +00187b40: 6e64 2061 6363 6573 7320 6f66 2074 6865 nd access of the │ │ │ +00187b50: 203c 636f 6465 3e3c 6120 636c 6173 733d soap context.
    │ │ │ +00187bc0: 3c2f 646c 3e0a 3c70 3e53 6565 2061 6c73
    .

    See als │ │ │ +00187bd0: 6f20 4150 4920 646f 6375 6d65 6e74 6174 o API documentat │ │ │ +00187be0: 696f 6e20 4d6f 6475 6c65 203c 6120 636c ion Module SSL/TLS c │ │ │ +00187c20: 6f6e 7465 7874 2061 6e64 2066 756e 6374 ontext and funct │ │ │ +00187c30: 696f 6e73 3c2f 613e 2066 6f72 206d 6f72 ions for mor │ │ │ +00187c40: 6520 6465 7461 696c 7320 6f6e 2074 6865 e details on the │ │ │ +00187c50: 2053 534c 2f54 4c53 2066 756e 6374 696f SSL/TLS functio │ │ │ +00187c60: 6e73 2e3c 2f70 3e0a 3c70 3ef0 9f94 9d20 ns.

    .

    .... │ │ │ +00187c70: 3c61 2068 7265 663d 2223 223e 4261 636b Back │ │ │ +00187c80: 2074 6f20 7461 626c 6520 6f66 2063 6f6e to table of con │ │ │ +00187c90: 7465 6e74 733c 2f61 3e3c 2f70 3e0a 3c68 tents

    ..Secu │ │ │ +00187cd0: 7265 2063 6c69 656e 7473 2077 6974 6820 re clients with │ │ │ +00187ce0: 4854 5450 533c 2f68 323e 0a3c 703e 546f HTTPS.

    To │ │ │ +00187cf0: 2075 7469 6c69 7a65 2048 5454 5053 2f53 utilize HTTPS/S │ │ │ +00187d00: 534c 2c20 796f 7520 6e65 6564 2074 6f20 SL, you need to │ │ │ +00187d10: 696e 7374 616c 6c20 7468 6520 4f70 656e install the Open │ │ │ +00187d20: 5353 4c20 6c69 6272 6172 7920 6f6e 2079 SSL library on y │ │ │ +00187d30: 6f75 7220 706c 6174 666f 726d 206f 7220 our platform or │ │ │ +00187d40: 474e 5554 4c53 2066 6f72 2061 206c 6967 GNUTLS for a lig │ │ │ +00187d50: 6874 2d77 6569 6768 7420 5353 4c2f 544c ht-weight SSL/TL │ │ │ +00187d60: 5320 6c69 6272 6172 792e 2041 6674 6572 S library. After │ │ │ +00187d70: 2069 6e73 7461 6c6c 6174 696f 6e2c 2063 installation, c │ │ │ +00187d80: 6f6d 7069 6c65 2061 6c6c 2074 6865 2073 ompile all the s │ │ │ +00187d90: 6f75 7263 6573 206f 6620 796f 7572 2061 ources of your a │ │ │ +00187da0: 7070 6c69 6361 7469 6f6e 2077 6974 6820 pplication with │ │ │ +00187db0: 636f 6d70 696c 652d 7469 6d65 2066 6c61 compile-time fla │ │ │ +00187dc0: 6720 3c63 6f64 653e 2357 4954 485f 4f50 g #WITH_OP │ │ │ +00187dd0: 454e 5353 4c3c 2f63 6f64 653e 2028 6f72 ENSSL (or │ │ │ +00187de0: 203c 636f 6465 3e23 5749 5448 5f47 4e55 #WITH_GNU │ │ │ +00187df0: 544c 533c 2f63 6f64 653e 2077 6865 6e20 TLS when │ │ │ +00187e00: 7573 696e 6720 474e 5554 4c53 292e 2046 using GNUTLS). F │ │ │ +00187e10: 6f72 2065 7861 6d70 6c65 206f 6e20 4c69 or example on Li │ │ │ +00187e20: 6e75 783a 203c 2f70 3e3c 7072 6520 636c nux:

     
    │ │ │ +00187e40: 632b 2b20 2d44 5749 5448 5f4f 5045 4e53  c++ -DWITH_OPENS
    │ │ │ +00187e50: 534c 206d 7963 6c69 656e 742e 6370 7020  SL myclient.cpp 
    │ │ │ +00187e60: 7374 6473 6f61 702e 6370 7020 736f 6170  stdsoap.cpp soap
    │ │ │ +00187e70: 432e 6370 7020 736f 6170 436c 6965 6e74  C.cpp soapClient
    │ │ │ +00187e80: 2e63 7070 202d 6c73 736c 202d 6c63 7279  .cpp -lssl -lcry
    │ │ │ +00187e90: 7074 6f0a 3c2f 7072 653e 3c70 3e20 6f72  pto.

    or │ │ │ +00187ea0: 2055 6e69 783a 203c 2f70 3e3c 7072 6520 Unix:

     c++ -DWITH_OPE
    │ │ │ +00187ed0: 4e53 534c 206d 7963 6c69 656e 742e 6370  NSSL myclient.cp
    │ │ │ +00187ee0: 7020 7374 6473 6f61 702e 6370 7020 736f  p stdsoap.cpp so
    │ │ │ +00187ef0: 6170 432e 6370 7020 736f 6170 436c 6965  apC.cpp soapClie
    │ │ │ +00187f00: 6e74 2e63 7070 202d 6c78 6e65 7420 2d6c  nt.cpp -lxnet -l
    │ │ │ +00187f10: 736f 636b 6574 202d 6c6e 736c 202d 6c73  socket -lnsl -ls
    │ │ │ +00187f20: 736c 202d 6c63 7279 7074 6f0a 3c2f 7072  sl -lcrypto.

    or you can │ │ │ +00187f40: 2061 6464 2074 6865 2066 6f6c 6c6f 7769 add the followi │ │ │ +00187f50: 6e67 206c 696e 6520 746f 203c 656d 3e3c ng line to < │ │ │ +00187f60: 636f 6465 3e73 6f61 7064 6566 732e 683c code>soapdefs.h< │ │ │ +00187f70: 2f63 6f64 653e 3c2f 656d 3e3a 3c2f 703e /code>:

    │ │ │ +00187f80: 0a3c 6469 7620 636c 6173 733d 2266 7261 .
    #define WITH │ │ │ +00187fd0: 5f4f 5045 4e53 534c 3c2f 7370 616e 3e3c _OPENSSL< │ │ │ +00187fe0: 2f64 6976 3e0a 3c2f 6469 763e 3c21 2d2d /div>.

    │ │ │ +00188000: 616e 6420 636f 6d70 696c 6520 7769 7468 and compile with │ │ │ +00188010: 2063 6f6d 7069 6c65 2d74 696d 6520 666c compile-time fl │ │ │ +00188020: 6167 203c 636f 6465 3e23 5749 5448 5f53 ag #WITH_S │ │ │ +00188030: 4f41 5044 4546 535f 483c 2f63 6f64 653e OAPDEFS_H │ │ │ +00188040: 2074 6f20 696e 636c 7564 6520 3c65 6d3e to include │ │ │ +00188050: 3c63 6f64 653e 736f 6170 6465 6673 2e68 soapdefs.h │ │ │ +00188060: 3c2f 636f 6465 3e3c 2f65 6d3e 2069 6e20 in │ │ │ +00188070: 796f 7572 2070 726f 6a65 6374 2e20 416c your project. Al │ │ │ +00188080: 7465 726e 6174 6976 656c 792c 2063 6f6d ternatively, com │ │ │ +00188090: 7069 6c65 2077 6974 6820 474e 5554 4c53 pile with GNUTLS │ │ │ +001880a0: 3a20 3c2f 703e 3c70 7265 2063 6c61 7373 :

     c++
    │ │ │ +001880c0: 202d 4457 4954 485f 474e 5554 4c53 206d   -DWITH_GNUTLS m
    │ │ │ +001880d0: 7963 6c69 656e 742e 6370 7020 7374 6473  yclient.cpp stds
    │ │ │ +001880e0: 6f61 702e 6370 7020 736f 6170 432e 6370  oap.cpp soapC.cp
    │ │ │ +001880f0: 7020 736f 6170 436c 6965 6e74 2e63 7070  p soapClient.cpp
    │ │ │ +00188100: 202d 6c67 6e75 746c 7320 2d6c 6763 7279   -lgnutls -lgcry
    │ │ │ +00188110: 7074 202d 6c67 7067 2d65 7272 6f72 0a3c  pt -lgpg-error.<
    │ │ │ +00188120: 2f70 7265 3e3c 703e 4120 636c 6965 6e74  /pre>

    A client │ │ │ +00188130: 2070 726f 6772 616d 2073 696d 706c 7920 program simply │ │ │ +00188140: 7573 6573 2074 6865 2070 7265 6669 7820 uses the prefix │ │ │ +00188150: 3c65 6d3e 3c63 6f64 653e 6874 7470 733a https: │ │ │ +00188160: 3c2f 636f 6465 3e3c 2f65 6d3e 2069 6e73 ins │ │ │ +00188170: 7465 6164 206f 6620 3c65 6d3e 3c63 6f64 tead of http: in the endpo │ │ │ +001881a0: 696e 7420 5552 4c20 6f66 2061 2073 6572 int URL of a ser │ │ │ +001881b0: 7669 6365 206f 7065 7261 7469 6f6e 2063 vice operation c │ │ │ +001881c0: 616c 6c20 746f 2061 2057 6562 2053 6572 all to a Web Ser │ │ │ +001881d0: 7669 6365 2074 6f20 7573 6520 656e 6372 vice to use encr │ │ │ +001881e0: 7970 7465 6420 7472 616e 7366 6572 7320 ypted transfers │ │ │ +001881f0: 2869 6620 7468 6520 7365 7276 6963 6520 (if the service │ │ │ +00188200: 7375 7070 6f72 7473 2048 5454 5053 292e supports HTTPS). │ │ │ +00188210: 2059 6f75 206e 6565 6420 746f 2073 7065 You need to spe │ │ │ +00188220: 6369 6679 2074 6865 2063 6c69 656e 742d cify the client- │ │ │ +00188230: 7369 6465 206b 6579 2066 696c 6520 616e side key file an │ │ │ +00188240: 6420 7061 7373 776f 7264 206f 6620 7468 d password of th │ │ │ +00188250: 6520 6b65 7966 696c 653a 3c2f 703e 0a3c e keyfile:

    .< │ │ │ +00188260: 6469 7620 636c 6173 733d 2266 7261 676d div class="fragm │ │ │ +00188270: 656e 7422 3e3c 6469 7620 636c 6173 733d ent">
    str │ │ │ +001882a0: 7563 7420 3c2f 7370 616e 3e3c 6120 636c uct soap soap;
    .
    soap_ssl_in │ │ │ +00188380: 6974 3c2f 613e 2829 3b20 3c73 7061 6e20 it(); │ │ │ +001883a0: 2f2a 2069 6e69 7420 4f70 656e 5353 4c20 /* init OpenSSL │ │ │ +001883b0: 2873 6b69 7070 696e 6720 7468 6973 206f (skipping this o │ │ │ +001883c0: 7220 6361 6c6c 696e 6720 6d75 6c74 6970 r calling multip │ │ │ +001883d0: 6c65 2074 696d 6573 2069 7320 4f4b 2c20 le times is OK, │ │ │ +001883e0: 7369 6e63 6520 7468 6520 656e 6769 6e65 since the engine │ │ │ +001883f0: 2077 696c 6c20 696e 6974 2053 534c 2061 will init SSL a │ │ │ +00188400: 7574 6f6d 6174 6963 616c 6c79 2920 2a2f utomatically) */ │ │ │ +00188410: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ +00188430: 3c73 7061 6e20 636c 6173 733d 2263 6f6d /* soap_ss │ │ │ +00188450: 6c5f 6e6f 696e 6974 2829 3b20 2a2f 3c2f l_noinit(); */ /* d │ │ │ +00188480: 6f20 6e6f 7420 696e 6974 204f 7065 6e53 o not init OpenS │ │ │ +00188490: 534c 2028 6966 2053 534c 2069 7320 616c SL (if SSL is al │ │ │ +001884a0: 7265 6164 7920 696e 6974 6961 6c69 7a65 ready initialize │ │ │ +001884b0: 6420 656c 7365 7768 6572 6520 696e 2074 d elsewhere in t │ │ │ +001884c0: 6869 7320 6170 706c 6963 6174 696f 6e29 his application) │ │ │ +001884d0: 202a 2f3c 2f73 7061 6e3e 3c2f 6469 763e */
    │ │ │ +001884e0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    soap_ini │ │ │ +00188550: 743c 2f61 3e28 2661 6d70 3b3c 6120 636c t(&soap);.
    i │ │ │ +001885c0: 663c 2f73 7061 6e3e 2028 3c61 2063 6c61 f (soap_ │ │ │ +00188620: 7373 6c5f 636c 6965 6e74 5f63 6f6e 7465 ssl_client_conte │ │ │ +00188630: 7874 3c2f 613e 2826 616d 703b 3c61 2063 xt(&soap, .
    SOAP_SS │ │ │ +001886e0: 4c5f 4445 4641 554c 543c 2f61 3e2c 203c L_DEFAULT, < │ │ │ +001886f0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    "clie │ │ │ +00188730: 6e74 2e70 656d 2671 756f 743b 3c2f 7370 nt.pem", /* keyfile: re │ │ │ +00188770: 7175 6972 6564 206f 6e6c 7920 7768 656e quired only when │ │ │ +00188780: 2063 6c69 656e 7420 6d75 7374 2061 7574 client must aut │ │ │ +00188790: 6865 6e74 6963 6174 6520 746f 2073 6572 henticate to ser │ │ │ +001887a0: 7665 7220 2873 6565 2053 534c 2064 6f63 ver (see SSL doc │ │ │ +001887b0: 7320 6f6e 2068 6f77 2074 6f20 6f62 7461 s on how to obta │ │ │ +001887c0: 696e 2074 6869 7320 6669 6c65 2920 2a2f in this file) */ │ │ │ +001887d0: 3c2f 7370 616e 3e20 3c2f 6469 763e 0a3c
    .< │ │ │ +001887e0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +001887f0: 3e20 203c 7370 616e 2063 6c61 7373 3d22 > & │ │ │ +00188810: 7175 6f74 3b70 6173 7377 6f72 6426 7175 quot;password&qu │ │ │ +00188820: 6f74 3b3c 2f73 7061 6e3e 2c20 2020 2020 ot;, │ │ │ +00188830: 2020 2020 203c 7370 616e 2063 6c61 7373 /* pa │ │ │ +00188850: 7373 776f 7264 2074 6f20 7265 6164 2074 ssword to read t │ │ │ +00188860: 6865 206b 6579 2066 696c 6520 286e 6f74 he key file (not │ │ │ +00188870: 2075 7365 6420 7769 7468 2047 4e55 544c used with GNUTL │ │ │ +00188880: 5329 202a 2f3c 2f73 7061 6e3e 203c 2f64 S) */ .
    "cacert │ │ │ +001888d0: 732e 7065 6d26 7175 6f74 3b3c 2f73 7061 s.pem", │ │ │ +00188900: 2f2a 2063 6163 6572 7420 6669 6c65 2074 /* cacert file t │ │ │ +00188910: 6f20 7374 6f72 6520 7472 7573 7465 6420 o store trusted │ │ │ +00188920: 6365 7274 6966 6963 6174 6573 2028 6e65 certificates (ne │ │ │ +00188930: 6564 6564 2074 6f20 7665 7269 6679 2073 eded to verify s │ │ │ +00188940: 6572 7665 7229 202a 2f3c 2f73 7061 6e3e erver) */ │ │ │ +00188950: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    NULL │ │ │ +00188970: 2c20 2020 2020 2020 2020 2020 2020 2020 , │ │ │ +00188980: 203c 7370 616e 2063 6c61 7373 3d22 636f /* capath │ │ │ +001889a0: 2074 6f20 6469 7265 6374 6f72 7920 7769 to directory wi │ │ │ +001889b0: 7468 2074 7275 7374 6564 2063 6572 7469 th trusted certi │ │ │ +001889c0: 6669 6361 7465 7320 2a2f 3c2f 7370 616e ficates */
    .
    NUL │ │ │ +001889f0: 4c20 2020 2020 2020 2020 3c73 7061 6e20 L │ │ │ +00188a10: 2f2a 2069 6620 7261 6e64 6669 6c65 213d /* if randfile!= │ │ │ +00188a20: 4e55 4c4c 3a20 7573 6520 6120 6669 6c65 NULL: use a file │ │ │ +00188a30: 2077 6974 6820 7261 6e64 6f6d 2064 6174 with random dat │ │ │ +00188a40: 6120 746f 2073 6565 6420 7261 6e64 6f6d a to seed random │ │ │ +00188a50: 6e65 7373 202a 2f3c 2f73 7061 6e3e 2020 ness */ │ │ │ +00188a60: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    )) .
    {
    . │ │ │ +00188ab0: 203c 6120 636c 6173 733d 2263 6f64 6522 soap_print_f │ │ │ +00188b10: 6175 6c74 3c2f 613e 2826 616d 703b 3c61 ault(&soap, s │ │ │ +00188b50: 7464 6572 7229 3b20 3c2f 6469 763e 0a3c tderr);
    .< │ │ │ +00188b60: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +00188b70: 3e20 2065 7869 7428 4558 4954 5f46 4149 > exit(EXIT_FAI │ │ │ +00188b80: 4c55 5245 293b 203c 2f64 6976 3e0a 3c64 LURE);
    . │ │ │ +00188ba0: 7d20 3c2f 6469 763e 0a3c 6469 7620 636c }
    .
    soap_ │ │ │ +00188bc0: 6361 6c6c 5f6e 735f 5f6d 796d 6574 686f call_ns__mymetho │ │ │ +00188bd0: 6428 2661 6d70 3b3c 6120 636c 6173 733d d(&so │ │ │ +00188c00: 6170 3c2f 613e 2c20 3c73 7061 6e20 636c ap, "https: │ │ │ +00188c30: 2f2f 646f 6d61 696e 2f70 6174 682f 7365 //domain/path/se │ │ │ +00188c40: 6375 7265 2e63 6769 2671 756f 743b 3c2f cure.cgi", ""< │ │ │ +00188c80: 2f73 7061 6e3e 2c20 2e2e 2e29 3b3c 2f64 /span>, ...);.
    int soap_ssl_c │ │ │ +00188d80: 6c69 656e 745f 636f 6e74 6578 7428 7374 lient_context(st │ │ │ +00188d90: 7275 6374 2073 6f61 7020 2a73 6f61 702c ruct soap *soap, │ │ │ +00188da0: 2073 6f61 705f 7373 6c5f 666c 6167 7320 soap_ssl_flags │ │ │ +00188db0: 666c 6167 732c 2063 6f6e 7374 2063 6861 flags, const cha │ │ │ +00188dc0: 7220 2a6b 6579 6669 6c65 2c20 636f 6e73 r *keyfile, cons │ │ │ +00188dd0: 7420 6368 6172 202a 7061 7373 776f 7264 t char *password │ │ │ +00188de0: 2c20 636f 6e73 7420 6368 6172 202a 6361 , const char *ca │ │ │ +00188df0: 6669 6c65 2c20 636f 6e73 7420 6368 6172 file, const char │ │ │ +00188e00: 202a 6361 7061 7468 2c20 636f 6e73 7420 *capath, const │ │ │ +00188e10: 6368 6172 202a 7261 6e64 6669 6c65 293c char *randfile)< │ │ │ +00188e20: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
    Initiali │ │ │ +00188e40: 7a65 2074 6865 2063 6c69 656e 742d 7369 ze the client-si │ │ │ +00188e50: 6465 2053 534c 2f54 4c53 2063 6f6e 7465 de SSL/TLS conte │ │ │ +00188e60: 7874 2e3c 2f64 6976 3e3c 2f64 6976 3e0a xt.
    . │ │ │ +00188e70: 3c2f 6469 763e 3c21 2d2d 2066 7261 676d

    By def │ │ │ +00188e90: 6175 6c74 2c20 7365 7276 6572 2061 7574 ault, server aut │ │ │ +00188ea0: 6865 6e74 6963 6174 696f 6e20 6973 2065 hentication is e │ │ │ +00188eb0: 6e61 626c 6564 2061 6e64 2074 6865 203c nabled and the < │ │ │ +00188ec0: 656d 3e3c 636f 6465 3e63 6163 6572 7473 em>cacerts │ │ │ +00188ed0: 2e70 656d 3c2f 636f 6465 3e3c 2f65 6d3e .pem │ │ │ +00188ee0: 206f 7220 3c63 6f64 653e 6361 7061 7468 or capath │ │ │ +00188ef0: 3c2f 636f 6465 3e20 286e 6f74 2075 7365 (not use │ │ │ +00188f00: 6420 7769 7468 2047 4e55 544c 5329 206d d with GNUTLS) m │ │ │ +00188f10: 7573 7420 6265 2073 6574 2073 6f20 7468 ust be set so th │ │ │ +00188f20: 6174 2074 6865 2043 4120 6365 7274 6966 at the CA certif │ │ │ +00188f30: 6963 6174 6573 206f 6620 7468 6520 7365 icates of the se │ │ │ +00188f40: 7276 6572 2873 2920 6172 6520 6163 6365 rver(s) are acce │ │ │ +00188f50: 7373 6962 6c65 2061 7420 7275 6e20 7469 ssible at run ti │ │ │ +00188f60: 6d65 2e20 5468 6520 3c65 6d3e 3c63 6f64 me. The cacerts.pem file i │ │ │ +00188f90: 6e63 6c75 6465 6420 696e 2074 6865 2067 ncluded in the g │ │ │ +00188fa0: 534f 4150 2073 6f75 7263 6520 636f 6465 SOAP source code │ │ │ +00188fb0: 2070 6163 6b61 6765 2063 6f6e 7461 696e package contain │ │ │ +00188fc0: 7320 7468 6520 6365 7274 6966 6963 6174 s the certificat │ │ │ +00188fd0: 6573 206f 6620 636f 6d6d 6f6e 2043 4173 es of common CAs │ │ │ +00188fe0: 2e20 5468 6973 2066 696c 6520 6d75 7374 . This file must │ │ │ +00188ff0: 2062 6520 7375 7070 6c69 6564 2077 6974 be supplied wit │ │ │ +00189000: 6820 7468 6520 636c 6965 6e74 2c20 6966 h the client, if │ │ │ +00189010: 2073 6572 7665 7220 6175 7468 656e 7469 server authenti │ │ │ +00189020: 6361 7469 6f6e 2069 7320 7265 7175 6972 cation is requir │ │ │ +00189030: 6564 2e20 416c 7465 726e 6174 6976 656c ed. Alternativel │ │ │ +00189040: 792c 2079 6f75 2063 616e 2075 7365 2074 y, you can use t │ │ │ +00189050: 6865 203c 656d 3e3c 636f 6465 3e67 736f he gso │ │ │ +00189060: 6170 2f70 6c75 6769 6e2f 6361 6365 7274 ap/plugin/cacert │ │ │ +00189070: 732e 683c 2f63 6f64 653e 3c2f 656d 3e20 s.h │ │ │ +00189080: 616e 6420 3c65 6d3e 3c63 6f64 653e 6773 and gs │ │ │ +00189090: 6f61 702f 706c 7567 696e 2f63 6163 6572 oap/plugin/cacer │ │ │ +001890a0: 7473 2e63 3c2f 636f 6465 3e3c 2f65 6d3e ts.c │ │ │ +001890b0: 2063 6f64 6520 746f 2065 6d62 6564 2043 code to embed C │ │ │ +001890c0: 4120 6365 7274 6966 6963 6174 6573 2069 A certificates i │ │ │ +001890d0: 6e20 796f 7572 2063 6c69 656e 7420 636f n your client co │ │ │ +001890e0: 6465 2e3c 2f70 3e0a 3c70 3e59 6f75 2063 de.

    .

    You c │ │ │ +001890f0: 616e 2073 7065 6369 6679 2061 2063 6970 an specify a cip │ │ │ +00189100: 6865 7220 6c69 7374 2074 6f20 7573 6520 her list to use │ │ │ +00189110: 7769 7468 2054 4c53 7631 2e32 2061 6e64 with TLSv1.2 and │ │ │ +00189120: 2062 656c 6f77 2077 6974 6820 3c63 6f64 below with SSL_CTX_set_ci │ │ │ +00189140: 7068 6572 5f6c 6973 7428 736f 6170 2d26 pher_list(soap-& │ │ │ +00189150: 6774 3b63 7478 2c20 222e 2e2e 2229 3c2f gt;ctx, "...") where soap->ctx is the SSL │ │ │ +00189190: 2063 6f6e 7465 7874 2063 7265 6174 6564 context created │ │ │ +001891a0: 2062 7920 3c63 6f64 653e 3c61 2063 6c61 by soa │ │ │ +00189230: 705f 7373 6c5f 636c 6965 6e74 5f63 6f6e p_ssl_client_con │ │ │ +00189240: 7465 7874 2829 3c2f 613e 3c2f 636f 6465 text(). Likewise, use │ │ │ +00189260: 203c 636f 6465 3e53 534c 5f43 5458 5f73 SSL_CTX_s │ │ │ +00189270: 6574 5f63 6970 6865 7273 7569 7465 7328 et_ciphersuites( │ │ │ +00189280: 736f 6170 2d26 6774 3b63 7478 2c20 222e soap->ctx, ". │ │ │ +00189290: 2e2e 2229 3c2f 636f 6465 3e20 746f 2063 ..") to c │ │ │ +001892a0: 6f6e 6669 6775 7265 2074 6865 2061 7661 onfigure the ava │ │ │ +001892b0: 696c 6162 6c65 2054 4c53 7631 2e33 2063 ilable TLSv1.3 c │ │ │ +001892c0: 6970 6865 7273 7569 7465 732e 3c2f 703e iphersuites.

    │ │ │ +001892d0: 0a3c 703e 5765 2072 6566 6572 2074 6f20 .

    We refer to │ │ │ +001892e0: 7468 6520 4f70 656e 5353 4c20 646f 6375 the OpenSSL docu │ │ │ +001892f0: 6d65 6e74 6174 696f 6e20 616e 6420 6d61 mentation and ma │ │ │ +00189300: 6e75 616c 2070 6167 6573 206f 6620 3c63 nual pages of SSL_CTX_set_ │ │ │ +00189320: 6369 7068 6572 5f6c 6973 743c 2f63 6f64 cipher_list and SSL │ │ │ +00189340: 5f43 5458 5f73 6574 5f63 6970 6865 7273 _CTX_set_ciphers │ │ │ +00189350: 7569 7465 733c 2f63 6f64 653e 2066 6f72 uites for │ │ │ +00189360: 2064 6574 6169 6c73 206f 6e20 7468 6520 details on the │ │ │ +00189370: 6c61 7465 7374 2063 6970 6865 7220 6c69 latest cipher li │ │ │ +00189380: 7374 7320 616e 6420 7375 6974 6573 2061 sts and suites a │ │ │ +00189390: 7661 696c 6162 6c65 2074 6f20 7573 652e vailable to use. │ │ │ +001893a0: 3c2f 703e 0a3c 703e 4f74 6865 7220 636c

    .

    Other cl │ │ │ +001893b0: 6965 6e74 2d73 6964 6520 5353 4c20 6f70 ient-side SSL op │ │ │ +001893c0: 7469 6f6e 7320 6172 6520 3c63 6f64 653e tions are │ │ │ +001893d0: 2353 4f41 505f 5353 4c5f 534b 4950 5f48 #SOAP_SSL_SKIP_H │ │ │ +001893e0: 4f53 545f 4348 4543 4b3c 2f63 6f64 653e OST_CHECK │ │ │ +001893f0: 2074 6f20 736b 6970 2074 6865 2068 6f73 to skip the hos │ │ │ +00189400: 7420 6e61 6d65 2076 6572 6966 6963 6174 t name verificat │ │ │ +00189410: 696f 6e20 6368 6563 6b20 616e 6420 3c63 ion check and #SOAP_SSL_AL │ │ │ +00189430: 4c4f 575f 4558 5049 5245 445f 4345 5254 LOW_EXPIRED_CERT │ │ │ +00189440: 4946 4943 4154 453c 2f63 6f64 653e 2074 IFICATE t │ │ │ +00189450: 6f20 616c 6c6f 7720 636f 6e6e 6563 7469 o allow connecti │ │ │ +00189460: 6e67 2074 6f20 6120 686f 7374 2077 6974 ng to a host wit │ │ │ +00189470: 6820 616e 2065 7870 6972 6564 2063 6572 h an expired cer │ │ │ +00189480: 7469 6669 6361 7465 2e20 466f 7220 6578 tificate. For ex │ │ │ +00189490: 616d 706c 652c 3c2f 703e 0a3c 6469 7620 ample,

    ..
    /* soap_ssl_no │ │ │ +00189690: 696e 6974 2829 3b20 2a2f 3c2f 7370 616e init(); */ /* do no │ │ │ +001896c0: 7420 696e 6974 204f 7065 6e53 534c 2028 t init OpenSSL ( │ │ │ +001896d0: 6966 2053 534c 2069 7320 616c 7265 6164 if SSL is alread │ │ │ +001896e0: 7920 696e 6974 6961 6c69 7a65 6420 656c y initialized el │ │ │ +001896f0: 7365 7768 6572 6520 696e 2074 6869 7320 sewhere in this │ │ │ +00189700: 6170 706c 6963 6174 696f 6e29 202a 2f3c application) */< │ │ │ +00189710: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    .< │ │ │ +00189730: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +00189740: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ +00189750: 705f 5f63 6f6e 7465 7874 2e68 746d 6c23 p__context.html# │ │ │ +00189760: 6761 3865 3033 3465 3161 3764 3630 3933 ga8e034e1a7d6093 │ │ │ +00189770: 6561 6464 6331 3162 3634 3731 3739 3635 eaddc11b64717965 │ │ │ +00189780: 3763 223e 736f 6170 5f69 6e69 743c 2f61 7c">soap_init
    (&so │ │ │ +001897c0: 6170 3c2f 613e 293b 3c2f 6469 763e 0a3c ap);
    .< │ │ │ +001897d0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +001897e0: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >if
    (soap_ssl_ │ │ │ +00189860: 636c 6965 6e74 5f63 6f6e 7465 7874 3c2f client_context(&s │ │ │ +001898a0: 6f61 703c 2f61 3e2c 203c 2f64 6976 3e0a oap,
    . │ │ │ +001898b0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65 .
    | S │ │ │ +001899b0: 4f41 505f 5353 4c5f 534b 4950 5f48 4f53 OAP_SSL_SKIP_HOS │ │ │ +001899c0: 545f 4348 4543 4b3c 2f61 3e2c 203c 2f64 T_CHECK, ..
    " │ │ │ +00189aa0: 636c 6965 6e74 2e70 656d 2671 756f 743b client.pem" │ │ │ +00189ab0: 3c2f 7370 616e 3e2c 2020 2020 2020 2020 , │ │ │ +00189ac0: 3c73 7061 6e20 636c 6173 733d 2263 6f6d /* keyfile │ │ │ +00189ae0: 3a20 7265 7175 6972 6564 206f 6e6c 7920 : required only │ │ │ +00189af0: 7768 656e 2063 6c69 656e 7420 6d75 7374 when client must │ │ │ +00189b00: 2061 7574 6865 6e74 6963 6174 6520 746f authenticate to │ │ │ +00189b10: 2073 6572 7665 7220 2873 6565 2053 534c server (see SSL │ │ │ +00189b20: 2064 6f63 7320 6f6e 2068 6f77 2074 6f20 docs on how to │ │ │ +00189b30: 6f62 7461 696e 2074 6869 7320 6669 6c65 obtain this file │ │ │ +00189b40: 2920 2a2f 3c2f 7370 616e 3e20 3c2f 6469 ) */ .
    "passwor │ │ │ +00189b90: 6426 7175 6f74 3b3c 2f73 7061 6e3e 2c20 d", │ │ │ +00189ba0: 2020 2020 2020 2020 203c 7370 616e 2063 / │ │ │ +00189bc0: 2a20 7061 7373 776f 7264 2074 6f20 7265 * password to re │ │ │ +00189bd0: 6164 2074 6865 206b 6579 2066 696c 6520 ad the key file │ │ │ +00189be0: 286e 6f74 2075 7365 6420 7769 7468 2047 (not used with G │ │ │ +00189bf0: 4e55 544c 5329 202a 2f3c 2f73 7061 6e3e NUTLS) */ │ │ │ +00189c00: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    "ca │ │ │ +00189c40: 6365 7274 732e 7065 6d26 7175 6f74 3b3c certs.pem"< │ │ │ +00189c50: 2f73 7061 6e3e 2c20 2020 2020 2020 3c73 /span>, /* cacert fi │ │ │ +00189c80: 6c65 2074 6f20 7374 6f72 6520 7472 7573 le to store trus │ │ │ +00189c90: 7465 6420 6365 7274 6966 6963 6174 6573 ted certificates │ │ │ +00189ca0: 2028 6e65 6564 6564 2074 6f20 7665 7269 (needed to veri │ │ │ +00189cb0: 6679 2073 6572 7665 7229 202a 2f3c 2f73 fy server) */
    .
    N │ │ │ +00189ce0: 554c 4c2c 2020 2020 2020 2020 2020 2020 ULL, │ │ │ +00189cf0: 2020 2020 3c73 7061 6e20 636c 6173 733d /* cap │ │ │ +00189d10: 6174 6820 746f 2064 6972 6563 746f 7279 ath to directory │ │ │ +00189d20: 2077 6974 6820 7472 7573 7465 6420 6365 with trusted ce │ │ │ +00189d30: 7274 6966 6963 6174 6573 202a 2f3c 2f73 rtificates */
    .
    │ │ │ +00189d60: 4e55 4c4c 2020 2020 2020 2020 203c 7370 NULL /* if randfil │ │ │ +00189d90: 6521 3d4e 554c 4c3a 2075 7365 2061 2066 e!=NULL: use a f │ │ │ +00189da0: 696c 6520 7769 7468 2072 616e 646f 6d20 ile with random │ │ │ +00189db0: 6461 7461 2074 6f20 7365 6564 2072 616e data to seed ran │ │ │ +00189dc0: 646f 6d6e 6573 7320 2a2f 3c2f 7370 616e domness */
    .
    )) < │ │ │ +00189df0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    {
    . │ │ │ +00189e10: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    soap_prin │ │ │ +00189e80: 745f 6661 756c 743c 2f61 3e28 2661 6d70 t_fault(& │ │ │ +00189e90: 3b3c 6120 636c 6173 733d 2263 6f64 6522 ;soap │ │ │ +00189ec0: 2c20 7374 6465 7272 293b 203c 2f64 6976 , stderr);
    .
    exit(EXIT_ │ │ │ +00189ef0: 4641 494c 5552 4529 3b20 3c2f 6469 763e FAILURE);
    │ │ │ +00189f00: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    }
    .
    so │ │ │ +00189f30: 6170 5f63 616c 6c5f 6e73 5f5f 6d79 6d65 ap_call_ns__myme │ │ │ +00189f40: 7468 6f64 2826 616d 703b 3c61 2063 6c61 thod(&soap, "htt │ │ │ +00189fa0: 7073 3a2f 2f64 6f6d 6169 6e2f 7061 7468 ps://domain/path │ │ │ +00189fb0: 2f73 6563 7572 652e 6367 6926 7175 6f74 /secure.cgi" │ │ │ +00189fc0: 3b3c 2f73 7061 6e3e 2c20 3c73 7061 6e20 ;, "&quo │ │ │ +00189ff0: 743b 3c2f 7370 616e 3e2c 202e 2e2e 293b t;, ...); │ │ │ +0018a000: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    │ │ │ +0018a0b0: 534f 4150 5f53 534c 5f53 4b49 505f 484f SOAP_SSL_SKIP_HO │ │ │ +0018a0c0: 5354 5f43 4845 434b 3c2f 613e 3c2f 6469 ST_CHECK
    #define SO │ │ │ +0018a0f0: 4150 5f53 534c 5f53 4b49 505f 484f 5354 AP_SSL_SKIP_HOST │ │ │ +0018a100: 5f43 4845 434b 3c2f 6469 763e 3c64 6976 _CHECK
    s │ │ │ +0018a120: 6f61 705f 7373 6c5f 666c 6167 7320 666c oap_ssl_flags fl │ │ │ +0018a130: 6167 2066 6f72 2063 6c69 656e 7473 2074 ag for clients t │ │ │ +0018a140: 6f20 616c 6c6f 7720 636c 6965 6e74 7320 o allow clients │ │ │ +0018a150: 746f 2073 6b69 7020 636f 6d6d 6f6e 206e to skip common n │ │ │ +0018a160: 616d 6520 6368 6563 6b73 2061 6761 696e ame checks again │ │ │ +0018a170: 7374 2074 6865 2068 6f73 7420 6e61 6d65 st the host name │ │ │ +0018a180: 206f 6620 2e2e 2e3c 2f64 6976 3e3c 6469 of ...
    │ │ │ +0018a1a0: 3c62 3e44 6566 696e 6974 696f 6e3a 3c2f Definition: stdsoap2.h:58 │ │ │ +0018a1c0: 3638 3c2f 6469 763e 3c2f 6469 763e 0a3c 68
    .< │ │ │ +0018a1d0: 6469 7620 636c 6173 733d 2274 7463 2220 div class="ttc" │ │ │ +0018a1e0: 6964 3d22 6167 726f 7570 5f5f 6772 6f75 id="agroup__grou │ │ │ +0018a1f0: 705f 5f73 736c 5f68 746d 6c5f 6761 3863 p__ssl_html_ga8c │ │ │ +0018a200: 3966 3837 6233 3466 6633 3430 3230 3334 9f87b34ff3402034 │ │ │ +0018a210: 3964 3466 6537 3330 3063 3437 6263 223e 9d4fe7300c47bc"> │ │ │ +0018a220: 3c64 6976 2063 6c61 7373 3d22 7474 6e61 │ │ │ +0018a2f0: 3c64 6976 2063 6c61 7373 3d22 7474 646f
    soap_ssl_flag │ │ │ +0018a310: 7320 666c 6167 2066 6f72 2063 6c69 656e s flag for clien │ │ │ +0018a320: 7473 2074 6f20 7265 7175 6972 6520 7365 ts to require se │ │ │ +0018a330: 7276 6572 7320 746f 2061 7574 6865 6e74 rvers to authent │ │ │ +0018a340: 6963 6174 6520 746f 2063 6c69 656e 7473 icate to clients │ │ │ +0018a350: 2064 7572 696e 6720 7468 6520 4854 5450 during the HTTP │ │ │ +0018a360: 5320 6861 6e64 7368 2e2e 2e3c 2f64 6976 S handsh...
    Definitio │ │ │ +0018a390: 6e3a 3c2f 623e 2073 7464 736f 6170 322e n: stdsoap2. │ │ │ +0018a3a0: 683a 3538 3632 3c2f 6469 763e 3c2f 6469 h:5862
    .
    .< │ │ │ +0018a590: 2f64 6976 3e3c 212d 2d20 6672 6167 6d65 /div>

    For sys │ │ │ +0018a5b0: 7465 6d73 2062 6173 6564 206f 6e20 4d69 tems based on Mi │ │ │ +0018a5c0: 6372 6f73 6f66 7420 7769 6e64 6f77 732c crosoft windows, │ │ │ +0018a5d0: 2074 6865 2057 696e 496e 6574 206d 6f64 the WinInet mod │ │ │ +0018a5e0: 756c 6520 6361 6e20 6265 2075 7365 6420 ule can be used │ │ │ +0018a5f0: 696e 7374 6561 642c 2073 6565 203c 636f instead, see mod_gsoap/gso │ │ │ +0018a610: 6170 5f77 696e 2f77 696e 696e 6574 3c2f ap_win/wininet.

    .

    Si │ │ │ +0018a630: 6e63 6520 7265 6c65 6173 6520 7665 7273 nce release vers │ │ │ +0018a640: 696f 6e20 322e 382e 3230 2053 534c 2076 ion 2.8.20 SSL v │ │ │ +0018a650: 3320 6973 2064 6973 6162 6c65 642e 2054 3 is disabled. T │ │ │ +0018a660: 6f20 656e 6162 6c65 2053 534c 2076 3320 o enable SSL v3 │ │ │ +0018a670: 746f 6765 7468 6572 2077 6974 6820 544c together with TL │ │ │ +0018a680: 5320 312e 3020 616e 6420 6869 6768 6572 S 1.0 and higher │ │ │ +0018a690: 2c20 7573 6520 3c63 6f64 653e 2353 4f41 , use #SOA │ │ │ +0018a6a0: 505f 5353 4c76 335f 544c 5376 313c 2f63 P_SSLv3_TLSv1 with │ │ │ +0018a6c0: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap_ssl_serv │ │ │ +0018a750: 6572 5f63 6f6e 7465 7874 3c2f 613e 3c2f er_context. To use TL │ │ │ +0018a770: 5320 312e 3120 616e 6420 312e 3220 7573 S 1.1 and 1.2 us │ │ │ +0018a780: 6520 3c63 6f64 653e 534f 4150 5f54 4c53 e SOAP_TLS │ │ │ +0018a790: 7631 5f31 207c 2053 4f41 505f 544c 5376 v1_1 | SOAP_TLSv │ │ │ +0018a7a0: 315f 323c 2f63 6f64 653e 2e20 546f 2075 1_2. To u │ │ │ +0018a7b0: 7365 2054 4c53 2031 2e32 206f 6e6c 7920 se TLS 1.2 only │ │ │ +0018a7c0: 7573 6520 3c63 6f64 653e 2353 4f41 505f use #SOAP_ │ │ │ +0018a7d0: 544c 5376 315f 323c 2f63 6f64 653e 2e20 TLSv1_2. │ │ │ +0018a7e0: 546f 2075 7365 2053 534c 2076 3320 6f6e To use SSL v3 on │ │ │ +0018a7f0: 6c79 2075 7365 203c 636f 6465 3e23 534f ly use #SO │ │ │ +0018a800: 4150 5f53 534c 7633 3c2f 636f 6465 3e2e AP_SSLv3. │ │ │ +0018a810: 3c2f 703e 0a3c 703e 546f 2064 6973 6162

    .

    To disab │ │ │ +0018a820: 6c65 2073 6572 7665 7220 6175 7468 656e le server authen │ │ │ +0018a830: 7469 6361 7469 6f6e 2066 6f72 2074 6573 tication for tes │ │ │ +0018a840: 7469 6e67 2070 7572 706f 7365 732c 2075 ting purposes, u │ │ │ +0018a850: 7365 2074 6865 2066 6f6c 6c6f 7769 6e67 se the following │ │ │ +0018a860: 3a3c 2f70 3e0a 3c64 6976 2063 6c61 7373 :

    .
    . │ │ │ +0018a970: 203c 6120 636c 6173 733d 2263 6f64 6522 SOAP_SSL_NO_AU │ │ │ +0018a9d0: 5448 454e 5449 4341 5449 4f4e 3c2f 613e THENTICATION │ │ │ +0018a9e0: 2c20 3c2f 6469 763e 0a3c 6469 7620 636c ,
    .
    NUL │ │ │ +0018aa00: 4c2c 203c 2f64 6976 3e0a 3c64 6976 2063 L,
    .
    NU │ │ │ +0018aa20: 4c4c 2c20 3c2f 6469 763e 0a3c 6469 7620 LL,
    .
    N │ │ │ +0018aa40: 554c 4c2c 203c 2f64 6976 3e0a 3c64 6976 ULL,
    .
    │ │ │ +0018aa60: 4e55 4c4c 2c20 3c2f 6469 763e 0a3c 6469 NULL,
    . │ │ │ +0018aa80: 204e 554c 4c20 3c2f 6469 763e 0a3c 6469 NULL
    .) │ │ │ +0018aaa0: 2920 3c2f 6469 763e 0a3c 6469 7620 636c )
    .
    {.
    soap_p │ │ │ +0018ab30: 7269 6e74 5f66 6175 6c74 3c2f 613e 2826 rint_fault(& │ │ │ +0018ab40: 616d 703b 3c61 2063 6c61 7373 3d22 636f amp;soap< │ │ │ +0018ab70: 2f61 3e2c 2073 7464 6572 7229 3b20 3c2f /a>, stderr); .
    exit(EX │ │ │ +0018aba0: 4954 5f46 4149 4c55 5245 293b 203c 2f64 IT_FAILURE); .
    }
    .< │ │ │ +0018abd0: 6469 7620 636c 6173 733d 2274 7463 2220 div class="ttc" │ │ │ +0018abe0: 6964 3d22 6167 726f 7570 5f5f 6772 6f75 id="agroup__grou │ │ │ +0018abf0: 705f 5f73 736c 5f68 746d 6c5f 6761 3532 p__ssl_html_ga52 │ │ │ +0018ac00: 3631 3430 3037 6430 6330 3335 3963 6561 614007d0c0359cea │ │ │ +0018ac10: 6638 3635 3838 6634 3736 3631 6239 223e f86588f47661b9"> │ │ │ +0018ac20: 3c64 6976 2063 6c61 7373 3d22 7474 6e61
    │ │ │ +0018acb0: 2364 6566 696e 6520 534f 4150 5f53 534c #define SOAP_SSL │ │ │ +0018acc0: 5f4e 4f5f 4155 5448 454e 5449 4341 5449 _NO_AUTHENTICATI │ │ │ +0018acd0: 4f4e 3c2f 6469 763e 3c64 6976 2063 6c61 ON
    soap_ │ │ │ +0018acf0: 7373 6c5f 666c 6167 7320 666c 6167 2076 ssl_flags flag v │ │ │ +0018ad00: 616c 7565 2074 6f20 6469 7361 626c 6520 alue to disable │ │ │ +0018ad10: 6175 7468 656e 7469 6361 7469 6f6e 206f authentication o │ │ │ +0018ad20: 6620 7468 6520 7065 6572 3c2f 6469 763e f the peer
    │ │ │ +0018ad30: 3c64 6976 2063 6c61 7373 3d22 7474 6465
    Definition │ │ │ +0018ad50: 3a3c 2f62 3e20 7374 6473 6f61 7032 2e68 : stdsoap2.h │ │ │ +0018ad60: 3a35 3834 303c 2f64 6976 3e3c 2f64 6976 :5840
    .

    This │ │ │ +0018ad90: 2061 6c73 6f20 6173 7375 6d65 7320 7468 also assumes th │ │ │ +0018ada0: 6174 2074 6865 2073 6572 7665 7220 646f at the server do │ │ │ +0018adb0: 6573 206e 6f74 2072 6571 7569 7265 2063 es not require c │ │ │ +0018adc0: 6c69 656e 7473 2074 6f20 6175 7468 656e lients to authen │ │ │ +0018add0: 7469 6361 7465 2028 7468 6520 6b65 7966 ticate (the keyf │ │ │ +0018ade0: 696c 6520 6973 2061 6273 656e 7429 2e3c ile is absent).< │ │ │ +0018adf0: 2f70 3e0a 3c70 3e4d 616b 6520 7375 7265 /p>.

    Make sure │ │ │ +0018ae00: 2079 6f75 2068 6176 6520 7369 676e 616c you have signal │ │ │ +0018ae10: 2068 616e 646c 6572 7320 7365 7420 696e handlers set in │ │ │ +0018ae20: 2079 6f75 7220 6170 706c 6963 6174 696f your applicatio │ │ │ +0018ae30: 6e20 746f 2063 6174 6368 2062 726f 6b65 n to catch broke │ │ │ +0018ae40: 6e20 636f 6e6e 6563 7469 6f6e 7320 283c n connections (< │ │ │ +0018ae50: 636f 6465 3e53 4947 5049 5045 3c2f 636f code>SIGPIPE):

    .
    │ │ │ +0018ae80: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    signal(SIGPIPE │ │ │ +0018aea0: 2c20 7369 6770 6970 655f 6861 6e64 6c65 , sigpipe_handle │ │ │ +0018aeb0: 293b 3c2f 6469 763e 0a3c 2f64 6976 3e3c );
    .
    < │ │ │ +0018aec0: 212d 2d20 6672 6167 6d65 6e74 202d 2d3e !-- fragment --> │ │ │ +0018aed0: 3c70 3e77 6865 7265 2c20 666f 7220 6578

    where, for ex │ │ │ +0018aee0: 616d 706c 653a 3c2f 703e 0a3c 6469 7620 ample:

    .
    voi │ │ │ +0018af30: 643c 2f73 7061 6e3e 2073 6967 7069 7065 d sigpipe │ │ │ +0018af40: 5f68 616e 646c 6528 3c73 7061 6e20 636c _handle(int x) │ │ │ +0018af70: 7b20 7d3c 2f64 6976 3e0a 3c2f 6469 763e { }
    .
    │ │ │ +0018af80: 3c21 2d2d 2066 7261 676d 656e 7420 2d2d │ │ │ +0018e510: 3c70 3e54 6865 2066 6f6c 6c6f 7769 6e67

    The following │ │ │ +0018e520: 2074 6162 6c65 206c 6973 7473 2074 6865 table lists the │ │ │ +0018e530: 206e 616d 6573 206f 6620 7468 6520 6861 names of the ha │ │ │ +0018e540: 7264 7761 7265 2061 6e64 2073 6f66 7477 rdware and softw │ │ │ +0018e550: 6172 6520 656e 6769 6e65 733a 3c2f 703e are engines:

    │ │ │ +0018e560: 0a3c 7461 626c 6520 636c 6173 733d 226d ..< │ │ │ +0018e580: 7472 2063 6c61 7373 3d22 6d61 726b 646f tr class="markdo │ │ │ +0018e590: 776e 5461 626c 6548 6561 6422 3e0a 3c74 wnTableHead">. │ │ │ +0018e5c0: 656e 6769 6e65 2020 203c 2f74 683e 3c74 engine │ │ │ +0018e5f0: 7265 7375 6c74 2020 2020 3c2f 7468 3e3c result < │ │ │ +0018e600: 2f74 723e 0a3c 7472 2063 6c61 7373 3d22 /tr>....< │ │ │ +0018e6f0: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ +0018e700: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ +0018e710: 3e3c 636f 6465 3e6f 7065 6e62 7364 5f64 >openbsd_d │ │ │ +0018e720: 6576 5f63 7279 7074 6f3c 2f63 6f64 653e ev_crypto │ │ │ +0018e730: 2020 203c 2f74 643e 3c74 6420 636c 6173 .... │ │ │ +0018e8a0: 3c74 6420 636c 6173 733d 226d 6172 6b64 ..< │ │ │ +0018e9a0: 2f74 723e 0a3c 7472 2063 6c61 7373 3d22 /tr>...< │ │ │ +0018ea50: 7472 2063 6c61 7373 3d22 6d61 726b 646f tr class="markdo │ │ │ +0018ea60: 776e 5461 626c 6552 6f77 4f64 6422 3e0a wnTableRowOdd">. │ │ │ +0018ea70: 3c74 6420 636c 6173 733d 226d 6172 6b64 │ │ │ +0018eb00: 0a3c 7472 2063 6c61 7373 3d22 6d61 726b ....< │ │ │ +0018ec50: 2f74 723e 0a3c 2f74 6162 6c65 3e0a 3c70 /tr>.
    op │ │ │ +0018e650: 656e 7373 6c3c 2f63 6f64 653e 2020 203c enssl < │ │ │ +0018e660: 2f74 643e 3c74 6420 636c 6173 733d 226d /td>The defaul │ │ │ +0018e690: 7420 736f 6674 7761 7265 2065 6e67 696e t software engin │ │ │ +0018e6a0: 6520 666f 7220 6372 7970 746f 6772 6170 e for cryptograp │ │ │ +0018e6b0: 6869 6320 6f70 6572 6174 696f 6e73 2020 hic operations │ │ │ +0018e6c0: 2020 3c2f 7464 3e3c 2f74 723e 0a3c 7472
    OpenBS │ │ │ +0018e760: 4420 7375 7070 6f72 7473 206b 6572 6e65 D supports kerne │ │ │ +0018e770: 6c20 6c65 7665 6c20 6372 7970 746f 6772 l level cryptogr │ │ │ +0018e780: 6170 6879 2020 2020 3c2f 7464 3e3c 2f74 aphy
    cswi │ │ │ +0018e7e0: 6674 3c2f 636f 6465 3e20 2020 3c2f 7464 ft CryptoSwift a │ │ │ +0018e820: 6363 656c 6572 6174 696f 6e20 6861 7264 cceleration hard │ │ │ +0018e830: 7761 7265 2020 2020 3c2f 7464 3e3c 2f74 ware
    chi │ │ │ +0018e890: 6c3c 2f63 6f64 653e 2020 203c 2f74 643e l nCipher CHIL a │ │ │ +0018e8d0: 6363 656c 6572 6174 696f 6e20 6861 7264 cceleration hard │ │ │ +0018e8e0: 7761 7265 2020 2020 3c2f 7464 3e3c 2f74 ware
    atal │ │ │ +0018e940: 6c61 3c2f 636f 6465 3e20 2020 3c2f 7464 la Compaq Atalla │ │ │ +0018e980: 2061 6363 656c 6572 6174 696f 6e20 6861 acceleration ha │ │ │ +0018e990: 7264 7761 7265 2020 2020 3c2f 7464 3e3c rdware
    n │ │ │ +0018e9f0: 7572 6f6e 3c2f 636f 6465 3e20 2020 3c2f uron Nuron accel │ │ │ +0018ea30: 6572 6174 696f 6e20 6861 7264 7761 7265 eration hardware │ │ │ +0018ea40: 2020 2020 3c2f 7464 3e3c 2f74 723e 0a3c
    ubsec Br │ │ │ +0018ead0: 6f61 6463 6f6d 2075 4253 6563 2061 6363 oadcom uBSec acc │ │ │ +0018eae0: 656c 6572 6174 696f 6e20 6861 7264 7761 eleration hardwa │ │ │ +0018eaf0: 7265 2020 2020 3c2f 7464 3e3c 2f74 723e re
    aep A │ │ │ +0018eb80: 6570 2061 6363 656c 6572 6174 696f 6e20 ep acceleration │ │ │ +0018eb90: 6861 7264 7761 7265 2020 2020 3c2f 7464 hardware
    │ │ │ +0018ebf0: 7375 7265 7761 7265 3c2f 636f 6465 3e20 sureware │ │ │ +0018ec00: 2020 3c2f 7464 3e3c 7464 2063 6c61 7373 SureWar │ │ │ +0018ec30: 6520 6163 6365 6c65 7261 7469 6f6e 2068 e acceleration h │ │ │ +0018ec40: 6172 6477 6172 6520 2020 3c2f 7464 3e3c ardware
    .

    .... Back to table │ │ │ +0018ec80: 6f66 2063 6f6e 7465 6e74 733c 2f61 3e3c of contents< │ │ │ +0018ec90: 2f70 3e0a 3c68 323e 3c61 2063 6c61 7373 /p>.

    .SSL o │ │ │ +0018ecc0: 6e20 5769 6e64 6f77 733c 2f68 323e 0a3c n Windows

    .< │ │ │ +0018ecd0: 703e 5365 7420 7468 6520 6675 6c6c 2070 p>Set the full p │ │ │ +0018ece0: 6174 6820 746f 203c 656d 3e3c 636f 6465 ath to libssl.lib and │ │ │ +0018ed10: 3c63 6f64 653e 6c69 6263 7279 7074 6f2e libcrypto. │ │ │ +0018ed20: 6c69 623c 2f63 6f64 653e 3c2f 656d 3e20 lib │ │ │ +0018ed30: 756e 6465 7220 7468 6520 4d53 5643 2b2b under the MSVC++ │ │ │ +0018ed40: 2022 5072 6f6a 6563 7473 2220 6d65 6e75 "Projects" menu │ │ │ +0018ed50: 2c20 7468 656e 2063 686f 6f73 6520 224c , then choose "L │ │ │ +0018ed60: 696e 6b22 3a20 224f 626a 6563 742f 4d6f ink": "Object/Mo │ │ │ +0018ed70: 6475 6c65 7322 2e20 506c 6561 7365 206d dules". Please m │ │ │ +0018ed80: 616b 6520 7375 7265 203c 656d 3e3c 636f ake sure libssl32.dll< │ │ │ +0018eda0: 2f63 6f64 653e 3c2f 656d 3e20 616e 6420 /code> and │ │ │ +0018edb0: 3c65 6d3e 3c63 6f64 653e 6c69 6265 6179 libeay │ │ │ +0018edc0: 3332 2e64 6c6c 3c2f 636f 6465 3e3c 2f65 32.dll can be loaded │ │ │ +0018ede0: 2062 7920 796f 7572 2061 7070 6c69 6361 by your applica │ │ │ +0018edf0: 7469 6f6e 732c 2074 6875 7320 7468 6579 tions, thus they │ │ │ +0018ee00: 206d 7573 7420 6265 2069 6e73 7461 6c6c must be install │ │ │ +0018ee10: 6564 2070 726f 7065 726c 7920 6f6e 2074 ed properly on t │ │ │ +0018ee20: 6865 2074 6172 6765 7420 6d61 6368 696e he target machin │ │ │ +0018ee30: 652e 3c2f 703e 0a3c 703e 4966 2079 6f75 e.

    .

    If you │ │ │ +0018ee40: 2772 6520 7573 696e 6720 636f 6d70 696c 're using compil │ │ │ +0018ee50: 6174 696f 6e20 7365 7474 696e 6773 2073 ation settings s │ │ │ +0018ee60: 7563 6820 6173 203c 636f 6465 3e2f 4d54 uch as /MT │ │ │ +0018ee70: 643c 2f63 6f64 653e 2074 6865 6e20 6c69 d then li │ │ │ +0018ee80: 6e6b 2074 6f20 7468 6520 636f 7272 6563 nk to the correc │ │ │ +0018ee90: 7420 3c65 6d3e 3c63 6f64 653e 6c69 6265 t libe │ │ │ +0018eea0: 6179 3332 4d54 642e 6c69 623c 2f63 6f64 ay32MTd.lib and │ │ │ +0018eec0: 3c63 6f64 653e 7373 6c65 6179 3332 4d54 ssleay32MT │ │ │ +0018eed0: 642e 6c69 623c 2f63 6f64 653e 3c2f 656d d.lib libraries.

    │ │ │ +0018eef0: 0a3c 703e 416c 7465 726e 6174 6976 656c .

    Alternativel │ │ │ +0018ef00: 792c 2079 6f75 2063 616e 2075 7365 2074 y, you can use t │ │ │ +0018ef10: 6865 2057 696e 496e 6574 2069 6e74 6572 he WinInet inter │ │ │ +0018ef20: 6661 6365 2066 6f72 2073 6563 7572 6520 face for secure │ │ │ +0018ef30: 636f 6e6e 6563 7469 6f6e 732c 2061 7661 connections, ava │ │ │ +0018ef40: 696c 6162 6c65 2069 6e20 7468 6520 3c65 ilable in the gsoap/mo │ │ │ +0018ef60: 645f 6773 6f61 703c 2f63 6f64 653e 3c2f d_gsoap directory of │ │ │ +0018ef80: 2074 6865 2067 534f 4150 2070 6163 6b61 the gSOAP packa │ │ │ +0018ef90: 6765 2c20 7365 6520 616c 736f 2053 6563 ge, see also Sec │ │ │ +0018efa0: 7469 6f6e 203c 6120 636c 6173 733d 2265 tion The WinInet p │ │ │ +0018efe0: 6c75 6769 6e3c 2f61 3e2e 204f 7220 796f lugin. Or yo │ │ │ +0018eff0: 7520 6361 6e20 7573 6520 7468 6520 4355 u can use the CU │ │ │ +0018f000: 524c 2070 6c75 6769 6e20 746f 2075 7365 RL plugin to use │ │ │ +0018f010: 2043 5552 4c20 666f 7220 7365 6375 7265 CURL for secure │ │ │ +0018f020: 2063 6f6e 6e65 6374 696f 6e73 2c20 7365 connections, se │ │ │ +0018f030: 6520 5365 6374 696f 6e20 3c61 2063 6c61 e Section The CURL pl │ │ │ +0018f070: 7567 696e 3c2f 613e 2e3c 2f70 3e0a 3c70 ugin.

    .

    .... Back to table │ │ │ +0018f0a0: 6f66 2063 6f6e 7465 6e74 733c 2f61 3e3c of contents< │ │ │ +0018f0b0: 2f70 3e0a 3c68 323e 3c61 2063 6c61 7373 /p>.

    . │ │ │ +0018f0e0: 5a6c 6962 2063 6f6d 7072 6573 7369 6f6e Zlib compression │ │ │ +0018f0f0: 3c2f 6832 3e0a 3c70 3e54 6f20 656e 6162

    .

    To enab │ │ │ +0018f100: 6c65 2064 6566 6c61 7465 2061 6e64 2067 le deflate and g │ │ │ +0018f110: 7a69 7020 636f 6d70 7265 7373 696f 6e20 zip compression │ │ │ +0018f120: 7769 7468 205a 6c69 622c 2069 6e73 7461 with Zlib, insta │ │ │ +0018f130: 6c6c 205a 6c69 6220 6672 6f6d 203c 6120 ll Zlib from http: │ │ │ +0018f160: 2f2f 7777 772e 7a6c 6962 2e6f 7267 3c2f //www.zlib.org if not alread │ │ │ +0018f180: 7920 696e 7374 616c 6c65 6420 6f6e 2079 y installed on y │ │ │ +0018f190: 6f75 7220 7379 7374 656d 2e20 436f 6d70 our system. Comp │ │ │ +0018f1a0: 696c 6520 3c65 6d3e 3c63 6f64 653e 6773 ile gs │ │ │ +0018f1b0: 6f61 702f 7374 6473 6f61 7032 2e63 7070 oap/stdsoap2.cpp │ │ │ +0018f1c0: 3c2f 636f 6465 3e3c 2f65 6d3e 2028 6f72 (or │ │ │ +0018f1d0: 203c 656d 3e3c 636f 6465 3e67 736f 6170 gsoap │ │ │ +0018f1e0: 2f73 7464 736f 6170 322e 633c 2f63 6f64 /stdsoap2.c) and all │ │ │ +0018f200: 2079 6f75 7220 736f 7572 6365 7320 7468 your sources th │ │ │ +0018f210: 6174 2069 6e63 6c75 6465 203c 656d 3e3c at include < │ │ │ +0018f220: 636f 6465 3e67 736f 6170 2f73 7464 736f code>gsoap/stdso │ │ │ +0018f230: 6170 322e 683c 2f63 6f64 653e 3c2f 656d ap2.h or s │ │ │ +0018f250: 6f61 7048 2e68 3c2f 636f 6465 3e3c 2f65 oapH.h with compile- │ │ │ +0018f270: 7469 6d65 2066 6c61 6720 3c63 6f64 653e time flag │ │ │ +0018f280: 2357 4954 485f 475a 4950 3c2f 636f 6465 #WITH_GZIP and link your │ │ │ +0018f2a0: 636f 6465 2077 6974 6820 7468 6520 5a6c code with the Zl │ │ │ +0018f2b0: 6962 206c 6962 7261 7279 2c20 652e 672e ib library, e.g. │ │ │ +0018f2c0: 203c 623e 3c63 6f64 653e 2d6c 7a3c 2f63 -lz on Unix │ │ │ +0018f2e0: 2f4c 696e 7578 2070 6c61 7466 6f72 6d73 /Linux platforms │ │ │ +0018f2f0: 2e3c 2f70 3e0a 3c70 3e54 6865 2067 7a69 .

    .

    The gzi │ │ │ +0018f300: 7020 636f 6d70 7265 7373 696f 6e20 6973 p compression is │ │ │ +0018f310: 206f 7274 686f 676f 6e61 6c20 746f 2061 orthogonal to a │ │ │ +0018f320: 6c6c 2074 7261 6e73 706f 7274 2065 6e63 ll transport enc │ │ │ +0018f330: 6f64 696e 6773 2073 7563 6820 6173 2048 odings such as H │ │ │ +0018f340: 5454 502c 2053 534c 2c20 4449 4d45 2c20 TTP, SSL, DIME, │ │ │ +0018f350: 616e 6420 6361 6e20 6265 2075 7365 6420 and can be used │ │ │ +0018f360: 7769 7468 206f 7468 6572 2074 7261 6e73 with other trans │ │ │ +0018f370: 706f 7274 206c 6179 6572 732e 2059 6f75 port layers. You │ │ │ +0018f380: 2063 616e 2065 7665 6e20 7361 7665 2061 can even save a │ │ │ +0018f390: 6e64 206c 6f61 6420 636f 6d70 7265 7373 nd load compress │ │ │ +0018f3a0: 6564 2058 4d4c 2064 6174 6120 746f 2f66 ed XML data to/f │ │ │ +0018f3b0: 726f 6d20 6669 6c65 732e 3c2f 703e 0a3c rom files.

    .< │ │ │ +0018f3c0: 703e 5477 6f20 636f 6d70 7265 7373 696f p>Two compressio │ │ │ +0018f3d0: 6e20 666f 726d 6174 7320 6172 6520 7375 n formats are su │ │ │ +0018f3e0: 7070 6f72 7465 6420 6279 2074 6865 2065 pported by the e │ │ │ +0018f3f0: 6e67 696e 653a 2064 6566 6c61 7465 2061 ngine: deflate a │ │ │ +0018f400: 6e64 2067 7a69 702e 2054 6865 2067 7a69 nd gzip. The gzi │ │ │ +0018f410: 7020 666f 726d 6174 2069 7320 7573 6564 p format is used │ │ │ +0018f420: 2062 7920 6465 6661 756c 742e 2054 6865 by default. The │ │ │ +0018f430: 2067 7a69 7020 666f 726d 6174 2068 6173 gzip format has │ │ │ +0018f440: 2073 6576 6572 616c 2062 656e 6566 6974 several benefit │ │ │ +0018f450: 7320 6f76 6572 2064 6566 6c61 7465 2e20 s over deflate. │ │ │ +0018f460: 4669 7273 746c 792c 2074 6865 2065 6e67 Firstly, the eng │ │ │ +0018f470: 696e 6520 6175 746f 6d61 7469 6361 6c6c ine automaticall │ │ │ +0018f480: 7920 6465 7465 6374 7320 677a 6970 2063 y detects gzip c │ │ │ +0018f490: 6f6d 7072 6573 7365 6420 696e 626f 756e ompressed inboun │ │ │ +0018f4a0: 6420 6d65 7373 6167 6573 2c20 6576 656e d messages, even │ │ │ +0018f4b0: 2077 6974 686f 7574 2048 5454 5020 6865 without HTTP he │ │ │ +0018f4c0: 6164 6572 732c 2062 7920 6368 6563 6b69 aders, by checki │ │ │ +0018f4d0: 6e67 2066 6f72 2074 6865 2070 7265 7365 ng for the prese │ │ │ +0018f4e0: 6e63 6520 6f66 2061 2067 7a69 7020 6865 nce of a gzip he │ │ │ +0018f4f0: 6164 6572 2069 6e20 7468 6520 6d65 7373 ader in the mess │ │ │ +0018f500: 6167 6520 636f 6e74 656e 742e 2053 6563 age content. Sec │ │ │ +0018f510: 6f6e 646c 792c 2067 7a69 7020 696e 636c ondly, gzip incl │ │ │ +0018f520: 7564 6573 2061 2043 5243 3332 2063 6865 udes a CRC32 che │ │ │ +0018f530: 636b 7375 6d20 746f 2065 6e73 7572 6520 cksum to ensure │ │ │ +0018f540: 6d65 7373 6167 6573 2068 6176 6520 6265 messages have be │ │ │ +0018f550: 656e 2063 6f72 7265 6374 6c79 2072 6563 en correctly rec │ │ │ +0018f560: 6569 7665 642e 2054 6869 7264 6c79 2c20 eived. Thirdly, │ │ │ +0018f570: 677a 6970 2063 6f6d 7072 6573 7365 6420 gzip compressed │ │ │ +0018f580: 636f 6e74 656e 7420 6361 6e20 6265 2064 content can be d │ │ │ +0018f590: 6563 6f6d 7072 6573 7365 6420 7769 7468 ecompressed with │ │ │ +0018f5a0: 206f 7468 6572 2063 6f6d 7072 6573 7369 other compressi │ │ │ +0018f5b0: 6f6e 2073 6f66 7477 6172 652c 2073 6f20 on software, so │ │ │ +0018f5c0: 796f 7520 6361 6e20 6465 636f 6d70 7265 you can decompre │ │ │ +0018f5d0: 7373 2058 4d4c 2064 6174 6120 7361 7665 ss XML data save │ │ │ +0018f5e0: 6420 6279 2061 2067 534f 4150 2061 7070 d by a gSOAP app │ │ │ +0018f5f0: 6c69 6361 7469 6f6e 2069 6e20 677a 6970 lication in gzip │ │ │ +0018f600: 2066 6f72 6d61 742e 3c2f 703e 0a3c 703e format.

    .

    │ │ │ +0018f610: 477a 6970 2063 6f6d 7072 6573 7369 6f6e Gzip compression │ │ │ +0018f620: 2069 7320 656e 6162 6c65 6420 6279 2063 is enabled by c │ │ │ +0018f630: 6f6d 7069 6c69 6e67 2074 6865 2073 6f75 ompiling the sou │ │ │ +0018f640: 7263 6573 2077 6974 6820 636f 6d70 696c rces with compil │ │ │ +0018f650: 652d 7469 6d65 2066 6c61 6720 3c63 6f64 e-time flag #WITH_GZIP. To transmit │ │ │ +0018f680: 2067 7a69 7020 636f 6d70 7265 7373 6564 gzip compressed │ │ │ +0018f690: 2053 4f41 502f 584d 4c20 6461 7461 2c20 SOAP/XML data, │ │ │ +0018f6a0: 7365 7420 7468 6520 6f75 7470 7574 206d set the output m │ │ │ +0018f6b0: 6f64 6520 666c 6167 7320 746f 203c 636f ode flags to #SOAP_ENC_ZLI │ │ │ +0018f6d0: 423c 2f63 6f64 653e 2e20 466f 7220 6578 B. For ex │ │ │ +0018f6e0: 616d 706c 653a 3c2f 703e 0a3c 6469 7620 ample:

    .
    soap_ini │ │ │ +0018f770: 743c 2f61 3e28 2661 6d70 3b3c 6120 636c t(&soap); .
    soap_ │ │ │ +0018f820: 7365 745f 6f6d 6f64 653c 2f61 3e28 2661 set_omode(&a │ │ │ +0018f830: 6d70 3b3c 6120 636c 6173 733d 2263 6f64 mp;soap, SOAP_ENC_ │ │ │ +0018f8c0: 5a4c 4942 3c2f 613e 293b 203c 7370 616e ZLIB); // enable Zlib& │ │ │ +0018f8f0: 2333 393b 7320 677a 6970 203c 2f73 7061 #39;s gzip
    .
    if ( │ │ │ +0018f940: 736f 6170 5f63 616c 6c5f 6e73 5f5f 6d79 soap_call_ns__my │ │ │ +0018f950: 4d65 7468 6f64 2826 616d 703b 3c61 2063 Method(&soap, ... │ │ │ +0018f990: 2929 203c 2f64 6976 3e0a 3c64 6976 2063 ))
    .
    .. │ │ │ +0018f9b0: 2e20 3c73 7061 6e20 636c 6173 733d 2263 . // error │ │ │ +0018f9d0: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ +0018f9f0: 3c73 7061 6e20 636c 6173 733d 226b 6579 else
    .
    │ │ │ +0018fa30: 2e2e 2e20 3c73 7061 6e20 636c 6173 733d ... // suc │ │ │ +0018fa50: 6365 7373 3c2f 7370 616e 3e3c 2f64 6976 cess
    .
    soap_cl │ │ │ +0018fad0: 725f 6f6d 6f64 653c 2f61 3e28 2661 6d70 r_omode(& │ │ │ +0018fae0: 3b3c 6120 636c 6173 733d 2263 6f64 6522 ;soap │ │ │ +0018fb10: 2c20 3c61 2063 6c61 7373 3d22 636f 6465 , SOAP_ENC_ZL │ │ │ +0018fb70: 4942 3c2f 613e 293b 203c 7370 616e 2063 IB); / │ │ │ +0018fb90: 2f20 6469 7361 626c 6520 5a6c 6962 2623 / disable Zlib&# │ │ │ +0018fba0: 3339 3b73 2067 7a69 7020 3c2f 7370 616e 39;s gzip
    .
    < │ │ │ +0018fc20: 6120 6872 6566 3d22 6772 6f75 705f 5f67 a href="group__g │ │ │ +0018fc30: 726f 7570 5f5f 666c 6167 732e 6874 6d6c roup__flags.html │ │ │ +0018fc40: 2367 6166 6136 3262 6537 6261 3436 6235 #gafa62be7ba46b5 │ │ │ +0018fc50: 3064 3538 3630 3861 3036 3666 3434 3263 0d58608a066f442c │ │ │ +0018fc60: 3261 3822 3e53 4f41 505f 454e 435f 5a4c 2a8">SOAP_ENC_ZL │ │ │ +0018fc70: 4942 3c2f 613e 3c2f 6469 763e 3c64 6976 IB
    │ │ │ +0018fc90: 2364 6566 696e 6520 534f 4150 5f45 4e43 #define SOAP_ENC │ │ │ +0018fca0: 5f5a 4c49 423c 2f64 6976 3e3c 6469 7620 _ZLIB
    so │ │ │ +0018fcc0: 6170 5f6d 6f64 6520 454e 4320 6f75 7470 ap_mode ENC outp │ │ │ +0018fcd0: 7574 2066 6c61 6720 7661 6c75 6520 746f ut flag value to │ │ │ +0018fce0: 2063 6f6d 7072 6573 7320 6d65 7373 6167 compress messag │ │ │ +0018fcf0: 6573 2073 656e 742c 2072 6571 7569 7265 es sent, require │ │ │ +0018fd00: 7320 7a6c 6962 2065 6e61 626c 6564 2077 s zlib enabled w │ │ │ +0018fd10: 6974 6820 636f 6d70 696c 652d 7469 6d65 ith compile-time │ │ │ +0018fd20: 2066 6c2e 2e2e 3c2f 6469 763e 3c64 6976 fl...
    < │ │ │ +0018fd40: 623e 4465 6669 6e69 7469 6f6e 3a3c 2f62 b>Definition: stdsoap2.h:178 │ │ │ +0018fd60: 383c 2f64 6976 3e3c 2f64 6976 3e0a 3c2f 8
    .

    This wil │ │ │ +0018fd90: 6c20 7365 6e64 2061 2063 6f6d 7072 6573 l send a compres │ │ │ +0018fda0: 7365 6420 534f 4150 2f58 4d4c 2072 6571 sed SOAP/XML req │ │ │ +0018fdb0: 7565 7374 2074 6f20 6120 7365 7276 6963 uest to a servic │ │ │ +0018fdc0: 652c 2070 726f 7669 6465 6420 7468 6174 e, provided that │ │ │ +0018fdd0: 205a 6c69 6220 6973 2069 6e73 7461 6c6c Zlib is install │ │ │ +0018fde0: 6564 2061 6e64 206c 696e 6b65 6420 7769 ed and linked wi │ │ │ +0018fdf0: 7468 2074 6865 2061 7070 6c69 6361 7469 th the applicati │ │ │ +0018fe00: 6f6e 2061 6e64 2074 6865 2063 6f6d 7069 on and the compi │ │ │ +0018fe10: 6c65 2d74 696d 6520 666c 6167 203c 636f le-time flag #WITH_GZIP option was │ │ │ +0018fe40: 7573 6564 2074 6f20 636f 6d70 696c 6520 used to compile │ │ │ +0018fe50: 7468 6520 736f 7572 6365 732e 2052 6563 the sources. Rec │ │ │ +0018fe60: 6569 7669 6e67 2063 6f6d 7072 6573 7365 eiving compresse │ │ │ +0018fe70: 6420 534f 4150 2f58 4d4c 206f 7665 7220 d SOAP/XML over │ │ │ +0018fe80: 4854 5450 2065 6974 6865 7220 696e 2067 HTTP either in g │ │ │ +0018fe90: 7a69 7020 6f72 2064 6566 6c61 7465 2066 zip or deflate f │ │ │ +0018fea0: 6f72 6d61 7473 2069 7320 6175 746f 6d61 ormats is automa │ │ │ +0018feb0: 7469 632e 2054 6865 203c 636f 6465 3e23 tic. The # │ │ │ +0018fec0: 534f 4150 5f45 4e43 5f5a 4c49 423c 2f63 SOAP_ENC_ZLIB flag does n │ │ │ +0018fee0: 6f74 2068 6176 6520 746f 2062 6520 7365 ot have to be se │ │ │ +0018fef0: 7420 6174 2074 6865 2073 6572 7665 7220 t at the server │ │ │ +0018ff00: 7369 6465 2074 6f20 6163 6365 7074 2063 side to accept c │ │ │ +0018ff10: 6f6d 7072 6573 7365 6420 6d65 7373 6167 ompressed messag │ │ │ +0018ff20: 6573 2e20 5265 6164 696e 6720 616e 6420 es. Reading and │ │ │ +0018ff30: 7265 6365 6976 696e 6720 677a 6970 2063 receiving gzip c │ │ │ +0018ff40: 6f6d 7072 6573 7365 6420 534f 4150 2f58 ompressed SOAP/X │ │ │ +0018ff50: 4d4c 2077 6974 686f 7574 2048 5454 5020 ML without HTTP │ │ │ +0018ff60: 6865 6164 6572 7320 2865 2e67 2e20 7769 headers (e.g. wi │ │ │ +0018ff70: 7468 206f 7468 6572 2074 7261 6e73 706f th other transpo │ │ │ +0018ff80: 7274 2070 726f 746f 636f 6c73 2920 6973 rt protocols) is │ │ │ +0018ff90: 2061 6c73 6f20 6175 746f 6d61 7469 632e also automatic. │ │ │ +0018ffa0: 3c2f 703e 0a3c 703e 546f 2063 6f6e 7472

    .

    To contr │ │ │ +0018ffb0: 6f6c 2074 6865 206c 6576 656c 206f 6620 ol the level of │ │ │ +0018ffc0: 636f 6d70 7265 7373 696f 6e20 666f 7220 compression for │ │ │ +0018ffd0: 6f75 7462 6f75 6e64 206d 6573 7361 6765 outbound message │ │ │ +0018ffe0: 732c 2079 6f75 2063 616e 2073 6574 2074 s, you can set t │ │ │ +0018fff0: 6865 203c 636f 6465 3e3c 6120 636c 6173 he soa │ │ │ +001900b0: 703a 3a7a 5f6c 6576 656c 3c2f 613e 3c2f p::z_level to a value │ │ │ +001900d0: 2062 6574 7765 656e 2031 2061 6e64 2039 between 1 and 9 │ │ │ +001900e0: 2c20 7768 6572 6520 3120 6973 2074 6865 , where 1 is the │ │ │ +001900f0: 2062 6573 7420 7370 6565 6420 616e 6420 best speed and │ │ │ +00190100: 3920 6973 2074 6865 2062 6573 7420 636f 9 is the best co │ │ │ +00190110: 6d70 7265 7373 696f 6e20 2864 6566 6175 mpression (defau │ │ │ +00190120: 6c74 2069 7320 3629 2e20 466f 7220 6578 lt is 6). For ex │ │ │ +00190130: 616d 706c 653c 2f70 3e0a 3c64 6976 2063 ample

    .
    │ │ │ +00190150: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    soap_init │ │ │ +001901c0: 3c2f 613e 2826 616d 703b 3c61 2063 6c61 (&soap); . │ │ │ +00190320: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    soap.z_le │ │ │ +001903b0: 7665 6c3c 2f61 3e20 3d20 393b 203c 7370 vel = 9; // best compr │ │ │ +001903e0: 6573 7369 6f6e 203c 2f73 7061 6e3e 3c2f ession .
    so │ │ │ +00190490: 6170 3a3a 7a5f 6c65 7665 6c3c 2f61 3e3c ap::z_level< │ │ │ +001904a0: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
    unsigne │ │ │ +001904c0: 6420 7368 6f72 7420 7a5f 6c65 7665 6c3c d short z_level< │ │ │ +001904d0: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
    User-def │ │ │ +001904f0: 696e 6162 6c65 2063 6f6d 7072 6573 7369 inable compressi │ │ │ +00190500: 6f6e 206c 6576 656c 2066 6f72 2067 7a69 on level for gzi │ │ │ +00190510: 7020 636f 6d70 7265 7373 696f 6e20 2830 p compression (0 │ │ │ +00190520: 3d6e 6f6e 652c 2031 3d66 6173 7420 746f =none, 1=fast to │ │ │ +00190530: 2039 3d62 6573 7429 2064 6566 6175 6c74 9=best) default │ │ │ +00190540: 206c 6576 656c 2069 7320 362e 3c2f 6469 level is 6.
    Definiti │ │ │ +00190570: 6f6e 3a3c 2f62 3e20 7374 6473 6f61 7032 on: stdsoap2 │ │ │ +00190580: 2e68 3a33 3730 343c 2f64 6976 3e3c 2f64 .h:3704
    .

    To │ │ │ +001905b0: 2076 6572 6966 7920 616e 6420 6d6f 6e69 verify and moni │ │ │ +001905c0: 746f 7220 636f 6d70 7265 7373 696f 6e20 tor compression │ │ │ +001905d0: 7261 7465 732c 2079 6f75 2063 616e 2075 rates, you can u │ │ │ +001905e0: 7365 2074 6865 2076 616c 7565 7320 3c63 se the values soap::z_ratio_i │ │ │ +001906b0: 6e3c 2f61 3e3c 2f63 6f64 653e 2061 6e64 n and │ │ │ +001906c0: 203c 636f 6465 3e3c 6120 636c 6173 733d │ │ │ +00190770: 736f 6170 3a3a 7a5f 7261 7469 6f5f 6f75 soap::z_ratio_ou │ │ │ +00190780: 743c 2f61 3e3c 2f63 6f64 653e 2e20 5468 t. Th │ │ │ +00190790: 6573 6520 7477 6f20 666c 6f61 7420 7661 ese two float va │ │ │ +001907a0: 6c75 6573 206c 6965 2062 6574 7765 656e lues lie between │ │ │ +001907b0: 2030 2e30 2061 6e64 2031 2e30 2061 6e64 0.0 and 1.0 and │ │ │ +001907c0: 2065 7870 7265 7373 2074 6865 2072 6174 express the rat │ │ │ +001907d0: 696f 206f 6620 7468 6520 636f 6d70 7265 io of the compre │ │ │ +001907e0: 7373 6564 206d 6573 7361 6765 206c 656e ssed message len │ │ │ +001907f0: 6774 6820 6f76 6572 2075 6e63 6f6d 7072 gth over uncompr │ │ │ +00190800: 6573 7365 6420 6d65 7373 6167 6520 6c65 essed message le │ │ │ +00190810: 6e67 7468 2e3c 2f70 3e0a 3c64 6976 2063 ngth.

    .
    │ │ │ +00190830: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    if (soap_call │ │ │ +00190870: 5f6e 735f 5f6d 794d 6574 686f 6428 2661 _ns__myMethod(&a │ │ │ +00190880: 6d70 3b3c 6120 636c 6173 733d 2263 6f64 mp;soap, ...))
    . │ │ │ +001908c0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    {
    .
    .. │ │ │ +001908f0: 2e20 3c73 7061 6e20 636c 6173 733d 2263 . // error │ │ │ +00190910: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ +00190930: 7d3c 2f64 6976 3e0a 3c64 6976 2063 6c61 }
    .
    else< │ │ │ +00190970: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    {
    . │ │ │ +00190990: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    .
    ... │ │ │ +00190b40: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // success │ │ │ +00190b60: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ +00190b80: 7d3c 2f64 6976 3e0a 3c64 6976 2063 6c61 }
    .
    f │ │ │ +00190c50: 6c6f 6174 207a 5f72 6174 696f 5f69 6e3c loat z_ratio_in< │ │ │ +00190c60: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
    The comp │ │ │ +00190c80: 7265 7373 696f 6e20 7261 7469 6f20 3d20 ression ratio = │ │ │ +00190c90: 636f 6d70 7265 7373 6564 2e73 697a 652f compressed.size/ │ │ │ +00190ca0: 756e 636f 6d70 7265 7373 6564 2e73 697a uncompressed.siz │ │ │ +00190cb0: 6520 6f66 2074 6865 2063 6f6d 7072 6573 e of the compres │ │ │ +00190cc0: 7365 6420 6d65 7373 6167 6520 7265 6365 sed message rece │ │ │ +00190cd0: 6976 6564 2e3c 2f64 6976 3e3c 6469 7620 ived.
    Definition: │ │ │ +00190d00: 2073 7464 736f 6170 322e 683a 3337 3039 stdsoap2.h:3709 │ │ │ +00190d10: 3c2f 6469 763e 3c2f 6469 763e 0a3c 6469
    .
    float z_rat │ │ │ +00190df0: 696f 5f6f 7574 3c2f 6469 763e 3c64 6976 io_out
    T │ │ │ +00190e10: 6865 2063 6f6d 7072 6573 7369 6f6e 2072 he compression r │ │ │ +00190e20: 6174 696f 203d 2063 6f6d 7072 6573 7365 atio = compresse │ │ │ +00190e30: 642e 7369 7a65 2f75 6e63 6f6d 7072 6573 d.size/uncompres │ │ │ +00190e40: 7365 642e 7369 7a65 206f 6620 7468 6520 sed.size of the │ │ │ +00190e50: 636f 6d70 7265 7373 6564 206d 6573 7361 compressed messa │ │ │ +00190e60: 6765 2073 656e 742e 3c2f 6469 763e 3c64 ge sent.
    Definition:< │ │ │ +00190e90: 2f62 3e20 7374 6473 6f61 7032 2e68 3a33 /b> stdsoap2.h:3 │ │ │ +00190ea0: 3731 343c 2f64 6976 3e3c 2f64 6976 3e0a 714
    . │ │ │ +00190eb0: 3c2f 6469 763e 3c21 2d2d 2066 7261 676d

    Note: │ │ │ +00190ed0: 6c6f 7765 7220 7261 7469 6f73 206d 6561 lower ratios mea │ │ │ +00190ee0: 6e20 6869 6768 6572 2063 6f6d 7072 6573 n higher compres │ │ │ +00190ef0: 7369 6f6e 2072 6174 6573 2e3c 2f70 3e0a sion rates.

    . │ │ │ +00190f00: 3c70 3e43 6f6d 7072 6573 7365 6420 7472

    Compressed tr │ │ │ +00190f10: 616e 7366 6572 7320 7265 7175 6972 6520 ansfers require │ │ │ +00190f20: 6275 6666 6572 696e 6720 7468 6520 656e buffering the en │ │ │ +00190f30: 7469 7265 206f 7574 7075 7420 6d65 7373 tire output mess │ │ │ +00190f40: 6167 6520 746f 2064 6574 6572 6d69 6e65 age to determine │ │ │ +00190f50: 2048 5454 5020 6d65 7373 6167 6520 6c65 HTTP message le │ │ │ +00190f60: 6e67 7468 2e20 5468 6973 206d 6561 6e73 ngth. This means │ │ │ +00190f70: 2074 6861 7420 7468 6520 3c63 6f64 653e that the │ │ │ +00190f80: 2353 4f41 505f 494f 5f53 544f 5245 3c2f #SOAP_IO_STORE flag is au │ │ │ +00190fa0: 746f 6d61 7469 6361 6c6c 7920 7365 7420 tomatically set │ │ │ +00190fb0: 7768 656e 2074 6865 203c 636f 6465 3e23 when the # │ │ │ +00190fc0: 534f 4150 5f45 4e43 5f5a 4c49 423c 2f63 SOAP_ENC_ZLIB flag is set │ │ │ +00190fe0: 2074 6f20 7365 6e64 2063 6f6d 7072 6573 to send compres │ │ │ +00190ff0: 7365 6420 6d65 7373 6167 6573 2e20 5468 sed messages. Th │ │ │ +00191000: 6520 7573 6520 6f66 2048 5454 5020 6368 e use of HTTP ch │ │ │ +00191010: 756e 6b69 6e67 2073 6967 6e69 6669 6361 unking significa │ │ │ +00191020: 6e74 6c79 2072 6564 7563 6573 206d 656d ntly reduces mem │ │ │ +00191030: 6f72 7920 7573 6167 6520 616e 6420 6d61 ory usage and ma │ │ │ +00191040: 7920 7370 6565 6420 7570 2074 6865 2074 y speed up the t │ │ │ +00191050: 7261 6e73 6d69 7373 696f 6e20 6f66 2063 ransmission of c │ │ │ +00191060: 6f6d 7072 6573 7365 6420 534f 4150 2f58 ompressed SOAP/X │ │ │ +00191070: 4d4c 206d 6573 7361 6765 732e 2054 6869 ML messages. Thi │ │ │ +00191080: 7320 6973 2061 6363 6f6d 706c 6973 6865 s is accomplishe │ │ │ +00191090: 6420 6279 2073 6574 7469 6e67 2074 6865 d by setting the │ │ │ +001910a0: 203c 636f 6465 3e23 534f 4150 5f49 4f5f #SOAP_IO_ │ │ │ +001910b0: 4348 554e 4b3c 2f63 6f64 653e 2066 6c61 CHUNK fla │ │ │ +001910c0: 6720 7769 7468 203c 636f 6465 3e23 534f g with #SO │ │ │ +001910d0: 4150 5f45 4e43 5f5a 4c49 423c 2f63 6f64 AP_ENC_ZLIB for the outpu │ │ │ +001910f0: 7420 6d6f 6465 2e20 486f 7765 7665 722c t mode. However, │ │ │ +00191100: 2073 6f6d 6520 5765 6220 7365 7276 6572 some Web server │ │ │ +00191110: 7320 646f 206e 6f74 2061 6363 6570 7420 s do not accept │ │ │ +00191120: 4854 5450 2063 6875 6e6b 6564 2072 6571 HTTP chunked req │ │ │ +00191130: 7565 7374 206d 6573 7361 6765 7320 2865 uest messages (e │ │ │ +00191140: 7665 6e20 7768 656e 2074 6865 7920 7265 ven when they re │ │ │ +00191150: 7475 726e 2048 5454 5020 6368 756e 6b65 turn HTTP chunke │ │ │ +00191160: 6420 6d65 7373 6167 6573 2129 2e20 5374 d messages!). St │ │ │ +00191170: 616e 642d 616c 6f6e 6520 6753 4f41 5020 and-alone gSOAP │ │ │ +00191180: 7365 7276 6963 6573 2061 6c77 6179 7320 services always │ │ │ +00191190: 6163 6365 7074 2063 6875 6e6b 6564 2072 accept chunked r │ │ │ +001911a0: 6571 7565 7374 206d 6573 7361 6765 732e equest messages. │ │ │ +001911b0: 3c2f 703e 0a3c 703e 546f 2072 6573 7472

    .

    To restr │ │ │ +001911c0: 6963 7420 7468 6520 636f 6d70 7265 7373 ict the compress │ │ │ +001911d0: 696f 6e20 746f 2074 6865 2064 6566 6c61 ion to the defla │ │ │ +001911e0: 7465 2066 6f72 6d61 7420 6f6e 6c79 2c20 te format only, │ │ │ +001911f0: 636f 6d70 696c 6520 7468 6520 736f 7572 compile the sour │ │ │ +00191200: 6365 7320 7769 7468 2074 6865 2063 6f6d ces with the com │ │ │ +00191210: 7069 6c65 2d74 696d 6520 666c 6167 203c pile-time flag < │ │ │ +00191220: 636f 6465 3e23 5749 5448 5f5a 4c49 423c code>#WITH_ZLIB< │ │ │ +00191230: 2f63 6f64 653e 2e20 5468 6973 206c 696d /code>. This lim │ │ │ +00191240: 6974 7320 636f 6d70 7265 7373 696f 6e20 its compression │ │ │ +00191250: 616e 6420 6465 636f 6d70 7265 7373 696f and decompressio │ │ │ +00191260: 6e20 746f 2074 6865 2064 6566 6c61 7465 n to the deflate │ │ │ +00191270: 2066 6f72 6d61 742e 204f 6e6c 7920 706c format. Only pl │ │ │ +00191280: 6169 6e20 616e 6420 6465 666c 6174 6564 ain and deflated │ │ │ +00191290: 206d 6573 7361 6765 7320 6361 6e20 6265 messages can be │ │ │ +001912a0: 2065 7863 6861 6e67 6564 2c20 677a 6970 exchanged, gzip │ │ │ +001912b0: 2069 7320 6e6f 7420 7375 7070 6f72 7465 is not supporte │ │ │ +001912c0: 6420 7769 7468 2074 6869 7320 6f70 7469 d with this opti │ │ │ +001912d0: 6f6e 2e20 5265 6365 6976 696e 6720 677a on. Receiving gz │ │ │ +001912e0: 6970 2063 6f6d 7072 6573 7365 6420 636f ip compressed co │ │ │ +001912f0: 6e74 656e 7420 6973 2061 7574 6f6d 6174 ntent is automat │ │ │ +00191300: 6963 2c20 6576 656e 2069 6e20 7468 6520 ic, even in the │ │ │ +00191310: 6162 7365 6e63 6520 6f66 2048 5454 5020 absence of HTTP │ │ │ +00191320: 6865 6164 6572 732e 2052 6563 6569 7669 headers. Receivi │ │ │ +00191330: 6e67 2064 6566 6c61 7465 2063 6f6d 7072 ng deflate compr │ │ │ +00191340: 6573 7365 6420 636f 6e74 656e 7420 6973 essed content is │ │ │ +00191350: 206e 6f74 2061 7574 6f6d 6174 6963 2069 not automatic i │ │ │ +00191360: 6e20 7468 6520 6162 7365 6e63 6520 6f66 n the absence of │ │ │ +00191370: 2048 5454 5020 6865 6164 6572 7320 616e HTTP headers an │ │ │ +00191380: 6420 7265 7175 6972 6573 2074 6865 2066 d requires the f │ │ │ +00191390: 6c61 6720 3c63 6f64 653e 2353 4f41 505f lag #SOAP_ │ │ │ +001913a0: 454e 435f 5a4c 4942 3c2f 636f 6465 3e20 ENC_ZLIB │ │ │ +001913b0: 746f 2062 6520 7365 7420 666f 7220 7468 to be set for th │ │ │ +001913c0: 6520 696e 7075 7420 6d6f 6465 2074 6f20 e input mode to │ │ │ +001913d0: 6465 636f 6d70 7265 7373 2064 6566 6c61 decompress defla │ │ │ +001913e0: 7465 6420 6461 7461 2e3c 2f70 3e0a 3c64 ted data.

    .
    Wa │ │ │ +00191410: 726e 696e 673c 2f64 743e 3c64 643e 4974 rning
    It │ │ │ +00191420: 2069 7320 696d 706f 7274 616e 7420 7468 is important th │ │ │ +00191430: 6174 2074 6865 203c 636f 6465 3e23 5749 at the #WI │ │ │ +00191440: 5448 5f47 5a49 503c 2f63 6f64 653e 2061 TH_GZIP a │ │ │ +00191450: 6e64 203c 636f 6465 3e23 5749 5448 5f5a nd #WITH_Z │ │ │ +00191460: 4c49 423c 2f63 6f64 653e 206d 6163 726f LIB macro │ │ │ +00191470: 7320 6d75 7374 2062 6520 636f 6e73 6973 s must be consis │ │ │ +00191480: 7465 6e74 6c79 2064 6566 696e 6564 2074 tently defined t │ │ │ +00191490: 6f20 636f 6d70 696c 6520 7468 6520 736f o compile the so │ │ │ +001914a0: 7572 6365 732c 2073 7563 6820 6173 203c urces, such as < │ │ │ +001914b0: 656d 3e3c 636f 6465 3e67 736f 6170 2f73 em>gsoap/s │ │ │ +001914c0: 7464 736f 6170 322e 6370 703c 2f63 6f64 tdsoap2.cpp, soapC.cpp, soapClient.c │ │ │ +00191510: 7070 3c2f 636f 6465 3e3c 2f65 6d3e 2c20 pp, │ │ │ +00191520: 3c65 6d3e 3c63 6f64 653e 736f 6170 5365 soapSe │ │ │ +00191530: 7276 6572 2e63 7070 3c2f 636f 6465 3e3c rver.cpp< │ │ │ +00191540: 2f65 6d3e 2c20 616e 6420 616c 6c20 6170 /em>, and all ap │ │ │ +00191550: 706c 6963 6174 696f 6e20 736f 7572 6365 plication source │ │ │ +00191560: 7320 7468 6174 2069 6e63 6c75 6465 203c s that include < │ │ │ +00191570: 656d 3e3c 636f 6465 3e67 736f 6170 2f73 em>gsoap/s │ │ │ +00191580: 7464 736f 6170 322e 683c 2f63 6f64 653e tdsoap2.h │ │ │ +00191590: 3c2f 656d 3e20 6f72 203c 656d 3e3c 636f or soapH.h. If the m │ │ │ +001915c0: 6163 726f 7320 6172 6520 6e6f 7420 636f acros are not co │ │ │ +001915d0: 6e73 6973 7465 6e74 6c79 2075 7365 642c nsistently used, │ │ │ +001915e0: 2074 6865 2061 7070 6c69 6361 7469 6f6e the application │ │ │ +001915f0: 2077 696c 6c20 6372 6173 6820 6475 6520 will crash due │ │ │ +00191600: 746f 2061 206d 6973 6d61 7463 6865 7320 to a mismatches │ │ │ +00191610: 696e 2074 6865 2064 6563 6c61 7261 7469 in the declarati │ │ │ +00191620: 6f6e 2061 6e64 2061 6363 6573 7320 6f66 on and access of │ │ │ +00191630: 2074 6865 203c 636f 6465 3e3c 6120 636c the soap< │ │ │ +00191690: 2f63 6f64 653e 2063 6f6e 7465 7874 2e3c /code> context.< │ │ │ +001916a0: 2f64 643e 3c2f 646c 3e0a 3c70 3ef0 9f94 /dd>.

    ... │ │ │ +001916b0: 9d20 3c61 2068 7265 663d 2223 223e 4261 . Ba │ │ │ +001916c0: 636b 2074 6f20 7461 626c 6520 6f66 2063 ck to table of c │ │ │ +001916d0: 6f6e 7465 6e74 733c 2f61 3e3c 2f70 3e0a ontents

    . │ │ │ +001916e0: 3c68 323e 3c61 2063 6c61 7373 3d22 616e

    .Cli │ │ │ +00191710: 656e 742d 7369 6465 2063 6f6f 6b69 6520 ent-side cookie │ │ │ +00191720: 7375 7070 6f72 743c 2f68 323e 0a3c 703e support

    .

    │ │ │ +00191730: 436c 6965 6e74 2d73 6964 6520 636f 6f6b Client-side cook │ │ │ +00191740: 6965 2073 7570 706f 7274 2069 7320 6f70 ie support is op │ │ │ +00191750: 7469 6f6e 616c 2e20 546f 2065 6e61 626c tional. To enabl │ │ │ +00191760: 6520 636f 6f6b 6965 2073 7570 706f 7274 e cookie support │ │ │ +00191770: 2c20 636f 6d70 696c 6520 616c 6c20 736f , compile all so │ │ │ +00191780: 7572 6365 7320 7769 7468 2074 6865 2063 urces with the c │ │ │ +00191790: 6f6d 7069 6c65 2d74 696d 6520 666c 6167 ompile-time flag │ │ │ +001917a0: 203c 636f 6465 3e23 5749 5448 5f43 4f4f #WITH_COO │ │ │ +001917b0: 4b49 4553 3c2f 636f 6465 3e2c 2066 6f72 KIES, for │ │ │ +001917c0: 2065 7861 6d70 6c65 3a20 3c2f 703e 3c70 example:

    c++ -DWITH_ │ │ │ +001917f0: 434f 4f4b 4945 5320 2d6f 206d 7963 6c69 COOKIES -o mycli │ │ │ +00191800: 656e 7420 7374 6473 6f61 7032 2e63 7070 ent stdsoap2.cpp │ │ │ +00191810: 2073 6f61 7043 2e63 7070 2073 6f61 7043 soapC.cpp soapC │ │ │ +00191820: 6c69 656e 742e 6370 700a 3c2f 7072 653e lient.cpp. │ │ │ +00191830: 3c70 3e20 6f72 2061 6464 2074 6865 2066

    or add the f │ │ │ +00191840: 6f6c 6c6f 7769 6e67 206c 696e 6520 746f ollowing line to │ │ │ +00191850: 203c 656d 3e3c 636f 6465 3e73 7464 736f stdso │ │ │ +00191860: 6170 2e68 3c2f 636f 6465 3e3c 2f65 6d3e ap.h │ │ │ +00191870: 3a3c 2f70 3e0a 3c64 6976 2063 6c61 7373 :

    .
    #define │ │ │ +001918c0: 2057 4954 485f 434f 4f4b 4945 533c 2f73 WITH_COOKIES
    .

    The cookie │ │ │ +00192100: 2073 746f 7265 2069 7320 6120 6c69 6e6b store is a link │ │ │ +00192110: 6564 206c 6973 7420 6f66 203c 636f 6465 ed list of soap_coo │ │ │ +00192170: 6b69 653c 2f61 3e3c 2f63 6f64 653e 2073 kie s │ │ │ +00192180: 7472 7563 7475 7265 7320 706f 696e 7465 tructures pointe │ │ │ +00192190: 6420 746f 2062 7920 3c63 6f64 653e 3c61 d to by soap: │ │ │ +00192220: 3a63 6f6f 6b69 6573 3c2f 613e 3c2f 636f :cookies.

    .

    Sinc │ │ │ +00192240: 6520 7468 6520 636f 6f6b 6965 2073 746f e the cookie sto │ │ │ +00192250: 7265 2069 7320 6c69 6e6b 6564 2074 6f20 re is linked to │ │ │ +00192260: 7468 6520 6375 7272 656e 7420 3c63 6f64 the current so │ │ │ +001922c0: 6170 3c2f 613e 3c2f 636f 6465 3e20 636f ap co │ │ │ +001922d0: 6e74 6578 742c 2061 6e64 2065 6163 6820 ntext, and each │ │ │ +001922e0: 7468 7265 6164 206d 7573 7420 7573 6520 thread must use │ │ │ +001922f0: 6974 7320 6f77 6e20 636f 6e74 6578 742c its own context, │ │ │ +00192300: 2065 6163 6820 7468 7265 6164 2061 6c73 each thread als │ │ │ +00192310: 6f20 6861 7320 6974 7320 6f77 6e20 636f o has its own co │ │ │ +00192320: 6f6b 6965 2073 746f 7265 2e3c 2f70 3e0a okie store.

    . │ │ │ +00192330: 3c70 3ef0 9f94 9d20 3c61 2068 7265 663d

    .... Back to tabl │ │ │ +00192350: 6520 6f66 2063 6f6e 7465 6e74 733c 2f61 e of contents

    .

    .Server-side c │ │ │ +001923a0: 6f6f 6b69 6520 7375 7070 6f72 743c 2f68 ookie support.

    This featu │ │ │ +001923c0: 7265 2069 7320 6e6f 7420 7265 636f 6d6d re is not recomm │ │ │ +001923d0: 656e 6465 6420 746f 2069 6d70 6c65 6d65 ended to impleme │ │ │ +001923e0: 6e74 2073 7461 7465 2069 6e20 7374 616e nt state in stan │ │ │ +001923f0: 642d 616c 6f6e 6520 7365 7276 6572 732e d-alone servers. │ │ │ +00192400: 2043 6f6f 6b69 6573 206d 6179 2072 6571 Cookies may req │ │ │ +00192410: 7569 7265 2061 2066 6169 7220 616d 6f75 uire a fair amou │ │ │ +00192420: 6e74 206f 6620 7072 6f63 6573 7369 6e67 nt of processing │ │ │ +00192430: 206f 7665 7268 6561 6420 616e 6420 6172 overhead and ar │ │ │ +00192440: 6520 6e6f 7420 696e 2066 6163 7420 6e65 e not in fact ne │ │ │ +00192450: 6564 6564 2074 6f20 696d 706c 656d 656e eded to implemen │ │ │ +00192460: 7420 7374 6174 6566 756c 2073 6572 7669 t stateful servi │ │ │ +00192470: 6365 732c 2077 6869 6368 2069 7320 7479 ces, which is ty │ │ │ +00192480: 7069 6361 6c6c 7920 7065 7266 6f72 6d65 pically performe │ │ │ +00192490: 6420 7769 7468 2073 6573 7369 6f6e 2049 d with session I │ │ │ +001924a0: 4473 2069 6e20 584d 4c2f 4a53 4f4e 206d Ds in XML/JSON m │ │ │ +001924b0: 6573 7361 6765 7320 6f72 2062 7920 7061 essages or by pa │ │ │ +001924c0: 7373 696e 6720 7468 6520 7365 7373 696f ssing the sessio │ │ │ +001924d0: 6e20 4944 7320 7669 6120 7468 6520 5552 n IDs via the UR │ │ │ +001924e0: 4c2e 3c2f 703e 0a3c 703e 5365 7276 6572 L.

    .

    Server │ │ │ +001924f0: 2d73 6964 6520 636f 6f6b 6965 2073 7570 -side cookie sup │ │ │ +00192500: 706f 7274 2069 7320 6f70 7469 6f6e 616c port is optional │ │ │ +00192510: 2e20 546f 2065 6e61 626c 6520 636f 6f6b . To enable cook │ │ │ +00192520: 6965 2073 7570 706f 7274 2c20 636f 6d70 ie support, comp │ │ │ +00192530: 696c 6520 616c 6c20 736f 7572 6365 7320 ile all sources │ │ │ +00192540: 7769 7468 2063 6f6d 7069 6c65 2d74 696d with compile-tim │ │ │ +00192550: 6520 666c 6167 203c 636f 6465 3e23 5749 e flag #WI │ │ │ +00192560: 5448 5f43 4f4f 4b49 4553 3c2f 636f 6465 TH_COOKIES:

     c+
    │ │ │ +00192590: 2b20 2d44 5749 5448 5f43 4f4f 4b49 4553  + -DWITH_COOKIES
    │ │ │ +001925a0: 202d 6f20 6d79 7365 7276 6572 202e 2e2e   -o myserver ...
    │ │ │ +001925b0: 0a3c 2f70 7265 3e3c 703e 2053 6565 2041  .

    See A │ │ │ +001925c0: 5049 2064 6f63 756d 656e 7461 7469 6f6e PI documentation │ │ │ +001925d0: 204d 6f64 756c 6520 3c61 2063 6c61 7373 Module HTTP coo │ │ │ +00192610: 6b69 6520 6675 6e63 7469 6f6e 733c 2f61 kie functions for the cookie │ │ │ +00192630: 2041 5049 2066 756e 6374 696f 6e73 2e20 API functions. │ │ │ +00192640: 5365 6520 7468 6520 3c61 2068 7265 663d See the HTTP sessions p │ │ │ +00192680: 6c75 6769 6e3c 2f61 3e20 666f 7220 4854 lugin for HT │ │ │ +00192690: 5450 2073 6573 7369 6f6e 206d 616e 6167 TP session manag │ │ │ +001926a0: 656d 656e 7420 7769 7468 2063 6f6f 6b69 ement with cooki │ │ │ +001926b0: 6573 2074 6861 7420 6973 2072 6571 7569 es that is requi │ │ │ +001926c0: 7265 6420 666f 7220 7365 7276 6572 2d73 red for server-s │ │ │ +001926d0: 6964 6520 7365 7373 696f 6e20 636f 6e74 ide session cont │ │ │ +001926e0: 726f 6c2e 2054 6865 203c 636f 6465 3e23 rol. The # │ │ │ +001926f0: 5749 5448 5f43 4f4f 4b49 4553 3c2f 636f WITH_COOKIES flag is usel │ │ │ +00192710: 6573 7320 7769 7468 6f75 7420 7365 7276 ess without serv │ │ │ +00192720: 6572 2d73 6964 6520 7365 7373 696f 6e20 er-side session │ │ │ +00192730: 6d61 6e61 6765 6d65 6e74 2061 6e64 2063 management and c │ │ │ +00192740: 6f6e 7472 6f6c 2e3c 2f70 3e0a 3c70 3e48 ontrol.

    .

    H │ │ │ +00192750: 6572 6520 6973 2061 6e20 6f76 6572 7669 ere is an overvi │ │ │ +00192760: 6577 206f 6620 7468 6520 636f 6f6b 6965 ew of the cookie │ │ │ +00192770: 2041 5049 2066 756e 6374 696f 6e73 3a3c API functions:< │ │ │ +00192780: 2f70 3e0a 3c75 6c3e 0a3c 6c69 3e3c 636f /p>.

    .
    soap.cookie_pat │ │ │ +00195b30: 683c 2f61 3e20 3d20 3c73 7061 6e20 636c h = "/" │ │ │ +00195b60: 3b3c 2f73 7061 6e3e 3b20 3c73 7061 6e20 ;; │ │ │ +00195b80: 2f2f 2074 6865 2070 6174 6820 7768 6963 // the path whic │ │ │ +00195b90: 6820 6973 2075 7365 6420 746f 2066 696c h is used to fil │ │ │ +00195ba0: 7465 722f 7365 7420 636f 6f6b 6965 7320 ter/set cookies │ │ │ +00195bb0: 7769 7468 2074 6869 7320 6465 7374 696e with this destin │ │ │ +00195bc0: 6174 696f 6e20 3c2f 7370 616e 3e3c 2f64 ation .
    if (arg │ │ │ +00195c10: 6320 266c 743b 2032 2920 3c2f 6469 763e c < 2)
    │ │ │ +00195c20: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    {
    . │ │ │ +00195c50: 2020 203c 6120 636c 6173 733d 2263 6f64 soap_get │ │ │ +00195cb0: 656e 765f 636f 6f6b 6965 733c 2f61 3e28 env_cookies( │ │ │ +00195cc0: 2661 6d70 3b3c 6120 636c 6173 733d 2263 &soap │ │ │ +00195cf0: 3c2f 613e 293b 203c 7370 616e 2063 6c61 ); // │ │ │ +00195d10: 4347 4920 6170 703a 2067 7261 6220 636f CGI app: grab co │ │ │ +00195d20: 6f6b 6965 7320 6672 6f6d 2026 2333 393b okies from ' │ │ │ +00195d30: 4854 5450 5f43 4f4f 4b49 4526 2333 393b HTTP_COOKIE' │ │ │ +00195d40: 2065 6e76 2076 6172 203c 2f73 7061 6e3e env var │ │ │ +00195d50: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    soa │ │ │ +00195dc0: 705f 7365 7276 653c 2f61 3e28 2661 6d70 p_serve(& │ │ │ +00195dd0: 3b3c 6120 636c 6173 733d 2263 6f64 6522 ;soap │ │ │ +00195e00: 293b 203c 2f64 6976 3e0a 3c64 6976 2063 );
    .
    } │ │ │ +00195e20: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    else │ │ │ +00195e60: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    {.
    m = so │ │ │ +00195ef0: 6170 5f62 696e 643c 2f61 3e28 2661 6d70 ap_bind(& │ │ │ +00195f00: 3b3c 6120 636c 6173 733d 2263 6f64 6522 ;soap │ │ │ +00195f30: 2c20 4e55 4c4c 2c20 6174 6f69 2861 7267 , NULL, atoi(arg │ │ │ +00195f40: 765b 315d 292c 2031 3029 3b20 3c73 7061 v[1]), 10); // small BACKL │ │ │ +00195f70: 4f47 2066 6f72 2069 7465 7261 7469 7665 OG for iterative │ │ │ +00195f80: 2073 6572 7665 7273 3c2f 7370 616e 3e3c servers< │ │ │ +00195f90: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    if │ │ │ +00195fd0: 2821 3c61 2063 6c61 7373 3d22 636f 6465 (!soap_valid_s │ │ │ +00196030: 6f63 6b65 743c 2f61 3e28 6d29 2920 3c2f ocket(m)) .
    exi │ │ │ +00196060: 7428 4558 4954 5f46 4149 4c55 5245 293b t(EXIT_FAILURE); │ │ │ +00196070: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    for (in │ │ │ +001960d0: 743c 2f73 7061 6e3e 2069 203d 2031 3b20 t i = 1; │ │ │ +001960e0: 3b20 692b 2b29 203c 2f64 6976 3e0a 3c64 ; i++)
    . │ │ │ +00196100: 2020 2020 7b3c 2f64 6976 3e0a 3c64 6976 {
    .
    │ │ │ +00196120: 2020 2020 7320 3d20 3c61 2063 6c61 7373 s = soap_acc │ │ │ +00196180: 6570 743c 2f61 3e28 2661 6d70 3b3c 6120 ept(&soap); < │ │ │ +001961c0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    if (!soap_valid │ │ │ +00196260: 5f73 6f63 6b65 743c 2f61 3e28 7329 2920 _socket(s)) │ │ │ +00196270: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    │ │ │ +00196290: 2065 7869 7428 4558 4954 5f46 4149 4c55 exit(EXIT_FAILU │ │ │ +001962a0: 5245 293b 203c 2f64 6976 3e0a 3c64 6976 RE);
    .
    │ │ │ +001962c0: 2020 2020 3c61 2063 6c61 7373 3d22 636f soap_serve(&s │ │ │ +00196350: 6f61 703c 2f61 3e29 3b20 3c2f 6469 763e oap);
    │ │ │ +00196360: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    so │ │ │ +001963d0: 6170 5f65 6e64 3c2f 613e 2826 616d 703b ap_end(& │ │ │ +001963e0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap) │ │ │ +00196410: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
    .
    │ │ │ +00196430: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap_free_c │ │ │ +00196490: 6f6f 6b69 6573 3c2f 613e 2826 616d 703b ookies(& │ │ │ +001964a0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap) │ │ │ +001964d0: 3b20 3c73 7061 6e20 636c 6173 733d 2263 ; // remov │ │ │ +001964f0: 6520 616c 6c20 6f6c 6420 636f 6f6b 6965 e all old cookie │ │ │ +00196500: 7320 6672 6f6d 2064 6174 6162 6173 6520 s from database │ │ │ +00196510: 736f 206e 6f20 696e 7465 7266 6572 656e so no interferen │ │ │ +00196520: 6365 206f 6363 7572 7320 7769 7468 2074 ce occurs with t │ │ │ +00196530: 6865 2061 7272 6976 616c 206f 6620 6e65 he arrival of ne │ │ │ +00196540: 7720 636f 6f6b 6965 7320 3c2f 7370 616e w cookies
    .
    } │ │ │ +00196570: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    } .
    return │ │ │ +001965d0: 303b 203c 2f64 6976 3e0a 3c64 6976 2063 0;
    .
    } .
    .< │ │ │ +00196610: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ +00196620: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >int ns__webmet │ │ │ +00196650: 686f 6428 3c73 7061 6e20 636c 6173 733d hod(struct │ │ │ +00196670: 3c2f 7370 616e 3e20 3c61 2063 6c61 7373 s │ │ │ +001966a0: 6f61 703c 2f61 3e20 2a3c 6120 636c 6173 oap * │ │ │ +001966d0: 736f 6170 3c2f 613e 2c20 2e2e 2e29 203c soap, ...) < │ │ │ +001966e0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    {
    . │ │ │ +00196700: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    const< │ │ │ +00196730: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> char *co │ │ │ +00196760: 6f6b 6965 5f76 616c 7565 203d 203c 6120 okie_value = soap_cookie_va │ │ │ +001967d0: 6c75 653c 2f61 3e28 3c61 2063 6c61 7373 lue(s │ │ │ +00196800: 6f61 703c 2f61 3e2c 203c 7370 616e 2063 oap, "cooki │ │ │ +00196830: 655f 6e61 6d65 2671 756f 743b 3c2f 7370 e_name", NULL, NULL) │ │ │ +00196850: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
    .
    if │ │ │ +00196890: 2821 636f 6f6b 6965 5f76 616c 7565 2920 (!cookie_value) │ │ │ +001968a0: 2020 2020 2020 2020 2020 2020 2020 203c < │ │ │ +001968b0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ +001968c0: 656e 7422 3e2f 2f20 636f 6f6b 6965 2072 ent">// cookie r │ │ │ +001968d0: 6574 7572 6e65 6420 6279 2063 6c69 656e eturned by clien │ │ │ +001968e0: 743f 203c 2f73 7061 6e3e 3c2f 6469 763e t?
    │ │ │ +001968f0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    cookie_va │ │ │ +00196910: 6c75 6520 3d20 3c73 7061 6e20 636c 6173 lue = "initial_ │ │ │ +00196940: 7661 6c75 6526 7175 6f74 3b3c 2f73 7061 value"; // no: │ │ │ +00196970: 2073 6574 2069 6e69 7469 616c 2063 6f6f set initial coo │ │ │ +00196980: 6b69 6520 7661 6c75 6520 3c2f 7370 616e kie value
    .
    else
    .
    . │ │ │ +001969f0: 2e2e 2020 2020 2020 2020 2020 2020 2020 .. │ │ │ +00196a00: 2020 2020 2020 2020 2020 2020 2020 203c < │ │ │ +00196a10: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ +00196a20: 656e 7422 3e2f 2f20 7965 733a 206d 6f64 ent">// yes: mod │ │ │ +00196a30: 6966 7920 7468 6520 636f 6f6b 6965 2076 ify the cookie v │ │ │ +00196a40: 616c 7565 2074 6f20 7265 666c 6563 7420 alue to reflect │ │ │ +00196a50: 7468 6520 6e65 7720 7374 6174 653c 2f73 the new state
    .
    < │ │ │ +00196a80: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ +00196a90: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ +00196aa0: 705f 5f63 6f6f 6b69 6573 2e68 746d 6c23 p__cookies.html# │ │ │ +00196ab0: 6761 3764 3562 3035 3838 6561 3736 3365 ga7d5b0588ea763e │ │ │ +00196ac0: 3531 3137 3732 6630 6363 3234 3938 6533 511772f0cc2498e3 │ │ │ +00196ad0: 3232 223e 736f 6170 5f73 6574 5f63 6f6f 22">soap_set_coo │ │ │ +00196ae0: 6b69 653c 2f61 3e28 3c61 2063 6c61 7373 kie(s │ │ │ +00196b10: 6f61 703c 2f61 3e2c 203c 7370 616e 2063 oap, "cooki │ │ │ +00196b40: 655f 6e61 6d65 2671 756f 743b 3c2f 7370 e_name", cookie_valu │ │ │ +00196b60: 652c 204e 554c 4c2c 204e 554c 4c29 3b20 e, NULL, NULL); │ │ │ +00196b70: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    │ │ │ +00196be0: 736f 6170 5f73 6574 5f63 6f6f 6b69 655f soap_set_cookie_ │ │ │ +00196bf0: 6578 7069 7265 3c2f 613e 283c 6120 636c expire(soap, "co │ │ │ +00196c50: 6f6b 6965 5f6e 616d 6526 7175 6f74 3b3c okie_name"< │ │ │ +00196c60: 2f73 7061 6e3e 2c20 3630 2c20 4e55 4c4c /span>, 60, NULL │ │ │ +00196c70: 2c20 4e55 4c4c 293b 203c 7370 616e 2063 , NULL); / │ │ │ +00196c90: 2f20 636f 6f6b 6965 2065 7870 6972 6573 / cookie expires │ │ │ +00196ca0: 2069 6e20 3630 2073 6563 6f6e 6473 203c in 60 seconds < │ │ │ +00196cb0: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    . │ │ │ +00196cd0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 retur │ │ │ +00196cf0: 6e3c 2f73 7061 6e3e 203c 6120 636c 6173 n SOA │ │ │ +00196d50: 505f 4f4b 3c2f 613e 3b20 3c2f 6469 763e P_OK;
    │ │ │ +00196d60: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    }
    .
    │ │ │ +00196dd0: 3c64 6976 2063 6c61 7373 3d22 7474 6e61
    const │ │ │ +00196e60: 2063 6861 7220 2a20 736f 6170 5f63 6f6f char * soap_coo │ │ │ +00196e70: 6b69 655f 7661 6c75 6528 7374 7275 6374 kie_value(struct │ │ │ +00196e80: 2073 6f61 7020 2a73 6f61 702c 2063 6f6e soap *soap, con │ │ │ +00196e90: 7374 2063 6861 7220 2a6e 616d 652c 2063 st char *name, c │ │ │ +00196ea0: 6f6e 7374 2063 6861 7220 2a64 6f6d 6169 onst char *domai │ │ │ +00196eb0: 6e2c 2063 6f6e 7374 2063 6861 7220 2a70 n, const char *p │ │ │ +00196ec0: 6174 6829 3c2f 6469 763e 3c64 6976 2063 ath)
    Get │ │ │ +00196ee0: 2063 6f6f 6b69 6520 7661 6c75 652e 3c2f cookie value.
    .
    │ │ │ +00196f50: 3c64 6976 2063 6c61 7373 3d22 7474 6e61
    soap │ │ │ +00196fb0: 5f73 6574 5f63 6f6f 6b69 653c 2f61 3e3c _set_cookie< │ │ │ +00196fc0: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
    struct │ │ │ +00196fe0: 736f 6170 5f63 6f6f 6b69 6520 2a20 736f soap_cookie * so │ │ │ +00196ff0: 6170 5f73 6574 5f63 6f6f 6b69 6528 7374 ap_set_cookie(st │ │ │ +00197000: 7275 6374 2073 6f61 7020 2a73 6f61 702c ruct soap *soap, │ │ │ +00197010: 2063 6f6e 7374 2063 6861 7220 2a6e 616d const char *nam │ │ │ +00197020: 652c 2063 6f6e 7374 2063 6861 7220 2a76 e, const char *v │ │ │ +00197030: 616c 7565 2c20 636f 6e73 7420 6368 6172 alue, const char │ │ │ +00197040: 202a 646f 6d61 696e 2c20 636f 6e73 7420 *domain, const │ │ │ +00197050: 6368 6172 202a 7061 7468 293c 2f64 6976 char *path)
    Add a cookie │ │ │ +00197080: 2e3c 2f64 6976 3e3c 2f64 6976 3e0a 3c64 .
    .
    │ │ │ +00197170: 696e 7420 736f 6170 5f67 6574 656e 765f int soap_getenv_ │ │ │ +00197180: 636f 6f6b 6965 7328 7374 7275 6374 2073 cookies(struct s │ │ │ +00197190: 6f61 7020 2a73 6f61 7029 3c2f 6469 763e oap *soap)
    │ │ │ +001971a0: 3c64 6976 2063 6c61 7373 3d22 7474 646f
    Get cookies f │ │ │ +001971c0: 726f 6d20 7468 6520 4854 5450 5f43 4f4f rom the HTTP_COO │ │ │ +001971d0: 4b49 4520 656e 7669 726f 6e6d 656e 7420 KIE environment │ │ │ +001971e0: 7661 7269 6162 6c65 2e3c 2f64 6976 3e3c variable.
    < │ │ │ +001971f0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.