--- /srv/reproducible-results/rbuild-debian/r-b-build.wOCnGPgG/b1/gsoap_2.8.104-3_amd64.changes +++ /srv/reproducible-results/rbuild-debian/r-b-build.wOCnGPgG/b2/gsoap_2.8.104-3_amd64.changes ├── Files │ @@ -1,7 +1,7 @@ │ │ 7ceb18b9438c958b0ec4730f9bd18d25 6280996 debug optional gsoap-dbgsym_2.8.104-3_amd64.deb │ - 323ab2e51972877d1a9428035a8360db 12593192 doc optional gsoap-doc_2.8.104-3_all.deb │ + 37fd14865ec89c6f6c1ee814a5ed1f5b 12593252 doc optional gsoap-doc_2.8.104-3_all.deb │ 4620210cc927e4603d5505209278052b 1480532 devel optional gsoap_2.8.104-3_amd64.deb │ 0684d113c326584f3d6db61342292116 1626352 debug optional libgsoap-2.8.104-dbgsym_2.8.104-3_amd64.deb │ 37e97ebba2ee4174ea1b1b1444c61a7f 283524 libs optional libgsoap-2.8.104_2.8.104-3_amd64.deb │ b6cf67a1787cdf02eaa11f2dbf928858 290536 libdevel optional libgsoap-dev_2.8.104-3_amd64.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 12546024 2021-03-08 13:06:23.000000 data.tar.xz │ │ +-rw-r--r-- 0 0 0 46980 2021-03-08 13:06:23.000000 control.tar.xz │ │ +-rw-r--r-- 0 0 0 12546080 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) 1834605 2021-03-08 13:06:23.000000 ./usr/share/doc/gsoap-doc/guide/html/index.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 1834598 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,27 +56951,27 @@ │ │ │ │ 000de760: 6c69 7374 3c2f 7370 616e 3e20 3c73 7061 list id="1& │ │ │ │ 000de7b0: 7175 6f74 3b3c 2f73 7061 6e3e 3c73 7061 quot;.......
....|U.....U
.
....|U< │ │ │ │ +000de850: 6c69 7465 7261 6c22 3eb0 c08b f7f3 553c literal">.....U< │ │ │ │ 000de860: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
.< │ │ │ │ 000de880: 7370 616e 2063 6c61 7373 3d22 7374 7269 span class="stri │ │ │ │ -000de890: 6e67 6c69 7465 7261 6c22 3e80 e019 fc7c ngliteral">....| │ │ │ │ +000de890: 6e67 6c69 7465 7261 6c22 3eb0 c08b f7f3 ngliteral">..... │ │ │ │ 000de8a0: 553c 2f73 7061 6e3e 3c2f 6469 763e 0a3c U.< │ │ │ │ 000de8b0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ 000de8c0: 3e3c 7370 616e 2063 6c61 7373 3d22 7374 > │ │ │ │ 000de8e0: 2026 6c74 3b6e 6578 7420 6872 6566 3d26 <next href=& │ │ │ │ 000de8f0: 7175 6f74 3b3c 2f73 7061 6e3e 2331 2671 quot;#1&q │ │ │ │ 000de900: 756f 743b 2f26 6774 3b20 3c2f 6469 763e uot;/> │ │ │ │ @@ -57253,57411 +57253,57411 @@ │ │ │ │ 000dfa40: 763e 0a3c 6469 7620 636c 6173 733d 226c v>.
<q ref=< │ │ │ │ 000dfaa0: 7370 616e 2063 6c61 7373 3d22 7374 7269 span class="stri │ │ │ │ -000dfab0: 6e67 6c69 7465 7261 6c22 3ec0 2726 2378 ngliteral">.'&#x │ │ │ │ -000dfac0: 3234 3139 3bfc 0055 3c2f 7370 616e 3e3c 2419;..U< │ │ │ │ -000dfad0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
<r id=& │ │ │ │ -000dfb10: 7175 6f74 3b3c 2f73 7061 6e3e 313c 7370 quot;1" │ │ │ │ -000dfb40: 7873 693a 6e69 6c3d 2671 756f 743b 3c2f xsi:nil="true< │ │ │ │ -000dfb70: 2f73 7061 6e3e 2671 756f 743b 2f26 6774 /span>"/> │ │ │ │ -000dfb80: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
.
</< │ │ │ │ -000dfba0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -000dfbb0: 6f72 6474 7970 6522 3e58 3c2f 7370 616e ordtype">X>
.

The │ │ │ │ -000dfbf0: 2064 6573 6572 6961 6c69 7a65 7220 7265 deserializer re │ │ │ │ -000dfc00: 636f 6e73 7472 7563 7473 2074 6865 2073 constructs the s │ │ │ │ -000dfc10: 7472 7563 7420 3c63 6f64 653e 583c 2f63 truct X from this f │ │ │ │ -000dfc30: 6f72 6d20 6f66 2058 4d4c 2c20 7468 6572 orm of XML, ther │ │ │ │ -000dfc40: 6562 7920 7072 6573 6572 7669 6e67 2074 eby preserving t │ │ │ │ -000dfc50: 6865 2069 6e74 6567 7269 7479 206f 6620 he integrity of │ │ │ │ -000dfc60: 7468 6520 6461 7461 2073 7472 7563 7475 the data structu │ │ │ │ -000dfc70: 7265 2073 6572 6961 6c69 7a65 642e 3c2f re serialized..

When the d │ │ │ │ -000dfc90: 6573 6572 6961 6c69 7a65 7220 656e 636f eserializer enco │ │ │ │ -000dfca0: 756e 7465 7273 2061 6e20 584d 4c20 656c unters an XML el │ │ │ │ -000dfcb0: 656d 656e 7420 7468 6174 2068 6173 2061 ement that has a │ │ │ │ -000dfcc0: 203c 656d 3e3c 636f 6465 3e78 7369 3a6e xsi:n │ │ │ │ -000dfcd0: 696c 3d22 7472 7565 223c 2f63 6f64 653e il="true" │ │ │ │ -000dfce0: 3c2f 656d 3e20 6174 7472 6962 7574 6520 attribute │ │ │ │ -000dfcf0: 6275 7420 7468 6520 636f 7272 6573 706f but the correspo │ │ │ │ -000dfd00: 6e64 696e 6720 432f 432b 2b20 6461 7461 nding C/C++ data │ │ │ │ -000dfd10: 2069 7320 6e6f 7420 6120 706f 696e 7465 is not a pointe │ │ │ │ -000dfd20: 7220 6f72 2072 6566 6572 656e 6365 2c20 r or reference, │ │ │ │ -000dfd30: 7468 6520 6465 7365 7269 616c 697a 6572 the deserializer │ │ │ │ -000dfd40: 2077 696c 6c20 7465 726d 696e 6174 6520 will terminate │ │ │ │ -000dfd50: 7769 7468 2061 203c 636f 6465 3e23 534f with a #SO │ │ │ │ -000dfd60: 4150 5f4e 554c 4c3c 2f63 6f64 653e 2066 AP_NULL f │ │ │ │ -000dfd70: 6175 6c74 2077 6865 6e20 7468 6520 3c63 ault when the #SOAP_XML_ST │ │ │ │ -000dfd90: 5249 4354 3c2f 636f 6465 3e20 666c 6167 RICT flag │ │ │ │ -000dfda0: 2069 7320 7365 742e 3c2f 703e 0a3c 703e is set.

.

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

.Void poi │ │ │ │ -000dfe10: 6e74 6572 2073 6572 6961 6c69 7a61 7469 nter serializati │ │ │ │ -000dfe20: 6f6e 3c2f 6832 3e0a 3c70 3e56 6f69 6420 on

.

Void │ │ │ │ -000dfe30: 706f 696e 7465 7273 2028 3c63 6f64 653e pointers ( │ │ │ │ -000dfe40: 766f 6964 2a3c 2f63 6f64 653e 2920 6361 void*) ca │ │ │ │ -000dfe50: 6e6e 6f74 2062 6520 7365 7269 616c 697a nnot be serializ │ │ │ │ -000dfe60: 6564 2069 6e20 584d 4c20 6265 6361 7573 ed in XML becaus │ │ │ │ -000dfe70: 6520 7468 6520 7479 7065 206f 6620 6461 e the type of da │ │ │ │ -000dfe80: 7461 2072 6566 6572 7265 6420 746f 2069 ta referred to i │ │ │ │ -000dfe90: 7320 756e 7479 7065 642e 2054 6f20 656e s untyped. To en │ │ │ │ -000dfea0: 6162 6c65 2074 6865 2073 6572 6961 6c69 able the seriali │ │ │ │ -000dfeb0: 7a61 7469 6f6e 206f 6620 766f 6964 2070 zation of void p │ │ │ │ -000dfec0: 6f69 6e74 6572 7320 7468 6174 2061 7265 ointers that are │ │ │ │ -000dfed0: 206d 656d 6265 7273 206f 6620 7374 7275 members of stru │ │ │ │ -000dfee0: 6374 7320 616e 6420 636c 6173 7365 732c cts and classes, │ │ │ │ -000dfef0: 2079 6f75 2063 616e 2069 6e73 6572 7420 you can insert │ │ │ │ -000dff00: 6120 3c63 6f64 653e 696e 7420 5f5f 7479 a int __ty │ │ │ │ -000dff10: 7065 3c2f 636f 6465 3e20 6d65 6d62 6572 pe member │ │ │ │ -000dff20: 2072 6967 6874 2062 6566 6f72 6520 7468 right before th │ │ │ │ -000dff30: 6520 766f 6964 2070 6f69 6e74 6572 206d e void pointer m │ │ │ │ -000dff40: 656d 6265 722e 2054 6865 203c 636f 6465 ember. The int __type member contai │ │ │ │ -000dff70: 6e73 2072 756e 2074 696d 6520 696e 666f ns run time info │ │ │ │ -000dff80: 726d 6174 696f 6e20 6f6e 2074 6865 2074 rmation on the t │ │ │ │ -000dff90: 7970 6520 6f66 2074 6865 2064 6174 6120 ype of the data │ │ │ │ -000dffa0: 706f 696e 7465 6420 746f 2062 7920 3c63 pointed to by void* │ │ │ │ -000dffc0: 206d 656d 6265 7220 696e 2061 2073 7472 member in a str │ │ │ │ -000dffd0: 7563 742f 636c 6173 7320 746f 2065 6e61 uct/class to ena │ │ │ │ -000dffe0: 626c 6520 7468 6520 7365 7269 616c 697a ble the serializ │ │ │ │ -000dfff0: 6174 696f 6e20 6f66 2074 6869 7320 6461 ation of this da │ │ │ │ -000e0000: 7461 2e20 5468 6520 3c63 6f64 653e 696e ta. The in │ │ │ │ -000e0010: 7420 5f5f 7479 7065 3c2f 636f 6465 3e20 t __type │ │ │ │ -000e0020: 6d65 6d62 6572 2069 7320 7365 7420 746f member is set to │ │ │ │ -000e0030: 2061 203c 636f 6465 3e53 4f41 505f 5459 a SOAP_TY │ │ │ │ -000e0040: 5045 5f54 3c2f 636f 6465 3e20 7661 6c75 PE_T valu │ │ │ │ -000e0050: 652c 2077 6865 7265 203c 636f 6465 3e54 e, where T │ │ │ │ -000e0060: 3c2f 636f 6465 3e20 6973 2074 6865 206e is the n │ │ │ │ -000e0070: 616d 6520 6f66 2061 2074 7970 652e 2054 ame of a type. T │ │ │ │ -000e0080: 6865 2073 6f61 7063 7070 3220 746f 6f6c he soapcpp2 tool │ │ │ │ -000e0090: 2067 656e 6572 6174 6573 2074 6865 203c generates the < │ │ │ │ -000e00a0: 636f 6465 3e53 4f41 505f 5459 5045 5f54 code>SOAP_TYPE_T │ │ │ │ -000e00b0: 3c2f 636f 6465 3e20 6465 6669 6e69 7469 definiti │ │ │ │ -000e00c0: 6f6e 7320 696e 203c 656d 3e3c 636f 6465 ons in soapH.h< │ │ │ │ -000e00e0: 2f65 6d3e 2061 6e64 2075 7365 7320 7468 /em> and uses th │ │ │ │ -000e00f0: 656d 2069 6e74 6572 6e61 6c6c 7920 746f em internally to │ │ │ │ -000e0100: 2075 6e69 7175 656c 7920 6964 656e 7469 uniquely identi │ │ │ │ -000e0110: 6679 2074 6865 2074 7970 6520 6f66 2065 fy the type of e │ │ │ │ -000e0120: 6163 6820 6f62 6a65 6374 2e20 5468 6520 ach object. The │ │ │ │ -000e0130: 7479 7065 206e 616d 696e 6720 636f 6e76 type naming conv │ │ │ │ -000e0140: 656e 7469 6f6e 7320 6f75 746c 696e 6564 entions outlined │ │ │ │ -000e0150: 2069 6e20 5365 6374 696f 6e20 3c61 2063 in Section Serializin │ │ │ │ -000e0190: 6720 432f 432b 2b20 6461 7461 2074 6f20 g C/C++ data to │ │ │ │ -000e01a0: 584d 4c3c 2f61 3e20 6172 6520 7573 6564 XML are used │ │ │ │ -000e01b0: 2074 6f20 6465 7465 726d 696e 6520 7468 to determine th │ │ │ │ -000e01c0: 6520 7479 7065 206e 616d 6520 666f 7220 e type name for │ │ │ │ -000e01d0: 3c63 6f64 653e 543c 2f63 6f64 653e 2e20 T. │ │ │ │ -000e01e0: 5661 6c75 6573 2073 6572 6961 6c69 7a65 Values serialize │ │ │ │ -000e01f0: 6420 696e 2058 4d4c 2077 6974 6820 7468 d in XML with th │ │ │ │ -000e0200: 6973 2061 7070 726f 6163 6820 616c 7761 is approach alwa │ │ │ │ -000e0210: 7973 2063 6172 7279 2074 6865 203c 656d ys carry the xsi:type< │ │ │ │ -000e0230: 2f63 6f64 653e 3c2f 656d 3e20 6174 7472 /code> attr │ │ │ │ -000e0240: 6962 7574 6520 696e 2058 4d4c 2074 6f20 ibute in XML to │ │ │ │ -000e0250: 696e 6469 6361 7465 2074 6865 2074 7970 indicate the typ │ │ │ │ -000e0260: 6520 6f66 2063 6f6e 7465 6e74 2073 6572 e of content ser │ │ │ │ -000e0270: 6961 6c69 7a65 642e 3c2f 703e 0a3c 703e ialized.

.

│ │ │ │ -000e0280: 4865 7265 2069 7320 616e 2065 7861 6d70 Here is an examp │ │ │ │ -000e0290: 6c65 2074 6f20 696c 6c75 7374 7261 7465 le to illustrate │ │ │ │ -000e02a0: 2074 6865 2073 6572 6961 6c69 7a61 7469 the serializati │ │ │ │ -000e02b0: 6f6e 206f 6620 6120 3c63 6f64 653e 766f on of a vo │ │ │ │ -000e02c0: 6964 2a3c 2f63 6f64 653e 206d 656d 6265 id* membe │ │ │ │ -000e02d0: 7220 696e 2061 2073 7472 7563 742f 636c r in a struct/cl │ │ │ │ -000e02e0: 6173 733a 3c2f 703e 0a3c 6469 7620 636c ass:

.
< │ │ │ │ -000e0300: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -000e0310: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >struct ns__record │ │ │ │ -000e0340: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
{
│ │ │ │ -000e0360: 0a3c 6469 7620 636c 6173 733d 226c 696e .
int __ty │ │ │ │ -000e03a0: 7065 3b20 3c73 7061 6e20 636c 6173 733d pe; // the │ │ │ │ -000e03c0: 2053 4f41 505f 5459 5045 5f54 2070 6f69 SOAP_TYPE_T poi │ │ │ │ -000e03d0: 6e74 6564 2074 6f20 6279 2076 616c 3c2f nted to by val
.
│ │ │ │ -000e0400: 2020 3c73 7061 6e20 636c 6173 733d 226b void │ │ │ │ -000e0420: 3c2f 7370 616e 3e20 2a76 616c 3b20 203c *val; < │ │ │ │ -000e0430: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ -000e0440: 656e 7422 3e2f 2f20 7365 7269 616c 697a ent">// serializ │ │ │ │ -000e0450: 6520 616e 7920 7479 7065 2069 6e20 656c e any type in el │ │ │ │ -000e0460: 656d 656e 7420 266c 743b 7661 6c26 6774 ement <val> │ │ │ │ -000e0470: 3b3c 2f73 7061 6e3e 3c2f 6469 763e 0a3c ;
.< │ │ │ │ -000e0480: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -000e0490: 3e7d 3b3c 2f64 6976 3e0a 3c2f 6469 763e >};. │ │ │ │ -000e04a0: 3c21 2d2d 2066 7261 676d 656e 7420 2d2d │ │ │ │ -000e0900: 3c70 3e54 6865 2064 6573 6572 6961 6c69

The deseriali │ │ │ │ -000e0910: 7a65 7220 666f 7220 3c63 6f64 653e 6e73 zer for ns │ │ │ │ -000e0920: 5f5f 7265 636f 7264 3c2f 636f 6465 3e20 __record │ │ │ │ -000e0930: 7769 6c6c 2061 7574 6f6d 6174 6963 616c will automatical │ │ │ │ -000e0940: 6c79 2073 6574 2074 6865 203c 636f 6465 ly set the __type f │ │ │ │ -000e0960: 6965 6c64 2061 6e64 2076 6f69 6420 706f ield and void po │ │ │ │ -000e0970: 696e 7465 7220 7768 656e 2064 6573 6572 inter when deser │ │ │ │ -000e0980: 6961 6c69 7a69 6e67 2074 6865 2064 6174 ializing the dat │ │ │ │ -000e0990: 612c 2070 726f 7669 6465 6420 7468 6174 a, provided that │ │ │ │ -000e09a0: 2074 6865 2058 4d4c 2065 6c65 6d65 6e74 the XML element │ │ │ │ -000e09b0: 203c 656d 3e3c 636f 6465 3e76 616c 3c2f val carri │ │ │ │ -000e09d0: 6573 2074 6865 203c 656d 3e3c 636f 6465 es the xsi:type │ │ │ │ -000e09f0: 3c2f 656d 3e20 6174 7472 6962 7574 6520 attribute │ │ │ │ -000e0a00: 6672 6f6d 2077 6869 6368 2069 7420 6361 from which it ca │ │ │ │ -000e0a10: 6e20 6465 7465 726d 696e 6520 7468 6520 n determine the │ │ │ │ -000e0a20: 7479 7065 2e3c 2f70 3e0a 3c64 6c20 636c type.

.
Note
│ │ │ │ -000e0a50: 3c64 643e 7768 656e 2073 6572 6961 6c69
when seriali │ │ │ │ -000e0a60: 7a69 6e67 2073 7472 696e 6773 2076 6961 zing strings via │ │ │ │ -000e0a70: 2061 203c 636f 6465 3e76 6f69 642a 3c2f a void* member, th │ │ │ │ -000e0a90: 6520 3c63 6f64 653e 766f 6964 2a3c 2f63 e void* pointer mus │ │ │ │ -000e0ab0: 7420 6469 7265 6374 6c79 2070 6f69 6e74 t directly point │ │ │ │ -000e0ac0: 2074 6f20 7468 6520 7374 7269 6e67 2076 to the string v │ │ │ │ -000e0ad0: 616c 7565 2072 6174 6865 7220 7468 616e alue rather than │ │ │ │ -000e0ae0: 2069 6e64 6972 6563 746c 7920 6173 2077 indirectly as w │ │ │ │ -000e0af0: 6974 6820 616c 6c20 6f74 6865 7220 7479 ith all other ty │ │ │ │ -000e0b00: 7065 732e 2046 6f72 2065 7861 6d70 6c65 pes. For example │ │ │ │ -000e0b10: 3a3c 2f64 643e 3c2f 646c 3e0a 3c64 6976 :
.
struct │ │ │ │ -000e0b60: 203c 2f73 7061 6e3e 6e73 5f5f 7265 636f ns__reco │ │ │ │ -000e0b70: 7264 2053 3b20 3c2f 6469 763e 0a3c 6469 rd S;
.S │ │ │ │ -000e0b90: 2e76 616c 203d 2028 3c73 7061 6e20 636c .val = (void*)< │ │ │ │ -000e0bc0: 7370 616e 2063 6c61 7373 3d22 7374 7269 span class="stri │ │ │ │ -000e0bd0: 6e67 6c69 7465 7261 6c22 3e26 7175 6f74 ngliteral">" │ │ │ │ -000e0be0: 3b48 656c 6c6f 2671 756f 743b 3c2f 7370 ;Hello";
.
S. │ │ │ │ -000e0c10: 5f5f 7479 7065 203d 2053 4f41 505f 5459 __type = SOAP_TY │ │ │ │ -000e0c20: 5045 5f73 7472 696e 673b 203c 2f64 6976 PE_string;
.

This │ │ │ │ -000e0c50: 2069 7320 7468 6520 6361 7365 2066 6f72 is the case for │ │ │ │ -000e0c60: 2061 6c6c 2073 7472 696e 672d 6261 7365 all string-base │ │ │ │ -000e0c70: 6420 7479 7065 732c 2069 6e63 6c75 6469 d types, includi │ │ │ │ -000e0c80: 6e67 2074 7970 6573 2064 6566 696e 6564 ng types defined │ │ │ │ -000e0c90: 2077 6974 6820 3c63 6f64 653e 7479 7065 with type │ │ │ │ -000e0ca0: 6465 6620 6368 6172 2a3c 2f63 6f64 653e def char* │ │ │ │ -000e0cb0: 2e3c 2f70 3e0a 3c70 3e59 6f75 206d 6179 .

.

You may │ │ │ │ -000e0cc0: 2075 7365 2061 6e20 6172 6269 7472 6172 use an arbitrar │ │ │ │ -000e0cd0: 7920 7375 6666 6978 2077 6974 6820 7468 y suffix with th │ │ │ │ -000e0ce0: 6520 3c63 6f64 653e 5f5f 7479 7065 3c2f e __type members to │ │ │ │ -000e0d00: 2068 616e 646c 6520 6d75 6c74 6970 6c65 handle multiple │ │ │ │ -000e0d10: 2076 6f69 6420 706f 696e 7465 7273 2069 void pointers i │ │ │ │ -000e0d20: 6e20 7374 7275 6374 732f 636c 6173 7365 n structs/classe │ │ │ │ -000e0d30: 732e 2046 6f72 2065 7861 6d70 6c65 3a3c s. For example:< │ │ │ │ -000e0d40: 2f70 3e0a 3c64 6976 2063 6c61 7373 3d22 /p>.

struct │ │ │ │ -000e0d90: 6e73 5f5f 7265 636f 7264 203c 2f64 6976 ns__record
.
{
.
│ │ │ │ -000e0dd0: 2020 3c73 7061 6e20 636c 6173 733d 226b int< │ │ │ │ -000e0df0: 2f73 7061 6e3e 205f 5f74 7970 654f 6670 /span> __typeOfp │ │ │ │ -000e0e00: 3b20 3c73 7061 6e20 636c 6173 733d 2263 ; // the S │ │ │ │ -000e0e20: 4f41 505f 5459 5045 5f54 2070 6f69 6e74 OAP_TYPE_T point │ │ │ │ -000e0e30: 6564 2074 6f20 6279 2070 203c 2f73 7061 ed to by p
.
< │ │ │ │ -000e0e60: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -000e0e70: 6f72 6474 7970 6522 3e76 6f69 643c 2f73 ordtype">void *p; < │ │ │ │ -000e0e90: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ -000e0ea0: 656e 7422 3e2f 2f20 656c 656d 656e 7420 ent">// element │ │ │ │ -000e0eb0: 266c 743b 7026 6774 3b3c 2f73 7061 6e3e <p> │ │ │ │ -000e0ec0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
int __typeOfq; // the SOAP_T │ │ │ │ -000e0f30: 5950 455f 5420 706f 696e 7465 6420 746f YPE_T pointed to │ │ │ │ -000e0f40: 2062 7920 7120 3c2f 7370 616e 3e3c 2f64 by q .
void │ │ │ │ -000e0f90: 2a71 3b20 2020 2020 2020 3c73 7061 6e20 *q; │ │ │ │ -000e0fb0: 2f2f 2065 6c65 6d65 6e74 2026 6c74 3b71 // element <q │ │ │ │ -000e0fc0: 2667 743b 3c2f 7370 616e 3e3c 2f64 6976 >
.
};
.

Because s │ │ │ │ -000e1010: 6572 7669 6365 206d 6574 686f 6420 7061 ervice method pa │ │ │ │ -000e1020: 7261 6d65 7465 7273 2061 7265 2073 746f rameters are sto │ │ │ │ -000e1030: 7265 6420 7769 7468 696e 2073 7472 7563 red within struc │ │ │ │ -000e1040: 7473 2c20 796f 7520 6361 6e20 7573 6520 ts, you can use │ │ │ │ -000e1050: 3c63 6f64 653e 5f5f 7479 7065 3c2f 636f __type and vo │ │ │ │ -000e1070: 6964 2a3c 2f63 6f64 653e 2070 6172 616d id* param │ │ │ │ -000e1080: 6574 6572 7320 746f 2070 6173 7320 706f eters to pass po │ │ │ │ -000e1090: 6c79 6d6f 7270 6869 6320 6172 6775 6d65 lymorphic argume │ │ │ │ -000e10a0: 6e74 7320 7769 7468 6f75 7420 6861 7669 nts without havi │ │ │ │ -000e10b0: 6e67 2074 6f20 6465 6669 6e65 2061 2043 ng to define a C │ │ │ │ -000e10c0: 2b2b 2063 6c61 7373 2068 6965 7261 7263 ++ class hierarc │ │ │ │ -000e10d0: 6879 2028 5365 6374 696f 6e20 3c61 2063 hy (Section Polymorphi │ │ │ │ -000e1110: 736d 2c20 6465 7269 7665 6420 7479 7065 sm, derived type │ │ │ │ -000e1120: 732c 2061 6e64 2064 796e 616d 6963 2062 s, and dynamic b │ │ │ │ -000e1130: 696e 6469 6e67 2069 6e20 432b 2b3c 2f61 inding in C++ ), provided th │ │ │ │ -000e1150: 6174 203c 656d 3e3c 636f 6465 3e78 7369 at xsi │ │ │ │ -000e1160: 3a74 7970 653c 2f63 6f64 653e 3c2f 656d :type attributes are │ │ │ │ -000e1180: 2070 7265 7365 6e74 2069 6e20 7468 6520 present in the │ │ │ │ -000e1190: 584d 4c20 656c 656d 656e 7473 2e20 466f XML elements. Fo │ │ │ │ -000e11a0: 7220 6578 616d 706c 653a 3c2f 703e 0a3c r example:

.< │ │ │ │ -000e11b0: 6469 7620 636c 6173 733d 2266 7261 676d div class="fragm │ │ │ │ -000e11c0: 656e 7422 3e3c 6469 7620 636c 6173 733d ent">
typ │ │ │ │ -000e11f0: 6564 6566 3c2f 7370 616e 3e20 3c73 7061 edef char *xsd__string; │ │ │ │ -000e1230: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
t │ │ │ │ -000e1260: 7970 6564 6566 3c2f 7370 616e 3e20 3c73 ypedef int xsd__int; .
type │ │ │ │ -000e12d0: 6465 663c 2f73 7061 6e3e 203c 7370 616e def float xsd__float; .
enu │ │ │ │ -000e1340: 6d3c 2f73 7061 6e3e 206e 735f 5f73 7461 m ns__sta │ │ │ │ -000e1350: 7475 7320 7b20 6f6e 2c20 6f66 6620 7d3b tus { on, off }; │ │ │ │ -000e1360: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
│ │ │ │ -000e1390: 7374 7275 6374 203c 2f73 7061 6e3e 6e73 struct ns │ │ │ │ -000e13a0: 5f5f 7769 6467 6574 3c2f 6469 763e 0a3c __widget
.< │ │ │ │ -000e13b0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -000e13c0: 3e7b 3c2f 6469 763e 0a3c 6469 7620 636c >{
.
< │ │ │ │ -000e13e0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -000e13f0: 6f72 6474 7970 6522 3e63 6861 723c 2f73 ordtype">char *name;
.
int par │ │ │ │ -000e1450: 743b 3c2f 6469 763e 0a3c 6469 7620 636c t;
.
};.
│ │ │ │ -000e14a0: 696e 743c 2f73 7061 6e3e 206e 735f 5f77 int ns__w │ │ │ │ -000e14b0: 6562 6d65 7468 6f64 283c 7370 616e 2063 ebmethod(int __ │ │ │ │ -000e14e0: 7479 7065 2c20 3c73 7061 6e20 636c 6173 type, │ │ │ │ -000e1500: 766f 6964 3c2f 7370 616e 3e20 2a64 6174 void *dat │ │ │ │ -000e1510: 612c 203c 7370 616e 2063 6c61 7373 3d22 a, struct< │ │ │ │ -000e1530: 2f73 7061 6e3e 206e 735f 5f77 6562 6d65 /span> ns__webme │ │ │ │ -000e1540: 7468 6f64 5265 7370 6f6e 7365 207b 203c thodResponse { < │ │ │ │ -000e1550: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -000e1560: 6f72 6474 7970 6522 3e69 6e74 3c2f 7370 ordtype">int __type; void *return_; } *o │ │ │ │ -000e15b0: 7574 293b 3c2f 6469 763e 0a3c 2f64 6976 ut);
.
│ │ │ │ -000e1b10: 3c70 3e54 6865 2066 6f6c 6c6f 7769 6e67

The following │ │ │ │ -000e1b20: 2065 7861 6d70 6c65 2069 6c6c 7573 7472 example illustr │ │ │ │ -000e1b30: 6174 6573 2074 6865 2069 6e69 7469 616c ates the initial │ │ │ │ -000e1b40: 697a 6174 696f 6e20 6f66 203c 636f 6465 ization of __ns__record with a void │ │ │ │ -000e1b70: 2070 6f69 6e74 6572 2074 6f20 616e 2069 pointer to an i │ │ │ │ -000e1b80: 6e74 3a3c 2f70 3e0a 3c64 6976 2063 6c61 nt:

.
│ │ │ │ -000e1bb0: 3c73 7061 6e20 636c 6173 733d 226b 6579 struct ns__record S │ │ │ │ -000e1be0: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
int │ │ │ │ -000e1c20: 6e20 3d20 3132 333b 203c 2f64 6976 3e0a n = 123;
. │ │ │ │ -000e1c30: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
S.val.__item = │ │ │ │ -000e1c50: 2028 3c73 7061 6e20 636c 6173 733d 226b (void │ │ │ │ -000e1c70: 3c2f 7370 616e 3e2a 2926 616d 703b 6e3b *)&n; │ │ │ │ -000e1c80: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
S.val. │ │ │ │ -000e1ca0: 5f5f 7479 7065 203d 2053 4f41 505f 5459 __type = SOAP_TY │ │ │ │ -000e1cb0: 5045 5f69 6e74 3b20 3c2f 6469 763e 0a3c PE_int;
.< │ │ │ │ -000e1cc0: 2f64 6976 3e3c 212d 2d20 6672 6167 6d65 /div>

The ser │ │ │ │ -000e1ce0: 6961 6c69 7a65 6420 6f75 7470 7574 206f ialized output o │ │ │ │ -000e1cf0: 6620 3c63 6f64 653e 533c 2f63 6f64 653e f S │ │ │ │ -000e1d00: 2063 6f6e 7461 696e 7320 7468 6520 696e contains the in │ │ │ │ -000e1d10: 7465 6765 723a 3c2f 703e 0a3c 6469 7620 teger:

.
<ns:record>
. │ │ │ │ -000e1da0: 2020 266c 743b 3c73 7061 6e20 636c 6173 < │ │ │ │ -000e1dc0: 7661 6c3c 2f73 7061 6e3e 203c 7370 616e val xsi:type │ │ │ │ -000e1df0: 3d3c 7370 616e 2063 6c61 7373 3d22 7374 =&qu │ │ │ │ -000e1e10: 6f74 3b78 7364 3a69 6e74 2671 756f 743b ot;xsd:int" │ │ │ │ -000e1e20: 3c2f 7370 616e 3e26 6774 3b31 3233 266c >123&l │ │ │ │ -000e1e30: 743b 2f3c 7370 616e 2063 6c61 7373 3d22 t;/val │ │ │ │ -000e1e50: 3c2f 7370 616e 3e26 6774 3b3c 2f64 6976 >
.
</ns:record>
.

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

.

.Fi │ │ │ │ -000e1f30: 7865 642d 7369 7a65 2061 7272 6179 2073 xed-size array s │ │ │ │ -000e1f40: 6572 6961 6c69 7a61 7469 6f6e 3c2f 6832 erialization

.

Fixed size │ │ │ │ -000e1f60: 6172 7261 7973 2061 7265 2073 6572 6961 arrays are seria │ │ │ │ -000e1f70: 6c69 7a65 6420 6173 2072 6570 6574 6974 lized as repetit │ │ │ │ -000e1f80: 696f 6e73 206f 6620 3c65 6d3e 3c63 6f64 ions of item elements with │ │ │ │ -000e1fb0: 2074 6865 2061 7272 6179 2076 616c 7565 the array value │ │ │ │ -000e1fc0: 7320 696e 2058 4d4c 2e20 4d75 6c74 692d s in XML. Multi- │ │ │ │ -000e1fd0: 6469 6d65 6e73 696f 6e61 6c20 6669 7865 dimensional fixe │ │ │ │ -000e1fe0: 6420 7369 7a65 2061 7272 6179 7320 6172 d size arrays ar │ │ │ │ -000e1ff0: 6520 7365 7269 616c 697a 6564 2061 7320 e serialized as │ │ │ │ -000e2000: 6e65 7374 6564 203c 656d 3e3c 636f 6465 nested item elements, wher │ │ │ │ -000e2030: 6520 7468 6520 6f75 7465 7220 656c 656d e the outer elem │ │ │ │ -000e2040: 656e 7473 2061 7265 2061 7272 6179 732e ents are arrays. │ │ │ │ -000e2050: 3c2f 703e 0a3c 703e 5468 6520 7365 7269

.

The seri │ │ │ │ -000e2060: 616c 697a 6174 696f 6e20 6f66 2066 6978 alization of fix │ │ │ │ -000e2070: 6564 2d73 697a 6520 6172 7261 7973 2073 ed-size arrays s │ │ │ │ -000e2080: 7570 706f 7274 7320 7468 6520 534f 4150 upports the SOAP │ │ │ │ -000e2090: 2052 5043 2065 6e63 6f64 696e 6720 6d75 RPC encoding mu │ │ │ │ -000e20a0: 6c74 692d 6469 6d65 6e73 696f 6e61 6c20 lti-dimensional │ │ │ │ -000e20b0: 6172 7261 7920 666f 726d 6174 2061 7320 array format as │ │ │ │ -000e20c0: 7765 6c6c 2061 7320 7061 7274 6961 6c6c well as partiall │ │ │ │ -000e20d0: 7920 7472 616e 736d 6974 7465 6420 616e y transmitted an │ │ │ │ -000e20e0: 6420 7370 6172 7365 2061 7272 6179 2066 d sparse array f │ │ │ │ -000e20f0: 6f72 6d61 7473 2073 7461 6e64 6172 6469 ormats standardi │ │ │ │ -000e2100: 7a65 6420 696e 2053 4f41 5020 312e 3120 zed in SOAP 1.1 │ │ │ │ -000e2110: 616e 6420 312e 322e 3c2f 703e 0a3c 703e and 1.2.

.

│ │ │ │ -000e2120: 466f 7220 6578 616d 706c 653a 3c2f 703e For example:

│ │ │ │ -000e2130: 0a3c 6469 7620 636c 6173 733d 2266 7261 .
/ │ │ │ │ -000e2170: 2f20 436f 6e74 656e 7473 206f 6620 6669 / Contents of fi │ │ │ │ -000e2180: 6c65 2026 7175 6f74 3b66 6978 6564 2e68 le "fixed.h │ │ │ │ -000e2190: 2671 756f 743b 3a20 3c2f 7370 616e 3e3c ": < │ │ │ │ -000e21a0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
st │ │ │ │ -000e21d0: 7275 6374 203c 2f73 7061 6e3e 4578 616d ruct Exam │ │ │ │ -000e21e0: 706c 6520 3c2f 6469 763e 0a3c 6469 7620 ple
.
{.
float a[3];
.< │ │ │ │ -000e2250: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -000e2260: 3e7d 3b3c 2f64 6976 3e0a 3c2f 6469 763e >};
.
│ │ │ │ -000e2270: 3c21 2d2d 2066 7261 676d 656e 7420 2d2d

│ │ │ │ -000e2540: 416e 7920 6465 7365 7269 616c 697a 6564 Any deserialized │ │ │ │ -000e2550: 2069 7465 6d73 206f 6620 616e 2061 7272 items of an arr │ │ │ │ -000e2560: 6179 2074 6861 7420 646f 206e 6f74 2066 ay that do not f │ │ │ │ -000e2570: 6974 2069 6e20 7468 6520 6669 7865 6420 it in the fixed │ │ │ │ -000e2580: 7369 7a65 2061 7272 6179 2c20 692e 652e size array, i.e. │ │ │ │ -000e2590: 2061 7265 206f 7574 206f 6620 626f 756e are out of boun │ │ │ │ -000e25a0: 6473 2c20 6172 6520 6967 6e6f 7265 6420 ds, are ignored │ │ │ │ -000e25b0: 6279 2074 6865 2064 6573 6572 6961 6c69 by the deseriali │ │ │ │ -000e25c0: 7a65 7220 7768 656e 2074 6865 203c 636f zer when the #SOAP_C_NOIOB │ │ │ │ -000e25e0: 3c2f 636f 6465 3e20 666c 6167 2069 7320 flag is │ │ │ │ -000e25f0: 7365 742c 206f 7468 6572 7769 7365 203c set, otherwise < │ │ │ │ -000e2600: 636f 6465 3e23 534f 4150 5f49 4f42 3c2f code>#SOAP_IOB errors wil │ │ │ │ -000e2620: 6c20 6265 2067 656e 6572 6174 6564 2062 l be generated b │ │ │ │ -000e2630: 7920 7468 6520 6465 7365 7269 616c 697a y the deserializ │ │ │ │ -000e2640: 6572 2e3c 2f70 3e0a 3c70 3ef0 9f94 9d20 er.

.

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

..Dynamic a │ │ │ │ -000e26b0: 7272 6179 2073 6572 6961 6c69 7a61 7469 rray serializati │ │ │ │ -000e26c0: 6f6e 3c2f 6832 3e0a 3c70 3e44 796e 616d on.

Dynam │ │ │ │ -000e26d0: 6963 2061 7272 6179 7320 6172 6520 6d75 ic arrays are mu │ │ │ │ -000e26e0: 6368 206d 6f72 6520 666c 6578 6962 6c65 ch more flexible │ │ │ │ -000e26f0: 2074 6861 6e20 6669 7865 642d 7369 7a65 than fixed-size │ │ │ │ -000e2700: 2061 7272 6179 732e 2044 796e 616d 6963 arrays. Dynamic │ │ │ │ -000e2710: 2061 7272 6179 7320 6465 636c 6172 6564 arrays declared │ │ │ │ -000e2720: 2069 6e20 7468 6520 696e 7465 7266 6163 in the interfac │ │ │ │ -000e2730: 6520 6865 6164 6572 2066 696c 6520 666f e header file fo │ │ │ │ -000e2740: 7220 736f 6170 6370 7032 2061 7265 2061 r soapcpp2 are a │ │ │ │ -000e2750: 2073 7065 6369 616c 2073 7472 7563 7420 special struct │ │ │ │ -000e2760: 6f72 2063 6c61 7373 206f 7220 6172 6520 or class or are │ │ │ │ -000e2770: 7061 7274 206f 6620 6120 7374 7275 6374 part of a struct │ │ │ │ -000e2780: 206f 7220 636c 6173 7320 7769 7468 2061 or class with a │ │ │ │ -000e2790: 206d 656d 6265 7220 706f 696e 7469 6e67 member pointing │ │ │ │ -000e27a0: 2074 6f20 616e 2061 7272 6179 206f 6620 to an array of │ │ │ │ -000e27b0: 656c 656d 656e 7473 2061 6e64 2061 206d elements and a m │ │ │ │ -000e27c0: 656d 6265 7220 7468 6174 2073 746f 7265 ember that store │ │ │ │ -000e27d0: 7320 7468 6520 7369 7a65 206f 6620 7468 s the size of th │ │ │ │ -000e27e0: 6520 6172 7261 792e 2044 796e 616d 6963 e array. Dynamic │ │ │ │ -000e27f0: 2061 7272 6179 2061 6c6c 6f63 6174 696f array allocatio │ │ │ │ -000e2800: 6e73 2061 7265 2065 6173 7920 7573 696e ns are easy usin │ │ │ │ -000e2810: 6720 7468 6520 736f 6170 6370 702d 6765 g the soapcpp-ge │ │ │ │ -000e2820: 6e65 7261 7465 6420 3c63 6f64 653e 736f nerated so │ │ │ │ -000e2830: 6170 5f6e 6577 5f54 3c2f 636f 6465 3e20 ap_new_T │ │ │ │ -000e2840: 6675 6e63 7469 6f6e 7320 666f 7220 7479 functions for ty │ │ │ │ -000e2850: 7065 203c 636f 6465 3e54 3c2f 636f 6465 pe T. This function │ │ │ │ -000e2870: 2069 7320 7573 6564 2074 6f20 616c 6c6f is used to allo │ │ │ │ -000e2880: 6361 7465 2061 6e20 6172 7261 7920 6f66 cate an array of │ │ │ │ -000e2890: 2076 616c 7565 7320 7768 6963 6820 6361 values which ca │ │ │ │ -000e28a0: 6e20 7468 656e 2062 6520 6173 7369 676e n then be assign │ │ │ │ -000e28b0: 6564 2074 6f20 7468 6520 706f 696e 7465 ed to the pointe │ │ │ │ -000e28c0: 7220 6d65 6d62 6572 206f 6620 7468 6520 r member of the │ │ │ │ -000e28d0: 7374 7275 6374 2f63 6c61 7373 2074 6861 struct/class tha │ │ │ │ -000e28e0: 7420 7374 6f72 6573 2074 6865 2061 7272 t stores the arr │ │ │ │ -000e28f0: 6179 2070 6f69 6e74 6572 2077 6974 6820 ay pointer with │ │ │ │ -000e2900: 6974 7320 7369 7a65 2e3c 2f70 3e0a 3c70 its size.

.

To facilitate S │ │ │ │ -000e2920: 4f41 5020 5250 4320 656e 636f 6469 6e67 OAP RPC encoding │ │ │ │ -000e2930: 2c20 534f 4150 2d65 6e63 6f64 6564 2061 , SOAP-encoded a │ │ │ │ -000e2940: 7272 6179 7320 7265 7175 6972 6520 7370 rrays require sp │ │ │ │ -000e2950: 6563 6961 6c20 7472 6561 746d 656e 742e ecial treatment. │ │ │ │ -000e2960: 2053 4f41 502d 656e 636f 6465 6420 6172 SOAP-encoded ar │ │ │ │ -000e2970: 7261 7973 2061 7265 2073 696e 676c 652d rays are single- │ │ │ │ -000e2980: 206f 7220 6d75 6c74 692d 6469 6d65 6e73 or multi-dimens │ │ │ │ -000e2990: 696f 6e61 6c20 6172 7261 7973 2077 6974 ional arrays wit │ │ │ │ -000e29a0: 6820 626f 756e 6473 2074 6861 7420 6170 h bounds that ap │ │ │ │ -000e29b0: 7065 6172 2069 6e20 584d 4c2e 2054 6865 pear in XML. The │ │ │ │ -000e29c0: 7365 2061 7272 6179 7320 6d61 7920 616c se arrays may al │ │ │ │ -000e29d0: 736f 2068 6176 6520 6f66 6673 6574 7320 so have offsets │ │ │ │ -000e29e0: 7468 6174 2064 6966 6665 7220 6672 6f6d that differ from │ │ │ │ -000e29f0: 207a 6572 6f2e 2054 6865 2069 6e74 656e zero. The inten │ │ │ │ -000e2a00: 7420 6f66 2053 4f41 502d 656e 636f 6465 t of SOAP-encode │ │ │ │ -000e2a10: 6420 6172 7261 7973 2069 7320 746f 2072 d arrays is to r │ │ │ │ -000e2a20: 6570 6c69 6361 7465 206d 756c 7469 2d64 eplicate multi-d │ │ │ │ -000e2a30: 696d 656e 7369 6f6e 616c 2061 7272 6179 imensional array │ │ │ │ -000e2a40: 7320 636f 6d6d 6f6e 6c79 2066 6f75 6e64 s commonly found │ │ │ │ -000e2a50: 2069 6e20 7072 6f67 7261 6d6d 696e 6720 in programming │ │ │ │ -000e2a60: 6c61 6e67 7561 6765 732e 3c2f 703e 0a3c languages.

.< │ │ │ │ -000e2a70: 703e 486f 7765 7665 722c 2058 4d4c 2061 p>However, XML a │ │ │ │ -000e2a80: 6c73 6f20 7072 6f76 6964 6573 2061 2073 lso provides a s │ │ │ │ -000e2a90: 696d 706c 6520 7761 7920 746f 2072 6570 imple way to rep │ │ │ │ -000e2aa0: 7265 7365 6e74 2061 2073 6571 7565 6e63 resent a sequenc │ │ │ │ -000e2ab0: 6520 6f66 2076 616c 7565 7320 7769 7468 e of values with │ │ │ │ -000e2ac0: 2061 2073 6571 7565 6e63 6520 6f66 2058 a sequence of X │ │ │ │ -000e2ad0: 4d4c 2065 6c65 6d65 6e74 732e 2054 6869 ML elements. Thi │ │ │ │ -000e2ae0: 7320 6469 6666 6572 7320 6672 6f6d 2053 s differs from S │ │ │ │ -000e2af0: 4f41 502d 656e 636f 6465 6420 6172 7261 OAP-encoded arra │ │ │ │ -000e2b00: 7973 2069 6e20 7468 6174 2053 4f41 502d ys in that SOAP- │ │ │ │ -000e2b10: 656e 636f 6465 6420 6172 7261 7973 2061 encoded arrays a │ │ │ │ -000e2b20: 7265 2065 6c65 6d65 6e74 7320 7769 7468 re elements with │ │ │ │ -000e2b30: 206e 6573 7465 6420 3c65 6d3e 3c63 6f64 nested item
elements with │ │ │ │ -000e2b60: 2076 616c 7565 732c 2074 686f 7567 6820 values, though │ │ │ │ -000e2b70: 534f 4150 2064 6573 6572 6961 6c69 7a65 SOAP deserialize │ │ │ │ -000e2b80: 7273 206d 6179 2069 676e 6f72 6520 7468 rs may ignore th │ │ │ │ -000e2b90: 6520 6e61 6d65 206f 6620 7468 6573 6520 e name of these │ │ │ │ -000e2ba0: 656c 656d 656e 7473 2077 6865 6e20 7061 elements when pa │ │ │ │ -000e2bb0: 7273 696e 6720 584d 4c20 6173 2073 7461 rsing XML as sta │ │ │ │ -000e2bc0: 7465 6420 696e 2074 6865 2053 4f41 5020 ted in the SOAP │ │ │ │ -000e2bd0: 7370 6563 6966 6963 6174 696f 6e73 2e3c specifications.< │ │ │ │ -000e2be0: 2f70 3e0a 3c70 3e42 6f74 6820 534f 4150 /p>.

Both SOAP │ │ │ │ -000e2bf0: 2d65 6e63 6f64 6564 2061 7272 6179 7320 -encoded arrays │ │ │ │ -000e2c00: 616e 6420 7365 7175 656e 6365 7320 6f66 and sequences of │ │ │ │ -000e2c10: 2058 4d4c 2065 6c65 6d65 6e74 7320 6172 XML elements ar │ │ │ │ -000e2c20: 6520 7375 7070 6f72 7465 6420 696e 2067 e supported in g │ │ │ │ -000e2c30: 534f 4150 2c20 7573 696e 6720 6479 6e61 SOAP, using dyna │ │ │ │ -000e2c40: 6d69 6320 6172 7261 7973 2061 6e64 2063 mic arrays and c │ │ │ │ -000e2c50: 6f6e 7461 696e 6572 732e 2054 6865 2062 ontainers. The b │ │ │ │ -000e2c60: 6173 6963 7320 7769 6c6c 2062 6520 6465 asics will be de │ │ │ │ -000e2c70: 7363 7269 6265 6420 6e65 7874 2e20 466f scribed next. Fo │ │ │ │ -000e2c80: 7220 6164 6469 7469 6f6e 616c 2064 6574 r additional det │ │ │ │ -000e2c90: 6169 6c73 2c20 7365 6520 7468 6520 3c61 ails, see the C and │ │ │ │ -000e2cd0: 432b 2b20 584d 4c20 4461 7461 2042 696e C++ XML Data Bin │ │ │ │ -000e2ce0: 6469 6e67 733c 2f61 3e20 646f 6375 6d65 dings docume │ │ │ │ -000e2cf0: 6e74 6174 696f 6e2e 3c2f 703e 0a3c 703e ntation.

.

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

.S │ │ │ │ -000e2d60: 4f41 502d 656e 636f 6465 6420 6172 7261 OAP-encoded arra │ │ │ │ -000e2d70: 7920 626f 756e 6473 3c2f 6833 3e0a 3c70 y bounds

.

SOAP-encoded ar │ │ │ │ -000e2d90: 7261 7973 2075 7365 2074 6865 203c 656d rays use the SOAP-ENC: │ │ │ │ -000e2db0: 4172 7261 793c 2f63 6f64 653e 3c2f 656d Array attribute in X │ │ │ │ -000e2dd0: 4d4c 2074 6f20 6964 656e 7469 6679 2074 ML to identify t │ │ │ │ -000e2de0: 6865 2061 7272 6179 2061 6e64 2074 6865 he array and the │ │ │ │ -000e2df0: 203c 656d 3e3c 636f 6465 3e53 4f41 502d SOAP- │ │ │ │ -000e2e00: 454e 433a 6172 7261 7954 7970 653c 2f63 ENC:arrayType attrib │ │ │ │ -000e2e20: 7574 6520 746f 2069 6465 6e74 6966 7920 ute to identify │ │ │ │ -000e2e30: 7468 6520 6172 7261 7920 6469 6d65 6e73 the array dimens │ │ │ │ -000e2e40: 696f 6e61 6c69 7479 2061 6e64 2069 7473 ionality and its │ │ │ │ -000e2e50: 2073 697a 652e 3c2f 703e 0a3c 703e 4173 size.

.

As │ │ │ │ -000e2e60: 2061 2073 6563 7572 6974 7920 6d65 6173 a security meas │ │ │ │ -000e2e70: 7572 6520 746f 2061 766f 6964 2064 656e ure to avoid den │ │ │ │ -000e2e80: 6961 6c20 6f66 2073 6572 7669 6365 2061 ial of service a │ │ │ │ -000e2e90: 7474 6163 6b73 2062 6173 6564 206f 6e20 ttacks based on │ │ │ │ -000e2ea0: 7365 6e64 696e 6720 6120 6875 6765 2061 sending a huge a │ │ │ │ -000e2eb0: 7272 6179 2073 697a 6520 7661 6c75 6520 rray size value │ │ │ │ -000e2ec0: 7573 696e 6720 7468 6520 3c65 6d3e 3c63 using the SOAP-ENC:arr │ │ │ │ -000e2ee0: 6179 5479 7065 3c2f 636f 6465 3e3c 2f65 ayType attribute, re │ │ │ │ -000e2f00: 7175 6972 696e 6720 7468 6520 616c 6c6f quiring the allo │ │ │ │ -000e2f10: 6361 7469 6f6e 206f 6620 6c61 7267 6520 cation of large │ │ │ │ -000e2f20: 6368 756e 6b73 206f 6620 6d65 6d6f 7279 chunks of memory │ │ │ │ -000e2f30: 2c20 7468 6520 746f 7461 6c20 6e75 6d62 , the total numb │ │ │ │ -000e2f40: 6572 206f 6620 6172 7261 7920 656c 656d er of array elem │ │ │ │ -000e2f50: 656e 7473 2073 6574 2062 7920 7468 6520 ents set by the │ │ │ │ -000e2f60: 3c65 6d3e 3c63 6f64 653e 534f 4150 2d45 SOAP-E │ │ │ │ -000e2f70: 4e43 3a61 7272 6179 5479 7065 3c2f 636f NC:arrayType attribu │ │ │ │ -000e2f90: 7465 2063 616e 6e6f 7420 6578 6365 6564 te cannot exceed │ │ │ │ -000e2fa0: 203c 636f 6465 3e23 534f 4150 5f4d 4158 #SOAP_MAX │ │ │ │ -000e2fb0: 4152 5241 5953 495a 453c 2f63 6f64 653e ARRAYSIZE │ │ │ │ -000e2fc0: 2c20 7768 6963 6820 6973 2073 6574 2074 , which is set t │ │ │ │ -000e2fd0: 6f20 3130 3030 3030 2062 7920 6465 6661 o 100000 by defa │ │ │ │ -000e2fe0: 756c 742e 2054 6869 7320 6c69 6d69 7420 ult. This limit │ │ │ │ -000e2ff0: 6973 206e 6f74 2061 2068 6172 6420 6c69 is not a hard li │ │ │ │ -000e3000: 6d69 7420 6f6e 2074 6865 206e 756d 6265 mit on the numbe │ │ │ │ -000e3010: 7220 6f66 2061 7272 6179 2065 6c65 6d65 r of array eleme │ │ │ │ -000e3020: 6e74 732c 2062 7574 2072 6174 6865 7220 nts, but rather │ │ │ │ -000e3030: 746f 2061 766f 6964 2070 7265 2d61 6c6c to avoid pre-all │ │ │ │ -000e3040: 6f63 6174 696e 6720 6c61 7267 6520 6172 ocating large ar │ │ │ │ -000e3050: 7261 7973 2061 7320 7374 6174 6564 2e20 rays as stated. │ │ │ │ -000e3060: 5468 6520 6861 7264 206c 696d 6974 206f The hard limit o │ │ │ │ -000e3070: 6e20 7468 6520 6e75 6d62 6572 206f 6620 n the number of │ │ │ │ -000e3080: 6172 7261 7920 656c 656d 656e 7473 2072 array elements r │ │ │ │ -000e3090: 6563 6569 7665 6420 6973 203c 636f 6465 eceived is soap::m │ │ │ │ -000e3160: 6178 6f63 6375 7273 3c2f 613e 3c2f 636f axoccurs which is set │ │ │ │ -000e3180: 2074 6f20 3c63 6f64 653e 2353 4f41 505f to #SOAP_ │ │ │ │ -000e3190: 4d41 584f 4343 5552 533c 2f63 6f64 653e MAXOCCURS │ │ │ │ -000e31a0: 2062 7920 6465 6661 756c 742e 2042 7920 by default. By │ │ │ │ -000e31b0: 636f 6e74 7261 7374 2c20 7468 6520 3c63 contrast, the #SOAP_MAXARR │ │ │ │ -000e31d0: 4159 5349 5a45 3c2f 636f 6465 3e20 6c69 AYSIZE li │ │ │ │ -000e31e0: 6d69 7420 6f6e 6c79 206e 6567 6174 6976 mit only negativ │ │ │ │ -000e31f0: 656c 7920 6166 6665 6374 7320 6d75 6c74 ely affects mult │ │ │ │ -000e3200: 692d 6469 6d65 6e73 696f 6e61 6c20 6172 i-dimensional ar │ │ │ │ -000e3210: 7261 7973 2062 6563 6175 7365 2074 6865 rays because the │ │ │ │ -000e3220: 2064 696d 656e 7369 6f6e 616c 6974 7920 dimensionality │ │ │ │ -000e3230: 6f66 2074 6865 2072 6563 6569 7669 6e67 of the receiving │ │ │ │ -000e3240: 2061 7272 6179 206d 6179 2062 6520 6c6f array may be lo │ │ │ │ -000e3250: 7374 2077 6865 6e20 7468 6520 6e75 6d62 st when the numb │ │ │ │ -000e3260: 6572 206f 6620 656c 656d 656e 7473 2065 er of elements e │ │ │ │ -000e3270: 7863 6565 6473 2031 3030 3030 302e 204f xceeds 100000. O │ │ │ │ -000e3280: 6e65 2d64 696d 656e 7369 6f6e 616c 2061 ne-dimensional a │ │ │ │ -000e3290: 7272 6179 7320 6172 6520 6e6f 7420 6166 rrays are not af │ │ │ │ -000e32a0: 6665 6374 6564 2061 6e64 2070 6f70 756c fected and popul │ │ │ │ -000e32b0: 6174 6564 2061 6674 6572 2074 6869 7320 ated after this │ │ │ │ -000e32c0: 6c69 6d69 7420 6279 2073 696d 706c 7920 limit by simply │ │ │ │ -000e32d0: 6465 7365 7269 616c 697a 696e 6720 7468 deserializing th │ │ │ │ -000e32e0: 6520 6172 7261 7920 656c 656d 656e 7473 e array elements │ │ │ │ -000e32f0: 2072 6563 6569 7665 642e 3c2f 703e 0a3c received.

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

.

.One-di │ │ │ │ -000e3360: 6d65 6e73 696f 6e61 6c20 6479 6e61 6d69 mensional dynami │ │ │ │ -000e3370: 6320 534f 4150 2d65 6e63 6f64 6564 2061 c SOAP-encoded a │ │ │ │ -000e3380: 7272 6179 733c 2f68 333e 0a3c 703e 4120 rrays

.

A │ │ │ │ -000e3390: 7370 6563 6961 6c20 666f 726d 206f 6620 special form of │ │ │ │ -000e33a0: 7374 7275 6374 206f 7220 636c 6173 7320 struct or class │ │ │ │ -000e33b0: 6973 2075 7365 6420 746f 2064 6566 696e is used to defin │ │ │ │ -000e33c0: 6520 6f6e 652d 6469 6d65 6e73 696f 6e61 e one-dimensiona │ │ │ │ -000e33d0: 6c20 6479 6e61 6d69 6320 534f 4150 2d65 l dynamic SOAP-e │ │ │ │ -000e33e0: 6e63 6f64 6564 2061 7272 6179 7320 696e ncoded arrays in │ │ │ │ -000e33f0: 2061 6e20 696e 7465 7266 6163 6520 6865 an interface he │ │ │ │ -000e3400: 6164 6572 2066 696c 6520 666f 7220 736f ader file for so │ │ │ │ -000e3410: 6170 6370 7032 2e20 4561 6368 2061 7272 apcpp2. Each arr │ │ │ │ -000e3420: 6179 2068 6173 2061 2070 6f69 6e74 6572 ay has a pointer │ │ │ │ -000e3430: 2076 6172 6961 626c 6520 616e 6420 6120 variable and a │ │ │ │ -000e3440: 6d65 6d62 6572 2074 6861 7420 7265 636f member that reco │ │ │ │ -000e3450: 7264 7320 7468 6520 6e75 6d62 6572 206f rds the number o │ │ │ │ -000e3460: 6620 656c 656d 656e 7473 2074 6865 2070 f elements the p │ │ │ │ -000e3470: 6f69 6e74 6572 2070 6f69 6e74 7320 746f ointer points to │ │ │ │ -000e3480: 2069 6e20 6d65 6d6f 7279 2e3c 2f70 3e0a in memory.

. │ │ │ │ -000e3490: 3c70 3e54 6865 2067 656e 6572 616c 2066

The general f │ │ │ │ -000e34a0: 6f72 6d20 6f66 2074 6865 2073 7472 7563 orm of the struc │ │ │ │ -000e34b0: 7420 6f72 2063 6c61 7373 2064 6563 6c61 t or class decla │ │ │ │ -000e34c0: 7261 7469 6f6e 2074 6861 7420 636f 6e74 ration that cont │ │ │ │ -000e34d0: 6169 6e73 2061 206f 6e65 2d64 696d 656e ains a one-dimen │ │ │ │ -000e34e0: 7369 6f6e 616c 2064 796e 616d 6963 2053 sional dynamic S │ │ │ │ -000e34f0: 4f41 502d 656e 636f 6465 6420 6172 7261 OAP-encoded arra │ │ │ │ -000e3500: 7920 6973 3a3c 2f70 3e0a 3c64 6976 2063 y is:

.
│ │ │ │ -000e3520: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
struct < │ │ │ │ -000e3550: 2f73 7061 6e3e 6172 7261 795f 6e61 6d65 /span>array_name │ │ │ │ -000e3560: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
{
.
Type *__ │ │ │ │ -000e35a0: 7074 723b 2020 3c73 7061 6e20 636c 6173 ptr; // p │ │ │ │ -000e35c0: 6f69 6e74 6572 2074 6f20 6172 7261 7920 ointer to array │ │ │ │ -000e35d0: 6f66 2065 6c65 6d65 6e74 7320 696e 206d of elements in m │ │ │ │ -000e35e0: 656d 6f72 793c 2f73 7061 6e3e 3c2f 6469 emory.
int __ │ │ │ │ -000e3630: 7369 7a65 3b20 2020 3c73 7061 6e20 636c size; // │ │ │ │ -000e3650: 206e 756d 6265 7220 6f66 2065 6c65 6d65 number of eleme │ │ │ │ -000e3660: 6e74 7320 706f 696e 7465 6420 746f 203c nts pointed to < │ │ │ │ -000e3670: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
. │ │ │ │ -000e3690: 2020 203c 7370 616e 2063 6c61 7373 3d22 int │ │ │ │ -000e36b0: 3c2f 7370 616e 3e20 5f5f 6f66 6673 6574 __offset │ │ │ │ -000e36c0: 3b20 3c73 7061 6e20 636c 6173 733d 2263 ; // optio │ │ │ │ -000e36e0: 6e61 6c20 534f 4150 2031 2e31 2061 7272 nal SOAP 1.1 arr │ │ │ │ -000e36f0: 6179 206f 6666 7365 743c 2f73 7061 6e3e ay offset │ │ │ │ -000e3700: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
... │ │ │ │ -000e3720: 2020 2020 2020 2020 2020 203c 7370 616e // anything tha │ │ │ │ -000e3750: 7420 666f 6c6c 6f77 7320 6865 7265 2077 t follows here w │ │ │ │ -000e3760: 696c 6c20 6265 2069 676e 6f72 6564 203c ill be ignored < │ │ │ │ -000e3770: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
.} │ │ │ │ -000e3790: 3b3c 2f64 6976 3e0a 3c2f 6469 763e 3c21 ;
.
< │ │ │ │ -000e37b0: 703e 7768 6572 6520 7468 6520 3c63 6f64 p>where the array_name must be a no │ │ │ │ -000e37e0: 6e2d 7175 616c 6966 6965 6420 6e61 6d65 n-qualified name │ │ │ │ -000e37f0: 2061 6e64 203c 636f 6465 3e54 7970 653c and Type< │ │ │ │ -000e3800: 2f63 6f64 653e 2069 7320 7468 6520 7479 /code> is the ty │ │ │ │ -000e3810: 7065 2066 6f72 2074 6865 2065 6c65 6d65 pe for the eleme │ │ │ │ -000e3820: 6e74 7320 6f66 2074 6865 2061 7272 6179 nts of the array │ │ │ │ -000e3830: 2e20 5468 6520 3c63 6f64 653e 5f5f 7074 . The __pt │ │ │ │ -000e3840: 723c 2f63 6f64 653e 206d 656d 6265 7220 r member │ │ │ │ -000e3850: 706f 696e 7473 2074 6f20 7468 6520 6172 points to the ar │ │ │ │ -000e3860: 7261 7920 7661 6c75 6573 2061 6e64 203c ray values and < │ │ │ │ -000e3870: 636f 6465 3e5f 5f73 697a 653c 2f63 6f64 code>__size is the array │ │ │ │ -000e3890: 7369 7a65 2e20 5468 6520 3c63 6f64 653e size. The │ │ │ │ -000e38a0: 5f5f 6f66 6673 6574 3c2f 636f 6465 3e20 __offset │ │ │ │ -000e38b0: 6d65 6d62 6572 2073 7065 6369 6669 6573 member specifies │ │ │ │ -000e38c0: 2061 6e20 6f70 7469 6f6e 616c 2061 7272 an optional arr │ │ │ │ -000e38d0: 6179 206f 6666 7365 742c 2077 6865 6e20 ay offset, when │ │ │ │ -000e38e0: 6e6f 6e7a 6572 6f2c 2073 6565 2053 6563 nonzero, see Sec │ │ │ │ -000e38f0: 7469 6f6e 203c 6120 636c 6173 733d 2265 tion │ │ │ │ -000e3920: 4f6e 652d 6469 6d65 6e73 696f 6e61 6c20 One-dimensional │ │ │ │ -000e3930: 6479 6e61 6d69 6320 534f 4150 2d65 6e63 dynamic SOAP-enc │ │ │ │ -000e3940: 6f64 6564 2061 7272 6179 7320 7769 7468 oded arrays with │ │ │ │ -000e3950: 206e 6f6e 2d7a 6572 6f20 6f66 6673 6574 non-zero offset │ │ │ │ -000e3960: 733c 2f61 3e2e 3c2f 703e 0a3c 703e 4966 s.

.

If │ │ │ │ -000e3970: 2074 6865 203c 636f 6465 3e61 7272 6179 the array │ │ │ │ -000e3980: 5f6e 616d 653c 2f63 6f64 653e 2069 7320 _name is │ │ │ │ -000e3990: 7175 616c 6966 6965 6420 7769 7468 2061 qualified with a │ │ │ │ -000e39a0: 206e 616d 6573 7061 6365 2070 7265 6669 namespace prefi │ │ │ │ -000e39b0: 7820 7468 656e 2074 6865 2061 7272 6179 x then the array │ │ │ │ -000e39c0: 2069 7320 6e6f 7420 6120 534f 4150 2d65 is not a SOAP-e │ │ │ │ -000e39d0: 6e63 6f64 6564 2061 7272 6179 2062 7574 ncoded array but │ │ │ │ -000e39e0: 2072 6174 6865 7220 7265 7072 6573 656e rather represen │ │ │ │ -000e39f0: 7473 2061 2073 6571 7565 6e63 6520 6f66 ts a sequence of │ │ │ │ -000e3a00: 2058 4d4c 2065 6c65 6d65 6e74 732c 2073 XML elements, s │ │ │ │ -000e3a10: 6565 2053 6563 7469 6f6e 203c 6120 636c ee Section │ │ │ │ -000e3a40: 4e6f 6e2d 534f 4150 2064 796e 616d 6963 Non-SOAP dynamic │ │ │ │ -000e3a50: 2061 7272 6179 733c 2f61 3e2e 3c2f 703e arrays.

│ │ │ │ -000e3a60: 0a3c 703e 5468 6520 736f 6170 6370 7032 .

The soapcpp2 │ │ │ │ -000e3a70: 2d67 656e 6572 6174 6564 2064 6573 6572 -generated deser │ │ │ │ -000e3a80: 6961 6c69 7a65 7220 6f66 2061 206f 6e65 ializer of a one │ │ │ │ -000e3a90: 2d64 696d 656e 7369 6f6e 616c 2064 796e -dimensional dyn │ │ │ │ -000e3aa0: 616d 6963 2061 7272 6179 2063 616e 2064 amic array can d │ │ │ │ -000e3ab0: 6573 6572 6961 6c69 7a65 2070 6172 7469 eserialize parti │ │ │ │ -000e3ac0: 616c 6c79 2074 7261 6e73 6d69 7474 6564 ally transmitted │ │ │ │ -000e3ad0: 2061 6e64 2f6f 7220 534f 4150 2d65 6e63 and/or SOAP-enc │ │ │ │ -000e3ae0: 6f64 6564 2073 7061 7273 6520 6172 7261 oded sparse arra │ │ │ │ -000e3af0: 7973 2c20 616e 6420 6576 656e 206d 756c ys, and even mul │ │ │ │ -000e3b00: 7469 2d64 696d 656e 7369 6f6e 616c 2061 ti-dimensional a │ │ │ │ -000e3b10: 7272 6179 7320 7768 6963 6820 7769 6c6c rrays which will │ │ │ │ -000e3b20: 2062 6520 636f 6c6c 6170 7365 6420 696e be collapsed in │ │ │ │ -000e3b30: 746f 2061 206f 6e65 2d64 696d 656e 7369 to a one-dimensi │ │ │ │ -000e3b40: 6f6e 616c 2061 7272 6179 2077 6974 6820 onal array with │ │ │ │ -000e3b50: 726f 772d 6d61 6a6f 7220 6f72 6465 7269 row-major orderi │ │ │ │ -000e3b60: 6e67 2e3c 2f70 3e0a 3c64 6c20 636c 6173 ng.

.
Warning< │ │ │ │ -000e3b90: 2f64 743e 3c64 643e 534f 4150 2031 2e32 /dt>
SOAP 1.2 │ │ │ │ -000e3ba0: 2064 6f65 7320 6e6f 7420 7375 7070 6f72 does not suppor │ │ │ │ -000e3bb0: 7420 7061 7274 6961 6c6c 7920 7472 616e t partially tran │ │ │ │ -000e3bc0: 736d 6974 7465 6420 6172 7261 7973 2061 smitted arrays a │ │ │ │ -000e3bd0: 6e64 2074 6865 203c 636f 6465 3e5f 5f6f nd the __o │ │ │ │ -000e3be0: 6666 7365 743c 2f63 6f64 653e 206d 656d ffset mem │ │ │ │ -000e3bf0: 6265 7220 6f66 2061 2064 796e 616d 6963 ber of a dynamic │ │ │ │ -000e3c00: 2061 7272 6179 2069 7320 6967 6e6f 7265 array is ignore │ │ │ │ -000e3c10: 642e 3c2f 6464 3e3c 2f64 6c3e 0a3c 703e d.
.

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

.On │ │ │ │ -000e3c80: 652d 6469 6d65 6e73 696f 6e61 6c20 6479 e-dimensional dy │ │ │ │ -000e3c90: 6e61 6d69 6320 534f 4150 2d65 6e63 6f64 namic SOAP-encod │ │ │ │ -000e3ca0: 6564 2061 7272 6179 7320 7769 7468 206e ed arrays with n │ │ │ │ -000e3cb0: 6f6e 2d7a 6572 6f20 6f66 6673 6574 733c on-zero offsets< │ │ │ │ -000e3cc0: 2f68 333e 0a3c 703e 5468 6520 6465 636c /h3>.

The decl │ │ │ │ -000e3cd0: 6172 6174 696f 6e20 6f66 2061 2064 796e aration of a dyn │ │ │ │ -000e3ce0: 616d 6963 2061 7272 6179 2061 7320 6465 amic array as de │ │ │ │ -000e3cf0: 7363 7269 6265 6420 696e 2053 6563 7469 scribed in Secti │ │ │ │ -000e3d00: 6f6e 203c 6120 636c 6173 733d 2265 6c22 on One-dime │ │ │ │ -000e3d30: 6e73 696f 6e61 6c20 6479 6e61 6d69 6320 nsional dynamic │ │ │ │ -000e3d40: 534f 4150 2d65 6e63 6f64 6564 2061 7272 SOAP-encoded arr │ │ │ │ -000e3d50: 6179 733c 2f61 3e20 6d61 7920 696e 636c ays may incl │ │ │ │ -000e3d60: 7564 6520 616e 203c 636f 6465 3e69 6e74 ude an int │ │ │ │ -000e3d70: 205f 5f6f 6666 7365 743c 2f63 6f64 653e __offset │ │ │ │ -000e3d80: 206d 656d 6265 722e 2057 6865 6e20 7365 member. When se │ │ │ │ -000e3d90: 7420 746f 2061 6e20 696e 7465 6765 7220 t to an integer │ │ │ │ -000e3da0: 7661 6c75 652c 2074 6865 2073 6572 6961 value, the seria │ │ │ │ -000e3db0: 6c69 7a65 7220 6f66 2074 6865 2064 796e lizer of the dyn │ │ │ │ -000e3dc0: 616d 6963 2061 7272 6179 2077 696c 6c20 amic array will │ │ │ │ -000e3dd0: 7573 6520 7468 6973 206d 656d 6265 7220 use this member │ │ │ │ -000e3de0: 6173 2074 6865 2073 7461 7274 2069 6e64 as the start ind │ │ │ │ -000e3df0: 6578 206f 6620 7468 6520 6172 7261 7920 ex of the array │ │ │ │ -000e3e00: 616e 6420 7468 6520 534f 4150 2d65 6e63 and the SOAP-enc │ │ │ │ -000e3e10: 6f64 6564 2061 7272 6179 206f 6666 7365 oded array offse │ │ │ │ -000e3e20: 7420 6174 7472 6962 7574 6520 3c65 6d3e t attribute │ │ │ │ -000e3e30: 3c63 6f64 653e 534f 4150 2d45 4e43 3a6f SOAP-ENC:o │ │ │ │ -000e3e40: 6666 7365 743c 2f63 6f64 653e 3c2f 656d ffset will appear in │ │ │ │ -000e3e60: 2074 6865 2058 4d4c 206d 6573 7361 6765 the XML message │ │ │ │ -000e3e70: 2e20 4e6f 7465 2074 6861 7420 6172 7261 . Note that arra │ │ │ │ -000e3e80: 7920 6f66 6673 6574 7320 6973 2061 2053 y offsets is a S │ │ │ │ -000e3e90: 4f41 5020 312e 3120 7370 6563 6966 6963 OAP 1.1 specific │ │ │ │ -000e3ea0: 2066 6561 7475 7265 2077 6869 6368 2069 feature which i │ │ │ │ -000e3eb0: 7320 6e6f 7420 7375 7070 6f72 7465 6420 s not supported │ │ │ │ -000e3ec0: 696e 2053 4f41 5020 312e 322e 3c2f 703e in SOAP 1.2.

│ │ │ │ -000e3ed0: 0a3c 703e 466f 7220 6578 616d 706c 652c .

For example, │ │ │ │ -000e3ee0: 2074 6865 2066 6f6c 6c6f 7769 6e67 2068 the following h │ │ │ │ -000e3ef0: 6561 6465 7220 6669 6c65 2064 6563 6c61 eader file decla │ │ │ │ -000e3f00: 7265 7320 6120 6e75 6d65 7269 6320 3c63 res a numeric Vector class, which i │ │ │ │ -000e3f30: 7320 6120 6479 6e61 6d69 6320 6172 7261 s a dynamic arra │ │ │ │ -000e3f40: 7920 6f66 2066 6c6f 6174 696e 6720 706f y of floating po │ │ │ │ -000e3f50: 696e 7420 7661 6c75 6573 2077 6974 6820 int values with │ │ │ │ -000e3f60: 616e 2069 6e64 6578 2074 6861 7420 7374 an index that st │ │ │ │ -000e3f70: 6172 7473 2061 7420 313a 3c2f 703e 0a3c arts at 1:

.< │ │ │ │ -000e3f80: 6469 7620 636c 6173 733d 2266 7261 676d div class="fragm │ │ │ │ -000e3f90: 656e 7422 3e3c 6469 7620 636c 6173 733d ent">
// │ │ │ │ -000e3fc0: 436f 6e74 656e 7473 206f 6620 6669 6c65 Contents of file │ │ │ │ -000e3fd0: 2026 7175 6f74 3b76 6563 746f 722e 6826 "vector.h& │ │ │ │ -000e3fe0: 7175 6f74 3b3a 203c 2f73 7061 6e3e 3c2f quot;: .
cla │ │ │ │ -000e4020: 7373 203c 2f73 7061 6e3e 5665 6374 6f72 ss Vector │ │ │ │ -000e4030: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
{ public: │ │ │ │ -000e4070: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
float *__ptr; .
int __ │ │ │ │ -000e4100: 7369 7a65 3b20 3c2f 6469 763e 0a3c 6469 size;
. │ │ │ │ -000e4120: 2020 203c 7370 616e 2063 6c61 7373 3d22 int │ │ │ │ -000e4140: 3c2f 7370 616e 3e20 5f5f 6f66 6673 6574 __offset │ │ │ │ -000e4150: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
V │ │ │ │ -000e4170: 6563 746f 7228 293b 3c2f 6469 763e 0a3c ector();
.< │ │ │ │ -000e4180: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -000e4190: 3e20 2020 2056 6563 746f 7228 3c73 7061 > Vector(struct │ │ │ │ -000e41c0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap │ │ │ │ -000e41f0: 2a2c 203c 7370 616e 2063 6c61 7373 3d22 *, int │ │ │ │ -000e4210: 3c2f 7370 616e 3e20 6e29 3b3c 2f64 6976 n);
.
float&a │ │ │ │ -000e4260: 6d70 3b20 6f70 6572 6174 6f72 5b5d 283c mp; operator[](< │ │ │ │ -000e4270: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -000e4280: 6f72 6474 7970 6522 3e69 6e74 3c2f 7370 ordtype">int i);
.< │ │ │ │ -000e42a0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -000e42b0: 3e20 2020 203c 7370 616e 2063 6c61 7373 > struc │ │ │ │ -000e42d0: 7420 3c2f 7370 616e 3e3c 6120 636c 6173 t │ │ │ │ -000e4300: 736f 6170 3c2f 613e 202a 3c61 2063 6c61 soap *soap;.
};
.

The impl │ │ │ │ -000e43a0: 656d 656e 7461 7469 6f6e 7320 6f66 2074 ementations of t │ │ │ │ -000e43b0: 6865 203c 636f 6465 3e56 6563 746f 723c he Vector< │ │ │ │ -000e43c0: 2f63 6f64 653e 206d 6574 686f 6473 2061 /code> methods a │ │ │ │ -000e43d0: 7265 3a3c 2f70 3e0a 3c64 6976 2063 6c61 re:

.
│ │ │ │ -000e4400: 5665 6374 6f72 3a3a 5665 6374 6f72 2829 Vector::Vector() │ │ │ │ -000e4410: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
{
│ │ │ │ -000e4430: 0a3c 6469 7620 636c 6173 733d 226c 696e .
this->so │ │ │ │ -000e4450: 6170 5f64 6566 6175 6c74 284e 554c 4c29 ap_default(NULL) │ │ │ │ -000e4460: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
.
}
.
Vector::Vect │ │ │ │ -000e44a0: 6f72 283c 7370 616e 2063 6c61 7373 3d22 or(struct< │ │ │ │ -000e44c0: 2f73 7061 6e3e 203c 6120 636c 6173 733d /span> so │ │ │ │ -000e44f0: 6170 3c2f 613e 202a 3c61 2063 6c61 7373 ap *s │ │ │ │ -000e4520: 6f61 703c 2f61 3e2c 203c 7370 616e 2063 oap, int n) │ │ │ │ -000e4550: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
{
.
this->s │ │ │ │ -000e4590: 6f61 7020 3d20 3c61 2063 6c61 7373 3d22 oap = s │ │ │ │ -000e45e0: 6f61 703c 2f61 3e3b 3c2f 6469 763e 0a3c oap;
.< │ │ │ │ -000e45f0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -000e4600: 3e20 205f 5f70 7472 203d 2073 6f61 705f > __ptr = soap_ │ │ │ │ -000e4610: 6e65 775f 666c 6f61 7428 3c61 2063 6c61 new_float(soap, n); < │ │ │ │ -000e4650: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
__size │ │ │ │ -000e4670: 203d 206e 3b20 3c2f 6469 763e 0a3c 6469 = n;
. │ │ │ │ -000e4690: 205f 5f6f 6666 7365 7420 3d20 313b 203c __offset = 1; < │ │ │ │ -000e46a0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
}
│ │ │ │ -000e46c0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
flo │ │ │ │ -000e46f0: 6174 3c2f 7370 616e 3e26 616d 703b 2056 at& V │ │ │ │ -000e4700: 6563 746f 723a 3a6f 7065 7261 746f 725b ector::operator[ │ │ │ │ -000e4710: 5d28 3c73 7061 6e20 636c 6173 733d 226b ](int< │ │ │ │ -000e4730: 2f73 7061 6e3e 2069 2920 3c2f 6469 763e /span> i)
│ │ │ │ -000e4740: 0a3c 6469 7620 636c 6173 733d 226c 696e .
{
.
< │ │ │ │ -000e4770: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -000e4780: 6f72 6466 6c6f 7722 3e72 6574 7572 6e3c ordflow">return< │ │ │ │ -000e4790: 2f73 7061 6e3e 205f 5f70 7472 5b69 202d /span> __ptr[i - │ │ │ │ -000e47a0: 205f 5f6f 6666 7365 745d 3b20 3c2f 6469 __offset]; .
}
.

An exampl │ │ │ │ -000e47f0: 6520 7072 6f67 7261 6d20 6672 6167 6d65 e program fragme │ │ │ │ -000e4800: 6e74 2074 6861 7420 7365 7269 616c 697a nt that serializ │ │ │ │ -000e4810: 6573 2061 2076 6563 746f 7220 6f66 2033 es a vector of 3 │ │ │ │ -000e4820: 2065 6c65 6d65 6e74 733a 3c2f 703e 0a3c elements:

.< │ │ │ │ -000e4830: 6469 7620 636c 6173 733d 2266 7261 676d div class="fragm │ │ │ │ -000e4840: 656e 7422 3e3c 6469 7620 636c 6173 733d ent">
str │ │ │ │ -000e4870: 7563 7420 3c2f 7370 616e 3e3c 6120 636c uct soap *soap = soap_new( │ │ │ │ -000e4940: 293b 203c 2f64 6976 3e0a 3c64 6976 2063 );
.
Vect │ │ │ │ -000e4960: 6f72 2076 283c 6120 636c 6173 733d 2263 or v(soap │ │ │ │ -000e4990: 3c2f 613e 2c20 3329 3b3c 2f64 6976 3e0a , 3);
. │ │ │ │ -000e49a0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
v[1] = 1.0; .
v[2] = 2. │ │ │ │ -000e49e0: 303b 203c 2f64 6976 3e0a 3c64 6976 2063 0;
.
v[3] │ │ │ │ -000e4a00: 203d 2033 2e30 3b20 3c2f 6469 763e 0a3c = 3.0;
.< │ │ │ │ -000e4a10: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -000e4a20: 3e73 6f61 705f 7772 6974 655f 5665 6374 >soap_write_Vect │ │ │ │ -000e4a30: 6f72 283c 6120 636c 6173 733d 2263 6f64 or(soap, &v);..

The output │ │ │ │ -000e4ca0: 2069 7320 6120 7061 7274 6961 6c6c 7920 is a partially │ │ │ │ -000e4cb0: 7472 616e 736d 6974 7465 6420 6172 7261 transmitted arra │ │ │ │ -000e4cc0: 793a 3c2f 703e 0a3c 6469 7620 636c 6173 y:

.
< │ │ │ │ -000e4cf0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -000e4d00: 3e26 6c74 3b3c 7370 616e 2063 6c61 7373 ><S │ │ │ │ -000e4d20: 4f41 502d 454e 433a 4172 7261 793c 2f73 OAP-ENC:Array SOAP- │ │ │ │ -000e4d50: 454e 433a 6172 7261 7954 7970 653c 2f73 ENC:arrayType="xsd:float │ │ │ │ -000e4d90: 5b34 5d26 7175 6f74 3b3c 2f73 7061 6e3e [4]" │ │ │ │ -000e4da0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 SOAP-ENC: │ │ │ │ -000e4dc0: 6f66 6673 6574 3c2f 7370 616e 3e3d 3c73 offset=" │ │ │ │ -000e4df0: 5b31 5d26 7175 6f74 3b3c 2f73 7061 6e3e [1]" │ │ │ │ -000e4e00: 2667 743b 203c 2f64 6976 3e0a 3c64 6976 >
.
│ │ │ │ -000e4e20: 266c 743b 3c73 7061 6e20 636c 6173 733d <it │ │ │ │ -000e4e40: 656d 3c2f 7370 616e 3e26 6774 3b31 266c em>1&l │ │ │ │ -000e4e50: 743b 2f3c 7370 616e 2063 6c61 7373 3d22 t;/ite │ │ │ │ -000e4e70: 6d3c 2f73 7061 6e3e 2667 743b 203c 2f64 m> .
<item>2</item │ │ │ │ -000e4ef0: 2667 743b 203c 2f64 6976 3e0a 3c64 6976 >
.
│ │ │ │ -000e4f10: 266c 743b 3c73 7061 6e20 636c 6173 733d <it │ │ │ │ -000e4f30: 656d 3c2f 7370 616e 3e26 6774 3b33 266c em>3&l │ │ │ │ -000e4f40: 743b 2f3c 7370 616e 2063 6c61 7373 3d22 t;/ite │ │ │ │ -000e4f60: 6d3c 2f73 7061 6e3e 2667 743b 203c 2f64 m> .
</SOAP-ENC:Ar │ │ │ │ -000e4fb0: 7261 793c 2f73 7061 6e3e 2667 743b 3c2f ray>.

Note that │ │ │ │ -000e4ff0: 3c65 6d3e 3c63 6f64 653e 7873 643a 666c xsd:fl │ │ │ │ -000e5000: 6f61 745b 345d 3c2f 636f 6465 3e3c 2f65 oat[4] is the type a │ │ │ │ -000e5020: 6e64 2073 6861 7065 206f 6620 7468 6520 nd shape of the │ │ │ │ -000e5030: 656e 636f 6465 6420 6172 7261 792c 2077 encoded array, w │ │ │ │ -000e5040: 6869 6368 2073 7461 7274 7320 6174 206f hich starts at o │ │ │ │ -000e5050: 6666 7365 7420 3120 616e 6420 7468 6572 ffset 1 and ther │ │ │ │ -000e5060: 6566 6f72 6520 7468 6520 656c 656d 656e efore the elemen │ │ │ │ -000e5070: 7420 6174 2030 2069 7320 6f6d 6974 7465 t at 0 is omitte │ │ │ │ -000e5080: 642e 3c2f 703e 0a3c 703e f09f 949d 203c d.

.

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

.

< │ │ │ │ -000e50e0: 2f61 3e0a 4e65 7374 6564 206f 6e65 2d64 /a>.Nested one-d │ │ │ │ -000e50f0: 696d 656e 7369 6f6e 616c 2064 796e 616d imensional dynam │ │ │ │ -000e5100: 6963 2053 4f41 502d 656e 636f 6465 6420 ic SOAP-encoded │ │ │ │ -000e5110: 6172 7261 7973 3c2f 6833 3e0a 3c70 3e4f arrays

.

O │ │ │ │ -000e5120: 6e65 2d64 696d 656e 7369 6f6e 616c 2053 ne-dimensional S │ │ │ │ -000e5130: 4f41 502d 656e 636f 6465 6420 6479 6e61 OAP-encoded dyna │ │ │ │ -000e5140: 6d69 6320 6172 7261 7973 206d 6179 2062 mic arrays may b │ │ │ │ -000e5150: 6520 6e65 7374 6564 2e20 466f 7220 6578 e nested. For ex │ │ │ │ -000e5160: 616d 706c 652c 2075 7369 6e67 203c 636f ample, using class Vector< │ │ │ │ -000e5180: 2f63 6f64 653e 2064 6563 6c61 7265 6420 /code> declared │ │ │ │ -000e5190: 696e 2074 6865 2070 7265 7669 6f75 7320 in the previous │ │ │ │ -000e51a0: 7365 6374 696f 6e2c 203c 636f 6465 3e63 section, c │ │ │ │ -000e51b0: 6c61 7373 204d 6174 7269 783c 2f63 6f64 lass Matrix is declared:< │ │ │ │ -000e51d0: 2f70 3e0a 3c64 6976 2063 6c61 7373 3d22 /p>.

// Contents of │ │ │ │ -000e5220: 2066 696c 6520 2671 756f 743b 6d61 7472 file "matr │ │ │ │ -000e5230: 6978 2e68 2671 756f 743b 3a20 3c2f 7370 ix.h":
.
class M │ │ │ │ -000e5280: 6174 7269 7820 3c2f 6469 763e 0a3c 6469 atrix
.{ │ │ │ │ -000e52a0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 public
:
. │ │ │ │ -000e52e0: 2020 2056 6563 746f 7220 2a5f 5f70 7472 Vector *__ptr │ │ │ │ -000e52f0: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
< │ │ │ │ -000e5310: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -000e5320: 6f72 6474 7970 6522 3e69 6e74 3c2f 7370 ordtype">int __size; .
int __ │ │ │ │ -000e5380: 6f66 6673 6574 3b20 3c2f 6469 763e 0a3c offset;
.< │ │ │ │ -000e5390: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -000e53a0: 3e20 2020 204d 6174 7269 7828 293b 203c > Matrix(); < │ │ │ │ -000e53b0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ -000e54b0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
Vector&am │ │ │ │ -000e54d0: 703b 206f 7065 7261 746f 725b 5d28 3c73 p; operator[](int i);
. │ │ │ │ -000e5520: 2020 2020 3c73 7061 6e20 636c 6173 733d struct │ │ │ │ -000e5540: 203c 2f73 7061 6e3e 3c61 2063 6c61 7373 s │ │ │ │ -000e5570: 6f61 703c 2f61 3e20 2a3c 6120 636c 6173 oap *soap;
.
};
.

The Matr │ │ │ │ -000e5610: 6978 2074 7970 6520 6973 2065 7373 656e ix type is essen │ │ │ │ -000e5620: 7469 616c 6c79 2061 6e20 6172 7261 7920 tially an array │ │ │ │ -000e5630: 6f66 2070 6f69 6e74 6572 7320 746f 2061 of pointers to a │ │ │ │ -000e5640: 7272 6179 7320 7768 6963 6820 6d61 6b65 rrays which make │ │ │ │ -000e5650: 2075 7020 7468 6520 726f 7773 206f 6620 up the rows of │ │ │ │ -000e5660: 6120 6d61 7472 6978 2e20 5468 6520 7365 a matrix. The se │ │ │ │ -000e5670: 7269 616c 697a 6174 696f 6e20 6f66 2074 rialization of t │ │ │ │ -000e5680: 6865 2074 776f 2d64 696d 656e 7369 6f6e he two-dimension │ │ │ │ -000e5690: 616c 2064 796e 616d 6963 2061 7272 6179 al dynamic array │ │ │ │ -000e56a0: 2069 6e20 6973 206e 6573 7465 6420 666f in is nested fo │ │ │ │ -000e56b0: 726d 2069 6e20 584d 4c2e 3c2f 703e 0a3c rm in XML.

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

.

.Mult │ │ │ │ -000e5720: 692d 6469 6d65 6e73 696f 6e61 6c20 6479 i-dimensional dy │ │ │ │ -000e5730: 6e61 6d69 6320 534f 4150 2d65 6e63 6f64 namic SOAP-encod │ │ │ │ -000e5740: 6564 2061 7272 6179 733c 2f68 333e 0a3c ed arrays

.< │ │ │ │ -000e5750: 703e 4120 7370 6563 6961 6c20 666f 726d p>A special form │ │ │ │ -000e5760: 206f 6620 3c63 6f64 653e 7374 7275 6374 of struct │ │ │ │ -000e5770: 3c2f 636f 6465 3e20 6f72 203c 636f 6465 or class is │ │ │ │ -000e5790: 2075 7365 6420 746f 2064 6566 696e 6520 used to define │ │ │ │ -000e57a0: 6d75 6c74 692d 6469 6d65 6e73 696f 6e61 multi-dimensiona │ │ │ │ -000e57b0: 6c20 6479 6e61 6d69 6320 534f 4150 2d65 l dynamic SOAP-e │ │ │ │ -000e57c0: 6e63 6f64 6564 2061 7272 6179 732e 2045 ncoded arrays. E │ │ │ │ -000e57d0: 6163 6820 6172 7261 7920 6861 7320 6120 ach array has a │ │ │ │ -000e57e0: 706f 696e 7465 7220 7661 7269 6162 6c65 pointer variable │ │ │ │ -000e57f0: 2061 6e64 2061 206d 656d 6265 7220 7468 and a member th │ │ │ │ -000e5800: 6174 2072 6563 6f72 6473 2074 6865 206e at records the n │ │ │ │ -000e5810: 756d 6265 7220 6f66 2065 6c65 6d65 6e74 umber of element │ │ │ │ -000e5820: 7320 7065 7220 6469 6d65 6e73 696f 6e2e s per dimension. │ │ │ │ -000e5830: 2041 203c 636f 6465 3e4b 3c2f 636f 6465 A K-dimensional ar │ │ │ │ -000e5850: 7261 7920 6973 2064 6563 6c61 7265 6420 ray is declared │ │ │ │ -000e5860: 6173 3a3c 2f70 3e0a 3c64 6976 2063 6c61 as:

.
│ │ │ │ -000e5890: 3c73 7061 6e20 636c 6173 733d 226b 6579 struct array_name < │ │ │ │ -000e58c0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
{
. │ │ │ │ -000e58e0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
Type *__pt │ │ │ │ -000e5900: 723b 2020 2020 203c 7370 616e 2063 6c61 r; // │ │ │ │ -000e5920: 706f 696e 7465 7220 746f 2061 7272 6179 pointer to array │ │ │ │ -000e5930: 206f 6620 656c 656d 656e 7473 2069 6e20 of elements in │ │ │ │ -000e5940: 6d65 6d6f 7279 3c2f 7370 616e 3e3c 2f64 memory.
int _ │ │ │ │ -000e5990: 5f73 697a 655b 4b5d 3b20 2020 3c73 7061 _size[K]; // number of e │ │ │ │ -000e59c0: 6c65 6d65 6e74 7320 7065 7220 6469 6d65 lements per dime │ │ │ │ -000e59d0: 6e73 696f 6e3c 2f73 7061 6e3e 3c2f 6469 nsion.
int __ │ │ │ │ -000e5a20: 6f66 6673 6574 5b4b 5d3b 203c 7370 616e offset[K]; // optional SOA │ │ │ │ -000e5a50: 5020 312e 3120 6172 7261 7920 6f66 6673 P 1.1 array offs │ │ │ │ -000e5a60: 6574 3c2f 7370 616e 3e3c 2f64 6976 3e0a et
. │ │ │ │ -000e5a70: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
... │ │ │ │ -000e5a90: 2020 2020 2020 203c 7370 616e 2063 6c61 // │ │ │ │ -000e5ab0: 616e 7974 6869 6e67 2074 6861 7420 666f anything that fo │ │ │ │ -000e5ac0: 6c6c 6f77 7320 6865 7265 2077 696c 6c20 llows here will │ │ │ │ -000e5ad0: 6265 2069 676e 6f72 6564 203c 2f73 7061 be ignored
.
};.

wh │ │ │ │ -000e5b20: 6572 6520 7468 6520 3c63 6f64 653e 6172 ere the ar │ │ │ │ -000e5b30: 7261 795f 6e61 6d65 3c2f 636f 6465 3e20 ray_name │ │ │ │ -000e5b40: 6d75 7374 2062 6520 6120 6e6f 6e2d 7175 must be a non-qu │ │ │ │ -000e5b50: 616c 6966 6965 6420 6e61 6d65 2061 6e64 alified name and │ │ │ │ -000e5b60: 203c 636f 6465 3e54 7970 653c 2f63 6f64 Type is the type f │ │ │ │ -000e5b80: 6f72 2074 6865 2065 6c65 6d65 6e74 7320 or the elements │ │ │ │ -000e5b90: 6f66 2074 6865 2061 7272 6179 2e20 5468 of the array. Th │ │ │ │ -000e5ba0: 6520 3c63 6f64 653e 5f5f 7074 723c 2f63 e __ptr member poin │ │ │ │ -000e5bc0: 7473 2074 6f20 7468 6520 6172 7261 7920 ts to the array │ │ │ │ -000e5bd0: 7661 6c75 6573 2e20 5468 6520 3c63 6f64 values. The __size │ │ │ │ -000e5bf0: 6172 7261 7920 7370 6563 6966 6965 7320 array specifies │ │ │ │ -000e5c00: 7468 6520 6e75 6d62 6572 206f 6620 6172 the number of ar │ │ │ │ -000e5c10: 7261 7920 656c 656d 656e 7473 2070 6572 ray elements per │ │ │ │ -000e5c20: 2064 696d 656e 7369 6f6e 2e20 5468 6520 dimension. The │ │ │ │ -000e5c30: 3c63 6f64 653e 5f5f 6f66 6673 6574 3c2f __offset array spec │ │ │ │ -000e5c50: 6966 6965 7320 616e 206f 7074 696f 6e61 ifies an optiona │ │ │ │ -000e5c60: 6c20 6f66 6673 6574 2070 6572 2064 696d l offset per dim │ │ │ │ -000e5c70: 656e 7369 6f6e 2e3c 2f70 3e0a 3c70 3e46 ension.

.

F │ │ │ │ -000e5c80: 6f72 2065 7861 6d70 6c65 2c20 7468 6520 or example, the │ │ │ │ -000e5c90: 666f 6c6c 6f77 696e 6720 6465 636c 6172 following declar │ │ │ │ -000e5ca0: 6174 696f 6e20 7370 6563 6966 6965 7320 ation specifies │ │ │ │ -000e5cb0: 6120 6d61 7472 6978 2063 6c61 7373 3a3c a matrix class:< │ │ │ │ -000e5cc0: 2f70 3e0a 3c64 6976 2063 6c61 7373 3d22 /p>.

class M │ │ │ │ -000e5d10: 6174 7269 7820 3c2f 6469 763e 0a3c 6469 atrix
.{ │ │ │ │ -000e5d30: 203c 7370 616e 2063 6c61 7373 3d22 6b65 public:
. │ │ │ │ -000e5d70: 2020 203c 7370 616e 2063 6c61 7373 3d22 flo │ │ │ │ -000e5d90: 6174 3c2f 7370 616e 3e20 2a5f 5f70 7472 at *__ptr │ │ │ │ -000e5da0: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
< │ │ │ │ -000e5dc0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -000e5dd0: 6f72 6474 7970 6522 3e69 6e74 3c2f 7370 ordtype">int __size[2]; < │ │ │ │ -000e5df0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
int │ │ │ │ -000e5e30: 205f 5f6f 6666 7365 745b 325d 3b20 3c2f __offset[2]; .
};
│ │ │ │ -000e5e60: 0a3c 2f64 6976 3e3c 212d 2d20 6672 6167 .

By co │ │ │ │ -000e5e80: 6e74 7261 7374 2074 6f20 7468 6520 6d61 ntrast to the ma │ │ │ │ -000e5e90: 7472 6978 2063 6c61 7373 206f 6620 5365 trix class of Se │ │ │ │ -000e5ea0: 6374 696f 6e20 3c61 2063 6c61 7373 3d22 ction Nes │ │ │ │ -000e5ed0: 7465 6420 6f6e 652d 6469 6d65 6e73 696f ted one-dimensio │ │ │ │ -000e5ee0: 6e61 6c20 6479 6e61 6d69 6320 534f 4150 nal dynamic SOAP │ │ │ │ -000e5ef0: 2d65 6e63 6f64 6564 2061 7272 6179 733c -encoded arrays< │ │ │ │ -000e5f00: 2f61 3e20 7468 6174 2064 6566 696e 6573 /a> that defines │ │ │ │ -000e5f10: 2061 206d 6174 7269 7820 6173 2061 6e20 a matrix as an │ │ │ │ -000e5f20: 6172 7261 7920 6f66 2070 6f69 6e74 6572 array of pointer │ │ │ │ -000e5f30: 7320 746f 206d 6174 7269 7820 726f 7773 s to matrix rows │ │ │ │ -000e5f40: 2c20 7468 6973 2063 6c61 7373 2068 6173 , this class has │ │ │ │ -000e5f50: 206f 6e65 2070 6f69 6e74 6572 2074 6f20 one pointer to │ │ │ │ -000e5f60: 6120 6d61 7472 6978 2073 746f 7265 6420 a matrix stored │ │ │ │ -000e5f70: 696e 2072 6f77 2d6d 616a 6f72 206f 7264 in row-major ord │ │ │ │ -000e5f80: 6572 2e20 5468 6520 7369 7a65 206f 6620 er. The size of │ │ │ │ -000e5f90: 7468 6520 6d61 7472 6978 2069 7320 6465 the matrix is de │ │ │ │ -000e5fa0: 7465 726d 696e 6564 2062 7920 7468 6520 termined by the │ │ │ │ -000e5fb0: 3c63 6f64 653e 5f5f 7369 7a65 3c2f 636f __size member: __size[0] holds the num │ │ │ │ -000e5ff0: 6265 7220 6f66 2072 6f77 7320 616e 6420 ber of rows and │ │ │ │ -000e6000: 3c63 6f64 653e 5f5f 7369 7a65 5b31 5d3c __size[1]< │ │ │ │ -000e6010: 2f63 6f64 653e 2068 6f6c 6473 2074 6865 /code> holds the │ │ │ │ -000e6020: 206e 756d 6265 7220 6f66 2063 6f6c 756d number of colum │ │ │ │ -000e6030: 6e73 206f 6620 7468 6520 6d61 7472 6978 ns of the matrix │ │ │ │ -000e6040: 2e20 4c69 6b65 7769 7365 2c20 3c63 6f64 . Likewise, __offset[0] is the row │ │ │ │ -000e6070: 6f66 6673 6574 2061 6e64 203c 636f 6465 offset and __offset[1] is the colum │ │ │ │ -000e60a0: 6e73 206f 6666 7365 742e 3c2f 703e 0a3c ns offset.

.< │ │ │ │ -000e60b0: 646c 2063 6c61 7373 3d22 7365 6374 696f dl class="sectio │ │ │ │ -000e60c0: 6e20 7761 726e 696e 6722 3e3c 6474 3e57 n warning">
W │ │ │ │ -000e60d0: 6172 6e69 6e67 3c2f 6474 3e3c 6464 3e53 arning
S │ │ │ │ -000e60e0: 4f41 5020 312e 3220 646f 6573 206e 6f74 OAP 1.2 does not │ │ │ │ -000e60f0: 2073 7570 706f 7274 2070 6172 7469 616c support partial │ │ │ │ -000e6100: 6c79 2074 7261 6e73 6d69 7474 6564 2061 ly transmitted a │ │ │ │ -000e6110: 7272 6179 7320 616e 6420 7468 6520 3c63 rrays and the __offset member of a │ │ │ │ -000e6140: 6479 6e61 6d69 6320 6172 7261 7920 6973 dynamic array is │ │ │ │ -000e6150: 2069 676e 6f72 6564 2e3c 2f64 643e 3c2f ignored.
.

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

.

.N │ │ │ │ -000e61c0: 6f6e 2d53 4f41 5020 6479 6e61 6d69 6320 on-SOAP dynamic │ │ │ │ -000e61d0: 6172 7261 7973 3c2f 6833 3e0a 3c70 3e41 arrays

.

A │ │ │ │ -000e61e0: 6e20 6172 7261 7920 6973 2073 6572 6961 n array is seria │ │ │ │ -000e61f0: 6c69 7a65 6420 6173 2061 2073 6571 7565 lized as a seque │ │ │ │ -000e6200: 6e63 6520 6f66 2058 4d4c 2065 6c65 6d65 nce of XML eleme │ │ │ │ -000e6210: 6e74 732e 2042 7920 636f 6e74 7261 7374 nts. By contrast │ │ │ │ -000e6220: 2c20 6120 534f 4150 2d65 6e63 6f64 6564 , a SOAP-encoded │ │ │ │ -000e6230: 2061 7272 6179 2069 7320 7365 7269 616c array is serial │ │ │ │ -000e6240: 697a 6564 2061 7320 616e 2065 6c65 6d65 ized as an eleme │ │ │ │ -000e6250: 6e74 2077 6974 6820 6120 7365 7175 656e nt with a sequen │ │ │ │ -000e6260: 6365 206f 6620 7375 622d 656c 656d 656e ce of sub-elemen │ │ │ │ -000e6270: 7473 2c20 7768 6f73 6520 7461 6720 6e61 ts, whose tag na │ │ │ │ -000e6280: 6d65 7320 6172 6520 6972 7265 6c65 7661 mes are irreleva │ │ │ │ -000e6290: 6e74 2074 6f20 7468 6520 534f 4150 2070 nt to the SOAP p │ │ │ │ -000e62a0: 726f 6365 7373 6f72 2c20 7365 6520 3c61 rocessor, see One-dimension │ │ │ │ -000e62e0: 616c 2064 796e 616d 6963 2053 4f41 502d al dynamic SOAP- │ │ │ │ -000e62f0: 656e 636f 6465 6420 6172 7261 7973 3c2f encoded arrays.

.

An ar │ │ │ │ -000e6310: 7261 7920 6973 2064 6563 6c61 7265 6420 ray is declared │ │ │ │ -000e6320: 696e 2061 6e20 696e 7465 7266 6163 6520 in an interface │ │ │ │ -000e6330: 6865 6164 6572 2066 696c 6520 666f 7220 header file for │ │ │ │ -000e6340: 736f 6170 6370 7032 2061 7320 6120 7374 soapcpp2 as a st │ │ │ │ -000e6350: 7275 6374 206f 7220 636c 6173 7320 7769 ruct or class wi │ │ │ │ -000e6360: 7468 2061 206e 616d 6520 7468 6174 2069 th a name that i │ │ │ │ -000e6370: 7320 7175 616c 6966 6965 6420 7769 7468 s qualified with │ │ │ │ -000e6380: 2061 206e 616d 6573 7061 6365 2070 7265 a namespace pre │ │ │ │ -000e6390: 6669 782e 2054 6865 7265 2061 7265 2074 fix. There are t │ │ │ │ -000e63a0: 776f 2066 6f72 6d73 2e20 5468 6520 6669 wo forms. The fi │ │ │ │ -000e63b0: 7273 7420 666f 726d 2069 7320 7369 6d69 rst form is simi │ │ │ │ -000e63c0: 6c61 7220 746f 2074 6865 2053 4f41 502d lar to the SOAP- │ │ │ │ -000e63d0: 656e 636f 6465 6420 6172 7261 7920 6465 encoded array de │ │ │ │ -000e63e0: 636c 6172 6174 696f 6e20 7468 6174 2077 claration that w │ │ │ │ -000e63f0: 7261 7073 2074 6865 203c 636f 6465 3e5f raps the _ │ │ │ │ -000e6400: 5f70 7472 3c2f 636f 6465 3e20 616e 6420 _ptr and │ │ │ │ -000e6410: 3c63 6f64 653e 5f5f 7369 7a65 3c2f 636f __size members:

│ │ │ │ -000e6430: 0a3c 6469 7620 636c 6173 733d 2266 7261 .
s │ │ │ │ -000e6470: 7472 7563 7420 3c2f 7370 616e 3e70 7265 truct pre │ │ │ │ -000e6480: 6669 785f 5f61 7272 6179 5f6e 616d 6520 fix__array_name │ │ │ │ -000e6490: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
{
│ │ │ │ -000e64b0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
Type *__p │ │ │ │ -000e64d0: 7472 3b20 203c 7370 616e 2063 6c61 7373 tr; // po │ │ │ │ -000e64f0: 696e 7465 7220 746f 2061 7272 6179 206f inter to array o │ │ │ │ -000e6500: 6620 656c 656d 656e 7473 2069 6e20 6d65 f elements in me │ │ │ │ -000e6510: 6d6f 7279 3c2f 7370 616e 3e3c 2f64 6976 mory
.
int __s │ │ │ │ -000e6560: 697a 653b 2020 203c 7370 616e 2063 6c61 ize; // │ │ │ │ -000e6580: 6e75 6d62 6572 206f 6620 656c 656d 656e number of elemen │ │ │ │ -000e6590: 7473 2070 6f69 6e74 6564 2074 6f20 3c2f ts pointed to
.
│ │ │ │ -000e65c0: 2020 2e2e 2e20 2020 2020 2020 2020 2020 ... │ │ │ │ -000e65d0: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // anythin │ │ │ │ -000e65f0: 6720 7468 6174 2066 6f6c 6c6f 7773 2068 g that follows h │ │ │ │ -000e6600: 6572 6520 7769 6c6c 2062 6520 6967 6e6f ere will be igno │ │ │ │ -000e6610: 7265 6420 3c2f 7370 616e 3e3c 2f64 6976 red
.
};
.

The secon │ │ │ │ -000e6660: 6420 666f 726d 2069 7320 6d6f 7265 2067 d form is more g │ │ │ │ -000e6670: 656e 6572 6963 2c20 6265 6361 7573 6520 eneric, because │ │ │ │ -000e6680: 7468 6520 6172 7261 7920 6361 6e20 6265 the array can be │ │ │ │ -000e6690: 2064 6563 6c61 7265 6420 616e 7977 6865 declared anywhe │ │ │ │ -000e66a0: 7265 2069 6e20 7468 6520 7374 7275 6374 re in the struct │ │ │ │ -000e66b0: 206f 7220 636c 6173 7320 616e 6420 6d75 or class and mu │ │ │ │ -000e66c0: 6c74 6970 6c65 2061 7272 6179 7320 6361 ltiple arrays ca │ │ │ │ -000e66d0: 6e20 6265 2075 7365 6420 6173 206d 656d n be used as mem │ │ │ │ -000e66e0: 6265 7273 2c20 6561 6368 2077 6974 6820 bers, each with │ │ │ │ -000e66f0: 6120 3c63 6f64 653e 5f5f 7369 7a65 3c2f a __size member (__sizeName is also al │ │ │ │ -000e6730: 6c6f 7765 6429 2074 6861 7420 7072 6563 lowed) that prec │ │ │ │ -000e6740: 6564 6573 2061 2070 6f69 6e74 6572 206d edes a pointer m │ │ │ │ -000e6750: 656d 6265 723a 3c2f 703e 0a3c 6469 7620 ember:

.
struct │ │ │ │ -000e67a0: 3c2f 7370 616e 3e70 7265 6669 785f 5f61 prefix__a │ │ │ │ -000e67b0: 7272 6179 5f6e 616d 6520 3c2f 6469 763e rray_name
│ │ │ │ -000e67c0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
{
.
│ │ │ │ -000e67f0: 202e 2e2e 2020 2020 2020 2020 2020 2020 ... │ │ │ │ -000e6800: 2020 2020 2020 203c 7370 616e 2063 6c61 // │ │ │ │ -000e6820: 6f74 6865 7220 6d65 6d62 6572 7320 7468 other members th │ │ │ │ -000e6830: 6174 2061 7265 2073 6572 6961 6c69 7a65 at are serialize │ │ │ │ -000e6840: 643c 2f73 7061 6e3e 3c2f 6469 763e 0a3c d
.< │ │ │ │ -000e6850: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -000e6860: 3e20 2020 203c 7370 616e 2063 6c61 7373 > i │ │ │ │ -000e6880: 6e74 3c2f 7370 616e 3e20 5f5f 7369 7a65 nt __size │ │ │ │ -000e6890: 5f6f 665f 6172 7261 7931 3b20 3c73 7061 _of_array1; // number of e │ │ │ │ -000e68c0: 6c65 6d65 6e74 7320 706f 696e 7465 6420 lements pointed │ │ │ │ -000e68d0: 746f 203c 2f73 7061 6e3e 3c2f 6469 763e to
│ │ │ │ -000e68e0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
Type1 *ar │ │ │ │ -000e6900: 7261 7931 3b20 2020 2020 2020 203c 7370 ray1; // pointer to │ │ │ │ -000e6930: 2061 7272 6179 206f 6620 656c 656d 656e array of elemen │ │ │ │ -000e6940: 7473 2069 6e20 6d65 6d6f 7279 3c2f 7370 ts in memory
.
│ │ │ │ -000e6970: 2e2e 2e20 2020 2020 2020 2020 2020 2020 ... │ │ │ │ -000e6980: 2020 2020 2020 3c73 7061 6e20 636c 6173 // o │ │ │ │ -000e69a0: 7468 6572 206d 656d 6265 7273 2074 6861 ther members tha │ │ │ │ -000e69b0: 7420 6172 6520 7365 7269 616c 697a 6564 t are serialized │ │ │ │ -000e69c0: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ │ -000e69e0: 2020 2020 3c73 7061 6e20 636c 6173 733d in │ │ │ │ -000e6a00: 743c 2f73 7061 6e3e 205f 5f73 697a 655f t __size_ │ │ │ │ -000e6a10: 6f66 5f61 7272 6179 313b 203c 7370 616e of_array1; // number of el │ │ │ │ -000e6a40: 656d 656e 7473 2070 6f69 6e74 6564 2074 ements pointed t │ │ │ │ -000e6a50: 6f20 3c2f 7370 616e 3e3c 2f64 6976 3e0a o
. │ │ │ │ -000e6a60: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
Type2 *arr │ │ │ │ -000e6a80: 6179 323b 2020 2020 2020 2020 3c73 7061 ay2; // pointer to │ │ │ │ -000e6ab0: 6172 7261 7920 6f66 2065 6c65 6d65 6e74 array of element │ │ │ │ -000e6ac0: 7320 696e 206d 656d 6f72 793c 2f73 7061 s in memory
.
. │ │ │ │ -000e6af0: 2e2e 2020 2020 2020 2020 2020 2020 2020 .. │ │ │ │ -000e6b00: 2020 2020 203c 7370 616e 2063 6c61 7373 // ot │ │ │ │ -000e6b20: 6865 7220 6d65 6d62 6572 7320 7468 6174 her members that │ │ │ │ -000e6b30: 2061 7265 2073 6572 6961 6c69 7a65 643c are serialized< │ │ │ │ -000e6b40: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
.} │ │ │ │ -000e6b60: 3b3c 2f64 6976 3e0a 3c2f 6469 763e 3c21 ;
.
< │ │ │ │ -000e6b80: 703e 5468 6520 3c63 6f64 653e 5f5f 7369 p>The __si │ │ │ │ -000e6b90: 7a65 3c2f 636f 6465 3e20 6d65 6d62 6572 ze member │ │ │ │ -000e6ba0: 2073 686f 756c 6420 6265 2061 6e20 3c63 should be an int t │ │ │ │ -000e6bc0: 7970 6520 616e 6420 6361 6e6e 6f74 2062 ype and cannot b │ │ │ │ -000e6bd0: 6520 6120 3c63 6f64 653e 7369 7a65 5f74 e a size_t │ │ │ │ -000e6be0: 3c2f 636f 6465 3e20 7479 7065 206f 7220 type or │ │ │ │ -000e6bf0: 6f74 6865 7220 696e 7465 6765 7220 7479 other integer ty │ │ │ │ -000e6c00: 7065 2e3c 2f70 3e0a 3c70 3e46 6f72 2065 pe.

.

For e │ │ │ │ -000e6c10: 7861 6d70 6c65 2c20 7765 2064 6566 696e xample, we defin │ │ │ │ -000e6c20: 6520 6120 4d61 7020 7374 7275 6374 7572 e a Map structur │ │ │ │ -000e6c30: 6520 7468 6174 2063 6f6e 7461 696e 7320 e that contains │ │ │ │ -000e6c40: 6120 7365 7175 656e 6365 206f 6620 6b65 a sequence of ke │ │ │ │ -000e6c50: 792d 7661 6c20 7061 6972 733a 3c2f 703e y-val pairs:

│ │ │ │ -000e6c60: 0a3c 6469 7620 636c 6173 733d 2266 7261 .
s │ │ │ │ -000e6ca0: 7472 7563 7420 3c2f 7370 616e 3e6e 735f truct ns_ │ │ │ │ -000e6cb0: 5f4d 6170 203c 2f64 6976 3e0a 3c64 6976 _Map
.
{< │ │ │ │ -000e6cd0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
int │ │ │ │ -000e6d10: 205f 5f73 697a 653b 203c 7370 616e 2063 __size; / │ │ │ │ -000e6d30: 2f20 6e75 6d62 6572 206f 6620 7061 6972 / number of pair │ │ │ │ -000e6d40: 7320 3c2f 7370 616e 3e3c 2f64 6976 3e0a s
. │ │ │ │ -000e6d50: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
stru │ │ │ │ -000e6d80: 6374 203c 2f73 7061 6e3e 6e73 5f5f 5061 ct ns__Pa │ │ │ │ -000e6d90: 6972 3c2f 6469 763e 0a3c 6469 7620 636c ir
.
{ │ │ │ │ -000e6db0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ │ -000e6dd0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 char< │ │ │ │ -000e6df0: 2f73 7061 6e3e 202a 6b65 793b 3c2f 6469 /span> *key;.
char *val;
.< │ │ │ │ -000e6e50: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -000e6e60: 3e20 2020 207d 202a 7061 6972 3b20 2020 > } *pair; │ │ │ │ -000e6e70: 203c 7370 616e 2063 6c61 7373 3d22 636f // array │ │ │ │ -000e6e90: 6f66 2070 6169 7273 3c2f 7370 616e 3e3c of pairs< │ │ │ │ -000e6ea0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
};
│ │ │ │ -000e6ec0: 0a3c 2f64 6976 3e3c 212d 2d20 6672 6167 .

Since │ │ │ │ -000e6ee0: 2032 2e37 2e31 3620 6974 2069 7320 616c 2.7.16 it is al │ │ │ │ -000e6ef0: 736f 2070 6f73 7369 626c 6520 746f 2075 so possible to u │ │ │ │ -000e6f00: 7365 2061 2027 3c63 6f64 653e 243c 2f63 se a '$' as a speci │ │ │ │ -000e6f20: 616c 206d 6172 6b65 7220 746f 2061 6e6e al marker to ann │ │ │ │ -000e6f30: 6f74 6174 6520 6120 7369 7a65 206d 656d otate a size mem │ │ │ │ -000e6f40: 6265 7220 696e 7374 6561 6420 6f66 2072 ber instead of r │ │ │ │ -000e6f50: 6571 7569 7269 6e67 2074 6865 7365 206d equiring these m │ │ │ │ -000e6f60: 656d 6265 7273 2074 6f20 7374 6172 7420 embers to start │ │ │ │ -000e6f70: 7769 7468 203c 636f 6465 3e5f 5f73 697a with __siz │ │ │ │ -000e6f80: 653c 2f63 6f64 653e 3a3c 2f70 3e0a 3c64 e:

.
stru │ │ │ │ -000e6fd0: 6374 203c 2f73 7061 6e3e 6e73 5f5f 4d61 ct ns__Ma │ │ │ │ -000e6fe0: 7020 3c2f 6469 763e 0a3c 6469 7620 636c p
.
{.
$ int si │ │ │ │ -000e7040: 7a65 3b20 203c 7370 616e 2063 6c61 7373 ze; // nu │ │ │ │ -000e7060: 6d62 6572 206f 6620 7061 6972 7320 3c2f mber of pairs
.
│ │ │ │ -000e7090: 2020 3c73 7061 6e20 636c 6173 733d 226b struct < │ │ │ │ -000e70b0: 2f73 7061 6e3e 6e73 5f5f 5061 6972 3c2f /span>ns__Pair.
{.
char *key;
.< │ │ │ │ -000e7130: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -000e7140: 3e20 2020 2020 2020 203c 7370 616e 2063 > char * │ │ │ │ -000e7170: 7661 6c3b 3c2f 6469 763e 0a3c 6469 7620 val;
.
│ │ │ │ -000e7190: 207d 202a 7061 6972 3b20 2020 203c 7370 } *pair; // array of p │ │ │ │ -000e71c0: 6169 7273 3c2f 7370 616e 3e3c 2f64 6976 airs
.
};
.

The array │ │ │ │ -000e7210: 2077 696c 6c20 6265 2073 6572 6961 6c69 will be seriali │ │ │ │ -000e7220: 7a65 6420 696e 2058 4d4c 2061 7320 6120 zed in XML as a │ │ │ │ -000e7230: 7365 7175 656e 6365 206f 6620 7061 6972 sequence of pair │ │ │ │ -000e7240: 733a 3c2f 703e 0a3c 6469 7620 636c 6173 s:

.
< │ │ │ │ -000e7270: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -000e7280: 3e26 6c74 3b3c 7370 616e 2063 6c61 7373 ><n │ │ │ │ -000e72a0: 733a 4d61 703c 2f73 7061 6e3e 2667 743b s:Map> │ │ │ │ -000e72b0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
< │ │ │ │ -000e72d0: 3c73 7061 6e20 636c 6173 733d 226b 6579 pair>
│ │ │ │ -000e7300: 0a3c 6469 7620 636c 6173 733d 226c 696e .
<key& │ │ │ │ -000e7340: 6774 3b3c 7370 616e 2063 6c61 7373 3d22 gt;Joe</key> │ │ │ │ -000e7390: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
&l │ │ │ │ -000e73b0: 743b 3c73 7061 6e20 636c 6173 733d 226b t;val< │ │ │ │ -000e73d0: 2f73 7061 6e3e 2667 743b 3535 3520 3737 /span>>555 77 │ │ │ │ -000e73e0: 2031 3233 3426 6c74 3b2f 3c73 7061 6e20 1234</val&g │ │ │ │ -000e7410: 743b 203c 2f64 6976 3e0a 3c64 6976 2063 t;
.
&l │ │ │ │ -000e7430: 743b 2f3c 7370 616e 2063 6c61 7373 3d22 t;/pai │ │ │ │ -000e7450: 723c 2f73 7061 6e3e 2667 743b 203c 2f64 r> .
<pair>
. │ │ │ │ -000e74c0: 2020 2026 6c74 3b3c 7370 616e 2063 6c61 <key>< │ │ │ │ -000e74f0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -000e7500: 6f72 6422 3e53 7573 616e 3c2f 7370 616e ord">Susan</ │ │ │ │ -000e7530: 6b65 793c 2f73 7061 6e3e 2667 743b 203c key> < │ │ │ │ -000e7540: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
< │ │ │ │ -000e7560: 3c73 7061 6e20 636c 6173 733d 226b 6579 val>555 12 6 │ │ │ │ -000e7590: 3732 3526 6c74 3b2f 3c73 7061 6e20 636c 725</val> │ │ │ │ -000e75c0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
< │ │ │ │ -000e75e0: 2f3c 7370 616e 2063 6c61 7373 3d22 6b65 /pair< │ │ │ │ -000e7600: 2f73 7061 6e3e 2667 743b 203c 2f64 6976 /span>>
.
<pair& │ │ │ │ -000e7650: 6774 3b20 3c2f 6469 763e 0a3c 6469 7620 gt;
.
│ │ │ │ -000e7670: 2026 6c74 3b3c 7370 616e 2063 6c61 7373 <k │ │ │ │ -000e7690: 6579 3c2f 7370 616e 3e26 6774 3b3c 7370 ey>Pete&l │ │ │ │ -000e76c0: 743b 2f3c 7370 616e 2063 6c61 7373 3d22 t;/key │ │ │ │ -000e76e0: 3c2f 7370 616e 3e26 6774 3b20 3c2f 6469 > .
<val>555 99 4321 │ │ │ │ -000e7740: 266c 743b 2f3c 7370 616e 2063 6c61 7373 </v │ │ │ │ -000e7760: 616c 3c2f 7370 616e 3e26 6774 3b20 3c2f al> .
</pair>
.< │ │ │ │ -000e77c0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -000e77d0: 3e26 6c74 3b2f 3c73 7061 6e20 636c 6173 ></ │ │ │ │ -000e77f0: 6e73 3a4d 6170 3c2f 7370 616e 3e26 6774 ns:Map> │ │ │ │ -000e7800: 3b3c 2f64 6976 3e0a 3c2f 6469 763e 3c21 ;
.
│ │ │ │ -000e7820: 3c2f 6469 763e 3c70 3e44 6573 6572 6961

Deseria │ │ │ │ -000e7830: 6c69 7a61 7469 6f6e 2069 7320 6c65 7373 lization is less │ │ │ │ -000e7840: 2065 6666 6963 6965 6e74 2063 6f6d 7061 efficient compa │ │ │ │ -000e7850: 7265 6420 746f 2061 2053 4f41 502d 656e red to a SOAP-en │ │ │ │ -000e7860: 636f 6465 6420 6172 7261 792c 2062 6563 coded array, bec │ │ │ │ -000e7870: 6175 7365 2074 6865 2073 697a 6520 6f66 ause the size of │ │ │ │ -000e7880: 2074 6865 2073 6571 7565 6e63 6520 6973 the sequence is │ │ │ │ -000e7890: 206e 6f74 2070 6172 7420 6f66 2074 6865 not part of the │ │ │ │ -000e78a0: 2053 4f41 5020 656e 636f 6469 6e67 2e20 SOAP encoding. │ │ │ │ -000e78b0: 4275 6666 6572 696e 6720 6973 2075 7365 Buffering is use │ │ │ │ -000e78c0: 6420 6279 2074 6865 2064 6573 6572 6961 d by the deseria │ │ │ │ -000e78d0: 6c69 7a65 7220 746f 2063 6f6c 6c65 6374 lizer to collect │ │ │ │ -000e78e0: 2074 6865 2065 6c65 6d65 6e74 7320 696e the elements in │ │ │ │ -000e78f0: 206d 656d 6f72 792e 2057 6865 6e20 7468 memory. When th │ │ │ │ -000e7900: 6520 656e 6420 6f66 2074 6865 206c 6973 e end of the lis │ │ │ │ -000e7910: 7420 6973 2072 6561 6368 6564 2c20 7468 t is reached, th │ │ │ │ -000e7920: 6520 6275 6666 6572 6564 2065 6c65 6d65 e buffered eleme │ │ │ │ -000e7930: 6e74 7320 6172 6520 636f 7069 6564 2074 nts are copied t │ │ │ │ -000e7940: 6f20 6120 6e65 776c 7920 616c 6c6f 6361 o a newly alloca │ │ │ │ -000e7950: 7465 6420 6d61 6e61 6765 6420 7370 6163 ted managed spac │ │ │ │ -000e7960: 6520 6f6e 2074 6865 2068 6561 7020 666f e on the heap fo │ │ │ │ -000e7970: 7220 7468 6520 6479 6e61 6d69 6320 6172 r the dynamic ar │ │ │ │ -000e7980: 7261 792e 3c2f 703e 0a3c 703e 4d75 6c74 ray.

.

Mult │ │ │ │ -000e7990: 6970 6c65 2061 7272 6179 7320 6361 6e20 iple arrays can │ │ │ │ -000e79a0: 6265 2070 6172 7420 6f66 2061 2073 7472 be part of a str │ │ │ │ -000e79b0: 7563 7420 6f72 2063 6c61 7373 2e20 466f uct or class. Fo │ │ │ │ -000e79c0: 7220 6578 616d 706c 653a 3c2f 703e 0a3c r example:

.< │ │ │ │ -000e79d0: 6469 7620 636c 6173 733d 2266 7261 676d div class="fragm │ │ │ │ -000e79e0: 656e 7422 3e3c 6469 7620 636c 6173 733d ent">
str │ │ │ │ -000e7a10: 7563 7420 3c2f 7370 616e 3e6e 735f 5f43 uct ns__C │ │ │ │ -000e7a20: 6f6e 7461 6374 203c 2f64 6976 3e0a 3c64 ontact
. │ │ │ │ -000e7a40: 7b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 {
.
char *firstName; │ │ │ │ -000e7a90: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
char *lastName; .
$ int │ │ │ │ -000e7b20: 6e50 686f 6e65 733b 2020 2020 2020 2020 nPhones; │ │ │ │ -000e7b30: 2020 3c73 7061 6e20 636c 6173 733d 2263 // numbe │ │ │ │ -000e7b50: 7220 6f66 2050 686f 6e65 733c 2f73 7061 r of Phones
.
.
$ < │ │ │ │ -000e7c40: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -000e7c50: 6f72 6474 7970 6522 3e69 6e74 3c2f 7370 ordtype">int nEmails; │ │ │ │ -000e7c70: 2020 2020 2020 3c73 7061 6e20 636c 6173 // n │ │ │ │ -000e7c90: 756d 6265 7220 6f66 2065 6d61 696c 7320 umber of emails │ │ │ │ -000e7ca0: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ │ -000e7cc0: 2020 2020 3c73 7061 6e20 636c 6173 733d ch │ │ │ │ -000e7ce0: 6172 3c2f 7370 616e 3e20 2a2a 656d 6169 ar **emai │ │ │ │ -000e7cf0: 6c41 6464 7265 7373 3b20 203c 7370 616e lAddress; // array of ema │ │ │ │ -000e7d20: 696c 2061 6464 7265 7373 6573 203c 2f73 il addresses
.
};< │ │ │ │ -000e7d50: 2f64 6976 3e0a 3c2f 6469 763e 3c21 2d2d /div>.

│ │ │ │ -000e7d70: 5468 6520 584d 4c20 7365 7269 616c 697a The XML serializ │ │ │ │ -000e7d80: 6174 696f 6e20 6f66 2061 6e20 6578 616d ation of an exam │ │ │ │ -000e7d90: 706c 6520 3c63 6f64 653e 6e73 5f5f 436f ple ns__Co │ │ │ │ -000e7da0: 6e74 6163 743c 2f63 6f64 653e 2069 733a ntact is: │ │ │ │ -000e7db0: 3c2f 703e 0a3c 6469 7620 636c 6173 733d

.
& │ │ │ │ -000e7df0: 6c74 3b3c 7370 616e 2063 6c61 7373 3d22 lt;ns: │ │ │ │ -000e7e10: 436f 6e74 6163 743c 2f73 7061 6e3e 2667 Contact&g │ │ │ │ -000e7e20: 743b 203c 2f64 6976 3e0a 3c64 6976 2063 t;
.
&l │ │ │ │ -000e7e40: 743b 3c73 7061 6e20 636c 6173 733d 226b t;firs │ │ │ │ -000e7e60: 744e 616d 653c 2f73 7061 6e3e 2667 743b tName> │ │ │ │ -000e7e70: 3c73 7061 6e20 636c 6173 733d 226b 6579 Joe │ │ │ │ -000e7e90: 266c 743b 2f3c 7370 616e 2063 6c61 7373 </f │ │ │ │ -000e7eb0: 6972 7374 4e61 6d65 3c2f 7370 616e 3e26 irstName& │ │ │ │ -000e7ec0: 6774 3b20 3c2f 6469 763e 0a3c 6469 7620 gt;
.
& │ │ │ │ -000e7ee0: 6c74 3b3c 7370 616e 2063 6c61 7373 3d22 lt;las │ │ │ │ -000e7f00: 744e 616d 653c 2f73 7061 6e3e 2667 743b tName> │ │ │ │ -000e7f10: 3c73 7061 6e20 636c 6173 733d 226b 6579 Smith</lastName │ │ │ │ -000e7f60: 2667 743b 203c 2f64 6976 3e0a 3c64 6976 >
.
│ │ │ │ -000e7f80: 266c 743b 3c73 7061 6e20 636c 6173 733d <ph │ │ │ │ -000e7fa0: 6f6e 654e 756d 6265 723c 2f73 7061 6e3e oneNumber │ │ │ │ -000e7fb0: 2667 743b 3535 3531 3131 3232 3232 266c >5551112222&l │ │ │ │ -000e7fc0: 743b 2f3c 7370 616e 2063 6c61 7373 3d22 t;/pho │ │ │ │ -000e7fe0: 6e65 4e75 6d62 6572 3c2f 7370 616e 3e26 neNumber& │ │ │ │ -000e7ff0: 6774 3b20 3c2f 6469 763e 0a3c 6469 7620 gt;
.
& │ │ │ │ -000e8010: 6c74 3b3c 7370 616e 2063 6c61 7373 3d22 lt;pho │ │ │ │ -000e8030: 6e65 4e75 6d62 6572 3c2f 7370 616e 3e26 neNumber& │ │ │ │ -000e8040: 6774 3b35 3535 3132 3334 3536 3726 6c74 gt;5551234567< │ │ │ │ -000e8050: 3b2f 3c73 7061 6e20 636c 6173 733d 226b ;/phon │ │ │ │ -000e8070: 654e 756d 6265 723c 2f73 7061 6e3e 2667 eNumber&g │ │ │ │ -000e8080: 743b 203c 2f64 6976 3e0a 3c64 6976 2063 t;
.
&l │ │ │ │ -000e80a0: 743b 3c73 7061 6e20 636c 6173 733d 226b t;phon │ │ │ │ -000e80c0: 654e 756d 6265 723c 2f73 7061 6e3e 2667 eNumber&g │ │ │ │ -000e80d0: 743b 3535 3532 3334 3839 3031 266c 743b t;5552348901< │ │ │ │ -000e80e0: 2f3c 7370 616e 2063 6c61 7373 3d22 6b65 /phone │ │ │ │ -000e8100: 4e75 6d62 6572 3c2f 7370 616e 3e26 6774 Number> │ │ │ │ -000e8110: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
< │ │ │ │ -000e8130: 3b3c 7370 616e 2063 6c61 7373 3d22 6b65 ;email │ │ │ │ -000e8150: 4164 6472 6573 733c 2f73 7061 6e3e 2667 Address&g │ │ │ │ -000e8160: 743b 3c73 7061 6e20 636c 6173 733d 226b t;Joe.Smit │ │ │ │ -000e8180: 683c 2f73 7061 6e3e 403c 7370 616e 2063 h@m │ │ │ │ -000e81a0: 6169 6c2e 636f 6d3c 2f73 7061 6e3e 266c ail.com&l │ │ │ │ -000e81b0: 743b 2f3c 7370 616e 2063 6c61 7373 3d22 t;/ema │ │ │ │ -000e81d0: 696c 4164 6472 6573 733c 2f73 7061 6e3e ilAddress │ │ │ │ -000e81e0: 2667 743b 203c 2f64 6976 3e0a 3c64 6976 >
.
│ │ │ │ -000e8200: 266c 743b 3c73 7061 6e20 636c 6173 733d <em │ │ │ │ -000e8220: 6169 6c41 6464 7265 7373 3c2f 7370 616e ailAddress>Joe@Smit │ │ │ │ -000e8270: 682e 636f 6d3c 2f73 7061 6e3e 266c 743b h.com< │ │ │ │ -000e8280: 2f3c 7370 616e 2063 6c61 7373 3d22 6b65 /email │ │ │ │ -000e82a0: 4164 6472 6573 733c 2f73 7061 6e3e 2667 Address&g │ │ │ │ -000e82b0: 743b 203c 2f64 6976 3e0a 3c64 6976 2063 t;
.
< │ │ │ │ -000e82d0: 2f3c 7370 616e 2063 6c61 7373 3d22 6b65 /ns:Co │ │ │ │ -000e82f0: 6e74 6163 743c 2f73 7061 6e3e 2667 743b ntact> │ │ │ │ -000e8300: 3c2f 6469 763e 0a3c 2f64 6976 3e3c 212d
.
< │ │ │ │ -000e8320: 2f64 6976 3e3c 703e 466f 7220 432b 2b2c /div>

For C++, │ │ │ │ -000e8330: 2061 2062 6574 7465 7220 616c 7465 726e a better altern │ │ │ │ -000e8340: 6174 6976 6520 746f 2061 7272 6179 7320 ative to arrays │ │ │ │ -000e8350: 6172 6520 636f 6e74 6169 6e65 7273 2c20 are containers, │ │ │ │ -000e8360: 7768 6963 6820 6172 6520 6465 7363 7269 which are descri │ │ │ │ -000e8370: 6265 6420 6e65 7874 2e3c 2f70 3e0a 3c70 bed next.

.

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

.ST │ │ │ │ -000e83e0: 4c20 636f 6e74 6169 6e65 7273 3c2f 6833 L containers

.

The STL con │ │ │ │ -000e8400: 7461 696e 6572 7320 3c63 6f64 653e 7374 tainers st │ │ │ │ -000e8410: 643a 3a64 6571 7565 3c2f 636f 6465 3e2c d::deque, │ │ │ │ -000e8420: 203c 636f 6465 3e73 7464 3a3a 6c69 7374 std::list │ │ │ │ -000e8430: 3c2f 636f 6465 3e2c 203c 636f 6465 3e73 , s │ │ │ │ -000e8440: 7464 3a3a 7365 743c 2f63 6f64 653e 2c20 td::set, │ │ │ │ -000e8450: 616e 6420 3c63 6f64 653e 7374 643a 3a76 and std::v │ │ │ │ -000e8460: 6563 746f 723c 2f63 6f64 653e 2061 7265 ector are │ │ │ │ -000e8470: 2073 6572 6961 6c69 7a61 626c 6520 696e serializable in │ │ │ │ -000e8480: 2058 4d4c 2062 7920 7468 6520 736f 6170 XML by the soap │ │ │ │ -000e8490: 6370 7032 2d67 656e 6572 6174 6564 2073 cpp2-generated s │ │ │ │ -000e84a0: 6572 6961 6c69 7a65 7273 2e3c 2f70 3e0a erializers.

. │ │ │ │ -000e84b0: 3c70 3e49 6e20 6f72 6465 7220 746f 2075

In order to u │ │ │ │ -000e84c0: 7365 2063 6f6e 7461 696e 6572 7320 696e se containers in │ │ │ │ -000e84d0: 2061 6e20 696e 7465 7266 6163 6520 6865 an interface he │ │ │ │ -000e84e0: 6164 6572 2066 696c 6520 666f 7220 736f ader file for so │ │ │ │ -000e84f0: 6170 6370 7032 2c20 696d 706f 7274 203c apcpp2, import < │ │ │ │ -000e8500: 656d 3e3c 636f 6465 3e73 746c 6465 7175 em>stldequ │ │ │ │ -000e8510: 652e 683c 2f63 6f64 653e 3c2f 656d 3e2c e.h, │ │ │ │ -000e8520: 203c 656d 3e3c 636f 6465 3e73 746c 6c69 stlli │ │ │ │ -000e8530: 7374 2e68 3c2f 636f 6465 3e3c 2f65 6d3e st.h │ │ │ │ -000e8540: 2c20 3c65 6d3e 3c63 6f64 653e 7374 6c73 , stls │ │ │ │ -000e8550: 6574 2e68 3c2f 636f 6465 3e3c 2f65 6d3e et.h │ │ │ │ -000e8560: 2c20 6f72 203c 656d 3e3c 636f 6465 3e73 , or s │ │ │ │ -000e8570: 746c 7665 6374 6f72 2e68 3c2f 636f 6465 tlvector.h to enable │ │ │ │ -000e8590: 203c 636f 6465 3e73 7464 3a3a 6465 7175 std::dequ │ │ │ │ -000e85a0: 653c 2f63 6f64 653e 2c20 3c63 6f64 653e e, │ │ │ │ -000e85b0: 7374 643a 3a6c 6973 743c 2f63 6f64 653e std::list │ │ │ │ -000e85c0: 2c20 3c63 6f64 653e 7374 643a 3a73 6574 , std::set │ │ │ │ -000e85d0: 3c2f 636f 6465 3e2c 2061 6e64 203c 636f , and std::vector, respectiv │ │ │ │ -000e8600: 656c 792e 2046 6f72 2065 7861 6d70 6c65 ely. For example │ │ │ │ -000e8610: 3a3c 2f70 3e0a 3c64 6976 2063 6c61 7373 :

.
#import │ │ │ │ -000e8660: 2026 7175 6f74 3b73 746c 7665 6374 6f72 "stlvector │ │ │ │ -000e8670: 2e68 2671 756f 743b 3c2f 7370 616e 3e20 .h" │ │ │ │ -000e8680: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
c │ │ │ │ -000e86b0: 6c61 7373 203c 2f73 7061 6e3e 6e73 5f5f lass ns__ │ │ │ │ -000e86c0: 6d79 436c 6173 7320 3c2f 6469 763e 0a3c myClass
.< │ │ │ │ -000e86d0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -000e86e0: 3e7b 203c 7370 616e 2063 6c61 7373 3d22 >{ public< │ │ │ │ -000e8700: 2f73 7061 6e3e 3a20 3c2f 6469 763e 0a3c /span>:
.< │ │ │ │ -000e8710: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -000e8720: 3e20 2020 2073 7464 3a3a 7665 6374 6f72 > std::vector │ │ │ │ -000e8730: 266c 743b 696e 7426 6774 3b20 2020 2020 <int> │ │ │ │ -000e8740: 2020 2020 206e 756d 6265 7220 313a 3130 number 1:10 │ │ │ │ -000e8750: 3b20 3c73 7061 6e20 636c 6173 733d 2263 ; // 1 to │ │ │ │ -000e8770: 3130 206e 756d 6265 7273 3c2f 7370 616e 10 numbers
.
st │ │ │ │ -000e87a0: 643a 3a76 6563 746f 7226 6c74 3b73 7464 d::vector<std │ │ │ │ -000e87b0: 3a3a 7374 7269 6e67 2667 743b 202a 6e61 ::string> *na │ │ │ │ -000e87c0: 6d65 2020 2032 3b20 2020 203c 7370 616e me 2; // more than 2 │ │ │ │ -000e87f0: 6e61 6d65 733c 2f73 7061 6e3e 3c2f 6469 names.
};
.

The use │ │ │ │ -000e8840: 6f66 2070 6f69 6e74 6572 206d 656d 6265 of pointer membe │ │ │ │ -000e8850: 7273 2073 7563 6820 6173 2066 6f72 203c rs such as for < │ │ │ │ -000e8860: 636f 6465 3e6e 616d 653c 2f63 6f64 653e code>name │ │ │ │ -000e8870: 2073 686f 776e 2061 626f 7665 2069 7320 shown above is │ │ │ │ -000e8880: 706f 7373 6962 6c65 2c20 6275 7420 6e6f possible, but no │ │ │ │ -000e8890: 7420 7265 7175 6972 6564 2e20 416c 736f t required. Also │ │ │ │ -000e88a0: 203c 636f 6465 3e6d 696e 4f63 6375 7273 minOccurs │ │ │ │ -000e88b0: 203a 206d 6178 4f63 6375 7273 3c2f 636f : maxOccurs and mi │ │ │ │ -000e88d0: 6e4f 6363 7572 733c 2f63 6f64 653e 206c nOccurs l │ │ │ │ -000e88e0: 656e 6774 6820 636f 6e73 7472 6169 6e74 ength constraint │ │ │ │ -000e88f0: 7320 6361 6e20 6265 2073 7065 6369 6669 s can be specifi │ │ │ │ -000e8900: 6564 2061 7320 7368 6f77 6e20 696e 2074 ed as shown in t │ │ │ │ -000e8910: 6865 2065 7861 6d70 6c65 2061 626f 7665 he example above │ │ │ │ -000e8920: 2e20 5468 6520 584d 4c20 7363 6865 6d61 . The XML schema │ │ │ │ -000e8930: 2074 6861 7420 636f 7272 6573 706f 6e64 that correspond │ │ │ │ -000e8940: 7320 746f 2074 6865 203c 636f 6465 3e6e s to the n │ │ │ │ -000e8950: 735f 5f6d 7943 6c61 7373 3c2f 636f 6465 s__myClass type is:

.< │ │ │ │ -000e8970: 6469 7620 636c 6173 733d 2261 6c74 223e div class="alt"> │ │ │ │ -000e8980: 203c 6469 7620 636c 6173 733d 2266 7261
<complexTy │ │ │ │ -000e89d0: 7065 3c2f 7370 616e 3e20 3c73 7061 6e20 pe │ │ │ │ -000e89f0: 6e61 6d65 3c2f 7370 616e 3e3d 3c73 7061 name="my │ │ │ │ -000e8a20: 436c 6173 7326 7175 6f74 3b3c 2f73 7061 Class">
. │ │ │ │ -000e8a50: 2020 266c 743b 3c73 7061 6e20 636c 6173 < │ │ │ │ -000e8a70: 7365 7175 656e 6365 3c2f 7370 616e 3e26 sequence& │ │ │ │ -000e8a80: 6774 3b20 3c2f 6469 763e 0a3c 6469 7620 gt;
.
│ │ │ │ -000e8aa0: 2026 6c74 3b3c 7370 616e 2063 6c61 7373 <e │ │ │ │ -000e8ac0: 6c65 6d65 6e74 3c2f 7370 616e 3e20 3c73 lement name= │ │ │ │ -000e8af0: 3c73 7061 6e20 636c 6173 733d 2273 7472 &quo │ │ │ │ -000e8b10: 743b 6e75 6d62 6572 2671 756f 743b 3c2f t;number" type │ │ │ │ -000e8b40: 3c2f 7370 616e 3e3d 3c73 7061 6e20 636c ="xsd:in │ │ │ │ -000e8b70: 7426 7175 6f74 3b3c 2f73 7061 6e3e 203c t" < │ │ │ │ -000e8b80: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -000e8b90: 6f72 6422 3e6d 696e 4f63 6375 7273 3c2f ord">minOccurs="1"< │ │ │ │ -000e8bd0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> max │ │ │ │ -000e8bf0: 4f63 6375 7273 3c2f 7370 616e 3e3d 3c73 Occurs=" │ │ │ │ -000e8c20: 3130 2671 756f 743b 3c2f 7370 616e 3e2f 10"/ │ │ │ │ -000e8c30: 2667 743b 203c 2f64 6976 3e0a 3c64 6976 >
.
│ │ │ │ -000e8c50: 2020 266c 743b 3c73 7061 6e20 636c 6173 < │ │ │ │ -000e8c70: 656c 656d 656e 743c 2f73 7061 6e3e 203c element < │ │ │ │ -000e8c80: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -000e8c90: 6f72 6422 3e6e 616d 653c 2f73 7061 6e3e ord">name │ │ │ │ -000e8ca0: 3d3c 7370 616e 2063 6c61 7373 3d22 7374 =&qu │ │ │ │ -000e8cc0: 6f74 3b6e 616d 6526 7175 6f74 3b3c 2f73 ot;name" type< │ │ │ │ -000e8cf0: 2f73 7061 6e3e 3d3c 7370 616e 2063 6c61 /span>="xsd:str │ │ │ │ -000e8d20: 696e 6726 7175 6f74 3b3c 2f73 7061 6e3e ing" │ │ │ │ -000e8d30: 203c 7370 616e 2063 6c61 7373 3d22 6b65 minOccurs │ │ │ │ -000e8d50: 3c2f 7370 616e 3e3d 3c73 7061 6e20 636c ="2" │ │ │ │ -000e8d80: 3b3c 2f73 7061 6e3e 203c 7370 616e 2063 ; m │ │ │ │ -000e8da0: 6178 4f63 6375 7273 3c2f 7370 616e 3e3d axOccurs= │ │ │ │ -000e8db0: 3c73 7061 6e20 636c 6173 733d 2273 7472 &quo │ │ │ │ -000e8dd0: 743b 756e 626f 756e 6465 6426 7175 6f74 t;unbounded" │ │ │ │ -000e8de0: 3b3c 2f73 7061 6e3e 2f26 6774 3b20 3c2f ;/> .
</sequence │ │ │ │ -000e8e30: 3c2f 7370 616e 3e26 6774 3b20 3c2f 6469 > .
</complexType< │ │ │ │ -000e8e80: 2f73 7061 6e3e 2667 743b 3c2f 6469 763e /span>>
│ │ │ │ -000e8e90: 0a3c 2f64 6976 3e3c 212d 2d20 6672 6167 .
< │ │ │ │ -000e8eb0: 703e 596f 7520 6361 6e20 616c 736f 2069 p>You can also i │ │ │ │ -000e8ec0: 6d70 6c65 6d65 6e74 2079 6f75 7220 6f77 mplement your ow │ │ │ │ -000e8ed0: 6e20 636f 6e74 6169 6e65 7273 2e20 5468 n containers. Th │ │ │ │ -000e8ee0: 6520 636f 6e74 6169 6e65 7273 206d 7573 e containers mus │ │ │ │ -000e8ef0: 7420 6265 2063 6c61 7373 2074 656d 706c t be class templ │ │ │ │ -000e8f00: 6174 6573 2061 6e64 2073 686f 756c 6420 ates and should │ │ │ │ -000e8f10: 6465 6669 6e65 2061 2066 6f72 7761 7264 define a forward │ │ │ │ -000e8f20: 2069 7465 7261 746f 7220 7479 7065 2c20 iterator type, │ │ │ │ -000e8f30: 616e 6420 7072 6f76 6964 6520 7468 6520 and provide the │ │ │ │ -000e8f40: 666f 6c6c 6f77 696e 6720 6d65 7468 6f64 following method │ │ │ │ -000e8f50: 733a 3c2f 703e 0a3c 756c 3e0a 3c6c 693e s:

.
    .
  • │ │ │ │ -000e8f60: 3c63 6f64 653e 766f 6964 2063 6c65 6172 void clear │ │ │ │ -000e8f70: 2829 3c2f 636f 6465 3e20 656d 7074 7920 () empty │ │ │ │ -000e8f80: 7468 6520 636f 6e74 6169 6e65 723b 3c2f the container;.
  • it │ │ │ │ -000e8fa0: 6572 6174 6f72 2062 6567 696e 2829 3c2f erator begin() return ite │ │ │ │ -000e8fc0: 7261 746f 7220 746f 2062 6567 696e 6e69 rator to beginni │ │ │ │ -000e8fd0: 6e67 3b3c 2f6c 693e 0a3c 6c69 3e3c 636f ng;
  • .
  • const_iterato │ │ │ │ -000e8ff0: 7220 6265 6769 6e28 2920 636f 6e73 743c r begin() const< │ │ │ │ -000e9000: 2f63 6f64 653e 2072 6574 7572 6e20 636f /code> return co │ │ │ │ -000e9010: 6e73 7420 6974 6572 6174 6f72 2074 6f20 nst iterator to │ │ │ │ -000e9020: 6265 6769 6e6e 696e 673b 3c2f 6c69 3e0a beginning;
  • . │ │ │ │ -000e9030: 3c6c 693e 3c63 6f64 653e 6974 6572 6174
  • iterat │ │ │ │ -000e9040: 6f72 2065 6e64 2829 3c2f 636f 6465 3e20 or end() │ │ │ │ -000e9050: 7265 7475 726e 2069 7465 7261 746f 7220 return iterator │ │ │ │ -000e9060: 746f 2065 6e64 3b3c 2f6c 693e 0a3c 6c69 to end;
  • .
  • const_ite │ │ │ │ -000e9080: 7261 746f 7220 656e 6428 2920 636f 6e73 rator end() cons │ │ │ │ -000e9090: 743c 2f63 6f64 653e 2072 6574 7572 6e20 t return │ │ │ │ -000e90a0: 636f 6e73 7420 6974 6572 6174 6f72 2074 const iterator t │ │ │ │ -000e90b0: 6f20 656e 643b 3c2f 6c69 3e0a 3c6c 693e o end;
  • .
  • │ │ │ │ -000e90c0: 3c63 6f64 653e 7369 7a65 5f74 2073 697a size_t siz │ │ │ │ -000e90d0: 6528 293c 2f63 6f64 653e 2072 6574 7572 e() retur │ │ │ │ -000e90e0: 6e20 7369 7a65 3b3c 2f6c 693e 0a3c 6c69 n size;
  • .
  • iterator │ │ │ │ -000e9100: 696e 7365 7274 2869 7465 7261 746f 7220 insert(iterator │ │ │ │ -000e9110: 706f 732c 2063 6f6e 7374 5f72 6566 6572 pos, const_refer │ │ │ │ -000e9120: 656e 6365 2076 616c 293c 2f63 6f64 653e ence val) │ │ │ │ -000e9130: 2069 6e73 6572 7420 656c 656d 656e 742e insert element. │ │ │ │ -000e9140: 3c2f 6c69 3e0a 3c2f 756c 3e0a 3c70 3e54
  • .
.

T │ │ │ │ -000e9150: 6865 203c 636f 6465 3e69 7465 7261 746f he iterato │ │ │ │ -000e9160: 723c 2f63 6f64 653e 2073 686f 756c 6420 r should │ │ │ │ -000e9170: 6265 2061 2066 6f72 7761 7264 2069 7465 be a forward ite │ │ │ │ -000e9180: 7261 746f 7220 7769 7468 2061 2064 6572 rator with a der │ │ │ │ -000e9190: 6566 6572 656e 6365 206f 7065 7261 746f eference operato │ │ │ │ -000e91a0: 7220 746f 2061 6363 6573 7320 7468 6520 r to access the │ │ │ │ -000e91b0: 636f 6e74 6169 6e65 7227 7320 656c 656d container's elem │ │ │ │ -000e91c0: 656e 7473 2c20 6974 206d 7573 7420 6265 ents, it must be │ │ │ │ -000e91d0: 2063 6f6d 7061 7261 626c 6520 2865 7175 comparable (equ │ │ │ │ -000e91e0: 616c 2f75 6e65 7175 616c 292c 2061 6e64 al/unequal), and │ │ │ │ -000e91f0: 2062 6520 7072 652d 696e 6372 656d 656e be pre-incremen │ │ │ │ -000e9200: 7461 626c 6520 283c 636f 6465 3e2b 2b69 table (++i │ │ │ │ -000e9210: 743c 2f63 6f64 653e 292e 2054 6865 2063 t). The c │ │ │ │ -000e9220: 6f6e 7374 2069 7465 7261 746f 7220 6973 onst iterator is │ │ │ │ -000e9230: 2075 7365 6420 6279 2069 7473 2073 6f61 used by its soa │ │ │ │ -000e9240: 7063 7070 322d 6765 6e65 7261 7465 6420 pcpp2-generated │ │ │ │ -000e9250: 7365 7269 616c 697a 6572 2074 6f20 7365 serializer to se │ │ │ │ -000e9260: 6e64 2061 2073 6571 7565 6e63 6520 6f66 nd a sequence of │ │ │ │ -000e9270: 2058 4d4c 2065 6c65 6d65 6e74 2076 616c XML element val │ │ │ │ -000e9280: 7565 732e 2054 6865 203c 636f 6465 3e69 ues. The i │ │ │ │ -000e9290: 6e73 6572 743c 2f63 6f64 653e 206d 6574 nsert met │ │ │ │ -000e92a0: 686f 6420 6973 2075 7365 6420 746f 2070 hod is used to p │ │ │ │ -000e92b0: 6f70 756c 6174 6520 6120 636f 6e74 6169 opulate a contai │ │ │ │ -000e92c0: 6e65 7220 7769 7468 203c 636f 6465 3e43 ner with C │ │ │ │ -000e92d0: 6f6e 7461 696e 6572 3a3a 6974 6572 6174 ontainer::iterat │ │ │ │ -000e92e0: 6f72 2069 203d 2063 6f6e 7461 696e 6572 or i = container │ │ │ │ -000e92f0: 2e69 6e73 6572 7428 636f 6e74 6169 6e65 .insert(containe │ │ │ │ -000e9300: 722e 656e 6428 292c 2076 616c 293c 2f63 r.end(), val).

.

Her │ │ │ │ -000e9320: 6520 6973 2069 6e20 6578 616d 706c 6520 e is in example │ │ │ │ -000e9330: 636f 6e74 6169 6e65 7220 7465 6d70 6c61 container templa │ │ │ │ -000e9340: 7465 2063 6c61 7373 3a3c 2f70 3e0a 3c64 te class:

.
// s │ │ │ │ -000e9390: 696d 706c 655f 7665 6374 6f72 2e68 203c imple_vector.h < │ │ │ │ -000e93a0: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
.< │ │ │ │ -000e93c0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -000e93d0: 6f72 6422 3e74 656d 706c 6174 653c 2f73 ord">template
<c │ │ │ │ -000e9400: 6c61 7373 3c2f 7370 616e 3e20 5426 6774 lass T> │ │ │ │ -000e9410: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
class si │ │ │ │ -000e9450: 6d70 6c65 5f76 6563 746f 7220 3c2f 6469 mple_vector .
{ pub │ │ │ │ -000e9490: 6c69 633c 2f73 7061 6e3e 3a20 3c2f 6469 lic: .
t │ │ │ │ -000e94d0: 7970 6564 6566 3c2f 7370 616e 3e20 5420 ypedef T │ │ │ │ -000e94e0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -000e94f0: 2020 2020 2020 7661 6c75 655f 7479 7065 value_type │ │ │ │ -000e9500: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
< │ │ │ │ -000e9520: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -000e9530: 6f72 6422 3e74 7970 6564 6566 3c2f 7370 ord">typedef value_type │ │ │ │ -000e9550: 2020 2020 2020 2020 2020 2a20 706f 696e * poin │ │ │ │ -000e9560: 7465 723b 203c 2f64 6976 3e0a 3c64 6976 ter;
.
│ │ │ │ -000e9580: 2020 3c73 7061 6e20 636c 6173 733d 226b typedef< │ │ │ │ -000e95a0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> con │ │ │ │ -000e95c0: 7374 3c2f 7370 616e 3e20 7661 6c75 655f st value_ │ │ │ │ -000e95d0: 7479 7065 2020 2020 2020 2a20 636f 6e73 type * cons │ │ │ │ -000e95e0: 745f 706f 696e 7465 723b 203c 2f64 6976 t_pointer;
.
ty │ │ │ │ -000e9620: 7065 6465 663c 2f73 7061 6e3e 2076 616c pedef val │ │ │ │ -000e9630: 7565 5f74 7970 6520 2020 2020 2020 2020 ue_type │ │ │ │ -000e9640: 2020 2026 616d 703b 2072 6566 6572 656e & referen │ │ │ │ -000e9650: 6365 3b20 3c2f 6469 763e 0a3c 6469 7620 ce;
.
│ │ │ │ -000e9670: 203c 7370 616e 2063 6c61 7373 3d22 6b65 typedef cons │ │ │ │ -000e96b0: 743c 2f73 7061 6e3e 2076 616c 7565 5f74 t value_t │ │ │ │ -000e96c0: 7970 6520 2020 2020 2026 616d 703b 2063 ype & c │ │ │ │ -000e96d0: 6f6e 7374 5f72 6566 6572 656e 6365 3b20 onst_reference; │ │ │ │ -000e96e0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
typedef pointer │ │ │ │ -000e9730: 2020 2020 2020 2020 2020 6974 6572 6174 iterat │ │ │ │ -000e9740: 6f72 3b20 3c2f 6469 763e 0a3c 6469 7620 or;
.
│ │ │ │ -000e9760: 203c 7370 616e 2063 6c61 7373 3d22 6b65 typedef const_poin │ │ │ │ -000e9790: 7465 7220 2020 2020 2020 2020 2020 636f ter co │ │ │ │ -000e97a0: 6e73 745f 6974 6572 6174 6f72 3b20 3c2f nst_iterator; .
p │ │ │ │ -000e97e0: 726f 7465 6374 6564 3c2f 7370 616e 3e3a rotected: │ │ │ │ -000e97f0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
it │ │ │ │ -000e9810: 6572 6174 6f72 2020 2020 2020 2020 2020 erator │ │ │ │ -000e9820: 2020 2020 2020 2020 2020 2020 2020 6865 he │ │ │ │ -000e9830: 6164 3b20 3c2f 6469 763e 0a3c 6469 7620 ad;
.
│ │ │ │ -000e9850: 2069 7465 7261 746f 7220 2020 2020 2020 iterator │ │ │ │ -000e9860: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -000e9870: 2074 6169 6c3b 203c 2f64 6976 3e0a 3c64 tail;
. │ │ │ │ -000e9890: 2020 2020 3c73 7061 6e20 636c 6173 733d si │ │ │ │ -000e98b0: 7a65 5f74 3c2f 7370 616e 3e20 2020 2020 ze_t │ │ │ │ -000e98c0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -000e98d0: 2020 2020 2063 6170 6163 6974 793b 203c capacity; < │ │ │ │ -000e98e0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ -000e9910: 7075 626c 6963 3c2f 7370 616e 3e3a 203c public: < │ │ │ │ -000e9920: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ +000dfab0: 6e67 6c69 7465 7261 6c22 3ef0 078b f700 ngliteral">..... │ │ │ │ +000dfac0: 553c 2f73 7061 6e3e 3c2f 6469 763e 0a3c U
.< │ │ │ │ +000dfad0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +000dfae0: 3e3c 7370 616e 2063 6c61 7373 3d22 7374 > & │ │ │ │ +000dfb00: 6c74 3b72 2069 643d 2671 756f 743b 3c2f lt;r id="1" xsi:nil │ │ │ │ +000dfb40: 3d26 7175 6f74 3b3c 2f73 7061 6e3e 3c73 ="true& │ │ │ │ +000dfb70: 7175 6f74 3b2f 2667 743b 3c2f 6469 763e quot;/>
│ │ │ │ +000dfb80: 0a3c 6469 7620 636c 6173 733d 226c 696e .
</X>.

The deseri │ │ │ │ +000dfbf0: 616c 697a 6572 2072 6563 6f6e 7374 7275 alizer reconstru │ │ │ │ +000dfc00: 6374 7320 7468 6520 7374 7275 6374 203c cts the struct < │ │ │ │ +000dfc10: 636f 6465 3e58 3c2f 636f 6465 3e20 6672 code>X fr │ │ │ │ +000dfc20: 6f6d 2074 6869 7320 666f 726d 206f 6620 om this form of │ │ │ │ +000dfc30: 584d 4c2c 2074 6865 7265 6279 2070 7265 XML, thereby pre │ │ │ │ +000dfc40: 7365 7276 696e 6720 7468 6520 696e 7465 serving the inte │ │ │ │ +000dfc50: 6772 6974 7920 6f66 2074 6865 2064 6174 grity of the dat │ │ │ │ +000dfc60: 6120 7374 7275 6374 7572 6520 7365 7269 a structure seri │ │ │ │ +000dfc70: 616c 697a 6564 2e3c 2f70 3e0a 3c70 3e57 alized.

.

W │ │ │ │ +000dfc80: 6865 6e20 7468 6520 6465 7365 7269 616c hen the deserial │ │ │ │ +000dfc90: 697a 6572 2065 6e63 6f75 6e74 6572 7320 izer encounters │ │ │ │ +000dfca0: 616e 2058 4d4c 2065 6c65 6d65 6e74 2074 an XML element t │ │ │ │ +000dfcb0: 6861 7420 6861 7320 6120 3c65 6d3e 3c63 hat has a xsi:nil="tru │ │ │ │ +000dfcd0: 6522 3c2f 636f 6465 3e3c 2f65 6d3e 2061 e" a │ │ │ │ +000dfce0: 7474 7269 6275 7465 2062 7574 2074 6865 ttribute but the │ │ │ │ +000dfcf0: 2063 6f72 7265 7370 6f6e 6469 6e67 2043 corresponding C │ │ │ │ +000dfd00: 2f43 2b2b 2064 6174 6120 6973 206e 6f74 /C++ data is not │ │ │ │ +000dfd10: 2061 2070 6f69 6e74 6572 206f 7220 7265 a pointer or re │ │ │ │ +000dfd20: 6665 7265 6e63 652c 2074 6865 2064 6573 ference, the des │ │ │ │ +000dfd30: 6572 6961 6c69 7a65 7220 7769 6c6c 2074 erializer will t │ │ │ │ +000dfd40: 6572 6d69 6e61 7465 2077 6974 6820 6120 erminate with a │ │ │ │ +000dfd50: 3c63 6f64 653e 2353 4f41 505f 4e55 4c4c #SOAP_NULL │ │ │ │ +000dfd60: 3c2f 636f 6465 3e20 6661 756c 7420 7768 fault wh │ │ │ │ +000dfd70: 656e 2074 6865 203c 636f 6465 3e23 534f en the #SO │ │ │ │ +000dfd80: 4150 5f58 4d4c 5f53 5452 4943 543c 2f63 AP_XML_STRICT flag is set │ │ │ │ +000dfda0: 2e3c 2f70 3e0a 3c70 3ef0 9f94 9d20 3c61 .

.

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

.

│ │ │ │ +000dfde0: 3c61 2063 6c61 7373 3d22 616e 6368 6f72 │ │ │ │ +000dfe00: 0a56 6f69 6420 706f 696e 7465 7220 7365 .Void pointer se │ │ │ │ +000dfe10: 7269 616c 697a 6174 696f 6e3c 2f68 323e rialization

│ │ │ │ +000dfe20: 0a3c 703e 566f 6964 2070 6f69 6e74 6572 .

Void pointer │ │ │ │ +000dfe30: 7320 283c 636f 6465 3e76 6f69 642a 3c2f s (void*) cannot be │ │ │ │ +000dfe50: 2073 6572 6961 6c69 7a65 6420 696e 2058 serialized in X │ │ │ │ +000dfe60: 4d4c 2062 6563 6175 7365 2074 6865 2074 ML because the t │ │ │ │ +000dfe70: 7970 6520 6f66 2064 6174 6120 7265 6665 ype of data refe │ │ │ │ +000dfe80: 7272 6564 2074 6f20 6973 2075 6e74 7970 rred to is untyp │ │ │ │ +000dfe90: 6564 2e20 546f 2065 6e61 626c 6520 7468 ed. To enable th │ │ │ │ +000dfea0: 6520 7365 7269 616c 697a 6174 696f 6e20 e serialization │ │ │ │ +000dfeb0: 6f66 2076 6f69 6420 706f 696e 7465 7273 of void pointers │ │ │ │ +000dfec0: 2074 6861 7420 6172 6520 6d65 6d62 6572 that are member │ │ │ │ +000dfed0: 7320 6f66 2073 7472 7563 7473 2061 6e64 s of structs and │ │ │ │ +000dfee0: 2063 6c61 7373 6573 2c20 796f 7520 6361 classes, you ca │ │ │ │ +000dfef0: 6e20 696e 7365 7274 2061 203c 636f 6465 n insert a int __type member right │ │ │ │ +000dff20: 6265 666f 7265 2074 6865 2076 6f69 6420 before the void │ │ │ │ +000dff30: 706f 696e 7465 7220 6d65 6d62 6572 2e20 pointer member. │ │ │ │ +000dff40: 5468 6520 3c63 6f64 653e 696e 7420 5f5f The int __ │ │ │ │ +000dff50: 7479 7065 3c2f 636f 6465 3e20 6d65 6d62 type memb │ │ │ │ +000dff60: 6572 2063 6f6e 7461 696e 7320 7275 6e20 er contains run │ │ │ │ +000dff70: 7469 6d65 2069 6e66 6f72 6d61 7469 6f6e time information │ │ │ │ +000dff80: 206f 6e20 7468 6520 7479 7065 206f 6620 on the type of │ │ │ │ +000dff90: 7468 6520 6461 7461 2070 6f69 6e74 6564 the data pointed │ │ │ │ +000dffa0: 2074 6f20 6279 203c 636f 6465 3e76 6f69 to by voi │ │ │ │ +000dffb0: 642a 3c2f 636f 6465 3e20 6d65 6d62 6572 d* member │ │ │ │ +000dffc0: 2069 6e20 6120 7374 7275 6374 2f63 6c61 in a struct/cla │ │ │ │ +000dffd0: 7373 2074 6f20 656e 6162 6c65 2074 6865 ss to enable the │ │ │ │ +000dffe0: 2073 6572 6961 6c69 7a61 7469 6f6e 206f serialization o │ │ │ │ +000dfff0: 6620 7468 6973 2064 6174 612e 2054 6865 f this data. The │ │ │ │ +000e0000: 203c 636f 6465 3e69 6e74 205f 5f74 7970 int __typ │ │ │ │ +000e0010: 653c 2f63 6f64 653e 206d 656d 6265 7220 e member │ │ │ │ +000e0020: 6973 2073 6574 2074 6f20 6120 3c63 6f64 is set to a SOAP_TYPE_T value, wher │ │ │ │ +000e0050: 6520 3c63 6f64 653e 543c 2f63 6f64 653e e T │ │ │ │ +000e0060: 2069 7320 7468 6520 6e61 6d65 206f 6620 is the name of │ │ │ │ +000e0070: 6120 7479 7065 2e20 5468 6520 736f 6170 a type. The soap │ │ │ │ +000e0080: 6370 7032 2074 6f6f 6c20 6765 6e65 7261 cpp2 tool genera │ │ │ │ +000e0090: 7465 7320 7468 6520 3c63 6f64 653e 534f tes the SO │ │ │ │ +000e00a0: 4150 5f54 5950 455f 543c 2f63 6f64 653e AP_TYPE_T │ │ │ │ +000e00b0: 2064 6566 696e 6974 696f 6e73 2069 6e20 definitions in │ │ │ │ +000e00c0: 3c65 6d3e 3c63 6f64 653e 736f 6170 482e soapH. │ │ │ │ +000e00d0: 683c 2f63 6f64 653e 3c2f 656d 3e20 616e h an │ │ │ │ +000e00e0: 6420 7573 6573 2074 6865 6d20 696e 7465 d uses them inte │ │ │ │ +000e00f0: 726e 616c 6c79 2074 6f20 756e 6971 7565 rnally to unique │ │ │ │ +000e0100: 6c79 2069 6465 6e74 6966 7920 7468 6520 ly identify the │ │ │ │ +000e0110: 7479 7065 206f 6620 6561 6368 206f 626a type of each obj │ │ │ │ +000e0120: 6563 742e 2054 6865 2074 7970 6520 6e61 ect. The type na │ │ │ │ +000e0130: 6d69 6e67 2063 6f6e 7665 6e74 696f 6e73 ming conventions │ │ │ │ +000e0140: 206f 7574 6c69 6e65 6420 696e 2053 6563 outlined in Sec │ │ │ │ +000e0150: 7469 6f6e 203c 6120 636c 6173 733d 2265 tion S │ │ │ │ +000e0180: 6572 6961 6c69 7a69 6e67 2043 2f43 2b2b erializing C/C++ │ │ │ │ +000e0190: 2064 6174 6120 746f 2058 4d4c 3c2f 613e data to XML │ │ │ │ +000e01a0: 2061 7265 2075 7365 6420 746f 2064 6574 are used to det │ │ │ │ +000e01b0: 6572 6d69 6e65 2074 6865 2074 7970 6520 ermine the type │ │ │ │ +000e01c0: 6e61 6d65 2066 6f72 203c 636f 6465 3e54 name for T │ │ │ │ +000e01d0: 3c2f 636f 6465 3e2e 2056 616c 7565 7320 . Values │ │ │ │ +000e01e0: 7365 7269 616c 697a 6564 2069 6e20 584d serialized in XM │ │ │ │ +000e01f0: 4c20 7769 7468 2074 6869 7320 6170 7072 L with this appr │ │ │ │ +000e0200: 6f61 6368 2061 6c77 6179 7320 6361 7272 oach always carr │ │ │ │ +000e0210: 7920 7468 6520 3c65 6d3e 3c63 6f64 653e y the │ │ │ │ +000e0220: 7873 693a 7479 7065 3c2f 636f 6465 3e3c xsi:type< │ │ │ │ +000e0230: 2f65 6d3e 2061 7474 7269 6275 7465 2069 /em> attribute i │ │ │ │ +000e0240: 6e20 584d 4c20 746f 2069 6e64 6963 6174 n XML to indicat │ │ │ │ +000e0250: 6520 7468 6520 7479 7065 206f 6620 636f e the type of co │ │ │ │ +000e0260: 6e74 656e 7420 7365 7269 616c 697a 6564 ntent serialized │ │ │ │ +000e0270: 2e3c 2f70 3e0a 3c70 3e48 6572 6520 6973 .

.

Here is │ │ │ │ +000e0280: 2061 6e20 6578 616d 706c 6520 746f 2069 an example to i │ │ │ │ +000e0290: 6c6c 7573 7472 6174 6520 7468 6520 7365 llustrate the se │ │ │ │ +000e02a0: 7269 616c 697a 6174 696f 6e20 6f66 2061 rialization of a │ │ │ │ +000e02b0: 203c 636f 6465 3e76 6f69 642a 3c2f 636f void* member in a │ │ │ │ +000e02d0: 7374 7275 6374 2f63 6c61 7373 3a3c 2f70 struct/class:

.
│ │ │ │ +000e0320: 7374 7275 6374 203c 2f73 7061 6e3e 6e73 struct ns │ │ │ │ +000e0330: 5f5f 7265 636f 7264 203c 2f64 6976 3e0a __record
. │ │ │ │ +000e0340: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
{
.
│ │ │ │ +000e0370: 3c73 7061 6e20 636c 6173 733d 226b 6579 int __type; // the SOAP_T │ │ │ │ +000e03c0: 5950 455f 5420 706f 696e 7465 6420 746f YPE_T pointed to │ │ │ │ +000e03d0: 2062 7920 7661 6c3c 2f73 7061 6e3e 3c2f by val.
void │ │ │ │ +000e0420: 202a 7661 6c3b 2020 3c73 7061 6e20 636c *val; // │ │ │ │ +000e0440: 2073 6572 6961 6c69 7a65 2061 6e79 2074 serialize any t │ │ │ │ +000e0450: 7970 6520 696e 2065 6c65 6d65 6e74 2026 ype in element & │ │ │ │ +000e0460: 6c74 3b76 616c 2667 743b 3c2f 7370 616e lt;val>
.
};.

The │ │ │ │ +000e04b0: 203c 636f 6465 3e5f 5f74 7970 653c 2f63 __type integer can │ │ │ │ +000e04d0: 2062 6520 7365 7420 746f 2030 2061 7420 be set to 0 at │ │ │ │ +000e04e0: 7275 6e20 7469 6d65 2074 6f20 6f6d 6974 run time to omit │ │ │ │ +000e04f0: 2074 6865 2073 6572 6961 6c69 7a61 7469 the serializati │ │ │ │ +000e0500: 6f6e 206f 6620 7468 6520 766f 6964 2070 on of the void p │ │ │ │ +000e0510: 6f69 6e74 6572 206d 656d 6265 722e 3c2f ointer member..

The follow │ │ │ │ +000e0530: 696e 6720 6578 616d 706c 6520 696c 6c75 ing example illu │ │ │ │ +000e0540: 7374 7261 7465 7320 7468 6520 696e 6974 strates the init │ │ │ │ +000e0550: 6961 6c69 7a61 7469 6f6e 206f 6620 3c63 ialization of myStruct with a void │ │ │ │ +000e0580: 706f 696e 7465 7220 746f 2061 6e20 696e pointer to an in │ │ │ │ +000e0590: 743a 3c2f 703e 0a3c 6469 7620 636c 6173 t:

.
< │ │ │ │ +000e05c0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +000e05d0: 6f72 6422 3e73 7472 7563 7420 3c2f 7370 ord">struct ns__record S; │ │ │ │ +000e05f0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
int n │ │ │ │ +000e0630: 203d 2031 3233 3b20 3c2f 6469 763e 0a3c = 123;
.< │ │ │ │ +000e0640: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +000e0650: 3e53 2e76 616c 203d 2028 3c73 7061 6e20 >S.val = (void* │ │ │ │ +000e0680: 2926 616d 703b 6e3b 203c 2f64 6976 3e0a )&n;
. │ │ │ │ +000e0690: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
S.__type = SOA │ │ │ │ +000e06b0: 505f 5459 5045 5f69 6e74 3b20 3c2f 6469 P_TYPE_int; .

The │ │ │ │ +000e06e0: 2073 6572 6961 6c69 7a65 6420 6f75 7470 serialized outp │ │ │ │ +000e06f0: 7574 206f 6620 3c63 6f64 653e 533c 2f63 ut of S contains th │ │ │ │ +000e0710: 6520 696e 7465 6765 7220 696e 2069 7473 e integer in its │ │ │ │ +000e0720: 203c 656d 3e3c 636f 6465 3e76 616c 3c2f val eleme │ │ │ │ +000e0740: 6e74 3a3c 2f70 3e0a 3c64 6976 2063 6c61 nt:

.
│ │ │ │ +000e0770: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
< │ │ │ │ +000e07a0: 6e73 3a72 6563 6f72 643c 2f73 7061 6e3e ns:record │ │ │ │ +000e07b0: 2667 743b 3c2f 6469 763e 0a3c 6469 7620 >
.
& │ │ │ │ +000e07d0: 6c74 3b3c 7370 616e 2063 6c61 7373 3d22 lt;val │ │ │ │ +000e07f0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c xs │ │ │ │ +000e0810: 693a 7479 7065 3c2f 7370 616e 3e3d 3c73 i:type=" │ │ │ │ +000e0840: 7873 643a 696e 7426 7175 6f74 3b3c 2f73 xsd:int">123</ │ │ │ │ +000e0860: 3c73 7061 6e20 636c 6173 733d 226b 6579 val>
.< │ │ │ │ +000e0890: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +000e08a0: 3e26 6c74 3b2f 3c73 7061 6e20 636c 6173 ></ │ │ │ │ +000e08c0: 6e73 3a72 6563 6f72 643c 2f73 7061 6e3e ns:record │ │ │ │ +000e08d0: 2667 743b 3c2f 6469 763e 0a3c 2f64 6976 >
.

│ │ │ │ +000e1000: 4265 6361 7573 6520 7365 7276 6963 6520 Because service │ │ │ │ +000e1010: 6d65 7468 6f64 2070 6172 616d 6574 6572 method parameter │ │ │ │ +000e1020: 7320 6172 6520 7374 6f72 6564 2077 6974 s are stored wit │ │ │ │ +000e1030: 6869 6e20 7374 7275 6374 732c 2079 6f75 hin structs, you │ │ │ │ +000e1040: 2063 616e 2075 7365 203c 636f 6465 3e5f can use _ │ │ │ │ +000e1050: 5f74 7970 653c 2f63 6f64 653e 2061 6e64 _type and │ │ │ │ +000e1060: 203c 636f 6465 3e76 6f69 642a 3c2f 636f void* parameters t │ │ │ │ +000e1080: 6f20 7061 7373 2070 6f6c 796d 6f72 7068 o pass polymorph │ │ │ │ +000e1090: 6963 2061 7267 756d 656e 7473 2077 6974 ic arguments wit │ │ │ │ +000e10a0: 686f 7574 2068 6176 696e 6720 746f 2064 hout having to d │ │ │ │ +000e10b0: 6566 696e 6520 6120 432b 2b20 636c 6173 efine a C++ clas │ │ │ │ +000e10c0: 7320 6869 6572 6172 6368 7920 2853 6563 s hierarchy (Sec │ │ │ │ +000e10d0: 7469 6f6e 203c 6120 636c 6173 733d 2265 tion P │ │ │ │ +000e1100: 6f6c 796d 6f72 7068 6973 6d2c 2064 6572 olymorphism, der │ │ │ │ +000e1110: 6976 6564 2074 7970 6573 2c20 616e 6420 ived types, and │ │ │ │ +000e1120: 6479 6e61 6d69 6320 6269 6e64 696e 6720 dynamic binding │ │ │ │ +000e1130: 696e 2043 2b2b 3c2f 613e 2029 2c20 7072 in C++ ), pr │ │ │ │ +000e1140: 6f76 6964 6564 2074 6861 7420 3c65 6d3e ovided that │ │ │ │ +000e1150: 3c63 6f64 653e 7873 693a 7479 7065 3c2f xsi:type attri │ │ │ │ +000e1170: 6275 7465 7320 6172 6520 7072 6573 656e butes are presen │ │ │ │ +000e1180: 7420 696e 2074 6865 2058 4d4c 2065 6c65 t in the XML ele │ │ │ │ +000e1190: 6d65 6e74 732e 2046 6f72 2065 7861 6d70 ments. For examp │ │ │ │ +000e11a0: 6c65 3a3c 2f70 3e0a 3c64 6976 2063 6c61 le:

.
│ │ │ │ +000e11d0: 3c73 7061 6e20 636c 6173 733d 226b 6579 typedef c │ │ │ │ +000e1210: 6861 723c 2f73 7061 6e3e 202a 7873 645f har *xsd_ │ │ │ │ +000e1220: 5f73 7472 696e 673b 203c 2f64 6976 3e0a _string;
. │ │ │ │ +000e1230: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
typedef< │ │ │ │ +000e1260: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> int xsd_ │ │ │ │ +000e1290: 5f69 6e74 3b20 3c2f 6469 763e 0a3c 6469 _int;
.< │ │ │ │ +000e12b0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +000e12c0: 6f72 6422 3e74 7970 6564 6566 3c2f 7370 ord">typedef fl │ │ │ │ +000e12f0: 6f61 743c 2f73 7061 6e3e 2078 7364 5f5f oat xsd__ │ │ │ │ +000e1300: 666c 6f61 743b 203c 2f64 6976 3e0a 3c64 float;
. │ │ │ │ +000e1320: 3c73 7061 6e20 636c 6173 733d 226b 6579 enum ns__status { o │ │ │ │ +000e1350: 6e2c 206f 6666 207d 3b20 3c2f 6469 763e n, off };
│ │ │ │ +000e1360: 0a3c 6469 7620 636c 6173 733d 226c 696e .
struct │ │ │ │ +000e1390: 3c2f 7370 616e 3e6e 735f 5f77 6964 6765 ns__widge │ │ │ │ +000e13a0: 743c 2f64 6976 3e0a 3c64 6976 2063 6c61 t
.
{
.
char *n │ │ │ │ +000e1400: 616d 653b 3c2f 6469 763e 0a3c 6469 7620 ame;
.
│ │ │ │ +000e1420: 203c 7370 616e 2063 6c61 7373 3d22 6b65 int part;
.
};
.< │ │ │ │ +000e1480: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +000e1490: 6f72 6474 7970 6522 3e69 6e74 3c2f 7370 ordtype">int ns__webmetho │ │ │ │ +000e14b0: 6428 3c73 7061 6e20 636c 6173 733d 226b d(int< │ │ │ │ +000e14d0: 2f73 7061 6e3e 205f 5f74 7970 652c 203c /span> __type, < │ │ │ │ +000e14e0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +000e14f0: 6f72 6474 7970 6522 3e76 6f69 643c 2f73 ordtype">void
*data, struct │ │ │ │ +000e1530: 6e73 5f5f 7765 626d 6574 686f 6452 6573 ns__webmethodRes │ │ │ │ +000e1540: 706f 6e73 6520 7b20 3c73 7061 6e20 636c ponse { int __t │ │ │ │ +000e1570: 7970 653b 203c 7370 616e 2063 6c61 7373 ype; v │ │ │ │ +000e1590: 6f69 643c 2f73 7061 6e3e 202a 7265 7475 oid *retu │ │ │ │ +000e15a0: 726e 5f3b 207d 202a 6f75 7429 3b3c 2f64 rn_; } *out);.

Th │ │ │ │ +000e15d0: 6973 206d 6574 686f 6420 6861 7320 6120 is method has a │ │ │ │ +000e15e0: 706f 6c79 6d6f 7270 6869 6320 696e 7075 polymorphic inpu │ │ │ │ +000e15f0: 7420 7061 7261 6d65 7465 7220 3c63 6f64 t parameter data an │ │ │ │ +000e1610: 6420 6120 706f 6c79 6d6f 7270 6869 6320 d a polymorphic │ │ │ │ +000e1620: 6f75 7470 7574 2070 6172 616d 6574 6572 output parameter │ │ │ │ +000e1630: 203c 636f 6465 3e72 6574 7572 6e5f 3c2f return_. The __type p │ │ │ │ +000e1660: 6172 616d 6574 6572 7320 6361 6e20 6265 arameters can be │ │ │ │ +000e1670: 206f 6e65 206f 6620 3c63 6f64 653e 534f one of SO │ │ │ │ +000e1680: 4150 5f54 5950 455f 7873 645f 5f73 7472 AP_TYPE_xsd__str │ │ │ │ +000e1690: 696e 673c 2f63 6f64 653e 2c20 3c63 6f64 ing, SOAP_TYPE_xsd_ │ │ │ │ +000e16b0: 5f69 6e74 3c2f 636f 6465 3e2c 203c 636f _int, SOAP_TYPE_xsd │ │ │ │ +000e16d0: 5f5f 666c 6f61 743c 2f63 6f64 653e 2c20 __float, │ │ │ │ +000e16e0: 3c63 6f64 653e 534f 4150 5f54 5950 455f SOAP_TYPE_ │ │ │ │ +000e16f0: 6e73 5f5f 7374 6174 7573 3c2f 636f 6465 ns__status, or SOAP │ │ │ │ +000e1710: 5f54 5950 455f 6e73 5f5f 7769 6467 6574 _TYPE_ns__widget │ │ │ │ +000e1720: 3c2f 636f 6465 3e2e 2054 6865 2057 5344 . The WSD │ │ │ │ +000e1730: 4c20 616e 6420 5853 4420 6669 6c65 7320 L and XSD files │ │ │ │ +000e1740: 7072 6f64 7563 6564 2062 7920 7468 6520 produced by the │ │ │ │ +000e1750: 736f 6170 6370 7032 2074 6f6f 6c20 6465 soapcpp2 tool de │ │ │ │ +000e1760: 636c 6172 6520 7468 6520 3c63 6f64 653e clare the │ │ │ │ +000e1770: 766f 6964 2a3c 2f63 6f64 653e 2070 6f6c void* pol │ │ │ │ +000e1780: 796d 6f72 7068 6963 206d 656d 6265 7273 ymorphic members │ │ │ │ +000e1790: 2061 7320 3c65 6d3e 3c63 6f64 653e 7873 as xs │ │ │ │ +000e17a0: 643a 616e 7954 7970 653c 2f63 6f64 653e d:anyType │ │ │ │ +000e17b0: 3c2f 656d 3e20 656c 656d 656e 7473 2e3c elements.< │ │ │ │ +000e17c0: 2f70 3e0a 3c70 3e54 6f20 6465 636c 6172 /p>.

To declar │ │ │ │ +000e17d0: 6520 6120 7772 6170 7065 7220 7374 7275 e a wrapper stru │ │ │ │ +000e17e0: 6374 2f63 6c61 7373 2066 6f72 203c 636f ct/class for void* │ │ │ │ +000e1800: 706f 696e 7465 7273 2061 6c6c 6f77 7320 pointers allows │ │ │ │ +000e1810: 7573 2074 6f20 7265 7573 6520 7468 6973 us to reuse this │ │ │ │ +000e1820: 206d 6563 6861 6e69 736d 2077 6865 6e20 mechanism when │ │ │ │ +000e1830: 7765 2075 7365 203c 636f 6465 3e5f 5f73 we use __s │ │ │ │ +000e1840: 656c 663c 2f63 6f64 653e 2061 7320 6120 elf as a │ │ │ │ +000e1850: 6d65 6d62 6572 206e 616d 6520 7468 6174 member name that │ │ │ │ +000e1860: 2072 6566 6572 7320 746f 2074 6865 2063 refers to the c │ │ │ │ +000e1870: 7572 7265 6e74 2058 4d4c 2065 6c65 6d65 urrent XML eleme │ │ │ │ +000e1880: 6e74 2074 6167 206e 616d 653a 3c2f 703e nt tag name:

│ │ │ │ +000e1890: 0a3c 6469 7620 636c 6173 733d 2266 7261 .
s │ │ │ │ +000e18d0: 7472 7563 7420 3c2f 7370 616e 3e5f 5f61 truct __a │ │ │ │ +000e18e0: 6e79 203c 2f64 6976 3e0a 3c64 6976 2063 ny
.
{.
int _ │ │ │ │ +000e1940: 5f74 7970 653b 2020 203c 7370 616e 2063 _type; / │ │ │ │ +000e1960: 2f20 7468 6520 534f 4150 5f54 5950 455f / the SOAP_TYPE_ │ │ │ │ +000e1970: 5420 706f 696e 7465 6420 746f 2062 7920 T pointed to by │ │ │ │ +000e1980: 5f5f 7365 6c66 3c2f 7370 616e 3e3c 2f64 __self.
void │ │ │ │ +000e19d0: 2a5f 5f73 656c 663b 203c 7370 616e 2063 *__self; / │ │ │ │ +000e19f0: 2f20 7365 7269 616c 697a 6520 616e 7920 / serialize any │ │ │ │ +000e1a00: 7479 7065 206f 6620 636f 6e74 656e 7420 type of content │ │ │ │ +000e1a10: 6f66 2074 6865 2063 7572 7265 6e74 2065 of the current e │ │ │ │ +000e1a20: 6c65 6d65 6e74 3c2f 7370 616e 3e3c 2f64 lement.
};
.< │ │ │ │ +000e1a50: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +000e1a60: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >struct ns__record< │ │ │ │ +000e1a90: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
{
. │ │ │ │ +000e1ab0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
__any val; │ │ │ │ +000e1ad0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
};
.

The │ │ │ │ +000e1b10: 666f 6c6c 6f77 696e 6720 6578 616d 706c following exampl │ │ │ │ +000e1b20: 6520 696c 6c75 7374 7261 7465 7320 7468 e illustrates th │ │ │ │ +000e1b30: 6520 696e 6974 6961 6c69 7a61 7469 6f6e e initialization │ │ │ │ +000e1b40: 206f 6620 3c63 6f64 653e 5f5f 6e73 5f5f of __ns__ │ │ │ │ +000e1b50: 7265 636f 7264 3c2f 636f 6465 3e20 7769 record wi │ │ │ │ +000e1b60: 7468 2061 2076 6f69 6420 706f 696e 7465 th a void pointe │ │ │ │ +000e1b70: 7220 746f 2061 6e20 696e 743a 3c2f 703e r to an int:

│ │ │ │ +000e1b80: 0a3c 6469 7620 636c 6173 733d 2266 7261 .
s │ │ │ │ +000e1bc0: 7472 7563 7420 3c2f 7370 616e 3e6e 735f truct ns_ │ │ │ │ +000e1bd0: 5f72 6563 6f72 6420 533b 203c 2f64 6976 _record S;
.
in │ │ │ │ +000e1c10: 743c 2f73 7061 6e3e 206e 203d 2031 3233 t n = 123 │ │ │ │ +000e1c20: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
S.val │ │ │ │ +000e1c40: 2e5f 5f69 7465 6d20 3d20 283c 7370 616e .__item = (void │ │ │ │ +000e1c70: 2a29 2661 6d70 3b6e 3b20 3c2f 6469 763e *)&n;
│ │ │ │ +000e1c80: 0a3c 6469 7620 636c 6173 733d 226c 696e .
S.val.__type │ │ │ │ +000e1ca0: 3d20 534f 4150 5f54 5950 455f 696e 743b = SOAP_TYPE_int; │ │ │ │ +000e1cb0: 203c 2f64 6976 3e0a 3c2f 6469 763e 3c21
.
< │ │ │ │ +000e1cd0: 703e 5468 6520 7365 7269 616c 697a 6564 p>The serialized │ │ │ │ +000e1ce0: 206f 7574 7075 7420 6f66 203c 636f 6465 output of S contai │ │ │ │ +000e1d00: 6e73 2074 6865 2069 6e74 6567 6572 3a3c ns the integer:< │ │ │ │ +000e1d10: 2f70 3e0a 3c64 6976 2063 6c61 7373 3d22 /p>.
&l │ │ │ │ +000e1d50: 743b 3c73 7061 6e20 636c 6173 733d 226b t;ns:r │ │ │ │ +000e1d70: 6563 6f72 643c 2f73 7061 6e3e 2667 743b ecord> │ │ │ │ +000e1d80: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
<< │ │ │ │ +000e1da0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +000e1db0: 6f72 6474 7970 6522 3e76 616c 3c2f 7370 ordtype">val xsi:ty │ │ │ │ +000e1de0: 7065 3c2f 7370 616e 3e3d 3c73 7061 6e20 pe="xsd: │ │ │ │ +000e1e10: 696e 7426 7175 6f74 3b3c 2f73 7061 6e3e int" │ │ │ │ +000e1e20: 2667 743b 3132 3326 6c74 3b2f 3c73 7061 >123</val │ │ │ │ +000e1e50: 2667 743b 3c2f 6469 763e 0a3c 6469 7620 >
.
< │ │ │ │ +000e1e70: 3b2f 3c73 7061 6e20 636c 6173 733d 226b ;/ns:r │ │ │ │ +000e1e90: 6563 6f72 643c 2f73 7061 6e3e 2667 743b ecord> │ │ │ │ +000e1ea0: 3c2f 6469 763e 0a3c 2f64 6976 3e3c 212d
.
< │ │ │ │ +000e1ec0: 2f64 6976 3e3c 703e f09f 949d 203c 6120 /div>

.... Back to │ │ │ │ +000e1ee0: 2074 6162 6c65 206f 6620 636f 6e74 656e table of conten │ │ │ │ +000e1ef0: 7473 3c2f 613e 3c2f 703e 0a3c 6832 3e3c ts

.

< │ │ │ │ +000e1f00: 6120 636c 6173 733d 2261 6e63 686f 7222 a class="anchor" │ │ │ │ +000e1f10: 2069 643d 2266 6978 6564 6172 7261 7973 id="fixedarrays │ │ │ │ +000e1f20: 223e 3c2f 613e 0a46 6978 6564 2d73 697a ">.Fixed-siz │ │ │ │ +000e1f30: 6520 6172 7261 7920 7365 7269 616c 697a e array serializ │ │ │ │ +000e1f40: 6174 696f 6e3c 2f68 323e 0a3c 703e 4669 ation

.

Fi │ │ │ │ +000e1f50: 7865 6420 7369 7a65 2061 7272 6179 7320 xed size arrays │ │ │ │ +000e1f60: 6172 6520 7365 7269 616c 697a 6564 2061 are serialized a │ │ │ │ +000e1f70: 7320 7265 7065 7469 7469 6f6e 7320 6f66 s repetitions of │ │ │ │ +000e1f80: 203c 656d 3e3c 636f 6465 3e69 7465 6d3c item< │ │ │ │ +000e1f90: 2f63 6f64 653e 3c2f 656d 3e20 656c 656d /code> elem │ │ │ │ +000e1fa0: 656e 7473 2077 6974 6820 7468 6520 6172 ents with the ar │ │ │ │ +000e1fb0: 7261 7920 7661 6c75 6573 2069 6e20 584d ray values in XM │ │ │ │ +000e1fc0: 4c2e 204d 756c 7469 2d64 696d 656e 7369 L. Multi-dimensi │ │ │ │ +000e1fd0: 6f6e 616c 2066 6978 6564 2073 697a 6520 onal fixed size │ │ │ │ +000e1fe0: 6172 7261 7973 2061 7265 2073 6572 6961 arrays are seria │ │ │ │ +000e1ff0: 6c69 7a65 6420 6173 206e 6573 7465 6420 lized as nested │ │ │ │ +000e2000: 3c65 6d3e 3c63 6f64 653e 6974 656d 3c2f item eleme │ │ │ │ +000e2020: 6e74 732c 2077 6865 7265 2074 6865 206f nts, where the o │ │ │ │ +000e2030: 7574 6572 2065 6c65 6d65 6e74 7320 6172 uter elements ar │ │ │ │ +000e2040: 6520 6172 7261 7973 2e3c 2f70 3e0a 3c70 e arrays.

.

The serializati │ │ │ │ +000e2060: 6f6e 206f 6620 6669 7865 642d 7369 7a65 on of fixed-size │ │ │ │ +000e2070: 2061 7272 6179 7320 7375 7070 6f72 7473 arrays supports │ │ │ │ +000e2080: 2074 6865 2053 4f41 5020 5250 4320 656e the SOAP RPC en │ │ │ │ +000e2090: 636f 6469 6e67 206d 756c 7469 2d64 696d coding multi-dim │ │ │ │ +000e20a0: 656e 7369 6f6e 616c 2061 7272 6179 2066 ensional array f │ │ │ │ +000e20b0: 6f72 6d61 7420 6173 2077 656c 6c20 6173 ormat as well as │ │ │ │ +000e20c0: 2070 6172 7469 616c 6c79 2074 7261 6e73 partially trans │ │ │ │ +000e20d0: 6d69 7474 6564 2061 6e64 2073 7061 7273 mitted and spars │ │ │ │ +000e20e0: 6520 6172 7261 7920 666f 726d 6174 7320 e array formats │ │ │ │ +000e20f0: 7374 616e 6461 7264 697a 6564 2069 6e20 standardized in │ │ │ │ +000e2100: 534f 4150 2031 2e31 2061 6e64 2031 2e32 SOAP 1.1 and 1.2 │ │ │ │ +000e2110: 2e3c 2f70 3e0a 3c70 3e46 6f72 2065 7861 .

.

For exa │ │ │ │ +000e2120: 6d70 6c65 3a3c 2f70 3e0a 3c64 6976 2063 mple:

.
│ │ │ │ +000e2140: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
// Conte │ │ │ │ +000e2170: 6e74 7320 6f66 2066 696c 6520 2671 756f nts of file &quo │ │ │ │ +000e2180: 743b 6669 7865 642e 6826 7175 6f74 3b3a t;fixed.h": │ │ │ │ +000e2190: 203c 2f73 7061 6e3e 3c2f 6469 763e 0a3c
.< │ │ │ │ +000e21a0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +000e21b0: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >struct Example .
{
. │ │ │ │ +000e2210: 2020 2020 3c73 7061 6e20 636c 6173 733d fl │ │ │ │ +000e2230: 6f61 743c 2f73 7061 6e3e 2061 5b33 5d3b oat a[3]; │ │ │ │ +000e2240: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
};.

Thi │ │ │ │ +000e2280: 7320 7370 6563 6966 6965 7320 6120 6669 s specifies a fi │ │ │ │ +000e2290: 7865 642d 7369 7a65 2061 7272 6179 2070 xed-size array p │ │ │ │ +000e22a0: 6172 7420 6f66 2074 6865 203c 636f 6465 art of the struct Example< │ │ │ │ +000e22c0: 2f63 6f64 653e 2e20 5468 6520 7365 7269 /code>. The seri │ │ │ │ +000e22d0: 616c 697a 6564 206f 7574 7075 7420 6f66 alized output of │ │ │ │ +000e22e0: 2061 7272 6179 203c 636f 6465 3e61 3c2f array a is:

. │ │ │ │ +000e2310: 3c64 6976 2063 6c61 7373 3d22 6672 6167
<a&g │ │ │ │ +000e2360: 743b 3c2f 6469 763e 0a3c 6469 7620 636c t;
.
< │ │ │ │ +000e2380: 3b3c 7370 616e 2063 6c61 7373 3d22 6b65 ;item< │ │ │ │ +000e23a0: 2f73 7061 6e3e 2667 743b 312e 3026 6c74 /span>>1.0< │ │ │ │ +000e23b0: 3b2f 3c73 7061 6e20 636c 6173 733d 226b ;/item │ │ │ │ +000e23d0: 3c2f 7370 616e 3e26 6774 3b3c 2f64 6976 >
.
<item& │ │ │ │ +000e2420: 6774 3b32 2e30 266c 743b 2f3c 7370 616e gt;2.0</item │ │ │ │ +000e2450: 2667 743b 3c2f 6469 763e 0a3c 6469 7620 >
.
& │ │ │ │ +000e2470: 6c74 3b3c 7370 616e 2063 6c61 7373 3d22 lt;ite │ │ │ │ +000e2490: 6d3c 2f73 7061 6e3e 2667 743b 332e 3026 m>3.0& │ │ │ │ +000e24a0: 6c74 3b2f 3c73 7061 6e20 636c 6173 733d lt;/it │ │ │ │ +000e24c0: 656d 3c2f 7370 616e 3e26 6774 3b3c 2f64 em>.
</a> │ │ │ │ +000e2510: 3b3c 2f64 6976 3e0a 3c2f 6469 763e 3c21 ;
.
│ │ │ │ +000e2530: 3c2f 6469 763e 3c70 3e41 6e79 2064 6573

Any des │ │ │ │ +000e2540: 6572 6961 6c69 7a65 6420 6974 656d 7320 erialized items │ │ │ │ +000e2550: 6f66 2061 6e20 6172 7261 7920 7468 6174 of an array that │ │ │ │ +000e2560: 2064 6f20 6e6f 7420 6669 7420 696e 2074 do not fit in t │ │ │ │ +000e2570: 6865 2066 6978 6564 2073 697a 6520 6172 he fixed size ar │ │ │ │ +000e2580: 7261 792c 2069 2e65 2e20 6172 6520 6f75 ray, i.e. are ou │ │ │ │ +000e2590: 7420 6f66 2062 6f75 6e64 732c 2061 7265 t of bounds, are │ │ │ │ +000e25a0: 2069 676e 6f72 6564 2062 7920 7468 6520 ignored by the │ │ │ │ +000e25b0: 6465 7365 7269 616c 697a 6572 2077 6865 deserializer whe │ │ │ │ +000e25c0: 6e20 7468 6520 3c63 6f64 653e 2353 4f41 n the #SOA │ │ │ │ +000e25d0: 505f 435f 4e4f 494f 423c 2f63 6f64 653e P_C_NOIOB │ │ │ │ +000e25e0: 2066 6c61 6720 6973 2073 6574 2c20 6f74 flag is set, ot │ │ │ │ +000e25f0: 6865 7277 6973 6520 3c63 6f64 653e 2353 herwise #S │ │ │ │ +000e2600: 4f41 505f 494f 423c 2f63 6f64 653e 2065 OAP_IOB e │ │ │ │ +000e2610: 7272 6f72 7320 7769 6c6c 2062 6520 6765 rrors will be ge │ │ │ │ +000e2620: 6e65 7261 7465 6420 6279 2074 6865 2064 nerated by the d │ │ │ │ +000e2630: 6573 6572 6961 6c69 7a65 722e 3c2f 703e eserializer.

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

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

.

. │ │ │ │ +000e26a0: 4479 6e61 6d69 6320 6172 7261 7920 7365 Dynamic array se │ │ │ │ +000e26b0: 7269 616c 697a 6174 696f 6e3c 2f68 323e rialization

│ │ │ │ +000e26c0: 0a3c 703e 4479 6e61 6d69 6320 6172 7261 .

Dynamic arra │ │ │ │ +000e26d0: 7973 2061 7265 206d 7563 6820 6d6f 7265 ys are much more │ │ │ │ +000e26e0: 2066 6c65 7869 626c 6520 7468 616e 2066 flexible than f │ │ │ │ +000e26f0: 6978 6564 2d73 697a 6520 6172 7261 7973 ixed-size arrays │ │ │ │ +000e2700: 2e20 4479 6e61 6d69 6320 6172 7261 7973 . Dynamic arrays │ │ │ │ +000e2710: 2064 6563 6c61 7265 6420 696e 2074 6865 declared in the │ │ │ │ +000e2720: 2069 6e74 6572 6661 6365 2068 6561 6465 interface heade │ │ │ │ +000e2730: 7220 6669 6c65 2066 6f72 2073 6f61 7063 r file for soapc │ │ │ │ +000e2740: 7070 3220 6172 6520 6120 7370 6563 6961 pp2 are a specia │ │ │ │ +000e2750: 6c20 7374 7275 6374 206f 7220 636c 6173 l struct or clas │ │ │ │ +000e2760: 7320 6f72 2061 7265 2070 6172 7420 6f66 s or are part of │ │ │ │ +000e2770: 2061 2073 7472 7563 7420 6f72 2063 6c61 a struct or cla │ │ │ │ +000e2780: 7373 2077 6974 6820 6120 6d65 6d62 6572 ss with a member │ │ │ │ +000e2790: 2070 6f69 6e74 696e 6720 746f 2061 6e20 pointing to an │ │ │ │ +000e27a0: 6172 7261 7920 6f66 2065 6c65 6d65 6e74 array of element │ │ │ │ +000e27b0: 7320 616e 6420 6120 6d65 6d62 6572 2074 s and a member t │ │ │ │ +000e27c0: 6861 7420 7374 6f72 6573 2074 6865 2073 hat stores the s │ │ │ │ +000e27d0: 697a 6520 6f66 2074 6865 2061 7272 6179 ize of the array │ │ │ │ +000e27e0: 2e20 4479 6e61 6d69 6320 6172 7261 7920 . Dynamic array │ │ │ │ +000e27f0: 616c 6c6f 6361 7469 6f6e 7320 6172 6520 allocations are │ │ │ │ +000e2800: 6561 7379 2075 7369 6e67 2074 6865 2073 easy using the s │ │ │ │ +000e2810: 6f61 7063 7070 2d67 656e 6572 6174 6564 oapcpp-generated │ │ │ │ +000e2820: 203c 636f 6465 3e73 6f61 705f 6e65 775f soap_new_ │ │ │ │ +000e2830: 543c 2f63 6f64 653e 2066 756e 6374 696f T functio │ │ │ │ +000e2840: 6e73 2066 6f72 2074 7970 6520 3c63 6f64 ns for type T. This │ │ │ │ +000e2860: 2066 756e 6374 696f 6e20 6973 2075 7365 function is use │ │ │ │ +000e2870: 6420 746f 2061 6c6c 6f63 6174 6520 616e d to allocate an │ │ │ │ +000e2880: 2061 7272 6179 206f 6620 7661 6c75 6573 array of values │ │ │ │ +000e2890: 2077 6869 6368 2063 616e 2074 6865 6e20 which can then │ │ │ │ +000e28a0: 6265 2061 7373 6967 6e65 6420 746f 2074 be assigned to t │ │ │ │ +000e28b0: 6865 2070 6f69 6e74 6572 206d 656d 6265 he pointer membe │ │ │ │ +000e28c0: 7220 6f66 2074 6865 2073 7472 7563 742f r of the struct/ │ │ │ │ +000e28d0: 636c 6173 7320 7468 6174 2073 746f 7265 class that store │ │ │ │ +000e28e0: 7320 7468 6520 6172 7261 7920 706f 696e s the array poin │ │ │ │ +000e28f0: 7465 7220 7769 7468 2069 7473 2073 697a ter with its siz │ │ │ │ +000e2900: 652e 3c2f 703e 0a3c 703e 546f 2066 6163 e.

.

To fac │ │ │ │ +000e2910: 696c 6974 6174 6520 534f 4150 2052 5043 ilitate SOAP RPC │ │ │ │ +000e2920: 2065 6e63 6f64 696e 672c 2053 4f41 502d encoding, SOAP- │ │ │ │ +000e2930: 656e 636f 6465 6420 6172 7261 7973 2072 encoded arrays r │ │ │ │ +000e2940: 6571 7569 7265 2073 7065 6369 616c 2074 equire special t │ │ │ │ +000e2950: 7265 6174 6d65 6e74 2e20 534f 4150 2d65 reatment. SOAP-e │ │ │ │ +000e2960: 6e63 6f64 6564 2061 7272 6179 7320 6172 ncoded arrays ar │ │ │ │ +000e2970: 6520 7369 6e67 6c65 2d20 6f72 206d 756c e single- or mul │ │ │ │ +000e2980: 7469 2d64 696d 656e 7369 6f6e 616c 2061 ti-dimensional a │ │ │ │ +000e2990: 7272 6179 7320 7769 7468 2062 6f75 6e64 rrays with bound │ │ │ │ +000e29a0: 7320 7468 6174 2061 7070 6561 7220 696e s that appear in │ │ │ │ +000e29b0: 2058 4d4c 2e20 5468 6573 6520 6172 7261 XML. These arra │ │ │ │ +000e29c0: 7973 206d 6179 2061 6c73 6f20 6861 7665 ys may also have │ │ │ │ +000e29d0: 206f 6666 7365 7473 2074 6861 7420 6469 offsets that di │ │ │ │ +000e29e0: 6666 6572 2066 726f 6d20 7a65 726f 2e20 ffer from zero. │ │ │ │ +000e29f0: 5468 6520 696e 7465 6e74 206f 6620 534f The intent of SO │ │ │ │ +000e2a00: 4150 2d65 6e63 6f64 6564 2061 7272 6179 AP-encoded array │ │ │ │ +000e2a10: 7320 6973 2074 6f20 7265 706c 6963 6174 s is to replicat │ │ │ │ +000e2a20: 6520 6d75 6c74 692d 6469 6d65 6e73 696f e multi-dimensio │ │ │ │ +000e2a30: 6e61 6c20 6172 7261 7973 2063 6f6d 6d6f nal arrays commo │ │ │ │ +000e2a40: 6e6c 7920 666f 756e 6420 696e 2070 726f nly found in pro │ │ │ │ +000e2a50: 6772 616d 6d69 6e67 206c 616e 6775 6167 gramming languag │ │ │ │ +000e2a60: 6573 2e3c 2f70 3e0a 3c70 3e48 6f77 6576 es.

.

Howev │ │ │ │ +000e2a70: 6572 2c20 584d 4c20 616c 736f 2070 726f er, XML also pro │ │ │ │ +000e2a80: 7669 6465 7320 6120 7369 6d70 6c65 2077 vides a simple w │ │ │ │ +000e2a90: 6179 2074 6f20 7265 7072 6573 656e 7420 ay to represent │ │ │ │ +000e2aa0: 6120 7365 7175 656e 6365 206f 6620 7661 a sequence of va │ │ │ │ +000e2ab0: 6c75 6573 2077 6974 6820 6120 7365 7175 lues with a sequ │ │ │ │ +000e2ac0: 656e 6365 206f 6620 584d 4c20 656c 656d ence of XML elem │ │ │ │ +000e2ad0: 656e 7473 2e20 5468 6973 2064 6966 6665 ents. This diffe │ │ │ │ +000e2ae0: 7273 2066 726f 6d20 534f 4150 2d65 6e63 rs from SOAP-enc │ │ │ │ +000e2af0: 6f64 6564 2061 7272 6179 7320 696e 2074 oded arrays in t │ │ │ │ +000e2b00: 6861 7420 534f 4150 2d65 6e63 6f64 6564 hat SOAP-encoded │ │ │ │ +000e2b10: 2061 7272 6179 7320 6172 6520 656c 656d arrays are elem │ │ │ │ +000e2b20: 656e 7473 2077 6974 6820 6e65 7374 6564 ents with nested │ │ │ │ +000e2b30: 203c 656d 3e3c 636f 6465 3e69 7465 6d3c item< │ │ │ │ +000e2b40: 2f63 6f64 653e 3c2f 656d 3e20 656c 656d /code> elem │ │ │ │ +000e2b50: 656e 7473 2077 6974 6820 7661 6c75 6573 ents with values │ │ │ │ +000e2b60: 2c20 7468 6f75 6768 2053 4f41 5020 6465 , though SOAP de │ │ │ │ +000e2b70: 7365 7269 616c 697a 6572 7320 6d61 7920 serializers may │ │ │ │ +000e2b80: 6967 6e6f 7265 2074 6865 206e 616d 6520 ignore the name │ │ │ │ +000e2b90: 6f66 2074 6865 7365 2065 6c65 6d65 6e74 of these element │ │ │ │ +000e2ba0: 7320 7768 656e 2070 6172 7369 6e67 2058 s when parsing X │ │ │ │ +000e2bb0: 4d4c 2061 7320 7374 6174 6564 2069 6e20 ML as stated in │ │ │ │ +000e2bc0: 7468 6520 534f 4150 2073 7065 6369 6669 the SOAP specifi │ │ │ │ +000e2bd0: 6361 7469 6f6e 732e 3c2f 703e 0a3c 703e cations.

.

│ │ │ │ +000e2be0: 426f 7468 2053 4f41 502d 656e 636f 6465 Both SOAP-encode │ │ │ │ +000e2bf0: 6420 6172 7261 7973 2061 6e64 2073 6571 d arrays and seq │ │ │ │ +000e2c00: 7565 6e63 6573 206f 6620 584d 4c20 656c uences of XML el │ │ │ │ +000e2c10: 656d 656e 7473 2061 7265 2073 7570 706f ements are suppo │ │ │ │ +000e2c20: 7274 6564 2069 6e20 6753 4f41 502c 2075 rted in gSOAP, u │ │ │ │ +000e2c30: 7369 6e67 2064 796e 616d 6963 2061 7272 sing dynamic arr │ │ │ │ +000e2c40: 6179 7320 616e 6420 636f 6e74 6169 6e65 ays and containe │ │ │ │ +000e2c50: 7273 2e20 5468 6520 6261 7369 6373 2077 rs. The basics w │ │ │ │ +000e2c60: 696c 6c20 6265 2064 6573 6372 6962 6564 ill be described │ │ │ │ +000e2c70: 206e 6578 742e 2046 6f72 2061 6464 6974 next. For addit │ │ │ │ +000e2c80: 696f 6e61 6c20 6465 7461 696c 732c 2073 ional details, s │ │ │ │ +000e2c90: 6565 2074 6865 203c 6120 6872 6566 3d22 ee the C and C++ XML │ │ │ │ +000e2cd0: 2044 6174 6120 4269 6e64 696e 6773 3c2f Data Bindings documentation │ │ │ │ +000e2cf0: 2e3c 2f70 3e0a 3c70 3ef0 9f94 9d20 3c61 .

.

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

.

│ │ │ │ +000e2d30: 3c61 2063 6c61 7373 3d22 616e 6368 6f72 .SOAP-enc │ │ │ │ +000e2d60: 6f64 6564 2061 7272 6179 2062 6f75 6e64 oded array bound │ │ │ │ +000e2d70: 733c 2f68 333e 0a3c 703e 534f 4150 2d65 s

.

SOAP-e │ │ │ │ +000e2d80: 6e63 6f64 6564 2061 7272 6179 7320 7573 ncoded arrays us │ │ │ │ +000e2d90: 6520 7468 6520 3c65 6d3e 3c63 6f64 653e e the │ │ │ │ +000e2da0: 534f 4150 2d45 4e43 3a41 7272 6179 3c2f SOAP-ENC:Array attri │ │ │ │ +000e2dc0: 6275 7465 2069 6e20 584d 4c20 746f 2069 bute in XML to i │ │ │ │ +000e2dd0: 6465 6e74 6966 7920 7468 6520 6172 7261 dentify the arra │ │ │ │ +000e2de0: 7920 616e 6420 7468 6520 3c65 6d3e 3c63 y and the SOAP-ENC:arr │ │ │ │ +000e2e00: 6179 5479 7065 3c2f 636f 6465 3e3c 2f65 ayType attribute to │ │ │ │ +000e2e20: 6964 656e 7469 6679 2074 6865 2061 7272 identify the arr │ │ │ │ +000e2e30: 6179 2064 696d 656e 7369 6f6e 616c 6974 ay dimensionalit │ │ │ │ +000e2e40: 7920 616e 6420 6974 7320 7369 7a65 2e3c y and its size.< │ │ │ │ +000e2e50: 2f70 3e0a 3c70 3e41 7320 6120 7365 6375 /p>.

As a secu │ │ │ │ +000e2e60: 7269 7479 206d 6561 7375 7265 2074 6f20 rity measure to │ │ │ │ +000e2e70: 6176 6f69 6420 6465 6e69 616c 206f 6620 avoid denial of │ │ │ │ +000e2e80: 7365 7276 6963 6520 6174 7461 636b 7320 service attacks │ │ │ │ +000e2e90: 6261 7365 6420 6f6e 2073 656e 6469 6e67 based on sending │ │ │ │ +000e2ea0: 2061 2068 7567 6520 6172 7261 7920 7369 a huge array si │ │ │ │ +000e2eb0: 7a65 2076 616c 7565 2075 7369 6e67 2074 ze value using t │ │ │ │ +000e2ec0: 6865 203c 656d 3e3c 636f 6465 3e53 4f41 he SOA │ │ │ │ +000e2ed0: 502d 454e 433a 6172 7261 7954 7970 653c P-ENC:arrayType< │ │ │ │ +000e2ee0: 2f63 6f64 653e 3c2f 656d 3e20 6174 7472 /code> attr │ │ │ │ +000e2ef0: 6962 7574 652c 2072 6571 7569 7269 6e67 ibute, requiring │ │ │ │ +000e2f00: 2074 6865 2061 6c6c 6f63 6174 696f 6e20 the allocation │ │ │ │ +000e2f10: 6f66 206c 6172 6765 2063 6875 6e6b 7320 of large chunks │ │ │ │ +000e2f20: 6f66 206d 656d 6f72 792c 2074 6865 2074 of memory, the t │ │ │ │ +000e2f30: 6f74 616c 206e 756d 6265 7220 6f66 2061 otal number of a │ │ │ │ +000e2f40: 7272 6179 2065 6c65 6d65 6e74 7320 7365 rray elements se │ │ │ │ +000e2f50: 7420 6279 2074 6865 203c 656d 3e3c 636f t by the SOAP-ENC:arra │ │ │ │ +000e2f70: 7954 7970 653c 2f63 6f64 653e 3c2f 656d yType attribute cann │ │ │ │ +000e2f90: 6f74 2065 7863 6565 6420 3c63 6f64 653e ot exceed │ │ │ │ +000e2fa0: 2353 4f41 505f 4d41 5841 5252 4159 5349 #SOAP_MAXARRAYSI │ │ │ │ +000e2fb0: 5a45 3c2f 636f 6465 3e2c 2077 6869 6368 ZE, which │ │ │ │ +000e2fc0: 2069 7320 7365 7420 746f 2031 3030 3030 is set to 10000 │ │ │ │ +000e2fd0: 3020 6279 2064 6566 6175 6c74 2e20 5468 0 by default. Th │ │ │ │ +000e2fe0: 6973 206c 696d 6974 2069 7320 6e6f 7420 is limit is not │ │ │ │ +000e2ff0: 6120 6861 7264 206c 696d 6974 206f 6e20 a hard limit on │ │ │ │ +000e3000: 7468 6520 6e75 6d62 6572 206f 6620 6172 the number of ar │ │ │ │ +000e3010: 7261 7920 656c 656d 656e 7473 2c20 6275 ray elements, bu │ │ │ │ +000e3020: 7420 7261 7468 6572 2074 6f20 6176 6f69 t rather to avoi │ │ │ │ +000e3030: 6420 7072 652d 616c 6c6f 6361 7469 6e67 d pre-allocating │ │ │ │ +000e3040: 206c 6172 6765 2061 7272 6179 7320 6173 large arrays as │ │ │ │ +000e3050: 2073 7461 7465 642e 2054 6865 2068 6172 stated. The har │ │ │ │ +000e3060: 6420 6c69 6d69 7420 6f6e 2074 6865 206e d limit on the n │ │ │ │ +000e3070: 756d 6265 7220 6f66 2061 7272 6179 2065 umber of array e │ │ │ │ +000e3080: 6c65 6d65 6e74 7320 7265 6365 6976 6564 lements received │ │ │ │ +000e3090: 2069 7320 3c63 6f64 653e 3c61 2063 6c61 is soap::maxoccur │ │ │ │ +000e3160: 733c 2f61 3e3c 2f63 6f64 653e 2077 6869 s whi │ │ │ │ +000e3170: 6368 2069 7320 7365 7420 746f 203c 636f ch is set to #SOAP_MAXOCCU │ │ │ │ +000e3190: 5253 3c2f 636f 6465 3e20 6279 2064 6566 RS by def │ │ │ │ +000e31a0: 6175 6c74 2e20 4279 2063 6f6e 7472 6173 ault. By contras │ │ │ │ +000e31b0: 742c 2074 6865 203c 636f 6465 3e23 534f t, the #SO │ │ │ │ +000e31c0: 4150 5f4d 4158 4152 5241 5953 495a 453c AP_MAXARRAYSIZE< │ │ │ │ +000e31d0: 2f63 6f64 653e 206c 696d 6974 206f 6e6c /code> limit onl │ │ │ │ +000e31e0: 7920 6e65 6761 7469 7665 6c79 2061 6666 y negatively aff │ │ │ │ +000e31f0: 6563 7473 206d 756c 7469 2d64 696d 656e ects multi-dimen │ │ │ │ +000e3200: 7369 6f6e 616c 2061 7272 6179 7320 6265 sional arrays be │ │ │ │ +000e3210: 6361 7573 6520 7468 6520 6469 6d65 6e73 cause the dimens │ │ │ │ +000e3220: 696f 6e61 6c69 7479 206f 6620 7468 6520 ionality of the │ │ │ │ +000e3230: 7265 6365 6976 696e 6720 6172 7261 7920 receiving array │ │ │ │ +000e3240: 6d61 7920 6265 206c 6f73 7420 7768 656e may be lost when │ │ │ │ +000e3250: 2074 6865 206e 756d 6265 7220 6f66 2065 the number of e │ │ │ │ +000e3260: 6c65 6d65 6e74 7320 6578 6365 6564 7320 lements exceeds │ │ │ │ +000e3270: 3130 3030 3030 2e20 4f6e 652d 6469 6d65 100000. One-dime │ │ │ │ +000e3280: 6e73 696f 6e61 6c20 6172 7261 7973 2061 nsional arrays a │ │ │ │ +000e3290: 7265 206e 6f74 2061 6666 6563 7465 6420 re not affected │ │ │ │ +000e32a0: 616e 6420 706f 7075 6c61 7465 6420 6166 and populated af │ │ │ │ +000e32b0: 7465 7220 7468 6973 206c 696d 6974 2062 ter this limit b │ │ │ │ +000e32c0: 7920 7369 6d70 6c79 2064 6573 6572 6961 y simply deseria │ │ │ │ +000e32d0: 6c69 7a69 6e67 2074 6865 2061 7272 6179 lizing the array │ │ │ │ +000e32e0: 2065 6c65 6d65 6e74 7320 7265 6365 6976 elements receiv │ │ │ │ +000e32f0: 6564 2e3c 2f70 3e0a 3c70 3ef0 9f94 9d20 ed.

.

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

..One-dimension │ │ │ │ +000e3360: 616c 2064 796e 616d 6963 2053 4f41 502d al dynamic SOAP- │ │ │ │ +000e3370: 656e 636f 6465 6420 6172 7261 7973 3c2f encoded arrays.

A special │ │ │ │ +000e3390: 2066 6f72 6d20 6f66 2073 7472 7563 7420 form of struct │ │ │ │ +000e33a0: 6f72 2063 6c61 7373 2069 7320 7573 6564 or class is used │ │ │ │ +000e33b0: 2074 6f20 6465 6669 6e65 206f 6e65 2d64 to define one-d │ │ │ │ +000e33c0: 696d 656e 7369 6f6e 616c 2064 796e 616d imensional dynam │ │ │ │ +000e33d0: 6963 2053 4f41 502d 656e 636f 6465 6420 ic SOAP-encoded │ │ │ │ +000e33e0: 6172 7261 7973 2069 6e20 616e 2069 6e74 arrays in an int │ │ │ │ +000e33f0: 6572 6661 6365 2068 6561 6465 7220 6669 erface header fi │ │ │ │ +000e3400: 6c65 2066 6f72 2073 6f61 7063 7070 322e le for soapcpp2. │ │ │ │ +000e3410: 2045 6163 6820 6172 7261 7920 6861 7320 Each array has │ │ │ │ +000e3420: 6120 706f 696e 7465 7220 7661 7269 6162 a pointer variab │ │ │ │ +000e3430: 6c65 2061 6e64 2061 206d 656d 6265 7220 le and a member │ │ │ │ +000e3440: 7468 6174 2072 6563 6f72 6473 2074 6865 that records the │ │ │ │ +000e3450: 206e 756d 6265 7220 6f66 2065 6c65 6d65 number of eleme │ │ │ │ +000e3460: 6e74 7320 7468 6520 706f 696e 7465 7220 nts the pointer │ │ │ │ +000e3470: 706f 696e 7473 2074 6f20 696e 206d 656d points to in mem │ │ │ │ +000e3480: 6f72 792e 3c2f 703e 0a3c 703e 5468 6520 ory.

.

The │ │ │ │ +000e3490: 6765 6e65 7261 6c20 666f 726d 206f 6620 general form of │ │ │ │ +000e34a0: 7468 6520 7374 7275 6374 206f 7220 636c the struct or cl │ │ │ │ +000e34b0: 6173 7320 6465 636c 6172 6174 696f 6e20 ass declaration │ │ │ │ +000e34c0: 7468 6174 2063 6f6e 7461 696e 7320 6120 that contains a │ │ │ │ +000e34d0: 6f6e 652d 6469 6d65 6e73 696f 6e61 6c20 one-dimensional │ │ │ │ +000e34e0: 6479 6e61 6d69 6320 534f 4150 2d65 6e63 dynamic SOAP-enc │ │ │ │ +000e34f0: 6f64 6564 2061 7272 6179 2069 733a 3c2f oded array is:.

struct a │ │ │ │ +000e3550: 7272 6179 5f6e 616d 6520 3c2f 6469 763e rray_name
│ │ │ │ +000e3560: 0a3c 6469 7620 636c 6173 733d 226c 696e .
{
.
│ │ │ │ +000e3590: 2054 7970 6520 2a5f 5f70 7472 3b20 203c Type *__ptr; < │ │ │ │ +000e35a0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ +000e35b0: 656e 7422 3e2f 2f20 706f 696e 7465 7220 ent">// pointer │ │ │ │ +000e35c0: 746f 2061 7272 6179 206f 6620 656c 656d to array of elem │ │ │ │ +000e35d0: 656e 7473 2069 6e20 6d65 6d6f 7279 3c2f ents in memory
.
│ │ │ │ +000e3600: 2020 3c73 7061 6e20 636c 6173 733d 226b int< │ │ │ │ +000e3620: 2f73 7061 6e3e 205f 5f73 697a 653b 2020 /span> __size; │ │ │ │ +000e3630: 203c 7370 616e 2063 6c61 7373 3d22 636f // number │ │ │ │ +000e3650: 206f 6620 656c 656d 656e 7473 2070 6f69 of elements poi │ │ │ │ +000e3660: 6e74 6564 2074 6f20 3c2f 7370 616e 3e3c nted to < │ │ │ │ +000e3670: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
int │ │ │ │ +000e36b0: 205f 5f6f 6666 7365 743b 203c 7370 616e __offset; // optional SOA │ │ │ │ +000e36e0: 5020 312e 3120 6172 7261 7920 6f66 6673 P 1.1 array offs │ │ │ │ +000e36f0: 6574 3c2f 7370 616e 3e3c 2f64 6976 3e0a et
. │ │ │ │ +000e3700: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
... │ │ │ │ +000e3720: 2020 2020 3c73 7061 6e20 636c 6173 733d // any │ │ │ │ +000e3740: 7468 696e 6720 7468 6174 2066 6f6c 6c6f thing that follo │ │ │ │ +000e3750: 7773 2068 6572 6520 7769 6c6c 2062 6520 ws here will be │ │ │ │ +000e3760: 6967 6e6f 7265 6420 3c2f 7370 616e 3e3c ignored < │ │ │ │ +000e3770: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
};
│ │ │ │ +000e3790: 0a3c 2f64 6976 3e3c 212d 2d20 6672 6167 .

where │ │ │ │ +000e37b0: 2074 6865 203c 636f 6465 3e61 7272 6179 the array │ │ │ │ +000e37c0: 5f6e 616d 653c 2f63 6f64 653e 206d 7573 _name mus │ │ │ │ +000e37d0: 7420 6265 2061 206e 6f6e 2d71 7561 6c69 t be a non-quali │ │ │ │ +000e37e0: 6669 6564 206e 616d 6520 616e 6420 3c63 fied name and Type │ │ │ │ +000e3800: 6973 2074 6865 2074 7970 6520 666f 7220 is the type for │ │ │ │ +000e3810: 7468 6520 656c 656d 656e 7473 206f 6620 the elements of │ │ │ │ +000e3820: 7468 6520 6172 7261 792e 2054 6865 203c the array. The < │ │ │ │ +000e3830: 636f 6465 3e5f 5f70 7472 3c2f 636f 6465 code>__ptr member points │ │ │ │ +000e3850: 746f 2074 6865 2061 7272 6179 2076 616c to the array val │ │ │ │ +000e3860: 7565 7320 616e 6420 3c63 6f64 653e 5f5f ues and __ │ │ │ │ +000e3870: 7369 7a65 3c2f 636f 6465 3e20 6973 2074 size is t │ │ │ │ +000e3880: 6865 2061 7272 6179 2073 697a 652e 2054 he array size. T │ │ │ │ +000e3890: 6865 203c 636f 6465 3e5f 5f6f 6666 7365 he __offse │ │ │ │ +000e38a0: 743c 2f63 6f64 653e 206d 656d 6265 7220 t member │ │ │ │ +000e38b0: 7370 6563 6966 6965 7320 616e 206f 7074 specifies an opt │ │ │ │ +000e38c0: 696f 6e61 6c20 6172 7261 7920 6f66 6673 ional array offs │ │ │ │ +000e38d0: 6574 2c20 7768 656e 206e 6f6e 7a65 726f et, when nonzero │ │ │ │ +000e38e0: 2c20 7365 6520 5365 6374 696f 6e20 3c61 , see Section One-dim │ │ │ │ +000e3920: 656e 7369 6f6e 616c 2064 796e 616d 6963 ensional dynamic │ │ │ │ +000e3930: 2053 4f41 502d 656e 636f 6465 6420 6172 SOAP-encoded ar │ │ │ │ +000e3940: 7261 7973 2077 6974 6820 6e6f 6e2d 7a65 rays with non-ze │ │ │ │ +000e3950: 726f 206f 6666 7365 7473 3c2f 613e 2e3c ro offsets.< │ │ │ │ +000e3960: 2f70 3e0a 3c70 3e49 6620 7468 6520 3c63 /p>.

If the array_name is qualifi │ │ │ │ +000e3990: 6564 2077 6974 6820 6120 6e61 6d65 7370 ed with a namesp │ │ │ │ +000e39a0: 6163 6520 7072 6566 6978 2074 6865 6e20 ace prefix then │ │ │ │ +000e39b0: 7468 6520 6172 7261 7920 6973 206e 6f74 the array is not │ │ │ │ +000e39c0: 2061 2053 4f41 502d 656e 636f 6465 6420 a SOAP-encoded │ │ │ │ +000e39d0: 6172 7261 7920 6275 7420 7261 7468 6572 array but rather │ │ │ │ +000e39e0: 2072 6570 7265 7365 6e74 7320 6120 7365 represents a se │ │ │ │ +000e39f0: 7175 656e 6365 206f 6620 584d 4c20 656c quence of XML el │ │ │ │ +000e3a00: 656d 656e 7473 2c20 7365 6520 5365 6374 ements, see Sect │ │ │ │ +000e3a10: 696f 6e20 3c61 2063 6c61 7373 3d22 656c ion Non-SOA │ │ │ │ +000e3a40: 5020 6479 6e61 6d69 6320 6172 7261 7973 P dynamic arrays │ │ │ │ +000e3a50: 3c2f 613e 2e3c 2f70 3e0a 3c70 3e54 6865 .

.

The │ │ │ │ +000e3a60: 2073 6f61 7063 7070 322d 6765 6e65 7261 soapcpp2-genera │ │ │ │ +000e3a70: 7465 6420 6465 7365 7269 616c 697a 6572 ted deserializer │ │ │ │ +000e3a80: 206f 6620 6120 6f6e 652d 6469 6d65 6e73 of a one-dimens │ │ │ │ +000e3a90: 696f 6e61 6c20 6479 6e61 6d69 6320 6172 ional dynamic ar │ │ │ │ +000e3aa0: 7261 7920 6361 6e20 6465 7365 7269 616c ray can deserial │ │ │ │ +000e3ab0: 697a 6520 7061 7274 6961 6c6c 7920 7472 ize partially tr │ │ │ │ +000e3ac0: 616e 736d 6974 7465 6420 616e 642f 6f72 ansmitted and/or │ │ │ │ +000e3ad0: 2053 4f41 502d 656e 636f 6465 6420 7370 SOAP-encoded sp │ │ │ │ +000e3ae0: 6172 7365 2061 7272 6179 732c 2061 6e64 arse arrays, and │ │ │ │ +000e3af0: 2065 7665 6e20 6d75 6c74 692d 6469 6d65 even multi-dime │ │ │ │ +000e3b00: 6e73 696f 6e61 6c20 6172 7261 7973 2077 nsional arrays w │ │ │ │ +000e3b10: 6869 6368 2077 696c 6c20 6265 2063 6f6c hich will be col │ │ │ │ +000e3b20: 6c61 7073 6564 2069 6e74 6f20 6120 6f6e lapsed into a on │ │ │ │ +000e3b30: 652d 6469 6d65 6e73 696f 6e61 6c20 6172 e-dimensional ar │ │ │ │ +000e3b40: 7261 7920 7769 7468 2072 6f77 2d6d 616a ray with row-maj │ │ │ │ +000e3b50: 6f72 206f 7264 6572 696e 672e 3c2f 703e or ordering.

│ │ │ │ +000e3b60: 0a3c 646c 2063 6c61 7373 3d22 7365 6374 .
Warning
SOAP 1.2 does n │ │ │ │ +000e3ba0: 6f74 2073 7570 706f 7274 2070 6172 7469 ot support parti │ │ │ │ +000e3bb0: 616c 6c79 2074 7261 6e73 6d69 7474 6564 ally transmitted │ │ │ │ +000e3bc0: 2061 7272 6179 7320 616e 6420 7468 6520 arrays and the │ │ │ │ +000e3bd0: 3c63 6f64 653e 5f5f 6f66 6673 6574 3c2f __offset member of │ │ │ │ +000e3bf0: 6120 6479 6e61 6d69 6320 6172 7261 7920 a dynamic array │ │ │ │ +000e3c00: 6973 2069 676e 6f72 6564 2e3c 2f64 643e is ignored.
│ │ │ │ +000e3c10: 3c2f 646c 3e0a 3c70 3ef0 9f94 9d20 3c61
.

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

.

│ │ │ │ +000e3c50: 3c61 2063 6c61 7373 3d22 616e 6368 6f72 .One-dimen │ │ │ │ +000e3c80: 7369 6f6e 616c 2064 796e 616d 6963 2053 sional dynamic S │ │ │ │ +000e3c90: 4f41 502d 656e 636f 6465 6420 6172 7261 OAP-encoded arra │ │ │ │ +000e3ca0: 7973 2077 6974 6820 6e6f 6e2d 7a65 726f ys with non-zero │ │ │ │ +000e3cb0: 206f 6666 7365 7473 3c2f 6833 3e0a 3c70 offsets

.

The declaration │ │ │ │ +000e3cd0: 206f 6620 6120 6479 6e61 6d69 6320 6172 of a dynamic ar │ │ │ │ +000e3ce0: 7261 7920 6173 2064 6573 6372 6962 6564 ray as described │ │ │ │ +000e3cf0: 2069 6e20 5365 6374 696f 6e20 3c61 2063 in Section One-dimensional │ │ │ │ +000e3d30: 2064 796e 616d 6963 2053 4f41 502d 656e dynamic SOAP-en │ │ │ │ +000e3d40: 636f 6465 6420 6172 7261 7973 3c2f 613e coded arrays │ │ │ │ +000e3d50: 206d 6179 2069 6e63 6c75 6465 2061 6e20 may include an │ │ │ │ +000e3d60: 3c63 6f64 653e 696e 7420 5f5f 6f66 6673 int __offs │ │ │ │ +000e3d70: 6574 3c2f 636f 6465 3e20 6d65 6d62 6572 et member │ │ │ │ +000e3d80: 2e20 5768 656e 2073 6574 2074 6f20 616e . When set to an │ │ │ │ +000e3d90: 2069 6e74 6567 6572 2076 616c 7565 2c20 integer value, │ │ │ │ +000e3da0: 7468 6520 7365 7269 616c 697a 6572 206f the serializer o │ │ │ │ +000e3db0: 6620 7468 6520 6479 6e61 6d69 6320 6172 f the dynamic ar │ │ │ │ +000e3dc0: 7261 7920 7769 6c6c 2075 7365 2074 6869 ray will use thi │ │ │ │ +000e3dd0: 7320 6d65 6d62 6572 2061 7320 7468 6520 s member as the │ │ │ │ +000e3de0: 7374 6172 7420 696e 6465 7820 6f66 2074 start index of t │ │ │ │ +000e3df0: 6865 2061 7272 6179 2061 6e64 2074 6865 he array and the │ │ │ │ +000e3e00: 2053 4f41 502d 656e 636f 6465 6420 6172 SOAP-encoded ar │ │ │ │ +000e3e10: 7261 7920 6f66 6673 6574 2061 7474 7269 ray offset attri │ │ │ │ +000e3e20: 6275 7465 203c 656d 3e3c 636f 6465 3e53 bute S │ │ │ │ +000e3e30: 4f41 502d 454e 433a 6f66 6673 6574 3c2f OAP-ENC:offset will │ │ │ │ +000e3e50: 6170 7065 6172 2069 6e20 7468 6520 584d appear in the XM │ │ │ │ +000e3e60: 4c20 6d65 7373 6167 652e 204e 6f74 6520 L message. Note │ │ │ │ +000e3e70: 7468 6174 2061 7272 6179 206f 6666 7365 that array offse │ │ │ │ +000e3e80: 7473 2069 7320 6120 534f 4150 2031 2e31 ts is a SOAP 1.1 │ │ │ │ +000e3e90: 2073 7065 6369 6669 6320 6665 6174 7572 specific featur │ │ │ │ +000e3ea0: 6520 7768 6963 6820 6973 206e 6f74 2073 e which is not s │ │ │ │ +000e3eb0: 7570 706f 7274 6564 2069 6e20 534f 4150 upported in SOAP │ │ │ │ +000e3ec0: 2031 2e32 2e3c 2f70 3e0a 3c70 3e46 6f72 1.2.

.

For │ │ │ │ +000e3ed0: 2065 7861 6d70 6c65 2c20 7468 6520 666f example, the fo │ │ │ │ +000e3ee0: 6c6c 6f77 696e 6720 6865 6164 6572 2066 llowing header f │ │ │ │ +000e3ef0: 696c 6520 6465 636c 6172 6573 2061 206e ile declares a n │ │ │ │ +000e3f00: 756d 6572 6963 203c 636f 6465 3e56 6563 umeric Vec │ │ │ │ +000e3f10: 746f 723c 2f63 6f64 653e 2063 6c61 7373 tor class │ │ │ │ +000e3f20: 2c20 7768 6963 6820 6973 2061 2064 796e , which is a dyn │ │ │ │ +000e3f30: 616d 6963 2061 7272 6179 206f 6620 666c amic array of fl │ │ │ │ +000e3f40: 6f61 7469 6e67 2070 6f69 6e74 2076 616c oating point val │ │ │ │ +000e3f50: 7565 7320 7769 7468 2061 6e20 696e 6465 ues with an inde │ │ │ │ +000e3f60: 7820 7468 6174 2073 7461 7274 7320 6174 x that starts at │ │ │ │ +000e3f70: 2031 3a3c 2f70 3e0a 3c64 6976 2063 6c61 1:

.
│ │ │ │ +000e3fa0: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // Content │ │ │ │ +000e3fc0: 7320 6f66 2066 696c 6520 2671 756f 743b s of file " │ │ │ │ +000e3fd0: 7665 6374 6f72 2e68 2671 756f 743b 3a20 vector.h": │ │ │ │ +000e3fe0: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ │ +000e4000: 3c73 7061 6e20 636c 6173 733d 226b 6579 class Vector
│ │ │ │ +000e4030: 0a3c 6469 7620 636c 6173 733d 226c 696e .
{ publi │ │ │ │ +000e4060: 633c 2f73 7061 6e3e 3a3c 2f64 6976 3e0a c:
. │ │ │ │ +000e4070: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
│ │ │ │ +000e40a0: 666c 6f61 743c 2f73 7061 6e3e 202a 5f5f float *__ │ │ │ │ +000e40b0: 7074 723b 203c 2f64 6976 3e0a 3c64 6976 ptr;
.
│ │ │ │ +000e40d0: 2020 3c73 7061 6e20 636c 6173 733d 226b int< │ │ │ │ +000e40f0: 2f73 7061 6e3e 205f 5f73 697a 653b 203c /span> __size; < │ │ │ │ +000e4100: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
int │ │ │ │ +000e4140: 205f 5f6f 6666 7365 743b 203c 2f64 6976 __offset;
.
Vector() │ │ │ │ +000e4170: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
.
Ve │ │ │ │ +000e4190: 6374 6f72 283c 7370 616e 2063 6c61 7373 ctor(struc │ │ │ │ +000e41b0: 743c 2f73 7061 6e3e 203c 6120 636c 6173 t │ │ │ │ +000e41e0: 736f 6170 3c2f 613e 202a 2c20 3c73 7061 soap *, int │ │ │ │ +000e4210: 206e 293b 3c2f 6469 763e 0a3c 6469 7620 n);
.
│ │ │ │ +000e4230: 203c 7370 616e 2063 6c61 7373 3d22 6b65 float │ │ │ │ +000e4250: 3c2f 7370 616e 3e26 616d 703b 206f 7065 & ope │ │ │ │ +000e4260: 7261 746f 725b 5d28 3c73 7061 6e20 636c rator[](int i); │ │ │ │ +000e4290: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
..
}; │ │ │ │ +000e4370: 3c2f 6469 763e 0a3c 2f64 6976 3e3c 212d
.

The implementat │ │ │ │ +000e43a0: 696f 6e73 206f 6620 7468 6520 3c63 6f64 ions of the Vector │ │ │ │ +000e43c0: 6d65 7468 6f64 7320 6172 653a 3c2f 703e methods are:

│ │ │ │ +000e43d0: 0a3c 6469 7620 636c 6173 733d 2266 7261 .
Vector: │ │ │ │ +000e4400: 3a56 6563 746f 7228 293c 2f64 6976 3e0a :Vector()
. │ │ │ │ +000e4410: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
{
.
th │ │ │ │ +000e4440: 6973 2d26 6774 3b73 6f61 705f 6465 6661 is->soap_defa │ │ │ │ +000e4450: 756c 7428 4e55 4c4c 293b 3c2f 6469 763e ult(NULL);
│ │ │ │ +000e4460: 0a3c 6469 7620 636c 6173 733d 226c 696e .
}
.
Vec │ │ │ │ +000e4490: 746f 723a 3a56 6563 746f 7228 3c73 7061 tor::Vector(struct │ │ │ │ +000e44c0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap │ │ │ │ +000e44f0: 2a3c 6120 636c 6173 733d 2263 6f64 6522 *soap │ │ │ │ +000e4520: 2c20 3c73 7061 6e20 636c 6173 733d 226b , int< │ │ │ │ +000e4540: 2f73 7061 6e3e 206e 2920 3c2f 6469 763e /span> n)
│ │ │ │ +000e4550: 0a3c 6469 7620 636c 6173 733d 226c 696e .
{
.
t │ │ │ │ +000e4580: 6869 732d 2667 743b 736f 6170 203d 203c his->soap = < │ │ │ │ +000e4590: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +000e45a0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ +000e45b0: 6874 6d6c 2361 3734 3066 3837 3630 6636 html#a740f8760f6 │ │ │ │ +000e45c0: 6565 3463 3635 3834 6532 3563 3631 3266 ee4c6584e25c612f │ │ │ │ +000e45d0: 3538 3564 3730 223e 736f 6170 3c2f 613e 585d70">soap │ │ │ │ +000e45e0: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
.
__pt │ │ │ │ +000e4600: 7220 3d20 736f 6170 5f6e 6577 5f66 6c6f r = soap_new_flo │ │ │ │ +000e4610: 6174 283c 6120 636c 6173 733d 2263 6f64 at(soap, n);
.< │ │ │ │ +000e4650: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +000e4660: 3e20 205f 5f73 697a 6520 3d20 6e3b 203c > __size = n; < │ │ │ │ +000e4670: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
__offs │ │ │ │ +000e4690: 6574 203d 2031 3b20 3c2f 6469 763e 0a3c et = 1;
.< │ │ │ │ +000e46a0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +000e46b0: 3e7d 203c 2f64 6976 3e0a 3c64 6976 2063 >}
.
float& Vector:: │ │ │ │ +000e4700: 6f70 6572 6174 6f72 5b5d 283c 7370 616e operator[](int │ │ │ │ +000e4730: 6929 203c 2f64 6976 3e0a 3c64 6976 2063 i)
.
{.
return │ │ │ │ +000e4790: 5f5f 7074 725b 6920 2d20 5f5f 6f66 6673 __ptr[i - __offs │ │ │ │ +000e47a0: 6574 5d3b 203c 2f64 6976 3e0a 3c64 6976 et];
.
}< │ │ │ │ +000e47c0: 2f64 6976 3e0a 3c2f 6469 763e 3c21 2d2d /div>.

│ │ │ │ +000e47e0: 416e 2065 7861 6d70 6c65 2070 726f 6772 An example progr │ │ │ │ +000e47f0: 616d 2066 7261 676d 656e 7420 7468 6174 am fragment that │ │ │ │ +000e4800: 2073 6572 6961 6c69 7a65 7320 6120 7665 serializes a ve │ │ │ │ +000e4810: 6374 6f72 206f 6620 3320 656c 656d 656e ctor of 3 elemen │ │ │ │ +000e4820: 7473 3a3c 2f70 3e0a 3c64 6976 2063 6c61 ts:

.
│ │ │ │ +000e4850: 3c73 7061 6e20 636c 6173 733d 226b 6579 struct soap< │ │ │ │ +000e48a0: 2f61 3e20 2a3c 6120 636c 6173 733d 2263 /a> *soap │ │ │ │ +000e48d0: 3c2f 613e 203d 203c 6120 636c 6173 733d = soap │ │ │ │ +000e4930: 5f6e 6577 3c2f 613e 2829 3b20 3c2f 6469 _new(); .
Vector v(soap, 3 │ │ │ │ +000e4990: 293b 3c2f 6469 763e 0a3c 6469 7620 636c );
.
v[1] │ │ │ │ +000e49b0: 3d20 312e 303b 203c 2f64 6976 3e0a 3c64 = 1.0;
. │ │ │ │ +000e49d0: 765b 325d 203d 2032 2e30 3b20 3c2f 6469 v[2] = 2.0; .
v[3] = 3.0; │ │ │ │ +000e4a00: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
soap_w │ │ │ │ +000e4a20: 7269 7465 5f56 6563 746f 7228 3c61 2063 rite_Vector(soap, &am │ │ │ │ +000e4a60: 703b 7629 3b3c 2f64 6976 3e0a 3c64 6976 p;v);
..
soap_end( │ │ │ │ +000e4b90: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap) │ │ │ │ +000e4bc0: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
.

T │ │ │ │ +000e4c90: 6865 206f 7574 7075 7420 6973 2061 2070 he output is a p │ │ │ │ +000e4ca0: 6172 7469 616c 6c79 2074 7261 6e73 6d69 artially transmi │ │ │ │ +000e4cb0: 7474 6564 2061 7272 6179 3a3c 2f70 3e0a tted array:

. │ │ │ │ +000e4cc0: 3c64 6976 2063 6c61 7373 3d22 616c 7422
<SOAP-ENC │ │ │ │ +000e4d20: 3a41 7272 6179 3c2f 7370 616e 3e20 3c73 :Array SOAP-ENC:arr │ │ │ │ +000e4d50: 6179 5479 7065 3c2f 7370 616e 3e3d 3c73 ayType=" │ │ │ │ +000e4d80: 7873 643a 666c 6f61 745b 345d 2671 756f xsd:float[4]&quo │ │ │ │ +000e4d90: 743b 3c2f 7370 616e 3e20 3c73 7061 6e20 t; │ │ │ │ +000e4db0: 534f 4150 2d45 4e43 3a6f 6666 7365 743c SOAP-ENC:offset< │ │ │ │ +000e4dc0: 2f73 7061 6e3e 3d3c 7370 616e 2063 6c61 /span>="[1]&quo │ │ │ │ +000e4df0: 743b 3c2f 7370 616e 3e26 6774 3b20 3c2f t;> .
<item>1</item>
. │ │ │ │ +000e4e90: 2026 6c74 3b3c 7370 616e 2063 6c61 7373 <i │ │ │ │ +000e4eb0: 7465 6d3c 2f73 7061 6e3e 2667 743b 3226 tem>2& │ │ │ │ +000e4ec0: 6c74 3b2f 3c73 7061 6e20 636c 6173 733d lt;/it │ │ │ │ +000e4ee0: 656d 3c2f 7370 616e 3e26 6774 3b20 3c2f em> .
<item>3</item>
.& │ │ │ │ +000e4f80: 6c74 3b2f 3c73 7061 6e20 636c 6173 733d lt;/SO │ │ │ │ +000e4fa0: 4150 2d45 4e43 3a41 7272 6179 3c2f 7370 AP-ENC:Array>
.

N │ │ │ │ +000e4fe0: 6f74 6520 7468 6174 203c 656d 3e3c 636f ote that xsd:float[4]< │ │ │ │ +000e5000: 2f63 6f64 653e 3c2f 656d 3e20 6973 2074 /code> is t │ │ │ │ +000e5010: 6865 2074 7970 6520 616e 6420 7368 6170 he type and shap │ │ │ │ +000e5020: 6520 6f66 2074 6865 2065 6e63 6f64 6564 e of the encoded │ │ │ │ +000e5030: 2061 7272 6179 2c20 7768 6963 6820 7374 array, which st │ │ │ │ +000e5040: 6172 7473 2061 7420 6f66 6673 6574 2031 arts at offset 1 │ │ │ │ +000e5050: 2061 6e64 2074 6865 7265 666f 7265 2074 and therefore t │ │ │ │ +000e5060: 6865 2065 6c65 6d65 6e74 2061 7420 3020 he element at 0 │ │ │ │ +000e5070: 6973 206f 6d69 7474 6564 2e3c 2f70 3e0a is omitted.

. │ │ │ │ +000e5080: 3c70 3ef0 9f94 9d20 3c61 2068 7265 663d

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

.

.Nes │ │ │ │ +000e50e0: 7465 6420 6f6e 652d 6469 6d65 6e73 696f ted one-dimensio │ │ │ │ +000e50f0: 6e61 6c20 6479 6e61 6d69 6320 534f 4150 nal dynamic SOAP │ │ │ │ +000e5100: 2d65 6e63 6f64 6564 2061 7272 6179 733c -encoded arrays< │ │ │ │ +000e5110: 2f68 333e 0a3c 703e 4f6e 652d 6469 6d65 /h3>.

One-dime │ │ │ │ +000e5120: 6e73 696f 6e61 6c20 534f 4150 2d65 6e63 nsional SOAP-enc │ │ │ │ +000e5130: 6f64 6564 2064 796e 616d 6963 2061 7272 oded dynamic arr │ │ │ │ +000e5140: 6179 7320 6d61 7920 6265 206e 6573 7465 ays may be neste │ │ │ │ +000e5150: 642e 2046 6f72 2065 7861 6d70 6c65 2c20 d. For example, │ │ │ │ +000e5160: 7573 696e 6720 3c63 6f64 653e 636c 6173 using clas │ │ │ │ +000e5170: 7320 5665 6374 6f72 3c2f 636f 6465 3e20 s Vector │ │ │ │ +000e5180: 6465 636c 6172 6564 2069 6e20 7468 6520 declared in the │ │ │ │ +000e5190: 7072 6576 696f 7573 2073 6563 7469 6f6e previous section │ │ │ │ +000e51a0: 2c20 3c63 6f64 653e 636c 6173 7320 4d61 , class Ma │ │ │ │ +000e51b0: 7472 6978 3c2f 636f 6465 3e20 6973 2064 trix is d │ │ │ │ +000e51c0: 6563 6c61 7265 643a 3c2f 703e 0a3c 6469 eclared:

.
// Co │ │ │ │ +000e5210: 6e74 656e 7473 206f 6620 6669 6c65 2026 ntents of file & │ │ │ │ +000e5220: 7175 6f74 3b6d 6174 7269 782e 6826 7175 quot;matrix.h&qu │ │ │ │ +000e5230: 6f74 3b3a 203c 2f73 7061 6e3e 3c2f 6469 ot;: .
class │ │ │ │ +000e5270: 203c 2f73 7061 6e3e 4d61 7472 6978 203c Matrix < │ │ │ │ +000e5280: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
{ │ │ │ │ +000e52b0: 7075 626c 6963 3c2f 7370 616e 3e3a 203c public: < │ │ │ │ +000e52c0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
Vect │ │ │ │ +000e52e0: 6f72 202a 5f5f 7074 723b 203c 2f64 6976 or *__ptr;
.
int __s │ │ │ │ +000e5330: 697a 653b 203c 2f64 6976 3e0a 3c64 6976 ize;
.
│ │ │ │ +000e5350: 2020 3c73 7061 6e20 636c 6173 733d 226b int< │ │ │ │ +000e5370: 2f73 7061 6e3e 205f 5f6f 6666 7365 743b /span> __offset; │ │ │ │ +000e5380: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
Ma │ │ │ │ +000e53a0: 7472 6978 2829 3b20 3c2f 6469 763e 0a3c trix();
.< │ │ │ │ +000e53b0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +000e53c0: 3e20 2020 204d 6174 7269 7828 3c73 7061 > Matrix(struct │ │ │ │ +000e53f0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap │ │ │ │ +000e5420: 2a3c 6120 636c 6173 733d 2263 6f64 6522 *soap │ │ │ │ +000e5450: 2c20 3c73 7061 6e20 636c 6173 733d 226b , int< │ │ │ │ +000e5470: 2f73 7061 6e3e 206e 2c20 3c73 7061 6e20 /span> n, int m │ │ │ │ +000e54a0: 293b 203c 2f64 6976 3e0a 3c64 6976 2063 );
.
│ │ │ │ +000e54c0: 5665 6374 6f72 2661 6d70 3b20 6f70 6572 Vector& oper │ │ │ │ +000e54d0: 6174 6f72 5b5d 283c 7370 616e 2063 6c61 ator[](int i); │ │ │ │ +000e5500: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
struct soap │ │ │ │ +000e5570: 202a 3c61 2063 6c61 7373 3d22 636f 6465 *soap< │ │ │ │ +000e55c0: 2f61 3e3b 3c2f 6469 763e 0a3c 6469 7620 /a>;
.
}; │ │ │ │ +000e55e0: 3c2f 6469 763e 0a3c 2f64 6976 3e3c 212d
.

The Matrix type │ │ │ │ +000e5610: 2069 7320 6573 7365 6e74 6961 6c6c 7920 is essentially │ │ │ │ +000e5620: 616e 2061 7272 6179 206f 6620 706f 696e an array of poin │ │ │ │ +000e5630: 7465 7273 2074 6f20 6172 7261 7973 2077 ters to arrays w │ │ │ │ +000e5640: 6869 6368 206d 616b 6520 7570 2074 6865 hich make up the │ │ │ │ +000e5650: 2072 6f77 7320 6f66 2061 206d 6174 7269 rows of a matri │ │ │ │ +000e5660: 782e 2054 6865 2073 6572 6961 6c69 7a61 x. The serializa │ │ │ │ +000e5670: 7469 6f6e 206f 6620 7468 6520 7477 6f2d tion of the two- │ │ │ │ +000e5680: 6469 6d65 6e73 696f 6e61 6c20 6479 6e61 dimensional dyna │ │ │ │ +000e5690: 6d69 6320 6172 7261 7920 696e 2069 7320 mic array in is │ │ │ │ +000e56a0: 6e65 7374 6564 2066 6f72 6d20 696e 2058 nested form in X │ │ │ │ +000e56b0: 4d4c 2e3c 2f70 3e0a 3c70 3ef0 9f94 9d20 ML.

.

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

. │ │ │ │ +000e5710: 3c2f 613e 0a4d 756c 7469 2d64 696d 656e .Multi-dimen │ │ │ │ +000e5720: 7369 6f6e 616c 2064 796e 616d 6963 2053 sional dynamic S │ │ │ │ +000e5730: 4f41 502d 656e 636f 6465 6420 6172 7261 OAP-encoded arra │ │ │ │ +000e5740: 7973 3c2f 6833 3e0a 3c70 3e41 2073 7065 ys

.

A spe │ │ │ │ +000e5750: 6369 616c 2066 6f72 6d20 6f66 203c 636f cial form of struct │ │ │ │ +000e5770: 206f 7220 3c63 6f64 653e 636c 6173 733c or class< │ │ │ │ +000e5780: 2f63 6f64 653e 2069 7320 7573 6564 2074 /code> is used t │ │ │ │ +000e5790: 6f20 6465 6669 6e65 206d 756c 7469 2d64 o define multi-d │ │ │ │ +000e57a0: 696d 656e 7369 6f6e 616c 2064 796e 616d imensional dynam │ │ │ │ +000e57b0: 6963 2053 4f41 502d 656e 636f 6465 6420 ic SOAP-encoded │ │ │ │ +000e57c0: 6172 7261 7973 2e20 4561 6368 2061 7272 arrays. Each arr │ │ │ │ +000e57d0: 6179 2068 6173 2061 2070 6f69 6e74 6572 ay has a pointer │ │ │ │ +000e57e0: 2076 6172 6961 626c 6520 616e 6420 6120 variable and a │ │ │ │ +000e57f0: 6d65 6d62 6572 2074 6861 7420 7265 636f member that reco │ │ │ │ +000e5800: 7264 7320 7468 6520 6e75 6d62 6572 206f rds the number o │ │ │ │ +000e5810: 6620 656c 656d 656e 7473 2070 6572 2064 f elements per d │ │ │ │ +000e5820: 696d 656e 7369 6f6e 2e20 4120 3c63 6f64 imension. A K-dimen │ │ │ │ +000e5840: 7369 6f6e 616c 2061 7272 6179 2069 7320 sional array is │ │ │ │ +000e5850: 6465 636c 6172 6564 2061 733a 3c2f 703e declared as:

│ │ │ │ +000e5860: 0a3c 6469 7620 636c 6173 733d 2266 7261 .
s │ │ │ │ +000e58a0: 7472 7563 7420 3c2f 7370 616e 3e61 7272 truct arr │ │ │ │ +000e58b0: 6179 5f6e 616d 6520 3c2f 6469 763e 0a3c ay_name
.< │ │ │ │ +000e58c0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +000e58d0: 3e7b 3c2f 6469 763e 0a3c 6469 7620 636c >{
.
T │ │ │ │ +000e58f0: 7970 6520 2a5f 5f70 7472 3b20 2020 2020 ype *__ptr; │ │ │ │ +000e5900: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // pointer │ │ │ │ +000e5920: 2074 6f20 6172 7261 7920 6f66 2065 6c65 to array of ele │ │ │ │ +000e5930: 6d65 6e74 7320 696e 206d 656d 6f72 793c ments in memory< │ │ │ │ +000e5940: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
. │ │ │ │ +000e5960: 2020 203c 7370 616e 2063 6c61 7373 3d22 int │ │ │ │ +000e5980: 3c2f 7370 616e 3e20 5f5f 7369 7a65 5b4b __size[K │ │ │ │ +000e5990: 5d3b 2020 203c 7370 616e 2063 6c61 7373 ]; // nu │ │ │ │ +000e59b0: 6d62 6572 206f 6620 656c 656d 656e 7473 mber of elements │ │ │ │ +000e59c0: 2070 6572 2064 696d 656e 7369 6f6e 3c2f per dimension
.
│ │ │ │ +000e59f0: 2020 3c73 7061 6e20 636c 6173 733d 226b int< │ │ │ │ +000e5a10: 2f73 7061 6e3e 205f 5f6f 6666 7365 745b /span> __offset[ │ │ │ │ +000e5a20: 4b5d 3b20 3c73 7061 6e20 636c 6173 733d K]; // opt │ │ │ │ +000e5a40: 696f 6e61 6c20 534f 4150 2031 2e31 2061 ional SOAP 1.1 a │ │ │ │ +000e5a50: 7272 6179 206f 6666 7365 743c 2f73 7061 rray offset
.
. │ │ │ │ +000e5a80: 2e2e 2020 2020 2020 2020 2020 2020 2020 .. │ │ │ │ +000e5a90: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // anythin │ │ │ │ +000e5ab0: 6720 7468 6174 2066 6f6c 6c6f 7773 2068 g that follows h │ │ │ │ +000e5ac0: 6572 6520 7769 6c6c 2062 6520 6967 6e6f ere will be igno │ │ │ │ +000e5ad0: 7265 6420 3c2f 7370 616e 3e3c 2f64 6976 red
.
};
.

where the │ │ │ │ +000e5b20: 203c 636f 6465 3e61 7272 6179 5f6e 616d array_nam │ │ │ │ +000e5b30: 653c 2f63 6f64 653e 206d 7573 7420 6265 e must be │ │ │ │ +000e5b40: 2061 206e 6f6e 2d71 7561 6c69 6669 6564 a non-qualified │ │ │ │ +000e5b50: 206e 616d 6520 616e 6420 3c63 6f64 653e name and │ │ │ │ +000e5b60: 5479 7065 3c2f 636f 6465 3e20 6973 2074 Type is t │ │ │ │ +000e5b70: 6865 2074 7970 6520 666f 7220 7468 6520 he type for the │ │ │ │ +000e5b80: 656c 656d 656e 7473 206f 6620 7468 6520 elements of the │ │ │ │ +000e5b90: 6172 7261 792e 2054 6865 203c 636f 6465 array. The __ptr me │ │ │ │ +000e5bb0: 6d62 6572 2070 6f69 6e74 7320 746f 2074 mber points to t │ │ │ │ +000e5bc0: 6865 2061 7272 6179 2076 616c 7565 732e he array values. │ │ │ │ +000e5bd0: 2054 6865 203c 636f 6465 3e5f 5f73 697a The __siz │ │ │ │ +000e5be0: 653c 2f63 6f64 653e 2061 7272 6179 2073 e array s │ │ │ │ +000e5bf0: 7065 6369 6669 6573 2074 6865 206e 756d pecifies the num │ │ │ │ +000e5c00: 6265 7220 6f66 2061 7272 6179 2065 6c65 ber of array ele │ │ │ │ +000e5c10: 6d65 6e74 7320 7065 7220 6469 6d65 6e73 ments per dimens │ │ │ │ +000e5c20: 696f 6e2e 2054 6865 203c 636f 6465 3e5f ion. The _ │ │ │ │ +000e5c30: 5f6f 6666 7365 743c 2f63 6f64 653e 2061 _offset a │ │ │ │ +000e5c40: 7272 6179 2073 7065 6369 6669 6573 2061 rray specifies a │ │ │ │ +000e5c50: 6e20 6f70 7469 6f6e 616c 206f 6666 7365 n optional offse │ │ │ │ +000e5c60: 7420 7065 7220 6469 6d65 6e73 696f 6e2e t per dimension. │ │ │ │ +000e5c70: 3c2f 703e 0a3c 703e 466f 7220 6578 616d

.

For exam │ │ │ │ +000e5c80: 706c 652c 2074 6865 2066 6f6c 6c6f 7769 ple, the followi │ │ │ │ +000e5c90: 6e67 2064 6563 6c61 7261 7469 6f6e 2073 ng declaration s │ │ │ │ +000e5ca0: 7065 6369 6669 6573 2061 206d 6174 7269 pecifies a matri │ │ │ │ +000e5cb0: 7820 636c 6173 733a 3c2f 703e 0a3c 6469 x class:

.
class │ │ │ │ +000e5d00: 203c 2f73 7061 6e3e 4d61 7472 6978 203c Matrix < │ │ │ │ +000e5d10: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
{ │ │ │ │ +000e5d40: 7075 626c 6963 3c2f 7370 616e 3e3a 203c public: < │ │ │ │ +000e5d50: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
float *__ptr;
.
int __s │ │ │ │ +000e5de0: 697a 655b 325d 3b20 3c2f 6469 763e 0a3c ize[2];
.< │ │ │ │ +000e5df0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +000e5e00: 3e20 2020 203c 7370 616e 2063 6c61 7373 > i │ │ │ │ +000e5e20: 6e74 3c2f 7370 616e 3e20 5f5f 6f66 6673 nt __offs │ │ │ │ +000e5e30: 6574 5b32 5d3b 203c 2f64 6976 3e0a 3c64 et[2];
. │ │ │ │ +000e5e50: 7d3b 203c 2f64 6976 3e0a 3c2f 6469 763e };
.
│ │ │ │ +000e5e60: 3c21 2d2d 2066 7261 676d 656e 7420 2d2d

│ │ │ │ +000e6650: 5468 6520 7365 636f 6e64 2066 6f72 6d20 The second form │ │ │ │ +000e6660: 6973 206d 6f72 6520 6765 6e65 7269 632c is more generic, │ │ │ │ +000e6670: 2062 6563 6175 7365 2074 6865 2061 7272 because the arr │ │ │ │ +000e6680: 6179 2063 616e 2062 6520 6465 636c 6172 ay can be declar │ │ │ │ +000e6690: 6564 2061 6e79 7768 6572 6520 696e 2074 ed anywhere in t │ │ │ │ +000e66a0: 6865 2073 7472 7563 7420 6f72 2063 6c61 he struct or cla │ │ │ │ +000e66b0: 7373 2061 6e64 206d 756c 7469 706c 6520 ss and multiple │ │ │ │ +000e66c0: 6172 7261 7973 2063 616e 2062 6520 7573 arrays can be us │ │ │ │ +000e66d0: 6564 2061 7320 6d65 6d62 6572 732c 2065 ed as members, e │ │ │ │ +000e66e0: 6163 6820 7769 7468 2061 203c 636f 6465 ach with a __size m │ │ │ │ +000e6700: 656d 6265 7220 283c 636f 6465 3e5f 5f73 ember (__s │ │ │ │ +000e6710: 697a 654e 616d 653c 2f63 6f64 653e 2069 izeName i │ │ │ │ +000e6720: 7320 616c 736f 2061 6c6c 6f77 6564 2920 s also allowed) │ │ │ │ +000e6730: 7468 6174 2070 7265 6365 6465 7320 6120 that precedes a │ │ │ │ +000e6740: 706f 696e 7465 7220 6d65 6d62 6572 3a3c pointer member:< │ │ │ │ +000e6750: 2f70 3e0a 3c64 6976 2063 6c61 7373 3d22 /p>.

struct │ │ │ │ +000e67a0: 7072 6566 6978 5f5f 6172 7261 795f 6e61 prefix__array_na │ │ │ │ +000e67b0: 6d65 203c 2f64 6976 3e0a 3c64 6976 2063 me
.
{.
... │ │ │ │ +000e67f0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +000e6800: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // other m │ │ │ │ +000e6820: 656d 6265 7273 2074 6861 7420 6172 6520 embers that are │ │ │ │ +000e6830: 7365 7269 616c 697a 6564 3c2f 7370 616e serialized
.
int __size_of_arr │ │ │ │ +000e6890: 6179 313b 203c 7370 616e 2063 6c61 7373 ay1; // nu │ │ │ │ +000e68b0: 6d62 6572 206f 6620 656c 656d 656e 7473 mber of elements │ │ │ │ +000e68c0: 2070 6f69 6e74 6564 2074 6f20 3c2f 7370 pointed to
.
│ │ │ │ +000e68f0: 5479 7065 3120 2a61 7272 6179 313b 2020 Type1 *array1; │ │ │ │ +000e6900: 2020 2020 2020 3c73 7061 6e20 636c 6173 // p │ │ │ │ +000e6920: 6f69 6e74 6572 2074 6f20 6172 7261 7920 ointer to array │ │ │ │ +000e6930: 6f66 2065 6c65 6d65 6e74 7320 696e 206d of elements in m │ │ │ │ +000e6940: 656d 6f72 793c 2f73 7061 6e3e 3c2f 6469 emory.
... │ │ │ │ +000e6970: 2020 2020 2020 2020 2020 2020 2020 203c < │ │ │ │ +000e6980: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ +000e6990: 656e 7422 3e2f 2f20 6f74 6865 7220 6d65 ent">// other me │ │ │ │ +000e69a0: 6d62 6572 7320 7468 6174 2061 7265 2073 mbers that are s │ │ │ │ +000e69b0: 6572 6961 6c69 7a65 643c 2f73 7061 6e3e erialized │ │ │ │ +000e69c0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
int __size_of_arra │ │ │ │ +000e6a10: 7931 3b20 3c73 7061 6e20 636c 6173 733d y1; // num │ │ │ │ +000e6a30: 6265 7220 6f66 2065 6c65 6d65 6e74 7320 ber of elements │ │ │ │ +000e6a40: 706f 696e 7465 6420 746f 203c 2f73 7061 pointed to
.
T │ │ │ │ +000e6a70: 7970 6532 202a 6172 7261 7932 3b20 2020 ype2 *array2; │ │ │ │ +000e6a80: 2020 2020 203c 7370 616e 2063 6c61 7373 // po │ │ │ │ +000e6aa0: 696e 7465 7220 746f 2061 7272 6179 206f inter to array o │ │ │ │ +000e6ab0: 6620 656c 656d 656e 7473 2069 6e20 6d65 f elements in me │ │ │ │ +000e6ac0: 6d6f 7279 3c2f 7370 616e 3e3c 2f64 6976 mory
.
... │ │ │ │ +000e6af0: 2020 2020 2020 2020 2020 2020 2020 3c73 // other mem │ │ │ │ +000e6b20: 6265 7273 2074 6861 7420 6172 6520 7365 bers that are se │ │ │ │ +000e6b30: 7269 616c 697a 6564 3c2f 7370 616e 3e3c rialized< │ │ │ │ +000e6b40: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
};
│ │ │ │ +000e6b60: 0a3c 2f64 6976 3e3c 212d 2d20 6672 6167 .

The < │ │ │ │ +000e6b80: 636f 6465 3e5f 5f73 697a 653c 2f63 6f64 code>__size member should │ │ │ │ +000e6ba0: 2062 6520 616e 203c 636f 6465 3e69 6e74 be an int │ │ │ │ +000e6bb0: 3c2f 636f 6465 3e20 7479 7065 2061 6e64 type and │ │ │ │ +000e6bc0: 2063 616e 6e6f 7420 6265 2061 203c 636f cannot be a size_t │ │ │ │ +000e6be0: 2074 7970 6520 6f72 206f 7468 6572 2069 type or other i │ │ │ │ +000e6bf0: 6e74 6567 6572 2074 7970 652e 3c2f 703e nteger type.

│ │ │ │ +000e6c00: 0a3c 703e 466f 7220 6578 616d 706c 652c .

For example, │ │ │ │ +000e6c10: 2077 6520 6465 6669 6e65 2061 204d 6170 we define a Map │ │ │ │ +000e6c20: 2073 7472 7563 7475 7265 2074 6861 7420 structure that │ │ │ │ +000e6c30: 636f 6e74 6169 6e73 2061 2073 6571 7565 contains a seque │ │ │ │ +000e6c40: 6e63 6520 6f66 206b 6579 2d76 616c 2070 nce of key-val p │ │ │ │ +000e6c50: 6169 7273 3a3c 2f70 3e0a 3c64 6976 2063 airs:

.
│ │ │ │ +000e6c70: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
struct < │ │ │ │ +000e6ca0: 2f73 7061 6e3e 6e73 5f5f 4d61 7020 3c2f /span>ns__Map .
{
.< │ │ │ │ +000e6cd0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +000e6ce0: 3e20 2020 203c 7370 616e 2063 6c61 7373 > i │ │ │ │ +000e6d00: 6e74 3c2f 7370 616e 3e20 5f5f 7369 7a65 nt __size │ │ │ │ +000e6d10: 3b20 3c73 7061 6e20 636c 6173 733d 2263 ; // numbe │ │ │ │ +000e6d30: 7220 6f66 2070 6169 7273 203c 2f73 7061 r of pairs
.
< │ │ │ │ +000e6d60: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +000e6d70: 6f72 6422 3e73 7472 7563 7420 3c2f 7370 ord">struct ns__Pair
.
{
. │ │ │ │ +000e6db0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
char │ │ │ │ +000e6df0: 2a6b 6579 3b3c 2f64 6976 3e0a 3c64 6976 *key;
.
│ │ │ │ +000e6e10: 2020 2020 2020 3c73 7061 6e20 636c 6173 │ │ │ │ +000e6e30: 6368 6172 3c2f 7370 616e 3e20 2a76 616c char *val │ │ │ │ +000e6e40: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
.
} │ │ │ │ +000e6e60: 2a70 6169 723b 2020 2020 3c73 7061 6e20 *pair; │ │ │ │ +000e6e80: 2f2f 2061 7272 6179 206f 6620 7061 6972 // array of pair │ │ │ │ +000e6e90: 733c 2f73 7061 6e3e 3c2f 6469 763e 0a3c s
.< │ │ │ │ +000e6ea0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +000e6eb0: 3e7d 3b3c 2f64 6976 3e0a 3c2f 6469 763e >};
.
│ │ │ │ +000e6ec0: 3c21 2d2d 2066 7261 676d 656e 7420 2d2d

│ │ │ │ +000e7200: 5468 6520 6172 7261 7920 7769 6c6c 2062 The array will b │ │ │ │ +000e7210: 6520 7365 7269 616c 697a 6564 2069 6e20 e serialized in │ │ │ │ +000e7220: 584d 4c20 6173 2061 2073 6571 7565 6e63 XML as a sequenc │ │ │ │ +000e7230: 6520 6f66 2070 6169 7273 3a3c 2f70 3e0a e of pairs:

. │ │ │ │ +000e7240: 3c64 6976 2063 6c61 7373 3d22 616c 7422
<ns:Map>
│ │ │ │ +000e72b0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
<pair&g │ │ │ │ +000e72f0: 743b 203c 2f64 6976 3e0a 3c64 6976 2063 t;
.
│ │ │ │ +000e7310: 266c 743b 3c73 7061 6e20 636c 6173 733d <ke │ │ │ │ +000e7330: 793c 2f73 7061 6e3e 2667 743b 3c73 7061 y>Joe< │ │ │ │ +000e7360: 2f3c 7370 616e 2063 6c61 7373 3d22 6b65 /key>
│ │ │ │ +000e7390: 0a3c 6469 7620 636c 6173 733d 226c 696e .
<val& │ │ │ │ +000e73d0: 6774 3b35 3535 2037 3720 3132 3334 266c gt;555 77 1234&l │ │ │ │ +000e73e0: 743b 2f3c 7370 616e 2063 6c61 7373 3d22 t;/val │ │ │ │ +000e7400: 3c2f 7370 616e 3e26 6774 3b20 3c2f 6469 > .
</pair>
. │ │ │ │ +000e7470: 2026 6c74 3b3c 7370 616e 2063 6c61 7373 <p │ │ │ │ +000e7490: 6169 723c 2f73 7061 6e3e 2667 743b 203c air> < │ │ │ │ +000e74a0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
< │ │ │ │ +000e74c0: 3c73 7061 6e20 636c 6173 733d 226b 6579 key>Su │ │ │ │ +000e7500: 7361 6e3c 2f73 7061 6e3e 266c 743b 2f3c san</< │ │ │ │ +000e7510: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +000e7520: 6f72 6474 7970 6522 3e6b 6579 3c2f 7370 ordtype">key>
.< │ │ │ │ +000e7540: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +000e7550: 3e20 2020 2026 6c74 3b3c 7370 616e 2063 > <val> │ │ │ │ +000e7580: 3b35 3535 2031 3220 3637 3235 266c 743b ;555 12 6725< │ │ │ │ +000e7590: 2f3c 7370 616e 2063 6c61 7373 3d22 6b65 /val>
│ │ │ │ +000e75c0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
</pair& │ │ │ │ +000e7600: 6774 3b20 3c2f 6469 763e 0a3c 6469 7620 gt;
.
& │ │ │ │ +000e7620: 6c74 3b3c 7370 616e 2063 6c61 7373 3d22 lt;pai │ │ │ │ +000e7640: 723c 2f73 7061 6e3e 2667 743b 203c 2f64 r> .
<key>Pete │ │ │ │ +000e76b0: 3c2f 7370 616e 3e26 6c74 3b2f 3c73 7061 </key │ │ │ │ +000e76e0: 2667 743b 203c 2f64 6976 3e0a 3c64 6976 >
.
│ │ │ │ +000e7700: 2020 266c 743b 3c73 7061 6e20 636c 6173 < │ │ │ │ +000e7720: 7661 6c3c 2f73 7061 6e3e 2667 743b 3535 val>55 │ │ │ │ +000e7730: 3520 3939 2034 3332 3126 6c74 3b2f 3c73 5 99 4321</val>
. │ │ │ │ +000e7780: 2020 266c 743b 2f3c 7370 616e 2063 6c61 </pair> │ │ │ │ +000e77b0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
</< │ │ │ │ +000e77d0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +000e77e0: 6f72 6474 7970 6522 3e6e 733a 4d61 703c ordtype">ns:Map< │ │ │ │ +000e77f0: 2f73 7061 6e3e 2667 743b 3c2f 6469 763e /span>>
│ │ │ │ +000e7800: 0a3c 2f64 6976 3e3c 212d 2d20 6672 6167 .
< │ │ │ │ +000e7820: 703e 4465 7365 7269 616c 697a 6174 696f p>Deserializatio │ │ │ │ +000e7830: 6e20 6973 206c 6573 7320 6566 6669 6369 n is less effici │ │ │ │ +000e7840: 656e 7420 636f 6d70 6172 6564 2074 6f20 ent compared to │ │ │ │ +000e7850: 6120 534f 4150 2d65 6e63 6f64 6564 2061 a SOAP-encoded a │ │ │ │ +000e7860: 7272 6179 2c20 6265 6361 7573 6520 7468 rray, because th │ │ │ │ +000e7870: 6520 7369 7a65 206f 6620 7468 6520 7365 e size of the se │ │ │ │ +000e7880: 7175 656e 6365 2069 7320 6e6f 7420 7061 quence is not pa │ │ │ │ +000e7890: 7274 206f 6620 7468 6520 534f 4150 2065 rt of the SOAP e │ │ │ │ +000e78a0: 6e63 6f64 696e 672e 2042 7566 6665 7269 ncoding. Bufferi │ │ │ │ +000e78b0: 6e67 2069 7320 7573 6564 2062 7920 7468 ng is used by th │ │ │ │ +000e78c0: 6520 6465 7365 7269 616c 697a 6572 2074 e deserializer t │ │ │ │ +000e78d0: 6f20 636f 6c6c 6563 7420 7468 6520 656c o collect the el │ │ │ │ +000e78e0: 656d 656e 7473 2069 6e20 6d65 6d6f 7279 ements in memory │ │ │ │ +000e78f0: 2e20 5768 656e 2074 6865 2065 6e64 206f . When the end o │ │ │ │ +000e7900: 6620 7468 6520 6c69 7374 2069 7320 7265 f the list is re │ │ │ │ +000e7910: 6163 6865 642c 2074 6865 2062 7566 6665 ached, the buffe │ │ │ │ +000e7920: 7265 6420 656c 656d 656e 7473 2061 7265 red elements are │ │ │ │ +000e7930: 2063 6f70 6965 6420 746f 2061 206e 6577 copied to a new │ │ │ │ +000e7940: 6c79 2061 6c6c 6f63 6174 6564 206d 616e ly allocated man │ │ │ │ +000e7950: 6167 6564 2073 7061 6365 206f 6e20 7468 aged space on th │ │ │ │ +000e7960: 6520 6865 6170 2066 6f72 2074 6865 2064 e heap for the d │ │ │ │ +000e7970: 796e 616d 6963 2061 7272 6179 2e3c 2f70 ynamic array.

.

Multiple ar │ │ │ │ +000e7990: 7261 7973 2063 616e 2062 6520 7061 7274 rays can be part │ │ │ │ +000e79a0: 206f 6620 6120 7374 7275 6374 206f 7220 of a struct or │ │ │ │ +000e79b0: 636c 6173 732e 2046 6f72 2065 7861 6d70 class. For examp │ │ │ │ +000e79c0: 6c65 3a3c 2f70 3e0a 3c64 6976 2063 6c61 le:

.
│ │ │ │ +000e79f0: 3c73 7061 6e20 636c 6173 733d 226b 6579 struct ns__Contact │ │ │ │ +000e7a20: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
{
│ │ │ │ +000e7a40: 0a3c 6469 7620 636c 6173 733d 226c 696e .
char *fi │ │ │ │ +000e7a80: 7273 744e 616d 653b 203c 2f64 6976 3e0a rstName;
. │ │ │ │ +000e7a90: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
│ │ │ │ +000e7ac0: 6368 6172 3c2f 7370 616e 3e20 2a6c 6173 char *las │ │ │ │ +000e7ad0: 744e 616d 653b 203c 2f64 6976 3e0a 3c64 tName;
. │ │ │ │ +000e7af0: 2020 2420 3c73 7061 6e20 636c 6173 733d $ in │ │ │ │ +000e7b10: 743c 2f73 7061 6e3e 206e 5068 6f6e 6573 t nPhones │ │ │ │ +000e7b20: 3b20 2020 2020 2020 2020 203c 7370 616e ; // number of Ph │ │ │ │ +000e7b50: 6f6e 6573 3c2f 7370 616e 3e3c 2f64 6976 ones
.
ULONG6 │ │ │ │ +000e7bd0: 343c 2f61 3e20 2a70 686f 6e65 4e75 6d62 4 *phoneNumb │ │ │ │ +000e7be0: 6572 3b20 3c73 7061 6e20 636c 6173 733d er; // arr │ │ │ │ +000e7c00: 6179 206f 6620 7068 6f6e 6520 6e75 6d62 ay of phone numb │ │ │ │ +000e7c10: 6572 7320 3c2f 7370 616e 3e3c 2f64 6976 ers
.
$ int nEm │ │ │ │ +000e7c60: 6169 6c73 3b20 2020 2020 2020 2020 203c ails; < │ │ │ │ +000e7c70: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ +000e7c80: 656e 7422 3e2f 2f20 6e75 6d62 6572 206f ent">// number o │ │ │ │ +000e7c90: 6620 656d 6169 6c73 203c 2f73 7061 6e3e f emails │ │ │ │ +000e7ca0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
char **emailAddres │ │ │ │ +000e7cf0: 733b 2020 3c73 7061 6e20 636c 6173 733d s; // arr │ │ │ │ +000e7d10: 6179 206f 6620 656d 6169 6c20 6164 6472 ay of email addr │ │ │ │ +000e7d20: 6573 7365 7320 3c2f 7370 616e 3e3c 2f64 esses .
};
.< │ │ │ │ +000e7d50: 2f64 6976 3e3c 212d 2d20 6672 6167 6d65 /div>

The XML │ │ │ │ +000e7d70: 2073 6572 6961 6c69 7a61 7469 6f6e 206f serialization o │ │ │ │ +000e7d80: 6620 616e 2065 7861 6d70 6c65 203c 636f f an example ns__Contact is:

. │ │ │ │ +000e7dc0: 3c64 6976 2063 6c61 7373 3d22 6672 6167
<ns:Contact │ │ │ │ +000e7e10: 3c2f 7370 616e 3e26 6774 3b20 3c2f 6469 > .
<firstName>J │ │ │ │ +000e7e80: 6f65 3c2f 7370 616e 3e26 6c74 3b2f 3c73 oe</firstNam │ │ │ │ +000e7eb0: 653c 2f73 7061 6e3e 2667 743b 203c 2f64 e> .
<lastName>S │ │ │ │ +000e7f20: 6d69 7468 3c2f 7370 616e 3e26 6c74 3b2f mith</ │ │ │ │ +000e7f30: 3c73 7061 6e20 636c 6173 733d 226b 6579 lastNa │ │ │ │ +000e7f50: 6d65 3c2f 7370 616e 3e26 6774 3b20 3c2f me> .
<phoneNumb │ │ │ │ +000e7fa0: 6572 3c2f 7370 616e 3e26 6774 3b35 3535 er>555 │ │ │ │ +000e7fb0: 3131 3132 3232 3226 6c74 3b2f 3c73 7061 1112222</phoneNumbe │ │ │ │ +000e7fe0: 723c 2f73 7061 6e3e 2667 743b 203c 2f64 r> .
<phoneNumbe │ │ │ │ +000e8030: 723c 2f73 7061 6e3e 2667 743b 3535 3531 r>5551 │ │ │ │ +000e8040: 3233 3435 3637 266c 743b 2f3c 7370 616e 234567</phoneNumber │ │ │ │ +000e8070: 3c2f 7370 616e 3e26 6774 3b20 3c2f 6469 > .
<phoneNumber │ │ │ │ +000e80c0: 3c2f 7370 616e 3e26 6774 3b35 3535 3233 >55523 │ │ │ │ +000e80d0: 3438 3930 3126 6c74 3b2f 3c73 7061 6e20 48901</phoneNumber< │ │ │ │ +000e8100: 2f73 7061 6e3e 2667 743b 203c 2f64 6976 /span>>
.
<emailAddress │ │ │ │ +000e8150: 3c2f 7370 616e 3e26 6774 3b3c 7370 616e >Joe.Smith@mail.com │ │ │ │ +000e81a0: 3c2f 7370 616e 3e26 6c74 3b2f 3c73 7061 </emailAddre │ │ │ │ +000e81d0: 7373 3c2f 7370 616e 3e26 6774 3b20 3c2f ss> .
<emailAddr │ │ │ │ +000e8220: 6573 733c 2f73 7061 6e3e 2667 743b 3c73 ess>Joe@< │ │ │ │ +000e8250: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +000e8260: 6f72 6422 3e53 6d69 7468 2e63 6f6d 3c2f ord">Smith.com</emailAddress │ │ │ │ +000e82a0: 3c2f 7370 616e 3e26 6774 3b20 3c2f 6469 > .
</ns:Contact>
. │ │ │ │ +000e8300: 3c2f 6469 763e 3c21 2d2d 2066 7261 676d

For C++, a bett │ │ │ │ +000e8330: 6572 2061 6c74 6572 6e61 7469 7665 2074 er alternative t │ │ │ │ +000e8340: 6f20 6172 7261 7973 2061 7265 2063 6f6e o arrays are con │ │ │ │ +000e8350: 7461 696e 6572 732c 2077 6869 6368 2061 tainers, which a │ │ │ │ +000e8360: 7265 2064 6573 6372 6962 6564 206e 6578 re described nex │ │ │ │ +000e8370: 742e 3c2f 703e 0a3c 703e f09f 949d 203c t.

.

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

.

.STL conta │ │ │ │ +000e83e0: 696e 6572 733c 2f68 333e 0a3c 703e 5468 iners

.

Th │ │ │ │ +000e83f0: 6520 5354 4c20 636f 6e74 6169 6e65 7273 e STL containers │ │ │ │ +000e8400: 203c 636f 6465 3e73 7464 3a3a 6465 7175 std::dequ │ │ │ │ +000e8410: 653c 2f63 6f64 653e 2c20 3c63 6f64 653e e, │ │ │ │ +000e8420: 7374 643a 3a6c 6973 743c 2f63 6f64 653e std::list │ │ │ │ +000e8430: 2c20 3c63 6f64 653e 7374 643a 3a73 6574 , std::set │ │ │ │ +000e8440: 3c2f 636f 6465 3e2c 2061 6e64 203c 636f , and std::vector are serial │ │ │ │ +000e8470: 697a 6162 6c65 2069 6e20 584d 4c20 6279 izable in XML by │ │ │ │ +000e8480: 2074 6865 2073 6f61 7063 7070 322d 6765 the soapcpp2-ge │ │ │ │ +000e8490: 6e65 7261 7465 6420 7365 7269 616c 697a nerated serializ │ │ │ │ +000e84a0: 6572 732e 3c2f 703e 0a3c 703e 496e 206f ers.

.

In o │ │ │ │ +000e84b0: 7264 6572 2074 6f20 7573 6520 636f 6e74 rder to use cont │ │ │ │ +000e84c0: 6169 6e65 7273 2069 6e20 616e 2069 6e74 ainers in an int │ │ │ │ +000e84d0: 6572 6661 6365 2068 6561 6465 7220 6669 erface header fi │ │ │ │ +000e84e0: 6c65 2066 6f72 2073 6f61 7063 7070 322c le for soapcpp2, │ │ │ │ +000e84f0: 2069 6d70 6f72 7420 3c65 6d3e 3c63 6f64 import stldeque.h, stllist.h, < │ │ │ │ +000e8540: 636f 6465 3e73 746c 7365 742e 683c 2f63 code>stlset.h, or stlvecto │ │ │ │ +000e8570: 722e 683c 2f63 6f64 653e 3c2f 656d 3e20 r.h │ │ │ │ +000e8580: 746f 2065 6e61 626c 6520 3c63 6f64 653e to enable │ │ │ │ +000e8590: 7374 643a 3a64 6571 7565 3c2f 636f 6465 std::deque, std::li │ │ │ │ +000e85b0: 7374 3c2f 636f 6465 3e2c 203c 636f 6465 st, std::set │ │ │ │ +000e85d0: 2c20 616e 6420 3c63 6f64 653e 7374 643a , and std: │ │ │ │ +000e85e0: 3a76 6563 746f 723c 2f63 6f64 653e 2c20 :vector, │ │ │ │ +000e85f0: 7265 7370 6563 7469 7665 6c79 2e20 466f respectively. Fo │ │ │ │ +000e8600: 7220 6578 616d 706c 653a 3c2f 703e 0a3c r example:

.< │ │ │ │ +000e8610: 6469 7620 636c 6173 733d 2266 7261 676d div class="fragm │ │ │ │ +000e8620: 656e 7422 3e3c 6469 7620 636c 6173 733d ent">
#import " │ │ │ │ +000e8660: 7374 6c76 6563 746f 722e 6826 7175 6f74 stlvector.h" │ │ │ │ +000e8670: 3b3c 2f73 7061 6e3e 203c 2f64 6976 3e0a ;
. │ │ │ │ +000e8680: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
class ns__myClass │ │ │ │ +000e86c0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
{ public: │ │ │ │ +000e8700: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
st │ │ │ │ +000e8720: 643a 3a76 6563 746f 7226 6c74 3b69 6e74 d::vector<int │ │ │ │ +000e8730: 2667 743b 2020 2020 2020 2020 2020 6e75 > nu │ │ │ │ +000e8740: 6d62 6572 2031 3a31 303b 203c 7370 616e mber 1:10; // 1 to 10 numb │ │ │ │ +000e8770: 6572 733c 2f73 7061 6e3e 3c2f 6469 763e ers
│ │ │ │ +000e8780: 0a3c 6469 7620 636c 6173 733d 226c 696e .
std::vect │ │ │ │ +000e87a0: 6f72 266c 743b 7374 643a 3a73 7472 696e or<std::strin │ │ │ │ +000e87b0: 6726 6774 3b20 2a6e 616d 6520 2020 323b g> *name 2; │ │ │ │ +000e87c0: 2020 2020 3c73 7061 6e20 636c 6173 733d // mor │ │ │ │ +000e87e0: 6520 7468 616e 2032 206e 616d 6573 3c2f e than 2 names
.
}; │ │ │ │ +000e8810: 3c2f 6469 763e 0a3c 2f64 6976 3e3c 212d
.

The use of poin │ │ │ │ +000e8840: 7465 7220 6d65 6d62 6572 7320 7375 6368 ter members such │ │ │ │ +000e8850: 2061 7320 666f 7220 3c63 6f64 653e 6e61 as for na │ │ │ │ +000e8860: 6d65 3c2f 636f 6465 3e20 7368 6f77 6e20 me shown │ │ │ │ +000e8870: 6162 6f76 6520 6973 2070 6f73 7369 626c above is possibl │ │ │ │ +000e8880: 652c 2062 7574 206e 6f74 2072 6571 7569 e, but not requi │ │ │ │ +000e8890: 7265 642e 2041 6c73 6f20 3c63 6f64 653e red. Also │ │ │ │ +000e88a0: 6d69 6e4f 6363 7572 7320 3a20 6d61 784f minOccurs : maxO │ │ │ │ +000e88b0: 6363 7572 733c 2f63 6f64 653e 2061 6e64 ccurs and │ │ │ │ +000e88c0: 203c 636f 6465 3e6d 696e 4f63 6375 7273 minOccurs │ │ │ │ +000e88d0: 3c2f 636f 6465 3e20 6c65 6e67 7468 2063 length c │ │ │ │ +000e88e0: 6f6e 7374 7261 696e 7473 2063 616e 2062 onstraints can b │ │ │ │ +000e88f0: 6520 7370 6563 6966 6965 6420 6173 2073 e specified as s │ │ │ │ +000e8900: 686f 776e 2069 6e20 7468 6520 6578 616d hown in the exam │ │ │ │ +000e8910: 706c 6520 6162 6f76 652e 2054 6865 2058 ple above. The X │ │ │ │ +000e8920: 4d4c 2073 6368 656d 6120 7468 6174 2063 ML schema that c │ │ │ │ +000e8930: 6f72 7265 7370 6f6e 6473 2074 6f20 7468 orresponds to th │ │ │ │ +000e8940: 6520 3c63 6f64 653e 6e73 5f5f 6d79 436c e ns__myCl │ │ │ │ +000e8950: 6173 733c 2f63 6f64 653e 2074 7970 6520 ass type │ │ │ │ +000e8960: 6973 3a3c 2f70 3e0a 3c64 6976 2063 6c61 is:

.
│ │ │ │ +000e8990: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
< │ │ │ │ +000e89c0: 636f 6d70 6c65 7854 7970 653c 2f73 7061 complexType name="myClass&q │ │ │ │ +000e8a20: 756f 743b 3c2f 7370 616e 3e26 6774 3b20 uot;> │ │ │ │ +000e8a30: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
<< │ │ │ │ +000e8a50: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +000e8a60: 6f72 6474 7970 6522 3e73 6571 7565 6e63 ordtype">sequenc │ │ │ │ +000e8a70: 653c 2f73 7061 6e3e 2667 743b 203c 2f64 e> .
<element< │ │ │ │ +000e8ac0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> nam │ │ │ │ +000e8ae0: 653c 2f73 7061 6e3e 3d3c 7370 616e 2063 e="numbe │ │ │ │ +000e8b10: 7226 7175 6f74 3b3c 2f73 7061 6e3e 203c r" < │ │ │ │ +000e8b20: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +000e8b30: 6f72 6422 3e74 7970 653c 2f73 7061 6e3e ord">type │ │ │ │ +000e8b40: 3d3c 7370 616e 2063 6c61 7373 3d22 7374 =&qu │ │ │ │ +000e8b60: 6f74 3b78 7364 3a69 6e74 2671 756f 743b ot;xsd:int" │ │ │ │ +000e8b70: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c mi │ │ │ │ +000e8b90: 6e4f 6363 7572 733c 2f73 7061 6e3e 3d3c nOccurs=< │ │ │ │ +000e8ba0: 7370 616e 2063 6c61 7373 3d22 7374 7269 span class="stri │ │ │ │ +000e8bb0: 6e67 6c69 7465 7261 6c22 3e26 7175 6f74 ngliteral">" │ │ │ │ +000e8bc0: 3b31 2671 756f 743b 3c2f 7370 616e 3e20 ;1" │ │ │ │ +000e8bd0: 3c73 7061 6e20 636c 6173 733d 226b 6579 maxOccurs< │ │ │ │ +000e8bf0: 2f73 7061 6e3e 3d3c 7370 616e 2063 6c61 /span>="10" │ │ │ │ +000e8c20: 3b3c 2f73 7061 6e3e 2f26 6774 3b20 3c2f ;/> .
<< │ │ │ │ +000e8c50: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +000e8c60: 6f72 6474 7970 6522 3e65 6c65 6d65 6e74 ordtype">element │ │ │ │ +000e8c70: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c na │ │ │ │ +000e8c90: 6d65 3c2f 7370 616e 3e3d 3c73 7061 6e20 me="name │ │ │ │ +000e8cc0: 2671 756f 743b 3c2f 7370 616e 3e20 3c73 " type= │ │ │ │ +000e8cf0: 3c73 7061 6e20 636c 6173 733d 2273 7472 &quo │ │ │ │ +000e8d10: 743b 7873 643a 7374 7269 6e67 2671 756f t;xsd:string&quo │ │ │ │ +000e8d20: 743b 3c2f 7370 616e 3e20 3c73 7061 6e20 t; │ │ │ │ +000e8d40: 6d69 6e4f 6363 7572 733c 2f73 7061 6e3e minOccurs │ │ │ │ +000e8d50: 3d3c 7370 616e 2063 6c61 7373 3d22 7374 =&qu │ │ │ │ +000e8d70: 6f74 3b32 2671 756f 743b 3c2f 7370 616e ot;2" maxOccur │ │ │ │ +000e8da0: 733c 2f73 7061 6e3e 3d3c 7370 616e 2063 s="unbou │ │ │ │ +000e8dd0: 6e64 6564 2671 756f 743b 3c2f 7370 616e nded"/>
. │ │ │ │ +000e8e00: 2020 266c 743b 2f3c 7370 616e 2063 6c61 </sequence │ │ │ │ +000e8e30: 2667 743b 203c 2f64 6976 3e0a 3c64 6976 >
.
&l │ │ │ │ +000e8e50: 743b 2f3c 7370 616e 2063 6c61 7373 3d22 t;/com │ │ │ │ +000e8e70: 706c 6578 5479 7065 3c2f 7370 616e 3e26 plexType& │ │ │ │ +000e8e80: 6774 3b3c 2f64 6976 3e0a 3c2f 6469 763e gt;
.
│ │ │ │ +000e8e90: 3c21 2d2d 2066 7261 676d 656e 7420 2d2d

To e │ │ │ │ -000eaa50: 6e61 626c 6520 7468 6520 636f 6e74 6169 nable the contai │ │ │ │ -000eaa60: 6e65 722c 2077 6520 6164 6420 7468 6520 ner, we add the │ │ │ │ -000eaa70: 666f 6c6c 6f77 696e 6720 7477 6f20 6c69 following two li │ │ │ │ -000eaa80: 6e65 7320 746f 2074 6865 2069 6e74 6572 nes to the inter │ │ │ │ -000eaa90: 6661 6365 2068 6561 6465 7220 6669 6c65 face header file │ │ │ │ -000eaaa0: 2066 6f72 2073 6f61 7063 7070 323a 3c2f for soapcpp2:.

#include & │ │ │ │ -000eab00: 7175 6f74 3b73 696d 706c 6556 6563 746f quot;simpleVecto │ │ │ │ -000eab10: 722e 6826 7175 6f74 3b3c 2f73 7061 6e3e r.h" │ │ │ │ -000eab20: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
│ │ │ │ -000eab50: 7465 6d70 6c61 7465 3c2f 7370 616e 3e20 template │ │ │ │ -000eab60: 266c 743b 3c73 7061 6e20 636c 6173 733d <class< │ │ │ │ -000eab80: 2f73 7061 6e3e 2054 2667 743b 203c 7370 /span> T> class │ │ │ │ -000eabb0: 7369 6d70 6c65 5665 6374 6f72 3b3c 2f64 simpleVector;.

Th │ │ │ │ -000eabe0: 6520 636f 6e74 6169 6e65 7220 636c 6173 e container clas │ │ │ │ -000eabf0: 7320 6974 7365 6c66 2073 686f 756c 6420 s itself should │ │ │ │ -000eac00: 6e6f 7420 6265 2064 6566 696e 6564 2069 not be defined i │ │ │ │ -000eac10: 6e20 7468 6520 696e 7465 7266 6163 6520 n the interface │ │ │ │ -000eac20: 6865 6164 6572 2066 696c 652c 206f 6e6c header file, onl │ │ │ │ -000eac30: 7920 7468 6520 7465 6d70 6c61 7465 2064 y the template d │ │ │ │ -000eac40: 6563 6c61 7261 7469 6f6e 2073 7566 6669 eclaration suffi │ │ │ │ -000eac50: 6365 7320 666f 7220 736f 6170 6370 7032 ces for soapcpp2 │ │ │ │ -000eac60: 2074 6f20 6765 6e65 7261 7465 2073 6572 to generate ser │ │ │ │ -000eac70: 6961 6c69 7a65 7273 2e20 5265 6361 6c6c ializers. Recall │ │ │ │ -000eac80: 2074 6861 7420 7468 6520 3c63 6f64 653e that the │ │ │ │ -000eac90: 2369 6e63 6c75 6465 3c2f 636f 6465 3e20 #include │ │ │ │ -000eaca0: 6469 7265 6374 6976 6573 2061 7265 206e directives are n │ │ │ │ -000eacb0: 6f74 2065 7865 6375 7465 6420 6279 2073 ot executed by s │ │ │ │ -000eacc0: 6f61 7063 7070 3220 6275 7420 7369 6d70 oapcpp2 but simp │ │ │ │ -000eacd0: 6c79 2070 6173 7365 6420 6f6e 2074 6f20 ly passed on to │ │ │ │ -000eace0: 7468 6520 6765 6e65 7261 7465 6420 736f the generated so │ │ │ │ -000eacf0: 7572 6365 2063 6f64 652e 2054 6869 7320 urce code. This │ │ │ │ -000ead00: 696e 636c 7564 6520 7370 6563 6966 6965 include specifie │ │ │ │ -000ead10: 7320 696e 2074 6865 2067 656e 6572 6174 s in the generat │ │ │ │ -000ead20: 6564 2073 6f75 7263 6520 636f 6465 2077 ed source code w │ │ │ │ -000ead30: 6865 7265 2074 6865 2063 6f6e 7461 696e here the contain │ │ │ │ -000ead40: 6572 2069 7320 6163 7475 616c 6c79 2064 er is actually d │ │ │ │ -000ead50: 6566 696e 6564 2e3c 2f70 3e0a 3c70 3ef0 efined.

.

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

.

< │ │ │ │ -000eadc0: 2f61 3e0a 506f 6c79 6d6f 7270 6869 6320 /a>.Polymorphic │ │ │ │ -000eadd0: 6479 6e61 6d69 6320 6172 7261 7973 2061 dynamic arrays a │ │ │ │ -000eade0: 6e64 206c 6973 7473 3c2f 6833 3e0a 3c70 nd lists

.

Polymorphic arr │ │ │ │ -000eae00: 6179 732c 2074 6861 7420 6973 2c20 6172 ays, that is, ar │ │ │ │ -000eae10: 7261 7973 206f 6620 7661 6c75 6573 206f rays of values o │ │ │ │ -000eae20: 6620 616e 7920 7479 7065 2c20 6361 6e20 f any type, can │ │ │ │ -000eae30: 6265 2073 6572 6961 6c69 7a65 6420 696e be serialized in │ │ │ │ -000eae40: 2058 4d4c 2077 6865 6e20 6465 636c 6172 XML when declar │ │ │ │ -000eae50: 6564 2061 7320 616e 2061 7272 6179 206f ed as an array o │ │ │ │ -000eae60: 6620 706f 696e 7465 7273 2074 6f20 6120 f pointers to a │ │ │ │ -000eae70: 6261 7365 2063 6c61 7373 2e20 466f 7220 base class. For │ │ │ │ -000eae80: 6578 616d 706c 653a 3c2f 703e 0a3c 6469 example:

.
class │ │ │ │ -000eaed0: 203c 2f73 7061 6e3e 6e73 5f5f 4f62 6a65 ns__Obje │ │ │ │ -000eaee0: 6374 203c 2f64 6976 3e0a 3c64 6976 2063 ct
.
{ public:
.
│ │ │ │ -000eaf40: 2e2e 2e20 3c73 7061 6e20 636c 6173 733d ... // mem │ │ │ │ -000eaf60: 6265 7273 206f 6620 6e73 5f5f 4f62 6a65 bers of ns__Obje │ │ │ │ -000eaf70: 6374 3c2f 7370 616e 3e3c 2f64 6976 3e0a ct
. │ │ │ │ -000eaf80: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
};
.
class ns__Data : public │ │ │ │ -000eb000: 6e73 5f5f 4f62 6a65 6374 203c 2f64 6976 ns__Object
.
{ publ │ │ │ │ -000eb040: 6963 3c2f 7370 616e 3e3a 203c 2f64 6976 ic:
.
... // members of │ │ │ │ -000eb090: 6e73 5f5f 4461 7461 3c2f 7370 616e 3e3c ns__Data< │ │ │ │ -000eb0a0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
};
.
class │ │ │ │ -000eb0f0: 3c2f 7370 616e 3e41 7272 6179 4f66 4f62 ArrayOfOb │ │ │ │ -000eb100: 6a65 6374 203c 2f64 6976 3e0a 3c64 6976 ject
.
{ │ │ │ │ -000eb120: 3c73 7061 6e20 636c 6173 733d 226b 6579 public:
.
│ │ │ │ -000eb160: 2020 6e73 5f5f 4f62 6a65 6374 202a 2a5f ns__Object **_ │ │ │ │ -000eb170: 5f70 7472 3b20 3c73 7061 6e20 636c 6173 _ptr; // p │ │ │ │ -000eb190: 6f69 6e74 6572 2074 6f20 6172 7261 7920 ointer to array │ │ │ │ -000eb1a0: 6f66 2070 6f69 6e74 6572 7320 746f 2062 of pointers to b │ │ │ │ -000eb1b0: 6173 6520 6f72 2064 6572 6976 6564 206f ase or derived o │ │ │ │ -000eb1c0: 626a 6563 7473 203c 2f73 7061 6e3e 3c2f bjects .
int │ │ │ │ -000eb210: 5f5f 7369 7a65 3b20 2020 2020 2020 2020 __size; │ │ │ │ -000eb220: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // size of │ │ │ │ -000eb240: 2074 6865 2061 7272 6179 3c2f 7370 616e the array
.
}; .
clas │ │ │ │ -000eb2a0: 7320 3c2f 7370 616e 3e6e 735f 5f4f 626a s ns__Obj │ │ │ │ -000eb2b0: 6563 7473 203c 2f64 6976 3e0a 3c64 6976 ects
.
{ │ │ │ │ -000eb2d0: 3c73 7061 6e20 636c 6173 733d 226b 6579 public:
.
│ │ │ │ -000eb310: 2020 7374 643a 3a76 6563 746f 7226 6c74 std::vector< │ │ │ │ -000eb320: 3b6e 735f 5f4f 626a 6563 7426 6774 3b20 ;ns__Object> │ │ │ │ -000eb330: 6f62 6a65 6374 733b 203c 7370 616e 2063 objects; / │ │ │ │ -000eb350: 2f20 7665 6374 6f72 206f 6620 6261 7365 / vector of base │ │ │ │ -000eb360: 206f 7220 6465 7269 7665 6420 6f62 6a65 or derived obje │ │ │ │ -000eb370: 6374 7320 3c2f 7370 616e 3e3c 2f64 6976 cts
.
};
.

The point │ │ │ │ -000eb3c0: 6572 7320 696e 2074 6865 2061 7272 6179 ers in the array │ │ │ │ -000eb3d0: 2063 616e 2070 6f69 6e74 2074 6f20 7468 can point to th │ │ │ │ -000eb3e0: 6520 3c63 6f64 653e 6e73 5f5f 4f62 6a65 e ns__Obje │ │ │ │ -000eb3f0: 6374 3c2f 636f 6465 3e20 6261 7365 2069 ct base i │ │ │ │ -000eb400: 6e73 7461 6e63 6573 206f 7220 3c63 6f64 nstances or ns__Data derived instan │ │ │ │ -000eb430: 6365 732c 2077 6869 6368 2077 696c 6c20 ces, which will │ │ │ │ -000eb440: 6265 2073 6572 6961 6c69 7a65 6420 6163 be serialized ac │ │ │ │ -000eb450: 636f 7264 696e 676c 7920 696e 2058 4d4c cordingly in XML │ │ │ │ -000eb460: 2e20 4465 7269 7665 6420 696e 7374 616e . Derived instan │ │ │ │ -000eb470: 6365 7320 6172 6520 696e 6469 6361 7465 ces are indicate │ │ │ │ -000eb480: 6420 6279 203c 656d 3e3c 636f 6465 3e78 d by x │ │ │ │ -000eb490: 7369 3a74 7970 653c 2f63 6f64 653e 3c2f si:type attribute in │ │ │ │ -000eb4b0: 2058 4d4c 2077 6974 6820 7468 6520 7175 XML with the qu │ │ │ │ -000eb4c0: 616c 6966 6965 6420 6e61 6d65 206f 6620 alified name of │ │ │ │ -000eb4d0: 7468 6520 636c 6173 732c 2074 6f20 6469 the class, to di │ │ │ │ -000eb4e0: 7374 696e 6775 6973 6820 6465 7269 7665 stinguish derive │ │ │ │ -000eb4f0: 6420 696e 7374 616e 6365 7320 6672 6f6d d instances from │ │ │ │ -000eb500: 2074 6865 2062 6173 6520 696e 7374 616e the base instan │ │ │ │ -000eb510: 6365 732e 2057 6974 686f 7574 2074 6869 ces. Without thi │ │ │ │ -000eb520: 7320 6174 7472 6962 7574 6520 7468 6520 s attribute the │ │ │ │ -000eb530: 6465 7365 7269 616c 697a 6572 2077 696c deserializer wil │ │ │ │ -000eb540: 6c20 6e6f 7420 696e 7374 616e 7469 6174 l not instantiat │ │ │ │ -000eb550: 6520 7468 6520 6465 7269 7665 6420 696e e the derived in │ │ │ │ -000eb560: 7374 616e 6365 2062 7574 2061 2062 6173 stance but a bas │ │ │ │ -000eb570: 6520 696e 7374 616e 6365 2073 696e 6365 e instance since │ │ │ │ -000eb580: 2074 6865 7265 2069 7320 6e6f 2069 6465 there is no ide │ │ │ │ -000eb590: 6e74 6966 7969 6e67 2069 6e66 6f72 6d61 ntifying informa │ │ │ │ -000eb5a0: 7469 6f6e 2074 6f20 6469 7374 696e 6775 tion to distingu │ │ │ │ -000eb5b0: 6973 6820 7468 6520 584d 4c20 666f 726d ish the XML form │ │ │ │ -000eb5c0: 7320 6578 6365 7074 2066 6f72 2074 6865 s except for the │ │ │ │ -000eb5d0: 203c 656d 3e3c 636f 6465 3e78 7369 3a74 xsi:t │ │ │ │ -000eb5e0: 7970 653c 2f63 6f64 653e 3c2f 656d 3e20 ype │ │ │ │ -000eb5f0: 6174 7472 6962 7574 652e 3c2f 703e 0a3c attribute.

.< │ │ │ │ -000eb600: 703e 5369 6e63 6520 7765 2063 616e 6e6f p>Since we canno │ │ │ │ -000eb610: 7420 7573 6520 6479 6e61 6d69 6320 6269 t use dynamic bi │ │ │ │ -000eb620: 6e64 696e 6720 746f 2073 7570 706f 7274 nding to support │ │ │ │ -000eb630: 2070 6f6c 796d 6f72 7068 6973 6d20 696e polymorphism in │ │ │ │ -000eb640: 2043 2c20 616e 6f74 6865 7220 6d65 6368 C, another mech │ │ │ │ -000eb650: 616e 6973 6d20 7765 2063 616e 2075 7365 anism we can use │ │ │ │ -000eb660: 2069 7320 766f 6964 2070 6f69 6e74 6572 is void pointer │ │ │ │ -000eb670: 7320 2e20 4865 7265 2069 7320 616e 2065 s . Here is an e │ │ │ │ -000eb680: 7861 6d70 6c65 206f 6620 6120 706f 6c79 xample of a poly │ │ │ │ -000eb690: 6d6f 7270 6869 6320 534f 4150 2d65 6e63 morphic SOAP-enc │ │ │ │ -000eb6a0: 6f64 6564 2061 7272 6179 203c 636f 6465 oded array ArrayOfObject and a non- │ │ │ │ -000eb6d0: 534f 4150 2064 796e 616d 6963 2061 7272 SOAP dynamic arr │ │ │ │ -000eb6e0: 6179 203c 636f 6465 3e6e 735f 5f4f 626a ay ns__Obj │ │ │ │ -000eb6f0: 6563 7473 3c2f 636f 6465 3e20 7468 6174 ects that │ │ │ │ -000eb700: 2068 6f6c 6420 7661 6c75 6573 206f 6620 hold values of │ │ │ │ -000eb710: 616e 7920 7365 7269 616c 697a 6162 6c65 any serializable │ │ │ │ -000eb720: 2074 7970 653a 3c2f 703e 0a3c 6469 7620 type:

.
struct │ │ │ │ -000eb770: 3c2f 7370 616e 3e5f 5f77 7261 7070 6572 __wrapper │ │ │ │ -000eb780: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
{
.
int __t │ │ │ │ -000eb7e0: 7970 653b 2020 203c 7370 616e 2063 6c61 ype; // │ │ │ │ -000eb800: 6964 656e 7469 6679 2074 6865 2074 7970 identify the typ │ │ │ │ -000eb810: 6520 6265 6c6f 7720 6279 2053 4f41 505f e below by SOAP_ │ │ │ │ -000eb820: 5459 5045 5f54 203c 2f73 7061 6e3e 3c2f TYPE_T .
void │ │ │ │ -000eb870: 202a 5f5f 6974 656d 3b20 3c73 7061 6e20 *__item; │ │ │ │ -000eb890: 2f2f 2070 6f69 6e74 6572 2074 6f20 6461 // pointer to da │ │ │ │ -000eb8a0: 7461 206f 6620 7479 7065 2054 203c 2f73 ta of type T
.
}; │ │ │ │ -000eb8d0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
s │ │ │ │ -000eb900: 7472 7563 7420 3c2f 7370 616e 3e41 7272 truct Arr │ │ │ │ -000eb910: 6179 4f66 4f62 6a65 6374 203c 2f64 6976 ayOfObject
.
{
.
│ │ │ │ -000eb950: 2020 3c73 7061 6e20 636c 6173 733d 226b struct < │ │ │ │ -000eb970: 2f73 7061 6e3e 5f5f 7772 6170 7065 7220 /span>__wrapper │ │ │ │ -000eb980: 2a5f 5f70 7472 3b20 3c73 7061 6e20 636c *__ptr; // │ │ │ │ -000eb9a0: 2070 6f69 6e74 6572 2074 6f20 6172 7261 pointer to arra │ │ │ │ -000eb9b0: 793c 2f73 7061 6e3e 3c2f 6469 763e 0a3c y
.< │ │ │ │ -000eb9c0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -000eb9d0: 3e20 2020 203c 7370 616e 2063 6c61 7373 > i │ │ │ │ -000eb9f0: 6e74 3c2f 7370 616e 3e20 5f5f 7369 7a65 nt __size │ │ │ │ -000eba00: 3b20 2020 2020 2020 2020 2020 2020 203c ; < │ │ │ │ -000eba10: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ -000eba20: 656e 7422 3e2f 2f20 7369 7a65 206f 6620 ent">// size of │ │ │ │ -000eba30: 7468 6520 6172 7261 793c 2f73 7061 6e3e the array │ │ │ │ -000eba40: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
}; .
struc │ │ │ │ -000eba90: 7420 3c2f 7370 616e 3e6e 735f 5f4f 626a t ns__Obj │ │ │ │ -000ebaa0: 6563 7473 203c 2f64 6976 3e0a 3c64 6976 ects
.
{< │ │ │ │ -000ebac0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
int │ │ │ │ -000ebb00: 205f 5f73 697a 653b 2020 2020 2020 2020 __size; │ │ │ │ -000ebb10: 2020 2020 2020 2020 3c73 7061 6e20 636c // │ │ │ │ -000ebb30: 2073 697a 6520 6f66 2074 6865 2061 7272 size of the arr │ │ │ │ -000ebb40: 6179 3c2f 7370 616e 3e3c 2f64 6976 3e0a ay
. │ │ │ │ -000ebb50: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
stru │ │ │ │ -000ebb80: 6374 203c 2f73 7061 6e3e 5f5f 7772 6170 ct __wrap │ │ │ │ -000ebb90: 7065 7220 2a6f 626a 6563 7473 3b20 3c73 per *objects; // pointer t │ │ │ │ -000ebbc0: 6f20 6172 7261 793c 2f73 7061 6e3e 3c2f o array.
};
. │ │ │ │ -000ebbf0: 3c2f 6469 763e 3c21 2d2d 2066 7261 676d

This e │ │ │ │ -000ebc10: 7861 6d70 6c65 2075 7365 7320 616e 2022 xample uses an " │ │ │ │ -000ebc20: 696e 7669 7369 626c 6522 2074 7970 6520 invisible" type │ │ │ │ -000ebc30: 3c63 6f64 653e 5f5f 7772 6170 7065 723c __wrapper< │ │ │ │ -000ebc40: 2f63 6f64 653e 2061 6e64 206d 656d 6265 /code> and membe │ │ │ │ -000ebc50: 7220 3c63 6f64 653e 5f5f 6172 7261 793c r __array< │ │ │ │ -000ebc60: 2f63 6f64 653e 2c20 7768 6963 6820 7374 /code>, which st │ │ │ │ -000ebc70: 6172 7420 7769 7468 2061 2064 6f75 626c art with a doubl │ │ │ │ -000ebc80: 6520 756e 6465 7273 636f 7265 2e20 5468 e underscore. Th │ │ │ │ -000ebc90: 6573 6520 6e61 6d65 7320 6172 6520 6e65 ese names are ne │ │ │ │ -000ebca0: 7665 7220 7669 7369 626c 6520 696e 2073 ver visible in s │ │ │ │ -000ebcb0: 6572 6961 6c69 7a65 6420 584d 4c2e 2054 erialized XML. T │ │ │ │ -000ebcc0: 6865 203c 636f 6465 3e5f 5f74 7970 653c he __type< │ │ │ │ -000ebcd0: 2f63 6f64 653e 206d 656d 6265 7220 6f66 /code> member of │ │ │ │ -000ebce0: 203c 636f 6465 3e5f 5f77 7261 7070 6572 __wrapper │ │ │ │ -000ebcf0: 3c2f 636f 6465 3e20 6973 2061 203c 636f is a SOAP_TYPE_T value that │ │ │ │ -000ebd20: 2069 6465 6e74 6966 6965 7320 7468 6520 identifies the │ │ │ │ -000ebd30: 7479 7065 203c 636f 6465 3e54 3c2f 636f type T that _ │ │ │ │ -000ebd50: 5f69 7465 6d3c 2f63 6f64 653e 2070 6f69 _item poi │ │ │ │ -000ebd60: 6e74 7320 746f 2c20 7365 6520 5365 6374 nts to, see Sect │ │ │ │ -000ebd70: 696f 6e20 3c61 2063 6c61 7373 3d22 656c ion Void po │ │ │ │ -000ebda0: 696e 7465 7220 7365 7269 616c 697a 6174 inter serializat │ │ │ │ -000ebdb0: 696f 6e3c 2f61 3e2e 3c2f 703e 0a3c 703e ion.

.

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

.Ho │ │ │ │ -000ebe20: 7720 746f 2063 6861 6e67 6520 7468 6520 w to change the │ │ │ │ -000ebe30: 7461 6720 6e61 6d65 7320 6f66 2061 7272 tag names of arr │ │ │ │ -000ebe40: 6179 2069 7465 6d20 656c 656d 656e 7473 ay item elements │ │ │ │ -000ebe50: 3c2f 6833 3e0a 3c70 3e54 6865 2064 6566

.

The def │ │ │ │ -000ebe60: 6175 6c74 2058 4d4c 2065 6c65 6d65 6e74 ault XML element │ │ │ │ -000ebe70: 2074 6167 206e 616d 6520 666f 7220 6172 tag name for ar │ │ │ │ -000ebe80: 7261 7920 656c 656d 656e 7473 2069 7320 ray elements is │ │ │ │ -000ebe90: 3c65 6d3e 3c63 6f64 653e 6974 656d 3c2f item, whic │ │ │ │ -000ebeb0: 6820 6361 6e20 6265 2063 6861 6e67 6564 h can be changed │ │ │ │ -000ebec0: 2e20 5468 6520 3c63 6f64 653e 5f5f 7074 . The __pt │ │ │ │ -000ebed0: 723c 2f63 6f64 653e 206d 656d 6265 7220 r member │ │ │ │ -000ebee0: 696e 2061 2073 7472 7563 7420 6f72 2063 in a struct or c │ │ │ │ -000ebef0: 6c61 7373 206f 6620 6120 6479 6e61 6d69 lass of a dynami │ │ │ │ -000ebf00: 6320 6172 7261 7920 6d61 7920 6861 7665 c array may have │ │ │ │ -000ebf10: 2061 6e20 6f70 7469 6f6e 616c 2073 7566 an optional suf │ │ │ │ -000ebf20: 6669 7820 7061 7274 2074 6861 7420 7370 fix part that sp │ │ │ │ -000ebf30: 6563 6966 6965 7320 7468 6520 6e61 6d65 ecifies the name │ │ │ │ -000ebf40: 206f 6620 7468 6520 656c 656d 656e 7420 of the element │ │ │ │ -000ebf50: 7461 6720 696e 2058 4d4c 2e20 5468 6174 tag in XML. That │ │ │ │ -000ebf60: 2069 732c 2074 6865 2073 7566 6669 7820 is, the suffix │ │ │ │ -000ebf70: 6973 2070 6172 7420 6f66 2074 6865 203c is part of the < │ │ │ │ -000ebf80: 636f 6465 3e5f 5f70 7472 3c2f 636f 6465 code>__ptr member name:.

Type │ │ │ │ -000ebfd0: 2a5f 5f70 7472 6172 7261 795f 656c 745f *__ptrarray_elt_ │ │ │ │ -000ebfe0: 6e61 6d65 3c2f 6469 763e 0a3c 2f64 6976 name
.

The arr │ │ │ │ -000ec170: 6179 2069 7320 7365 7269 616c 697a 6564 ay is serialized │ │ │ │ -000ec180: 2061 733a 3c2f 703e 0a3c 6469 7620 636c as:

.
<SOAP-ENC:Array< │ │ │ │ -000ec1f0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> SOA │ │ │ │ -000ec210: 502d 454e 433a 6172 7261 7954 7970 653c P-ENC:arrayType< │ │ │ │ -000ec220: 2f73 7061 6e3e 3d3c 7370 616e 2063 6c61 /span>="xsd:str │ │ │ │ -000ec250: 696e 675b 325d 2671 756f 743b 3c2f 7370 ing[2]">
.< │ │ │ │ -000ec270: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -000ec280: 3e20 2026 6c74 3b3c 7370 616e 2063 6c61 > <string&g │ │ │ │ -000ec2b0: 743b 3c73 7061 6e20 636c 6173 733d 226b t;Hello
</string │ │ │ │ -000ec300: 2667 743b 203c 2f64 6976 3e0a 3c64 6976 >
.
│ │ │ │ -000ec320: 266c 743b 3c73 7061 6e20 636c 6173 733d <st │ │ │ │ -000ec340: 7269 6e67 3c2f 7370 616e 3e26 6774 3b3c ring>< │ │ │ │ -000ec350: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -000ec360: 6f72 6422 3e57 6f72 6c64 3c2f 7370 616e ord">World</ │ │ │ │ -000ec390: 7374 7269 6e67 3c2f 7370 616e 3e26 6774 string> │ │ │ │ -000ec3a0: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
</ │ │ │ │ -000ec3c0: 3c73 7061 6e20 636c 6173 733d 226b 6579 SOAP-E │ │ │ │ -000ec3e0: 4e43 3a41 7272 6179 3c2f 7370 616e 3e26 NC:Array& │ │ │ │ -000ec3f0: 6774 3b3c 2f64 6976 3e0a 3c2f 6469 763e gt;
.
│ │ │ │ -000ec400: 3c21 2d2d 2066 7261 676d 656e 7420 2d2d

The advant │ │ │ │ -000ec890: 6167 6520 6f66 2074 6869 7320 7374 7275 age of this stru │ │ │ │ -000ec8a0: 6374 206f 7220 636c 6173 7320 6973 2074 ct or class is t │ │ │ │ -000ec8b0: 6865 2061 6269 6c69 7479 2074 6f20 7365 he ability to se │ │ │ │ -000ec8c0: 7269 616c 697a 6572 2072 6177 2062 696e rializer raw bin │ │ │ │ -000ec8d0: 6172 7920 6461 7461 2066 726f 6d20 6d65 ary data from me │ │ │ │ -000ec8e0: 6d6f 7279 2c20 7369 6e63 6520 7468 6520 mory, since the │ │ │ │ -000ec8f0: 736f 6170 6370 7032 2d67 656e 6572 6174 soapcpp2-generat │ │ │ │ -000ec900: 6564 2073 6572 6961 6c69 7a65 7220 636f ed serializer co │ │ │ │ -000ec910: 6e76 6572 7473 2074 6865 2062 696e 6172 nverts the binar │ │ │ │ -000ec920: 7920 6461 7461 2074 6f2f 6672 6f6d 2062 y data to/from b │ │ │ │ -000ec930: 6173 6536 3420 696e 2058 4d4c 2e3c 2f70 ase64 in XML.

.

To introduc │ │ │ │ -000ec950: 6520 6120 6e65 7720 584d 4c20 7363 6865 e a new XML sche │ │ │ │ -000ec960: 6d61 2074 7970 6520 6465 7269 7665 6420 ma type derived │ │ │ │ -000ec970: 6672 6f6d 203c 656d 3e3c 636f 6465 3e62 from b │ │ │ │ -000ec980: 6173 6536 3442 696e 6172 793c 2f63 6f64 ase64Binary use the │ │ │ │ -000ec9a0: 7361 6d65 2073 7472 7563 7420 6f72 2063 same struct or c │ │ │ │ -000ec9b0: 6c61 7373 2073 7472 7563 7475 7265 2c20 lass structure, │ │ │ │ -000ec9c0: 6275 7420 7769 7468 2061 6e6f 7468 6572 but with another │ │ │ │ -000ec9d0: 206e 616d 652e 2046 6f72 2065 7861 6d70 name. For examp │ │ │ │ -000ec9e0: 6c65 3a3c 2f70 3e0a 3c64 6976 2063 6c61 le:

.
│ │ │ │ -000eca10: 3c73 7061 6e20 636c 6173 733d 226b 6579 struct ns__binary.
{
.< │ │ │ │ -000eca60: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -000eca70: 3e20 2020 203c 7370 616e 2063 6c61 7373 > u │ │ │ │ -000eca90: 6e73 6967 6e65 643c 2f73 7061 6e3e 203c nsigned < │ │ │ │ -000ecaa0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -000ecab0: 6f72 6474 7970 6522 3e63 6861 723c 2f73 ordtype">char *__ptr; .
int _ │ │ │ │ -000ecb10: 5f73 697a 653b 203c 2f64 6976 3e0a 3c64 _size;
. │ │ │ │ -000ecb30: 7d3b 3c2f 6469 763e 0a3c 2f64 6976 3e3c };
.
< │ │ │ │ -000ecb40: 212d 2d20 6672 6167 6d65 6e74 202d 2d3e !-- fragment --> │ │ │ │ -000ecb50: 3c70 3e54 6865 2072 6573 756c 7469 6e67

The resulting │ │ │ │ -000ecb60: 2058 4d4c 2073 6368 656d 6120 7479 7065 XML schema type │ │ │ │ -000ecb70: 2069 733a 3c2f 703e 0a3c 6469 7620 636c is:

.
<simpleType name="binary&qu │ │ │ │ -000ecc30: 6f74 3b3c 2f73 7061 6e3e 2667 743b 3c2f ot;>.
<restricti │ │ │ │ -000ecc80: 6f6e 3c2f 7370 616e 3e20 3c73 7061 6e20 on │ │ │ │ -000ecca0: 6261 7365 3c2f 7370 616e 3e3d 3c73 7061 base="xs │ │ │ │ -000eccd0: 643a 6261 7365 3634 4269 6e61 7279 2671 d:base64Binary&q │ │ │ │ -000ecce0: 756f 743b 3c2f 7370 616e 3e26 6774 3b3c uot;>< │ │ │ │ -000eccf0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
</< │ │ │ │ -000ecd10: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -000ecd20: 6f72 6474 7970 6522 3e72 6573 7472 6963 ordtype">restric │ │ │ │ -000ecd30: 7469 6f6e 3c2f 7370 616e 3e26 6774 3b3c tion>< │ │ │ │ -000ecd40: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
</simpleTyp │ │ │ │ -000ecd80: 653c 2f73 7061 6e3e 2667 743b 3c2f 6469 e>.

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

.

│ │ │ │ -000ece10: 0a68 6578 4269 6e61 7279 2073 6572 6961 .hexBinary seria │ │ │ │ -000ece20: 6c69 7a61 7469 6f6e 3c2f 6832 3e0a 3c70 lization

.

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

│ │ │ │ -000ecef0: 0a3c 6469 7620 636c 6173 733d 2266 7261 .
s │ │ │ │ -000ecf30: 7472 7563 7420 3c2f 7370 616e 3e3c 6120 truct xsd__hexBinary< │ │ │ │ -000ecf80: 2f61 3e20 3c2f 6469 763e 0a3c 6469 7620 /a>
.
{.
unsigned c │ │ │ │ -000ed000: 6861 723c 2f73 7061 6e3e 202a 3c61 2063 har *__ptr; .
int < │ │ │ │ -000ed0b0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -000ed0c0: 7265 663d 2273 7472 7563 7478 7364 5f5f ref="structxsd__ │ │ │ │ -000ed0d0: 5f5f 6865 785f 6269 6e61 7279 2e68 746d __hex_binary.htm │ │ │ │ -000ed0e0: 6c23 6134 6332 3133 6434 3438 6166 3339 l#a4c213d448af39 │ │ │ │ -000ed0f0: 3535 6633 3764 6465 6434 6632 3338 3330 55f37dded4f23830 │ │ │ │ -000ed100: 3165 3622 3e5f 5f73 697a 653c 2f61 3e3b 1e6">__size; │ │ │ │ -000ed110: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
};.

The │ │ │ │ -000ed150: 2061 6476 616e 7461 6765 206f 6620 7468 advantage of th │ │ │ │ -000ed160: 6973 2073 7472 7563 7420 6f72 2063 6c61 is struct or cla │ │ │ │ -000ed170: 7373 2069 7320 7468 6520 6162 696c 6974 ss is the abilit │ │ │ │ -000ed180: 7920 746f 2073 6572 6961 6c69 7a65 7220 y to serializer │ │ │ │ -000ed190: 7261 7720 6269 6e61 7279 2064 6174 6120 raw binary data │ │ │ │ -000ed1a0: 6672 6f6d 206d 656d 6f72 792c 2073 696e from memory, sin │ │ │ │ -000ed1b0: 6365 2074 6865 2073 6f61 7063 7070 322d ce the soapcpp2- │ │ │ │ -000ed1c0: 6765 6e65 7261 7465 6420 7365 7269 616c generated serial │ │ │ │ -000ed1d0: 697a 6572 2063 6f6e 7665 7274 7320 7468 izer converts th │ │ │ │ -000ed1e0: 6520 6269 6e61 7279 2064 6174 6120 746f e binary data to │ │ │ │ -000ed1f0: 2f66 726f 6d20 6865 7861 6465 6369 6d61 /from hexadecima │ │ │ │ -000ed200: 6c20 696e 2058 4d4c 2e3c 2f70 3e0a 3c70 l in XML.

.

If a binary typ │ │ │ │ -000ed220: 6520 7375 6368 2061 7320 3c63 6f64 653e e such as │ │ │ │ -000ed230: 3c61 2063 6c61 7373 3d22 656c 2220 6872 xs │ │ │ │ -000ed2a0: 645f 5f62 6173 6536 3442 696e 6172 793c d__base64Binary< │ │ │ │ -000ed2b0: 2f61 3e3c 2f63 6f64 653e 2069 7320 616c /a> is al │ │ │ │ -000ed2c0: 7265 6164 7920 6465 6669 6e65 642c 2074 ready defined, t │ │ │ │ -000ed2d0: 6865 6e20 7765 2063 616e 2073 696d 706c hen we can simpl │ │ │ │ -000ed2e0: 7920 7573 6520 6120 3c63 6f64 653e 7479 y use a ty │ │ │ │ -000ed2f0: 7065 6465 663c 2f63 6f64 653e 2074 6f20 pedef to │ │ │ │ -000ed300: 696e 7472 6f64 7563 6520 7468 6520 6865 introduce the he │ │ │ │ -000ed310: 7820 7661 7269 616e 743a 3c2f 703e 0a3c x variant:

.< │ │ │ │ -000ed320: 6469 7620 636c 6173 733d 2266 7261 676d div class="fragm │ │ │ │ -000ed330: 656e 7422 3e3c 6469 7620 636c 6173 733d ent">.{ │ │ │ │ -000ed3d0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 public
:
. │ │ │ │ -000ed410: 2020 203c 7370 616e 2063 6c61 7373 3d22 uns │ │ │ │ -000ed430: 6967 6e65 643c 2f73 7061 6e3e 203c 7370 igned char *__p │ │ │ │ -000ed4c0: 7472 3c2f 613e 3b20 3c2f 6469 763e 0a3c tr;
.< │ │ │ │ -000ed4d0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -000ed4e0: 3e20 2020 203c 7370 616e 2063 6c61 7373 > i │ │ │ │ -000ed500: 6e74 3c2f 7370 616e 3e20 3c61 2063 6c61 nt __size; < │ │ │ │ -000ed570: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
};
.
typede │ │ │ │ -000ed5c0: 663c 2f73 7061 6e3e 203c 6120 636c 6173 f │ │ │ │ -000ed600: 7873 645f 5f62 6173 6536 3442 696e 6172 xsd__base64Binar │ │ │ │ -000ed610: 793c 2f61 3e20 3c61 2063 6c61 7373 3d22 y xsd__h │ │ │ │ -000ed650: 6578 4269 6e61 7279 3c2f 613e 3b20 3c73 exBinary; // serialize │ │ │ │ -000ed680: 7320 696e 746f 2068 6578 2063 6f6e 7465 s into hex conte │ │ │ │ -000ed690: 6e74 3c2f 7370 616e 3e3c 2f64 6976 3e0a nt
. │ │ │ │ -000ed6a0: 3c2f 6469 763e 3c21 2d2d 2066 7261 676d

This l │ │ │ │ -000ed6c0: 6574 7320 736f 6170 6370 7032 2067 656e ets soapcpp2 gen │ │ │ │ -000ed6d0: 6572 6174 6520 3c65 6d3e 3c63 6f64 653e erate │ │ │ │ -000ed6e0: 7873 643a 6261 7365 3634 4269 6e61 7279 xsd:base64Binary │ │ │ │ -000ed6f0: 3c2f 636f 6465 3e3c 2f65 6d3e 2061 6e64 and │ │ │ │ -000ed700: 203c 656d 3e3c 636f 6465 3e78 7364 3a68 xsd:h │ │ │ │ -000ed710: 6578 4269 6e61 7279 3c2f 636f 6465 3e3c exBinary< │ │ │ │ -000ed720: 2f65 6d3e 2073 6572 6961 6c69 7a65 7273 /em> serializers │ │ │ │ -000ed730: 2e3c 2f70 3e0a 3c70 3ef0 9f94 9d20 3c61 .

.

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

.

│ │ │ │ -000ed770: 3c61 2063 6c61 7373 3d22 616e 6368 6f72 < │ │ │ │ -000ed790: 2f61 3e0a 534f 4150 2052 5043 2065 6e63 /a>.SOAP RPC enc │ │ │ │ -000ed7a0: 6f64 6564 2076 6572 7375 7320 646f 6375 oded versus docu │ │ │ │ -000ed7b0: 6d65 6e74 2f6c 6974 6572 616c 2073 7479 ment/literal sty │ │ │ │ -000ed7c0: 6c65 3c2f 6832 3e0a 3c70 3e53 4f41 5020 le

.

SOAP │ │ │ │ -000ed7d0: 6861 7320 7365 7665 7261 6c20 7374 796c has several styl │ │ │ │ -000ed7e0: 6573 3a3c 2f70 3e0a 3c75 6c3e 0a3c 6c69 es:

.
    .
  • SOAP RPC encodi │ │ │ │ -000ed800: 6e67 2075 7365 7320 584d 4c20 7468 6174 ng uses XML that │ │ │ │ -000ed810: 2069 7320 7265 7374 7269 6374 6564 2074 is restricted t │ │ │ │ -000ed820: 6f20 534f 4150 2073 7472 7563 7475 7265 o SOAP structure │ │ │ │ -000ed830: 7320 746f 2065 6e73 7572 6520 7072 6f67 s to ensure prog │ │ │ │ -000ed840: 7261 6d6d 696e 672d 6c61 6e67 7561 6765 ramming-language │ │ │ │ -000ed850: 2069 6e74 6572 6f70 6572 6162 696c 6974 interoperabilit │ │ │ │ -000ed860: 792e 204e 6f74 2061 6c6c 6f77 6564 2061 y. Not allowed a │ │ │ │ -000ed870: 7265 2076 616c 7565 7320 7365 7269 616c re values serial │ │ │ │ -000ed880: 697a 6564 2061 7320 584d 4c20 6174 7472 ized as XML attr │ │ │ │ -000ed890: 6962 7574 6573 2c20 6172 7261 7973 2073 ibutes, arrays s │ │ │ │ -000ed8a0: 686f 756c 6420 6265 2073 6572 6961 6c69 hould be seriali │ │ │ │ -000ed8b0: 7a65 6420 6173 2053 4f41 502d 656e 636f zed as SOAP-enco │ │ │ │ -000ed8c0: 6465 6420 6172 7261 7973 2069 6e73 7465 ded arrays inste │ │ │ │ -000ed8d0: 6164 206f 6620 584d 4c20 656c 656d 656e ad of XML elemen │ │ │ │ -000ed8e0: 7420 7265 7065 7469 7469 6f6e 7320 2869 t repetitions (i │ │ │ │ -000ed8f0: 2e65 2e20 3c65 6d3e 3c63 6f64 653e 7873 .e. xs │ │ │ │ -000ed900: 643a 7365 7175 656e 6365 206d 6178 4f63 d:sequence maxOc │ │ │ │ -000ed910: 6375 7273 3d22 756e 626f 756e 6465 6422 curs="unbounded" │ │ │ │ -000ed920: 3c2f 636f 6465 3e3c 2f65 6d3e 2069 7320 is │ │ │ │ -000ed930: 6e6f 7420 616c 6c6f 7765 6429 2c20 616e not allowed), an │ │ │ │ -000ed940: 6420 3c65 6d3e 3c63 6f64 653e 7873 643a d xsd: │ │ │ │ -000ed950: 6368 6f69 6365 3c2f 636f 6465 3e3c 2f65 choice components ar │ │ │ │ -000ed970: 6520 6e6f 7420 616c 6c6f 7765 642e 204d e not allowed. M │ │ │ │ -000ed980: 756c 7469 2d72 6566 6572 656e 6365 6420 ulti-referenced │ │ │ │ -000ed990: 656c 656d 656e 7473 2061 7265 2075 7365 elements are use │ │ │ │ -000ed9a0: 6420 746f 2073 6572 6961 6c69 7a65 2064 d to serialize d │ │ │ │ -000ed9b0: 6174 6120 7374 7275 6374 7572 6520 6772 ata structure gr │ │ │ │ -000ed9c0: 6170 6873 2e20 4265 6361 7573 6520 6164 aphs. Because ad │ │ │ │ -000ed9d0: 6469 7469 6f6e 616c 2053 4f41 502d 656e ditional SOAP-en │ │ │ │ -000ed9e0: 636f 6469 6e67 2073 7065 6369 6669 6320 coding specific │ │ │ │ -000ed9f0: 6174 7472 6962 7574 6573 2061 7265 2070 attributes are p │ │ │ │ -000eda00: 7265 7365 6e74 2074 6861 7420 6172 6520 resent that are │ │ │ │ -000eda10: 6e6f 7420 6465 6669 6e65 6420 696e 2074 not defined in t │ │ │ │ -000eda20: 6865 2058 4d4c 2073 6368 656d 6120 286f he XML schema (o │ │ │ │ -000eda30: 6620 7468 6520 5753 444c 292c 2073 7472 f the WSDL), str │ │ │ │ -000eda40: 6963 7420 584d 4c20 7363 6865 6d61 2076 ict XML schema v │ │ │ │ -000eda50: 616c 6964 6174 6f72 7320 6d61 7920 7265 alidators may re │ │ │ │ -000eda60: 6a65 6374 2053 4f41 502d 656e 636f 6465 ject SOAP-encode │ │ │ │ -000eda70: 6420 636f 6e74 656e 742e 2054 6865 2053 d content. The S │ │ │ │ -000eda80: 4f41 5020 426f 6479 2063 6f6e 7461 696e OAP Body contain │ │ │ │ -000eda90: 7320 6174 206d 6f73 7420 6f6e 6520 7365 s at most one se │ │ │ │ -000edaa0: 7276 6963 6520 6f70 6572 6174 696f 6e20 rvice operation │ │ │ │ -000edab0: 7265 7175 6573 7420 656c 656d 656e 7420 request element │ │ │ │ -000edac0: 6f72 2061 7420 6d6f 7374 206f 6e65 2073 or at most one s │ │ │ │ -000edad0: 6572 7669 6365 206f 7065 7261 7469 6f6e ervice operation │ │ │ │ -000edae0: 2072 6573 706f 6e73 6520 656c 656d 656e response elemen │ │ │ │ -000edaf0: 7420 616e 6420 7468 6520 656e 636f 6469 t and the encodi │ │ │ │ -000edb00: 6e67 2073 7479 6c65 2069 7320 696e 6469 ng style is indi │ │ │ │ -000edb10: 6361 7465 6420 7769 7468 2074 6865 203c cated with the < │ │ │ │ -000edb20: 656d 3e3c 636f 6465 3e53 4f41 502d 454e em>SOAP-EN │ │ │ │ -000edb30: 563a 656e 636f 6469 6e67 5374 796c 653d V:encodingStyle= │ │ │ │ -000edb40: 222e 2e2e 223c 2f63 6f64 653e 3c2f 656d "..." attribute in t │ │ │ │ -000edb60: 6865 2053 4f41 5020 426f 6479 206f 7220 he SOAP Body or │ │ │ │ -000edb70: 6f6e 6520 6f72 206d 6f72 6520 6f66 2069 one or more of i │ │ │ │ -000edb80: 7473 2073 7562 2d65 6c65 6d65 6e74 732e ts sub-elements. │ │ │ │ -000edb90: 2054 6869 7320 7374 796c 6520 6973 2073 This style is s │ │ │ │ -000edba0: 7065 6369 6669 6564 2066 6f72 2074 6865 pecified for the │ │ │ │ -000edbb0: 2065 6e74 6972 6520 7365 7276 6963 6520 entire service │ │ │ │ -000edbc0: 6465 636c 6172 6564 2075 6e64 6572 206e declared under n │ │ │ │ -000edbd0: 616d 6573 7061 6365 2070 7265 6669 7820 amespace prefix │ │ │ │ -000edbe0: 3c63 6f64 653e 6e73 3c2f 636f 6465 3e20 ns │ │ │ │ -000edbf0: 7769 7468 3a20 3c64 6976 2063 6c61 7373 with:
    //gsoap ns s │ │ │ │ -000edc40: 6572 7669 6365 2073 7479 6c65 3a20 2020 ervice style: │ │ │ │ -000edc50: 2072 7063 3c2f 7370 616e 3e3c 2f64 6976 rpc
    .
    //gsoa │ │ │ │ -000edc90: 7020 6e73 2073 6572 7669 6365 2065 6e63 p ns service enc │ │ │ │ -000edca0: 6f64 696e 673a 2065 6e63 6f64 6564 3c2f oding: encoded
    .
  • .
  • SOA │ │ │ │ -000edce0: 5020 646f 6375 6d65 6e74 2f6c 6974 6572 P document/liter │ │ │ │ -000edcf0: 616c 2075 7365 7320 584d 4c20 636f 6e73 al uses XML cons │ │ │ │ -000edd00: 7472 6169 6e65 6420 746f 2074 6865 2058 trained to the X │ │ │ │ -000edd10: 4d4c 2073 6368 656d 6120 7468 6174 2064 ML schema that d │ │ │ │ -000edd20: 6566 696e 6573 2074 6865 2058 4d4c 2063 efines the XML c │ │ │ │ -000edd30: 6f6e 7465 6e74 2e20 5468 6520 7365 7269 ontent. The seri │ │ │ │ -000edd40: 616c 697a 6174 696f 6e20 6f66 2074 7265 alization of tre │ │ │ │ -000edd50: 652d 6261 7365 6420 6461 7461 2073 7472 e-based data str │ │ │ │ -000edd60: 7563 7475 7265 7320 6973 2061 6363 7572 uctures is accur │ │ │ │ -000edd70: 6174 6520 696e 2058 4d4c 2e20 5468 6520 ate in XML. The │ │ │ │ -000edd80: 7365 7269 616c 697a 6174 696f 6e20 6f66 serialization of │ │ │ │ -000edd90: 2064 6967 7261 7068 2d73 6861 7065 6420 digraph-shaped │ │ │ │ -000edda0: 6461 7461 2073 7472 7563 7475 7265 7320 data structures │ │ │ │ -000eddb0: 7265 7375 6c74 7320 696e 2074 6865 2064 results in the d │ │ │ │ -000eddc0: 7570 6c69 6361 7469 6f6e 206f 6620 6461 uplication of da │ │ │ │ -000eddd0: 7461 206e 6f64 6573 2074 6861 7420 6172 ta nodes that ar │ │ │ │ -000edde0: 6520 636f 2d72 6566 6572 656e 6365 732e e co-references. │ │ │ │ -000eddf0: 2043 7963 6c69 6320 6461 7461 2073 7472 Cyclic data str │ │ │ │ -000ede00: 7563 7475 7265 7320 6361 6e6e 6f74 2062 uctures cannot b │ │ │ │ -000ede10: 6520 6163 6375 7261 7465 6c79 2073 6572 e accurately ser │ │ │ │ -000ede20: 6961 6c69 7a65 642c 2062 7574 2079 6f75 ialized, but you │ │ │ │ -000ede30: 2063 616e 2075 7365 203c 636f 6465 3e23 can use # │ │ │ │ -000ede40: 534f 4150 5f58 4d4c 5f47 5241 5048 3c2f SOAP_XML_GRAPH to force t │ │ │ │ -000ede60: 6865 2075 7365 206f 6620 6964 2d72 6566 he use of id-ref │ │ │ │ -000ede70: 2074 6f20 6163 6375 7261 7465 6c79 2073 to accurately s │ │ │ │ -000ede80: 6572 6961 6c69 7a65 2064 6967 7261 7068 erialize digraph │ │ │ │ -000ede90: 7320 616e 6420 6379 636c 6963 2064 6174 s and cyclic dat │ │ │ │ -000edea0: 6120 7374 7275 6374 7572 6573 2e20 5468 a structures. Th │ │ │ │ -000edeb0: 6520 534f 4150 2042 6f64 7920 6d61 7920 e SOAP Body may │ │ │ │ -000edec0: 636f 6e74 6169 6e20 616e 7920 6e75 6d62 contain any numb │ │ │ │ -000eded0: 6572 206f 6620 584d 4c20 656c 656d 656e er of XML elemen │ │ │ │ -000edee0: 7473 2c20 6173 2069 6620 7468 6520 534f ts, as if the SO │ │ │ │ -000edef0: 4150 2042 6f64 7920 6973 2074 6865 2072 AP Body is the r │ │ │ │ -000edf00: 6f6f 7420 6f66 2061 6e20 584d 4c20 646f oot of an XML do │ │ │ │ -000edf10: 6375 6d65 6e74 2e20 4e6f 203c 656d 3e3c cument. No < │ │ │ │ -000edf20: 636f 6465 3e53 4f41 502d 454e 563a 656e code>SOAP-ENV:en │ │ │ │ -000edf30: 636f 6469 6e67 5374 796c 653d 222e 2e2e codingStyle="... │ │ │ │ -000edf40: 223c 2f63 6f64 653e 3c2f 656d 3e20 6174 " at │ │ │ │ -000edf50: 7472 6962 7574 6520 7368 6f75 6c64 2061 tribute should a │ │ │ │ -000edf60: 7070 6561 7220 696e 206c 6974 6572 616c ppear in literal │ │ │ │ -000edf70: 2063 6f6e 7465 6e74 2e20 5468 6973 2073 content. This s │ │ │ │ -000edf80: 7479 6c65 2069 7320 7370 6563 6966 6965 tyle is specifie │ │ │ │ -000edf90: 6420 666f 7220 7468 6520 656e 7469 7265 d for the entire │ │ │ │ -000edfa0: 2073 6572 7669 6365 2064 6563 6c61 7265 service declare │ │ │ │ -000edfb0: 6420 756e 6465 7220 6e61 6d65 7370 6163 d under namespac │ │ │ │ -000edfc0: 6520 7072 6566 6978 203c 636f 6465 3e6e e prefix n │ │ │ │ -000edfd0: 733c 2f63 6f64 653e 2077 6974 683a 203c s with: < │ │ │ │ -000edfe0: 6469 7620 636c 6173 733d 2266 7261 676d div class="fragm │ │ │ │ -000edff0: 656e 7422 3e3c 6469 7620 636c 6173 733d ent">
    //g │ │ │ │ -000ee020: 736f 6170 206e 7320 7365 7276 6963 6520 soap ns service │ │ │ │ -000ee030: 7374 796c 653a 2020 2020 646f 6375 6d65 style: docume │ │ │ │ -000ee040: 6e74 3c2f 7370 616e 3e3c 2f64 6976 3e0a nt
    . │ │ │ │ -000ee050: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    //gsoap │ │ │ │ -000ee080: 6e73 2073 6572 7669 6365 2065 6e63 6f64 ns service encod │ │ │ │ -000ee090: 696e 673a 206c 6974 6572 616c 3c2f 7370 ing: literal
    .
│ │ │ │ -000ee0b0: 3c21 2d2d 2066 7261 676d 656e 7420 2d2d < │ │ │ │ -000ee370: 2f6c 693e 0a3c 2f75 6c3e 0a3c 703e 4265 /li>..

Be │ │ │ │ -000ee380: 7369 6465 7320 3c63 6f64 653e 2f2f 6773 sides //gs │ │ │ │ -000ee390: 6f61 7020 6e73 2073 6572 7669 6365 2073 oap ns service s │ │ │ │ -000ee3a0: 7479 6c65 3c2f 636f 6465 3e20 616e 6420 tyle and │ │ │ │ -000ee3b0: 3c63 6f64 653e 2f2f 6773 6f61 7020 6e73 //gsoap ns │ │ │ │ -000ee3c0: 2073 6572 7669 6365 2065 6e63 6f64 696e service encodin │ │ │ │ -000ee3d0: 673c 2f63 6f64 653e 2074 6865 7265 2061 g there a │ │ │ │ -000ee3e0: 7265 2061 6c73 6f20 7468 6520 7365 7276 re also the serv │ │ │ │ -000ee3f0: 6963 6520 6f70 6572 6174 696f 6e20 7370 ice operation sp │ │ │ │ -000ee400: 6563 6966 6963 2076 6572 7369 6f6e 7320 ecific versions │ │ │ │ -000ee410: 3c63 6f64 653e 2f2f 6773 6f61 7020 6e73 //gsoap ns │ │ │ │ -000ee420: 2073 6572 7669 6365 206d 6574 686f 642d service method- │ │ │ │ -000ee430: 7374 796c 653c 2f63 6f64 653e 2c20 3c63 style, //gsoap ns s │ │ │ │ -000ee450: 6572 7669 6365 206d 6574 686f 642d 7265 ervice method-re │ │ │ │ -000ee460: 7370 6f6e 7365 2d73 7479 6c65 3c2f 636f sponse-style, //gso │ │ │ │ -000ee480: 6170 206e 7320 7365 7276 6963 6520 6d65 ap ns service me │ │ │ │ -000ee490: 7468 6f64 2d65 6e63 6f64 696e 673c 2f63 thod-encoding, and │ │ │ │ -000ee4b0: 2f2f 6773 6f61 7020 6e73 2073 6572 7669 //gsoap ns servi │ │ │ │ -000ee4c0: 6365 206d 6574 686f 642d 7265 7370 6f6e ce method-respon │ │ │ │ -000ee4d0: 7365 2d65 6e63 6f64 696e 673c 2f63 6f64 se-encoding that explicit │ │ │ │ -000ee4f0: 6c79 2073 7065 6369 6679 2053 4f41 5020 ly specify SOAP │ │ │ │ -000ee500: 5250 4320 656e 636f 6465 642c 2064 6f63 RPC encoded, doc │ │ │ │ -000ee510: 756d 656e 742f 6c69 7465 7261 6c2c 206f ument/literal, o │ │ │ │ -000ee520: 7220 5250 4320 6c69 7465 7261 6c20 7374 r RPC literal st │ │ │ │ -000ee530: 796c 6520 6d65 7373 6167 6573 2066 6f72 yle messages for │ │ │ │ -000ee540: 2074 6865 2069 6e64 6963 6174 6564 2073 the indicated s │ │ │ │ -000ee550: 6572 7669 6365 206f 7065 7261 7469 6f6e ervice operation │ │ │ │ -000ee560: 206d 6574 686f 6473 2e3c 2f70 3e0a 3c70 methods.

.

To enable SOAP │ │ │ │ -000ee580: 5250 4320 656e 636f 6469 6e67 2066 6f72 RPC encoding for │ │ │ │ -000ee590: 2061 2070 6172 7469 6375 6c61 7220 7365 a particular se │ │ │ │ -000ee5a0: 7276 6963 6520 6f70 6572 6174 696f 6e2c rvice operation, │ │ │ │ -000ee5b0: 2075 7365 3a3c 2f70 3e0a 3c64 6976 2063 use:

.
│ │ │ │ -000ee5d0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
//gsoap │ │ │ │ -000ee600: 6e73 2073 6572 7669 6365 206d 6574 686f ns service metho │ │ │ │ -000ee610: 642d 7374 796c 653a 2020 2020 7765 626d d-style: webm │ │ │ │ -000ee620: 6574 686f 6420 7270 6320 3c2f 7370 616e ethod rpc
.
│ │ │ │ -000ee660: 2f2f 6773 6f61 7020 6e73 2073 6572 7669 //gsoap ns servi │ │ │ │ -000ee670: 6365 206d 6574 686f 642d 656e 636f 6469 ce method-encodi │ │ │ │ -000ee680: 6e67 3a20 7765 626d 6574 686f 6420 656e ng: webmethod en │ │ │ │ -000ee690: 636f 6465 6420 3c2f 7370 616e 3e3c 2f64 coded .
│ │ │ │ -000ee6d0: 696e 743c 2f73 7061 6e3e 206e 735f 5f77 int ns__w │ │ │ │ -000ee6e0: 6562 6d65 7468 6f64 282e 2e2e 293c 2f64 ebmethod(...).

To │ │ │ │ -000ee710: 2065 6e61 626c 6520 534f 4150 2052 5043 enable SOAP RPC │ │ │ │ -000ee720: 2065 6e63 6f64 696e 6720 666f 7220 6120 encoding for a │ │ │ │ -000ee730: 7061 7274 6963 756c 6172 2073 6572 7669 particular servi │ │ │ │ -000ee740: 6365 206f 7065 7261 7469 6f6e 2072 6573 ce operation res │ │ │ │ -000ee750: 706f 6e73 652c 2075 7365 3a3c 2f70 3e0a ponse, use:

. │ │ │ │ -000ee760: 3c64 6976 2063 6c61 7373 3d22 6672 6167
// │ │ │ │ -000ee7a0: 6773 6f61 7020 6e73 2073 6572 7669 6365 gsoap ns service │ │ │ │ -000ee7b0: 206d 6574 686f 642d 7265 7370 6f6e 7365 method-response │ │ │ │ -000ee7c0: 2d73 7479 6c65 3a20 2020 2077 6562 6d65 -style: webme │ │ │ │ -000ee7d0: 7468 6f64 2072 7063 203c 2f73 7061 6e3e thod rpc │ │ │ │ -000ee7e0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
/ │ │ │ │ -000ee810: 2f67 736f 6170 206e 7320 7365 7276 6963 /gsoap ns servic │ │ │ │ -000ee820: 6520 6d65 7468 6f64 2d72 6573 706f 6e73 e method-respons │ │ │ │ -000ee830: 652d 656e 636f 6469 6e67 3a20 7765 626d e-encoding: webm │ │ │ │ -000ee840: 6574 686f 6420 656e 636f 6465 6420 3c2f ethod encoded
.
int ns__webmethod │ │ │ │ -000ee8a0: 282e 2e2e 293c 2f64 6976 3e0a 3c2f 6469 (...)
.

Likewise, │ │ │ │ -000ee8d0: 796f 7520 6361 6e20 7370 6563 6966 7920 you can specify │ │ │ │ -000ee8e0: 646f 6375 6d65 6e74 2f6c 6974 6572 616c document/literal │ │ │ │ -000ee8f0: 2061 6e64 2052 5043 206c 6974 6572 616c and RPC literal │ │ │ │ -000ee900: 206d 6573 7361 6765 732e 2054 6865 2064 messages. The d │ │ │ │ -000ee910: 6566 6175 6c74 2073 7479 6c65 2069 7320 efault style is │ │ │ │ -000ee920: 646f 6375 6d65 6e74 2f6c 6974 6572 616c document/literal │ │ │ │ -000ee930: 2c20 756e 6c65 7373 203c 623e 3c63 6f64 , unless soapcpp2 -e option │ │ │ │ -000ee960: 3c62 3e3c 636f 6465 3e2d 653c 2f63 6f64 -e is used t │ │ │ │ -000ee980: 6f20 7365 7420 534f 4150 2052 5043 2065 o set SOAP RPC e │ │ │ │ -000ee990: 6e63 6f64 696e 6720 6279 2064 6566 6175 ncoding by defau │ │ │ │ -000ee9a0: 6c74 2e3c 2f70 3e0a 3c70 3e46 6f72 2074 lt.

.

For t │ │ │ │ -000ee9b0: 6865 203c 636f 6465 3e73 7479 6c65 3c2f he style directives │ │ │ │ -000ee9d0: 2079 6f75 2063 616e 2073 7065 6369 6679 you can specify │ │ │ │ -000ee9e0: 203c 636f 6465 3e72 7063 3c2f 636f 6465 rpc or docum │ │ │ │ -000eea00: 656e 743c 2f63 6f64 653e 2e20 466f 7220 ent. For │ │ │ │ -000eea10: 7468 6520 3c63 6f64 653e 656e 636f 6469 the encodi │ │ │ │ -000eea20: 6e67 3c2f 636f 6465 3e20 6469 7265 6374 ng direct │ │ │ │ -000eea30: 6976 6573 2079 6f75 2063 616e 2073 7065 ives you can spe │ │ │ │ -000eea40: 6369 6679 203c 636f 6465 3e6c 6974 6572 cify liter │ │ │ │ -000eea50: 616c 3c2f 636f 6465 3e2c 203c 636f 6465 al, encoded, │ │ │ │ -000eea70: 206f 7220 6576 656e 2061 2063 7573 746f or even a custo │ │ │ │ -000eea80: 6d20 5552 4920 7468 6174 2069 6e64 6963 m URI that indic │ │ │ │ -000eea90: 6174 6573 2073 6f6d 6520 6375 7374 6f6d ates some custom │ │ │ │ -000eeaa0: 206f 7220 7072 6f70 7269 6574 6172 7920 or proprietary │ │ │ │ -000eeab0: 656e 636f 6469 6e67 2066 6f72 6d61 7420 encoding format │ │ │ │ -000eeac0: 696e 2058 4d4c 2077 6869 6368 2077 696c in XML which wil │ │ │ │ -000eead0: 6c20 6e6f 7420 696e 7465 726f 7065 7261 l not interopera │ │ │ │ -000eeae0: 7465 2077 6974 6820 534f 4150 2070 726f te with SOAP pro │ │ │ │ -000eeaf0: 6365 7373 6f72 7320 7468 6174 2061 7265 cessors that are │ │ │ │ -000eeb00: 206e 6f74 2063 6f6d 7061 7469 626c 6520 not compatible │ │ │ │ -000eeb10: 7769 7468 2074 6865 2073 7065 6369 6669 with the specifi │ │ │ │ -000eeb20: 6564 2065 6e63 6f64 696e 6720 666f 726d ed encoding form │ │ │ │ -000eeb30: 6174 2e20 5365 6520 616c 736f 2053 6563 at. See also Sec │ │ │ │ -000eeb40: 7469 6f6e 203c 6120 636c 6173 733d 2265 tion │ │ │ │ -000eeb70: 4469 7265 6374 6976 6573 3c2f 613e 2e3c Directives.< │ │ │ │ -000eeb80: 2f70 3e0a 3c70 3e53 6565 2061 6c73 6f20 /p>.

See also │ │ │ │ -000eeb90: 3c61 2068 7265 663d 222e 2e2f 2e2e 2f64 C an │ │ │ │ -000eebc0: 6420 432b 2b20 584d 4c20 6461 7461 2062 d C++ XML data b │ │ │ │ -000eebd0: 696e 6469 6e67 733c 2f61 3e20 646f 6375 indings docu │ │ │ │ -000eebe0: 6d65 6e74 6174 696f 6e20 666f 7220 6469 mentation for di │ │ │ │ -000eebf0: 6666 6572 656e 6365 7320 696e 2058 4d4c fferences in XML │ │ │ │ -000eec00: 2073 6572 6961 6c69 7a61 7469 6f6e 2077 serialization w │ │ │ │ -000eec10: 6865 6e20 7573 696e 6720 7468 6520 534f hen using the SO │ │ │ │ -000eec20: 4150 2052 5043 2065 6e63 6f64 6564 2061 AP RPC encoded a │ │ │ │ -000eec30: 6e64 2064 6f63 756d 656e 742f 6c69 7465 nd document/lite │ │ │ │ -000eec40: 7261 6c20 6d65 7373 6167 696e 6720 7374 ral messaging st │ │ │ │ -000eec50: 796c 6573 2e3c 2f70 3e0a 3c70 3ef0 9f94 yles.

.

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

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

.Seriali │ │ │ │ -000eecc0: 7a69 6e67 206d 6978 6564 2063 6f6e 7465 zing mixed conte │ │ │ │ -000eecd0: 6e74 2077 6974 6820 6c69 7465 7261 6c20 nt with literal │ │ │ │ -000eece0: 584d 4c20 7374 7269 6e67 733c 2f68 333e XML strings

│ │ │ │ -000eecf0: 0a3c 703e 584d 4c20 6973 2073 746f 7265 .

XML is store │ │ │ │ -000eed00: 6420 696e 2022 6c69 7465 7261 6c22 2058 d in "literal" X │ │ │ │ -000eed10: 4d4c 2073 7472 696e 6773 2077 6869 6368 ML strings which │ │ │ │ -000eed20: 2061 7265 2074 6865 2062 7569 6c74 2d69 are the built-i │ │ │ │ -000eed30: 6e20 3c63 6f64 653e 5f58 4d4c 3c2f 636f n _XML type that is │ │ │ │ -000eed50: 2061 2072 6567 756c 6172 203c 636f 6465 a regular char* st │ │ │ │ -000eed70: 7269 6e67 206f 7220 796f 7520 6361 6e20 ring or you can │ │ │ │ -000eed80: 6465 636c 6172 6520 6120 7769 6465 2063 declare a wide c │ │ │ │ -000eed90: 6861 7261 6374 6572 2073 7472 696e 6720 haracter string │ │ │ │ -000eeda0: 696e 2061 6e20 696e 7465 7266 6163 6520 in an interface │ │ │ │ -000eedb0: 6865 6164 6572 2066 696c 6520 666f 7220 header file for │ │ │ │ -000eedc0: 736f 6170 6370 7032 2061 7320 666f 6c6c soapcpp2 as foll │ │ │ │ -000eedd0: 6f77 733a 3c2f 703e 0a3c 6469 7620 636c ows:

.
< │ │ │ │ -000eedf0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -000eee00: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >typedef │ │ │ │ -000eee40: 7763 6861 725f 743c 2f73 7061 6e3e 202a wchar_t * │ │ │ │ -000eee50: 584d 4c3b 3c2f 6469 763e 0a3c 2f64 6976 XML;
.
│ │ │ │ -000eef30: 3c70 3e4f 7220 7573 6520 6120 7769 6465

Or use a wide │ │ │ │ -000eef40: 2063 6861 7261 6374 6572 2073 7472 696e character strin │ │ │ │ -000eef50: 673a 3c2f 703e 0a3c 6469 7620 636c 6173 g:

.
< │ │ │ │ -000eef80: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -000eef90: 6f72 6422 3e74 7970 6564 6566 3c2f 7370 ord">typedef std::wstring │ │ │ │ -000eefb0: 2058 4d4c 3b3c 2f64 6976 3e0a 3c2f 6469 XML;
.

To use bot │ │ │ │ -000eefe0: 6820 6174 2074 6865 2073 616d 6520 7469 h at the same ti │ │ │ │ -000eeff0: 6d65 3a3c 2f70 3e0a 3c64 6976 2063 6c61 me:

.
│ │ │ │ -000ef020: 3c73 7061 6e20 636c 6173 733d 226b 6579 typedef std::string │ │ │ │ -000ef050: 2020 584d 4c3b 3c2f 6469 763e 0a3c 6469 XML;
.< │ │ │ │ -000ef070: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -000ef080: 6f72 6422 3e74 7970 6564 6566 3c2f 7370 ord">typedef std::wstring │ │ │ │ -000ef0a0: 2058 4d4c 5f3b 3c2f 6469 763e 0a3c 2f64 XML_;
.

The diffe │ │ │ │ -000ef0d0: 7265 6e63 6573 2062 6574 7765 656e 2074 rences between t │ │ │ │ -000ef0e0: 6865 2075 7365 206f 6620 7265 6775 6c61 he use of regula │ │ │ │ -000ef0f0: 7220 382d 6269 7420 7374 7269 6e67 7320 r 8-bit strings │ │ │ │ -000ef100: 7665 7273 7573 2077 6964 6520 6368 6172 versus wide char │ │ │ │ -000ef110: 6163 7465 7220 7374 7269 6e67 7320 666f acter strings fo │ │ │ │ -000ef120: 7220 584d 4c20 646f 6375 6d65 6e74 7320 r XML documents │ │ │ │ -000ef130: 6172 653a 3c2f 703e 0a3c 756c 3e0a 3c6c are:

.
    .XML literal st │ │ │ │ -000ef150: 7269 6e67 7320 6d75 7374 2068 6f6c 6420 rings must hold │ │ │ │ -000ef160: 5554 462d 3820 584d 4c20 636f 6e74 656e UTF-8 XML conten │ │ │ │ -000ef170: 742e 3c2f 6c69 3e0a 3c6c 693e 5769 6465 t..
  • Wide │ │ │ │ -000ef180: 2063 6861 7261 6374 6572 2058 4d4c 206c character XML l │ │ │ │ -000ef190: 6974 6572 616c 2073 7472 696e 6773 2061 iteral strings a │ │ │ │ -000ef1a0: 7265 2063 6f6e 7665 7274 6564 2074 6f20 re converted to │ │ │ │ -000ef1b0: 616e 6420 6672 6f6d 2055 5446 2d38 2e3c and from UTF-8.< │ │ │ │ -000ef1c0: 2f6c 693e 0a3c 2f75 6c3e 0a3c 703e f09f /li>.
.

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

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

.XML │ │ │ │ -000ef230: 7661 6c69 6461 7469 6f6e 3c2f 6831 3e0a validation

. │ │ │ │ -000ef240: 3c70 3e53 6f6d 6520 584d 4c20 7661 6c69

Some XML vali │ │ │ │ -000ef250: 6461 7469 6f6e 2063 6f6e 7374 7261 696e dation constrain │ │ │ │ -000ef260: 7473 2061 7265 206e 6f74 2061 7574 6f6d ts are not autom │ │ │ │ -000ef270: 6174 6963 616c 6c79 2076 6572 6966 6965 atically verifie │ │ │ │ -000ef280: 6420 756e 6c65 7373 2065 7870 6c69 6369 d unless explici │ │ │ │ -000ef290: 746c 7920 7365 7420 7573 696e 6720 7468 tly set using th │ │ │ │ -000ef2a0: 6520 3c63 6f64 653e 2353 4f41 505f 584d e #SOAP_XM │ │ │ │ -000ef2b0: 4c5f 5354 5249 4354 3c2f 636f 6465 3e20 L_STRICT │ │ │ │ -000ef2c0: 666c 6167 2e20 534f 4150 2052 5043 2065 flag. SOAP RPC e │ │ │ │ -000ef2d0: 6e63 6f64 696e 6720 6973 2061 6e20 584d ncoding is an XM │ │ │ │ -000ef2e0: 4c20 666f 726d 6174 2074 6861 7420 646f L format that do │ │ │ │ -000ef2f0: 6573 206e 6f74 2061 6666 6f72 6420 7374 es not afford st │ │ │ │ -000ef300: 7269 6374 2058 4d4c 2076 616c 6964 6174 rict XML validat │ │ │ │ -000ef310: 696f 6e2c 2062 6563 6175 7365 206f 6620 ion, because of │ │ │ │ -000ef320: 7468 6520 6164 6469 7469 6f6e 206f 6620 the addition of │ │ │ │ -000ef330: 534f 4150 2d73 7065 6369 6669 6320 6174 SOAP-specific at │ │ │ │ -000ef340: 7472 6962 7574 6573 2061 6e64 206f 7468 tributes and oth │ │ │ │ -000ef350: 6572 2073 6d61 6c6c 2064 6576 6961 7469 er small deviati │ │ │ │ -000ef360: 6f6e 7320 7468 6174 2077 696c 6c20 6265 ons that will be │ │ │ │ -000ef370: 2064 6574 6563 7465 6420 6279 2061 6e20 detected by an │ │ │ │ -000ef380: 6167 6772 6573 7369 7665 2058 4d4c 2076 aggressive XML v │ │ │ │ -000ef390: 616c 6964 6174 6f72 2c20 6c65 6164 696e alidator, leadin │ │ │ │ -000ef3a0: 6720 7468 6520 6d65 7373 6167 696e 6720 g the messaging │ │ │ │ -000ef3b0: 6661 696c 7572 6573 2e20 4279 2074 6f6e failures. By ton │ │ │ │ -000ef3c0: 696e 6720 584d 4c20 7661 6c69 6461 7469 ing XML validati │ │ │ │ -000ef3d0: 6f6e 2064 6f77 6e2c 2069 7420 6865 6c70 on down, it help │ │ │ │ -000ef3e0: 7320 746f 2069 6d70 726f 7665 2053 4f41 s to improve SOA │ │ │ │ -000ef3f0: 5020 5250 4320 656e 636f 6469 6e67 2069 P RPC encoding i │ │ │ │ -000ef400: 6e74 6572 6f70 6572 6162 696c 6974 792e nteroperability. │ │ │ │ -000ef410: 3c2f 703e 0a3c 703e 5374 7269 6374 2076

.

Strict v │ │ │ │ -000ef420: 616c 6964 6174 696f 6e20 636f 6e73 7472 alidation constr │ │ │ │ -000ef430: 6169 6e74 7320 6172 6520 656e 6162 6c65 aints are enable │ │ │ │ -000ef440: 6420 7769 7468 2074 6865 203c 636f 6465 d with the #SOAP_XML_STRIC │ │ │ │ -000ef460: 543c 2f63 6f64 653e 206d 6f64 6520 666c T mode fl │ │ │ │ -000ef470: 6167 2073 6574 2c20 652e 672e 2077 6974 ag set, e.g. wit │ │ │ │ -000ef480: 6820 3c63 6f64 653e 736f 6170 5f73 6574 h soap_set │ │ │ │ -000ef490: 5f69 6d6f 6465 2873 6f61 702c 2053 4f41 _imode(soap, SOA │ │ │ │ -000ef4a0: 505f 584d 4c5f 5354 5249 4354 293c 2f63 P_XML_STRICT) or so │ │ │ │ -000ef4c0: 6170 5f6e 6577 2853 4f41 505f 584d 4c5f ap_new(SOAP_XML_ │ │ │ │ -000ef4d0: 5354 5249 4354 293c 2f63 6f64 653e 2c20 STRICT), │ │ │ │ -000ef4e0: 7365 6520 5365 6374 696f 6e20 3c61 2063 see Section Run-time flags │ │ │ │ -000ef520: 3c2f 613e 2066 6f72 2074 6865 2063 6f6d for the com │ │ │ │ -000ef530: 706c 6574 6520 6c69 7374 206f 6620 666c plete list of fl │ │ │ │ -000ef540: 6167 732e 3c2f 703e 0a3c 703e 5468 6520 ags.

.

The │ │ │ │ -000ef550: 6e65 7874 2073 6563 7469 6f6e 7320 6465 next sections de │ │ │ │ -000ef560: 7363 7269 6265 2074 6865 2074 7970 6520 scribe the type │ │ │ │ -000ef570: 6f66 2063 6f6e 7374 7261 696e 7473 2076 of constraints v │ │ │ │ -000ef580: 616c 6964 6174 6564 2077 6865 6e20 3c63 alidated when #SOAP_XML_ST │ │ │ │ -000ef5a0: 5249 4354 3c2f 636f 6465 3e20 6973 2065 RICT is e │ │ │ │ -000ef5b0: 6e61 626c 6564 2061 6e64 2076 616c 6964 nabled and valid │ │ │ │ -000ef5c0: 6174 696f 6e20 636f 6e73 7472 6169 6e74 ation constraint │ │ │ │ -000ef5d0: 7320 6172 6520 7370 6563 6966 6965 6420 s are specified │ │ │ │ -000ef5e0: 696e 2074 6865 2069 6e74 6572 6661 6365 in the interface │ │ │ │ -000ef5f0: 2068 6561 6465 7220 6669 6c65 2e3c 2f70 header file.

.

Use compile │ │ │ │ -000ef610: 7220 666c 6167 203c 636f 6465 3e23 5749 r flag #WI │ │ │ │ -000ef620: 5448 5f52 4550 4c41 4345 5f49 4c4c 4547 TH_REPLACE_ILLEG │ │ │ │ -000ef630: 414c 5f55 5446 383c 2f63 6f64 653e 2074 AL_UTF8 t │ │ │ │ -000ef640: 6f20 666f 7263 6520 7374 7269 6374 2055 o force strict U │ │ │ │ -000ef650: 5446 2d38 2074 6578 7420 636f 6e76 6572 TF-8 text conver │ │ │ │ -000ef660: 7369 6f6e 732c 2077 6869 6368 2072 6570 sions, which rep │ │ │ │ -000ef670: 6c61 6365 7320 696e 7661 6c69 6420 5554 laces invalid UT │ │ │ │ -000ef680: 462d 3820 7769 7468 2055 2b46 4646 442e F-8 with U+FFFD. │ │ │ │ -000ef690: 3c2f 703e 0a3c 703e 5365 6520 616c 736f

.

See also │ │ │ │ -000ef6a0: 203c 6120 6872 6566 3d22 2e2e 2f2e 2e2f C a │ │ │ │ -000ef6d0: 6e64 2043 2b2b 2058 4d4c 2064 6174 6120 nd C++ XML data │ │ │ │ -000ef6e0: 6269 6e64 696e 6773 3c2f 613e 2064 6f63 bindings doc │ │ │ │ -000ef6f0: 756d 656e 7461 7469 6f6e 2066 6f72 206d umentation for m │ │ │ │ -000ef700: 6f72 6520 6465 7461 696c 732e 3c2f 703e ore details.

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

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

.

│ │ │ │ -000ef770: 3c2f 613e 0a44 6566 6175 6c74 2076 616c .Default val │ │ │ │ -000ef780: 7565 733c 2f68 323e 0a3c 703e 4465 6661 ues

.

Defa │ │ │ │ -000ef790: 756c 7420 7661 6c75 6573 2063 616e 2062 ult values can b │ │ │ │ -000ef7a0: 6520 6465 6669 6e65 6420 666f 7220 6f70 e defined for op │ │ │ │ -000ef7b0: 7469 6f6e 616c 2065 6c65 6d65 6e74 7320 tional elements │ │ │ │ -000ef7c0: 616e 6420 6174 7472 6962 7574 6573 2c20 and attributes, │ │ │ │ -000ef7d0: 7768 6963 6820 6d65 616e 7320 7468 6174 which means that │ │ │ │ -000ef7e0: 2074 6865 2064 6566 6175 6c74 2076 616c the default val │ │ │ │ -000ef7f0: 7565 2077 696c 6c20 6265 2075 7365 6420 ue will be used │ │ │ │ -000ef800: 7768 656e 2074 6865 2065 6c65 6d65 6e74 when the element │ │ │ │ -000ef810: 206f 7220 6174 7472 6962 7574 6520 7661 or attribute va │ │ │ │ -000ef820: 6c75 6520 6973 206e 6f74 2070 7265 7365 lue is not prese │ │ │ │ -000ef830: 6e74 2069 6e20 7468 6520 7061 7273 6564 nt in the parsed │ │ │ │ -000ef840: 2058 4d4c 2e20 5365 6520 616c 736f 2053 XML. See also S │ │ │ │ -000ef850: 6563 7469 6f6e 203c 6120 636c 6173 733d ection D │ │ │ │ -000ef880: 6566 6175 6c74 2076 616c 7565 7320 666f efault values fo │ │ │ │ -000ef890: 7220 6f6d 6974 7465 6420 584d 4c20 656c r omitted XML el │ │ │ │ -000ef8a0: 656d 656e 7473 2061 6e64 2061 7474 7269 ements and attri │ │ │ │ -000ef8b0: 6275 7465 733c 2f61 3e20 616e 6420 6578 butes and ex │ │ │ │ -000ef8c0: 616d 706c 6573 2069 6e20 7375 6273 6571 amples in subseq │ │ │ │ -000ef8d0: 7565 6e74 2073 7562 7365 6374 696f 6e73 uent subsections │ │ │ │ -000ef8e0: 2062 656c 6f77 2e3c 2f70 3e0a 3c70 3e44 below.

.

D │ │ │ │ -000ef8f0: 6566 6175 6c74 2076 616c 7565 7320 6d75 efault values mu │ │ │ │ -000ef900: 7374 2062 6520 7072 696d 6974 6976 6520 st be primitive │ │ │ │ -000ef910: 7479 7065 732c 2069 6e74 6567 6572 2c20 types, integer, │ │ │ │ -000ef920: 666c 6f61 742c 2073 7472 696e 672c 2065 float, string, e │ │ │ │ -000ef930: 7463 2e20 6f72 2070 6f69 6e74 6572 7320 tc. or pointers │ │ │ │ -000ef940: 746f 2070 7269 6d69 7469 7665 2074 7970 to primitive typ │ │ │ │ -000ef950: 6573 2e20 4465 6661 756c 7420 7661 6c75 es. Default valu │ │ │ │ -000ef960: 6573 2063 616e 2062 6520 7370 6563 6966 es can be specif │ │ │ │ -000ef970: 6965 6420 666f 7220 7374 7275 6374 2061 ied for struct a │ │ │ │ -000ef980: 6e64 2063 6c61 7373 206d 656d 6265 7273 nd class members │ │ │ │ -000ef990: 2c20 6173 2073 686f 776e 2069 6e20 7468 , as shown in th │ │ │ │ -000ef9a0: 6520 6578 616d 706c 6520 6265 6c6f 773a e example below: │ │ │ │ -000ef9b0: 3c2f 703e 0a3c 6469 7620 636c 6173 733d

.
struct ns__MyRecord .
{
.< │ │ │ │ -000efa30: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -000efa40: 3e20 2020 203c 7370 616e 2063 6c61 7373 > i │ │ │ │ -000efa60: 6e74 3c2f 7370 616e 3e20 6e20 3d20 353b nt n = 5; │ │ │ │ -000efa70: 2020 2020 2020 2020 2020 203c 7370 616e // optional ele │ │ │ │ -000efaa0: 6d65 6e74 2077 6974 6820 6465 6661 756c ment with defaul │ │ │ │ -000efab0: 7420 7661 6c75 6520 3520 3c2f 7370 616e t value 5
.
char *name = "no │ │ │ │ -000efb30: 6e65 2671 756f 743b 3c2f 7370 616e 3e3b ne"; │ │ │ │ -000efb40: 203c 7370 616e 2063 6c61 7373 3d22 636f // option │ │ │ │ -000efb60: 616c 2065 6c65 6d65 6e74 2077 6974 6820 al element with │ │ │ │ -000efb70: 6465 6661 756c 7420 7661 6c75 6520 2671 default value &q │ │ │ │ -000efb80: 756f 743b 6e6f 6e65 2671 756f 743b 203c uot;none" < │ │ │ │ -000efb90: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
. │ │ │ │ -000efbb0: 2040 203c 7370 616e 2063 6c61 7373 3d22 @ enum ns__color { │ │ │ │ -000efbe0: 2052 4544 2c20 5748 4954 452c 2042 4c55 RED, WHITE, BLU │ │ │ │ -000efbf0: 4520 7d20 636f 6c6f 7220 3d20 5245 443b E } color = RED; │ │ │ │ -000efc00: 203c 7370 616e 2063 6c61 7373 3d22 636f // option │ │ │ │ -000efc20: 616c 2061 7474 7269 6275 7465 2077 6974 al attribute wit │ │ │ │ -000efc30: 6820 6465 6661 756c 7420 7661 6c75 6520 h default value │ │ │ │ -000efc40: 5245 4420 3c2f 7370 616e 3e3c 2f64 6976 RED
.
};
.

Upon dese │ │ │ │ -000efc90: 7269 616c 697a 6174 696f 6e20 6f66 2061 rialization of a │ │ │ │ -000efca0: 6273 656e 7420 6461 7461 2c20 7468 6573 bsent data, thes │ │ │ │ -000efcb0: 6520 6d65 6d62 6572 7320 7769 6c6c 2062 e members will b │ │ │ │ -000efcc0: 6520 7365 7420 6163 636f 7264 696e 676c e set accordingl │ │ │ │ -000efcd0: 792e 2057 6865 6e20 636c 6173 7365 7320 y. When classes │ │ │ │ -000efce0: 6172 6520 696e 7374 616e 7469 6174 6564 are instantiated │ │ │ │ -000efcf0: 2077 6974 6820 3c63 6f64 653e 736f 6170 with soap │ │ │ │ -000efd00: 5f6e 6577 5f43 6c61 7373 4e61 6d65 3c2f _new_ClassName the instan │ │ │ │ -000efd20: 6365 2077 696c 6c20 6265 2069 6e69 7469 ce will be initi │ │ │ │ -000efd30: 616c 697a 6564 2077 6974 6820 6465 6661 alized with defa │ │ │ │ -000efd40: 756c 7420 7661 6c75 6573 2e3c 2f70 3e0a ult values.

. │ │ │ │ -000efd50: 3c70 3e53 6565 2061 6c73 6f20 3c61 2068

See also C and C+ │ │ │ │ -000efd90: 2b20 584d 4c20 6461 7461 2062 696e 6469 + XML data bindi │ │ │ │ -000efda0: 6e67 733c 2f61 3e20 646f 6375 6d65 6e74 ngs document │ │ │ │ -000efdb0: 6174 696f 6e20 666f 7220 6d6f 7265 2064 ation for more d │ │ │ │ -000efdc0: 6574 6169 6c73 2e3c 2f70 3e0a 3c70 3ef0 etails.

.

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

.

.Occ │ │ │ │ -000efe30: 7572 7265 6e63 6520 636f 6e73 7472 6169 urrence constrai │ │ │ │ -000efe40: 6e74 733c 2f68 323e 0a3c 703e 4f63 6375 nts

.

Occu │ │ │ │ -000efe50: 7272 656e 6365 2063 6f6e 7374 7261 696e rrence constrain │ │ │ │ -000efe60: 7473 2073 7065 6369 6679 2074 6865 206d ts specify the m │ │ │ │ -000efe70: 696e 696d 756d 2061 6e64 2f6f 7220 6d61 inimum and/or ma │ │ │ │ -000efe80: 7869 6d75 6d20 6672 6571 7565 6e63 7920 ximum frequency │ │ │ │ -000efe90: 6f72 206f 7074 696f 6e61 6c69 7479 206f or optionality o │ │ │ │ -000efea0: 6620 6f66 2061 7474 7269 6275 7465 7320 f of attributes │ │ │ │ -000efeb0: 616e 6420 656c 656d 656e 7473 2e3c 2f70 and elements.

.

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

.

.E │ │ │ │ -000eff20: 6c65 6d65 6e74 7320 7769 7468 206d 696e lements with min │ │ │ │ -000eff30: 4f63 6375 7273 2061 6e64 206d 6178 4f63 Occurs and maxOc │ │ │ │ -000eff40: 6375 7273 2072 6573 7472 6963 7469 6f6e curs restriction │ │ │ │ -000eff50: 733c 2f68 333e 0a3c 703e 546f 2066 6f72 s

.

To for │ │ │ │ -000eff60: 6365 2074 6865 2076 616c 6964 6174 696f ce the validatio │ │ │ │ -000eff70: 6e20 6f66 206d 696e 4f63 6375 7273 2061 n of minOccurs a │ │ │ │ -000eff80: 6e64 206d 6178 4f63 6375 7273 2063 6f6e nd maxOccurs con │ │ │ │ -000eff90: 7374 7261 696e 7473 2074 6865 203c 636f straints the #SOAP_XML_STR │ │ │ │ -000effb0: 4943 543c 2f63 6f64 653e 2069 6e70 7574 ICT input │ │ │ │ -000effc0: 206d 6f64 6520 666c 6167 206d 7573 7420 mode flag must │ │ │ │ -000effd0: 6265 2073 6574 2e20 5468 6520 6d69 6e4f be set. The minO │ │ │ │ -000effe0: 6363 7572 7320 616e 6420 6d61 784f 6363 ccurs and maxOcc │ │ │ │ -000efff0: 7572 7320 636f 6e73 7472 6169 6e74 7320 urs constraints │ │ │ │ -000f0000: 6172 6520 7370 6563 6966 6965 6420 666f are specified fo │ │ │ │ -000f0010: 7220 6d65 6d62 6572 7320 6f66 2061 2073 r members of a s │ │ │ │ -000f0020: 7472 7563 7420 616e 6420 6d65 6d62 6572 truct and member │ │ │ │ -000f0030: 7320 6f66 2061 2063 6c61 7373 2069 6e20 s of a class in │ │ │ │ -000f0040: 6120 6865 6164 6572 2066 696c 6520 7573 a header file us │ │ │ │ -000f0050: 696e 6720 7468 6520 666f 6c6c 6f77 696e ing the followin │ │ │ │ -000f0060: 6720 7379 6e74 6178 3a3c 2f70 3e0a 3c64 g syntax:

.
Type membe │ │ │ │ -000f00a0: 726e 616d 6520 3c73 7061 6e20 636c 6173 rname null │ │ │ │ -000f00c0: 7074 723c 2f73 7061 6e3e 206d 696e 4f63 ptr minOc │ │ │ │ -000f00d0: 6375 7273 203a 206d 6178 4f63 6375 7273 curs : maxOccurs │ │ │ │ -000f00e0: 203d 2076 616c 7565 3b3c 2f64 6976 3e0a = value;
. │ │ │ │ -000f00f0: 3c2f 6469 763e 3c21 2d2d 2066 7261 676d

The nullptr is optional a │ │ │ │ -000f0130: 6e64 2069 6e64 6963 6174 6573 2074 6861 nd indicates tha │ │ │ │ -000f0140: 7420 7468 6520 6d65 6d62 6572 2069 7320 t the member is │ │ │ │ -000f0150: 6e69 6c6c 6162 6c65 2028 6753 4f41 5020 nillable (gSOAP │ │ │ │ -000f0160: 7665 7273 696f 6e20 322e 382e 3234 206f version 2.8.24 o │ │ │ │ -000f0170: 7220 6772 6561 7465 7229 2c20 7768 6963 r greater), whic │ │ │ │ -000f0180: 6820 6d65 616e 7320 7468 6174 2077 6865 h means that whe │ │ │ │ -000f0190: 6e20 4e55 4c4c 2061 6e20 656d 7074 7920 n NULL an empty │ │ │ │ -000f01a0: 656c 656d 656e 7420 7769 7468 203c 656d element with xsi:nil=" │ │ │ │ -000f01c0: 7472 7565 223c 2f63 6f64 653e 3c2f 656d true" is added in th │ │ │ │ -000f01e0: 6520 7365 7269 616c 697a 6564 2058 4d4c e serialized XML │ │ │ │ -000f01f0: 2e3c 2f70 3e0a 3c70 3e54 6865 203c 636f .

.

The minOccurs and ma │ │ │ │ -000f0220: 784f 6363 7572 733c 2f63 6f64 653e 2061 xOccurs a │ │ │ │ -000f0230: 7265 206f 7074 696f 6e61 6c20 7661 6c75 re optional valu │ │ │ │ -000f0240: 6573 2074 6861 7420 6d75 7374 2062 6520 es that must be │ │ │ │ -000f0250: 696e 7465 6765 7220 6c69 7465 7261 6c73 integer literals │ │ │ │ -000f0260: 2e20 5768 656e 203c 636f 6465 3e6d 6178 . When max │ │ │ │ -000f0270: 4f63 6375 7273 3c2f 636f 6465 3e20 6973 Occurs is │ │ │ │ -000f0280: 206e 6f74 2073 7065 6369 6669 6564 2074 not specified t │ │ │ │ -000f0290: 6865 6e20 7468 6520 636f 6c6f 6e20 6361 hen the colon ca │ │ │ │ -000f02a0: 6e20 6265 206f 6d69 7474 6564 2e20 5768 n be omitted. Wh │ │ │ │ -000f02b0: 656e 203c 636f 6465 3e6d 696e 4f63 6375 en minOccu │ │ │ │ -000f02c0: 7273 3c2f 636f 6465 3e20 6973 206e 6f74 rs is not │ │ │ │ -000f02d0: 2073 7065 6369 6669 6564 2069 7420 6973 specified it is │ │ │ │ -000f02e0: 2061 7373 756d 6564 2074 6f20 6265 206f assumed to be o │ │ │ │ -000f02f0: 6e65 2028 3129 2066 6f72 206e 6f6e 2d70 ne (1) for non-p │ │ │ │ -000f0300: 6f69 6e74 6572 206d 656d 6265 7273 2074 ointer members t │ │ │ │ -000f0310: 6861 7420 6172 6520 656c 656d 656e 7473 hat are elements │ │ │ │ -000f0320: 2061 6e64 207a 6572 6f20 2830 2920 666f and zero (0) fo │ │ │ │ -000f0330: 7220 6d65 6d62 6572 7320 7468 6174 2061 r members that a │ │ │ │ -000f0340: 7265 2070 6f69 6e74 6572 7320 6f72 2061 re pointers or a │ │ │ │ -000f0350: 7265 2061 7474 7269 6275 7465 7320 2869 re attributes (i │ │ │ │ -000f0360: 2e65 2e20 6861 7665 2061 203c 636f 6465 .e. have a @ qualif │ │ │ │ -000f0380: 6965 7229 2e3c 2f70 3e0a 3c70 3e41 2064 ier).

.

A d │ │ │ │ -000f0390: 6566 6175 6c74 2069 6e69 7469 616c 697a efault initializ │ │ │ │ -000f03a0: 6174 696f 6e20 3c63 6f64 653e 7661 6c75 ation valu │ │ │ │ -000f03b0: 653c 2f63 6f64 653e 206d 6179 2062 6520 e may be │ │ │ │ -000f03c0: 7072 6f76 6964 6564 2061 6e64 2069 7320 provided and is │ │ │ │ -000f03d0: 6f70 7469 6f6e 616c 2e3c 2f70 3e0a 3c70 optional.

.

A fixed initial │ │ │ │ -000f03f0: 697a 6174 696f 6e20 7661 6c75 6520 6361 ization value ca │ │ │ │ -000f0400: 6e20 6265 2073 7065 6369 6669 6564 2077 n be specified w │ │ │ │ -000f0410: 6974 6820 3c63 6f64 653e 3d3d 3c2f 636f ith == (gSOAP versi │ │ │ │ -000f0430: 6f6e 2032 2e38 2e34 3820 6f72 2067 7265 on 2.8.48 or gre │ │ │ │ -000f0440: 6174 6572 292e 3c2f 703e 0a3c 703e 466f ater).

.

Fo │ │ │ │ -000f0450: 7220 6578 616d 706c 653c 2f70 3e0a 3c64 r example

.
stru │ │ │ │ -000f04a0: 6374 203c 2f73 7061 6e3e 6e73 5f5f 4d79 ct ns__My │ │ │ │ -000f04b0: 5265 636f 7264 203c 2f64 6976 3e0a 3c64 Record
. │ │ │ │ -000f04d0: 7b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 {
.
int n 0 = 5; │ │ │ │ -000f0520: 203c 7370 616e 2063 6c61 7373 3d22 636f // elemen │ │ │ │ -000f0540: 7420 7769 7468 2064 6566 6175 6c74 2076 t with default v │ │ │ │ -000f0550: 616c 7565 2035 2c20 6d69 6e4f 6363 7572 alue 5, minOccur │ │ │ │ -000f0560: 733d 302c 206d 6178 4f63 6375 7273 3d31 s=0, maxOccurs=1 │ │ │ │ -000f0570: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ │ -000f0590: 2020 2020 3c73 7061 6e20 636c 6173 733d in │ │ │ │ -000f05b0: 743c 2f73 7061 6e3e 206d 3b20 2020 2020 t m; │ │ │ │ -000f05c0: 2020 2020 2020 203c 7370 616e 2063 6c61 // │ │ │ │ -000f05e0: 656c 656d 656e 7420 7769 7468 206d 696e element with min │ │ │ │ -000f05f0: 4f63 6375 7273 3d31 203c 2f73 7061 6e3e Occurs=1 │ │ │ │ -000f0600: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
int *k nullp │ │ │ │ -000f0660: 7472 3c2f 7370 616e 3e20 313b 203c 7370 tr 1; // element wi │ │ │ │ -000f0690: 7468 206d 696e 4f63 6375 7273 3d31 2061 th minOccurs=1 a │ │ │ │ -000f06a0: 6e64 206e 696c 6c61 626c 653d 7472 7565 nd nillable=true │ │ │ │ -000f06b0: 203c 2f73 7061 6e3e 3c2f 6469 763e 0a3c
.< │ │ │ │ -000f06c0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -000f06d0: 3e20 2020 203c 7370 616e 2063 6c61 7373 > i │ │ │ │ -000f06f0: 6e74 3c2f 7370 616e 3e20 7620 3d3d 2032 nt v == 2 │ │ │ │ -000f0700: 3b20 2020 2020 2020 3c73 7061 6e20 636c ; // │ │ │ │ -000f0720: 2065 6c65 6d65 6e74 2077 6974 6820 6d69 element with mi │ │ │ │ -000f0730: 6e4f 6363 7572 733d 3120 616e 6420 6669 nOccurs=1 and fi │ │ │ │ -000f0740: 7865 6420 7661 6c75 6520 3220 3c2f 7370 xed value 2
.
│ │ │ │ -000f0770: 3c73 7061 6e20 636c 6173 733d 226b 6579 int __size 0:10 │ │ │ │ -000f07a0: 3b20 203c 7370 616e 2063 6c61 7373 3d22 ; // sequ │ │ │ │ -000f07c0: 656e 6365 2026 6c74 3b69 7465 6d26 6774 ence <item> │ │ │ │ -000f07d0: 3b20 7769 7468 206d 696e 4f63 6375 7273 ; with minOccurs │ │ │ │ -000f07e0: 3d30 2c20 6d61 784f 6363 7572 733d 3130 =0, maxOccurs=10 │ │ │ │ -000f07f0: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ │ -000f0810: 2020 2020 3c73 7061 6e20 636c 6173 733d in │ │ │ │ -000f0830: 743c 2f73 7061 6e3e 202a 6974 656d 3b20 t *item; │ │ │ │ -000f0840: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
std │ │ │ │ -000f0860: 3a3a 7665 6374 6f72 266c 743b 646f 7562 ::vector<doub │ │ │ │ -000f0870: 6c65 2667 743b 206e 756d 7320 323b 203c le> nums 2; < │ │ │ │ -000f0880: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ -000f0890: 656e 7422 3e2f 2f20 7365 7175 656e 6365 ent">// sequence │ │ │ │ -000f08a0: 2026 6c74 3b6e 756d 7326 6774 3b20 7769 <nums> wi │ │ │ │ -000f08b0: 7468 206d 696e 4f63 6375 7273 3d32 2c20 th minOccurs=2, │ │ │ │ -000f08c0: 6d61 784f 6363 7572 733d 756e 626f 756e maxOccurs=unboun │ │ │ │ -000f08d0: 6465 6420 3c2f 7370 616e 3e3c 2f64 6976 ded
.
};
. │ │ │ │ -000f0910: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
│ │ │ │ -000f0940: 7374 7275 6374 203c 2f73 7061 6e3e 6172 struct ar │ │ │ │ -000f0950: 7261 794f 6669 6e74 203c 2f64 6976 3e0a rayOfint
. │ │ │ │ -000f0960: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
{
.
│ │ │ │ -000f0990: 3c73 7061 6e20 636c 6173 733d 226b 6579 int *__ptr 1:10 │ │ │ │ -000f09c0: 303b 203c 7370 616e 2063 6c61 7373 3d22 0; // minO │ │ │ │ -000f09e0: 6363 7572 733d 312c 206d 6178 4f63 6375 ccurs=1, maxOccu │ │ │ │ -000f09f0: 7273 3d31 3030 203c 2f73 7061 6e3e 3c2f rs=100 .
int │ │ │ │ -000f0a40: 7369 7a65 3b20 3c2f 6469 763e 0a3c 6469 size;
.} │ │ │ │ -000f0a60: 3b3c 2f64 6976 3e0a 3c2f 6469 763e 3c21 ;
.
< │ │ │ │ -000f0a80: 703e 5365 6520 616c 736f 203c 6120 6872 p>See also C and C++ │ │ │ │ -000f0ac0: 2058 4d4c 2064 6174 6120 6269 6e64 696e XML data bindin │ │ │ │ -000f0ad0: 6773 3c2f 613e 2064 6f63 756d 656e 7461 gs documenta │ │ │ │ -000f0ae0: 7469 6f6e 2066 6f72 206d 6f72 6520 6465 tion for more de │ │ │ │ -000f0af0: 7461 696c 732e 3c2f 703e 0a3c 703e f09f tails.

.

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

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

.Required │ │ │ │ -000f0b70: 616e 6420 7072 6f68 6962 6974 6564 2061 and prohibited a │ │ │ │ -000f0b80: 7474 7269 6275 7465 733c 2f68 333e 0a3c ttributes

.< │ │ │ │ -000f0b90: 703e 5369 6d69 6c61 7220 746f 2074 6865 p>Similar to the │ │ │ │ -000f0ba0: 206d 696e 4f63 6375 7273 2061 6e64 206d minOccurs and m │ │ │ │ -000f0bb0: 6178 4f63 6375 7273 2061 6e6e 6f74 6174 axOccurs annotat │ │ │ │ -000f0bc0: 696f 6e73 2064 6566 696e 6564 2069 6e20 ions defined in │ │ │ │ -000f0bd0: 7468 6520 7072 6576 696f 7573 2073 6563 the previous sec │ │ │ │ -000f0be0: 7469 6f6e 2c20 6174 7472 6962 7574 6573 tion, attributes │ │ │ │ -000f0bf0: 2069 6e20 6120 7374 7275 6374 206f 7220 in a struct or │ │ │ │ -000f0c00: 636c 6173 7320 6361 6e20 6265 2061 6e6e class can be ann │ │ │ │ -000f0c10: 6f74 6174 6564 2077 6974 6820 6f63 6375 otated with occu │ │ │ │ -000f0c20: 7272 656e 6365 2063 6f6e 7374 7261 696e rrence constrain │ │ │ │ -000f0c30: 7473 2074 6f20 6d61 6b65 2074 6865 6d20 ts to make them │ │ │ │ -000f0c40: 6f70 7469 6f6e 616c 2028 3029 2c20 7265 optional (0), re │ │ │ │ -000f0c50: 7175 6972 6564 2028 3129 2c20 6f72 2070 quired (1), or p │ │ │ │ -000f0c60: 726f 6869 6269 7465 6420 2830 3a30 292e rohibited (0:0). │ │ │ │ -000f0c70: 2044 6566 6175 6c74 2076 616c 7565 7320 Default values │ │ │ │ -000f0c80: 6361 6e20 6265 2061 7373 6967 6e65 6420 can be assigned │ │ │ │ -000f0c90: 746f 206f 7074 696f 6e61 6c20 6174 7472 to optional attr │ │ │ │ -000f0ca0: 6962 7574 6573 2e3c 2f70 3e0a 3c70 3e46 ibutes.

.

F │ │ │ │ -000f0cb0: 6f72 2065 7861 6d70 6c65 3c2f 703e 0a3c or example

.< │ │ │ │ -000f0cc0: 6469 7620 636c 6173 733d 2266 7261 676d div class="fragm │ │ │ │ -000f0cd0: 656e 7422 3e3c 6469 7620 636c 6173 733d ent">
str │ │ │ │ -000f0d00: 7563 7420 3c2f 7370 616e 3e6e 735f 5f4d uct ns__M │ │ │ │ -000f0d10: 7952 6563 6f72 6420 3c2f 6469 763e 0a3c yRecord
.< │ │ │ │ -000f0d20: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -000f0d30: 3e7b 3c2f 6469 763e 0a3c 6469 7620 636c >{
.
@ < │ │ │ │ -000f0d50: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -000f0d60: 6f72 6474 7970 6522 3e69 6e74 3c2f 7370 ordtype">int m 1; // required att │ │ │ │ -000f0da0: 7269 6275 7465 2028 6f63 6375 7273 2061 ribute (occurs a │ │ │ │ -000f0db0: 7420 6c65 6173 7420 6f6e 6365 2920 3c2f t least once)
.
│ │ │ │ -000f0de0: 4020 3c73 7061 6e20 636c 6173 733d 226b @ int< │ │ │ │ -000f0e00: 2f73 7061 6e3e 206e 203d 2035 3b20 3c73 /span> n = 5; // optional │ │ │ │ -000f0e30: 6174 7472 6962 7574 6520 7769 7468 2064 attribute with d │ │ │ │ -000f0e40: 6566 6175 6c74 2076 616c 7565 2035 3c2f efault value 5
.
│ │ │ │ -000f0e70: 4020 3c73 7061 6e20 636c 6173 733d 226b @ int< │ │ │ │ -000f0e90: 2f73 7061 6e3e 206f 2030 3b20 2020 3c73 /span> o 0; // optional │ │ │ │ -000f0ec0: 6174 7472 6962 7574 6520 286d 6179 206f attribute (may o │ │ │ │ -000f0ed0: 7220 6d61 7920 6e6f 7420 6f63 6375 7229 r may not occur) │ │ │ │ -000f0ee0: 203c 2f73 7061 6e3e 3c2f 6469 763e 0a3c
.< │ │ │ │ -000f0ef0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -000f0f00: 3e20 2040 203c 7370 616e 2063 6c61 7373 > @ i │ │ │ │ -000f0f20: 6e74 3c2f 7370 616e 3e20 7020 303a 303b nt p 0:0; │ │ │ │ -000f0f30: 203c 7370 616e 2063 6c61 7373 3d22 636f // prohib │ │ │ │ -000f0f50: 6974 6564 2061 7474 7269 6275 7465 203c ited attribute < │ │ │ │ -000f0f60: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
.} │ │ │ │ -000f0f80: 3b3c 2f64 6976 3e0a 3c2f 6469 763e 3c21 ;
.
< │ │ │ │ -000f0fa0: 703e 5265 6d65 6d62 6572 2074 6f20 7365 p>Remember to se │ │ │ │ -000f0fb0: 7420 7468 6520 3c63 6f64 653e 2353 4f41 t the #SOA │ │ │ │ -000f0fc0: 505f 584d 4c5f 5354 5249 4354 3c2f 636f P_XML_STRICT input mode f │ │ │ │ -000f0fe0: 6c61 6720 746f 2065 6e61 626c 6520 7468 lag to enable th │ │ │ │ -000f0ff0: 6520 7661 6c69 6461 7469 6f6e 206f 6620 e validation of │ │ │ │ -000f1000: 6174 7472 6962 7574 6520 6f63 6375 7272 attribute occurr │ │ │ │ -000f1010: 656e 6365 2063 6f6e 7374 7261 696e 7473 ence constraints │ │ │ │ -000f1020: 2e3c 2f70 3e0a 3c70 3e53 6565 2061 6c73 .

.

See als │ │ │ │ -000f1030: 6f20 3c61 2068 7265 663d 222e 2e2f 2e2e o C │ │ │ │ -000f1060: 616e 6420 432b 2b20 584d 4c20 6461 7461 and C++ XML data │ │ │ │ -000f1070: 2062 696e 6469 6e67 733c 2f61 3e20 646f bindings do │ │ │ │ -000f1080: 6375 6d65 6e74 6174 696f 6e20 666f 7220 cumentation for │ │ │ │ -000f1090: 6d6f 7265 2064 6574 6169 6c73 2e3c 2f70 more details.

.

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

.

.Value c │ │ │ │ -000f1110: 6f6e 7374 7261 696e 7473 3c2f 6832 3e0a onstraints

. │ │ │ │ -000f1120: 3c70 3e56 616c 7565 2063 6f6e 7374 7261

Value constra │ │ │ │ -000f1130: 696e 7473 2072 6573 7472 6963 7420 7468 ints restrict th │ │ │ │ -000f1140: 6520 6c65 6e67 7468 206f 6620 7374 7269 e length of stri │ │ │ │ -000f1150: 6e67 7320 616e 6420 7468 6520 7261 6e67 ngs and the rang │ │ │ │ -000f1160: 6520 6f66 2076 616c 7565 7320 6f66 206e e of values of n │ │ │ │ -000f1170: 756d 6572 6963 2074 7970 6573 2e3c 2f70 umeric types.

.

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

.

.Data l │ │ │ │ -000f11f0: 656e 6774 6820 7265 7374 7269 6374 696f ength restrictio │ │ │ │ -000f1200: 6e73 3c2f 6833 3e0a 3c70 3e41 2073 6368 ns

.

A sch │ │ │ │ -000f1210: 656d 6120 7369 6d70 6c65 5479 7065 2069 ema simpleType i │ │ │ │ -000f1220: 7320 6465 6669 6e65 6420 7769 7468 2061 s defined with a │ │ │ │ -000f1230: 203c 636f 6465 3e74 7970 6564 6566 3c2f typedef by taking │ │ │ │ -000f1250: 6120 6261 7365 2070 7269 6d69 7469 7665 a base primitive │ │ │ │ -000f1260: 2074 6f20 6465 6669 6e65 6420 6120 6465 to defined a de │ │ │ │ -000f1270: 7269 7665 6420 7369 6d70 6c65 5479 7065 rived simpleType │ │ │ │ -000f1280: 2e20 466f 7220 6578 616d 706c 653a 3c2f . For example:.

typedef │ │ │ │ -000f12e0: 3c73 7061 6e20 636c 6173 733d 226b 6579 int time__secon │ │ │ │ -000f1310: 6473 3b3c 2f64 6976 3e0a 3c2f 6469 763e ds;
.
│ │ │ │ -000f1320: 3c21 2d2d 2066 7261 676d 656e 7420 2d2d < │ │ │ │ -000f1560: 2f64 6976 3e3c 703e 4120 636f 6d70 6c65 /div>

A comple │ │ │ │ -000f1570: 7854 7970 6520 7769 7468 2073 696d 706c xType with simpl │ │ │ │ -000f1580: 6543 6f6e 7465 6e74 2069 7320 6465 6669 eContent is defi │ │ │ │ -000f1590: 6e65 6420 7769 7468 2061 2077 7261 7070 ned with a wrapp │ │ │ │ -000f15a0: 6572 2073 7472 7563 742f 636c 6173 733a er struct/class: │ │ │ │ -000f15b0: 3c2f 703e 0a3c 6469 7620 636c 6173 733d

.
struct time__date .
{
. │ │ │ │ -000f1640: 2020 203c 7370 616e 2063 6c61 7373 3d22 cha │ │ │ │ -000f1660: 723c 2f73 7061 6e3e 202a 5f5f 6974 656d r *__item │ │ │ │ -000f1670: 3b20 3c73 7061 6e20 636c 6173 733d 2263 ; // some │ │ │ │ -000f1690: 6375 7374 6f6d 2066 6f72 6d61 7420 6461 custom format da │ │ │ │ -000f16a0: 7465 2028 7265 7374 7269 6374 696f 6e20 te (restriction │ │ │ │ -000f16b0: 6f66 2073 7472 696e 6729 203c 2f73 7061 of string)
.
@ < │ │ │ │ -000f16e0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -000f16f0: 6f72 6422 3e65 6e75 6d3c 2f73 7061 6e3e ord">enum │ │ │ │ -000f1700: 2074 696d 655f 5f7a 6f6e 6520 7b20 4553 time__zone { ES │ │ │ │ -000f1710: 542c 2047 4d54 2c20 2e2e 2e20 7d20 7a6f T, GMT, ... } zo │ │ │ │ -000f1720: 6e65 3b20 3c2f 6469 763e 0a3c 6469 7620 ne;
.
}.

T │ │ │ │ -000f1760: 6869 7320 6465 6669 6e65 7320 7468 6520 his defines the │ │ │ │ -000f1770: 666f 6c6c 6f77 696e 6720 7363 6865 6d61 following schema │ │ │ │ -000f1780: 2074 7970 6520 696e 203c 656d 3e3c 636f type in time.xsd:

. < │ │ │ │ -000f17c0: 6469 7620 636c 6173 733d 2266 7261 676d div class="fragm │ │ │ │ -000f17d0: 656e 7422 3e3c 6469 7620 636c 6173 733d ent">
<complexType │ │ │ │ -000f1810: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c na │ │ │ │ -000f1830: 6d65 3c2f 7370 616e 3e3d 3c73 7061 6e20 me="date │ │ │ │ -000f1860: 2671 756f 743b 3c2f 7370 616e 3e26 6774 "> │ │ │ │ -000f1870: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
< │ │ │ │ -000f1890: 3b3c 7370 616e 2063 6c61 7373 3d22 6b65 ;simpl │ │ │ │ -000f18b0: 6543 6f6e 7465 6e74 3c2f 7370 616e 3e26 eContent& │ │ │ │ -000f18c0: 6774 3b20 3c2f 6469 763e 0a3c 6469 7620 gt;
.
│ │ │ │ -000f18e0: 2026 6c74 3b3c 7370 616e 2063 6c61 7373 <e │ │ │ │ -000f1900: 7874 656e 7369 6f6e 3c2f 7370 616e 3e20 xtension │ │ │ │ -000f1910: 3c73 7061 6e20 636c 6173 733d 226b 6579 base=&q │ │ │ │ -000f1950: 756f 743b 7873 643a 7374 7269 6e67 2671 uot;xsd:string&q │ │ │ │ -000f1960: 756f 743b 3c2f 7370 616e 3e2f 2667 743b uot;/> │ │ │ │ -000f1970: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
< │ │ │ │ -000f1990: 2f3c 7370 616e 2063 6c61 7373 3d22 6b65 /simpl │ │ │ │ -000f19b0: 6543 6f6e 7465 6e74 3c2f 7370 616e 3e26 eContent& │ │ │ │ -000f19c0: 6774 3b20 3c2f 6469 763e 0a3c 6469 7620 gt;
.
& │ │ │ │ -000f19e0: 6c74 3b3c 7370 616e 2063 6c61 7373 3d22 lt;att │ │ │ │ -000f1a00: 7269 6275 7465 3c2f 7370 616e 3e20 3c73 ribute name= │ │ │ │ -000f1a30: 3c73 7061 6e20 636c 6173 733d 2273 7472 &quo │ │ │ │ -000f1a50: 743b 7a6f 6e65 2671 756f 743b 3c2f 7370 t;zone" type="time:zon │ │ │ │ -000f1ab0: 6526 7175 6f74 3b3c 2f73 7061 6e3e 203c e" < │ │ │ │ -000f1ac0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -000f1ad0: 6f72 6422 3e75 7365 3c2f 7370 616e 3e3d ord">use= │ │ │ │ -000f1ae0: 3c73 7061 6e20 636c 6173 733d 2273 7472 &quo │ │ │ │ -000f1b00: 743b 6f70 7469 6f6e 616c 2671 756f 743b t;optional" │ │ │ │ -000f1b10: 3c2f 7370 616e 3e2f 2667 743b 203c 2f64 /> .
</complexType │ │ │ │ -000f1b60: 3c2f 7370 616e 3e26 6774 3b3c 2f64 6976 >
.
<simpleType name="zone&quo │ │ │ │ -000f1c00: 743b 3c2f 7370 616e 3e26 6774 3b20 3c2f t;> .
<restricti │ │ │ │ -000f1c50: 6f6e 3c2f 7370 616e 3e20 3c73 7061 6e20 on │ │ │ │ -000f1c70: 6261 7365 3c2f 7370 616e 3e3d 3c73 7061 base="xs │ │ │ │ -000f1ca0: 643a 7374 7269 6e67 2671 756f 743b 3c2f d:string">
│ │ │ │ -000f1cc0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
<enumeration │ │ │ │ -000f1d00: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c va │ │ │ │ -000f1d20: 6c75 653c 2f73 7061 6e3e 3d3c 7370 616e lue="EST │ │ │ │ -000f1d50: 2671 756f 743b 3c2f 7370 616e 3e2f 2667 "/&g │ │ │ │ -000f1d60: 743b 203c 2f64 6976 3e0a 3c64 6976 2063 t;
.
│ │ │ │ -000f1d80: 266c 743b 3c73 7061 6e20 636c 6173 733d <en │ │ │ │ -000f1da0: 756d 6572 6174 696f 6e3c 2f73 7061 6e3e umeration │ │ │ │ -000f1db0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 value= │ │ │ │ -000f1df0: 2671 756f 743b 474d 5426 7175 6f74 3b3c "GMT"< │ │ │ │ -000f1e00: 2f73 7061 6e3e 2f26 6774 3b20 3c2f 6469 /span>/> .
... .
</restricti │ │ │ │ -000f1e70: 6f6e 3c2f 7370 616e 3e26 6774 3b20 3c2f on> .
</simpleType │ │ │ │ -000f1ec0: 3c2f 7370 616e 3e26 6774 3b3c 2f64 6976 >
.
│ │ │ │ -000f1ef0: 3c70 3e44 6174 6120 7661 6c75 6520 6c65

Data value le │ │ │ │ -000f1f00: 6e67 7468 2063 6f6e 7374 7261 696e 7473 ngth constraints │ │ │ │ -000f1f10: 206f 6620 7369 6d70 6c65 5479 7065 7320 of simpleTypes │ │ │ │ -000f1f20: 616e 6420 636f 6d70 6c65 7854 7970 6573 and complexTypes │ │ │ │ -000f1f30: 2077 6974 6820 7369 6d70 6c65 436f 6e74 with simpleCont │ │ │ │ -000f1f40: 656e 7420 6172 6520 6465 6669 6e65 6420 ent are defined │ │ │ │ -000f1f50: 6173 2066 6f6c 6c6f 7773 3a3c 2f70 3e0a as follows:

. │ │ │ │ -000f1f60: 3c64 6976 2063 6c61 7373 3d22 6672 6167
ty │ │ │ │ -000f1fa0: 7065 6465 663c 2f73 7061 6e3e 203c 7370 pedef char *ns__string25 │ │ │ │ -000f1fe0: 3620 303a 3235 363b 203c 7370 616e 2063 6 0:256; / │ │ │ │ -000f2000: 2f20 7369 6d70 6c65 5479 7065 2072 6573 / simpleType res │ │ │ │ -000f2010: 7472 6963 7469 6f6e 206f 6620 7374 7269 triction of stri │ │ │ │ -000f2020: 6e67 2077 6974 6820 6d61 7820 6c65 6e67 ng with max leng │ │ │ │ -000f2030: 7468 2032 3536 2063 6861 7261 6374 6572 th 256 character │ │ │ │ -000f2040: 7320 3c2f 7370 616e 3e3c 2f64 6976 3e0a s
. │ │ │ │ -000f2050: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
typedef< │ │ │ │ -000f2080: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> char *ns │ │ │ │ -000f20b0: 5f5f 7374 7269 6e67 3130 2031 303a 3130 __string10 10:10 │ │ │ │ -000f20c0: 3b20 3c73 7061 6e20 636c 6173 733d 2263 ; // simpl │ │ │ │ -000f20e0: 6554 7970 6520 7265 7374 7269 6374 696f eType restrictio │ │ │ │ -000f20f0: 6e20 6f66 2073 7472 696e 6720 7769 7468 n of string with │ │ │ │ -000f2100: 206c 656e 6774 6820 6f66 2031 3020 6368 length of 10 ch │ │ │ │ -000f2110: 6172 6163 7465 7273 203c 2f73 7061 6e3e aracters │ │ │ │ -000f2120: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
t │ │ │ │ -000f2150: 7970 6564 6566 3c2f 7370 616e 3e20 7374 ypedef st │ │ │ │ -000f2160: 643a 3a73 7472 696e 6720 2a6e 735f 5f73 d::string *ns__s │ │ │ │ -000f2170: 7472 696e 6738 2038 3b20 3c73 7061 6e20 tring8 8; │ │ │ │ -000f2190: 2f2f 2073 696d 706c 6554 7970 6520 7265 // simpleType re │ │ │ │ -000f21a0: 7374 7269 6374 696f 6e20 6f66 2073 7472 striction of str │ │ │ │ -000f21b0: 696e 6720 7769 7468 2061 7420 6c65 6173 ing with at leas │ │ │ │ -000f21c0: 7420 3820 6368 6172 6163 7465 7273 203c t 8 characters < │ │ │ │ -000f21d0: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
.< │ │ │ │ -000f21f0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -000f2200: 6f72 6422 3e73 7472 7563 7420 3c2f 7370 ord">struct ns__data // simpleConte │ │ │ │ -000f2240: 6e74 2077 7261 7070 6572 203c 2f73 7061 nt wrapper
.
{.
char * │ │ │ │ -000f22b0: 5f5f 6974 656d 203a 3235 363b 203c 7370 __item :256; // simpleCont │ │ │ │ -000f22e0: 656e 7420 7769 7468 2061 7420 6d6f 7374 ent with at most │ │ │ │ -000f22f0: 2032 3536 2063 6861 7261 6374 6572 7320 256 characters │ │ │ │ -000f2300: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ │ -000f2320: 2020 4020 3c73 7061 6e20 636c 6173 733d @ ch │ │ │ │ -000f2340: 6172 3c2f 7370 616e 3e20 2a6e 616d 6520 ar *name │ │ │ │ -000f2350: 313b 2020 2020 2020 3c73 7061 6e20 636c 1; // │ │ │ │ -000f2370: 2072 6571 7569 7265 6420 6e61 6d65 2061 required name a │ │ │ │ -000f2380: 7474 7269 6275 7465 203c 2f73 7061 6e3e ttribute │ │ │ │ -000f2390: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
}; .
struc │ │ │ │ -000f23e0: 7420 3c2f 7370 616e 3e74 696d 655f 5f64 t time__d │ │ │ │ -000f23f0: 6174 6520 3c73 7061 6e20 636c 6173 733d ate // sim │ │ │ │ -000f2410: 706c 6543 6f6e 7465 6e74 2077 7261 7070 pleContent wrapp │ │ │ │ -000f2420: 6572 203c 2f73 7061 6e3e 3c2f 6469 763e er
│ │ │ │ -000f2430: 0a3c 6469 7620 636c 6173 733d 226c 696e .
{
.
│ │ │ │ -000f2460: 203c 7370 616e 2063 6c61 7373 3d22 6b65 char< │ │ │ │ -000f2480: 2f73 7061 6e3e 202a 5f5f 6974 656d 203a /span> *__item : │ │ │ │ -000f2490: 3130 303b 203c 2f64 6976 3e0a 3c64 6976 100;
.
│ │ │ │ -000f24b0: 4020 3c73 7061 6e20 636c 6173 733d 226b @ enum time__zone { │ │ │ │ -000f24e0: 2045 5354 2c20 474d 542c 202e 2e2e 207d EST, GMT, ... } │ │ │ │ -000f24f0: 207a 6f6e 6520 3d20 474d 543b 203c 2f64 zone = GMT; .
}
.

Set the │ │ │ │ -000f2540: 3c63 6f64 653e 2353 4f41 505f 584d 4c5f #SOAP_XML_ │ │ │ │ -000f2550: 5354 5249 4354 3c2f 636f 6465 3e20 6d6f STRICT mo │ │ │ │ -000f2560: 6465 2066 6c61 6720 746f 2065 6e61 626c de flag to enabl │ │ │ │ -000f2570: 6520 7468 6520 7661 6c69 6461 7469 6f6e e the validation │ │ │ │ -000f2580: 206f 6620 7661 6c75 6520 6c65 6e67 7468 of value length │ │ │ │ -000f2590: 2063 6f6e 7374 7261 696e 7473 2e3c 2f70 constraints.

.

See also C and │ │ │ │ -000f25e0: 432b 2b20 584d 4c20 6461 7461 2062 696e C++ XML data bin │ │ │ │ -000f25f0: 6469 6e67 733c 2f61 3e20 646f 6375 6d65 dings docume │ │ │ │ -000f2600: 6e74 6174 696f 6e20 666f 7220 6d6f 7265 ntation for more │ │ │ │ -000f2610: 2064 6574 6169 6c73 2e3c 2f70 3e0a 3c70 details.

.

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

.Value │ │ │ │ -000f2690: 7261 6e67 6520 7265 7374 7269 6374 696f range restrictio │ │ │ │ -000f26a0: 6e73 3c2f 6833 3e0a 3c70 3e53 696d 696c ns

.

Simil │ │ │ │ -000f26b0: 6172 2074 6f20 6461 7461 206c 656e 6774 ar to data lengt │ │ │ │ -000f26c0: 6820 636f 6e73 7472 6169 6e74 7320 666f h constraints fo │ │ │ │ -000f26d0: 7220 7374 7269 6e67 2d62 6173 6564 2064 r string-based d │ │ │ │ -000f26e0: 6174 612c 2069 6e74 6567 6572 2061 6e64 ata, integer and │ │ │ │ -000f26f0: 2066 6c6f 6174 696e 6720 706f 696e 7420 floating point │ │ │ │ -000f2700: 7661 6c75 6520 7261 6e67 6520 636f 6e73 value range cons │ │ │ │ -000f2710: 7472 6169 6e74 7320 6f6e 206e 756d 6572 traints on numer │ │ │ │ -000f2720: 6963 2073 696d 706c 6554 7970 6573 2061 ic simpleTypes a │ │ │ │ -000f2730: 6e64 2063 6f6d 706c 6578 5479 7065 7320 nd complexTypes │ │ │ │ -000f2740: 7769 7468 2073 696d 706c 6543 6f6e 7465 with simpleConte │ │ │ │ -000f2750: 6e74 2061 7265 2064 6563 6c61 7265 6420 nt are declared │ │ │ │ -000f2760: 7769 7468 203c 636f 6465 3e6c 6f77 203a with low : │ │ │ │ -000f2770: 2068 6967 683c 2f63 6f64 653e 2c20 7768 high, wh │ │ │ │ -000f2780: 6572 6520 3c63 6f64 653e 6c6f 773c 2f63 ere low and h │ │ │ │ -000f27a0: 6967 683c 2f63 6f64 653e 2061 7265 206f igh are o │ │ │ │ -000f27b0: 7074 696f 6e61 6c2e 3c2f 703e 0a3c 703e ptional.

.

│ │ │ │ -000f27c0: 4173 206f 6620 6753 4f41 5020 322e 382e As of gSOAP 2.8. │ │ │ │ -000f27d0: 3236 2c20 666c 6f61 7469 6e67 2070 6f69 26, floating poi │ │ │ │ -000f27e0: 6e74 2076 616c 7565 2072 616e 6765 7320 nt value ranges │ │ │ │ -000f27f0: 616e 6420 696e 7465 6765 7220 7261 6e67 and integer rang │ │ │ │ -000f2800: 6573 2063 616e 2062 6520 6578 636c 7573 es can be exclus │ │ │ │ -000f2810: 6976 6520 6279 2061 6464 696e 6720 3c63 ive by adding < │ │ │ │ -000f2830: 6f6e 2065 6974 6865 7220 7369 6465 206f on either side o │ │ │ │ -000f2840: 6620 7468 6520 3c63 6f64 653e 3a3c 2f63 f the : range opera │ │ │ │ -000f2860: 746f 723a 3c2f 703e 0a3c 7461 626c 6520 tor:

... │ │ │ │ -000f2910: 3c2f 7472 3e0a 3c74 7220 636c 6173 733d ..< │ │ │ │ -000f2970: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ │ -000f2980: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ │ -000f2990: 3e31 2026 6c74 3b3d 2078 2020 2020 3c2f >1 <= x ...< │ │ │ │ -000f2a40: 7472 2063 6c61 7373 3d22 6d61 726b 646f tr class="markdo │ │ │ │ -000f2a50: 776e 5461 626c 6552 6f77 4f64 6422 3e0a wnTableRowOdd">. │ │ │ │ -000f2a60: 3c74 6420 636c 6173 733d 226d 6172 6b64 │ │ │ │ -000f2ad0: 3c2f 7472 3e0a 3c74 7220 636c 6173 733d .... │ │ │ │ -000f2be0: 3c74 6420 636c 6173 733d 226d 6172 6b64 │ │ │ │ -000f2c20: 0a3c 7472 2063 6c61 7373 3d22 6d61 726b ......< │ │ │ │ -000f2e00: 2f74 723e 0a3c 7472 2063 6c61 7373 3d22 /tr>.... │ │ │ │ -000f2ec0: 3c74 6420 636c 6173 733d 226d 6172 6b64 < │ │ │ │ -000f2f00: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ │ -000f2f10: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ │ -000f2f20: 3e31 2026 6c74 3b20 7820 2020 203c 2f74 >1 < x ...< │ │ │ │ -000f2fd0: 7472 2063 6c61 7373 3d22 6d61 726b 646f tr class="markdo │ │ │ │ -000f2fe0: 776e 5461 626c 6552 6f77 4576 656e 223e wnTableRowEven"> │ │ │ │ -000f2ff0: 0a3c 7464 2063 6c61 7373 3d22 6d61 726b ..
range │ │ │ │ -000f28d0: 3c2f 7468 3e3c 7468 2063 6c61 7373 3d22 validatio │ │ │ │ -000f2900: 6e20 6368 6563 6b20 2020 203c 2f74 683e n check
1 │ │ │ │ -000f2960: 3c2f 636f 6465 3e20 2020 3c2f 7464 3e3c
1 : │ │ │ │ -000f2a00: 3c2f 7464 3e3c 7464 2063 6c61 7373 3d22 1 <= x │ │ │ │ -000f2a30: 2020 2020 3c2f 7464 3e3c 2f74 723e 0a3c
: 10 x & │ │ │ │ -000f2ac0: 6c74 3b3d 2031 3020 2020 203c 2f74 643e lt;= 10
│ │ │ │ -000f2b20: 3120 3a20 3130 3c2f 636f 6465 3e20 2020 1 : 10 │ │ │ │ -000f2b30: 3c2f 7464 3e3c 7464 2063 6c61 7373 3d22 1 <= x │ │ │ │ -000f2b60: 2026 6c74 3b3d 2031 3020 2020 203c 2f74 <= 10
1 < : < 1 │ │ │ │ -000f2bd0: 303c 2f63 6f64 653e 2020 203c 2f74 643e 0 1 < x < │ │ │ │ -000f2c10: 3130 2020 2020 3c2f 7464 3e3c 2f74 723e 10
1 < │ │ │ │ -000f2c70: 3b20 3130 3c2f 636f 6465 3e20 2020 3c2f ; 10 1 < x &l │ │ │ │ -000f2cb0: 743b 2031 3020 2020 203c 2f74 643e 3c2f t; 10
1 : │ │ │ │ -000f2d10: 2026 6c74 3b20 3130 3c2f 636f 6465 3e20 < 10 │ │ │ │ -000f2d20: 2020 3c2f 7464 3e3c 7464 2063 6c61 7373 1 <= │ │ │ │ -000f2d50: 2078 2026 6c74 3b20 3130 2020 2020 3c2f x < 10
: < 10 x & │ │ │ │ -000f2df0: 6c74 3b20 3130 2020 2020 3c2f 7464 3e3c lt; 10
&l │ │ │ │ -000f2e50: 743b 2031 303c 2f63 6f64 653e 2020 203c t; 10 < │ │ │ │ -000f2e60: 2f74 643e 3c74 6420 636c 6173 733d 226d /td>x < 10 │ │ │ │ -000f2e90: 2020 203c 2f74 643e 3c2f 7472 3e0a 3c74
1 < : │ │ │ │ -000f2ef0: 3c2f 636f 6465 3e20 2020 3c2f 7464 3e3c
1 < │ │ │ │ -000f2f90: 203c 2f74 643e 3c74 6420 636c 6173 733d 1 < x │ │ │ │ -000f2fc0: 2020 2020 3c2f 7464 3e3c 2f74 723e 0a3c
1 < │ │ │ │ -000f3020: 3a20 3130 3c2f 636f 6465 3e20 2020 3c2f : 10 1 < x &l │ │ │ │ -000f3060: 743b 3d20 3130 2020 203c 2f74 643e 3c2f t;= 10
.

│ │ │ │ -000f3080: 466f 7220 6578 616d 706c 653a 3c2f 703e For example:

│ │ │ │ -000f3090: 0a3c 6469 7620 636c 6173 733d 2266 7261 .
t │ │ │ │ -000f30d0: 7970 6564 6566 3c2f 7370 616e 3e20 3c73 ypedef int ns__int10 0:1 │ │ │ │ -000f3110: 303b 203c 7370 616e 2063 6c61 7373 3d22 0; // simp │ │ │ │ -000f3130: 6c65 5479 7065 2072 6573 7472 6963 7469 leType restricti │ │ │ │ -000f3140: 6f6e 206f 6620 696e 7420 302e 2e31 3020 on of int 0..10 │ │ │ │ -000f3150: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ │ -000f3170: 3c73 7061 6e20 636c 6173 733d 226b 6579 typedef LONG64 ns__long -1000 │ │ │ │ -000f3200: 3030 303a 3130 3030 3030 303b 203c 7370 000:1000000; // simpleType │ │ │ │ -000f3230: 2072 6573 7472 6963 7469 6f6e 206f 6620 restriction of │ │ │ │ -000f3240: 6c6f 6e67 3634 202d 3130 3030 3030 302e long64 -1000000. │ │ │ │ -000f3250: 2e31 3030 3030 3030 203c 2f73 7061 6e3e .1000000 │ │ │ │ -000f3260: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
t │ │ │ │ -000f3290: 7970 6564 6566 3c2f 7370 616e 3e20 3c73 ypedef float ns__float - │ │ │ │ -000f32d0: 312e 3020 266c 743b 3a26 6c74 3b20 3130 1.0 <:< 10 │ │ │ │ -000f32e0: 2e35 3b20 3c73 7061 6e20 636c 6173 733d .5; // sim │ │ │ │ -000f3300: 706c 6554 7970 6520 7265 7374 7269 6374 pleType restrict │ │ │ │ -000f3310: 696f 6e20 6f66 2066 6c6f 6174 2069 6e20 ion of float in │ │ │ │ -000f3320: 282d 312c 3130 2e35 2920 3c2f 7370 616e (-1,10.5)
.
│ │ │ │ -000f3360: 7374 7275 6374 203c 2f73 7061 6e3e 6e73 struct ns │ │ │ │ -000f3370: 5f5f 6461 7461 203c 7370 616e 2063 6c61 __data // │ │ │ │ -000f3390: 7369 6d70 6c65 436f 6e74 656e 7420 7772 simpleContent wr │ │ │ │ -000f33a0: 6170 7065 7220 3c2f 7370 616e 3e3c 2f64 apper .
{
. │ │ │ │ -000f33e0: 2020 2020 3c73 7061 6e20 636c 6173 733d in │ │ │ │ -000f3400: 743c 2f73 7061 6e3e 205f 5f69 7465 6d20 t __item │ │ │ │ -000f3410: 303a 3130 3b20 3c73 7061 6e20 636c 6173 0:10; // s │ │ │ │ -000f3430: 696d 706c 6543 6f6e 7465 6e74 2072 616e impleContent ran │ │ │ │ -000f3440: 6765 2030 2e2e 3130 203c 2f73 7061 6e3e ge 0..10 │ │ │ │ -000f3450: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
@ char *name 1; < │ │ │ │ -000f34a0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ -000f34b0: 656e 7422 3e2f 2f20 7265 7175 6972 6564 ent">// required │ │ │ │ -000f34c0: 206e 616d 6520 6174 7472 6962 7574 6520 name attribute │ │ │ │ -000f34d0: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ │ -000f34f0: 7d3b 3c2f 6469 763e 0a3c 2f64 6976 3e3c };
.
< │ │ │ │ -000f3500: 212d 2d20 6672 6167 6d65 6e74 202d 2d3e !-- fragment --> │ │ │ │ -000f3510: 3c70 3e53 6574 2074 6865 203c 636f 6465

Set the #SOAP_XML_STRIC │ │ │ │ -000f3530: 543c 2f63 6f64 653e 206d 6f64 6520 666c T mode fl │ │ │ │ -000f3540: 6167 2074 6f20 656e 6162 6c65 2074 6865 ag to enable the │ │ │ │ -000f3550: 2076 616c 6964 6174 696f 6e20 6f66 2076 validation of v │ │ │ │ -000f3560: 616c 7565 2072 616e 6765 2063 6f6e 7374 alue range const │ │ │ │ -000f3570: 7261 696e 7473 2e3c 2f70 3e0a 3c70 3e53 raints.

.

S │ │ │ │ -000f3580: 6565 2061 6c73 6f20 3c61 2068 7265 663d ee also C and C++ XM │ │ │ │ -000f35c0: 4c20 6461 7461 2062 696e 6469 6e67 733c L data bindings< │ │ │ │ -000f35d0: 2f61 3e20 646f 6375 6d65 6e74 6174 696f /a> documentatio │ │ │ │ -000f35e0: 6e20 666f 7220 6d6f 7265 2064 6574 6169 n for more detai │ │ │ │ -000f35f0: 6c73 2e3c 2f70 3e0a 3c70 3ef0 9f94 9d20 ls.

.

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

. │ │ │ │ -000f3660: 0a50 6174 7465 726e 2072 6573 7472 6963 .Pattern restric │ │ │ │ -000f3670: 7469 6f6e 733c 2f68 333e 0a3c 703e 5061 tions

.

Pa │ │ │ │ -000f3680: 7474 6572 6e73 2063 616e 2062 6520 6465 tterns can be de │ │ │ │ -000f3690: 6669 6e65 6420 666f 7220 7369 6d70 6c65 fined for simple │ │ │ │ -000f36a0: 5479 7065 2063 6f6e 7465 6e74 2e20 486f Type content. Ho │ │ │ │ -000f36b0: 7765 7665 722c 2070 6174 7465 726e 2076 wever, pattern v │ │ │ │ -000f36c0: 616c 6964 6174 696f 6e20 6973 206e 6f74 alidation is not │ │ │ │ -000f36d0: 2065 6e66 6f72 6365 6420 756e 6c65 7373 enforced unless │ │ │ │ -000f36e0: 2074 6865 203c 636f 6465 3e3c 6120 636c the soap::fsvalidat │ │ │ │ -000f3790: 653c 2f61 3e3c 2f63 6f64 653e 2061 6e64 e and │ │ │ │ -000f37a0: 203c 636f 6465 3e3c 6120 636c 6173 733d soap::fwvalida │ │ │ │ -000f3850: 7465 3c2f 613e 3c2f 636f 6465 3e20 6361 te ca │ │ │ │ -000f3860: 6c6c 6261 636b 7320 6172 6520 7365 7420 llbacks are set │ │ │ │ -000f3870: 746f 2061 2072 6567 6578 206d 6174 6368 to a regex match │ │ │ │ -000f3880: 6572 2e3c 2f70 3e0a 3c70 3e54 6f20 6173 er.

.

To as │ │ │ │ -000f3890: 736f 6369 6174 6520 6120 7061 7474 6572 sociate a patter │ │ │ │ -000f38a0: 6e20 7769 7468 2061 2073 696d 706c 6554 n with a simpleT │ │ │ │ -000f38b0: 7970 652c 2079 6f75 2063 616e 2064 6566 ype, you can def │ │ │ │ -000f38c0: 696e 6520 6120 7369 6d70 6c65 5479 7065 ine a simpleType │ │ │ │ -000f38d0: 2077 6974 6820 6120 3c63 6f64 653e 7479 with a ty │ │ │ │ -000f38e0: 7065 6465 663c 2f63 6f64 653e 2061 6e64 pedef and │ │ │ │ -000f38f0: 2061 2070 6174 7465 726e 2073 7472 696e a pattern strin │ │ │ │ -000f3900: 673a 3c2f 703e 0a3c 6469 7620 636c 6173 g:

.
< │ │ │ │ -000f3930: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -000f3940: 6f72 6422 3e74 7970 6564 6566 3c2f 7370 ord">typedef in │ │ │ │ -000f3970: 743c 2f73 7061 6e3e 2074 696d 655f 5f73 t time__s │ │ │ │ -000f3980: 6563 6f6e 6420 3c73 7061 6e20 636c 6173 econd "[1-5]?[0 │ │ │ │ -000f39b0: 2d39 5d7c 3630 2671 756f 743b 3c2f 7370 -9]|60";
.

T │ │ │ │ -000f3d30: 6865 2070 6174 7465 726e 2073 7472 696e he pattern strin │ │ │ │ -000f3d40: 6720 6d75 7374 2063 6f6e 7461 696e 2061 g must contain a │ │ │ │ -000f3d50: 2076 616c 6964 2072 6567 756c 6172 2065 valid regular e │ │ │ │ -000f3d60: 7870 7265 7373 696f 6e2e 3c2f 703e 0a3c xpression.

.< │ │ │ │ -000f3d70: 703e 4120 7370 6563 6961 6c20 6361 7365 p>A special case │ │ │ │ -000f3d80: 2066 6f72 2043 2066 6f72 6d61 7420 7374 for C format st │ │ │ │ -000f3d90: 7269 6e67 2070 6174 7465 726e 7320 6973 ring patterns is │ │ │ │ -000f3da0: 2069 6e74 726f 6475 6365 6420 696e 2067 introduced in g │ │ │ │ -000f3db0: 534f 4150 2032 2e38 2e31 382e 2057 6865 SOAP 2.8.18. Whe │ │ │ │ -000f3dc0: 6e20 3c65 6d3e 3c63 6f64 653e 7873 643a n xsd: │ │ │ │ -000f3dd0: 746f 7461 6c44 6967 6974 733c 2f63 6f64 totalDigits and │ │ │ │ -000f3df0: 3c63 6f64 653e 7873 643a 6672 6163 7469 xsd:fracti │ │ │ │ -000f3e00: 6f6e 4469 6769 7473 3c2f 636f 6465 3e3c onDigits< │ │ │ │ -000f3e10: 2f65 6d3e 2061 7265 2067 6976 656e 2069 /em> are given i │ │ │ │ -000f3e20: 6e20 6120 5853 4420 6669 6c65 2c20 7468 n a XSD file, th │ │ │ │ -000f3e30: 656e 2061 2043 2066 6f72 6d61 7420 7374 en a C format st │ │ │ │ -000f3e40: 7269 6e67 2069 7320 7072 6f64 7563 6564 ring is produced │ │ │ │ -000f3e50: 2074 6f20 6f75 7470 7574 2066 6c6f 6174 to output float │ │ │ │ -000f3e60: 696e 6720 706f 696e 7420 7661 6c75 6573 ing point values │ │ │ │ -000f3e70: 2077 6974 6820 7468 6520 7072 6f70 6572 with the proper │ │ │ │ -000f3e80: 2070 7265 6369 7369 6f6e 2061 6e64 2073 precision and s │ │ │ │ -000f3e90: 6361 6c65 2e20 466f 7220 6578 616d 706c cale. For exampl │ │ │ │ -000f3ea0: 653a 3c2f 703e 0a3c 6469 7620 636c 6173 e:

.
< │ │ │ │ -000f3ed0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -000f3ee0: 3e26 6c74 3b3c 7370 616e 2063 6c61 7373 ><s │ │ │ │ -000f3f00: 696d 706c 6554 7970 653c 2f73 7061 6e3e impleType │ │ │ │ -000f3f10: 203c 7370 616e 2063 6c61 7373 3d22 6b65 name=& │ │ │ │ -000f3f50: 7175 6f74 3b72 6174 696f 2671 756f 743b quot;ratio" │ │ │ │ -000f3f60: 3c2f 7370 616e 3e26 6774 3b20 3c2f 6469 > .
<restriction │ │ │ │ -000f3fb0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c ba │ │ │ │ -000f3fd0: 7365 3c2f 7370 616e 3e3d 3c73 7061 6e20 se="xsd: │ │ │ │ -000f4000: 666c 6f61 7426 7175 6f74 3b3c 2f73 7061 float">
. │ │ │ │ -000f4030: 2020 2020 266c 743b 3c73 7061 6e20 636c <totalDigits
value │ │ │ │ -000f4080: 3c2f 7370 616e 3e3d 3c73 7061 6e20 636c ="5" │ │ │ │ -000f40b0: 3b3c 2f73 7061 6e3e 2f26 6774 3b20 3c2f ;/> .
<< │ │ │ │ -000f40e0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -000f40f0: 6f72 6474 7970 6522 3e66 7261 6374 696f ordtype">fractio │ │ │ │ -000f4100: 6e44 6967 6974 733c 2f73 7061 6e3e 203c nDigits < │ │ │ │ -000f4110: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -000f4120: 6f72 6422 3e76 616c 7565 3c2f 7370 616e ord">value=&q │ │ │ │ -000f4150: 756f 743b 3226 7175 6f74 3b3c 2f73 7061 uot;2"/>
.< │ │ │ │ -000f4170: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -000f4180: 3e20 2026 6c74 3b2f 3c73 7061 6e20 636c > </restriction
>
. │ │ │ │ -000f41c0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
</simpleType>
.

pr │ │ │ │ -000f4230: 6f64 7563 6573 3a3c 2f70 3e0a 3c64 6976 oduces:

.
typede │ │ │ │ -000f4280: 663c 2f73 7061 6e3e 203c 7370 616e 2063 f float │ │ │ │ -000f42b0: 7469 6d65 5f5f 7261 7469 6f20 3c73 7061 time__ratio "%5 │ │ │ │ -000f42e0: 2e32 6626 7175 6f74 3b3c 2f73 7061 6e3e .2f" │ │ │ │ -000f42f0: 3b3c 2f64 6976 3e0a 3c2f 6469 763e 3c21 ;
.
< │ │ │ │ -000f4310: 703e 5468 6520 666f 726d 6174 2073 7472 p>The format str │ │ │ │ -000f4320: 696e 6720 6973 2075 7365 6420 746f 2066 ing is used to f │ │ │ │ -000f4330: 6f72 6d61 7420 7468 6520 6f75 7470 7574 ormat the output │ │ │ │ -000f4340: 2074 6865 2066 6c6f 6174 696e 6720 706f the floating po │ │ │ │ -000f4350: 696e 7420 7661 6c75 6520 696e 2058 4d4c int value in XML │ │ │ │ -000f4360: 2e3c 2f70 3e0a 3c70 3e53 6565 2061 6c73 .

.

See als │ │ │ │ -000f4370: 6f20 3c61 2068 7265 663d 222e 2e2f 2e2e o C │ │ │ │ -000f43a0: 616e 6420 432b 2b20 584d 4c20 6461 7461 and C++ XML data │ │ │ │ -000f43b0: 2062 696e 6469 6e67 733c 2f61 3e20 646f bindings do │ │ │ │ -000f43c0: 6375 6d65 6e74 6174 696f 6e20 666f 7220 cumentation for │ │ │ │ -000f43d0: 6d6f 7265 2064 6574 6169 6c73 2e3c 2f70 more details.

.

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

.

.Element and at │ │ │ │ -000f4450: 7472 6962 7574 6520 7175 616c 6966 6965 tribute qualifie │ │ │ │ -000f4460: 642f 756e 7175 616c 6966 6965 6420 666f d/unqualified fo │ │ │ │ -000f4470: 726d 733c 2f68 323e 0a3c 703e 5374 7275 rms

.

Stru │ │ │ │ -000f4480: 6374 2c20 636c 6173 732c 2061 6e64 2075 ct, class, and u │ │ │ │ -000f4490: 6e69 6f6e 206d 656d 6265 7273 2072 6570 nion members rep │ │ │ │ -000f44a0: 7265 7365 6e74 2065 6c65 6d65 6e74 7320 resent elements │ │ │ │ -000f44b0: 616e 6420 6174 7472 6962 7574 6573 2074 and attributes t │ │ │ │ -000f44c0: 6861 7420 6172 6520 6175 746f 6d61 7469 hat are automati │ │ │ │ -000f44d0: 6361 6c6c 7920 7175 616c 6966 6965 6420 cally qualified │ │ │ │ -000f44e0: 6f72 2075 6e71 7561 6c69 6669 6564 2064 or unqualified d │ │ │ │ -000f44f0: 6570 656e 6469 6e67 206f 6e20 7468 6520 epending on the │ │ │ │ -000f4500: 7363 6865 6d61 2065 6c65 6d65 6e74 2061 schema element a │ │ │ │ -000f4510: 6e64 2061 7474 7269 6275 7465 2064 6566 nd attribute def │ │ │ │ -000f4520: 6175 6c74 2066 6f72 6d73 2073 7065 6369 ault forms speci │ │ │ │ -000f4530: 6669 6564 2e20 5468 6520 656e 6769 6e65 fied. The engine │ │ │ │ -000f4540: 2061 6c77 6179 7320 7661 6c69 6461 7465 always validate │ │ │ │ -000f4550: 7320 7468 6520 7072 6566 6978 6573 206f s the prefixes o │ │ │ │ -000f4560: 6620 656c 656d 656e 7473 2061 6e64 2061 f elements and a │ │ │ │ -000f4570: 7474 7269 6275 7465 732e 2057 6865 6e20 ttributes. When │ │ │ │ -000f4580: 6120 6e61 6d65 7370 6163 6520 6d69 736d a namespace mism │ │ │ │ -000f4590: 6174 6368 206f 6363 7572 732c 2074 6865 atch occurs, the │ │ │ │ -000f45a0: 2065 6c65 6d65 6e74 206f 7220 6174 7472 element or attr │ │ │ │ -000f45b0: 6962 7574 6520 6973 206e 6f74 2063 6f6e ibute is not con │ │ │ │ -000f45c0: 7375 6d65 6420 7768 6963 6820 6361 6e20 sumed which can │ │ │ │ -000f45d0: 6c65 6164 2074 6f20 6120 7661 6c69 6461 lead to a valida │ │ │ │ -000f45e0: 7469 6f6e 2065 7272 6f72 2028 756e 6c65 tion error (unle │ │ │ │ -000f45f0: 7373 2074 6865 2063 6f6d 706c 6578 5479 ss the complexTy │ │ │ │ -000f4600: 7065 2069 7320 6578 7465 6e73 6962 6c65 pe is extensible │ │ │ │ -000f4610: 206f 7220 7768 656e 203c 636f 6465 3e23 or when # │ │ │ │ -000f4620: 534f 4150 5f58 4d4c 5f53 5452 4943 543c SOAP_XML_STRICT< │ │ │ │ -000f4630: 2f63 6f64 653e 2069 7320 7475 726e 6564 /code> is turned │ │ │ │ -000f4640: 206f 6666 292e 3c2f 703e 0a3c 703e 436f off).

.

Co │ │ │ │ -000f4650: 6e73 6964 6572 2066 6f72 2065 7861 6d70 nsider for examp │ │ │ │ -000f4660: 6c65 3a3c 2f70 3e0a 3c64 6976 2063 6c61 le:

.
│ │ │ │ -000f4690: 3c73 7061 6e20 636c 6173 733d 2263 6f6d //gsoap ns │ │ │ │ -000f46b0: 2073 6368 656d 6120 656c 656d 656e 7446 schema elementF │ │ │ │ -000f46c0: 6f72 6d3a 2071 7561 6c69 6669 6564 203c orm: qualified < │ │ │ │ -000f46d0: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
.< │ │ │ │ -000f46f0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ -000f4700: 656e 7422 3e2f 2f67 736f 6170 206e 7320 ent">//gsoap ns │ │ │ │ -000f4710: 7363 6865 6d61 2061 7474 7269 6275 7465 schema attribute │ │ │ │ -000f4720: 466f 726d 3a20 756e 7175 616c 6966 6965 Form: unqualifie │ │ │ │ -000f4730: 6420 3c2f 7370 616e 3e3c 2f64 6976 3e0a d . │ │ │ │ -000f4740: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
struct < │ │ │ │ -000f4770: 2f73 7061 6e3e 6e73 5f5f 7265 636f 7264 /span>ns__record │ │ │ │ -000f4780: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
{
.
@ char * │ │ │ │ -000f47e0: 7479 7065 3b20 3c2f 6469 763e 0a3c 6469 type;
. │ │ │ │ -000f4800: 2020 203c 7370 616e 2063 6c61 7373 3d22 cha │ │ │ │ -000f4820: 723c 2f73 7061 6e3e 202a 206e 616d 653b r * name; │ │ │ │ -000f4830: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61 .
};.

Her │ │ │ │ -000f4870: 652c 2074 6865 203c 636f 6465 3e6e 735f e, the ns_ │ │ │ │ -000f4880: 5f72 6563 6f72 643c 2f63 6f64 653e 2073 _record s │ │ │ │ -000f4890: 7472 7563 7420 6973 2073 6572 6961 6c69 truct is seriali │ │ │ │ -000f48a0: 7a65 6420 7769 7468 2071 7561 6c69 6669 zed with qualifi │ │ │ │ -000f48b0: 6564 2065 6c65 6d65 6e74 203c 636f 6465 ed element name and │ │ │ │ -000f48d0: 2075 6e71 7561 6c69 6669 6564 2061 7474 unqualified att │ │ │ │ -000f48e0: 7269 6275 7465 203c 636f 6465 3e74 7970 ribute typ │ │ │ │ -000f48f0: 653c 2f63 6f64 653e 3a3c 2f70 3e0a 3c64 e:

. │ │ │ │ -000f4910: 3c64 6976 2063 6c61 7373 3d22 6672 6167
<ns:record< │ │ │ │ -000f4960: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> typ │ │ │ │ -000f4980: 653c 2f73 7061 6e3e 3d3c 7370 616e 2063 e="...&q │ │ │ │ -000f49b0: 756f 743b 3c2f 7370 616e 3e26 6774 3b20 uot;> │ │ │ │ -000f49c0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
<< │ │ │ │ -000f49e0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -000f49f0: 6f72 6474 7970 6522 3e6e 733a 6e61 6d65 ordtype">ns:name │ │ │ │ -000f4a00: 3c2f 7370 616e 3e26 6774 3b2e 2e2e 266c >...&l │ │ │ │ -000f4a10: 743b 2f3c 7370 616e 2063 6c61 7373 3d22 t;/ns: │ │ │ │ -000f4a30: 6e61 6d65 3c2f 7370 616e 3e26 6774 3b20 name> │ │ │ │ -000f4a40: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
</ns:recor │ │ │ │ -000f4a80: 643c 2f73 7061 6e3e 2667 743b 3c2f 6469 d>.

The "colon n │ │ │ │ -000f4ac0: 6f74 6174 696f 6e22 2066 6f72 2073 7472 otation" for str │ │ │ │ -000f4ad0: 7563 742f 636c 6173 732f 756e 696f 6e20 uct/class/union │ │ │ │ -000f4ae0: 6d65 6d62 6572 206e 616d 6573 2069 7320 member names is │ │ │ │ -000f4af0: 7573 6564 2074 6f20 6f76 6572 7269 6465 used to override │ │ │ │ -000f4b00: 2065 6c65 6d65 6e74 2061 6e64 2061 7474 element and att │ │ │ │ -000f4b10: 7269 6275 7465 2071 7561 6c69 6669 6564 ribute qualified │ │ │ │ -000f4b20: 206f 7220 756e 7175 616c 6966 6965 6420 or unqualified │ │ │ │ -000f4b30: 666f 726d 732e 2054 6f20 6f76 6572 7269 forms. To overri │ │ │ │ -000f4b40: 6465 2074 6865 2066 6f72 6d20 666f 7220 de the form for │ │ │ │ -000f4b50: 696e 6469 7669 6475 616c 206d 656d 6265 individual membe │ │ │ │ -000f4b60: 7273 2074 6861 7420 7265 7072 6573 656e rs that represen │ │ │ │ -000f4b70: 7420 656c 656d 656e 7473 2061 6e64 2061 t elements and a │ │ │ │ -000f4b80: 7474 7269 6275 7465 732c 2075 7365 2061 ttributes, use a │ │ │ │ -000f4b90: 206e 616d 6573 7061 6365 2070 7265 6669 namespace prefi │ │ │ │ -000f4ba0: 7820 616e 6420 636f 6c6f 6e20 7769 7468 x and colon with │ │ │ │ -000f4bb0: 2074 6865 206d 656d 6265 7220 6e61 6d65 the member name │ │ │ │ -000f4bc0: 3a3c 2f70 3e0a 3c64 6976 2063 6c61 7373 :

.
//gsoap ns s │ │ │ │ -000f4c10: 6368 656d 6120 656c 656d 656e 7446 6f72 chema elementFor │ │ │ │ -000f4c20: 6d3a 2071 7561 6c69 6669 6564 203c 2f73 m: qualified
.
//gsoap ns sc │ │ │ │ -000f4c70: 6865 6d61 2061 7474 7269 6275 7465 466f hema attributeFo │ │ │ │ -000f4c80: 726d 3a20 756e 7175 616c 6966 6965 6420 rm: unqualified │ │ │ │ -000f4c90: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ │ -000f4cb0: 3c73 7061 6e20 636c 6173 733d 226b 6579 struct
ns__record < │ │ │ │ -000f4ce0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
{
. │ │ │ │ -000f4d00: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
@ │ │ │ │ -000f4d30: 6368 6172 3c2f 7370 616e 3e20 2a20 6e73 char * ns │ │ │ │ -000f4d40: 3a74 7970 653b 203c 2f64 6976 3e0a 3c64 :type;
. │ │ │ │ -000f4d60: 2020 2020 3c73 7061 6e20 636c 6173 733d ch │ │ │ │ -000f4d80: 6172 3c2f 7370 616e 3e20 2a20 3a6e 616d ar * :nam │ │ │ │ -000f4d90: 653b 203c 2f64 6976 3e0a 3c64 6976 2063 e;
.
};.

w │ │ │ │ -000f4dd0: 6865 7265 203c 636f 6465 3e6e 616d 653c here name< │ │ │ │ -000f4de0: 2f63 6f64 653e 2069 7320 756e 7175 616c /code> is unqual │ │ │ │ -000f4df0: 6966 6965 6420 616e 6420 3c63 6f64 653e ified and │ │ │ │ -000f4e00: 7479 7065 3c2f 636f 6465 3e20 6973 2071 type is q │ │ │ │ -000f4e10: 7561 6c69 6669 6564 3a3c 2f70 3e0a 3c64 ualified:

. │ │ │ │ -000f4e30: 3c64 6976 2063 6c61 7373 3d22 6672 6167
<ns:record< │ │ │ │ -000f4e80: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> ns: │ │ │ │ -000f4ea0: 7479 7065 3c2f 7370 616e 3e3d 3c73 7061 type=".. │ │ │ │ -000f4ed0: 2e26 7175 6f74 3b3c 2f73 7061 6e3e 2667 ."&g │ │ │ │ -000f4ee0: 743b 203c 2f64 6976 3e0a 3c64 6976 2063 t;
.
&l │ │ │ │ -000f4f00: 743b 3c73 7061 6e20 636c 6173 733d 226b t;name │ │ │ │ -000f4f20: 3c2f 7370 616e 3e26 6774 3b2e 2e2e 266c >...&l │ │ │ │ -000f4f30: 743b 2f3c 7370 616e 2063 6c61 7373 3d22 t;/nam │ │ │ │ -000f4f50: 653c 2f73 7061 6e3e 2667 743b 203c 2f64 e> .
</ns:record>
. │ │ │ │ -000f4fb0: 3c2f 6469 763e 3c21 2d2d 2066 7261 676d

The colon notat │ │ │ │ -000f4fe0: 696f 6e20 6973 2061 2073 796e 7461 6374 ion is a syntact │ │ │ │ -000f4ff0: 6963 206e 6f74 6174 696f 6e20 7573 6564 ic notation used │ │ │ │ -000f5000: 206f 6e6c 7920 696e 2074 6865 2069 6e74 only in the int │ │ │ │ -000f5010: 6572 6661 6365 2068 6561 6465 7220 6669 erface header fi │ │ │ │ -000f5020: 6c65 2073 796e 7461 782c 2069 7420 6973 le syntax, it is │ │ │ │ -000f5030: 206e 6f74 2074 7261 6e73 6c61 7465 6420 not translated │ │ │ │ -000f5040: 746f 2074 6865 2043 2f43 2b2b 206f 7574 to the C/C++ out │ │ │ │ -000f5050: 7075 742e 3c2f 703e 0a3c 703e 5468 6520 put.

.

The │ │ │ │ -000f5060: 636f 6c6f 6e20 6e6f 7461 7469 6f6e 2064 colon notation d │ │ │ │ -000f5070: 6f65 7320 6e6f 7420 6176 6f69 6420 6e61 oes not avoid na │ │ │ │ -000f5080: 6d65 2063 6c61 7368 6573 2062 6574 7765 me clashes betwe │ │ │ │ -000f5090: 656e 206d 656d 6265 7273 2e20 466f 7220 en members. For │ │ │ │ -000f50a0: 6578 616d 706c 653a 3c2f 703e 0a3c 6469 example:

.
struc │ │ │ │ -000f50f0: 7420 3c2f 7370 616e 3e78 5f5f 7265 636f t x__reco │ │ │ │ -000f5100: 7264 203c 2f64 6976 3e0a 3c64 6976 2063 rd
.
{.
@ char │ │ │ │ -000f5160: 2a20 6e61 6d65 3b20 3c2f 6469 763e 0a3c * name;
.< │ │ │ │ -000f5170: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -000f5180: 3e20 2020 203c 7370 616e 2063 6c61 7373 > c │ │ │ │ -000f51a0: 6861 723c 2f73 7061 6e3e 202a 2078 3a6e har * x:n │ │ │ │ -000f51b0: 616d 653b 203c 2f64 6976 3e0a 3c64 6976 ame;
.
}; │ │ │ │ -000f51d0: 3c2f 6469 763e 0a3c 2f64 6976 3e3c 212d
.

results in a re │ │ │ │ -000f5200: 6465 6669 6e69 7469 6f6e 2065 7272 6f72 definition error │ │ │ │ -000f5210: 2c20 7369 6e63 6520 626f 7468 206d 656d , since both mem │ │ │ │ -000f5220: 6265 7273 2068 6176 6520 7468 6520 7361 bers have the sa │ │ │ │ -000f5230: 6d65 206e 616d 652e 2054 6f20 6176 6f69 me name. To avoi │ │ │ │ -000f5240: 6420 6e61 6d65 2063 6c61 7368 6573 2c20 d name clashes, │ │ │ │ -000f5250: 7573 6520 6120 756e 6465 7273 636f 7265 use a underscore │ │ │ │ -000f5260: 2073 7566 6669 783a 3c2f 703e 0a3c 6469 suffix:

.
struc │ │ │ │ -000f52b0: 7420 3c2f 7370 616e 3e78 5f5f 7265 636f t x__reco │ │ │ │ -000f52c0: 7264 203c 2f64 6976 3e0a 3c64 6976 2063 rd
.
{.
@ char │ │ │ │ -000f5320: 2a20 6e61 6d65 3b20 3c2f 6469 763e 0a3c * name;
.< │ │ │ │ -000f5330: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -000f5340: 3e20 2020 203c 7370 616e 2063 6c61 7373 > c │ │ │ │ -000f5360: 6861 723c 2f73 7061 6e3e 202a 2078 3a6e har * x:n │ │ │ │ -000f5370: 616d 655f 3b20 3c2f 6469 763e 0a3c 6469 ame_;
.} │ │ │ │ -000f5390: 3b3c 2f64 6976 3e0a 3c2f 6469 763e 3c21 ;.< │ │ │ │ -000f53b0: 703e 4e6f 7420 7468 6174 2074 6865 206e p>Not that the n │ │ │ │ -000f53c0: 616d 6573 7061 6365 2070 7265 6669 7820 amespace prefix │ │ │ │ -000f53d0: 636f 6e76 656e 7469 6f6e 2063 616e 2062 convention can b │ │ │ │ -000f53e0: 6520 7573 6564 2069 6e73 7465 6164 3a3c e used instead:< │ │ │ │ -000f53f0: 2f70 3e0a 3c64 6976 2063 6c61 7373 3d22 /p>.
struct │ │ │ │ -000f5440: 785f 5f72 6563 6f72 6420 3c2f 6469 763e x__record
│ │ │ │ -000f5450: 0a3c 6469 7620 636c 6173 733d 226c 696e .
{
.
@ │ │ │ │ -000f5480: 203c 7370 616e 2063 6c61 7373 3d22 6b65 char< │ │ │ │ -000f54a0: 2f73 7061 6e3e 202a 206e 616d 653b 203c /span> * name; < │ │ │ │ -000f54b0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
char * x__name; .
};
.< │ │ │ │ -000f5520: 2f64 6976 3e3c 212d 2d20 6672 6167 6d65 /div>

which a │ │ │ │ -000f5540: 766f 6964 7320 7468 6520 6e61 6d65 2063 voids the name c │ │ │ │ -000f5550: 6c61 7368 2e20 486f 7765 7665 722c 2074 lash. However, t │ │ │ │ -000f5560: 6865 2072 6573 756c 7469 6e67 2073 6368 he resulting sch │ │ │ │ -000f5570: 656d 6120 6973 2064 6966 6665 7265 6e74 ema is different │ │ │ │ -000f5580: 2073 696e 6365 2074 6865 206c 6173 7420 since the last │ │ │ │ -000f5590: 6578 616d 706c 6520 6765 6e65 7261 7465 example generate │ │ │ │ -000f55a0: 7320 6120 676c 6f62 616c 203c 636f 6465 s a global name ele │ │ │ │ -000f55c0: 6d65 6e74 2064 6566 696e 6974 696f 6e20 ment definition │ │ │ │ -000f55d0: 7468 6174 2069 7320 7265 6665 7265 6e63 that is referenc │ │ │ │ -000f55e0: 6564 2062 7920 7468 6520 6c6f 6361 6c20 ed by the local │ │ │ │ -000f55f0: 656c 656d 656e 742e 3c2f 703e 0a3c 703e element.

.

│ │ │ │ -000f5600: 4d6f 7265 2073 7065 6369 6669 6361 6c6c More specificall │ │ │ │ -000f5610: 792c 2074 6865 2064 6966 6665 7265 6e63 y, the differenc │ │ │ │ -000f5620: 6520 6265 7477 6565 6e20 7468 6520 6e61 e between the na │ │ │ │ -000f5630: 6d65 7370 6163 6520 7072 6566 6978 2063 mespace prefix c │ │ │ │ -000f5640: 6f6e 7665 6e74 696f 6e20 7769 7468 2064 onvention with d │ │ │ │ -000f5650: 6f75 626c 6520 756e 6465 7273 636f 7265 ouble underscore │ │ │ │ -000f5660: 7320 616e 6420 636f 6c6f 6e20 6e6f 7461 s and colon nota │ │ │ │ -000f5670: 7469 6f6e 2069 7320 7468 6174 2074 6865 tion is that the │ │ │ │ -000f5680: 206e 616d 6573 7061 6365 2070 7265 6669 namespace prefi │ │ │ │ -000f5690: 7820 636f 6e76 656e 7469 6f6e 2067 656e x convention gen │ │ │ │ -000f56a0: 6572 6174 6573 2073 6368 656d 6120 656c erates schema el │ │ │ │ -000f56b0: 656d 656e 742f 6174 7472 6962 7574 6520 ement/attribute │ │ │ │ -000f56c0: 7265 6665 7265 6e63 6573 2074 6f20 656c references to el │ │ │ │ -000f56d0: 656d 656e 7473 2f61 7474 7269 6275 7465 ements/attribute │ │ │ │ -000f56e0: 7320 6174 2074 6865 2074 6f70 206c 6576 s at the top lev │ │ │ │ -000f56f0: 656c 2c20 7768 696c 6520 7468 6520 636f el, while the co │ │ │ │ -000f5700: 6c6f 6e20 6e6f 7461 7469 6f6e 206f 6e6c lon notation onl │ │ │ │ -000f5710: 7920 6166 6665 6374 7320 7468 6520 6c6f y affects the lo │ │ │ │ -000f5720: 6361 6c20 656c 656d 656e 742f 6174 7472 cal element/attr │ │ │ │ -000f5730: 6962 7574 6520 6e61 6d65 7370 6163 6520 ibute namespace │ │ │ │ -000f5740: 7175 616c 6966 6963 6174 696f 6e20 6279 qualification by │ │ │ │ -000f5750: 2066 6f72 6d20 6f76 6572 7269 6469 6e67 form overriding │ │ │ │ -000f5760: 2e20 5468 6973 2069 7320 6265 7374 2069 . This is best i │ │ │ │ -000f5770: 6c6c 7573 7472 6174 6564 2062 7920 616e llustrated by an │ │ │ │ -000f5780: 2065 7861 6d70 6c65 3a3c 2f70 3e0a 3c64 example:

.
stru │ │ │ │ -000f57d0: 6374 203c 2f73 7061 6e3e 785f 5f72 6563 ct x__rec │ │ │ │ -000f57e0: 6f72 6420 3c2f 6469 763e 0a3c 6469 7620 ord
.
{.
char │ │ │ │ -000f5840: 202a 203a 6e61 6d65 3b20 3c2f 6469 763e * :name;
│ │ │ │ -000f5850: 0a3c 6469 7620 636c 6173 733d 226c 696e .
char * x │ │ │ │ -000f5890: 3a70 686f 6e65 3b20 3c2f 6469 763e 0a3c :phone;
.< │ │ │ │ -000f58a0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -000f58b0: 3e20 2020 203c 7370 616e 2063 6c61 7373 > c │ │ │ │ -000f58d0: 6861 723c 2f73 7061 6e3e 202a 2078 5f5f har * x__ │ │ │ │ -000f58e0: 6661 783b 203c 2f64 6976 3e0a 3c64 6976 fax;
.
│ │ │ │ -000f5900: 2020 3c73 7061 6e20 636c 6173 733d 226b char │ │ │ │ -000f5920: 3c2f 7370 616e 3e20 2a20 795f 5f7a 6970 * y__zip │ │ │ │ -000f5930: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
};.

wh │ │ │ │ -000f5970: 6963 6820 6765 6e65 7261 7465 7320 7468 ich generates th │ │ │ │ -000f5980: 6520 666f 6c6c 6f77 696e 6720 3c65 6d3e e following │ │ │ │ -000f5990: 3c63 6f64 653e 782e 7873 643c 2f63 6f64 x.xsdschema:.

< │ │ │ │ -000f59f0: 3b3c 7370 616e 2063 6c61 7373 3d22 6b65 ;compl │ │ │ │ -000f5a10: 6578 5479 7065 3c2f 7370 616e 3e20 3c73 exType name= │ │ │ │ -000f5a40: 3c73 7061 6e20 636c 6173 733d 2273 7472 &quo │ │ │ │ -000f5a60: 743b 7265 636f 7264 2671 756f 743b 3c2f t;record">
│ │ │ │ -000f5a80: 0a3c 6469 7620 636c 6173 733d 226c 696e .
<sequence>
. │ │ │ │ -000f5ae0: 2020 2020 266c 743b 3c73 7061 6e20 636c <element │ │ │ │ -000f5b10: 203c 7370 616e 2063 6c61 7373 3d22 6b65 name=& │ │ │ │ -000f5b50: 7175 6f74 3b6e 616d 6526 7175 6f74 3b3c quot;name"< │ │ │ │ -000f5b60: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> typ │ │ │ │ -000f5b80: 653c 2f73 7061 6e3e 3d3c 7370 616e 2063 e="xsd:s │ │ │ │ -000f5bb0: 7472 696e 6726 7175 6f74 3b3c 2f73 7061 tring" minOccu │ │ │ │ -000f5be0: 7273 3c2f 7370 616e 3e3d 3c73 7061 6e20 rs="0&qu │ │ │ │ -000f5c10: 6f74 3b3c 2f73 7061 6e3e 203c 7370 616e ot; maxOccurs=&q │ │ │ │ -000f5c60: 756f 743b 3126 7175 6f74 3b3c 2f73 7061 uot;1" nillabl │ │ │ │ -000f5c90: 653c 2f73 7061 6e3e 3d3c 7370 616e 2063 e="true& │ │ │ │ -000f5cc0: 7175 6f74 3b3c 2f73 7061 6e3e 203c 7370 quot; form=< │ │ │ │ -000f5cf0: 7370 616e 2063 6c61 7373 3d22 7374 7269 span class="stri │ │ │ │ -000f5d00: 6e67 6c69 7465 7261 6c22 3e26 7175 6f74 ngliteral">" │ │ │ │ -000f5d10: 3b75 6e71 7561 6c69 6669 6564 2671 756f ;unqualified&quo │ │ │ │ -000f5d20: 743b 3c2f 7370 616e 3e2f 2667 743b 203c t;/> < │ │ │ │ -000f5d30: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
< │ │ │ │ -000f5d50: 3c73 7061 6e20 636c 6173 733d 226b 6579 elemen │ │ │ │ -000f5d70: 743c 2f73 7061 6e3e 203c 7370 616e 2063 t n │ │ │ │ -000f5d90: 616d 653c 2f73 7061 6e3e 3d3c 7370 616e ame="pho │ │ │ │ -000f5dc0: 6e65 2671 756f 743b 3c2f 7370 616e 3e20 ne" │ │ │ │ -000f5dd0: 3c73 7061 6e20 636c 6173 733d 226b 6579 type=&q │ │ │ │ -000f5e10: 756f 743b 7873 643a 7374 7269 6e67 2671 uot;xsd:string&q │ │ │ │ -000f5e20: 756f 743b 3c2f 7370 616e 3e20 3c73 7061 uot; minOccurs=& │ │ │ │ -000f5e70: 7175 6f74 3b30 2671 756f 743b 3c2f 7370 quot;0" maxOcc │ │ │ │ -000f5ea0: 7572 733c 2f73 7061 6e3e 3d3c 7370 616e urs="1&q │ │ │ │ -000f5ed0: 756f 743b 3c2f 7370 616e 3e20 3c73 7061 uot; nillable=&q │ │ │ │ -000f5f20: 756f 743b 7472 7565 2671 756f 743b 3c2f uot;true" form │ │ │ │ -000f5f50: 3c2f 7370 616e 3e3d 3c73 7061 6e20 636c ="qualif │ │ │ │ -000f5f80: 6965 6426 7175 6f74 3b3c 2f73 7061 6e3e ied" │ │ │ │ -000f5f90: 2f26 6774 3b20 3c2f 6469 763e 0a3c 6469 />
. │ │ │ │ -000f5fb0: 2020 2026 6c74 3b3c 7370 616e 2063 6c61 <element │ │ │ │ -000f5fe0: 3c73 7061 6e20 636c 6173 733d 226b 6579 ref │ │ │ │ -000f6000: 3d3c 7370 616e 2063 6c61 7373 3d22 7374 =&qu │ │ │ │ -000f6020: 6f74 3b78 3a66 6178 2671 756f 743b 3c2f ot;x:fax" minO │ │ │ │ -000f6050: 6363 7572 733c 2f73 7061 6e3e 3d3c 7370 ccurs="0 │ │ │ │ -000f6080: 2671 756f 743b 3c2f 7370 616e 3e20 3c73 " maxOccurs="1"/>
.
<element ref="y:zip&qu │ │ │ │ -000f6180: 6f74 3b3c 2f73 7061 6e3e 203c 7370 616e ot; minOccurs=&q │ │ │ │ -000f61d0: 756f 743b 3026 7175 6f74 3b3c 2f73 7061 uot;0" maxOccu │ │ │ │ -000f6200: 7273 3c2f 7370 616e 3e3d 3c73 7061 6e20 rs="1&qu │ │ │ │ -000f6230: 6f74 3b3c 2f73 7061 6e3e 2f26 6774 3b20 ot;/> │ │ │ │ -000f6240: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
</ │ │ │ │ -000f6260: 3c73 7061 6e20 636c 6173 733d 226b 6579 sequen │ │ │ │ -000f6280: 6365 3c2f 7370 616e 3e26 6774 3b20 3c2f ce> .
</complexTyp │ │ │ │ -000f62d0: 653c 2f73 7061 6e3e 2667 743b 203c 2f64 e> .
<element name="fax" │ │ │ │ -000f6370: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c ty │ │ │ │ -000f6390: 7065 3c2f 7370 616e 3e3d 3c73 7061 6e20 pe="xsd: │ │ │ │ -000f63c0: 7374 7269 6e67 2671 756f 743b 3c2f 7370 string"/>
.< │ │ │ │ -000f63e0: 2f64 6976 3e3c 212d 2d20 6672 6167 6d65 /div>

│ │ │ │ -000f6400: 616e 6420 7468 6520 3c65 6d3e 3c63 6f64 and the y.xsd schema defin │ │ │ │ -000f6430: 6573 2063 6f6e 7461 696e 733a 3c2f 703e es contains:

│ │ │ │ -000f6440: 0a3c 6469 7620 636c 6173 733d 2261 6c74 .
<< │ │ │ │ -000f6480: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -000f6490: 6f72 6474 7970 6522 3e65 6c65 6d65 6e74 ordtype">element │ │ │ │ -000f64a0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c na │ │ │ │ -000f64c0: 6d65 3c2f 7370 616e 3e3d 3c73 7061 6e20 me="zip& │ │ │ │ -000f64f0: 7175 6f74 3b3c 2f73 7061 6e3e 203c 7370 quot; type=< │ │ │ │ -000f6520: 7370 616e 2063 6c61 7373 3d22 7374 7269 span class="stri │ │ │ │ -000f6530: 6e67 6c69 7465 7261 6c22 3e26 7175 6f74 ngliteral">" │ │ │ │ -000f6540: 3b78 7364 3a73 7472 696e 6726 7175 6f74 ;xsd:string" │ │ │ │ -000f6550: 3b3c 2f73 7061 6e3e 2f26 6774 3b3c 2f64 ;/>.

See also C and │ │ │ │ -000f65c0: 432b 2b20 584d 4c20 6461 7461 2062 696e C++ XML data bin │ │ │ │ -000f65d0: 6469 6e67 733c 2f61 3e20 646f 6375 6d65 dings docume │ │ │ │ -000f65e0: 6e74 6174 696f 6e20 666f 7220 6d6f 7265 ntation for more │ │ │ │ -000f65f0: 2064 6574 6169 6c73 2e3c 2f70 3e0a 3c70 details.

.

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

.XML │ │ │ │ -000f6660: 6e61 6d65 7370 6163 6573 2061 6e64 2074 namespaces and t │ │ │ │ -000f6670: 6865 206e 616d 6573 7061 6365 206d 6170 he namespace map │ │ │ │ -000f6680: 7069 6e67 2074 6162 6c65 3c2f 6831 3e0a ping table

. │ │ │ │ -000f6690: 3c70 3e41 206e 616d 6573 7061 6365 206d

A namespace m │ │ │ │ -000f66a0: 6170 7069 6e67 2074 6162 6c65 2073 686f apping table sho │ │ │ │ -000f66b0: 756c 6420 6265 2069 6e63 6c75 6465 6420 uld be included │ │ │ │ -000f66c0: 696e 2074 6865 2073 6f75 7263 6520 636f in the source co │ │ │ │ -000f66d0: 6465 206f 6620 636c 6965 6e74 2061 6e64 de of client and │ │ │ │ -000f66e0: 2073 6572 7669 6365 2061 7070 6c69 6361 service applica │ │ │ │ -000f66f0: 7469 6f6e 732e 2054 6865 206d 6170 7069 tions. The mappi │ │ │ │ -000f6700: 6e67 2074 6162 6c65 2069 7320 7573 6564 ng table is used │ │ │ │ -000f6710: 2062 7920 7468 6520 7365 7269 616c 697a by the serializ │ │ │ │ -000f6720: 6572 7320 616e 6420 6465 7365 7269 616c ers and deserial │ │ │ │ -000f6730: 697a 6572 7320 6f66 2074 6865 2073 7475 izers of the stu │ │ │ │ -000f6740: 6220 616e 6420 736b 656c 6574 6f6e 2066 b and skeleton f │ │ │ │ -000f6750: 756e 6374 696f 6e73 2074 6f20 7072 6f64 unctions to prod │ │ │ │ -000f6760: 7563 6520 7661 6c69 6420 584d 4c20 6d65 uce valid XML me │ │ │ │ -000f6770: 7373 6167 6573 2061 6e64 2074 6f20 7061 ssages and to pa │ │ │ │ -000f6780: 7273 6520 616e 6420 7661 6c69 6461 7465 rse and validate │ │ │ │ -000f6790: 2058 4d4c 206d 6573 7361 6765 732e 2041 XML messages. A │ │ │ │ -000f67a0: 2074 7970 6963 616c 206d 6170 7069 6e67 typical mapping │ │ │ │ -000f67b0: 2074 6162 6c65 2069 7320 7368 6f77 6e20 table is shown │ │ │ │ -000f67c0: 6265 6c6f 773a 3c2f 703e 0a3c 6469 7620 below:

.
struct │ │ │ │ -000f6810: 3c2f 7370 616e 3e3c 6120 636c 6173 733d Namespace namespa │ │ │ │ -000f68b0: 6365 733c 2f61 3e5b 5d20 3d20 3c2f 6469 ces[] = .
{
. │ │ │ │ -000f68f0: 203c 7370 616e 2063 6c61 7373 3d22 636f // { &quo │ │ │ │ -000f6910: 743b 7072 6566 6978 2671 756f 743b 2c20 t;prefix", │ │ │ │ -000f6920: 2671 756f 743b 5552 4926 7175 6f74 3b2c "URI", │ │ │ │ -000f6930: 2026 7175 6f74 3b55 5249 2d70 6174 7465 "URI-patte │ │ │ │ -000f6940: 726e 2671 756f 743b 2028 6f70 7469 6f6e rn" (option │ │ │ │ -000f6950: 616c 2920 7d20 3c2f 7370 616e 3e3c 2f64 al) } .
{ "SOAP │ │ │ │ -000f69a0: 2d45 4e56 2671 756f 743b 3c2f 7370 616e -ENV", & │ │ │ │ -000f69d0: 7175 6f74 3b68 7474 703a 2f2f 7363 6865 quot;http://sche │ │ │ │ -000f69e0: 6d61 732e 786d 6c73 6f61 702e 6f72 672f mas.xmlsoap.org/ │ │ │ │ -000f69f0: 736f 6170 2f65 6e76 656c 6f70 652f 2671 soap/envelope/&q │ │ │ │ -000f6a00: 756f 743b 3c2f 7370 616e 3e20 7d2c 203c uot; }, < │ │ │ │ -000f6a10: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ -000f6a20: 656e 7422 3e2f 2f20 6d75 7374 2062 6520 ent">// must be │ │ │ │ -000f6a30: 6669 7273 7420 3c2f 7370 616e 3e3c 2f64 first .
{ "SOAP │ │ │ │ -000f6a80: 2d45 4e43 2671 756f 743b 3c2f 7370 616e -ENC", & │ │ │ │ -000f6ab0: 7175 6f74 3b68 7474 703a 2f2f 7363 6865 quot;http://sche │ │ │ │ -000f6ac0: 6d61 732e 786d 6c73 6f61 702e 6f72 672f mas.xmlsoap.org/ │ │ │ │ -000f6ad0: 736f 6170 2f65 6e63 6f64 696e 672f 2671 soap/encoding/&q │ │ │ │ -000f6ae0: 756f 743b 3c2f 7370 616e 3e20 7d2c 203c uot; }, < │ │ │ │ -000f6af0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ -000f6b00: 656e 7422 3e2f 2f20 6d75 7374 2062 6520 ent">// must be │ │ │ │ -000f6b10: 7365 636f 6e64 203c 2f73 7061 6e3e 3c2f second .
{ "xsi │ │ │ │ -000f6b60: 2671 756f 743b 3c2f 7370 616e 3e2c 2020 ", │ │ │ │ -000f6b70: 2020 2020 3c73 7061 6e20 636c 6173 733d │ │ │ │ -000f6b90: 2671 756f 743b 6874 7470 3a2f 2f77 7777 "http://www │ │ │ │ -000f6ba0: 2e77 332e 6f72 672f 3230 3031 2f58 4d4c .w3.org/2001/XML │ │ │ │ -000f6bb0: 5363 6865 6d61 2d69 6e73 7461 6e63 6526 Schema-instance& │ │ │ │ -000f6bc0: 7175 6f74 3b3c 2f73 7061 6e3e 207d 2c20 quot; }, │ │ │ │ -000f6bd0: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // must be │ │ │ │ -000f6bf0: 2074 6869 7264 203c 2f73 7061 6e3e 3c2f third .
{ "xsd │ │ │ │ -000f6c40: 2671 756f 743b 3c2f 7370 616e 3e2c 2020 ", │ │ │ │ -000f6c50: 2020 2020 3c73 7061 6e20 636c 6173 733d │ │ │ │ -000f6c70: 2671 756f 743b 6874 7470 3a2f 2f77 7777 "http://www │ │ │ │ -000f6c80: 2e77 332e 6f72 672f 3230 3031 2f58 4d4c .w3.org/2001/XML │ │ │ │ -000f6c90: 5363 6865 6d61 2671 756f 743b 3c2f 7370 Schema" }, │ │ │ │ -000f6cb0: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // must be │ │ │ │ -000f6cd0: 2066 6f75 7274 683c 2f73 7061 6e3e 3c2f fourth.
{ "ns& │ │ │ │ -000f6d20: 7175 6f74 3b3c 2f73 7061 6e3e 2c20 2020 quot;, │ │ │ │ -000f6d30: 2020 2020 3c73 7061 6e20 636c 6173 733d │ │ │ │ -000f6d50: 2671 756f 743b 7572 6e3a 6d79 2d73 6572 "urn:my-ser │ │ │ │ -000f6d60: 7669 6365 2d55 5249 2671 756f 743b 3c2f vice-URI" }, / │ │ │ │ -000f6d90: 2f20 6269 6e64 7320 2671 756f 743b 6e73 / binds "ns │ │ │ │ -000f6da0: 2671 756f 743b 206e 616d 6573 7061 6365 " namespace │ │ │ │ -000f6db0: 2070 7265 6669 7820 746f 2073 6368 656d prefix to schem │ │ │ │ -000f6dc0: 6120 5552 493c 2f73 7061 6e3e 3c2f 6469 a URI.
{ NULL, N │ │ │ │ -000f6df0: 554c 4c20 7d20 3c73 7061 6e20 636c 6173 ULL } // e │ │ │ │ -000f6e10: 6e64 206f 6620 7461 626c 6520 3c2f 7370 nd of table
.
}; < │ │ │ │ -000f6e40: 2f64 6976 3e0a 3c2f 6469 763e 3c21 2d2d /div>.

│ │ │ │ -000f6e60: 4561 6368 206e 616d 6573 7061 6365 2070 Each namespace p │ │ │ │ -000f6e70: 7265 6669 7820 7573 6564 2062 7920 6120 refix used by a │ │ │ │ -000f6e80: 6964 656e 7469 6669 6572 206e 616d 6520 identifier name │ │ │ │ -000f6e90: 696e 2074 6865 2068 6561 6465 7220 6669 in the header fi │ │ │ │ -000f6ea0: 6c65 2073 7065 6369 6669 6361 7469 6f6e le specification │ │ │ │ -000f6eb0: 2c20 7365 6520 5365 6374 696f 6e20 3c61 , see Section C/C++ iden │ │ │ │ -000f6ef0: 7469 6669 6572 206e 616d 6520 746f 2058 tifier name to X │ │ │ │ -000f6f00: 4d4c 2074 6167 206e 616d 6520 7472 616e ML tag name tran │ │ │ │ -000f6f10: 736c 6174 696f 6e3c 2f61 3e2c 206d 7573 slation, mus │ │ │ │ -000f6f20: 7420 6861 7665 2061 2062 696e 6469 6e67 t have a binding │ │ │ │ -000f6f30: 2074 6f20 6120 6e61 6d65 7370 6163 6520 to a namespace │ │ │ │ -000f6f40: 5552 4920 696e 2074 6865 206d 6170 7069 URI in the mappi │ │ │ │ -000f6f50: 6e67 2074 6162 6c65 2e20 5468 6520 656e ng table. The en │ │ │ │ -000f6f60: 6420 6f66 2074 6865 206e 616d 6573 7061 d of the namespa │ │ │ │ -000f6f70: 6365 206d 6170 7069 6e67 2074 6162 6c65 ce mapping table │ │ │ │ -000f6f80: 206d 7573 7420 6265 2069 6e64 6963 6174 must be indicat │ │ │ │ -000f6f90: 6564 2062 7920 7468 6520 4e55 4c4c 2070 ed by the NULL p │ │ │ │ -000f6fa0: 6169 722e 2054 6865 206e 616d 6573 7061 air. The namespa │ │ │ │ -000f6fb0: 6365 2055 5249 206d 6174 6368 696e 6720 ce URI matching │ │ │ │ -000f6fc0: 6973 2063 6173 6520 696e 7365 6e73 6974 is case insensit │ │ │ │ -000f6fd0: 6976 652e 2041 206e 616d 6573 7061 6365 ive. A namespace │ │ │ │ -000f6fe0: 2070 7265 6669 7820 6973 2064 6973 7469 prefix is disti │ │ │ │ -000f6ff0: 6e67 7569 7368 6564 2062 7920 7468 6520 nguished by the │ │ │ │ -000f7000: 6f63 6375 7272 656e 6365 206f 6620 6120 occurrence of a │ │ │ │ -000f7010: 7061 6972 206f 6620 756e 6465 7273 636f pair of undersco │ │ │ │ -000f7020: 7265 7320 283c 636f 6465 3e5f 5f3c 2f63 res (__) in an iden │ │ │ │ -000f7040: 7469 6669 6572 206f 7220 6279 2075 7369 tifier or by usi │ │ │ │ -000f7050: 6e67 2063 6f6c 6f6e 206e 6f74 6174 696f ng colon notatio │ │ │ │ -000f7060: 6e2c 2073 6565 2053 6563 7469 6f6e 203c n, see Section < │ │ │ │ -000f7070: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ -000f7080: 663d 2269 6e64 6578 2e68 746d 6c23 6964 f="index.html#id │ │ │ │ -000f7090: 7472 616e 7322 3e43 2f43 2b2b 2069 6465 trans">C/C++ ide │ │ │ │ -000f70a0: 6e74 6966 6965 7220 6e61 6d65 2074 6f20 ntifier name to │ │ │ │ -000f70b0: 584d 4c20 7461 6720 6e61 6d65 2074 7261 XML tag name tra │ │ │ │ -000f70c0: 6e73 6c61 7469 6f6e 3c2f 613e 2e3c 2f70 nslation.

.

An optional │ │ │ │ -000f70e0: 2074 6869 7264 2063 6f6c 756d 6e20 696e third column in │ │ │ │ -000f70f0: 2074 6865 206e 616d 6573 7061 6365 206d the namespace m │ │ │ │ -000f7100: 6170 7069 6e67 2074 6162 6c65 206d 6179 apping table may │ │ │ │ -000f7110: 2062 6520 7370 6563 6966 6965 6420 7468 be specified th │ │ │ │ -000f7120: 6174 2063 6f6e 7461 696e 7320 6120 6e61 at contains a na │ │ │ │ -000f7130: 6d65 7370 6163 6520 5552 4920 7061 7474 mespace URI patt │ │ │ │ -000f7140: 6572 6e2e 2054 6865 2070 6174 7465 726e ern. The pattern │ │ │ │ -000f7150: 7320 7072 6f76 6964 6520 616e 2061 6c74 s provide an alt │ │ │ │ -000f7160: 6572 6e61 7469 7665 206e 616d 6573 7061 ernative namespa │ │ │ │ -000f7170: 6365 2066 6f72 2074 6865 2076 616c 6964 ce for the valid │ │ │ │ -000f7180: 6174 696f 6e20 6f66 2070 6172 7365 6420 ation of parsed │ │ │ │ -000f7190: 584d 4c20 6d65 7373 6167 6573 2e20 496e XML messages. In │ │ │ │ -000f71a0: 2074 6869 7320 7061 7474 6572 6e2c 2064 this pattern, d │ │ │ │ -000f71b0: 6173 6865 7320 283c 636f 6465 3e2d 3c2f ashes (-) are singl │ │ │ │ -000f71d0: 652d 6368 6172 6163 7465 7220 7769 6c64 e-character wild │ │ │ │ -000f71e0: 6361 7264 7320 616e 6420 6173 7465 7269 cards and asteri │ │ │ │ -000f71f0: 736b 7320 283c 636f 6465 3e2a 3c2f 636f sks (*) are multi-c │ │ │ │ -000f7210: 6861 7261 6374 6572 2077 696c 6463 6172 haracter wildcar │ │ │ │ -000f7220: 6473 2e20 466f 7220 6578 616d 706c 652c ds. For example, │ │ │ │ -000f7230: 2074 6f20 6163 6365 7074 2061 6c74 6572 to accept alter │ │ │ │ -000f7240: 6e61 7469 7665 2076 6572 7369 6f6e 7320 native versions │ │ │ │ -000f7250: 6f66 2058 4d4c 2073 6368 656d 6173 2077 of XML schemas w │ │ │ │ -000f7260: 6974 6820 6469 6666 6572 656e 7420 6175 ith different au │ │ │ │ -000f7270: 7468 6f72 696e 6720 6461 7465 732c 2066 thoring dates, f │ │ │ │ -000f7280: 6f75 7220 6461 7368 6573 2063 616e 2062 our dashes can b │ │ │ │ -000f7290: 6520 7573 6564 2069 6e20 706c 6163 6520 e used in place │ │ │ │ -000f72a0: 6f66 2074 6865 2073 7065 6369 6669 6320 of the specific │ │ │ │ -000f72b0: 6461 7465 7320 696e 2074 6865 206e 616d dates in the nam │ │ │ │ -000f72c0: 6573 7061 6365 206d 6170 7069 6e67 2074 espace mapping t │ │ │ │ -000f72d0: 6162 6c65 2070 6174 7465 726e 3a3c 2f70 able pattern:

.
│ │ │ │ -000f7320: 7374 7275 6374 203c 2f73 7061 6e3e 3c61 struct Names │ │ │ │ -000f7360: 7061 6365 3c2f 613e 203c 6120 636c 6173 pace │ │ │ │ -000f73c0: 6e61 6d65 7370 6163 6573 3c2f 613e 5b5d namespaces[] │ │ │ │ -000f73d0: 203d 203c 2f64 6976 3e0a 3c64 6976 2063 =
.
{.
// │ │ │ │ -000f7420: 207b 2026 7175 6f74 3b70 7265 6669 7826 { "prefix& │ │ │ │ -000f7430: 7175 6f74 3b2c 2026 7175 6f74 3b55 5249 quot;, "URI │ │ │ │ -000f7440: 2671 756f 743b 2c20 2671 756f 743b 5552 ", "UR │ │ │ │ -000f7450: 492d 7061 7474 6572 6e26 7175 6f74 3b20 I-pattern" │ │ │ │ -000f7460: 286f 7074 696f 6e61 6c29 207d 203c 2f73 (optional) }
.
{ │ │ │ │ -000f7490: 203c 7370 616e 2063 6c61 7373 3d22 7374 &qu │ │ │ │ -000f74b0: 6f74 3b53 4f41 502d 454e 5626 7175 6f74 ot;SOAP-ENV" │ │ │ │ -000f74c0: 3b3c 2f73 7061 6e3e 2c20 3c73 7061 6e20 ;, "http │ │ │ │ -000f74f0: 3a2f 2f73 6368 656d 6173 2e78 6d6c 736f ://schemas.xmlso │ │ │ │ -000f7500: 6170 2e6f 7267 2f73 6f61 702f 656e 7665 ap.org/soap/enve │ │ │ │ -000f7510: 6c6f 7065 2f26 7175 6f74 3b3c 2f73 7061 lope/" }, // m │ │ │ │ -000f7540: 7573 7420 6265 2066 6972 7374 203c 2f73 ust be first
.
{ │ │ │ │ -000f7570: 203c 7370 616e 2063 6c61 7373 3d22 7374 &qu │ │ │ │ -000f7590: 6f74 3b53 4f41 502d 454e 4326 7175 6f74 ot;SOAP-ENC" │ │ │ │ -000f75a0: 3b3c 2f73 7061 6e3e 2c20 3c73 7061 6e20 ;, "http │ │ │ │ -000f75d0: 3a2f 2f73 6368 656d 6173 2e78 6d6c 736f ://schemas.xmlso │ │ │ │ -000f75e0: 6170 2e6f 7267 2f73 6f61 702f 656e 636f ap.org/soap/enco │ │ │ │ -000f75f0: 6469 6e67 2f26 7175 6f74 3b3c 2f73 7061 ding/" }, // m │ │ │ │ -000f7620: 7573 7420 6265 2073 6563 6f6e 6420 3c2f ust be second
.
│ │ │ │ -000f7650: 7b20 3c73 7061 6e20 636c 6173 733d 2273 { &q │ │ │ │ -000f7670: 756f 743b 7873 6926 7175 6f74 3b3c 2f73 uot;xsi", "htt │ │ │ │ -000f76b0: 703a 2f2f 7777 772e 7733 2e6f 7267 2f32 p://www.w3.org/2 │ │ │ │ -000f76c0: 3030 312f 584d 4c53 6368 656d 612d 696e 001/XMLSchema-in │ │ │ │ -000f76d0: 7374 616e 6365 2671 756f 743b 3c2f 7370 stance", "http://ww │ │ │ │ -000f7710: 772e 7733 2e6f 7267 2f2d 2d2d 2d2f 584d w.w3.org/----/XM │ │ │ │ -000f7720: 4c53 6368 656d 612d 696e 7374 616e 6365 LSchema-instance │ │ │ │ -000f7730: 2671 756f 743b 3c2f 7370 616e 3e20 7d2c " }, │ │ │ │ -000f7740: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
{ " │ │ │ │ -000f7780: 7873 6426 7175 6f74 3b3c 2f73 7061 6e3e xsd" │ │ │ │ -000f7790: 2c20 2020 2020 203c 7370 616e 2063 6c61 , "http:// │ │ │ │ -000f77c0: 7777 772e 7733 2e6f 7267 2f32 3030 312f www.w3.org/2001/ │ │ │ │ -000f77d0: 584d 4c53 6368 656d 6126 7175 6f74 3b3c XMLSchema"< │ │ │ │ -000f77e0: 2f73 7061 6e3e 2c20 3c73 7061 6e20 636c /span>, "http:/ │ │ │ │ -000f7810: 2f77 7777 2e77 332e 6f72 672f 2d2d 2d2d /www.w3.org/---- │ │ │ │ -000f7820: 2f58 4d4c 5363 6865 6d61 2671 756f 743b /XMLSchema" │ │ │ │ -000f7830: 3c2f 7370 616e 3e20 7d2c 203c 2f64 6976 },
.
... │ │ │ │ -000f7870: 2f2f 3c2f 7370 616e 3e3c 2f64 6976 3e0a //
. │ │ │ │ -000f7880: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
{ NULL, NULL │ │ │ │ -000f78a0: 207d 203c 7370 616e 2063 6c61 7373 3d22 } // end │ │ │ │ -000f78c0: 6f66 2074 6162 6c65 203c 2f73 7061 6e3e of table │ │ │ │ -000f78d0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
};
.

Or a │ │ │ │ -000f7910: 6c74 6572 6e61 7469 7665 6c79 2c20 6173 lternatively, as │ │ │ │ -000f7920: 7465 7269 736b 7320 6361 6e20 6265 2075 terisks can be u │ │ │ │ -000f7930: 7365 6420 6173 2077 696c 6463 6172 6473 sed as wildcards │ │ │ │ -000f7940: 2066 6f72 206d 756c 7469 706c 6520 6368 for multiple ch │ │ │ │ -000f7950: 6172 6163 7465 7273 3a3c 2f70 3e0a 3c64 aracters:

.
stru │ │ │ │ -000f79a0: 6374 203c 2f73 7061 6e3e 3c61 2063 6c61 ct Namespace │ │ │ │ -000f79e0: 3c2f 613e 203c 6120 636c 6173 733d 2263 name │ │ │ │ -000f7a40: 7370 6163 6573 3c2f 613e 5b5d 203d 203c spaces[] = < │ │ │ │ -000f7a50: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
{
. │ │ │ │ -000f7a70: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
// { & │ │ │ │ -000f7aa0: 7175 6f74 3b70 7265 6669 7826 7175 6f74 quot;prefix" │ │ │ │ -000f7ab0: 3b2c 2026 7175 6f74 3b55 5249 2671 756f ;, "URI&quo │ │ │ │ -000f7ac0: 743b 2c20 2671 756f 743b 5552 492d 7061 t;, "URI-pa │ │ │ │ -000f7ad0: 7474 6572 6e26 7175 6f74 3b20 286f 7074 ttern" (opt │ │ │ │ -000f7ae0: 696f 6e61 6c29 207d 203c 2f73 7061 6e3e ional) } │ │ │ │ -000f7af0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
{ "S │ │ │ │ -000f7b30: 4f41 502d 454e 5626 7175 6f74 3b3c 2f73 OAP-ENV", "http://s │ │ │ │ -000f7b70: 6368 656d 6173 2e78 6d6c 736f 6170 2e6f chemas.xmlsoap.o │ │ │ │ -000f7b80: 7267 2f73 6f61 702f 656e 7665 6c6f 7065 rg/soap/envelope │ │ │ │ -000f7b90: 2f26 7175 6f74 3b3c 2f73 7061 6e3e 207d /" } │ │ │ │ -000f7ba0: 2c20 3c73 7061 6e20 636c 6173 733d 2263 , // must │ │ │ │ -000f7bc0: 6265 2066 6972 7374 203c 2f73 7061 6e3e be first │ │ │ │ -000f7bd0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
{ "S │ │ │ │ -000f7c10: 4f41 502d 454e 4326 7175 6f74 3b3c 2f73 OAP-ENC", "http://s │ │ │ │ -000f7c50: 6368 656d 6173 2e78 6d6c 736f 6170 2e6f chemas.xmlsoap.o │ │ │ │ -000f7c60: 7267 2f73 6f61 702f 656e 636f 6469 6e67 rg/soap/encoding │ │ │ │ -000f7c70: 2f26 7175 6f74 3b3c 2f73 7061 6e3e 207d /" } │ │ │ │ -000f7c80: 2c20 3c73 7061 6e20 636c 6173 733d 2263 , // must │ │ │ │ -000f7ca0: 6265 2073 6563 6f6e 6420 3c2f 7370 616e be second
.
{ " │ │ │ │ -000f7cf0: 7873 6926 7175 6f74 3b3c 2f73 7061 6e3e xsi" │ │ │ │ -000f7d00: 2c20 2020 2020 203c 7370 616e 2063 6c61 , "http:// │ │ │ │ -000f7d30: 7777 772e 7733 2e6f 7267 2f32 3030 312f www.w3.org/2001/ │ │ │ │ -000f7d40: 584d 4c53 6368 656d 612d 696e 7374 616e XMLSchema-instan │ │ │ │ -000f7d50: 6365 2671 756f 743b 3c2f 7370 616e 3e2c ce", │ │ │ │ -000f7d60: 203c 7370 616e 2063 6c61 7373 3d22 7374 &qu │ │ │ │ -000f7d80: 6f74 3b68 7474 703a 2f2f 7777 772e 7733 ot;http://www.w3 │ │ │ │ -000f7d90: 2e6f 7267 2f2a 2f58 4d4c 5363 6865 6d61 .org/*/XMLSchema │ │ │ │ -000f7da0: 2d69 6e73 7461 6e63 6526 7175 6f74 3b3c -instance"< │ │ │ │ -000f7db0: 2f73 7061 6e3e 207d 2c20 3c2f 6469 763e /span> },
│ │ │ │ -000f7dc0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
{ "xsd&quo │ │ │ │ -000f7e00: 743b 3c2f 7370 616e 3e2c 2020 2020 2020 t;, │ │ │ │ -000f7e10: 3c73 7061 6e20 636c 6173 733d 2273 7472 &quo │ │ │ │ -000f7e30: 743b 6874 7470 3a2f 2f77 7777 2e77 332e t;http://www.w3. │ │ │ │ -000f7e40: 6f72 672f 3230 3031 2f58 4d4c 5363 6865 org/2001/XMLSche │ │ │ │ -000f7e50: 6d61 2671 756f 743b 3c2f 7370 616e 3e2c ma", │ │ │ │ -000f7e60: 2020 2020 2020 2020 2020 3c73 7061 6e20 "http │ │ │ │ -000f7e90: 3a2f 2f77 7777 2e77 332e 6f72 672f 2a2f ://www.w3.org/*/ │ │ │ │ -000f7ea0: 584d 4c53 6368 656d 6126 7175 6f74 3b3c XMLSchema"< │ │ │ │ -000f7eb0: 2f73 7061 6e3e 207d 2c20 3c2f 6469 763e /span> },
│ │ │ │ -000f7ec0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
... / │ │ │ │ -000f7ef0: 2f3c 2f73 7061 6e3e 3c2f 6469 763e 0a3c /
.< │ │ │ │ -000f7f00: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -000f7f10: 3e20 207b 204e 554c 4c2c 204e 554c 4c7d > { NULL, NULL} │ │ │ │ -000f7f20: 203c 7370 616e 2063 6c61 7373 3d22 636f // end of │ │ │ │ -000f7f40: 2074 6162 6c65 203c 2f73 7061 6e3e 3c2f table .
};
. │ │ │ │ -000f7f70: 3c2f 6469 763e 3c21 2d2d 2066 7261 676d

A name │ │ │ │ -000f7f90: 7370 6163 6520 6d61 7070 696e 6720 7461 space mapping ta │ │ │ │ -000f7fa0: 626c 6520 6973 2061 7574 6f6d 6174 6963 ble is automatic │ │ │ │ -000f7fb0: 616c 6c79 2067 656e 6572 6174 6564 2077 ally generated w │ │ │ │ -000f7fc0: 6974 6820 7072 6566 6978 6573 2061 6e64 ith prefixes and │ │ │ │ -000f7fd0: 2055 5249 7320 696e 2074 6865 2074 6162 URIs in the tab │ │ │ │ -000f7fe0: 6c65 2074 6861 7420 6172 6520 6465 636c le that are decl │ │ │ │ -000f7ff0: 6172 6564 2077 6974 6820 3c63 6f64 653e ared with │ │ │ │ -000f8000: 2f2f 6773 6f61 7020 266c 743b 7072 6566 //gsoap <pref │ │ │ │ -000f8010: 6978 2667 743b 2073 6368 656d 6120 6e61 ix> schema na │ │ │ │ -000f8020: 6d65 7370 6163 653a 3c2f 636f 6465 3e20 mespace: │ │ │ │ -000f8030: 6469 7265 6374 6976 6573 2069 6e20 7468 directives in th │ │ │ │ -000f8040: 6520 696e 7465 7266 6163 6520 6865 6164 e interface head │ │ │ │ -000f8050: 6572 2066 696c 652c 2073 6565 2053 6563 er file, see Sec │ │ │ │ -000f8060: 7469 6f6e 203c 6120 636c 6173 733d 2265 tion │ │ │ │ -000f8090: 4469 7265 6374 6976 6573 3c2f 613e 2e20 Directives. │ │ │ │ -000f80a0: 4966 2064 6972 6563 7469 7665 7320 6172 If directives ar │ │ │ │ -000f80b0: 6520 6e6f 7420 7072 6f76 6964 6564 2069 e not provided i │ │ │ │ -000f80c0: 6e20 7468 6520 6865 6164 6572 2066 696c n the header fil │ │ │ │ -000f80d0: 6520 7468 656e 2064 6566 6175 6c74 2055 e then default U │ │ │ │ -000f80e0: 5249 7320 6f66 2074 6865 2066 6f72 6d20 RIs of the form │ │ │ │ -000f80f0: 3c65 6d3e 3c63 6f64 653e 3c61 2068 7265 http://tempuri │ │ │ │ -000f8130: 2e6f 7267 2f70 7265 6669 782e 7873 643c .org/prefix.xsd< │ │ │ │ -000f8140: 2f61 3e3c 2f63 6f64 653e 3c2f 656d 3e20 /a> │ │ │ │ -000f8150: 666f 7220 6561 6368 206e 616d 6573 7061 for each namespa │ │ │ │ -000f8160: 6365 203c 656d 3e3c 636f 6465 3e70 7265 ce pre │ │ │ │ -000f8170: 6669 783c 2f63 6f64 653e 3c2f 656d 3e2e fix. │ │ │ │ -000f8180: 2054 6865 2073 6f61 7063 7070 3220 746f The soapcpp2 to │ │ │ │ -000f8190: 6f6c 2061 6c73 6f20 6765 6e65 7261 7465 ol also generate │ │ │ │ -000f81a0: 7320 6120 5753 444c 2061 6e64 206f 6e65 s a WSDL and one │ │ │ │ -000f81b0: 206f 7220 6d6f 7265 2058 5344 2066 696c or more XSD fil │ │ │ │ -000f81c0: 6573 2c20 6f6e 6520 666f 7220 6561 6368 es, one for each │ │ │ │ -000f81d0: 2058 4d4c 206e 616d 6573 7061 6365 2e3c XML namespace.< │ │ │ │ -000f81e0: 2f70 3e0a 3c70 3e57 6865 6e20 7061 7273 /p>.

When pars │ │ │ │ -000f81f0: 696e 6720 584d 4c20 616e 6420 6465 7365 ing XML and dese │ │ │ │ -000f8200: 7269 616c 697a 696e 6720 6461 7461 2c20 rializing data, │ │ │ │ -000f8210: 6e61 6d65 7370 6163 6520 5552 4973 2069 namespace URIs i │ │ │ │ -000f8220: 6e20 7468 6520 584d 4c20 6d65 7373 6167 n the XML messag │ │ │ │ -000f8230: 6573 2061 7265 206d 6174 6368 6564 2061 es are matched a │ │ │ │ -000f8240: 6761 696e 7374 2074 6865 2073 6563 6f6e gainst the secon │ │ │ │ -000f8250: 6420 616e 6420 7468 6972 6420 636f 6c75 d and third colu │ │ │ │ -000f8260: 6d6e 206f 6620 7468 6520 6e61 6d65 7370 mn of the namesp │ │ │ │ -000f8270: 6163 6520 6d61 7070 696e 6720 7461 626c ace mapping tabl │ │ │ │ -000f8280: 652c 2073 6561 7263 6869 6e67 2066 726f e, searching fro │ │ │ │ -000f8290: 6d20 7468 6520 746f 7020 746f 2074 6865 m the top to the │ │ │ │ -000f82a0: 2062 6f74 746f 6d20 6f66 2074 6865 2074 bottom of the t │ │ │ │ -000f82b0: 6162 6c65 2e20 5468 6520 6163 7475 616c able. The actual │ │ │ │ -000f82c0: 2070 7265 6669 7820 7573 6564 2069 6e20 prefix used in │ │ │ │ -000f82d0: 7468 6520 584d 4c20 6d65 7373 6167 6520 the XML message │ │ │ │ -000f82e0: 6973 2069 7272 656c 6576 616e 7420 6173 is irrelevant as │ │ │ │ -000f82f0: 2074 6865 2055 5249 2061 7373 6f63 6961 the URI associa │ │ │ │ -000f8300: 7465 6420 7769 7468 2074 6865 2070 7265 ted with the pre │ │ │ │ -000f8310: 6669 7820 6973 2072 656c 6576 616e 7420 fix is relevant │ │ │ │ -000f8320: 746f 2064 6566 696e 6520 7468 6520 584d to define the XM │ │ │ │ -000f8330: 4c20 6e61 6d65 7370 6163 6520 746f 2077 L namespace to w │ │ │ │ -000f8340: 6869 6368 2061 2071 7561 6c69 6669 6564 hich a qualified │ │ │ │ -000f8350: 2065 6c65 6d65 6e74 206f 7220 6174 7472 element or attr │ │ │ │ -000f8360: 6962 7574 6520 6265 6c6f 6e67 732e 2057 ibute belongs. W │ │ │ │ -000f8370: 6865 6e20 6120 6d61 7463 6820 6973 2066 hen a match is f │ │ │ │ -000f8380: 6f75 6e64 2c20 7468 6520 6e61 6d65 7370 ound, the namesp │ │ │ │ -000f8390: 6163 6520 7072 6566 6978 2069 6e20 7468 ace prefix in th │ │ │ │ -000f83a0: 6520 6669 7273 7420 636f 6c75 6d6e 206f e first column o │ │ │ │ -000f83b0: 6620 7468 6520 7461 626c 6520 6973 2063 f the table is c │ │ │ │ -000f83c0: 6f6e 7369 6465 7265 6420 7365 6d61 6e74 onsidered semant │ │ │ │ -000f83d0: 6963 616c 6c79 2069 6465 6e74 6963 616c ically identical │ │ │ │ -000f83e0: 2074 6f20 7468 6520 6e61 6d65 7370 6163 to the namespac │ │ │ │ -000f83f0: 6520 7072 6566 6978 2075 7365 6420 6279 e prefix used by │ │ │ │ -000f8400: 2074 6865 2071 7561 6c69 6669 6564 2058 the qualified X │ │ │ │ -000f8410: 4d4c 2065 6c65 6d65 6e74 2061 6e64 2061 ML element and a │ │ │ │ -000f8420: 7474 7269 6275 7465 2070 6172 7365 642c ttribute parsed, │ │ │ │ -000f8430: 2065 7665 6e20 7768 656e 2074 6865 2070 even when the p │ │ │ │ -000f8440: 7265 6669 7820 6e61 6d65 7320 6469 6666 refix names diff │ │ │ │ -000f8450: 6572 2e20 5468 6973 206e 6f72 6d61 6c69 er. This normali │ │ │ │ -000f8460: 7a61 7469 6f6e 206f 6620 7072 6566 6978 zation of prefix │ │ │ │ -000f8470: 6573 2069 7320 696e 7669 7369 626c 6520 es is invisible │ │ │ │ -000f8480: 746f 2074 6865 2075 7365 7220 6f66 2067 to the user of g │ │ │ │ -000f8490: 534f 4150 2061 6e64 206d 616b 6573 2063 SOAP and makes c │ │ │ │ -000f84a0: 6f64 696e 6720 7769 7468 2058 4d4c 2065 oding with XML e │ │ │ │ -000f84b0: 6173 6965 722e 2046 6f72 2065 7861 6d70 asier. For examp │ │ │ │ -000f84c0: 6c65 2c20 7768 656e 2058 5344 2051 4e61 le, when XSD QNa │ │ │ │ -000f84d0: 6d65 7320 6172 6520 7061 7273 6564 2069 mes are parsed i │ │ │ │ -000f84e0: 6e74 6f20 7374 7269 6e67 7320 7573 696e nto strings usin │ │ │ │ -000f84f0: 6720 7468 6520 6275 696c 742d 696e 2073 g the built-in s │ │ │ │ -000f8500: 6f61 7063 7070 3220 3c63 6f64 653e 5f51 oapcpp2 _Q │ │ │ │ -000f8510: 4e61 6d65 3c2f 636f 6465 3e20 7479 7065 Name type │ │ │ │ -000f8520: 206f 7220 6120 514e 616d 6520 6465 636c or a QName decl │ │ │ │ -000f8530: 6172 6564 2077 6974 6820 3c63 6f64 653e ared with │ │ │ │ -000f8540: 7479 7065 6465 6620 7374 643a 3a73 7472 typedef std::str │ │ │ │ -000f8550: 696e 6720 7873 645f 5f51 4e61 6d65 3c2f ing xsd__QName, then this │ │ │ │ -000f8570: 2051 4e61 6d65 2073 7472 696e 6720 7769 QName string wi │ │ │ │ -000f8580: 6c6c 2061 6c77 6179 7320 636f 6e74 6169 ll always contai │ │ │ │ -000f8590: 6e20 7175 616c 6966 6965 6420 6e61 6d65 n qualified name │ │ │ │ -000f85a0: 7320 7769 7468 206e 6f72 6d61 6c69 7a65 s with normalize │ │ │ │ -000f85b0: 6420 7072 6566 6978 6573 2c20 692e 652e d prefixes, i.e. │ │ │ │ -000f85c0: 2070 7265 6669 7865 7320 6465 6669 6e65 prefixes define │ │ │ │ -000f85d0: 6420 696e 2074 6865 206e 616d 6573 7061 d in the namespa │ │ │ │ -000f85e0: 6365 206d 6170 7069 6e67 2074 6162 6c65 ce mapping table │ │ │ │ -000f85f0: 2c20 756e 6c65 7373 2074 6865 2074 6162 , unless the tab │ │ │ │ -000f8600: 6c65 2068 6173 206e 6f20 656e 7472 792c le has no entry, │ │ │ │ -000f8610: 2073 6565 2053 6563 7469 6f6e 203c 6120 see Section How to use QN │ │ │ │ -000f8650: 616d 6520 6174 7472 6962 7574 6573 2061 ame attributes a │ │ │ │ -000f8660: 6e64 2065 6c65 6d65 6e74 733c 2f61 3e2e nd elements. │ │ │ │ -000f8670: 3c2f 703e 0a3c 703e 466f 7220 6578 616d

.

For exam │ │ │ │ -000f8680: 706c 652c 206c 6574 2773 2073 6179 2077 ple, let's say w │ │ │ │ -000f8690: 6520 6861 7665 2074 6865 2066 6f6c 6c6f e have the follo │ │ │ │ -000f86a0: 7769 6e67 2073 7472 7563 7473 3a3c 2f70 wing structs:

.
│ │ │ │ -000f86f0: 7374 7275 6374 203c 2f73 7061 6e3e 615f struct a_ │ │ │ │ -000f8700: 5f65 6c74 207b 202e 2e2e 207d 3b20 3c2f _elt { ... }; .
str │ │ │ │ -000f8740: 7563 7420 3c2f 7370 616e 3e62 5f5f 656c uct b__el │ │ │ │ -000f8750: 7420 7b20 2e2e 2e20 7d3b 203c 2f64 6976 t { ... };
.
struct │ │ │ │ -000f8790: 203c 2f73 7061 6e3e 6b5f 5f65 6c74 207b k__elt { │ │ │ │ -000f87a0: 202e 2e2e 207d 3b20 3c2f 6469 763e 0a3c ... };
.< │ │ │ │ -000f87b0: 2f64 6976 3e3c 212d 2d20 6672 6167 6d65 /div>

The nam │ │ │ │ -000f87d0: 6573 7061 6365 206d 6170 7069 6e67 2074 espace mapping t │ │ │ │ -000f87e0: 6162 6c65 2067 656e 6572 6174 6564 2062 able generated b │ │ │ │ -000f87f0: 7920 736f 6170 6370 7032 2068 6173 2074 y soapcpp2 has t │ │ │ │ -000f8800: 6865 2066 6f6c 6c6f 7769 6e67 2065 6e74 he following ent │ │ │ │ -000f8810: 7269 6573 3a3c 2f70 3e0a 3c64 6976 2063 ries:

.
│ │ │ │ -000f8830: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
struct < │ │ │ │ -000f8860: 2f73 7061 6e3e 3c61 2063 6c61 7373 3d22 /span>Namespace │ │ │ │ -000f88a0: 203c 6120 636c 6173 733d 2263 6f64 6522 namespac │ │ │ │ -000f8900: 6573 3c2f 613e 5b5d 203d 203c 2f64 6976 es[] =
.
{
.
│ │ │ │ -000f8940: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // { " │ │ │ │ -000f8960: 3b70 7265 6669 7826 7175 6f74 3b2c 2026 ;prefix", & │ │ │ │ -000f8970: 7175 6f74 3b55 5249 2671 756f 743b 2c20 quot;URI", │ │ │ │ -000f8980: 2671 756f 743b 5552 492d 7061 7474 6572 "URI-patter │ │ │ │ -000f8990: 6e26 7175 6f74 3b20 286f 7074 696f 6e61 n" (optiona │ │ │ │ -000f89a0: 6c29 207d 203c 2f73 7061 6e3e 3c2f 6469 l) } .
... // the four SOA │ │ │ │ -000f89f0: 5020 616e 6420 5853 4420 6e61 6d65 7370 P and XSD namesp │ │ │ │ -000f8a00: 6163 6520 6269 6e64 696e 6773 3c2f 7370 ace bindings
.
{ │ │ │ │ -000f8a30: 3c73 7061 6e20 636c 6173 733d 2273 7472 &quo │ │ │ │ -000f8a50: 743b 6126 7175 6f74 3b3c 2f73 7061 6e3e t;a" │ │ │ │ -000f8a60: 2c20 3c73 7061 6e20 636c 6173 733d 2273 , &q │ │ │ │ -000f8a80: 756f 743b 6874 7470 3a2f 2f74 656d 7075 uot;http://tempu │ │ │ │ -000f8a90: 7269 2e6f 7267 2f61 2e78 7364 2671 756f ri.org/a.xsd&quo │ │ │ │ -000f8aa0: 743b 3c2f 7370 616e 3e20 7d2c 203c 2f64 t; }, .
{ "b&qu │ │ │ │ -000f8af0: 6f74 3b3c 2f73 7061 6e3e 2c20 3c73 7061 ot;, "ht │ │ │ │ -000f8b20: 7470 3a2f 2f74 656d 7075 7269 2e6f 7267 tp://tempuri.org │ │ │ │ -000f8b30: 2f62 2e78 7364 2671 756f 743b 3c2f 7370 /b.xsd" },
. │ │ │ │ -000f8b60: 2020 7b20 3c73 7061 6e20 636c 6173 733d { │ │ │ │ -000f8b80: 2671 756f 743b 6326 7175 6f74 3b3c 2f73 "c"
, "http://t │ │ │ │ -000f8bc0: 656d 7075 7269 2e6f 7267 2f63 2e78 7364 empuri.org/c.xsd │ │ │ │ -000f8bd0: 2671 756f 743b 3c2f 7370 616e 3e20 7d2c " }, │ │ │ │ -000f8be0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
... │ │ │ │ -000f8c00: 3c73 7061 6e20 636c 6173 733d 2263 6f6d //< │ │ │ │ -000f8c20: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
{ NULL │ │ │ │ -000f8c40: 2c20 4e55 4c4c 207d 3c2f 6469 763e 0a3c , NULL }
.< │ │ │ │ -000f8c50: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -000f8c60: 3e7d 3b3c 2f64 6976 3e0a 3c2f 6469 763e >};
.
│ │ │ │ -000f8c70: 3c21 2d2d 2066 7261 676d 656e 7420 2d2d

Likewis │ │ │ │ -000f9820: 652c 206f 6e20 7468 6520 7365 7276 6572 e, on the server │ │ │ │ -000f9830: 2073 6964 6520 6361 6c6c 203c 636f 6465 side call soap_set_namesp │ │ │ │ -000f9910: 6163 6573 3c2f 613e 3c2f 636f 6465 3e20 aces │ │ │ │ -000f9920: 6265 666f 7265 2063 616c 6c69 6e67 203c before calling < │ │ │ │ -000f9930: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soap_serve. Chang │ │ │ │ -000f99c0: 696e 6720 7468 6520 6e61 6d65 7370 6163 ing the namespac │ │ │ │ -000f99d0: 6573 2074 6162 6c65 2069 6e20 7365 7276 es table in serv │ │ │ │ -000f99e0: 6963 6520 6f70 6572 6174 696f 6e73 2068 ice operations h │ │ │ │ -000f99f0: 6173 206e 6f20 6566 6665 6374 2e3c 2f70 as no effect.

.

The XML mes │ │ │ │ -000f9a10: 7361 6765 7320 7072 6f64 7563 6564 2062 sages produced b │ │ │ │ -000f9a20: 7920 7468 6520 6753 4f41 5020 656e 6769 y the gSOAP engi │ │ │ │ -000f9a30: 6e65 2069 6e63 6c75 6465 2061 6c6c 203c ne include all < │ │ │ │ -000f9a40: 656d 3e3c 636f 6465 3e78 6d6c 736e 3c2f em>xmlsn names │ │ │ │ -000f9a60: 7061 6365 2062 696e 6469 6e67 7320 696e pace bindings in │ │ │ │ -000f9a70: 2074 6865 2072 6f6f 7420 656c 656d 656e the root elemen │ │ │ │ -000f9a80: 742c 2077 6869 6368 2069 7320 6765 6e65 t, which is gene │ │ │ │ -000f9a90: 7261 6c6c 7920 6d6f 7265 2065 6666 6963 rally more effic │ │ │ │ -000f9aa0: 6965 6e74 2066 6f72 206c 6172 6765 7220 ient for larger │ │ │ │ -000f9ab0: 584d 4c20 646f 6375 6d65 6e74 7320 696e XML documents in │ │ │ │ -000f9ac0: 2077 6869 6368 206f 7468 6572 7769 7365 which otherwise │ │ │ │ -000f9ad0: 2074 6865 203c 656d 3e3c 636f 6465 3e78 the x │ │ │ │ -000f9ae0: 6d6c 736e 3c2f 636f 6465 3e3c 2f65 6d3e mlsn │ │ │ │ -000f9af0: 206e 616d 6573 7061 6365 2062 696e 6469 namespace bindi │ │ │ │ -000f9b00: 6e67 7320 7769 6c6c 2062 6520 7370 7269 ngs will be spri │ │ │ │ -000f9b10: 6e6b 6c65 6420 7468 726f 7567 686f 7574 nkled throughout │ │ │ │ -000f9b20: 2e20 4279 2063 6f6e 7472 6173 742c 2063 . By contrast, c │ │ │ │ -000f9b30: 616e 6f6e 6963 616c 2058 4d4c 2072 6571 anonical XML req │ │ │ │ -000f9b40: 7569 7265 7320 3c65 6d3e 3c63 6f64 653e uires │ │ │ │ -000f9b50: 786d 6c73 6e3c 2f63 6f64 653e 3c2f 656d xmlsn namespace bind │ │ │ │ -000f9b70: 696e 6773 206f 6e6c 7920 746f 2062 6520 ings only to be │ │ │ │ -000f9b80: 696e 636c 7564 6564 2077 6865 6e20 7574 included when ut │ │ │ │ -000f9b90: 696c 697a 6564 2e20 5468 6572 6566 6f72 ilized. Therefor │ │ │ │ -000f9ba0: 652c 2074 6865 203c 636f 6465 3e23 534f e, the #SO │ │ │ │ -000f9bb0: 4150 5f58 4d4c 5f43 414e 4f4e 4943 414c AP_XML_CANONICAL │ │ │ │ -000f9bc0: 3c2f 636f 6465 3e20 636f 6e74 6578 7420 context │ │ │ │ -000f9bd0: 666c 6167 2070 726f 6475 6365 7320 4331 flag produces C1 │ │ │ │ -000f9be0: 344e 2065 7863 6c75 7369 7665 2058 4d4c 4N exclusive XML │ │ │ │ -000f9bf0: 206d 6573 7361 6765 7320 616e 6420 646f messages and do │ │ │ │ -000f9c00: 6375 6d65 6e74 732c 2077 6869 6368 2065 cuments, which e │ │ │ │ -000f9c10: 6c69 6d69 6e61 7465 7320 756e 7573 6564 liminates unused │ │ │ │ -000f9c20: 203c 656d 3e3c 636f 6465 3e78 6d6c 736e xmlsn │ │ │ │ -000f9c30: 3c2f 636f 6465 3e3c 2f65 6d3e 206e 616d nam │ │ │ │ -000f9c40: 6573 7061 6365 2062 696e 6469 6e67 7320 espace bindings │ │ │ │ -000f9c50: 6672 6f6d 2058 4d4c 2e20 556e 666f 7274 from XML. Unfort │ │ │ │ -000f9c60: 756e 6174 656c 792c 2074 6865 2063 7572 unately, the cur │ │ │ │ -000f9c70: 7265 6e74 2043 3134 4e20 7374 616e 6461 rent C14N standa │ │ │ │ -000f9c80: 7264 2069 7320 6275 6767 7920 7769 7468 rd is buggy with │ │ │ │ -000f9c90: 2072 6573 7065 6374 2074 6f20 5853 4420 respect to XSD │ │ │ │ -000f9ca0: 514e 616d 6520 636f 6e74 656e 742c 2062 QName content, b │ │ │ │ -000f9cb0: 6563 6175 7365 2070 7265 6669 7865 7320 ecause prefixes │ │ │ │ -000f9cc0: 7573 6564 2069 6e20 514e 616d 6520 636f used in QName co │ │ │ │ -000f9cd0: 6e74 656e 7420 6172 6520 6e6f 7420 636f ntent are not co │ │ │ │ -000f9ce0: 6e73 6964 6572 6564 2075 7469 6c69 7a65 nsidered utilize │ │ │ │ -000f9cf0: 642e 2054 6865 2067 534f 4150 2065 6e67 d. The gSOAP eng │ │ │ │ -000f9d00: 696e 6520 636f 6e73 6964 6572 7320 514e ine considers QN │ │ │ │ -000f9d10: 616d 6520 636f 6e74 656e 7420 7072 6566 ame content pref │ │ │ │ -000f9d20: 6978 6573 2075 7469 6c69 7a65 6420 616e ixes utilized an │ │ │ │ -000f9d30: 6420 7468 6572 6566 6f72 6520 7072 6f64 d therefore prod │ │ │ │ -000f9d40: 7563 6573 2063 6f72 7265 6374 6564 2063 uces corrected c │ │ │ │ -000f9d50: 616e 6f6e 6963 616c 697a 6564 2058 4d4c anonicalized XML │ │ │ │ -000f9d60: 206f 7574 7075 7420 7468 6174 2070 7265 output that pre │ │ │ │ -000f9d70: 7665 6e74 7320 7468 6520 6c6f 7373 206f vents the loss o │ │ │ │ -000f9d80: 6620 6e61 6d65 7370 6163 6520 696e 666f f namespace info │ │ │ │ -000f9d90: 726d 6174 696f 6e20 666f 7220 514e 616d rmation for QNam │ │ │ │ -000f9da0: 6573 2e3c 2f70 3e0a 3c70 3ef0 9f94 9d20 es.

.

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

. │ │ │ │ -000f9e00: 3c2f 613e 0a53 4f41 5020 4865 6164 6572 .SOAP Header │ │ │ │ -000f9e10: 2070 726f 6365 7373 696e 673c 2f68 313e processing │ │ │ │ -000f9e20: 0a3c 703e 4120 6275 696c 742d 696e 2053 .

A built-in S │ │ │ │ -000f9e30: 4f41 5020 4865 6164 6572 2064 6174 6120 OAP Header data │ │ │ │ -000f9e40: 7374 7275 6374 7572 6520 3c63 6f64 653e structure │ │ │ │ -000f9e50: 3c61 2063 6c61 7373 3d22 656c 2220 6872 SOAP_ │ │ │ │ -000f9eb0: 454e 565f 5f48 6561 6465 723c 2f61 3e3c ENV__Header< │ │ │ │ -000f9ec0: 2f63 6f64 653e 2069 7320 6765 6e65 7261 /code> is genera │ │ │ │ -000f9ed0: 7465 6420 6279 2074 6865 2073 6f61 7063 ted by the soapc │ │ │ │ -000f9ee0: 7070 3220 746f 6f6c 2066 6f72 2065 7863 pp2 tool for exc │ │ │ │ -000f9ef0: 6861 6e67 696e 6720 534f 4150 2068 6561 hanging SOAP hea │ │ │ │ -000f9f00: 6465 7273 2069 6e20 534f 4150 206d 6573 ders in SOAP mes │ │ │ │ -000f9f10: 7361 6765 732e 2054 6869 7320 7374 7275 sages. This stru │ │ │ │ -000f9f20: 6374 7572 6520 6973 2065 6d70 7479 2075 cture is empty u │ │ │ │ -000f9f30: 6e6c 6573 7320 6865 6164 6572 7320 6172 nless headers ar │ │ │ │ -000f9f40: 6520 6164 6465 6420 6279 2070 6c75 6769 e added by plugi │ │ │ │ -000f9f50: 6e73 2061 6e64 2068 6561 6465 7273 2073 ns and headers s │ │ │ │ -000f9f60: 7065 6369 6669 6564 2062 7920 5753 444c pecified by WSDL │ │ │ │ -000f9f70: 2073 7065 6369 6669 6361 7469 6f6e 7320 specifications │ │ │ │ -000f9f80: 2869 2e65 2e20 7773 646c 3268 2061 6464 (i.e. wsdl2h add │ │ │ │ -000f9f90: 7320 534f 4150 2048 6561 6465 7273 292e s SOAP Headers). │ │ │ │ -000f9fa0: 3c2f 703e 0a3c 703e 596f 7520 6361 6e20

.

You can │ │ │ │ -000f9fb0: 6372 6561 7465 2079 6f75 7220 6f77 6e20 create your own │ │ │ │ -000f9fc0: 534f 4150 2048 6561 6465 7220 7374 7275 SOAP Header stru │ │ │ │ -000f9fd0: 6374 2073 696d 706c 7920 6279 2064 6563 ct simply by dec │ │ │ │ -000f9fe0: 6c61 7269 6e67 2069 7420 696e 2061 6e20 laring it in an │ │ │ │ -000f9ff0: 696e 7465 7266 6163 6520 6865 6164 6572 interface header │ │ │ │ -000fa000: 2066 696c 6520 666f 7220 736f 6170 6370 file for soapcp │ │ │ │ -000fa010: 7032 2061 6e64 2062 7920 6164 6469 6e67 p2 and by adding │ │ │ │ -000fa020: 206d 656d 6265 7273 2074 6861 7420 6d75 members that mu │ │ │ │ -000fa030: 7374 2062 6520 7175 616c 6966 6965 6420 st be qualified │ │ │ │ -000fa040: 7769 7468 206e 616d 6573 7061 6365 2070 with namespace p │ │ │ │ -000fa050: 7265 6669 7865 7320 746f 2063 6f6e 666f refixes to confo │ │ │ │ -000fa060: 726d 2074 6f20 7468 6520 534f 4150 2048 rm to the SOAP H │ │ │ │ -000fa070: 6561 6465 7220 7072 6f63 6573 7369 6e67 eader processing │ │ │ │ -000fa080: 2072 6571 7569 7265 6d65 6e74 7320 7468 requirements th │ │ │ │ -000fa090: 6174 2053 4f41 5020 4865 6164 6572 2065 at SOAP Header e │ │ │ │ -000fa0a0: 6c65 6d65 6e74 7320 6d75 7374 2062 6520 lements must be │ │ │ │ -000fa0b0: 6e61 6d65 7370 6163 6520 7175 616c 6966 namespace qualif │ │ │ │ -000fa0c0: 6965 642e 3c2f 703e 0a3c 703e 466f 7220 ied.

.

For │ │ │ │ -000fa0d0: 6578 616d 706c 652c 2061 7373 756d 6520 example, assume │ │ │ │ -000fa0e0: 7468 6174 2074 7261 6e73 6163 7469 6f6e that transaction │ │ │ │ -000fa0f0: 2064 6174 6120 7368 6f75 6c64 2062 6520 data should be │ │ │ │ -000fa100: 7069 6767 792d 6261 636b 6564 2077 6974 piggy-backed wit │ │ │ │ -000fa110: 6820 534f 4150 206d 6573 7361 6765 7320 h SOAP messages │ │ │ │ -000fa120: 696e 2053 4f41 5020 4865 6164 6572 3a3c in SOAP Header:< │ │ │ │ -000fa130: 2f70 3e0a 3c64 6976 2063 6c61 7373 3d22 /p>.

struct │ │ │ │ -000fa180: 745f 5f74 7261 6e73 6163 7469 6f6e 3c2f t__transaction.
{
.< │ │ │ │ -000fa1b0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -000fa1c0: 3e20 2020 203c 7370 616e 2063 6c61 7373 > i │ │ │ │ -000fa1e0: 6e74 3c2f 7370 616e 3e20 6e75 6d62 6572 nt number │ │ │ │ -000fa1f0: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
.
const │ │ │ │ -000fa230: 203c 7370 616e 2063 6c61 7373 3d22 6b65 char< │ │ │ │ -000fa250: 2f73 7061 6e3e 202a 6473 6372 6970 7469 /span> *dscripti │ │ │ │ -000fa260: 6f6e 3b3c 2f64 6976 3e0a 3c64 6976 2063 on;
.
};.
str │ │ │ │ -000fa2b0: 7563 7420 3c2f 7370 616e 3e3c 6120 636c uct SOAP_EN │ │ │ │ -000fa300: 565f 5f48 6561 6465 723c 2f61 3e20 3c2f V__Header .
{
.< │ │ │ │ -000fa330: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -000fa340: 3e20 2020 206d 7573 7455 6e64 6572 7374 > mustUnderst │ │ │ │ -000fa350: 616e 6420 3c73 7061 6e20 636c 6173 733d and struct │ │ │ │ -000fa370: 203c 2f73 7061 6e3e 745f 5f74 7261 6e73 t__trans │ │ │ │ -000fa380: 6163 7469 6f6e 202a 745f 5f74 7261 6e73 action *t__trans │ │ │ │ -000fa390: 6163 7469 6f6e 3b20 3c2f 6469 763e 0a3c action;
.< │ │ │ │ -000fa3a0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -000fa3b0: 3e7d 3b3c 2f64 6976 3e0a 3c64 6976 2063 >};
.
//gsoap ns ser │ │ │ │ -000fa3f0: 7669 6365 206d 6574 686f 642d 696e 7075 vice method-inpu │ │ │ │ -000fa400: 742d 6865 6164 6572 2d70 6172 743a 2077 t-header-part: w │ │ │ │ -000fa410: 6562 6d65 7468 6f64 2074 5f5f 7472 616e ebmethod t__tran │ │ │ │ -000fa420: 7361 6374 696f 6e3c 2f73 7061 6e3e 3c2f saction.
int ns__ │ │ │ │ -000fa470: 7765 626d 6574 686f 6428 2e2e 2e29 3b3c webmethod(...);< │ │ │ │ -000fa480: 2f64 6976 3e0a 3c2f 6469 763e 3c21 2d2d /div>.

│ │ │ │ -000fa4a0: 5468 6520 3c63 6f64 653e 6d75 7374 556e The mustUn │ │ │ │ -000fa4b0: 6465 7273 7461 6e64 3c2f 636f 6465 3e20 derstand │ │ │ │ -000fa4c0: 7175 616c 6966 6965 7220 7370 6563 6966 qualifier specif │ │ │ │ -000fa4d0: 6965 7320 7468 6174 2074 6865 2065 6c65 ies that the ele │ │ │ │ -000fa4e0: 6d65 6e74 206d 7573 7420 6265 2070 726f ment must be pro │ │ │ │ -000fa4f0: 6365 7373 6564 2062 7920 7468 6520 534f cessed by the SO │ │ │ │ -000fa500: 4150 2070 726f 6365 7373 6f72 2061 6e64 AP processor and │ │ │ │ -000fa510: 2063 616e 6e6f 7420 6265 2069 676e 6f72 cannot be ignor │ │ │ │ -000fa520: 6564 2069 6620 7468 6520 7072 6f63 6573 ed if the proces │ │ │ │ -000fa530: 736f 7220 6861 7320 6e6f 206c 6f67 6963 sor has no logic │ │ │ │ -000fa540: 2069 6e20 706c 6163 6520 666f 7220 7468 in place for th │ │ │ │ -000fa550: 6973 2053 4f41 5020 6865 6164 6572 2c20 is SOAP header, │ │ │ │ -000fa560: 7768 6963 6820 6973 2064 6f6e 6520 6279 which is done by │ │ │ │ -000fa570: 2061 6464 696e 6720 6120 3c65 6d3e 3c63 adding a SOAP-ENV:mus │ │ │ │ -000fa590: 7455 6e64 6572 7374 616e 643d 2274 7275 tUnderstand="tru │ │ │ │ -000fa5a0: 6522 3c2f 636f 6465 3e3c 2f65 6d3e 2061 e" a │ │ │ │ -000fa5b0: 7474 7269 6275 7465 2074 6f20 7468 6520 ttribute to the │ │ │ │ -000fa5c0: 3c65 6d3e 3c63 6f64 653e 743a 7472 616e t:tran │ │ │ │ -000fa5d0: 7361 6374 696f 6e3c 2f63 6f64 653e 3c2f saction element. The │ │ │ │ -000fa5f0: 2073 6f61 7063 7070 322d 6765 6e65 7261 soapcpp2-genera │ │ │ │ -000fa600: 7465 6420 7365 7269 616c 697a 6572 7320 ted serializers │ │ │ │ -000fa610: 6f62 6579 2074 6869 7320 7361 6665 7479 obey this safety │ │ │ │ -000fa620: 2070 7269 6e63 6970 6c65 2e3c 2f70 3e0a principle.

. │ │ │ │ -000fa630: 3c70 3e54 6869 7320 6465 636c 6172 6573

This declares │ │ │ │ -000fa640: 2061 2073 6572 7669 6365 206f 7065 7261 a service opera │ │ │ │ -000fa650: 7469 6f6e 2074 6861 7420 7365 6e64 7320 tion that sends │ │ │ │ -000fa660: 6d65 7373 6167 6573 2077 6974 6820 616e messages with an │ │ │ │ -000fa670: 2069 6e70 7574 2053 4f41 5020 6865 6164 input SOAP head │ │ │ │ -000fa680: 6572 203c 636f 6465 3e74 5f5f 7472 616e er t__tran │ │ │ │ -000fa690: 7361 6374 696f 6e3c 2f63 6f64 653e 2c20 saction, │ │ │ │ -000fa6a0: 6173 2063 616e 2062 6520 7365 656e 2069 as can be seen i │ │ │ │ -000fa6b0: 6e20 7468 6520 6765 6e65 7261 7465 6420 n the generated │ │ │ │ -000fa6c0: 5753 444c 2062 696e 6469 6e67 3a3c 2f70 WSDL binding:

.
< │ │ │ │ -000fa710: 3c73 7061 6e20 636c 6173 733d 226b 6579 bindin │ │ │ │ -000fa730: 673c 2f73 7061 6e3e 203c 7370 616e 2063 g n │ │ │ │ -000fa750: 616d 653c 2f73 7061 6e3e 3d3c 7370 616e ame="Ser │ │ │ │ -000fa780: 7669 6365 2671 756f 743b 3c2f 7370 616e vice" type= │ │ │ │ -000fa7d0: 2671 756f 743b 746e 733a 5365 7276 6963 "tns:Servic │ │ │ │ -000fa7e0: 6550 6f72 7454 7970 6526 7175 6f74 3b3c ePortType"< │ │ │ │ -000fa7f0: 2f73 7061 6e3e 2667 743b 3c2f 6469 763e /span>>
│ │ │ │ -000fa800: 0a3c 6469 7620 636c 6173 733d 226c 696e .
<SOAP:binding< │ │ │ │ -000fa840: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> sty │ │ │ │ -000fa860: 6c65 3c2f 7370 616e 3e3d 3c73 7061 6e20 le="docu │ │ │ │ -000fa890: 6d65 6e74 2671 756f 743b 3c2f 7370 616e ment" transpor │ │ │ │ -000fa8c0: 743c 2f73 7061 6e3e 3d3c 7370 616e 2063 t="http: │ │ │ │ -000fa8f0: 2f2f 7363 6865 6d61 732e 786d 6c73 6f61 //schemas.xmlsoa │ │ │ │ -000fa900: 702e 6f72 672f 736f 6170 2f68 7474 7026 p.org/soap/http& │ │ │ │ -000fa910: 7175 6f74 3b3c 2f73 7061 6e3e 2f26 6774 quot;/> │ │ │ │ -000fa920: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
.
< │ │ │ │ -000fa940: 3c73 7061 6e20 636c 6173 733d 226b 6579 operat │ │ │ │ -000fa960: 696f 6e3c 2f73 7061 6e3e 203c 7370 616e ion name="w │ │ │ │ -000fa9b0: 6562 6d65 7468 6f64 2671 756f 743b 3c2f ebmethod">
. │ │ │ │ -000fa9d0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
<SOAP:operati │ │ │ │ -000faa10: 6f6e 3c2f 7370 616e 3e20 3c73 7061 6e20 on │ │ │ │ -000faa30: 736f 6170 4163 7469 6f6e 3c2f 7370 616e soapAction=&q │ │ │ │ -000faa60: 756f 743b 2671 756f 743b 3c2f 7370 616e uot;"/>
. │ │ │ │ -000faa90: 2020 2026 6c74 3b3c 7370 616e 2063 6c61 <input> │ │ │ │ -000faac0: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
.
│ │ │ │ -000faae0: 2020 2020 266c 743b 3c73 7061 6e20 636c <SOAP:body use= │ │ │ │ -000fab50: 2671 756f 743b 6c69 7465 7261 6c26 7175 "literal&qu │ │ │ │ -000fab60: 6f74 3b3c 2f73 7061 6e3e 203c 7370 616e ot; parts=" │ │ │ │ -000fabb0: 426f 6479 2671 756f 743b 3c2f 7370 616e Body"/>
. │ │ │ │ -000fabe0: 2020 2020 2020 2020 2026 6c74 3b3c 7370 <SOAP:head │ │ │ │ -000fac10: 6572 3c2f 7370 616e 3e20 3c73 7061 6e20 er │ │ │ │ -000fac30: 7573 653c 2f73 7061 6e3e 3d3c 7370 616e use="lit │ │ │ │ -000fac60: 6572 616c 2671 756f 743b 3c2f 7370 616e eral" message< │ │ │ │ -000fac90: 2f73 7061 6e3e 3d3c 7370 616e 2063 6c61 /span>="tns:Ser │ │ │ │ -000facc0: 7669 6365 4865 6164 6572 2671 756f 743b viceHeader" │ │ │ │ -000facd0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c pa │ │ │ │ -000facf0: 7274 3c2f 7370 616e 3e3d 3c73 7061 6e20 rt="tran │ │ │ │ -000fad20: 7361 6374 696f 6e26 7175 6f74 3b3c 2f73 saction"/>
. │ │ │ │ -000fad40: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
</input>
.
│ │ │ │ -000fada0: 2020 266c 743b 3c73 7061 6e20 636c 6173 < │ │ │ │ -000fadc0: 6f75 7470 7574 3c2f 7370 616e 3e26 6774 output> │ │ │ │ -000fadd0: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
.
│ │ │ │ -000fadf0: 2020 2020 266c 743b 3c73 7061 6e20 636c <SOAP:body use= │ │ │ │ -000fae60: 2671 756f 743b 6c69 7465 7261 6c26 7175 "literal&qu │ │ │ │ -000fae70: 6f74 3b3c 2f73 7061 6e3e 203c 7370 616e ot; parts=" │ │ │ │ -000faec0: 426f 6479 2671 756f 743b 3c2f 7370 616e Body"/>
. │ │ │ │ -000faef0: 2020 2026 6c74 3b2f 3c73 7061 6e20 636c </output& │ │ │ │ -000faf20: 6774 3b3c 2f64 6976 3e0a 3c64 6976 2063 gt;
.
&l │ │ │ │ -000faf40: 743b 2f3c 7370 616e 2063 6c61 7373 3d22 t;/ope │ │ │ │ -000faf60: 7261 7469 6f6e 3c2f 7370 616e 3e26 6774 ration> │ │ │ │ -000faf70: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
.
</< │ │ │ │ -000faf90: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -000fafa0: 6f72 6474 7970 6522 3e62 696e 6469 6e67 ordtype">binding │ │ │ │ -000fafb0: 3c2f 7370 616e 3e26 6774 3b3c 2f64 6976 >
.
│ │ │ │ -000fafe0: 3c70 3e4c 696b 6577 6973 652c 2079 6f75

Likewise, you │ │ │ │ -000faff0: 2063 616e 2073 7065 6369 6679 2074 6861 can specify tha │ │ │ │ -000fb000: 7420 626f 7468 2069 6e70 7574 2061 6e64 t both input and │ │ │ │ -000fb010: 206f 7574 7075 7420 6d65 7373 6167 6573 output messages │ │ │ │ -000fb020: 2068 6176 6520 7468 6520 7361 6d65 2068 have the same h │ │ │ │ -000fb030: 6561 6465 7220 7769 7468 203c 636f 6465 eader with //gsoap ns serv │ │ │ │ -000fb050: 6963 6520 6d65 7468 6f64 2d68 6561 6465 ice method-heade │ │ │ │ -000fb060: 722d 7061 7274 3a3c 2f63 6f64 653e 206f r-part: o │ │ │ │ -000fb070: 7220 7468 6520 6f75 7470 7574 206d 6573 r the output mes │ │ │ │ -000fb080: 7361 6765 2068 6173 2061 2068 6561 6465 sage has a heade │ │ │ │ -000fb090: 7220 7769 7468 203c 636f 6465 3e2f 2f67 r with //g │ │ │ │ -000fb0a0: 736f 6170 206e 7320 7365 7276 6963 6520 soap ns service │ │ │ │ -000fb0b0: 6d65 7468 6f64 2d6f 7574 7075 742d 6865 method-output-he │ │ │ │ -000fb0c0: 6164 6572 2d70 6172 743a 3c2f 636f 6465 ader-part:. Multiple head │ │ │ │ -000fb0e0: 6572 7320 6361 6e20 6265 2073 7065 6369 ers can be speci │ │ │ │ -000fb0f0: 6669 6564 2074 6869 7320 7761 792e 3c2f fied this way..

To set up │ │ │ │ -000fb110: 6120 534f 4150 2048 6561 6465 7220 6174 a SOAP Header at │ │ │ │ -000fb120: 2074 6865 2063 6c69 656e 7420 7369 6465 the client side │ │ │ │ -000fb130: 2074 6861 7420 636f 6e74 6169 6e73 2074 that contains t │ │ │ │ -000fb140: 6865 203c 636f 6465 3e74 5f5f 7472 616e he t__tran │ │ │ │ -000fb150: 7361 6374 696f 6e3c 2f63 6f64 653e 206d saction m │ │ │ │ -000fb160: 656d 6265 723a 3c2f 703e 0a3c 6469 7620 ember:

.
struct │ │ │ │ -000fb1b0: 3c2f 7370 616e 3e3c 6120 636c 6173 733d so │ │ │ │ -000fb1e0: 6170 3c2f 613e 202a 3c61 2063 6c61 7373 ap *s │ │ │ │ -000fb210: 6f61 703c 2f61 3e20 3d20 3c61 2063 6c61 oap = s │ │ │ │ -000fb270: 6f61 705f 6e65 773c 2f61 3e28 293b 203c oap_new(); < │ │ │ │ -000fb280: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
... //
.
soap< │ │ │ │ -000fb300: 2f61 3e2e 3c61 2063 6c61 7373 3d22 636f /a>.hea │ │ │ │ -000fb350: 6465 723c 2f61 3e20 3d20 4e55 4c4c 3b20 der = NULL; │ │ │ │ -000fb360: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // erase a │ │ │ │ -000fb380: 6e79 2053 4f41 5020 4865 6164 6572 2077 ny SOAP Header w │ │ │ │ -000fb390: 6520 6861 7665 2073 6f20 6661 723c 2f73 e have so far
.
soap_header │ │ │ │ -000fb420: 283c 6120 636c 6173 733d 2263 6f64 6522 (soap │ │ │ │ -000fb450: 293b 2020 3c73 7061 6e20 636c 6173 733d ); // all │ │ │ │ -000fb470: 6f63 6174 6520 616e 6420 696e 6974 6961 ocate and initia │ │ │ │ -000fb480: 6c69 7a65 2061 206e 6577 2053 4f41 5020 lize a new SOAP │ │ │ │ -000fb490: 4865 6164 6572 3c2f 7370 616e 3e3c 2f64 Header.
soa │ │ │ │ -000fb4e0: 703c 2f61 3e2d 2667 743b 3c61 2063 6c61 p->header-&g │ │ │ │ -000fb540: 743b 745f 5f74 7261 6e73 6163 7469 6f6e t;t__transaction │ │ │ │ -000fb550: 203d 2073 6f61 705f 6e65 775f 745f 5f74 = soap_new_t__t │ │ │ │ -000fb560: 7261 6e73 6163 7469 6f6e 283c 6120 636c ransaction(soap, -1); │ │ │ │ -000fb5a0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ │ -000fb5e0: 736f 6170 3c2f 613e 2d26 6774 3b3c 6120 soap->header │ │ │ │ -000fb640: 2d26 6774 3b74 5f5f 7472 616e 7361 6374 ->t__transact │ │ │ │ -000fb650: 696f 6e2d 2667 743b 6e75 6d62 6572 203d ion->number = │ │ │ │ -000fb660: 206e 756d 3b3c 2f64 6976 3e0a 3c64 6976 num;
.
soap-&g │ │ │ │ -000fb6b0: 743b 3c61 2063 6c61 7373 3d22 636f 6465 t;heade │ │ │ │ -000fb700: 723c 2f61 3e2d 2667 743b 745f 5f74 7261 r->t__tra │ │ │ │ -000fb710: 6e73 6163 7469 6f6e 2d26 6774 3b64 6573 nsaction->des │ │ │ │ -000fb720: 6372 6970 7469 6f6e 203d 203c 7370 616e cription = "Tra │ │ │ │ -000fb750: 6e73 6163 7469 6f6e 616c 2064 6174 6126 nsactional data& │ │ │ │ -000fb760: 7175 6f74 3b3c 2f73 7061 6e3e 3b3c 2f64 quot;;.
│ │ │ │ -000fb7a0: 6966 3c2f 7370 616e 3e20 2873 6f61 705f if (soap_ │ │ │ │ -000fb7b0: 6361 6c6c 5f77 6562 6d65 7468 6f64 283c call_webmethod(< │ │ │ │ -000fb7c0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -000fb7d0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ -000fb7e0: 6874 6d6c 223e 736f 6170 3c2f 613e 2c20 html">soap, │ │ │ │ -000fb7f0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 endpoin │ │ │ │ -000fb840: 743c 2f61 3e2c 204e 554c 4c2c 202e 2e2e t, NULL, ... │ │ │ │ -000fb850: 2929 3c2f 6469 763e 0a3c 6469 7620 636c ))
.
... │ │ │ │ -000fb870: 203c 7370 616e 2063 6c61 7373 3d22 636f // error< │ │ │ │ -000fb890: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
.
│ │ │ │ -000fb960: 7374 7275 6374 2053 4f41 505f 454e 565f struct SOAP_ENV_ │ │ │ │ -000fb970: 5f48 6561 6465 7220 2a20 6865 6164 6572 _Header * header │ │ │ │ -000fb980: 3c2f 6469 763e 3c64 6976 2063 6c61 7373
The soa │ │ │ │ -000fb9a0: 703a 3a68 6561 6465 7220 706f 696e 7473 p::header points │ │ │ │ -000fb9b0: 2074 6f20 6120 534f 4150 5f45 4e56 5f5f to a SOAP_ENV__ │ │ │ │ -000fb9c0: 4865 6164 6572 2073 7472 7563 7475 7265 Header structure │ │ │ │ -000fb9d0: 2077 6974 6820 7468 6520 534f 4150 2048 with the SOAP H │ │ │ │ -000fb9e0: 6561 6465 7220 7468 6174 2077 6173 2072 eader that was r │ │ │ │ -000fb9f0: 6563 6569 7665 6420 6f72 2074 6861 2e2e eceived or tha.. │ │ │ │ -000fba00: 2e3c 2f64 6976 3e3c 6469 7620 636c 6173 .
Def │ │ │ │ -000fba20: 696e 6974 696f 6e3a 3c2f 623e 2073 7464 inition: std │ │ │ │ -000fba30: 736f 6170 322e 683a 3239 3535 3c2f 6469 soap2.h:2955
.
< │ │ │ │ -000fba50: 212d 2d20 6672 6167 6d65 6e74 202d 2d3e !-- fragment --> │ │ │ │ -000fba60: 3c70 3e54 6865 2053 4f41 5020 5765 6220

The SOAP Web │ │ │ │ -000fba70: 7365 7276 6963 6520 7265 7175 6573 7420 service request │ │ │ │ -000fba80: 696e 636c 7564 6573 2074 6865 2053 4f41 includes the SOA │ │ │ │ -000fba90: 5020 4865 6164 6572 2077 6974 6820 7468 P Header with th │ │ │ │ -000fbaa0: 6520 7472 616e 7361 6374 696f 6e20 6461 e transaction da │ │ │ │ -000fbab0: 7461 3a3c 2f70 3e0a 3c64 6976 2063 6c61 ta:

.
│ │ │ │ -000fbae0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
< │ │ │ │ -000fbb10: 534f 4150 2d45 4e56 3a45 6e76 656c 6f70 SOAP-ENV:Envelop │ │ │ │ -000fbb20: 653c 2f73 7061 6e3e 202e 2e2e 2667 743b e ...> │ │ │ │ -000fbb30: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
< │ │ │ │ -000fbb50: 3c73 7061 6e20 636c 6173 733d 226b 6579 SOAP-E │ │ │ │ -000fbb70: 4e56 3a48 6561 6465 723c 2f73 7061 6e3e NV:Header │ │ │ │ -000fbb80: 2667 743b 203c 2f64 6976 3e0a 3c64 6976 >
.
│ │ │ │ -000fbba0: 2020 266c 743b 3c73 7061 6e20 636c 6173 < │ │ │ │ -000fbbc0: 743a 7472 616e 7361 6374 696f 6e3c 2f73 t:transaction SOAP- │ │ │ │ -000fbbf0: 454e 563a 6d75 7374 556e 6465 7273 7461 ENV:mustUndersta │ │ │ │ -000fbc00: 6e64 3c2f 7370 616e 3e3d 3c73 7061 6e20 nd="true │ │ │ │ -000fbc30: 2671 756f 743b 3c2f 7370 616e 3e26 6774 "> │ │ │ │ -000fbc40: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
.
│ │ │ │ -000fbc60: 266c 743b 3c73 7061 6e20 636c 6173 733d <nu │ │ │ │ -000fbc80: 6d62 6572 3c2f 7370 616e 3e26 6774 3b31 mber>1 │ │ │ │ -000fbc90: 3233 3435 266c 743b 2f3c 7370 616e 2063 2345</number │ │ │ │ -000fbcc0: 2667 743b 3c2f 6469 763e 0a3c 6469 7620 >
.
│ │ │ │ -000fbce0: 2020 2026 6c74 3b3c 7370 616e 2063 6c61 <description>Tra │ │ │ │ -000fbd30: 6e73 6163 7469 6f6e 616c 3c2f 7370 616e nsactional data</description>
.< │ │ │ │ -000fbda0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -000fbdb0: 3e20 2020 2026 6c74 3b2f 3c73 7061 6e20 > </t:transactio │ │ │ │ -000fbde0: 6e3c 2f73 7061 6e3e 2667 743b 203c 2f64 n> .
</SOAP-ENV: │ │ │ │ -000fbe30: 4865 6164 6572 3c2f 7370 616e 3e26 6774 Header> │ │ │ │ -000fbe40: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
< │ │ │ │ -000fbe60: 3b3c 7370 616e 2063 6c61 7373 3d22 6b65 ;SOAP- │ │ │ │ -000fbe80: 454e 563a 426f 6479 3c2f 7370 616e 3e26 ENV:Body& │ │ │ │ -000fbe90: 6774 3b20 3c2f 6469 763e 0a3c 6469 7620 gt;
.
│ │ │ │ -000fbeb0: 2026 6c74 3b3c 7370 616e 2063 6c61 7373 <n │ │ │ │ -000fbed0: 733a 7765 626d 6574 686f 643c 2f73 7061 s:webmethod>
. │ │ │ │ -000fbf00: 2020 2020 202e 2e2e 3c2f 6469 763e 0a3c ...
.< │ │ │ │ -000fbf10: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -000fbf20: 3e20 2020 2026 6c74 3b2f 3c73 7061 6e20 > </ns:webmethod │ │ │ │ -000fbf50: 3c2f 7370 616e 3e26 6774 3b3c 2f64 6976 >
.
</SOAP-ENV:Bo │ │ │ │ -000fbfa0: 6479 3c2f 7370 616e 3e26 6774 3b20 3c2f dy> .
</SOAP-ENV:E │ │ │ │ -000fbff0: 6e76 656c 6f70 653c 2f73 7061 6e3e 2667 nvelope&g │ │ │ │ -000fc000: 743b 3c2f 6469 763e 0a3c 2f64 6976 3e3c t;
.
< │ │ │ │ -000fc010: 212d 2d20 6672 6167 6d65 6e74 202d 2d3e !-- fragment --> │ │ │ │ -000fc020: 203c 2f64 6976 3e3c 703e 4174 2074 6865

At the │ │ │ │ -000fc030: 2072 6563 6569 7669 6e67 2073 6964 652c receiving side, │ │ │ │ -000fc040: 2061 2053 4f41 5020 4865 6164 6572 2063 a SOAP Header c │ │ │ │ -000fc050: 616e 2062 6520 696e 7370 6563 7465 6420 an be inspected │ │ │ │ -000fc060: 6279 2063 6865 636b 696e 6720 666f 7220 by checking for │ │ │ │ -000fc070: 6120 6e6f 6e2d 4e55 4c4c 203c 636f 6465 a non-NULL soap::h │ │ │ │ -000fc140: 6561 6465 723c 2f61 3e3c 2f63 6f64 653e eader │ │ │ │ -000fc150: 2e3c 2f70 3e0a 3c64 6c20 636c 6173 733d .

.
Warning
When SOAP │ │ │ │ -000fc190: 4865 6164 6572 7320 6172 6520 7573 6564 Headers are used │ │ │ │ -000fc1a0: 2c20 796f 7520 6d75 7374 206d 616b 6520 , you must make │ │ │ │ -000fc1b0: 7375 7265 2074 6f20 7365 7420 3c63 6f64 sure to set soap:: │ │ │ │ -000fc280: 6865 6164 6572 3c2f 613e 3c2f 636f 6465 header to NULL when n │ │ │ │ -000fc2a0: 6f20 534f 4150 2048 6561 6465 7220 7368 o SOAP Header sh │ │ │ │ -000fc2b0: 6f75 6c64 2062 6520 7365 6e74 2c20 6f74 ould be sent, ot │ │ │ │ -000fc2c0: 6865 7277 6973 6520 616e 7920 534f 4150 herwise any SOAP │ │ │ │ -000fc2d0: 2048 6561 6465 7273 2063 7572 7265 6e74 Headers current │ │ │ │ -000fc2e0: 6c79 2070 7265 7365 6e74 2069 6e20 7468 ly present in th │ │ │ │ -000fc2f0: 6520 3c63 6f64 653e 3c61 2063 6c61 7373 e SOAP_ENV__Hea │ │ │ │ -000fc360: 6465 723c 2f61 3e3c 2f63 6f64 653e 2073 der s │ │ │ │ -000fc370: 7472 7563 7420 706f 696e 7465 6420 746f truct pointed to │ │ │ │ -000fc380: 2062 7920 3c63 6f64 653e 3c61 2063 6c61 by soap::header will b │ │ │ │ -000fc460: 6520 696e 636c 7564 6564 2069 6e20 7468 e included in th │ │ │ │ -000fc470: 6520 6d65 7373 6167 652e 3c2f 6464 3e3c e message.
< │ │ │ │ -000fc480: 2f64 6c3e 0a3c 703e 4174 2074 6865 2063 /dl>.

At the c │ │ │ │ -000fc490: 6c69 656e 7420 7369 6465 2c20 7468 6520 lient side, the │ │ │ │ -000fc4a0: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 so │ │ │ │ -000fc560: 6170 3a3a 6163 746f 723c 2f61 3e3c 2f63 ap::actor string vari │ │ │ │ -000fc580: 6162 6c65 2063 616e 2062 6520 7365 7420 able can be set │ │ │ │ -000fc590: 746f 2073 6574 2074 6865 2053 4f41 5020 to set the SOAP │ │ │ │ -000fc5a0: 3c65 6d3e 3c63 6f64 653e 534f 4150 2d45 SOAP-E │ │ │ │ -000fc5b0: 4e56 3a61 6374 6f72 3c2f 636f 6465 3e3c NV:actor< │ │ │ │ -000fc5c0: 2f65 6d3e 2061 7474 7269 6275 7465 2e20 /em> attribute. │ │ │ │ -000fc5d0: 5468 6520 3c65 6d3e 3c63 6f64 653e 534f The SO │ │ │ │ -000fc5e0: 4150 2d45 4e56 3a6d 7573 7455 6e64 6572 AP-ENV:mustUnder │ │ │ │ -000fc5f0: 7374 616e 643d 2274 7275 6522 3c2f 636f stand="true" attribu │ │ │ │ -000fc610: 7465 2074 6865 6e20 696e 6469 6361 7465 te then indicate │ │ │ │ -000fc620: 7320 7468 6520 7265 7175 6972 656d 656e s the requiremen │ │ │ │ -000fc630: 7420 7468 6174 2074 6865 2072 6563 6970 t that the recip │ │ │ │ -000fc640: 6965 6e74 2063 6f72 7265 7370 6f6e 6469 ient correspondi │ │ │ │ -000fc650: 6e67 2074 6f20 7468 6520 3c65 6d3e 3c63 ng to the SOAP-ENV:act │ │ │ │ -000fc670: 6f72 3c2f 636f 6465 3e3c 2f65 6d3e 2061 or a │ │ │ │ -000fc680: 7474 7269 6275 7465 2076 616c 7565 2069 ttribute value i │ │ │ │ -000fc690: 7320 7265 7370 6f6e 7369 626c 6520 746f s responsible to │ │ │ │ -000fc6a0: 2070 726f 6365 7373 2074 6865 2053 4f41 process the SOA │ │ │ │ -000fc6b0: 5020 4865 6164 6572 2065 6c65 6d65 6e74 P Header element │ │ │ │ -000fc6c0: 2e20 5468 6520 6465 7461 696c 7320 6f66 . The details of │ │ │ │ -000fc6d0: 2077 6869 6368 2063 616e 2062 6520 666f which can be fo │ │ │ │ -000fc6e0: 756e 6420 696e 2074 6865 2053 4f41 5020 und in the SOAP │ │ │ │ -000fc6f0: 312e 312f 312e 3220 7370 6563 6966 6963 1.1/1.2 specific │ │ │ │ -000fc700: 6174 696f 6e73 2074 6861 7420 7468 6520 ations that the │ │ │ │ -000fc710: 6753 4f41 5020 746f 6f6c 7320 636f 6e66 gSOAP tools conf │ │ │ │ -000fc720: 6f72 6d20 746f 2e3c 2f70 3e0a 3c70 3e54 orm to.

.

T │ │ │ │ -000fc730: 6865 2053 4f41 5020 4865 6164 6572 2073 he SOAP Header s │ │ │ │ -000fc740: 7472 7563 7475 7265 203c 636f 6465 3e3c tructure < │ │ │ │ -000fc750: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ -000fc760: 663d 2273 7472 7563 745f 735f 6f5f 615f f="struct_s_o_a_ │ │ │ │ -000fc770: 705f 5f5f 655f 6e5f 765f 5f5f 5f5f 6865 p___e_n_v_____he │ │ │ │ -000fc780: 6164 6572 2e68 746d 6c22 2074 6974 6c65 ader.html" title │ │ │ │ -000fc790: 3d22 534f 4150 2048 6561 6465 7220 7374 ="SOAP Header st │ │ │ │ -000fc7a0: 7275 6374 7572 652e 223e 534f 4150 5f45 ructure.">SOAP_E │ │ │ │ -000fc7b0: 4e56 5f5f 4865 6164 6572 3c2f 613e 3c2f NV__Header is declare │ │ │ │ -000fc7d0: 6420 3c63 6f64 653e 6d75 7461 626c 653c d mutable< │ │ │ │ -000fc7e0: 2f63 6f64 653e 2c20 7768 6963 6820 6d65 /code>, which me │ │ │ │ -000fc7f0: 616e 7320 7468 6174 2072 652d 6465 636c ans that re-decl │ │ │ │ -000fc800: 6172 6174 696f 6e73 206f 6620 7468 6520 arations of the │ │ │ │ -000fc810: 7374 7275 6374 7572 6573 2061 7265 2070 structures are p │ │ │ │ -000fc820: 6572 6d69 7474 6564 2061 6e64 2061 6464 ermitted and add │ │ │ │ -000fc830: 6974 696f 6e61 6c20 6d65 6d62 6572 7320 itional members │ │ │ │ -000fc840: 6172 6520 636f 6c6c 6563 7465 6420 696e are collected in │ │ │ │ -000fc850: 746f 206f 6e65 2066 696e 616c 2073 7472 to one final str │ │ │ │ -000fc860: 7563 7475 7265 2062 7920 7468 6520 736f ucture by the so │ │ │ │ -000fc870: 6170 6370 7032 2074 6f6f 6c2e 3c2f 703e apcpp2 tool.

│ │ │ │ -000fc880: 0a3c 703e 466f 7220 616e 6f74 6865 7220 .

For another │ │ │ │ -000fc890: 6578 616d 706c 652c 2063 6f6e 7369 6465 example, conside │ │ │ │ -000fc8a0: 723a 3c2f 703e 0a3c 6469 7620 636c 6173 r:

.
< │ │ │ │ -000fc8d0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -000fc8e0: 6f72 6422 3e73 7472 7563 7420 3c2f 7370 ord">struct SOAP_ENV__Heade │ │ │ │ -000fc940: 723c 2f61 3e20 3c2f 6469 763e 0a3c 6469 r
.{ │ │ │ │ -000fc960: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
char *h__transacti │ │ │ │ -000fc9b0: 6f6e 3b20 3c2f 6469 763e 0a3c 6469 7620 on;
.
│ │ │ │ -000fc9d0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 struct UserAuth *h │ │ │ │ -000fca00: 5f5f 6175 7468 656e 7469 6361 7469 6f6e __authentication │ │ │ │ -000fca10: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
};.

Su │ │ │ │ -000fca50: 7070 6f73 6520 6d65 7468 6f64 203c 636f ppose method ns__login uses both he │ │ │ │ -000fca80: 6164 6572 2070 6172 7473 2028 6174 206d ader parts (at m │ │ │ │ -000fca90: 6f73 7429 2c20 7468 656e 2074 6869 7320 ost), then this │ │ │ │ -000fcaa0: 6973 2064 6563 6c61 7265 6420 6173 3a3c is declared as:< │ │ │ │ -000fcab0: 2f70 3e0a 3c64 6976 2063 6c61 7373 3d22 /p>.

//gsoap ns ser │ │ │ │ -000fcb00: 7669 6365 206d 6574 686f 642d 6865 6164 vice method-head │ │ │ │ -000fcb10: 6572 2d70 6172 743a 206c 6f67 696e 2068 er-part: login h │ │ │ │ -000fcb20: 5f5f 7472 616e 7361 6374 696f 6e20 3c2f __transaction
.
//gsoap ns s │ │ │ │ -000fcb70: 6572 7669 6365 206d 6574 686f 642d 6865 ervice method-he │ │ │ │ -000fcb80: 6164 6572 2d70 6172 743a 206c 6f67 696e ader-part: login │ │ │ │ -000fcb90: 2068 5f5f 6175 7468 656e 7469 6361 7469 h__authenticati │ │ │ │ -000fcba0: 6f6e 203c 2f73 7061 6e3e 3c2f 6469 763e on
│ │ │ │ -000fcbb0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
int │ │ │ │ -000fcbe0: 3c2f 7370 616e 3e20 6e73 5f5f 6c6f 6769 ns__logi │ │ │ │ -000fcbf0: 6e28 2e2e 2e29 3b3c 2f64 6976 3e0a 3c2f n(...);
.

Suppose │ │ │ │ -000fcc20: 6d65 7468 6f64 203c 636f 6465 3e6e 735f method ns_ │ │ │ │ -000fcc30: 5f73 6561 7263 683c 2f63 6f64 653e 2075 _search u │ │ │ │ -000fcc40: 7365 7320 6f6e 6c79 2074 6865 2066 6972 ses only the fir │ │ │ │ -000fcc50: 7374 2068 6561 6465 7220 7061 7274 2c20 st header part, │ │ │ │ -000fcc60: 7468 656e 2074 6869 7320 6973 2064 6563 then this is dec │ │ │ │ -000fcc70: 6c61 7265 6420 6173 3a3c 2f70 3e0a 3c64 lared as:

.
//gs │ │ │ │ -000fccc0: 6f61 7020 6e73 2073 6572 7669 6365 206d oap ns service m │ │ │ │ -000fccd0: 6574 686f 642d 6865 6164 6572 2d70 6172 ethod-header-par │ │ │ │ -000fcce0: 743a 2073 6561 7263 6820 685f 5f74 7261 t: search h__tra │ │ │ │ -000fccf0: 6e73 6163 7469 6f6e 203c 2f73 7061 6e3e nsaction │ │ │ │ -000fcd00: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
int ns │ │ │ │ -000fcd40: 5f5f 7365 6172 6368 282e 2e2e 293b 3c2f __search(...);.

N │ │ │ │ -000fcd70: 6f74 6520 7468 6174 2074 6865 206d 6574 ote that the met │ │ │ │ -000fcd80: 686f 6420 6e61 6d65 2061 6e64 2068 6561 hod name and hea │ │ │ │ -000fcd90: 6465 7220 7061 7274 206e 616d 6573 206d der part names m │ │ │ │ -000fcda0: 7573 7420 6265 206e 616d 6573 7061 6365 ust be namespace │ │ │ │ -000fcdb0: 2071 7561 6c69 6669 6564 2e20 5468 6520 qualified. The │ │ │ │ -000fcdc0: 6865 6164 6572 7320 6d75 7374 2062 6520 headers must be │ │ │ │ -000fcdd0: 7072 6573 656e 7420 696e 2061 6c6c 206f present in all o │ │ │ │ -000fcde0: 7065 7261 7469 6f6e 7320 7468 6174 2064 perations that d │ │ │ │ -000fcdf0: 6563 6c61 7265 6420 7468 6520 6865 6164 eclared the head │ │ │ │ -000fce00: 6572 2070 6172 7473 2e3c 2f70 3e0a 3c70 er parts.

.

To specify the │ │ │ │ -000fce20: 6865 6164 6572 2070 6172 7473 2066 6f72 header parts for │ │ │ │ -000fce30: 2074 6865 206d 6574 686f 6420 696e 7075 the method inpu │ │ │ │ -000fce40: 7420 286d 6574 686f 6420 7265 7175 6573 t (method reques │ │ │ │ -000fce50: 7420 6d65 7373 6167 6529 2c20 7573 653a t message), use: │ │ │ │ -000fce60: 3c2f 703e 0a3c 6469 7620 636c 6173 733d

.
//gsoap names │ │ │ │ -000fceb0: 7061 6365 2d70 7265 6669 7820 7365 7276 pace-prefix serv │ │ │ │ -000fcec0: 6963 6520 6d65 7468 6f64 2d69 6e70 7574 ice method-input │ │ │ │ -000fced0: 2d68 6561 6465 722d 7061 7274 3a20 6d65 -header-part: me │ │ │ │ -000fcee0: 7468 6f64 2d6e 616d 6520 6865 6164 6572 thod-name header │ │ │ │ -000fcef0: 2d70 6172 743c 2f73 7061 6e3e 3c2f 6469 -part.

Sim │ │ │ │ -000fcf20: 696c 6172 6c79 2c20 746f 2073 7065 6369 ilarly, to speci │ │ │ │ -000fcf30: 6679 2074 6865 2068 6561 6465 7220 7061 fy the header pa │ │ │ │ -000fcf40: 7274 7320 666f 7220 7468 6520 6d65 7468 rts for the meth │ │ │ │ -000fcf50: 6f64 206f 7574 7075 7420 286d 6574 686f od output (metho │ │ │ │ -000fcf60: 6420 7265 7370 6f6e 7365 206d 6573 7361 d response messa │ │ │ │ -000fcf70: 6765 292c 2075 7365 3a3c 2f70 3e0a 3c64 ge), use:

.
//gs │ │ │ │ -000fcfc0: 6f61 7020 6e61 6d65 7370 6163 652d 7072 oap namespace-pr │ │ │ │ -000fcfd0: 6566 6978 2073 6572 7669 6365 206d 6574 efix service met │ │ │ │ -000fcfe0: 686f 642d 6f75 7470 7574 2d68 6561 6465 hod-output-heade │ │ │ │ -000fcff0: 722d 7061 7274 3a20 6d65 7468 6f64 2d6e r-part: method-n │ │ │ │ -000fd000: 616d 6520 6865 6164 6572 2d70 6172 743c ame header-part< │ │ │ │ -000fd010: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 2f64 /span>
.

The decla │ │ │ │ -000fd040: 7261 7469 6f6e 7320 6f6e 6c79 2061 6666 rations only aff │ │ │ │ -000fd050: 6563 7420 7468 6520 5753 444c 2e20 466f ect the WSDL. Fo │ │ │ │ -000fd060: 7220 6578 616d 706c 653a 3c2f 703e 0a3c r example:

.< │ │ │ │ -000fd070: 6469 7620 636c 6173 733d 2266 7261 676d div class="fragm │ │ │ │ -000fd080: 656e 7422 3e3c 6469 7620 636c 6173 733d ent">
str │ │ │ │ -000fd0b0: 7563 7420 3c2f 7370 616e 3e3c 6120 636c uct SOAP_EN │ │ │ │ -000fd100: 565f 5f48 6561 6465 723c 2f61 3e20 3c2f V__Header .
{
.< │ │ │ │ -000fd130: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -000fd140: 3e20 2020 203c 7370 616e 2063 6c61 7373 > c │ │ │ │ -000fd160: 6861 723c 2f73 7061 6e3e 202a 685f 5f74 har *h__t │ │ │ │ -000fd170: 7261 6e73 6163 7469 6f6e 3b20 3c2f 6469 ransaction; .
s │ │ │ │ -000fd1b0: 7472 7563 7420 3c2f 7370 616e 3e55 7365 truct Use │ │ │ │ -000fd1c0: 7241 7574 6820 2a68 5f5f 6175 7468 656e rAuth *h__authen │ │ │ │ -000fd1d0: 7469 6361 7469 6f6e 3b20 3c2f 6469 763e tication;
│ │ │ │ -000fd1e0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
};
.< │ │ │ │ -000fd210: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ -000fd220: 656e 7422 3e2f 2f67 736f 6170 206e 7320 ent">//gsoap ns │ │ │ │ -000fd230: 7365 7276 6963 6520 6d65 7468 6f64 2d69 service method-i │ │ │ │ -000fd240: 6e70 7574 2d68 6561 6465 722d 7061 7274 nput-header-part │ │ │ │ -000fd250: 3a20 6c6f 6769 6e20 685f 5f61 7574 6865 : login h__authe │ │ │ │ -000fd260: 6e74 6963 6174 696f 6e20 3c2f 7370 616e ntication
.
│ │ │ │ -000fd2a0: 2f2f 6773 6f61 7020 6e73 2073 6572 7669 //gsoap ns servi │ │ │ │ -000fd2b0: 6365 206d 6574 686f 642d 696e 7075 742d ce method-input- │ │ │ │ -000fd2c0: 6865 6164 6572 2d70 6172 743a 206c 6f67 header-part: log │ │ │ │ -000fd2d0: 696e 2068 5f5f 7472 616e 7361 6374 696f in h__transactio │ │ │ │ -000fd2e0: 6e20 3c2f 7370 616e 3e3c 2f64 6976 3e0a n
. │ │ │ │ -000fd2f0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
//gsoap │ │ │ │ -000fd320: 6e73 2073 6572 7669 6365 206d 6574 686f ns service metho │ │ │ │ -000fd330: 642d 6f75 7470 7574 2d68 6561 6465 722d d-output-header- │ │ │ │ -000fd340: 7061 7274 3a20 6c6f 6769 6e20 685f 5f74 part: login h__t │ │ │ │ -000fd350: 7261 6e73 6163 7469 6f6e 203c 2f73 7061 ransaction
.
int │ │ │ │ -000fd3a0: 6e73 5f5f 6c6f 6769 6e28 2e2e 2e29 3b3c ns__login(...);< │ │ │ │ -000fd3b0: 2f64 6976 3e0a 3c2f 6469 763e 3c21 2d2d /div>.

│ │ │ │ -000fd3d0: 5468 6520 6865 6164 6572 7320 6d75 7374 The headers must │ │ │ │ -000fd3e0: 2062 6520 7072 6573 656e 7420 696e 2061 be present in a │ │ │ │ -000fd3f0: 6c6c 206f 7065 7261 7469 6f6e 7320 7468 ll operations th │ │ │ │ -000fd400: 6174 2064 6563 6c61 7265 6420 7468 6520 at declared the │ │ │ │ -000fd410: 6865 6164 6572 2070 6172 7473 2e3c 2f70 header parts.

.

See also AP │ │ │ │ -000fd430: 4920 646f 6375 6d65 6e74 6174 696f 6e20 I documentation │ │ │ │ -000fd440: 4d6f 6475 6c65 203c 6120 636c 6173 733d Module Header str │ │ │ │ -000fd480: 7563 7475 7265 2061 6e64 2066 756e 6374 ucture and funct │ │ │ │ -000fd490: 696f 6e73 3c2f 613e 2e3c 2f70 3e0a 3c70 ions.

.

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

.SOAP F │ │ │ │ -000fd500: 6175 6c74 2070 726f 6365 7373 696e 673c ault processing< │ │ │ │ -000fd510: 2f68 313e 0a3c 703e 4120 6275 696c 742d /h1>.

A built- │ │ │ │ -000fd520: 696e 2053 4f41 5020 4661 756c 7420 6461 in SOAP Fault da │ │ │ │ -000fd530: 7461 2073 7472 7563 7475 7265 203c 636f ta structure SOAP │ │ │ │ -000fd5a0: 5f45 4e56 5f5f 4661 756c 743c 2f61 3e3c _ENV__Fault< │ │ │ │ -000fd5b0: 2f63 6f64 653e 2069 7320 6765 6e65 7261 /code> is genera │ │ │ │ -000fd5c0: 7465 6420 6279 2074 6865 2073 6f61 7063 ted by the soapc │ │ │ │ -000fd5d0: 7070 3220 746f 6f6c 2066 6f72 2065 7863 pp2 tool for exc │ │ │ │ -000fd5e0: 6861 6e67 696e 6720 6578 6365 7074 696f hanging exceptio │ │ │ │ -000fd5f0: 6e20 6d65 7373 6167 6573 2e20 5468 6973 n messages. This │ │ │ │ -000fd600: 2073 7472 7563 7475 7265 2068 6173 2074 structure has t │ │ │ │ -000fd610: 6865 2067 656e 6572 616c 2066 6f72 6d3a he general form: │ │ │ │ -000fd620: 3c2f 703e 0a3c 6469 7620 636c 6173 733d

.
.
{..< │ │ │ │ -000fd800: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -000fd810: 3e20 2020 203c 7370 616e 2063 6c61 7373 > c │ │ │ │ -000fd830: 6861 723c 2f73 7061 6e3e 202a 3c61 2063 har *fault │ │ │ │ -000fd8a0: 7374 7269 6e67 3c2f 613e 3b20 3c2f 6469 string; .
char * │ │ │ │ -000fd8f0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 f │ │ │ │ -000fd950: 6175 6c74 6163 746f 723c 2f61 3e3b 203c aultactor; < │ │ │ │ -000fd960: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
struct │ │ │ │ -000fd9a0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 SO │ │ │ │ -000fd9e0: 4150 5f45 4e56 5f5f 4465 7461 696c 3c2f AP_ENV__Detail *detail; < │ │ │ │ -000fda60: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
struct │ │ │ │ -000fdaa0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 SOAP │ │ │ │ -000fdae0: 5f45 4e56 5f5f 436f 6465 3c2f 613e 202a _ENV__Code * │ │ │ │ -000fdaf0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 S │ │ │ │ -000fdb50: 4f41 505f 454e 565f 5f43 6f64 653c 2f61 OAP_ENV__Code; // must │ │ │ │ -000fdb80: 2062 6520 6120 534f 4150 5f45 4e56 5f5f be a SOAP_ENV__ │ │ │ │ -000fdb90: 436f 6465 2073 7472 7563 7420 6465 6669 Code struct defi │ │ │ │ -000fdba0: 6e65 6420 6265 6c6f 7720 3c2f 7370 616e ned below
. │ │ │ │ -000fdc70: 0a3c 6469 7620 636c 6173 733d 226c 696e .
char *SOA │ │ │ │ -000fdd10: 505f 454e 565f 5f4e 6f64 653c 2f61 3e3b P_ENV__Node; │ │ │ │ -000fdd20: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
..< │ │ │ │ -000fdde0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -000fddf0: 3e20 2020 203c 7370 616e 2063 6c61 7373 > struc │ │ │ │ -000fde10: 7420 3c2f 7370 616e 3e3c 6120 636c 6173 t SOAP_ENV_ │ │ │ │ -000fde60: 5f44 6574 6169 6c3c 2f61 3e20 2a3c 6120 _Detail *SOAP │ │ │ │ -000fded0: 5f45 4e56 5f5f 4465 7461 696c 3c2f 613e _ENV__Detail │ │ │ │ -000fdee0: 3b20 3c73 7061 6e20 636c 6173 733d 2263 ; // SOAP │ │ │ │ -000fdf00: 312e 3220 6465 7461 696c 206d 656d 6265 1.2 detail membe │ │ │ │ -000fdf10: 7220 3c2f 7370 616e 3e3c 2f64 6976 3e0a r
. │ │ │ │ -000fdf20: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
};
.
struct SO │ │ │ │ -000fdfb0: 4150 5f45 4e56 5f5f 436f 6465 3c2f 613e AP_ENV__Code │ │ │ │ -000fdfc0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
{
.. │ │ │ │ -000fe0d0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
stru │ │ │ │ -000fe100: 6374 203c 2f73 7061 6e3e 3c61 2063 6c61 ct SOAP_ENV__ │ │ │ │ -000fe150: 436f 6465 3c2f 613e 202a 3c61 2063 6c61 Code *SOAP_ENV │ │ │ │ -000fe1c0: 5f5f 5375 6263 6f64 653c 2f61 3e3b 203c __Subcode; < │ │ │ │ -000fe1d0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
};
.
struct │ │ │ │ -000fe220: 203c 2f73 7061 6e3e 3c61 2063 6c61 7373 SOAP_ENV__ │ │ │ │ -000fe270: 4465 7461 696c 3c2f 613e 203c 2f64 6976 Detail
.
{
.
│ │ │ │ -000fe2b0: 2020 3c73 7061 6e20 636c 6173 733d 226b int< │ │ │ │ -000fe2d0: 2f73 7061 6e3e 203c 6120 636c 6173 733d /span> __type; // The │ │ │ │ -000fe360: 2053 4f41 505f 5459 5045 5f20 6f66 2074 SOAP_TYPE_ of t │ │ │ │ -000fe370: 6865 206f 626a 6563 7420 7365 7269 616c he object serial │ │ │ │ -000fe380: 697a 6564 2061 7320 4661 756c 7420 6465 ized as Fault de │ │ │ │ -000fe390: 7461 696c 203c 2f73 7061 6e3e 3c2f 6469 tail .
void * │ │ │ │ -000fe3e0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 │ │ │ │ -000fe440: 6661 756c 743c 2f61 3e3b 203c 7370 616e fault; // pointer to t │ │ │ │ -000fe470: 6865 2066 6175 6c74 206f 626a 6563 742c he fault object, │ │ │ │ -000fe480: 206f 7220 4e55 4c4c 203c 2f73 7061 6e3e or NULL │ │ │ │ -000fe490: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ │ -000fe500: 5f58 4d4c 3c2f 613e 203c 6120 636c 6173 _XML __any; // an │ │ │ │ -000fe590: 7920 6f74 6865 7220 6465 7461 696c 2065 y other detail e │ │ │ │ -000fe5a0: 6c65 6d65 6e74 2063 6f6e 7465 6e74 2028 lement content ( │ │ │ │ -000fe5b0: 7374 6f72 6564 2069 6e20 584d 4c20 666f stored in XML fo │ │ │ │ -000fe5c0: 726d 6174 2920 3c2f 7370 616e 3e3c 2f64 rmat) .
};
.< │ │ │ │ -000fe5f0: 6469 7620 636c 6173 733d 2274 7463 2220 div class="ttc" │ │ │ │ -000fe600: 6964 3d22 6173 7472 7563 745f 735f 6f5f id="astruct_s_o_ │ │ │ │ -000fe610: 615f 705f 5f5f 655f 6e5f 765f 5f5f 5f5f a_p___e_n_v_____ │ │ │ │ -000fe620: 636f 6465 5f68 746d 6c22 3e3c 6469 7620 code_html">
SOAP Fa │ │ │ │ -000fe6a0: 756c 7420 436f 6465 2073 7472 7563 7475 ult Code structu │ │ │ │ -000fe6b0: 7265 2e3c 2f64 6976 3e3c 6469 7620 636c re.
D │ │ │ │ -000fe6d0: 6566 696e 6974 696f 6e3a 3c2f 623e 2073 efinition: s │ │ │ │ -000fe6e0: 7464 736f 6170 322e 683a 3934 3731 3c2f tdsoap2.h:9471
..Optional elemen │ │ │ │ -000fea00: 7420 534f 4150 2d45 4e56 3a56 616c 7565 t SOAP-ENV:Value │ │ │ │ -000fea10: 206f 6620 5853 4420 7479 7065 2078 7364 of XSD type xsd │ │ │ │ -000fea20: 3a51 4e61 6d65 3c2f 6469 763e 3c64 6976 :QName
< │ │ │ │ -000fea40: 623e 4465 6669 6e69 7469 6f6e 3a3c 2f62 b>Definition: stdsoap2.h:947 │ │ │ │ -000fea60: 333c 2f64 6976 3e3c 2f64 6976 3e0a 3c64 3
.
│ │ │ │ -000feac0: 3c61 2068 7265 663d 2273 7472 7563 745f SOAP_ENV__Detai │ │ │ │ -000feb00: 6c3c 2f61 3e3c 2f64 6976 3e3c 6469 7620 l
SO │ │ │ │ -000feb20: 4150 2046 6175 6c74 2044 6574 6169 6c20 AP Fault Detail │ │ │ │ -000feb30: 7374 7275 6374 7572 652e 3c2f 6469 763e structure.
│ │ │ │ -000feb40: 3c64 6976 2063 6c61 7373 3d22 7474 6465
Definition │ │ │ │ -000feb60: 3a3c 2f62 3e20 7374 6473 6f61 7032 2e68 : stdsoap2.h │ │ │ │ -000feb70: 3a39 3438 323c 2f64 6976 3e3c 2f64 6976 :9482
.
vo │ │ │ │ -000fec80: 6964 202a 2066 6175 6c74 3c2f 6469 763e id * fault
│ │ │ │ -000fec90: 3c64 6976 2063 6c61 7373 3d22 7474 646f
Any data of s │ │ │ │ -000fecb0: 6f6d 6520 7479 7065 2054 2073 6572 6961 ome type T seria │ │ │ │ -000fecc0: 6c69 7a65 6420 6173 2066 6175 6c74 2065 lized as fault e │ │ │ │ -000fecd0: 6c65 6d65 6e74 2077 6865 6e20 6974 7320 lement when its │ │ │ │ -000fece0: 534f 4150 5f54 5950 455f 5420 6973 2061 SOAP_TYPE_T is a │ │ │ │ -000fecf0: 7373 6967 6e65 6420 746f 205f 5f74 7970 ssigned to __typ │ │ │ │ -000fed00: 653c 2f64 6976 3e3c 6469 7620 636c 6173 e
Def │ │ │ │ -000fed20: 696e 6974 696f 6e3a 3c2f 623e 2073 7464 inition: std │ │ │ │ -000fed30: 736f 6170 322e 683a 3934 3836 3c2f 6469 soap2.h:9486
.
_XML __any< │ │ │ │ -000fee50: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
Any XML │ │ │ │ -000fee70: 636f 6e74 656e 742e 3c2f 6469 763e 3c64 content.
Definition:< │ │ │ │ -000feea0: 2f62 3e20 7374 6473 6f61 7032 2e68 3a39 /b> stdsoap2.h:9 │ │ │ │ -000feeb0: 3438 383c 2f64 6976 3e3c 2f64 6976 3e0a 488
. │ │ │ │ -000feec0: 3c64 6976 2063 6c61 7373 3d22 7474 6322
│ │ │ │ -000fef20: 3c64 6976 2063 6c61 7373 3d22 7474 6e61 │ │ │ │ -000fefe0: 416e 7920 6461 7461 206f 6620 736f 6d65 Any data of some │ │ │ │ -000feff0: 2074 7970 6520 5420 7365 7269 616c 697a type T serializ │ │ │ │ -000ff000: 6564 2061 7320 6661 756c 7420 656c 656d ed as fault elem │ │ │ │ -000ff010: 656e 7420 7768 656e 2069 7473 2053 4f41 ent when its SOA │ │ │ │ -000ff020: 505f 5459 5045 5f54 2069 7320 6173 7369 P_TYPE_T is assi │ │ │ │ -000ff030: 676e 6564 2074 6f20 5f5f 7479 7065 3c2f gned to __type
Defini │ │ │ │ -000ff060: 7469 6f6e 3a3c 2f62 3e20 7374 6473 6f61 tion: stdsoa │ │ │ │ -000ff070: 7032 2e68 3a39 3438 343c 2f64 6976 3e3c p2.h:9484
< │ │ │ │ -000ff080: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
SOAP_ │ │ │ │ -000ff150: 454e 565f 5f46 6175 6c74 3a3a 534f 4150 ENV__Fault::SOAP │ │ │ │ -000ff160: 5f45 4e56 5f5f 4e6f 6465 3c2f 613e 3c2f _ENV__Node
char * S │ │ │ │ -000ff190: 4f41 505f 454e 565f 5f4e 6f64 653c 2f64 OAP_ENV__Node
Optional e │ │ │ │ -000ff1c0: 6c65 6d65 6e74 2053 4f41 502d 454e 563a lement SOAP-ENV: │ │ │ │ -000ff1d0: 4e6f 6465 206f 6620 5853 4420 7479 7065 Node of XSD type │ │ │ │ -000ff1e0: 2078 7364 3a73 7472 696e 673c 2f64 6976 xsd:string
Definitio │ │ │ │ -000ff210: 6e3a 3c2f 623e 2073 7464 736f 6170 322e n: stdsoap2. │ │ │ │ -000ff220: 683a 3934 3630 3c2f 6469 763e 3c2f 6469 h:9460
.
SOAP_ENV │ │ │ │ -000ff300: 5f5f 4661 756c 743a 3a53 4f41 505f 454e __Fault::SOAP_EN │ │ │ │ -000ff310: 565f 5f44 6574 6169 6c3c 2f61 3e3c 2f64 V__Detail
struct SO │ │ │ │ -000ff340: 4150 5f45 4e56 5f5f 4465 7461 696c 202a AP_ENV__Detail * │ │ │ │ -000ff350: 2053 4f41 505f 454e 565f 5f44 6574 6169 SOAP_ENV__Detai │ │ │ │ -000ff360: 6c3c 2f64 6976 3e3c 6469 7620 636c 6173 l
Option │ │ │ │ -000ff380: 616c 2065 6c65 6d65 6e74 2053 4f41 502d al element SOAP- │ │ │ │ -000ff390: 454e 563a 4465 7461 696c 206f 6620 5853 ENV:Detail of XS │ │ │ │ -000ff3a0: 4420 7479 7065 2053 4f41 502d 454e 563a D type SOAP-ENV: │ │ │ │ -000ff3b0: 4465 7461 696c 3c2f 6469 763e 3c64 6976 Detail
< │ │ │ │ -000ff3d0: 623e 4465 6669 6e69 7469 6f6e 3a3c 2f62 b>Definition: stdsoap2.h:946 │ │ │ │ -000ff3f0: 343c 2f64 6976 3e3c 2f64 6976 3e0a 3c64 4
.SOAP_ENV__Fau │ │ │ │ -000ff4d0: 6c74 3a3a 534f 4150 5f45 4e56 5f5f 526f lt::SOAP_ENV__Ro │ │ │ │ -000ff4e0: 6c65 3c2f 613e 3c2f 6469 763e 3c64 6976 le
│ │ │ │ -000ff500: 6368 6172 202a 2053 4f41 505f 454e 565f char * SOAP_ENV_ │ │ │ │ -000ff510: 5f52 6f6c 653c 2f64 6976 3e3c 6469 7620 _Role
Op │ │ │ │ -000ff530: 7469 6f6e 616c 2065 6c65 6d65 6e74 2053 tional element S │ │ │ │ -000ff540: 4f41 502d 454e 563a 526f 6c65 206f 6620 OAP-ENV:Role of │ │ │ │ -000ff550: 5853 4420 7479 7065 2078 7364 3a73 7472 XSD type xsd:str │ │ │ │ -000ff560: 696e 673c 2f64 6976 3e3c 6469 7620 636c ing
D │ │ │ │ -000ff580: 6566 696e 6974 696f 6e3a 3c2f 623e 2073 efinition: s │ │ │ │ -000ff590: 7464 736f 6170 322e 683a 3934 3632 3c2f tdsoap2.h:9462
.
s │ │ │ │ -000ff6b0: 7472 7563 7420 534f 4150 5f45 4e56 5f5f truct SOAP_ENV__ │ │ │ │ -000ff6c0: 5265 6173 6f6e 202a 2053 4f41 505f 454e Reason * SOAP_EN │ │ │ │ -000ff6d0: 565f 5f52 6561 736f 6e3c 2f64 6976 3e3c V__Reason
< │ │ │ │ -000ff6e0: 6469 7620 636c 6173 733d 2274 7464 6f63 div class="ttdoc │ │ │ │ -000ff6f0: 223e 4f70 7469 6f6e 616c 2065 6c65 6d65 ">Optional eleme │ │ │ │ -000ff700: 6e74 2053 4f41 502d 454e 563a 5265 6173 nt SOAP-ENV:Reas │ │ │ │ -000ff710: 6f6e 206f 6620 5853 4420 7479 7065 2053 on of XSD type S │ │ │ │ -000ff720: 4f41 502d 454e 563a 5265 6173 6f6e 3c2f OAP-ENV:Reason
Defini │ │ │ │ -000ff750: 7469 6f6e 3a3c 2f62 3e20 7374 6473 6f61 tion: stdsoa │ │ │ │ -000ff760: 7032 2e68 3a39 3435 383c 2f64 6976 3e3c p2.h:9458
< │ │ │ │ -000ff770: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
char * faul │ │ │ │ -000ff880: 7473 7472 696e 673c 2f64 6976 3e3c 6469 tstring
│ │ │ │ -000ff8a0: 4f70 7469 6f6e 616c 2065 6c65 6d65 6e74 Optional element │ │ │ │ -000ff8b0: 2066 6175 6c74 7374 7269 6e67 206f 6620 faultstring of │ │ │ │ -000ff8c0: 5853 4420 7479 7065 2078 7364 3a73 7472 XSD type xsd:str │ │ │ │ -000ff8d0: 696e 673c 2f64 6976 3e3c 6469 7620 636c ing
D │ │ │ │ -000ff8f0: 6566 696e 6974 696f 6e3a 3c2f 623e 2073 efinition: s │ │ │ │ -000ff900: 7464 736f 6170 322e 683a 3934 3530 3c2f tdsoap2.h:9450
.
.
< │ │ │ │ -000ffb50: 6120 6872 6566 3d22 7374 7275 6374 5f73 a href="struct_s │ │ │ │ -000ffb60: 5f6f 5f61 5f70 5f5f 5f65 5f6e 5f76 5f5f _o_a_p___e_n_v__ │ │ │ │ -000ffb70: 5f5f 5f66 6175 6c74 2e68 746d 6c23 6164 ___fault.html#ad │ │ │ │ -000ffb80: 3830 3064 6264 3332 6233 3032 6363 3965 800dbd32b302cc9e │ │ │ │ -000ffb90: 3039 3665 3663 3331 3164 6632 3964 6522 096e6c311df29de" │ │ │ │ -000ffba0: 3e53 4f41 505f 454e 565f 5f46 6175 6c74 >SOAP_ENV__Fault │ │ │ │ -000ffbb0: 3a3a 6661 756c 7463 6f64 653c 2f61 3e3c ::faultcode< │ │ │ │ -000ffbc0: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
_QName │ │ │ │ -000ffbe0: 6661 756c 7463 6f64 653c 2f64 6976 3e3c faultcode
< │ │ │ │ -000ffbf0: 6469 7620 636c 6173 733d 2274 7464 6f63 div class="ttdoc │ │ │ │ -000ffc00: 223e 4f70 7469 6f6e 616c 2065 6c65 6d65 ">Optional eleme │ │ │ │ -000ffc10: 6e74 2066 6175 6c74 636f 6465 206f 6620 nt faultcode of │ │ │ │ -000ffc20: 5853 4420 7479 7065 2078 7364 3a51 4e61 XSD type xsd:QNa │ │ │ │ -000ffc30: 6d65 3c2f 6469 763e 3c64 6976 2063 6c61 me
De │ │ │ │ -000ffc50: 6669 6e69 7469 6f6e 3a3c 2f62 3e20 7374 finition: st │ │ │ │ -000ffc60: 6473 6f61 7032 2e68 3a39 3434 383c 2f64 dsoap2.h:9448
.
S │ │ │ │ -000ffd40: 4f41 505f 454e 565f 5f46 6175 6c74 3a3a OAP_ENV__Fault:: │ │ │ │ -000ffd50: 6661 756c 7461 6374 6f72 3c2f 613e 3c2f faultactor
char * f │ │ │ │ -000ffd80: 6175 6c74 6163 746f 723c 2f64 6976 3e3c aultactor
< │ │ │ │ -000ffd90: 6469 7620 636c 6173 733d 2274 7464 6f63 div class="ttdoc │ │ │ │ -000ffda0: 223e 4f70 7469 6f6e 616c 2065 6c65 6d65 ">Optional eleme │ │ │ │ -000ffdb0: 6e74 2066 6175 6c74 6163 746f 7220 6f66 nt faultactor of │ │ │ │ -000ffdc0: 2058 5344 2074 7970 6520 7873 643a 7374 XSD type xsd:st │ │ │ │ -000ffdd0: 7269 6e67 3c2f 6469 763e 3c64 6976 2063 ring
│ │ │ │ -000ffdf0: 4465 6669 6e69 7469 6f6e 3a3c 2f62 3e20 Definition: │ │ │ │ -000ffe00: 7374 6473 6f61 7032 2e68 3a39 3435 323c stdsoap2.h:9452< │ │ │ │ -000ffe10: 2f64 6976 3e3c 2f64 6976 3e0a 3c64 6976 /div>
.
< │ │ │ │ -000ffe90: 6120 6872 6566 3d22 7374 7275 6374 5f73 a href="struct_s │ │ │ │ -000ffea0: 5f6f 5f61 5f70 5f5f 5f65 5f6e 5f76 5f5f _o_a_p___e_n_v__ │ │ │ │ -000ffeb0: 5f5f 5f66 6175 6c74 2e68 746d 6c23 6166 ___fault.html#af │ │ │ │ -000ffec0: 3439 6332 6131 3932 3665 6266 3463 3836 49c2a1926ebf4c86 │ │ │ │ -000ffed0: 3564 6464 3434 3439 3630 6239 6164 6222 5ddd444960b9adb" │ │ │ │ -000ffee0: 3e53 4f41 505f 454e 565f 5f46 6175 6c74 >SOAP_ENV__Fault │ │ │ │ -000ffef0: 3a3a 6465 7461 696c 3c2f 613e 3c2f 6469 ::detail
struct SOA │ │ │ │ -000fff20: 505f 454e 565f 5f44 6574 6169 6c20 2a20 P_ENV__Detail * │ │ │ │ -000fff30: 6465 7461 696c 3c2f 6469 763e 3c64 6976 detail
O │ │ │ │ -000fff50: 7074 696f 6e61 6c20 656c 656d 656e 7420 ptional element │ │ │ │ -000fff60: 6465 7461 696c 206f 6620 5853 4420 7479 detail of XSD ty │ │ │ │ -000fff70: 7065 2053 4f41 502d 454e 563a 4465 7461 pe SOAP-ENV:Deta │ │ │ │ -000fff80: 696c 3c2f 6469 763e 3c64 6976 2063 6c61 il
De │ │ │ │ -000fffa0: 6669 6e69 7469 6f6e 3a3c 2f62 3e20 7374 finition: st │ │ │ │ -000fffb0: 6473 6f61 7032 2e68 3a39 3435 343c 2f64 dsoap2.h:9454
.
│ │ │ │ -000fffd0: 3c21 2d2d 2066 7261 676d 656e 7420 2d2d

In the example, │ │ │ │ -00100f60: 2074 6865 2053 4f41 5020 4661 756c 7420 the SOAP Fault │ │ │ │ -00100f70: 6465 7461 696c 7320 7765 7265 2065 6d70 details were emp │ │ │ │ -00100f80: 7479 2028 4e55 4c4c 292e 2059 6f75 206d ty (NULL). You m │ │ │ │ -00100f90: 6179 2070 6173 7320 616e 2058 4d4c 2066 ay pass an XML f │ │ │ │ -00100fa0: 7261 676d 656e 742c 2077 6869 6368 2077 ragment, which w │ │ │ │ -00100fb0: 696c 6c20 6265 206c 6974 6572 616c 6c79 ill be literally │ │ │ │ -00100fc0: 2069 6e63 6c75 6465 6420 696e 2074 6865 included in the │ │ │ │ -00100fd0: 2053 4f41 5020 4661 756c 7420 6d65 7373 SOAP Fault mess │ │ │ │ -00100fe0: 6167 652e 2046 6f72 2057 532d 4920 4261 age. For WS-I Ba │ │ │ │ -00100ff0: 7369 6320 5072 6f66 696c 6520 636f 6d70 sic Profile comp │ │ │ │ -00101000: 6c69 616e 6365 2c20 796f 7520 6d75 7374 liance, you must │ │ │ │ -00101010: 2070 6173 7320 616e 2058 4d4c 2073 7472 pass an XML str │ │ │ │ -00101020: 696e 6720 7769 7468 206f 6e65 206f 7220 ing with one or │ │ │ │ -00101030: 6d6f 7265 206e 616d 6573 7061 6365 2071 more namespace q │ │ │ │ -00101040: 7561 6c69 6669 6564 2065 6c65 6d65 6e74 ualified element │ │ │ │ -00101050: 732c 2073 7563 6820 6173 3a3c 2f70 3e0a s, such as:

. │ │ │ │ -00101060: 3c64 6976 2063 6c61 7373 3d22 6672 6167
return │ │ │ │ -001010b0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap_receiver │ │ │ │ -00101110: 5f66 6175 6c74 3c2f 613e 283c 6120 636c _fault(soap, "Re │ │ │ │ -00101170: 736f 7572 6365 2074 656d 706f 7261 7269 source temporari │ │ │ │ -00101180: 6c79 2075 6e61 7661 696c 6162 6c65 2671 ly unavailable&q │ │ │ │ -00101190: 756f 743b 3c2f 7370 616e 3e2c 203c 7370 uot;, "& │ │ │ │ -001011c0: 6c74 3b65 7272 6f72 636f 6465 2078 6d6c lt;errorcode xml │ │ │ │ -001011d0: 6e73 3d26 2333 393b 6874 7470 3a2f 2f74 ns='http://t │ │ │ │ -001011e0: 656d 7075 7269 2e6f 7267 2623 3339 3b26 empuri.org'& │ │ │ │ -001011f0: 6774 3b31 3233 266c 743b 2f65 7272 6f72 gt;123</error │ │ │ │ -00101200: 636f 6465 2667 743b 266c 743b 6572 726f code><erro │ │ │ │ -00101210: 7269 6e66 6f20 786d 6c6e 733d 2623 3339 rinfo xmlns=' │ │ │ │ -00101220: 3b68 7474 703a 2f2f 7465 6d70 7572 692e ;http://tempuri. │ │ │ │ -00101230: 6f72 6726 2333 393b 2667 743b 6162 6326 org'>abc& │ │ │ │ -00101240: 6c74 3b2f 6572 726f 7269 6e66 6f26 6774 lt;/errorinfo> │ │ │ │ -00101250: 3b26 7175 6f74 3b3c 2f73 7061 6e3e 293b ;"); │ │ │ │ -00101260: 3c2f 6469 763e 0a3c 2f64 6976 3e3c 212d
.

When a service │ │ │ │ -00101290: 6f70 6572 6174 696f 6e20 6e65 6564 7320 operation needs │ │ │ │ -001012a0: 746f 2070 6f70 756c 6174 6520 534f 4150 to populate SOAP │ │ │ │ -001012b0: 2046 6175 6c74 2064 6574 6169 6c73 2077 Fault details w │ │ │ │ -001012c0: 6974 6820 6120 6170 706c 6963 6174 696f ith a applicatio │ │ │ │ -001012d0: 6e2d 7370 6563 6966 6963 2064 6174 612c n-specific data, │ │ │ │ -001012e0: 2069 7420 646f 6573 2073 6f20 6279 2061 it does so by a │ │ │ │ -001012f0: 7373 6967 6e69 6e67 2074 6865 203c 636f ssigning the soap: │ │ │ │ -001013c0: 3a66 6175 6c74 3c2f 613e 3c2f 636f 6465 :fault member of the │ │ │ │ -001013e0: 6375 7272 656e 7420 7265 6665 7265 6e63 current referenc │ │ │ │ -001013f0: 6520 746f 2074 6865 2063 6f6e 7465 7874 e to the context │ │ │ │ -00101400: 2077 6974 6820 6170 7072 6f70 7269 6174 with appropriat │ │ │ │ -00101410: 6520 6461 7461 2061 7373 6f63 6961 7465 e data associate │ │ │ │ -00101420: 6420 7769 7468 2074 6865 2065 7863 6570 d with the excep │ │ │ │ -00101430: 7469 6f6e 2061 6e64 2062 7920 7265 7475 tion and by retu │ │ │ │ -00101440: 726e 696e 6720 7468 6520 6572 726f 7220 rning the error │ │ │ │ -00101450: 3c63 6f64 653e 2353 4f41 505f 4641 554c #SOAP_FAUL │ │ │ │ -00101460: 543c 2f63 6f64 653e 2e20 466f 7220 6578 T. For ex │ │ │ │ -00101470: 616d 706c 653a 3c2f 703e 0a3c 6469 7620 ample:

.
soap_recei │ │ │ │ -00101500: 7665 725f 6661 756c 743c 2f61 3e28 3c61 ver_fault(soap, < │ │ │ │ -00101540: 7370 616e 2063 6c61 7373 3d22 7374 7269 span class="stri │ │ │ │ -00101550: 6e67 6c69 7465 7261 6c22 3e26 7175 6f74 ngliteral">" │ │ │ │ -00101560: 3b45 7272 6f72 206d 6573 7361 6765 2671 ;Error message&q │ │ │ │ -00101570: 756f 743b 3c2f 7370 616e 3e2c 204e 554c uot;, NUL │ │ │ │ -00101580: 4c29 3b20 3c2f 6469 763e 0a3c 6469 7620 L);
.
if │ │ │ │ -001015c0: 2028 3c61 2063 6c61 7373 3d22 636f 6465 (soap->v │ │ │ │ -00101640: 6572 7369 6f6e 3c2f 613e 203d 3d20 3229 ersion == 2) │ │ │ │ -00101650: 203c 7370 616e 2063 6c61 7373 3d22 636f // SOAP 1 │ │ │ │ -00101670: 2e32 2069 7320 7573 6564 203c 2f73 7061 .2 is used
.
{.
so │ │ │ │ -001016e0: 6170 3c2f 613e 2d26 6774 3b3c 6120 636c ap->fault-&g │ │ │ │ -00101740: 743b 3c61 2063 6c61 7373 3d22 636f 6465 t;SOAP_ENV__Detai │ │ │ │ -001017b0: 6c3c 2f61 3e20 3d20 736f 6170 5f6e 6577 l = soap_new │ │ │ │ -001017c0: 5f53 4f41 505f 454e 565f 5f44 6574 6169 _SOAP_ENV__Detai │ │ │ │ -001017d0: 6c28 3c61 2063 6c61 7373 3d22 636f 6465 l(soap, -1);
. │ │ │ │ -00101820: 2020 3c61 2063 6c61 7373 3d22 636f 6465 soap->f │ │ │ │ -001018a0: 6175 6c74 3c2f 613e 2d26 6774 3b3c 6120 ault->SOAP │ │ │ │ -00101910: 5f45 4e56 5f5f 4465 7461 696c 3c2f 613e _ENV__Detail │ │ │ │ -00101920: 2d26 6774 3b3c 6120 636c 6173 733d 2263 ->__type │ │ │ │ -00101990: 3d20 534f 4150 5f54 5950 455f 6e73 315f = SOAP_TYPE_ns1_ │ │ │ │ -001019a0: 5f6d 7953 7461 636b 4461 7461 5479 7065 _myStackDataType │ │ │ │ -001019b0: 3b20 3c73 7061 6e20 636c 6173 733d 2263 ; // stack │ │ │ │ -001019d0: 2074 7970 6520 3c2f 7370 616e 3e3c 2f64 type .
s │ │ │ │ -00101a20: 6f61 703c 2f61 3e2d 2667 743b 3c61 2063 oap->fault-& │ │ │ │ -00101a80: 6774 3b3c 6120 636c 6173 733d 2263 6f64 gt;SOAP_ENV__Deta │ │ │ │ -00101af0: 696c 3c2f 613e 2d26 6774 3b3c 6120 636c il->fault │ │ │ │ -00101b60: 3c2f 613e 203d 2073 703b 2020 2020 2020 = sp; │ │ │ │ +000e9aa0: 2020 2020 2020 2020 207e 7369 6d70 6c65 ~simple │ │ │ │ +000e9ab0: 5f76 6563 746f 7228 2920 2020 2020 207b _vector() { │ │ │ │ +000e9ac0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 if (head) delete[ │ │ │ │ +000e9b10: 5d20 6865 6164 3b20 7d20 3c2f 6469 763e ] head; }
│ │ │ │ +000e9b20: 0a3c 6469 7620 636c 6173 733d 226c 696e .
void │ │ │ │ +000e9b60: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +000e9b70: 2020 2020 2020 2020 636c 6561 7228 2920 clear() │ │ │ │ +000e9b80: 2020 2020 2020 2020 2020 2020 2020 7b20 { │ │ │ │ +000e9b90: 7461 696c 203d 2068 6561 643b 207d 203c tail = head; } < │ │ │ │ +000e9ba0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
/* │ │ │ │ +000e9bd0: 2074 6865 206d 656d 6265 7220 6675 6e63 the member func │ │ │ │ +000e9be0: 7469 6f6e 7320 6265 6c6f 7720 6172 6520 tions below are │ │ │ │ +000e9bf0: 7265 7175 6972 6564 2066 6f72 2073 6572 required for ser │ │ │ │ +000e9c00: 6961 6c69 7a61 7469 6f6e 206f 6620 7465 ialization of te │ │ │ │ +000e9c10: 6d70 6c61 7465 7320 2a2f 3c2f 7370 616e mplates */
.
i │ │ │ │ +000e9c40: 7465 7261 746f 7220 2020 2020 2020 2020 terator │ │ │ │ +000e9c50: 2020 2020 2020 2020 2020 2020 2020 2062 b │ │ │ │ +000e9c60: 6567 696e 2829 2020 2020 2020 2020 2020 egin() │ │ │ │ +000e9c70: 2020 2020 207b 203c 7370 616e 2063 6c61 { return h │ │ │ │ +000e9ca0: 6561 643b 207d 203c 2f64 6976 3e0a 3c64 ead; }
. │ │ │ │ +000e9cc0: 2020 2020 636f 6e73 745f 6974 6572 6174 const_iterat │ │ │ │ +000e9cd0: 6f72 2020 2020 2020 2020 2020 2020 2020 or │ │ │ │ +000e9ce0: 2020 2020 6265 6769 6e28 293c 7370 616e begin() const { │ │ │ │ +000e9d10: 203c 7370 616e 2063 6c61 7373 3d22 6b65 retur │ │ │ │ +000e9d30: 6e3c 2f73 7061 6e3e 2068 6561 643b 207d n head; } │ │ │ │ +000e9d40: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
it │ │ │ │ +000e9d60: 6572 6174 6f72 2020 2020 2020 2020 2020 erator │ │ │ │ +000e9d70: 2020 2020 2020 2020 2020 2020 2020 656e en │ │ │ │ +000e9d80: 6428 2920 2020 2020 2020 2020 2020 2020 d() │ │ │ │ +000e9d90: 2020 2020 7b20 3c73 7061 6e20 636c 6173 { │ │ │ │ +000e9db0: 7265 7475 726e 3c2f 7370 616e 3e20 7461 return ta │ │ │ │ +000e9dc0: 696c 3b20 7d20 3c2f 6469 763e 0a3c 6469 il; }
. │ │ │ │ +000e9de0: 2020 2063 6f6e 7374 5f69 7465 7261 746f const_iterato │ │ │ │ +000e9df0: 7220 2020 2020 2020 2020 2020 2020 2020 r │ │ │ │ +000e9e00: 2020 2065 6e64 2829 3c73 7061 6e20 636c end() c │ │ │ │ +000e9e20: 6f6e 7374 203c 2f73 7061 6e3e 7b20 3c73 onst { return tail; } .
size_t │ │ │ │ +000e9eb0: 2020 2020 2020 2020 2020 2020 7369 7a65 size │ │ │ │ +000e9ec0: 2829 3c73 7061 6e20 636c 6173 733d 226b () const < │ │ │ │ +000e9ee0: 2f73 7061 6e3e 7b20 3c73 7061 6e20 636c /span>{ return │ │ │ │ +000e9f10: 7461 696c 202d 2068 6561 643b 207d 203c tail - head; } < │ │ │ │ +000e9f20: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
iter │ │ │ │ +000e9f40: 6174 6f72 2020 2020 2020 2020 2020 2020 ator │ │ │ │ +000e9f50: 2020 2020 2020 2020 2020 2020 696e 7365 inse │ │ │ │ +000e9f60: 7274 2869 7465 7261 746f 7220 706f 732c rt(iterator pos, │ │ │ │ +000e9f70: 2063 6f6e 7374 5f72 6566 6572 656e 6365 const_reference │ │ │ │ +000e9f80: 2076 616c 2920 3c2f 6469 763e 0a3c 6469 val)
. │ │ │ │ +000e9fa0: 2020 207b 3c2f 6469 763e 0a3c 6469 7620 {
.
│ │ │ │ +000e9fc0: 2020 203c 7370 616e 2063 6c61 7373 3d22 if< │ │ │ │ +000e9fe0: 2f73 7061 6e3e 2028 2168 6561 6429 203c /span> (!head) < │ │ │ │ +000e9ff0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ +000ea010: 6865 6164 203d 2074 6169 6c20 3d20 3c73 head = tail = new v │ │ │ │ +000ea040: 616c 7565 5f74 7970 655b 6361 7061 6369 alue_type[capaci │ │ │ │ +000ea050: 7479 203d 2031 5d3b 203c 2f64 6976 3e0a ty = 1];
. │ │ │ │ +000ea060: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
else if (tail >= he │ │ │ │ +000ea0d0: 6164 202b 2063 6170 6163 6974 7929 203c ad + capacity) < │ │ │ │ +000ea0e0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
{< │ │ │ │ +000ea100: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ +000ea120: 6974 6572 6174 6f72 2069 203d 2068 6561 iterator i = hea │ │ │ │ +000ea130: 643b 203c 2f64 6976 3e0a 3c64 6976 2063 d;
.
│ │ │ │ +000ea150: 2020 2020 6974 6572 6174 6f72 206a 203d iterator j = │ │ │ │ +000ea160: 203c 7370 616e 2063 6c61 7373 3d22 6b65 new value_type[cap │ │ │ │ +000ea190: 6163 6974 7920 2a3d 2032 5d3b 203c 2f64 acity *= 2]; .
it │ │ │ │ +000ea1c0: 6572 6174 6f72 206b 203d 206a 3b20 3c2f erator k = j; .
< │ │ │ │ +000ea1f0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +000ea200: 6f72 6466 6c6f 7722 3e77 6869 6c65 3c2f ordflow">while (i < ta │ │ │ │ +000ea220: 696c 2920 3c2f 6469 763e 0a3c 6469 7620 il)
.
│ │ │ │ +000ea240: 2020 2020 2020 202a 6b2b 2b20 3d20 2a69 *k++ = *i │ │ │ │ +000ea250: 2b2b 3b20 3c2f 6469 763e 0a3c 6469 7620 ++;
.
│ │ │ │ +000ea270: 2020 2020 203c 7370 616e 2063 6c61 7373 i │ │ │ │ +000ea290: 663c 2f73 7061 6e3e 2028 706f 7329 203c f (pos) < │ │ │ │ +000ea2a0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ +000ea2c0: 2020 706f 7320 3d20 6a20 2b20 2870 6f73 pos = j + (pos │ │ │ │ +000ea2d0: 202d 2068 6561 6429 3b20 3c2f 6469 763e - head);
│ │ │ │ +000ea2e0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
tail │ │ │ │ +000ea300: 3d20 6a20 2b20 2874 6169 6c20 2d20 6865 = j + (tail - he │ │ │ │ +000ea310: 6164 293b 203c 2f64 6976 3e0a 3c64 6976 ad);
.
│ │ │ │ +000ea330: 2020 2020 2020 3c73 7061 6e20 636c 6173 dele │ │ │ │ +000ea350: 7465 3c2f 7370 616e 3e5b 5d20 6865 6164 te[] head │ │ │ │ +000ea360: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
│ │ │ │ +000ea380: 2020 2068 6561 6420 3d20 6a3b 203c 2f64 head = j; .
} .
if │ │ │ │ +000ea3f0: 2028 706f 7320 2661 6d70 3b26 616d 703b (pos && │ │ │ │ +000ea400: 2070 6f73 2026 6774 3b3d 2068 6561 6420 pos >= head │ │ │ │ +000ea410: 2661 6d70 3b26 616d 703b 2070 6f73 2026 && pos & │ │ │ │ +000ea420: 6c74 3b20 7461 696c 2920 3c2f 6469 763e lt; tail)
│ │ │ │ +000ea430: 0a3c 6469 7620 636c 6173 733d 226c 696e .
{
│ │ │ │ +000ea450: 0a3c 6469 7620 636c 6173 733d 226c 696e .
itera │ │ │ │ +000ea470: 746f 7220 6920 3d20 7461 696c 3b20 3c2f tor i = tail; .
i │ │ │ │ +000ea4a0: 7465 7261 746f 7220 6a20 3d20 6920 2d20 terator j = i - │ │ │ │ +000ea4b0: 313b 203c 2f64 6976 3e0a 3c64 6976 2063 1;
.
│ │ │ │ +000ea4d0: 2020 2020 3c73 7061 6e20 636c 6173 733d wh │ │ │ │ +000ea4f0: 696c 653c 2f73 7061 6e3e 2028 6a20 213d ile (j != │ │ │ │ +000ea500: 2070 6f73 2920 3c2f 6469 763e 0a3c 6469 pos)
. │ │ │ │ +000ea520: 2020 2020 2020 2020 2020 2a69 2d2d 203d *i-- = │ │ │ │ +000ea530: 202a 6a2d 2d3b 203c 2f64 6976 3e0a 3c64 *j--;
. │ │ │ │ +000ea550: 2020 2020 2020 2020 2a70 6f73 203d 2076 *pos = v │ │ │ │ +000ea560: 616c 3b20 3c2f 6469 763e 0a3c 6469 7620 al;
.
│ │ │ │ +000ea580: 2020 207d 203c 2f64 6976 3e0a 3c64 6976 }
.
│ │ │ │ +000ea5a0: 2020 2020 3c73 7061 6e20 636c 6173 733d el │ │ │ │ +000ea5c0: 7365 3c2f 7370 616e 3e20 3c2f 6469 763e se
│ │ │ │ +000ea5d0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
{
│ │ │ │ +000ea5f0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
pos = │ │ │ │ +000ea610: 2074 6169 6c3b 203c 2f64 6976 3e0a 3c64 tail;
. │ │ │ │ +000ea630: 2020 2020 2020 2020 2a74 6169 6c2b 2b20 *tail++ │ │ │ │ +000ea640: 3d20 7661 6c3b 203c 2f64 6976 3e0a 3c64 = val;
. │ │ │ │ +000ea660: 2020 2020 2020 7d20 3c2f 6469 763e 0a3c }
.< │ │ │ │ +000ea670: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +000ea680: 3e20 2020 2020 203c 7370 616e 2063 6c61 > return p │ │ │ │ +000ea6b0: 6f73 3b20 3c2f 6469 763e 0a3c 6469 7620 os;
.
│ │ │ │ +000ea6d0: 207d 203c 2f64 6976 3e0a 3c64 6976 2063 }
.
│ │ │ │ +000ea6f0: 7369 6d70 6c65 5f76 6563 746f 7226 616d simple_vector&am │ │ │ │ +000ea700: 703b 206f 7065 7261 746f 723d 283c 7370 p; operator=(const │ │ │ │ +000ea730: 7369 6d70 6c65 5f76 6563 746f 7226 616d simple_vector&am │ │ │ │ +000ea740: 703b 2076 2920 3c2f 6469 763e 0a3c 6469 p; v)
. │ │ │ │ +000ea760: 2020 207b 3c2f 6469 763e 0a3c 6469 7620 {
.
│ │ │ │ +000ea780: 2020 2068 6561 6420 3d20 7461 696c 203d head = tail = │ │ │ │ +000ea790: 204e 554c 4c3b 203c 2f64 6976 3e0a 3c64 NULL;
. │ │ │ │ +000ea7b0: 2020 2020 2020 6361 7061 6369 7479 203d capacity = │ │ │ │ +000ea7c0: 2076 2e63 6170 6163 6974 793b 203c 2f64 v.capacity; .
if │ │ │ │ +000ea810: 2876 2e68 6561 6429 203c 2f64 6976 3e0a (v.head)
. │ │ │ │ +000ea820: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
{
. │ │ │ │ +000ea840: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
head = │ │ │ │ +000ea860: 2074 6169 6c20 3d20 3c73 7061 6e20 636c tail = ne │ │ │ │ +000ea880: 773c 2f73 7061 6e3e 2076 616c 7565 5f74 w value_t │ │ │ │ +000ea890: 7970 655b 6361 7061 6369 7479 5d3b 203c ype[capacity]; < │ │ │ │ +000ea8a0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ +000ea8c0: 6974 6572 6174 6f72 2069 203d 2076 2e68 iterator i = v.h │ │ │ │ +000ea8d0: 6561 643b 203c 2f64 6976 3e0a 3c64 6976 ead;
.
│ │ │ │ +000ea8f0: 2020 2020 2020 3c73 7061 6e20 636c 6173 │ │ │ │ +000ea910: 7768 696c 653c 2f73 7061 6e3e 2028 6920 while (i │ │ │ │ +000ea920: 213d 2076 2e74 6169 6c29 203c 2f64 6976 != v.tail)
.
*t │ │ │ │ +000ea950: 6169 6c2b 2b20 3d20 2a69 2b2b 3b20 3c2f ail++ = *i++; .
} < │ │ │ │ +000ea980: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
return *thi │ │ │ │ +000ea9e0: 733c 2f73 7061 6e3e 3b20 3c2f 6469 763e s;
│ │ │ │ +000ea9f0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
}
. │ │ │ │ +000eaa10: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
};
.

The conta │ │ │ │ +000eabe0: 696e 6572 2063 6c61 7373 2069 7473 656c iner class itsel │ │ │ │ +000eabf0: 6620 7368 6f75 6c64 206e 6f74 2062 6520 f should not be │ │ │ │ +000eac00: 6465 6669 6e65 6420 696e 2074 6865 2069 defined in the i │ │ │ │ +000eac10: 6e74 6572 6661 6365 2068 6561 6465 7220 nterface header │ │ │ │ +000eac20: 6669 6c65 2c20 6f6e 6c79 2074 6865 2074 file, only the t │ │ │ │ +000eac30: 656d 706c 6174 6520 6465 636c 6172 6174 emplate declarat │ │ │ │ +000eac40: 696f 6e20 7375 6666 6963 6573 2066 6f72 ion suffices for │ │ │ │ +000eac50: 2073 6f61 7063 7070 3220 746f 2067 656e soapcpp2 to gen │ │ │ │ +000eac60: 6572 6174 6520 7365 7269 616c 697a 6572 erate serializer │ │ │ │ +000eac70: 732e 2052 6563 616c 6c20 7468 6174 2074 s. Recall that t │ │ │ │ +000eac80: 6865 203c 636f 6465 3e23 696e 636c 7564 he #includ │ │ │ │ +000eac90: 653c 2f63 6f64 653e 2064 6972 6563 7469 e directi │ │ │ │ +000eaca0: 7665 7320 6172 6520 6e6f 7420 6578 6563 ves are not exec │ │ │ │ +000eacb0: 7574 6564 2062 7920 736f 6170 6370 7032 uted by soapcpp2 │ │ │ │ +000eacc0: 2062 7574 2073 696d 706c 7920 7061 7373 but simply pass │ │ │ │ +000eacd0: 6564 206f 6e20 746f 2074 6865 2067 656e ed on to the gen │ │ │ │ +000eace0: 6572 6174 6564 2073 6f75 7263 6520 636f erated source co │ │ │ │ +000eacf0: 6465 2e20 5468 6973 2069 6e63 6c75 6465 de. This include │ │ │ │ +000ead00: 2073 7065 6369 6669 6573 2069 6e20 7468 specifies in th │ │ │ │ +000ead10: 6520 6765 6e65 7261 7465 6420 736f 7572 e generated sour │ │ │ │ +000ead20: 6365 2063 6f64 6520 7768 6572 6520 7468 ce code where th │ │ │ │ +000ead30: 6520 636f 6e74 6169 6e65 7220 6973 2061 e container is a │ │ │ │ +000ead40: 6374 7561 6c6c 7920 6465 6669 6e65 642e ctually defined. │ │ │ │ +000ead50: 3c2f 703e 0a3c 703e f09f 949d 203c 6120

.

.... Back to │ │ │ │ +000ead70: 2074 6162 6c65 206f 6620 636f 6e74 656e table of conten │ │ │ │ +000ead80: 7473 3c2f 613e 3c2f 703e 0a3c 6833 3e3c ts

.

< │ │ │ │ +000ead90: 6120 636c 6173 733d 2261 6e63 686f 7222 a class="anchor" │ │ │ │ +000eada0: 2069 643d 2270 6f6c 796d 6f72 7068 6963 id="polymorphic │ │ │ │ +000eadb0: 6172 7261 7973 223e 3c2f 613e 0a50 6f6c arrays">.Pol │ │ │ │ +000eadc0: 796d 6f72 7068 6963 2064 796e 616d 6963 ymorphic dynamic │ │ │ │ +000eadd0: 2061 7272 6179 7320 616e 6420 6c69 7374 arrays and list │ │ │ │ +000eade0: 733c 2f68 333e 0a3c 703e 506f 6c79 6d6f s

.

Polymo │ │ │ │ +000eadf0: 7270 6869 6320 6172 7261 7973 2c20 7468 rphic arrays, th │ │ │ │ +000eae00: 6174 2069 732c 2061 7272 6179 7320 6f66 at is, arrays of │ │ │ │ +000eae10: 2076 616c 7565 7320 6f66 2061 6e79 2074 values of any t │ │ │ │ +000eae20: 7970 652c 2063 616e 2062 6520 7365 7269 ype, can be seri │ │ │ │ +000eae30: 616c 697a 6564 2069 6e20 584d 4c20 7768 alized in XML wh │ │ │ │ +000eae40: 656e 2064 6563 6c61 7265 6420 6173 2061 en declared as a │ │ │ │ +000eae50: 6e20 6172 7261 7920 6f66 2070 6f69 6e74 n array of point │ │ │ │ +000eae60: 6572 7320 746f 2061 2062 6173 6520 636c ers to a base cl │ │ │ │ +000eae70: 6173 732e 2046 6f72 2065 7861 6d70 6c65 ass. For example │ │ │ │ +000eae80: 3a3c 2f70 3e0a 3c64 6976 2063 6c61 7373 :

.
class ns__Object .
{ pub │ │ │ │ +000eaf10: 6c69 633c 2f73 7061 6e3e 3a20 3c2f 6469 lic: .
... // members of │ │ │ │ +000eaf60: 206e 735f 5f4f 626a 6563 743c 2f73 7061 ns__Object
.
}; .
cla │ │ │ │ +000eafc0: 7373 203c 2f73 7061 6e3e 6e73 5f5f 4461 ss ns__Da │ │ │ │ +000eafd0: 7461 203a 203c 7370 616e 2063 6c61 7373 ta : publi │ │ │ │ +000eaff0: 633c 2f73 7061 6e3e 206e 735f 5f4f 626a c ns__Obj │ │ │ │ +000eb000: 6563 7420 3c2f 6469 763e 0a3c 6469 7620 ect
.
{ < │ │ │ │ +000eb020: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +000eb030: 6f72 6422 3e70 7562 6c69 633c 2f73 7061 ord">public:
.
│ │ │ │ +000eb060: 202e 2e2e 203c 7370 616e 2063 6c61 7373 ... // me │ │ │ │ +000eb080: 6d62 6572 7320 6f66 206e 735f 5f44 6174 mbers of ns__Dat │ │ │ │ +000eb090: 613c 2f73 7061 6e3e 3c2f 6469 763e 0a3c a
.< │ │ │ │ +000eb0a0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +000eb0b0: 3e7d 3b20 3c2f 6469 763e 0a3c 6469 7620 >};
.
class │ │ │ │ +000eb0f0: 4172 7261 794f 664f 626a 6563 7420 3c2f ArrayOfObject .
{ p │ │ │ │ +000eb130: 7562 6c69 633c 2f73 7061 6e3e 3a20 3c2f ublic: .
ns__O │ │ │ │ +000eb160: 626a 6563 7420 2a2a 5f5f 7074 723b 203c bject **__ptr; < │ │ │ │ +000eb170: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ +000eb180: 656e 7422 3e2f 2f20 706f 696e 7465 7220 ent">// pointer │ │ │ │ +000eb190: 746f 2061 7272 6179 206f 6620 706f 696e to array of poin │ │ │ │ +000eb1a0: 7465 7273 2074 6f20 6261 7365 206f 7220 ters to base or │ │ │ │ +000eb1b0: 6465 7269 7665 6420 6f62 6a65 6374 7320 derived objects │ │ │ │ +000eb1c0: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ │ +000eb1e0: 2020 2020 3c73 7061 6e20 636c 6173 733d in │ │ │ │ +000eb200: 743c 2f73 7061 6e3e 205f 5f73 697a 653b t __size; │ │ │ │ +000eb210: 2020 2020 2020 2020 203c 7370 616e 2063 / │ │ │ │ +000eb230: 2f20 7369 7a65 206f 6620 7468 6520 6172 / size of the ar │ │ │ │ +000eb240: 7261 793c 2f73 7061 6e3e 3c2f 6469 763e ray
│ │ │ │ +000eb250: 0a3c 6469 7620 636c 6173 733d 226c 696e .
};
.< │ │ │ │ +000eb280: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +000eb290: 6f72 6422 3e63 6c61 7373 203c 2f73 7061 ord">class ns__Objects .
{ p │ │ │ │ +000eb2e0: 7562 6c69 633c 2f73 7061 6e3e 3a20 3c2f ublic: .
std:: │ │ │ │ +000eb310: 7665 6374 6f72 266c 743b 6e73 5f5f 4f62 vector<ns__Ob │ │ │ │ +000eb320: 6a65 6374 2667 743b 206f 626a 6563 7473 ject> objects │ │ │ │ +000eb330: 3b20 3c73 7061 6e20 636c 6173 733d 2263 ; // vecto │ │ │ │ +000eb350: 7220 6f66 2062 6173 6520 6f72 2064 6572 r of base or der │ │ │ │ +000eb360: 6976 6564 206f 626a 6563 7473 203c 2f73 ived objects
.
};< │ │ │ │ +000eb390: 2f64 6976 3e0a 3c2f 6469 763e 3c21 2d2d /div>.

│ │ │ │ +000eb3b0: 5468 6520 706f 696e 7465 7273 2069 6e20 The pointers in │ │ │ │ +000eb3c0: 7468 6520 6172 7261 7920 6361 6e20 706f the array can po │ │ │ │ +000eb3d0: 696e 7420 746f 2074 6865 203c 636f 6465 int to the ns__Object base instance │ │ │ │ +000eb400: 7320 6f72 203c 636f 6465 3e6e 735f 5f44 s or ns__D │ │ │ │ +000eb410: 6174 613c 2f63 6f64 653e 2064 6572 6976 ata deriv │ │ │ │ +000eb420: 6564 2069 6e73 7461 6e63 6573 2c20 7768 ed instances, wh │ │ │ │ +000eb430: 6963 6820 7769 6c6c 2062 6520 7365 7269 ich will be seri │ │ │ │ +000eb440: 616c 697a 6564 2061 6363 6f72 6469 6e67 alized according │ │ │ │ +000eb450: 6c79 2069 6e20 584d 4c2e 2044 6572 6976 ly in XML. Deriv │ │ │ │ +000eb460: 6564 2069 6e73 7461 6e63 6573 2061 7265 ed instances are │ │ │ │ +000eb470: 2069 6e64 6963 6174 6564 2062 7920 3c65 indicated by xsi:type │ │ │ │ +000eb490: 3c2f 636f 6465 3e3c 2f65 6d3e 2061 7474 att │ │ │ │ +000eb4a0: 7269 6275 7465 2069 6e20 584d 4c20 7769 ribute in XML wi │ │ │ │ +000eb4b0: 7468 2074 6865 2071 7561 6c69 6669 6564 th the qualified │ │ │ │ +000eb4c0: 206e 616d 6520 6f66 2074 6865 2063 6c61 name of the cla │ │ │ │ +000eb4d0: 7373 2c20 746f 2064 6973 7469 6e67 7569 ss, to distingui │ │ │ │ +000eb4e0: 7368 2064 6572 6976 6564 2069 6e73 7461 sh derived insta │ │ │ │ +000eb4f0: 6e63 6573 2066 726f 6d20 7468 6520 6261 nces from the ba │ │ │ │ +000eb500: 7365 2069 6e73 7461 6e63 6573 2e20 5769 se instances. Wi │ │ │ │ +000eb510: 7468 6f75 7420 7468 6973 2061 7474 7269 thout this attri │ │ │ │ +000eb520: 6275 7465 2074 6865 2064 6573 6572 6961 bute the deseria │ │ │ │ +000eb530: 6c69 7a65 7220 7769 6c6c 206e 6f74 2069 lizer will not i │ │ │ │ +000eb540: 6e73 7461 6e74 6961 7465 2074 6865 2064 nstantiate the d │ │ │ │ +000eb550: 6572 6976 6564 2069 6e73 7461 6e63 6520 erived instance │ │ │ │ +000eb560: 6275 7420 6120 6261 7365 2069 6e73 7461 but a base insta │ │ │ │ +000eb570: 6e63 6520 7369 6e63 6520 7468 6572 6520 nce since there │ │ │ │ +000eb580: 6973 206e 6f20 6964 656e 7469 6679 696e is no identifyin │ │ │ │ +000eb590: 6720 696e 666f 726d 6174 696f 6e20 746f g information to │ │ │ │ +000eb5a0: 2064 6973 7469 6e67 7569 7368 2074 6865 distinguish the │ │ │ │ +000eb5b0: 2058 4d4c 2066 6f72 6d73 2065 7863 6570 XML forms excep │ │ │ │ +000eb5c0: 7420 666f 7220 7468 6520 3c65 6d3e 3c63 t for the xsi:type attribu │ │ │ │ +000eb5f0: 7465 2e3c 2f70 3e0a 3c70 3e53 696e 6365 te.

.

Since │ │ │ │ +000eb600: 2077 6520 6361 6e6e 6f74 2075 7365 2064 we cannot use d │ │ │ │ +000eb610: 796e 616d 6963 2062 696e 6469 6e67 2074 ynamic binding t │ │ │ │ +000eb620: 6f20 7375 7070 6f72 7420 706f 6c79 6d6f o support polymo │ │ │ │ +000eb630: 7270 6869 736d 2069 6e20 432c 2061 6e6f rphism in C, ano │ │ │ │ +000eb640: 7468 6572 206d 6563 6861 6e69 736d 2077 ther mechanism w │ │ │ │ +000eb650: 6520 6361 6e20 7573 6520 6973 2076 6f69 e can use is voi │ │ │ │ +000eb660: 6420 706f 696e 7465 7273 202e 2048 6572 d pointers . Her │ │ │ │ +000eb670: 6520 6973 2061 6e20 6578 616d 706c 6520 e is an example │ │ │ │ +000eb680: 6f66 2061 2070 6f6c 796d 6f72 7068 6963 of a polymorphic │ │ │ │ +000eb690: 2053 4f41 502d 656e 636f 6465 6420 6172 SOAP-encoded ar │ │ │ │ +000eb6a0: 7261 7920 3c63 6f64 653e 4172 7261 794f ray ArrayO │ │ │ │ +000eb6b0: 664f 626a 6563 743c 2f63 6f64 653e 2061 fObject a │ │ │ │ +000eb6c0: 6e64 2061 206e 6f6e 2d53 4f41 5020 6479 nd a non-SOAP dy │ │ │ │ +000eb6d0: 6e61 6d69 6320 6172 7261 7920 3c63 6f64 namic array ns__Objects that hold v │ │ │ │ +000eb700: 616c 7565 7320 6f66 2061 6e79 2073 6572 alues of any ser │ │ │ │ +000eb710: 6961 6c69 7a61 626c 6520 7479 7065 3a3c ializable type:< │ │ │ │ +000eb720: 2f70 3e0a 3c64 6976 2063 6c61 7373 3d22 /p>.

struct │ │ │ │ +000eb770: 5f5f 7772 6170 7065 7220 3c2f 6469 763e __wrapper
│ │ │ │ +000eb780: 0a3c 6469 7620 636c 6173 733d 226c 696e .
{
.
│ │ │ │ +000eb7b0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 int __type; │ │ │ │ +000eb7e0: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // identif │ │ │ │ +000eb800: 7920 7468 6520 7479 7065 2062 656c 6f77 y the type below │ │ │ │ +000eb810: 2062 7920 534f 4150 5f54 5950 455f 5420 by SOAP_TYPE_T │ │ │ │ +000eb820: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ │ +000eb840: 2020 2020 3c73 7061 6e20 636c 6173 733d vo │ │ │ │ +000eb860: 6964 3c2f 7370 616e 3e20 2a5f 5f69 7465 id *__ite │ │ │ │ +000eb870: 6d3b 203c 7370 616e 2063 6c61 7373 3d22 m; // poin │ │ │ │ +000eb890: 7465 7220 746f 2064 6174 6120 6f66 2074 ter to data of t │ │ │ │ +000eb8a0: 7970 6520 5420 3c2f 7370 616e 3e3c 2f64 ype T .
};
. │ │ │ │ +000eb8d0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
struct < │ │ │ │ +000eb900: 2f73 7061 6e3e 4172 7261 794f 664f 626a /span>ArrayOfObj │ │ │ │ +000eb910: 6563 7420 3c2f 6469 763e 0a3c 6469 7620 ect
.
{.
struct _ │ │ │ │ +000eb970: 5f77 7261 7070 6572 202a 5f5f 7074 723b _wrapper *__ptr; │ │ │ │ +000eb980: 203c 7370 616e 2063 6c61 7373 3d22 636f // pointe │ │ │ │ +000eb9a0: 7220 746f 2061 7272 6179 3c2f 7370 616e r to array
.
int __size; │ │ │ │ +000eba00: 2020 2020 2020 2020 3c73 7061 6e20 636c // │ │ │ │ +000eba20: 2073 697a 6520 6f66 2074 6865 2061 7272 size of the arr │ │ │ │ +000eba30: 6179 3c2f 7370 616e 3e3c 2f64 6976 3e0a ay
. │ │ │ │ +000eba40: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
};
.
struct ns__Objects .
{
.< │ │ │ │ +000ebac0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +000ebad0: 3e20 2020 203c 7370 616e 2063 6c61 7373 > i │ │ │ │ +000ebaf0: 6e74 3c2f 7370 616e 3e20 5f5f 7369 7a65 nt __size │ │ │ │ +000ebb00: 3b20 2020 2020 2020 2020 2020 2020 2020 ; │ │ │ │ +000ebb10: 203c 7370 616e 2063 6c61 7373 3d22 636f // size o │ │ │ │ +000ebb30: 6620 7468 6520 6172 7261 793c 2f73 7061 f the array
.
< │ │ │ │ +000ebb60: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +000ebb70: 6f72 6422 3e73 7472 7563 7420 3c2f 7370 ord">struct __wrapper *ob │ │ │ │ +000ebb90: 6a65 6374 733b 203c 7370 616e 2063 6c61 jects; // │ │ │ │ +000ebbb0: 706f 696e 7465 7220 746f 2061 7272 6179 pointer to array │ │ │ │ +000ebbc0: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ │ +000ebbe0: 7d3b 3c2f 6469 763e 0a3c 2f64 6976 3e3c };
.
< │ │ │ │ +000ebbf0: 212d 2d20 6672 6167 6d65 6e74 202d 2d3e !-- fragment --> │ │ │ │ +000ebc00: 3c70 3e54 6869 7320 6578 616d 706c 6520

This example │ │ │ │ +000ebc10: 7573 6573 2061 6e20 2269 6e76 6973 6962 uses an "invisib │ │ │ │ +000ebc20: 6c65 2220 7479 7065 203c 636f 6465 3e5f le" type _ │ │ │ │ +000ebc30: 5f77 7261 7070 6572 3c2f 636f 6465 3e20 _wrapper │ │ │ │ +000ebc40: 616e 6420 6d65 6d62 6572 203c 636f 6465 and member __array, │ │ │ │ +000ebc60: 2077 6869 6368 2073 7461 7274 2077 6974 which start wit │ │ │ │ +000ebc70: 6820 6120 646f 7562 6c65 2075 6e64 6572 h a double under │ │ │ │ +000ebc80: 7363 6f72 652e 2054 6865 7365 206e 616d score. These nam │ │ │ │ +000ebc90: 6573 2061 7265 206e 6576 6572 2076 6973 es are never vis │ │ │ │ +000ebca0: 6962 6c65 2069 6e20 7365 7269 616c 697a ible in serializ │ │ │ │ +000ebcb0: 6564 2058 4d4c 2e20 5468 6520 3c63 6f64 ed XML. The __type │ │ │ │ +000ebcd0: 6d65 6d62 6572 206f 6620 3c63 6f64 653e member of │ │ │ │ +000ebce0: 5f5f 7772 6170 7065 723c 2f63 6f64 653e __wrapper │ │ │ │ +000ebcf0: 2069 7320 6120 3c63 6f64 653e 534f 4150 is a SOAP │ │ │ │ +000ebd00: 5f54 5950 455f 543c 2f63 6f64 653e 2076 _TYPE_T v │ │ │ │ +000ebd10: 616c 7565 2074 6861 7420 6964 656e 7469 alue that identi │ │ │ │ +000ebd20: 6669 6573 2074 6865 2074 7970 6520 3c63 fies the type T tha │ │ │ │ +000ebd40: 7420 3c63 6f64 653e 5f5f 6974 656d 3c2f t __item points to, │ │ │ │ +000ebd60: 2073 6565 2053 6563 7469 6f6e 203c 6120 see Section Void pointer s │ │ │ │ +000ebda0: 6572 6961 6c69 7a61 7469 6f6e 3c2f 613e erialization │ │ │ │ +000ebdb0: 2e3c 2f70 3e0a 3c70 3ef0 9f94 9d20 3c61 .

.

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

.

│ │ │ │ +000ebdf0: 3c61 2063 6c61 7373 3d22 616e 6368 6f72 .How to ch │ │ │ │ +000ebe20: 616e 6765 2074 6865 2074 6167 206e 616d ange the tag nam │ │ │ │ +000ebe30: 6573 206f 6620 6172 7261 7920 6974 656d es of array item │ │ │ │ +000ebe40: 2065 6c65 6d65 6e74 733c 2f68 333e 0a3c elements

.< │ │ │ │ +000ebe50: 703e 5468 6520 6465 6661 756c 7420 584d p>The default XM │ │ │ │ +000ebe60: 4c20 656c 656d 656e 7420 7461 6720 6e61 L element tag na │ │ │ │ +000ebe70: 6d65 2066 6f72 2061 7272 6179 2065 6c65 me for array ele │ │ │ │ +000ebe80: 6d65 6e74 7320 6973 203c 656d 3e3c 636f ments is item
, which can b │ │ │ │ +000ebeb0: 6520 6368 616e 6765 642e 2054 6865 203c e changed. The < │ │ │ │ +000ebec0: 636f 6465 3e5f 5f70 7472 3c2f 636f 6465 code>__ptr member in a st │ │ │ │ +000ebee0: 7275 6374 206f 7220 636c 6173 7320 6f66 ruct or class of │ │ │ │ +000ebef0: 2061 2064 796e 616d 6963 2061 7272 6179 a dynamic array │ │ │ │ +000ebf00: 206d 6179 2068 6176 6520 616e 206f 7074 may have an opt │ │ │ │ +000ebf10: 696f 6e61 6c20 7375 6666 6978 2070 6172 ional suffix par │ │ │ │ +000ebf20: 7420 7468 6174 2073 7065 6369 6669 6573 t that specifies │ │ │ │ +000ebf30: 2074 6865 206e 616d 6520 6f66 2074 6865 the name of the │ │ │ │ +000ebf40: 2065 6c65 6d65 6e74 2074 6167 2069 6e20 element tag in │ │ │ │ +000ebf50: 584d 4c2e 2054 6861 7420 6973 2c20 7468 XML. That is, th │ │ │ │ +000ebf60: 6520 7375 6666 6978 2069 7320 7061 7274 e suffix is part │ │ │ │ +000ebf70: 206f 6620 7468 6520 3c63 6f64 653e 5f5f of the __ │ │ │ │ +000ebf80: 7074 723c 2f63 6f64 653e 206d 656d 6265 ptr membe │ │ │ │ +000ebf90: 7220 6e61 6d65 3a3c 2f70 3e0a 3c64 6976 r name:

.
Type *__ptra │ │ │ │ +000ebfd0: 7272 6179 5f65 6c74 5f6e 616d 653c 2f64 rray_elt_name.

Co │ │ │ │ +000ec000: 6e73 6964 6572 2066 6f72 2065 7861 6d70 nsider for examp │ │ │ │ +000ec010: 6c65 3a3c 2f70 3e0a 3c64 6976 2063 6c61 le:

.
│ │ │ │ +000ec040: 3c73 7061 6e20 636c 6173 733d 226b 6579 struct ArrayOfstrin │ │ │ │ +000ec070: 6720 3c2f 6469 763e 0a3c 6469 7620 636c g
.
{.
char* │ │ │ │ +000ec0d0: 2a5f 5f70 7472 7374 7269 6e67 3b3c 2f64 *__ptrstring;.
int _ │ │ │ │ +000ec120: 5f73 697a 653b 3c2f 6469 763e 0a3c 6469 _size;
.} │ │ │ │ +000ec140: 3b3c 2f64 6976 3e0a 3c2f 6469 763e 3c21 ;
.
< │ │ │ │ +000ec160: 703e 5468 6520 6172 7261 7920 6973 2073 p>The array is s │ │ │ │ +000ec170: 6572 6961 6c69 7a65 6420 6173 3a3c 2f70 erialized as:

.
< │ │ │ │ +000ec1c0: 3c73 7061 6e20 636c 6173 733d 226b 6579 SOAP-E │ │ │ │ +000ec1e0: 4e43 3a41 7272 6179 3c2f 7370 616e 3e20 NC:Array │ │ │ │ +000ec1f0: 3c73 7061 6e20 636c 6173 733d 226b 6579 SOAP-ENC:a │ │ │ │ +000ec210: 7272 6179 5479 7065 3c2f 7370 616e 3e3d rrayType= │ │ │ │ +000ec220: 3c73 7061 6e20 636c 6173 733d 2273 7472 &quo │ │ │ │ +000ec240: 743b 7873 643a 7374 7269 6e67 5b32 5d26 t;xsd:string[2]& │ │ │ │ +000ec250: 7175 6f74 3b3c 2f73 7061 6e3e 2667 743b quot;> │ │ │ │ +000ec260: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
< │ │ │ │ +000ec280: 3c73 7061 6e20 636c 6173 733d 226b 6579 string │ │ │ │ +000ec2a0: 3c2f 7370 616e 3e26 6774 3b3c 7370 616e >Hello< │ │ │ │ +000ec2d0: 3b2f 3c73 7061 6e20 636c 6173 733d 226b ;/stri │ │ │ │ +000ec2f0: 6e67 3c2f 7370 616e 3e26 6774 3b20 3c2f ng> .
<string>Wo │ │ │ │ +000ec360: 726c 643c 2f73 7061 6e3e 266c 743b 2f3c rld</< │ │ │ │ +000ec370: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +000ec380: 6f72 6474 7970 6522 3e73 7472 696e 673c ordtype">string< │ │ │ │ +000ec390: 2f73 7061 6e3e 2667 743b 203c 2f64 6976 /span>>
.
</SOAP-ENC:Arra │ │ │ │ +000ec3e0: 793c 2f73 7061 6e3e 2667 743b 3c2f 6469 y>.

SOAP 1.1/1.2 │ │ │ │ +000ec420: 2064 6f65 7320 6e6f 7420 6d61 6e64 6174 does not mandat │ │ │ │ +000ec430: 6520 6120 7370 6563 6966 6963 2074 6167 e a specific tag │ │ │ │ +000ec440: 206e 616d 6520 666f 7220 534f 4150 2d65 name for SOAP-e │ │ │ │ +000ec450: 6e63 6f64 6564 2061 7272 6179 2065 6c65 ncoded array ele │ │ │ │ +000ec460: 6d65 6e74 7320 616e 6420 7468 6520 736f ments and the so │ │ │ │ +000ec470: 6170 6370 7032 2d67 656e 6572 6174 6564 apcpp2-generated │ │ │ │ +000ec480: 2073 6572 6961 6c69 7a65 7273 2077 696c serializers wil │ │ │ │ +000ec490: 6c20 6967 6e6f 7265 2074 6865 206e 616d l ignore the nam │ │ │ │ +000ec4a0: 6520 7573 6564 2074 6f20 6974 656d 697a e used to itemiz │ │ │ │ +000ec4b0: 6520 534f 4150 2d65 6e63 6f64 6564 2061 e SOAP-encoded a │ │ │ │ +000ec4c0: 7272 6179 2076 616c 7565 732e 3c2f 703e rray values.

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

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

.

< │ │ │ │ +000ec530: 2f61 3e0a 6261 7365 3634 4269 6e61 7279 /a>.base64Binary │ │ │ │ +000ec540: 2073 6572 6961 6c69 7a61 7469 6f6e 3c2f serialization.

The < │ │ │ │ +000ec560: 636f 6465 3e62 6173 6536 3442 696e 6172 code>base64Binar │ │ │ │ +000ec570: 793c 2f63 6f64 653e 3c2f 656d 3e20 5853 y XS │ │ │ │ +000ec580: 4420 7479 7065 2069 7320 696e 7472 6f64 D type is introd │ │ │ │ +000ec590: 7563 6564 2069 6e20 616e 2069 6e74 6572 uced in an inter │ │ │ │ +000ec5a0: 6661 6365 2068 6561 6465 7220 6669 6c65 face header file │ │ │ │ +000ec5b0: 2066 6f72 2073 6f61 7063 7070 3220 7573 for soapcpp2 us │ │ │ │ +000ec5c0: 696e 6720 6120 7374 7275 6374 206f 7220 ing a struct or │ │ │ │ +000ec5d0: 636c 6173 7320 7468 6174 2063 6f6e 7461 class that conta │ │ │ │ +000ec5e0: 696e 7320 616e 2061 7272 6179 206f 6620 ins an array of │ │ │ │ +000ec5f0: 3c63 6f64 653e 756e 7369 676e 6564 2063 unsigned c │ │ │ │ +000ec600: 6861 723c 2f63 6f64 653e 2076 616c 7565 har value │ │ │ │ +000ec610: 733a 3c2f 703e 0a3c 6469 7620 636c 6173 s:

.
.
{
│ │ │ │ +000ec6d0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
unsigned │ │ │ │ +000ec710: 203c 7370 616e 2063 6c61 7373 3d22 6b65 char< │ │ │ │ +000ec730: 2f73 7061 6e3e 202a 3c61 2063 6c61 7373 /span> *__ptr; .
int __size;
.
};.

T │ │ │ │ +000ec880: 6865 2061 6476 616e 7461 6765 206f 6620 he advantage of │ │ │ │ +000ec890: 7468 6973 2073 7472 7563 7420 6f72 2063 this struct or c │ │ │ │ +000ec8a0: 6c61 7373 2069 7320 7468 6520 6162 696c lass is the abil │ │ │ │ +000ec8b0: 6974 7920 746f 2073 6572 6961 6c69 7a65 ity to serialize │ │ │ │ +000ec8c0: 7220 7261 7720 6269 6e61 7279 2064 6174 r raw binary dat │ │ │ │ +000ec8d0: 6120 6672 6f6d 206d 656d 6f72 792c 2073 a from memory, s │ │ │ │ +000ec8e0: 696e 6365 2074 6865 2073 6f61 7063 7070 ince the soapcpp │ │ │ │ +000ec8f0: 322d 6765 6e65 7261 7465 6420 7365 7269 2-generated seri │ │ │ │ +000ec900: 616c 697a 6572 2063 6f6e 7665 7274 7320 alizer converts │ │ │ │ +000ec910: 7468 6520 6269 6e61 7279 2064 6174 6120 the binary data │ │ │ │ +000ec920: 746f 2f66 726f 6d20 6261 7365 3634 2069 to/from base64 i │ │ │ │ +000ec930: 6e20 584d 4c2e 3c2f 703e 0a3c 703e 546f n XML.

.

To │ │ │ │ +000ec940: 2069 6e74 726f 6475 6365 2061 206e 6577 introduce a new │ │ │ │ +000ec950: 2058 4d4c 2073 6368 656d 6120 7479 7065 XML schema type │ │ │ │ +000ec960: 2064 6572 6976 6564 2066 726f 6d20 3c65 derived from base64Bi │ │ │ │ +000ec980: 6e61 7279 3c2f 636f 6465 3e3c 2f65 6d3e nary │ │ │ │ +000ec990: 2075 7365 2074 6865 2073 616d 6520 7374 use the same st │ │ │ │ +000ec9a0: 7275 6374 206f 7220 636c 6173 7320 7374 ruct or class st │ │ │ │ +000ec9b0: 7275 6374 7572 652c 2062 7574 2077 6974 ructure, but wit │ │ │ │ +000ec9c0: 6820 616e 6f74 6865 7220 6e61 6d65 2e20 h another name. │ │ │ │ +000ec9d0: 466f 7220 6578 616d 706c 653a 3c2f 703e For example:

│ │ │ │ +000ec9e0: 0a3c 6469 7620 636c 6173 733d 2266 7261 .
s │ │ │ │ +000eca20: 7472 7563 7420 3c2f 7370 616e 3e6e 735f truct ns_ │ │ │ │ +000eca30: 5f62 696e 6172 793c 2f64 6976 3e0a 3c64 _binary
. │ │ │ │ +000eca50: 7b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 {
.
unsigned │ │ │ │ +000eca90: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c char *_ │ │ │ │ +000ecac0: 5f70 7472 3b20 3c2f 6469 763e 0a3c 6469 _ptr;
. │ │ │ │ +000ecae0: 2020 203c 7370 616e 2063 6c61 7373 3d22 int │ │ │ │ +000ecb00: 3c2f 7370 616e 3e20 5f5f 7369 7a65 3b20 __size; │ │ │ │ +000ecb10: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
};
.

The │ │ │ │ +000ecb50: 7265 7375 6c74 696e 6720 584d 4c20 7363 resulting XML sc │ │ │ │ +000ecb60: 6865 6d61 2074 7970 6520 6973 3a3c 2f70 hema type is:

.
< │ │ │ │ +000ecbb0: 3c73 7061 6e20 636c 6173 733d 226b 6579 simple │ │ │ │ +000ecbd0: 5479 7065 3c2f 7370 616e 3e20 3c73 7061 Type name=" │ │ │ │ +000ecc20: 6269 6e61 7279 2671 756f 743b 3c2f 7370 binary">
. │ │ │ │ +000ecc50: 2020 266c 743b 3c73 7061 6e20 636c 6173 < │ │ │ │ +000ecc70: 7265 7374 7269 6374 696f 6e3c 2f73 7061 restriction base="xsd:base6 │ │ │ │ +000eccd0: 3442 696e 6172 7926 7175 6f74 3b3c 2f73 4Binary"
>
.< │ │ │ │ +000eccf0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +000ecd00: 3e20 2026 6c74 3b2f 3c73 7061 6e20 636c > </restriction>
.< │ │ │ │ +000ecd40: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +000ecd50: 3e26 6c74 3b2f 3c73 7061 6e20 636c 6173 ></ │ │ │ │ +000ecd70: 7369 6d70 6c65 5479 7065 3c2f 7370 616e simpleType>
.

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

. │ │ │ │ +000ecde0: 3c68 323e 3c61 2063 6c61 7373 3d22 616e

.hexBin │ │ │ │ +000ece10: 6172 7920 7365 7269 616c 697a 6174 696f ary serializatio │ │ │ │ +000ece20: 6e3c 2f68 323e 0a3c 703e 5468 6520 3c65 n

.

The base64Bi │ │ │ │ +000ece40: 6e61 7279 3c2f 636f 6465 3e3c 2f65 6d3e nary │ │ │ │ +000ece50: 2058 5344 2074 7970 6520 6973 2069 6e74 XSD type is int │ │ │ │ +000ece60: 726f 6475 6365 6420 696e 2061 6e20 696e roduced in an in │ │ │ │ +000ece70: 7465 7266 6163 6520 6865 6164 6572 2066 terface header f │ │ │ │ +000ece80: 696c 6520 666f 7220 736f 6170 6370 7032 ile for soapcpp2 │ │ │ │ +000ece90: 2075 7369 6e67 2061 2073 7472 7563 7420 using a struct │ │ │ │ +000ecea0: 6f72 2063 6c61 7373 2074 6861 7420 636f or class that co │ │ │ │ +000eceb0: 6e74 6169 6e73 2061 6e20 6172 7261 7920 ntains an array │ │ │ │ +000ecec0: 6f66 203c 636f 6465 3e75 6e73 6967 6e65 of unsigne │ │ │ │ +000eced0: 6420 6368 6172 3c2f 636f 6465 3e20 7661 d char va │ │ │ │ +000ecee0: 6c75 6573 3a3c 2f70 3e0a 3c64 6976 2063 lues:

.
│ │ │ │ +000ecf00: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
struct < │ │ │ │ +000ecf30: 2f73 7061 6e3e 3c61 2063 6c61 7373 3d22 /span>xsd__h │ │ │ │ +000ecf70: 6578 4269 6e61 7279 3c2f 613e 203c 2f64 exBinary .
{
. │ │ │ │ +000ecfb0: 2020 2020 3c73 7061 6e20 636c 6173 733d un │ │ │ │ +000ecfd0: 7369 676e 6564 3c2f 7370 616e 3e20 3c73 signed char *__ptr │ │ │ │ +000ed060: 3c2f 613e 3b20 3c2f 6469 763e 0a3c 6469 ;
. │ │ │ │ +000ed080: 2020 203c 7370 616e 2063 6c61 7373 3d22 int │ │ │ │ +000ed0a0: 3c2f 7370 616e 3e20 3c61 2063 6c61 7373 __ │ │ │ │ +000ed100: 7369 7a65 3c2f 613e 3b20 3c2f 6469 763e size;
│ │ │ │ +000ed110: 0a3c 6469 7620 636c 6173 733d 226c 696e .
};
.

The advant │ │ │ │ +000ed150: 6167 6520 6f66 2074 6869 7320 7374 7275 age of this stru │ │ │ │ +000ed160: 6374 206f 7220 636c 6173 7320 6973 2074 ct or class is t │ │ │ │ +000ed170: 6865 2061 6269 6c69 7479 2074 6f20 7365 he ability to se │ │ │ │ +000ed180: 7269 616c 697a 6572 2072 6177 2062 696e rializer raw bin │ │ │ │ +000ed190: 6172 7920 6461 7461 2066 726f 6d20 6d65 ary data from me │ │ │ │ +000ed1a0: 6d6f 7279 2c20 7369 6e63 6520 7468 6520 mory, since the │ │ │ │ +000ed1b0: 736f 6170 6370 7032 2d67 656e 6572 6174 soapcpp2-generat │ │ │ │ +000ed1c0: 6564 2073 6572 6961 6c69 7a65 7220 636f ed serializer co │ │ │ │ +000ed1d0: 6e76 6572 7473 2074 6865 2062 696e 6172 nverts the binar │ │ │ │ +000ed1e0: 7920 6461 7461 2074 6f2f 6672 6f6d 2068 y data to/from h │ │ │ │ +000ed1f0: 6578 6164 6563 696d 616c 2069 6e20 584d exadecimal in XM │ │ │ │ +000ed200: 4c2e 3c2f 703e 0a3c 703e 4966 2061 2062 L.

.

If a b │ │ │ │ +000ed210: 696e 6172 7920 7479 7065 2073 7563 6820 inary type such │ │ │ │ +000ed220: 6173 203c 636f 6465 3e3c 6120 636c 6173 as xsd__base │ │ │ │ +000ed2a0: 3634 4269 6e61 7279 3c2f 613e 3c2f 636f 64Binary is already d │ │ │ │ +000ed2c0: 6566 696e 6564 2c20 7468 656e 2077 6520 efined, then we │ │ │ │ +000ed2d0: 6361 6e20 7369 6d70 6c79 2075 7365 2061 can simply use a │ │ │ │ +000ed2e0: 203c 636f 6465 3e74 7970 6564 6566 3c2f typedef to introdu │ │ │ │ +000ed300: 6365 2074 6865 2068 6578 2076 6172 6961 ce the hex varia │ │ │ │ +000ed310: 6e74 3a3c 2f70 3e0a 3c64 6976 2063 6c61 nt:

.
│ │ │ │ +000ed340: 3c73 7061 6e20 636c 6173 733d 226b 6579 class xsd__b │ │ │ │ +000ed3a0: 6173 6536 3442 696e 6172 793c 2f61 3e3c ase64Binary< │ │ │ │ +000ed3b0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
{ │ │ │ │ +000ed3e0: 7075 626c 6963 3c2f 7370 616e 3e3a 203c public: < │ │ │ │ +000ed3f0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
unsigned │ │ │ │ +000ed450: 6368 6172 3c2f 7370 616e 3e20 2a3c 6120 char *__ptr; │ │ │ │ +000ed4c0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
..< │ │ │ │ +000ed570: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +000ed580: 3e7d 3b20 3c2f 6469 763e 0a3c 6469 7620 >};
.
typedef xsd__ba │ │ │ │ +000ed600: 7365 3634 4269 6e61 7279 3c2f 613e 203c se64Binary < │ │ │ │ +000ed610: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +000ed620: 7265 663d 2273 7472 7563 7478 7364 5f5f ref="structxsd__ │ │ │ │ +000ed630: 5f5f 6865 785f 6269 6e61 7279 2e68 746d __hex_binary.htm │ │ │ │ +000ed640: 6c22 3e78 7364 5f5f 6865 7842 696e 6172 l">xsd__hexBinar │ │ │ │ +000ed650: 793c 2f61 3e3b 203c 7370 616e 2063 6c61 y; // │ │ │ │ +000ed670: 7365 7269 616c 697a 6573 2069 6e74 6f20 serializes into │ │ │ │ +000ed680: 6865 7820 636f 6e74 656e 743c 2f73 7061 hex content
.
< │ │ │ │ +000ed6a0: 212d 2d20 6672 6167 6d65 6e74 202d 2d3e !-- fragment --> │ │ │ │ +000ed6b0: 3c70 3e54 6869 7320 6c65 7473 2073 6f61

This lets soa │ │ │ │ +000ed6c0: 7063 7070 3220 6765 6e65 7261 7465 203c pcpp2 generate < │ │ │ │ +000ed6d0: 656d 3e3c 636f 6465 3e78 7364 3a62 6173 em>xsd:bas │ │ │ │ +000ed6e0: 6536 3442 696e 6172 793c 2f63 6f64 653e e64Binary │ │ │ │ +000ed6f0: 3c2f 656d 3e20 616e 6420 3c65 6d3e 3c63 and xsd:hexBinar │ │ │ │ +000ed710: 793c 2f63 6f64 653e 3c2f 656d 3e20 7365 y se │ │ │ │ +000ed720: 7269 616c 697a 6572 732e 3c2f 703e 0a3c rializers.

.< │ │ │ │ +000ed730: 703e f09f 949d 203c 6120 6872 6566 3d22 p>.... Back to table │ │ │ │ +000ed750: 206f 6620 636f 6e74 656e 7473 3c2f 613e of contents │ │ │ │ +000ed760: 3c2f 703e 0a3c 6832 3e3c 6120 636c 6173

.

.SOA │ │ │ │ +000ed790: 5020 5250 4320 656e 636f 6465 6420 7665 P RPC encoded ve │ │ │ │ +000ed7a0: 7273 7573 2064 6f63 756d 656e 742f 6c69 rsus document/li │ │ │ │ +000ed7b0: 7465 7261 6c20 7374 796c 653c 2f68 323e teral style

│ │ │ │ +000ed7c0: 0a3c 703e 534f 4150 2068 6173 2073 6576 .

SOAP has sev │ │ │ │ +000ed7d0: 6572 616c 2073 7479 6c65 733a 3c2f 703e eral styles:

│ │ │ │ +000ed7e0: 0a3c 756c 3e0a 3c6c 693e 534f 4150 2052 .

.

int (soap::f │ │ │ │ -0015c3b0: 7061 7273 653c 2f61 3e29 2873 7472 7563 parse)(struc │ │ │ │ -0015c3c0: 7420 736f 6170 202a 736f 6170 293c 2f63 t soap *soap)

.

This │ │ │ │ -0015c3e0: 2063 616c 6c62 6163 6b20 6973 2063 616c callback is cal │ │ │ │ -0015c3f0: 6c65 6420 6279 2074 6865 2065 6e67 696e led by the engin │ │ │ │ -0015c400: 6520 2861 7320 6120 636c 6965 6e74 206f e (as a client o │ │ │ │ -0015c410: 7220 7365 7276 6572 2920 746f 2072 6561 r server) to rea │ │ │ │ -0015c420: 6420 616e 6420 7061 7273 6520 4854 5450 d and parse HTTP │ │ │ │ -0015c430: 2068 6561 6465 7273 206f 7220 4d49 4d45 headers or MIME │ │ │ │ -0015c440: 2068 6561 6465 7273 2e20 5768 656e 2072 headers. When r │ │ │ │ -0015c450: 6564 6566 696e 6564 2c20 7468 6973 2066 edefined, this f │ │ │ │ -0015c460: 756e 6374 696f 6e20 7368 6f75 6c64 2061 unction should a │ │ │ │ -0015c470: 7420 7265 6164 206f 7220 736b 6970 2074 t read or skip t │ │ │ │ -0015c480: 6865 2065 6e74 6972 6520 4854 5450 2068 he entire HTTP h │ │ │ │ -0015c490: 6561 6465 7220 746f 2072 6561 6368 2074 eader to reach t │ │ │ │ -0015c4a0: 6865 206d 6573 7361 6765 2062 6f64 792e he message body. │ │ │ │ -0015c4b0: 2046 756e 6374 696f 6e20 3c63 6f64 653e Function │ │ │ │ -0015c4c0: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap_ge │ │ │ │ -0015c530: 746c 696e 653c 2f61 3e3c 2f63 6f64 653e tline │ │ │ │ -0015c540: 2069 7320 7573 6564 2062 7920 7468 6973 is used by this │ │ │ │ -0015c550: 2063 616c 6c62 6163 6b20 746f 2072 6561 callback to rea │ │ │ │ -0015c560: 6420 6561 6368 2068 6561 6465 7220 6c69 d each header li │ │ │ │ -0015c570: 6e65 2069 6e74 6f20 616e 2069 6e74 6572 ne into an inter │ │ │ │ -0015c580: 6e61 6c20 6275 6666 6572 203c 636f 6465 nal buffer soap::m │ │ │ │ -0015c650: 7367 6275 663c 2f61 3e3c 2f63 6f64 653e sgbuf │ │ │ │ -0015c660: 2077 6974 6820 3c63 6f64 653e 3c61 2063 with soap_getlin │ │ │ │ -0015c6e0: 653c 2f61 3e28 736f 6170 2c20 736f 6170 e(soap, soap │ │ │ │ -0015c6f0: 2d26 6774 3b6d 7367 6275 662c 2073 697a ->msgbuf, siz │ │ │ │ -0015c700: 656f 6628 736f 6170 2d26 6774 3b6d 7367 eof(soap->msg │ │ │ │ -0015c710: 6275 6629 293c 2f63 6f64 653e 2e20 5265 buf)). Re │ │ │ │ -0015c720: 7475 726e 7320 3c63 6f64 653e 2353 4f41 turns #SOA │ │ │ │ -0015c730: 505f 4f4b 3c2f 636f 6465 3e2c 206f 7220 P_OK, or │ │ │ │ -0015c740: 6120 6753 4f41 5020 6572 726f 7220 636f a gSOAP error co │ │ │ │ -0015c750: 6465 2e20 5468 6520 6275 696c 742d 696e de. The built-in │ │ │ │ -0015c760: 2066 756e 6374 696f 6e20 6173 7369 676e function assign │ │ │ │ -0015c770: 6564 2074 6f20 3c63 6f64 653e 3c61 2063 ed to s │ │ │ │ -0015c810: 6f61 703a 3a66 7061 7273 653c 2f61 3e3c oap::fparse< │ │ │ │ -0015c820: 2f63 6f64 653e 2069 7320 3c63 6f64 653e /code> is │ │ │ │ -0015c830: 6874 7470 5f70 6172 7365 3c2f 636f 6465 http_parse.

.

< │ │ │ │ -0015c870: 2f61 3e0a 6670 6172 7365 6864 723c 2f68 /a>.fparsehdr.

int │ │ │ │ -0015c890: 283c 6120 636c 6173 733d 2265 6c22 2068 (soap::fpa │ │ │ │ -0015c940: 7273 6568 6472 3c2f 613e 2928 7374 7275 rsehdr)(stru │ │ │ │ -0015c950: 6374 2073 6f61 7020 2a73 6f61 702c 2063 ct soap *soap, c │ │ │ │ -0015c960: 6f6e 7374 2063 6861 7220 2a6b 6579 2c20 onst char *key, │ │ │ │ -0015c970: 636f 6e73 7420 6368 6172 202a 7661 6c29 const char *val) │ │ │ │ -0015c980: 3c2f 636f 6465 3e3c 2f70 3e0a 3c70 3e54

.

T │ │ │ │ -0015c990: 6869 7320 6361 6c6c 6261 636b 2069 7320 his callback is │ │ │ │ -0015c9a0: 6361 6c6c 6564 2062 7920 3c63 6f64 653e called by │ │ │ │ -0015c9b0: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap::fparse< │ │ │ │ -0015ca50: 2f61 3e3c 2f63 6f64 653e 2c20 636f 6e73 /a>, cons │ │ │ │ -0015ca60: 756d 6573 2061 6e20 4854 5450 2068 6561 umes an HTTP hea │ │ │ │ -0015ca70: 6465 7220 7468 6174 2069 7320 7370 6c69 der that is spli │ │ │ │ -0015ca80: 7420 696e 2061 206b 6579 2d76 616c 7565 t in a key-value │ │ │ │ -0015ca90: 2070 6169 7220 616e 6420 7570 6461 7465 pair and update │ │ │ │ -0015caa0: 7320 7468 6520 3c63 6f64 653e 3c61 2063 s the soap │ │ │ │ -0015cb00: 3c2f 636f 6465 3e20 636f 6e74 6578 7420 context │ │ │ │ -0015cb10: 7374 6174 6520 6163 636f 7264 696e 676c state accordingl │ │ │ │ -0015cb20: 792e 2054 6865 2063 6f6e 7465 7874 2069 y. The context i │ │ │ │ -0015cb30: 7320 7570 6461 7465 6420 7769 7468 2074 s updated with t │ │ │ │ -0015cb40: 6865 2048 5454 5020 6865 6164 6572 2069 he HTTP header i │ │ │ │ -0015cb50: 6e66 6f72 6d61 7469 6f6e 2072 6563 6569 nformation recei │ │ │ │ -0015cb60: 7665 642c 2062 7574 2048 5454 5020 6865 ved, but HTTP he │ │ │ │ -0015cb70: 6164 6572 7320 6172 6520 6e6f 7420 6c69 aders are not li │ │ │ │ -0015cb80: 7465 7261 6c6c 7920 7265 7461 696e 6564 terally retained │ │ │ │ -0015cb90: 2062 7920 7468 6520 656e 6769 6e65 2e20 by the engine. │ │ │ │ -0015cba0: 5265 7475 726e 7320 3c63 6f64 653e 2353 Returns #S │ │ │ │ -0015cbb0: 4f41 505f 4f4b 3c2f 636f 6465 3e20 6f72 OAP_OK or │ │ │ │ -0015cbc0: 203c 636f 6465 3e23 534f 4150 5f53 544f #SOAP_STO │ │ │ │ -0015cbd0: 503c 2f63 6f64 653e 2074 6f20 7072 6576 P to prev │ │ │ │ -0015cbe0: 656e 7420 6675 7274 6865 7220 7265 6164 ent further read │ │ │ │ -0015cbf0: 696e 6720 6f66 2074 6865 2048 5454 5020 ing of the HTTP │ │ │ │ -0015cc00: 626f 6479 2c20 6f72 2061 203c 636f 6465 body, or a soap_status (int) e │ │ │ │ -0015cce0: 7272 6f72 2063 6f64 652e 2054 6865 2062 rror code. The b │ │ │ │ -0015ccf0: 7569 6c74 2d69 6e20 6675 6e63 7469 6f6e uilt-in function │ │ │ │ -0015cd00: 2061 7373 6967 6e65 6420 746f 203c 636f assigned to soap::f │ │ │ │ -0015cdc0: 7061 7273 6568 6472 3c2f 613e 3c2f 636f parsehdr is htt │ │ │ │ -0015cde0: 705f 7061 7273 655f 6865 6164 6572 3c2f p_parse_header.

.

< │ │ │ │ -0015ce00: 6120 636c 6173 733d 2261 6e63 686f 7222 a class="anchor" │ │ │ │ -0015ce10: 2069 643d 2261 7574 6f74 6f63 5f6d 6433 id="autotoc_md3 │ │ │ │ -0015ce20: 3322 3e3c 2f61 3e0a 6667 6574 3c2f 6833 3">.fget

.

int ( │ │ │ │ -0015ce40: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap::fget │ │ │ │ -0015cf10: 2928 7374 7275 6374 2073 6f61 7020 2a73 )(struct soap *s │ │ │ │ -0015cf20: 6f61 7029 3c2f 636f 6465 3e3c 2f70 3e0a oap)

. │ │ │ │ -0015cf30: 3c70 3e54 6869 7320 6361 6c6c 6261 636b

This callback │ │ │ │ -0015cf40: 2069 7320 6361 6c6c 6564 2062 7920 7468 is called by th │ │ │ │ -0015cf50: 6520 7365 7276 6963 6520 6469 7370 6174 e service dispat │ │ │ │ -0015cf60: 6368 6572 2077 6865 6e20 616e 2048 5454 cher when an HTT │ │ │ │ -0015cf70: 5020 4745 5420 7265 7175 6573 7420 6973 P GET request is │ │ │ │ -0015cf80: 2070 656e 6469 6e67 2e20 5265 6465 6669 pending. Redefi │ │ │ │ -0015cf90: 6e65 2074 6869 7320 6361 6c6c 6261 636b ne this callback │ │ │ │ -0015cfa0: 2074 6f20 7265 7370 6f6e 6420 746f 2048 to respond to H │ │ │ │ -0015cfb0: 5454 5020 4745 5420 7265 7175 6573 7473 TTP GET requests │ │ │ │ -0015cfc0: 2077 6974 6820 636f 6e74 656e 742c 2073 with content, s │ │ │ │ -0015cfd0: 6565 2074 6865 203c 636f 6465 3e3c 6120 ee the ht │ │ │ │ -0015d060: 7470 5f67 6574 3c2f 613e 3c2f 636f 6465 tp_get HTTP GET plugi │ │ │ │ -0015d080: 6e20 666f 7220 6d6f 7265 2064 6574 6169 n for more detai │ │ │ │ -0015d090: 6c73 2e20 5265 7475 726e 7320 3c63 6f64 ls. Returns #SOAP_OK or a so │ │ │ │ -0015d170: 6170 5f73 7461 7475 733c 2f61 3e3c 2f63 ap_status (int) error │ │ │ │ -0015d190: 2063 6f64 652e 2054 6865 2062 7569 6c74 code. The built │ │ │ │ -0015d1a0: 2d69 6e20 6675 6e63 7469 6f6e 2061 7373 -in function ass │ │ │ │ -0015d1b0: 6967 6e65 6420 746f 203c 636f 6465 3e3c igned to < │ │ │ │ -0015d1c0: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ -0015d1d0: 663d 2267 726f 7570 5f5f 6772 6f75 705f f="group__group_ │ │ │ │ -0015d1e0: 5f63 616c 6c62 6163 6b73 2e68 746d 6c23 _callbacks.html# │ │ │ │ -0015d1f0: 6761 6530 3232 3230 3466 6637 3030 3464 gae022204ff7004d │ │ │ │ -0015d200: 6632 6435 6163 3965 3038 3363 6262 3562 f2d5ac9e083cbb5b │ │ │ │ -0015d210: 3136 2220 7469 746c 653d 2243 616c 6c62 16" title="Callb │ │ │ │ -0015d220: 6163 6b20 746f 2069 6d70 6c65 6d65 6e74 ack to implement │ │ │ │ -0015d230: 206c 6f67 6963 2061 7420 7468 6520 7365 logic at the se │ │ │ │ -0015d240: 7276 6572 2d73 6964 6520 746f 2073 6572 rver-side to ser │ │ │ │ -0015d250: 7665 2072 6573 706f 6e73 6573 2074 6f20 ve responses to │ │ │ │ -0015d260: 4854 5450 2047 4554 2072 6571 7565 7374 HTTP GET request │ │ │ │ -0015d270: 7320 6672 6f6d 2063 6c69 656e 7473 2e22 s from clients." │ │ │ │ -0015d280: 3e73 6f61 703a 3a66 6765 743c 2f61 3e3c >soap::fget< │ │ │ │ -0015d290: 2f63 6f64 653e 2069 7320 7468 6520 696e /code> is the in │ │ │ │ -0015d2a0: 7465 726e 616c 2073 7461 7469 6320 6675 ternal static fu │ │ │ │ -0015d2b0: 6e63 7469 6f6e 203c 636f 6465 3e68 7474 nction htt │ │ │ │ -0015d2c0: 705f 6765 743c 2f63 6f64 653e 2074 6861 p_get tha │ │ │ │ -0015d2d0: 7420 7265 7475 726e 7320 7468 6520 3c63 t returns the #SOAP_GET_ME │ │ │ │ -0015d2f0: 5448 4f44 3c2f 636f 6465 3e20 6572 726f THOD erro │ │ │ │ -0015d300: 722e 3c2f 703e 0a3c 6833 3e3c 6120 636c r.

.

< │ │ │ │ -0015d330: 2f61 3e0a 6670 7574 3c2f 6833 3e0a 3c70 /a>.fput

.

int (so │ │ │ │ -0015d410: 6170 3a3a 6670 7574 3c2f 613e 2928 7374 ap::fput)(st │ │ │ │ -0015d420: 7275 6374 2073 6f61 7020 2a73 6f61 7029 ruct soap *soap) │ │ │ │ -0015d430: 3c2f 636f 6465 3e3c 2f70 3e0a 3c70 3e54

.

T │ │ │ │ -0015d440: 6869 7320 6361 6c6c 6261 636b 2069 7320 his callback is │ │ │ │ -0015d450: 6361 6c6c 6564 2062 7920 7468 6520 7365 called by the se │ │ │ │ -0015d460: 7276 6963 6520 6469 7370 6174 6368 6572 rvice dispatcher │ │ │ │ -0015d470: 2077 6865 6e20 616e 2048 5454 5020 5055 when an HTTP PU │ │ │ │ -0015d480: 5420 7265 7175 6573 7420 6973 2070 656e T request is pen │ │ │ │ -0015d490: 6469 6e67 2e20 5265 6465 6669 6e65 2074 ding. Redefine t │ │ │ │ -0015d4a0: 6869 7320 6361 6c6c 6261 636b 2074 6f20 his callback to │ │ │ │ -0015d4b0: 7265 7370 6f6e 6420 746f 2048 5454 5020 respond to HTTP │ │ │ │ -0015d4c0: 5055 5420 7265 7175 6573 7473 2c20 7365 PUT requests, se │ │ │ │ -0015d4d0: 6520 7468 6520 3c63 6f64 653e 3c61 2063 e the ht │ │ │ │ -0015d560: 7470 5f70 6f73 743c 2f61 3e3c 2f63 6f64 tp_post HTTP POST plu │ │ │ │ -0015d580: 6769 6e20 666f 7220 6d6f 7265 2064 6574 gin for more det │ │ │ │ -0015d590: 6169 6c73 2e20 5265 7475 726e 7320 3c63 ails. Returns #SOAP_OK or a < │ │ │ │ -0015d5c0: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ -0015d5d0: 663d 2267 726f 7570 5f5f 6772 6f75 705f f="group__group_ │ │ │ │ -0015d5e0: 5f65 7272 6f72 732e 6874 6d6c 2367 6163 _errors.html#gac │ │ │ │ -0015d5f0: 3065 6164 6638 6637 3262 6163 6235 6234 0eadf8f72bacb5b4 │ │ │ │ -0015d600: 3162 3735 3062 6561 6563 6130 3434 3422 1b750beaeca0444" │ │ │ │ -0015d610: 2074 6974 6c65 3d22 5374 6174 7573 2061 title="Status a │ │ │ │ -0015d620: 6e64 2065 7272 6f72 2063 6f64 6573 2061 nd error codes a │ │ │ │ -0015d630: 7265 2069 6e74 2076 616c 7565 732c 2061 re int values, a │ │ │ │ -0015d640: 207a 6572 6f20 7661 6c75 6520 6f72 2023 zero value or # │ │ │ │ -0015d650: 534f 4150 5f4f 4b20 2830 2920 6d65 616e SOAP_OK (0) mean │ │ │ │ -0015d660: 7320 6e6f 2065 7272 6f72 2c2e 2e2e 223e s no error,..."> │ │ │ │ -0015d670: 736f 6170 5f73 7461 7475 733c 2f61 3e3c soap_status< │ │ │ │ -0015d680: 2f63 6f64 653e 2065 7272 6f72 2063 6f64 /code> error cod │ │ │ │ -0015d690: 652e 2054 6865 2062 7569 6c74 2d69 6e20 e. The built-in │ │ │ │ -0015d6a0: 6675 6e63 7469 6f6e 2061 7373 6967 6e65 function assigne │ │ │ │ -0015d6b0: 6420 746f 203c 636f 6465 3e3c 6120 636c d to soa │ │ │ │ -0015d780: 703a 3a66 7075 743c 2f61 3e3c 2f63 6f64 p::fput is the intern │ │ │ │ -0015d7a0: 616c 2073 7461 7469 6320 6675 6e63 7469 al static functi │ │ │ │ -0015d7b0: 6f6e 203c 636f 6465 3e68 7474 705f 7075 on http_pu │ │ │ │ -0015d7c0: 743c 2f63 6f64 653e 2074 6861 7420 7265 t that re │ │ │ │ -0015d7d0: 7475 726e 7320 7468 6520 3c63 6f64 653e turns the │ │ │ │ -0015d7e0: 2353 4f41 505f 5055 545f 4d45 5448 4f44 #SOAP_PUT_METHOD │ │ │ │ -0015d7f0: 3c2f 636f 6465 3e20 6572 726f 722e 3c2f error..

. │ │ │ │ -0015d830: 6670 6174 6368 3c2f 6833 3e0a 3c70 3e3c fpatch

.

< │ │ │ │ -0015d840: 636f 6465 3e69 6e74 2028 3c61 2063 6c61 code>int ( │ │ │ │ -0015d910: 736f 6170 3a3a 6670 6174 6368 3c2f 613e soap::fpatch │ │ │ │ -0015d920: 2928 7374 7275 6374 2073 6f61 7020 2a73 )(struct soap *s │ │ │ │ -0015d930: 6f61 7029 3c2f 636f 6465 3e3c 2f70 3e0a oap)

. │ │ │ │ -0015d940: 3c70 3e54 6869 7320 6361 6c6c 6261 636b

This callback │ │ │ │ -0015d950: 2069 7320 6361 6c6c 6564 2062 7920 7468 is called by th │ │ │ │ -0015d960: 6520 7365 7276 6963 6520 6469 7370 6174 e service dispat │ │ │ │ -0015d970: 6368 6572 2077 6865 6e20 616e 2048 5454 cher when an HTT │ │ │ │ -0015d980: 5020 5041 5443 4820 7265 7175 6573 7420 P PATCH request │ │ │ │ -0015d990: 6973 2070 656e 6469 6e67 2e20 5265 6465 is pending. Rede │ │ │ │ -0015d9a0: 6669 6e65 2074 6869 7320 6361 6c6c 6261 fine this callba │ │ │ │ -0015d9b0: 636b 2074 6f20 7265 7370 6f6e 6420 746f ck to respond to │ │ │ │ -0015d9c0: 2048 5454 5020 5041 5443 4820 7265 7175 HTTP PATCH requ │ │ │ │ -0015d9d0: 6573 7473 2c20 7365 6520 7468 6520 3c63 ests, see the http_post< │ │ │ │ -0015da70: 2f61 3e3c 2f63 6f64 653e 2048 5454 5020 /a> HTTP │ │ │ │ -0015da80: 504f 5354 2070 6c75 6769 6e20 666f 7220 POST plugin for │ │ │ │ -0015da90: 6d6f 7265 2064 6574 6169 6c73 2e20 5265 more details. Re │ │ │ │ -0015daa0: 7475 726e 7320 3c63 6f64 653e 2353 4f41 turns #SOA │ │ │ │ -0015dab0: 505f 4f4b 3c2f 636f 6465 3e20 6f72 2061 P_OK or a │ │ │ │ -0015dac0: 203c 636f 6465 3e3c 6120 636c 6173 733d soap_sta │ │ │ │ -0015db80: 7475 733c 2f61 3e3c 2f63 6f64 653e 2065 tus e │ │ │ │ -0015db90: 7272 6f72 2063 6f64 652e 2054 6865 2062 rror code. The b │ │ │ │ -0015dba0: 7569 6c74 2d69 6e20 6675 6e63 7469 6f6e uilt-in function │ │ │ │ -0015dbb0: 2061 7373 6967 6e65 6420 746f 203c 636f assigned to soap::f │ │ │ │ -0015dc90: 7061 7463 683c 2f61 3e3c 2f63 6f64 653e patch │ │ │ │ -0015dca0: 2069 7320 7468 6520 696e 7465 726e 616c is the internal │ │ │ │ -0015dcb0: 2073 7461 7469 6320 6675 6e63 7469 6f6e static function │ │ │ │ -0015dcc0: 203c 636f 6465 3e68 7474 705f 7061 7463 http_patc │ │ │ │ -0015dcd0: 683c 2f63 6f64 653e 2074 6861 7420 7265 h that re │ │ │ │ -0015dce0: 7475 726e 7320 7468 6520 3c63 6f64 653e turns the │ │ │ │ -0015dcf0: 2353 4f41 505f 5041 5443 485f 4d45 5448 #SOAP_PATCH_METH │ │ │ │ -0015dd00: 4f44 3c2f 636f 6465 3e20 6572 726f 722e OD error. │ │ │ │ -0015dd10: 3c2f 703e 0a3c 6833 3e3c 6120 636c 6173

.

.fdel

.

< │ │ │ │ -0015dd50: 636f 6465 3e69 6e74 2028 3c61 2063 6c61 code>int ( │ │ │ │ -0015de20: 736f 6170 3a3a 6664 656c 3c2f 613e 2928 soap::fdel)( │ │ │ │ -0015de30: 7374 7275 6374 2073 6f61 7020 2a73 6f61 struct soap *soa │ │ │ │ -0015de40: 7029 3c2f 636f 6465 3e3c 2f70 3e0a 3c70 p)

.

This callback i │ │ │ │ -0015de60: 7320 6361 6c6c 6564 2062 7920 7468 6520 s called by the │ │ │ │ -0015de70: 7365 7276 6963 6520 6469 7370 6174 6368 service dispatch │ │ │ │ -0015de80: 6572 2077 6865 6e20 616e 2048 5454 5020 er when an HTTP │ │ │ │ -0015de90: 4445 4c45 5445 2072 6571 7565 7374 2069 DELETE request i │ │ │ │ -0015dea0: 7320 7065 6e64 696e 672e 2052 6564 6566 s pending. Redef │ │ │ │ -0015deb0: 696e 6520 7468 6973 2063 616c 6c62 6163 ine this callbac │ │ │ │ -0015dec0: 6b20 746f 2072 6573 706f 6e64 2074 6f20 k to respond to │ │ │ │ -0015ded0: 4854 5450 2044 454c 4554 4520 7265 7175 HTTP DELETE requ │ │ │ │ -0015dee0: 6573 7473 2c20 7365 6520 7468 6520 3c63 ests, see the http_post< │ │ │ │ -0015df80: 2f61 3e3c 2f63 6f64 653e 2048 5454 5020 /a> HTTP │ │ │ │ -0015df90: 504f 5354 2070 6c75 6769 6e20 666f 7220 POST plugin for │ │ │ │ -0015dfa0: 6d6f 7265 2064 6574 6169 6c73 2e20 5265 more details. Re │ │ │ │ -0015dfb0: 7475 726e 7320 3c63 6f64 653e 2353 4f41 turns #SOA │ │ │ │ -0015dfc0: 505f 4f4b 3c2f 636f 6465 3e20 6f72 2061 P_OK or a │ │ │ │ -0015dfd0: 203c 636f 6465 3e3c 6120 636c 6173 733d soap_sta │ │ │ │ -0015e090: 7475 733c 2f61 3e3c 2f63 6f64 653e 2028 tus ( │ │ │ │ -0015e0a0: 696e 7429 2065 7272 6f72 2063 6f64 652e int) error code. │ │ │ │ -0015e0b0: 2054 6865 2062 7569 6c74 2d69 6e20 6675 The built-in fu │ │ │ │ -0015e0c0: 6e63 7469 6f6e 2061 7373 6967 6e65 6420 nction assigned │ │ │ │ -0015e0d0: 746f 203c 636f 6465 3e3c 6120 636c 6173 to s │ │ │ │ -0015e1a0: 6f61 703a 3a66 6465 6c3c 2f61 3e3c 2f63 oap::fdel is the inte │ │ │ │ -0015e1c0: 726e 616c 2073 7461 7469 6320 6675 6e63 rnal static func │ │ │ │ -0015e1d0: 7469 6f6e 203c 636f 6465 3e68 7474 705f tion http_ │ │ │ │ -0015e1e0: 6465 6c3c 2f63 6f64 653e 2074 6861 7420 del that │ │ │ │ -0015e1f0: 7265 7475 726e 7320 7468 6520 3c63 6f64 returns the #SOAP_DEL_METH │ │ │ │ -0015e210: 4f44 3c2f 636f 6465 3e20 6572 726f 722e OD error. │ │ │ │ -0015e220: 3c2f 703e 0a3c 6833 3e3c 6120 636c 6173

.

.fopt

.

< │ │ │ │ -0015e260: 636f 6465 3e69 6e74 2028 3c61 2063 6c61 code>int ( │ │ │ │ -0015e330: 736f 6170 3a3a 666f 7074 3c2f 613e 2928 soap::fopt)( │ │ │ │ -0015e340: 7374 7275 6374 2073 6f61 7020 2a73 6f61 struct soap *soa │ │ │ │ -0015e350: 7029 3c2f 636f 6465 3e3c 2f70 3e0a 3c70 p)

.

Called by the s │ │ │ │ -0015e370: 6572 7669 6365 2064 6973 7061 7463 6865 ervice dispatche │ │ │ │ -0015e380: 7220 7768 656e 2061 6e20 4854 5450 204f r when an HTTP O │ │ │ │ -0015e390: 5054 494f 4e20 7265 7175 6573 7420 6973 PTION request is │ │ │ │ -0015e3a0: 2070 656e 6469 6e67 2e20 5265 6465 6669 pending. Redefi │ │ │ │ -0015e3b0: 6e65 2074 6869 7320 6361 6c6c 6261 636b ne this callback │ │ │ │ -0015e3c0: 2074 6f20 7265 7370 6f6e 6420 746f 2048 to respond to H │ │ │ │ -0015e3d0: 5454 5020 4f50 5449 4f4e 2072 6571 7565 TTP OPTION reque │ │ │ │ -0015e3e0: 7374 732c 2073 6565 2074 6865 203c 636f sts, see the http_post HTTP P │ │ │ │ -0015e490: 4f53 5420 706c 7567 696e 2066 6f72 206d OST plugin for m │ │ │ │ -0015e4a0: 6f72 6520 6465 7461 696c 732e 2052 6574 ore details. Ret │ │ │ │ -0015e4b0: 7572 6e73 203c 636f 6465 3e23 534f 4150 urns #SOAP │ │ │ │ -0015e4c0: 5f4f 4b3c 2f63 6f64 653e 206f 7220 6120 _OK or a │ │ │ │ -0015e4d0: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 soap_stat │ │ │ │ -0015e590: 7573 3c2f 613e 3c2f 636f 6465 3e20 2869 us (i │ │ │ │ -0015e5a0: 6e74 2920 6572 726f 7220 636f 6465 2e20 nt) error code. │ │ │ │ -0015e5b0: 5468 6520 6275 696c 742d 696e 2066 756e The built-in fun │ │ │ │ -0015e5c0: 6374 696f 6e20 6173 7369 676e 6564 2074 ction assigned t │ │ │ │ -0015e5d0: 6f20 3c63 6f64 653e 3c61 2063 6c61 7373 o so │ │ │ │ -0015e6a0: 6170 3a3a 666f 7074 3c2f 613e 3c2f 636f ap::fopt is the inter │ │ │ │ -0015e6c0: 6e61 6c20 7374 6174 6963 2066 756e 6374 nal static funct │ │ │ │ -0015e6d0: 696f 6e20 3c63 6f64 653e 6874 7470 5f32 ion http_2 │ │ │ │ -0015e6e0: 3030 3c2f 636f 6465 3e20 7468 6174 2072 00 that r │ │ │ │ -0015e6f0: 6574 7572 6e73 2048 5454 5020 3230 3020 eturns HTTP 200 │ │ │ │ -0015e700: 4f4b 2e3c 2f70 3e0a 3c68 333e 3c61 2063 OK.

.

│ │ │ │ -0015e730: 3c2f 613e 0a66 6865 6164 3c2f 6833 3e0a .fhead

. │ │ │ │ -0015e740: 3c70 3e3c 636f 6465 3e69 6e74 2028 3c61

int (soap::fhead │ │ │ │ -0015e820: 2928 7374 7275 6374 2073 6f61 7020 2a73 )(struct soap *s │ │ │ │ -0015e830: 6f61 7029 3c2f 636f 6465 3e3c 2f70 3e0a oap)

. │ │ │ │ -0015e840: 3c70 3e54 6869 7320 6361 6c6c 6261 636b

This callback │ │ │ │ -0015e850: 2069 7320 6361 6c6c 6564 2062 7920 7468 is called by th │ │ │ │ -0015e860: 6520 7365 7276 6963 6520 6469 7370 6174 e service dispat │ │ │ │ -0015e870: 6368 6572 2077 6865 6e20 616e 2048 5454 cher when an HTT │ │ │ │ -0015e880: 5020 4845 4144 2072 6571 7565 7374 2069 P HEAD request i │ │ │ │ -0015e890: 7320 7065 6e64 696e 672e 2052 6564 6566 s pending. Redef │ │ │ │ -0015e8a0: 696e 6520 7468 6973 2063 616c 6c62 6163 ine this callbac │ │ │ │ -0015e8b0: 6b20 746f 2072 6573 706f 6e64 2074 6f20 k to respond to │ │ │ │ -0015e8c0: 4854 5450 2048 4541 4420 7265 7175 6573 HTTP HEAD reques │ │ │ │ -0015e8d0: 7473 206d 6f72 6520 7370 6563 6966 6963 ts more specific │ │ │ │ -0015e8e0: 616c 6c79 2e20 5265 7475 726e 7320 3c63 ally. Returns #SOAP_OK or a < │ │ │ │ -0015e910: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ -0015e920: 663d 2267 726f 7570 5f5f 6772 6f75 705f f="group__group_ │ │ │ │ -0015e930: 5f65 7272 6f72 732e 6874 6d6c 2367 6163 _errors.html#gac │ │ │ │ -0015e940: 3065 6164 6638 6637 3262 6163 6235 6234 0eadf8f72bacb5b4 │ │ │ │ -0015e950: 3162 3735 3062 6561 6563 6130 3434 3422 1b750beaeca0444" │ │ │ │ -0015e960: 2074 6974 6c65 3d22 5374 6174 7573 2061 title="Status a │ │ │ │ -0015e970: 6e64 2065 7272 6f72 2063 6f64 6573 2061 nd error codes a │ │ │ │ -0015e980: 7265 2069 6e74 2076 616c 7565 732c 2061 re int values, a │ │ │ │ -0015e990: 207a 6572 6f20 7661 6c75 6520 6f72 2023 zero value or # │ │ │ │ -0015e9a0: 534f 4150 5f4f 4b20 2830 2920 6d65 616e SOAP_OK (0) mean │ │ │ │ -0015e9b0: 7320 6e6f 2065 7272 6f72 2c2e 2e2e 223e s no error,..."> │ │ │ │ -0015e9c0: 736f 6170 5f73 7461 7475 733c 2f61 3e3c soap_status< │ │ │ │ -0015e9d0: 2f63 6f64 653e 2028 696e 7429 2065 7272 /code> (int) err │ │ │ │ -0015e9e0: 6f72 2063 6f64 652e 2054 6865 2062 7569 or code. The bui │ │ │ │ -0015e9f0: 6c74 2d69 6e20 6675 6e63 7469 6f6e 2061 lt-in function a │ │ │ │ -0015ea00: 7373 6967 6e65 6420 746f 203c 636f 6465 ssigned to soap::fhead< │ │ │ │ -0015eae0: 2f61 3e3c 2f63 6f64 653e 2069 7320 7468 /a> is th │ │ │ │ -0015eaf0: 6520 696e 7465 726e 616c 2073 7461 7469 e internal stati │ │ │ │ -0015eb00: 6320 6675 6e63 7469 6f6e 203c 636f 6465 c function http_200 │ │ │ │ -0015eb20: 2074 6861 7420 7265 7475 726e 7320 4854 that returns HT │ │ │ │ -0015eb30: 5450 2032 3030 204f 4b2e 3c2f 703e 0a3c TP 200 OK.

.< │ │ │ │ -0015eb40: 6833 3e3c 6120 636c 6173 733d 2261 6e63 h3>.ffor │ │ │ │ -0015eb70: 6d3c 2f68 333e 0a3c 703e 3c63 6f64 653e m.

│ │ │ │ -0015eb80: 696e 7420 283c 6120 636c 6173 733d 2265 int (soap: │ │ │ │ -0015ec50: 3a66 666f 726d 3c2f 613e 2928 7374 7275 :fform)(stru │ │ │ │ -0015ec60: 6374 2073 6f61 7020 2a73 6f61 7029 3c2f ct soap *soap)

.

Thi │ │ │ │ -0015ec80: 7320 6361 6c6c 6261 636b 2069 7320 6361 s callback is ca │ │ │ │ -0015ec90: 6c6c 6564 2062 7920 7468 6520 4854 5450 lled by the HTTP │ │ │ │ -0015eca0: 2046 4f52 4d20 6861 6e64 6c65 7220 706c FORM handler pl │ │ │ │ -0015ecb0: 7567 696e 2074 6f20 7061 7273 6520 4854 ugin to parse HT │ │ │ │ -0015ecc0: 4d4c 2066 6f72 6d73 2072 6563 6569 7665 ML forms receive │ │ │ │ -0015ecd0: 6420 7769 7468 2048 5454 5020 504f 5354 d with HTTP POST │ │ │ │ -0015ece0: 2061 6e64 2050 5554 2072 6571 7565 7374 and PUT request │ │ │ │ -0015ecf0: 732c 2073 6565 2074 6865 203c 636f 6465 s, see the ;:http_form HTTP FORM pl │ │ │ │ -0015ed20: 7567 696e 2066 6f72 206d 6f72 6520 6465 ugin for more de │ │ │ │ -0015ed30: 7461 696c 732e 2054 6865 2048 5454 5020 tails. The HTTP │ │ │ │ -0015ed40: 626f 6479 2077 6974 6820 7468 6520 666f body with the fo │ │ │ │ -0015ed50: 726d 2064 6174 6120 7368 6f75 6c64 2062 rm data should b │ │ │ │ -0015ed60: 6520 7061 7273 6564 2062 7920 7468 6973 e parsed by this │ │ │ │ -0015ed70: 2063 616c 6c62 6163 6b2c 206f 7468 6572 callback, other │ │ │ │ -0015ed80: 7769 7365 2048 5454 5020 6b65 6570 2d61 wise HTTP keep-a │ │ │ │ -0015ed90: 6c69 7665 206d 6573 7361 6765 7320 7769 live messages wi │ │ │ │ -0015eda0: 6c6c 2065 6e64 2075 7020 6f75 7420 6f66 ll end up out of │ │ │ │ -0015edb0: 2073 796e 6320 6173 2061 2072 6573 756c sync as a resul │ │ │ │ -0015edc0: 7420 6f66 2074 6865 2063 7572 7265 6e74 t of the current │ │ │ │ -0015edd0: 2070 6f73 6974 696f 6e20 6e6f 7420 6265 position not be │ │ │ │ -0015ede0: 696e 6720 6164 7661 6e63 6564 2074 6f20 ing advanced to │ │ │ │ -0015edf0: 7468 6520 656e 6420 6f66 2074 6865 2048 the end of the H │ │ │ │ -0015ee00: 5454 5020 626f 6479 2e20 5265 7475 726e TTP body. Return │ │ │ │ -0015ee10: 7320 3c63 6f64 653e 2353 4f41 505f 4f4b s #SOAP_OK │ │ │ │ -0015ee20: 3c2f 636f 6465 3e20 6f72 2061 203c 636f or a soap_status< │ │ │ │ -0015eef0: 2f61 3e3c 2f63 6f64 653e 2028 696e 7429 /a> (int) │ │ │ │ -0015ef00: 2065 7272 6f72 2063 6f64 652e 204e 6f20 error code. No │ │ │ │ -0015ef10: 6275 696c 742d 696e 2066 756e 6374 696f built-in functio │ │ │ │ -0015ef20: 6e20 6973 2061 7373 6967 6e65 6420 746f n is assigned to │ │ │ │ -0015ef30: 203c 636f 6465 3e3c 6120 636c 6173 733d soa │ │ │ │ -0015f000: 703a 3a66 666f 726d 3c2f 613e 3c2f 636f p::fform.

.

.fheader.

int │ │ │ │ -0015f060: 283c 6120 636c 6173 733d 2265 6c22 2068 (soap::fhe │ │ │ │ -0015f130: 6164 6572 3c2f 613e 2928 7374 7275 6374 ader)(struct │ │ │ │ -0015f140: 2073 6f61 7020 2a73 6f61 7029 3c2f 636f soap *soap)

.

This │ │ │ │ -0015f160: 6361 6c6c 6261 636b 2069 7320 6361 6c6c callback is call │ │ │ │ -0015f170: 6564 2069 6d6d 6564 6961 7465 6c79 2061 ed immediately a │ │ │ │ -0015f180: 6674 6572 2070 6172 7369 6e67 2061 2053 fter parsing a S │ │ │ │ -0015f190: 4f41 5020 4865 6164 6572 2069 6e74 6f20 OAP Header into │ │ │ │ -0015f1a0: 7468 6520 3c63 6f64 653e 3c61 2063 6c61 the soap::header struct │ │ │ │ -0015f280: 7572 652e 2054 6865 2053 4f41 5020 4865 ure. The SOAP He │ │ │ │ -0015f290: 6164 6572 2073 7472 7563 7475 7265 203c ader structure < │ │ │ │ -0015f2a0: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soa │ │ │ │ -0015f360: 703a 3a68 6561 6465 723c 2f61 3e3c 2f63 p::header can be insp │ │ │ │ -0015f380: 6563 7465 6420 6279 2074 6869 7320 6675 ected by this fu │ │ │ │ -0015f390: 6e63 7469 6f6e 2061 6e64 2076 6572 6966 nction and verif │ │ │ │ -0015f3a0: 6965 6420 6f72 2072 656a 6563 7465 6420 ied or rejected │ │ │ │ -0015f3b0: 6265 666f 7265 2074 6865 2072 6573 7420 before the rest │ │ │ │ -0015f3c0: 6f66 2074 6865 206d 6573 7361 6765 2077 of the message w │ │ │ │ -0015f3d0: 6974 6820 7468 6520 534f 4150 2042 6f64 ith the SOAP Bod │ │ │ │ -0015f3e0: 7920 6973 2063 6f6e 7375 6d65 642e 2052 y is consumed. R │ │ │ │ -0015f3f0: 6574 7572 6e73 203c 636f 6465 3e23 534f eturns #SO │ │ │ │ -0015f400: 4150 5f4f 4b3c 2f63 6f64 653e 206f 7220 AP_OK or │ │ │ │ -0015f410: 6120 3c63 6f64 653e 3c61 2063 6c61 7373 a soap_st │ │ │ │ -0015f4d0: 6174 7573 3c2f 613e 3c2f 636f 6465 3e20 atus │ │ │ │ -0015f4e0: 2869 6e74 2920 6572 726f 7220 636f 6465 (int) error code │ │ │ │ -0015f4f0: 2e20 4e6f 2062 7569 6c74 2d69 6e20 6675 . No built-in fu │ │ │ │ -0015f500: 6e63 7469 6f6e 2069 7320 6173 7369 676e nction is assign │ │ │ │ -0015f510: 6564 2074 6f20 3c63 6f64 653e 3c61 2063 ed to soap::fheader< │ │ │ │ -0015f5f0: 2f61 3e3c 2f63 6f64 653e 2e3c 2f70 3e0a /a>.

. │ │ │ │ -0015f600: 3c68 333e 3c61 2063 6c61 7373 3d22 616e

.fig │ │ │ │ -0015f630: 6e6f 7265 3c2f 6833 3e0a 3c70 3e3c 636f nore

.

int (so │ │ │ │ -0015f710: 6170 3a3a 6669 676e 6f72 653c 2f61 3e29 ap::fignore) │ │ │ │ -0015f720: 2873 7472 7563 7420 736f 6170 202a 736f (struct soap *so │ │ │ │ -0015f730: 6170 2c20 636f 6e73 7420 6368 6172 202a ap, const char * │ │ │ │ -0015f740: 7461 6729 3c2f 636f 6465 3e3c 2f70 3e0a tag)

. │ │ │ │ -0015f750: 3c70 3e54 6869 7320 6361 6c6c 6261 636b

This callback │ │ │ │ -0015f760: 2069 7320 6361 6c6c 6564 2077 6865 6e20 is called when │ │ │ │ -0015f770: 616e 2075 6e72 6563 6f67 6e69 7a65 6420 an unrecognized │ │ │ │ -0015f780: 584d 4c20 656c 656d 656e 7420 7761 7320 XML element was │ │ │ │ -0015f790: 656e 636f 756e 7465 7265 6420 6f6e 2074 encountered on t │ │ │ │ -0015f7a0: 6865 2069 6e70 7574 2074 6861 7420 636f he input that co │ │ │ │ -0015f7b0: 756c 6420 6265 2069 676e 6f72 6564 2064 uld be ignored d │ │ │ │ -0015f7c0: 6570 656e 6469 6e67 206f 6e20 736f 6d65 epending on some │ │ │ │ -0015f7d0: 2073 7065 6369 6669 6564 206c 6f67 6963 specified logic │ │ │ │ -0015f7e0: 2e20 5468 6520 3c63 6f64 653e 7461 673c . The tag< │ │ │ │ -0015f7f0: 2f63 6f64 653e 2070 6172 616d 6574 6572 /code> parameter │ │ │ │ -0015f800: 2069 7320 7468 6520 6f66 6665 6e64 696e is the offendin │ │ │ │ -0015f810: 6720 584d 4c20 656c 656d 656e 7420 7461 g XML element ta │ │ │ │ -0015f820: 6720 6e61 6d65 2073 7472 696e 672e 2054 g name string. T │ │ │ │ -0015f830: 6865 2063 616c 6c62 6163 6b20 7368 6f75 he callback shou │ │ │ │ -0015f840: 6c64 2072 6574 7572 6e20 3c63 6f64 653e ld return │ │ │ │ -0015f850: 2353 4f41 505f 4f4b 3c2f 636f 6465 3e20 #SOAP_OK │ │ │ │ -0015f860: 746f 2069 676e 6f72 6520 7468 6520 656c to ignore the el │ │ │ │ -0015f870: 656d 656e 7420 6f72 2072 6574 7572 6e20 ement or return │ │ │ │ -0015f880: 616e 203c 636f 6465 3e3c 6120 636c 6173 an soap_s │ │ │ │ -0015f940: 7461 7475 733c 2f61 3e3c 2f63 6f64 653e tatus │ │ │ │ -0015f950: 2065 7272 6f72 2063 6f64 6520 7375 6368 error code such │ │ │ │ -0015f960: 2061 7320 3c63 6f64 653e 2353 4f41 505f as #SOAP_ │ │ │ │ -0015f970: 5441 475f 4d49 534d 4154 4348 3c2f 636f TAG_MISMATCH to trigger a │ │ │ │ -0015f990: 2076 616c 6964 6174 696f 6e20 6572 726f validation erro │ │ │ │ -0015f9a0: 722e 2054 6869 7320 6361 6c6c 6261 636b r. This callback │ │ │ │ -0015f9b0: 2061 6c73 6f20 6f76 6572 7269 6465 7320 also overrides │ │ │ │ -0015f9c0: 3c63 6f64 653e 6d75 7374 556e 6465 7273 mustUnders │ │ │ │ -0015f9d0: 7461 6e64 3c2f 636f 6465 3e20 6174 7472 tand attr │ │ │ │ -0015f9e0: 6962 7574 6573 206f 6e20 756e 7265 636f ibutes on unreco │ │ │ │ -0015f9f0: 676e 697a 6564 2053 4f41 5020 4865 6164 gnized SOAP Head │ │ │ │ -0015fa00: 6572 2065 6c65 6d65 6e74 7320 7468 6174 er elements that │ │ │ │ -0015fa10: 206e 6f72 6d61 6c6c 7920 7261 6973 6520 normally raise │ │ │ │ -0015fa20: 6661 756c 7473 2e20 4974 2069 7320 7374 faults. It is st │ │ │ │ -0015fa30: 726f 6e67 6c79 2072 6563 6f6d 6d65 6e64 rongly recommend │ │ │ │ -0015fa40: 6564 2074 6861 7420 7468 6520 6361 6c6c ed that the call │ │ │ │ -0015fa50: 6261 636b 2072 6574 7572 6e73 203c 636f back returns #SOAP_MUSTUND │ │ │ │ -0015fa70: 4552 5354 414e 443c 2f63 6f64 653e 2077 ERSTAND w │ │ │ │ -0015fa80: 6865 6e20 3c63 6f64 653e 3c61 2063 6c61 hen soap::mustUnde │ │ │ │ -0015fb50: 7273 7461 6e64 3c2f 613e 3c2f 636f 6465 rstand != 0. Returns #SOAP_OK or a s │ │ │ │ -0015fc50: 6f61 705f 7374 6174 7573 3c2f 613e 3c2f oap_status (int) erro │ │ │ │ -0015fc70: 7220 636f 6465 2e20 4e6f 2062 7569 6c74 r code. No built │ │ │ │ -0015fc80: 2d69 6e20 6675 6e63 7469 6f6e 2069 7320 -in function is │ │ │ │ -0015fc90: 6173 7369 676e 6564 2074 6f20 3c63 6f64 assigned to soap::fi │ │ │ │ -0015fd70: 676e 6f72 653c 2f61 3e3c 2f63 6f64 653e gnore │ │ │ │ -0015fd80: 2e3c 2f70 3e0a 3c68 333e 3c61 2063 6c61 .

.

.fsvalidate.

int │ │ │ │ -0015fdd0: 283c 6120 636c 6173 733d 2265 6c22 2068 (soap::fsv │ │ │ │ -0015fe70: 616c 6964 6174 653c 2f61 3e29 2873 7472 alidate)(str │ │ │ │ -0015fe80: 7563 7420 736f 6170 202a 736f 6170 2c20 uct soap *soap, │ │ │ │ -0015fe90: 636f 6e73 7420 6368 6172 202a 7061 7474 const char *patt │ │ │ │ -0015fea0: 6572 6e2c 2063 6f6e 7374 2063 6861 7220 ern, const char │ │ │ │ -0015feb0: 2a73 7472 696e 6729 3c2f 636f 6465 3e3c *string)< │ │ │ │ -0015fec0: 2f70 3e0a 3c70 3e54 6869 7320 6361 6c6c /p>.

This call │ │ │ │ -0015fed0: 6261 636b 2069 7320 6361 6c6c 6564 2074 back is called t │ │ │ │ -0015fee0: 6f20 7661 6c69 6461 7465 2061 2073 7472 o validate a str │ │ │ │ -0015fef0: 696e 6720 6167 6169 6e73 7420 616e 2058 ing against an X │ │ │ │ -0015ff00: 4d4c 2072 6567 6578 2070 6174 7465 726e ML regex pattern │ │ │ │ -0015ff10: 2e20 5061 7474 6572 6e73 2075 7365 2058 . Patterns use X │ │ │ │ -0015ff20: 4d4c 2073 6368 656d 6120 7265 6765 7820 ML schema regex │ │ │ │ -0015ff30: 7379 6e74 6178 2e20 5468 6973 2063 616c syntax. This cal │ │ │ │ -0015ff40: 6c62 6163 6b20 616c 6c6f 7773 2075 7365 lback allows use │ │ │ │ -0015ff50: 722d 6465 6669 6e65 6420 7061 7474 6572 r-defined patter │ │ │ │ -0015ff60: 6e20 7661 6c69 6461 7469 6f6e 2074 6861 n validation tha │ │ │ │ -0015ff70: 7420 6973 206e 6f72 6d61 6c6c 7920 6469 t is normally di │ │ │ │ -0015ff80: 7361 626c 6564 2e20 5265 7475 726e 7320 sabled. Returns │ │ │ │ -0015ff90: 3c63 6f64 653e 2353 4f41 505f 4f4b 3c2f #SOAP_OK when the s │ │ │ │ -0015ffb0: 7472 696e 6720 6d61 7463 6865 7320 7468 tring matches th │ │ │ │ -0015ffc0: 6520 7061 7474 6572 6e20 6f72 203c 636f e pattern or #SOAP_TYPE when the st │ │ │ │ -0015fff0: 7269 6e67 2064 6f65 7320 6e6f 7420 6d61 ring does not ma │ │ │ │ -00160000: 7463 682e 204e 6f20 6275 696c 742d 696e tch. No built-in │ │ │ │ -00160010: 2066 756e 6374 696f 6e20 6973 2061 7373 function is ass │ │ │ │ -00160020: 6967 6e65 6420 746f 203c 636f 6465 3e3c igned to < │ │ │ │ -00160030: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ -00160040: 663d 2267 726f 7570 5f5f 6772 6f75 705f f="group__group_ │ │ │ │ -00160050: 5f63 616c 6c62 6163 6b73 2e68 746d 6c23 _callbacks.html# │ │ │ │ -00160060: 6761 3661 3565 3239 6238 3630 6432 3866 ga6a5e29b860d28f │ │ │ │ -00160070: 3835 3563 3864 3961 3637 6330 3936 6433 855c8d9a67c096d3 │ │ │ │ -00160080: 3131 2220 7469 746c 653d 2243 616c 6c62 11" title="Callb │ │ │ │ -00160090: 6163 6b20 746f 2076 616c 6964 6174 6520 ack to validate │ │ │ │ -001600a0: 7374 7269 6e67 7320 6167 6169 6e73 7420 strings against │ │ │ │ -001600b0: 584d 4c20 7265 6765 7820 7061 7474 6572 XML regex patter │ │ │ │ -001600c0: 6e73 2e22 3e73 6f61 703a 3a66 7376 616c ns.">soap::fsval │ │ │ │ -001600d0: 6964 6174 653c 2f61 3e3c 2f63 6f64 653e idate │ │ │ │ -001600e0: 2e3c 2f70 3e0a 3c68 333e 3c61 2063 6c61 .

.

.fwvalidate.

int │ │ │ │ -00160130: 283c 6120 636c 6173 733d 2265 6c22 2068 (soap │ │ │ │ -001601d0: 3a3a 6677 7661 6c69 6461 7465 3c2f 613e ::fwvalidate │ │ │ │ -001601e0: 2928 7374 7275 6374 2073 6f61 7020 2a73 )(struct soap *s │ │ │ │ -001601f0: 6f61 702c 2063 6f6e 7374 2063 6861 7220 oap, const char │ │ │ │ -00160200: 2a70 6174 7465 726e 2c20 636f 6e73 7420 *pattern, const │ │ │ │ -00160210: 7763 6861 725f 7420 2a73 7472 696e 6729 wchar_t *string) │ │ │ │ -00160220: 3c2f 636f 6465 3e20 5468 6973 2063 616c This cal │ │ │ │ -00160230: 6c62 6163 6b20 6973 2063 616c 6c65 6420 lback is called │ │ │ │ -00160240: 746f 2076 616c 6964 6174 6520 6120 7769 to validate a wi │ │ │ │ -00160250: 6465 2073 7472 696e 6720 6167 6169 6e73 de string agains │ │ │ │ -00160260: 7420 616e 2058 4d4c 2072 6567 6578 2070 t an XML regex p │ │ │ │ -00160270: 6174 7465 726e 2e20 5061 7474 6572 6e73 attern. Patterns │ │ │ │ -00160280: 2075 7365 2058 4d4c 2073 6368 656d 6120 use XML schema │ │ │ │ -00160290: 7265 6765 7820 7379 6e74 6178 2e20 5468 regex syntax. Th │ │ │ │ -001602a0: 6973 2063 616c 6c62 6163 6b20 616c 6c6f is callback allo │ │ │ │ -001602b0: 7773 2075 7365 722d 6465 6669 6e65 6420 ws user-defined │ │ │ │ -001602c0: 7061 7474 6572 6e20 7661 6c69 6461 7469 pattern validati │ │ │ │ -001602d0: 6f6e 2074 6861 7420 6973 206e 6f72 6d61 on that is norma │ │ │ │ -001602e0: 6c6c 7920 6469 7361 626c 6564 2e20 5265 lly disabled. Re │ │ │ │ -001602f0: 7475 726e 7320 3c63 6f64 653e 2353 4f41 turns #SOA │ │ │ │ -00160300: 505f 4f4b 3c2f 636f 6465 3e20 7768 656e P_OK when │ │ │ │ -00160310: 2074 6865 2073 7472 696e 6720 6d61 7463 the string matc │ │ │ │ -00160320: 6865 7320 7468 6520 7061 7474 6572 6e20 hes the pattern │ │ │ │ -00160330: 6f72 203c 636f 6465 3e23 534f 4150 5f54 or #SOAP_T │ │ │ │ -00160340: 5950 453c 2f63 6f64 653e 2077 6865 6e20 YPE when │ │ │ │ -00160350: 7468 6520 7374 7269 6e67 2064 6f65 7320 the string does │ │ │ │ -00160360: 6e6f 7420 6d61 7463 682e 204e 6f20 6275 not match. No bu │ │ │ │ -00160370: 696c 742d 696e 2066 756e 6374 696f 6e20 ilt-in function │ │ │ │ -00160380: 6973 2061 7373 6967 6e65 6420 746f 203c is assigned to < │ │ │ │ -00160390: 636f 6465 3e3c 6120 636c 6173 733d 2265 code> │ │ │ │ -00160430: 736f 6170 3a3a 6677 7661 6c69 6461 7465 soap::fwvalidate │ │ │ │ -00160440: 3c2f 613e 3c2f 636f 6465 3e2e 3c2f 703e .

│ │ │ │ -00160450: 0a3c 6833 3e3c 6120 636c 6173 733d 2261 .

.fs │ │ │ │ -00160480: 6574 6572 726f 723c 2f68 333e 0a3c 703e eterror

.

│ │ │ │ -00160490: 3c63 6f64 653e 766f 6964 2028 3c61 2063 void (so │ │ │ │ -00160540: 6170 3a3a 6673 6574 6572 726f 723c 2f61 ap::fseterror)(struct soap * │ │ │ │ -00160560: 736f 6170 2c20 636f 6e73 7420 6368 6172 soap, const char │ │ │ │ -00160570: 202a 2a63 6f64 652c 2063 6f6e 7374 2063 **code, const c │ │ │ │ -00160580: 6861 7220 2a2a 7374 7269 6e67 293c 2f63 har **string)

.

This │ │ │ │ -001605a0: 2063 616c 6c62 6163 6b20 6973 2063 616c callback is cal │ │ │ │ -001605b0: 6c65 6420 6279 2074 6865 2065 6e67 696e led by the engin │ │ │ │ -001605c0: 6520 7768 656e 2061 6e20 6572 726f 7220 e when an error │ │ │ │ -001605d0: 6973 2072 6169 7365 6420 746f 2061 6c6c is raised to all │ │ │ │ -001605e0: 6f77 2069 6e73 7065 6374 696f 6e20 6f72 ow inspection or │ │ │ │ -001605f0: 206f 7665 7272 6964 696e 6720 6f66 2074 overriding of t │ │ │ │ -00160600: 6865 2066 6175 6c74 2063 6f64 6520 6f72 he fault code or │ │ │ │ -00160610: 2066 6175 6c74 2073 7472 696e 6720 6d65 fault string me │ │ │ │ -00160620: 7373 6167 6573 2062 6566 6f72 6520 7468 ssages before th │ │ │ │ -00160630: 6520 6572 726f 7220 6973 2072 6570 6f72 e error is repor │ │ │ │ -00160640: 7465 6420 6f72 2074 7261 6e73 6d69 7474 ted or transmitt │ │ │ │ -00160650: 6564 2e20 4e6f 2062 7569 6c74 2d69 6e20 ed. No built-in │ │ │ │ -00160660: 6675 6e63 7469 6f6e 2069 7320 6173 7369 function is assi │ │ │ │ -00160670: 676e 6564 2074 6f20 3c63 6f64 653e 3c61 gned to │ │ │ │ -00160720: 736f 6170 3a3a 6673 6574 6572 726f 723c soap::fseterror< │ │ │ │ -00160730: 2f61 3e3c 2f63 6f64 653e 2e3c 2f70 3e0a /a>.

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

.fop │ │ │ │ -00160770: 656e 3c2f 6833 3e0a 3c70 3e3c 636f 6465 en

.

SOAP_SOCKET (soap::f │ │ │ │ -00160830: 6f70 656e 3c2f 613e 2928 7374 7275 6374 open)(struct │ │ │ │ -00160840: 2073 6f61 7020 2a73 6f61 702c 2063 6f6e soap *soap, con │ │ │ │ -00160850: 7374 2063 6861 7220 2a65 6e64 706f 696e st char *endpoin │ │ │ │ -00160860: 742c 2063 6f6e 7374 2063 6861 7220 2a68 t, const char *h │ │ │ │ -00160870: 6f73 742c 2069 6e74 2070 6f72 7429 3c2f ost, int port)

.

Thi │ │ │ │ -00160890: 7320 6361 6c6c 6261 636b 2069 7320 6361 s callback is ca │ │ │ │ -001608a0: 6c6c 6564 2062 7920 7468 6520 656e 6769 lled by the engi │ │ │ │ -001608b0: 6e65 2061 7420 7468 6520 636c 6965 6e74 ne at the client │ │ │ │ -001608c0: 2d73 6964 6520 6279 203c 636f 6465 3e3c -side by < │ │ │ │ -001608d0: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ -001608e0: 663d 2267 726f 7570 5f5f 6772 6f75 705f f="group__group_ │ │ │ │ -001608f0: 5f69 6f2e 6874 6d6c 2367 6135 6338 3765 _io.html#ga5c87e │ │ │ │ -00160900: 3964 3061 3433 6665 3138 6363 3334 3963 9d0a43fe18cc349c │ │ │ │ -00160910: 3732 3466 3139 3866 3634 6122 2074 6974 724f198f64a" tit │ │ │ │ -00160920: 6c65 3d22 436f 6e6e 6563 7420 746f 2061 le="Connect to a │ │ │ │ -00160930: 2073 6572 7665 7220 7573 696e 6720 4854 server using HT │ │ │ │ -00160940: 5450 2050 4f53 542e 223e 736f 6170 5f63 TP POST.">soap_c │ │ │ │ -00160950: 6f6e 6e65 6374 3c2f 613e 3c2f 636f 6465 onnect or soap_conne │ │ │ │ -001609e0: 6374 5f63 6f6d 6d61 6e64 3c2f 613e 3c2f ct_command to open a │ │ │ │ -00160a00: 5443 5020 6f72 2055 4450 2063 6f6e 6e65 TCP or UDP conne │ │ │ │ -00160a10: 6374 696f 6e20 746f 2061 2073 6572 7665 ction to a serve │ │ │ │ -00160a20: 7220 7370 6563 6966 6965 6420 6174 2061 r specified at a │ │ │ │ -00160a30: 6e20 656e 6470 6f69 6e74 2e20 5061 7261 n endpoint. Para │ │ │ │ -00160a40: 6d65 7465 7273 203c 636f 6465 3e68 6f73 meters hos │ │ │ │ -00160a50: 743c 2f63 6f64 653e 2061 6e64 203c 636f t and port a │ │ │ │ -00160a70: 7265 206d 6963 726f 2d70 6172 7365 6420 re micro-parsed │ │ │ │ -00160a80: 6672 6f6d 203c 636f 6465 3e65 6e64 706f from endpo │ │ │ │ -00160a90: 696e 743c 2f63 6f64 653e 2062 6566 6f72 int befor │ │ │ │ -00160aa0: 6520 6265 696e 6720 7061 7373 6564 2074 e being passed t │ │ │ │ -00160ab0: 6f20 3c63 6f64 653e 3c61 2063 6c61 7373 o soap::fopen. Retur │ │ │ │ -00160b70: 6e73 2061 2076 616c 6964 2073 6f63 6b65 ns a valid socke │ │ │ │ -00160b80: 7420 6f72 203c 636f 6465 3e23 534f 4150 t or #SOAP │ │ │ │ -00160b90: 5f49 4e56 414c 4944 5f53 4f43 4b45 543c _INVALID_SOCKET< │ │ │ │ -00160ba0: 2f63 6f64 653e 2077 6974 6820 6120 3c63 /code> with a soap:: │ │ │ │ -00160c60: 6572 726f 723c 2f61 3e3c 2f63 6f64 653e error │ │ │ │ -00160c70: 2073 6574 2074 6f20 6120 3c63 6f64 653e set to a │ │ │ │ -00160c80: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap_status │ │ │ │ -00160d40: 3c2f 636f 6465 3e20 2869 6e74 2920 6572 (int) er │ │ │ │ -00160d50: 726f 7220 636f 6465 2061 6e64 203c 636f ror code and soap::errnum< │ │ │ │ -00160df0: 2f61 3e3c 2f63 6f64 653e 2073 6574 2074 /a> set t │ │ │ │ -00160e00: 6f20 3c63 6f64 653e 6572 726e 6f3c 2f63 o errno of the conn │ │ │ │ -00160e20: 6563 7469 6f6e 2066 6169 6c75 7265 2e20 ection failure. │ │ │ │ -00160e30: 5468 6520 6275 696c 742d 696e 2066 756e The built-in fun │ │ │ │ -00160e40: 6374 696f 6e20 6173 7369 676e 6564 2074 ction assigned t │ │ │ │ -00160e50: 6f20 3c63 6f64 653e 3c61 2063 6c61 7373 o soap::fopen is tcp_connect.

.

< │ │ │ │ -00160f30: 6120 636c 6173 733d 2261 6e63 686f 7222 a class="anchor" │ │ │ │ -00160f40: 2069 643d 2261 7574 6f74 6f63 5f6d 6434 id="autotoc_md4 │ │ │ │ -00160f50: 3622 3e3c 2f61 3e0a 6661 6363 6570 743c 6">.faccept< │ │ │ │ -00160f60: 2f68 333e 0a3c 703e 3c63 6f64 653e 534f /h3>.

SO │ │ │ │ -00160f70: 4150 5f53 4f43 4b45 5420 283c 6120 636c AP_SOCKET (soap::fac │ │ │ │ -00161030: 6365 7074 3c2f 613e 2928 7374 7275 6374 cept)(struct │ │ │ │ -00161040: 2073 6f61 7020 2a73 6f61 702c 2053 4f41 soap *soap, SOA │ │ │ │ -00161050: 505f 534f 434b 4554 2073 2c20 7374 7275 P_SOCKET s, stru │ │ │ │ -00161060: 6374 2073 6f63 6b61 6464 7220 2a61 2c20 ct sockaddr *a, │ │ │ │ -00161070: 696e 7420 2a6e 293c 2f63 6f64 653e 3c2f int *n).

This callb │ │ │ │ -00161090: 6163 6b20 6973 2063 616c 6c65 6420 6279 ack is called by │ │ │ │ -001610a0: 203c 636f 6465 3e3c 6120 636c 6173 733d │ │ │ │ -00161120: 736f 6170 5f61 6363 6570 743c 2f61 3e3c soap_accept< │ │ │ │ -00161130: 2f63 6f64 653e 2028 6f72 2074 6865 2043 /code> (or the C │ │ │ │ -00161140: 2b2b 2073 6572 7669 6365 2063 6c61 7373 ++ service class │ │ │ │ -00161150: 203c 636f 6465 3e61 6363 6570 743c 2f63 accept method) to │ │ │ │ -00161170: 7761 6974 2066 6f72 2061 6e64 2061 6363 wait for and acc │ │ │ │ -00161180: 6570 7420 6120 736f 636b 6574 2063 6f6e ept a socket con │ │ │ │ -00161190: 6e65 6374 696f 6e20 7265 7175 6573 7465 nection requeste │ │ │ │ -001611a0: 6420 6279 2061 2063 6c69 656e 742e 2052 d by a client. R │ │ │ │ -001611b0: 6574 7572 6e73 2061 2076 616c 6964 2073 eturns a valid s │ │ │ │ -001611c0: 6f63 6b65 7420 6f72 203c 636f 6465 3e23 ocket or # │ │ │ │ -001611d0: 534f 4150 5f49 4e56 414c 4944 5f53 4f43 SOAP_INVALID_SOC │ │ │ │ -001611e0: 4b45 543c 2f63 6f64 653e 2077 6865 6e20 KET when │ │ │ │ -001611f0: 616e 2065 7272 6f72 206f 6363 7572 7265 an error occurre │ │ │ │ -00161200: 6420 616e 6420 7365 7473 203c 636f 6465 d and sets soap::err │ │ │ │ -001612c0: 6f72 3c2f 613e 3c2f 636f 6465 3e20 746f or to │ │ │ │ -001612d0: 2061 203c 636f 6465 3e3c 6120 636c 6173 a soap_s │ │ │ │ -00161390: 7461 7475 733c 2f61 3e3c 2f63 6f64 653e tatus │ │ │ │ -001613a0: 2076 616c 7565 2e20 5468 6520 6275 696c value. The buil │ │ │ │ -001613b0: 742d 696e 2066 756e 6374 696f 6e20 6173 t-in function as │ │ │ │ -001613c0: 7369 676e 6564 2074 6f20 3c63 6f64 653e signed to │ │ │ │ -001613d0: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap │ │ │ │ -00161480: 3a3a 6661 6363 6570 743c 2f61 3e3c 2f63 ::faccept is tc │ │ │ │ -001614a0: 705f 6163 6365 7074 3c2f 636f 6465 3e2e p_accept. │ │ │ │ -001614b0: 3c2f 703e 0a3c 6833 3e3c 6120 636c 6173

.

.fclose

.

int (soa │ │ │ │ -00161590: 703a 3a66 636c 6f73 653c 2f61 3e29 2873 p::fclose)(s │ │ │ │ -001615a0: 7472 7563 7420 736f 6170 202a 736f 6170 truct soap *soap │ │ │ │ -001615b0: 293c 2f63 6f64 653e 3c2f 703e 0a3c 703e )

.

│ │ │ │ -001615c0: 5468 6973 2063 616c 6c62 6163 6b20 6973 This callback is │ │ │ │ -001615d0: 2063 616c 6c65 6420 6279 2074 6865 2065 called by the e │ │ │ │ -001615e0: 6e67 696e 6520 6174 2074 6865 2063 6c69 ngine at the cli │ │ │ │ -001615f0: 656e 742d 7369 6465 2074 6f20 636c 6f73 ent-side to clos │ │ │ │ -00161600: 6520 7468 6520 6375 7272 656e 7420 736f e the current so │ │ │ │ -00161610: 636b 6574 2063 6f6e 6e65 6374 696f 6e20 cket connection │ │ │ │ -00161620: 6265 666f 7265 2061 206e 6577 2073 6f63 before a new soc │ │ │ │ -00161630: 6b65 7420 636f 6e6e 6563 7469 6f6e 2069 ket connection i │ │ │ │ -00161640: 7320 6573 7461 626c 6973 6865 642e 2054 s established. T │ │ │ │ -00161650: 6869 7320 6361 6c6c 6261 636b 206d 6179 his callback may │ │ │ │ -00161660: 2062 6520 6361 6c6c 6564 206d 756c 7469 be called multi │ │ │ │ -00161670: 706c 6520 7469 6d65 7320 2865 2e67 2e20 ple times (e.g. │ │ │ │ -00161680: 6279 2074 6865 2065 6e67 696e 6520 616e by the engine an │ │ │ │ -00161690: 6420 6279 2070 6c75 6769 6e73 2920 746f d by plugins) to │ │ │ │ -001616a0: 2063 6c6f 7365 2074 6865 2073 616d 6520 close the same │ │ │ │ -001616b0: 736f 636b 6574 203c 636f 6465 3e3c 6120 socket soap::socke │ │ │ │ -00161780: 743c 2f61 3e3c 2f63 6f64 653e 2e20 4368 t. Ch │ │ │ │ -00161790: 6563 6b73 2069 6e74 6572 6e61 6c6c 7920 ecks internally │ │ │ │ -001617a0: 6966 203c 636f 6465 3e3c 6120 636c 6173 if soap::socket == #SOAP_INVALID_ │ │ │ │ -00161890: 534f 434b 4554 3c2f 636f 6465 3e20 6265 SOCKET be │ │ │ │ -001618a0: 666f 7265 2063 6c6f 7369 6e67 2c20 7768 fore closing, wh │ │ │ │ -001618b0: 6963 6820 6d65 616e 7320 7468 6174 2074 ich means that t │ │ │ │ -001618c0: 6865 2073 6f63 6b65 7420 7761 7320 616c he socket was al │ │ │ │ -001618d0: 7265 6164 7920 636c 6f73 6564 2e20 5265 ready closed. Re │ │ │ │ -001618e0: 7475 726e 7320 3c63 6f64 653e 2353 4f41 turns #SOA │ │ │ │ -001618f0: 505f 4f4b 3c2f 636f 6465 3e20 6f72 2061 P_OK or a │ │ │ │ -00161900: 203c 636f 6465 3e3c 6120 636c 6173 733d soap_sta │ │ │ │ -001619c0: 7475 733c 2f61 3e3c 2f63 6f64 653e 2028 tus ( │ │ │ │ -001619d0: 696e 7429 2065 7272 6f72 2063 6f64 652e int) error code. │ │ │ │ -001619e0: 2054 6865 2062 7569 6c74 2d69 6e20 6675 The built-in fu │ │ │ │ -001619f0: 6e63 7469 6f6e 2061 7373 6967 6e65 6420 nction assigned │ │ │ │ -00161a00: 746f 203c 636f 6465 3e3c 6120 636c 6173 to soap:: │ │ │ │ -00161aa0: 6663 6c6f 7365 3c2f 613e 3c2f 636f 6465 fclose is tcp_d │ │ │ │ -00161ac0: 6973 636f 6e6e 6563 743c 2f63 6f64 653e isconnect │ │ │ │ -00161ad0: 2e3c 2f70 3e0a 3c68 333e 3c61 2063 6c61 .

.

.fresolve

│ │ │ │ -00161b10: 0a3c 703e 3c63 6f64 653e 696e 7420 283c .

int (< │ │ │ │ -00161b20: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ -00161b30: 663d 2267 726f 7570 5f5f 6772 6f75 705f f="group__group_ │ │ │ │ -00161b40: 5f63 616c 6c62 6163 6b73 2e68 746d 6c23 _callbacks.html# │ │ │ │ -00161b50: 6761 3061 6538 3030 6661 3630 6335 6536 ga0ae800fa60c5e6 │ │ │ │ -00161b60: 3561 3836 3765 3564 3065 3363 6537 3232 5a867e5d0e3ce722 │ │ │ │ -00161b70: 3365 2220 7469 746c 653d 2243 616c 6c62 3e" title="Callb │ │ │ │ -00161b80: 6163 6b20 7468 6174 2072 6573 6f6c 7665 ack that resolve │ │ │ │ -00161b90: 7320 6120 686f 7374 206e 616d 6520 6279 s a host name by │ │ │ │ -00161ba0: 2061 6464 7265 7373 2074 7261 6e73 6c61 address transla │ │ │ │ -00161bb0: 7469 6f6e 2e22 3e73 6f61 703a 3a66 7265 tion.">soap::fre │ │ │ │ -00161bc0: 736f 6c76 653c 2f61 3e29 2873 7472 7563 solve)(struc │ │ │ │ -00161bd0: 7420 736f 6170 202a 736f 6170 2c20 636f t soap *soap, co │ │ │ │ -00161be0: 6e73 7420 6368 6172 202a 6164 6472 2c20 nst char *addr, │ │ │ │ -00161bf0: 7374 7275 6374 2069 6e5f 6164 6472 202a struct in_addr * │ │ │ │ -00161c00: 696e 6164 6472 293c 2f63 6f64 653e 3c2f inaddr).

This callb │ │ │ │ -00161c20: 6163 6b20 6973 2063 616c 6c65 6420 6279 ack is called by │ │ │ │ -00161c30: 203c 636f 6465 3e3c 6120 636c 6173 733d soap_bin │ │ │ │ -00161cb0: 643c 2f61 3e3c 2f63 6f64 653e 2028 6f72 d (or │ │ │ │ -00161cc0: 2074 6865 2043 2b2b 2073 6572 7669 6365 the C++ service │ │ │ │ -00161cd0: 2063 6c61 7373 203c 636f 6465 3e62 696e class bin │ │ │ │ -00161ce0: 643c 2f63 6f64 653e 206d 6574 686f 6429 d method) │ │ │ │ -00161cf0: 2061 7420 7468 6520 7365 7276 6572 2d73 at the server-s │ │ │ │ -00161d00: 6964 6520 616e 6420 6279 203c 636f 6465 ide and by soap │ │ │ │ -00161d90: 5f63 6f6e 6e65 6374 3c2f 613e 3c2f 636f _connect or soap_con │ │ │ │ -00161e20: 6e65 6374 5f63 6f6d 6d61 6e64 3c2f 613e nect_command │ │ │ │ -00161e30: 3c2f 636f 6465 3e20 6174 2074 6865 2063 at the c │ │ │ │ -00161e40: 6c69 656e 742d 7369 6465 2077 6974 6820 lient-side with │ │ │ │ -00161e50: 6120 686f 7374 203c 636f 6465 3e6e 616d a host nam │ │ │ │ -00161e60: 653c 2f63 6f64 653e 2070 6172 616d 6574 e paramet │ │ │ │ -00161e70: 6572 2074 6f20 7265 736f 6c76 6520 746f er to resolve to │ │ │ │ -00161e80: 2061 6464 7265 7373 203c 636f 6465 3e69 address i │ │ │ │ -00161e90: 6e61 6464 723c 2f63 6f64 653e 2062 7920 naddr by │ │ │ │ -00161ea0: 6164 6472 6573 7320 7472 616e 736c 6174 address translat │ │ │ │ -00161eb0: 696f 6e2e 2057 6865 6e20 7375 6363 6573 ion. When succes │ │ │ │ -00161ec0: 7366 756c 2073 6574 7320 7061 7261 6d65 sful sets parame │ │ │ │ -00161ed0: 7465 7220 3c63 6f64 653e 696e 6164 6472 ter inaddr │ │ │ │ -00161ee0: 3c2f 636f 6465 3e20 616e 6420 7265 7475 and retu │ │ │ │ -00161ef0: 726e 7320 3c63 6f64 653e 2353 4f41 505f rns #SOAP_ │ │ │ │ -00161f00: 4f4b 3c2f 636f 6465 3e20 6f72 2061 203c OK or a < │ │ │ │ -00161f10: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soap_statu │ │ │ │ -00161fd0: 733c 2f61 3e3c 2f63 6f64 653e 2028 696e s (in │ │ │ │ -00161fe0: 7429 2065 7272 6f72 2063 6f64 652e 2054 t) error code. T │ │ │ │ -00161ff0: 6865 2062 7569 6c74 2d69 6e20 6675 6e63 he built-in func │ │ │ │ -00162000: 7469 6f6e 2061 7373 6967 6e65 6420 746f tion assigned to │ │ │ │ -00162010: 203c 636f 6465 3e3c 6120 636c 6173 733d s │ │ │ │ -001620b0: 6f61 703a 3a66 7265 736f 6c76 653c 2f61 oap::fresolve is tcp_gethost.

.

.fconnect< │ │ │ │ -00162120: 2f68 333e 0a3c 703e 3c63 6f64 653e 696e /h3>.

in │ │ │ │ -00162130: 7420 283c 6120 636c 6173 733d 2265 6c22 t (s │ │ │ │ -001621d0: 6f61 703a 3a66 636f 6e6e 6563 743c 2f61 oap::fconnect)(struct soap * │ │ │ │ -001621f0: 736f 6170 2c20 636f 6e73 7420 6368 6172 soap, const char │ │ │ │ -00162200: 202a 656e 6470 6f69 6e74 2c20 636f 6e73 *endpoint, cons │ │ │ │ -00162210: 7420 6368 6172 202a 686f 7374 2c20 696e t char *host, in │ │ │ │ -00162220: 7420 706f 7274 293c 2f63 6f64 653e 3c2f t port).

This callb │ │ │ │ -00162240: 6163 6b20 6973 2063 616c 6c65 6420 6279 ack is called by │ │ │ │ -00162250: 2074 6865 2065 6e67 696e 6520 746f 206f the engine to o │ │ │ │ -00162260: 7074 696f 6e61 6c6c 7920 6f76 6572 7269 ptionally overri │ │ │ │ -00162270: 6465 2063 6c69 656e 742d 7369 6465 2063 de client-side c │ │ │ │ -00162280: 6f6e 6e65 6374 696e 672e 2054 6865 2070 onnecting. The p │ │ │ │ -00162290: 6172 616d 6574 6572 7320 3c63 6f64 653e arameters │ │ │ │ -001622a0: 686f 7374 3c2f 636f 6465 3e20 616e 6420 host and │ │ │ │ -001622b0: 3c63 6f64 653e 706f 7274 3c2f 636f 6465 port were micro-par │ │ │ │ -001622d0: 7365 6420 6672 6f6d 2074 6865 203c 636f sed from the endpoint prior to pass │ │ │ │ -00162300: 696e 6720 7468 656d 2074 6f20 7468 6973 ing them to this │ │ │ │ -00162310: 2063 616c 6c62 6163 6b2e 2052 6574 7572 callback. Retur │ │ │ │ -00162320: 6e73 203c 636f 6465 3e23 534f 4150 5f4f ns #SOAP_O │ │ │ │ -00162330: 4b3c 2f63 6f64 653e 206f 7220 6120 3c63 K or a soap_status │ │ │ │ -00162400: 3c2f 613e 3c2f 636f 6465 3e20 2869 6e74 (int │ │ │ │ -00162410: 2920 6572 726f 7220 636f 6465 2e20 4e6f ) error code. No │ │ │ │ -00162420: 2062 7569 6c74 2d69 6e20 6675 6e63 7469 built-in functi │ │ │ │ -00162430: 6f6e 2069 7320 6173 7369 676e 6564 2074 on is assigned t │ │ │ │ -00162440: 6f20 3c63 6f64 653e 3c61 2063 6c61 7373 o soap::fconne │ │ │ │ -001624f0: 6374 3c2f 613e 3c2f 636f 6465 3e2e 3c2f ct..

. │ │ │ │ -00162530: 6664 6973 636f 6e6e 6563 743c 2f68 333e fdisconnect

│ │ │ │ -00162540: 0a3c 703e 3c63 6f64 653e 696e 7420 283c .

int (< │ │ │ │ -00162550: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ -00162560: 663d 2267 726f 7570 5f5f 6772 6f75 705f f="group__group_ │ │ │ │ -00162570: 5f63 616c 6c62 6163 6b73 2e68 746d 6c23 _callbacks.html# │ │ │ │ -00162580: 6761 3264 6531 3934 3037 3566 3634 3564 ga2de194075f645d │ │ │ │ -00162590: 3737 6331 3566 3738 6335 3263 6132 3438 77c15f78c52ca248 │ │ │ │ -001625a0: 3538 2220 7469 746c 653d 2243 616c 6c62 58" title="Callb │ │ │ │ -001625b0: 6163 6b20 7468 6174 2065 7865 6375 7465 ack that execute │ │ │ │ -001625c0: 7320 6469 7363 6f6e 6e65 6374 206c 6f67 s disconnect log │ │ │ │ -001625d0: 6963 2062 6566 6f72 6520 636c 6f73 696e ic before closin │ │ │ │ -001625e0: 672e 223e 736f 6170 3a3a 6664 6973 636f g.">soap::fdisco │ │ │ │ -001625f0: 6e6e 6563 743c 2f61 3e29 2873 7472 7563 nnect)(struc │ │ │ │ -00162600: 7420 736f 6170 202a 736f 6170 293c 2f63 t soap *soap)

.

This │ │ │ │ -00162620: 2063 616c 6c62 6163 6b20 6973 2063 616c callback is cal │ │ │ │ -00162630: 6c65 6420 6279 2074 6865 2065 6e67 696e led by the engin │ │ │ │ -00162640: 6520 3c63 6f64 653e 3c61 2063 6c61 7373 e soap_ │ │ │ │ -001626c0: 636c 6f73 6573 6f63 6b3c 2f61 3e3c 2f63 closesock before the │ │ │ │ -001626e0: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 soap::fcl │ │ │ │ -00162780: 6f73 653c 2f61 3e3c 2f63 6f64 653e 2063 ose c │ │ │ │ -00162790: 616c 6c62 6163 6b20 6973 2063 616c 6c65 allback is calle │ │ │ │ -001627a0: 6420 746f 2073 6875 7464 6f77 6e2f 6469 d to shutdown/di │ │ │ │ -001627b0: 7363 6f6e 6e65 6374 2e20 5265 7475 726e sconnect. Return │ │ │ │ -001627c0: 7320 3c63 6f64 653e 2353 4f41 505f 4f4b s #SOAP_OK │ │ │ │ -001627d0: 3c2f 636f 6465 3e20 6f72 2061 203c 636f or a soap_status< │ │ │ │ -001628a0: 2f61 3e3c 2f63 6f64 653e 2028 696e 7429 /a> (int) │ │ │ │ -001628b0: 2065 7272 6f72 2063 6f64 652e 204e 6f20 error code. No │ │ │ │ -001628c0: 6275 696c 742d 696e 2066 756e 6374 696f built-in functio │ │ │ │ -001628d0: 6e20 6973 2061 7373 6967 6e65 6420 746f n is assigned to │ │ │ │ -001628e0: 203c 636f 6465 3e3c 6120 636c 6173 733d soap │ │ │ │ -00162980: 3a3a 6664 6973 636f 6e6e 6563 743c 2f61 ::fdisconnect.

..fclos │ │ │ │ -001629d0: 6573 6f63 6b65 743c 2f68 333e 0a3c 703e esocket

.

│ │ │ │ -001629e0: 3c63 6f64 653e 696e 7420 283c 6120 636c int (soa │ │ │ │ -00162a70: 703a 3a66 636c 6f73 6573 6f63 6b65 743c p::fclosesocket< │ │ │ │ -00162a80: 2f61 3e29 2873 7472 7563 7420 736f 6170 /a>)(struct soap │ │ │ │ -00162a90: 202a 736f 6170 2c20 534f 4150 5f53 4f43 *soap, SOAP_SOC │ │ │ │ -00162aa0: 4b45 5420 736f 636b 293c 2f63 6f64 653e KET sock) │ │ │ │ -00162ab0: 3c2f 703e 0a3c 703e 5468 6973 2063 616c

.

This cal │ │ │ │ -00162ac0: 6c62 6163 6b20 6973 2063 616c 6c65 6420 lback is called │ │ │ │ -00162ad0: 746f 2063 6c6f 7365 2061 2073 6f63 6b65 to close a socke │ │ │ │ -00162ae0: 7420 6279 2074 6865 2065 6e67 696e 652e t by the engine. │ │ │ │ -00162af0: 2052 6574 7572 6e73 203c 636f 6465 3e23 Returns # │ │ │ │ -00162b00: 534f 4150 5f4f 4b3c 2f63 6f64 653e 206f SOAP_OK o │ │ │ │ -00162b10: 7220 6120 3c63 6f64 653e 3c61 2063 6c61 r a soap_ │ │ │ │ -00162bd0: 7374 6174 7573 3c2f 613e 3c2f 636f 6465 status (int) error co │ │ │ │ -00162bf0: 6465 2e20 5468 6520 6275 696c 742d 696e de. The built-in │ │ │ │ -00162c00: 2066 756e 6374 696f 6e20 6173 7369 676e function assign │ │ │ │ -00162c10: 6564 2074 6f20 3c63 6f64 653e 3c61 2063 ed to so │ │ │ │ -00162ca0: 6170 3a3a 6663 6c6f 7365 736f 636b 6574 ap::fclosesocket │ │ │ │ -00162cb0: 3c2f 613e 3c2f 636f 6465 3e20 6973 203c is < │ │ │ │ -00162cc0: 636f 6465 3e74 6370 5f63 6c6f 7365 736f code>tcp_closeso │ │ │ │ -00162cd0: 636b 6574 3c2f 636f 6465 3e2e 3c2f 703e cket.

│ │ │ │ -00162ce0: 0a3c 6833 3e3c 6120 636c 6173 733d 2261 .

.fs │ │ │ │ -00162d10: 6875 7464 6f77 6e73 6f63 6b65 743c 2f68 hutdownsocket.

int │ │ │ │ -00162d30: 283c 6120 636c 6173 733d 2265 6c22 2068 (soap::fsh │ │ │ │ -00162dc0: 7574 646f 776e 736f 636b 6574 3c2f 613e utdownsocket │ │ │ │ -00162dd0: 2928 7374 7275 6374 2073 6f61 7020 2a73 )(struct soap *s │ │ │ │ -00162de0: 6f61 702c 2053 4f41 505f 534f 434b 4554 oap, SOAP_SOCKET │ │ │ │ -00162df0: 2073 6f63 6b2c 2069 6e74 2068 6f77 293c sock, int how)< │ │ │ │ -00162e00: 2f63 6f64 653e 3c2f 703e 0a3c 703e 5468 /code>

.

Th │ │ │ │ -00162e10: 6973 2063 616c 6c62 6163 6b20 6973 2063 is callback is c │ │ │ │ -00162e20: 616c 6c65 6420 746f 2073 6875 7420 646f alled to shut do │ │ │ │ -00162e30: 776e 2061 2073 6f63 6b65 7420 6279 2074 wn a socket by t │ │ │ │ -00162e40: 6865 2065 6e67 696e 652e 2052 6574 7572 he engine. Retur │ │ │ │ -00162e50: 6e73 203c 636f 6465 3e23 534f 4150 5f4f ns #SOAP_O │ │ │ │ -00162e60: 4b3c 2f63 6f64 653e 206f 7220 6120 3c63 K or a soap_status │ │ │ │ -00162f30: 3c2f 613e 3c2f 636f 6465 3e20 2869 6e74 (int │ │ │ │ -00162f40: 2920 6572 726f 7220 636f 6465 2e20 5468 ) error code. Th │ │ │ │ -00162f50: 6520 6275 696c 742d 696e 2066 756e 6374 e built-in funct │ │ │ │ -00162f60: 696f 6e20 6173 7369 676e 6564 2074 6f20 ion assigned to │ │ │ │ -00162f70: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 soap │ │ │ │ -00163000: 3a3a 6673 6875 7464 6f77 6e73 6f63 6b65 ::fshutdownsocke │ │ │ │ -00163010: 743c 2f61 3e3c 2f63 6f64 653e 2069 7320 t is │ │ │ │ -00163020: 3c63 6f64 653e 7463 705f 7368 7574 646f tcp_shutdo │ │ │ │ -00163030: 776e 736f 636b 6574 3c2f 636f 6465 3e2e wnsocket. │ │ │ │ -00163040: 3c2f 703e 0a3c 6833 3e3c 6120 636c 6173

.

.fpoll

.

│ │ │ │ -00163080: 3c63 6f64 653e 696e 7420 283c 6120 636c int (soap::fpo │ │ │ │ -00163150: 6c6c 3c2f 613e 2928 7374 7275 6374 2073 ll)(struct s │ │ │ │ -00163160: 6f61 7020 2a73 6f61 7029 3c2f 636f 6465 oap *soap)

.

This ca │ │ │ │ -00163180: 6c6c 6261 636b 2069 7320 6361 6c6c 6564 llback is called │ │ │ │ -00163190: 2062 7920 7468 6520 656e 6769 6e65 2074 by the engine t │ │ │ │ -001631a0: 6f20 7761 6974 2066 6f72 2061 6374 6976 o wait for activ │ │ │ │ -001631b0: 6974 7920 6f6e 2074 6865 203c 636f 6465 ity on the soap::s │ │ │ │ -00163280: 6f63 6b65 743c 2f61 3e3c 2f63 6f64 653e ocket │ │ │ │ -00163290: 206f 7220 3c63 6f64 653e 3c61 2063 6c61 or soap::master socket │ │ │ │ -00163370: 2075 7369 6e67 203c 636f 6465 3e70 6f6c using pol │ │ │ │ -00163380: 6c3c 2f63 6f64 653e 206f 7220 3c63 6f64 l or select. │ │ │ │ -001633a0: 2054 696d 6573 206f 7574 2077 6865 6e20 Times out when │ │ │ │ -001633b0: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 so │ │ │ │ -00163460: 6170 3a3a 7365 6e64 5f74 696d 656f 7574 ap::send_timeout │ │ │ │ -00163470: 3c2f 613e 3c2f 636f 6465 3e20 6f72 203c or < │ │ │ │ -00163480: 636f 6465 3e3c 6120 636c 6173 733d 2265 code> │ │ │ │ -00163530: 736f 6170 3a3a 7265 6376 5f74 696d 656f soap::recv_timeo │ │ │ │ -00163540: 7574 3c2f 613e 3c2f 636f 6465 3e20 6172 ut ar │ │ │ │ -00163550: 6520 6e6f 6e7a 6572 6f2e 2052 6574 7572 e nonzero. Retur │ │ │ │ -00163560: 6e73 203c 636f 6465 3e23 534f 4150 5f4f ns #SOAP_O │ │ │ │ -00163570: 4b3c 2f63 6f64 653e 206f 7220 6120 3c63 K or a soap_status │ │ │ │ -00163640: 3c2f 613e 3c2f 636f 6465 3e20 2869 6e74 (int │ │ │ │ -00163650: 2920 6572 726f 7220 636f 6465 2e20 5468 ) error code. Th │ │ │ │ -00163660: 6520 6275 696c 742d 696e 2066 756e 6374 e built-in funct │ │ │ │ -00163670: 696f 6e20 6173 7369 676e 6564 2074 6f20 ion assigned to │ │ │ │ -00163680: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 soap::fpoll is soap_poll.

.

│ │ │ │ -001637a0: 3c2f 613e 0a66 7265 6376 3c2f 6833 3e0a .frecv

. │ │ │ │ -001637b0: 3c70 3e3c 636f 6465 3e73 697a 655f 7420

size_t │ │ │ │ -001637c0: 283c 6120 636c 6173 733d 2265 6c22 2068 (soap:: │ │ │ │ -00163860: 6672 6563 763c 2f61 3e29 2873 7472 7563 frecv)(struc │ │ │ │ -00163870: 7420 736f 6170 202a 736f 6170 2c20 6368 t soap *soap, ch │ │ │ │ -00163880: 6172 202a 6275 662c 2073 697a 655f 7420 ar *buf, size_t │ │ │ │ -00163890: 6c65 6e29 3c2f 636f 6465 3e3c 2f70 3e0a len)

. │ │ │ │ -001638a0: 3c70 3e54 6869 7320 6361 6c6c 6261 636b

This callback │ │ │ │ -001638b0: 2069 7320 6361 6c6c 6564 2062 7920 7468 is called by th │ │ │ │ -001638c0: 6520 656e 6769 6e65 2074 6f20 7265 6365 e engine to rece │ │ │ │ -001638d0: 6976 6520 286f 7220 7265 6164 2920 6461 ive (or read) da │ │ │ │ -001638e0: 7461 2069 6e74 6f20 6120 7370 6563 6966 ta into a specif │ │ │ │ -001638f0: 6965 6420 6275 6666 6572 203c 636f 6465 ied buffer buf and │ │ │ │ -00163910: 3c63 6f64 653e 6c65 6e3c 2f63 6f64 653e len │ │ │ │ -00163920: 2e20 5468 6520 736f 7572 6365 2066 6f72 . The source for │ │ │ │ -00163930: 2074 6865 2064 6174 6120 746f 2072 6561 the data to rea │ │ │ │ -00163940: 6420 6279 2074 6869 7320 6361 6c6c 6261 d by this callba │ │ │ │ -00163950: 636b 2069 7320 3c63 6f64 653e 3c61 2063 ck is soap::is │ │ │ │ -00163a20: 3c2f 636f 6465 3e20 7768 656e 206e 6f6e when non │ │ │ │ -00163a30: 2d4e 554c 4c2c 203c 636f 6465 3e3c 6120 -NULL, soap::socke │ │ │ │ -00163b00: 743c 2f61 3e3c 2f63 6f64 653e 2077 6865 t whe │ │ │ │ -00163b10: 6e20 7661 6c69 642c 206f 7220 3c63 6f64 n valid, or soap:: │ │ │ │ -00163be0: 7265 6376 6664 3c2f 613e 3c2f 636f 6465 recvfd. Returns #SOAP_OK │ │ │ │ -00163c10: 206f 7220 6120 3c63 6f64 653e 3c61 2063 or a soa │ │ │ │ -00163cd0: 705f 7374 6174 7573 3c2f 613e 3c2f 636f p_status (int) error │ │ │ │ -00163cf0: 636f 6465 2e20 5468 6520 6275 696c 742d code. The built- │ │ │ │ -00163d00: 696e 2066 756e 6374 696f 6e20 6173 7369 in function assi │ │ │ │ -00163d10: 676e 6564 2074 6f20 3c63 6f64 653e 3c61 gned to soap::fre │ │ │ │ -00163dc0: 6376 3c2f 613e 3c2f 636f 6465 3e20 6973 cv is │ │ │ │ -00163dd0: 203c 636f 6465 3e66 7265 6376 3c2f 636f frecv.

.

.fsend

│ │ │ │ -00163e20: 0a3c 703e 3c63 6f64 653e 696e 7420 283c .

int (< │ │ │ │ -00163e30: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ -00163e40: 663d 2267 726f 7570 5f5f 6772 6f75 705f f="group__group_ │ │ │ │ -00163e50: 5f63 616c 6c62 6163 6b73 2e68 746d 6c23 _callbacks.html# │ │ │ │ -00163e60: 6761 6664 3532 6238 3036 3535 6534 6631 gafd52b80655e4f1 │ │ │ │ -00163e70: 3032 3165 6464 3663 3535 6238 6466 6564 021edd6c55b8dfed │ │ │ │ -00163e80: 6666 2220 7469 746c 653d 2243 616c 6c62 ff" title="Callb │ │ │ │ -00163e90: 6163 6b20 7468 6174 2073 656e 6473 2074 ack that sends t │ │ │ │ -00163ea0: 6865 2067 6976 656e 2062 7974 6573 206f he given bytes o │ │ │ │ -00163eb0: 6620 6461 7461 2e22 3e73 6f61 703a 3a66 f data.">soap::f │ │ │ │ -00163ec0: 7365 6e64 3c2f 613e 2928 7374 7275 6374 send)(struct │ │ │ │ -00163ed0: 2073 6f61 7020 2a73 6f61 702c 2063 6f6e soap *soap, con │ │ │ │ -00163ee0: 7374 2063 6861 7220 2a62 7566 2c20 7369 st char *buf, si │ │ │ │ -00163ef0: 7a65 5f74 206c 656e 293c 2f63 6f64 653e ze_t len) │ │ │ │ -00163f00: 3c2f 703e 0a3c 703e 5468 6973 2063 616c

.

This cal │ │ │ │ -00163f10: 6c62 6163 6b20 6973 2063 616c 6c65 6420 lback is called │ │ │ │ -00163f20: 6279 2074 6865 2065 6e67 696e 6520 746f by the engine to │ │ │ │ -00163f30: 2073 656e 6420 286f 7220 7772 6974 6529 send (or write) │ │ │ │ -00163f40: 2064 6174 6120 7370 6563 6966 6965 6420 data specified │ │ │ │ -00163f50: 6279 203c 636f 6465 3e64 6174 613c 2f63 by data bytes of le │ │ │ │ -00163f70: 6e67 7468 203c 636f 6465 3e6c 656e 3c2f ngth len. The sink │ │ │ │ -00163f90: 666f 7220 7468 6520 6461 7461 2074 6f20 for the data to │ │ │ │ -00163fa0: 6265 2073 656e 7420 746f 2069 7320 7479 be sent to is ty │ │ │ │ -00163fb0: 7069 6361 6c6c 7920 3c63 6f64 653e 3c61 pically soap::sock │ │ │ │ -00164080: 6574 3c2f 613e 3c2f 636f 6465 3e2c 203c et, < │ │ │ │ -00164090: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soa │ │ │ │ -00164150: 703a 3a73 656e 6466 643c 2f61 3e3c 2f63 p::sendfd or soap::os. Retur │ │ │ │ -00164240: 6e73 203c 636f 6465 3e23 534f 4150 5f4f ns #SOAP_O │ │ │ │ -00164250: 4b3c 2f63 6f64 653e 206f 7220 6120 3c63 K or a soap_status │ │ │ │ -00164320: 3c2f 613e 3c2f 636f 6465 3e20 2869 6e74 (int │ │ │ │ -00164330: 2920 6572 726f 7220 636f 6465 2e20 5468 ) error code. Th │ │ │ │ -00164340: 6520 6275 696c 742d 696e 2066 756e 6374 e built-in funct │ │ │ │ -00164350: 696f 6e20 6173 7369 676e 6564 2074 6f20 ion assigned to │ │ │ │ -00164360: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 │ │ │ │ -001643f0: 736f 6170 3a3a 6673 656e 643c 2f61 3e3c soap::fsend< │ │ │ │ -00164400: 2f63 6f64 653e 2069 7320 3c63 6f64 653e /code> is │ │ │ │ -00164410: 6673 656e 643c 2f63 6f64 653e 2e3c 2f70 fsend.

.

.f │ │ │ │ -00164450: 7365 7276 6572 6c6f 6f70 3c2f 6833 3e0a serverloop

. │ │ │ │ -00164460: 3c70 3e3c 636f 6465 3e69 6e74 2028 3c61

int (soap::fserve │ │ │ │ -00164540: 6c6f 6f70 3c2f 613e 2928 7374 7275 6374 loop)(struct │ │ │ │ -00164550: 2073 6f61 7020 2a73 6f61 7029 3c2f 636f soap *soap)

.

This │ │ │ │ -00164570: 6361 6c6c 6261 636b 2069 7320 6361 6c6c callback is call │ │ │ │ -00164580: 6564 2061 6674 6572 2065 6163 6820 7375 ed after each su │ │ │ │ -00164590: 6363 6573 7366 756c 2063 6f6d 706c 6574 ccessful complet │ │ │ │ -001645a0: 696f 6e20 6f66 2061 2073 6572 7665 7220 ion of a server │ │ │ │ -001645b0: 6f70 6572 6174 696f 6e20 696e 2074 6865 operation in the │ │ │ │ -001645c0: 2073 6572 7665 7220 6c6f 6f70 2e20 4578 server loop. Ex │ │ │ │ -001645d0: 6563 7574 6573 2069 6d6d 6564 6961 7465 ecutes immediate │ │ │ │ -001645e0: 6c79 2061 6674 6572 2073 656e 6469 6e67 ly after sending │ │ │ │ -001645f0: 2074 6865 2072 6573 706f 6e73 6520 746f the response to │ │ │ │ -00164600: 2061 2063 6c69 656e 7420 616e 6420 6265 a client and be │ │ │ │ -00164610: 666f 7265 2074 6865 206e 6578 7420 6b65 fore the next ke │ │ │ │ -00164620: 6570 2d61 6c69 7665 2073 6572 7665 7220 ep-alive server │ │ │ │ -00164630: 6c6f 6f70 2069 7465 7261 7469 6f6e 2077 loop iteration w │ │ │ │ -00164640: 6865 6e20 656e 6162 6c65 6420 7769 7468 hen enabled with │ │ │ │ -00164650: 203c 636f 6465 3e23 534f 4150 5f49 4f5f #SOAP_IO_ │ │ │ │ -00164660: 4b45 4550 414c 4956 453c 2f63 6f64 653e KEEPALIVE │ │ │ │ -00164670: 2e20 5468 6973 2063 616c 6c62 6163 6b20 . This callback │ │ │ │ -00164680: 6361 6e20 6265 2075 7365 6420 746f 2072 can be used to r │ │ │ │ -00164690: 6563 6c61 696d 2072 6573 6f75 7263 6573 eclaim resources │ │ │ │ -001646a0: 2069 6e20 7468 6520 6b65 6570 2d61 6c69 in the keep-ali │ │ │ │ -001646b0: 7665 2073 6572 7665 7220 6c6f 6f70 2c20 ve server loop, │ │ │ │ -001646c0: 666f 7220 6578 616d 706c 6520 6d61 6e61 for example mana │ │ │ │ -001646d0: 6765 6420 6d65 6d6f 7279 2063 616e 2062 ged memory can b │ │ │ │ -001646e0: 6520 7265 636c 6169 6d65 6420 6279 2063 e reclaimed by c │ │ │ │ -001646f0: 616c 6c69 6e67 203c 636f 6465 3e3c 6120 alling soap │ │ │ │ -001647b0: 5f64 6573 7472 6f79 3c2f 613e 3c2f 636f _destroy and soap_end in that or │ │ │ │ -001648b0: 6465 7220 616e 6420 616c 6c20 6465 7365 der and all dese │ │ │ │ -001648c0: 7269 616c 697a 6564 2061 6e64 206f 7468 rialized and oth │ │ │ │ -001648d0: 6572 2064 796e 616d 6963 616c 6c79 2d61 er dynamically-a │ │ │ │ -001648e0: 6c6c 6f63 6174 6564 2064 6174 6120 6d61 llocated data ma │ │ │ │ -001648f0: 6e61 6765 6420 6279 2074 6865 2063 6f6e naged by the con │ │ │ │ -00164900: 7465 7874 2077 696c 6c20 6265 2064 6561 text will be dea │ │ │ │ -00164910: 6c6c 6f63 6174 6564 2e20 5265 7475 726e llocated. Return │ │ │ │ -00164920: 7320 3c63 6f64 653e 2353 4f41 505f 4f4b s #SOAP_OK │ │ │ │ -00164930: 3c2f 636f 6465 3e20 6f72 2061 203c 636f or a soap_status< │ │ │ │ -00164a00: 2f61 3e3c 2f63 6f64 653e 2028 696e 7429 /a> (int) │ │ │ │ -00164a10: 2065 7272 6f72 2063 6f64 652e 204e 6f20 error code. No │ │ │ │ -00164a20: 6275 696c 742d 696e 2066 756e 6374 696f built-in functio │ │ │ │ -00164a30: 6e20 6973 2061 7373 6967 6e65 6420 746f n is assigned to │ │ │ │ -00164a40: 203c 636f 6465 3e3c 6120 636c 6173 733d soa │ │ │ │ -00164b10: 703a 3a66 7365 7276 656c 6f6f 703c 2f61 p::fserveloop.

..fmall │ │ │ │ -00164b60: 6f63 3c2f 6833 3e0a 3c70 3e3c 636f 6465 oc

.

void (soap::fmalloc │ │ │ │ -00164c20: 3c2f 613e 2928 7374 7275 6374 2073 6f61 )(struct soa │ │ │ │ -00164c30: 7020 2a73 6f61 702c 2073 697a 655f 7420 p *soap, size_t │ │ │ │ -00164c40: 7369 7a65 293c 2f63 6f64 653e 3c2f 703e size)

│ │ │ │ -00164c50: 0a3c 703e 5468 6973 2063 616c 6c62 6163 .

This callbac │ │ │ │ -00164c60: 6b20 6361 6e20 6265 2075 7365 6420 746f k can be used to │ │ │ │ -00164c70: 206f 7665 7272 6964 6520 6d65 6d6f 7279 override memory │ │ │ │ -00164c80: 2061 6c6c 6f63 6174 696f 6e20 616e 6420 allocation and │ │ │ │ -00164c90: 6d61 6e61 6765 6d65 6e74 2064 6f6e 6520 management done │ │ │ │ -00164ca0: 6279 203c 636f 6465 3e3c 6120 636c 6173 by soap_ │ │ │ │ -00164d50: 6d61 6c6c 6f63 3c2f 613e 3c2f 636f 6465 malloc in C. Memory a │ │ │ │ -00164d70: 6c6c 6f63 6174 6564 2076 6961 2074 6869 llocated via thi │ │ │ │ -00164d80: 7320 6361 6c6c 6261 636b 2077 696c 6c20 s callback will │ │ │ │ -00164d90: 6e6f 7420 6265 206d 616e 6167 6564 2061 not be managed a │ │ │ │ -00164da0: 6e64 206e 6f74 2062 6520 6175 746f 6d61 nd not be automa │ │ │ │ -00164db0: 7469 6361 6c6c 7920 7265 6c65 6173 6564 tically released │ │ │ │ -00164dc0: 2062 7920 7468 6520 656e 6769 6e65 2e20 by the engine. │ │ │ │ -00164dd0: 496e 7374 6561 642c 2074 6865 2061 7070 Instead, the app │ │ │ │ -00164de0: 6c69 6361 7469 6f6e 2075 7369 6e67 2074 lication using t │ │ │ │ -00164df0: 6869 7320 6361 6c6c 6261 636b 2073 686f his callback sho │ │ │ │ -00164e00: 756c 6420 7265 6c65 6173 6520 616c 6c6f uld release allo │ │ │ │ -00164e10: 6361 7465 6420 6d65 6d6f 7279 2e20 416c cated memory. Al │ │ │ │ -00164e20: 6c20 616c 6c6f 6361 7469 6f6e 7320 646f l allocations do │ │ │ │ -00164e30: 6e65 2062 7920 3c63 6f64 653e 3c61 2063 ne by so │ │ │ │ -00164ee0: 6170 5f6d 616c 6c6f 633c 2f61 3e3c 2f63 ap_malloc are replace │ │ │ │ -00164f00: 6420 7769 7468 2061 2063 616c 6c20 746f d with a call to │ │ │ │ -00164f10: 203c 636f 6465 3e3c 6120 636c 6173 733d soap::fmalloc │ │ │ │ -00164fc0: 3c2f 613e 3c2f 636f 6465 3e2e 2048 6f77 . How │ │ │ │ -00164fd0: 6576 6572 2c20 6e6f 206f 7468 6572 2061 ever, no other a │ │ │ │ -00164fe0: 6c6c 6f63 6174 696f 6e73 2c20 7375 6368 llocations, such │ │ │ │ -00164ff0: 2061 7320 3c63 6f64 653e 3c61 2063 6c61 as soap_new and s │ │ │ │ -001650a0: 6f61 705f 6e65 775f 543c 2f63 6f64 653e oap_new_T │ │ │ │ -001650b0: 2066 6f72 2043 2b2b 2063 6c61 7373 6573 for C++ classes │ │ │ │ -001650c0: 203c 636f 6465 3e54 3c2f 636f 6465 3e20 T │ │ │ │ -001650d0: 6172 6520 6166 6665 6374 6564 2c20 6265 are affected, be │ │ │ │ -001650e0: 6361 7573 6520 6f62 6a65 6374 7320 6172 cause objects ar │ │ │ │ -001650f0: 6520 616c 6c6f 6361 7465 6420 6469 6666 e allocated diff │ │ │ │ -00165100: 6572 656e 746c 792e 2054 6869 7320 6361 erently. This ca │ │ │ │ -00165110: 6c6c 6261 636b 2069 7320 7468 6572 6566 llback is theref │ │ │ │ -00165120: 6f72 6520 6e6f 7420 7573 6566 756c 2066 ore not useful f │ │ │ │ -00165130: 6f72 2043 2b2b 2061 7070 6c69 6361 7469 or C++ applicati │ │ │ │ -00165140: 6f6e 732e 2052 6574 7572 6e73 2061 2070 ons. Returns a p │ │ │ │ -00165150: 6f69 6e74 6572 2074 6f20 6479 6e61 6d69 ointer to dynami │ │ │ │ -00165160: 6361 6c6c 7920 616c 6c6f 6361 7465 6420 cally allocated │ │ │ │ -00165170: 6d65 6d6f 7279 206f 7220 4e55 4c4c 206f memory or NULL o │ │ │ │ -00165180: 6e20 6661 696c 7572 6520 746f 2061 6c6c n failure to all │ │ │ │ -00165190: 6f63 6174 652e 204e 6f20 6275 696c 742d ocate. No built- │ │ │ │ -001651a0: 696e 2066 756e 6374 696f 6e20 6973 2061 in function is a │ │ │ │ -001651b0: 7373 6967 6e65 6420 746f 203c 636f 6465 ssigned to soa │ │ │ │ -00165260: 703a 3a66 6d61 6c6c 6f63 3c2f 613e 3c2f p::fmalloc.

.
Warni │ │ │ │ -001652a0: 6e67 3c2f 6474 3e3c 6464 3e44 6570 7265 ng
Depre │ │ │ │ -001652b0: 6361 7465 6420 7369 6e63 6520 322e 382e cated since 2.8. │ │ │ │ -001652c0: 3732 2e20 4465 6669 6e65 203c 636f 6465 72. Define #SOAP_MALLOC and # │ │ │ │ -001652f0: 534f 4150 5f46 5245 453c 2f63 6f64 653e SOAP_FREE │ │ │ │ -00165300: 2069 6e73 7465 6164 2e3c 2f64 643e 3c2f instead.
.

│ │ │ │ -00165340: 0a75 7365 7220 7661 7269 6162 6c65 3c2f .user variable.

A v │ │ │ │ -00165360: 6f69 642a 203c 6120 636c 6173 733d 2265 oid* soa │ │ │ │ -00165420: 703a 3a75 7365 723c 2f61 3e3c 2f63 6f64 p::user variable is a │ │ │ │ -00165440: 7661 696c 6162 6c65 2074 6f20 7061 7373 vailable to pass │ │ │ │ -00165450: 2075 7365 722d 6465 6669 6e65 6420 6461 user-defined da │ │ │ │ -00165460: 7461 2074 6f20 7468 6520 6361 6c6c 6261 ta to the callba │ │ │ │ -00165470: 636b 732e 3c2f 703e 0a3c 6833 3e3c 6120 cks.

.

.Examples.

The follo │ │ │ │ -001654c0: 7769 6e67 2065 7861 6d70 6c65 2075 7365 wing example use │ │ │ │ -001654d0: 7320 492f 4f20 6361 6c6c 6261 636b 7320 s I/O callbacks │ │ │ │ -001654e0: 666f 7220 6375 7374 6f6d 697a 6564 2073 for customized s │ │ │ │ -001654f0: 6572 6961 6c69 7a61 7469 6f6e 206f 6620 erialization of │ │ │ │ -00165500: 6461 7461 2069 6e74 6f20 6120 6669 7865 data into a fixe │ │ │ │ -00165510: 642d 7369 7a65 2062 7566 6665 7220 616e d-size buffer an │ │ │ │ -00165520: 6420 6465 7365 7269 616c 697a 6174 696f d deserializatio │ │ │ │ -00165530: 6e20 6261 636b 2069 6e74 6f20 6120 6461 n back into a da │ │ │ │ -00165540: 7461 2073 7472 7563 7475 7265 3a3c 2f70 ta structure:

.
char │ │ │ │ -001655a0: 6275 665b 3130 3030 305d 3b20 3c73 7061 buf[10000]; // XML buffer │ │ │ │ -001655d0: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ │ -001655f0: 3c73 7061 6e20 636c 6173 733d 226b 6579 int
len1 = 0; │ │ │ │ -00165620: 2020 3c73 7061 6e20 636c 6173 733d 2263 // #char │ │ │ │ -00165640: 7320 7772 6974 7465 6e20 3c2f 7370 616e s written
.
int l │ │ │ │ -00165690: 656e 3220 3d20 303b 2020 2020 3c73 7061 en2 = 0; // #chars read │ │ │ │ -001656c0: 203c 2f73 7061 6e3e 3c2f 6469 763e 0a3c
.< │ │ │ │ -001656d0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001656e0: 3e20 3c2f 6469 763e 0a3c 6469 7620 636c >

.
// mysend: put │ │ │ │ -00165720: 584d 4c20 696e 2062 7566 5b5d 203c 2f73 XML in buf[]
.
int mysend(s │ │ │ │ -00165790: 7472 7563 743c 2f73 7061 6e3e 203c 6120 truct soap *soap, < │ │ │ │ -00165800: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -00165810: 6f72 6422 3e63 6f6e 7374 3c2f 7370 616e ord">const char │ │ │ │ -00165840: 3c2f 7370 616e 3e20 2a73 2c20 3c73 7061 *s, size_t n)
. │ │ │ │ -00165890: 7b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 {
.
if │ │ │ │ -001658d0: 286c 656e 3120 2b20 6e20 2667 743b 203c (len1 + n > < │ │ │ │ -001658e0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -001658f0: 6f72 6422 3e73 697a 656f 663c 2f73 7061 ord">sizeof(buf))
. │ │ │ │ -00165910: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
│ │ │ │ -00165940: 7265 7475 726e 3c2f 7370 616e 3e20 3c61 return SOAP_EOF; │ │ │ │ -001659b0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
strcp │ │ │ │ -001659d0: 7928 6275 6620 2b20 6c65 6e31 2c20 7329 y(buf + len1, s) │ │ │ │ -001659e0: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
len │ │ │ │ -00165a00: 3120 2b3d 206e 3b20 3c2f 6469 763e 0a3c 1 += n;
.< │ │ │ │ -00165a10: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -00165a20: 3e20 203c 7370 616e 2063 6c61 7373 3d22 > ret │ │ │ │ -00165a40: 7572 6e3c 2f73 7061 6e3e 203c 6120 636c urn S │ │ │ │ -00165aa0: 4f41 505f 4f4b 3c2f 613e 3b20 3c2f 6469 OAP_OK; .
}
. │ │ │ │ -00165ae0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
│ │ │ │ -00165b10: 2f2f 206d 7972 6563 763a 2067 6574 2058 // myrecv: get X │ │ │ │ -00165b20: 4d4c 2066 726f 6d20 6275 665b 5d20 3c2f ML from buf[]
.
size_t myrecv(struct │ │ │ │ -00165ba0: 203c 6120 636c 6173 733d 2263 6f64 6522 soap │ │ │ │ -00165bd0: 202a 3c61 2063 6c61 7373 3d22 636f 6465 *soap, cha │ │ │ │ -00165c20: 723c 2f73 7061 6e3e 202a 732c 203c 7370 r *s, size_t n)
.< │ │ │ │ -00165c60: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -00165c70: 3e7b 3c2f 6469 763e 0a3c 6469 7620 636c >{
.
if │ │ │ │ -00165cb0: 2028 6c65 6e32 202b 206e 2026 6774 3b20 (len2 + n > │ │ │ │ -00165cc0: 6c65 6e31 2920 3c2f 6469 763e 0a3c 6469 len1)
. │ │ │ │ -00165ce0: 2020 206e 203d 206c 656e 3120 2d20 6c65 n = len1 - le │ │ │ │ -00165cf0: 6e32 3b20 3c2f 6469 763e 0a3c 6469 7620 n2;
.
s │ │ │ │ -00165d10: 7472 6e63 7079 2873 2c20 6275 6620 2b20 trncpy(s, buf + │ │ │ │ -00165d20: 6c65 6e32 2c20 6e29 3b20 3c2f 6469 763e len2, n);
│ │ │ │ -00165d30: 0a3c 6469 7620 636c 6173 733d 226c 696e .
len2 += n; │ │ │ │ -00165d50: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
return n;
.} │ │ │ │ -00165db0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
.
in │ │ │ │ -00165e00: 743c 2f73 7061 6e3e 206d 6169 6e28 2920 t main() │ │ │ │ -00165e10: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
{
│ │ │ │ -00165e30: 0a3c 6469 7620 636c 6173 733d 226c 696e . │ │ │ │ -00165ed0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
struc │ │ │ │ -00165f00: 7420 3c2f 7370 616e 3e6e 735f 5f70 6572 t ns__per │ │ │ │ -00165f10: 736f 6e20 703b 203c 2f64 6976 3e0a 3c64 son p;
. │ │ │ │ -00165f30: 2020 3c61 2063 6c61 7373 3d22 636f 6465 soap_init │ │ │ │ -00165f90: 313c 2f61 3e28 2661 6d70 3b3c 6120 636c 1(&soap, S │ │ │ │ -00166020: 4f41 505f 584d 4c5f 5452 4545 3c2f 613e OAP_XML_TREE │ │ │ │ -00166030: 293b 203c 2f64 6976 3e0a 3c64 6976 2063 );
.
le │ │ │ │ -00166050: 6e31 203d 206c 656e 3220 3d20 303b 2020 n1 = len2 = 0; │ │ │ │ -00166060: 2020 203c 7370 616e 2063 6c61 7373 3d22 // rese │ │ │ │ -00166080: 7420 6275 6666 6572 2070 6f69 6e74 6572 t buffer pointer │ │ │ │ -00166090: 7320 3c2f 7370 616e 3e3c 2f64 6976 3e0a s
. │ │ │ │ -001660a0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
p.name = "J │ │ │ │ -001660e0: 6f68 6e20 446f 6526 7175 6f74 3b3c 2f73 ohn Doe";
. │ │ │ │ -00166110: 2070 2e61 6765 203d 2032 353b 203c 2f64 p.age = 25; .
s │ │ │ │ -00166160: 6f61 703c 2f61 3e2e 3c61 2063 6c61 7373 oap.f │ │ │ │ -001661c0: 7365 6e64 3c2f 613e 203d 206d 7973 656e send = mysen │ │ │ │ -001661d0: 643b 203c 7370 616e 2063 6c61 7373 3d22 d; // assi │ │ │ │ -001661f0: 676e 2063 616c 6c62 6163 6b20 3c2f 7370 gn callback
.
soap.frecv = │ │ │ │ -001662b0: 206d 7972 6563 763b 203c 7370 616e 2063 myrecv; / │ │ │ │ -001662d0: 2f20 6173 7369 676e 2063 616c 6c62 6163 / assign callbac │ │ │ │ -001662e0: 6b20 3c2f 7370 616e 3e3c 2f64 6976 3e0a k
. │ │ │ │ -001662f0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
if │ │ │ │ -00166320: 3c2f 7370 616e 3e20 2873 6f61 705f 7772 (soap_wr │ │ │ │ -00166330: 6974 655f 6e73 5f5f 7065 7273 6f6e 2826 ite_ns__person(& │ │ │ │ -00166340: 616d 703b 3c61 2063 6c61 7373 3d22 636f amp;soap< │ │ │ │ -00166370: 2f61 3e2c 2026 616d 703b 7029 293c 2f64 /a>, &p)).
{
. │ │ │ │ -001663a0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
soap_pr │ │ │ │ -00166410: 696e 745f 6661 756c 743c 2f61 3e28 2661 int_fault(&a │ │ │ │ -00166420: 6d70 3b3c 6120 636c 6173 733d 2263 6f64 mp;soap, stdout); .
exit(E │ │ │ │ -00166480: 5849 545f 4641 494c 5552 4529 3b20 3c2f XIT_FAILURE); .
}
.
│ │ │ │ -001664e0: 6966 3c2f 7370 616e 3e20 2873 6f61 705f if (soap_ │ │ │ │ -001664f0: 7265 6164 5f6e 735f 5f50 6572 736f 6e28 read_ns__Person( │ │ │ │ -00166500: 2661 6d70 3b3c 6120 636c 6173 733d 2263 &soap │ │ │ │ -00166530: 3c2f 613e 2c20 2661 6d70 3b70 2929 3c2f , &p)).
{
│ │ │ │ -00166560: 0a3c 6469 7620 636c 6173 733d 226c 696e .
soap_p │ │ │ │ -001665d0: 7269 6e74 5f66 6175 6c74 3c2f 613e 2826 rint_fault(& │ │ │ │ -001665e0: 616d 703b 3c61 2063 6c61 7373 3d22 636f amp;soap< │ │ │ │ -00166610: 2f61 3e2c 2073 7464 6f75 7429 3b20 3c2f /a>, stdout); .
exit( │ │ │ │ -00166640: 4558 4954 5f46 4149 4c55 5245 293b 203c EXIT_FAILURE); < │ │ │ │ -00166650: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
} .
soap │ │ │ │ -001666e0: 5f64 6573 7472 6f79 3c2f 613e 2826 616d _destroy(&am │ │ │ │ -001666f0: 703b 3c61 2063 6c61 7373 3d22 636f 6465 p;soap);
.
< │ │ │ │ -00166740: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -00166750: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ │ -00166760: 705f 5f63 6f6e 7465 7874 2e68 746d 6c23 p__context.html# │ │ │ │ -00166770: 6761 3831 6130 3039 6165 3165 6138 3235 ga81a009ae1ea825 │ │ │ │ -00166780: 6130 3565 3532 3431 6532 6237 6138 6563 a05e5241e2b7a8ec │ │ │ │ -00166790: 6539 223e 736f 6170 5f65 6e64 3c2f 613e e9">soap_end │ │ │ │ -001667a0: 2826 616d 703b 3c61 2063 6c61 7373 3d22 (&soa │ │ │ │ -001667d0: 703c 2f61 3e29 3b20 3c2f 6469 763e 0a3c p);
.< │ │ │ │ -001667e0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001667f0: 3e20 203c 6120 636c 6173 733d 2263 6f64 > soap_don │ │ │ │ -00166850: 653c 2f61 3e28 2661 6d70 3b3c 6120 636c e(&soap);.
}
.
size_ │ │ │ │ -00166990: 7428 2a20 6672 6563 7629 2873 7472 7563 t(* frecv)(struc │ │ │ │ -001669a0: 7420 736f 6170 202a 736f 6170 2c20 6368 t soap *soap, ch │ │ │ │ -001669b0: 6172 202a 6275 662c 2073 697a 655f 7420 ar *buf, size_t │ │ │ │ -001669c0: 6c65 6e29 3c2f 6469 763e 3c64 6976 2063 len)
Cal │ │ │ │ -001669e0: 6c62 6163 6b20 7468 6174 2072 6563 6569 lback that recei │ │ │ │ -001669f0: 7665 7320 6279 7465 7320 6f66 2064 6174 ves bytes of dat │ │ │ │ -00166a00: 6120 696e 746f 2074 6865 2067 6976 656e a into the given │ │ │ │ -00166a10: 2062 7566 6665 722e 3c2f 6469 763e 3c64 buffer.
Definition:< │ │ │ │ -00166a40: 2f62 3e20 7374 6473 6f61 7032 2e68 3a34 /b> stdsoap2.h:4 │ │ │ │ -00166a50: 3630 373c 2f64 6976 3e3c 2f64 6976 3e0a 607
. │ │ │ │ -00166a60: 3c64 6976 2063 6c61 7373 3d22 7474 6322
in │ │ │ │ -00166b40: 7428 2a20 6673 656e 6429 2873 7472 7563 t(* fsend)(struc │ │ │ │ -00166b50: 7420 736f 6170 202a 736f 6170 2c20 636f t soap *soap, co │ │ │ │ -00166b60: 6e73 7420 6368 6172 202a 6461 7461 2c20 nst char *data, │ │ │ │ -00166b70: 7369 7a65 5f74 206c 656e 293c 2f64 6976 size_t len)
Callback tha │ │ │ │ -00166ba0: 7420 7365 6e64 7320 7468 6520 6769 7665 t sends the give │ │ │ │ -00166bb0: 6e20 6279 7465 7320 6f66 2064 6174 612e n bytes of data. │ │ │ │ -00166bc0: 3c2f 6469 763e 3c64 6976 2063 6c61 7373
Defi │ │ │ │ -00166be0: 6e69 7469 6f6e 3a3c 2f62 3e20 7374 6473 nition: stds │ │ │ │ -00166bf0: 6f61 7032 2e68 3a34 3632 303c 2f64 6976 oap2.h:4620
.
< │ │ │ │ -00166c20: 703e 4120 6669 7865 642d 7369 7a65 2062 p>A fixed-size b │ │ │ │ -00166c30: 7566 6665 7220 746f 2073 746f 7265 2074 uffer to store t │ │ │ │ -00166c40: 6865 206f 7574 626f 756e 6420 6d65 7373 he outbound mess │ │ │ │ -00166c50: 6167 6520 7365 6e74 2069 7320 6e6f 7420 age sent is not │ │ │ │ -00166c60: 666c 6578 6962 6c65 2074 6f20 6861 6e64 flexible to hand │ │ │ │ -00166c70: 6c65 206c 6172 6765 2063 6f6e 7465 6e74 le large content │ │ │ │ -00166c80: 2e20 546f 2073 746f 7265 2074 6865 206d . To store the m │ │ │ │ -00166c90: 6573 7361 6765 2069 6e20 616e 2065 7870 essage in an exp │ │ │ │ -00166ca0: 616e 6469 6e67 2062 7566 6665 723a 3c2f anding buffer:.
struct b │ │ │ │ -00166d00: 7566 6665 7220 3c2f 6469 763e 0a3c 6469 uffer
.{ │ │ │ │ -00166d20: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
size_t len;
.< │ │ │ │ -00166d70: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -00166d80: 3e20 203c 7370 616e 2063 6c61 7373 3d22 > siz │ │ │ │ -00166da0: 655f 743c 2f73 7061 6e3e 206d 6178 3b20 e_t max; │ │ │ │ -00166db0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
char │ │ │ │ -00166df0: 202a 6275 663b 203c 2f64 6976 3e0a 3c64 *buf;
. │ │ │ │ -00166e10: 7d3b 203c 2f64 6976 3e0a 3c64 6976 2063 };
.
.
│ │ │ │ -00166e60: 696e 743c 2f73 7061 6e3e 206d 6169 6e28 int main( │ │ │ │ -00166e70: 2920 3c2f 6469 763e 0a3c 6469 7620 636c )
.
{.
str │ │ │ │ -00166ec0: 7563 7420 3c2f 7370 616e 3e3c 6120 636c uct soap soap; .
str │ │ │ │ -00166f60: 7563 7420 3c2f 7370 616e 3e6e 735f 5f70 uct ns__p │ │ │ │ -00166f70: 6572 736f 6e20 703b 203c 2f64 6976 3e0a erson p;
. │ │ │ │ -00166f80: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
struct │ │ │ │ -00166fb0: 203c 2f73 7061 6e3e 6275 6666 6572 202a buffer * │ │ │ │ -00166fc0: 6820 3d20 6d61 6c6c 6f63 283c 7370 616e h = malloc(sizeof(< │ │ │ │ -00166ff0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -00167000: 6f72 6422 3e73 7472 7563 743c 2f73 7061 ord">struct buffer)); .
h->le │ │ │ │ -00167040: 6e20 3d20 303b 203c 2f64 6976 3e0a 3c64 n = 0;
. │ │ │ │ -00167060: 2020 682d 2667 743b 6d61 7820 3d20 303b h->max = 0; │ │ │ │ -00167070: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
h-&g │ │ │ │ -00167090: 743b 6275 6620 3d20 4e55 4c4c 3b20 3c2f t;buf = NULL; . │ │ │ │ -001671c0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
soap │ │ │ │ -00167200: 3c2f 613e 2e3c 6120 636c 6173 733d 2263 .us │ │ │ │ -00167250: 6572 3c2f 613e 203d 2028 3c73 7061 6e20 er = (void* │ │ │ │ -00167280: 2968 3b20 3c73 7061 6e20 636c 6173 733d )h; // pas │ │ │ │ -001672a0: 7320 6275 6666 6572 2061 7320 6120 6861 s buffer as a ha │ │ │ │ -001672b0: 6e64 6c65 2074 6f20 7468 6520 6361 6c6c ndle to the call │ │ │ │ -001672c0: 6261 636b 203c 2f73 7061 6e3e 3c2f 6469 back .
so │ │ │ │ -00167310: 6170 3c2f 613e 2e3c 6120 636c 6173 733d ap.fs │ │ │ │ -00167370: 656e 643c 2f61 3e20 3d20 6d79 7365 6e64 end = mysend │ │ │ │ -00167380: 3b20 203c 7370 616e 2063 6c61 7373 3d22 ; // assi │ │ │ │ -001673a0: 676e 2063 616c 6c62 6163 6b20 3c2f 7370 gn callback
.
if (soap_write_ns │ │ │ │ -00167400: 5f5f 7065 7273 6f6e 2826 616d 703b 3c61 __person(&soap, & │ │ │ │ -00167440: 616d 703b 7029 293c 2f64 6976 3e0a 3c64 amp;p))
. │ │ │ │ -00167460: 2020 7b3c 2f64 6976 3e0a 3c64 6976 2063 {
.
│ │ │ │ -00167480: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap_print_fa │ │ │ │ -001674e0: 756c 743c 2f61 3e28 2661 6d70 3b3c 6120 ult(&soap, st │ │ │ │ -00167520: 646f 7574 293b 203c 2f64 6976 3e0a 3c64 dout);
. │ │ │ │ -00167540: 2020 2020 6578 6974 2845 5849 545f 4641 exit(EXIT_FA │ │ │ │ -00167550: 494c 5552 4529 3b20 3c2f 6469 763e 0a3c ILURE);
.< │ │ │ │ -00167560: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -00167570: 3e20 207d 203c 2f64 6976 3e0a 3c64 6976 > }
.
│ │ │ │ -00167590: 3c73 7061 6e20 636c 6173 733d 226b 6579 if (h->len) │ │ │ │ -001675c0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
{.
... // use h-> │ │ │ │ -00167620: 6275 665b 302e 2e68 2d26 6774 3b6c 656e buf[0..h->len │ │ │ │ -00167630: 2d31 5d20 636f 6e74 656e 7420 3c2f 7370 -1] content
.
│ │ │ │ -00167660: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // then cl │ │ │ │ -00167680: 6561 6e75 703a 203c 2f73 7061 6e3e 3c2f eanup: .
h-> │ │ │ │ -001676b0: 3b6c 656e 203d 2030 3b20 3c2f 6469 763e ;len = 0;
│ │ │ │ -001676c0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
h->max │ │ │ │ -001676e0: 203d 2030 3b20 3c2f 6469 763e 0a3c 6469 = 0;
. │ │ │ │ -00167700: 2020 2066 7265 6528 682d 2667 743b 6275 free(h->bu │ │ │ │ -00167710: 6629 3b20 3c2f 6469 763e 0a3c 6469 7620 f);
.
│ │ │ │ -00167730: 2068 2d26 6774 3b62 7566 203d 204e 554c h->buf = NUL │ │ │ │ -00167740: 4c3b 203c 2f64 6976 3e0a 3c64 6976 2063 L;
.
} │ │ │ │ -00167760: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
..< │ │ │ │ -00167820: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -00167830: 3e20 203c 6120 636c 6173 733d 2263 6f64 > soap_end │ │ │ │ -00167890: 3c2f 613e 2826 616d 703b 3c61 2063 6c61 (&soap); .
soap │ │ │ │ -00167940: 5f64 6f6e 653c 2f61 3e28 2661 6d70 3b3c _done(&< │ │ │ │ -00167950: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -00167960: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ -00167970: 6874 6d6c 223e 736f 6170 3c2f 613e 293b html">soap); │ │ │ │ -00167980: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
}
.
.
int mysend( │ │ │ │ -00167a10: 7374 7275 6374 3c2f 7370 616e 3e20 3c61 struct soap *< │ │ │ │ -00167a50: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -00167a60: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ -00167a70: 6874 6d6c 223e 736f 6170 3c2f 613e 2c20 html">soap, │ │ │ │ -00167a80: 3c73 7061 6e20 636c 6173 733d 226b 6579 const cha │ │ │ │ -00167ac0: 723c 2f73 7061 6e3e 202a 732c 203c 7370 r *s, size_t n)
.< │ │ │ │ -00167b00: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -00167b10: 3e7b 3c2f 6469 763e 0a3c 6469 7620 636c >{
.
struct buffer *h = (struct buffer*)soap->user; │ │ │ │ -00167c10: 203c 7370 616e 2063 6c61 7373 3d22 636f // get bu │ │ │ │ -00167c30: 6666 6572 2074 6872 6f75 6768 2068 616e ffer through han │ │ │ │ -00167c40: 646c 6520 3c2f 7370 616e 3e3c 2f64 6976 dle
.
│ │ │ │ -00167c80: 696e 743c 2f73 7061 6e3e 206d 203d 2068 int m = h │ │ │ │ -00167c90: 2d26 6774 3b6d 6178 2c20 6b20 3d20 682d ->max, k = h- │ │ │ │ -00167ca0: 2667 743b 6c65 6e20 2b20 6e3b 203c 2f64 >len + n; .
// │ │ │ │ -00167ce0: 206e 6565 6420 746f 2069 6e63 7265 6173 need to increas │ │ │ │ -00167cf0: 6520 7370 6163 653f 203c 2f73 7061 6e3e e space? │ │ │ │ -00167d00: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
if (m │ │ │ │ -00167d20: 203d 3d20 3029 203c 2f64 6976 3e0a 3c64 == 0)
. │ │ │ │ -00167d40: 2020 2020 6d20 3d20 3130 3234 3b20 3c2f m = 1024; .
else < │ │ │ │ -00167d90: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
while (k >= m) < │ │ │ │ -00167de0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
m │ │ │ │ -00167e00: 2a3d 2032 3b20 3c2f 6469 763e 0a3c 6469 *= 2;
. │ │ │ │ -00167e20: 203c 7370 616e 2063 6c61 7373 3d22 6b65 if
(m != h-> │ │ │ │ -00167e50: 3b6d 6178 2920 3c2f 6469 763e 0a3c 6469 ;max)
. │ │ │ │ -00167e70: 207b 3c2f 6469 763e 0a3c 6469 7620 636c {
.
< │ │ │ │ -00167e90: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -00167ea0: 6f72 6474 7970 6522 3e63 6861 723c 2f73 ordtype">char *buf = mall │ │ │ │ -00167ec0: 6f63 286d 293b 203c 2f64 6976 3e0a 3c64 oc(m);
. │ │ │ │ -00167ee0: 2020 2020 6d65 6d63 7079 2862 7566 2c20 memcpy(buf, │ │ │ │ -00167ef0: 682d 2667 743b 6275 662c 2068 2d26 6774 h->buf, h-> │ │ │ │ -00167f00: 3b6c 656e 293b 203c 2f64 6976 3e0a 3c64 ;len);
. │ │ │ │ -00167f20: 2020 2020 682d 2667 743b 6d61 7820 3d20 h->max = │ │ │ │ -00167f30: 6d3b 203c 2f64 6976 3e0a 3c64 6976 2063 m;
.
│ │ │ │ -00167f50: 3c73 7061 6e20 636c 6173 733d 226b 6579 if (h->buf) │ │ │ │ -00167f80: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
f │ │ │ │ -00167fa0: 7265 6528 682d 2667 743b 6275 6629 3b20 ree(h->buf); │ │ │ │ -00167fb0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
h-& │ │ │ │ -00167fd0: 6774 3b62 7566 203d 2062 7566 3b20 3c2f gt;buf = buf; .
}
.
memcpy(h-& │ │ │ │ -00168020: 6774 3b62 7566 202b 2068 2d26 6774 3b6c gt;buf + h->l │ │ │ │ -00168030: 656e 2c20 732c 206e 293b 203c 2f64 6976 en, s, n);
.
h->len │ │ │ │ -00168060: 2b3d 206e 3b20 3c2f 6469 763e 0a3c 6469 += n;
. │ │ │ │ -00168080: 203c 7370 616e 2063 6c61 7373 3d22 6b65 retur │ │ │ │ -001680a0: 6e3c 2f73 7061 6e3e 203c 6120 636c 6173 n SOA │ │ │ │ -00168100: 505f 4f4b 3c2f 613e 3b20 3c2f 6469 763e P_OK;
│ │ │ │ -00168110: 0a3c 6469 7620 636c 6173 733d 226c 696e .
}
.

The │ │ │ │ -00168670: 636c 6965 6e74 2070 726f 6772 616d 2069 client program i │ │ │ │ -00168680: 733a 3c2f 703e 0a3c 6469 7620 636c 6173 s:

.
< │ │ │ │ -001686b0: 7370 616e 2063 6c61 7373 3d22 7072 6570 span class="prep │ │ │ │ -001686c0: 726f 6365 7373 6f72 223e 2369 6e63 6c75 rocessor">#inclu │ │ │ │ -001686d0: 6465 2026 7175 6f74 3b73 6f61 7048 2e68 de "soapH.h │ │ │ │ -001686e0: 2671 756f 743b 3c2f 7370 616e 3e20 3c2f " .
#include " │ │ │ │ -00168730: 3b6e 732e 6e73 6d61 7026 7175 6f74 3b3c ;ns.nsmap"< │ │ │ │ -00168740: 2f73 7061 6e3e 203c 2f64 6976 3e0a 3c64 /span>
. │ │ │ │ -00168760: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
SOAP │ │ │ │ -001687d0: 5f53 4f43 4b45 543c 2f61 3e20 6d79 6f70 _SOCKET myop │ │ │ │ -001687e0: 656e 283c 7370 616e 2063 6c61 7373 3d22 en(struct< │ │ │ │ -00168800: 2f73 7061 6e3e 203c 6120 636c 6173 733d /span> so │ │ │ │ -00168830: 6170 3c2f 613e 202a 3c61 2063 6c61 7373 ap *s │ │ │ │ -00168860: 6f61 703c 2f61 3e2c 203c 7370 616e 2063 oap, c │ │ │ │ -00168880: 6f6e 7374 3c2f 7370 616e 3e20 3c73 7061 onst char *endpoint, const │ │ │ │ -001688e0: 3c73 7061 6e20 636c 6173 733d 226b 6579 char *host, int port)
.< │ │ │ │ -00168940: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -00168950: 3e7b 3c2f 6469 763e 0a3c 6469 7620 636c >{
.
if │ │ │ │ -00168990: 2028 7374 726e 636d 7028 656e 6470 6f69 (strncmp(endpoi │ │ │ │ -001689a0: 6e74 2c20 3c73 7061 6e20 636c 6173 733d nt, │ │ │ │ -001689c0: 2671 756f 743b 6669 6c65 3a26 7175 6f74 "file:" │ │ │ │ -001689d0: 3b3c 2f73 7061 6e3e 2c20 3529 2920 3c2f ;, 5)) .
{
│ │ │ │ -00168a00: 0a3c 6469 7620 636c 6173 733d 226c 696e .
printf(" │ │ │ │ -00168a40: 4669 6c65 206e 616d 6520 6578 7065 6374 File name expect │ │ │ │ -00168a50: 6564 5c6e 2671 756f 743b 3c2f 7370 616e ed\n");
.
│ │ │ │ -00168a80: 203c 7370 616e 2063 6c61 7373 3d22 6b65 retur │ │ │ │ -00168aa0: 6e3c 2f73 7061 6e3e 203c 6120 636c 6173 n SOAP_ │ │ │ │ -00168b00: 494e 5641 4c49 445f 534f 434b 4554 3c2f INVALID_SOCKET;
.
} │ │ │ │ -00168b30: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
..
│ │ │ │ -00168da0: 7265 7475 726e 3c2f 7370 616e 3e20 3c61 return soap-&g │ │ │ │ -00168de0: 743b 3c61 2063 6c61 7373 3d22 636f 6465 t;sendf │ │ │ │ -00168e30: 643c 2f61 3e3b 203c 2f64 6976 3e0a 3c64 d;
. │ │ │ │ -00168e50: 7d20 3c2f 6469 763e 0a3c 6469 7620 636c }
.
.
v │ │ │ │ -00168ea0: 6f69 643c 2f73 7061 6e3e 206d 7963 6c6f oid myclo │ │ │ │ -00168eb0: 7365 283c 7370 616e 2063 6c61 7373 3d22 se(struct< │ │ │ │ -00168ed0: 2f73 7061 6e3e 203c 6120 636c 6173 733d /span> so │ │ │ │ -00168f00: 6170 3c2f 613e 202a 3c61 2063 6c61 7373 ap *s │ │ │ │ -00168f30: 6f61 703c 2f61 3e29 203c 2f64 6976 3e0a oap)
. │ │ │ │ -00168f40: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
{
.
if (soap-> │ │ │ │ -00169010: 7365 6e64 6664 3c2f 613e 2026 6774 3b20 sendfd > │ │ │ │ -00169020: 3229 2020 3c73 7061 6e20 636c 6173 733d 2) // sti │ │ │ │ -00169040: 6c6c 206f 7065 6e3f 203c 2f73 7061 6e3e ll open? │ │ │ │ -00169050: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
clo │ │ │ │ -00169070: 7365 283c 6120 636c 6173 733d 2263 6f64 se(soap-> │ │ │ │ -001690f0: 7365 6e64 6664 3c2f 613e 293b 203c 7370 sendfd); // then close │ │ │ │ -00169120: 2069 7420 3c2f 7370 616e 3e3c 2f64 6976 it
.
soa │ │ │ │ -00169170: 703c 2f61 3e2d 2667 743b 3c61 2063 6c61 p->recvfd = │ │ │ │ -001691d0: 303b 2020 2020 2020 3c73 7061 6e20 636c 0; // │ │ │ │ -001691f0: 2073 6574 2062 6163 6b20 746f 2073 7464 set back to std │ │ │ │ -00169200: 696e 203c 2f73 7061 6e3e 3c2f 6469 763e in
│ │ │ │ -00169210: 0a3c 6469 7620 636c 6173 733d 226c 696e .
soap │ │ │ │ -00169250: 3c2f 613e 2d26 6774 3b3c 6120 636c 6173 ->sendfd = 1 │ │ │ │ -001692b0: 3b20 2020 2020 203c 7370 616e 2063 6c61 ; // │ │ │ │ -001692d0: 7365 7420 6261 636b 2074 6f20 7374 646f set back to stdo │ │ │ │ -001692e0: 7574 203c 2f73 7061 6e3e 3c2f 6469 763e ut
│ │ │ │ -001692f0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
}
.
< │ │ │ │ -00169320: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
int myp │ │ │ │ -00169360: 6f73 7428 3c73 7061 6e20 636c 6173 733d ost(struct │ │ │ │ -00169380: 3c2f 7370 616e 3e20 3c61 2063 6c61 7373 s │ │ │ │ -001693b0: 6f61 703c 2f61 3e20 2a3c 6120 636c 6173 oap * │ │ │ │ -001693e0: 736f 6170 3c2f 613e 2c20 3c73 7061 6e20 soap, │ │ │ │ -00169400: 636f 6e73 743c 2f73 7061 6e3e 203c 7370 const char *endpoint, const │ │ │ │ -00169460: 203c 7370 616e 2063 6c61 7373 3d22 6b65 char< │ │ │ │ -00169480: 2f73 7061 6e3e 202a 686f 7374 2c20 3c73 /span> *host, const │ │ │ │ -001694b0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 char< │ │ │ │ -001694d0: 2f73 7061 6e3e 202a 7061 7468 2c20 3c73 /span> *path, const │ │ │ │ -00169500: 203c 7370 616e 2063 6c61 7373 3d22 6b65 char< │ │ │ │ -00169520: 2f73 7061 6e3e 202a 6163 7469 6f6e 2c20 /span> *action, │ │ │ │ -00169530: 3c61 2063 6c61 7373 3d22 636f 6465 2220 ULONG64 co │ │ │ │ -00169590: 756e 7429 203c 2f64 6976 3e0a 3c64 6976 unt)
.
{< │ │ │ │ -001695b0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
return soap_send( │ │ │ │ -00169650: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap, │ │ │ │ -00169680: 203c 7370 616e 2063 6c61 7373 3d22 7374 &qu │ │ │ │ -001696a0: 6f74 3b43 7573 746f 6d2d 6765 6e65 7261 ot;Custom-genera │ │ │ │ -001696b0: 7465 6420 6669 6c65 5c6e 2671 756f 743b ted file\n" │ │ │ │ -001696c0: 3c2f 7370 616e 3e29 3b20 3c73 7061 6e20 ); │ │ │ │ -001696e0: 2f2f 2077 7269 7465 7320 746f 2073 6f61 // writes to soa │ │ │ │ -001696f0: 702d 2667 743b 7365 6e64 6664 203c 2f73 p->sendfd
.
} < │ │ │ │ -00169720: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
. │ │ │ │ -00169740: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
int< │ │ │ │ -00169770: 2f73 7061 6e3e 206d 7970 6172 7365 283c /span> myparse(< │ │ │ │ -00169780: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -00169790: 6f72 6422 3e73 7472 7563 743c 2f73 7061 ord">struct soap *soap< │ │ │ │ -00169800: 2f61 3e29 203c 2f64 6976 3e0a 3c64 6976 /a>)
.
{< │ │ │ │ -00169820: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
char │ │ │ │ -00169860: 6275 665b 3235 365d 3b20 3c2f 6469 763e buf[256];
│ │ │ │ -00169870: 0a3c 6469 7620 636c 6173 733d 226c 696e .
i │ │ │ │ -001698a0: 663c 2f73 7061 6e3e 2028 6c73 6565 6b28 f (lseek( │ │ │ │ -001698b0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap- │ │ │ │ -001698e0: 2667 743b 3c61 2063 6c61 7373 3d22 636f >rec │ │ │ │ -00169930: 7666 643c 2f61 3e2c 2030 2c20 5345 454b vfd, 0, SEEK │ │ │ │ -00169940: 5f53 4554 2920 266c 743b 2030 207c 7c20 _SET) < 0 || │ │ │ │ -00169950: 3c61 2063 6c61 7373 3d22 636f 6465 2220 │ │ │ │ -001699a0: 736f 6170 5f67 6574 6c69 6e65 3c2f 613e soap_getline │ │ │ │ -001699b0: 283c 6120 636c 6173 733d 2263 6f64 6522 (soap │ │ │ │ -001699e0: 2c20 6275 662c 2032 3536 2929 203c 7370 , buf, 256)) // go to begi │ │ │ │ -00169a10: 6e20 616e 6420 736b 6970 2063 7573 746f n and skip custo │ │ │ │ -00169a20: 6d20 6865 6164 6572 203c 2f73 7061 6e3e m header │ │ │ │ -00169a30: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
. │ │ │ │ -00169af0: 2020 3c73 7061 6e20 636c 6173 733d 226b retu │ │ │ │ -00169b10: 726e 3c2f 7370 616e 3e20 3c61 2063 6c61 rn SO │ │ │ │ -00169b70: 4150 5f4f 4b3c 2f61 3e3b 203c 2f64 6976 AP_OK;
.
}
. │ │ │ │ -00169bb0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
int ma │ │ │ │ -00169bf0: 696e 2829 203c 2f64 6976 3e0a 3c64 6976 in()
.
{< │ │ │ │ -00169c10: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ -00169c40: 7374 7275 6374 203c 2f73 7061 6e3e 3c61 struct soap soap; < │ │ │ │ -00169cb0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ -00169ce0: 7374 7275 6374 203c 2f73 7061 6e3e 6e73 struct ns │ │ │ │ -00169cf0: 5f5f 7465 7374 2072 3b20 3c2f 6469 763e __test r;
│ │ │ │ -00169d00: 0a3c 6469 7620 636c 6173 733d 226c 696e .
struc │ │ │ │ -00169d30: 7420 3c2f 7370 616e 3e6e 735f 5f70 6572 t ns__per │ │ │ │ -00169d40: 736f 6e20 703b 203c 2f64 6976 3e0a 3c64 son p;
. │ │ │ │ -00169d60: 2020 3c61 2063 6c61 7373 3d22 636f 6465 soap_init │ │ │ │ -00169dc0: 3c2f 613e 2826 616d 703b 3c61 2063 6c61 (&soap);
.
p.name = < │ │ │ │ -00169e20: 7370 616e 2063 6c61 7373 3d22 7374 7269 span class="stri │ │ │ │ -00169e30: 6e67 6c69 7465 7261 6c22 3e26 7175 6f74 ngliteral">" │ │ │ │ -00169e40: 3b4a 6f68 6e20 446f 6526 7175 6f74 3b3c ;John Doe"< │ │ │ │ -00169e50: 2f73 7061 6e3e 3b20 3c2f 6469 763e 0a3c /span>;
.< │ │ │ │ -00169e60: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -00169e70: 3e20 2070 2e61 6765 203d 2039 393b 203c > p.age = 99; < │ │ │ │ -00169e80: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
soap.fopen = myo │ │ │ │ -00169f30: 7065 6e3b 2020 203c 7370 616e 2063 6c61 pen; // │ │ │ │ -00169f50: 7573 6520 6375 7374 6f6d 206f 7065 6e20 use custom open │ │ │ │ -00169f60: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
. │ │ │ │ -00169f80: 2020 3c61 2063 6c61 7373 3d22 636f 6465 soap.fpost = mypost; < │ │ │ │ -0016a020: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ -0016a030: 656e 7422 3e2f 2f20 7573 6520 6375 7374 ent">// use cust │ │ │ │ -0016a040: 6f6d 2070 6f73 7420 3c2f 7370 616e 3e3c om post < │ │ │ │ -0016a050: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
soap.fparse = my │ │ │ │ -0016a100: 7061 7273 653b 203c 7370 616e 2063 6c61 parse; // │ │ │ │ -0016a120: 7573 6520 6375 7374 6f6d 2072 6573 706f use custom respo │ │ │ │ -0016a130: 6e73 6520 7061 7273 6572 203c 2f73 7061 nse parser
.
soap.fclose = │ │ │ │ -0016a1f0: 206d 7963 6c6f 7365 3b20 3c73 7061 6e20 myclose; │ │ │ │ -0016a210: 2f2f 2075 7365 2063 7573 746f 6d20 636c // use custom cl │ │ │ │ -0016a220: 6f73 6520 3c2f 7370 616e 3e3c 2f64 6976 ose
.
soap_call_ │ │ │ │ -0016a250: 6e73 5f5f 7465 7374 2826 616d 703b 3c61 ns__test(&soap, < │ │ │ │ -0016a290: 7370 616e 2063 6c61 7373 3d22 7374 7269 span class="stri │ │ │ │ -0016a2a0: 6e67 6c69 7465 7261 6c22 3e26 7175 6f74 ngliteral">" │ │ │ │ -0016a2b0: 3b66 696c 653a 2f2f 7465 7374 2e78 6d6c ;file://test.xml │ │ │ │ -0016a2c0: 2671 756f 743b 3c2f 7370 616e 3e2c 203c ", < │ │ │ │ -0016a2d0: 7370 616e 2063 6c61 7373 3d22 7374 7269 span class="stri │ │ │ │ -0016a2e0: 6e67 6c69 7465 7261 6c22 3e26 7175 6f74 ngliteral">" │ │ │ │ -0016a2f0: 3b26 7175 6f74 3b3c 2f73 7061 6e3e 2c20 ;", │ │ │ │ -0016a300: 702c 2072 293b 203c 2f64 6976 3e0a 3c64 p, r);
. │ │ │ │ -0016a320: 2020 3c73 7061 6e20 636c 6173 733d 226b if (so │ │ │ │ -0016a370: 6170 3c2f 613e 2e3c 6120 636c 6173 733d ap. │ │ │ │ -0016a3c0: 6572 726f 723c 2f61 3e29 203c 2f64 6976 error)
.
{
. │ │ │ │ -0016a400: 2020 2020 3c61 2063 6c61 7373 3d22 636f soap_prin │ │ │ │ -0016a460: 745f 6661 756c 743c 2f61 3e28 2661 6d70 t_fault(& │ │ │ │ -0016a470: 3b3c 6120 636c 6173 733d 2263 6f64 6522 ;soap │ │ │ │ -0016a4a0: 2c20 7374 646f 7574 293b 203c 2f64 6976 , stdout);
.
exit(EXI │ │ │ │ -0016a4d0: 545f 4641 494c 5552 4529 3b20 3c2f 6469 T_FAILURE); .
}
. │ │ │ │ -0016a500: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
soap_de │ │ │ │ -0016a570: 7374 726f 793c 2f61 3e28 2661 6d70 3b3c stroy(&< │ │ │ │ -0016a580: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -0016a590: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ -0016a5a0: 6874 6d6c 223e 736f 6170 3c2f 613e 293b html">soap); │ │ │ │ -0016a5b0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ │ -0016a620: 736f 6170 5f65 6e64 3c2f 613e 2826 616d soap_end(&am │ │ │ │ -0016a630: 703b 3c61 2063 6c61 7373 3d22 636f 6465 p;soap);
.
< │ │ │ │ -0016a680: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -0016a690: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ │ -0016a6a0: 705f 5f63 6f6e 7465 7874 2e68 746d 6c23 p__context.html# │ │ │ │ -0016a6b0: 6761 3238 6565 3866 6463 6635 3030 3434 ga28ee8fdcf50044 │ │ │ │ -0016a6c0: 3365 3065 3531 3735 3033 3234 6161 3661 3e0e51750324aa6a │ │ │ │ -0016a6d0: 3161 223e 736f 6170 5f64 6f6e 653c 2f61 1a">soap_done(&so │ │ │ │ -0016a710: 6170 3c2f 613e 293b 3c2f 6469 763e 0a3c ap);
.< │ │ │ │ -0016a720: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -0016a730: 3e7d 3c2f 6469 763e 0a3c 6469 7620 636c >}
.
│ │ │ │ -0016a790: 3c64 6976 2063 6c61 7373 3d22 7474 6e61
so │ │ │ │ -0016a7f0: 6170 3a3a 6670 6f73 743c 2f61 3e3c 2f64 ap::fpost
int(* fpo │ │ │ │ -0016a820: 7374 2928 7374 7275 6374 2073 6f61 7020 st)(struct soap │ │ │ │ -0016a830: 2a73 6f61 702c 2063 6f6e 7374 2063 6861 *soap, const cha │ │ │ │ -0016a840: 7220 2a65 6e64 706f 696e 742c 2063 6f6e r *endpoint, con │ │ │ │ -0016a850: 7374 2063 6861 7220 2a68 6f73 742c 2069 st char *host, i │ │ │ │ -0016a860: 6e74 2070 6f72 742c 2063 6f6e 7374 2063 nt port, const c │ │ │ │ -0016a870: 6861 7220 2a70 6174 682c 2063 6f6e 7374 har *path, const │ │ │ │ -0016a880: 2063 6861 7220 2a61 6374 696f 6e2c 2055 char *action, U │ │ │ │ -0016a890: 4c4f 4e47 3634 2063 6f75 6e74 293c 2f64 LONG64 count)
Callback t │ │ │ │ -0016a8c0: 6861 7420 706f 7075 6c61 7465 7320 616e hat populates an │ │ │ │ -0016a8d0: 6420 7468 656e 2073 656e 6473 2048 5454 d then sends HTT │ │ │ │ -0016a8e0: 5020 6865 6164 6572 7320 6672 6f6d 2074 P headers from t │ │ │ │ -0016a8f0: 6865 2063 6c69 656e 742d 7369 6465 2074 he client-side t │ │ │ │ -0016a900: 6f20 6120 636f 6e6e 6563 7465 6420 4854 o a connected HT │ │ │ │ -0016a910: 5450 2073 6572 7665 722e 3c2f 6469 763e TP server.
│ │ │ │ -0016a920: 3c64 6976 2063 6c61 7373 3d22 7474 6465
Definition │ │ │ │ -0016a940: 3a3c 2f62 3e20 7374 6473 6f61 7032 2e68 : stdsoap2.h │ │ │ │ -0016a950: 3a34 3232 303c 2f64 6976 3e3c 2f64 6976 :4220
.
int(* fparse)(s │ │ │ │ -0016aa50: 7472 7563 7420 736f 6170 202a 736f 6170 truct soap *soap │ │ │ │ -0016aa60: 293c 2f64 6976 3e3c 6469 7620 636c 6173 )
Callba │ │ │ │ -0016aa80: 636b 2074 6861 7420 7265 6164 7320 616e ck that reads an │ │ │ │ -0016aa90: 6420 7061 7273 6573 2048 5454 5020 616e d parses HTTP an │ │ │ │ -0016aaa0: 6420 4d49 4d45 2068 6561 6465 7273 2e3c d MIME headers.< │ │ │ │ -0016aab0: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
Defin │ │ │ │ -0016aad0: 6974 696f 6e3a 3c2f 623e 2073 7464 736f ition: stdso │ │ │ │ -0016aae0: 6170 322e 683a 3432 3530 3c2f 6469 763e ap2.h:4250
│ │ │ │ -0016aaf0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
so │ │ │ │ -0016aba0: 6170 5f67 6574 6c69 6e65 3c2f 613e 3c2f ap_getline
int soap │ │ │ │ -0016abd0: 5f67 6574 6c69 6e65 2873 7472 7563 7420 _getline(struct │ │ │ │ -0016abe0: 736f 6170 202a 736f 6170 2c20 6368 6172 soap *soap, char │ │ │ │ -0016abf0: 202a 6275 662c 2069 6e74 206c 656e 293c *buf, int len)< │ │ │ │ -0016ac00: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
Get a he │ │ │ │ -0016ac20: 6164 6572 206c 696e 652e 3c2f 6469 763e ader line.
│ │ │ │ -0016ac30: 3c2f 6469 763e 0a3c 2f64 6976 3e3c 212d
.

SOAP 1.1/1.2 RP │ │ │ │ -0016ac60: 4320 656e 636f 6469 6e67 2073 7065 6369 C encoding speci │ │ │ │ -0016ac70: 6669 6573 2074 6861 7420 534f 4150 2f58 fies that SOAP/X │ │ │ │ -0016ac80: 4d4c 2065 6c65 6d65 6e74 7320 6d61 7920 ML elements may │ │ │ │ -0016ac90: 6265 2069 676e 6f72 6564 2077 6865 6e20 be ignored when │ │ │ │ -0016aca0: 7072 6573 656e 7420 696e 2061 2053 4f41 present in a SOA │ │ │ │ -0016acb0: 5020 7061 796c 6f61 6420 6f6e 2074 6865 P payload on the │ │ │ │ -0016acc0: 2072 6563 6569 7669 6e67 2073 6964 652e receiving side. │ │ │ │ -0016acd0: 2048 6f77 6576 6572 2c20 646f 6375 6d65 However, docume │ │ │ │ -0016ace0: 6e74 2f6c 6974 6572 616c 2073 7479 6c65 nt/literal style │ │ │ │ -0016acf0: 206d 6573 7361 6769 6e67 2076 616c 6964 messaging valid │ │ │ │ -0016ad00: 6174 6573 2058 4d4c 206d 6573 7361 6765 ates XML message │ │ │ │ -0016ad10: 7320 616e 6420 6578 7472 6120 656c 656d s and extra elem │ │ │ │ -0016ad20: 656e 7473 2063 616e 6e6f 7420 6a75 7374 ents cannot just │ │ │ │ -0016ad30: 2062 6520 6967 6e6f 7265 6420 6173 2073 be ignored as s │ │ │ │ -0016ad40: 7563 682e 2057 6974 6820 534f 4150 2064 uch. With SOAP d │ │ │ │ -0016ad50: 6f63 756d 656e 742f 6c69 7465 7261 6c20 ocument/literal │ │ │ │ -0016ad60: 7374 796c 6520 6974 2069 7320 7265 636f style it is reco │ │ │ │ -0016ad70: 6d6d 656e 6465 6420 746f 2065 6e61 626c mmended to enabl │ │ │ │ -0016ad80: 6520 7468 6520 3c63 6f64 653e 2353 4f41 e the #SOA │ │ │ │ -0016ad90: 505f 584d 4c5f 5354 5249 4354 3c2f 636f P_XML_STRICT mode flag. W │ │ │ │ -0016adb0: 6974 6820 534f 4150 2052 5043 2065 6e63 ith SOAP RPC enc │ │ │ │ -0016adc0: 6f64 696e 672c 2074 6865 2065 6e67 696e oding, the engin │ │ │ │ -0016add0: 6520 6967 6e6f 7265 7320 584d 4c20 656c e ignores XML el │ │ │ │ -0016ade0: 656d 656e 7473 2074 6861 7420 6172 6520 ements that are │ │ │ │ -0016adf0: 756e 6b6e 6f77 6e20 6279 2064 6566 6175 unknown by defau │ │ │ │ -0016ae00: 6c74 2c20 756e 6c65 7373 2074 6865 2058 lt, unless the X │ │ │ │ -0016ae10: 4d4c 2061 7474 7269 6275 7465 203c 656d ML attribute mustUnder │ │ │ │ -0016ae30: 7374 616e 643d 2274 7275 6522 3c2f 636f stand="true" is pres │ │ │ │ -0016ae50: 656e 7420 696e 2074 6865 2058 4d4c 2065 ent in the XML e │ │ │ │ -0016ae60: 6c65 6d65 6e74 2e20 4974 206d 6179 2062 lement. It may b │ │ │ │ -0016ae70: 6520 756e 6465 7369 7261 626c 6520 666f e undesirable fo │ │ │ │ -0016ae80: 7220 656c 656d 656e 7473 2074 6f20 6265 r elements to be │ │ │ │ -0016ae90: 2069 676e 6f72 6564 2077 6865 6e20 7468 ignored when th │ │ │ │ -0016aea0: 6520 6f75 7463 6f6d 6520 6f66 2074 6865 e outcome of the │ │ │ │ -0016aeb0: 206f 6d69 7373 696f 6e20 6973 2075 6e63 omission is unc │ │ │ │ -0016aec0: 6572 7461 696e 2e20 5468 6520 3c63 6f64 ertain. The soap::fi │ │ │ │ -0016afa0: 676e 6f72 653c 2f61 3e3c 2f63 6f64 653e gnore │ │ │ │ -0016afb0: 2063 616c 6c62 6163 6b20 6361 6e20 6265 callback can be │ │ │ │ -0016afc0: 2073 6574 2074 6f20 6120 6675 6e63 7469 set to a functi │ │ │ │ -0016afd0: 6f6e 2074 6861 7420 7265 7475 726e 7320 on that returns │ │ │ │ -0016afe0: 3c63 6f64 653e 2353 4f41 505f 4f4b 3c2f #SOAP_OK in case th │ │ │ │ -0016b000: 6520 656c 656d 656e 7420 6361 6e20 6265 e element can be │ │ │ │ -0016b010: 2073 6166 656c 7920 6967 6e6f 7265 642c safely ignored, │ │ │ │ -0016b020: 206f 7220 3c63 6f64 653e 2353 4f41 505f or #SOAP_ │ │ │ │ -0016b030: 4d55 5354 554e 4445 5253 5441 4e44 3c2f MUSTUNDERSTAND to throw a │ │ │ │ -0016b050: 6e20 6578 6365 7074 696f 6e2c 206f 7220 n exception, or │ │ │ │ -0016b060: 746f 2070 6572 666f 726d 2073 6f6d 6520 to perform some │ │ │ │ -0016b070: 6170 706c 6963 6174 696f 6e2d 7370 6563 application-spec │ │ │ │ -0016b080: 6966 6963 2061 6374 696f 6e2e 2046 6f72 ific action. For │ │ │ │ -0016b090: 2065 7861 6d70 6c65 2c20 746f 2074 6872 example, to thr │ │ │ │ -0016b0a0: 6f77 2061 6e20 6578 6365 7074 696f 6e20 ow an exception │ │ │ │ -0016b0b0: 6173 2073 6f6f 6e20 6173 2061 6e20 756e as soon as an un │ │ │ │ -0016b0c0: 6b6e 6f77 6e20 656c 656d 656e 7420 6973 known element is │ │ │ │ -0016b0d0: 2065 6e63 6f75 6e74 6572 6564 206f 6e20 encountered on │ │ │ │ -0016b0e0: 7468 6520 696e 7075 742c 2075 7365 3a3c the input, use:< │ │ │ │ -0016b0f0: 2f70 3e0a 3c64 6976 2063 6c61 7373 3d22 /p>.

int │ │ │ │ -0016b140: 206d 6169 6e28 293c 2f64 6976 3e0a 3c64 main()
. │ │ │ │ -0016b160: 7b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 {
.
struct │ │ │ │ -0016b1a0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap │ │ │ │ -0016b1d0: 2a3c 6120 636c 6173 733d 2263 6f64 6522 *soap │ │ │ │ -0016b200: 203d 203c 6120 636c 6173 733d 2263 6f64 = soap_new │ │ │ │ -0016b260: 3c2f 613e 2829 3b3c 2f64 6976 3e0a 3c64 ();
. │ │ │ │ -0016b280: 2020 3c61 2063 6c61 7373 3d22 636f 6465 soap->fig │ │ │ │ -0016b310: 6e6f 7265 3c2f 613e 203d 206d 7969 676e nore = myign │ │ │ │ -0016b320: 6f72 653b 203c 2f64 6976 3e0a 3c64 6976 ore;
.
│ │ │ │ -0016b340: 2e2e 2e20 3c73 7061 6e20 636c 6173 733d ... // soa │ │ │ │ -0016b360: 705f 6361 6c6c 5f6e 735f 5f77 6562 6d65 p_call_ns__webme │ │ │ │ -0016b370: 7468 6f64 2873 6f61 702c 202e 2e2e 2920 thod(soap, ...) │ │ │ │ -0016b380: 6f72 2073 6f61 705f 7365 7276 6528 736f or soap_serve(so │ │ │ │ -0016b390: 6170 2920 3c2f 7370 616e 3e3c 2f64 6976 ap)
.
}
.
< │ │ │ │ -0016b3d0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
int myi │ │ │ │ -0016b410: 676e 6f72 6528 3c73 7061 6e20 636c 6173 gnore(stru │ │ │ │ -0016b430: 6374 3c2f 7370 616e 3e20 3c61 2063 6c61 ct soap *soap, const < │ │ │ │ -0016b4c0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -0016b4d0: 6f72 6474 7970 6522 3e63 6861 723c 2f73 ordtype">char *tag)
.
{
..
} .
│ │ │ │ -0016b6e0: 3c64 6976 2063 6c61 7373 3d22 7474 6465
int(* fignor │ │ │ │ -0016b700: 6529 2873 7472 7563 7420 736f 6170 202a e)(struct soap * │ │ │ │ -0016b710: 736f 6170 2c20 636f 6e73 7420 6368 6172 soap, const char │ │ │ │ -0016b720: 202a 7461 6729 3c2f 6469 763e 3c64 6976 *tag)
C │ │ │ │ -0016b740: 616c 6c62 6163 6b20 746f 2063 6174 6368 allback to catch │ │ │ │ -0016b750: 2075 6e72 6563 6f67 6e69 7a65 6420 584d unrecognized XM │ │ │ │ -0016b760: 4c20 656c 656d 656e 7473 2061 6e64 206f L elements and o │ │ │ │ -0016b770: 7665 7272 6964 6573 2023 534f 4150 5f58 verrides #SOAP_X │ │ │ │ -0016b780: 4d4c 5f53 5452 4943 5420 7661 6c69 6461 ML_STRICT valida │ │ │ │ -0016b790: 7469 6f6e 2065 7272 6f72 7320 666f 7220 tion errors for │ │ │ │ -0016b7a0: 7468 6573 2e2e 2e3c 2f64 6976 3e3c 6469 thes...
│ │ │ │ -0016b7c0: 3c62 3e44 6566 696e 6974 696f 6e3a 3c2f Definition: stdsoap2.h:44 │ │ │ │ -0016b7e0: 3433 3c2f 6469 763e 3c2f 6469 763e 0a3c 43
.< │ │ │ │ -0016b7f0: 6469 7620 636c 6173 733d 2274 7463 2220 div class="ttc" │ │ │ │ -0016b800: 6964 3d22 6167 726f 7570 5f5f 6772 6f75 id="agroup__grou │ │ │ │ -0016b810: 705f 5f65 7272 6f72 735f 6874 6d6c 5f67 p__errors_html_g │ │ │ │ -0016b820: 6136 6536 3834 3966 3532 6533 3634 3166 a6e6849f52e3641f │ │ │ │ -0016b830: 6662 6134 3433 6466 3636 3864 3535 3136 fba443df668d5516 │ │ │ │ -0016b840: 3822 3e3c 6469 7620 636c 6173 733d 2274 8">
# │ │ │ │ -0016b8d0: 6465 6669 6e65 2053 4f41 505f 4d55 5354 define SOAP_MUST │ │ │ │ -0016b8e0: 554e 4445 5253 5441 4e44 3c2f 6469 763e UNDERSTAND
│ │ │ │ -0016b8f0: 3c64 6976 2063 6c61 7373 3d22 7474 646f
A soap_status │ │ │ │ -0016b910: 2065 7272 6f72 2063 6f64 653a 2061 6e20 error code: an │ │ │ │ -0016b920: 584d 4c20 656c 656d 656e 7420 6973 2070 XML element is p │ │ │ │ -0016b930: 7265 7365 6e74 2077 6974 6820 6120 6d75 resent with a mu │ │ │ │ -0016b940: 7374 556e 6465 7273 7461 6e64 2061 7474 stUnderstand att │ │ │ │ -0016b950: 7269 6275 7465 2077 6869 6368 206d 7573 ribute which mus │ │ │ │ -0016b960: 7420 6265 2075 6e64 2e2e 2e3c 2f64 6976 t be und...
Definitio │ │ │ │ -0016b990: 6e3a 3c2f 623e 2073 7464 736f 6170 322e n: stdsoap2. │ │ │ │ -0016b9a0: 683a 3234 3930 3c2f 6469 763e 3c2f 6469 h:2490
.

To │ │ │ │ -0016b9d0: 7365 6c65 6374 6976 656c 7920 7468 726f selectively thro │ │ │ │ -0016b9e0: 7720 616e 2065 7863 6570 7469 6f6e 2077 w an exception w │ │ │ │ -0016b9f0: 6865 6e20 3c65 6d3e 3c63 6f64 653e 6d75 hen mu │ │ │ │ -0016ba00: 7374 556e 6465 7273 7461 6e64 3d22 7472 stUnderstand="tr │ │ │ │ -0016ba10: 7565 223c 2f63 6f64 653e 3c2f 656d 3e20 ue" │ │ │ │ -0016ba20: 534f 4150 2048 6561 6465 7220 656c 656d SOAP Header elem │ │ │ │ -0016ba30: 656e 7420 6973 2065 6e63 6f75 6e74 6572 ent is encounter │ │ │ │ -0016ba40: 6564 206f 7220 7768 656e 2061 6e20 756e ed or when an un │ │ │ │ -0016ba50: 6b6e 6f77 6e20 656c 656d 656e 7420 6973 known element is │ │ │ │ -0016ba60: 2065 6e63 6f75 6e74 6572 6564 2065 7863 encountered exc │ │ │ │ -0016ba70: 6570 7420 666f 7220 656c 656d 656e 7420 ept for element │ │ │ │ -0016ba80: 3c65 6d3e 3c63 6f64 653e 6e73 3a78 797a ns:xyz │ │ │ │ -0016ba90: 3c2f 636f 6465 3e3c 2f65 6d3e 2c20 7573 , us │ │ │ │ -0016baa0: 653a 3c2f 703e 0a3c 6469 7620 636c 6173 e:

.
< │ │ │ │ -0016bad0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -0016bae0: 6f72 6474 7970 6522 3e69 6e74 3c2f 7370 ordtype">int main()
│ │ │ │ -0016bb00: 0a3c 6469 7620 636c 6173 733d 226c 696e .
{
.
< │ │ │ │ -0016bb30: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -0016bb40: 6f72 6422 3e73 7472 7563 7420 3c2f 7370 ord">struct soap *soap< │ │ │ │ -0016bbb0: 2f61 3e20 3d20 3c61 2063 6c61 7373 3d22 /a> = soap_ │ │ │ │ -0016bc10: 6e65 773c 2f61 3e28 293b 3c2f 6469 763e new();
│ │ │ │ -0016bc20: 0a3c 6469 7620 636c 6173 733d 226c 696e .. │ │ │ │ -0016bcf0: 202e 2e2e 203c 7370 616e 2063 6c61 7373 ... // so │ │ │ │ -0016bd10: 6170 5f63 616c 6c5f 6e73 5f5f 7765 626d ap_call_ns__webm │ │ │ │ -0016bd20: 6574 686f 6428 736f 6170 2c20 2e2e 2e29 ethod(soap, ...) │ │ │ │ -0016bd30: 206f 7220 736f 6170 5f73 6572 7665 2873 or soap_serve(s │ │ │ │ -0016bd40: 6f61 7029 203c 2f73 7061 6e3e 3c2f 6469 oap) .
}
. │ │ │ │ -0016bd80: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
int ig │ │ │ │ -0016bdc0: 6e6f 7265 283c 7370 616e 2063 6c61 7373 nore(struc │ │ │ │ -0016bde0: 743c 2f73 7061 6e3e 203c 6120 636c 6173 t │ │ │ │ -0016be10: 736f 6170 3c2f 613e 202a 3c61 2063 6c61 soap *soap, const char *tag)
│ │ │ │ -0016bea0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
{
.
< │ │ │ │ -0016bed0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ -0016bee0: 656e 7422 3e2f 2f20 646f 206e 6f74 2069 ent">// do not i │ │ │ │ -0016bef0: 676e 6f72 6520 6d75 7374 556e 6465 7273 gnore mustUnders │ │ │ │ -0016bf00: 7461 6e64 3d26 7175 6f74 3b74 7275 6526 tand="true& │ │ │ │ -0016bf10: 7175 6f74 3b20 3c2f 7370 616e 3e3c 2f64 quot; .
if (!soap-&g │ │ │ │ -0016bf90: 743b 3c61 2063 6c61 7373 3d22 636f 6465 t;mustU │ │ │ │ -0016bfe0: 6e64 6572 7374 616e 643c 2f61 3e29 3c2f nderstand).
{
│ │ │ │ -0016c010: 0a3c 6469 7620 636c 6173 733d 226c 696e .
// │ │ │ │ -0016c040: 7461 6773 2026 6c74 3b6e 733a 736f 6d65 tags <ns:some │ │ │ │ -0016c050: 456c 656d 656e 7426 6774 3b20 6361 6e20 Element> can │ │ │ │ -0016c060: 6265 2073 6166 656c 7920 6967 6e6f 7265 be safely ignore │ │ │ │ -0016c070: 643c 2f73 7061 6e3e 3c2f 6469 763e 0a3c d
.< │ │ │ │ -0016c080: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -0016c090: 3e20 2020 203c 7370 616e 2063 6c61 7373 > i │ │ │ │ -0016c0b0: 663c 2f73 7061 6e3e 2028 3c61 2063 6c61 f (soap │ │ │ │ -0016c110: 5f6d 6174 6368 5f74 6167 3c2f 613e 283c _match_tag(< │ │ │ │ -0016c120: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -0016c130: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ -0016c140: 6874 6d6c 223e 736f 6170 3c2f 613e 2c20 html">soap, │ │ │ │ -0016c150: 7461 672c 203c 7370 616e 2063 6c61 7373 tag, "ns:someEl │ │ │ │ -0016c180: 656d 656e 7426 7175 6f74 3b3c 2f73 7061 ement") == SOAP_ │ │ │ │ -0016c1f0: 4f4b 3c2f 613e 293c 2f64 6976 3e0a 3c64 OK)
. │ │ │ │ -0016c210: 2020 2020 2020 3c73 7061 6e20 636c 6173 │ │ │ │ -0016c230: 7265 7475 726e 3c2f 7370 616e 3e20 3c61 return SOAP_OK;.
}
│ │ │ │ -0016c2c0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
r │ │ │ │ -0016c2f0: 6574 7572 6e3c 2f73 7061 6e3e 203c 6120 eturn SOAP_MUSTUNDERS │ │ │ │ -0016c360: 5441 4e44 3c2f 613e 3b20 3c2f 6469 763e TAND;
│ │ │ │ -0016c370: 0a3c 6469 7620 636c 6173 733d 226c 696e .
}
.
.
str │ │ │ │ -0016c3d0: 7563 7420 3c2f 7370 616e 3e3c 6120 636c uct Namespac │ │ │ │ -0016c410: 653c 2f61 3e20 3c61 2063 6c61 7373 3d22 e nam │ │ │ │ -0016c470: 6573 7061 6365 733c 2f61 3e5b 5d20 3d20 espaces[] = │ │ │ │ -0016c480: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
{
│ │ │ │ -0016c4a0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
{ "SOAP-EN │ │ │ │ -0016c4e0: 5626 7175 6f74 3b3c 2f73 7061 6e3e 2c20 V", │ │ │ │ -0016c4f0: 3c73 7061 6e20 636c 6173 733d 2273 7472 &quo │ │ │ │ -0016c510: 743b 6874 7470 3a2f 2f73 6368 656d 6173 t;http://schemas │ │ │ │ -0016c520: 2e78 6d6c 736f 6170 2e6f 7267 2f73 6f61 .xmlsoap.org/soa │ │ │ │ -0016c530: 702f 656e 7665 6c6f 7065 2f26 7175 6f74 p/envelope/" │ │ │ │ -0016c540: 3b3c 2f73 7061 6e3e 207d 2c20 3c2f 6469 ; }, .
{ "SOAP- │ │ │ │ -0016c590: 454e 4326 7175 6f74 3b3c 2f73 7061 6e3e ENC" │ │ │ │ -0016c5a0: 2c20 3c73 7061 6e20 636c 6173 733d 2273 , &q │ │ │ │ -0016c5c0: 756f 743b 6874 7470 3a2f 2f73 6368 656d uot;http://schem │ │ │ │ -0016c5d0: 6173 2e78 6d6c 736f 6170 2e6f 7267 2f73 as.xmlsoap.org/s │ │ │ │ -0016c5e0: 6f61 702f 656e 636f 6469 6e67 2f26 7175 oap/encoding/&qu │ │ │ │ -0016c5f0: 6f74 3b3c 2f73 7061 6e3e 207d 2c20 3c2f ot; }, .
{ "xsi │ │ │ │ -0016c640: 2671 756f 743b 3c2f 7370 616e 3e2c 2020 ", │ │ │ │ -0016c650: 2020 2020 3c73 7061 6e20 636c 6173 733d │ │ │ │ -0016c670: 2671 756f 743b 6874 7470 3a2f 2f77 7777 "http://www │ │ │ │ -0016c680: 2e77 332e 6f72 672f 3230 3031 2f58 4d4c .w3.org/2001/XML │ │ │ │ -0016c690: 5363 6865 6d61 2d69 6e73 7461 6e63 6526 Schema-instance& │ │ │ │ -0016c6a0: 7175 6f74 3b3c 2f73 7061 6e3e 207d 2c20 quot; }, │ │ │ │ -0016c6b0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
{ "x │ │ │ │ -0016c6f0: 7364 2671 756f 743b 3c2f 7370 616e 3e2c sd", │ │ │ │ -0016c700: 2020 2020 2020 3c73 7061 6e20 636c 6173 "http://w │ │ │ │ -0016c730: 7777 2e77 332e 6f72 672f 3230 3031 2f58 ww.w3.org/2001/X │ │ │ │ -0016c740: 4d4c 5363 6865 6d61 2671 756f 743b 3c2f MLSchema" },
. │ │ │ │ -0016c760: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
{ "ns" │ │ │ │ -0016c7a0: 3c2f 7370 616e 3e2c 2020 2020 2020 203c , < │ │ │ │ -0016c7b0: 7370 616e 2063 6c61 7373 3d22 7374 7269 span class="stri │ │ │ │ -0016c7c0: 6e67 6c69 7465 7261 6c22 3e26 7175 6f74 ngliteral">" │ │ │ │ -0016c7d0: 3b73 6f6d 652d 5552 4926 7175 6f74 3b3c ;some-URI"< │ │ │ │ -0016c7e0: 2f73 7061 6e3e 7d2c 203c 7370 616e 2063 /span>}, / │ │ │ │ -0016c800: 2f20 6269 6e64 7320 2671 756f 743b 6e73 / binds "ns │ │ │ │ -0016c810: 2671 756f 743b 206e 616d 6573 7061 6365 " namespace │ │ │ │ -0016c820: 2070 7265 6669 7820 746f 2073 6368 656d prefix to schem │ │ │ │ -0016c830: 6120 5552 493c 2f73 7061 6e3e 3c2f 6469 a URI.
{ NULL, N │ │ │ │ -0016c860: 554c 4c7d 203c 2f64 6976 3e0a 3c64 6976 ULL}
.
]; │ │ │ │ -0016c880: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
│ │ │ │ -0016c8d0: 3c64 6976 2063 6c61 7373 3d22 7474 6e61 short mustUnde │ │ │ │ -0016c960: 7273 7461 6e64 3c2f 6469 763e 3c64 6976 rstand
T │ │ │ │ -0016c980: 6865 2073 6f61 703a 3a6d 7573 7455 6e64 he soap::mustUnd │ │ │ │ -0016c990: 6572 7374 616e 6420 666c 6167 2069 7320 erstand flag is │ │ │ │ -0016c9a0: 7365 7420 7768 656e 2061 2053 4f41 5020 set when a SOAP │ │ │ │ -0016c9b0: 4865 6164 6572 2065 6c65 6d65 6e74 2063 Header element c │ │ │ │ -0016c9c0: 6172 7269 6573 2061 2053 4f41 502d 454e arries a SOAP-EN │ │ │ │ -0016c9d0: 563a 6d75 7374 556e 6465 7273 7461 6e64 V:mustUnderstand │ │ │ │ -0016c9e0: 2061 7474 2e2e 2e3c 2f64 6976 3e3c 6469 att...
│ │ │ │ -0016ca00: 3c62 3e44 6566 696e 6974 696f 6e3a 3c2f Definition: stdsoap2.h:29 │ │ │ │ -0016ca20: 3631 3c2f 6469 763e 3c2f 6469 763e 0a3c 61
.< │ │ │ │ -0016ca30: 2f64 6976 3e3c 212d 2d20 6672 6167 6d65 /div>

Functio │ │ │ │ -0016ca50: 6e20 3c63 6f64 653e 3c61 2063 6c61 7373 n soap_matc │ │ │ │ -0016cad0: 685f 7461 673c 2f61 3e3c 2f63 6f64 653e h_tag │ │ │ │ -0016cae0: 2063 6f6d 7061 7265 7320 7477 6f20 7461 compares two ta │ │ │ │ -0016caf0: 6773 2e20 5468 6520 7468 6972 6420 7061 gs. The third pa │ │ │ │ -0016cb00: 7261 6d65 7465 7220 6d61 7920 6265 2061 rameter may be a │ │ │ │ -0016cb10: 2070 6174 7465 726e 2077 6865 7265 203c pattern where < │ │ │ │ -0016cb20: 636f 6465 3e2a 3c2f 636f 6465 3e20 6973 code>* is │ │ │ │ -0016cb30: 2061 2077 696c 6463 6172 6420 616e 6420 a wildcard and │ │ │ │ -0016cb40: 3c63 6f64 653e 2d3c 2f63 6f64 653e 2069 - i │ │ │ │ -0016cb50: 7320 6120 7369 6e67 6c65 2063 6861 7261 s a single chara │ │ │ │ -0016cb60: 6374 6572 2077 696c 6463 6172 642e 2053 cter wildcard. S │ │ │ │ -0016cb70: 6f20 666f 7220 6578 616d 706c 6520 3c63 o for example soap_match_t │ │ │ │ -0016cb90: 6167 2873 6f61 702c 2074 6167 2c20 226e ag(soap, tag, "n │ │ │ │ -0016cba0: 733a 2a22 293c 2f63 6f64 653e 2077 696c s:*") wil │ │ │ │ -0016cbb0: 6c20 6d61 7463 6820 616e 7920 656c 656d l match any elem │ │ │ │ -0016cbc0: 656e 7420 696e 206e 616d 6573 7061 6365 ent in namespace │ │ │ │ -0016cbd0: 203c 636f 6465 3e6e 733c 2f63 6f64 653e ns │ │ │ │ -0016cbe0: 206f 7220 7768 656e 206e 6f20 6e61 6d65 or when no name │ │ │ │ -0016cbf0: 7370 6163 6520 7072 6566 6978 2069 7320 space prefix is │ │ │ │ -0016cc00: 7072 6573 656e 7420 696e 2074 6865 2058 present in the X │ │ │ │ -0016cc10: 4d4c 206d 6573 7361 6765 2e3c 2f70 3e0a ML message.

. │ │ │ │ -0016cc20: 3c70 3e54 6865 2063 616c 6c62 6163 6b20

The callback │ │ │ │ -0016cc30: 6361 6e20 616c 736f 2062 6520 7573 6564 can also be used │ │ │ │ -0016cc40: 2074 6f20 6b65 6570 2074 7261 636b 206f to keep track o │ │ │ │ -0016cc50: 6620 756e 6b6e 6f77 6e20 656c 656d 656e f unknown elemen │ │ │ │ -0016cc60: 7473 2069 6e20 616e 2069 6e74 6572 6e61 ts in an interna │ │ │ │ -0016cc70: 6c20 6461 7461 2073 7472 7563 7475 7265 l data structure │ │ │ │ -0016cc80: 2073 7563 6820 6173 2061 206c 6973 743a such as a list: │ │ │ │ -0016cc90: 3c2f 703e 0a3c 6469 7620 636c 6173 733d

.
struct Unknown
. │ │ │ │ -0016ccf0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
{
.
char *tag;
│ │ │ │ -0016cd50: 0a3c 6469 7620 636c 6173 733d 226c 696e .
struc │ │ │ │ -0016cd80: 7420 3c2f 7370 616e 3e55 6e6b 6e6f 776e t Unknown │ │ │ │ -0016cd90: 202a 6e65 7874 3b20 3c2f 6469 763e 0a3c *next;
.< │ │ │ │ -0016cda0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -0016cdb0: 3e7d 3b20 3c2f 6469 763e 0a3c 6469 7620 >};
.
int myignore(struct < │ │ │ │ -0016ce20: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -0016ce30: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ -0016ce40: 6874 6d6c 223e 736f 6170 3c2f 613e 202a html">soap * │ │ │ │ -0016ce50: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap, │ │ │ │ -0016ce80: 203c 7370 616e 2063 6c61 7373 3d22 6b65 const ch │ │ │ │ -0016cec0: 6172 3c2f 7370 616e 3e20 2a74 6167 2920 ar *tag) │ │ │ │ -0016ced0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
.
{
│ │ │ │ -0016cef0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
c │ │ │ │ -0016cf20: 6861 723c 2f73 7061 6e3e 202a 7320 3d20 har *s = │ │ │ │ -0016cf30: 283c 7370 616e 2063 6c61 7373 3d22 6b65 (char< │ │ │ │ -0016cf50: 2f73 7061 6e3e 2a29 3c61 2063 6c61 7373 /span>*)soa │ │ │ │ -0016cfb0: 705f 6d61 6c6c 6f63 3c2f 613e 283c 6120 p_malloc(soap, st │ │ │ │ -0016cff0: 726c 656e 2874 6167 292b 3129 3b20 3c2f rlen(tag)+1); .
s │ │ │ │ -0016d030: 7472 7563 7420 3c2f 7370 616e 3e55 6e6b truct Unk │ │ │ │ -0016d040: 6e6f 776e 202a 7520 3d20 283c 7370 616e nown *u = (struct U │ │ │ │ -0016d070: 6e6b 6e6f 776e 2a29 3c61 2063 6c61 7373 nknown*)soa │ │ │ │ -0016d0d0: 705f 6d61 6c6c 6f63 3c2f 613e 283c 6120 p_malloc(soap, sizeof(struct Unknown)); │ │ │ │ -0016d160: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
if │ │ │ │ -0016d1a0: 2873 2026 616d 703b 2661 6d70 3b20 7529 (s && u) │ │ │ │ -0016d1b0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
{.
strcpy │ │ │ │ -0016d1f0: 2873 2c20 7461 6729 3b20 3c2f 6469 763e (s, tag);
│ │ │ │ -0016d200: 0a3c 6469 7620 636c 6173 733d 226c 696e .
u->tag │ │ │ │ -0016d220: 203d 2073 3b20 3c2f 6469 763e 0a3c 6469 = s;
. │ │ │ │ -0016d240: 2020 2075 2d26 6774 3b6e 6578 7420 3d20 u->next = │ │ │ │ -0016d250: 756c 6973 743b 203c 2f64 6976 3e0a 3c64 ulist;
. │ │ │ │ -0016d270: 2020 2020 756c 6973 7420 3d20 753b 203c ulist = u; < │ │ │ │ -0016d280: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
} .
}
. │ │ │ │ -0016d2d0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
.
int m │ │ │ │ -0016d310: 6169 6e28 293c 2f64 6976 3e0a 3c64 6976 ain()
.
{< │ │ │ │ -0016d330: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
│ │ │ │ -0016d360: 7374 7275 6374 203c 2f73 7061 6e3e 3c61 struct soap *< │ │ │ │ -0016d3a0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -0016d3b0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ -0016d3c0: 6874 6d6c 2361 3734 3066 3837 3630 6636 html#a740f8760f6 │ │ │ │ -0016d3d0: 6565 3463 3635 3834 6532 3563 3631 3266 ee4c6584e25c612f │ │ │ │ -0016d3e0: 3538 3564 3730 223e 736f 6170 3c2f 613e 585d70">soap │ │ │ │ -0016d3f0: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
.
struct Unknown *ulist │ │ │ │ -0016d440: 3d20 4e55 4c4c 3b20 3c2f 6469 763e 0a3c = NULL;
.< │ │ │ │ -0016d450: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -0016d460: 3e20 203c 6120 636c 6173 733d 2263 6f64 > soap_ini │ │ │ │ -0016d4c0: 743c 2f61 3e28 2661 6d70 3b3c 6120 636c t(&soap); .. │ │ │ │ -0016d5d0: 2020 2e2e 2e20 3c73 7061 6e20 636c 6173 ... // s │ │ │ │ -0016d5f0: 6f61 705f 6361 6c6c 5f6e 735f 5f77 6562 oap_call_ns__web │ │ │ │ -0016d600: 6d65 7468 6f64 2873 6f61 702c 202e 2e2e method(soap, ... │ │ │ │ -0016d610: 2920 6f72 2073 6f61 705f 7365 7276 6528 ) or soap_serve( │ │ │ │ -0016d620: 736f 6170 2920 3c2f 7370 616e 3e3c 2f64 soap) .
... // print the l │ │ │ │ -0016d670: 6973 7420 6f66 2075 6e6b 6e6f 776e 2065 ist of unknown e │ │ │ │ -0016d680: 6c65 6d65 6e74 7320 7374 6f72 6564 2069 lements stored i │ │ │ │ -0016d690: 6e20 756c 6973 743c 2f73 7061 6e3e 3c2f n ulist...< │ │ │ │ -0016d810: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -0016d820: 3e20 203c 6120 636c 6173 733d 2263 6f64 > soap_don │ │ │ │ -0016d880: 653c 2f61 3e28 2661 6d70 3b3c 6120 636c e(&soap);.
}
.

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

.

.How to handle │ │ │ │ -0016d960: 4854 5450 2033 3037 2074 656d 706f 7261 HTTP 307 tempora │ │ │ │ -0016d970: 7279 2072 6564 6972 6563 743c 2f68 323e ry redirect

│ │ │ │ -0016d980: 0a3c 703e 5468 6520 636c 6965 6e74 2d73 .

The client-s │ │ │ │ -0016d990: 6964 6520 6861 6e64 6c69 6e67 206f 6620 ide handling of │ │ │ │ -0016d9a0: 4854 5450 2033 3037 2063 6f64 6520 2254 HTTP 307 code "T │ │ │ │ -0016d9b0: 656d 706f 7261 7279 2052 6564 6972 6563 emporary Redirec │ │ │ │ -0016d9c0: 7422 2061 6e64 2061 6e79 206f 6620 7468 t" and any of th │ │ │ │ -0016d9d0: 6520 7265 6469 7265 6374 2063 6f64 6573 e redirect codes │ │ │ │ -0016d9e0: 2033 3031 2c20 3330 322c 2061 6e64 2033 301, 302, and 3 │ │ │ │ -0016d9f0: 3033 2061 7265 206e 6f74 2061 7574 6f6d 03 are not autom │ │ │ │ -0016da00: 6174 6564 2e20 436c 6965 6e74 2061 7070 ated. Client app │ │ │ │ -0016da10: 6c69 6361 7469 6f6e 2064 6576 656c 6f70 lication develop │ │ │ │ -0016da20: 6572 7320 6d61 7920 7761 6e74 2074 6f20 ers may want to │ │ │ │ -0016da30: 636f 6e73 6964 6572 2061 6464 696e 6720 consider adding │ │ │ │ -0016da40: 6120 6665 7720 6c69 6e65 7320 6f66 2063 a few lines of c │ │ │ │ -0016da50: 6f64 6520 746f 2073 7570 706f 7274 2072 ode to support r │ │ │ │ -0016da60: 6564 6972 6563 7473 2e20 4974 2077 6173 edirects. It was │ │ │ │ -0016da70: 2064 6563 6964 6564 206e 6f74 2074 6f20 decided not to │ │ │ │ -0016da80: 6175 746f 6d61 7469 6361 6c6c 7920 7375 automatically su │ │ │ │ -0016da90: 7070 6f72 7420 7265 6469 7265 6374 7320 pport redirects │ │ │ │ -0016daa0: 666f 7220 7468 6520 666f 6c6c 6f77 696e for the followin │ │ │ │ -0016dab0: 6720 7265 6173 6f6e 733a 3c2f 703e 0a3c g reasons:

.< │ │ │ │ -0016dac0: 756c 3e0a 3c6c 693e 5265 6469 7265 6374 ul>.
  • Redirect │ │ │ │ -0016dad0: 696e 6720 6120 7365 6375 7265 2048 5454 ing a secure HTT │ │ │ │ -0016dae0: 5053 2061 6464 7265 7373 2074 6f20 6120 PS address to a │ │ │ │ -0016daf0: 6e6f 6e2d 7365 6375 7265 2048 5454 5020 non-secure HTTP │ │ │ │ -0016db00: 6164 6472 6573 7320 7669 6120 3330 3720 address via 307 │ │ │ │ -0016db10: 6372 6561 7465 7320 6120 7365 6375 7269 creates a securi │ │ │ │ -0016db20: 7479 2076 756c 6e65 7261 6269 6c69 7479 ty vulnerability │ │ │ │ -0016db30: 2e3c 2f6c 693e 0a3c 6c69 3e43 7963 6c69 .
  • .
  • Cycli │ │ │ │ -0016db40: 6320 7265 6469 7265 6374 7320 6d75 7374 c redirects must │ │ │ │ -0016db50: 2062 6520 6465 7465 6374 6564 2028 652e be detected (e. │ │ │ │ -0016db60: 672e 2061 6c6c 6f77 696e 6720 6f6e 6c79 g. allowing only │ │ │ │ -0016db70: 2061 206c 696d 6974 6564 206e 756d 6265 a limited numbe │ │ │ │ -0016db80: 7220 6f66 2072 6564 6972 6563 7420 6c65 r of redirect le │ │ │ │ -0016db90: 7665 6c73 292e 3c2f 6c69 3e0a 3c6c 693e vels).
  • .
  • │ │ │ │ -0016dba0: 5265 6469 7265 6374 696e 6720 4854 5450 Redirecting HTTP │ │ │ │ -0016dbb0: 2050 4f53 5420 7769 6c6c 2072 6573 756c POST will resul │ │ │ │ -0016dbc0: 7420 696e 2072 652d 7365 7269 616c 697a t in re-serializ │ │ │ │ -0016dbd0: 6174 696f 6e20 616e 6420 7265 2d70 6f73 ation and re-pos │ │ │ │ -0016dbe0: 7420 6f66 2074 6865 2065 6e74 6972 6520 t of the entire │ │ │ │ -0016dbf0: 534f 4150 2072 6571 7565 7374 2e20 5468 SOAP request. Th │ │ │ │ -0016dc00: 6520 534f 4150 2072 6571 7565 7374 206d e SOAP request m │ │ │ │ -0016dc10: 6573 7361 6765 206d 7573 7420 6265 2072 essage must be r │ │ │ │ -0016dc20: 652d 706f 7374 6564 2069 6e20 6974 7320 e-posted in its │ │ │ │ -0016dc30: 656e 7469 7265 7479 2077 6865 6e20 7265 entirety when re │ │ │ │ -0016dc40: 2d69 7373 7569 6e67 2074 6865 2053 4f41 -issuing the SOA │ │ │ │ -0016dc50: 5020 6f70 6572 6174 696f 6e20 746f 2061 P operation to a │ │ │ │ -0016dc60: 206e 6577 2061 6464 7265 7373 2e3c 2f6c new address...

    To i │ │ │ │ -0016dc80: 6d70 6c65 6d65 6e74 2063 6c69 656e 742d mplement client- │ │ │ │ -0016dc90: 7369 6465 2033 3037 2072 6564 6972 6563 side 307 redirec │ │ │ │ -0016dca0: 742c 2061 6464 2074 6865 2066 6f6c 6c6f t, add the follo │ │ │ │ -0016dcb0: 7769 6e67 206c 696e 6573 206f 6620 636f wing lines of co │ │ │ │ -0016dcc0: 6465 3a3c 2f70 3e0a 3c64 6976 2063 6c61 de:

    .
    │ │ │ │ -0016dcf0: 3c73 7061 6e20 636c 6173 733d 226b 6579 const cha │ │ │ │ -0016dd30: 723c 2f73 7061 6e3e 202a 656e 6470 6f69 r *endpoi │ │ │ │ -0016dd40: 6e74 203d 204e 554c 4c3b 203c 7370 616e nt = NULL; // use default │ │ │ │ -0016dd70: 656e 6470 6f69 6e74 2067 6976 656e 2069 endpoint given i │ │ │ │ -0016dd80: 6e20 5753 444c 206f 7220 7370 6563 6966 n WSDL or specif │ │ │ │ -0016dd90: 7920 6f6e 6520 6865 7265 3c2f 7370 616e y one here
    .
    int r │ │ │ │ -0016dde0: 6564 6972 6563 7473 203d 2031 303b 2020 edirects = 10; │ │ │ │ -0016ddf0: 2020 2020 2020 2020 3c73 7061 6e20 636c // │ │ │ │ -0016de10: 206d 6178 2072 6564 6972 6563 7420 636f max redirect co │ │ │ │ -0016de20: 756e 7420 3c2f 7370 616e 3e3c 2f64 6976 unt
    .
    wh │ │ │ │ -0016de60: 696c 653c 2f73 7061 6e3e 2028 7265 6469 ile (redi │ │ │ │ -0016de70: 7265 6374 732d 2d29 203c 2f64 6976 3e0a rects--)
    . │ │ │ │ -0016de80: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    {
    .
    if (soap_call_ns1 │ │ │ │ -0016dee0: 5f5f 6d79 4d65 7468 6f64 283c 6120 636c __myMethod(soap, endp │ │ │ │ -0016df20: 6f69 6e74 2c20 2e2e 2e29 2920 3c2f 6469 oint, ...)) .
    {
    .< │ │ │ │ -0016df50: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -0016df60: 3e20 2020 203c 7370 616e 2063 6c61 7373 > i │ │ │ │ -0016df80: 663c 2f73 7061 6e3e 2028 283c 6120 636c f ((soap->< │ │ │ │ -0016dfc0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -0016dfd0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ -0016dfe0: 6874 6d6c 2361 6238 3566 3564 3432 3730 html#ab85f5d4270 │ │ │ │ -0016dff0: 3239 3633 6431 3365 6135 3430 6264 3938 2963d13ea540bd98 │ │ │ │ -0016e000: 3736 6536 6432 223e 6572 726f 723c 2f61 76e6d2">error >= 301 & │ │ │ │ -0016e020: 3b26 616d 703b 203c 6120 636c 6173 733d ;& so │ │ │ │ -0016e050: 6170 3c2f 613e 2d26 6774 3b3c 6120 636c ap->error &l │ │ │ │ -0016e0b0: 743b 3d20 3330 3329 207c 7c20 3c61 2063 t;= 303) || soap-> │ │ │ │ -0016e0f0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 error == 307)
    .
    {
    . │ │ │ │ -0016e170: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    .
    }
    . │ │ │ │ -0016e330: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    │ │ │ │ -0016e360: 656c 7365 3c2f 7370 616e 3e20 3c2f 6469 else .
    {
    │ │ │ │ -0016e390: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    ... // handle err │ │ │ │ -0016e3d0: 6f72 203c 2f73 7061 6e3e 3c2f 6469 763e or
    │ │ │ │ -0016e3e0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    break; │ │ │ │ -0016e420: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    } │ │ │ │ -0016e440: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    } .
    else .
    {
    │ │ │ │ -0016e4c0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    break; < │ │ │ │ -0016e500: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ -0016e510: 656e 7422 3e2f 2f20 616c 6c20 4f4b 206e ent">// all OK n │ │ │ │ -0016e520: 6f77 3c2f 7370 616e 3e3c 2f64 6976 3e0a ow
    . │ │ │ │ -0016e530: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    }
    .
    }< │ │ │ │ -0016e560: 2f64 6976 3e0a 3c2f 6469 763e 3c21 2d2d /div>.

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

    .How to im │ │ │ │ -0016e5e0: 706c 656d 656e 7420 4854 5450 2047 4554 plement HTTP GET │ │ │ │ -0016e5f0: 2c20 5055 542c 2061 6e64 2050 4154 4348 , PUT, and PATCH │ │ │ │ -0016e600: 2073 6572 7669 6365 733c 2f68 323e 0a3c services

    .< │ │ │ │ -0016e610: 703e 546f 2069 6d70 6c65 6d65 6e74 2048 p>To implement H │ │ │ │ -0016e620: 5454 5020 4745 5420 7265 7175 6573 7420 TTP GET request │ │ │ │ -0016e630: 7265 7370 6f6e 7365 732c 2064 6566 696e responses, defin │ │ │ │ -0016e640: 6520 7468 6520 3c63 6f64 653e 3c61 2063 e the so │ │ │ │ -0016e710: 6170 3a3a 6667 6574 3c2f 613e 3c2f 636f ap::fget callback fun │ │ │ │ -0016e730: 6374 696f 6e2e 2054 6865 2063 616c 6c62 ction. The callb │ │ │ │ -0016e740: 6163 6b20 6973 2072 6571 7569 7265 6420 ack is required │ │ │ │ -0016e750: 746f 2070 726f 6475 6365 2061 2072 6573 to produce a res │ │ │ │ -0016e760: 706f 6e73 6520 746f 2074 6865 2072 6571 ponse to the req │ │ │ │ -0016e770: 7565 7374 2069 6e20 7465 7874 7561 6c20 uest in textual │ │ │ │ -0016e780: 666f 726d 2c20 7375 6368 2061 7320 6120 form, such as a │ │ │ │ -0016e790: 5765 6220 7061 6765 206f 7220 616e 2058 Web page or an X │ │ │ │ -0016e7a0: 4d4c 206f 7220 4a53 4f4e 2072 6573 706f ML or JSON respo │ │ │ │ -0016e7b0: 6e73 652e 3c2f 703e 0a3c 703e 596f 7520 nse.

    .

    You │ │ │ │ -0016e7c0: 6361 6e20 616c 736f 2075 7365 2074 6865 can also use the │ │ │ │ -0016e7d0: 203c 636f 6465 3e3c 6120 636c 6173 733d http_get │ │ │ │ -0016e860: 3c2f 613e 3c2f 636f 6465 3e20 706c 7567 plug │ │ │ │ -0016e870: 696e 2077 6869 6368 2065 7373 656e 7469 in which essenti │ │ │ │ -0016e880: 616c 6c79 2073 6574 7320 7468 6520 3c63 ally sets the soap::fget │ │ │ │ -0016e960: 3c2f 613e 3c2f 636f 6465 3e20 6361 6c6c call │ │ │ │ -0016e970: 6261 636b 2061 6e64 2061 6c73 6f20 6b65 back and also ke │ │ │ │ -0016e980: 6570 7320 7472 6163 6b20 6f66 2074 6865 eps track of the │ │ │ │ -0016e990: 206e 756d 6265 7220 6f66 2048 5454 5020 number of HTTP │ │ │ │ -0016e9a0: 4745 5420 616e 6420 504f 5354 2072 6571 GET and POST req │ │ │ │ -0016e9b0: 7565 7374 7320 6d61 6465 2061 7420 7468 uests made at th │ │ │ │ -0016e9c0: 6520 7365 7276 6572 2073 6964 652e 3c2f e server side..

    The follow │ │ │ │ -0016e9e0: 696e 6720 6578 616d 706c 6520 7072 6f64 ing example prod │ │ │ │ -0016e9f0: 7563 6573 2061 2057 6562 2070 6167 6520 uces a Web page │ │ │ │ -0016ea00: 7570 6f6e 2061 2048 5454 5020 4745 5420 upon a HTTP GET │ │ │ │ -0016ea10: 7265 7175 6573 7420 2865 2e67 2e20 6672 request (e.g. fr │ │ │ │ -0016ea20: 6f6d 2061 2062 726f 7773 6572 293a 3c2f om a browser):.

    int │ │ │ │ -0016ea80: 6d61 696e 2829 3c2f 6469 763e 0a3c 6469 main()
    .{ │ │ │ │ -0016eaa0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    struct < │ │ │ │ -0016eae0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -0016eaf0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ -0016eb00: 6874 6d6c 223e 736f 6170 3c2f 613e 202a html">soap * │ │ │ │ -0016eb10: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap │ │ │ │ -0016eb40: 3d20 3c61 2063 6c61 7373 3d22 636f 6465 = soap_new< │ │ │ │ -0016eba0: 2f61 3e28 293b 203c 2f64 6976 3e0a 3c64 /a>();
    . │ │ │ │ -0016ebc0: 2020 3c61 2063 6c61 7373 3d22 636f 6465 soap->fge │ │ │ │ -0016ec50: 743c 2f61 3e20 3d20 3c61 2063 6c61 7373 t = http_get │ │ │ │ -0016ecb0: 3c2f 613e 3b20 3c2f 6469 763e 0a3c 6469 ;
    . │ │ │ │ -0016ecd0: 202e 2e2e 203c 7370 616e 2063 6c61 7373 ... //
    .
    < │ │ │ │ -0016ed10: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -0016ed20: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ │ -0016ed30: 705f 5f69 6f2e 6874 6d6c 2367 6135 3164 p__io.html#ga51d │ │ │ │ -0016ed40: 6261 3737 3036 6135 3035 3234 3062 6438 ba7706a505240bd8 │ │ │ │ -0016ed50: 3933 3563 3062 3238 6534 3139 6422 3e73 935c0b28e419d">s │ │ │ │ -0016ed60: 6f61 705f 7365 7276 653c 2f61 3e28 3c61 oap_serve(soap); │ │ │ │ -0016eda0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    ... < │ │ │ │ -0016edc0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ -0016edd0: 656e 7422 3e2f 2f3c 2f73 7061 6e3e 3c2f ent">//.
    }
    .< │ │ │ │ -0016ee00: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -0016ee10: 3e20 3c2f 6469 763e 0a3c 6469 7620 636c >
    .
    int │ │ │ │ -0016ee50: 3c61 2063 6c61 7373 3d22 636f 6465 2220 │ │ │ │ -0016eea0: 6874 7470 5f67 6574 3c2f 613e 283c 7370 http_get(struct │ │ │ │ -0016eed0: 203c 6120 636c 6173 733d 2263 6f64 6522 soap │ │ │ │ -0016ef00: 202a 3c61 2063 6c61 7373 3d22 636f 6465 *soap)
    .
    {.
    if (soa │ │ │ │ -0016efe0: 705f 7265 7370 6f6e 7365 3c2f 613e 283c p_response(< │ │ │ │ -0016eff0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -0016f000: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ -0016f010: 6874 6d6c 223e 736f 6170 3c2f 613e 2c20 html">soap, │ │ │ │ -0016f020: 3c61 2063 6c61 7373 3d22 636f 6465 2220 │ │ │ │ -0016f070: 534f 4150 5f48 544d 4c3c 2f61 3e29 203c SOAP_HTML) < │ │ │ │ -0016f080: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ -0016f090: 656e 7422 3e2f 2f20 4854 5450 2072 6573 ent">// HTTP res │ │ │ │ -0016f0a0: 706f 6e73 6520 6865 6164 6572 2077 6974 ponse header wit │ │ │ │ -0016f0b0: 6820 7465 7874 2f68 746d 6c20 3c2f 7370 h text/html
    .
    | │ │ │ │ -0016f0e0: 7c20 3c61 2063 6c61 7373 3d22 636f 6465 | soap_send( │ │ │ │ -0016f140: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap, │ │ │ │ -0016f170: 203c 7370 616e 2063 6c61 7373 3d22 7374 &qu │ │ │ │ -0016f190: 6f74 3b26 6c74 3b48 544d 4c26 6774 3b4d ot;<HTML>M │ │ │ │ -0016f1a0: 7920 5765 6220 7365 7276 6572 2069 7320 y Web server is │ │ │ │ -0016f1b0: 6f70 6572 6174 696f 6e61 6c2e 266c 743b operational.< │ │ │ │ -0016f1c0: 2f48 544d 4c26 6774 3b26 7175 6f74 3b3c /HTML>"< │ │ │ │ -0016f1d0: 2f73 7061 6e3e 293c 2f64 6976 3e0a 3c64 /span>)
    . │ │ │ │ -0016f1f0: 2020 207c 7c20 3c61 2063 6c61 7373 3d22 || soap_end_s │ │ │ │ -0016f250: 656e 643c 2f61 3e28 3c61 2063 6c61 7373 end(s │ │ │ │ -0016f280: 6f61 703c 2f61 3e29 293c 2f64 6976 3e0a oap))
    . │ │ │ │ -0016f290: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    │ │ │ │ -0016f2c0: 7265 7475 726e 3c2f 7370 616e 3e20 3c61 return so │ │ │ │ -0016f320: 6170 5f63 6c6f 7365 736f 636b 3c2f 613e ap_closesock │ │ │ │ -0016f330: 283c 6120 636c 6173 733d 2263 6f64 6522 (soap │ │ │ │ -0016f360: 293b 3c2f 6469 763e 0a3c 6469 7620 636c );
    .
    . │ │ │ │ -0016f440: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    }
    .
    s │ │ │ │ -0016f510: 6f61 703a 3a66 6765 743c 2f61 3e3c 2f64 oap::fget
    int(* fge │ │ │ │ -0016f540: 7429 2873 7472 7563 7420 736f 6170 202a t)(struct soap * │ │ │ │ -0016f550: 736f 6170 293c 2f64 6976 3e3c 6469 7620 soap)
    Ca │ │ │ │ -0016f570: 6c6c 6261 636b 2074 6f20 696d 706c 656d llback to implem │ │ │ │ -0016f580: 656e 7420 6c6f 6769 6320 6174 2074 6865 ent logic at the │ │ │ │ -0016f590: 2073 6572 7665 722d 7369 6465 2074 6f20 server-side to │ │ │ │ -0016f5a0: 7365 7276 6520 7265 7370 6f6e 7365 7320 serve responses │ │ │ │ -0016f5b0: 746f 2048 5454 5020 4745 5420 7265 7175 to HTTP GET requ │ │ │ │ -0016f5c0: 6573 7473 2066 726f 6d20 636c 6965 6e74 ests from client │ │ │ │ -0016f5d0: 732e 3c2f 6469 763e 3c64 6976 2063 6c61 s.
    De │ │ │ │ -0016f5f0: 6669 6e69 7469 6f6e 3a3c 2f62 3e20 7374 finition: st │ │ │ │ -0016f600: 6473 6f61 7032 2e68 3a34 3333 303c 2f64 dsoap2.h:4330
    .
    │ │ │ │ -0016f790: 0a3c 6469 7620 636c 6173 733d 2274 7463 .
    │ │ │ │ -0016f850: 3c64 6976 2063 6c61 7373 3d22 7474 6465
    int soap_clo │ │ │ │ -0016f870: 7365 736f 636b 2873 7472 7563 7420 736f sesock(struct so │ │ │ │ -0016f880: 6170 202a 736f 6170 293c 2f64 6976 3e3c ap *soap)
    < │ │ │ │ -0016f890: 6469 7620 636c 6173 733d 2274 7464 6f63 div class="ttdoc │ │ │ │ -0016f8a0: 223e 436c 6f73 6520 7468 6520 736f 636b ">Close the sock │ │ │ │ -0016f8b0: 6574 2063 6f6e 6e65 6374 696f 6e2e 3c2f et connection.
    .
    < │ │ │ │ -0016f930: 6120 6872 6566 3d22 6772 6f75 705f 5f67 a href="group__g │ │ │ │ -0016f940: 726f 7570 5f5f 696f 2e68 746d 6c23 6761 roup__io.html#ga │ │ │ │ -0016f950: 3065 6364 6334 3361 3533 6534 3934 6564 0ecdc43a53e494ed │ │ │ │ -0016f960: 6334 6638 3465 3863 3133 3536 3539 6261 c4f84e8c135659ba │ │ │ │ -0016f970: 223e 6874 7470 5f67 6574 3c2f 613e 3c2f ">http_get
    int http │ │ │ │ -0016f9a0: 5f67 6574 2873 7472 7563 7420 736f 6170 _get(struct soap │ │ │ │ -0016f9b0: 202a 2c20 7374 7275 6374 2073 6f61 705f *, struct soap_ │ │ │ │ -0016f9c0: 706c 7567 696e 202a 2c20 766f 6964 202a plugin *, void * │ │ │ │ -0016f9d0: 293c 2f64 6976 3e3c 6469 7620 636c 6173 )
    The HT │ │ │ │ -0016f9f0: 5450 2047 4554 2070 6c75 6769 6e20 7265 TP GET plugin re │ │ │ │ -0016fa00: 6769 7374 7261 7469 6f6e 2066 756e 6374 gistration funct │ │ │ │ -0016fa10: 696f 6e2e 3c2f 6469 763e 3c2f 6469 763e ion.
    │ │ │ │ -0016fa20: 0a3c 6469 7620 636c 6173 733d 2274 7463 .
    # │ │ │ │ -0016faf0: 6465 6669 6e65 2053 4f41 505f 4854 4d4c define SOAP_HTML │ │ │ │ -0016fb00: 3c2f 6469 763e 3c64 6976 2063 6c61 7373
    A speci │ │ │ │ -0016fb20: 616c 2073 6f61 705f 7374 6174 7573 2065 al soap_status e │ │ │ │ -0016fb30: 7272 6f72 2063 6f64 6520 746f 2073 6967 rror code to sig │ │ │ │ -0016fb40: 6e61 6c20 7468 6174 2061 2063 7573 746f nal that a custo │ │ │ │ -0016fb50: 6d20 4854 5450 2072 6573 706f 6e73 6520 m HTTP response │ │ │ │ -0016fb60: 6973 2070 7265 7365 6e74 2061 6e64 206e is present and n │ │ │ │ -0016fb70: 6f20 4854 5450 2072 6573 706f 6e73 2e2e o HTTP respons.. │ │ │ │ -0016fb80: 2e3c 2f64 6976 3e3c 6469 7620 636c 6173 .
    Def │ │ │ │ -0016fba0: 696e 6974 696f 6e3a 3c2f 623e 2073 7464 inition: std │ │ │ │ -0016fbb0: 736f 6170 322e 683a 3237 3132 3c2f 6469 soap2.h:2712
    .
    int s │ │ │ │ -0016fca0: 6f61 705f 656e 645f 7365 6e64 2873 7472 oap_end_send(str │ │ │ │ -0016fcb0: 7563 7420 736f 6170 202a 736f 6170 293c uct soap *soap)< │ │ │ │ -0016fcc0: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
    Finalize │ │ │ │ -0016fce0: 2074 6865 2063 6f6e 7465 7874 2061 6674 the context aft │ │ │ │ -0016fcf0: 6572 2073 656e 6469 6e67 2e3c 2f64 6976 er sending.
    .
    < │ │ │ │ -0016fd20: 703e 5468 6520 6578 616d 706c 6520 6265 p>The example be │ │ │ │ -0016fd30: 6c6f 7720 7072 6f64 7563 6573 2061 2057 low produces a W │ │ │ │ -0016fd40: 5344 4c20 6669 6c65 2075 706f 6e20 6120 SDL file upon a │ │ │ │ -0016fd50: 4854 5450 2047 4554 2077 6974 6820 7061 HTTP GET with pa │ │ │ │ -0016fd60: 7468 203c 636f 6465 3e3f 7773 646c 3c2f th ?wsdl:

    .
    int │ │ │ │ -0016fdc0: 3c2f 7370 616e 3e20 3c61 2063 6c61 7373 http_get │ │ │ │ -0016fe20: 3c2f 613e 283c 7370 616e 2063 6c61 7373 (struc │ │ │ │ -0016fe40: 743c 2f73 7061 6e3e 203c 6120 636c 6173 t │ │ │ │ -0016fe70: 736f 6170 3c2f 613e 202a 3c61 2063 6c61 soap *soap)
    .
    {
    .
    │ │ │ │ -0016fee0: 4649 4c45 202a 6664 203d 204e 554c 4c3b FILE *fd = NULL; │ │ │ │ -0016fef0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    char │ │ │ │ -0016ff30: 202a 7320 3d20 7374 7263 6872 283c 6120 *s = strchr(soap-> │ │ │ │ -0016ff70: 3b3c 6120 636c 6173 733d 2263 6f64 6522 ;path, &# │ │ │ │ -0016ffe0: 3339 3b3f 2623 3339 3b3c 2f73 7061 6e3e 39;?' │ │ │ │ -0016fff0: 293b 203c 2f64 6976 3e0a 3c64 6976 2063 );
    .
    if (!s || strcmp( │ │ │ │ -00170040: 732c 203c 7370 616e 2063 6c61 7373 3d22 s, & │ │ │ │ -00170060: 7175 6f74 3b3f 7773 646c 2671 756f 743b quot;?wsdl" │ │ │ │ -00170070: 3c2f 7370 616e 3e29 2920 3c2f 6469 763e ))
    │ │ │ │ -00170080: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    .< │ │ │ │ -00170130: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -00170140: 3e20 2066 6420 3d20 3c61 2063 6c61 7373 > fd = f │ │ │ │ -001701a0: 6f70 656e 3c2f 613e 283c 7370 616e 2063 open("myser │ │ │ │ -001701d0: 7669 6365 2e77 7364 6c26 7175 6f74 3b3c vice.wsdl"< │ │ │ │ -001701e0: 2f73 7061 6e3e 2c20 3c73 7061 6e20 636c /span>, "rb&quo │ │ │ │ -00170210: 743b 3c2f 7370 616e 3e29 3b20 3c73 7061 t;); // open WSDL f │ │ │ │ -00170240: 696c 6520 746f 2063 6f70 7920 3c2f 7370 ile to copy
    .
    if (!fd)
    .< │ │ │ │ -001702a0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001702b0: 3e20 2020 203c 7370 616e 2063 6c61 7373 > r │ │ │ │ -001702d0: 6574 7572 6e3c 2f73 7061 6e3e 2034 3034 eturn 404 │ │ │ │ -001702e0: 3b20 3c73 7061 6e20 636c 6173 733d 2263 ; // retur │ │ │ │ -00170300: 6e20 4854 5450 206e 6f74 2066 6f75 6e64 n HTTP not found │ │ │ │ -00170310: 2065 7272 6f72 203c 2f73 7061 6e3e 3c2f error .
    │ │ │ │ -00170360: 736f 6170 3c2f 613e 2d26 6774 3b3c 6120 soap->http_conte │ │ │ │ -001703c0: 6e74 3c2f 613e 203d 203c 7370 616e 2063 nt = "text/ │ │ │ │ -001703f0: 786d 6c26 7175 6f74 3b3c 2f73 7061 6e3e xml" │ │ │ │ -00170400: 3b20 3c73 7061 6e20 636c 6173 733d 2263 ; // HTTP │ │ │ │ -00170420: 6865 6164 6572 2077 6974 6820 7465 7874 header with text │ │ │ │ -00170430: 2f78 6d6c 2063 6f6e 7465 6e74 203c 2f73 /xml content
    .. │ │ │ │ -001705e0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    {
    .
    │ │ │ │ -00170610: 2020 3c73 7061 6e20 636c 6173 733d 226b whil │ │ │ │ -00170630: 653c 2f73 7061 6e3e 2028 3129 3c2f 6469 e (1).
    {
    │ │ │ │ -00170660: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    size_t │ │ │ │ -001706a0: 2072 203d 2066 7265 6164 283c 6120 636c r = fread(soap->< │ │ │ │ -001706e0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -001706f0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ -00170700: 6874 6d6c 2361 3139 3462 6361 6665 6430 html#a194bcafed0 │ │ │ │ -00170710: 6333 6533 3638 6239 3266 3435 3266 6338 c3e368b92f452fc8 │ │ │ │ -00170720: 3062 3264 3331 223e 746d 7062 7566 3c2f 0b2d31">tmpbuf, 1, siz │ │ │ │ -00170750: 656f 663c 2f73 7061 6e3e 283c 6120 636c eof(soap->< │ │ │ │ -00170790: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -001707a0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ -001707b0: 6874 6d6c 2361 3139 3462 6361 6665 6430 html#a194bcafed0 │ │ │ │ -001707c0: 6333 6533 3638 6239 3266 3435 3266 6338 c3e368b92f452fc8 │ │ │ │ -001707d0: 3062 3264 3331 223e 746d 7062 7566 3c2f 0b2d31">tmpbuf), fd);
    │ │ │ │ -001707f0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    if (!r │ │ │ │ -00170830: 207c 7c20 3c61 2063 6c61 7373 3d22 636f || soap_send_ra │ │ │ │ -00170890: 773c 2f61 3e28 3c61 2063 6c61 7373 3d22 w(soa │ │ │ │ -001708c0: 703c 2f61 3e2c 203c 6120 636c 6173 733d p, so │ │ │ │ -001708f0: 6170 3c2f 613e 2d26 6774 3b3c 6120 636c ap->tmpbuf, │ │ │ │ -00170950: 7229 2920 3c2f 6469 763e 0a3c 6469 7620 r))
    .
    │ │ │ │ -00170970: 2020 2020 203c 7370 616e 2063 6c61 7373 b │ │ │ │ -00170990: 7265 616b 3c2f 7370 616e 3e3b 3c2f 6469 reak;.
    }
    .
    }
    . │ │ │ │ -001709f0: 2020 3c61 2063 6c61 7373 3d22 636f 6465 fclose< │ │ │ │ -00170a50: 2f61 3e28 6664 293b 203c 2f64 6976 3e0a /a>(fd);
    . │ │ │ │ -00170a60: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65 . │ │ │ │ -00170b20: 2020 3c73 7061 6e20 636c 6173 733d 226b retu │ │ │ │ -00170b40: 726e 3c2f 7370 616e 3e20 3c61 2063 6c61 rn soap_c │ │ │ │ -00170ba0: 6c6f 7365 736f 636b 3c2f 613e 283c 6120 losesock(soap);.
    }
    .< │ │ │ │ -00170c00: 6469 7620 636c 6173 733d 2274 7463 2220 div class="ttc" │ │ │ │ -00170c10: 6964 3d22 6167 726f 7570 5f5f 6772 6f75 id="agroup__grou │ │ │ │ -00170c20: 705f 5f65 7272 6f72 735f 6874 6d6c 5f67 p__errors_html_g │ │ │ │ -00170c30: 6163 3632 6635 6637 3065 3534 3565 6138 ac62f5f70e545ea8 │ │ │ │ -00170c40: 6662 6362 6231 3831 6538 3837 3530 6435 fbcbb181e88750d5 │ │ │ │ -00170c50: 3622 3e3c 6469 7620 636c 6173 733d 2274 6">
    #defi │ │ │ │ -00170ce0: 6e65 2053 4f41 505f 4745 545f 4d45 5448 ne SOAP_GET_METH │ │ │ │ -00170cf0: 4f44 3c2f 6469 763e 3c64 6976 2063 6c61 OD
    A soa │ │ │ │ -00170d10: 705f 7374 6174 7573 2065 7272 6f72 2063 p_status error c │ │ │ │ -00170d20: 6f64 653a 2061 6e20 4854 5450 2047 4554 ode: an HTTP GET │ │ │ │ -00170d30: 2072 6571 7565 7374 2077 6173 2072 6563 request was rec │ │ │ │ -00170d40: 6569 7665 6420 6279 2074 6865 2073 6572 eived by the ser │ │ │ │ -00170d50: 7669 6365 2062 7574 2074 6865 2047 4554 vice but the GET │ │ │ │ -00170d60: 2072 6571 7565 7374 2063 616c 6c62 6163 request callbac │ │ │ │ -00170d70: 2e2e 2e3c 2f64 6976 3e3c 6469 7620 636c ...
    D │ │ │ │ -00170d90: 6566 696e 6974 696f 6e3a 3c2f 623e 2073 efinition: s │ │ │ │ -00170da0: 7464 736f 6170 322e 683a 3233 3937 3c2f tdsoap2.h:2397
    .
    < │ │ │ │ -00170e20: 6120 6872 6566 3d22 6772 6f75 705f 5f67 a href="group__g │ │ │ │ -00170e30: 726f 7570 5f5f 696f 2e68 746d 6c23 6761 roup__io.html#ga │ │ │ │ -00170e40: 3035 6265 3939 3334 3366 3535 3666 6537 05be99343f556fe7 │ │ │ │ -00170e50: 3039 3430 3134 3565 3837 3463 6462 3939 0940145e874cdb99 │ │ │ │ -00170e60: 223e 534f 4150 5f46 494c 453c 2f61 3e3c ">SOAP_FILE< │ │ │ │ -00170e70: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
    #define │ │ │ │ -00170e90: 2053 4f41 505f 4649 4c45 3c2f 6469 763e SOAP_FILE
    │ │ │ │ -00170ea0: 3c64 6976 2063 6c61 7373 3d22 7474 646f
    A special soa │ │ │ │ -00170ec0: 705f 7374 6174 7573 2065 7272 6f72 2063 p_status error c │ │ │ │ -00170ed0: 6f64 6520 746f 2073 6967 6e61 6c20 7468 ode to signal th │ │ │ │ -00170ee0: 6174 2061 2063 7573 746f 6d20 6669 6c65 at a custom file │ │ │ │ -00170ef0: 2d62 6173 6564 2048 5454 5020 7265 7370 -based HTTP resp │ │ │ │ -00170f00: 6f6e 7365 2069 7320 7072 6573 656e 7420 onse is present │ │ │ │ -00170f10: 616e 6420 6e6f 2048 2e2e 2e3c 2f64 6976 and no H...
    Definitio │ │ │ │ -00170f40: 6e3a 3c2f 623e 2073 7464 736f 6170 322e n: stdsoap2. │ │ │ │ -00170f50: 683a 3237 3139 3c2f 6469 763e 3c2f 6469 h:2719
    .
    int soap_se │ │ │ │ -00171040: 6e64 5f72 6177 2873 7472 7563 7420 736f nd_raw(struct so │ │ │ │ -00171050: 6170 202a 736f 6170 2c20 636f 6e73 7420 ap *soap, const │ │ │ │ -00171060: 6368 6172 202a 732c 2073 697a 655f 7420 char *s, size_t │ │ │ │ -00171070: 6e29 3c2f 6469 763e 3c64 6976 2063 6c61 n)
    Send │ │ │ │ -00171090: 7261 7720 6279 7465 732e 3c2f 6469 763e raw bytes.
    │ │ │ │ -001710a0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    │ │ │ │ -001710f0: 3c64 6976 2063 6c61 7373 3d22 7474 6e61
    │ │ │ │ -00171140: 736f 6170 3a3a 746d 7062 7566 3c2f 613e soap::tmpbuf │ │ │ │ -00171150: 3c2f 6469 763e 3c64 6976 2063 6c61 7373
    char t │ │ │ │ -00171170: 6d70 6275 665b 534f 4150 5f54 4d50 4c45 mpbuf[SOAP_TMPLE │ │ │ │ -00171180: 4e5d 3c2f 6469 763e 3c64 6976 2063 6c61 N]
    Inter │ │ │ │ -001711a0: 6e61 6c20 6275 6666 6572 2074 6f20 686f nal buffer to ho │ │ │ │ -001711b0: 6c64 2074 656d 706f 7261 7279 2073 7472 ld temporary str │ │ │ │ -001711c0: 696e 6773 2073 7563 6820 6173 2073 7472 ings such as str │ │ │ │ -001711d0: 696e 6720 7265 7072 6573 656e 7461 7469 ing representati │ │ │ │ -001711e0: 6f6e 7320 6f66 2070 7269 6d69 7469 7665 ons of primitive │ │ │ │ -001711f0: 2076 616c 7565 732c 2e2e 2e3c 2f64 6976 values,...
    Definitio │ │ │ │ -00171220: 6e3a 3c2f 623e 2073 7464 736f 6170 322e n: stdsoap2. │ │ │ │ -00171230: 683a 3431 3939 3c2f 6469 763e 3c2f 6469 h:4199
    ..

    This exa │ │ │ │ -00171410: 6d70 6c65 2073 686f 7773 2068 6f77 206f mple shows how o │ │ │ │ -00171420: 6e65 2070 7265 6465 7465 726d 696e 6564 ne predetermined │ │ │ │ -00171430: 2066 696c 6520 6973 2073 6572 7665 642e file is served. │ │ │ │ -00171440: 2054 6865 203c 656d 3e3c 636f 6465 3e67 The g │ │ │ │ -00171450: 736f 6170 2f73 616d 706c 6573 2f77 6562 soap/samples/web │ │ │ │ -00171460: 7365 7276 6572 3c2f 636f 6465 3e3c 2f65 server demonstrates │ │ │ │ -00171480: 686f 7720 6669 6c65 7320 7368 6f75 6c64 how files should │ │ │ │ -00171490: 2062 6520 7365 7276 6564 2069 6e20 6765 be served in ge │ │ │ │ -001714a0: 6e65 7261 6c2c 2062 7920 6164 6469 6e67 neral, by adding │ │ │ │ -001714b0: 2074 6865 206e 6563 6573 7361 7279 206c the necessary l │ │ │ │ -001714c0: 6f67 6963 2074 6f20 6164 6420 6d65 6469 ogic to add medi │ │ │ │ -001714d0: 6120 7479 7065 7320 746f 2048 5454 5020 a types to HTTP │ │ │ │ -001714e0: 6865 6164 6572 7320 616e 6420 746f 2072 headers and to r │ │ │ │ -001714f0: 6573 7472 6963 7420 7468 6520 7365 6c65 estrict the sele │ │ │ │ -00171500: 6374 696f 6e20 6f66 2066 696c 6573 2074 ction of files t │ │ │ │ -00171510: 6861 7420 7368 6f75 6c64 2062 6520 7365 hat should be se │ │ │ │ -00171520: 7276 6564 2e3c 2f70 3e0a 3c64 6c20 636c rved.

    .
    Warnin │ │ │ │ -00171550: 673c 2f64 743e 3c64 643e 5768 656e 2073 g
    When s │ │ │ │ -00171560: 6572 7669 6e67 2066 696c 6573 2061 7320 erving files as │ │ │ │ -00171570: 7265 7370 6f6e 7365 7320 746f 2072 6571 responses to req │ │ │ │ -00171580: 7565 7374 732c 2077 6520 6e65 6564 2074 uests, we need t │ │ │ │ -00171590: 6f20 6265 2076 6172 7920 6361 7265 6675 o be vary carefu │ │ │ │ -001715a0: 6c2c 2062 6563 6175 7365 2077 6520 646f l, because we do │ │ │ │ -001715b0: 6e27 7420 7761 6e74 2072 6571 7565 7374 n't want request │ │ │ │ -001715c0: 7320 746f 2073 6e6f 6f70 2061 726f 756e s to snoop aroun │ │ │ │ -001715d0: 6420 696e 2064 6972 6563 746f 7269 6573 d in directories │ │ │ │ -001715e0: 2061 6e64 2073 6572 7665 2066 696c 6573 and serve files │ │ │ │ -001715f0: 2074 6861 7420 7368 6f75 6c64 2062 6520 that should be │ │ │ │ -00171600: 7072 6f74 6563 7465 6420 6672 6f6d 2070 protected from p │ │ │ │ -00171610: 7562 6c69 6320 7669 6577 2e20 5468 6572 ublic view. Ther │ │ │ │ -00171620: 6566 6f72 652c 2077 6865 6e20 6164 6469 efore, when addi │ │ │ │ -00171630: 6e67 206c 6f67 6963 2074 6f20 7365 7276 ng logic to serv │ │ │ │ -00171640: 6520 6669 6c65 732c 2077 6520 6d75 7374 e files, we must │ │ │ │ -00171650: 2072 656a 6563 7420 7265 7175 6573 7420 reject request │ │ │ │ -00171660: 7468 6174 2068 6176 6520 3c63 6f64 653e that have │ │ │ │ -00171670: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap::pat │ │ │ │ -00171700: 683c 2f61 3e3c 2f63 6f64 653e 2076 616c h val │ │ │ │ -00171710: 7565 7320 7769 7468 2061 203c 636f 6465 ues with a / or a < │ │ │ │ -00171730: 636f 6465 3e5c 3c2f 636f 6465 3e20 283c code>\ (< │ │ │ │ -00171740: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soap │ │ │ │ -001717d0: 3a3a 7061 7468 3c2f 613e 3c2f 636f 6465 ::path is a string wi │ │ │ │ -001717f0: 7468 2074 6865 2070 6174 6820 7061 7274 th the path part │ │ │ │ -00171800: 206f 6620 7468 6520 5552 4c2c 2073 7461 of the URL, sta │ │ │ │ -00171810: 7274 696e 6720 7769 7468 2061 203c 636f rting with a /). If │ │ │ │ -00171830: 2074 6865 7365 2061 7265 2061 6c6c 6f77 these are allow │ │ │ │ -00171840: 6564 2c20 7468 656e 2077 6520 6d75 7374 ed, then we must │ │ │ │ -00171850: 2061 7420 6c65 6173 7420 6368 6563 6b20 at least check │ │ │ │ -00171860: 666f 7220 3c63 6f64 653e 2e2e 3c2f 636f for .. in the path │ │ │ │ -00171880: 746f 2061 766f 6964 2072 6571 7565 7374 to avoid request │ │ │ │ -00171890: 2066 726f 6d20 736e 6f6f 7069 6e67 2061 from snooping a │ │ │ │ -001718a0: 726f 756e 6420 696e 2068 6967 6865 7220 round in higher │ │ │ │ -001718b0: 6469 7265 6374 6f72 6965 7320 616c 6c20 directories all │ │ │ │ -001718c0: 7468 6520 7761 7920 7570 2074 6f20 7468 the way up to th │ │ │ │ -001718d0: 6520 726f 6f74 2e3c 2f64 643e 3c2f 646c e root.
    .

    For a one-w │ │ │ │ -001718f0: 6179 2053 4f41 502f 584d 4c20 6d65 7373 ay SOAP/XML mess │ │ │ │ -00171900: 6167 652c 2079 6f75 2063 616e 2061 6c73 age, you can als │ │ │ │ -00171910: 6f20 7265 7475 726e 2061 2053 4f41 502f o return a SOAP/ │ │ │ │ -00171920: 584d 4c20 7265 7370 6f6e 7365 3a3c 2f70 XML response:

    .
    int < │ │ │ │ -00171980: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -00171990: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ │ -001719a0: 705f 5f69 6f2e 6874 6d6c 2367 6130 6563 p__io.html#ga0ec │ │ │ │ -001719b0: 6463 3433 6135 3365 3439 3465 6463 3466 dc43a53e494edc4f │ │ │ │ -001719c0: 3834 6538 6331 3335 3635 3962 6122 3e68 84e8c135659ba">h │ │ │ │ -001719d0: 7474 705f 6765 743c 2f61 3e28 3c73 7061 ttp_get(struct │ │ │ │ -00171a00: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap │ │ │ │ -00171a30: 2a3c 6120 636c 6173 733d 2263 6f64 6522 *soap │ │ │ │ -00171a60: 2920 3c2f 6469 763e 0a3c 6469 7620 636c )
    .
    {.
    soap_resp │ │ │ │ -00171af0: 6f6e 7365 3c2f 613e 283c 6120 636c 6173 onse( │ │ │ │ -00171b20: 736f 6170 3c2f 613e 2c20 3c61 2063 6c61 soap, SO │ │ │ │ -00171b80: 4150 5f4f 4b3c 2f61 3e29 3b20 3c2f 6469 AP_OK); .
    return s │ │ │ │ -00171bd0: 6f61 705f 7365 6e64 5f6e 7331 5f5f 6d79 oap_send_ns1__my │ │ │ │ -00171be0: 5365 6e64 4d65 7468 6f64 5265 7370 6f6e SendMethodRespon │ │ │ │ -00171bf0: 7365 283c 6120 636c 6173 733d 2263 6f64 se(soap, │ │ │ │ -00171c40: 2671 756f 743b 2671 756f 743b 3c2f 7370 "", NULL, ... p │ │ │ │ -00171c60: 6172 616d 7320 2e2e 2e29 3b20 3c2f 6469 arams ...); .
    }
    .

    where ns1__mySendM │ │ │ │ -00171cc0: 6574 686f 6452 6573 706f 6e73 653c 2f63 ethodResponse is a one-wa │ │ │ │ -00171ce0: 7920 6d65 7373 6167 6520 6465 636c 6172 y message declar │ │ │ │ -00171cf0: 6564 2069 6e20 6120 696e 7465 7266 6163 ed in a interfac │ │ │ │ -00171d00: 6520 6865 6164 6572 2066 696c 6520 6173 e header file as │ │ │ │ -00171d10: 3a3c 2f70 3e0a 3c64 6976 2063 6c61 7373 :

    .
    int ns1__mySendMe │ │ │ │ -00171d70: 7468 6f64 5265 7370 6f6e 7365 282e 2e2e thodResponse(... │ │ │ │ -00171d80: 2070 6172 616d 7320 2e2e 2e2c 203c 7370 params ..., void);
    .

    When a cli │ │ │ │ -00172460: 656e 7420 6f72 2061 2073 6572 7669 6365 ent or a service │ │ │ │ -00172470: 2063 6f6d 6d75 6e69 6361 7465 7320 7769 communicates wi │ │ │ │ -00172480: 7468 2061 6e6f 7468 6572 2063 6c69 656e th another clien │ │ │ │ -00172490: 7420 6f72 2073 6572 7669 6365 2074 6861 t or service tha │ │ │ │ -001724a0: 7420 7375 7070 6f72 7473 206b 6565 7020 t supports keep │ │ │ │ -001724b0: 616c 6976 652c 2074 6865 203c 636f 6465 alive, the s │ │ │ │ -00172570: 6f61 703a 3a6b 6565 705f 616c 6976 653c oap::keep_alive< │ │ │ │ -00172580: 2f61 3e3c 2f63 6f64 653e 2076 6172 6961 /a> varia │ │ │ │ -00172590: 626c 6520 7769 6c6c 2062 6520 7365 7420 ble will be set │ │ │ │ -001725a0: 746f 2031 2c20 6f74 6865 7277 6973 6520 to 1, otherwise │ │ │ │ -001725b0: 6974 2069 7320 7265 7365 7420 746f 2030 it is reset to 0 │ │ │ │ -001725c0: 2069 6e64 6963 6174 696e 6720 7468 6174 indicating that │ │ │ │ -001725d0: 2074 6865 206f 7468 6572 2070 6172 7479 the other party │ │ │ │ -001725e0: 2077 616e 7473 2074 6f20 636c 6f73 6520 wants to close │ │ │ │ -001725f0: 7468 6520 636f 6e6e 6563 7469 6f6e 2e20 the connection. │ │ │ │ -00172600: 5468 6520 636f 6e6e 6563 7469 6f6e 206d The connection m │ │ │ │ -00172610: 6179 6265 2074 6572 6d69 6e61 7465 6420 aybe terminated │ │ │ │ -00172620: 6f6e 2065 6974 6865 7220 656e 6420 6265 on either end be │ │ │ │ -00172630: 666f 7265 2074 6865 2063 6f6d 6d75 6e69 fore the communi │ │ │ │ -00172640: 6361 7469 6f6e 2063 6f6d 706c 6574 6564 cation completed │ │ │ │ -00172650: 2c20 666f 7220 6578 616d 706c 6520 7768 , for example wh │ │ │ │ -00172660: 656e 2074 6865 2073 6572 7665 7220 6b65 en the server ke │ │ │ │ -00172670: 6570 2d61 6c69 7665 2063 6f6e 6e65 6374 ep-alive connect │ │ │ │ -00172680: 696f 6e20 6861 7320 7469 6d65 6420 6f75 ion has timed ou │ │ │ │ -00172690: 742e 2054 6869 7320 6d61 7920 6765 6e65 t. This may gene │ │ │ │ -001726a0: 7261 7465 2061 2022 4272 6f6b 656e 2050 rate a "Broken P │ │ │ │ -001726b0: 6970 6522 2073 6967 6e61 6c20 6f6e 2055 ipe" signal on U │ │ │ │ -001726c0: 6e69 782f 4c69 6e75 7820 706c 6174 666f nix/Linux platfo │ │ │ │ -001726d0: 726d 732e 2054 6869 7320 7369 676e 616c rms. This signal │ │ │ │ -001726e0: 2063 616e 2062 6520 6361 7567 6874 2077 can be caught w │ │ │ │ -001726f0: 6974 6820 6120 7369 676e 616c 2068 616e ith a signal han │ │ │ │ -00172700: 646c 6572 3a3c 2f70 3e0a 3c64 6976 2063 dler:

    .
    │ │ │ │ -00172720: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    signal(SIGPIPE │ │ │ │ -00172740: 2c20 7369 6770 6970 655f 6861 6e64 6c65 , sigpipe_handle │ │ │ │ -00172750: 293b 3c2f 6469 763e 0a3c 2f64 6976 3e3c );
    .
    < │ │ │ │ -00172760: 212d 2d20 6672 6167 6d65 6e74 202d 2d3e !-- fragment --> │ │ │ │ -00172770: 3c70 3e77 6865 7265 2c20 666f 7220 6578

    where, for ex │ │ │ │ -00172780: 616d 706c 653a 3c2f 703e 0a3c 6469 7620 ample:

    .
    voi │ │ │ │ -001727d0: 643c 2f73 7061 6e3e 2073 6967 7069 7065 d sigpipe │ │ │ │ -001727e0: 5f68 616e 646c 6528 3c73 7061 6e20 636c _handle(int x) │ │ │ │ -00172810: 7b20 7d3c 2f64 6976 3e0a 3c2f 6469 763e { }
    .
    │ │ │ │ -00172820: 3c21 2d2d 2066 7261 676d 656e 7420 2d2d

    This sett │ │ │ │ -00172b00: 696e 6720 7769 6c6c 206e 6f74 2067 656e ing will not gen │ │ │ │ -00172b10: 6572 6174 6520 6120 5349 4750 4950 4520 erate a SIGPIPE │ │ │ │ -00172b20: 6275 7420 7265 6164 2f77 7269 7465 206f but read/write o │ │ │ │ -00172b30: 7065 7261 7469 6f6e 7320 7265 7475 726e perations return │ │ │ │ -00172b40: 203c 636f 6465 3e23 534f 4150 5f45 4f46 #SOAP_EOF │ │ │ │ -00172b50: 3c2f 636f 6465 3e20 696e 7374 6561 642e instead. │ │ │ │ -00172b60: 204e 6f74 6520 7468 6174 2057 696e 646f Note that Windo │ │ │ │ -00172b70: 7773 2064 6f65 7320 6e6f 7420 7375 7070 ws does not supp │ │ │ │ -00172b80: 6f72 7420 7369 676e 616c 7320 616e 6420 ort signals and │ │ │ │ -00172b90: 6c61 636b 2074 6865 203c 636f 6465 3e4d lack the M │ │ │ │ -00172ba0: 5347 5f4e 4f53 4947 4e41 4c3c 2f63 6f64 SG_NOSIGNAL flag.

    .

    │ │ │ │ -00172bc0: 4966 2074 6865 2063 6c69 656e 7420 646f If the client do │ │ │ │ -00172bd0: 6573 206e 6f74 2063 6c6f 7365 2074 6865 es not close the │ │ │ │ -00172be0: 2063 6f6e 6e65 6374 696f 6e2c 2074 6865 connection, the │ │ │ │ -00172bf0: 2073 6572 7665 7220 7769 6c6c 2077 6169 server will wai │ │ │ │ -00172c00: 7420 666f 7265 7665 7220 7768 656e 206e t forever when n │ │ │ │ -00172c10: 6f20 3c63 6f64 653e 3c61 2063 6c61 7373 o soap::recv_ti │ │ │ │ -00172cd0: 6d65 6f75 743c 2f61 3e3c 2f63 6f64 653e meout │ │ │ │ -00172ce0: 2069 7320 7370 6563 6966 6965 642c 2073 is specified, s │ │ │ │ -00172cf0: 6f20 6265 2063 6172 6566 756c 2074 6f20 o be careful to │ │ │ │ -00172d00: 7365 7420 7469 6d65 6f75 7473 2c20 5365 set timeouts, Se │ │ │ │ -00172d10: 6520 5365 6374 696f 6e20 3c61 2063 6c61 e Section Timeout manage │ │ │ │ -00172d50: 6d65 6e74 2066 6f72 206e 6f6e 2d62 6c6f ment for non-blo │ │ │ │ -00172d60: 636b 696e 6720 6f70 6572 6174 696f 6e73 cking operations │ │ │ │ -00172d70: 3c2f 613e 2e20 496e 2061 6464 6974 696f . In additio │ │ │ │ -00172d80: 6e2c 206f 7468 6572 2063 6c69 656e 7473 n, other clients │ │ │ │ -00172d90: 2077 696c 6c20 6265 2064 656e 6965 6420 will be denied │ │ │ │ -00172da0: 7365 7276 6963 6520 6173 206c 6f6e 6720 service as long │ │ │ │ -00172db0: 6173 2061 2063 6c69 656e 7420 6b65 6570 as a client keep │ │ │ │ -00172dc0: 7320 7468 6520 636f 6e6e 6563 7469 6f6e s the connection │ │ │ │ -00172dd0: 2074 6f20 7468 6520 7365 7276 6572 206f to the server o │ │ │ │ -00172de0: 7065 6e2e 2054 6f20 7072 6576 656e 7420 pen. To prevent │ │ │ │ -00172df0: 7468 6973 2066 726f 6d20 6861 7070 656e this from happen │ │ │ │ -00172e00: 696e 672c 2074 6865 2073 6572 7669 6365 ing, the service │ │ │ │ -00172e10: 2073 686f 756c 6420 6265 206d 756c 7469 should be multi │ │ │ │ -00172e20: 2d74 6872 6561 6465 6420 7375 6368 2074 -threaded such t │ │ │ │ -00172e30: 6861 7420 6561 6368 2074 6872 6561 6420 hat each thread │ │ │ │ -00172e40: 6861 6e64 6c65 7320 7468 6520 636c 6965 handles the clie │ │ │ │ -00172e50: 6e74 2063 6f6e 6e65 6374 696f 6e3a 3c2f nt connection:.

    int │ │ │ │ -00172eb0: 6d61 696e 283c 7370 616e 2063 6c61 7373 main(i │ │ │ │ -00172ed0: 6e74 3c2f 7370 616e 3e20 6172 6763 2c20 nt argc, │ │ │ │ -00172ee0: 3c73 7061 6e20 636c 6173 733d 226b 6579 char **argv) .
    {
    .< │ │ │ │ -00172f30: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -00172f40: 3e20 203c 7370 616e 2063 6c61 7373 3d22 > struct │ │ │ │ -00172f60: 3c2f 7370 616e 3e3c 6120 636c 6173 733d so │ │ │ │ -00172f90: 6170 3c2f 613e 203c 6120 636c 6173 733d ap so │ │ │ │ -00172fc0: 6170 3c2f 613e 2c20 2a74 736f 6170 3b20 ap, *tsoap; │ │ │ │ -00172fd0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    │ │ │ │ -00173040: 5448 5245 4144 5f54 5950 453c 2f61 3e20 THREAD_TYPE │ │ │ │ -00173050: 7469 643b 203c 2f64 6976 3e0a 3c64 6976 tid;
    .
    │ │ │ │ -00173070: 3c73 7061 6e20 636c 6173 733d 226b 6579 int m, s;
    .
    soap_ │ │ │ │ -00173110: 696e 6974 323c 2f61 3e28 2661 6d70 3b3c init2(&< │ │ │ │ -00173120: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -00173130: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ -00173140: 6874 6d6c 223e 736f 6170 3c2f 613e 2c20 html">soap, │ │ │ │ -00173150: 3c61 2063 6c61 7373 3d22 636f 6465 2220 SOAP_IO_KEEPA │ │ │ │ -001731b0: 4c49 5645 3c2f 613e 2c20 3c61 2063 6c61 LIVE, SOA │ │ │ │ -00173210: 505f 494f 5f4b 4545 5041 4c49 5645 3c2f P_IO_KEEPALIVE);
    .
    │ │ │ │ -00173240: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap. │ │ │ │ -00173270: 3c61 2063 6c61 7373 3d22 636f 6465 2220 max_kee │ │ │ │ -001732c0: 705f 616c 6976 653c 2f61 3e20 3d20 3130 p_alive = 10 │ │ │ │ -001732d0: 303b 203c 7370 616e 2063 6c61 7373 3d22 0; // at m │ │ │ │ -001732f0: 6f73 7420 3130 3020 6361 6c6c 7320 7065 ost 100 calls pe │ │ │ │ -00173300: 7220 6b65 6570 2d61 6c69 7665 2073 6573 r keep-alive ses │ │ │ │ -00173310: 7369 6f6e 203c 2f73 7061 6e3e 3c2f 6469 sion ..< │ │ │ │ -00173430: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -00173440: 3e20 206d 203d 203c 6120 636c 6173 733d > m = soap_bind │ │ │ │ -001734a0: 3c2f 613e 2826 616d 703b 3c61 2063 6c61 (&soap, NULL, │ │ │ │ -001734e0: 2031 3830 3030 2c20 4241 434b 4c4f 4729 18000, BACKLOG) │ │ │ │ -001734f0: 3b20 3c73 7061 6e20 636c 6173 733d 2263 ; // use p │ │ │ │ -00173510: 6f72 7420 3138 3030 3020 6f6e 2074 6865 ort 18000 on the │ │ │ │ -00173520: 2063 7572 7265 6e74 206d 6163 6869 6e65 current machine │ │ │ │ -00173530: 203c 2f73 7061 6e3e 3c2f 6469 763e 0a3c
    .< │ │ │ │ -00173540: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -00173550: 3e20 203c 7370 616e 2063 6c61 7373 3d22 > if< │ │ │ │ -00173570: 2f73 7061 6e3e 2028 213c 6120 636c 6173 /span> (!soap_ │ │ │ │ -001735d0: 7661 6c69 645f 736f 636b 6574 3c2f 613e valid_socket │ │ │ │ -001735e0: 286d 2929 203c 2f64 6976 3e0a 3c64 6976 (m))
    .
    │ │ │ │ -00173600: 7b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 {
    .
    soap_print_faul │ │ │ │ -00173680: 743c 2f61 3e28 2661 6d70 3b3c 6120 636c t(&soap, stde │ │ │ │ -001736c0: 7272 293b 203c 2f64 6976 3e0a 3c64 6976 rr);
    .
    │ │ │ │ -001736e0: 2020 6578 6974 2845 5849 545f 4641 494c exit(EXIT_FAIL │ │ │ │ -001736f0: 5552 4529 3b20 3c2f 6469 763e 0a3c 6469 URE);
    . │ │ │ │ -00173710: 207d 203c 2f64 6976 3e0a 3c64 6976 2063 }
    .
    fp │ │ │ │ -00173730: 7269 6e74 6628 7374 6465 7272 2c20 3c73 rintf(stderr, " │ │ │ │ -00173760: 536f 636b 6574 2063 6f6e 6e65 6374 696f Socket connectio │ │ │ │ -00173770: 6e20 7375 6363 6573 7366 756c 2025 645c n successful %d\ │ │ │ │ -00173780: 6e26 7175 6f74 3b3c 2f73 7061 6e3e 2c20 n", │ │ │ │ -00173790: 6d29 3b20 3c2f 6469 763e 0a3c 6469 7620 m);
    .
    < │ │ │ │ -001737b0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -001737c0: 6f72 6466 6c6f 7722 3e66 6f72 3c2f 7370 ordflow">for (co │ │ │ │ -00173820: 756e 743c 2f61 3e20 3d20 303b 203c 6120 unt = 0; count │ │ │ │ -00173880: 2667 743b 3d20 303b 203c 6120 636c 6173 >= 0; count++) < │ │ │ │ -001738e0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    {
    .
    s │ │ │ │ -00173940: 6f61 703c 2f61 3e2e 3c61 2063 6c61 7373 oap.socket_flags = MSG_NOSIGNAL │ │ │ │ -001739b0: 3b20 3c73 7061 6e20 636c 6173 733d 2263 ; // use t │ │ │ │ -001739d0: 6869 7320 3c2f 7370 616e 3e3c 2f64 6976 his
    .
    s │ │ │ │ -00173a20: 6f61 703c 2f61 3e2e 3c61 2063 6c61 7373 oap.accept_flags = SO_NOSIGPIPE │ │ │ │ -00173a90: 3b20 3c73 7061 6e20 636c 6173 733d 2263 ; // or th │ │ │ │ -00173ab0: 6973 2074 6f20 7072 6576 656e 7420 5349 is to prevent SI │ │ │ │ -00173ac0: 4750 4950 4520 3c2f 7370 616e 3e3c 2f64 GPIPE .
    s = so │ │ │ │ -00173b40: 6170 5f61 6363 6570 743c 2f61 3e28 2661 ap_accept(&a │ │ │ │ -00173b50: 6d70 3b3c 6120 636c 6173 733d 2263 6f64 mp;soap);
    ..
    │ │ │ │ -00173c50: 7b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 {
    .
    │ │ │ │ -00173c70: 6670 7269 6e74 6628 7374 6465 7272 2c20 fprintf(stderr, │ │ │ │ -00173c80: 3c73 7061 6e20 636c 6173 733d 2273 7472 &quo │ │ │ │ -00173ca0: 743b 4163 6365 7074 2073 6f63 6b65 7420 t;Accept socket │ │ │ │ -00173cb0: 2564 2063 6f6e 6e65 6374 696f 6e20 6672 %d connection fr │ │ │ │ -00173cc0: 6f6d 2049 5020 2564 2e25 642e 2564 2e25 om IP %d.%d.%d.% │ │ │ │ -00173cd0: 645c 6e26 7175 6f74 3b3c 2f73 7061 6e3e d\n" │ │ │ │ -00173ce0: 2c20 732c 2028 3c73 7061 6e20 636c 6173 , s, ( │ │ │ │ -00173d00: 696e 743c 2f73 7061 6e3e 2928 3c61 2063 int)(soap.ip>& │ │ │ │ -00173d90: 6774 3b32 3429 2661 6d70 3b30 7846 462c gt;24)&0xFF, │ │ │ │ -00173da0: 2028 3c73 7061 6e20 636c 6173 733d 226b (int< │ │ │ │ -00173dc0: 2f73 7061 6e3e 2928 3c61 2063 6c61 7373 /span>)(s │ │ │ │ -00173df0: 6f61 703c 2f61 3e2e 3c61 2063 6c61 7373 oap.ip>>1 │ │ │ │ -00173e50: 3629 2661 6d70 3b30 7846 462c 2028 3c73 6)&0xFF, (int)(soap< │ │ │ │ -00173eb0: 2f61 3e2e 3c61 2063 6c61 7373 3d22 636f /a>.ip< │ │ │ │ -00173f00: 2f61 3e26 6774 3b26 6774 3b38 2926 616d /a>>>8)&am │ │ │ │ -00173f10: 703b 3078 4646 2c20 283c 7370 616e 2063 p;0xFF, (int)soap.ip&am │ │ │ │ -00173fc0: 703b 3078 4646 293b 203c 2f64 6976 3e0a p;0xFF);
    . │ │ │ │ -00173fd0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    tsoap = │ │ │ │ -00173ff0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap_copy(&s │ │ │ │ -00174080: 6f61 703c 2f61 3e29 3b20 3c2f 6469 763e oap);
    │ │ │ │ -00174090: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    if (!t │ │ │ │ -001740d0: 736f 6170 293c 2f64 6976 3e0a 3c64 6976 soap)
    .
    │ │ │ │ -001740f0: 2020 2020 2020 3c61 2063 6c61 7373 3d22 soap_force │ │ │ │ -00174150: 5f63 6c6f 7365 736f 636b 3c2f 613e 2826 _closesock(& │ │ │ │ -00174160: 616d 703b 3c61 2063 6c61 7373 3d22 636f amp;soap< │ │ │ │ -00174190: 2f61 3e29 3b3c 2f64 6976 3e0a 3c64 6976 /a>);
    .
    │ │ │ │ -001741b0: 2020 2020 3c73 7061 6e20 636c 6173 733d el │ │ │ │ -001741d0: 7365 3c2f 7370 616e 3e3c 2f64 6976 3e0a se
    . │ │ │ │ -001741e0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    while │ │ │ │ -00174220: 2028 3c61 2063 6c61 7373 3d22 636f 6465 (THREAD_CR │ │ │ │ -00174280: 4541 5445 3c2f 613e 2826 616d 703b 7469 EATE(&ti │ │ │ │ -00174290: 642c 2028 3c73 7061 6e20 636c 6173 733d d, (vo │ │ │ │ -001742b0: 6964 3c2f 7370 616e 3e2a 282a 2928 3c73 id*(*)(void*))process_re │ │ │ │ -001742f0: 7175 6573 742c 2028 3c73 7061 6e20 636c quest, (void*)t │ │ │ │ -00174320: 736f 6170 2929 3c2f 6469 763e 0a3c 6469 soap))
    . │ │ │ │ -00174340: 2020 2020 2020 2020 2073 6c65 6570 2831 sleep(1 │ │ │ │ -00174350: 293b 203c 7370 616e 2063 6c61 7373 3d22 ); // fail │ │ │ │ -00174370: 6564 2c20 7472 7920 6167 6169 6e3c 2f73 ed, try again
    .
    │ │ │ │ -001743a0: 207d 3c2f 6469 763e 0a3c 6469 7620 636c }
    .
    < │ │ │ │ -001743c0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -001743d0: 6f72 6466 6c6f 7722 3e65 6c73 653c 2f73 ordflow">else i │ │ │ │ -00174400: 663c 2f73 7061 6e3e 2028 3c61 2063 6c61 f (soap.errnum) < │ │ │ │ -00174490: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ -001744a0: 656e 7422 3e2f 2f20 6163 6365 7074 2066 ent">// accept f │ │ │ │ -001744b0: 6169 6c65 642c 2074 7279 2061 6761 696e ailed, try again │ │ │ │ -001744c0: 2061 6674 6572 2031 2073 6563 6f6e 643c after 1 second< │ │ │ │ -001744d0: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    . │ │ │ │ -001744f0: 2020 207b 3c2f 6469 763e 0a3c 6469 7620 {
    .
    │ │ │ │ -00174510: 2020 203c 6120 636c 6173 733d 2263 6f64 soap_print │ │ │ │ -00174570: 5f66 6175 6c74 3c2f 613e 2826 616d 703b _fault(& │ │ │ │ -00174580: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap, │ │ │ │ -001745b0: 2073 7464 6572 7229 3b20 3c2f 6469 763e stderr);
    │ │ │ │ -001745c0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    sleep(1 │ │ │ │ -001745e0: 293b 3c2f 6469 763e 0a3c 6469 7620 636c );
    .
    } │ │ │ │ -00174600: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    else
    .
    { │ │ │ │ -00174660: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    f │ │ │ │ -00174680: 7072 696e 7466 2873 7464 6572 722c 203c printf(stderr, < │ │ │ │ -00174690: 7370 616e 2063 6c61 7373 3d22 7374 7269 span class="stri │ │ │ │ -001746a0: 6e67 6c69 7465 7261 6c22 3e26 7175 6f74 ngliteral">" │ │ │ │ -001746b0: 3b53 6572 7665 7220 7469 6d65 6420 6f75 ;Server timed ou │ │ │ │ -001746c0: 745c 6e26 7175 6f74 3b3c 2f73 7061 6e3e t\n" │ │ │ │ -001746d0: 293b 3c2f 6469 763e 0a3c 6469 7620 636c );
    .
    │ │ │ │ -001746f0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 break │ │ │ │ -00174710: 3c2f 7370 616e 3e3b 203c 2f64 6976 3e0a ;
    . │ │ │ │ -00174720: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    }
    .< │ │ │ │ -00174740: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -00174750: 3e20 207d 203c 2f64 6976 3e0a 3c64 6976 > }
    .
    │ │ │ │ -00174770: 3c73 7061 6e20 636c 6173 733d 226b 6579 return │ │ │ │ -00174790: 3c2f 7370 616e 3e20 303b 203c 2f64 6976 0;
    .
    }
    . │ │ │ │ -001747d0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    void * │ │ │ │ -00174810: 7072 6f63 6573 735f 7265 7175 6573 7428 process_request( │ │ │ │ -00174820: 3c73 7061 6e20 636c 6173 733d 226b 6579 void *tsoap) .
    {
    .< │ │ │ │ -00174870: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -00174880: 3e20 203c 7370 616e 2063 6c61 7373 3d22 > struct │ │ │ │ -001748a0: 3c2f 7370 616e 3e2a 3c61 2063 6c61 7373 *s │ │ │ │ -001748d0: 6f61 703c 2f61 3e20 3d20 283c 7370 616e oap = (struct < │ │ │ │ -00174900: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -00174910: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ -00174920: 6874 6d6c 223e 736f 6170 3c2f 613e 2a29 html">soap*) │ │ │ │ -00174930: 7473 6f61 703b 3c2f 6469 763e 0a3c 6469 tsoap;
    . │ │ │ │ -00174950: 203c 6120 636c 6173 733d 2263 6f64 6522 THREAD_DET │ │ │ │ -001749b0: 4143 483c 2f61 3e28 3c61 2063 6c61 7373 ACH(THR │ │ │ │ -00174a10: 4541 445f 4944 3c2f 613e 293b 203c 2f64 EAD_ID); .
    (( │ │ │ │ -00174a50: 7374 7275 6374 203c 2f73 7061 6e3e 3c61 struct soap*)< │ │ │ │ -00174a90: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -00174aa0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ -00174ab0: 6874 6d6c 223e 736f 6170 3c2f 613e 292d html">soap)- │ │ │ │ -00174ac0: 2667 743b 7265 6376 5f74 696d 656f 7574 >recv_timeout │ │ │ │ -00174ad0: 203d 2036 303b 203c 7370 616e 2063 6c61 = 60; // │ │ │ │ -00174af0: 5469 6d65 6f75 7420 6166 7465 7220 3120 Timeout after 1 │ │ │ │ -00174b00: 6d69 6e75 7465 2073 7461 6c6c 206f 6e20 minute stall on │ │ │ │ -00174b10: 7265 6376 203c 2f73 7061 6e3e 3c2f 6469 recv .
    ((s │ │ │ │ -00174b50: 7472 7563 7420 3c2f 7370 616e 3e3c 6120 truct soap*)soap)-& │ │ │ │ -00174bc0: 6774 3b73 656e 645f 7469 6d65 6f75 7420 gt;send_timeout │ │ │ │ -00174bd0: 3d20 3130 3b20 3c73 7061 6e20 636c 6173 = 10; // T │ │ │ │ -00174bf0: 696d 656f 7574 2061 6674 6572 2031 3020 imeout after 10 │ │ │ │ -00174c00: 7365 636f 6e64 2073 7461 6c6c 206f 6e20 second stall on │ │ │ │ -00174c10: 7365 6e64 203c 2f73 7061 6e3e 3c2f 6469 send ..< │ │ │ │ -00174cd0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -00174ce0: 3e20 203c 6120 636c 6173 733d 2263 6f64 > soap_des │ │ │ │ -00174d40: 7472 6f79 3c2f 613e 283c 6120 636c 6173 troy( │ │ │ │ -00174d70: 736f 6170 3c2f 613e 293b 203c 2f64 6976 soap);
    . │ │ │ │ -00174e30: 0a3c 6469 7620 636c 6173 733d 226c 696e . │ │ │ │ -00174ee0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    r │ │ │ │ -00174f10: 6574 7572 6e3c 2f73 7061 6e3e 204e 554c eturn NUL │ │ │ │ -00174f20: 4c3b 203c 2f64 6976 3e0a 3c64 6976 2063 L;
    .
    }.
    soa │ │ │ │ -00174fe0: 703a 3a63 6f75 6e74 3c2f 613e 3c2f 6469 p::count
    ULONG64 co │ │ │ │ -00175010: 756e 743c 2f64 6976 3e3c 6469 7620 636c unt
    Mess │ │ │ │ -00175030: 6167 6520 6c65 6e67 7468 2063 6f75 6e74 age length count │ │ │ │ -00175040: 6572 2076 616c 7565 206f 6620 7468 6520 er value of the │ │ │ │ -00175050: 6d65 7373 6167 6520 7265 6365 6976 6564 message received │ │ │ │ -00175060: 2061 6e64 2063 6f75 6e74 6572 2076 616c and counter val │ │ │ │ -00175070: 7565 206f 6620 7468 6520 4854 5450 2063 ue of the HTTP c │ │ │ │ -00175080: 6f6e 7465 6e74 206c 656e 6774 6820 6865 ontent length he │ │ │ │ -00175090: 612e 2e2e 3c2f 6469 763e 3c64 6976 2063 a...
    │ │ │ │ -001750b0: 4465 6669 6e69 7469 6f6e 3a3c 2f62 3e20 Definition: │ │ │ │ -001750c0: 7374 6473 6f61 7032 2e68 3a34 3230 343c stdsoap2.h:4204< │ │ │ │ -001750d0: 2f64 6976 3e3c 2f64 6976 3e0a 3c64 6976 /div>
    .
    int accept_ │ │ │ │ -001751b0: 666c 6167 733c 2f64 6976 3e3c 6469 7620 flags
    Us │ │ │ │ -001751d0: 6572 2d64 6566 696e 6162 6c65 2073 6574 er-definable set │ │ │ │ -001751e0: 736f 636b 6f70 7420 6c65 7665 6c20 534f sockopt level SO │ │ │ │ -001751f0: 4c5f 534f 434b 4554 2066 6c61 6773 2028 L_SOCKET flags ( │ │ │ │ -00175200: 3020 6279 2064 6566 6175 6c74 292c 2077 0 by default), w │ │ │ │ -00175210: 6865 6e20 6e6f 6e7a 6572 6f20 7365 7473 hen nonzero sets │ │ │ │ -00175220: 2074 6865 2073 6f61 703a 3a73 6f63 6b65 the soap::socke │ │ │ │ -00175230: 7420 662e 2e2e 3c2f 6469 763e 3c64 6976 t f...
    < │ │ │ │ -00175250: 623e 4465 6669 6e69 7469 6f6e 3a3c 2f62 b>Definition: stdsoap2.h:345 │ │ │ │ -00175270: 333c 2f64 6976 3e3c 2f64 6976 3e0a 3c2f 3
    .

    A client │ │ │ │ -001752a0: 2063 616c 6c20 7769 6c6c 2061 7574 6f6d call will autom │ │ │ │ -001752b0: 6174 6963 616c 6c79 2061 7474 656d 7074 atically attempt │ │ │ │ -001752c0: 2074 6f20 7265 2d65 7374 6162 6c69 7368 to re-establish │ │ │ │ -001752d0: 2061 2063 6f6e 6e65 6374 696f 6e20 746f a connection to │ │ │ │ -001752e0: 2061 2073 6572 7665 7220 7768 656e 2074 a server when t │ │ │ │ -001752f0: 6865 2073 6572 7665 7220 6861 7320 7465 he server has te │ │ │ │ -00175300: 726d 696e 6174 6564 2074 6865 2063 6f6e rminated the con │ │ │ │ -00175310: 6e65 6374 696f 6e20 666f 7220 616e 7920 nection for any │ │ │ │ -00175320: 7265 6173 6f6e 2e20 5468 6973 2077 6179 reason. This way │ │ │ │ -00175330: 2c20 6120 7365 7175 656e 6365 206f 6620 , a sequence of │ │ │ │ -00175340: 6361 6c6c 7320 6361 6e20 6265 206d 6164 calls can be mad │ │ │ │ -00175350: 6520 746f 2074 6865 2073 6572 7665 7220 e to the server │ │ │ │ -00175360: 7768 696c 6520 6b65 6570 696e 6720 7468 while keeping th │ │ │ │ -00175370: 6520 636f 6e6e 6563 7469 6f6e 206f 7065 e connection ope │ │ │ │ -00175380: 6e2e 2043 6c69 656e 7420 7374 7562 2066 n. Client stub f │ │ │ │ -00175390: 756e 6374 696f 6e73 2070 6f6c 6c20 7468 unctions poll th │ │ │ │ -001753a0: 6520 7365 7276 6572 2074 6f20 6368 6563 e server to chec │ │ │ │ -001753b0: 6b20 6966 2074 6865 2063 6f6e 6e65 6374 k if the connect │ │ │ │ -001753c0: 696f 6e20 6973 2073 7469 6c6c 206f 7065 ion is still ope │ │ │ │ -001753d0: 6e2e 2057 6865 6e20 7468 6520 636f 6e6e n. When the conn │ │ │ │ -001753e0: 6563 7469 6f6e 2077 6173 2074 6572 6d69 ection was termi │ │ │ │ -001753f0: 6e61 7465 6420 6279 2074 6865 2073 6572 nated by the ser │ │ │ │ -00175400: 7665 722c 2074 6865 2063 6c69 656e 7420 ver, the client │ │ │ │ -00175410: 7769 6c6c 2061 7574 6f6d 6174 6963 616c will automatical │ │ │ │ -00175420: 6c79 2072 6563 6f6e 6e65 6374 2e20 3c62 ly reconnect. .

    .

    A │ │ │ │ -00175440: 636c 6965 6e74 206d 6179 2063 6c65 6172 client may clear │ │ │ │ -00175450: 2074 6865 203c 636f 6465 3e23 534f 4150 the #SOAP │ │ │ │ -00175460: 5f49 4f5f 4b45 4550 414c 4956 453c 2f63 _IO_KEEPALIVE flag just b │ │ │ │ -00175480: 6566 6f72 6520 7468 6520 6c61 7374 2063 efore the last c │ │ │ │ -00175490: 616c 6c20 746f 2061 2073 6572 7665 7220 all to a server │ │ │ │ -001754a0: 746f 206c 6574 2074 6865 2073 6572 7665 to let the serve │ │ │ │ -001754b0: 7220 6b6e 6f77 2069 7420 7761 6e74 7320 r know it wants │ │ │ │ -001754c0: 746f 2063 6c6f 7365 2074 6865 2063 6f6e to close the con │ │ │ │ -001754d0: 6e65 6374 696f 6e20 6166 7465 7220 7468 nection after th │ │ │ │ -001754e0: 6973 206c 6173 7420 6361 6c6c 2e20 5468 is last call. Th │ │ │ │ -001754f0: 6973 2077 696c 6c20 636c 6f73 6520 7468 is will close th │ │ │ │ -00175500: 6520 736f 636b 6574 2061 6674 6572 2074 e socket after t │ │ │ │ -00175510: 6865 2063 616c 6c20 616e 6420 616c 736f he call and also │ │ │ │ -00175520: 2069 6e66 6f72 6d73 2074 6865 2073 6572 informs the ser │ │ │ │ -00175530: 7665 7220 746f 2067 7261 6365 6675 6c6c ver to gracefull │ │ │ │ -00175540: 7920 636c 6f73 6520 7468 6520 636f 6e6e y close the conn │ │ │ │ -00175550: 6563 7469 6f6e 2e3c 2f70 3e0a 3c70 3e54 ection.

    .

    T │ │ │ │ -00175560: 6865 2063 6c69 656e 742d 7369 6465 2063 he client-side c │ │ │ │ -00175570: 616e 2061 6c73 6f20 7365 7420 7468 6520 an also set the │ │ │ │ -00175580: 5443 5020 6b65 6570 2d61 6c69 7665 2073 TCP keep-alive s │ │ │ │ -00175590: 6f63 6b65 7420 7072 6f70 6572 7469 6573 ocket properties │ │ │ │ -001755a0: 2c20 7573 696e 6720 7468 6520 3c63 6f64 , using the soap:: │ │ │ │ -00175670: 7463 705f 6b65 6570 5f61 6c69 7665 3c2f tcp_keep_alive flag ( │ │ │ │ -00175690: 7365 7420 746f 2031 2074 6f20 656e 6162 set to 1 to enab │ │ │ │ -001756a0: 6c65 292c 203c 636f 6465 3e3c 6120 636c le), soap:: │ │ │ │ -00175750: 7463 705f 6b65 6570 5f69 646c 653c 2f61 tcp_keep_idle to set │ │ │ │ -00175770: 7468 6520 3c63 6f64 653e 5443 505f 4b45 the TCP_KE │ │ │ │ -00175780: 4550 4944 4c45 3c2f 636f 6465 3e20 7661 EPIDLE va │ │ │ │ -00175790: 6c75 652c 203c 636f 6465 3e3c 6120 636c lue, soap: │ │ │ │ -00175840: 3a74 6370 5f6b 6565 705f 696e 7476 6c3c :tcp_keep_intvl< │ │ │ │ -00175850: 2f61 3e3c 2f63 6f64 653e 2074 6f20 7365 /a> to se │ │ │ │ -00175860: 7420 7468 6520 3c63 6f64 653e 5443 505f t the TCP_ │ │ │ │ -00175870: 4b45 4550 494e 5456 4c3c 2f63 6f64 653e KEEPINTVL │ │ │ │ -00175880: 2076 616c 7565 2c20 616e 6420 3c63 6f64 value, and │ │ │ │ -00175930: 736f 6170 3a3a 7463 705f 6b65 6570 5f63 soap::tcp_keep_c │ │ │ │ -00175940: 6e74 3c2f 613e 3c2f 636f 6465 3e20 746f nt to │ │ │ │ -00175950: 2073 6574 2074 6865 203c 636f 6465 3e54 set the T │ │ │ │ -00175960: 4350 5f4b 4545 5043 4e54 3c2f 636f 6465 CP_KEEPCNT value.

    .

    │ │ │ │ -00175980: 4966 2061 2063 6c69 656e 7420 6973 2069 If a client is i │ │ │ │ -00175990: 6e20 7468 6520 6d69 6464 6c65 206f 6620 n the middle of │ │ │ │ -001759a0: 736f 6170 2063 616c 6c20 7468 6174 206d soap call that m │ │ │ │ -001759b0: 6967 6874 2074 616b 6520 6120 6c6f 6e67 ight take a long │ │ │ │ -001759c0: 2074 696d 6520 616e 6420 7468 6520 7365 time and the se │ │ │ │ -001759d0: 7276 6572 2067 6f65 7320 6177 6179 2f64 rver goes away/d │ │ │ │ -001759e0: 6f77 6e20 7468 6520 6361 6c6c 6572 2064 own the caller d │ │ │ │ -001759f0: 6f65 7320 6e6f 7420 6765 7420 616e 7920 oes not get any │ │ │ │ -00175a00: 6665 6564 6261 636b 2075 6e74 696c 2074 feedback until t │ │ │ │ -00175a10: 6865 203c 636f 6465 3e3c 6120 636c 6173 he soap::recv_t │ │ │ │ -00175ad0: 696d 656f 7574 3c2f 613e 3c2f 636f 6465 imeout is reached. En │ │ │ │ -00175af0: 6162 6c69 6e67 2054 4350 206b 6565 7020 abling TCP keep │ │ │ │ -00175b00: 616c 6976 6520 6f6e 2073 7973 7465 6d73 alive on systems │ │ │ │ -00175b10: 2074 6861 7420 7375 7070 6f72 7420 6974 that support it │ │ │ │ -00175b20: 2061 6c6c 6f77 7320 666f 7220 6120 6661 allows for a fa │ │ │ │ -00175b30: 7374 6572 2063 6f6e 6e65 6374 696f 6e20 ster connection │ │ │ │ -00175b40: 7465 6172 646f 776e 2064 6574 6563 7469 teardown detecti │ │ │ │ -00175b50: 6f6e 2066 6f72 2061 7070 6c69 6361 7469 on for applicati │ │ │ │ -00175b60: 6f6e 7320 7468 6174 206e 6565 6420 6974 ons that need it │ │ │ │ -00175b70: 2e3c 2f70 3e0a 3c70 3ef0 9f94 9d20 3c61 .

    .

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

    .

    │ │ │ │ -00175bb0: 3c61 2063 6c61 7373 3d22 616e 6368 6f72 < │ │ │ │ -00175bd0: 2f61 3e0a 4854 5450 2063 6875 6e6b 6564 /a>.HTTP chunked │ │ │ │ -00175be0: 2074 7261 6e73 6665 7220 656e 636f 6469 transfer encodi │ │ │ │ -00175bf0: 6e67 3c2f 6832 3e0a 3c70 3e4f 7574 626f ng

    .

    Outbo │ │ │ │ -00175c00: 756e 6420 4854 5450 206d 6573 7361 6765 und HTTP message │ │ │ │ -00175c10: 7320 6172 6520 6e6f 7420 6368 756e 6b65 s are not chunke │ │ │ │ -00175c20: 6420 756e 6c65 7373 2074 6865 203c 636f d unless the #SOAP_IO_CHUN │ │ │ │ -00175c40: 4b3c 2f63 6f64 653e 2066 6c61 6720 6973 K flag is │ │ │ │ -00175c50: 2065 6e61 626c 6564 2e20 4368 756e 6b69 enabled. Chunki │ │ │ │ -00175c60: 6e67 206d 6179 2069 6d70 726f 7665 2074 ng may improve t │ │ │ │ -00175c70: 6865 2073 7065 6564 206f 6620 6d65 7373 he speed of mess │ │ │ │ -00175c80: 6167 6520 7365 6e64 696e 6720 7769 7468 age sending with │ │ │ │ -00175c90: 2048 5454 502c 2062 6563 6175 7365 2074 HTTP, because t │ │ │ │ -00175ca0: 6865 206d 6573 7361 6765 206c 656e 6774 he message lengt │ │ │ │ -00175cb0: 6820 646f 6573 206e 6f74 206e 6565 6420 h does not need │ │ │ │ -00175cc0: 746f 2062 6520 6465 7465 726d 696e 6564 to be determined │ │ │ │ -00175cd0: 2069 6e20 6164 7661 6e63 6520 666f 7220 in advance for │ │ │ │ -00175ce0: 7468 6520 4854 5450 2063 6f6e 7465 6e74 the HTTP content │ │ │ │ -00175cf0: 206c 656e 6774 6820 6865 6164 6572 2e3c length header.< │ │ │ │ -00175d00: 2f70 3e0a 3c70 3ef0 9f94 9d20 3c61 2068 /p>.

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

    .

    .HTTP buffered │ │ │ │ -00175d70: 2073 656e 6473 3c2f 6832 3e0a 3c70 3e54 sends

    .

    T │ │ │ │ -00175d80: 6865 2065 6e74 6972 6520 6f75 7462 6f75 he entire outbou │ │ │ │ -00175d90: 6e64 206d 6573 7361 6765 2063 616e 2062 nd message can b │ │ │ │ -00175da0: 6520 7374 6f72 6564 2069 6e20 6120 6275 e stored in a bu │ │ │ │ -00175db0: 6666 6572 2074 6f20 6465 7465 726d 696e ffer to determin │ │ │ │ -00175dc0: 6520 7468 6520 4854 5450 2063 6f6e 7465 e the HTTP conte │ │ │ │ -00175dd0: 6e74 206c 656e 6774 6820 7261 7468 6572 nt length rather │ │ │ │ -00175de0: 2074 6861 6e20 7468 6520 7477 6f2d 7068 than the two-ph │ │ │ │ -00175df0: 6173 6520 656e 636f 6469 6e67 2075 7365 ase encoding use │ │ │ │ -00175e00: 6420 6279 2067 534f 4150 2063 6c69 656e d by gSOAP clien │ │ │ │ -00175e10: 742d 7369 6465 2073 7475 6220 6675 6e63 t-side stub func │ │ │ │ -00175e20: 7469 6f6e 7320 616e 6420 7365 7276 6572 tions and server │ │ │ │ -00175e30: 2d73 6964 6520 736b 656c 6574 6f6e 2066 -side skeleton f │ │ │ │ -00175e40: 756e 6374 696f 6e73 2067 656e 6572 6174 unctions generat │ │ │ │ -00175e50: 6564 2062 7920 736f 6170 6370 7032 2c20 ed by soapcpp2, │ │ │ │ -00175e60: 7768 6963 6820 7065 7266 6f72 6d20 6120 which perform a │ │ │ │ -00175e70: 7365 7061 7261 7465 2070 6173 7320 6f76 separate pass ov │ │ │ │ -00175e80: 6572 2074 6865 2064 6174 6120 746f 2064 er the data to d │ │ │ │ -00175e90: 6574 6572 6d69 6e65 2074 6865 206c 656e etermine the len │ │ │ │ -00175ea0: 6774 6820 6f66 2074 6865 206f 7574 626f gth of the outbo │ │ │ │ -00175eb0: 756e 6420 6d65 7373 6167 652e 2053 6574 und message. Set │ │ │ │ -00175ec0: 7469 6e67 2074 6865 2066 6c61 6720 3c63 ting the flag #SOAP_IO_STO │ │ │ │ -00175ee0: 5245 3c2f 636f 6465 3e20 666f 7220 7468 RE for th │ │ │ │ -00175ef0: 6520 6f75 7470 7574 206d 6f64 6520 7769 e output mode wi │ │ │ │ -00175f00: 6c6c 2062 7566 6665 7220 7468 6520 656e ll buffer the en │ │ │ │ -00175f10: 7469 7265 206d 6573 7361 6765 2e20 5468 tire message. Th │ │ │ │ -00175f20: 6973 206d 6179 206f 7220 6d61 7920 6e6f is may or may no │ │ │ │ -00175f30: 7420 7370 6565 6420 7570 2074 6865 2074 t speed up the t │ │ │ │ -00175f40: 7261 6e73 6d69 7373 696f 6e20 6f66 206d ransmission of m │ │ │ │ -00175f50: 6573 7361 6765 732c 2064 6570 656e 6469 essages, dependi │ │ │ │ -00175f60: 6e67 206f 6e20 7468 6520 636f 6e74 656e ng on the conten │ │ │ │ -00175f70: 742c 2062 7574 206d 6179 2072 6571 7569 t, but may requi │ │ │ │ -00175f80: 7265 2073 6967 6e69 6669 6361 6e74 2073 re significant s │ │ │ │ -00175f90: 746f 7261 6765 2073 7061 6365 2074 6f20 torage space to │ │ │ │ -00175fa0: 686f 6c64 206c 6172 6765 206d 6573 7361 hold large messa │ │ │ │ -00175fb0: 6765 7320 7465 6d70 6f72 6172 696c 792e ges temporarily. │ │ │ │ -00175fc0: 3c2f 703e 0a3c 703e f09f 949d 203c 6120

    .

    .... Back to │ │ │ │ -00175fe0: 2074 6162 6c65 206f 6620 636f 6e74 656e table of conten │ │ │ │ -00175ff0: 7473 3c2f 613e 3c2f 703e 0a3c 6832 3e3c ts

    .

    < │ │ │ │ -00176000: 6120 636c 6173 733d 2261 6e63 686f 7222 a class="anchor" │ │ │ │ -00176010: 2069 643d 2261 7574 6865 6e74 6963 6174 id="authenticat │ │ │ │ -00176020: 696f 6e22 3e3c 2f61 3e0a 4854 5450 2061 ion">.HTTP a │ │ │ │ -00176030: 7574 6865 6e74 6963 6174 696f 6e3c 2f68 uthentication.

    The follow │ │ │ │ -00176050: 696e 6720 7365 6374 696f 6e73 2065 7870 ing sections exp │ │ │ │ -00176060: 6c61 696e 2068 6f77 2074 6f20 6175 7468 lain how to auth │ │ │ │ -00176070: 656e 7469 6361 7465 2077 6974 6820 4854 enticate with HT │ │ │ │ -00176080: 5450 2062 6561 7265 722c 2062 6173 6963 TP bearer, basic │ │ │ │ -00176090: 2c20 6469 6765 7374 2c20 616e 6420 4e54 , digest, and NT │ │ │ │ -001760a0: 4c4d 2e20 5072 6f78 7920 6175 7468 656e LM. Proxy authen │ │ │ │ -001760b0: 7469 6361 7469 6f6e 2069 7320 616c 736f tication is also │ │ │ │ -001760c0: 2063 6f76 6572 6564 2e3c 2f70 3e0a 3c70 covered.

    .

    You could also │ │ │ │ -001760e0: 7573 6520 7468 6520 5769 6e49 6e65 7420 use the WinInet │ │ │ │ -001760f0: 706c 7567 696e 2061 7661 696c 6162 6c65 plugin available │ │ │ │ -00176100: 2069 6e20 7468 6520 3c65 6d3e 3c63 6f64 in the gsoap/mod_gsoa │ │ │ │ -00176120: 703c 2f63 6f64 653e 3c2f 656d 3e20 6469 p di │ │ │ │ -00176130: 7265 6374 6f72 7920 6f66 2074 6865 2067 rectory of the g │ │ │ │ -00176140: 534f 4150 2073 6f75 7263 6520 636f 6465 SOAP source code │ │ │ │ -00176150: 2070 6163 6b61 6765 2074 6f20 7369 6d70 package to simp │ │ │ │ -00176160: 6c69 6679 2049 6e74 6572 6e65 7420 6163 lify Internet ac │ │ │ │ -00176170: 6365 7373 2066 6f72 2067 534f 4150 2063 cess for gSOAP c │ │ │ │ -00176180: 6c69 656e 7420 6170 706c 6963 6174 696f lient applicatio │ │ │ │ -00176190: 6e73 2061 6e64 2064 6561 6c20 7769 7468 ns and deal with │ │ │ │ -001761a0: 2065 6e63 7279 7074 696f 6e2c 2070 726f encryption, pro │ │ │ │ -001761b0: 7869 6573 2c20 616e 6420 6175 7468 656e xies, and authen │ │ │ │ -001761c0: 7469 6361 7469 6f6e 2c20 7365 6520 7468 tication, see th │ │ │ │ -001761d0: 6520 6753 4f41 5020 3c61 2068 7265 663d e gSOAP │ │ │ │ -00176200: 5769 6e49 6e65 7420 706c 7567 696e 3c2f WinInet plugin documentation │ │ │ │ -00176220: 2e3c 2f70 3e0a 3c70 3e54 6865 2067 534f .

    .

    The gSO │ │ │ │ -00176230: 4150 2043 5552 4c20 706c 7567 696e 2063 AP CURL plugin c │ │ │ │ -00176240: 616e 2061 6c73 6f20 6265 2075 7365 6420 an also be used │ │ │ │ -00176250: 746f 2064 6576 656c 6f70 2067 534f 4150 to develop gSOAP │ │ │ │ -00176260: 2063 6c69 656e 7420 6170 706c 6963 6174 client applicat │ │ │ │ -00176270: 696f 6e73 2061 6e64 2043 5552 4c20 696d ions and CURL im │ │ │ │ -00176280: 706c 656d 656e 7473 2076 6172 696f 7573 plements various │ │ │ │ -00176290: 2048 5454 5020 6175 7468 656e 7469 6361 HTTP authentica │ │ │ │ -001762a0: 7469 6f6e 206d 6574 686f 6473 2c20 7365 tion methods, se │ │ │ │ -001762b0: 6520 7468 6520 6753 4f41 5020 3c61 2068 e the gSOAP CURL plugin │ │ │ │ -001762f0: 2064 6f63 756d 656e 7461 7469 6f6e 2e3c documentation.< │ │ │ │ -00176300: 2f70 3e0a 3c70 3ef0 9f94 9d20 3c61 2068 /p>.

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

    .

    .H │ │ │ │ -00176370: 5454 5020 6265 6172 6572 2061 7574 6865 TTP bearer authe │ │ │ │ -00176380: 6e74 6963 6174 696f 6e3c 2f68 333e 0a3c ntication

    .< │ │ │ │ -00176390: 703e 4854 5450 2062 6561 7265 7220 6175 p>HTTP bearer au │ │ │ │ -001763a0: 7468 656e 7469 6361 7469 6f6e 2069 7320 thentication is │ │ │ │ -001763b0: 656e 6162 6c65 6420 6174 2074 6865 2063 enabled at the c │ │ │ │ -001763c0: 6c69 656e 742d 7369 6465 2062 7920 7365 lient-side by se │ │ │ │ -001763d0: 7474 696e 6720 7468 6520 3c63 6f64 653e tting the │ │ │ │ -001763e0: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap::be │ │ │ │ -001764a0: 6172 6572 3c2f 613e 3c2f 636f 6465 3e20 arer │ │ │ │ -001764b0: 7374 7269 6e67 2074 6f20 7468 6520 6265 string to the be │ │ │ │ -001764c0: 6172 6572 2074 6f6b 656e 3a3c 2f70 3e0a arer token:

    . │ │ │ │ -001764d0: 3c64 6976 2063 6c61 7373 3d22 6672 6167
    st │ │ │ │ -00176510: 7275 6374 203c 2f73 7061 6e3e 3c61 2063 ruct soap *soap = < │ │ │ │ -00176580: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -00176590: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ │ -001765a0: 705f 5f63 6f6e 7465 7874 2e68 746d 6c23 p__context.html# │ │ │ │ -001765b0: 6761 3837 6332 3034 3838 6232 6463 3638 ga87c20488b2dc68 │ │ │ │ -001765c0: 3061 6161 3736 3839 6231 6430 3234 3938 0aaa7689b1d02498 │ │ │ │ -001765d0: 3963 223e 736f 6170 5f6e 6577 3c2f 613e 9c">soap_new │ │ │ │ -001765e0: 2829 3b20 3c2f 6469 763e 0a3c 6469 7620 ();
    .
    soap-> │ │ │ │ -00176630: 3b3c 6120 636c 6173 733d 2263 6f64 6522 ;bearer │ │ │ │ -00176680: 3c2f 613e 203d 203c 7370 616e 2063 6c61 = "...&quo │ │ │ │ -001766b0: 743b 3c2f 7370 616e 3e3b 203c 2f64 6976 t;;
    .
    if │ │ │ │ -001766f0: 3c2f 7370 616e 3e20 2873 6f61 705f 6361 (soap_ca │ │ │ │ -00176700: 6c6c 5f6e 735f 5f77 6562 6d65 7468 6f64 ll_ns__webmethod │ │ │ │ -00176710: 283c 6120 636c 6173 733d 2263 6f64 6522 (soap │ │ │ │ -00176740: 2c20 2e2e 2e29 293c 2f64 6976 3e0a 3c64 , ...))
    . │ │ │ │ -00176760: 2020 2e2e 2e20 3c73 7061 6e20 636c 6173 ... // e │ │ │ │ -00176780: 7272 6f72 3c2f 7370 616e 3e3c 2f64 6976 rror
    .
    el │ │ │ │ -001767c0: 7365 3c2f 7370 616e 3e3c 2f64 6976 3e0a se
    . │ │ │ │ -001767d0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    ... // │ │ │ │ -00176800: 204f 4b3c 2f73 7061 6e3e 3c2f 6469 763e OK
    │ │ │ │ -00176810: 0a3c 6469 7620 636c 6173 733d 2274 7463 .
    │ │ │ │ -001768c0: 3c64 6976 2063 6c61 7373 3d22 7474 6465
    const char * │ │ │ │ -001768e0: 2062 6561 7265 723c 2f64 6976 3e3c 6469 bearer
    │ │ │ │ -00176900: 5573 6572 2d64 6566 696e 6162 6c65 2048 User-definable H │ │ │ │ -00176910: 5454 5020 6175 7468 6f72 697a 6174 696f TTP authorizatio │ │ │ │ -00176920: 6e20 6265 6172 6572 2074 6f6b 656e 2076 n bearer token v │ │ │ │ -00176930: 616c 7565 2074 6f20 6265 2073 656e 7420 alue to be sent │ │ │ │ -00176940: 6279 2074 6865 2063 6c69 656e 742c 2073 by the client, s │ │ │ │ -00176950: 6572 7665 7220 7369 6465 2072 6563 6569 erver side recei │ │ │ │ -00176960: 7665 7320 742e 2e2e 3c2f 6469 763e 3c64 ves t...
    Definition:< │ │ │ │ -00176990: 2f62 3e20 7374 6473 6f61 7032 2e68 3a33 /b> stdsoap2.h:3 │ │ │ │ -001769a0: 3735 323c 2f64 6976 3e3c 2f64 6976 3e0a 752
    . │ │ │ │ -001769b0: 3c2f 6469 763e 3c21 2d2d 2066 7261 676d

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

    .

    │ │ │ │ -00176a30: 0a48 5454 5020 6261 7369 6320 6175 7468 .HTTP basic auth │ │ │ │ -00176a40: 656e 7469 6361 7469 6f6e 3c2f 6833 3e0a entication

    . │ │ │ │ -00176a50: 3c70 3e48 5454 5020 6261 7369 6320 6175

    HTTP basic au │ │ │ │ -00176a60: 7468 656e 7469 6361 7469 6f6e 2069 7320 thentication is │ │ │ │ -00176a70: 656e 6162 6c65 6420 6174 2074 6865 2063 enabled at the c │ │ │ │ -00176a80: 6c69 656e 742d 7369 6465 2062 7920 7365 lient-side by se │ │ │ │ -00176a90: 7474 696e 6720 7468 6520 3c63 6f64 653e tting the │ │ │ │ -00176aa0: 636f 6e73 7420 6368 6172 2a20 3c61 2063 const char* soap::userid │ │ │ │ -00176b70: 3c2f 613e 3c2f 636f 6465 3e20 616e 6420 and │ │ │ │ -00176b80: 3c63 6f64 653e 636f 6e73 7420 6368 6172 const char │ │ │ │ -00176b90: 2a20 3c61 2063 6c61 7373 3d22 656c 2220 * soap:: │ │ │ │ -00176c50: 7061 7373 7764 3c2f 613e 3c2f 636f 6465 passwd strings to a u │ │ │ │ -00176c70: 7365 726e 616d 6520 616e 6420 7061 7373 sername and pass │ │ │ │ -00176c80: 776f 7264 2c20 7265 7370 6563 7469 7665 word, respective │ │ │ │ -00176c90: 6c79 2e20 4120 7365 7276 6572 206d 6179 ly. A server may │ │ │ │ -00176ca0: 2072 6571 7565 7374 2075 7365 7220 6175 request user au │ │ │ │ -00176cb0: 7468 656e 7469 6361 7469 6f6e 2061 6e64 thentication and │ │ │ │ -00176cc0: 2064 656e 6965 7320 6163 6365 7373 2028 denies access ( │ │ │ │ -00176cd0: 4854 5450 2034 3031 2065 7272 6f72 2920 HTTP 401 error) │ │ │ │ -00176ce0: 7768 656e 2074 6865 2063 6c69 656e 7420 when the client │ │ │ │ -00176cf0: 7472 6965 7320 746f 2063 6f6e 6e65 6374 tries to connect │ │ │ │ -00176d00: 2077 6974 686f 7574 2048 5454 5020 6175 without HTTP au │ │ │ │ -00176d10: 7468 656e 7469 6361 7469 6f6e 2028 6f72 thentication (or │ │ │ │ -00176d20: 2077 6974 6820 7468 6520 7772 6f6e 6720 with the wrong │ │ │ │ -00176d30: 6175 7468 656e 7469 6361 7469 6f6e 2069 authentication i │ │ │ │ -00176d40: 6e66 6f72 6d61 7469 6f6e 292e 3c2f 703e nformation).

    │ │ │ │ -00176d50: 0a3c 703e 4261 7369 6320 6175 7468 656e .

    Basic authen │ │ │ │ -00176d60: 7469 6361 7469 6f6e 2073 686f 756c 6420 tication should │ │ │ │ -00176d70: 6f6e 6c79 2062 6520 7573 6564 206f 7665 only be used ove │ │ │ │ -00176d80: 7220 4854 5450 532c 2062 6563 6175 7365 r HTTPS, because │ │ │ │ -00176d90: 2074 6865 2063 7265 6465 6e74 6961 6c73 the credentials │ │ │ │ -00176da0: 2061 7265 2073 656e 7420 696e 2074 6865 are sent in the │ │ │ │ -00176db0: 2063 6c65 6172 2077 6974 6820 4854 5450 clear with HTTP │ │ │ │ -00176dc0: 2e20 5365 6520 5365 6374 696f 6e20 3c61 . See Section The H │ │ │ │ -00176e00: 5454 5020 6469 6765 7374 2061 7574 6865 TTP digest authe │ │ │ │ -00176e10: 6e74 6963 6174 696f 6e20 706c 7567 696e ntication plugin │ │ │ │ -00176e20: 3c2f 613e 2074 6f20 7573 6520 7468 6520 to use the │ │ │ │ -00176e30: 4854 5450 2064 6967 6573 7420 706c 7567 HTTP digest plug │ │ │ │ -00176e40: 696e 2074 6861 7420 6973 2073 6166 6520 in that is safe │ │ │ │ -00176e50: 666f 7220 6175 7468 656e 7469 6361 7469 for authenticati │ │ │ │ -00176e60: 6f6e 206f 7665 7220 4854 5450 2e3c 2f70 on over HTTP.

    .

    Here is an │ │ │ │ -00176e80: 6578 616d 706c 6520 636c 6965 6e74 2063 example client c │ │ │ │ -00176e90: 6f64 6520 6672 6167 6d65 6e74 2074 6f20 ode fragment to │ │ │ │ -00176ea0: 7365 7420 7468 6520 4854 5450 2061 7574 set the HTTP aut │ │ │ │ -00176eb0: 6865 6e74 6963 6174 696f 6e20 7573 6572 hentication user │ │ │ │ -00176ec0: 6e61 6d65 2061 6e64 2070 6173 7377 6f72 name and passwor │ │ │ │ -00176ed0: 643a 3c2f 703e 0a3c 6469 7620 636c 6173 d:

    .
    < │ │ │ │ -00176f00: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -00176f10: 6f72 6422 3e73 7472 7563 7420 3c2f 7370 ord">struct soap *soap< │ │ │ │ -00176f80: 2f61 3e20 3d20 3c61 2063 6c61 7373 3d22 /a> = soap_ │ │ │ │ -00176fe0: 6e65 773c 2f61 3e28 293b 203c 2f64 6976 new();
    .
    soap< │ │ │ │ -00177030: 2f61 3e2d 2667 743b 3c61 2063 6c61 7373 /a>->userid = " │ │ │ │ -001770b0: 6775 6573 7426 7175 6f74 3b3c 2f73 7061 guest";
    .
    soap-> │ │ │ │ -00177110: 3b3c 6120 636c 6173 733d 2263 6f64 6522 ;passwd │ │ │ │ -00177160: 3c2f 613e 203d 203c 7370 616e 2063 6c61 = "visit&q │ │ │ │ -00177190: 756f 743b 3c2f 7370 616e 3e3b 203c 2f64 uot;; .
    │ │ │ │ -001771d0: 6966 3c2f 7370 616e 3e20 2873 6f61 705f if (soap_ │ │ │ │ -001771e0: 6361 6c6c 5f6e 735f 5f77 6562 6d65 7468 call_ns__webmeth │ │ │ │ -001771f0: 6f64 283c 6120 636c 6173 733d 2263 6f64 od(soap, ...))
    . │ │ │ │ -00177230: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    ... // │ │ │ │ -00177260: 2065 7272 6f72 3c2f 7370 616e 3e3c 2f64 error.
    │ │ │ │ -001772a0: 656c 7365 3c2f 7370 616e 3e3c 2f64 6976 else
    .
    ... │ │ │ │ -001772e0: 2f2f 2073 7563 6365 7373 3c2f 7370 616e // success
    .
    const │ │ │ │ -001773c0: 2063 6861 7220 2a20 7061 7373 7764 3c2f char * passwd
    User-defi │ │ │ │ -001773f0: 6e61 626c 6520 4854 5450 2061 6e64 204e nable HTTP and N │ │ │ │ -00177400: 544c 4d20 6175 7468 6f72 697a 6174 696f TLM authorizatio │ │ │ │ -00177410: 6e20 7061 7373 776f 7264 2073 7472 696e n password strin │ │ │ │ -00177420: 6720 7265 7175 6972 6564 2066 6f72 2048 g required for H │ │ │ │ -00177430: 5454 5020 6261 7369 6320 616e 6420 4e54 TTP basic and NT │ │ │ │ -00177440: 4c4d 2061 7574 6865 6e74 6963 2e2e 2e3c LM authentic...< │ │ │ │ -00177450: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
    Defin │ │ │ │ -00177470: 6974 696f 6e3a 3c2f 623e 2073 7464 736f ition: stdso │ │ │ │ -00177480: 6170 322e 683a 3338 3237 3c2f 6469 763e ap2.h:3827
    │ │ │ │ -00177490: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    │ │ │ │ -001774e0: 3c64 6976 2063 6c61 7373 3d22 7474 6e61
    │ │ │ │ -00177530: 736f 6170 3a3a 7573 6572 6964 3c2f 613e soap::userid │ │ │ │ -00177540: 3c2f 6469 763e 3c64 6976 2063 6c61 7373
    const │ │ │ │ -00177560: 6368 6172 202a 2075 7365 7269 643c 2f64 char * userid
    User-defin │ │ │ │ -00177590: 6162 6c65 2048 5454 5020 616e 6420 4e54 able HTTP and NT │ │ │ │ -001775a0: 4c4d 2061 7574 686f 7269 7a61 7469 6f6e LM authorization │ │ │ │ -001775b0: 2075 7365 7220 6964 2073 7472 696e 6720 user id string │ │ │ │ -001775c0: 666f 7220 4854 5450 2062 6173 6963 2061 for HTTP basic a │ │ │ │ -001775d0: 6e64 204e 544c 4d20 6175 7468 656e 7469 nd NTLM authenti │ │ │ │ -001775e0: 6361 7469 6f6e 2062 7920 742e 2e2e 3c2f cation by t...
    Defini │ │ │ │ -00177610: 7469 6f6e 3a3c 2f62 3e20 7374 6473 6f61 tion: stdsoa │ │ │ │ -00177620: 7032 2e68 3a33 3832 323c 2f64 6976 3e3c p2.h:3822
    < │ │ │ │ -00177630: 2f64 6976 3e0a 3c2f 6469 763e 3c21 2d2d /div>.

    │ │ │ │ -00177650: 4120 636c 6965 6e74 2053 4f41 5020 7265 A client SOAP re │ │ │ │ -00177660: 7175 6573 7420 7769 6c6c 2068 6176 6520 quest will have │ │ │ │ -00177670: 7468 6520 666f 6c6c 6f77 696e 6720 4854 the following HT │ │ │ │ -00177680: 5450 2068 6561 6465 723a 203c 2f70 3e3c TP header:

    < │ │ │ │ -00177690: 7072 6520 636c 6173 733d 2266 7261 676d pre class="fragm │ │ │ │ -001776a0: 656e 7422 3e50 4f53 5420 2f58 5858 2048 ent">POST /XXX H │ │ │ │ -001776b0: 5454 502f 312e 3120 0a48 6f73 743a 2059 TTP/1.1 .Host: Y │ │ │ │ -001776c0: 5959 200a 5573 6572 2d41 6765 6e74 3a20 YY .User-Agent: │ │ │ │ -001776d0: 6753 4f41 502f 322e 3820 0a43 6f6e 7465 gSOAP/2.8 .Conte │ │ │ │ -001776e0: 6e74 2d54 7970 653a 2074 6578 742f 786d nt-Type: text/xm │ │ │ │ -001776f0: 6c3b 2063 6861 7273 6574 3d75 7466 2d38 l; charset=utf-8 │ │ │ │ -00177700: 200a 436f 6e74 656e 742d 4c65 6e67 7468 .Content-Length │ │ │ │ -00177710: 3a20 5a5a 5a20 0a41 7574 686f 7269 7a61 : ZZZ .Authoriza │ │ │ │ -00177720: 7469 6f6e 3a20 4261 7369 6320 5a33 566c tion: Basic Z3Vl │ │ │ │ -00177730: 6333 5136 5a33 566c 6333 513d 200a 3c2f c3Q6Z3Vlc3Q= .

    A client │ │ │ │ -00177750: 206d 7573 7420 7365 7420 7468 6520 3c63 must set the const char* │ │ │ │ -00177770: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap::us │ │ │ │ -00177830: 6572 6964 3c2f 613e 3c2f 636f 6465 3e20 erid │ │ │ │ -00177840: 616e 6420 3c63 6f64 653e 636f 6e73 7420 and const │ │ │ │ -00177850: 6368 6172 2a20 3c61 2063 6c61 7373 3d22 char* so │ │ │ │ -00177910: 6170 3a3a 7061 7373 7764 3c2f 613e 3c2f ap::passwd strings fo │ │ │ │ -00177930: 7220 6561 6368 2063 616c 6c20 7468 6174 r each call that │ │ │ │ -00177940: 2072 6571 7569 7265 7320 636c 6965 6e74 requires client │ │ │ │ -00177950: 2061 7574 6865 6e74 6963 6174 696f 6e2e authentication. │ │ │ │ -00177960: 2054 6865 2073 7472 696e 6773 2061 7265 The strings are │ │ │ │ -00177970: 2072 6573 6574 2061 6674 6572 2065 6163 reset after eac │ │ │ │ -00177980: 6820 7375 6363 6573 7366 756c 206f 7220 h successful or │ │ │ │ -00177990: 756e 7375 6363 6573 7366 756c 2063 616c unsuccessful cal │ │ │ │ -001779a0: 6c2e 3c2f 703e 0a3c 703e 5768 656e 2070 l.

    .

    When p │ │ │ │ -001779b0: 7265 7365 6e74 2c20 7468 6520 3c63 6f64 resent, the WWW-Authentica │ │ │ │ -001779d0: 7465 3c2f 636f 6465 3e20 4854 5450 2068 te HTTP h │ │ │ │ -001779e0: 6561 6465 7220 7265 7475 726e 6564 2062 eader returned b │ │ │ │ -001779f0: 7920 7468 6520 7365 7276 6572 2077 6974 y the server wit │ │ │ │ -00177a00: 6820 7468 6520 6175 7468 656e 7469 6361 h the authentica │ │ │ │ -00177a10: 7469 6f6e 2072 6561 6c6d 2069 7320 7374 tion realm is st │ │ │ │ -00177a20: 6f72 6564 2069 6e20 7468 6520 7468 6520 ored in the the │ │ │ │ -00177a30: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 so │ │ │ │ -00177af0: 6170 3a3a 6175 7468 7265 616c 6d3c 2f61 ap::authrealm string. │ │ │ │ -00177b10: 2054 6869 7320 6973 2075 7365 6675 6c20 This is useful │ │ │ │ -00177b20: 666f 7220 636c 6965 6e74 7320 746f 2075 for clients to u │ │ │ │ -00177b30: 7365 2074 6869 7320 646f 6d61 696e 2069 se this domain i │ │ │ │ -00177b40: 6e66 6f72 6d61 7469 6f6e 2074 6f20 7265 nformation to re │ │ │ │ -00177b50: 7370 6f6e 6420 746f 2061 7574 6865 6e74 spond to authent │ │ │ │ -00177b60: 6963 6174 696f 6e20 7265 7175 6573 7473 ication requests │ │ │ │ -00177b70: 2e3c 2f70 3e0a 3c70 3e41 2073 7461 6e64 .

    .

    A stand │ │ │ │ -00177b80: 2d61 6c6f 6e65 2067 534f 4150 2057 6562 -alone gSOAP Web │ │ │ │ -00177b90: 2053 6572 7669 6365 2061 7070 6c69 6361 Service applica │ │ │ │ -00177ba0: 7469 6f6e 2063 616e 2065 6e66 6f72 6365 tion can enforce │ │ │ │ -00177bb0: 2048 5454 5020 6175 7468 656e 7469 6361 HTTP authentica │ │ │ │ -00177bc0: 7469 6f6e 206f 6e20 636c 6965 6e74 7320 tion on clients │ │ │ │ -00177bd0: 6279 2063 6865 636b 696e 6720 7468 6520 by checking the │ │ │ │ -00177be0: 3c63 6f64 653e 636f 6e73 7420 6368 6172 const char │ │ │ │ -00177bf0: 2a20 3c61 2063 6c61 7373 3d22 656c 2220 * soap:: │ │ │ │ -00177cb0: 7573 6572 6964 3c2f 613e 3c2f 636f 6465 userid and cons │ │ │ │ -00177cd0: 7420 6368 6172 2a20 3c61 2063 6c61 7373 t char* │ │ │ │ -00177d90: 736f 6170 3a3a 7061 7373 7764 3c2f 613e soap::passwd │ │ │ │ -00177da0: 3c2f 636f 6465 3e20 7374 7269 6e67 732e strings. │ │ │ │ -00177db0: 2054 6865 7365 2073 7472 696e 6773 2061 These strings a │ │ │ │ -00177dc0: 7265 2073 6574 2077 6865 6e20 6120 636c re set when a cl │ │ │ │ -00177dd0: 6965 6e74 2072 6571 7565 7374 2063 6f6e ient request con │ │ │ │ -00177de0: 7461 696e 7320 4854 5450 2061 7574 6865 tains HTTP authe │ │ │ │ -00177df0: 6e74 6963 6174 696f 6e20 6865 6164 6572 ntication header │ │ │ │ -00177e00: 732e 2054 6865 2073 7472 696e 6773 2073 s. The strings s │ │ │ │ -00177e10: 686f 756c 6420 6265 2063 6865 636b 6564 hould be checked │ │ │ │ -00177e20: 2069 6e20 6561 6368 2073 6572 7669 6365 in each service │ │ │ │ -00177e30: 206d 6574 686f 6420 2874 6861 7420 7265 method (that re │ │ │ │ -00177e40: 7175 6972 6573 2061 7574 6865 6e74 6963 quires authentic │ │ │ │ -00177e50: 6174 696f 6e20 746f 2065 7865 6375 7465 ation to execute │ │ │ │ -00177e60: 292e 3c2f 703e 0a3c 703e 4865 7265 2069 ).

    .

    Here i │ │ │ │ -00177e70: 7320 616e 2065 7861 6d70 6c65 2073 6572 s an example ser │ │ │ │ -00177e80: 7669 6365 206d 6574 686f 6420 696d 706c vice method impl │ │ │ │ -00177e90: 656d 656e 7461 7469 6f6e 2074 6861 7420 ementation that │ │ │ │ -00177ea0: 656e 666f 7263 6564 2063 6c69 656e 7420 enforced client │ │ │ │ -00177eb0: 6175 7468 656e 7469 6361 7469 6f6e 3a3c authentication:< │ │ │ │ -00177ec0: 2f70 3e0a 3c64 6976 2063 6c61 7373 3d22 /p>.

    int │ │ │ │ -00177f10: 206e 735f 5f77 6562 6d65 7468 6f64 283c ns__webmethod(< │ │ │ │ -00177f20: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -00177f30: 6f72 6422 3e73 7472 7563 743c 2f73 7061 ord">struct soap *soap< │ │ │ │ -00177fa0: 2f61 3e2c 202e 2e2e 2920 3c2f 6469 763e /a>, ...)
    │ │ │ │ -00177fb0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    {
    .
    < │ │ │ │ -00177fe0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -00177ff0: 6f72 6466 6c6f 7722 3e69 663c 2f73 7061 ordflow">if (!soap │ │ │ │ -00178030: 3c2f 613e 2d26 6774 3b3c 6120 636c 6173 ->userid.
    || !soap-> │ │ │ │ -001780e0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 passwd< │ │ │ │ -00178130: 2f61 3e3c 2f64 6976 3e0a 3c64 6976 2063 /a>
    .
    | │ │ │ │ -00178150: 7c20 7374 7263 6d70 283c 6120 636c 6173 | strcmp( │ │ │ │ -00178180: 736f 6170 3c2f 613e 2d26 6774 3b3c 6120 soap->userid │ │ │ │ -001781e0: 2c20 3c73 7061 6e20 636c 6173 733d 2273 , &q │ │ │ │ -00178200: 756f 743b 6775 6573 7426 7175 6f74 3b3c uot;guest"< │ │ │ │ -00178210: 2f73 7061 6e3e 293c 2f64 6976 3e0a 3c64 /span>)
    . │ │ │ │ -00178230: 2020 207c 7c20 7374 7263 6d70 283c 6120 || strcmp(soap-> │ │ │ │ -00178270: 3b3c 6120 636c 6173 733d 2263 6f64 6522 ;passwd │ │ │ │ -001782c0: 3c2f 613e 2c20 3c73 7061 6e20 636c 6173 , "visit&qu │ │ │ │ -001782f0: 6f74 3b3c 2f73 7061 6e3e 2929 203c 2f64 ot;)) .
    {
    . │ │ │ │ -00178320: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    soa │ │ │ │ -00178360: 703c 2f61 3e2d 2667 743b 3c61 2063 6c61 p->authrealm │ │ │ │ -001783c0: 203d 203c 7370 616e 2063 6c61 7373 3d22 = & │ │ │ │ -001783e0: 7175 6f74 3b2e 2e2e 2671 756f 743b 3c2f quot;..."; // │ │ │ │ -00178410: 646f 6d61 696e 2072 6561 6c6d 2061 6363 domain realm acc │ │ │ │ -00178420: 6573 7365 6420 286f 7074 696f 6e61 6c2c essed (optional, │ │ │ │ -00178430: 204e 554c 4c20 746f 206f 6d69 7429 3c2f NULL to omit)
    .
    │ │ │ │ -00178460: 2020 3c73 7061 6e20 636c 6173 733d 226b retu │ │ │ │ -00178480: 726e 3c2f 7370 616e 3e20 3430 313b 203c rn 401; < │ │ │ │ -00178490: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    }
    .
    ... │ │ │ │ -001784e0: 2f2f 2077 6562 6d65 7468 6f64 206c 6f67 // webmethod log │ │ │ │ -001784f0: 6963 3c2f 7370 616e 3e3c 2f64 6976 3e0a ic
    . │ │ │ │ -00178500: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    re │ │ │ │ -00178530: 7475 726e 3c2f 7370 616e 3e20 3c61 2063 turn │ │ │ │ -00178590: 534f 4150 5f4f 4b3c 2f61 3e3b 3c2f 6469 SOAP_OK;.
    }
    .< │ │ │ │ -00178670: 6469 7620 636c 6173 733d 2274 7464 6563 div class="ttdec │ │ │ │ -00178680: 6922 3e63 6f6e 7374 2063 6861 7220 2a20 i">const char * │ │ │ │ -00178690: 6175 7468 7265 616c 6d3c 2f64 6976 3e3c authrealm
    < │ │ │ │ -001786a0: 6469 7620 636c 6173 733d 2274 7464 6f63 div class="ttdoc │ │ │ │ -001786b0: 223e 5468 6520 4854 5450 2061 6e64 204e ">The HTTP and N │ │ │ │ -001786c0: 544c 4d20 6175 7468 6f72 697a 6174 696f TLM authorizatio │ │ │ │ -001786d0: 6e20 7265 616c 6d2f 646f 6d61 696e 2073 n realm/domain s │ │ │ │ -001786e0: 7472 696e 6720 7265 6365 6976 6564 2062 tring received b │ │ │ │ -001786f0: 7920 7468 6520 636c 6965 6e74 2077 6974 y the client wit │ │ │ │ -00178700: 6820 7468 6520 5757 572d 4175 7468 656e h the WWW-Authen │ │ │ │ -00178710: 7469 6361 7465 202e 2e2e 3c2f 6469 763e ticate ...
    │ │ │ │ -00178720: 3c64 6976 2063 6c61 7373 3d22 7474 6465
    Definition │ │ │ │ -00178740: 3a3c 2f62 3e20 7374 6473 6f61 7032 2e68 : stdsoap2.h │ │ │ │ -00178750: 3a33 3833 323c 2f64 6976 3e3c 2f64 6976 :3832
    .

    When │ │ │ │ -00178780: 2074 6865 2061 7574 6865 6e74 6963 6174 the authenticat │ │ │ │ -00178790: 696f 6e20 6661 696c 732c 2074 6865 2073 ion fails, the s │ │ │ │ -001787a0: 6572 7669 6365 2072 6573 706f 6e73 6520 ervice response │ │ │ │ -001787b0: 7769 7468 2061 2053 4f41 5020 4661 756c with a SOAP Faul │ │ │ │ -001787c0: 7420 6d65 7373 6167 6520 616e 6420 6120 t message and a │ │ │ │ -001787d0: 4854 5450 2065 7272 6f72 2063 6f64 6520 HTTP error code │ │ │ │ -001787e0: 2234 3031 2055 6e61 7574 686f 7269 7a65 "401 Unauthorize │ │ │ │ -001787f0: 6422 2e20 5468 6520 4854 5450 2065 7272 d". The HTTP err │ │ │ │ -00178800: 6f72 2063 6f64 6573 2061 7265 2064 6573 or codes are des │ │ │ │ -00178810: 6372 6962 6564 2069 6e20 5365 6374 696f cribed in Sectio │ │ │ │ -00178820: 6e20 3c61 2063 6c61 7373 3d22 656c 2220 n Run-t │ │ │ │ -00178850: 696d 6520 6572 726f 7220 636f 6465 733c ime error codes< │ │ │ │ -00178860: 2f61 3e20 2e3c 2f70 3e0a 3c70 3e54 6f20 /a> .

    .

    To │ │ │ │ -00178870: 7265 7475 726e 2061 206e 6f6e 2d53 4f41 return a non-SOA │ │ │ │ -00178880: 5020 6572 726f 722c 2075 7365 3a3c 2f70 P error, use:

    .
    return soap_send_empt │ │ │ │ -00178940: 795f 7265 7370 6f6e 7365 3c2f 613e 283c y_response(< │ │ │ │ -00178950: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -00178960: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ -00178970: 6874 6d6c 223e 736f 6170 3c2f 613e 2c20 html">soap, │ │ │ │ -00178980: 3430 3129 3b20 3c2f 6469 763e 0a3c 2f64 401);
    .

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

    .

    .HTT │ │ │ │ -00178a10: 5020 4e54 4c4d 2061 7574 6865 6e74 6963 P NTLM authentic │ │ │ │ -00178a20: 6174 696f 6e3c 2f68 333e 0a3c 703e 4854 ation

    .

    HT │ │ │ │ -00178a30: 5450 204e 544c 4d20 6175 7468 656e 7469 TP NTLM authenti │ │ │ │ -00178a40: 6361 7469 6f6e 2069 7320 656e 6162 6c65 cation is enable │ │ │ │ -00178a50: 6420 6174 2074 6865 2063 6c69 656e 742d d at the client- │ │ │ │ -00178a60: 7369 6465 2062 7920 696e 7374 616c 6c69 side by installi │ │ │ │ -00178a70: 6e67 203c 636f 6465 3e6c 6962 6e74 6c6d ng libntlm │ │ │ │ -00178a80: 3c2f 636f 6465 3e20 6672 6f6d 203c 6120 from http://www. │ │ │ │ -00178ac0: 6e6f 6e67 6e75 2e6f 7267 2f6c 6962 6e74 nongnu.org/libnt │ │ │ │ -00178ad0: 6c6d 3c2f 613e 2061 6e64 2063 6f6d 7069 lm and compi │ │ │ │ -00178ae0: 6c69 6e67 2061 6c6c 2070 726f 6a65 6374 ling all project │ │ │ │ -00178af0: 2073 6f75 7263 6520 636f 6465 7320 7769 source codes wi │ │ │ │ -00178b00: 7468 2074 6865 2063 6f6d 7069 6c65 2d74 th the compile-t │ │ │ │ -00178b10: 696d 6520 666c 6167 203c 636f 6465 3e23 ime flag # │ │ │ │ -00178b20: 5749 5448 5f4e 544c 4d3c 2f63 6f64 653e WITH_NTLM │ │ │ │ -00178b30: 2e3c 2f70 3e0a 3c70 3e49 6e20 796f 7572 .

    .

    In your │ │ │ │ -00178b40: 2061 7070 6c69 6361 7469 6f6e 2063 6f64 application cod │ │ │ │ -00178b50: 6520 7365 7420 7468 6520 3c63 6f64 653e e set the │ │ │ │ -00178b60: 636f 6e73 7420 6368 6172 2a20 3c61 2063 const char* soap::userid │ │ │ │ -00178c30: 3c2f 613e 3c2f 636f 6465 3e20 616e 6420 and │ │ │ │ -00178c40: 3c63 6f64 653e 636f 6e73 7420 6368 6172 const char │ │ │ │ -00178c50: 2a20 3c61 2063 6c61 7373 3d22 656c 2220 * soap:: │ │ │ │ -00178d10: 7061 7373 7764 3c2f 613e 3c2f 636f 6465 passwd strings to a u │ │ │ │ -00178d30: 7365 726e 616d 6520 616e 6420 7061 7373 sername and pass │ │ │ │ -00178d40: 776f 7264 2e20 4120 7365 7276 6572 206d word. A server m │ │ │ │ -00178d50: 6179 2072 6571 7565 7374 204e 544c 4d20 ay request NTLM │ │ │ │ -00178d60: 6175 7468 656e 7469 6361 7469 6f6e 2061 authentication a │ │ │ │ -00178d70: 6e64 2064 656e 6965 7320 6163 6365 7373 nd denies access │ │ │ │ -00178d80: 2028 4854 5450 2034 3031 2061 7574 6865 (HTTP 401 authe │ │ │ │ -00178d90: 6e74 6963 6174 696f 6e20 7265 7175 6972 ntication requir │ │ │ │ -00178da0: 6564 206f 7220 4854 5450 2034 3037 2048 ed or HTTP 407 H │ │ │ │ -00178db0: 5454 5020 7072 6f78 7920 6175 7468 656e TTP proxy authen │ │ │ │ -00178dc0: 7469 6361 7469 6f6e 2072 6571 7569 7265 tication require │ │ │ │ -00178dd0: 6429 2077 6865 6e20 7468 6520 636c 6965 d) when the clie │ │ │ │ -00178de0: 6e74 2074 7269 6573 2074 6f20 636f 6e6e nt tries to conn │ │ │ │ -00178df0: 6563 7420 7769 7468 6f75 7420 4854 5450 ect without HTTP │ │ │ │ -00178e00: 2061 7574 6865 6e74 6963 6174 696f 6e20 authentication │ │ │ │ -00178e10: 286f 7220 7769 7468 2074 6865 2077 726f (or with the wro │ │ │ │ -00178e20: 6e67 2061 7574 6865 6e74 6963 6174 696f ng authenticatio │ │ │ │ -00178e30: 6e20 696e 666f 726d 6174 696f 6e29 2e3c n information).< │ │ │ │ -00178e40: 2f70 3e0a 3c70 3e48 6572 6520 6973 2061 /p>.

    Here is a │ │ │ │ -00178e50: 6e20 6578 616d 706c 6520 636c 6965 6e74 n example client │ │ │ │ -00178e60: 2063 6f64 6520 6672 6167 6d65 6e74 2074 code fragment t │ │ │ │ -00178e70: 6f20 7365 7420 7468 6520 4e54 4c4d 2061 o set the NTLM a │ │ │ │ -00178e80: 7574 6865 6e74 6963 6174 696f 6e20 7573 uthentication us │ │ │ │ -00178e90: 6572 6e61 6d65 2061 6e64 2070 6173 7377 ername and passw │ │ │ │ -00178ea0: 6f72 643a 3c2f 703e 0a3c 6469 7620 636c ord:

    ..< │ │ │ │ -00179040: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -00179050: 6f72 6466 6c6f 7722 3e69 663c 2f73 7061 ordflow">if (soap_call_ns │ │ │ │ -00179070: 5f5f 7765 626d 6574 686f 6428 3c61 2063 __webmethod(soap, ... │ │ │ │ -001790b0: 2929 203c 2f64 6976 3e0a 3c64 6976 2063 ))
    .
    {.
    if (soap-> │ │ │ │ -00179140: 3b3c 6120 636c 6173 733d 2263 6f64 6522 ;error< │ │ │ │ -00179190: 2f61 3e20 3d3d 2034 3031 2920 3c2f 6469 /a> == 401) .
    {
    .< │ │ │ │ -001791c0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001791d0: 3e20 2020 203c 6120 636c 6173 733d 2263 >
    soap │ │ │ │ -00179200: 3c2f 613e 2d26 6774 3b3c 6120 636c 6173 ->userid = < │ │ │ │ -00179260: 7370 616e 2063 6c61 7373 3d22 7374 7269 span class="stri │ │ │ │ -00179270: 6e67 6c69 7465 7261 6c22 3e26 7175 6f74 ngliteral">" │ │ │ │ -00179280: 3b5a 6170 686f 6426 7175 6f74 3b3c 2f73 ;Zaphod";
    . │ │ │ │ -001792b0: 2020 203c 6120 636c 6173 733d 2263 6f64 soap-> │ │ │ │ -00179330: 7061 7373 7764 3c2f 613e 203d 203c 7370 passwd = "B │ │ │ │ -00179360: 6565 626c 6562 726f 7826 7175 6f74 3b3c eeblebrox"< │ │ │ │ -00179370: 2f73 7061 6e3e 3b20 3c2f 6469 763e 0a3c /span>;
    .< │ │ │ │ -00179380: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -00179390: 3e20 2020 203c 7370 616e 2063 6c61 7373 > i │ │ │ │ -001793b0: 663c 2f73 7061 6e3e 2028 736f 6170 5f63 f (soap_c │ │ │ │ -001793c0: 616c 6c5f 6e73 5f5f 7765 626d 6574 686f all_ns__webmetho │ │ │ │ -001793d0: 6428 3c61 2063 6c61 7373 3d22 636f 6465 d(soap, ...))
    . │ │ │ │ -00179410: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    ... // error
    .
    else
    .
    │ │ │ │ -001794b0: 2020 2e2e 2e20 3c73 7061 6e20 636c 6173 ... // s │ │ │ │ -001794d0: 7563 6365 7373 3c2f 7370 616e 3e3c 2f64 uccess.
    }
    . │ │ │ │ -00179500: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    }
    .
    │ │ │ │ -00179520: 3c21 2d2d 2066 7261 676d 656e 7420 2d2d

    Whe │ │ │ │ -0017a500: 6e20 7468 6520 6175 7468 656e 7469 6361 n the authentica │ │ │ │ -0017a510: 7469 6f6e 2066 6169 6c73 2028 7374 6167 tion fails (stag │ │ │ │ -0017a520: 6520 3120 616e 6420 3229 2c20 7468 6520 e 1 and 2), the │ │ │ │ -0017a530: 7365 7276 6963 6520 7265 7370 6f6e 7365 service response │ │ │ │ -0017a540: 2077 6974 6820 4854 5450 2065 7272 6f72 with HTTP error │ │ │ │ -0017a550: 2063 6f64 6520 2234 3031 2055 6e61 7574 code "401 Unaut │ │ │ │ -0017a560: 686f 7269 7a65 6422 2061 6e64 203c 636f horized" and soap::e │ │ │ │ -0017a620: 7272 6f72 3c2f 613e 3c2f 636f 6465 3e20 rror │ │ │ │ -0017a630: 6973 2073 6574 2074 6f20 4854 5450 2063 is set to HTTP c │ │ │ │ -0017a640: 6f64 6520 3430 312e 3c2f 703e 0a3c 703e ode 401.

    .

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

    .HTTP │ │ │ │ -0017a6c0: 7072 6f78 7920 4e54 4c4d 2061 7574 6865 proxy NTLM authe │ │ │ │ -0017a6d0: 6e74 6963 6174 696f 6e3c 2f68 333e 0a3c ntication

    .< │ │ │ │ -0017a6e0: 703e 466f 7220 4854 5450 2034 3037 2050 p>For HTTP 407 P │ │ │ │ -0017a6f0: 726f 7879 2041 7574 6865 6e74 6963 6174 roxy Authenticat │ │ │ │ -0017a700: 696f 6e20 5265 7175 6972 6564 2073 6574 ion Required set │ │ │ │ -0017a710: 2074 6865 203c 636f 6465 3e3c 6120 636c the soap:: │ │ │ │ -0017a7d0: 7072 6f78 795f 7573 6572 6964 3c2f 613e proxy_userid │ │ │ │ -0017a7e0: 3c2f 636f 6465 3e20 616e 6420 3c63 6f64 and soap::proxy_pa │ │ │ │ -0017a8b0: 7373 7764 3c2f 613e 3c2f 636f 6465 3e3a sswd: │ │ │ │ -0017a8c0: 3c2f 703e 0a3c 6469 7620 636c 6173 733d

    .
    struct soap │ │ │ │ -0017a940: 202a 3c61 2063 6c61 7373 3d22 636f 6465 *soap = soap_ne │ │ │ │ -0017a9d0: 7731 3c2f 613e 283c 6120 636c 6173 733d w1(SOAP_I │ │ │ │ -0017aa30: 4f5f 4b45 4550 414c 4956 453c 2f61 3e29 O_KEEPALIVE) │ │ │ │ -0017aa40: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
    .
    soap->< │ │ │ │ -0017aa90: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -0017aaa0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ -0017aab0: 6874 6d6c 2361 6331 3732 6264 3930 3139 html#ac172bd9019 │ │ │ │ -0017aac0: 6166 6565 6262 3336 3335 6233 6139 6637 afeebb3635b3a9f7 │ │ │ │ -0017aad0: 3261 3931 3031 223e 7072 6f78 795f 686f 2a9101">proxy_ho │ │ │ │ -0017aae0: 7374 3c2f 613e 203d 203c 7370 616e 2063 st = "...&q │ │ │ │ -0017ab10: 756f 743b 3c2f 7370 616e 3e3b 203c 2f64 uot;; .. │ │ │ │ -0017abd0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    if (soap_call │ │ │ │ -0017ac10: 5f6e 735f 5f77 6562 6d65 7468 6f64 283c _ns__webmethod(< │ │ │ │ -0017ac20: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -0017ac30: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ -0017ac40: 6874 6d6c 223e 736f 6170 3c2f 613e 2c20 html">soap, │ │ │ │ -0017ac50: 2e2e 2e29 2920 3c2f 6469 763e 0a3c 6469 ...))
    .{ │ │ │ │ -0017ac70: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    if ( │ │ │ │ -0017acb0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap- │ │ │ │ -0017ace0: 2667 743b 3c61 2063 6c61 7373 3d22 636f >err │ │ │ │ -0017ad30: 6f72 3c2f 613e 203d 3d20 3430 3729 203c or == 407) < │ │ │ │ -0017ad40: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    {
    .
    s │ │ │ │ -0017ada0: 6f61 703c 2f61 3e2d 2667 743b 3c61 2063 oap->proxy_useri │ │ │ │ -0017ae00: 643c 2f61 3e20 3d20 3c73 7061 6e20 636c d = "Zaphod │ │ │ │ -0017ae30: 2671 756f 743b 3c2f 7370 616e 3e3b 203c "; < │ │ │ │ -0017ae40: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    soap-> │ │ │ │ -0017ae90: 3c61 2063 6c61 7373 3d22 636f 6465 2220 proxy_p │ │ │ │ -0017aee0: 6173 7377 643c 2f61 3e20 3d20 3c73 7061 asswd = "Be │ │ │ │ -0017af10: 6562 6c65 6272 6f78 2671 756f 743b 3c2f eblebrox";
    . │ │ │ │ -0017af40: 2020 2020 3c61 2063 6c61 7373 3d22 636f soap< │ │ │ │ -0017af70: 2f61 3e2d 2667 743b 3c61 2063 6c61 7373 /a>->authrealm = │ │ │ │ -0017afd0: 203c 7370 616e 2063 6c61 7373 3d22 7374 &qu │ │ │ │ -0017aff0: 6f74 3b55 7273 612d 4d69 6e6f 7226 7175 ot;Ursa-Minor&qu │ │ │ │ -0017b000: 6f74 3b3c 2f73 7061 6e3e 3b20 3c2f 6469 ot;; .
    if (so │ │ │ │ -0017b050: 6170 5f63 616c 6c5f 6e73 5f5f 7765 626d ap_call_ns__webm │ │ │ │ -0017b060: 6574 686f 6428 3c61 2063 6c61 7373 3d22 ethod(soa │ │ │ │ -0017b090: 703c 2f61 3e2c 202e 2e2e 2929 203c 2f64 p, ...)) .
    ... │ │ │ │ -0017b0c0: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // error
    .
    │ │ │ │ -0017b100: 2020 3c73 7061 6e20 636c 6173 733d 226b else │ │ │ │ -0017b120: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ │ -0017b140: 2020 2020 2020 2e2e 2e20 3c73 7061 6e20 ... │ │ │ │ -0017b160: 2f2f 2073 7563 6365 7373 3c2f 7370 616e // success
    .
    i │ │ │ │ -0017b240: 6e74 2070 726f 7879 5f70 6f72 743c 2f64 nt proxy_port
    User-defin │ │ │ │ -0017b270: 6162 6c65 2070 726f 7879 2070 6f72 7420 able proxy port │ │ │ │ -0017b280: 7768 6963 6820 7368 6f75 6c64 2062 6520 which should be │ │ │ │ -0017b290: 7365 7420 746f 2063 6f6e 6e65 6374 2074 set to connect t │ │ │ │ -0017b2a0: 6872 6f75 6768 2061 6e20 4854 5450 2070 hrough an HTTP p │ │ │ │ -0017b2b0: 726f 7879 2028 7468 6520 7661 6c75 6520 roxy (the value │ │ │ │ -0017b2c0: 6973 2038 3038 3020 6279 202e 2e2e 3c2f is 8080 by ...
    Defini │ │ │ │ -0017b2f0: 7469 6f6e 3a3c 2f62 3e20 7374 6473 6f61 tion: stdsoa │ │ │ │ -0017b300: 7032 2e68 3a33 3930 363c 2f64 6976 3e3c p2.h:3906
    < │ │ │ │ -0017b310: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    < │ │ │ │ -0017b360: 6469 7620 636c 6173 733d 2274 746e 616d div class="ttnam │ │ │ │ -0017b370: 6522 3e3c 6120 6872 6566 3d22 7374 7275 e">s │ │ │ │ -0017b3b0: 6f61 703a 3a70 726f 7879 5f75 7365 7269 oap::proxy_useri │ │ │ │ -0017b3c0: 643c 2f61 3e3c 2f64 6976 3e3c 6469 7620 d
    c │ │ │ │ -0017b3e0: 6f6e 7374 2063 6861 7220 2a20 7072 6f78 onst char * prox │ │ │ │ -0017b3f0: 795f 7573 6572 6964 3c2f 6469 763e 3c64 y_userid
    User-definable │ │ │ │ -0017b420: 7072 6f78 7920 6175 7468 6f72 697a 6174 proxy authorizat │ │ │ │ -0017b430: 696f 6e20 7573 6572 2069 6420 7374 7269 ion user id stri │ │ │ │ -0017b440: 6e67 2074 6f20 6175 7468 656e 7469 6361 ng to authentica │ │ │ │ -0017b450: 7465 2061 6e64 2063 6f6e 6e65 6374 2074 te and connect t │ │ │ │ -0017b460: 6f20 616e 2048 5454 5020 7072 6f78 792e o an HTTP proxy. │ │ │ │ -0017b470: 3c2f 6469 763e 3c64 6976 2063 6c61 7373
    Defi │ │ │ │ -0017b490: 6e69 7469 6f6e 3a3c 2f62 3e20 7374 6473 nition: stds │ │ │ │ -0017b4a0: 6f61 7032 2e68 3a33 3931 313c 2f64 6976 oap2.h:3911
    .
    c │ │ │ │ -0017b580: 6f6e 7374 2063 6861 7220 2a20 7072 6f78 onst char * prox │ │ │ │ -0017b590: 795f 686f 7374 3c2f 6469 763e 3c64 6976 y_host
    U │ │ │ │ -0017b5b0: 7365 722d 6465 6669 6e61 626c 6520 7072 ser-definable pr │ │ │ │ -0017b5c0: 6f78 7920 686f 7374 206e 616d 6520 7374 oxy host name st │ │ │ │ -0017b5d0: 7269 6e67 2077 6869 6368 2073 686f 756c ring which shoul │ │ │ │ -0017b5e0: 6420 6265 2073 6574 2074 6f20 636f 6e6e d be set to conn │ │ │ │ -0017b5f0: 6563 7420 7468 726f 7567 6820 616e 2048 ect through an H │ │ │ │ -0017b600: 5454 5020 7072 6f78 792e 3c2f 6469 763e TTP proxy.
    │ │ │ │ -0017b610: 3c64 6976 2063 6c61 7373 3d22 7474 6465
    Definition │ │ │ │ -0017b630: 3a3c 2f62 3e20 7374 6473 6f61 7032 2e68 : stdsoap2.h │ │ │ │ -0017b640: 3a33 3930 313c 2f64 6976 3e3c 2f64 6976 :3901
    .
    < │ │ │ │ -0017b6b0: 6120 6872 6566 3d22 7374 7275 6374 736f a href="structso │ │ │ │ -0017b6c0: 6170 2e68 746d 6c23 6164 3735 6134 6162 ap.html#ad75a4ab │ │ │ │ -0017b6d0: 6531 3139 6131 6137 3461 3236 6430 3634 e119a1a74a26d064 │ │ │ │ -0017b6e0: 3031 6661 3131 6333 6122 3e73 6f61 703a 01fa11c3a">soap: │ │ │ │ -0017b6f0: 3a70 726f 7879 5f70 6173 7377 643c 2f61 :proxy_passwd
    const │ │ │ │ -0017b720: 2063 6861 7220 2a20 7072 6f78 795f 7061 char * proxy_pa │ │ │ │ -0017b730: 7373 7764 3c2f 6469 763e 3c64 6976 2063 sswd
    Use │ │ │ │ -0017b750: 722d 6465 6669 6e61 626c 6520 7072 6f78 r-definable prox │ │ │ │ -0017b760: 7920 6175 7468 6f72 697a 6174 696f 6e20 y authorization │ │ │ │ -0017b770: 7061 7373 776f 7264 2073 7472 696e 6720 password string │ │ │ │ -0017b780: 746f 2061 7574 6865 6e74 6963 6174 6520 to authenticate │ │ │ │ -0017b790: 616e 6420 636f 6e6e 6563 7420 746f 2061 and connect to a │ │ │ │ -0017b7a0: 6e20 4854 5450 2070 726f 7879 2e3c 2f64 n HTTP proxy.
    Definit │ │ │ │ -0017b7d0: 696f 6e3a 3c2f 623e 2073 7464 736f 6170 ion: stdsoap │ │ │ │ -0017b7e0: 322e 683a 3339 3136 3c2f 6469 763e 3c2f 2.h:3916
    .

    T │ │ │ │ -0017b810: 6f20 6176 6f69 6420 7468 6520 6f76 6572 o avoid the over │ │ │ │ -0017b820: 6865 6164 206f 6620 7468 6520 6669 7273 head of the firs │ │ │ │ -0017b830: 7420 7265 6a65 6374 6564 2063 616c 6c2c t rejected call, │ │ │ │ -0017b840: 2075 7365 3a3c 2f70 3e0a 3c64 6976 2063 use:

    .
    │ │ │ │ -0017b860: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65 . │ │ │ │ -0017b9e0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap- │ │ │ │ -0017ba10: 2667 743b 3c61 2063 6c61 7373 3d22 636f >pro │ │ │ │ -0017ba60: 7879 5f68 6f73 743c 2f61 3e20 3d20 3c73 xy_host = " │ │ │ │ -0017ba90: 2e2e 2e26 7175 6f74 3b3c 2f73 7061 6e3e ..." │ │ │ │ -0017baa0: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
    .
    soap->< │ │ │ │ -0017baf0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -0017bb00: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ -0017bb10: 6874 6d6c 2361 3033 3735 3534 6664 3263 html#a037554fd2c │ │ │ │ -0017bb20: 6635 3466 6239 6136 6435 3332 3662 3131 f54fb9a6d5326b11 │ │ │ │ -0017bb30: 6338 6666 6130 223e 7072 6f78 795f 706f c8ffa0">proxy_po │ │ │ │ -0017bb40: 7274 3c2f 613e 203d 202e 2e2e 3b20 3c2f rt = ...; .
    so │ │ │ │ -0017bb90: 6170 3c2f 613e 2d26 6774 3b3c 6120 636c ap->proxy_userid │ │ │ │ -0017bbf0: 3c2f 613e 203d 203c 7370 616e 2063 6c61 = "Zaphod& │ │ │ │ -0017bc20: 7175 6f74 3b3c 2f73 7061 6e3e 3b20 3c2f quot;; .
    so │ │ │ │ -0017bc70: 6170 3c2f 613e 2d26 6774 3b3c 6120 636c ap->proxy_passwd │ │ │ │ -0017bcd0: 3c2f 613e 203d 203c 7370 616e 2063 6c61 = "Beebleb │ │ │ │ -0017bd00: 726f 7826 7175 6f74 3b3c 2f73 7061 6e3e rox" │ │ │ │ -0017bd10: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
    .
    soap->< │ │ │ │ -0017bd60: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -0017bd70: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ -0017bd80: 6874 6d6c 2361 3864 6265 3537 6435 3966 html#a8dbe57d59f │ │ │ │ -0017bd90: 3638 3364 3939 3330 3561 3434 6234 6437 683d99305a44b4d7 │ │ │ │ -0017bda0: 3933 3962 6664 223e 6175 7468 7265 616c 939bfd">authreal │ │ │ │ -0017bdb0: 6d3c 2f61 3e20 3d20 3c73 7061 6e20 636c m = "Ursa-M │ │ │ │ -0017bde0: 696e 6f72 2671 756f 743b 3c2f 7370 616e inor";
    .
    soap-> │ │ │ │ -0017be40: 3c61 2063 6c61 7373 3d22 636f 6465 2220 ntlm_ch │ │ │ │ -0017be90: 616c 6c65 6e67 653c 2f61 3e20 3d20 3c73 allenge = " │ │ │ │ -0017bec0: 2671 756f 743b 3c2f 7370 616e 3e3b 203c "; < │ │ │ │ -0017bed0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    if (soa │ │ │ │ -0017bf10: 705f 6361 6c6c 5f6e 735f 5f77 6562 6d65 p_call_ns__webme │ │ │ │ -0017bf20: 7468 6f64 283c 6120 636c 6173 733d 2263 thod(soap │ │ │ │ -0017bf50: 3c2f 613e 2c20 2e2e 2e29 2920 3c2f 6469 , ...)) .
    ... // error │ │ │ │ -0017bfa0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    else.
    ... // success
    .

    A client S │ │ │ │ -0017c880: 4f41 5020 7265 7175 6573 7420 7769 6c6c OAP request will │ │ │ │ -0017c890: 2068 6176 6520 7468 6520 666f 6c6c 6f77 have the follow │ │ │ │ -0017c8a0: 696e 6720 4854 5450 2068 6561 6465 723a ing HTTP header: │ │ │ │ -0017c8b0: 203c 2f70 3e3c 7072 6520 636c 6173 733d

    POST 
    │ │ │ │ -0017c8d0: 2f58 5858 2048 5454 502f 312e 3120 0a48  /XXX HTTP/1.1 .H
    │ │ │ │ -0017c8e0: 6f73 743a 2059 5959 200a 5573 6572 2d41  ost: YYY .User-A
    │ │ │ │ -0017c8f0: 6765 6e74 3a20 6753 4f41 502f 322e 3820  gent: gSOAP/2.8 
    │ │ │ │ -0017c900: 0a43 6f6e 7465 6e74 2d54 7970 653a 2074  .Content-Type: t
    │ │ │ │ -0017c910: 6578 742f 786d 6c3b 2063 6861 7273 6574  ext/xml; charset
    │ │ │ │ -0017c920: 3d75 7466 2d38 200a 436f 6e74 656e 742d  =utf-8 .Content-
    │ │ │ │ -0017c930: 4c65 6e67 7468 3a20 5a5a 5a20 0a50 726f  Length: ZZZ .Pro
    │ │ │ │ -0017c940: 7879 2d41 7574 686f 7269 7a61 7469 6f6e  xy-Authorization
    │ │ │ │ -0017c950: 3a20 4261 7369 6320 5a33 566c 6333 5136  : Basic Z3Vlc3Q6
    │ │ │ │ -0017c960: 5a33 566c 6333 513d 200a 3c2f 7072 653e  Z3Vlc3Q= .
    │ │ │ │ -0017c970: 3c70 3e20 5768 656e 2058 2d46 6f72 7761

    When X-Forwa │ │ │ │ -0017c980: 7264 6564 2d46 6f72 2068 6561 6465 7273 rded-For headers │ │ │ │ -0017c990: 2061 7265 2072 6574 7572 6e65 6420 6279 are returned by │ │ │ │ -0017c9a0: 2074 6865 2070 726f 7879 2c20 7468 6520 the proxy, the │ │ │ │ -0017c9b0: 6865 6164 6572 2063 616e 2062 6520 6163 header can be ac │ │ │ │ -0017c9c0: 6365 7373 6564 2069 6e20 7468 6520 3c63 cessed in the soap: │ │ │ │ -0017ca60: 3a70 726f 7879 5f66 726f 6d3c 2f61 3e3c :proxy_from< │ │ │ │ -0017ca70: 2f63 6f64 653e 2073 7472 696e 672e 3c2f /code> string..

    The CONNEC │ │ │ │ -0017ca90: 5420 6d65 7468 6f64 2069 7320 7573 6564 T method is used │ │ │ │ -0017caa0: 2066 6f72 2048 5454 5020 7072 6f78 7920 for HTTP proxy │ │ │ │ -0017cab0: 6175 7468 656e 7469 6361 7469 6f6e 3a20 authentication: │ │ │ │ -0017cac0: 3c2f 703e 3c70 7265 2063 6c61 7373 3d22

    CONNEC
    │ │ │ │ -0017cae0: 5420 7365 7276 6572 2e65 7861 6d70 6c65  T server.example
    │ │ │ │ -0017caf0: 2e63 6f6d 3a38 3020 4854 5450 2f31 2e31  .com:80 HTTP/1.1
    │ │ │ │ -0017cb00: 0a3c 2f70 7265 3e3c 703e 2049 6e20 736f  .

    In so │ │ │ │ -0017cb10: 6d65 2063 6173 6573 2c20 796f 7520 7769 me cases, you wi │ │ │ │ -0017cb20: 6c6c 206e 6f74 6963 6520 7468 6174 2074 ll notice that t │ │ │ │ -0017cb30: 6865 2048 6f73 7420 4854 5450 2068 6561 he Host HTTP hea │ │ │ │ -0017cb40: 6465 7220 7573 6573 2074 6865 2043 4f4e der uses the CON │ │ │ │ -0017cb50: 4e45 4354 2070 726f 746f 636f 6c3a 203c NECT protocol: < │ │ │ │ -0017cb60: 2f70 3e3c 7072 6520 636c 6173 733d 2266 /p>

    CONNECT
    │ │ │ │ -0017cb80: 2073 6572 7665 722e 6578 616d 706c 652e   server.example.
    │ │ │ │ -0017cb90: 636f 6d3a 3830 2048 5454 502f 312e 3120  com:80 HTTP/1.1 
    │ │ │ │ -0017cba0: 0a48 6f73 743a 2073 6572 7665 722e 6578  .Host: server.ex
    │ │ │ │ -0017cbb0: 616d 706c 652e 636f 6d3a 3830 0a3c 2f70  ample.com:80.

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

    .

    .P │ │ │ │ -0017cc20: 6572 666f 726d 616e 6365 2069 6d70 726f erformance impro │ │ │ │ -0017cc30: 7665 6d65 6e74 2074 6970 733c 2f68 323e vement tips

    │ │ │ │ -0017cc40: 0a3c 703e 4865 7265 2061 7265 2073 6f6d .

    Here are som │ │ │ │ -0017cc50: 6520 7469 7073 2079 6f75 2063 616e 2075 e tips you can u │ │ │ │ -0017cc60: 7365 2074 6f20 7370 6565 6420 7570 2067 se to speed up g │ │ │ │ -0017cc70: 534f 4150 2e20 5468 6520 6465 6661 756c SOAP. The defaul │ │ │ │ -0017cc80: 7420 7365 7474 696e 6773 2061 7265 2063 t settings are c │ │ │ │ -0017cc90: 686f 7365 6e20 746f 206d 6178 696d 697a hosen to maximiz │ │ │ │ -0017cca0: 6520 706f 7274 6162 696c 6974 7920 616e e portability an │ │ │ │ -0017ccb0: 6420 636f 6d70 6174 6962 696c 6974 792e d compatibility. │ │ │ │ -0017ccc0: 2054 6865 2073 6574 7469 6e67 7320 6361 The settings ca │ │ │ │ -0017ccd0: 6e20 6265 2074 7765 616b 6564 2074 6f20 n be tweaked to │ │ │ │ -0017cce0: 6f70 7469 6d69 7a65 2074 6865 2070 6572 optimize the per │ │ │ │ -0017ccf0: 666f 726d 616e 6365 2061 7320 666f 6c6c formance as foll │ │ │ │ -0017cd00: 6f77 733a 3c2f 703e 0a3c 756c 3e0a 3c6c ows:

    .
      .Increase the b │ │ │ │ -0017cd20: 7566 6665 7220 7369 7a65 203c 636f 6465 uffer size #SOAP_BUFLEN by changing │ │ │ │ -0017cd50: 2074 6865 203c 636f 6465 3e23 534f 4150 the #SOAP │ │ │ │ -0017cd60: 5f42 5546 4c45 4e3c 2f63 6f64 653e 206d _BUFLEN m │ │ │ │ -0017cd70: 6163 726f 2069 6e20 3c65 6d3e 3c63 6f64 acro in gsoap/stdsoap2 │ │ │ │ -0017cd90: 2e68 3c2f 636f 6465 3e3c 2f65 6d3e 2e20 .h. │ │ │ │ -0017cda0: 5573 6520 6275 6666 6572 2073 697a 6520 Use buffer size │ │ │ │ -0017cdb0: 325e 3138 3d32 3632 3134 3420 666f 7220 2^18=262144 for │ │ │ │ -0017cdc0: 6578 616d 706c 652e 3c2f 6c69 3e0a 3c6c example..Use HTTP keep- │ │ │ │ -0017cde0: 616c 6976 6520 6174 2074 6865 2063 6c69 alive at the cli │ │ │ │ -0017cdf0: 656e 742d 7369 6465 2c20 7365 6520 5365 ent-side, see Se │ │ │ │ -0017ce00: 6374 696f 6e20 3c61 2063 6c61 7373 3d22 ction │ │ │ │ -0017ce30: 5443 5020 616e 6420 4854 5450 206b 6565 TCP and HTTP kee │ │ │ │ -0017ce40: 702d 616c 6976 653c 2f61 3e20 2c20 7768 p-alive , wh │ │ │ │ -0017ce50: 656e 2074 6865 2063 6c69 656e 7420 6e65 en the client ne │ │ │ │ -0017ce60: 6564 7320 746f 206d 616b 6520 6120 7365 eds to make a se │ │ │ │ -0017ce70: 7269 6573 206f 6620 6361 6c6c 7320 746f ries of calls to │ │ │ │ -0017ce80: 2074 6865 2073 616d 6520 7365 7276 6572 the same server │ │ │ │ -0017ce90: 2e20 5365 7276 6572 2d73 6964 6520 6b65 . Server-side ke │ │ │ │ -0017cea0: 6570 2d61 6c69 7665 2073 7570 706f 7274 ep-alive support │ │ │ │ -0017ceb0: 2063 616e 2067 7265 6174 6c79 2069 6d70 can greatly imp │ │ │ │ -0017cec0: 726f 7665 2070 6572 666f 726d 616e 6365 rove performance │ │ │ │ -0017ced0: 206f 6620 626f 7468 2063 6c69 656e 7420 of both client │ │ │ │ -0017cee0: 616e 6420 7365 7276 6572 2e20 4275 7420 and server. But │ │ │ │ -0017cef0: 6265 2061 7761 7265 2074 6861 7420 636c be aware that cl │ │ │ │ -0017cf00: 6965 6e74 7320 616e 6420 7365 7276 6963 ients and servic │ │ │ │ -0017cf10: 6573 2075 6e64 6572 2055 6e69 782f 4c69 es under Unix/Li │ │ │ │ -0017cf20: 6e75 7820 7265 7175 6972 6520 7369 676e nux require sign │ │ │ │ -0017cf30: 616c 2068 616e 646c 6572 7320 746f 2063 al handlers to c │ │ │ │ -0017cf40: 6174 6368 2064 726f 7070 6564 2063 6f6e atch dropped con │ │ │ │ -0017cf50: 6e65 6374 696f 6e73 2e3c 2f6c 693e 0a3c nections..< │ │ │ │ -0017cf60: 6c69 3e55 7365 2048 5454 5020 6368 756e li>Use HTTP chun │ │ │ │ -0017cf70: 6b65 6420 7472 616e 7366 6572 732c 2073 ked transfers, s │ │ │ │ -0017cf80: 6565 2053 6563 7469 6f6e 203c 6120 636c ee Section HTTP chunked │ │ │ │ -0017cfc0: 7472 616e 7366 6572 2065 6e63 6f64 696e transfer encodin │ │ │ │ -0017cfd0: 673c 2f61 3e20 2e3c 2f6c 693e 0a3c 6c69 g ..
    • Do not use gzip │ │ │ │ -0017cff0: 2063 6f6d 7072 6573 7369 6f6e 2c20 7369 compression, si │ │ │ │ -0017d000: 6e63 6520 7468 6520 6f76 6572 6865 6164 nce the overhead │ │ │ │ -0017d010: 206f 6620 636f 6d70 7265 7373 696f 6e20 of compression │ │ │ │ -0017d020: 6973 2074 7970 6963 616c 6c79 2068 6967 is typically hig │ │ │ │ -0017d030: 6865 7220 7468 616e 2074 6865 2062 616e her than the ban │ │ │ │ -0017d040: 6477 6964 7468 2067 6169 6e73 2e3c 2f6c dwidth gains..
    • Set the < │ │ │ │ -0017d060: 636f 6465 3e23 534f 4150 5f58 4d4c 5f54 code>#SOAP_XML_T │ │ │ │ -0017d070: 5245 453c 2f63 6f64 653e 2066 6c61 6720 REE flag │ │ │ │ -0017d080: 746f 2064 6973 6162 6c65 2069 642d 7265 to disable id-re │ │ │ │ -0017d090: 6620 6d75 6c74 692d 7265 6620 6f62 6a65 f multi-ref obje │ │ │ │ -0017d0a0: 6374 2073 6572 6961 6c69 7a61 7469 6f6e ct serialization │ │ │ │ -0017d0b0: 2e20 5468 6973 2062 6f6f 7374 7320 7065 . This boosts pe │ │ │ │ -0017d0c0: 7266 6f72 6d61 6e63 6520 7369 676e 6966 rformance signif │ │ │ │ -0017d0d0: 6963 616e 746c 7920 616e 6420 776f 726b icantly and work │ │ │ │ -0017d0e0: 7320 7769 7468 2053 4f41 5020 646f 6375 s with SOAP docu │ │ │ │ -0017d0f0: 6d65 6e74 2f6c 6974 6572 616c 2073 7479 ment/literal sty │ │ │ │ -0017d100: 6c65 2028 692e 652e 206e 6f20 6964 2d72 le (i.e. no id-r │ │ │ │ -0017d110: 6566 2067 7261 7068 2073 6572 6961 6c69 ef graph seriali │ │ │ │ -0017d120: 7a61 7469 6f6e 2061 7320 7265 7175 6972 zation as requir │ │ │ │ -0017d130: 6564 2077 6974 6820 534f 4150 2065 6e63 ed with SOAP enc │ │ │ │ -0017d140: 6f64 696e 6720 7374 796c 6529 2e20 446f oding style). Do │ │ │ │ -0017d150: 206e 6f74 2075 7365 2074 6869 7320 666f not use this fo │ │ │ │ -0017d160: 7220 534f 4150 2052 5043 2065 6e63 6f64 r SOAP RPC encod │ │ │ │ -0017d170: 6564 206d 6573 7361 6769 6e67 2e3c 2f6c ed messaging..
    • Compile < │ │ │ │ -0017d190: 656d 3e3c 636f 6465 3e67 736f 6170 2f73 em>gsoap/s │ │ │ │ -0017d1a0: 7464 736f 6170 322e 633c 2f63 6f64 653e tdsoap2.c │ │ │ │ -0017d1b0: 3c2f 656d 3e20 616e 6420 3c65 6d3e 3c63 and gsoap/stdsoa │ │ │ │ -0017d1d0: 7032 2e63 7070 3c2f 636f 6465 3e3c 2f65 p2.cpp and all other │ │ │ │ -0017d1f0: 2073 6f75 7263 6520 636f 6465 7320 7769 source codes wi │ │ │ │ -0017d200: 7468 2074 6865 2063 6f6d 7069 6c65 2074 th the compile t │ │ │ │ -0017d210: 696d 6520 666c 6167 203c 636f 6465 3e23 ime flag # │ │ │ │ -0017d220: 5749 5448 5f4e 4f49 4452 4546 3c2f 636f WITH_NOIDREF to improve p │ │ │ │ -0017d240: 6572 666f 726d 616e 6365 2065 7665 6e20 erformance even │ │ │ │ -0017d250: 6265 7474 6572 2062 7920 7065 726d 616e better by perman │ │ │ │ -0017d260: 656e 746c 7920 6469 7361 626c 696e 6720 ently disabling │ │ │ │ -0017d270: 6964 2d72 6566 206d 756c 7469 2d72 6566 id-ref multi-ref │ │ │ │ -0017d280: 206f 626a 6563 7420 7365 7269 616c 697a object serializ │ │ │ │ -0017d290: 6174 696f 6e2e 2044 6f20 6e6f 7420 7573 ation. Do not us │ │ │ │ -0017d2a0: 6520 7468 6973 2066 6f72 2053 4f41 5020 e this for SOAP │ │ │ │ -0017d2b0: 5250 4320 656e 636f 6465 6420 6d65 7373 RPC encoded mess │ │ │ │ -0017d2c0: 6167 696e 672e 3c2f 6c69 3e0a 3c6c 693e aging.
    • .
    • │ │ │ │ -0017d2d0: 446f 206e 6f74 2075 7365 2044 4542 5547 Do not use DEBUG │ │ │ │ -0017d2e0: 206d 6f64 652c 2073 696e 6365 2074 6865 mode, since the │ │ │ │ -0017d2f0: 206f 7665 7268 6561 6420 6f66 206c 6f67 overhead of log │ │ │ │ -0017d300: 6769 6e67 2069 7320 7369 676e 6966 6963 ging is signific │ │ │ │ -0017d310: 616e 742e 3c2f 6c69 3e0a 3c2f 756c 3e0a ant.
    • .
    . │ │ │ │ -0017d320: 3c70 3ef0 9f94 9d20 3c61 2068 7265 663d

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

    .

    .Saf │ │ │ │ -0017d380: 6574 7920 6775 6172 6473 3c2f 6832 3e0a ety guards

    . │ │ │ │ -0017d390: 3c70 3e54 6865 2066 6f6c 6c6f 7769 6e67

    The following │ │ │ │ -0017d3a0: 2073 6574 7469 6e67 7320 6172 6520 696d settings are im │ │ │ │ -0017d3b0: 706f 7274 616e 7420 746f 2065 6e73 7572 portant to ensur │ │ │ │ -0017d3c0: 6520 7468 6174 2058 4d4c 206d 6573 7361 e that XML messa │ │ │ │ -0017d3d0: 6769 6e67 2069 7320 7361 6665 2062 7920 ging is safe by │ │ │ │ -0017d3e0: 6465 6669 6e69 6e67 2072 6561 736f 6e61 defining reasona │ │ │ │ -0017d3f0: 626c 6520 584d 4c20 6d65 7373 6167 6520 ble XML message │ │ │ │ -0017d400: 7265 7374 7269 6374 696f 6e73 2e20 416c restrictions. Al │ │ │ │ -0017d410: 736f 206d 6573 7361 6769 6e67 2074 696d so messaging tim │ │ │ │ -0017d420: 656f 7574 7320 7368 6f75 6c64 2062 6520 eouts should be │ │ │ │ -0017d430: 7365 7420 6173 2065 7870 6c61 696e 6564 set as explained │ │ │ │ -0017d440: 2069 6e20 5365 6374 696f 6e20 3c61 2063 in Section Timeout mana │ │ │ │ -0017d480: 6765 6d65 6e74 2066 6f72 206e 6f6e 2d62 gement for non-b │ │ │ │ -0017d490: 6c6f 636b 696e 6720 6f70 6572 6174 696f locking operatio │ │ │ │ -0017d4a0: 6e73 3c2f 613e 2e3c 2f70 3e0a 3c70 3e54 ns.

    .

    T │ │ │ │ -0017d4b0: 6865 2058 4d4c 2070 6172 7365 7220 6973 he XML parser is │ │ │ │ -0017d4c0: 2063 6f6e 6669 6775 7265 6420 746f 2072 configured to r │ │ │ │ -0017d4d0: 6573 7472 6963 7420 7468 6520 584d 4c20 estrict the XML │ │ │ │ -0017d4e0: 6e65 7374 696e 6720 6465 7074 6820 6c65 nesting depth le │ │ │ │ -0017d4f0: 7665 6c20 746f 203c 636f 6465 3e23 534f vel to #SO │ │ │ │ -0017d500: 4150 5f4d 4158 4c45 5645 4c3c 2f63 6f64 AP_MAXLEVEL and restricts │ │ │ │ -0017d520: 2074 6865 2072 6570 6561 7465 6420 6f63 the repeated oc │ │ │ │ -0017d530: 6375 7272 656e 6365 206f 6620 656c 656d currence of elem │ │ │ │ -0017d540: 656e 7473 2074 6861 7420 6172 6520 6465 ents that are de │ │ │ │ -0017d550: 7365 7269 616c 697a 6564 2069 6e74 6f20 serialized into │ │ │ │ -0017d560: 6172 7261 7973 2061 6e64 2063 6f6e 7461 arrays and conta │ │ │ │ -0017d570: 696e 6572 7320 6279 203c 636f 6465 3e23 iners by # │ │ │ │ -0017d580: 534f 4150 5f4d 4158 4f43 4355 5253 3c2f SOAP_MAXOCCURS. These mac │ │ │ │ -0017d5a0: 726f 7320 6361 6e20 6265 2063 6861 6e67 ros can be chang │ │ │ │ -0017d5b0: 6564 2c20 6275 7420 796f 7520 6361 6e20 ed, but you can │ │ │ │ -0017d5c0: 616c 736f 2063 6861 6e67 6520 7468 6520 also change the │ │ │ │ -0017d5d0: 666f 6c6c 6f77 696e 6720 636f 6e74 6578 following contex │ │ │ │ -0017d5e0: 7420 6174 7472 6962 7574 6573 2061 7420 t attributes at │ │ │ │ -0017d5f0: 7275 6e2d 7469 6d65 2c20 652e 672e 2074 run-time, e.g. t │ │ │ │ -0017d600: 6f20 656e 6861 6e63 6520 7468 6520 7361 o enhance the sa │ │ │ │ -0017d610: 6665 7479 2066 6f72 2073 7065 6369 6669 fety for specifi │ │ │ │ -0017d620: 6320 7365 7276 6963 6520 616e 642f 6f72 c service and/or │ │ │ │ -0017d630: 2063 6c69 656e 7420 6f70 6572 6174 696f client operatio │ │ │ │ -0017d640: 6e73 3a3c 2f70 3e0a 3c75 6c3e 0a3c 6c69 ns:

    .

    With │ │ │ │ -00182bd0: 474e 5554 4c53 3a20 3c2f 703e 3c70 7265 GNUTLS:

     c++ -DWITH_GN
    │ │ │ │ -00182c00: 5554 4c53 202d 6f20 6d79 7072 6f67 206d  UTLS -o myprog m
    │ │ │ │ -00182c10: 7970 726f 672e 6370 7020 7374 6473 6f61  yprog.cpp stdsoa
    │ │ │ │ -00182c20: 7032 2e63 7070 2073 6f61 7043 2e63 7070  p2.cpp soapC.cpp
    │ │ │ │ -00182c30: 2073 6f61 7053 6572 7665 722e 6370 7020   soapServer.cpp 
    │ │ │ │ -00182c40: 2d6c 676e 7574 6c73 202d 6c67 6372 7970  -lgnutls -lgcryp
    │ │ │ │ -00182c50: 7420 2d6c 6770 672d 6572 726f 720a 3c2f  t -lgpg-error.

    SSL supp │ │ │ │ -00182c70: 6f72 7420 666f 7220 7374 616e 642d 616c ort for stand-al │ │ │ │ -00182c80: 6f6e 6520 6753 4f41 5020 5765 6220 7365 one gSOAP Web se │ │ │ │ -00182c90: 7276 6963 6573 2069 7320 656e 6162 6c65 rvices is enable │ │ │ │ -00182ca0: 6420 6279 2063 616c 6c69 6e67 203c 636f d by calling soap_ssl_ac │ │ │ │ -00182d30: 6365 7074 3c2f 613e 3c2f 636f 6465 3e20 cept │ │ │ │ -00182d40: 746f 2070 6572 666f 726d 2074 6865 2053 to perform the S │ │ │ │ -00182d50: 534c 2f54 4c53 2068 616e 6473 6861 6b65 SL/TLS handshake │ │ │ │ -00182d60: 2061 6674 6572 203c 636f 6465 3e3c 6120 after soap_accep │ │ │ │ -00182df0: 743c 2f61 3e3c 2f63 6f64 653e 2e20 496e t. In │ │ │ │ -00182e00: 2061 6464 6974 696f 6e2c 2061 206b 6579 addition, a key │ │ │ │ -00182e10: 2066 696c 652c 2061 2043 4120 6669 6c65 file, a CA file │ │ │ │ -00182e20: 2028 6f72 2070 6174 6820 746f 2063 6572 (or path to cer │ │ │ │ -00182e30: 7469 6669 6361 7465 7329 2c20 4448 2066 tificates), DH f │ │ │ │ -00182e40: 696c 6520 2869 6620 5253 4120 6973 206e ile (if RSA is n │ │ │ │ -00182e50: 6f74 2075 7365 6429 2c20 616e 6420 7061 ot used), and pa │ │ │ │ -00182e60: 7373 776f 7264 206e 6565 6420 746f 2062 ssword need to b │ │ │ │ -00182e70: 6520 7375 7070 6c69 6564 2e20 496e 7374 e supplied. Inst │ │ │ │ -00182e80: 7275 6374 696f 6e73 206f 6e20 686f 7720 ructions on how │ │ │ │ -00182e90: 746f 2064 6f20 7468 6973 2063 616e 2062 to do this can b │ │ │ │ -00182ea0: 6520 666f 756e 6420 696e 2074 6865 204f e found in the O │ │ │ │ -00182eb0: 7065 6e53 534c 2064 6f63 756d 656e 7461 penSSL documenta │ │ │ │ -00182ec0: 7469 6f6e 203c 6120 6872 6566 3d22 6874 tion http://www │ │ │ │ -00182ef0: 2e6f 7065 6e73 736c 2e6f 7267 3c2f 613e .openssl.org │ │ │ │ -00182f00: 2e20 5365 6520 616c 736f 2053 6563 7469 . See also Secti │ │ │ │ -00182f10: 6f6e 203c 6120 636c 6173 733d 2265 6c22 on SSL certi │ │ │ │ -00182f40: 6669 6361 7465 7320 616e 6420 6b65 7920 ficates and key │ │ │ │ -00182f50: 6669 6c65 733c 2f61 3e20 2e3c 2f70 3e0a files .

    . │ │ │ │ -00182f60: 3c70 3e4c 6574 2773 2074 616b 6520 6120

    Let's take a │ │ │ │ -00182f70: 6c6f 6f6b 2061 7420 616e 2065 7861 6d70 look at an examp │ │ │ │ -00182f80: 6c65 2053 534c 2073 6563 7572 6520 6d75 le SSL secure mu │ │ │ │ -00182f90: 6c74 692d 7468 7265 6164 6564 2073 7461 lti-threaded sta │ │ │ │ -00182fa0: 6e64 2d61 6c6f 6e65 2053 4f41 5020 5765 nd-alone SOAP We │ │ │ │ -00182fb0: 6220 5365 7276 6963 653a 3c2f 703e 0a3c b Service:

    .< │ │ │ │ -00182fc0: 6469 7620 636c 6173 733d 2266 7261 676d div class="fragm │ │ │ │ -00182fd0: 656e 7422 3e3c 6469 7620 636c 6173 733d ent">
    int main │ │ │ │ -00183010: 2829 203c 2f64 6976 3e0a 3c64 6976 2063 ()
    .
    {.
    SOAP_S │ │ │ │ -001830a0: 4f43 4b45 543c 2f61 3e20 6d2c 2073 3b20 OCKET m, s; │ │ │ │ -001830b0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    │ │ │ │ -00183120: 5448 5245 4144 5f54 5950 453c 2f61 3e20 THREAD_TYPE │ │ │ │ -00183130: 7469 643b 203c 2f64 6976 3e0a 3c64 6976 tid;
    .
    │ │ │ │ -00183150: 3c73 7061 6e20 636c 6173 733d 226b 6579 struct soap< │ │ │ │ -001831a0: 2f61 3e20 2a3c 6120 636c 6173 733d 2263 /a> *so │ │ │ │ -001831f0: 6170 3c2f 613e 2c20 2a74 736f 6170 3b20 ap, *tsoap; │ │ │ │ -00183200: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    soap │ │ │ │ -00183270: 5f73 736c 5f69 6e69 743c 2f61 3e28 293b _ssl_init(); │ │ │ │ -00183280: 203c 7370 616e 2063 6c61 7373 3d22 636f /* init O │ │ │ │ -001832a0: 7065 6e53 534c 2028 736b 6970 7069 6e67 penSSL (skipping │ │ │ │ -001832b0: 2074 6869 7320 6f72 2063 616c 6c69 6e67 this or calling │ │ │ │ -001832c0: 206d 756c 7469 706c 6520 7469 6d65 7320 multiple times │ │ │ │ -001832d0: 6973 204f 4b2c 2073 696e 6365 2074 6865 is OK, since the │ │ │ │ -001832e0: 2065 6e67 696e 6520 7769 6c6c 2069 6e69 engine will ini │ │ │ │ -001832f0: 7420 5353 4c20 6175 746f 6d61 7469 6361 t SSL automatica │ │ │ │ -00183300: 6c6c 7929 202a 2f3c 2f73 7061 6e3e 3c2f lly) */.
    / │ │ │ │ -00183340: 2a20 736f 6170 5f73 736c 5f6e 6f69 6e69 * soap_ssl_noini │ │ │ │ -00183350: 7428 293b 202a 2f3c 2f73 7061 6e3e 203c t(); */ < │ │ │ │ -00183360: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ -00183370: 656e 7422 3e2f 2a20 646f 206e 6f74 2069 ent">/* do not i │ │ │ │ -00183380: 6e69 7420 4f70 656e 5353 4c20 2869 6620 nit OpenSSL (if │ │ │ │ -00183390: 5353 4c20 6973 2061 6c72 6561 6479 2069 SSL is already i │ │ │ │ -001833a0: 6e69 7469 616c 697a 6564 2065 6c73 6577 nitialized elsew │ │ │ │ -001833b0: 6865 7265 2069 6e20 7468 6973 2061 7070 here in this app │ │ │ │ -001833c0: 6c69 6361 7469 6f6e 2920 2a2f 3c2f 7370 lication) */
    .
    if (CRYPTO_threa │ │ │ │ -00183470: 645f 7365 7475 703c 2f61 3e28 2929 203c d_setup()) < │ │ │ │ -00183480: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ -00183490: 656e 7422 3e2f 2a20 4f70 656e 5353 4c20 ent">/* OpenSSL │ │ │ │ -001834a0: 7468 7265 6164 206d 7574 6578 2073 6574 thread mutex set │ │ │ │ -001834b0: 7570 202a 2f3c 2f73 7061 6e3e 3c2f 6469 up */.
    {
    .< │ │ │ │ -001834e0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001834f0: 3e20 2020 2066 7072 696e 7466 2873 7464 > fprintf(std │ │ │ │ -00183500: 6572 722c 203c 7370 616e 2063 6c61 7373 err, "Cannot se │ │ │ │ -00183530: 7475 7020 7468 7265 6164 206d 7574 6578 tup thread mutex │ │ │ │ -00183540: 5c6e 2671 756f 743b 3c2f 7370 616e 3e29 \n") │ │ │ │ -00183550: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
    .
    e │ │ │ │ -00183570: 7869 7428 4558 4954 5f46 4149 4c55 5245 xit(EXIT_FAILURE │ │ │ │ -00183580: 293b 203c 2f64 6976 3e0a 3c64 6976 2063 );
    .
    } │ │ │ │ -001835a0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    soap = soap_new() │ │ │ │ -00183650: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
    .
    if │ │ │ │ -00183690: 2028 3c61 2063 6c61 7373 3d22 636f 6465 (soap_ssl_serv │ │ │ │ -001836f0: 6572 5f63 6f6e 7465 7874 3c2f 613e 283c er_context(< │ │ │ │ -00183700: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -00183710: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ -00183720: 6874 6d6c 223e 736f 6170 3c2f 613e 2c20 html">soap, │ │ │ │ -00183730: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    ..
    │ │ │ │ -001837d0: 203c 7370 616e 2063 6c61 7373 3d22 7374 &qu │ │ │ │ -001837f0: 6f74 3b73 6572 7665 722e 7065 6d26 7175 ot;server.pem&qu │ │ │ │ -00183800: 6f74 3b3c 2f73 7061 6e3e 2c20 2020 2020 ot;, │ │ │ │ -00183810: 203c 7370 616e 2063 6c61 7373 3d22 636f /* keyfil │ │ │ │ -00183830: 653a 2072 6571 7569 7265 6420 7768 656e e: required when │ │ │ │ -00183840: 2073 6572 7665 7220 6d75 7374 2061 7574 server must aut │ │ │ │ -00183850: 6865 6e74 6963 6174 6520 746f 2063 6c69 henticate to cli │ │ │ │ -00183860: 656e 7473 2028 7365 6520 5353 4c20 646f ents (see SSL do │ │ │ │ -00183870: 6373 206f 6e20 686f 7720 746f 206f 6274 cs on how to obt │ │ │ │ -00183880: 6169 6e20 7468 6973 2066 696c 6529 202a ain this file) * │ │ │ │ -00183890: 2f3c 2f73 7061 6e3e 203c 2f64 6976 3e0a /
    . │ │ │ │ -001838a0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    "password │ │ │ │ -001838e0: 2671 756f 743b 3c2f 7370 616e 3e2c 2020 ", │ │ │ │ -001838f0: 2020 2020 2020 3c73 7061 6e20 636c 6173 /* p │ │ │ │ -00183910: 6173 7377 6f72 6420 746f 2072 6561 6420 assword to read │ │ │ │ -00183920: 7468 6520 6b65 7920 6669 6c65 2028 6e6f the key file (no │ │ │ │ -00183930: 7420 7573 6564 2077 6974 6820 474e 5554 t used with GNUT │ │ │ │ -00183940: 4c53 2920 2a2f 3c2f 7370 616e 3e20 3c2f LS) */ .
    "cac │ │ │ │ -00183990: 6572 742e 7065 6d26 7175 6f74 3b3c 2f73 ert.pem", /* optional cac │ │ │ │ -001839d0: 6572 7420 6669 6c65 2074 6f20 7374 6f72 ert file to stor │ │ │ │ -001839e0: 6520 7472 7573 7465 6420 6365 7274 6966 e trusted certif │ │ │ │ -001839f0: 6963 6174 6573 202a 2f3c 2f73 7061 6e3e icates */ │ │ │ │ -00183a00: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    NU │ │ │ │ -00183a20: 4c4c 2c20 2020 2020 2020 2020 2020 2020 LL, │ │ │ │ -00183a30: 203c 7370 616e 2063 6c61 7373 3d22 636f /* option │ │ │ │ -00183a50: 616c 2063 6170 6174 6820 746f 2064 6972 al capath to dir │ │ │ │ -00183a60: 6563 746f 7279 2077 6974 6820 7472 7573 ectory with trus │ │ │ │ -00183a70: 7465 6420 6365 7274 6966 6963 6174 6573 ted certificates │ │ │ │ -00183a80: 202a 2f3c 2f73 7061 6e3e 203c 2f64 6976 */
    .
    "dh512. │ │ │ │ -00183ad0: 7065 6d26 7175 6f74 3b3c 2f73 7061 6e3e pem" │ │ │ │ -00183ae0: 2c20 2020 2020 2020 3c73 7061 6e20 636c , /* │ │ │ │ -00183b00: 2044 4820 6669 6c65 206e 616d 6520 6f72 DH file name or │ │ │ │ -00183b10: 2044 4820 6b65 7920 6c65 6e20 6269 7473 DH key len bits │ │ │ │ -00183b20: 2028 6d69 6e69 6d75 6d20 6973 2035 3132 (minimum is 512 │ │ │ │ -00183b30: 2c20 652e 672e 2026 7175 6f74 3b35 3132 , e.g. "512 │ │ │ │ -00183b40: 2671 756f 743b 2920 746f 2067 656e 6572 ") to gener │ │ │ │ -00183b50: 6174 6520 4448 2070 6172 616d 2c20 6966 ate DH param, if │ │ │ │ -00183b60: 204e 554c 4c20 7573 6520 5253 4120 2a2f NULL use RSA */ │ │ │ │ -00183b70: 3c2f 7370 616e 3e20 3c2f 6469 763e 0a3c
    .< │ │ │ │ -00183b80: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -00183b90: 3e20 2020 204e 554c 4c2c 2020 2020 2020 > NULL, │ │ │ │ -00183ba0: 2020 2020 2020 2020 3c73 7061 6e20 636c /* │ │ │ │ -00183bc0: 2069 6620 7261 6e64 6669 6c65 213d 4e55 if randfile!=NU │ │ │ │ -00183bd0: 4c4c 3a20 7573 6520 6120 6669 6c65 2077 LL: use a file w │ │ │ │ -00183be0: 6974 6820 7261 6e64 6f6d 2064 6174 6120 ith random data │ │ │ │ -00183bf0: 746f 2073 6565 6420 7261 6e64 6f6d 6e65 to seed randomne │ │ │ │ -00183c00: 7373 202a 2f3c 2f73 7061 6e3e 2020 3c2f ss */ .
    NULL │ │ │ │ -00183c30: 2020 2020 2020 2020 2020 2020 2020 3c73 /* optional │ │ │ │ -00183c60: 7365 7276 6572 2069 6465 6e74 6966 6963 server identific │ │ │ │ -00183c70: 6174 696f 6e20 746f 2065 6e61 626c 6520 ation to enable │ │ │ │ -00183c80: 5353 4c20 7365 7373 696f 6e20 6361 6368 SSL session cach │ │ │ │ -00183c90: 696e 6720 746f 2073 7065 6564 2075 7020 ing to speed up │ │ │ │ -00183ca0: 544c 5320 286d 7573 7420 6265 2061 2075 TLS (must be a u │ │ │ │ -00183cb0: 6e69 7175 6520 6e61 6d65 2920 2a2f 3c2f nique name) */
    .
    │ │ │ │ -00183ce0: 2929 203c 2f64 6976 3e0a 3c64 6976 2063 ))
    .
    {< │ │ │ │ -00183d00: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    s │ │ │ │ -00183d70: 6f61 705f 7072 696e 745f 6661 756c 743c oap_print_fault< │ │ │ │ -00183d80: 2f61 3e28 3c61 2063 6c61 7373 3d22 636f /a>(soap< │ │ │ │ -00183db0: 2f61 3e2c 2073 7464 6572 7229 3b20 3c2f /a>, stderr); .
    exit( │ │ │ │ -00183de0: 4558 4954 5f46 4149 4c55 5245 293b 203c EXIT_FAILURE); < │ │ │ │ -00183df0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    } .
    m = soap_ │ │ │ │ -00183e80: 6269 6e64 3c2f 613e 283c 6120 636c 6173 bind( │ │ │ │ -00183eb0: 736f 6170 3c2f 613e 2c20 4e55 4c4c 2c20 soap, NULL, │ │ │ │ -00183ec0: 3138 3030 302c 2042 4143 4b4c 4f47 293b 18000, BACKLOG); │ │ │ │ -00183ed0: 203c 7370 616e 2063 6c61 7373 3d22 636f /* use po │ │ │ │ -00183ef0: 7274 2031 3830 3030 202a 2f3c 2f73 7061 rt 18000 */
    .
    if │ │ │ │ -00183f40: 2028 213c 6120 636c 6173 733d 2263 6f64 (!soap_valid_ │ │ │ │ -00183fa0: 736f 636b 6574 3c2f 613e 286d 2929 203c socket(m)) < │ │ │ │ -00183fb0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    {
    .
    soap_ │ │ │ │ -00184040: 7072 696e 745f 6661 756c 743c 2f61 3e28 print_fault( │ │ │ │ -00184050: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap, │ │ │ │ -00184080: 2073 7464 6572 7229 3b20 3c2f 6469 763e stderr);
    │ │ │ │ -00184090: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    exit(EXIT │ │ │ │ -001840b0: 5f46 4149 4c55 5245 293b 203c 2f64 6976 _FAILURE);
    .
    }
    .< │ │ │ │ -001840e0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001840f0: 3e20 2066 7072 696e 7466 2873 7464 6572 > fprintf(stder │ │ │ │ -00184100: 722c 203c 7370 616e 2063 6c61 7373 3d22 r, & │ │ │ │ -00184120: 7175 6f74 3b53 6f63 6b65 7420 636f 6e6e quot;Socket conn │ │ │ │ -00184130: 6563 7469 6f6e 2073 7563 6365 7373 6675 ection successfu │ │ │ │ -00184140: 6c3a 206d 6173 7465 7220 736f 636b 6574 l: master socket │ │ │ │ -00184150: 203d 2025 645c 6e26 7175 6f74 3b3c 2f73 = %d\n"
    , m);
    │ │ │ │ -00184170: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    w │ │ │ │ -001841a0: 6869 6c65 3c2f 7370 616e 3e20 2831 293c hile (1)< │ │ │ │ -001841b0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    {
    .
    s = soap │ │ │ │ -00184240: 5f61 6363 6570 743c 2f61 3e28 3c61 2063 _accept(soap); .
    fprin │ │ │ │ -001842a0: 7466 2873 7464 6572 722c 203c 7370 616e tf(stderr, "Soc │ │ │ │ -001842d0: 6b65 7420 636f 6e6e 6563 7469 6f6e 2073 ket connection s │ │ │ │ -001842e0: 7563 6365 7373 6675 6c3a 2073 6c61 7665 uccessful: slave │ │ │ │ -001842f0: 2073 6f63 6b65 7420 3d20 2564 5c6e 2671 socket = %d\n&q │ │ │ │ -00184300: 756f 743b 3c2f 7370 616e 3e2c 2073 293b uot;, s); │ │ │ │ -00184310: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    if (!soap_valid │ │ │ │ -001843b0: 5f73 6f63 6b65 743c 2f61 3e28 7329 2920 _socket(s)) │ │ │ │ -001843c0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    {.
    if │ │ │ │ -00184420: 2028 3c61 2063 6c61 7373 3d22 636f 6465 (soap->e │ │ │ │ -001844a0: 7272 6e75 6d3c 2f61 3e29 203c 7370 616e rrnum) /* accept faile │ │ │ │ -001844d0: 642c 2074 7279 2061 6761 696e 2061 6674 d, try again aft │ │ │ │ -001844e0: 6572 2031 2073 6563 6f6e 6420 2a2f 3c2f er 1 second */
    .
    │ │ │ │ -00184510: 2020 2020 7b3c 2f64 6976 3e0a 3c64 6976 {
    .
    │ │ │ │ -00184530: 2020 2020 2020 3c61 2063 6c61 7373 3d22 soap_pr │ │ │ │ -00184590: 696e 745f 6661 756c 743c 2f61 3e28 3c61 int_fault(soap, s │ │ │ │ -001845d0: 7464 6572 7229 3b20 3c2f 6469 763e 0a3c tderr);
    .< │ │ │ │ -001845e0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001845f0: 3e20 2020 2020 2020 2073 6c65 6570 2831 > sleep(1 │ │ │ │ -00184600: 293b 3c2f 6469 763e 0a3c 6469 7620 636c );
    .
    │ │ │ │ -00184620: 2020 203c 7370 616e 2063 6c61 7373 3d22 con │ │ │ │ -00184640: 7469 6e75 653c 2f73 7061 6e3e 3b20 3c73 tinue; /* retry */< │ │ │ │ -00184670: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    . │ │ │ │ -00184690: 2020 2020 207d 3c2f 6469 763e 0a3c 6469 }
    . │ │ │ │ -001846b0: 2020 2020 2066 7072 696e 7466 2873 7464 fprintf(std │ │ │ │ -001846c0: 6572 722c 203c 7370 616e 2063 6c61 7373 err, "Server ti │ │ │ │ -001846f0: 6d65 6420 6f75 745c 6e26 7175 6f74 3b3c med out\n"< │ │ │ │ -00184700: 2f73 7061 6e3e 293b 3c2f 6469 763e 0a3c /span>);
    .< │ │ │ │ -00184710: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -00184720: 3e20 2020 2020 203c 7370 616e 2063 6c61 > break; < │ │ │ │ -00184750: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    } .. │ │ │ │ -00184840: 2020 2020 3c73 7061 6e20 636c 6173 733d if │ │ │ │ -00184860: 3c2f 7370 616e 3e20 2821 7473 6f61 7029 (!tsoap) │ │ │ │ -00184870: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    . │ │ │ │ -00184930: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    else.
    while (THREAD_C │ │ │ │ -00184a10: 5245 4154 453c 2f61 3e28 2661 6d70 3b74 REATE(&t │ │ │ │ -00184a20: 6964 2c20 283c 7370 616e 2063 6c61 7373 id, (v │ │ │ │ -00184a40: 6f69 643c 2f73 7061 6e3e 2a28 2a29 283c oid*(*)(< │ │ │ │ -00184a50: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -00184a60: 6f72 6474 7970 6522 3e76 6f69 643c 2f73 ordtype">void*))&proc │ │ │ │ -00184a80: 6573 735f 7265 7175 6573 742c 2028 3c73 ess_request, (void*)tsoap)).
    sle │ │ │ │ -00184ae0: 6570 2831 293b 203c 7370 616e 2063 6c61 ep(1); /* │ │ │ │ -00184b00: 6661 696c 6564 2c20 7472 7920 6167 6169 failed, try agai │ │ │ │ -00184b10: 6e20 2a2f 3c2f 7370 616e 3e3c 2f64 6976 n */
    .
    }
    .< │ │ │ │ -00184b40: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -00184b50: 3e20 203c 6120 636c 6173 733d 2263 6f64 > soap_fre │ │ │ │ -00184bb0: 653c 2f61 3e28 3c61 2063 6c61 7373 3d22 e(soa │ │ │ │ -00184be0: 703c 2f61 3e29 3b20 3c73 7061 6e20 636c p); /* │ │ │ │ -00184c00: 2064 6561 6c6c 6f63 6174 6573 2053 534c deallocates SSL │ │ │ │ -00184c10: 2063 6f6e 7465 7874 202a 2f3c 2f73 7061 context */
    .
    CR │ │ │ │ -00184c90: 5950 544f 5f74 6872 6561 645f 636c 6561 YPTO_thread_clea │ │ │ │ -00184ca0: 6e75 703c 2f61 3e28 293b 203c 7370 616e nup(); /* OpenSSL thre │ │ │ │ -00184cd0: 6164 206d 7574 6578 2063 6c65 616e 7570 ad mutex cleanup │ │ │ │ -00184ce0: 202a 2f3c 2f73 7061 6e3e 3c2f 6469 763e */
    │ │ │ │ -00184cf0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    r │ │ │ │ -00184d20: 6574 7572 6e3c 2f73 7061 6e3e 2030 3b20 eturn 0; │ │ │ │ -00184d30: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    } .
    .< │ │ │ │ -00184d80: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -00184d90: 6f72 6474 7970 6522 3e76 6f69 643c 2f73 ordtype">void
    *process_re │ │ │ │ -00184db0: 7175 6573 7428 3c73 7061 6e20 636c 6173 quest( │ │ │ │ -00184dd0: 766f 6964 3c2f 7370 616e 3e20 2a74 736f void *tso │ │ │ │ -00184de0: 6170 2920 3c2f 6469 763e 0a3c 6469 7620 ap)
    .
    {.
    s │ │ │ │ -00184e30: 7472 7563 7420 3c2f 7370 616e 3e3c 6120 truct soap *soap = │ │ │ │ -00184ea0: 283c 7370 616e 2063 6c61 7373 3d22 6b65 (struct soap │ │ │ │ -00184ef0: 3c2f 613e 2a29 7473 6f61 703b 3c2f 6469 *)tsoap;.
    THRE │ │ │ │ -00184f70: 4144 5f44 4554 4143 483c 2f61 3e28 3c61 AD_DETACH(THREAD_ID │ │ │ │ -00184fe0: 293b 203c 2f64 6976 3e0a 3c64 6976 2063 );
    . │ │ │ │ -001850c0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    soap_p │ │ │ │ -00185130: 7269 6e74 5f66 6175 6c74 3c2f 613e 283c rint_fault(< │ │ │ │ -00185140: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -00185150: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ -00185160: 6874 6d6c 223e 736f 6170 3c2f 613e 2c20 html">soap, │ │ │ │ -00185170: 7374 6465 7272 293b 203c 2f64 6976 3e0a stderr);
    . │ │ │ │ -00185180: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    el │ │ │ │ -001851b0: 7365 3c2f 7370 616e 3e20 3c2f 6469 763e se
    │ │ │ │ -001851c0: 0a3c 6469 7620 636c 6173 733d 226c 696e ..< │ │ │ │ -00185270: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -00185280: 3e20 203c 6120 636c 6173 733d 2263 6f64 > soap_des │ │ │ │ -001852e0: 7472 6f79 3c2f 613e 283c 6120 636c 6173 troy( │ │ │ │ -00185310: 736f 6170 3c2f 613e 293b 203c 2f64 6976 soap);
    . │ │ │ │ -001853d0: 0a3c 6469 7620 636c 6173 733d 226c 696e .. │ │ │ │ -00185480: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    re │ │ │ │ -001854b0: 7475 726e 3c2f 7370 616e 3e20 4e55 4c4c turn NULL │ │ │ │ -001854c0: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
    .
    }.
    int soap_ssl_se │ │ │ │ -001855d0: 7276 6572 5f63 6f6e 7465 7874 2873 7472 rver_context(str │ │ │ │ -001855e0: 7563 7420 736f 6170 202a 736f 6170 2c20 uct soap *soap, │ │ │ │ -001855f0: 736f 6170 5f73 736c 5f66 6c61 6773 2066 soap_ssl_flags f │ │ │ │ -00185600: 6c61 6773 2c20 636f 6e73 7420 6368 6172 lags, const char │ │ │ │ -00185610: 202a 6b65 7966 696c 652c 2063 6f6e 7374 *keyfile, const │ │ │ │ -00185620: 2063 6861 7220 2a70 6173 7377 6f72 642c char *password, │ │ │ │ -00185630: 2063 6f6e 7374 2063 6861 7220 2a63 6166 const char *caf │ │ │ │ -00185640: 696c 652c 2063 6f6e 7374 2063 6861 7220 ile, const char │ │ │ │ -00185650: 2a63 6170 6174 682c 2063 6f6e 7374 2063 *capath, const c │ │ │ │ -00185660: 6861 7220 2a64 6866 696c 652c 2063 6f6e har *dhfile, con │ │ │ │ -00185670: 7374 2063 6861 7220 2a72 616e 6466 696c st char *randfil │ │ │ │ -00185680: 652c 2063 6f6e 7374 2063 6861 7220 2a73 e, const char *s │ │ │ │ -00185690: 6964 293c 2f64 6976 3e3c 6469 7620 636c id)
    Init │ │ │ │ -001856b0: 6961 6c69 7a65 2074 6865 2073 6572 7665 ialize the serve │ │ │ │ -001856c0: 722d 7369 6465 2053 534c 2f54 4c53 2063 r-side SSL/TLS c │ │ │ │ -001856d0: 6f6e 7465 7874 2e3c 2f64 6976 3e3c 2f64 ontext.
    .
    soa │ │ │ │ -00185790: 705f 7373 6c5f 696e 6974 3c2f 613e 3c2f p_ssl_init
    void soa │ │ │ │ -001857c0: 705f 7373 6c5f 696e 6974 2876 6f69 6429 p_ssl_init(void) │ │ │ │ -001857d0: 3c2f 6469 763e 3c64 6976 2063 6c61 7373
    Initial │ │ │ │ -001857f0: 697a 6520 7468 6520 5353 4c2f 544c 5320 ize the SSL/TLS │ │ │ │ -00185800: 6c69 6272 6172 792e 3c2f 6469 763e 3c2f library.
    ..
    │ │ │ │ -00185a90: 3c64 6976 2063 6c61 7373 3d22 7474 6465
    int CRYPTO_t │ │ │ │ -00185ab0: 6872 6561 645f 636c 6561 6e75 7028 293c hread_cleanup()< │ │ │ │ -00185ac0: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
    Cleanup │ │ │ │ -00185ae0: 6675 6e63 7469 6f6e 2066 6f72 204f 7065 function for Ope │ │ │ │ -00185af0: 6e53 534c 2076 6572 7369 6f6e 7320 7072 nSSL versions pr │ │ │ │ -00185b00: 696f 7220 746f 2031 2e31 2e31 2e3c 2f64 ior to 1.1.1.
    .
    < │ │ │ │ -00185b80: 6120 6872 6566 3d22 6772 6f75 705f 5f67 a href="group__g │ │ │ │ -00185b90: 726f 7570 5f5f 7373 6c2e 6874 6d6c 2367 roup__ssl.html#g │ │ │ │ -00185ba0: 6139 3930 3038 3365 6666 6135 6438 6564 a990083effa5d8ed │ │ │ │ -00185bb0: 3933 3166 6437 3564 6332 3633 3061 3263 931fd75dc2630a2c │ │ │ │ -00185bc0: 6322 3e73 6f61 705f 7373 6c5f 6163 6365 c">soap_ssl_acce │ │ │ │ -00185bd0: 7074 3c2f 613e 3c2f 6469 763e 3c64 6976 pt
    │ │ │ │ -00185bf0: 696e 7420 736f 6170 5f73 736c 5f61 6363 int soap_ssl_acc │ │ │ │ -00185c00: 6570 7428 7374 7275 6374 2073 6f61 7020 ept(struct soap │ │ │ │ -00185c10: 2a73 6f61 7029 3c2f 6469 763e 3c64 6976 *soap)
    A │ │ │ │ -00185c30: 6363 6570 7420 5353 4c2f 544c 5320 636f ccept SSL/TLS co │ │ │ │ -00185c40: 6e6e 6563 7469 6f6e 2e3c 2f64 6976 3e3c nnection.
    < │ │ │ │ -00185c50: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    │ │ │ │ -00185d30: 696e 7420 4352 5950 544f 5f74 6872 6561 int CRYPTO_threa │ │ │ │ -00185d40: 645f 7365 7475 7028 293c 2f64 6976 3e3c d_setup()
    < │ │ │ │ -00185d50: 6469 7620 636c 6173 733d 2274 7464 6f63 div class="ttdoc │ │ │ │ -00185d60: 223e 5365 7475 7020 6675 6e63 7469 6f6e ">Setup function │ │ │ │ -00185d70: 2066 6f72 204f 7065 6e53 534c 2076 6572 for OpenSSL ver │ │ │ │ -00185d80: 7369 6f6e 7320 7072 696f 7220 746f 2031 sions prior to 1 │ │ │ │ -00185d90: 2e31 2e31 2074 6f20 7365 7420 6c6f 636b .1.1 to set lock │ │ │ │ -00185da0: 7320 666f 7220 6d75 6c74 692d 7468 7265 s for multi-thre │ │ │ │ -00185db0: 6164 6564 2053 534c 2f54 4c53 2061 7070 aded SSL/TLS app │ │ │ │ -00185dc0: 6c69 6361 7469 6f2e 2e2e 3c2f 6469 763e licatio...
    │ │ │ │ -00185dd0: 3c2f 6469 763e 0a3c 2f64 6976 3e3c 212d
    .

    The so │ │ │ │ -00185e80: 6170 5f73 736c 5f73 6572 7665 725f 636f ap_ssl_server_co │ │ │ │ -00185e90: 6e74 6578 743c 2f61 3e3c 2f63 6f64 653e ntext │ │ │ │ -00185ea0: 2066 756e 6374 696f 6e20 696e 6974 6961 function initia │ │ │ │ -00185eb0: 6c69 7a65 7320 7468 6520 7365 7276 6572 lizes the server │ │ │ │ -00185ec0: 2d73 6964 6520 5353 4c20 636f 6e74 6578 -side SSL contex │ │ │ │ -00185ed0: 742e 2054 6865 203c 656d 3e3c 636f 6465 t. The server.pem key file │ │ │ │ -00185f00: 2069 7320 7468 6520 7365 7276 6572 2773 is the server's │ │ │ │ -00185f10: 2070 7269 7661 7465 206b 6579 2063 6f6e private key con │ │ │ │ -00185f20: 6361 7465 6e61 7465 6420 7769 7468 2069 catenated with i │ │ │ │ -00185f30: 7473 2063 6572 7469 6669 6361 7465 2e20 ts certificate. │ │ │ │ -00185f40: 5468 6520 3c65 6d3e 3c63 6f64 653e 6361 The ca │ │ │ │ -00185f50: 6365 7274 2e70 656d 3c2f 636f 6465 3e3c cert.pem< │ │ │ │ -00185f60: 2f65 6d3e 2069 7320 7573 6564 2074 6f20 /em> is used to │ │ │ │ -00185f70: 6175 7468 656e 7469 6361 7465 2063 6c69 authenticate cli │ │ │ │ -00185f80: 656e 7473 2061 6e64 2063 6f6e 7461 696e ents and contain │ │ │ │ -00185f90: 7320 7468 6520 636c 6965 6e74 2063 6572 s the client cer │ │ │ │ -00185fa0: 7469 6669 6361 7465 732e 2041 6c74 6572 tificates. Alter │ │ │ │ -00185fb0: 6e61 7469 7665 6c79 2061 2064 6972 6563 natively a direc │ │ │ │ -00185fc0: 746f 7279 206e 616d 6520 6361 6e20 6265 tory name can be │ │ │ │ -00185fd0: 2073 7065 6369 6669 6564 2e20 5468 6973 specified. This │ │ │ │ -00185fe0: 2064 6972 6563 746f 7279 2069 7320 6173 directory is as │ │ │ │ -00185ff0: 7375 6d65 6420 746f 2063 6f6e 7461 696e sumed to contain │ │ │ │ -00186000: 2074 6865 2063 6572 7469 6669 6361 7465 the certificate │ │ │ │ -00186010: 732e 2054 6865 203c 656d 3e3c 636f 6465 s. The dh512.pem file spec │ │ │ │ -00186040: 6966 6965 7320 7468 6174 2044 4820 7769 ifies that DH wi │ │ │ │ -00186050: 6c6c 2062 6520 7573 6564 2066 6f72 206b ll be used for k │ │ │ │ -00186060: 6579 2061 6772 6565 6d65 6e74 2069 6e73 ey agreement ins │ │ │ │ -00186070: 7465 6164 206f 6620 5253 412e 2041 206e tead of RSA. A n │ │ │ │ -00186080: 756d 6572 6963 2076 616c 7565 2067 7265 umeric value gre │ │ │ │ -00186090: 6174 6572 2074 6861 6e20 3531 3220 6361 ater than 512 ca │ │ │ │ -001860a0: 6e20 6265 2070 726f 7669 6465 6420 696e n be provided in │ │ │ │ -001860b0: 7374 6561 6420 6173 2061 2073 7472 696e stead as a strin │ │ │ │ -001860c0: 6720 636f 6e73 7461 6e74 2028 652e 672e g constant (e.g. │ │ │ │ -001860d0: 203c 636f 6465 3e22 3531 3222 3c2f 636f "512") to allow th │ │ │ │ -001860f0: 6520 656e 6769 6e65 2074 6f20 6765 6e65 e engine to gene │ │ │ │ -00186100: 7261 7465 2074 6865 2044 4820 7061 7261 rate the DH para │ │ │ │ -00186110: 6d65 7465 7273 206f 6e20 7468 6520 666c meters on the fl │ │ │ │ -00186120: 7920 2874 6869 7320 6361 6e20 7461 6b65 y (this can take │ │ │ │ -00186130: 2061 2077 6869 6c65 2920 7261 7468 6572 a while) rather │ │ │ │ -00186140: 2074 6861 6e20 7265 7472 6965 7669 6e67 than retrieving │ │ │ │ -00186150: 2074 6865 6d20 6672 6f6d 2061 2066 696c them from a fil │ │ │ │ -00186160: 652e 2054 6865 2072 616e 6466 696c 6520 e. The randfile │ │ │ │ -00186170: 656e 7472 7920 6361 6e20 6265 2075 7365 entry can be use │ │ │ │ -00186180: 6420 746f 2073 6565 6420 7468 6520 5052 d to seed the PR │ │ │ │ -00186190: 4e47 2e20 5468 6520 6c61 7374 2065 6e74 NG. The last ent │ │ │ │ -001861a0: 7279 2065 6e61 626c 6520 7365 7276 6572 ry enable server │ │ │ │ -001861b0: 2d73 6964 6520 7365 7373 696f 6e20 6361 -side session ca │ │ │ │ -001861c0: 6368 696e 6720 746f 2073 7065 6564 2075 ching to speed u │ │ │ │ -001861d0: 7020 544c 532e 2041 2075 6e69 7175 6520 p TLS. A unique │ │ │ │ -001861e0: 7365 7276 6572 206e 616d 6520 6973 2072 server name is r │ │ │ │ -001861f0: 6571 7569 7265 642e 3c2f 703e 0a3c 703e equired.

    .

    │ │ │ │ -00186200: 596f 7520 6361 6e20 7370 6563 6966 7920 You can specify │ │ │ │ -00186210: 6120 6369 7068 6572 206c 6973 7420 746f a cipher list to │ │ │ │ -00186220: 2075 7365 2077 6974 6820 544c 5376 312e use with TLSv1. │ │ │ │ -00186230: 3220 616e 6420 6265 6c6f 7720 7769 7468 2 and below with │ │ │ │ -00186240: 203c 636f 6465 3e53 534c 5f43 5458 5f73 SSL_CTX_s │ │ │ │ -00186250: 6574 5f63 6970 6865 725f 6c69 7374 2873 et_cipher_list(s │ │ │ │ -00186260: 6f61 702d 2667 743b 6374 782c 2022 2e2e oap->ctx, ".. │ │ │ │ -00186270: 2e22 293c 2f63 6f64 653e 2077 6865 7265 .") where │ │ │ │ -00186280: 203c 636f 6465 3e73 6f61 702d 2667 743b soap-> │ │ │ │ -00186290: 6374 783c 2f63 6f64 653e 2069 7320 7468 ctx is th │ │ │ │ -001862a0: 6520 5353 4c20 636f 6e74 6578 7420 6372 e SSL context cr │ │ │ │ -001862b0: 6561 7465 6420 6279 203c 636f 6465 3e3c eated by < │ │ │ │ -001862c0: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ -001862d0: 663d 2267 726f 7570 5f5f 6772 6f75 705f f="group__group_ │ │ │ │ -001862e0: 5f73 736c 2e68 746d 6c23 6761 3334 3932 _ssl.html#ga3492 │ │ │ │ -001862f0: 3436 3563 6464 3861 6137 3166 6537 3436 465cdd8aa71fe746 │ │ │ │ -00186300: 3139 3964 3338 3432 6361 6337 2220 7469 199d3842cac7" ti │ │ │ │ -00186310: 746c 653d 2249 6e69 7469 616c 697a 6520 tle="Initialize │ │ │ │ -00186320: 7468 6520 7365 7276 6572 2d73 6964 6520 the server-side │ │ │ │ -00186330: 5353 4c2f 544c 5320 636f 6e74 6578 742e SSL/TLS context. │ │ │ │ -00186340: 223e 736f 6170 5f73 736c 5f73 6572 7665 ">soap_ssl_serve │ │ │ │ -00186350: 725f 636f 6e74 6578 7428 293c 2f61 3e3c r_context()< │ │ │ │ -00186360: 2f63 6f64 653e 2e20 4c69 6b65 7769 7365 /code>. Likewise │ │ │ │ -00186370: 2c20 7573 6520 3c63 6f64 653e 5353 4c5f , use SSL_ │ │ │ │ -00186380: 4354 585f 7365 745f 6369 7068 6572 7375 CTX_set_ciphersu │ │ │ │ -00186390: 6974 6573 2873 6f61 702d 2667 743b 6374 ites(soap->ct │ │ │ │ -001863a0: 782c 2022 2e2e 2e22 293c 2f63 6f64 653e x, "...") │ │ │ │ -001863b0: 2074 6f20 636f 6e66 6967 7572 6520 7468 to configure th │ │ │ │ -001863c0: 6520 6176 6169 6c61 626c 6520 544c 5376 e available TLSv │ │ │ │ -001863d0: 312e 3320 6369 7068 6572 7375 6974 6573 1.3 ciphersuites │ │ │ │ -001863e0: 2e3c 2f70 3e0a 3c70 3e57 6520 7265 6665 .

    .

    We refe │ │ │ │ -001863f0: 7220 746f 2074 6865 204f 7065 6e53 534c r to the OpenSSL │ │ │ │ -00186400: 2064 6f63 756d 656e 7461 7469 6f6e 2061 documentation a │ │ │ │ -00186410: 6e64 206d 616e 7561 6c20 7061 6765 7320 nd manual pages │ │ │ │ -00186420: 6f66 203c 636f 6465 3e53 534c 5f43 5458 of SSL_CTX │ │ │ │ -00186430: 5f73 6574 5f63 6970 6865 725f 6c69 7374 _set_cipher_list │ │ │ │ -00186440: 3c2f 636f 6465 3e20 616e 6420 3c63 6f64 and SSL_CTX_set_ci │ │ │ │ -00186460: 7068 6572 7375 6974 6573 3c2f 636f 6465 phersuites for details on │ │ │ │ -00186480: 2074 6865 206c 6174 6573 7420 6369 7068 the latest ciph │ │ │ │ -00186490: 6572 206c 6973 7473 2061 6e64 2073 7569 er lists and sui │ │ │ │ -001864a0: 7465 7320 6176 6169 6c61 626c 6520 746f tes available to │ │ │ │ -001864b0: 2075 7365 2e3c 2f70 3e0a 3c70 3e54 6865 use.

    .

    The │ │ │ │ -001864c0: 2047 4e55 544c 5320 6d75 7465 7820 6c6f GNUTLS mutex lo │ │ │ │ -001864d0: 636b 2073 6574 7570 2069 7320 6175 746f ck setup is auto │ │ │ │ -001864e0: 6d61 7469 6361 6c6c 7920 7065 7266 6f72 matically perfor │ │ │ │ -001864f0: 6d65 6420 696e 2074 6865 2065 6e67 696e med in the engin │ │ │ │ -00186500: 652c 2062 7574 206f 6e6c 7920 7768 656e e, but only when │ │ │ │ -00186510: 2050 4f53 4958 2074 6872 6561 6473 2061 POSIX threads a │ │ │ │ -00186520: 7265 2064 6574 6563 7465 6420 616e 6420 re detected and │ │ │ │ -00186530: 6176 6169 6c61 626c 652e 3c2f 703e 0a3c available.

    .< │ │ │ │ -00186540: 703e 416c 6c20 4f70 656e 5353 4c20 7665 p>All OpenSSL ve │ │ │ │ -00186550: 7273 696f 6e73 2070 7269 6f72 2074 6f20 rsions prior to │ │ │ │ -00186560: 312e 312e 3020 7265 7175 6972 6520 6d75 1.1.0 require mu │ │ │ │ -00186570: 7465 7820 6c6f 636b 7320 746f 2062 6520 tex locks to be │ │ │ │ -00186580: 6578 706c 6963 6974 6c79 2073 6574 2075 explicitly set u │ │ │ │ -00186590: 7020 696e 2079 6f75 7220 636f 6465 2066 p in your code f │ │ │ │ -001865a0: 6f72 206d 756c 7469 2d74 6872 6561 6465 or multi-threade │ │ │ │ -001865b0: 6420 6170 706c 6963 6174 696f 6e73 2062 d applications b │ │ │ │ -001865c0: 7920 6361 6c6c 696e 6720 3c63 6f64 653e y calling │ │ │ │ -001865d0: 3c61 2063 6c61 7373 3d22 656c 2220 6872 │ │ │ │ -00186690: 4352 5950 544f 5f74 6872 6561 645f 7365 CRYPTO_thread_se │ │ │ │ -001866a0: 7475 7028 293c 2f61 3e3c 2f63 6f64 653e tup() │ │ │ │ -001866b0: 2061 6e64 203c 636f 6465 3e3c 6120 636c and CRYPTO_t │ │ │ │ -00186750: 6872 6561 645f 636c 6561 6e75 7028 293c hread_cleanup()< │ │ │ │ -00186760: 2f61 3e3c 2f63 6f64 653e 2061 7320 7761 /a> as wa │ │ │ │ -00186770: 7320 7368 6f77 6e20 696e 2074 6865 2063 s shown in the c │ │ │ │ -00186780: 6f64 6520 6162 6f76 652e 204f 7065 6e53 ode above. OpenS │ │ │ │ -00186790: 534c 2031 2e31 2e30 2061 6e64 2067 7265 SL 1.1.0 and gre │ │ │ │ -001867a0: 6174 6572 2064 6f65 7320 6e6f 7420 7265 ater does not re │ │ │ │ -001867b0: 7175 6972 6520 7468 6573 6520 6c6f 636b quire these lock │ │ │ │ -001867c0: 7320 746f 2062 6520 7365 7420 7570 2e20 s to be set up. │ │ │ │ -001867d0: 4966 2079 6f75 2061 7265 206e 6f74 2073 If you are not s │ │ │ │ -001867e0: 7572 6520 7768 6963 6820 7665 7273 696f ure which versio │ │ │ │ -001867f0: 6e20 6f66 204f 7065 6e53 534c 2079 6f75 n of OpenSSL you │ │ │ │ -00186800: 206d 6179 2062 6520 7573 696e 6720 7769 may be using wi │ │ │ │ -00186810: 7468 2079 6f75 7220 6d75 6c74 692d 7468 th your multi-th │ │ │ │ -00186820: 7265 6164 6564 2061 7070 6c69 6361 7469 readed applicati │ │ │ │ -00186830: 6f6e 2c20 7468 656e 2073 6574 2075 7020 on, then set up │ │ │ │ -00186840: 7468 6520 6c6f 636b 732e 3c2f 703e 0a3c the locks.

    .< │ │ │ │ -00186850: 703e 466f 7220 556e 6978 2061 6e64 204c p>For Unix and L │ │ │ │ -00186860: 696e 7578 2c20 6d61 6b65 2073 7572 6520 inux, make sure │ │ │ │ -00186870: 796f 7520 6861 7665 2073 6967 6e61 6c20 you have signal │ │ │ │ -00186880: 6861 6e64 6c65 7273 2073 6574 2069 6e20 handlers set in │ │ │ │ -00186890: 796f 7572 2073 6572 7669 6365 2061 6e64 your service and │ │ │ │ -001868a0: 2f6f 7220 636c 6965 6e74 2061 7070 6c69 /or client appli │ │ │ │ -001868b0: 6361 7469 6f6e 7320 746f 2063 6174 6368 cations to catch │ │ │ │ -001868c0: 2062 726f 6b65 6e20 636f 6e6e 6563 7469 broken connecti │ │ │ │ -001868d0: 6f6e 7320 283c 636f 6465 3e53 4947 5049 ons (SIGPI │ │ │ │ -001868e0: 5045 3c2f 636f 6465 3e29 3a3c 2f70 3e0a PE):

    . │ │ │ │ -001868f0: 3c64 6976 2063 6c61 7373 3d22 6672 6167
    signal(S │ │ │ │ -00186920: 4947 5049 5045 2c20 7369 6770 6970 655f IGPIPE, sigpipe_ │ │ │ │ -00186930: 6861 6e64 6c65 293b 3c2f 6469 763e 0a3c handle);
    .< │ │ │ │ -00186940: 2f64 6976 3e3c 212d 2d20 6672 6167 6d65 /div>

    where, │ │ │ │ -00186960: 666f 7220 6578 616d 706c 653a 3c2f 703e for example:

    │ │ │ │ -00186970: 0a3c 6469 7620 636c 6173 733d 2266 7261 .
    void s │ │ │ │ -001869c0: 6967 7069 7065 5f68 616e 646c 6528 3c73 igpipe_handle(int x) { }
    . │ │ │ │ -00186a00: 3c2f 6469 763e 3c21 2d2d 2066 7261 676d

    By def │ │ │ │ -00186a20: 6175 6c74 2c20 636c 6965 6e74 7320 6172 ault, clients ar │ │ │ │ -00186a30: 6520 6e6f 7420 7265 7175 6972 6564 2074 e not required t │ │ │ │ -00186a40: 6f20 6175 7468 656e 7469 6361 7465 2e20 o authenticate. │ │ │ │ -00186a50: 546f 2072 6571 7569 7265 2063 6c69 656e To require clien │ │ │ │ -00186a60: 7420 6175 7468 656e 7469 6361 7469 6f6e t authentication │ │ │ │ -00186a70: 2075 7365 2074 6865 2066 6f6c 6c6f 7769 use the followi │ │ │ │ -00186a80: 6e67 3a3c 2f70 3e0a 3c64 6976 2063 6c61 ng:

    .
    .< │ │ │ │ -00186b80: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -00186b90: 3e20 2020 203c 6120 636c 6173 733d 2263 > SOAP_SSL_R │ │ │ │ -00186bf0: 4551 5549 5245 5f43 4c49 454e 545f 4155 EQUIRE_CLIENT_AU │ │ │ │ -00186c00: 5448 454e 5449 4341 5449 4f4e 3c2f 613e THENTICATION │ │ │ │ -00186c10: 2c20 3c2f 6469 763e 0a3c 6469 7620 636c ,
    .
    < │ │ │ │ -00186c30: 7370 616e 2063 6c61 7373 3d22 7374 7269 span class="stri │ │ │ │ -00186c40: 6e67 6c69 7465 7261 6c22 3e26 7175 6f74 ngliteral">" │ │ │ │ -00186c50: 3b73 6572 7665 722e 7065 6d26 7175 6f74 ;server.pem" │ │ │ │ -00186c60: 3b3c 2f73 7061 6e3e 2c20 3c2f 6469 763e ;,
    │ │ │ │ -00186c70: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    "passwor │ │ │ │ -00186cb0: 6426 7175 6f74 3b3c 2f73 7061 6e3e 2c20 d", │ │ │ │ -00186cc0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    "c │ │ │ │ -00186d00: 6163 6572 742e 7065 6d26 7175 6f74 3b3c acert.pem"< │ │ │ │ -00186d10: 2f73 7061 6e3e 2c20 3c2f 6469 763e 0a3c /span>,
    .< │ │ │ │ -00186d20: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -00186d30: 3e20 2020 204e 554c 4c2c 203c 2f64 6976 > NULL,
    .
    "dh512. │ │ │ │ -00186d80: 7065 6d26 7175 6f74 3b3c 2f73 7061 6e3e pem" │ │ │ │ -00186d90: 2c20 3c2f 6469 763e 0a3c 6469 7620 636c ,
    .
    N │ │ │ │ -00186db0: 554c 4c2c 203c 2f64 6976 3e0a 3c64 6976 ULL,
    .
    │ │ │ │ -00186dd0: 2020 4e55 4c4c 2929 203c 2f64 6976 3e0a NULL))
    . │ │ │ │ -00186de0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    {
    .
    soap_print_faul │ │ │ │ -00186e70: 743c 2f61 3e28 2661 6d70 3b3c 6120 636c t(&soap, stde │ │ │ │ -00186eb0: 7272 293b 203c 2f64 6976 3e0a 3c64 6976 rr);
    .
    │ │ │ │ -00186ed0: 6578 6974 2845 5849 545f 4641 494c 5552 exit(EXIT_FAILUR │ │ │ │ -00186ee0: 4529 3b20 3c2f 6469 763e 0a3c 6469 7620 E);
    .
    }.
    #define SOAP_S │ │ │ │ -00187000: 534c 5f52 4551 5549 5245 5f43 4c49 454e SL_REQUIRE_CLIEN │ │ │ │ -00187010: 545f 4155 5448 454e 5449 4341 5449 4f4e T_AUTHENTICATION │ │ │ │ -00187020: 3c2f 6469 763e 3c64 6976 2063 6c61 7373
    soap_ss │ │ │ │ -00187040: 6c5f 666c 6167 7320 666c 6167 2066 6f72 l_flags flag for │ │ │ │ -00187050: 2073 6572 7665 7273 2074 6f20 7265 7175 servers to requ │ │ │ │ -00187060: 6972 6520 636c 6965 6e74 7320 746f 2061 ire clients to a │ │ │ │ -00187070: 7574 6865 6e74 6963 6174 6520 746f 2073 uthenticate to s │ │ │ │ -00187080: 6572 7665 7273 2064 7572 696e 6720 7468 ervers during th │ │ │ │ -00187090: 6520 4854 5450 5320 6861 6e64 7368 2e2e e HTTPS handsh.. │ │ │ │ -001870a0: 2e3c 2f64 6976 3e3c 6469 7620 636c 6173 .
    Def │ │ │ │ -001870c0: 696e 6974 696f 6e3a 3c2f 623e 2073 7464 inition: std │ │ │ │ -001870d0: 736f 6170 322e 683a 3538 3534 3c2f 6469 soap2.h:5854
    .
    < │ │ │ │ -001870f0: 212d 2d20 6672 6167 6d65 6e74 202d 2d3e !-- fragment --> │ │ │ │ -00187100: 3c70 3e54 6869 7320 7265 7175 6972 6573

    This requires │ │ │ │ -00187110: 2065 6163 6820 636c 6965 6e74 2074 6f20 each client to │ │ │ │ -00187120: 6175 7468 656e 7469 6361 7465 2077 6974 authenticate wit │ │ │ │ -00187130: 6820 6974 7320 6365 7274 6966 6963 6174 h its certificat │ │ │ │ -00187140: 652c 2069 6e20 6164 6469 7469 6f6e 2066 e, in addition f │ │ │ │ -00187150: 6f72 2074 6865 2073 6572 7665 7220 746f or the server to │ │ │ │ -00187160: 2061 7574 6865 6e74 6963 6174 6520 746f authenticate to │ │ │ │ -00187170: 2074 6865 2063 6c69 656e 742e 3c2f 703e the client.

    │ │ │ │ -00187180: 0a3c 703e 5369 6e63 6520 7265 6c65 6173 .

    Since releas │ │ │ │ -00187190: 6520 7665 7273 696f 6e20 322e 382e 3230 e version 2.8.20 │ │ │ │ -001871a0: 2c20 5353 4c20 7633 2069 7320 6469 7361 , SSL v3 is disa │ │ │ │ -001871b0: 626c 6564 2e20 546f 2065 6e61 626c 6520 bled. To enable │ │ │ │ -001871c0: 5353 4c20 7633 2074 6f67 6574 6865 7220 SSL v3 together │ │ │ │ -001871d0: 7769 7468 2054 4c53 2031 2e30 2061 6e64 with TLS 1.0 and │ │ │ │ -001871e0: 2068 6967 6865 722c 2075 7365 203c 636f higher, use #SOAP_SSLv3_T │ │ │ │ -00187200: 4c53 7631 3c2f 636f 6465 3e20 7769 7468 LSv1 with │ │ │ │ -00187210: 203c 636f 6465 3e3c 6120 636c 6173 733d soap_s │ │ │ │ -001872a0: 736c 5f73 6572 7665 725f 636f 6e74 6578 sl_server_contex │ │ │ │ -001872b0: 743c 2f61 3e3c 2f63 6f64 653e 2e20 546f t. To │ │ │ │ -001872c0: 2075 7365 2054 4c53 2031 2e31 2061 6e64 use TLS 1.1 and │ │ │ │ -001872d0: 2031 2e32 2075 7365 203c 636f 6465 3e53 1.2 use S │ │ │ │ -001872e0: 4f41 505f 544c 5376 315f 3120 7c20 534f OAP_TLSv1_1 | SO │ │ │ │ -001872f0: 4150 5f54 4c53 7631 5f32 3c2f 636f 6465 AP_TLSv1_2. To use TLS 1. │ │ │ │ -00187310: 3220 6f6e 6c79 2075 7365 203c 636f 6465 2 only use #SOAP_TLSv1_2. To use SS │ │ │ │ -00187340: 4c20 7633 206f 6e6c 7920 7573 6520 3c63 L v3 only use #SOAP_SSLv3< │ │ │ │ -00187360: 2f63 6f64 653e 2e3c 2f70 3e0a 3c70 3e54 /code>.

    .

    T │ │ │ │ -00187370: 6865 203c 636f 6465 3e63 6163 6572 743c he cacert< │ │ │ │ -00187380: 2f63 6f64 653e 2066 696c 6520 616e 6420 /code> file and │ │ │ │ -00187390: 3c63 6f64 653e 6361 7061 7468 3c2f 636f capath are optional │ │ │ │ -001873b0: 2e20 4569 7468 6572 206f 6e65 2063 616e . Either one can │ │ │ │ -001873c0: 2062 6520 7370 6563 6966 6965 6420 7768 be specified wh │ │ │ │ -001873d0: 656e 2063 6c69 656e 7473 206d 7573 7420 en clients must │ │ │ │ -001873e0: 7275 6e20 6f6e 206e 6f6e 2d74 7275 7374 run on non-trust │ │ │ │ -001873f0: 6564 2073 7973 7465 6d73 2028 3c63 6f64 ed systems (capath │ │ │ │ -00187410: 6973 206e 6f74 2075 7365 6420 7769 7468 is not used with │ │ │ │ -00187420: 2047 4e55 544c 5329 2e20 5765 2077 616e GNUTLS). We wan │ │ │ │ -00187430: 7420 746f 2061 766f 6964 2073 746f 7269 t to avoid stori │ │ │ │ -00187440: 6e67 2074 7275 7374 6564 2063 6572 7469 ng trusted certi │ │ │ │ -00187450: 6669 6361 7465 7320 696e 2074 6865 2064 ficates in the d │ │ │ │ -00187460: 6566 6175 6c74 206c 6f63 6174 696f 6e20 efault location │ │ │ │ -00187470: 6f6e 2074 6865 2066 696c 6520 7379 7374 on the file syst │ │ │ │ -00187480: 656d 2077 6865 6e20 7468 6174 2069 7320 em when that is │ │ │ │ -00187490: 6e6f 7420 7365 6375 7265 2e20 5468 6572 not secure. Ther │ │ │ │ -001874a0: 6566 6f72 652c 2061 2066 6c61 7420 3c65 efore, a flat cacert.p │ │ │ │ -001874c0: 656d 3c2f 636f 6465 3e3c 2f65 6d3e 2066 em f │ │ │ │ -001874d0: 696c 6520 6f72 2064 6972 6563 746f 7279 ile or directory │ │ │ │ -001874e0: 2063 616e 2062 6520 7370 6563 6966 6965 can be specifie │ │ │ │ -001874f0: 6420 746f 2073 746f 7265 2074 7275 7374 d to store trust │ │ │ │ -00187500: 6564 2063 6572 7469 6669 6361 7465 732e ed certificates. │ │ │ │ -00187510: 3c2f 703e 0a3c 703e 5468 6520 6753 4f41

    .

    The gSOA │ │ │ │ -00187520: 5020 7061 636b 6167 6520 696e 636c 7564 P package includ │ │ │ │ -00187530: 6573 2061 203c 656d 3e3c 636f 6465 3e63 es a c │ │ │ │ -00187540: 6163 6572 7473 2e70 656d 3c2f 636f 6465 acerts.pem file with │ │ │ │ -00187560: 2074 6865 2063 6572 7469 6669 6361 7465 the certificate │ │ │ │ -00187570: 7320 6f66 2061 6c6c 2063 6572 7469 6669 s of all certifi │ │ │ │ -00187580: 6361 7465 2061 7574 686f 7269 7469 6573 cate authorities │ │ │ │ -00187590: 2e20 596f 7520 6361 6e20 7573 6520 7468 . You can use th │ │ │ │ -001875a0: 6973 2066 696c 6520 746f 2076 6572 6966 is file to verif │ │ │ │ -001875b0: 7920 7468 6520 6175 7468 656e 7469 6361 y the authentica │ │ │ │ -001875c0: 7469 6f6e 206f 6620 7365 7276 6572 7320 tion of servers │ │ │ │ -001875d0: 7468 6174 2070 726f 7669 6465 2063 6572 that provide cer │ │ │ │ -001875e0: 7469 6669 6361 7465 7320 6973 7375 6564 tificates issued │ │ │ │ -001875f0: 2062 7920 7468 6573 6520 4341 732e 3c2f by these CAs..

    The cacert.pem, │ │ │ │ -00187630: 3c63 6f64 653e 636c 6965 6e74 2e70 656d client.pem │ │ │ │ -00187640: 3c2f 636f 6465 3e3c 2f65 6d3e 2c20 616e , an │ │ │ │ -00187650: 6420 3c65 6d3e 3c63 6f64 653e 7365 7276 d serv │ │ │ │ -00187660: 6572 2e70 656d 3c2f 636f 6465 3e3c 2f65 er.pem files in the │ │ │ │ -00187680: 6753 4f41 5020 7061 636b 6167 6520 6172 gSOAP package ar │ │ │ │ -00187690: 6520 6578 616d 706c 6573 206f 6620 7365 e examples of se │ │ │ │ -001876a0: 6c66 2d73 6967 6e65 6420 6365 7274 6966 lf-signed certif │ │ │ │ -001876b0: 6963 6174 6573 2e20 5468 6520 3c65 6d3e icates. The │ │ │ │ -001876c0: 3c63 6f64 653e 636c 6965 6e74 2e70 656d client.pem │ │ │ │ -001876d0: 3c2f 636f 6465 3e3c 2f65 6d3e 2061 6e64 and │ │ │ │ -001876e0: 203c 656d 3e3c 636f 6465 3e73 6572 7665 serve │ │ │ │ -001876f0: 722e 7065 6d3c 2f63 6f64 653e 3c2f 656d r.pem contain the cl │ │ │ │ -00187710: 6965 6e74 2f73 6572 7665 7220 7072 6976 ient/server priv │ │ │ │ -00187720: 6174 6520 6b65 7920 636f 6e63 6174 656e ate key concaten │ │ │ │ -00187730: 6174 6564 2077 6974 6820 7468 6520 6365 ated with the ce │ │ │ │ -00187740: 7274 6966 6963 6174 652e 2054 6865 206b rtificate. The k │ │ │ │ -00187750: 6579 6669 6c65 7320 283c 656d 3e3c 636f eyfiles (client.pem and server.p │ │ │ │ -00187790: 656d 3c2f 636f 6465 3e3c 2f65 6d3e 2920 em) │ │ │ │ -001877a0: 6172 6520 6372 6561 7465 6420 6279 2063 are created by c │ │ │ │ -001877b0: 6f6e 6361 7465 6e61 7469 6e67 2074 6865 oncatenating the │ │ │ │ -001877c0: 2070 7269 7661 7465 206b 6579 2050 454d private key PEM │ │ │ │ -001877d0: 2077 6974 6820 7468 6520 6365 7274 6966 with the certif │ │ │ │ -001877e0: 6963 6174 6520 5045 4d2e 2054 6865 206b icate PEM. The k │ │ │ │ -001877f0: 6579 6669 6c65 2073 686f 756c 6420 6e6f eyfile should no │ │ │ │ -00187800: 7420 6265 2073 6861 7265 6420 7769 7468 t be shared with │ │ │ │ -00187810: 2061 6e79 2070 6172 7479 2e20 5769 7468 any party. With │ │ │ │ -00187820: 204f 7065 6e53 534c 2c20 796f 7520 6361 OpenSSL, you ca │ │ │ │ -00187830: 6e20 656e 6372 7970 7420 7468 6520 6b65 n encrypt the ke │ │ │ │ -00187840: 7966 696c 6573 2077 6974 6820 6120 7061 yfiles with a pa │ │ │ │ -00187850: 7373 776f 7264 2074 6f20 6f66 6665 7220 ssword to offer │ │ │ │ -00187860: 736f 6d65 2070 726f 7465 6374 696f 6e20 some protection │ │ │ │ -00187870: 616e 6420 7468 6520 7061 7373 776f 7264 and the password │ │ │ │ -00187880: 2069 7320 7573 6564 2069 6e20 7468 6520 is used in the │ │ │ │ -00187890: 636c 6965 6e74 2f73 6572 7665 7220 636f client/server co │ │ │ │ -001878a0: 6465 2074 6f20 7265 6164 2074 6865 206b de to read the k │ │ │ │ -001878b0: 6579 6669 6c65 2e20 474e 5554 4c53 2064 eyfile. GNUTLS d │ │ │ │ -001878c0: 6f65 7320 6e6f 7420 7375 7070 6f72 7420 oes not support │ │ │ │ -001878d0: 7468 6973 2066 6561 7475 7265 2061 6e64 this feature and │ │ │ │ -001878e0: 2063 616e 6e6f 7420 656e 6372 7970 7420 cannot encrypt │ │ │ │ -001878f0: 6f72 2064 6563 7279 7074 2061 206b 6579 or decrypt a key │ │ │ │ -00187900: 6669 6c65 2e3c 2f70 3e0a 3c64 6c20 636c file.

    .
    Warnin │ │ │ │ -00187930: 673c 2f64 743e 3c64 643e 4974 2069 7320 g
    It is │ │ │ │ -00187940: 696d 706f 7274 616e 7420 7468 6174 2074 important that t │ │ │ │ -00187950: 6865 203c 636f 6465 3e23 5749 5448 5f4f he #WITH_O │ │ │ │ -00187960: 5045 4e53 534c 3c2f 636f 6465 3e20 6d61 PENSSL ma │ │ │ │ -00187970: 6372 6f20 6d75 7374 2062 6520 636f 6e73 cro must be cons │ │ │ │ -00187980: 6973 7465 6e74 6c79 2064 6566 696e 6564 istently defined │ │ │ │ -00187990: 2074 6f20 636f 6d70 696c 6520 7468 6520 to compile the │ │ │ │ -001879a0: 736f 7572 6365 732c 2073 7563 6820 6173 sources, such as │ │ │ │ -001879b0: 203c 656d 3e3c 636f 6465 3e67 736f 6170 gsoap │ │ │ │ -001879c0: 2f73 7464 736f 6170 322e 6370 703c 2f63 /stdsoap2.cpp, < │ │ │ │ -001879e0: 636f 6465 3e73 6f61 7043 2e63 7070 3c2f code>soapC.cpp, │ │ │ │ -00187a00: 3c63 6f64 653e 736f 6170 436c 6965 6e74 soapClient │ │ │ │ -00187a10: 2e63 7070 3c2f 636f 6465 3e3c 2f65 6d3e .cpp │ │ │ │ -00187a20: 2c20 3c65 6d3e 3c63 6f64 653e 736f 6170 , soap │ │ │ │ -00187a30: 5365 7276 6572 2e63 7070 3c2f 636f 6465 Server.cpp, and all │ │ │ │ -00187a50: 6170 706c 6963 6174 696f 6e20 736f 7572 application sour │ │ │ │ -00187a60: 6365 7320 7468 6174 2069 6e63 6c75 6465 ces that include │ │ │ │ -00187a70: 203c 656d 3e3c 636f 6465 3e67 736f 6170 gsoap │ │ │ │ -00187a80: 2f73 7464 736f 6170 322e 683c 2f63 6f64 /stdsoap2.h or < │ │ │ │ -00187aa0: 636f 6465 3e73 6f61 7048 2e68 3c2f 636f code>soapH.h. If the │ │ │ │ -00187ac0: 206d 6163 726f 7320 6172 6520 6e6f 7420 macros are not │ │ │ │ -00187ad0: 636f 6e73 6973 7465 6e74 6c79 2075 7365 consistently use │ │ │ │ -00187ae0: 642c 2074 6865 2061 7070 6c69 6361 7469 d, the applicati │ │ │ │ -00187af0: 6f6e 2077 696c 6c20 6372 6173 6820 6475 on will crash du │ │ │ │ -00187b00: 6520 746f 2061 206d 6973 6d61 7463 6865 e to a mismatche │ │ │ │ -00187b10: 7320 696e 2074 6865 2064 6563 6c61 7261 s in the declara │ │ │ │ -00187b20: 7469 6f6e 2061 6e64 2061 6363 6573 7320 tion and access │ │ │ │ -00187b30: 6f66 2074 6865 203c 636f 6465 3e3c 6120 of the soap context │ │ │ │ -00187ba0: 2e3c 2f64 643e 3c2f 646c 3e0a 3c70 3e53 .
    .

    S │ │ │ │ -00187bb0: 6565 2061 6c73 6f20 4150 4920 646f 6375 ee also API docu │ │ │ │ -00187bc0: 6d65 6e74 6174 696f 6e20 4d6f 6475 6c65 mentation Module │ │ │ │ -00187bd0: 203c 6120 636c 6173 733d 2265 6c22 2068 SSL │ │ │ │ -00187c00: 2f54 4c53 2063 6f6e 7465 7874 2061 6e64 /TLS context and │ │ │ │ -00187c10: 2066 756e 6374 696f 6e73 3c2f 613e 2066 functions f │ │ │ │ -00187c20: 6f72 206d 6f72 6520 6465 7461 696c 7320 or more details │ │ │ │ -00187c30: 6f6e 2074 6865 2053 534c 2f54 4c53 2066 on the SSL/TLS f │ │ │ │ -00187c40: 756e 6374 696f 6e73 2e3c 2f70 3e0a 3c70 unctions.

    .

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

    .Secure clients │ │ │ │ -00187cc0: 2077 6974 6820 4854 5450 533c 2f68 323e with HTTPS

    │ │ │ │ -00187cd0: 0a3c 703e 546f 2075 7469 6c69 7a65 2048 .

    To utilize H │ │ │ │ -00187ce0: 5454 5053 2f53 534c 2c20 796f 7520 6e65 TTPS/SSL, you ne │ │ │ │ -00187cf0: 6564 2074 6f20 696e 7374 616c 6c20 7468 ed to install th │ │ │ │ -00187d00: 6520 4f70 656e 5353 4c20 6c69 6272 6172 e OpenSSL librar │ │ │ │ -00187d10: 7920 6f6e 2079 6f75 7220 706c 6174 666f y on your platfo │ │ │ │ -00187d20: 726d 206f 7220 474e 5554 4c53 2066 6f72 rm or GNUTLS for │ │ │ │ -00187d30: 2061 206c 6967 6874 2d77 6569 6768 7420 a light-weight │ │ │ │ -00187d40: 5353 4c2f 544c 5320 6c69 6272 6172 792e SSL/TLS library. │ │ │ │ -00187d50: 2041 6674 6572 2069 6e73 7461 6c6c 6174 After installat │ │ │ │ -00187d60: 696f 6e2c 2063 6f6d 7069 6c65 2061 6c6c ion, compile all │ │ │ │ -00187d70: 2074 6865 2073 6f75 7263 6573 206f 6620 the sources of │ │ │ │ -00187d80: 796f 7572 2061 7070 6c69 6361 7469 6f6e your application │ │ │ │ -00187d90: 2077 6974 6820 636f 6d70 696c 652d 7469 with compile-ti │ │ │ │ -00187da0: 6d65 2066 6c61 6720 3c63 6f64 653e 2357 me flag #W │ │ │ │ -00187db0: 4954 485f 4f50 454e 5353 4c3c 2f63 6f64 ITH_OPENSSL (or #WI │ │ │ │ -00187dd0: 5448 5f47 4e55 544c 533c 2f63 6f64 653e TH_GNUTLS │ │ │ │ -00187de0: 2077 6865 6e20 7573 696e 6720 474e 5554 when using GNUT │ │ │ │ -00187df0: 4c53 292e 2046 6f72 2065 7861 6d70 6c65 LS). For example │ │ │ │ -00187e00: 206f 6e20 4c69 6e75 783a 203c 2f70 3e3c on Linux:

    < │ │ │ │ -00187e10: 7072 6520 636c 6173 733d 2266 7261 676d pre class="fragm │ │ │ │ -00187e20: 656e 7422 3e20 632b 2b20 2d44 5749 5448 ent"> c++ -DWITH │ │ │ │ -00187e30: 5f4f 5045 4e53 534c 206d 7963 6c69 656e _OPENSSL myclien │ │ │ │ -00187e40: 742e 6370 7020 7374 6473 6f61 702e 6370 t.cpp stdsoap.cp │ │ │ │ -00187e50: 7020 736f 6170 432e 6370 7020 736f 6170 p soapC.cpp soap │ │ │ │ -00187e60: 436c 6965 6e74 2e63 7070 202d 6c73 736c Client.cpp -lssl │ │ │ │ -00187e70: 202d 6c63 7279 7074 6f0a 3c2f 7072 653e -lcrypto.
    │ │ │ │ -00187e80: 3c70 3e20 6f72 2055 6e69 783a 203c 2f70

    or Unix:

     c++ -DWI
    │ │ │ │ -00187eb0: 5448 5f4f 5045 4e53 534c 206d 7963 6c69  TH_OPENSSL mycli
    │ │ │ │ -00187ec0: 656e 742e 6370 7020 7374 6473 6f61 702e  ent.cpp stdsoap.
    │ │ │ │ -00187ed0: 6370 7020 736f 6170 432e 6370 7020 736f  cpp soapC.cpp so
    │ │ │ │ -00187ee0: 6170 436c 6965 6e74 2e63 7070 202d 6c78  apClient.cpp -lx
    │ │ │ │ -00187ef0: 6e65 7420 2d6c 736f 636b 6574 202d 6c6e  net -lsocket -ln
    │ │ │ │ -00187f00: 736c 202d 6c73 736c 202d 6c63 7279 7074  sl -lssl -lcrypt
    │ │ │ │ -00187f10: 6f0a 3c2f 7072 653e 3c70 3e20 6f72 2079  o.

    or y │ │ │ │ -00187f20: 6f75 2063 616e 2061 6464 2074 6865 2066 ou can add the f │ │ │ │ -00187f30: 6f6c 6c6f 7769 6e67 206c 696e 6520 746f ollowing line to │ │ │ │ -00187f40: 203c 656d 3e3c 636f 6465 3e73 6f61 7064 soapd │ │ │ │ -00187f50: 6566 732e 683c 2f63 6f64 653e 3c2f 656d efs.h:

    .
    < │ │ │ │ -00187f90: 7370 616e 2063 6c61 7373 3d22 7072 6570 span class="prep │ │ │ │ -00187fa0: 726f 6365 7373 6f72 223e 2364 6566 696e rocessor">#defin │ │ │ │ -00187fb0: 6520 5749 5448 5f4f 5045 4e53 534c 3c2f e WITH_OPENSSL
    .

    and compil │ │ │ │ -00187ff0: 6520 7769 7468 2063 6f6d 7069 6c65 2d74 e with compile-t │ │ │ │ -00188000: 696d 6520 666c 6167 203c 636f 6465 3e23 ime flag # │ │ │ │ -00188010: 5749 5448 5f53 4f41 5044 4546 535f 483c WITH_SOAPDEFS_H< │ │ │ │ -00188020: 2f63 6f64 653e 2074 6f20 696e 636c 7564 /code> to includ │ │ │ │ -00188030: 6520 3c65 6d3e 3c63 6f64 653e 736f 6170 e soap │ │ │ │ -00188040: 6465 6673 2e68 3c2f 636f 6465 3e3c 2f65 defs.h in your proje │ │ │ │ -00188060: 6374 2e20 416c 7465 726e 6174 6976 656c ct. Alternativel │ │ │ │ -00188070: 792c 2063 6f6d 7069 6c65 2077 6974 6820 y, compile with │ │ │ │ -00188080: 474e 5554 4c53 3a20 3c2f 703e 3c70 7265 GNUTLS:

     c++ -DWITH_GN
    │ │ │ │ -001880b0: 5554 4c53 206d 7963 6c69 656e 742e 6370  UTLS myclient.cp
    │ │ │ │ -001880c0: 7020 7374 6473 6f61 702e 6370 7020 736f  p stdsoap.cpp so
    │ │ │ │ -001880d0: 6170 432e 6370 7020 736f 6170 436c 6965  apC.cpp soapClie
    │ │ │ │ -001880e0: 6e74 2e63 7070 202d 6c67 6e75 746c 7320  nt.cpp -lgnutls 
    │ │ │ │ -001880f0: 2d6c 6763 7279 7074 202d 6c67 7067 2d65  -lgcrypt -lgpg-e
    │ │ │ │ -00188100: 7272 6f72 0a3c 2f70 7265 3e3c 703e 4120  rror.

    A │ │ │ │ -00188110: 636c 6965 6e74 2070 726f 6772 616d 2073 client program s │ │ │ │ -00188120: 696d 706c 7920 7573 6573 2074 6865 2070 imply uses the p │ │ │ │ -00188130: 7265 6669 7820 3c65 6d3e 3c63 6f64 653e refix │ │ │ │ -00188140: 6874 7470 733a 3c2f 636f 6465 3e3c 2f65 https: instead of http: in the │ │ │ │ -00188180: 2065 6e64 706f 696e 7420 5552 4c20 6f66 endpoint URL of │ │ │ │ -00188190: 2061 2073 6572 7669 6365 206f 7065 7261 a service opera │ │ │ │ -001881a0: 7469 6f6e 2063 616c 6c20 746f 2061 2057 tion call to a W │ │ │ │ -001881b0: 6562 2053 6572 7669 6365 2074 6f20 7573 eb Service to us │ │ │ │ -001881c0: 6520 656e 6372 7970 7465 6420 7472 616e e encrypted tran │ │ │ │ -001881d0: 7366 6572 7320 2869 6620 7468 6520 7365 sfers (if the se │ │ │ │ -001881e0: 7276 6963 6520 7375 7070 6f72 7473 2048 rvice supports H │ │ │ │ -001881f0: 5454 5053 292e 2059 6f75 206e 6565 6420 TTPS). You need │ │ │ │ -00188200: 746f 2073 7065 6369 6679 2074 6865 2063 to specify the c │ │ │ │ -00188210: 6c69 656e 742d 7369 6465 206b 6579 2066 lient-side key f │ │ │ │ -00188220: 696c 6520 616e 6420 7061 7373 776f 7264 ile and password │ │ │ │ -00188230: 206f 6620 7468 6520 6b65 7966 696c 653a of the keyfile: │ │ │ │ -00188240: 3c2f 703e 0a3c 6469 7620 636c 6173 733d

    .
    struct soap │ │ │ │ -001882c0: 203c 6120 636c 6173 733d 2263 6f64 6522 soap │ │ │ │ -001882f0: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
    .
    soap_ │ │ │ │ -00188360: 7373 6c5f 696e 6974 3c2f 613e 2829 3b20 ssl_init(); │ │ │ │ -00188370: 3c73 7061 6e20 636c 6173 733d 2263 6f6d /* init Op │ │ │ │ -00188390: 656e 5353 4c20 2873 6b69 7070 696e 6720 enSSL (skipping │ │ │ │ -001883a0: 7468 6973 206f 7220 6361 6c6c 696e 6720 this or calling │ │ │ │ -001883b0: 6d75 6c74 6970 6c65 2074 696d 6573 2069 multiple times i │ │ │ │ -001883c0: 7320 4f4b 2c20 7369 6e63 6520 7468 6520 s OK, since the │ │ │ │ -001883d0: 656e 6769 6e65 2077 696c 6c20 696e 6974 engine will init │ │ │ │ -001883e0: 2053 534c 2061 7574 6f6d 6174 6963 616c SSL automatical │ │ │ │ -001883f0: 6c79 2920 2a2f 3c2f 7370 616e 3e3c 2f64 ly) */.
    /* s │ │ │ │ -00188430: 6f61 705f 7373 6c5f 6e6f 696e 6974 2829 oap_ssl_noinit() │ │ │ │ -00188440: 3b20 2a2f 3c2f 7370 616e 3e20 3c73 7061 ; */ /* do not init │ │ │ │ -00188470: 204f 7065 6e53 534c 2028 6966 2053 534c OpenSSL (if SSL │ │ │ │ -00188480: 2069 7320 616c 7265 6164 7920 696e 6974 is already init │ │ │ │ -00188490: 6961 6c69 7a65 6420 656c 7365 7768 6572 ialized elsewher │ │ │ │ -001884a0: 6520 696e 2074 6869 7320 6170 706c 6963 e in this applic │ │ │ │ -001884b0: 6174 696f 6e29 202a 2f3c 2f73 7061 6e3e ation) */ │ │ │ │ -001884c0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    so │ │ │ │ -00188530: 6170 5f69 6e69 743c 2f61 3e28 2661 6d70 ap_init(& │ │ │ │ -00188540: 3b3c 6120 636c 6173 733d 2263 6f64 6522 ;soap │ │ │ │ -00188570: 293b 3c2f 6469 763e 0a3c 6469 7620 636c );
    .
    if ( │ │ │ │ -001885b0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap_ssl_client │ │ │ │ -00188610: 5f63 6f6e 7465 7874 3c2f 613e 2826 616d _context(&am │ │ │ │ -00188620: 703b 3c61 2063 6c61 7373 3d22 636f 6465 p;soap,
    ..
    │ │ │ │ -001886f0: 3c73 7061 6e20 636c 6173 733d 2273 7472 &quo │ │ │ │ -00188710: 743b 636c 6965 6e74 2e70 656d 2671 756f t;client.pem&quo │ │ │ │ -00188720: 743b 3c2f 7370 616e 3e2c 2020 2020 2020 t;, │ │ │ │ -00188730: 2020 3c73 7061 6e20 636c 6173 733d 2263 /* keyfi │ │ │ │ -00188750: 6c65 3a20 7265 7175 6972 6564 206f 6e6c le: required onl │ │ │ │ -00188760: 7920 7768 656e 2063 6c69 656e 7420 6d75 y when client mu │ │ │ │ -00188770: 7374 2061 7574 6865 6e74 6963 6174 6520 st authenticate │ │ │ │ -00188780: 746f 2073 6572 7665 7220 2873 6565 2053 to server (see S │ │ │ │ -00188790: 534c 2064 6f63 7320 6f6e 2068 6f77 2074 SL docs on how t │ │ │ │ -001887a0: 6f20 6f62 7461 696e 2074 6869 7320 6669 o obtain this fi │ │ │ │ -001887b0: 6c65 2920 2a2f 3c2f 7370 616e 3e20 3c2f le) */ .
    "passw │ │ │ │ -00188800: 6f72 6426 7175 6f74 3b3c 2f73 7061 6e3e ord" │ │ │ │ -00188810: 2c20 2020 2020 2020 2020 203c 7370 616e , /* password to │ │ │ │ -00188840: 7265 6164 2074 6865 206b 6579 2066 696c read the key fil │ │ │ │ -00188850: 6520 286e 6f74 2075 7365 6420 7769 7468 e (not used with │ │ │ │ -00188860: 2047 4e55 544c 5329 202a 2f3c 2f73 7061 GNUTLS) */
    .
    " │ │ │ │ -001888b0: 6361 6365 7274 732e 7065 6d26 7175 6f74 cacerts.pem" │ │ │ │ -001888c0: 3b3c 2f73 7061 6e3e 2c20 2020 2020 2020 ;, │ │ │ │ -001888d0: 3c73 7061 6e20 636c 6173 733d 2263 6f6d /* cacert │ │ │ │ -001888f0: 6669 6c65 2074 6f20 7374 6f72 6520 7472 file to store tr │ │ │ │ -00188900: 7573 7465 6420 6365 7274 6966 6963 6174 usted certificat │ │ │ │ -00188910: 6573 2028 6e65 6564 6564 2074 6f20 7665 es (needed to ve │ │ │ │ -00188920: 7269 6679 2073 6572 7665 7229 202a 2f3c rify server) */< │ │ │ │ -00188930: 2f73 7061 6e3e 203c 2f64 6976 3e0a 3c64 /span>
    . │ │ │ │ -00188950: 2020 4e55 4c4c 2c20 2020 2020 2020 2020 NULL, │ │ │ │ -00188960: 2020 2020 2020 203c 7370 616e 2063 6c61 /* │ │ │ │ -00188980: 6361 7061 7468 2074 6f20 6469 7265 6374 capath to direct │ │ │ │ -00188990: 6f72 7920 7769 7468 2074 7275 7374 6564 ory with trusted │ │ │ │ -001889a0: 2063 6572 7469 6669 6361 7465 7320 2a2f certificates */ │ │ │ │ -001889b0: 3c2f 7370 616e 3e20 3c2f 6469 763e 0a3c
    .< │ │ │ │ -001889c0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001889d0: 3e20 204e 554c 4c20 2020 2020 2020 2020 > NULL │ │ │ │ -001889e0: 3c73 7061 6e20 636c 6173 733d 2263 6f6d /* if rand │ │ │ │ -00188a00: 6669 6c65 213d 4e55 4c4c 3a20 7573 6520 file!=NULL: use │ │ │ │ -00188a10: 6120 6669 6c65 2077 6974 6820 7261 6e64 a file with rand │ │ │ │ -00188a20: 6f6d 2064 6174 6120 746f 2073 6565 6420 om data to seed │ │ │ │ -00188a30: 7261 6e64 6f6d 6e65 7373 202a 2f3c 2f73 randomness */
    .) │ │ │ │ -00188a60: 2920 3c2f 6469 763e 0a3c 6469 7620 636c )
    .
    {.
    soap_p │ │ │ │ -00188af0: 7269 6e74 5f66 6175 6c74 3c2f 613e 2826 rint_fault(& │ │ │ │ -00188b00: 616d 703b 3c61 2063 6c61 7373 3d22 636f amp;soap< │ │ │ │ -00188b30: 2f61 3e2c 2073 7464 6572 7229 3b20 3c2f /a>, stderr); .
    exit(EX │ │ │ │ -00188b60: 4954 5f46 4149 4c55 5245 293b 203c 2f64 IT_FAILURE); .
    }
    .< │ │ │ │ -00188b90: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -00188ba0: 3e73 6f61 705f 6361 6c6c 5f6e 735f 5f6d >soap_call_ns__m │ │ │ │ -00188bb0: 796d 6574 686f 6428 2661 6d70 3b3c 6120 ymethod(&
    soap, " │ │ │ │ -00188c10: 6874 7470 733a 2f2f 646f 6d61 696e 2f70 https://domain/p │ │ │ │ -00188c20: 6174 682f 7365 6375 7265 2e63 6769 2671 ath/secure.cgi&q │ │ │ │ -00188c30: 756f 743b 3c2f 7370 616e 3e2c 203c 7370 uot;, "& │ │ │ │ -00188c60: 7175 6f74 3b3c 2f73 7061 6e3e 2c20 2e2e quot;, .. │ │ │ │ -00188c70: 2e29 3b3c 2f64 6976 3e0a 3c64 6976 2063 .);
    .
    < │ │ │ │ -00188ce0: 6120 6872 6566 3d22 6772 6f75 705f 5f67 a href="group__g │ │ │ │ -00188cf0: 726f 7570 5f5f 7373 6c2e 6874 6d6c 2367 roup__ssl.html#g │ │ │ │ -00188d00: 6132 3639 6337 3733 3262 3163 6461 3964 a269c7732b1cda9d │ │ │ │ -00188d10: 6337 3964 6230 3866 6362 6631 6435 3433 c79db08fcbf1d543 │ │ │ │ -00188d20: 3822 3e73 6f61 705f 7373 6c5f 636c 6965 8">soap_ssl_clie │ │ │ │ -00188d30: 6e74 5f63 6f6e 7465 7874 3c2f 613e 3c2f nt_context
    int soap │ │ │ │ -00188d60: 5f73 736c 5f63 6c69 656e 745f 636f 6e74 _ssl_client_cont │ │ │ │ -00188d70: 6578 7428 7374 7275 6374 2073 6f61 7020 ext(struct soap │ │ │ │ -00188d80: 2a73 6f61 702c 2073 6f61 705f 7373 6c5f *soap, soap_ssl_ │ │ │ │ -00188d90: 666c 6167 7320 666c 6167 732c 2063 6f6e flags flags, con │ │ │ │ -00188da0: 7374 2063 6861 7220 2a6b 6579 6669 6c65 st char *keyfile │ │ │ │ -00188db0: 2c20 636f 6e73 7420 6368 6172 202a 7061 , const char *pa │ │ │ │ -00188dc0: 7373 776f 7264 2c20 636f 6e73 7420 6368 ssword, const ch │ │ │ │ -00188dd0: 6172 202a 6361 6669 6c65 2c20 636f 6e73 ar *cafile, cons │ │ │ │ -00188de0: 7420 6368 6172 202a 6361 7061 7468 2c20 t char *capath, │ │ │ │ -00188df0: 636f 6e73 7420 6368 6172 202a 7261 6e64 const char *rand │ │ │ │ -00188e00: 6669 6c65 293c 2f64 6976 3e3c 6469 7620 file)
    In │ │ │ │ -00188e20: 6974 6961 6c69 7a65 2074 6865 2063 6c69 itialize the cli │ │ │ │ -00188e30: 656e 742d 7369 6465 2053 534c 2f54 4c53 ent-side SSL/TLS │ │ │ │ -00188e40: 2063 6f6e 7465 7874 2e3c 2f64 6976 3e3c context.
    < │ │ │ │ -00188e50: 2f64 6976 3e0a 3c2f 6469 763e 3c21 2d2d /div>.

    │ │ │ │ -00188e70: 4279 2064 6566 6175 6c74 2c20 7365 7276 By default, serv │ │ │ │ -00188e80: 6572 2061 7574 6865 6e74 6963 6174 696f er authenticatio │ │ │ │ -00188e90: 6e20 6973 2065 6e61 626c 6564 2061 6e64 n is enabled and │ │ │ │ -00188ea0: 2074 6865 203c 656d 3e3c 636f 6465 3e63 the c │ │ │ │ -00188eb0: 6163 6572 7473 2e70 656d 3c2f 636f 6465 acerts.pem or │ │ │ │ -00188ed0: 6361 7061 7468 3c2f 636f 6465 3e20 286e capath (n │ │ │ │ -00188ee0: 6f74 2075 7365 6420 7769 7468 2047 4e55 ot used with GNU │ │ │ │ -00188ef0: 544c 5329 206d 7573 7420 6265 2073 6574 TLS) must be set │ │ │ │ -00188f00: 2073 6f20 7468 6174 2074 6865 2043 4120 so that the CA │ │ │ │ -00188f10: 6365 7274 6966 6963 6174 6573 206f 6620 certificates of │ │ │ │ -00188f20: 7468 6520 7365 7276 6572 2873 2920 6172 the server(s) ar │ │ │ │ -00188f30: 6520 6163 6365 7373 6962 6c65 2061 7420 e accessible at │ │ │ │ -00188f40: 7275 6e20 7469 6d65 2e20 5468 6520 3c65 run time. The cacerts. │ │ │ │ -00188f60: 7065 6d3c 2f63 6f64 653e 3c2f 656d 3e20 pem │ │ │ │ -00188f70: 6669 6c65 2069 6e63 6c75 6465 6420 696e file included in │ │ │ │ -00188f80: 2074 6865 2067 534f 4150 2073 6f75 7263 the gSOAP sourc │ │ │ │ -00188f90: 6520 636f 6465 2070 6163 6b61 6765 2063 e code package c │ │ │ │ -00188fa0: 6f6e 7461 696e 7320 7468 6520 6365 7274 ontains the cert │ │ │ │ -00188fb0: 6966 6963 6174 6573 206f 6620 636f 6d6d ificates of comm │ │ │ │ -00188fc0: 6f6e 2043 4173 2e20 5468 6973 2066 696c on CAs. This fil │ │ │ │ -00188fd0: 6520 6d75 7374 2062 6520 7375 7070 6c69 e must be suppli │ │ │ │ -00188fe0: 6564 2077 6974 6820 7468 6520 636c 6965 ed with the clie │ │ │ │ -00188ff0: 6e74 2c20 6966 2073 6572 7665 7220 6175 nt, if server au │ │ │ │ -00189000: 7468 656e 7469 6361 7469 6f6e 2069 7320 thentication is │ │ │ │ -00189010: 7265 7175 6972 6564 2e20 416c 7465 726e required. Altern │ │ │ │ -00189020: 6174 6976 656c 792c 2079 6f75 2063 616e atively, you can │ │ │ │ -00189030: 2075 7365 2074 6865 203c 656d 3e3c 636f use the gsoap/plugin/ │ │ │ │ -00189050: 6361 6365 7274 732e 683c 2f63 6f64 653e cacerts.h │ │ │ │ -00189060: 3c2f 656d 3e20 616e 6420 3c65 6d3e 3c63 and gsoap/plugin │ │ │ │ -00189080: 2f63 6163 6572 7473 2e63 3c2f 636f 6465 /cacerts.c code to e │ │ │ │ -001890a0: 6d62 6564 2043 4120 6365 7274 6966 6963 mbed CA certific │ │ │ │ -001890b0: 6174 6573 2069 6e20 796f 7572 2063 6c69 ates in your cli │ │ │ │ -001890c0: 656e 7420 636f 6465 2e3c 2f70 3e0a 3c70 ent code.

    .

    You can specify │ │ │ │ -001890e0: 2061 2063 6970 6865 7220 6c69 7374 2074 a cipher list t │ │ │ │ -001890f0: 6f20 7573 6520 7769 7468 2054 4c53 7631 o use with TLSv1 │ │ │ │ -00189100: 2e32 2061 6e64 2062 656c 6f77 2077 6974 .2 and below wit │ │ │ │ -00189110: 6820 3c63 6f64 653e 5353 4c5f 4354 585f h SSL_CTX_ │ │ │ │ -00189120: 7365 745f 6369 7068 6572 5f6c 6973 7428 set_cipher_list( │ │ │ │ -00189130: 736f 6170 2d26 6774 3b63 7478 2c20 222e soap->ctx, ". │ │ │ │ -00189140: 2e2e 2229 3c2f 636f 6465 3e20 7768 6572 ..") wher │ │ │ │ -00189150: 6520 3c63 6f64 653e 736f 6170 2d26 6774 e soap-> │ │ │ │ -00189160: 3b63 7478 3c2f 636f 6465 3e20 6973 2074 ;ctx is t │ │ │ │ -00189170: 6865 2053 534c 2063 6f6e 7465 7874 2063 he SSL context c │ │ │ │ -00189180: 7265 6174 6564 2062 7920 3c63 6f64 653e reated by │ │ │ │ -00189190: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap_ssl_clie │ │ │ │ -00189220: 6e74 5f63 6f6e 7465 7874 2829 3c2f 613e nt_context() │ │ │ │ -00189230: 3c2f 636f 6465 3e2e 204c 696b 6577 6973 . Likewis │ │ │ │ -00189240: 652c 2075 7365 203c 636f 6465 3e53 534c e, use SSL │ │ │ │ -00189250: 5f43 5458 5f73 6574 5f63 6970 6865 7273 _CTX_set_ciphers │ │ │ │ -00189260: 7569 7465 7328 736f 6170 2d26 6774 3b63 uites(soap->c │ │ │ │ -00189270: 7478 2c20 222e 2e2e 2229 3c2f 636f 6465 tx, "...") to configure t │ │ │ │ -00189290: 6865 2061 7661 696c 6162 6c65 2054 4c53 he available TLS │ │ │ │ -001892a0: 7631 2e33 2063 6970 6865 7273 7569 7465 v1.3 ciphersuite │ │ │ │ -001892b0: 732e 3c2f 703e 0a3c 703e 5765 2072 6566 s.

    .

    We ref │ │ │ │ -001892c0: 6572 2074 6f20 7468 6520 4f70 656e 5353 er to the OpenSS │ │ │ │ -001892d0: 4c20 646f 6375 6d65 6e74 6174 696f 6e20 L documentation │ │ │ │ -001892e0: 616e 6420 6d61 6e75 616c 2070 6167 6573 and manual pages │ │ │ │ -001892f0: 206f 6620 3c63 6f64 653e 5353 4c5f 4354 of SSL_CT │ │ │ │ -00189300: 585f 7365 745f 6369 7068 6572 5f6c 6973 X_set_cipher_lis │ │ │ │ -00189310: 743c 2f63 6f64 653e 2061 6e64 203c 636f t and SSL_CTX_set_c │ │ │ │ -00189330: 6970 6865 7273 7569 7465 733c 2f63 6f64 iphersuites for details o │ │ │ │ -00189350: 6e20 7468 6520 6c61 7465 7374 2063 6970 n the latest cip │ │ │ │ -00189360: 6865 7220 6c69 7374 7320 616e 6420 7375 her lists and su │ │ │ │ -00189370: 6974 6573 2061 7661 696c 6162 6c65 2074 ites available t │ │ │ │ -00189380: 6f20 7573 652e 3c2f 703e 0a3c 703e 4f74 o use.

    .

    Ot │ │ │ │ -00189390: 6865 7220 636c 6965 6e74 2d73 6964 6520 her client-side │ │ │ │ -001893a0: 5353 4c20 6f70 7469 6f6e 7320 6172 6520 SSL options are │ │ │ │ -001893b0: 3c63 6f64 653e 2353 4f41 505f 5353 4c5f #SOAP_SSL_ │ │ │ │ -001893c0: 534b 4950 5f48 4f53 545f 4348 4543 4b3c SKIP_HOST_CHECK< │ │ │ │ -001893d0: 2f63 6f64 653e 2074 6f20 736b 6970 2074 /code> to skip t │ │ │ │ -001893e0: 6865 2068 6f73 7420 6e61 6d65 2076 6572 he host name ver │ │ │ │ -001893f0: 6966 6963 6174 696f 6e20 6368 6563 6b20 ification check │ │ │ │ -00189400: 616e 6420 3c63 6f64 653e 2353 4f41 505f and #SOAP_ │ │ │ │ -00189410: 5353 4c5f 414c 4c4f 575f 4558 5049 5245 SSL_ALLOW_EXPIRE │ │ │ │ -00189420: 445f 4345 5254 4946 4943 4154 453c 2f63 D_CERTIFICATE to allow co │ │ │ │ -00189440: 6e6e 6563 7469 6e67 2074 6f20 6120 686f nnecting to a ho │ │ │ │ -00189450: 7374 2077 6974 6820 616e 2065 7870 6972 st with an expir │ │ │ │ -00189460: 6564 2063 6572 7469 6669 6361 7465 2e20 ed certificate. │ │ │ │ -00189470: 466f 7220 6578 616d 706c 652c 3c2f 703e For example,

    │ │ │ │ -00189480: 0a3c 6469 7620 636c 6173 733d 2266 7261 .
    s │ │ │ │ -001894c0: 7472 7563 7420 3c2f 7370 616e 3e3c 6120 truct soap soap;.
    soap_ssl_ │ │ │ │ -001895a0: 696e 6974 3c2f 613e 2829 3b20 3c73 7061 init(); /* init OpenSS │ │ │ │ -001895d0: 4c20 2873 6b69 7070 696e 6720 7468 6973 L (skipping this │ │ │ │ -001895e0: 206f 7220 6361 6c6c 696e 6720 6d75 6c74 or calling mult │ │ │ │ -001895f0: 6970 6c65 2074 696d 6573 2069 7320 4f4b iple times is OK │ │ │ │ -00189600: 2c20 7369 6e63 6520 7468 6520 656e 6769 , since the engi │ │ │ │ -00189610: 6e65 2077 696c 6c20 696e 6974 2053 534c ne will init SSL │ │ │ │ -00189620: 2061 7574 6f6d 6174 6963 616c 6c79 2920 automatically) │ │ │ │ -00189630: 2a2f 3c2f 7370 616e 3e3c 2f64 6976 3e0a */
    . │ │ │ │ -00189640: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    /* soap_ │ │ │ │ -00189670: 7373 6c5f 6e6f 696e 6974 2829 3b20 2a2f ssl_noinit(); */ │ │ │ │ -00189680: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c /* │ │ │ │ -001896a0: 2064 6f20 6e6f 7420 696e 6974 204f 7065 do not init Ope │ │ │ │ -001896b0: 6e53 534c 2028 6966 2053 534c 2069 7320 nSSL (if SSL is │ │ │ │ -001896c0: 616c 7265 6164 7920 696e 6974 6961 6c69 already initiali │ │ │ │ -001896d0: 7a65 6420 656c 7365 7768 6572 6520 696e zed elsewhere in │ │ │ │ -001896e0: 2074 6869 7320 6170 706c 6963 6174 696f this applicatio │ │ │ │ -001896f0: 6e29 202a 2f3c 2f73 7061 6e3e 3c2f 6469 n) */.
    soap_i │ │ │ │ -00189770: 6e69 743c 2f61 3e28 2661 6d70 3b3c 6120 nit(&soap);... │ │ │ │ -00189a50: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    │ │ │ │ -00189a80: 2671 756f 743b 636c 6965 6e74 2e70 656d "client.pem │ │ │ │ -00189a90: 2671 756f 743b 3c2f 7370 616e 3e2c 2020 ", │ │ │ │ -00189aa0: 2020 2020 2020 3c73 7061 6e20 636c 6173 /* k │ │ │ │ -00189ac0: 6579 6669 6c65 3a20 7265 7175 6972 6564 eyfile: required │ │ │ │ -00189ad0: 206f 6e6c 7920 7768 656e 2063 6c69 656e only when clien │ │ │ │ -00189ae0: 7420 6d75 7374 2061 7574 6865 6e74 6963 t must authentic │ │ │ │ -00189af0: 6174 6520 746f 2073 6572 7665 7220 2873 ate to server (s │ │ │ │ -00189b00: 6565 2053 534c 2064 6f63 7320 6f6e 2068 ee SSL docs on h │ │ │ │ -00189b10: 6f77 2074 6f20 6f62 7461 696e 2074 6869 ow to obtain thi │ │ │ │ -00189b20: 7320 6669 6c65 2920 2a2f 3c2f 7370 616e s file) */
    .
    "p │ │ │ │ -00189b70: 6173 7377 6f72 6426 7175 6f74 3b3c 2f73 assword", < │ │ │ │ -00189b90: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ -00189ba0: 656e 7422 3e2f 2a20 7061 7373 776f 7264 ent">/* password │ │ │ │ -00189bb0: 2074 6f20 7265 6164 2074 6865 206b 6579 to read the key │ │ │ │ -00189bc0: 2066 696c 6520 286e 6f74 2075 7365 6420 file (not used │ │ │ │ -00189bd0: 7769 7468 2047 4e55 544c 5329 202a 2f3c with GNUTLS) */< │ │ │ │ -00189be0: 2f73 7061 6e3e 203c 2f64 6976 3e0a 3c64 /span>
    . │ │ │ │ -00189c00: 2020 3c73 7061 6e20 636c 6173 733d 2273 &q │ │ │ │ -00189c20: 756f 743b 6361 6365 7274 732e 7065 6d26 uot;cacerts.pem& │ │ │ │ -00189c30: 7175 6f74 3b3c 2f73 7061 6e3e 2c20 2020 quot;, │ │ │ │ -00189c40: 2020 2020 3c73 7061 6e20 636c 6173 733d /* cac │ │ │ │ -00189c60: 6572 7420 6669 6c65 2074 6f20 7374 6f72 ert file to stor │ │ │ │ -00189c70: 6520 7472 7573 7465 6420 6365 7274 6966 e trusted certif │ │ │ │ -00189c80: 6963 6174 6573 2028 6e65 6564 6564 2074 icates (needed t │ │ │ │ -00189c90: 6f20 7665 7269 6679 2073 6572 7665 7229 o verify server) │ │ │ │ -00189ca0: 202a 2f3c 2f73 7061 6e3e 3c2f 6469 763e */
    │ │ │ │ -00189cb0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    NULL, │ │ │ │ -00189cd0: 2020 2020 2020 2020 2020 3c73 7061 6e20 │ │ │ │ -00189cf0: 2f2a 2063 6170 6174 6820 746f 2064 6972 /* capath to dir │ │ │ │ -00189d00: 6563 746f 7279 2077 6974 6820 7472 7573 ectory with trus │ │ │ │ -00189d10: 7465 6420 6365 7274 6966 6963 6174 6573 ted certificates │ │ │ │ -00189d20: 202a 2f3c 2f73 7061 6e3e 203c 2f64 6976 */
    .
    NULL │ │ │ │ -00189d50: 2020 203c 7370 616e 2063 6c61 7373 3d22 /* if r │ │ │ │ -00189d70: 616e 6466 696c 6521 3d4e 554c 4c3a 2075 andfile!=NULL: u │ │ │ │ -00189d80: 7365 2061 2066 696c 6520 7769 7468 2072 se a file with r │ │ │ │ -00189d90: 616e 646f 6d20 6461 7461 2074 6f20 7365 andom data to se │ │ │ │ -00189da0: 6564 2072 616e 646f 6d6e 6573 7320 2a2f ed randomness */ │ │ │ │ -00189db0: 3c2f 7370 616e 3e20 203c 2f64 6976 3e0a
    . │ │ │ │ -00189dc0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    ))
    .
    {< │ │ │ │ -00189df0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>..
    exit │ │ │ │ -00189ed0: 2845 5849 545f 4641 494c 5552 4529 3b20 (EXIT_FAILURE); │ │ │ │ -00189ee0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    }
    .
    soap_call_ns │ │ │ │ -00189f20: 5f5f 6d79 6d65 7468 6f64 2826 616d 703b __mymethod(& │ │ │ │ -00189f30: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap, │ │ │ │ -00189f60: 203c 7370 616e 2063 6c61 7373 3d22 7374 &qu │ │ │ │ -00189f80: 6f74 3b68 7474 7073 3a2f 2f64 6f6d 6169 ot;https://domai │ │ │ │ -00189f90: 6e2f 7061 7468 2f73 6563 7572 652e 6367 n/path/secure.cg │ │ │ │ -00189fa0: 6926 7175 6f74 3b3c 2f73 7061 6e3e 2c20 i", │ │ │ │ -00189fb0: 3c73 7061 6e20 636c 6173 733d 2273 7472 &quo │ │ │ │ -00189fd0: 743b 2671 756f 743b 3c2f 7370 616e 3e2c t;", │ │ │ │ -00189fe0: 202e 2e2e 293b 3c2f 6469 763e 0a3c 6469 ...);
    .SOAP_SSL_S │ │ │ │ -0018a0a0: 4b49 505f 484f 5354 5f43 4845 434b 3c2f KIP_HOST_CHECK
    #def │ │ │ │ -0018a0d0: 696e 6520 534f 4150 5f53 534c 5f53 4b49 ine SOAP_SSL_SKI │ │ │ │ -0018a0e0: 505f 484f 5354 5f43 4845 434b 3c2f 6469 P_HOST_CHECK
    soap_ssl_fl │ │ │ │ -0018a110: 6167 7320 666c 6167 2066 6f72 2063 6c69 ags flag for cli │ │ │ │ -0018a120: 656e 7473 2074 6f20 616c 6c6f 7720 636c ents to allow cl │ │ │ │ -0018a130: 6965 6e74 7320 746f 2073 6b69 7020 636f ients to skip co │ │ │ │ -0018a140: 6d6d 6f6e 206e 616d 6520 6368 6563 6b73 mmon name checks │ │ │ │ -0018a150: 2061 6761 696e 7374 2074 6865 2068 6f73 against the hos │ │ │ │ -0018a160: 7420 6e61 6d65 206f 6620 2e2e 2e3c 2f64 t name of ...
    Definit │ │ │ │ -0018a190: 696f 6e3a 3c2f 623e 2073 7464 736f 6170 ion: stdsoap │ │ │ │ -0018a1a0: 322e 683a 3538 3638 3c2f 6469 763e 3c2f 2.h:5868
    .
    #define SOAP_S │ │ │ │ -0018a2b0: 534c 5f52 4551 5549 5245 5f53 4552 5645 SL_REQUIRE_SERVE │ │ │ │ -0018a2c0: 525f 4155 5448 454e 5449 4341 5449 4f4e R_AUTHENTICATION │ │ │ │ -0018a2d0: 3c2f 6469 763e 3c64 6976 2063 6c61 7373
    soap_ss │ │ │ │ -0018a2f0: 6c5f 666c 6167 7320 666c 6167 2066 6f72 l_flags flag for │ │ │ │ -0018a300: 2063 6c69 656e 7473 2074 6f20 7265 7175 clients to requ │ │ │ │ -0018a310: 6972 6520 7365 7276 6572 7320 746f 2061 ire servers to a │ │ │ │ -0018a320: 7574 6865 6e74 6963 6174 6520 746f 2063 uthenticate to c │ │ │ │ -0018a330: 6c69 656e 7473 2064 7572 696e 6720 7468 lients during th │ │ │ │ -0018a340: 6520 4854 5450 5320 6861 6e64 7368 2e2e e HTTPS handsh.. │ │ │ │ -0018a350: 2e3c 2f64 6976 3e3c 6469 7620 636c 6173 .
    Def │ │ │ │ -0018a370: 696e 6974 696f 6e3a 3c2f 623e 2073 7464 inition: std │ │ │ │ -0018a380: 736f 6170 322e 683a 3538 3632 3c2f 6469 soap2.h:5862
    .
    #define SOAP_S │ │ │ │ -0018a490: 534c 5f41 4c4c 4f57 5f45 5850 4952 4544 SL_ALLOW_EXPIRED │ │ │ │ -0018a4a0: 5f43 4552 5449 4649 4341 5445 3c2f 6469 _CERTIFICATE
    soap_ssl_fl │ │ │ │ -0018a4d0: 6167 7320 666c 6167 2076 616c 7565 2074 ags flag value t │ │ │ │ -0018a4e0: 6f20 616c 6c6f 7720 7365 6c66 2d73 6967 o allow self-sig │ │ │ │ -0018a4f0: 6e65 6420 616e 6420 6578 7069 7265 6420 ned and expired │ │ │ │ -0018a500: 6365 7274 6966 6963 6174 6573 2061 6e64 certificates and │ │ │ │ -0018a510: 2074 686f 7365 2077 6974 686f 7574 2043 those without C │ │ │ │ -0018a520: 524c 2074 6f20 6265 2075 2e2e 2e3c 2f64 RL to be u...
    Definit │ │ │ │ -0018a550: 696f 6e3a 3c2f 623e 2073 7464 736f 6170 ion: stdsoap │ │ │ │ -0018a560: 322e 683a 3538 3332 3c2f 6469 763e 3c2f 2.h:5832
    .

    F │ │ │ │ -0018a590: 6f72 2073 7973 7465 6d73 2062 6173 6564 or systems based │ │ │ │ -0018a5a0: 206f 6e20 4d69 6372 6f73 6f66 7420 7769 on Microsoft wi │ │ │ │ -0018a5b0: 6e64 6f77 732c 2074 6865 2057 696e 496e ndows, the WinIn │ │ │ │ -0018a5c0: 6574 206d 6f64 756c 6520 6361 6e20 6265 et module can be │ │ │ │ -0018a5d0: 2075 7365 6420 696e 7374 6561 642c 2073 used instead, s │ │ │ │ -0018a5e0: 6565 203c 636f 6465 3e6d 6f64 5f67 736f ee mod_gso │ │ │ │ -0018a5f0: 6170 2f67 736f 6170 5f77 696e 2f77 696e ap/gsoap_win/win │ │ │ │ -0018a600: 696e 6574 3c2f 636f 6465 3e2e 3c2f 703e inet.

    │ │ │ │ -0018a610: 0a3c 703e 5369 6e63 6520 7265 6c65 6173 .

    Since releas │ │ │ │ -0018a620: 6520 7665 7273 696f 6e20 322e 382e 3230 e version 2.8.20 │ │ │ │ -0018a630: 2053 534c 2076 3320 6973 2064 6973 6162 SSL v3 is disab │ │ │ │ -0018a640: 6c65 642e 2054 6f20 656e 6162 6c65 2053 led. To enable S │ │ │ │ -0018a650: 534c 2076 3320 746f 6765 7468 6572 2077 SL v3 together w │ │ │ │ -0018a660: 6974 6820 544c 5320 312e 3020 616e 6420 ith TLS 1.0 and │ │ │ │ -0018a670: 6869 6768 6572 2c20 7573 6520 3c63 6f64 higher, use #SOAP_SSLv3_TL │ │ │ │ -0018a690: 5376 313c 2f63 6f64 653e 2077 6974 6820 Sv1 with │ │ │ │ -0018a6a0: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 soap_ss │ │ │ │ -0018a730: 6c5f 7365 7276 6572 5f63 6f6e 7465 7874 l_server_context │ │ │ │ -0018a740: 3c2f 613e 3c2f 636f 6465 3e2e 2054 6f20 . To │ │ │ │ -0018a750: 7573 6520 544c 5320 312e 3120 616e 6420 use TLS 1.1 and │ │ │ │ -0018a760: 312e 3220 7573 6520 3c63 6f64 653e 534f 1.2 use SO │ │ │ │ -0018a770: 4150 5f54 4c53 7631 5f31 207c 2053 4f41 AP_TLSv1_1 | SOA │ │ │ │ -0018a780: 505f 544c 5376 315f 323c 2f63 6f64 653e P_TLSv1_2 │ │ │ │ -0018a790: 2e20 546f 2075 7365 2054 4c53 2031 2e32 . To use TLS 1.2 │ │ │ │ -0018a7a0: 206f 6e6c 7920 7573 6520 3c63 6f64 653e only use │ │ │ │ -0018a7b0: 2353 4f41 505f 544c 5376 315f 323c 2f63 #SOAP_TLSv1_2. To use SSL │ │ │ │ -0018a7d0: 2076 3320 6f6e 6c79 2075 7365 203c 636f v3 only use #SOAP_SSLv3.

    .

    To │ │ │ │ -0018a800: 2064 6973 6162 6c65 2073 6572 7665 7220 disable server │ │ │ │ -0018a810: 6175 7468 656e 7469 6361 7469 6f6e 2066 authentication f │ │ │ │ -0018a820: 6f72 2074 6573 7469 6e67 2070 7572 706f or testing purpo │ │ │ │ -0018a830: 7365 732c 2075 7365 2074 6865 2066 6f6c ses, use the fol │ │ │ │ -0018a840: 6c6f 7769 6e67 3a3c 2f70 3e0a 3c64 6976 lowing:

    .
    if │ │ │ │ -0018a890: 3c2f 7370 616e 3e20 283c 6120 636c 6173 (soap_s │ │ │ │ -0018a8f0: 736c 5f63 6c69 656e 745f 636f 6e74 6578 sl_client_contex │ │ │ │ -0018a900: 743c 2f61 3e28 2661 6d70 3b3c 6120 636c t(&soap, ..< │ │ │ │ -0018a9d0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -0018a9e0: 3e20 204e 554c 4c2c 203c 2f64 6976 3e0a > NULL,
    . │ │ │ │ -0018a9f0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    NULL,
    │ │ │ │ -0018aa10: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    NULL,
    .
    NULL, .
    NULL .
    ))
    .< │ │ │ │ -0018aa90: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -0018aaa0: 3e7b 3c2f 6469 763e 0a3c 6469 7620 636c >{
    ..
    e │ │ │ │ -0018ab80: 7869 7428 4558 4954 5f46 4149 4c55 5245 xit(EXIT_FAILURE │ │ │ │ -0018ab90: 293b 203c 2f64 6976 3e0a 3c64 6976 2063 );
    .
    } .
    SO │ │ │ │ -0018ac60: 4150 5f53 534c 5f4e 4f5f 4155 5448 454e AP_SSL_NO_AUTHEN │ │ │ │ -0018ac70: 5449 4341 5449 4f4e 3c2f 613e 3c2f 6469 TICATION
    #define SO │ │ │ │ -0018aca0: 4150 5f53 534c 5f4e 4f5f 4155 5448 454e AP_SSL_NO_AUTHEN │ │ │ │ -0018acb0: 5449 4341 5449 4f4e 3c2f 6469 763e 3c64 TICATION
    soap_ssl_flags │ │ │ │ -0018ace0: 666c 6167 2076 616c 7565 2074 6f20 6469 flag value to di │ │ │ │ -0018acf0: 7361 626c 6520 6175 7468 656e 7469 6361 sable authentica │ │ │ │ -0018ad00: 7469 6f6e 206f 6620 7468 6520 7065 6572 tion of the peer │ │ │ │ -0018ad10: 3c2f 6469 763e 3c64 6976 2063 6c61 7373
    Defi │ │ │ │ -0018ad30: 6e69 7469 6f6e 3a3c 2f62 3e20 7374 6473 nition: stds │ │ │ │ -0018ad40: 6f61 7032 2e68 3a35 3834 303c 2f64 6976 oap2.h:5840
    .
    < │ │ │ │ -0018ad70: 703e 5468 6973 2061 6c73 6f20 6173 7375 p>This also assu │ │ │ │ -0018ad80: 6d65 7320 7468 6174 2074 6865 2073 6572 mes that the ser │ │ │ │ -0018ad90: 7665 7220 646f 6573 206e 6f74 2072 6571 ver does not req │ │ │ │ -0018ada0: 7569 7265 2063 6c69 656e 7473 2074 6f20 uire clients to │ │ │ │ -0018adb0: 6175 7468 656e 7469 6361 7465 2028 7468 authenticate (th │ │ │ │ -0018adc0: 6520 6b65 7966 696c 6520 6973 2061 6273 e keyfile is abs │ │ │ │ -0018add0: 656e 7429 2e3c 2f70 3e0a 3c70 3e4d 616b ent).

    .

    Mak │ │ │ │ -0018ade0: 6520 7375 7265 2079 6f75 2068 6176 6520 e sure you have │ │ │ │ -0018adf0: 7369 676e 616c 2068 616e 646c 6572 7320 signal handlers │ │ │ │ -0018ae00: 7365 7420 696e 2079 6f75 7220 6170 706c set in your appl │ │ │ │ -0018ae10: 6963 6174 696f 6e20 746f 2063 6174 6368 ication to catch │ │ │ │ -0018ae20: 2062 726f 6b65 6e20 636f 6e6e 6563 7469 broken connecti │ │ │ │ -0018ae30: 6f6e 7320 283c 636f 6465 3e53 4947 5049 ons (SIGPI │ │ │ │ -0018ae40: 5045 3c2f 636f 6465 3e29 3a3c 2f70 3e0a PE):

    . │ │ │ │ -0018ae50: 3c64 6976 2063 6c61 7373 3d22 6672 6167
    signal(S │ │ │ │ -0018ae80: 4947 5049 5045 2c20 7369 6770 6970 655f IGPIPE, sigpipe_ │ │ │ │ -0018ae90: 6861 6e64 6c65 293b 3c2f 6469 763e 0a3c handle);
    .< │ │ │ │ -0018aea0: 2f64 6976 3e3c 212d 2d20 6672 6167 6d65 /div>

    where, │ │ │ │ -0018aec0: 666f 7220 6578 616d 706c 653a 3c2f 703e for example:

    │ │ │ │ -0018aed0: 0a3c 6469 7620 636c 6173 733d 2266 7261 .
    void s │ │ │ │ -0018af20: 6967 7069 7065 5f68 616e 646c 6528 3c73 igpipe_handle(int x) { }
    . │ │ │ │ -0018af60: 3c2f 6469 763e 3c21 2d2d 2066 7261 676d
    Warning
    It is imp │ │ │ │ -0018afb0: 6f72 7461 6e74 2074 6861 7420 7468 6520 ortant that the │ │ │ │ -0018afc0: 3c63 6f64 653e 2357 4954 485f 4f50 454e #WITH_OPEN │ │ │ │ -0018afd0: 5353 4c3c 2f63 6f64 653e 206d 6163 726f SSL macro │ │ │ │ -0018afe0: 2069 7320 636f 6e73 6973 7465 6e74 6c79 is consistently │ │ │ │ -0018aff0: 2064 6566 696e 6564 2074 6f20 636f 6d70 defined to comp │ │ │ │ -0018b000: 696c 6520 7468 6520 736f 7572 6365 732c ile the sources, │ │ │ │ -0018b010: 2073 7563 6820 6173 203c 656d 3e3c 636f such as gsoap/stdsoap │ │ │ │ -0018b030: 322e 6370 703c 2f63 6f64 653e 3c2f 656d 2.cpp, soa │ │ │ │ -0018b050: 7043 2e63 7070 3c2f 636f 6465 3e3c 2f65 pC.cpp, so │ │ │ │ -0018b070: 6170 436c 6965 6e74 2e63 7070 3c2f 636f apClient.cpp, soapServer.c │ │ │ │ -0018b0a0: 7070 3c2f 636f 6465 3e3c 2f65 6d3e 2c20 pp, │ │ │ │ -0018b0b0: 616e 6420 616c 6c20 6170 706c 6963 6174 and all applicat │ │ │ │ -0018b0c0: 696f 6e20 736f 7572 6365 7320 7468 6174 ion sources that │ │ │ │ -0018b0d0: 2069 6e63 6c75 6465 203c 656d 3e3c 636f include gsoap/stdsoap │ │ │ │ -0018b0f0: 322e 683c 2f63 6f64 653e 3c2f 656d 3e20 2.h │ │ │ │ -0018b100: 6f72 203c 656d 3e3c 636f 6465 3e73 6f61 or soa │ │ │ │ -0018b110: 7048 2e68 3c2f 636f 6465 3e3c 2f65 6d3e pH.h │ │ │ │ -0018b120: 2e20 4966 2074 6865 206d 6163 726f 7320 . If the macros │ │ │ │ -0018b130: 6172 6520 6e6f 7420 636f 6e73 6973 7465 are not consiste │ │ │ │ -0018b140: 6e74 6c79 2075 7365 642c 2074 6865 2061 ntly used, the a │ │ │ │ -0018b150: 7070 6c69 6361 7469 6f6e 2077 696c 6c20 pplication will │ │ │ │ -0018b160: 6372 6173 6820 6475 6520 746f 2061 206d crash due to a m │ │ │ │ -0018b170: 6973 6d61 7463 6865 7320 696e 2074 6865 ismatches in the │ │ │ │ -0018b180: 2064 6563 6c61 7261 7469 6f6e 2061 6e64 declaration and │ │ │ │ -0018b190: 2061 6363 6573 7320 6f66 2074 6865 203c access of the < │ │ │ │ -0018b1a0: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soap │ │ │ │ -0018b200: 2063 6f6e 7465 7874 2e20 416c 7465 726e context. Altern │ │ │ │ -0018b210: 6174 6976 656c 792c 2075 7365 206c 6962 atively, use lib │ │ │ │ -0018b220: 7261 7279 203c 623e 3c63 6f64 653e 2d6c rary -l │ │ │ │ -0018b230: 6773 6f61 7073 736c 3c2f 636f 6465 3e3c gsoapssl< │ │ │ │ -0018b240: 2f62 3e20 6f72 203c 623e 3c63 6f64 653e /b> or │ │ │ │ -0018b250: 2d6c 6773 6f61 7073 736c 2b2b 3c2f 636f -lgsoapssl++ and comp │ │ │ │ -0018b270: 696c 6520 6576 6572 7974 6869 6e67 2065 ile everything e │ │ │ │ -0018b280: 6c73 6520 7769 7468 203c 636f 6465 3e23 lse with # │ │ │ │ -0018b290: 5749 5448 5f4f 5045 4e53 534c 3c2f 636f WITH_OPENSSL.
    .
    .C │ │ │ │ -0018b2b0: 6f6e 6375 7272 656e 7420 636c 6965 6e74 oncurrent client │ │ │ │ -0018b2c0: 2063 616c 6c73 2077 6974 6820 7468 7265 calls with thre │ │ │ │ -0018b2d0: 6164 7320 7368 6f75 6c64 2075 7365 2073 ads should use s │ │ │ │ -0018b2e0: 6570 6172 6174 6520 3c63 6f64 653e 3c61 eparate soap contex │ │ │ │ -0018b350: 7473 2049 6e20 6164 6469 7469 6f6e 2c20 ts In addition, │ │ │ │ -0018b360: 7468 6520 7468 7265 6164 2069 6e69 7469 the thread initi │ │ │ │ -0018b370: 616c 697a 6174 696f 6e20 636f 6465 2064 alization code d │ │ │ │ -0018b380: 6973 6375 7373 6564 2069 6e20 5365 6374 iscussed in Sect │ │ │ │ -0018b390: 696f 6e20 3c61 2063 6c61 7373 3d22 656c ion Secure Web ser │ │ │ │ -0018b3d0: 7669 6365 7320 7769 7468 2048 5454 5053 vices with HTTPS │ │ │ │ -0018b3e0: 3c2f 613e 206d 7573 7420 6265 2075 7365 must be use │ │ │ │ -0018b3f0: 6420 746f 2070 726f 7065 726c 7920 7365 d to properly se │ │ │ │ -0018b400: 7475 7020 4f70 656e 5353 4c20 696e 2061 tup OpenSSL in a │ │ │ │ -0018b410: 206d 756c 7469 2d74 6872 6561 6465 6420 multi-threaded │ │ │ │ -0018b420: 636c 6965 6e74 2061 7070 6c69 6361 7469 client applicati │ │ │ │ -0018b430: 6f6e 2e3c 2f64 643e 3c2f 646c 3e0a 3c70 on.
    .

    See also API do │ │ │ │ -0018b450: 6375 6d65 6e74 6174 696f 6e20 4d6f 6475 cumentation Modu │ │ │ │ -0018b460: 6c65 203c 6120 636c 6173 733d 2265 6c22 le S │ │ │ │ -0018b490: 534c 2f54 4c53 2063 6f6e 7465 7874 2061 SL/TLS context a │ │ │ │ -0018b4a0: 6e64 2066 756e 6374 696f 6e73 3c2f 613e nd functions │ │ │ │ -0018b4b0: 2066 6f72 206d 6f72 6520 6465 7461 696c for more detail │ │ │ │ -0018b4c0: 7320 6f6e 2074 6865 2053 534c 2f54 4c53 s on the SSL/TLS │ │ │ │ -0018b4d0: 2066 756e 6374 696f 6e73 2e3c 2f70 3e0a functions.

    . │ │ │ │ -0018b4e0: 3c70 3e59 6f75 2063 616e 2061 6c73 6f20

    You can also │ │ │ │ -0018b4f0: 7573 6520 7468 6520 5769 6e49 6e65 7420 use the WinInet │ │ │ │ -0018b500: 696e 7465 7266 6163 6520 746f 2065 7374 interface to est │ │ │ │ -0018b510: 6162 6c69 7368 2073 6563 7572 6520 4854 ablish secure HT │ │ │ │ -0018b520: 5450 5320 636f 6e6e 6563 7469 6f6e 7320 TPS connections │ │ │ │ -0018b530: 6f6e 2057 696e 646f 7773 206d 6163 6869 on Windows machi │ │ │ │ -0018b540: 6e65 732c 2061 7661 696c 6162 6c65 2069 nes, available i │ │ │ │ -0018b550: 6e20 7468 6520 3c65 6d3e 3c63 6f64 653e n the │ │ │ │ -0018b560: 6773 6f61 702f 6d6f 645f 6773 6f61 703c gsoap/mod_gsoap< │ │ │ │ -0018b570: 2f63 6f64 653e 3c2f 656d 3e20 6469 7265 /code> dire │ │ │ │ -0018b580: 6374 6f72 7920 6f66 2074 6865 2067 534f ctory of the gSO │ │ │ │ -0018b590: 4150 2073 6f75 7263 6520 636f 6465 2070 AP source code p │ │ │ │ -0018b5a0: 6163 6b61 6765 2c20 7365 6520 616c 736f ackage, see also │ │ │ │ -0018b5b0: 2053 6563 7469 6f6e 203c 6120 636c 6173 Section The WinIn │ │ │ │ -0018b5f0: 6574 2070 6c75 6769 6e3c 2f61 3e2e 204f et plugin. O │ │ │ │ -0018b600: 7220 796f 7520 6361 6e20 7573 6520 7468 r you can use th │ │ │ │ -0018b610: 6520 4355 524c 2070 6c75 6769 6e20 746f e CURL plugin to │ │ │ │ -0018b620: 2075 7365 2043 5552 4c20 746f 2065 7374 use CURL to est │ │ │ │ -0018b630: 6162 6c69 7368 2073 6563 7572 6520 4854 ablish secure HT │ │ │ │ -0018b640: 5450 5320 636f 6e6e 6563 7469 6f6e 732c TPS connections, │ │ │ │ -0018b650: 2073 6565 2053 6563 7469 6f6e 203c 6120 see Section The CURL │ │ │ │ -0018b690: 2070 6c75 6769 6e3c 2f61 3e2e 3c2f 703e plugin.

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

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

    .

    .SSL authentica │ │ │ │ -0018b720: 7469 6f6e 2063 616c 6c62 6163 6b73 3c2f tion callbacks.

    The fsslauth │ │ │ │ -0018b750: 2063 616c 6c62 6163 6b20 6675 6e63 7469 callback functi │ │ │ │ -0018b760: 6f6e 2063 6f6e 7472 6f6c 7320 4f70 656e on controls Open │ │ │ │ -0018b770: 5353 4c2f 474e 5554 4c53 2061 7574 6865 SSL/GNUTLS authe │ │ │ │ -0018b780: 6e74 6963 6174 696f 6e20 696e 6974 6961 ntication initia │ │ │ │ -0018b790: 6c69 7a61 7469 6f6e 3a3c 2f70 3e0a 3c75 lization:

    ..
  • int │ │ │ │ -0018b7b0: 2028 3c61 2063 6c61 7373 3d22 656c 2220 (soap: │ │ │ │ -0018b840: 3a66 7373 6c61 7574 683c 2f61 3e29 2873 :fsslauth)(s │ │ │ │ -0018b850: 7472 7563 7420 736f 6170 202a 736f 6170 truct soap *soap │ │ │ │ -0018b860: 293c 2f63 6f64 653e 2054 6869 7320 6361 ) This ca │ │ │ │ -0018b870: 6c6c 6261 636b 2069 7320 6361 6c6c 6564 llback is called │ │ │ │ -0018b880: 2074 6f20 696e 6974 6961 6c69 7a65 2074 to initialize t │ │ │ │ -0018b890: 6865 204f 7065 6e53 534c 206f 7220 474e he OpenSSL or GN │ │ │ │ -0018b8a0: 5554 4c53 2063 6f6e 7465 7874 2066 6f72 UTLS context for │ │ │ │ -0018b8b0: 2048 5454 5053 2063 6f6e 6e65 6374 696f HTTPS connectio │ │ │ │ -0018b8c0: 6e73 2063 6f6e 6669 6775 7265 6420 7769 ns configured wi │ │ │ │ -0018b8d0: 7468 2074 6865 2070 6172 616d 6574 6572 th the parameter │ │ │ │ -0018b8e0: 7320 7061 7373 6564 2074 6f20 3c63 6f64 s passed to soap_ssl_cl │ │ │ │ -0018b980: 6965 6e74 5f63 6f6e 7465 7874 3c2f 613e ient_context │ │ │ │ -0018b990: 3c2f 636f 6465 3e20 616e 6420 3c63 6f64 and soap_ssl_se │ │ │ │ -0018ba30: 7276 6572 5f63 6f6e 7465 7874 3c2f 613e rver_context │ │ │ │ -0018ba40: 3c2f 636f 6465 3e2e 2052 6574 7572 6e73 . Returns │ │ │ │ -0018ba50: 203c 636f 6465 3e23 534f 4150 5f4f 4b3c #SOAP_OK< │ │ │ │ -0018ba60: 2f63 6f64 653e 206f 7220 6120 3c63 6f64 /code> or a soap_status (int) │ │ │ │ -0018bb40: 6572 726f 7220 636f 6465 2e20 5468 6520 error code. The │ │ │ │ -0018bb50: 6275 696c 742d 696e 2066 756e 6374 696f built-in functio │ │ │ │ -0018bb60: 6e20 6173 7369 676e 6564 2074 6f20 3c63 n assigned to soa │ │ │ │ -0018bc00: 703a 3a66 7373 6c61 7574 683c 2f61 3e3c p::fsslauth< │ │ │ │ -0018bc10: 2f63 6f64 653e 2069 7320 3c63 6f64 653e /code> is │ │ │ │ -0018bc20: 7373 6c5f 6175 7468 5f69 6e69 743c 2f63 ssl_auth_init.
  • . │ │ │ │ -0018bc40: 0a3c 703e 5468 6520 3c63 6f64 653e 6673 .

    The fs │ │ │ │ -0018bc50: 736c 7665 7269 6679 3c2f 636f 6465 3e20 slverify │ │ │ │ -0018bc60: 6361 6c6c 6261 636b 2066 756e 6374 696f callback functio │ │ │ │ -0018bc70: 6e20 636f 6e74 726f 6c73 204f 7065 6e53 n controls OpenS │ │ │ │ -0018bc80: 534c 2070 6565 7220 6365 7274 6966 6963 SL peer certific │ │ │ │ -0018bc90: 6174 6520 7665 7269 6669 6361 7469 6f6e ate verification │ │ │ │ -0018bca0: 2c20 7669 6120 696e 7465 726e 616c 6c79 , via internally │ │ │ │ -0018bcb0: 2069 6e76 6f6b 696e 6720 3c63 6f64 653e invoking │ │ │ │ -0018bcc0: 5353 4c5f 4354 585f 7365 745f 7665 7269 SSL_CTX_set_veri │ │ │ │ -0018bcd0: 6679 3c2f 636f 6465 3e3a 3c2f 703e 0a3c fy:

    .< │ │ │ │ -0018bce0: 756c 3e0a 3c6c 693e 3c63 6f64 653e 696e ul>.
  • in │ │ │ │ -0018bcf0: 7420 2873 6f61 703a 3a66 7373 7665 7269 t (soap::fssveri │ │ │ │ -0018bd00: 6679 2928 696e 7420 6f6b 2c20 5835 3039 fy)(int ok, X509 │ │ │ │ -0018bd10: 5f53 544f 5245 5f43 5458 202a 7374 6f72 _STORE_CTX *stor │ │ │ │ -0018bd20: 653c 2f63 6f64 653e 2054 6869 7320 6361 e This ca │ │ │ │ -0018bd30: 6c6c 6261 636b 2069 7320 6361 6c6c 6564 llback is called │ │ │ │ -0018bd40: 2062 7920 7468 6520 656e 6769 6e65 2074 by the engine t │ │ │ │ -0018bd50: 6f20 6d61 6e61 6765 2074 6865 2076 6572 o manage the ver │ │ │ │ -0018bd60: 6966 6963 6174 696f 6e20 6f66 2074 6865 ification of the │ │ │ │ -0018bd70: 2063 6572 7469 6669 6361 7465 2070 726f certificate pro │ │ │ │ -0018bd80: 7669 6465 6420 6279 2061 2070 6565 722c vided by a peer, │ │ │ │ -0018bd90: 2073 7563 6820 6173 2074 6865 2063 6572 such as the cer │ │ │ │ -0018bda0: 7469 6669 6361 7465 2070 726f 7669 6465 tificate provide │ │ │ │ -0018bdb0: 6420 6279 2061 2073 6572 7665 7220 636f d by a server co │ │ │ │ -0018bdc0: 6e6e 6563 7465 6420 6f76 6572 2048 5454 nnected over HTT │ │ │ │ -0018bdd0: 5053 206f 7220 746f 2076 6572 6966 7920 PS or to verify │ │ │ │ -0018bde0: 7468 6520 6365 7274 6966 6963 6174 6520 the certificate │ │ │ │ -0018bdf0: 696e 636c 7564 6564 2077 6974 6820 6120 included with a │ │ │ │ -0018be00: 5753 2d53 6563 7572 6974 7920 6d65 7373 WS-Security mess │ │ │ │ -0018be10: 6167 652e 2054 6f20 7265 7175 6972 6520 age. To require │ │ │ │ -0018be20: 6365 7274 6966 6963 6174 6520 7665 7269 certificate veri │ │ │ │ -0018be30: 6669 6361 7469 6f6e 206f 6620 6120 7365 fication of a se │ │ │ │ -0018be40: 7276 6572 2063 6f6e 6e65 6374 6564 2076 rver connected v │ │ │ │ -0018be50: 6961 2048 5454 5053 2c20 7573 6520 3c63 ia HTTPS, use soap_ssl_ │ │ │ │ -0018bef0: 636c 6965 6e74 5f63 6f6e 7465 7874 3c2f client_context with < │ │ │ │ -0018bf10: 636f 6465 3e23 534f 4150 5f53 534c 5f52 code>#SOAP_SSL_R │ │ │ │ -0018bf20: 4551 5549 5245 5f53 4552 5645 525f 4155 EQUIRE_SERVER_AU │ │ │ │ -0018bf30: 5448 454e 5449 4341 5449 4f4e 3c2f 636f THENTICATION. To require │ │ │ │ -0018bf50: 6365 7274 6966 6963 6174 6520 7665 7269 certificate veri │ │ │ │ -0018bf60: 6669 6361 7469 6f6e 206f 6620 6120 636c fication of a cl │ │ │ │ -0018bf70: 6965 6e74 2063 6f6e 6e65 6374 6564 2074 ient connected t │ │ │ │ -0018bf80: 6f20 6120 7365 7276 6572 2c20 7573 6520 o a server, use │ │ │ │ -0018bf90: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 soap_ss │ │ │ │ -0018c020: 6c5f 7365 7276 6572 5f63 6f6e 7465 7874 l_server_context │ │ │ │ -0018c030: 3c2f 613e 3c2f 636f 6465 3e20 7769 7468 with │ │ │ │ -0018c040: 203c 636f 6465 3e23 534f 4150 5f53 534c #SOAP_SSL │ │ │ │ -0018c050: 5f52 4551 5549 5245 5f43 4c49 454e 545f _REQUIRE_CLIENT_ │ │ │ │ -0018c060: 4155 5448 454e 5449 4341 5449 4f4e 3c2f AUTHENTICATION. The ok param │ │ │ │ -0018c090: 6574 6572 206f 6620 7468 6973 2063 616c eter of this cal │ │ │ │ -0018c0a0: 6c62 6163 6b20 696e 6469 6361 7465 7320 lback indicates │ │ │ │ -0018c0b0: 7768 6574 6865 7220 7468 6520 7665 7269 whether the veri │ │ │ │ -0018c0c0: 6669 6361 7469 6f6e 206f 6620 7468 6520 fication of the │ │ │ │ -0018c0d0: 6365 7274 6966 6963 6174 6520 696e 2071 certificate in q │ │ │ │ -0018c0e0: 7565 7374 696f 6e20 7061 7373 6564 2028 uestion passed ( │ │ │ │ -0018c0f0: 3c63 6f64 653e 6f6b 3c2f 636f 6465 3e20 ok │ │ │ │ -0018c100: 3d3d 2031 2920 6f72 2066 6169 6c65 6420 == 1) or failed │ │ │ │ -0018c110: 283c 636f 6465 3e6f 6b3c 2f63 6f64 653e (ok │ │ │ │ -0018c120: 203d 3d20 3029 2061 7320 6465 7465 726d == 0) as determ │ │ │ │ -0018c130: 696e 6564 2062 7920 7468 6520 4f70 656e ined by the Open │ │ │ │ -0018c140: 5353 4c20 6c69 6272 6172 7920 6261 7365 SSL library base │ │ │ │ -0018c150: 6420 6f6e 2074 6865 203c 636f 6465 3e3c d on the < │ │ │ │ -0018c160: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ -0018c170: 663d 2267 726f 7570 5f5f 6772 6f75 705f f="group__group_ │ │ │ │ -0018c180: 5f73 736c 2e68 746d 6c23 6761 3236 3963 _ssl.html#ga269c │ │ │ │ -0018c190: 3737 3332 6231 6364 6139 6463 3739 6462 7732b1cda9dc79db │ │ │ │ -0018c1a0: 3038 6663 6266 3164 3534 3338 2220 7469 08fcbf1d5438" ti │ │ │ │ -0018c1b0: 746c 653d 2249 6e69 7469 616c 697a 6520 tle="Initialize │ │ │ │ -0018c1c0: 7468 6520 636c 6965 6e74 2d73 6964 6520 the client-side │ │ │ │ -0018c1d0: 5353 4c2f 544c 5320 636f 6e74 6578 742e SSL/TLS context. │ │ │ │ -0018c1e0: 223e 736f 6170 5f73 736c 5f63 6c69 656e ">soap_ssl_clien │ │ │ │ -0018c1f0: 745f 636f 6e74 6578 743c 2f61 3e3c 2f63 t_context or soap_ssl_server │ │ │ │ -0018c2a0: 5f63 6f6e 7465 7874 3c2f 613e 3c2f 636f _context configuratio │ │ │ │ -0018c2c0: 6e2e 2049 6620 7468 6520 6361 6c6c 6261 n. If the callba │ │ │ │ -0018c2d0: 636b 2072 6574 7572 6e73 2031 2074 6865 ck returns 1 the │ │ │ │ -0018c2e0: 6e20 7468 6520 6861 6e64 7368 616b 6520 n the handshake │ │ │ │ -0018c2f0: 6973 2063 6f6e 7469 6e75 6564 2061 6e64 is continued and │ │ │ │ -0018c300: 2074 6865 2063 6f6e 6e65 6374 696f 6e20 the connection │ │ │ │ -0018c310: 6d61 7962 6520 6573 7461 626c 6973 6865 maybe establishe │ │ │ │ -0018c320: 642e 2054 6f20 7265 7475 726e 2031 2077 d. To return 1 w │ │ │ │ -0018c330: 6865 6e20 3c63 6f64 653e 6f6b 3c2f 636f hen ok == 0 require │ │ │ │ -0018c350: 7320 7265 7365 7474 696e 6720 7468 6520 s resetting the │ │ │ │ -0018c360: 6572 726f 7220 7374 6174 6520 7769 7468 error state with │ │ │ │ -0018c370: 203c 636f 6465 3e58 3530 395f 5354 4f52 X509_STOR │ │ │ │ -0018c380: 455f 4354 585f 7365 745f 6572 726f 7228 E_CTX_set_error( │ │ │ │ -0018c390: 7374 6f72 652c 2058 3530 395f 565f 4f4b store, X509_V_OK │ │ │ │ -0018c3a0: 293c 2f63 6f64 653e 2e20 4966 2074 6865 ). If the │ │ │ │ -0018c3b0: 2063 616c 6c62 6163 6b20 7265 7475 726e callback return │ │ │ │ -0018c3c0: 7320 3020 7468 656e 2074 6865 2068 616e s 0 then the han │ │ │ │ -0018c3d0: 6473 6861 6b65 2069 7320 696d 6d65 6469 dshake is immedi │ │ │ │ -0018c3e0: 6174 656c 7920 7465 726d 696e 6174 6564 ately terminated │ │ │ │ -0018c3f0: 2077 6974 6820 2276 6572 6966 6963 6174 with "verificat │ │ │ │ -0018c400: 696f 6e20 6661 696c 6564 2220 616e 6420 ion failed" and │ │ │ │ -0018c410: 6120 7665 7269 6669 6361 7469 6f6e 2066 a verification f │ │ │ │ -0018c420: 6169 6c75 7265 2061 6c65 7274 2069 7320 ailure alert is │ │ │ │ -0018c430: 7365 6e74 2074 6f20 7468 6520 7065 6572 sent to the peer │ │ │ │ -0018c440: 2e20 5468 6520 6275 696c 742d 696e 2066 . The built-in f │ │ │ │ -0018c450: 756e 6374 696f 6e20 6173 7369 676e 6564 unction assigned │ │ │ │ -0018c460: 2074 6f20 3c63 6f64 653e 3c61 2063 6c61 to soap::fssl │ │ │ │ -0018c530: 7665 7269 6679 3c2f 613e 3c2f 636f 6465 verify is ssl_v │ │ │ │ -0018c550: 6572 6966 795f 6361 6c6c 6261 636b 3c2f erify_callback or when #SOAP_SSL_AL │ │ │ │ -0018c580: 4c4f 575f 4558 5049 5245 445f 4345 5254 LOW_EXPIRED_CERT │ │ │ │ -0018c590: 4946 4943 4154 453c 2f63 6f64 653e 2069 IFICATE i │ │ │ │ -0018c5a0: 7320 7573 6564 203c 636f 6465 3e73 736c s used ssl │ │ │ │ -0018c5b0: 5f76 6572 6966 795f 6361 6c6c 6261 636b _verify_callback │ │ │ │ -0018c5c0: 5f61 6c6c 6f77 5f65 7870 6972 6564 5f63 _allow_expired_c │ │ │ │ -0018c5d0: 6572 7469 6669 6361 7465 3c2f 636f 6465 ertificate.
  • ..

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

    .SSL cert │ │ │ │ -0018c650: 6966 6963 6174 6573 2061 6e64 206b 6579 ificates and key │ │ │ │ -0018c660: 2066 696c 6573 3c2f 6832 3e0a 3c70 3e54 files

    .

    T │ │ │ │ -0018c670: 6865 2067 534f 4150 2070 6163 6b61 6765 he gSOAP package │ │ │ │ -0018c680: 2069 6e63 6c75 6465 7320 6120 3c65 6d3e includes a │ │ │ │ -0018c690: 3c63 6f64 653e 6361 6365 7274 732e 7065 cacerts.pe │ │ │ │ -0018c6a0: 6d3c 2f63 6f64 653e 3c2f 656d 3e20 6669 m fi │ │ │ │ -0018c6b0: 6c65 2077 6974 6820 7468 6520 6365 7274 le with the cert │ │ │ │ -0018c6c0: 6966 6963 6174 6573 206f 6620 616c 6c20 ificates of all │ │ │ │ -0018c6d0: 6365 7274 6966 6963 6174 6520 6175 7468 certificate auth │ │ │ │ -0018c6e0: 6f72 6974 6965 732e 2059 6f75 2063 616e orities. You can │ │ │ │ -0018c6f0: 2075 7365 2074 6869 7320 6669 6c65 2074 use this file t │ │ │ │ -0018c700: 6f20 7665 7269 6679 2074 6865 2061 7574 o verify the aut │ │ │ │ -0018c710: 6865 6e74 6963 6174 696f 6e20 6f66 2073 hentication of s │ │ │ │ -0018c720: 6572 7665 7273 2074 6861 7420 7072 6f76 ervers that prov │ │ │ │ -0018c730: 6964 6520 6365 7274 6966 6963 6174 6573 ide certificates │ │ │ │ -0018c740: 2069 7373 7565 6420 6279 2074 6865 7365 issued by these │ │ │ │ -0018c750: 2043 4173 2e20 4a75 7374 2073 6574 2074 CAs. Just set t │ │ │ │ -0018c760: 6865 203c 636f 6465 3e63 6166 696c 653c he cafile< │ │ │ │ -0018c770: 2f63 6f64 653e 2070 6172 616d 6574 6572 /code> parameter │ │ │ │ -0018c780: 2074 6f20 7468 6520 6c6f 6361 7469 6f6e to the location │ │ │ │ -0018c790: 206f 6620 7468 6973 2066 696c 6520 6f6e of this file on │ │ │ │ -0018c7a0: 2079 6f75 7220 6669 6c65 2073 7973 7465 your file syste │ │ │ │ -0018c7b0: 6d2e 2054 6865 7265 666f 7265 2c20 7768 m. Therefore, wh │ │ │ │ -0018c7c0: 656e 2079 6f75 206f 6274 6169 6e20 6120 en you obtain a │ │ │ │ -0018c7d0: 6365 7274 6966 6963 6174 6520 7369 676e certificate sign │ │ │ │ -0018c7e0: 6564 2062 7920 6120 7472 7573 7465 6420 ed by a trusted │ │ │ │ -0018c7f0: 4341 2079 6f75 2063 616e 2073 696d 706c CA you can simpl │ │ │ │ -0018c800: 7920 7573 6520 7468 6520 3c65 6d3e 3c63 y use the cacerts.pem< │ │ │ │ -0018c820: 2f63 6f64 653e 3c2f 656d 3e20 6669 6c65 /code> file │ │ │ │ -0018c830: 2074 6f20 6465 7665 6c6f 7020 636c 6965 to develop clie │ │ │ │ -0018c840: 6e74 2061 7070 6c69 6361 7469 6f6e 7320 nt applications │ │ │ │ -0018c850: 7468 6174 2063 616e 2076 6572 6966 7920 that can verify │ │ │ │ -0018c860: 7468 6520 6175 7468 656e 7469 6369 7479 the authenticity │ │ │ │ -0018c870: 206f 6620 796f 7572 2073 6572 7665 722e of your server. │ │ │ │ -0018c880: 3c2f 703e 0a3c 703e 416c 7465 726e 6174

    .

    Alternat │ │ │ │ -0018c890: 6976 656c 792c 2079 6f75 2063 616e 2075 ively, you can u │ │ │ │ -0018c8a0: 7365 2074 6865 203c 656d 3e3c 636f 6465 se the gsoap/plugin/ca │ │ │ │ -0018c8c0: 6365 7274 732e 683c 2f63 6f64 653e 3c2f certs.h and gsoap/plugin/c │ │ │ │ -0018c8f0: 6163 6572 7473 2e63 3c2f 636f 6465 3e3c acerts.c< │ │ │ │ -0018c900: 2f65 6d3e 2063 6f64 6520 746f 2065 6d62 /em> code to emb │ │ │ │ -0018c910: 6564 2043 4120 6365 7274 6966 6963 6174 ed CA certificat │ │ │ │ -0018c920: 6573 2069 6e20 796f 7572 2063 6c69 656e es in your clien │ │ │ │ -0018c930: 7420 636f 6465 2e3c 2f70 3e0a 3c70 3e46 t code.

    .

    F │ │ │ │ -0018c940: 6f72 2073 7973 7465 6d73 2062 6173 6564 or systems based │ │ │ │ -0018c950: 206f 6e20 4d69 6372 6f73 6f66 7420 7769 on Microsoft wi │ │ │ │ -0018c960: 6e64 6f77 732c 2074 6865 2057 696e 496e ndows, the WinIn │ │ │ │ -0018c970: 6574 206d 6f64 756c 6520 6361 6e20 6265 et module can be │ │ │ │ -0018c980: 2075 7365 6420 696e 7374 6561 642c 2073 used instead, s │ │ │ │ -0018c990: 6565 2074 6865 203c 636f 6465 3e52 4541 ee the REA │ │ │ │ -0018c9a0: 444d 452e 7478 743c 2f63 6f64 653e 206c DME.txt l │ │ │ │ -0018c9b0: 6f63 6174 6564 2069 6e20 7468 6520 6753 ocated in the gS │ │ │ │ -0018c9c0: 4f41 5020 736f 7572 6365 2063 6f64 6520 OAP source code │ │ │ │ -0018c9d0: 7061 636b 6167 6520 756e 6465 7220 3c63 package under mod_gsoap/gs │ │ │ │ -0018c9f0: 6f61 705f 7769 6e2f 7769 6e69 6e65 743c oap_win/wininet< │ │ │ │ -0018ca00: 2f63 6f64 653e 2c20 7365 6520 7468 6520 /code>, see the │ │ │ │ -0018ca10: 6753 4f41 5020 3c61 2068 7265 663d 222e gSOAP Wi │ │ │ │ -0018ca40: 6e49 6e65 7420 706c 7567 696e 3c2f 613e nInet plugin │ │ │ │ -0018ca50: 2064 6f63 756d 656e 7461 7469 6f6e 2e3c documentation.< │ │ │ │ -0018ca60: 2f70 3e0a 3c70 3e54 6865 206f 7468 6572 /p>.

    The other │ │ │ │ -0018ca70: 203c 656d 3e3c 636f 6465 3e2e 7065 6d3c .pem< │ │ │ │ -0018ca80: 2f63 6f64 653e 3c2f 656d 3e20 6669 6c65 /code> file │ │ │ │ -0018ca90: 7320 696e 2074 6865 2067 534f 4150 2070 s in the gSOAP p │ │ │ │ -0018caa0: 6163 6b61 6765 2061 7265 2065 7861 6d70 ackage are examp │ │ │ │ -0018cab0: 6c65 7320 6f66 2073 656c 662d 7369 676e les of self-sign │ │ │ │ -0018cac0: 6564 2063 6572 7469 6669 6361 7465 7320 ed certificates │ │ │ │ -0018cad0: 666f 7220 7465 7374 696e 6720 7075 7270 for testing purp │ │ │ │ -0018cae0: 6f73 6573 2028 3c65 6d3e 3c63 6f64 653e oses ( │ │ │ │ -0018caf0: 6361 6365 7274 2e70 656d 3c2f 636f 6465 cacert.pem, client.pem, server.pem). The │ │ │ │ -0018cb50: 203c 656d 3e3c 636f 6465 3e63 6c69 656e clien │ │ │ │ -0018cb60: 742e 7065 6d3c 2f63 6f64 653e 3c2f 656d t.pem and │ │ │ │ -0018cb80: 7365 7276 6572 2e70 656d 3c2f 636f 6465 server.pem contain t │ │ │ │ -0018cba0: 6865 2070 7269 7661 7465 206b 6579 2061 he private key a │ │ │ │ -0018cbb0: 6e64 2063 6572 7469 6669 6361 7465 206f nd certificate o │ │ │ │ -0018cbc0: 6620 7468 6520 636c 6965 6e74 206f 7220 f the client or │ │ │ │ -0018cbd0: 7365 7276 6572 2c20 7265 7370 6563 7469 server, respecti │ │ │ │ -0018cbe0: 7665 6c79 2e20 5468 6520 6b65 7966 696c vely. The keyfil │ │ │ │ -0018cbf0: 6573 2028 3c65 6d3e 3c63 6f64 653e 636c es (cl │ │ │ │ -0018cc00: 6965 6e74 2e70 656d 3c2f 636f 6465 3e3c ient.pem< │ │ │ │ -0018cc10: 2f65 6d3e 2061 6e64 203c 656d 3e3c 636f /em> and server.pem) are c │ │ │ │ -0018cc40: 7265 6174 6564 2062 7920 636f 6e63 6174 reated by concat │ │ │ │ -0018cc50: 656e 6174 696e 6720 7468 6520 7072 6976 enating the priv │ │ │ │ -0018cc60: 6174 6520 6b65 7920 5045 4d20 7769 7468 ate key PEM with │ │ │ │ -0018cc70: 2074 6865 2063 6572 7469 6669 6361 7465 the certificate │ │ │ │ -0018cc80: 2050 454d 2e20 5468 6520 6b65 7966 696c PEM. The keyfil │ │ │ │ -0018cc90: 6520 7368 6f75 6c64 206e 6f74 2062 6520 e should not be │ │ │ │ -0018cca0: 7368 6172 6564 2077 6974 6820 616e 7920 shared with any │ │ │ │ -0018ccb0: 7061 7274 792e 2057 6974 6820 4f70 656e party. With Open │ │ │ │ -0018ccc0: 5353 4c2c 2079 6f75 2063 616e 2065 6e63 SSL, you can enc │ │ │ │ -0018ccd0: 7279 7074 2074 6865 206b 6579 6669 6c65 rypt the keyfile │ │ │ │ -0018cce0: 7320 7769 7468 2061 2070 6173 7377 6f72 s with a passwor │ │ │ │ -0018ccf0: 6420 746f 206f 6666 6572 2073 6f6d 6520 d to offer some │ │ │ │ -0018cd00: 7072 6f74 6563 7469 6f6e 2061 6e64 2074 protection and t │ │ │ │ -0018cd10: 6865 2070 6173 7377 6f72 6420 6973 2075 he password is u │ │ │ │ -0018cd20: 7365 6420 696e 2074 6865 2063 6c69 656e sed in the clien │ │ │ │ -0018cd30: 742f 7365 7276 6572 2063 6f64 6520 746f t/server code to │ │ │ │ -0018cd40: 2072 6561 6420 7468 6520 6b65 7966 696c read the keyfil │ │ │ │ -0018cd50: 652e 2047 4e55 544c 5320 646f 6573 206e e. GNUTLS does n │ │ │ │ -0018cd60: 6f74 2073 7570 706f 7274 2074 6869 7320 ot support this │ │ │ │ -0018cd70: 6665 6174 7572 6520 616e 6420 6361 6e6e feature and cann │ │ │ │ -0018cd80: 6f74 2065 6e63 7279 7074 206f 7220 6465 ot encrypt or de │ │ │ │ -0018cd90: 6372 7970 7420 6120 6b65 7966 696c 652e crypt a keyfile. │ │ │ │ -0018cda0: 3c2f 703e 0a3c 703e 596f 7520 6361 6e20

    .

    You can │ │ │ │ -0018cdb0: 616c 736f 2063 7265 6174 6520 796f 7572 also create your │ │ │ │ -0018cdc0: 206f 776e 2073 656c 662d 7369 676e 6564 own self-signed │ │ │ │ -0018cdd0: 2063 6572 7469 6669 6361 7465 732e 2054 certificates. T │ │ │ │ -0018cde0: 6865 7265 2069 7320 6d6f 7265 2074 6861 here is more tha │ │ │ │ -0018cdf0: 6e20 6f6e 6520 7761 7920 746f 2067 656e n one way to gen │ │ │ │ -0018ce00: 6572 6174 6520 7468 6520 6e65 6365 7373 erate the necess │ │ │ │ -0018ce10: 6172 7920 6669 6c65 7320 666f 7220 636c ary files for cl │ │ │ │ -0018ce20: 6965 6e74 7320 616e 6420 7365 7276 6572 ients and server │ │ │ │ -0018ce30: 732e 2053 6565 203c 6120 6872 6566 3d22 s. See http://w │ │ │ │ -0018ce60: 7777 2e6f 7065 6e73 736c 2e6f 7267 3c2f ww.openssl.org for informati │ │ │ │ -0018ce80: 6f6e 206f 6e20 4f70 656e 5353 4c20 616e on on OpenSSL an │ │ │ │ -0018ce90: 6420 3c61 2068 7265 663d 2268 7474 703a d ht │ │ │ │ -0018cec0: 7470 3a2f 2f73 6961 6c2e 6f72 672f 686f tp://sial.org/ho │ │ │ │ -0018ced0: 7774 6f2f 6f70 656e 7373 6c2f 6361 2f3c wto/openssl/ca/< │ │ │ │ -0018cee0: 2f61 3e20 6f6e 2068 6f77 2074 6f20 7365 /a> on how to se │ │ │ │ -0018cef0: 7475 7020 616e 6420 6d61 6e61 6765 2061 tup and manage a │ │ │ │ -0018cf00: 206c 6f63 616c 2043 4120 616e 6420 3c61 local CA and http://sial.or │ │ │ │ -0018cf50: 672f 686f 7774 6f2f 6f70 656e 7373 6c2f g/howto/openssl/ │ │ │ │ -0018cf60: 7365 6c66 2d73 6967 6e65 643c 2f61 3e20 self-signed │ │ │ │ -0018cf70: 6f6e 2068 6f77 2074 6f20 7365 7475 7020 on how to setup │ │ │ │ -0018cf80: 7365 6c66 2d73 6967 6e65 6420 7465 7374 self-signed test │ │ │ │ -0018cf90: 2063 6572 7469 6669 6361 7465 732e 3c2f certificates..

    It is poss │ │ │ │ -0018cfb0: 6962 6c65 2074 6f20 636f 6e76 6572 7420 ible to convert │ │ │ │ -0018cfc0: 4949 532d 6765 6e65 7261 7465 6420 6365 IIS-generated ce │ │ │ │ -0018cfd0: 7274 6966 6963 6174 6573 2074 6f20 5045 rtificates to PE │ │ │ │ -0018cfe0: 4d20 666f 726d 6174 2077 6974 6820 7468 M format with th │ │ │ │ -0018cff0: 6520 6f70 656e 7373 6c20 6c69 6272 6172 e openssl librar │ │ │ │ -0018d000: 7920 616e 6420 6f70 656e 7373 6c20 636f y and openssl co │ │ │ │ -0018d010: 6d6d 616e 642d 6c69 6e65 2074 6f6f 6c3a mmand-line tool: │ │ │ │ -0018d020: 203c 2f70 3e3c 7072 6520 636c 6173 733d

    opens
    │ │ │ │ -0018d040: 736c 2078 3530 3920 2d69 6e20 6d79 6365  sl x509 -in myce
    │ │ │ │ -0018d050: 7274 2e63 6572 202d 696e 666f 726d 2044  rt.cer -inform D
    │ │ │ │ -0018d060: 4552 202d 6f75 7420 6d79 6365 7274 2e70  ER -out mycert.p
    │ │ │ │ -0018d070: 656d 202d 6f75 7466 6f72 6d20 5045 4d0a  em -outform PEM.
    │ │ │ │ -0018d080: 3c2f 7072 653e 3c70 3e20 5468 6973 2063  

    This c │ │ │ │ -0018d090: 6f6e 7665 7274 7320 7468 6520 4352 542d onverts the CRT- │ │ │ │ -0018d0a0: 666f 726d 6174 7465 6420 6d79 6365 7274 formatted mycert │ │ │ │ -0018d0b0: 2e63 6572 2074 6f20 5045 4d2d 666f 726d .cer to PEM-form │ │ │ │ -0018d0c0: 6174 7465 6420 6d79 6365 7274 2e70 656d atted mycert.pem │ │ │ │ -0018d0d0: 2e3c 2f70 3e0a 3c70 3e48 6572 6520 6973 .

    .

    Here is │ │ │ │ -0018d0e0: 2074 6865 2073 696d 706c 6573 7420 7761 the simplest wa │ │ │ │ -0018d0f0: 7920 746f 2073 6574 7570 2073 656c 662d y to setup self- │ │ │ │ -0018d100: 7369 676e 6564 2063 6572 7469 6669 6361 signed certifica │ │ │ │ -0018d110: 7465 732e 2046 6972 7374 2079 6f75 206e tes. First you n │ │ │ │ -0018d120: 6565 6420 746f 2063 7265 6174 6520 6120 eed to create a │ │ │ │ -0018d130: 7072 6976 6174 6520 4365 7274 6966 6963 private Certific │ │ │ │ -0018d140: 6174 6520 4175 7468 6f72 6974 7920 2843 ate Authority (C │ │ │ │ -0018d150: 4129 2e20 5468 6520 4341 2069 7320 7573 A). The CA is us │ │ │ │ -0018d160: 6564 2069 6e20 5353 4c20 746f 2076 6572 ed in SSL to ver │ │ │ │ -0018d170: 6966 7920 7468 6520 6175 7468 656e 7469 ify the authenti │ │ │ │ -0018d180: 6369 7479 206f 6620 6120 6769 7665 6e20 city of a given │ │ │ │ -0018d190: 6365 7274 6966 6963 6174 652e 2054 6865 certificate. The │ │ │ │ -0018d1a0: 2043 4120 6163 7473 2061 7320 6120 7472 CA acts as a tr │ │ │ │ -0018d1b0: 7573 7465 6420 7468 6972 6420 7061 7274 usted third part │ │ │ │ -0018d1c0: 7920 7768 6f20 6861 7320 6175 7468 656e y who has authen │ │ │ │ -0018d1d0: 7469 6361 7465 6420 7468 6520 7573 6572 ticated the user │ │ │ │ -0018d1e0: 206f 6620 7468 6520 7369 676e 6564 2063 of the signed c │ │ │ │ -0018d1f0: 6572 7469 6669 6361 7465 2061 7320 6265 ertificate as be │ │ │ │ -0018d200: 696e 6720 7768 6f20 7468 6579 2073 6179 ing who they say │ │ │ │ -0018d210: 2e20 5468 6520 6365 7274 6966 6963 6174 . The certificat │ │ │ │ -0018d220: 6520 6973 2073 6967 6e65 6420 6279 2074 e is signed by t │ │ │ │ -0018d230: 6865 2043 412c 2061 6e64 2069 6620 7468 he CA, and if th │ │ │ │ -0018d240: 6520 636c 6965 6e74 2074 7275 7374 7320 e client trusts │ │ │ │ -0018d250: 7468 6520 4341 2c20 6974 2077 696c 6c20 the CA, it will │ │ │ │ -0018d260: 7472 7573 7420 796f 7572 2063 6572 7469 trust your certi │ │ │ │ -0018d270: 6669 6361 7465 2e20 466f 7220 7573 6520 ficate. For use │ │ │ │ -0018d280: 7769 7468 696e 2079 6f75 7220 6f72 6761 within your orga │ │ │ │ -0018d290: 6e69 7a61 7469 6f6e 2c20 6120 7072 6976 nization, a priv │ │ │ │ -0018d2a0: 6174 6520 4341 2077 696c 6c20 7072 6f62 ate CA will prob │ │ │ │ -0018d2b0: 6162 6c79 2073 6572 7665 2079 6f75 7220 ably serve your │ │ │ │ -0018d2c0: 6e65 6564 732e 2048 6f77 6576 6572 2c20 needs. However, │ │ │ │ -0018d2d0: 6966 2079 6f75 2069 6e74 656e 6420 7573 if you intend us │ │ │ │ -0018d2e0: 6520 796f 7572 2063 6572 7469 6669 6361 e your certifica │ │ │ │ -0018d2f0: 7465 7320 666f 7220 6120 7075 626c 6963 tes for a public │ │ │ │ -0018d300: 2073 6572 7669 6365 2c20 796f 7520 7368 service, you sh │ │ │ │ -0018d310: 6f75 6c64 2070 726f 6261 626c 7920 6f62 ould probably ob │ │ │ │ -0018d320: 7461 696e 2061 2063 6572 7469 6669 6361 tain a certifica │ │ │ │ -0018d330: 7465 2066 726f 6d20 6120 6b6e 6f77 6e20 te from a known │ │ │ │ -0018d340: 4341 2e20 496e 2061 6464 6974 696f 6e20 CA. In addition │ │ │ │ -0018d350: 746f 2069 6465 6e74 6966 6963 6174 696f to identificatio │ │ │ │ -0018d360: 6e2c 2079 6f75 7220 6365 7274 6966 6963 n, your certific │ │ │ │ -0018d370: 6174 6520 6973 2061 6c73 6f20 7573 6564 ate is also used │ │ │ │ -0018d380: 2066 6f72 2065 6e63 7279 7074 696f 6e2e for encryption. │ │ │ │ -0018d390: 3c2f 703e 0a3c 703e 4372 6561 7469 6e67

    .

    Creating │ │ │ │ -0018d3a0: 2063 6572 7469 6669 6361 7465 7320 7368 certificates sh │ │ │ │ -0018d3b0: 6f75 6c64 2062 6520 646f 6e65 2074 6872 ould be done thr │ │ │ │ -0018d3c0: 6f75 6768 2061 2043 4120 746f 206f 6274 ough a CA to obt │ │ │ │ -0018d3d0: 6169 6e20 7369 676e 6564 2063 6572 7469 ain signed certi │ │ │ │ -0018d3e0: 6669 6361 7465 732e 2042 7574 2079 6f75 ficates. But you │ │ │ │ -0018d3f0: 2063 616e 2063 7265 6174 6520 796f 7572 can create your │ │ │ │ -0018d400: 206f 776e 2063 6572 7469 6669 6361 7465 own certificate │ │ │ │ -0018d410: 7320 666f 7220 7465 7374 696e 6720 7075 s for testing pu │ │ │ │ -0018d420: 7270 6f73 6573 2061 7320 666f 6c6c 6f77 rposes as follow │ │ │ │ -0018d430: 732e 3c2f 703e 0a3c 756c 3e0a 3c6c 693e s.

    .
      .
    • │ │ │ │ -0018d440: 476f 2074 6f20 7468 6520 4f70 656e 5353 Go to the OpenSS │ │ │ │ -0018d450: 4c20 6269 6e20 6469 7265 6374 6f72 7920 L bin directory │ │ │ │ -0018d460: 283c 636f 6465 3e2f 7573 722f 6c6f 6361 (/usr/loca │ │ │ │ -0018d470: 6c2f 7373 6c3c 2f63 6f64 653e 2062 7920 l/ssl by │ │ │ │ -0018d480: 6465 6661 756c 7420 616e 6420 3c63 6f64 default and /System/Librar │ │ │ │ -0018d4a0: 792f 4f70 656e 5353 4c3c 2f63 6f64 653e y/OpenSSL │ │ │ │ -0018d4b0: 206f 6e20 4d61 6320 4f53 2058 293c 2f6c on Mac OS X).
    • There sho │ │ │ │ -0018d4d0: 756c 6420 6265 2061 2066 696c 6520 6361 uld be a file ca │ │ │ │ -0018d4e0: 6c6c 6564 206f 7065 6e73 736c 2e63 6e66 lled openssl.cnf │ │ │ │ -0018d4f0: 3c2f 6c69 3e0a 3c6c 693e 4372 6561 7465
    • .
    • Create │ │ │ │ -0018d500: 2061 206e 6577 2064 6972 6563 746f 7279 a new directory │ │ │ │ -0018d510: 2069 6e20 796f 7572 2068 6f6d 6520 6163 in your home ac │ │ │ │ -0018d520: 636f 756e 742c 2065 2e67 2e20 2448 4f4d count, e.g. $HOM │ │ │ │ -0018d530: 452f 4341 2c20 616e 6420 636f 7079 2074 E/CA, and copy t │ │ │ │ -0018d540: 6865 206f 7065 6e73 736c 2e63 6e66 2066 he openssl.cnf f │ │ │ │ -0018d550: 696c 6520 746f 2074 6869 7320 6469 7265 ile to this dire │ │ │ │ -0018d560: 6374 6f72 793c 2f6c 693e 0a3c 6c69 3e4d ctory
    • .
    • M │ │ │ │ -0018d570: 6f64 6966 7920 6f70 656e 7373 6c2e 636e odify openssl.cn │ │ │ │ -0018d580: 6620 6279 2063 6861 6e67 696e 6720 7468 f by changing th │ │ │ │ -0018d590: 6520 2764 6972 2720 7661 6c75 6520 746f e 'dir' value to │ │ │ │ -0018d5a0: 2048 4f4d 452f 4341 3c2f 6c69 3e0a 3c6c HOME/CA
    • .Copy the READM │ │ │ │ -0018d5c0: 452e 7478 742c 2072 6f6f 742e 7368 2c20 E.txt, root.sh, │ │ │ │ -0018d5d0: 616e 6420 6365 7274 2e73 6820 7363 7269 and cert.sh scri │ │ │ │ -0018d5e0: 7074 7320 6672 6f6d 2074 6865 2067 534f pts from the gSO │ │ │ │ -0018d5f0: 4150 2073 6f75 7263 6520 636f 6465 2070 AP source code p │ │ │ │ -0018d600: 6163 6b61 6765 206c 6f63 6174 6564 2069 ackage located i │ │ │ │ -0018d610: 6e20 7468 6520 3c65 6d3e 3c63 6f64 653e n the │ │ │ │ -0018d620: 6773 6f61 702f 7361 6d70 6c65 732f 7373 gsoap/samples/ss │ │ │ │ -0018d630: 6c3c 2f63 6f64 653e 3c2f 656d 3e20 6469 l di │ │ │ │ -0018d640: 7265 6374 6f72 7920 746f 2048 4f4d 452f rectory to HOME/ │ │ │ │ -0018d650: 4341 3c2f 6c69 3e0a 3c6c 693e 466f 6c6c CA.
    • Foll │ │ │ │ -0018d660: 6f77 2074 6865 2052 4541 444d 452e 7478 ow the README.tx │ │ │ │ -0018d670: 7420 696e 7374 7275 6374 696f 6e73 3c2f t instructions.
    .

    You │ │ │ │ -0018d690: 206e 6f77 2068 6176 6520 6120 7365 6c66 now have a self │ │ │ │ -0018d6a0: 2d73 6967 6e65 6420 4341 2072 6f6f 7420 -signed CA root │ │ │ │ -0018d6b0: 6365 7274 6966 6963 6174 6520 6361 6365 certificate cace │ │ │ │ -0018d6c0: 7274 2e70 656d 2061 6e64 2061 2073 6572 rt.pem and a ser │ │ │ │ -0018d6d0: 7665 722e 7065 6d20 286f 7220 636c 6965 ver.pem (or clie │ │ │ │ -0018d6e0: 6e74 2e70 656d 2920 6365 7274 6966 6963 nt.pem) certific │ │ │ │ -0018d6f0: 6174 6520 696e 2050 454d 2066 6f72 6d61 ate in PEM forma │ │ │ │ -0018d700: 742e 2054 6865 2063 6163 6572 742e 7065 t. The cacert.pe │ │ │ │ -0018d710: 6d20 6365 7274 6966 6963 6174 6520 6973 m certificate is │ │ │ │ -0018d720: 2075 7365 6420 696e 2074 6865 203c 636f used in the cafile │ │ │ │ -0018d740: 2070 6172 616d 6574 6572 206f 6620 7468 parameter of th │ │ │ │ -0018d750: 6520 3c63 6f64 653e 3c61 2063 6c61 7373 e soap_ │ │ │ │ -0018d7e0: 7373 6c5f 636c 6965 6e74 5f63 6f6e 7465 ssl_client_conte │ │ │ │ -0018d7f0: 7874 3c2f 613e 3c2f 636f 6465 3e20 286f xt (o │ │ │ │ -0018d800: 7220 3c63 6f64 653e 3c61 2063 6c61 7373 r soap_ │ │ │ │ -0018d890: 7373 6c5f 7365 7276 6572 5f63 6f6e 7465 ssl_server_conte │ │ │ │ -0018d8a0: 7874 3c2f 613e 3c2f 636f 6465 3e29 2061 xt) a │ │ │ │ -0018d8b0: 7420 7468 6520 636c 6965 6e74 2028 6f72 t the client (or │ │ │ │ -0018d8c0: 2073 6572 7665 7229 2073 6964 6520 746f server) side to │ │ │ │ -0018d8d0: 2076 6572 6966 7920 7468 6520 6175 7468 verify the auth │ │ │ │ -0018d8e0: 656e 7469 6369 7479 206f 6620 7468 6520 enticity of the │ │ │ │ -0018d8f0: 7065 6572 2e20 596f 7520 6361 6e20 616c peer. You can al │ │ │ │ -0018d900: 736f 2070 726f 7669 6465 2061 2063 6170 so provide a cap │ │ │ │ -0018d910: 6174 6820 7061 7261 6d65 7465 7220 746f ath parameter to │ │ │ │ -0018d920: 2074 6865 7365 2074 7275 7374 6564 2063 these trusted c │ │ │ │ -0018d930: 6572 7469 6669 6361 7465 732e 2054 6865 ertificates. The │ │ │ │ -0018d940: 2073 6572 7665 722e 7065 6d20 286f 7220 server.pem (or │ │ │ │ -0018d950: 636c 6965 6e74 2e70 656d 2920 6d75 7374 client.pem) must │ │ │ │ -0018d960: 2062 6520 7072 6f76 6964 6564 2077 6974 be provided wit │ │ │ │ -0018d970: 6820 7468 6520 3c63 6f64 653e 3c61 2063 h the s │ │ │ │ -0018da00: 6f61 705f 7373 6c5f 7365 7276 6572 5f63 oap_ssl_server_c │ │ │ │ -0018da10: 6f6e 7465 7874 3c2f 613e 3c2f 636f 6465 ontext at the server │ │ │ │ -0018da30: 7369 6465 2028 6f72 203c 636f 6465 3e3c side (or < │ │ │ │ -0018da40: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ -0018da50: 663d 2267 726f 7570 5f5f 6772 6f75 705f f="group__group_ │ │ │ │ -0018da60: 5f73 736c 2e68 746d 6c23 6761 3236 3963 _ssl.html#ga269c │ │ │ │ -0018da70: 3737 3332 6231 6364 6139 6463 3739 6462 7732b1cda9dc79db │ │ │ │ -0018da80: 3038 6663 6266 3164 3534 3338 2220 7469 08fcbf1d5438" ti │ │ │ │ -0018da90: 746c 653d 2249 6e69 7469 616c 697a 6520 tle="Initialize │ │ │ │ -0018daa0: 7468 6520 636c 6965 6e74 2d73 6964 6520 the client-side │ │ │ │ -0018dab0: 5353 4c2f 544c 5320 636f 6e74 6578 742e SSL/TLS context. │ │ │ │ -0018dac0: 223e 736f 6170 5f73 736c 5f63 6c69 656e ">soap_ssl_clien │ │ │ │ -0018dad0: 745f 636f 6e74 6578 743c 2f61 3e3c 2f63 t_context at the clie │ │ │ │ -0018daf0: 6e74 2073 6964 6529 2074 6f67 6574 6865 nt side) togethe │ │ │ │ -0018db00: 7220 7769 7468 2074 6865 2070 6173 7377 r with the passw │ │ │ │ -0018db10: 6f72 6420 796f 7520 656e 7465 7265 6420 ord you entered │ │ │ │ -0018db20: 7768 656e 2067 656e 6572 6174 696e 6720 when generating │ │ │ │ -0018db30: 7468 6520 6365 7274 6966 6963 6174 6520 the certificate │ │ │ │ -0018db40: 7573 696e 6720 6365 7274 2e73 6820 746f using cert.sh to │ │ │ │ -0018db50: 2061 6363 6573 7320 7468 6520 6669 6c65 access the file │ │ │ │ -0018db60: 2e20 5468 6573 6520 6365 7274 6966 6963 . These certific │ │ │ │ -0018db70: 6174 6573 206d 7573 7420 6265 2070 7265 ates must be pre │ │ │ │ -0018db80: 7365 6e74 2074 6f20 6772 616e 7420 6175 sent to grant au │ │ │ │ -0018db90: 7468 656e 7469 6361 7469 6f6e 2072 6571 thentication req │ │ │ │ -0018dba0: 7565 7374 7320 6279 2070 6565 7273 2e20 uests by peers. │ │ │ │ -0018dbb0: 496e 2061 6464 6974 696f 6e2c 2074 6865 In addition, the │ │ │ │ -0018dbc0: 2073 6572 7665 722e 7065 6d20 2861 6e64 server.pem (and │ │ │ │ -0018dbd0: 2063 6c69 656e 742e 7065 6d29 2069 6e63 client.pem) inc │ │ │ │ -0018dbe0: 6c75 6465 2074 6865 2068 6f73 7420 6e61 lude the host na │ │ │ │ -0018dbf0: 6d65 206f 6620 7468 6520 6d61 6368 696e me of the machin │ │ │ │ -0018dc00: 6520 6f6e 2077 6869 6368 2074 6865 2061 e on which the a │ │ │ │ -0018dc10: 7070 6c69 6361 7469 6f6e 2072 756e 7320 pplication runs │ │ │ │ -0018dc20: 2865 2e67 2e20 6c6f 6361 6c68 6f73 7429 (e.g. localhost) │ │ │ │ -0018dc30: 2c20 736f 2079 6f75 206e 6565 6420 746f , so you need to │ │ │ │ -0018dc40: 2067 656e 6572 6174 6520 6e65 7720 6365 generate new ce │ │ │ │ -0018dc50: 7274 6966 6963 6174 6573 2077 6865 6e20 rtificates when │ │ │ │ -0018dc60: 6d69 6772 6174 696e 6720 6120 7365 7276 migrating a serv │ │ │ │ -0018dc70: 6572 2028 6f72 2063 6c69 656e 7429 2e3c er (or client).< │ │ │ │ -0018dc80: 2f70 3e0a 3c70 3e46 696e 616c 6c79 2c20 /p>.

    Finally, │ │ │ │ -0018dc90: 796f 7520 6e65 6564 2074 6f20 6765 6e65 you need to gene │ │ │ │ -0018dca0: 7261 7465 2044 6966 6669 652d 4865 6c6d rate Diffie-Helm │ │ │ │ -0018dcb0: 616e 6e20 2844 4829 2070 6172 616d 6574 ann (DH) paramet │ │ │ │ -0018dcc0: 6572 7320 666f 7220 7468 6520 7365 7276 ers for the serv │ │ │ │ -0018dcd0: 6572 2069 6620 796f 7520 7769 7368 2074 er if you wish t │ │ │ │ -0018dce0: 6f20 7573 6520 4448 2069 6e73 7465 6164 o use DH instead │ │ │ │ -0018dcf0: 206f 6620 5253 412e 2054 6865 7265 2061 of RSA. There a │ │ │ │ -0018dd00: 7265 2074 776f 206f 7074 696f 6e73 3a3c re two options:< │ │ │ │ -0018dd10: 2f70 3e0a 3c75 6c3e 0a3c 6c69 3e53 6574 /p>.

      .
    • Set │ │ │ │ -0018dd20: 2074 6865 203c 636f 6465 3e64 6866 696c the dhfil │ │ │ │ -0018dd30: 653c 2f63 6f64 653e 2070 6172 616d 6574 e paramet │ │ │ │ -0018dd40: 6572 2074 6f20 7468 6520 6e75 6d65 7269 er to the numeri │ │ │ │ -0018dd50: 6320 4448 2070 7269 6d65 206c 656e 6774 c DH prime lengt │ │ │ │ -0018dd60: 6820 696e 2062 6974 7320 7265 7175 6972 h in bits requir │ │ │ │ -0018dd70: 6564 2028 666f 7220 6578 616d 706c 6520 ed (for example │ │ │ │ -0018dd80: 2231 3032 3422 2920 746f 206c 6574 2074 "1024") to let t │ │ │ │ -0018dd90: 6865 2065 6e67 696e 6520 6765 6e65 7261 he engine genera │ │ │ │ -0018dda0: 7465 2044 4820 7061 7261 6d65 7465 7273 te DH parameters │ │ │ │ -0018ddb0: 2061 7420 696e 6974 6961 6c69 7a61 7469 at initializati │ │ │ │ -0018ddc0: 6f6e 2e20 5468 6973 2063 616e 2062 6520 on. This can be │ │ │ │ -0018ddd0: 7469 6d65 2063 6f6e 7375 6d69 6e67 2e3c time consuming.< │ │ │ │ -0018dde0: 2f6c 693e 0a3c 6c69 3e50 726f 7669 6465 /li>.
    • Provide │ │ │ │ -0018ddf0: 2061 2066 696c 6520 6e61 6d65 2066 6f72 a file name for │ │ │ │ -0018de00: 2074 6865 203c 636f 6465 3e64 6866 696c the dhfil │ │ │ │ -0018de10: 653c 2f63 6f64 653e 2070 6172 616d 6574 e paramet │ │ │ │ -0018de20: 6572 206f 6620 3c63 6f64 653e 3c61 2063 er of s │ │ │ │ -0018deb0: 6f61 705f 7373 6c5f 7365 7276 6572 5f63 oap_ssl_server_c │ │ │ │ -0018dec0: 6f6e 7465 7874 3c2f 613e 3c2f 636f 6465 ontext. The file shou │ │ │ │ -0018dee0: 6c64 2062 6520 6765 6e65 7261 7465 6420 ld be generated │ │ │ │ -0018def0: 6265 666f 7265 6861 6e64 2e20 546f 2064 beforehand. To d │ │ │ │ -0018df00: 6f20 736f 2077 6974 6820 7468 6520 4f70 o so with the Op │ │ │ │ -0018df10: 656e 5353 4c20 636f 6d6d 616e 6420 6c69 enSSL command li │ │ │ │ -0018df20: 6e65 2074 6f6f 6c2c 2075 7365 3a20 3c70 ne tool, use:

      openssl dhp │ │ │ │ -0018df50: 6172 616d 202d 6f75 7466 6f72 6d20 5045 aram -outform PE │ │ │ │ -0018df60: 4d20 2d6f 7574 2064 682e 7065 6d20 3531 M -out dh.pem 51 │ │ │ │ -0018df70: 320a 3c2f 7072 653e 2046 696c 6520 3c65 2. File dh512.pe │ │ │ │ -0018df90: 6d3c 2f63 6f64 653e 3c2f 656d 3e20 6973 m is │ │ │ │ -0018dfa0: 2074 6865 206f 7574 7075 7420 6669 6c65 the output file │ │ │ │ -0018dfb0: 2061 6e64 2035 3132 2069 7320 7468 6520 and 512 is the │ │ │ │ -0018dfc0: 6e75 6d62 6572 206f 6620 6269 7473 2075 number of bits u │ │ │ │ -0018dfd0: 7365 642e 3c2f 6c69 3e0a 3c2f 756c 3e0a sed.

    • .
    . │ │ │ │ -0018dfe0: 3c70 3ef0 9f94 9d20 3c61 2068 7265 663d

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

    .

    .SSL │ │ │ │ -0018e040: 6861 7264 7761 7265 2061 6363 656c 6572 hardware acceler │ │ │ │ -0018e050: 6174 696f 6e3c 2f68 323e 0a3c 703e 596f ation

    .

    Yo │ │ │ │ -0018e060: 7520 6361 6e20 7370 6563 6966 7920 6120 u can specify a │ │ │ │ -0018e070: 6861 7264 7761 7265 2065 6e67 696e 6520 hardware engine │ │ │ │ -0018e080: 746f 2065 6e61 626c 6520 6861 7264 7761 to enable hardwa │ │ │ │ -0018e090: 7265 2073 7570 706f 7274 2066 6f72 2063 re support for c │ │ │ │ -0018e0a0: 7279 7074 6f67 7261 7068 6963 2061 6363 ryptographic acc │ │ │ │ -0018e0b0: 656c 6572 6174 696f 6e2e 2054 6869 7320 eleration. This │ │ │ │ -0018e0c0: 6361 6e20 6265 2064 6f6e 6520 6f6e 6365 can be done once │ │ │ │ -0018e0d0: 2069 6e20 6120 7365 7276 6572 206f 7220 in a server or │ │ │ │ -0018e0e0: 636c 6965 6e74 2077 6974 6820 7468 6520 client with the │ │ │ │ -0018e0f0: 666f 6c6c 6f77 696e 6720 7374 6174 656d following statem │ │ │ │ -0018e100: 656e 7473 3a3c 2f70 3e0a 3c64 6976 2063 ents:

    .
    │ │ │ │ -0018e120: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    static cons │ │ │ │ -0018e170: 743c 2f73 7061 6e3e 203c 7370 616e 2063 t char * │ │ │ │ -0018e1a0: 656e 6769 6e65 203d 203c 7370 616e 2063 engine = "cswif │ │ │ │ -0018e1d0: 7426 7175 6f74 3b3c 2f73 7061 6e3e 3b20 t"; │ │ │ │ -0018e1e0: 3c73 7061 6e20 636c 6173 733d 2263 6f6d /* engine │ │ │ │ -0018e200: 6e61 6d65 202a 2f3c 2f73 7061 6e3e 203c name */ < │ │ │ │ -0018e210: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    int mai │ │ │ │ -0018e250: 6e28 2920 3c2f 6469 763e 0a3c 6469 7620 n()
    .
    {.
    ENGINE │ │ │ │ -0018e290: 2a65 3b20 3c2f 6469 763e 0a3c 6469 7620 *e;
    .
    < │ │ │ │ -0018e2b0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -0018e2c0: 6f72 6466 6c6f 7722 3e69 663c 2f73 7061 ordflow">if (!(e = ENGINE │ │ │ │ -0018e2e0: 5f62 795f 6964 2865 6e67 696e 6529 2929 _by_id(engine))) │ │ │ │ -0018e2f0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    fp │ │ │ │ -0018e310: 7269 6e74 6628 7374 6465 7272 2c20 3c73 rintf(stderr, " │ │ │ │ -0018e340: 4572 726f 7220 6669 6e64 696e 6720 656e Error finding en │ │ │ │ -0018e350: 6769 6e65 2025 735c 6e26 7175 6f74 3b3c gine %s\n"< │ │ │ │ -0018e360: 2f73 7061 6e3e 2c20 656e 6769 6e65 293b /span>, engine); │ │ │ │ -0018e370: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    else if (!ENGINE_s │ │ │ │ -0018e3e0: 6574 5f64 6566 6175 6c74 2865 2c20 454e et_default(e, EN │ │ │ │ -0018e3f0: 4749 4e45 5f4d 4554 484f 445f 414c 4c29 GINE_METHOD_ALL) │ │ │ │ -0018e400: 2920 3c2f 6469 763e 0a3c 6469 7620 636c )
    .
    f │ │ │ │ -0018e420: 7072 696e 7466 2873 7464 6572 722c 203c printf(stderr, < │ │ │ │ -0018e430: 7370 616e 2063 6c61 7373 3d22 7374 7269 span class="stri │ │ │ │ -0018e440: 6e67 6c69 7465 7261 6c22 3e26 7175 6f74 ngliteral">" │ │ │ │ -0018e450: 3b45 7272 6f72 2075 7369 6e67 2065 6e67 ;Error using eng │ │ │ │ -0018e460: 696e 6520 2573 5c6e 2671 756f 743b 3c2f ine %s\n", engine); │ │ │ │ -0018e480: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    ... < │ │ │ │ -0018e4a0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ -0018e4b0: 656e 7422 3e2f 2f3c 2f73 7061 6e3e 3c2f ent">//.
    }
    .< │ │ │ │ -0018e4e0: 2f64 6976 3e3c 212d 2d20 6672 6167 6d65 /div>

    The fol │ │ │ │ -0018e500: 6c6f 7769 6e67 2074 6162 6c65 206c 6973 lowing table lis │ │ │ │ -0018e510: 7473 2074 6865 206e 616d 6573 206f 6620 ts the names of │ │ │ │ -0018e520: 7468 6520 6861 7264 7761 7265 2061 6e64 the hardware and │ │ │ │ -0018e530: 2073 6f66 7477 6172 6520 656e 6769 6e65 software engine │ │ │ │ -0018e540: 733a 3c2f 703e 0a3c 7461 626c 6520 636c s:

    ....... │ │ │ │ -0018e740: 4f70 656e 4253 4420 7375 7070 6f72 7473 OpenBSD supports │ │ │ │ -0018e750: 206b 6572 6e65 6c20 6c65 7665 6c20 6372 kernel level cr │ │ │ │ -0018e760: 7970 746f 6772 6170 6879 2020 2020 3c2f yptography ........< │ │ │ │ -0018ea30: 2f74 723e 0a3c 7472 2063 6c61 7373 3d22 /tr>...... │ │ │ │ -0018ebd0: 3c63 6f64 653e 7375 7265 7761 7265 3c2f sureware ..

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

    .

    │ │ │ │ -0018eca0: 0a53 534c 206f 6e20 5769 6e64 6f77 733c .SSL on Windows< │ │ │ │ -0018ecb0: 2f68 323e 0a3c 703e 5365 7420 7468 6520 /h2>.

    Set the │ │ │ │ -0018ecc0: 6675 6c6c 2070 6174 6820 746f 203c 656d full path to libssl.li │ │ │ │ -0018ece0: 623c 2f63 6f64 653e 3c2f 656d 3e20 616e b an │ │ │ │ -0018ecf0: 6420 3c65 6d3e 3c63 6f64 653e 6c69 6263 d libc │ │ │ │ -0018ed00: 7279 7074 6f2e 6c69 623c 2f63 6f64 653e rypto.lib │ │ │ │ -0018ed10: 3c2f 656d 3e20 756e 6465 7220 7468 6520 under the │ │ │ │ -0018ed20: 4d53 5643 2b2b 2022 5072 6f6a 6563 7473 MSVC++ "Projects │ │ │ │ -0018ed30: 2220 6d65 6e75 2c20 7468 656e 2063 686f " menu, then cho │ │ │ │ -0018ed40: 6f73 6520 224c 696e 6b22 3a20 224f 626a ose "Link": "Obj │ │ │ │ -0018ed50: 6563 742f 4d6f 6475 6c65 7322 2e20 506c ect/Modules". Pl │ │ │ │ -0018ed60: 6561 7365 206d 616b 6520 7375 7265 203c ease make sure < │ │ │ │ -0018ed70: 656d 3e3c 636f 6465 3e6c 6962 7373 6c33 em>libssl3 │ │ │ │ -0018ed80: 322e 646c 6c3c 2f63 6f64 653e 3c2f 656d 2.dll and │ │ │ │ -0018eda0: 6c69 6265 6179 3332 2e64 6c6c 3c2f 636f libeay32.dll can be │ │ │ │ -0018edc0: 6c6f 6164 6564 2062 7920 796f 7572 2061 loaded by your a │ │ │ │ -0018edd0: 7070 6c69 6361 7469 6f6e 732c 2074 6875 pplications, thu │ │ │ │ -0018ede0: 7320 7468 6579 206d 7573 7420 6265 2069 s they must be i │ │ │ │ -0018edf0: 6e73 7461 6c6c 6564 2070 726f 7065 726c nstalled properl │ │ │ │ -0018ee00: 7920 6f6e 2074 6865 2074 6172 6765 7420 y on the target │ │ │ │ -0018ee10: 6d61 6368 696e 652e 3c2f 703e 0a3c 703e machine.

    .

    │ │ │ │ -0018ee20: 4966 2079 6f75 2772 6520 7573 696e 6720 If you're using │ │ │ │ -0018ee30: 636f 6d70 696c 6174 696f 6e20 7365 7474 compilation sett │ │ │ │ -0018ee40: 696e 6773 2073 7563 6820 6173 203c 636f ings such as /MTd t │ │ │ │ -0018ee60: 6865 6e20 6c69 6e6b 2074 6f20 7468 6520 hen link to the │ │ │ │ -0018ee70: 636f 7272 6563 7420 3c65 6d3e 3c63 6f64 correct libeay32MTd.li │ │ │ │ -0018ee90: 623c 2f63 6f64 653e 3c2f 656d 3e20 616e b an │ │ │ │ -0018eea0: 6420 3c65 6d3e 3c63 6f64 653e 7373 6c65 d ssle │ │ │ │ -0018eeb0: 6179 3332 4d54 642e 6c69 623c 2f63 6f64 ay32MTd.lib librarie │ │ │ │ -0018eed0: 732e 3c2f 703e 0a3c 703e 416c 7465 726e s.

    .

    Altern │ │ │ │ -0018eee0: 6174 6976 656c 792c 2079 6f75 2063 616e atively, you can │ │ │ │ -0018eef0: 2075 7365 2074 6865 2057 696e 496e 6574 use the WinInet │ │ │ │ -0018ef00: 2069 6e74 6572 6661 6365 2066 6f72 2073 interface for s │ │ │ │ -0018ef10: 6563 7572 6520 636f 6e6e 6563 7469 6f6e ecure connection │ │ │ │ -0018ef20: 732c 2061 7661 696c 6162 6c65 2069 6e20 s, available in │ │ │ │ -0018ef30: 7468 6520 3c65 6d3e 3c63 6f64 653e 6773 the gs │ │ │ │ -0018ef40: 6f61 702f 6d6f 645f 6773 6f61 703c 2f63 oap/mod_gsoap direct │ │ │ │ -0018ef60: 6f72 7920 6f66 2074 6865 2067 534f 4150 ory of the gSOAP │ │ │ │ -0018ef70: 2070 6163 6b61 6765 2c20 7365 6520 616c package, see al │ │ │ │ -0018ef80: 736f 2053 6563 7469 6f6e 203c 6120 636c so Section The Win │ │ │ │ -0018efc0: 496e 6574 2070 6c75 6769 6e3c 2f61 3e2e Inet plugin. │ │ │ │ -0018efd0: 204f 7220 796f 7520 6361 6e20 7573 6520 Or you can use │ │ │ │ -0018efe0: 7468 6520 4355 524c 2070 6c75 6769 6e20 the CURL plugin │ │ │ │ -0018eff0: 746f 2075 7365 2043 5552 4c20 666f 7220 to use CURL for │ │ │ │ -0018f000: 7365 6375 7265 2063 6f6e 6e65 6374 696f secure connectio │ │ │ │ -0018f010: 6e73 2c20 7365 6520 5365 6374 696f 6e20 ns, see Section │ │ │ │ -0018f020: 3c61 2063 6c61 7373 3d22 656c 2220 6872 The C │ │ │ │ -0018f050: 5552 4c20 706c 7567 696e 3c2f 613e 2e3c URL plugin.< │ │ │ │ -0018f060: 2f70 3e0a 3c70 3ef0 9f94 9d20 3c61 2068 /p>.

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

    .

    .Zlib compr │ │ │ │ -0018f0d0: 6573 7369 6f6e 3c2f 6832 3e0a 3c70 3e54 ession

    .

    T │ │ │ │ -0018f0e0: 6f20 656e 6162 6c65 2064 6566 6c61 7465 o enable deflate │ │ │ │ -0018f0f0: 2061 6e64 2067 7a69 7020 636f 6d70 7265 and gzip compre │ │ │ │ -0018f100: 7373 696f 6e20 7769 7468 205a 6c69 622c ssion with Zlib, │ │ │ │ -0018f110: 2069 6e73 7461 6c6c 205a 6c69 6220 6672 install Zlib fr │ │ │ │ -0018f120: 6f6d 203c 6120 6872 6566 3d22 6874 7470 om http://www.zlib │ │ │ │ -0018f150: 2e6f 7267 3c2f 613e 2069 6620 6e6f 7420 .org if not │ │ │ │ -0018f160: 616c 7265 6164 7920 696e 7374 616c 6c65 already installe │ │ │ │ -0018f170: 6420 6f6e 2079 6f75 7220 7379 7374 656d d on your system │ │ │ │ -0018f180: 2e20 436f 6d70 696c 6520 3c65 6d3e 3c63 . Compile gsoap/stdsoa │ │ │ │ -0018f1a0: 7032 2e63 7070 3c2f 636f 6465 3e3c 2f65 p2.cpp (or gsoap/stdsoap2. │ │ │ │ -0018f1d0: 633c 2f63 6f64 653e 3c2f 656d 3e29 2061 c) a │ │ │ │ -0018f1e0: 6e64 2061 6c6c 2079 6f75 7220 736f 7572 nd all your sour │ │ │ │ -0018f1f0: 6365 7320 7468 6174 2069 6e63 6c75 6465 ces that include │ │ │ │ -0018f200: 203c 656d 3e3c 636f 6465 3e67 736f 6170 gsoap │ │ │ │ -0018f210: 2f73 7464 736f 6170 322e 683c 2f63 6f64 /stdsoap2.h or < │ │ │ │ -0018f230: 636f 6465 3e73 6f61 7048 2e68 3c2f 636f code>soapH.h with co │ │ │ │ -0018f250: 6d70 696c 652d 7469 6d65 2066 6c61 6720 mpile-time flag │ │ │ │ -0018f260: 3c63 6f64 653e 2357 4954 485f 475a 4950 #WITH_GZIP │ │ │ │ -0018f270: 3c2f 636f 6465 3e20 616e 6420 6c69 6e6b and link │ │ │ │ -0018f280: 2079 6f75 7220 636f 6465 2077 6974 6820 your code with │ │ │ │ -0018f290: 7468 6520 5a6c 6962 206c 6962 7261 7279 the Zlib library │ │ │ │ -0018f2a0: 2c20 652e 672e 203c 623e 3c63 6f64 653e , e.g. │ │ │ │ -0018f2b0: 2d6c 7a3c 2f63 6f64 653e 3c2f 623e 206f -lz o │ │ │ │ -0018f2c0: 6e20 556e 6978 2f4c 696e 7578 2070 6c61 n Unix/Linux pla │ │ │ │ -0018f2d0: 7466 6f72 6d73 2e3c 2f70 3e0a 3c70 3e54 tforms.

    .

    T │ │ │ │ -0018f2e0: 6865 2067 7a69 7020 636f 6d70 7265 7373 he gzip compress │ │ │ │ -0018f2f0: 696f 6e20 6973 206f 7274 686f 676f 6e61 ion is orthogona │ │ │ │ -0018f300: 6c20 746f 2061 6c6c 2074 7261 6e73 706f l to all transpo │ │ │ │ -0018f310: 7274 2065 6e63 6f64 696e 6773 2073 7563 rt encodings suc │ │ │ │ -0018f320: 6820 6173 2048 5454 502c 2053 534c 2c20 h as HTTP, SSL, │ │ │ │ -0018f330: 4449 4d45 2c20 616e 6420 6361 6e20 6265 DIME, and can be │ │ │ │ -0018f340: 2075 7365 6420 7769 7468 206f 7468 6572 used with other │ │ │ │ -0018f350: 2074 7261 6e73 706f 7274 206c 6179 6572 transport layer │ │ │ │ -0018f360: 732e 2059 6f75 2063 616e 2065 7665 6e20 s. You can even │ │ │ │ -0018f370: 7361 7665 2061 6e64 206c 6f61 6420 636f save and load co │ │ │ │ -0018f380: 6d70 7265 7373 6564 2058 4d4c 2064 6174 mpressed XML dat │ │ │ │ -0018f390: 6120 746f 2f66 726f 6d20 6669 6c65 732e a to/from files. │ │ │ │ -0018f3a0: 3c2f 703e 0a3c 703e 5477 6f20 636f 6d70

    .

    Two comp │ │ │ │ -0018f3b0: 7265 7373 696f 6e20 666f 726d 6174 7320 ression formats │ │ │ │ -0018f3c0: 6172 6520 7375 7070 6f72 7465 6420 6279 are supported by │ │ │ │ -0018f3d0: 2074 6865 2065 6e67 696e 653a 2064 6566 the engine: def │ │ │ │ -0018f3e0: 6c61 7465 2061 6e64 2067 7a69 702e 2054 late and gzip. T │ │ │ │ -0018f3f0: 6865 2067 7a69 7020 666f 726d 6174 2069 he gzip format i │ │ │ │ -0018f400: 7320 7573 6564 2062 7920 6465 6661 756c s used by defaul │ │ │ │ -0018f410: 742e 2054 6865 2067 7a69 7020 666f 726d t. The gzip form │ │ │ │ -0018f420: 6174 2068 6173 2073 6576 6572 616c 2062 at has several b │ │ │ │ -0018f430: 656e 6566 6974 7320 6f76 6572 2064 6566 enefits over def │ │ │ │ -0018f440: 6c61 7465 2e20 4669 7273 746c 792c 2074 late. Firstly, t │ │ │ │ -0018f450: 6865 2065 6e67 696e 6520 6175 746f 6d61 he engine automa │ │ │ │ -0018f460: 7469 6361 6c6c 7920 6465 7465 6374 7320 tically detects │ │ │ │ -0018f470: 677a 6970 2063 6f6d 7072 6573 7365 6420 gzip compressed │ │ │ │ -0018f480: 696e 626f 756e 6420 6d65 7373 6167 6573 inbound messages │ │ │ │ -0018f490: 2c20 6576 656e 2077 6974 686f 7574 2048 , even without H │ │ │ │ -0018f4a0: 5454 5020 6865 6164 6572 732c 2062 7920 TTP headers, by │ │ │ │ -0018f4b0: 6368 6563 6b69 6e67 2066 6f72 2074 6865 checking for the │ │ │ │ -0018f4c0: 2070 7265 7365 6e63 6520 6f66 2061 2067 presence of a g │ │ │ │ -0018f4d0: 7a69 7020 6865 6164 6572 2069 6e20 7468 zip header in th │ │ │ │ -0018f4e0: 6520 6d65 7373 6167 6520 636f 6e74 656e e message conten │ │ │ │ -0018f4f0: 742e 2053 6563 6f6e 646c 792c 2067 7a69 t. Secondly, gzi │ │ │ │ -0018f500: 7020 696e 636c 7564 6573 2061 2043 5243 p includes a CRC │ │ │ │ -0018f510: 3332 2063 6865 636b 7375 6d20 746f 2065 32 checksum to e │ │ │ │ -0018f520: 6e73 7572 6520 6d65 7373 6167 6573 2068 nsure messages h │ │ │ │ -0018f530: 6176 6520 6265 656e 2063 6f72 7265 6374 ave been correct │ │ │ │ -0018f540: 6c79 2072 6563 6569 7665 642e 2054 6869 ly received. Thi │ │ │ │ -0018f550: 7264 6c79 2c20 677a 6970 2063 6f6d 7072 rdly, gzip compr │ │ │ │ -0018f560: 6573 7365 6420 636f 6e74 656e 7420 6361 essed content ca │ │ │ │ -0018f570: 6e20 6265 2064 6563 6f6d 7072 6573 7365 n be decompresse │ │ │ │ -0018f580: 6420 7769 7468 206f 7468 6572 2063 6f6d d with other com │ │ │ │ -0018f590: 7072 6573 7369 6f6e 2073 6f66 7477 6172 pression softwar │ │ │ │ -0018f5a0: 652c 2073 6f20 796f 7520 6361 6e20 6465 e, so you can de │ │ │ │ -0018f5b0: 636f 6d70 7265 7373 2058 4d4c 2064 6174 compress XML dat │ │ │ │ -0018f5c0: 6120 7361 7665 6420 6279 2061 2067 534f a saved by a gSO │ │ │ │ -0018f5d0: 4150 2061 7070 6c69 6361 7469 6f6e 2069 AP application i │ │ │ │ -0018f5e0: 6e20 677a 6970 2066 6f72 6d61 742e 3c2f n gzip format..

    Gzip compr │ │ │ │ -0018f600: 6573 7369 6f6e 2069 7320 656e 6162 6c65 ession is enable │ │ │ │ -0018f610: 6420 6279 2063 6f6d 7069 6c69 6e67 2074 d by compiling t │ │ │ │ -0018f620: 6865 2073 6f75 7263 6573 2077 6974 6820 he sources with │ │ │ │ -0018f630: 636f 6d70 696c 652d 7469 6d65 2066 6c61 compile-time fla │ │ │ │ -0018f640: 6720 3c63 6f64 653e 2357 4954 485f 475a g #WITH_GZ │ │ │ │ -0018f650: 4950 3c2f 636f 6465 3e2e 2054 6f20 7472 IP. To tr │ │ │ │ -0018f660: 616e 736d 6974 2067 7a69 7020 636f 6d70 ansmit gzip comp │ │ │ │ -0018f670: 7265 7373 6564 2053 4f41 502f 584d 4c20 ressed SOAP/XML │ │ │ │ -0018f680: 6461 7461 2c20 7365 7420 7468 6520 6f75 data, set the ou │ │ │ │ -0018f690: 7470 7574 206d 6f64 6520 666c 6167 7320 tput mode flags │ │ │ │ -0018f6a0: 746f 203c 636f 6465 3e23 534f 4150 5f45 to #SOAP_E │ │ │ │ -0018f6b0: 4e43 5f5a 4c49 423c 2f63 6f64 653e 2e20 NC_ZLIB. │ │ │ │ -0018f6c0: 466f 7220 6578 616d 706c 653a 3c2f 703e For example:

    │ │ │ │ -0018f6d0: 0a3c 6469 7620 636c 6173 733d 2266 7261 .
    so │ │ │ │ -0018f750: 6170 5f69 6e69 743c 2f61 3e28 2661 6d70 ap_init(& │ │ │ │ -0018f760: 3b3c 6120 636c 6173 733d 2263 6f64 6522 ;soap │ │ │ │ -0018f790: 293b 203c 2f64 6976 3e0a 3c64 6976 2063 );
    .
    soap_set_omode< │ │ │ │ -0018f810: 2f61 3e28 2661 6d70 3b3c 6120 636c 6173 /a>(& │ │ │ │ -0018f840: 736f 6170 3c2f 613e 2c20 3c61 2063 6c61 soap, SOA │ │ │ │ -0018f8a0: 505f 454e 435f 5a4c 4942 3c2f 613e 293b P_ENC_ZLIB); │ │ │ │ -0018f8b0: 203c 7370 616e 2063 6c61 7373 3d22 636f // enable │ │ │ │ -0018f8d0: 205a 6c69 6226 2333 393b 7320 677a 6970 Zlib's gzip │ │ │ │ -0018f8e0: 203c 2f73 7061 6e3e 3c2f 6469 763e 0a3c
    .< │ │ │ │ -0018f8f0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -0018f900: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >if (soap_call_ │ │ │ │ -0018f930: 6e73 5f5f 6d79 4d65 7468 6f64 2826 616d ns__myMethod(&am │ │ │ │ -0018f940: 703b 3c61 2063 6c61 7373 3d22 636f 6465 p;soap, ...))
    . │ │ │ │ -0018f980: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    ... // │ │ │ │ -0018f9b0: 2065 7272 6f72 3c2f 7370 616e 3e3c 2f64 error.
    │ │ │ │ -0018f9f0: 656c 7365 3c2f 7370 616e 3e3c 2f64 6976 else
    .
    ... │ │ │ │ -0018fa30: 2f2f 2073 7563 6365 7373 3c2f 7370 616e // success
    .
    s │ │ │ │ -0018fab0: 6f61 705f 636c 725f 6f6d 6f64 653c 2f61 oap_clr_omode(&so │ │ │ │ -0018faf0: 6170 3c2f 613e 2c20 3c61 2063 6c61 7373 ap, SOAP_ │ │ │ │ -0018fb50: 454e 435f 5a4c 4942 3c2f 613e 293b 203c ENC_ZLIB); < │ │ │ │ -0018fb60: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ -0018fb70: 656e 7422 3e2f 2f20 6469 7361 626c 6520 ent">// disable │ │ │ │ -0018fb80: 5a6c 6962 2623 3339 3b73 2067 7a69 7020 Zlib's gzip │ │ │ │ -0018fb90: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    .
    SOAP_ │ │ │ │ -0018fc50: 454e 435f 5a4c 4942 3c2f 613e 3c2f 6469 ENC_ZLIB
    #define SO │ │ │ │ -0018fc80: 4150 5f45 4e43 5f5a 4c49 423c 2f64 6976 AP_ENC_ZLIB
    soap_mode EN │ │ │ │ -0018fcb0: 4320 6f75 7470 7574 2066 6c61 6720 7661 C output flag va │ │ │ │ -0018fcc0: 6c75 6520 746f 2063 6f6d 7072 6573 7320 lue to compress │ │ │ │ -0018fcd0: 6d65 7373 6167 6573 2073 656e 742c 2072 messages sent, r │ │ │ │ -0018fce0: 6571 7569 7265 7320 7a6c 6962 2065 6e61 equires zlib ena │ │ │ │ -0018fcf0: 626c 6564 2077 6974 6820 636f 6d70 696c bled with compil │ │ │ │ -0018fd00: 652d 7469 6d65 2066 6c2e 2e2e 3c2f 6469 e-time fl...
    Definiti │ │ │ │ -0018fd30: 6f6e 3a3c 2f62 3e20 7374 6473 6f61 7032 on: stdsoap2 │ │ │ │ -0018fd40: 2e68 3a31 3738 383c 2f64 6976 3e3c 2f64 .h:1788
    .

    Th │ │ │ │ -0018fd70: 6973 2077 696c 6c20 7365 6e64 2061 2063 is will send a c │ │ │ │ -0018fd80: 6f6d 7072 6573 7365 6420 534f 4150 2f58 ompressed SOAP/X │ │ │ │ -0018fd90: 4d4c 2072 6571 7565 7374 2074 6f20 6120 ML request to a │ │ │ │ -0018fda0: 7365 7276 6963 652c 2070 726f 7669 6465 service, provide │ │ │ │ -0018fdb0: 6420 7468 6174 205a 6c69 6220 6973 2069 d that Zlib is i │ │ │ │ -0018fdc0: 6e73 7461 6c6c 6564 2061 6e64 206c 696e nstalled and lin │ │ │ │ -0018fdd0: 6b65 6420 7769 7468 2074 6865 2061 7070 ked with the app │ │ │ │ -0018fde0: 6c69 6361 7469 6f6e 2061 6e64 2074 6865 lication and the │ │ │ │ -0018fdf0: 2063 6f6d 7069 6c65 2d74 696d 6520 666c compile-time fl │ │ │ │ -0018fe00: 6167 203c 636f 6465 3e23 5749 5448 5f47 ag #WITH_G │ │ │ │ -0018fe10: 5a49 503c 2f63 6f64 653e 206f 7074 696f ZIP optio │ │ │ │ -0018fe20: 6e20 7761 7320 7573 6564 2074 6f20 636f n was used to co │ │ │ │ -0018fe30: 6d70 696c 6520 7468 6520 736f 7572 6365 mpile the source │ │ │ │ -0018fe40: 732e 2052 6563 6569 7669 6e67 2063 6f6d s. Receiving com │ │ │ │ -0018fe50: 7072 6573 7365 6420 534f 4150 2f58 4d4c pressed SOAP/XML │ │ │ │ -0018fe60: 206f 7665 7220 4854 5450 2065 6974 6865 over HTTP eithe │ │ │ │ -0018fe70: 7220 696e 2067 7a69 7020 6f72 2064 6566 r in gzip or def │ │ │ │ -0018fe80: 6c61 7465 2066 6f72 6d61 7473 2069 7320 late formats is │ │ │ │ -0018fe90: 6175 746f 6d61 7469 632e 2054 6865 203c automatic. The < │ │ │ │ -0018fea0: 636f 6465 3e23 534f 4150 5f45 4e43 5f5a code>#SOAP_ENC_Z │ │ │ │ -0018feb0: 4c49 423c 2f63 6f64 653e 2066 6c61 6720 LIB flag │ │ │ │ -0018fec0: 646f 6573 206e 6f74 2068 6176 6520 746f does not have to │ │ │ │ -0018fed0: 2062 6520 7365 7420 6174 2074 6865 2073 be set at the s │ │ │ │ -0018fee0: 6572 7665 7220 7369 6465 2074 6f20 6163 erver side to ac │ │ │ │ -0018fef0: 6365 7074 2063 6f6d 7072 6573 7365 6420 cept compressed │ │ │ │ -0018ff00: 6d65 7373 6167 6573 2e20 5265 6164 696e messages. Readin │ │ │ │ -0018ff10: 6720 616e 6420 7265 6365 6976 696e 6720 g and receiving │ │ │ │ -0018ff20: 677a 6970 2063 6f6d 7072 6573 7365 6420 gzip compressed │ │ │ │ -0018ff30: 534f 4150 2f58 4d4c 2077 6974 686f 7574 SOAP/XML without │ │ │ │ -0018ff40: 2048 5454 5020 6865 6164 6572 7320 2865 HTTP headers (e │ │ │ │ -0018ff50: 2e67 2e20 7769 7468 206f 7468 6572 2074 .g. with other t │ │ │ │ -0018ff60: 7261 6e73 706f 7274 2070 726f 746f 636f ransport protoco │ │ │ │ -0018ff70: 6c73 2920 6973 2061 6c73 6f20 6175 746f ls) is also auto │ │ │ │ -0018ff80: 6d61 7469 632e 3c2f 703e 0a3c 703e 546f matic.

    .

    To │ │ │ │ -0018ff90: 2063 6f6e 7472 6f6c 2074 6865 206c 6576 control the lev │ │ │ │ -0018ffa0: 656c 206f 6620 636f 6d70 7265 7373 696f el of compressio │ │ │ │ -0018ffb0: 6e20 666f 7220 6f75 7462 6f75 6e64 206d n for outbound m │ │ │ │ -0018ffc0: 6573 7361 6765 732c 2079 6f75 2063 616e essages, you can │ │ │ │ -0018ffd0: 2073 6574 2074 6865 203c 636f 6465 3e3c set the < │ │ │ │ -0018ffe0: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ -0018fff0: 663d 2273 7472 7563 7473 6f61 702e 6874 f="structsoap.ht │ │ │ │ -00190000: 6d6c 2361 3966 6165 3436 3434 3665 6263 ml#a9fae46446ebc │ │ │ │ -00190010: 6231 6135 3134 3137 6632 6330 6331 6462 b1a51417f2c0c1db │ │ │ │ -00190020: 3331 6638 2220 7469 746c 653d 2255 7365 31f8" title="Use │ │ │ │ -00190030: 722d 6465 6669 6e61 626c 6520 636f 6d70 r-definable comp │ │ │ │ -00190040: 7265 7373 696f 6e20 6c65 7665 6c20 666f ression level fo │ │ │ │ -00190050: 7220 677a 6970 2063 6f6d 7072 6573 7369 r gzip compressi │ │ │ │ -00190060: 6f6e 2028 303d 6e6f 6e65 2c20 313d 6661 on (0=none, 1=fa │ │ │ │ -00190070: 7374 2074 6f20 393d 6265 7374 2920 6465 st to 9=best) de │ │ │ │ -00190080: 6661 756c 7420 6c65 7665 6c20 6973 2036 fault level is 6 │ │ │ │ -00190090: 2e22 3e73 6f61 703a 3a7a 5f6c 6576 656c .">soap::z_level │ │ │ │ -001900a0: 3c2f 613e 3c2f 636f 6465 3e20 746f 2061 to a │ │ │ │ -001900b0: 2076 616c 7565 2062 6574 7765 656e 2031 value between 1 │ │ │ │ -001900c0: 2061 6e64 2039 2c20 7768 6572 6520 3120 and 9, where 1 │ │ │ │ -001900d0: 6973 2074 6865 2062 6573 7420 7370 6565 is the best spee │ │ │ │ -001900e0: 6420 616e 6420 3920 6973 2074 6865 2062 d and 9 is the b │ │ │ │ -001900f0: 6573 7420 636f 6d70 7265 7373 696f 6e20 est compression │ │ │ │ -00190100: 2864 6566 6175 6c74 2069 7320 3629 2e20 (default is 6). │ │ │ │ -00190110: 466f 7220 6578 616d 706c 653c 2f70 3e0a For example

    . │ │ │ │ -00190120: 3c64 6976 2063 6c61 7373 3d22 6672 6167
    soa │ │ │ │ -001901a0: 705f 696e 6974 3c2f 613e 2826 616d 703b p_init(& │ │ │ │ -001901b0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap) │ │ │ │ -001901e0: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
    ..
    │ │ │ │ -00190340: 736f 6170 3c2f 613e 2e3c 6120 636c 6173 soap.z_level = │ │ │ │ -001903a0: 393b 203c 7370 616e 2063 6c61 7373 3d22 9; // best │ │ │ │ -001903c0: 2063 6f6d 7072 6573 7369 6f6e 203c 2f73 compression
    .
    u │ │ │ │ -001904a0: 6e73 6967 6e65 6420 7368 6f72 7420 7a5f nsigned short z_ │ │ │ │ -001904b0: 6c65 7665 6c3c 2f64 6976 3e3c 6469 7620 level
    Us │ │ │ │ -001904d0: 6572 2d64 6566 696e 6162 6c65 2063 6f6d er-definable com │ │ │ │ -001904e0: 7072 6573 7369 6f6e 206c 6576 656c 2066 pression level f │ │ │ │ -001904f0: 6f72 2067 7a69 7020 636f 6d70 7265 7373 or gzip compress │ │ │ │ -00190500: 696f 6e20 2830 3d6e 6f6e 652c 2031 3d66 ion (0=none, 1=f │ │ │ │ -00190510: 6173 7420 746f 2039 3d62 6573 7429 2064 ast to 9=best) d │ │ │ │ -00190520: 6566 6175 6c74 206c 6576 656c 2069 7320 efault level is │ │ │ │ -00190530: 362e 3c2f 6469 763e 3c64 6976 2063 6c61 6.
    De │ │ │ │ -00190550: 6669 6e69 7469 6f6e 3a3c 2f62 3e20 7374 finition: st │ │ │ │ -00190560: 6473 6f61 7032 2e68 3a33 3730 343c 2f64 dsoap2.h:3704
    .
    │ │ │ │ -00190580: 3c21 2d2d 2066 7261 676d 656e 7420 2d2d

    │ │ │ │ -00190eb0: 4e6f 7465 3a20 6c6f 7765 7220 7261 7469 Note: lower rati │ │ │ │ -00190ec0: 6f73 206d 6561 6e20 6869 6768 6572 2063 os mean higher c │ │ │ │ -00190ed0: 6f6d 7072 6573 7369 6f6e 2072 6174 6573 ompression rates │ │ │ │ -00190ee0: 2e3c 2f70 3e0a 3c70 3e43 6f6d 7072 6573 .

    .

    Compres │ │ │ │ -00190ef0: 7365 6420 7472 616e 7366 6572 7320 7265 sed transfers re │ │ │ │ -00190f00: 7175 6972 6520 6275 6666 6572 696e 6720 quire buffering │ │ │ │ -00190f10: 7468 6520 656e 7469 7265 206f 7574 7075 the entire outpu │ │ │ │ -00190f20: 7420 6d65 7373 6167 6520 746f 2064 6574 t message to det │ │ │ │ -00190f30: 6572 6d69 6e65 2048 5454 5020 6d65 7373 ermine HTTP mess │ │ │ │ -00190f40: 6167 6520 6c65 6e67 7468 2e20 5468 6973 age length. This │ │ │ │ -00190f50: 206d 6561 6e73 2074 6861 7420 7468 6520 means that the │ │ │ │ -00190f60: 3c63 6f64 653e 2353 4f41 505f 494f 5f53 #SOAP_IO_S │ │ │ │ -00190f70: 544f 5245 3c2f 636f 6465 3e20 666c 6167 TORE flag │ │ │ │ -00190f80: 2069 7320 6175 746f 6d61 7469 6361 6c6c is automaticall │ │ │ │ -00190f90: 7920 7365 7420 7768 656e 2074 6865 203c y set when the < │ │ │ │ -00190fa0: 636f 6465 3e23 534f 4150 5f45 4e43 5f5a code>#SOAP_ENC_Z │ │ │ │ -00190fb0: 4c49 423c 2f63 6f64 653e 2066 6c61 6720 LIB flag │ │ │ │ -00190fc0: 6973 2073 6574 2074 6f20 7365 6e64 2063 is set to send c │ │ │ │ -00190fd0: 6f6d 7072 6573 7365 6420 6d65 7373 6167 ompressed messag │ │ │ │ -00190fe0: 6573 2e20 5468 6520 7573 6520 6f66 2048 es. The use of H │ │ │ │ -00190ff0: 5454 5020 6368 756e 6b69 6e67 2073 6967 TTP chunking sig │ │ │ │ -00191000: 6e69 6669 6361 6e74 6c79 2072 6564 7563 nificantly reduc │ │ │ │ -00191010: 6573 206d 656d 6f72 7920 7573 6167 6520 es memory usage │ │ │ │ -00191020: 616e 6420 6d61 7920 7370 6565 6420 7570 and may speed up │ │ │ │ -00191030: 2074 6865 2074 7261 6e73 6d69 7373 696f the transmissio │ │ │ │ -00191040: 6e20 6f66 2063 6f6d 7072 6573 7365 6420 n of compressed │ │ │ │ -00191050: 534f 4150 2f58 4d4c 206d 6573 7361 6765 SOAP/XML message │ │ │ │ -00191060: 732e 2054 6869 7320 6973 2061 6363 6f6d s. This is accom │ │ │ │ -00191070: 706c 6973 6865 6420 6279 2073 6574 7469 plished by setti │ │ │ │ -00191080: 6e67 2074 6865 203c 636f 6465 3e23 534f ng the #SO │ │ │ │ -00191090: 4150 5f49 4f5f 4348 554e 4b3c 2f63 6f64 AP_IO_CHUNK flag with #SOAP_ENC_ZLI │ │ │ │ -001910c0: 423c 2f63 6f64 653e 2066 6f72 2074 6865 B for the │ │ │ │ -001910d0: 206f 7574 7075 7420 6d6f 6465 2e20 486f output mode. Ho │ │ │ │ -001910e0: 7765 7665 722c 2073 6f6d 6520 5765 6220 wever, some Web │ │ │ │ -001910f0: 7365 7276 6572 7320 646f 206e 6f74 2061 servers do not a │ │ │ │ -00191100: 6363 6570 7420 4854 5450 2063 6875 6e6b ccept HTTP chunk │ │ │ │ -00191110: 6564 2072 6571 7565 7374 206d 6573 7361 ed request messa │ │ │ │ -00191120: 6765 7320 2865 7665 6e20 7768 656e 2074 ges (even when t │ │ │ │ -00191130: 6865 7920 7265 7475 726e 2048 5454 5020 hey return HTTP │ │ │ │ -00191140: 6368 756e 6b65 6420 6d65 7373 6167 6573 chunked messages │ │ │ │ -00191150: 2129 2e20 5374 616e 642d 616c 6f6e 6520 !). Stand-alone │ │ │ │ -00191160: 6753 4f41 5020 7365 7276 6963 6573 2061 gSOAP services a │ │ │ │ -00191170: 6c77 6179 7320 6163 6365 7074 2063 6875 lways accept chu │ │ │ │ -00191180: 6e6b 6564 2072 6571 7565 7374 206d 6573 nked request mes │ │ │ │ -00191190: 7361 6765 732e 3c2f 703e 0a3c 703e 546f sages.

    .

    To │ │ │ │ -001911a0: 2072 6573 7472 6963 7420 7468 6520 636f restrict the co │ │ │ │ -001911b0: 6d70 7265 7373 696f 6e20 746f 2074 6865 mpression to the │ │ │ │ -001911c0: 2064 6566 6c61 7465 2066 6f72 6d61 7420 deflate format │ │ │ │ -001911d0: 6f6e 6c79 2c20 636f 6d70 696c 6520 7468 only, compile th │ │ │ │ -001911e0: 6520 736f 7572 6365 7320 7769 7468 2074 e sources with t │ │ │ │ -001911f0: 6865 2063 6f6d 7069 6c65 2d74 696d 6520 he compile-time │ │ │ │ -00191200: 666c 6167 203c 636f 6465 3e23 5749 5448 flag #WITH │ │ │ │ -00191210: 5f5a 4c49 423c 2f63 6f64 653e 2e20 5468 _ZLIB. Th │ │ │ │ -00191220: 6973 206c 696d 6974 7320 636f 6d70 7265 is limits compre │ │ │ │ -00191230: 7373 696f 6e20 616e 6420 6465 636f 6d70 ssion and decomp │ │ │ │ -00191240: 7265 7373 696f 6e20 746f 2074 6865 2064 ression to the d │ │ │ │ -00191250: 6566 6c61 7465 2066 6f72 6d61 742e 204f eflate format. O │ │ │ │ -00191260: 6e6c 7920 706c 6169 6e20 616e 6420 6465 nly plain and de │ │ │ │ -00191270: 666c 6174 6564 206d 6573 7361 6765 7320 flated messages │ │ │ │ -00191280: 6361 6e20 6265 2065 7863 6861 6e67 6564 can be exchanged │ │ │ │ -00191290: 2c20 677a 6970 2069 7320 6e6f 7420 7375 , gzip is not su │ │ │ │ -001912a0: 7070 6f72 7465 6420 7769 7468 2074 6869 pported with thi │ │ │ │ -001912b0: 7320 6f70 7469 6f6e 2e20 5265 6365 6976 s option. Receiv │ │ │ │ -001912c0: 696e 6720 677a 6970 2063 6f6d 7072 6573 ing gzip compres │ │ │ │ -001912d0: 7365 6420 636f 6e74 656e 7420 6973 2061 sed content is a │ │ │ │ -001912e0: 7574 6f6d 6174 6963 2c20 6576 656e 2069 utomatic, even i │ │ │ │ -001912f0: 6e20 7468 6520 6162 7365 6e63 6520 6f66 n the absence of │ │ │ │ -00191300: 2048 5454 5020 6865 6164 6572 732e 2052 HTTP headers. R │ │ │ │ -00191310: 6563 6569 7669 6e67 2064 6566 6c61 7465 eceiving deflate │ │ │ │ -00191320: 2063 6f6d 7072 6573 7365 6420 636f 6e74 compressed cont │ │ │ │ -00191330: 656e 7420 6973 206e 6f74 2061 7574 6f6d ent is not autom │ │ │ │ -00191340: 6174 6963 2069 6e20 7468 6520 6162 7365 atic in the abse │ │ │ │ -00191350: 6e63 6520 6f66 2048 5454 5020 6865 6164 nce of HTTP head │ │ │ │ -00191360: 6572 7320 616e 6420 7265 7175 6972 6573 ers and requires │ │ │ │ -00191370: 2074 6865 2066 6c61 6720 3c63 6f64 653e the flag │ │ │ │ -00191380: 2353 4f41 505f 454e 435f 5a4c 4942 3c2f #SOAP_ENC_ZLIB to be set │ │ │ │ -001913a0: 666f 7220 7468 6520 696e 7075 7420 6d6f for the input mo │ │ │ │ -001913b0: 6465 2074 6f20 6465 636f 6d70 7265 7373 de to decompress │ │ │ │ -001913c0: 2064 6566 6c61 7465 6420 6461 7461 2e3c deflated data.< │ │ │ │ -001913d0: 2f70 3e0a 3c64 6c20 636c 6173 733d 2273 /p>.

    │ │ │ │ -001913f0: 3c64 743e 5761 726e 696e 673c 2f64 743e
    Warning
    │ │ │ │ -00191400: 3c64 643e 4974 2069 7320 696d 706f 7274
    It is import │ │ │ │ -00191410: 616e 7420 7468 6174 2074 6865 203c 636f ant that the #WITH_GZIP and # │ │ │ │ -00191440: 5749 5448 5f5a 4c49 423c 2f63 6f64 653e WITH_ZLIB │ │ │ │ -00191450: 206d 6163 726f 7320 6d75 7374 2062 6520 macros must be │ │ │ │ -00191460: 636f 6e73 6973 7465 6e74 6c79 2064 6566 consistently def │ │ │ │ -00191470: 696e 6564 2074 6f20 636f 6d70 696c 6520 ined to compile │ │ │ │ -00191480: 7468 6520 736f 7572 6365 732c 2073 7563 the sources, suc │ │ │ │ -00191490: 6820 6173 203c 656d 3e3c 636f 6465 3e67 h as g │ │ │ │ -001914a0: 736f 6170 2f73 7464 736f 6170 322e 6370 soap/stdsoap2.cp │ │ │ │ -001914b0: 703c 2f63 6f64 653e 3c2f 656d 3e2c 203c p, < │ │ │ │ -001914c0: 656d 3e3c 636f 6465 3e73 6f61 7043 2e63 em>soapC.c │ │ │ │ -001914d0: 7070 3c2f 636f 6465 3e3c 2f65 6d3e 2c20 pp, │ │ │ │ -001914e0: 3c65 6d3e 3c63 6f64 653e 736f 6170 436c soapCl │ │ │ │ -001914f0: 6965 6e74 2e63 7070 3c2f 636f 6465 3e3c ient.cpp< │ │ │ │ -00191500: 2f65 6d3e 2c20 3c65 6d3e 3c63 6f64 653e /em>, │ │ │ │ -00191510: 736f 6170 5365 7276 6572 2e63 7070 3c2f soapServer.cpp, and │ │ │ │ -00191530: 616c 6c20 6170 706c 6963 6174 696f 6e20 all application │ │ │ │ -00191540: 736f 7572 6365 7320 7468 6174 2069 6e63 sources that inc │ │ │ │ -00191550: 6c75 6465 203c 656d 3e3c 636f 6465 3e67 lude g │ │ │ │ -00191560: 736f 6170 2f73 7464 736f 6170 322e 683c soap/stdsoap2.h< │ │ │ │ -00191570: 2f63 6f64 653e 3c2f 656d 3e20 6f72 203c /code> or < │ │ │ │ -00191580: 656d 3e3c 636f 6465 3e73 6f61 7048 2e68 em>soapH.h │ │ │ │ -00191590: 3c2f 636f 6465 3e3c 2f65 6d3e 2e20 4966 . If │ │ │ │ -001915a0: 2074 6865 206d 6163 726f 7320 6172 6520 the macros are │ │ │ │ -001915b0: 6e6f 7420 636f 6e73 6973 7465 6e74 6c79 not consistently │ │ │ │ -001915c0: 2075 7365 642c 2074 6865 2061 7070 6c69 used, the appli │ │ │ │ -001915d0: 6361 7469 6f6e 2077 696c 6c20 6372 6173 cation will cras │ │ │ │ -001915e0: 6820 6475 6520 746f 2061 206d 6973 6d61 h due to a misma │ │ │ │ -001915f0: 7463 6865 7320 696e 2074 6865 2064 6563 tches in the dec │ │ │ │ -00191600: 6c61 7261 7469 6f6e 2061 6e64 2061 6363 laration and acc │ │ │ │ -00191610: 6573 7320 6f66 2074 6865 203c 636f 6465 ess of the soa │ │ │ │ -00191670: 703c 2f61 3e3c 2f63 6f64 653e 2063 6f6e p con │ │ │ │ -00191680: 7465 7874 2e3c 2f64 643e 3c2f 646c 3e0a text.
    . │ │ │ │ -00191690: 3c70 3ef0 9f94 9d20 3c61 2068 7265 663d

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

    .

    .Client-side c │ │ │ │ -00191700: 6f6f 6b69 6520 7375 7070 6f72 743c 2f68 ookie support.

    Client-sid │ │ │ │ -00191720: 6520 636f 6f6b 6965 2073 7570 706f 7274 e cookie support │ │ │ │ -00191730: 2069 7320 6f70 7469 6f6e 616c 2e20 546f is optional. To │ │ │ │ -00191740: 2065 6e61 626c 6520 636f 6f6b 6965 2073 enable cookie s │ │ │ │ -00191750: 7570 706f 7274 2c20 636f 6d70 696c 6520 upport, compile │ │ │ │ -00191760: 616c 6c20 736f 7572 6365 7320 7769 7468 all sources with │ │ │ │ -00191770: 2074 6865 2063 6f6d 7069 6c65 2d74 696d the compile-tim │ │ │ │ -00191780: 6520 666c 6167 203c 636f 6465 3e23 5749 e flag #WI │ │ │ │ -00191790: 5448 5f43 4f4f 4b49 4553 3c2f 636f 6465 TH_COOKIES, for example: │ │ │ │ -001917b0: 3c2f 703e 3c70 7265 2063 6c61 7373 3d22

     c++ -
    │ │ │ │ -001917d0: 4457 4954 485f 434f 4f4b 4945 5320 2d6f  DWITH_COOKIES -o
    │ │ │ │ -001917e0: 206d 7963 6c69 656e 7420 7374 6473 6f61   myclient stdsoa
    │ │ │ │ -001917f0: 7032 2e63 7070 2073 6f61 7043 2e63 7070  p2.cpp soapC.cpp
    │ │ │ │ -00191800: 2073 6f61 7043 6c69 656e 742e 6370 700a   soapClient.cpp.
    │ │ │ │ -00191810: 3c2f 7072 653e 3c70 3e20 6f72 2061 6464  

    or add │ │ │ │ -00191820: 2074 6865 2066 6f6c 6c6f 7769 6e67 206c the following l │ │ │ │ -00191830: 696e 6520 746f 203c 656d 3e3c 636f 6465 ine to stdsoap.h:

    .
    # │ │ │ │ -001918a0: 6465 6669 6e65 2057 4954 485f 434f 4f4b define WITH_COOK │ │ │ │ -001918b0: 4945 533c 2f73 7061 6e3e 3c2f 6469 763e IES
    │ │ │ │ -001918c0: 0a3c 2f64 6976 3e3c 212d 2d20 6672 6167 .

    Clien │ │ │ │ -001918e0: 742d 7369 6465 2063 6f6f 6b69 6520 7375 t-side cookie su │ │ │ │ -001918f0: 7070 6f72 7420 6973 2066 756c 6c79 2061 pport is fully a │ │ │ │ -00191900: 7574 6f6d 6174 6963 2e20 536f 206a 7573 utomatic. So jus │ │ │ │ -00191910: 7420 636f 6d70 696c 6520 3c65 6d3e 3c63 t compile gsoap/stdsoa │ │ │ │ -00191930: 7032 2e63 7070 3c2f 636f 6465 3e3c 2f65 p2.cpp with the comp │ │ │ │ -00191950: 696c 652d 7469 6d65 2066 6c61 6720 3c63 ile-time flag #WITH_COOKIE │ │ │ │ -00191970: 533c 2f63 6f64 653e 2074 6f20 656e 6162 S to enab │ │ │ │ -00191980: 6c65 2063 6f6f 6b69 652d 6261 7365 6420 le cookie-based │ │ │ │ -00191990: 7365 7373 696f 6e20 636f 6e74 726f 6c20 session control │ │ │ │ -001919a0: 696e 2079 6f75 7220 636c 6965 6e74 2e3c in your client.< │ │ │ │ -001919b0: 2f70 3e0a 3c70 3e41 2063 6f6f 6b69 6520 /p>.

    A cookie │ │ │ │ -001919c0: 7374 6f72 6520 7769 7468 2063 6f6f 6b69 store with cooki │ │ │ │ -001919d0: 6573 2069 7320 6b65 7074 2061 6e64 2072 es is kept and r │ │ │ │ -001919e0: 6574 7572 6e65 6420 746f 2074 6865 2061 eturned to the a │ │ │ │ -001919f0: 7070 726f 7072 6961 7465 2073 6572 7665 ppropriate serve │ │ │ │ -00191a00: 7273 2077 6865 6e20 7468 6520 636c 6965 rs when the clie │ │ │ │ -00191a10: 6e74 2063 6f6e 6e65 6374 7320 746f 2074 nt connects to t │ │ │ │ -00191a20: 6865 7365 2073 6572 7665 7273 2e20 436f hese servers. Co │ │ │ │ -00191a30: 6f6b 6965 7320 6172 6520 6e6f 7420 6175 okies are not au │ │ │ │ -00191a40: 746f 6d61 7469 6361 6c6c 7920 7361 7665 tomatically save │ │ │ │ -00191a50: 6420 746f 2061 2066 696c 6520 6279 2061 d to a file by a │ │ │ │ -00191a60: 2063 6c69 656e 742e 2041 6e20 6578 616d client. An exam │ │ │ │ -00191a70: 706c 6520 636f 6f6b 6965 2066 696c 6520 ple cookie file │ │ │ │ -00191a80: 6d61 6e61 6765 7220 6973 2069 6e63 6c75 manager is inclu │ │ │ │ -00191a90: 6465 6420 6173 2061 6e20 6578 7472 6173 ded as an extras │ │ │ │ -00191aa0: 2069 6e20 7468 6520 6753 4f41 5020 7061 in the gSOAP pa │ │ │ │ -00191ab0: 636b 6167 652e 2059 6f75 2063 616e 2072 ckage. You can r │ │ │ │ -00191ac0: 656d 6f76 6520 616c 6c20 636f 6f6b 6965 emove all cookie │ │ │ │ -00191ad0: 7320 6672 6f6d 2061 203c 636f 6465 3e3c s from a < │ │ │ │ -00191ae0: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ -00191af0: 663d 2273 7472 7563 7473 6f61 702e 6874 f="structsoap.ht │ │ │ │ -00191b00: 6d6c 2220 7469 746c 653d 2243 6f6e 7465 ml" title="Conte │ │ │ │ -00191b10: 7874 2077 6974 6820 7468 6520 656e 6769 xt with the engi │ │ │ │ -00191b20: 6e65 2073 7461 7465 2e22 3e73 6f61 703c ne state.">soap< │ │ │ │ -00191b30: 2f61 3e3c 2f63 6f64 653e 2063 6f6e 7465 /a> conte │ │ │ │ -00191b40: 7874 2062 7920 6361 6c6c 696e 6720 3c63 xt by calling soap_free_co │ │ │ │ -00191b60: 6f6b 6965 7328 736f 6170 293c 2f63 6f64 okies(soap), which also h │ │ │ │ -00191b80: 6170 7065 6e73 2077 6865 6e20 796f 7520 appens when you │ │ │ │ -00191b90: 6361 6c6c 203c 636f 6465 3e73 6f61 705f call soap_ │ │ │ │ -00191ba0: 646f 6e65 2873 6f61 7029 3c2f 636f 6465 done(soap).

    .

    To avo │ │ │ │ -00191bc0: 6964 2022 636f 6f6b 6965 2073 746f 726d id "cookie storm │ │ │ │ -00191bd0: 7322 2063 6175 7365 6420 6279 206d 616c s" caused by mal │ │ │ │ -00191be0: 6963 696f 7573 2073 6572 7665 7273 2074 icious servers t │ │ │ │ -00191bf0: 6861 7420 7265 7475 726e 2061 6e20 756e hat return an un │ │ │ │ -00191c00: 7265 6173 6f6e 6162 6c65 2061 6d6f 756e reasonable amoun │ │ │ │ -00191c10: 7420 6f66 2063 6f6f 6b69 6573 2c20 6753 t of cookies, gS │ │ │ │ -00191c20: 4f41 5020 636c 6965 6e74 732f 7365 7276 OAP clients/serv │ │ │ │ -00191c30: 6572 7320 6172 6520 6c69 6d69 7465 6420 ers are limited │ │ │ │ -00191c40: 746f 2061 2063 6f6f 6b69 6520 7374 6f72 to a cookie stor │ │ │ │ -00191c50: 6520 7369 7a65 206f 6620 3c63 6f64 653e e size of │ │ │ │ -00191c60: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap::co │ │ │ │ -00191d20: 6f6b 6965 5f6d 6178 3c2f 613e 3c2f 636f okie_max that the use │ │ │ │ -00191d40: 7220 6361 6e20 6368 616e 6765 2c20 666f r can change, fo │ │ │ │ -00191d50: 7220 6578 616d 706c 653a 3c2f 703e 0a3c r example:

    .< │ │ │ │ -00191d60: 6469 7620 636c 6173 733d 2266 7261 676d div class="fragm │ │ │ │ -00191d70: 656e 7422 3e3c 6469 7620 636c 6173 733d ent">
    str │ │ │ │ -00191da0: 7563 7420 3c2f 7370 616e 3e3c 6120 636c uct soap *soap = soap_new( │ │ │ │ -00191e70: 293b 203c 2f64 6976 3e0a 3c64 6976 2063 );
    .
    soap-> │ │ │ │ -00191ec0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 cookie_ │ │ │ │ -00191f10: 6d61 783c 2f61 3e20 3d20 3130 3b3c 2f64 max = 10;.
    int c │ │ │ │ -00191ff0: 6f6f 6b69 655f 6d61 783c 2f64 6976 3e3c ookie_max
    < │ │ │ │ -00192000: 6469 7620 636c 6173 733d 2274 7464 6f63 div class="ttdoc │ │ │ │ -00192010: 223e 5573 6572 2d64 6566 696e 6162 6c65 ">User-definable │ │ │ │ -00192020: 206d 6178 696d 756d 206e 756d 6265 7220 maximum number │ │ │ │ -00192030: 6f66 2061 6374 6976 6520 636f 6f6b 6965 of active cookie │ │ │ │ -00192040: 7320 616c 6c6f 7765 6420 746f 2062 6520 s allowed to be │ │ │ │ -00192050: 7365 7420 7769 7468 2073 6f61 705f 7365 set with soap_se │ │ │ │ -00192060: 745f 636f 6f6b 6965 2062 6566 6f72 6520 t_cookie before │ │ │ │ -00192070: 636f 6f6b 6965 202e 2e2e 3c2f 6469 763e cookie ...
    │ │ │ │ -00192080: 3c64 6976 2063 6c61 7373 3d22 7474 6465
    Definition │ │ │ │ -001920a0: 3a3c 2f62 3e20 7374 6473 6f61 7032 2e68 : stdsoap2.h │ │ │ │ -001920b0: 3a32 3937 333c 2f64 6976 3e3c 2f64 6976 :2973

    .

    The │ │ │ │ -001920e0: 636f 6f6b 6965 2073 746f 7265 2069 7320 cookie store is │ │ │ │ -001920f0: 6120 6c69 6e6b 6564 206c 6973 7420 6f66 a linked list of │ │ │ │ -00192100: 203c 636f 6465 3e3c 6120 636c 6173 733d so │ │ │ │ -00192150: 6170 5f63 6f6f 6b69 653c 2f61 3e3c 2f63 ap_cookie structures │ │ │ │ -00192170: 706f 696e 7465 6420 746f 2062 7920 3c63 pointed to by soap::cookies.

    .< │ │ │ │ -00192220: 703e 5369 6e63 6520 7468 6520 636f 6f6b p>Since the cook │ │ │ │ -00192230: 6965 2073 746f 7265 2069 7320 6c69 6e6b ie store is link │ │ │ │ -00192240: 6564 2074 6f20 7468 6520 6375 7272 656e ed to the curren │ │ │ │ -00192250: 7420 3c63 6f64 653e 3c61 2063 6c61 7373 t soap context, and │ │ │ │ -001922c0: 2065 6163 6820 7468 7265 6164 206d 7573 each thread mus │ │ │ │ -001922d0: 7420 7573 6520 6974 7320 6f77 6e20 636f t use its own co │ │ │ │ -001922e0: 6e74 6578 742c 2065 6163 6820 7468 7265 ntext, each thre │ │ │ │ -001922f0: 6164 2061 6c73 6f20 6861 7320 6974 7320 ad also has its │ │ │ │ -00192300: 6f77 6e20 636f 6f6b 6965 2073 746f 7265 own cookie store │ │ │ │ -00192310: 2e3c 2f70 3e0a 3c70 3ef0 9f94 9d20 3c61 .

    .

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

    .

    │ │ │ │ -00192350: 3c61 2063 6c61 7373 3d22 616e 6368 6f72 .Server- │ │ │ │ -00192380: 7369 6465 2063 6f6f 6b69 6520 7375 7070 side cookie supp │ │ │ │ -00192390: 6f72 743c 2f68 323e 0a3c 703e 5468 6973 ort

    .

    This │ │ │ │ -001923a0: 2066 6561 7475 7265 2069 7320 6e6f 7420 feature is not │ │ │ │ -001923b0: 7265 636f 6d6d 656e 6465 6420 746f 2069 recommended to i │ │ │ │ -001923c0: 6d70 6c65 6d65 6e74 2073 7461 7465 2069 mplement state i │ │ │ │ -001923d0: 6e20 7374 616e 642d 616c 6f6e 6520 7365 n stand-alone se │ │ │ │ -001923e0: 7276 6572 732e 2043 6f6f 6b69 6573 206d rvers. Cookies m │ │ │ │ -001923f0: 6179 2072 6571 7569 7265 2061 2066 6169 ay require a fai │ │ │ │ -00192400: 7220 616d 6f75 6e74 206f 6620 7072 6f63 r amount of proc │ │ │ │ -00192410: 6573 7369 6e67 206f 7665 7268 6561 6420 essing overhead │ │ │ │ -00192420: 616e 6420 6172 6520 6e6f 7420 696e 2066 and are not in f │ │ │ │ -00192430: 6163 7420 6e65 6564 6564 2074 6f20 696d act needed to im │ │ │ │ -00192440: 706c 656d 656e 7420 7374 6174 6566 756c plement stateful │ │ │ │ -00192450: 2073 6572 7669 6365 732c 2077 6869 6368 services, which │ │ │ │ -00192460: 2069 7320 7479 7069 6361 6c6c 7920 7065 is typically pe │ │ │ │ -00192470: 7266 6f72 6d65 6420 7769 7468 2073 6573 rformed with ses │ │ │ │ -00192480: 7369 6f6e 2049 4473 2069 6e20 584d 4c2f sion IDs in XML/ │ │ │ │ -00192490: 4a53 4f4e 206d 6573 7361 6765 7320 6f72 JSON messages or │ │ │ │ -001924a0: 2062 7920 7061 7373 696e 6720 7468 6520 by passing the │ │ │ │ -001924b0: 7365 7373 696f 6e20 4944 7320 7669 6120 session IDs via │ │ │ │ -001924c0: 7468 6520 5552 4c2e 3c2f 703e 0a3c 703e the URL.

    .

    │ │ │ │ -001924d0: 5365 7276 6572 2d73 6964 6520 636f 6f6b Server-side cook │ │ │ │ -001924e0: 6965 2073 7570 706f 7274 2069 7320 6f70 ie support is op │ │ │ │ -001924f0: 7469 6f6e 616c 2e20 546f 2065 6e61 626c tional. To enabl │ │ │ │ -00192500: 6520 636f 6f6b 6965 2073 7570 706f 7274 e cookie support │ │ │ │ -00192510: 2c20 636f 6d70 696c 6520 616c 6c20 736f , compile all so │ │ │ │ -00192520: 7572 6365 7320 7769 7468 2063 6f6d 7069 urces with compi │ │ │ │ -00192530: 6c65 2d74 696d 6520 666c 6167 203c 636f le-time flag #WITH_COOKIES │ │ │ │ -00192550: 3c2f 636f 6465 3e3a 203c 2f70 3e3c 7072 :

    c++ -DWITH_C │ │ │ │ -00192580: 4f4f 4b49 4553 202d 6f20 6d79 7365 7276 OOKIES -o myserv │ │ │ │ -00192590: 6572 202e 2e2e 0a3c 2f70 7265 3e3c 703e er ....

    │ │ │ │ -001925a0: 2053 6565 2041 5049 2064 6f63 756d 656e See API documen │ │ │ │ -001925b0: 7461 7469 6f6e 204d 6f64 756c 6520 3c61 tation Module HT │ │ │ │ -001925f0: 5450 2063 6f6f 6b69 6520 6675 6e63 7469 TP cookie functi │ │ │ │ -00192600: 6f6e 733c 2f61 3e20 666f 7220 7468 6520 ons for the │ │ │ │ -00192610: 636f 6f6b 6965 2041 5049 2066 756e 6374 cookie API funct │ │ │ │ -00192620: 696f 6e73 2e20 5365 6520 7468 6520 3c61 ions. See the HTTP sess │ │ │ │ -00192660: 696f 6e73 2070 6c75 6769 6e3c 2f61 3e20 ions plugin │ │ │ │ -00192670: 666f 7220 4854 5450 2073 6573 7369 6f6e for HTTP session │ │ │ │ -00192680: 206d 616e 6167 656d 656e 7420 7769 7468 management with │ │ │ │ -00192690: 2063 6f6f 6b69 6573 2074 6861 7420 6973 cookies that is │ │ │ │ -001926a0: 2072 6571 7569 7265 6420 666f 7220 7365 required for se │ │ │ │ -001926b0: 7276 6572 2d73 6964 6520 7365 7373 696f rver-side sessio │ │ │ │ -001926c0: 6e20 636f 6e74 726f 6c2e 2054 6865 203c n control. The < │ │ │ │ -001926d0: 636f 6465 3e23 5749 5448 5f43 4f4f 4b49 code>#WITH_COOKI │ │ │ │ -001926e0: 4553 3c2f 636f 6465 3e20 666c 6167 2069 ES flag i │ │ │ │ -001926f0: 7320 7573 656c 6573 7320 7769 7468 6f75 s useless withou │ │ │ │ -00192700: 7420 7365 7276 6572 2d73 6964 6520 7365 t server-side se │ │ │ │ -00192710: 7373 696f 6e20 6d61 6e61 6765 6d65 6e74 ssion management │ │ │ │ -00192720: 2061 6e64 2063 6f6e 7472 6f6c 2e3c 2f70 and control.

    .

    Here is an │ │ │ │ -00192740: 6f76 6572 7669 6577 206f 6620 7468 6520 overview of the │ │ │ │ -00192750: 636f 6f6b 6965 2041 5049 2066 756e 6374 cookie API funct │ │ │ │ -00192760: 696f 6e73 3a3c 2f70 3e0a 3c75 6c3e 0a3c ions:

    ..

    The │ │ │ │ -00195220: 666f 6c6c 6f77 696e 6720 7661 7269 6162 following variab │ │ │ │ -00195230: 6c65 7320 6f66 2074 6865 203c 636f 6465 les of the soa │ │ │ │ -00195290: 703c 2f61 3e3c 2f63 6f64 653e 2063 6f6e p con │ │ │ │ -001952a0: 7465 7874 2061 7265 2075 7365 6420 746f text are used to │ │ │ │ -001952b0: 2064 6566 696e 6520 7468 6520 6375 7272 define the curr │ │ │ │ -001952c0: 656e 7420 646f 6d61 696e 2061 6e64 2070 ent domain and p │ │ │ │ -001952d0: 6174 683a 3c2f 703e 0a3c 756c 3e0a 3c6c ath:

    ..

    Th │ │ │ │ -00195610: 6520 3c63 6f64 653e 3c61 2063 6c61 7373 e soap::co │ │ │ │ -001956c0: 6f6b 6965 5f70 6174 683c 2f61 3e3c 2f63 okie_path value is us │ │ │ │ -001956e0: 6564 2074 6f20 6669 6c74 6572 2063 6f6f ed to filter coo │ │ │ │ -001956f0: 6b69 6573 2069 6e74 656e 6465 6420 666f kies intended fo │ │ │ │ -00195700: 7220 7468 6973 2073 6572 7669 6365 2061 r this service a │ │ │ │ -00195710: 6363 6f72 6469 6e67 2074 6f20 7468 6520 ccording to the │ │ │ │ -00195720: 7061 7468 2070 7265 6669 7820 7275 6c65 path prefix rule │ │ │ │ -00195730: 7320 6f75 746c 696e 6564 2069 6e20 5246 s outlined in RF │ │ │ │ -00195740: 4332 3130 392e 3c2f 703e 0a3c 703e 5468 C2109.

    .

    Th │ │ │ │ -00195750: 6520 666f 6c6c 6f77 696e 6720 6578 616d e following exam │ │ │ │ -00195760: 706c 6520 7365 7276 6572 2061 646f 7074 ple server adopt │ │ │ │ -00195770: 7320 636f 6f6b 6965 7320 666f 7220 7365 s cookies for se │ │ │ │ -00195780: 7373 696f 6e20 636f 6e74 726f 6c3a 3c2f ssion control:.

    int │ │ │ │ -001957e0: 6d61 696e 2829 203c 2f64 6976 3e0a 3c64 main()
    . │ │ │ │ -00195800: 7b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 {
    .
    struct │ │ │ │ -00195840: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap │ │ │ │ -00195870: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap; │ │ │ │ -001958a0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    int │ │ │ │ -001958e0: 206d 2c20 733b 203c 2f64 6976 3e0a 3c64 m, s;
    . │ │ │ │ -00195900: 2020 3c61 2063 6c61 7373 3d22 636f 6465 soap_init │ │ │ │ -00195960: 3c2f 613e 2826 616d 703b 3c61 2063 6c61 (&soap); .
    so │ │ │ │ -001959e0: 6170 3c2f 613e 2e3c 6120 636c 6173 733d ap. │ │ │ │ -00195a30: 636f 6f6b 6965 5f64 6f6d 6169 6e3c 2f61 cookie_domain = │ │ │ │ -00195a60: 2671 756f 743b 2e2e 2e26 7175 6f74 3b3c "..."< │ │ │ │ -00195a70: 2f73 7061 6e3e 3b20 3c2f 6469 763e 0a3c /span>;
    .< │ │ │ │ -00195a80: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -00195a90: 3e20 203c 6120 636c 6173 733d 2263 6f64 > soap.cook │ │ │ │ -00195b10: 6965 5f70 6174 683c 2f61 3e20 3d20 3c73 ie_path = " │ │ │ │ -00195b40: 2f26 7175 6f74 3b3c 2f73 7061 6e3e 3b20 /"; │ │ │ │ -00195b50: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // the pat │ │ │ │ -00195b70: 6820 7768 6963 6820 6973 2075 7365 6420 h which is used │ │ │ │ -00195b80: 746f 2066 696c 7465 722f 7365 7420 636f to filter/set co │ │ │ │ -00195b90: 6f6b 6965 7320 7769 7468 2074 6869 7320 okies with this │ │ │ │ -00195ba0: 6465 7374 696e 6174 696f 6e20 3c2f 7370 destination
    .
    if (argc < 2) │ │ │ │ -00195c00: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    {.
    so │ │ │ │ -00195c90: 6170 5f67 6574 656e 765f 636f 6f6b 6965 ap_getenv_cookie │ │ │ │ -00195ca0: 733c 2f61 3e28 2661 6d70 3b3c 6120 636c s(&soap); // CGI app: g │ │ │ │ -00195d00: 7261 6220 636f 6f6b 6965 7320 6672 6f6d rab cookies from │ │ │ │ -00195d10: 2026 2333 393b 4854 5450 5f43 4f4f 4b49 'HTTP_COOKI │ │ │ │ -00195d20: 4526 2333 393b 2065 6e76 2076 6172 203c E' env var < │ │ │ │ -00195d30: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    . │ │ │ │ -00195d50: 2020 203c 6120 636c 6173 733d 2263 6f64 soap_serve(&so │ │ │ │ -00195de0: 6170 3c2f 613e 293b 203c 2f64 6976 3e0a ap);
    . │ │ │ │ -00195df0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    }
    . │ │ │ │ -00195e20: 203c 7370 616e 2063 6c61 7373 3d22 6b65 else< │ │ │ │ -00195e40: 2f73 7061 6e3e 203c 2f64 6976 3e0a 3c64 /span> . │ │ │ │ -00195e60: 2020 7b3c 2f64 6976 3e0a 3c64 6976 2063 {.
    │ │ │ │ -00195e80: 6d20 3d20 3c61 2063 6c61 7373 3d22 636f m = soap_bind(&so │ │ │ │ -00195f10: 6170 3c2f 613e 2c20 4e55 4c4c 2c20 6174 ap, NULL, at │ │ │ │ -00195f20: 6f69 2861 7267 765b 315d 292c 2031 3029 oi(argv[1]), 10) │ │ │ │ -00195f30: 3b20 3c73 7061 6e20 636c 6173 733d 2263 ; // small │ │ │ │ -00195f50: 2042 4143 4b4c 4f47 2066 6f72 2069 7465 BACKLOG for ite │ │ │ │ -00195f60: 7261 7469 7665 2073 6572 7665 7273 3c2f rative servers
    .
    │ │ │ │ -00195f90: 2020 3c73 7061 6e20 636c 6173 733d 226b if (!soap_v │ │ │ │ -00196010: 616c 6964 5f73 6f63 6b65 743c 2f61 3e28 alid_socket( │ │ │ │ -00196020: 6d29 2920 3c2f 6469 763e 0a3c 6469 7620 m))
    .
    │ │ │ │ -00196040: 2020 2065 7869 7428 4558 4954 5f46 4149 exit(EXIT_FAI │ │ │ │ -00196050: 4c55 5245 293b 203c 2f64 6976 3e0a 3c64 LURE);
    . │ │ │ │ -00196070: 2020 2020 3c73 7061 6e20 636c 6173 733d fo │ │ │ │ -00196090: 723c 2f73 7061 6e3e 2028 3c73 7061 6e20 r (int i │ │ │ │ -001960c0: 203d 2031 3b20 3b20 692b 2b29 203c 2f64 = 1; ; i++) .
    {
    .
    s = so │ │ │ │ -00196160: 6170 5f61 6363 6570 743c 2f61 3e28 2661 ap_accept(&a │ │ │ │ -00196170: 6d70 3b3c 6120 636c 6173 733d 2263 6f64 mp;soap);
    .. │ │ │ │ -00196270: 2020 2020 2020 2065 7869 7428 4558 4954 exit(EXIT │ │ │ │ -00196280: 5f46 4149 4c55 5245 293b 203c 2f64 6976 _FAILURE); .
    soap_s │ │ │ │ -00196300: 6572 7665 3c2f 613e 2826 616d 703b 3c61 erve(&soap); │ │ │ │ -00196340: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    < │ │ │ │ -00196360: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -00196370: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ │ -00196380: 705f 5f63 6f6e 7465 7874 2e68 746d 6c23 p__context.html# │ │ │ │ -00196390: 6761 3831 6130 3039 6165 3165 6138 3235 ga81a009ae1ea825 │ │ │ │ -001963a0: 6130 3565 3532 3431 6532 6237 6138 6563 a05e5241e2b7a8ec │ │ │ │ -001963b0: 6539 223e 736f 6170 5f65 6e64 3c2f 613e e9">soap_end │ │ │ │ -001963c0: 2826 616d 703b 3c61 2063 6c61 7373 3d22 (&soa │ │ │ │ -001963f0: 703c 2f61 3e29 3b3c 2f64 6976 3e0a 3c64 p);
    . │ │ │ │ -00196410: 2020 2020 2020 3c61 2063 6c61 7373 3d22 soap_ │ │ │ │ -00196470: 6672 6565 5f63 6f6f 6b69 6573 3c2f 613e free_cookies │ │ │ │ -00196480: 2826 616d 703b 3c61 2063 6c61 7373 3d22 (&soa │ │ │ │ -001964b0: 703c 2f61 3e29 3b20 3c73 7061 6e20 636c p); // │ │ │ │ -001964d0: 2072 656d 6f76 6520 616c 6c20 6f6c 6420 remove all old │ │ │ │ -001964e0: 636f 6f6b 6965 7320 6672 6f6d 2064 6174 cookies from dat │ │ │ │ -001964f0: 6162 6173 6520 736f 206e 6f20 696e 7465 abase so no inte │ │ │ │ -00196500: 7266 6572 656e 6365 206f 6363 7572 7320 rference occurs │ │ │ │ -00196510: 7769 7468 2074 6865 2061 7272 6976 616c with the arrival │ │ │ │ -00196520: 206f 6620 6e65 7720 636f 6f6b 6965 7320 of new cookies │ │ │ │ -00196530: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64 . │ │ │ │ -00196550: 2020 2020 7d20 3c2f 6469 763e 0a3c 6469 } . │ │ │ │ -00196570: 207d 203c 2f64 6976 3e0a 3c64 6976 2063 } .
    return 0;
    . │ │ │ │ -001965c0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    }
    .
    .
    int ns__ │ │ │ │ -00196630: 7765 626d 6574 686f 6428 3c73 7061 6e20 webmethod( │ │ │ │ -00196650: 7374 7275 6374 3c2f 7370 616e 3e20 3c61 struct soap *< │ │ │ │ -00196690: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -001966a0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ -001966b0: 6874 6d6c 223e 736f 6170 3c2f 613e 2c20 html">soap, │ │ │ │ -001966c0: 2e2e 2e29 203c 2f64 6976 3e0a 3c64 6976 ...)
    .
    {< │ │ │ │ -001966e0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    │ │ │ │ -00196710: 636f 6e73 743c 2f73 7061 6e3e 203c 7370 const char *cookie_value │ │ │ │ -00196750: 203d 203c 6120 636c 6173 733d 2263 6f64 = soap_coo │ │ │ │ -001967b0: 6b69 655f 7661 6c75 653c 2f61 3e28 3c61 kie_value(soap, < │ │ │ │ -001967f0: 7370 616e 2063 6c61 7373 3d22 7374 7269 span class="stri │ │ │ │ -00196800: 6e67 6c69 7465 7261 6c22 3e26 7175 6f74 ngliteral">" │ │ │ │ -00196810: 3b63 6f6f 6b69 655f 6e61 6d65 2671 756f ;cookie_name&quo │ │ │ │ -00196820: 743b 3c2f 7370 616e 3e2c 204e 554c 4c2c t;, NULL, │ │ │ │ -00196830: 204e 554c 4c29 3b3c 2f64 6976 3e0a 3c64 NULL);
    . │ │ │ │ -00196850: 2020 3c73 7061 6e20 636c 6173 733d 226b if (!cookie_v │ │ │ │ -00196880: 616c 7565 2920 2020 2020 2020 2020 2020 alue) │ │ │ │ -00196890: 2020 2020 203c 7370 616e 2063 6c61 7373 // co │ │ │ │ -001968b0: 6f6b 6965 2072 6574 7572 6e65 6420 6279 okie returned by │ │ │ │ -001968c0: 2063 6c69 656e 743f 203c 2f73 7061 6e3e client? │ │ │ │ -001968d0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    coo │ │ │ │ -001968f0: 6b69 655f 7661 6c75 6520 3d20 3c73 7061 kie_value = "in │ │ │ │ -00196920: 6974 6961 6c5f 7661 6c75 6526 7175 6f74 itial_value" │ │ │ │ -00196930: 3b3c 2f73 7061 6e3e 3b20 3c73 7061 6e20 ;; │ │ │ │ -00196950: 2f2f 206e 6f3a 2073 6574 2069 6e69 7469 // no: set initi │ │ │ │ -00196960: 616c 2063 6f6f 6b69 6520 7661 6c75 6520 al cookie value │ │ │ │ -00196970: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ │ -00196990: 2020 3c73 7061 6e20 636c 6173 733d 226b else │ │ │ │ -001969b0: 3c2f 7370 616e 3e20 3c2f 6469 763e 0a3c
    .< │ │ │ │ -001969c0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001969d0: 3e20 2020 202e 2e2e 2020 2020 2020 2020 > ... │ │ │ │ -001969e0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ -001969f0: 2020 2020 203c 7370 616e 2063 6c61 7373 // ye │ │ │ │ -00196a10: 733a 206d 6f64 6966 7920 7468 6520 636f s: modify the co │ │ │ │ -00196a20: 6f6b 6965 2076 616c 7565 2074 6f20 7265 okie value to re │ │ │ │ -00196a30: 666c 6563 7420 7468 6520 6e65 7720 7374 flect the new st │ │ │ │ -00196a40: 6174 653c 2f73 7061 6e3e 3c2f 6469 763e ate │ │ │ │ -00196a50: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    soap_s │ │ │ │ -00196ac0: 6574 5f63 6f6f 6b69 653c 2f61 3e28 3c61 et_cookie(soap, < │ │ │ │ -00196b00: 7370 616e 2063 6c61 7373 3d22 7374 7269 span class="stri │ │ │ │ -00196b10: 6e67 6c69 7465 7261 6c22 3e26 7175 6f74 ngliteral">" │ │ │ │ -00196b20: 3b63 6f6f 6b69 655f 6e61 6d65 2671 756f ;cookie_name&quo │ │ │ │ -00196b30: 743b 3c2f 7370 616e 3e2c 2063 6f6f 6b69 t;, cooki │ │ │ │ -00196b40: 655f 7661 6c75 652c 204e 554c 4c2c 204e e_value, NULL, N │ │ │ │ -00196b50: 554c 4c29 3b20 3c2f 6469 763e 0a3c 6469 ULL);
    . │ │ │ │ -00196b70: 203c 6120 636c 6173 733d 2263 6f64 6522 soap_set_c │ │ │ │ -00196bd0: 6f6f 6b69 655f 6578 7069 7265 3c2f 613e ookie_expire │ │ │ │ -00196be0: 283c 6120 636c 6173 733d 2263 6f64 6522 (soap │ │ │ │ -00196c10: 2c20 3c73 7061 6e20 636c 6173 733d 2273 , &q │ │ │ │ -00196c30: 756f 743b 636f 6f6b 6965 5f6e 616d 6526 uot;cookie_name& │ │ │ │ -00196c40: 7175 6f74 3b3c 2f73 7061 6e3e 2c20 3630 quot;, 60 │ │ │ │ -00196c50: 2c20 4e55 4c4c 2c20 4e55 4c4c 293b 203c , NULL, NULL); < │ │ │ │ -00196c60: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ -00196c70: 656e 7422 3e2f 2f20 636f 6f6b 6965 2065 ent">// cookie e │ │ │ │ -00196c80: 7870 6972 6573 2069 6e20 3630 2073 6563 xpires in 60 sec │ │ │ │ -00196c90: 6f6e 6473 203c 2f73 7061 6e3e 3c2f 6469 onds
    .
    return < │ │ │ │ -00196ce0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -00196cf0: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ │ -00196d00: 705f 5f65 7272 6f72 732e 6874 6d6c 2367 p__errors.html#g │ │ │ │ -00196d10: 6133 6231 3061 3638 6633 3534 6633 3963 a3b10a68f354f39c │ │ │ │ -00196d20: 6262 3066 6530 6430 3433 6164 3463 3763 bb0fe0d043ad4c7c │ │ │ │ -00196d30: 3022 3e53 4f41 505f 4f4b 3c2f 613e 3b20 0">SOAP_OK; │ │ │ │ -00196d40: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    }
    │ │ │ │ -00196d60: 0a3c 6469 7620 636c 6173 733d 2274 7463 .
    const char * so │ │ │ │ -00196e50: 6170 5f63 6f6f 6b69 655f 7661 6c75 6528 ap_cookie_value( │ │ │ │ -00196e60: 7374 7275 6374 2073 6f61 7020 2a73 6f61 struct soap *soa │ │ │ │ -00196e70: 702c 2063 6f6e 7374 2063 6861 7220 2a6e p, const char *n │ │ │ │ -00196e80: 616d 652c 2063 6f6e 7374 2063 6861 7220 ame, const char │ │ │ │ -00196e90: 2a64 6f6d 6169 6e2c 2063 6f6e 7374 2063 *domain, const c │ │ │ │ -00196ea0: 6861 7220 2a70 6174 6829 3c2f 6469 763e har *path)
    │ │ │ │ -00196eb0: 3c64 6976 2063 6c61 7373 3d22 7474 646f
    Get cookie va │ │ │ │ -00196ed0: 6c75 652e 3c2f 6469 763e 3c2f 6469 763e lue.
    │ │ │ │ -00196ee0: 0a3c 6469 7620 636c 6173 733d 2274 7463 .
    s │ │ │ │ -00196fc0: 7472 7563 7420 736f 6170 5f63 6f6f 6b69 truct soap_cooki │ │ │ │ -00196fd0: 6520 2a20 736f 6170 5f73 6574 5f63 6f6f e * soap_set_coo │ │ │ │ -00196fe0: 6b69 6528 7374 7275 6374 2073 6f61 7020 kie(struct soap │ │ │ │ -00196ff0: 2a73 6f61 702c 2063 6f6e 7374 2063 6861 *soap, const cha │ │ │ │ -00197000: 7220 2a6e 616d 652c 2063 6f6e 7374 2063 r *name, const c │ │ │ │ -00197010: 6861 7220 2a76 616c 7565 2c20 636f 6e73 har *value, cons │ │ │ │ -00197020: 7420 6368 6172 202a 646f 6d61 696e 2c20 t char *domain, │ │ │ │ -00197030: 636f 6e73 7420 6368 6172 202a 7061 7468 const char *path │ │ │ │ -00197040: 293c 2f64 6976 3e3c 6469 7620 636c 6173 )
    Add a │ │ │ │ -00197060: 636f 6f6b 6965 2e3c 2f64 6976 3e3c 2f64 cookie.
    .
    soap_getenv │ │ │ │ -00197130: 5f63 6f6f 6b69 6573 3c2f 613e 3c2f 6469 _cookies
    int soap_g │ │ │ │ -00197160: 6574 656e 765f 636f 6f6b 6965 7328 7374 etenv_cookies(st │ │ │ │ -00197170: 7275 6374 2073 6f61 7020 2a73 6f61 7029 ruct soap *soap) │ │ │ │ -00197180: 3c2f 6469 763e 3c64 6976 2063 6c61 7373
    Get coo │ │ │ │ -001971a0: 6b69 6573 2066 726f 6d20 7468 6520 4854 kies from the HT │ │ │ │ -001971b0: 5450 5f43 4f4f 4b49 4520 656e 7669 726f TP_COOKIE enviro │ │ │ │ -001971c0: 6e6d 656e 7420 7661 7269 6162 6c65 2e3c nment variable.< │ │ │ │ -001971d0: 2f64 6976 3e3c 2f64 6976 3e0a 3c64 6976 /div>
    ..
    int │ │ │ │ -00197400: 2073 6f61 705f 7365 745f 636f 6f6b 6965 soap_set_cookie │ │ │ │ -00197410: 5f65 7870 6972 6528 7374 7275 6374 2073 _expire(struct s │ │ │ │ -00197420: 6f61 7020 2a73 6f61 702c 2063 6f6e 7374 oap *soap, const │ │ │ │ -00197430: 2063 6861 7220 2a6e 616d 652c 206c 6f6e char *name, lon │ │ │ │ -00197440: 6720 6d61 7861 6765 2c20 636f 6e73 7420 g maxage, const │ │ │ │ -00197450: 6368 6172 202a 646f 6d61 696e 2c20 636f char *domain, co │ │ │ │ -00197460: 6e73 7420 6368 6172 202a 7061 7468 293c nst char *path)< │ │ │ │ -00197470: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
    Set cook │ │ │ │ -00197490: 6965 2065 7870 6972 6174 696f 6e2e 3c2f ie expiration.
    .
    const char │ │ │ │ -00197580: 2a20 636f 6f6b 6965 5f64 6f6d 6169 6e3c * cookie_domain< │ │ │ │ -00197590: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
    User-def │ │ │ │ -001975b0: 696e 6162 6c65 2073 7472 696e 6720 7468 inable string th │ │ │ │ -001975c0: 6174 2073 7065 6369 6669 6573 2074 6865 at specifies the │ │ │ │ -001975d0: 2048 5454 5020 636f 6f6b 6965 2064 6f6d HTTP cookie dom │ │ │ │ -001975e0: 6169 6e20 6f66 2074 6865 2072 756e 6e69 ain of the runni │ │ │ │ -001975f0: 6e67 2073 6572 7665 722e 3c2f 6469 763e ng server.
    │ │ │ │ -00197600: 3c64 6976 2063 6c61 7373 3d22 7474 6465
    Definition │ │ │ │ -00197620: 3a3c 2f62 3e20 7374 6473 6f61 7032 2e68 : stdsoap2.h │ │ │ │ -00197630: 3a32 3936 393c 2f64 6976 3e3c 2f64 6976 :2969
    .
    < │ │ │ │ -001976a0: 6120 6872 6566 3d22 7374 7275 6374 736f a href="structso │ │ │ │ -001976b0: 6170 2e68 746d 6c23 6166 6464 3931 6365 ap.html#afdd91ce │ │ │ │ -001976c0: 3131 3839 6665 6464 3332 6562 6661 3531 1189fedd32ebfa51 │ │ │ │ -001976d0: 6464 3665 6433 3365 6222 3e73 6f61 703a dd6ed33eb">soap: │ │ │ │ -001976e0: 3a63 6f6f 6b69 655f 7061 7468 3c2f 613e :cookie_path │ │ │ │ -001976f0: 3c2f 6469 763e 3c64 6976 2063 6c61 7373
    const │ │ │ │ -00197710: 6368 6172 202a 2063 6f6f 6b69 655f 7061 char * cookie_pa │ │ │ │ -00197720: 7468 3c2f 6469 763e 3c64 6976 2063 6c61 th
    User- │ │ │ │ -00197740: 6465 6669 6e61 626c 6520 7374 7269 6e67 definable string │ │ │ │ -00197750: 2074 6861 7420 7370 6563 6966 6965 7320 that specifies │ │ │ │ -00197760: 7468 6520 4854 5450 2063 6f6f 6b69 6520 the HTTP cookie │ │ │ │ -00197770: 7061 7468 206f 6620 7468 6520 7275 6e6e path of the runn │ │ │ │ -00197780: 696e 6720 7365 7276 6572 2e3c 2f64 6976 ing server.
    Definitio │ │ │ │ -001977b0: 6e3a 3c2f 623e 2073 7464 736f 6170 322e n: stdsoap2. │ │ │ │ -001977c0: 683a 3239 3731 3c2f 6469 763e 3c2f 6469 h:2971
    .

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

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

    .Con │ │ │ │ -00197850: 6e65 6374 696e 6720 636c 6965 6e74 7320 necting clients │ │ │ │ -00197860: 7468 726f 7567 6820 7072 6f78 7920 7365 through proxy se │ │ │ │ -00197870: 7276 6572 733c 2f68 323e 0a3c 703e 5768 rvers

    .

    Wh │ │ │ │ -00197880: 656e 2061 2063 6c69 656e 7420 6e65 6564 en a client need │ │ │ │ -00197890: 7320 746f 2063 6f6e 6e65 6374 2074 6f20 s to connect to │ │ │ │ -001978a0: 6120 5765 6220 5365 7276 6963 6520 7468 a Web Service th │ │ │ │ -001978b0: 726f 7567 6820 6120 7072 6f78 7920 7365 rough a proxy se │ │ │ │ -001978c0: 7276 6572 2c20 7365 7420 7468 6520 3c63 rver, set the s │ │ │ │ -00197980: 6f61 703a 3a70 726f 7879 5f68 6f73 743c oap::proxy_host< │ │ │ │ -00197990: 2f61 3e3c 2f63 6f64 653e 2073 7472 696e /a> strin │ │ │ │ -001979a0: 6720 616e 6420 3c63 6f64 653e 3c61 2063 g and soap::proxy_ │ │ │ │ -00197a70: 706f 7274 3c2f 613e 3c2f 636f 6465 3e20 port │ │ │ │ -00197a80: 696e 7465 6765 7220 6174 7472 6962 7574 integer attribut │ │ │ │ -00197a90: 6573 206f 6620 7468 6520 6375 7272 656e es of the curren │ │ │ │ -00197aa0: 7420 3c63 6f64 653e 3c61 2063 6c61 7373 t soap context to t │ │ │ │ -00197b10: 6865 2070 726f 7879 2773 2068 6f73 7420 he proxy's host │ │ │ │ -00197b20: 6e61 6d65 2061 6e64 2070 6f72 742c 2072 name and port, r │ │ │ │ -00197b30: 6573 7065 6374 6976 656c 792e 2046 6f72 espectively. For │ │ │ │ -00197b40: 2065 7861 6d70 6c65 3a3c 2f70 3e0a 3c64 example:

    .
    stru │ │ │ │ -00197b90: 6374 203c 2f73 7061 6e3e 3c61 2063 6c61 ct soap soap;
    .
    soap_in │ │ │ │ -00197c70: 6974 3c2f 613e 2826 616d 703b 3c61 2063 it(&soap); .
    so │ │ │ │ -00197cf0: 6170 3c2f 613e 2e3c 6120 636c 6173 733d ap. │ │ │ │ -00197d40: 7072 6f78 795f 686f 7374 3c2f 613e 203d proxy_host = │ │ │ │ -00197d50: 203c 7370 616e 2063 6c61 7373 3d22 7374 &qu │ │ │ │ -00197d70: 6f74 3b70 726f 7879 686f 7374 6e61 6d65 ot;proxyhostname │ │ │ │ -00197d80: 2671 756f 743b 3c2f 7370 616e 3e3b 203c "; < │ │ │ │ -00197d90: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    s │ │ │ │ -00197dd0: 6f61 703c 2f61 3e2e 3c61 2063 6c61 7373 oap.proxy_port │ │ │ │ -00197e30: 3d20 3830 3830 3b20 3c2f 6469 763e 0a3c = 8080;
    .< │ │ │ │ -00197e40: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -00197e50: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >if
    (soap_call_ │ │ │ │ -00197e80: 6e73 5f5f 7765 626d 6574 686f 6428 2661 ns__webmethod(&a │ │ │ │ -00197e90: 6d70 3b3c 6120 636c 6173 733d 2263 6f64 mp;soap, │ │ │ │ -00197ee0: 2671 756f 743b 6874 7470 3a2f 2f68 6f73 "http://hos │ │ │ │ -00197ef0: 743a 706f 7274 2f70 6174 6826 7175 6f74 t:port/path" │ │ │ │ -00197f00: 3b3c 2f73 7061 6e3e 2c20 3c73 7061 6e20 ;, "acti │ │ │ │ -00197f30: 6f6e 2671 756f 743b 3c2f 7370 616e 3e2c on", │ │ │ │ -00197f40: 202e 2e2e 2929 203c 2f64 6976 3e0a 3c64 ...))
    . │ │ │ │ -00197f60: 2020 3c61 2063 6c61 7373 3d22 636f 6465 soap_print_ │ │ │ │ -00197fc0: 6661 756c 743c 2f61 3e28 2661 6d70 3b3c fault(&< │ │ │ │ -00197fd0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -00197fe0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ -00197ff0: 6874 6d6c 223e 736f 6170 3c2f 613e 2c20 html">soap, │ │ │ │ -00198000: 7374 6465 7272 293b 203c 2f64 6976 3e0a stderr);
    . │ │ │ │ -00198010: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    else │ │ │ │ -00198040: 3c2f 7370 616e 3e20 3c2f 6469 763e 0a3c
    .< │ │ │ │ -00198050: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -00198060: 3e20 202e 2e2e 203c 7370 616e 2063 6c61 > ... // │ │ │ │ -00198080: 7375 6363 6573 733c 2f73 7061 6e3e 3c2f success.

    T │ │ │ │ -001980b0: 6865 2063 6f6e 7465 7874 2061 7474 7269 he context attri │ │ │ │ -001980c0: 6275 7465 7320 3c63 6f64 653e 3c61 2063 butes soap::pro │ │ │ │ -00198180: 7879 5f68 6f73 743c 2f61 3e3c 2f63 6f64 xy_host and soap::proxy │ │ │ │ -00198260: 5f70 6f72 743c 2f61 3e3c 2f63 6f64 653e _port │ │ │ │ -00198270: 206b 6565 7020 7468 6569 7220 7661 6c75 keep their valu │ │ │ │ -00198280: 6573 2074 6872 6f75 6768 2061 2073 6571 es through a seq │ │ │ │ -00198290: 7565 6e63 6520 6f66 2073 6572 7669 6365 uence of service │ │ │ │ -001982a0: 206f 7065 7261 7469 6f6e 2063 616c 6c73 operation calls │ │ │ │ -001982b0: 2c20 736f 2074 6865 7920 6f6e 6c79 206e , so they only n │ │ │ │ -001982c0: 6565 6420 746f 2062 6520 7365 7420 6f6e eed to be set on │ │ │ │ -001982d0: 6365 2e3c 2f70 3e0a 3c70 3e57 6865 6e20 ce.

    .

    When │ │ │ │ -001982e0: 582d 466f 7277 6172 6465 642d 466f 7220 X-Forwarded-For │ │ │ │ -001982f0: 6865 6164 6572 7320 6172 6520 7265 7475 headers are retu │ │ │ │ -00198300: 726e 6564 2062 7920 7468 6520 7072 6f78 rned by the prox │ │ │ │ -00198310: 792c 2074 6865 2068 6561 6465 7220 6361 y, the header ca │ │ │ │ -00198320: 6e20 6265 2061 6363 6573 7365 6420 696e n be accessed in │ │ │ │ -00198330: 2074 6865 203c 636f 6465 3e3c 6120 636c the soap::proxy_fr │ │ │ │ -001983d0: 6f6d 3c2f 613e 3c2f 636f 6465 3e20 7374 om st │ │ │ │ -001983e0: 7269 6e67 2e3c 2f70 3e0a 3c70 3e53 6565 ring.

    .

    See │ │ │ │ -001983f0: 2061 6c73 6f20 5365 6374 696f 6e73 203c also Sections < │ │ │ │ -00198400: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ -00198410: 663d 2269 6e64 6578 2e68 746d 6c23 7072 f="index.html#pr │ │ │ │ -00198420: 6f78 7961 7574 6865 6e74 6963 6174 696f oxyauthenticatio │ │ │ │ -00198430: 6e22 3e48 5454 5020 7072 6f78 7920 6261 n">HTTP proxy ba │ │ │ │ -00198440: 7369 6320 6175 7468 656e 7469 6361 7469 sic authenticati │ │ │ │ -00198450: 6f6e 3c2f 613e 2061 6e64 203c 6120 636c on and HTTP proxy NT │ │ │ │ -001984a0: 4c4d 2061 7574 6865 6e74 6963 6174 696f LM authenticatio │ │ │ │ -001984b0: 6e3c 2f61 3e2e 3c2f 703e 0a3c 703e f09f n.

    .

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

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

    .Bind before c │ │ │ │ -00198530: 6f6e 6e65 6374 2061 6e64 2073 6574 7469 onnect and setti │ │ │ │ -00198540: 6e67 2074 6865 2063 6c69 656e 7420 696e ng the client in │ │ │ │ -00198550: 7465 7266 6163 6520 6164 6472 6573 733c terface address< │ │ │ │ -00198560: 2f68 323e 0a3c 703e 546f 2062 696e 6420 /h2>.

    To bind │ │ │ │ -00198570: 7468 6520 636c 6965 6e74 2074 6f20 6120 the client to a │ │ │ │ -00198580: 706f 7274 2062 6566 6f72 6520 636f 6e6e port before conn │ │ │ │ -00198590: 6563 742c 2073 6574 2074 6865 203c 636f ect, set the soap:: │ │ │ │ -00198650: 636c 6965 6e74 5f70 6f72 743c 2f61 3e3c client_port< │ │ │ │ -00198660: 2f63 6f64 653e 2074 6f20 6120 6e6f 6e2d /code> to a non- │ │ │ │ -00198670: 6e65 6761 7469 7665 2070 6f72 7420 6e75 negative port nu │ │ │ │ -00198680: 6d62 6572 3a3c 2f70 3e0a 3c64 6976 2063 mber:

    .
    │ │ │ │ -001986a0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    struct < │ │ │ │ -001986d0: 2f73 7061 6e3e 3c61 2063 6c61 7373 3d22 /span>soa │ │ │ │ -00198700: 703c 2f61 3e20 2a3c 6120 636c 6173 733d p *so │ │ │ │ -00198730: 6170 3c2f 613e 203d 203c 6120 636c 6173 ap = so │ │ │ │ -00198790: 6170 5f6e 6577 3c2f 613e 2829 3b20 3c2f ap_new(); ..
    if │ │ │ │ -001988c0: 2028 736f 6170 5f63 616c 6c5f 6e73 5f5f (soap_call_ns__ │ │ │ │ -001988d0: 7765 626d 6574 686f 6428 3c61 2063 6c61 webmethod(soap, "htt │ │ │ │ -00198930: 703a 2f2f 686f 7374 3a70 6f72 742f 7061 p://host:port/pa │ │ │ │ -00198940: 7468 2671 756f 743b 3c2f 7370 616e 3e2c th", │ │ │ │ -00198950: 203c 7370 616e 2063 6c61 7373 3d22 7374 &qu │ │ │ │ -00198970: 6f74 3b61 6374 696f 6e26 7175 6f74 3b3c ot;action"< │ │ │ │ -00198980: 2f73 7061 6e3e 2c20 2e2e 2e29 2920 3c2f /span>, ...)) .
    ... // error
    .
    else │ │ │ │ -00198a10: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    ... │ │ │ │ -00198a30: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // success │ │ │ │ -00198a50: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    .
    soap::cli │ │ │ │ -00198b00: 656e 745f 706f 7274 3c2f 613e 3c2f 6469 ent_port
    int client │ │ │ │ -00198b30: 5f70 6f72 743c 2f64 6976 3e3c 6469 7620 _port
    Us │ │ │ │ -00198b50: 6572 2d64 6566 696e 6162 6c65 2063 6c69 er-definable cli │ │ │ │ -00198b60: 656e 7420 706f 7274 2074 6f20 6269 6e64 ent port to bind │ │ │ │ -00198b70: 2074 6f20 6265 666f 7265 2063 6f6e 6e65 to before conne │ │ │ │ -00198b80: 6374 696e 6720 746f 2061 2073 6572 7665 cting to a serve │ │ │ │ -00198b90: 722c 2077 6865 6e20 6e6f 6e2d 6e65 6761 r, when non-nega │ │ │ │ -00198ba0: 7469 7665 2e3c 2f64 6976 3e3c 6469 7620 tive.
    Definition: │ │ │ │ -00198bd0: 2073 7464 736f 6170 322e 683a 3336 3930 stdsoap2.h:3690 │ │ │ │ -00198be0: 3c2f 6469 763e 3c2f 6469 763e 0a3c 2f64
    .

    This port │ │ │ │ -00198c10: 206e 756d 6265 7220 6973 2075 7365 6420 number is used │ │ │ │ -00198c20: 6f6e 6c79 206f 6e63 6520 616e 6420 7265 only once and re │ │ │ │ -00198c30: 7365 7420 746f 202d 3120 2864 6973 6162 set to -1 (disab │ │ │ │ -00198c40: 6c65 6429 2e20 5365 7420 6974 2061 6761 led). Set it aga │ │ │ │ -00198c50: 696e 2066 6f72 2074 6865 206e 6578 7420 in for the next │ │ │ │ -00198c60: 6361 6c6c 2e3c 2f70 3e0a 3c70 3e54 6f20 call.

    .

    To │ │ │ │ -00198c70: 7365 7420 6120 636c 6965 6e74 2069 6e74 set a client int │ │ │ │ -00198c80: 6572 6661 6365 2061 6464 7265 7373 2066 erface address f │ │ │ │ -00198c90: 6f72 2074 6865 2063 6f6e 6e65 6374 696f or the connectio │ │ │ │ -00198ca0: 6e20 7468 6174 2069 7320 616e 2049 5020 n that is an IP │ │ │ │ -00198cb0: 6164 6472 6573 7320 6f66 2074 6865 2063 address of the c │ │ │ │ -00198cc0: 6c69 656e 743a 3c2f 703e 0a3c 6469 7620 lient:

    .
    struct │ │ │ │ -00198d10: 3c2f 7370 616e 3e3c 6120 636c 6173 733d so │ │ │ │ -00198d40: 6170 3c2f 613e 202a 3c61 2063 6c61 7373 ap *s │ │ │ │ -00198d70: 6f61 703c 2f61 3e20 3d20 3c61 2063 6c61 oap = s │ │ │ │ -00198dd0: 6f61 705f 6e65 773c 2f61 3e28 293b 203c oap_new(); < │ │ │ │ -00198de0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    s │ │ │ │ -00198e20: 6f61 703c 2f61 3e2d 2667 743b 3c61 2063 oap->client_inte │ │ │ │ -00198e80: 7266 6163 653c 2f61 3e20 3d20 3c73 7061 rface = ".. │ │ │ │ -00198eb0: 2e26 7175 6f74 3b3c 2f73 7061 6e3e 3b20 ."; │ │ │ │ -00198ec0: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // IP addr │ │ │ │ -00198ee0: 6573 7320 3c2f 7370 616e 3e3c 2f64 6976 ess
    .
    if │ │ │ │ -00198f20: 3c2f 7370 616e 3e20 2873 6f61 705f 6361 (soap_ca │ │ │ │ -00198f30: 6c6c 5f6e 735f 5f77 6562 6d65 7468 6f64 ll_ns__webmethod │ │ │ │ -00198f40: 283c 6120 636c 6173 733d 2263 6f64 6522 (soap │ │ │ │ -00198f70: 2c20 3c73 7061 6e20 636c 6173 733d 2273 , &q │ │ │ │ -00198f90: 756f 743b 6874 7470 3a2f 2f68 6f73 743a uot;http://host: │ │ │ │ -00198fa0: 706f 7274 2f70 6174 6826 7175 6f74 3b3c port/path"< │ │ │ │ -00198fb0: 2f73 7061 6e3e 2c20 3c73 7061 6e20 636c /span>, "action │ │ │ │ -00198fe0: 2671 756f 743b 3c2f 7370 616e 3e2c 202e ", . │ │ │ │ -00198ff0: 2e2e 2929 203c 2f64 6976 3e0a 3c64 6976 ..))
    .
    │ │ │ │ -00199010: 2e2e 2e20 3c73 7061 6e20 636c 6173 733d ... // err │ │ │ │ -00199030: 6f72 3c2f 7370 616e 3e3c 2f64 6976 3e0a or
    . │ │ │ │ -00199040: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    else │ │ │ │ -00199070: 3c2f 7370 616e 3e20 3c2f 6469 763e 0a3c
    .< │ │ │ │ -00199080: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -00199090: 3e20 202e 2e2e 203c 7370 616e 2063 6c61 > ... // │ │ │ │ -001990b0: 7375 6363 6573 733c 2f73 7061 6e3e 3c2f success.const char * c │ │ │ │ -001991a0: 6c69 656e 745f 696e 7465 7266 6163 653c lient_interface< │ │ │ │ -001991b0: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
    User-def │ │ │ │ -001991d0: 696e 6162 6c65 2063 6c69 656e 7420 696e inable client in │ │ │ │ -001991e0: 7465 7266 6163 6520 6164 6472 6573 7320 terface address │ │ │ │ -001991f0: 746f 206f 7665 7272 6964 6520 7768 656e to override when │ │ │ │ -00199200: 2063 6f6e 6e65 6374 696e 6720 746f 2061 connecting to a │ │ │ │ -00199210: 2073 6572 7665 722c 2077 6865 6e20 6e6f server, when no │ │ │ │ -00199220: 6e2d 4e55 4c4c 2028 5769 6e64 6f2e 2e2e n-NULL (Windo... │ │ │ │ -00199230: 3c2f 6469 763e 3c64 6976 2063 6c61 7373
    Defi │ │ │ │ -00199250: 6e69 7469 6f6e 3a3c 2f62 3e20 7374 6473 nition: stds │ │ │ │ -00199260: 6f61 7032 2e68 3a33 3639 393c 2f64 6976 oap2.h:3699
    .
    < │ │ │ │ -00199290: 703e 5468 6973 2063 6c69 656e 7420 696e p>This client in │ │ │ │ -001992a0: 7465 7266 6163 6520 6164 6472 6573 7320 terface address │ │ │ │ -001992b0: 7374 7269 6e67 2069 7320 7573 6564 206f string is used o │ │ │ │ -001992c0: 6e6c 7920 6f6e 6365 2061 6e64 2072 6573 nly once and res │ │ │ │ -001992d0: 6574 2074 6f20 4e55 4c4c 2028 6469 7361 et to NULL (disa │ │ │ │ -001992e0: 626c 6564 292e 2053 6574 2069 7420 6167 bled). Set it ag │ │ │ │ -001992f0: 6169 6e20 666f 7220 7468 6520 6e65 7874 ain for the next │ │ │ │ -00199300: 2063 616c 6c2e 2054 6869 7320 6665 6174 call. This feat │ │ │ │ -00199310: 7572 6520 6973 206e 6f74 2061 7661 696c ure is not avail │ │ │ │ -00199320: 6162 6c65 2077 6865 6e20 636f 6d70 696c able when compil │ │ │ │ -00199330: 696e 6720 7468 6520 636f 6465 206f 6e20 ing the code on │ │ │ │ -00199340: 7769 6e64 6f77 732e 3c2f 703e 0a3c 703e windows.

    .

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

    .FastC │ │ │ │ -001993b0: 4749 3c2f 6832 3e0a 3c70 3e54 6f20 656e GI

    .

    To en │ │ │ │ -001993c0: 6162 6c65 2046 6173 7443 4749 2073 7570 able FastCGI sup │ │ │ │ -001993d0: 706f 7274 2c20 696e 7374 616c 6c20 4661 port, install Fa │ │ │ │ -001993e0: 7374 4347 4920 616e 6420 636f 6d70 696c stCGI and compil │ │ │ │ -001993f0: 6520 616c 6c20 736f 6170 6370 7032 2d67 e all soapcpp2-g │ │ │ │ -00199400: 656e 6572 6174 6564 2073 6f75 7263 6520 enerated source │ │ │ │ -00199410: 636f 6465 2066 696c 6573 2061 6e64 2079 code files and y │ │ │ │ -00199420: 6f75 7220 6170 706c 6963 6174 696f 6e20 our application │ │ │ │ -00199430: 736f 7572 6365 7320 7769 7468 2074 6865 sources with the │ │ │ │ -00199440: 2063 6f6d 7069 6c65 2d74 696d 6520 666c compile-time fl │ │ │ │ -00199450: 6167 203c 636f 6465 3e23 5749 5448 5f46 ag #WITH_F │ │ │ │ -00199460: 4153 5443 4749 3c2f 636f 6465 3e20 6f72 ASTCGI or │ │ │ │ -00199470: 2061 6464 3a3c 2f70 3e0a 3c64 6976 2063 add:

    .
    │ │ │ │ -00199490: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    #de │ │ │ │ -001994c0: 6669 6e65 2057 4954 485f 4641 5354 4347 fine WITH_FASTCG │ │ │ │ -001994d0: 493c 2f73 7061 6e3e 3c2f 6469 763e 0a3c I
    .< │ │ │ │ -001994e0: 2f64 6976 3e3c 212d 2d20 6672 6167 6d65 /div>

    to │ │ │ │ -00199500: 3c63 6f64 653e 6773 6f61 702f 7374 6473 gsoap/stds │ │ │ │ -00199510: 6f61 7032 2e68 3c2f 636f 6465 3e3c 2f65 oap2.h and recompile │ │ │ │ -00199530: 2074 6865 2070 726f 6a65 6374 2063 6f64 the project cod │ │ │ │ -00199540: 652e 3c2f 703e 0a3c 646c 2063 6c61 7373 e.

    .
    Warning
    Do not li │ │ │ │ -00199580: 6e6b 2061 6761 696e 7374 2074 6865 203c nk against the < │ │ │ │ -00199590: 656d 3e3c 636f 6465 3e67 736f 6170 2f6c em>gsoap/l │ │ │ │ -001995a0: 6962 6773 6f61 702a 3c2f 636f 6465 3e3c ibgsoap*< │ │ │ │ -001995b0: 2f65 6d3e 206c 6962 7261 7269 6573 2061 /em> libraries a │ │ │ │ -001995c0: 7320 7468 6573 6520 6172 6520 6e6f 7420 s these are not │ │ │ │ -001995d0: 7375 6974 6162 6c65 2066 6f72 2046 6173 suitable for Fas │ │ │ │ -001995e0: 7443 4749 2e20 436f 6d70 696c 6520 3c65 tCGI. Compile gsoap/st │ │ │ │ -00199600: 6473 6f61 7032 2e63 3c2f 636f 6465 3e3c dsoap2.c< │ │ │ │ -00199610: 2f65 6d3e 2028 6f72 203c 656d 3e3c 636f /em> (or gsoap/stdsoap │ │ │ │ -00199630: 322e 6370 703c 2f63 6f64 653e 3c2f 656d 2.cpp) instead.
    │ │ │ │ -00199650: 3c2f 646c 3e0a 3c70 3ef0 9f94 9d20 3c61
    .

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

    .

    │ │ │ │ -00199690: 3c61 2063 6c61 7373 3d22 616e 6368 6f72 │ │ │ │ -001996b0: 0a48 6f77 2074 6f20 6d69 6e69 6d69 7a65 .How to minimize │ │ │ │ -001996c0: 2061 7070 6c69 6361 7469 6f6e 206d 656d application mem │ │ │ │ -001996d0: 6f72 7920 666f 6f74 7072 696e 743c 2f68 ory footprint.

    To compile │ │ │ │ -001996f0: 2067 534f 4150 2061 7070 6c69 6361 7469 gSOAP applicati │ │ │ │ -00199700: 6f6e 7320 696e 7465 6e64 6564 2066 6f72 ons intended for │ │ │ │ -00199710: 2073 6d61 6c6c 206d 656d 6f72 7920 6465 small memory de │ │ │ │ -00199720: 7669 6365 732c 2079 6f75 206d 6179 2077 vices, you may w │ │ │ │ -00199730: 616e 7420 746f 2072 656d 6f76 6520 616c ant to remove al │ │ │ │ -00199740: 6c20 6e6f 6e2d 6573 7365 6e74 6961 6c20 l non-essential │ │ │ │ -00199750: 6665 6174 7572 6573 2074 6861 7420 636f features that co │ │ │ │ -00199760: 6e73 756d 6520 7072 6563 696f 7573 2063 nsume precious c │ │ │ │ -00199770: 6f64 6520 616e 6420 6461 7461 2073 7061 ode and data spa │ │ │ │ -00199780: 6365 2e20 546f 2064 6f20 7468 6973 2c20 ce. To do this, │ │ │ │ -00199790: 636f 6d70 696c 6520 7468 6520 736f 7572 compile the sour │ │ │ │ -001997a0: 6365 2063 6f64 6520 6669 6c65 7320 7769 ce code files wi │ │ │ │ -001997b0: 7468 2074 6865 2063 6f6d 7069 6c65 2d74 th the compile-t │ │ │ │ -001997c0: 696d 6520 666c 6167 203c 636f 6465 3e23 ime flag # │ │ │ │ -001997d0: 5749 5448 5f4c 4541 4e3c 2f63 6f64 653e WITH_LEAN │ │ │ │ -001997e0: 2028 692e 652e 203c 636f 6465 3e23 6465 (i.e. #de │ │ │ │ -001997f0: 6669 6e65 2057 4954 485f 4c45 414e 3c2f fine WITH_LEAN) to remove │ │ │ │ -00199810: 206d 616e 7920 6e6f 6e2d 6573 7365 6e74 many non-essent │ │ │ │ -00199820: 6961 6c20 6665 6174 7572 6573 2e20 5468 ial features. Th │ │ │ │ -00199830: 6520 6665 6174 7572 6573 2074 6861 7420 e features that │ │ │ │ -00199840: 7769 6c6c 2062 6520 6469 7361 626c 6564 will be disabled │ │ │ │ -00199850: 2061 7265 3a3c 2f70 3e0a 3c75 6c3e 0a3c are:

    .
    .

    Use the compile │ │ │ │ -0019a1a0: 2d74 696d 6520 666c 6167 203c 636f 6465 -time flag #WITH_LEANER to make the │ │ │ │ -0019a1d0: 2065 7865 6375 7461 626c 6520 6576 656e executable even │ │ │ │ -0019a1e0: 2073 6d61 6c6c 6572 2062 7920 7265 6d6f smaller by remo │ │ │ │ -0019a1f0: 7669 6e67 2044 494d 4520 616e 6420 4d49 ving DIME and MI │ │ │ │ -0019a200: 4d45 2061 7474 6163 686d 656e 7420 6861 ME attachment ha │ │ │ │ -0019a210: 6e64 6c69 6e67 2c20 3c63 6f64 653e 234c ndling, #L │ │ │ │ -0019a220: 4f4e 4736 343c 2f63 6f64 653e 2028 3634 ONG64 (64 │ │ │ │ -0019a230: 2062 6974 2920 7365 7269 616c 697a 6174 bit) serializat │ │ │ │ -0019a240: 696f 6e2c 203c 636f 6465 3e77 6368 6172 ion, wchar │ │ │ │ -0019a250: 5f74 2a3c 2f63 6f64 653e 2073 6572 6961 _t* seria │ │ │ │ -0019a260: 6c69 7a61 7469 6f6e 2c20 616e 6420 7375 lization, and su │ │ │ │ -0019a270: 7070 6f72 7420 666f 7220 584d 4c20 444f pport for XML DO │ │ │ │ -0019a280: 4d20 6f70 6572 6174 696f 6e73 2e20 4e6f M operations. No │ │ │ │ -0019a290: 7465 2074 6861 7420 4449 4d45 2f4d 494d te that DIME/MIM │ │ │ │ -0019a2a0: 4520 6174 7461 6368 6d65 6e74 7320 6172 E attachments ar │ │ │ │ -0019a2b0: 6520 6e6f 7420 6573 7365 6e74 6961 6c20 e not essential │ │ │ │ -0019a2c0: 746f 2061 6368 6965 7665 2053 4f41 502f to achieve SOAP/ │ │ │ │ -0019a2d0: 584d 4c20 696e 7465 726f 7065 7261 6269 XML interoperabi │ │ │ │ -0019a2e0: 6c69 7479 2e20 4449 4d45 2061 7474 6163 lity. DIME attac │ │ │ │ -0019a2f0: 686d 656e 7473 2061 7265 2061 2063 6f6e hments are a con │ │ │ │ -0019a300: 7665 6e69 656e 7420 7761 7920 746f 2065 venient way to e │ │ │ │ -0019a310: 7863 6861 6e67 6520 6e6f 6e2d 7465 7874 xchange non-text │ │ │ │ -0019a320: 2d62 6173 6564 2028 692e 652e 2062 696e -based (i.e. bin │ │ │ │ -0019a330: 6172 7929 2063 6f6e 7465 6e74 2c20 6275 ary) content, bu │ │ │ │ -0019a340: 7420 6172 6520 6e6f 7420 7265 7175 6972 t are not requir │ │ │ │ -0019a350: 6564 2066 6f72 2062 6173 6963 2053 4f41 ed for basic SOA │ │ │ │ -0019a360: 502f 584d 4c20 696e 7465 726f 7065 7261 P/XML interopera │ │ │ │ -0019a370: 6269 6c69 7479 2e20 4174 7461 6368 6d65 bility. Attachme │ │ │ │ -0019a380: 6e74 2072 6571 7569 7265 6d65 6e74 7320 nt requirements │ │ │ │ -0019a390: 6172 6520 7072 6564 6963 7461 626c 652e are predictable. │ │ │ │ -0019a3a0: 2054 6861 7420 6973 2c20 6170 706c 6963 That is, applic │ │ │ │ -0019a3b0: 6174 696f 6e73 2077 6f6e 2774 2073 7564 ations won't sud │ │ │ │ -0019a3c0: 6465 6e6c 7920 6465 6369 6465 2074 6f20 denly decide to │ │ │ │ -0019a3d0: 7573 6520 4449 4d45 206f 7220 4d49 4d45 use DIME or MIME │ │ │ │ -0019a3e0: 2069 6e73 7465 6164 206f 6620 584d 4c20 instead of XML │ │ │ │ -0019a3f0: 746f 2065 7863 6861 6e67 6520 636f 6e74 to exchange cont │ │ │ │ -0019a400: 656e 742e 3c2f 703e 0a3c 703e 4974 2069 ent.

    .

    It i │ │ │ │ -0019a410: 7320 7361 6665 2074 6f20 7472 7920 746f s safe to try to │ │ │ │ -0019a420: 2063 6f6d 7069 6c65 2079 6f75 7220 6170 compile your ap │ │ │ │ -0019a430: 706c 6963 6174 696f 6e20 7769 7468 2074 plication with t │ │ │ │ -0019a440: 6865 2063 6f6d 7069 6c65 2d74 696d 6520 he compile-time │ │ │ │ -0019a450: 666c 6167 203c 636f 6465 3e23 5749 5448 flag #WITH │ │ │ │ -0019a460: 5f4c 4541 4e3c 2f63 6f64 653e 2c20 7072 _LEAN, pr │ │ │ │ -0019a470: 6f76 6964 6564 2074 6861 7420 796f 7572 ovided that your │ │ │ │ -0019a480: 2061 7070 6c69 6361 7469 6f6e 2064 6f65 application doe │ │ │ │ -0019a490: 7320 6e6f 7420 7265 6c79 206f 6e20 492f s not rely on I/ │ │ │ │ -0019a4a0: 4f20 7469 6d65 6f75 7473 2e20 5768 656e O timeouts. When │ │ │ │ -0019a4b0: 206e 6f20 6c69 6e6b 6167 6520 6572 726f no linkage erro │ │ │ │ -0019a4c0: 7220 6f63 6375 7273 2069 6e20 7468 6520 r occurs in the │ │ │ │ -0019a4d0: 636f 6d70 696c 6174 696f 6e20 7072 6f63 compilation proc │ │ │ │ -0019a4e0: 6573 732c 2069 7420 6973 2073 6166 6520 ess, it is safe │ │ │ │ -0019a4f0: 746f 2061 7373 756d 6520 7468 6174 2079 to assume that y │ │ │ │ -0019a500: 6f75 7220 6170 706c 6963 6174 696f 6e20 our application │ │ │ │ -0019a510: 7769 6c6c 2072 756e 206a 7573 7420 6669 will run just fi │ │ │ │ -0019a520: 6e65 2e3c 2f70 3e0a 3c70 3ef0 9f94 9d20 ne.

    .

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

    ..How to remove │ │ │ │ -0019a590: 2074 6865 2042 5344 2073 6f63 6b65 7420 the BSD socket │ │ │ │ -0019a5a0: 6c69 6272 6172 7920 7265 7175 6972 656d library requirem │ │ │ │ -0019a5b0: 656e 743c 2f68 323e 0a3c 703e 5468 6520 ent

    .

    The │ │ │ │ -0019a5c0: 3c65 6d3e 3c63 6f64 653e 6773 6f61 702f gsoap/ │ │ │ │ -0019a5d0: 7374 6473 6f61 7032 2e63 3c2f 636f 6465 stdsoap2.c and < │ │ │ │ -0019a5f0: 636f 6465 3e67 736f 6170 2f73 7464 736f code>gsoap/stdso │ │ │ │ -0019a600: 6170 322e 6370 703c 2f63 6f64 653e 3c2f ap2.cpp libraries sh │ │ │ │ -0019a620: 6f75 6c64 2062 6520 6c69 6e6b 6564 2077 ould be linked w │ │ │ │ -0019a630: 6974 6820 6120 4253 4420 736f 636b 6574 ith a BSD socket │ │ │ │ -0019a640: 206c 6962 7261 7279 2069 6e20 7468 6520 library in the │ │ │ │ -0019a650: 7072 6f6a 6563 7420 6275 696c 642e 2054 project build. T │ │ │ │ -0019a660: 6f20 7265 6d6f 7665 2074 6865 206e 6565 o remove the nee │ │ │ │ -0019a670: 6420 746f 206c 696e 6b20 6120 736f 636b d to link a sock │ │ │ │ -0019a680: 6574 206c 6962 7261 7279 2c20 796f 7520 et library, you │ │ │ │ -0019a690: 6361 6e20 636f 6d70 696c 6520 3c65 6d3e can compile │ │ │ │ -0019a6a0: 3c63 6f64 653e 6773 6f61 702f 7374 6473 gsoap/stds │ │ │ │ -0019a6b0: 6f61 7032 2e63 3c2f 636f 6465 3e3c 2f65 oap2.c (for C) and < │ │ │ │ -0019a6d0: 656d 3e3c 636f 6465 3e67 736f 6170 2f73 em>gsoap/s │ │ │ │ -0019a6e0: 7464 736f 6170 322e 6370 703c 2f63 6f64 tdsoap2.cpp (for C++ │ │ │ │ -0019a700: 2920 7769 7468 2074 6865 2074 6865 2063 ) with the the c │ │ │ │ -0019a710: 6f6d 7069 6c65 2d74 696d 6520 666c 6167 ompile-time flag │ │ │ │ -0019a720: 203c 636f 6465 3e23 5749 5448 5f4e 4f49 #WITH_NOI │ │ │ │ -0019a730: 4f3c 2f63 6f64 653e 206d 6163 726f 2073 O macro s │ │ │ │ -0019a740: 6574 2028 692e 652e 203c 636f 6465 3e23 et (i.e. # │ │ │ │ -0019a750: 6465 6669 6e65 2057 4954 485f 4e4f 494f define WITH_NOIO │ │ │ │ -0019a760: 3c2f 636f 6465 3e29 2e20 5468 6973 2072 ). This r │ │ │ │ -0019a770: 656d 6f76 6573 2074 6865 2064 6570 656e emoves the depen │ │ │ │ -0019a780: 6465 6e63 7920 6f6e 2074 6865 2042 5344 dency on the BSD │ │ │ │ -0019a790: 2073 6f63 6b65 7420 4150 492c 2049 4f20 socket API, IO │ │ │ │ -0019a7a0: 7374 7265 616d 732c 203c 636f 6465 3e46 streams, F │ │ │ │ -0019a7b0: 494c 453c 2f63 6f64 653e 2074 7970 652c ILE type, │ │ │ │ -0019a7c0: 2061 6e64 203c 636f 6465 3e65 7272 6e6f and errno │ │ │ │ -0019a7d0: 3c2f 636f 6465 3e2e 3c2f 703e 0a3c 703e .

    .

    │ │ │ │ -0019a7e0: 596f 7520 7368 6f75 6c64 2064 6566 696e You should defin │ │ │ │ -0019a7f0: 6520 6361 6c6c 6261 636b 7320 746f 2072 e callbacks to r │ │ │ │ -0019a800: 6570 6c61 6365 2074 6865 206d 6973 7369 eplace the missi │ │ │ │ -0019a810: 6e67 2073 6f63 6b65 7420 7374 6163 6b2e ng socket stack. │ │ │ │ -0019a820: 2054 6f20 646f 2073 6f2c 2061 6464 2074 To do so, add t │ │ │ │ -0019a830: 6f20 796f 7572 2063 6f64 6520 7468 6520 o your code the │ │ │ │ -0019a840: 666f 6c6c 6f77 696e 6720 6465 6669 6e69 following defini │ │ │ │ -0019a850: 7469 6f6e 733a 3c2f 703e 0a3c 6469 7620 tions:

    .
    .
    /* fse │ │ │ │ -0019a9f0: 6e64 2069 7320 7573 6564 2074 6f20 7472 nd is used to tr │ │ │ │ -0019aa00: 616e 736d 6974 2064 6174 6120 696e 2062 ansmit data in b │ │ │ │ -0019aa10: 6c6f 636b 7320 2a2f 3c2f 7370 616e 3e20 locks */ │ │ │ │ -0019aa20: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    ..
    /* frecv is │ │ │ │ -0019ab10: 7573 6564 2074 6f20 7265 6365 6976 6520 used to receive │ │ │ │ -0019ab20: 6461 7461 2069 6e20 626c 6f63 6b73 202a data in blocks * │ │ │ │ -0019ab30: 2f3c 2f73 7061 6e3e 203c 2f64 6976 3e0a /
    . │ │ │ │ -0019ab40: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    soap.frecv = my_recv; .
    /* │ │ │ │ -0019ac20: 666f 7065 6e20 6973 2075 7365 6420 746f fopen is used to │ │ │ │ -0019ac30: 2063 6f6e 6e65 6374 202a 2f3c 2f73 7061 connect */
    .
    soap.fopen = m │ │ │ │ -0019acf0: 795f 7463 705f 636f 6e6e 6563 743b 203c y_tcp_connect; < │ │ │ │ -0019ad00: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    /* │ │ │ │ -0019ad30: 2066 636c 6f73 6520 6973 2075 7365 6420 fclose is used │ │ │ │ -0019ad40: 746f 2064 6973 636f 6e6e 6563 7420 2a2f to disconnect */ │ │ │ │ -0019ad50: 3c2f 7370 616e 3e20 3c2f 6469 763e 0a3c
    .< │ │ │ │ -0019ad60: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -0019ad70: 3e3c 6120 636c 6173 733d 2263 6f64 6522 >soap │ │ │ │ -0019ada0: 2e3c 6120 636c 6173 733d 2263 6f64 6522 .fclose = my_tcp_disc │ │ │ │ -0019ae10: 6f6e 6e65 6374 3b20 3c2f 6469 763e 0a3c onnect;
    .< │ │ │ │ -0019ae20: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -0019ae30: 3e3c 7370 616e 2063 6c61 7373 3d22 636f >/* fclose │ │ │ │ -0019ae50: 736f 636b 6574 2069 7320 7573 6564 206f socket is used o │ │ │ │ -0019ae60: 6e6c 7920 746f 2063 6c6f 7365 2074 6865 nly to close the │ │ │ │ -0019ae70: 206d 6173 7465 7220 736f 636b 6574 2069 master socket i │ │ │ │ -0019ae80: 6e20 6120 7365 7276 6572 2075 706f 6e20 n a server upon │ │ │ │ -0019ae90: 736f 6170 5f64 6f6e 6528 2920 2a2f 3c2f soap_done() */
    .< │ │ │ │ -0019aec0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -0019aed0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ -0019aee0: 6874 6d6c 223e 736f 6170 3c2f 613e 2e3c html">soap.< │ │ │ │ -0019aef0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -0019af00: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ │ -0019af10: 705f 5f63 616c 6c62 6163 6b73 2e68 746d p__callbacks.htm │ │ │ │ -0019af20: 6c23 6761 3231 6564 6164 6362 6430 3831 l#ga21edadcbd081 │ │ │ │ -0019af30: 6337 6633 3738 3232 6430 3462 6230 3561 c7f37822d04bb05a │ │ │ │ -0019af40: 3964 3239 223e 6663 6c6f 7365 736f 636b 9d29">fclosesock │ │ │ │ -0019af50: 6574 3c2f 613e 203d 206d 795f 7463 705f et = my_tcp_ │ │ │ │ -0019af60: 636c 6f73 6573 6f63 6b65 743b 203c 2f64 closesocket; .
    /* f │ │ │ │ -0019afa0: 7368 7574 646f 776e 736f 636b 6574 2069 shutdownsocket i │ │ │ │ -0019afb0: 7320 7573 6564 2061 6674 6572 2063 6f6d s used after com │ │ │ │ -0019afc0: 706c 6574 696e 6720 6120 7365 6e64 206f pleting a send o │ │ │ │ -0019afd0: 7065 7261 7469 6f6e 2074 6f20 7365 6e64 peration to send │ │ │ │ -0019afe0: 2054 4350 2046 494e 202a 2f3c 2f73 7061 TCP FIN */
    .
    soap.fshutdownsock │ │ │ │ -0019b0a0: 6574 3c2f 613e 203d 206d 795f 7463 705f et = my_tcp_ │ │ │ │ -0019b0b0: 7368 7574 646f 776e 736f 636b 6574 3b20 shutdownsocket; │ │ │ │ -0019b0c0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    / │ │ │ │ -0019b0f0: 2a20 7365 7474 696e 6720 6670 6f6c 6c20 * setting fpoll │ │ │ │ -0019b100: 6973 206f 7074 696f 6e61 6c2c 206c 6561 is optional, lea │ │ │ │ -0019b110: 7665 2069 7420 4e55 4c4c 2074 6f20 6f6d ve it NULL to om │ │ │ │ -0019b120: 6974 2070 6f6c 6c69 6e67 2074 6865 2073 it polling the s │ │ │ │ -0019b130: 6572 7665 7220 2a2f 3c2f 7370 616e 3e20 erver */ │ │ │ │ -0019b140: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    ..
    /* faccept i │ │ │ │ -0019b230: 7320 7573 6564 206f 6e6c 7920 6279 2061 s used only by a │ │ │ │ -0019b240: 2073 6572 7665 7220 6170 706c 6963 6174 server applicat │ │ │ │ -0019b250: 696f 6e20 2a2f 3c2f 7370 616e 3e20 3c2f ion */ ..
    int(* │ │ │ │ -0019b400: 2066 706f 6c6c 2928 7374 7275 6374 2073 fpoll)(struct s │ │ │ │ -0019b410: 6f61 7020 2a73 6f61 7029 3c2f 6469 763e oap *soap)
    │ │ │ │ -0019b420: 3c64 6976 2063 6c61 7373 3d22 7474 646f
    Callback that │ │ │ │ -0019b440: 2062 6c6f 636b 7320 756e 7469 6c20 6163 blocks until ac │ │ │ │ -0019b450: 7469 7669 7479 2069 7320 6465 7465 6374 tivity is detect │ │ │ │ -0019b460: 6564 206f 6e20 7468 6520 736f 6170 3a3a ed on the soap:: │ │ │ │ -0019b470: 736f 636b 6574 206f 7220 736f 6170 3a3a socket or soap:: │ │ │ │ -0019b480: 6d61 7374 6572 2073 6f63 6b65 742c 2e2e master socket,.. │ │ │ │ -0019b490: 2e3c 2f64 6976 3e3c 6469 7620 636c 6173 .
    Def │ │ │ │ -0019b4b0: 696e 6974 696f 6e3a 3c2f 623e 2073 7464 inition: std │ │ │ │ -0019b4c0: 736f 6170 322e 683a 3435 3934 3c2f 6469 soap2.h:4594
    .
    │ │ │ │ -0019b530: 3c64 6976 2063 6c61 7373 3d22 7474 6e61
    in │ │ │ │ -0019b5c0: 7428 2a20 6663 6c6f 7365 736f 636b 6574 t(* fclosesocket │ │ │ │ -0019b5d0: 2928 7374 7275 6374 2073 6f61 7020 2a73 )(struct soap *s │ │ │ │ -0019b5e0: 6f61 702c 2053 4f41 505f 534f 434b 4554 oap, SOAP_SOCKET │ │ │ │ -0019b5f0: 2073 6f63 6b29 3c2f 6469 763e 3c64 6976 sock)
    C │ │ │ │ -0019b610: 616c 6c62 6163 6b20 7468 6174 2063 6c6f allback that clo │ │ │ │ -0019b620: 7365 7320 6120 6769 7665 6e20 736f 636b ses a given sock │ │ │ │ -0019b630: 6574 2e3c 2f64 6976 3e3c 6469 7620 636c et.
    D │ │ │ │ -0019b650: 6566 696e 6974 696f 6e3a 3c2f 623e 2073 efinition: s │ │ │ │ -0019b660: 7464 736f 6170 322e 683a 3435 3730 3c2f tdsoap2.h:4570
    .
    < │ │ │ │ -0019b750: 6469 7620 636c 6173 733d 2274 7464 6563 div class="ttdec │ │ │ │ -0019b760: 6922 3e69 6e74 282a 2066 7368 7574 646f i">int(* fshutdo │ │ │ │ -0019b770: 776e 736f 636b 6574 2928 7374 7275 6374 wnsocket)(struct │ │ │ │ -0019b780: 2073 6f61 7020 2a73 6f61 702c 2053 4f41 soap *soap, SOA │ │ │ │ -0019b790: 505f 534f 434b 4554 2073 6f63 6b2c 2069 P_SOCKET sock, i │ │ │ │ -0019b7a0: 6e74 2068 6f77 293c 2f64 6976 3e3c 6469 nt how)
    │ │ │ │ -0019b7c0: 4361 6c6c 6261 636b 2074 6861 7420 7368 Callback that sh │ │ │ │ -0019b7d0: 7574 7320 646f 776e 2061 2067 6976 656e uts down a given │ │ │ │ -0019b7e0: 2073 6f63 6b65 742e 3c2f 6469 763e 3c64 socket.
    Definition:< │ │ │ │ -0019b810: 2f62 3e20 7374 6473 6f61 7032 2e68 3a34 /b> stdsoap2.h:4 │ │ │ │ -0019b820: 3538 333c 2f64 6976 3e3c 2f64 6976 3e0a 583
    . │ │ │ │ -0019b830: 3c64 6976 2063 6c61 7373 3d22 7474 6322
    │ │ │ │ -0019b910: 534f 4150 5f53 4f43 4b45 5428 2a20 6661 SOAP_SOCKET(* fa │ │ │ │ -0019b920: 6363 6570 7429 2873 7472 7563 7420 736f ccept)(struct so │ │ │ │ -0019b930: 6170 202a 736f 6170 2c20 534f 4150 5f53 ap *soap, SOAP_S │ │ │ │ -0019b940: 4f43 4b45 5420 736f 636b 2c20 7374 7275 OCKET sock, stru │ │ │ │ -0019b950: 6374 2073 6f63 6b61 6464 7220 2a61 6464 ct sockaddr *add │ │ │ │ -0019b960: 722c 2069 6e74 202a 6c65 6e29 3c2f 6469 r, int *len)
    Callback th │ │ │ │ -0019b990: 6174 2077 6169 7473 2066 6f72 2061 6e64 at waits for and │ │ │ │ -0019b9a0: 2061 6363 6570 7473 2061 2073 6f63 6b65 accepts a socke │ │ │ │ -0019b9b0: 7420 636f 6e6e 6563 7469 6f6e 2072 6571 t connection req │ │ │ │ -0019b9c0: 7565 7374 6564 2062 7920 6120 636c 6965 uested by a clie │ │ │ │ -0019b9d0: 6e74 2e3c 2f64 6976 3e3c 6469 7620 636c nt.
    D │ │ │ │ -0019b9f0: 6566 696e 6974 696f 6e3a 3c2f 623e 2073 efinition: s │ │ │ │ -0019ba00: 7464 736f 6170 322e 683a 3435 3039 3c2f tdsoap2.h:4509
    .
    │ │ │ │ -0019cba0: 3c70 3e57 6865 6e20 636f 6d70 696c 696e

    When compilin │ │ │ │ -0019cbb0: 6720 7468 6973 2069 6e74 6572 6661 6365 g this interface │ │ │ │ -0019cbc0: 2068 6561 6465 7220 6669 6c65 2077 6974 header file wit │ │ │ │ -0019cbd0: 6820 7468 6520 736f 6170 6370 7032 2074 h the soapcpp2 t │ │ │ │ -0019cbe0: 6f6f 6c2c 2061 6c6c 2074 7970 6520 6465 ool, all type de │ │ │ │ -0019cbf0: 6669 6e69 7469 6f6e 732c 2074 6865 2073 finitions, the s │ │ │ │ -0019cc00: 6572 6961 6c69 7a65 7273 2066 6f72 2074 erializers for t │ │ │ │ -0019cc10: 6865 7365 2074 7970 6573 2c20 616e 6420 hese types, and │ │ │ │ -0019cc20: 7468 6520 7374 7562 2061 6e64 2073 6b65 the stub and ske │ │ │ │ -0019cc30: 6c65 746f 6e20 6675 6e63 7469 6f6e 7320 leton functions │ │ │ │ -0019cc40: 7769 6c6c 2062 6520 706c 6163 6564 2069 will be placed i │ │ │ │ -0019cc50: 6e20 7468 6973 206e 616d 6573 7061 6365 n this namespace │ │ │ │ -0019cc60: 2e20 5468 6520 584d 4c20 6e61 6d65 7370 . The XML namesp │ │ │ │ -0019cc70: 6163 6520 6d61 7070 696e 6720 7461 626c ace mapping tabl │ │ │ │ -0019cc80: 6520 2873 6176 6564 2069 6e20 6120 3c65 e (saved in a .nsmap file) │ │ │ │ -0019ccb0: 2077 696c 6c20 6e6f 7420 6265 2070 6c61 will not be pla │ │ │ │ -0019ccc0: 6365 6420 696e 2074 6865 2063 6f64 6520 ced in the code │ │ │ │ -0019ccd0: 6e61 6d65 7370 6163 6520 746f 2061 6c6c namespace to all │ │ │ │ -0019cce0: 6f77 2069 7420 746f 2062 6520 6c69 6e6b ow it to be link │ │ │ │ -0019ccf0: 6564 2061 7320 6120 676c 6f62 616c 206f ed as a global o │ │ │ │ -0019cd00: 626a 6563 742e 2059 6f75 2063 616e 2075 bject. You can u │ │ │ │ -0019cd10: 7365 203c 623e 3c63 6f64 653e 736f 6170 se soap │ │ │ │ -0019cd20: 6370 7032 202d 6e3c 2f63 6f64 653e 3c2f cpp2 -n option -n │ │ │ │ -0019cd50: 2074 6f20 6372 6561 7465 206c 6f63 616c to create local │ │ │ │ -0019cd60: 2058 4d4c 206e 616d 6573 7061 6365 2074 XML namespace t │ │ │ │ -0019cd70: 6162 6c65 732c 2073 6565 2053 6563 7469 ables, see Secti │ │ │ │ -0019cd80: 6f6e 203c 6120 636c 6173 733d 2265 6c22 on soapcpp2 opti │ │ │ │ -0019cdc0: 6f6e 733c 2f61 3e20 2862 7574 2072 656d ons (but rem │ │ │ │ -0019cdd0: 656d 6265 7220 7468 6174 2079 6f75 2065 ember that you e │ │ │ │ -0019cde0: 7870 6c69 6369 746c 7920 6e65 6564 2074 xplicitly need t │ │ │ │ -0019cdf0: 6f20 696e 6974 6961 6c69 7a65 2074 6865 o initialize the │ │ │ │ -0019ce00: 206e 616d 6573 7061 6365 7320 746f 2070 namespaces to p │ │ │ │ -0019ce10: 6f69 6e74 2074 6f20 6120 7461 626c 6520 oint to a table │ │ │ │ -0019ce20: 6174 2072 756e 2074 696d 6520 7573 696e at run time usin │ │ │ │ -0019ce30: 6720 3c63 6f64 653e 3c61 2063 6c61 7373 g soap_set │ │ │ │ -0019cf00: 5f6e 616d 6573 7061 6365 733c 2f61 3e3c _namespaces< │ │ │ │ -0019cf10: 2f63 6f64 653e 292e 2054 6865 2067 656e /code>). The gen │ │ │ │ -0019cf20: 6572 6174 6564 2066 696c 6573 2061 7265 erated files are │ │ │ │ -0019cf30: 2070 7265 6669 7865 6420 7769 7468 2074 prefixed with t │ │ │ │ -0019cf40: 6865 2063 6f64 6520 6e61 6d65 7370 6163 he code namespac │ │ │ │ -0019cf50: 6520 6e61 6d65 2069 6e73 7465 6164 206f e name instead o │ │ │ │ -0019cf60: 6620 7468 6520 7573 7561 6c20 3c65 6d3e f the usual │ │ │ │ -0019cf70: 3c63 6f64 653e 736f 6170 3c2f 636f 6465 soap file name │ │ │ │ -0019cf90: 2070 7265 6669 7820 746f 2065 6e61 626c prefix to enabl │ │ │ │ -0019cfa0: 6520 6d75 6c74 6970 6c65 2063 6c69 656e e multiple clien │ │ │ │ -0019cfb0: 742f 7365 7276 6572 2063 6f64 6573 2074 t/server codes t │ │ │ │ -0019cfc0: 6f20 6265 2062 7569 6c64 2069 6e20 7468 o be build in th │ │ │ │ -0019cfd0: 6520 7361 6d65 2070 726f 6a65 6374 2064 e same project d │ │ │ │ -0019cfe0: 6972 6563 746f 7279 2e3c 2f70 3e0a 3c70 irectory.

    .

    Because the SOA │ │ │ │ -0019d000: 5020 4865 6164 6572 2061 6e64 2046 6175 P Header and Fau │ │ │ │ -0019d010: 6c74 2073 6572 6961 6c69 7a65 7273 2077 lt serializers w │ │ │ │ -0019d020: 696c 6c20 616c 736f 2062 6520 706c 6163 ill also be plac │ │ │ │ -0019d030: 6564 2069 6e20 7468 6520 6e61 6d65 7370 ed in the namesp │ │ │ │ -0019d040: 6163 652c 2074 6865 7920 6361 6e6e 6f74 ace, they cannot │ │ │ │ -0019d050: 2062 6520 6361 6c6c 6564 2066 726f 6d20 be called from │ │ │ │ -0019d060: 7468 6520 3c65 6d3e 3c63 6f64 653e 6773 the gs │ │ │ │ -0019d070: 6f61 702f 7374 6473 6f61 7032 2e63 7070 oap/stdsoap2.cpp │ │ │ │ -0019d080: 3c2f 636f 6465 3e3c 2f65 6d3e 2072 756e run │ │ │ │ -0019d090: 2074 696d 6520 6c69 6272 6172 7920 636f time library co │ │ │ │ -0019d0a0: 6465 2061 6e64 2061 7265 2074 6865 7265 de and are there │ │ │ │ -0019d0b0: 666f 7265 2072 656e 6465 7265 6420 756e fore rendered un │ │ │ │ -0019d0c0: 7573 6162 6c65 2e20 5468 6572 6566 6f72 usable. Therefor │ │ │ │ -0019d0d0: 652c 2074 6865 7365 2073 6572 6961 6c69 e, these seriali │ │ │ │ -0019d0e0: 7a65 7273 2061 7265 206e 6f74 2063 6f6d zers are not com │ │ │ │ -0019d0f0: 7069 6c65 6420 6174 2061 6c6c 2028 656e piled at all (en │ │ │ │ -0019d100: 666f 7263 6564 2077 6974 6820 3c63 6f64 forced with #define WITH_N │ │ │ │ -0019d120: 4f47 4c4f 4241 4c3c 2f63 6f64 653e 292e OGLOBAL). │ │ │ │ -0019d130: 2054 6f20 6164 6420 534f 4150 2048 6561 To add SOAP Hea │ │ │ │ -0019d140: 6465 7220 616e 6420 4661 756c 7420 7365 der and Fault se │ │ │ │ -0019d150: 7269 616c 697a 6572 732c 2079 6f75 206d rializers, you m │ │ │ │ -0019d160: 7573 7420 636f 6d70 696c 6520 7468 656d ust compile them │ │ │ │ -0019d170: 2073 6570 6172 6174 656c 7920 6173 2066 separately as f │ │ │ │ -0019d180: 6f6c 6c6f 7773 2e20 4669 7273 742c 2063 ollows. First, c │ │ │ │ -0019d190: 7265 6174 6520 6120 6e65 7720 6865 6164 reate a new head │ │ │ │ -0019d1a0: 6572 2066 696c 6520 3c65 6d3e 3c63 6f64 er file env.h with the SOA │ │ │ │ -0019d1d0: 5020 4865 6164 6572 203c 636f 6465 3e3c P Header < │ │ │ │ -0019d1e0: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ -0019d1f0: 663d 2273 7472 7563 745f 735f 6f5f 615f f="struct_s_o_a_ │ │ │ │ -0019d200: 705f 5f5f 655f 6e5f 765f 5f5f 5f5f 6865 p___e_n_v_____he │ │ │ │ -0019d210: 6164 6572 2e68 746d 6c22 2074 6974 6c65 ader.html" title │ │ │ │ -0019d220: 3d22 534f 4150 2048 6561 6465 7220 7374 ="SOAP Header st │ │ │ │ -0019d230: 7275 6374 7572 652e 223e 534f 4150 5f45 ructure.">SOAP_E │ │ │ │ -0019d240: 4e56 5f5f 4865 6164 6572 3c2f 613e 3c2f NV__Header and SOAP F │ │ │ │ -0019d260: 6175 6c74 203c 636f 6465 3e3c 6120 636c ault SOAP_ENV__Fa │ │ │ │ -0019d2d0: 756c 743c 2f61 3e3c 2f63 6f64 653e 2073 ult s │ │ │ │ -0019d2e0: 7472 7563 7475 7265 732c 2069 6e63 6c75 tructures, inclu │ │ │ │ -0019d2f0: 6469 6e67 203c 636f 6465 3e3c 6120 636c ding SOAP │ │ │ │ -0019d360: 5f45 4e56 5f5f 4465 7461 696c 3c2f 613e _ENV__Detail │ │ │ │ -0019d370: 3c2f 636f 6465 3e20 6966 2074 6869 7320 if this │ │ │ │ -0019d380: 7374 7275 6374 7572 6520 636f 6e74 6169 structure contai │ │ │ │ -0019d390: 6e73 206d 656d 6265 7273 2074 6861 7420 ns members that │ │ │ │ -0019d3a0: 6172 6520 7365 7269 616c 697a 6564 2061 are serialized a │ │ │ │ -0019d3b0: 7320 6661 756c 7420 6465 7461 696c 732e s fault details. │ │ │ │ -0019d3c0: 2059 6f75 2063 616e 206c 6561 7665 2074 You can leave t │ │ │ │ -0019d3d0: 6869 7320 6865 6164 6572 2066 696c 6520 his header file │ │ │ │ -0019d3e0: 656d 7074 7920 6966 2079 6f75 2077 616e empty if you wan │ │ │ │ -0019d3f0: 7420 746f 2075 7365 2074 6865 2064 6566 t to use the def │ │ │ │ -0019d400: 6175 6c74 2053 4f41 5020 4865 6164 6572 ault SOAP Header │ │ │ │ -0019d410: 2061 6e64 2046 6175 6c74 2e20 486f 7765 and Fault. Howe │ │ │ │ -0019d420: 7665 722c 2069 6620 534f 4150 2048 6561 ver, if SOAP Hea │ │ │ │ -0019d430: 6465 7273 2061 7265 2072 6571 7569 7265 ders are require │ │ │ │ -0019d440: 6420 7468 656e 2079 6f75 2063 616e 6e6f d then you canno │ │ │ │ -0019d450: 7420 6c65 6176 6520 7468 6520 3c63 6f64 t leave the SOA │ │ │ │ -0019d4c0: 505f 454e 565f 5f48 6561 6465 723c 2f61 P_ENV__Header structu │ │ │ │ -0019d4e0: 7265 2065 6d70 7479 2e20 466f 7220 6578 re empty. For ex │ │ │ │ -0019d4f0: 616d 706c 652c 2074 6865 2057 532d 4164 ample, the WS-Ad │ │ │ │ -0019d500: 6472 6573 7369 6e67 2061 6e64 2057 532d dressing and WS- │ │ │ │ -0019d510: 5365 6375 7269 7479 2070 6c75 6769 6e73 Security plugins │ │ │ │ -0019d520: 2072 6571 7569 7265 2053 4f41 5020 4865 require SOAP He │ │ │ │ -0019d530: 6164 6572 7320 7768 6963 6820 6361 6e20 aders which can │ │ │ │ -0019d540: 6265 2069 6d70 6f72 7465 6420 6279 2061 be imported by a │ │ │ │ -0019d550: 6464 696e 6720 3c63 6f64 653e 2369 6d70 dding #imp │ │ │ │ -0019d560: 6f72 7420 2277 7361 352e 6822 3c2f 636f ort "wsa5.h" and #i │ │ │ │ -0019d580: 6d70 6f72 7420 2277 7373 652e 6822 3c2f mport "wsse.h", respectiv │ │ │ │ -0019d5a0: 656c 7920 746f 203c 656d 3e3c 636f 6465 ely to env.h. Then compile │ │ │ │ -0019d5d0: 2074 6869 7320 6865 6164 6572 2066 696c this header fil │ │ │ │ -0019d5e0: 6520 7769 7468 3a20 3c2f 703e 3c70 7265 e with:

     soapcpp2 -pen
    │ │ │ │ -0019d610: 7620 656e 762e 680a 3c2f 7072 653e 3c70  v env.h.

    The generated │ │ │ │ -0019d630: 3c65 6d3e 3c63 6f64 653e 656e 7643 2e63 envC.c │ │ │ │ -0019d640: 7070 3c2f 636f 6465 3e3c 2f65 6d3e 2066 pp f │ │ │ │ -0019d650: 696c 6520 686f 6c64 7320 7468 6520 534f ile holds the SO │ │ │ │ -0019d660: 4150 2048 6561 6465 7220 616e 6420 4661 AP Header and Fa │ │ │ │ -0019d670: 756c 7420 7365 7269 616c 697a 6572 7320 ult serializers │ │ │ │ -0019d680: 616e 6420 796f 7520 6361 6e20 6c69 6e6b and you can link │ │ │ │ -0019d690: 2074 6869 7320 6669 6c65 2077 6974 6820 this file with │ │ │ │ -0019d6a0: 796f 7572 2063 6c69 656e 7420 616e 6420 your client and │ │ │ │ -0019d6b0: 7365 7276 6572 2061 7070 6c69 6361 7469 server applicati │ │ │ │ -0019d6c0: 6f6e 732e 3c2f 703e 0a3c 703e f09f 949d ons.

    .

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

    .< │ │ │ │ -0019d700: 6832 3e3c 6120 636c 6173 733d 2261 6e63 h2>.How to cre │ │ │ │ -0019d730: 6174 6520 636c 6965 6e74 2f73 6572 7665 ate client/serve │ │ │ │ -0019d740: 7220 6c69 6272 6172 6965 733c 2f68 323e r libraries

    │ │ │ │ -0019d750: 0a3c 703e 5468 6520 736f 6170 6370 7032 .

    The soapcpp2 │ │ │ │ -0019d760: 2074 6f6f 6c20 7072 6f64 7563 6573 203c tool produces < │ │ │ │ -0019d770: 656d 3e3c 636f 6465 3e73 6f61 7043 6c69 em>soapCli │ │ │ │ -0019d780: 656e 744c 6962 2e63 7070 3c2f 636f 6465 entLib.cpp and < │ │ │ │ -0019d7a0: 636f 6465 3e73 6f61 7053 6572 7665 724c code>soapServerL │ │ │ │ -0019d7b0: 6962 2e63 7070 3c2f 636f 6465 3e3c 2f65 ib.cpp source code f │ │ │ │ -0019d7d0: 696c 6573 2074 6861 7420 6172 6520 7370 iles that are sp │ │ │ │ -0019d7e0: 6563 6966 6963 616c 6c79 2069 6e74 656e ecifically inten │ │ │ │ -0019d7f0: 6465 6420 666f 7220 6275 696c 6469 6e67 ded for building │ │ │ │ -0019d800: 2073 7461 7469 6320 6f72 2064 796e 616d static or dynam │ │ │ │ -0019d810: 6963 2063 6c69 656e 7420 616e 6420 7365 ic client and se │ │ │ │ -0019d820: 7276 6572 206c 6962 7261 7269 6573 2069 rver libraries i │ │ │ │ -0019d830: 6e20 4320 6f72 2043 2b2b 2e20 5468 6573 n C or C++. Thes │ │ │ │ -0019d840: 6520 6669 6c65 7320 6578 706f 7274 2074 e files export t │ │ │ │ -0019d850: 6865 2073 7475 6220 616e 6420 736b 656c he stub and skel │ │ │ │ -0019d860: 6574 6f6e 2066 756e 6374 696f 6e73 2c20 eton functions, │ │ │ │ -0019d870: 6275 7420 6b65 6570 2061 6c6c 2073 6572 but keep all ser │ │ │ │ -0019d880: 6961 6c69 7a61 7469 6f6e 2063 6f64 6520 ialization code │ │ │ │ -0019d890: 7374 6174 6963 2c20 7468 7573 2068 6964 static, thus hid │ │ │ │ -0019d8a0: 6465 6e20 746f 2061 766f 6964 206c 696e den to avoid lin │ │ │ │ -0019d8b0: 6b20 7379 6d62 6f6c 2063 6f6e 666c 6963 k symbol conflic │ │ │ │ -0019d8c0: 7473 2077 6865 6e20 636f 6d62 696e 696e ts when combinin │ │ │ │ -0019d8d0: 6720 6d75 6c74 6970 6c65 2063 6c69 656e g multiple clien │ │ │ │ -0019d8e0: 7473 2061 6e64 2073 6572 7669 6365 7320 ts and services │ │ │ │ -0019d8f0: 696e 746f 206f 6e65 2065 7865 6375 7461 into one executa │ │ │ │ -0019d900: 626c 652e 204e 6f74 6520 7468 6174 2069 ble. Note that i │ │ │ │ -0019d910: 7420 6973 2066 6172 2073 696d 706c 6572 t is far simpler │ │ │ │ -0019d920: 2074 6f20 7573 6520 7468 6520 7773 646c to use the wsdl │ │ │ │ -0019d930: 3268 2074 6f6f 6c20 6f6e 206d 756c 7469 2h tool on multi │ │ │ │ -0019d940: 706c 6520 5753 444c 2066 696c 6573 2074 ple WSDL files t │ │ │ │ -0019d950: 6f20 6765 6e65 7261 7465 2061 2068 6561 o generate a hea │ │ │ │ -0019d960: 6465 7220 6669 6c65 2074 6861 7420 636f der file that co │ │ │ │ -0019d970: 6d62 696e 6573 2061 6c6c 2073 6572 7669 mbines all servi │ │ │ │ -0019d980: 6365 2064 6566 696e 6974 696f 6e73 2e20 ce definitions. │ │ │ │ -0019d990: 486f 7765 7665 722c 2074 6865 2061 7070 However, the app │ │ │ │ -0019d9a0: 726f 6163 6820 7072 6573 656e 7465 6420 roach presented │ │ │ │ -0019d9b0: 696e 2074 6869 7320 7365 6374 696f 6e20 in this section │ │ │ │ -0019d9c0: 6973 2075 7365 6675 6c20 7768 656e 2063 is useful when c │ │ │ │ -0019d9d0: 7265 6174 696e 6720 2864 796e 616d 6963 reating (dynamic │ │ │ │ -0019d9e0: 2920 6c69 6272 6172 6965 7320 666f 7220 ) libraries for │ │ │ │ -0019d9f0: 636c 6965 6e74 2061 6e64 2073 6572 7665 client and serve │ │ │ │ -0019da00: 7220 6f62 6a65 6374 732c 2073 7563 6820 r objects, such │ │ │ │ -0019da10: 6173 2044 4c4c 7320 6173 2064 6573 6372 as DLLs as descr │ │ │ │ -0019da20: 6962 6564 2069 6e20 5365 6374 696f 6e20 ibed in Section │ │ │ │ -0019da30: 3c61 2063 6c61 7373 3d22 656c 2220 6872 How to creat │ │ │ │ -0019da60: 6520 444c 4c73 3c2f 613e 202e 3c2f 703e e DLLs .

    │ │ │ │ -0019da70: 0a3c 646c 2063 6c61 7373 3d22 7365 6374 .
    No │ │ │ │ -0019da90: 7465 3c2f 6474 3e3c 6464 3e4f 6e65 206d te
    One m │ │ │ │ -0019daa0: 616a 6f72 2064 6973 6164 7661 6e74 6167 ajor disadvantag │ │ │ │ -0019dab0: 6520 6f66 2074 6865 2061 7070 726f 6163 e of the approac │ │ │ │ -0019dac0: 6820 7072 6573 656e 7465 6420 6865 7265 h presented here │ │ │ │ -0019dad0: 2069 7320 7468 6174 2074 6865 2073 6572 is that the ser │ │ │ │ -0019dae0: 6961 6c69 7a65 7220 6675 6e63 7469 6f6e ializer function │ │ │ │ -0019daf0: 7320 6172 6520 6e6f 206c 6f6e 6765 7220 s are no longer │ │ │ │ -0019db00: 6163 6365 7373 6962 6c65 2069 6e20 7468 accessible in th │ │ │ │ -0019db10: 6520 7573 6572 2773 2073 6f75 7263 6520 e user's source │ │ │ │ -0019db20: 636f 6465 2c20 6265 6361 7573 6520 7365 code, because se │ │ │ │ -0019db30: 7269 616c 697a 6572 7320 7769 6c6c 2062 rializers will b │ │ │ │ -0019db40: 6520 636f 6e76 6572 7465 6420 746f 2073 e converted to s │ │ │ │ -0019db50: 7461 7469 6320 6675 6e63 7469 6f6e 7320 tatic functions │ │ │ │ -0019db60: 2874 6f20 6265 2075 7365 6420 6279 2074 (to be used by t │ │ │ │ -0019db70: 6865 2067 656e 6572 6174 6564 2073 7475 he generated stu │ │ │ │ -0019db80: 6220 616e 6420 736b 656c 6574 6f6e 2066 b and skeleton f │ │ │ │ -0019db90: 756e 6374 696f 6e73 206f 6e6c 7929 2e20 unctions only). │ │ │ │ -0019dba0: 466f 7220 6578 616d 706c 652c 2066 756e For example, fun │ │ │ │ -0019dbb0: 6374 696f 6e73 2073 7563 6820 6173 203c ctions such as < │ │ │ │ -0019dbc0: 636f 6465 3e73 6f61 705f 6e65 775f 543c code>soap_new_T< │ │ │ │ -0019dbd0: 2f63 6f64 653e 2c20 3c63 6f64 653e 736f /code>, so │ │ │ │ -0019dbe0: 6170 5f64 6566 6175 6c74 5f54 3c2f 636f ap_default_T, soap_ │ │ │ │ -0019dc00: 7772 6974 655f 543c 2f63 6f64 653e 2c20 write_T, │ │ │ │ -0019dc10: 3c63 6f64 653e 736f 6170 5f72 6561 645f soap_read_ │ │ │ │ -0019dc20: 543c 2f63 6f64 653e 2c20 3c63 6f64 653e T, │ │ │ │ -0019dc30: 736f 6170 5f70 7574 5f54 3c2f 636f 6465 soap_put_T, and soa │ │ │ │ -0019dc50: 705f 6765 745f 543c 2f63 6f64 653e 2063 p_get_T c │ │ │ │ -0019dc60: 616e 6e6f 7420 6265 2075 7365 6420 616e annot be used an │ │ │ │ -0019dc70: 7920 6c6f 6e67 6572 2e3c 2f64 643e 3c2f y longer.
    .

    Using C++ │ │ │ │ -0019dc90: 206e 616d 6573 7061 6365 7320 6973 2061 namespaces is a │ │ │ │ -0019dca0: 2062 6574 7465 7220 616c 7465 726e 6174 better alternat │ │ │ │ -0019dcb0: 6976 6520 7768 656e 2062 7569 6c64 696e ive when buildin │ │ │ │ -0019dcc0: 6720 6170 706c 6963 6174 696f 6e73 2069 g applications i │ │ │ │ -0019dcd0: 6e20 432b 2b20 7468 6174 2063 6f6d 6269 n C++ that combi │ │ │ │ -0019dce0: 6e65 206d 756c 7469 706c 6520 636c 6965 ne multiple clie │ │ │ │ -0019dcf0: 6e74 7320 616e 6420 7365 7276 6963 6573 nts and services │ │ │ │ -0019dd00: 2e20 546f 2062 7569 6c64 206d 756c 7469 . To build multi │ │ │ │ -0019dd10: 706c 6520 6c69 6272 6172 6965 732c 2079 ple libraries, y │ │ │ │ -0019dd20: 6f75 2063 616e 2064 6566 696e 6520 6120 ou can define a │ │ │ │ -0019dd30: 432b 2b20 6e61 6d65 7370 6163 6520 696e C++ namespace in │ │ │ │ -0019dd40: 2079 6f75 7220 6865 6164 6572 2066 696c your header fil │ │ │ │ -0019dd50: 6520 7769 7468 203c 623e 3c63 6f64 653e e with │ │ │ │ -0019dd60: 736f 6170 6370 7032 202d 716e 616d 653c soapcpp2 -qname< │ │ │ │ -0019dd70: 2f63 6f64 653e 3c2f 623e 206f 7074 696f /code> optio │ │ │ │ -0019dd80: 6e20 3c62 3e3c 636f 6465 3e2d 716e 616d n -qnam │ │ │ │ -0019dd90: 653c 2f63 6f64 653e 3c2f 623e 2c20 7365 e, se │ │ │ │ -0019dda0: 6520 5365 6374 696f 6e20 3c61 2063 6c61 e Section How to b │ │ │ │ -0019dde0: 7569 6c64 2061 2063 6c69 656e 7420 6f72 uild a client or │ │ │ │ -0019ddf0: 2073 6572 7665 7220 696e 2061 2043 2b2b server in a C++ │ │ │ │ -0019de00: 2063 6f64 6520 6e61 6d65 7370 6163 653c code namespace< │ │ │ │ -0019de10: 2f61 3e20 666f 7220 6465 7461 696c 732e /a> for details. │ │ │ │ -0019de20: 3c2f 703e 0a3c 703e 466f 7220 432c 2079

    .

    For C, y │ │ │ │ -0019de30: 6f75 2063 616e 2075 7365 203c 623e 3c63 ou can use soapcpp2 -c │ │ │ │ -0019de50: 2d70 206e 616d 653c 2f63 6f64 653e 3c2f -p name option -p name to rename │ │ │ │ -0019de90: 7468 6520 6765 6e65 7261 7465 6420 3c65 the generated soapClie │ │ │ │ -0019deb0: 6e74 4c69 622e 633c 2f63 6f64 653e 3c2f ntLib.c and soapServerLib. │ │ │ │ -0019dee0: 633c 2f63 6f64 653e 3c2f 656d 3e20 2861 c (a │ │ │ │ -0019def0: 6e64 2061 7373 6f63 6961 7465 6429 2066 nd associated) f │ │ │ │ -0019df00: 696c 6573 2e20 5468 6520 3c62 3e3c 636f iles. The -p name option spe │ │ │ │ -0019df30: 6369 6669 6573 2074 6865 2066 696c 6520 cifies the file │ │ │ │ -0019df40: 3c65 6d3e 3c63 6f64 653e 6e61 6d65 3c2f name prefi │ │ │ │ -0019df60: 7820 746f 2072 6570 6c61 6365 2074 6865 x to replace the │ │ │ │ -0019df70: 203c 656d 3e3c 636f 6465 3e73 6f61 703c soap< │ │ │ │ -0019df80: 2f63 6f64 653e 3c2f 656d 3e20 6669 6c65 /code> file │ │ │ │ -0019df90: 206e 616d 6520 7072 6566 6978 2e3c 2f70 name prefix.

    .

    The engine │ │ │ │ -0019dfb0: 646f 6573 206e 6f74 2064 6566 696e 6520 does not define │ │ │ │ -0019dfc0: 534f 4150 2048 6561 6465 7220 616e 6420 SOAP Header and │ │ │ │ -0019dfd0: 4661 756c 7420 7365 7269 616c 697a 6572 Fault serializer │ │ │ │ -0019dfe0: 7320 7468 6174 2074 6865 2065 6e67 696e s that the engin │ │ │ │ -0019dff0: 6520 6e65 6564 732e 2057 6520 7468 6572 e needs. We ther │ │ │ │ -0019e000: 6566 6f72 6520 6164 6420 534f 4150 2048 efore add SOAP H │ │ │ │ -0019e010: 6561 6465 7220 616e 6420 4661 756c 7420 eader and Fault │ │ │ │ -0019e020: 7365 7269 616c 697a 6572 732c 2077 6869 serializers, whi │ │ │ │ -0019e030: 6368 2061 7265 2063 6f6d 7069 6c65 6420 ch are compiled │ │ │ │ -0019e040: 7365 7061 7261 7465 6c79 2061 7320 666f separately as fo │ │ │ │ -0019e050: 6c6c 6f77 732e 2046 6972 7374 2c20 6372 llows. First, cr │ │ │ │ -0019e060: 6561 7465 2061 206e 6577 2068 6561 6465 eate a new heade │ │ │ │ -0019e070: 7220 6669 6c65 203c 656d 3e3c 636f 6465 r file env.h with the SOAP │ │ │ │ -0019e0a0: 2048 6561 6465 7220 3c63 6f64 653e 3c61 Header SOAP_EN │ │ │ │ -0019e110: 565f 5f48 6561 6465 723c 2f61 3e3c 2f63 V__Header and SOAP Fa │ │ │ │ -0019e130: 756c 7420 3c63 6f64 653e 3c61 2063 6c61 ult SOAP_ENV__Fau │ │ │ │ -0019e1a0: 6c74 3c2f 613e 3c2f 636f 6465 3e20 7374 lt st │ │ │ │ -0019e1b0: 7275 6374 7572 6573 2c20 696e 636c 7564 ructures, includ │ │ │ │ -0019e1c0: 696e 6720 3c63 6f64 653e 3c61 2063 6c61 ing SOAP_ │ │ │ │ -0019e230: 454e 565f 5f44 6574 6169 6c3c 2f61 3e3c ENV__Detail< │ │ │ │ -0019e240: 2f63 6f64 653e 2069 6620 7468 6973 2073 /code> if this s │ │ │ │ -0019e250: 7472 7563 7475 7265 2063 6f6e 7461 696e tructure contain │ │ │ │ -0019e260: 7320 6d65 6d62 6572 7320 7468 6174 2061 s members that a │ │ │ │ -0019e270: 7265 2073 6572 6961 6c69 7a65 6420 6173 re serialized as │ │ │ │ -0019e280: 2066 6175 6c74 2064 6574 6169 6c73 2e20 fault details. │ │ │ │ -0019e290: 596f 7520 6361 6e20 6c65 6176 6520 7468 You can leave th │ │ │ │ -0019e2a0: 6973 2068 6561 6465 7220 6669 6c65 2065 is header file e │ │ │ │ -0019e2b0: 6d70 7479 2069 6620 796f 7520 7761 6e74 mpty if you want │ │ │ │ -0019e2c0: 2074 6f20 7573 6520 7468 6520 6465 6661 to use the defa │ │ │ │ -0019e2d0: 756c 7420 534f 4150 2048 6561 6465 7220 ult SOAP Header │ │ │ │ -0019e2e0: 616e 6420 4661 756c 742e 2048 6f77 6576 and Fault. Howev │ │ │ │ -0019e2f0: 6572 2c20 6966 2053 4f41 5020 4865 6164 er, if SOAP Head │ │ │ │ -0019e300: 6572 7320 6172 6520 7265 7175 6972 6564 ers are required │ │ │ │ -0019e310: 2074 6865 6e20 796f 7520 6361 6e6e 6f74 then you cannot │ │ │ │ -0019e320: 206c 6561 7665 2074 6865 203c 636f 6465 leave the SOAP │ │ │ │ -0019e390: 5f45 4e56 5f5f 4865 6164 6572 3c2f 613e _ENV__Header │ │ │ │ -0019e3a0: 3c2f 636f 6465 3e20 7374 7275 6374 7572 structur │ │ │ │ -0019e3b0: 6520 656d 7074 792e 2046 6f72 2065 7861 e empty. For exa │ │ │ │ -0019e3c0: 6d70 6c65 2c20 7468 6520 5753 2d41 6464 mple, the WS-Add │ │ │ │ -0019e3d0: 7265 7373 696e 6720 616e 6420 5753 2d53 ressing and WS-S │ │ │ │ -0019e3e0: 6563 7572 6974 7920 706c 7567 696e 7320 ecurity plugins │ │ │ │ -0019e3f0: 7265 7175 6972 6520 534f 4150 2048 6561 require SOAP Hea │ │ │ │ -0019e400: 6465 7273 2077 6869 6368 2063 616e 2062 ders which can b │ │ │ │ -0019e410: 6520 696d 706f 7274 6564 2062 7920 6164 e imported by ad │ │ │ │ -0019e420: 6469 6e67 203c 636f 6465 3e23 696d 706f ding #impo │ │ │ │ -0019e430: 7274 2022 7773 6135 2e68 223c 2f63 6f64 rt "wsa5.h" and #im │ │ │ │ -0019e450: 706f 7274 2022 7773 7365 2e68 223c 2f63 port "wsse.h", respective │ │ │ │ -0019e470: 6c79 2074 6f20 3c65 6d3e 3c63 6f64 653e ly to │ │ │ │ -0019e480: 656e 762e 683c 2f63 6f64 653e 3c2f 656d env.h. Then compile │ │ │ │ -0019e4a0: 7468 6973 2068 6561 6465 7220 6669 6c65 this header file │ │ │ │ -0019e4b0: 2077 6974 683a 203c 2f70 3e3c 7072 6520 with:

     soapcpp2 -penv
    │ │ │ │ -0019e4e0: 2065 6e76 2e68 0a3c 2f70 7265 3e3c 703e   env.h.

    │ │ │ │ -0019e4f0: 2054 6865 2067 656e 6572 6174 6564 203c The generated < │ │ │ │ -0019e500: 656d 3e3c 636f 6465 3e65 6e76 432e 6370 em>envC.cp │ │ │ │ -0019e510: 703c 2f63 6f64 653e 3c2f 656d 3e20 6669 p fi │ │ │ │ -0019e520: 6c65 2068 6f6c 6473 2074 6865 2053 4f41 le holds the SOA │ │ │ │ -0019e530: 5020 4865 6164 6572 2061 6e64 2046 6175 P Header and Fau │ │ │ │ -0019e540: 6c74 2073 6572 6961 6c69 7a65 7273 2061 lt serializers a │ │ │ │ -0019e550: 6e64 2079 6f75 2063 616e 2063 7265 6174 nd you can creat │ │ │ │ -0019e560: 6520 6120 2864 796e 616d 6963 2920 6c69 e a (dynamic) li │ │ │ │ -0019e570: 6272 6172 7920 666f 7220 6974 2074 6f20 brary for it to │ │ │ │ -0019e580: 6c69 6e6b 2069 7420 7769 7468 2079 6f75 link it with you │ │ │ │ -0019e590: 7220 636c 6965 6e74 2061 6e64 2073 6572 r client and ser │ │ │ │ -0019e5a0: 7665 7220 6170 706c 6963 6174 696f 6e73 ver applications │ │ │ │ -0019e5b0: 2e3c 2f70 3e0a 3c70 3e59 6f75 2073 686f .

    .

    You sho │ │ │ │ -0019e5c0: 756c 6420 7468 656e 2063 6f6d 7069 6c65 uld then compile │ │ │ │ -0019e5d0: 2074 6865 203c 656d 3e3c 636f 6465 3e67 the g │ │ │ │ -0019e5e0: 736f 6170 2f73 7464 736f 6170 322e 6370 soap/stdsoap2.cp │ │ │ │ -0019e5f0: 703c 2f63 6f64 653e 3c2f 656d 3e20 6c69 p li │ │ │ │ -0019e600: 6272 6172 7920 7769 7468 2074 6865 2063 brary with the c │ │ │ │ -0019e610: 6f6d 7069 6c65 2d74 696d 6520 3c63 6f64 ompile-time #WITH_NONAMESP │ │ │ │ -0019e630: 4143 4553 3c2f 636f 6465 3e20 666c 6167 ACES flag │ │ │ │ -0019e640: 3a20 3c2f 703e 3c70 7265 2063 6c61 7373 :

     c++
    │ │ │ │ -0019e660: 202d 4457 4954 485f 4e4f 4e41 4d45 5350   -DWITH_NONAMESP
    │ │ │ │ -0019e670: 4143 4553 202d 6320 7374 6473 6f61 7032  ACES -c stdsoap2
    │ │ │ │ -0019e680: 2e63 7070 0a3c 2f70 7265 3e3c 703e 2054  .cpp.

    T │ │ │ │ -0019e690: 6869 7320 6f6d 6974 7320 7468 6520 7265 his omits the re │ │ │ │ -0019e6a0: 6665 7265 6e63 6520 746f 2074 6865 2067 ference to the g │ │ │ │ -0019e6b0: 6c6f 6261 6c20 6e61 6d65 7370 6163 6573 lobal namespaces │ │ │ │ -0019e6c0: 2074 6162 6c65 2c20 7768 6963 6820 6973 table, which is │ │ │ │ -0019e6d0: 206e 6f77 6865 7265 2074 6f20 6265 2064 nowhere to be d │ │ │ │ -0019e6e0: 6566 696e 6564 2073 696e 6365 2077 6520 efined since we │ │ │ │ -0019e6f0: 7769 6c6c 2075 7365 2058 4d4c 206e 616d will use XML nam │ │ │ │ -0019e700: 6573 7061 6365 7320 666f 7220 6561 6368 espaces for each │ │ │ │ -0019e710: 2063 6c69 656e 742f 7365 7276 6963 6520 client/service │ │ │ │ -0019e720: 7365 7061 7261 7465 6c79 2e20 5468 6572 separately. Ther │ │ │ │ -0019e730: 6566 6f72 652c 2079 6f75 206d 7573 7420 efore, you must │ │ │ │ -0019e740: 6578 706c 6963 6974 6c79 2073 6574 2074 explicitly set t │ │ │ │ -0019e750: 6865 206e 616d 6573 7061 6365 7320 7661 he namespaces va │ │ │ │ -0019e760: 6c75 6520 6f66 2074 6865 203c 636f 6465 lue of the soa │ │ │ │ -0019e7c0: 703c 2f61 3e3c 2f63 6f64 653e 2063 6f6e p con │ │ │ │ -0019e7d0: 7465 7874 2069 6e20 796f 7572 2063 6f64 text in your cod │ │ │ │ -0019e7e0: 6520 6576 6572 7920 7469 6d65 2061 6674 e every time aft │ │ │ │ -0019e7f0: 6572 2069 6e69 7469 616c 697a 6174 696f er initializatio │ │ │ │ -0019e800: 6e20 6f66 2074 6865 203c 636f 6465 3e3c n of the < │ │ │ │ -0019e810: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ -0019e820: 663d 2273 7472 7563 7473 6f61 702e 6874 f="structsoap.ht │ │ │ │ -0019e830: 6d6c 2220 7469 746c 653d 2243 6f6e 7465 ml" title="Conte │ │ │ │ -0019e840: 7874 2077 6974 6820 7468 6520 656e 6769 xt with the engi │ │ │ │ -0019e850: 6e65 2073 7461 7465 2e22 3e73 6f61 703c ne state.">soap< │ │ │ │ -0019e860: 2f61 3e3c 2f63 6f64 653e 2063 6f6e 7465 /a> conte │ │ │ │ -0019e870: 7874 2077 6974 6820 7468 6520 3c63 6f64 xt with the soap_set_names │ │ │ │ -0019e950: 7061 6365 7328 7374 7275 6374 2073 6f61 paces(struct soa │ │ │ │ -0019e960: 702a 2c20 636f 6e73 7420 7374 7275 6374 p*, const struct │ │ │ │ -0019e970: 204e 616d 6573 7061 6365 2a29 3c2f 613e Namespace*) │ │ │ │ -0019e980: 3c2f 636f 6465 3e20 6675 6e63 7469 6f6e function │ │ │ │ -0019e990: 2e3c 2f70 3e0a 3c70 3e46 6f72 2065 7861 .

    .

    For exa │ │ │ │ -0019e9a0: 6d70 6c65 2c20 7375 7070 6f73 6520 7765 mple, suppose we │ │ │ │ -0019e9b0: 2068 6176 6520 7477 6f20 636c 6965 6e74 have two client │ │ │ │ -0019e9c0: 7320 6465 6669 6e65 6420 696e 2068 6561 s defined in hea │ │ │ │ -0019e9d0: 6465 7220 6669 6c65 7320 3c65 6d3e 3c63 der files client1.h and client2. │ │ │ │ -0019ea10: 683c 2f63 6f64 653e 3c2f 656d 3e2e 2057 h. W │ │ │ │ -0019ea20: 6520 6669 7273 7420 6765 6e65 7261 7465 e first generate │ │ │ │ -0019ea30: 2074 6865 203c 656d 3e3c 636f 6465 3e65 the e │ │ │ │ -0019ea40: 6e76 482e 683c 2f63 6f64 653e 3c2f 656d nvH.h file for the S │ │ │ │ -0019ea60: 4f41 5020 4865 6164 6572 2061 6e64 2046 OAP Header and F │ │ │ │ -0019ea70: 6175 6c74 2064 6566 696e 6974 696f 6e73 ault definitions │ │ │ │ -0019ea80: 3a20 3c2f 703e 3c70 7265 2063 6c61 7373 :

     soa
    │ │ │ │ -0019eaa0: 7063 7070 3220 2d63 202d 7065 6e76 2065  pcpp2 -c -penv e
    │ │ │ │ -0019eab0: 6e76 2e68 0a3c 2f70 7265 3e3c 703e 2054  nv.h.

    T │ │ │ │ -0019eac0: 6865 6e20 7765 2067 656e 6572 6174 6520 hen we generate │ │ │ │ -0019ead0: 7468 6520 636f 6465 2066 6f72 2063 6c69 the code for cli │ │ │ │ -0019eae0: 656e 7431 2061 6e64 2063 6c69 656e 7432 ent1 and client2 │ │ │ │ -0019eaf0: 3a20 3c2f 703e 3c70 7265 2063 6c61 7373 :

     soa
    │ │ │ │ -0019eb10: 7063 7070 3220 2d63 202d 6e20 2d70 6d79  pcpp2 -c -n -pmy
    │ │ │ │ -0019eb20: 436c 6965 6e74 3120 636c 6965 6e74 312e  Client1 client1.
    │ │ │ │ -0019eb30: 680a 2073 6f61 7063 7070 3220 2d63 202d  h. soapcpp2 -c -
    │ │ │ │ -0019eb40: 6e20 2d70 6d79 436c 6965 6e74 3220 636c  n -pmyClient2 cl
    │ │ │ │ -0019eb50: 6965 6e74 322e 680a 3c2f 7072 653e 3c70  ient2.h.

    This generates │ │ │ │ -0019eb70: 203c 656d 3e3c 636f 6465 3e6d 7943 6c69 myCli │ │ │ │ -0019eb80: 656e 7431 436c 6965 6e74 4c69 622e 633c ent1ClientLib.c< │ │ │ │ -0019eb90: 2f63 6f64 653e 3c2f 656d 3e20 616e 6420 /code> and │ │ │ │ -0019eba0: 3c65 6d3e 3c63 6f64 653e 6d79 436c 6965 myClie │ │ │ │ -0019ebb0: 6e74 3243 6c69 656e 744c 6962 2e63 3c2f nt2ClientLib.c (amon │ │ │ │ -0019ebd0: 6720 7365 7665 7261 6c20 6f74 6865 7220 g several other │ │ │ │ -0019ebe0: 6669 6c65 7329 2e20 5468 6573 6520 7477 files). These tw │ │ │ │ -0019ebf0: 6f20 6669 6c65 7320 7368 6f75 6c64 2062 o files should b │ │ │ │ -0019ec00: 6520 636f 6d70 696c 6564 2061 6e64 206c e compiled and l │ │ │ │ -0019ec10: 696e 6b65 6420 7769 7468 2079 6f75 7220 inked with your │ │ │ │ -0019ec20: 6170 706c 6963 6174 696f 6e2e 2054 6865 application. The │ │ │ │ -0019ec30: 2073 6f75 7263 6520 636f 6465 206f 6620 source code of │ │ │ │ -0019ec40: 796f 7572 2061 7070 6c69 6361 7469 6f6e your application │ │ │ │ -0019ec50: 2073 686f 756c 6420 696e 636c 7564 6520 should include │ │ │ │ -0019ec60: 7468 6520 6765 6e65 7261 7465 6420 3c65 the generated envH.h, │ │ │ │ -0019ec90: 3c63 6f64 653e 6d79 436c 6965 6e74 3148 myClient1H │ │ │ │ -0019eca0: 2e68 3c2f 636f 6465 3e3c 2f65 6d3e 2c20 .h, │ │ │ │ -0019ecb0: 3c65 6d3e 3c63 6f64 653e 6d79 436c 6965 myClie │ │ │ │ -0019ecc0: 6e74 322e 683c 2f63 6f64 653e 3c2f 656d nt2.h files and │ │ │ │ -0019ece0: 3c63 6f64 653e 6d79 436c 6965 6e74 312e myClient1. │ │ │ │ -0019ecf0: 6e73 6d61 703c 2f63 6f64 653e 3c2f 656d nsmap, myC │ │ │ │ -0019ed10: 6c69 656e 7432 2e6e 736d 6170 3c2f 636f lient2.nsmap files:< │ │ │ │ -0019ed30: 2f70 3e0a 3c64 6976 2063 6c61 7373 3d22 /p>.

    #include │ │ │ │ -0019ed80: 2671 756f 743b 6d79 436c 6965 6e74 3148 "myClient1H │ │ │ │ -0019ed90: 2e68 2671 756f 743b 3c2f 7370 616e 3e20 .h" │ │ │ │ -0019eda0: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // include │ │ │ │ -0019edc0: 2063 6c69 656e 7420 3120 7374 7562 7320 client 1 stubs │ │ │ │ -0019edd0: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ │ -0019edf0: 3c73 7061 6e20 636c 6173 733d 2270 7265 #incl │ │ │ │ -0019ee10: 7564 6520 2671 756f 743b 6d79 436c 6965 ude "myClie │ │ │ │ -0019ee20: 6e74 3248 2e68 2671 756f 743b 3c2f 7370 nt2H.h" // inc │ │ │ │ -0019ee50: 6c75 6465 2063 6c69 656e 7420 3220 7374 lude client 2 st │ │ │ │ -0019ee60: 7562 7320 3c2f 7370 616e 3e3c 2f64 6976 ubs
    .
    # │ │ │ │ -0019eea0: 696e 636c 7564 6520 2671 756f 743b 656e include "en │ │ │ │ -0019eeb0: 7648 2e68 2671 756f 743b 3c2f 7370 616e vH.h"
    .
    ... < │ │ │ │ -0019eee0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ -0019eef0: 656e 7422 3e2f 2f3c 2f73 7061 6e3e 3c2f ent">//.
    #include " │ │ │ │ -0019ef40: 3b6d 7943 6c69 656e 7431 482e 6e73 6d61 ;myClient1H.nsma │ │ │ │ -0019ef50: 7026 7175 6f74 3b3c 2f73 7061 6e3e 203c p" < │ │ │ │ -0019ef60: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ -0019ef70: 656e 7422 3e2f 2f20 696e 636c 7564 6520 ent">// include │ │ │ │ -0019ef80: 636c 6965 6e74 2031 206e 736d 6170 203c client 1 nsmap < │ │ │ │ -0019ef90: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    .< │ │ │ │ -0019efb0: 7370 616e 2063 6c61 7373 3d22 7072 6570 span class="prep │ │ │ │ -0019efc0: 726f 6365 7373 6f72 223e 2369 6e63 6c75 rocessor">#inclu │ │ │ │ -0019efd0: 6465 2026 7175 6f74 3b6d 7943 6c69 656e de "myClien │ │ │ │ -0019efe0: 7432 482e 6e73 6d61 7026 7175 6f74 3b3c t2H.nsmap"< │ │ │ │ -0019eff0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> // │ │ │ │ -0019f010: 696e 636c 7564 6520 636c 6965 6e74 2032 include client 2 │ │ │ │ -0019f020: 206e 736d 6170 203c 2f73 7061 6e3e 3c2f nsmap .
    .< │ │ │ │ -0019f050: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -0019f060: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >struct soap │ │ │ │ -0019f0b0: 3c2f 613e 202a 3c61 2063 6c61 7373 3d22 *soa │ │ │ │ -0019f0e0: 703c 2f61 3e20 3d20 3c61 2063 6c61 7373 p = soa │ │ │ │ -0019f140: 705f 6e65 773c 2f61 3e28 293b 3c2f 6469 p_new();
    .
    soap │ │ │ │ -0019f1c0: 5f73 6574 5f6e 616d 6573 7061 6365 733c _set_namespaces< │ │ │ │ -0019f1d0: 2f61 3e28 3c61 2063 6c61 7373 3d22 636f /a>(soap< │ │ │ │ -0019f200: 2f61 3e2c 206d 7943 6c69 656e 7431 5f6e /a>, myClient1_n │ │ │ │ -0019f210: 616d 6573 7061 6365 7329 3b20 3c2f 6469 amespaces); .
    ... / │ │ │ │ -0019f250: 2f20 6d61 6b65 2043 6c69 656e 7420 3120 / make Client 1 │ │ │ │ -0019f260: 696e 766f 6361 7469 6f6e 733c 2f73 7061 invocations
    .
    ... < │ │ │ │ -0019f290: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ -0019f2a0: 656e 7422 3e2f 2f3c 2f73 7061 6e3e 3c2f ent">//.
    so │ │ │ │ -0019f320: 6170 5f73 6574 5f6e 616d 6573 7061 6365 ap_set_namespace │ │ │ │ -0019f330: 733c 2f61 3e28 3c61 2063 6c61 7373 3d22 s(soa │ │ │ │ -0019f360: 703c 2f61 3e2c 206d 7943 6c69 656e 7432 p, myClient2 │ │ │ │ -0019f370: 5f6e 616d 6573 7061 6365 7329 3b20 3c2f _namespaces); .
    ... // make Client │ │ │ │ -0019f3c0: 3220 696e 766f 6361 7469 6f6e 733c 2f73 2 invocations
    .

    We │ │ │ │ -0019fed0: 2074 6865 6e20 636f 6d70 696c 6520 6974 then compile it │ │ │ │ -0019fee0: 2061 7320 6120 6c69 6272 6172 7920 616e as a library an │ │ │ │ -0019fef0: 6420 7765 2075 7365 206f 7074 696f 6e20 d we use option │ │ │ │ -0019ff00: 3c62 3e3c 636f 6465 3e2d 6e3c 2f63 6f64 -n to prefix │ │ │ │ -0019ff20: 2074 6865 2067 656e 6572 6174 6564 2066 the generated f │ │ │ │ -0019ff30: 696c 6573 2061 6e64 2074 6f20 7265 6e61 iles and to rena │ │ │ │ -0019ff40: 6d65 2074 6865 206e 616d 6573 7061 6365 me the namespace │ │ │ │ -0019ff50: 2074 6162 6c65 2074 6f20 6176 6f69 6420 table to avoid │ │ │ │ -0019ff60: 6c69 6e6b 2063 6f6e 666c 6963 7473 206c link conflicts l │ │ │ │ -0019ff70: 6174 6572 3a20 3c2f 703e 3c70 7265 2063 ater:

    │ │ │ │ -0019ff90: 2073 6f61 7063 7070 3220 2d6e 2071 756f   soapcpp2 -n quo
    │ │ │ │ -0019ffa0: 7465 2e68 0a20 632b 2b20 2d63 2071 756f  te.h. c++ -c quo
    │ │ │ │ -0019ffb0: 7465 436c 6965 6e74 4c69 622e 6370 700a  teClientLib.cpp.
    │ │ │ │ -0019ffc0: 3c2f 7072 653e 3c70 3e20 4966 2079 6f75  

    If you │ │ │ │ -0019ffd0: 2064 6f6e 2774 2077 616e 7420 746f 2075 don't want to u │ │ │ │ -0019ffe0: 7365 2061 2043 2b2b 2063 6f64 6520 6e61 se a C++ code na │ │ │ │ -0019fff0: 6d65 7370 6163 652c 2079 6f75 2073 686f mespace, you sho │ │ │ │ -001a0000: 756c 6420 636f 6d70 696c 6520 3c65 6d3e uld compile │ │ │ │ -001a0010: 3c63 6f64 653e 7175 6f74 652e 683c 2f63 quote.h "as is │ │ │ │ -001a0030: 2220 7769 7468 206f 7074 696f 6e20 3c62 " with option -pquote:

    < │ │ │ │ -001a0060: 7072 6520 636c 6173 733d 2266 7261 676d pre class="fragm │ │ │ │ -001a0070: 656e 7422 3e20 736f 6170 6370 7032 202d ent"> soapcpp2 - │ │ │ │ -001a0080: 6e20 2d70 7175 6f74 6520 7175 6f74 652e n -pquote quote. │ │ │ │ -001a0090: 680a 2063 2b2b 202d 6320 7175 6f74 6543 h. c++ -c quoteC │ │ │ │ -001a00a0: 6c69 656e 744c 6962 2e63 7070 0a3c 2f70 lientLib.cpp.

    Third, we │ │ │ │ -001a00c0: 2063 7265 6174 6520 7468 6520 4375 7272 create the Curr │ │ │ │ -001a00d0: 656e 6379 2045 7863 6861 6e67 6520 5261 ency Exchange Ra │ │ │ │ -001a00e0: 7465 2068 6561 6465 7220 6669 6c65 2073 te header file s │ │ │ │ -001a00f0: 7065 6369 6669 6361 7469 6f6e 3a3c 2f70 pecification:

    .
    │ │ │ │ -001a0140: 6e61 6d65 7370 6163 6520 3c2f 7370 616e namespace rate {
    . │ │ │ │ -001a0170: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    │ │ │ │ -001a01a0: 2f2f 6773 6f61 7020 6e73 2073 6572 7669 //gsoap ns servi │ │ │ │ -001a01b0: 6365 206e 616d 653a 2053 6572 7669 6365 ce name: Service │ │ │ │ -001a01c0: 203c 2f73 7061 6e3e 3c2f 6469 763e 0a3c
    .< │ │ │ │ -001a01d0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001a01e0: 3e3c 7370 616e 2063 6c61 7373 3d22 636f >//gsoap n │ │ │ │ -001a0200: 7320 7365 7276 6963 6520 7374 796c 653a s service style: │ │ │ │ -001a0210: 2072 7063 203c 2f73 7061 6e3e 3c2f 6469 rpc .
    //gso │ │ │ │ -001a0250: 6170 206e 7320 7365 7276 6963 6520 656e ap ns service en │ │ │ │ -001a0260: 636f 6469 6e67 3a20 656e 636f 6465 6420 coding: encoded │ │ │ │ -001a0270: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ │ -001a0290: 3c73 7061 6e20 636c 6173 733d 2263 6f6d //gsoap ns │ │ │ │ -001a02b0: 2073 6572 7669 6365 206c 6f63 6174 696f service locatio │ │ │ │ -001a02c0: 6e3a 2068 7474 703a 2f2f 7365 7276 6963 n: http://servic │ │ │ │ -001a02d0: 6573 2e78 6d65 7468 6f64 732e 6e65 742f es.xmethods.net/ │ │ │ │ -001a02e0: 736f 6170 203c 2f73 7061 6e3e 3c2f 6469 soap .
    //gso │ │ │ │ -001a0320: 6170 206e 7320 7363 6865 6d61 206e 616d ap ns schema nam │ │ │ │ -001a0330: 6573 7061 6365 3a20 7572 6e3a 786d 6574 espace: urn:xmet │ │ │ │ -001a0340: 686f 6473 2d43 7572 7265 6e63 7945 7863 hods-CurrencyExc │ │ │ │ -001a0350: 6861 6e67 6520 3c2f 7370 616e 3e3c 2f64 hange .
    //gs │ │ │ │ -001a0390: 6f61 7020 6e73 2073 6572 7669 6365 206d oap ns service m │ │ │ │ -001a03a0: 6574 686f 642d 6163 7469 6f6e 3a20 6765 ethod-action: ge │ │ │ │ -001a03b0: 7452 6174 6520 2671 756f 743b 2671 756f tRate "&quo │ │ │ │ -001a03c0: 743b 203c 2f73 7061 6e3e 3c2f 6469 763e t;
    │ │ │ │ -001a03d0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    int │ │ │ │ -001a0400: 3c2f 7370 616e 3e20 6e73 5f5f 6765 7452 ns__getR │ │ │ │ -001a0410: 6174 6528 3c73 7061 6e20 636c 6173 733d ate(ch │ │ │ │ -001a0430: 6172 3c2f 7370 616e 3e20 2a63 6f75 6e74 ar *count │ │ │ │ -001a0440: 7279 312c 203c 7370 616e 2063 6c61 7373 ry1, c │ │ │ │ -001a0460: 6861 723c 2f73 7061 6e3e 202a 636f 756e har *coun │ │ │ │ -001a0470: 7472 7932 2c20 3c73 7061 6e20 636c 6173 try2, │ │ │ │ -001a0490: 666c 6f61 743c 2f73 7061 6e3e 2026 616d float &am │ │ │ │ -001a04a0: 703b 5265 7375 6c74 293b 203c 2f64 6976 p;Result);
    .
    .
    } │ │ │ │ -001a04e0: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // namespa │ │ │ │ -001a0500: 6365 2072 6174 653c 2f73 7061 6e3e 3c2f ce rate.

    S │ │ │ │ -001a0530: 696d 696c 6172 2074 6f20 7468 6520 5175 imilar to the Qu │ │ │ │ -001a0540: 6f74 6520 6578 616d 706c 6520 6162 6f76 ote example abov │ │ │ │ -001a0550: 652c 2077 6520 6765 6e65 7261 7465 2073 e, we generate s │ │ │ │ -001a0560: 6f75 7263 6520 636f 6465 2075 7369 6e67 ource code using │ │ │ │ -001a0570: 206f 7074 696f 6e20 3c62 3e3c 636f 6465 option -n t │ │ │ │ -001a0590: 6f20 7072 6566 6978 2074 6865 2067 656e o prefix the gen │ │ │ │ -001a05a0: 6572 6174 6564 2066 696c 6573 2061 6e64 erated files and │ │ │ │ -001a05b0: 2074 6f20 7265 6e61 6d65 2074 6865 206e to rename the n │ │ │ │ -001a05c0: 616d 6573 7061 6365 2074 6162 6c65 2074 amespace table t │ │ │ │ -001a05d0: 6f20 6176 6f69 6420 6c69 6e6b 2063 6f6e o avoid link con │ │ │ │ -001a05e0: 666c 6963 7473 3a20 3c2f 703e 3c70 7265 flicts:

     soapcpp2 -n r
    │ │ │ │ -001a0610: 6174 652e 680a 3c2f 7072 653e 3c70 3e20  ate.h.

    │ │ │ │ -001a0620: 466f 7572 7468 2c20 7765 2075 7365 2074 Fourth, we use t │ │ │ │ -001a0630: 6865 2067 656e 6572 6174 6564 2073 6f75 he generated sou │ │ │ │ -001a0640: 7263 6520 636f 6465 206c 6962 7261 7269 rce code librari │ │ │ │ -001a0650: 6573 2077 6974 6820 7468 6520 6d61 696e es with the main │ │ │ │ -001a0660: 2070 726f 6772 616d 2e3c 2f70 3e0a 3c64 program.

    .
    #include " │ │ │ │ -001a06c0: 7175 6f74 6548 2e68 2e68 2671 756f 743b quoteH.h.h" │ │ │ │ -001a06d0: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ │ -001a06f0: 3c73 7061 6e20 636c 6173 733d 2270 7265 #incl │ │ │ │ -001a0710: 7564 6520 2671 756f 743b 7261 7465 482e ude "rateH. │ │ │ │ -001a0720: 682e 6826 7175 6f74 3b3c 2f73 7061 6e3e h.h" │ │ │ │ -001a0730: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    #include &qu │ │ │ │ -001a0770: 6f74 3b71 756f 7465 2e6e 736d 6170 2671 ot;quote.nsmap&q │ │ │ │ -001a0780: 756f 743b 3c2f 7370 616e 3e3c 2f64 6976 uot;
    .
    # │ │ │ │ -001a07c0: 696e 636c 7564 6520 2671 756f 743b 7261 include "ra │ │ │ │ -001a07d0: 7465 2e6e 736d 6170 2671 756f 743b 3c2f te.nsmap"
    .
    < │ │ │ │ -001a0800: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    int mai │ │ │ │ -001a0840: 6e28 3c73 7061 6e20 636c 6173 733d 226b n(int< │ │ │ │ -001a0860: 2f73 7061 6e3e 2061 7267 632c 203c 7370 /span> argc, char *argv[]) .
    {
    . │ │ │ │ -001a08d0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 if
    (argc <= │ │ │ │ -001a0900: 2031 2920 3c2f 6469 763e 0a3c 6469 7620 1)
    .
    { │ │ │ │ -001a0920: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    std │ │ │ │ -001a0940: 3a3a 6365 7272 2026 6c74 3b26 6c74 3b20 ::cerr << │ │ │ │ -001a0950: 3c73 7061 6e20 636c 6173 733d 2273 7472 &quo │ │ │ │ -001a0970: 743b 5573 6167 653a 206d 6169 6e20 7469 t;Usage: main ti │ │ │ │ -001a0980: 636b 6572 205b 6375 7272 656e 6379 5d26 cker [currency]& │ │ │ │ -001a0990: 7175 6f74 3b3c 2f73 7061 6e3e 2026 6c74 quot; < │ │ │ │ -001a09a0: 3b26 6c74 3b20 7374 643a 3a65 6e64 6c20 ;< std::endl │ │ │ │ -001a09b0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    exi │ │ │ │ -001a09d0: 7428 4558 4954 5f46 4149 4c55 5245 293b t(EXIT_FAILURE); │ │ │ │ -001a09e0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    } .
    s │ │ │ │ -001a0a30: 7472 7563 7420 3c2f 7370 616e 3e3c 6120 truct soap *soap = │ │ │ │ -001a0aa0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap_new();
    .
    < │ │ │ │ -001a0b20: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -001a0b30: 6f72 6474 7970 6522 3e66 6c6f 6174 3c2f ordtype">float q;
    . │ │ │ │ -001a0b50: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65 . │ │ │ │ -001a0c30: 2020 3c73 7061 6e20 636c 6173 733d 226b if (soap_call │ │ │ │ -001a0c60: 5f6e 735f 5f67 6574 5175 6f74 6528 3c61 _ns__getQuote(soap, N │ │ │ │ -001a0ca0: 554c 4c2c 204e 554c 4c2c 2061 7267 765b ULL, NULL, argv[ │ │ │ │ -001a0cb0: 315d 2c20 7129 2920 3c73 7061 6e20 636c 1], q)) // │ │ │ │ -001a0cd0: 2067 6574 2071 756f 7465 203c 2f73 7061 get quote
    .
    {..
    │ │ │ │ -001a0ea0: 2020 7b3c 2f64 6976 3e0a 3c64 6976 2063 {
    .
    │ │ │ │ -001a0ec0: 2020 3c73 7061 6e20 636c 6173 733d 226b floa │ │ │ │ -001a0ee0: 743c 2f73 7061 6e3e 2072 3b20 3c2f 6469 t r; .
    soap_set_names │ │ │ │ -001a0f70: 7061 6365 733c 2f61 3e28 3c61 2063 6c61 paces(soap, rate_ │ │ │ │ -001a0fb0: 6e61 6d65 7370 6163 6573 293b 203c 2f64 namespaces); .
    if │ │ │ │ -001a1000: 2873 6f61 705f 6361 6c6c 5f6e 735f 5f67 (soap_call_ns__g │ │ │ │ -001a1010: 6574 5261 7465 283c 6120 636c 6173 733d etRate(so │ │ │ │ -001a1040: 6170 3c2f 613e 2c20 4e55 4c4c 2c20 4e55 ap, NULL, NU │ │ │ │ -001a1050: 4c4c 2c20 3c73 7061 6e20 636c 6173 733d LL, │ │ │ │ -001a1070: 2671 756f 743b 7573 2671 756f 743b 3c2f "us", argv[2], │ │ │ │ -001a1090: 7229 2920 3c73 7061 6e20 636c 6173 733d r)) // get │ │ │ │ -001a10b0: 2072 6174 6520 696e 2055 5320 646f 6c6c rate in US doll │ │ │ │ -001a10c0: 6172 7320 3c2f 7370 616e 3e3c 2f64 6976 ars
    .
    s │ │ │ │ -001a1140: 6f61 705f 7072 696e 745f 6661 756c 743c oap_print_fault< │ │ │ │ -001a1150: 2f61 3e28 3c61 2063 6c61 7373 3d22 636f /a>(soap< │ │ │ │ -001a1180: 2f61 3e2c 2073 7464 6572 7229 3b20 3c2f /a>, stderr); .
    else
    .
    │ │ │ │ -001a11f0: 2020 2020 7120 2a3d 2072 3b20 3c73 7061 q *= r; // convert the │ │ │ │ -001a1220: 2071 756f 7465 203c 2f73 7061 6e3e 3c2f quote .
    } .
    std::c │ │ │ │ -001a1270: 6f75 7420 266c 743b 266c 743b 2061 7267 out << arg │ │ │ │ -001a1280: 765b 315d 2026 6c74 3b26 6c74 3b20 3c73 v[1] << " │ │ │ │ -001a12b0: 3a20 2671 756f 743b 3c2f 7370 616e 3e20 : " │ │ │ │ -001a12c0: 266c 743b 266c 743b 2071 2026 6c74 3b26 << q <& │ │ │ │ -001a12d0: 6c74 3b20 7374 643a 3a65 6e64 6c3b 203c lt; std::endl; < │ │ │ │ -001a12e0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    } .
    soap │ │ │ │ -001a1370: 5f64 6573 7472 6f79 3c2f 613e 283c 6120 _destroy(soap);.
    so │ │ │ │ -001a1420: 6170 5f65 6e64 3c2f 613e 283c 6120 636c ap_end(soap);..
    │ │ │ │ -001a1540: 7265 7475 726e 3c2f 7370 616e 3e20 303b return 0; │ │ │ │ -001a1550: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    }
    .

    Comp │ │ │ │ -001a1590: 696c 6520 616e 6420 6c69 6e6b 2074 6869 ile and link thi │ │ │ │ -001a15a0: 7320 6170 706c 6963 6174 696f 6e20 7769 s application wi │ │ │ │ -001a15b0: 7468 203c 656d 3e3c 636f 6465 3e73 7464 th std │ │ │ │ -001a15c0: 736f 6170 322e 6f3c 2f63 6f64 653e 3c2f soap2.o, e │ │ │ │ -001a15e0: 6e76 432e 6f3c 2f63 6f64 653e 3c2f 656d nvC.o, quo │ │ │ │ -001a1600: 7465 5365 7276 6572 5072 6f78 792e 6f3c teServerProxy.o< │ │ │ │ -001a1610: 2f63 6f64 653e 3c2f 656d 3e2c 2061 6e64 /code>, and │ │ │ │ -001a1620: 203c 656d 3e3c 636f 6465 3e72 6174 6553 rateS │ │ │ │ -001a1630: 6572 7665 7250 726f 7879 2e6f 3c2f 636f erverProxy.o.

    .

    Instead of the │ │ │ │ -001a1660: 6765 6e65 7261 7465 6420 3c63 6f64 653e generated │ │ │ │ -001a1670: 736f 6170 5f63 616c 6c5f 7765 626d 6574 soap_call_webmet │ │ │ │ -001a1680: 686f 643c 2f63 6f64 653e 2073 7475 6220 hod stub │ │ │ │ -001a1690: 6675 6e63 7469 6f6e 7320 796f 7520 6361 functions you ca │ │ │ │ -001a16a0: 6e20 616c 736f 2075 7365 203c 623e 3c63 n also use soapcpp2 -j< │ │ │ │ -001a16c0: 2f63 6f64 653e 3c2f 623e 206f 7074 696f /code> optio │ │ │ │ -001a16d0: 6e20 3c62 3e3c 636f 6465 3e2d 6a3c 2f63 n -j or opti │ │ │ │ -001a16f0: 6f6e 203c 623e 3c63 6f64 653e 2d69 3c2f on -i to gen │ │ │ │ -001a1710: 6572 6174 6520 432b 2b20 7072 6f78 7920 erate C++ proxy │ │ │ │ -001a1720: 636c 6173 7365 732e 3c2f 703e 0a3c 703e classes.

    .

    │ │ │ │ -001a1730: 546f 2063 6f6d 7069 6c65 2073 6572 7665 To compile serve │ │ │ │ -001a1740: 7220 6973 2076 6572 7920 7369 6d69 6c61 r is very simila │ │ │ │ -001a1750: 722e 2046 6f72 2065 7861 6d70 6c65 2c20 r. For example, │ │ │ │ -001a1760: 6173 7375 6d65 2074 6861 7420 7765 206e assume that we n │ │ │ │ -001a1770: 6565 6420 746f 2069 6d70 6c65 6d65 6e74 eed to implement │ │ │ │ -001a1780: 2061 2063 616c 6375 6c61 746f 7220 7365 a calculator se │ │ │ │ -001a1790: 7276 6963 6520 616e 6420 7765 2077 616e rvice and we wan │ │ │ │ -001a17a0: 7420 746f 2063 7265 6174 6520 6120 6c69 t to create a li │ │ │ │ -001a17b0: 6272 6172 7920 666f 7220 6974 2e3c 2f70 brary for it.

    .
    │ │ │ │ -001a1800: 6e61 6d65 7370 6163 6520 3c2f 7370 616e namespace calc {
    . │ │ │ │ -001a1830: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    │ │ │ │ -001a1860: 2f2f 6773 6f61 7020 6e73 2073 6572 7669 //gsoap ns servi │ │ │ │ -001a1870: 6365 206e 616d 653a 2043 616c 6320 3c2f ce name: Calc
    .
    //gsoap ns s │ │ │ │ -001a18c0: 6572 7669 6365 2073 7479 6c65 3a20 7270 ervice style: rp │ │ │ │ -001a18d0: 6320 3c2f 7370 616e 3e3c 2f64 6976 3e0a c
    . │ │ │ │ -001a18e0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    //gsoap │ │ │ │ -001a1910: 6e73 2073 6572 7669 6365 2065 6e63 6f64 ns service encod │ │ │ │ -001a1920: 696e 673a 2065 6e63 6f64 6564 203c 2f73 ing: encoded
    .
    //gsoap ns se │ │ │ │ -001a1970: 7276 6963 6520 6c6f 6361 7469 6f6e 3a20 rvice location: │ │ │ │ -001a1980: 6874 7470 3a2f 2f77 7777 2e63 732e 6673 http://www.cs.fs │ │ │ │ -001a1990: 752e 6564 752f 7e65 6e67 656c 656e 2f63 u.edu/~engelen/c │ │ │ │ -001a19a0: 616c 632e 6367 6920 3c2f 7370 616e 3e3c alc.cgi < │ │ │ │ -001a19b0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    // │ │ │ │ -001a19e0: 6773 6f61 7020 6e73 2073 6368 656d 6120 gsoap ns schema │ │ │ │ -001a19f0: 6e61 6d65 7370 6163 653a 2075 726e 3a63 namespace: urn:c │ │ │ │ -001a1a00: 616c 6320 3c2f 7370 616e 3e3c 2f64 6976 alc
    .
    in │ │ │ │ -001a1a40: 743c 2f73 7061 6e3e 206e 735f 5f61 6464 t ns__add │ │ │ │ -001a1a50: 283c 7370 616e 2063 6c61 7373 3d22 6b65 (doubl │ │ │ │ -001a1a70: 653c 2f73 7061 6e3e 2061 2c20 3c73 7061 e a, double b, double & │ │ │ │ -001a1ad0: 616d 703b 7265 7375 6c74 293b 203c 2f64 amp;result); .
    │ │ │ │ -001a1b10: 696e 743c 2f73 7061 6e3e 206e 735f 5f73 int ns__s │ │ │ │ -001a1b20: 7562 283c 7370 616e 2063 6c61 7373 3d22 ub(dou │ │ │ │ -001a1b40: 626c 653c 2f73 7061 6e3e 2061 2c20 3c73 ble a, double b, double │ │ │ │ -001a1ba0: 2026 616d 703b 7265 7375 6c74 293b 203c &result); < │ │ │ │ -001a1bb0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    int ns_ │ │ │ │ -001a1bf0: 5f6d 756c 283c 7370 616e 2063 6c61 7373 _mul(d │ │ │ │ -001a1c10: 6f75 626c 653c 2f73 7061 6e3e 2061 2c20 ouble a, │ │ │ │ -001a1c20: 3c73 7061 6e20 636c 6173 733d 226b 6579 double │ │ │ │ -001a1c40: 3c2f 7370 616e 3e20 622c 203c 7370 616e b, double &result); │ │ │ │ -001a1c80: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    int n │ │ │ │ -001a1cc0: 735f 5f64 6976 283c 7370 616e 2063 6c61 s__div(double a │ │ │ │ -001a1cf0: 2c20 3c73 7061 6e20 636c 6173 733d 226b , doub │ │ │ │ -001a1d10: 6c65 3c2f 7370 616e 3e20 622c 203c 7370 le b, double &result │ │ │ │ -001a1d50: 293b 203c 2f64 6976 3e0a 3c64 6976 2063 );
    .
    .
    } // │ │ │ │ -001a1da0: 206e 616d 6573 7061 6365 2063 616c 633c namespace calc< │ │ │ │ -001a1db0: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 2f64 /span>
    .

    We genera │ │ │ │ -001a1de0: 7465 2063 6f64 653a 203c 2f70 3e3c 7072 te code:

    soapcpp2 -j │ │ │ │ -001a1e10: 2d6e 2063 616c 632e 680a 3c2f 7072 653e -n calc.h. │ │ │ │ -001a1e20: 3c70 3e20 4865 7265 2077 6520 7573 6564

    Here we used │ │ │ │ -001a1e30: 206f 7074 696f 6e20 3c62 3e3c 636f 6465 option -j t │ │ │ │ -001a1e50: 6f20 6765 6e65 7261 7465 2061 2043 2b2b o generate a C++ │ │ │ │ -001a1e60: 2073 6572 7669 6365 2063 6c61 7373 203c service class < │ │ │ │ -001a1e70: 656d 3e3c 636f 6465 3e63 616c 6343 616c em>calcCal │ │ │ │ -001a1e80: 6353 6572 7669 6365 2e68 3c2f 636f 6465 cService.h and < │ │ │ │ -001a1ea0: 636f 6465 3e63 616c 6343 616c 6353 6572 code>calcCalcSer │ │ │ │ -001a1eb0: 7669 6365 2e63 7070 3c2f 636f 6465 3e3c vice.cpp< │ │ │ │ -001a1ec0: 2f65 6d3e 2e20 5468 6520 6566 6665 6374 /em>. The effect │ │ │ │ -001a1ed0: 206f 6620 7468 6520 3c62 3e3c 636f 6465 of the -n o │ │ │ │ -001a1ef0: 7074 696f 6e20 6973 2074 6861 7420 6974 ption is that it │ │ │ │ -001a1f00: 2063 7265 6174 6573 206c 6f63 616c 206e creates local n │ │ │ │ -001a1f10: 616d 6573 7061 6365 2074 6162 6c65 7320 amespace tables │ │ │ │ -001a1f20: 616e 6420 7573 6573 203c 656d 3e3c 636f and uses calc to prefix th │ │ │ │ -001a1f50: 6520 6765 6e65 7261 7465 6420 6669 6c65 e generated file │ │ │ │ -001a1f60: 732e 3c2f 703e 0a3c 6469 7620 636c 6173 s.

    .
    < │ │ │ │ -001a1f90: 7370 616e 2063 6c61 7373 3d22 7072 6570 span class="prep │ │ │ │ -001a1fa0: 726f 6365 7373 6f72 223e 2369 6e63 6c75 rocessor">#inclu │ │ │ │ -001a1fb0: 6465 2026 7175 6f74 3b63 616c 6343 616c de "calcCal │ │ │ │ -001a1fc0: 6353 6572 7669 6365 2e68 2671 756f 743b cService.h" │ │ │ │ -001a1fd0: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ │ -001a1ff0: 3c73 7061 6e20 636c 6173 733d 2270 7265 #incl │ │ │ │ -001a2010: 7564 6520 2671 756f 743b 6361 6c63 2e6e ude "calc.n │ │ │ │ -001a2020: 736d 6170 2671 756f 743b 3c2f 7370 616e smap"
    .
    .
    in │ │ │ │ -001a2080: 743c 2f73 7061 6e3e 206d 6169 6e28 293c t main()< │ │ │ │ -001a2090: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    {
    . │ │ │ │ -001a20b0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    calc::Calc c │ │ │ │ -001a20d0: 616c 633b 203c 2f64 6976 3e0a 3c64 6976 alc;
    .
    │ │ │ │ -001a20f0: 2e2e 2e20 3c73 7061 6e20 636c 6173 733d ... //
    .
    ca │ │ │ │ -001a2130: 6c63 2e73 6572 7665 2829 3b20 3c73 7061 lc.serve(); // calls reque │ │ │ │ -001a2160: 7374 2064 6973 7061 7463 6865 7220 746f st dispatcher to │ │ │ │ -001a2170: 2069 6e76 6f6b 6520 6f6e 6520 6f66 2074 invoke one of t │ │ │ │ -001a2180: 6865 2066 756e 6374 696f 6e73 2062 656c he functions bel │ │ │ │ -001a2190: 6f77 203c 2f73 7061 6e3e 3c2f 6469 763e ow
    │ │ │ │ -001a21a0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    ... / │ │ │ │ -001a21d0: 2f3c 2f73 7061 6e3e 3c2f 6469 763e 0a3c /
    .< │ │ │ │ -001a21e0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001a21f0: 3e7d 3c2f 6469 763e 0a3c 6469 7620 636c >}
    .
    .
    i │ │ │ │ -001a2240: 6e74 3c2f 7370 616e 3e20 6361 6c63 3a3a nt calc:: │ │ │ │ -001a2250: 4361 6c63 3a3a 6164 6428 3c73 7061 6e20 Calc::add(double a, d │ │ │ │ -001a22a0: 6f75 626c 653c 2f73 7061 6e3e 2062 2c20 ouble b, │ │ │ │ -001a22b0: 3c73 7061 6e20 636c 6173 733d 226b 6579 double │ │ │ │ -001a22d0: 3c2f 7370 616e 3e20 2661 6d70 3b72 6573 &res │ │ │ │ -001a22e0: 756c 7429 3c2f 6469 763e 0a3c 6469 7620 ult)
    .
    {.
    result │ │ │ │ -001a2320: 3d20 6120 2b20 623b 3c2f 6469 763e 0a3c = a + b;
    .< │ │ │ │ -001a2330: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001a2340: 3e20 203c 7370 616e 2063 6c61 7373 3d22 > ret │ │ │ │ -001a2360: 7572 6e3c 2f73 7061 6e3e 203c 6120 636c urn S │ │ │ │ -001a23c0: 4f41 505f 4f4b 3c2f 613e 3b3c 2f64 6976 OAP_OK;
    .
    }
    . │ │ │ │ -001a2400: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    int ca │ │ │ │ -001a2440: 6c63 3a3a 4361 6c63 3a3a 7375 6228 3c73 lc::Calc::sub(double a, double │ │ │ │ -001a24a0: 2062 2c20 3c73 7061 6e20 636c 6173 733d b, do │ │ │ │ -001a24c0: 7562 6c65 3c2f 7370 616e 3e20 2661 6d70 uble & │ │ │ │ -001a24d0: 3b72 6573 756c 7429 3c2f 6469 763e 0a3c ;result)
    .< │ │ │ │ -001a24e0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001a24f0: 3e7b 3c2f 6469 763e 0a3c 6469 7620 636c >{
    .
    res │ │ │ │ -001a2510: 756c 7420 3d20 6120 2d20 623b 3c2f 6469 ult = a - b;.
    return < │ │ │ │ -001a2560: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -001a2570: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ │ -001a2580: 705f 5f65 7272 6f72 732e 6874 6d6c 2367 p__errors.html#g │ │ │ │ -001a2590: 6133 6231 3061 3638 6633 3534 6633 3963 a3b10a68f354f39c │ │ │ │ -001a25a0: 6262 3066 6530 6430 3433 6164 3463 3763 bb0fe0d043ad4c7c │ │ │ │ -001a25b0: 3022 3e53 4f41 505f 4f4b 3c2f 613e 3b3c 0">SOAP_OK;< │ │ │ │ -001a25c0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    }
    │ │ │ │ -001a25e0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    .
    int calc::Calc::mu │ │ │ │ -001a2640: 6c28 3c73 7061 6e20 636c 6173 733d 226b l(doub │ │ │ │ -001a2660: 6c65 3c2f 7370 616e 3e20 612c 203c 7370 le a, double b, double │ │ │ │ -001a26c0: 2661 6d70 3b72 6573 756c 7429 3c2f 6469 &result).
    {
    . │ │ │ │ -001a2700: 2072 6573 756c 7420 3d20 6120 2a20 623b result = a * b; │ │ │ │ -001a2710: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    return SOAP_OK;
    .
    } .
    .< │ │ │ │ -001a27f0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001a2800: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >int calc::Calc │ │ │ │ -001a2830: 3a3a 6469 7628 3c73 7061 6e20 636c 6173 ::div( │ │ │ │ -001a2850: 646f 7562 6c65 3c2f 7370 616e 3e20 612c double a, │ │ │ │ -001a2860: 203c 7370 616e 2063 6c61 7373 3d22 6b65 doubl │ │ │ │ -001a2880: 653c 2f73 7061 6e3e 2062 2c20 3c73 7061 e b, double &result) │ │ │ │ -001a28c0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    {
    │ │ │ │ -001a28e0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    result = a │ │ │ │ -001a2900: 2f20 623b 3c2f 6469 763e 0a3c 6469 7620 / b;
    .
    . │ │ │ │ -001a29c0: 7d20 3c2f 6469 763e 0a3c 2f64 6976 3e3c }
    .
    < │ │ │ │ -001a29d0: 212d 2d20 6672 6167 6d65 6e74 202d 2d3e !-- fragment --> │ │ │ │ -001a29e0: 3c70 3e54 6865 2065 7861 6d70 6c65 2061

    The example a │ │ │ │ -001a29f0: 626f 7665 2073 6572 7665 7320 7265 7175 bove serves requ │ │ │ │ -001a2a00: 6573 7473 206f 7665 7220 7374 6469 6e2f ests over stdin/ │ │ │ │ -001a2a10: 6f75 742e 2055 7365 2074 6865 2062 696e out. Use the bin │ │ │ │ -001a2a20: 6420 616e 6420 6163 6365 7074 2063 616c d and accept cal │ │ │ │ -001a2a30: 6c73 2074 6f20 6372 6561 7465 2061 2073 ls to create a s │ │ │ │ -001a2a40: 7461 6e64 2d61 6c6f 6e65 2073 6572 7665 tand-alone serve │ │ │ │ -001a2a50: 7220 746f 2073 6572 7669 6365 2069 6e62 r to service inb │ │ │ │ -001a2a60: 6f75 6e64 2072 6571 7565 7374 7320 6f76 ound requests ov │ │ │ │ -001a2a70: 6572 2073 6f63 6b65 7473 2c20 7365 6520 er sockets, see │ │ │ │ -001a2a80: 5365 6374 696f 6e20 3c61 2063 6c61 7373 Section How to creat │ │ │ │ -001a2ac0: 6520 6120 7374 616e 642d 616c 6f6e 6520 e a stand-alone │ │ │ │ -001a2ad0: 7365 7276 6572 3c2f 613e 202e 3c2f 703e server .

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

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

    .

    │ │ │ │ -001a2b40: 0a43 2065 7861 6d70 6c65 733c 2f68 333e .C examples

    │ │ │ │ -001a2b50: 0a3c 703e 5468 6973 2069 7320 7468 6520 .

    This is the │ │ │ │ -001a2b60: 7361 6d65 2065 7861 6d70 6c65 2061 7320 same example as │ │ │ │ -001a2b70: 6162 6f76 652c 2062 7574 2074 6865 2063 above, but the c │ │ │ │ -001a2b80: 6c69 656e 7473 2061 7265 2062 7569 6c64 lients are build │ │ │ │ -001a2b90: 2069 6e20 432e 3c2f 703e 0a3c 703e 5765 in C.

    .

    We │ │ │ │ -001a2ba0: 2063 7265 6174 6520 6120 3c65 6d3e 3c63 create a env.h │ │ │ │ -001a2bc0: 3c2f 656d 3e20 7468 6174 2063 6f6e 7461 that conta │ │ │ │ -001a2bd0: 696e 7320 7468 6520 6a6f 696e 7420 534f ins the joint SO │ │ │ │ -001a2be0: 4150 2048 6561 6465 7220 616e 6420 534f AP Header and SO │ │ │ │ -001a2bf0: 4150 2046 6175 6c74 2064 6566 696e 6974 AP Fault definit │ │ │ │ -001a2c00: 696f 6e73 2e20 596f 7520 6d61 7920 6861 ions. You may ha │ │ │ │ -001a2c10: 7665 2074 6f20 636f 7079 2d70 6173 7465 ve to copy-paste │ │ │ │ -001a2c20: 2074 6865 7365 2066 726f 6d20 7468 6520 these from the │ │ │ │ -001a2c30: 6f74 6865 7220 6865 6164 6572 2066 696c other header fil │ │ │ │ -001a2c40: 6573 2e20 5468 656e 2c20 636f 6d70 696c es. Then, compil │ │ │ │ -001a2c50: 6520 6974 2061 7320 666f 6c6c 6f77 733a e it as follows: │ │ │ │ -001a2c60: 203c 2f70 3e3c 7072 6520 636c 6173 733d

     soap
    │ │ │ │ -001a2c80: 6370 7032 202d 6320 2d70 656e 7620 656e  cpp2 -c -penv en
    │ │ │ │ -001a2c90: 762e 680a 2063 6320 2d63 2065 6e76 432e  v.h. cc -c envC.
    │ │ │ │ -001a2ca0: 630a 3c2f 7072 653e 3c70 3e20 5765 2061  c.

    We a │ │ │ │ -001a2cb0: 6c73 6f20 636f 6d70 696c 6520 3c65 6d3e lso compile │ │ │ │ -001a2cc0: 3c63 6f64 653e 6773 6f61 702f 7374 6473 gsoap/stds │ │ │ │ -001a2cd0: 6f61 7032 2e63 3c2f 636f 6465 3e3c 2f65 oap2.c without names │ │ │ │ -001a2cf0: 7061 6365 733a 203c 2f70 3e3c 7072 6520 paces:

     cc -c -DWITH_N
    │ │ │ │ -001a2d20: 4f4e 414d 4553 5041 4345 5320 7374 6473  ONAMESPACES stds
    │ │ │ │ -001a2d30: 6f61 7032 2e63 0a3c 2f70 7265 3e3c 703e  oap2.c.

    │ │ │ │ -001a2d40: 2053 6563 6f6e 642c 2077 6520 6372 6561 Second, we crea │ │ │ │ -001a2d50: 7465 2074 6865 2044 656c 6179 6564 2053 te the Delayed S │ │ │ │ -001a2d60: 746f 636b 2051 756f 7465 2068 6561 6465 tock Quote heade │ │ │ │ -001a2d70: 7220 6669 6c65 2073 7065 6369 6669 6361 r file specifica │ │ │ │ -001a2d80: 7469 6f6e 2c20 7768 6963 6820 6d61 7920 tion, which may │ │ │ │ -001a2d90: 6265 206f 6274 6169 6e65 6420 7573 696e be obtained usin │ │ │ │ -001a2da0: 6720 7468 6520 5753 444c 2069 6d70 6f72 g the WSDL impor │ │ │ │ -001a2db0: 7465 722e 3c2f 703e 0a3c 6469 7620 636c ter.

    .
    < │ │ │ │ -001a2dd0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001a2de0: 3e3c 7370 616e 2063 6c61 7373 3d22 636f >//gsoap n │ │ │ │ -001a2e00: 7320 7365 7276 6963 6520 6e61 6d65 3a20 s service name: │ │ │ │ -001a2e10: 5365 7276 6963 6520 3c2f 7370 616e 3e3c Service < │ │ │ │ -001a2e20: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    // │ │ │ │ -001a2e50: 6773 6f61 7020 6e73 2073 6572 7669 6365 gsoap ns service │ │ │ │ -001a2e60: 2073 7479 6c65 3a20 7270 6320 3c2f 7370 style: rpc
    .
    //gsoap ns ser │ │ │ │ -001a2eb0: 7669 6365 2065 6e63 6f64 696e 673a 2065 vice encoding: e │ │ │ │ -001a2ec0: 6e63 6f64 6564 203c 2f73 7061 6e3e 3c2f ncoded .
    //g │ │ │ │ -001a2f00: 736f 6170 206e 7320 7365 7276 6963 6520 soap ns service │ │ │ │ -001a2f10: 6c6f 6361 7469 6f6e 3a20 6874 7470 3a2f location: http:/ │ │ │ │ -001a2f20: 2f73 6572 7669 6365 732e 786d 6574 686f /services.xmetho │ │ │ │ -001a2f30: 6473 2e6e 6574 2f73 6f61 7020 3c2f 7370 ds.net/soap
    .
    //gsoap ns sch │ │ │ │ -001a2f80: 656d 6120 6e61 6d65 7370 6163 653a 2075 ema namespace: u │ │ │ │ -001a2f90: 726e 3a78 6d65 7468 6f64 732d 6465 6c61 rn:xmethods-dela │ │ │ │ -001a2fa0: 7965 642d 7175 6f74 6573 203c 2f73 7061 yed-quotes
    .
    //gsoap ns serv │ │ │ │ -001a2ff0: 6963 6520 6d65 7468 6f64 2d61 6374 696f ice method-actio │ │ │ │ -001a3000: 6e3a 2067 6574 5175 6f74 6520 2671 756f n: getQuote &quo │ │ │ │ -001a3010: 743b 2671 756f 743b 203c 2f73 7061 6e3e t;" │ │ │ │ -001a3020: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    int ns │ │ │ │ -001a3060: 5f5f 6765 7451 756f 7465 283c 7370 616e __getQuote(char │ │ │ │ -001a3090: 202a 7379 6d62 6f6c 2c20 3c73 7061 6e20 *symbol, float │ │ │ │ -001a30c0: 202a 5265 7375 6c74 293b 3c2f 6469 763e *Result);
    │ │ │ │ -001a30d0: 0a3c 2f64 6976 3e3c 212d 2d20 6672 6167 .

    We co │ │ │ │ -001a30f0: 6d70 696c 6520 6974 2061 7320 6120 6c69 mpile it as a li │ │ │ │ -001a3100: 6272 6172 7920 616e 6420 7765 2075 7365 brary and we use │ │ │ │ -001a3110: 206f 7074 696f 6e73 203c 623e 3c63 6f64 options -n │ │ │ │ -001a3130: 616e 6420 3c62 3e3c 636f 6465 3e2d 7071 and -pq │ │ │ │ -001a3140: 756f 7465 3c2f 636f 6465 3e3c 2f62 3e20 uote │ │ │ │ -001a3150: 746f 2070 7265 6669 7820 7468 6520 6765 to prefix the ge │ │ │ │ -001a3160: 6e65 7261 7465 6420 6669 6c65 7320 616e nerated files an │ │ │ │ -001a3170: 6420 746f 2072 656e 616d 6520 7468 6520 d to rename the │ │ │ │ -001a3180: 6e61 6d65 7370 6163 6520 7461 626c 6520 namespace table │ │ │ │ -001a3190: 746f 2061 766f 6964 206c 696e 6b20 636f to avoid link co │ │ │ │ -001a31a0: 6e66 6c69 6374 733a 203c 2f70 3e3c 7072 nflicts:

    soapcpp2 -c │ │ │ │ -001a31d0: 2d6e 202d 7071 756f 7465 2071 756f 7465 -n -pquote quote │ │ │ │ -001a31e0: 2e68 0a20 6363 202d 6320 7175 6f74 6543 .h. cc -c quoteC │ │ │ │ -001a31f0: 6c69 656e 744c 6962 2e63 0a3c 2f70 7265 lientLib.c.

    Third, we c │ │ │ │ -001a3210: 7265 6174 6520 7468 6520 4375 7272 656e reate the Curren │ │ │ │ -001a3220: 6379 2045 7863 6861 6e67 6520 5261 7465 cy Exchange Rate │ │ │ │ -001a3230: 2068 6561 6465 7220 6669 6c65 2073 7065 header file spe │ │ │ │ -001a3240: 6369 6669 6361 7469 6f6e 3a3c 2f70 3e0a cification:

    . │ │ │ │ -001a3250: 3c64 6976 2063 6c61 7373 3d22 6672 6167
    // │ │ │ │ -001a3290: 6773 6f61 7020 6e73 2073 6572 7669 6365 gsoap ns service │ │ │ │ -001a32a0: 206e 616d 653a 2053 6572 7669 6365 203c name: Service < │ │ │ │ -001a32b0: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    .< │ │ │ │ -001a32d0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ -001a32e0: 656e 7422 3e2f 2f67 736f 6170 206e 7320 ent">//gsoap ns │ │ │ │ -001a32f0: 7365 7276 6963 6520 7374 796c 653a 2072 service style: r │ │ │ │ -001a3300: 7063 203c 2f73 7061 6e3e 3c2f 6469 763e pc
    │ │ │ │ -001a3310: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    //gsoap │ │ │ │ -001a3340: 206e 7320 7365 7276 6963 6520 656e 636f ns service enco │ │ │ │ -001a3350: 6469 6e67 3a20 656e 636f 6465 6420 3c2f ding: encoded
    .
    //gsoap ns s │ │ │ │ -001a33a0: 6572 7669 6365 206c 6f63 6174 696f 6e3a ervice location: │ │ │ │ -001a33b0: 2068 7474 703a 2f2f 7365 7276 6963 6573 http://services │ │ │ │ -001a33c0: 2e78 6d65 7468 6f64 732e 6e65 742f 736f .xmethods.net/so │ │ │ │ -001a33d0: 6170 203c 2f73 7061 6e3e 3c2f 6469 763e ap
    │ │ │ │ -001a33e0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    //gsoap │ │ │ │ -001a3410: 206e 7320 7363 6865 6d61 206e 616d 6573 ns schema names │ │ │ │ -001a3420: 7061 6365 3a20 7572 6e3a 786d 6574 686f pace: urn:xmetho │ │ │ │ -001a3430: 6473 2d43 7572 7265 6e63 7945 7863 6861 ds-CurrencyExcha │ │ │ │ -001a3440: 6e67 6520 3c2f 7370 616e 3e3c 2f64 6976 nge
    .
    //gsoa │ │ │ │ -001a3480: 7020 6e73 2073 6572 7669 6365 206d 6574 p ns service met │ │ │ │ -001a3490: 686f 642d 6163 7469 6f6e 3a20 6765 7452 hod-action: getR │ │ │ │ -001a34a0: 6174 6520 2671 756f 743b 2671 756f 743b ate "" │ │ │ │ -001a34b0: 203c 2f73 7061 6e3e 3c2f 6469 763e 0a3c
    .< │ │ │ │ -001a34c0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001a34d0: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >int ns__getRat │ │ │ │ -001a3500: 6528 3c73 7061 6e20 636c 6173 733d 226b e(char │ │ │ │ -001a3520: 3c2f 7370 616e 3e20 2a63 6f75 6e74 7279 *country │ │ │ │ -001a3530: 312c 203c 7370 616e 2063 6c61 7373 3d22 1, cha │ │ │ │ -001a3550: 723c 2f73 7061 6e3e 202a 636f 756e 7472 r *countr │ │ │ │ -001a3560: 7932 2c20 3c73 7061 6e20 636c 6173 733d y2, fl │ │ │ │ -001a3580: 6f61 743c 2f73 7061 6e3e 202a 5265 7375 oat *Resu │ │ │ │ -001a3590: 6c74 293b 3c2f 6469 763e 0a3c 2f64 6976 lt);
    .

    Compile │ │ │ │ -001a45a0: 616e 6420 6c69 6e6b 2074 6869 7320 6170 and link this ap │ │ │ │ -001a45b0: 706c 6963 6174 696f 6e20 7769 7468 203c plication with < │ │ │ │ -001a45c0: 656d 3e3c 636f 6465 3e73 7464 736f 6170 em>stdsoap │ │ │ │ -001a45d0: 322e 6f3c 2f63 6f64 653e 3c2f 656d 3e2c 2.o, │ │ │ │ -001a45e0: 203c 656d 3e3c 636f 6465 3e65 6e76 432e envC. │ │ │ │ -001a45f0: 6f3c 2f63 6f64 653e 3c2f 656d 3e2c 203c o, < │ │ │ │ -001a4600: 656d 3e3c 636f 6465 3e71 756f 7465 436c em>quoteCl │ │ │ │ -001a4610: 6965 6e74 4c69 622e 6f3c 2f63 6f64 653e ientLib.o │ │ │ │ -001a4620: 3c2f 656d 3e2c 2061 6e64 203c 656d 3e3c , and < │ │ │ │ -001a4630: 636f 6465 3e72 6174 6543 6c69 656e 744c code>rateClientL │ │ │ │ -001a4640: 6962 2e6f 3c2f 636f 6465 3e3c 2f65 6d3e ib.o │ │ │ │ -001a4650: 2e3c 2f70 3e0a 3c70 3ef0 9f94 9d20 3c61 .

    .

    .... Back t │ │ │ │ -001a4670: 6f20 7461 626c 6520 6f66 2063 6f6e 7465 o table of conte │ │ │ │ -001a4680: 6e74 733c 2f61 3e3c 2f70 3e0a 3c68 333e nts

    .

    │ │ │ │ -001a4690: 3c61 2063 6c61 7373 3d22 616e 6368 6f72 .How to cha │ │ │ │ -001a46c0: 696e 2043 2073 6572 7669 6365 7320 746f in C services to │ │ │ │ -001a46d0: 2061 6363 6570 7420 6d65 7373 6167 6573 accept messages │ │ │ │ -001a46e0: 206f 6e20 7468 6520 7361 6d65 2070 6f72 on the same por │ │ │ │ -001a46f0: 743c 2f68 333e 0a3c 703e 5768 656e 2063 t

    .

    When c │ │ │ │ -001a4700: 6f6d 6269 6e69 6e67 206d 756c 7469 706c ombining multipl │ │ │ │ -001a4710: 6520 7365 7276 6963 6573 2069 6e74 6f20 e services into │ │ │ │ -001a4720: 6f6e 6520 6170 706c 6963 6174 696f 6e2c one application, │ │ │ │ -001a4730: 2079 6f75 2063 616e 2072 756e 2077 7364 you can run wsd │ │ │ │ -001a4740: 6c32 6820 6f6e 206d 756c 7469 706c 6520 l2h on multiple │ │ │ │ -001a4750: 5753 444c 7320 746f 2067 656e 6572 6174 WSDLs to generat │ │ │ │ -001a4760: 6520 7468 6520 7369 6e67 6c65 2061 6c6c e the single all │ │ │ │ -001a4770: 2d69 6e63 6c75 7369 7665 2073 6572 7669 -inclusive servi │ │ │ │ -001a4780: 6365 2064 6566 696e 6974 696f 6e73 2069 ce definitions i │ │ │ │ -001a4790: 6e74 6572 6661 6365 2068 6561 6465 7220 nterface header │ │ │ │ -001a47a0: 6669 6c65 2066 6f72 2073 6f61 7063 7070 file for soapcpp │ │ │ │ -001a47b0: 322e 2054 6869 7320 6865 6164 6572 2066 2. This header f │ │ │ │ -001a47c0: 696c 6520 6973 2074 6865 6e20 7072 6f63 ile is then proc │ │ │ │ -001a47d0: 6573 7365 6420 7769 7468 2073 6f61 7063 essed with soapc │ │ │ │ -001a47e0: 7070 3220 746f 2067 656e 6572 6174 6520 pp2 to generate │ │ │ │ -001a47f0: 736b 656c 6574 6f6e 2066 756e 6374 696f skeleton functio │ │ │ │ -001a4800: 6e73 2069 6e20 432e 3c2f 703e 0a3c 703e ns in C.

    .

    │ │ │ │ -001a4810: 5768 6174 2069 6620 7765 2067 656e 6572 What if we gener │ │ │ │ -001a4820: 6174 6520 6d75 6c74 6970 6c65 2073 6572 ate multiple ser │ │ │ │ -001a4830: 7669 6365 732c 2065 6163 6820 6672 6f6d vices, each from │ │ │ │ -001a4840: 2061 2057 5344 4c20 7365 7061 7261 7465 a WSDL separate │ │ │ │ -001a4850: 6c79 2c20 616e 6420 7761 6e74 2074 6f20 ly, and want to │ │ │ │ -001a4860: 6465 706c 6f79 2074 6865 6d20 6f6e 2074 deploy them on t │ │ │ │ -001a4870: 6865 2073 616d 6520 706f 7274 3f20 5468 he same port? Th │ │ │ │ -001a4880: 6973 2072 6571 7569 7265 7320 6c69 7374 is requires list │ │ │ │ -001a4890: 656e 696e 6720 746f 2074 6865 2073 616d ening to the sam │ │ │ │ -001a48a0: 6520 706f 7274 2061 6e64 2074 6865 6e20 e port and then │ │ │ │ -001a48b0: 6368 6169 6e69 6e67 2074 6865 2073 6572 chaining the ser │ │ │ │ -001a48c0: 7669 6365 2064 6973 7061 7463 6865 7320 vice dispatches │ │ │ │ -001a48d0: 736f 2074 6861 7420 6561 6368 2073 6572 so that each ser │ │ │ │ -001a48e0: 7669 6365 2063 616e 2073 6572 7665 2061 vice can serve a │ │ │ │ -001a48f0: 2072 6571 7565 7374 2e3c 2f70 3e0a 3c70 request.

    .

    First we create │ │ │ │ -001a4910: 2061 203c 656d 3e3c 636f 6465 3e65 6e76 a env │ │ │ │ -001a4920: 2e68 3c2f 636f 6465 3e3c 2f65 6d3e 2074 .h t │ │ │ │ -001a4930: 6861 7420 636f 6e74 6169 6e73 2074 6865 hat contains the │ │ │ │ -001a4940: 206a 6f69 6e74 2053 4f41 5020 4865 6164 joint SOAP Head │ │ │ │ -001a4950: 6572 2061 6e64 2053 4f41 5020 4661 756c er and SOAP Faul │ │ │ │ -001a4960: 7420 6465 6669 6e69 7469 6f6e 732c 2066 t definitions, f │ │ │ │ -001a4970: 6f72 2065 7861 6d70 6c65 2062 7920 636f or example by co │ │ │ │ -001a4980: 7079 2d70 6173 7469 6e67 2074 6865 7365 py-pasting these │ │ │ │ -001a4990: 2066 726f 6d20 7468 6520 6f74 6865 7220 from the other │ │ │ │ -001a49a0: 6865 6164 6572 2066 696c 6573 2067 656e header files gen │ │ │ │ -001a49b0: 6572 6174 6564 2062 7920 7773 646c 3268 erated by wsdl2h │ │ │ │ -001a49c0: 2e20 4f72 2074 6869 7320 6669 6c65 2069 . Or this file i │ │ │ │ -001a49d0: 7320 656d 7074 7920 6966 206e 6f20 7370 s empty if no sp │ │ │ │ -001a49e0: 6563 6961 6c69 7a65 6420 534f 4150 2048 ecialized SOAP H │ │ │ │ -001a49f0: 6561 6465 7273 2061 6e64 2046 6175 6c74 eaders and Fault │ │ │ │ -001a4a00: 7320 6172 6520 7573 6564 2e20 5765 2063 s are used. We c │ │ │ │ -001a4a10: 6f6d 7069 6c65 2069 7420 6173 2066 6f6c ompile it as fol │ │ │ │ -001a4a20: 6c6f 7773 3a20 3c2f 703e 3c70 7265 2063 lows:

    │ │ │ │ -001a4a40: 2073 6f61 7063 7070 3220 2d63 202d 7065   soapcpp2 -c -pe
    │ │ │ │ -001a4a50: 6e76 2065 6e76 2e68 0a20 6363 202d 6320  nv env.h. cc -c 
    │ │ │ │ -001a4a60: 656e 7643 2e63 0a3c 2f70 7265 3e3c 703e  envC.c.

    │ │ │ │ -001a4a70: 2057 6520 616c 736f 2063 6f6d 7069 6c65 We also compile │ │ │ │ -001a4a80: 203c 656d 3e3c 636f 6465 3e67 736f 6170 gsoap │ │ │ │ -001a4a90: 2f73 7464 736f 6170 322e 633c 2f63 6f64 /stdsoap2.c without │ │ │ │ -001a4ab0: 6e61 6d65 7370 6163 6573 3a20 3c2f 703e namespaces:

    │ │ │ │ -001a4ac0: 3c70 7265 2063 6c61 7373 3d22 6672 6167
     cc -c -DW
    │ │ │ │ -001a4ae0: 4954 485f 4e4f 4e41 4d45 5350 4143 4553  ITH_NONAMESPACES
    │ │ │ │ -001a4af0: 2073 7464 736f 6170 322e 630a 3c2f 7072   stdsoap2.c.

    Say for ex │ │ │ │ -001a4b10: 616d 706c 6520 7468 6174 2077 6520 6861 ample that we ha │ │ │ │ -001a4b20: 7665 2061 2073 6572 7669 6365 2064 6566 ve a service def │ │ │ │ -001a4b30: 696e 6974 696f 6e20 696e 203c 656d 3e3c inition in < │ │ │ │ -001a4b40: 636f 6465 3e71 756f 7465 2e68 3c2f 636f code>quote.h. We com │ │ │ │ -001a4b60: 7069 6c65 2069 7420 6173 2061 206c 6962 pile it as a lib │ │ │ │ -001a4b70: 7261 7279 2061 6e64 2077 6520 7573 6520 rary and we use │ │ │ │ -001a4b80: 6f70 7469 6f6e 7320 3c62 3e3c 636f 6465 options -n a │ │ │ │ -001a4ba0: 6e64 203c 623e 3c63 6f64 653e 2d70 7175 nd -pqu │ │ │ │ -001a4bb0: 6f74 653c 2f63 6f64 653e 3c2f 623e 2074 ote t │ │ │ │ -001a4bc0: 6f20 7072 6566 6978 2074 6865 2067 656e o prefix the gen │ │ │ │ -001a4bd0: 6572 6174 6564 2066 696c 6573 2061 6e64 erated files and │ │ │ │ -001a4be0: 2074 6f20 7265 6e61 6d65 2074 6865 206e to rename the n │ │ │ │ -001a4bf0: 616d 6573 7061 6365 2074 6162 6c65 2074 amespace table t │ │ │ │ -001a4c00: 6f20 6176 6f69 6420 6c69 6e6b 2063 6f6e o avoid link con │ │ │ │ -001a4c10: 666c 6963 7473 3a20 3c2f 703e 3c70 7265 flicts:

     soapcpp2 -c -
    │ │ │ │ -001a4c40: 6e20 2d70 7175 6f74 6520 7175 6f74 652e  n -pquote quote.
    │ │ │ │ -001a4c50: 680a 2063 6320 2d63 2071 756f 7465 436c  h. cc -c quoteCl
    │ │ │ │ -001a4c60: 6965 6e74 4c69 622e 630a 3c2f 7072 653e  ientLib.c.
    │ │ │ │ -001a4c70: 3c70 3e20 5765 2064 6f20 7468 6520 7361

    We do the sa │ │ │ │ -001a4c80: 6d65 2066 6f72 2061 2073 6572 7669 6365 me for a service │ │ │ │ -001a4c90: 2064 6566 696e 6974 696f 6e20 696e 203c definition in < │ │ │ │ -001a4ca0: 656d 3e3c 636f 6465 3e72 6174 652e 683c em>rate.h< │ │ │ │ -001a4cb0: 2f63 6f64 653e 3c2f 656d 3e3a 203c 2f70 /code>:

     soapcpp2
    │ │ │ │ -001a4ce0: 202d 6320 2d6e 202d 7072 6174 6520 7261   -c -n -prate ra
    │ │ │ │ -001a4cf0: 7465 2e68 0a20 6363 202d 6320 7261 7465  te.h. cc -c rate
    │ │ │ │ -001a4d00: 436c 6965 6e74 4c69 622e 630a 3c2f 7072  ClientLib.c.

    To serve b │ │ │ │ -001a4d20: 6f74 6820 7468 6520 7175 6f74 6520 616e oth the quote an │ │ │ │ -001a4d30: 6420 7261 7465 2073 6572 7669 6365 7320 d rate services │ │ │ │ -001a4d40: 6f6e 2074 6865 2073 616d 6520 706f 7274 on the same port │ │ │ │ -001a4d50: 2c20 7765 2063 6861 696e 2074 6865 2073 , we chain the s │ │ │ │ -001a4d60: 6572 7669 6365 2064 6973 7061 7463 6865 ervice dispatche │ │ │ │ -001a4d70: 7273 2061 7320 666f 6c6c 6f77 733a 3c2f rs as follows:.

    #include & │ │ │ │ -001a4dd0: 7175 6f74 3b71 756f 7465 482e 6826 7175 quot;quoteH.h&qu │ │ │ │ -001a4de0: 6f74 3b3c 2f73 7061 6e3e 3c2f 6469 763e ot;
    │ │ │ │ -001a4df0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    #i │ │ │ │ -001a4e20: 6e63 6c75 6465 2026 7175 6f74 3b72 6174 nclude "rat │ │ │ │ -001a4e30: 6548 2e68 2671 756f 743b 3c2f 7370 616e eH.h"
    .
    #include &q │ │ │ │ -001a4e80: 756f 743b 7175 6f74 652e 6e73 6d61 7026 uot;quote.nsmap& │ │ │ │ -001a4e90: 7175 6f74 3b3c 2f73 7061 6e3e 3c2f 6469 quot;.
    │ │ │ │ -001a4ed0: 2369 6e63 6c75 6465 2026 7175 6f74 3b72 #include "r │ │ │ │ -001a4ee0: 6174 652e 6e73 6d61 7026 7175 6f74 3b3c ate.nsmap"< │ │ │ │ -001a4ef0: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    . │ │ │ │ -001a4f10: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    s │ │ │ │ -001a4f40: 7472 7563 7420 3c2f 7370 616e 3e3c 6120 truct soap *soap = │ │ │ │ -001a4fb0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap_new();
    .
    if (soap_valid_ │ │ │ │ -001a50b0: 736f 636b 6574 3c2f 613e 283c 6120 636c socket(soap_ │ │ │ │ -001a5110: 6269 6e64 3c2f 613e 283c 6120 636c 6173 bind( │ │ │ │ -001a5140: 736f 6170 3c2f 613e 2c20 4e55 4c4c 2c20 soap, NULL, │ │ │ │ -001a5150: 3830 3830 2c20 3130 2929 2920 3c73 7061 8080, 10))) // small BACKL │ │ │ │ -001a5180: 4f47 2066 6f72 2069 7465 7261 7469 7665 OG for iterative │ │ │ │ -001a5190: 2073 6572 7665 7273 3c2f 7370 616e 3e3c servers< │ │ │ │ -001a51a0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    {
    . │ │ │ │ -001a51c0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65 .
    │ │ │ │ -001a5390: 2020 203c 7370 616e 2063 6c61 7373 3d22 if< │ │ │ │ -001a53b0: 2f73 7061 6e3e 2028 3c61 2063 6c61 7373 /span> (soap_beg │ │ │ │ -001a5410: 696e 5f73 6572 7665 3c2f 613e 283c 6120 in_serve(soap)) < │ │ │ │ -001a5450: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    {< │ │ │ │ -001a5470: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    │ │ │ │ -001a5490: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap_print_fa │ │ │ │ -001a54f0: 756c 743c 2f61 3e28 3c61 2063 6c61 7373 ult(s │ │ │ │ -001a5520: 6f61 703c 2f61 3e2c 2073 7464 6572 7229 oap, stderr) │ │ │ │ -001a5530: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
    .
    │ │ │ │ -001a5550: 2020 203c 7370 616e 2063 6c61 7373 3d22 con │ │ │ │ -001a5570: 7469 6e75 653c 2f73 7061 6e3e 3b3c 2f64 tinue;.
    }.
    soap_set_name │ │ │ │ -001a5620: 7370 6163 6573 3c2f 613e 283c 6120 636c spaces(soap, quot │ │ │ │ -001a5660: 655f 6e61 6d65 7370 6163 6573 293b 3c2f e_namespaces);.
    if │ │ │ │ -001a56b0: 2028 7175 6f74 655f 7365 7276 655f 7265 (quote_serve_re │ │ │ │ -001a56c0: 7175 6573 7428 3c61 2063 6c61 7373 3d22 quest(soa │ │ │ │ -001a56f0: 703c 2f61 3e29 203d 3d20 3c61 2063 6c61 p) == SO │ │ │ │ -001a5750: 4150 5f4e 4f5f 4d45 5448 4f44 3c2f 613e AP_NO_METHOD │ │ │ │ -001a5760: 2920 3c2f 6469 763e 0a3c 6469 7620 636c )
    .
    │ │ │ │ -001a5780: 207b 3c2f 6469 763e 0a3c 6469 7620 636c {
    .
    │ │ │ │ -001a57a0: 2020 203c 6120 636c 6173 733d 2263 6f64 soap_s │ │ │ │ -001a5800: 6574 5f6e 616d 6573 7061 6365 733c 2f61 et_namespaces(soap, rate_namespac │ │ │ │ -001a5850: 6573 293b 3c2f 6469 763e 0a3c 6469 7620 es);
    .
    │ │ │ │ -001a5870: 2020 2020 203c 7370 616e 2063 6c61 7373 i │ │ │ │ -001a5890: 663c 2f73 7061 6e3e 2028 7261 7465 5f73 f (rate_s │ │ │ │ -001a58a0: 6572 7665 5f72 6571 7565 7374 283c 6120 erve_request(soap)).
    │ │ │ │ -001a5900: 203c 6120 636c 6173 733d 2263 6f64 6522 soap_send_fault │ │ │ │ -001a5960: 3c2f 613e 283c 6120 636c 6173 733d 2263 (soap │ │ │ │ -001a5990: 3c2f 613e 293b 203c 7370 616e 2063 6c61 ); // │ │ │ │ -001a59b0: 7365 6e64 2066 6175 6c74 2074 6f20 636c send fault to cl │ │ │ │ -001a59c0: 6965 6e74 203c 2f73 7061 6e3e 3c2f 6469 ient .
    } .
    else if (so │ │ │ │ -001a5a80: 6170 3c2f 613e 2d26 6774 3b3c 6120 636c ap->error) < │ │ │ │ -001a5ae0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    {< │ │ │ │ -001a5b00: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>..
    }
    .
    }
    . │ │ │ │ -001a5c30: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    │ │ │ │ -001a5c60: 656c 7365 3c2f 7370 616e 3e20 3c73 7061 else if │ │ │ │ -001a5c90: 283c 6120 636c 6173 733d 2263 6f64 6522 (soap │ │ │ │ -001a5cc0: 2d26 6774 3b3c 6120 636c 6173 733d 2263 ->er │ │ │ │ -001a5d10: 726e 756d 3c2f 613e 2920 3c73 7061 6e20 rnum) │ │ │ │ -001a5d30: 2f2f 2061 6363 6570 7420 6661 696c 6564 // accept failed │ │ │ │ -001a5d40: 2c20 7472 7920 6167 6169 6e20 6166 7465 , try again afte │ │ │ │ -001a5d50: 7220 3120 7365 636f 6e64 3c2f 7370 616e r 1 second
    .
    {< │ │ │ │ -001a5d80: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>..
    s │ │ │ │ -001a5e60: 6c65 6570 2831 293b 3c2f 6469 763e 0a3c leep(1);
    .< │ │ │ │ -001a5e70: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001a5e80: 3e20 2020 207d 203c 2f64 6976 3e0a 3c64 > }
    . │ │ │ │ -001a5ea0: 2020 2020 3c73 7061 6e20 636c 6173 733d el │ │ │ │ -001a5ec0: 7365 3c2f 7370 616e 3e3c 2f64 6976 3e0a se
    . │ │ │ │ -001a5ed0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    {
    . │ │ │ │ -001a5f00: 2020 2020 2020 6670 7269 6e74 6628 7374 fprintf(st │ │ │ │ -001a5f10: 6465 7272 2c20 3c73 7061 6e20 636c 6173 derr, "server t │ │ │ │ -001a5f40: 696d 6564 206f 7574 5c6e 2671 756f 743b imed out\n" │ │ │ │ -001a5f50: 3c2f 7370 616e 3e29 3b20 3c2f 6469 763e );
    │ │ │ │ -001a5f60: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    break; │ │ │ │ -001a5fa0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    }< │ │ │ │ -001a5fc0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>..
    │ │ │ │ -001a6090: 203c 6120 636c 6173 733d 2263 6f64 6522 soap_end(soap);
    .
    │ │ │ │ -001a6140: 7d3c 2f64 6976 3e0a 3c64 6976 2063 6c61 }
    .
    }
    .
    soap_de │ │ │ │ -001a61d0: 7374 726f 793c 2f61 3e28 3c61 2063 6c61 stroy(soap); .. │ │ │ │ -001a62c0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65 .

    This chai │ │ │ │ -001a6390: 6e69 6e67 2063 616e 2062 6520 6172 6269 ning can be arbi │ │ │ │ -001a63a0: 7472 6172 696c 7920 6465 6570 2e20 5768 trarily deep. Wh │ │ │ │ -001a63b0: 656e 2074 6865 2070 7265 7669 6f75 7320 en the previous │ │ │ │ -001a63c0: 7265 7175 6573 7420 6661 696c 7320 7769 request fails wi │ │ │ │ -001a63d0: 7468 2061 203c 636f 6465 3e23 534f 4150 th a #SOAP │ │ │ │ -001a63e0: 5f4e 4f5f 4d45 5448 4f44 3c2f 636f 6465 _NO_METHOD then next requ │ │ │ │ -001a6400: 6573 7420 6469 7370 6174 6368 6572 2063 est dispatcher c │ │ │ │ -001a6410: 616e 2062 6520 7472 6965 642e 3c2f 703e an be tried.

    │ │ │ │ -001a6420: 0a3c 703e 5468 6520 7365 7276 6572 2073 .

    The server s │ │ │ │ -001a6430: 686f 756c 6420 616c 736f 2064 6566 696e hould also defin │ │ │ │ -001a6440: 6520 7468 6520 7365 7276 6963 6520 6f70 e the service op │ │ │ │ -001a6450: 6572 6174 696f 6e73 3a3c 2f70 3e0a 3c64 erations:

    .
    │ │ │ │ -001a64a0: 696e 743c 2f73 7061 6e3e 206e 735f 5f67 int ns__g │ │ │ │ -001a64b0: 6574 5175 6f74 6528 3c73 7061 6e20 636c etQuote(st │ │ │ │ -001a64d0: 7275 6374 3c2f 7370 616e 3e20 3c61 2063 ruct soap *soap, char *symbol, float *Result); .
    {
    .< │ │ │ │ -001a65c0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001a65d0: 3e20 202a 5265 7375 6c74 203d 202e 2e2e > *Result = ... │ │ │ │ -001a65e0: 203b 203c 2f64 6976 3e0a 3c64 6976 2063 ;
    .. │ │ │ │ -001a66a0: 7d20 3c2f 6469 763e 0a3c 6469 7620 636c }
    .
    .
    i │ │ │ │ -001a66f0: 6e74 3c2f 7370 616e 3e20 6e73 5f5f 6765 nt ns__ge │ │ │ │ -001a6700: 7452 6174 6528 3c73 7061 6e20 636c 6173 tRate(stru │ │ │ │ -001a6720: 6374 3c2f 7370 616e 3e20 3c61 2063 6c61 ct soap *soap, char *country1, char *country2, float *Result); < │ │ │ │ -001a6820: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    {
    . │ │ │ │ -001a6840: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    *Result = .. │ │ │ │ -001a6860: 2e20 3b20 3c2f 6469 763e 0a3c 6469 7620 . ;
    .
    < │ │ │ │ -001a6880: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -001a6890: 6f72 6466 6c6f 7722 3e72 6574 7572 6e3c ordflow">return< │ │ │ │ -001a68a0: 2f73 7061 6e3e 203c 6120 636c 6173 733d /span> SOAP_ │ │ │ │ -001a6900: 4f4b 3c2f 613e 3b20 3c2f 6469 763e 0a3c OK;
    .< │ │ │ │ -001a6910: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001a6920: 3e7d 3c2f 6469 763e 0a3c 2f64 6976 3e3c >}
    .
    < │ │ │ │ -001a6930: 212d 2d20 6672 6167 6d65 6e74 202d 2d3e !-- fragment --> │ │ │ │ -001a6940: 3c70 3e48 6f77 6576 6572 2c20 7468 6520

    However, the │ │ │ │ -001a6950: 7768 696c 6520 6c6f 6f70 2069 7465 7261 while loop itera │ │ │ │ -001a6960: 7465 7320 666f 7220 6561 6368 206e 6577 tes for each new │ │ │ │ -001a6970: 2063 6f6e 6e65 6374 696f 6e20 7468 6174 connection that │ │ │ │ -001a6980: 2069 7320 6573 7461 626c 6973 6865 6420 is established │ │ │ │ -001a6990: 7769 7468 203c 636f 6465 3e3c 6120 636c with soap_accept< │ │ │ │ -001a6a20: 2f61 3e3c 2f63 6f64 653e 2061 6e64 2064 /a> and d │ │ │ │ -001a6a30: 6f65 7320 6e6f 7420 616c 6c6f 7720 666f oes not allow fo │ │ │ │ -001a6a40: 7220 4854 5450 206b 6565 702d 616c 6976 r HTTP keep-aliv │ │ │ │ -001a6a50: 6520 636f 6e6e 6563 7469 6f6e 7320 746f e connections to │ │ │ │ -001a6a60: 2070 6572 7369 7374 2e20 466f 7220 6f75 persist. For ou │ │ │ │ -001a6a70: 7220 6669 6e61 6c20 696d 7072 6f76 656d r final improvem │ │ │ │ -001a6a80: 656e 7420 7765 2077 616e 7420 746f 2073 ent we want to s │ │ │ │ -001a6a90: 7570 706f 7274 2048 5454 5020 6b65 6570 upport HTTP keep │ │ │ │ -001a6aa0: 2d61 6c69 7665 2063 6f6e 6e65 6374 696f -alive connectio │ │ │ │ -001a6ab0: 6e73 2074 6861 7420 7265 7175 6972 6520 ns that require │ │ │ │ -001a6ac0: 6c6f 6f70 696e 6720 6f76 6572 2074 6865 looping over the │ │ │ │ -001a6ad0: 2073 6572 7669 6365 2064 6973 7061 7463 service dispatc │ │ │ │ -001a6ae0: 6865 7320 756e 7469 6c20 7468 6520 636f hes until the co │ │ │ │ -001a6af0: 6e6e 6563 7469 6f6e 2063 6c6f 7365 7320 nnection closes │ │ │ │ -001a6b00: 6f6e 2065 6974 6865 7220 656e 642c 2061 on either end, a │ │ │ │ -001a6b10: 6674 6572 2077 6869 6368 2077 6520 7265 fter which we re │ │ │ │ -001a6b20: 7375 6d65 2074 6865 206f 7574 6572 206c sume the outer l │ │ │ │ -001a6b30: 6f6f 702e 2054 6865 2072 6573 756c 7469 oop. The resulti │ │ │ │ -001a6b40: 6e67 2063 6f64 6520 6973 2076 6572 7920 ng code is very │ │ │ │ -001a6b50: 636c 6f73 6520 746f 2074 6865 2073 6f61 close to the soa │ │ │ │ -001a6b60: 7063 7070 322d 6765 6e65 7261 7465 6420 pcpp2-generated │ │ │ │ -001a6b70: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 soap_serve< │ │ │ │ -001a6bf0: 2f61 3e3c 2f63 6f64 653e 2063 6f64 6520 /a> code │ │ │ │ -001a6c00: 616e 6420 7468 6520 3c63 6f64 653e 7365 and the se │ │ │ │ -001a6c10: 7276 653c 2f63 6f64 653e 2073 6572 7669 rve servi │ │ │ │ -001a6c20: 6365 2063 6c61 7373 206d 6574 686f 6473 ce class methods │ │ │ │ -001a6c30: 2c20 7769 7468 2074 6865 2061 6464 6974 , with the addit │ │ │ │ -001a6c40: 696f 6e20 6f66 2074 6865 2063 6861 696e ion of the chain │ │ │ │ -001a6c50: 206f 6620 7365 7276 6963 6520 6469 7370 of service disp │ │ │ │ -001a6c60: 6174 6368 6573 2069 6e20 7468 6520 6c6f atches in the lo │ │ │ │ -001a6c70: 6f70 2062 6f64 793a 3c2f 703e 0a3c 6469 op body:

    .
    │ │ │ │ -001a6cc0: 2369 6e63 6c75 6465 2026 7175 6f74 3b71 #include "q │ │ │ │ -001a6cd0: 756f 7465 482e 6826 7175 6f74 3b3c 2f73 uoteH.h"
    .
    #include │ │ │ │ -001a6d20: 2026 7175 6f74 3b72 6174 6548 2e68 2671 "rateH.h&q │ │ │ │ -001a6d30: 756f 743b 3c2f 7370 616e 3e3c 2f64 6976 uot;
    .
    # │ │ │ │ -001a6d70: 696e 636c 7564 6520 2671 756f 743b 7175 include "qu │ │ │ │ -001a6d80: 6f74 652e 6e73 6d61 7026 7175 6f74 3b3c ote.nsmap"< │ │ │ │ -001a6d90: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    .< │ │ │ │ -001a6db0: 7370 616e 2063 6c61 7373 3d22 7072 6570 span class="prep │ │ │ │ -001a6dc0: 726f 6365 7373 6f72 223e 2369 6e63 6c75 rocessor">#inclu │ │ │ │ -001a6dd0: 6465 2026 7175 6f74 3b72 6174 652e 6e73 de "rate.ns │ │ │ │ -001a6de0: 6d61 7026 7175 6f74 3b3c 2f73 7061 6e3e map" │ │ │ │ -001a6df0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    │ │ │ │ -001a6e10: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    .
    .
    {.
    soap-> │ │ │ │ -001a72c0: 3b3c 6120 636c 6173 733d 2263 6f64 6522 ;keep_a │ │ │ │ -001a7310: 6c69 7665 3c2f 613e 203d 203c 6120 636c live = soap->< │ │ │ │ -001a7350: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -001a7360: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ -001a7370: 6874 6d6c 2361 3164 3761 6361 3661 6331 html#a1d7aca6ac1 │ │ │ │ -001a7380: 6436 3233 3032 3130 3263 3137 3530 3861 d62302102c17508a │ │ │ │ -001a7390: 3862 3065 6330 223e 6d61 785f 6b65 6570 8b0ec0">max_keep │ │ │ │ -001a73a0: 5f61 6c69 7665 3c2f 613e 202b 2031 3b20 _alive + 1; │ │ │ │ -001a73b0: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // max kee │ │ │ │ -001a73d0: 702d 616c 6976 6520 6974 6572 6174 696f p-alive iteratio │ │ │ │ -001a73e0: 6e73 3c2f 7370 616e 3e3c 2f64 6976 3e0a ns
    . │ │ │ │ -001a73f0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    do
    .
    {
    .
    if │ │ │ │ -001a7490: 2828 3c61 2063 6c61 7373 3d22 636f 6465 ((soap->k │ │ │ │ -001a7510: 6565 705f 616c 6976 653c 2f61 3e20 2667 eep_alive &g │ │ │ │ -001a7520: 743b 2030 2920 2661 6d70 3b26 616d 703b t; 0) && │ │ │ │ -001a7530: 2028 3c61 2063 6c61 7373 3d22 636f 6465 (soap->m │ │ │ │ -001a75b0: 6178 5f6b 6565 705f 616c 6976 653c 2f61 ax_keep_alive > 0))
    │ │ │ │ -001a75d0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    soap-> │ │ │ │ -001a7620: 3b3c 6120 636c 6173 733d 2263 6f64 6522 ;keep_a │ │ │ │ -001a7670: 6c69 7665 3c2f 613e 2d2d 3b3c 2f64 6976 live--;
    .. │ │ │ │ -001a7770: 2020 2020 2020 2020 7b3c 2f64 6976 3e0a {
    . │ │ │ │ -001a7780: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    if │ │ │ │ -001a77c0: 283c 6120 636c 6173 733d 2263 6f64 6522 (soap │ │ │ │ -001a77f0: 2d26 6774 3b3c 6120 636c 6173 733d 2263 ->er │ │ │ │ -001a7840: 726f 723c 2f61 3e20 2667 743b 3d20 3c61 ror >= SOAP_STOP) │ │ │ │ -001a78b0: 203c 7370 616e 2063 6c61 7373 3d22 636f // if a p │ │ │ │ -001a78d0: 6c75 6769 6e20 6861 7320 7365 7276 6564 lugin has served │ │ │ │ -001a78e0: 2074 6865 2072 6571 7565 7374 3c2f 7370 the request
    .
    │ │ │ │ -001a7910: 2020 2020 2020 2020 3c73 7061 6e20 636c continue; │ │ │ │ -001a7950: 2020 2020 203c 7370 616e 2063 6c61 7373 // th │ │ │ │ -001a7970: 656e 2063 6f6e 7469 6e75 6520 7769 7468 en continue with │ │ │ │ -001a7980: 2074 6865 206e 6578 7420 7265 7175 6573 the next reques │ │ │ │ -001a7990: 743c 2f73 7061 6e3e 3c2f 6469 763e 0a3c t
    .< │ │ │ │ -001a79a0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001a79b0: 3e20 2020 2020 2020 2020 203c 7370 616e > break; │ │ │ │ -001a79f0: 2020 2020 2020 2020 2020 3c73 7061 6e20 │ │ │ │ -001a7a10: 2f2f 2061 6e20 6572 726f 7220 6f63 6375 // an error occu │ │ │ │ -001a7a20: 7272 6564 3c2f 7370 616e 3e3c 2f64 6976 rred
    .
    }.
    soap_set_na │ │ │ │ -001a7ad0: 6d65 7370 6163 6573 3c2f 613e 283c 6120 mespaces(soap, qu │ │ │ │ -001a7b10: 6f74 655f 6e61 6d65 7370 6163 6573 293b ote_namespaces); │ │ │ │ -001a7b20: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    │ │ │ │ -001a7b40: 203c 7370 616e 2063 6c61 7373 3d22 6b65 if (quote_serv │ │ │ │ -001a7b70: 655f 7265 7175 6573 7428 3c61 2063 6c61 e_request(soap) == SOAP_NO_METHOD │ │ │ │ -001a7c10: 3c2f 613e 2920 3c2f 6469 763e 0a3c 6469 )
    . │ │ │ │ -001a7c30: 2020 2020 2020 207b 3c2f 6469 763e 0a3c {
    .< │ │ │ │ -001a7c40: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001a7c50: 3e20 2020 2020 2020 2020 203c 6120 636c > soap_set_names │ │ │ │ -001a7cc0: 7061 6365 733c 2f61 3e28 3c61 2063 6c61 paces(soap, rate_ │ │ │ │ -001a7d00: 6e61 6d65 7370 6163 6573 293b 3c2f 6469 namespaces);.
    < │ │ │ │ -001a7d30: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -001a7d40: 6f72 6466 6c6f 7722 3e69 663c 2f73 7061 ordflow">if (rate_serve_r │ │ │ │ -001a7d60: 6571 7565 7374 283c 6120 636c 6173 733d equest(so │ │ │ │ -001a7d90: 6170 3c2f 613e 2929 3c2f 6469 763e 0a3c ap))
    .< │ │ │ │ -001a7da0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001a7db0: 3e20 2020 2020 2020 2020 2020 203c 6120 > soa │ │ │ │ -001a7e10: 705f 7365 6e64 5f66 6175 6c74 3c2f 613e p_send_fault │ │ │ │ -001a7e20: 283c 6120 636c 6173 733d 2263 6f64 6522 (soap │ │ │ │ -001a7e50: 293b 203c 7370 616e 2063 6c61 7373 3d22 ); // send │ │ │ │ -001a7e70: 2066 6175 6c74 2074 6f20 636c 6965 6e74 fault to client │ │ │ │ -001a7e80: 203c 2f73 7061 6e3e 3c2f 6469 763e 0a3c
    .< │ │ │ │ -001a7e90: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001a7ea0: 3e20 2020 2020 2020 207d 203c 2f64 6976 > }
    .
    else if (so │ │ │ │ -001a7f40: 6170 3c2f 613e 2d26 6774 3b3c 6120 636c ap->error) < │ │ │ │ -001a7fa0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    │ │ │ │ -001a7fc0: 7b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 {
    .
    │ │ │ │ -001a7fe0: 2020 2020 3c61 2063 6c61 7373 3d22 636f soap_send_fa │ │ │ │ -001a8040: 756c 743c 2f61 3e28 3c61 2063 6c61 7373 ult(s │ │ │ │ -001a8070: 6f61 703c 2f61 3e29 3b20 3c73 7061 6e20 oap); │ │ │ │ -001a8090: 2f2f 2073 656e 6420 6661 756c 7420 746f // send fault to │ │ │ │ -001a80a0: 2063 6c69 656e 7420 3c2f 7370 616e 3e3c client < │ │ │ │ -001a80b0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    │ │ │ │ -001a80d0: 7d3c 2f64 6976 3e0a 3c64 6976 2063 6c61 }
    . │ │ │ │ -001a8190: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    │ │ │ │ -001a8200: 736f 6170 5f65 6e64 3c2f 613e 283c 6120 soap_end(soap); < │ │ │ │ -001a8240: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    } │ │ │ │ -001a8260: 3c73 7061 6e20 636c 6173 733d 226b 6579 while< │ │ │ │ -001a8280: 2f73 7061 6e3e 2028 3c61 2063 6c61 7373 /span> (s │ │ │ │ -001a82b0: 6f61 703c 2f61 3e2d 2667 743b 3c61 2063 oap->keep_alive< │ │ │ │ -001a8310: 2f61 3e29 3b3c 2f64 6976 3e0a 3c64 6976 /a>);
    .
    │ │ │ │ -001a8330: 2020 7d3c 2f64 6976 3e0a 3c64 6976 2063 }
    .
    │ │ │ │ -001a8350: 3c73 7061 6e20 636c 6173 733d 226b 6579 else │ │ │ │ -001a8390: 6966 3c2f 7370 616e 3e20 283c 6120 636c if (soap->< │ │ │ │ -001a83d0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -001a83e0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ -001a83f0: 6874 6d6c 2361 3130 6236 3664 3664 3438 html#a10b66d6d48 │ │ │ │ -001a8400: 3936 3930 6237 6430 6635 3931 6165 3236 9690b7d0f591ae26 │ │ │ │ -001a8410: 3333 6464 3133 223e 6572 726e 756d 3c2f 33dd13">errnum) // acc │ │ │ │ -001a8440: 6570 7420 6661 696c 6564 2c20 7472 7920 ept failed, try │ │ │ │ -001a8450: 6167 6169 6e20 6166 7465 7220 3120 7365 again after 1 se │ │ │ │ -001a8460: 636f 6e64 3c2f 7370 616e 3e3c 2f64 6976 cond
    .
    {
    . │ │ │ │ -001a8490: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    soap_ │ │ │ │ -001a8500: 7072 696e 745f 6661 756c 743c 2f61 3e28 print_fault( │ │ │ │ -001a8510: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap, │ │ │ │ -001a8540: 2073 7464 6572 7229 3b20 3c2f 6469 763e stderr);
    │ │ │ │ -001a8550: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    sleep(1 │ │ │ │ -001a8570: 293b 3c2f 6469 763e 0a3c 6469 7620 636c );
    .
    } │ │ │ │ -001a8590: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    else
    .
    │ │ │ │ -001a85f0: 7b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 {
    .
    │ │ │ │ -001a8610: 6670 7269 6e74 6628 7374 6465 7272 2c20 fprintf(stderr, │ │ │ │ -001a8620: 3c73 7061 6e20 636c 6173 733d 2273 7472 &quo │ │ │ │ -001a8640: 743b 7365 7276 6572 2074 696d 6564 206f t;server timed o │ │ │ │ -001a8650: 7574 5c6e 2671 756f 743b 3c2f 7370 616e ut\n");
    .
    │ │ │ │ -001a8680: 2020 203c 7370 616e 2063 6c61 7373 3d22 bre │ │ │ │ -001a86a0: 616b 3c2f 7370 616e 3e3b 203c 2f64 6976 ak;
    .
    }
    . │ │ │ │ -001a86d0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65

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

    .How to c │ │ │ │ -001a8af0: 7265 6174 6520 444c 4c73 3c2f 6832 3e0a reate DLLs

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

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

    .

    .Cr │ │ │ │ -001a8b60: 6561 7469 6e67 2074 6865 2062 6173 6520 eating the base │ │ │ │ -001a8b70: 7374 6473 6f61 7032 2e64 6c6c 3c2f 6833 stdsoap2.dll

    .

    The engine │ │ │ │ -001a8b90: 646f 6573 206e 6f74 2064 6566 696e 6520 does not define │ │ │ │ -001a8ba0: 534f 4150 2048 6561 6465 7220 616e 6420 SOAP Header and │ │ │ │ -001a8bb0: 4661 756c 7420 7365 7269 616c 697a 6572 Fault serializer │ │ │ │ -001a8bc0: 7320 7468 6174 2074 6865 2065 6e67 696e s that the engin │ │ │ │ -001a8bd0: 6520 6e65 6564 7320 7768 656e 2069 6e73 e needs when ins │ │ │ │ -001a8be0: 7461 6c6c 6564 2061 7320 6120 6c69 6272 talled as a libr │ │ │ │ -001a8bf0: 6172 792e 2057 6520 7468 6572 6566 6f72 ary. We therefor │ │ │ │ -001a8c00: 6520 6164 6420 534f 4150 2048 6561 6465 e add SOAP Heade │ │ │ │ -001a8c10: 7220 616e 6420 4661 756c 7420 7365 7269 r and Fault seri │ │ │ │ -001a8c20: 616c 697a 6572 732c 2077 6869 6368 2061 alizers, which a │ │ │ │ -001a8c30: 7265 2063 6f6d 7069 6c65 6420 7365 7061 re compiled sepa │ │ │ │ -001a8c40: 7261 7465 6c79 2061 7320 666f 6c6c 6f77 rately as follow │ │ │ │ -001a8c50: 732e 2046 6972 7374 2c20 6372 6561 7465 s. First, create │ │ │ │ -001a8c60: 2061 206e 6577 2068 6561 6465 7220 6669 a new header fi │ │ │ │ -001a8c70: 6c65 203c 656d 3e3c 636f 6465 3e65 6e76 le env │ │ │ │ -001a8c80: 2e68 3c2f 636f 6465 3e3c 2f65 6d3e 2077 .h w │ │ │ │ -001a8c90: 6974 6820 7468 6520 534f 4150 2048 6561 ith the SOAP Hea │ │ │ │ -001a8ca0: 6465 7220 3c63 6f64 653e 3c61 2063 6c61 der SOAP_ENV__H │ │ │ │ -001a8d10: 6561 6465 723c 2f61 3e3c 2f63 6f64 653e eader │ │ │ │ -001a8d20: 2061 6e64 2053 4f41 5020 4661 756c 7420 and SOAP Fault │ │ │ │ -001a8d30: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 S │ │ │ │ -001a8d90: 4f41 505f 454e 565f 5f46 6175 6c74 3c2f OAP_ENV__Fault struct │ │ │ │ -001a8db0: 7572 6573 2c20 696e 636c 7564 696e 6720 ures, including │ │ │ │ -001a8dc0: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 SOAP_ENV_ │ │ │ │ -001a8e30: 5f44 6574 6169 6c3c 2f61 3e3c 2f63 6f64 _Detail if this struc │ │ │ │ -001a8e50: 7475 7265 2063 6f6e 7461 696e 7320 6d65 ture contains me │ │ │ │ -001a8e60: 6d62 6572 7320 7468 6174 2061 7265 2073 mbers that are s │ │ │ │ -001a8e70: 6572 6961 6c69 7a65 6420 6173 2066 6175 erialized as fau │ │ │ │ -001a8e80: 6c74 2064 6574 6169 6c73 2e20 596f 7520 lt details. You │ │ │ │ -001a8e90: 6361 6e20 6c65 6176 6520 7468 6973 2068 can leave this h │ │ │ │ -001a8ea0: 6561 6465 7220 6669 6c65 2065 6d70 7479 eader file empty │ │ │ │ -001a8eb0: 2069 6620 796f 7520 7761 6e74 2074 6f20 if you want to │ │ │ │ -001a8ec0: 7573 6520 7468 6520 6465 6661 756c 7420 use the default │ │ │ │ -001a8ed0: 534f 4150 2048 6561 6465 7220 616e 6420 SOAP Header and │ │ │ │ -001a8ee0: 4661 756c 742e 2048 6f77 6576 6572 2c20 Fault. However, │ │ │ │ -001a8ef0: 6966 2053 4f41 5020 4865 6164 6572 7320 if SOAP Headers │ │ │ │ -001a8f00: 6172 6520 7265 7175 6972 6564 2074 6865 are required the │ │ │ │ -001a8f10: 6e20 796f 7520 6361 6e6e 6f74 206c 6561 n you cannot lea │ │ │ │ -001a8f20: 7665 2074 6865 203c 636f 6465 3e3c 6120 ve the SOAP_ENV │ │ │ │ -001a8f90: 5f5f 4865 6164 6572 3c2f 613e 3c2f 636f __Header structure em │ │ │ │ -001a8fb0: 7074 792e 2046 6f72 2065 7861 6d70 6c65 pty. For example │ │ │ │ -001a8fc0: 2c20 7468 6520 5753 2d41 6464 7265 7373 , the WS-Address │ │ │ │ -001a8fd0: 696e 6720 616e 6420 5753 2d53 6563 7572 ing and WS-Secur │ │ │ │ -001a8fe0: 6974 7920 706c 7567 696e 7320 7265 7175 ity plugins requ │ │ │ │ -001a8ff0: 6972 6520 534f 4150 2048 6561 6465 7273 ire SOAP Headers │ │ │ │ -001a9000: 2077 6869 6368 2063 616e 2062 6520 696d which can be im │ │ │ │ -001a9010: 706f 7274 6564 2062 7920 6164 6469 6e67 ported by adding │ │ │ │ -001a9020: 203c 636f 6465 3e23 696d 706f 7274 2022 #import " │ │ │ │ -001a9030: 7773 6135 2e68 223c 2f63 6f64 653e 2061 wsa5.h" a │ │ │ │ -001a9040: 6e64 203c 636f 6465 3e23 696d 706f 7274 nd #import │ │ │ │ -001a9050: 2022 7773 7365 2e68 223c 2f63 6f64 653e "wsse.h" │ │ │ │ -001a9060: 2c20 7265 7370 6563 7469 7665 6c79 2074 , respectively t │ │ │ │ -001a9070: 6f20 3c65 6d3e 3c63 6f64 653e 656e 762e o env. │ │ │ │ -001a9080: 683c 2f63 6f64 653e 3c2f 656d 3e2e 2054 h. T │ │ │ │ -001a9090: 6865 6e20 636f 6d70 696c 6520 7468 6973 hen compile this │ │ │ │ -001a90a0: 2068 6561 6465 7220 6669 6c65 2077 6974 header file wit │ │ │ │ -001a90b0: 683a 203c 2f70 3e3c 7072 6520 636c 6173 h:

     so
    │ │ │ │ -001a90d0: 6170 6370 7032 202d 7065 6e76 2065 6e76  apcpp2 -penv env
    │ │ │ │ -001a90e0: 2e68 0a3c 2f70 7265 3e3c 703e 2054 6865  .h.

    The │ │ │ │ -001a90f0: 2067 656e 6572 6174 6564 203c 656d 3e3c generated < │ │ │ │ -001a9100: 636f 6465 3e65 6e76 432e 6370 703c 2f63 code>envC.cpp file h │ │ │ │ -001a9120: 6f6c 6473 2074 6865 2053 4f41 5020 4865 olds the SOAP He │ │ │ │ -001a9130: 6164 6572 2061 6e64 2046 6175 6c74 2073 ader and Fault s │ │ │ │ -001a9140: 6572 6961 6c69 7a65 7273 2e20 5765 2063 erializers. We c │ │ │ │ -001a9150: 616e 2065 6974 6865 7220 6372 6561 7465 an either create │ │ │ │ -001a9160: 2061 2073 6570 6172 6174 6520 3c65 6d3e a separate │ │ │ │ -001a9170: 3c63 6f64 653e 656e 7643 2e64 6c6c 3c2f envC.dll DLL f │ │ │ │ -001a9190: 6f72 2074 6869 7320 7468 6174 2061 6c6c or this that all │ │ │ │ -001a91a0: 2063 6c69 656e 7473 2061 6e64 2073 6572 clients and ser │ │ │ │ -001a91b0: 7669 6365 2061 7070 6c69 6361 7469 6f6e vice application │ │ │ │ -001a91c0: 7320 7769 6c6c 2075 7365 2c20 6f72 2063 s will use, or c │ │ │ │ -001a91d0: 6f6d 6269 6e65 203c 656d 3e3c 636f 6465 ombine envC.cpp │ │ │ │ -001a91f0: 3c2f 656d 3e20 7769 7468 2074 6865 203c with the < │ │ │ │ -001a9200: 656d 3e3c 636f 6465 3e73 7464 736f 6170 em>stdsoap │ │ │ │ -001a9210: 322e 646c 6c3c 2f63 6f64 653e 3c2f 656d 2.dll we create, whi │ │ │ │ -001a9230: 6368 2077 6520 7769 6c6c 2065 7870 6c61 ch we will expla │ │ │ │ -001a9240: 696e 2066 7572 7468 6572 2e3c 2f70 3e0a in further.

    . │ │ │ │ -001a9250: 3c70 3e54 6865 206e 6578 7420 7374 6570

    The next step │ │ │ │ -001a9260: 2069 7320 746f 2063 7265 6174 6520 3c65 is to create stdsoap2 │ │ │ │ -001a9280: 2e64 6c6c 3c2f 636f 6465 3e3c 2f65 6d3e .dll │ │ │ │ -001a9290: 2077 6869 6368 2063 6f6e 7369 7374 7320 which consists │ │ │ │ -001a92a0: 6f66 2074 6865 2066 696c 6520 3c65 6d3e of the file │ │ │ │ -001a92b0: 3c63 6f64 653e 6773 6f61 702f 7374 6473 gsoap/stds │ │ │ │ -001a92c0: 6f61 7032 2e63 7070 3c2f 636f 6465 3e3c oap2.cpp< │ │ │ │ -001a92d0: 2f65 6d3e 2061 6e64 203c 656d 3e3c 636f /em> and envC.cpp and opti │ │ │ │ -001a9300: 6f6e 616c 6c79 2074 6865 2070 6c75 6769 onally the plugi │ │ │ │ -001a9310: 6e73 2079 6f75 2077 616e 7420 746f 2075 ns you want to u │ │ │ │ -001a9320: 7365 2073 7563 6820 6173 203c 656d 3e3c se such as < │ │ │ │ -001a9330: 636f 6465 3e77 7373 6561 7069 2e63 7070 code>wsseapi.cpp │ │ │ │ -001a9340: 3c2f 636f 6465 3e3c 2f65 6d3e 2028 7765 (we │ │ │ │ -001a9350: 206e 6565 6420 746f 2072 656e 616d 6520 need to rename │ │ │ │ -001a9360: 616c 6c20 3c65 6d3e 3c63 6f64 653e 2e63 all .c │ │ │ │ -001a9370: 3c2f 636f 6465 3e3c 2f65 6d3e 2066 696c fil │ │ │ │ -001a9380: 6573 2074 6f20 3c65 6d3e 3c63 6f64 653e es to │ │ │ │ -001a9390: 2e63 7070 3c2f 636f 6465 3e3c 2f65 6d3e .cpp │ │ │ │ -001a93a0: 2066 696c 6573 2074 6f20 6176 6f69 6420 files to avoid │ │ │ │ -001a93b0: 6973 7375 6573 2077 6974 6820 4d53 5643 issues with MSVC │ │ │ │ -001a93c0: 2b2b 292e 2054 6869 7320 444c 4c20 636f ++). This DLL co │ │ │ │ -001a93d0: 6e74 6169 6e73 2061 6c6c 2063 6f6d 6d6f ntains all commo │ │ │ │ -001a93e0: 6e20 6675 6e63 7469 6f6e 7320 6e65 6564 n functions need │ │ │ │ -001a93f0: 6564 2066 6f72 2061 6c6c 206f 7468 6572 ed for all other │ │ │ │ -001a9400: 2063 6c69 656e 7473 2061 6e64 2073 6572 clients and ser │ │ │ │ -001a9410: 7665 7273 2062 6173 6564 206f 6e20 6753 vers based on gS │ │ │ │ -001a9420: 4f41 502e 2043 6f6d 7069 6c65 203c 656d OAP. Compile envC.cpp< │ │ │ │ -001a9440: 2f63 6f64 653e 3c2f 656d 3e20 616e 6420 /code> and │ │ │ │ -001a9450: 3c65 6d3e 3c63 6f64 653e 6773 6f61 702f gsoap/ │ │ │ │ -001a9460: 7374 6473 6f61 7032 2e63 7070 3c2f 636f stdsoap2.cpp into stdsoap2 │ │ │ │ -001a9490: 2e64 6c6c 3c2f 636f 6465 3e3c 2f65 6d3e .dll │ │ │ │ -001a94a0: 2075 7369 6e67 2074 6865 2063 6f6d 7069 using the compi │ │ │ │ -001a94b0: 6c65 7220 6f70 7469 6f6e 203c 636f 6465 ler option /D #WITH_NONAMESPA │ │ │ │ -001a94e0: 4345 533c 2f63 6f64 653e 2061 6e64 2074 CES and t │ │ │ │ -001a94f0: 6865 204d 5356 4320 5072 652d 5072 6f63 he MSVC Pre-Proc │ │ │ │ -001a9500: 6573 736f 7220 6465 6669 6e69 7469 6f6e essor definition │ │ │ │ -001a9510: 7320 3c63 6f64 653e 534f 4150 5f46 4d41 s SOAP_FMA │ │ │ │ -001a9520: 4331 3d5f 5f64 6563 6c73 7065 6328 646c C1=__declspec(dl │ │ │ │ -001a9530: 6c65 7870 6f72 7429 3c2f 636f 6465 3e2c lexport), │ │ │ │ -001a9540: 203c 636f 6465 3e53 4f41 505f 464d 4143 SOAP_FMAC │ │ │ │ -001a9550: 333d 5f5f 6465 636c 7370 6563 2864 6c6c 3=__declspec(dll │ │ │ │ -001a9560: 6578 706f 7274 293c 2f63 6f64 653e 2c20 export), │ │ │ │ -001a9570: 616e 6420 7468 6520 3c63 6f64 653e 2353 and the #S │ │ │ │ -001a9580: 4f41 505f 5354 445f 4558 504f 5254 533c OAP_STD_EXPORTS< │ │ │ │ -001a9590: 2f63 6f64 653e 206d 6163 726f 2073 6574 /code> macro set │ │ │ │ -001a95a0: 2061 7320 7368 6f77 6e20 6265 6c6f 7720 as shown below │ │ │ │ -001a95b0: 6672 6f6d 2074 6865 204d 5356 4320 636f from the MSVC co │ │ │ │ -001a95c0: 6d6d 616e 6420 7072 6f6d 7074 3a20 3c2f mmand prompt:

    C:> c
    │ │ │ │ -001a95f0: 6c20 2f63 202f 492e 202f 4548 7363 202f  l /c /I. /EHsc /
    │ │ │ │ -001a9600: 4457 4954 485f 4e4f 4e41 4d45 5350 4143  DWITH_NONAMESPAC
    │ │ │ │ -001a9610: 4553 202f 4453 4f41 505f 464d 4143 313d  ES /DSOAP_FMAC1=
    │ │ │ │ -001a9620: 5f5f 6465 636c 7370 6563 2864 6c6c 6578  __declspec(dllex
    │ │ │ │ -001a9630: 706f 7274 2920 2f44 534f 4150 5f46 4d41  port) /DSOAP_FMA
    │ │ │ │ -001a9640: 4333 3d5f 5f64 6563 6c73 7065 6328 646c  C3=__declspec(dl
    │ │ │ │ -001a9650: 6c65 7870 6f72 7429 202f 4453 4f41 505f  lexport) /DSOAP_
    │ │ │ │ -001a9660: 5354 445f 4558 504f 5254 5320 656e 7643  STD_EXPORTS envC
    │ │ │ │ -001a9670: 2e63 7070 2073 7464 736f 6170 322e 6370  .cpp stdsoap2.cp
    │ │ │ │ -001a9680: 700a 433a 2667 743b 206c 696e 6b20 2f4c  p.C:> link /L
    │ │ │ │ -001a9690: 4942 5041 5448 2077 7332 5f33 322e 6c69  IBPATH ws2_32.li
    │ │ │ │ -001a96a0: 6220 2f4f 5554 3a6d 7967 736f 6170 2e64  b /OUT:mygsoap.d
    │ │ │ │ -001a96b0: 6c6c 202f 444c 4c20 656e 7643 2e6f 626a  ll /DLL envC.obj
    │ │ │ │ -001a96c0: 2073 7464 736f 6170 322e 6f62 6a0a 3c2f   stdsoap2.obj.

    Note: as │ │ │ │ -001a96e0: 206f 6620 6753 4f41 5020 322e 382e 3330 of gSOAP 2.8.30 │ │ │ │ -001a96f0: 2061 6e64 206c 6174 6572 2c20 7468 6520 and later, the │ │ │ │ -001a9700: 444c 4c20 6578 706f 7274 206d 6163 726f DLL export macro │ │ │ │ -001a9710: 7320 7368 6f77 6e20 6865 7265 2061 7265 s shown here are │ │ │ │ -001a9720: 2061 6c6c 2073 6574 2077 6974 6820 6f6e all set with on │ │ │ │ -001a9730: 6520 7072 652d 7072 6f63 6573 736f 7220 e pre-processor │ │ │ │ -001a9740: 6465 6669 6e69 7469 6f6e 203c 636f 6465 definition #SOAP_STD_EXPOR │ │ │ │ -001a9760: 5453 3c2f 636f 6465 3e2e 3c2f 703e 0a3c TS.

    .< │ │ │ │ -001a9770: 703e 416c 7465 726e 6174 6976 656c 792c p>Alternatively, │ │ │ │ -001a9780: 2079 6f75 2063 616e 2063 6f6d 7069 6c65 you can compile │ │ │ │ -001a9790: 2077 6974 6820 3c63 6f64 653e 2f44 3c2f with /D #WIT │ │ │ │ -001a97b0: 485f 534f 4150 4445 4653 5f48 3c2f 636f H_SOAPDEFS_H and put the │ │ │ │ -001a97d0: 6d61 6372 6f20 6465 6669 6e69 7469 6f6e macro definition │ │ │ │ -001a97e0: 7320 696e 203c 656d 3e3c 636f 6465 3e73 s in s │ │ │ │ -001a97f0: 6f61 7064 6566 732e 683c 2f63 6f64 653e oapdefs.h │ │ │ │ -001a9800: 3c2f 656d 3e2e 2054 6869 7320 6578 706f . This expo │ │ │ │ -001a9810: 7274 7320 616c 6c20 6675 6e63 7469 6f6e rts all function │ │ │ │ -001a9820: 7320 7768 6963 6820 6172 6520 7072 6563 s which are prec │ │ │ │ -001a9830: 6564 6564 2062 7920 7468 6520 6d61 6372 eded by the macr │ │ │ │ -001a9840: 6f20 3c63 6f64 653e 2353 4f41 505f 464d o #SOAP_FM │ │ │ │ -001a9850: 4143 313c 2f63 6f64 653e 2069 6e20 7468 AC1 in th │ │ │ │ -001a9860: 6520 3c65 6d3e 3c63 6f64 653e 736f 6170 e soap │ │ │ │ -001a9870: 6370 7032 2e63 7070 3c2f 636f 6465 3e3c cpp2.cpp< │ │ │ │ -001a9880: 2f65 6d3e 2073 6f75 7263 6520 6669 6c65 /em> source file │ │ │ │ -001a9890: 2061 6e64 206d 6163 726f 203c 636f 6465 and macro #SOAP_FMAC3 in the < │ │ │ │ -001a98c0: 636f 6465 3e65 6e76 432e 6370 703c 2f63 code>envC.cpp source │ │ │ │ -001a98e0: 2066 696c 652e 3c2f 703e 0a3c 703e 4669 file.

    .

    Fi │ │ │ │ -001a98f0: 6e61 6c6c 792c 206e 6f74 6520 7468 6174 nally, note that │ │ │ │ -001a9900: 2074 6865 2067 534f 4150 2073 6f75 7263 the gSOAP sourc │ │ │ │ -001a9910: 6520 636f 6465 2070 6163 6b61 6765 2063 e code package c │ │ │ │ -001a9920: 6f6e 7461 696e 7320 6120 6c6f 7420 6f66 ontains a lot of │ │ │ │ -001a9930: 203c 656d 3e3c 636f 6465 3e2e 633c 2f63 .c source │ │ │ │ -001a9950: 2063 6f64 6520 6669 6c65 732e 204d 6978 code files. Mix │ │ │ │ -001a9960: 696e 6720 4320 7769 7468 2043 2b2b 2066 ing C with C++ f │ │ │ │ -001a9970: 696c 6573 2069 7320 6e6f 7420 7265 636f iles is not reco │ │ │ │ -001a9980: 6d6d 656e 6465 6420 7769 7468 2056 6973 mmended with Vis │ │ │ │ -001a9990: 7561 6c20 5374 7564 696f 2061 6e64 2077 ual Studio and w │ │ │ │ -001a99a0: 696c 6c20 6c65 6164 2074 6f20 7275 6e2d ill lead to run- │ │ │ │ -001a99b0: 7469 6d65 2065 7272 6f72 7320 7768 656e time errors when │ │ │ │ -001a99c0: 2062 7569 6c64 696e 6720 444c 4c73 2e20 building DLLs. │ │ │ │ -001a99d0: 5468 6572 6566 6f72 652c 2061 6c77 6179 Therefore, alway │ │ │ │ -001a99e0: 7320 7265 6e61 6d65 203c 656d 3e3c 636f s rename .c source code fi │ │ │ │ -001a9a10: 6c65 7320 746f 203c 656d 3e3c 636f 6465 les to .cpp source code fi │ │ │ │ -001a9a40: 6c65 7320 7768 656e 2063 7265 6174 696e les when creatin │ │ │ │ -001a9a50: 6720 444c 4c73 2e3c 2f70 3e0a 3c70 3ef0 g DLLs.

    .

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

    .

    .Creating clien │ │ │ │ -001a9ad0: 7420 616e 6420 7365 7276 6572 2044 4c4c t and server DLL │ │ │ │ -001a9ae0: 733c 2f68 333e 0a3c 703e 436f 6d70 696c s

    .

    Compil │ │ │ │ -001a9af0: 6520 7468 6520 3c65 6d3e 3c63 6f64 653e e the │ │ │ │ -001a9b00: 736f 6170 436c 6965 6e74 4c69 622e 6370 soapClientLib.cp │ │ │ │ -001a9b10: 703c 2f63 6f64 653e 3c2f 656d 3e20 616e p an │ │ │ │ -001a9b20: 6420 3c65 6d3e 3c63 6f64 653e 736f 6170 d soap │ │ │ │ -001a9b30: 5365 7276 6572 4c69 622e 6370 703c 2f63 ServerLib.cpp source │ │ │ │ -001a9b50: 7320 6173 2044 4c4c 7320 6279 2075 7369 s as DLLs by usi │ │ │ │ -001a9b60: 6e67 2074 6865 204d 5356 4320 5072 652d ng the MSVC Pre- │ │ │ │ -001a9b70: 5072 6f63 6573 736f 7220 6465 6669 6e69 Processor defini │ │ │ │ -001a9b80: 7469 6f6e 7320 3c63 6f64 653e 534f 4150 tions SOAP │ │ │ │ -001a9b90: 5f46 4d41 4335 3d5f 5f64 6563 6c73 7065 _FMAC5=__declspe │ │ │ │ -001a9ba0: 6328 646c 6c65 7870 6f72 7429 3c2f 636f c(dllexport) and SO │ │ │ │ -001a9bc0: 4150 5f43 4d41 433d 5f5f 6465 636c 7370 AP_CMAC=__declsp │ │ │ │ -001a9bd0: 6563 2864 6c6c 6578 706f 7274 293c 2f63 ec(dllexport), and by usi │ │ │ │ -001a9bf0: 6e67 2074 6865 2043 2b2b 2063 6f6d 7069 ng the C++ compi │ │ │ │ -001a9c00: 6c65 7220 6f70 7469 6f6e 203c 636f 6465 ler option /D #WITH_NONAMESPA │ │ │ │ -001a9c30: 4345 533c 2f63 6f64 653e 2e20 416c 6c20 CES. All │ │ │ │ -001a9c40: 6f66 2074 6865 7365 206d 6163 726f 7320 of these macros │ │ │ │ -001a9c50: 6172 6520 7365 7420 6173 2061 2073 686f are set as a sho │ │ │ │ -001a9c60: 7274 6861 6e64 2077 6974 6820 6f6e 6520 rthand with one │ │ │ │ -001a9c70: 7072 652d 7072 6f63 6573 736f 7220 6465 pre-processor de │ │ │ │ -001a9c80: 6669 6e69 7469 6f6e 203c 636f 6465 3e23 finition # │ │ │ │ -001a9c90: 534f 4150 5f53 5444 5f45 5850 4f52 5453 SOAP_STD_EXPORTS │ │ │ │ -001a9ca0: 3c2f 636f 6465 3e20 2872 6571 7569 7265 (require │ │ │ │ -001a9cb0: 7320 6753 4f41 5020 322e 382e 3330 206f s gSOAP 2.8.30 o │ │ │ │ -001a9cc0: 7220 6c61 7465 7229 2e3c 2f70 3e0a 3c70 r later).

    .

    This DLL links │ │ │ │ -001a9ce0: 746f 203c 656d 3e3c 636f 6465 3e73 7464 to std │ │ │ │ -001a9cf0: 736f 6170 322e 646c 6c3c 2f63 6f64 653e soap2.dll │ │ │ │ -001a9d00: 3c2f 656d 3e20 7765 2063 7265 6174 6564 we created │ │ │ │ -001a9d10: 2069 6e20 5365 6374 696f 6e20 3c61 2063 in Section Creating the │ │ │ │ -001a9d50: 2062 6173 6520 7374 6473 6f61 7032 2e64 base stdsoap2.d │ │ │ │ -001a9d60: 6c6c 3c2f 613e 2e3c 2f70 3e0a 3c70 3e54 ll.

    .

    T │ │ │ │ -001a9d70: 6f20 6372 6561 7465 206d 756c 7469 706c o create multipl │ │ │ │ -001a9d80: 6520 444c 4c73 2069 6e20 7468 6520 7361 e DLLs in the sa │ │ │ │ -001a9d90: 6d65 2070 726f 6a65 6374 2064 6972 6563 me project direc │ │ │ │ -001a9da0: 746f 7279 2c20 796f 7520 7368 6f75 6c64 tory, you should │ │ │ │ -001a9db0: 2075 7365 203c 623e 3c63 6f64 653e 736f use so │ │ │ │ -001a9dc0: 6170 6370 7032 202d 7020 6e61 6d65 3c2f apcpp2 -p name option │ │ │ │ -001a9de0: 203c 623e 3c63 6f64 653e 2d70 206e 616d -p nam │ │ │ │ -001a9df0: 653c 2f63 6f64 653e 3c2f 623e 2074 6f20 e to │ │ │ │ -001a9e00: 7265 6e61 6d65 2074 6865 2067 656e 6572 rename the gener │ │ │ │ -001a9e10: 6174 6564 203c 656d 3e3c 636f 6465 3e73 ated s │ │ │ │ -001a9e20: 6f61 7043 6c69 656e 744c 6962 2e63 7070 oapClientLib.cpp │ │ │ │ -001a9e30: 3c2f 636f 6465 3e3c 2f65 6d3e 2061 6e64 and │ │ │ │ -001a9e40: 203c 656d 3e3c 636f 6465 3e73 6f61 7053 soapS │ │ │ │ -001a9e50: 6572 7665 724c 6962 2e63 7070 3c2f 636f erverLib.cpp (and as │ │ │ │ -001a9e70: 736f 6369 6174 6564 2920 6669 6c65 732e sociated) files. │ │ │ │ -001a9e80: 2054 6865 203c 623e 3c63 6f64 653e 2d70 The -p │ │ │ │ -001a9e90: 206e 616d 653c 2f63 6f64 653e 3c2f 623e name │ │ │ │ -001a9ea0: 206f 7074 696f 6e20 7370 6563 6966 6965 option specifie │ │ │ │ -001a9eb0: 7320 6120 3c65 6d3e 3c63 6f64 653e 6e61 s a na │ │ │ │ -001a9ec0: 6d65 3c2f 636f 6465 3e3c 2f65 6d3e 2070 me p │ │ │ │ -001a9ed0: 7265 6669 7820 746f 2072 6570 6c61 6365 refix to replace │ │ │ │ -001a9ee0: 2074 6865 203c 656d 3e3c 636f 6465 3e73 the s │ │ │ │ -001a9ef0: 6f61 703c 2f63 6f64 653e 3c2f 656d 3e20 oap │ │ │ │ -001a9f00: 6669 6c65 206e 616d 6520 7072 6566 6978 file name prefix │ │ │ │ -001a9f10: 2e20 416e 6f74 6865 7220 7761 7920 6973 . Another way is │ │ │ │ -001a9f20: 2074 6f20 7573 6520 432b 2b20 6e61 6d65 to use C++ name │ │ │ │ -001a9f30: 7370 6163 6573 2077 6974 6820 3c62 3e3c spaces with < │ │ │ │ -001a9f40: 636f 6465 3e73 6f61 7063 7070 3220 2d71 code>soapcpp2 -q │ │ │ │ -001a9f50: 206e 616d 653c 2f63 6f64 653e 3c2f 623e name │ │ │ │ -001a9f60: 206f 7074 696f 6e20 3c62 3e3c 636f 6465 option -q name< │ │ │ │ -001a9f80: 2f62 3e2c 2069 6620 7468 6520 696e 7465 /b>, if the inte │ │ │ │ -001a9f90: 7266 6163 6520 6865 6164 6572 2066 696c rface header fil │ │ │ │ -001a9fa0: 6520 696e 7075 7420 746f 2073 6f61 7063 e input to soapc │ │ │ │ -001a9fb0: 7070 3220 646f 6573 206e 6f74 2061 6c72 pp2 does not alr │ │ │ │ -001a9fc0: 6561 6479 2064 6563 6c61 7265 2061 2043 eady declare a C │ │ │ │ -001a9fd0: 2b2b 206e 616d 6573 7061 6365 2e20 4120 ++ namespace. A │ │ │ │ -001a9fe0: 636c 6561 6e20 7365 7061 7261 7469 6f6e clean separation │ │ │ │ -001a9ff0: 206f 6620 6c69 6272 6172 6965 7320 6361 of libraries ca │ │ │ │ -001aa000: 6e20 616c 736f 2062 6520 6163 6869 6576 n also be achiev │ │ │ │ -001aa010: 6564 2077 6974 6820 432b 2b20 6e61 6d65 ed with C++ name │ │ │ │ -001aa020: 7370 6163 6573 2c20 7365 6520 5365 6374 spaces, see Sect │ │ │ │ -001aa030: 696f 6e20 3c61 2063 6c61 7373 3d22 656c ion How to build a │ │ │ │ -001aa070: 2063 6c69 656e 7420 6f72 2073 6572 7665 client or serve │ │ │ │ -001aa080: 7220 696e 2061 2043 2b2b 2063 6f64 6520 r in a C++ code │ │ │ │ -001aa090: 6e61 6d65 7370 6163 653c 2f61 3e20 2e3c namespace .< │ │ │ │ -001aa0a0: 2f70 3e0a 3c70 3e55 6e6c 6573 7320 796f /p>.

    Unless yo │ │ │ │ -001aa0b0: 7520 7573 6520 7468 6520 636c 6965 6e74 u use the client │ │ │ │ -001aa0c0: 2070 726f 7879 2061 6e64 2073 6572 7665 proxy and serve │ │ │ │ -001aa0d0: 7220 6f62 6a65 6374 2063 6c61 7373 6573 r object classes │ │ │ │ -001aa0e0: 2028 3c65 6d3e 3c63 6f64 653e 736f 6170 (soap │ │ │ │ -001aa0f0: 5859 5a50 726f 7879 2e68 3c2f 636f 6465 XYZProxy.h and < │ │ │ │ -001aa110: 636f 6465 3e73 6f61 7058 595a 5365 7276 code>soapXYZServ │ │ │ │ -001aa120: 6963 652e 683c 2f63 6f64 653e 3c2f 656d ice.h), all client a │ │ │ │ -001aa140: 6e64 2073 6572 7665 7220 6170 706c 6963 nd server applic │ │ │ │ -001aa150: 6174 696f 6e73 206d 7573 7420 6578 706c ations must expl │ │ │ │ -001aa160: 6963 6974 6c79 2073 6574 2074 6865 206e icitly set the n │ │ │ │ -001aa170: 616d 6573 7061 6365 7320 7661 6c75 6520 amespaces value │ │ │ │ -001aa180: 6f66 2074 6865 203c 636f 6465 3e3c 6120 of the soap context │ │ │ │ -001aa1f0: 2077 6974 683a 3c2f 703e 0a3c 6469 7620 with:

    .

    where │ │ │ │ -001aa350: 2074 6865 203c 636f 6465 3e6e 616d 6573 the names │ │ │ │ -001aa360: 7061 6365 735b 5d3c 2f63 6f64 653e 2074 paces[] t │ │ │ │ -001aa370: 6162 6c65 2073 686f 756c 6420 6265 2064 able should be d │ │ │ │ -001aa380: 6566 696e 6564 2069 6e20 7468 6520 636c efined in the cl │ │ │ │ -001aa390: 6965 6e74 2f73 6572 7665 7220 736f 7572 ient/server sour │ │ │ │ -001aa3a0: 6365 2e20 5468 6573 6520 7461 626c 6573 ce. These tables │ │ │ │ -001aa3b0: 2061 7265 2067 656e 6572 6174 6564 2069 are generated i │ │ │ │ -001aa3c0: 6e20 7468 6520 3c65 6d3e 3c63 6f64 653e n the │ │ │ │ -001aa3d0: 2e6e 736d 6170 3c2f 636f 6465 3e3c 2f65 .nsmap files. The ta │ │ │ │ -001aa3f0: 626c 6573 2061 7265 2072 656e 616d 6564 bles are renamed │ │ │ │ -001aa400: 2066 6f72 2063 6f6e 7665 6e69 656e 6365 for convenience │ │ │ │ -001aa410: 2075 7369 6e67 203c 623e 3c63 6f64 653e using │ │ │ │ -001aa420: 736f 6170 6370 7032 202d 6e3c 2f63 6f64 soapcpp2 -n option -n │ │ │ │ -001aa450: 3c2f 623e 2c20 7365 6520 5365 6374 696f , see Sectio │ │ │ │ -001aa460: 6e20 3c61 2063 6c61 7373 3d22 656c 2220 n soapcpp2 optio │ │ │ │ -001aa4a0: 6e73 3c2f 613e 202e 3c2f 703e 0a3c 703e ns .

    .

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

    .How to │ │ │ │ -001aa510: 2062 7569 6c64 206d 6f64 756c 6573 2061 build modules a │ │ │ │ -001aa520: 6e64 206c 6962 7261 7269 6573 2077 6974 nd libraries wit │ │ │ │ -001aa530: 6820 7468 6520 236d 6f64 756c 6520 6469 h the #module di │ │ │ │ -001aa540: 7265 6374 6976 653c 2f68 323e 0a3c 703e rective

    .

    │ │ │ │ -001aa550: 5468 6520 3c63 6f64 653e 236d 6f64 756c The #modul │ │ │ │ -001aa560: 653c 2f63 6f64 653e 2064 6972 6563 7469 e directi │ │ │ │ -001aa570: 7665 2069 7320 7573 6564 2074 6f20 6275 ve is used to bu │ │ │ │ -001aa580: 696c 6420 6d6f 6475 6c65 7320 7769 7468 ild modules with │ │ │ │ -001aa590: 2073 6f61 7063 7070 322e 2041 206c 6962 soapcpp2. A lib │ │ │ │ -001aa5a0: 7261 7279 2063 616e 2062 6520 6275 696c rary can be buil │ │ │ │ -001aa5b0: 7420 6672 6f6d 2061 206d 6f64 756c 6520 t from a module │ │ │ │ -001aa5c0: 616e 6420 6c69 6e6b 6564 2077 6974 6820 and linked with │ │ │ │ -001aa5d0: 6d75 6c74 6970 6c65 2057 6562 2073 6572 multiple Web ser │ │ │ │ -001aa5e0: 7669 6365 7320 6170 706c 6963 6174 696f vices applicatio │ │ │ │ -001aa5f0: 6e73 2e20 5468 6520 6469 7265 6374 6976 ns. The directiv │ │ │ │ -001aa600: 6520 7368 6f75 6c64 2061 7070 6561 7220 e should appear │ │ │ │ -001aa610: 6174 2074 6865 2074 6f70 206f 6620 7468 at the top of th │ │ │ │ -001aa620: 6520 696e 7465 7266 6163 6520 6865 6164 e interface head │ │ │ │ -001aa630: 6572 2066 696c 6520 666f 7220 736f 6170 er file for soap │ │ │ │ -001aa640: 6370 7032 2061 6e64 2068 6173 2074 6865 cpp2 and has the │ │ │ │ -001aa650: 2066 6f6c 6c6f 7769 6e67 2066 6f72 6d61 following forma │ │ │ │ -001aa660: 7473 3a3c 2f70 3e0a 3c64 6976 2063 6c61 ts:

    .
    │ │ │ │ -001aa690: 3c73 7061 6e20 636c 6173 733d 2270 7265 #modu │ │ │ │ -001aa6b0: 6c65 2026 7175 6f74 3b6e 616d 6526 7175 le "name&qu │ │ │ │ -001aa6c0: 6f74 3b3c 2f73 7061 6e3e 203c 2f64 6976 ot;
    .

    and< │ │ │ │ -001aa6f0: 2f70 3e0a 3c64 6976 2063 6c61 7373 3d22 /p>.

    #module & │ │ │ │ -001aa740: 7175 6f74 3b6e 616d 6526 7175 6f74 3b3c quot;name"< │ │ │ │ -001aa750: 2f73 7061 6e3e 2026 7175 6f74 3b66 756c /span> "ful │ │ │ │ -001aa760: 6c6e 616d 6526 7175 6f74 3b3c 2f64 6976 lname"
    .

    wher │ │ │ │ -001aa790: 6520 7468 6520 3c63 6f64 653e 6e61 6d65 e the name │ │ │ │ -001aa7a0: 3c2f 636f 6465 3e20 6d75 7374 2062 6520 must be │ │ │ │ -001aa7b0: 6120 756e 6971 7565 2073 686f 7274 206e a unique short n │ │ │ │ -001aa7c0: 616d 6520 666f 7220 7468 6520 6d6f 6475 ame for the modu │ │ │ │ -001aa7d0: 6c65 2e20 5468 6520 6e61 6d65 2069 7320 le. The name is │ │ │ │ -001aa7e0: 6361 7365 2069 6e73 656e 7369 7469 7665 case insensitive │ │ │ │ -001aa7f0: 2061 6e64 206d 7573 7420 6e6f 7420 6578 and must not ex │ │ │ │ -001aa800: 6365 6564 2034 2063 6861 7261 6374 6572 ceed 4 character │ │ │ │ -001aa810: 7320 696e 206c 656e 6774 682e 2054 6865 s in length. The │ │ │ │ -001aa820: 203c 636f 6465 3e66 756c 6c6e 616d 653c fullname< │ │ │ │ -001aa830: 2f63 6f64 653e 2c20 7768 656e 2070 7265 /code>, when pre │ │ │ │ -001aa840: 7365 6e74 2c20 7265 7072 6573 656e 7473 sent, represents │ │ │ │ -001aa850: 2074 6865 2066 756c 6c20 6e61 6d65 206f the full name o │ │ │ │ -001aa860: 6620 7468 6520 6d6f 6475 6c65 2061 6e64 f the module and │ │ │ │ -001aa870: 2069 7320 7573 6564 2074 6f20 7072 6566 is used to pref │ │ │ │ -001aa880: 6978 2074 6865 2066 756e 6374 696f 6e20 ix the function │ │ │ │ -001aa890: 6e61 6d65 7320 6f66 2074 6865 2067 656e names of the gen │ │ │ │ -001aa8a0: 6572 6174 6564 2073 6572 6961 6c69 7a65 erated serialize │ │ │ │ -001aa8b0: 7273 2072 6570 6c61 6369 6e67 2074 6865 rs replacing the │ │ │ │ -001aa8c0: 2075 7375 616c 203c 636f 6465 3e73 6f61 usual soa │ │ │ │ -001aa8d0: 703c 2f63 6f64 653e 2070 7265 6669 782e p prefix. │ │ │ │ -001aa8e0: 2049 6620 6162 7365 6e74 2c20 7468 6520 If absent, the │ │ │ │ -001aa8f0: 7368 6f72 7420 6e61 6d65 2069 7320 7573 short name is us │ │ │ │ -001aa900: 6564 2074 6f20 7072 6566 6978 2074 6865 ed to prefix the │ │ │ │ -001aa910: 2066 756e 6374 696f 6e20 6e61 6d65 7320 function names │ │ │ │ -001aa920: 6f66 2074 6865 2073 6572 6961 6c69 7a65 of the serialize │ │ │ │ -001aa930: 7273 2e3c 2f70 3e0a 3c70 3e54 6865 2072 rs.

    .

    The r │ │ │ │ -001aa940: 6573 7420 6f66 2074 6865 2063 6f6e 7465 est of the conte │ │ │ │ -001aa950: 6e74 206f 6620 7468 6520 696e 7465 7266 nt of the interf │ │ │ │ -001aa960: 6163 6520 6865 6164 6572 2066 696c 6520 ace header file │ │ │ │ -001aa970: 696e 636c 7564 6573 2074 7970 6520 6465 includes type de │ │ │ │ -001aa980: 636c 6172 6174 696f 6e73 2061 6e64 206f clarations and o │ │ │ │ -001aa990: 7074 696f 6e61 6c6c 7920 7468 6520 6465 ptionally the de │ │ │ │ -001aa9a0: 636c 6172 6174 696f 6e73 206f 6620 7365 clarations of se │ │ │ │ -001aa9b0: 7276 6963 6520 6f70 6572 6174 696f 6e73 rvice operations │ │ │ │ -001aa9c0: 2061 6e64 2053 4f41 5020 4865 6164 6572 and SOAP Header │ │ │ │ -001aa9d0: 7320 616e 6420 4661 756c 7473 2074 6861 s and Faults tha │ │ │ │ -001aa9e0: 7420 6172 6520 756e 6976 6572 7361 6c6c t are universall │ │ │ │ -001aa9f0: 7920 7573 6564 2062 7920 534f 4150 2073 y used by SOAP s │ │ │ │ -001aaa00: 6572 7669 6365 732c 2077 6865 6e20 6170 ervices, when ap │ │ │ │ -001aaa10: 706c 6963 6162 6c65 2e20 5768 656e 2074 plicable. When t │ │ │ │ -001aaa20: 6865 2073 6f61 7063 7070 3220 746f 6f6c he soapcpp2 tool │ │ │ │ -001aaa30: 2070 726f 6365 7373 6573 2074 6865 2068 processes the h │ │ │ │ -001aaa40: 6561 6465 7220 6669 6c65 206d 6f64 756c eader file modul │ │ │ │ -001aaa50: 652c 2069 7420 7769 6c6c 2067 656e 6572 e, it will gener │ │ │ │ -001aaa60: 6174 6520 7468 6520 736f 7572 6365 2063 ate the source c │ │ │ │ -001aaa70: 6f64 6573 2066 6f72 2061 206c 6962 7261 odes for a libra │ │ │ │ -001aaa80: 7279 2e20 5468 6520 5765 6220 7365 7276 ry. The Web serv │ │ │ │ -001aaa90: 6963 6573 2061 7070 6c69 6361 7469 6f6e ices application │ │ │ │ -001aaaa0: 2074 6861 7420 7573 6573 2074 6865 206c that uses the l │ │ │ │ -001aaab0: 6962 7261 7279 2073 686f 756c 6420 7573 ibrary should us │ │ │ │ -001aaac0: 6520 6120 6865 6164 6572 2066 696c 6520 e a header file │ │ │ │ -001aaad0: 7468 6174 2069 6d70 6f72 7473 2074 6865 that imports the │ │ │ │ -001aaae0: 206d 6f64 756c 6520 7769 7468 2074 6865 module with the │ │ │ │ -001aaaf0: 203c 636f 6465 3e23 696d 706f 7274 3c2f #import directive, │ │ │ │ -001aab10: 2066 6f72 2065 7861 6d70 6c65 3a3c 2f70 for example:

    .
    │ │ │ │ -001aab60: 2f2a 2043 6f6e 7465 6e74 7320 6f66 2066 /* Contents of f │ │ │ │ -001aab70: 696c 6520 2671 756f 743b 6d6f 6475 6c65 ile "module │ │ │ │ -001aab80: 2e68 2671 756f 743b 202a 2f3c 2f73 7061 .h" */
    .
    #module & │ │ │ │ -001aabd0: 7175 6f74 3b74 6573 7426 7175 6f74 3b3c quot;test"< │ │ │ │ -001aabe0: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    . │ │ │ │ -001aac00: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    / │ │ │ │ -001aac30: 2f20 7479 7065 7320 616e 6420 7479 7065 / types and type │ │ │ │ -001aac40: 6465 6673 2062 6563 6f6d 6520 6d6f 6475 defs become modu │ │ │ │ -001aac50: 6c65 2d73 7065 6369 6669 633c 2f73 7061 le-specific
    .
    typedef │ │ │ │ -001aaca0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 LONG64 xsd │ │ │ │ -001aad00: 5f5f 6c6f 6e67 3b3c 2f64 6976 3e0a 3c64 __long;
    . │ │ │ │ -001aad20: 3c73 7061 6e20 636c 6173 733d 226b 6579 char*;
    . │ │ │ │ -001aad60: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    │ │ │ │ -001aad90: 2f2f 2061 206d 6f64 756c 652d 7370 6563 // a module-spec │ │ │ │ -001aada0: 6966 6963 2073 7472 7563 743c 2f73 7061 ific struct
    .
    struct n │ │ │ │ -001aadf0: 735f 5f53 203c 2f64 6976 3e0a 3c64 6976 s__S
    .
    {< │ │ │ │ -001aae10: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    ... │ │ │ │ -001aae30: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // members │ │ │ │ -001aae50: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ │ -001aae70: 7d3b 3c2f 6469 763e 0a3c 2f64 6976 3e3c };
    .
    < │ │ │ │ -001aae80: 212d 2d20 6672 6167 6d65 6e74 202d 2d3e !-- fragment --> │ │ │ │ -001aae90: 3c70 3e54 6865 203c 656d 3e3c 636f 6465

    The module.h │ │ │ │ -001aaeb0: 3c2f 656d 3e20 6461 7461 2062 696e 6469 data bindi │ │ │ │ -001aaec0: 6e67 2069 6e74 6572 6661 6365 2068 6561 ng interface hea │ │ │ │ -001aaed0: 6465 7220 6669 6c65 2066 6f72 2073 6f61 der file for soa │ │ │ │ -001aaee0: 7063 7070 3220 6465 636c 6172 6573 206d pcpp2 declares m │ │ │ │ -001aaef0: 6f64 756c 652d 7370 6563 6966 6963 2073 odule-specific s │ │ │ │ -001aaf00: 6572 6961 6c69 7a61 626c 6520 7479 7065 erializable type │ │ │ │ -001aaf10: 7320 3c63 6f64 653e 4c4f 4e47 3634 3c2f s LONG64, xsd │ │ │ │ -001aaf30: 5f5f 6c6f 6e67 3c2f 636f 6465 3e2c 203c __long, < │ │ │ │ -001aaf40: 636f 6465 3e63 6861 722a 3c2f 636f 6465 code>char*, and a s │ │ │ │ -001aaf60: 7472 7563 7420 6e73 5f5f 533c 2f63 6f64 truct ns__S. The module n │ │ │ │ -001aaf80: 616d 6520 6973 2022 7465 7374 222c 2073 ame is "test", s │ │ │ │ -001aaf90: 6f20 7468 6520 736f 6170 6370 7032 2074 o the soapcpp2 t │ │ │ │ -001aafa0: 6f6f 6c20 7072 6f64 7563 6573 2061 203c ool produces a < │ │ │ │ -001aafb0: 656d 3e3c 636f 6465 3e74 6573 7443 2e63 em>testC.c │ │ │ │ -001aafc0: 7070 3c2f 636f 6465 3e3c 2f65 6d3e 2066 pp f │ │ │ │ -001aafd0: 696c 6520 7769 7468 2074 6865 2058 4d4c ile with the XML │ │ │ │ -001aafe0: 2073 6572 6961 6c69 7a65 7273 2066 6f72 serializers for │ │ │ │ -001aaff0: 2074 6865 7365 2074 7970 6573 2e20 5468 these types. Th │ │ │ │ -001ab000: 6520 3c65 6d3e 3c63 6f64 653e 7465 7374 e test │ │ │ │ -001ab010: 432e 6370 703c 2f63 6f64 653e 3c2f 656d C.cpp data binding i │ │ │ │ -001ab030: 6d70 6c65 6d65 6e74 6174 696f 6e20 736f mplementation so │ │ │ │ -001ab040: 7572 6365 2063 6f64 6520 6361 6e20 6265 urce code can be │ │ │ │ -001ab050: 2073 6570 6172 6174 656c 7920 636f 6d70 separately comp │ │ │ │ -001ab060: 696c 6564 2061 6e64 206c 696e 6b65 6420 iled and linked │ │ │ │ -001ab070: 7769 7468 2061 6e20 6170 706c 6963 6174 with an applicat │ │ │ │ -001ab080: 696f 6e2e 2049 6620 7365 7276 6963 6520 ion. If service │ │ │ │ -001ab090: 6f70 6572 6174 696f 6e73 2061 7265 2064 operations are d │ │ │ │ -001ab0a0: 6563 6c61 7265 6420 696e 2074 6865 2069 eclared in the i │ │ │ │ -001ab0b0: 6e74 6572 6661 6365 2068 6561 6465 7220 nterface header │ │ │ │ -001ab0c0: 6669 6c65 2061 7320 6675 6e63 7469 6f6e file as function │ │ │ │ -001ab0d0: 2070 726f 746f 7479 7065 732c 2077 6520 prototypes, we │ │ │ │ -001ab0e0: 616c 736f 2067 6574 203c 656d 3e3c 636f also get testClient.cp │ │ │ │ -001ab100: 703c 2f63 6f64 653e 3c2f 656d 3e20 636c p cl │ │ │ │ -001ab110: 6965 6e74 2073 7475 6220 6675 6e63 7469 ient stub functi │ │ │ │ -001ab120: 6f6e 7320 616e 6420 3c65 6d3e 3c63 6f64 ons and testServer.cpp │ │ │ │ -001ab140: 3c2f 636f 6465 3e3c 2f65 6d3e 2073 6572 ser │ │ │ │ -001ab150: 7665 7220 736b 656c 6574 6f6e 2066 756e ver skeleton fun │ │ │ │ -001ab160: 6374 696f 6e73 2e3c 2f70 3e0a 3c70 3e54 ctions.

    .

    T │ │ │ │ -001ab170: 6865 7265 2061 7265 2073 6f6d 6520 6c69 here are some li │ │ │ │ -001ab180: 6d69 7461 7469 6f6e 7320 666f 7220 6d6f mitations for mo │ │ │ │ -001ab190: 6475 6c65 2069 6d70 6f72 7473 3a3c 2f70 dule imports:

    .
      .
    • A mod │ │ │ │ -001ab1b0: 756c 6520 6d75 7374 2062 6520 696d 706f ule must be impo │ │ │ │ -001ab1c0: 7274 6564 2069 6e74 6f20 616e 6f74 6865 rted into anothe │ │ │ │ -001ab1d0: 7220 696e 7465 7266 6163 6520 6865 6164 r interface head │ │ │ │ -001ab1e0: 6572 2074 6f20 7573 6520 7468 6520 6d6f er to use the mo │ │ │ │ -001ab1f0: 6475 6c65 2773 2074 7970 6520 6465 6669 dule's type defi │ │ │ │ -001ab200: 6e69 7469 6f6e 732e 3c2f 6c69 3e0a 3c6c nitions.
    • .When multiple │ │ │ │ -001ab220: 6d6f 6475 6c65 7320 6172 6520 696d 706f modules are impo │ │ │ │ -001ab230: 7274 6564 2c20 7468 6520 7479 7065 7320 rted, the types │ │ │ │ -001ab240: 7468 6174 2074 6865 7920 6465 636c 6172 that they declar │ │ │ │ -001ab250: 6520 6d75 7374 2062 6520 6465 636c 6172 e must be declar │ │ │ │ -001ab260: 6564 2069 6e20 6f6e 6520 6d6f 6475 6c65 ed in one module │ │ │ │ -001ab270: 206f 6e6c 7920 746f 2061 766f 6964 206e only to avoid n │ │ │ │ -001ab280: 616d 6520 636c 6173 6865 7320 616e 6420 ame clashes and │ │ │ │ -001ab290: 6c69 6e6b 2065 7272 6f72 732e 2059 6f75 link errors. You │ │ │ │ -001ab2a0: 2063 616e 6e6f 7420 6372 6561 7465 2074 cannot create t │ │ │ │ -001ab2b0: 776f 206d 6f64 756c 6573 2074 6861 7420 wo modules that │ │ │ │ -001ab2c0: 6465 636c 6172 6520 6f72 2075 7365 2074 declare or use t │ │ │ │ -001ab2d0: 6865 2073 616d 6520 7479 7065 2061 6e64 he same type and │ │ │ │ -001ab2e0: 2069 6d70 6f72 7420 7468 6573 6520 6d6f import these mo │ │ │ │ -001ab2f0: 6475 6c65 7320 7365 7061 7261 7465 6c79 dules separately │ │ │ │ -001ab300: 2069 6e74 6f20 616e 6f74 6865 7220 6865 into another he │ │ │ │ -001ab310: 6164 6572 2066 696c 652e 2057 6865 6e20 ader file. When │ │ │ │ -001ab320: 7573 696e 6720 6d6f 6475 6c65 732c 2063 using modules, c │ │ │ │ -001ab330: 6f6e 7369 6465 7220 6372 6561 7469 6e67 onsider creating │ │ │ │ -001ab340: 2061 206d 6f64 756c 6520 6869 6572 6172 a module hierar │ │ │ │ -001ab350: 6368 7920 7375 6368 2074 6861 7420 7479 chy such that ty │ │ │ │ -001ab360: 7065 7320 6172 6520 6465 636c 6172 6564 pes are declared │ │ │ │ -001ab370: 206f 6e6c 7920 6f6e 6365 2061 6e64 2062 only once and b │ │ │ │ -001ab380: 7920 6f6e 6c79 206f 6e65 206d 6f64 756c y only one modul │ │ │ │ -001ab390: 6520 7768 656e 2074 6865 7365 206d 6f64 e when these mod │ │ │ │ -001ab3a0: 756c 6573 206d 7573 7420 6265 206c 696e ules must be lin │ │ │ │ -001ab3b0: 6b65 642e 3c2f 6c69 3e0a 3c2f 756c 3e0a ked..
    . │ │ │ │ -001ab3c0: 3c70 3e57 6974 6820 6d6f 6475 6c65 732c

    With modules, │ │ │ │ -001ab3d0: 2074 6865 2073 6f75 7263 6520 636f 6465 the source code │ │ │ │ -001ab3e0: 2073 6572 6961 6c69 7a65 7273 2066 6f72 serializers for │ │ │ │ -001ab3f0: 2074 6865 2074 7970 6573 2064 6566 696e the types defin │ │ │ │ -001ab400: 6564 2069 6e20 7468 6520 6d6f 6475 6c65 ed in the module │ │ │ │ -001ab410: 7320 6172 6520 6765 6e65 7261 7465 6420 s are generated │ │ │ │ -001ab420: 7769 7468 2073 6f61 7063 7070 3220 7365 with soapcpp2 se │ │ │ │ -001ab430: 7061 7261 7465 6c79 2e20 466f 7220 6578 parately. For ex │ │ │ │ -001ab440: 616d 706c 652c 2061 7373 756d 6520 7468 ample, assume th │ │ │ │ -001ab450: 6174 2077 6520 6861 7665 2061 206d 6f64 at we have a mod │ │ │ │ -001ab460: 756c 6520 3c65 6d3e 3c63 6f64 653e 6d6f ule mo │ │ │ │ -001ab470: 6475 6c65 2e68 3c2f 636f 6465 3e3c 2f65 dule.h:

    .
    │ │ │ │ -001ab4b0: 3c73 7061 6e20 636c 6173 733d 2263 6f6d /* Content │ │ │ │ -001ab4d0: 7320 6f66 2066 696c 6520 2671 756f 743b s of file " │ │ │ │ -001ab4e0: 6d6f 6475 6c65 2e68 2671 756f 743b 202a module.h" * │ │ │ │ -001ab4f0: 2f3c 2f73 7061 6e3e 3c2f 6469 763e 0a3c /
    .< │ │ │ │ -001ab500: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001ab510: 3e3c 7370 616e 2063 6c61 7373 3d22 7072 >#mod │ │ │ │ -001ab530: 756c 6520 2671 756f 743b 7465 7374 2671 ule "test&q │ │ │ │ -001ab540: 756f 743b 3c2f 7370 616e 3e3c 2f64 6976 uot;
    .
    .
    struct ns__S
    . │ │ │ │ -001ab5c0: 7b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 {
    .
    char *name;
    │ │ │ │ -001ab610: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    int amou │ │ │ │ -001ab650: 6e74 3b3c 2f64 6976 3e0a 3c64 6976 2063 nt;
    .
    };.

    a │ │ │ │ -001ab690: 6e64 2061 2068 6561 6465 7220 6669 6c65 nd a header file │ │ │ │ -001ab6a0: 203c 656d 3e3c 636f 6465 3e65 7861 6d70 examp │ │ │ │ -001ab6b0: 6c65 2e68 3c2f 636f 6465 3e3c 2f65 6d3e le.h │ │ │ │ -001ab6c0: 2074 6861 7420 7573 6573 2069 743a 3c2f that uses it:.

    /* Contents of │ │ │ │ -001ab720: 6669 6c65 2026 7175 6f74 3b65 7861 6d70 file "examp │ │ │ │ -001ab730: 6c65 2e68 2671 756f 743b 202a 2f3c 2f73 le.h" */
    .
    #import │ │ │ │ -001ab780: 2671 756f 743b 6d6f 6475 6c65 2e68 2671 "module.h&q │ │ │ │ -001ab790: 756f 743b 3c2f 7370 616e 3e3c 2f64 6976 uot;
    .
    .
    int ns__webmethod │ │ │ │ -001ab800: 283c 7370 616e 2063 6c61 7373 3d22 6b65 (const ch │ │ │ │ -001ab840: 6172 3c2f 7370 616e 3e20 2a63 6f64 652c ar *code, │ │ │ │ -001ab850: 203c 7370 616e 2063 6c61 7373 3d22 6b65 struct ns__S *reco │ │ │ │ -001ab880: 7264 2c20 3c73 7061 6e20 636c 6173 733d rd, in │ │ │ │ -001ab8a0: 743c 2f73 7061 6e3e 202a 7265 7375 6c74 t *result │ │ │ │ -001ab8b0: 293b 2020 2020 3c2f 6469 763e 0a3c 2f64 );
    .

    The modul │ │ │ │ -001ab8e0: 6520 6973 2063 6f6d 7069 6c65 6420 6173 e is compiled as │ │ │ │ -001ab8f0: 2066 6f6c 6c6f 7773 3a20 3c2f 703e 3c70 follows:

    soapcpp2 mod │ │ │ │ -001ab920: 756c 6531 2e68 0a3c 2f70 7265 3e3c 703e ule1.h.

    │ │ │ │ -001ab930: 2054 6869 7320 6765 6e65 7261 7465 7320 This generates │ │ │ │ -001ab940: 7468 6520 6669 6c65 7320 3c65 6d3e 3c63 the files testStub.h, │ │ │ │ -001ab970: 3c63 6f64 653e 7465 7374 482e 683c 2f63 testH.h, and < │ │ │ │ -001ab990: 656d 3e3c 636f 6465 3e74 6573 7443 2e63 em>testC.c │ │ │ │ -001ab9a0: 7070 3c2f 636f 6465 3e3c 2f65 6d3e 2077 pp w │ │ │ │ -001ab9b0: 6974 6820 7365 7269 616c 697a 6572 7320 ith serializers │ │ │ │ -001ab9c0: 666f 7220 3c63 6f64 653e 7374 7275 6374 for struct │ │ │ │ -001ab9d0: 206e 735f 5f53 3c2f 636f 6465 3e20 6275 ns__S bu │ │ │ │ -001ab9e0: 7420 616c 736f 2066 6f72 203c 636f 6465 t also for char* an │ │ │ │ -001aba00: 6420 3c63 6f64 653e 696e 743c 2f63 6f64 d int.

    ., n);

    Runni │ │ │ │ -001aba20: 6e67 2073 6f61 7063 7070 3220 6f6e 203c ng soapcpp2 on < │ │ │ │ -001aba30: 656d 3e3c 636f 6465 3e65 7861 6d70 6c65 em>example │ │ │ │ -001aba40: 2e68 3c2f 636f 6465 3e3c 2f65 6d3e 2069 .h i │ │ │ │ -001aba50: 6d70 6f72 7473 2074 6865 206d 6f64 756c mports the modul │ │ │ │ -001aba60: 6520 6465 6669 6e69 7469 6f6e 732c 2062 e definitions, b │ │ │ │ -001aba70: 7574 2064 6f65 7320 6e6f 7420 6765 6e65 ut does not gene │ │ │ │ -001aba80: 7261 7465 2073 6572 6961 6c69 7a65 7273 rate serializers │ │ │ │ -001aba90: 2066 6f72 203c 636f 6465 3e73 7472 7563 for struc │ │ │ │ -001abaa0: 7420 6e73 5f5f 533c 2f63 6f64 653e 2c20 t ns__S, │ │ │ │ -001abab0: 3c63 6f64 653e 6368 6172 2a3c 2f63 6f64 char* and int │ │ │ │ -001abad0: 3c2f 636f 6465 3e20 7369 6e63 6520 7468 since th │ │ │ │ -001abae0: 6573 6520 6172 6520 6465 6669 6e65 6420 ese are defined │ │ │ │ -001abaf0: 6279 203c 656d 3e3c 636f 6465 3e6d 6f64 by mod │ │ │ │ -001abb00: 756c 652e 683c 2f63 6f64 653e 3c2f 656d ule.h:

    soa
    │ │ │ │ -001abb30: 7063 7070 3220 2d43 4c20 6578 616d 706c  pcpp2 -CL exampl
    │ │ │ │ -001abb40: 652e 680a 3c2f 7072 653e 3c70 3e20 416e  e.h.

    An │ │ │ │ -001abb50: 2065 7861 6d70 6c65 2063 6c69 656e 7420 example client │ │ │ │ -001abb60: 6170 706c 6963 6174 696f 6e20 7468 6174 application that │ │ │ │ -001abb70: 2063 616c 6c73 2074 6865 2063 6c69 656e calls the clien │ │ │ │ -001abb80: 7420 7374 7562 2066 756e 6374 696f 6e3a t stub function: │ │ │ │ -001abb90: 3c2f 703e 0a3c 6469 7620 636c 6173 733d

    .
    #include │ │ │ │ -001abbe0: 2026 7175 6f74 3b73 6f61 7048 2e68 2671 "soapH.h&q │ │ │ │ -001abbf0: 756f 743b 3c2f 7370 616e 3e3c 2f64 6976 uot;
    .
    # │ │ │ │ -001abc30: 696e 636c 7564 6520 2671 756f 743b 6e73 include "ns │ │ │ │ -001abc40: 2e6e 736d 6170 2671 756f 743b 3c2f 7370 .nsmap"
    .
    .
    │ │ │ │ -001abca0: 696e 743c 2f73 7061 6e3e 206d 6169 6e28 int main( │ │ │ │ -001abcb0: 293c 2f64 6976 3e0a 3c64 6976 2063 6c61 )
    .
    {
    .
    stru │ │ │ │ -001abd00: 6374 203c 2f73 7061 6e3e 3c61 2063 6c61 ct soap *soap = soap_new() │ │ │ │ -001abdd0: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
    .
    struct │ │ │ │ -001abe10: 6e73 5f5f 5320 733b 3c2f 6469 763e 0a3c ns__S s;
    .< │ │ │ │ -001abe20: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001abe30: 3e20 2073 6f61 705f 6465 6661 756c 745f > soap_default_ │ │ │ │ -001abe40: 6e73 5f5f 5328 3c61 2063 6c61 7373 3d22 ns__S(soa │ │ │ │ -001abe70: 703c 2f61 3e2c 2026 616d 703b 7329 3b3c p, &s);< │ │ │ │ -001abe80: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    s.name │ │ │ │ -001abea0: 203d 203c 6120 636c 6173 733d 2263 6f64 = soap_str │ │ │ │ -001abf00: 6475 703c 2f61 3e28 3c61 2063 6c61 7373 dup(s │ │ │ │ -001abf30: 6f61 703c 2f61 3e2c 203c 7370 616e 2063 oap, "name& │ │ │ │ -001abf60: 7175 6f74 3b3c 2f73 7061 6e3e 293b 3c2f quot;);.
    s.amoun │ │ │ │ -001abf90: 7420 3d20 3132 343b 3c2f 6469 763e 0a3c t = 124;
    .< │ │ │ │ -001abfa0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001abfb0: 3e20 203c 7370 616e 2063 6c61 7373 3d22 > int │ │ │ │ -001abfd0: 3c2f 7370 616e 3e20 6e3b 3c2f 6469 763e n;
    │ │ │ │ -001abfe0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    i │ │ │ │ -001ac010: 663c 2f73 7061 6e3e 2028 736f 6170 5f63 f (soap_c │ │ │ │ -001ac020: 616c 6c5f 6e73 5f5f 7765 626d 6574 686f all_ns__webmetho │ │ │ │ -001ac030: 6428 3c61 2063 6c61 7373 3d22 636f 6465 d(soap, endpoint, NUL │ │ │ │ -001ac070: 4c2c 203c 7370 616e 2063 6c61 7373 3d22 L, & │ │ │ │ -001ac090: 7175 6f74 3b63 6f64 6526 7175 6f74 3b3c quot;code"< │ │ │ │ -001ac0a0: 2f73 7061 6e3e 2c20 2661 6d70 3b73 2c20 /span>, &s, │ │ │ │ -001ac0b0: 2661 6d70 3b6e 2929 3c2f 6469 763e 0a3c &n))
    .< │ │ │ │ -001ac0c0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001ac0d0: 3e20 2020 203c 6120 636c 6173 733d 2263 > soap_pri │ │ │ │ -001ac130: 6e74 5f66 6175 6c74 3c2f 613e 283c 6120 nt_fault(soap, st │ │ │ │ -001ac170: 6465 7272 293b 3c2f 6469 763e 0a3c 6469 derr);
    . │ │ │ │ -001ac190: 203c 7370 616e 2063 6c61 7373 3d22 6b65 else< │ │ │ │ -001ac1b0: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    . │ │ │ │ -001ac1d0: 2020 2070 7269 6e74 6628 3c73 7061 6e20 printf("OK n │ │ │ │ -001ac200: 203d 2025 645c 6e26 7175 6f74 3b3c 2f73 = %d\n"
    . │ │ │ │ -001ac220: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65 .. │ │ │ │ -001ac380: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65 .< │ │ │ │ -001ac430: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001ac440: 3e7d 3c2f 6469 763e 0a3c 2f64 6976 3e3c >}
    .
    < │ │ │ │ -001ac450: 212d 2d20 6672 6167 6d65 6e74 202d 2d3e !-- fragment --> │ │ │ │ -001ac460: 3c70 3e57 6520 636f 6d70 696c 6520 7468

    We compile th │ │ │ │ -001ac470: 6973 2065 7861 6d70 6c65 2061 7320 666f is example as fo │ │ │ │ -001ac480: 6c6c 6f77 733a 203c 2f70 3e3c 7072 6520 llows:

    c++ -o example 
    │ │ │ │ -001ac4b0: 6578 616d 706c 652e 6370 7020 7465 7374  example.cpp test
    │ │ │ │ -001ac4c0: 432e 6370 7020 736f 6170 432e 6370 7020  C.cpp soapC.cpp 
    │ │ │ │ -001ac4d0: 736f 6170 436c 6965 6e74 2e63 7070 2073  soapClient.cpp s
    │ │ │ │ -001ac4e0: 7464 736f 6170 322e 6370 700a 3c2f 7072  tdsoap2.cpp.

    Modules ma │ │ │ │ -001ac500: 7920 6865 6c70 2074 6f20 6465 6669 6e65 y help to define │ │ │ │ -001ac510: 2061 206d 6f64 756c 6172 2068 6965 7261 a modular hiera │ │ │ │ -001ac520: 7263 6879 206f 6620 6c69 6272 6172 6965 rchy of librarie │ │ │ │ -001ac530: 7320 7769 7468 2072 6575 7361 626c 6520 s with reusable │ │ │ │ -001ac540: 7365 7269 616c 697a 6162 6c65 2074 7970 serializable typ │ │ │ │ -001ac550: 6573 2e3c 2f70 3e0a 3c70 3ef0 9f94 9d20 es.

    .

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

    ..Plugins, m │ │ │ │ -001ac5c0: 6f64 756c 6573 2c20 616e 6420 6578 7465 odules, and exte │ │ │ │ -001ac5d0: 6e73 696f 6e73 3c2f 6832 3e0a 3c70 3e50 nsions

    .

    P │ │ │ │ -001ac5e0: 6c75 6769 6e73 206f 6666 6572 2061 2063 lugins offer a c │ │ │ │ -001ac5f0: 6f6e 7665 6e69 656e 7420 6578 7465 6e73 onvenient extens │ │ │ │ -001ac600: 696f 6e20 6d65 6368 616e 6973 6d20 666f ion mechanism fo │ │ │ │ -001ac610: 7220 7468 6520 6753 4f41 5020 746f 6f6c r the gSOAP tool │ │ │ │ -001ac620: 6b69 7420 6279 2065 7874 656e 6469 6e67 kit by extending │ │ │ │ -001ac630: 2074 6865 2063 6170 6162 696c 6974 6965 the capabilitie │ │ │ │ -001ac640: 7320 6f66 2069 7473 2065 6e67 696e 652e s of its engine. │ │ │ │ -001ac650: 2057 6865 6e20 7468 6520 706c 7567 696e When the plugin │ │ │ │ -001ac660: 2072 6567 6973 7465 7273 2077 6974 6820 registers with │ │ │ │ -001ac670: 7468 6520 6753 4f41 5020 656e 6769 6e65 the gSOAP engine │ │ │ │ -001ac680: 2c20 6974 2068 6173 2066 756c 6c20 6163 , it has full ac │ │ │ │ -001ac690: 6365 7373 2074 6f20 7468 6520 7275 6e2d cess to the run- │ │ │ │ -001ac6a0: 7469 6d65 2073 6574 7469 6e67 7320 616e time settings an │ │ │ │ -001ac6b0: 6420 7468 6520 656e 6769 6e65 2773 2066 d the engine's f │ │ │ │ -001ac6c0: 756e 6374 696f 6e20 6361 6c6c 6261 636b unction callback │ │ │ │ -001ac6d0: 732e 2055 706f 6e20 7265 6769 7374 7279 s. Upon registry │ │ │ │ -001ac6e0: 2c20 7468 6520 706c 7567 696e 2773 206c , the plugin's l │ │ │ │ -001ac6f0: 6f63 616c 2064 6174 6120 6973 2061 7373 ocal data is ass │ │ │ │ -001ac700: 6f63 6961 7465 6420 7769 7468 2074 6865 ociated with the │ │ │ │ -001ac710: 203c 636f 6465 3e3c 6120 636c 6173 733d soap context. By o │ │ │ │ -001ac780: 7665 7272 6964 696e 6720 7468 6520 6361 verriding the ca │ │ │ │ -001ac790: 6c6c 6261 636b 7320 7769 7468 2074 6865 llbacks with the │ │ │ │ -001ac7a0: 2070 6c75 6769 6e27 7320 6361 6c6c 6261 plugin's callba │ │ │ │ -001ac7b0: 636b 732c 2074 6865 2070 6c75 6769 6e20 cks, the plugin │ │ │ │ -001ac7c0: 6578 7465 6e64 7320 6f72 206d 6f64 6966 extends or modif │ │ │ │ -001ac7d0: 6965 7320 7468 6520 656e 6769 6e65 2773 ies the engine's │ │ │ │ -001ac7e0: 2063 6170 6162 696c 6974 6965 732e 2054 capabilities. T │ │ │ │ -001ac7f0: 6865 206c 6f63 616c 2070 6c75 6769 6e20 he local plugin │ │ │ │ -001ac800: 6461 7461 2063 616e 2062 6520 6163 6365 data can be acce │ │ │ │ -001ac810: 7373 6564 2074 6872 6f75 6768 2061 206c ssed through a l │ │ │ │ -001ac820: 6f6f 6b75 7020 6675 6e63 7469 6f6e 2c20 ookup function, │ │ │ │ -001ac830: 7573 7561 6c6c 7920 696e 766f 6b65 6420 usually invoked │ │ │ │ -001ac840: 7769 7468 696e 2061 2063 616c 6c62 6163 within a callbac │ │ │ │ -001ac850: 6b20 6675 6e63 7469 6f6e 2074 6f20 6163 k function to ac │ │ │ │ -001ac860: 6365 7373 2074 6865 2070 6c75 6769 6e20 cess the plugin │ │ │ │ -001ac870: 6461 7461 2e20 5468 6520 7265 6769 7374 data. The regist │ │ │ │ -001ac880: 7279 2061 6e64 206c 6f6f 6b75 7020 6675 ry and lookup fu │ │ │ │ -001ac890: 6e63 7469 6f6e 7320 6172 653a 3c2f 703e nctions are:

    │ │ │ │ -001ac8a0: 0a3c 6469 7620 636c 6173 733d 2266 7261 .
    int soap_register_ │ │ │ │ -001ac950: 706c 7567 696e 5f61 7267 3c2f 613e 283c plugin_arg(< │ │ │ │ -001ac960: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -001ac970: 6f72 6422 3e73 7472 7563 743c 2f73 7061 ord">struct soap *soap< │ │ │ │ -001ac9e0: 2f61 3e2c 203c 7370 616e 2063 6c61 7373 /a>, i │ │ │ │ -001aca00: 6e74 3c2f 7370 616e 3e20 282a 6663 7265 nt (*fcre │ │ │ │ -001aca10: 6174 6529 283c 7370 616e 2063 6c61 7373 ate)(struc │ │ │ │ -001aca30: 743c 2f73 7061 6e3e 203c 6120 636c 6173 t │ │ │ │ -001aca60: 736f 6170 3c2f 613e 202a 3c61 2063 6c61 soap *soap, struct s │ │ │ │ -001acac0: 6f61 705f 706c 7567 696e 202a 702c 203c oap_plugin *p, < │ │ │ │ -001acad0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -001acae0: 6f72 6474 7970 6522 3e76 6f69 643c 2f73 ordtype">void *arg), void *arg)
    .< │ │ │ │ -001acc00: 6469 7620 636c 6173 733d 2274 7464 6563 div class="ttdec │ │ │ │ -001acc10: 6922 3e69 6e74 2073 6f61 705f 7265 6769 i">int soap_regi │ │ │ │ -001acc20: 7374 6572 5f70 6c75 6769 6e5f 6172 6728 ster_plugin_arg( │ │ │ │ -001acc30: 7374 7275 6374 2073 6f61 7020 2a73 6f61 struct soap *soa │ │ │ │ -001acc40: 702c 2069 6e74 282a 6663 7265 6174 6529 p, int(*fcreate) │ │ │ │ -001acc50: 2873 7472 7563 7420 736f 6170 202a 2c20 (struct soap *, │ │ │ │ -001acc60: 7374 7275 6374 2073 6f61 705f 706c 7567 struct soap_plug │ │ │ │ -001acc70: 696e 202a 2c20 766f 6964 202a 292c 2076 in *, void *), v │ │ │ │ -001acc80: 6f69 6420 2a61 7267 293c 2f64 6976 3e3c oid *arg)
    < │ │ │ │ -001acc90: 6469 7620 636c 6173 733d 2274 7464 6f63 div class="ttdoc │ │ │ │ -001acca0: 223e 5265 6769 7374 6572 2061 2070 6c75 ">Register a plu │ │ │ │ -001accb0: 6769 6e20 7769 7468 2061 6e20 6172 6775 gin with an argu │ │ │ │ -001accc0: 6d65 6e74 2e3c 2f64 6976 3e3c 2f64 6976 ment..
    │ │ │ │ -001acd00: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    void │ │ │ │ -001acd30: 3c2f 7370 616e 3e2a 2073 6f61 705f 6c6f * soap_lo │ │ │ │ -001acd40: 6f6b 7570 5f70 6c75 6769 6e28 3c73 7061 okup_plugin(struct │ │ │ │ -001acd70: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap* │ │ │ │ -001acda0: 2c20 3c73 7061 6e20 636c 6173 733d 226b , const c │ │ │ │ -001acde0: 6861 723c 2f73 7061 6e3e 2a29 3b3c 2f64 har*);.

    Th │ │ │ │ -001ace10: 6520 3c63 6f64 653e 3c61 2063 6c61 7373 e soap_copy │ │ │ │ -001aced0: 3c2f 636f 6465 3e20 6675 6e63 7469 6f6e function │ │ │ │ -001acee0: 2072 6574 7572 6e73 2061 206e 6577 2064 returns a new d │ │ │ │ -001acef0: 796e 616d 6963 616c 6c79 2061 6c6c 6f63 ynamically alloc │ │ │ │ -001acf00: 6174 6564 203c 636f 6465 3e3c 6120 636c ated soap< │ │ │ │ -001acf60: 2f63 6f64 653e 2063 6f6e 7465 7874 2074 /code> context t │ │ │ │ -001acf70: 6861 7420 6973 2061 2063 6f70 7920 6f66 hat is a copy of │ │ │ │ -001acf80: 2061 6e6f 7468 6572 2c20 7375 6368 2074 another, such t │ │ │ │ -001acf90: 6861 7420 6e6f 2064 6174 6120 6973 2073 hat no data is s │ │ │ │ -001acfa0: 6861 7265 6420 6265 7477 6565 6e20 7468 hared between th │ │ │ │ -001acfb0: 6520 636f 7079 2061 6e64 2074 6865 206f e copy and the o │ │ │ │ -001acfc0: 7269 6769 6e61 6c20 636f 6e74 6578 742e riginal context. │ │ │ │ -001acfd0: 2054 6865 203c 636f 6465 3e3c 6120 636c The soap_copy< │ │ │ │ -001ad090: 2f61 3e3c 2f63 6f64 653e 2066 756e 6374 /a> funct │ │ │ │ -001ad0a0: 696f 6e20 696e 766f 6b65 7320 7468 6520 ion invokes the │ │ │ │ -001ad0b0: 636f 7079 2066 756e 6374 696f 6e73 206f copy functions o │ │ │ │ -001ad0c0: 6620 7468 6520 7265 6769 7374 6572 6564 f the registered │ │ │ │ -001ad0d0: 2070 6c75 6769 6e73 2074 6f20 636f 7079 plugins to copy │ │ │ │ -001ad0e0: 2074 6865 2070 6c75 6769 6e73 2720 6c6f the plugins' lo │ │ │ │ -001ad0f0: 6361 6c20 6461 7461 2e20 5468 6520 3c63 cal data. The soap_don │ │ │ │ -001ad1d0: 653c 2f61 3e3c 2f63 6f64 653e 2061 6e64 e and │ │ │ │ -001ad1e0: 203c 636f 6465 3e3c 6120 636c 6173 733d soap_free │ │ │ │ -001ad290: 3c2f 613e 3c2f 636f 6465 3e20 6675 6e63 func │ │ │ │ -001ad2a0: 7469 6f6e 7320 6465 2d72 6567 6973 7465 tions de-registe │ │ │ │ -001ad2b0: 7273 2061 6c6c 2070 6c75 6769 6e2e 3c2f rs all plugin..

    The follow │ │ │ │ -001ad2d0: 2065 7861 6d70 6c65 206f 7665 7272 6964 example overrid │ │ │ │ -001ad2e0: 6573 2074 6865 2073 656e 6420 616e 6420 es the send and │ │ │ │ -001ad2f0: 7265 6365 6976 6520 6361 6c6c 6261 636b receive callback │ │ │ │ -001ad300: 7320 746f 2063 6f70 7920 616c 6c20 6d65 s to copy all me │ │ │ │ -001ad310: 7373 6167 6573 2074 6861 7420 6172 6520 ssages that are │ │ │ │ -001ad320: 7365 6e74 2061 6e64 2072 6563 6569 7665 sent and receive │ │ │ │ -001ad330: 6420 746f 2074 6865 2074 6572 6d69 6e61 d to the termina │ │ │ │ -001ad340: 6c20 2873 7464 6572 7229 2e3c 2f70 3e0a l (stderr).

    . │ │ │ │ -001ad350: 3c70 3e46 6972 7374 2c20 7765 2077 7269

    First, we wri │ │ │ │ -001ad360: 7465 2061 2068 6561 6465 7220 6669 6c65 te a header file │ │ │ │ -001ad370: 203c 656d 3e3c 636f 6465 3e70 6c75 6769 plugi │ │ │ │ -001ad380: 6e2e 683c 2f63 6f64 653e 3c2f 656d 3e20 n.h │ │ │ │ -001ad390: 746f 2064 6566 696e 6520 7468 6520 6c6f to define the lo │ │ │ │ -001ad3a0: 6361 6c20 706c 7567 696e 2064 6174 6120 cal plugin data │ │ │ │ -001ad3b0: 7374 7275 6374 7572 6528 7329 2061 6e64 structure(s) and │ │ │ │ -001ad3c0: 2077 6520 6465 6669 6e65 2061 2067 6c6f we define a glo │ │ │ │ -001ad3d0: 6261 6c20 6e61 6d65 2074 6f20 6964 656e bal name to iden │ │ │ │ -001ad3e0: 7469 6679 2074 6865 2070 6c75 6769 6e3a tify the plugin: │ │ │ │ -001ad3f0: 3c2f 703e 0a3c 6469 7620 636c 6173 733d

    .
    #include │ │ │ │ -001ad440: 2026 7175 6f74 3b3c 6120 636c 6173 733d "s │ │ │ │ -001ad470: 7464 736f 6170 322e 683c 2f61 3e26 7175 tdsoap2.h&qu │ │ │ │ -001ad480: 6f74 3b3c 2f73 7061 6e3e 203c 2f64 6976 ot;
    .
    # │ │ │ │ -001ad4c0: 6465 6669 6e65 2050 4c55 4749 4e5f 4944 define PLUGIN_ID │ │ │ │ -001ad4d0: 2026 7175 6f74 3b50 4c55 4749 4e2d 312e "PLUGIN-1. │ │ │ │ -001ad4e0: 3026 7175 6f74 3b3c 2f73 7061 6e3e 203c 0" < │ │ │ │ -001ad4f0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ -001ad500: 656e 7422 3e2f 2f20 736f 6d65 206e 616d ent">// some nam │ │ │ │ -001ad510: 6520 746f 2069 6465 6e74 6966 7920 706c e to identify pl │ │ │ │ -001ad520: 7567 696e 203c 2f73 7061 6e3e 3c2f 6469 ugin .
    .< │ │ │ │ -001ad560: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -001ad570: 6f72 6422 3e73 7472 7563 7420 3c2f 7370 ord">struct plugin_data < │ │ │ │ -001ad590: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ -001ad5a0: 656e 7422 3e2f 2f20 6c6f 6361 6c20 706c ent">// local pl │ │ │ │ -001ad5b0: 7567 696e 2064 6174 6120 3c2f 7370 616e ugin data
    .
    {
    .
    int (*fsen │ │ │ │ -001ad600: 6429 283c 7370 616e 2063 6c61 7373 3d22 d)(struct │ │ │ │ -001ad620: 3c2f 7370 616e 3e3c 6120 636c 6173 733d so │ │ │ │ -001ad650: 6170 3c2f 613e 2a2c 203c 7370 616e 2063 ap*, c │ │ │ │ -001ad670: 6f6e 7374 3c2f 7370 616e 3e20 3c73 7061 onst char*, size_t); // to save an │ │ │ │ -001ad6d0: 6420 7573 6520 7365 6e64 2063 616c 6c62 d use send callb │ │ │ │ -001ad6e0: 6163 6b20 3c2f 7370 616e 3e3c 2f64 6976 ack
    .
    size_t (*< │ │ │ │ -001ad710: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -001ad720: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ │ -001ad730: 705f 5f63 616c 6c62 6163 6b73 2e68 746d p__callbacks.htm │ │ │ │ -001ad740: 6c23 6761 3063 3231 3863 6435 3535 3230 l#ga0c218cd55520 │ │ │ │ -001ad750: 3435 3734 3563 6336 3430 3939 3865 3235 45745cc640998e25 │ │ │ │ -001ad760: 6564 3732 223e 6672 6563 763c 2f61 3e29 ed72">frecv) │ │ │ │ -001ad770: 283c 7370 616e 2063 6c61 7373 3d22 6b65 (struct soap │ │ │ │ -001ad7c0: 3c2f 613e 2a2c 203c 7370 616e 2063 6c61 *, char*, s │ │ │ │ -001ad7f0: 697a 655f 7429 3b20 3c73 7061 6e20 636c ize_t); // │ │ │ │ -001ad810: 2074 6f20 7361 7665 2061 6e64 2075 7365 to save and use │ │ │ │ -001ad820: 2072 6563 7620 6361 6c6c 6261 636b 203c recv callback < │ │ │ │ -001ad830: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    .} │ │ │ │ -001ad850: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
    .
    int │ │ │ │ -001ad890: 706c 7567 696e 283c 7370 616e 2063 6c61 plugin(str │ │ │ │ -001ad8b0: 7563 743c 2f73 7061 6e3e 203c 6120 636c uct soap *soap, struct │ │ │ │ -001ad940: 2073 6f61 705f 706c 7567 696e 202a 706c soap_plugin *pl │ │ │ │ -001ad950: 7567 696e 2c20 3c73 7061 6e20 636c 6173 ugin, │ │ │ │ -001ad970: 766f 6964 3c2f 7370 616e 3e20 2a61 7267 void *arg │ │ │ │ -001ad980: 293b 3c2f 6469 763e 0a3c 6469 7620 636c );
    .
    │ │ │ │ -001ad9e0: 7374 6473 6f61 7032 2e68 3c2f 613e 3c2f stdsoap2.h
    This file │ │ │ │ -001ada10: 2064 6566 696e 6573 2074 6865 2063 6f6d defines the com │ │ │ │ -001ada20: 6d6f 6e20 6d61 6372 6f73 2c20 7479 7065 mon macros, type │ │ │ │ -001ada30: 7320 616e 6420 6675 6e63 7469 6f6e 7320 s and functions │ │ │ │ -001ada40: 6f66 2074 6865 2067 534f 4150 2041 5049 of the gSOAP API │ │ │ │ -001ada50: 2067 726f 7570 6564 2062 7920 6d6f 6475 grouped by modu │ │ │ │ -001ada60: 6c65 733c 2f64 6976 3e3c 2f64 6976 3e0a les
    . │ │ │ │ -001ada70: 3c2f 6469 763e 3c21 2d2d 2066 7261 676d

    Then, │ │ │ │ -001ada90: 7765 2077 7269 7465 2074 6865 2070 6c75 we write the plu │ │ │ │ -001adaa0: 6769 6e20 7265 6769 7374 7279 2066 756e gin registry fun │ │ │ │ -001adab0: 6374 696f 6e20 616e 6420 7468 6520 6361 ction and the ca │ │ │ │ -001adac0: 6c6c 6261 636b 733a 3c2f 703e 0a3c 6469 llbacks:

    .
    │ │ │ │ -001adb10: 2369 6e63 6c75 6465 2026 7175 6f74 3b70 #include "p │ │ │ │ -001adb20: 6c75 6769 6e2e 6826 7175 6f74 3b3c 2f73 lugin.h"
    .
    < │ │ │ │ -001adb50: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    st │ │ │ │ -001adb80: 6174 6963 3c2f 7370 616e 3e20 3c73 7061 atic const < │ │ │ │ -001adbb0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -001adbc0: 6f72 6474 7970 6522 3e63 6861 723c 2f73 ordtype">char plugin_id[] │ │ │ │ -001adbe0: 203d 2050 4c55 4749 4e5f 4944 3b20 3c73 = PLUGIN_ID; // the plugi │ │ │ │ -001adc10: 6e20 6964 203c 2f73 7061 6e3e 3c2f 6469 n id .
    stati │ │ │ │ -001adc50: 633c 2f73 7061 6e3e 203c 7370 616e 2063 c int pl │ │ │ │ -001adc80: 7567 696e 5f69 6e69 7428 3c73 7061 6e20 ugin_init( │ │ │ │ -001adca0: 7374 7275 6374 3c2f 7370 616e 3e20 3c61 struct soap *< │ │ │ │ -001adce0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -001adcf0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ -001add00: 6874 6d6c 223e 736f 6170 3c2f 613e 2c20 html">soap, │ │ │ │ -001add10: 3c73 7061 6e20 636c 6173 733d 226b 6579 struct plugin_data │ │ │ │ -001add40: 2a64 6174 6129 3b20 3c2f 6469 763e 0a3c *data);
    .< │ │ │ │ -001add50: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001add60: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >static
    i │ │ │ │ -001adda0: 6e74 3c2f 7370 616e 3e20 706c 7567 696e nt plugin │ │ │ │ -001addb0: 5f63 6f70 7928 3c73 7061 6e20 636c 6173 _copy(stru │ │ │ │ -001addd0: 6374 3c2f 7370 616e 3e20 3c61 2063 6c61 ct soap *soap, struct │ │ │ │ -001ade60: 736f 6170 5f70 6c75 6769 6e20 2a64 7374 soap_plugin *dst │ │ │ │ -001ade70: 2c20 3c73 7061 6e20 636c 6173 733d 226b , struct soap_plugi │ │ │ │ -001adea0: 6e20 2a73 7263 293b 203c 2f64 6976 3e0a n *src);
    . │ │ │ │ -001adeb0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    static │ │ │ │ -001adf00: 766f 6964 3c2f 7370 616e 3e20 706c 7567 void plug │ │ │ │ -001adf10: 696e 5f64 656c 6574 6528 3c73 7061 6e20 in_delete( │ │ │ │ -001adf30: 7374 7275 6374 3c2f 7370 616e 3e20 3c61 struct soap *< │ │ │ │ -001adf70: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -001adf80: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ -001adf90: 6874 6d6c 223e 736f 6170 3c2f 613e 2c20 html">soap, │ │ │ │ -001adfa0: 3c73 7061 6e20 636c 6173 733d 226b 6579 struct soap_plugin │ │ │ │ -001adfd0: 2a70 293b 203c 2f64 6976 3e0a 3c64 6976 *p);
    .
    static int< │ │ │ │ -001ae030: 2f73 7061 6e3e 2070 6c75 6769 6e5f 7365 /span> plugin_se │ │ │ │ -001ae040: 6e64 283c 7370 616e 2063 6c61 7373 3d22 nd(struct< │ │ │ │ -001ae060: 2f73 7061 6e3e 203c 6120 636c 6173 733d /span> so │ │ │ │ -001ae090: 6170 3c2f 613e 202a 3c61 2063 6c61 7373 ap *s │ │ │ │ -001ae0c0: 6f61 703c 2f61 3e2c 203c 7370 616e 2063 oap, c │ │ │ │ -001ae0e0: 6f6e 7374 3c2f 7370 616e 3e20 3c73 7061 onst char *buf< │ │ │ │ -001ae160: 2f61 3e2c 203c 7370 616e 2063 6c61 7373 /a>, s │ │ │ │ -001ae180: 697a 655f 743c 2f73 7061 6e3e 206c 656e ize_t len │ │ │ │ -001ae190: 293b 203c 2f64 6976 3e0a 3c64 6976 2063 );
    ..
    .
    // the │ │ │ │ -001ae380: 2072 6567 6973 7472 7920 6675 6e63 7469 registry functi │ │ │ │ -001ae390: 6f6e 3a20 3c2f 7370 616e 3e3c 2f64 6976 on:
    .
    in │ │ │ │ -001ae3d0: 743c 2f73 7061 6e3e 2070 6c75 6769 6e28 t plugin( │ │ │ │ -001ae3e0: 3c73 7061 6e20 636c 6173 733d 226b 6579 struct soap< │ │ │ │ -001ae430: 2f61 3e20 2a3c 6120 636c 6173 733d 2263 /a> *soap │ │ │ │ -001ae460: 3c2f 613e 2c20 3c73 7061 6e20 636c 6173 , stru │ │ │ │ -001ae480: 6374 3c2f 7370 616e 3e20 736f 6170 5f70 ct soap_p │ │ │ │ -001ae490: 6c75 6769 6e20 2a70 2c20 3c73 7061 6e20 lugin *p, void │ │ │ │ -001ae4c0: 2a61 7267 2920 3c2f 6469 763e 0a3c 6469 *arg)
    .{ │ │ │ │ -001ae4e0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    p-> │ │ │ │ -001ae500: 3b69 6420 3d20 706c 7567 696e 5f69 643b ;id = plugin_id; │ │ │ │ -001ae510: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    p-&g │ │ │ │ -001ae530: 743b 6461 7461 203d 2028 3c73 7061 6e20 t;data = (void* │ │ │ │ -001ae560: 296d 616c 6c6f 6328 3c73 7061 6e20 636c )malloc(si │ │ │ │ -001ae580: 7a65 6f66 3c2f 7370 616e 3e28 3c73 7061 zeof(struct │ │ │ │ -001ae5b0: 706c 7567 696e 5f64 6174 6129 293b 203c plugin_data)); < │ │ │ │ -001ae5c0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    p-> │ │ │ │ -001ae5e0: 6663 6f70 7920 3d20 706c 7567 696e 5f63 fcopy = plugin_c │ │ │ │ -001ae5f0: 6f70 793b 203c 7370 616e 2063 6c61 7373 opy; /* op │ │ │ │ -001ae610: 7469 6f6e 616c 3a20 7768 656e 2073 6574 tional: when set │ │ │ │ -001ae620: 2074 6865 2070 6c75 6769 6e20 6d75 7374 the plugin must │ │ │ │ -001ae630: 2063 6f70 7920 6974 7320 6c6f 6361 6c20 copy its local │ │ │ │ -001ae640: 6461 7461 202a 2f3c 2f73 7061 6e3e 3c2f data */.
    p->f │ │ │ │ -001ae670: 6465 6c65 7465 203d 2070 6c75 6769 6e5f delete = plugin_ │ │ │ │ -001ae680: 6465 6c65 7465 3b20 3c2f 6469 763e 0a3c delete;
    .< │ │ │ │ -001ae690: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001ae6a0: 3e20 203c 7370 616e 2063 6c61 7373 3d22 > if< │ │ │ │ -001ae6c0: 2f73 7061 6e3e 2028 702d 2667 743b 6461 /span> (p->da │ │ │ │ -001ae6d0: 7461 2920 3c2f 6469 763e 0a3c 6469 7620 ta)
    .
    { │ │ │ │ -001ae6f0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    if │ │ │ │ -001ae730: 2028 706c 7567 696e 5f69 6e69 7428 3c61 (plugin_init(soap, ( │ │ │ │ -001ae770: 3c73 7061 6e20 636c 6173 733d 226b 6579 struct plugin_data* │ │ │ │ -001ae7a0: 2970 2d26 6774 3b64 6174 6129 2920 3c2f )p->data)) .
    {.
    free( │ │ │ │ -001ae7f0: 702d 2667 743b 6461 7461 293b 203c 7370 p->data); // error: cou │ │ │ │ -001ae820: 6c64 206e 6f74 2069 6e69 7420 3c2f 7370 ld not init
    .
    │ │ │ │ -001ae850: 2020 3c73 7061 6e20 636c 6173 733d 226b retu │ │ │ │ -001ae870: 726e 3c2f 7370 616e 3e20 3c61 2063 6c61 rn SO │ │ │ │ -001ae8d0: 4150 5f45 4f4d 3c2f 613e 3b20 3c73 7061 AP_EOM; // return erro │ │ │ │ -001ae900: 7220 3c2f 7370 616e 3e3c 2f64 6976 3e0a r
    . │ │ │ │ -001ae910: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    }
    .< │ │ │ │ -001ae930: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001ae940: 3e20 207d 3c2f 6469 763e 0a3c 6469 7620 > }
    .
    < │ │ │ │ -001ae960: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -001ae970: 6f72 6466 6c6f 7722 3e72 6574 7572 6e3c ordflow">return< │ │ │ │ -001ae980: 2f73 7061 6e3e 203c 6120 636c 6173 733d /span> SOAP_ │ │ │ │ -001ae9e0: 4f4b 3c2f 613e 3b20 3c2f 6469 763e 0a3c OK;
    .< │ │ │ │ -001ae9f0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001aea00: 3e7d 203c 2f64 6976 3e0a 3c64 6976 2063 >}
    .
    .
    stat │ │ │ │ -001aea50: 6963 3c2f 7370 616e 3e20 3c73 7061 6e20 ic int p │ │ │ │ -001aea80: 6c75 6769 6e5f 696e 6974 283c 7370 616e lugin_init(struct < │ │ │ │ -001aeab0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -001aeac0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ -001aead0: 6874 6d6c 223e 736f 6170 3c2f 613e 202a html">soap * │ │ │ │ -001aeae0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap, │ │ │ │ -001aeb10: 203c 7370 616e 2063 6c61 7373 3d22 6b65 struct plugin_data │ │ │ │ -001aeb40: 202a 6461 7461 2920 3c2f 6469 763e 0a3c *data)
    .< │ │ │ │ -001aeb50: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001aeb60: 3e7b 3c2f 6469 763e 0a3c 6469 7620 636c >{
    .
    dat │ │ │ │ -001aeb80: 612d 2667 743b 6673 656e 6420 3d20 3c61 a->fsend = soap-&g │ │ │ │ -001aebc0: 743b 3c61 2063 6c61 7373 3d22 636f 6465 t;fsend; // sav │ │ │ │ -001aec40: 6520 6f6c 6420 7265 6376 2063 616c 6c62 e old recv callb │ │ │ │ -001aec50: 6163 6b20 3c2f 7370 616e 3e3c 2f64 6976 ack
    .
    .
    < │ │ │ │ -001aed70: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -001aed80: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ -001aed90: 6874 6d6c 223e 736f 6170 3c2f 613e 2d26 html">soap-& │ │ │ │ -001aeda0: 6774 3b3c 6120 636c 6173 733d 2263 6f64 gt;fsend< │ │ │ │ -001aee00: 2f61 3e20 3d20 706c 7567 696e 5f73 656e /a> = plugin_sen │ │ │ │ -001aee10: 643b 203c 7370 616e 2063 6c61 7373 3d22 d; // repl │ │ │ │ -001aee30: 6163 6520 7365 6e64 2063 616c 6c62 6163 ace send callbac │ │ │ │ -001aee40: 6b20 7769 7468 206e 6577 203c 2f73 7061 k with new
    .
    soap-> │ │ │ │ -001aeea0: 3b3c 6120 636c 6173 733d 2263 6f64 6522 ;frecv = plugin_recv; │ │ │ │ -001aef10: 203c 7370 616e 2063 6c61 7373 3d22 636f // replac │ │ │ │ -001aef30: 6520 7265 6376 2063 616c 6c62 6163 6b20 e recv callback │ │ │ │ -001aef40: 7769 7468 206e 6577 203c 2f73 7061 6e3e with new │ │ │ │ -001aef50: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    return SOAP_OK;
    .
    } < │ │ │ │ -001af010: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    . │ │ │ │ -001af030: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    // copy │ │ │ │ -001af060: 706c 7567 696e 2064 6174 612c 2063 616c plugin data, cal │ │ │ │ -001af070: 6c65 6420 6279 2073 6f61 705f 636f 7079 led by soap_copy │ │ │ │ -001af080: 2829 3c2f 7370 616e 3e3c 2f64 6976 3e0a ()
    . │ │ │ │ -001af090: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    // This │ │ │ │ -001af0c0: 6973 2069 6d70 6f72 7461 6e74 3a20 7765 is important: we │ │ │ │ -001af0d0: 206e 6565 6420 6120 6465 6570 2063 6f70 need a deep cop │ │ │ │ -001af0e0: 7920 746f 2061 766f 6964 2064 6174 6120 y to avoid data │ │ │ │ -001af0f0: 7368 6172 696e 6720 6279 2074 776f 2063 sharing by two c │ │ │ │ -001af100: 6f6e 7465 7874 7320 3c2f 7370 616e 3e3c ontexts < │ │ │ │ -001af110: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    st │ │ │ │ -001af140: 6174 6963 3c2f 7370 616e 3e20 3c73 7061 atic int │ │ │ │ -001af170: 2070 6c75 6769 6e5f 636f 7079 283c 7370 plugin_copy(struct │ │ │ │ -001af1a0: 203c 6120 636c 6173 733d 2263 6f64 6522 soap │ │ │ │ -001af1d0: 202a 3c61 2063 6c61 7373 3d22 636f 6465 *soap, struct< │ │ │ │ -001af220: 2f73 7061 6e3e 2073 6f61 705f 706c 7567 /span> soap_plug │ │ │ │ -001af230: 696e 202a 6473 742c 203c 7370 616e 2063 in *dst, s │ │ │ │ -001af250: 7472 7563 743c 2f73 7061 6e3e 2073 6f61 truct soa │ │ │ │ -001af260: 705f 706c 7567 696e 202a 7372 6329 203c p_plugin *src) < │ │ │ │ -001af270: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    {
    . │ │ │ │ -001af290: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    if │ │ │ │ -001af2c0: 3c2f 7370 616e 3e20 2821 2864 7374 2d26 (!(dst-& │ │ │ │ -001af2d0: 6774 3b64 6174 6120 3d20 283c 7370 616e gt;data = (struct p │ │ │ │ -001af300: 6c75 6769 6e5f 6461 7461 2a29 6d61 6c6c lugin_data*)mall │ │ │ │ -001af310: 6f63 283c 7370 616e 2063 6c61 7373 3d22 oc(sizeof< │ │ │ │ -001af330: 2f73 7061 6e3e 283c 7370 616e 2063 6c61 /span>(str │ │ │ │ -001af350: 7563 743c 2f73 7061 6e3e 2070 6c75 6769 uct plugi │ │ │ │ -001af360: 6e5f 6461 7461 2929 2929 203c 2f64 6976 n_data))))
    .
    return │ │ │ │ -001af3b0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 SOAP_EOM │ │ │ │ -001af410: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
    .
    *ds │ │ │ │ -001af430: 742d 2667 743b 6461 7461 203d 202a 7372 t->data = *sr │ │ │ │ -001af440: 632d 2667 743b 6461 7461 3b20 3c2f 6469 c->data; .
    return < │ │ │ │ -001af490: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -001af4a0: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ │ -001af4b0: 705f 5f65 7272 6f72 732e 6874 6d6c 2367 p__errors.html#g │ │ │ │ -001af4c0: 6133 6231 3061 3638 6633 3534 6633 3963 a3b10a68f354f39c │ │ │ │ -001af4d0: 6262 3066 6530 6430 3433 6164 3463 3763 bb0fe0d043ad4c7c │ │ │ │ -001af4e0: 3022 3e53 4f41 505f 4f4b 3c2f 613e 3b20 0">SOAP_OK; │ │ │ │ -001af4f0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    }
    .
    .
    // plugin de │ │ │ │ -001af560: 6c65 7469 6f6e 2c20 6361 6c6c 6564 2062 letion, called b │ │ │ │ -001af570: 7920 736f 6170 5f64 6f6e 6528 2920 3c2f y soap_done()
    .
    static void │ │ │ │ -001af5e0: 3c2f 7370 616e 3e20 706c 7567 696e 5f64 plugin_d │ │ │ │ -001af5f0: 656c 6574 6528 3c73 7061 6e20 636c 6173 elete(stru │ │ │ │ -001af610: 6374 3c2f 7370 616e 3e20 3c61 2063 6c61 ct soap *soap, struct │ │ │ │ -001af6a0: 736f 6170 5f70 6c75 6769 6e20 2a70 2920 soap_plugin *p) │ │ │ │ -001af6b0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    {
    │ │ │ │ -001af6d0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    free(p-> │ │ │ │ -001af6f0: 6461 7461 293b 203c 7370 616e 2063 6c61 data); // │ │ │ │ -001af710: 6672 6565 2061 6c6c 6f63 6174 6564 2070 free allocated p │ │ │ │ -001af720: 6c75 6769 6e20 6461 7461 203c 2f73 7061 lugin data
    .
    } .
    . │ │ │ │ -001af780: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // the new │ │ │ │ -001af7a0: 2073 656e 6420 6361 6c6c 6261 636b 203c send callback < │ │ │ │ -001af7b0: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    .< │ │ │ │ -001af7d0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -001af7e0: 6f72 6422 3e73 7461 7469 633c 2f73 7061 ord">static int │ │ │ │ -001af810: 3c2f 7370 616e 3e20 706c 7567 696e 5f73 plugin_s │ │ │ │ -001af820: 656e 6428 3c73 7061 6e20 636c 6173 733d end(struct │ │ │ │ -001af840: 3c2f 7370 616e 3e20 3c61 2063 6c61 7373 s │ │ │ │ -001af870: 6f61 703c 2f61 3e20 2a3c 6120 636c 6173 oap * │ │ │ │ -001af8a0: 736f 6170 3c2f 613e 2c20 3c73 7061 6e20 soap, │ │ │ │ -001af8c0: 636f 6e73 743c 2f73 7061 6e3e 203c 7370 const char *buf │ │ │ │ -001af940: 3c2f 613e 2c20 3c73 7061 6e20 636c 6173 , │ │ │ │ -001af960: 7369 7a65 5f74 3c2f 7370 616e 3e20 6c65 size_t le │ │ │ │ -001af970: 6e29 203c 2f64 6976 3e0a 3c64 6976 2063 n)
    .
    {.
    st │ │ │ │ -001af9c0: 7275 6374 203c 2f73 7061 6e3e 706c 7567 ruct plug │ │ │ │ -001af9d0: 696e 5f64 6174 6120 2a64 6174 6120 3d20 in_data *data = │ │ │ │ -001af9e0: 283c 7370 616e 2063 6c61 7373 3d22 6b65 (struct plugin_data │ │ │ │ -001afa10: 2a29 736f 6170 5f6c 6f6f 6b75 705f 706c *)soap_lookup_pl │ │ │ │ -001afa20: 7567 696e 283c 6120 636c 6173 733d 2263 ugin(soap │ │ │ │ -001afa50: 3c2f 613e 2c20 706c 7567 696e 5f69 6429 , plugin_id) │ │ │ │ -001afa60: 3b20 3c73 7061 6e20 636c 6173 733d 2263 ; // fetch │ │ │ │ -001afa80: 2070 6c75 6769 6e26 2333 393b 7320 6c6f plugin's lo │ │ │ │ -001afa90: 6361 6c20 6461 7461 203c 2f73 7061 6e3e cal data │ │ │ │ -001afaa0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    fwrit │ │ │ │ -001afac0: 6528 6275 662c 206c 656e 2c20 312c 2073 e(buf, len, 1, s │ │ │ │ -001afad0: 7464 6572 7229 3b20 3c73 7061 6e20 636c tderr); // │ │ │ │ -001afaf0: 2077 7269 7465 206d 6573 7361 6765 2074 write message t │ │ │ │ -001afb00: 6f20 7374 6465 7272 203c 2f73 7061 6e3e o stderr │ │ │ │ -001afb10: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    return data->fsen │ │ │ │ -001afb60: 6428 3c61 2063 6c61 7373 3d22 636f 6465 d(soap, buf, len); // pass data │ │ │ │ -001afbc0: 206f 6e20 746f 206f 6c64 2073 656e 6420 on to old send │ │ │ │ -001afbd0: 6361 6c6c 6261 636b 203c 2f73 7061 6e3e callback │ │ │ │ -001afbe0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    }
    .
    .
    // the new r │ │ │ │ -001afc50: 6563 6569 7665 2063 616c 6c62 6163 6b20 eceive callback │ │ │ │ -001afc60: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ │ -001afc80: 3c73 7061 6e20 636c 6173 733d 226b 6579 static si │ │ │ │ -001afcc0: 7a65 5f74 3c2f 7370 616e 3e20 706c 7567 ze_t plug │ │ │ │ -001afcd0: 696e 5f72 6563 7628 3c73 7061 6e20 636c in_recv(st │ │ │ │ -001afcf0: 7275 6374 3c2f 7370 616e 3e20 3c61 2063 ruct soap *soap, char *buf, size_t len)
    . │ │ │ │ -001afdd0: 7b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 {
    .
    struct │ │ │ │ -001afe10: 706c 7567 696e 5f64 6174 6120 2a64 6174 plugin_data *dat │ │ │ │ -001afe20: 6120 3d20 283c 7370 616e 2063 6c61 7373 a = (struc │ │ │ │ -001afe40: 7420 3c2f 7370 616e 3e70 6c75 6769 6e5f t plugin_ │ │ │ │ -001afe50: 6461 7461 2a29 736f 6170 5f6c 6f6f 6b75 data*)soap_looku │ │ │ │ -001afe60: 705f 706c 7567 696e 283c 6120 636c 6173 p_plugin( │ │ │ │ -001afe90: 736f 6170 3c2f 613e 2c20 706c 7567 696e soap, plugin │ │ │ │ -001afea0: 5f69 6429 3b20 3c73 7061 6e20 636c 6173 _id); // f │ │ │ │ -001afec0: 6574 6368 2070 6c75 6769 6e26 2333 393b etch plugin' │ │ │ │ -001afed0: 7320 6c6f 6361 6c20 6461 7461 203c 2f73 s local data
    .
    < │ │ │ │ -001aff00: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -001aff10: 6f72 6474 7970 6522 3e73 697a 655f 743c ordtype">size_t< │ │ │ │ -001aff20: 2f73 7061 6e3e 2072 6573 203d 2064 6174 /span> res = dat │ │ │ │ -001aff30: 612d 2667 743b 6672 6563 7628 3c61 2063 a->frecv(soap, buf │ │ │ │ -001aff70: 2c20 6c65 6e29 3b20 3c73 7061 6e20 636c , len); // │ │ │ │ -001aff90: 2067 6574 2064 6174 6120 6672 6f6d 206f get data from o │ │ │ │ -001affa0: 6c64 2072 6563 7620 6361 6c6c 6261 636b ld recv callback │ │ │ │ -001affb0: 203c 2f73 7061 6e3e 3c2f 6469 763e 0a3c
    .< │ │ │ │ -001affc0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001affd0: 3e20 2066 7772 6974 6528 6275 662c 2072 > fwrite(buf, r │ │ │ │ -001affe0: 6573 2c20 312c 2073 7464 6572 7229 3b20 es, 1, stderr); │ │ │ │ -001afff0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    return res;
    .< │ │ │ │ -001b0040: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001b0050: 3e7d 3c2f 6469 763e 0a3c 6469 7620 636c >}
    .
    #d │ │ │ │ -001b0130: 6566 696e 6520 534f 4150 5f45 4f4d 3c2f efine SOAP_EOM
    A soap_st │ │ │ │ -001b0160: 6174 7573 2065 7272 6f72 2063 6f64 653a atus error code: │ │ │ │ -001b0170: 206f 7574 206f 6620 6d65 6d6f 7279 2e3c out of memory.< │ │ │ │ -001b0180: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
    Defin │ │ │ │ -001b01a0: 6974 696f 6e3a 3c2f 623e 2073 7464 736f ition: stdso │ │ │ │ -001b01b0: 6170 322e 683a 3233 3731 3c2f 6469 763e ap2.h:2371
    │ │ │ │ -001b01c0: 3c2f 6469 763e 0a3c 2f64 6976 3e3c 212d
    .

    It is the respo │ │ │ │ -001b01f0: 6e73 6962 696c 6974 7920 6f66 2074 6865 nsibility of the │ │ │ │ -001b0200: 2070 6c75 6769 6e20 746f 2068 616e 646c plugin to handl │ │ │ │ -001b0210: 6520 7265 6769 7374 7279 2028 696e 6974 e registry (init │ │ │ │ -001b0220: 292c 2063 6f70 792c 2061 6e64 2064 656c ), copy, and del │ │ │ │ -001b0230: 6574 696f 6e20 6f66 2074 6865 2070 6c75 etion of the plu │ │ │ │ -001b0240: 6769 6e20 6461 7461 2061 6e64 2072 6573 gin data and res │ │ │ │ -001b0250: 6574 2063 616c 6c62 6163 6b73 2e3c 2f70 et callbacks.

    .

    The f │ │ │ │ -001b0270: 6465 6c65 7465 3c2f 636f 6465 3e20 6361 delete ca │ │ │ │ -001b0280: 6c6c 6261 636b 206f 6620 3c63 6f64 653e llback of │ │ │ │ -001b0290: 7374 7275 6374 2073 6f61 705f 706c 7567 struct soap_plug │ │ │ │ -001b02a0: 696e 3c2f 636f 6465 3e20 6d75 7374 2062 in must b │ │ │ │ -001b02b0: 6520 7365 7420 746f 2064 652d 7265 6769 e set to de-regi │ │ │ │ -001b02c0: 7374 6572 2074 6865 2070 6c75 6769 6e20 ster the plugin │ │ │ │ -001b02d0: 616e 6420 6c65 7420 6974 2064 656c 6574 and let it delet │ │ │ │ -001b02e0: 6520 6974 7320 7265 736f 7572 6365 732e e its resources. │ │ │ │ -001b02f0: 3c2f 703e 0a3c 703e 4120 706c 7567 696e

    .

    A plugin │ │ │ │ -001b0300: 2069 7320 636f 7069 6564 2061 6c6f 6e67 is copied along │ │ │ │ -001b0310: 2077 6974 6820 6974 7320 636f 7272 6573 with its corres │ │ │ │ -001b0320: 706f 6e64 696e 6720 3c63 6f64 653e 3c61 ponding soap contex │ │ │ │ -001b0390: 7420 7769 7468 2074 6865 203c 636f 6465 t with the soap │ │ │ │ -001b0450: 5f63 6f70 793c 2f61 3e3c 2f63 6f64 653e _copy │ │ │ │ -001b0460: 2063 616c 6c2e 2054 6869 7320 6675 6e63 call. This func │ │ │ │ -001b0470: 7469 6f6e 2063 6f70 6965 7320 6120 3c63 tion copies a │ │ │ │ -001b04d0: 736f 6170 3c2f 613e 3c2f 636f 6465 3e20 soap │ │ │ │ -001b04e0: 636f 6e74 6578 7420 616e 6420 7468 6520 context and the │ │ │ │ -001b04f0: 6368 6169 6e20 6f66 2070 6c75 6769 6e73 chain of plugins │ │ │ │ -001b0500: 2e20 4974 2069 7320 7570 2074 6f20 7468 . It is up to th │ │ │ │ -001b0510: 6520 706c 7567 696e 2069 6d70 6c65 6d65 e plugin impleme │ │ │ │ -001b0520: 6e74 6174 696f 6e20 746f 2073 6861 7265 ntation to share │ │ │ │ -001b0530: 2074 6865 2070 6c75 6769 6e20 6461 7461 the plugin data │ │ │ │ -001b0540: 206f 7220 6e6f 7420 6173 2066 6f6c 6c6f or not as follo │ │ │ │ -001b0550: 7773 3a3c 2f70 3e0a 3c75 6c3e 0a3c 6c69 ws:

    .

    This declares < │ │ │ │ -001b1750: 636f 6465 3e78 7364 5f5f 616e 7954 7970 code>xsd__anyTyp │ │ │ │ -001b1760: 653c 2f63 6f64 653e 2061 6e64 203c 636f e and xsd__anyAttri │ │ │ │ -001b1780: 6275 7465 3c2f 636f 6465 3e20 7479 7065 bute type │ │ │ │ -001b1790: 732e 3c2f 703e 0a3c 703e 4120 444f 4d20 s.

    .

    A DOM │ │ │ │ -001b17a0: 656c 656d 656e 7420 6e6f 6465 2069 7320 element node is │ │ │ │ -001b17b0: 7365 7269 616c 697a 6564 2077 6974 6820 serialized with │ │ │ │ -001b17c0: 7468 6520 3c63 6f64 653e 7873 645f 5f61 the xsd__a │ │ │ │ -001b17d0: 6e79 5479 7065 3c2f 636f 6465 3e20 7365 nyType se │ │ │ │ -001b17e0: 7269 616c 697a 6162 6c65 2074 7970 652e rializable type. │ │ │ │ -001b17f0: 2054 6865 2075 6e64 6572 6c79 696e 6720 The underlying │ │ │ │ -001b1800: 696d 706c 656d 656e 7461 7469 6f6e 2074 implementation t │ │ │ │ -001b1810: 7970 6520 6f66 203c 636f 6465 3e78 7364 ype of xsd │ │ │ │ -001b1820: 5f5f 616e 7954 7970 653c 2f63 6f64 653e __anyType │ │ │ │ -001b1830: 2069 7320 3c63 6f64 653e 736f 6170 5f64 is soap_d │ │ │ │ -001b1840: 6f6d 5f65 6c65 6d65 6e74 3c2f 636f 6465 om_element. One or more D │ │ │ │ -001b1860: 4f4d 2061 7474 7269 6275 7465 206e 6f64 OM attribute nod │ │ │ │ -001b1870: 6573 2061 7265 2073 6572 6961 6c69 7a65 es are serialize │ │ │ │ -001b1880: 6420 7769 7468 2074 6865 203c 636f 6465 d with the xsd__anyAttribu │ │ │ │ -001b18a0: 7465 3c2f 636f 6465 3e20 7365 7269 616c te serial │ │ │ │ -001b18b0: 697a 6162 6c65 2074 7970 652e 2054 6865 izable type. The │ │ │ │ -001b18c0: 2075 6e64 6572 6c79 696e 6720 696d 706c underlying impl │ │ │ │ -001b18d0: 656d 656e 7461 7469 6f6e 2074 7970 6520 ementation type │ │ │ │ -001b18e0: 6f66 203c 636f 6465 3e78 7364 5f5f 616e of xsd__an │ │ │ │ -001b18f0: 7941 7474 7269 6275 7465 3c2f 636f 6465 yAttribute is soap_ │ │ │ │ -001b1910: 646f 6d5f 6174 7472 6962 7574 653c 2f63 dom_attribute, which is a │ │ │ │ -001b1930: 206c 696e 6b65 6420 6c69 7374 2e3c 2f70 linked list.

    .
    #import &qu │ │ │ │ -001b1990: 6f74 3b64 6f6d 2e68 2671 756f 743b 3c2f ot;dom.h" // i │ │ │ │ -001b19c0: 6d70 6f72 7473 2078 7364 5f5f 616e 7954 mports xsd__anyT │ │ │ │ -001b19d0: 7970 6520 6173 2061 2044 4f4d 206e 6f64 ype as a DOM nod │ │ │ │ -001b19e0: 653c 2f73 7061 6e3e 3c2f 6469 763e 0a3c e
    .< │ │ │ │ -001b19f0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001b1a00: 3e20 3c2f 6469 763e 0a3c 6469 7620 636c >
    .
    class ns │ │ │ │ -001b1a40: 5f5f 6461 7461 203a 203c 7370 616e 2063 __data : p │ │ │ │ -001b1a60: 7562 6c69 633c 2f73 7061 6e3e 2078 7364 ublic xsd │ │ │ │ -001b1a70: 5f5f 616e 7954 7970 653c 2f64 6976 3e0a __anyType
    . │ │ │ │ -001b1a80: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    { public │ │ │ │ -001b1ab0: 3c2f 7370 616e 3e3a 3c2f 6469 763e 0a3c :
    .< │ │ │ │ -001b1ac0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001b1ad0: 3e20 2020 2078 7364 5f5f 616e 7954 7970 > xsd__anyTyp │ │ │ │ -001b1ae0: 652a 2066 6f6f 3b20 2020 2020 2020 2020 e* foo; │ │ │ │ -001b1af0: 2020 2020 2020 203c 7370 616e 2063 6c61 // │ │ │ │ -001b1b10: 5374 6f72 6520 266c 743b 666f 6f26 6774 Store <foo> │ │ │ │ -001b1b20: 3b20 656c 656d 656e 7420 696e 2044 4f4d ; element in DOM │ │ │ │ -001b1b30: 2073 6f61 705f 646f 6d5f 656c 656d 656e soap_dom_elemen │ │ │ │ -001b1b40: 743c 2f73 7061 6e3e 3c2f 6469 763e 0a3c t
    .< │ │ │ │ -001b1b50: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001b1b60: 3e20 2020 2078 7364 5f5f 616e 7954 7970 > xsd__anyTyp │ │ │ │ -001b1b70: 6520 5f5f 616e 793b 2020 2020 2020 2020 e __any; │ │ │ │ -001b1b80: 2020 2020 2020 203c 7370 616e 2063 6c61 // │ │ │ │ -001b1ba0: 5374 6f72 6520 616e 7920 656c 656d 656e Store any elemen │ │ │ │ -001b1bb0: 7420 636f 6e74 656e 7420 696e 2044 4f4d t content in DOM │ │ │ │ -001b1bc0: 2073 6f61 705f 646f 6d5f 656c 656d 656e soap_dom_elemen │ │ │ │ -001b1bd0: 743c 2f73 7061 6e3e 3c2f 6469 763e 0a3c t.< │ │ │ │ -001b1be0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001b1bf0: 3e20 2040 2078 7364 5f5f 616e 7941 7474 > @ xsd__anyAtt │ │ │ │ -001b1c00: 7269 6275 7465 205f 5f61 6e79 4174 7472 ribute __anyAttr │ │ │ │ -001b1c10: 6962 7574 653b 203c 7370 616e 2063 6c61 ibute; // │ │ │ │ -001b1c30: 5374 6f72 6520 616e 7941 7474 7269 6275 Store anyAttribu │ │ │ │ -001b1c40: 7465 2063 6f6e 7465 6e74 2069 6e20 444f te content in DO │ │ │ │ -001b1c50: 4d20 736f 6170 5f64 6f6d 5f61 7474 7269 M soap_dom_attri │ │ │ │ -001b1c60: 6275 7465 206c 696e 6b65 6420 6e6f 6465 bute linked node │ │ │ │ -001b1c70: 2073 7472 7563 7475 7265 3c2f 7370 616e structure.
    };.

    To │ │ │ │ -001b1cc0: 6d61 6e69 7075 6c61 7465 2074 6865 2044 manipulate the D │ │ │ │ -001b1cd0: 4f4d 2065 6c65 6d65 6e74 7320 616e 6420 OM elements and │ │ │ │ -001b1ce0: 6174 7472 6962 7574 6573 2077 6520 7573 attributes we us │ │ │ │ -001b1cf0: 6520 7468 6520 444f 4d20 4150 4920 6675 e the DOM API fu │ │ │ │ -001b1d00: 6e63 7469 6f6e 7320 646f 6375 6d65 6e74 nctions document │ │ │ │ -001b1d10: 6564 2069 6e20 7468 6520 6753 4f41 5020 ed in the gSOAP │ │ │ │ -001b1d20: 3c61 2068 7265 663d 222e 2e2f 2e2e 2f64 XML DOM API │ │ │ │ -001b1d50: 646f 6375 6d65 6e74 6174 696f 6e3c 2f61 documentation.

    .

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

    .

    .The m │ │ │ │ -001b1dd0: 6573 7361 6765 206c 6f67 6769 6e67 2070 essage logging p │ │ │ │ -001b1de0: 6c75 6769 6e3c 2f68 333e 0a3c 703e 5468 lugin

    .

    Th │ │ │ │ -001b1df0: 6520 6d65 7373 6167 6520 3c63 6f64 653e e message │ │ │ │ -001b1e00: 3c61 2063 6c61 7373 3d22 656c 2220 6872 logging plugin can │ │ │ │ -001b1ea0: 2062 6520 7573 6564 2074 6f20 7365 6c65 be used to sele │ │ │ │ -001b1eb0: 6374 6976 656c 7920 6c6f 6720 696e 626f ctively log inbo │ │ │ │ -001b1ec0: 756e 6420 616e 6420 6f75 7462 6f75 6e64 und and outbound │ │ │ │ -001b1ed0: 206d 6573 7361 6765 7320 746f 2061 2066 messages to a f │ │ │ │ -001b1ee0: 696c 6520 6f72 2073 7472 6561 6d2e 2049 ile or stream. I │ │ │ │ -001b1ef0: 7420 616c 736f 206b 6565 7073 2061 6363 t also keeps acc │ │ │ │ -001b1f00: 6573 7320 7374 6174 6973 7469 6373 2074 ess statistics t │ │ │ │ -001b1f10: 6f20 6c6f 6720 7468 6520 746f 7461 6c20 o log the total │ │ │ │ -001b1f20: 6e75 6d62 6572 206f 6620 6279 7465 7320 number of bytes │ │ │ │ -001b1f30: 7365 6e74 2061 6e64 2072 6563 6569 7665 sent and receive │ │ │ │ -001b1f40: 642e 3c2f 703e 0a3c 703e 546f 2075 7365 d.

    .

    To use │ │ │ │ -001b1f50: 2074 6865 2070 6c75 6769 6e2c 2063 6f6d the plugin, com │ │ │ │ -001b1f60: 7069 6c65 2061 6e64 206c 696e 6b20 796f pile and link yo │ │ │ │ -001b1f70: 7572 2061 7070 6c69 6361 7469 6f6e 2077 ur application w │ │ │ │ -001b1f80: 6974 6820 3c65 6d3e 3c63 6f64 653e 6c6f ith lo │ │ │ │ -001b1f90: 6767 696e 672e 633c 2f63 6f64 653e 3c2f gging.c located in t │ │ │ │ -001b1fb0: 6865 203c 656d 3e3c 636f 6465 3e67 736f he gso │ │ │ │ -001b1fc0: 6170 2f70 6c75 6769 6e3c 2f63 6f64 653e ap/plugin │ │ │ │ -001b1fd0: 3c2f 656d 3e20 6469 7265 6374 6f72 7920 directory │ │ │ │ -001b1fe0: 6f66 2074 6865 2067 534f 4150 2070 6163 of the gSOAP pac │ │ │ │ -001b1ff0: 6b61 6765 2e20 546f 2065 6e61 626c 6520 kage. To enable │ │ │ │ -001b2000: 7468 6520 706c 7567 696e 2069 6e20 796f the plugin in yo │ │ │ │ -001b2010: 7572 2063 6f64 652c 2072 6567 6973 7465 ur code, registe │ │ │ │ -001b2020: 7220 7468 6520 706c 7567 696e 2061 6e64 r the plugin and │ │ │ │ -001b2030: 2073 6574 2074 6865 2073 7472 6561 6d73 set the streams │ │ │ │ -001b2040: 2061 7320 666f 6c6c 6f77 733a 3c2f 703e as follows:

    │ │ │ │ -001b2050: 0a3c 6469 7620 636c 6173 733d 2266 7261 .
    #include &qu │ │ │ │ -001b20a0: 6f74 3b6c 6f67 6769 6e67 2e68 2671 756f ot;logging.h&quo │ │ │ │ -001b20b0: 743b 3c2f 7370 616e 3e20 3c2f 6469 763e t;
    │ │ │ │ -001b20c0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    .
    struct soap │ │ │ │ -001b2140: 202a 3c61 2063 6c61 7373 3d22 636f 6465 *soap = soap_ne │ │ │ │ -001b21d0: 773c 2f61 3e28 293b 3c2f 6469 763e 0a3c w();
    .< │ │ │ │ -001b21e0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001b21f0: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >size_ │ │ │ │ -001b2210: 743c 2f73 7061 6e3e 2062 7974 6573 5f69 t bytes_i │ │ │ │ -001b2220: 6e3b 203c 2f64 6976 3e0a 3c64 6976 2063 n;
    .
    size_t bytes_out; < │ │ │ │ -001b2270: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    if (soap_register_p │ │ │ │ -001b2310: 6c75 6769 6e3c 2f61 3e28 3c61 2063 6c61 lugin(soap, lo │ │ │ │ -001b23a0: 6767 696e 673c 2f61 3e29 2920 3c2f 6469 gging)) .
    ... // failed to re │ │ │ │ -001b23f0: 6769 7374 6572 203c 2f73 7061 6e3e 3c2f gister .
    ... //
    │ │ │ │ -001b2440: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    soap_set_l │ │ │ │ -001b24b0: 6f67 6769 6e67 5f69 6e62 6f75 6e64 3c2f ogging_inbound(soap, stdout); ..
    ... // process m │ │ │ │ -001b2600: 6573 7361 6765 733c 2f73 7061 6e3e 3c2f essages.
    soap_s │ │ │ │ -001b2680: 6574 5f6c 6f67 6769 6e67 5f69 6e62 6f75 et_logging_inbou │ │ │ │ -001b2690: 6e64 3c2f 613e 283c 6120 636c 6173 733d nd(so │ │ │ │ -001b26c0: 6170 3c2f 613e 2c20 4e55 4c4c 293b 203c ap, NULL); < │ │ │ │ -001b26d0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ -001b26e0: 656e 7422 3e2f 2f20 6469 7361 626c 6520 ent">// disable │ │ │ │ -001b26f0: 6c6f 6767 696e 6720 3c2f 7370 616e 3e3c logging < │ │ │ │ -001b2700: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    soap_ │ │ │ │ -001b2770: 7365 745f 6c6f 6767 696e 675f 6f75 7462 set_logging_outb │ │ │ │ -001b2780: 6f75 6e64 3c2f 613e 283c 6120 636c 6173 ound( │ │ │ │ -001b27b0: 736f 6170 3c2f 613e 2c20 4e55 4c4c 293b soap, NULL); │ │ │ │ -001b27c0: 203c 7370 616e 2063 6c61 7373 3d22 636f // disabl │ │ │ │ -001b27e0: 6520 6c6f 6767 696e 6720 3c2f 7370 616e e logging
    ..
    ... │ │ │ │ -001b28e0: 203c 7370 616e 2063 6c61 7373 3d22 636f // │ │ │ │ -001b2900: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    │ │ │ │ -001b29c0: 0a3c 6469 7620 636c 6173 733d 2274 7463 .
    void soap_s │ │ │ │ -001b2ab0: 6574 5f6c 6f67 6769 6e67 5f6f 7574 626f et_logging_outbo │ │ │ │ -001b2ac0: 756e 6428 7374 7275 6374 2073 6f61 7020 und(struct soap │ │ │ │ -001b2ad0: 2a73 6f61 702c 2046 494c 4520 2a66 6429 *soap, FILE *fd) │ │ │ │ -001b2ae0: 3c2f 6469 763e 3c64 6976 2063 6c61 7373
    Specify │ │ │ │ -001b2b00: 206f 7574 626f 756e 6420 6d65 7373 6167 outbound messag │ │ │ │ -001b2b10: 6520 6c6f 6767 696e 6720 7769 7468 2074 e logging with t │ │ │ │ -001b2b20: 6865 206c 6f67 6769 6e67 2070 6c75 6769 he logging plugi │ │ │ │ -001b2b30: 6e2e 3c2f 6469 763e 3c2f 6469 763e 0a3c n.
    .< │ │ │ │ -001b2b40: 6469 7620 636c 6173 733d 2274 7463 2220 div class="ttc" │ │ │ │ -001b2b50: 6964 3d22 6167 726f 7570 5f5f 6772 6f75 id="agroup__grou │ │ │ │ -001b2b60: 705f 5f64 6562 7567 5f68 746d 6c5f 6761 p__debug_html_ga │ │ │ │ -001b2b70: 3439 3635 6132 6435 3861 6563 3461 6533 4965a2d58aec4ae3 │ │ │ │ -001b2b80: 3938 3361 6537 3366 6337 3131 6466 3630 983ae73fc711df60 │ │ │ │ -001b2b90: 223e 3c64 6976 2063 6c61 7373 3d22 7474 ">void soap_rese │ │ │ │ -001b2c30: 745f 6c6f 6767 696e 675f 7374 6174 7328 t_logging_stats( │ │ │ │ -001b2c40: 7374 7275 6374 2073 6f61 7020 2a73 6f61 struct soap *soa │ │ │ │ -001b2c50: 7029 3c2f 6469 763e 3c64 6976 2063 6c61 p)
    Reset │ │ │ │ -001b2c70: 206d 6573 7361 6769 6e67 2073 7461 7469 messaging stati │ │ │ │ -001b2c80: 7374 6963 7320 7769 7468 2074 6865 206c stics with the l │ │ │ │ -001b2c90: 6f67 6769 6e67 2070 6c75 6769 6e2e 3c2f ogging plugin.
    .
    soap_log │ │ │ │ -001b2d60: 6769 6e67 5f73 7461 7473 3c2f 613e 3c2f ging_stats
    void soa │ │ │ │ -001b2d90: 705f 6c6f 6767 696e 675f 7374 6174 7328 p_logging_stats( │ │ │ │ -001b2da0: 7374 7275 6374 2073 6f61 7020 2a73 6f61 struct soap *soa │ │ │ │ -001b2db0: 702c 2073 697a 655f 7420 2a73 656e 742c p, size_t *sent, │ │ │ │ -001b2dc0: 2073 697a 655f 7420 2a72 6563 7629 3c2f size_t *recv)
    Collect m │ │ │ │ -001b2df0: 6573 7361 6769 6e67 2073 7461 7469 7374 essaging statist │ │ │ │ -001b2e00: 6963 7320 7769 7468 2074 6865 206c 6f67 ics with the log │ │ │ │ -001b2e10: 6769 6e67 2070 6c75 6769 6e2e 3c2f 6469 ging plugin.
    .
    │ │ │ │ -001b2e90: 3c61 2068 7265 663d 2267 726f 7570 5f5f soap_set_l │ │ │ │ -001b2ee0: 6f67 6769 6e67 5f69 6e62 6f75 6e64 3c2f ogging_inbound
    .
    logging
    int loggin │ │ │ │ -001b3080: 6728 7374 7275 6374 2073 6f61 7020 2a2c g(struct soap *, │ │ │ │ -001b3090: 2073 7472 7563 7420 736f 6170 5f70 6c75 struct soap_plu │ │ │ │ -001b30a0: 6769 6e20 2a2c 2076 6f69 6420 2a29 3c2f gin *, void *)
    The loggi │ │ │ │ -001b30d0: 6e67 2070 6c75 6769 6e20 7265 6769 7374 ng plugin regist │ │ │ │ -001b30e0: 7261 7469 6f6e 2066 756e 6374 696f 6e2e ration function. │ │ │ │ -001b30f0: 3c2f 6469 763e 3c2f 6469 763e 0a3c 2f64
    .

    If you us │ │ │ │ -001b3120: 6520 3c63 6f64 653e 3c61 2063 6c61 7373 e soap_copy │ │ │ │ -001b31e0: 3c2f 636f 6465 3e20 746f 2063 6f70 7920 to copy │ │ │ │ -001b31f0: 7468 6520 3c63 6f64 653e 3c61 2063 6c61 the soap context wi │ │ │ │ -001b3260: 7468 2074 6865 2070 6c75 6769 6e2c 2074 th the plugin, t │ │ │ │ -001b3270: 6865 2070 6c75 6769 6e27 7320 7374 6174 he plugin's stat │ │ │ │ -001b3280: 6520 7769 6c6c 2062 6520 7368 6172 6564 e will be shared │ │ │ │ -001b3290: 2062 7920 7468 6520 636f 7079 2e20 5468 by the copy. Th │ │ │ │ -001b32a0: 6520 706c 7567 696e 2069 7320 7468 7265 e plugin is thre │ │ │ │ -001b32b0: 6164 2d73 6166 652c 2062 7574 2064 6f65 ad-safe, but doe │ │ │ │ -001b32c0: 7320 6e6f 7420 7573 6520 6120 6c6f 636b s not use a lock │ │ │ │ -001b32d0: 2074 6f20 7072 6f74 6563 7420 7468 6520 to protect the │ │ │ │ -001b32e0: 696e 7465 726e 616c 2073 7461 7469 7374 internal statist │ │ │ │ -001b32f0: 6963 7320 636f 756e 7465 7273 2074 6f20 ics counters to │ │ │ │ -001b3300: 656e 7375 7265 2074 6865 2073 7065 6564 ensure the speed │ │ │ │ -001b3310: 206f 6620 6d65 7373 6167 696e 6720 6973 of messaging is │ │ │ │ -001b3320: 206e 6f74 2063 6f6d 7072 6f6d 6973 6564 not compromised │ │ │ │ -001b3330: 2c20 6d65 616e 696e 6720 7468 6174 2079 , meaning that y │ │ │ │ -001b3340: 6f75 2073 686f 756c 6420 6e6f 7420 6675 ou should not fu │ │ │ │ -001b3350: 6c6c 7920 7265 6c79 206f 6e20 7468 6520 lly rely on the │ │ │ │ -001b3360: 7374 6174 6973 7469 6373 2074 6f20 6265 statistics to be │ │ │ │ -001b3370: 2031 3030 2520 6163 6375 7261 7465 2066 100% accurate f │ │ │ │ -001b3380: 6f72 206d 756c 7469 2d74 6872 6561 6465 or multi-threade │ │ │ │ -001b3390: 6420 7365 7276 6963 6573 2e3c 2f70 3e0a d services.

    . │ │ │ │ -001b33a0: 3c70 3e53 6565 2061 6c73 6f20 3c63 6f64

    See also logging │ │ │ │ -001b3440: 3c2f 636f 6465 3e2e 3c2f 703e 0a3c 703e .

    .

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

    < │ │ │ │ -001b34b0: 2f61 3e0a 5245 5354 6675 6c20 7365 7276 /a>.RESTful serv │ │ │ │ -001b34c0: 6572 2d73 6964 6520 4150 4920 7769 7468 er-side API with │ │ │ │ -001b34d0: 2074 6865 2048 5454 5020 4745 5420 706c the HTTP GET pl │ │ │ │ -001b34e0: 7567 696e 3c2f 6833 3e0a 3c70 3e53 6572 ugin

    .

    Ser │ │ │ │ -001b34f0: 7665 722d 7369 6465 2075 7365 206f 6620 ver-side use of │ │ │ │ -001b3500: 5245 5354 6675 6c20 4854 5450 2047 4554 RESTful HTTP GET │ │ │ │ -001b3510: 206f 7065 7261 7469 6f6e 7320 6973 2073 operations is s │ │ │ │ -001b3520: 7570 706f 7274 6564 2077 6974 6820 7468 upported with th │ │ │ │ -001b3530: 6520 3c63 6f64 653e 3c61 2063 6c61 7373 e http_ge │ │ │ │ -001b35c0: 743c 2f61 3e3c 2f63 6f64 653e 2048 5454 t HTT │ │ │ │ -001b35d0: 5020 4745 5420 706c 7567 696e 203c 656d P GET plugin gsoap/plu │ │ │ │ -001b35f0: 6769 6e2f 6874 7470 6765 742e 633c 2f63 gin/httpget.c.

    .< │ │ │ │ -001b3610: 703e 5468 6520 4854 5450 2047 4554 2070 p>The HTTP GET p │ │ │ │ -001b3620: 6c75 6769 6e20 616c 6c6f 7773 2079 6f75 lugin allows you │ │ │ │ -001b3630: 7220 7365 7276 6572 2074 6f20 6861 6e64 r server to hand │ │ │ │ -001b3640: 6c65 2052 4553 5466 756c 2048 5454 5020 le RESTful HTTP │ │ │ │ -001b3650: 4745 5420 7265 7175 6573 7473 2061 6e64 GET requests and │ │ │ │ -001b3660: 2061 7420 7468 6520 7361 6d65 2074 696d at the same tim │ │ │ │ -001b3670: 6520 7374 696c 6c20 7365 7276 6520 534f e still serve SO │ │ │ │ -001b3680: 4150 2d62 6173 6564 2050 4f53 5420 7265 AP-based POST re │ │ │ │ -001b3690: 7175 6573 7473 2e20 5468 6520 706c 7567 quests. The plug │ │ │ │ -001b36a0: 696e 2070 726f 7669 6465 7320 7375 7070 in provides supp │ │ │ │ -001b36b0: 6f72 7420 746f 2063 6c69 656e 7420 6170 ort to client ap │ │ │ │ -001b36c0: 706c 6963 6174 696f 6e73 2074 6f20 6973 plications to is │ │ │ │ -001b36d0: 7375 6520 4854 5450 2047 4554 206f 7065 sue HTTP GET ope │ │ │ │ -001b36e0: 7261 7469 6f6e 7320 746f 2061 2073 6572 rations to a ser │ │ │ │ -001b36f0: 7665 722e 3c2f 703e 0a3c 703e 4e6f 7465 ver.

    .

    Note │ │ │ │ -001b3700: 2074 6861 7420 4854 5450 2047 4554 2072 that HTTP GET r │ │ │ │ -001b3710: 6571 7565 7374 7320 6361 6e20 616c 736f equests can also │ │ │ │ -001b3720: 2062 6520 6861 6e64 6c65 6420 6174 2074 be handled at t │ │ │ │ -001b3730: 6865 2073 6572 7665 7220 7369 6465 2077 he server side w │ │ │ │ -001b3740: 6974 6820 7468 6520 3c63 6f64 653e 3c61 ith the │ │ │ │ -001b3810: 736f 6170 3a3a 6667 6574 3c2f 613e 3c2f soap::fget callback, │ │ │ │ -001b3830: 7365 6520 5365 6374 696f 6e20 3c61 2063 see Section Function ca │ │ │ │ -001b3870: 6c6c 6261 636b 7320 666f 7220 6375 7374 llbacks for cust │ │ │ │ -001b3880: 6f6d 697a 6564 2049 2f4f 2061 6e64 2048 omized I/O and H │ │ │ │ -001b3890: 5454 5020 6861 6e64 6c69 6e67 3c2f 613e TTP handling │ │ │ │ -001b38a0: 202e 2048 6f77 6576 6572 2c20 7468 6520 . However, the │ │ │ │ -001b38b0: 4854 5450 2047 4554 2070 6c75 6769 6e20 HTTP GET plugin │ │ │ │ -001b38c0: 616c 736f 206b 6565 7073 2073 7461 7469 also keeps stati │ │ │ │ -001b38d0: 7374 6963 7320 6f6e 2074 6865 206e 756d stics on the num │ │ │ │ -001b38e0: 6265 7220 6f66 2073 7563 6365 7373 6675 ber of successfu │ │ │ │ -001b38f0: 6c20 504f 5354 2061 6e64 2047 4554 2065 l POST and GET e │ │ │ │ -001b3900: 7863 6861 6e67 6573 2061 6e64 2066 6169 xchanges and fai │ │ │ │ -001b3910: 6c65 6420 6f70 6572 6174 696f 6e73 2028 led operations ( │ │ │ │ -001b3920: 4854 5450 2066 6175 6c74 732c 2053 4f41 HTTP faults, SOA │ │ │ │ -001b3930: 5020 4661 756c 7473 2c20 6574 632e 292e P Faults, etc.). │ │ │ │ -001b3940: 2049 7420 616c 736f 206b 6565 7073 2068 It also keeps h │ │ │ │ -001b3950: 6974 2068 6973 746f 6772 616d 7320 6163 it histograms ac │ │ │ │ -001b3960: 6375 6d75 6c61 7465 6420 666f 7220 7570 cumulated for up │ │ │ │ -001b3970: 2074 6f20 6120 7965 6172 206f 6620 7275 to a year of ru │ │ │ │ -001b3980: 6e6e 696e 6720 7469 6d65 2e3c 2f70 3e0a nning time.

    . │ │ │ │ -001b3990: 3c70 3e54 6f20 7573 6520 7468 6520 3c63

    To use the http_get plugin, │ │ │ │ -001b3a40: 2063 6f6d 7069 6c65 2061 6e64 206c 696e compile and lin │ │ │ │ -001b3a50: 6b20 796f 7572 2061 7070 6c69 6361 7469 k your applicati │ │ │ │ -001b3a60: 6f6e 2077 6974 6820 3c65 6d3e 3c63 6f64 on with httpget.c located │ │ │ │ -001b3a90: 696e 2074 6865 203c 656d 3e3c 636f 6465 in the gsoap/plugin direct │ │ │ │ -001b3ac0: 6f72 7920 6f66 2074 6865 2067 534f 4150 ory of the gSOAP │ │ │ │ -001b3ad0: 2070 6163 6b61 6765 2e20 546f 2065 6e61 package. To ena │ │ │ │ -001b3ae0: 626c 6520 7468 6520 706c 7567 696e 2069 ble the plugin i │ │ │ │ -001b3af0: 6e20 796f 7572 2063 6f64 652c 2072 6567 n your code, reg │ │ │ │ -001b3b00: 6973 7465 7220 7468 6520 706c 7567 696e ister the plugin │ │ │ │ -001b3b10: 2077 6974 6820 796f 7572 2048 5454 5020 with your HTTP │ │ │ │ -001b3b20: 4745 5420 6861 6e64 6c65 7220 6675 6e63 GET handler func │ │ │ │ -001b3b30: 7469 6f6e 2061 7320 666f 6c6c 6f77 733a tion as follows: │ │ │ │ -001b3b40: 3c2f 703e 0a3c 6469 7620 636c 6173 733d

    .
    #include │ │ │ │ -001b3b90: 2026 7175 6f74 3b68 7474 7067 6574 2e68 "httpget.h │ │ │ │ -001b3ba0: 2671 756f 743b 3c2f 7370 616e 3e3c 2f64 ".
    . │ │ │ │ -001b3be0: 3c73 7061 6e20 636c 6173 733d 226b 6579 int
    main()
    .
    {
    ..
    │ │ │ │ -001b3d60: 6966 3c2f 7370 616e 3e20 283c 6120 636c if (s │ │ │ │ -001b3dc0: 6f61 705f 7265 6769 7374 6572 5f70 6c75 oap_register_plu │ │ │ │ -001b3dd0: 6769 6e5f 6172 673c 2f61 3e28 3c61 2063 gin_arg(soap, htt │ │ │ │ -001b3e60: 705f 6765 743c 2f61 3e2c 2028 3c73 7061 p_get, (void*)my_http_get_h │ │ │ │ -001b3ea0: 616e 646c 6572 2929 203c 2f64 6976 3e0a andler))
    . │ │ │ │ -001b3eb0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    soap_pr │ │ │ │ -001b3f20: 696e 745f 6661 756c 743c 2f61 3e28 3c61 int_fault(soap, s │ │ │ │ -001b3f60: 7464 6572 7229 3b20 3c73 7061 6e20 636c tderr); // │ │ │ │ -001b3f80: 2066 6169 6c65 6420 746f 2072 6567 6973 failed to regis │ │ │ │ -001b3f90: 7465 7220 3c2f 7370 616e 3e3c 2f64 6976 ter
    .
    ... │ │ │ │ -001b3fd0: 2f2f 3c2f 7370 616e 3e3c 2f64 6976 3e0a //
    . │ │ │ │ -001b3fe0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    struct │ │ │ │ -001b4010: 203c 2f73 7061 6e3e 6874 7470 5f67 6574 http_get │ │ │ │ -001b4020: 5f64 6174 6120 2a68 7474 7067 6574 6461 _data *httpgetda │ │ │ │ -001b4030: 7461 3b20 3c2f 6469 763e 0a3c 6469 7620 ta;
    .
    h │ │ │ │ -001b4050: 7474 7067 6574 6461 7461 203d 2028 3c73 ttpgetdata = (struct http_get_data* │ │ │ │ -001b4090: 2973 6f61 705f 6c6f 6f6b 7570 5f70 6c75 )soap_lookup_plu │ │ │ │ -001b40a0: 6769 6e28 3c61 2063 6c61 7373 3d22 636f gin(soap< │ │ │ │ -001b40d0: 2f61 3e2c 2068 7474 705f 6765 745f 6964 /a>, http_get_id │ │ │ │ -001b40e0: 293b 203c 2f64 6976 3e0a 3c64 6976 2063 );
    .
    if (!httpgetdata) │ │ │ │ -001b4130: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    .. │ │ │ │ -001b4150: 2e20 3c73 7061 6e20 636c 6173 733d 2263 . // if th │ │ │ │ -001b4170: 6520 706c 7567 696e 2072 6567 6973 7465 e plugin registe │ │ │ │ -001b4180: 7265 6420 4f4b 2c20 7468 6572 6520 6973 red OK, there is │ │ │ │ -001b4190: 2063 6572 7461 696e 6c79 2064 6174 6120 certainly data │ │ │ │ -001b41a0: 6275 7420 6361 6e26 2333 393b 7420 6875 but can't hu │ │ │ │ -001b41b0: 7274 2074 6f20 6368 6563 6b20 3c2f 7370 rt to check
    .
    .. │ │ │ │ -001b41e0: 2e20 3c73 7061 6e20 636c 6173 733d 2263 . // proce │ │ │ │ -001b4200: 7373 206d 6573 7361 6765 733c 2f73 7061 ss messages
    .
    size_t get_ok = ht │ │ │ │ -001b4260: 7470 6765 7464 6174 612d 2667 743b 7374 tpgetdata->st │ │ │ │ -001b4270: 6174 5f67 6574 3b20 3c2f 6469 763e 0a3c at_get;
    .< │ │ │ │ -001b4280: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001b4290: 3e20 203c 7370 616e 2063 6c61 7373 3d22 > siz │ │ │ │ -001b42b0: 655f 743c 2f73 7061 6e3e 2070 6f73 745f e_t post_ │ │ │ │ -001b42c0: 6f6b 203d 2068 7474 7067 6574 6461 7461 ok = httpgetdata │ │ │ │ -001b42d0: 2d26 6774 3b73 7461 745f 706f 7374 3b20 ->stat_post; │ │ │ │ -001b42e0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    size_t errors = http │ │ │ │ -001b4330: 6765 7464 6174 612d 2667 743b 7374 6174 getdata->stat │ │ │ │ -001b4340: 5f66 6169 6c3b 203c 2f64 6976 3e0a 3c64 _fail;
    . │ │ │ │ -001b4360: 2020 7469 6d65 5f74 206e 6f77 203d 2074 time_t now = t │ │ │ │ -001b4370: 696d 6528 4e55 4c4c 293b 203c 2f64 6976 ime(NULL);
    .
    stru │ │ │ │ -001b43b0: 6374 203c 2f73 7061 6e3e 746d 202a 543b ct tm *T; │ │ │ │ -001b43c0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    T = │ │ │ │ -001b43e0: 6c6f 6361 6c74 696d 6528 2661 6d70 3b6e localtime(&n │ │ │ │ -001b43f0: 6f77 293b 203c 2f64 6976 3e0a 3c64 6976 ow);
    .
    │ │ │ │ -001b4410: 3c73 7061 6e20 636c 6173 733d 226b 6579 size_t │ │ │ │ -001b4430: 3c2f 7370 616e 3e20 6869 7473 7468 6973 hitsthis │ │ │ │ -001b4440: 6d69 6e75 7465 203d 2068 7474 7067 6574 minute = httpget │ │ │ │ -001b4450: 6461 7461 2d26 6774 3b68 6973 745f 6d69 data->hist_mi │ │ │ │ -001b4460: 6e5b 542d 2667 743b 746d 5f6d 696e 5d3b n[T->tm_min]; │ │ │ │ -001b4470: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    size_t hitsthishour │ │ │ │ -001b44c0: 203d 2068 7474 7067 6574 6461 7461 2d26 = httpgetdata-& │ │ │ │ -001b44d0: 6774 3b68 6973 745f 686f 7572 5b54 2d26 gt;hist_hour[T-& │ │ │ │ -001b44e0: 6774 3b74 6d5f 686f 7572 5d3b 203c 2f64 gt;tm_hour]; .
    size_t │ │ │ │ -001b4530: 6869 7473 746f 6461 7920 3d20 6874 7470 hitstoday = http │ │ │ │ -001b4540: 6765 7464 6174 612d 2667 743b 6869 7374 getdata->hist │ │ │ │ -001b4550: 5f64 6179 5b54 2d26 6774 3b74 6d5f 7964 _day[T->tm_yd │ │ │ │ -001b4560: 6179 5d3b 3c2f 6469 763e 0a3c 6469 7620 ay];
    .
    }.

    A │ │ │ │ -001b45a0: 6e20 4854 5450 2047 4554 2068 616e 646c n HTTP GET handl │ │ │ │ -001b45b0: 6572 2063 616e 2073 696d 706c 7920 7072 er can simply pr │ │ │ │ -001b45c0: 6f64 7563 6520 736f 6d65 2048 544d 4c20 oduce some HTML │ │ │ │ -001b45d0: 636f 6e74 656e 742c 206f 7220 616e 7920 content, or any │ │ │ │ -001b45e0: 6f74 6865 7220 7479 7065 206f 6620 636f other type of co │ │ │ │ -001b45f0: 6e74 656e 7420 6279 2073 656e 6469 6e67 ntent by sending │ │ │ │ -001b4600: 2064 6174 6120 7573 696e 6720 3c63 6f64 data using soap_res │ │ │ │ -001b46c0: 706f 6e73 653c 2f61 3e3c 2f63 6f64 653e ponse │ │ │ │ -001b46d0: 3a3c 2f70 3e0a 3c64 6976 2063 6c61 7373 :

    .
    int my_http_get_h │ │ │ │ -001b4730: 616e 646c 6572 283c 7370 616e 2063 6c61 andler(str │ │ │ │ -001b4750: 7563 743c 2f73 7061 6e3e 203c 6120 636c uct soap *soap) .
    {
    . │ │ │ │ -001b47f0: 2020 3c61 2063 6c61 7373 3d22 636f 6465 soap->h │ │ │ │ -001b4870: 7474 705f 636f 6e74 656e 743c 2f61 3e20 ttp_content │ │ │ │ -001b4880: 3d20 3c73 7061 6e20 636c 6173 733d 2273 = &q │ │ │ │ -001b48a0: 756f 743b 7465 7874 2f68 746d 6c26 7175 uot;text/html&qu │ │ │ │ -001b48b0: 6f74 3b3c 2f73 7061 6e3e 3b20 3c2f 6469 ot;; .
    if (soap │ │ │ │ -001b4950: 5f72 6573 706f 6e73 653c 2f61 3e28 3c61 _response(soap, < │ │ │ │ -001b4990: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -001b49a0: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ │ -001b49b0: 705f 5f69 6f2e 6874 6d6c 2367 6130 3562 p__io.html#ga05b │ │ │ │ -001b49c0: 6539 3933 3433 6635 3536 6665 3730 3934 e99343f556fe7094 │ │ │ │ -001b49d0: 3031 3435 6538 3734 6364 6239 3922 3e53 0145e874cdb99">S │ │ │ │ -001b49e0: 4f41 505f 4649 4c45 3c2f 613e 293c 2f64 OAP_FILE).
    || soap │ │ │ │ -001b4a60: 5f73 656e 643c 2f61 3e28 3c61 2063 6c61 _send(soap, "< │ │ │ │ -001b4ac0: 3b68 746d 6c26 6774 3b48 656c 6c6f 266c ;html>Hello&l │ │ │ │ -001b4ad0: 743b 2f68 746d 6c26 6774 3b26 7175 6f74 t;/html>" │ │ │ │ -001b4ae0: 3b3c 2f73 7061 6e3e 293c 2f64 6976 3e0a ;)
    . │ │ │ │ -001b4af0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65 │ │ │ │ -001b4ba0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    return < │ │ │ │ -001b4be0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -001b4bf0: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ │ -001b4c00: 705f 5f69 6f2e 6874 6d6c 2367 6130 3664 p__io.html#ga06d │ │ │ │ -001b4c10: 3539 3039 3461 6661 3364 6636 6231 6239 59094afa3df6b1b9 │ │ │ │ -001b4c20: 6636 6232 6262 3438 3432 3037 6322 3e73 f6b2bb484207c">s │ │ │ │ -001b4c30: 6f61 705f 636c 6f73 6573 6f63 6b3c 2f61 oap_closesock(soap);
    .
    return SOAP_O │ │ │ │ -001b4d10: 4b3c 2f61 3e3b 203c 7370 616e 2063 6c61 K; // │ │ │ │ -001b4d30: 7265 7475 726e 2053 4f41 505f 4f4b 206f return SOAP_OK o │ │ │ │ -001b4d40: 7220 4854 5450 2065 7272 6f72 2063 6f64 r HTTP error cod │ │ │ │ -001b4d50: 652c 2065 2e67 2e20 3430 3420 3c2f 7370 e, e.g. 404
    .
    }.

    If │ │ │ │ -001b4da0: 2079 6f75 2075 7365 203c 636f 6465 3e3c you use < │ │ │ │ -001b4db0: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ -001b4dc0: 663d 2267 726f 7570 5f5f 6772 6f75 705f f="group__group_ │ │ │ │ -001b4dd0: 5f63 6f6e 7465 7874 2e68 746d 6c23 6761 _context.html#ga │ │ │ │ -001b4de0: 6234 6333 6638 6365 3830 6261 6630 6631 b4c3f8ce80baf0f1 │ │ │ │ -001b4df0: 6665 6338 6338 3666 3062 6235 3738 3861 fec8c86f0bb5788a │ │ │ │ -001b4e00: 2220 7469 746c 653d 2241 6c6c 6f63 6174 " title="Allocat │ │ │ │ -001b4e10: 6520 616e 6420 696e 6974 6961 6c69 7a65 e and initialize │ │ │ │ -001b4e20: 2061 206e 6577 2073 6f61 7020 636f 6e74 a new soap cont │ │ │ │ -001b4e30: 6578 7420 6173 2061 2063 6f70 7920 6f66 ext as a copy of │ │ │ │ -001b4e40: 2074 6865 2067 6976 656e 2073 6f61 7020 the given soap │ │ │ │ -001b4e50: 636f 6e74 6578 742e 223e 736f 6170 5f63 context.">soap_c │ │ │ │ -001b4e60: 6f70 793c 2f61 3e3c 2f63 6f64 653e 2074 opy t │ │ │ │ -001b4e70: 6f20 636f 7079 2074 6865 203c 636f 6465 o copy the soa │ │ │ │ -001b4ed0: 703c 2f61 3e3c 2f63 6f64 653e 2063 6f6e p con │ │ │ │ -001b4ee0: 7465 7874 2077 6974 6820 7468 6520 706c text with the pl │ │ │ │ -001b4ef0: 7567 696e 2c20 7468 6520 706c 7567 696e ugin, the plugin │ │ │ │ -001b4f00: 2773 2064 6174 6120 7769 6c6c 2062 6520 's data will be │ │ │ │ -001b4f10: 7368 6172 6564 2062 7920 7468 6520 636f shared by the co │ │ │ │ -001b4f20: 7079 2e20 5468 6572 6566 6f72 652c 2074 py. Therefore, t │ │ │ │ -001b4f30: 6865 2073 7461 7469 7374 6963 7320 6172 he statistics ar │ │ │ │ -001b4f40: 6520 6e6f 7420 3130 3025 2067 7561 7261 e not 100% guara │ │ │ │ -001b4f50: 6e74 6565 6420 746f 2062 6520 6163 6375 nteed to be accu │ │ │ │ -001b4f60: 7261 7465 2066 6f72 206d 756c 7469 2d74 rate for multi-t │ │ │ │ -001b4f70: 6872 6561 6465 6420 7365 7276 6963 6573 hreaded services │ │ │ │ -001b4f80: 2073 696e 6365 2072 6163 6520 636f 6e64 since race cond │ │ │ │ -001b4f90: 6974 696f 6e73 206f 6e20 7468 6520 636f itions on the co │ │ │ │ -001b4fa0: 756e 7465 7273 206d 6179 206f 6363 7572 unters may occur │ │ │ │ -001b4fb0: 2e20 4d75 7465 7820 6973 206e 6f74 2075 . Mutex is not u │ │ │ │ -001b4fc0: 7365 6420 746f 2075 7064 6174 6520 7468 sed to update th │ │ │ │ -001b4fd0: 6520 636f 756e 7465 7273 2074 6f20 6176 e counters to av │ │ │ │ -001b4fe0: 6f69 6420 696e 7472 6f64 7563 696e 6720 oid introducing │ │ │ │ -001b4ff0: 6578 7065 6e73 6976 6520 7379 6e63 6872 expensive synchr │ │ │ │ -001b5000: 6f6e 697a 6174 696f 6e20 706f 696e 7473 onization points │ │ │ │ -001b5010: 2e20 4966 2031 3030 2520 7365 7276 6572 . If 100% server │ │ │ │ -001b5020: 2d73 6964 6520 6163 6375 7261 6379 2069 -side accuracy i │ │ │ │ -001b5030: 7320 7265 7175 6972 6564 2c20 6164 6420 s required, add │ │ │ │ -001b5040: 6d75 7465 7820 6174 2074 6865 2070 6f69 mutex at the poi │ │ │ │ -001b5050: 6e74 7320 696e 6469 6361 7465 6420 696e nts indicated in │ │ │ │ -001b5060: 2074 6865 203c 656d 3e3c 636f 6465 3e68 the h │ │ │ │ -001b5070: 7474 7067 6574 2e63 3c2f 636f 6465 3e3c ttpget.c< │ │ │ │ -001b5080: 2f65 6d3e 2063 6f64 652e 3c2f 703e 0a3c /em> code.

    .< │ │ │ │ -001b5090: 703e 5468 6520 636c 6965 6e74 2d73 6964 p>The client-sid │ │ │ │ -001b50a0: 6520 7573 6520 6f66 2048 5454 5020 4745 e use of HTTP GE │ │ │ │ -001b50b0: 5420 6973 2070 726f 7669 6465 6420 6279 T is provided by │ │ │ │ -001b50c0: 2074 6865 203c 636f 6465 3e3c 6120 636c the s │ │ │ │ -001b5140: 6f61 705f 4745 543c 2f61 3e3c 2f63 6f64 oap_GET operation. To │ │ │ │ -001b5160: 2072 6563 6569 7665 2061 2053 4f41 502f receive a SOAP/ │ │ │ │ -001b5170: 584d 4c20 2872 6573 706f 6e73 6529 206d XML (response) m │ │ │ │ -001b5180: 6573 7361 6765 203c 656d 3e3c 636f 6465 essage ns:methodRespon │ │ │ │ -001b51a0: 7365 3c2f 636f 6465 3e3c 2f65 6d3e 2c20 se, │ │ │ │ -001b51b0: 7573 653a 3c2f 703e 0a3c 6469 7620 636c use:

    .
    < │ │ │ │ -001b51d0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001b51e0: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >int main().
    {
    . │ │ │ │ -001b5240: 203c 7370 616e 2063 6c61 7373 3d22 6b65 struct soap │ │ │ │ -001b5290: 3c2f 613e 202a 3c61 2063 6c61 7373 3d22 *soa │ │ │ │ -001b52c0: 703c 2f61 3e20 3d20 3c61 2063 6c61 7373 p = soa │ │ │ │ -001b5320: 705f 6e65 773c 2f61 3e28 293b 3c2f 6469 p_new();..< │ │ │ │ -001b5460: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001b5470: 3e20 2020 202e 2e2e 203c 7370 616e 2063 > ... / │ │ │ │ -001b5490: 2f20 6572 726f 723c 2f73 7061 6e3e 3c2f / error.
    else < │ │ │ │ -001b54e0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -001b54f0: 6f72 6466 6c6f 7722 3e69 663c 2f73 7061 ordflow">if (soap_recv_ns │ │ │ │ -001b5510: 5f5f 7765 626d 6574 686f 6452 6573 706f __webmethodRespo │ │ │ │ -001b5520: 6e73 6528 3c61 2063 6c61 7373 3d22 636f nse(soap< │ │ │ │ -001b5550: 2f61 3e2c 202e 2e2e 2929 203c 2f64 6976 /a>, ...))
    .
    ... // error
    .
    else
    .
    . │ │ │ │ -001b5600: 2e2e 203c 7370 616e 2063 6c61 7373 3d22 .. // succ │ │ │ │ -001b5620: 6573 733c 2f73 7061 6e3e 3c2f 6469 763e ess
    │ │ │ │ -001b5630: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    ..< │ │ │ │ -001b5790: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001b57a0: 3e3c 6120 636c 6173 733d 2263 6f64 6522 >soap_done< │ │ │ │ -001b5800: 2f61 3e28 3c61 2063 6c61 7373 3d22 636f /a>(soap< │ │ │ │ -001b5830: 2f61 3e29 3b3c 2f64 6976 3e0a 3c64 6976 /a>);
    .
    │ │ │ │ -001b58a0: 3c61 2068 7265 663d 2267 726f 7570 5f5f soap_GET< │ │ │ │ -001b58f0: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
    int soa │ │ │ │ -001b5910: 705f 4745 5428 7374 7275 6374 2073 6f61 p_GET(struct soa │ │ │ │ -001b5920: 7020 2a73 6f61 702c 2063 6f6e 7374 2063 p *soap, const c │ │ │ │ -001b5930: 6861 7220 2a65 6e64 706f 696e 742c 2063 har *endpoint, c │ │ │ │ -001b5940: 6f6e 7374 2063 6861 7220 2a61 6374 696f onst char *actio │ │ │ │ -001b5950: 6e29 3c2f 6469 763e 3c64 6976 2063 6c61 n)
    HTTP │ │ │ │ -001b5970: 4745 5420 636f 6e74 656e 7420 6672 6f6d GET content from │ │ │ │ -001b5980: 2073 6572 7665 722e 3c2f 6469 763e 3c2f server.
    .

    T │ │ │ │ -001b59b0: 6f20 7265 6365 6976 6520 616e 7920 4854 o receive any HT │ │ │ │ -001b59c0: 5450 2042 6f64 7920 6461 7461 2069 6e74 TP Body data int │ │ │ │ -001b59d0: 6f20 6120 6275 6666 6572 2c20 7573 653a o a buffer, use: │ │ │ │ -001b59e0: 3c2f 703e 0a3c 6469 7620 636c 6173 733d

    .
    int main()
    .< │ │ │ │ -001b5a40: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001b5a50: 3e7b 3c2f 6469 763e 0a3c 6469 7620 636c >{
    .
    struct soap │ │ │ │ -001b5ac0: 202a 3c61 2063 6c61 7373 3d22 636f 6465 *soap = soap_ne │ │ │ │ -001b5b50: 773c 2f61 3e28 293b 3c2f 6469 763e 0a3c w();
    .< │ │ │ │ -001b5b60: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001b5b70: 3e20 203c 7370 616e 2063 6c61 7373 3d22 > cha │ │ │ │ -001b5b90: 723c 2f73 7061 6e3e 202a 7265 7370 6f6e r *respon │ │ │ │ -001b5ba0: 7365 203d 204e 554c 4c3b 203c 2f64 6976 se = NULL;
    .
    │ │ │ │ -001b5be0: 7369 7a65 5f74 3c2f 7370 616e 3e20 7265 size_t re │ │ │ │ -001b5bf0: 7370 6f6e 7365 5f6c 656e 3b3c 2f64 6976 sponse_len;
    .
    │ │ │ │ -001b5c30: 6966 3c2f 7370 616e 3e20 283c 6120 636c if (soap_ │ │ │ │ -001b5c90: 4745 543c 2f61 3e28 3c61 2063 6c61 7373 GET(s │ │ │ │ -001b5cc0: 6f61 703c 2f61 3e2c 203c 6120 636c 6173 oap, endpoint, │ │ │ │ -001b5d20: 4e55 4c4c 293c 2f64 6976 3e0a 3c64 6976 NULL)
    .
    │ │ │ │ -001b5d40: 207c 7c20 2872 6573 706f 6e73 6520 3d20 || (response = │ │ │ │ -001b5d50: 3c61 2063 6c61 7373 3d22 636f 6465 2220 │ │ │ │ -001b5da0: 736f 6170 5f68 7474 705f 6765 745f 626f soap_http_get_bo │ │ │ │ -001b5db0: 6479 3c2f 613e 283c 6120 636c 6173 733d dy(so │ │ │ │ -001b5de0: 6170 3c2f 613e 2c20 2661 6d70 3b72 6573 ap, &res │ │ │ │ -001b5df0: 706f 6e73 655f 6c65 6e29 2920 3d3d 204e ponse_len)) == N │ │ │ │ -001b5e00: 554c 4c3c 2f64 6976 3e0a 3c64 6976 2063 ULL
    . │ │ │ │ -001b5ec0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    ... // error │ │ │ │ -001b5f00: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    else │ │ │ │ -001b5f40: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    ... │ │ │ │ -001b5f60: 203c 7370 616e 2063 6c61 7373 3d22 636f // use th │ │ │ │ -001b5f80: 6520 7265 7370 6f6e 7365 2073 7472 696e e response strin │ │ │ │ -001b5f90: 6720 284e 554c 4c20 696e 6469 6361 7465 g (NULL indicate │ │ │ │ -001b5fa0: 7320 6e6f 2062 6f64 7920 6f72 2065 7272 s no body or err │ │ │ │ -001b5fb0: 6f72 293c 2f73 7061 6e3e 3c2f 6469 763e or)
    │ │ │ │ -001b5fc0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    soap_d │ │ │ │ -001b6030: 6573 7472 6f79 3c2f 613e 2826 616d 703b estroy(& │ │ │ │ -001b6040: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap) │ │ │ │ -001b6070: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
    .
    soap_end(& │ │ │ │ -001b60f0: 616d 703b 3c61 2063 6c61 7373 3d22 636f amp;soap< │ │ │ │ -001b6120: 2f61 3e29 3b20 3c2f 6469 763e 0a3c 6469 /a>);
    . │ │ │ │ -001b6140: 203c 6120 636c 6173 733d 2263 6f64 6522 soap_done< │ │ │ │ -001b61a0: 2f61 3e28 2661 6d70 3b3c 6120 636c 6173 /a>(& │ │ │ │ -001b61d0: 736f 6170 3c2f 613e 293b 3c2f 6469 763e soap);
    │ │ │ │ -001b61e0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    }
    .
    < │ │ │ │ -001b6260: 6120 6872 6566 3d22 6772 6f75 705f 5f67 a href="group__g │ │ │ │ -001b6270: 726f 7570 5f5f 696f 2e68 746d 6c23 6761 roup__io.html#ga │ │ │ │ -001b6280: 3836 6230 6330 3465 3862 6161 3931 3166 86b0c04e8baa911f │ │ │ │ -001b6290: 6335 3765 3766 3132 3230 6639 6562 3866 c57e7f1220f9eb8f │ │ │ │ -001b62a0: 223e 736f 6170 5f65 6e64 5f72 6563 763c ">soap_end_recv< │ │ │ │ -001b62b0: 2f61 3e3c 2f64 6976 3e3c 6469 7620 636c /a>
    int │ │ │ │ -001b62d0: 2073 6f61 705f 656e 645f 7265 6376 2873 soap_end_recv(s │ │ │ │ -001b62e0: 7472 7563 7420 736f 6170 202a 736f 6170 truct soap *soap │ │ │ │ -001b62f0: 293c 2f64 6976 3e3c 6469 7620 636c 6173 )
    Finali │ │ │ │ -001b6310: 7a65 2074 6865 2063 6f6e 7465 7874 2061 ze the context a │ │ │ │ -001b6320: 6674 6572 2072 6563 6569 7669 6e67 2e3c fter receiving.< │ │ │ │ -001b6330: 2f64 6976 3e3c 2f64 6976 3e0a 3c64 6976 /div>
    .
    │ │ │ │ -001b63a0: 3c61 2068 7265 663d 2267 726f 7570 5f5f soap_http_get │ │ │ │ -001b63f0: 5f62 6f64 793c 2f61 3e3c 2f64 6976 3e3c _body
    < │ │ │ │ -001b6400: 6469 7620 636c 6173 733d 2274 7464 6563 div class="ttdec │ │ │ │ -001b6410: 6922 3e63 6861 7220 2a20 736f 6170 5f68 i">char * soap_h │ │ │ │ -001b6420: 7474 705f 6765 745f 626f 6479 2873 7472 ttp_get_body(str │ │ │ │ -001b6430: 7563 7420 736f 6170 202a 736f 6170 2c20 uct soap *soap, │ │ │ │ -001b6440: 7369 7a65 5f74 202a 6c65 6e29 3c2f 6469 size_t *len)
    Get the HTT │ │ │ │ -001b6470: 5020 626f 6479 206d 6573 7361 6765 2061 P body message a │ │ │ │ -001b6480: 7320 6120 7374 7269 6e67 2e3c 2f64 6976 s a string.
    .
    < │ │ │ │ -001b64b0: 703e 5365 6520 616c 736f 203c 636f 6465 p>See also http_get.

    .

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

    │ │ │ │ -001b6590: 0a3c 6833 3e3c 6120 636c 6173 733d 2261 .

    < │ │ │ │ -001b65c0: 2f61 3e0a 5245 5354 6675 6c20 7365 7276 /a>.RESTful serv │ │ │ │ -001b65d0: 6572 2d73 6964 6520 4150 4920 7769 7468 er-side API with │ │ │ │ -001b65e0: 2074 6865 2048 5454 5020 504f 5354 2070 the HTTP POST p │ │ │ │ -001b65f0: 6c75 6769 6e3c 2f68 333e 0a3c 703e 5365 lugin

    .

    Se │ │ │ │ -001b6600: 7276 6572 2d73 6964 6520 7573 6520 6f66 rver-side use of │ │ │ │ -001b6610: 2052 4553 5466 756c 2048 5454 5020 504f RESTful HTTP PO │ │ │ │ -001b6620: 5354 2c20 5055 542c 2050 4154 4348 2c20 ST, PUT, PATCH, │ │ │ │ -001b6630: 616e 6420 4445 4c45 5445 206f 7065 7261 and DELETE opera │ │ │ │ -001b6640: 7469 6f6e 7320 6172 6520 7375 7070 6f72 tions are suppor │ │ │ │ -001b6650: 7465 6420 7769 7468 2074 6865 203c 636f ted with the http_post HTTP P │ │ │ │ -001b6700: 4f53 5420 706c 7567 696e 203c 656d 3e3c OST plugin < │ │ │ │ -001b6710: 636f 6465 3e67 736f 6170 2f70 6c75 6769 code>gsoap/plugi │ │ │ │ -001b6720: 6e2f 6874 7470 706f 7374 2e63 3c2f 636f n/httppost.c.

    .

    The htt │ │ │ │ -001b67d0: 705f 706f 7374 3c2f 613e 3c2f 636f 6465 p_post HTTP POST plug │ │ │ │ -001b67f0: 696e 2061 6c6c 6f77 7320 796f 7572 2073 in allows your s │ │ │ │ -001b6800: 6572 7665 7220 746f 2068 616e 646c 6520 erver to handle │ │ │ │ -001b6810: 5245 5354 6675 6c20 4854 5450 2050 4f53 RESTful HTTP POS │ │ │ │ -001b6820: 5420 7265 7175 6573 7473 2061 6e64 2061 T requests and a │ │ │ │ -001b6830: 7420 7468 6520 7361 6d65 2074 696d 6520 t the same time │ │ │ │ -001b6840: 7374 696c 6c20 7365 7276 6520 534f 4150 still serve SOAP │ │ │ │ -001b6850: 2d62 6173 6564 2050 4f53 5420 7265 7175 -based POST requ │ │ │ │ -001b6860: 6573 7473 2e20 5468 6520 706c 7567 696e ests. The plugin │ │ │ │ -001b6870: 2061 6c73 6f20 7072 6f76 6964 6573 2073 also provides s │ │ │ │ -001b6880: 7570 706f 7274 2066 6f72 2063 6c69 656e upport for clien │ │ │ │ -001b6890: 7420 6170 706c 6963 6174 696f 6e73 2074 t applications t │ │ │ │ -001b68a0: 6f20 6973 7375 6520 4854 5450 2050 4f53 o issue HTTP POS │ │ │ │ -001b68b0: 5420 6f70 6572 6174 696f 6e73 2074 6f20 T operations to │ │ │ │ -001b68c0: 6120 7365 7276 6572 2e3c 2f70 3e0a 3c70 a server.

    .

    To simplify the │ │ │ │ -001b68e0: 2073 6572 7665 722d 7369 6465 2068 616e server-side han │ │ │ │ -001b68f0: 646c 696e 6720 6f66 2050 4f53 5420 7265 dling of POST re │ │ │ │ -001b6900: 7175 6573 7473 2c20 6861 6e64 6c65 7273 quests, handlers │ │ │ │ -001b6910: 2063 616e 2062 6520 6173 736f 6369 6174 can be associat │ │ │ │ -001b6920: 6564 2077 6974 6820 6d65 6469 6120 7479 ed with media ty │ │ │ │ -001b6930: 7065 733a 3c2f 703e 0a3c 6469 7620 636c pes:

    .
    < │ │ │ │ -001b6950: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001b6960: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >struct http_post_h │ │ │ │ -001b6990: 616e 646c 6572 7320 6d79 5f68 616e 646c andlers my_handl │ │ │ │ -001b69a0: 6572 735b 5d20 3d20 3c2f 6469 763e 0a3c ers[] =
    .< │ │ │ │ -001b69b0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001b69c0: 3e7b 3c2f 6469 763e 0a3c 6469 7620 636c >{
    .
    { < │ │ │ │ -001b69e0: 7370 616e 2063 6c61 7373 3d22 7374 7269 span class="stri │ │ │ │ -001b69f0: 6e67 6c69 7465 7261 6c22 3e26 7175 6f74 ngliteral">" │ │ │ │ -001b6a00: 3b69 6d61 6765 2f6a 7067 2671 756f 743b ;image/jpg" │ │ │ │ -001b6a10: 3c2f 7370 616e 3e2c 206a 7065 675f 6861 , jpeg_ha │ │ │ │ -001b6a20: 6e64 6c65 7220 7d2c 203c 2f64 6976 3e0a ndler },
    . │ │ │ │ -001b6a30: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    { "image/*& │ │ │ │ -001b6a70: 7175 6f74 3b3c 2f73 7061 6e3e 2c20 2020 quot;, │ │ │ │ -001b6a80: 696d 6167 655f 6861 6e64 6c65 7220 7d2c image_handler }, │ │ │ │ -001b6a90: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    { " │ │ │ │ -001b6ad0: 7465 7874 2f68 746d 6c26 7175 6f74 3b3c text/html"< │ │ │ │ -001b6ae0: 2f73 7061 6e3e 2c20 6874 6d6c 5f68 616e /span>, html_han │ │ │ │ -001b6af0: 646c 6572 207d 2c20 3c2f 6469 763e 0a3c dler },
    .< │ │ │ │ -001b6b00: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001b6b10: 3e20 207b 203c 7370 616e 2063 6c61 7373 > { "text/*&qu │ │ │ │ -001b6b40: 6f74 3b3c 2f73 7061 6e3e 2c20 2020 2074 ot;, t │ │ │ │ -001b6b50: 6578 745f 6861 6e64 6c65 7220 7d2c 203c ext_handler }, < │ │ │ │ -001b6b60: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    { "PO │ │ │ │ -001b6ba0: 5354 2671 756f 743b 3c2f 7370 616e 3e2c ST", │ │ │ │ -001b6bb0: 2020 2020 2020 6765 6e65 7269 635f 504f generic_PO │ │ │ │ -001b6bc0: 5354 5f68 616e 646c 6572 207d 2c20 3c2f ST_handler }, .
    { "PUT │ │ │ │ -001b6c10: 2671 756f 743b 3c2f 7370 616e 3e2c 2020 ", │ │ │ │ -001b6c20: 2020 2020 2067 656e 6572 6963 5f50 5554 generic_PUT │ │ │ │ -001b6c30: 5f68 616e 646c 6572 207d 2c20 3c2f 6469 _handler }, .
    { "PATCH │ │ │ │ -001b6c80: 2671 756f 743b 3c2f 7370 616e 3e2c 2020 ", │ │ │ │ -001b6c90: 2020 2067 656e 6572 6963 5f50 4154 4348 generic_PATCH │ │ │ │ -001b6ca0: 5f68 616e 646c 6572 207d 2c20 3c2f 6469 _handler }, .
    { "DELET │ │ │ │ -001b6cf0: 4526 7175 6f74 3b3c 2f73 7061 6e3e 2c20 E", │ │ │ │ -001b6d00: 2020 2067 656e 6572 6963 5f44 454c 4554 generic_DELET │ │ │ │ -001b6d10: 455f 6861 6e64 6c65 7220 7d2c 203c 2f64 E_handler }, .
    { NULL } │ │ │ │ -001b6d40: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    };.

    Not │ │ │ │ -001b6d80: 6520 7468 6174 203c 636f 6465 3e2a 3c2f e that * and │ │ │ │ -001b6da0: 2d3c 2f63 6f64 653e 2063 616e 2062 6520 - can be │ │ │ │ -001b6db0: 7573 6564 2061 7320 7769 6c64 6361 7264 used as wildcard │ │ │ │ -001b6dc0: 7320 746f 206d 6174 6368 2061 6e79 2074 s to match any t │ │ │ │ -001b6dd0: 6578 7420 616e 6420 616e 7920 6368 6172 ext and any char │ │ │ │ -001b6de0: 6163 7465 722c 2072 6573 7065 6374 6976 acter, respectiv │ │ │ │ -001b6df0: 656c 792e 204d 6564 6961 2074 7970 6573 ely. Media types │ │ │ │ -001b6e00: 206d 6179 2068 6176 6520 6f70 7469 6f6e may have option │ │ │ │ -001b6e10: 616c 2070 6172 616d 6574 6572 7320 6166 al parameters af │ │ │ │ -001b6e20: 7465 7220 3c63 6f64 653e 3b3c 2f63 6f64 ter ; such as charset │ │ │ │ -001b6e50: 616e 6420 3c63 6f64 653e 626f 756e 6461 and bounda │ │ │ │ -001b6e60: 7279 3c2f 636f 6465 3e2e 2054 6865 7365 ry. These │ │ │ │ -001b6e70: 2070 6172 616d 6574 6572 7320 6361 6e20 parameters can │ │ │ │ -001b6e80: 6265 206d 6174 6368 6564 2062 7920 7468 be matched by th │ │ │ │ -001b6e90: 6520 6d65 6469 6120 7479 7065 2070 6174 e media type pat │ │ │ │ -001b6ea0: 7465 726e 7320 696e 2074 6865 2074 6162 terns in the tab │ │ │ │ -001b6eb0: 6c65 2e20 5061 7474 6572 6e73 2074 6861 le. Patterns tha │ │ │ │ -001b6ec0: 7420 6172 6520 6d6f 7265 2073 7065 6369 t are more speci │ │ │ │ -001b6ed0: 6669 6320 6d75 7374 2070 7265 6365 6465 fic must precede │ │ │ │ -001b6ee0: 2070 6174 7465 726e 7320 7468 6174 2061 patterns that a │ │ │ │ -001b6ef0: 7265 206c 6573 7320 7370 6563 6966 6963 re less specific │ │ │ │ -001b6f00: 2069 6e20 7468 6520 7461 626c 652e 2046 in the table. F │ │ │ │ -001b6f10: 6f72 2065 7861 6d70 6c65 2c20 3c63 6f64 or example, "text/xml;*cha │ │ │ │ -001b6f30: 7273 6574 3d75 7466 2d38 2a22 3c2f 636f rset=utf-8*" must precede │ │ │ │ -001b6f50: 203c 636f 6465 3e22 7465 7874 2f78 6d6c "text/xml │ │ │ │ -001b6f60: 223c 2f63 6f64 653e 2077 6869 6368 206d " which m │ │ │ │ -001b6f70: 7573 7420 7072 6563 6564 6520 3c63 6f64 ust precede "text/*". Note that "text/xml" also matche │ │ │ │ -001b6fc0: 7320 616e 7920 7061 7261 6d65 7465 7273 s any parameters │ │ │ │ -001b6fd0: 206f 6620 7468 6520 6d65 6469 6120 7479 of the media ty │ │ │ │ -001b6fe0: 7065 206f 6620 7468 6520 6d65 7373 6167 pe of the messag │ │ │ │ -001b6ff0: 6520 7265 7665 6976 6564 2c20 7375 6368 e reveived, such │ │ │ │ -001b7000: 2061 7320 3c63 6f64 653e 2274 6578 742f as "text/ │ │ │ │ -001b7010: 786d 6c3b 2063 6861 7273 6574 3d75 7466 xml; charset=utf │ │ │ │ -001b7020: 2d38 223c 2f63 6f64 653e 2028 6f6e 6c79 -8" (only │ │ │ │ -001b7030: 2073 696e 6365 2067 534f 4150 2076 6572 since gSOAP ver │ │ │ │ -001b7040: 7369 6f6e 2032 2e38 2e37 3529 2e3c 2f70 sion 2.8.75).

    .

    The handler │ │ │ │ -001b7060: 7320 6172 6520 6675 6e63 7469 6f6e 7320 s are functions │ │ │ │ -001b7070: 7468 6174 2077 696c 6c20 6265 2069 6e76 that will be inv │ │ │ │ -001b7080: 6f6b 6564 2077 6865 6e20 6120 504f 5354 oked when a POST │ │ │ │ -001b7090: 6564 2072 6571 7565 7374 206d 6573 7361 ed request messa │ │ │ │ -001b70a0: 6765 206d 6174 6368 696e 6720 6d65 6469 ge matching medi │ │ │ │ -001b70b0: 6120 7479 7065 2069 7320 7365 6e74 2074 a type is sent t │ │ │ │ -001b70c0: 6f20 7468 6520 7365 7276 6572 2e3c 2f70 o the server.

    .

    An example │ │ │ │ -001b70e0: 696d 6167 6520 6861 6e64 6c65 7220 7468 image handler th │ │ │ │ -001b70f0: 6174 2063 6865 636b 7320 7468 6520 7370 at checks the sp │ │ │ │ -001b7100: 6563 6966 6963 2069 6d61 6765 2074 7970 ecific image typ │ │ │ │ -001b7110: 653a 3c2f 703e 0a3c 6469 7620 636c 6173 e:

    .
    < │ │ │ │ -001b7140: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -001b7150: 6f72 6474 7970 6522 3e69 6e74 3c2f 7370 ordtype">int image_handle │ │ │ │ -001b7170: 7228 3c73 7061 6e20 636c 6173 733d 226b r(struct soa │ │ │ │ -001b71c0: 703c 2f61 3e20 2a3c 6120 636c 6173 733d p *so │ │ │ │ -001b71f0: 6170 3c2f 613e 2920 3c2f 6469 763e 0a3c ap)
    .< │ │ │ │ -001b7200: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001b7210: 3e7b 3c2f 6469 763e 0a3c 6469 7620 636c >{
    .
    const │ │ │ │ -001b7250: 3c73 7061 6e20 636c 6173 733d 226b 6579 char *buf; .
    size_t l │ │ │ │ -001b72c0: 656e 3b20 3c2f 6469 763e 0a3c 6469 7620 en;
    .
    < │ │ │ │ -001b72e0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ -001b72f0: 656e 7422 3e2f 2f20 6966 206e 6563 6573 ent">// if neces │ │ │ │ -001b7300: 7361 7279 2c20 6368 6563 6b20 7479 7065 sary, check type │ │ │ │ -001b7310: 2069 6e20 736f 6170 2d26 6774 3b68 7474 in soap->htt │ │ │ │ -001b7320: 705f 636f 6e74 656e 7420 3c2f 7370 616e p_content
    .
    if │ │ │ │ -001b7370: 283c 6120 636c 6173 733d 2263 6f64 6522 (soap │ │ │ │ -001b73a0: 2d26 6774 3b3c 6120 636c 6173 733d 2263 ->ht │ │ │ │ -001b73f0: 7470 5f63 6f6e 7465 6e74 3c2f 613e 2026 tp_content & │ │ │ │ -001b7400: 616d 703b 2661 6d70 3b20 213c 6120 636c amp;& !soa │ │ │ │ -001b7460: 705f 7461 675f 636d 703c 2f61 3e28 3c61 p_tag_cmp(soap-&g │ │ │ │ -001b74a0: 743b 3c61 2063 6c61 7373 3d22 636f 6465 t;http_ │ │ │ │ -001b74f0: 636f 6e74 656e 743c 2f61 3e2c 203c 7370 content, "i │ │ │ │ -001b7520: 6d61 6765 2f67 6966 2671 756f 743b 3c2f mage/gif")
    . │ │ │ │ -001b7550: 2020 2020 3c73 7061 6e20 636c 6173 733d re │ │ │ │ -001b7570: 7475 726e 3c2f 7370 616e 3e20 3430 343b turn 404; │ │ │ │ -001b7580: 203c 7370 616e 2063 6c61 7373 3d22 636f // HTTP e │ │ │ │ -001b75a0: 7272 6f72 2034 3034 203c 2f73 7061 6e3e rror 404 │ │ │ │ -001b75b0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    if (( │ │ │ │ -001b75d0: 6275 6620 3d20 3c61 2063 6c61 7373 3d22 buf = soap_http_ │ │ │ │ -001b7630: 6765 745f 626f 6479 3c2f 613e 283c 6120 get_body(soap, &a │ │ │ │ -001b7670: 6d70 3b6c 656e 2929 203d 3d20 4e55 4c4c mp;len)) == NULL │ │ │ │ -001b7680: 293c 2f64 6976 3e0a 3c64 6976 2063 6c61 )
    .
    return soa │ │ │ │ -001b76f0: 703c 2f61 3e2d 2667 743b 3c61 2063 6c61 p->error; .
    / │ │ │ │ -001b7780: 2f20 2e2e 2e20 6e6f 7720 7072 6f63 6573 / ... now proces │ │ │ │ -001b7790: 7320 696d 6167 6520 696e 2062 7566 203c s image in buf < │ │ │ │ -001b77a0: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    . │ │ │ │ -001b77c0: 203c 7370 616e 2063 6c61 7373 3d22 636f // reply │ │ │ │ -001b77e0: 7769 7468 2065 6d70 7479 2048 5454 5020 with empty HTTP │ │ │ │ -001b77f0: 3230 3020 4f4b 2072 6573 706f 6e73 653a 200 OK response: │ │ │ │ -001b7800: 203c 2f73 7061 6e3e 3c2f 6469 763e 0a3c
    .< │ │ │ │ -001b7810: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001b7820: 3e20 203c 7370 616e 2063 6c61 7373 3d22 > ret │ │ │ │ -001b7840: 7572 6e3c 2f73 7061 6e3e 203c 6120 636c urn soap_ │ │ │ │ -001b78a0: 7365 6e64 5f65 6d70 7479 5f72 6573 706f send_empty_respo │ │ │ │ -001b78b0: 6e73 653c 2f61 3e28 3c61 2063 6c61 7373 nse(s │ │ │ │ -001b78e0: 6f61 703c 2f61 3e2c 2032 3030 293b 203c oap, 200); < │ │ │ │ -001b78f0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    }
    . │ │ │ │ -001b7910: 3c64 6976 2063 6c61 7373 3d22 7474 6322
    int soap_ta │ │ │ │ -001b79f0: 675f 636d 7028 636f 6e73 7420 6368 6172 g_cmp(const char │ │ │ │ -001b7a00: 202a 7374 7269 6e67 2c20 636f 6e73 7420 *string, const │ │ │ │ -001b7a10: 6368 6172 202a 7061 7474 6572 6e29 3c2f char *pattern)
    Compare s │ │ │ │ -001b7a40: 7472 696e 6720 746f 2061 2070 6174 7465 tring to a patte │ │ │ │ -001b7a50: 726e 2e3c 2f64 6976 3e3c 2f64 6976 3e0a rn.
    . │ │ │ │ -001b7a60: 3c2f 6469 763e 3c21 2d2d 2066 7261 676d

    The ab │ │ │ │ -001b7a80: 6f76 6520 6578 616d 706c 6520 7265 7475 ove example retu │ │ │ │ -001b7a90: 726e 7320 4854 5450 204f 4b2e 2049 6620 rns HTTP OK. If │ │ │ │ -001b7aa0: 636f 6e74 656e 7420 6973 2073 7570 706f content is suppo │ │ │ │ -001b7ab0: 7365 6420 746f 2062 6520 7265 7475 726e sed to be return │ │ │ │ -001b7ac0: 6564 2c20 7468 656e 2075 7365 3a3c 2f70 ed, then use:

    .
    │ │ │ │ -001b7b10: 7374 7275 6374 203c 2f73 7061 6e3e 3c61 struct soap *< │ │ │ │ -001b7b50: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -001b7b60: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ -001b7b70: 6874 6d6c 223e 736f 6170 3c2f 613e 203d html">soap = │ │ │ │ -001b7b80: 203c 6120 636c 6173 733d 2263 6f64 6522 soap_new();
    .
    .. │ │ │ │ -001b7c00: 2e20 3c73 7061 6e20 636c 6173 733d 2263 . //
    .
    soap->http_cont │ │ │ │ -001b7cc0: 656e 743c 2f61 3e20 3d20 3c73 7061 6e20 ent = "imag │ │ │ │ -001b7cf0: 652f 6a70 6567 2671 756f 743b 3c2f 7370 e/jpeg"; // a │ │ │ │ -001b7d20: 6a70 6567 2069 6d61 6765 2074 6f20 7265 jpeg image to re │ │ │ │ -001b7d30: 7475 726e 2062 6163 6b20 3c2f 7370 616e turn back
    .
    if (< │ │ │ │ -001b7d80: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -001b7d90: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ │ -001b7da0: 705f 5f69 6f2e 6874 6d6c 2367 6130 3339 p__io.html#ga039 │ │ │ │ -001b7db0: 3065 3538 6264 3261 3365 6265 3666 6533 0e58bd2a3ebe6fe3 │ │ │ │ -001b7dc0: 6134 3664 6530 3533 3461 3631 3422 3e73 a46de0534a614">s │ │ │ │ -001b7dd0: 6f61 705f 7265 7370 6f6e 7365 3c2f 613e oap_response │ │ │ │ -001b7de0: 283c 6120 636c 6173 733d 2263 6f64 6522 (soap │ │ │ │ -001b7e10: 2c20 3c61 2063 6c61 7373 3d22 636f 6465 , SOAP_FILE) │ │ │ │ -001b7e70: 2920 3c73 7061 6e20 636c 6173 733d 2263 ) // SOAP_ │ │ │ │ -001b7e90: 4649 4c45 2073 6574 7320 6375 7374 6f6d FILE sets custom │ │ │ │ -001b7ea0: 2068 7474 7020 636f 6e74 656e 7420 3c2f http content
    .
    | │ │ │ │ -001b7ed0: 7c20 3c61 2063 6c61 7373 3d22 636f 6465 | soap_send_raw< │ │ │ │ -001b7f30: 2f61 3e28 3c61 2063 6c61 7373 3d22 636f /a>(soap< │ │ │ │ -001b7f60: 2f61 3e2c 203c 6120 636c 6173 733d 2263 /a>, bu │ │ │ │ -001b7fb0: 663c 2f61 3e2c 206c 656e 2920 3c73 7061 f, len) // send image │ │ │ │ -001b7fe0: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ │ -001b8000: 207c 7c20 3c61 2063 6c61 7373 3d22 636f || soap_end_sen │ │ │ │ -001b8060: 643c 2f61 3e28 3c61 2063 6c61 7373 3d22 d(soa │ │ │ │ -001b8090: 703c 2f61 3e29 3c2f 6469 763e 0a3c 6469 p)
    . │ │ │ │ -001b80b0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 retur │ │ │ │ -001b80d0: 6e3c 2f73 7061 6e3e 203c 6120 636c 6173 n soap_cl │ │ │ │ -001b8130: 6f73 6573 6f63 6b3c 2f61 3e28 3c61 2063 osesock(soap);.
    │ │ │ │ -001b81a0: 7265 7475 726e 3c2f 7370 616e 3e20 3c61 return SOAP_OK;.

    F │ │ │ │ -001b8230: 6f72 2063 6c69 656e 7420 6170 706c 6963 or client applic │ │ │ │ -001b8240: 6174 696f 6e73 2074 6f20 7573 6520 4854 ations to use HT │ │ │ │ -001b8250: 5450 2050 4f53 542c 2075 7365 2074 6865 TP POST, use the │ │ │ │ -001b8260: 203c 636f 6465 3e3c 6120 636c 6173 733d soap_P │ │ │ │ -001b82e0: 4f53 543c 2f61 3e3c 2f63 6f64 653e 206f OST o │ │ │ │ -001b82f0: 7065 7261 7469 6f6e 3a3c 2f70 3e0a 3c64 peration:

    .
    stru │ │ │ │ -001b8340: 6374 203c 2f73 7061 6e3e 3c61 2063 6c61 ct soap *soap = soap_new() │ │ │ │ -001b8410: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
    .
    ... //.
    │ │ │ │ -001b8480: 6368 6172 3c2f 7370 616e 3e20 2a3c 6120 char *buf; < │ │ │ │ -001b84e0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ -001b84f0: 656e 7422 3e2f 2f20 686f 6c64 7320 7468 ent">// holds th │ │ │ │ -001b8500: 6520 4854 5450 2072 6571 7565 7374 2f72 e HTTP request/r │ │ │ │ -001b8510: 6573 706f 6e73 6520 626f 6479 2064 6174 esponse body dat │ │ │ │ -001b8520: 6120 3c2f 7370 616e 3e3c 2f64 6976 3e0a a
    . │ │ │ │ -001b8530: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    size │ │ │ │ -001b8560: 5f74 3c2f 7370 616e 3e20 6c65 6e3b 203c _t len; < │ │ │ │ -001b8570: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ -001b8580: 656e 7422 3e2f 2f20 6c65 6e67 7468 206f ent">// length o │ │ │ │ -001b8590: 6620 6461 7461 203c 2f73 7061 6e3e 3c2f f data .
    ... // populate buf │ │ │ │ -001b85e0: 2061 6e64 206c 656e 2077 6974 6820 6d65 and len with me │ │ │ │ -001b85f0: 7373 6167 6520 746f 2073 656e 643c 2f73 ssage to send
    .
    if │ │ │ │ -001b8640: 2028 3c61 2063 6c61 7373 3d22 636f 6465 (soap_POST( │ │ │ │ -001b86a0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap, │ │ │ │ -001b86d0: 203c 7370 616e 2063 6c61 7373 3d22 7374 &qu │ │ │ │ -001b86f0: 6f74 3b55 524c 2671 756f 743b 3c2f 7370 ot;URL", "SOAP acti │ │ │ │ -001b8730: 6f6e 206f 7220 4e55 4c4c 2671 756f 743b on or NULL" │ │ │ │ -001b8740: 3c2f 7370 616e 3e2c 203c 7370 616e 2063 , "media │ │ │ │ -001b8770: 2074 7970 6526 7175 6f74 3b3c 2f73 7061 type")
    .
    || │ │ │ │ -001b87a0: 203c 6120 636c 6173 733d 2263 6f64 6522 soap_send_raw(soap, buf │ │ │ │ -001b8880: 3c2f 613e 2c20 6c65 6e29 3b20 3c2f 6469 , len); .
    || soap_en │ │ │ │ -001b8900: 645f 7365 6e64 3c2f 613e 283c 6120 636c d_send(soap)) .
    ... // error │ │ │ │ -001b8980: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    ..< │ │ │ │ -001b8a60: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001b8a70: 3e20 7c7c 2028 3c61 2063 6c61 7373 3d22 > || (b │ │ │ │ -001b8ac0: 7566 3c2f 613e 203d 203c 6120 636c 6173 uf = soap_ht │ │ │ │ -001b8b20: 7470 5f67 6574 5f62 6f64 793c 2f61 3e28 tp_get_body( │ │ │ │ -001b8b30: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap, │ │ │ │ -001b8b60: 2026 616d 703b 6c65 6e29 2920 3d3d 204e &len)) == N │ │ │ │ -001b8b70: 554c 4c3c 2f64 6976 3e0a 3c64 6976 2063 ULL
    .. │ │ │ │ -001b8c30: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    ... // │ │ │ │ -001b8c60: 2065 7272 6f72 3c2f 7370 616e 3e3c 2f64 error.
    // . │ │ │ │ -001b8ca0: 2e2e 2075 7365 2062 7566 5b30 2e2e 6c65 .. use buf[0..le │ │ │ │ -001b8cb0: 6e2d 315d 203c 2f73 7061 6e3e 3c2f 6469 n-1] ..
    │ │ │ │ -001b8fa0: 696e 7420 736f 6170 5f62 6567 696e 5f72 int soap_begin_r │ │ │ │ -001b8fb0: 6563 7628 7374 7275 6374 2073 6f61 7020 ecv(struct soap │ │ │ │ -001b8fc0: 2a73 6f61 7029 3c2f 6469 763e 3c64 6976 *soap)
    I │ │ │ │ -001b8fe0: 6e69 7469 616c 697a 6520 7468 6520 636f nitialize the co │ │ │ │ -001b8ff0: 6e74 6578 7420 666f 7220 7265 6365 6976 ntext for receiv │ │ │ │ -001b9000: 696e 672e 3c2f 6469 763e 3c2f 6469 763e ing.
    │ │ │ │ -001b9010: 0a3c 6469 7620 636c 6173 733d 2274 7463 .
    i │ │ │ │ -001b90e0: 6e74 2073 6f61 705f 504f 5354 2873 7472 nt soap_POST(str │ │ │ │ -001b90f0: 7563 7420 736f 6170 202a 736f 6170 2c20 uct soap *soap, │ │ │ │ -001b9100: 636f 6e73 7420 6368 6172 202a 656e 6470 const char *endp │ │ │ │ -001b9110: 6f69 6e74 2c20 636f 6e73 7420 6368 6172 oint, const char │ │ │ │ -001b9120: 202a 6163 7469 6f6e 2c20 636f 6e73 7420 *action, const │ │ │ │ -001b9130: 6368 6172 202a 7479 7065 293c 2f64 6976 char *type)
    HTTP POST co │ │ │ │ -001b9160: 6e74 656e 7420 746f 2073 6572 7665 722e ntent to server. │ │ │ │ -001b9170: 3c2f 6469 763e 3c2f 6469 763e 0a3c 2f64
    .

    Similarly │ │ │ │ -001b91a0: 2c20 3c63 6f64 653e 3c61 2063 6c61 7373 , soap_P │ │ │ │ -001b9220: 5554 3c2f 613e 3c2f 636f 6465 3e2c 203c UT, < │ │ │ │ -001b9230: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soap_PA │ │ │ │ -001b92b0: 5443 483c 2f61 3e3c 2f63 6f64 653e 2c20 TCH, │ │ │ │ -001b92c0: 616e 6420 3c63 6f64 653e 3c61 2063 6c61 and soap_DELETE │ │ │ │ -001b9350: 3c2f 636f 6465 3e20 636f 6d6d 616e 6473 commands │ │ │ │ -001b9360: 2061 7265 2070 726f 7669 6465 6420 666f are provided fo │ │ │ │ -001b9370: 7220 5055 542c 2050 4154 4348 2c20 616e r PUT, PATCH, an │ │ │ │ -001b9380: 6420 4445 4c45 5445 2068 616e 646c 696e d DELETE handlin │ │ │ │ -001b9390: 672e 3c2f 703e 0a3c 703e 546f 2073 7570 g.

    .

    To sup │ │ │ │ -001b93a0: 706f 7274 2048 5454 5020 7069 7065 6c69 port HTTP pipeli │ │ │ │ -001b93b0: 6e69 6e67 2077 6520 7573 6520 7468 6520 ning we use the │ │ │ │ -001b93c0: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 ht │ │ │ │ -001b9450: 7470 5f70 6970 653c 2f61 3e3c 2f63 6f64 tp_pipe plugin, which │ │ │ │ -001b9470: 2063 616e 2062 6520 7573 6564 2061 7420 can be used at │ │ │ │ -001b9480: 7468 6520 7365 7276 6572 2073 6964 6520 the server side │ │ │ │ -001b9490: 746f 2065 6e61 626c 6520 4854 5450 2070 to enable HTTP p │ │ │ │ -001b94a0: 6970 656c 696e 696e 6720 6175 746f 6d61 ipelining automa │ │ │ │ -001b94b0: 7469 6361 6c6c 792c 2077 6865 6e20 7265 tically, when re │ │ │ │ -001b94c0: 6769 7374 6572 6564 2e20 5468 6520 706c gistered. The pl │ │ │ │ -001b94d0: 7567 696e 2063 616e 2061 6c73 6f20 6265 ugin can also be │ │ │ │ -001b94e0: 2075 7365 6420 6174 2074 6865 2063 6c69 used at the cli │ │ │ │ -001b94f0: 656e 7420 7369 6465 2c20 7468 6f75 6768 ent side, though │ │ │ │ -001b9500: 2074 6869 7320 6973 206f 6e6c 7920 6e65 this is only ne │ │ │ │ -001b9510: 6365 7373 6172 7920 696e 2073 6365 6e61 cessary in scena │ │ │ │ -001b9520: 7269 6f73 2074 6861 7420 7265 7175 6972 rios that requir │ │ │ │ -001b9530: 6520 7468 6520 636c 6965 6e74 2074 6f20 e the client to │ │ │ │ -001b9540: 7265 6365 6976 6520 6d75 6c74 6970 6c65 receive multiple │ │ │ │ -001b9550: 206d 6573 7361 6765 7320 7769 7468 6f75 messages withou │ │ │ │ -001b9560: 7420 696e 7465 726d 6974 7465 6e64 2073 t intermittend s │ │ │ │ -001b9570: 656e 6473 2c20 692e 652e 206d 756c 7469 ends, i.e. multi │ │ │ │ -001b9580: 706c 6520 7365 6e64 7320 666f 6c6c 6f77 ple sends follow │ │ │ │ -001b9590: 6564 2062 7920 6d75 6c74 6970 6c65 2072 ed by multiple r │ │ │ │ -001b95a0: 6563 6569 7665 7320 6279 2074 6865 2073 eceives by the s │ │ │ │ -001b95b0: 616d 6520 7468 7265 6164 2075 7369 6e67 ame thread using │ │ │ │ -001b95c0: 2074 6865 2073 616d 6520 3c63 6f64 653e the same │ │ │ │ -001b95d0: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap │ │ │ │ -001b9620: 3c2f 613e 3c2f 636f 6465 3e20 636f 6e74 cont │ │ │ │ -001b9630: 6578 742e 2048 6f77 6576 6572 2c20 636c ext. However, cl │ │ │ │ -001b9640: 6965 6e74 7320 7368 6f75 6c64 2075 7365 ients should use │ │ │ │ -001b9650: 206d 756c 7469 706c 6520 7468 7265 6164 multiple thread │ │ │ │ -001b9660: 7320 7768 656e 2048 5454 5020 7069 7065 s when HTTP pipe │ │ │ │ -001b9670: 6c69 6e69 6e67 2069 7320 7573 6564 2074 lining is used t │ │ │ │ -001b9680: 6f20 7072 6576 656e 7420 626c 6f63 6b69 o prevent blocki │ │ │ │ -001b9690: 6e67 2e20 5365 6520 7468 6520 3c65 6d3e ng. See the │ │ │ │ -001b96a0: 3c63 6f64 653e 6773 6f61 702f 7361 6d70 gsoap/samp │ │ │ │ -001b96b0: 6c65 732f 6173 796e 633c 2f63 6f64 653e les/async │ │ │ │ -001b96c0: 3c2f 656d 3e20 666f 6c64 6572 2069 6e20 folder in │ │ │ │ -001b96d0: 7468 6520 6753 4f41 5020 7061 636b 6167 the gSOAP packag │ │ │ │ -001b96e0: 6520 666f 7220 6578 706c 616e 6174 696f e for explanatio │ │ │ │ -001b96f0: 6e20 616e 6420 6578 616d 706c 6573 2e3c n and examples.< │ │ │ │ -001b9700: 2f70 3e0a 3c70 3e53 6565 2061 6c73 6f20 /p>.

    See also │ │ │ │ -001b9710: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 http_pos │ │ │ │ -001b97a0: 743c 2f61 3e3c 2f63 6f64 653e 2061 6e64 t and │ │ │ │ -001b97b0: 203c 636f 6465 3e3c 6120 636c 6173 733d h │ │ │ │ -001b9840: 7474 705f 7069 7065 3c2f 613e 3c2f 636f ttp_pipe.

    .

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

    .< │ │ │ │ -001b9890: 6833 3e3c 6120 636c 6173 733d 2261 6e63 h3>.The │ │ │ │ -001b98c0: 4854 5450 2064 6967 6573 7420 6175 7468 HTTP digest auth │ │ │ │ -001b98d0: 656e 7469 6361 7469 6f6e 2070 6c75 6769 entication plugi │ │ │ │ -001b98e0: 6e3c 2f68 333e 0a3c 703e 5468 6520 4854 n.

    The HT │ │ │ │ -001b98f0: 5450 2064 6967 6573 7420 6175 7468 656e TP digest authen │ │ │ │ -001b9900: 7469 6361 7469 6f6e 2070 6c75 6769 6e20 tication plugin │ │ │ │ -001b9910: 656e 6162 6c65 7320 6120 6d6f 7265 2073 enables a more s │ │ │ │ -001b9920: 6563 7572 6520 6175 7468 656e 7469 6361 ecure authentica │ │ │ │ -001b9930: 7469 6f6e 2073 6368 656d 6520 636f 6d70 tion scheme comp │ │ │ │ -001b9940: 6172 6564 2074 6f20 6261 7369 6320 6175 ared to basic au │ │ │ │ -001b9950: 7468 656e 7469 6361 7469 6f6e 2e20 4854 thentication. HT │ │ │ │ -001b9960: 5450 2062 6173 6963 2061 7574 6865 6e74 TP basic authent │ │ │ │ -001b9970: 6963 6174 696f 6e20 7365 6e64 7320 756e ication sends un │ │ │ │ -001b9980: 656e 6372 7970 7465 6420 7573 6572 6964 encrypted userid │ │ │ │ -001b9990: 7320 616e 6420 7061 7373 776f 7264 7320 s and passwords │ │ │ │ -001b99a0: 6f76 6572 2074 6865 206e 6574 2c20 7768 over the net, wh │ │ │ │ -001b99b0: 696c 6520 6469 6765 7374 2061 7574 6865 ile digest authe │ │ │ │ -001b99c0: 6e74 6963 6174 696f 6e20 646f 6573 206e ntication does n │ │ │ │ -001b99d0: 6f74 2065 7863 6861 6e67 6520 7061 7373 ot exchange pass │ │ │ │ -001b99e0: 776f 7264 7320 6275 7420 6578 6368 616e words but exchan │ │ │ │ -001b99f0: 6765 7320 6368 6563 6b73 756d 7320 6f66 ges checksums of │ │ │ │ -001b9a00: 2070 6173 7377 6f72 6473 2028 616e 6420 passwords (and │ │ │ │ -001b9a10: 6f74 6865 7220 6461 7461 2073 7563 6820 other data such │ │ │ │ -001b9a20: 6173 206e 6f6e 6365 7320 746f 2061 766f as nonces to avo │ │ │ │ -001b9a30: 6964 2072 6570 6c61 7920 6174 7461 636b id replay attack │ │ │ │ -001b9a40: 7329 2e20 466f 7220 6d6f 7265 2064 6574 s). For more det │ │ │ │ -001b9a50: 6169 6c73 2c20 706c 6561 7365 2073 6565 ails, please see │ │ │ │ -001b9a60: 2052 4643 2032 3631 372e 3c2f 703e 0a3c RFC 2617.

    .< │ │ │ │ -001b9a70: 703e 5468 6520 4854 5450 2064 6967 6573 p>The HTTP diges │ │ │ │ -001b9a80: 7420 6175 7468 656e 7469 6361 7469 6f6e t authentication │ │ │ │ -001b9a90: 2063 616e 2062 6520 7573 6564 206e 6578 can be used nex │ │ │ │ -001b9aa0: 7420 746f 2074 6865 2062 7569 6c74 2d69 t to the built-i │ │ │ │ -001b9ab0: 6e20 6261 7369 6320 6175 7468 656e 7469 n basic authenti │ │ │ │ -001b9ac0: 6361 7469 6f6e 2c20 6f72 2062 6173 6963 cation, or basic │ │ │ │ -001b9ad0: 2061 7574 6865 6e74 6963 6174 696f 6e20 authentication │ │ │ │ -001b9ae0: 6361 6e20 6265 2072 656a 6563 7465 6420 can be rejected │ │ │ │ -001b9af0: 746f 2074 6967 6874 656e 2073 6563 7572 to tighten secur │ │ │ │ -001b9b00: 6974 792e 2054 6865 2073 6572 7665 7220 ity. The server │ │ │ │ -001b9b10: 6d75 7374 2068 6176 6520 6120 6461 7461 must have a data │ │ │ │ -001b9b20: 6261 7365 2077 6974 6820 7573 6572 6964 base with userid │ │ │ │ -001b9b30: 2773 2061 6e64 2070 6173 7377 6f72 6473 's and passwords │ │ │ │ -001b9b40: 2028 696e 2070 6c61 696e 2074 6578 7420 (in plain text │ │ │ │ -001b9b50: 666f 726d 292e 2054 6865 2063 6c69 656e form). The clien │ │ │ │ -001b9b60: 742c 2077 6865 6e20 6368 616c 6c65 6e67 t, when challeng │ │ │ │ -001b9b70: 6564 2062 7920 7468 6520 7365 7276 6572 ed by the server │ │ │ │ -001b9b80: 2c20 6368 6563 6b73 2074 6865 2061 7574 , checks the aut │ │ │ │ -001b9b90: 6865 6e74 6963 6174 696f 6e20 7265 616c hentication real │ │ │ │ -001b9ba0: 6d20 7072 6f76 6964 6564 2062 7920 7468 m provided by th │ │ │ │ -001b9bb0: 6520 7365 7276 6572 2061 6e64 2073 6574 e server and set │ │ │ │ -001b9bc0: 7320 7468 6520 7573 6572 6964 2061 6e64 s the userid and │ │ │ │ -001b9bd0: 2070 6173 7377 6f72 6473 2066 6f72 2064 passwords for d │ │ │ │ -001b9be0: 6967 6573 7420 6175 7468 656e 7469 6361 igest authentica │ │ │ │ -001b9bf0: 7469 6f6e 2e20 5468 6520 636c 6965 6e74 tion. The client │ │ │ │ -001b9c00: 2061 7070 6c69 6361 7469 6f6e 2063 616e application can │ │ │ │ -001b9c10: 2074 656d 706f 7261 7269 6c79 2073 746f temporarily sto │ │ │ │ -001b9c20: 7265 2074 6865 2075 7365 7269 6420 616e re the userid an │ │ │ │ -001b9c30: 6420 7061 7373 776f 7264 2066 6f72 2061 d password for a │ │ │ │ -001b9c40: 2073 6571 7565 6e63 6520 6f66 206d 6573 sequence of mes │ │ │ │ -001b9c50: 7361 6765 2065 7863 6861 6e67 6573 2077 sage exchanges w │ │ │ │ -001b9c60: 6974 6820 7468 6520 7365 7276 6572 2c20 ith the server, │ │ │ │ -001b9c70: 7768 6963 6820 6973 2066 6173 7465 7220 which is faster │ │ │ │ -001b9c80: 7468 616e 2072 6570 6561 7465 6420 6175 than repeated au │ │ │ │ -001b9c90: 7468 6f72 697a 6174 696f 6e20 6368 616c thorization chal │ │ │ │ -001b9ca0: 6c65 6e67 6573 2061 6e64 2061 7574 6865 lenges and authe │ │ │ │ -001b9cb0: 6e74 6963 6174 696f 6e20 7265 7370 6f6e ntication respon │ │ │ │ -001b9cc0: 7365 732e 3c2f 703e 0a3c 703e 4174 2074 ses.

    .

    At t │ │ │ │ -001b9cd0: 6865 2063 6c69 656e 7420 7369 6465 2c20 he client side, │ │ │ │ -001b9ce0: 7468 6520 706c 7567 696e 2069 7320 7265 the plugin is re │ │ │ │ -001b9cf0: 6769 7374 6572 6564 2061 6e64 2073 6572 gistered and ser │ │ │ │ -001b9d00: 7669 6365 2069 6e76 6f63 6174 696f 6e73 vice invocations │ │ │ │ -001b9d10: 2061 7265 2063 6865 636b 6564 2066 6f72 are checked for │ │ │ │ -001b9d20: 2061 7574 686f 7269 7a61 7469 6f6e 2063 authorization c │ │ │ │ -001b9d30: 6861 6c6c 656e 6765 7320 2848 5454 5020 hallenges (HTTP │ │ │ │ -001b9d40: 6572 726f 7220 636f 6465 2034 3031 292e error code 401). │ │ │ │ -001b9d50: 2057 6865 6e20 7468 6520 7365 7276 6572 When the server │ │ │ │ -001b9d60: 2063 6861 6c6c 656e 6765 7320 7468 6520 challenges the │ │ │ │ -001b9d70: 636c 6965 6e74 2c20 7468 6520 636c 6965 client, the clie │ │ │ │ -001b9d80: 6e74 2073 686f 756c 6420 7365 7420 7468 nt should set th │ │ │ │ -001b9d90: 6520 7573 6572 6964 2061 6e64 2070 6173 e userid and pas │ │ │ │ -001b9da0: 7377 6f72 6420 616e 6420 7265 7472 7920 sword and retry │ │ │ │ -001b9db0: 7468 6520 696e 766f 6361 7469 6f6e 2e20 the invocation. │ │ │ │ -001b9dc0: 5468 6520 636c 6965 6e74 2063 616e 2064 The client can d │ │ │ │ -001b9dd0: 6574 6572 6d69 6e65 2074 6865 2075 7365 etermine the use │ │ │ │ -001b9de0: 7269 6420 616e 6420 7061 7373 776f 7264 rid and password │ │ │ │ -001b9df0: 2062 6173 6564 206f 6e20 7468 6520 6175 based on the au │ │ │ │ -001b9e00: 7468 656e 7469 6361 7469 6f6e 2072 6561 thentication rea │ │ │ │ -001b9e10: 6c6d 2070 6172 7420 6f66 2074 6865 2073 lm part of the s │ │ │ │ -001b9e20: 6572 7665 7227 7320 6368 616c 6c65 6e67 erver's challeng │ │ │ │ -001b9e30: 652e 2054 6865 2061 7574 6865 6e74 6963 e. The authentic │ │ │ │ -001b9e40: 6174 696f 6e20 696e 666f 726d 6174 696f ation informatio │ │ │ │ -001b9e50: 6e20 6361 6e20 6265 2074 656d 706f 7261 n can be tempora │ │ │ │ -001b9e60: 7269 6c79 2073 6176 6564 2066 6f72 206d rily saved for m │ │ │ │ -001b9e70: 756c 7469 706c 6520 696e 766f 6361 7469 ultiple invocati │ │ │ │ -001b9e80: 6f6e 732e 3c2f 703e 0a3c 703e 436c 6965 ons.

    .

    Clie │ │ │ │ -001b9e90: 6e74 2d73 6964 6520 6578 616d 706c 653a nt-side example: │ │ │ │ -001b9ea0: 3c2f 703e 0a3c 6469 7620 636c 6173 733d

    .
    #include │ │ │ │ -001b9ef0: 2026 7175 6f74 3b68 7474 7064 612e 6826 "httpda.h& │ │ │ │ -001b9f00: 7175 6f74 3b3c 2f73 7061 6e3e 203c 2f64 quot; .
    . │ │ │ │ -001b9f40: 3c73 7061 6e20 636c 6173 733d 226b 6579 int
    main()
    .
    {
    ..
    │ │ │ │ -001ba0c0: 6966 3c2f 7370 616e 3e20 3c61 2063 6c61 if so │ │ │ │ -001ba120: 6170 5f72 6567 6973 7465 725f 706c 7567 ap_register_plug │ │ │ │ -001ba130: 696e 3c2f 613e 283c 6120 636c 6173 733d in(so │ │ │ │ -001ba160: 6170 3c2f 613e 2c20 6874 7470 5f64 6129 ap, http_da) │ │ │ │ -001ba170: 2920 3c2f 6469 763e 0a3c 6469 7620 636c )
    .
    e │ │ │ │ -001ba190: 7869 7428 4558 4954 5f46 4149 4c55 5245 xit(EXIT_FAILURE │ │ │ │ -001ba1a0: 293b 203c 7370 616e 2063 6c61 7373 3d22 ); // fail │ │ │ │ -001ba1c0: 6564 2074 6f20 7265 6769 7374 6572 203c ed to register < │ │ │ │ -001ba1d0: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    . │ │ │ │ -001ba1f0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 if
    (soap_call_ │ │ │ │ -001ba220: 6e73 5f5f 7765 626d 6574 686f 6428 3c61 ns__webmethod(soap, . │ │ │ │ -001ba260: 2e2e 2929 203c 2f64 6976 3e0a 3c64 6976 ..))
    .
    │ │ │ │ -001ba280: 7b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 {
    .
    if (soap-> │ │ │ │ -001ba340: 6572 726f 723c 2f61 3e20 3d3d 2034 3031 error == 401 │ │ │ │ -001ba350: 2920 3c73 7061 6e20 636c 6173 733d 2263 ) // chall │ │ │ │ -001ba370: 656e 6765 3a20 4854 5450 2061 7574 6865 enge: HTTP authe │ │ │ │ -001ba380: 6e74 6963 6174 696f 6e20 7265 7175 6972 ntication requir │ │ │ │ -001ba390: 6564 203c 2f73 7061 6e3e 3c2f 6469 763e ed
    │ │ │ │ -001ba3a0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    {
    .< │ │ │ │ -001ba3c0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001ba3d0: 3e20 2020 2020 203c 7370 616e 2063 6c61 > if (!str │ │ │ │ -001ba400: 636d 7028 3c61 2063 6c61 7373 3d22 636f cmp(soap< │ │ │ │ -001ba430: 2f61 3e2d 2667 743b 3c61 2063 6c61 7373 /a>->authrealm, │ │ │ │ -001ba490: 3c61 2063 6c61 7373 3d22 636f 6465 2220 authrea │ │ │ │ -001ba4e0: 6c6d 3c2f 613e 2929 203c 7370 616e 2063 lm)) / │ │ │ │ -001ba500: 2f20 6f70 7469 6f6e 616c 6c79 2064 6574 / optionally det │ │ │ │ -001ba510: 6572 6d69 6e65 2061 7574 6865 6e74 6963 ermine authentic │ │ │ │ -001ba520: 6174 696f 6e20 7265 616c 6d3c 2f73 7061 ation realm
    .
    │ │ │ │ -001ba550: 207b 3c2f 6469 763e 0a3c 6469 7620 636c {
    .
    │ │ │ │ -001ba570: 2020 203c 7370 616e 2063 6c61 7373 3d22 struct │ │ │ │ -001ba590: 3c2f 7370 616e 3e68 7474 705f 6461 5f69 http_da_i │ │ │ │ -001ba5a0: 6e66 6f20 696e 666f 3b20 3c73 7061 6e20 nfo info; │ │ │ │ -001ba5c0: 2f2f 2074 6f20 7374 6f72 6520 7573 6572 // to store user │ │ │ │ -001ba5d0: 6964 2061 6e64 2070 6173 7377 6420 3c2f id and passwd
    .
    │ │ │ │ -001ba600: 2020 2020 2020 6874 7470 5f64 615f 7361 http_da_sa │ │ │ │ -001ba610: 7665 283c 6120 636c 6173 733d 2263 6f64 ve(soap, &info, a │ │ │ │ -001ba650: 7574 6872 6561 6c6d 2c20 7573 6572 6964 uthrealm, userid │ │ │ │ -001ba660: 2c20 7061 7373 7764 293b 203c 7370 616e , passwd); // set userid a │ │ │ │ -001ba690: 6e64 2070 6173 7377 6420 666f 7220 7468 nd passwd for th │ │ │ │ -001ba6a0: 6973 2072 6561 6c6d 3c2f 7370 616e 3e3c is realm< │ │ │ │ -001ba6b0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    │ │ │ │ -001ba6d0: 3c73 7061 6e20 636c 6173 733d 226b 6579 if (soap_call_n │ │ │ │ -001ba700: 735f 5f77 6562 6d65 7468 6f64 283c 6120 s__webmethod(soap, .. │ │ │ │ -001ba740: 2e29 2920 3c73 7061 6e20 636c 6173 733d .)) // ret │ │ │ │ -001ba760: 7279 203c 2f73 7061 6e3e 3c2f 6469 763e ry
    │ │ │ │ -001ba770: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    {.
    . │ │ │ │ -001ba7b0: 2e2e 203c 7370 616e 2063 6c61 7373 3d22 .. //
    .
    │ │ │ │ -001ba7f0: 2020 2020 203c 6120 636c 6173 733d 2263 soap_e │ │ │ │ -001ba850: 6e64 3c2f 613e 283c 6120 636c 6173 733d nd(so │ │ │ │ -001ba880: 6170 3c2f 613e 293b 203c 7370 616e 2063 ap); / │ │ │ │ -001ba8a0: 2f20 7573 6572 6964 2061 6e64 2070 6173 / userid and pas │ │ │ │ -001ba8b0: 7377 6420 7765 7265 2064 6561 6c6c 6f63 swd were dealloc │ │ │ │ -001ba8c0: 6174 6564 203c 2f73 7061 6e3e 3c2f 6469 ated .
    h │ │ │ │ -001ba8f0: 7474 705f 6461 5f72 6573 746f 7265 283c ttp_da_restore(< │ │ │ │ -001ba900: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -001ba910: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ -001ba920: 6874 6d6c 223e 736f 6170 3c2f 613e 2c20 html">soap, │ │ │ │ -001ba930: 2661 6d70 3b69 6e66 6f29 3b20 3c73 7061 &info); // restore use │ │ │ │ -001ba960: 7269 6420 616e 6420 7061 7373 7764 203c rid and passwd < │ │ │ │ -001ba970: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    . │ │ │ │ -001ba990: 2020 2020 2020 2020 203c 7370 616e 2063 if (!s │ │ │ │ -001ba9c0: 6f61 705f 6361 6c6c 5f6e 735f 5f77 6562 oap_call_ns__web │ │ │ │ -001ba9d0: 6d65 7468 6f64 283c 6120 636c 6173 733d method(so │ │ │ │ -001baa00: 6170 3c2f 613e 2c20 2e2e 2e29 2920 3c73 ap, ...)) // another c │ │ │ │ -001baa30: 616c 6c20 3c2f 7370 616e 3e3c 2f64 6976 all
    .
    │ │ │ │ -001baa60: 2e2e 2e20 3c73 7061 6e20 636c 6173 733d ... //
    .
    │ │ │ │ -001baaa0: 2020 2020 7d3c 2f64 6976 3e0a 3c64 6976 }
    .
    │ │ │ │ -001baac0: 2020 2020 7d3c 2f64 6976 3e0a 3c64 6976 }
    .
    │ │ │ │ -001baae0: 2020 7d3c 2f64 6976 3e0a 3c64 6976 2063 }
    .
    }< │ │ │ │ -001bab00: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    http_d │ │ │ │ -001bab20: 615f 7265 6c65 6173 6528 3c61 2063 6c61 a_release(soap, & │ │ │ │ -001bab60: 696e 666f 293b 203c 7370 616e 2063 6c61 info); // │ │ │ │ -001bab80: 746f 2072 656d 6f76 6520 616c 6c20 7573 to remove all us │ │ │ │ -001bab90: 6572 6964 2061 6e64 2070 6173 7377 643c erid and passwd< │ │ │ │ -001baba0: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    . │ │ │ │ -001babc0: 203c 6120 636c 6173 733d 2263 6f64 6522 soap_destr │ │ │ │ -001bac20: 6f79 3c2f 613e 283c 6120 636c 6173 733d oy(so │ │ │ │ -001bac50: 6170 3c2f 613e 293b 3c2f 6469 763e 0a3c ap);
    .< │ │ │ │ -001bac60: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001bac70: 3e20 203c 6120 636c 6173 733d 2263 6f64 > soap_end │ │ │ │ -001bacd0: 3c2f 613e 283c 6120 636c 6173 733d 2263 (soap │ │ │ │ -001bad00: 3c2f 613e 293b 3c2f 6469 763e 0a3c 6469 );
    . │ │ │ │ -001bad20: 203c 6120 636c 6173 733d 2263 6f64 6522 soap_free< │ │ │ │ -001bad80: 2f61 3e28 3c61 2063 6c61 7373 3d22 636f /a>(soap< │ │ │ │ -001badb0: 2f61 3e29 3b3c 2f64 6976 3e0a 3c64 6976 /a>);
    .
    }< │ │ │ │ -001badd0: 2f64 6976 3e0a 3c2f 6469 763e 3c21 2d2d /div>.

    │ │ │ │ -001badf0: 5468 6973 2063 6f64 6520 7375 7070 6f72 This code suppor │ │ │ │ -001bae00: 7473 2062 6f74 6820 6261 7369 6320 616e ts both basic an │ │ │ │ -001bae10: 6420 6469 6765 7374 2061 7574 6865 6e74 d digest authent │ │ │ │ -001bae20: 6963 6174 696f 6e2e 3c2f 703e 0a3c 703e ication.

    .

    │ │ │ │ -001bae30: 5468 6520 7365 7276 6572 2063 616e 2063 The server can c │ │ │ │ -001bae40: 6861 6c6c 656e 6765 2061 2063 6c69 656e hallenge a clien │ │ │ │ -001bae50: 7420 7573 696e 6720 4854 5450 2063 6f64 t using HTTP cod │ │ │ │ -001bae60: 6520 3430 312e 2057 6974 6820 7468 6520 e 401. With the │ │ │ │ -001bae70: 706c 7567 696e 2c20 4854 5450 2064 6967 plugin, HTTP dig │ │ │ │ -001bae80: 6573 7420 6175 7468 656e 7469 6361 7469 est authenticati │ │ │ │ -001bae90: 6f6e 2063 6861 6c6c 656e 6765 7320 6172 on challenges ar │ │ │ │ -001baea0: 6520 7365 6e64 2e20 5769 7468 6f75 7420 e send. Without │ │ │ │ -001baeb0: 7468 6520 706c 7567 696e 2c20 6261 7369 the plugin, basi │ │ │ │ -001baec0: 6320 6175 7468 656e 7469 6361 7469 6f6e c authentication │ │ │ │ -001baed0: 2063 6861 6c6c 656e 6765 7320 6172 6520 challenges are │ │ │ │ -001baee0: 7365 6e64 2e3c 2f70 3e0a 3c70 3e45 6163 send.

    .

    Eac │ │ │ │ -001baef0: 6820 7365 7276 6572 206d 6574 686f 6420 h server method │ │ │ │ -001baf00: 6361 6e20 696d 706c 656d 656e 7420 6175 can implement au │ │ │ │ -001baf10: 7468 656e 7469 6361 7469 6f6e 2061 7320 thentication as │ │ │ │ -001baf20: 6465 7369 7265 6420 616e 6420 6d61 7920 desired and may │ │ │ │ -001baf30: 656e 666f 7263 6520 6469 6765 7374 2061 enforce digest a │ │ │ │ -001baf40: 7574 6865 6e74 6963 6174 696f 6e20 6f72 uthentication or │ │ │ │ -001baf50: 206d 6179 2061 6c73 6f20 6163 6365 7074 may also accept │ │ │ │ -001baf60: 2062 6173 6963 2061 7574 6865 6e74 6963 basic authentic │ │ │ │ -001baf70: 6174 696f 6e20 7265 7370 6f6e 7365 732e ation responses. │ │ │ │ -001baf80: 2054 6f20 7665 7269 6679 2064 6967 6573 To verify diges │ │ │ │ -001baf90: 7420 6175 7468 656e 7469 6361 7469 6f6e t authentication │ │ │ │ -001bafa0: 2072 6573 706f 6e73 6573 2c20 7468 6520 responses, the │ │ │ │ -001bafb0: 7365 7276 6572 2073 686f 756c 6420 636f server should co │ │ │ │ -001bafc0: 6d70 7574 6520 616e 6420 636f 6d70 6172 mpute and compar │ │ │ │ -001bafd0: 6520 7468 6520 6368 6563 6b73 756d 7320 e the checksums │ │ │ │ -001bafe0: 7573 696e 6720 7468 6520 706c 7567 696e using the plugin │ │ │ │ -001baff0: 2773 203c 636f 6465 3e68 7474 705f 6461 's http_da │ │ │ │ -001bb000: 5f76 6572 6966 795f 706f 7374 3c2f 636f _verify_post function for │ │ │ │ -001bb020: 2048 5454 5020 504f 5354 2072 6571 7565 HTTP POST reque │ │ │ │ -001bb030: 7374 7320 2861 6e64 203c 636f 6465 3e68 sts (and h │ │ │ │ -001bb040: 7474 705f 6461 5f76 6572 6966 795f 6765 ttp_da_verify_ge │ │ │ │ -001bb050: 743c 2f63 6f64 653e 2066 6f72 2048 5454 t for HTT │ │ │ │ -001bb060: 5020 4745 5420 7265 7175 6573 7473 2077 P GET requests w │ │ │ │ -001bb070: 6974 6820 7468 6520 4854 5450 2047 4554 ith the HTTP GET │ │ │ │ -001bb080: 2070 6c75 6769 6e29 2061 7320 666f 6c6c plugin) as foll │ │ │ │ -001bb090: 6f77 733a 3c2f 703e 0a3c 6469 7620 636c ows:

    .
    < │ │ │ │ -001bb0b0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001bb0c0: 3e3c 7370 616e 2063 6c61 7373 3d22 7072 >#inc │ │ │ │ -001bb0e0: 6c75 6465 2026 7175 6f74 3b68 7474 7064 lude "httpd │ │ │ │ -001bb0f0: 612e 6826 7175 6f74 3b3c 2f73 7061 6e3e a.h" │ │ │ │ -001bb100: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    .
    in │ │ │ │ -001bb150: 743c 2f73 7061 6e3e 206d 6169 6e28 293c t main()< │ │ │ │ -001bb160: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    {
    . │ │ │ │ -001bb180: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    struct │ │ │ │ -001bb1b0: 203c 2f73 7061 6e3e 3c61 2063 6c61 7373 s │ │ │ │ -001bb1e0: 6f61 703c 2f61 3e20 2a3c 6120 636c 6173 oap * │ │ │ │ -001bb210: 736f 6170 3c2f 613e 203d 203c 6120 636c soap = │ │ │ │ -001bb270: 736f 6170 5f6e 6577 3c2f 613e 2829 3b3c soap_new();< │ │ │ │ -001bb280: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    if (< │ │ │ │ -001bb2c0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -001bb2d0: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ │ -001bb2e0: 705f 5f70 6c75 6769 6e2e 6874 6d6c 2367 p__plugin.html#g │ │ │ │ -001bb2f0: 6164 3634 3565 3561 3538 6564 3434 3266 ad645e5a58ed442f │ │ │ │ -001bb300: 6534 3735 3364 6363 3233 3338 6338 6264 e4753dcc2338c8bd │ │ │ │ -001bb310: 6222 3e73 6f61 705f 7265 6769 7374 6572 b">soap_register │ │ │ │ -001bb320: 5f70 6c75 6769 6e3c 2f61 3e28 3c61 2063 _plugin(soap, htt │ │ │ │ -001bb360: 705f 6461 2929 203c 2f64 6976 3e0a 3c64 p_da))
    . │ │ │ │ -001bb380: 2020 2020 6578 6974 2845 5849 545f 4641 exit(EXIT_FA │ │ │ │ -001bb390: 494c 5552 4529 3b20 3c73 7061 6e20 636c ILURE); // │ │ │ │ -001bb3b0: 2066 6169 6c65 6420 746f 2072 6567 6973 failed to regis │ │ │ │ -001bb3c0: 7465 7220 3c2f 7370 616e 3e3c 2f64 6976 ter
    .
    ... │ │ │ │ -001bb400: 2f2f 2075 7365 2073 6f61 705f 6269 6e64 // use soap_bind │ │ │ │ -001bb410: 2061 6e64 2073 6f61 705f 6163 6365 7074 and soap_accept │ │ │ │ -001bb420: 2069 6e20 6120 286d 756c 7469 2d74 6872 in a (multi-thr │ │ │ │ -001bb430: 6561 6465 6429 2073 6572 7669 6365 206c eaded) service l │ │ │ │ -001bb440: 6f6f 703c 2f73 7061 6e3e 3c2f 6469 763e oop
    │ │ │ │ -001bb450: 0a3c 6469 7620 636c 6173 733d 226c 696e . │ │ │ │ -001bb520: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    soap_p │ │ │ │ -001bb590: 7269 6e74 5f66 6175 6c74 3c2f 613e 283c rint_fault(< │ │ │ │ -001bb5a0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -001bb5b0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ -001bb5c0: 6874 6d6c 223e 736f 6170 3c2f 613e 2c20 html">soap, │ │ │ │ -001bb5d0: 7374 6465 7272 293b 3c2f 6469 763e 0a3c stderr);
    .< │ │ │ │ -001bb5e0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001bb5f0: 3e20 202e 2e2e 203c 7370 616e 2063 6c61 > ... //< │ │ │ │ -001bb610: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    . │ │ │ │ -001bb630: 203c 6120 636c 6173 733d 2263 6f64 6522 soap_destr │ │ │ │ -001bb690: 6f79 3c2f 613e 283c 6120 636c 6173 733d oy(so │ │ │ │ -001bb6c0: 6170 3c2f 613e 293b 3c2f 6469 763e 0a3c ap);
    .< │ │ │ │ -001bb6d0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001bb6e0: 3e20 203c 6120 636c 6173 733d 2263 6f64 > soap_end │ │ │ │ -001bb740: 3c2f 613e 283c 6120 636c 6173 733d 2263 (soap │ │ │ │ -001bb770: 3c2f 613e 293b 3c2f 6469 763e 0a3c 6469 );
    . │ │ │ │ -001bb790: 203c 6120 636c 6173 733d 2263 6f64 6522 soap_free< │ │ │ │ -001bb7f0: 2f61 3e28 3c61 2063 6c61 7373 3d22 636f /a>(soap< │ │ │ │ -001bb820: 2f61 3e29 3b3c 2f64 6976 3e0a 3c64 6976 /a>);
    .
    }< │ │ │ │ -001bb840: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    . │ │ │ │ -001bb860: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    .
    {
    │ │ │ │ -001bb950: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    i │ │ │ │ -001bb980: 663c 2f73 7061 6e3e 2028 3c61 2063 6c61 f (soap->userid && soap-> │ │ │ │ -001bba50: 3b3c 6120 636c 6173 733d 2263 6f64 6522 ;passwd │ │ │ │ -001bbaa0: 3c2f 613e 2920 3c73 7061 6e20 636c 6173 ) // c │ │ │ │ -001bbac0: 6c69 656e 7420 7573 6564 2062 6173 6963 lient used basic │ │ │ │ -001bbad0: 2061 7574 6865 6e74 6963 6174 696f 6e20 authentication │ │ │ │ -001bbae0: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ │ -001bbb00: 2020 7b3c 2f64 6976 3e0a 3c64 6976 2063 {
    .
    │ │ │ │ -001bbb20: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // may dec │ │ │ │ -001bbb40: 6964 6520 6e6f 7420 746f 2068 616e 646c ide not to handl │ │ │ │ -001bbb50: 652c 2062 7574 2069 6620 6f6b 2074 6865 e, but if ok the │ │ │ │ -001bbb60: 6e20 676f 2061 6865 6164 2061 6e64 2063 n go ahead and c │ │ │ │ -001bbb70: 6f6d 7061 7265 2069 6e66 6f3a 203c 2f73 ompare info:
    .
    │ │ │ │ -001bbba0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 if (!strcmp(soap-&g │ │ │ │ -001bbc00: 743b 3c61 2063 6c61 7373 3d22 636f 6465 t;useri │ │ │ │ -001bbc50: 643c 2f61 3e2c 203c 6120 636c 6173 733d d, │ │ │ │ -001bbca0: 7573 6572 6964 3c2f 613e 2920 2661 6d70 userid) & │ │ │ │ -001bbcb0: 3b26 616d 703b 2021 7374 7263 6d70 283c ;& !strcmp(< │ │ │ │ -001bbcc0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -001bbcd0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ -001bbce0: 6874 6d6c 223e 736f 6170 3c2f 613e 2d26 html">soap-& │ │ │ │ -001bbcf0: 6774 3b3c 6120 636c 6173 733d 2263 6f64 gt;pass │ │ │ │ -001bbd40: 7764 3c2f 613e 2c20 3c61 2063 6c61 7373 wd, passwd)) .
    {.
    ... < │ │ │ │ -001bbde0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ -001bbdf0: 656e 7422 3e2f 2f20 6861 6e64 6c65 2072 ent">// handle r │ │ │ │ -001bbe00: 6571 7565 7374 3c2f 7370 616e 3e3c 2f64 equest..
    │ │ │ │ -001bbed0: 2020 7d20 3c2f 6469 763e 0a3c 6469 7620 }
    .
    } │ │ │ │ -001bbef0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    else if (so │ │ │ │ -001bbf80: 6170 3c2f 613e 2d26 6774 3b3c 6120 636c ap->authrealm && soap-> │ │ │ │ -001bc020: 3b3c 6120 636c 6173 733d 2263 6f64 6522 ;userid │ │ │ │ -001bc070: 3c2f 613e 2920 3c73 7061 6e20 636c 6173 ) // D │ │ │ │ -001bc090: 6967 6573 7420 6175 7468 656e 7469 6361 igest authentica │ │ │ │ -001bc0a0: 7469 6f6e 203c 2f73 7061 6e3e 3c2f 6469 tion .
    {
    .< │ │ │ │ -001bc0d0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001bc0e0: 3e20 2020 203c 6120 636c 6173 733d 2263 > pa │ │ │ │ -001bc130: 7373 7764 3c2f 613e 203d 202e 2e2e 3b20 sswd = ...; │ │ │ │ -001bc140: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // databas │ │ │ │ -001bc160: 6520 6c6f 6f6b 7570 206f 6e20 7573 6572 e lookup on user │ │ │ │ -001bc170: 6964 2061 6e64 2061 7574 6872 6561 6c6d id and authrealm │ │ │ │ -001bc180: 2074 6f20 6669 6e64 2070 6173 7377 6420 to find passwd │ │ │ │ -001bc190: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ │ -001bc1b0: 2020 2020 3c73 7061 6e20 636c 6173 733d if │ │ │ │ -001bc1d0: 3c2f 7370 616e 3e20 2821 7374 7263 6d70 (!strcmp │ │ │ │ -001bc1e0: 283c 6120 636c 6173 733d 2263 6f64 6522 (soap │ │ │ │ -001bc210: 2d26 6774 3b3c 6120 636c 6173 733d 2263 ->au │ │ │ │ -001bc260: 7468 7265 616c 6d3c 2f61 3e2c 203c 6120 threalm, authrealm< │ │ │ │ -001bc2c0: 2f61 3e29 2026 616d 703b 2661 6d70 3b20 /a>) && │ │ │ │ -001bc2d0: 2173 7472 636d 7028 3c61 2063 6c61 7373 !strcmp(s │ │ │ │ -001bc300: 6f61 703c 2f61 3e2d 2667 743b 3c61 2063 oap->userid, │ │ │ │ -001bc360: 203c 6120 636c 6173 733d 2263 6f64 6522 userid │ │ │ │ -001bc3b0: 3c2f 613e 2929 203c 2f64 6976 3e0a 3c64 ))
    . │ │ │ │ -001bc3d0: 2020 2020 7b3c 2f64 6976 3e0a 3c64 6976 {
    .
    │ │ │ │ -001bc3f0: 2020 2020 3c73 7061 6e20 636c 6173 733d if │ │ │ │ -001bc410: 3c2f 7370 616e 3e20 2821 6874 7470 5f64 (!http_d │ │ │ │ -001bc420: 615f 7665 7269 6679 5f70 6f73 7428 3c61 a_verify_post(soap, < │ │ │ │ -001bc460: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -001bc470: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ -001bc480: 6874 6d6c 2361 3232 6432 3139 6339 3866 html#a22d219c98f │ │ │ │ -001bc490: 3066 6366 3435 3636 3431 3237 3763 6336 0fcf456641277cc6 │ │ │ │ -001bc4a0: 3431 3734 6133 223e 7061 7373 7764 3c2f 4174a3">passwd))
    .
    │ │ │ │ -001bc4d0: 2020 2020 7b3c 2f64 6976 3e0a 3c64 6976 {
    .
    │ │ │ │ -001bc4f0: 2020 2020 2020 2e2e 2e20 3c73 7061 6e20 ... │ │ │ │ -001bc510: 2f2f 2068 616e 646c 6520 7265 7175 6573 // handle reques │ │ │ │ -001bc520: 743c 2f73 7061 6e3e 3c2f 6469 763e 0a3c t
    .< │ │ │ │ -001bc530: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001bc540: 3e20 2020 2020 2020 203c 7370 616e 2063 > return │ │ │ │ -001bc570: 203c 6120 636c 6173 733d 2263 6f64 6522 SOAP_OK │ │ │ │ -001bc5d0: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
    .
    │ │ │ │ -001bc5f0: 207d 203c 2f64 6976 3e0a 3c64 6976 2063 }
    .
    │ │ │ │ -001bc610: 7d20 3c2f 6469 763e 0a3c 6469 7620 636c }
    .
    } < │ │ │ │ -001bc630: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    soap->authrealm │ │ │ │ -001bc6d0: 3c2f 613e 203d 203c 6120 636c 6173 733d = │ │ │ │ -001bc720: 6175 7468 7265 616c 6d3c 2f61 3e3b 203c authrealm; < │ │ │ │ -001bc730: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ -001bc740: 656e 7422 3e2f 2f20 7365 7420 7265 616c ent">// set real │ │ │ │ -001bc750: 6d20 666f 7220 6368 616c 6c65 6e67 6520 m for challenge │ │ │ │ -001bc760: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ │ -001bc780: 2020 3c73 7061 6e20 636c 6173 733d 226b retu │ │ │ │ -001bc7a0: 726e 3c2f 7370 616e 3e20 3430 313b 203c rn 401; < │ │ │ │ -001bc7b0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ -001bc7c0: 656e 7422 3e2f 2f20 4e6f 7420 6175 7468 ent">// Not auth │ │ │ │ -001bc7d0: 6f72 697a 6564 2c20 6368 616c 6c65 6e67 orized, challeng │ │ │ │ -001bc7e0: 6520 6469 6765 7374 2061 7574 6865 6e74 e digest authent │ │ │ │ -001bc7f0: 6963 6174 696f 6e20 3c2f 7370 616e 3e3c ication < │ │ │ │ -001bc800: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    }
    . │ │ │ │ -001bc820: 3c2f 6469 763e 3c21 2d2d 2066 7261 676d

    For mo │ │ │ │ -001bc840: 7265 2064 6574 6169 6c73 2c20 696e 636c re details, incl │ │ │ │ -001bc850: 7564 696e 6720 686f 7720 746f 2063 6f6e uding how to con │ │ │ │ -001bc860: 6669 6775 7265 2048 5454 5020 4469 6765 figure HTTP Dige │ │ │ │ -001bc870: 7374 2061 7574 6865 6e74 6963 6174 696f st authenticatio │ │ │ │ -001bc880: 6e20 666f 7220 7072 6f78 6965 732c 2073 n for proxies, s │ │ │ │ -001bc890: 6565 2074 6865 203c 6120 6872 6566 3d22 ee the H │ │ │ │ -001bc8c0: 5454 5020 6469 6765 7374 2061 7574 6865 TTP digest authe │ │ │ │ -001bc8d0: 6e74 6963 6174 696f 6e20 706c 7567 696e ntication plugin │ │ │ │ -001bc8e0: 3c2f 613e 2064 6f63 756d 656e 7461 7469 documentati │ │ │ │ -001bc8f0: 6f6e 2e3c 2f70 3e0a 3c70 3ef0 9f94 9d20 on.

    .

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

    ..The │ │ │ │ -001bc960: 2048 5454 5020 7365 7373 696f 6e73 2070 HTTP sessions p │ │ │ │ -001bc970: 6c75 6769 6e3c 2f68 333e 0a3c 703e 5468 lugin.

    Th │ │ │ │ -001bc980: 6520 706c 7567 696e 2063 6f64 6520 6973 e plugin code is │ │ │ │ -001bc990: 206c 6f63 6174 6564 2069 6e20 7468 6520 located in the │ │ │ │ -001bc9a0: 3c65 6d3e 3c63 6f64 653e 6773 6f61 702f gsoap/ │ │ │ │ -001bc9b0: 706c 7567 696e 3c2f 636f 6465 3e3c 2f65 plugin directory con │ │ │ │ -001bc9d0: 7461 696e 696e 6720 3c65 6d3e 3c63 6f64 taining sessions.h and sessions. │ │ │ │ -001bca10: 633c 2f63 6f64 653e 3c2f 656d 3e2e 3c2f c..

    For more d │ │ │ │ -001bca30: 6574 6169 6c73 2c20 7365 6520 7468 6520 etails, see the │ │ │ │ -001bca40: 3c61 2068 7265 663d 222e 2e2f 2e2e 2f73 HTTP se │ │ │ │ -001bca70: 7373 696f 6e73 2070 6c75 6769 6e3c 2f61 ssions plugin documentation. │ │ │ │ -001bca90: 3c2f 703e 0a3c 703e f09f 949d 203c 6120

    .

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

    .

    < │ │ │ │ -001bcad0: 6120 636c 6173 733d 2261 6e63 686f 7222 a class="anchor" │ │ │ │ -001bcae0: 2069 643d 2261 7061 6368 6570 6c75 6769 id="apacheplugi │ │ │ │ -001bcaf0: 6e22 3e3c 2f61 3e0a 5468 6520 4170 6163 n">.The Apac │ │ │ │ -001bcb00: 6865 206d 6f64 756c 6520 706c 7567 696e he module plugin │ │ │ │ -001bcb10: 3c2f 6833 3e0a 3c70 3e54 6865 2070 6c75

    .

    The plu │ │ │ │ -001bcb20: 6769 6e20 636f 6465 2069 7320 6c6f 6361 gin code is loca │ │ │ │ -001bcb30: 7465 6420 696e 2074 6865 203c 656d 3e3c ted in the < │ │ │ │ -001bcb40: 636f 6465 3e67 736f 6170 2f6d 6f64 5f67 code>gsoap/mod_g │ │ │ │ -001bcb50: 736f 6170 2f6d 6f64 5f67 736f 6170 2d30 soap/mod_gsoap-0 │ │ │ │ -001bcb60: 2e39 2f61 7061 6368 655f 3230 3c2f 636f .9/apache_20 directo │ │ │ │ -001bcb80: 7279 2e3c 2f70 3e0a 3c70 3e46 6f72 206d ry.

    .

    For m │ │ │ │ -001bcb90: 6f72 6520 6465 7461 696c 732c 2073 6565 ore details, see │ │ │ │ -001bcba0: 2074 6865 203c 6120 6872 6566 3d22 2e2e the Apac │ │ │ │ -001bcbd0: 6865 206d 6f64 756c 653c 2f61 3e20 646f he module do │ │ │ │ -001bcbe0: 6375 6d65 6e74 6174 696f 6e2e 3c2f 703e cumentation.

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

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

    .

    .The ISAPI ext │ │ │ │ -001bcc60: 656e 7369 6f6e 2070 6c75 6769 6e3c 2f68 ension plugin.

    The plugin │ │ │ │ -001bcc80: 2063 6f64 6520 6973 206c 6f63 6174 6564 code is located │ │ │ │ -001bcc90: 2069 6e20 7468 6520 3c65 6d3e 3c63 6f64 in the gsoap/mod_gsoa │ │ │ │ -001bccb0: 702f 6773 6f61 705f 7769 6e2f 6973 6170 p/gsoap_win/isap │ │ │ │ -001bccc0: 693c 2f63 6f64 653e 3c2f 656d 3e20 6469 i di │ │ │ │ -001bccd0: 7265 6374 6f72 792e 3c2f 703e 0a3c 703e rectory.

    .

    │ │ │ │ -001bcce0: 466f 7220 6d6f 7265 2064 6574 6169 6c73 For more details │ │ │ │ -001bccf0: 2c20 7365 6520 7468 6520 3c61 2068 7265 , see the │ │ │ │ -001bcd20: 4953 4150 4920 6578 7465 6e73 696f 6e3c ISAPI extension< │ │ │ │ -001bcd30: 2f61 3e20 646f 6375 6d65 6e74 6174 696f /a> documentatio │ │ │ │ -001bcd40: 6e2e 3c2f 703e 0a3c 703e f09f 949d 203c n.

    .

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

    .

    .The CURL │ │ │ │ -001bcdb0: 2070 6c75 6769 6e3c 2f68 333e 0a3c 703e plugin

    .

    │ │ │ │ -001bcdc0: 5468 6520 706c 7567 696e 2063 6f64 6520 The plugin code │ │ │ │ -001bcdd0: 6973 206c 6f63 6174 6564 2069 6e20 7468 is located in th │ │ │ │ -001bcde0: 6520 3c65 6d3e 3c63 6f64 653e 6773 6f61 e gsoa │ │ │ │ -001bcdf0: 702f 706c 7567 696e 3c2f 636f 6465 3e3c p/plugin< │ │ │ │ -001bce00: 2f65 6d3e 2064 6972 6563 746f 7279 2063 /em> directory c │ │ │ │ -001bce10: 6f6e 7461 696e 696e 6720 3c65 6d3e 3c63 ontaining curlapi.h and curlapi. │ │ │ │ -001bce50: 633c 2f63 6f64 653e 3c2f 656d 3e2e 3c2f c..

    For more d │ │ │ │ -001bce70: 6574 6169 6c73 2c20 7365 6520 7468 6520 etails, see the │ │ │ │ -001bce80: 3c61 2068 7265 663d 222e 2e2f 2e2e 2f63 CURL plugin │ │ │ │ -001bceb0: 3c2f 613e 2064 6f63 756d 656e 7461 7469 documentati │ │ │ │ -001bcec0: 6f6e 2e3c 2f70 3e0a 3c70 3ef0 9f94 9d20 on.

    .

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

    ..The │ │ │ │ -001bcf30: 5769 6e49 6e65 7420 706c 7567 696e 3c2f WinInet plugin.

    The plugi │ │ │ │ -001bcf50: 6e20 636f 6465 2069 7320 6c6f 6361 7465 n code is locate │ │ │ │ -001bcf60: 6420 696e 2074 6865 203c 656d 3e3c 636f d in the gsoap/mod_gso │ │ │ │ -001bcf80: 6170 2f67 736f 6170 5f77 696e 2f77 696e ap/gsoap_win/win │ │ │ │ -001bcf90: 696e 6574 3c2f 636f 6465 3e3c 2f65 6d3e inet │ │ │ │ -001bcfa0: 2064 6972 6563 746f 7279 2e3c 2f70 3e0a directory.

    . │ │ │ │ -001bcfb0: 3c70 3e46 6f72 206d 6f72 6520 6465 7461

    For more deta │ │ │ │ -001bcfc0: 696c 732c 2073 6565 2074 6865 203c 6120 ils, see the WinInet plu │ │ │ │ -001bd000: 6769 6e3c 2f61 3e20 646f 6375 6d65 6e74 gin document │ │ │ │ -001bd010: 6174 696f 6e2e 3c2f 703e 0a3c 703e f09f ation.

    .

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

    │ │ │ │ -001bd050: 0a3c 6833 3e3c 6120 636c 6173 733d 2261 .

    .The W │ │ │ │ -001bd080: 532d 4164 6472 6573 7369 6e67 2070 6c75 S-Addressing plu │ │ │ │ -001bd090: 6769 6e3c 2f68 333e 0a3c 703e 5468 6520 gin

    .

    The │ │ │ │ -001bd0a0: 706c 7567 696e 2063 6f64 6520 6973 206c plugin code is l │ │ │ │ -001bd0b0: 6f63 6174 6564 2069 6e20 7468 6520 3c65 ocated in the gsoap/pl │ │ │ │ -001bd0d0: 7567 696e 3c2f 636f 6465 3e3c 2f65 6d3e ugin │ │ │ │ -001bd0e0: 2064 6972 6563 746f 7279 2063 6f6e 7461 directory conta │ │ │ │ -001bd0f0: 696e 696e 6720 3c65 6d3e 3c63 6f64 653e ining │ │ │ │ -001bd100: 7773 6161 7069 2e68 3c2f 636f 6465 3e3c wsaapi.h< │ │ │ │ -001bd110: 2f65 6d3e 2061 6e64 203c 656d 3e3c 636f /em> and wsaapi.c (to be u │ │ │ │ -001bd140: 7365 6420 696e 2043 2061 6e64 2043 2b2b sed in C and C++ │ │ │ │ -001bd150: 292e 3c2f 703e 0a3c 703e 546f 2065 6e61 ).

    .

    To ena │ │ │ │ -001bd160: 626c 6520 5753 2d41 6464 7265 7373 696e ble WS-Addressin │ │ │ │ -001bd170: 6720 3230 3035 2028 616e 6420 7375 7070 g 2005 (and supp │ │ │ │ -001bd180: 6f72 7420 666f 7220 382f 3230 3034 292c ort for 8/2004), │ │ │ │ -001bd190: 2074 6865 2073 6572 7669 6365 2064 6566 the service def │ │ │ │ -001bd1a0: 696e 6974 696f 6e73 2068 6561 6465 7220 initions header │ │ │ │ -001bd1b0: 6669 6c65 2066 6f72 2073 6f61 7063 7070 file for soapcpp │ │ │ │ -001bd1c0: 3220 7368 6f75 6c64 2069 6e63 6c75 6465 2 should include │ │ │ │ -001bd1d0: 2074 6865 2066 6f6c 6c6f 7769 6e67 2069 the following i │ │ │ │ -001bd1e0: 6d70 6f72 7473 3a3c 2f70 3e0a 3c64 6976 mports:

    .
    # │ │ │ │ -001bd230: 696d 706f 7274 2026 7175 6f74 3b69 6d70 import "imp │ │ │ │ -001bd240: 6f72 742f 7773 6135 2e68 2671 756f 743b ort/wsa5.h" │ │ │ │ -001bd250: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c2f
    .

    This imp │ │ │ │ -001bd280: 6f72 7473 2074 6865 2053 4f41 5020 6865 orts the SOAP he │ │ │ │ -001bd290: 6164 6572 2065 6c65 6d65 6e74 7320 7265 ader elements re │ │ │ │ -001bd2a0: 7175 6972 6564 2062 7920 5753 2d41 6464 quired by WS-Add │ │ │ │ -001bd2b0: 7265 7373 696e 672e 3c2f 703e 0a3c 703e ressing.

    .

    │ │ │ │ -001bd2c0: 466f 7220 6d6f 7265 2064 6574 6169 6c73 For more details │ │ │ │ -001bd2d0: 2c20 7365 6520 7468 6520 3c61 2068 7265 , see the WS │ │ │ │ -001bd300: 2d41 6464 7265 7373 696e 6720 706c 7567 -Addressing plug │ │ │ │ -001bd310: 696e 3c2f 613e 2064 6f63 756d 656e 7461 in documenta │ │ │ │ -001bd320: 7469 6f6e 2e3c 2f70 3e0a 3c70 3ef0 9f94 tion.

    .

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

    . │ │ │ │ -001bd360: 3c68 333e 3c61 2063 6c61 7373 3d22 616e

    .The W │ │ │ │ -001bd390: 532d 5265 6c69 6162 6c65 4d65 7373 6167 S-ReliableMessag │ │ │ │ -001bd3a0: 696e 6720 706c 7567 696e 3c2f 6833 3e0a ing plugin

    . │ │ │ │ -001bd3b0: 3c70 3e54 6865 2070 6c75 6769 6e20 636f

    The plugin co │ │ │ │ -001bd3c0: 6465 2069 7320 6c6f 6361 7465 6420 696e de is located in │ │ │ │ -001bd3d0: 2074 6865 203c 656d 3e3c 636f 6465 3e67 the g │ │ │ │ -001bd3e0: 736f 6170 2f70 6c75 6769 6e3c 2f63 6f64 soap/plugin director │ │ │ │ -001bd400: 7920 636f 6e74 6169 6e69 6e67 203c 656d y containing wsrmapi.h │ │ │ │ -001bd420: 3c2f 636f 6465 3e3c 2f65 6d3e 2061 6e64 and │ │ │ │ -001bd430: 203c 656d 3e3c 636f 6465 3e77 7372 6d61 wsrma │ │ │ │ -001bd440: 7069 2e63 3c2f 636f 6465 3e3c 2f65 6d3e pi.c │ │ │ │ -001bd450: 2028 746f 2062 6520 7573 6564 2069 6e20 (to be used in │ │ │ │ -001bd460: 4320 616e 6420 432b 2b29 2e3c 2f70 3e0a C and C++).

    . │ │ │ │ -001bd470: 3c70 3e41 6c73 6f20 6e65 6564 6564 2061

    Also needed a │ │ │ │ -001bd480: 7265 203c 656d 3e3c 636f 6465 3e74 6872 re thr │ │ │ │ -001bd490: 6561 6473 2e68 3c2f 636f 6465 3e3c 2f65 eads.h and threads.c for multi │ │ │ │ -001bd4d0: 2d74 6872 6561 6469 6e67 2061 6e64 206c -threading and l │ │ │ │ -001bd4e0: 6f63 6b69 6e67 2073 7570 706f 7274 2e3c ocking support.< │ │ │ │ -001bd4f0: 2f70 3e0a 3c70 3e54 6f20 656e 6162 6c65 /p>.

    To enable │ │ │ │ -001bd500: 2057 532d 5265 6c69 6162 6c65 4d65 7373 WS-ReliableMess │ │ │ │ -001bd510: 6167 696e 672c 2074 6865 2073 6572 7669 aging, the servi │ │ │ │ -001bd520: 6365 2064 6566 696e 6974 696f 6e73 2068 ce definitions h │ │ │ │ -001bd530: 6561 6465 7220 6669 6c65 2066 6f72 2073 eader file for s │ │ │ │ -001bd540: 6f61 7063 7070 3220 7368 6f75 6c64 2069 oapcpp2 should i │ │ │ │ -001bd550: 6e63 6c75 6465 2074 6865 2066 6f6c 6c6f nclude the follo │ │ │ │ -001bd560: 7769 6e67 2069 6d70 6f72 7473 3a3c 2f70 wing imports:

    .
    #import &qu │ │ │ │ -001bd5c0: 6f74 3b69 6d70 6f72 742f 7773 726d 2e68 ot;import/wsrm.h │ │ │ │ -001bd5d0: 2671 756f 743b 3c2f 7370 616e 3e20 3c2f " .
    #import " │ │ │ │ -001bd620: 696d 706f 7274 2f77 7361 352e 6826 7175 import/wsa5.h&qu │ │ │ │ -001bd630: 6f74 3b3c 2f73 7061 6e3e 3c2f 6469 763e ot;
    │ │ │ │ -001bd640: 0a3c 2f64 6976 3e3c 212d 2d20 6672 6167 .

    This │ │ │ │ -001bd660: 696d 706f 7274 7320 7468 6520 534f 4150 imports the SOAP │ │ │ │ -001bd670: 2068 6561 6465 7220 656c 656d 656e 7473 header elements │ │ │ │ -001bd680: 2072 6571 7569 7265 6420 6279 2057 532d required by WS- │ │ │ │ -001bd690: 5265 6c69 6162 6c65 4d65 7373 6167 696e ReliableMessagin │ │ │ │ -001bd6a0: 672e 3c2f 703e 0a3c 703e 466f 7220 6d6f g.

    .

    For mo │ │ │ │ -001bd6b0: 7265 2064 6574 6169 6c73 2c20 7365 6520 re details, see │ │ │ │ -001bd6c0: 7468 6520 3c61 2068 7265 663d 222e 2e2f the WS-Rel │ │ │ │ -001bd6f0: 6961 626c 654d 6573 7361 6769 6e67 2070 iableMessaging p │ │ │ │ -001bd700: 6c75 6769 6e3c 2f61 3e20 646f 6375 6d65 lugin docume │ │ │ │ -001bd710: 6e74 6174 696f 6e2e 3c2f 703e 0a3c 703e ntation.

    .

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

    .Th │ │ │ │ -001bd780: 6520 5753 2d53 6563 7572 6974 7920 706c e WS-Security pl │ │ │ │ -001bd790: 7567 696e 3c2f 6833 3e0a 3c70 3e54 6865 ugin

    .

    The │ │ │ │ -001bd7a0: 2070 6c75 6769 6e20 636f 6465 2069 7320 plugin code is │ │ │ │ -001bd7b0: 6c6f 6361 7465 6420 696e 2074 6865 203c located in the < │ │ │ │ -001bd7c0: 656d 3e3c 636f 6465 3e67 736f 6170 2f70 em>gsoap/p │ │ │ │ -001bd7d0: 6c75 6769 6e3c 2f63 6f64 653e 3c2f 656d lugin directory cont │ │ │ │ -001bd7f0: 6169 6e69 6e67 203c 656d 3e3c 636f 6465 aining wsseapi.h and < │ │ │ │ -001bd820: 636f 6465 3e77 7373 6561 7069 2e63 3c2f code>wsseapi.c (to b │ │ │ │ -001bd840: 6520 7573 6564 2069 6e20 4320 616e 6420 e used in C and │ │ │ │ -001bd850: 432b 2b29 2e3c 2f70 3e0a 3c70 3e41 6c73 C++).

    .

    Als │ │ │ │ -001bd860: 6f20 6e65 6564 6564 2061 7265 3a20 3c65 o needed are: smdevp.h │ │ │ │ -001bd880: 3c2f 636f 6465 3e3c 2f65 6d3e 2061 6e64 and │ │ │ │ -001bd890: 203c 656d 3e3c 636f 6465 3e73 6d64 6576 smdev │ │ │ │ -001bd8a0: 702e 633c 2f63 6f64 653e 3c2f 656d 3e20 p.c │ │ │ │ -001bd8b0: 666f 7220 7374 7265 616d 696e 6720 584d for streaming XM │ │ │ │ -001bd8c0: 4c20 7369 676e 6174 7572 6520 616e 6420 L signature and │ │ │ │ -001bd8d0: 6d65 7373 6167 6520 6469 6765 7374 2065 message digest e │ │ │ │ -001bd8e0: 6e67 696e 652c 203c 656d 3e3c 636f 6465 ngine, mecevp.h │ │ │ │ -001bd900: 3c2f 656d 3e20 616e 6420 3c65 6d3e 3c63 and mecevp.c for the │ │ │ │ -001bd930: 2073 7472 6561 6d69 6e67 2058 4d4c 2065 streaming XML e │ │ │ │ -001bd940: 6e63 7279 7074 696f 6e20 656e 6769 6e65 ncryption engine │ │ │ │ -001bd950: 2c20 3c65 6d3e 3c63 6f64 653e 7468 7265 , thre │ │ │ │ -001bd960: 6164 732e 683c 2f63 6f64 653e 3c2f 656d ads.h and │ │ │ │ -001bd980: 7468 7265 6164 732e 633c 2f63 6f64 653e threads.c │ │ │ │ -001bd990: 3c2f 656d 3e20 666f 7220 6d75 6c74 692d for multi- │ │ │ │ -001bd9a0: 7468 7265 6164 696e 6720 616e 6420 6c6f threading and lo │ │ │ │ -001bd9b0: 636b 696e 6720 7375 7070 6f72 742e 3c2f cking support..

    To enable │ │ │ │ -001bd9d0: 5753 2d53 6563 7572 6974 792c 2074 6865 WS-Security, the │ │ │ │ -001bd9e0: 2073 6572 7669 6365 2064 6566 696e 6974 service definit │ │ │ │ -001bd9f0: 696f 6e73 2068 6561 6465 7220 6669 6c65 ions header file │ │ │ │ -001bda00: 2066 6f72 2073 6f61 7063 7070 3220 7368 for soapcpp2 sh │ │ │ │ -001bda10: 6f75 6c64 2069 6e63 6c75 6465 2074 6865 ould include the │ │ │ │ -001bda20: 2066 6f6c 6c6f 7769 6e67 2069 6d70 6f72 following impor │ │ │ │ -001bda30: 7473 3a3c 2f70 3e0a 3c64 6976 2063 6c61 ts:

    .
    │ │ │ │ -001bda60: 3c73 7061 6e20 636c 6173 733d 2270 7265 #impo │ │ │ │ -001bda80: 7274 2026 7175 6f74 3b69 6d70 6f72 742f rt "import/ │ │ │ │ -001bda90: 7773 7365 2e68 2671 756f 743b 3c2f 7370 wsse.h"
    .
    │ │ │ │ -001bdab0: 3c21 2d2d 2066 7261 676d 656e 7420 2d2d
    │ │ │ │ -001be240: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    void │ │ │ │ -001be270: 3c2f 7370 616e 3e20 7773 6464 5f65 7665 wsdd_eve │ │ │ │ -001be280: 6e74 5f42 7965 283c 7370 616e 2063 6c61 nt_Bye(str │ │ │ │ -001be2a0: 7563 743c 2f73 7061 6e3e 203c 6120 636c uct soap *soap, .
    │ │ │ │ -001be340: 756e 7369 676e 6564 3c2f 7370 616e 3e20 unsigned │ │ │ │ -001be350: 3c73 7061 6e20 636c 6173 733d 226b 6579 int InstanceId, │ │ │ │ -001be380: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    │ │ │ │ -001be3b0: 636f 6e73 743c 2f73 7061 6e3e 203c 7370 const char *SequenceId, │ │ │ │ -001be3f0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    unsigned int │ │ │ │ -001be450: 3c2f 7370 616e 3e20 4d65 7373 6167 654e MessageN │ │ │ │ -001be460: 756d 6265 722c 203c 2f64 6976 3e0a 3c64 umber,
    . │ │ │ │ -001be480: 3c73 7061 6e20 636c 6173 733d 226b 6579 const cha │ │ │ │ -001be4c0: 723c 2f73 7061 6e3e 202a 4d65 7373 6167 r *Messag │ │ │ │ -001be4d0: 6549 442c 203c 2f64 6976 3e0a 3c64 6976 eID,
    .
    const │ │ │ │ -001be510: 203c 7370 616e 2063 6c61 7373 3d22 6b65 char< │ │ │ │ -001be530: 2f73 7061 6e3e 202a 5265 6c61 7465 7354 /span> *RelatesT │ │ │ │ -001be540: 6f2c 203c 2f64 6976 3e0a 3c64 6976 2063 o,
    .
    const < │ │ │ │ -001be580: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -001be590: 6f72 6474 7970 6522 3e63 6861 723c 2f73 ordtype">char *EndpointRe │ │ │ │ -001be5b0: 6665 7265 6e63 652c 203c 2f64 6976 3e0a ference,
    . │ │ │ │ -001be5c0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    const c │ │ │ │ -001be610: 6861 723c 2f73 7061 6e3e 202a 5479 7065 har *Type │ │ │ │ -001be620: 732c 203c 2f64 6976 3e0a 3c64 6976 2063 s,
    .
    const < │ │ │ │ -001be660: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -001be670: 6f72 6474 7970 6522 3e63 6861 723c 2f73 ordtype">char *Scopes, .
    con │ │ │ │ -001be6c0: 7374 3c2f 7370 616e 3e20 3c73 7061 6e20 st char │ │ │ │ -001be6f0: 2a4d 6174 6368 4279 2c20 3c2f 6469 763e *MatchBy,
    │ │ │ │ -001be700: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    const │ │ │ │ -001be750: 6368 6172 3c2f 7370 616e 3e20 2a58 4164 char *XAd │ │ │ │ -001be760: 6472 732c 203c 2f64 6976 3e0a 3c64 6976 drs,
    .
    unsigned │ │ │ │ -001be7a0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c int Met │ │ │ │ -001be7d0: 6164 6174 6156 6572 7369 6f6e 293c 2f64 adataVersion).
    soap_wsdd_mod │ │ │ │ -001be830: 6520 7773 6464 5f65 7665 6e74 5f50 726f e wsdd_event_Pro │ │ │ │ -001be840: 6265 283c 7370 616e 2063 6c61 7373 3d22 be(struct< │ │ │ │ -001be860: 2f73 7061 6e3e 203c 6120 636c 6173 733d /span> so │ │ │ │ -001be890: 6170 3c2f 613e 202a 3c61 2063 6c61 7373 ap *s │ │ │ │ -001be8c0: 6f61 703c 2f61 3e2c 203c 2f64 6976 3e0a oap,
    . │ │ │ │ -001be8d0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    const c │ │ │ │ -001be920: 6861 723c 2f73 7061 6e3e 202a 4d65 7373 har *Mess │ │ │ │ -001be930: 6167 6549 442c 203c 2f64 6976 3e0a 3c64 ageID,
    . │ │ │ │ -001be950: 3c73 7061 6e20 636c 6173 733d 226b 6579 const cha │ │ │ │ -001be990: 723c 2f73 7061 6e3e 202a 5265 706c 7954 r *ReplyT │ │ │ │ -001be9a0: 6f2c 203c 2f64 6976 3e0a 3c64 6976 2063 o,
    .
    const < │ │ │ │ -001be9e0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -001be9f0: 6f72 6474 7970 6522 3e63 6861 723c 2f73 ordtype">char *Types, .
    cons │ │ │ │ -001bea40: 743c 2f73 7061 6e3e 203c 7370 616e 2063 t char * │ │ │ │ -001bea70: 5363 6f70 6573 2c20 3c2f 6469 763e 0a3c Scopes,
    .< │ │ │ │ -001bea80: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001bea90: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >const ch │ │ │ │ -001bead0: 6172 3c2f 7370 616e 3e20 2a4d 6174 6368 ar *Match │ │ │ │ -001beae0: 4279 2c20 3c2f 6469 763e 0a3c 6469 7620 By,
    .
    struct │ │ │ │ -001beb20: 2077 7364 645f 5f50 726f 6265 4d61 7463 wsdd__ProbeMatc │ │ │ │ -001beb30: 6865 7354 7970 6520 2a50 726f 6265 4d61 hesType *ProbeMa │ │ │ │ -001beb40: 7463 6865 7329 3c2f 6469 763e 0a3c 2f64 tches)
    .
    void wsdd_event_Pro │ │ │ │ -001bebc0: 6265 4d61 7463 6865 7328 3c73 7061 6e20 beMatches( │ │ │ │ -001bebe0: 7374 7275 6374 3c2f 7370 616e 3e20 3c61 struct soap *< │ │ │ │ -001bec20: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ -001bec30: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ -001bec40: 6874 6d6c 223e 736f 6170 3c2f 613e 2c20 html">soap, │ │ │ │ -001bec50: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    unsigned int │ │ │ │ -001becb0: 3c2f 7370 616e 3e20 496e 7374 616e 6365 Instance │ │ │ │ -001becc0: 4964 2c20 3c2f 6469 763e 0a3c 6469 7620 Id,
    .
    const │ │ │ │ -001bed00: 3c73 7061 6e20 636c 6173 733d 226b 6579 char *SequenceI │ │ │ │ -001bed30: 642c 203c 2f64 6976 3e0a 3c64 6976 2063 d,
    .
    unsigned │ │ │ │ -001bed90: 696e 743c 2f73 7061 6e3e 204d 6573 7361 int Messa │ │ │ │ -001beda0: 6765 4e75 6d62 6572 2c20 3c2f 6469 763e geNumber,
    │ │ │ │ -001bedb0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    const │ │ │ │ -001bee00: 6368 6172 3c2f 7370 616e 3e20 2a4d 6573 char *Mes │ │ │ │ -001bee10: 7361 6765 4944 2c20 3c2f 6469 763e 0a3c sageID,
    .< │ │ │ │ -001bee20: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001bee30: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >const ch │ │ │ │ -001bee70: 6172 3c2f 7370 616e 3e20 2a52 656c 6174 ar *Relat │ │ │ │ -001bee80: 6573 546f 2c20 3c2f 6469 763e 0a3c 6469 esTo,
    .< │ │ │ │ -001beea0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -001beeb0: 6f72 6422 3e73 7472 7563 743c 2f73 7061 ord">struct wsdd__ProbeMa │ │ │ │ -001beed0: 7463 6865 7354 7970 6520 2a50 726f 6265 tchesType *Probe │ │ │ │ -001beee0: 4d61 7463 6865 7329 3c2f 6469 763e 0a3c Matches)
    .< │ │ │ │ -001beef0: 2f64 6976 3e3c 212d 2d20 6672 6167 6d65 /div>
    so │ │ │ │ -001bef30: 6170 5f77 7364 645f 6d6f 6465 2077 7364 ap_wsdd_mode wsd │ │ │ │ -001bef40: 645f 6576 656e 745f 5265 736f 6c76 6528 d_event_Resolve( │ │ │ │ -001bef50: 3c73 7061 6e20 636c 6173 733d 226b 6579 struct soap< │ │ │ │ -001befa0: 2f61 3e20 2a3c 6120 636c 6173 733d 2263 /a> *soap │ │ │ │ -001befd0: 3c2f 613e 2c20 3c2f 6469 763e 0a3c 6469 ,
    .< │ │ │ │ -001beff0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -001bf000: 6f72 6422 3e63 6f6e 7374 3c2f 7370 616e ord">const char │ │ │ │ -001bf030: 3c2f 7370 616e 3e20 2a4d 6573 7361 6765 *Message │ │ │ │ -001bf040: 4944 2c20 3c2f 6469 763e 0a3c 6469 7620 ID,
    .
    const │ │ │ │ -001bf080: 3c73 7061 6e20 636c 6173 733d 226b 6579 char *ReplyTo, │ │ │ │ -001bf0b0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    c │ │ │ │ -001bf0e0: 6f6e 7374 3c2f 7370 616e 3e20 3c73 7061 onst char *EndpointRefer │ │ │ │ -001bf120: 656e 6365 2c20 3c2f 6469 763e 0a3c 6469 ence,
    .< │ │ │ │ -001bf140: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ -001bf150: 6f72 6422 3e73 7472 7563 743c 2f73 7061 ord">struct wsdd__Resolve │ │ │ │ -001bf170: 4d61 7463 6865 7354 7970 6520 2a52 6573 MatchesType *Res │ │ │ │ -001bf180: 6f6c 7665 4d61 7463 6865 7329 3c2f 6469 olveMatches).
    │ │ │ │ -001bf1c0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    void │ │ │ │ -001bf1f0: 3c2f 7370 616e 3e20 7773 6464 5f65 7665 wsdd_eve │ │ │ │ -001bf200: 6e74 5f52 6573 6f6c 7665 4d61 7463 6865 nt_ResolveMatche │ │ │ │ -001bf210: 7328 3c73 7061 6e20 636c 6173 733d 226b s(struct soa │ │ │ │ -001bf260: 703c 2f61 3e20 2a3c 6120 636c 6173 733d p *so │ │ │ │ -001bf290: 6170 3c2f 613e 2c20 3c2f 6469 763e 0a3c ap,
    .< │ │ │ │ -001bf2a0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ -001bf2b0: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >unsig │ │ │ │ -001bf2d0: 6e65 643c 2f73 7061 6e3e 203c 7370 616e ned int │ │ │ │ -001bf300: 496e 7374 616e 6365 4964 2c20 3c2f 6469 InstanceId, .
    const │ │ │ │ -001bf340: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c char *S │ │ │ │ -001bf370: 6571 7565 6e63 6549 642c 203c 2f64 6976 equenceId,
    .
    un │ │ │ │ -001bf3b0: 7369 676e 6564 3c2f 7370 616e 3e20 3c73 signed int MessageNumber │ │ │ │ -001bf3f0: 2c20 3c2f 6469 763e 0a3c 6469 7620 636c ,
    .
    const char *MessageID, │ │ │ │ -001bf460: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    c │ │ │ │ -001bf490: 6f6e 7374 3c2f 7370 616e 3e20 3c73 7061 onst char *RelatesTo, .
    con │ │ │ │ -001bf500: 7374 3c2f 7370 616e 3e20 3c73 7061 6e20 st char │ │ │ │ -001bf530: 2a45 6e64 706f 696e 7452 6566 6572 656e *EndpointReferen │ │ │ │ -001bf540: 6365 2c20 3c2f 6469 763e 0a3c 6469 7620 ce,
    .
    const │ │ │ │ -001bf580: 3c73 7061 6e20 636c 6173 733d 226b 6579 char *Types, .
    con │ │ │ │ -001bf5e0: 7374 3c2f 7370 616e 3e20 3c73 7061 6e20 st char │ │ │ │ -001bf610: 2a53 636f 7065 732c 203c 2f64 6976 3e0a *Scopes,
    . │ │ │ │ -001bf620: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    const c │ │ │ │ -001bf670: 6861 723c 2f73 7061 6e3e 202a 4d61 7463 har *Matc │ │ │ │ -001bf680: 6842 792c 203c 2f64 6976 3e0a 3c64 6976 hBy,
    .
    const │ │ │ │ -001bf6c0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 char< │ │ │ │ -001bf6e0: 2f73 7061 6e3e 202a 5841 6464 7273 2c20 /span> *XAddrs, │ │ │ │ -001bf6f0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    unsigned int │ │ │ │ -001bf750: 3c2f 7370 616e 3e20 4d65 7461 6461 7461 Metadata │ │ │ │ -001bf760: 5665 7273 696f 6e29 3c2f 6469 763e 0a3c Version)
    .< │ │ │ │ -001bf770: 2f64 6976 3e3c 212d 2d20 6672 6167 6d65 /div>

    These e │ │ │ │ -001bf790: 7665 6e74 2068 616e 646c 6572 7320 7769 vent handlers wi │ │ │ │ -001bf7a0: 6c6c 2062 6520 696e 766f 6b65 6420 7768 ll be invoked wh │ │ │ │ -001bf7b0: 656e 2069 6e62 6f75 6e64 2057 532d 4469 en inbound WS-Di │ │ │ │ -001bf7c0: 7363 6f76 6572 7920 6d65 7373 6167 6573 scovery messages │ │ │ │ -001bf7d0: 2061 7272 6976 6520 7573 696e 673a 3c2f arrive using:.

    if ( │ │ │ │ -001bf830: 213c 6120 636c 6173 733d 2263 6f64 6522 !soap_valid_so │ │ │ │ -001bf890: 636b 6574 3c2f 613e 283c 6120 636c 6173 cket(soap_bi │ │ │ │ -001bf8f0: 6e64 3c2f 613e 283c 6120 636c 6173 733d nd(so │ │ │ │ -001bf920: 6170 3c2f 613e 2c20 4e55 4c4c 2c20 3c61 ap, NULL, port, │ │ │ │ -001bf980: 2042 4143 4b4c 4f47 2929 2920 3c2f 6469 BACKLOG))) .
    ... // error
    .
    if (s │ │ │ │ -001bfa10: 6f61 705f 7773 6464 5f6c 6973 7465 6e28 oap_wsdd_listen( │ │ │ │ -001bfa20: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap, │ │ │ │ -001bfa50: 2074 696d 656f 7574 2929 203c 2f64 6976 timeout))
    .
    ... │ │ │ │ -001bfa90: 2f2f 2065 7272 6f72 3c2f 7370 616e 3e3c // error< │ │ │ │ -001bfaa0: 2f64 6976 3e0a 3c2f 6469 763e 3c21 2d2d /div>.

    │ │ │ │ -001bfac0: 7768 6963 6820 7769 6c6c 206c 6973 7465 which will liste │ │ │ │ -001bfad0: 6e20 666f 7220 3c63 6f64 653e 7469 6d65 n for time │ │ │ │ -001bfae0: 6f75 743c 2f63 6f64 653e 2073 6563 6f6e out secon │ │ │ │ -001bfaf0: 6473 2074 6f20 696e 626f 756e 6420 5753 ds to inbound WS │ │ │ │ -001bfb00: 2d44 6973 636f 7665 7279 206d 6573 7361 -Discovery messa │ │ │ │ -001bfb10: 6765 7320 6f6e 2061 2070 6f72 7420 616e ges on a port an │ │ │ │ -001bfb20: 6420 6469 7370 6174 6368 6573 2074 6865 d dispatches the │ │ │ │ -001bfb30: 6d20 746f 2074 6865 2065 7665 6e74 2068 m to the event h │ │ │ │ -001bfb40: 616e 646c 6572 732e 2041 206e 6567 6174 andlers. A negat │ │ │ │ -001bfb50: 6976 6520 3c63 6f64 653e 7469 6d65 6f75 ive timeou │ │ │ │ -001bfb60: 743c 2f63 6f64 653e 2076 616c 7565 2073 t value s │ │ │ │ -001bfb70: 7065 6369 6669 6573 2074 6865 2074 696d pecifies the tim │ │ │ │ -001bfb80: 656f 7574 2069 6e20 6d69 6372 6f73 6563 eout in microsec │ │ │ │ -001bfb90: 6f6e 6473 2e3c 2f70 3e0a 3c70 3e46 6f72 onds.

    .

    For │ │ │ │ -001bfba0: 206d 6f72 6520 6465 7461 696c 732c 2073 more details, s │ │ │ │ -001bfbb0: 6565 2074 6865 203c 6120 6872 6566 3d22 ee the WS- │ │ │ │ -001bfbe0: 4469 7363 6f76 6572 7920 706c 7567 696e Discovery plugin │ │ │ │ -001bfbf0: 3c2f 613e 2064 6f63 756d 656e 7461 7469 documentati │ │ │ │ -001bfc00: 6f6e 2e3c 2f70 3e0a 3c68 313e 3c61 2063 on.

    .

    .Copyright

    │ │ │ │ -001bfc40: 0a3c 703e 3c65 6d3e 436f 7079 7269 6768 .

    Copyrigh │ │ │ │ -001bfc50: 7420 2863 2920 3230 3030 2d32 3032 302c t (c) 2000-2020, │ │ │ │ -001bfc60: 2052 6f62 6572 7420 412e 2076 616e 2045 Robert A. van E │ │ │ │ -001bfc70: 6e67 656c 656e 2c20 4765 6e69 7669 6120 ngelen, Genivia │ │ │ │ -001bfc80: 496e 632e 3c62 7220 202f 3e0a 416c 6c20 Inc.
    .All │ │ │ │ -001bfc90: 7269 6768 7473 2072 6573 6572 7665 642e rights reserved. │ │ │ │ -001bfca0: 3c2f 656d 3e20 3c2f 703e 0a3c 2f64 6976

    .
    .
    . │ │ │ │ -001bfce0: 3c2f 6469 763e 3c21 2d2d 2064 6f63 2d63
    .
    .< │ │ │ │ -001bfd10: 6164 6472 6573 7320 636c 6173 733d 2266 address class="f │ │ │ │ -001bfd20: 6f6f 7465 7222 3e0a 436f 7079 7269 6768 ooter">.Copyrigh │ │ │ │ -001bfd30: 7420 2843 2920 3230 3231 2c20 526f 6265 t (C) 2021, Robe │ │ │ │ -001bfd40: 7274 2076 616e 2045 6e67 656c 656e 2c20 rt van Engelen, │ │ │ │ -001bfd50: 4765 6e69 7669 6120 496e 632e 2c20 416c Genivia Inc., Al │ │ │ │ -001bfd60: 6c20 5269 6768 7473 2052 6573 6572 7665 l Rights Reserve │ │ │ │ -001bfd70: 642e 0a3c 2f61 6464 7265 7373 3e0a 3c61 d....Co │ │ │ │ -001bfda0: 6e76 6572 7465 6420 6f6e 204d 6f6e 204d nverted on Mon M │ │ │ │ -001bfdb0: 6172 2038 2032 3032 3120 3133 3a30 363a ar 8 2021 13:06: │ │ │ │ -001bfdc0: 3233 2062 7920 3c61 2074 6172 6765 743d 23 by Doxygen 1. │ │ │ │ -001bfe10: 392e 313c 2f73 6d61 6c6c 3e3c 2f61 6464 9.1.
    .
    ... │ │ │ │ +001024a0: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // no othe │ │ │ │ +001024c0: 7220 584d 4c20 6461 7461 203c 2f73 7061 r XML data
    .
    } .
    │ │ │ │ +00102520: 7265 7475 726e 3c2f 7370 616e 3e20 3c61 return SOAP_FAULT │ │ │ │ +00102590: 3b20 3c73 7061 6e20 636c 6173 733d 2263 ; // retur │ │ │ │ +001025b0: 6e20 6672 6f6d 2073 6572 7669 6365 206f n from service o │ │ │ │ +001025c0: 7065 7261 7469 6f6e 2063 616c 6c20 7769 peration call wi │ │ │ │ +001025d0: 7468 2074 6865 2066 6175 6c74 3c2f 7370 th the fault
    .
    sh │ │ │ │ +001026b0: 6f72 7420 7665 7273 696f 6e3c 2f64 6976 ort version
    SOAP version │ │ │ │ +001026e0: 2028 3020 3d20 6e6f 2053 4f41 502c 2031 (0 = no SOAP, 1 │ │ │ │ +001026f0: 203d 2053 4f41 5020 312e 312c 2032 203d = SOAP 1.1, 2 = │ │ │ │ +00102700: 2053 4f41 5020 312e 3229 3c2f 6469 763e SOAP 1.2)
    │ │ │ │ +00102710: 3c64 6976 2063 6c61 7373 3d22 7474 6465
    Definition │ │ │ │ +00102730: 3a3c 2f62 3e20 7374 6473 6f61 7032 2e68 : stdsoap2.h │ │ │ │ +00102740: 3a32 3835 313c 2f64 6976 3e3c 2f64 6976 :2851
    .

    Here │ │ │ │ +00102770: 2c20 3c63 6f64 653e 3c61 2063 6c61 7373 , soap_rec │ │ │ │ +00102820: 6569 7665 725f 6661 756c 743c 2f61 3e3c eiver_fault< │ │ │ │ +00102830: 2f63 6f64 653e 2061 6c6c 6f63 6174 6573 /code> allocates │ │ │ │ +00102840: 2061 2066 6175 6c74 2073 7472 7563 7420 a fault struct │ │ │ │ +00102850: 7468 656e 2077 6520 7365 7420 7468 6520 then we set the │ │ │ │ +00102860: 534f 4150 2046 6175 6c74 2064 6574 6169 SOAP Fault detai │ │ │ │ +00102870: 6c73 2061 7320 7368 6f77 6e2e 3c2f 703e ls as shown.

    │ │ │ │ +00102880: 0a3c 703e 4e6f 7465 2074 6861 7420 534f .

    Note that SO │ │ │ │ +00102890: 4150 2031 2e32 2073 7570 706f 7274 7320 AP 1.2 supports │ │ │ │ +001028a0: 6e65 7374 6564 2066 6175 6c74 2073 7562 nested fault sub │ │ │ │ +001028b0: 2d63 6f64 6573 2e20 5468 6573 6520 6361 -codes. These ca │ │ │ │ +001028c0: 6e20 6265 2073 6574 2061 7320 666f 6c6c n be set as foll │ │ │ │ +001028d0: 6f77 733a 3c2f 703e 0a3c 6469 7620 636c ows:

    .. │ │ │ │ +001029d0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    struct < │ │ │ │ +00102a00: 2f73 7061 6e3e 3c61 2063 6c61 7373 3d22 /span>SOAP_ENV__Code │ │ │ │ +00102a50: 3c2f 613e 202a 7375 6263 6f64 6532 203d *subcode2 = │ │ │ │ +00102a60: 2073 6f61 705f 6e65 775f 534f 4150 5f45 soap_new_SOAP_E │ │ │ │ +00102a70: 4e56 5f5f 436f 6465 283c 6120 636c 6173 NV__Code( │ │ │ │ +00102aa0: 736f 6170 3c2f 613e 293b 3c2f 6469 763e soap);
    │ │ │ │ +00102ab0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    soap_sende │ │ │ │ +00102b20: 725f 6661 756c 743c 2f61 3e28 3c61 2063 r_fault(soap, "T │ │ │ │ +00102b80: 6865 2072 6571 7565 7374 6564 2070 726f he requested pro │ │ │ │ +00102b90: 6669 6c65 2074 6f6b 656e 2050 726f 6669 file token Profi │ │ │ │ +00102ba0: 6c65 546f 6b65 6e20 646f 6573 206e 6f74 leToken does not │ │ │ │ +00102bb0: 2065 7869 7374 2e26 7175 6f74 3b3c 2f73 exist.", NULL); .
    subcode1-& │ │ │ │ +00102bf0: 6774 3b3c 6120 636c 6173 733d 2263 6f64 gt;SOAP_ENV__Value │ │ │ │ +00102c60: 3c2f 613e 203d 2028 3c73 7061 6e20 636c = (char*)< │ │ │ │ +00102c90: 7370 616e 2063 6c61 7373 3d22 7374 7269 span class="stri │ │ │ │ +00102ca0: 6e67 6c69 7465 7261 6c22 3e26 7175 6f74 ngliteral">" │ │ │ │ +00102cb0: 3b74 6572 3a49 6e76 616c 6964 4172 6773 ;ter:InvalidArgs │ │ │ │ +00102cc0: 2671 756f 743b 3c2f 7370 616e 3e3b 203c "; < │ │ │ │ +00102cd0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ +00102ce0: 656e 7422 3e2f 2f20 6120 514e 616d 6520 ent">// a QName │ │ │ │ +00102cf0: 7661 6c75 653c 2f73 7061 6e3e 3c2f 6469 value.
    subcode1-&g │ │ │ │ +00102d20: 743b 3c61 2063 6c61 7373 3d22 636f 6465 t; │ │ │ │ +00102d80: 534f 4150 5f45 4e56 5f5f 5375 6263 6f64 SOAP_ENV__Subcod │ │ │ │ +00102d90: 653c 2f61 3e20 3d20 7375 6263 6f64 6532 e = subcode2 │ │ │ │ +00102da0: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
    .
    subcod │ │ │ │ +00102dc0: 6532 2d26 6774 3b3c 6120 636c 6173 733d e2->SOAP_ENV__V │ │ │ │ +00102e30: 616c 7565 3c2f 613e 203d 2028 3c73 7061 alue = (char*)& │ │ │ │ +00102e80: 7175 6f74 3b74 6572 3a4e 6f50 726f 6669 quot;ter:NoProfi │ │ │ │ +00102e90: 6c65 2671 756f 743b 3c2f 7370 616e 3e3b le"; │ │ │ │ +00102ea0: 203c 7370 616e 2063 6c61 7373 3d22 636f // a QNam │ │ │ │ +00102ec0: 6520 7661 6c75 653c 2f73 7061 6e3e 3c2f e value.
    subcode2- │ │ │ │ +00102ef0: 2667 743b 3c61 2063 6c61 7373 3d22 636f >SOAP_ENV__Subc │ │ │ │ +00102f60: 6f64 653c 2f61 3e20 3d20 4e55 4c4c 3b3c ode = NULL;< │ │ │ │ +00102f70: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>..< │ │ │ │ +00103110: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00103120: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >retur │ │ │ │ +00103140: 6e3c 2f73 7061 6e3e 203c 6120 636c 6173 n SOA │ │ │ │ +001031a0: 505f 4641 554c 543c 2f61 3e3b 3c2f 6469 P_FAULT;.

    Thi │ │ │ │ +001031d0: 7320 7072 6f64 7563 6573 3a3c 2f70 3e0a s produces:

    . │ │ │ │ +001031e0: 3c64 6976 2063 6c61 7373 3d22 616c 7422
    <SOAP-ENV │ │ │ │ +00103240: 3a46 6175 6c74 3c2f 7370 616e 3e26 6774 :Fault> │ │ │ │ +00103250: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
    .
    < │ │ │ │ +00103270: 3c73 7061 6e20 636c 6173 733d 226b 6579 SOAP-E │ │ │ │ +00103290: 4e56 3a43 6f64 653c 2f73 7061 6e3e 2667 NV:Code&g │ │ │ │ +001032a0: 743b 3c2f 6469 763e 0a3c 6469 7620 636c t;
    .
    & │ │ │ │ +001032c0: 6c74 3b3c 7370 616e 2063 6c61 7373 3d22 lt;SOA │ │ │ │ +001032e0: 502d 454e 563a 5661 6c75 653c 2f73 7061 P-ENV:Value>SOAP │ │ │ │ +00103310: 2d45 4e56 3a53 656e 6465 723c 2f73 7061 -ENV:Sender</SOAP-ENV:Value< │ │ │ │ +00103350: 2f73 7061 6e3e 2667 743b 3c2f 6469 763e /span>>
    │ │ │ │ +00103360: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    <SOAP-ENV:Su │ │ │ │ +001033a0: 6263 6f64 653c 2f73 7061 6e3e 2667 743b bcode> │ │ │ │ +001033b0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    & │ │ │ │ +001033d0: 6c74 3b3c 7370 616e 2063 6c61 7373 3d22 lt;SOA │ │ │ │ +001033f0: 502d 454e 563a 5661 6c75 653c 2f73 7061 P-ENV:Value>ter: │ │ │ │ +00103420: 496e 7661 6c69 6441 7267 733c 2f73 7061 InvalidArgs</SOAP-ENV:Value< │ │ │ │ +00103460: 2f73 7061 6e3e 2667 743b 3c2f 6469 763e /span>>
    │ │ │ │ +00103470: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    <SOAP-ENV: │ │ │ │ +001034b0: 5375 6263 6f64 653c 2f73 7061 6e3e 2667 Subcode&g │ │ │ │ +001034c0: 743b 3c2f 6469 763e 0a3c 6469 7620 636c t;
    .
    │ │ │ │ +001034e0: 2020 2026 6c74 3b3c 7370 616e 2063 6c61 <SOAP-ENV:Value< │ │ │ │ +00103510: 2f73 7061 6e3e 2667 743b 3c73 7061 6e20 /span>> │ │ │ │ +00103530: 7465 723a 4e6f 5072 6f66 696c 653c 2f73 ter:NoProfile </SOAP-ENV:Val │ │ │ │ +00103570: 7565 3c2f 7370 616e 3e26 6774 3b3c 2f64 ue>.
    < │ │ │ │ +001035a0: 2f3c 7370 616e 2063 6c61 7373 3d22 6b65 /SOAP- │ │ │ │ +001035c0: 454e 563a 5375 6263 6f64 653c 2f73 7061 ENV:Subcode>
    . │ │ │ │ +001035f0: 2020 2026 6c74 3b2f 3c73 7061 6e20 636c </SOAP-ENV:Subco │ │ │ │ +00103620: 6465 3c2f 7370 616e 3e26 6774 3b3c 2f64 de>.
    </SOAP-ENV: │ │ │ │ +00103670: 436f 6465 3c2f 7370 616e 3e26 6774 3b3c Code>< │ │ │ │ +00103680: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    <SOAP-ENV │ │ │ │ +001036c0: 3a52 6561 736f 6e3c 2f73 7061 6e3e 2667 :Reason&g │ │ │ │ +001036d0: 743b 3c2f 6469 763e 0a3c 6469 7620 636c t;
    .
    & │ │ │ │ +001036f0: 6c74 3b3c 7370 616e 2063 6c61 7373 3d22 lt;SOA │ │ │ │ +00103710: 502d 454e 563a 5465 7874 3c2f 7370 616e P-ENV:Text xml:lang │ │ │ │ +00103740: 3c2f 7370 616e 3e3d 3c73 7061 6e20 636c ="en&quo │ │ │ │ +00103770: 743b 3c2f 7370 616e 3e26 6774 3b3c 7370 t;>The requested profi │ │ │ │ +001037e0: 6c65 3c2f 7370 616e 3e20 3c73 7061 6e20 le │ │ │ │ +00103800: 746f 6b65 6e3c 2f73 7061 6e3e 203c 7370 token ProfileToken< │ │ │ │ +00103830: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> doe │ │ │ │ +00103850: 733c 2f73 7061 6e3e 203c 7370 616e 2063 s n │ │ │ │ +00103870: 6f74 3c2f 7370 616e 3e20 3c73 7061 6e20 ot │ │ │ │ +00103890: 6578 6973 742e 3c2f 7370 616e 3e26 6c74 exist.< │ │ │ │ +001038a0: 3b2f 3c73 7061 6e20 636c 6173 733d 226b ;/SOAP │ │ │ │ +001038c0: 2d45 4e56 3a54 6578 743c 2f73 7061 6e3e -ENV:Text │ │ │ │ +001038d0: 2667 743b 3c2f 6469 763e 0a3c 6469 7620 >
    .
    & │ │ │ │ +001038f0: 6c74 3b2f 3c73 7061 6e20 636c 6173 733d lt;/SO │ │ │ │ +00103910: 4150 2d45 4e56 3a52 6561 736f 6e3c 2f73 AP-ENV:Reason>
    .< │ │ │ │ +00103930: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00103940: 3e26 6c74 3b2f 3c73 7061 6e20 636c 6173 ></ │ │ │ │ +00103960: 534f 4150 2d45 4e56 3a46 6175 6c74 3c2f SOAP-ENV:Fault>
    . │ │ │ │ +00103980: 3c2f 6469 763e 3c21 2d2d 2066 7261 676d

    Service operati │ │ │ │ +001039b0: 6f6e 7320 696d 706c 656d 656e 7461 7469 ons implementati │ │ │ │ +001039c0: 6f6e 2069 6e20 6120 5765 6220 7365 7276 on in a Web serv │ │ │ │ +001039d0: 6963 6520 6170 706c 6963 6174 696f 6e20 ice application │ │ │ │ +001039e0: 6361 6e20 7265 7475 726e 2076 6172 696f can return vario │ │ │ │ +001039f0: 7573 2053 4f41 5020 4661 756c 7473 2063 us SOAP Faults c │ │ │ │ +00103a00: 7573 746f 6d69 7a65 6420 696e 2074 6869 ustomized in thi │ │ │ │ +00103a10: 7320 7761 792e 3c2f 703e 0a3c 703e 534f s way.

    .

    SO │ │ │ │ +00103a20: 4150 2046 6175 6c74 2073 7472 7563 7475 AP Fault structu │ │ │ │ +00103a30: 7265 7320 6172 6520 6465 636c 6172 6564 res are declared │ │ │ │ +00103a40: 203c 636f 6465 3e6d 7574 6162 6c65 3c2f mutable, which mea │ │ │ │ +00103a60: 6e73 2074 6861 7420 7265 2d64 6563 6c61 ns that re-decla │ │ │ │ +00103a70: 7261 7469 6f6e 7320 6f66 2074 6865 2073 rations of the s │ │ │ │ +00103a80: 7472 7563 7475 7265 7320 6172 6520 7065 tructures are pe │ │ │ │ +00103a90: 726d 6974 7465 6420 616e 6420 6164 6469 rmitted and addi │ │ │ │ +00103aa0: 7469 6f6e 616c 206d 656d 6265 7273 2061 tional members a │ │ │ │ +00103ab0: 7265 2063 6f6c 6c65 6374 6564 2069 6e74 re collected int │ │ │ │ +00103ac0: 6f20 6f6e 6520 6669 6e61 6c20 7374 7275 o one final stru │ │ │ │ +00103ad0: 6374 7572 6520 6279 2074 6865 2073 6f61 cture by the soa │ │ │ │ +00103ae0: 7063 7070 3220 746f 6f6c 2e3c 2f70 3e0a pcpp2 tool.

    . │ │ │ │ +00103af0: 3c70 3e46 6f72 2061 6e20 6578 616d 706c

    For an exampl │ │ │ │ +00103b00: 6520 7468 6174 2075 7365 6420 7468 6520 e that used the │ │ │ │ +00103b10: 534f 4150 2046 6175 6c74 2064 6574 6169 SOAP Fault detai │ │ │ │ +00103b20: 6c20 7374 7275 6374 7572 653a 3c2f 703e l structure:

    │ │ │ │ +00103b30: 0a3c 6469 7620 636c 6173 733d 2266 7261 .
    s │ │ │ │ +00103b70: 7472 7563 7420 3c2f 7370 616e 3e3c 6120 truct SOAP_ │ │ │ │ +00103bc0: 454e 565f 5f44 6574 6169 6c3c 2f61 3e20 ENV__Detail │ │ │ │ +00103bd0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    {
    │ │ │ │ +00103bf0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    con │ │ │ │ +00103c20: 7374 3c2f 7370 616e 3e20 3c73 7061 6e20 st char │ │ │ │ +00103c50: 2a66 5f5f 696e 7661 6c69 643b 3c2f 6469 *f__invalid;.
    c │ │ │ │ +00103c90: 6f6e 7374 3c2f 7370 616e 3e20 3c73 7061 onst char *f__unavailabl │ │ │ │ +00103cd0: 653b 3c2f 6469 763e 0a3c 6469 7620 636c e;
    .
    < │ │ │ │ +00103cf0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +00103d00: 6f72 6474 7970 6522 3e69 6e74 3c2f 7370 ordtype">int __type;< │ │ │ │ +00103d80: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    void *fault;.
    _XM │ │ │ │ +00103ea0: 4c3c 2f61 3e20 3c61 2063 6c61 7373 3d22 L __any; │ │ │ │ +00103f10: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    }; .
    //gso │ │ │ │ +00103f60: 6170 206e 7320 7365 7276 6963 6520 6d65 ap ns service me │ │ │ │ +00103f70: 7468 6f64 2d66 6175 6c74 3a20 6c6f 6769 thod-fault: logi │ │ │ │ +00103f80: 6e20 665f 5f69 6e76 616c 6964 203c 2f73 n f__invalid
    .
    //gsoap ns se │ │ │ │ +00103fd0: 7276 6963 6520 6d65 7468 6f64 2d66 6175 rvice method-fau │ │ │ │ +00103fe0: 6c74 3a20 6c6f 6769 6e20 665f 5f75 6e61 lt: login f__una │ │ │ │ +00103ff0: 7661 696c 6162 6c65 203c 2f73 7061 6e3e vailable │ │ │ │ +00104000: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    int ns │ │ │ │ +00104040: 5f5f 6c6f 6769 6e28 2e2e 2e29 3b3c 2f64 __login(...);.

    Se │ │ │ │ +00104070: 6520 616c 736f 2041 5049 2064 6f63 756d e also API docum │ │ │ │ +00104080: 656e 7461 7469 6f6e 204d 6f64 756c 6520 entation Module │ │ │ │ +00104090: 3c61 2063 6c61 7373 3d22 656c 2220 6872 Fa │ │ │ │ +001040c0: 756c 7420 7374 7275 6374 7572 6520 616e ult structure an │ │ │ │ +001040d0: 6420 6675 6e63 7469 6f6e 733c 2f61 3e2e d functions. │ │ │ │ +001040e0: 3c2f 703e 0a3c 703e f09f 949d 203c 6120

    .

    .... Back to │ │ │ │ +00104100: 2074 6162 6c65 206f 6620 636f 6e74 656e table of conten │ │ │ │ +00104110: 7473 3c2f 613e 3c2f 703e 0a3c 6831 3e3c ts

    .

    < │ │ │ │ +00104120: 6120 636c 6173 733d 2261 6e63 686f 7222 a class="anchor" │ │ │ │ +00104130: 2069 643d 224d 494d 4522 3e3c 2f61 3e0a id="MIME">. │ │ │ │ +00104140: 4d49 4d45 2061 7474 6163 686d 656e 7473 MIME attachments │ │ │ │ +00104150: 3c2f 6831 3e0a 3c70 3e54 6865 2067 534f

    .

    The gSO │ │ │ │ +00104160: 4150 2074 6f6f 6c6b 6974 2073 7570 706f AP toolkit suppo │ │ │ │ +00104170: 7274 7320 4d49 4d45 2061 7474 6163 686d rts MIME attachm │ │ │ │ +00104180: 656e 7473 2061 7320 7065 7220 534f 4150 ents as per SOAP │ │ │ │ +00104190: 2077 6974 6820 4174 7461 6368 6d65 6e74 with Attachment │ │ │ │ +001041a0: 7320 2853 7741 2920 7370 6563 6966 6963 s (SwA) specific │ │ │ │ +001041b0: 6174 696f 6e20 3c61 2068 7265 663d 2268 ation http://www │ │ │ │ +001041f0: 2e77 332e 6f72 672f 5452 2f53 4f41 502d .w3.org/TR/SOAP- │ │ │ │ +00104200: 6174 7461 6368 6d65 6e74 733c 2f61 3e2e attachments. │ │ │ │ +00104210: 3c2f 703e 0a3c 703e 4d54 4f4d 2061 7474

    .

    MTOM att │ │ │ │ +00104220: 6163 686d 656e 7473 2074 6861 7420 6172 achments that ar │ │ │ │ +00104230: 6520 6573 7365 6e74 6961 6c6c 7920 4d49 e essentially MI │ │ │ │ +00104240: 4d45 2061 7474 6163 686d 656e 7473 2074 ME attachments t │ │ │ │ +00104250: 6861 7420 636f 6e66 6f72 6d20 746f 2074 hat conform to t │ │ │ │ +00104260: 6865 204d 544f 4d20 7370 6563 6966 6963 he MTOM specific │ │ │ │ +00104270: 6174 696f 6e20 3c61 2068 7265 663d 2268 ation http://www.w3.o │ │ │ │ +001042b0: 7267 2f54 522f 736f 6170 3132 2d6d 746f rg/TR/soap12-mto │ │ │ │ +001042c0: 6d3c 2f61 3e20 6172 6520 616c 736f 2073 m are also s │ │ │ │ +001042d0: 7570 706f 7274 6564 2077 6869 6368 2061 upported which a │ │ │ │ +001042e0: 7265 2074 6865 2070 7265 6665 7272 6564 re the preferred │ │ │ │ +001042f0: 2077 6179 2074 6f20 696e 636c 7564 6520 way to include │ │ │ │ +00104300: 4d49 4d45 2061 7474 6163 686d 656e 7473 MIME attachments │ │ │ │ +00104310: 2077 6974 6820 534f 4150 206d 6573 7361 with SOAP messa │ │ │ │ +00104320: 6765 732c 2073 6565 2053 6563 7469 6f6e ges, see Section │ │ │ │ +00104330: 203c 6120 636c 6173 733d 2265 6c22 2068 MTOM attac │ │ │ │ +00104360: 686d 656e 7473 3c2f 613e 2e3c 2f70 3e0a hments.

    . │ │ │ │ +00104370: 3c70 3e49 6e20 7468 6520 666f 6c6c 6f77

    In the follow │ │ │ │ +00104380: 696e 6720 6469 7363 7573 7369 6f6e 2c20 ing discussion, │ │ │ │ +00104390: 4d49 4d45 2061 7474 6163 686d 656e 7420 MIME attachment │ │ │ │ +001043a0: 6461 7461 2069 7320 6173 7375 6d65 6420 data is assumed │ │ │ │ +001043b0: 746f 2062 6520 7265 7369 6465 6e74 2069 to be resident i │ │ │ │ +001043c0: 6e20 6d65 6d6f 7279 2066 6f72 2073 656e n memory for sen │ │ │ │ +001043d0: 6469 6e67 206f 7065 7261 7469 6f6e 7320 ding operations │ │ │ │ +001043e0: 616e 6420 4d49 4d45 2061 7474 6163 686d and MIME attachm │ │ │ │ +001043f0: 656e 7473 2072 6563 6569 7665 6420 7769 ents received wi │ │ │ │ +00104400: 6c6c 2062 6520 7374 6f72 6564 2069 6e20 ll be stored in │ │ │ │ +00104410: 6d65 6d6f 7279 206d 616e 6167 6564 2062 memory managed b │ │ │ │ +00104420: 7920 7468 6520 636f 6e74 6578 742e 204d y the context. M │ │ │ │ +00104430: 544f 4d20 616e 6420 4449 4d45 2061 7474 TOM and DIME att │ │ │ │ +00104440: 6163 686d 656e 7473 206f 6e20 7468 6520 achments on the │ │ │ │ +00104450: 6f74 6865 7220 6861 6e64 2063 616e 2062 other hand can b │ │ │ │ +00104460: 6520 7374 7265 616d 6564 2061 6e64 2074 e streamed and t │ │ │ │ +00104470: 6865 7265 666f 7265 204d 544f 4d2f 4449 herefore MTOM/DI │ │ │ │ +00104480: 4d45 2061 7474 6163 686d 656e 7420 6461 ME attachment da │ │ │ │ +00104490: 7461 2064 6f65 7320 6e6f 7420 6e65 6564 ta does not need │ │ │ │ +001044a0: 2074 6f20 6265 2073 746f 7265 6420 696e to be stored in │ │ │ │ +001044b0: 206d 656d 6f72 792c 2073 6565 2053 6563 memory, see Sec │ │ │ │ +001044c0: 7469 6f6e 7320 3c61 2063 6c61 7373 3d22 tions DIME │ │ │ │ +001044f0: 6174 7461 6368 6d65 6e74 733c 2f61 3e20 attachments │ │ │ │ +00104500: 616e 6420 3c61 2063 6c61 7373 3d22 656c and MTOM at │ │ │ │ +00104530: 7461 6368 6d65 6e74 733c 2f61 3e20 2e3c tachments .< │ │ │ │ +00104540: 2f70 3e0a 3c70 3e54 7261 6e73 6d69 7474 /p>.

    Transmitt │ │ │ │ +00104550: 696e 6720 6d75 6c74 6970 6172 742f 7265 ing multipart/re │ │ │ │ +00104560: 6c61 7465 6420 4d49 4d45 2061 7474 6163 lated MIME attac │ │ │ │ +00104570: 686d 656e 7473 2077 6974 6820 6120 534f hments with a SO │ │ │ │ +00104580: 4150 2f58 4d4c 206d 6573 7361 6765 2069 AP/XML message i │ │ │ │ +00104590: 7320 6163 636f 6d70 6c69 7368 6564 2077 s accomplished w │ │ │ │ +001045a0: 6974 6820 7477 6f20 6675 6e63 7469 6f6e ith two function │ │ │ │ +001045b0: 732c 203c 636f 6465 3e3c 6120 636c 6173 s, soap_s │ │ │ │ +00104630: 6574 5f6d 696d 653c 2f61 3e3c 2f63 6f64 et_mime and soap_set_mim │ │ │ │ +001046e0: 655f 6174 7461 6368 6d65 6e74 3c2f 613e e_attachment │ │ │ │ +001046f0: 3c2f 636f 6465 3e2e 2054 6865 2066 6972 . The fir │ │ │ │ +00104700: 7374 2066 756e 6374 696f 6e20 6973 2066 st function is f │ │ │ │ +00104710: 6f72 2069 6e69 7469 616c 697a 6174 696f or initializatio │ │ │ │ +00104720: 6e20 7075 7270 6f73 6573 2061 6e64 2074 n purposes and t │ │ │ │ +00104730: 6865 206c 6174 7465 7220 6675 6e63 7469 he latter functi │ │ │ │ +00104740: 6f6e 2069 7320 7573 6564 2074 6f20 7370 on is used to sp │ │ │ │ +00104750: 6563 6966 7920 6d65 7461 2064 6174 6120 ecify meta data │ │ │ │ +00104760: 616e 6420 636f 6e74 656e 7420 6461 7461 and content data │ │ │ │ +00104770: 2066 6f72 2065 6163 6820 6174 7461 6368 for each attach │ │ │ │ +00104780: 6d65 6e74 2e3c 2f70 3e0a 3c70 3e53 6565 ment.

    .

    See │ │ │ │ +00104790: 2061 6c73 6f20 4150 4920 646f 6375 6d65 also API docume │ │ │ │ +001047a0: 6e74 6174 696f 6e20 4d6f 6475 6c65 203c ntation Module < │ │ │ │ +001047b0: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ +001047c0: 663d 2267 726f 7570 5f5f 6772 6f75 705f f="group__group_ │ │ │ │ +001047d0: 5f6d 696d 652e 6874 6d6c 223e 4d49 4d45 _mime.html">MIME │ │ │ │ +001047e0: 2061 7474 6163 686d 656e 7420 6675 6e63 attachment func │ │ │ │ +001047f0: 7469 6f6e 733c 2f61 3e2e 3c2f 703e 0a3c tions.

    .< │ │ │ │ +00104800: 703e f09f 949d 203c 6120 6872 6566 3d22 p>.... Back to table │ │ │ │ +00104820: 206f 6620 636f 6e74 656e 7473 3c2f 613e of contents │ │ │ │ +00104830: 3c2f 703e 0a3c 6832 3e3c 6120 636c 6173

    .

    . │ │ │ │ +00104860: 5365 6e64 696e 6720 6120 636f 6c6c 6563 Sending a collec │ │ │ │ +00104870: 7469 6f6e 206f 6620 4d49 4d45 2061 7474 tion of MIME att │ │ │ │ +00104880: 6163 686d 656e 7473 2028 5377 4129 3c2f achments (SwA).

    The follo │ │ │ │ +001048a0: 7769 6e67 2066 756e 6374 696f 6e73 2061 wing functions a │ │ │ │ +001048b0: 7265 2075 7365 6420 746f 2073 6574 2075 re used to set u │ │ │ │ +001048c0: 7020 6120 636f 6c6c 6563 7469 6f6e 206f p a collection o │ │ │ │ +001048d0: 6620 6d75 6c74 6970 6172 742f 7265 6c61 f multipart/rela │ │ │ │ +001048e0: 7465 6420 4d49 4d45 2061 7474 6163 686d ted MIME attachm │ │ │ │ +001048f0: 656e 7473 2066 6f72 2074 7261 6e73 6d69 ents for transmi │ │ │ │ +00104900: 7373 696f 6e20 7769 7468 2061 2053 4f41 ssion with a SOA │ │ │ │ +00104910: 5020 6f72 2058 4d4c 206d 6573 7361 6765 P or XML message │ │ │ │ +00104920: 2e3c 2f70 3e0a 3c75 6c3e 0a3c 6c69 3e3c .

    .
      .
    • < │ │ │ │ +00104930: 636f 6465 3e76 6f69 6420 3c61 2063 6c61 code>void soap_ │ │ │ │ +001049b0: 7365 745f 6d69 6d65 2873 7472 7563 7420 set_mime(struct │ │ │ │ +001049c0: 736f 6170 202a 736f 6170 2c20 636f 6e73 soap *soap, cons │ │ │ │ +001049d0: 7420 6368 6172 202a 626f 756e 6461 7279 t char *boundary │ │ │ │ +001049e0: 2c20 636f 6e73 7420 6368 6172 202a 7374 , const char *st │ │ │ │ +001049f0: 6172 7429 3c2f 613e 3c2f 636f 6465 3e20 art) │ │ │ │ +00104a00: 5468 6973 2066 756e 6374 696f 6e20 656e This function en │ │ │ │ +00104a10: 6162 6c65 7320 7365 6e64 696e 6720 4d49 ables sending MI │ │ │ │ +00104a20: 4d45 2061 7474 6163 686d 656e 7473 2e20 ME attachments. │ │ │ │ +00104a30: 5468 6973 2066 756e 6374 696f 6e20 6973 This function is │ │ │ │ +00104a40: 2067 656e 6572 616c 6c79 206e 6f74 2072 generally not r │ │ │ │ +00104a50: 6571 7569 7265 6420 7768 656e 2074 6865 equired when the │ │ │ │ +00104a60: 2063 6f6e 7465 7874 2069 7320 696e 6974 context is init │ │ │ │ +00104a70: 6961 6c69 7a65 6420 7769 7468 203c 636f ialized with #SOAP_ENC_MIM │ │ │ │ +00104a90: 453c 2f63 6f64 653e 2c20 6265 6361 7573 E, becaus │ │ │ │ +00104aa0: 6520 4d49 4d45 2061 7474 6163 686d 656e e MIME attachmen │ │ │ │ +00104ab0: 7473 2061 7265 2061 7574 6f6d 6174 6963 ts are automatic │ │ │ │ +00104ac0: 616c 6c79 2064 6574 6563 7465 6420 6173 ally detected as │ │ │ │ +00104ad0: 203c 636f 6465 3e3c 6120 636c 6173 733d xsd__base64 │ │ │ │ +00104b50: 4269 6e61 7279 3c2f 613e 3c2f 636f 6465 Binary and _xop__Include< │ │ │ │ +00104be0: 2f61 3e3c 2f63 6f64 653e 2073 7472 7563 /a> struc │ │ │ │ +00104bf0: 7475 7265 7320 696e 2074 6865 2064 6174 tures in the dat │ │ │ │ +00104c00: 6120 746f 2073 6572 6961 6c69 7a65 2061 a to serialize a │ │ │ │ +00104c10: 7320 616e 2058 4d4c 206d 6573 7361 6765 s an XML message │ │ │ │ +00104c20: 2077 6974 6820 7468 6520 6174 7461 6368 with the attach │ │ │ │ +00104c30: 6d65 6e74 7320 6175 746f 6d61 7469 6361 ments automatica │ │ │ │ +00104c40: 6c6c 7920 6164 6465 6420 6f72 204d 494d lly added or MIM │ │ │ │ +00104c50: 4520 6174 7461 6368 6d65 6e74 7320 6361 E attachments ca │ │ │ │ +00104c60: 6e20 6265 2065 7870 6c69 6369 746c 7920 n be explicitly │ │ │ │ +00104c70: 6164 6465 6420 7769 7468 203c 636f 6465 added with soap_set │ │ │ │ +00104d10: 5f6d 696d 655f 6174 7461 6368 6d65 6e74 _mime_attachment │ │ │ │ +00104d20: 3c2f 613e 3c2f 636f 6465 3e2e 2050 6172 . Par │ │ │ │ +00104d30: 616d 6574 6572 203c 636f 6465 3e62 6f75 ameter bou │ │ │ │ +00104d40: 6e64 6172 793c 2f63 6f64 653e 2073 7065 ndary spe │ │ │ │ +00104d50: 6369 6669 6573 2061 204d 494d 4520 626f cifies a MIME bo │ │ │ │ +00104d60: 756e 6461 7279 2073 7472 696e 6720 6f72 undary string or │ │ │ │ +00104d70: 204e 554c 4c20 746f 2068 6176 6520 7468 NULL to have th │ │ │ │ +00104d80: 6520 656e 6769 6e65 2067 656e 6572 6174 e engine generat │ │ │ │ +00104d90: 6520 6120 4d49 4d45 2062 6f75 6e64 6172 e a MIME boundar │ │ │ │ +00104da0: 7920 7374 7269 6e67 2e20 5061 7261 6d65 y string. Parame │ │ │ │ +00104db0: 7465 7220 3c63 6f64 653e 7374 6172 743c ter start< │ │ │ │ +00104dc0: 2f63 6f64 653e 2073 7065 6369 6669 6573 /code> specifies │ │ │ │ +00104dd0: 2074 6865 2073 7461 7274 2063 6f6e 7465 the start conte │ │ │ │ +00104de0: 6e74 2049 4420 666f 7220 7468 6520 6669 nt ID for the fi │ │ │ │ +00104df0: 7273 7420 4d49 4d45 2062 6f64 7920 636f rst MIME body co │ │ │ │ +00104e00: 6e74 6169 6e69 6e67 2074 6865 2053 4f41 ntaining the SOA │ │ │ │ +00104e10: 5020 6f72 2058 4d4c 206d 6573 7361 6765 P or XML message │ │ │ │ +00104e20: 2e20 5768 656e 204e 554c 4c2c 2074 6865 . When NULL, the │ │ │ │ +00104e30: 2073 7461 7274 2049 4420 6f66 2074 6865 start ID of the │ │ │ │ +00104e40: 2053 4f41 5020 6d65 7373 6167 6520 6973 SOAP message is │ │ │ │ +00104e50: 203c 656d 3e3c 636f 6465 3e26 6c74 3b53 <S │ │ │ │ +00104e60: 4f41 502d 454e 563a 456e 7665 6c6f 7065 OAP-ENV:Envelope │ │ │ │ +00104e70: 2667 743b 3c2f 636f 6465 3e3c 2f65 6d3e > │ │ │ │ +00104e80: 2e3c 2f6c 693e 0a3c 6c69 3e3c 636f 6465 .
    • .
    • int soap_set_mi │ │ │ │ +00104ea0: 6d65 5f61 7474 6163 686d 656e 7428 7374 me_attachment(st │ │ │ │ +00104eb0: 7275 6374 2073 6f61 7020 2a73 6f61 702c ruct soap *soap, │ │ │ │ +00104ec0: 2063 6861 7220 2a70 7472 2c20 7369 7a65 char *ptr, size │ │ │ │ +00104ed0: 5f74 2073 697a 652c 2065 6e75 6d20 736f _t size, enum so │ │ │ │ +00104ee0: 6170 5f6d 696d 655f 656e 636f 6469 6e67 ap_mime_encoding │ │ │ │ +00104ef0: 2065 6e63 6f64 696e 672c 2063 6f6e 7374 encoding, const │ │ │ │ +00104f00: 2063 6861 7220 2a74 7970 652c 2063 6f6e char *type, con │ │ │ │ +00104f10: 7374 2063 6861 7220 2a69 642c 2063 6f6e st char *id, con │ │ │ │ +00104f20: 7374 2063 6861 7220 2a6c 6f63 6174 696f st char *locatio │ │ │ │ +00104f30: 6e2c 2063 6f6e 7374 2063 6861 7220 2a64 n, const char *d │ │ │ │ +00104f40: 6573 6372 6970 7469 6f6e 293c 2f63 6f64 escription) This function │ │ │ │ +00104f60: 2061 6464 7320 6120 4d49 4d45 2061 7474 adds a MIME att │ │ │ │ +00104f70: 6163 686d 656e 7420 746f 2061 2053 4f41 achment to a SOA │ │ │ │ +00104f80: 502f 584d 4c20 6d65 7373 6167 6520 746f P/XML message to │ │ │ │ +00104f90: 2073 656e 642e 2054 6865 2073 7065 6369 send. The speci │ │ │ │ +00104fa0: 6669 6564 203c 636f 6465 3e70 7472 3c2f fied ptr points to │ │ │ │ +00104fc0: 7468 6520 6461 7461 2074 6f20 7365 6e64 the data to send │ │ │ │ +00104fd0: 206f 6620 6c65 6e67 7468 2073 7065 6369 of length speci │ │ │ │ +00104fe0: 6669 6564 2062 7920 3c63 6f64 653e 7369 fied by si │ │ │ │ +00104ff0: 7a65 3c2f 636f 6465 3e2e 2054 6865 203c ze. The < │ │ │ │ +00105000: 636f 6465 3e65 6e63 6f64 696e 673c 2f63 code>encoding parameter i │ │ │ │ +00105020: 7320 6120 3c63 6f64 653e 3c61 2063 6c61 s a soap_ │ │ │ │ +001050b0: 6d69 6d65 5f65 6e63 6f64 696e 673c 2f61 mime_encoding value t │ │ │ │ +001050d0: 6861 7420 6973 2072 6563 6f6d 6d65 6e64 hat is recommend │ │ │ │ +001050e0: 6564 2074 6f20 6265 2073 7065 6369 6669 ed to be specifi │ │ │ │ +001050f0: 6564 2061 7320 3c63 6f64 653e 2353 4f41 ed as #SOA │ │ │ │ +00105100: 505f 4d49 4d45 5f4e 4f4e 453c 2f63 6f64 P_MIME_NONE to specify th │ │ │ │ +00105120: 6174 2074 6865 204d 494d 4520 6461 7461 at the MIME data │ │ │ │ +00105130: 2063 6f6e 7465 6e74 2069 7320 6e6f 7420 content is not │ │ │ │ +00105140: 656e 636f 6465 6420 696e 2061 6e79 2077 encoded in any w │ │ │ │ +00105150: 6179 2028 7468 6520 4d49 4d45 2061 7474 ay (the MIME att │ │ │ │ +00105160: 6163 686d 656e 7420 6675 6e63 7469 6f6e achment function │ │ │ │ +00105170: 2073 696d 706c 7920 636f 7069 6573 2074 simply copies t │ │ │ │ +00105180: 6865 2072 6177 2064 6174 6120 746f 2074 he raw data to t │ │ │ │ +00105190: 6865 204d 494d 4520 626c 6f63 6b20 7769 he MIME block wi │ │ │ │ +001051a0: 7468 6f75 7420 656e 636f 6469 6e67 292e thout encoding). │ │ │ │ +001051b0: 2054 6865 203c 636f 6465 3e74 7970 653c The type< │ │ │ │ +001051c0: 2f63 6f64 653e 2070 6172 616d 6574 6572 /code> parameter │ │ │ │ +001051d0: 2069 7320 7265 7175 6972 6564 2061 6e64 is required and │ │ │ │ +001051e0: 2069 6e64 6963 6174 6573 2074 6865 204d indicates the M │ │ │ │ +001051f0: 494d 4520 7479 7065 206f 6620 7468 6520 IME type of the │ │ │ │ +00105200: 6461 7461 2c20 7375 6368 2061 7320 2269 data, such as "i │ │ │ │ +00105210: 6d61 6765 2f6a 7067 222e 2054 6865 203c mage/jpg". The < │ │ │ │ +00105220: 636f 6465 3e69 643c 2f63 6f64 653e 2070 code>id p │ │ │ │ +00105230: 6172 616d 6574 6572 2075 6e69 7175 656c arameter uniquel │ │ │ │ +00105240: 7920 6964 656e 7469 6669 6573 2074 6865 y identifies the │ │ │ │ +00105250: 2061 7474 6163 686d 656e 7420 696e 2074 attachment in t │ │ │ │ +00105260: 6865 206d 6573 7361 6765 2c20 7768 6963 he message, whic │ │ │ │ +00105270: 6820 6361 6e20 6265 206f 6d69 7474 6564 h can be omitted │ │ │ │ +00105280: 2062 7920 7370 6563 6966 7969 6e67 204e by specifying N │ │ │ │ +00105290: 554c 4c2e 2054 6865 203c 636f 6465 3e6c ULL. The l │ │ │ │ +001052a0: 6f63 6174 696f 6e3c 2f63 6f64 653e 2070 ocation p │ │ │ │ +001052b0: 6172 616d 6574 6572 2073 7065 6369 6669 arameter specifi │ │ │ │ +001052c0: 6573 2061 206c 6f63 6174 696f 6e20 7374 es a location st │ │ │ │ +001052d0: 7269 6e67 206f 7220 4e55 4c4c 2e20 5468 ring or NULL. Th │ │ │ │ +001052e0: 6520 3c63 6f64 653e 6465 7363 7269 7074 e descript │ │ │ │ +001052f0: 696f 6e3c 2f63 6f64 653e 2070 6172 616d ion param │ │ │ │ +00105300: 6574 6572 2069 7320 6120 7374 7269 6e67 eter is a string │ │ │ │ +00105310: 2074 6861 7420 6465 7363 7269 6265 7320 that describes │ │ │ │ +00105320: 7468 6520 6461 7461 206f 7220 4e55 4c4c the data or NULL │ │ │ │ +00105330: 2e20 5265 7475 726e 7320 3c63 6f64 653e . Returns │ │ │ │ +00105340: 2353 4f41 505f 4f4b 3c2f 636f 6465 3e20 #SOAP_OK │ │ │ │ +00105350: 6f72 2061 203c 636f 6465 3e3c 6120 636c or a soap │ │ │ │ +00105410: 5f73 7461 7475 733c 2f61 3e3c 2f63 6f64 _status error code..
    • vo │ │ │ │ +00105440: 6964 203c 6120 636c 6173 733d 2265 6c22 id soap_clr_mi │ │ │ │ +001054c0: 6d65 2873 7472 7563 7420 736f 6170 202a me(struct soap * │ │ │ │ +001054d0: 736f 6170 293c 2f61 3e3c 2f63 6f64 653e soap) │ │ │ │ +001054e0: 2054 6869 7320 6675 6e63 7469 6f6e 2064 This function d │ │ │ │ +001054f0: 6973 6162 6c65 7320 4d49 4d45 2061 7474 isables MIME att │ │ │ │ +00105500: 6163 686d 656e 7473 2073 7563 6820 6173 achments such as │ │ │ │ +00105510: 2061 6674 6572 2073 656e 6469 6e67 2061 after sending a │ │ │ │ +00105520: 206d 756c 7469 7061 7274 2d72 656c 6174 multipart-relat │ │ │ │ +00105530: 6564 206d 6573 7361 6765 2077 6974 6820 ed message with │ │ │ │ +00105540: 6174 7461 6368 6d65 6e74 7320 746f 2073 attachments to s │ │ │ │ +00105550: 7769 7463 6820 6261 636b 2074 6f20 6e6f witch back to no │ │ │ │ +00105560: 6e2d 6d75 6c74 6970 6172 742d 7265 6c61 n-multipart-rela │ │ │ │ +00105570: 7465 6420 6d65 7373 6167 696e 672c 2075 ted messaging, u │ │ │ │ +00105580: 6e6c 6573 7320 7468 6520 6461 7461 2074 nless the data t │ │ │ │ +00105590: 6f20 7365 7269 616c 697a 6520 6173 2061 o serialize as a │ │ │ │ +001055a0: 206d 6573 7361 6765 2063 6f6e 7461 696e message contain │ │ │ │ +001055b0: 7320 6174 7461 6368 6d65 6e74 7320 7375 s attachments su │ │ │ │ +001055c0: 6368 2061 7320 3c63 6f64 653e 3c61 2063 ch as xsd__b │ │ │ │ +00105640: 6173 6536 3442 696e 6172 793c 2f61 3e3c ase64Binary< │ │ │ │ +00105650: 2f63 6f64 653e 2066 6f72 204d 494d 4520 /code> for MIME │ │ │ │ +00105660: 6174 7461 6368 6d65 6e74 7320 616e 6420 attachments and │ │ │ │ +00105670: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 _xop │ │ │ │ +001056e0: 5f5f 496e 636c 7564 653c 2f61 3e3c 2f63 __Include for MTOM at │ │ │ │ +00105700: 7461 6368 6d65 6e74 732e 3c2f 6c69 3e0a tachments.
    • . │ │ │ │ +00105710: 3c2f 756c 3e0a 3c70 3e57 6865 6e20 7072
    .

    When pr │ │ │ │ +00105720: 6f76 6964 696e 6720 6120 4d49 4d45 2062 oviding a MIME b │ │ │ │ +00105730: 6f75 6e64 6172 7920 7769 7468 203c 636f oundary with soap_set_mim │ │ │ │ +001057c0: 653c 2f61 3e3c 2f63 6f64 653e 2c20 796f e, yo │ │ │ │ +001057d0: 7520 6861 7665 2074 6f20 6d61 6b65 2073 u have to make s │ │ │ │ +001057e0: 7572 6520 7468 6520 626f 756e 6461 7279 ure the boundary │ │ │ │ +001057f0: 2063 616e 6e6f 7420 6d61 7463 6820 616e cannot match an │ │ │ │ +00105800: 7920 7061 7274 7320 6f66 2074 6865 206d y parts of the m │ │ │ │ +00105810: 6573 7361 6765 2061 6e64 2061 7474 6163 essage and attac │ │ │ │ +00105820: 686d 656e 7473 2074 6861 7420 796f 7520 hments that you │ │ │ │ +00105830: 6172 6520 7365 6e64 696e 672c 2062 6563 are sending, bec │ │ │ │ +00105840: 6175 7365 2074 6865 2062 6f75 6e64 6172 ause the boundar │ │ │ │ +00105850: 7920 6465 6c69 6e65 6174 6573 2074 6865 y delineates the │ │ │ │ +00105860: 2061 7474 6163 686d 656e 7473 2e3c 2f70 attachments.

    .

    The interna │ │ │ │ +00105880: 6c20 6c69 7374 206f 6620 6174 7461 6368 l list of attach │ │ │ │ +00105890: 6d65 6e74 7320 7370 6563 6966 6965 6420 ments specified │ │ │ │ +001058a0: 7769 7468 203c 636f 6465 3e3c 6120 636c with soap_set_mime_ │ │ │ │ +00105940: 6174 7461 6368 6d65 6e74 3c2f 613e 3c2f attachment is destroy │ │ │ │ +00105960: 6564 2077 6974 6820 3c63 6f64 653e 3c61 ed with soap_end or when a │ │ │ │ +00105a50: 6d65 7373 6167 6520 6973 2072 6563 6569 message is recei │ │ │ │ +00105a60: 7665 642e 2054 6865 7265 666f 7265 2c20 ved. Therefore, │ │ │ │ +00105a70: 6361 6c6c 203c 636f 6465 3e3c 6120 636c call soap_set_mime_ │ │ │ │ +00105b10: 6174 7461 6368 6d65 6e74 3c2f 613e 3c2f attachment to set att │ │ │ │ +00105b30: 6163 686d 656e 7473 2062 6566 6f72 6520 achments before │ │ │ │ +00105b40: 7365 6e64 696e 6720 6120 6d65 7373 6167 sending a messag │ │ │ │ +00105b50: 652e 3c2f 703e 0a3c 703e 5468 6520 666f e.

    .

    The fo │ │ │ │ +00105b60: 6c6c 6f77 696e 6720 6578 616d 706c 6520 llowing example │ │ │ │ +00105b70: 7368 6f77 7320 686f 7720 6120 6d75 6c74 shows how a mult │ │ │ │ +00105b80: 6970 6172 742f 7265 6c61 7465 6420 4854 ipart/related HT │ │ │ │ +00105b90: 5450 206d 6573 7361 6765 2077 6974 6820 TP message with │ │ │ │ +00105ba0: 7468 7265 6520 4d49 4d45 2061 7474 6163 three MIME attac │ │ │ │ +00105bb0: 686d 656e 7473 2069 7320 7365 7420 7570 hments is set up │ │ │ │ +00105bc0: 2061 6e64 2074 7261 6e73 6d69 7474 6564 and transmitted │ │ │ │ +00105bd0: 2074 6f20 6120 7365 7276 6572 2e20 496e to a server. In │ │ │ │ +00105be0: 2074 6869 7320 6578 616d 706c 6520 7765 this example we │ │ │ │ +00105bf0: 206c 6574 2074 6865 206d 6573 7361 6765 let the message │ │ │ │ +00105c00: 2062 6f64 7920 7265 6665 7220 746f 2074 body refer to t │ │ │ │ +00105c10: 6865 2061 7474 6163 686d 656e 7473 2075 he attachments u │ │ │ │ +00105c20: 7369 6e67 2058 4d4c 203c 656d 3e3c 636f sing XML href attributes. │ │ │ │ +00105c50: 5468 6520 3c63 6f64 653e 7374 7275 6374 The struct │ │ │ │ +00105c60: 2063 6c61 696d 5f5f 666f 726d 3c2f 636f claim__form data type in │ │ │ │ +00105c80: 636c 7564 6573 2061 2064 6566 696e 6974 cludes a definit │ │ │ │ +00105c90: 696f 6e20 6f66 2061 203c 636f 6465 3e68 ion of a h │ │ │ │ +00105ca0: 7265 663c 2f63 6f64 653e 2061 7474 7269 ref attri │ │ │ │ +00105cb0: 6275 7465 2066 6f72 2074 6869 7320 7075 bute for this pu │ │ │ │ +00105cc0: 7270 6f73 652e 3c2f 703e 0a3c 6469 7620 rpose.

    .
    struct │ │ │ │ +00105d10: 3c2f 7370 616e 3e63 6c61 696d 5f5f 666f claim__fo │ │ │ │ +00105d20: 726d 2066 6f72 6d31 2c20 666f 726d 323b rm form1, form2; │ │ │ │ +00105d30: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    form1. │ │ │ │ +00105d50: 6872 6566 203d 203c 7370 616e 2063 6c61 href = "cid:cla │ │ │ │ +00105d80: 696d 3036 3134 3030 612e 7469 6666 4063 im061400a.tiff@c │ │ │ │ +00105d90: 6c61 696d 696e 672d 6974 2e63 6f6d 2671 laiming-it.com&q │ │ │ │ +00105da0: 756f 743b 3c2f 7370 616e 3e3b 203c 2f64 uot;; .
    form2.href │ │ │ │ +00105dd0: 203d 203c 7370 616e 2063 6c61 7373 3d22 = & │ │ │ │ +00105df0: 7175 6f74 3b63 6964 3a63 6c61 696d 3036 quot;cid:claim06 │ │ │ │ +00105e00: 3134 3030 612e 6a70 6567 4063 6c61 696d 1400a.jpeg@claim │ │ │ │ +00105e10: 696e 672d 6974 2e63 6f6d 2671 756f 743b ing-it.com" │ │ │ │ +00105e20: 3c2f 7370 616e 3e3b 203c 2f64 6976 3e0a ;
    . │ │ │ │ +00105e30: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    /* initi │ │ │ │ +00105e60: 616c 697a 6520 616e 6420 656e 6162 6c65 alize and enable │ │ │ │ +00105e70: 204d 494d 4520 2a2f 3c2f 7370 616e 3e20 MIME */ │ │ │ │ +00105e80: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    soap_ │ │ │ │ +00105ef0: 7365 745f 6d69 6d65 3c2f 613e 283c 6120 set_mime(soap, NU │ │ │ │ +00105f30: 4c4c 2c20 3c73 7061 6e20 636c 6173 733d LL, │ │ │ │ +00105f50: 2671 756f 743b 266c 743b 636c 6169 6d30 "<claim0 │ │ │ │ +00105f60: 3631 3430 3061 2e78 6d6c 4063 6c61 696d 61400a.xml@claim │ │ │ │ +00105f70: 696e 672d 6974 2e63 6f6d 2667 743b 2671 ing-it.com>&q │ │ │ │ +00105f80: 756f 743b 3c2f 7370 616e 3e29 3b20 3c2f uot;); .
    /* │ │ │ │ +00105fc0: 6164 6420 6120 6261 7365 3634 2065 6e63 add a base64 enc │ │ │ │ +00105fd0: 6f64 6564 2074 6966 6620 696d 6167 6520 oded tiff image │ │ │ │ +00105fe0: 2874 6966 6649 6d61 6765 2070 6f69 6e74 (tiffImage point │ │ │ │ +00105ff0: 7320 746f 2062 6173 6536 3420 6461 7461 s to base64 data │ │ │ │ +00106000: 2920 2a2f 3c2f 7370 616e 3e20 3c2f 6469 ) */ .
    soap_set_ │ │ │ │ +00106080: 6d69 6d65 5f61 7474 6163 686d 656e 743c mime_attachment< │ │ │ │ +00106090: 2f61 3e28 3c61 2063 6c61 7373 3d22 636f /a>(soap< │ │ │ │ +001060c0: 2f61 3e2c 2074 6966 6649 6d61 6765 2c20 /a>, tiffImage, │ │ │ │ +001060d0: 7469 6666 4c65 6e2c 203c 6120 636c 6173 tiffLen, SOA │ │ │ │ +00106150: 505f 4d49 4d45 5f42 4153 4536 343c 2f61 P_MIME_BASE64, & │ │ │ │ +00106180: 7175 6f74 3b69 6d61 6765 2f74 6966 6626 quot;image/tiff& │ │ │ │ +00106190: 7175 6f74 3b3c 2f73 7061 6e3e 2c20 3c73 quot;, " │ │ │ │ +001061c0: 266c 743b 636c 6169 6d30 3631 3430 3061 <claim061400a │ │ │ │ +001061d0: 2e74 6966 6640 636c 6169 6d69 6e67 2d69 .tiff@claiming-i │ │ │ │ +001061e0: 742e 636f 6d26 6774 3b26 7175 6f74 3b3c t.com>"< │ │ │ │ +001061f0: 2f73 7061 6e3e 2c20 4e55 4c4c 2c20 4e55 /span>, NULL, NU │ │ │ │ +00106200: 4c4c 293b 203c 2f64 6976 3e0a 3c64 6976 LL);
    .
    /* add a raw │ │ │ │ +00106240: 2062 696e 6172 7920 6a70 6567 2069 6d61 binary jpeg ima │ │ │ │ +00106250: 6765 2028 6a70 6567 496d 6167 6520 706f ge (jpegImage po │ │ │ │ +00106260: 696e 7473 2074 6f20 7261 7720 6461 7461 ints to raw data │ │ │ │ +00106270: 2920 2a2f 3c2f 7370 616e 3e20 3c2f 6469 ) */ .
    soap_set_ │ │ │ │ +001062f0: 6d69 6d65 5f61 7474 6163 686d 656e 743c mime_attachment< │ │ │ │ +00106300: 2f61 3e28 3c61 2063 6c61 7373 3d22 636f /a>(soap< │ │ │ │ +00106330: 2f61 3e2c 206a 7065 6749 6d61 6765 2c20 /a>, jpegImage, │ │ │ │ +00106340: 6a70 6567 4c65 6e2c 203c 6120 636c 6173 jpegLen, SOA │ │ │ │ +001063c0: 505f 4d49 4d45 5f42 494e 4152 593c 2f61 P_MIME_BINARY, & │ │ │ │ +001063f0: 7175 6f74 3b69 6d61 6765 2f6a 7065 6726 quot;image/jpeg& │ │ │ │ +00106400: 7175 6f74 3b3c 2f73 7061 6e3e 2c20 3c73 quot;, " │ │ │ │ +00106430: 266c 743b 636c 6169 6d30 3631 3430 3061 <claim061400a │ │ │ │ +00106440: 2e6a 7065 6740 636c 6169 6d69 6e67 2d69 .jpeg@claiming-i │ │ │ │ +00106450: 742e 636f 6d26 6774 3b26 7175 6f74 3b3c t.com>"< │ │ │ │ +00106460: 2f73 7061 6e3e 2c20 4e55 4c4c 2c20 4e55 /span>, NULL, NU │ │ │ │ +00106470: 4c4c 293b 203c 2f64 6976 3e0a 3c64 6976 LL);
    .
    /* send the │ │ │ │ +001064b0: 666f 726d 7320 6173 204d 494d 4520 6174 forms as MIME at │ │ │ │ +001064c0: 7461 6368 6d65 6e74 7320 7769 7468 2074 tachments with t │ │ │ │ +001064d0: 6869 7320 696e 766f 6361 7469 6f6e 202a his invocation * │ │ │ │ +001064e0: 2f3c 2f73 7061 6e3e 203c 2f64 6976 3e0a /
    . │ │ │ │ +001064f0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    if (soap_call │ │ │ │ +00106530: 5f63 6c61 696d 5f5f 696e 7375 7261 6e63 _claim__insuranc │ │ │ │ +00106540: 655f 636c 6169 6d5f 6175 746f 283c 6120 e_claim_auto(soap, fo │ │ │ │ +00106580: 726d 312c 2066 6f72 6d32 2c20 2e2e 2e29 rm1, form2, ...) │ │ │ │ +00106590: 2920 3c2f 6469 763e 0a3c 6469 7620 636c )
    .
    ... │ │ │ │ +001065b0: 203c 7370 616e 2063 6c61 7373 3d22 636f // an err │ │ │ │ +001065d0: 6f72 206f 6363 7572 7265 6420 3c2f 7370 or occurred
    .
    else
    .
    ... │ │ │ │ +00106640: 203c 7370 616e 2063 6c61 7373 3d22 636f // proces │ │ │ │ +00106660: 7320 7468 6520 7265 7370 6f6e 7365 3c2f s the response
    ..
    │ │ │ │ +00106790: 3c61 2068 7265 663d 2267 726f 7570 5f5f soap_set_mi │ │ │ │ +001067e0: 6d65 5f61 7474 6163 686d 656e 743c 2f61 me_attachment
    int s │ │ │ │ +00106810: 6f61 705f 7365 745f 6d69 6d65 5f61 7474 oap_set_mime_att │ │ │ │ +00106820: 6163 686d 656e 7428 7374 7275 6374 2073 achment(struct s │ │ │ │ +00106830: 6f61 7020 2a73 6f61 702c 2063 6f6e 7374 oap *soap, const │ │ │ │ +00106840: 2063 6861 7220 2a70 7472 2c20 7369 7a65 char *ptr, size │ │ │ │ +00106850: 5f74 2073 697a 652c 2065 6e75 6d20 736f _t size, enum so │ │ │ │ +00106860: 6170 5f6d 696d 655f 656e 636f 6469 6e67 ap_mime_encoding │ │ │ │ +00106870: 2065 6e63 6f64 696e 672c 2063 6f6e 7374 encoding, const │ │ │ │ +00106880: 2063 6861 7220 2a74 7970 652c 2063 6f6e char *type, con │ │ │ │ +00106890: 7374 2063 6861 7220 2a69 642c 2063 6f6e st char *id, con │ │ │ │ +001068a0: 7374 2063 6861 7220 2a6c 6f63 6174 696f st char *locatio │ │ │ │ +001068b0: 6e2c 2063 6f6e 7374 2063 6861 7220 2a64 n, const char *d │ │ │ │ +001068c0: 6573 6372 6970 7469 6f6e 293c 2f64 6976 escription)
    Add a MIME a │ │ │ │ +001068f0: 7474 6163 686d 656e 7420 746f 2074 6865 ttachment to the │ │ │ │ +00106900: 2053 4f41 502f 584d 4c20 6d65 7373 6167 SOAP/XML messag │ │ │ │ +00106910: 652e 3c2f 6469 763e 3c2f 6469 763e 0a3c e.
    .< │ │ │ │ +00106920: 6469 7620 636c 6173 733d 2274 7463 2220 div class="ttc" │ │ │ │ +00106930: 6964 3d22 6167 726f 7570 5f5f 6772 6f75 id="agroup__grou │ │ │ │ +00106940: 705f 5f6d 696d 655f 6874 6d6c 5f67 6138 p__mime_html_ga8 │ │ │ │ +00106950: 3163 6564 6232 3436 3730 6562 6461 3438 1cedb24670ebda48 │ │ │ │ +00106960: 6137 3936 3739 6434 3638 3232 3131 6622 a79679d4682211f" │ │ │ │ +00106970: 3e3c 6469 7620 636c 6173 733d 2274 746e >
    void soap_c │ │ │ │ +00106a00: 6c72 5f6d 696d 6528 7374 7275 6374 2073 lr_mime(struct s │ │ │ │ +00106a10: 6f61 7020 2a73 6f61 7029 3c2f 6469 763e oap *soap)
    │ │ │ │ +00106a20: 3c64 6976 2063 6c61 7373 3d22 7474 646f
    Disable MIME │ │ │ │ +00106a40: 6174 7461 6368 6d65 6e74 732e 3c2f 6469 attachments.
    .
    < │ │ │ │ +00106ac0: 6120 6872 6566 3d22 6772 6f75 705f 5f67 a href="group__g │ │ │ │ +00106ad0: 726f 7570 5f5f 6d69 6d65 2e68 746d 6c23 roup__mime.html# │ │ │ │ +00106ae0: 6761 3931 3830 6535 6261 3633 3462 3230 ga9180e5ba634b20 │ │ │ │ +00106af0: 3330 3562 3735 3562 3431 3030 3435 6439 305b755b410045d9 │ │ │ │ +00106b00: 6565 223e 736f 6170 5f73 6574 5f6d 696d ee">soap_set_mim │ │ │ │ +00106b10: 653c 2f61 3e3c 2f64 6976 3e3c 6469 7620 e
    i │ │ │ │ +00106b30: 6e74 2073 6f61 705f 7365 745f 6d69 6d65 nt soap_set_mime │ │ │ │ +00106b40: 2873 7472 7563 7420 736f 6170 202a 736f (struct soap *so │ │ │ │ +00106b50: 6170 2c20 636f 6e73 7420 6368 6172 202a ap, const char * │ │ │ │ +00106b60: 626f 756e 6461 7279 2c20 636f 6e73 7420 boundary, const │ │ │ │ +00106b70: 6368 6172 202a 7374 6172 7429 3c2f 6469 char *start)
    Enable MIME │ │ │ │ +00106ba0: 2061 7474 6163 686d 656e 7473 2e3c 2f64 attachments.
    .
    SOAP_MI │ │ │ │ +00106cb0: 4d45 5f42 4153 4536 343c 2f61 3e3c 2f64 ME_BASE64
    @ SOAP_MI │ │ │ │ +00106ce0: 4d45 5f42 4153 4536 343c 2f64 6976 3e3c ME_BASE64
    < │ │ │ │ +00106cf0: 6469 7620 636c 6173 733d 2274 7464 6f63 div class="ttdoc │ │ │ │ +00106d00: 223e 6461 7461 2069 7320 666f 726d 6174 ">data is format │ │ │ │ +00106d10: 7465 6420 696e 2062 6173 6536 343c 2f64 ted in base64
    Definit │ │ │ │ +00106d40: 696f 6e3a 3c2f 623e 2073 7464 736f 6170 ion: stdsoap │ │ │ │ +00106d50: 322e 683a 3130 3232 393c 2f64 6976 3e3c 2.h:10229
    < │ │ │ │ +00106d60: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    < │ │ │ │ +00106e70: 6469 7620 636c 6173 733d 2274 7464 6563 div class="ttdec │ │ │ │ +00106e80: 6922 3e40 2053 4f41 505f 4d49 4d45 5f42 i">@ SOAP_MIME_B │ │ │ │ +00106e90: 494e 4152 593c 2f64 6976 3e3c 6469 7620 INARY
    bi │ │ │ │ +00106eb0: 6e61 7279 2072 6177 2064 6174 6120 636f nary raw data co │ │ │ │ +00106ec0: 6e74 656e 743c 2f64 6976 3e3c 6469 7620 ntent
    Definition: │ │ │ │ +00106ef0: 2073 7464 736f 6170 322e 683a 3130 3232 stdsoap2.h:1022 │ │ │ │ +00106f00: 373c 2f64 6976 3e3c 2f64 6976 3e0a 3c2f 7
    .

    The claim__form struct is d │ │ │ │ +00106f50: 6563 6c61 7265 6420 696e 2074 6865 2069 eclared in the i │ │ │ │ +00106f60: 6e74 6572 6661 6365 2068 6561 6465 7220 nterface header │ │ │ │ +00106f70: 6669 6c65 2061 733a 3c2f 703e 0a3c 6469 file as:

    .
    struc │ │ │ │ +00106fc0: 7420 3c2f 7370 616e 3e63 6c61 696d 5f5f t claim__ │ │ │ │ +00106fd0: 666f 726d 203c 2f64 6976 3e0a 3c64 6976 form
    .
    {< │ │ │ │ +00106ff0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    @ char *href;
    . │ │ │ │ +00107040: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    };
    .

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

    .< │ │ │ │ +00107d30: 6832 3e3c 6120 636c 6173 733d 2261 6e63 h2>.Retr │ │ │ │ +00107d60: 6965 7669 6e67 2061 2063 6f6c 6c65 6374 ieving a collect │ │ │ │ +00107d70: 696f 6e20 6f66 204d 494d 452f 4d54 4f4d ion of MIME/MTOM │ │ │ │ +00107d80: 2061 7474 6163 686d 656e 7473 2028 5377 attachments (Sw │ │ │ │ +00107d90: 4129 3c2f 6832 3e0a 3c70 3e4d 494d 4520 A)

    .

    MIME │ │ │ │ +00107da0: 6174 7461 6368 6d65 6e74 7320 6172 6520 attachments are │ │ │ │ +00107db0: 6175 746f 6d61 7469 6361 6c6c 7920 7061 automatically pa │ │ │ │ +00107dc0: 7273 6564 2061 6e64 2073 746f 7265 6420 rsed and stored │ │ │ │ +00107dd0: 696e 206d 656d 6f72 7920 6d61 6e61 6765 in memory manage │ │ │ │ +00107de0: 6420 6279 2074 6865 203c 636f 6465 3e3c d by the < │ │ │ │ +00107df0: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ +00107e00: 663d 2273 7472 7563 7473 6f61 702e 6874 f="structsoap.ht │ │ │ │ +00107e10: 6d6c 2220 7469 746c 653d 2243 6f6e 7465 ml" title="Conte │ │ │ │ +00107e20: 7874 2077 6974 6820 7468 6520 656e 6769 xt with the engi │ │ │ │ +00107e30: 6e65 2073 7461 7465 2e22 3e73 6f61 703c ne state.">soap< │ │ │ │ +00107e40: 2f61 3e3c 2f63 6f64 653e 2063 6f6e 7465 /a> conte │ │ │ │ +00107e50: 7874 2e20 4166 7465 7220 7265 6365 6976 xt. After receiv │ │ │ │ +00107e60: 696e 6720 6120 7365 7420 6f66 204d 494d ing a set of MIM │ │ │ │ +00107e70: 452f 4d54 4f4d 2061 7474 6163 686d 656e E/MTOM attachmen │ │ │ │ +00107e80: 7473 2c20 6569 7468 6572 2061 7420 7468 ts, either at th │ │ │ │ +00107e90: 6520 636c 6965 6e74 2d73 6964 6520 6f72 e client-side or │ │ │ │ +00107ea0: 2074 6865 2073 6572 7665 722d 7369 6465 the server-side │ │ │ │ +00107eb0: 2c20 7468 6520 6c69 7374 206f 6620 4d49 , the list of MI │ │ │ │ +00107ec0: 4d45 2f4d 544f 4d20 6174 7461 6368 6d65 ME/MTOM attachme │ │ │ │ +00107ed0: 6e74 7320 6361 6e20 6265 2074 7261 7665 nts can be trave │ │ │ │ +00107ee0: 7273 6564 2074 6f20 6578 7472 6163 7420 rsed to extract │ │ │ │ +00107ef0: 6d65 7461 2064 6174 6120 616e 6420 7468 meta data and th │ │ │ │ +00107f00: 6520 6174 7461 6368 6d65 6e74 2063 6f6e e attachment con │ │ │ │ +00107f10: 7465 6e74 2e20 5468 6520 6669 7273 7420 tent. The first │ │ │ │ +00107f20: 6174 7461 6368 6d65 6e74 2069 6e20 7468 attachment in th │ │ │ │ +00107f30: 6520 636f 6c6c 6563 7469 6f6e 206f 6620 e collection of │ │ │ │ +00107f40: 4d49 4d45 2f4d 544f 4d20 6174 7461 6368 MIME/MTOM attach │ │ │ │ +00107f50: 6d65 6e74 7320 616c 7761 7973 2063 6f6e ments always con │ │ │ │ +00107f60: 7461 696e 7320 6d65 7461 2064 6174 6120 tains meta data │ │ │ │ +00107f70: 6162 6f75 7420 7468 6520 534f 4150 206d about the SOAP m │ │ │ │ +00107f80: 6573 7361 6765 2069 7473 656c 6620 2862 essage itself (b │ │ │ │ +00107f90: 6563 6175 7365 2074 6865 2053 4f41 5020 ecause the SOAP │ │ │ │ +00107fa0: 6d65 7373 6167 6520 7761 7320 7072 6f63 message was proc │ │ │ │ +00107fb0: 6573 7365 6420 7468 6520 6174 7461 6368 essed the attach │ │ │ │ +00107fc0: 6d65 6e74 2064 6f65 7320 6e6f 7420 636f ment does not co │ │ │ │ +00107fd0: 6e74 6169 6e20 616e 7920 7573 6566 756c ntain any useful │ │ │ │ +00107fe0: 2064 6174 6129 2e3c 2f70 3e0a 3c70 3e54 data).

    .

    T │ │ │ │ +00107ff0: 6f20 7472 6176 6572 7365 2074 6865 206c o traverse the l │ │ │ │ +00108000: 6973 7420 6f66 204d 494d 4520 6174 7461 ist of MIME atta │ │ │ │ +00108010: 6368 6d65 6e74 7320 696e 2043 2c20 796f chments in C, yo │ │ │ │ +00108020: 7520 7573 6520 6120 6c6f 6f70 2073 696d u use a loop sim │ │ │ │ +00108030: 696c 6172 2074 6f3a 3c2f 703e 0a3c 6469 ilar to:

    .
    i │ │ │ │ +00108080: 6e74 3c2f 7370 616e 3e20 6e20 3d20 303b nt n = 0; │ │ │ │ +00108090: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    s │ │ │ │ +001080c0: 7472 7563 7420 3c2f 7370 616e 3e3c 6120 truct s │ │ │ │ +00108100: 6f61 705f 6d75 6c74 6970 6172 743c 2f61 oap_multipart *attachment;.
    for (att │ │ │ │ +00108160: 6163 686d 656e 7420 3d20 3c61 2063 6c61 achment = soap->mime. │ │ │ │ +001081f0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 l │ │ │ │ +00108240: 6973 743c 2f61 3e3b 2061 7474 6163 686d ist; attachm │ │ │ │ +00108250: 656e 743b 2061 7474 6163 686d 656e 7420 ent; attachment │ │ │ │ +00108260: 3d20 6174 7461 6368 6d65 6e74 2d26 6774 = attachment-> │ │ │ │ +00108270: 3b3c 6120 636c 6173 733d 2263 6f64 6522 ;next).
    {
    .< │ │ │ │ +001082f0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00108300: 3e20 202b 2b6e 3b3c 2f64 6976 3e0a 3c64 > ++n;
    . │ │ │ │ +00108320: 2020 7072 696e 7466 283c 7370 616e 2063 printf("Part │ │ │ │ +00108350: 2564 3a5c 6e26 7175 6f74 3b3c 2f73 7061 %d:\n", n);
    . │ │ │ │ +00108380: 2020 7072 696e 7466 283c 7370 616e 2063 printf("ptr │ │ │ │ +001083b0: 2020 2020 2020 3d25 705c 6e26 7175 6f74 =%p\n" │ │ │ │ +001083c0: 3b3c 2f73 7061 6e3e 2c20 6174 7461 6368 ;, attach │ │ │ │ +001083d0: 6d65 6e74 2d26 6774 3b3c 6120 636c 6173 ment->ptr │ │ │ │ +00108430: 3c2f 613e 293b 3c2f 6469 763e 0a3c 6469 );
    . │ │ │ │ +00108450: 2070 7269 6e74 6628 3c73 7061 6e20 636c printf("size │ │ │ │ +00108480: 2020 2020 203d 2575 6c5c 6e26 7175 6f74 =%ul\n" │ │ │ │ +00108490: 3b3c 2f73 7061 6e3e 2c20 6174 7461 6368 ;, attach │ │ │ │ +001084a0: 6d65 6e74 2d26 6774 3b3c 6120 636c 6173 ment->siz │ │ │ │ +00108500: 653c 2f61 3e29 3b3c 2f64 6976 3e0a 3c64 e);
    . │ │ │ │ +00108520: 2020 7072 696e 7466 283c 7370 616e 2063 printf("id │ │ │ │ +00108550: 2020 2020 2020 3d25 735c 6e26 7175 6f74 =%s\n" │ │ │ │ +00108560: 3b3c 2f73 7061 6e3e 2c20 6174 7461 6368 ;, attach │ │ │ │ +00108570: 6d65 6e74 2d26 6774 3b3c 6120 636c 6173 ment->id< │ │ │ │ +001085d0: 2f61 3e20 3f20 6174 7461 6368 6d65 6e74 /a> ? attachment │ │ │ │ +001085e0: 2d26 6774 3b3c 6120 636c 6173 733d 2263 ->id │ │ │ │ +00108640: 3a20 3c73 7061 6e20 636c 6173 733d 2273 : &q │ │ │ │ +00108660: 756f 743b 2671 756f 743b 3c2f 7370 616e uot;");
    .
    pr │ │ │ │ +00108690: 696e 7466 283c 7370 616e 2063 6c61 7373 intf("type │ │ │ │ +001086c0: 2020 3d25 735c 6e26 7175 6f74 3b3c 2f73 =%s\n", attachment │ │ │ │ +001086e0: 2d26 6774 3b3c 6120 636c 6173 733d 2263 ->type ? attachment-& │ │ │ │ +00108750: 6774 3b3c 6120 636c 6173 733d 2263 6f64 gt;type │ │ │ │ +001087b0: 3a20 3c73 7061 6e20 636c 6173 733d 2273 : &q │ │ │ │ +001087d0: 756f 743b 2671 756f 743b 3c2f 7370 616e uot;");
    .
    pr │ │ │ │ +00108800: 696e 7466 283c 7370 616e 2063 6c61 7373 intf("location │ │ │ │ +00108830: 2020 3d25 735c 6e26 7175 6f74 3b3c 2f73 =%s\n", attachment │ │ │ │ +00108850: 2d26 6774 3b3c 6120 636c 6173 733d 2263 ->locatio │ │ │ │ +001088b0: 6e3c 2f61 3e20 3f20 6174 7461 6368 6d65 n ? attachme │ │ │ │ +001088c0: 6e74 2d26 6774 3b3c 6120 636c 6173 733d nt->locat │ │ │ │ +00108920: 696f 6e3c 2f61 3e20 3a20 3c73 7061 6e20 ion : "&quo │ │ │ │ +00108950: 743b 3c2f 7370 616e 3e29 3b3c 2f64 6976 t;);
    .
    printf("d │ │ │ │ +001089a0: 6573 6372 6970 7469 6f6e 3d25 735c 6e26 escription=%s\n& │ │ │ │ +001089b0: 7175 6f74 3b3c 2f73 7061 6e3e 2c20 6174 quot;, at │ │ │ │ +001089c0: 7461 6368 6d65 6e74 2d26 6774 3b3c 6120 tachment->description │ │ │ │ +00108a30: 203f 2061 7474 6163 686d 656e 742d 2667 ? attachment-&g │ │ │ │ +00108a40: 743b 3c61 2063 6c61 7373 3d22 636f 6465 t;descriptio │ │ │ │ +00108aa0: 6e3c 2f61 3e20 3a20 3c73 7061 6e20 636c n : "" │ │ │ │ +00108ad0: 3c2f 7370 616e 3e29 3b3c 2f64 6976 3e0a );
    . │ │ │ │ +00108ae0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    }
    ..DIME/MIME/MTOM │ │ │ │ +00108d10: 6174 7461 6368 6d65 6e74 2064 6174 6120 attachment data │ │ │ │ +00108d20: 7265 6365 6976 6564 2062 7920 7468 6520 received by the │ │ │ │ +00108d30: 656e 6769 6e65 2e3c 2f64 6976 3e3c 6469 engine.
    │ │ │ │ +00108d50: 3c62 3e44 6566 696e 6974 696f 6e3a 3c2f Definition: stdsoap2.h:10 │ │ │ │ +00108d70: 3433 303c 2f64 6976 3e3c 2f64 6976 3e0a 430
    . │ │ │ │ +00108d80: 3c64 6976 2063 6c61 7373 3d22 7474 6322
    DIME/ │ │ │ │ +00108e90: 4d49 4d45 2f4d 544f 4d20 7479 7065 2028 MIME/MTOM type ( │ │ │ │ +00108ea0: 4d49 4d45 2074 7970 6520 666f 726d 6174 MIME type format │ │ │ │ +00108eb0: 293c 2f64 6976 3e3c 6469 7620 636c 6173 )
    Def │ │ │ │ +00108ed0: 696e 6974 696f 6e3a 3c2f 623e 2073 7464 inition: std │ │ │ │ +00108ee0: 736f 6170 322e 683a 3130 3433 353c 2f64 soap2.h:10435
    .
    struc │ │ │ │ +00108fe0: 7420 736f 6170 5f6d 756c 7469 7061 7274 t soap_multipart │ │ │ │ +00108ff0: 202a 206e 6578 743c 2f64 6976 3e3c 6469 * next
    │ │ │ │ +00109010: 6e65 7874 2061 7474 6163 686d 656e 7420 next attachment │ │ │ │ +00109020: 696e 2074 6865 206c 696e 6b65 6420 6c69 in the linked li │ │ │ │ +00109030: 7374 3c2f 6469 763e 3c64 6976 2063 6c61 st
    De │ │ │ │ +00109050: 6669 6e69 7469 6f6e 3a3c 2f62 3e20 7374 finition: st │ │ │ │ +00109060: 6473 6f61 7032 2e68 3a31 3034 3331 3c2f dsoap2.h:10431
    .
    < │ │ │ │ +001090d0: 6469 7620 636c 6173 733d 2274 746e 616d div class="ttnam │ │ │ │ +001090e0: 6522 3e3c 6120 6872 6566 3d22 7374 7275 e">soap_m │ │ │ │ +00109130: 756c 7469 7061 7274 3a3a 7074 723c 2f61 ultipart::ptr
    const │ │ │ │ +00109160: 2063 6861 7220 2a20 7074 723c 2f64 6976 char * ptr
    points to ra │ │ │ │ +00109190: 7720 6461 7461 2063 6f6e 7465 6e74 3c2f w data content
    Defini │ │ │ │ +001091c0: 7469 6f6e 3a3c 2f62 3e20 7374 6473 6f61 tion: stdsoa │ │ │ │ +001091d0: 7032 2e68 3a31 3034 3332 3c2f 6469 763e p2.h:10432
    │ │ │ │ +001091e0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    < │ │ │ │ +00109250: 6120 6872 6566 3d22 7374 7275 6374 736f a href="structso │ │ │ │ +00109260: 6170 5f5f 6d75 6c74 6970 6172 742e 6874 ap__multipart.ht │ │ │ │ +00109270: 6d6c 2361 6235 3237 6336 6536 6363 6537 ml#ab527c6e6cce7 │ │ │ │ +00109280: 3834 6336 3861 3562 6439 6262 3830 3834 84c68a5bd9bb8084 │ │ │ │ +00109290: 3563 6134 223e 736f 6170 5f6d 756c 7469 5ca4">soap_multi │ │ │ │ +001092a0: 7061 7274 3a3a 6465 7363 7269 7074 696f part::descriptio │ │ │ │ +001092b0: 6e3c 2f61 3e3c 2f64 6976 3e3c 6469 7620 n
    c │ │ │ │ +001092d0: 6f6e 7374 2063 6861 7220 2a20 6465 7363 onst char * desc │ │ │ │ +001092e0: 7269 7074 696f 6e3c 2f64 6976 3e3c 6469 ription
    │ │ │ │ +00109300: 4d49 4d45 2043 6f6e 7465 6e74 2d44 6573 MIME Content-Des │ │ │ │ +00109310: 6372 6970 7469 6f6e 2028 6f70 7469 6f6e cription (option │ │ │ │ +00109320: 616c 293c 2f64 6976 3e3c 6469 7620 636c al)
    D │ │ │ │ +00109340: 6566 696e 6974 696f 6e3a 3c2f 623e 2073 efinition: s │ │ │ │ +00109350: 7464 736f 6170 322e 683a 3130 3433 393c tdsoap2.h:10439< │ │ │ │ +00109360: 2f64 6976 3e3c 2f64 6976 3e0a 3c64 6976 /div>
    .
    │ │ │ │ +001093c0: 3c64 6976 2063 6c61 7373 3d22 7474 6e61
    const │ │ │ │ +00109450: 2063 6861 7220 2a20 6964 3c2f 6469 763e char * id
    │ │ │ │ +00109460: 3c64 6976 2063 6c61 7373 3d22 7474 646f
    DIME/MIME/MTO │ │ │ │ +00109480: 4d20 636f 6e74 656e 7420 4944 206f 7220 M content ID or │ │ │ │ +00109490: 666f 726d 2064 6174 6120 6e61 6d65 2e3c form data name.< │ │ │ │ +001094a0: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
    Defin │ │ │ │ +001094c0: 6974 696f 6e3a 3c2f 623e 2073 7464 736f ition: stdso │ │ │ │ +001094d0: 6170 322e 683a 3130 3433 343c 2f64 6976 ap2.h:10434
    .
    .
    size_t size │ │ │ │ +00109750: 3c2f 6469 763e 3c64 6976 2063 6c61 7373
    size of │ │ │ │ +00109770: 2064 6174 6120 636f 6e74 656e 743c 2f64 data content
    Definit │ │ │ │ +001097a0: 696f 6e3a 3c2f 623e 2073 7464 736f 6170 ion: stdsoap │ │ │ │ +001097b0: 322e 683a 3130 3433 333c 2f64 6976 3e3c 2.h:10433
    < │ │ │ │ +001097c0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    < │ │ │ │ +00109810: 6469 7620 636c 6173 733d 2274 746e 616d div class="ttnam │ │ │ │ +00109820: 6522 3e3c 6120 6872 6566 3d22 7374 7275 e">s │ │ │ │ +00109860: 6f61 703a 3a6d 696d 653c 2f61 3e3c 2f64 oap::mime
    struct so │ │ │ │ +00109890: 6170 5f6d 696d 6520 6d69 6d65 3c2f 6469 ap_mime mime
    MIME attach │ │ │ │ +001098c0: 6d65 6e74 7320 7265 6365 6976 6564 2e3c ments received.< │ │ │ │ +001098d0: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
    Defin │ │ │ │ +001098f0: 6974 696f 6e3a 3c2f 623e 2073 7464 736f ition: stdso │ │ │ │ +00109900: 6170 322e 683a 3431 3839 3c2f 6469 763e ap2.h:4189
    │ │ │ │ +00109910: 3c2f 6469 763e 0a3c 2f64 6976 3e3c 212d
    .

    C++ programmers │ │ │ │ +00109940: 2063 616e 2075 7365 2061 6e20 6974 6572 can use an iter │ │ │ │ +00109950: 6174 6f72 2069 6e73 7465 6164 3a3c 2f70 ator instead:

    .
    int n │ │ │ │ +001099b0: 203d 2030 3b3c 2f64 6976 3e0a 3c64 6976 = 0;
    .
    for (soap_mul │ │ │ │ +00109a50: 7469 7061 7274 3a3a 6974 6572 6174 6f72 tipart::iterator │ │ │ │ +00109a60: 3c2f 613e 2069 203d 203c 6120 636c 6173 i = │ │ │ │ +00109a90: 736f 6170 3c2f 613e 2d26 6774 3b3c 6120 soap->mime.< │ │ │ │ +00109af0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +00109b00: 7265 663d 2273 7472 7563 7473 6f61 705f ref="structsoap_ │ │ │ │ +00109b10: 5f6d 696d 652e 6874 6d6c 2361 6539 3966 _mime.html#ae99f │ │ │ │ +00109b20: 6131 3963 3564 3234 3035 3161 3439 3562 a19c5d24051a495b │ │ │ │ +00109b30: 3739 6130 3234 6133 6635 6639 223e 6265 79a024a3f5f9">be │ │ │ │ +00109b40: 6769 6e3c 2f61 3e28 293b 2069 2021 3d20 gin(); i != │ │ │ │ +00109b50: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap- │ │ │ │ +00109b80: 2667 743b 3c61 2063 6c61 7373 3d22 636f >mim │ │ │ │ +00109bd0: 653c 2f61 3e2e 3c61 2063 6c61 7373 3d22 e.end(); │ │ │ │ +00109c30: 2b2b 6929 3c2f 6469 763e 0a3c 6469 7620 ++i)
    .
    {.
    ++n;.
    printf(< │ │ │ │ +00109c90: 7370 616e 2063 6c61 7373 3d22 7374 7269 span class="stri │ │ │ │ +00109ca0: 6e67 6c69 7465 7261 6c22 3e26 7175 6f74 ngliteral">" │ │ │ │ +00109cb0: 3b50 6172 7420 2564 3a5c 6e26 7175 6f74 ;Part %d:\n" │ │ │ │ +00109cc0: 3b3c 2f73 7061 6e3e 2c20 6e29 3b3c 2f64 ;, n);.
    printf(< │ │ │ │ +00109cf0: 7370 616e 2063 6c61 7373 3d22 7374 7269 span class="stri │ │ │ │ +00109d00: 6e67 6c69 7465 7261 6c22 3e26 7175 6f74 ngliteral">" │ │ │ │ +00109d10: 3b70 7472 2020 2020 2020 2020 3d25 705c ;ptr =%p\ │ │ │ │ +00109d20: 6e26 7175 6f74 3b3c 2f73 7061 6e3e 2c20 n", │ │ │ │ +00109d30: 692d 2667 743b 7074 7229 3b3c 2f64 6976 i->ptr);
    .
    ... │ │ │ │ +00109d70: 2f2f 2065 7463 3c2f 7370 616e 3e3c 2f64 // etc.
    }
    .soap_mime::be │ │ │ │ +00109e50: 6769 6e3c 2f61 3e3c 2f64 6976 3e3c 6469 gin
    soap_multipart: │ │ │ │ +00109e80: 3a69 7465 7261 746f 7220 6265 6769 6e28 :iterator begin( │ │ │ │ +00109e90: 293c 2f64 6976 3e3c 6469 7620 636c 6173 )
    C++ on │ │ │ │ +00109eb0: 6c79 3a20 616e 2069 7465 7261 746f 7220 ly: an iterator │ │ │ │ +00109ec0: 6f76 6572 2073 6f61 705f 6d75 6c74 6970 over soap_multip │ │ │ │ +00109ed0: 6172 7420 6174 7461 6368 6d65 6e74 732e art attachments. │ │ │ │ +00109ee0: 3c2f 6469 763e 3c2f 6469 763e 0a3c 6469
    .
    │ │ │ │ +00109f50: 3c61 2068 7265 663d 2273 7472 7563 7473 soap_mime::end │ │ │ │ +00109fa0: 3c2f 613e 3c2f 6469 763e 3c64 6976 2063
    so │ │ │ │ +00109fc0: 6170 5f6d 756c 7469 7061 7274 3a3a 6974 ap_multipart::it │ │ │ │ +00109fd0: 6572 6174 6f72 2065 6e64 2829 3c2f 6469 erator end()
    C++ only: a │ │ │ │ +0010a000: 6e20 6974 6572 6174 6f72 206f 7665 7220 n iterator over │ │ │ │ +0010a010: 736f 6170 5f6d 756c 7469 7061 7274 2061 soap_multipart a │ │ │ │ +0010a020: 7474 6163 686d 656e 7473 2e3c 2f64 6976 ttachments.
    .
    soa │ │ │ │ +0010a120: 705f 6d75 6c74 6970 6172 745f 6974 6572 p_multipart_iter │ │ │ │ +0010a130: 6174 6f72 2069 7465 7261 746f 723c 2f64 ator iterator
    C++ only: │ │ │ │ +0010a160: 616e 2069 7465 7261 746f 7220 6f76 6572 an iterator over │ │ │ │ +0010a170: 2073 6f61 705f 6d75 6c74 6970 6172 7420 soap_multipart │ │ │ │ +0010a180: 6174 7461 6368 6d65 6e74 732e 3c2f 6469 attachments.
    Definiti │ │ │ │ +0010a1b0: 6f6e 3a3c 2f62 3e20 7374 6473 6f61 7032 on: stdsoap2 │ │ │ │ +0010a1c0: 2e68 3a31 3034 3431 3c2f 6469 763e 3c2f .h:10441
    .

    N │ │ │ │ +0010a1f0: 6f74 653a 206b 6565 7020 696e 206d 696e ote: keep in min │ │ │ │ +0010a200: 6420 7468 6174 2074 6865 2066 6972 7374 d that the first │ │ │ │ +0010a210: 2061 7474 6163 686d 656e 7420 6973 2061 attachment is a │ │ │ │ +0010a220: 7373 6f63 6961 7465 6420 7769 7468 2074 ssociated with t │ │ │ │ +0010a230: 6865 2053 4f41 5020 6d65 7373 6167 6520 he SOAP message │ │ │ │ +0010a240: 616e 6420 796f 7520 6d61 7920 7761 6e74 and you may want │ │ │ │ +0010a250: 2074 6f20 6967 6e6f 7265 2069 742e 3c2f to ignore it..

    A call to │ │ │ │ +0010a270: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 soap_e │ │ │ │ +0010a340: 6e64 3c2f 613e 3c2f 636f 6465 3e20 7265 nd re │ │ │ │ +0010a350: 6d6f 7665 7320 616c 6c20 6f66 2074 6865 moves all of the │ │ │ │ +0010a360: 2072 6563 6569 7665 6420 4d49 4d45 2064 received MIME d │ │ │ │ +0010a370: 6174 612e 2054 6f20 7072 6573 6572 7665 ata. To preserve │ │ │ │ +0010a380: 2061 6e20 6174 7461 6368 6d65 6e74 2069 an attachment i │ │ │ │ +0010a390: 6e20 6d65 6d6f 7279 2c20 7573 6520 3c63 n memory, use soap_unl │ │ │ │ +0010a470: 696e 6b3c 2f61 3e3c 2f63 6f64 653e 206f ink o │ │ │ │ +0010a480: 6e20 7468 6520 3c63 6f64 653e 7074 723c n the ptr< │ │ │ │ +0010a490: 2f63 6f64 653e 206d 656d 6265 7220 6f66 /code> member of │ │ │ │ +0010a4a0: 2074 6865 203c 636f 6465 3e3c 6120 636c the soap_m │ │ │ │ +0010a520: 756c 7469 7061 7274 3c2f 613e 3c2f 636f ultipart struct. The │ │ │ │ +0010a540: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 soap_u │ │ │ │ +0010a610: 6e6c 696e 6b3c 2f61 3e3c 2f63 6f64 653e nlink │ │ │ │ +0010a620: 2066 756e 6374 696f 6e20 6361 6e20 6265 function can be │ │ │ │ +0010a630: 2075 7365 6420 746f 2070 7265 7665 6e74 used to prevent │ │ │ │ +0010a640: 2064 6561 6c6c 6f63 6174 696f 6e20 6f66 deallocation of │ │ │ │ +0010a650: 2064 6573 6572 6961 6c69 7a65 6420 6461 deserialized da │ │ │ │ +0010a660: 7461 2e3c 2f70 3e0a 3c70 3ef0 9f94 9d20 ta.

    .

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

    ..DIME attachme │ │ │ │ +0010a6d0: 6e74 733c 2f68 313e 0a3c 703e 4170 706c nts.

    Appl │ │ │ │ +0010a6e0: 6963 6174 696f 6e73 2064 6576 656c 6f70 ications develop │ │ │ │ +0010a6f0: 6564 2077 6974 6820 7468 6520 6753 4f41 ed with the gSOA │ │ │ │ +0010a700: 5020 746f 6f6c 7320 6361 6e20 7472 616e P tools can tran │ │ │ │ +0010a710: 736d 6974 2062 696e 6172 7920 4449 4d45 smit binary DIME │ │ │ │ +0010a720: 2061 7474 6163 686d 656e 7473 2073 746f attachments sto │ │ │ │ +0010a730: 7265 6420 696e 206d 656d 6f72 7920 6f72 red in memory or │ │ │ │ +0010a740: 2069 6e20 7374 7265 616d 696e 6720 6d6f in streaming mo │ │ │ │ +0010a750: 6465 2062 7920 6665 7463 6869 6e67 2064 de by fetching d │ │ │ │ +0010a760: 6174 6120 6672 6f6d 2061 2072 6573 6f75 ata from a resou │ │ │ │ +0010a770: 7263 6520 6f72 2073 656e 6469 6e67 2064 rce or sending d │ │ │ │ +0010a780: 6174 6120 746f 2061 2072 6573 6f75 7263 ata to a resourc │ │ │ │ +0010a790: 6520 7573 696e 6720 6361 6c6c 6261 636b e using callback │ │ │ │ +0010a7a0: 2066 756e 6374 696f 6e73 2e20 5468 6520 functions. The │ │ │ │ +0010a7b0: 6d61 7869 6d75 6d20 4449 4d45 2061 7474 maximum DIME att │ │ │ │ +0010a7c0: 6163 686d 656e 7420 7369 7a65 2069 7320 achment size is │ │ │ │ +0010a7d0: 6c69 6d69 7465 6420 746f 2038 204d 4220 limited to 8 MB │ │ │ │ +0010a7e0: 6279 2064 6566 6175 6c74 2061 7320 7365 by default as se │ │ │ │ +0010a7f0: 7420 7769 7468 203c 636f 6465 3e23 534f t with #SO │ │ │ │ +0010a800: 4150 5f4d 4158 4449 4d45 5349 5a45 3c2f AP_MAXDIMESIZE. This limi │ │ │ │ +0010a820: 7420 6361 6e20 6265 2063 6861 6e67 6564 t can be changed │ │ │ │ +0010a830: 2061 7320 6e65 6564 6564 2e20 5769 7468 as needed. With │ │ │ │ +0010a840: 2073 7472 6561 6d69 6e67 2044 494d 4520 streaming DIME │ │ │ │ +0010a850: 7573 696e 6720 6361 6c6c 6261 636b 2066 using callback f │ │ │ │ +0010a860: 756e 6374 696f 6e73 2c20 6461 7461 2068 unctions, data h │ │ │ │ +0010a870: 616e 646c 6572 7320 6172 6520 7573 6564 andlers are used │ │ │ │ +0010a880: 2074 6f20 7061 7373 2074 6865 2064 6174 to pass the dat │ │ │ │ +0010a890: 6120 746f 2061 6e64 2066 726f 6d20 6120 a to and from a │ │ │ │ +0010a8a0: 7265 736f 7572 6365 2066 726f 6d20 7768 resource from wh │ │ │ │ +0010a8b0: 6963 6820 746f 2066 6574 6368 2074 6865 ich to fetch the │ │ │ │ +0010a8c0: 2064 6174 6120 746f 2073 656e 6420 6f72 data to send or │ │ │ │ +0010a8d0: 2064 6174 6120 746f 2073 746f 7265 2c20 data to store, │ │ │ │ +0010a8e0: 7375 6368 2061 7320 6120 6669 6c65 206f such as a file o │ │ │ │ +0010a8f0: 7220 6465 7669 6365 2e20 5365 6520 5365 r device. See Se │ │ │ │ +0010a900: 6374 696f 6e20 3c61 2063 6c61 7373 3d22 ction Streaming DI │ │ │ │ +0010a940: 4d45 3c2f 613e 202e 3c2f 703e 0a3c 703e ME .

    .

    │ │ │ │ +0010a950: 466f 7220 6465 7461 696c 7320 6f6e 2044 For details on D │ │ │ │ +0010a960: 494d 4520 6174 7461 6368 6d65 6e74 732c IME attachments, │ │ │ │ +0010a970: 2073 6565 203c 6120 6872 6566 3d22 6874 see http://msdn.mic │ │ │ │ +0010a9e0: 726f 736f 6674 2e63 6f6d 2f6c 6962 7261 rosoft.com/libra │ │ │ │ +0010a9f0: 7279 2f65 6e2d 7573 2f64 6e67 6c6f 6273 ry/en-us/dnglobs │ │ │ │ +0010aa00: 7065 632f 6874 6d6c 2f64 7261 6674 2d6e pec/html/draft-n │ │ │ │ +0010aa10: 6965 6c73 656e 2d64 696d 652d 3032 2e74 ielsen-dime-02.t │ │ │ │ +0010aa20: 7874 3c2f 613e 3c2f 703e 0a3c 703e 5365 xt

    .

    Se │ │ │ │ +0010aa30: 6520 616c 736f 2041 5049 2064 6f63 756d e also API docum │ │ │ │ +0010aa40: 656e 7461 7469 6f6e 204d 6f64 756c 6520 entation Module │ │ │ │ +0010aa50: 3c61 2063 6c61 7373 3d22 656c 2220 6872 DIM │ │ │ │ +0010aa80: 4520 6174 7461 6368 6d65 6e74 2066 756e E attachment fun │ │ │ │ +0010aa90: 6374 696f 6e73 3c2f 613e 2e3c 2f70 3e0a ctions.

    . │ │ │ │ +0010aaa0: 3c70 3ef0 9f94 9d20 3c61 2068 7265 663d

    .... Back to tabl │ │ │ │ +0010aac0: 6520 6f66 2063 6f6e 7465 6e74 733c 2f61 e of contents

    .

    .Sending a coll │ │ │ │ +0010ab10: 6563 7469 6f6e 206f 6620 4449 4d45 2061 ection of DIME a │ │ │ │ +0010ab20: 7474 6163 686d 656e 7473 3c2f 6832 3e0a ttachments

    . │ │ │ │ +0010ab30: 3c70 3e54 6865 2066 6f6c 6c6f 7769 6e67

    The following │ │ │ │ +0010ab40: 2066 756e 6374 696f 6e73 2063 616e 2062 functions can b │ │ │ │ +0010ab50: 6520 7573 6564 2074 6f20 6578 706c 6963 e used to explic │ │ │ │ +0010ab60: 6974 6c79 2073 6574 2075 7020 6120 636f itly set up a co │ │ │ │ +0010ab70: 6c6c 6563 7469 6f6e 206f 6620 4449 4d45 llection of DIME │ │ │ │ +0010ab80: 2061 7474 6163 686d 656e 7473 2066 6f72 attachments for │ │ │ │ +0010ab90: 2074 7261 6e73 6d69 7373 696f 6e20 7769 transmission wi │ │ │ │ +0010aba0: 7468 2061 206d 6573 7361 6765 2e20 5468 th a message. Th │ │ │ │ +0010abb0: 6573 6520 6174 7461 6368 6d65 6e74 7320 ese attachments │ │ │ │ +0010abc0: 6361 6e20 6265 2073 7472 6561 6d65 642c can be streamed, │ │ │ │ +0010abd0: 2061 7320 6465 7363 7269 6265 6420 696e as described in │ │ │ │ +0010abe0: 2053 6563 7469 6f6e 203c 6120 636c 6173 Section Streaming │ │ │ │ +0010ac20: 2044 494d 453c 2f61 3e20 2e20 5769 7468 DIME . With │ │ │ │ +0010ac30: 6f75 7420 7374 7265 616d 696e 672c 2065 out streaming, e │ │ │ │ +0010ac40: 6163 6820 6174 7461 6368 6d65 6e74 206d ach attachment m │ │ │ │ +0010ac50: 7573 7420 7265 6665 7220 746f 2061 2062 ust refer to a b │ │ │ │ +0010ac60: 6c6f 636b 206f 6620 6461 7461 2069 6e20 lock of data in │ │ │ │ +0010ac70: 6d65 6d6f 7279 2e3c 2f70 3e0a 3c75 6c3e memory.

    .
      │ │ │ │ +0010ac80: 0a3c 6c69 3e3c 636f 6465 3e76 6f69 6420 .
    • void │ │ │ │ +0010ac90: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap_set_dime(s │ │ │ │ +0010ad10: 7472 7563 7420 736f 6170 202a 736f 6170 truct soap *soap │ │ │ │ +0010ad20: 293c 2f61 3e3c 2f63 6f64 653e 2054 6869 ) Thi │ │ │ │ +0010ad30: 7320 6675 6e63 7469 6f6e 2065 6e61 626c s function enabl │ │ │ │ +0010ad40: 6573 2073 656e 6469 6e67 2044 494d 4520 es sending DIME │ │ │ │ +0010ad50: 6174 7461 6368 6d65 6e74 732e 2054 6869 attachments. Thi │ │ │ │ +0010ad60: 7320 6675 6e63 7469 6f6e 2069 7320 6765 s function is ge │ │ │ │ +0010ad70: 6e65 7261 6c6c 7920 6e6f 7420 7265 7175 nerally not requ │ │ │ │ +0010ad80: 6972 6564 2062 6563 6175 7365 2044 494d ired because DIM │ │ │ │ +0010ad90: 4520 6174 7461 6368 6d65 6e74 7320 6172 E attachments ar │ │ │ │ +0010ada0: 6520 6175 746f 6d61 7469 6361 6c6c 7920 e automatically │ │ │ │ +0010adb0: 6465 7465 6374 6564 2061 7320 3c63 6f64 detected as │ │ │ │ +0010ae30: 7873 645f 5f62 6173 6536 3442 696e 6172 xsd__base64Binar │ │ │ │ +0010ae40: 793c 2f61 3e3c 2f63 6f64 653e 2061 6e64 y and │ │ │ │ +0010ae50: 203c 636f 6465 3e3c 6120 636c 6173 733d _xo │ │ │ │ +0010aec0: 705f 5f49 6e63 6c75 6465 3c2f 613e 3c2f p__Include structures │ │ │ │ +0010aee0: 2069 6e20 7468 6520 6461 7461 2074 6f20 in the data to │ │ │ │ +0010aef0: 7365 7269 616c 697a 6520 6173 2061 6e20 serialize as an │ │ │ │ +0010af00: 584d 4c20 6d65 7373 6167 6520 7769 7468 XML message with │ │ │ │ +0010af10: 2074 6865 2061 7474 6163 686d 656e 7473 the attachments │ │ │ │ +0010af20: 2061 7574 6f6d 6174 6963 616c 6c79 2061 automatically a │ │ │ │ +0010af30: 6464 6564 206f 7220 4449 4d45 2061 7474 dded or DIME att │ │ │ │ +0010af40: 6163 686d 656e 7473 2063 616e 2062 6520 achments can be │ │ │ │ +0010af50: 6578 706c 6963 6974 6c79 2061 6464 6564 explicitly added │ │ │ │ +0010af60: 2077 6974 6820 3c63 6f64 653e 3c61 2063 with soap_set_dime │ │ │ │ +0010b000: 5f61 7474 6163 686d 656e 743c 2f61 3e3c _attachment< │ │ │ │ +0010b010: 2f63 6f64 653e 2e3c 2f6c 693e 0a3c 6c69 /code>.
    • .
    • int soap_ │ │ │ │ +0010b030: 7365 745f 6469 6d65 5f61 7474 6163 686d set_dime_attachm │ │ │ │ +0010b040: 656e 7428 7374 7275 6374 2073 6f61 7020 ent(struct soap │ │ │ │ +0010b050: 2a73 6f61 702c 2063 6861 7220 2a70 7472 *soap, char *ptr │ │ │ │ +0010b060: 2c20 7369 7a65 5f74 2073 697a 652c 2063 , size_t size, c │ │ │ │ +0010b070: 6f6e 7374 2063 6861 7220 2a74 7970 652c onst char *type, │ │ │ │ +0010b080: 2063 6f6e 7374 2063 6861 7220 2a69 642c const char *id, │ │ │ │ +0010b090: 2075 6e73 6967 6e65 6420 7368 6f72 7420 unsigned short │ │ │ │ +0010b0a0: 6f70 7479 7065 2c20 636f 6e73 7420 6368 optype, const ch │ │ │ │ +0010b0b0: 6172 202a 6f70 7469 6f6e 293c 2f63 6f64 ar *option) This function │ │ │ │ +0010b0d0: 2061 6464 7320 6120 4449 4d45 2061 7474 adds a DIME att │ │ │ │ +0010b0e0: 6163 686d 656e 7420 746f 2074 6865 2058 achment to the X │ │ │ │ +0010b0f0: 4d4c 206d 6573 7361 6765 2074 6f20 7365 ML message to se │ │ │ │ +0010b100: 6e64 2e20 5468 6520 7370 6563 6966 6965 nd. The specifie │ │ │ │ +0010b110: 6420 3c63 6f64 653e 7074 723c 2f63 6f64 d ptr points to the │ │ │ │ +0010b130: 2064 6174 6120 746f 2073 656e 6420 6f66 data to send of │ │ │ │ +0010b140: 206c 656e 6774 6820 7370 6563 6966 6965 length specifie │ │ │ │ +0010b150: 6420 6279 203c 636f 6465 3e73 697a 653c d by size< │ │ │ │ +0010b160: 2f63 6f64 653e 2e20 5468 6520 3c63 6f64 /code>. The type pa │ │ │ │ +0010b180: 7261 6d65 7465 7220 696e 6469 6361 7465 rameter indicate │ │ │ │ +0010b190: 7320 7468 6520 4d49 4d45 2074 7970 6520 s the MIME type │ │ │ │ +0010b1a0: 6f66 2074 6865 2064 6174 6120 6f72 2063 of the data or c │ │ │ │ +0010b1b0: 616e 2062 6520 4e55 4c4c 2e20 5468 6520 an be NULL. The │ │ │ │ +0010b1c0: 3c63 6f64 653e 6964 3c2f 636f 6465 3e20 id │ │ │ │ +0010b1d0: 7061 7261 6d65 7465 7220 756e 6971 7565 parameter unique │ │ │ │ +0010b1e0: 6c79 2069 6465 6e74 6966 6965 7320 7468 ly identifies th │ │ │ │ +0010b1f0: 6520 6174 7461 6368 6d65 6e74 2069 6e20 e attachment in │ │ │ │ +0010b200: 7468 6520 6d65 7373 6167 652c 2077 6869 the message, whi │ │ │ │ +0010b210: 6368 2063 616e 2062 6520 6f6d 6974 7465 ch can be omitte │ │ │ │ +0010b220: 6420 6279 2073 7065 6369 6679 696e 6720 d by specifying │ │ │ │ +0010b230: 4e55 4c4c 2e20 5468 6520 3c63 6f64 653e NULL. The │ │ │ │ +0010b240: 6f70 7469 6f6e 3c2f 636f 6465 3e20 7061 option pa │ │ │ │ +0010b250: 7261 6d65 7465 7220 6973 2061 6e20 6f70 rameter is an op │ │ │ │ +0010b260: 7469 6f6e 2073 7563 6820 6173 2061 2064 tion such as a d │ │ │ │ +0010b270: 6573 6372 6970 7469 6f6e 206f 6620 7468 escription of th │ │ │ │ +0010b280: 6520 6461 7461 2061 6e64 203c 636f 6465 e data and optype i │ │ │ │ +0010b2a0: 7320 6120 7573 6572 2d64 6566 696e 6564 s a user-defined │ │ │ │ +0010b2b0: 206f 7074 696f 6e20 7479 7065 2028 6173 option type (as │ │ │ │ +0010b2c0: 2070 6572 2044 494d 4520 6f70 7469 6f6e per DIME option │ │ │ │ +0010b2d0: 2073 7065 6369 6669 6361 7469 6f6e 2066 specification f │ │ │ │ +0010b2e0: 6f72 6d61 7429 2e20 5468 6520 3c63 6f64 ormat). The ptr par │ │ │ │ +0010b300: 616d 6574 6572 206d 7573 7420 6265 2070 ameter must be p │ │ │ │ +0010b310: 6572 7369 7374 656e 742e 2054 6865 203c ersistent. The < │ │ │ │ +0010b320: 636f 6465 3e70 7472 3c2f 636f 6465 3e20 code>ptr │ │ │ │ +0010b330: 7061 7261 6d65 7465 7220 7061 7373 6564 parameter passed │ │ │ │ +0010b340: 2074 6f20 7468 6973 2066 756e 6374 696f to this functio │ │ │ │ +0010b350: 6e20 6d75 7374 2062 6520 7065 7273 6973 n must be persis │ │ │ │ +0010b360: 7465 6e74 2069 6e20 6d65 6d6f 7279 2075 tent in memory u │ │ │ │ +0010b370: 6e74 696c 2074 6865 2061 7474 6163 686d ntil the attachm │ │ │ │ +0010b380: 656e 7420 7761 7320 7365 6e74 2e20 5265 ent was sent. Re │ │ │ │ +0010b390: 7475 726e 7320 3c63 6f64 653e 2353 4f41 turns #SOA │ │ │ │ +0010b3a0: 505f 4f4b 3c2f 636f 6465 3e20 6f72 2061 P_OK or a │ │ │ │ +0010b3b0: 203c 636f 6465 3e3c 6120 636c 6173 733d soap_sta │ │ │ │ +0010b470: 7475 733c 2f61 3e3c 2f63 6f64 653e 2065 tus e │ │ │ │ +0010b480: 7272 6f72 2063 6f64 652e 3c2f 6c69 3e0a rror code.
    • . │ │ │ │ +0010b490: 3c6c 693e 3c63 6f64 653e 766f 6964 203c
    • void < │ │ │ │ +0010b4a0: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ +0010b4b0: 663d 2267 726f 7570 5f5f 6772 6f75 705f f="group__group_ │ │ │ │ +0010b4c0: 5f64 696d 652e 6874 6d6c 2367 6137 6633 _dime.html#ga7f3 │ │ │ │ +0010b4d0: 3139 3137 3062 6139 3530 6334 6234 3032 19170ba950c4b402 │ │ │ │ +0010b4e0: 3563 3563 3137 3339 6132 3666 6322 2074 5c5c1739a26fc" t │ │ │ │ +0010b4f0: 6974 6c65 3d22 4469 7361 626c 6520 4449 itle="Disable DI │ │ │ │ +0010b500: 4d45 2061 7474 6163 686d 656e 7473 2e22 ME attachments." │ │ │ │ +0010b510: 3e73 6f61 705f 636c 725f 6469 6d65 2873 >soap_clr_dime(s │ │ │ │ +0010b520: 7472 7563 7420 736f 6170 202a 736f 6170 truct soap *soap │ │ │ │ +0010b530: 293c 2f61 3e3c 2f63 6f64 653e 2054 6869 ) Thi │ │ │ │ +0010b540: 7320 6675 6e63 7469 6f6e 2064 6973 6162 s function disab │ │ │ │ +0010b550: 6c65 7320 4449 4d45 2061 7474 6163 686d les DIME attachm │ │ │ │ +0010b560: 656e 7473 2c20 756e 6c65 7373 2074 6865 ents, unless the │ │ │ │ +0010b570: 2064 6174 6120 746f 2073 6572 6961 6c69 data to seriali │ │ │ │ +0010b580: 7a65 2061 7320 616e 2058 4d4c 206d 6573 ze as an XML mes │ │ │ │ +0010b590: 7361 6765 2063 6f6e 7461 696e 7320 6174 sage contains at │ │ │ │ +0010b5a0: 7461 6368 6d65 6e74 7320 6465 6669 6e65 tachments define │ │ │ │ +0010b5b0: 6420 6279 203c 636f 6465 3e3c 6120 636c d by xsd__ba │ │ │ │ +0010b630: 7365 3634 4269 6e61 7279 3c2f 613e 3c2f se64Binary and │ │ │ │ +0010b650: 3c61 2063 6c61 7373 3d22 656c 2220 6872 _xop__Incl │ │ │ │ +0010b6c0: 7564 653c 2f61 3e3c 2f63 6f64 653e 2073 ude s │ │ │ │ +0010b6d0: 7472 7563 7475 7265 732e 3c2f 6c69 3e0a tructures.
    • . │ │ │ │ +0010b6e0: 3c2f 756c 3e0a 3c70 3e54 6865 7365 2066
    .

    These f │ │ │ │ +0010b6f0: 756e 6374 696f 6e73 2061 6c6c 6f77 2044 unctions allow D │ │ │ │ +0010b700: 494d 4520 6174 7461 6368 6d65 6e74 7320 IME attachments │ │ │ │ +0010b710: 746f 2062 6520 6164 6465 6420 746f 2053 to be added to S │ │ │ │ +0010b720: 4f41 5020 6d65 7373 6167 6573 2077 6974 OAP messages wit │ │ │ │ +0010b730: 686f 7574 2072 6571 7569 7269 6e67 206d hout requiring m │ │ │ │ +0010b740: 6573 7361 6765 2062 6f64 7920 7265 6665 essage body refe │ │ │ │ +0010b750: 7265 6e63 6573 2e20 5468 6973 2069 7320 rences. This is │ │ │ │ +0010b760: 616c 736f 2072 6566 6572 7265 6420 746f also referred to │ │ │ │ +0010b770: 2061 7320 7468 6520 6f70 656e 2044 494d as the open DIM │ │ │ │ +0010b780: 4520 6174 7461 6368 6d65 6e74 2073 7479 E attachment sty │ │ │ │ +0010b790: 6c65 2e20 5468 6520 636c 6f73 6564 2061 le. The closed a │ │ │ │ +0010b7a0: 7474 6163 686d 656e 7420 7374 796c 6520 ttachment style │ │ │ │ +0010b7b0: 7265 7175 6972 6573 2061 6c6c 2044 494d requires all DIM │ │ │ │ +0010b7c0: 4520 6174 7461 6368 6d65 6e74 7320 746f E attachments to │ │ │ │ +0010b7d0: 2062 6520 7265 6665 7265 6e63 6564 2066 be referenced f │ │ │ │ +0010b7e0: 726f 6d20 7468 6520 534f 4150 206d 6573 rom the SOAP mes │ │ │ │ +0010b7f0: 7361 6765 2062 6f64 7920 7769 7468 203c sage body with < │ │ │ │ +0010b800: 656d 3e3c 636f 6465 3e68 7265 663c 2f63 em>href (or si │ │ │ │ +0010b820: 6d69 6c61 7229 2072 6566 6572 656e 6365 milar) reference │ │ │ │ +0010b830: 732e 2046 6f72 2074 6865 2063 6c6f 7365 s. For the close │ │ │ │ +0010b840: 6420 7374 796c 652c 2067 534f 4150 2073 d style, gSOAP s │ │ │ │ +0010b850: 7570 706f 7274 7320 616e 2061 7574 6f6d upports an autom │ │ │ │ +0010b860: 6174 6963 2062 696e 6172 7920 6461 7461 atic binary data │ │ │ │ +0010b870: 2073 6572 6961 6c69 7a61 7469 6f6e 206d serialization m │ │ │ │ +0010b880: 6574 686f 642c 2073 6565 2053 6563 7469 ethod, see Secti │ │ │ │ +0010b890: 6f6e 203c 6120 636c 6173 733d 2265 6c22 on Se │ │ │ │ +0010b8c0: 7269 616c 697a 696e 6720 6269 6e61 7279 rializing binary │ │ │ │ +0010b8d0: 2064 6174 6120 7769 7468 2044 494d 4520 data with DIME │ │ │ │ +0010b8e0: 6174 7461 6368 6d65 6e74 733c 2f61 3e20 attachments │ │ │ │ +0010b8f0: 2e3c 2f70 3e0a 3c70 3ef0 9f94 9d20 3c61 .

    .

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

    .

    │ │ │ │ +0010b930: 3c61 2063 6c61 7373 3d22 616e 6368 6f72 .Retrie │ │ │ │ +0010b960: 7669 6e67 2061 2063 6f6c 6c65 6374 696f ving a collectio │ │ │ │ +0010b970: 6e20 6f66 2044 494d 4520 6174 7461 6368 n of DIME attach │ │ │ │ +0010b980: 6d65 6e74 733c 2f68 323e 0a3c 703e 4449 ments

    .

    DI │ │ │ │ +0010b990: 4d45 2061 7474 6163 686d 656e 7473 2061 ME attachments a │ │ │ │ +0010b9a0: 7265 2061 7574 6f6d 6174 6963 616c 6c79 re automatically │ │ │ │ +0010b9b0: 2070 6172 7365 6420 616e 6420 7374 6f72 parsed and stor │ │ │ │ +0010b9c0: 6564 2069 6e20 6d65 6d6f 7279 2028 6f72 ed in memory (or │ │ │ │ +0010b9d0: 2070 6173 7365 6420 746f 2074 6865 2073 passed to the s │ │ │ │ +0010b9e0: 7472 6561 6d69 6e67 2068 616e 646c 6572 treaming handler │ │ │ │ +0010b9f0: 7320 7669 6120 7468 6520 4449 4d45 2063 s via the DIME c │ │ │ │ +0010ba00: 616c 6c62 6163 6b20 6675 6e63 7469 6f6e allback function │ │ │ │ +0010ba10: 7320 7768 656e 2064 6566 696e 6564 292e s when defined). │ │ │ │ +0010ba20: 2041 6674 6572 2072 6563 6569 7669 6e67 After receiving │ │ │ │ +0010ba30: 2061 2073 6574 206f 6620 4449 4d45 2061 a set of DIME a │ │ │ │ +0010ba40: 7474 6163 686d 656e 7473 2c20 6569 7468 ttachments, eith │ │ │ │ +0010ba50: 6572 2061 7420 7468 6520 636c 6965 6e74 er at the client │ │ │ │ +0010ba60: 2d73 6964 6520 6f72 2074 6865 2073 6572 -side or the ser │ │ │ │ +0010ba70: 7665 722d 7369 6465 2c20 7468 6520 6c69 ver-side, the li │ │ │ │ +0010ba80: 7374 206f 6620 4449 4d45 2061 7474 6163 st of DIME attac │ │ │ │ +0010ba90: 686d 656e 7473 2063 616e 2062 6520 7472 hments can be tr │ │ │ │ +0010baa0: 6176 6572 7365 6420 746f 2065 7874 7261 aversed to extra │ │ │ │ +0010bab0: 6374 206d 6574 6120 6461 7461 2061 6e64 ct meta data and │ │ │ │ +0010bac0: 2074 6865 2061 7474 6163 686d 656e 7420 the attachment │ │ │ │ +0010bad0: 636f 6e74 656e 742e 3c2f 703e 0a3c 703e content.

    .

    │ │ │ │ +0010bae0: 546f 2074 7261 7665 7273 6520 7468 6520 To traverse the │ │ │ │ +0010baf0: 6c69 7374 206f 6620 4449 4d45 2061 7474 list of DIME att │ │ │ │ +0010bb00: 6163 686d 656e 7473 2069 6e20 432c 2079 achments in C, y │ │ │ │ +0010bb10: 6f75 2075 7365 2061 206c 6f6f 7020 7369 ou use a loop si │ │ │ │ +0010bb20: 6d69 6c61 7220 746f 3a3c 2f70 3e0a 3c64 milar to:

    .
    │ │ │ │ +0010bb70: 696e 743c 2f73 7061 6e3e 206e 203d 2030 int n = 0 │ │ │ │ +0010bb80: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
    .
    │ │ │ │ +0010bbb0: 7374 7275 6374 203c 2f73 7061 6e3e 3c61 struct │ │ │ │ +0010bbf0: 736f 6170 5f6d 756c 7469 7061 7274 3c2f soap_multipart *attachment;< │ │ │ │ +0010bc10: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    for (at │ │ │ │ +0010bc50: 7461 6368 6d65 6e74 203d 203c 6120 636c tachment = soap->< │ │ │ │ +0010bc90: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +0010bca0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ +0010bcb0: 6874 6d6c 2361 3338 3834 3561 3465 3063 html#a38845a4e0c │ │ │ │ +0010bcc0: 6330 3639 3637 3832 3736 3961 6339 3937 c0696782769ac997 │ │ │ │ +0010bcd0: 3663 3464 6661 223e 6469 6d65 3c2f 613e 6c4dfa">dime │ │ │ │ +0010bce0: 2e3c 6120 636c 6173 733d 2263 6f64 6522 . │ │ │ │ +0010bd30: 6c69 7374 3c2f 613e 3b20 6174 7461 6368 list; attach │ │ │ │ +0010bd40: 6d65 6e74 3b20 6174 7461 6368 6d65 6e74 ment; attachment │ │ │ │ +0010bd50: 203d 2061 7474 6163 686d 656e 742d 2667 = attachment-&g │ │ │ │ +0010bd60: 743b 3c61 2063 6c61 7373 3d22 636f 6465 t;next)< │ │ │ │ +0010bdc0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    {
    . │ │ │ │ +0010bde0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    ++n;
    .< │ │ │ │ +0010be00: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +0010be10: 3e20 2070 7269 6e74 6628 3c73 7061 6e20 > printf("Part │ │ │ │ +0010be40: 2025 643a 5c6e 2671 756f 743b 3c2f 7370 %d:\n", n);
    .< │ │ │ │ +0010be60: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +0010be70: 3e20 2070 7269 6e74 6628 3c73 7061 6e20 > printf("ptr │ │ │ │ +0010bea0: 2020 2020 2020 203d 2570 5c6e 2671 756f =%p\n&quo │ │ │ │ +0010beb0: 743b 3c2f 7370 616e 3e2c 2061 7474 6163 t;, attac │ │ │ │ +0010bec0: 686d 656e 742d 2667 743b 3c61 2063 6c61 hment->pt │ │ │ │ +0010bf20: 723c 2f61 3e29 3b3c 2f64 6976 3e0a 3c64 r);
    . │ │ │ │ +0010bf40: 2020 7072 696e 7466 283c 7370 616e 2063 printf("size │ │ │ │ +0010bf70: 2020 2020 2020 3d25 756c 5c6e 2671 756f =%ul\n&quo │ │ │ │ +0010bf80: 743b 3c2f 7370 616e 3e2c 2061 7474 6163 t;, attac │ │ │ │ +0010bf90: 686d 656e 742d 2667 743b 3c61 2063 6c61 hment->si │ │ │ │ +0010bff0: 7a65 3c2f 613e 293b 3c2f 6469 763e 0a3c ze);
    .< │ │ │ │ +0010c000: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +0010c010: 3e20 2070 7269 6e74 6628 3c73 7061 6e20 > printf("id │ │ │ │ +0010c040: 2020 2020 2020 203d 2573 5c6e 2671 756f =%s\n&quo │ │ │ │ +0010c050: 743b 3c2f 7370 616e 3e2c 2061 7474 6163 t;, attac │ │ │ │ +0010c060: 686d 656e 742d 2667 743b 3c61 2063 6c61 hment->id │ │ │ │ +0010c0c0: 3c2f 613e 203f 2061 7474 6163 686d 656e ? attachmen │ │ │ │ +0010c0d0: 742d 2667 743b 3c61 2063 6c61 7373 3d22 t->id │ │ │ │ +0010c130: 203a 203c 7370 616e 2063 6c61 7373 3d22 : & │ │ │ │ +0010c150: 7175 6f74 3b26 7175 6f74 3b3c 2f73 7061 quot;");
    .
    p │ │ │ │ +0010c180: 7269 6e74 6628 3c73 7061 6e20 636c 6173 rintf("type │ │ │ │ +0010c1b0: 2020 203d 2573 5c6e 2671 756f 743b 3c2f =%s\n", attachmen │ │ │ │ +0010c1d0: 742d 2667 743b 3c61 2063 6c61 7373 3d22 t->type ? attachment- │ │ │ │ +0010c240: 2667 743b 3c61 2063 6c61 7373 3d22 636f >type │ │ │ │ +0010c2a0: 203a 203c 7370 616e 2063 6c61 7373 3d22 : & │ │ │ │ +0010c2c0: 7175 6f74 3b26 7175 6f74 3b3c 2f73 7061 quot;");
    .
    }.
    soap_d │ │ │ │ +0010c3a0: 696d 653a 3a6c 6973 743c 2f61 3e3c 2f64 ime::list
    struct so │ │ │ │ +0010c3d0: 6170 5f6d 756c 7469 7061 7274 202a 206c ap_multipart * l │ │ │ │ +0010c3e0: 6973 743c 2f64 6976 3e3c 6469 7620 636c ist
    list │ │ │ │ +0010c400: 206f 6620 4449 4d45 2061 7474 6163 686d of DIME attachm │ │ │ │ +0010c410: 656e 7473 2072 6563 6569 7665 643c 2f64 ents received
    Definit │ │ │ │ +0010c440: 696f 6e3a 3c2f 623e 2073 7464 736f 6170 ion: stdsoap │ │ │ │ +0010c450: 322e 683a 3939 3731 3c2f 6469 763e 3c2f 2.h:9971
    .
    so │ │ │ │ +0010c500: 6170 3a3a 6469 6d65 3c2f 613e 3c2f 6469 ap::dime
    struct soa │ │ │ │ +0010c530: 705f 6469 6d65 2064 696d 653c 2f64 6976 p_dime dime
    DIME attachm │ │ │ │ +0010c560: 656e 7473 2072 6563 6569 7665 642e 3c2f ents received.
    Defini │ │ │ │ +0010c590: 7469 6f6e 3a3c 2f62 3e20 7374 6473 6f61 tion: stdsoa │ │ │ │ +0010c5a0: 7032 2e68 3a34 3138 343c 2f64 6976 3e3c p2.h:4184
    < │ │ │ │ +0010c5b0: 2f64 6976 3e0a 3c2f 6469 763e 3c21 2d2d /div>.

    │ │ │ │ +0010c5d0: 432b 2b20 7072 6f67 7261 6d6d 6572 7320 C++ programmers │ │ │ │ +0010c5e0: 6361 6e20 7573 6520 616e 2069 7465 7261 can use an itera │ │ │ │ +0010c5f0: 746f 7220 696e 7374 6561 643a 3c2f 703e tor instead:

    │ │ │ │ +0010c600: 0a3c 6469 7620 636c 6173 733d 2266 7261 .
    int n │ │ │ │ +0010c650: 3d20 303b 3c2f 6469 763e 0a3c 6469 7620 = 0;
    .
    for (soap_mult │ │ │ │ +0010c6f0: 6970 6172 743a 3a69 7465 7261 746f 723c ipart::iterator< │ │ │ │ +0010c700: 2f61 3e20 6920 3d20 3c61 2063 6c61 7373 /a> i = s │ │ │ │ +0010c730: 6f61 703c 2f61 3e2d 2667 743b 3c61 2063 oap->dime.beg │ │ │ │ +0010c7e0: 696e 3c2f 613e 2829 3b20 6920 213d 203c in(); i != < │ │ │ │ +0010c7f0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +0010c800: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ +0010c810: 6874 6d6c 223e 736f 6170 3c2f 613e 2d26 html">soap-& │ │ │ │ +0010c820: 6774 3b3c 6120 636c 6173 733d 2263 6f64 gt;dime │ │ │ │ +0010c870: 3c2f 613e 2e3c 6120 636c 6173 733d 2263 .end(); + │ │ │ │ +0010c8d0: 2b69 293c 2f64 6976 3e0a 3c64 6976 2063 +i)
    .
    {.
    ++n;.
    printf(" │ │ │ │ +0010c950: 5061 7274 2025 643a 5c6e 2671 756f 743b Part %d:\n" │ │ │ │ +0010c960: 3c2f 7370 616e 3e2c 206e 293b 3c2f 6469 , n);.
    printf(" │ │ │ │ +0010c9b0: 7074 7220 2020 2020 2020 203d 2570 5c6e ptr =%p\n │ │ │ │ +0010c9c0: 2671 756f 743b 3c2f 7370 616e 3e2c 2069 ", i │ │ │ │ +0010c9d0: 2d26 6774 3b70 7472 293b 3c2f 6469 763e ->ptr);
    │ │ │ │ +0010c9e0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    ... / │ │ │ │ +0010ca10: 2f20 6574 633c 2f73 7061 6e3e 3c2f 6469 / etc.
    }
    .
    │ │ │ │ +0010caa0: 3c61 2068 7265 663d 2273 7472 7563 7473 soap_dime::beg │ │ │ │ +0010caf0: 696e 3c2f 613e 3c2f 6469 763e 3c64 6976 in
    │ │ │ │ +0010cb10: 736f 6170 5f6d 756c 7469 7061 7274 3a3a soap_multipart:: │ │ │ │ +0010cb20: 6974 6572 6174 6f72 2062 6567 696e 2829 iterator begin() │ │ │ │ +0010cb30: 3c2f 6469 763e 3c64 6976 2063 6c61 7373
    C++ onl │ │ │ │ +0010cb50: 793a 2061 6e20 6974 6572 6174 6f72 206f y: an iterator o │ │ │ │ +0010cb60: 7665 7220 736f 6170 5f6d 756c 7469 7061 ver soap_multipa │ │ │ │ +0010cb70: 7274 2061 7474 6163 686d 656e 7473 2e3c rt attachments.< │ │ │ │ +0010cb80: 2f64 6976 3e3c 2f64 6976 3e0a 3c64 6976 /div>
    .
    < │ │ │ │ +0010cbf0: 6120 6872 6566 3d22 7374 7275 6374 736f a href="structso │ │ │ │ +0010cc00: 6170 5f5f 6469 6d65 2e68 746d 6c23 6166 ap__dime.html#af │ │ │ │ +0010cc10: 3463 3038 3038 6564 3939 3564 3038 3535 4c0808ed995d0855 │ │ │ │ +0010cc20: 3134 6366 6330 3936 3262 6234 3536 3522 14cfc0962bb4565" │ │ │ │ +0010cc30: 3e73 6f61 705f 6469 6d65 3a3a 656e 643c >soap_dime::end< │ │ │ │ +0010cc40: 2f61 3e3c 2f64 6976 3e3c 6469 7620 636c /a>
    soa │ │ │ │ +0010cc60: 705f 6d75 6c74 6970 6172 743a 3a69 7465 p_multipart::ite │ │ │ │ +0010cc70: 7261 746f 7220 656e 6428 293c 2f64 6976 rator end()
    C++ only: an │ │ │ │ +0010cca0: 2069 7465 7261 746f 7220 6f76 6572 2073 iterator over s │ │ │ │ +0010ccb0: 6f61 705f 6d75 6c74 6970 6172 7420 6174 oap_multipart at │ │ │ │ +0010ccc0: 7461 6368 6d65 6e74 732e 3c2f 6469 763e tachments.
    │ │ │ │ +0010ccd0: 3c2f 6469 763e 0a3c 2f64 6976 3e3c 212d
    .

    The optio │ │ │ │ +0010cd00: 6e73 3c2f 636f 6465 3e20 6d65 6d62 6572 ns member │ │ │ │ +0010cd10: 2069 7320 6176 6169 6c61 626c 6520 6173 is available as │ │ │ │ +0010cd20: 2077 656c 6c2c 2062 7574 206e 6f74 2073 well, but not s │ │ │ │ +0010cd30: 686f 776e 2069 6e20 7468 6520 636f 6465 hown in the code │ │ │ │ +0010cd40: 2061 626f 7665 2e20 5468 6520 3c63 6f64 above. The options │ │ │ │ +0010cd60: 2063 6f6e 7465 6e74 2069 7320 666f 726d content is form │ │ │ │ +0010cd70: 6174 7465 6420 6163 636f 7264 696e 6720 atted according │ │ │ │ +0010cd80: 746f 2074 6865 2044 494d 4520 7370 6563 to the DIME spec │ │ │ │ +0010cd90: 6966 6963 6174 696f 6e3a 2074 6865 2066 ification: the f │ │ │ │ +0010cda0: 6972 7374 2074 776f 2062 7974 6573 2061 irst two bytes a │ │ │ │ +0010cdb0: 7265 2072 6573 6572 7665 6420 666f 7220 re reserved for │ │ │ │ +0010cdc0: 7468 6520 6f70 7469 6f6e 2074 7970 652c the option type, │ │ │ │ +0010cdd0: 2074 6865 206e 6578 7420 7477 6f20 6279 the next two by │ │ │ │ +0010cde0: 7465 7320 7374 6f72 6520 7468 6520 7369 tes store the si │ │ │ │ +0010cdf0: 7a65 206f 6620 7468 6520 6f70 7469 6f6e ze of the option │ │ │ │ +0010ce00: 2064 6174 612c 2066 6f6c 6c6f 7765 6420 data, followed │ │ │ │ +0010ce10: 6279 2074 6865 2028 6269 6e61 7279 2920 by the (binary) │ │ │ │ +0010ce20: 6f70 7469 6f6e 2064 6174 612e 3c2f 703e option data.

    │ │ │ │ +0010ce30: 0a3c 703e 4120 6361 6c6c 2074 6f20 3c63 .

    A call to soap_end │ │ │ │ +0010cf10: 3c2f 613e 3c2f 636f 6465 3e20 7265 6d6f remo │ │ │ │ +0010cf20: 7665 7320 616c 6c20 6f66 2074 6865 2072 ves all of the r │ │ │ │ +0010cf30: 6563 6569 7665 6420 4449 4d45 2064 6174 eceived DIME dat │ │ │ │ +0010cf40: 612e 2054 6f20 7072 6573 6572 7665 2061 a. To preserve a │ │ │ │ +0010cf50: 6e20 6174 7461 6368 6d65 6e74 2069 6e20 n attachment in │ │ │ │ +0010cf60: 6d65 6d6f 7279 2c20 7573 6520 3c63 6f64 memory, use soap_unlin │ │ │ │ +0010d040: 6b3c 2f61 3e3c 2f63 6f64 653e 206f 6e20 k on │ │ │ │ +0010d050: 7468 6520 3c63 6f64 653e 7074 723c 2f63 the ptr member of t │ │ │ │ +0010d070: 6865 203c 636f 6465 3e3c 6120 636c 6173 he soap_mul │ │ │ │ +0010d0f0: 7469 7061 7274 3c2f 613e 3c2f 636f 6465 tipart struct. The soap_unl │ │ │ │ +0010d1e0: 696e 6b3c 2f61 3e3c 2f63 6f64 653e 2066 ink f │ │ │ │ +0010d1f0: 756e 6374 696f 6e20 6361 6e20 6265 2075 unction can be u │ │ │ │ +0010d200: 7365 6420 746f 2070 7265 7665 6e74 2064 sed to prevent d │ │ │ │ +0010d210: 6561 6c6c 6f63 6174 696f 6e20 6f66 2064 eallocation of d │ │ │ │ +0010d220: 6573 6572 6961 6c69 7a65 6420 6461 7461 eserialized data │ │ │ │ +0010d230: 2e3c 2f70 3e0a 3c70 3ef0 9f94 9d20 3c61 .

    .

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

    .

    │ │ │ │ +0010d270: 3c61 2063 6c61 7373 3d22 616e 6368 6f72 .Serializi │ │ │ │ +0010d2a0: 6e67 2062 696e 6172 7920 6461 7461 2077 ng binary data w │ │ │ │ +0010d2b0: 6974 6820 4449 4d45 2061 7474 6163 686d ith DIME attachm │ │ │ │ +0010d2c0: 656e 7473 3c2f 6832 3e0a 3c70 3e42 696e ents

    .

    Bin │ │ │ │ +0010d2d0: 6172 7920 6461 7461 2073 746f 7265 6420 ary data stored │ │ │ │ +0010d2e0: 696e 2065 7874 656e 6465 6420 3c63 6f64 in extended │ │ │ │ +0010d360: 7873 645f 5f62 6173 6536 3442 696e 6172 xsd__base64Binar │ │ │ │ +0010d370: 793c 2f61 3e3c 2f63 6f64 653e 2061 6e64 y and │ │ │ │ +0010d380: 203c 636f 6465 3e3c 6120 636c 6173 733d x │ │ │ │ +0010d3f0: 7364 5f5f 6865 7842 696e 6172 793c 2f61 sd__hexBinary types c │ │ │ │ +0010d410: 616e 2062 6520 7365 7269 616c 697a 6564 an be serialized │ │ │ │ +0010d420: 2061 6e64 2064 6573 6572 6961 6c69 7a65 and deserialize │ │ │ │ +0010d430: 6420 6173 2044 494d 4520 6174 7461 6368 d as DIME attach │ │ │ │ +0010d440: 6d65 6e74 7320 7768 656e 206f 6e65 206f ments when one o │ │ │ │ +0010d450: 7220 6d6f 7265 206f 6620 7468 6520 6578 r more of the ex │ │ │ │ +0010d460: 7472 6120 6d65 6d62 6572 7320 3c63 6f64 tra members id, type, │ │ │ │ +0010d490: 616e 6420 3c63 6f64 653e 6f70 7469 6f6e and option │ │ │ │ +0010d4a0: 733c 2f63 6f64 653e 2061 7265 206e 6f6e s are non │ │ │ │ +0010d4b0: 2d4e 554c 4c2e 2054 6865 7365 2061 7474 -NULL. These att │ │ │ │ +0010d4c0: 6163 686d 656e 7473 2077 696c 6c20 6265 achments will be │ │ │ │ +0010d4d0: 2061 7574 6f6d 6174 6963 616c 6c79 2074 automatically t │ │ │ │ +0010d4e0: 7261 6e73 6d69 7474 6564 2070 7269 6f72 ransmitted prior │ │ │ │ +0010d4f0: 2074 6f20 7468 6520 7365 7175 656e 6365 to the sequence │ │ │ │ +0010d500: 206f 6620 7365 636f 6e64 6172 7920 4449 of secondary DI │ │ │ │ +0010d510: 4d45 2061 7474 6163 686d 656e 7473 2064 ME attachments d │ │ │ │ +0010d520: 6566 696e 6564 2062 7920 7468 6520 7573 efined by the us │ │ │ │ +0010d530: 6572 2077 6974 6820 3c63 6f64 653e 3c61 er with soap_set_di │ │ │ │ +0010d5d0: 6d65 5f61 7474 6163 686d 656e 743c 2f61 me_attachment as expl │ │ │ │ +0010d5f0: 6169 6e65 6420 696e 2074 6865 2070 7265 ained in the pre │ │ │ │ +0010d600: 7669 6f75 7320 7365 6374 696f 6e2e 2054 vious section. T │ │ │ │ +0010d610: 6865 2073 6572 6961 6c69 7a61 7469 6f6e he serialization │ │ │ │ +0010d620: 2070 726f 6365 7373 2069 7320 6175 746f process is auto │ │ │ │ +0010d630: 6d61 7465 6420 666f 7220 534f 4150 2065 mated for SOAP e │ │ │ │ +0010d640: 6e63 6f64 6564 206d 6573 7361 6765 7320 ncoded messages │ │ │ │ +0010d650: 616e 6420 4449 4d45 2061 7474 6163 686d and DIME attachm │ │ │ │ +0010d660: 656e 7473 2077 696c 6c20 6265 2073 656e ents will be sen │ │ │ │ +0010d670: 6420 6576 656e 2077 6865 6e20 3c63 6f64 d even when soap_set_dime │ │ │ │ +0010d700: 3c2f 613e 3c2f 636f 6465 3e20 6f72 203c or < │ │ │ │ +0010d710: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soap │ │ │ │ +0010d7a0: 5f73 6574 5f64 696d 655f 6174 7461 6368 _set_dime_attach │ │ │ │ +0010d7b0: 6d65 6e74 3c2f 613e 3c2f 636f 6465 3e20 ment │ │ │ │ +0010d7c0: 6172 6520 6e6f 7420 7573 6564 2e20 466f are not used. Fo │ │ │ │ +0010d7d0: 7220 6e6f 6e2d 534f 4150 2d65 6e63 6f64 r non-SOAP-encod │ │ │ │ +0010d7e0: 6564 206d 6573 7361 6765 7320 7375 6368 ed messages such │ │ │ │ +0010d7f0: 2061 7320 646f 6375 6d65 6e74 2f6c 6974 as document/lit │ │ │ │ +0010d800: 6572 616c 206d 6573 7361 6765 7320 796f eral messages yo │ │ │ │ +0010d810: 7520 6d75 7374 2073 7469 6c6c 2063 616c u must still cal │ │ │ │ +0010d820: 6c20 3c63 6f64 653e 3c61 2063 6c61 7373 l soap_se │ │ │ │ +0010d8a0: 745f 6469 6d65 3c2f 613e 3c2f 636f 6465 t_dime to enable send │ │ │ │ +0010d8c0: 696e 6720 6d65 7373 6167 6573 2077 6974 ing messages wit │ │ │ │ +0010d8d0: 6820 6174 7461 6368 6d65 6e74 732e 3c2f h attachments..

    To enable │ │ │ │ +0010d8f0: 7365 7269 616c 697a 6174 696f 6e20 6f66 serialization of │ │ │ │ +0010d900: 2074 6865 2064 6174 6120 6173 2044 494d the data as DIM │ │ │ │ +0010d910: 4520 6174 7461 6368 6d65 6e74 7320 696e E attachments in │ │ │ │ +0010d920: 7374 6561 6420 6f66 2069 6e6c 696e 6520 stead of inline │ │ │ │ +0010d930: 6261 7365 3634 2c20 7765 2065 7874 656e base64, we exten │ │ │ │ +0010d940: 6420 7468 6520 3c63 6f64 653e 3c61 2063 d the xsd__b │ │ │ │ +0010d9c0: 6173 6536 3442 696e 6172 793c 2f61 3e3c ase64Binary< │ │ │ │ +0010d9d0: 2f63 6f64 653e 2074 7970 6520 7769 7468 /code> type with │ │ │ │ +0010d9e0: 2074 6872 6565 2061 6464 6974 696f 6e61 three additiona │ │ │ │ +0010d9f0: 6c20 6d65 6d62 6572 733a 3c2f 703e 0a3c l members:

    .< │ │ │ │ +0010da00: 6469 7620 636c 6173 733d 2266 7261 676d div class="fragm │ │ │ │ +0010da10: 656e 7422 3e3c 6469 7620 636c 6173 733d ent">
    str │ │ │ │ +0010da40: 7563 7420 3c2f 7370 616e 3e3c 6120 636c uct xsd__base64Bin │ │ │ │ +0010da90: 6172 793c 2f61 3e20 3c2f 6469 763e 0a3c ary
    .< │ │ │ │ +0010daa0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +0010dab0: 3e7b 3c2f 6469 763e 0a3c 6469 7620 636c >{
    .
    < │ │ │ │ +0010dad0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +0010dae0: 6f72 6474 7970 6522 3e75 6e73 6967 6e65 ordtype">unsigne │ │ │ │ +0010daf0: 643c 2f73 7061 6e3e 203c 7370 616e 2063 d char * │ │ │ │ +0010db20: 3c61 2063 6c61 7373 3d22 636f 6465 2220 __ptr;
    ..
    char *< │ │ │ │ +0010dc70: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +0010dc80: 7265 663d 2273 7472 7563 7478 7364 5f5f ref="structxsd__ │ │ │ │ +0010dc90: 5f5f 6261 7365 3634 5f62 696e 6172 792e __base64_binary. │ │ │ │ +0010dca0: 6874 6d6c 2361 3633 3938 6539 6438 3630 html#a6398e9d860 │ │ │ │ +0010dcb0: 3739 3839 3666 6163 6333 3030 3538 3731 79896facc3005871 │ │ │ │ +0010dcc0: 6437 6665 3237 223e 6964 3c2f 613e 3b20 d7fe27">id; │ │ │ │ +0010dcd0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .. │ │ │ │ +0010dd90: 2020 2020 3c73 7061 6e20 636c 6173 733d ch │ │ │ │ +0010ddb0: 6172 3c2f 7370 616e 3e20 2a3c 6120 636c ar *options; │ │ │ │ +0010de20: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    };.
    │ │ │ │ +0010df20: 3c64 6976 2063 6c61 7373 3d22 7474 6465
    char * optio │ │ │ │ +0010df40: 6e73 3c2f 6469 763e 3c64 6976 2063 6c61 ns
    extra │ │ │ │ +0010df60: 206d 656d 6265 723a 2044 494d 4520 6f70 member: DIME op │ │ │ │ +0010df70: 7469 6f6e 7320 6f72 2061 2064 6573 6372 tions or a descr │ │ │ │ +0010df80: 6970 7469 6f6e 206f 6620 7468 6520 4d49 iption of the MI │ │ │ │ +0010df90: 4d45 2061 7474 6163 686d 656e 7420 6f72 ME attachment or │ │ │ │ +0010dfa0: 204e 554c 4c3c 2f64 6976 3e3c 6469 7620 NULL
    Definition: │ │ │ │ +0010dfd0: 2073 7464 736f 6170 322e 683a 3938 3432 stdsoap2.h:9842 │ │ │ │ +0010dfe0: 3c2f 6469 763e 3c2f 6469 763e 0a3c 6469
    .
    xsd__base6 │ │ │ │ +0010e0b0: 3442 696e 6172 793a 3a69 643c 2f61 3e3c 4Binary::id< │ │ │ │ +0010e0c0: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
    char * │ │ │ │ +0010e0e0: 6964 3c2f 6469 763e 3c64 6976 2063 6c61 id
    extra │ │ │ │ +0010e100: 206d 656d 6265 723a 204e 554c 4c20 746f member: NULL to │ │ │ │ +0010e110: 2067 656e 6572 6174 6520 616e 2069 6420 generate an id │ │ │ │ +0010e120: 6f72 2061 7373 6967 6e20 7468 6973 206d or assign this m │ │ │ │ +0010e130: 656d 6265 7220 7661 7269 6162 6c65 2061 ember variable a │ │ │ │ +0010e140: 2075 6e69 7175 6520 5555 4944 3c2f 6469 unique UUID
    Definiti │ │ │ │ +0010e170: 6f6e 3a3c 2f62 3e20 7374 6473 6f61 7032 on: stdsoap2 │ │ │ │ +0010e180: 2e68 3a39 3834 303c 2f64 6976 3e3c 2f64 .h:9840
    .char * type
    extra memb │ │ │ │ +0010e2b0: 6572 3a20 4d49 4d45 2074 7970 6520 6f66 er: MIME type of │ │ │ │ +0010e2c0: 2074 6865 2064 6174 613c 2f64 6976 3e3c the data
    < │ │ │ │ +0010e2d0: 6469 7620 636c 6173 733d 2274 7464 6566 div class="ttdef │ │ │ │ +0010e2e0: 223e 3c62 3e44 6566 696e 6974 696f 6e3a ">Definition: │ │ │ │ +0010e2f0: 3c2f 623e 2073 7464 736f 6170 322e 683a stdsoap2.h: │ │ │ │ +0010e300: 3938 3431 3c2f 6469 763e 3c2f 6469 763e 9841
    │ │ │ │ +0010e310: 0a3c 2f64 6976 3e3c 212d 2d20 6672 6167 .

    The < │ │ │ │ +0010e330: 636f 6465 3e69 643c 2f63 6f64 653e 206d code>id m │ │ │ │ +0010e340: 656d 6265 7220 6973 2066 6f72 2061 7474 ember is for att │ │ │ │ +0010e350: 6163 686d 656e 7420 7265 6665 7265 6e63 achment referenc │ │ │ │ +0010e360: 696e 672c 2074 7970 6963 616c 6c79 2061 ing, typically a │ │ │ │ +0010e370: 2063 6f6e 7465 6e74 2069 6420 2843 4944 content id (CID │ │ │ │ +0010e380: 2920 6f72 2061 2055 5549 4420 7768 6963 ) or a UUID whic │ │ │ │ +0010e390: 6820 6361 6e20 6265 206f 6274 6169 6e65 h can be obtaine │ │ │ │ +0010e3a0: 6420 7769 7468 203c 636f 6465 3e3c 6120 d with so │ │ │ │ +0010e430: 6170 5f72 616e 645f 7575 6964 3c2f 613e ap_rand_uuid │ │ │ │ +0010e440: 3c2f 636f 6465 3e2c 2061 203c 636f 6465 , a type mem │ │ │ │ +0010e460: 6265 7220 6973 2075 7365 6420 746f 2073 ber is used to s │ │ │ │ +0010e470: 7065 6369 6679 2074 6865 204d 494d 4520 pecify the MIME │ │ │ │ +0010e480: 7479 7065 206f 6620 7468 6520 6461 7461 type of the data │ │ │ │ +0010e490: 2c20 7468 6520 3c63 6f64 653e 6f70 7469 , the opti │ │ │ │ +0010e4a0: 6f6e 733c 2f63 6f64 653e 206d 656d 6265 ons membe │ │ │ │ +0010e4b0: 7220 6973 2075 7365 6420 746f 2070 6967 r is used to pig │ │ │ │ +0010e4c0: 6779 2d62 6163 6b20 6164 6469 7469 6f6e gy-back addition │ │ │ │ +0010e4d0: 616c 2069 6e66 6f72 6d61 7469 6f6e 2077 al information w │ │ │ │ +0010e4e0: 6974 6820 6120 4449 4d45 2061 7474 6163 ith a DIME attac │ │ │ │ +0010e4f0: 686d 656e 742e 2054 6865 206f 7264 6572 hment. The order │ │ │ │ +0010e500: 206f 6620 7468 6520 6465 636c 6172 6174 of the declarat │ │ │ │ +0010e510: 696f 6e20 6f66 2074 6865 206d 656d 6265 ion of the membe │ │ │ │ +0010e520: 7273 2069 7320 7369 676e 6966 6963 616e rs is significan │ │ │ │ +0010e530: 742e 2049 6e20 6164 6469 7469 6f6e 2c20 t. In addition, │ │ │ │ +0010e540: 6e6f 206f 7468 6572 206d 656d 6265 7273 no other members │ │ │ │ +0010e550: 206f 7220 6d65 7468 6f64 7320 6d61 7920 or methods may │ │ │ │ +0010e560: 6265 2064 6563 6c61 7265 6420 6265 666f be declared befo │ │ │ │ +0010e570: 7265 2061 6e79 206f 6620 7468 6573 6520 re any of these │ │ │ │ +0010e580: 6d65 6d62 6572 7320 696e 2074 6865 2073 members in the s │ │ │ │ +0010e590: 7472 7563 742f 636c 6173 732c 2062 7574 truct/class, but │ │ │ │ +0010e5a0: 2061 6464 6974 696f 6e61 6c20 6d65 6d62 additional memb │ │ │ │ +0010e5b0: 6572 7320 616e 6420 6d65 7468 6f64 7320 ers and methods │ │ │ │ +0010e5c0: 6d61 7920 6170 7065 6172 2061 6674 6572 may appear after │ │ │ │ +0010e5d0: 2074 6865 206d 656d 6265 7220 6465 636c the member decl │ │ │ │ +0010e5e0: 6172 6174 696f 6e73 2e20 5468 6520 6578 arations. The ex │ │ │ │ +0010e5f0: 7465 6e64 6564 203c 636f 6465 3e3c 6120 tended xsd__hexBin │ │ │ │ +0010e670: 6172 793c 2f61 3e3c 2f63 6f64 653e 2074 ary t │ │ │ │ +0010e680: 7970 6520 6973 2073 696d 696c 6172 2e3c ype is similar.< │ │ │ │ +0010e690: 2f70 3e0a 3c70 3e54 6865 203c 636f 6465 /p>.

    The id and < │ │ │ │ +0010e6b0: 636f 6465 3e74 7970 653c 2f63 6f64 653e code>type │ │ │ │ +0010e6c0: 206d 656d 6265 7273 2063 6f6e 7461 696e members contain │ │ │ │ +0010e6d0: 2074 6578 742e 2054 6865 2073 6574 2074 text. The set t │ │ │ │ +0010e6e0: 6865 2044 494d 452d 7370 6563 6966 6963 he DIME-specific │ │ │ │ +0010e6f0: 206f 7074 696f 6e73 206d 656d 6265 722c options member, │ │ │ │ +0010e700: 2079 6f75 2063 616e 2075 7365 2074 6865 you can use the │ │ │ │ +0010e710: 203c 636f 6465 3e3c 6120 636c 6173 733d soap_dime_ │ │ │ │ +0010e790: 6f70 7469 6f6e 3c2f 613e 3c2f 636f 6465 option function char *soap_dime │ │ │ │ +0010e7c0: 5f6f 7074 696f 6e28 7374 7275 6374 2073 _option(struct s │ │ │ │ +0010e7d0: 6f61 7020 2a73 6f61 702c 2075 6e73 6967 oap *soap, unsig │ │ │ │ +0010e7e0: 6e65 6420 7368 6f72 7420 7479 7065 2c20 ned short type, │ │ │ │ +0010e7f0: 636f 6e73 7420 6368 6172 202a 6f70 7469 const char *opti │ │ │ │ +0010e800: 6f6e 293c 2f63 6f64 653e 2e3c 2f70 3e0a on).

    . │ │ │ │ +0010e810: 3c70 3e54 6869 7320 6675 6e63 7469 6f6e

    This function │ │ │ │ +0010e820: 2072 6574 7572 6e73 2061 2073 7472 696e returns a strin │ │ │ │ +0010e830: 6720 7769 7468 2074 6869 7320 656e 636f g with this enco │ │ │ │ +0010e840: 6469 6e67 2e20 466f 7220 6578 616d 706c ding. For exampl │ │ │ │ +0010e850: 653c 2f70 3e0a 3c64 6976 2063 6c61 7373 e

    .
    struct xsd__ba │ │ │ │ +0010e8e0: 7365 3634 4269 6e61 7279 3c2f 613e 2069 se64Binary i │ │ │ │ +0010e8f0: 6d61 6765 3b20 3c2f 6469 763e 0a3c 6469 mage;
    .i │ │ │ │ +0010e910: 6d61 6765 2e3c 6120 636c 6173 733d 2263 mage.__ │ │ │ │ +0010e970: 7074 723c 2f61 3e20 3d20 2e2e 2e3b 203c ptr = ...; < │ │ │ │ +0010e980: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    image.__ │ │ │ │ +0010e9a0: 7369 7a65 203d 202e 2e2e 3b20 3c2f 6469 size = ...; .
    image.id = │ │ │ │ +0010e9d0: 3c73 7061 6e20 636c 6173 733d 2273 7472 &quo │ │ │ │ +0010e9f0: 743b 7575 6964 3a30 3932 3333 3532 332d t;uuid:09233523- │ │ │ │ +0010ea00: 3334 3562 2d34 3335 312d 6236 3233 2d35 345b-4351-b623-5 │ │ │ │ +0010ea10: 6473 6633 3573 6773 3564 3626 7175 6f74 dsf35sgs5d6" │ │ │ │ +0010ea20: 3b3c 2f73 7061 6e3e 3b20 3c2f 6469 763e ;;
    │ │ │ │ +0010ea30: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    image.type = │ │ │ │ +0010ea50: 3c73 7061 6e20 636c 6173 733d 2273 7472 &quo │ │ │ │ +0010ea70: 743b 696d 6167 652f 6a70 6567 2671 756f t;image/jpeg&quo │ │ │ │ +0010ea80: 743b 3c2f 7370 616e 3e3b 203c 2f64 6976 t;;
    .
    image.option │ │ │ │ +0010eab0: 7320 3d20 3c61 2063 6c61 7373 3d22 636f s = soap_dime_ │ │ │ │ +0010eb10: 6f70 7469 6f6e 3c2f 613e 283c 6120 636c option(soap, 0, < │ │ │ │ +0010eb50: 7370 616e 2063 6c61 7373 3d22 7374 7269 span class="stri │ │ │ │ +0010eb60: 6e67 6c69 7465 7261 6c22 3e26 7175 6f74 ngliteral">" │ │ │ │ +0010eb70: 3b4d 7920 7765 6464 696e 6720 7069 6374 ;My wedding pict │ │ │ │ +0010eb80: 7572 6526 7175 6f74 3b3c 2f73 7061 6e3e ure" │ │ │ │ +0010eb90: 293b 3c2f 6469 763e 0a3c 6469 7620 636c );
    .
    < │ │ │ │ +0010ec00: 6120 6872 6566 3d22 6772 6f75 705f 5f67 a href="group__g │ │ │ │ +0010ec10: 726f 7570 5f5f 6469 6d65 2e68 746d 6c23 roup__dime.html# │ │ │ │ +0010ec20: 6761 3438 3239 6638 3333 6162 6537 3466 ga4829f833abe74f │ │ │ │ +0010ec30: 6562 6362 3865 3566 6539 3336 3061 6235 ebcb8e5fe9360ab5 │ │ │ │ +0010ec40: 3931 223e 736f 6170 5f64 696d 655f 6f70 91">soap_dime_op │ │ │ │ +0010ec50: 7469 6f6e 3c2f 613e 3c2f 6469 763e 3c64 tion
    char * soap_di │ │ │ │ +0010ec80: 6d65 5f6f 7074 696f 6e28 7374 7275 6374 me_option(struct │ │ │ │ +0010ec90: 2073 6f61 7020 2a73 6f61 702c 2075 6e73 soap *soap, uns │ │ │ │ +0010eca0: 6967 6e65 6420 7368 6f72 7420 6f70 7479 igned short opty │ │ │ │ +0010ecb0: 7065 2c20 636f 6e73 7420 6368 6172 202a pe, const char * │ │ │ │ +0010ecc0: 6f70 7469 6f6e 293c 2f64 6976 3e3c 6469 option)
    │ │ │ │ +0010ece0: 4372 6561 7465 7320 6120 4449 4d45 206f Creates a DIME o │ │ │ │ +0010ecf0: 7074 696f 6e2e 3c2f 6469 763e 3c2f 6469 ption.
    .

    Whe │ │ │ │ +0010ed20: 6e20 6569 7468 6572 2074 6865 203c 636f n either the id or │ │ │ │ +0010ed40: 3c63 6f64 653e 7479 7065 3c2f 636f 6465 type member values │ │ │ │ +0010ed60: 6172 6520 6e6f 6e2d 4e55 4c4c 2061 7420 are non-NULL at │ │ │ │ +0010ed70: 7275 6e20 7469 6d65 2c20 7468 6520 6461 run time, the da │ │ │ │ +0010ed80: 7461 2077 696c 6c20 6265 2073 6572 6961 ta will be seria │ │ │ │ +0010ed90: 6c69 7a65 6420 6173 2061 2044 494d 4520 lized as a DIME │ │ │ │ +0010eda0: 6174 7461 6368 6d65 6e74 2e3c 2f70 3e0a attachment.

    . │ │ │ │ +0010edb0: 3c70 3e54 6865 2053 4f41 502f 584d 4c20

    The SOAP/XML │ │ │ │ +0010edc0: 6d65 7373 6167 6520 7265 6665 7273 2074 message refers t │ │ │ │ +0010edd0: 6f20 7468 6520 6174 7461 6368 6d65 6e74 o the attachment │ │ │ │ +0010ede0: 7320 7573 696e 6720 3c65 6d3e 3c63 6f64 s using href attributes. T │ │ │ │ +0010ee10: 6869 7320 6765 6e65 7261 6c6c 7920 776f his generally wo │ │ │ │ +0010ee20: 726b 7320 7769 6c6c 2077 6974 6820 534f rks will with SO │ │ │ │ +0010ee30: 4150 2052 5043 2065 6e63 6f64 6564 206d AP RPC encoded m │ │ │ │ +0010ee40: 6573 7361 6769 6e67 2c20 6265 6361 7573 essaging, becaus │ │ │ │ +0010ee50: 6520 3c65 6d3e 3c63 6f64 653e 6872 6566 e href │ │ │ │ +0010ee60: 3c2f 636f 6465 3e3c 2f65 6d3e 2061 7474 att │ │ │ │ +0010ee70: 7269 6275 7465 7320 6172 6520 7065 726d ributes are perm │ │ │ │ +0010ee80: 6974 7465 642e 2048 6f77 6576 6572 2c20 itted. However, │ │ │ │ +0010ee90: 7769 7468 2064 6f63 756d 656e 742f 6c69 with document/li │ │ │ │ +0010eea0: 7465 7261 6c20 7374 796c 6520 7468 6520 teral style the │ │ │ │ +0010eeb0: 7265 6665 7265 6e63 696e 6720 6d65 6368 referencing mech │ │ │ │ +0010eec0: 616e 6973 6d20 6d75 7374 2062 6520 6578 anism must be ex │ │ │ │ +0010eed0: 706c 6963 6974 6c79 2064 6566 696e 6564 plicitly defined │ │ │ │ +0010eee0: 2069 6e20 7468 6520 7363 6865 6d61 206f in the schema o │ │ │ │ +0010eef0: 6620 7468 6520 6269 6e61 7279 2074 7970 f the binary typ │ │ │ │ +0010ef00: 652e 2054 6865 7265 666f 7265 2c20 4d54 e. Therefore, MT │ │ │ │ +0010ef10: 4f4d 2069 7320 7468 6520 7072 6566 6572 OM is the prefer │ │ │ │ +0010ef20: 7265 6420 6174 7461 6368 6d65 6e74 206d red attachment m │ │ │ │ +0010ef30: 6563 6861 6e69 736d 2066 6f72 2064 6f63 echanism for doc │ │ │ │ +0010ef40: 756d 656e 742f 6c69 7465 7261 6c20 7374 ument/literal st │ │ │ │ +0010ef50: 796c 6520 6d65 7373 6167 696e 672e 3c2f yle messaging..

    The declar │ │ │ │ +0010ef70: 6174 696f 6e20 6f66 2061 6e20 6578 7465 ation of an exte │ │ │ │ +0010ef80: 6e64 6564 2062 696e 6172 7920 7479 7065 nded binary type │ │ │ │ +0010ef90: 2069 6e20 7468 6520 696e 7465 7266 6163 in the interfac │ │ │ │ +0010efa0: 6520 6865 6164 6572 2066 696c 6520 666f e header file fo │ │ │ │ +0010efb0: 7220 736f 6170 6370 7032 2069 733a 3c2f r soapcpp2 is:.

    struct n │ │ │ │ +0010f010: 735f 5f6d 7942 696e 6172 7944 6174 6154 s__myBinaryDataT │ │ │ │ +0010f020: 7970 6520 3c2f 6469 763e 0a3c 6469 7620 ype
    .
    {.
    unsigned c │ │ │ │ +0010f0a0: 6861 723c 2f73 7061 6e3e 202a 5f5f 7074 har *__pt │ │ │ │ +0010f0b0: 723b 203c 2f64 6976 3e0a 3c64 6976 2063 r;
    .
    │ │ │ │ +0010f0d0: 3c73 7061 6e20 636c 6173 733d 226b 6579 int __size; .
    char │ │ │ │ +0010f140: 2a69 643b 203c 2f64 6976 3e0a 3c64 6976 *id;
    .
    │ │ │ │ +0010f160: 2020 3c73 7061 6e20 636c 6173 733d 226b char │ │ │ │ +0010f180: 3c2f 7370 616e 3e20 2a74 7970 653b 203c *type; < │ │ │ │ +0010f190: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    char *options; .
    };
    .

    C++ prog │ │ │ │ +0010f220: 7261 6d6d 6572 7320 6361 6e20 7573 6520 rammers can use │ │ │ │ +0010f230: 696e 6865 7269 7461 6e63 6520 696e 7374 inheritance inst │ │ │ │ +0010f240: 6561 6420 6f66 2074 6578 7475 616c 2065 ead of textual e │ │ │ │ +0010f250: 7874 656e 7369 6f6e 2072 6571 7569 7265 xtension require │ │ │ │ +0010f260: 6420 696e 2043 3a3c 2f70 3e0a 3c64 6976 d in C:

    .
    .
    { < │ │ │ │ +0010f320: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +0010f330: 6f72 6422 3e70 7562 6c69 633c 2f73 7061 ord">public:
    .
    .
    │ │ │ │ +0010f430: 2020 3c73 7061 6e20 636c 6173 733d 226b int< │ │ │ │ +0010f450: 2f73 7061 6e3e 203c 6120 636c 6173 733d /span> │ │ │ │ +0010f4b0: 5f5f 7369 7a65 3c2f 613e 3b20 3c2f 6469 __size; .
    };
    .< │ │ │ │ +0010f4e0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +0010f4f0: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >class
    ns__myBinary │ │ │ │ +0010f520: 4461 7461 5479 7065 203a 203c 7370 616e DataType : public < │ │ │ │ +0010f550: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +0010f560: 7265 663d 2273 7472 7563 7478 7364 5f5f ref="structxsd__ │ │ │ │ +0010f570: 5f5f 6261 7365 3634 5f62 696e 6172 792e __base64_binary. │ │ │ │ +0010f580: 6874 6d6c 223e 7873 645f 5f62 6173 6536 html">xsd__base6 │ │ │ │ +0010f590: 3442 696e 6172 793c 2f61 3e20 3c2f 6469 4Binary .
    { pub │ │ │ │ +0010f5d0: 6c69 633c 2f73 7061 6e3e 3a3c 2f64 6976 lic:
    .
    char *i │ │ │ │ +0010f620: 643b 203c 2f64 6976 3e0a 3c64 6976 2063 d;
    .
    │ │ │ │ +0010f640: 3c73 7061 6e20 636c 6173 733d 226b 6579 char *type; .
    char │ │ │ │ +0010f6b0: 2a6f 7074 696f 6e73 3b20 3c2f 6469 763e *options;
    │ │ │ │ +0010f6c0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    };
    .

    This defin │ │ │ │ +0010f700: 6573 2061 6e20 6578 7465 6e73 696f 6e20 es an extension │ │ │ │ +0010f710: 6f66 203c 656d 3e3c 636f 6465 3e78 7364 of xsd │ │ │ │ +0010f720: 3a62 6173 6536 3442 696e 6172 793c 2f63 :base64Binary, such │ │ │ │ +0010f740: 7468 6174 2074 6865 2064 6174 6120 6361 that the data ca │ │ │ │ +0010f750: 6e20 6265 2073 6572 6961 6c69 7a65 6420 n be serialized │ │ │ │ +0010f760: 6173 2044 494d 4520 6174 7461 6368 6d65 as DIME attachme │ │ │ │ +0010f770: 6e74 7320 7573 696e 6720 3c65 6d3e 3c63 nts using href< │ │ │ │ +0010f790: 2f65 6d3e 2061 7474 7269 6275 7465 7320 /em> attributes │ │ │ │ +0010f7a0: 666f 7220 7265 6665 7265 6e63 696e 672e for referencing. │ │ │ │ +0010f7b0: 2057 6865 6e20 6120 6469 6666 6572 656e When a differen │ │ │ │ +0010f7c0: 7420 6174 7472 6962 7574 6520 6973 2074 t attribute is t │ │ │ │ +0010f7d0: 6f20 6265 2075 7365 642c 2074 6869 7320 o be used, this │ │ │ │ +0010f7e0: 6d75 7374 2062 6520 6578 706c 6963 6974 must be explicit │ │ │ │ +0010f7f0: 6c79 2064 6566 696e 6564 3a3c 2f70 3e0a ly defined:

    . │ │ │ │ +0010f800: 3c64 6976 2063 6c61 7373 3d22 6672 6167
    // │ │ │ │ +0010f840: 6773 6f61 7020 5753 7265 6620 7363 6865 gsoap WSref sche │ │ │ │ +0010f850: 6d61 2069 6d70 6f72 743a 2068 7474 703a ma import: http: │ │ │ │ +0010f860: 2f2f 7363 6865 6d61 732e 786d 6c73 6f61 //schemas.xmlsoa │ │ │ │ +0010f870: 702e 6f72 672f 7773 2f32 3030 322f 3034 p.org/ws/2002/04 │ │ │ │ +0010f880: 2f72 6566 6572 656e 6365 2f20 3c2f 7370 /reference/
    .
    struct │ │ │ │ +0010f8d0: 6e73 5f5f 6d79 4269 6e61 7279 4461 7461 ns__myBinaryData │ │ │ │ +0010f8e0: 5479 7065 203c 2f64 6976 3e0a 3c64 6976 Type
    .
    {< │ │ │ │ +0010f900: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    unsigned │ │ │ │ +0010f960: 6368 6172 3c2f 7370 616e 3e20 2a5f 5f70 char *__p │ │ │ │ +0010f970: 7472 3b20 3c2f 6469 763e 0a3c 6469 7620 tr;
    .
    │ │ │ │ +0010f990: 203c 7370 616e 2063 6c61 7373 3d22 6b65 int __size; .
    char │ │ │ │ +0010fa00: 202a 6964 3b20 3c2f 6469 763e 0a3c 6469 *id;
    . │ │ │ │ +0010fa20: 2020 203c 7370 616e 2063 6c61 7373 3d22 cha │ │ │ │ +0010fa40: 723c 2f73 7061 6e3e 202a 7479 7065 3b20 r *type; │ │ │ │ +0010fa50: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    char *options; .
    @ char │ │ │ │ +0010fae0: 2a57 5372 6566 5f5f 6c6f 6361 7469 6f6e *WSref__location │ │ │ │ +0010faf0: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
    .
    };.

    Th │ │ │ │ +0010fb30: 6520 6578 616d 706c 6520 6162 6f76 6520 e example above │ │ │ │ +0010fb40: 7573 6573 2074 6865 203c 656d 3e3c 636f uses the location attribut │ │ │ │ +0010fb70: 6520 6465 6669 6e65 6420 696e 2074 6865 e defined in the │ │ │ │ +0010fb80: 2063 6f6e 7465 6e74 2072 6566 6572 656e content referen │ │ │ │ +0010fb90: 6365 2073 6368 656d 612c 2061 7320 6465 ce schema, as de │ │ │ │ +0010fba0: 6669 6e65 6420 696e 206f 6e65 206f 6620 fined in one of │ │ │ │ +0010fbb0: 7468 6520 7665 6e64 6f72 2773 2073 7065 the vendor's spe │ │ │ │ +0010fbc0: 6369 6669 6320 5753 444c 2065 7874 656e cific WSDL exten │ │ │ │ +0010fbd0: 7369 6f6e 7320 666f 7220 4449 4d45 203c sions for DIME < │ │ │ │ +0010fbe0: 6120 6872 6566 3d22 6874 7470 3a2f 2f77 a href="http://w │ │ │ │ +0010fbf0: 7777 2e67 6f74 646f 746e 6574 2e63 6f6d ww.gotdotnet.com │ │ │ │ +0010fc00: 2f74 6561 6d2f 786d 6c5f 7773 7370 6563 /team/xml_wsspec │ │ │ │ +0010fc10: 732f 6469 6d65 2f57 5344 4c2d 4578 7465 s/dime/WSDL-Exte │ │ │ │ +0010fc20: 6e73 696f 6e2d 666f 722d 4449 4d45 2e68 nsion-for-DIME.h │ │ │ │ +0010fc30: 746d 223e 6874 7470 3a2f 2f77 7777 2e67 tm">http://www.g │ │ │ │ +0010fc40: 6f74 646f 746e 6574 2e63 6f6d 2f74 6561 otdotnet.com/tea │ │ │ │ +0010fc50: 6d2f 786d 6c5f 7773 7370 6563 732f 6469 m/xml_wsspecs/di │ │ │ │ +0010fc60: 6d65 2f57 5344 4c2d 4578 7465 6e73 696f me/WSDL-Extensio │ │ │ │ +0010fc70: 6e2d 666f 722d 4449 4d45 2e68 746d 3c2f n-for-DIME.htm.

    .

    When │ │ │ │ +0010fc90: 7265 6365 6976 696e 6720 4449 4d45 2061 receiving DIME a │ │ │ │ +0010fca0: 7474 6163 686d 656e 7473 2c20 7468 6520 ttachments, the │ │ │ │ +0010fcb0: 4449 4d45 206d 6574 6120 6461 7461 2061 DIME meta data a │ │ │ │ +0010fcc0: 6e64 2062 696e 6172 7920 636f 6e74 656e nd binary conten │ │ │ │ +0010fcd0: 7420 6172 6520 7374 6f72 6564 2069 6e20 t are stored in │ │ │ │ +0010fce0: 7468 6520 7370 6563 6966 6965 6420 3c63 the specified xsd__base64Bin │ │ │ │ +0010fd70: 6172 793c 2f61 3e3c 2f63 6f64 653e 2061 ary a │ │ │ │ +0010fd80: 6e64 203c 636f 6465 3e3c 6120 636c 6173 nd xsd__hexBinary< │ │ │ │ +0010fe00: 2f61 3e3c 2f63 6f64 653e 2062 696e 6172 /a> binar │ │ │ │ +0010fe10: 7920 6461 7461 2074 7970 6573 206f 6e6c y data types onl │ │ │ │ +0010fe20: 7920 7768 656e 2074 6865 2058 4d4c 2070 y when the XML p │ │ │ │ +0010fe30: 6172 7473 206f 6620 7468 6520 6d65 7373 arts of the mess │ │ │ │ +0010fe40: 6167 6520 7573 6573 203c 656d 3e3c 636f age uses href attributes t │ │ │ │ +0010fe70: 6f20 7265 6665 7220 746f 2074 6865 7365 o refer to these │ │ │ │ +0010fe80: 2061 7474 6163 686d 656e 7473 2e20 4966 attachments. If │ │ │ │ +0010fe90: 2073 6f2c 2074 6865 2062 696e 6172 7920 so, the binary │ │ │ │ +0010fea0: 6461 7461 2074 7970 6520 3c63 6f64 653e data type │ │ │ │ +0010feb0: 5f5f 7074 723c 2f63 6f64 653e 2061 6e64 __ptr and │ │ │ │ +0010fec0: 203c 636f 6465 3e5f 5f73 697a 653c 2f63 __size members are │ │ │ │ +0010fee0: 2073 6574 2074 6f20 7468 6520 6c6f 6361 set to the loca │ │ │ │ +0010fef0: 7469 6f6e 2069 6e20 6d65 6d6f 7279 206f tion in memory o │ │ │ │ +0010ff00: 6620 7468 6520 6174 7461 6368 6d65 6e74 f the attachment │ │ │ │ +0010ff10: 2064 6174 6120 616e 6420 6c65 6e67 7468 data and length │ │ │ │ +0010ff20: 2c20 7265 7370 6563 7469 7665 6c79 2e3c , respectively.< │ │ │ │ +0010ff30: 2f70 3e0a 3c70 3e4d 6573 7361 6765 7320 /p>.

    Messages │ │ │ │ +0010ff40: 6d61 7920 636f 6e74 6169 6e20 6269 6e61 may contain bina │ │ │ │ +0010ff50: 7279 2064 6174 6120 7468 6174 2072 6566 ry data that ref │ │ │ │ +0010ff60: 6572 656e 6365 7320 6578 7465 726e 616c erences external │ │ │ │ +0010ff70: 2072 6573 6f75 7263 6573 206e 6f74 2070 resources not p │ │ │ │ +0010ff80: 726f 7669 6465 6420 6173 2061 7474 6163 rovided as attac │ │ │ │ +0010ff90: 686d 656e 7473 2e20 496e 2074 6861 7420 hments. In that │ │ │ │ +0010ffa0: 6361 7365 2c20 7468 6520 3c63 6f64 653e case, the │ │ │ │ +0010ffb0: 5f5f 7074 723c 2f63 6f64 653e 206d 656d __ptr mem │ │ │ │ +0010ffc0: 6265 7220 6973 204e 554c 4c20 616e 6420 ber is NULL and │ │ │ │ +0010ffd0: 7468 6520 3c63 6f64 653e 6964 3c2f 636f the id member refer │ │ │ │ +0010fff0: 7320 746f 2074 6865 2065 7874 6572 6e61 s to the externa │ │ │ │ +00110000: 6c20 6461 7461 2073 6f75 7263 652e 3c2f l data source..

    The │ │ │ │ +00110020: 6469 6d65 5f69 645f 666f 726d 6174 3c2f dime_id_format attribute │ │ │ │ +00110040: 6f66 2074 6865 2063 7572 7265 6e74 2063 of the current c │ │ │ │ +00110050: 6f6e 7465 7874 2063 616e 2062 6520 7365 ontext can be se │ │ │ │ +00110060: 7420 746f 2074 6865 2064 6566 6175 6c74 t to the default │ │ │ │ +00110070: 2066 6f72 6d61 7420 6f66 2044 494d 4520 format of DIME │ │ │ │ +00110080: 6964 206d 656d 6265 7273 2e20 5468 6520 id members. The │ │ │ │ +00110090: 666f 726d 6174 2073 7472 696e 6720 6d75 format string mu │ │ │ │ +001100a0: 7374 2063 6f6e 7461 696e 2061 203c 636f st contain a d form │ │ │ │ +001100c0: 6174 2073 7065 6369 6669 6572 2028 6f72 at specifier (or │ │ │ │ +001100d0: 2061 6e79 206f 7468 6572 203c 636f 6465 any other int-base │ │ │ │ +001100f0: 6420 666f 726d 6174 2073 7065 6369 6669 d format specifi │ │ │ │ +00110100: 6572 292e 2054 6865 2076 616c 7565 206f er). The value o │ │ │ │ +00110110: 6620 7468 6973 2073 7065 6369 6669 6572 f this specifier │ │ │ │ +00110120: 2069 7320 6120 6e6f 6e2d 6e65 6761 7469 is a non-negati │ │ │ │ +00110130: 7665 2069 6e74 6567 6572 2c20 7769 7468 ve integer, with │ │ │ │ +00110140: 207a 6572 6f20 6265 696e 6720 7468 6520 zero being the │ │ │ │ +00110150: 7661 6c75 6520 6f66 2074 6865 2044 494d value of the DIM │ │ │ │ +00110160: 4520 6174 7461 6368 6d65 6e74 2069 6420 E attachment id │ │ │ │ +00110170: 666f 7220 7468 6520 534f 4150 206d 6573 for the SOAP mes │ │ │ │ +00110180: 7361 6765 2e20 466f 7220 6578 616d 706c sage. For exampl │ │ │ │ +00110190: 652c 3c2f 703e 0a3c 6469 7620 636c 6173 e,

    . │ │ │ │ +001102b0: 0a3c 6469 7620 636c 6173 733d 226c 696e ..
    < │ │ │ │ +001103f0: 6120 6872 6566 3d22 7374 7275 6374 736f a href="structso │ │ │ │ +00110400: 6170 2e68 746d 6c23 6138 3534 3162 6666 ap.html#a8541bff │ │ │ │ +00110410: 3039 3334 3433 3963 3966 3666 6565 3663 0934439c9f6fee6c │ │ │ │ +00110420: 3434 3934 3030 6662 6522 3e73 6f61 703a 449400fbe">soap: │ │ │ │ +00110430: 3a64 696d 655f 6964 5f66 6f72 6d61 743c :dime_id_format< │ │ │ │ +00110440: 2f61 3e3c 2f64 6976 3e3c 6469 7620 636c /a>
    con │ │ │ │ +00110460: 7374 2063 6861 7220 2a20 6469 6d65 5f69 st char * dime_i │ │ │ │ +00110470: 645f 666f 726d 6174 3c2f 6469 763e 3c64 d_format
    User-definable │ │ │ │ +001104a0: 666f 726d 6174 2073 7472 696e 6720 746f format string to │ │ │ │ +001104b0: 2067 656e 6572 6174 6520 4449 4d45 2063 generate DIME c │ │ │ │ +001104c0: 6f6e 7465 6e74 2049 4473 2e3c 2f64 6976 ontent IDs.
    Definitio │ │ │ │ +001104f0: 6e3a 3c2f 623e 2073 7464 736f 6170 322e n: stdsoap2. │ │ │ │ +00110500: 683a 3431 3732 3c2f 6469 763e 3c2f 6469 h:4172
    .

    As │ │ │ │ +00110530: 6120 7265 7375 6c74 2c20 616c 6c20 6174 a result, all at │ │ │ │ +00110540: 7461 6368 6d65 6e74 7320 7769 7468 2061 tachments with a │ │ │ │ +00110550: 204e 554c 4c20 3c63 6f64 653e 6964 3c2f NULL id member wil │ │ │ │ +00110570: 6c20 7573 6520 6120 6175 746f 2d67 656e l use a auto-gen │ │ │ │ +00110580: 6572 6174 6564 2069 6420 7661 6c75 6520 erated id value │ │ │ │ +00110590: 6261 7365 6420 6f6e 2074 6865 2066 6f72 based on the for │ │ │ │ +001105a0: 6d61 7420 7374 7269 6e67 2e3c 2f70 3e0a mat string.

    . │ │ │ │ +001105b0: 3c64 6c20 636c 6173 733d 2273 6563 7469
    │ │ │ │ +001105d0: 5761 726e 696e 673c 2f64 743e 3c64 643e Warning
    │ │ │ │ +001105e0: 4361 7265 206d 7573 7420 6265 2074 616b Care must be tak │ │ │ │ +001105f0: 656e 206e 6f74 2074 6f20 696e 7472 6f64 en not to introd │ │ │ │ +00110600: 7563 6520 6475 706c 6963 6174 6520 636f uce duplicate co │ │ │ │ +00110610: 6e74 656e 7420 6964 2076 616c 7565 732c ntent id values, │ │ │ │ +00110620: 2077 6865 6e20 6173 7369 676e 696e 6720 when assigning │ │ │ │ +00110630: 636f 6e74 656e 7420 6964 2076 616c 7565 content id value │ │ │ │ +00110640: 7320 746f 2074 6865 2069 6420 6d65 6d62 s to the id memb │ │ │ │ +00110650: 6572 7320 6f66 2044 494d 4520 6578 7465 ers of DIME exte │ │ │ │ +00110660: 6e64 6564 2062 696e 6172 7920 6461 7461 nded binary data │ │ │ │ +00110670: 2074 7970 6573 2e20 436f 6e74 656e 7420 types. Content │ │ │ │ +00110680: 6964 7320 6d75 7374 2062 6520 756e 6971 ids must be uniq │ │ │ │ +00110690: 7565 2e3c 2f64 643e 3c2f 646c 3e0a 3c70 ue.
    .

    .... Back to table │ │ │ │ +001106c0: 6f66 2063 6f6e 7465 6e74 733c 2f61 3e3c of contents< │ │ │ │ +001106d0: 2f70 3e0a 3c68 323e 3c61 2063 6c61 7373 /p>.

    .Streaming DIME │ │ │ │ +00110710: 3c2f 6832 3e0a 3c70 3e53 7472 6561 6d69

    .

    Streami │ │ │ │ +00110720: 6e67 2044 494d 4520 6973 2061 6368 6965 ng DIME is achie │ │ │ │ +00110730: 7665 6420 7769 7468 2063 616c 6c62 6163 ved with callbac │ │ │ │ +00110740: 6b20 6675 6e63 7469 6f6e 7320 746f 2066 k functions to f │ │ │ │ +00110750: 6574 6368 2061 6e64 2073 746f 7265 2064 etch and store d │ │ │ │ +00110760: 6174 6120 6475 7269 6e67 2074 7261 6e73 ata during trans │ │ │ │ +00110770: 6d69 7373 696f 6e2e 2054 6872 6565 2066 mission. Three f │ │ │ │ +00110780: 756e 6374 696f 6e20 6361 6c6c 6261 636b unction callback │ │ │ │ +00110790: 7320 666f 7220 7374 7265 616d 696e 6720 s for streaming │ │ │ │ +001107a0: 4449 4d45 206f 7574 7075 7420 616e 6420 DIME output and │ │ │ │ +001107b0: 7468 7265 6520 6361 6c6c 6261 636b 7320 three callbacks │ │ │ │ +001107c0: 666f 7220 7374 7265 616d 696e 6720 4449 for streaming DI │ │ │ │ +001107d0: 4d45 2069 6e70 7574 2061 7265 2061 7661 ME input are ava │ │ │ │ +001107e0: 696c 6162 6c65 2e3c 2f70 3e0a 3c75 6c3e ilable.

    .
    . │ │ │ │ +001133f0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    FILE *fd; .
    s │ │ │ │ +00113440: 7472 7563 7420 3c2f 7370 616e 3e73 7461 truct sta │ │ │ │ +00113450: 7420 7362 3b20 3c2f 6469 763e 0a3c 6469 t sb;
    . │ │ │ │ +00113470: 203c 6120 636c 6173 733d 2263 6f64 6522 soap_init< │ │ │ │ +001134d0: 2f61 3e28 2661 6d70 3b3c 6120 636c 6173 /a>(& │ │ │ │ +00113500: 736f 6170 3c2f 613e 293b 203c 2f64 6976 soap);
    .
    │ │ │ │ +00113540: 6966 3c2f 7370 616e 3e20 2821 6673 7461 if (!fsta │ │ │ │ +00113550: 7428 6669 6c65 6e6f 2866 6429 2c20 2661 t(fileno(fd), &a │ │ │ │ +00113560: 6d70 3b73 6229 2026 616d 703b 2661 6d70 mp;sb) && │ │ │ │ +00113570: 3b20 7362 2e73 745f 7369 7a65 2026 6774 ; sb.st_size > │ │ │ │ +00113580: 3b20 3029 203c 2f64 6976 3e0a 3c64 6976 ; 0)
    .
    │ │ │ │ +001135a0: 7b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 {
    .
    // because w │ │ │ │ +001135e0: 6520 6361 6e20 6765 7420 7468 6520 6c65 e can get the le │ │ │ │ +001135f0: 6e67 7468 206f 6620 7468 6520 6669 6c65 ngth of the file │ │ │ │ +00113600: 2c20 7765 2063 616e 2073 7472 6561 6d20 , we can stream │ │ │ │ +00113610: 6974 203c 2f73 7061 6e3e 3c2f 6469 763e it
    │ │ │ │ +00113620: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    so │ │ │ │ +00113660: 6170 3c2f 613e 2e3c 6120 636c 6173 733d ap.fd │ │ │ │ +001136c0: 696d 6572 6561 646f 7065 6e3c 2f61 3e20 imereadopen │ │ │ │ +001136d0: 3d20 6469 6d65 5f72 6561 645f 6f70 656e = dime_read_open │ │ │ │ +001136e0: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
    .
    < │ │ │ │ +00113700: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +00113710: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ +00113720: 6874 6d6c 223e 736f 6170 3c2f 613e 2e3c html">soap.< │ │ │ │ +00113730: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +00113740: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ │ +00113750: 705f 5f63 616c 6c62 6163 6b73 2e68 746d p__callbacks.htm │ │ │ │ +00113760: 6c23 6761 3135 3437 3532 6535 3533 6265 l#ga154752e553be │ │ │ │ +00113770: 3431 6564 3362 3130 6665 3361 3132 3733 41ed3b10fe3a1273 │ │ │ │ +00113780: 6163 3731 223e 6664 696d 6572 6561 6463 ac71">fdimereadc │ │ │ │ +00113790: 6c6f 7365 3c2f 613e 203d 2064 696d 655f lose = dime_ │ │ │ │ +001137a0: 7265 6164 5f63 6c6f 7365 3b20 3c2f 6469 read_close; ..
    image.__ │ │ │ │ +00113890: 7074 7220 3d20 283c 7370 616e 2063 6c61 ptr = (unsigned │ │ │ │ +001138c0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 char< │ │ │ │ +001138e0: 2f73 7061 6e3e 2a29 6664 3b20 3c73 7061 /span>*)fd; // must set to │ │ │ │ +00113910: 206e 6f6e 2d4e 554c 4c20 2874 6869 7320 non-NULL (this │ │ │ │ +00113920: 6973 206f 7572 2066 6420 6861 6e64 6c65 is our fd handle │ │ │ │ +00113930: 2077 6869 6368 2077 6520 6e65 6564 2069 which we need i │ │ │ │ +00113940: 6e20 7468 6520 6361 6c6c 6261 636b 7329 n the callbacks) │ │ │ │ +00113950: 203c 2f73 7061 6e3e 3c2f 6469 763e 0a3c
    .< │ │ │ │ +00113960: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00113970: 3e20 2020 2069 6d61 6765 2e5f 5f73 697a > image.__siz │ │ │ │ +00113980: 6520 3d20 7362 2e73 745f 7369 7a65 3b20 e = sb.st_size; │ │ │ │ +00113990: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // must se │ │ │ │ +001139b0: 7420 7369 7a65 203c 2f73 7061 6e3e 3c2f t size .
    }
    .
    │ │ │ │ +00113a10: 656c 7365 3c2f 7370 616e 3e20 3c2f 6469 else .
    {
    .< │ │ │ │ +00113a40: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00113a50: 3e20 2020 203c 7370 616e 2063 6c61 7373 > // do │ │ │ │ +00113a70: 6e26 2333 393b 7420 6b6e 6f77 2074 6865 n't know the │ │ │ │ +00113a80: 2073 697a 652c 2073 6f20 6275 6666 6572 size, so buffer │ │ │ │ +00113a90: 2069 7420 3c2f 7370 616e 3e3c 2f64 6976 it
    .
    size_t │ │ │ │ +00113ae0: 693b 203c 2f64 6976 3e0a 3c64 6976 2063 i;
    .
    │ │ │ │ +00113b00: 3c73 7061 6e20 636c 6173 733d 226b 6579 int c;
    .< │ │ │ │ +00113b30: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00113b40: 3e20 2020 2069 6d61 6765 2e5f 5f70 7472 > image.__ptr │ │ │ │ +00113b50: 203d 2028 3c73 7061 6e20 636c 6173 733d = (un │ │ │ │ +00113b70: 7369 676e 6564 3c2f 7370 616e 3e20 3c73 signed char*)soap_m │ │ │ │ +00113c00: 616c 6c6f 633c 2f61 3e28 2661 6d70 3b3c alloc(&< │ │ │ │ +00113c10: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +00113c20: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ +00113c30: 6874 6d6c 223e 736f 6170 3c2f 613e 2c20 html">soap, │ │ │ │ +00113c40: 4d41 585f 4649 4c45 5f53 495a 4529 3b20 MAX_FILE_SIZE); │ │ │ │ +00113c50: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    for (i = 0; i < │ │ │ │ +00113ca0: 204d 4158 5f46 494c 455f 5349 5a45 3b20 MAX_FILE_SIZE; │ │ │ │ +00113cb0: 692b 2b29 203c 2f64 6976 3e0a 3c64 6976 i++)
    .
    │ │ │ │ +00113cd0: 2020 7b3c 2f64 6976 3e0a 3c64 6976 2063 {
    .
    │ │ │ │ +00113cf0: 2020 3c73 7061 6e20 636c 6173 733d 226b if ((c = fget │ │ │ │ +00113d20: 6328 6664 2929 203d 3d20 454f 4629 203c c(fd)) == EOF) < │ │ │ │ +00113d30: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    │ │ │ │ +00113d50: 3c73 7061 6e20 636c 6173 733d 226b 6579 break< │ │ │ │ +00113d70: 2f73 7061 6e3e 3b20 3c2f 6469 763e 0a3c /span>;
    .< │ │ │ │ +00113d80: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00113d90: 3e20 2020 2020 2069 6d61 6765 2e5f 5f70 > image.__p │ │ │ │ +00113da0: 7472 5b69 5d20 3d20 633b 203c 2f64 6976 tr[i] = c;
    .
    }
    │ │ │ │ +00113dd0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    fclose(fd │ │ │ │ +00113df0: 293b 203c 2f64 6976 3e0a 3c64 6976 2063 );
    .
    │ │ │ │ +00113e10: 696d 6167 652e 5f5f 7369 7a65 203d 2069 image.__size = i │ │ │ │ +00113e20: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
    .
    } < │ │ │ │ +00113e40: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    image. │ │ │ │ +00113e60: 7479 7065 203d 203c 7370 616e 2063 6c61 type = "image/j │ │ │ │ +00113e90: 7065 6726 7175 6f74 3b3c 2f73 7061 6e3e peg" │ │ │ │ +00113ea0: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
    .
    ima │ │ │ │ +00113ec0: 6765 2e6f 7074 696f 6e73 203d 203c 6120 ge.options = s │ │ │ │ +00113f20: 6f61 705f 6469 6d65 5f6f 7074 696f 6e3c oap_dime_option< │ │ │ │ +00113f30: 2f61 3e28 2661 6d70 3b3c 6120 636c 6173 /a>(& │ │ │ │ +00113f60: 736f 6170 3c2f 613e 2c20 302c 203c 7370 soap, 0, "M │ │ │ │ +00113f90: 7920 7069 6374 7572 6526 7175 6f74 3b3c y picture"< │ │ │ │ +00113fa0: 2f73 7061 6e3e 293b 203c 2f64 6976 3e0a /span>);
    . │ │ │ │ +00113fb0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    if │ │ │ │ +00113fe0: 3c2f 7370 616e 3e20 2873 6f61 705f 6361 (soap_ca │ │ │ │ +00113ff0: 6c6c 5f6e 735f 5f77 6562 6d65 7468 6f64 ll_ns__webmethod │ │ │ │ +00114000: 2826 616d 703b 3c61 2063 6c61 7373 3d22 (&soa │ │ │ │ +00114030: 703c 2f61 3e2c 202e 2e2e 2929 3c2f 6469 p, ...)).
    ... // error
    .
    else
    .
    . │ │ │ │ +001140e0: 2e2e 203c 7370 616e 2063 6c61 7373 3d22 .. // succ │ │ │ │ +00114100: 6573 733c 2f73 7061 6e3e 3c2f 6469 763e ess
    │ │ │ │ +00114110: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    }
    .
    < │ │ │ │ +00114140: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>..
    {< │ │ │ │ +00114370: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    return handle;
    │ │ │ │ +001143c0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    }
    .
    < │ │ │ │ +001143f0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>..
    {.
    fclose(( │ │ │ │ +00114530: 4649 4c45 2a29 6861 6e64 6c65 293b 203c FILE*)handle); < │ │ │ │ +00114540: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    }
    │ │ │ │ +00114560: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    .
    size_t dime_read(< │ │ │ │ +001145c0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +001145d0: 6f72 6422 3e73 7472 7563 743c 2f73 7061 ord">struct soap *soap< │ │ │ │ +00114640: 2f61 3e2c 203c 7370 616e 2063 6c61 7373 /a>, v │ │ │ │ +00114660: 6f69 643c 2f73 7061 6e3e 202a 6861 6e64 oid *hand │ │ │ │ +00114670: 6c65 2c20 3c73 7061 6e20 636c 6173 733d le, ch │ │ │ │ +00114690: 6172 3c2f 7370 616e 3e20 2a62 7566 2c20 ar *buf, │ │ │ │ +001146a0: 3c73 7061 6e20 636c 6173 733d 226b 6579 size_t │ │ │ │ +001146c0: 3c2f 7370 616e 3e20 6c65 6e29 203c 2f64 len) .
    {
    . │ │ │ │ +00114700: 2020 3c73 7061 6e20 636c 6173 733d 226b retu │ │ │ │ +00114720: 726e 3c2f 7370 616e 3e20 6672 6561 6428 rn fread( │ │ │ │ +00114730: 6275 662c 2031 2c20 6c65 6e2c 2028 4649 buf, 1, len, (FI │ │ │ │ +00114740: 4c45 2a29 6861 6e64 6c65 293b 203c 2f64 LE*)handle); .
    }
    .
    │ │ │ │ +00114840: 3c64 6976 2063 6c61 7373 3d22 7474 6465
    void *(* fdi │ │ │ │ +00114860: 6d65 7265 6164 6f70 656e 2928 7374 7275 mereadopen)(stru │ │ │ │ +00114870: 6374 2073 6f61 7020 2a73 6f61 702c 2076 ct soap *soap, v │ │ │ │ +00114880: 6f69 6420 2a68 616e 646c 652c 2063 6f6e oid *handle, con │ │ │ │ +00114890: 7374 2063 6861 7220 2a69 642c 2063 6f6e st char *id, con │ │ │ │ +001148a0: 7374 2063 6861 7220 2a74 7970 652c 2063 st char *type, c │ │ │ │ +001148b0: 6f6e 7374 2063 6861 7220 2a6f 7074 696f onst char *optio │ │ │ │ +001148c0: 6e73 293c 2f64 6976 3e3c 6469 7620 636c ns)
    Call │ │ │ │ +001148e0: 6261 636b 2074 6f20 6f70 656e 2061 2073 back to open a s │ │ │ │ +001148f0: 7472 6561 6d69 6e67 2044 494d 4520 6174 treaming DIME at │ │ │ │ +00114900: 7461 6368 6d65 6e74 2066 6f72 2072 6561 tachment for rea │ │ │ │ +00114910: 6469 6e67 2e3c 2f64 6976 3e3c 6469 7620 ding.
    Definition: │ │ │ │ +00114940: 2073 7464 736f 6170 322e 683a 3436 3934 stdsoap2.h:4694 │ │ │ │ +00114950: 3c2f 6469 763e 3c2f 6469 763e 0a3c 6469
    . │ │ │ │ +00114a30: 3c64 6976 2063 6c61 7373 3d22 7474 6465
    void(* fdime │ │ │ │ +00114a50: 7265 6164 636c 6f73 6529 2873 7472 7563 readclose)(struc │ │ │ │ +00114a60: 7420 736f 6170 202a 736f 6170 2c20 766f t soap *soap, vo │ │ │ │ +00114a70: 6964 202a 6861 6e64 6c65 293c 2f64 6976 id *handle)
    Callback to │ │ │ │ +00114aa0: 636c 6f73 6520 6120 4449 4d45 2061 7474 close a DIME att │ │ │ │ +00114ab0: 6163 686d 656e 7420 7374 7265 616d 2061 achment stream a │ │ │ │ +00114ac0: 6674 6572 2072 6561 6469 6e67 2e3c 2f64 fter reading.
    Definit │ │ │ │ +00114af0: 696f 6e3a 3c2f 623e 2073 7464 736f 6170 ion: stdsoap │ │ │ │ +00114b00: 322e 683a 3437 3339 3c2f 6469 763e 3c2f 2.h:4739
    .
    │ │ │ │ +00114b80: 3c61 2068 7265 663d 2267 726f 7570 5f5f soap:: │ │ │ │ +00114bd0: 6664 696d 6572 6561 643c 2f61 3e3c 2f64 fdimeread
    size_t(* │ │ │ │ +00114c00: 6664 696d 6572 6561 6429 2873 7472 7563 fdimeread)(struc │ │ │ │ +00114c10: 7420 736f 6170 202a 736f 6170 2c20 766f t soap *soap, vo │ │ │ │ +00114c20: 6964 202a 6861 6e64 6c65 2c20 6368 6172 id *handle, char │ │ │ │ +00114c30: 202a 6275 662c 2073 697a 655f 7420 6c65 *buf, size_t le │ │ │ │ +00114c40: 6e29 3c2f 6469 763e 3c64 6976 2063 6c61 n)
    Callb │ │ │ │ +00114c60: 6163 6b20 746f 2072 6561 6420 6461 7461 ack to read data │ │ │ │ +00114c70: 2069 6e20 6120 4449 4d45 2061 7474 6163 in a DIME attac │ │ │ │ +00114c80: 686d 656e 7420 7374 7265 616d 2e3c 2f64 hment stream.
    Definit │ │ │ │ +00114cb0: 696f 6e3a 3c2f 623e 2073 7464 736f 6170 ion: stdsoap │ │ │ │ +00114cc0: 322e 683a 3437 3234 3c2f 6469 763e 3c2f 2.h:4724
    .
    v │ │ │ │ +00114db0: 6f69 6420 2a20 736f 6170 5f6d 616c 6c6f oid * soap_mallo │ │ │ │ +00114dc0: 6328 7374 7275 6374 2073 6f61 7020 2a73 c(struct soap *s │ │ │ │ +00114dd0: 6f61 702c 2073 697a 655f 7420 6c65 6e29 oap, size_t len) │ │ │ │ +00114de0: 3c2f 6469 763e 3c64 6976 2063 6c61 7373
    Allocat │ │ │ │ +00114e00: 6520 6120 626c 6f63 6b20 6f66 2068 6561 e a block of hea │ │ │ │ +00114e10: 7020 6d65 6d6f 7279 206d 616e 6167 6564 p memory managed │ │ │ │ +00114e20: 2062 7920 7468 6520 7370 6563 6966 6965 by the specifie │ │ │ │ +00114e30: 6420 736f 6170 2063 6f6e 7465 7874 2e3c d soap context.< │ │ │ │ +00114e40: 2f64 6976 3e3c 2f64 6976 3e0a 3c2f 6469 /div>
    .

    The follow │ │ │ │ +00114e70: 696e 6720 6578 616d 706c 6520 696c 6c75 ing example illu │ │ │ │ +00114e80: 7374 7261 7465 7320 7468 6520 7374 7265 strates the stre │ │ │ │ +00114e90: 616d 696e 6720 6f66 2061 2044 494d 4520 aming of a DIME │ │ │ │ +00114ea0: 6174 7461 6368 6d65 6e74 2069 6e74 6f20 attachment into │ │ │ │ +00114eb0: 6120 6669 6c65 2062 7920 6120 636c 6965 a file by a clie │ │ │ │ +00114ec0: 6e74 3a3c 2f70 3e0a 3c64 6976 2063 6c61 nt:

    .
    │ │ │ │ +00114ef0: 3c73 7061 6e20 636c 6173 733d 226b 6579 int main() .
    {
    . │ │ │ │ +00114f50: 203c 7370 616e 2063 6c61 7373 3d22 6b65 struct soap │ │ │ │ +00114fa0: 3c2f 613e 203c 6120 636c 6173 733d 2263 soap │ │ │ │ +00114fd0: 3c2f 613e 3b20 3c2f 6469 763e 0a3c 6469 ;
    . │ │ │ │ +00114ff0: 203c 6120 636c 6173 733d 2263 6f64 6522 soap_init< │ │ │ │ +00115050: 2f61 3e28 2661 6d70 3b3c 6120 636c 6173 /a>(& │ │ │ │ +00115080: 736f 6170 3c2f 613e 293b 203c 2f64 6976 soap);
    .
    soa │ │ │ │ +001150d0: 703c 2f61 3e2e 3c61 2063 6c61 7373 3d22 p.fdi │ │ │ │ +00115130: 6d65 7772 6974 656f 7065 6e3c 2f61 3e20 mewriteopen │ │ │ │ +00115140: 3d20 6469 6d65 5f77 7269 7465 5f6f 7065 = dime_write_ope │ │ │ │ +00115150: 6e3b 203c 2f64 6976 3e0a 3c64 6976 2063 n;
    .
    soap.fdimewritec │ │ │ │ +00115200: 6c6f 7365 3c2f 613e 203d 2064 696d 655f lose = dime_ │ │ │ │ +00115210: 7772 6974 655f 636c 6f73 653b 203c 2f64 write_close; .
    s │ │ │ │ +00115260: 6f61 703c 2f61 3e2e 3c61 2063 6c61 7373 oap.f │ │ │ │ +001152c0: 6469 6d65 7772 6974 653c 2f61 3e20 3d20 dimewrite = │ │ │ │ +001152d0: 6469 6d65 5f77 7269 7465 3b20 3c2f 6469 dime_write; .
    if (soap │ │ │ │ +00115320: 5f63 616c 6c5f 6e73 5f5f 7765 626d 6574 _call_ns__webmet │ │ │ │ +00115330: 686f 6428 2661 6d70 3b3c 6120 636c 6173 hod(& │ │ │ │ +00115360: 736f 6170 3c2f 613e 2c20 2e2e 2e29 293c soap, ...))< │ │ │ │ +00115370: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    ... │ │ │ │ +00115390: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // error
    .
    │ │ │ │ +001153d0: 3c73 7061 6e20 636c 6173 733d 226b 6579 else
    .
    │ │ │ │ +00115410: 2020 2e2e 2e20 3c73 7061 6e20 636c 6173 ... // s │ │ │ │ +00115430: 7563 6365 7373 3c2f 7370 616e 3e3c 2f64 uccess.
    }
    .< │ │ │ │ +00115460: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00115470: 3e20 3c2f 6469 763e 0a3c 6469 7620 636c >
    .
    void │ │ │ │ +001154b0: 202a 6469 6d65 5f77 7269 7465 5f6f 7065 *dime_write_ope │ │ │ │ +001154c0: 6e28 3c73 7061 6e20 636c 6173 733d 226b n(struct soa │ │ │ │ +00115510: 703c 2f61 3e20 2a3c 6120 636c 6173 733d p *so │ │ │ │ +00115540: 6170 3c2f 613e 2c20 3c73 7061 6e20 636c ap, co │ │ │ │ +00115560: 6e73 743c 2f73 7061 6e3e 203c 7370 616e nst char │ │ │ │ +00115590: 202a 3c73 7061 6e20 636c 6173 733d 226b *id, con │ │ │ │ +001155d0: 7374 3c2f 7370 616e 3e20 3c73 7061 6e20 st char │ │ │ │ +00115600: 2a74 7970 652c 203c 7370 616e 2063 6c61 *type, con │ │ │ │ +00115620: 7374 3c2f 7370 616e 3e20 3c73 7061 6e20 st char │ │ │ │ +00115650: 2a6f 7074 696f 6e73 2920 3c2f 6469 763e *options)
    │ │ │ │ +00115660: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    {
    .
    F │ │ │ │ +00115690: 494c 4520 2a68 616e 646c 6520 3d20 3c61 ILE *handle = fopen(< │ │ │ │ +00115700: 7370 616e 2063 6c61 7373 3d22 7374 7269 span class="stri │ │ │ │ +00115710: 6e67 6c69 7465 7261 6c22 3e26 7175 6f74 ngliteral">" │ │ │ │ +00115720: 3b73 6f6d 6566 696c 6526 7175 6f74 3b3c ;somefile"< │ │ │ │ +00115730: 2f73 7061 6e3e 2c20 3c73 7061 6e20 636c /span>, "wb&quo │ │ │ │ +00115760: 743b 3c2f 7370 616e 3e29 3b20 3c2f 6469 t;); .
    if (!han │ │ │ │ +001157b0: 646c 6529 203c 2f64 6976 3e0a 3c64 6976 dle)
    .
    │ │ │ │ +001157d0: 7b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 {
    .. │ │ │ │ +001158e0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    soa │ │ │ │ +00115920: 703c 2f61 3e2d 2667 743b 3c61 2063 6c61 p->errnum = │ │ │ │ +00115980: 6572 726e 6f3b 203c 7370 616e 2063 6c61 errno; // │ │ │ │ +001159a0: 6765 7420 7265 6173 6f6e 203c 2f73 7061 get reason
    .
    } < │ │ │ │ +001159d0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    return (voi │ │ │ │ +00115a30: 643c 2f73 7061 6e3e 2a29 6861 6e64 6c65 d*)handle │ │ │ │ +00115a40: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
    .
    } .
    . │ │ │ │ +00115a90: 3c73 7061 6e20 636c 6173 733d 226b 6579 void dime_write │ │ │ │ +00115ac0: 5f63 6c6f 7365 283c 7370 616e 2063 6c61 _close(str │ │ │ │ +00115ae0: 7563 743c 2f73 7061 6e3e 203c 6120 636c uct soap *soap, void *handle) .
    {
    . │ │ │ │ +00115bb0: 203c 6120 636c 6173 733d 2263 6f64 6522 fclose((FILE*)handle │ │ │ │ +00115c20: 293b 203c 2f64 6976 3e0a 3c64 6976 2063 );
    .
    } .
    .< │ │ │ │ +00115c60: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00115c70: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >int dime_write │ │ │ │ +00115ca0: 283c 7370 616e 2063 6c61 7373 3d22 6b65 (struct
    soap │ │ │ │ +00115cf0: 3c2f 613e 202a 3c61 2063 6c61 7373 3d22 *soa │ │ │ │ +00115d20: 703c 2f61 3e2c 203c 7370 616e 2063 6c61 p, void *ha │ │ │ │ +00115d50: 6e64 6c65 2c20 3c73 7061 6e20 636c 6173 ndle, cons │ │ │ │ +00115d70: 743c 2f73 7061 6e3e 203c 7370 616e 2063 t char * │ │ │ │ +00115da0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 buf │ │ │ │ +00115df0: 2c20 3c73 7061 6e20 636c 6173 733d 226b , size │ │ │ │ +00115e10: 5f74 3c2f 7370 616e 3e20 6c65 6e29 203c _t len) < │ │ │ │ +00115e20: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    {
    . │ │ │ │ +00115e40: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    si │ │ │ │ +00115e70: 7a65 5f74 3c2f 7370 616e 3e20 6e77 7269 ze_t nwri │ │ │ │ +00115e80: 7474 656e 3b20 3c2f 6469 763e 0a3c 6469 tten;
    . │ │ │ │ +00115ea0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 while │ │ │ │ +00115ec0: 3c2f 7370 616e 3e20 286c 656e 2920 3c2f (len) .
    {
    │ │ │ │ +00115ef0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    nwritten │ │ │ │ +00115f10: 3d20 6677 7269 7465 283c 6120 636c 6173 = fwrite(buf, 1, le │ │ │ │ +00115f70: 6e2c 2028 4649 4c45 2a29 6861 6e64 6c65 n, (FILE*)handle │ │ │ │ +00115f80: 293b 203c 2f64 6976 3e0a 3c64 6976 2063 );
    .
    │ │ │ │ +00115fa0: 3c73 7061 6e20 636c 6173 733d 226b 6579 if (!nwritten) │ │ │ │ +00115fd0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    {.
    soap-> │ │ │ │ +00116040: 3b3c 6120 636c 6173 733d 2263 6f64 6522 ;errnum │ │ │ │ +00116090: 3c2f 613e 203d 2065 7272 6e6f 3b20 3c73 = errno; // get reaso │ │ │ │ +001160c0: 6e20 3c2f 7370 616e 3e3c 2f64 6976 3e0a n
    . │ │ │ │ +001160d0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    return │ │ │ │ +00116110: 3c61 2063 6c61 7373 3d22 636f 6465 2220 SOAP_EOF │ │ │ │ +00116170: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
    .
    } │ │ │ │ +00116190: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    le │ │ │ │ +001161b0: 6e20 2d3d 206e 7772 6974 7465 6e3b 203c n -= nwritten; < │ │ │ │ +001161c0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    buf += │ │ │ │ +00116230: 6e77 7269 7474 656e 3b20 3c2f 6469 763e nwritten;
    │ │ │ │ +00116240: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    }
    . │ │ │ │ +00116270: 2020 3c73 7061 6e20 636c 6173 733d 226b retu │ │ │ │ +00116290: 726e 3c2f 7370 616e 3e20 3c61 2063 6c61 rn SO │ │ │ │ +001162f0: 4150 5f4f 4b3c 2f61 3e3b 203c 2f64 6976 AP_OK;
    .
    }
    .
    i │ │ │ │ +00116400: 6e74 282a 2066 6469 6d65 7772 6974 6529 nt(* fdimewrite) │ │ │ │ +00116410: 2873 7472 7563 7420 736f 6170 202a 736f (struct soap *so │ │ │ │ +00116420: 6170 2c20 766f 6964 202a 2c20 636f 6e73 ap, void *, cons │ │ │ │ +00116430: 7420 6368 6172 202a 2c20 7369 7a65 5f74 t char *, size_t │ │ │ │ +00116440: 293c 2f64 6976 3e3c 6469 7620 636c 6173 )
    Callba │ │ │ │ +00116460: 636b 2074 6f20 7772 6974 6520 6461 7461 ck to write data │ │ │ │ +00116470: 2069 6e20 6120 4449 4d45 2061 7474 6163 in a DIME attac │ │ │ │ +00116480: 686d 656e 7420 7374 7265 616d 2e3c 2f64 hment stream.
    Definit │ │ │ │ +001164b0: 696f 6e3a 3c2f 623e 2073 7464 736f 6170 ion: stdsoap │ │ │ │ +001164c0: 322e 683a 3438 3232 3c2f 6469 763e 3c2f 2.h:4822
    .
    .< │ │ │ │ +00116690: 6469 7620 636c 6173 733d 2274 7463 2220 div class="ttc" │ │ │ │ +001166a0: 6964 3d22 6167 726f 7570 5f5f 6772 6f75 id="agroup__grou │ │ │ │ +001166b0: 705f 5f63 616c 6c62 6163 6b73 5f68 746d p__callbacks_htm │ │ │ │ +001166c0: 6c5f 6761 3362 3165 3461 6130 3436 6236 l_ga3b1e4aa046b6 │ │ │ │ +001166d0: 3833 3533 3531 3130 6133 3466 6334 3661 83535110a34fc46a │ │ │ │ +001166e0: 6231 6562 223e 3c64 6976 2063 6c61 7373 b1eb">
    soap::fdimew │ │ │ │ +00116750: 7269 7465 6f70 656e 3c2f 613e 3c2f 6469 riteopen
    void *(* f │ │ │ │ +00116780: 6469 6d65 7772 6974 656f 7065 6e29 2873 dimewriteopen)(s │ │ │ │ +00116790: 7472 7563 7420 736f 6170 202a 736f 6170 truct soap *soap │ │ │ │ +001167a0: 2c20 636f 6e73 7420 6368 6172 202a 6964 , const char *id │ │ │ │ +001167b0: 2c20 636f 6e73 7420 6368 6172 202a 7479 , const char *ty │ │ │ │ +001167c0: 7065 2c20 636f 6e73 7420 6368 6172 202a pe, const char * │ │ │ │ +001167d0: 6f70 7469 6f6e 7329 3c2f 6469 763e 3c64 options)
    Callback to ope │ │ │ │ +00116800: 6e20 6120 7374 7265 616d 696e 6720 4449 n a streaming DI │ │ │ │ +00116810: 4d45 2061 7474 6163 686d 656e 7420 666f ME attachment fo │ │ │ │ +00116820: 7220 7772 6974 696e 672e 3c2f 6469 763e r writing.
    │ │ │ │ +00116830: 3c64 6976 2063 6c61 7373 3d22 7474 6465
    Definition │ │ │ │ +00116850: 3a3c 2f62 3e20 7374 6473 6f61 7032 2e68 : stdsoap2.h │ │ │ │ +00116860: 3a34 3831 303c 2f64 6976 3e3c 2f64 6976 :4810
    .
    │ │ │ │ +00116950: 534f 4150 5f53 4f43 4b45 5428 2a20 666f SOAP_SOCKET(* fo │ │ │ │ +00116960: 7065 6e29 2873 7472 7563 7420 736f 6170 pen)(struct soap │ │ │ │ +00116970: 202a 736f 6170 2c20 636f 6e73 7420 6368 *soap, const ch │ │ │ │ +00116980: 6172 202a 656e 6470 6f69 6e74 2c20 636f ar *endpoint, co │ │ │ │ +00116990: 6e73 7420 6368 6172 202a 686f 7374 2c20 nst char *host, │ │ │ │ +001169a0: 696e 7420 706f 7274 293c 2f64 6976 3e3c int port)
    < │ │ │ │ +001169b0: 6469 7620 636c 6173 733d 2274 7464 6f63 div class="ttdoc │ │ │ │ +001169c0: 223e 4361 6c6c 6261 636b 2074 6861 7420 ">Callback that │ │ │ │ +001169d0: 6f70 656e 7320 6120 736f 636b 6574 2063 opens a socket c │ │ │ │ +001169e0: 6f6e 6e65 6374 696f 6e20 746f 2061 2073 onnection to a s │ │ │ │ +001169f0: 6572 7665 7220 656e 6470 6f69 6e74 2e3c erver endpoint.< │ │ │ │ +00116a00: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
    Defin │ │ │ │ +00116a20: 6974 696f 6e3a 3c2f 623e 2073 7464 736f ition: stdso │ │ │ │ +00116a30: 6170 322e 683a 3434 3935 3c2f 6469 763e ap2.h:4495
    │ │ │ │ +00116a40: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    soap │ │ │ │ +00116b00: 3a3a 6663 6c6f 7365 3c2f 613e 3c2f 6469 ::fclose
    int(* fclo │ │ │ │ +00116b30: 7365 2928 7374 7275 6374 2073 6f61 7020 se)(struct soap │ │ │ │ +00116b40: 2a73 6f61 7029 3c2f 6469 763e 3c64 6976 *soap)
    C │ │ │ │ +00116b60: 616c 6c62 6163 6b20 7468 6174 2063 6c6f allback that clo │ │ │ │ +00116b70: 7365 7320 7468 6520 6375 7272 656e 7420 ses the current │ │ │ │ +00116b80: 736f 636b 6574 2063 6f6e 6e65 6374 696f socket connectio │ │ │ │ +00116b90: 6e2e 3c2f 6469 763e 3c64 6976 2063 6c61 n.
    De │ │ │ │ +00116bb0: 6669 6e69 7469 6f6e 3a3c 2f62 3e20 7374 finition: st │ │ │ │ +00116bc0: 6473 6f61 7032 2e68 3a34 3532 303c 2f64 dsoap2.h:4520
    .
    # │ │ │ │ +00116cb0: 6465 6669 6e65 2053 4f41 505f 454f 463c define SOAP_EOF< │ │ │ │ +00116cc0: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
    A soap_s │ │ │ │ +00116ce0: 7461 7475 7320 6572 726f 7220 636f 6465 tatus error code │ │ │ │ +00116cf0: 3a20 756e 6578 7065 6374 6564 2065 6e64 : unexpected end │ │ │ │ +00116d00: 206f 6620 6669 6c65 2c20 6e6f 2069 6e70 of file, no inp │ │ │ │ +00116d10: 7574 2c20 7472 616e 736d 6973 7369 6f6e ut, transmission │ │ │ │ +00116d20: 2069 6e74 6572 7275 7074 6564 206f 7220 interrupted or │ │ │ │ +00116d30: 7469 6d65 6420 6f75 7420 2873 612e 2e2e timed out (sa... │ │ │ │ +00116d40: 3c2f 6469 763e 3c64 6976 2063 6c61 7373
    Defi │ │ │ │ +00116d60: 6e69 7469 6f6e 3a3c 2f62 3e20 7374 6473 nition: stds │ │ │ │ +00116d70: 6f61 7032 2e68 3a32 3336 353c 2f64 6976 oap2.h:2365
    .
    < │ │ │ │ +00116da0: 703e 4d65 7373 6167 6520 636f 6d70 7265 p>Message compre │ │ │ │ +00116db0: 7373 696f 6e20 7769 7468 203c 636f 6465 ssion with #SOAP_ENC_ZLIB< │ │ │ │ +00116dd0: 2f63 6f64 653e 2063 616e 2062 6520 7573 /code> can be us │ │ │ │ +00116de0: 6564 2077 6974 6820 4449 4d45 2074 6f20 ed with DIME to │ │ │ │ +00116df0: 636f 6d70 7265 7373 2074 6865 2065 6e74 compress the ent │ │ │ │ +00116e00: 6972 6520 6d65 7373 6167 652e 2048 6f77 ire message. How │ │ │ │ +00116e10: 6576 6572 2c20 636f 6d70 7265 7373 696f ever, compressio │ │ │ │ +00116e20: 6e20 7265 7175 6972 6573 2062 7566 6665 n requires buffe │ │ │ │ +00116e30: 7269 6e67 2074 6f20 6465 7465 726d 696e ring to determin │ │ │ │ +00116e40: 6520 7468 6520 4854 5450 2063 6f6e 7465 e the HTTP conte │ │ │ │ +00116e50: 6e74 206c 656e 6774 6820 6865 6164 6572 nt length header │ │ │ │ +00116e60: 2c20 7768 6963 6820 6361 6e63 656c 7320 , which cancels │ │ │ │ +00116e70: 7468 6520 6265 6e65 6669 7473 206f 6620 the benefits of │ │ │ │ +00116e80: 7374 7265 616d 696e 6720 4449 4d45 2e20 streaming DIME. │ │ │ │ +00116e90: 546f 2061 766f 6964 2074 6869 732c 2079 To avoid this, y │ │ │ │ +00116ea0: 6f75 2073 686f 756c 6420 7573 6520 6368 ou should use ch │ │ │ │ +00116eb0: 756e 6b65 6420 4854 5450 2028 7769 7468 unked HTTP (with │ │ │ │ +00116ec0: 2074 6865 206f 7574 7075 742d 6d6f 6465 the output-mode │ │ │ │ +00116ed0: 203c 636f 6465 3e23 534f 4150 5f49 4f5f #SOAP_IO_ │ │ │ │ +00116ee0: 4348 554e 4b3c 2f63 6f64 653e 2066 6c61 CHUNK fla │ │ │ │ +00116ef0: 6729 2077 6974 6820 636f 6d70 7265 7373 g) with compress │ │ │ │ +00116f00: 696f 6e20 616e 6420 7374 7265 616d 696e ion and streamin │ │ │ │ +00116f10: 6720 4449 4d45 2e20 4174 2074 6865 2073 g DIME. At the s │ │ │ │ +00116f20: 6572 7665 7220 7369 6465 2c20 7768 656e erver side, when │ │ │ │ +00116f30: 2079 6f75 2073 6574 203c 636f 6465 3e23 you set # │ │ │ │ +00116f40: 534f 4150 5f49 4f5f 4348 554e 4b3c 2f63 SOAP_IO_CHUNK before call │ │ │ │ +00116f60: 696e 6720 3c63 6f64 653e 3c61 2063 6c61 ing soap_se │ │ │ │ +00116fe0: 7276 653c 2f61 3e3c 2f63 6f64 653e 2c20 rve, │ │ │ │ +00116ff0: 7468 6520 656e 6769 6e65 2077 696c 6c20 the engine will │ │ │ │ +00117000: 6175 746f 6d61 7469 6361 6c6c 7920 7265 automatically re │ │ │ │ +00117010: 7665 7274 2074 6f20 6275 6666 6572 696e vert to bufferin │ │ │ │ +00117020: 6720 283c 636f 6465 3e23 534f 4150 5f49 g (#SOAP_I │ │ │ │ +00117030: 4f5f 5354 4f52 453c 2f63 6f64 653e 2066 O_STORE f │ │ │ │ +00117040: 6c61 6720 6973 2073 6574 292e 2059 6f75 lag is set). You │ │ │ │ +00117050: 2063 616e 2063 6865 636b 2074 6869 7320 can check this │ │ │ │ +00117060: 666c 6167 2077 6974 6820 3c63 6f64 653e flag with │ │ │ │ +00117070: 2873 6f61 702d 2667 743b 6f6d 6f64 6520 (soap->omode │ │ │ │ +00117080: 2661 6d70 3b20 534f 4150 5f49 4f29 203d & SOAP_IO) = │ │ │ │ +00117090: 3d20 534f 4150 5f49 4f5f 4348 554e 4b3c = SOAP_IO_CHUNK< │ │ │ │ +001170a0: 2f63 6f64 653e 2074 6f20 7365 6520 6966 /code> to see if │ │ │ │ +001170b0: 2074 6865 2063 6c69 656e 7420 6163 6365 the client acce │ │ │ │ +001170c0: 7074 7320 6368 756e 6b69 6e67 2e20 4d6f pts chunking. Mo │ │ │ │ +001170d0: 7265 2069 6e66 6f72 6d61 7469 6f6e 2061 re information a │ │ │ │ +001170e0: 626f 7574 2073 7472 6561 6d69 6e67 2063 bout streaming c │ │ │ │ +001170f0: 6875 6e6b 6564 2044 494d 4520 6361 6e20 hunked DIME can │ │ │ │ +00117100: 6265 2066 6f75 6e64 2069 6e20 5365 6374 be found in Sect │ │ │ │ +00117110: 696f 6e20 3c61 2063 6c61 7373 3d22 656c ion Streaming chunk │ │ │ │ +00117150: 6564 2044 494d 453c 2f61 3e20 2e3c 2f70 ed DIME .

    .
    WarningThe opti │ │ │ │ +001171a0: 6f6e 733c 2f63 6f64 653e 206d 656d 6265 ons membe │ │ │ │ +001171b0: 7220 6973 2061 2044 494d 452d 7370 6563 r is a DIME-spec │ │ │ │ +001171c0: 6966 6963 2064 6174 6120 7374 7275 6374 ific data struct │ │ │ │ +001171d0: 7572 652c 2063 6f6e 7369 7374 696e 6720 ure, consisting │ │ │ │ +001171e0: 6f66 2061 2034 2062 7974 6520 6865 6164 of a 4 byte head │ │ │ │ +001171f0: 6572 2063 6f6e 7461 696e 696e 6720 7468 er containing th │ │ │ │ +00117200: 6520 6f70 7469 6f6e 2074 7970 6520 696e e option type in │ │ │ │ +00117210: 666f 2028 6869 2062 7974 652c 206c 6f20 fo (hi byte, lo │ │ │ │ +00117220: 6279 7465 292c 206f 7074 696f 6e20 7374 byte), option st │ │ │ │ +00117230: 7269 6e67 206c 656e 6774 6820 2868 6920 ring length (hi │ │ │ │ +00117240: 6279 7465 2c20 6c6f 2062 7974 6529 2c20 byte, lo byte), │ │ │ │ +00117250: 666f 6c6c 6f77 6564 2062 7920 6120 6e6f followed by a no │ │ │ │ +00117260: 6e2d 275c 3027 2074 6572 6d69 6e61 7465 n-'\0' terminate │ │ │ │ +00117270: 6420 7374 7269 6e67 2e20 5468 6520 4449 d string. The DI │ │ │ │ +00117280: 4d45 2068 616e 646c 6572 2072 6563 6f67 ME handler recog │ │ │ │ +00117290: 6e69 7a65 7320 6f6e 6520 6f70 7469 6f6e nizes one option │ │ │ │ +001172a0: 2061 7420 6d6f 7374 2e3c 2f64 643e 3c2f at most..

    .... Back to │ │ │ │ +001172d0: 7461 626c 6520 6f66 2063 6f6e 7465 6e74 table of content │ │ │ │ +001172e0: 733c 2f61 3e3c 2f70 3e0a 3c68 323e 3c61 s

    .

    .Streaming │ │ │ │ +00117320: 2063 6875 6e6b 6564 2044 494d 453c 2f68 chunked DIME.

    To send DI │ │ │ │ +00117340: 4d45 2061 7474 6163 686d 656e 7473 2c20 ME attachments, │ │ │ │ +00117350: 7468 6520 6174 7461 6368 6d65 6e74 2073 the attachment s │ │ │ │ +00117360: 697a 6573 206d 7573 7420 6265 2064 6574 izes must be det │ │ │ │ +00117370: 6572 6d69 6e65 6420 696e 2061 6476 616e ermined in advan │ │ │ │ +00117380: 6365 2074 6f20 6361 6c63 756c 6174 6520 ce to calculate │ │ │ │ +00117390: 4854 5450 206d 6573 7361 6765 206c 656e HTTP message len │ │ │ │ +001173a0: 6774 6820 7265 7175 6972 6564 2074 6f20 gth required to │ │ │ │ +001173b0: 7374 7265 616d 2044 494d 4520 6f76 6572 stream DIME over │ │ │ │ +001173c0: 2048 5454 502e 2048 6f77 6576 6572 2c20 HTTP. However, │ │ │ │ +001173d0: 6368 756e 6b65 6420 4449 4d45 2074 6f67 chunked DIME tog │ │ │ │ +001173e0: 6574 6865 7220 7769 7468 2063 6875 6e6b ether with chunk │ │ │ │ +001173f0: 6564 2048 5454 5020 6361 6e20 6265 2075 ed HTTP can be u │ │ │ │ +00117400: 7365 6420 746f 206f 6d69 7420 7468 6973 sed to omit this │ │ │ │ +00117410: 2073 7465 702e 2046 6972 7374 2073 6574 step. First set │ │ │ │ +00117420: 2074 6865 203c 636f 6465 3e23 534f 4150 the #SOAP │ │ │ │ +00117430: 5f49 4f5f 4348 554e 4b3c 2f63 6f64 653e _IO_CHUNK │ │ │ │ +00117440: 2066 6c61 672e 2054 6865 6e2c 2074 6f20 flag. Then, to │ │ │ │ +00117450: 7374 7265 616d 2063 6875 6e6b 6564 2044 stream chunked D │ │ │ │ +00117460: 494d 452c 2073 6574 2074 6865 203c 636f IME, set the __size │ │ │ │ +00117480: 206d 656d 6265 7220 6f66 2061 6e20 6174 member of an at │ │ │ │ +00117490: 7461 6368 6d65 6e74 2074 6f20 7a65 726f tachment to zero │ │ │ │ +001174a0: 2061 6e64 2065 6e61 626c 6520 4449 4d45 and enable DIME │ │ │ │ +001174b0: 2063 6875 6e6b 696e 672e 2054 6865 2044 chunking. The D │ │ │ │ +001174c0: 494d 4520 3c63 6f64 653e 3c61 2063 6c61 IME soap:: │ │ │ │ +00117560: 6664 696d 6572 6561 643c 2f61 3e3c 2f63 fdimeread callback th │ │ │ │ +00117580: 656e 2066 6574 6368 6573 2064 6174 6120 en fetches data │ │ │ │ +00117590: 696e 2063 6875 6e6b 7320 616e 6420 6974 in chunks and it │ │ │ │ +001175a0: 2069 7320 696d 706f 7274 616e 7420 746f is important to │ │ │ │ +001175b0: 2066 696c 6c20 7468 6520 656e 7469 7265 fill the entire │ │ │ │ +001175c0: 2062 7566 6665 7220 756e 6c65 7373 2074 buffer unless t │ │ │ │ +001175d0: 6865 2065 6e64 206f 6620 7468 6520 6461 he end of the da │ │ │ │ +001175e0: 7461 2068 6173 2062 6565 6e20 7265 6163 ta has been reac │ │ │ │ +001175f0: 6865 6420 616e 6420 7468 6520 6c61 7374 hed and the last │ │ │ │ +00117600: 2063 6875 6e6b 2069 7320 746f 2062 6520 chunk is to be │ │ │ │ +00117610: 7365 6e64 2e20 5468 6174 2069 732c 203c send. That is, < │ │ │ │ +00117620: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soap::fdime │ │ │ │ +001176c0: 7265 6164 3c2f 613e 3c2f 636f 6465 3e20 read │ │ │ │ +001176d0: 7368 6f75 6c64 2072 6574 7572 6e20 7468 should return th │ │ │ │ +001176e0: 6520 7661 6c75 6520 6f66 2074 6865 206c e value of the l │ │ │ │ +001176f0: 6173 7420 3c63 6f64 653e 6c65 6e3c 2f63 ast len parameter a │ │ │ │ +00117710: 6e64 2066 696c 6c20 7468 6520 656e 7469 nd fill the enti │ │ │ │ +00117720: 7265 2062 7566 6665 7220 3c63 6f64 653e re buffer │ │ │ │ +00117730: 6275 663c 2f63 6f64 653e 2066 6f72 2061 buf for a │ │ │ │ +00117740: 6c6c 2063 6875 6e6b 7320 6578 6365 7074 ll chunks except │ │ │ │ +00117750: 2074 6865 206c 6173 742e 2046 6f72 2074 the last. For t │ │ │ │ +00117760: 6865 206c 6173 7420 6974 2072 6574 7572 he last it retur │ │ │ │ +00117770: 6e73 2030 2e3c 2f70 3e0a 3c70 3e59 6f75 ns 0.

    .

    You │ │ │ │ +00117780: 2063 616e 2061 6c73 6f20 7573 6520 7468 can also use th │ │ │ │ +00117790: 6520 3c63 6f64 653e 2353 4f41 505f 494f e #SOAP_IO │ │ │ │ +001177a0: 5f53 544f 5245 3c2f 636f 6465 3e20 666c _STORE fl │ │ │ │ +001177b0: 6167 2c20 6275 7420 7468 6174 2063 616e ag, but that can │ │ │ │ +001177c0: 6365 6c73 2074 6865 2062 656e 6566 6974 cels the benefit │ │ │ │ +001177d0: 7320 6f66 2073 7472 6561 6d69 6e67 2044 s of streaming D │ │ │ │ +001177e0: 494d 452e 3c2f 703e 0a3c 703e f09f 949d IME.

    .

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

    .< │ │ │ │ +00117820: 6832 3e3c 6120 636c 6173 733d 2261 6e63 h2>.WSDL bin │ │ │ │ +00117850: 6469 6e67 7320 666f 7220 4449 4d45 2061 dings for DIME a │ │ │ │ +00117860: 7474 6163 686d 656e 7473 3c2f 6832 3e0a ttachments

    . │ │ │ │ +00117870: 3c70 3e54 6865 2077 7364 6c32 6820 746f

    The wsdl2h to │ │ │ │ +00117880: 6f6c 2072 6563 6f67 6e69 7a65 7320 4449 ol recognizes DI │ │ │ │ +00117890: 4d45 2061 7474 6163 686d 656e 7473 2061 ME attachments a │ │ │ │ +001178a0: 6e64 2070 726f 6475 6365 7320 616e 2061 nd produces an a │ │ │ │ +001178b0: 6e6e 6f74 6174 6564 2068 6561 6465 7220 nnotated header │ │ │ │ +001178c0: 6669 6c65 2e20 426f 7468 206f 7065 6e20 file. Both open │ │ │ │ +001178d0: 616e 6420 636c 6f73 6564 206c 6179 6f75 and closed layou │ │ │ │ +001178e0: 7473 2061 7265 2073 7570 706f 7274 6564 ts are supported │ │ │ │ +001178f0: 2066 6f72 2074 7261 6e73 6d69 7474 696e for transmittin │ │ │ │ +00117900: 6720 4449 4d45 2061 7474 6163 686d 656e g DIME attachmen │ │ │ │ +00117910: 7473 2e20 466f 7220 636c 6f73 6564 2066 ts. For closed f │ │ │ │ +00117920: 6f72 6d61 7473 2c20 616c 6c20 4449 4d45 ormats, all DIME │ │ │ │ +00117930: 2061 7474 6163 686d 656e 7473 206d 7573 attachments mus │ │ │ │ +00117940: 7420 6265 2072 6566 6572 656e 6365 6420 t be referenced │ │ │ │ +00117950: 6672 6f6d 2074 6865 2053 4f41 5020 6d65 from the SOAP me │ │ │ │ +00117960: 7373 6167 652c 2065 2e67 2e20 7573 696e ssage, e.g. usin │ │ │ │ +00117970: 6720 6872 6566 7320 7769 7468 2053 4f41 g hrefs with SOA │ │ │ │ +00117980: 5020 656e 636f 6469 6e67 2061 6e64 2075 P encoding and u │ │ │ │ +00117990: 7369 6e67 2074 6865 2061 7070 6c69 6361 sing the applica │ │ │ │ +001179a0: 7469 6f6e 2d73 7065 6369 6669 6320 7265 tion-specific re │ │ │ │ +001179b0: 6665 7265 6e63 6520 6174 7472 6962 7574 ference attribut │ │ │ │ +001179c0: 6520 696e 636c 7564 6564 2069 6e20 7468 e included in th │ │ │ │ +001179d0: 6520 3c63 6f64 653e 3c61 2063 6c61 7373 e xsd__base6 │ │ │ │ +00117a50: 3442 696e 6172 793c 2f61 3e3c 2f63 6f64 4Binary struct or cla │ │ │ │ +00117a70: 7373 2066 6f72 2064 6f63 756d 656e 742f ss for document/ │ │ │ │ +00117a80: 6c69 7465 7261 6c20 6d65 7373 6167 696e literal messagin │ │ │ │ +00117a90: 672e 3c2f 703e 0a3c 703e 5468 6520 736f g.

    .

    The so │ │ │ │ +00117aa0: 6170 6370 7032 2074 6f6f 6c20 646f 6573 apcpp2 tool does │ │ │ │ +00117ab0: 206e 6f74 2070 726f 6475 6365 2061 2057 not produce a W │ │ │ │ +00117ac0: 5344 4c20 7769 7468 2044 494d 4520 6578 SDL with DIME ex │ │ │ │ +00117ad0: 7465 6e73 696f 6e73 2e20 4449 4d45 2069 tensions. DIME i │ │ │ │ +00117ae0: 7320 616e 206f 6c64 6572 2062 696e 6172 s an older binar │ │ │ │ +00117af0: 7920 666f 726d 6174 2074 6861 7420 6861 y format that ha │ │ │ │ +00117b00: 7320 6e6f 2057 5344 4c20 7072 6f74 6f63 s no WSDL protoc │ │ │ │ +00117b10: 6f6c 2073 7570 706f 7274 2c20 756e 6c69 ol support, unli │ │ │ │ +00117b20: 6b65 204d 494d 4520 616e 6420 4d54 4f4d ke MIME and MTOM │ │ │ │ +00117b30: 2e3c 2f70 3e0a 3c70 3ef0 9f94 9d20 3c61 .

    .

    .... Back t │ │ │ │ +00117b50: 6f20 7461 626c 6520 6f66 2063 6f6e 7465 o table of conte │ │ │ │ +00117b60: 6e74 733c 2f61 3e3c 2f70 3e0a 3c68 313e nts

    .

    │ │ │ │ +00117b70: 3c61 2063 6c61 7373 3d22 616e 6368 6f72 │ │ │ │ +00117b90: 0a4d 544f 4d20 6174 7461 6368 6d65 6e74 .MTOM attachment │ │ │ │ +00117ba0: 733c 2f68 313e 0a3c 703e 4d54 4f4d 2028 s

    .

    MTOM ( │ │ │ │ +00117bb0: 4d65 7373 6167 6520 5472 616e 736d 6973 Message Transmis │ │ │ │ +00117bc0: 7369 6f6e 204f 7074 696d 697a 6174 696f sion Optimizatio │ │ │ │ +00117bd0: 6e20 4d65 6368 616e 6973 6d29 2069 7320 n Mechanism) is │ │ │ │ +00117be0: 6120 7265 6c61 7469 7665 6c79 206e 6577 a relatively new │ │ │ │ +00117bf0: 2066 6f72 6d61 7420 666f 7220 7472 616e format for tran │ │ │ │ +00117c00: 736d 6974 7469 6e67 2061 7474 6163 686d smitting attachm │ │ │ │ +00117c10: 656e 7473 2077 6974 6820 534f 4150 206d ents with SOAP m │ │ │ │ +00117c20: 6573 7361 6765 7320 2873 6565 203c 6120 essages (see http://w │ │ │ │ +00117c60: 7777 2e77 332e 6f72 672f 5452 2f73 6f61 ww.w3.org/TR/soa │ │ │ │ +00117c70: 7031 322d 6d74 6f6d 3c2f 613e 292e 204d p12-mtom). M │ │ │ │ +00117c80: 544f 4d20 6174 7461 6368 6d65 6e74 7320 TOM attachments │ │ │ │ +00117c90: 6172 6520 6573 7365 6e74 6961 6c6c 7920 are essentially │ │ │ │ +00117ca0: 4d49 4d45 2061 7474 6163 686d 656e 7473 MIME attachments │ │ │ │ +00117cb0: 2077 6974 6820 7374 616e 6461 7264 697a with standardiz │ │ │ │ +00117cc0: 6564 206d 6563 6861 6e69 736d 7320 666f ed mechanisms fo │ │ │ │ +00117cd0: 7220 6372 6f73 7320 7265 6665 7265 6e63 r cross referenc │ │ │ │ +00117ce0: 696e 6720 6174 7461 6368 6d65 6e74 7320 ing attachments │ │ │ │ +00117cf0: 6672 6f6d 2074 6865 2053 4f41 5020 626f from the SOAP bo │ │ │ │ +00117d00: 6479 2c20 7768 6963 6820 6973 2061 6273 dy, which is abs │ │ │ │ +00117d10: 656e 7420 696e 2028 706c 6169 6e29 204d ent in (plain) M │ │ │ │ +00117d20: 494d 4520 6174 7461 6368 6d65 6e74 7320 IME attachments │ │ │ │ +00117d30: 616e 6420 6f70 7469 6f6e 616c 2077 6974 and optional wit │ │ │ │ +00117d40: 6820 4449 4d45 2061 7474 6163 686d 656e h DIME attachmen │ │ │ │ +00117d50: 7473 2e3c 2f70 3e0a 3c70 3e55 6e6c 696b ts.

    .

    Unlik │ │ │ │ +00117d60: 6520 7468 6520 6e61 6d65 2073 7567 6765 e the name sugge │ │ │ │ +00117d70: 7374 732c 2074 6865 2073 7065 6564 2062 sts, the speed b │ │ │ │ +00117d80: 7920 7768 6963 6820 6174 7461 6368 6564 y which attached │ │ │ │ +00117d90: 2064 6174 6120 6973 2074 7261 6e73 6d69 data is transmi │ │ │ │ +00117da0: 7474 6564 2069 7320 6e6f 7420 696e 6372 tted is not incr │ │ │ │ +00117db0: 6561 7365 6420 636f 6d70 6172 6564 2074 eased compared t │ │ │ │ +00117dc0: 6f20 4d49 4d45 2c20 4449 4d45 2c20 6f72 o MIME, DIME, or │ │ │ │ +00117dd0: 2065 7665 6e20 584d 4c20 656e 636f 6465 even XML encode │ │ │ │ +00117de0: 6420 6261 7365 3634 2064 6174 612c 2062 d base64 data, b │ │ │ │ +00117df0: 6563 6175 7365 2074 6865 2070 6572 666f ecause the perfo │ │ │ │ +00117e00: 726d 616e 6365 2064 6966 6665 7265 6e63 rmance differenc │ │ │ │ +00117e10: 6573 2077 6865 6e20 7573 696e 6720 6753 es when using gS │ │ │ │ +00117e20: 4f41 5020 7769 6c6c 2062 6520 736d 616c OAP will be smal │ │ │ │ +00117e30: 6c2e 2054 6865 2061 6476 616e 7461 6765 l. The advantage │ │ │ │ +00117e40: 206f 6620 7468 6520 666f 726d 6174 2069 of the format i │ │ │ │ +00117e50: 7320 7468 6520 7374 616e 6461 7264 697a s the standardiz │ │ │ │ +00117e60: 6564 2061 7474 6163 686d 656e 7420 7265 ed attachment re │ │ │ │ +00117e70: 6665 7265 6e63 6520 6d65 6368 616e 6973 ference mechanis │ │ │ │ +00117e80: 6d2c 2077 6869 6368 2073 686f 756c 6420 m, which should │ │ │ │ +00117e90: 696d 7072 6f76 6520 696e 7465 726f 7065 improve interope │ │ │ │ +00117ea0: 7261 6269 6c69 7479 2e3c 2f70 3e0a 3c70 rability.

    .

    The MTOM specif │ │ │ │ +00117ec0: 6963 6174 696f 6e20 6d61 6e64 6174 6573 ication mandates │ │ │ │ +00117ed0: 2053 4f41 5020 312e 3220 616e 6420 7468 SOAP 1.2 and th │ │ │ │ +00117ee0: 6520 7573 6520 6f66 2074 6865 2058 4f50 e use of the XOP │ │ │ │ +00117ef0: 206e 616d 6573 7061 6365 2e20 5468 6520 namespace. The │ │ │ │ +00117f00: 584f 5020 496e 636c 7564 6520 656c 656d XOP Include elem │ │ │ │ +00117f10: 656e 7420 3c65 6d3e 3c63 6f64 653e 786f ent xo │ │ │ │ +00117f20: 703a 496e 636c 7564 653c 2f63 6f64 653e p:Include │ │ │ │ +00117f30: 3c2f 656d 3e20 6973 2064 6566 696e 6564 is defined │ │ │ │ +00117f40: 2069 6e20 7468 6520 696e 7465 7266 6163 in the interfac │ │ │ │ +00117f50: 6520 6865 6164 6572 2066 696c 6520 6173 e header file as │ │ │ │ +00117f60: 2061 203c 636f 6465 3e3c 6120 636c 6173 a _ │ │ │ │ +00117fd0: 786f 705f 5f49 6e63 6c75 6465 3c2f 613e xop__Include │ │ │ │ +00117fe0: 3c2f 636f 6465 3e20 7374 7275 6374 206f struct o │ │ │ │ +00117ff0: 7220 636c 6173 732c 2074 6861 7420 6973 r class, that is │ │ │ │ +00118000: 2075 7365 6420 746f 2072 6566 6572 656e used to referen │ │ │ │ +00118010: 6365 2061 7474 6163 686d 656e 7428 7329 ce attachment(s) │ │ │ │ +00118020: 2066 726f 6d20 7468 6520 534f 4150 206d from the SOAP m │ │ │ │ +00118030: 6573 7361 6765 2062 6f64 792e 3c2f 703e essage body.

    │ │ │ │ +00118040: 0a3c 703e 4265 6361 7573 6520 7265 6665 .

    Because refe │ │ │ │ +00118050: 7265 6e63 6573 2066 726f 6d20 7769 7468 rences from with │ │ │ │ +00118060: 696e 2074 6865 2053 4f41 5020 6d65 7373 in the SOAP mess │ │ │ │ +00118070: 6167 6520 626f 6479 2074 6f20 6174 7461 age body to atta │ │ │ │ +00118080: 6368 6d65 6e74 7320 6172 6520 6d61 6e64 chments are mand │ │ │ │ +00118090: 6174 6f72 7920 7769 7468 204d 544f 4d2c atory with MTOM, │ │ │ │ +001180a0: 2074 6865 2069 6d70 6c65 6d65 6e74 6174 the implementat │ │ │ │ +001180b0: 696f 6e20 6f66 2074 6865 2073 6572 6961 ion of the seria │ │ │ │ +001180c0: 6c69 7a61 7469 6f6e 2061 6e64 2064 6573 lization and des │ │ │ │ +001180d0: 6572 6961 6c69 7a61 7469 6f6e 206f 6620 erialization of │ │ │ │ +001180e0: 4d54 4f4d 204d 494d 4520 6174 7461 6368 MTOM MIME attach │ │ │ │ +001180f0: 6d65 6e74 7320 7573 6573 2074 6865 2065 ments uses the e │ │ │ │ +00118100: 7874 656e 6465 6420 6269 6e61 7279 2074 xtended binary t │ │ │ │ +00118110: 7970 6520 636f 6d70 6172 6162 6c65 2074 ype comparable t │ │ │ │ +00118120: 6f20 4449 4d45 2073 7570 706f 7274 2e20 o DIME support. │ │ │ │ +00118130: 5468 6973 2062 696e 6172 7920 7479 7065 This binary type │ │ │ │ +00118140: 2069 7320 7072 6564 6566 696e 6564 2069 is predefined i │ │ │ │ +00118150: 6e20 7468 6520 3c65 6d3e 3c63 6f64 653e n the │ │ │ │ +00118160: 696d 706f 7274 2f78 6f70 2e68 3c2f 636f import/xop.h file:.

    //gsoap xop sch │ │ │ │ +001181d0: 656d 6120 696d 706f 7274 3a20 6874 7470 ema import: http │ │ │ │ +001181e0: 3a2f 2f77 7777 2e77 332e 6f72 672f 3230 ://www.w3.org/20 │ │ │ │ +001181f0: 3034 2f30 382f 786f 702f 696e 636c 7564 04/08/xop/includ │ │ │ │ +00118200: 6520 3c2f 7370 616e 3e3c 2f64 6976 3e0a e
    . │ │ │ │ +00118210: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    struct < │ │ │ │ +00118240: 2f73 7061 6e3e 3c61 2063 6c61 7373 3d22 /span>_xop__ │ │ │ │ +00118280: 496e 636c 7564 653c 2f61 3e20 3c2f 6469 Include .
    {
    . │ │ │ │ +001182c0: 2020 203c 7370 616e 2063 6c61 7373 3d22 uns │ │ │ │ +001182e0: 6967 6e65 643c 2f73 7061 6e3e 203c 7370 igned char *__ptr< │ │ │ │ +00118370: 2f61 3e3b 203c 2f64 6976 3e0a 3c64 6976 /a>;
    .. │ │ │ │ +00118420: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    │ │ │ │ +00118450: 6368 6172 3c2f 7370 616e 3e20 2a3c 6120 char *id;
    .
    char *< │ │ │ │ +00118500: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +00118510: 7265 663d 2273 7472 7563 745f 5f78 6f70 ref="struct__xop │ │ │ │ +00118520: 5f5f 5f5f 5f69 6e63 6c75 6465 2e68 746d _____include.htm │ │ │ │ +00118530: 6c23 6130 6437 3061 6630 6432 6331 3233 l#a0d70af0d2c123 │ │ │ │ +00118540: 3736 3663 6531 3838 6366 3264 6431 3538 766ce188cf2dd158 │ │ │ │ +00118550: 3333 6122 3e74 7970 653c 2f61 3e3b 203c 33a">type; < │ │ │ │ +00118560: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>..} │ │ │ │ +00118620: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
    .
    typedef │ │ │ │ +00118660: 3c73 7061 6e20 636c 6173 733d 226b 6579 struct _xop__In │ │ │ │ +001186c0: 636c 7564 653c 2f61 3e20 3c61 2063 6c61 clude _x │ │ │ │ +00118700: 6f70 5f5f 496e 636c 7564 653c 2f61 3e3b op__Include; │ │ │ │ +00118710: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    < │ │ │ │ +00118760: 6120 6872 6566 3d22 7374 7275 6374 5f5f a href="struct__ │ │ │ │ +00118770: 786f 705f 5f5f 5f5f 696e 636c 7564 652e xop_____include. │ │ │ │ +00118780: 6874 6d6c 223e 5f78 6f70 5f5f 496e 636c html">_xop__Incl │ │ │ │ +00118790: 7564 653c 2f61 3e3c 2f64 6976 3e3c 6469 ude
    │ │ │ │ +001187b0: 584f 5020 696e 636c 7564 6520 7374 7275 XOP include stru │ │ │ │ +001187c0: 6374 7572 6520 7769 7468 2061 7474 6163 cture with attac │ │ │ │ +001187d0: 686d 656e 7420 6461 7461 2e3c 2f64 6976 hment data.
    Definitio │ │ │ │ +00118800: 6e3a 3c2f 623e 2073 7464 736f 6170 322e n: stdsoap2. │ │ │ │ +00118810: 683a 3938 3833 3c2f 6469 763e 3c2f 6469 h:9883
    .
    _xop__Incl │ │ │ │ +001188e0: 7564 653a 3a74 7970 653c 2f61 3e3c 2f64 ude::type
    char * ty │ │ │ │ +00118910: 7065 3c2f 6469 763e 3c64 6976 2063 6c61 pe
    MIME │ │ │ │ +00118930: 7479 7065 206f 6620 7468 6520 6461 7461 type of the data │ │ │ │ +00118940: 2e3c 2f64 6976 3e3c 6469 7620 636c 6173 .
    Def │ │ │ │ +00118960: 696e 6974 696f 6e3a 3c2f 623e 2073 7464 inition: std │ │ │ │ +00118970: 736f 6170 322e 683a 3938 3837 3c2f 6469 soap2.h:9887
    .
    < │ │ │ │ +001189e0: 6469 7620 636c 6173 733d 2274 746e 616d div class="ttnam │ │ │ │ +001189f0: 6522 3e3c 6120 6872 6566 3d22 7374 7275 e">_xop │ │ │ │ +00118a40: 5f5f 496e 636c 7564 653a 3a69 643c 2f61 __Include::id
    char │ │ │ │ +00118a70: 2a20 6964 3c2f 6469 763e 3c64 6976 2063 * id
    NUL │ │ │ │ +00118a90: 4c20 746f 2067 656e 6572 6174 6520 616e L to generate an │ │ │ │ +00118aa0: 2069 6420 6f72 2061 7373 6967 6e20 7468 id or assign th │ │ │ │ +00118ab0: 6973 206d 656d 6265 7220 7661 7269 6162 is member variab │ │ │ │ +00118ac0: 6c65 2061 2075 6e69 7175 6520 5555 4944 le a unique UUID │ │ │ │ +00118ad0: 2e3c 2f64 6976 3e3c 6469 7620 636c 6173 .
    Def │ │ │ │ +00118af0: 696e 6974 696f 6e3a 3c2f 623e 2073 7464 inition: std │ │ │ │ +00118b00: 736f 6170 322e 683a 3938 3836 3c2f 6469 soap2.h:9886
    .
    < │ │ │ │ +00118b70: 6469 7620 636c 6173 733d 2274 746e 616d div class="ttnam │ │ │ │ +00118b80: 6522 3e3c 6120 6872 6566 3d22 7374 7275 e">_xop │ │ │ │ +00118bd0: 5f5f 496e 636c 7564 653a 3a6f 7074 696f __Include::optio │ │ │ │ +00118be0: 6e73 3c2f 613e 3c2f 6469 763e 3c64 6976 ns
    │ │ │ │ +00118c00: 6368 6172 202a 206f 7074 696f 6e73 3c2f char * options
    descripti │ │ │ │ +00118c30: 6f6e 206f 6620 7468 6520 4d49 4d45 2f4d on of the MIME/M │ │ │ │ +00118c40: 544f 4d20 6174 7461 6368 6d65 6e74 206f TOM attachment o │ │ │ │ +00118c50: 7220 4e55 4c4c 3c2f 6469 763e 3c64 6976 r NULL
    < │ │ │ │ +00118c70: 623e 4465 6669 6e69 7469 6f6e 3a3c 2f62 b>Definition: stdsoap2.h:988 │ │ │ │ +00118c90: 383c 2f64 6976 3e3c 2f64 6976 3e0a 3c64 8
    . │ │ │ │ +00118d70: 3c64 6976 2063 6c61 7373 3d22 7474 6465
    int __size
    size of t │ │ │ │ +00118db0: 6865 2062 696e 6172 7920 6461 7461 3c2f he binary data
    Defini │ │ │ │ +00118de0: 7469 6f6e 3a3c 2f62 3e20 7374 6473 6f61 tion: stdsoa │ │ │ │ +00118df0: 7032 2e68 3a39 3838 353c 2f64 6976 3e3c p2.h:9885
    < │ │ │ │ +00118e00: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    │ │ │ │ +00118e70: 3c61 2068 7265 663d 2273 7472 7563 745f _xop__I │ │ │ │ +00118ec0: 6e63 6c75 6465 3a3a 5f5f 7074 723c 2f61 nclude::__ptr
    unsig │ │ │ │ +00118ef0: 6e65 6420 6368 6172 202a 205f 5f70 7472 ned char * __ptr │ │ │ │ +00118f00: 3c2f 6469 763e 3c64 6976 2063 6c61 7373
    pointer │ │ │ │ +00118f20: 2074 6f20 6269 6e61 7279 2064 6174 613c to binary data< │ │ │ │ +00118f30: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
    Defin │ │ │ │ +00118f50: 6974 696f 6e3a 3c2f 623e 2073 7464 736f ition: stdso │ │ │ │ +00118f60: 6170 322e 683a 3938 3834 3c2f 6469 763e ap2.h:9884
    │ │ │ │ +00118f70: 3c2f 6469 763e 0a3c 2f64 6976 3e3c 212d
    .

    The additional │ │ │ │ +00118fa0: 3c63 6f64 653e 6964 3c2f 636f 6465 3e2c id, │ │ │ │ +00118fb0: 203c 636f 6465 3e74 7970 653c 2f63 6f64 type, and op │ │ │ │ +00118fd0: 7469 6f6e 3c2f 636f 6465 3e20 6d65 6d62 tion memb │ │ │ │ +00118fe0: 6572 7320 656e 6162 6c65 204d 544f 4d20 ers enable MTOM │ │ │ │ +00118ff0: 6174 7461 6368 6d65 6e74 7320 666f 7220 attachments for │ │ │ │ +00119000: 7468 6520 6461 7461 2070 6f69 6e74 6564 the data pointed │ │ │ │ +00119010: 2074 6f20 6279 203c 636f 6465 3e5f 5f70 to by __p │ │ │ │ +00119020: 7472 3c2f 636f 6465 3e20 6f66 2073 697a tr of siz │ │ │ │ +00119030: 6520 3c63 6f64 653e 5f5f 7369 7a65 3c2f e __size. The proce │ │ │ │ +00119050: 7373 2066 6f72 2073 656e 6469 6e67 2061 ss for sending a │ │ │ │ +00119060: 6e64 2072 6563 6569 7669 6e67 204d 544f nd receiving MTO │ │ │ │ +00119070: 4d20 584f 5020 6174 7461 6368 6d65 6e74 M XOP attachment │ │ │ │ +00119080: 7320 6973 2066 756c 6c79 2061 7574 6f6d s is fully autom │ │ │ │ +00119090: 6174 6564 2e20 5468 6520 3c63 6f64 653e ated. The │ │ │ │ +001190a0: 6964 3c2f 636f 6465 3e20 6d65 6d62 6572 id member │ │ │ │ +001190b0: 2072 6566 6572 656e 6365 7320 7468 6520 references the │ │ │ │ +001190c0: 6174 7461 6368 6d65 6e74 2c20 7479 7069 attachment, typi │ │ │ │ +001190d0: 6361 6c6c 7920 6120 636f 6e74 656e 7420 cally a content │ │ │ │ +001190e0: 6964 2043 4944 206f 7220 5555 4944 2077 id CID or UUID w │ │ │ │ +001190f0: 6869 6368 2063 616e 2062 6520 6f62 7461 hich can be obta │ │ │ │ +00119100: 696e 6564 2077 6974 6820 3c63 6f64 653e ined with │ │ │ │ +00119110: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap_rand_uuid< │ │ │ │ +001191a0: 2f61 3e3c 2f63 6f64 653e 2e20 5768 656e /a>. When │ │ │ │ +001191b0: 2073 6574 2074 6f20 4e55 4c4c 2c20 6120 set to NULL, a │ │ │ │ +001191c0: 756e 6971 7565 2043 4944 2069 7320 6175 unique CID is au │ │ │ │ +001191d0: 746f 6d61 7469 6361 6c6c 7920 7573 6564 tomatically used │ │ │ │ +001191e0: 2e20 5468 6520 3c63 6f64 653e 7479 7065 . The type │ │ │ │ +001191f0: 3c2f 636f 6465 3e20 6669 656c 6420 7370 field sp │ │ │ │ +00119200: 6563 6966 6965 7320 7468 6520 7265 7175 ecifies the requ │ │ │ │ +00119210: 6972 6564 204d 494d 4520 7479 7065 206f ired MIME type o │ │ │ │ +00119220: 6620 7468 6520 6269 6e61 7279 2064 6174 f the binary dat │ │ │ │ +00119230: 612c 2061 6e64 2074 6865 206f 7074 696f a, and the optio │ │ │ │ +00119240: 6e61 6c20 3c63 6f64 653e 6f70 7469 6f6e nal option │ │ │ │ +00119250: 733c 2f63 6f64 653e 206d 656d 6265 7220 s member │ │ │ │ +00119260: 6361 6e20 6265 2075 7365 6420 746f 2070 can be used to p │ │ │ │ +00119270: 6967 6779 2d62 6163 6b20 6465 7363 7269 iggy-back descri │ │ │ │ +00119280: 7074 6976 6520 7465 7874 2077 6974 6820 ptive text with │ │ │ │ +00119290: 616e 2061 7474 6163 686d 656e 742e 2054 an attachment. T │ │ │ │ +001192a0: 6865 206f 7264 6572 206f 6620 7468 6520 he order of the │ │ │ │ +001192b0: 6465 636c 6172 6174 696f 6e20 6f66 2074 declaration of t │ │ │ │ +001192c0: 6865 206d 656d 6265 7273 2069 7320 7369 he members is si │ │ │ │ +001192d0: 676e 6966 6963 616e 742e 3c2f 703e 0a3c gnificant.

    .< │ │ │ │ +001192e0: 703e 596f 7520 6361 6e20 696d 706f 7274 p>You can import │ │ │ │ +001192f0: 203c 656d 3e3c 636f 6465 3e78 6f70 2e68 xop.h │ │ │ │ +00119300: 3c2f 636f 6465 3e3c 2f65 6d3e 2069 6e20 in │ │ │ │ +00119310: 796f 7572 2069 6e74 6572 6661 6365 2068 your interface h │ │ │ │ +00119320: 6561 6465 7220 6669 6c65 2074 6f20 7573 eader file to us │ │ │ │ +00119330: 6520 7468 6520 4d54 4f4d 2061 7474 6163 e the MTOM attac │ │ │ │ +00119340: 686d 656e 7473 2c20 666f 7220 6578 616d hments, for exam │ │ │ │ +00119350: 706c 653a 3c2f 703e 0a3c 6469 7620 636c ple:

    .
    < │ │ │ │ +00119370: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00119380: 3e3c 7370 616e 2063 6c61 7373 3d22 7072 >#imp │ │ │ │ +001193a0: 6f72 7420 2671 756f 743b 696d 706f 7274 ort "import │ │ │ │ +001193b0: 2f78 6f70 2e68 2671 756f 743b 3c2f 7370 /xop.h"
    .
    #import │ │ │ │ +00119400: 2671 756f 743b 696d 706f 7274 2f78 6d69 "import/xmi │ │ │ │ +00119410: 6d65 352e 6826 7175 6f74 3b3c 2f73 7061 me5.h"
    .
    #import & │ │ │ │ +00119460: 7175 6f74 3b69 6d70 6f72 742f 736f 6170 quot;import/soap │ │ │ │ +00119470: 3132 2e68 2671 756f 743b 3c2f 7370 616e 12.h"
    .
    /* alternativel │ │ │ │ +001194c0: 792c 2077 6974 686f 7574 2074 6865 2069 y, without the i │ │ │ │ +001194d0: 6d70 6f72 7420 6162 6f76 652c 2075 7365 mport above, use │ │ │ │ +001194e0: 3a20 3c2f 7370 616e 3e3c 2f64 6976 3e0a :
    . │ │ │ │ +001194f0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    //gsoap │ │ │ │ +00119520: 534f 4150 2d45 4e56 2073 6368 656d 6120 SOAP-ENV schema │ │ │ │ +00119530: 6e61 6d65 7370 6163 653a 2068 7474 703a namespace: http: │ │ │ │ +00119540: 2f2f 7777 772e 7733 2e6f 7267 2f32 3030 //www.w3.org/200 │ │ │ │ +00119550: 332f 3035 2f73 6f61 702d 656e 7665 6c6f 3/05/soap-envelo │ │ │ │ +00119560: 7065 203c 2f73 7061 6e3e 3c2f 6469 763e pe
    │ │ │ │ +00119570: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    //gsoap │ │ │ │ +001195a0: 2053 4f41 502d 454e 4320 7363 6865 6d61 SOAP-ENC schema │ │ │ │ +001195b0: 206e 616d 6573 7061 6365 3a20 6874 7470 namespace: http │ │ │ │ +001195c0: 3a2f 2f77 7777 2e77 332e 6f72 672f 3230 ://www.w3.org/20 │ │ │ │ +001195d0: 3033 2f30 352f 736f 6170 2d65 6e63 6f64 03/05/soap-encod │ │ │ │ +001195e0: 696e 6720 3c2f 7370 616e 3e3c 2f64 6976 ing
    .
    */
    .
    .
    //g │ │ │ │ +00119670: 736f 6170 2078 2073 6368 656d 6120 6e61 soap x schema na │ │ │ │ +00119680: 6d65 7370 6163 653a 2068 7474 703a 2f2f mespace: http:// │ │ │ │ +00119690: 6d79 2e66 6972 7374 2e6d 746f 6d2e 6e65 my.first.mtom.ne │ │ │ │ +001196a0: 7420 3c2f 7370 616e 3e3c 2f64 6976 3e0a t
    . │ │ │ │ +001196b0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    struct < │ │ │ │ +001196e0: 2f73 7061 6e3e 785f 5f6d 7944 6174 6120 /span>x__myData │ │ │ │ +001196f0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    {
    │ │ │ │ +00119710: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    _xop_ │ │ │ │ +00119760: 5f49 6e63 6c75 6465 3c2f 613e 2078 6f70 _Include xop │ │ │ │ +00119770: 5f5f 496e 636c 7564 653b 203c 7370 616e __Include; // attachment < │ │ │ │ +001197a0: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    . │ │ │ │ +001197c0: 2040 203c 7370 616e 2063 6c61 7373 3d22 @ cha │ │ │ │ +001197e0: 723c 2f73 7061 6e3e 202a 786d 696d 6535 r *xmime5 │ │ │ │ +001197f0: 5f5f 636f 6e74 656e 7454 7970 653b 2020 __contentType; │ │ │ │ +00119800: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // and its │ │ │ │ +00119820: 2063 6f6e 7465 6e74 5479 7065 203c 2f73 contentType
    .
    }; │ │ │ │ +00119850: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    int x_ │ │ │ │ +00119890: 5f6d 794d 544f 4d74 6573 7428 3c73 7061 _myMTOMtest(struct │ │ │ │ +001198c0: 785f 5f6d 7944 6174 6120 2a69 6e2c 203c x__myData *in, < │ │ │ │ +001198d0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +001198e0: 6f72 6422 3e73 7472 7563 743c 2f73 7061 ord">struct x__myData *ou │ │ │ │ +00119900: 7429 3b3c 2f64 6976 3e0a 3c2f 6469 763e t);
    .
    │ │ │ │ +00119910: 3c21 2d2d 2066 7261 676d 656e 7420 2d2d

    Witho │ │ │ │ +00119d80: 7574 2074 6869 7320 666c 6167 2c20 7468 ut this flag, th │ │ │ │ +00119d90: 6520 6174 7461 6368 6d65 6e74 7320 7769 e attachments wi │ │ │ │ +00119da0: 6c6c 2062 6520 7472 616e 736d 6974 7465 ll be transmitte │ │ │ │ +00119db0: 6420 696e 2044 494d 4520 666f 726d 6174 d in DIME format │ │ │ │ +00119dc0: 2c20 7768 6963 6820 6973 206e 6f74 2077 , which is not w │ │ │ │ +00119dd0: 6861 7420 7765 2077 616e 742e 2049 6620 hat we want. If │ │ │ │ +00119de0: 796f 7572 2063 7572 7265 6e74 2063 6c69 your current cli │ │ │ │ +00119df0: 656e 7473 2061 6e64 2073 6572 7669 6365 ents and service │ │ │ │ +00119e00: 7320 6172 6520 6261 7365 6420 6f6e 206e s are based on n │ │ │ │ +00119e10: 6f6e 2d73 7472 6561 6d69 6e67 2044 494d on-streaming DIM │ │ │ │ +00119e20: 4520 6174 7461 6368 6d65 6e74 7320 7573 E attachments us │ │ │ │ +00119e30: 696e 6720 7468 6520 534f 4150 2062 6f64 ing the SOAP bod │ │ │ │ +00119e40: 7920 7265 6665 7265 6e63 6520 6d65 6368 y reference mech │ │ │ │ +00119e50: 616e 6973 6d20 2874 6875 732c 2077 6974 anism (thus, wit │ │ │ │ +00119e60: 686f 7574 2075 7369 6e67 2074 6865 203c hout using the < │ │ │ │ +00119e70: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soap │ │ │ │ +00119f00: 5f73 6574 5f64 696d 655f 6174 7461 6368 _set_dime_attach │ │ │ │ +00119f10: 6d65 6e74 3c2f 613e 3c2f 636f 6465 3e20 ment │ │ │ │ +00119f20: 6675 6e63 7469 6f6e 2920 6f72 2070 6c61 function) or pla │ │ │ │ +00119f30: 696e 2062 6173 6536 3420 6269 6e61 7279 in base64 binary │ │ │ │ +00119f40: 2058 4d4c 2064 6174 6120 656c 656d 656e XML data elemen │ │ │ │ +00119f50: 7473 2c20 6974 2069 7320 7665 7279 2065 ts, it is very e │ │ │ │ +00119f60: 6173 7920 746f 2061 646f 7074 204d 544f asy to adopt MTO │ │ │ │ +00119f70: 4d20 6279 2072 656e 616d 696e 6720 7468 M by renaming th │ │ │ │ +00119f80: 6520 6269 6e61 7279 2074 7970 6573 2074 e binary types t │ │ │ │ +00119f90: 6f20 3c63 6f64 653e 786f 705f 5f49 6e63 o xop__Inc │ │ │ │ +00119fa0: 6c75 6465 3c2f 636f 6465 3e20 616e 6420 lude and │ │ │ │ +00119fb0: 7573 696e 6720 7468 6520 3c63 6f64 653e using the │ │ │ │ +00119fc0: 2353 4f41 505f 454e 435f 4d54 4f4d 3c2f #SOAP_ENC_MTOM flag with │ │ │ │ +00119fe0: 7468 6520 534f 4150 2031 2e32 206e 616d the SOAP 1.2 nam │ │ │ │ +00119ff0: 6573 7061 6365 2e3c 2f70 3e0a 3c70 3e53 espace.

    .

    S │ │ │ │ +0011a000: 6565 2061 6c73 6f20 4150 4920 646f 6375 ee also API docu │ │ │ │ +0011a010: 6d65 6e74 6174 696f 6e20 4d6f 6475 6c65 mentation Module │ │ │ │ +0011a020: 203c 6120 636c 6173 733d 2265 6c22 2068 MI │ │ │ │ +0011a050: 4d45 2061 7474 6163 686d 656e 7420 6675 ME attachment fu │ │ │ │ +0011a060: 6e63 7469 6f6e 733c 2f61 3e2e 3c2f 703e nctions.

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

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

    .

    . │ │ │ │ +0011a0d0: 4765 6e65 7261 7469 6e67 204d 756c 7469 Generating Multi │ │ │ │ +0011a0e0: 7061 7274 5265 6c61 7465 6420 4d49 4d45 partRelated MIME │ │ │ │ +0011a0f0: 2061 7474 6163 686d 656e 7420 6269 6e64 attachment bind │ │ │ │ +0011a100: 696e 6773 2069 6e20 5753 444c 3c2f 6832 ings in WSDL

    .

    To generate │ │ │ │ +0011a120: 206d 756c 7469 7061 7274 5265 6c61 7465 multipartRelate │ │ │ │ +0011a130: 6420 6269 6e64 696e 6773 2069 6e20 7468 d bindings in th │ │ │ │ +0011a140: 6520 5753 444c 2066 696c 6520 696e 6469 e WSDL file indi │ │ │ │ +0011a150: 6361 7469 6e67 2074 6865 2075 7365 206f cating the use o │ │ │ │ +0011a160: 6620 4d49 4d45 2061 7474 6163 686d 656e f MIME attachmen │ │ │ │ +0011a170: 7473 2c20 7573 653a 3c2f 703e 0a3c 6469 ts, use:

    .
    //gso │ │ │ │ +0011a1c0: 6170 2026 6c74 3b70 7265 6669 7826 6774 ap <prefix> │ │ │ │ +0011a1d0: 3b20 7365 7276 6963 6520 6d65 7468 6f64 ; service method │ │ │ │ +0011a1e0: 2d6d 696d 652d 7479 7065 3a20 2e2e 2e3c -mime-type: ...< │ │ │ │ +0011a1f0: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 2f64 /span>
    .

    This dire │ │ │ │ +0011a220: 6374 6976 6520 6469 7265 6374 6976 6520 ctive directive │ │ │ │ +0011a230: 6361 6e20 6265 2072 6570 6561 7465 6420 can be repeated │ │ │ │ +0011a240: 666f 7220 6561 6368 2061 7474 6163 686d for each attachm │ │ │ │ +0011a250: 656e 7420 796f 7520 7761 6e74 2074 6f20 ent you want to │ │ │ │ +0011a260: 6173 736f 6369 6174 6520 7769 7468 2061 associate with a │ │ │ │ +0011a270: 206d 6574 686f 6427 7320 7265 7175 6573 method's reques │ │ │ │ +0011a280: 7420 616e 6420 7265 7370 6f6e 7365 206d t and response m │ │ │ │ +0011a290: 6573 7361 6765 2e20 7365 6520 616c 736f essage. see also │ │ │ │ +0011a2a0: 2053 6563 7469 6f6e 203c 6120 636c 6173 Section Directives .

    .

    For │ │ │ │ +0011a2f0: 6578 616d 706c 653a 3c2f 703e 0a3c 6469 example:

    .
    │ │ │ │ +0011a340: 2369 6d70 6f72 7420 2671 756f 743b 696d #import "im │ │ │ │ +0011a350: 706f 7274 2f78 6f70 2e68 2671 756f 743b port/xop.h" │ │ │ │ +0011a360: 3c2f 7370 616e 3e20 3c2f 6469 763e 0a3c
    .< │ │ │ │ +0011a370: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +0011a380: 3e3c 7370 616e 2063 6c61 7373 3d22 7072 >#imp │ │ │ │ +0011a3a0: 6f72 7420 2671 756f 743b 696d 706f 7274 ort "import │ │ │ │ +0011a3b0: 2f78 6d69 6d65 352e 6826 7175 6f74 3b3c /xmime5.h"< │ │ │ │ +0011a3c0: 2f73 7061 6e3e 203c 2f64 6976 3e0a 3c64 /span>
    . │ │ │ │ +0011a3e0: 3c73 7061 6e20 636c 6173 733d 2270 7265 #impo │ │ │ │ +0011a400: 7274 2026 7175 6f74 3b69 6d70 6f72 742f rt "import/ │ │ │ │ +0011a410: 736f 6170 3132 2e68 2671 756f 743b 3c2f soap12.h"
    . │ │ │ │ +0011a440: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    / │ │ │ │ +0011a470: 2f67 736f 6170 2078 2073 6368 656d 6120 /gsoap x schema │ │ │ │ +0011a480: 6e61 6d65 7370 6163 653a 2068 7474 703a namespace: http: │ │ │ │ +0011a490: 2f2f 6d79 2e66 6972 7374 2e6d 746f 6d2e //my.first.mtom. │ │ │ │ +0011a4a0: 6e65 7420 3c2f 7370 616e 3e3c 2f64 6976 net
    .
    struct │ │ │ │ +0011a4e0: 203c 2f73 7061 6e3e 785f 5f6d 7944 6174 x__myDat │ │ │ │ +0011a4f0: 6120 3c2f 6469 763e 0a3c 6469 7620 636c a
    .
    {.
    _xo │ │ │ │ +0011a560: 705f 5f49 6e63 6c75 6465 3c2f 613e 2078 p__Include x │ │ │ │ +0011a570: 6f70 5f5f 496e 636c 7564 653b 203c 7370 op__Include; // attachment │ │ │ │ +0011a5a0: 203c 2f73 7061 6e3e 3c2f 6469 763e 0a3c
    .< │ │ │ │ +0011a5b0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +0011a5c0: 3e20 2040 203c 7370 616e 2063 6c61 7373 > @ c │ │ │ │ +0011a5e0: 6861 723c 2f73 7061 6e3e 202a 786d 696d har *xmim │ │ │ │ +0011a5f0: 6535 5f5f 636f 6e74 656e 7454 7970 653b e5__contentType; │ │ │ │ +0011a600: 2020 3c73 7061 6e20 636c 6173 733d 2263 // and i │ │ │ │ +0011a620: 7473 2063 6f6e 7465 6e74 5479 7065 203c ts contentType < │ │ │ │ +0011a630: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    .} │ │ │ │ +0011a650: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
    .
    //gsoap x servi │ │ │ │ +0011a690: 6365 206d 6574 686f 642d 6d69 6d65 2d74 ce method-mime-t │ │ │ │ +0011a6a0: 7970 653a 206d 794d 544f 4d74 6573 7420 ype: myMTOMtest │ │ │ │ +0011a6b0: 7465 7874 2f78 6d6c 203c 2f73 7061 6e3e text/xml │ │ │ │ +0011a6c0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    int x_ │ │ │ │ +0011a700: 5f6d 794d 544f 4d74 6573 7428 3c73 7061 _myMTOMtest(struct │ │ │ │ +0011a730: 785f 5f6d 7944 6174 6120 2a69 6e2c 203c x__myData *in, < │ │ │ │ +0011a740: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +0011a750: 6f72 6422 3e73 7472 7563 743c 2f73 7061 ord">struct x__myData *ou │ │ │ │ +0011a770: 7429 3b3c 2f64 6976 3e0a 3c2f 6469 763e t);
    .
    │ │ │ │ +0011a780: 3c21 2d2d 2066 7261 676d 656e 7420 2d2d

    S │ │ │ │ +0011aa10: 696d 696c 6172 6c79 2c20 746f 2062 696e imilarly, to bin │ │ │ │ +0011aa20: 6420 6174 7461 6368 6d65 6e74 7320 6f6e d attachments on │ │ │ │ +0011aa30: 6c79 2074 6f20 7468 6520 7265 7370 6f6e ly to the respon │ │ │ │ +0011aa40: 7365 206d 6573 7361 6765 206f 6620 616e se message of an │ │ │ │ +0011aa50: 206f 7065 7261 7469 6f6e 2c20 7573 653a operation, use: │ │ │ │ +0011aa60: 3c2f 703e 0a3c 6469 7620 636c 6173 733d

    .
    //gsoap <p │ │ │ │ +0011aab0: 7265 6669 7826 6774 3b20 7365 7276 6963 refix> servic │ │ │ │ +0011aac0: 6520 6d65 7468 6f64 2d6f 7574 7075 742d e method-output- │ │ │ │ +0011aad0: 6d69 6d65 2d74 7970 653a 202e 2e2e 3c2f mime-type: ...
    .

    The wsdl2h │ │ │ │ +0011ab10: 2074 6f6f 6c20 7265 636f 676e 697a 6573 tool recognizes │ │ │ │ +0011ab20: 204d 494d 4520 6174 7461 6368 6d65 6e74 MIME attachment │ │ │ │ +0011ab30: 7320 616e 6420 7072 6f64 7563 6573 2061 s and produces a │ │ │ │ +0011ab40: 6e20 616e 6e6f 7461 7465 6420 6865 6164 n annotated head │ │ │ │ +0011ab50: 6572 2066 696c 652e 3c2f 703e 0a3c 703e er file.

    .

    │ │ │ │ +0011ab60: 596f 7520 6361 6e20 7265 7065 6174 2074 You can repeat t │ │ │ │ +0011ab70: 6865 7365 2064 6972 6563 7469 7665 7320 hese directives │ │ │ │ +0011ab80: 666f 7220 616c 6c20 6d75 6c74 6970 6172 for all multipar │ │ │ │ +0011ab90: 7452 656c 6174 6564 204d 494d 4520 6174 tRelated MIME at │ │ │ │ +0011aba0: 7461 6368 6d65 6e74 7320 796f 7520 7761 tachments you wa │ │ │ │ +0011abb0: 6e74 2074 6f20 6173 736f 6369 6174 6520 nt to associate │ │ │ │ +0011abc0: 7769 7468 2074 6865 2073 6572 7669 6365 with the service │ │ │ │ +0011abd0: 206f 7065 7261 7469 6f6e 2069 6e70 7574 operation input │ │ │ │ +0011abe0: 2061 6e64 206f 7574 7075 742e 3c2f 703e and output.

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

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

    .

    .Send │ │ │ │ +0011ac60: 696e 6720 616e 6420 7265 6365 6976 696e ing and receivin │ │ │ │ +0011ac70: 6720 4d54 4f4d 2061 7474 6163 686d 656e g MTOM attachmen │ │ │ │ +0011ac80: 7473 3c2f 6832 3e0a 3c70 3e41 2072 6563 ts

    .

    A rec │ │ │ │ +0011ac90: 6569 7665 7220 6d75 7374 2062 6520 696e eiver must be in │ │ │ │ +0011aca0: 666f 726d 6564 2074 6f20 7265 636f 676e formed to recogn │ │ │ │ +0011acb0: 697a 6520 4d54 4f4d 2061 7474 6163 686d ize MTOM attachm │ │ │ │ +0011acc0: 656e 7473 2062 7920 7365 7474 696e 6720 ents by setting │ │ │ │ +0011acd0: 7468 6520 3c63 6f64 653e 2353 4f41 505f the #SOAP_ │ │ │ │ +0011ace0: 454e 435f 4d54 4f4d 3c2f 636f 6465 3e20 ENC_MTOM │ │ │ │ +0011acf0: 666c 6167 206f 6620 7468 6520 3c63 6f64 flag of the so │ │ │ │ +0011ad50: 6170 3c2f 613e 3c2f 636f 6465 3e20 636f ap co │ │ │ │ +0011ad60: 6e74 6578 742e 204f 7468 6572 7769 7365 ntext. Otherwise │ │ │ │ +0011ad70: 2c20 7468 6520 7265 6775 6c61 7220 4d49 , the regular MI │ │ │ │ +0011ad80: 4d45 2061 7474 6163 686d 656e 7420 6d65 ME attachment me │ │ │ │ +0011ad90: 6368 616e 6973 6d20 2853 7741 2920 7769 chanism (SwA) wi │ │ │ │ +0011ada0: 6c6c 2062 6520 7573 6564 2074 6f20 7374 ll be used to st │ │ │ │ +0011adb0: 6f72 6520 6174 7461 6368 6d65 6e74 732e ore attachments. │ │ │ │ +0011adc0: 3c2f 703e 0a3c 703e 5768 656e 2075 7369

    .

    When usi │ │ │ │ +0011add0: 6e67 2077 7364 6c32 6820 746f 2062 7569 ng wsdl2h to bui │ │ │ │ +0011ade0: 6c64 2063 6c69 656e 7473 2061 6e64 2f6f ld clients and/o │ │ │ │ +0011adf0: 7220 7365 7276 6963 6573 2c20 796f 7520 r services, you │ │ │ │ +0011ae00: 7368 6f75 6c64 2075 7365 2074 6865 203c should use the < │ │ │ │ +0011ae10: 656d 3e3c 636f 6465 3e74 7970 656d 6170 em>typemap │ │ │ │ +0011ae20: 2e64 6174 3c2f 636f 6465 3e3c 2f65 6d3e .dat │ │ │ │ +0011ae30: 2066 696c 6520 696e 636c 7564 6564 2069 file included i │ │ │ │ +0011ae40: 6e20 7468 6520 6753 4f41 5020 736f 7572 n the gSOAP sour │ │ │ │ +0011ae50: 6365 2063 6f64 6520 7061 636b 6167 652e ce code package. │ │ │ │ +0011ae60: 2054 6865 203c 656d 3e3c 636f 6465 3e74 The t │ │ │ │ +0011ae70: 7970 656d 6170 2e64 6174 3c2f 636f 6465 ypemap.dat file defi │ │ │ │ +0011ae90: 6e65 7320 7468 6520 584f 5020 6e61 6d65 nes the XOP name │ │ │ │ +0011aea0: 7370 6163 6520 616e 6420 584d 4c20 4d49 space and XML MI │ │ │ │ +0011aeb0: 4d45 206e 616d 6573 7061 6365 7320 6173 ME namespaces as │ │ │ │ +0011aec0: 2069 6d70 6f72 7465 6420 6e61 6d65 7370 imported namesp │ │ │ │ +0011aed0: 6163 6573 3a20 3c2f 703e 3c70 7265 2063 aces:

    │ │ │ │ +0011aef0: 786f 7020 2020 203d 2026 6c74 3b68 7474  xop    = <htt
    │ │ │ │ +0011af00: 703a 2f2f 7777 772e 7733 2e6f 7267 2f32  p://www.w3.org/2
    │ │ │ │ +0011af10: 3030 342f 3038 2f78 6f70 2f69 6e63 6c75  004/08/xop/inclu
    │ │ │ │ +0011af20: 6465 2667 743b 200a 786d 696d 6535 203d  de> .xmime5 =
    │ │ │ │ +0011af30: 2026 6c74 3b68 7474 703a 2f2f 7777 772e   <http://www.
    │ │ │ │ +0011af40: 7733 2e6f 7267 2f32 3030 352f 3035 2f78  w3.org/2005/05/x
    │ │ │ │ +0011af50: 6d6c 6d69 6d65 2667 743b 200a 786d 696d  mlmime> .xmim
    │ │ │ │ +0011af60: 6534 203d 2026 6c74 3b68 7474 703a 2f2f  e4 = <http://
    │ │ │ │ +0011af70: 7777 772e 7733 2e6f 7267 2f32 3030 342f  www.w3.org/2004/
    │ │ │ │ +0011af80: 3131 2f78 6d6c 6d69 6d65 2667 743b 0a3c  11/xmlmime>.<
    │ │ │ │ +0011af90: 2f70 7265 3e3c 703e 2054 6865 2077 7364  /pre>

    The wsd │ │ │ │ +0011afa0: 6c32 6820 746f 6f6c 2075 7365 7320 7468 l2h tool uses th │ │ │ │ +0011afb0: 6520 3c65 6d3e 3c63 6f64 653e 7479 7065 e type │ │ │ │ +0011afc0: 6d61 702e 6461 743c 2f63 6f64 653e 3c2f map.dat file to conv │ │ │ │ +0011afe0: 6572 7420 5753 444c 2069 6e74 6f20 616e ert WSDL into an │ │ │ │ +0011aff0: 2069 6e74 6572 6661 6365 2068 6561 6465 interface heade │ │ │ │ +0011b000: 7220 6669 6c65 2e20 496e 2074 6869 7320 r file. In this │ │ │ │ +0011b010: 6361 7365 2077 6520 646f 6e27 7420 7761 case we don't wa │ │ │ │ +0011b020: 6e74 2074 6865 2077 7364 6c32 6820 746f nt the wsdl2h to │ │ │ │ +0011b030: 6f6c 2074 6f20 7265 6164 2074 6865 2058 ol to read the X │ │ │ │ +0011b040: 4f50 2073 6368 656d 6120 616e 6420 7472 OP schema and tr │ │ │ │ +0011b050: 616e 736c 6174 6520 6974 2c20 7369 6e63 anslate it, sinc │ │ │ │ +0011b060: 6520 7765 2068 6176 6520 6120 7072 652d e we have a pre- │ │ │ │ +0011b070: 6465 6669 6e65 6420 3c63 6f64 653e 3c61 defined _xop__Includ │ │ │ │ +0011b0f0: 653c 2f61 3e3c 2f63 6f64 653e 2065 6c65 e ele │ │ │ │ +0011b100: 6d65 6e74 2074 6f20 6861 6e64 6c65 2058 ment to handle X │ │ │ │ +0011b110: 4f50 2066 6f72 204d 544f 4d2e 2054 6869 OP for MTOM. Thi │ │ │ │ +0011b120: 7320 3c63 6f64 653e 3c61 2063 6c61 7373 s _x │ │ │ │ +0011b190: 6f70 5f5f 496e 636c 7564 653c 2f61 3e3c op__Include< │ │ │ │ +0011b1a0: 2f63 6f64 653e 2065 6c65 6d65 6e74 2069 /code> element i │ │ │ │ +0011b1b0: 7320 6465 6669 6e65 6420 696e 203c 656d s defined in xop.h. Theref │ │ │ │ +0011b1e0: 6f72 652c 2074 6865 2062 696e 6469 6e67 ore, the binding │ │ │ │ +0011b1f0: 7320 7368 6f77 6e20 6162 6f76 6520 7769 s shown above wi │ │ │ │ +0011b200: 6c6c 206e 6f74 2074 7261 6e73 6c61 7465 ll not translate │ │ │ │ +0011b210: 2074 6865 2058 4f50 2061 6e64 2058 4d4c the XOP and XML │ │ │ │ +0011b220: 204d 494d 4520 7363 6865 6d61 7320 746f MIME schemas to │ │ │ │ +0011b230: 2063 6f64 652c 2062 7574 2067 656e 6572 code, but gener │ │ │ │ +0011b240: 6174 6573 203c 636f 6465 3e23 696d 706f ates #impo │ │ │ │ +0011b250: 7274 3c2f 636f 6465 3e20 7374 6174 656d rt statem │ │ │ │ +0011b260: 656e 7473 2069 6e73 7465 6164 2069 6e20 ents instead in │ │ │ │ +0011b270: 7468 6520 6765 6e65 7261 7465 6420 696e the generated in │ │ │ │ +0011b280: 7465 7266 6163 6520 6865 6164 6572 2066 terface header f │ │ │ │ +0011b290: 696c 653a 3c2f 703e 0a3c 6469 7620 636c ile:

    .
    < │ │ │ │ +0011b2b0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +0011b2c0: 3e3c 7370 616e 2063 6c61 7373 3d22 7072 >#imp │ │ │ │ +0011b2e0: 6f72 7420 2671 756f 743b 786f 702e 6826 ort "xop.h& │ │ │ │ +0011b2f0: 7175 6f74 3b3c 2f73 7061 6e3e 203c 2f64 quot; .
    #import "x │ │ │ │ +0011b340: 6d69 6d65 352e 6826 7175 6f74 3b3c 2f73 mime5.h"
    .

    │ │ │ │ +0011b6a0: 5375 7070 6f73 6520 7468 6520 5753 444c Suppose the WSDL │ │ │ │ +0011b6b0: 2064 6566 696e 6573 2061 6e20 6f70 6572 defines an oper │ │ │ │ +0011b6c0: 6174 696f 6e3a 3c2f 703e 0a3c 6469 7620 ation:

    .
    int │ │ │ │ +0011b710: 3c2f 7370 616e 3e20 6e73 5f5f 6563 686f ns__echo │ │ │ │ +0011b720: 4461 7461 283c 7370 616e 2063 6c61 7373 Data(struc │ │ │ │ +0011b740: 743c 2f73 7061 6e3e 206e 735f 5f44 6174 t ns__Dat │ │ │ │ +0011b750: 6120 2a69 6e2c 203c 7370 616e 2063 6c61 a *in, str │ │ │ │ +0011b770: 7563 743c 2f73 7061 6e3e 206e 735f 5f44 uct ns__D │ │ │ │ +0011b780: 6174 6120 2a6f 7574 293b 3c2f 6469 763e ata *out);
    │ │ │ │ +0011b790: 0a3c 2f64 6976 3e3c 212d 2d20 6672 6167 .

    After │ │ │ │ +0011b7b0: 2067 656e 6572 6174 696e 6720 7468 6520 generating the │ │ │ │ +0011b7c0: 7374 7562 2066 756e 6374 696f 6e73 2077 stub functions w │ │ │ │ +0011b7d0: 6974 6820 7468 6520 736f 6170 6370 7032 ith the soapcpp2 │ │ │ │ +0011b7e0: 2074 6f6f 6c2c 2077 6520 6361 6e20 696e tool, we can in │ │ │ │ +0011b7f0: 766f 6b65 2074 6865 2073 7475 6220 6174 voke the stub at │ │ │ │ +0011b800: 2074 6865 2063 6c69 656e 7420 7369 6465 the client side │ │ │ │ +0011b810: 2077 6974 683a 3c2f 703e 0a3c 6469 7620 with:

    .
    .
    struct ns__Data data; │ │ │ │ +0011b9e0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    data.xo │ │ │ │ +0011ba00: 705f 5f49 6e63 6c75 6465 2e5f 5f70 7472 p__Include.__ptr │ │ │ │ +0011ba10: 203d 2028 3c73 7061 6e20 636c 6173 733d = (un │ │ │ │ +0011ba30: 7369 676e 6564 3c2f 7370 616e 3e20 3c73 signed char*)"<b> │ │ │ │ +0011ba90: 4865 6c6c 6f20 776f 726c 6421 266c 743b Hello world!< │ │ │ │ +0011baa0: 2f62 2667 743b 2671 756f 743b 3c2f 7370 /b>";
    .
    da │ │ │ │ +0011bad0: 7461 2e78 6f70 5f5f 496e 636c 7564 652e ta.xop__Include. │ │ │ │ +0011bae0: 5f5f 7369 7a65 203d 2032 303b 203c 2f64 __size = 20; .
    data.xop__ │ │ │ │ +0011bb10: 496e 636c 7564 652e 6964 203d 204e 554c Include.id = NUL │ │ │ │ +0011bb20: 4c3b 2020 2020 2020 2020 2020 2020 3c73 L; // CID autom │ │ │ │ +0011bb50: 6174 6963 616c 6c79 2067 656e 6572 6174 atically generat │ │ │ │ +0011bb60: 6564 2062 7920 656e 6769 6e65 203c 2f73 ed by engine
    .
    dat │ │ │ │ +0011bb90: 612e 786f 705f 5f49 6e63 6c75 6465 2e74 a.xop__Include.t │ │ │ │ +0011bba0: 7970 6520 3d20 3c73 7061 6e20 636c 6173 ype = "text/htm │ │ │ │ +0011bbd0: 6c26 7175 6f74 3b3c 2f73 7061 6e3e 3b20 l"; │ │ │ │ +0011bbe0: 2020 3c73 7061 6e20 636c 6173 733d 2263 // MIME │ │ │ │ +0011bc00: 7479 7065 203c 2f73 7061 6e3e 3c2f 6469 type .
    data.xop__I │ │ │ │ +0011bc30: 6e63 6c75 6465 2e6f 7074 696f 6e73 203d nclude.options = │ │ │ │ +0011bc40: 204e 554c 4c3b 2020 2020 2020 203c 7370 NULL; // no descrip │ │ │ │ +0011bc70: 7469 7665 2069 6e66 6f20 6164 6465 6420 tive info added │ │ │ │ +0011bc80: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ │ +0011bca0: 6461 7461 2e78 6d69 6d65 355f 5f63 6f6e data.xmime5__con │ │ │ │ +0011bcb0: 7465 6e74 5479 7065 203d 203c 7370 616e tentType = "tex │ │ │ │ +0011bce0: 742f 6874 6d6c 2671 756f 743b 3c2f 7370 t/html"; // MI │ │ │ │ +0011bd10: 4d45 2074 7970 6520 3c2f 7370 616e 3e3c ME type < │ │ │ │ +0011bd20: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    if (soa │ │ │ │ +0011bd60: 705f 6361 6c6c 5f6e 735f 5f65 6368 6f44 p_call_ns__echoD │ │ │ │ +0011bd70: 6174 6128 3c61 2063 6c61 7373 3d22 636f ata(soap< │ │ │ │ +0011bda0: 2f61 3e2c 2065 6e64 706f 696e 742c 2061 /a>, endpoint, a │ │ │ │ +0011bdb0: 6374 696f 6e2c 2026 616d 703b 6461 7461 ction, &data │ │ │ │ +0011bdc0: 2c20 2661 6d70 3b64 6174 6129 293c 2f64 , &data)).
    soap_ │ │ │ │ +0011be40: 7072 696e 745f 6661 756c 743c 2f61 3e28 print_fault( │ │ │ │ +0011be50: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap, │ │ │ │ +0011be80: 2073 7464 6572 7229 3b3c 2f64 6976 3e0a stderr);
    . │ │ │ │ +0011be90: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    else │ │ │ │ +0011bec0: 3c2f 7370 616e 3e20 3c2f 6469 763e 0a3c
    .< │ │ │ │ +0011bed0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +0011bee0: 3e20 2070 7269 6e74 6628 3c73 7061 6e20 > printf("Got │ │ │ │ +0011bf10: 6461 7461 5c6e 2671 756f 743b 3c2f 7370 data\n");
    .< │ │ │ │ +0011bf40: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +0011bf50: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ │ +0011bf60: 705f 5f63 6f6e 7465 7874 2e68 746d 6c23 p__context.html# │ │ │ │ +0011bf70: 6761 6637 6430 3137 3631 3631 6539 6465 gaf7d0176161e9de │ │ │ │ +0011bf80: 6633 3639 3831 6532 3466 6161 3139 3133 f36981e24faa1913 │ │ │ │ +0011bf90: 6439 223e 736f 6170 5f64 6573 7472 6f79 d9">soap_destroy │ │ │ │ +0011bfa0: 3c2f 613e 283c 6120 636c 6173 733d 2263 (soap │ │ │ │ +0011bfd0: 3c2f 613e 293b 3c2f 6469 763e 0a3c 6469 );
    .< │ │ │ │ +0011bff0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +0011c000: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ │ +0011c010: 705f 5f63 6f6e 7465 7874 2e68 746d 6c23 p__context.html# │ │ │ │ +0011c020: 6761 3831 6130 3039 6165 3165 6138 3235 ga81a009ae1ea825 │ │ │ │ +0011c030: 6130 3565 3532 3431 6532 6237 6138 6563 a05e5241e2b7a8ec │ │ │ │ +0011c040: 6539 223e 736f 6170 5f65 6e64 3c2f 613e e9">soap_end │ │ │ │ +0011c050: 283c 6120 636c 6173 733d 2263 6f64 6522 (soap │ │ │ │ +0011c080: 293b 3c2f 6469 763e 0a3c 6469 7620 636c );
    .
    │ │ │ │ +0011c0f0: 736f 6170 5f66 7265 653c 2f61 3e28 3c61 soap_free(soap);< │ │ │ │ +0011c130: 2f64 6976 3e0a 3c2f 6469 763e 3c21 2d2d /div>.

    │ │ │ │ +0011c150: 4e6f 7465 2074 6861 7420 7468 6520 3c63 Note that the xop__Include │ │ │ │ +0011c170: 2e74 7970 653c 2f63 6f64 653e 206d 656d .type mem │ │ │ │ +0011c180: 6265 7220 6d75 7374 2062 6520 7365 7420 ber must be set │ │ │ │ +0011c190: 746f 2074 7261 6e73 6d69 7420 4d54 4f4d to transmit MTOM │ │ │ │ +0011c1a0: 2061 7474 6163 686d 656e 7473 2c20 6f74 attachments, ot │ │ │ │ +0011c1b0: 6865 7277 6973 6520 696e 6c69 6e65 2062 herwise inline b │ │ │ │ +0011c1c0: 6173 6536 3420 584d 4c20 7769 6c6c 2062 ase64 XML will b │ │ │ │ +0011c1d0: 6520 7365 6e74 2e3c 2f70 3e0a 3c70 3e41 e sent.

    .

    A │ │ │ │ +0011c1e0: 7420 7468 6520 7365 7276 6572 2073 6964 t the server sid │ │ │ │ +0011c1f0: 652c 2077 6520 7368 6f77 2061 6e20 6578 e, we show an ex │ │ │ │ +0011c200: 616d 706c 6520 6f66 2061 6e20 6f70 6572 ample of an oper │ │ │ │ +0011c210: 6174 696f 6e20 6861 6e64 6c65 7220 7468 ation handler th │ │ │ │ +0011c220: 6174 206a 7573 7420 636f 7069 6573 2074 at just copies t │ │ │ │ +0011c230: 6865 2069 6e70 7574 2064 6174 6120 746f he input data to │ │ │ │ +0011c240: 206f 7574 7075 743a 3c2f 703e 0a3c 6469 output:

    .
    i │ │ │ │ +0011c290: 6e74 3c2f 7370 616e 3e20 6e73 5f5f 6563 nt ns__ec │ │ │ │ +0011c2a0: 686f 4461 7461 283c 7370 616e 2063 6c61 hoData(str │ │ │ │ +0011c2c0: 7563 743c 2f73 7061 6e3e 203c 6120 636c uct soap *soap, struct │ │ │ │ +0011c350: 206e 735f 5f44 6174 6120 2a69 6e2c 203c ns__Data *in, < │ │ │ │ +0011c360: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +0011c370: 6f72 6422 3e73 7472 7563 743c 2f73 7061 ord">struct ns__data *out │ │ │ │ +0011c390: 2920 3c2f 6469 763e 0a3c 6469 7620 636c )
    .
    {.
    *out = *i │ │ │ │ +0011c3d0: 6e3b 203c 2f64 6976 3e0a 3c64 6976 2063 n;
    .. │ │ │ │ +0011c490: 7d3c 2f64 6976 3e0a 3c2f 6469 763e 3c21 }
    .
    < │ │ │ │ +0011c4b0: 703e 5468 6520 7365 7276 6572 206d 7573 p>The server mus │ │ │ │ +0011c4c0: 7420 7573 6520 7468 6520 3c63 6f64 653e t use the │ │ │ │ +0011c4d0: 2353 4f41 505f 454e 435f 4d54 4f4d 3c2f #SOAP_ENC_MTOM flag to in │ │ │ │ +0011c4f0: 6974 6961 6c69 7a65 2074 6865 203c 636f itialize the s │ │ │ │ +0011c550: 6f61 703c 2f61 3e3c 2f63 6f64 653e 2063 oap c │ │ │ │ +0011c560: 6f6e 7465 7874 2074 6f20 7265 6365 6976 ontext to receiv │ │ │ │ +0011c570: 6520 616e 6420 7365 6e64 204d 544f 4d20 e and send MTOM │ │ │ │ +0011c580: 6174 7461 6368 6d65 6e74 732e 3c2f 703e attachments.

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

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

    .

    │ │ │ │ +0011c5f0: 3c2f 613e 0a53 7472 6561 6d69 6e67 204d .Streaming M │ │ │ │ +0011c600: 494d 452f 4d54 4f4d 3c2f 6832 3e0a 3c70 IME/MTOM

    .

    Streaming MIME/ │ │ │ │ +0011c620: 4d54 4f4d 2069 7320 6163 6869 6576 6564 MTOM is achieved │ │ │ │ +0011c630: 2077 6974 6820 6361 6c6c 6261 636b 2066 with callback f │ │ │ │ +0011c640: 756e 6374 696f 6e73 2074 6f20 6665 7463 unctions to fetc │ │ │ │ +0011c650: 6820 616e 6420 7374 6f72 6520 6461 7461 h and store data │ │ │ │ +0011c660: 2064 7572 696e 6720 7472 616e 736d 6973 during transmis │ │ │ │ +0011c670: 7369 6f6e 2e20 5468 7265 6520 6675 6e63 sion. Three func │ │ │ │ +0011c680: 7469 6f6e 2063 616c 6c62 6163 6b73 2066 tion callbacks f │ │ │ │ +0011c690: 6f72 2073 7472 6561 6d69 6e67 204d 494d or streaming MIM │ │ │ │ +0011c6a0: 452f 4d54 4f4d 206f 7574 7075 7420 616e E/MTOM output an │ │ │ │ +0011c6b0: 6420 7468 7265 6520 6361 6c6c 6261 636b d three callback │ │ │ │ +0011c6c0: 7320 666f 7220 7374 7265 616d 696e 6720 s for streaming │ │ │ │ +0011c6d0: 4d49 4d45 2f4d 544f 4d20 696e 7075 7420 MIME/MTOM input │ │ │ │ +0011c6e0: 6172 6520 6176 6169 6c61 626c 652e 3c2f are available..

      .
    • void *(*soap.f │ │ │ │ +0011c710: 6d69 6d65 7265 6164 6f70 656e 2928 7374 mimereadopen)(st │ │ │ │ +0011c720: 7275 6374 2073 6f61 7020 2a73 6f61 702c ruct soap *soap, │ │ │ │ +0011c730: 2076 6f69 6420 2a68 616e 646c 652c 2063 void *handle, c │ │ │ │ +0011c740: 6f6e 7374 2063 6861 7220 2a69 642c 2063 onst char *id, c │ │ │ │ +0011c750: 6f6e 7374 2063 6861 7220 2a74 7970 652c onst char *type, │ │ │ │ +0011c760: 2063 6f6e 7374 2063 6861 7220 2a64 6573 const char *des │ │ │ │ +0011c770: 6372 6970 7469 6f6e 293c 2f63 6f64 653e cription) │ │ │ │ +0011c780: 2054 6869 7320 6361 6c6c 6261 636b 2069 This callback i │ │ │ │ +0011c790: 7320 6361 6c6c 6564 2062 7920 7468 6520 s called by the │ │ │ │ +0011c7a0: 656e 6769 6e65 2074 6f20 7374 6172 7420 engine to start │ │ │ │ +0011c7b0: 7365 6e64 696e 6720 6120 7374 7265 616d sending a stream │ │ │ │ +0011c7c0: 696e 6720 4d49 4d45 2f4d 544f 4d20 6174 ing MIME/MTOM at │ │ │ │ +0011c7d0: 7461 6368 6d65 6e74 2e20 5468 6973 2063 tachment. This c │ │ │ │ +0011c7e0: 616c 6c62 6163 6b20 6f70 656e 7320 6120 allback opens a │ │ │ │ +0011c7f0: 7374 7265 616d 2074 6f20 7374 6172 7420 stream to start │ │ │ │ +0011c800: 7265 6164 696e 6720 7468 6520 6174 7461 reading the atta │ │ │ │ +0011c810: 6368 6d65 6e74 2064 6174 6120 746f 2073 chment data to s │ │ │ │ +0011c820: 656e 642e 2054 6865 2061 6374 7561 6c20 end. The actual │ │ │ │ +0011c830: 6461 7461 2073 7472 6561 6d20 7769 6c6c data stream will │ │ │ │ +0011c840: 2062 6520 7265 6164 2069 6e20 6368 756e be read in chun │ │ │ │ +0011c850: 6b73 2075 7369 6e67 2074 6865 203c 636f ks using the soap::fm │ │ │ │ +0011c900: 696d 6572 6561 643c 2f61 3e3c 2f63 6f64 imeread callback unti │ │ │ │ +0011c920: 6c20 6e6f 206d 6f72 6520 6461 7461 2069 l no more data i │ │ │ │ +0011c930: 7320 6176 6169 6c61 626c 6520 616e 6420 s available and │ │ │ │ +0011c940: 7468 6520 3c63 6f64 653e 3c61 2063 6c61 the soap::fmim │ │ │ │ +0011c9f0: 6572 6561 6463 6c6f 7365 3c2f 613e 3c2f ereadclose callback i │ │ │ │ +0011ca10: 7320 6361 6c6c 6564 2074 6f20 636c 6f73 s called to clos │ │ │ │ +0011ca20: 6520 7468 6520 7374 7265 616d 2e20 5468 e the stream. Th │ │ │ │ +0011ca30: 6520 3c63 6f64 653e 6861 6e64 6c65 3c2f e handle parameter │ │ │ │ +0011ca50: 636f 6e74 6169 6e73 2074 6865 2076 616c contains the val │ │ │ │ +0011ca60: 7565 206f 6620 7468 6520 3c63 6f64 653e ue of the │ │ │ │ +0011ca70: 5f5f 7074 723c 2f63 6f64 653e 206d 656d __ptr mem │ │ │ │ +0011ca80: 6265 7220 7661 7269 6162 6c65 206f 6620 ber variable of │ │ │ │ +0011ca90: 7468 6520 6174 7461 6368 6d65 6e74 2073 the attachment s │ │ │ │ +0011caa0: 7472 7563 742f 636c 6173 7320 7769 7468 truct/class with │ │ │ │ +0011cab0: 2064 6174 6120 2865 2e67 2e20 3c63 6f64 data (e.g. │ │ │ │ +0011cb30: 7873 645f 5f62 6173 6536 3442 696e 6172 xsd__base64Binar │ │ │ │ +0011cb40: 793c 2f61 3e3c 2f63 6f64 653e 206f 7220 y or │ │ │ │ +0011cb50: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 _xop │ │ │ │ +0011cbc0: 5f5f 496e 636c 7564 653c 2f61 3e3c 2f63 __Include with │ │ │ │ +0011cbe0: 5f5f 7074 723c 2f63 6f64 653e 2c20 3c63 __ptr, __size, id, type and │ │ │ │ +0011cc30: 6f70 7469 6f6e 733c 2f63 6f64 653e 206d options m │ │ │ │ +0011cc40: 656d 6265 7273 292c 2077 6869 6368 2073 embers), which s │ │ │ │ +0011cc50: 686f 756c 6420 6265 2061 2070 6f69 6e74 hould be a point │ │ │ │ +0011cc60: 6572 2074 6f20 7370 6563 6966 6963 2069 er to specific i │ │ │ │ +0011cc70: 6e66 6f72 6d61 7469 6f6e 2073 7563 6820 nformation such │ │ │ │ +0011cc80: 6173 2061 2066 696c 6520 6465 7363 7269 as a file descri │ │ │ │ +0011cc90: 7074 6f72 206f 7220 6120 706f 696e 7465 ptor or a pointe │ │ │ │ +0011cca0: 7220 746f 2061 2073 6f6d 6520 6170 706c r to a some appl │ │ │ │ +0011ccb0: 6963 6174 696f 6e2d 7370 6563 6966 6963 ication-specific │ │ │ │ +0011ccc0: 2064 6174 6120 746f 2062 6520 7061 7373 data to be pass │ │ │ │ +0011ccd0: 6564 2074 6f20 7468 6973 2063 616c 6c62 ed to this callb │ │ │ │ +0011cce0: 6163 6b2e 2042 6f74 6820 7468 6520 3c63 ack. Both the __ptr │ │ │ │ +0011cd00: 2061 6e64 203c 636f 6465 3e5f 5f73 697a and __siz │ │ │ │ +0011cd10: 653c 2f63 6f64 653e 206d 656d 6265 7273 e members │ │ │ │ +0011cd20: 206f 6620 7468 6520 6174 7461 6368 6d65 of the attachme │ │ │ │ +0011cd30: 6e74 2073 7472 7563 742f 636c 6173 7320 nt struct/class │ │ │ │ +0011cd40: 7368 6f75 6c64 2068 6176 6520 6265 656e should have been │ │ │ │ +0011cd50: 2073 6574 2062 7920 7468 6520 6170 706c set by the appl │ │ │ │ +0011cd60: 6963 6174 696f 6e20 7072 696f 7220 746f ication prior to │ │ │ │ +0011cd70: 2074 6865 2073 6572 6961 6c69 7a61 7469 the serializati │ │ │ │ +0011cd80: 6f6e 206f 6620 7468 6520 6d65 7373 6167 on of the messag │ │ │ │ +0011cd90: 6520 7769 7468 2061 7474 6163 686d 656e e with attachmen │ │ │ │ +0011cda0: 7473 2e20 4966 2074 6865 203c 636f 6465 ts. If the __size i │ │ │ │ +0011cdc0: 7320 7a65 726f 2061 6e64 2048 5454 5020 s zero and HTTP │ │ │ │ +0011cdd0: 6368 756e 6b69 6e67 2069 7320 656e 6162 chunking is enab │ │ │ │ +0011cde0: 6c65 6420 2877 6974 6820 3c63 6f64 653e led (with │ │ │ │ +0011cdf0: 2353 4f41 505f 494f 5f43 4855 4e4b 3c2f #SOAP_IO_CHUNK), then chu │ │ │ │ +0011ce10: 6e6b 6564 204d 494d 452f 4d54 4f4d 2061 nked MIME/MTOM a │ │ │ │ +0011ce20: 7474 6163 686d 656e 7473 2061 7265 2073 ttachments are s │ │ │ │ +0011ce30: 656e 742c 2073 6565 203c 636f 6465 3e3c ent, see < │ │ │ │ +0011ce40: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ +0011ce50: 663d 2267 726f 7570 5f5f 6772 6f75 705f f="group__group_ │ │ │ │ +0011ce60: 5f63 616c 6c62 6163 6b73 2e68 746d 6c23 _callbacks.html# │ │ │ │ +0011ce70: 6761 6666 3430 6131 6361 3666 6266 3037 gaff40a1ca6fbf07 │ │ │ │ +0011ce80: 3562 3534 6363 6266 3437 3930 3039 6365 5b54ccbf479009ce │ │ │ │ +0011ce90: 3734 2220 7469 746c 653d 2243 616c 6c62 74" title="Callb │ │ │ │ +0011cea0: 6163 6b20 746f 2072 6561 6420 6461 7461 ack to read data │ │ │ │ +0011ceb0: 2069 6e20 6120 4d49 4d45 2f4d 544f 4d20 in a MIME/MTOM │ │ │ │ +0011cec0: 6174 7461 6368 6d65 6e74 2073 7472 6561 attachment strea │ │ │ │ +0011ced0: 6d2e 223e 736f 6170 3a3a 666d 696d 6572 m.">soap::fmimer │ │ │ │ +0011cee0: 6561 643c 2f61 3e3c 2f63 6f64 653e 2e20 ead. │ │ │ │ +0011cef0: 5468 6520 3c63 6f64 653e 6964 3c2f 636f The id, type< │ │ │ │ +0011cf10: 2f63 6f64 653e 2061 6e64 203c 636f 6465 /code> and options │ │ │ │ +0011cf30: 7061 7261 6d65 7465 7273 2061 7265 2074 parameters are t │ │ │ │ +0011cf40: 6865 203c 636f 6465 3e69 643c 2f63 6f64 he id (an optional │ │ │ │ +0011cf60: 4944 292c 203c 636f 6465 3e74 7970 653c ID), type< │ │ │ │ +0011cf70: 2f63 6f64 653e 2028 6120 4d49 4d45 2074 /code> (a MIME t │ │ │ │ +0011cf80: 7970 6529 2061 6e64 203c 636f 6465 3e6f ype) and o │ │ │ │ +0011cf90: 7074 696f 6e73 3c2f 636f 6465 3e20 2861 ptions (a │ │ │ │ +0011cfa0: 2064 6573 6372 6970 7469 7665 2073 7472 descriptive str │ │ │ │ +0011cfb0: 696e 6729 206f 6620 7468 6520 6174 7461 ing) of the atta │ │ │ │ +0011cfc0: 6368 6d65 6e74 2073 7472 7563 742f 636c chment struct/cl │ │ │ │ +0011cfd0: 6173 732c 2072 6573 7065 6374 6976 656c ass, respectivel │ │ │ │ +0011cfe0: 792c 206f 6620 7768 6963 6820 6174 206c y, of which at l │ │ │ │ +0011cff0: 6561 7374 206f 6e65 206d 656d 6265 7220 east one member │ │ │ │ +0011d000: 7368 6f75 6c64 2062 6520 6e6f 6e2d 4e55 should be non-NU │ │ │ │ +0011d010: 4c4c 2e20 5468 6520 6361 6c6c 6261 636b LL. The callback │ │ │ │ +0011d020: 2073 686f 756c 6420 7265 7475 726e 2074 should return t │ │ │ │ +0011d030: 6865 203c 636f 6465 3e68 616e 646c 653c he handle< │ │ │ │ +0011d040: 2f63 6f64 653e 2070 6172 616d 6574 6572 /code> parameter │ │ │ │ +0011d050: 2076 616c 7565 206f 7220 616e 6f74 6865 value or anothe │ │ │ │ +0011d060: 7220 706f 696e 7465 7220 7661 6c75 652c r pointer value, │ │ │ │ +0011d070: 2077 6869 6368 2069 7320 7061 7373 6564 which is passed │ │ │ │ +0011d080: 2061 7320 7468 6520 6e65 7720 3c63 6f64 as the new handle │ │ │ │ +0011d0a0: 7061 7261 6d65 7465 7220 746f 203c 636f parameter to soap::fm │ │ │ │ +0011d150: 696d 6572 6561 643c 2f61 3e3c 2f63 6f64 imeread and soap::f │ │ │ │ +0011d210: 6d69 6d65 7265 6164 636c 6f73 653c 2f61 mimereadclose callbac │ │ │ │ +0011d230: 6b73 2e20 5768 656e 2061 6e20 6572 726f ks. When an erro │ │ │ │ +0011d240: 7220 6f63 6375 7272 6564 2069 6e20 7468 r occurred in th │ │ │ │ +0011d250: 6973 2063 616c 6c62 6163 6b2c 2074 6865 is callback, the │ │ │ │ +0011d260: 2063 616c 6c62 6163 6b20 7368 6f75 6c64 callback should │ │ │ │ +0011d270: 2072 6574 7572 6e20 4e55 4c4c 2061 6e64 return NULL and │ │ │ │ +0011d280: 2073 6574 203c 636f 6465 3e3c 6120 636c set soap::error │ │ │ │ +0011d340: 3c2f 636f 6465 3e20 746f 2061 6e20 6572 to an er │ │ │ │ +0011d350: 726f 7220 636f 6465 2c20 652e 672e 2075 ror code, e.g. u │ │ │ │ +0011d360: 7369 6e67 203c 636f 6465 3e3c 6120 636c sing soap_ │ │ │ │ +0011d410: 7265 6365 6976 6572 5f66 6175 6c74 3c2f receiver_fault. The c │ │ │ │ +0011d430: 616c 6c62 6163 6b20 6d61 7920 7265 7475 allback may retu │ │ │ │ +0011d440: 726e 204e 554c 4c20 616e 6420 7365 7420 rn NULL and set │ │ │ │ +0011d450: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 soap │ │ │ │ +0011d500: 3a3a 6572 726f 723c 2f61 3e3c 2f63 6f64 ::error to #SOA │ │ │ │ +0011d520: 505f 4f4b 3c2f 636f 6465 3e20 7768 656e P_OK when │ │ │ │ +0011d530: 2074 6869 7320 7370 6563 6966 6963 204d this specific M │ │ │ │ +0011d540: 494d 452f 4d54 4f4d 2061 7474 6163 686d IME/MTOM attachm │ │ │ │ +0011d550: 656e 7420 7368 6f75 6c64 206e 6f74 2074 ent should not t │ │ │ │ +0011d560: 6f20 6265 2073 7472 6561 6d65 6420 616e o be streamed an │ │ │ │ +0011d570: 6420 7468 6520 656e 6769 6e65 2077 696c d the engine wil │ │ │ │ +0011d580: 6c20 7369 6d70 6c79 2073 6b69 7020 6974 l simply skip it │ │ │ │ +0011d590: 2e3c 2f6c 693e 0a3c 6c69 3e3c 636f 6465 .
    • .
    • size_t (*soap.f │ │ │ │ +0011d5b0: 6d69 6d65 7265 6164 2928 7374 7275 6374 mimeread)(struct │ │ │ │ +0011d5c0: 2073 6f61 7020 2a73 6f61 702c 2076 6f69 soap *soap, voi │ │ │ │ +0011d5d0: 6420 2a68 616e 646c 652c 2063 6861 7220 d *handle, char │ │ │ │ +0011d5e0: 2a62 7566 2c20 7369 7a65 5f74 206c 656e *buf, size_t len │ │ │ │ +0011d5f0: 293c 2f63 6f64 653e 2054 6869 7320 6361 ) This ca │ │ │ │ +0011d600: 6c6c 6261 636b 2069 7320 6361 6c6c 6564 llback is called │ │ │ │ +0011d610: 2062 7920 7468 6520 656e 6769 6e65 2074 by the engine t │ │ │ │ +0011d620: 6f20 7265 6164 2061 2063 6875 6e6b 206f o read a chunk o │ │ │ │ +0011d630: 6620 6174 7461 6368 6d65 6e74 2064 6174 f attachment dat │ │ │ │ +0011d640: 6120 746f 2074 7261 6e73 6d69 742e 2054 a to transmit. T │ │ │ │ +0011d650: 6865 203c 636f 6465 3e68 616e 646c 653c he handle< │ │ │ │ +0011d660: 2f63 6f64 653e 2070 6172 616d 6574 6572 /code> parameter │ │ │ │ +0011d670: 2063 6f6e 7461 696e 7320 7468 6520 6861 contains the ha │ │ │ │ +0011d680: 6e64 6c65 2072 6574 7572 6e65 6420 6279 ndle returned by │ │ │ │ +0011d690: 2074 6865 203c 636f 6465 3e3c 6120 636c the soap::fmi │ │ │ │ +0011d740: 6d65 7265 6164 6f70 656e 3c2f 613e 3c2f mereadopen callback. │ │ │ │ +0011d760: 5468 6520 3c63 6f64 653e 6275 663c 2f63 The buf parameter i │ │ │ │ +0011d780: 7320 7468 6520 6275 6666 6572 206f 6620 s the buffer of │ │ │ │ +0011d790: 6c65 6e67 7468 203c 636f 6465 3e6c 656e length len │ │ │ │ +0011d7a0: 3c2f 636f 6465 3e20 696e 746f 2077 6869 into whi │ │ │ │ +0011d7b0: 6368 2061 2063 6875 6e6b 206f 6620 6461 ch a chunk of da │ │ │ │ +0011d7c0: 7461 2073 686f 756c 6420 6265 2077 7269 ta should be wri │ │ │ │ +0011d7d0: 7474 656e 2062 7920 7468 6520 6361 6c6c tten by the call │ │ │ │ +0011d7e0: 6261 636b 2e20 5468 6520 6163 7475 616c back. The actual │ │ │ │ +0011d7f0: 2061 6d6f 756e 7420 6f66 2064 6174 6120 amount of data │ │ │ │ +0011d800: 7772 6974 7465 6e20 696e 746f 2074 6865 written into the │ │ │ │ +0011d810: 2062 7566 6665 7220 6d61 7920 6265 206c buffer may be l │ │ │ │ +0011d820: 6573 7320 7468 616e 203c 636f 6465 3e6c ess than l │ │ │ │ +0011d830: 656e 3c2f 636f 6465 3e20 616e 6420 7468 en and th │ │ │ │ +0011d840: 6973 2061 6374 7561 6c20 616d 6f75 6e74 is actual amount │ │ │ │ +0011d850: 2073 686f 756c 6420 6265 2072 6574 7572 should be retur │ │ │ │ +0011d860: 6e65 6420 6279 2074 6865 2063 616c 6c62 ned by the callb │ │ │ │ +0011d870: 6163 6b2e 2041 2072 6574 7572 6e20 7661 ack. A return va │ │ │ │ +0011d880: 6c75 6520 6f66 207a 6572 6f20 696e 6469 lue of zero indi │ │ │ │ +0011d890: 6361 7465 7320 616e 2065 7272 6f72 2061 cates an error a │ │ │ │ +0011d8a0: 6e64 203c 636f 6465 3e3c 6120 636c 6173 nd s │ │ │ │ +0011d950: 6f61 703a 3a65 7272 6f72 3c2f 613e 3c2f oap::error should be │ │ │ │ +0011d970: 7365 742e 2054 6865 203c 636f 6465 3e5f set. The _ │ │ │ │ +0011d980: 5f73 697a 653c 2f63 6f64 653e 206d 656d _size mem │ │ │ │ +0011d990: 6265 7220 7661 7269 6162 6c65 206f 6620 ber variable of │ │ │ │ +0011d9a0: 7468 6520 6174 7461 6368 6d65 6e74 2073 the attachment s │ │ │ │ +0011d9b0: 7472 7563 742f 636c 6173 7320 7769 7468 truct/class with │ │ │ │ +0011d9c0: 2064 6174 6120 2865 2e67 2e20 3c63 6f64 data (e.g. │ │ │ │ +0011da40: 7873 645f 5f62 6173 6536 3442 696e 6172 xsd__base64Binar │ │ │ │ +0011da50: 793c 2f61 3e3c 2f63 6f64 653e 206f 7220 y or │ │ │ │ +0011da60: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 _xop │ │ │ │ +0011dad0: 5f5f 496e 636c 7564 653c 2f61 3e3c 2f63 __Include with │ │ │ │ +0011daf0: 5f5f 7074 723c 2f63 6f64 653e 2c20 3c63 __ptr, __size, id, type and │ │ │ │ +0011db40: 6f70 7469 6f6e 733c 2f63 6f64 653e 206d options m │ │ │ │ +0011db50: 656d 6265 7273 2920 7368 6f75 6c64 2062 embers) should b │ │ │ │ +0011db60: 6520 7365 7420 6279 2074 6865 2061 7070 e set by the app │ │ │ │ +0011db70: 6c69 6361 7469 6f6e 2070 7269 6f72 2074 lication prior t │ │ │ │ +0011db80: 6f20 7468 6520 7365 7269 616c 697a 6174 o the serializat │ │ │ │ +0011db90: 696f 6e20 6f66 2074 6865 206d 6573 7361 ion of the messa │ │ │ │ +0011dba0: 6765 2077 6974 6820 6174 7461 6368 6d65 ge with attachme │ │ │ │ +0011dbb0: 6e74 732e 2054 6865 2076 616c 7565 206f nts. The value o │ │ │ │ +0011dbc0: 6620 3c63 6f64 653e 5f5f 7369 7a65 3c2f f __size indicates │ │ │ │ +0011dbe0: 7468 6520 746f 7461 6c20 7369 7a65 206f the total size o │ │ │ │ +0011dbf0: 6620 7468 6520 6174 7461 6368 6d65 6e74 f the attachment │ │ │ │ +0011dc00: 2064 6174 6120 746f 2062 6520 7472 616e data to be tran │ │ │ │ +0011dc10: 736d 6974 7465 642e 2049 6620 7468 6520 smitted. If the │ │ │ │ +0011dc20: 3c63 6f64 653e 5f5f 7369 7a65 3c2f 636f __size member varia │ │ │ │ +0011dc40: 626c 6520 6973 207a 6572 6f20 616e 6420 ble is zero and │ │ │ │ +0011dc50: 4854 5450 2063 6875 6e6b 696e 6720 6973 HTTP chunking is │ │ │ │ +0011dc60: 2065 6e61 626c 6564 2028 7769 7468 203c enabled (with < │ │ │ │ +0011dc70: 636f 6465 3e23 534f 4150 5f49 4f5f 4348 code>#SOAP_IO_CH │ │ │ │ +0011dc80: 554e 4b3c 2f63 6f64 653e 292c 2074 6865 UNK), the │ │ │ │ +0011dc90: 6e20 4d49 4d45 2f4d 544f 4d20 6368 756e n MIME/MTOM chun │ │ │ │ +0011dca0: 6b65 6420 7472 616e 7366 6572 7320 6172 ked transfers ar │ │ │ │ +0011dcb0: 6520 6163 7469 7661 7465 6420 6279 2074 e activated by t │ │ │ │ +0011dcc0: 6865 2065 6e67 696e 652c 2077 6869 6368 he engine, which │ │ │ │ +0011dcd0: 2069 7320 6d6f 7265 2066 6c65 7869 626c is more flexibl │ │ │ │ +0011dce0: 6520 7369 6e63 6520 7468 6520 6174 7461 e since the atta │ │ │ │ +0011dcf0: 6368 6d65 6e74 2064 6174 6120 7369 7a65 chment data size │ │ │ │ +0011dd00: 2064 6f65 7320 6e6f 7420 6e65 6564 2074 does not need t │ │ │ │ +0011dd10: 6f20 6265 2064 6574 6572 6d69 6e65 6420 o be determined │ │ │ │ +0011dd20: 696e 2061 6476 616e 6365 2e20 546f 2075 in advance. To u │ │ │ │ +0011dd30: 7365 204d 494d 452f 4d54 4f4d 2063 6875 se MIME/MTOM chu │ │ │ │ +0011dd40: 6e6b 6564 2074 7261 6e73 6665 7273 2c20 nked transfers, │ │ │ │ +0011dd50: 656e 6162 6c65 2048 5454 5020 6368 756e enable HTTP chun │ │ │ │ +0011dd60: 6b69 6e67 2077 6974 6820 3c63 6f64 653e king with │ │ │ │ +0011dd70: 2353 4f41 505f 494f 5f43 4855 4e4b 3c2f #SOAP_IO_CHUNK (also #SOAP_IO_STORE │ │ │ │ +0011dda0: 3c2f 636f 6465 3e20 6361 6e20 6265 2075 can be u │ │ │ │ +0011ddb0: 7365 642c 2062 7574 2074 6869 7320 6275 sed, but this bu │ │ │ │ +0011ddc0: 6666 6572 7320 7468 6520 656e 7469 7265 ffers the entire │ │ │ │ +0011ddd0: 206d 6573 7361 6765 2069 6e20 6d65 6d6f message in memo │ │ │ │ +0011dde0: 7279 2062 6566 6f72 6520 7472 616e 736d ry before transm │ │ │ │ +0011ddf0: 6973 7369 6f6e 2920 616e 6420 7365 7420 ission) and set │ │ │ │ +0011de00: 7468 6520 3c63 6f64 653e 5f5f 7369 7a65 the __size │ │ │ │ +0011de10: 3c2f 636f 6465 3e20 6d65 6d62 6572 2076 member v │ │ │ │ +0011de20: 6172 6961 626c 6520 6f66 2074 6865 2061 ariable of the a │ │ │ │ +0011de30: 7474 6163 686d 656e 7420 7374 7275 6374 ttachment struct │ │ │ │ +0011de40: 2f63 6c61 7373 2074 6f20 7a65 726f 2e20 /class to zero. │ │ │ │ +0011de50: 5768 656e 204d 494d 452f 4d54 4f4d 2061 When MIME/MTOM a │ │ │ │ +0011de60: 7474 6163 686d 656e 7420 6368 756e 6b69 ttachment chunki │ │ │ │ +0011de70: 6e67 2069 7320 656e 6162 6c65 642c 2074 ng is enabled, t │ │ │ │ +0011de80: 6869 7320 6361 6c6c 6261 636b 2073 686f his callback sho │ │ │ │ +0011de90: 756c 6420 636f 6d70 6c65 7465 6c79 2066 uld completely f │ │ │ │ +0011dea0: 696c 6c20 7468 6520 3c63 6f64 653e 6275 ill the bu │ │ │ │ +0011deb0: 663c 2f63 6f64 653e 2062 7566 6665 7220 f buffer │ │ │ │ +0011dec0: 7769 7468 203c 636f 6465 3e6c 656e 3c2f with len bytes unle │ │ │ │ +0011dee0: 7373 2074 6865 206c 6173 7420 6461 7461 ss the last data │ │ │ │ +0011def0: 2063 6875 6e6b 2069 7320 7265 6163 6865 chunk is reache │ │ │ │ +0011df00: 6420 616e 6420 6665 7765 7220 6279 7465 d and fewer byte │ │ │ │ +0011df10: 7320 6172 6520 7265 7475 726e 6564 2e3c s are returned.< │ │ │ │ +0011df20: 2f6c 693e 0a3c 6c69 3e3c 636f 6465 3e76 /li>.
    • v │ │ │ │ +0011df30: 6f69 6420 282a 736f 6170 2e66 6d69 6d65 oid (*soap.fmime │ │ │ │ +0011df40: 7265 6164 636c 6f73 6529 2873 7472 7563 readclose)(struc │ │ │ │ +0011df50: 7420 736f 6170 202a 736f 6170 2c20 766f t soap *soap, vo │ │ │ │ +0011df60: 6964 202a 6861 6e64 6c65 293c 2f63 6f64 id *handle) This callback │ │ │ │ +0011df80: 2069 7320 6361 6c6c 6564 2062 7920 7468 is called by th │ │ │ │ +0011df90: 6520 656e 6769 6e65 2074 6f20 636c 6f73 e engine to clos │ │ │ │ +0011dfa0: 6520 7468 6520 4d49 4d45 2f4d 544f 4d20 e the MIME/MTOM │ │ │ │ +0011dfb0: 6174 7461 6368 6d65 6e74 2073 7472 6561 attachment strea │ │ │ │ +0011dfc0: 6d20 6166 7465 7220 7265 6164 696e 672e m after reading. │ │ │ │ +0011dfd0: 2054 6865 203c 636f 6465 3e68 616e 646c The handl │ │ │ │ +0011dfe0: 653c 2f63 6f64 653e 2070 6172 616d 6574 e paramet │ │ │ │ +0011dff0: 6572 2063 6f6e 7461 696e 7320 7468 6520 er contains the │ │ │ │ +0011e000: 6861 6e64 6c65 2072 6574 7572 6e65 6420 handle returned │ │ │ │ +0011e010: 6279 2074 6865 203c 636f 6465 3e3c 6120 by the soap::f │ │ │ │ +0011e0c0: 6d69 6d65 7265 6164 6f70 656e 3c2f 613e mimereadopen │ │ │ │ +0011e0d0: 3c2f 636f 6465 3e20 6361 6c6c 6261 636b callback │ │ │ │ +0011e0e0: 2e3c 2f6c 693e 0a3c 6c69 3e3c 636f 6465 .
    • .
    • void *(*soap.fm │ │ │ │ +0011e100: 696d 6577 7269 7465 6f70 656e 2928 7374 imewriteopen)(st │ │ │ │ +0011e110: 7275 6374 2073 6f61 7020 2a73 6f61 702c ruct soap *soap, │ │ │ │ +0011e120: 2076 6f69 6420 2a68 616e 646c 652c 2063 void *handle, c │ │ │ │ +0011e130: 6f6e 7374 2063 6861 7220 2a69 642c 2063 onst char *id, c │ │ │ │ +0011e140: 6f6e 7374 2063 6861 7220 2a74 7970 652c onst char *type, │ │ │ │ +0011e150: 2063 6f6e 7374 2063 6861 7220 2a64 6573 const char *des │ │ │ │ +0011e160: 6372 6970 7469 6f6e 2c20 656e 756d 2073 cription, enum s │ │ │ │ +0011e170: 6f61 705f 6d69 6d65 5f65 6e63 6f64 696e oap_mime_encodin │ │ │ │ +0011e180: 6720 656e 636f 6469 6e67 293c 2f63 6f64 g encoding) Called by the │ │ │ │ +0011e1a0: 2074 6f20 7374 6172 7420 7265 6365 6976 to start receiv │ │ │ │ +0011e1b0: 696e 6720 6120 7374 7265 616d 696e 6720 ing a streaming │ │ │ │ +0011e1c0: 4d49 4d45 2f4d 544f 4d20 6174 7461 6368 MIME/MTOM attach │ │ │ │ +0011e1d0: 6d65 6e74 2e20 5468 6973 2063 616c 6c62 ment. This callb │ │ │ │ +0011e1e0: 6163 6b20 6f70 656e 7320 6120 7374 7265 ack opens a stre │ │ │ │ +0011e1f0: 616d 2074 6f20 7374 6172 7420 7772 6974 am to start writ │ │ │ │ +0011e200: 696e 6720 7468 6520 6174 7461 6368 6d65 ing the attachme │ │ │ │ +0011e210: 6e74 2064 6174 6120 7265 6365 6976 6564 nt data received │ │ │ │ +0011e220: 2e20 5468 6520 6163 7475 616c 2064 6174 . The actual dat │ │ │ │ +0011e230: 6120 7374 7265 616d 2077 696c 6c20 6265 a stream will be │ │ │ │ +0011e240: 2077 7269 7474 656e 2069 6e20 6368 756e written in chun │ │ │ │ +0011e250: 6b73 2075 7369 6e67 2074 6865 203c 636f ks using the soap::fmimew │ │ │ │ +0011e300: 7269 7465 3c2f 613e 3c2f 636f 6465 3e20 rite │ │ │ │ +0011e310: 6361 6c6c 6261 636b 2075 6e74 696c 206e callback until n │ │ │ │ +0011e320: 6f20 6d6f 7265 2064 6174 6120 6973 2061 o more data is a │ │ │ │ +0011e330: 7661 696c 6162 6c65 2061 6e64 2074 6865 vailable and the │ │ │ │ +0011e340: 203c 636f 6465 3e3c 6120 636c 6173 733d soap::fmimewr │ │ │ │ +0011e3f0: 6974 6563 6c6f 7365 3c2f 613e 3c2f 636f iteclose callback is │ │ │ │ +0011e410: 6361 6c6c 6564 2074 6f20 636c 6f73 6520 called to close │ │ │ │ +0011e420: 7468 6520 7374 7265 616d 2e20 5468 6520 the stream. The │ │ │ │ +0011e430: 3c63 6f64 653e 6964 3c2f 636f 6465 3e2c id, │ │ │ │ +0011e440: 203c 636f 6465 3e74 7970 653c 2f63 6f64 type and opt │ │ │ │ +0011e460: 696f 6e73 3c2f 636f 6465 3e20 7061 7261 ions para │ │ │ │ +0011e470: 6d65 7465 7273 2061 7265 2074 6865 203c meters are the < │ │ │ │ +0011e480: 636f 6465 3e69 643c 2f63 6f64 653e 2c20 code>id, │ │ │ │ +0011e490: 3c63 6f64 653e 7479 7065 3c2f 636f 6465 type and opti │ │ │ │ +0011e4b0: 6f6e 733c 2f63 6f64 653e 206f 6620 7468 ons of th │ │ │ │ +0011e4c0: 6520 6174 7461 6368 6d65 6e74 2073 7472 e attachment str │ │ │ │ +0011e4d0: 7563 742f 636c 6173 7320 2865 2e67 2e20 uct/class (e.g. │ │ │ │ +0011e4e0: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 xsd__base64B │ │ │ │ +0011e560: 696e 6172 793c 2f61 3e3c 2f63 6f64 653e inary │ │ │ │ +0011e570: 206f 7220 3c63 6f64 653e 3c61 2063 6c61 or │ │ │ │ +0011e5e0: 5f78 6f70 5f5f 496e 636c 7564 653c 2f61 _xop__Include with __ptr │ │ │ │ +0011e610: 2c20 3c63 6f64 653e 5f5f 7369 7a65 3c2f , __size, id< │ │ │ │ +0011e630: 2f63 6f64 653e 2c20 3c63 6f64 653e 7479 /code>, ty │ │ │ │ +0011e640: 7065 3c2f 636f 6465 3e20 616e 6420 3c63 pe and options members), res │ │ │ │ +0011e670: 7065 6374 6976 656c 792e 2054 6865 2063 pectively. The c │ │ │ │ +0011e680: 616c 6c62 6163 6b20 7368 6f75 6c64 2072 allback should r │ │ │ │ +0011e690: 6574 7572 6e20 6120 6861 6e64 6c65 2c20 eturn a handle, │ │ │ │ +0011e6a0: 7768 6963 6820 6973 2070 6173 7365 6420 which is passed │ │ │ │ +0011e6b0: 746f 2074 6865 203c 636f 6465 3e3c 6120 to the so │ │ │ │ +0011e750: 6170 3a3a 666d 696d 6577 7269 7465 3c2f ap::fmimewrite and │ │ │ │ +0011e810: 736f 6170 3a3a 666d 696d 6577 7269 7465 soap::fmimewrite │ │ │ │ +0011e820: 636c 6f73 653c 2f61 3e3c 2f63 6f64 653e close │ │ │ │ +0011e830: 2063 616c 6c62 6163 6b73 2e20 5468 6520 callbacks. The │ │ │ │ +0011e840: 3c63 6f64 653e 5f5f 7074 723c 2f63 6f64 __ptr member variab │ │ │ │ +0011e860: 6c65 206f 6620 7468 6520 6174 7461 6368 le of the attach │ │ │ │ +0011e870: 6d65 6e74 2073 7472 7563 742f 636c 6173 ment struct/clas │ │ │ │ +0011e880: 7320 6973 2073 6574 2062 7920 7468 6520 s is set by the │ │ │ │ +0011e890: 656e 6769 6e65 2074 6f20 7468 6520 7661 engine to the va │ │ │ │ +0011e8a0: 6c75 6520 6f66 2074 6869 7320 6861 6e64 lue of this hand │ │ │ │ +0011e8b0: 6c65 2e20 5468 6520 3c63 6f64 653e 5f5f le. The __ │ │ │ │ +0011e8c0: 7369 7a65 3c2f 636f 6465 3e20 6d65 6d62 size memb │ │ │ │ +0011e8d0: 6572 2076 6172 6961 626c 6520 6973 2073 er variable is s │ │ │ │ +0011e8e0: 6574 2074 6f20 7468 6520 7369 7a65 206f et to the size o │ │ │ │ +0011e8f0: 6620 7468 6520 6174 7461 6368 6d65 6e74 f the attachment │ │ │ │ +0011e900: 2072 6563 6569 7665 642e 3c2f 6c69 3e0a received.
    • . │ │ │ │ +0011e910: 3c6c 693e 3c63 6f64 653e 696e 7420 282a
    • int (* │ │ │ │ +0011e920: 736f 6170 2e66 6d69 6d65 7772 6974 6529 soap.fmimewrite) │ │ │ │ +0011e930: 2873 7472 7563 7420 736f 6170 202a 736f (struct soap *so │ │ │ │ +0011e940: 6170 2c20 766f 6964 202a 6861 6e64 6c65 ap, void *handle │ │ │ │ +0011e950: 2c20 636f 6e73 7420 6368 6172 202a 6275 , const char *bu │ │ │ │ +0011e960: 662c 2073 697a 655f 7420 6c65 6e29 3c2f f, size_t len) This callb │ │ │ │ +0011e980: 6163 6b20 6973 2063 616c 6c65 6420 6279 ack is called by │ │ │ │ +0011e990: 2074 6865 2065 6e67 696e 6520 746f 2077 the engine to w │ │ │ │ +0011e9a0: 7269 7465 2061 2063 6875 6e6b 206f 6620 rite a chunk of │ │ │ │ +0011e9b0: 6174 7461 6368 6d65 6e74 2064 6174 6120 attachment data │ │ │ │ +0011e9c0: 7265 6365 6976 6564 2e20 5468 6520 3c63 received. The handle parameter cont │ │ │ │ +0011e9f0: 6169 6e73 2074 6865 2068 616e 646c 6520 ains the handle │ │ │ │ +0011ea00: 7265 7475 726e 6564 2062 7920 7468 6520 returned by the │ │ │ │ +0011ea10: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 soap::fmimewri │ │ │ │ +0011eac0: 7465 6f70 656e 3c2f 613e 3c2f 636f 6465 teopen callback. The │ │ │ │ +0011eae0: 3c63 6f64 653e 6275 663c 2f63 6f64 653e buf │ │ │ │ +0011eaf0: 2070 6172 616d 6574 6572 2063 6f6e 7461 parameter conta │ │ │ │ +0011eb00: 696e 7320 7468 6520 6461 7461 206f 6620 ins the data of │ │ │ │ +0011eb10: 6c65 6e67 7468 203c 636f 6465 3e6c 656e length len │ │ │ │ +0011eb20: 3c2f 636f 6465 3e2e 2052 6574 7572 6e73 . Returns │ │ │ │ +0011eb30: 203c 636f 6465 3e23 534f 4150 5f4f 4b3c #SOAP_OK< │ │ │ │ +0011eb40: 2f63 6f64 653e 206f 7220 6120 3c63 6f64 /code> or a soap_status (int) │ │ │ │ +0011ec20: 6572 726f 7220 636f 6465 2e3c 2f6c 693e error code.
    • │ │ │ │ +0011ec30: 0a3c 6c69 3e3c 636f 6465 3e76 6f69 6420 .
    • void │ │ │ │ +0011ec40: 282a 736f 6170 2e66 6d69 6d65 7772 6974 (*soap.fmimewrit │ │ │ │ +0011ec50: 6563 6c6f 7365 2928 7374 7275 6374 2073 eclose)(struct s │ │ │ │ +0011ec60: 6f61 7020 2a73 6f61 702c 2076 6f69 6420 oap *soap, void │ │ │ │ +0011ec70: 2a68 616e 646c 6529 3c2f 636f 6465 3e20 *handle) │ │ │ │ +0011ec80: 5468 6973 2063 616c 6c62 6163 6b20 6973 This callback is │ │ │ │ +0011ec90: 2063 616c 6c65 6420 6279 2074 6865 2065 called by the e │ │ │ │ +0011eca0: 6e67 696e 6520 746f 2063 6c6f 7365 2074 ngine to close t │ │ │ │ +0011ecb0: 6865 204d 494d 452f 4d54 4f4d 2061 7474 he MIME/MTOM att │ │ │ │ +0011ecc0: 6163 686d 656e 7420 7374 7265 616d 2061 achment stream a │ │ │ │ +0011ecd0: 6674 6572 2077 7269 7469 6e67 2e20 5468 fter writing. Th │ │ │ │ +0011ece0: 6520 3c63 6f64 653e 6861 6e64 6c65 3c2f e handle parameter │ │ │ │ +0011ed00: 636f 6e74 6169 6e73 2074 6865 2068 616e contains the han │ │ │ │ +0011ed10: 646c 6520 7265 7475 726e 6564 2062 7920 dle returned by │ │ │ │ +0011ed20: 7468 6520 3c63 6f64 653e 3c61 2063 6c61 the soap::fmim │ │ │ │ +0011edd0: 6577 7269 7465 6f70 656e 3c2f 613e 3c2f ewriteopen callback.< │ │ │ │ +0011edf0: 2f6c 693e 0a3c 2f75 6c3e 0a3c 703e 496e /li>.
    .

    In │ │ │ │ +0011ee00: 2061 6464 6974 696f 6e2c 2061 203c 636f addition, a void* soap::user< │ │ │ │ +0011eee0: 2f63 6f64 653e 206d 656d 6265 7220 6973 /code> member is │ │ │ │ +0011eef0: 2061 7661 696c 6162 6c65 2074 6f20 7061 available to pa │ │ │ │ +0011ef00: 7373 2075 7365 722d 6465 6669 6e65 6420 ss user-defined │ │ │ │ +0011ef10: 6461 7461 2074 6f20 7468 6520 6361 6c6c data to the call │ │ │ │ +0011ef20: 6261 636b 732e 2054 6869 7320 7761 792c backs. This way, │ │ │ │ +0011ef30: 2079 6f75 2063 616e 2073 6574 203c 636f you can set void* soap::user< │ │ │ │ +0011f010: 2f63 6f64 653e 2074 6f20 706f 696e 7420 /code> to point │ │ │ │ +0011f020: 746f 2061 7070 6c69 6361 7469 6f6e 2064 to application d │ │ │ │ +0011f030: 6174 6120 7468 6174 2074 6865 2063 616c ata that the cal │ │ │ │ +0011f040: 6c62 6163 6b73 206e 6565 6420 7375 6368 lbacks need such │ │ │ │ +0011f050: 2061 7320 6120 6669 6c65 206e 616d 6520 as a file name │ │ │ │ +0011f060: 666f 7220 6578 616d 706c 652e 3c2f 703e for example.

    │ │ │ │ +0011f070: 0a3c 703e 5468 6520 666f 6c6c 6f77 696e .

    The followin │ │ │ │ +0011f080: 6720 6578 616d 706c 6520 696c 6c75 7374 g example illust │ │ │ │ +0011f090: 7261 7465 7320 7468 6520 636c 6965 6e74 rates the client │ │ │ │ +0011f0a0: 2d73 6964 6520 696e 6974 6961 6c69 7a61 -side initializa │ │ │ │ +0011f0b0: 7469 6f6e 206f 6620 616e 2069 6d61 6765 tion of an image │ │ │ │ +0011f0c0: 2061 7474 6163 686d 656e 7420 7374 7275 attachment stru │ │ │ │ +0011f0d0: 6374 2074 6f20 7374 7265 616d 2061 2066 ct to stream a f │ │ │ │ +0011f0e0: 696c 6520 696e 746f 2061 204d 544f 4d20 ile into a MTOM │ │ │ │ +0011f0f0: 6174 7461 6368 6d65 6e74 2077 6974 686f attachment witho │ │ │ │ +0011f100: 7574 2048 5454 5020 6368 756e 6b69 6e67 ut HTTP chunking │ │ │ │ +0011f110: 2028 4854 5450 2073 7472 6561 6d69 6e67 (HTTP streaming │ │ │ │ +0011f120: 2063 6875 6e6b 6564 204d 544f 4d20 7472 chunked MTOM tr │ │ │ │ +0011f130: 616e 7366 6572 2069 7320 7072 6573 656e ansfer is presen │ │ │ │ +0011f140: 7465 6420 696e 2053 6563 7469 6f6e 203c ted in Section < │ │ │ │ +0011f150: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ +0011f160: 663d 2269 6e64 6578 2e68 746d 6c23 6d69 f="index.html#mi │ │ │ │ +0011f170: 6d65 6368 756e 6b69 6e67 223e 5374 7265 mechunking">Stre │ │ │ │ +0011f180: 616d 696e 6720 6368 756e 6b65 6420 4d49 aming chunked MI │ │ │ │ +0011f190: 4d45 2f4d 544f 4d3c 2f61 3e20 293a 3c2f ME/MTOM ):.

    int │ │ │ │ +0011f1f0: 6d61 696e 2829 203c 2f64 6976 3e0a 3c64 main()
    . │ │ │ │ +0011f210: 7b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 {
    .
    struct │ │ │ │ +0011f250: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap │ │ │ │ +0011f280: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap; │ │ │ │ +0011f2b0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    struct │ │ │ │ +0011f2f0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 xsd__base │ │ │ │ +0011f330: 3634 4269 6e61 7279 3c2f 613e 2069 6d61 64Binary ima │ │ │ │ +0011f340: 6765 3b20 3c2f 6469 763e 0a3c 6469 7620 ge;
    .
    F │ │ │ │ +0011f360: 494c 4520 2a66 643b 203c 2f64 6976 3e0a ILE *fd;
    . │ │ │ │ +0011f370: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    struct │ │ │ │ +0011f3a0: 203c 2f73 7061 6e3e 7374 6174 2073 623b stat sb; │ │ │ │ +0011f3b0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    soap_init1( │ │ │ │ +0011f430: 2661 6d70 3b3c 6120 636c 6173 733d 2263 &soap │ │ │ │ +0011f460: 3c2f 613e 2c20 3c61 2063 6c61 7373 3d22 , SOAP_EN │ │ │ │ +0011f4c0: 435f 4d54 4f4d 3c2f 613e 293b 203c 7370 C_MTOM); // mandatory │ │ │ │ +0011f4f0: 746f 2065 6e61 626c 6520 4d54 4f4d 203c to enable MTOM < │ │ │ │ +0011f500: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    . │ │ │ │ +0011f520: 203c 7370 616e 2063 6c61 7373 3d22 6b65 if
    (!fstat(fil │ │ │ │ +0011f550: 656e 6f28 6664 292c 2026 616d 703b 7362 eno(fd), &sb │ │ │ │ +0011f560: 2920 2661 6d70 3b26 616d 703b 2073 622e ) && sb. │ │ │ │ +0011f570: 7374 5f73 697a 6520 2667 743b 2030 2920 st_size > 0) │ │ │ │ +0011f580: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    {.
    / │ │ │ │ +0011f5d0: 2f20 6265 6361 7573 6520 7765 2063 616e / because we can │ │ │ │ +0011f5e0: 2067 6574 2074 6865 206c 656e 6774 6820 get the length │ │ │ │ +0011f5f0: 6f66 2074 6865 2066 696c 652c 2077 6520 of the file, we │ │ │ │ +0011f600: 6361 6e20 7374 7265 616d 2069 7420 7769 can stream it wi │ │ │ │ +0011f610: 7468 6f75 7420 6368 756e 6b69 6e67 203c thout chunking < │ │ │ │ +0011f620: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    . │ │ │ │ +0011f640: 2020 203c 6120 636c 6173 733d 2263 6f64 soap.fmimer │ │ │ │ +0011f6d0: 6561 646f 7065 6e3c 2f61 3e20 3d20 6d69 eadopen = mi │ │ │ │ +0011f6e0: 6d65 5f72 6561 645f 6f70 656e 3b20 3c2f me_read_open; .
    soap.fmimereadclose │ │ │ │ +0011f7a0: 3c2f 613e 203d 206d 696d 655f 7265 6164 = mime_read │ │ │ │ +0011f7b0: 5f63 6c6f 7365 3b20 3c2f 6469 763e 0a3c _close;
    .< │ │ │ │ +0011f7c0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +0011f7d0: 3e20 2020 203c 6120 636c 6173 733d 2263 > soap │ │ │ │ +0011f800: 3c2f 613e 2e3c 6120 636c 6173 733d 2263 .fmim │ │ │ │ +0011f860: 6572 6561 643c 2f61 3e20 3d20 6d69 6d65 eread = mime │ │ │ │ +0011f870: 5f72 6561 643b 203c 2f64 6976 3e0a 3c64 _read;
    . │ │ │ │ +0011f890: 2020 2020 696d 6167 652e 5f5f 7074 7220 image.__ptr │ │ │ │ +0011f8a0: 3d20 283c 7370 616e 2063 6c61 7373 3d22 = (uns │ │ │ │ +0011f8c0: 6967 6e65 643c 2f73 7061 6e3e 203c 7370 igned char*)fd; // │ │ │ │ +0011f910: 206d 7573 7420 7365 7420 746f 206e 6f6e must set to non │ │ │ │ +0011f920: 2d4e 554c 4c20 2874 6869 7320 6973 206f -NULL (this is o │ │ │ │ +0011f930: 7572 2066 6420 6861 6e64 6c65 2077 6869 ur fd handle whi │ │ │ │ +0011f940: 6368 2077 6520 6e65 6564 2069 6e20 7468 ch we need in th │ │ │ │ +0011f950: 6520 6361 6c6c 6261 636b 7329 203c 2f73 e callbacks)
    .
    │ │ │ │ +0011f980: 2069 6d61 6765 2e5f 5f73 697a 6520 3d20 image.__size = │ │ │ │ +0011f990: 7362 2e73 745f 7369 7a65 3b20 3c73 7061 sb.st_size; // must set si │ │ │ │ +0011f9c0: 7a65 203c 2f73 7061 6e3e 3c2f 6469 763e ze
    │ │ │ │ +0011f9d0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    }
    . │ │ │ │ +0011fa00: 2020 3c73 7061 6e20 636c 6173 733d 226b else │ │ │ │ +0011fa20: 3c2f 7370 616e 3e20 3c2f 6469 763e 0a3c
    .< │ │ │ │ +0011fa30: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +0011fa40: 3e20 207b 3c2f 6469 763e 0a3c 6469 7620 > {
    .
    │ │ │ │ +0011fa60: 203c 7370 616e 2063 6c61 7373 3d22 636f // don │ │ │ │ +0011fa80: 393b 7420 6b6e 6f77 2074 6865 2073 697a 9;t know the siz │ │ │ │ +0011fa90: 652c 2073 6f20 6275 6666 6572 2069 7420 e, so buffer it │ │ │ │ +0011faa0: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ │ +0011fac0: 2020 2020 3c73 7061 6e20 636c 6173 733d si │ │ │ │ +0011fae0: 7a65 5f74 3c2f 7370 616e 3e20 693b 203c ze_t i; < │ │ │ │ +0011faf0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    int │ │ │ │ +0011fb30: 2063 3b20 3c2f 6469 763e 0a3c 6469 7620 c;
    .
    │ │ │ │ +0011fb50: 2069 6d61 6765 2e5f 5f70 7472 203d 2028 image.__ptr = ( │ │ │ │ +0011fb60: 3c73 7061 6e20 636c 6173 733d 226b 6579 unsign │ │ │ │ +0011fb80: 6564 3c2f 7370 616e 3e20 3c73 7061 6e20 ed char* │ │ │ │ +0011fbb0: 293c 6120 636c 6173 733d 2263 6f64 6522 )soap_mallo │ │ │ │ +0011fc10: 633c 2f61 3e28 2661 6d70 3b3c 6120 636c c(&soap, MAX_ │ │ │ │ +0011fc50: 4649 4c45 5f53 495a 4529 3b20 3c2f 6469 FILE_SIZE); .
    for (i │ │ │ │ +0011fca0: 203d 2030 3b20 6920 266c 743b 204d 4158 = 0; i < MAX │ │ │ │ +0011fcb0: 5f46 494c 455f 5349 5a45 3b20 692b 2b29 _FILE_SIZE; i++) │ │ │ │ +0011fcc0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    {< │ │ │ │ +0011fce0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    if ((c = fgetc(fd │ │ │ │ +0011fd30: 2929 203d 3d20 454f 4629 203c 2f64 6976 )) == EOF)
    .
    break;
    .
    │ │ │ │ +0011fda0: 2020 2069 6d61 6765 2e5f 5f70 7472 5b69 image.__ptr[i │ │ │ │ +0011fdb0: 5d20 3d20 633b 203c 2f64 6976 3e0a 3c64 ] = c;
    . │ │ │ │ +0011fdd0: 2020 2020 7d20 3c2f 6469 763e 0a3c 6469 }
    . │ │ │ │ +0011fdf0: 2020 2066 636c 6f73 6528 6664 293b 203c fclose(fd); < │ │ │ │ +0011fe00: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    imag │ │ │ │ +0011fe20: 652e 5f5f 7369 7a65 203d 2069 3b20 3c2f e.__size = i; .
    }
    .
    image.type │ │ │ │ +0011fe70: 203d 203c 7370 616e 2063 6c61 7373 3d22 = & │ │ │ │ +0011fe90: 7175 6f74 3b69 6d61 6765 2f6a 7065 6726 quot;image/jpeg& │ │ │ │ +0011fea0: 7175 6f74 3b3c 2f73 7061 6e3e 3b20 3c73 quot;; // MIME type │ │ │ │ +0011fed0: 203c 2f73 7061 6e3e 3c2f 6469 763e 0a3c
    .< │ │ │ │ +0011fee0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +0011fef0: 3e20 2069 6d61 6765 2e6f 7074 696f 6e73 > image.options │ │ │ │ +0011ff00: 203d 203c 7370 616e 2063 6c61 7373 3d22 = & │ │ │ │ +0011ff20: 7175 6f74 3b54 6869 7320 6973 206d 7920 quot;This is my │ │ │ │ +0011ff30: 7069 6374 7572 6526 7175 6f74 3b3c 2f73 picture"; // d │ │ │ │ +0011ff60: 6573 6372 6970 7469 6f6e 206f 6620 6f62 escription of ob │ │ │ │ +0011ff70: 6a65 6374 203c 2f73 7061 6e3e 3c2f 6469 ject .
    if (soap │ │ │ │ +0011ffc0: 5f63 616c 6c5f 6e73 5f5f 7765 626d 6574 _call_ns__webmet │ │ │ │ +0011ffd0: 686f 6428 2661 6d70 3b3c 6120 636c 6173 hod(& │ │ │ │ +00120000: 736f 6170 3c2f 613e 2c20 2e2e 2e29 293c soap, ...))< │ │ │ │ +00120010: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    ... │ │ │ │ +00120030: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // error
    .
    │ │ │ │ +00120070: 3c73 7061 6e20 636c 6173 733d 226b 6579 else
    .
    │ │ │ │ +001200b0: 2020 2e2e 2e20 3c73 7061 6e20 636c 6173 ... // s │ │ │ │ +001200d0: 7563 6365 7373 3c2f 7370 616e 3e3c 2f64 uccess.
    }
    .< │ │ │ │ +00120100: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00120110: 3e20 3c2f 6469 763e 0a3c 6469 7620 636c >
    .
    void │ │ │ │ +00120150: 202a 6d69 6d65 5f72 6561 645f 6f70 656e *mime_read_open │ │ │ │ +00120160: 283c 7370 616e 2063 6c61 7373 3d22 6b65 (struct soap │ │ │ │ +001201b0: 3c2f 613e 202a 3c61 2063 6c61 7373 3d22 *soa │ │ │ │ +001201e0: 703c 2f61 3e2c 203c 7370 616e 2063 6c61 p, void *ha │ │ │ │ +00120210: 6e64 6c65 2c20 3c73 7061 6e20 636c 6173 ndle, cons │ │ │ │ +00120230: 743c 2f73 7061 6e3e 203c 7370 616e 2063 t char * │ │ │ │ +00120260: 3c73 7061 6e20 636c 6173 733d 226b 6579 id, const │ │ │ │ +001202a0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c char *t │ │ │ │ +001202d0: 7970 652c 203c 7370 616e 2063 6c61 7373 ype, const │ │ │ │ +001202f0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c char *d │ │ │ │ +00120320: 6573 6372 6970 7469 6f6e 2920 3c2f 6469 escription) .
    {
    . │ │ │ │ +00120360: 203c 7370 616e 2063 6c61 7373 3d22 6b65 retur │ │ │ │ +00120380: 6e3c 2f73 7061 6e3e 2068 616e 646c 653b n handle; │ │ │ │ +00120390: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    } .
    .< │ │ │ │ +001203e0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +001203f0: 6f72 6474 7970 6522 3e76 6f69 643c 2f73 ordtype">void mime_read_c │ │ │ │ +00120410: 6c6f 7365 283c 7370 616e 2063 6c61 7373 lose(struc │ │ │ │ +00120430: 743c 2f73 7061 6e3e 203c 6120 636c 6173 t │ │ │ │ +00120460: 736f 6170 3c2f 613e 202a 3c61 2063 6c61 soap *soap, void │ │ │ │ +001204c0: 202a 6861 6e64 6c65 2920 3c2f 6469 763e *handle)
    │ │ │ │ +001204d0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    {
    .
    f │ │ │ │ +00120500: 636c 6f73 6528 2846 494c 452a 2968 616e close((FILE*)han │ │ │ │ +00120510: 646c 6529 3b20 3c2f 6469 763e 0a3c 6469 dle);
    .} │ │ │ │ +00120530: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    .
    si │ │ │ │ +00120580: 7a65 5f74 3c2f 7370 616e 3e20 6d69 6d65 ze_t mime │ │ │ │ +00120590: 5f72 6561 6428 3c73 7061 6e20 636c 6173 _read(stru │ │ │ │ +001205b0: 6374 3c2f 7370 616e 3e20 3c61 2063 6c61 ct soap *soap, void *handle, char │ │ │ │ +00120670: 202a 6275 662c 203c 7370 616e 2063 6c61 *buf, size_t l │ │ │ │ +001206a0: 656e 2920 3c2f 6469 763e 0a3c 6469 7620 en)
    .
    {.
    return │ │ │ │ +00120700: 2066 7265 6164 2862 7566 2c20 312c 206c fread(buf, 1, l │ │ │ │ +00120710: 656e 2c20 2846 494c 452a 2968 616e 646c en, (FILE*)handl │ │ │ │ +00120720: 6529 3b20 3c2f 6469 763e 0a3c 6469 7620 e);
    .
    }.
    │ │ │ │ +001207b0: 3c61 2068 7265 663d 2267 726f 7570 5f5f soap:: │ │ │ │ +00120800: 666d 696d 6572 6561 646f 7065 6e3c 2f61 fmimereadopen
    void │ │ │ │ +00120830: 2a28 2a20 666d 696d 6572 6561 646f 7065 *(* fmimereadope │ │ │ │ +00120840: 6e29 2873 7472 7563 7420 736f 6170 202a n)(struct soap * │ │ │ │ +00120850: 736f 6170 2c20 766f 6964 202a 2c20 636f soap, void *, co │ │ │ │ +00120860: 6e73 7420 6368 6172 202a 2c20 636f 6e73 nst char *, cons │ │ │ │ +00120870: 7420 6368 6172 202a 2c20 636f 6e73 7420 t char *, const │ │ │ │ +00120880: 6368 6172 202a 293c 2f64 6976 3e3c 6469 char *)
    │ │ │ │ +001208a0: 4361 6c6c 6261 636b 2074 6f20 6f70 656e Callback to open │ │ │ │ +001208b0: 2061 2073 7472 6561 6d69 6e67 204d 494d a streaming MIM │ │ │ │ +001208c0: 452f 4d54 4f4d 2061 7474 6163 686d 656e E/MTOM attachmen │ │ │ │ +001208d0: 7420 666f 7220 7265 6164 696e 672e 3c2f t for reading.
    Defini │ │ │ │ +00120900: 7469 6f6e 3a3c 2f62 3e20 7374 6473 6f61 tion: stdsoa │ │ │ │ +00120910: 7032 2e68 3a34 3839 363c 2f64 6976 3e3c p2.h:4896
    < │ │ │ │ +00120920: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    .
    size_t(* fm │ │ │ │ +00120bd0: 696d 6572 6561 6429 2873 7472 7563 7420 imeread)(struct │ │ │ │ +00120be0: 736f 6170 202a 736f 6170 2c20 766f 6964 soap *soap, void │ │ │ │ +00120bf0: 202a 6861 6e64 6c65 2c20 6368 6172 202a *handle, char * │ │ │ │ +00120c00: 6275 662c 2073 697a 655f 7420 6c65 6e29 buf, size_t len) │ │ │ │ +00120c10: 3c2f 6469 763e 3c64 6976 2063 6c61 7373
    Callbac │ │ │ │ +00120c30: 6b20 746f 2072 6561 6420 6461 7461 2069 k to read data i │ │ │ │ +00120c40: 6e20 6120 4d49 4d45 2f4d 544f 4d20 6174 n a MIME/MTOM at │ │ │ │ +00120c50: 7461 6368 6d65 6e74 2073 7472 6561 6d2e tachment stream. │ │ │ │ +00120c60: 3c2f 6469 763e 3c64 6976 2063 6c61 7373
    Defi │ │ │ │ +00120c80: 6e69 7469 6f6e 3a3c 2f62 3e20 7374 6473 nition: stds │ │ │ │ +00120c90: 6f61 7032 2e68 3a34 3931 343c 2f64 6976 oap2.h:4914
    .
    < │ │ │ │ +00120cc0: 703e 5468 6520 666f 6c6c 6f77 696e 6720 p>The following │ │ │ │ +00120cd0: 6578 616d 706c 6520 696c 6c75 7374 7261 example illustra │ │ │ │ +00120ce0: 7465 7320 7468 6520 7374 7265 616d 696e tes the streamin │ │ │ │ +00120cf0: 6720 6f66 2061 204d 494d 452f 4d54 4f4d g of a MIME/MTOM │ │ │ │ +00120d00: 2061 7474 6163 686d 656e 7420 696e 746f attachment into │ │ │ │ +00120d10: 2061 2066 696c 6520 6279 2061 2063 6c69 a file by a cli │ │ │ │ +00120d20: 656e 743a 3c2f 703e 0a3c 6469 7620 636c ent:

    .
    < │ │ │ │ +00120d40: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00120d50: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >int main() .
    {
    . │ │ │ │ +00120db0: 2020 3c73 7061 6e20 636c 6173 733d 226b struct < │ │ │ │ +00120dd0: 2f73 7061 6e3e 3c61 2063 6c61 7373 3d22 /span>soa │ │ │ │ +00120e00: 703c 2f61 3e20 3c61 2063 6c61 7373 3d22 p soa │ │ │ │ +00120e30: 703c 2f61 3e3b 203c 2f64 6976 3e0a 3c64 p;
    . │ │ │ │ +00120e50: 2020 3c61 2063 6c61 7373 3d22 636f 6465 soap_init │ │ │ │ +00120eb0: 3c2f 613e 2826 616d 703b 3c61 2063 6c61 (&soap); .
    so │ │ │ │ +00120f30: 6170 3c2f 613e 2e3c 6120 636c 6173 733d ap.fm │ │ │ │ +00120f90: 696d 6577 7269 7465 6f70 656e 3c2f 613e imewriteopen │ │ │ │ +00120fa0: 203d 206d 696d 655f 7772 6974 655f 6f70 = mime_write_op │ │ │ │ +00120fb0: 656e 3b20 3c2f 6469 763e 0a3c 6469 7620 en;
    .
    < │ │ │ │ +00120fd0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +00120fe0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ +00120ff0: 6874 6d6c 223e 736f 6170 3c2f 613e 2e3c html">soap.< │ │ │ │ +00121000: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +00121010: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ │ +00121020: 705f 5f63 616c 6c62 6163 6b73 2e68 746d p__callbacks.htm │ │ │ │ +00121030: 6c23 6761 3861 6638 3834 3039 3662 3231 l#ga8af884096b21 │ │ │ │ +00121040: 6365 6131 6236 3931 3333 3834 3331 3331 cea1b69133843131 │ │ │ │ +00121050: 6134 3762 223e 666d 696d 6577 7269 7465 a47b">fmimewrite │ │ │ │ +00121060: 636c 6f73 653c 2f61 3e20 3d20 6d69 6d65 close = mime │ │ │ │ +00121070: 5f77 7269 7465 5f63 6c6f 7365 3b20 3c2f _write_close; .
    │ │ │ │ +001210c0: 736f 6170 3c2f 613e 2e3c 6120 636c 6173 soap. │ │ │ │ +00121120: 666d 696d 6577 7269 7465 3c2f 613e 203d fmimewrite = │ │ │ │ +00121130: 206d 696d 655f 7772 6974 653b 203c 2f64 mime_write; .
    if (soa │ │ │ │ +00121180: 705f 6361 6c6c 5f6e 735f 5f77 6562 6d65 p_call_ns__webme │ │ │ │ +00121190: 7468 6f64 2826 616d 703b 3c61 2063 6c61 thod(&soap, ...)) │ │ │ │ +001211d0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    ... │ │ │ │ +001211f0: 203c 7370 616e 2063 6c61 7373 3d22 636f // error< │ │ │ │ +00121210: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    . │ │ │ │ +00121230: 203c 7370 616e 2063 6c61 7373 3d22 6b65 else< │ │ │ │ +00121250: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    . │ │ │ │ +00121270: 2020 202e 2e2e 203c 7370 616e 2063 6c61 ... // │ │ │ │ +00121290: 7375 6363 6573 733c 2f73 7061 6e3e 3c2f success.
    }
    . │ │ │ │ +001212c0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    .
    void *mime_write_op │ │ │ │ +00121320: 656e 283c 7370 616e 2063 6c61 7373 3d22 en(struct< │ │ │ │ +00121340: 2f73 7061 6e3e 203c 6120 636c 6173 733d /span> so │ │ │ │ +00121370: 6170 3c2f 613e 202a 3c61 2063 6c61 7373 ap *s │ │ │ │ +001213a0: 6f61 703c 2f61 3e2c 203c 7370 616e 2063 oap, c │ │ │ │ +001213c0: 6f6e 7374 3c2f 7370 616e 3e20 3c73 7061 onst char *id< │ │ │ │ +00121410: 2f73 7061 6e3e 2c20 3c73 7061 6e20 636c /span>, co │ │ │ │ +00121430: 6e73 743c 2f73 7061 6e3e 203c 7370 616e nst char │ │ │ │ +00121460: 202a 7479 7065 2c20 3c73 7061 6e20 636c *type, co │ │ │ │ +00121480: 6e73 743c 2f73 7061 6e3e 203c 7370 616e nst char │ │ │ │ +001214b0: 202a 6465 7363 7269 7074 696f 6e2c 203c *description, < │ │ │ │ +001214c0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +001214d0: 6f72 6422 3e65 6e75 6d3c 2f73 7061 6e3e ord">enum │ │ │ │ +001214e0: 203c 6120 636c 6173 733d 2263 6f64 6522 soap_mime_enc │ │ │ │ +00121540: 6f64 696e 673c 2f61 3e20 656e 636f 6469 oding encodi │ │ │ │ +00121550: 6e67 2920 3c2f 6469 763e 0a3c 6469 7620 ng)
    .
    {.
    FILE *h │ │ │ │ +00121590: 616e 646c 6520 3d20 3c61 2063 6c61 7373 andle = f │ │ │ │ +001215f0: 6f70 656e 3c2f 613e 283c 7370 616e 2063 open("somef │ │ │ │ +00121620: 696c 6526 7175 6f74 3b3c 2f73 7061 6e3e ile" │ │ │ │ +00121630: 2c20 3c73 7061 6e20 636c 6173 733d 2273 , &q │ │ │ │ +00121650: 756f 743b 7762 2671 756f 743b 3c2f 7370 uot;wb");
    . │ │ │ │ +00121680: 203c 7370 616e 2063 6c61 7373 3d22 636f // We ign │ │ │ │ +001216a0: 6f72 6520 7468 6520 4d49 4d45 2063 6f6e ore the MIME con │ │ │ │ +001216b0: 7465 6e74 2074 7261 6e73 6665 7220 656e tent transfer en │ │ │ │ +001216c0: 636f 6469 6e67 2068 6572 652c 2062 7574 coding here, but │ │ │ │ +001216d0: 2073 686f 756c 6420 6368 6563 6b20 3c2f should check
    .
    │ │ │ │ +00121700: 3c73 7061 6e20 636c 6173 733d 226b 6579 if (!handle) .
    {
    │ │ │ │ +00121750: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    so │ │ │ │ +00121790: 6170 3c2f 613e 2d26 6774 3b3c 6120 636c ap->error = │ │ │ │ +001217f0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 SOAP_EOF │ │ │ │ +00121850: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
    .
    < │ │ │ │ +00121870: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +00121880: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ +00121890: 6874 6d6c 223e 736f 6170 3c2f 613e 2d26 html">soap-& │ │ │ │ +001218a0: 6774 3b3c 6120 636c 6173 733d 2263 6f64 gt;errn │ │ │ │ +001218f0: 756d 3c2f 613e 203d 2065 7272 6e6f 3b20 um = errno; │ │ │ │ +00121900: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // get rea │ │ │ │ +00121920: 736f 6e20 3c2f 7370 616e 3e3c 2f64 6976 son
    .
    }
    .< │ │ │ │ +00121950: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00121960: 3e20 203c 7370 616e 2063 6c61 7373 3d22 > ret │ │ │ │ +00121980: 7572 6e3c 2f73 7061 6e3e 2028 3c73 7061 urn (void
    *)handle;
    .
    }
    . │ │ │ │ +001219f0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    void m │ │ │ │ +00121a30: 696d 655f 7772 6974 655f 636c 6f73 6528 ime_write_close( │ │ │ │ +00121a40: 3c73 7061 6e20 636c 6173 733d 226b 6579 struct soap< │ │ │ │ +00121a90: 2f61 3e20 2a3c 6120 636c 6173 733d 2263 /a> *soap │ │ │ │ +00121ac0: 3c2f 613e 2c20 3c73 7061 6e20 636c 6173 , │ │ │ │ +00121ae0: 766f 6964 3c2f 7370 616e 3e20 2a68 616e void *han │ │ │ │ +00121af0: 646c 6529 203c 2f64 6976 3e0a 3c64 6976 dle)
    .
    {< │ │ │ │ +00121b10: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    fclose((FIL │ │ │ │ +00121b90: 452a 2968 616e 646c 6529 3b20 3c2f 6469 E*)handle); .
    }
    . │ │ │ │ +00121bd0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    int m │ │ │ │ +00121c10: 696d 655f 7772 6974 6528 3c73 7061 6e20 ime_write( │ │ │ │ +00121c30: 7374 7275 6374 3c2f 7370 616e 3e20 3c61 struct soap *< │ │ │ │ +00121c70: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +00121c80: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ +00121c90: 6874 6d6c 223e 736f 6170 3c2f 613e 2c20 html">soap, │ │ │ │ +00121ca0: 3c73 7061 6e20 636c 6173 733d 226b 6579 void *handle, < │ │ │ │ +00121cd0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +00121ce0: 6f72 6422 3e63 6f6e 7374 3c2f 7370 616e ord">const char │ │ │ │ +00121d10: 3c2f 7370 616e 3e20 2a3c 6120 636c 6173 *buf, size_t len)
    .< │ │ │ │ +00121da0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00121db0: 3e7b 3c2f 6469 763e 0a3c 6469 7620 636c >{
    .
    size_t nwritten; < │ │ │ │ +00121e00: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    while │ │ │ │ +00121e40: 2028 6c65 6e29 203c 2f64 6976 3e0a 3c64 (len)
    . │ │ │ │ +00121e60: 2020 7b3c 2f64 6976 3e0a 3c64 6976 2063 {
    .
    │ │ │ │ +00121e80: 6e77 7269 7474 656e 203d 2066 7772 6974 nwritten = fwrit │ │ │ │ +00121e90: 6528 3c61 2063 6c61 7373 3d22 636f 6465 e(buf, 1, len, (FIL │ │ │ │ +00121ef0: 452a 2968 616e 646c 6529 3b20 3c2f 6469 E*)handle); .
    if (!n │ │ │ │ +00121f40: 7772 6974 7465 6e29 203c 2f64 6976 3e0a written)
    . │ │ │ │ +00121f50: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    {
    . │ │ │ │ +00121f80: 2020 2020 2020 3c61 2063 6c61 7373 3d22
    soa │ │ │ │ +00121fb0: 703c 2f61 3e2d 2667 743b 3c61 2063 6c61 p->errnum = │ │ │ │ +00122010: 6572 726e 6f3b 203c 7370 616e 2063 6c61 errno; // │ │ │ │ +00122030: 6765 7420 7265 6173 6f6e 203c 2f73 7061 get reason
    .
    │ │ │ │ +00122060: 203c 7370 616e 2063 6c61 7373 3d22 6b65 retur │ │ │ │ +00122080: 6e3c 2f73 7061 6e3e 203c 6120 636c 6173 n SOA │ │ │ │ +001220e0: 505f 454f 463c 2f61 3e3b 203c 2f64 6976 P_EOF;
    .
    }
    │ │ │ │ +00122110: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    len -= nw │ │ │ │ +00122130: 7269 7474 656e 3b20 3c2f 6469 763e 0a3c ritten;
    .< │ │ │ │ +00122140: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00122150: 3e20 2020 203c 6120 636c 6173 733d 2263 > bu │ │ │ │ +001221a0: 663c 2f61 3e20 2b3d 206e 7772 6974 7465 f += nwritte │ │ │ │ +001221b0: 6e3b 203c 2f64 6976 3e0a 3c64 6976 2063 n;
    .
    } │ │ │ │ +001221d0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    return SOAP_OK;
    .
    }.
    Ca │ │ │ │ +001223d0: 6c6c 6261 636b 2074 6f20 636c 6f73 6520 llback to close │ │ │ │ +001223e0: 6120 4d49 4d45 2f4d 544f 4d20 6174 7461 a MIME/MTOM atta │ │ │ │ +001223f0: 6368 6d65 6e74 2073 7472 6561 6d20 6166 chment stream af │ │ │ │ +00122400: 7465 7220 7772 6974 696e 672e 3c2f 6469 ter writing.
    Definiti │ │ │ │ +00122430: 6f6e 3a3c 2f62 3e20 7374 6473 6f61 7032 on: stdsoap2 │ │ │ │ +00122440: 2e68 3a35 3032 303c 2f64 6976 3e3c 2f64 .h:5020
    .
    < │ │ │ │ +001224c0: 6120 6872 6566 3d22 6772 6f75 705f 5f67 a href="group__g │ │ │ │ +001224d0: 726f 7570 5f5f 6361 6c6c 6261 636b 732e roup__callbacks. │ │ │ │ +001224e0: 6874 6d6c 2367 6139 3038 3466 3033 3932 html#ga9084f0392 │ │ │ │ +001224f0: 6534 6135 3432 3837 3336 3631 3231 6433 e4a54287366121d3 │ │ │ │ +00122500: 3062 6334 3833 3022 3e73 6f61 703a 3a66 0bc4830">soap::f │ │ │ │ +00122510: 6d69 6d65 7772 6974 653c 2f61 3e3c 2f64 mimewrite
    int(* fmi │ │ │ │ +00122540: 6d65 7772 6974 6529 2873 7472 7563 7420 mewrite)(struct │ │ │ │ +00122550: 736f 6170 202a 736f 6170 2c20 766f 6964 soap *soap, void │ │ │ │ +00122560: 202a 6861 6e64 6c65 2c20 636f 6e73 7420 *handle, const │ │ │ │ +00122570: 6368 6172 202a 6275 662c 2073 697a 655f char *buf, size_ │ │ │ │ +00122580: 7420 6c65 6e29 3c2f 6469 763e 3c64 6976 t len)
    C │ │ │ │ +001225a0: 616c 6c62 6163 6b20 746f 2077 7269 7465 allback to write │ │ │ │ +001225b0: 2064 6174 6120 696e 2061 204d 494d 4520 data in a MIME │ │ │ │ +001225c0: 6174 7461 6368 6d65 6e74 2073 7472 6561 attachment strea │ │ │ │ +001225d0: 6d2e 3c2f 6469 763e 3c64 6976 2063 6c61 m.
    De │ │ │ │ +001225f0: 6669 6e69 7469 6f6e 3a3c 2f62 3e20 7374 finition: st │ │ │ │ +00122600: 6473 6f61 7032 2e68 3a35 3030 393c 2f64 dsoap2.h:5009
    .
    void *(* fmimew │ │ │ │ +00122710: 7269 7465 6f70 656e 2928 7374 7275 6374 riteopen)(struct │ │ │ │ +00122720: 2073 6f61 7020 2a73 6f61 702c 2076 6f69 soap *soap, voi │ │ │ │ +00122730: 6420 2a68 616e 646c 652c 2063 6f6e 7374 d *handle, const │ │ │ │ +00122740: 2063 6861 7220 2a69 642c 2063 6f6e 7374 char *id, const │ │ │ │ +00122750: 2063 6861 7220 2a74 7970 652c 2063 6f6e char *type, con │ │ │ │ +00122760: 7374 2063 6861 7220 2a64 6573 6372 6970 st char *descrip │ │ │ │ +00122770: 7469 6f6e 2c20 656e 756d 2073 6f61 705f tion, enum soap_ │ │ │ │ +00122780: 6d69 6d65 5f65 6e63 6f64 696e 6720 656e mime_encoding en │ │ │ │ +00122790: 636f 6469 6e67 293c 2f64 6976 3e3c 6469 coding)
    │ │ │ │ +001227b0: 4361 6c6c 6261 636b 2074 6f20 6f70 656e Callback to open │ │ │ │ +001227c0: 2061 2073 7472 6561 6d69 6e67 204d 494d a streaming MIM │ │ │ │ +001227d0: 452f 4d54 4f4d 2061 7474 6163 686d 656e E/MTOM attachmen │ │ │ │ +001227e0: 7420 666f 7220 7772 6974 696e 672e 3c2f t for writing.
    Defini │ │ │ │ +00122810: 7469 6f6e 3a3c 2f62 3e20 7374 6473 6f61 tion: stdsoa │ │ │ │ +00122820: 7032 2e68 3a34 3939 383c 2f64 6976 3e3c p2.h:4998
    < │ │ │ │ +00122830: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    soap_mime_encod │ │ │ │ +00122920: 696e 673c 2f64 6976 3e3c 6469 7620 636c ing
    RFC2 │ │ │ │ +00122940: 3034 3520 4d49 4d45 2063 6f6e 7465 6e74 045 MIME content │ │ │ │ +00122950: 2074 7261 6e73 6665 7220 656e 636f 6469 transfer encodi │ │ │ │ +00122960: 6e67 732e 3c2f 6469 763e 3c64 6976 2063 ngs.
    │ │ │ │ +00122980: 4465 6669 6e69 7469 6f6e 3a3c 2f62 3e20 Definition: │ │ │ │ +00122990: 7374 6473 6f61 7032 2e68 3a31 3032 3233 stdsoap2.h:10223 │ │ │ │ +001229a0: 3c2f 6469 763e 3c2f 6469 763e 0a3c 2f64
    .

    Message c │ │ │ │ +001229d0: 6f6d 7072 6573 7369 6f6e 2077 6974 6820 ompression with │ │ │ │ +001229e0: 3c63 6f64 653e 2353 4f41 505f 454e 435f #SOAP_ENC_ │ │ │ │ +001229f0: 5a4c 4942 3c2f 636f 6465 3e20 6361 6e20 ZLIB can │ │ │ │ +00122a00: 6265 2075 7365 6420 7769 7468 204d 494d be used with MIM │ │ │ │ +00122a10: 4520 746f 2063 6f6d 7072 6573 7320 7468 E to compress th │ │ │ │ +00122a20: 6520 656e 7469 7265 206d 6573 7361 6765 e entire message │ │ │ │ +00122a30: 2e20 486f 7765 7665 722c 2063 6f6d 7072 . However, compr │ │ │ │ +00122a40: 6573 7369 6f6e 2072 6571 7569 7265 7320 ession requires │ │ │ │ +00122a50: 6275 6666 6572 696e 6720 746f 2064 6574 buffering to det │ │ │ │ +00122a60: 6572 6d69 6e65 2074 6865 2048 5454 5020 ermine the HTTP │ │ │ │ +00122a70: 636f 6e74 656e 7420 6c65 6e67 7468 2068 content length h │ │ │ │ +00122a80: 6561 6465 722c 2077 6869 6368 2063 616e eader, which can │ │ │ │ +00122a90: 6365 6c73 2074 6865 2062 656e 6566 6974 cels the benefit │ │ │ │ +00122aa0: 7320 6f66 2073 7472 6561 6d69 6e67 204d s of streaming M │ │ │ │ +00122ab0: 494d 452e 2054 6f20 6176 6f69 6420 7468 IME. To avoid th │ │ │ │ +00122ac0: 6973 2c20 796f 7520 7368 6f75 6c64 2075 is, you should u │ │ │ │ +00122ad0: 7365 2063 6875 6e6b 6564 2048 5454 5020 se chunked HTTP │ │ │ │ +00122ae0: 2877 6974 6820 7468 6520 6f75 7470 7574 (with the output │ │ │ │ +00122af0: 2d6d 6f64 6520 3c63 6f64 653e 2353 4f41 -mode #SOA │ │ │ │ +00122b00: 505f 494f 5f43 4855 4e4b 3c2f 636f 6465 P_IO_CHUNK flag) with com │ │ │ │ +00122b20: 7072 6573 7369 6f6e 2061 6e64 2073 7472 pression and str │ │ │ │ +00122b30: 6561 6d69 6e67 204d 494d 452e 2041 7420 eaming MIME. At │ │ │ │ +00122b40: 7468 6520 7365 7276 6572 2073 6964 652c the server side, │ │ │ │ +00122b50: 2077 6865 6e20 796f 7520 7365 7420 3c63 when you set #SOAP_IO_CHU │ │ │ │ +00122b70: 4e4b 3c2f 636f 6465 3e20 6265 666f 7265 NK before │ │ │ │ +00122b80: 2063 616c 6c69 6e67 203c 636f 6465 3e3c calling < │ │ │ │ +00122b90: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ +00122ba0: 663d 2267 726f 7570 5f5f 6772 6f75 705f f="group__group_ │ │ │ │ +00122bb0: 5f69 6f2e 6874 6d6c 2367 6135 3164 6261 _io.html#ga51dba │ │ │ │ +00122bc0: 3737 3036 6135 3035 3234 3062 6438 3933 7706a505240bd893 │ │ │ │ +00122bd0: 3563 3062 3238 6534 3139 6422 2074 6974 5c0b28e419d" tit │ │ │ │ +00122be0: 6c65 3d22 5365 7276 6520 6120 7065 6e64 le="Serve a pend │ │ │ │ +00122bf0: 696e 6720 7265 7175 6573 742e 223e 736f ing request.">so │ │ │ │ +00122c00: 6170 5f73 6572 7665 3c2f 613e 3c2f 636f ap_serve, the engine │ │ │ │ +00122c20: 7769 6c6c 2061 7574 6f6d 6174 6963 616c will automatical │ │ │ │ +00122c30: 6c79 2072 6576 6572 7420 746f 2062 7566 ly revert to buf │ │ │ │ +00122c40: 6665 7269 6e67 2028 3c63 6f64 653e 2353 fering (#S │ │ │ │ +00122c50: 4f41 505f 494f 5f53 544f 5245 3c2f 636f OAP_IO_STORE flag is set) │ │ │ │ +00122c70: 2e20 596f 7520 6361 6e20 6368 6563 6b20 . You can check │ │ │ │ +00122c80: 7468 6973 2066 6c61 6720 7769 7468 203c this flag with < │ │ │ │ +00122c90: 636f 6465 3e28 736f 6170 2d26 6774 3b6f code>(soap->o │ │ │ │ +00122ca0: 6d6f 6465 2026 616d 703b 2053 4f41 505f mode & SOAP_ │ │ │ │ +00122cb0: 494f 2920 3d3d 2053 4f41 505f 494f 5f43 IO) == SOAP_IO_C │ │ │ │ +00122cc0: 4855 4e4b 3c2f 636f 6465 3e20 746f 2073 HUNK to s │ │ │ │ +00122cd0: 6565 2069 6620 7468 6520 636c 6965 6e74 ee if the client │ │ │ │ +00122ce0: 2061 6363 6570 7473 2063 6875 6e6b 696e accepts chunkin │ │ │ │ +00122cf0: 672e 204d 6f72 6520 696e 666f 726d 6174 g. More informat │ │ │ │ +00122d00: 696f 6e20 6162 6f75 7420 7374 7265 616d ion about stream │ │ │ │ +00122d10: 696e 6720 6368 756e 6b65 6420 4d49 4d45 ing chunked MIME │ │ │ │ +00122d20: 2063 616e 2062 6520 666f 756e 6420 696e can be found in │ │ │ │ +00122d30: 2053 6563 7469 6f6e 203c 6120 636c 6173 Section Streaming │ │ │ │ +00122d70: 6368 756e 6b65 6420 4d49 4d45 2f4d 544f chunked MIME/MTO │ │ │ │ +00122d80: 4d3c 2f61 3e20 2e2e 3c2f 703e 0a3c 703e M ..

    .

    │ │ │ │ +00122d90: 4e6f 7465 2074 6861 7420 7468 6520 6578 Note that the ex │ │ │ │ +00122da0: 616d 706c 6520 6162 6f76 6520 666f 7220 ample above for │ │ │ │ +00122db0: 3c63 6f64 653e 6d69 6d65 5f72 6561 643c mime_read< │ │ │ │ +00122dc0: 2f63 6f64 653e 2075 7365 7320 6120 6861 /code> uses a ha │ │ │ │ +00122dd0: 6e64 6c65 2074 6861 7420 706f 696e 7473 ndle that points │ │ │ │ +00122de0: 2074 6f20 7468 6520 6f70 656e 2066 696c to the open fil │ │ │ │ +00122df0: 6520 3c63 6f64 653e 4649 4c45 2a3c 2f63 e FILE*. The simple │ │ │ │ +00122e10: 2065 7861 6d70 6c65 2061 626f 7665 2069 example above i │ │ │ │ +00122e20: 7320 6e6f 7420 7265 636f 6d6d 656e 6465 s not recommende │ │ │ │ +00122e30: 6420 7768 656e 2074 6865 2070 6c61 7466 d when the platf │ │ │ │ +00122e40: 6f72 6d20 696d 706f 7365 7320 6120 6c69 orm imposes a li │ │ │ │ +00122e50: 6d69 7420 6f6e 2074 6865 206e 756d 6265 mit on the numbe │ │ │ │ +00122e60: 7220 6f66 206f 7065 6e20 6669 6c65 2064 r of open file d │ │ │ │ +00122e70: 6573 6372 6970 746f 7273 2e20 596f 7520 escriptors. You │ │ │ │ +00122e80: 6361 6e20 7573 6520 7468 6520 6861 6e64 can use the hand │ │ │ │ +00122e90: 6c65 2074 6f20 7061 7373 2061 6c6f 6e67 le to pass along │ │ │ │ +00122ea0: 206d 6f72 6520 696e 666f 726d 6174 696f more informatio │ │ │ │ +00122eb0: 6e20 7468 616e 206a 7573 7420 7468 6520 n than just the │ │ │ │ +00122ec0: 6669 6c65 2064 6573 6372 6970 746f 722e file descriptor. │ │ │ │ +00122ed0: 2053 6f20 666f 7220 6578 616d 706c 652c So for example, │ │ │ │ +00122ee0: 2077 6865 6e20 7468 6520 6e75 6d62 6572 when the number │ │ │ │ +00122ef0: 206f 6620 6f70 656e 2066 696c 6520 6465 of open file de │ │ │ │ +00122f00: 7363 7269 7074 6f72 7320 6973 206c 696d scriptors is lim │ │ │ │ +00122f10: 6974 6564 206f 6e20 796f 7572 2070 6c61 ited on your pla │ │ │ │ +00122f20: 7466 6f72 6d2c 2079 6f75 2073 686f 756c tform, you shoul │ │ │ │ +00122f30: 6420 6c65 7420 7468 6520 6861 6e64 6c65 d let the handle │ │ │ │ +00122f40: 2070 6f69 6e74 2074 6f20 6120 7374 7275 point to a stru │ │ │ │ +00122f50: 6374 7572 6520 7769 7468 2066 696c 652d cture with file- │ │ │ │ +00122f60: 7265 6c61 7465 6420 696e 666f 726d 6174 related informat │ │ │ │ +00122f70: 696f 6e2e 2054 6865 2043 2b2b 2065 7861 ion. The C++ exa │ │ │ │ +00122f80: 6d70 6c65 2062 656c 6f77 2069 6c6c 7573 mple below illus │ │ │ │ +00122f90: 7472 6174 6573 2074 6869 733a 3c2f 703e trates this:

    │ │ │ │ +00122fa0: 0a3c 6469 7620 636c 6173 733d 2266 7261 .
    file.xo │ │ │ │ +00122fd0: 705f 5f49 6e63 6c75 6465 203d 2073 6f61 p__Include = soa │ │ │ │ +00122fe0: 705f 6e65 775f 5f78 6f70 5f5f 496e 636c p_new__xop__Incl │ │ │ │ +00122ff0: 7564 6528 3c61 2063 6c61 7373 3d22 636f ude(soap< │ │ │ │ +00123020: 2f61 3e29 3b20 3c2f 6469 763e 0a3c 6469 /a>);
    .f │ │ │ │ +00123040: 696c 652e 786f 705f 5f49 6e63 6c75 6465 ile.xop__Include │ │ │ │ +00123050: 2d26 6774 3b69 6420 3d20 4e55 4c4c 3b20 ->id = NULL; │ │ │ │ +00123060: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    file.xo │ │ │ │ +00123080: 705f 5f49 6e63 6c75 6465 2d26 6774 3b74 p__Include->t │ │ │ │ +00123090: 7970 6520 3d20 7479 7065 3b20 3c2f 6469 ype = type; .
    file.xop__I │ │ │ │ +001230c0: 6e63 6c75 6465 2d26 6774 3b6f 7074 696f nclude->optio │ │ │ │ +001230d0: 6e73 203d 204e 554c 4c3b 203c 2f64 6976 ns = NULL;
    .
    .
    fi │ │ │ │ +00123110: 6c65 2e78 6d69 6d65 355f 5f63 6f6e 7465 le.xmime5__conte │ │ │ │ +00123120: 6e74 5479 7065 203d 2074 7970 653b 203c ntType = type; < │ │ │ │ +00123130: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    file.fil │ │ │ │ +00123150: 656e 616d 6520 3d20 6669 6c65 6e61 6d65 ename = filename │ │ │ │ +00123160: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
    .
    .
    // Th │ │ │ │ +001231b0: 6520 6f62 6a65 6374 2068 6f6c 6469 6e67 e object holding │ │ │ │ +001231c0: 2061 6c6c 2069 6e66 6f72 6d61 7469 6f6e all information │ │ │ │ +001231d0: 2074 6f20 7265 6164 2064 6174 6120 3c2f to read data
    .
    Fi │ │ │ │ +00123200: 6c65 5374 7265 616d 496e 202a 696e 7320 leStreamIn *ins │ │ │ │ +00123210: 3d20 3c73 7061 6e20 636c 6173 733d 226b = new FileStreamIn( │ │ │ │ +00123240: 6572 726f 7268 616e 646c 6572 293b 203c errorhandler); < │ │ │ │ +00123250: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    ins-> │ │ │ │ +00123270: 7365 7446 696c 6550 6174 6828 3c61 2063 setFilePath(path); │ │ │ │ +001232d0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    ins-> │ │ │ │ +001232f0: 3b73 6574 4669 6c65 4e61 6d65 2866 696c ;setFileName(fil │ │ │ │ +00123300: 656e 616d 6529 3b20 3c2f 6469 763e 0a3c ename);
    .< │ │ │ │ +00123310: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00123320: 3e20 3c2f 6469 763e 0a3c 6469 7620 636c >
    .
    file. │ │ │ │ +00123340: 786f 705f 5f49 6e63 6c75 6465 2d26 6774 xop__Include-> │ │ │ │ +00123350: 3b5f 5f73 697a 6520 3d20 7369 7a65 3b20 ;__size = size; │ │ │ │ +00123360: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    file.xo │ │ │ │ +00123380: 705f 5f49 6e63 6c75 6465 2d26 6774 3b5f p__Include->_ │ │ │ │ +00123390: 5f70 7472 203d 2028 3c73 7061 6e20 636c _ptr = (unsigned char │ │ │ │ +001233e0: 3c2f 7370 616e 3e2a 2969 6e73 3b3c 2f64 *)ins;.
    char path[S │ │ │ │ +001234c0: 4f41 505f 5441 474c 454e 5d3c 2f64 6976 OAP_TAGLEN]
    The client r │ │ │ │ +001234f0: 6571 7565 7374 2070 6174 6820 6173 2072 equest path as r │ │ │ │ +00123500: 6563 6569 7665 6420 6f6e 2074 6865 2073 eceived on the s │ │ │ │ +00123510: 6572 7665 7220 7369 6465 2e3c 2f64 6976 erver side.
    Definitio │ │ │ │ +00123540: 6e3a 3c2f 623e 2073 7464 736f 6170 322e n: stdsoap2. │ │ │ │ +00123550: 683a 3430 3332 3c2f 6469 763e 3c2f 6469 h:4032
    .

    To │ │ │ │ +00123580: 7265 6164 2074 6865 204d 544f 4d20 6461 read the MTOM da │ │ │ │ +00123590: 7461 2066 6f72 2074 7261 6e73 6d69 7373 ta for transmiss │ │ │ │ +001235a0: 696f 6e3a 3c2f 703e 0a3c 6469 7620 636c ion:

    .
    < │ │ │ │ +001235c0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +001235d0: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >void< │ │ │ │ +001235f0: 2f73 7061 6e3e 202a 6d69 6d65 5f72 6561 /span> *mime_rea │ │ │ │ +00123600: 645f 6f70 656e 283c 7370 616e 2063 6c61 d_open(str │ │ │ │ +00123620: 7563 743c 2f73 7061 6e3e 203c 6120 636c uct soap *soap, void *handle, const < │ │ │ │ +001236e0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +001236f0: 6f72 6474 7970 6522 3e63 6861 723c 2f73 ordtype">char * │ │ │ │ +00123720: 6964 3c2f 7370 616e 3e2c 203c 7370 616e id, const char *type, const char *description │ │ │ │ +001237d0: 2920 3c2f 6469 763e 0a3c 6469 7620 636c )
    .
    {.
    if (!han │ │ │ │ +00123830: 646c 6529 203c 2f64 6976 3e0a 3c64 6976 dle)
    .
    │ │ │ │ +00123850: 2020 3c73 7061 6e20 636c 6173 733d 226b retu │ │ │ │ +00123870: 726e 3c2f 7370 616e 3e20 4e55 4c4c 3b20 rn NULL; │ │ │ │ +00123880: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    FileS │ │ │ │ +001238a0: 7472 6561 6d49 6e20 2a69 6e73 203d 2028 treamIn *ins = ( │ │ │ │ +001238b0: 4669 6c65 5374 7265 616d 496e 2a29 6861 FileStreamIn*)ha │ │ │ │ +001238c0: 6e64 6c65 3b20 3c2f 6469 763e 0a3c 6469 ndle;
    . │ │ │ │ +001238e0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 if
    (!ins->o │ │ │ │ +00123910: 7065 6e28 2929 203c 2f64 6976 3e0a 3c64 pen())
    . │ │ │ │ +00123930: 2020 7b3c 2f64 6976 3e0a 3c64 6976 2063 {
    .
    │ │ │ │ +00123950: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap- │ │ │ │ +00123980: 2667 743b 3c61 2063 6c61 7373 3d22 636f >err │ │ │ │ +001239d0: 6f72 3c2f 613e 203d 203c 6120 636c 6173 or = SOA │ │ │ │ +00123a30: 505f 4552 523c 2f61 3e3b 203c 2f64 6976 P_ERR;
    .
    return │ │ │ │ +00123a80: 4e55 4c4c 3b20 3c2f 6469 763e 0a3c 6469 NULL;
    . │ │ │ │ +00123aa0: 207d 203c 2f64 6976 3e0a 3c64 6976 2063 }
    .
    return handle; .
    }
    . │ │ │ │ +00123b10: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    void │ │ │ │ +00123b40: 3c2f 7370 616e 3e20 6d69 6d65 5f72 6561 mime_rea │ │ │ │ +00123b50: 645f 636c 6f73 6528 3c73 7061 6e20 636c d_close(st │ │ │ │ +00123b70: 7275 6374 3c2f 7370 616e 3e20 3c61 2063 ruct soap *soap, void *handle) .
    {
    . │ │ │ │ +00123c40: 2020 3c73 7061 6e20 636c 6173 733d 226b if (!handle) │ │ │ │ +00123c70: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    return;
    . │ │ │ │ +00123cd0: 2046 696c 6553 7472 6561 6d49 6e20 2a69 FileStreamIn *i │ │ │ │ +00123ce0: 6e73 203d 2028 4669 6c65 5374 7265 616d ns = (FileStream │ │ │ │ +00123cf0: 496e 2a29 6861 6e64 6c65 3b20 3c2f 6469 In*)handle; .
    del │ │ │ │ +00123d30: 6574 653c 2f73 7061 6e3e 2069 6e73 3b20 ete ins; │ │ │ │ +00123d40: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    }
    .
    si │ │ │ │ +00123d90: 7a65 5f74 3c2f 7370 616e 3e20 6d69 6d65 ze_t mime │ │ │ │ +00123da0: 5f72 6561 6428 3c73 7061 6e20 636c 6173 _read(stru │ │ │ │ +00123dc0: 6374 3c2f 7370 616e 3e20 3c61 2063 6c61 ct soap *soap, void *handle, char │ │ │ │ +00123e80: 202a 3c61 2063 6c61 7373 3d22 636f 6465 *buf, si │ │ │ │ +00123ef0: 7a65 5f74 3c2f 7370 616e 3e20 6c65 6e29 ze_t len) │ │ │ │ +00123f00: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    {
    .
    │ │ │ │ +00123f50: 6966 3c2f 7370 616e 3e20 2821 6861 6e64 if (!hand │ │ │ │ +00123f60: 6c65 2920 3c2f 6469 763e 0a3c 6469 7620 le)
    .
    │ │ │ │ +00123f80: 203c 7370 616e 2063 6c61 7373 3d22 6b65 retur │ │ │ │ +00123fa0: 6e3c 2f73 7061 6e3e 2030 3b20 3c2f 6469 n 0; .
    FileStrea │ │ │ │ +00123fd0: 6d49 6e20 2a69 6e73 203d 2028 4669 6c65 mIn *ins = (File │ │ │ │ +00123fe0: 5374 7265 616d 496e 2a29 6861 6e64 6c65 StreamIn*)handle │ │ │ │ +00123ff0: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
    .
    size_t nread = ins │ │ │ │ +00124040: 2d26 6774 3b72 6561 6428 3c61 2063 6c61 ->read(buf, len) │ │ │ │ +001240a0: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
    .
    if │ │ │ │ +001240e0: 2028 696e 732d 2667 743b 7374 7265 616d (ins->stream │ │ │ │ +001240f0: 4572 726f 7228 2929 203c 2f64 6976 3e0a Error())
    . │ │ │ │ +00124100: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    {
    .
    │ │ │ │ +00124130: 2020 3c61 2063 6c61 7373 3d22 636f 6465 soap->e │ │ │ │ +001241b0: 7272 6f72 3c2f 613e 203d 2069 6e73 2d26 rror = ins-& │ │ │ │ +001241c0: 6774 3b73 7472 6561 6d45 7272 6f72 2829 gt;streamError() │ │ │ │ +001241d0: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
    .
    < │ │ │ │ +001241f0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +00124200: 6f72 6466 6c6f 7722 3e72 6574 7572 6e3c ordflow">return< │ │ │ │ +00124210: 2f73 7061 6e3e 2030 3b20 3c2f 6469 763e /span> 0;
    │ │ │ │ +00124220: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    }
    . │ │ │ │ +00124250: 2020 3c73 7061 6e20 636c 6173 733d 226b retu │ │ │ │ +00124270: 726e 3c2f 7370 616e 3e20 6e72 6561 643b rn nread; │ │ │ │ +00124280: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    }
    .
    SOAP_ERR
    #define S │ │ │ │ +00124380: 4f41 505f 4552 523c 2f64 6976 3e3c 6469 OAP_ERR
    │ │ │ │ +001243a0: 4120 736f 6170 5f73 7461 7475 7320 6572 A soap_status er │ │ │ │ +001243b0: 726f 7220 636f 6465 3a20 616e 2075 6e73 ror code: an uns │ │ │ │ +001243c0: 7065 6369 6669 6564 2065 7272 6f72 206f pecified error o │ │ │ │ +001243d0: 6363 7572 7265 642e 3c2f 6469 763e 3c64 ccurred.
    Definition:< │ │ │ │ +00124400: 2f62 3e20 7374 6473 6f61 7032 2e68 3a32 /b> stdsoap2.h:2 │ │ │ │ +00124410: 3337 343c 2f64 6976 3e3c 2f64 6976 3e0a 374
    . │ │ │ │ +00124420: 3c2f 6469 763e 3c21 2d2d 2066 7261 676d

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

    .

    .R │ │ │ │ +001244a0: 6564 6972 6563 7469 6e67 2069 6e62 6f75 edirecting inbou │ │ │ │ +001244b0: 6e64 204d 494d 452f 4d54 4f4d 2073 7472 nd MIME/MTOM str │ │ │ │ +001244c0: 6561 6d73 2062 6173 6564 206f 6e20 534f eams based on SO │ │ │ │ +001244d0: 4150 2062 6f64 7920 636f 6e74 656e 743c AP body content< │ │ │ │ +001244e0: 2f68 323e 0a3c 703e 5768 656e 2069 7420 /h2>.

    When it │ │ │ │ +001244f0: 6973 2070 7265 6665 7261 626c 6520 6f72 is preferable or │ │ │ │ +00124500: 2072 6571 7569 7265 6420 746f 2072 6564 required to red │ │ │ │ +00124510: 6972 6563 7420 696e 626f 756e 6420 4d49 irect inbound MI │ │ │ │ +00124520: 4d45 2f4d 544f 4d20 6174 7461 6368 6d65 ME/MTOM attachme │ │ │ │ +00124530: 6e74 2073 7472 6561 6d73 2062 6173 6564 nt streams based │ │ │ │ +00124540: 206f 6e20 534f 4150 206d 6573 7361 6765 on SOAP message │ │ │ │ +00124550: 2062 6f64 7920 636f 6e74 656e 742c 2077 body content, w │ │ │ │ +00124560: 6865 7265 2066 6f72 2065 7861 6d70 6c65 here for example │ │ │ │ +00124570: 2074 6865 206e 616d 6573 206f 6620 7468 the names of th │ │ │ │ +00124580: 6520 7265 736f 7572 6365 7320 6172 6520 e resources are │ │ │ │ +00124590: 6c69 7374 6564 2069 6e20 7468 6520 534f listed in the SO │ │ │ │ +001245a0: 4150 206d 6573 7361 6765 2062 6f64 792c AP message body, │ │ │ │ +001245b0: 2061 6e20 616c 7465 726e 6174 6976 6520 an alternative │ │ │ │ +001245c0: 6d65 6368 616e 6973 6d20 6d75 7374 2062 mechanism must b │ │ │ │ +001245d0: 6520 7573 6564 2074 6f20 6861 6e64 6c65 e used to handle │ │ │ │ +001245e0: 2074 6865 2061 7474 6163 686d 656e 7473 the attachments │ │ │ │ +001245f0: 2e20 5468 6973 206d 6563 6861 6e69 736d . This mechanism │ │ │ │ +00124600: 2063 616e 2062 6520 7573 6564 2061 7420 can be used at │ │ │ │ +00124610: 7468 6520 636c 6965 6e74 2061 6e64 2073 the client and s │ │ │ │ +00124620: 6572 7665 7220 7369 6465 2e3c 2f70 3e0a erver side.

    . │ │ │ │ +00124630: 3c70 3e42 6563 6175 7365 2074 6865 2072

    Because the r │ │ │ │ +00124640: 6f75 7469 6e67 206f 6620 7468 6520 7374 outing of the st │ │ │ │ +00124650: 7265 616d 7320 6973 2061 6363 6f6d 706c reams is accompl │ │ │ │ +00124660: 6973 6865 6420 7769 7468 2065 7870 6c69 ished with expli │ │ │ │ +00124670: 6369 7420 6675 6e63 7469 6f6e 2063 616c cit function cal │ │ │ │ +00124680: 6c73 2c20 7468 6973 206d 6574 686f 6420 ls, this method │ │ │ │ +00124690: 7368 6f75 6c64 206f 6e6c 7920 6265 2075 should only be u │ │ │ │ +001246a0: 7365 6420 7768 656e 2072 6571 7569 7265 sed when require │ │ │ │ +001246b0: 6420 616e 6420 7368 6f75 6c64 206e 6f74 d and should not │ │ │ │ +001246c0: 2062 6520 636f 6e73 6964 6572 6564 206f be considered o │ │ │ │ +001246d0: 7074 696f 6e61 6c2e 2054 6861 7420 6973 ptional. That is │ │ │ │ +001246e0: 2c20 7768 656e 2079 6f75 2065 6e61 626c , when you enabl │ │ │ │ +001246f0: 6520 7468 6973 206d 6574 686f 642c 2079 e this method, y │ │ │ │ +00124700: 6f75 206d 7573 7420 6368 6563 6b20 666f ou must check fo │ │ │ │ +00124710: 7220 7065 6e64 696e 6720 4d49 4d45 2f4d r pending MIME/M │ │ │ │ +00124720: 544f 4d20 6174 7461 6368 6d65 6e74 7320 TOM attachments │ │ │ │ +00124730: 616e 6420 6861 6e64 6c65 2074 6865 6d20 and handle them │ │ │ │ +00124740: 6170 7072 6f70 7269 6174 656c 792e 2054 appropriately. T │ │ │ │ +00124750: 6869 7320 6973 2074 7275 6520 6576 656e his is true even │ │ │ │ +00124760: 2077 6865 6e20 796f 7520 646f 6e27 7420 when you don't │ │ │ │ +00124770: 6578 7065 6374 204d 494d 452f 4d54 4f4d expect MIME/MTOM │ │ │ │ +00124780: 2061 7474 6163 686d 656e 7473 2069 6e20 attachments in │ │ │ │ +00124790: 7468 6520 7061 796c 6f61 642c 2062 6563 the payload, bec │ │ │ │ +001247a0: 6175 7365 2074 6865 2070 6565 7220 6d61 ause the peer ma │ │ │ │ +001247b0: 7920 7472 6963 6b20 796f 7520 6279 2073 y trick you by s │ │ │ │ +001247c0: 656e 6469 6e67 2061 7474 6163 686d 656e ending attachmen │ │ │ │ +001247d0: 7473 2061 6e79 7761 7920 616e 6420 796f ts anyway and yo │ │ │ │ +001247e0: 7520 7368 6f75 6c64 2062 6520 7072 6570 u should be prep │ │ │ │ +001247f0: 6172 6564 2074 6f20 6163 6365 7074 206f ared to accept o │ │ │ │ +00124800: 7220 7265 6a65 6374 2074 6865 6d2e 3c2f r reject them..

    The explic │ │ │ │ +00124820: 6974 204d 494d 452f 4d54 4f4d 2073 7472 it MIME/MTOM str │ │ │ │ +00124830: 6561 6d69 6e67 206d 6563 6861 6e69 736d eaming mechanism │ │ │ │ +00124840: 2063 6f6e 7369 7374 7320 6f66 2074 6872 consists of thr │ │ │ │ +00124850: 6565 2041 5049 2066 756e 6374 696f 6e73 ee API functions │ │ │ │ +00124860: 3a3c 2f70 3e0a 3c75 6c3e 0a3c 6c69 3e3c :

    .
      .
    • < │ │ │ │ +00124870: 636f 6465 3e76 6f69 6420 3c61 2063 6c61 code>void soap_post_che │ │ │ │ +00124910: 636b 5f6d 696d 655f 6174 7461 6368 6d65 ck_mime_attachme │ │ │ │ +00124920: 6e74 7328 7374 7275 6374 2073 6f61 7020 nts(struct soap │ │ │ │ +00124930: 2a73 6f61 7029 3c2f 613e 3c2f 636f 6465 *soap) This function │ │ │ │ +00124950: 656e 6162 6c65 7320 706f 7374 2d70 726f enables post-pro │ │ │ │ +00124960: 6365 7373 696e 6720 6f66 204d 494d 452f cessing of MIME/ │ │ │ │ +00124970: 4d54 4f4d 2061 7474 6163 686d 656e 7473 MTOM attachments │ │ │ │ +00124980: 2072 6563 6569 7665 642e 2054 6869 7320 received. This │ │ │ │ +00124990: 6d65 616e 7320 7468 6174 2074 6865 2070 means that the p │ │ │ │ +001249a0: 7265 7365 6e63 6520 6f66 204d 494d 452f resence of MIME/ │ │ │ │ +001249b0: 4d54 4f4d 2061 7474 6163 686d 656e 7473 MTOM attachments │ │ │ │ +001249c0: 206d 7573 7420 6265 2065 7870 6c69 6369 must be explici │ │ │ │ +001249d0: 746c 7920 6368 6563 6b65 6420 6279 2063 tly checked by c │ │ │ │ +001249e0: 616c 6c69 6e67 203c 636f 6465 3e3c 6120 alling soap_chec │ │ │ │ +00124a70: 6b5f 6d69 6d65 5f61 7474 6163 686d 656e k_mime_attachmen │ │ │ │ +00124a80: 7473 3c2f 613e 3c2f 636f 6465 3e20 6166 ts af │ │ │ │ +00124a90: 7465 7220 7468 6520 6d65 7373 6167 6520 ter the message │ │ │ │ +00124aa0: 7761 7320 7265 6365 6976 6564 2e20 5768 was received. Wh │ │ │ │ +00124ab0: 656e 2074 6869 7320 6675 6e63 7469 6f6e en this function │ │ │ │ +00124ac0: 2072 6574 7572 6e73 206e 6f6e 7a65 726f returns nonzero │ │ │ │ +00124ad0: 2028 7472 7565 292c 2074 6865 6e20 7468 (true), then th │ │ │ │ +00124ae0: 6520 6174 7461 6368 6d65 6e74 7320 6361 e attachments ca │ │ │ │ +00124af0: 6e20 6265 2072 6574 7269 6576 6564 2062 n be retrieved b │ │ │ │ +00124b00: 7920 6361 6c6c 696e 6720 3c63 6f64 653e y calling │ │ │ │ +00124b10: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap_recv_mi │ │ │ │ +00124b90: 6d65 5f61 7474 6163 686d 656e 743c 2f61 me_attachment repeate │ │ │ │ +00124bb0: 646c 7920 746f 2072 6574 7269 6576 6520 dly to retrieve │ │ │ │ +00124bc0: 6561 6368 2061 7474 6163 686d 656e 7420 each attachment │ │ │ │ +00124bd0: 756e 7469 6c20 7468 6973 2066 756e 6374 until this funct │ │ │ │ +00124be0: 696f 6e20 7265 7475 726e 7320 4e55 4c4c ion returns NULL │ │ │ │ +00124bf0: 2e20 5468 6973 2066 756e 6374 696f 6e20 . This function │ │ │ │ +00124c00: 7265 7475 726e 7320 6120 706f 696e 7465 returns a pointe │ │ │ │ +00124c10: 7220 746f 2061 203c 636f 6465 3e73 7472 r to a str │ │ │ │ +00124c20: 7563 7420 3c61 2063 6c61 7373 3d22 656c uct soap_multipar │ │ │ │ +00124ca0: 743c 2f61 3e3c 2f63 6f64 653e 2061 7474 t att │ │ │ │ +00124cb0: 6163 686d 656e 742e 3c2f 6c69 3e0a 3c6c achment.
    • .int soap_check │ │ │ │ +00124d50: 5f6d 696d 655f 6174 7461 6368 6d65 6e74 _mime_attachment │ │ │ │ +00124d60: 7328 7374 7275 6374 2073 6f61 7020 2a73 s(struct soap *s │ │ │ │ +00124d70: 6f61 7029 3c2f 613e 3c2f 636f 6465 3e20 oap) │ │ │ │ +00124d80: 5468 6973 2066 756e 6374 696f 6e20 6368 This function ch │ │ │ │ +00124d90: 6563 6b73 2074 6865 2070 7265 7365 6e63 ecks the presenc │ │ │ │ +00124da0: 6520 6f66 2061 204d 494d 452f 4d54 4f4d e of a MIME/MTOM │ │ │ │ +00124db0: 2061 7474 6163 686d 656e 7420 6166 7465 attachment afte │ │ │ │ +00124dc0: 7220 6361 6c6c 696e 6720 6120 7365 7276 r calling a serv │ │ │ │ +00124dd0: 6963 6520 6f70 6572 6174 696f 6e20 6279 ice operation by │ │ │ │ +00124de0: 2072 6574 7572 6e69 6e67 206e 6f6e 7a65 returning nonze │ │ │ │ +00124df0: 726f 2077 6865 6e20 6174 7461 6368 6d65 ro when attachme │ │ │ │ +00124e00: 6e74 7320 6172 6520 7072 6573 656e 742e nts are present. │ │ │ │ +00124e10: 2052 6574 7572 6e73 206e 6f6e 7a65 726f Returns nonzero │ │ │ │ +00124e20: 2069 6620 6174 7461 6368 6d65 6e74 7320 if attachments │ │ │ │ +00124e30: 6172 6520 7072 6573 656e 742e 2052 6571 are present. Req │ │ │ │ +00124e40: 7569 7265 7320 3c63 6f64 653e 3c61 2063 uires soap_post_c │ │ │ │ +00124ee0: 6865 636b 5f6d 696d 655f 6174 7461 6368 heck_mime_attach │ │ │ │ +00124ef0: 6d65 6e74 733c 2f61 3e3c 2f63 6f64 653e ments │ │ │ │ +00124f00: 2e3c 2f6c 693e 0a3c 6c69 3e3c 636f 6465 ..
    • struct soap_mult │ │ │ │ +00124f90: 6970 6172 743c 2f61 3e20 2a73 6f61 705f ipart *soap_ │ │ │ │ +00124fa0: 7265 6376 5f6d 696d 655f 6174 7461 6368 recv_mime_attach │ │ │ │ +00124fb0: 6d65 6e74 2873 7472 7563 7420 736f 6170 ment(struct soap │ │ │ │ +00124fc0: 202a 736f 6170 2c20 766f 6964 202a 6861 *soap, void *ha │ │ │ │ +00124fd0: 6e64 6c65 293c 2f63 6f64 653e 2054 6869 ndle) Thi │ │ │ │ +00124fe0: 7320 6675 6e63 7469 6f6e 2070 6172 7365 s function parse │ │ │ │ +00124ff0: 7320 616e 2061 7474 6163 686d 656e 7420 s an attachment │ │ │ │ +00125000: 616e 6420 696e 766f 6b65 7320 7468 6520 and invokes the │ │ │ │ +00125010: 4d49 4d45 2063 616c 6c62 6163 6b73 2077 MIME callbacks w │ │ │ │ +00125020: 6865 6e20 7365 742e 2054 6865 203c 636f hen set. The handle │ │ │ │ +00125040: 2070 6172 616d 6574 6572 2069 7320 7061 parameter is pa │ │ │ │ +00125050: 7373 6564 2074 6f20 3c63 6f64 653e 666d ssed to fm │ │ │ │ +00125060: 696d 6577 7269 7465 6f70 656e 3c2f 636f imewriteopen. The handle │ │ │ │ +00125080: 6d61 7920 636f 6e74 6169 6e20 616e 7920 may contain any │ │ │ │ +00125090: 6461 7461 2074 6861 7420 6973 2065 7874 data that is ext │ │ │ │ +001250a0: 7261 6374 6564 2066 726f 6d20 7468 6520 racted from the │ │ │ │ +001250b0: 534f 4150 206d 6573 7361 6765 2062 6f64 SOAP message bod │ │ │ │ +001250c0: 7920 746f 2067 7569 6465 2074 6865 2072 y to guide the r │ │ │ │ +001250d0: 6564 6972 6563 7469 6f6e 206f 6620 7468 edirection of th │ │ │ │ +001250e0: 6520 7374 7265 616d 2069 6e20 7468 6520 e stream in the │ │ │ │ +001250f0: 6361 6c6c 6261 636b 732e 2052 6574 7572 callbacks. Retur │ │ │ │ +00125100: 6e73 2061 2073 7472 7563 7420 7769 7468 ns a struct with │ │ │ │ +00125110: 2061 203c 636f 6465 3e63 6861 7220 2a70 a char *p │ │ │ │ +00125120: 7472 3c2f 636f 6465 3e20 6d65 6d62 6572 tr member │ │ │ │ +00125130: 2074 6861 7420 636f 6e74 6169 6e73 2074 that contains t │ │ │ │ +00125140: 6865 2068 616e 646c 6520 7661 6c75 6520 he handle value │ │ │ │ +00125150: 7265 7475 726e 6564 2062 7920 7468 6520 returned by the │ │ │ │ +00125160: 3c63 6f64 653e 666d 696d 6577 7269 7465 fmimewrite │ │ │ │ +00125170: 6f70 656e 3c2f 636f 6465 3e20 6361 6c6c open call │ │ │ │ +00125180: 6261 636b 2c20 616e 6420 3c63 6f64 653e back, and │ │ │ │ +00125190: 6368 6172 202a 6964 3c2f 636f 6465 3e2c char *id, │ │ │ │ +001251a0: 203c 636f 6465 3e63 6861 7220 2a74 7970 char *typ │ │ │ │ +001251b0: 653c 2f63 6f64 653e 2c20 616e 6420 3c63 e, and char *descri │ │ │ │ +001251d0: 7074 696f 6e3c 2f63 6f64 653e 206d 656d ption mem │ │ │ │ +001251e0: 6265 7220 7661 7269 6162 6c65 7320 7769 ber variables wi │ │ │ │ +001251f0: 7468 2074 6865 204d 494d 4520 6964 2c20 th the MIME id, │ │ │ │ +00125200: 7479 7065 2c20 616e 6420 6465 7363 7269 type, and descri │ │ │ │ +00125210: 7074 696f 6e20 696e 666f 2077 6865 6e20 ption info when │ │ │ │ +00125220: 7072 6573 656e 7420 696e 2074 6865 2061 present in the a │ │ │ │ +00125230: 7474 6163 686d 656e 742e 3c2f 6c69 3e0a ttachment.
    • . │ │ │ │ +00125240: 3c2f 756c 3e0a 3c70 3e45 7861 6d70 6c65
    .

    Example │ │ │ │ +00125250: 2063 6c69 656e 7420 696e 2043 3a3c 2f70 client in C:

    .
    │ │ │ │ +001252a0: 7374 7275 6374 203c 2f73 7061 6e3e 3c61 struct soap *< │ │ │ │ +001252e0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +001252f0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ +00125300: 6874 6d6c 223e 736f 6170 3c2f 613e 203d html">soap = │ │ │ │ +00125310: 203c 6120 636c 6173 733d 2263 6f64 6522 soap_new1< │ │ │ │ +00125370: 2f61 3e28 3c61 2063 6c61 7373 3d22 636f /a>(SOAP_ENC_ │ │ │ │ +001253d0: 4d54 4f4d 3c2f 613e 293b 203c 2f64 6976 MTOM);
    .
    soap_post_ │ │ │ │ +00125450: 6368 6563 6b5f 6d69 6d65 5f61 7474 6163 check_mime_attac │ │ │ │ +00125460: 686d 656e 7473 3c2f 613e 283c 6120 636c hments(soap); .
    │ │ │ │ +001254d0: 6966 3c2f 7370 616e 3e20 2873 6f61 705f if (soap_ │ │ │ │ +001254e0: 6361 6c6c 5f6e 735f 5f6d 794d 6574 686f call_ns__myMetho │ │ │ │ +001254f0: 6428 3c61 2063 6c61 7373 3d22 636f 6465 d(soap, ...))
    . │ │ │ │ +00125530: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    {
    .
    soap_print_faul │ │ │ │ +001255c0: 743c 2f61 3e28 3c61 2063 6c61 7373 3d22 t(soa │ │ │ │ +001255f0: 703c 2f61 3e2c 2073 7464 6572 7229 3b20 p, stderr); │ │ │ │ +00125600: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // an erro │ │ │ │ +00125620: 7220 6f63 6375 7272 6564 203c 2f73 7061 r occurred
    .
    }.
    e │ │ │ │ +00125680: 6c73 653c 2f73 7061 6e3e 203c 2f64 6976 lse
    .
    {
    ..< │ │ │ │ +00125790: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +001257a0: 3e20 207b 3c2f 6469 763e 0a3c 6469 7620 > {
    .
    │ │ │ │ +001257c0: 203c 7370 616e 2063 6c61 7373 3d22 636f // attach │ │ │ │ +001257e0: 6d65 6e74 7320 6172 6520 7072 6573 656e ments are presen │ │ │ │ +001257f0: 742c 2063 6861 6e6e 656c 2069 7320 7374 t, channel is st │ │ │ │ +00125800: 696c 6c20 6f70 656e 203c 2f73 7061 6e3e ill open │ │ │ │ +00125810: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    do │ │ │ │ +00125850: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    {.
    ... │ │ │ │ +00125890: 203c 7370 616e 2063 6c61 7373 3d22 636f // get da │ │ │ │ +001258b0: 7461 2026 2333 393b 6861 6e64 6c65 2623 ta 'handle&# │ │ │ │ +001258c0: 3339 3b20 6672 6f6d 2053 4f41 5020 7265 39; from SOAP re │ │ │ │ +001258d0: 7370 6f6e 7365 2061 6e64 2070 6173 7320 sponse and pass │ │ │ │ +001258e0: 746f 2063 616c 6c62 6163 6b73 203c 2f73 to callbacks
    .
    │ │ │ │ +00125910: 2020 202e 2e2e 203c 7370 616e 2063 6c61 ... // │ │ │ │ +00125930: 7365 7420 7468 6520 666d 696d 6520 6361 set the fmime ca │ │ │ │ +00125940: 6c6c 6261 636b 732c 2069 6620 6e65 6564 llbacks, if need │ │ │ │ +00125950: 6564 203c 2f73 7061 6e3e 3c2f 6469 763e ed
    │ │ │ │ +00125960: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    s │ │ │ │ +00125990: 7472 7563 7420 3c2f 7370 616e 3e3c 6120 truct s │ │ │ │ +001259d0: 6f61 705f 6d75 6c74 6970 6172 743c 2f61 oap_multipart *content = s │ │ │ │ +00125a40: 6f61 705f 7265 6376 5f6d 696d 655f 6174 oap_recv_mime_at │ │ │ │ +00125a50: 7461 6368 6d65 6e74 3c2f 613e 283c 6120 tachment(soap, (< │ │ │ │ +00125a90: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +00125aa0: 6f72 6474 7970 6522 3e76 6f69 643c 2f73 ordtype">void*)handle); < │ │ │ │ +00125ac0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    pr │ │ │ │ +00125ae0: 696e 7466 283c 7370 616e 2063 6c61 7373 intf("Received │ │ │ │ +00125b10: 6174 7461 6368 6d65 6e74 2077 6974 6820 attachment with │ │ │ │ +00125b20: 6964 3d25 7320 616e 6420 7479 7065 3d25 id=%s and type=% │ │ │ │ +00125b30: 735c 6e26 7175 6f74 3b3c 2f73 7061 6e3e s\n" │ │ │ │ +00125b40: 2c20 636f 6e74 656e 742d 2667 743b 3c61 , content->id?content │ │ │ │ +00125bb0: 2d26 6774 3b3c 6120 636c 6173 733d 2263 ->id: │ │ │ │ +00125c10: 3c73 7061 6e20 636c 6173 733d 2273 7472 &quo │ │ │ │ +00125c30: 743b 2671 756f 743b 3c2f 7370 616e 3e2c t;", │ │ │ │ +00125c40: 2063 6f6e 7465 6e74 2d26 6774 3b3c 6120 content->type?conten │ │ │ │ +00125cb0: 742d 2667 743b 3c61 2063 6c61 7373 3d22 t->type:& │ │ │ │ +00125d30: 7175 6f74 3b26 7175 6f74 3b3c 2f73 7061 quot;");
    .
    │ │ │ │ +00125d60: 2020 7d20 3c73 7061 6e20 636c 6173 733d } wh │ │ │ │ +00125d80: 696c 653c 2f73 7061 6e3e 2028 636f 6e74 ile (cont │ │ │ │ +00125d90: 656e 7429 3b20 3c2f 6469 763e 0a3c 6469 ent);
    . │ │ │ │ +00125db0: 2020 203c 7370 616e 2063 6c61 7373 3d22 if< │ │ │ │ +00125dd0: 2f73 7061 6e3e 2028 3c61 2063 6c61 7373 /span> (
    s │ │ │ │ +00125e00: 6f61 703c 2f61 3e2d 2667 743b 3c61 2063 oap->error) │ │ │ │ +00125e60: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    < │ │ │ │ +00125e80: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +00125e90: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ │ +00125ea0: 705f 5f66 6175 6c74 2e68 746d 6c23 6761 p__fault.html#ga │ │ │ │ +00125eb0: 3933 3161 3461 6236 6466 3235 3533 6234 931a4ab6df2553b4 │ │ │ │ +00125ec0: 3861 3063 3237 3066 3861 3061 3838 6166 8a0c270f8a0a88af │ │ │ │ +00125ed0: 223e 736f 6170 5f70 7269 6e74 5f66 6175 ">soap_print_fau │ │ │ │ +00125ee0: 6c74 3c2f 613e 283c 6120 636c 6173 733d lt(so │ │ │ │ +00125f10: 6170 3c2f 613e 2c20 7374 6465 7272 293b ap, stderr); │ │ │ │ +00125f20: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    }.
    }
    .< │ │ │ │ +00125f60: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00125f70: 3e3c 6120 636c 6173 733d 2263 6f64 6522 >soap_destr │ │ │ │ +00125fd0: 6f79 3c2f 613e 283c 6120 636c 6173 733d oy(so │ │ │ │ +00126000: 6170 3c2f 613e 293b 203c 2f64 6976 3e0a ap);
    . │ │ │ │ +00126010: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65 .< │ │ │ │ +001260d0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +001260e0: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ │ +001260f0: 705f 5f63 6f6e 7465 7874 2e68 746d 6c23 p__context.html# │ │ │ │ +00126100: 6761 3537 3130 3863 6134 3638 3131 3836 ga57108ca4681186 │ │ │ │ +00126110: 6535 3862 3562 3138 3963 3335 3238 6631 e58b5b189c3528f1 │ │ │ │ +00126120: 3061 223e 736f 6170 5f66 7265 653c 2f61 0a">soap_free(soap);
    .
    │ │ │ │ +001261d0: 3c61 2068 7265 663d 2267 726f 7570 5f5f soap_recv_m │ │ │ │ +00126220: 696d 655f 6174 7461 6368 6d65 6e74 3c2f ime_attachment
    .< │ │ │ │ +001262e0: 6469 7620 636c 6173 733d 2274 7463 2220 div class="ttc" │ │ │ │ +001262f0: 6964 3d22 6167 726f 7570 5f5f 6772 6f75 id="agroup__grou │ │ │ │ +00126300: 705f 5f6d 696d 655f 6874 6d6c 5f67 6135 p__mime_html_ga5 │ │ │ │ +00126310: 3763 6632 6139 3538 6232 6365 3665 3935 7cf2a958b2ce6e95 │ │ │ │ +00126320: 3738 3935 3634 3263 6434 6330 3936 3622 7895642cd4c0966" │ │ │ │ +00126330: 3e3c 6469 7620 636c 6173 733d 2274 746e >
    soap_p │ │ │ │ +00126390: 6f73 745f 6368 6563 6b5f 6d69 6d65 5f61 ost_check_mime_a │ │ │ │ +001263a0: 7474 6163 686d 656e 7473 3c2f 613e 3c2f ttachments
    int soap │ │ │ │ +001263d0: 5f70 6f73 745f 6368 6563 6b5f 6d69 6d65 _post_check_mime │ │ │ │ +001263e0: 5f61 7474 6163 686d 656e 7473 2873 7472 _attachments(str │ │ │ │ +001263f0: 7563 7420 736f 6170 202a 736f 6170 293c uct soap *soap)< │ │ │ │ +00126400: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
    Enable p │ │ │ │ +00126420: 6f73 742d 7072 6f63 6573 7369 6e67 206f ost-processing o │ │ │ │ +00126430: 6620 4d49 4d45 2f4d 544f 4d20 6174 7461 f MIME/MTOM atta │ │ │ │ +00126440: 6368 6d65 6e74 732e 3c2f 6469 763e 3c2f chments.
    .
    │ │ │ │ +00126500: 736f 6170 5f63 6865 636b 5f6d 696d 655f soap_check_mime_ │ │ │ │ +00126510: 6174 7461 6368 6d65 6e74 733c 2f61 3e3c attachments< │ │ │ │ +00126520: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
    int soa │ │ │ │ +00126540: 705f 6368 6563 6b5f 6d69 6d65 5f61 7474 p_check_mime_att │ │ │ │ +00126550: 6163 686d 656e 7473 2873 7472 7563 7420 achments(struct │ │ │ │ +00126560: 736f 6170 202a 736f 6170 293c 2f64 6976 soap *soap)
    Check for a │ │ │ │ +00126590: 4d49 4d45 2f4d 544f 4d20 6174 7461 6368 MIME/MTOM attach │ │ │ │ +001265a0: 6d65 6e74 2e3c 2f64 6976 3e3c 2f64 6976 ment.
    .

    The │ │ │ │ +001265d0: 7365 7276 6572 2d73 6964 6520 7365 7276 server-side serv │ │ │ │ +001265e0: 6963 6520 6f70 6572 6174 696f 6e73 2061 ice operations a │ │ │ │ +001265f0: 7265 2069 6d70 6c65 6d65 6e74 6564 2061 re implemented a │ │ │ │ +00126600: 7320 7573 7561 6c2c 2062 7574 2077 6974 s usual, but wit │ │ │ │ +00126610: 6820 6164 6469 7469 6f6e 616c 2063 6865 h additional che │ │ │ │ +00126620: 636b 7320 666f 7220 4d49 4d45 2f4d 544f cks for MIME/MTO │ │ │ │ +00126630: 4d20 6174 7461 6368 6d65 6e74 733a 3c2f M attachments:.

    int │ │ │ │ +00126690: 6d61 696e 2829 3c2f 6469 763e 0a3c 6469 main()
    .{ │ │ │ │ +001266b0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    struct < │ │ │ │ +001266f0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +00126700: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ +00126710: 6874 6d6c 223e 736f 6170 3c2f 613e 202a html">soap * │ │ │ │ +00126720: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap │ │ │ │ +00126750: 3d20 3c61 2063 6c61 7373 3d22 636f 6465 = soap_new1 │ │ │ │ +001267b0: 3c2f 613e 283c 6120 636c 6173 733d 2263 (SOAP_ENC │ │ │ │ +00126810: 5f4d 544f 4d3c 2f61 3e29 3b20 3c2f 6469 _MTOM); ..
    soap_ │ │ │ │ +00126950: 7365 7276 653c 2f61 3e28 3c61 2063 6c61 serve(soap); .
    }
    . │ │ │ │ +001269c0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    int ns │ │ │ │ +00126a00: 5f5f 6d79 4d65 7468 6f64 283c 7370 616e __myMethod(struct < │ │ │ │ +00126a30: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +00126a40: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ +00126a50: 6874 6d6c 223e 736f 6170 3c2f 613e 202a html">soap * │ │ │ │ +00126a60: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap, │ │ │ │ +00126a90: 202e 2e2e 2920 3c2f 6469 763e 0a3c 6469 ...)
    .{ │ │ │ │ +00126ab0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    ... < │ │ │ │ +00126ad0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ +00126ae0: 656e 7422 3e2f 2f20 7365 7276 6572 2d73 ent">// server-s │ │ │ │ +00126af0: 6964 6520 7072 6f63 6573 7369 6e67 206c ide processing l │ │ │ │ +00126b00: 6f67 6963 203c 2f73 7061 6e3e 3c2f 6469 ogic .
    if (so │ │ │ │ +00126ba0: 6170 5f63 6865 636b 5f6d 696d 655f 6174 ap_check_mime_at │ │ │ │ +00126bb0: 7461 6368 6d65 6e74 733c 2f61 3e28 3c61 tachments(soap))< │ │ │ │ +00126bf0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    {
    .
    // │ │ │ │ +00126c40: 2061 7474 6163 686d 656e 7473 2061 7265 attachments are │ │ │ │ +00126c50: 2070 7265 7365 6e74 2c20 6368 616e 6e65 present, channe │ │ │ │ +00126c60: 6c20 6973 2073 7469 6c6c 206f 7065 6e20 l is still open │ │ │ │ +00126c70: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ │ +00126c90: 2020 2020 3c73 7061 6e20 636c 6173 733d do │ │ │ │ +00126cb0: 3c2f 7370 616e 3e20 3c2f 6469 763e 0a3c
    .< │ │ │ │ +00126cc0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00126cd0: 3e20 2020 207b 3c2f 6469 763e 0a3c 6469 > {
    . │ │ │ │ +00126cf0: 2020 2020 202e 2e2e 203c 7370 616e 2063 ... / │ │ │ │ +00126d10: 2f20 6765 7420 6461 7461 2026 2333 393b / get data ' │ │ │ │ +00126d20: 6861 6e64 6c65 2623 3339 3b20 6672 6f6d handle' from │ │ │ │ +00126d30: 2053 4f41 5020 7265 7175 6573 7420 616e SOAP request an │ │ │ │ +00126d40: 6420 7061 7373 2074 6f20 6361 6c6c 6261 d pass to callba │ │ │ │ +00126d50: 636b 7320 3c2f 7370 616e 3e3c 2f64 6976 cks
    .
    ... // set the f │ │ │ │ +00126da0: 6d69 6d65 2063 616c 6c62 6163 6b73 2c20 mime callbacks, │ │ │ │ +00126db0: 6966 206e 6565 6465 6420 3c2f 7370 616e if needed
    .. │ │ │ │ +00126f40: 2020 2020 2070 7269 6e74 6628 3c73 7061 printf("Re │ │ │ │ +00126f70: 6365 6976 6564 2061 7474 6163 686d 656e ceived attachmen │ │ │ │ +00126f80: 7420 7769 7468 2069 643d 2573 2061 6e64 t with id=%s and │ │ │ │ +00126f90: 2074 7970 653d 2573 5c6e 2671 756f 743b type=%s\n" │ │ │ │ +00126fa0: 3c2f 7370 616e 3e2c 2063 6f6e 7465 6e74 , content │ │ │ │ +00126fb0: 2d26 6774 3b3c 6120 636c 6173 733d 2263 ->id? │ │ │ │ +00127010: 636f 6e74 656e 742d 2667 743b 3c61 2063 content-> │ │ │ │ +00127070: 6964 3c2f 613e 3a3c 7370 616e 2063 6c61 id:""< │ │ │ │ +001270a0: 2f73 7061 6e3e 2c20 636f 6e74 656e 742d /span>, content- │ │ │ │ +001270b0: 2667 743b 3c61 2063 6c61 7373 3d22 636f >type │ │ │ │ +00127110: 3f63 6f6e 7465 6e74 2d26 6774 3b3c 6120 ?content->type:"&quo │ │ │ │ +001271a0: 743b 3c2f 7370 616e 3e29 3b20 3c2f 6469 t;); .
    } while (content); .
    if (< │ │ │ │ +00127240: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +00127250: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ +00127260: 6874 6d6c 223e 736f 6170 3c2f 613e 2d26 html">soap-& │ │ │ │ +00127270: 6774 3b3c 6120 636c 6173 733d 2263 6f64 gt;erro │ │ │ │ +001272c0: 723c 2f61 3e29 203c 2f64 6976 3e0a 3c64 r)
    . │ │ │ │ +001272e0: 2020 2020 2020 3c73 7061 6e20 636c 6173 │ │ │ │ +00127300: 7265 7475 726e 3c2f 7370 616e 3e20 3c61 return soap-&g │ │ │ │ +00127340: 743b 3c61 2063 6c61 7373 3d22 636f 6465 t;error │ │ │ │ +00127390: 3c2f 613e 3b20 3c2f 6469 763e 0a3c 6469 ;
    . │ │ │ │ +001273b0: 207d 203c 2f64 6976 3e0a 3c64 6976 2063 }
    .
    .. │ │ │ │ +001273d0: 2e20 3c73 7061 6e20 636c 6173 733d 2263 . // serve │ │ │ │ +001273f0: 722d 7369 6465 2070 726f 6365 7373 696e r-side processin │ │ │ │ +00127400: 6720 6c6f 6769 6320 3c2f 7370 616e 3e3c g logic < │ │ │ │ +00127410: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    return SOAP_OK;
    .
    }.

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

    │ │ │ │ +00127520: 0a3c 6832 3e3c 6120 636c 6173 733d 2261 .

    .St │ │ │ │ +00127550: 7265 616d 696e 6720 6368 756e 6b65 6420 reaming chunked │ │ │ │ +00127560: 4d49 4d45 2f4d 544f 4d3c 2f68 323e 0a3c MIME/MTOM

    .< │ │ │ │ +00127570: 703e 546f 2073 656e 6420 4d49 4d45 2f4d p>To send MIME/M │ │ │ │ +00127580: 544f 4d20 6174 7461 6368 6d65 6e74 732c TOM attachments, │ │ │ │ +00127590: 2074 6865 2061 7474 6163 686d 656e 7420 the attachment │ │ │ │ +001275a0: 7369 7a65 7320 6d75 7374 2062 6520 6465 sizes must be de │ │ │ │ +001275b0: 7465 726d 696e 6564 2069 6e20 6164 7661 termined in adva │ │ │ │ +001275c0: 6e63 6520 746f 2063 616c 6375 6c61 7465 nce to calculate │ │ │ │ +001275d0: 2048 5454 5020 6d65 7373 6167 6520 6c65 HTTP message le │ │ │ │ +001275e0: 6e67 7468 2072 6571 7569 7265 6420 746f ngth required to │ │ │ │ +001275f0: 2073 7472 6561 6d20 4d49 4d45 2f4d 544f stream MIME/MTO │ │ │ │ +00127600: 4d20 6f76 6572 2048 5454 502e 2048 6f77 M over HTTP. How │ │ │ │ +00127610: 6576 6572 2c20 6368 756e 6b65 6420 4d49 ever, chunked MI │ │ │ │ +00127620: 4d45 2f4d 544f 4d20 746f 6765 7468 6572 ME/MTOM together │ │ │ │ +00127630: 2077 6974 6820 6368 756e 6b65 6420 4854 with chunked HT │ │ │ │ +00127640: 5450 2063 616e 2062 6520 7573 6564 2074 TP can be used t │ │ │ │ +00127650: 6f20 6f6d 6974 2074 6869 7320 7374 6570 o omit this step │ │ │ │ +00127660: 2e20 4669 7273 7420 7365 7420 7468 6520 . First set the │ │ │ │ +00127670: 3c63 6f64 653e 2353 4f41 505f 494f 5f43 #SOAP_IO_C │ │ │ │ +00127680: 4855 4e4b 3c2f 636f 6465 3e20 666c 6167 HUNK flag │ │ │ │ +00127690: 2e20 5468 656e 2c20 746f 2073 7472 6561 . Then, to strea │ │ │ │ +001276a0: 6d20 6368 756e 6b65 6420 4d49 4d45 2f4d m chunked MIME/M │ │ │ │ +001276b0: 544f 4d2c 2073 6574 2074 6865 203c 636f TOM, set the __size
    │ │ │ │ +001276d0: 206d 656d 6265 7220 6f66 2061 6e20 6174 member of an at │ │ │ │ +001276e0: 7461 6368 6d65 6e74 2074 6f20 7a65 726f tachment to zero │ │ │ │ +001276f0: 2061 6e64 2065 6e61 626c 6520 4d49 4d45 and enable MIME │ │ │ │ +00127700: 2f4d 544f 4d20 6368 756e 6b69 6e67 2e20 /MTOM chunking. │ │ │ │ +00127710: 5468 6520 4d49 4d45 2f4d 544f 4d20 3c63 The MIME/MTOM soap::f │ │ │ │ +001277c0: 6d69 6d65 7265 6164 3c2f 613e 3c2f 636f mimeread callback the │ │ │ │ +001277e0: 6e20 6665 7463 6865 7320 6461 7461 2069 n fetches data i │ │ │ │ +001277f0: 6e20 6368 756e 6b73 2061 6e64 2069 7420 n chunks and it │ │ │ │ +00127800: 6973 2069 6d70 6f72 7461 6e74 2074 6f20 is important to │ │ │ │ +00127810: 6669 6c6c 2074 6865 2065 6e74 6972 6520 fill the entire │ │ │ │ +00127820: 6275 6666 6572 2075 6e6c 6573 7320 7468 buffer unless th │ │ │ │ +00127830: 6520 656e 6420 6f66 2074 6865 2064 6174 e end of the dat │ │ │ │ +00127840: 6120 6861 7320 6265 656e 2072 6561 6368 a has been reach │ │ │ │ +00127850: 6564 2061 6e64 2074 6865 206c 6173 7420 ed and the last │ │ │ │ +00127860: 6368 756e 6b20 6973 2074 6f20 6265 2073 chunk is to be s │ │ │ │ +00127870: 656e 642e 2054 6861 7420 6973 2c20 3c63 end. That is, soap::f │ │ │ │ +00127920: 6d69 6d65 7265 6164 3c2f 613e 3c2f 636f mimeread should retur │ │ │ │ +00127940: 6e20 7468 6520 7661 6c75 6520 6f66 2074 n the value of t │ │ │ │ +00127950: 6865 206c 6173 7420 3c63 6f64 653e 6c65 he last le │ │ │ │ +00127960: 6e3c 2f63 6f64 653e 2070 6172 616d 6574 n paramet │ │ │ │ +00127970: 6572 2061 6e64 2066 696c 6c20 7468 6520 er and fill the │ │ │ │ +00127980: 656e 7469 7265 2062 7566 6665 7220 3c63 entire buffer buf f │ │ │ │ +001279a0: 6f72 2061 6c6c 2063 6875 6e6b 7320 6578 or all chunks ex │ │ │ │ +001279b0: 6365 7074 2074 6865 206c 6173 742e 2046 cept the last. F │ │ │ │ +001279c0: 6f72 2074 6865 206c 6173 7420 6974 2072 or the last it r │ │ │ │ +001279d0: 6574 7572 6e73 2030 2e3c 2f70 3e0a 3c70 eturns 0.

    .

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

    .SOAP/XML │ │ │ │ +00127a40: 206f 7665 7220 5544 503c 2f68 313e 0a3c over UDP

    .< │ │ │ │ +00127a50: 703e 5544 5020 6973 2061 2073 696d 706c p>UDP is a simpl │ │ │ │ +00127a60: 652c 2075 6e72 656c 6961 626c 6520 6461 e, unreliable da │ │ │ │ +00127a70: 7461 6772 616d 2070 726f 746f 636f 6c3a tagram protocol: │ │ │ │ +00127a80: 2055 4450 2073 6f63 6b65 7473 2061 7265 UDP sockets are │ │ │ │ +00127a90: 2063 6f6e 6e65 6374 696f 6e6c 6573 732e connectionless. │ │ │ │ +00127aa0: 2055 4450 2061 6464 7265 7373 2066 6f72 UDP address for │ │ │ │ +00127ab0: 6d61 7473 2061 7265 2069 6465 6e74 6963 mats are identic │ │ │ │ +00127ac0: 616c 2074 6f20 7468 6f73 6520 7573 6564 al to those used │ │ │ │ +00127ad0: 2062 7920 5443 502e 2049 6e20 7061 7274 by TCP. In part │ │ │ │ +00127ae0: 6963 756c 6172 2055 4450 2070 726f 7669 icular UDP provi │ │ │ │ +00127af0: 6465 7320 6120 706f 7274 2069 6465 6e74 des a port ident │ │ │ │ +00127b00: 6966 6965 7220 696e 2061 6464 6974 696f ifier in additio │ │ │ │ +00127b10: 6e20 746f 2074 6865 206e 6f72 6d61 6c20 n to the normal │ │ │ │ +00127b20: 496e 7465 726e 6574 2061 6464 7265 7373 Internet address │ │ │ │ +00127b30: 2066 6f72 6d61 742e 2054 6865 2055 4450 format. The UDP │ │ │ │ +00127b40: 2070 6f72 7420 7370 6163 6520 6973 2073 port space is s │ │ │ │ +00127b50: 6570 6172 6174 6520 6672 6f6d 2074 6865 eparate from the │ │ │ │ +00127b60: 2054 4350 2070 6f72 7420 7370 6163 6520 TCP port space │ │ │ │ +00127b70: 2869 2e65 2e20 6120 5544 5020 706f 7274 (i.e. a UDP port │ │ │ │ +00127b80: 206d 6179 206e 6f74 2062 6520 2263 6f6e may not be "con │ │ │ │ +00127b90: 6e65 6374 6564 2220 746f 2061 2054 4350 nected" to a TCP │ │ │ │ +00127ba0: 2070 6f72 7429 2e20 496e 2061 6464 6974 port). In addit │ │ │ │ +00127bb0: 696f 6e20 6272 6f61 6463 6173 7420 7061 ion broadcast pa │ │ │ │ +00127bc0: 636b 6574 7320 6d61 7920 6265 2073 656e ckets may be sen │ │ │ │ +00127bd0: 7420 2861 7373 756d 696e 6720 7468 6520 t (assuming the │ │ │ │ +00127be0: 756e 6465 726c 7969 6e67 206e 6574 776f underlying netwo │ │ │ │ +00127bf0: 726b 2073 7570 706f 7274 7320 7468 6973 rk supports this │ │ │ │ +00127c00: 2920 6279 2075 7369 6e67 2061 2072 6573 ) by using a res │ │ │ │ +00127c10: 6572 7665 6420 2262 726f 6164 6361 7374 erved "broadcast │ │ │ │ +00127c20: 0a61 6464 7265 7373 223b 2074 6869 7320 .address"; this │ │ │ │ +00127c30: 6164 6472 6573 7320 6973 206e 6574 776f address is netwo │ │ │ │ +00127c40: 726b 2069 6e74 6572 6661 6365 2064 6570 rk interface dep │ │ │ │ +00127c50: 656e 6465 6e74 2e3c 2f70 3e0a 3c70 3e43 endent.

    .

    C │ │ │ │ +00127c60: 6c69 656e 742d 7369 6465 206d 6573 7361 lient-side messa │ │ │ │ +00127c70: 6765 7320 7769 7468 2053 4f41 502d 6f76 ges with SOAP-ov │ │ │ │ +00127c80: 6572 2d55 4450 2065 6e64 706f 696e 7420 er-UDP endpoint │ │ │ │ +00127c90: 5552 4c73 2028 3c63 6f64 653e 736f 6170 URLs (soap │ │ │ │ +00127ca0: 2e75 6470 3a2f 2f2e 2e2e 3c2f 636f 6465 .udp://...) are automatic │ │ │ │ +00127cc0: 616c 6c79 2074 7261 6e73 6d69 7474 6564 ally transmitted │ │ │ │ +00127cd0: 2061 7320 6461 7461 6772 616d 732e 2053 as datagrams. S │ │ │ │ +00127ce0: 6572 7665 722d 7369 6465 2061 7070 6c69 erver-side appli │ │ │ │ +00127cf0: 6361 7469 6f6e 7320 7368 6f75 6c64 2073 cations should s │ │ │ │ +00127d00: 6574 2074 6865 203c 636f 6465 3e23 534f et the #SO │ │ │ │ +00127d10: 4150 5f49 4f5f 5544 503c 2f63 6f64 653e AP_IO_UDP │ │ │ │ +00127d20: 206d 6f64 6520 666c 6167 2074 6f20 6163 mode flag to ac │ │ │ │ +00127d30: 6365 7074 2055 4450 2072 6571 7565 7374 cept UDP request │ │ │ │ +00127d40: 732c 2065 2e67 2e20 7573 696e 6720 3c63 s, e.g. using soap_new1, soap_in │ │ │ │ +00127ed0: 6974 313c 2f61 3e3c 2f63 6f64 653e 2c20 it1, │ │ │ │ +00127ee0: 6f72 203c 636f 6465 3e3c 6120 636c 6173 or soap_set_mod │ │ │ │ +00127f90: 653c 2f61 3e3c 2f63 6f64 653e 2e3c 2f70 e.

    .

    The maximum │ │ │ │ +00127fb0: 206d 6573 7361 6765 206c 656e 6774 6820 message length │ │ │ │ +00127fc0: 666f 7220 6461 7461 6772 616d 2070 6163 for datagram pac │ │ │ │ +00127fd0: 6b65 7473 2069 7320 7265 7374 7269 6374 kets is restrict │ │ │ │ +00127fe0: 6564 2062 7920 7468 6520 6275 6666 6572 ed by the buffer │ │ │ │ +00127ff0: 2073 697a 6520 3c63 6f64 653e 2353 4f41 size #SOA │ │ │ │ +00128000: 505f 4255 464c 454e 3c2f 636f 6465 3e2c P_BUFLEN, │ │ │ │ +00128010: 2077 6869 6368 2069 7320 3635 3533 3620 which is 65536 │ │ │ │ +00128020: 6279 2064 6566 6175 6c74 2c20 756e 6c65 by default, unle │ │ │ │ +00128030: 7373 2063 6f6d 7069 6c65 6420 7769 7468 ss compiled with │ │ │ │ +00128040: 203c 636f 6465 3e23 5749 5448 5f4c 4541 #WITH_LEA │ │ │ │ +00128050: 4e3c 2f63 6f64 653e 2074 6f20 7375 7070 N to supp │ │ │ │ +00128060: 6f72 7420 736d 616c 6c2d 7363 616c 6520 ort small-scale │ │ │ │ +00128070: 656d 6265 6464 6564 2073 7973 7465 6d73 embedded systems │ │ │ │ +00128080: 2e20 466f 7220 5544 5020 7472 616e 7370 . For UDP transp │ │ │ │ +00128090: 6f72 7420 3c63 6f64 653e 2353 4f41 505f ort #SOAP_ │ │ │ │ +001280a0: 4255 464c 454e 3c2f 636f 6465 3e20 6d75 BUFLEN mu │ │ │ │ +001280b0: 7374 206e 6f74 2065 7863 6565 6420 7468 st not exceed th │ │ │ │ +001280c0: 6520 6d61 7869 6d75 6d20 5544 5020 7061 e maximum UDP pa │ │ │ │ +001280d0: 636b 6574 2073 697a 6520 3635 3533 3620 cket size 65536 │ │ │ │ +001280e0: 2874 6865 2073 697a 6520 6f66 2064 6174 (the size of dat │ │ │ │ +001280f0: 6167 7261 6d20 6d65 7373 6167 6573 2069 agram messages i │ │ │ │ +00128100: 7320 636f 6e73 7472 6169 6e65 6420 6279 s constrained by │ │ │ │ +00128110: 2074 6865 2055 4450 2070 6163 6b65 7420 the UDP packet │ │ │ │ +00128120: 7369 7a65 2032 5e31 363d 3635 3533 3620 size 2^16=65536 │ │ │ │ +00128130: 6173 2070 6572 2055 4450 2073 7461 6e64 as per UDP stand │ │ │ │ +00128140: 6172 6429 2e20 596f 7520 6361 6e20 7573 ard). You can us │ │ │ │ +00128150: 6520 636f 6d70 7265 7373 696f 6e20 7769 e compression wi │ │ │ │ +00128160: 7468 203c 636f 6465 3e23 534f 4150 5f45 th #SOAP_E │ │ │ │ +00128170: 4e43 5f5a 4c49 423c 2f63 6f64 653e 2074 NC_ZLIB t │ │ │ │ +00128180: 6f20 7265 6475 6365 2074 6865 206d 6573 o reduce the mes │ │ │ │ +00128190: 7361 6765 2073 697a 652c 2062 7574 206e sage size, but n │ │ │ │ +001281a0: 6f74 6520 7468 6174 2063 6f6d 7072 6573 ote that compres │ │ │ │ +001281b0: 7365 6420 534f 4150 2d6f 7665 722d 5544 sed SOAP-over-UD │ │ │ │ +001281c0: 5020 6973 2061 2067 534f 4150 2d73 7065 P is a gSOAP-spe │ │ │ │ +001281d0: 6369 6669 6320 6665 6174 7572 6520 6265 cific feature be │ │ │ │ +001281e0: 6361 7573 6520 6974 2069 7320 6e6f 7420 cause it is not │ │ │ │ +001281f0: 7061 7274 206f 6620 7468 6520 534f 4150 part of the SOAP │ │ │ │ +00128200: 2d6f 7665 722d 5544 5020 7370 6563 6966 -over-UDP specif │ │ │ │ +00128210: 6963 6174 696f 6e2e 3c2f 703e 0a3c 703e ication.

    .

    │ │ │ │ +00128220: 5468 6520 534f 4150 2d6f 7665 722d 5544 The SOAP-over-UD │ │ │ │ +00128230: 5020 7370 6563 6966 6963 6174 696f 6e20 P specification │ │ │ │ +00128240: 7265 6c69 6573 206f 6e20 5753 2d41 6464 relies on WS-Add │ │ │ │ +00128250: 7265 7373 696e 672e 2054 6865 203c 656d ressing. The wsa.h file in │ │ │ │ +00128280: 2074 6865 203c 636f 6465 3e69 6d70 6f72 the impor │ │ │ │ +00128290: 743c 2f63 6f64 653e 2064 6972 6563 746f t directo │ │ │ │ +001282a0: 7279 2064 6566 696e 6573 2074 6865 2057 ry defines the W │ │ │ │ +001282b0: 532d 4164 6472 6573 7369 6e67 2065 6c65 S-Addressing ele │ │ │ │ +001282c0: 6d65 6e74 7320 666f 7220 636c 6965 6e74 ments for client │ │ │ │ +001282d0: 2061 6e64 2073 6572 7665 7220 6170 706c and server appl │ │ │ │ +001282e0: 6963 6174 696f 6e73 2e3c 2f70 3e0a 3c70 ications.

    .

    The gSOAP imple │ │ │ │ +00128300: 6d65 6e74 6174 696f 6e20 636f 6e66 6f72 mentation confor │ │ │ │ +00128310: 6d73 2074 6f20 7468 6520 534f 4150 2d6f ms to the SOAP-o │ │ │ │ +00128320: 7665 722d 5544 5020 7265 7175 6972 656d ver-UDP requirem │ │ │ │ +00128330: 656e 7473 3a3c 2f70 3e0a 3c75 6c3e 0a3c ents:

    .
      .< │ │ │ │ +00128340: 6c69 3e53 4f41 502d 6f76 6572 2d55 4450 li>SOAP-over-UDP │ │ │ │ +00128350: 2073 6572 7665 7220 656e 6470 6f69 6e74 server endpoint │ │ │ │ +00128360: 2055 524c 2066 6f72 6d61 743a 203c 656d URL format: soap.udp: │ │ │ │ +00128380: 2f2f 686f 7374 3a70 6f72 742f 7061 7468 //host:port/path │ │ │ │ +00128390: 3c2f 636f 6465 3e3c 2f65 6d3e 3c2f 6c69 .
    • Support on │ │ │ │ +001283b0: 652d 7761 7920 6d65 7373 6167 652d 6578 e-way message-ex │ │ │ │ +001283c0: 6368 616e 6765 2070 6174 7465 726e 2028 change pattern ( │ │ │ │ +001283d0: 4d45 5029 2077 6865 7265 2061 2053 4f41 MEP) where a SOA │ │ │ │ +001283e0: 5020 656e 7665 6c6f 7065 2069 7320 6361 P envelope is ca │ │ │ │ +001283f0: 7272 6965 6420 696e 2061 2075 7365 7220 rried in a user │ │ │ │ +00128400: 6461 7461 6772 616d 2e3c 2f6c 693e 0a3c datagram.
    • .< │ │ │ │ +00128410: 6c69 3e53 7570 706f 7274 2072 6571 7565 li>Support reque │ │ │ │ +00128420: 7374 2d72 6573 706f 6e73 6520 6d65 7373 st-response mess │ │ │ │ +00128430: 6167 652d 6578 6368 616e 6765 2070 6174 age-exchange pat │ │ │ │ +00128440: 7465 726e 2028 4d45 5029 2077 6865 7265 tern (MEP) where │ │ │ │ +00128450: 2053 4f41 5020 656e 7665 6c6f 7065 7320 SOAP envelopes │ │ │ │ +00128460: 6172 6520 6361 7272 6965 6420 696e 2075 are carried in u │ │ │ │ +00128470: 7365 7220 6461 7461 6772 616d 732e 3c2f ser datagrams..
    • Support │ │ │ │ +00128490: 6d75 6c74 6963 6173 7420 7472 616e 736d multicast transm │ │ │ │ +001284a0: 6973 7369 6f6e 206f 6620 534f 4150 2065 ission of SOAP e │ │ │ │ +001284b0: 6e76 656c 6f70 6573 2063 6172 7269 6564 nvelopes carried │ │ │ │ +001284c0: 2069 6e20 7573 6572 2064 6174 6167 7261 in user datagra │ │ │ │ +001284d0: 6d73 2e3c 2f6c 693e 0a3c 6c69 3e53 7570 ms.
    • .
    • Sup │ │ │ │ +001284e0: 706f 7274 2062 6f74 6820 534f 4150 2031 port both SOAP 1 │ │ │ │ +001284f0: 2e31 2061 6e64 2053 4f41 5020 312e 3220 .1 and SOAP 1.2 │ │ │ │ +00128500: 656e 7665 6c6f 7065 732e 3c2f 6c69 3e0a envelopes.
    • . │ │ │ │ +00128510: 3c2f 756c 3e0a 3c70 3e54 6865 2066 6f6c
    .

    The fol │ │ │ │ +00128520: 6c6f 7769 6e67 2061 6464 6974 696f 6e61 lowing additiona │ │ │ │ +00128530: 6c20 6665 6174 7572 6573 2061 7265 2061 l features are a │ │ │ │ +00128540: 6c73 6f20 6176 6169 6c61 626c 652c 2062 lso available, b │ │ │ │ +00128550: 7574 2061 7265 206e 6f74 2073 7570 706f ut are not suppo │ │ │ │ +00128560: 7274 6564 2062 7920 7468 6520 534f 4150 rted by the SOAP │ │ │ │ +00128570: 2d6f 7665 722d 5544 5020 7370 6563 6966 -over-UDP specif │ │ │ │ +00128580: 6963 6174 696f 6e3a 3c2f 703e 0a3c 756c ication:

    .
      .
    • Zlib/gzip │ │ │ │ +001285a0: 6d65 7373 6167 6520 636f 6d70 7265 7373 message compress │ │ │ │ +001285b0: 696f 6e20 2875 7365 2063 6f6d 7069 6c65 ion (use compile │ │ │ │ +001285c0: 2d74 696d 6520 666c 6167 203c 636f 6465 -time flag #WITH_GZIP).
    • .
    • SO │ │ │ │ +001285f0: 4150 2077 6974 6820 4449 4d45 2061 7474 AP with DIME att │ │ │ │ +00128600: 6163 686d 656e 7473 206f 7665 7220 5544 achments over UD │ │ │ │ +00128610: 502e 3c2f 6c69 3e0a 3c6c 693e 534f 4150 P.
    • .
    • SOAP │ │ │ │ +00128620: 2077 6974 6820 4d49 4d45 2f4d 544f 4d20 with MIME/MTOM │ │ │ │ +00128630: 6174 7461 6368 6d65 6e74 7320 6f76 6572 attachments over │ │ │ │ +00128640: 2055 4450 2e3c 2f6c 693e 0a3c 6c69 3e53 UDP.
    • .
    • S │ │ │ │ +00128650: 7570 706f 7274 2066 6f72 2049 5076 3620 upport for IPv6 │ │ │ │ +00128660: 2875 7365 2063 6f6d 7069 6c65 2d74 696d (use compile-tim │ │ │ │ +00128670: 6520 666c 6167 203c 636f 6465 3e23 5749 e flag #WI │ │ │ │ +00128680: 5448 5f49 5056 363c 2f63 6f64 653e 293c TH_IPV6)< │ │ │ │ +00128690: 2f6c 693e 0a3c 2f75 6c3e 0a3c 703e f09f /li>.
    .

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

    │ │ │ │ +001286d0: 0a3c 6832 3e3c 6120 636c 6173 733d 2261 .

    .Using WS │ │ │ │ +00128700: 2d41 6464 7265 7373 696e 6720 7769 7468 -Addressing with │ │ │ │ +00128710: 2053 4f41 502d 6f76 6572 2d55 4450 3c2f SOAP-over-UDP.

    A SOAP-ov │ │ │ │ +00128730: 6572 2d55 4450 2061 7070 6c69 6361 7469 er-UDP applicati │ │ │ │ +00128740: 6f6e 206d 6179 2075 7365 2057 532d 4164 on may use WS-Ad │ │ │ │ +00128750: 6472 6573 7369 6e67 2074 6f20 636f 6e74 dressing to cont │ │ │ │ +00128760: 726f 6c20 6d65 7373 6167 6520 6465 6c69 rol message deli │ │ │ │ +00128770: 7665 7279 2061 7320 7065 7220 534f 4150 very as per SOAP │ │ │ │ +00128780: 2d6f 7665 722d 5544 5020 7370 6563 6966 -over-UDP specif │ │ │ │ +00128790: 6963 6174 696f 6e2e 3c2f 703e 0a3c 703e ication.

    .

    │ │ │ │ +001287a0: 5468 6520 3c65 6d3e 3c63 6f64 653e 7773 The ws │ │ │ │ +001287b0: 612e 683c 2f63 6f64 653e 3c2f 656d 3e20 a.h │ │ │ │ +001287c0: 6669 6c65 2069 6e20 7468 6520 3c63 6f64 file in the import │ │ │ │ +001287e0: 6469 7265 6374 6f72 7920 6465 6669 6e65 directory define │ │ │ │ +001287f0: 7320 7468 6520 5753 2d41 6464 7265 7373 s the WS-Address │ │ │ │ +00128800: 696e 6720 656c 656d 656e 7473 2e20 546f ing elements. To │ │ │ │ +00128810: 2069 6e63 6c75 6465 2074 6865 2057 532d include the WS- │ │ │ │ +00128820: 4164 6472 6573 7369 6e67 2065 6c65 6d65 Addressing eleme │ │ │ │ +00128830: 6e74 7320 696e 2074 6865 2053 4f41 5020 nts in the SOAP │ │ │ │ +00128840: 4865 6164 6572 2066 6f72 206d 6573 7361 Header for messa │ │ │ │ +00128850: 6769 6e67 2c20 6120 5753 2d41 6464 7265 ging, a WS-Addre │ │ │ │ +00128860: 7373 696e 6720 6361 7061 626c 6520 3c63 ssing capable S │ │ │ │ +001288d0: 4f41 505f 454e 565f 5f48 6561 6465 723c OAP_ENV__Header< │ │ │ │ +001288e0: 2f61 3e3c 2f63 6f64 653e 2073 7472 7563 /a> struc │ │ │ │ +001288f0: 7420 7368 6f75 6c64 2062 6520 6465 6669 t should be defi │ │ │ │ +00128900: 6e65 6420 696e 2079 6f75 7220 6865 6164 ned in your head │ │ │ │ +00128910: 6572 2066 696c 6520 6279 2069 6d70 6f72 er file by impor │ │ │ │ +00128920: 7469 6e67 203c 656d 3e3c 636f 6465 3e67 ting g │ │ │ │ +00128930: 736f 6170 2f69 6d70 6f72 742f 7773 612e soap/import/wsa. │ │ │ │ +00128940: 683c 2f63 6f64 653e 3c2f 656d 3e20 6f72 h or │ │ │ │ +00128950: 203c 656d 3e3c 636f 6465 3e67 736f 6170 gsoap │ │ │ │ +00128960: 2f69 6d70 6f72 742f 7773 6135 2e68 3c2f /import/wsa5.h:

    . │ │ │ │ +00128980: 3c64 6976 2063 6c61 7373 3d22 6672 6167
    #import " │ │ │ │ +001289d0: 3b77 7361 2e68 2671 756f 743b 3c2f 7370 ;wsa.h"
    .

    │ │ │ │ +00128f40: 5265 7175 6573 742d 7265 7370 6f6e 7365 Request-response │ │ │ │ +00128f50: 2053 4f41 502d 6f76 6572 2d55 4450 206d SOAP-over-UDP m │ │ │ │ +00128f60: 6573 7361 6765 7320 7368 6f75 6c64 2062 essages should b │ │ │ │ +00128f70: 6520 6465 636c 6172 6564 2074 6f20 696e e declared to in │ │ │ │ +00128f80: 636c 7564 6520 7468 6520 3c65 6d3e 3c63 clude the wsa:MessageI │ │ │ │ +00128fa0: 443c 2f63 6f64 653e 3c2f 656d 3e2c 203c D, < │ │ │ │ +00128fb0: 656d 3e3c 636f 6465 3e77 7361 3a54 6f3c em>wsa:To< │ │ │ │ +00128fc0: 2f63 6f64 653e 3c2f 656d 3e2c 203c 656d /code>, wsa:Actio │ │ │ │ +00128fe0: 6e3c 2f63 6f64 653e 3c2f 656d 3e2c 2061 n, a │ │ │ │ +00128ff0: 6e64 203c 656d 3e3c 636f 6465 3e77 7361 nd wsa │ │ │ │ +00129000: 3a52 6570 6c79 546f 3c2f 636f 6465 3e3c :ReplyTo< │ │ │ │ +00129010: 2f65 6d3e 2065 6c65 6d65 6e74 7320 696e /em> elements in │ │ │ │ +00129020: 2074 6865 2053 4f41 5020 4865 6164 6572 the SOAP Header │ │ │ │ +00129030: 206f 6620 7468 6520 7265 7175 6573 7420 of the request │ │ │ │ +00129040: 6d65 7373 6167 652c 2061 6e64 2074 6865 message, and the │ │ │ │ +00129050: 2074 6865 203c 656d 3e3c 636f 6465 3e77 the w │ │ │ │ +00129060: 7361 3a4d 6573 7361 6765 4944 3c2f 636f sa:MessageID, wsa:To, wsa:Action, and wsa:Rela │ │ │ │ +001290d0: 7465 7354 6f3c 2f63 6f64 653e 3c2f 656d tesTo elements in th │ │ │ │ +001290f0: 6520 534f 4150 2048 6561 6465 7220 6f66 e SOAP Header of │ │ │ │ +00129100: 2074 6865 2072 6573 706f 6e73 6520 6d65 the response me │ │ │ │ +00129110: 7373 6167 653a 3c2f 703e 0a3c 6469 7620 ssage:

    .
    //gsoap │ │ │ │ +00129160: 206e 7320 7365 7276 6963 6520 6d65 7468 ns service meth │ │ │ │ +00129170: 6f64 2d68 6561 6465 722d 7061 7274 3a20 od-header-part: │ │ │ │ +00129180: 2020 2020 2020 2020 2065 6368 6f53 7472 echoStr │ │ │ │ +00129190: 696e 6720 7773 615f 5f4d 6573 7361 6765 ing wsa__Message │ │ │ │ +001291a0: 4944 203c 2f73 7061 6e3e 3c2f 6469 763e ID
    │ │ │ │ +001291b0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    //gsoap │ │ │ │ +001291e0: 206e 7320 7365 7276 6963 6520 6d65 7468 ns service meth │ │ │ │ +001291f0: 6f64 2d68 6561 6465 722d 7061 7274 3a20 od-header-part: │ │ │ │ +00129200: 2020 2020 2020 2020 2065 6368 6f53 7472 echoStr │ │ │ │ +00129210: 696e 6720 7773 615f 5f54 6f20 3c2f 7370 ing wsa__To
    .
    //gsoap ns ser │ │ │ │ +00129260: 7669 6365 206d 6574 686f 642d 6865 6164 vice method-head │ │ │ │ +00129270: 6572 2d70 6172 743a 2020 2020 2020 2020 er-part: │ │ │ │ +00129280: 2020 6563 686f 5374 7269 6e67 2077 7361 echoString wsa │ │ │ │ +00129290: 5f5f 4163 7469 6f6e 203c 2f73 7061 6e3e __Action │ │ │ │ +001292a0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    / │ │ │ │ +001292d0: 2f67 736f 6170 206e 7320 7365 7276 6963 /gsoap ns servic │ │ │ │ +001292e0: 6520 6d65 7468 6f64 2d69 6e70 7574 2d68 e method-input-h │ │ │ │ +001292f0: 6561 6465 722d 7061 7274 3a20 2020 2065 eader-part: e │ │ │ │ +00129300: 6368 6f53 7472 696e 6720 7773 615f 5f52 choString wsa__R │ │ │ │ +00129310: 6570 6c79 546f 203c 2f73 7061 6e3e 3c2f eplyTo .
    //g │ │ │ │ +00129350: 736f 6170 206e 7320 7365 7276 6963 6520 soap ns service │ │ │ │ +00129360: 6d65 7468 6f64 2d6f 7574 7075 742d 6865 method-output-he │ │ │ │ +00129370: 6164 6572 2d70 6172 743a 2020 2065 6368 ader-part: ech │ │ │ │ +00129380: 6f53 7472 696e 6720 7773 615f 5f52 656c oString wsa__Rel │ │ │ │ +00129390: 6174 6573 546f 203c 2f73 7061 6e3e 3c2f atesTo .
    int ns__ │ │ │ │ +001293e0: 6563 686f 5374 7269 6e67 283c 7370 616e echoString(char │ │ │ │ +00129410: 202a 7374 722c 203c 7370 616e 2063 6c61 *str, char **r │ │ │ │ +00129440: 6573 293b 3c2f 6469 763e 0a3c 2f64 6976 es);
    .

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

    .< │ │ │ │ +0012a280: 6833 3e3c 6120 636c 6173 733d 2261 6e63 h3>.Client- │ │ │ │ +0012a2b0: 7369 6465 206f 6e65 2d77 6179 2055 4450 side one-way UDP │ │ │ │ +0012a2c0: 206d 756c 7469 6361 7374 3c2f 6833 3e0a multicast

    . │ │ │ │ +0012a2d0: 3c70 3e54 6869 7320 6578 616d 706c 6520

    This example │ │ │ │ +0012a2e0: 6973 2073 696d 696c 6172 2074 6f20 7468 is similar to th │ │ │ │ +0012a2f0: 6520 6f6e 652d 7761 7920 756e 6963 6173 e one-way unicas │ │ │ │ +0012a300: 7420 6578 616d 706c 6520 6469 7363 7573 t example discus │ │ │ │ +0012a310: 7365 6420 6162 6f76 652c 2062 7574 2075 sed above, but u │ │ │ │ +0012a320: 7365 7320 6120 6272 6f61 6463 6173 7420 ses a broadcast │ │ │ │ +0012a330: 6164 6472 6573 7320 616e 6420 7468 6520 address and the │ │ │ │ +0012a340: 3c63 6f64 653e 534f 5f42 524f 4144 4341 SO_BROADCA │ │ │ │ +0012a350: 5354 3c2f 636f 6465 3e20 736f 636b 6574 ST socket │ │ │ │ +0012a360: 206f 7074 696f 6e3a 3c2f 703e 0a3c 6469 option:

    .
    │ │ │ │ +0012a3b0: 2369 6e63 6c75 6465 2026 7175 6f74 3b70 #include "p │ │ │ │ +0012a3c0: 6c75 6769 6e2f 7773 6161 7069 2e68 2671 lugin/wsaapi.h&q │ │ │ │ +0012a3d0: 756f 743b 3c2f 7370 616e 3e3c 2f64 6976 uot;
    .
    .
    struct soap soap;
    .
    in_a │ │ │ │ +0012a4b0: 6464 725f 7420 6164 6472 203d 2069 6e65 ddr_t addr = ine │ │ │ │ +0012a4c0: 745f 6164 6472 283c 7370 616e 2063 6c61 t_addr("1.2.3.4 │ │ │ │ +0012a4f0: 2671 756f 743b 3c2f 7370 616e 3e29 3b20 "); │ │ │ │ +0012a500: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // optiona │ │ │ │ +0012a520: 6c20 3c2f 7370 616e 3e3c 2f64 6976 3e0a l
    . │ │ │ │ +0012a530: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    soap_init │ │ │ │ +0012a5a0: 3c2f 613e 2826 616d 703b 3c61 2063 6c61 (&soap); ..
    soap.send_timeout │ │ │ │ +0012a740: 3c2f 613e 203d 2035 3b20 3c73 7061 6e20 = 5; │ │ │ │ +0012a760: 2f2f 2035 2073 6563 6f6e 6473 206d 6178 // 5 seconds max │ │ │ │ +0012a770: 2073 6f63 6b65 7420 6465 6c61 793c 2f73 socket delay
    .
    soap.connect_fl │ │ │ │ +0012a820: 6167 733c 2f61 3e20 3d20 534f 5f42 524f ags = SO_BRO │ │ │ │ +0012a830: 4144 4341 5354 3b20 3c73 7061 6e20 636c ADCAST; // │ │ │ │ +0012a850: 2072 6571 7569 7265 6420 666f 7220 6272 required for br │ │ │ │ +0012a860: 6f61 6463 6173 7420 3c2f 7370 616e 3e3c oadcast < │ │ │ │ +0012a870: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    s │ │ │ │ +0012a8b0: 6f61 703c 2f61 3e2e 3c61 2063 6c61 7373 oap.ipv4_multicast_ │ │ │ │ +0012a910: 6966 3c2f 613e 203d 2026 616d 703b 6164 if = &ad │ │ │ │ +0012a920: 6472 3b20 3c73 7061 6e20 636c 6173 733d dr; // opt │ │ │ │ +0012a940: 696f 6e61 6c20 666f 7220 4950 7634 3a20 ional for IPv4: │ │ │ │ +0012a950: 7365 6520 7365 7473 6f63 6b6f 7074 2049 see setsockopt I │ │ │ │ +0012a960: 5050 524f 544f 5f49 5020 4950 5f4d 554c PPROTO_IP IP_MUL │ │ │ │ +0012a970: 5449 4341 5354 5f49 4620 3c2f 7370 616e TICAST_IF
    .
    soap.ipv6_multicas │ │ │ │ +0012aa20: 745f 6966 3c2f 613e 203d 2061 6464 723b t_if = addr; │ │ │ │ +0012aa30: 203c 7370 616e 2063 6c61 7373 3d22 636f // option │ │ │ │ +0012aa50: 616c 2066 6f72 2049 5076 363a 206d 756c al for IPv6: mul │ │ │ │ +0012aa60: 7469 6361 7374 2073 696e 365f 7363 6f70 ticast sin6_scop │ │ │ │ +0012aa70: 655f 6964 203c 2f73 7061 6e3e 3c2f 6469 e_id .
    soap │ │ │ │ +0012aac0: 3c2f 613e 2e3c 6120 636c 6173 733d 2263 .ip │ │ │ │ +0012ab10: 7634 5f6d 756c 7469 6361 7374 5f74 746c v4_multicast_ttl │ │ │ │ +0012ab20: 3c2f 613e 203d 2031 3b20 3c73 7061 6e20 = 1; │ │ │ │ +0012ab40: 2f2f 206f 7074 696f 6e61 6c2c 2073 6565 // optional, see │ │ │ │ +0012ab50: 2073 6574 736f 636b 6f70 7420 4950 5052 setsockopt IPPR │ │ │ │ +0012ab60: 4f54 4f5f 4950 2c20 4950 5f4d 554c 5449 OTO_IP, IP_MULTI │ │ │ │ +0012ab70: 4341 5354 5f54 544c 203c 2f73 7061 6e3e CAST_TTL │ │ │ │ +0012ab80: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    / │ │ │ │ +0012abb0: 2f20 7365 7420 7570 2057 532d 4164 6472 / set up WS-Addr │ │ │ │ +0012abc0: 6573 7369 6e67 2068 6561 6465 723c 2f73 essing header
    ..
    // Send the m │ │ │ │ +0012ad20: 6573 7361 6765 206f 7665 7220 5544 5020 essage over UDP │ │ │ │ +0012ad30: 746f 2061 2062 726f 6164 6361 7374 2061 to a broadcast a │ │ │ │ +0012ad40: 6464 7265 7373 3a20 3c2f 7370 616e 3e3c ddress: < │ │ │ │ +0012ad50: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    if (soa │ │ │ │ +0012ad90: 705f 7365 6e64 5f6e 735f 5f65 6368 6f53 p_send_ns__echoS │ │ │ │ +0012ada0: 7472 696e 6728 2661 6d70 3b3c 6120 636c tring(&soap, "so │ │ │ │ +0012ae00: 6170 2e75 6470 3a2f 2f65 6e64 706f 696e ap.udp://endpoin │ │ │ │ +0012ae10: 7426 7175 6f74 3b3c 2f73 7061 6e3e 2c20 t", │ │ │ │ +0012ae20: 3c73 7061 6e20 636c 6173 733d 2273 7472 &quo │ │ │ │ +0012ae40: 743b 534f 4150 2061 6374 696f 6e26 7175 t;SOAP action&qu │ │ │ │ +0012ae50: 6f74 3b3c 2f73 7061 6e3e 2c20 3c73 7061 ot;, "he │ │ │ │ +0012ae80: 6c6c 6f20 776f 726c 6421 2671 756f 743b llo world!" │ │ │ │ +0012ae90: 3c2f 7370 616e 3e29 2920 3c2f 6469 763e ))
    │ │ │ │ +0012aea0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    soap_pri │ │ │ │ +0012af10: 6e74 5f66 6175 6c74 3c2f 613e 2826 616d nt_fault(&am │ │ │ │ +0012af20: 703b 3c61 2063 6c61 7373 3d22 636f 6465 p;soap, stderr); // report erro │ │ │ │ +0012af80: 7220 3c2f 7370 616e 3e3c 2f64 6976 3e0a r
    . │ │ │ │ +0012af90: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    soap_dest │ │ │ │ +0012b000: 726f 793c 2f61 3e28 2661 6d70 3b3c 6120 roy(&soap);.
    soap │ │ │ │ +0012b0b0: 5f65 6e64 3c2f 613e 2826 616d 703b 3c61 _end(&soap);< │ │ │ │ +0012b0f0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    soa │ │ │ │ +0012b160: 705f 646f 6e65 3c2f 613e 2826 616d 703b p_done(& │ │ │ │ +0012b170: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap) │ │ │ │ +0012b1a0: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
    .
    soap::ipv6_mult │ │ │ │ +0012b250: 6963 6173 745f 6966 3c2f 613e 3c2f 6469 icast_if
    unsigned i │ │ │ │ +0012b280: 6e74 2069 7076 365f 6d75 6c74 6963 6173 nt ipv6_multicas │ │ │ │ +0012b290: 745f 6966 3c2f 6469 763e 3c64 6976 2063 t_if
    Use │ │ │ │ +0012b2b0: 722d 6465 6669 6e61 626c 6520 7661 6c75 r-definable valu │ │ │ │ +0012b2c0: 6520 746f 2073 6574 2073 6f63 6b61 6464 e to set sockadd │ │ │ │ +0012b2d0: 725f 696e 363a 3a73 696e 365f 7363 6f70 r_in6::sin6_scop │ │ │ │ +0012b2e0: 655f 6964 2077 6865 6e20 6e6f 6e7a 6572 e_id when nonzer │ │ │ │ +0012b2f0: 6f2e 3c2f 6469 763e 3c64 6976 2063 6c61 o.
    De │ │ │ │ +0012b310: 6669 6e69 7469 6f6e 3a3c 2f62 3e20 7374 finition: st │ │ │ │ +0012b320: 6473 6f61 7032 2e68 3a33 3539 323c 2f64 dsoap2.h:3592
    .
    │ │ │ │ +0012b3f0: 3c64 6976 2063 6c61 7373 3d22 7474 6465
    int connect_ │ │ │ │ +0012b410: 666c 6167 733c 2f64 6976 3e3c 6469 7620 flags
    Us │ │ │ │ +0012b430: 6572 2d64 6566 696e 6162 6c65 2073 6574 er-definable set │ │ │ │ +0012b440: 736f 636b 6f70 7420 6c65 7665 6c20 534f sockopt level SO │ │ │ │ +0012b450: 4c5f 534f 434b 4554 2066 6c61 6773 2077 L_SOCKET flags w │ │ │ │ +0012b460: 6865 6e20 636f 6e6e 6563 7469 6e67 2073 hen connecting s │ │ │ │ +0012b470: 6f61 703a 3a73 6f63 6b65 7420 746f 2061 oap::socket to a │ │ │ │ +0012b480: 2073 6572 7665 7220 2874 6865 2076 616c server (the val │ │ │ │ +0012b490: 7565 202e 2e2e 3c2f 6469 763e 3c64 6976 ue ...
    < │ │ │ │ +0012b4b0: 623e 4465 6669 6e69 7469 6f6e 3a3c 2f62 b>Definition: stdsoap2.h:337 │ │ │ │ +0012b4d0: 373c 2f64 6976 3e3c 2f64 6976 3e0a 3c64 7
    .
    uns │ │ │ │ +0012b5b0: 6967 6e65 6420 6368 6172 2069 7076 345f igned char ipv4_ │ │ │ │ +0012b5c0: 6d75 6c74 6963 6173 745f 7474 6c3c 2f64 multicast_ttl
    User-defin │ │ │ │ +0012b5f0: 6162 6c65 2076 616c 7565 2074 6f20 7365 able value to se │ │ │ │ +0012b600: 7420 7365 7473 6f63 6b6f 7074 206c 6576 t setsockopt lev │ │ │ │ +0012b610: 656c 2049 5050 524f 544f 5f49 5020 746f el IPPROTO_IP to │ │ │ │ +0012b620: 2049 505f 4d55 4c54 4943 4153 545f 5454 IP_MULTICAST_TT │ │ │ │ +0012b630: 4c20 7768 656e 206e 6f6e 7a65 726f 2e3c L when nonzero.< │ │ │ │ +0012b640: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
    Defin │ │ │ │ +0012b660: 6974 696f 6e3a 3c2f 623e 2073 7464 736f ition: stdso │ │ │ │ +0012b670: 6170 322e 683a 3336 3230 3c2f 6469 763e ap2.h:3620
    │ │ │ │ +0012b680: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    │ │ │ │ +0012b6d0: 3c64 6976 2063 6c61 7373 3d22 7474 6e61
    char * ipv4 │ │ │ │ +0012b760: 5f6d 756c 7469 6361 7374 5f69 663c 2f64 _multicast_if
    User-defin │ │ │ │ +0012b790: 6162 6c65 2076 616c 7565 2074 6f20 7365 able value to se │ │ │ │ +0012b7a0: 7420 7365 7473 6f63 6b6f 7074 206c 6576 t setsockopt lev │ │ │ │ +0012b7b0: 656c 2049 5050 524f 544f 5f49 5020 746f el IPPROTO_IP to │ │ │ │ +0012b7c0: 2049 505f 4d55 4c54 4943 4153 545f 4946 IP_MULTICAST_IF │ │ │ │ +0012b7d0: 2077 6865 6e20 6e6f 6e2d 4e55 4c4c 2e3c when non-NULL.< │ │ │ │ +0012b7e0: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
    Defin │ │ │ │ +0012b800: 6974 696f 6e3a 3c2f 623e 2073 7464 736f ition: stdso │ │ │ │ +0012b810: 6170 322e 683a 3335 3939 3c2f 6469 763e ap2.h:3599
    │ │ │ │ +0012b820: 3c2f 6469 763e 0a3c 2f64 6976 3e3c 212d
    .

    Please refer to │ │ │ │ +0012b850: 2074 6865 2073 6f63 6b65 7420 6f70 7469 the socket opti │ │ │ │ +0012b860: 6f6e 7320 666f 7220 3c63 6f64 653e 4950 ons for IP │ │ │ │ +0012b870: 5052 4f54 4f5f 4950 3c2f 636f 6465 3e20 PROTO_IP │ │ │ │ +0012b880: 3c63 6f64 653e 4950 5f4d 554c 5449 4341 IP_MULTICA │ │ │ │ +0012b890: 5354 5f49 463c 2f63 6f64 653e 2074 6f20 ST_IF to │ │ │ │ +0012b8a0: 7370 6563 6966 7920 7468 6520 6465 6661 specify the defa │ │ │ │ +0012b8b0: 756c 7420 696e 7465 7266 6163 6520 666f ult interface fo │ │ │ │ +0012b8c0: 7220 6d75 6c74 6963 6173 7420 6461 7461 r multicast data │ │ │ │ +0012b8d0: 6772 616d 7320 746f 2062 6520 7365 6e74 grams to be sent │ │ │ │ +0012b8e0: 2066 726f 6d2e 2054 6869 7320 6973 2061 from. This is a │ │ │ │ +0012b8f0: 203c 636f 6465 3e73 7472 7563 7420 696e struct in │ │ │ │ +0012b900: 5f61 6464 723c 2f63 6f64 653e 2028 3c63 _addr (in_addr_t for s │ │ │ │ +0012b930: 696e 365f 7363 6f70 655f 6964 3c2f 636f in6_scope_id) interface v │ │ │ │ +0012b950: 616c 7565 2e20 4f74 6865 7277 6973 652c alue. Otherwise, │ │ │ │ +0012b960: 2074 6865 2064 6566 6175 6c74 2069 6e74 the default int │ │ │ │ +0012b970: 6572 6661 6365 2073 6574 2062 7920 7468 erface set by th │ │ │ │ +0012b980: 6520 7379 7374 656d 2061 646d 696e 6973 e system adminis │ │ │ │ +0012b990: 7472 6174 6f72 2077 696c 6c20 6265 2075 trator will be u │ │ │ │ +0012b9a0: 7365 6420 2869 6620 616e 7929 2e3c 2f70 sed (if any).

    .

    Please refe │ │ │ │ +0012b9c0: 7220 746f 2074 6865 2073 6f63 6b65 7420 r to the socket │ │ │ │ +0012b9d0: 6f70 7469 6f6e 7320 666f 7220 3c63 6f64 options for IPPROTO_IP IP_MUL │ │ │ │ +0012ba00: 5449 4341 5354 5f54 544c 3c2f 636f 6465 TICAST_TTL to limit the l │ │ │ │ +0012ba20: 6966 6574 696d 6520 6f66 2074 6865 2070 ifetime of the p │ │ │ │ +0012ba30: 6163 6b65 742e 204d 756c 7469 6361 7374 acket. Multicast │ │ │ │ +0012ba40: 2064 6174 6167 7261 6d73 2061 7265 2073 datagrams are s │ │ │ │ +0012ba50: 656e 7420 7769 7468 2061 2064 6566 6175 ent with a defau │ │ │ │ +0012ba60: 6c74 2076 616c 7565 206f 6620 312c 2074 lt value of 1, t │ │ │ │ +0012ba70: 6f20 7072 6576 656e 7420 7468 656d 2074 o prevent them t │ │ │ │ +0012ba80: 6f20 6265 2066 6f72 7761 7264 6564 2062 o be forwarded b │ │ │ │ +0012ba90: 6579 6f6e 6420 7468 6520 6c6f 6361 6c20 eyond the local │ │ │ │ +0012baa0: 6e65 7477 6f72 6b2e 2054 6869 7320 7061 network. This pa │ │ │ │ +0012bab0: 7261 6d65 7465 7220 6361 6e20 6265 2073 rameter can be s │ │ │ │ +0012bac0: 6574 2062 6574 7765 656e 2031 2074 6f20 et between 1 to │ │ │ │ +0012bad0: 3235 352e 3c2f 703e 0a3c 703e f09f 949d 255.

    .

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

    .< │ │ │ │ +0012bb10: 6833 3e3c 6120 636c 6173 733d 2261 6e63 h3>.Client-sid │ │ │ │ +0012bb50: 6520 7265 7175 6573 742d 7265 7370 6f6e e request-respon │ │ │ │ +0012bb60: 7365 2055 4450 2075 6e69 6361 7374 3c2f se UDP unicast.

    This exam │ │ │ │ +0012bb80: 706c 6520 6173 7375 6d65 7320 7468 6174 ple assumes that │ │ │ │ +0012bb90: 2074 6865 2069 6e74 6572 6661 6365 2068 the interface h │ │ │ │ +0012bba0: 6561 6465 7220 6669 6c65 2066 6f72 2073 eader file for s │ │ │ │ +0012bbb0: 6f61 7063 7070 3220 696e 636c 7564 6573 oapcpp2 includes │ │ │ │ +0012bbc0: 2074 6865 2053 4f41 5020 4865 6164 6572 the SOAP Header │ │ │ │ +0012bbd0: 2077 6974 6820 5753 2d41 6464 7265 7373 with WS-Address │ │ │ │ +0012bbe0: 696e 6720 656c 656d 656e 7473 2069 6d70 ing elements imp │ │ │ │ +0012bbf0: 6f72 7465 6420 7769 7468 203c 636f 6465 orted with #import "wsa.h" │ │ │ │ +0012bc10: 3c2f 636f 6465 3e20 616e 6420 7468 6520 and the │ │ │ │ +0012bc20: 3c63 6f64 653e 6e73 5f5f 6563 686f 5374 ns__echoSt │ │ │ │ +0012bc30: 7269 6e67 3c2f 636f 6465 3e20 6675 6e63 ring func │ │ │ │ +0012bc40: 7469 6f6e 2064 6973 6375 7373 6564 2069 tion discussed i │ │ │ │ +0012bc50: 6e20 5365 6374 696f 6e20 3c61 2063 6c61 n Section Using WS-Addres │ │ │ │ +0012bc90: 7369 6e67 2077 6974 6820 534f 4150 2d6f sing with SOAP-o │ │ │ │ +0012bca0: 7665 722d 5544 503c 2f61 3e20 2e3c 2f70 ver-UDP .

    .
    #include &q │ │ │ │ +0012bd00: 756f 743b 706c 7567 696e 2f77 7361 6170 uot;plugin/wsaap │ │ │ │ +0012bd10: 692e 6826 7175 6f74 3b3c 2f73 7061 6e3e i.h" │ │ │ │ +0012bd20: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    │ │ │ │ +0012bd40: 0a3c 6469 7620 636c 6173 733d 226c 696e ..< │ │ │ │ +0012bde0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +0012bdf0: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >struct wsa__Endpoi │ │ │ │ +0012be20: 6e74 5265 6665 7265 6e63 6554 7970 6520 ntReferenceType │ │ │ │ +0012be30: 7265 706c 7954 6f3b 203c 7370 616e 2063 replyTo; / │ │ │ │ +0012be50: 2f20 2861 6e6f 6e79 6d6f 7573 2920 7265 / (anonymous) re │ │ │ │ +0012be60: 706c 7920 6164 6472 6573 7320 3c2f 7370 ply address
    .
    char *res; // │ │ │ │ +0012bed0: 2073 6572 7665 7220 7265 7370 6f6e 7365 server response │ │ │ │ +0012bee0: 203c 2f73 7061 6e3e 3c2f 6469 763e 0a3c
    .< │ │ │ │ +0012bef0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +0012bf00: 3e3c 6120 636c 6173 733d 2263 6f64 6522 >soap_init< │ │ │ │ +0012bf60: 2f61 3e28 2661 6d70 3b3c 6120 636c 6173 /a>(& │ │ │ │ +0012bf90: 736f 6170 3c2f 613e 293b 203c 2f64 6976 soap);
    .
    soap_reg │ │ │ │ +0012c010: 6973 7465 725f 706c 7567 696e 3c2f 613e ister_plugin │ │ │ │ +0012c020: 2826 616d 703b 3c61 2063 6c61 7373 3d22 (&soa │ │ │ │ +0012c050: 703c 2f61 3e2c 2073 6f61 705f 7773 6129 p, soap_wsa) │ │ │ │ +0012c060: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
    ..
    soap.recv_timeo │ │ │ │ +0012c1e0: 7574 3c2f 613e 203d 2035 3b20 3c73 7061 ut = 5; // 5 seconds m │ │ │ │ +0012c210: 6178 2073 6f63 6b65 7420 6465 6c61 7920 ax socket delay │ │ │ │ +0012c220: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ │ +0012c240: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // set up │ │ │ │ +0012c260: 5753 2d41 6464 7265 7373 696e 6720 6865 WS-Addressing he │ │ │ │ +0012c270: 6164 6572 3c2f 7370 616e 3e3c 2f64 6976 ader
    .
    soap_wsa_req │ │ │ │ +0012c2a0: 7565 7374 2826 616d 703b 3c61 2063 6c61 uest(&soap, "mes │ │ │ │ +0012c300: 7361 6765 2049 4426 7175 6f74 3b3c 2f73 sage ID", "endpoint │ │ │ │ +0012c340: 2671 756f 743b 3c2f 7370 616e 3e2c 203c ", < │ │ │ │ +0012c350: 7370 616e 2063 6c61 7373 3d22 7374 7269 span class="stri │ │ │ │ +0012c360: 6e67 6c69 7465 7261 6c22 3e26 7175 6f74 ngliteral">" │ │ │ │ +0012c370: 3b53 4f41 5020 6163 7469 6f6e 2671 756f ;SOAP action&quo │ │ │ │ +0012c380: 743b 3c2f 7370 616e 3e29 3b3c 2f64 6976 t;);
    .
    soap_wsa_add │ │ │ │ +0012c3b0: 5f52 6570 6c79 546f 2826 616d 703b 3c61 _ReplyTo(&soap, N │ │ │ │ +0012c3f0: 554c 4c29 3b20 3c73 7061 6e20 636c 6173 ULL); // a │ │ │ │ +0012c410: 6e6f 6e79 6d6f 7573 2052 6570 6c79 546f nonymous ReplyTo │ │ │ │ +0012c420: 2061 6464 7265 7373 3c2f 7370 616e 3e3c address< │ │ │ │ +0012c430: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    // │ │ │ │ +0012c460: 2053 656e 6420 616e 6420 7265 6365 6976 Send and receiv │ │ │ │ +0012c470: 6520 6d65 7373 6167 6573 206f 7665 7220 e messages over │ │ │ │ +0012c480: 5544 503a 203c 2f73 7061 6e3e 3c2f 6469 UDP: .
    i │ │ │ │ +0012c4c0: 663c 2f73 7061 6e3e 2028 736f 6170 5f63 f (soap_c │ │ │ │ +0012c4d0: 616c 6c5f 6e73 5f5f 6563 686f 5374 7269 all_ns__echoStri │ │ │ │ +0012c4e0: 6e67 2826 616d 703b 3c61 2063 6c61 7373 ng(&s │ │ │ │ +0012c510: 6f61 703c 2f61 3e2c 203c 7370 616e 2063 oap, "soap. │ │ │ │ +0012c540: 7564 703a 2f2f 656e 6470 6f69 6e74 2026 udp://endpoint & │ │ │ │ +0012c550: 7175 6f74 3b3c 2f73 7061 6e3e 534f 4150 quot;SOAP │ │ │ │ +0012c560: 2061 6374 696f 6e3c 7370 616e 2063 6c61 action", " │ │ │ │ +0012c590: 3b3c 2f73 7061 6e3e 6865 6c6c 6f20 776f ;hello wo │ │ │ │ +0012c5a0: 726c 6421 3c73 7061 6e20 636c 6173 733d rld! │ │ │ │ +0012c5c0: 2671 756f 743b 2c20 2661 6d70 3b72 6573 ", &res │ │ │ │ +0012c5d0: 2929 203c 2f73 7061 6e3e 3c2f 6469 763e ))
    │ │ │ │ +0012c5e0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    { │ │ │ │ +0012c610: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ │ +0012c630: 3c73 7061 6e20 636c 6173 733d 2273 7472 if │ │ │ │ +0012c650: 2028 736f 6170 2e65 7272 6f72 203d 3d20 (soap.error == │ │ │ │ +0012c660: 534f 4150 5f45 4f46 2026 616d 703b 2661 SOAP_EOF &&a │ │ │ │ +0012c670: 6d70 3b20 736f 6170 2e65 7272 6e75 6d20 mp; soap.errnum │ │ │ │ +0012c680: 3d3d 2030 2920 3c2f 7370 616e 3e3c 2f64 == 0) .
    ... // Tim │ │ │ │ +0012c6d0: 656f 7574 3a20 6e6f 2072 6573 706f 6e73 eout: no respons │ │ │ │ +0012c6e0: 6520 6672 6f6d 2073 6572 7665 7220 286d e from server (m │ │ │ │ +0012c6f0: 6573 7361 6765 2061 6c72 6561 6479 2064 essage already d │ │ │ │ +0012c700: 656c 6976 6572 6564 3f29 203c 2f73 7061 elivered?)
    .
    else
    .
    so │ │ │ │ +0012c790: 6170 5f70 7269 6e74 5f66 6175 6c74 2826 ap_print_fault(& │ │ │ │ +0012c7a0: 616d 703b 736f 6170 2c20 7374 6465 7272 amp;soap, stderr │ │ │ │ +0012c7b0: 293b 203c 2f73 7061 6e3e 3c2f 6469 763e );
    │ │ │ │ +0012c7c0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    } │ │ │ │ +0012c7f0: 203c 2f73 7061 6e3e 3c2f 6469 763e 0a3c
    .< │ │ │ │ +0012c800: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +0012c810: 3e3c 7370 616e 2063 6c61 7373 3d22 7374 >els │ │ │ │ +0012c830: 6520 3c2f 7370 616e 3e3c 2f64 6976 3e0a e
    . │ │ │ │ +0012c840: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    │ │ │ │ +0012c870: 2e2e 2e20 2f2f 2055 4450 2073 6572 7665 ... // UDP serve │ │ │ │ +0012c880: 7220 7265 7370 6f6e 7365 2069 7320 7374 r response is st │ │ │ │ +0012c890: 6f72 6564 2069 6e20 2623 3339 3b72 6573 ored in 'res │ │ │ │ +0012c8a0: 2623 3339 3b20 3c2f 7370 616e 3e3c 2f64 ' .
    // check SOAP │ │ │ │ +0012c8f0: 6865 6164 6572 2072 6563 6569 7665 642c header received, │ │ │ │ +0012c900: 2069 6620 6170 706c 6963 6162 6c65 203c if applicable < │ │ │ │ +0012c910: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    .< │ │ │ │ +0012c930: 7370 616e 2063 6c61 7373 3d22 7374 7269 span class="stri │ │ │ │ +0012c940: 6e67 6c69 7465 7261 6c22 3e63 6865 636b ngliteral">check │ │ │ │ +0012c950: 5f68 6561 6465 7228 2661 6d70 3b73 6f61 _header(&soa │ │ │ │ +0012c960: 702e 6865 6164 6572 293b 203c 2f73 7061 p.header);
    .
    soap_dest │ │ │ │ +0012c9b0: 726f 7928 2661 6d70 3b73 6f61 7029 3b3c roy(&soap);< │ │ │ │ +0012c9c0: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    .< │ │ │ │ +0012c9e0: 7370 616e 2063 6c61 7373 3d22 7374 7269 span class="stri │ │ │ │ +0012c9f0: 6e67 6c69 7465 7261 6c22 3e73 6f61 705f ngliteral">soap_ │ │ │ │ +0012ca00: 656e 6428 2661 6d70 3b73 6f61 7029 3b3c end(&soap);< │ │ │ │ +0012ca10: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    .< │ │ │ │ +0012ca30: 7370 616e 2063 6c61 7373 3d22 7374 7269 span class="stri │ │ │ │ +0012ca40: 6e67 6c69 7465 7261 6c22 3e73 6f61 705f ngliteral">soap_ │ │ │ │ +0012ca50: 646f 6e65 2826 616d 703b 736f 6170 293b done(&soap); │ │ │ │ +0012ca60: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c2f
    .

    .... Back to │ │ │ │ +0012caa0: 2074 6162 6c65 206f 6620 636f 6e74 656e table of conten │ │ │ │ +0012cab0: 7473 3c2f 613e 3c2f 703e 0a3c 6833 3e3c ts

    .

    < │ │ │ │ +0012cac0: 6120 636c 6173 733d 2261 6e63 686f 7222 a class="anchor" │ │ │ │ +0012cad0: 2069 643d 2272 6571 7565 7374 7265 7370 id="requestresp │ │ │ │ +0012cae0: 6f6e 7365 6d75 6c74 6963 6173 7422 3e3c onsemulticast">< │ │ │ │ +0012caf0: 2f61 3e0a 436c 6965 6e74 2d73 6964 6520 /a>.Client-side │ │ │ │ +0012cb00: 7265 7175 6573 742d 7265 7370 6f6e 7365 request-response │ │ │ │ +0012cb10: 206d 756c 7469 6361 7374 3c2f 6833 3e0a multicast

    . │ │ │ │ +0012cb20: 3c70 3e54 6869 7320 6578 616d 706c 6520

    This example │ │ │ │ +0012cb30: 6973 2073 696d 696c 6172 2074 6f20 7468 is similar to th │ │ │ │ +0012cb40: 6520 7265 7175 6573 742d 7265 7370 6f6e e request-respon │ │ │ │ +0012cb50: 7365 2075 6e69 6361 7374 2065 7861 6d70 se unicast examp │ │ │ │ +0012cb60: 6c65 2064 6973 6375 7373 6564 2061 626f le discussed abo │ │ │ │ +0012cb70: 7665 2c20 6275 7420 7573 6573 2061 2062 ve, but uses a b │ │ │ │ +0012cb80: 726f 6164 6361 7374 2061 6464 7265 7373 roadcast address │ │ │ │ +0012cb90: 2061 6e64 2074 6865 203c 636f 6465 3e53 and the S │ │ │ │ +0012cba0: 4f5f 4252 4f41 4443 4153 543c 2f63 6f64 O_BROADCAST socket option │ │ │ │ +0012cbc0: 2e20 4265 6361 7573 6520 7765 2065 7870 . Because we exp │ │ │ │ +0012cbd0: 6563 7420 746f 2072 6563 6569 7665 206d ect to receive m │ │ │ │ +0012cbe0: 756c 7469 706c 6520 7265 7370 6f6e 7365 ultiple response │ │ │ │ +0012cbf0: 732c 2077 6520 616c 736f 206e 6565 6420 s, we also need │ │ │ │ +0012cc00: 746f 2075 7365 2073 6570 6172 6174 6520 to use separate │ │ │ │ +0012cc10: 7265 7175 6573 742d 7265 7370 6f6e 7365 request-response │ │ │ │ +0012cc20: 206d 6573 7361 6765 7320 746f 2073 656e messages to sen │ │ │ │ +0012cc30: 6420 6f6e 6520 7265 7175 6573 7420 616e d one request an │ │ │ │ +0012cc40: 6420 636f 6e73 756d 6520 6d75 6c74 6970 d consume multip │ │ │ │ +0012cc50: 6c65 2072 6573 706f 6e73 6573 2e20 496e le responses. In │ │ │ │ +0012cc60: 2074 6869 7320 6578 616d 706c 6520 7765 this example we │ │ │ │ +0012cc70: 2064 6566 696e 6564 2061 203c 636f 6465 defined a bcastString request and │ │ │ │ +0012cca0: 6120 3c63 6f64 653e 6263 6173 7453 7472 a bcastStr │ │ │ │ +0012ccb0: 696e 6752 6573 706f 6e73 653c 2f63 6f64 ingResponse response mess │ │ │ │ +0012ccd0: 6167 652c 2077 6869 6368 2061 7265 2065 age, which are e │ │ │ │ +0012cce0: 7373 656e 7469 616c 6c79 2064 6563 6c61 ssentially decla │ │ │ │ +0012ccf0: 7265 6420 6173 206f 6e65 2d77 6179 206d red as one-way m │ │ │ │ +0012cd00: 6573 7361 6765 7320 696e 2074 6865 2068 essages in the h │ │ │ │ +0012cd10: 6561 6465 7220 6669 6c65 3a3c 2f70 3e0a eader file:

    . │ │ │ │ +0012cd20: 3c64 6976 2063 6c61 7373 3d22 6672 6167
    // │ │ │ │ +0012cd60: 6773 6f61 7020 6e73 2073 6572 7669 6365 gsoap ns service │ │ │ │ +0012cd70: 206d 6574 686f 642d 6865 6164 6572 2d70 method-header-p │ │ │ │ +0012cd80: 6172 743a 2020 2020 2020 2020 2020 6263 art: bc │ │ │ │ +0012cd90: 6173 7453 7472 696e 6720 7773 615f 5f4d astString wsa__M │ │ │ │ +0012cda0: 6573 7361 6765 4944 203c 2f73 7061 6e3e essageID │ │ │ │ +0012cdb0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    / │ │ │ │ +0012cde0: 2f67 736f 6170 206e 7320 7365 7276 6963 /gsoap ns servic │ │ │ │ +0012cdf0: 6520 6d65 7468 6f64 2d68 6561 6465 722d e method-header- │ │ │ │ +0012ce00: 7061 7274 3a20 2020 2020 2020 2020 2062 part: b │ │ │ │ +0012ce10: 6361 7374 5374 7269 6e67 2077 7361 5f5f castString wsa__ │ │ │ │ +0012ce20: 546f 203c 2f73 7061 6e3e 3c2f 6469 763e To
    │ │ │ │ +0012ce30: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    //gsoap │ │ │ │ +0012ce60: 206e 7320 7365 7276 6963 6520 6d65 7468 ns service meth │ │ │ │ +0012ce70: 6f64 2d68 6561 6465 722d 7061 7274 3a20 od-header-part: │ │ │ │ +0012ce80: 2020 2020 2020 2020 2062 6361 7374 5374 bcastSt │ │ │ │ +0012ce90: 7269 6e67 2077 7361 5f5f 4163 7469 6f6e ring wsa__Action │ │ │ │ +0012cea0: 203c 2f73 7061 6e3e 3c2f 6469 763e 0a3c
    .< │ │ │ │ +0012ceb0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +0012cec0: 3e3c 7370 616e 2063 6c61 7373 3d22 636f >//gsoap n │ │ │ │ +0012cee0: 7320 7365 7276 6963 6520 6d65 7468 6f64 s service method │ │ │ │ +0012cef0: 2d68 6561 6465 722d 7061 7274 3a20 2020 -header-part: │ │ │ │ +0012cf00: 2020 2020 2020 2062 6361 7374 5374 7269 bcastStri │ │ │ │ +0012cf10: 6e67 2077 7361 5f5f 5265 706c 7954 6f20 ng wsa__ReplyTo │ │ │ │ +0012cf20: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ │ +0012cf40: 3c73 7061 6e20 636c 6173 733d 226b 6579 int
    ns__bcastSt │ │ │ │ +0012cf70: 7269 6e67 283c 7370 616e 2063 6c61 7373 ring(c │ │ │ │ +0012cf90: 6861 723c 2f73 7061 6e3e 202a 7374 722c har *str, │ │ │ │ +0012cfa0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 void< │ │ │ │ +0012cfc0: 2f73 7061 6e3e 293b 203c 2f64 6976 3e0a /span>);
    . │ │ │ │ +0012cfd0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    //gsoap │ │ │ │ +0012d000: 6e73 2073 6572 7669 6365 206d 6574 686f ns service metho │ │ │ │ +0012d010: 642d 6865 6164 6572 2d70 6172 743a 2020 d-header-part: │ │ │ │ +0012d020: 2020 2020 2020 2020 6263 6173 7453 7472 bcastStr │ │ │ │ +0012d030: 696e 6752 6573 706f 6e73 6520 7773 615f ingResponse wsa_ │ │ │ │ +0012d040: 5f4d 6573 7361 6765 4944 203c 2f73 7061 _MessageID
    .
    //gsoap ns serv │ │ │ │ +0012d090: 6963 6520 6d65 7468 6f64 2d68 6561 6465 ice method-heade │ │ │ │ +0012d0a0: 722d 7061 7274 3a20 2020 2020 2020 2020 r-part: │ │ │ │ +0012d0b0: 2062 6361 7374 5374 7269 6e67 5265 7370 bcastStringResp │ │ │ │ +0012d0c0: 6f6e 7365 2077 7361 5f5f 546f 203c 2f73 onse wsa__To
    .
    //gsoap ns se │ │ │ │ +0012d110: 7276 6963 6520 6d65 7468 6f64 2d68 6561 rvice method-hea │ │ │ │ +0012d120: 6465 722d 7061 7274 3a20 2020 2020 2020 der-part: │ │ │ │ +0012d130: 2020 2062 6361 7374 5374 7269 6e67 5265 bcastStringRe │ │ │ │ +0012d140: 7370 6f6e 7365 2077 7361 5f5f 4163 7469 sponse wsa__Acti │ │ │ │ +0012d150: 6f6e 203c 2f73 7061 6e3e 3c2f 6469 763e on
    │ │ │ │ +0012d160: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    //gsoap │ │ │ │ +0012d190: 206e 7320 7365 7276 6963 6520 6d65 7468 ns service meth │ │ │ │ +0012d1a0: 6f64 2d68 6561 6465 722d 7061 7274 3a20 od-header-part: │ │ │ │ +0012d1b0: 2020 2020 2020 2020 2062 6361 7374 5374 bcastSt │ │ │ │ +0012d1c0: 7269 6e67 5265 7370 6f6e 7365 2077 7361 ringResponse wsa │ │ │ │ +0012d1d0: 5f5f 5265 6c61 7465 7354 6f20 3c2f 7370 __RelatesTo
    .
    int │ │ │ │ +0012d220: 206e 735f 5f62 6361 7374 5374 7269 6e67 ns__bcastString │ │ │ │ +0012d230: 5265 7370 6f6e 7365 283c 7370 616e 2063 Response(char * │ │ │ │ +0012d260: 7265 732c 203c 7370 616e 2063 6c61 7373 res, v │ │ │ │ +0012d280: 6f69 643c 2f73 7061 6e3e 293b 3c2f 6469 oid);.

    To │ │ │ │ +0012d2b0: 6f62 7461 696e 2072 6573 706f 6e73 6520 obtain response │ │ │ │ +0012d2c0: 6f6e 652d 7761 7920 6f70 6572 6174 696f one-way operatio │ │ │ │ +0012d2d0: 6e73 2c20 7573 6520 3c61 2068 7265 663d ns, use < │ │ │ │ +0012d2f0: 636f 6465 3e77 7364 6c32 6820 2d62 3c2f code>wsdl2h -b option │ │ │ │ +0012d310: 203c 623e 3c63 6f64 653e 2d62 3c2f 636f -b.

    │ │ │ │ +0012d330: 0a3c 703e 5468 6520 636c 6965 6e74 2063 .

    The client c │ │ │ │ +0012d340: 6f64 6520 696e 636c 7564 6573 2061 206c ode includes a l │ │ │ │ +0012d350: 6f6f 7020 746f 2072 6563 6569 7665 2072 oop to receive r │ │ │ │ +0012d360: 6573 706f 6e73 6520 6d65 7373 6167 6573 esponse messages │ │ │ │ +0012d370: 2075 6e74 696c 2061 2074 696d 656f 7574 until a timeout │ │ │ │ +0012d380: 206f 6363 7572 733a 3c2f 703e 0a3c 6469 occurs:

    .
    │ │ │ │ +0012d3d0: 2369 6e63 6c75 6465 2026 7175 6f74 3b70 #include "p │ │ │ │ +0012d3e0: 6c75 6769 6e2f 7773 6161 7069 2e68 2671 lugin/wsaapi.h&q │ │ │ │ +0012d3f0: 756f 743b 3c2f 7370 616e 3e3c 2f64 6976 uot;
    .
    .
    struct soap soap;
    .
    struct │ │ │ │ +0012d4f0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 SO │ │ │ │ +0012d530: 4150 5f45 4e56 5f5f 4865 6164 6572 3c2f AP_ENV__Header header;
    .
    struct │ │ │ │ +0012d580: 203c 2f73 7061 6e3e 7773 615f 5f45 6e64 wsa__End │ │ │ │ +0012d590: 706f 696e 7452 6566 6572 656e 6365 5479 pointReferenceTy │ │ │ │ +0012d5a0: 7065 2072 6570 6c79 546f 3b20 3c2f 6469 pe replyTo; .
    c │ │ │ │ +0012d5e0: 6861 723c 2f73 7061 6e3e 202a 7265 733b har *res; │ │ │ │ +0012d5f0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    s │ │ │ │ +0012d660: 6f61 705f 696e 6974 3c2f 613e 2826 616d oap_init(&am │ │ │ │ +0012d670: 703b 3c61 2063 6c61 7373 3d22 636f 6465 p;soap);
    .
    soap_register_p │ │ │ │ +0012d720: 6c75 6769 6e3c 2f61 3e28 2661 6d70 3b3c lugin(&< │ │ │ │ +0012d730: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +0012d740: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ +0012d750: 6874 6d6c 223e 736f 6170 3c2f 613e 2c20 html">soap, │ │ │ │ +0012d760: 736f 6170 5f77 7361 293b 3c2f 6469 763e soap_wsa);
    │ │ │ │ +0012d770: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    soap.conn │ │ │ │ +0012d800: 6563 745f 666c 6167 733c 2f61 3e20 3d20 ect_flags = │ │ │ │ +0012d810: 534f 5f42 524f 4144 4341 5354 3b20 3c2f SO_BROADCAST; .
    so │ │ │ │ +0012d860: 6170 3c2f 613e 2e3c 6120 636c 6173 733d ap. │ │ │ │ +0012d8b0: 7365 6e64 5f74 696d 656f 7574 3c2f 613e send_timeout │ │ │ │ +0012d8c0: 203d 2035 3b20 3c73 7061 6e20 636c 6173 = 5; // 5 │ │ │ │ +0012d8e0: 2073 6563 6f6e 6473 206d 6178 2073 6f63 seconds max soc │ │ │ │ +0012d8f0: 6b65 7420 6465 6c61 7920 3c2f 7370 616e ket delay
    .
    .
    // set up WS- │ │ │ │ +0012da20: 4164 6472 6573 7369 6e67 2068 6561 6465 Addressing heade │ │ │ │ +0012da30: 723c 2f73 7061 6e3e 3c2f 6469 763e 0a3c r
    .< │ │ │ │ +0012da40: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +0012da50: 3e73 6f61 705f 7773 615f 7265 7175 6573 >soap_wsa_reques │ │ │ │ +0012da60: 7428 2661 6d70 3b3c 6120 636c 6173 733d t(&
    so │ │ │ │ +0012da90: 6170 3c2f 613e 2c20 3c73 7061 6e20 636c ap, "messag │ │ │ │ +0012dac0: 6520 4944 2671 756f 743b 3c2f 7370 616e e ID", & │ │ │ │ +0012daf0: 7175 6f74 3b65 6e64 706f 696e 7426 7175 quot;endpoint&qu │ │ │ │ +0012db00: 6f74 3b3c 2f73 7061 6e3e 2c20 3c73 7061 ot;, "SO │ │ │ │ +0012db30: 4150 2061 6374 696f 6e26 7175 6f74 3b3c AP action"< │ │ │ │ +0012db40: 2f73 7061 6e3e 293b 3c2f 6469 763e 0a3c /span>);
    .< │ │ │ │ +0012db50: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +0012db60: 3e73 6f61 705f 7773 615f 6164 645f 5265 >soap_wsa_add_Re │ │ │ │ +0012db70: 706c 7954 6f28 2661 6d70 3b3c 6120 636c plyTo(&soap, NULL │ │ │ │ +0012dbb0: 293b 203c 7370 616e 2063 6c61 7373 3d22 ); // anon │ │ │ │ +0012dbd0: 796d 6f75 7320 5265 706c 7954 6f20 6164 ymous ReplyTo ad │ │ │ │ +0012dbe0: 6472 6573 733c 2f73 7061 6e3e 3c2f 6469 dress.
    i │ │ │ │ +0012dc20: 663c 2f73 7061 6e3e 2028 736f 6170 5f73 f (soap_s │ │ │ │ +0012dc30: 656e 645f 6e73 5f5f 6263 6173 7453 7472 end_ns__bcastStr │ │ │ │ +0012dc40: 696e 6728 2661 6d70 3b3c 6120 636c 6173 ing(& │ │ │ │ +0012dc70: 736f 6170 3c2f 613e 2c20 3c73 7061 6e20 soap, "soap │ │ │ │ +0012dca0: 2e75 6470 3a2f 2f65 6e64 706f 696e 7426 .udp://endpoint& │ │ │ │ +0012dcb0: 7175 6f74 3b3c 2f73 7061 6e3e 2c20 3c73 quot;, " │ │ │ │ +0012dce0: 534f 4150 2061 6374 696f 6e26 7175 6f74 SOAP action" │ │ │ │ +0012dcf0: 3b3c 2f73 7061 6e3e 2c20 3c73 7061 6e20 ;, "hell │ │ │ │ +0012dd20: 6f20 776f 726c 6421 2671 756f 743b 3c2f o world!"))
    .< │ │ │ │ +0012dd40: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +0012dd50: 3e7b 3c2f 6469 763e 0a3c 6469 7620 636c >{
    ..
    }.
    else .
    {
    . │ │ │ │ +0012dea0: 2020 3c73 7061 6e20 636c 6173 733d 226b whil │ │ │ │ +0012dec0: 653c 2f73 7061 6e3e 2028 3129 3c2f 6469 e (1).
    {
    .< │ │ │ │ +0012def0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +0012df00: 3e20 2020 203c 7370 616e 2063 6c61 7373 > i │ │ │ │ +0012df20: 663c 2f73 7061 6e3e 2028 736f 6170 5f72 f (soap_r │ │ │ │ +0012df30: 6563 765f 6e73 5f5f 6263 6173 7453 7472 ecv_ns__bcastStr │ │ │ │ +0012df40: 696e 6752 6573 706f 6e73 6528 2661 6d70 ingResponse(& │ │ │ │ +0012df50: 3b3c 6120 636c 6173 733d 2263 6f64 6522 ;soap │ │ │ │ +0012df80: 2c20 2661 6d70 3b72 6573 2929 203c 2f64 , &res))
    .
    break;
    .
    │ │ │ │ +0012dff0: 202e 2e2e 203c 7370 616e 2063 6c61 7373 ... // Go │ │ │ │ +0012e010: 7420 7265 7370 6f6e 7365 2026 2333 393b t response ' │ │ │ │ +0012e020: 7265 7326 2333 393b 2066 726f 6d20 6120 res' from a │ │ │ │ +0012e030: 7365 7276 6572 203c 2f73 7061 6e3e 3c2f server .
    }
    .
    │ │ │ │ +0012e090: 6966 3c2f 7370 616e 3e20 283c 6120 636c if (soap.error == │ │ │ │ +0012e120: 203c 6120 636c 6173 733d 2263 6f64 6522 SOAP_EOF && soap.errnum │ │ │ │ +0012e210: 203d 3d20 3029 203c 2f64 6976 3e0a 3c64 == 0)
    . │ │ │ │ +0012e230: 2020 2020 2e2e 2e20 3c73 7061 6e20 636c ... // │ │ │ │ +0012e250: 2054 696d 656f 7574 3a20 6e6f 206d 6f72 Timeout: no mor │ │ │ │ +0012e260: 6520 6d65 7373 6167 6573 2072 6563 6569 e messages recei │ │ │ │ +0012e270: 7665 6420 3c2f 7370 616e 3e3c 2f64 6976 ved
    .
    │ │ │ │ +0012e2b0: 656c 7365 3c2f 7370 616e 3e20 3c2f 6469 else .
    soap │ │ │ │ +0012e330: 5f70 7269 6e74 5f66 6175 6c74 3c2f 613e _print_fault │ │ │ │ +0012e340: 2826 616d 703b 3c61 2063 6c61 7373 3d22 (&soa │ │ │ │ +0012e370: 703c 2f61 3e2c 2073 7464 6572 7229 3b20 p, stderr); │ │ │ │ +0012e380: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    }
    .
    soap_de │ │ │ │ +0012e410: 7374 726f 793c 2f61 3e28 2661 6d70 3b3c stroy(&< │ │ │ │ +0012e420: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +0012e430: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ +0012e440: 6874 6d6c 223e 736f 6170 3c2f 613e 293b html">soap); │ │ │ │ +0012e450: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    so │ │ │ │ +0012e4c0: 6170 5f65 6e64 3c2f 613e 2826 616d 703b ap_end(& │ │ │ │ +0012e4d0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap) │ │ │ │ +0012e500: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
    .
    s │ │ │ │ +0012e570: 6f61 705f 646f 6e65 3c2f 613e 2826 616d oap_done(&am │ │ │ │ +0012e580: 703b 3c61 2063 6c61 7373 3d22 636f 6465 p;soap);
    .
    │ │ │ │ +0012e5c0: 3c21 2d2d 2066 7261 676d 656e 7420 2d2d < │ │ │ │ +00130860: 703e 5468 6520 7365 7276 6572 2062 696e p>The server bin │ │ │ │ +00130870: 6473 2074 6f20 6120 686f 7374 2061 6e64 ds to a host and │ │ │ │ +00130880: 2070 6f72 7420 616e 6420 6163 6365 7074 port and accept │ │ │ │ +00130890: 7320 6d65 7373 6167 6573 2069 6e20 6120 s messages in a │ │ │ │ +001308a0: 6c6f 6f70 2e20 4265 6361 7573 6520 5544 loop. Because UD │ │ │ │ +001308b0: 5020 646f 6573 206e 6f74 2068 6176 6520 P does not have │ │ │ │ +001308c0: 7468 6520 6571 7569 7661 6c65 6e74 206f the equivalent o │ │ │ │ +001308d0: 6620 616e 2061 6363 6570 742c 2074 6865 f an accept, the │ │ │ │ +001308e0: 206d 6573 7361 6765 7320 6361 6e6e 6f74 messages cannot │ │ │ │ +001308f0: 2062 6520 6469 7370 6174 6368 6564 2074 be dispatched t │ │ │ │ +00130900: 6f20 7468 7265 6164 732e 2049 6e73 7465 o threads. Inste │ │ │ │ +00130910: 6164 2074 6865 203c 636f 6465 3e3c 6120 ad the soap │ │ │ │ +00130990: 5f73 6572 7665 3c2f 613e 3c2f 636f 6465 _serve waits for a me │ │ │ │ +001309b0: 7373 6167 6520 616e 6420 696d 6d65 6469 ssage and immedi │ │ │ │ +001309c0: 6174 656c 7920 6163 6365 7074 7320 6974 ately accepts it │ │ │ │ +001309d0: 2e20 596f 7520 6361 6e20 7573 6520 6120 . You can use a │ │ │ │ +001309e0: 7265 6365 6976 6520 7469 6d65 6f75 7420 receive timeout │ │ │ │ +001309f0: 7661 6c75 6520 666f 7220 3c63 6f64 653e value for │ │ │ │ +00130a00: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap: │ │ │ │ +00130ab0: 3a72 6563 765f 7469 6d65 6f75 743c 2f61 :recv_timeout to make │ │ │ │ +00130ad0: 203c 636f 6465 3e3c 6120 636c 6173 733d soap_serve │ │ │ │ +00130b50: 3c2f 613e 3c2f 636f 6465 3e20 6e6f 6e2d non- │ │ │ │ +00130b60: 626c 6f63 6b69 6e67 2e3c 2f70 3e0a 3c70 blocking.

    .

    To obtain respo │ │ │ │ +00130b80: 6e73 6520 6f6e 652d 7761 7920 6f70 6572 nse one-way oper │ │ │ │ +00130b90: 6174 696f 6e73 2066 726f 6d20 6120 5753 ations from a WS │ │ │ │ +00130ba0: 444c 2c20 7573 6520 3c61 2068 7265 663d DL, use < │ │ │ │ +00130bc0: 636f 6465 3e77 7364 6c32 6820 2d62 3c2f code>wsdl2h -b option │ │ │ │ +00130be0: 203c 623e 3c63 6f64 653e 2d62 3c2f 636f -b. Thi │ │ │ │ +00130c00: 7320 7072 6f64 7563 6573 2061 6464 6974 s produces addit │ │ │ │ +00130c10: 696f 6e61 6c20 6f6e 652d 7761 7920 6f70 ional one-way op │ │ │ │ +00130c20: 6572 6174 696f 6e73 2074 6f20 7375 7070 erations to supp │ │ │ │ +00130c30: 6f72 7420 6173 796e 6368 726f 6e6f 7573 ort asynchronous │ │ │ │ +00130c40: 2068 616e 646c 696e 6720 6f66 2072 6573 handling of res │ │ │ │ +00130c50: 706f 6e73 6520 6d65 7373 6167 6573 2069 ponse messages i │ │ │ │ +00130c60: 6e20 7468 6520 7361 6d65 2077 6179 2072 n the same way r │ │ │ │ +00130c70: 6571 7565 7374 7320 6172 6520 6861 6e64 equests are hand │ │ │ │ +00130c80: 6c65 642e 3c2f 703e 0a3c 703e f09f 949d led.

    .

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

    .< │ │ │ │ +00130cc0: 6833 3e3c 6120 636c 6173 733d 2261 6e63 h3>< │ │ │ │ +00130cf0: 2f61 3e0a 534f 4150 2d6f 7665 722d 5544 /a>.SOAP-over-UD │ │ │ │ +00130d00: 5020 6d75 6c74 6963 6173 7420 7265 6365 P multicast rece │ │ │ │ +00130d10: 6976 696e 6720 7365 7276 6572 3c2f 6833 iving server

    .

    For UDP mul │ │ │ │ +00130d30: 7469 6361 7374 2073 7570 706f 7274 2c20 ticast support, │ │ │ │ +00130d40: 666f 6c6c 6f77 2074 6865 2073 7567 6765 follow the sugge │ │ │ │ +00130d50: 7374 696f 6e73 2069 6e20 5365 6374 696f stions in Sectio │ │ │ │ +00130d60: 6e20 3c61 2063 6c61 7373 3d22 656c 2220 n SO │ │ │ │ +00130d90: 4150 2d6f 7665 722d 5544 5020 7365 7276 AP-over-UDP serv │ │ │ │ +00130da0: 6572 3c2f 613e 2061 6e64 2063 6861 6e67 er and chang │ │ │ │ +00130db0: 6520 7468 6520 696e 6974 6961 6c69 7a61 e the initializa │ │ │ │ +00130dc0: 7469 6f6e 2070 6172 7473 206f 6620 7468 tion parts of th │ │ │ │ +00130dd0: 6520 636f 6465 2074 6f20 656e 6162 6c65 e code to enable │ │ │ │ +00130de0: 2055 4450 206d 756c 7469 6361 7374 2070 UDP multicast p │ │ │ │ +00130df0: 6f72 7420 6269 6e64 696e 6720 6279 2074 ort binding by t │ │ │ │ +00130e00: 6f20 7465 6c6c 696e 6720 7468 6520 6b65 o telling the ke │ │ │ │ +00130e10: 726e 656c 2077 6869 6368 206d 756c 7469 rnel which multi │ │ │ │ +00130e20: 6361 7374 2067 726f 7570 7320 796f 7520 cast groups you │ │ │ │ +00130e30: 6172 6520 696e 7465 7265 7374 6564 2069 are interested i │ │ │ │ +00130e40: 6e3a 3c2f 703e 0a3c 6469 7620 636c 6173 n:

    .
    < │ │ │ │ +00130e70: 7370 616e 2063 6c61 7373 3d22 7072 6570 span class="prep │ │ │ │ +00130e80: 726f 6365 7373 6f72 223e 2369 6e63 6c75 rocessor">#inclu │ │ │ │ +00130e90: 6465 2026 7175 6f74 3b70 6c75 6769 6e2f de "plugin/ │ │ │ │ +00130ea0: 7773 6161 7069 2e68 2671 756f 743b 3c2f wsaapi.h"
    .
    < │ │ │ │ +00130ed0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    int mai │ │ │ │ +00130f10: 6e28 2920 3c2f 6469 763e 0a3c 6469 7620 n()
    .
    {.
    s │ │ │ │ +00130f60: 7472 7563 7420 3c2f 7370 616e 3e3c 6120 truct soap soap; .
    s │ │ │ │ +00131000: 7472 7563 7420 3c2f 7370 616e 3e69 705f truct ip_ │ │ │ │ +00131010: 6d72 6571 206d 6361 7374 3b20 3c2f 6469 mreq mcast; .
    soap │ │ │ │ +00131090: 5f69 6e69 7431 3c2f 613e 2826 616d 703b _init1(& │ │ │ │ +001310a0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap, │ │ │ │ +001310d0: 203c 6120 636c 6173 733d 2263 6f64 6522 SOAP_IO_UDP< │ │ │ │ +00131130: 2f61 3e29 3b20 3c2f 6469 763e 0a3c 6469 /a>);
    . │ │ │ │ +00131150: 203c 6120 636c 6173 733d 2263 6f64 6522 soap_regist │ │ │ │ +001311b0: 6572 5f70 6c75 6769 6e3c 2f61 3e28 2661 er_plugin(&a │ │ │ │ +001311c0: 6d70 3b3c 6120 636c 6173 733d 2263 6f64 mp;soap, soap_wsa);..
    {..
    e │ │ │ │ +00131450: 7869 7428 4558 4954 5f46 4149 4c55 5245 xit(EXIT_FAILURE │ │ │ │ +00131460: 293b 203c 2f64 6976 3e0a 3c64 6976 2063 );
    .
    } │ │ │ │ +00131480: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    mcast │ │ │ │ +001314a0: 2e69 6d72 5f6d 756c 7469 6164 6472 2e73 .imr_multiaddr.s │ │ │ │ +001314b0: 5f61 6464 7220 3d20 696e 6574 5f61 6464 _addr = inet_add │ │ │ │ +001314c0: 7228 7075 7420 4950 206d 756c 7469 6361 r(put IP multica │ │ │ │ +001314d0: 7374 2061 6464 7265 7373 206f 6620 6772 st address of gr │ │ │ │ +001314e0: 6f75 7020 6865 7265 293b 203c 2f64 6976 oup here);
    .
    mcast.imr_ │ │ │ │ +00131510: 696e 7465 7266 6163 652e 735f 6164 6472 interface.s_addr │ │ │ │ +00131520: 203d 2068 746f 6e6c 2849 4e41 4444 525f = htonl(INADDR_ │ │ │ │ +00131530: 414e 5929 3b20 3c2f 6469 763e 0a3c 6469 ANY);
    . │ │ │ │ +00131550: 203c 7370 616e 2063 6c61 7373 3d22 6b65 if
    (setsockopt │ │ │ │ +00131580: 283c 6120 636c 6173 733d 2263 6f64 6522 (soap │ │ │ │ +001315b0: 2e3c 6120 636c 6173 733d 2263 6f64 6522 .master │ │ │ │ +00131600: 3c2f 613e 2c20 4950 5052 4f54 4f5f 4950 , IPPROTO_IP │ │ │ │ +00131610: 2c20 4950 5f41 4444 5f4d 454d 4245 5253 , IP_ADD_MEMBERS │ │ │ │ +00131620: 4849 502c 2026 616d 703b 6d63 6173 742c HIP, &mcast, │ │ │ │ +00131630: 203c 7370 616e 2063 6c61 7373 3d22 6b65 sizeof(mcast))< │ │ │ │ +00131660: 3029 203c 2f64 6976 3e0a 3c64 6976 2063 0)
    .
    │ │ │ │ +00131680: 2e2e 2e20 3c73 7061 6e20 636c 6173 733d ... // err │ │ │ │ +001316a0: 6f72 3c2f 7370 616e 3e3c 2f64 6976 3e0a or
    . │ │ │ │ +001316b0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    ... // │ │ │ │ +001316e0: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ │ +00131700: 2020 3c61 2063 6c61 7373 3d22 636f 6465 soap_dest │ │ │ │ +00131760: 726f 793c 2f61 3e28 2661 6d70 3b3c 6120 roy(&soap);.
    so │ │ │ │ +00131810: 6170 5f65 6e64 3c2f 613e 2826 616d 703b ap_end(& │ │ │ │ +00131820: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap) │ │ │ │ +00131850: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
    .
    soap_done(& │ │ │ │ +001318d0: 616d 703b 3c61 2063 6c61 7373 3d22 636f amp;soap< │ │ │ │ +00131900: 2f61 3e29 3b3c 2f64 6976 3e0a 3c64 6976 /a>);
    .
    }< │ │ │ │ +00131920: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    < │ │ │ │ +00131970: 6469 7620 636c 6173 733d 2274 746e 616d div class="ttnam │ │ │ │ +00131980: 6522 3e3c 6120 6872 6566 3d22 7374 7275 e">s │ │ │ │ +001319c0: 6f61 703a 3a6d 6173 7465 723c 2f61 3e3c oap::master< │ │ │ │ +001319d0: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
    SOAP_SO │ │ │ │ +001319f0: 434b 4554 206d 6173 7465 723c 2f64 6976 CKET master
    The socket s │ │ │ │ +00131a20: 6574 2062 7920 736f 6170 5f62 696e 6420 et by soap_bind │ │ │ │ +00131a30: 286f 7220 7468 6520 432b 2b20 7365 7276 (or the C++ serv │ │ │ │ +00131a40: 6963 6520 636c 6173 7320 6269 6e64 206d ice class bind m │ │ │ │ +00131a50: 6574 686f 6429 2074 6f20 7365 7276 6520 ethod) to serve │ │ │ │ +00131a60: 6173 2074 6865 206d 6173 7465 7220 736f as the master so │ │ │ │ +00131a70: 636b 6574 2062 6f75 6e2e 2e2e 3c2f 6469 cket boun...
    Definiti │ │ │ │ +00131aa0: 6f6e 3a3c 2f62 3e20 7374 6473 6f61 7032 on: stdsoap2 │ │ │ │ +00131ab0: 2e68 3a33 3032 333c 2f64 6976 3e3c 2f64 .h:3023
    .

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

    │ │ │ │ +00131b10: 0a3c 6831 3e3c 6120 636c 6173 733d 2261 .

    .C │ │ │ │ +00131b40: 6f6d 7069 6c65 2d74 696d 6520 666c 6167 ompile-time flag │ │ │ │ +00131b50: 733c 2f68 313e 0a3c 703e 5468 6520 666f s

    .

    The fo │ │ │ │ +00131b60: 6c6c 6f77 696e 6720 6d61 6372 6f73 2061 llowing macros a │ │ │ │ +00131b70: 7265 2064 6566 696e 6564 2069 6e20 7468 re defined in th │ │ │ │ +00131b80: 6520 4150 4920 646f 6375 6d65 6e74 6174 e API documentat │ │ │ │ +00131b90: 696f 6e20 4d6f 6475 6c65 203c 6120 636c ion Module WITH_MAC │ │ │ │ +00131bd0: 524f 2063 6f6d 7069 6c65 2d74 696d 6520 RO compile-time │ │ │ │ +00131be0: 666c 6167 733c 2f61 3e2e 2054 6865 7365 flags. These │ │ │ │ +00131bf0: 206d 6163 726f 7320 6172 6520 7573 6564 macros are used │ │ │ │ +00131c00: 2074 6f20 656e 6162 6c65 206f 7220 6469 to enable or di │ │ │ │ +00131c10: 7361 626c 6520 6665 6174 7572 6573 2061 sable features a │ │ │ │ +00131c20: 7320 7370 6563 6966 6965 6420 6265 6c6f s specified belo │ │ │ │ +00131c30: 772c 2062 7920 636f 6d70 696c 696e 6720 w, by compiling │ │ │ │ +00131c40: 736f 7572 6365 2063 6f64 6520 6669 6c65 source code file │ │ │ │ +00131c50: 7320 7769 7468 2063 6f6d 7069 6c65 7220 s with compiler │ │ │ │ +00131c60: 6f70 7469 6f6e 203c 623e 3c63 6f64 653e option │ │ │ │ +00131c70: 2d44 3c2f 636f 6465 3e3c 2f62 3e20 746f -D to │ │ │ │ +00131c80: 2073 6574 2074 6865 206d 6163 726f 3a3c set the macro:< │ │ │ │ +00131c90: 2f70 3e0a 3c74 6162 6c65 2063 6c61 7373 /p>.

    engine < │ │ │ │ -0018e5b0: 2f74 683e 3c74 6820 636c 6173 733d 226d /th>result │ │ │ │ -0018e5e0: 3c2f 7468 3e3c 2f74 723e 0a3c 7472 2063
    openssl The │ │ │ │ -0018e670: 6465 6661 756c 7420 736f 6674 7761 7265 default software │ │ │ │ -0018e680: 2065 6e67 696e 6520 666f 7220 6372 7970 engine for cryp │ │ │ │ -0018e690: 746f 6772 6170 6869 6320 6f70 6572 6174 tographic operat │ │ │ │ -0018e6a0: 696f 6e73 2020 2020 3c2f 7464 3e3c 2f74 ions
    ope │ │ │ │ -0018e700: 6e62 7364 5f64 6576 5f63 7279 7074 6f3c nbsd_dev_crypto< │ │ │ │ -0018e710: 2f63 6f64 653e 2020 203c 2f74 643e 3c74 /code>
    cswift │ │ │ │ -0018e7d0: 2020 3c2f 7464 3e3c 7464 2063 6c61 7373 CryptoS │ │ │ │ -0018e800: 7769 6674 2061 6363 656c 6572 6174 696f wift acceleratio │ │ │ │ -0018e810: 6e20 6861 7264 7761 7265 2020 2020 3c2f n hardware
    chil │ │ │ │ -0018e880: 203c 2f74 643e 3c74 6420 636c 6173 733d nCipher │ │ │ │ -0018e8b0: 4348 494c 2061 6363 656c 6572 6174 696f CHIL acceleratio │ │ │ │ -0018e8c0: 6e20 6861 7264 7761 7265 2020 2020 3c2f n hardware
    atalla │ │ │ │ -0018e930: 2020 3c2f 7464 3e3c 7464 2063 6c61 7373 Compaq │ │ │ │ -0018e960: 4174 616c 6c61 2061 6363 656c 6572 6174 Atalla accelerat │ │ │ │ -0018e970: 696f 6e20 6861 7264 7761 7265 2020 2020 ion hardware │ │ │ │ -0018e980: 3c2f 7464 3e3c 2f74 723e 0a3c 7472 2063
    < │ │ │ │ -0018e9d0: 636f 6465 3e6e 7572 6f6e 3c2f 636f 6465 code>nuron Nuron │ │ │ │ -0018ea10: 2061 6363 656c 6572 6174 696f 6e20 6861 acceleration ha │ │ │ │ -0018ea20: 7264 7761 7265 2020 2020 3c2f 7464 3e3c rdware
    ub │ │ │ │ -0018ea80: 7365 633c 2f63 6f64 653e 2020 203c 2f74 sec Broadcom uBS │ │ │ │ -0018eac0: 6563 2061 6363 656c 6572 6174 696f 6e20 ec acceleration │ │ │ │ -0018ead0: 6861 7264 7761 7265 2020 2020 3c2f 7464 hardware
    aep Aep acceler │ │ │ │ -0018eb70: 6174 696f 6e20 6861 7264 7761 7265 2020 ation hardware │ │ │ │ -0018eb80: 2020 3c2f 7464 3e3c 2f74 723e 0a3c 7472
    S │ │ │ │ -0018ec10: 7572 6557 6172 6520 6163 6365 6c65 7261 ureWare accelera │ │ │ │ -0018ec20: 7469 6f6e 2068 6172 6477 6172 6520 2020 tion hardware │ │ │ │ -0018ec30: 3c2f 7464 3e3c 2f74 723e 0a3c 2f74 6162
    . │ │ │ │ +00131cd0: 0a3c 7468 2063 6c61 7373 3d22 6d61 726b ... │ │ │ │ +00131e10: 0a3c 7472 2063 6c61 7373 3d22 6d61 726b ....< │ │ │ │ +00132010: 2f74 723e 0a3c 7472 2063 6c61 7373 3d22 /tr>... │ │ │ │ +00132130: 3c74 7220 636c 6173 733d 226d 6172 6b64 │ │ │ │ +00132150: 0a3c 7464 2063 6c61 7373 3d22 6d61 726b ....... │ │ │ │ +001324e0: 3c63 6f64 653e 2357 4954 485f 494e 5345 #WITH_INSE │ │ │ │ +001324f0: 4355 5245 5f43 4f4f 4b49 4553 3c2f 636f CURE_COOKIES . │ │ │ │ +001325a0: 3c74 7220 636c 6173 733d 226d 6172 6b64 │ │ │ │ +001325c0: 0a3c 7464 2063 6c61 7373 3d22 6d61 726b ..........< │ │ │ │ +00132ac0: 7472 2063 6c61 7373 3d22 6d61 726b 646f tr class="markdo │ │ │ │ +00132ad0: 776e 5461 626c 6552 6f77 4576 656e 223e wnTableRowEven"> │ │ │ │ +00132ae0: 0a3c 7464 2063 6c61 7373 3d22 6d61 726b . │ │ │ │ +00132bc0: 0a3c 7472 2063 6c61 7373 3d22 6d61 726b ....< │ │ │ │ +00132cd0: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ │ +00132ce0: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ │ +00132cf0: 3e66 6f72 6365 2074 6865 2075 7365 206c >force the use l │ │ │ │ +00132d00: 6f63 616c 6520 6675 6e63 7469 6f6e 7320 ocale functions │ │ │ │ +00132d10: 7768 656e 2061 7661 696c 6162 6c65 2074 when available t │ │ │ │ +00132d20: 6f20 656e 7375 7265 206c 6f63 616c 652d o ensure locale- │ │ │ │ +00132d30: 696e 6465 7065 6e64 656e 7420 6e75 6d62 independent numb │ │ │ │ +00132d40: 6572 2063 6f6e 7665 7273 696f 6e73 2020 er conversions │ │ │ │ +00132d50: 2020 3c2f 7464 3e3c 2f74 723e 0a3c 7472 .. │ │ │ │ +00132da0: 3c63 6f64 653e 2357 4954 485f 4e4f 5f43 #WITH_NO_C │ │ │ │ +00132db0: 5f4c 4f43 414c 453c 2f63 6f64 653e 2020 _LOCALE │ │ │ │ +00132dc0: 203c 2f74 643e 3c74 6420 636c 6173 733d . │ │ │ │ +00132e30: 3c74 7220 636c 6173 733d 226d 6172 6b64 . │ │ │ │ +00132ea0: 3c74 6420 636c 6173 733d 226d 6172 6b64 .....< │ │ │ │ +00133130: 7472 2063 6c61 7373 3d22 6d61 726b 646f tr class="markdo │ │ │ │ +00133140: 776e 5461 626c 6552 6f77 4f64 6422 3e0a wnTableRowOdd">. │ │ │ │ +00133150: 3c74 6420 636c 6173 733d 226d 6172 6b64 < │ │ │ │ +00133210: 2f74 723e 0a3c 7472 2063 6c61 7373 3d22 /tr>....< │ │ │ │ +001333b0: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ │ +001333c0: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ │ +001333d0: 3e72 656d 6f76 6573 2069 6420 616e 6420 >removes id and │ │ │ │ +001333e0: 6872 6566 2f72 6566 206d 756c 7469 2d72 href/ref multi-r │ │ │ │ +001333f0: 6566 6572 656e 6365 2064 6174 612c 206d eference data, m │ │ │ │ +00133400: 6f72 6520 6167 6772 6573 7369 7665 2074 ore aggressive t │ │ │ │ +00133410: 6861 6e20 7573 696e 6720 7468 6520 3c63 han using the #SOAP_XML_TR │ │ │ │ +00133430: 4545 3c2f 636f 6465 3e20 7275 6e74 696d EE runtim │ │ │ │ +00133440: 6520 666c 6167 2020 2020 3c2f 7464 3e3c e flag < │ │ │ │ +00133450: 2f74 723e 0a3c 7472 2063 6c61 7373 3d22 /tr>..< │ │ │ │ +00133510: 2f74 723e 0a3c 7472 2063 6c61 7373 3d22 /tr>...< │ │ │ │ +001335f0: 7472 2063 6c61 7373 3d22 6d61 726b 646f tr class="markdo │ │ │ │ +00133600: 776e 5461 626c 6552 6f77 4576 656e 223e wnTableRowEven"> │ │ │ │ +00133610: 0a3c 7464 2063 6c61 7373 3d22 6d61 726b .< │ │ │ │ +00133660: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ │ +00133670: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ │ +00133680: 3e64 6973 6162 6c65 7320 786d 6c6e 733d >disables xmlns= │ │ │ │ +00133690: 2222 2064 6566 6175 6c74 2065 6d70 7479 "" default empty │ │ │ │ +001336a0: 206e 616d 6573 7061 6365 7320 6672 6f6d namespaces from │ │ │ │ +001336b0: 2058 4d4c 206d 6573 7361 6765 7320 2020 XML messages │ │ │ │ +001336c0: 203c 2f74 643e 3c2f 7472 3e0a 3c74 7220 ........ │ │ │ │ +00133bc0: 0a3c 7472 2063 6c61 7373 3d22 6d61 726b ...... │ │ │ │ +00133e60: 3c63 6f64 653e 2357 4954 485f 4341 5345 #WITH_CASE │ │ │ │ +00133e70: 494e 5345 4e53 4954 4956 4554 4147 533c INSENSITIVETAGS< │ │ │ │ +00133e80: 2f63 6f64 653e 2020 203c 2f74 643e 3c74 /code> │ │ │ │ +00133eb0: 656e 6162 6c65 7320 6361 7365 2069 6e73 enables case ins │ │ │ │ +00133ec0: 656e 7369 7469 7665 2058 4d4c 2070 6172 ensitive XML par │ │ │ │ +00133ed0: 7369 6e67 2020 2020 3c2f 7464 3e3c 2f74 sing ....< │ │ │ │ +00134070: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ │ +00134080: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ │ +00134090: 3e65 6e61 626c 6573 2054 4350 2046 494e >enables TCP FIN │ │ │ │ +001340a0: 2061 6674 6572 2073 656e 6473 2077 6865 after sends whe │ │ │ │ +001340b0: 6e20 736f 636b 6574 2069 7320 7265 6164 n socket is read │ │ │ │ +001340c0: 7920 746f 2063 6c6f 7365 2020 2020 3c2f y to close ..< │ │ │ │ +00134270: 2f74 723e 0a3c 2f74 6162 6c65 3e0a 3c70 /tr>.
    define result
    #SOAPDEFS_H the │ │ │ │ +00131dc0: 2068 6561 6465 7220 6669 6c65 2074 6f20 header file to │ │ │ │ +00131dd0: 696e 636c 7564 652c 2069 6620 6469 6666 include, if diff │ │ │ │ +00131de0: 6572 656e 7420 6672 6f6d 203c 636f 6465 erent from soapdefs.h
    #WITH │ │ │ │ +00131e60: 5f53 4f41 5044 4546 535f 483c 2f63 6f64 _SOAPDEFS_H incl │ │ │ │ +00131ea0: 7564 6573 2074 6865 203c 636f 6465 3e73 udes the s │ │ │ │ +00131eb0: 6f61 7064 6566 732e 683c 2f63 6f64 653e oapdefs.h │ │ │ │ +00131ec0: 2066 696c 6520 666f 7220 6375 7374 6f6d file for custom │ │ │ │ +00131ed0: 2073 6574 7469 6e67 732c 2073 6565 2053 settings, see S │ │ │ │ +00131ee0: 6563 7469 6f6e 203c 6120 636c 6173 733d ection │ │ │ │ +00131f10: 5573 696e 6720 7468 6520 736f 6170 6465 Using the soapde │ │ │ │ +00131f20: 6673 2e68 2068 6561 6465 7220 6669 6c65 fs.h header file │ │ │ │ +00131f30: 3c2f 613e 2020 2020 3c2f 7464 3e3c 2f74
    #WIT │ │ │ │ +00131f90: 485f 434f 4d50 4154 3c2f 636f 6465 3e20 H_COMPAT │ │ │ │ +00131fa0: 2020 3c2f 7464 3e3c 7464 2063 6c61 7373 removes │ │ │ │ +00131fd0: 2064 6570 656e 6465 6e63 7920 6f6e 2043 dependency on C │ │ │ │ +00131fe0: 2b2b 2073 7472 6561 6d20 6c69 6272 6172 ++ stream librar │ │ │ │ +00131ff0: 6965 7320 616e 6420 432b 2b20 6578 6365 ies and C++ exce │ │ │ │ +00132000: 7074 696f 6e73 2020 2020 3c2f 7464 3e3c ptions
    # │ │ │ │ +00132060: 5749 5448 5f4c 4541 4e3c 2f63 6f64 653e WITH_LEAN │ │ │ │ +00132070: 2020 203c 2f74 643e 3c74 6420 636c 6173 create │ │ │ │ +001320a0: 7320 6120 736d 616c 6c2d 666f 6f74 7072 s a small-footpr │ │ │ │ +001320b0: 696e 7420 6578 6563 7574 6162 6c65 2c20 int executable, │ │ │ │ +001320c0: 7365 6520 5365 6374 696f 6e20 3c61 2063 see Section How to minimize │ │ │ │ +00132100: 2061 7070 6c69 6361 7469 6f6e 206d 656d application mem │ │ │ │ +00132110: 6f72 7920 666f 6f74 7072 696e 743c 2f61 ory footprint
    #WITH_L │ │ │ │ +00132180: 4541 4e45 523c 2f63 6f64 653e 2020 203c EANER < │ │ │ │ +00132190: 2f74 643e 3c74 6420 636c 6173 733d 226d /td>creates an │ │ │ │ +001321c0: 2065 7665 6e20 736d 616c 6c65 7220 666f even smaller fo │ │ │ │ +001321d0: 6f74 7072 696e 7420 6578 6563 7574 6162 otprint executab │ │ │ │ +001321e0: 6c65 2c20 7365 6520 5365 6374 696f 6e20 le, see Section │ │ │ │ +001321f0: 3c61 2063 6c61 7373 3d22 656c 2220 6872 How to mini │ │ │ │ +00132220: 6d69 7a65 2061 7070 6c69 6361 7469 6f6e mize application │ │ │ │ +00132230: 206d 656d 6f72 7920 666f 6f74 7072 696e memory footprin │ │ │ │ +00132240: 743c 2f61 3e20 2020 203c 2f74 643e 3c2f t
    #W │ │ │ │ +001322a0: 4954 485f 4641 5354 3c2f 636f 6465 3e20 ITH_FAST │ │ │ │ +001322b0: 2020 3c2f 7464 3e3c 7464 2063 6c61 7373 use fas │ │ │ │ +001322e0: 7465 7220 6d65 6d6f 7279 2061 6c6c 6f63 ter memory alloc │ │ │ │ +001322f0: 6174 696f 6e20 7768 656e 2075 7365 6420 ation when used │ │ │ │ +00132300: 7769 7468 203c 636f 6465 3e23 5749 5448 with #WITH │ │ │ │ +00132310: 5f4c 4541 4e3c 2f63 6f64 653e 206f 7220 _LEAN or │ │ │ │ +00132320: 3c63 6f64 653e 2357 4954 485f 4c45 414e #WITH_LEAN │ │ │ │ +00132330: 4552 3c2f 636f 6465 3e20 2020 203c 2f74 ER
    #WITH_COOKIES e │ │ │ │ +001323d0: 6e61 626c 6573 2048 5454 5020 636f 6f6b nables HTTP cook │ │ │ │ +001323e0: 6965 732c 2073 6565 2053 6563 7469 6f6e ies, see Section │ │ │ │ +001323f0: 7320 3c61 2063 6c61 7373 3d22 656c 2220 s C │ │ │ │ +00132420: 6c69 656e 742d 7369 6465 2063 6f6f 6b69 lient-side cooki │ │ │ │ +00132430: 6520 7375 7070 6f72 743c 2f61 3e20 616e e support an │ │ │ │ +00132440: 6420 3c61 2063 6c61 7373 3d22 656c 2220 d S │ │ │ │ +00132470: 6572 7665 722d 7369 6465 2063 6f6f 6b69 erver-side cooki │ │ │ │ +00132480: 6520 7375 7070 6f72 743c 2f61 3e20 2020 e support │ │ │ │ +00132490: 203c 2f74 643e 3c2f 7472 3e0a 3c74 7220
    ena │ │ │ │ +00132530: 626c 6573 2048 5454 5020 636f 6f6b 6965 bles HTTP cookie │ │ │ │ +00132540: 7320 616e 6420 616c 6c6f 7773 2063 6f6f s and allows coo │ │ │ │ +00132550: 6b69 6573 2077 6974 6820 7468 6569 7220 kies with their │ │ │ │ +00132560: 5365 6375 7265 2066 6c61 6720 7365 7420 Secure flag set │ │ │ │ +00132570: 746f 2062 6520 7365 6e74 206f 7665 7220 to be sent over │ │ │ │ +00132580: 696e 7365 6375 7265 2063 6861 6e6e 656c insecure channel │ │ │ │ +00132590: 7320 2020 203c 2f74 643e 3c2f 7472 3e0a s
    #WITH_I │ │ │ │ +001325f0: 5056 363c 2f63 6f64 653e 2020 203c 2f74 PV6 enables IPv6 │ │ │ │ +00132630: 2073 7570 706f 7274 2020 2020 3c2f 7464 support
    #WITH_IPV6_V6ON │ │ │ │ +001326a0: 4c59 3c2f 636f 6465 3e20 2020 3c2f 7464 LY enables IPv6 │ │ │ │ +001326e0: 7375 7070 6f72 7420 7769 7468 2049 5076 support with IPv │ │ │ │ +001326f0: 362d 6f6e 6c79 2073 6572 7665 7220 6f70 6-only server op │ │ │ │ +00132700: 7469 6f6e 2020 2020 3c2f 7464 3e3c 2f74 tion
    #WIT │ │ │ │ +00132760: 485f 4f50 454e 5353 4c3c 2f63 6f64 653e H_OPENSSL │ │ │ │ +00132770: 2020 203c 2f74 643e 3c74 6420 636c 6173 enable │ │ │ │ +001327a0: 7320 4f70 656e 5353 4c2c 2073 6565 2053 s OpenSSL, see S │ │ │ │ +001327b0: 6563 7469 6f6e 7320 3c61 2063 6c61 7373 ections Secure cli │ │ │ │ +001327f0: 656e 7473 2077 6974 6820 4854 5450 533c ents with HTTPS< │ │ │ │ +00132800: 2f61 3e20 616e 6420 3c61 2063 6c61 7373 /a> and Secure Web │ │ │ │ +00132840: 2073 6572 7669 6365 7320 7769 7468 2048 services with H │ │ │ │ +00132850: 5454 5053 3c2f 613e 2020 2020 3c2f 7464 TTPS
    #WITH_GNUTLS en │ │ │ │ +001328f0: 6162 6c65 7320 474e 5554 4c53 2c20 7365 ables GNUTLS, se │ │ │ │ +00132900: 6520 5365 6374 696f 6e73 203c 6120 636c e Sections Secure │ │ │ │ +00132940: 636c 6965 6e74 7320 7769 7468 2048 5454 clients with HTT │ │ │ │ +00132950: 5053 3c2f 613e 2061 6e64 203c 6120 636c PS and Secure │ │ │ │ +00132990: 5765 6220 7365 7276 6963 6573 2077 6974 Web services wit │ │ │ │ +001329a0: 6820 4854 5450 533c 2f61 3e20 2020 203c h HTTPS < │ │ │ │ +001329b0: 2f74 643e 3c2f 7472 3e0a 3c74 7220 636c /td>
    #WITH_GZIP en │ │ │ │ +00132a40: 6162 6c65 7320 677a 6970 2061 6e64 2064 ables gzip and d │ │ │ │ +00132a50: 6566 6c61 7465 2063 6f6d 7072 6573 7369 eflate compressi │ │ │ │ +00132a60: 6f6e 2c20 7365 6520 5365 6374 696f 6e20 on, see Section │ │ │ │ +00132a70: 3c61 2063 6c61 7373 3d22 656c 2220 6872 Zlib │ │ │ │ +00132aa0: 2063 6f6d 7072 6573 7369 6f6e 3c2f 613e compression │ │ │ │ +00132ab0: 2020 2020 3c2f 7464 3e3c 2f74 723e 0a3c
    #WITH_Z │ │ │ │ +00132b10: 4c49 423c 2f63 6f64 653e 2020 203c 2f74 LIB enables defl │ │ │ │ +00132b50: 6174 6520 636f 6d70 7265 7373 696f 6e20 ate compression │ │ │ │ +00132b60: 6f6e 6c79 2c20 7365 6520 5365 6374 696f only, see Sectio │ │ │ │ +00132b70: 6e20 3c61 2063 6c61 7373 3d22 656c 2220 n Zl │ │ │ │ +00132ba0: 6962 2063 6f6d 7072 6573 7369 6f6e 3c2f ib compression
    #WITH_ │ │ │ │ +00132c10: 4e54 4c4d 3c2f 636f 6465 3e20 2020 3c2f NTLM enables NTL │ │ │ │ +00132c50: 4d20 7375 7070 6f72 7420 2020 203c 2f74 M support
    #WITH_C_LOCALE │ │ │ │ +00132cc0: 3c2f 636f 6465 3e20 2020 3c2f 7464 3e3c
    remove t │ │ │ │ +00132df0: 6865 2075 7365 206f 6620 6c6f 6361 6c65 he use of locale │ │ │ │ +00132e00: 2066 756e 6374 696f 6e73 2074 6f20 696d functions to im │ │ │ │ +00132e10: 7072 6f76 6520 706f 7274 6162 696c 6974 prove portabilit │ │ │ │ +00132e20: 7920 2020 203c 2f74 643e 3c2f 7472 3e0a y
    #WITH_ │ │ │ │ +00132e80: 494e 434c 5544 455f 584c 4f43 414c 455f INCLUDE_XLOCALE_ │ │ │ │ +00132e90: 483c 2f63 6f64 653e 2020 203c 2f74 643e H force the incl │ │ │ │ +00132ed0: 7573 696f 6e20 6f66 203c 636f 6465 3e26 usion of & │ │ │ │ +00132ee0: 6c74 3b78 6c6f 6361 6c65 2e68 2667 743b lt;xlocale.h> │ │ │ │ +00132ef0: 3c2f 636f 6465 3e20 746f 2064 6566 696e to defin │ │ │ │ +00132f00: 6520 3c63 6f64 653e 6c6f 6361 6c65 5f74 e locale_t │ │ │ │ +00132f10: 3c2f 636f 6465 3e20 616e 6420 3c63 6f64 and _l func │ │ │ │ +00132f30: 7469 6f6e 732c 2074 6f20 696d 7072 6f76 tions, to improv │ │ │ │ +00132f40: 6520 706f 7274 6162 696c 6974 7920 2020 e portability │ │ │ │ +00132f50: 203c 2f74 643e 3c2f 7472 3e0a 3c74 7220
    < │ │ │ │ +00132fa0: 636f 6465 3e23 5749 5448 5f44 4f4d 3c2f code>#WITH_DOM e │ │ │ │ +00132fe0: 6e61 626c 6520 444f 4d20 7061 7273 696e nable DOM parsin │ │ │ │ +00132ff0: 6720 696e 2074 6865 2065 6e67 696e 652c g in the engine, │ │ │ │ +00133000: 2072 6571 7569 7265 6420 6279 2074 6865 required by the │ │ │ │ +00133010: 2057 532d 5365 6375 7269 7479 2070 6c75 WS-Security plu │ │ │ │ +00133020: 6769 6e20 2020 203c 2f74 643e 3c2f 7472 gin
    #WIT │ │ │ │ +00133080: 485f 5245 504c 4143 455f 494c 4c45 4741 H_REPLACE_ILLEGA │ │ │ │ +00133090: 4c5f 5554 4638 3c2f 636f 6465 3e20 2020 L_UTF8 │ │ │ │ +001330a0: 3c2f 7464 3e3c 7464 2063 6c61 7373 3d22 enable st │ │ │ │ +001330d0: 7269 6374 2055 5446 2d38 2c20 7265 706c rict UTF-8, repl │ │ │ │ +001330e0: 6163 6573 2055 5446 2d38 2063 6f6e 7465 aces UTF-8 conte │ │ │ │ +001330f0: 6e74 2074 6861 7420 6973 206f 7574 7369 nt that is outsi │ │ │ │ +00133100: 6465 2074 6865 2061 6c6c 6f77 6564 2072 de the allowed r │ │ │ │ +00133110: 616e 6765 2077 6974 6820 552b 4646 4644 ange with U+FFFD │ │ │ │ +00133120: 2020 2020 3c2f 7464 3e3c 2f74 723e 0a3c
    #WITH_FA │ │ │ │ +00133180: 5354 4347 493c 2f63 6f64 653e 2020 203c STCGI < │ │ │ │ +00133190: 2f74 643e 3c74 6420 636c 6173 733d 226d /td>enables Fa │ │ │ │ +001331c0: 7374 4347 492c 2073 6565 2053 6563 7469 stCGI, see Secti │ │ │ │ +001331d0: 6f6e 203c 6120 636c 6173 733d 2265 6c22 on FastC │ │ │ │ +00133200: 4749 3c2f 613e 2020 2020 3c2f 7464 3e3c GI
    # │ │ │ │ +00133260: 5749 5448 5f4e 4f49 4f3c 2f63 6f64 653e WITH_NOIO │ │ │ │ +00133270: 2020 203c 2f74 643e 3c74 6420 636c 6173 remove │ │ │ │ +001332a0: 7320 494f 206f 7065 7261 7469 6f6e 732c s IO operations, │ │ │ │ +001332b0: 2074 6f20 656c 696d 696e 6174 6520 7468 to eliminate th │ │ │ │ +001332c0: 6520 7573 6520 6f66 2042 5344 2073 6f63 e use of BSD soc │ │ │ │ +001332d0: 6b65 7473 2c20 7365 6520 5365 6374 696f kets, see Sectio │ │ │ │ +001332e0: 6e20 3c61 2063 6c61 7373 3d22 656c 2220 n How to re │ │ │ │ +00133310: 6d6f 7665 2074 6865 2042 5344 2073 6f63 move the BSD soc │ │ │ │ +00133320: 6b65 7420 6c69 6272 6172 7920 7265 7175 ket library requ │ │ │ │ +00133330: 6972 656d 656e 743c 2f61 3e20 2020 203c irement < │ │ │ │ +00133340: 2f74 643e 3c2f 7472 3e0a 3c74 7220 636c /td>
    #WITH_NOIDREF │ │ │ │ +001333a0: 3c2f 636f 6465 3e20 2020 3c2f 7464 3e3c
    # │ │ │ │ +001334a0: 5749 5448 5f4e 4f48 5454 503c 2f63 6f64 WITH_NOHTTP remo │ │ │ │ +001334e0: 7665 7320 7468 6520 4854 5450 2073 7461 ves the HTTP sta │ │ │ │ +001334f0: 636b 2074 6f20 7265 6475 6365 2063 6f64 ck to reduce cod │ │ │ │ +00133500: 6520 7369 7a65 2020 2020 3c2f 7464 3e3c e size
    #W │ │ │ │ +00133560: 4954 485f 4e4f 5a4f 4e45 3c2f 636f 6465 ITH_NOZONE disab │ │ │ │ +001335a0: 6c65 7320 616e 6420 6967 6e6f 7265 7320 les and ignores │ │ │ │ +001335b0: 7468 6520 7469 6d65 7a6f 6e65 2069 6e20 the timezone in │ │ │ │ +001335c0: 3c63 6f64 653e 7873 643a 6461 7465 5469 xsd:dateTi │ │ │ │ +001335d0: 6d65 3c2f 636f 6465 3e20 7661 6c75 6573 me values │ │ │ │ +001335e0: 2020 2020 3c2f 7464 3e3c 2f74 723e 0a3c
    #WITH_N │ │ │ │ +00133640: 4f45 4d50 5459 4e41 4d45 5350 4143 4553 OEMPTYNAMESPACES │ │ │ │ +00133650: 3c2f 636f 6465 3e20 2020 3c2f 7464 3e3c
    < │ │ │ │ +00133710: 636f 6465 3e23 5749 5448 5f4e 4f45 4d50 code>#WITH_NOEMP │ │ │ │ +00133720: 5459 5354 5255 4354 3c2f 636f 6465 3e20 TYSTRUCT │ │ │ │ +00133730: 2020 3c2f 7464 3e3c 7464 2063 6c61 7373 inserts │ │ │ │ +00133760: 2061 2064 756d 6d79 206d 656d 6265 7220 a dummy member │ │ │ │ +00133770: 696e 2065 6d70 7479 2073 7472 7563 7473 in empty structs │ │ │ │ +00133780: 2074 6f20 616c 6c6f 7720 636f 6d70 696c to allow compil │ │ │ │ +00133790: 6174 696f 6e20 2020 203c 2f74 643e 3c2f ation
    #W │ │ │ │ +001337f0: 4954 485f 4e4f 474c 4f42 414c 3c2f 636f ITH_NOGLOBAL omi │ │ │ │ +00133830: 7420 534f 4150 2048 6561 6465 7220 616e t SOAP Header an │ │ │ │ +00133840: 6420 4661 756c 7420 7365 7269 616c 697a d Fault serializ │ │ │ │ +00133850: 6174 696f 6e20 636f 6465 2c20 7072 6576 ation code, prev │ │ │ │ +00133860: 656e 7473 2064 7570 6c69 6361 7465 2064 ents duplicate d │ │ │ │ +00133870: 6566 696e 6974 696f 6e73 2077 6974 6820 efinitions with │ │ │ │ +00133880: 6765 6e65 7261 7465 6420 736f 6170 5859 generated soapXY │ │ │ │ +00133890: 5a4c 6962 2063 6f64 6520 2020 203c 2f74 ZLib code
    #WITH_NONAMESPA │ │ │ │ +00133900: 4345 533c 2f63 6f64 653e 2020 203c 2f74 CES disables dep │ │ │ │ +00133940: 656e 6465 6e63 6520 6f6e 2067 6c6f 6261 endence on globa │ │ │ │ +00133950: 6c20 3c63 6f64 653e 6e61 6d65 7370 6163 l namespac │ │ │ │ +00133960: 6573 3c2f 636f 6465 3e20 7461 626c 652c es table, │ │ │ │ +00133970: 2061 2074 6162 6c65 206d 7573 7420 6265 a table must be │ │ │ │ +00133980: 2073 6574 2065 7870 6c69 6369 746c 7920 set explicitly │ │ │ │ +00133990: 7769 7468 203c 636f 6465 3e3c 6120 636c with soap_ │ │ │ │ +00133a60: 7365 745f 6e61 6d65 7370 6163 6573 3c2f set_namespaces see al │ │ │ │ +00133a80: 736f 2053 6563 7469 6f6e 203c 6120 636c so Section XML namespace │ │ │ │ +00133ac0: 7320 616e 6420 7468 6520 6e61 6d65 7370 s and the namesp │ │ │ │ +00133ad0: 6163 6520 6d61 7070 696e 6720 7461 626c ace mapping tabl │ │ │ │ +00133ae0: 653c 2f61 3e20 2020 203c 2f74 643e 3c2f e
    #W │ │ │ │ +00133b40: 4954 485f 4344 4154 413c 2f63 6f64 653e ITH_CDATA │ │ │ │ +00133b50: 2020 203c 2f74 643e 3c74 6420 636c 6173 retain │ │ │ │ +00133b80: 7320 7468 6520 7061 7273 6564 2043 4441 s the parsed CDA │ │ │ │ +00133b90: 5441 2073 6563 7469 6f6e 7320 696e 206c TA sections in l │ │ │ │ +00133ba0: 6974 6572 616c 2058 4d4c 2073 7472 696e iteral XML strin │ │ │ │ +00133bb0: 6773 2020 2020 3c2f 7464 3e3c 2f74 723e gs
    #WITH_ │ │ │ │ +00133c10: 5055 5245 5f56 4952 5455 414c 3c2f 636f PURE_VIRTUAL ena │ │ │ │ +00133c50: 626c 6573 2043 2b2b 2061 6273 7472 6163 bles C++ abstrac │ │ │ │ +00133c60: 7420 7365 7276 6963 6520 636c 6173 7365 t service classe │ │ │ │ +00133c70: 7320 7769 7468 2070 7572 6520 7669 7274 s with pure virt │ │ │ │ +00133c80: 7561 6c20 6d65 7468 6f64 732c 2072 6571 ual methods, req │ │ │ │ +00133c90: 7569 7265 7320 736f 6170 6370 7032 206f uires soapcpp2 o │ │ │ │ +00133ca0: 7074 696f 6e20 3c63 6f64 653e 2d69 3c2f ption -i or - │ │ │ │ +00133cc0: 6a3c 2f63 6f64 653e 2020 2020 3c2f 7464 j
    #WITH_DEFAULT_V │ │ │ │ +00133d30: 4952 5455 414c 3c2f 636f 6465 3e20 2020 IRTUAL │ │ │ │ +00133d40: 3c2f 7464 3e3c 7464 2063 6c61 7373 3d22 enables C │ │ │ │ +00133d70: 2b2b 2062 6173 6520 7365 7276 6963 6520 ++ base service │ │ │ │ +00133d80: 636c 6173 7365 7320 7769 7468 2064 6566 classes with def │ │ │ │ +00133d90: 6175 6c74 2076 6972 7475 616c 206d 6574 ault virtual met │ │ │ │ +00133da0: 686f 6473 2072 6574 7572 6e69 6e67 2066 hods returning f │ │ │ │ +00133db0: 6175 6c74 203c 636f 6465 3e23 534f 4150 ault #SOAP │ │ │ │ +00133dc0: 5f4e 4f5f 4d45 5448 4f44 3c2f 636f 6465 _NO_METHOD, requires soap │ │ │ │ +00133de0: 6370 7032 206f 7074 696f 6e20 3c63 6f64 cpp2 option -i or < │ │ │ │ +00133e00: 636f 6465 3e2d 6a3c 2f63 6f64 653e 2020 code>-j │ │ │ │ +00133e10: 2020 3c2f 7464 3e3c 2f74 723e 0a3c 7472
    #WI │ │ │ │ +00133f30: 5448 5f53 4f43 4b45 545f 434c 4f53 455f TH_SOCKET_CLOSE_ │ │ │ │ +00133f40: 4f4e 5f45 5849 543c 2f63 6f64 653e 2020 ON_EXIT │ │ │ │ +00133f50: 203c 2f74 643e 3c74 6420 636c 6173 733d prevents │ │ │ │ +00133f80: 2061 2073 6572 7665 7220 706f 7274 2066 a server port f │ │ │ │ +00133f90: 726f 6d20 7374 6179 696e 6720 696e 206c rom staying in l │ │ │ │ +00133fa0: 6973 7465 6e69 6e67 206d 6f64 6520 6166 istening mode af │ │ │ │ +00133fb0: 7465 7220 6578 6974 2062 7920 696e 7465 ter exit by inte │ │ │ │ +00133fc0: 726e 616c 6c79 2073 6574 7469 6e67 203c rnally setting < │ │ │ │ +00133fd0: 636f 6465 3e66 636e 746c 2873 6f63 6b2c code>fcntl(sock, │ │ │ │ +00133fe0: 2046 5f53 4554 4644 2c20 4644 5f43 4c4f F_SETFD, FD_CLO │ │ │ │ +00133ff0: 4558 4543 293c 2f63 6f64 653e 2020 2020 EXEC) │ │ │ │ +00134000: 3c2f 7464 3e3c 2f74 723e 0a3c 7472 2063
    #WITH_TCPFIN │ │ │ │ +00134060: 3c2f 636f 6465 3e20 2020 3c2f 7464 3e3c
    #WITH_SELF_PI │ │ │ │ +00134130: 5045 3c2f 636f 6465 3e20 2020 3c2f 7464 PE enables a "se │ │ │ │ +00134170: 6c66 2070 6970 6522 2074 6f20 656e 6162 lf pipe" to enab │ │ │ │ +00134180: 6c65 2074 6865 203c 636f 6465 3e3c 6120 le the soap_close_c │ │ │ │ +00134230: 6f6e 6e65 6374 696f 6e3c 2f61 3e3c 2f63 onnection function (g │ │ │ │ +00134250: 534f 4150 2032 2e38 2e37 3120 6f72 2067 SOAP 2.8.71 or g │ │ │ │ +00134260: 7265 6174 6572 2920 2020 3c2f 7464 3e3c reater)
    .

    The following s │ │ │ │ +00134290: 7562 7365 7420 6f66 206d 6163 726f 7320 ubset of macros │ │ │ │ +001342a0: 6172 6520 6465 6669 6e65 6420 696e 2074 are defined in t │ │ │ │ +001342b0: 6865 2041 5049 2064 6f63 756d 656e 7461 he API documenta │ │ │ │ +001342c0: 7469 6f6e 204d 6f64 756c 6520 3c61 2063 tion Module SOAP_MA │ │ │ │ +00134300: 4352 4f20 636f 6d70 696c 652d 7469 6d65 CRO compile-time │ │ │ │ +00134310: 2076 616c 7565 733c 2f61 3e2e 2054 6865 values. The │ │ │ │ +00134320: 7365 206d 6163 726f 7320 6172 6520 7573 se macros are us │ │ │ │ +00134330: 6564 2074 6f20 656e 6162 6c65 206f 7220 ed to enable or │ │ │ │ +00134340: 6469 7361 626c 6520 6665 6174 7572 6573 disable features │ │ │ │ +00134350: 2061 7320 7370 6563 6966 6965 6420 6265 as specified be │ │ │ │ +00134360: 6c6f 772c 2062 7920 636f 6d70 696c 696e low, by compilin │ │ │ │ +00134370: 6720 736f 7572 6365 2063 6f64 6520 6669 g source code fi │ │ │ │ +00134380: 6c65 7320 7769 7468 2063 6f6d 7069 6c65 les with compile │ │ │ │ +00134390: 7220 6f70 7469 6f6e 203c 623e 3c63 6f64 r option -D │ │ │ │ +001343b0: 746f 2073 6574 2074 6865 206d 6163 726f to set the macro │ │ │ │ +001343c0: 3a3c 2f70 3e0a 3c74 6162 6c65 2063 6c61 :

    .....< │ │ │ │ +001344d0: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ │ +001344e0: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ │ +001344f0: 3e65 7870 616e 6473 2074 6f20 3c63 6f64 >expands to (std::nothrow) │ │ │ │ +00134510: 3c2f 636f 6465 3e20 746f 2070 7265 7665 to preve │ │ │ │ +00134520: 6e74 206d 656d 6f72 7920 616c 6c6f 6361 nt memory alloca │ │ │ │ +00134530: 7469 6f6e 2065 7863 6570 7469 6f6e 7320 tion exceptions │ │ │ │ +00134540: 283c 636f 6465 3e23 534f 4150 5f45 4f4d (#SOAP_EOM │ │ │ │ +00134550: 3c2f 636f 6465 3e20 6973 2075 7365 6420 is used │ │ │ │ +00134560: 696e 7374 6561 6429 2c20 7468 6973 206d instead), this m │ │ │ │ +00134570: 6163 726f 2063 616e 2062 6520 6368 616e acro can be chan │ │ │ │ +00134580: 6765 6420 2020 203c 2f74 643e 3c2f 7472 ged ..< │ │ │ │ +00134670: 2f74 723e 0a3c 7472 2063 6c61 7373 3d22 /tr>.... │ │ │ │ +00134770: 3c63 6f64 653e 2353 4f41 505f 5441 474c #SOAP_TAGL │ │ │ │ +00134780: 454e 3c2f 636f 6465 3e20 2020 3c2f 7464 EN .... │ │ │ │ +00134960: 7468 6520 6d61 7869 6d75 6d20 7369 7a65 the maximum size │ │ │ │ +00134970: 206f 6620 6120 626c 6f63 6b20 6f66 206d of a block of m │ │ │ │ +00134980: 656d 6f72 7920 7468 6174 203c 636f 6465 emory that malloc c │ │ │ │ +001349a0: 616e 2061 6c6c 6f63 6174 6520 2020 203c an allocate < │ │ │ │ +001349b0: 2f74 643e 3c2f 7472 3e0a 3c74 7220 636c /td>......< │ │ │ │ +00134bd0: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ │ +00134be0: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ │ +00134bf0: 3e6d 6178 696d 756d 206e 756d 6265 7220 >maximum number │ │ │ │ +00134c00: 6f66 2045 494e 5452 2069 6e74 6572 7275 of EINTR interru │ │ │ │ +00134c10: 7074 7320 746f 2069 676e 6f72 6520 7768 pts to ignore wh │ │ │ │ +00134c20: 696c 6520 706f 6c6c 696e 6720 6120 736f ile polling a so │ │ │ │ +00134c30: 636b 6574 2066 6f72 2070 656e 6469 6e67 cket for pending │ │ │ │ +00134c40: 2061 6374 6976 6974 7920 2020 203c 2f74 activity ..< │ │ │ │ +00134d20: 2f74 723e 0a3c 7472 2063 6c61 7373 3d22 /tr>..< │ │ │ │ +00134d90: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ │ +00134da0: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ │ +00134db0: 3e6d 6178 696d 756d 2069 7465 7261 7469 >maximum iterati │ │ │ │ +00134dc0: 6f6e 7320 696e 2074 6865 203c 636f 6465 ons in the │ │ │ │ +00134e40: 736f 6170 5f73 6572 7665 3c2f 613e 3c2f soap_serve loop on HT │ │ │ │ +00134e60: 5450 206b 6565 702d 616c 6976 6520 636f TP keep-alive co │ │ │ │ +00134e70: 6e6e 6563 7469 6f6e 7320 2020 203c 2f74 nnections .. │ │ │ │ +00134ef0: 3c74 6420 636c 6173 733d 226d 6172 6b64 ........ │ │ │ │ +001352a0: 3c63 6f64 653e 2353 4f41 505f 5055 5245 #SOAP_PURE │ │ │ │ +001352b0: 5f56 4952 5455 414c 3c2f 636f 6465 3e20 _VIRTUAL │ │ │ │ +001352c0: 2020 3c2f 7464 3e3c 7464 2063 6c61 7373 .< │ │ │ │ +00135340: 7472 2063 6c61 7373 3d22 6d61 726b 646f tr class="markdo │ │ │ │ +00135350: 776e 5461 626c 6552 6f77 4f64 6422 3e0a wnTableRowOdd">. │ │ │ │ +00135360: 3c74 6420 636c 6173 733d 226d 6172 6b64 │ │ │ │ +00135400: 0a3c 7472 2063 6c61 7373 3d22 6d61 726b ..< │ │ │ │ +00135520: 2f74 723e 0a3c 7472 2063 6c61 7373 3d22 /tr>......< │ │ │ │ +001357d0: 2f74 723e 0a3c 7472 2063 6c61 7373 3d22 /tr>....
    │ │ │ │ +001359c0: 3c64 743e 5761 726e 696e 673c 2f64 743e
    Warning
    │ │ │ │ +001359d0: 3c64 643e 4974 2069 7320 696d 706f 7274
    It is import │ │ │ │ +001359e0: 616e 7420 7468 6174 2061 6e79 206f 6620 ant that any of │ │ │ │ +001359f0: 7468 6573 6520 6d61 6372 6f73 2077 6865 these macros whe │ │ │ │ +00135a00: 6e20 6465 6669 6e65 6420 7368 6f75 6c64 n defined should │ │ │ │ +00135a10: 2062 6520 636f 6e73 6973 7465 6e74 6c79 be consistently │ │ │ │ +00135a20: 2064 6566 696e 6564 2077 6865 6e20 636f defined when co │ │ │ │ +00135a30: 6d70 696c 696e 6720 736f 7572 6365 2063 mpiling source c │ │ │ │ +00135a40: 6f64 6520 6669 6c65 732c 2073 7563 6820 ode files, such │ │ │ │ +00135a50: 6173 203c 656d 3e3c 636f 6465 3e67 736f as gso │ │ │ │ +00135a60: 6170 2f73 7464 736f 6170 322e 6370 703c ap/stdsoap2.cpp< │ │ │ │ +00135a70: 2f63 6f64 653e 3c2f 656d 3e2c 203c 656d /code>, soapC.cpp │ │ │ │ +00135a90: 3c2f 636f 6465 3e3c 2f65 6d3e 2c20 3c65 , soapClie │ │ │ │ +00135ab0: 6e74 2e63 7070 3c2f 636f 6465 3e3c 2f65 nt.cpp, so │ │ │ │ +00135ad0: 6170 5365 7276 6572 2e63 7070 3c2f 636f apServer.cpp, and al │ │ │ │ +00135af0: 6c20 6170 706c 6963 6174 696f 6e20 736f l application so │ │ │ │ +00135b00: 7572 6365 2063 6f64 6520 6669 6c65 7320 urce code files │ │ │ │ +00135b10: 7468 6174 2069 6e63 6c75 6465 203c 656d that include gsoap/std │ │ │ │ +00135b30: 736f 6170 322e 683c 2f63 6f64 653e 3c2f soap2.h or soapH.h< │ │ │ │ +00135b60: 2f65 6d3e 2e20 4966 2074 6865 206d 6163 /em>. If the mac │ │ │ │ +00135b70: 726f 7320 6172 6520 6e6f 7420 636f 6e73 ros are not cons │ │ │ │ +00135b80: 6973 7465 6e74 6c79 2064 6566 696e 6564 istently defined │ │ │ │ +00135b90: 2061 7420 636f 6d70 696c 6520 7469 6d65 at compile time │ │ │ │ +00135ba0: 2074 6865 6e20 7468 6520 6170 706c 6963 then the applic │ │ │ │ +00135bb0: 6174 696f 6e20 7769 6c6c 206c 696b 656c ation will likel │ │ │ │ +00135bc0: 7920 6372 6173 6820 6475 6520 746f 2061 y crash due to a │ │ │ │ +00135bd0: 206d 6973 6d61 7463 6865 7320 696e 2074 mismatches in t │ │ │ │ +00135be0: 6865 2064 6563 6c61 7261 7469 6f6e 2061 he declaration a │ │ │ │ +00135bf0: 6e64 2075 7365 206f 6620 7468 6520 3c63 nd use of the │ │ │ │ +00135c50: 736f 6170 3c2f 613e 3c2f 636f 6465 3e20 soap │ │ │ │ +00135c60: 636f 6e74 6578 7420 7468 6174 2069 7320 context that is │ │ │ │ +00135c70: 6375 7374 6f6d 697a 6564 2062 7920 7468 customized by th │ │ │ │ +00135c80: 6573 6520 666c 6167 732e 3c2f 6464 3e3c ese flags.
    < │ │ │ │ +00135c90: 2f64 6c3e 0a3c 703e f09f 949d 203c 6120 /dl>.

    .... Back to │ │ │ │ +00135cb0: 2074 6162 6c65 206f 6620 636f 6e74 656e table of conten │ │ │ │ +00135cc0: 7473 3c2f 613e 3c2f 703e 0a3c 6832 3e3c ts

    .

    < │ │ │ │ +00135cd0: 6120 636c 6173 733d 2261 6e63 686f 7222 a class="anchor" │ │ │ │ +00135ce0: 2069 643d 2273 6f61 7064 6566 7322 3e3c id="soapdefs">< │ │ │ │ +00135cf0: 2f61 3e0a 5573 696e 6720 7468 6520 736f /a>.Using the so │ │ │ │ +00135d00: 6170 6465 6673 2e68 2068 6561 6465 7220 apdefs.h header │ │ │ │ +00135d10: 6669 6c65 3c2f 6832 3e0a 3c70 3e54 6865 file

    .

    The │ │ │ │ +00135d20: 203c 656d 3e3c 636f 6465 3e73 6f61 7064 soapd │ │ │ │ +00135d30: 6566 732e 683c 2f63 6f64 653e 3c2f 656d efs.h header file is │ │ │ │ +00135d50: 2069 6e63 6c75 6465 6420 696e 203c 656d included in gsoap/std │ │ │ │ +00135d70: 736f 6170 322e 683c 2f63 6f64 653e 3c2f soap2.h when compili │ │ │ │ +00135d90: 6e67 2077 6974 6820 636f 6d70 696c 652d ng with compile- │ │ │ │ +00135da0: 7469 6d65 2066 6c61 6720 3c63 6f64 653e time flag │ │ │ │ +00135db0: 2357 4954 485f 534f 4150 4445 4653 5f48 #WITH_SOAPDEFS_H │ │ │ │ +00135dc0: 3c2f 636f 6465 3e3a 203c 2f70 3e3c 7072 :

    c++ -D WITH_ │ │ │ │ +00135df0: 534f 4150 4445 4653 5f48 202d 6320 7374 SOAPDEFS_H -c st │ │ │ │ +00135e00: 6473 6f61 7032 2e63 7070 0a3c 2f70 7265 dsoap2.cpp.

    The soapdefs.h file a │ │ │ │ +00135e40: 6c6c 6f77 7320 7573 6572 7320 746f 2069 llows users to i │ │ │ │ +00135e50: 6e63 6c75 6465 2064 6566 696e 6974 696f nclude definitio │ │ │ │ +00135e60: 6e73 2061 6e64 2061 6464 2069 6e63 6c75 ns and add inclu │ │ │ │ +00135e70: 6465 7320 7769 7468 6f75 7420 7265 7175 des without requ │ │ │ │ +00135e80: 6972 696e 6720 6368 616e 6765 7320 746f iring changes to │ │ │ │ +00135e90: 203c 656d 3e3c 636f 6465 3e67 736f 6170 gsoap │ │ │ │ +00135ea0: 2f73 7464 736f 6170 322e 683c 2f63 6f64 /stdsoap2.h. You can │ │ │ │ +00135ec0: 2061 6c73 6f20 7370 6563 6966 7920 7468 also specify th │ │ │ │ +00135ed0: 6520 6865 6164 6572 2066 696c 6520 6e61 e header file na │ │ │ │ +00135ee0: 6d65 2074 6f20 696e 636c 7564 6520 6173 me to include as │ │ │ │ +00135ef0: 2061 206d 6163 726f 203c 636f 6465 3e53 a macro S │ │ │ │ +00135f00: 4f41 5044 4546 535f 483c 2f63 6f64 653e OAPDEFS_H │ │ │ │ +00135f10: 2074 6f20 6f76 6572 7269 6465 2074 6865 to override the │ │ │ │ +00135f20: 206e 616d 6520 3c65 6d3e 3c63 6f64 653e name │ │ │ │ +00135f30: 736f 6170 6465 6673 2e68 3c2f 636f 6465 soapdefs.h:

     c++ -D SOAPDE
    │ │ │ │ +00135f70: 4653 5f48 3d6d 7964 6566 732e 6820 2d63  FS_H=mydefs.h -c
    │ │ │ │ +00135f80: 2073 7464 736f 6170 322e 6370 700a 3c2f   stdsoap2.cpp.

    For exam │ │ │ │ +00135fa0: 706c 652c 3c2f 703e 0a3c 6469 7620 636c ple,

    .
    < │ │ │ │ +00135fc0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00135fd0: 3e3c 7370 616e 2063 6c61 7373 3d22 636f >// Conten │ │ │ │ +00135ff0: 7473 206f 6620 6669 6c65 2026 7175 6f74 ts of file " │ │ │ │ +00136000: 3b73 6f61 7064 6566 732e 6826 7175 6f74 ;soapdefs.h" │ │ │ │ +00136010: 3b3c 2f73 7061 6e3e 3c2f 6469 763e 0a3c ;
    .< │ │ │ │ +00136020: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00136030: 3e3c 7370 616e 2063 6c61 7373 3d22 7072 >#inc │ │ │ │ +00136050: 6c75 6465 2026 6c74 3b6f 7374 7265 616d lude <ostream │ │ │ │ +00136060: 2667 743b 3c2f 7370 616e 3e20 3c2f 6469 > .

    The │ │ │ │ +00136090: 2066 6f6c 6c6f 7769 6e67 2068 6561 6465 following heade │ │ │ │ +001360a0: 7220 6669 6c65 2066 6f72 2073 6f61 7063 r file for soapc │ │ │ │ +001360b0: 7070 3220 7265 6665 7273 2074 6f20 3c63 pp2 refers to std::ostream │ │ │ │ +001360d0: 3c2f 636f 6465 3e20 7769 7468 6f75 7420 without │ │ │ │ +001360e0: 736f 6170 6370 7032 2074 6872 6f77 696e soapcpp2 throwin │ │ │ │ +001360f0: 6720 6572 726f 7273 2c20 6279 2075 7369 g errors, by usi │ │ │ │ +00136100: 6e67 203c 636f 6465 3e65 7874 6572 6e3c ng extern< │ │ │ │ +00136110: 2f63 6f64 653e 2074 6f20 6465 636c 6172 /code> to declar │ │ │ │ +00136120: 6520 3c63 6f64 653e 636c 6173 7320 7374 e class st │ │ │ │ +00136130: 643a 3a6f 7374 7265 616d 3c2f 636f 6465 d::ostream:

    .
    < │ │ │ │ +00136170: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ +00136180: 656e 7422 3e2f 2f20 7374 643a 3a6f 7374 ent">// std::ost │ │ │ │ +00136190: 7265 616d 2063 616e 2623 3339 3b74 2062 ream can't b │ │ │ │ +001361a0: 6520 7365 7269 616c 697a 6564 2c20 6275 e serialized, bu │ │ │ │ +001361b0: 7420 6e65 6564 2074 6f20 6265 2064 6563 t need to be dec │ │ │ │ +001361c0: 6c61 7265 6420 746f 206d 616b 6520 6974 lared to make it │ │ │ │ +001361d0: 2076 6973 6962 6c65 2074 6f20 6753 4f41 visible to gSOA │ │ │ │ +001361e0: 5020 3c2f 7370 616e 3e3c 2f64 6976 3e0a P
    . │ │ │ │ +001361f0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    extern clas │ │ │ │ +00136240: 7320 3c2f 7370 616e 3e73 7464 3a3a 6f73 s std::os │ │ │ │ +00136250: 7472 6561 6d3b 3c2f 6469 763e 0a3c 6469 tream;
    . │ │ │ │ +00136270: 3c2f 6469 763e 0a3c 6469 7620 636c 6173 .
    c │ │ │ │ +001362a0: 6c61 7373 203c 2f73 7061 6e3e 6e73 5f5f lass ns__ │ │ │ │ +001362b0: 6d79 436c 6173 7320 3c2f 6469 763e 0a3c myClass
    .< │ │ │ │ +001362c0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +001362d0: 3e7b 203c 7370 616e 2063 6c61 7373 3d22 >{ public< │ │ │ │ +001362f0: 2f73 7061 6e3e 3a3c 2f64 6976 3e0a 3c64 /span>:. │ │ │ │ +00136310: 2020 2020 3c73 7061 6e20 636c 6173 733d virtua │ │ │ │ +00136330: 6c3c 2f73 7061 6e3e 203c 7370 616e 2063 l void p │ │ │ │ +00136360: 7269 6e74 2873 7464 3a3a 6f73 7472 6561 rint(std::ostrea │ │ │ │ +00136370: 6d20 2661 6d70 3b73 2920 3c73 7061 6e20 m &s) │ │ │ │ +00136390: 636f 6e73 743c 2f73 7061 6e3e 3b20 3c73 const; // we need s │ │ │ │ +001363c0: 7464 3a3a 6f73 7472 6561 6d20 6865 7265 td::ostream here │ │ │ │ +001363d0: 203c 2f73 7061 6e3e 3c2f 6469 763e 0a3c .< │ │ │ │ +001363e0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +001363f0: 3e20 2020 202e 2e2e 203c 7370 616e 2063 > ... / │ │ │ │ +00136410: 2f3c 2f73 7061 6e3e 3c2f 6469 763e 0a3c /.< │ │ │ │ +00136420: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00136430: 3e7d 3b3c 2f64 6976 3e0a 3c2f 6469 763e >};. │ │ │ │ +00136440: 3c21 2d2d 2066 7261 676d 656e 7420 2d2d

    To initia │ │ │ │ +00138bd0: 6c69 7a65 2061 2073 7461 636b 2d61 6c6c lize a stack-all │ │ │ │ +00138be0: 6f63 6174 6564 203c 636f 6465 3e3c 6120 ocated soap context │ │ │ │ +00138c50: 2077 6974 6820 696e 7075 7420 616e 6420 with input and │ │ │ │ +00138c60: 6f75 7470 7574 206d 6f64 6520 666c 6167 output mode flag │ │ │ │ +00138c70: 733a 3c2f 703e 0a3c 6469 7620 636c 6173 s:

    .
    < │ │ │ │ +00138ca0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +00138cb0: 6f72 6474 7970 6522 3e76 6f69 643c 2f73 ordtype">void soap_i │ │ │ │ +00138d20: 6e69 7431 3c2f 613e 283c 7370 616e 2063 nit1(s │ │ │ │ +00138d40: 7472 7563 743c 2f73 7061 6e3e 203c 6120 truct soap *soap, < │ │ │ │ +00138db0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +00138dc0: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ │ +00138dd0: 705f 5f66 6c61 6773 2e68 746d 6c23 6761 p__flags.html#ga │ │ │ │ +00138de0: 3732 6230 3439 3163 3963 6266 3230 3731 72b0491c9cbf2071 │ │ │ │ +00138df0: 6630 6339 3663 3764 3239 6237 3139 6262 f0c96c7d29b719bb │ │ │ │ +00138e00: 223e 736f 6170 5f6d 6f64 653c 2f61 3e20 ">soap_mode │ │ │ │ +00138e10: 696f 6d6f 6465 293b 3c2f 6469 763e 0a3c iomode);
    .< │ │ │ │ +00138e20: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00138e30: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >void< │ │ │ │ +00138e50: 2f73 7061 6e3e 203c 6120 636c 6173 733d /span> soap │ │ │ │ +00138eb0: 5f69 6e69 7432 3c2f 613e 283c 7370 616e _init2(struct < │ │ │ │ +00138ee0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +00138ef0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ +00138f00: 6874 6d6c 223e 736f 6170 3c2f 613e 202a html">soap * │ │ │ │ +00138f10: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap, │ │ │ │ +00138f40: 203c 6120 636c 6173 733d 2263 6f64 6522 soap_mode imode │ │ │ │ +00138ff0: 3c2f 613e 2c20 3c61 2063 6c61 7373 3d22 , soap_mo │ │ │ │ +00139050: 6465 3c2f 613e 203c 6120 636c 6173 733d de │ │ │ │ +001390a0: 6f6d 6f64 653c 2f61 3e29 3b3c 2f64 6976 omode);.
    void │ │ │ │ +00139190: 736f 6170 5f69 6e69 7432 2873 7472 7563 soap_init2(struc │ │ │ │ +001391a0: 7420 736f 6170 202a 736f 6170 2c20 736f t soap *soap, so │ │ │ │ +001391b0: 6170 5f6d 6f64 6520 696e 7075 745f 6d6f ap_mode input_mo │ │ │ │ +001391c0: 6465 2c20 736f 6170 5f6d 6f64 6520 6f75 de, soap_mode ou │ │ │ │ +001391d0: 7470 7574 5f6d 6f64 6529 3c2f 6469 763e tput_mode)
    │ │ │ │ +001391e0: 3c64 6976 2063 6c61 7373 3d22 7474 646f
    Initialize a │ │ │ │ +00139200: 7374 6163 6b2d 616c 6c6f 6361 7465 6420 stack-allocated │ │ │ │ +00139210: 736f 6170 2063 6f6e 7465 7874 2077 6974 soap context wit │ │ │ │ +00139220: 6820 696e 7075 7420 616e 6420 6f75 7470 h input and outp │ │ │ │ +00139230: 7574 2073 6f61 705f 6d6f 6465 2066 6c61 ut soap_mode fla │ │ │ │ +00139240: 6773 2e3c 2f64 6976 3e3c 2f64 6976 3e0a gs.
    . │ │ │ │ +00139250: 3c2f 6469 763e 3c21 2d2d 2066 7261 676d

    To set │ │ │ │ +00139270: 2061 6e64 2063 6c65 6172 206d 6f64 6520 and clear mode │ │ │ │ +00139280: 666c 6167 7320 7573 653a 3c2f 703e 0a3c flags use:

    .< │ │ │ │ +00139290: 6469 7620 636c 6173 733d 2266 7261 676d div class="fragm │ │ │ │ +001392a0: 656e 7422 3e3c 6469 7620 636c 6173 733d ent">
    void soap_set_mode< │ │ │ │ +00139340: 2f61 3e28 3c73 7061 6e20 636c 6173 733d /a>(struct │ │ │ │ +00139360: 3c2f 7370 616e 3e20 3c61 2063 6c61 7373 s │ │ │ │ +00139390: 6f61 703c 2f61 3e20 2a3c 6120 636c 6173 oap * │ │ │ │ +001393c0: 736f 6170 3c2f 613e 2c20 3c61 2063 6c61 soap, soa │ │ │ │ +00139420: 705f 6d6f 6465 3c2f 613e 2069 6f6d 6f64 p_mode iomod │ │ │ │ +00139430: 6529 3b20 3c73 7061 6e20 636c 6173 733d e); // set │ │ │ │ +00139450: 2069 6e70 7574 2061 6e64 206f 7574 7075 input and outpu │ │ │ │ +00139460: 7420 6d6f 6465 2066 6c61 6773 3c2f 7370 t mode flags
    .
    void soap_set_ │ │ │ │ +00139510: 696d 6f64 653c 2f61 3e28 3c73 7061 6e20 imode( │ │ │ │ +00139530: 7374 7275 6374 3c2f 7370 616e 3e20 3c61 struct soap *< │ │ │ │ +00139570: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +00139580: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ +00139590: 6874 6d6c 223e 736f 6170 3c2f 613e 2c20 html">soap, │ │ │ │ +001395a0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap_mode │ │ │ │ +00139600: 203c 6120 636c 6173 733d 2263 6f64 6522 imode< │ │ │ │ +00139650: 2f61 3e29 3b20 3c73 7061 6e20 636c 6173 /a>); // s │ │ │ │ +00139670: 6574 2069 6e70 7574 206d 6f64 6520 666c et input mode fl │ │ │ │ +00139680: 6167 733c 2f73 7061 6e3e 3c2f 6469 763e ags
    │ │ │ │ +00139690: 0a3c 6469 7620 636c 6173 733d 226c 696e ..
    void │ │ │ │ +001398e0: 203c 6120 636c 6173 733d 2263 6f64 6522 soap_clr_m │ │ │ │ +00139940: 6f64 653c 2f61 3e28 3c73 7061 6e20 636c ode(st │ │ │ │ +00139960: 7275 6374 3c2f 7370 616e 3e20 3c61 2063 ruct soap *soap, soap_mode i │ │ │ │ +00139a30: 6f6d 6f64 6529 3b20 3c73 7061 6e20 636c omode); // │ │ │ │ +00139a50: 2063 6c65 6172 2069 6e70 7574 2061 6e64 clear input and │ │ │ │ +00139a60: 206f 7574 7075 7420 6d6f 6465 2066 6c61 output mode fla │ │ │ │ +00139a70: 6773 3c2f 7370 616e 3e3c 2f64 6976 3e0a gs
    . │ │ │ │ +00139a80: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65 .
    void │ │ │ │ +00139cd0: 203c 6120 636c 6173 733d 2263 6f64 6522 soap_clr_o │ │ │ │ +00139d30: 6d6f 6465 3c2f 613e 283c 7370 616e 2063 mode(s │ │ │ │ +00139d50: 7472 7563 743c 2f73 7061 6e3e 203c 6120 truct soap *soap, < │ │ │ │ +00139dc0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +00139dd0: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ │ +00139de0: 705f 5f66 6c61 6773 2e68 746d 6c23 6761 p__flags.html#ga │ │ │ │ +00139df0: 3732 6230 3439 3163 3963 6266 3230 3731 72b0491c9cbf2071 │ │ │ │ +00139e00: 6630 6339 3663 3764 3239 6237 3139 6262 f0c96c7d29b719bb │ │ │ │ +00139e10: 223e 736f 6170 5f6d 6f64 653c 2f61 3e20 ">soap_mode │ │ │ │ +00139e20: 3c61 2063 6c61 7373 3d22 636f 6465 2220 omode); // cl │ │ │ │ +00139e90: 6561 7220 6f75 7470 7574 206d 6f64 6520 ear output mode │ │ │ │ +00139ea0: 666c 6167 733c 2f73 7061 6e3e 3c2f 6469 flags.
    v │ │ │ │ +00139f90: 6f69 6420 736f 6170 5f63 6c72 5f6d 6f64 oid soap_clr_mod │ │ │ │ +00139fa0: 6528 7374 7275 6374 2073 6f61 7020 2a73 e(struct soap *s │ │ │ │ +00139fb0: 6f61 702c 2073 6f61 705f 6d6f 6465 2069 oap, soap_mode i │ │ │ │ +00139fc0: 6e70 7574 5f61 6e64 5f6f 7574 7075 745f nput_and_output_ │ │ │ │ +00139fd0: 6d6f 6465 293c 2f64 6976 3e3c 6469 7620 mode)
    Cl │ │ │ │ +00139ff0: 6561 7220 696e 7075 7420 616e 6420 6f75 ear input and ou │ │ │ │ +0013a000: 7470 7574 2073 6f61 705f 6d6f 6465 2066 tput soap_mode f │ │ │ │ +0013a010: 6c61 6773 206f 6620 7468 6520 6769 7665 lags of the give │ │ │ │ +0013a020: 6e20 736f 6170 2063 6f6e 7465 7874 2e3c n soap context.< │ │ │ │ +0013a030: 2f64 6976 3e3c 2f64 6976 3e0a 3c64 6976 /div>
    .
    soa │ │ │ │ +0013a0f0: 705f 636c 725f 696d 6f64 653c 2f61 3e3c p_clr_imode< │ │ │ │ +0013a100: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
    void so │ │ │ │ +0013a120: 6170 5f63 6c72 5f69 6d6f 6465 2873 7472 ap_clr_imode(str │ │ │ │ +0013a130: 7563 7420 736f 6170 202a 736f 6170 2c20 uct soap *soap, │ │ │ │ +0013a140: 736f 6170 5f6d 6f64 6520 696e 7075 745f soap_mode input_ │ │ │ │ +0013a150: 6d6f 6465 293c 2f64 6976 3e3c 6469 7620 mode)
    Cl │ │ │ │ +0013a170: 6561 7220 696e 7075 7420 736f 6170 5f6d ear input soap_m │ │ │ │ +0013a180: 6f64 6520 666c 6167 7320 6f66 2074 6865 ode flags of the │ │ │ │ +0013a190: 2067 6976 656e 2073 6f61 7020 636f 6e74 given soap cont │ │ │ │ +0013a1a0: 6578 742e 3c2f 6469 763e 3c2f 6469 763e ext.
    │ │ │ │ +0013a1b0: 0a3c 6469 7620 636c 6173 733d 2274 7463 .
    vo │ │ │ │ +0013a290: 6964 2073 6f61 705f 636c 725f 6f6d 6f64 id soap_clr_omod │ │ │ │ +0013a2a0: 6528 7374 7275 6374 2073 6f61 7020 2a73 e(struct soap *s │ │ │ │ +0013a2b0: 6f61 702c 2073 6f61 705f 6d6f 6465 206f oap, soap_mode o │ │ │ │ +0013a2c0: 7574 7075 745f 6d6f 6465 293c 2f64 6976 utput_mode)
    Clear output │ │ │ │ +0013a2f0: 2073 6f61 705f 6d6f 6465 2066 6c61 6773 soap_mode flags │ │ │ │ +0013a300: 206f 6620 7468 6520 6769 7665 6e20 736f of the given so │ │ │ │ +0013a310: 6170 2063 6f6e 7465 7874 2e3c 2f64 6976 ap context.
    .
    void soap_s │ │ │ │ +0013a410: 6574 5f69 6d6f 6465 2873 7472 7563 7420 et_imode(struct │ │ │ │ +0013a420: 736f 6170 202a 736f 6170 2c20 736f 6170 soap *soap, soap │ │ │ │ +0013a430: 5f6d 6f64 6520 696e 7075 745f 6d6f 6465 _mode input_mode │ │ │ │ +0013a440: 293c 2f64 6976 3e3c 6469 7620 636c 6173 )
    Set in │ │ │ │ +0013a460: 7075 7420 736f 6170 5f6d 6f64 6520 666c put soap_mode fl │ │ │ │ +0013a470: 6167 7320 6f66 2074 6865 2067 6976 656e ags of the given │ │ │ │ +0013a480: 2073 6f61 7020 636f 6e74 6578 742e 3c2f soap context.
    .
    │ │ │ │ +0013a4f0: 3c64 6976 2063 6c61 7373 3d22 7474 6e61
    soap │ │ │ │ +0013a550: 5f73 6574 5f6f 6d6f 6465 3c2f 613e 3c2f _set_omode
    void soa │ │ │ │ +0013a580: 705f 7365 745f 6f6d 6f64 6528 7374 7275 p_set_omode(stru │ │ │ │ +0013a590: 6374 2073 6f61 7020 2a73 6f61 702c 2073 ct soap *soap, s │ │ │ │ +0013a5a0: 6f61 705f 6d6f 6465 206f 7574 7075 745f oap_mode output_ │ │ │ │ +0013a5b0: 6d6f 6465 293c 2f64 6976 3e3c 6469 7620 mode)
    Se │ │ │ │ +0013a5d0: 7420 6f75 7470 7574 2073 6f61 705f 6d6f t output soap_mo │ │ │ │ +0013a5e0: 6465 2066 6c61 6773 206f 6620 7468 6520 de flags of the │ │ │ │ +0013a5f0: 6769 7665 6e20 736f 6170 2063 6f6e 7465 given soap conte │ │ │ │ +0013a600: 7874 2e3c 2f64 6976 3e3c 2f64 6976 3e0a xt.
    . │ │ │ │ +0013a610: 3c2f 6469 763e 3c21 2d2d 2066 7261 676d
    │ │ │ │ +0013a640: 3c64 743e 4e6f 7465 3c2f 6474 3e3c 6464
    Note
    The #SOAP │ │ │ │ +0013a660: 5f58 4d4c 5f54 5245 453c 2f63 6f64 653e _XML_TREE │ │ │ │ +0013a670: 206d 6f64 6520 666c 6167 2063 616e 2062 mode flag can b │ │ │ │ +0013a680: 6520 7573 6564 2074 6f20 696d 7072 6f76 e used to improv │ │ │ │ +0013a690: 6520 696e 7465 726f 7065 7261 6269 6c69 e interoperabili │ │ │ │ +0013a6a0: 7479 2077 6974 6820 534f 4150 2069 6d70 ty with SOAP imp │ │ │ │ +0013a6b0: 6c65 6d65 6e74 6174 696f 6e73 2074 6861 lementations tha │ │ │ │ +0013a6c0: 7420 6172 6520 6e6f 7420 6675 6c6c 7920 t are not fully │ │ │ │ +0013a6d0: 534f 4150 2031 2e31 2f31 2e32 2052 5043 SOAP 1.1/1.2 RPC │ │ │ │ +0013a6e0: 2065 6e63 6f64 696e 6720 636f 6d70 6c69 encoding compli │ │ │ │ +0013a6f0: 616e 7420 7769 7468 2072 6573 7065 6374 ant with respect │ │ │ │ +0013a700: 2074 6f20 7072 6f63 6573 7369 6e67 2069 to processing i │ │ │ │ +0013a710: 642d 6872 6566 2f72 6566 2061 7474 7269 d-href/ref attri │ │ │ │ +0013a720: 6275 7465 732e 2048 6f77 6576 6572 2c20 butes. However, │ │ │ │ +0013a730: 7472 6565 2073 6572 6961 6c69 7a61 7469 tree serializati │ │ │ │ +0013a740: 6f6e 2077 696c 6c20 6475 706c 6963 6174 on will duplicat │ │ │ │ +0013a750: 6520 6461 7461 2077 6865 6e20 7468 6973 e data when this │ │ │ │ +0013a760: 2064 6174 6120 6973 2063 6f2d 7265 6665 data is co-refe │ │ │ │ +0013a770: 7265 6e63 6564 2e20 4379 636c 6573 2061 renced. Cycles a │ │ │ │ +0013a780: 7265 2064 6574 6563 7465 6420 616e 6420 re detected and │ │ │ │ +0013a790: 6272 6f6b 656e 2074 6f20 6176 6f69 6420 broken to avoid │ │ │ │ +0013a7a0: 696e 6669 6e69 7465 2073 6572 6961 6c69 infinite seriali │ │ │ │ +0013a7b0: 7a61 7469 6f6e 2e3c 2f64 643e 3c2f 646c zation.
    .

    In addition │ │ │ │ +0013a7d0: 2074 6f20 7468 6520 636f 6e74 6578 7420 to the context │ │ │ │ +0013a7e0: 6d6f 6465 2066 6c61 6773 2c20 7468 6520 mode flags, the │ │ │ │ +0013a7f0: 666f 6c6c 6f77 696e 6720 636f 6e74 6578 following contex │ │ │ │ +0013a800: 7420 666c 6167 7320 6361 6e20 6265 2075 t flags can be u │ │ │ │ +0013a810: 7365 6420 746f 2073 6574 203c 636f 6465 sed to set setsockopt level S │ │ │ │ +0013a840: 4f4c 5f53 4f43 4b45 543c 2f63 6f64 653e OL_SOCKET │ │ │ │ +0013a850: 206f 7074 696f 6e73 2077 6865 6e20 736f options when so │ │ │ │ +0013a860: 636b 6574 7320 6172 6520 6372 6561 7465 ckets are create │ │ │ │ +0013a870: 642c 2074 686f 7567 6820 736f 6d65 206f d, though some o │ │ │ │ +0013a880: 7074 696f 6e73 206d 6179 206e 6f74 2062 ptions may not b │ │ │ │ +0013a890: 6520 6170 706c 6963 6162 6c65 2074 6f20 e applicable to │ │ │ │ +0013a8a0: 796f 7572 206f 7065 7261 7469 6e67 2073 your operating s │ │ │ │ +0013a8b0: 7973 7465 6d3a 3c2f 703e 0a3c 7461 626c ystem:

    ..
    ...< │ │ │ │ +0013aac0: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ │ +0013aad0: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ │ +0013aae0: 3e64 6973 6162 6c65 7320 5349 4750 4950 >disables SIGPIP │ │ │ │ +0013aaf0: 4520 2020 203c 2f74 643e 3c2f 7472 3e0a E . │ │ │ │ +0013ab00: 3c74 7220 636c 6173 733d 226d 6172 6b64 . │ │ │ │ +0013ac40: 3c74 6420 636c 6173 733d 226d 6172 6b64 .< │ │ │ │ +0013acc0: 7472 2063 6c61 7373 3d22 6d61 726b 646f tr class="markdo │ │ │ │ +0013acd0: 776e 5461 626c 6552 6f77 4f64 6422 3e0a wnTableRowOdd">. │ │ │ │ +0013ace0: 3c74 6420 636c 6173 733d 226d 6172 6b64 .. │ │ │ │ +0013aea0: 3c74 6420 636c 6173 733d 226d 6172 6b64 < │ │ │ │ +0013afc0: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ │ +0013afd0: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ │ +0013afe0: 3e73 6574 7320 636c 6965 6e74 2d73 6964 >sets client-sid │ │ │ │ +0013aff0: 6520 6c69 6e67 6572 2074 696d 6520 746f e linger time to │ │ │ │ +0013b000: 2074 6865 2076 616c 7565 206f 6620 3c63 the value of soap │ │ │ │ +0013b0d0: 3a3a 6c69 6e67 6572 5f74 696d 653c 2f61 ::linger_time .... │ │ │ │ +0013b440: 0a3c 7472 2063 6c61 7373 3d22 6d61 726b ..< │ │ │ │ +0013b580: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ │ +0013b590: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ │ +0013b5a0: 3e74 7572 6e73 206f 6e20 7265 636f 7264 >turns on record │ │ │ │ +0013b5b0: 696e 6720 6f66 2064 6562 7567 6769 6e67 ing of debugging │ │ │ │ +0013b5c0: 2069 6e66 6f72 6d61 7469 6f6e 2069 6e20 information in │ │ │ │ +0013b5d0: 7468 6520 756e 6465 726c 7969 6e67 2070 the underlying p │ │ │ │ +0013b5e0: 726f 746f 636f 6c20 6d6f 6475 6c65 7320 rotocol modules │ │ │ │ +0013b5f0: 2020 203c 2f74 643e 3c2f 7472 3e0a 3c74 .. │ │ │ │ +0013b620: 3c74 6420 636c 6173 733d 226d 6172 6b64 │ │ │ │ +0013b760: 7365 7473 2073 6572 7665 722d 7369 6465 sets server-side │ │ │ │ +0013b770: 206c 696e 6765 7220 7469 6d65 2074 6f20 linger time to │ │ │ │ +0013b780: 7468 6520 7661 6c75 6520 6f66 203c 636f the value of soap: │ │ │ │ +0013b850: 3a6c 696e 6765 725f 7469 6d65 3c2f 613e :linger_time │ │ │ │ +0013b860: 3c2f 636f 6465 3e20 2020 203c 2f74 643e │ │ │ │ +0013b870: 3c2f 7472 3e0a 3c74 7220 636c 6173 733d ..< │ │ │ │ +0013ba10: 2f74 723e 0a3c 7472 2063 6c61 7373 3d22 /tr>... │ │ │ │ +0013bbc0: 3c74 7220 636c 6173 733d 226d 6172 6b64 │ │ │ │ +0013bbe0: 0a3c 7464 2063 6c61 7373 3d22 6d61 726b . │ │ │ │ +0013bd00: 3c74 6420 636c 6173 733d 226d 6172 6b64 ..

    For examp │ │ │ │ +0013bd70: 6c65 2c20 7768 656e 203c 636f 6465 3e3c le, when < │ │ │ │ +0013bd80: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ +0013bd90: 663d 2273 7472 7563 7473 6f61 702e 6874 f="structsoap.ht │ │ │ │ +0013bda0: 6d6c 2361 6439 3866 3132 6636 3032 6566 ml#ad98f12f602ef │ │ │ │ +0013bdb0: 6464 6530 3439 6462 6433 3637 6134 3365 dde049dbd367a43e │ │ │ │ +0013bdc0: 3763 6230 2220 7469 746c 653d 2255 7365 7cb0" title="Use │ │ │ │ +0013bdd0: 722d 6465 6669 6e61 626c 6520 7365 7473 r-definable sets │ │ │ │ +0013bde0: 6f63 6b6f 7074 206c 6576 656c 2053 4f4c ockopt level SOL │ │ │ │ +0013bdf0: 5f53 4f43 4b45 5420 666c 6167 7320 2830 _SOCKET flags (0 │ │ │ │ +0013be00: 2062 7920 6465 6661 756c 7429 2c20 7768 by default), wh │ │ │ │ +0013be10: 656e 206e 6f6e 7a65 726f 2073 6574 7320 en nonzero sets │ │ │ │ +0013be20: 7468 6520 736f 6170 3a3a 736f 636b 6574 the soap::socket │ │ │ │ +0013be30: 2066 2e2e 2e22 3e73 6f61 703a 3a61 6363 f...">soap::acc │ │ │ │ +0013be40: 6570 745f 666c 6167 733c 2f61 3e3c 2f63 ept_flags is set to < │ │ │ │ +0013be60: 636f 6465 3e28 534f 5f4e 4f53 4947 5049 code>(SO_NOSIGPI │ │ │ │ +0013be70: 5045 207c 2053 4f5f 4c49 4e47 4552 293c PE | SO_LINGER)< │ │ │ │ +0013be80: 2f63 6f64 653e 2074 6869 7320 6469 7361 /code> this disa │ │ │ │ +0013be90: 626c 6573 2053 4947 5049 5045 2073 6967 bles SIGPIPE sig │ │ │ │ +0013bea0: 6e61 6c73 2061 6e64 2073 6574 206c 696e nals and set lin │ │ │ │ +0013beb0: 6765 7220 7469 6d65 2076 616c 7565 2067 ger time value g │ │ │ │ +0013bec0: 6976 656e 2062 7920 3c63 6f64 653e 3c61 iven by soap::ling │ │ │ │ +0013bf90: 6572 5f74 696d 653c 2f61 3e3c 2f63 6f64 er_time, which is zer │ │ │ │ +0013bfb0: 6f20 6279 2064 6566 6175 6c74 2e3c 2f70 o by default.

    .

    The < │ │ │ │ +0013bfd0: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ +0013bfe0: 663d 2273 7472 7563 7473 6f61 702e 6874 f="structsoap.ht │ │ │ │ +0013bff0: 6d6c 2361 6165 3365 6565 3737 3164 3863 ml#aae3eee771d8c │ │ │ │ +0013c000: 3430 3331 6433 3064 3463 6137 3633 3365 4031d30d4ca7633e │ │ │ │ +0013c010: 6466 3966 2220 7469 746c 653d 2255 7365 df9f" title="Use │ │ │ │ +0013c020: 722d 6465 6669 6e61 626c 6520 736f 636b r-definable sock │ │ │ │ +0013c030: 6574 2073 656e 6420 616e 6420 7265 6376 et send and recv │ │ │ │ +0013c040: 2066 6c61 6773 2c20 666f 7220 6578 616d flags, for exam │ │ │ │ +0013c050: 706c 6520 6173 7369 676e 204d 5347 5f4e ple assign MSG_N │ │ │ │ +0013c060: 4f53 4947 4e41 4c20 746f 2064 6973 6162 OSIGNAL to disab │ │ │ │ +0013c070: 6c65 2073 6967 7069 7065 2028 7468 6520 le sigpipe (the │ │ │ │ +0013c080: 7661 2e2e 2e22 3e73 6f61 703a 3a73 6f63 va...">soap::soc │ │ │ │ +0013c090: 6b65 745f 666c 6167 733c 2f61 3e3c 2f63 ket_flags context fla │ │ │ │ +0013c0b0: 6720 6361 6e20 6265 2075 7365 6420 746f g can be used to │ │ │ │ +0013c0c0: 2070 6173 7320 6f70 7469 6f6e 7320 746f pass options to │ │ │ │ +0013c0d0: 2074 6865 203c 636f 6465 3e26 6c74 3b73 the <s │ │ │ │ +0013c0e0: 7973 2f73 6f63 6b65 742e 6826 6774 3b3c ys/socket.h>< │ │ │ │ +0013c0f0: 2f63 6f64 653e 203c 636f 6465 3e73 656e /code> sen │ │ │ │ +0013c100: 643c 2f63 6f64 653e 2c20 3c63 6f64 653e d, │ │ │ │ +0013c110: 7365 6e64 746f 3c2f 636f 6465 3e2c 203c sendto, < │ │ │ │ +0013c120: 636f 6465 3e72 6563 763c 2f63 6f64 653e code>recv │ │ │ │ +0013c130: 2c20 616e 6420 3c63 6f64 653e 7265 6376 , and recv │ │ │ │ +0013c140: 6672 6f6d 3c2f 636f 6465 3e20 6361 6c6c from call │ │ │ │ +0013c150: 7320 6d61 6465 2062 7920 7468 6520 656e s made by the en │ │ │ │ +0013c160: 6769 6e65 2c20 7468 6f75 6768 2073 6f6d gine, though som │ │ │ │ +0013c170: 6520 6f70 7469 6f6e 7320 6d61 7920 6e6f e options may no │ │ │ │ +0013c180: 7420 6265 2061 7070 6c69 6361 626c 6520 t be applicable │ │ │ │ +0013c190: 746f 2079 6f75 7220 6f70 6572 6174 696e to your operatin │ │ │ │ +0013c1a0: 6720 7379 7374 656d 3a3c 2f70 3e0a 3c74 g system:

    ..
    ... │ │ │ │ +0013c2b0: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 so │ │ │ │ +0013c370: 6170 3a3a 736f 636b 6574 5f66 6c61 6773 ap::socket_flags │ │ │ │ +0013c380: 3c2f 613e 3c2f 636f 6465 3e20 3d20 3c63 = MSG_NOSIGNAL │ │ │ │ +0013c3a0: 3c2f 636f 6465 3e20 2020 3c2f 7464 3e3c < │ │ │ │ +0013c3b0: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ │ +0013c3c0: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ │ +0013c3d0: 3e64 6973 6162 6c65 7320 5349 4750 4950 >disables SIGPIP │ │ │ │ +0013c3e0: 4520 2020 203c 2f74 643e 3c2f 7472 3e0a E . │ │ │ │ +0013c3f0: 3c74 7220 636c 6173 733d 226d 6172 6b64 .. │ │ │ │ +0013c590: 3c2f 7461 626c 653e 0a3c 703e 4675 7274
    define result < │ │ │ │ +00134460: 2f74 683e 3c2f 7472 3e0a 3c74 7220 636c /th>
    #SOAP_NOTHROW │ │ │ │ +001344c0: 3c2f 636f 6465 3e20 2020 3c2f 7464 3e3c
    #SOA │ │ │ │ +001345e0: 505f 4255 464c 454e 3c2f 636f 6465 3e20 P_BUFLEN │ │ │ │ +001345f0: 2020 3c2f 7464 3e3c 7464 2063 6c61 7373 the len │ │ │ │ +00134620: 6774 6820 6f66 2074 6865 2069 6e74 6572 gth of the inter │ │ │ │ +00134630: 6e61 6c20 6d65 7373 6167 6520 6275 6666 nal message buff │ │ │ │ +00134640: 6572 2c20 696d 7061 6374 7320 636f 6d6d er, impacts comm │ │ │ │ +00134650: 756e 6963 6174 696f 6e73 2070 6572 666f unications perfo │ │ │ │ +00134660: 726d 616e 6365 2020 2020 3c2f 7464 3e3c rmance
    #S │ │ │ │ +001346c0: 4f41 505f 4844 524c 454e 3c2f 636f 6465 OAP_HDRLEN the m │ │ │ │ +00134700: 6178 696d 756d 206c 656e 6774 6820 6f66 aximum length of │ │ │ │ +00134710: 2048 5454 5020 6865 6164 6572 7320 2020 HTTP headers │ │ │ │ +00134720: 203c 2f74 643e 3c2f 7472 3e0a 3c74 7220
    the maximum l │ │ │ │ +001347c0: 656e 6774 6820 6f66 2058 4d4c 2074 6167 ength of XML tag │ │ │ │ +001347d0: 7320 616e 6420 5552 4c73 2020 2020 3c2f s and URLs
    #SOAP_TMPLEN t │ │ │ │ +00134870: 6865 206d 6178 696d 756d 206c 656e 6774 he maximum lengt │ │ │ │ +00134880: 6820 6f66 2074 656d 706f 7261 7279 2073 h of temporary s │ │ │ │ +00134890: 7472 696e 6720 7661 6c75 6573 2c20 7368 tring values, sh │ │ │ │ +001348a0: 6f72 7420 7374 7269 6e67 7320 616e 6420 ort strings and │ │ │ │ +001348b0: 6272 6965 6620 6572 726f 7220 6d65 7373 brief error mess │ │ │ │ +001348c0: 6167 6573 2020 2020 3c2f 7464 3e3c 2f74 ages
    #SO │ │ │ │ +00134920: 4150 5f4d 4158 414c 4c4f 4353 495a 453c AP_MAXALLOCSIZE< │ │ │ │ +00134930: 2f63 6f64 653e 2020 203c 2f74 643e 3c74 /code>
    #SOAP_MAXARRA │ │ │ │ +00134a10: 5953 495a 453c 2f63 6f64 653e 2020 203c YSIZE < │ │ │ │ +00134a20: 2f74 643e 3c74 6420 636c 6173 733d 226d /td>the maximu │ │ │ │ +00134a50: 6d20 616c 6c6f 6361 7469 6f6e 2074 6872 m allocation thr │ │ │ │ +00134a60: 6573 686f 6c64 2074 6f20 7072 652d 616c eshold to pre-al │ │ │ │ +00134a70: 6c6f 6361 7465 2053 4f41 5020 6172 7261 locate SOAP arra │ │ │ │ +00134a80: 7973 2069 6e20 6d65 6d6f 7279 2020 2020 ys in memory │ │ │ │ +00134a90: 3c2f 7464 3e3c 2f74 723e 0a3c 7472 2063
    < │ │ │ │ +00134ae0: 636f 6465 3e23 534f 4150 5f4d 4158 4449 code>#SOAP_MAXDI │ │ │ │ +00134af0: 4d45 5349 5a45 3c2f 636f 6465 3e20 2020 MESIZE │ │ │ │ +00134b00: 3c2f 7464 3e3c 7464 2063 6c61 7373 3d22 the maxim │ │ │ │ +00134b30: 756d 2044 494d 4520 6174 7461 6368 6d65 um DIME attachme │ │ │ │ +00134b40: 6e74 2073 697a 6520 616c 6c6f 7765 6420 nt size allowed │ │ │ │ +00134b50: 746f 2072 6563 6569 7665 2020 2020 3c2f to receive
    #SOAP_MAXEINTR │ │ │ │ +00134bc0: 3c2f 636f 6465 3e20 2020 3c2f 7464 3e3c
    #SOAP_MAXINFLA │ │ │ │ +00134cb0: 5445 5349 5a45 3c2f 636f 6465 3e20 2020 TESIZE │ │ │ │ +00134cc0: 3c2f 7464 3e3c 7464 2063 6c61 7373 3d22 trusted i │ │ │ │ +00134cf0: 6e66 6c61 7465 6420 636f 6e74 656e 7420 nflated content │ │ │ │ +00134d00: 7369 7a65 2028 3120 4d42 2062 7920 6465 size (1 MB by de │ │ │ │ +00134d10: 6661 756c 7429 2020 2020 3c2f 7464 3e3c fault)
    #S │ │ │ │ +00134d70: 4f41 505f 4d41 584b 4545 5041 4c49 5645 OAP_MAXKEEPALIVE │ │ │ │ +00134d80: 3c2f 636f 6465 3e20 2020 3c2f 7464 3e3c
    #SOAP_MAXLENGT │ │ │ │ +00134ee0: 483c 2f63 6f64 653e 2020 203c 2f74 643e H maximum string │ │ │ │ +00134f20: 2063 6f6e 7465 6e74 206c 656e 6774 6820 content length │ │ │ │ +00134f30: 666f 7220 7374 7269 6e67 7320 6e6f 7420 for strings not │ │ │ │ +00134f40: 616c 7265 6164 7920 636f 6e73 7472 6169 already constrai │ │ │ │ +00134f50: 6e65 6420 6279 2058 4d4c 2073 6368 656d ned by XML schem │ │ │ │ +00134f60: 6120 7661 6c69 6461 7469 6f6e 2063 6f6e a validation con │ │ │ │ +00134f70: 7374 7261 696e 7473 2020 2020 3c2f 7464 straints
    │ │ │ │ +00134fd0: 2353 4f41 505f 4d41 584c 4556 454c 3c2f #SOAP_MAXLEVEL m │ │ │ │ +00135010: 6178 696d 756d 2058 4d4c 206e 6573 7469 aximum XML nesti │ │ │ │ +00135020: 6e67 2064 6570 7468 206c 6576 656c 2070 ng depth level p │ │ │ │ +00135030: 6572 6d69 7474 6564 2062 7920 7468 6520 ermitted by the │ │ │ │ +00135040: 584d 4c20 7061 7273 6572 2020 2020 3c2f XML parser
    #SOAP_MAXOCCU │ │ │ │ +001350b0: 5253 3c2f 636f 6465 3e20 2020 3c2f 7464 RS maximum numbe │ │ │ │ +001350f0: 7220 6f66 2061 7272 6179 206f 7220 636f r of array or co │ │ │ │ +00135100: 6e74 6169 6e65 7220 656c 656d 656e 7473 ntainer elements │ │ │ │ +00135110: 2066 6f72 2063 6f6e 7461 696e 6572 7320 for containers │ │ │ │ +00135120: 7468 6174 2061 7265 206e 6f74 2061 6c72 that are not alr │ │ │ │ +00135130: 6561 6479 2063 6f6e 7374 7261 696e 6564 eady constrained │ │ │ │ +00135140: 2062 7920 584d 4c20 7363 6865 6d61 2076 by XML schema v │ │ │ │ +00135150: 616c 6964 6174 696f 6e20 636f 6e73 7472 alidation constr │ │ │ │ +00135160: 6169 6e74 7320 2020 203c 2f74 643e 3c2f aints
    #SO │ │ │ │ +001351c0: 4150 5f4d 494e 4445 464c 4154 4552 4154 AP_MINDEFLATERAT │ │ │ │ +001351d0: 494f 3c2f 636f 6465 3e20 2020 3c2f 7464 IO trusted defla │ │ │ │ +00135210: 7469 6f6e 2072 6174 696f 2061 6674 6572 tion ratio after │ │ │ │ +00135220: 203c 636f 6465 3e23 534f 4150 5f4d 4158 #SOAP_MAX │ │ │ │ +00135230: 494e 464c 4154 4553 495a 453c 2f63 6f64 INFLATESIZE is reached │ │ │ │ +00135250: 203c 2f74 643e 3c2f 7472 3e0a 3c74 7220
    set to │ │ │ │ +001352f0: 3c63 6f64 653e 3d20 303c 2f63 6f64 653e = 0 │ │ │ │ +00135300: 2077 6865 6e20 3c63 6f64 653e 2357 4954 when #WIT │ │ │ │ +00135310: 485f 5055 5245 5f56 4952 5455 414c 3c2f H_PURE_VIRTUAL is defined │ │ │ │ +00135330: 2020 2020 3c2f 7464 3e3c 2f74 723e 0a3c
    #SOAP_SS │ │ │ │ +00135390: 4c5f 5253 415f 4249 5453 3c2f 636f 6465 L_RSA_BITS lengt │ │ │ │ +001353d0: 6820 6f66 2074 6865 2052 5341 206b 6579 h of the RSA key │ │ │ │ +001353e0: 2028 3230 3438 2062 7920 6465 6661 756c (2048 by defaul │ │ │ │ +001353f0: 7429 2020 2020 3c2f 7464 3e3c 2f74 723e t)
    #SOAP │ │ │ │ +00135450: 5f55 4e4b 4e4f 574e 5f43 4841 523c 2f63 _UNKNOWN_CHAR an │ │ │ │ +00135490: 2038 2062 6974 2069 6e74 6567 6572 2074 8 bit integer t │ │ │ │ +001354a0: 6861 7420 7265 7072 6573 656e 7473 2061 hat represents a │ │ │ │ +001354b0: 2063 6861 7261 6374 6572 2074 6861 7420 character that │ │ │ │ +001354c0: 636f 756c 6420 6e6f 7420 6265 2063 6f6e could not be con │ │ │ │ +001354d0: 7665 7274 6564 2074 6f20 616e 2041 5343 verted to an ASC │ │ │ │ +001354e0: 4949 2063 6861 722c 2069 2e65 2e20 7768 II char, i.e. wh │ │ │ │ +001354f0: 656e 2063 6f6e 7665 7274 696e 6720 616e en converting an │ │ │ │ +00135500: 2058 4d4c 2055 6e69 636f 6465 2063 6861 XML Unicode cha │ │ │ │ +00135510: 7261 6374 6572 2020 2020 3c2f 7464 3e3c racter
    #S │ │ │ │ +00135570: 4f41 505f 554e 4b4e 4f57 4e5f 554e 4943 OAP_UNKNOWN_UNIC │ │ │ │ +00135580: 4f44 455f 4348 4152 3c2f 636f 6465 3e20 ODE_CHAR │ │ │ │ +00135590: 2020 3c2f 7464 3e3c 7464 2063 6c61 7373 integer │ │ │ │ +001355c0: 2055 6e69 636f 6465 2076 616c 7565 2072 Unicode value r │ │ │ │ +001355d0: 6570 7265 7365 6e74 696e 6720 6120 6368 epresenting a ch │ │ │ │ +001355e0: 6172 6163 7465 7220 7468 6174 2072 6570 aracter that rep │ │ │ │ +001355f0: 6c61 6365 7320 616e 2069 6e76 616c 6964 laces an invalid │ │ │ │ +00135600: 2055 6e69 636f 6465 2063 6f64 6520 706f Unicode code po │ │ │ │ +00135610: 696e 7420 2020 203c 2f74 643e 3c2f 7472 int
    #SOA │ │ │ │ +00135670: 505f 4c4f 4e47 5f46 4f52 4d41 543c 2f63 P_LONG_FORMAT ma │ │ │ │ +001356b0: 6372 6f20 7468 6174 2072 6570 7265 7365 cro that represe │ │ │ │ +001356c0: 6e74 7320 7468 6520 3c63 6f64 653e 234c nts the #L │ │ │ │ +001356d0: 4f4e 4736 343c 2f63 6f64 653e 2070 7269 ONG64 pri │ │ │ │ +001356e0: 6e74 6620 252d 666f 726d 6174 2020 2020 ntf %-format │ │ │ │ +001356f0: 3c2f 7464 3e3c 2f74 723e 0a3c 7472 2063
    #SOAP_ULONG_ │ │ │ │ +00135750: 464f 524d 4154 3c2f 636f 6465 3e20 2020 FORMAT │ │ │ │ +00135760: 3c2f 7464 3e3c 7464 2063 6c61 7373 3d22 macro tha │ │ │ │ +00135790: 7420 7265 7072 6573 656e 7473 2074 6865 t represents the │ │ │ │ +001357a0: 203c 636f 6465 3e23 554c 4f4e 4736 343c #ULONG64< │ │ │ │ +001357b0: 2f63 6f64 653e 2070 7269 6e74 6620 252d /code> printf %- │ │ │ │ +001357c0: 666f 726d 6174 2020 2020 3c2f 7464 3e3c format
    # │ │ │ │ +00135820: 534f 4150 5f49 4e56 414c 4944 5f53 4f43 SOAP_INVALID_SOC │ │ │ │ +00135830: 4b45 543c 2f63 6f64 653e 2020 203c 2f74 KET portable inv │ │ │ │ +00135870: 616c 6964 2073 6f63 6b65 7420 7661 6c75 alid socket valu │ │ │ │ +00135880: 652c 2063 616e 2061 6c73 6f20 7573 6520 e, can also use │ │ │ │ +00135890: 3c63 6f64 653e 233c 6120 636c 6173 733d #soap_valid_s │ │ │ │ +00135950: 6f63 6b65 7428 736f 636b 293c 2f61 3e3c ocket(sock)< │ │ │ │ +00135960: 2f63 6f64 653e 2074 6f20 6368 6563 6b20 /code> to check │ │ │ │ +00135970: 6966 203c 636f 6465 3e73 6f63 6b3c 2f63 if sock is valid │ │ │ │ +00135990: 3c2f 7464 3e3c 2f74 723e 0a3c 2f74 6162
    contex │ │ │ │ +0013a920: 7420 666c 6167 2077 6974 6820 7365 7473 t flag with sets │ │ │ │ +0013a930: 6f63 6b6f 7074 206f 7074 696f 6e20 2020 ockopt option │ │ │ │ +0013a940: 3c2f 7468 3e3c 7468 2063 6c61 7373 3d22 result │ │ │ │ +0013a970: 203c 2f74 683e 3c2f 7472 3e0a 3c74 7220
    < │ │ │ │ +0013a9c0: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soa │ │ │ │ +0013aa80: 703a 3a63 6f6e 6e65 6374 5f66 6c61 6773 p::connect_flags │ │ │ │ +0013aa90: 3c2f 613e 3c2f 636f 6465 3e20 3d20 3c63 = SO_NOSIGPIPE │ │ │ │ +0013aab0: 3c2f 636f 6465 3e20 2020 3c2f 7464 3e3c
    soap::connect_ │ │ │ │ +0013ac10: 666c 6167 733c 2f61 3e3c 2f63 6f64 653e flags │ │ │ │ +0013ac20: 203d 203c 636f 6465 3e53 4f5f 4445 4255 = SO_DEBU │ │ │ │ +0013ac30: 473c 2f63 6f64 653e 2020 203c 2f74 643e G turns on recor │ │ │ │ +0013ac70: 6469 6e67 206f 6620 6465 6275 6767 696e ding of debuggin │ │ │ │ +0013ac80: 6720 696e 666f 726d 6174 696f 6e20 696e g information in │ │ │ │ +0013ac90: 2074 6865 2075 6e64 6572 6c79 696e 6720 the underlying │ │ │ │ +0013aca0: 7072 6f74 6f63 6f6c 206d 6f64 756c 6573 protocol modules │ │ │ │ +0013acb0: 2020 2020 3c2f 7464 3e3c 2f74 723e 0a3c
    │ │ │ │ +0013adc0: 736f 6170 3a3a 636f 6e6e 6563 745f 666c soap::connect_fl │ │ │ │ +0013add0: 6167 733c 2f61 3e3c 2f63 6f64 653e 203d ags = │ │ │ │ +0013ade0: 203c 636f 6465 3e53 4f5f 4252 4f41 4443 SO_BROADC │ │ │ │ +0013adf0: 4153 543c 2f63 6f64 653e 2020 203c 2f74 AST permits send │ │ │ │ +0013ae30: 696e 6720 6f66 2062 726f 6164 6361 7374 ing of broadcast │ │ │ │ +0013ae40: 206d 6573 7361 6765 732c 2066 6f72 2065 messages, for e │ │ │ │ +0013ae50: 7861 6d70 6c65 2077 6974 6820 5544 502c xample with UDP, │ │ │ │ +0013ae60: 2077 6865 6e20 7065 726d 6974 7465 6420 when permitted │ │ │ │ +0013ae70: 2020 203c 2f74 643e 3c2f 7472 3e0a 3c74
    │ │ │ │ +0013af80: 736f 6170 3a3a 636f 6e6e 6563 745f 666c soap::connect_fl │ │ │ │ +0013af90: 6167 733c 2f61 3e3c 2f63 6f64 653e 203d ags = │ │ │ │ +0013afa0: 203c 636f 6465 3e53 4f5f 4c49 4e47 4552 SO_LINGER │ │ │ │ +0013afb0: 3c2f 636f 6465 3e20 2020 3c2f 7464 3e3c
    │ │ │ │ +0013b140: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap::co │ │ │ │ +0013b200: 6e6e 6563 745f 666c 6167 733c 2f61 3e3c nnect_flags< │ │ │ │ +0013b210: 2f63 6f64 653e 203d 203c 636f 6465 3e53 /code> = S │ │ │ │ +0013b220: 4f5f 444f 4e54 524f 5554 453c 2f63 6f64 O_DONTROUTE enab │ │ │ │ +0013b260: 6c65 7320 726f 7574 696e 6720 6279 7061 les routing bypa │ │ │ │ +0013b270: 7373 2066 6f72 206f 7574 676f 696e 6720 ss for outgoing │ │ │ │ +0013b280: 6d65 7373 6167 6573 2020 2020 3c2f 7464 messages
    soap::a │ │ │ │ +0013b3a0: 6363 6570 745f 666c 6167 733c 2f61 3e3c ccept_flags< │ │ │ │ +0013b3b0: 2f63 6f64 653e 203d 203c 636f 6465 3e53 /code> = S │ │ │ │ +0013b3c0: 4f5f 4e4f 5349 4750 4950 453c 2f63 6f64 O_NOSIGPIPE disa │ │ │ │ +0013b400: 626c 6573 2053 4947 5049 5045 2028 6368 bles SIGPIPE (ch │ │ │ │ +0013b410: 6563 6b20 796f 7572 204f 532c 2074 6869 eck your OS, thi │ │ │ │ +0013b420: 7320 6973 206e 6f74 2070 6f72 7461 626c s is not portabl │ │ │ │ +0013b430: 6529 2020 2020 3c2f 7464 3e3c 2f74 723e e)
    soap::accept_f │ │ │ │ +0013b550: 6c61 6773 3c2f 613e 3c2f 636f 6465 3e20 lags │ │ │ │ +0013b560: 3d20 3c63 6f64 653e 534f 5f44 4542 5547 = SO_DEBUG │ │ │ │ +0013b570: 3c2f 636f 6465 3e20 2020 3c2f 7464 3e3c
    │ │ │ │ +0013b700: 736f 6170 3a3a 6163 6365 7074 5f66 6c61 soap::accept_fla │ │ │ │ +0013b710: 6773 3c2f 613e 3c2f 636f 6465 3e20 3d20 gs = │ │ │ │ +0013b720: 3c63 6f64 653e 534f 5f4c 494e 4745 523c SO_LINGER< │ │ │ │ +0013b730: 2f63 6f64 653e 2020 203c 2f74 643e 3c74 /code>
    < │ │ │ │ +0013b8c0: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ +0013b8d0: 663d 2273 7472 7563 7473 6f61 702e 6874 f="structsoap.ht │ │ │ │ +0013b8e0: 6d6c 2361 6439 3866 3132 6636 3032 6566 ml#ad98f12f602ef │ │ │ │ +0013b8f0: 6464 6530 3439 6462 6433 3637 6134 3365 dde049dbd367a43e │ │ │ │ +0013b900: 3763 6230 2220 7469 746c 653d 2255 7365 7cb0" title="Use │ │ │ │ +0013b910: 722d 6465 6669 6e61 626c 6520 7365 7473 r-definable sets │ │ │ │ +0013b920: 6f63 6b6f 7074 206c 6576 656c 2053 4f4c ockopt level SOL │ │ │ │ +0013b930: 5f53 4f43 4b45 5420 666c 6167 7320 2830 _SOCKET flags (0 │ │ │ │ +0013b940: 2062 7920 6465 6661 756c 7429 2c20 7768 by default), wh │ │ │ │ +0013b950: 656e 206e 6f6e 7a65 726f 2073 6574 7320 en nonzero sets │ │ │ │ +0013b960: 7468 6520 736f 6170 3a3a 736f 636b 6574 the soap::socket │ │ │ │ +0013b970: 2066 2e2e 2e22 3e73 6f61 703a 3a61 6363 f...">soap::acc │ │ │ │ +0013b980: 6570 745f 666c 6167 733c 2f61 3e3c 2f63 ept_flags = SO_ │ │ │ │ +0013b9a0: 444f 4e54 524f 5554 453c 2f63 6f64 653e DONTROUTE │ │ │ │ +0013b9b0: 2020 203c 2f74 643e 3c74 6420 636c 6173 enable │ │ │ │ +0013b9e0: 7320 726f 7574 696e 6720 6279 7061 7373 s routing bypass │ │ │ │ +0013b9f0: 2066 6f72 206f 7574 676f 696e 6720 6d65 for outgoing me │ │ │ │ +0013ba00: 7373 6167 6573 2020 2020 3c2f 7464 3e3c ssages
    < │ │ │ │ +0013ba60: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ +0013ba70: 663d 2273 7472 7563 7473 6f61 702e 6874 f="structsoap.ht │ │ │ │ +0013ba80: 6d6c 2361 3662 3138 6230 3137 6365 3263 ml#a6b18b017ce2c │ │ │ │ +0013ba90: 3737 6163 3262 3633 3331 3436 3930 3934 77ac2b6331469094 │ │ │ │ +0013baa0: 6465 3539 2220 7469 746c 653d 2255 7365 de59" title="Use │ │ │ │ +0013bab0: 722d 6465 6669 6e61 626c 6520 7365 7473 r-definable sets │ │ │ │ +0013bac0: 6f63 6b6f 7074 206c 6576 656c 2053 4f4c ockopt level SOL │ │ │ │ +0013bad0: 5f53 4f43 4b45 5420 666c 6167 7320 7768 _SOCKET flags wh │ │ │ │ +0013bae0: 656e 2062 696e 6469 6e67 2073 6f61 703a en binding soap: │ │ │ │ +0013baf0: 3a6d 6173 7465 7220 736f 636b 6574 2028 :master socket ( │ │ │ │ +0013bb00: 7468 6520 7661 6c75 6520 6973 2030 2062 the value is 0 b │ │ │ │ +0013bb10: 7920 2e2e 2e22 3e73 6f61 703a 3a62 696e y ...">soap::bin │ │ │ │ +0013bb20: 645f 666c 6167 733c 2f61 3e3c 2f63 6f64 d_flags = SO_RE │ │ │ │ +0013bb40: 5553 4541 4444 523c 2f63 6f64 653e 2020 USEADDR │ │ │ │ +0013bb50: 203c 2f74 643e 3c74 6420 636c 6173 733d enables │ │ │ │ +0013bb80: 6c6f 6361 6c20 6164 6472 6573 7320 7265 local address re │ │ │ │ +0013bb90: 7573 6520 696d 6d65 6469 6174 656c 792c use immediately, │ │ │ │ +0013bba0: 2075 7365 2077 6974 6820 6361 7574 696f use with cautio │ │ │ │ +0013bbb0: 6e20 2020 203c 2f74 643e 3c2f 7472 3e0a n
    soap::bind_flag │ │ │ │ +0013bcd0: 733c 2f61 3e3c 2f63 6f64 653e 203d 203c s = < │ │ │ │ +0013bce0: 636f 6465 3e53 4f5f 5245 5553 4550 4f52 code>SO_REUSEPOR │ │ │ │ +0013bcf0: 543c 2f63 6f64 653e 2020 203c 2f74 643e T enables duplic │ │ │ │ +0013bd30: 6174 6520 6164 6472 6573 7320 616e 6420 ate address and │ │ │ │ +0013bd40: 706f 7274 2062 696e 6469 6e67 7320 2020 port bindings │ │ │ │ +0013bd50: 3c2f 7464 3e3c 2f74 723e 0a3c 2f74 6162
    con │ │ │ │ +0013c210: 7465 7874 2066 6c61 6720 7769 7468 2073 text flag with s │ │ │ │ +0013c220: 656e 742f 7265 6376 2066 6c61 6773 2020 ent/recv flags │ │ │ │ +0013c230: 203c 2f74 683e 3c74 6820 636c 6173 733d result │ │ │ │ +0013c260: 2020 3c2f 7468 3e3c 2f74 723e 0a3c 7472
    soap::socket_f │ │ │ │ +0013c500: 6c61 6773 3c2f 613e 3c2f 636f 6465 3e20 lags │ │ │ │ +0013c510: 3d20 3c63 6f64 653e 4d53 475f 444f 4e54 = MSG_DONT │ │ │ │ +0013c520: 524f 5554 453c 2f63 6f64 653e 2020 203c ROUTE < │ │ │ │ +0013c530: 2f74 643e 3c74 6420 636c 6173 733d 226d /td>enables ro │ │ │ │ +0013c560: 7574 696e 6720 6279 7061 7373 2066 6f72 uting bypass for │ │ │ │ +0013c570: 206f 7574 676f 696e 6720 6d65 7373 6167 outgoing messag │ │ │ │ +0013c580: 6573 2020 203c 2f74 643e 3c2f 7472 3e0a es
    .

    Furt │ │ │ │ +0013c5a0: 6865 726d 6f72 652c 2074 6865 203c 636f hermore, the setsockopt level SOL_SOCKET options SO_SNDBUF and SO_R │ │ │ │ +0013c610: 4356 4255 463c 2f63 6f64 653e 2061 7265 CVBUF are │ │ │ │ +0013c620: 2073 6574 2074 6865 2065 6e67 696e 6520 set the engine │ │ │ │ +0013c630: 7768 656e 203c 636f 6465 3e3c 6120 636c when soap::sndbuf and soap: │ │ │ │ +0013c7b0: 3a72 6376 6275 663c 2f61 3e3c 2f63 6f64 :rcvbuf are set to a │ │ │ │ +0013c7d0: 6e6f 6e7a 6572 6f20 7661 6c75 652e 2054 nonzero value. T │ │ │ │ +0013c7e0: 6865 2064 6566 6175 6c74 2076 616c 7565 he default value │ │ │ │ +0013c7f0: 2069 7320 3c63 6f64 653e 2353 4f41 505f is #SOAP_ │ │ │ │ +0013c800: 4255 464c 454e 3c2f 636f 6465 3e2c 2077 BUFLEN, w │ │ │ │ +0013c810: 6869 6368 2069 7320 7468 6520 7361 6d65 hich is the same │ │ │ │ +0013c820: 2073 697a 6520 7573 6564 2062 7920 7468 size used by th │ │ │ │ +0013c830: 6520 696e 7465 726e 616c 2062 7566 6665 e internal buffe │ │ │ │ +0013c840: 7220 3c63 6f64 653e 3c61 2063 6c61 7373 r │ │ │ │ +0013c900: 736f 6170 3a3a 6275 663c 2f61 3e3c 2f63 soap::buf to send and │ │ │ │ +0013c920: 2072 6563 6569 7665 206d 6573 7361 6765 receive message │ │ │ │ +0013c930: 732e 2041 207a 6572 6f20 7661 6c75 6520 s. A zero value │ │ │ │ +0013c940: 6f6d 6974 7320 7468 6520 696e 7465 726e omits the intern │ │ │ │ +0013c950: 616c 203c 636f 6465 3e73 6574 736f 636b al setsock │ │ │ │ +0013c960: 6f70 743c 2f63 6f64 653e 2063 616c 6c20 opt call │ │ │ │ +0013c970: 746f 2073 6574 2074 6865 7365 206f 7074 to set these opt │ │ │ │ +0013c980: 696f 6e73 2e20 5365 7474 696e 6720 7468 ions. Setting th │ │ │ │ +0013c990: 6573 6520 7661 6c75 6573 2074 6f20 7a65 ese values to ze │ │ │ │ +0013c9a0: 726f 2061 6374 6976 6174 6573 2061 7574 ro activates aut │ │ │ │ +0013c9b0: 6f2d 7475 6e69 6e67 2077 6974 6820 4c69 o-tuning with Li │ │ │ │ +0013c9c0: 6e75 7820 322e 3420 616e 6420 6772 6561 nux 2.4 and grea │ │ │ │ +0013c9d0: 7465 722e 3c2f 703e 0a3c 703e 5468 6520 ter.

    .

    The │ │ │ │ +0013c9e0: 3c63 6f64 653e 7365 7473 6f63 6b6f 7074 setsockopt │ │ │ │ +0013c9f0: 3c2f 636f 6465 3e20 6c65 7665 6c20 3c63 level SOL_SOCKET option SO_KEEPALIVE< │ │ │ │ +0013ca30: 2f63 6f64 653e 2069 7320 7365 7420 7768 /code> is set wh │ │ │ │ +0013ca40: 656e 206b 6565 702d 616c 6976 6520 6973 en keep-alive is │ │ │ │ +0013ca50: 2065 6e61 626c 6564 2077 6974 6820 636f enabled with co │ │ │ │ +0013ca60: 6e74 6578 7420 666c 6167 203c 636f 6465 ntext flag #SOAP_IO_KEEPAL │ │ │ │ +0013ca80: 4956 453c 2f63 6f64 653e 206f 7220 7768 IVE or wh │ │ │ │ +0013ca90: 656e 203c 636f 6465 3e3c 6120 636c 6173 en soap::tcp_keep_ │ │ │ │ +0013cb60: 616c 6976 653c 2f61 3e3c 2f63 6f64 653e alive │ │ │ │ +0013cb70: 2069 7320 6e6f 6e7a 6572 6f2e 2057 6974 is nonzero. Wit │ │ │ │ +0013cb80: 6820 3c63 6f64 653e 3c61 2063 6c61 7373 h │ │ │ │ +0013cc40: 736f 6170 3a3a 7463 705f 6b65 6570 5f61 soap::tcp_keep_a │ │ │ │ +0013cc50: 6c69 7665 3c2f 613e 3c2f 636f 6465 3e20 live │ │ │ │ +0013cc60: 6164 6469 7469 6f6e 616c 206f 7074 696f additional optio │ │ │ │ +0013cc70: 6e73 2063 616e 2062 6520 7370 6563 6966 ns can be specif │ │ │ │ +0013cc80: 6965 6420 7769 7468 203c 636f 6465 3e3c ied with < │ │ │ │ +0013cc90: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ +0013cca0: 663d 2273 7472 7563 7473 6f61 702e 6874 f="structsoap.ht │ │ │ │ +0013ccb0: 6d6c 2361 3863 3038 3232 6362 3033 3939 ml#a8c0822cb0399 │ │ │ │ +0013ccc0: 6564 3535 6465 3663 3261 3438 3231 3731 ed55de6c2a482171 │ │ │ │ +0013ccd0: 3836 3866 2220 7469 746c 653d 2255 7365 868f" title="Use │ │ │ │ +0013cce0: 722d 6465 6669 6e61 626c 6520 7661 6c75 r-definable valu │ │ │ │ +0013ccf0: 6520 746f 2073 6574 2054 4350 5f4b 4545 e to set TCP_KEE │ │ │ │ +0013cd00: 5049 444c 4520 7365 7473 6f63 6b6f 7074 PIDLE setsockopt │ │ │ │ +0013cd10: 2028 7468 6520 7661 6c75 6520 6973 2030 (the value is 0 │ │ │ │ +0013cd20: 2062 7920 6465 6661 756c 7429 223e 736f by default)">so │ │ │ │ +0013cd30: 6170 3a3a 7463 705f 6b65 6570 5f69 646c ap::tcp_keep_idl │ │ │ │ +0013cd40: 653c 2f61 3e3c 2f63 6f64 653e 2c20 3c63 e, soap::tcp_ke │ │ │ │ +0013ce00: 6570 5f69 6e74 766c 3c2f 613e 3c2f 636f ep_intvl, and < │ │ │ │ +0013ce20: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ +0013ce30: 663d 2273 7472 7563 7473 6f61 702e 6874 f="structsoap.ht │ │ │ │ +0013ce40: 6d6c 2361 3831 3130 3431 6661 6162 3163 ml#a811041faab1c │ │ │ │ +0013ce50: 6634 3831 6537 6536 3536 6638 3164 6338 f481e7e656f81dc8 │ │ │ │ +0013ce60: 3839 3031 2220 7469 746c 653d 2255 7365 8901" title="Use │ │ │ │ +0013ce70: 722d 6465 6669 6e61 626c 6520 7661 6c75 r-definable valu │ │ │ │ +0013ce80: 6520 746f 2073 6574 2054 4350 5f4b 4545 e to set TCP_KEE │ │ │ │ +0013ce90: 5043 4e54 2073 6574 736f 636b 6f70 7420 PCNT setsockopt │ │ │ │ +0013cea0: 2874 6865 2076 616c 7565 2069 7320 3020 (the value is 0 │ │ │ │ +0013ceb0: 6279 2064 6566 6175 6c74 2922 3e73 6f61 by default)">soa │ │ │ │ +0013cec0: 703a 3a74 6370 5f6b 6565 705f 636e 743c p::tcp_keep_cnt< │ │ │ │ +0013ced0: 2f61 3e3c 2f63 6f64 653e 2e20 466f 7220 /a>. For │ │ │ │ +0013cee0: 6578 616d 706c 653a 3c2f 703e 0a3c 6469 example:

    .
    struc │ │ │ │ +0013cf30: 7420 3c2f 7370 616e 3e3c 6120 636c 6173 t │ │ │ │ +0013cf60: 736f 6170 3c2f 613e 202a 3c61 2063 6c61 soap *soap = soap_new(); │ │ │ │ +0013d000: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    │ │ │ │ +0013d040: 736f 6170 3c2f 613e 2d26 6774 3b3c 6120 soap->tcp_keep_a │ │ │ │ +0013d0a0: 6c69 7665 3c2f 613e 203d 2031 3b20 2020 live = 1; │ │ │ │ +0013d0b0: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // setsock │ │ │ │ +0013d0d0: 6f70 7420 534f 5f4b 4545 5041 4c49 5645 opt SO_KEEPALIVE │ │ │ │ +0013d0e0: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ │ +0013d100: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap- │ │ │ │ +0013d130: 2667 743b 3c61 2063 6c61 7373 3d22 636f >tcp │ │ │ │ +0013d180: 5f6b 6565 705f 6964 6c65 3c2f 613e 203d _keep_idle = │ │ │ │ +0013d190: 2033 303b 2020 203c 7370 616e 2063 6c61 30; // │ │ │ │ +0013d1b0: 7469 6d65 2069 6e20 7365 636f 6e64 7320 time in seconds │ │ │ │ +0013d1c0: 7468 6520 636f 6e6e 6563 7469 6f6e 206e the connection n │ │ │ │ +0013d1d0: 6565 6473 2074 6f20 7265 6d61 696e 2069 eeds to remain i │ │ │ │ +0013d1e0: 646c 6520 6265 666f 7265 2054 4350 2073 dle before TCP s │ │ │ │ +0013d1f0: 7461 7274 7320 7365 6e64 696e 6720 6b65 tarts sending ke │ │ │ │ +0013d200: 6570 616c 6976 6520 7072 6f62 6573 3c2f epalive probes
    .
    soap-&g │ │ │ │ +0013d260: 743b 3c61 2063 6c61 7373 3d22 636f 6465 t;tcp_k │ │ │ │ +0013d2b0: 6565 705f 696e 7476 6c3c 2f61 3e20 3d20 eep_intvl = │ │ │ │ +0013d2c0: 3132 303b 203c 7370 616e 2063 6c61 7373 120; // ti │ │ │ │ +0013d2e0: 6d65 2069 6e20 7365 636f 6e64 7320 6265 me in seconds be │ │ │ │ +0013d2f0: 7477 6565 6e20 696e 6469 7669 6475 616c tween individual │ │ │ │ +0013d300: 206b 6565 7061 6c69 7665 2070 726f 6265 keepalive probe │ │ │ │ +0013d310: 733c 2f73 7061 6e3e 3c2f 6469 763e 0a3c s
    .< │ │ │ │ +0013d320: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +0013d330: 3e3c 6120 636c 6173 733d 2263 6f64 6522 >soap │ │ │ │ +0013d360: 2d26 6774 3b3c 6120 636c 6173 733d 2263 ->tc │ │ │ │ +0013d3b0: 705f 6b65 6570 5f63 6e74 3c2f 613e 203d p_keep_cnt = │ │ │ │ +0013d3c0: 2035 3b20 2020 2020 3c73 7061 6e20 636c 5; // │ │ │ │ +0013d3e0: 206d 6178 696d 756d 206e 756d 6265 7220 maximum number │ │ │ │ +0013d3f0: 6f66 206b 6565 7061 6c69 7665 2070 726f of keepalive pro │ │ │ │ +0013d400: 6265 7320 5443 5020 7368 6f75 6c64 2073 bes TCP should s │ │ │ │ +0013d410: 656e 6420 6265 666f 7265 2064 726f 7070 end before dropp │ │ │ │ +0013d420: 696e 6720 7468 6520 636f 6e6e 6563 7469 ing the connecti │ │ │ │ +0013d430: 6f6e 3c2f 7370 616e 3e3c 2f64 6976 3e0a on
    . │ │ │ │ +0013d440: 3c64 6976 2063 6c61 7373 3d22 7474 6322
    soap::t │ │ │ │ +0013d4e0: 6370 5f6b 6565 705f 636e 743c 2f61 3e3c cp_keep_cnt< │ │ │ │ +0013d4f0: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
    unsigne │ │ │ │ +0013d510: 6420 696e 7420 7463 705f 6b65 6570 5f63 d int tcp_keep_c │ │ │ │ +0013d520: 6e74 3c2f 6469 763e 3c64 6976 2063 6c61 nt
    User- │ │ │ │ +0013d540: 6465 6669 6e61 626c 6520 7661 6c75 6520 definable value │ │ │ │ +0013d550: 746f 2073 6574 2054 4350 5f4b 4545 5043 to set TCP_KEEPC │ │ │ │ +0013d560: 4e54 2073 6574 736f 636b 6f70 7420 2874 NT setsockopt (t │ │ │ │ +0013d570: 6865 2076 616c 7565 2069 7320 3020 6279 he value is 0 by │ │ │ │ +0013d580: 2064 6566 6175 6c74 293c 2f64 6976 3e3c default)
    < │ │ │ │ +0013d590: 6469 7620 636c 6173 733d 2274 7464 6566 div class="ttdef │ │ │ │ +0013d5a0: 223e 3c62 3e44 6566 696e 6974 696f 6e3a ">Definition: │ │ │ │ +0013d5b0: 3c2f 623e 2073 7464 736f 6170 322e 683a stdsoap2.h: │ │ │ │ +0013d5c0: 3335 3834 3c2f 6469 763e 3c2f 6469 763e 3584
    │ │ │ │ +0013d5d0: 0a3c 6469 7620 636c 6173 733d 2274 7463 .
    .
    unsigned int t │ │ │ │ +0013d840: 6370 5f6b 6565 705f 6964 6c65 3c2f 6469 cp_keep_idle
    User-defina │ │ │ │ +0013d870: 626c 6520 7661 6c75 6520 746f 2073 6574 ble value to set │ │ │ │ +0013d880: 2054 4350 5f4b 4545 5049 444c 4520 7365 TCP_KEEPIDLE se │ │ │ │ +0013d890: 7473 6f63 6b6f 7074 2028 7468 6520 7661 tsockopt (the va │ │ │ │ +0013d8a0: 6c75 6520 6973 2030 2062 7920 6465 6661 lue is 0 by defa │ │ │ │ +0013d8b0: 756c 7429 3c2f 6469 763e 3c64 6976 2063 ult)
    │ │ │ │ +0013d8d0: 4465 6669 6e69 7469 6f6e 3a3c 2f62 3e20 Definition: │ │ │ │ +0013d8e0: 7374 6473 6f61 7032 2e68 3a33 3533 343c stdsoap2.h:3534< │ │ │ │ +0013d8f0: 2f64 6976 3e3c 2f64 6976 3e0a 3c64 6976 /div>
    .
    soap::tcp_k │ │ │ │ +0013d9a0: 6565 705f 616c 6976 653c 2f61 3e3c 2f64 eep_alive
    int tcp_k │ │ │ │ +0013d9d0: 6565 705f 616c 6976 653c 2f64 6976 3e3c eep_alive
    < │ │ │ │ +0013d9e0: 6469 7620 636c 6173 733d 2274 7464 6f63 div class="ttdoc │ │ │ │ +0013d9f0: 223e 5573 6572 2d64 6566 696e 6162 6c65 ">User-definable │ │ │ │ +0013da00: 2076 616c 7565 2074 6f20 7365 7420 534f value to set SO │ │ │ │ +0013da10: 5f4b 4545 5041 4c49 5645 2073 6574 736f _KEEPALIVE setso │ │ │ │ +0013da20: 636b 6f70 7420 2830 2062 7920 6465 6661 ckopt (0 by defa │ │ │ │ +0013da30: 756c 7420 756e 6c65 7373 2074 6865 2023 ult unless the # │ │ │ │ +0013da40: 534f 4150 5f49 4f5f 4b45 4550 414c 4956 SOAP_IO_KEEPALIV │ │ │ │ +0013da50: 4520 6d6f 6465 202e 2e2e 3c2f 6469 763e E mode ...
    │ │ │ │ +0013da60: 3c64 6976 2063 6c61 7373 3d22 7474 6465
    Definition │ │ │ │ +0013da80: 3a3c 2f62 3e20 7374 6473 6f61 7032 2e68 : stdsoap2.h │ │ │ │ +0013da90: 3a33 3530 393c 2f64 6976 3e3c 2f64 6976 :3509
    .

    For │ │ │ │ +0013dac0: 5544 5020 6d65 7373 6167 696e 672c 2075 UDP messaging, u │ │ │ │ +0013dad0: 7365 203c 636f 6465 3e23 534f 4150 5f49 se #SOAP_I │ │ │ │ +0013dae0: 4f5f 5544 503c 2f63 6f64 653e 2e20 5365 O_UDP. Se │ │ │ │ +0013daf0: 6520 616c 736f 2053 6563 7469 6f6e 203c e also Section < │ │ │ │ +0013db00: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ +0013db10: 663d 2269 6e64 6578 2e68 746d 6c23 5544 f="index.html#UD │ │ │ │ +0013db20: 5022 3e53 4f41 502f 584d 4c20 6f76 6572 P">SOAP/XML over │ │ │ │ +0013db30: 2055 4450 3c2f 613e 2e20 5468 6520 636f UDP. The co │ │ │ │ +0013db40: 6e74 6578 7420 666c 6167 7320 7468 6174 ntext flags that │ │ │ │ +0013db50: 2063 616e 2062 6520 7365 7420 6174 2074 can be set at t │ │ │ │ +0013db60: 6865 2063 6c69 656e 7420 7369 6465 2066 he client side f │ │ │ │ +0013db70: 6f72 2055 4450 206d 6573 7361 6769 6e67 or UDP messaging │ │ │ │ +0013db80: 2061 7265 203c 636f 6465 3e3c 6120 636c are soap::ipv4_m │ │ │ │ +0013dc40: 756c 7469 6361 7374 5f69 663c 2f61 3e3c ulticast_if< │ │ │ │ +0013dc50: 2f63 6f64 653e 2c20 3c63 6f64 653e 3c61 /code>, soap::ipv │ │ │ │ +0013dd10: 345f 6d75 6c74 6963 6173 745f 7474 6c3c 4_multicast_ttl< │ │ │ │ +0013dd20: 2f61 3e3c 2f63 6f64 653e 2c20 616e 6420 /a>, and │ │ │ │ +0013dd30: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 soap: │ │ │ │ +0013ddd0: 3a69 7076 365f 6d75 6c74 6963 6173 745f :ipv6_multicast_ │ │ │ │ +0013dde0: 6966 3c2f 613e 3c2f 636f 6465 3e3a 3c2f if:. │ │ │ │ +0013de10: 0a3c 7472 2063 6c61 7373 3d22 6d61 726b .. │ │ │ │ +0013de30: 3c74 6820 636c 6173 733d 226d 6172 6b64 .. │ │ │ │ +0013dee0: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 s │ │ │ │ +0013df90: 6f61 703a 3a69 7076 345f 6d75 6c74 6963 oap::ipv4_multic │ │ │ │ +0013dfa0: 6173 745f 6966 3c2f 613e 3c2f 636f 6465 ast_if .. │ │ │ │ +0013e150: 3c74 6420 636c 6173 733d 226d 6172 6b64 ...
    context flag │ │ │ │ +0013de60: 203c 2f74 683e 3c74 6820 636c 6173 733d result │ │ │ │ +0013de90: 2020 3c2f 7468 3e3c 2f74 723e 0a3c 7472
    set < │ │ │ │ +0013dfe0: 636f 6465 3e73 6574 736f 636b 6f70 743c code>setsockopt< │ │ │ │ +0013dff0: 2f63 6f64 653e 206c 6576 656c 203c 636f /code> level IPPROTO_IP to IP │ │ │ │ +0013e020: 5f4d 554c 5449 4341 5354 5f49 463c 2f63 _MULTICAST_IF with value │ │ │ │ +0013e040: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 s │ │ │ │ +0013e0f0: 6f61 703a 3a69 7076 345f 6d75 6c74 6963 oap::ipv4_multic │ │ │ │ +0013e100: 6173 745f 6966 3c2f 613e 3c2f 636f 6465 ast_if when non-NULL │ │ │ │ +0013e120: 2020 203c 2f74 643e 3c2f 7472 3e0a 3c74
    soap::ipv4_mult │ │ │ │ +0013e230: 6963 6173 745f 7474 6c3c 2f61 3e3c 2f63 icast_ttl se │ │ │ │ +0013e270: 7420 3c63 6f64 653e 7365 7473 6f63 6b6f t setsocko │ │ │ │ +0013e280: 7074 3c2f 636f 6465 3e20 6c65 7665 6c20 pt level │ │ │ │ +0013e290: 3c63 6f64 653e 4950 5052 4f54 4f5f 4950 IPPROTO_IP │ │ │ │ +0013e2a0: 3c2f 636f 6465 3e20 746f 203c 636f 6465 to IP_MULTICAST_TT │ │ │ │ +0013e2c0: 4c3c 2f63 6f64 653e 2077 6974 6820 7661 L with va │ │ │ │ +0013e2d0: 6c75 6520 3c63 6f64 653e 3c61 2063 6c61 lue soap::ipv4_mu │ │ │ │ +0013e390: 6c74 6963 6173 745f 7474 6c3c 2f61 3e3c lticast_ttl< │ │ │ │ +0013e3a0: 2f63 6f64 653e 2077 6865 6e20 6e6f 6e7a /code> when nonz │ │ │ │ +0013e3b0: 6572 6f20 2020 203c 2f74 643e 3c2f 7472 ero
    │ │ │ │ +0013e4a0: 736f 6170 3a3a 6970 7636 5f6d 756c 7469 soap::ipv6_multi │ │ │ │ +0013e4b0: 6361 7374 5f69 663c 2f61 3e3c 2f63 6f64 cast_if set │ │ │ │ +0013e4f0: 3c63 6f64 653e 736f 636b 6164 6472 5f69 sockaddr_i │ │ │ │ +0013e500: 6e36 3a3a 7369 6e36 5f73 636f 7065 5f69 n6::sin6_scope_i │ │ │ │ +0013e510: 643c 2f63 6f64 653e 2074 6f20 3c63 6f64 d to soap::ipv │ │ │ │ +0013e5c0: 365f 6d75 6c74 6963 6173 745f 6966 3c2f 6_multicast_if when n │ │ │ │ +0013e5e0: 6f6e 7a65 726f 2020 203c 2f74 643e 3c2f onzero
    .

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

    .Run- │ │ │ │ +0013e660: 7469 6d65 2065 7272 6f72 2063 6f64 6573 time error codes │ │ │ │ +0013e670: 3c2f 6831 3e0a 3c70 3e53 7461 7475 7320

    .

    Status │ │ │ │ +0013e680: 6572 726f 7220 636f 6465 7320 6172 6520 error codes are │ │ │ │ +0013e690: 696e 7465 6765 7220 7661 6c75 6573 2c20 integer values, │ │ │ │ +0013e6a0: 7768 6963 6820 6172 6520 7265 7475 726e which are return │ │ │ │ +0013e6b0: 6564 2062 7920 7468 6520 6753 4f41 5020 ed by the gSOAP │ │ │ │ +0013e6c0: 4150 4920 6675 6e63 7469 6f6e 732e 2054 API functions. T │ │ │ │ +0013e6d0: 6865 2066 756c 6c20 6c69 7374 206f 6620 he full list of │ │ │ │ +0013e6e0: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 soap_stat │ │ │ │ +0013e7a0: 7573 3c2f 613e 3c2f 636f 6465 3e20 6572 us er │ │ │ │ +0013e7b0: 726f 7220 636f 6465 7320 6973 206c 6973 ror codes is lis │ │ │ │ +0013e7c0: 7465 6420 6265 6c6f 773a 3c2f 703e 0a3c ted below:

    .< │ │ │ │ +0013e7d0: 7461 626c 6520 636c 6173 733d 226d 6172 table class="mar │ │ │ │ +0013e7e0: 6b64 6f77 6e54 6162 6c65 223e 0a3c 7472 kdownTable">..Er │ │ │ │ +0013e830: 726f 7220 636f 6465 2020 203c 2f74 683e ror code │ │ │ │ +0013e840: 3c74 6820 636c 6173 733d 226d 6172 6b64 Description │ │ │ │ +0013e870: 203c 2f74 683e 3c2f 7472 3e0a 3c74 7220 ..< │ │ │ │ +0013e8c0: 636f 6465 3e23 534f 4150 5f4f 4b3c 2f63 code>#SOAP_OK No │ │ │ │ +0013e900: 2065 7272 6f72 2028 7a65 726f 2920 2020 error (zero) │ │ │ │ +0013e910: 203c 2f74 643e 3c2f 7472 3e0a 3c74 7220 .. │ │ │ │ +0013e960: 3c63 6f64 653e 2353 4f41 505f 434c 495f #SOAP_CLI_ │ │ │ │ +0013e970: 4641 554c 543c 2f63 6f64 653e 2020 203c FAULT < │ │ │ │ +0013e980: 2f74 643e 3c74 6420 636c 6173 733d 226d /td>The servic │ │ │ │ +0013e9b0: 6520 7265 7475 726e 6564 2061 2053 4f41 e returned a SOA │ │ │ │ +0013e9c0: 5020 312e 3120 636c 6965 6e74 2066 6175 P 1.1 client fau │ │ │ │ +0013e9d0: 6c74 202f 2053 4f41 5020 312e 3220 7365 lt / SOAP 1.2 se │ │ │ │ +0013e9e0: 6e64 6572 2066 6175 6c74 2074 6f20 7468 nder fault to th │ │ │ │ +0013e9f0: 6520 636c 6965 6e74 2020 2020 3c2f 7464 e client .. │ │ │ │ +0013ea50: 2353 4f41 505f 4441 5441 454e 434f 4449 #SOAP_DATAENCODI │ │ │ │ +0013ea60: 4e47 554e 4b4e 4f57 4e3c 2f63 6f64 653e NGUNKNOWN │ │ │ │ +0013ea70: 2020 203c 2f74 643e 3c74 6420 636c 6173 SOAP 1 │ │ │ │ +0013eaa0: 2e32 2044 6174 6145 6e63 6f64 696e 6755 .2 DataEncodingU │ │ │ │ +0013eab0: 6e6b 6e6f 776e 2066 6175 6c74 2020 2020 nknown fault │ │ │ │ +0013eac0: 3c2f 7464 3e3c 2f74 723e 0a3c 7472 2063 ..< │ │ │ │ +0013eb10: 636f 6465 3e23 534f 4150 5f44 454c 5f4d code>#SOAP_DEL_M │ │ │ │ +0013eb20: 4554 484f 443c 2f63 6f64 653e 2020 203c ETHOD
    < │ │ │ │ +0013eb30: 2f74 643e 3c74 6420 636c 6173 733d 226d /td>An HTTP DE │ │ │ │ +0013eb60: 4c45 5445 2072 6571 7565 7374 2077 6173 LETE request was │ │ │ │ +0013eb70: 2072 6563 6569 7665 6420 6279 2074 6865 received by the │ │ │ │ +0013eb80: 2073 6572 7669 6365 2062 7574 2074 6865 service but the │ │ │ │ +0013eb90: 2044 454c 4554 4520 7265 7175 6573 7420 DELETE request │ │ │ │ +0013eba0: 6361 6c6c 6261 636b 203c 636f 6465 3e3c callback < │ │ │ │ +0013ebb0: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ +0013ebc0: 663d 2267 726f 7570 5f5f 6772 6f75 705f f="group__group_ │ │ │ │ +0013ebd0: 5f63 616c 6c62 6163 6b73 2e68 746d 6c23 _callbacks.html# │ │ │ │ +0013ebe0: 6761 6632 6264 6130 3138 3734 3839 6338 gaf2bda0187489c8 │ │ │ │ +0013ebf0: 6632 6239 3835 3766 3631 6239 3661 6430 f2b9857f61b96ad0 │ │ │ │ +0013ec00: 6530 2220 7469 746c 653d 2243 616c 6c62 e0" title="Callb │ │ │ │ +0013ec10: 6163 6b20 746f 2069 6d70 6c65 6d65 6e74 ack to implement │ │ │ │ +0013ec20: 206c 6f67 6963 2061 7420 7468 6520 7365 logic at the se │ │ │ │ +0013ec30: 7276 6572 2d73 6964 6520 746f 2073 6572 rver-side to ser │ │ │ │ +0013ec40: 7665 2072 6573 706f 6e73 6573 2074 6f20 ve responses to │ │ │ │ +0013ec50: 4854 5450 2044 454c 4554 4520 7265 7175 HTTP DELETE requ │ │ │ │ +0013ec60: 6573 7473 2066 726f 6d20 636c 6965 6e74 ests from client │ │ │ │ +0013ec70: 2e2e 2e22 3e73 6f61 703a 3a66 6465 6c3c ...">soap::fdel< │ │ │ │ +0013ec80: 2f61 3e3c 2f63 6f64 653e 2069 7320 6e6f /a> is no │ │ │ │ +0013ec90: 7420 696d 706c 656d 656e 7465 642c 2073 t implemented, s │ │ │ │ +0013eca0: 6565 2053 6563 7469 6f6e 203c 6120 636c ee Section Function cal │ │ │ │ +0013ece0: 6c62 6163 6b73 2066 6f72 2063 7573 746f lbacks for custo │ │ │ │ +0013ecf0: 6d69 7a65 6420 492f 4f20 616e 6420 4854 mized I/O and HT │ │ │ │ +0013ed00: 5450 2068 616e 646c 696e 673c 2f61 3e20 TP handling │ │ │ │ +0013ed10: 2020 203c 2f74 643e 3c2f 7472 3e0a 3c74 ..< │ │ │ │ +0013ed40: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ │ +0013ed50: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ │ +0013ed60: 3e3c 636f 6465 3e23 534f 4150 5f44 494d >#SOAP_DIM │ │ │ │ +0013ed70: 455f 454e 443c 2f63 6f64 653e 2020 203c E_END < │ │ │ │ +0013ed80: 2f74 643e 3c74 6420 636c 6173 733d 226d /td>End of DIM │ │ │ │ +0013edb0: 4520 6174 7461 6368 6d65 6e74 7320 7072 E attachments pr │ │ │ │ +0013edc0: 6f74 6f63 6f6c 2065 7272 6f72 2020 2020 otocol error │ │ │ │ +0013edd0: 3c2f 7464 3e3c 2f74 723e 0a3c 7472 2063 ..< │ │ │ │ +0013ee20: 636f 6465 3e23 534f 4150 5f44 494d 455f code>#SOAP_DIME_ │ │ │ │ +0013ee30: 4552 524f 523c 2f63 6f64 653e 2020 203c ERROR
    < │ │ │ │ +0013ee40: 2f74 643e 3c74 6420 636c 6173 733d 226d /td>DIME forma │ │ │ │ +0013ee70: 7474 696e 6720 6572 726f 7220 6f72 2044 tting error or D │ │ │ │ +0013ee80: 494d 4520 6174 7461 6368 6d65 6e74 2073 IME attachment s │ │ │ │ +0013ee90: 697a 6520 6578 6365 6564 7320 3c63 6f64 ize exceeds #SOAP_MAXDIMES │ │ │ │ +0013eeb0: 495a 453c 2f63 6f64 653e 2020 2020 3c2f IZE
    ..#SOAP_DIME_HRE │ │ │ │ +0013ef20: 463c 2f63 6f64 653e 2020 203c 2f74 643e F
    │ │ │ │ +0013ef30: 3c74 6420 636c 6173 733d 226d 6172 6b64 DIME attachmen │ │ │ │ +0013ef60: 7420 6861 7320 6e6f 2068 7265 6620 6672 t has no href fr │ │ │ │ +0013ef70: 6f6d 2053 4f41 5020 626f 6479 2061 6e64 om SOAP body and │ │ │ │ +0013ef80: 206e 6f20 4449 4d45 2063 616c 6c62 6163 no DIME callbac │ │ │ │ +0013ef90: 6b73 2077 6572 6520 6465 6669 6e65 6420 ks were defined │ │ │ │ +0013efa0: 746f 2073 6176 6520 7468 6520 6174 7461 to save the atta │ │ │ │ +0013efb0: 6368 6d65 6e74 2020 2020 3c2f 7464 3e3c chment < │ │ │ │ +0013efc0: 2f74 723e 0a3c 7472 2063 6c61 7373 3d22 /tr>..# │ │ │ │ +0013f010: 534f 4150 5f44 494d 455f 4d49 534d 4154 SOAP_DIME_MISMAT │ │ │ │ +0013f020: 4348 3c2f 636f 6465 3e20 2020 3c2f 7464 CH DIME version │ │ │ │ +0013f060: 6572 726f 7220 2020 203c 2f74 643e 3c2f error ..#SO │ │ │ │ +0013f0c0: 4150 5f44 5550 4c49 4341 5445 5f49 443c AP_DUPLICATE_ID< │ │ │ │ +0013f0d0: 2f63 6f64 653e 2020 203c 2f74 643e 3c74 /code> │ │ │ │ +0013f100: 584d 4c20 656c 656d 656e 7420 6861 7320 XML element has │ │ │ │ +0013f110: 6475 706c 6963 6174 6520 6964 2061 7474 duplicate id att │ │ │ │ +0013f120: 7269 6275 7465 2076 616c 7565 2028 6170 ribute value (ap │ │ │ │ +0013f130: 706c 6963 6162 6c65 2074 6f20 534f 4150 plicable to SOAP │ │ │ │ +0013f140: 206d 756c 7469 2d72 6566 2065 6e63 6f64 multi-ref encod │ │ │ │ +0013f150: 696e 6720 616e 6420 3c63 6f64 653e 2353 ing and #S │ │ │ │ +0013f160: 4f41 505f 584d 4c5f 4752 4150 483c 2f63 OAP_XML_GRAPH serializati │ │ │ │ +0013f180: 6f6e 2920 2020 203c 2f74 643e 3c2f 7472 on) ..#SOA │ │ │ │ +0013f1e0: 505f 454d 5054 593c 2f63 6f64 653e 2020 P_EMPTY │ │ │ │ +0013f1f0: 203c 2f74 643e 3c74 6420 636c 6173 733d XML elem │ │ │ │ +0013f220: 656e 7420 6f72 2061 7474 7269 6275 7465 ent or attribute │ │ │ │ +0013f230: 2069 7320 656d 7074 7920 7768 656e 2061 is empty when a │ │ │ │ +0013f240: 2076 616c 7565 2069 7320 7265 7175 6972 value is requir │ │ │ │ +0013f250: 6564 2020 2020 3c2f 7464 3e3c 2f74 723e ed │ │ │ │ +0013f260: 0a3c 7472 2063 6c61 7373 3d22 6d61 726b ..#SOAP_ │ │ │ │ +0013f2b0: 454f 463c 2f63 6f64 653e 2020 203c 2f74 EOF Unexpected e │ │ │ │ +0013f2f0: 6e64 206f 6620 6669 6c65 2c20 6e6f 2069 nd of file, no i │ │ │ │ +0013f300: 6e70 7574 2c20 7472 616e 736d 6973 7369 nput, transmissi │ │ │ │ +0013f310: 6f6e 2069 6e74 6572 7275 7074 6564 206f on interrupted o │ │ │ │ +0013f320: 7220 7469 6d65 6420 6f75 742c 2073 616d r timed out, sam │ │ │ │ +0013f330: 6520 6173 203c 636f 6465 3e45 4f46 3c2f e as EOF ..#S │ │ │ │ +0013f3a0: 4f41 505f 454f 4d3c 2f63 6f64 653e 2020 OAP_EOM │ │ │ │ +0013f3b0: 203c 2f74 643e 3c74 6420 636c 6173 733d Out of m │ │ │ │ +0013f3e0: 656d 6f72 7920 2020 203c 2f74 643e 3c2f emory ..#SO │ │ │ │ +0013f440: 4150 5f45 5252 3c2f 636f 6465 3e20 2020 AP_ERR │ │ │ │ +0013f450: 3c2f 7464 3e3c 7464 2063 6c61 7373 3d22 Same as < │ │ │ │ +0013f480: 636f 6465 3e45 4f46 3c2f 636f 6465 3e2c code>EOF, │ │ │ │ +0013f490: 2062 7574 2069 6e64 6963 6174 6573 2061 but indicates a │ │ │ │ +0013f4a0: 6e20 756e 7370 6563 6966 6965 6420 6572 n unspecified er │ │ │ │ +0013f4b0: 726f 7220 2020 203c 2f74 643e 3c2f 7472 ror ..#SOA │ │ │ │ +0013f510: 505f 4641 554c 543c 2f63 6f64 653e 2020 P_FAULT │ │ │ │ +0013f520: 203c 2f74 643e 3c74 6420 636c 6173 733d The faul │ │ │ │ +0013f550: 7420 636f 6465 2074 6f20 6265 2072 6574 t code to be ret │ │ │ │ +0013f560: 7572 6e65 6420 6279 2061 2073 6572 7669 urned by a servi │ │ │ │ +0013f570: 6365 206f 7065 7261 7469 6f6e 2077 6865 ce operation whe │ │ │ │ +0013f580: 6e20 6361 6c6c 696e 6720 3c63 6f64 653e n calling │ │ │ │ +0013f590: 3c61 2063 6c61 7373 3d22 656c 2220 6872 so │ │ │ │ +0013f630: 6170 5f73 656e 6465 725f 6661 756c 743c ap_sender_fault< │ │ │ │ +0013f640: 2f61 3e3c 2f63 6f64 653e 2028 636c 6965 /a> (clie │ │ │ │ +0013f650: 6e74 2069 7320 6174 2066 6175 6c74 2920 nt is at fault) │ │ │ │ +0013f660: 6f72 203c 636f 6465 3e3c 6120 636c 6173 or soap_re │ │ │ │ +0013f710: 6365 6976 6572 5f66 6175 6c74 3c2f 613e ceiver_fault │ │ │ │ +0013f720: 3c2f 636f 6465 3e20 2873 6572 7665 7220 (server │ │ │ │ +0013f730: 6973 2061 7420 6661 756c 7429 2c20 636c is at fault), cl │ │ │ │ +0013f740: 6965 6e74 7320 7265 6365 6976 6520 7468 ients receive th │ │ │ │ +0013f750: 6520 6661 756c 7420 6173 203c 636f 6465 e fault as #SOAP_CLI_FAULT │ │ │ │ +0013f770: 3c2f 636f 6465 3e20 6f72 203c 636f 6465 or #SOAP_SVR_FAULT │ │ │ │ +0013f790: 3c2f 636f 6465 3e20 7265 7370 6563 7469 respecti │ │ │ │ +0013f7a0: 7665 6c79 2020 2020 3c2f 7464 3e3c 2f74 vely ..#SOA │ │ │ │ +0013f800: 505f 4644 5f45 5843 4545 4445 443c 2f63 P_FD_EXCEEDED To │ │ │ │ +0013f840: 6f20 6d61 6e79 206f 7065 6e20 736f 636b o many open sock │ │ │ │ +0013f850: 6574 7320 2020 203c 2f74 643e 3c2f 7472 ets ..#SOA │ │ │ │ +0013f8b0: 505f 4649 5845 443c 2f63 6f64 653e 2020 P_FIXED │ │ │ │ +0013f8c0: 203c 2f74 643e 3c74 6420 636c 6173 733d XML elem │ │ │ │ +0013f8f0: 656e 7420 6f72 2061 7474 7269 6275 7465 ent or attribute │ │ │ │ +0013f900: 2076 616c 7565 2069 7320 6669 7865 6420 value is fixed │ │ │ │ +0013f910: 616e 6420 7468 6520 7061 7273 6564 2076 and the parsed v │ │ │ │ +0013f920: 616c 7565 2064 6f65 7320 6e6f 7420 6d61 alue does not ma │ │ │ │ +0013f930: 7463 6820 7468 6520 6669 7865 6420 7661 tch the fixed va │ │ │ │ +0013f940: 6c75 6520 2020 203c 2f74 643e 3c2f 7472 lue ..#SOAP │ │ │ │ +0013f9a0: 5f47 4554 5f4d 4554 484f 443c 2f63 6f64 _GET_METHOD An H │ │ │ │ +0013f9e0: 5454 5020 4745 5420 7265 7175 6573 7420 TTP GET request │ │ │ │ +0013f9f0: 7761 7320 7265 6365 6976 6564 2062 7920 was received by │ │ │ │ +0013fa00: 7468 6520 7365 7276 6963 6520 6275 7420 the service but │ │ │ │ +0013fa10: 7468 6520 4745 5420 7265 7175 6573 7420 the GET request │ │ │ │ +0013fa20: 6361 6c6c 6261 636b 203c 636f 6465 3e3c callback < │ │ │ │ +0013fa30: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ +0013fa40: 663d 2267 726f 7570 5f5f 6772 6f75 705f f="group__group_ │ │ │ │ +0013fa50: 5f63 616c 6c62 6163 6b73 2e68 746d 6c23 _callbacks.html# │ │ │ │ +0013fa60: 6761 6530 3232 3230 3466 6637 3030 3464 gae022204ff7004d │ │ │ │ +0013fa70: 6632 6435 6163 3965 3038 3363 6262 3562 f2d5ac9e083cbb5b │ │ │ │ +0013fa80: 3136 2220 7469 746c 653d 2243 616c 6c62 16" title="Callb │ │ │ │ +0013fa90: 6163 6b20 746f 2069 6d70 6c65 6d65 6e74 ack to implement │ │ │ │ +0013faa0: 206c 6f67 6963 2061 7420 7468 6520 7365 logic at the se │ │ │ │ +0013fab0: 7276 6572 2d73 6964 6520 746f 2073 6572 rver-side to ser │ │ │ │ +0013fac0: 7665 2072 6573 706f 6e73 6573 2074 6f20 ve responses to │ │ │ │ +0013fad0: 4854 5450 2047 4554 2072 6571 7565 7374 HTTP GET request │ │ │ │ +0013fae0: 7320 6672 6f6d 2063 6c69 656e 7473 2e22 s from clients." │ │ │ │ +0013faf0: 3e73 6f61 703a 3a66 6765 743c 2f61 3e3c >soap::fget< │ │ │ │ +0013fb00: 2f63 6f64 653e 2069 7320 6e6f 7420 696d /code> is not im │ │ │ │ +0013fb10: 706c 656d 656e 7465 642c 2073 6565 2053 plemented, see S │ │ │ │ +0013fb20: 6563 7469 6f6e 7320 3c61 2063 6c61 7373 ections How │ │ │ │ +0013fb50: 746f 2069 6d70 6c65 6d65 6e74 2048 5454 to implement HTT │ │ │ │ +0013fb60: 5020 4745 542c 2050 5554 2c20 616e 6420 P GET, PUT, and │ │ │ │ +0013fb70: 5041 5443 4820 7365 7276 6963 6573 3c2f PATCH services and │ │ │ │ +0013fbb0: 4675 6e63 7469 6f6e 2063 616c 6c62 6163 Function callbac │ │ │ │ +0013fbc0: 6b73 2066 6f72 2063 7573 746f 6d69 7a65 ks for customize │ │ │ │ +0013fbd0: 6420 492f 4f20 616e 6420 4854 5450 2068 d I/O and HTTP h │ │ │ │ +0013fbe0: 616e 646c 696e 673c 2f61 3e20 2020 203c andling < │ │ │ │ +0013fbf0: 2f74 643e 3c2f 7472 3e0a 3c74 7220 636c /td>..#SOAP_HREF R │ │ │ │ +0013fc80: 6566 6572 656e 6365 2074 6f20 6f62 6a65 eference to obje │ │ │ │ +0013fc90: 6374 2069 6e20 584d 4c20 6964 656e 7469 ct in XML identi │ │ │ │ +0013fca0: 6669 6564 2062 7920 6974 7320 6964 2061 fied by its id a │ │ │ │ +0013fcb0: 7474 7269 6275 7465 2069 7320 696e 636f ttribute is inco │ │ │ │ +0013fcc0: 6d70 6174 6962 6c65 2077 6974 6820 7468 mpatible with th │ │ │ │ +0013fcd0: 6520 6f62 6a65 6374 2072 6566 6572 7265 e object referre │ │ │ │ +0013fce0: 6420 746f 2062 7920 7468 6520 7265 6620 d to by the ref │ │ │ │ +0013fcf0: 6f72 2068 7265 6620 6174 7472 6962 7574 or href attribut │ │ │ │ +0013fd00: 6520 2861 7070 6c69 6361 626c 6520 746f e (applicable to │ │ │ │ +0013fd10: 2053 4f41 5020 6d75 6c74 692d 7265 6620 SOAP multi-ref │ │ │ │ +0013fd20: 656e 636f 6469 6e67 2061 6e64 203c 636f encoding and #SOAP_XML_GRA │ │ │ │ +0013fd40: 5048 3c2f 636f 6465 3e20 7365 7269 616c PH serial │ │ │ │ +0013fd50: 697a 6174 696f 6e29 2020 2020 3c2f 7464 ization) .. │ │ │ │ +0013fdb0: 2353 4f41 505f 4854 5450 5f45 5252 4f52 #SOAP_HTTP_ERROR │ │ │ │ +0013fdc0: 3c2f 636f 6465 3e20 2020 3c2f 7464 3e3c < │ │ │ │ +0013fdd0: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ │ +0013fde0: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ │ +0013fdf0: 3e41 6e20 756e 7370 6563 6966 6965 6420 >An unspecified │ │ │ │ +0013fe00: 4854 5450 2065 7272 6f72 206f 6363 7572 HTTP error occur │ │ │ │ +0013fe10: 7265 6420 2020 203c 2f74 643e 3c2f 7472 red ..#SOA │ │ │ │ +0013fe70: 505f 4854 5450 5f4d 4554 484f 443c 2f63 P_HTTP_METHOD An │ │ │ │ +0013feb0: 2048 5454 5020 7265 7175 6573 7420 7761 HTTP request wa │ │ │ │ +0013fec0: 7320 7265 6365 6976 6564 2062 7920 7468 s received by th │ │ │ │ +0013fed0: 6520 7365 7276 6963 6520 7468 6174 2063 e service that c │ │ │ │ +0013fee0: 616e 6e6f 7420 6265 2068 616e 646c 6564 annot be handled │ │ │ │ +0013fef0: 2020 2020 3c2f 7464 3e3c 2f74 723e 0a3c .< │ │ │ │ +0013ff00: 7472 2063 6c61 7373 3d22 6d61 726b 646f tr class="markdo │ │ │ │ +0013ff10: 776e 5461 626c 6552 6f77 4f64 6422 3e0a wnTableRowOdd">. │ │ │ │ +0013ff20: 3c74 6420 636c 6173 733d 226d 6172 6b64 #SOAP_IO │ │ │ │ +0013ff50: 423c 2f63 6f64 653e 2020 203c 2f74 643e B │ │ │ │ +0013ff60: 3c74 6420 636c 6173 733d 226d 6172 6b64 SOAP array ind │ │ │ │ +0013ff90: 6578 206f 7574 206f 6620 626f 756e 6473 ex out of bounds │ │ │ │ +0013ffa0: 2020 2020 3c2f 7464 3e3c 2f74 723e 0a3c .< │ │ │ │ +0013ffb0: 7472 2063 6c61 7373 3d22 6d61 726b 646f tr class="markdo │ │ │ │ +0013ffc0: 776e 5461 626c 6552 6f77 4576 656e 223e wnTableRowEven"> │ │ │ │ +0013ffd0: 0a3c 7464 2063 6c61 7373 3d22 6d61 726b .#SOAP_L │ │ │ │ +00140000: 454e 4754 483c 2f63 6f64 653e 2020 203c ENGTH < │ │ │ │ +00140010: 2f74 643e 3c74 6420 636c 6173 733d 226d /td>XML elemen │ │ │ │ +00140040: 7420 6f72 2061 7474 7269 6275 7465 206c t or attribute l │ │ │ │ +00140050: 656e 6774 6820 7661 6c69 6461 7469 6f6e ength validation │ │ │ │ +00140060: 2065 7272 6f72 206f 7220 3c63 6f64 653e error or │ │ │ │ +00140070: 2353 4f41 505f 4d41 584c 454e 4754 483c #SOAP_MAXLENGTH< │ │ │ │ +00140080: 2f63 6f64 653e 2065 7863 6565 6465 6420 /code> exceeded │ │ │ │ +00140090: 2020 203c 2f74 643e 3c2f 7472 3e0a 3c74 ..< │ │ │ │ +001400c0: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ │ +001400d0: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ │ +001400e0: 3e3c 636f 6465 3e23 534f 4150 5f4c 4556 >#SOAP_LEV │ │ │ │ +001400f0: 454c 3c2f 636f 6465 3e20 2020 3c2f 7464 EL XML nesting d │ │ │ │ +00140130: 6570 7468 206c 6576 656c 2065 7863 6565 epth level excee │ │ │ │ +00140140: 6473 203c 636f 6465 3e23 534f 4150 5f4d ds #SOAP_M │ │ │ │ +00140150: 4158 4c45 5645 4c3c 2f63 6f64 653e 2020 AXLEVEL │ │ │ │ +00140160: 2020 3c2f 7464 3e3c 2f74 723e 0a3c 7472 ..< │ │ │ │ +00140190: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ │ +001401a0: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ │ +001401b0: 3e3c 636f 6465 3e23 534f 4150 5f4d 494d >#SOAP_MIM │ │ │ │ +001401c0: 455f 454e 443c 2f63 6f64 653e 2020 203c E_END < │ │ │ │ +001401d0: 2f74 643e 3c74 6420 636c 6173 733d 226d /td>End of MIM │ │ │ │ +00140200: 4520 6174 7461 6368 6d65 6e74 7320 7072 E attachments pr │ │ │ │ +00140210: 6f74 6f63 6f6c 2065 7272 6f72 2020 2020 otocol error │ │ │ │ +00140220: 3c2f 7464 3e3c 2f74 723e 0a3c 7472 2063 ..#SOAP_MIME_E │ │ │ │ +00140280: 5252 4f52 3c2f 636f 6465 3e20 2020 3c2f RROR MIME attach │ │ │ │ +001402c0: 6d65 6e74 2070 6172 7369 6e67 2065 7272 ment parsing err │ │ │ │ +001402d0: 6f72 2020 2020 3c2f 7464 3e3c 2f74 723e or │ │ │ │ +001402e0: 0a3c 7472 2063 6c61 7373 3d22 6d61 726b ..#SOAP │ │ │ │ +00140330: 5f4d 494d 455f 4852 4546 3c2f 636f 6465 _MIME_HREF MIME │ │ │ │ +00140370: 6174 7461 6368 6d65 6e74 2068 6173 206e attachment has n │ │ │ │ +00140380: 6f20 6872 6566 2066 726f 6d20 534f 4150 o href from SOAP │ │ │ │ +00140390: 2062 6f64 7920 616e 6420 6e6f 204d 494d body and no MIM │ │ │ │ +001403a0: 4520 6361 6c6c 6261 636b 7320 7765 7265 E callbacks were │ │ │ │ +001403b0: 2064 6566 696e 6564 2074 6f20 7361 7665 defined to save │ │ │ │ +001403c0: 2074 6865 2061 7474 6163 686d 656e 7420 the attachment │ │ │ │ +001403d0: 2020 203c 2f74 643e 3c2f 7472 3e0a 3c74 ..< │ │ │ │ +00140400: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ │ +00140410: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ │ +00140420: 3e3c 636f 6465 3e23 534f 4150 5f4d 4953 >#SOAP_MIS │ │ │ │ +00140430: 5349 4e47 5f49 443c 2f63 6f64 653e 2020 SING_ID │ │ │ │ +00140440: 203c 2f74 643e 3c74 6420 636c 6173 733d An XML e │ │ │ │ +00140470: 6c65 6d65 6e74 2077 6974 6820 6964 2061 lement with id a │ │ │ │ +00140480: 7474 7269 6275 7465 2069 7320 6d69 7373 ttribute is miss │ │ │ │ +00140490: 696e 6720 7468 6174 2073 686f 756c 6420 ing that should │ │ │ │ +001404a0: 6d61 7463 6820 7468 6520 656c 656d 656e match the elemen │ │ │ │ +001404b0: 7420 7769 7468 2068 7265 662f 7265 6620 t with href/ref │ │ │ │ +001404c0: 6174 7472 6962 7574 6520 2861 7070 6c69 attribute (appli │ │ │ │ +001404d0: 6361 626c 6520 746f 2053 4f41 5020 6d75 cable to SOAP mu │ │ │ │ +001404e0: 6c74 692d 7265 6620 656e 636f 6469 6e67 lti-ref encoding │ │ │ │ +001404f0: 2061 6e64 203c 636f 6465 3e23 534f 4150 and #SOAP │ │ │ │ +00140500: 5f58 4d4c 5f47 5241 5048 3c2f 636f 6465 _XML_GRAPH serialization) │ │ │ │ +00140520: 2020 2020 3c2f 7464 3e3c 2f74 723e 0a3c .< │ │ │ │ +00140530: 7472 2063 6c61 7373 3d22 6d61 726b 646f tr class="markdo │ │ │ │ +00140540: 776e 5461 626c 6552 6f77 4576 656e 223e wnTableRowEven"> │ │ │ │ +00140550: 0a3c 7464 2063 6c61 7373 3d22 6d61 726b .#SOAP_M │ │ │ │ +00140580: 4f45 3c2f 636f 6465 3e20 2020 3c2f 7464 OE Memory overfl │ │ │ │ +001405c0: 6f77 206f 7220 6d65 6d6f 7279 2063 6f72 ow or memory cor │ │ │ │ +001405d0: 7275 7074 696f 6e20 6572 726f 7220 2861 ruption error (a │ │ │ │ +001405e0: 7070 6c69 6361 626c 6520 696e 203c 636f pplicable in #DEBUG │ │ │ │ +00140600: 206d 6f64 6520 6f6e 6c79 2920 2020 203c mode only) < │ │ │ │ +00140610: 2f74 643e 3c2f 7472 3e0a 3c74 7220 636c /td>..#SOAP_MUSTUND │ │ │ │ +00140670: 4552 5354 414e 443c 2f63 6f64 653e 2020 ERSTAND
    │ │ │ │ +00140680: 203c 2f74 643e 3c74 6420 636c 6173 733d An XML e │ │ │ │ +001406b0: 6c65 6d65 6e74 2069 7320 7072 6573 656e lement is presen │ │ │ │ +001406c0: 7420 7769 7468 2061 206d 7573 7455 6e64 t with a mustUnd │ │ │ │ +001406d0: 6572 7374 616e 6420 6174 7472 6962 7574 erstand attribut │ │ │ │ +001406e0: 6520 7768 6963 6820 6d75 7374 2062 6520 e which must be │ │ │ │ +001406f0: 756e 6465 7273 746f 6f64 2062 7574 2069 understood but i │ │ │ │ +00140700: 7320 6e6f 7420 6465 7365 7269 616c 697a s not deserializ │ │ │ │ +00140710: 6564 2020 2020 3c2f 7464 3e3c 2f74 723e ed │ │ │ │ +00140720: 0a3c 7472 2063 6c61 7373 3d22 6d61 726b ..#SOAP │ │ │ │ +00140770: 5f4e 414d 4553 5041 4345 3c2f 636f 6465 _NAMESPACE XML n │ │ │ │ +001407b0: 616d 6573 7061 6365 206e 616d 6520 6d69 amespace name mi │ │ │ │ +001407c0: 736d 6174 6368 2076 616c 6964 6174 696f smatch validatio │ │ │ │ +001407d0: 6e20 6572 726f 7220 2020 203c 2f74 643e n error │ │ │ │ +001407e0: 3c2f 7472 3e0a 3c74 7220 636c 6173 733d ..# │ │ │ │ +00140830: 534f 4150 5f4e 4f5f 4441 5441 3c2f 636f SOAP_NO_DATA No │ │ │ │ +00140870: 6461 7461 2069 6e20 7468 6520 4854 5450 data in the HTTP │ │ │ │ +00140880: 2062 6f64 7920 6f66 2074 6865 206d 6573 body of the mes │ │ │ │ +00140890: 7361 6765 2072 6563 6569 7665 6420 2020 sage received │ │ │ │ +001408a0: 203c 2f74 643e 3c2f 7472 3e0a 3c74 7220 .. │ │ │ │ +001408f0: 3c63 6f64 653e 2353 4f41 505f 4e4f 5f4d #SOAP_NO_M │ │ │ │ +00140900: 4554 484f 443c 2f63 6f64 653e 2020 203c ETHOD < │ │ │ │ +00140910: 2f74 643e 3c74 6420 636c 6173 733d 226d /td>The servic │ │ │ │ +00140940: 6520 7265 7175 6573 7420 6469 7370 6174 e request dispat │ │ │ │ +00140950: 6368 6572 2064 6964 206e 6f74 2066 696e cher did not fin │ │ │ │ +00140960: 6420 6120 6d61 7463 6869 6e67 2073 6572 d a matching ser │ │ │ │ +00140970: 7669 6365 206f 7065 7261 7469 6f6e 2066 vice operation f │ │ │ │ +00140980: 6f72 2061 2073 6572 7669 6365 2072 6571 or a service req │ │ │ │ +00140990: 7565 7374 2020 2020 3c2f 7464 3e3c 2f74 uest ..#SOA │ │ │ │ +001409f0: 505f 4e4f 5f54 4147 3c2f 636f 6465 3e20 P_NO_TAG │ │ │ │ +00140a00: 2020 3c2f 7464 3e3c 7464 2063 6c61 7373 No XML │ │ │ │ +00140a30: 656c 656d 656e 7420 7461 6720 7761 7320 element tag was │ │ │ │ +00140a40: 666f 756e 6420 7768 656e 206f 6e65 2077 found when one w │ │ │ │ +00140a50: 6173 2065 7870 6563 7465 6420 2020 203c as expected < │ │ │ │ +00140a60: 2f74 643e 3c2f 7472 3e0a 3c74 7220 636c /td>..#SOAP_NTLM_E │ │ │ │ +00140ac0: 5252 4f52 3c2f 636f 6465 3e20 2020 3c2f RROR An NTLM aut │ │ │ │ +00140b00: 6865 6e74 6963 6174 696f 6e20 6861 6e64 hentication hand │ │ │ │ +00140b10: 7368 616b 6520 6572 726f 7220 6f63 6375 shake error occu │ │ │ │ +00140b20: 7272 6564 2020 2020 3c2f 7464 3e3c 2f74 rred ..#SOA │ │ │ │ +00140b80: 505f 4e55 4c4c 3c2f 636f 6465 3e20 2020 P_NULL │ │ │ │ +00140b90: 3c2f 7464 3e3c 7464 2063 6c61 7373 3d22 XML eleme │ │ │ │ +00140bc0: 6e74 2068 6173 2061 6e20 3c63 6f64 653e nt has an │ │ │ │ +00140bd0: 7873 693a 6e69 6c3c 2f63 6f64 653e 2061 xsi:nil a │ │ │ │ +00140be0: 7474 7269 6275 7465 2077 6865 6e20 7468 ttribute when th │ │ │ │ +00140bf0: 6520 656c 656d 656e 7420 6973 206e 6f74 e element is not │ │ │ │ +00140c00: 206e 696c 6c61 626c 652c 2063 6175 7369 nillable, causi │ │ │ │ +00140c10: 6e67 2061 2076 616c 6964 6174 696f 6e20 ng a validation │ │ │ │ +00140c20: 6572 726f 7220 2020 203c 2f74 643e 3c2f error ..#S │ │ │ │ +00140c80: 4f41 505f 4f43 4355 5253 3c2f 636f 6465 OAP_OCCURS XML e │ │ │ │ +00140cc0: 6c65 6d65 6e74 206d 696e 4f63 6375 7273 lement minOccurs │ │ │ │ +00140cd0: 206f 7220 6d61 784f 6363 7572 7320 7661 or maxOccurs va │ │ │ │ +00140ce0: 6c69 6461 7469 6f6e 2065 7272 6f72 206f lidation error o │ │ │ │ +00140cf0: 7220 3c63 6f64 653e 2353 4f41 505f 4d41 r #SOAP_MA │ │ │ │ +00140d00: 584f 4343 5552 533c 2f63 6f64 653e 2065 XOCCURS e │ │ │ │ +00140d10: 7863 6565 6465 6420 2020 203c 2f74 643e xceeded │ │ │ │ +00140d20: 3c2f 7472 3e0a 3c74 7220 636c 6173 733d ..# │ │ │ │ +00140d70: 534f 4150 5f50 4154 4348 5f4d 4554 484f SOAP_PATCH_METHO │ │ │ │ +00140d80: 443c 2f63 6f64 653e 2020 203c 2f74 643e D │ │ │ │ +00140d90: 3c74 6420 636c 6173 733d 226d 6172 6b64 An HTTP PATCH │ │ │ │ +00140dc0: 7265 7175 6573 7420 7761 7320 7265 6365 request was rece │ │ │ │ +00140dd0: 6976 6564 2062 7920 7468 6520 7365 7276 ived by the serv │ │ │ │ +00140de0: 6963 6520 6275 7420 7468 6520 5041 5443 ice but the PATC │ │ │ │ +00140df0: 4820 7265 7175 6573 7420 6361 6c6c 6261 H request callba │ │ │ │ +00140e00: 636b 203c 636f 6465 3e3c 6120 636c 6173 ck s │ │ │ │ +00140ed0: 6f61 703a 3a66 7061 7463 683c 2f61 3e3c oap::fpatch< │ │ │ │ +00140ee0: 2f63 6f64 653e 2069 7320 6e6f 7420 696d /code> is not im │ │ │ │ +00140ef0: 706c 656d 656e 7465 642c 2073 6565 2053 plemented, see S │ │ │ │ +00140f00: 6563 7469 6f6e 203c 6120 636c 6173 733d ection │ │ │ │ +00140f30: 4675 6e63 7469 6f6e 2063 616c 6c62 6163 Function callbac │ │ │ │ +00140f40: 6b73 2066 6f72 2063 7573 746f 6d69 7a65 ks for customize │ │ │ │ +00140f50: 6420 492f 4f20 616e 6420 4854 5450 2068 d I/O and HTTP h │ │ │ │ +00140f60: 616e 646c 696e 673c 2f61 3e20 2020 203c andling < │ │ │ │ +00140f70: 2f74 643e 3c2f 7472 3e0a 3c74 7220 636c /td>..#SOAP_PATTER │ │ │ │ +00140fd0: 4e3c 2f63 6f64 653e 2020 203c 2f74 643e N │ │ │ │ +00140fe0: 3c74 6420 636c 6173 733d 226d 6172 6b64 XML element or │ │ │ │ +00141010: 2061 7474 7269 6275 7465 2076 616c 7565 attribute value │ │ │ │ +00141020: 2070 6174 7465 726e 206d 6973 6d61 7463 pattern mismatc │ │ │ │ +00141030: 6820 2020 203c 2f74 643e 3c2f 7472 3e0a h . │ │ │ │ +00141040: 3c74 7220 636c 6173 733d 226d 6172 6b64 │ │ │ │ +00141060: 0a3c 7464 2063 6c61 7373 3d22 6d61 726b .#SOAP_P │ │ │ │ +00141090: 4c55 4749 4e5f 4552 524f 523c 2f63 6f64 LUGIN_ERROR Fail │ │ │ │ +001410d0: 6564 2074 6f20 7265 6769 7374 6572 2070 ed to register p │ │ │ │ +001410e0: 6c75 6769 6e20 2020 203c 2f74 643e 3c2f lugin ..#S │ │ │ │ +00141140: 4f41 505f 5052 4f48 4942 4954 4544 3c2f OAP_PROHIBITED X │ │ │ │ +00141180: 4d4c 2061 7474 7269 6275 7465 2069 7320 ML attribute is │ │ │ │ +00141190: 7072 6f68 6962 6974 6564 2062 7574 2070 prohibited but p │ │ │ │ +001411a0: 7265 7365 6e74 2020 2020 3c2f 7464 3e3c resent < │ │ │ │ +001411b0: 2f74 723e 0a3c 7472 2063 6c61 7373 3d22 /tr>..#S │ │ │ │ +00141200: 4f41 505f 5055 545f 4d45 5448 4f44 3c2f OAP_PUT_METHOD A │ │ │ │ +00141240: 6e20 4854 5450 2050 5554 2072 6571 7565 n HTTP PUT reque │ │ │ │ +00141250: 7374 2077 6173 2072 6563 6569 7665 6420 st was received │ │ │ │ +00141260: 6279 2074 6865 2073 6572 7669 6365 2062 by the service b │ │ │ │ +00141270: 7574 2074 6865 2050 5554 2072 6571 7565 ut the PUT reque │ │ │ │ +00141280: 7374 2063 616c 6c62 6163 6b20 3c63 6f64 st callback soap::fput is not │ │ │ │ +00141370: 2069 6d70 6c65 6d65 6e74 6564 2c20 7365 implemented, se │ │ │ │ +00141380: 6520 5365 6374 696f 6e20 3c61 2063 6c61 e Section Function call │ │ │ │ +001413c0: 6261 636b 7320 666f 7220 6375 7374 6f6d backs for custom │ │ │ │ +001413d0: 697a 6564 2049 2f4f 2061 6e64 2048 5454 ized I/O and HTT │ │ │ │ +001413e0: 5020 6861 6e64 6c69 6e67 3c2f 613e 2020 P handling │ │ │ │ +001413f0: 2020 3c2f 7464 3e3c 2f74 723e 0a3c 7472 ..< │ │ │ │ +00141420: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ │ +00141430: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ │ +00141440: 3e3c 636f 6465 3e23 534f 4150 5f52 4551 >#SOAP_REQ │ │ │ │ +00141450: 5549 5245 443c 2f63 6f64 653e 2020 203c UIRED < │ │ │ │ +00141460: 2f74 643e 3c74 6420 636c 6173 733d 226d /td>XML attrib │ │ │ │ +00141490: 7574 6520 6973 2072 6571 7569 7265 6420 ute is required │ │ │ │ +001414a0: 6275 7420 6e6f 7420 7072 6573 656e 7420 but not present │ │ │ │ +001414b0: 2020 203c 2f74 643e 3c2f 7472 3e0a 3c74 ..< │ │ │ │ +001414e0: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ │ +001414f0: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ │ +00141500: 3e3c 636f 6465 3e23 534f 4150 5f53 534c >#SOAP_SSL │ │ │ │ +00141510: 5f45 5252 4f52 3c2f 636f 6465 3e20 2020 _ERROR │ │ │ │ +00141520: 3c2f 7464 3e3c 7464 2063 6c61 7373 3d22 An SSL er │ │ │ │ +00141550: 726f 7220 6f63 6375 7272 6564 2020 2020 ror occurred │ │ │ │ +00141560: 3c2f 7464 3e3c 2f74 723e 0a3c 7472 2063 ..< │ │ │ │ +001415b0: 636f 6465 3e23 534f 4150 5f53 5652 5f46 code>#SOAP_SVR_F │ │ │ │ +001415c0: 4155 4c54 3c2f 636f 6465 3e20 2020 3c2f AULT The service │ │ │ │ +00141600: 2072 6574 7572 6e65 6420 6120 534f 4150 returned a SOAP │ │ │ │ +00141610: 2031 2e31 2073 6572 7665 7220 6661 756c 1.1 server faul │ │ │ │ +00141620: 7420 6f72 2053 4f41 5020 312e 3220 7265 t or SOAP 1.2 re │ │ │ │ +00141630: 6365 6976 6572 2066 6175 6c74 2074 6f20 ceiver fault to │ │ │ │ +00141640: 7468 6520 636c 6965 6e74 2020 2020 3c2f the client ..#SOAP_SYNTAX_E │ │ │ │ +001416b0: 5252 4f52 3c2f 636f 6465 3e20 2020 3c2f RROR An XML synt │ │ │ │ +001416f0: 6178 2065 7272 6f72 206f 6363 7572 7265 ax error occurre │ │ │ │ +00141700: 6420 7768 696c 6520 7061 7273 696e 6720 d while parsing │ │ │ │ +00141710: 7468 6520 696e 7075 7420 2020 203c 2f74 the input ..#SOAP_TAG_MISM │ │ │ │ +00141780: 4154 4348 3c2f 636f 6465 3e20 2020 3c2f ATCH
    XML element │ │ │ │ +001417c0: 2074 6167 2070 6172 7365 6420 646f 6573 tag parsed does │ │ │ │ +001417d0: 206e 6f74 206d 6174 6368 2061 6e79 7468 not match anyth │ │ │ │ +001417e0: 696e 6720 7468 6174 2069 7320 6578 7065 ing that is expe │ │ │ │ +001417f0: 6374 6564 2020 2020 3c2f 7464 3e3c 2f74 cted ..#SOA │ │ │ │ +00141850: 505f 5443 505f 4552 524f 523c 2f63 6f64 P_TCP_ERROR A TC │ │ │ │ +00141890: 502f 4950 2063 6f6e 6e65 6374 696f 6e20 P/IP connection │ │ │ │ +001418a0: 6572 726f 7220 6f63 6375 7272 6564 2020 error occurred │ │ │ │ +001418b0: 2020 3c2f 7464 3e3c 2f74 723e 0a3c 7472 ..< │ │ │ │ +001418e0: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ │ +001418f0: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ │ +00141900: 3e3c 636f 6465 3e23 534f 4150 5f54 5950 >#SOAP_TYP │ │ │ │ +00141910: 453c 2f63 6f64 653e 2020 203c 2f74 643e E │ │ │ │ +00141920: 3c74 6420 636c 6173 733d 226d 6172 6b64 XML element or │ │ │ │ +00141950: 2061 7474 7269 6275 7465 2068 6173 2061 attribute has a │ │ │ │ +00141960: 206d 6973 6d61 7463 6869 6e67 2074 7970 mismatching typ │ │ │ │ +00141970: 6520 6f72 2076 616c 7565 2074 6861 7420 e or value that │ │ │ │ +00141980: 6973 2063 6175 7369 6e67 2061 2076 616c is causing a val │ │ │ │ +00141990: 6964 6174 696f 6e20 6572 726f 7220 2020 idation error │ │ │ │ +001419a0: 203c 2f74 643e 3c2f 7472 3e0a 3c74 7220 ..< │ │ │ │ +001419f0: 636f 6465 3e23 534f 4150 5f55 4450 5f45 code>#SOAP_UDP_E │ │ │ │ +00141a00: 5252 4f52 3c2f 636f 6465 3e20 2020 3c2f RROR A UDP/IP co │ │ │ │ +00141a40: 6e6e 6563 7469 6f6e 2065 7272 6f72 206f nnection error o │ │ │ │ +00141a50: 6363 7572 7265 6420 6f72 2074 6865 206d ccurred or the m │ │ │ │ +00141a60: 6573 7361 6765 2074 6f6f 206c 6172 6765 essage too large │ │ │ │ +00141a70: 2074 6f20 7374 6f72 6520 696e 2061 2055 to store in a U │ │ │ │ +00141a80: 4450 2070 6163 6b65 7420 2020 203c 2f74 DP packet ..#SOAP_USER_ERR │ │ │ │ +00141af0: 4f52 3c2f 636f 6465 3e20 2020 3c2f 7464 OR soap: │ │ │ │ +00141be0: 3a75 7365 723c 2f61 3e20 6e6f 7420 7365 :user not se │ │ │ │ +00141bf0: 7420 746f 206e 6f6e 2d4e 554c 4c20 2020 t to non-NULL │ │ │ │ +00141c00: 203c 2f74 643e 3c2f 7472 3e0a 3c74 7220 ..< │ │ │ │ +00141c50: 636f 6465 3e23 534f 4150 5f55 5446 5f45 code>#SOAP_UTF_E │ │ │ │ +00141c60: 5252 4f52 3c2f 636f 6465 3e20 2020 3c2f RROR
    An UTF-8 de │ │ │ │ +00141ca0: 636f 6469 6e67 2065 7272 6f72 206f 6363 coding error occ │ │ │ │ +00141cb0: 7572 7265 6420 2020 203c 2f74 643e 3c2f urred ..#S │ │ │ │ +00141d10: 4f41 505f 5645 5253 494f 4e4d 4953 4d41 OAP_VERSIONMISMA │ │ │ │ +00141d20: 5443 483c 2f63 6f64 653e 2020 203c 2f74 TCH SOAP version │ │ │ │ +00141d60: 206d 6973 6d61 7463 6820 6f72 206e 6f20 mismatch or no │ │ │ │ +00141d70: 534f 4150 206d 6573 7361 6765 2069 7320 SOAP message is │ │ │ │ +00141d80: 7265 6365 6976 6564 2020 2020 3c2f 7464 received .. │ │ │ │ +00141de0: 2353 4f41 505f 5a4c 4942 5f45 5252 4f52 #SOAP_ZLIB_ERROR │ │ │ │ +00141df0: 3c2f 636f 6465 3e20 2020 3c2f 7464 3e3c < │ │ │ │ +00141e00: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ │ +00141e10: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ │ +00141e20: 3e41 207a 6c69 6220 6572 726f 7220 6f63 >A zlib error oc │ │ │ │ +00141e30: 6375 7272 6564 2020 203c 2f74 643e 3c2f curred ..

    │ │ │ │ +00141e50: 4120 7374 6174 7573 2063 6f64 6520 6f66 A status code of │ │ │ │ +00141e60: 203c 636f 6465 3e23 534f 4150 5f4f 4b3c #SOAP_OK< │ │ │ │ +00141e70: 2f63 6f64 653e 2028 7a65 726f 2920 6973 /code> (zero) is │ │ │ │ +00141e80: 2072 6574 7572 6e65 6420 6279 2061 2067 returned by a g │ │ │ │ +00141e90: 534f 4150 2041 5049 2066 756e 6374 696f SOAP API functio │ │ │ │ +00141ea0: 6e20 7768 656e 2074 6865 2066 756e 6374 n when the funct │ │ │ │ +00141eb0: 696f 6e20 6361 6c6c 2077 6173 2073 7563 ion call was suc │ │ │ │ +00141ec0: 6365 7373 6675 6c2c 206f 7468 6572 7769 cessful, otherwi │ │ │ │ +00141ed0: 7365 2061 206e 6f6e 2d7a 6572 6f20 6572 se a non-zero er │ │ │ │ +00141ee0: 726f 7220 636f 6465 2069 7320 7265 7475 ror code is retu │ │ │ │ +00141ef0: 726e 6564 2e20 5468 6520 7374 6174 7573 rned. The status │ │ │ │ +00141f00: 2065 7272 6f72 2063 6f64 6520 6973 2061 error code is a │ │ │ │ +00141f10: 6c73 6f20 7374 6f72 6564 2069 6e20 7468 lso stored in th │ │ │ │ +00141f20: 6520 6375 7272 656e 7420 3c63 6f64 653e e current │ │ │ │ +00141f30: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap │ │ │ │ +00141f80: 3c2f 613e 3c2f 636f 6465 3e20 636f 6e74 cont │ │ │ │ +00141f90: 6578 7420 6173 203c 636f 6465 3e3c 6120 ext as soap::error. For I │ │ │ │ +00142060: 4f20 616e 6420 736f 636b 6574 2d72 656c O and socket-rel │ │ │ │ +00142070: 6174 6564 2065 7272 6f72 732c 2061 6c73 ated errors, als │ │ │ │ +00142080: 6f20 7468 6520 3c63 6f64 653e 3c61 2063 o the soap │ │ │ │ +00142110: 3a3a 6572 726e 756d 3c2f 613e 3c2f 636f ::errnum variable is │ │ │ │ +00142130: 7365 7420 746f 2074 6865 203c 636f 6465 set to the errno va │ │ │ │ +00142150: 6c75 6520 6f66 2074 6865 2073 7973 7465 lue of the syste │ │ │ │ +00142160: 6d20 6572 726f 7220 666f 7220 6578 616d m error for exam │ │ │ │ +00142170: 706c 6520 7768 656e 2061 203c 636f 6465 ple when a #SOAP_EOF error occurred │ │ │ │ +001421a0: 2e3c 2f70 3e0a 3c70 3e54 6f20 6469 7370 .

    .

    To disp │ │ │ │ +001421b0: 6c61 7920 7468 6520 6572 726f 722c 2075 lay the error, u │ │ │ │ +001421c0: 7365 203c 636f 6465 3e3c 6120 636c 6173 se s │ │ │ │ +00142250: 6f61 705f 7072 696e 745f 6661 756c 7428 oap_print_fault( │ │ │ │ +00142260: 7374 7275 6374 2073 6f61 7020 2a73 6f61 struct soap *soa │ │ │ │ +00142270: 702c 2046 494c 4520 2a66 6429 3c2f 613e p, FILE *fd) │ │ │ │ +00142280: 3c2f 636f 6465 3e20 7768 6572 6520 7468 where th │ │ │ │ +00142290: 6520 6375 7272 656e 7420 7661 6c75 6520 e current value │ │ │ │ +001422a0: 6f66 203c 636f 6465 3e3c 6120 636c 6173 of s │ │ │ │ +00142350: 6f61 703a 3a65 7272 6f72 3c2f 613e 3c2f oap::error is used by │ │ │ │ +00142370: 2074 6865 2066 756e 6374 696f 6e20 746f the function to │ │ │ │ +00142380: 2070 7269 6e74 2074 6865 2065 7272 6f72 print the error │ │ │ │ +00142390: 2074 6f20 7468 6520 7370 6563 6966 6965 to the specifie │ │ │ │ +001423a0: 6420 3c63 6f64 653e 6664 3c2f 636f 6465 d fd file. Alternat │ │ │ │ +001423c0: 6976 656c 792c 2069 6e20 432b 2b20 796f ively, in C++ yo │ │ │ │ +001423d0: 7520 6361 6e20 7573 6520 3c63 6f64 653e u can use │ │ │ │ +001423e0: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soa │ │ │ │ +00142470: 705f 7374 7265 616d 5f66 6175 6c74 2873 p_stream_fault(s │ │ │ │ +00142480: 7472 7563 7420 736f 6170 202a 736f 6170 truct soap *soap │ │ │ │ +00142490: 2c20 7374 643a 3a6f 7374 7265 616d 2661 , std::ostream&a │ │ │ │ +001424a0: 6d70 3b20 6f73 293c 2f61 3e3c 2f63 6f64 mp; os) to print the │ │ │ │ +001424c0: 6572 726f 7220 6f6e 2074 6865 2073 7065 error on the spe │ │ │ │ +001424d0: 6369 6669 6564 203c 636f 6465 3e6f 733c cified os< │ │ │ │ +001424e0: 2f63 6f64 653e 206f 7574 7075 7420 7374 /code> output st │ │ │ │ +001424f0: 7265 616d 2e3c 2f70 3e0a 3c70 3e54 6f20 ream.

    .

    To │ │ │ │ +00142500: 6469 7370 6c61 7920 7468 6520 6c6f 6361 display the loca │ │ │ │ +00142510: 7469 6f6e 206f 6620 616e 2058 4d4c 2070 tion of an XML p │ │ │ │ +00142520: 6172 7369 6e67 2061 6e64 2076 616c 6964 arsing and valid │ │ │ │ +00142530: 6174 696f 6e20 6572 726f 722c 2075 7365 ation error, use │ │ │ │ +00142540: 203c 636f 6465 3e3c 6120 636c 6173 733d soap_print_ │ │ │ │ +001425f0: 6661 756c 745f 6c6f 6361 7469 6f6e 2873 fault_location(s │ │ │ │ +00142600: 7472 7563 7420 736f 6170 202a 736f 6170 truct soap *soap │ │ │ │ +00142610: 2c20 4649 4c45 202a 6664 293c 2f61 3e3c , FILE *fd)< │ │ │ │ +00142620: 2f63 6f64 653e 206f 7220 3c63 6f64 653e /code> or │ │ │ │ +00142630: 3c61 2063 6c61 7373 3d22 656c 2220 6872 so │ │ │ │ +001426d0: 6170 5f73 7472 6561 6d5f 6661 756c 745f ap_stream_fault_ │ │ │ │ +001426e0: 6c6f 6361 7469 6f6e 2873 7472 7563 7420 location(struct │ │ │ │ +001426f0: 736f 6170 202a 736f 6170 2c20 7374 643a soap *soap, std: │ │ │ │ +00142700: 3a6f 7374 7265 616d 2661 6d70 3b20 6f73 :ostream& os │ │ │ │ +00142710: 293c 2f61 3e3c 2f63 6f64 653e 2074 6f20 ) to │ │ │ │ +00142720: 7072 696e 7420 7061 7274 206f 6620 7468 print part of th │ │ │ │ +00142730: 6520 584d 4c20 7769 7468 2074 6865 2065 e XML with the e │ │ │ │ +00142740: 7272 6f72 206c 6f63 6174 696f 6e20 6d61 rror location ma │ │ │ │ +00142750: 726b 6564 2069 6e20 7468 6520 584d 4c20 rked in the XML │ │ │ │ +00142760: 6f75 7470 7574 2e3c 2f70 3e0a 3c70 3e54 output.

    .

    T │ │ │ │ +00142770: 6f20 7361 7665 2074 6865 2065 7272 6f72 o save the error │ │ │ │ +00142780: 2069 6e20 6120 7374 7269 6e67 2062 7566 in a string buf │ │ │ │ +00142790: 6665 7220 3c63 6f64 653e 6275 665b 302e fer buf[0. │ │ │ │ +001427a0: 2e2e 6c65 6e2d 315d 3c2f 636f 6465 3e2c ..len-1], │ │ │ │ +001427b0: 2075 7365 203c 636f 6465 3e3c 6120 636c use soap_spr │ │ │ │ +00142850: 696e 745f 6661 756c 7428 7374 7275 6374 int_fault(struct │ │ │ │ +00142860: 2073 6f61 702a 2c20 6368 6172 202a 6275 soap*, char *bu │ │ │ │ +00142870: 662c 2073 697a 655f 7420 6c65 6e29 3c2f f, size_t len), where │ │ │ │ +00142890: 203c 636f 6465 3e62 7566 3c2f 636f 6465 buf is populated w │ │ │ │ +001428b0: 6974 6820 7468 6520 6661 756c 7420 6d65 ith the fault me │ │ │ │ +001428c0: 7373 6167 6520 7465 726d 696e 6174 696e ssage terminatin │ │ │ │ +001428d0: 6720 7769 7468 2061 203c 636f 6465 3e5c g with a \ │ │ │ │ +001428e0: 303c 2f63 6f64 653e 2e3c 2f70 3e0a 3c70 0.

    .

    To determine th │ │ │ │ +00142900: 6520 7479 7065 206f 6620 6572 726f 7220 e type of error │ │ │ │ +00142910: 7468 6174 206f 6363 7572 7265 642c 2075 that occurred, u │ │ │ │ +00142920: 7365 3a3c 2f70 3e3c 756c 3e0a 3c6c 693e se:

    .

    An HTTP │ │ │ │ +001435d0: 2073 7461 7475 7320 636f 6465 2069 7320 status code is │ │ │ │ +001435e0: 7265 7475 726e 6564 2077 6865 6e20 7468 returned when th │ │ │ │ +001435f0: 6520 636c 6965 6e74 2066 6169 6c73 2074 e client fails t │ │ │ │ +00143600: 6f20 636f 6e6e 6563 7420 746f 2061 6e20 o connect to an │ │ │ │ +00143610: 4854 5450 2073 6572 7665 7220 616e 6420 HTTP server and │ │ │ │ +00143620: 7468 6520 4854 5450 2073 6572 7665 7220 the HTTP server │ │ │ │ +00143630: 7265 7370 6f6e 7365 2077 6974 6820 616e response with an │ │ │ │ +00143640: 2065 7272 6f72 2e20 5468 6520 6c69 7374 error. The list │ │ │ │ +00143650: 206f 6620 4854 5450 2073 7461 7475 7320 of HTTP status │ │ │ │ +00143660: 636f 6465 7320 6973 2067 6976 656e 2062 codes is given b │ │ │ │ +00143670: 656c 6f77 3a3c 2f70 3e0a 3c74 6162 6c65 elow:

    ... │ │ │ │ +00143720: 0a3c 7472 2063 6c61 7373 3d22 6d61 726b ..< │ │ │ │ +00143770: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ │ +00143780: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ │ +00143790: 3e4f 4b20 286e 6f20 6572 726f 7229 2020 >OK (no error) │ │ │ │ +001437a0: 2020 3c2f 7464 3e3c 2f74 723e 0a3c 7472 ..< │ │ │ │ +001437d0: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ │ +001437e0: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ │ +001437f0: 3e32 3031 2020 203c 2f74 643e 3c74 6420 >201 ...... │ │ │ │ +001439e0: 0a3c 7472 2063 6c61 7373 3d22 6d61 726b .. │ │ │ │ +00143a30: 3c74 6420 636c 6173 733d 226d 6172 6b64 ..< │ │ │ │ +00143a90: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ │ +00143aa0: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ │ +00143ab0: 3e32 3036 2020 203c 2f74 643e 3c74 6420 >206 .. │ │ │ │ +00143b40: 3330 3020 2020 3c2f 7464 3e3c 7464 2063 300 .... │ │ │ │ +00143c60: 3330 3220 2020 3c2f 7464 3e3c 7464 2063 302 │ │ │ │ +00143ca0: 0a3c 7472 2063 6c61 7373 3d22 6d61 726b ..< │ │ │ │ +00143cf0: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ │ +00143d00: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ │ +00143d10: 3e53 6565 204f 7468 6572 2020 2020 3c2f >See Other ..< │ │ │ │ +00143db0: 2f74 723e 0a3c 7472 2063 6c61 7373 3d22 /tr>....< │ │ │ │ +00143e60: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ │ +00143e70: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ │ +00143e80: 3e33 3037 2020 203c 2f74 643e 3c74 6420 >307 .< │ │ │ │ +00143ed0: 7472 2063 6c61 7373 3d22 6d61 726b 646f tr class="markdo │ │ │ │ +00143ee0: 776e 5461 626c 6552 6f77 4f64 6422 3e0a wnTableRowOdd">. │ │ │ │ +00143ef0: 3c74 6420 636c 6173 733d 226d 6172 6b64 ..< │ │ │ │ +00143fe0: 2f74 723e 0a3c 7472 2063 6c61 7373 3d22 /tr>...... │ │ │ │ +00144140: 3430 3420 2020 3c2f 7464 3e3c 7464 2063 404 < │ │ │ │ +00144180: 2f74 723e 0a3c 7472 2063 6c61 7373 3d22 /tr>...... │ │ │ │ +00144340: 0a3c 7472 2063 6c61 7373 3d22 6d61 726b ..< │ │ │ │ +00144390: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ │ +001443a0: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ │ +001443b0: 3e52 6571 7565 7374 2054 696d 652d 6f75 >Request Time-ou │ │ │ │ +001443c0: 7420 2020 203c 2f74 643e 3c2f 7472 3e0a t . │ │ │ │ +001443d0: 3c74 7220 636c 6173 733d 226d 6172 6b64 .< │ │ │ │ +00144420: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ │ +00144430: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ │ +00144440: 3e43 6f6e 666c 6963 7420 2020 203c 2f74 >Conflict ........ │ │ │ │ +00144640: 3431 3320 2020 3c2f 7464 3e3c 7464 2063 413 ......< │ │ │ │ +001447e0: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ │ +001447f0: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ │ +00144800: 3e34 3136 2020 203c 2f74 643e 3c74 6420 >416 .. │ │ │ │ +001448a0: 3431 3720 2020 3c2f 7464 3e3c 7464 2063 417 ..< │ │ │ │ +00144910: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ │ +00144920: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ │ +00144930: 3e35 3030 2020 203c 2f74 643e 3c74 6420 >500 .. │ │ │ │ +00144a10: 0a3c 7472 2063 6c61 7373 3d22 6d61 726b ..< │ │ │ │ +00144a60: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ │ +00144a70: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ │ +00144a80: 3e42 6164 2047 6174 6577 6179 2020 2020 >Bad Gateway │ │ │ │ +00144a90: 3c2f 7464 3e3c 2f74 723e 0a3c 7472 2063 ....< │ │ │ │ +00144b50: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ │ +00144b60: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ │ +00144b70: 3e35 3034 2020 203c 2f74 643e 3c74 6420 >504 ..< │ │ │ │ +00144be0: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ │ +00144bf0: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ │ +00144c00: 3e35 3035 2020 203c 2f74 643e 3c74 6420 >505 │ │ │ │ +00144c50: 3c2f 7472 3e0a 3c2f 7461 626c 653e 0a3c .
    Code │ │ │ │ +001436e0: 3c2f 7468 3e3c 7468 2063 6c61 7373 3d22 Descripti │ │ │ │ +00143710: 6f6e 2020 2020 3c2f 7468 3e3c 2f74 723e on
    200
    Cr │ │ │ │ +00143820: 6561 7465 6420 2020 203c 2f74 643e 3c2f eated
    202 Accepted │ │ │ │ +001438b0: 3c2f 7464 3e3c 2f74 723e 0a3c 7472 2063
    2 │ │ │ │ +00143900: 3033 2020 203c 2f74 643e 3c74 6420 636c 03 Non- │ │ │ │ +00143930: 4175 7468 6f72 6974 6174 6976 6520 496e Authoritative In │ │ │ │ +00143940: 666f 726d 6174 696f 6e20 2020 203c 2f74 formation
    204 │ │ │ │ +001439a0: 203c 2f74 643e 3c74 6420 636c 6173 733d No Conte │ │ │ │ +001439d0: 6e74 2020 2020 3c2f 7464 3e3c 2f74 723e nt
    205 Reset Content │ │ │ │ +00143a60: 2020 203c 2f74 643e 3c2f 7472 3e0a 3c74
    Pa │ │ │ │ +00143ae0: 7274 6961 6c20 436f 6e74 656e 7420 2020 rtial Content │ │ │ │ +00143af0: 203c 2f74 643e 3c2f 7472 3e0a 3c74 7220
    Mul │ │ │ │ +00143b70: 7469 706c 6520 4368 6f69 6365 7320 2020 tiple Choices │ │ │ │ +00143b80: 203c 2f74 643e 3c2f 7472 3e0a 3c74 7220
    3 │ │ │ │ +00143bd0: 3031 2020 203c 2f74 643e 3c74 6420 636c 01 Move │ │ │ │ +00143c00: 6420 5065 726d 616e 656e 746c 7920 2020 d Permanently │ │ │ │ +00143c10: 203c 2f74 643e 3c2f 7472 3e0a 3c74 7220
    Fou │ │ │ │ +00143c90: 6e64 2020 2020 3c2f 7464 3e3c 2f74 723e nd
    303
    304 │ │ │ │ +00143d70: 2020 203c 2f74 643e 3c74 6420 636c 6173 Not Mo │ │ │ │ +00143da0: 6469 6669 6564 2020 2020 3c2f 7464 3e3c dified
    305 Use Proxy │ │ │ │ +00143e30: 2020 3c2f 7464 3e3c 2f74 723e 0a3c 7472
    Te │ │ │ │ +00143eb0: 6d70 6f72 6172 7920 5265 6469 7265 6374 mporary Redirect │ │ │ │ +00143ec0: 2020 2020 3c2f 7464 3e3c 2f74 723e 0a3c
    400 B │ │ │ │ +00143f40: 6164 2052 6571 7565 7374 2020 2020 3c2f ad Request
    401 │ │ │ │ +00143fa0: 2020 203c 2f74 643e 3c74 6420 636c 6173 Unauth │ │ │ │ +00143fd0: 6f72 697a 6564 2020 2020 3c2f 7464 3e3c orized
    402 Payment Req │ │ │ │ +00144060: 7569 7265 6420 2020 203c 2f74 643e 3c2f uired
    403 Forbidden │ │ │ │ +001440f0: 2020 3c2f 7464 3e3c 2f74 723e 0a3c 7472
    Not │ │ │ │ +00144170: 2046 6f75 6e64 2020 2020 3c2f 7464 3e3c Found
    405 < │ │ │ │ +001441d0: 2f74 643e 3c74 6420 636c 6173 733d 226d /td>Method Not │ │ │ │ +00144200: 2041 6c6c 6f77 6564 2020 2020 3c2f 7464 Allowed
    406 │ │ │ │ +00144260: 3c2f 7464 3e3c 7464 2063 6c61 7373 3d22 Not Accep │ │ │ │ +00144290: 7461 626c 6520 2020 203c 2f74 643e 3c2f table
    407 Proxy Authe │ │ │ │ +00144320: 6e74 6963 6174 696f 6e20 5265 7175 6972 ntication Requir │ │ │ │ +00144330: 6564 2020 2020 3c2f 7464 3e3c 2f74 723e ed
    408
    409
    410 │ │ │ │ +001444a0: 203c 2f74 643e 3c74 6420 636c 6173 733d Gone │ │ │ │ +001444d0: 3c2f 7464 3e3c 2f74 723e 0a3c 7472 2063
    4 │ │ │ │ +00144520: 3131 2020 203c 2f74 643e 3c74 6420 636c 11 Leng │ │ │ │ +00144550: 7468 2052 6571 7569 7265 6420 2020 203c th Required < │ │ │ │ +00144560: 2f74 643e 3c2f 7472 3e0a 3c74 7220 636c /td>
    412 │ │ │ │ +001445b0: 2020 203c 2f74 643e 3c74 6420 636c 6173 Precon │ │ │ │ +001445e0: 6469 7469 6f6e 2046 6169 6c65 6420 2020 dition Failed │ │ │ │ +001445f0: 203c 2f74 643e 3c2f 7472 3e0a 3c74 7220
    Req │ │ │ │ +00144670: 7565 7374 2045 6e74 6974 7920 546f 6f20 uest Entity Too │ │ │ │ +00144680: 4c61 7267 6520 2020 203c 2f74 643e 3c2f Large
    414 Request-URI │ │ │ │ +00144710: 546f 6f20 4c61 7267 6520 2020 203c 2f74 Too Large
    415 │ │ │ │ +00144770: 2020 3c2f 7464 3e3c 7464 2063 6c61 7373 Unsuppo │ │ │ │ +001447a0: 7274 6564 204d 6564 6961 2054 7970 6520 rted Media Type │ │ │ │ +001447b0: 2020 203c 2f74 643e 3c2f 7472 3e0a 3c74
    Re │ │ │ │ +00144830: 7175 6573 7465 6420 7261 6e67 6520 6e6f quested range no │ │ │ │ +00144840: 7420 7361 7469 7366 6961 626c 6520 2020 t satisfiable │ │ │ │ +00144850: 203c 2f74 643e 3c2f 7472 3e0a 3c74 7220
    Exp │ │ │ │ +001448d0: 6563 7461 7469 6f6e 2046 6169 6c65 6420 ectation Failed │ │ │ │ +001448e0: 2020 203c 2f74 643e 3c2f 7472 3e0a 3c74
    In │ │ │ │ +00144960: 7465 726e 616c 2053 6572 7665 7220 4572 ternal Server Er │ │ │ │ +00144970: 726f 7220 2020 203c 2f74 643e 3c2f 7472 ror
    501 Not Implement │ │ │ │ +00144a00: 6564 2020 2020 3c2f 7464 3e3c 2f74 723e ed
    502
    5 │ │ │ │ +00144ae0: 3033 2020 203c 2f74 643e 3c74 6420 636c 03 Serv │ │ │ │ +00144b10: 6963 6520 556e 6176 6169 6c61 626c 6520 ice Unavailable │ │ │ │ +00144b20: 2020 203c 2f74 643e 3c2f 7472 3e0a 3c74
    Ga │ │ │ │ +00144ba0: 7465 7761 7920 5469 6d65 2d6f 7574 2020 teway Time-out │ │ │ │ +00144bb0: 2020 3c2f 7464 3e3c 2f74 723e 0a3c 7472
    HT │ │ │ │ +00144c30: 5450 2056 6572 7369 6f6e 206e 6f74 2073 TP Version not s │ │ │ │ +00144c40: 7570 706f 7274 6564 2020 203c 2f74 643e upported
    .< │ │ │ │ +00144c60: 703e 4854 5450 2073 7461 7475 7320 636f p>HTTP status co │ │ │ │ +00144c70: 6465 2032 3030 2069 7320 6e6f 7420 666c de 200 is not fl │ │ │ │ +00144c80: 6167 6765 6420 6173 2061 6e20 6572 726f agged as an erro │ │ │ │ +00144c90: 7220 6279 2074 6865 2065 6e67 696e 652e r by the engine. │ │ │ │ +00144ca0: 2053 7461 7475 7320 636f 6465 7320 3230 Status codes 20 │ │ │ │ +00144cb0: 3120 616e 6420 3230 3220 6172 6520 696e 1 and 202 are in │ │ │ │ +00144cc0: 666f 726d 6174 6976 6520 616e 6420 7368 formative and sh │ │ │ │ +00144cd0: 6f75 6c64 206e 6f74 2062 6520 636f 6e73 ould not be cons │ │ │ │ +00144ce0: 6964 6572 6564 2065 7272 6f72 7320 6279 idered errors by │ │ │ │ +00144cf0: 2074 6865 2061 7070 6c69 6361 7469 6f6e the application │ │ │ │ +00144d00: 206c 6f67 6963 2e3c 2f70 3e0a 3c70 3e53 logic.

    .

    S │ │ │ │ +00144d10: 6572 7665 722d 7369 6465 2069 6d70 6c65 erver-side imple │ │ │ │ +00144d20: 6d65 6e74 6174 696f 6e73 206f 6620 7365 mentations of se │ │ │ │ +00144d30: 7276 6963 6520 6f70 6572 6174 696f 6e73 rvice operations │ │ │ │ +00144d40: 2073 686f 756c 6420 7265 7475 726e 203c should return < │ │ │ │ +00144d50: 636f 6465 3e23 534f 4150 5f4f 4b3c 2f63 code>#SOAP_OK when the op │ │ │ │ +00144d70: 6572 6174 696f 6e20 7761 7320 7375 6363 eration was succ │ │ │ │ +00144d80: 6573 7366 756c 2c20 7768 6963 6820 7265 essful, which re │ │ │ │ +00144d90: 7475 726e 7320 6120 2232 3030 204f 4b22 turns a "200 OK" │ │ │ │ +00144da0: 2048 5454 5020 6865 6164 6572 2077 6974 HTTP header wit │ │ │ │ +00144db0: 6820 7468 6520 584d 4c20 7265 7370 6f6e h the XML respon │ │ │ │ +00144dc0: 7365 206d 6573 7361 6765 2e20 5365 7276 se message. Serv │ │ │ │ +00144dd0: 6572 2d73 6964 6520 696d 706c 656d 656e er-side implemen │ │ │ │ +00144de0: 7461 7469 6f6e 7320 6f66 2073 6572 7669 tations of servi │ │ │ │ +00144df0: 6365 206f 7065 7261 7469 6f6e 7320 696e ce operations in │ │ │ │ +00144e00: 2067 534f 4150 206d 6179 2064 6972 6563 gSOAP may direc │ │ │ │ +00144e10: 746c 7920 7265 7475 726e 2061 6e20 4854 tly return an HT │ │ │ │ +00144e20: 5450 2073 7461 7475 7320 636f 6465 2077 TP status code w │ │ │ │ +00144e30: 6865 6e20 616e 2048 5454 502d 7265 6c61 hen an HTTP-rela │ │ │ │ +00144e40: 7465 6420 6572 726f 7220 7368 6f75 6c64 ted error should │ │ │ │ +00144e50: 2062 6520 7265 7475 726e 6564 2e20 466f be returned. Fo │ │ │ │ +00144e60: 7220 6578 616d 706c 652c 203c 636f 6465 r example, return 404 returns "404 │ │ │ │ +00144e90: 4e6f 7420 466f 756e 6422 2074 6f20 7468 Not Found" to th │ │ │ │ +00144ea0: 6520 636c 6965 6e74 2061 6e64 2074 6865 e client and the │ │ │ │ +00144eb0: 203c 636f 6465 3e3c 6120 636c 6173 733d soa │ │ │ │ +00144f60: 703a 3a65 7272 6f72 3c2f 613e 3c2f 636f p::error variable is │ │ │ │ +00144f80: 7365 7420 746f 2034 3034 2061 7420 7468 set to 404 at th │ │ │ │ +00144f90: 6520 636c 6965 6e74 2073 6964 652e 3c2f e client side..

    To return │ │ │ │ +00144fb0: 6120 534f 4150 2046 6175 6c74 2066 726f a SOAP Fault fro │ │ │ │ +00144fc0: 6d20 6120 7365 7276 6572 2d73 6964 6520 m a server-side │ │ │ │ +00144fd0: 696d 706c 656d 656e 7461 7469 6f6e 206f implementation o │ │ │ │ +00144fe0: 6620 6120 7365 7276 6963 6520 6f70 6572 f a service oper │ │ │ │ +00144ff0: 6174 696f 6e2c 2075 7365 206f 6e65 206f ation, use one o │ │ │ │ +00145000: 6620 7468 6520 666f 6c6c 6f77 696e 6720 f the following │ │ │ │ +00145010: 6675 6e63 7469 6f6e 7320 746f 2070 6f70 functions to pop │ │ │ │ +00145020: 756c 6174 6520 7468 6520 534f 4150 2046 ulate the SOAP F │ │ │ │ +00145030: 6175 6c74 206d 6573 7361 6765 3a3c 2f70 ault message:

    .

    A recei │ │ │ │ +00145920: 7665 7220 6572 726f 7220 696e 6469 6361 ver error indica │ │ │ │ +00145930: 7465 7320 7468 6174 2074 6865 2073 6572 tes that the ser │ │ │ │ +00145940: 7669 6365 2063 6f75 6c64 206e 6f74 2068 vice could not h │ │ │ │ +00145950: 616e 646c 6520 7468 6520 636c 6965 6e74 andle the client │ │ │ │ +00145960: 2072 6571 7565 7374 2c20 6275 7420 6974 request, but it │ │ │ │ +00145970: 2063 616e 2070 6f73 7369 626c 7920 7265 can possibly re │ │ │ │ +00145980: 636f 7665 7220 6672 6f6d 2074 6865 2065 cover from the e │ │ │ │ +00145990: 7272 6f72 206c 6174 6572 2c20 666f 7220 rror later, for │ │ │ │ +001459a0: 6578 616d 706c 6520 7768 656e 2072 6573 example when res │ │ │ │ +001459b0: 6f75 7263 6573 2061 7265 2074 656d 706f ources are tempo │ │ │ │ +001459c0: 7261 7269 6c79 2075 6e61 7661 696c 6162 rarily unavailab │ │ │ │ +001459d0: 6c65 2e20 4120 7365 6e64 6572 2065 7272 le. A sender err │ │ │ │ +001459e0: 6f72 2069 6e64 6963 6174 6573 2074 6861 or indicates tha │ │ │ │ +001459f0: 7420 7468 6520 636c 6965 6e74 2072 6571 t the client req │ │ │ │ +00145a00: 7565 7374 2069 7320 6661 756c 7479 2061 uest is faulty a │ │ │ │ +00145a10: 6e64 2073 2072 656a 6563 7465 6420 6279 nd s rejected by │ │ │ │ +00145a20: 2074 6865 2073 6572 7669 6365 2e3c 2f70 the service.

    .

    See Section │ │ │ │ +00145a40: 203c 6120 636c 6173 733d 2265 6c22 2068 SOAP Faul │ │ │ │ +00145a70: 7420 7072 6f63 6573 7369 6e67 3c2f 613e t processing │ │ │ │ +00145a80: 2066 6f72 206d 6f72 6520 6465 7461 696c for more detail │ │ │ │ +00145a90: 7320 6f6e 2068 6f77 2074 6f20 7573 6520 s on how to use │ │ │ │ +00145aa0: 7468 6573 6520 6675 6e63 7469 6f6e 732e these functions. │ │ │ │ +00145ab0: 3c2f 703e 0a3c 703e f09f 949d 203c 6120

    .

    .... Back to │ │ │ │ +00145ad0: 2074 6162 6c65 206f 6620 636f 6e74 656e table of conten │ │ │ │ +00145ae0: 7473 3c2f 613e 3c2f 703e 0a3c 6831 3e3c ts

    .

    < │ │ │ │ +00145af0: 6120 636c 6173 733d 2261 6e63 686f 7222 a class="anchor" │ │ │ │ +00145b00: 2069 643d 226d 656d 6f72 7922 3e3c 2f61 id="memory">.Memory managem │ │ │ │ +00145b20: 656e 743c 2f68 313e 0a3c 703e 4d65 6d6f ent

    .

    Memo │ │ │ │ +00145b30: 7279 206d 616e 6167 656d 656e 7420 7769 ry management wi │ │ │ │ +00145b40: 7468 2067 534f 4150 2069 7320 6175 746f th gSOAP is auto │ │ │ │ +00145b50: 6d61 7469 632e 2054 6865 2065 6e67 696e matic. The engin │ │ │ │ +00145b60: 6520 636f 6e74 6578 7420 6d61 6e61 6765 e context manage │ │ │ │ +00145b70: 7320 616c 6c20 6d65 6d6f 7279 2061 6c6c s all memory all │ │ │ │ +00145b80: 6f63 6174 6564 2074 6f20 7365 7269 616c ocated to serial │ │ │ │ +00145b90: 697a 6520 6461 7461 2061 6e64 2066 6f72 ize data and for │ │ │ │ +00145ba0: 2074 656d 706f 7261 7279 2073 746f 7261 temporary stora │ │ │ │ +00145bb0: 6765 2e20 4465 7365 7269 616c 697a 6564 ge. Deserialized │ │ │ │ +00145bc0: 2064 6174 6120 6973 2061 6c6c 6f63 6174 data is allocat │ │ │ │ +00145bd0: 6564 2069 6e20 6d61 6e61 6765 6420 6d65 ed in managed me │ │ │ │ +00145be0: 6d6f 7279 2061 6e64 2064 6174 6120 7374 mory and data st │ │ │ │ +00145bf0: 7275 6374 7572 6573 2063 616e 2062 6520 ructures can be │ │ │ │ +00145c00: 616c 6c6f 6361 7465 6420 696e 206d 616e allocated in man │ │ │ │ +00145c10: 6167 6564 206d 656d 6f72 7920 6279 2074 aged memory by t │ │ │ │ +00145c20: 6865 2075 7365 7220 7768 656e 2064 6573 he user when des │ │ │ │ +00145c30: 6972 6564 2075 7369 6e67 203c 636f 6465 ired using soap_new_T functions gen │ │ │ │ +00145c60: 6572 6174 6564 2062 7920 736f 6170 6370 erated by soapcp │ │ │ │ +00145c70: 7032 2066 6f72 2065 6163 6820 7365 7269 p2 for each seri │ │ │ │ +00145c80: 616c 697a 6162 6c65 2074 7970 6520 3c63 alizable type T. Al │ │ │ │ +00145ca0: 6c20 6d65 6d6f 7279 206d 616e 6167 6564 l memory managed │ │ │ │ +00145cb0: 2062 7920 6120 636f 6e74 6578 7420 6973 by a context is │ │ │ │ +00145cc0: 2064 6561 6c6c 6f63 6174 6564 2077 6974 deallocated wit │ │ │ │ +00145cd0: 6820 3c63 6f64 653e 3c61 2063 6c61 7373 h soap_dest │ │ │ │ +00145d90: 726f 793c 2f61 3e3c 2f63 6f64 653e 2074 roy t │ │ │ │ +00145da0: 6f20 6465 7374 726f 7920 6d61 6e61 6765 o destroy manage │ │ │ │ +00145db0: 6420 432b 2b20 6f62 6a65 6374 7320 616e d C++ objects an │ │ │ │ +00145dc0: 6420 3c63 6f64 653e 3c61 2063 6c61 7373 d soap │ │ │ │ +00145e90: 5f65 6e64 3c2f 613e 3c2f 636f 6465 3e20 _end │ │ │ │ +00145ea0: 746f 2064 656c 6574 6520 616c 6c20 6f74 to delete all ot │ │ │ │ +00145eb0: 6865 7220 6d61 6e61 6765 6420 6461 7461 her managed data │ │ │ │ +00145ec0: 2e20 5768 656e 2061 2063 6f6e 7465 7874 . When a context │ │ │ │ +00145ed0: 2069 7320 6669 6e61 6c69 7a65 6420 6f72 is finalized or │ │ │ │ +00145ee0: 2066 7265 6564 2077 6974 6820 3c63 6f64 freed with soap_done( │ │ │ │ +00145fc0: 7374 7275 6374 2073 6f61 702a 293c 2f61 struct soap*) and soap_free(str │ │ │ │ +00146090: 7563 7420 736f 6170 2a29 3c2f 613e 3c2f uct soap*) then manag │ │ │ │ +001460b0: 6564 206d 656d 6f72 7920 6973 206e 6f74 ed memory is not │ │ │ │ +001460c0: 2072 656c 6561 7365 642c 2073 6f20 6974 released, so it │ │ │ │ +001460d0: 2069 7320 696d 706f 7274 616e 7420 746f is important to │ │ │ │ +001460e0: 2063 616c 6c20 7468 6520 6465 616c 6c6f call the deallo │ │ │ │ +001460f0: 6361 7469 6f6e 2066 756e 6374 696f 6e73 cation functions │ │ │ │ +00146100: 2066 6972 7374 2e20 5468 6973 2077 6173 first. This was │ │ │ │ +00146110: 2064 6f6e 6520 746f 2061 6c6c 6f77 206d done to allow m │ │ │ │ +00146120: 616e 6167 6564 2064 6174 6120 746f 206f anaged data to o │ │ │ │ +00146130: 7574 6c69 7665 2074 6865 2063 6f6e 7465 utlive the conte │ │ │ │ +00146140: 7874 2c20 7375 6368 2061 7320 6465 7365 xt, such as dese │ │ │ │ +00146150: 7269 616c 697a 6564 206f 626a 6563 7473 rialized objects │ │ │ │ +00146160: 2c20 6275 7420 7468 6973 2069 7320 7261 , but this is ra │ │ │ │ +00146170: 7265 6c79 2069 6620 6576 6572 2075 7365 rely if ever use │ │ │ │ +00146180: 6420 6265 6361 7573 6520 6465 6c65 7469 d because deleti │ │ │ │ +00146190: 6e67 2074 6865 206f 7574 6c69 7665 6420 ng the outlived │ │ │ │ +001461a0: 6461 7461 2065 7870 6c69 6369 746c 7920 data explicitly │ │ │ │ +001461b0: 6973 2070 726f 6e65 2074 6f20 6d69 7374 is prone to mist │ │ │ │ +001461c0: 616b 6573 2e3c 2f70 3e0a 3c70 3e49 6620 akes.

    .

    If │ │ │ │ +001461d0: 796f 7520 7761 6e74 2074 6f20 6c65 7420 you want to let │ │ │ │ +001461e0: 6465 7365 7269 616c 697a 6564 2064 6174 deserialized dat │ │ │ │ +001461f0: 6120 6f75 746c 6976 6520 6120 3c63 6f64 a outlive a so │ │ │ │ +00146250: 6170 3c2f 613e 3c2f 636f 6465 3e20 636f ap co │ │ │ │ +00146260: 6e74 6578 7420 7468 6174 2079 6f75 2061 ntext that you a │ │ │ │ +00146270: 7265 2061 626f 7574 2074 6f20 6672 6565 re about to free │ │ │ │ +00146280: 2c20 7468 656e 2079 6f75 2063 616e 2064 , then you can d │ │ │ │ +00146290: 656c 6567 6174 6520 6d61 6e61 6765 6d65 elegate manageme │ │ │ │ +001462a0: 6e74 206f 6620 7468 6520 6461 7461 2074 nt of the data t │ │ │ │ +001462b0: 6f20 616e 6f74 6865 7220 3c63 6f64 653e o another │ │ │ │ +001462c0: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap │ │ │ │ +00146310: 3c2f 613e 3c2f 636f 6465 3e20 636f 6e74 cont │ │ │ │ +00146320: 6578 7420 7769 7468 203c 636f 6465 3e3c ext with < │ │ │ │ +00146330: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ +00146340: 663d 2267 726f 7570 5f5f 6772 6f75 705f f="group__group_ │ │ │ │ +00146350: 5f63 6f6e 7465 7874 2e68 746d 6c23 6761 _context.html#ga │ │ │ │ +00146360: 6139 3539 6666 3631 3630 3966 3762 3332 a959ff61609f7b32 │ │ │ │ +00146370: 3435 3237 6538 3836 3535 6332 3337 3766 4527e88655c2377f │ │ │ │ +00146380: 2220 7469 746c 653d 2244 656c 6567 6174 " title="Delegat │ │ │ │ +00146390: 6520 7468 6520 6465 6c65 7469 6f6e 206f e the deletion o │ │ │ │ +001463a0: 6620 616c 6c20 6d61 6e61 6765 6420 6f62 f all managed ob │ │ │ │ +001463b0: 6a65 6374 7320 616e 6420 6461 7461 2066 jects and data f │ │ │ │ +001463c0: 726f 6d20 7468 6520 7370 6563 6966 6965 rom the specifie │ │ │ │ +001463d0: 6420 736f 6170 2063 6f6e 7465 7874 2074 d soap context t │ │ │ │ +001463e0: 6f20 616e 6f74 6865 7220 736f 6170 2e2e o another soap.. │ │ │ │ +001463f0: 2e22 3e73 6f61 705f 6465 6c65 6761 7465 .">soap_delegate │ │ │ │ +00146400: 5f64 656c 6574 696f 6e28 7374 7275 6374 _deletion(struct │ │ │ │ +00146410: 2073 6f61 7020 2a73 6f61 705f 6672 6f6d soap *soap_from │ │ │ │ +00146420: 2c20 7374 7275 6374 2073 6f61 7020 2a73 , struct soap *s │ │ │ │ +00146430: 6f61 705f 746f 293c 2f61 3e3c 2f63 6f64 oap_to). This moves a │ │ │ │ +00146450: 6c6c 2064 6573 6572 6961 6c69 7a65 6420 ll deserialized │ │ │ │ +00146460: 616e 6420 7465 6d70 6f72 6172 7920 6461 and temporary da │ │ │ │ +00146470: 7461 2074 6f20 7468 6520 6f74 6865 7220 ta to the other │ │ │ │ +00146480: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 soap context │ │ │ │ +001464f0: 736f 6170 5f74 6f3c 2f63 6f64 653e 2c20 soap_to, │ │ │ │ +00146500: 7768 6963 6820 7769 6c6c 2064 656c 6574 which will delet │ │ │ │ +00146510: 6520 6974 7320 6461 7461 2061 6e64 2061 e its data and a │ │ │ │ +00146520: 6c6c 2074 6865 2064 656c 6567 6174 6564 ll the delegated │ │ │ │ +00146530: 2064 6174 6120 6974 2069 7320 7265 7370 data it is resp │ │ │ │ +00146540: 6f6e 7369 626c 6520 666f 7220 7768 656e onsible for when │ │ │ │ +00146550: 2079 6f75 2063 616c 6c20 3c63 6f64 653e you call │ │ │ │ +00146560: 3c61 2063 6c61 7373 3d22 656c 2220 6872 s │ │ │ │ +00146610: 6f61 705f 6465 7374 726f 793c 2f61 3e3c oap_destroy< │ │ │ │ +00146620: 2f63 6f64 653e 2061 6e64 203c 636f 6465 /code> and soap_end. This c │ │ │ │ +00146710: 616e 2062 6520 7061 7274 6963 756c 6172 an be particular │ │ │ │ +00146720: 6c79 2075 7365 6675 6c20 666f 7220 6d61 ly useful for ma │ │ │ │ +00146730: 6b69 6e67 2063 6c69 656e 7420 6361 6c6c king client call │ │ │ │ +00146740: 7320 696e 7369 6465 2061 2073 6572 7665 s inside a serve │ │ │ │ +00146750: 7220 6f70 6572 6174 696f 6e2c 2069 2e65 r operation, i.e │ │ │ │ +00146760: 2e20 6120 6d69 7865 6420 7365 7276 6572 . a mixed server │ │ │ │ +00146770: 2061 6e64 2063 6c69 656e 742e 2054 6865 and client. The │ │ │ │ +00146780: 2063 6c69 656e 7420 6361 6c6c 2069 6e73 client call ins │ │ │ │ +00146790: 6964 6520 7468 6520 7365 7276 6572 206f ide the server o │ │ │ │ +001467a0: 7065 7261 7469 6f6e 2072 6571 7569 7265 peration require │ │ │ │ +001467b0: 7320 6120 6e65 7720 3c63 6f64 653e 3c61 s a new soap contex │ │ │ │ +00146820: 742c 2065 2e67 2e20 636f 7069 6564 2066 t, e.g. copied f │ │ │ │ +00146830: 726f 6d20 7468 6520 7365 7276 6572 2773 rom the server's │ │ │ │ +00146840: 2077 6974 6820 3c63 6f64 653e 3c61 2063 with soap_copy │ │ │ │ +00146900: 3c2f 613e 3c2f 636f 6465 3e2e 2042 6566 . Bef │ │ │ │ +00146910: 6f72 6520 6465 7374 726f 7969 6e67 2074 ore destroying t │ │ │ │ +00146920: 6865 2063 6c69 656e 7420 636f 6e74 6578 he client contex │ │ │ │ +00146930: 7420 7769 7468 203c 636f 6465 3e3c 6120 t with soa │ │ │ │ +001469e0: 705f 6672 6565 3c2f 613e 3c2f 636f 6465 p_free, the data can │ │ │ │ +00146a00: 6265 2064 656c 6567 6174 6564 2074 6f20 be delegated to │ │ │ │ +00146a10: 7468 6520 7365 7276 6572 2773 2063 6f6e the server's con │ │ │ │ +00146a20: 7465 7874 2077 6974 6820 3c63 6f64 653e text with │ │ │ │ +00146a30: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap_delegat │ │ │ │ +00146b00: 655f 6465 6c65 7469 6f6e 3c2f 613e 3c2f e_deletion. See for e │ │ │ │ +00146b20: 7861 6d70 6c65 203c 656d 3e3c 636f 6465 xample gsoap/samples/m │ │ │ │ +00146b40: 6173 6875 702f 6d61 7368 7570 7365 7276 ashup/mashupserv │ │ │ │ +00146b50: 6572 2e63 3c2f 636f 6465 3e3c 2f65 6d3e er.c │ │ │ │ +00146b60: 2069 6e20 7468 6520 6753 4f41 5020 736f in the gSOAP so │ │ │ │ +00146b70: 7572 6365 2063 6f64 6520 7061 636b 6167 urce code packag │ │ │ │ +00146b80: 652e 3c2f 703e 0a3c 703e 5468 6520 6675 e.

    .

    The fu │ │ │ │ +00146b90: 6e63 7469 6f6e 7320 7265 6c61 7465 6420 nctions related │ │ │ │ +00146ba0: 746f 206d 656d 6f72 7920 6d61 6e61 6765 to memory manage │ │ │ │ +00146bb0: 6d65 6e74 2062 7920 7468 6520 636f 6e74 ment by the cont │ │ │ │ +00146bc0: 6578 7420 6172 653a 3c2f 703e 0a3c 756c ext are:

    .
    .

    To he │ │ │ │ +00148140: 6c70 2075 6e64 6572 7374 616e 6420 7468 lp understand th │ │ │ │ +00148150: 6520 6469 6666 6572 656e 6365 7320 6265 e differences be │ │ │ │ +00148160: 7477 6565 6e20 6d61 6e61 6765 6420 6f62 tween managed ob │ │ │ │ +00148170: 6a65 6374 732c 206d 616e 6167 6564 2064 jects, managed d │ │ │ │ +00148180: 6174 612c 2061 6e64 206d 616e 6167 6564 ata, and managed │ │ │ │ +00148190: 2074 656d 706f 7261 7279 2064 6174 613a temporary data: │ │ │ │ +001481a0: 2074 656d 706f 7261 7279 2064 6174 6120 temporary data │ │ │ │ +001481b0: 6973 2063 7265 6174 6564 2062 7920 7468 is created by th │ │ │ │ +001481c0: 6520 656e 6769 6e65 2074 6f20 6b65 6570 e engine to keep │ │ │ │ +001481d0: 2074 7261 636b 206f 6620 7468 696e 6773 track of things │ │ │ │ +001481e0: 2c20 7375 6368 2061 7320 6861 7368 2074 , such as hash t │ │ │ │ +001481f0: 6162 6c65 7320 746f 206b 6565 7020 706f ables to keep po │ │ │ │ +00148200: 696e 7465 7220 7265 6665 7265 6e63 6520 inter reference │ │ │ │ +00148210: 696e 666f 726d 6174 696f 6e20 666f 7220 information for │ │ │ │ +00148220: 7365 7269 616c 697a 6174 696f 6e20 616e serialization an │ │ │ │ +00148230: 6420 6861 7368 2074 6162 6c65 7320 746f d hash tables to │ │ │ │ +00148240: 206b 6565 7020 584d 4c20 6964 2f68 7265 keep XML id/hre │ │ │ │ +00148250: 6620 696e 666f 726d 6174 696f 6e20 666f f information fo │ │ │ │ +00148260: 7220 6d75 6c74 692d 7265 6665 7265 6e63 r multi-referenc │ │ │ │ +00148270: 6520 6f62 6a65 6374 2064 6573 6572 6961 e object deseria │ │ │ │ +00148280: 6c69 7a61 7469 6f6e 2e20 4465 7365 7269 lization. Deseri │ │ │ │ +00148290: 616c 697a 6564 2064 6174 6120 6973 2061 alized data is a │ │ │ │ +001482a0: 6c6c 6f63 6174 6564 2062 7920 7468 6520 llocated by the │ │ │ │ +001482b0: 636f 6e74 6578 7420 696e 206d 616e 6167 context in manag │ │ │ │ +001482c0: 6564 206d 656d 6f72 7920 7768 656e 2063 ed memory when c │ │ │ │ +001482d0: 6f6e 7374 7275 6374 696e 6720 6461 7461 onstructing data │ │ │ │ +001482e0: 2073 7472 7563 7475 7265 7320 6279 2064 structures by d │ │ │ │ +001482f0: 6573 6572 6961 6c69 7a69 6e67 2058 4d4c eserializing XML │ │ │ │ +00148300: 2061 6e64 204a 534f 4e20 6d65 7373 6167 and JSON messag │ │ │ │ +00148310: 6573 2e20 4461 7461 2069 7320 7374 6f72 es. Data is stor │ │ │ │ +00148320: 6564 2069 6e20 6d65 6d6f 7279 206d 616e ed in memory man │ │ │ │ +00148330: 6167 6564 2062 7920 7468 6520 636f 6e74 aged by the cont │ │ │ │ +00148340: 6578 7420 7573 696e 6720 6361 6c6c 7320 ext using calls │ │ │ │ +00148350: 746f 203c 636f 6465 3e3c 6120 636c 6173 to soap_ │ │ │ │ +00148400: 6d61 6c6c 6f63 3c2f 613e 3c2f 636f 6465 malloc to allocate he │ │ │ │ +00148420: 6170 2073 7061 6365 2077 6974 6820 3c63 ap space with malloc. A tiny bit mo │ │ │ │ +00148450: 7265 2073 7061 6365 2069 7320 616c 6c6f re space is allo │ │ │ │ +00148460: 6361 7465 6420 746f 206b 6565 7020 7472 cated to keep tr │ │ │ │ +00148470: 6163 6b20 6f66 2074 6865 2061 6c6c 6f63 ack of the alloc │ │ │ │ +00148480: 6174 696f 6e73 2061 6e64 2074 6f20 6164 ations and to ad │ │ │ │ +00148490: 6420 6120 2263 616e 6172 7922 2077 6f72 d a "canary" wor │ │ │ │ +001484a0: 6420 746f 2064 6574 6563 7420 6865 6170 d to detect heap │ │ │ │ +001484b0: 206d 656d 6f72 7920 6f76 6572 666c 6f77 memory overflow │ │ │ │ +001484c0: 732e 2048 6561 7020 6d65 6d6f 7279 206f s. Heap memory o │ │ │ │ +001484d0: 7665 7266 6c6f 7773 2061 7265 2064 6574 verflows are det │ │ │ │ +001484e0: 6563 7465 6420 7768 656e 2063 6f6e 7465 ected when conte │ │ │ │ +001484f0: 7874 2d6d 616e 6167 6564 2064 6174 6120 xt-managed data │ │ │ │ +00148500: 6973 2064 6561 6c6c 6f63 6174 6564 2077 is deallocated w │ │ │ │ +00148510: 6974 6820 3c63 6f64 653e 3c61 2063 6c61 ith so │ │ │ │ +001485e0: 6170 5f65 6e64 3c2f 613e 3c2f 636f 6465 ap_end. C++ objects a │ │ │ │ +00148600: 7265 2061 6c6c 6f63 6174 6564 2077 6974 re allocated wit │ │ │ │ +00148610: 6820 3c63 6f64 653e 6e65 773c 2f63 6f64 h new instead of malloc and are tracke │ │ │ │ +00148650: 6420 6173 2077 656c 6c2e 2054 6865 7365 d as well. These │ │ │ │ +00148660: 206f 626a 6563 7473 2061 7265 2064 6561 objects are dea │ │ │ │ +00148670: 6c6c 6f63 6174 6564 2077 6974 6820 3c63 llocated with soap_destroy< │ │ │ │ +00148740: 2f61 3e3c 2f63 6f64 653e 2e3c 2f70 3e0a /a>.

    . │ │ │ │ +00148750: 3c70 3e57 6865 6e20 7468 6520 6753 4f41

    When the gSOA │ │ │ │ +00148760: 5020 6170 706c 6963 6174 696f 6e20 6973 P application is │ │ │ │ +00148770: 2063 6f6d 7069 6c65 6420 7769 7468 203c compiled with < │ │ │ │ +00148780: 623e 3c63 6f64 653e 2d44 4445 4255 473c b>-DDEBUG< │ │ │ │ +00148790: 2f63 6f64 653e 3c2f 623e 2075 7369 6e67 /code> using │ │ │ │ +001487a0: 2074 6865 2063 6f6d 7069 6c65 2d74 696d the compile-tim │ │ │ │ +001487b0: 6520 666c 6167 203c 636f 6465 3e23 4445 e flag #DE │ │ │ │ +001487c0: 4255 473c 2f63 6f64 653e 2c20 7468 6520 BUG, the │ │ │ │ +001487d0: 656e 6769 6e65 2072 6570 6f72 7473 206d engine reports m │ │ │ │ +001487e0: 656d 6f72 7920 6c65 616b 7320 7768 6963 emory leaks whic │ │ │ │ +001487f0: 6820 6172 6520 6465 7465 6374 6564 2062 h are detected b │ │ │ │ +00148800: 7920 3c63 6f64 653e 3c61 2063 6c61 7373 y soap │ │ │ │ +001488d0: 5f64 6f6e 653c 2f61 3e3c 2f63 6f64 653e _done │ │ │ │ +001488e0: 2061 6e64 203c 636f 6465 3e3c 6120 636c and soap_ │ │ │ │ +00148990: 6672 6565 3c2f 613e 3c2f 636f 6465 3e2e free. │ │ │ │ +001489a0: 2054 6f20 696d 7072 6f76 6520 7468 6520 To improve the │ │ │ │ +001489b0: 6163 6375 7261 6379 206f 6620 6465 7465 accuracy of dete │ │ │ │ +001489c0: 6374 696f 6e2c 206e 6f20 6d65 6d6f 7279 ction, no memory │ │ │ │ +001489d0: 2069 7320 6163 7475 616c 6c79 2066 7265 is actually fre │ │ │ │ +001489e0: 6564 2075 6e74 696c 203c 636f 6465 3e3c ed until < │ │ │ │ +001489f0: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ +00148a00: 663d 2267 726f 7570 5f5f 6772 6f75 705f f="group__group_ │ │ │ │ +00148a10: 5f63 6f6e 7465 7874 2e68 746d 6c23 6761 _context.html#ga │ │ │ │ +00148a20: 3238 6565 3866 6463 6635 3030 3434 3365 28ee8fdcf500443e │ │ │ │ +00148a30: 3065 3531 3735 3033 3234 6161 3661 3161 0e51750324aa6a1a │ │ │ │ +00148a40: 2220 7469 746c 653d 2246 696e 616c 697a " title="Finaliz │ │ │ │ +00148a50: 6520 7468 6520 6769 7665 6e20 736f 6170 e the given soap │ │ │ │ +00148a60: 2063 6f6e 7465 7874 2c20 692e 652e 2077 context, i.e. w │ │ │ │ +00148a70: 6865 6e20 7468 6520 736f 6170 2063 6f6e hen the soap con │ │ │ │ +00148a80: 7465 7874 2069 7320 7374 6163 6b20 616c text is stack al │ │ │ │ +00148a90: 6c6f 6361 7465 642c 2061 7574 6f6d 6174 located, automat │ │ │ │ +00148aa0: 6963 616c 6c79 2069 6e76 6f6b 6564 2e2e ically invoked.. │ │ │ │ +00148ab0: 2e22 3e73 6f61 705f 646f 6e65 3c2f 613e .">soap_done │ │ │ │ +00148ac0: 3c2f 636f 6465 3e20 6f72 203c 636f 6465 or soap_free are called │ │ │ │ +00148b90: 2074 6f20 6465 7465 6374 206d 656d 6f72 to detect memor │ │ │ │ +00148ba0: 7920 6973 7375 6573 2c20 736f 2061 6e79 y issues, so any │ │ │ │ +00148bb0: 2063 616c 6c73 2074 6f20 3c63 6f64 653e calls to │ │ │ │ +00148bc0: 3c61 2063 6c61 7373 3d22 656c 2220 6872 s │ │ │ │ +00148c70: 6f61 705f 6465 7374 726f 793c 2f61 3e3c oap_destroy< │ │ │ │ +00148c80: 2f63 6f64 653e 2061 6e64 203c 636f 6465 /code> and soap_end are act │ │ │ │ +00148d70: 7561 6c6c 7920 6465 6665 7272 6564 2074 ually deferred t │ │ │ │ +00148d80: 6f20 6265 2065 7865 6375 7465 6420 7768 o be executed wh │ │ │ │ +00148d90: 656e 2074 6865 2063 6f6e 7465 7874 2066 en the context f │ │ │ │ +00148da0: 696e 616c 697a 6573 2e3c 2f70 3e0a 3c70 inalizes.

    .

    While memory ma │ │ │ │ +00148dc0: 6e61 6765 6d65 6e74 2069 6e20 6753 4f41 nagement in gSOA │ │ │ │ +00148dd0: 5020 6973 2061 7574 6f6d 6174 6963 2c20 P is automatic, │ │ │ │ +00148de0: 6974 2064 6f65 7320 6e6f 7420 656e 666f it does not enfo │ │ │ │ +00148df0: 7263 6520 6974 7320 6f77 6e20 6d65 6d6f rce its own memo │ │ │ │ +00148e00: 7279 206d 616e 6167 656d 656e 7420 706f ry management po │ │ │ │ +00148e10: 6c69 6379 206f 6e20 7468 6520 7573 6572 licy on the user │ │ │ │ +00148e20: 2e20 546f 206d 6f76 6520 6d61 6e61 6765 . To move manage │ │ │ │ +00148e30: 6420 6f62 6a65 6374 7320 616e 6420 6461 d objects and da │ │ │ │ +00148e40: 7461 2069 6e74 6f20 756e 6d61 6e61 6765 ta into unmanage │ │ │ │ +00148e50: 6420 6865 6170 2073 7061 6365 2c20 7468 d heap space, th │ │ │ │ +00148e60: 6520 3c63 6f64 653e 736f 6170 5f64 7570 e soap_dup │ │ │ │ +00148e70: 5f54 3c2f 636f 6465 3e20 6465 6570 2063 _T deep c │ │ │ │ +00148e80: 6f70 7920 6675 6e63 7469 6f6e 7320 6765 opy functions ge │ │ │ │ +00148e90: 6e65 7261 7465 6420 6279 203c 623e 3c63 nerated by soapcpp2 -Ec │ │ │ │ +00148eb0: 3c2f 636f 6465 3e3c 2f62 3e20 6f70 7469 opti │ │ │ │ +00148ec0: 6f6e 203c 623e 3c63 6f64 653e 2d45 633c on -Ec< │ │ │ │ +00148ed0: 2f63 6f64 653e 3c2f 623e 2063 616e 2062 /code> can b │ │ │ │ +00148ee0: 6520 7573 6564 2e20 546f 2064 656c 6574 e used. To delet │ │ │ │ +00148ef0: 6520 6465 6570 2063 6f70 6965 732c 2074 e deep copies, t │ │ │ │ +00148f00: 6865 203c 636f 6465 3e73 6f61 705f 6465 he soap_de │ │ │ │ +00148f10: 6c5f 543c 2f63 6f64 653e 2064 6565 7020 l_T deep │ │ │ │ +00148f20: 6465 6c65 7469 6f6e 2066 756e 6374 696f deletion functio │ │ │ │ +00148f30: 6e73 2067 656e 6572 6174 6564 2062 7920 ns generated by │ │ │ │ +00148f40: 3c62 3e3c 636f 6465 3e73 6f61 7063 7070 soapcpp │ │ │ │ +00148f50: 3220 2d45 643c 2f63 6f64 653e 3c2f 623e 2 -Ed │ │ │ │ +00148f60: 206f 7074 696f 6e20 3c62 3e3c 636f 6465 option -Ed │ │ │ │ +00148f80: 6361 6e20 6265 2075 7365 642e 2041 6674 can be used. Aft │ │ │ │ +00148f90: 6572 2063 6f70 7969 6e67 2074 6865 2075 er copying the u │ │ │ │ +00148fa0: 7375 616c 203c 636f 6465 3e3c 6120 636c sual soap_d │ │ │ │ +00149060: 6573 7472 6f79 3c2f 613e 3c2f 636f 6465 estroy and │ │ │ │ +00149140: 736f 6170 5f65 6e64 3c2f 613e 3c2f 636f soap_end functions re │ │ │ │ +00149160: 6d6f 7665 2074 6865 206d 616e 6167 6564 move the managed │ │ │ │ +00149170: 206f 7269 6769 6e61 6c73 2e20 5365 6520 originals. See │ │ │ │ +00149180: 616c 736f 2053 6563 7469 6f6e 203c 6120 also Section Generating dee │ │ │ │ +001491c0: 7020 636f 7079 2061 6e64 2064 656c 6574 p copy and delet │ │ │ │ +001491d0: 696f 6e20 6675 6e63 7469 6f6e 733c 2f61 ion functions.

    .

    Furthe │ │ │ │ +001491f0: 726d 6f72 652c 2074 6865 206d 656d 6f72 rmore, the memor │ │ │ │ +00149200: 7920 616c 6c6f 6361 7469 6f6e 2066 756e y allocation fun │ │ │ │ +00149210: 6374 696f 6e73 203c 636f 6465 3e6d 616c ctions mal │ │ │ │ +00149220: 6c6f 633c 2f63 6f64 653e 2061 6e64 203c loc and < │ │ │ │ +00149230: 636f 6465 3e6e 6577 3c2f 636f 6465 3e20 code>new │ │ │ │ +00149240: 7573 6564 2062 7920 7468 6520 656e 6769 used by the engi │ │ │ │ +00149250: 6e65 2069 6e74 6572 6e61 6c6c 7920 6361 ne internally ca │ │ │ │ +00149260: 6e20 6265 2072 6570 6c61 6365 6420 7769 n be replaced wi │ │ │ │ +00149270: 7468 206f 7468 6572 2061 6c6c 6f63 6174 th other allocat │ │ │ │ +00149280: 6f72 7320 6279 2064 6566 696e 696e 6720 ors by defining │ │ │ │ +00149290: 3c63 6f64 653e 534f 4150 5f4d 414c 4c4f SOAP_MALLO │ │ │ │ +001492a0: 433c 2f63 6f64 653e 2061 6e64 203c 636f C and SOAP_FREE to replace < │ │ │ │ +001492d0: 636f 6465 3e6d 616c 6c6f 633c 2f63 6f64 code>malloc and fre │ │ │ │ +001492f0: 653c 2f63 6f64 653e 2c20 616e 6420 6465 e, and de │ │ │ │ +00149300: 6669 6e65 203c 636f 6465 3e53 4f41 505f fine SOAP_ │ │ │ │ +00149310: 4e45 573c 2f63 6f64 653e 2c20 3c63 6f64 NEW, SOAP_NEW_ARRAY │ │ │ │ +00149330: 3c2f 636f 6465 3e2c 203c 636f 6465 3e53 , S │ │ │ │ +00149340: 4f41 505f 504c 4143 454d 454e 545f 4e45 OAP_PLACEMENT_NE │ │ │ │ +00149350: 573c 2f63 6f64 653e 2c20 616e 6420 3c63 W, and SOAP_DELETE< │ │ │ │ +00149370: 2f63 6f64 653e 2c20 3c63 6f64 653e 534f /code>, SO │ │ │ │ +00149380: 4150 5f44 454c 4554 455f 4152 5241 593c AP_DELETE_ARRAY< │ │ │ │ +00149390: 2f63 6f64 653e 2074 6f20 7265 706c 6163 /code> to replac │ │ │ │ +001493a0: 6520 3c63 6f64 653e 6e65 773c 2f63 6f64 e new and del │ │ │ │ +001493c0: 6574 653c 2f63 6f64 653e 2075 7365 6420 ete used │ │ │ │ +001493d0: 6279 2074 6865 2065 6e67 696e 6520 746f by the engine to │ │ │ │ +001493e0: 2061 6c6c 6f63 6174 6520 6d61 6e61 6765 allocate manage │ │ │ │ +001493f0: 6420 6d65 6d6f 7279 2e20 4f6e 6520 6361 d memory. One ca │ │ │ │ +00149400: 6e20 666f 7220 6578 616d 706c 6520 7573 n for example us │ │ │ │ +00149410: 6520 6120 6761 7262 6167 6520 636f 6c6c e a garbage coll │ │ │ │ +00149420: 6563 746f 7220 7769 7468 2067 534f 4150 ector with gSOAP │ │ │ │ +00149430: 2062 7920 6465 6669 6e69 6e67 2073 7569 by defining sui │ │ │ │ +00149440: 7461 626c 6520 7265 706c 6163 656d 656e table replacemen │ │ │ │ +00149450: 7473 2e3c 2f70 3e0a 3c70 3e4d 6f72 6520 ts.

    .

    More │ │ │ │ +00149460: 696e 666f 726d 6174 696f 6e20 6f6e 206d information on m │ │ │ │ +00149470: 656d 6f72 7920 6d61 6e61 6765 6d65 6e74 emory management │ │ │ │ +00149480: 2063 616e 2062 6520 666f 756e 6420 696e can be found in │ │ │ │ +00149490: 2074 6865 203c 6120 6872 6566 3d22 2e2e the C and C++ XML D │ │ │ │ +001494d0: 6174 6120 4269 6e64 696e 6773 3c2f 613e ata Bindings │ │ │ │ +001494e0: 2064 6f63 756d 656e 7461 7469 6f6e 2074 documentation t │ │ │ │ +001494f0: 6861 7420 6861 7320 7365 7061 7261 7465 hat has separate │ │ │ │ +00149500: 2073 6563 7469 6f6e 7320 6f6e 206d 656d sections on mem │ │ │ │ +00149510: 6f72 7920 6d61 6e61 6765 6d65 6e74 2069 ory management i │ │ │ │ +00149520: 6e20 4320 616e 6420 696e 2043 2b2b 2e3c n C and in C++.< │ │ │ │ +00149530: 2f70 3e0a 3c70 3ef0 9f94 9d20 3c61 2068 /p>.

    .... Back to │ │ │ │ +00149550: 7461 626c 6520 6f66 2063 6f6e 7465 6e74 table of content │ │ │ │ +00149560: 733c 2f61 3e3c 2f70 3e0a 3c68 313e 3c61 s

    .

    .Intra-clas │ │ │ │ +001495a0: 7320 6d65 6d6f 7279 206d 616e 6167 656d s memory managem │ │ │ │ +001495b0: 656e 743c 2f68 313e 0a3c 703e 5768 656e ent

    .

    When │ │ │ │ +001495c0: 2061 2063 6c61 7373 203c 636f 6465 3e54 a class T │ │ │ │ +001495d0: 3c2f 636f 6465 3e20 6861 7320 6120 3c63 has a struct soap │ │ │ │ +001495f0: 2a20 543a 3a73 6f61 703c 2f63 6f64 653e * T::soap │ │ │ │ +00149600: 206d 656d 6265 7220 6465 636c 6172 6564 member declared │ │ │ │ +00149610: 2069 6e20 616e 2069 6e74 6572 6661 6365 in an interface │ │ │ │ +00149620: 2068 6561 6465 7220 6669 6c65 2066 6f72 header file for │ │ │ │ +00149630: 2073 6f61 7063 7070 322c 2074 6865 6e20 soapcpp2, then │ │ │ │ +00149640: 7468 6973 206d 656d 6265 7220 7769 6c6c this member will │ │ │ │ +00149650: 2062 6520 7365 7420 746f 2070 6f69 6e74 be set to point │ │ │ │ +00149660: 2074 6f20 7468 6520 6375 7272 656e 7420 to the current │ │ │ │ +00149670: 636f 6e74 6578 7420 6279 2074 6865 2064 context by the d │ │ │ │ +00149680: 6573 6572 6961 6c69 7a65 7273 2061 6e64 eserializers and │ │ │ │ +00149690: 2062 7920 7468 6520 3c63 6f64 653e 736f by the so │ │ │ │ +001496a0: 6170 5f64 6566 6175 6c74 3c2f 636f 6465 ap_default method of the │ │ │ │ +001496c0: 636c 6173 7320 616e 6420 6279 2074 6865 class and by the │ │ │ │ +001496d0: 203c 636f 6465 3e73 6f61 705f 6465 6661 soap_defa │ │ │ │ +001496e0: 756c 745f 543c 2f63 6f64 653e 2061 6e64 ult_T and │ │ │ │ +001496f0: 203c 636f 6465 3e73 6f61 705f 6e65 775f soap_new_ │ │ │ │ +00149700: 543c 2f63 6f64 653e 2066 756e 6374 696f T functio │ │ │ │ +00149710: 6e73 2066 6f72 2074 6869 7320 636c 6173 ns for this clas │ │ │ │ +00149720: 7320 6e61 6d65 6420 3c63 6f64 653e 543c s named T< │ │ │ │ +00149730: 2f63 6f64 653e 2e20 5468 6973 2073 696d /code>. This sim │ │ │ │ +00149740: 706c 6966 6965 7320 6d65 6d6f 7279 206d plifies memory m │ │ │ │ +00149750: 616e 6167 656d 656e 7420 6279 2063 6c61 anagement by cla │ │ │ │ +00149760: 7373 206d 6574 686f 6473 2074 6861 7420 ss methods that │ │ │ │ +00149770: 616c 6c6f 6361 7465 2064 6174 6120 6173 allocate data as │ │ │ │ +00149780: 736f 6369 6174 6564 2077 6974 6820 7468 sociated with th │ │ │ │ +00149790: 6520 636c 6173 7320 696e 7374 616e 6365 e class instance │ │ │ │ +001497a0: 2074 6861 7420 6d75 7374 2062 6520 6d61 that must be ma │ │ │ │ +001497b0: 6e61 6765 6420 6279 2074 6865 2063 6f6e naged by the con │ │ │ │ +001497c0: 7465 7874 2e3c 2f70 3e0a 3c70 3e43 6f6e text.

    .

    Con │ │ │ │ +001497d0: 7369 6465 7220 666f 7220 6578 616d 706c sider for exampl │ │ │ │ +001497e0: 6520 7468 6520 666f 6c6c 6f77 696e 6720 e the following │ │ │ │ +001497f0: 636c 6173 7320 6465 636c 6172 6174 696f class declaratio │ │ │ │ +00149800: 6e3a 3c2f 703e 0a3c 6469 7620 636c 6173 n:

    .
    < │ │ │ │ +00149830: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +00149840: 6f72 6422 3e63 6c61 7373 203c 2f73 7061 ord">class Class
    .< │ │ │ │ +00149860: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00149870: 3e7b 203c 7370 616e 2063 6c61 7373 3d22 >{ public< │ │ │ │ +00149890: 2f73 7061 6e3e 3a3c 2f64 6976 3e0a 3c64 /span>:
    . │ │ │ │ +001498b0: 2020 2020 436c 6173 7328 293b 3c2f 6469 Class();.
    ~Class( │ │ │ │ +001498e0: 293b 3c2f 6469 763e 0a3c 6469 7620 636c );
    .
    < │ │ │ │ +00149900: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +00149910: 6f72 6422 3e73 7472 7563 7420 3c2f 7370 ord">struct soap *soa │ │ │ │ +001499a0: 703c 2f61 3e3b 3c2f 6469 763e 0a3c 6469 p;
    . │ │ │ │ +001499c0: 2020 203c 7370 616e 2063 6c61 7373 3d22 cha │ │ │ │ +001499e0: 723c 2f73 7061 6e3e 202a 6e61 6d65 3b20 r *name; │ │ │ │ +001499f0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173

    .
    void setName(const char *s);
    . │ │ │ │ +00149a90: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    │ │ │ │ +00149ac0: 6368 6172 3c2f 7370 616e 3e20 2a67 6574 char *get │ │ │ │ +00149ad0: 4e61 6d65 2829 3b3c 2f64 6976 3e0a 3c64 Name();
    . │ │ │ │ +00149af0: 7d3b 3c2f 6469 763e 0a3c 2f64 6976 3e3c };
    .
    < │ │ │ │ +00149b00: 212d 2d20 6672 6167 6d65 6e74 202d 2d3e !-- fragment --> │ │ │ │ +00149b10: 3c70 3e53 696e 6365 2074 6865 203c 636f

    Since the name m │ │ │ │ +00149b30: 656d 6265 7220 6973 2061 2063 6861 7261 ember is a chara │ │ │ │ +00149b40: 6374 6572 2070 6f69 6e74 6572 2074 6f20 cter pointer to │ │ │ │ +00149b50: 6120 7374 7269 6e67 2c20 7768 6572 6520 a string, where │ │ │ │ +00149b60: 7368 6f75 6c64 2077 6520 616c 6c6f 6361 should we alloca │ │ │ │ +00149b70: 7465 2074 6869 7320 7374 7269 6e67 3f20 te this string? │ │ │ │ +00149b80: 496e 206d 6f73 7420 6361 7365 7320 7765 In most cases we │ │ │ │ +00149b90: 2077 696c 6c20 6164 6420 6120 636f 6e73 will add a cons │ │ │ │ +00149ba0: 7472 7563 746f 7220 7468 6174 2069 6e69 tructor that ini │ │ │ │ +00149bb0: 7469 616c 6c79 2073 6574 7320 3c63 6f64 tially sets name to │ │ │ │ +00149bd0: 204e 554c 4c20 616e 6420 6120 6465 7374 NULL and a dest │ │ │ │ +00149be0: 7275 6374 6f72 2074 6861 7420 6465 6c65 ructor that dele │ │ │ │ +00149bf0: 7465 7320 3c63 6f64 653e 6e61 6d65 3c2f tes name when non-N │ │ │ │ +00149c10: 554c 4c2c 206c 696b 6520 736f 3a3c 2f70 ULL, like so:

    .
    Class: │ │ │ │ +00149c50: 3a43 6c61 7373 2829 203c 2f64 6976 3e0a :Class()
    . │ │ │ │ +00149c60: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    {
    .
    soap = │ │ │ │ +00149cc0: 4e55 4c4c 3b3c 2f64 6976 3e0a 3c64 6976 NULL;
    .
    │ │ │ │ +00149ce0: 6e61 6d65 203d 204e 554c 4c3b 3c2f 6469 name = NULL;.
    }
    . │ │ │ │ +00149d20: 436c 6173 733a 3a7e 436c 6173 7328 2920 Class::~Class() │ │ │ │ +00149d30: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    {
    │ │ │ │ +00149d50: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    i │ │ │ │ +00149d80: 663c 2f73 7061 6e3e 2028 6e61 6d65 293c f (name)< │ │ │ │ +00149d90: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    free │ │ │ │ +00149db0: 286e 616d 6529 3b3c 2f64 6976 3e0a 3c64 (name);
    . │ │ │ │ +00149dd0: 7d3c 2f64 6976 3e0a 3c2f 6469 763e 3c21 }
    .
    < │ │ │ │ +00149df0: 703e 486f 7765 7665 722c 2077 6865 6e20 p>However, when │ │ │ │ +00149e00: 696e 7374 616e 6365 7320 6f66 203c 636f instances of Class
    │ │ │ │ +00149e20: 6172 6520 6465 7365 7269 616c 697a 6564 are deserialized │ │ │ │ +00149e30: 2077 6520 6861 7665 2061 2070 726f 626c we have a probl │ │ │ │ +00149e40: 656d 2077 6974 6820 7468 6973 2061 7070 em with this app │ │ │ │ +00149e50: 726f 6163 6820 6265 6361 7573 6520 3c63 roach because free(name) deletes a │ │ │ │ +00149e80: 6d61 6e61 6765 6420 7374 7269 6e67 2c20 managed string, │ │ │ │ +00149e90: 7768 6963 6820 6973 206d 616e 6167 6564 which is managed │ │ │ │ +00149ea0: 2062 7920 7468 6520 636f 6e74 6578 742e by the context. │ │ │ │ +00149eb0: 2042 6563 6175 7365 2074 6865 2064 6573 Because the des │ │ │ │ +00149ec0: 6572 6961 6c69 7a65 7220 616c 736f 2073 erializer also s │ │ │ │ +00149ed0: 6574 7320 7468 6520 3c63 6f64 653e 736f ets the so │ │ │ │ +00149ee0: 6170 3c2f 636f 6465 3e20 6d65 6d62 6572 ap member │ │ │ │ +00149ef0: 206f 6620 7468 6973 2063 6c61 7373 2c20 of this class, │ │ │ │ +00149f00: 7468 6572 6520 6973 2061 6e20 6561 7379 there is an easy │ │ │ │ +00149f10: 2073 6f6c 7574 696f 6e20 746f 2074 6869 solution to thi │ │ │ │ +00149f20: 7320 7072 6f62 6c65 6d3a 3c2f 703e 0a3c s problem:

    .< │ │ │ │ +00149f30: 6469 7620 636c 6173 733d 2266 7261 676d div class="fragm │ │ │ │ +00149f40: 656e 7422 3e3c 6469 7620 636c 6173 733d ent">
    Class::~C │ │ │ │ +00149f60: 6c61 7373 2829 203c 2f64 6976 3e0a 3c64 lass()
    . │ │ │ │ +00149f80: 7b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 {
    .
    if │ │ │ │ +00149fc0: 2821 3c61 2063 6c61 7373 3d22 636f 6465 (!soap && nam │ │ │ │ +0014a000: 6529 3c2f 6469 763e 0a3c 6469 7620 636c e)
    .
    f │ │ │ │ +0014a020: 7265 6528 6e61 6d65 293b 3c2f 6469 763e ree(name);
    │ │ │ │ +0014a030: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    }
    .

    A │ │ │ │ +0014a6b0: 6e6f 7468 6572 2061 7070 726f 6163 6820 nother approach │ │ │ │ +0014a6c0: 6973 2074 6f20 7573 6520 3c63 6f64 653e is to use │ │ │ │ +0014a6d0: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap_unlink< │ │ │ │ +0014a7a0: 2f61 3e3c 2f63 6f64 653e 2074 6f20 756e /a> to un │ │ │ │ +0014a7b0: 6c69 6e6b 2064 6174 6120 6d61 6e61 6765 link data manage │ │ │ │ +0014a7c0: 6420 6279 2074 6865 2063 6f6e 7465 7874 d by the context │ │ │ │ +0014a7d0: 2061 6e64 206d 616b 6520 616c 6c20 616c and make all al │ │ │ │ +0014a7e0: 6c6f 6361 7469 6f6e 7320 6578 706c 6963 locations explic │ │ │ │ +0014a7f0: 6974 6c79 3a3c 2f70 3e0a 3c64 6976 2063 itly:

    .
    │ │ │ │ +0014a810: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    Class::~Class( │ │ │ │ +0014a830: 2920 3c2f 6469 763e 0a3c 6469 7620 636c )
    .
    {.
    if (name │ │ │ │ +0014a890: 293c 2f64 6976 3e0a 3c64 6976 2063 6c61 )
    .
    {.
    s │ │ │ │ +0014a920: 6f61 705f 756e 6c69 6e6b 3c2f 613e 283c oap_unlink(< │ │ │ │ +0014a930: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +0014a940: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ +0014a950: 6874 6d6c 223e 736f 6170 3c2f 613e 2c20 html">soap, │ │ │ │ +0014a960: 6e61 6d65 293b 203c 7370 616e 2063 6c61 name); // │ │ │ │ +0014a980: 756e 6c69 6e6b 7320 7468 6520 6e61 6d65 unlinks the name │ │ │ │ +0014a990: 2069 6620 736f 6170 2069 7320 6e6f 6e2d if soap is non- │ │ │ │ +0014a9a0: 4e55 4c4c 3c2f 7370 616e 3e3c 2f64 6976 NULL
    .
    free(nam │ │ │ │ +0014a9d0: 6529 3b3c 2f64 6976 3e0a 3c64 6976 2063 e);
    .
    }< │ │ │ │ +0014a9f0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    }
    . │ │ │ │ +0014aa10: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    void │ │ │ │ +0014aa40: 3c2f 7370 616e 3e20 436c 6173 733a 3a73 Class::s │ │ │ │ +0014aa50: 6574 4e61 6d65 283c 7370 616e 2063 6c61 etName(con │ │ │ │ +0014aa70: 7374 3c2f 7370 616e 3e20 3c73 7061 6e20 st char │ │ │ │ +0014aaa0: 2a73 293c 2f64 6976 3e0a 3c64 6976 2063 *s)
    .
    {.
    name = s │ │ │ │ +0014aae0: 7472 6475 7028 7329 3b3c 2f64 6976 3e0a trdup(s);
    . │ │ │ │ +0014aaf0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    }
    .
    const < │ │ │ │ +0014ab40: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +0014ab50: 6f72 6474 7970 6522 3e63 6861 723c 2f73 ordtype">char *getName()< │ │ │ │ +0014ab70: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    {
    . │ │ │ │ +0014ab90: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    re │ │ │ │ +0014abc0: 7475 726e 3c2f 7370 616e 3e20 6e61 6d65 turn name │ │ │ │ +0014abd0: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
    .
    }
    .
    int │ │ │ │ +0014acd0: 736f 6170 5f75 6e6c 696e 6b28 7374 7275 soap_unlink(stru │ │ │ │ +0014ace0: 6374 2073 6f61 7020 2a73 6f61 702c 2063 ct soap *soap, c │ │ │ │ +0014acf0: 6f6e 7374 2076 6f69 6420 2a70 7472 293c onst void *ptr)< │ │ │ │ +0014ad00: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
    Unlink a │ │ │ │ +0014ad20: 2062 6c6f 636b 206f 6620 6865 6170 206d block of heap m │ │ │ │ +0014ad30: 656d 6f72 7920 6d61 6e61 6765 6420 6279 emory managed by │ │ │ │ +0014ad40: 2074 6865 2073 7065 6369 6669 6564 2073 the specified s │ │ │ │ +0014ad50: 6f61 7020 636f 6e74 6578 742c 2074 6f20 oap context, to │ │ │ │ +0014ad60: 7265 6c65 6173 6520 7468 6520 6d65 6d6f release the memo │ │ │ │ +0014ad70: 7279 2065 7870 6c69 6369 746c 792e 2e2e ry explicitly... │ │ │ │ +0014ad80: 3c2f 6469 763e 3c2f 6469 763e 0a3c 2f64
    .

    The soap_unlink │ │ │ │ +0014ae80: 3c2f 613e 3c2f 636f 6465 3e20 6361 6c6c call │ │ │ │ +0014ae90: 2075 6e6c 696e 6b73 2064 6174 6120 616e unlinks data an │ │ │ │ +0014aea0: 6420 6f62 6a65 6374 7320 6672 6f6d 206d d objects from m │ │ │ │ +0014aeb0: 616e 6167 6564 206d 656d 6f72 792e 2049 anaged memory. I │ │ │ │ +0014aec0: 6e20 7468 6973 2077 6179 203c 636f 6465 n this way │ │ │ │ +0014af80: 736f 6170 5f64 6573 7472 6f79 3c2f 613e soap_destroy │ │ │ │ +0014af90: 3c2f 636f 6465 3e20 616e 6420 3c63 6f64 and soap_end can be │ │ │ │ +0014b080: 2063 616c 6c65 6420 6c61 7465 7220 6576 called later ev │ │ │ │ +0014b090: 656e 2077 6865 6e20 7468 6973 2063 6c61 en when this cla │ │ │ │ +0014b0a0: 7373 2077 6173 2064 6573 6572 6961 6c69 ss was deseriali │ │ │ │ +0014b0b0: 7a65 642e 3c2f 703e 0a3c 703e f09f 949d zed.

    .

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

    .< │ │ │ │ +0014b0f0: 6831 3e3c 6120 636c 6173 733d 2261 6e63 h1>.Debuggi │ │ │ │ +0014b120: 6e67 3c2f 6831 3e0a 3c70 3e54 6f20 6163 ng.

    To ac │ │ │ │ +0014b130: 7469 7661 7465 2064 6562 7567 6769 6e67 tivate debugging │ │ │ │ +0014b140: 2061 6e64 206d 6573 7361 6765 206c 6f67 and message log │ │ │ │ +0014b150: 6769 6e67 2063 6f6d 7069 6c65 2074 6865 ging compile the │ │ │ │ +0014b160: 2073 6f75 7263 6520 636f 6465 2077 6974 source code wit │ │ │ │ +0014b170: 6820 636f 6d70 696c 652d 7469 6d65 2066 h compile-time f │ │ │ │ +0014b180: 6c61 6720 3c63 6f64 653e 2344 4542 5547 lag #DEBUG │ │ │ │ +0014b190: 3c2f 636f 6465 3e2e 204f 7220 7768 656e . Or when │ │ │ │ +0014b1a0: 2075 7369 6e67 203c 623e 3c63 6f64 653e using │ │ │ │ +0014b1b0: 2d6c 6773 6f61 703c 2f63 6f64 653e 3c2f -lgsoap or - │ │ │ │ +0014b1d0: 6c67 736f 6170 2b2b 3c2f 636f 6465 3e3c lgsoap++< │ │ │ │ +0014b1e0: 2f62 3e20 7468 656e 2072 6569 6e73 7461 /b> then reinsta │ │ │ │ +0014b1f0: 6c6c 2067 534f 4150 2077 6974 6820 3c62 ll gSOAP with ./configu │ │ │ │ +0014b210: 7265 202d 2d65 6e61 626c 652d 6465 6275 re --enable-debu │ │ │ │ +0014b220: 673c 2f63 6f64 653e 3c2f 623e 2061 6e64 g and │ │ │ │ +0014b230: 203c 623e 3c63 6f64 653e 6d61 6b65 3c2f make.

    .< │ │ │ │ +0014b250: 703e 5768 656e 2079 6f75 7220 6753 4f41 p>When your gSOA │ │ │ │ +0014b260: 5020 636c 6965 6e74 206f 7220 7365 7276 P client or serv │ │ │ │ +0014b270: 6572 2061 7070 6c69 6361 7469 6f6e 7320 er applications │ │ │ │ +0014b280: 7275 6e2c 2074 6865 7920 7769 6c6c 206c run, they will l │ │ │ │ +0014b290: 6f67 2074 6865 6972 2061 6374 6976 6974 og their activit │ │ │ │ +0014b2a0: 7920 696e 2074 6872 6565 2073 6570 6172 y in three separ │ │ │ │ +0014b2b0: 6174 6520 6669 6c65 733a 3c2f 703e 0a3c ate files:

    .< │ │ │ │ +0014b2c0: 756c 3e0a 3c6c 693e 3c65 6d3e 3c63 6f64 ul>.
  • SENT.log a concate │ │ │ │ +0014b2f0: 6e61 7469 6f6e 206f 6620 616c 6c20 6d65 nation of all me │ │ │ │ +0014b300: 7373 6167 6573 2073 656e 743c 2f6c 693e ssages sent
  • │ │ │ │ +0014b310: 0a3c 6c69 3e3c 656d 3e3c 636f 6465 3e52 .
  • R │ │ │ │ +0014b320: 4543 562e 6c6f 673c 2f63 6f64 653e 3c2f ECV.log a concatenat │ │ │ │ +0014b340: 696f 6e20 6f66 2061 6c6c 206d 6573 7361 ion of all messa │ │ │ │ +0014b350: 6765 7320 7265 6365 6976 6564 3c2f 6c69 ges received
  • .
  • │ │ │ │ +0014b370: 5445 5354 2e6c 6f67 3c2f 636f 6465 3e3c TEST.log< │ │ │ │ +0014b380: 2f65 6d3e 2061 206c 6f67 206f 6620 7468 /em> a log of th │ │ │ │ +0014b390: 6520 656e 6769 6e65 2773 206f 7065 7261 e engine's opera │ │ │ │ +0014b3a0: 7469 6f6e 733c 2f6c 693e 0a3c 2f75 6c3e tions
  • . │ │ │ │ +0014b3b0: 0a3c 646c 2063 6c61 7373 3d22 7365 6374 .
    Warning
    The gSOAP clien │ │ │ │ +0014b3f0: 7420 616e 6420 7365 7276 6572 2061 7070 t and server app │ │ │ │ +0014b400: 6c69 6361 7469 6f6e 7320 7769 6c6c 2072 lications will r │ │ │ │ +0014b410: 756e 2073 6c6f 7720 6475 6520 746f 2064 un slow due to d │ │ │ │ +0014b420: 6562 7567 6769 6e67 2061 6e64 206d 6573 ebugging and mes │ │ │ │ +0014b430: 7361 6765 206c 6f67 6769 6e67 2e3c 2f64 sage logging.
    .

    You c │ │ │ │ +0014b450: 616e 2073 6574 206d 6163 726f 203c 636f an set macro #DEBUG_STAMP< │ │ │ │ +0014b470: 2f63 6f64 653e 2069 6e73 7465 6164 206f /code> instead o │ │ │ │ +0014b480: 6620 3c63 6f64 653e 2344 4542 5547 3c2f f #DEBUG to add tim │ │ │ │ +0014b4a0: 6520 7374 616d 7073 2074 6f20 3c63 6f64 e stamps to TEST.log. This works on │ │ │ │ +0014b4d0: 2061 6c6c 206f 7065 7261 7469 6e67 2073 all operating s │ │ │ │ +0014b4e0: 7973 7465 6d73 2073 7570 706f 7274 696e ystems supportin │ │ │ │ +0014b4f0: 6720 7468 6520 3c63 6f64 653e 6765 7474 g the gett │ │ │ │ +0014b500: 696d 656f 6664 6179 3c2f 636f 6465 3e20 imeofday │ │ │ │ +0014b510: 6675 6e63 7469 6f6e 2e3c 2f70 3e0a 3c70 function.

    .

    When installing │ │ │ │ +0014b530: 2061 2043 4749 2073 6572 7669 6365 2061 a CGI service a │ │ │ │ +0014b540: 7070 6c69 6361 7469 6f6e 2063 6f6d 7069 pplication compi │ │ │ │ +0014b550: 6c65 6420 7769 7468 2064 6562 7567 6769 led with debuggi │ │ │ │ +0014b560: 6e67 2065 6e61 626c 6564 2c20 7468 6520 ng enabled, the │ │ │ │ +0014b570: 6c6f 6720 6669 6c65 7320 6d61 7920 736f log files may so │ │ │ │ +0014b580: 6d65 7469 6d65 7320 6e6f 7420 6265 2063 metimes not be c │ │ │ │ +0014b590: 7265 6174 6564 2064 7565 2074 6f20 6669 reated due to fi │ │ │ │ +0014b5a0: 6c65 2061 6363 6573 7320 7065 726d 6973 le access permis │ │ │ │ +0014b5b0: 7369 6f6e 2072 6573 7472 6963 7469 6f6e sion restriction │ │ │ │ +0014b5c0: 7320 696d 706f 7365 6420 6f6e 2043 4749 s imposed on CGI │ │ │ │ +0014b5d0: 2061 7070 6c69 6361 7469 6f6e 732e 2054 applications. T │ │ │ │ +0014b5e0: 6f20 6765 7420 6172 6f75 6e64 2074 6869 o get around thi │ │ │ │ +0014b5f0: 732c 2063 7265 6174 6520 656d 7074 7920 s, create empty │ │ │ │ +0014b600: 6c6f 6720 6669 6c65 7320 7769 7468 2075 log files with u │ │ │ │ +0014b610: 6e69 7665 7273 616c 2077 7269 7465 2070 niversal write p │ │ │ │ +0014b620: 6572 6d69 7373 696f 6e73 2e20 4265 2063 ermissions. Be c │ │ │ │ +0014b630: 6172 6566 756c 2061 626f 7574 2074 6865 areful about the │ │ │ │ +0014b640: 2073 6563 7572 6974 7920 696d 706c 6963 security implic │ │ │ │ +0014b650: 6174 696f 6e20 6f66 2074 6869 732e 3c2f ation of this..

    You can ac │ │ │ │ +0014b670: 7475 616c 6c79 2074 6573 7420 6120 4347 tually test a CG │ │ │ │ +0014b680: 4920 7365 7276 6963 6520 6170 706c 6963 I service applic │ │ │ │ +0014b690: 6174 696f 6e20 7769 7468 6f75 7420 6465 ation without de │ │ │ │ +0014b6a0: 706c 6f79 696e 6720 6974 206f 6e20 7468 ploying it on th │ │ │ │ +0014b6b0: 6520 5765 622e 2054 6f20 646f 2074 6869 e Web. To do thi │ │ │ │ +0014b6c0: 732c 2063 7265 6174 6520 7468 6520 4347 s, create the CG │ │ │ │ +0014b6d0: 4920 7365 7276 6963 6520 6170 706c 6963 I service applic │ │ │ │ +0014b6e0: 6174 696f 6e20 616e 6420 7365 6e64 2069 ation and send i │ │ │ │ +0014b6f0: 7420 6120 7265 7175 6573 7420 6d65 7373 t a request mess │ │ │ │ +0014b700: 6167 6520 7573 696e 6720 7265 6469 7265 age using redire │ │ │ │ +0014b710: 6374 696f 6e20 6173 2066 6f6c 6c6f 7773 ction as follows │ │ │ │ +0014b720: 3a20 3c2f 703e 3c70 7265 2063 6c61 7373 :

    ./se
    │ │ │ │ +0014b740: 7276 6963 652e 6367 6920 266c 743b 206e  rvice.cgi < n
    │ │ │ │ +0014b750: 732e 6164 642e 7265 712e 786d 6c0a 3c2f  s.add.req.xml.

    this sho │ │ │ │ +0014b770: 756c 6420 6469 7370 6c61 7920 7468 6520 uld display the │ │ │ │ +0014b780: 7365 7276 6963 6520 7265 7370 6f6e 7365 service response │ │ │ │ +0014b790: 206f 6e20 7468 6520 7465 726d 696e 616c on the terminal │ │ │ │ +0014b7a0: 2c20 7768 6572 6520 3c65 6d3e 3c63 6f64 , where ns.add.req.xml │ │ │ │ +0014b7c0: 3c2f 636f 6465 3e3c 2f65 6d3e 2077 6173 was │ │ │ │ +0014b7d0: 2067 656e 6572 6174 6564 2062 7920 736f generated by so │ │ │ │ +0014b7e0: 6170 6370 7032 206f 7220 6120 6d6f 6469 apcpp2 or a modi │ │ │ │ +0014b7f0: 6669 6564 2076 6572 7369 6f6e 206f 6620 fied version of │ │ │ │ +0014b800: 7468 6973 2066 696c 652e 2059 6f75 2063 this file. You c │ │ │ │ +0014b810: 616e 2061 6c73 6f20 7573 6520 6120 3c65 an also use a SENT.log │ │ │ │ +0014b830: 3c2f 636f 6465 3e3c 2f65 6d3e 2066 696c fil │ │ │ │ +0014b840: 6520 7072 6f64 7563 6564 2062 7920 6120 e produced by a │ │ │ │ +0014b850: 636c 6965 6e74 2061 7070 6c69 6361 7469 client applicati │ │ │ │ +0014b860: 6f6e 2074 6f20 7265 6469 7265 6374 2074 on to redirect t │ │ │ │ +0014b870: 6f20 7468 6520 4347 4920 7365 7276 6963 o the CGI servic │ │ │ │ +0014b880: 6520 6170 706c 6963 6174 696f 6e2e 2059 e application. Y │ │ │ │ +0014b890: 6f75 2063 616e 2061 6c73 6f20 7573 6520 ou can also use │ │ │ │ +0014b8a0: 7468 6520 6753 4f41 5020 3c61 2068 7265 the gSOAP Test Messenge │ │ │ │ +0014b8e0: 723c 2f61 3e20 6170 706c 6963 6174 696f r applicatio │ │ │ │ +0014b8f0: 6e20 746f 2067 656e 6572 6174 6520 7261 n to generate ra │ │ │ │ +0014b900: 6e64 6f6d 697a 6564 206d 6573 7361 6765 ndomized message │ │ │ │ +0014b910: 7320 746f 2074 6573 7420 796f 7572 2073 s to test your s │ │ │ │ +0014b920: 6572 7665 7273 2e3c 2f70 3e0a 3c70 3e54 ervers.

    .

    T │ │ │ │ +0014b930: 6865 2066 696c 6520 6e61 6d65 7320 6f66 he file names of │ │ │ │ +0014b940: 2074 6865 206c 6f67 2066 696c 6573 2061 the log files a │ │ │ │ +0014b950: 6e64 2074 6865 206c 6f67 6769 6e67 2061 nd the logging a │ │ │ │ +0014b960: 6374 6976 6974 7920 6361 6e20 6265 2063 ctivity can be c │ │ │ │ +0014b970: 6f6e 7472 6f6c 6c65 6420 6174 2074 6865 ontrolled at the │ │ │ │ +0014b980: 2061 7070 6c69 6361 7469 6f6e 206c 6576 application lev │ │ │ │ +0014b990: 656c 2e20 5468 6973 2061 6c6c 6f77 7320 el. This allows │ │ │ │ +0014b9a0: 7468 6520 6372 6561 7469 6f6e 206f 6620 the creation of │ │ │ │ +0014b9b0: 7365 7061 7261 7465 206c 6f67 2066 696c separate log fil │ │ │ │ +0014b9c0: 6573 2062 7920 7365 7061 7261 7465 2073 es by separate s │ │ │ │ +0014b9d0: 6572 7669 6365 732c 2063 6c69 656e 7473 ervices, clients │ │ │ │ +0014b9e0: 2c20 616e 6420 7468 7265 6164 732e 2046 , and threads. F │ │ │ │ +0014b9f0: 6f72 2065 7861 6d70 6c65 2c20 7468 6520 or example, the │ │ │ │ +0014ba00: 666f 6c6c 6f77 696e 6720 7365 7276 6963 following servic │ │ │ │ +0014ba10: 6520 6c6f 6773 2061 6c6c 206d 6573 7361 e logs all messa │ │ │ │ +0014ba20: 6765 7320 2862 7574 206e 6f20 6465 6275 ges (but no debu │ │ │ │ +0014ba30: 6720 6d65 7373 6167 6573 2920 696e 2073 g messages) in s │ │ │ │ +0014ba40: 6570 6172 6174 6520 6469 7265 6374 6f72 eparate director │ │ │ │ +0014ba50: 6965 733a 3c2f 703e 0a3c 6469 7620 636c ies:

    .
    < │ │ │ │ +0014ba70: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +0014ba80: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >struct soap │ │ │ │ +0014bad0: 3c2f 613e 202a 3c61 2063 6c61 7373 3d22 *soa │ │ │ │ +0014bb00: 703c 2f61 3e20 3d20 3c61 2063 6c61 7373 p = soa │ │ │ │ +0014bb60: 705f 6e65 773c 2f61 3e28 293b 203c 2f64 p_new(); ..< │ │ │ │ +0014bce0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +0014bcf0: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ │ +0014bd00: 705f 5f64 6562 7567 2e68 746d 6c23 6761 p__debug.html#ga │ │ │ │ +0014bd10: 3935 3732 3963 3238 6637 3132 6366 3462 95729c28f712cf4b │ │ │ │ +0014bd20: 6361 3331 3235 3935 6235 6365 3236 3837 ca312595b5ce2687 │ │ │ │ +0014bd30: 223e 736f 6170 5f73 6574 5f73 656e 745f ">soap_set_sent_ │ │ │ │ +0014bd40: 6c6f 6766 696c 653c 2f61 3e28 3c61 2063 logfile(soap, "l │ │ │ │ +0014bda0: 6f67 732f 7365 6e74 2f73 6572 7669 6365 ogs/sent/service │ │ │ │ +0014bdb0: 3132 2e6c 6f67 2671 756f 743b 3c2f 7370 12.log"); // a │ │ │ │ +0014bde0: 7070 656e 6420 616c 6c20 6d65 7373 6167 ppend all messag │ │ │ │ +0014bdf0: 6573 2073 656e 7420 696e 202f 6c6f 6773 es sent in /logs │ │ │ │ +0014be00: 2f73 656e 742f 7365 7276 6963 6531 322e /sent/service12. │ │ │ │ +0014be10: 6c6f 6720 3c2f 7370 616e 3e3c 2f64 6976 log
    .
    soap_set_ │ │ │ │ +0014be90: 7465 7374 5f6c 6f67 6669 6c65 3c2f 613e test_logfile │ │ │ │ +0014bea0: 283c 6120 636c 6173 733d 2263 6f64 6522 (soap │ │ │ │ +0014bed0: 2c20 4e55 4c4c 293b 2020 2020 2020 2020 , NULL); │ │ │ │ +0014bee0: 2020 2020 2020 2020 2020 2020 2020 3c73 // no file n │ │ │ │ +0014bf10: 616d 653a 2064 6f20 6e6f 7420 7361 7665 ame: do not save │ │ │ │ +0014bf20: 2064 6562 7567 206d 6573 7361 6765 7320 debug messages │ │ │ │ +0014bf30: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ │ +0014bf50: 2e2e 2e20 3c73 7061 6e20 636c 6173 733d ... //
    .
    soap │ │ │ │ +0014bfe0: 5f73 6572 7665 3c2f 613e 283c 6120 636c _serve(soap); .
    ... │ │ │ │ +0014c050: 2f2f 3c2f 7370 616e 3e3c 2f64 6976 3e0a //
    . │ │ │ │ +0014c060: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65 . │ │ │ │ +0014c160: 3c64 6976 2063 6c61 7373 3d22 7474 6e61
    voi │ │ │ │ +0014c1f0: 6420 736f 6170 5f73 6574 5f72 6563 765f d soap_set_recv_ │ │ │ │ +0014c200: 6c6f 6766 696c 6528 7374 7275 6374 2073 logfile(struct s │ │ │ │ +0014c210: 6f61 7020 2a73 6f61 702c 2063 6f6e 7374 oap *soap, const │ │ │ │ +0014c220: 2063 6861 7220 2a6c 6f67 6669 6c65 293c char *logfile)< │ │ │ │ +0014c230: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
    Specify │ │ │ │ +0014c250: 6120 6669 6c65 206e 616d 6520 746f 2073 a file name to s │ │ │ │ +0014c260: 6176 6520 6d65 7373 6167 6573 2072 6563 ave messages rec │ │ │ │ +0014c270: 6569 7665 642e 3c2f 6469 763e 3c2f 6469 eived.
    .
    < │ │ │ │ +0014c350: 6469 7620 636c 6173 733d 2274 7464 6563 div class="ttdec │ │ │ │ +0014c360: 6922 3e76 6f69 6420 736f 6170 5f73 6574 i">void soap_set │ │ │ │ +0014c370: 5f74 6573 745f 6c6f 6766 696c 6528 7374 _test_logfile(st │ │ │ │ +0014c380: 7275 6374 2073 6f61 7020 2a73 6f61 702c ruct soap *soap, │ │ │ │ +0014c390: 2063 6f6e 7374 2063 6861 7220 2a6c 6f67 const char *log │ │ │ │ +0014c3a0: 6669 6c65 293c 2f64 6976 3e3c 6469 7620 file)
    Sp │ │ │ │ +0014c3c0: 6563 6966 7920 6120 6669 6c65 206e 616d ecify a file nam │ │ │ │ +0014c3d0: 6520 746f 2073 6176 6520 6465 6275 6767 e to save debugg │ │ │ │ +0014c3e0: 696e 6720 696e 666f 2e3c 2f64 6976 3e3c ing info.
    < │ │ │ │ +0014c3f0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    soap_set_sent │ │ │ │ +0014c4b0: 5f6c 6f67 6669 6c65 3c2f 613e 3c2f 6469 _logfile
    void soap_ │ │ │ │ +0014c4e0: 7365 745f 7365 6e74 5f6c 6f67 6669 6c65 set_sent_logfile │ │ │ │ +0014c4f0: 2873 7472 7563 7420 736f 6170 202a 736f (struct soap *so │ │ │ │ +0014c500: 6170 2c20 636f 6e73 7420 6368 6172 202a ap, const char * │ │ │ │ +0014c510: 6c6f 6766 696c 6529 3c2f 6469 763e 3c64 logfile)
    Specify a file │ │ │ │ +0014c540: 6e61 6d65 2074 6f20 7361 7665 206d 6573 name to save mes │ │ │ │ +0014c550: 7361 6765 7320 7365 6e74 2e3c 2f64 6976 sages sent.
    .
    < │ │ │ │ +0014c580: 703e 4c69 6b65 7769 7365 2c20 6d65 7373 p>Likewise, mess │ │ │ │ +0014c590: 6167 6573 2063 616e 2062 6520 6c6f 6767 ages can be logg │ │ │ │ +0014c5a0: 6564 2066 6f72 2069 6e64 6976 6964 7561 ed for individua │ │ │ │ +0014c5b0: 6c20 636c 6965 6e74 2d73 6964 6520 7365 l client-side se │ │ │ │ +0014c5c0: 7276 6963 6520 6f70 6572 6174 696f 6e20 rvice operation │ │ │ │ +0014c5d0: 6361 6c6c 7320 696e 2061 2063 6c69 656e calls in a clien │ │ │ │ +0014c5e0: 7420 6170 706c 6963 6174 696f 6e2e 3c2f t application..

    To log mes │ │ │ │ +0014c600: 7361 6765 7320 6d6f 7265 2065 6666 6963 sages more effic │ │ │ │ +0014c610: 6965 6e74 6c79 2c20 7573 6520 7468 6520 iently, use the │ │ │ │ +0014c620: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 logging │ │ │ │ +0014c6b0: 3c2f 613e 3c2f 636f 6465 3e20 706c 7567 plug │ │ │ │ +0014c6c0: 696e 2e3c 2f70 3e0a 3c70 3ef0 9f94 9d20 in.

    .

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

    ..Limita │ │ │ │ +0014c730: 7469 6f6e 733c 2f68 313e 0a3c 703e 4672 tions.

    Fr │ │ │ │ +0014c740: 6f6d 2074 6865 2070 6572 7370 6563 7469 om the perspecti │ │ │ │ +0014c750: 7665 206f 6620 7468 6520 432f 432b 2b20 ve of the C/C++ │ │ │ │ +0014c760: 6c61 6e67 7561 6765 2c20 6120 6665 7720 language, a few │ │ │ │ +0014c770: 432f 432b 2b20 6c61 6e67 7561 6765 2066 C/C++ language f │ │ │ │ +0014c780: 6561 7475 7265 7320 6172 6520 6e6f 7420 eatures are not │ │ │ │ +0014c790: 7375 7070 6f72 7465 6420 6279 2067 534f supported by gSO │ │ │ │ +0014c7a0: 4150 2061 6e64 2074 6865 7365 2066 6561 AP and these fea │ │ │ │ +0014c7b0: 7475 7265 7320 6361 6e6e 6f74 2062 6520 tures cannot be │ │ │ │ +0014c7c0: 7573 6564 2069 6e20 616e 2069 6e74 6572 used in an inter │ │ │ │ +0014c7d0: 6661 6365 2068 6561 6465 7220 6669 6c65 face header file │ │ │ │ +0014c7e0: 2066 6f72 2073 6f61 7063 7070 322e 3c2f for soapcpp2..

      .
    • STL: │ │ │ │ +0014c800: 2074 6865 2073 6f61 7063 7070 3220 746f the soapcpp2 to │ │ │ │ +0014c810: 6f6c 2073 7570 706f 7274 7320 7468 6520 ol supports the │ │ │ │ +0014c820: 7365 7269 616c 697a 6174 696f 6e20 6f66 serialization of │ │ │ │ +0014c830: 2043 2b2b 2073 7472 696e 6773 203c 636f C++ strings std::string and │ │ │ │ +0014c860: 7374 643a 3a77 7374 7269 6e67 3c2f 636f std::wstring and the cont │ │ │ │ +0014c880: 6169 6e65 7273 203c 636f 6465 3e73 7464 ainers std │ │ │ │ +0014c890: 3a3a 6465 7175 653c 2f63 6f64 653e 2c20 ::deque, │ │ │ │ +0014c8a0: 3c63 6f64 653e 7374 643a 3a6c 6973 743c std::list< │ │ │ │ +0014c8b0: 2f63 6f64 653e 2c20 3c63 6f64 653e 7374 /code>, st │ │ │ │ +0014c8c0: 643a 3a76 6563 746f 723c 2f63 6f64 653e d::vector │ │ │ │ +0014c8d0: 2c20 616e 6420 3c63 6f64 653e 7374 643a , and std: │ │ │ │ +0014c8e0: 3a73 6574 3c2f 636f 6465 3e2c 2028 7365 :set, (se │ │ │ │ +0014c8f0: 6520 5365 6374 696f 6e20 3c61 2063 6c61 e Section STL containe │ │ │ │ +0014c930: 7273 3c2f 613e 2029 2e20 416c 736f 203c rs ). Also < │ │ │ │ +0014c940: 636f 6465 3e73 7464 3a3a 7368 6172 6564 code>std::shared │ │ │ │ +0014c950: 5f70 7472 3c2f 636f 6465 3e2c 203c 636f _ptr, std::unique_p │ │ │ │ +0014c970: 7472 3c2f 636f 6465 3e2c 2061 6e64 203c tr, and < │ │ │ │ +0014c980: 636f 6465 3e73 7464 3a3a 6175 746f 5f70 code>std::auto_p │ │ │ │ +0014c990: 7472 3c2f 636f 6465 3e20 6172 6520 7375 tr are su │ │ │ │ +0014c9a0: 7070 6f72 7465 642e 204f 7468 6572 2053 pported. Other S │ │ │ │ +0014c9b0: 544c 2074 7970 6573 2061 7265 206e 6f74 TL types are not │ │ │ │ +0014c9c0: 2073 6572 6961 6c69 7a61 626c 652e 3c2f serializable..
    • Template │ │ │ │ +0014c9e0: 733a 2074 6865 2073 6f61 7063 7070 3220 s: the soapcpp2 │ │ │ │ +0014c9f0: 746f 6f6c 2061 7373 756d 6573 2074 6861 tool assumes tha │ │ │ │ +0014ca00: 7420 7465 6d70 6c61 7465 7320 636c 6173 t templates clas │ │ │ │ +0014ca10: 7365 7320 6861 7665 206f 6e6c 7920 6f6e ses have only on │ │ │ │ +0014ca20: 6520 7465 6d70 6c61 7465 2070 6172 616d e template param │ │ │ │ +0014ca30: 6574 6572 2074 7970 6520 616e 6420 7468 eter type and th │ │ │ │ +0014ca40: 6573 6520 7465 6d70 6c61 7465 7320 6172 ese templates ar │ │ │ │ +0014ca50: 6520 636f 6e74 6169 6e65 7273 206f 6620 e containers of │ │ │ │ +0014ca60: 7661 6c75 6573 206f 6620 7468 6973 2074 values of this t │ │ │ │ +0014ca70: 656d 706c 6174 6520 7061 7261 6d65 7465 emplate paramete │ │ │ │ +0014ca80: 7220 7479 7065 2e20 5468 6973 2074 656d r type. This tem │ │ │ │ +0014ca90: 706c 6174 6520 636c 6173 7320 7368 6f75 plate class shou │ │ │ │ +0014caa0: 6c64 2064 6566 696e 6520 3c63 6f64 653e ld define │ │ │ │ +0014cab0: 6265 6769 6e28 293c 2f63 6f64 653e 2c20 begin(), │ │ │ │ +0014cac0: 3c63 6f64 653e 656e 6428 293c 2f63 6f64 end(), size() │ │ │ │ +0014cae0: 3c2f 636f 6465 3e2c 203c 636f 6465 3e63 , c │ │ │ │ +0014caf0: 6c65 6172 2829 3c2f 636f 6465 3e2c 2061 lear(), a │ │ │ │ +0014cb00: 6e64 203c 636f 6465 3e69 6e73 6572 7428 nd insert( │ │ │ │ +0014cb10: 293c 2f63 6f64 653e 206d 6574 686f 6473 ) methods │ │ │ │ +0014cb20: 2e3c 2f6c 693e 0a3c 6c69 3e49 6e68 6572 .
    • .
    • Inher │ │ │ │ +0014cb30: 6974 616e 6365 3a20 7369 6e67 6c65 2063 itance: single c │ │ │ │ +0014cb40: 6c61 7373 2069 6e68 6572 6974 616e 6365 lass inheritance │ │ │ │ +0014cb50: 2069 7320 7375 7070 6f72 7465 642e 3c2f is supported..
    • Abstract │ │ │ │ +0014cb70: 206d 6574 686f 6473 3a20 6120 636c 6173 methods: a clas │ │ │ │ +0014cb80: 7320 6d75 7374 2062 6520 696e 7374 616e s must be instan │ │ │ │ +0014cb90: 7469 6162 6c65 2074 6f20 7375 7070 6f72 tiable to suppor │ │ │ │ +0014cba0: 7420 7365 7269 616c 697a 6174 696f 6e20 t serialization │ │ │ │ +0014cbb0: 6f66 2074 6861 7420 636c 6173 732e 2041 of that class. A │ │ │ │ +0014cbc0: 6e20 6162 7374 7261 6374 2063 6c61 7373 n abstract class │ │ │ │ +0014cbd0: 2077 6865 6e20 7573 6564 2073 686f 756c when used shoul │ │ │ │ +0014cbe0: 6420 6265 2064 6563 6c61 7265 6420 7472 d be declared tr │ │ │ │ +0014cbf0: 616e 7369 656e 742c 2073 6565 2053 6563 ansient, see Sec │ │ │ │ +0014cc00: 7469 6f6e 203c 6120 636c 6173 733d 2265 tion T │ │ │ │ +0014cc30: 7261 6e73 6965 6e74 2064 6174 6120 7479 ransient data ty │ │ │ │ +0014cc40: 7065 733c 2f61 3e2e 3c2f 6c69 3e0a 3c6c pes.
    • .Directives: di │ │ │ │ +0014cc60: 7265 6374 6976 6573 2061 6e64 2070 7261 rectives and pra │ │ │ │ +0014cc70: 676d 6173 2073 7563 6820 6173 203c 636f gmas such as #include and #de │ │ │ │ +0014cca0: 6669 6e65 3c2f 636f 6465 3e20 6172 6520 fine are │ │ │ │ +0014ccb0: 6d6f 7665 6420 746f 2074 6865 2067 656e moved to the gen │ │ │ │ +0014ccc0: 6572 6174 6564 203c 656d 3e3c 636f 6465 erated soapStub.h source c │ │ │ │ +0014ccf0: 6f64 6520 6279 2073 6f61 7063 7070 322e ode by soapcpp2. │ │ │ │ +0014cd00: 2054 6865 7365 2064 6972 6563 7469 7665 These directive │ │ │ │ +0014cd10: 7320 6172 6520 616c 6c20 706c 6163 6564 s are all placed │ │ │ │ +0014cd20: 2061 7420 7468 6520 746f 7020 6f66 2074 at the top of t │ │ │ │ +0014cd30: 6861 7420 6669 6c65 2c20 7365 6520 3c61 hat file, see The #inclu │ │ │ │ +0014cd70: 6465 2061 6e64 2023 6465 6669 6e65 2064 de and #define d │ │ │ │ +0014cd80: 6972 6563 7469 7665 733c 2f61 3e2e 2055 irectives. U │ │ │ │ +0014cd90: 7365 2074 6865 203c 636f 6465 3e23 696d se the #im │ │ │ │ +0014cda0: 706f 7274 3c2f 636f 6465 3e20 6469 7265 port dire │ │ │ │ +0014cdb0: 6374 6976 6520 746f 2069 6d70 6f72 7420 ctive to import │ │ │ │ +0014cdc0: 696e 7465 7266 6163 6520 6865 6164 6572 interface header │ │ │ │ +0014cdd0: 2066 696c 6573 2069 6e74 6f20 6f74 6865 files into othe │ │ │ │ +0014cde0: 7220 696e 7465 7266 6163 6520 6865 6164 r interface head │ │ │ │ +0014cdf0: 6572 2066 696c 6573 2c20 7365 6520 5365 er files, see Se │ │ │ │ +0014ce00: 6374 696f 6e20 3c61 2063 6c61 7373 3d22 ction The │ │ │ │ +0014ce30: 2023 696d 706f 7274 2064 6972 6563 7469 #import directi │ │ │ │ +0014ce40: 7665 3c2f 613e 202e 3c2f 6c69 3e0a 3c6c ve ..C and C++ code │ │ │ │ +0014ce60: 2073 7461 7465 6d65 6e74 733a 206e 6f20 statements: no │ │ │ │ +0014ce70: 636f 6465 2073 7461 7465 6d65 6e74 7320 code statements │ │ │ │ +0014ce80: 6172 6520 616c 6c6f 7773 2069 6e20 696e are allows in in │ │ │ │ +0014ce90: 7465 7266 6163 6520 6865 6164 6572 2066 terface header f │ │ │ │ +0014cea0: 696c 6573 2e20 436c 6173 7320 6d65 7468 iles. Class meth │ │ │ │ +0014ceb0: 6f64 7320 7368 6f75 6c64 2062 6520 6465 ods should be de │ │ │ │ +0014cec0: 636c 6172 6564 2077 6974 686f 7574 2063 clared without c │ │ │ │ +0014ced0: 6f64 6520 696e 203c 636f 6465 3e7b 3c2f ode in { and │ │ │ │ +0014cef0: 7d3c 2f63 6f64 653e 2e20 416c 736f 2063 }. Also c │ │ │ │ +0014cf00: 6f6e 7374 7275 6374 6f72 2069 6e69 7469 onstructor initi │ │ │ │ +0014cf10: 616c 697a 6572 7320 6172 6520 6e6f 7420 alizers are not │ │ │ │ +0014cf20: 616c 6c6f 7765 642e 2043 6c61 7373 206d allowed. Class m │ │ │ │ +0014cf30: 6574 686f 6420 696d 706c 656d 656e 7461 ethod implementa │ │ │ │ +0014cf40: 7469 6f6e 7320 7368 6f75 6c64 2062 6520 tions should be │ │ │ │ +0014cf50: 6465 6669 6e65 6420 696e 2061 2073 6570 defined in a sep │ │ │ │ +0014cf60: 6172 6174 6520 432b 2b20 736f 7572 6365 arate C++ source │ │ │ │ +0014cf70: 2066 696c 652e 3c2f 6c69 3e0a 3c6c 693e file..
    • │ │ │ │ +0014cf80: 432b 2b20 7265 6665 7265 6e63 6573 3a20 C++ references: │ │ │ │ +0014cf90: 7468 6573 6520 6361 6e6e 6f74 2062 6520 these cannot be │ │ │ │ +0014cfa0: 7365 7269 616c 697a 6564 2c20 7573 6520 serialized, use │ │ │ │ +0014cfb0: 706f 696e 7465 7273 2069 6e73 7465 6164 pointers instead │ │ │ │ +0014cfc0: 2e3c 2f6c 693e 0a3c 2f75 6c3e 0a3c 703e .
    • .
    .

    │ │ │ │ +0014cfd0: 5468 6520 666f 6c6c 6f77 696e 6720 432f The following C/ │ │ │ │ +0014cfe0: 432b 2b20 6461 7461 2074 7970 6573 2072 C++ data types r │ │ │ │ +0014cff0: 6571 7569 7265 2073 6f6d 6520 6174 7465 equire some atte │ │ │ │ +0014d000: 6e74 696f 6e20 746f 2065 6e73 7572 6520 ntion to ensure │ │ │ │ +0014d010: 7468 6579 2063 616e 2062 6520 7365 7269 they can be seri │ │ │ │ +0014d020: 616c 697a 6564 3a3c 2f70 3e0a 3c75 6c3e alized:

    .
    .

    .... Back t │ │ │ │ +0014d6d0: 6f20 7461 626c 6520 6f66 2063 6f6e 7465 o table of conte │ │ │ │ +0014d6e0: 6e74 733c 2f61 3e3c 2f70 3e0a 3c68 313e nts

    .

    │ │ │ │ +0014d6f0: 3c61 2063 6c61 7373 3d22 616e 6368 6f72 │ │ │ │ +0014d710: 3c2f 613e 0a41 6476 616e 6365 6420 6665 .Advanced fe │ │ │ │ +0014d720: 6174 7572 6573 3c2f 6831 3e0a 3c70 3ef0 atures

    .

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

    .

    .Internati │ │ │ │ +0014d7a0: 6f6e 616c 697a 6174 696f 6e3c 2f68 323e onalization

    │ │ │ │ +0014d7b0: 0a3c 703e 5265 6775 6c61 7220 382d 6269 .

    Regular 8-bi │ │ │ │ +0014d7c0: 7420 7374 7269 6e67 7320 6361 6e6e 6f74 t strings cannot │ │ │ │ +0014d7d0: 2068 6f6c 6420 7769 6465 2063 6861 7261 hold wide chara │ │ │ │ +0014d7e0: 6374 6572 7320 6f75 7473 6964 6520 6f66 cters outside of │ │ │ │ +0014d7f0: 2074 6865 2063 6861 7261 6374 6572 2072 the character r │ │ │ │ +0014d800: 616e 6765 205b 312c 3235 355d 2e20 4f66 ange [1,255]. Of │ │ │ │ +0014d810: 2063 6f75 7273 6520 796f 7520 6361 6e20 course you can │ │ │ │ +0014d820: 7573 6520 7769 6465 2073 7472 696e 6773 use wide strings │ │ │ │ +0014d830: 2069 6e73 7465 6164 206f 6620 382d 6269 instead of 8-bi │ │ │ │ +0014d840: 7420 7374 7269 6e67 7320 696e 2074 6865 t strings in the │ │ │ │ +0014d850: 2069 6e74 6572 6661 6365 2068 6561 6465 interface heade │ │ │ │ +0014d860: 7220 6669 6c65 2066 6f72 2073 6f61 7063 r file for soapc │ │ │ │ +0014d870: 7070 322e 2041 6c74 6572 6e61 7469 7665 pp2. Alternative │ │ │ │ +0014d880: 6c79 2c20 7365 7420 7468 6520 3c63 6f64 ly, set the #SOAP_C_UTFSTR │ │ │ │ +0014d8a0: 494e 473c 2f63 6f64 653e 206d 6f64 6520 ING mode │ │ │ │ +0014d8b0: 666c 6167 2074 6f20 656e 636f 6465 2077 flag to encode w │ │ │ │ +0014d8c0: 6964 6520 6368 6172 6163 7465 7273 2069 ide characters i │ │ │ │ +0014d8d0: 6e20 382d 6269 7420 7374 7269 6e67 7320 n 8-bit strings │ │ │ │ +0014d8e0: 696e 2055 5446 2d38 2066 6f72 6d61 742e in UTF-8 format. │ │ │ │ +0014d8f0: 3c2f 703e 0a3c 703e 466f 7220 6578 616d

    .

    For exam │ │ │ │ +0014d900: 706c 652c 2074 6865 203c 656d 3e3c 636f ple, the xsd:string string │ │ │ │ +0014d930: 2073 6368 656d 6120 7479 7065 2063 616e schema type can │ │ │ │ +0014d940: 2062 6520 6465 636c 6172 6564 2061 7320 be declared as │ │ │ │ +0014d950: 6120 7769 6465 2d63 6861 7261 6374 6572 a wide-character │ │ │ │ +0014d960: 2073 7472 696e 6720 616e 6420 7573 6564 string and used │ │ │ │ +0014d970: 2073 7562 7365 7175 656e 746c 793a 3c2f subsequently:.

    typedef │ │ │ │ +0014d9d0: 3c73 7061 6e20 636c 6173 733d 226b 6579 wchar_ │ │ │ │ +0014d9f0: 743c 2f73 7061 6e3e 202a 7873 645f 5f73 t *xsd__s │ │ │ │ +0014da00: 7472 696e 673b 203c 2f64 6976 3e0a 3c64 tring;
    . │ │ │ │ +0014da20: 3c73 7061 6e20 636c 6173 733d 226b 6579 int
    ns__myMetho │ │ │ │ +0014da50: 6428 7873 645f 5f73 7472 696e 6720 696e d(xsd__string in │ │ │ │ +0014da60: 7075 742c 2078 7364 5f5f 7374 7269 6e67 put, xsd__string │ │ │ │ +0014da70: 202a 6f75 7470 7574 293b 3c2f 6469 763e *output);
    │ │ │ │ +0014da80: 0a3c 2f64 6976 3e3c 212d 2d20 6672 6167 .

    To do │ │ │ │ +0014daa0: 2073 6f20 6175 746f 6d61 7469 6361 6c6c so automaticall │ │ │ │ +0014dab0: 7920 7769 7468 2077 7364 6c32 682c 2065 y with wsdl2h, e │ │ │ │ +0014dac0: 6469 7420 3c65 6d3e 3c63 6f64 653e 7479 dit ty │ │ │ │ +0014dad0: 7065 6d61 702e 6461 743c 2f63 6f64 653e pemap.dat │ │ │ │ +0014dae0: 3c2f 656d 3e20 616e 6420 6164 6420 7468 and add th │ │ │ │ +0014daf0: 6520 6c69 6e65 3a20 3c2f 703e 3c70 7265 e line:

    xsd__string = 
    │ │ │ │ +0014db20: 7c20 7763 6861 725f 742a 207c 2077 6368  | wchar_t* | wch
    │ │ │ │ +0014db30: 6172 5f74 2a0a 3c2f 7072 653e 3c70 3e20  ar_t*.

    │ │ │ │ +0014db40: 6f72 2066 6f72 2043 2b2b 3a20 3c2f 703e or for C++:

    │ │ │ │ +0014db50: 3c70 7265 2063 6c61 7373 3d22 6672 6167
    xsd__strin
    │ │ │ │ +0014db70: 6720 3d20 7c20 7374 643a 3a77 7374 7269  g = | std::wstri
    │ │ │ │ +0014db80: 6e67 207c 2073 7464 3a3a 7773 7472 696e  ng | std::wstrin
    │ │ │ │ +0014db90: 672a 0a3c 2f70 7265 3e3c 703e 2041 6c74  g*.

    Alt │ │ │ │ +0014dba0: 6572 6e61 7469 7665 6c79 2c20 382d 6269 ernatively, 8-bi │ │ │ │ +0014dbb0: 7420 7374 7269 6e67 7320 6361 6e20 686f t strings can ho │ │ │ │ +0014dbc0: 6c64 2055 5446 2d38 2066 6f72 6d61 7474 ld UTF-8 formatt │ │ │ │ +0014dbd0: 6564 2077 6964 6520 6368 6172 6163 7465 ed wide characte │ │ │ │ +0014dbe0: 7273 2077 6865 6e20 7468 6520 3c63 6f64 rs when the #SOAP_C_UTFSTR │ │ │ │ +0014dc00: 494e 473c 2f63 6f64 653e 2066 6c61 6720 ING flag │ │ │ │ +0014dc10: 6973 2065 6e61 626c 6564 2c20 7365 6520 is enabled, see │ │ │ │ +0014dc20: 5365 6374 696f 6e20 3c61 2063 6c61 7373 Section Ru │ │ │ │ +0014dc50: 6e2d 7469 6d65 2066 6c61 6773 3c2f 613e n-time flags │ │ │ │ +0014dc60: 202e 2054 6865 2061 7070 6c69 6361 7469 . The applicati │ │ │ │ +0014dc70: 6f6e 2069 7320 7265 7370 6f6e 7369 626c on is responsibl │ │ │ │ +0014dc80: 6520 666f 7220 6669 6c6c 696e 6720 7265 e for filling re │ │ │ │ +0014dc90: 6775 6c61 7220 7374 7269 6e67 7320 7769 gular strings wi │ │ │ │ +0014dca0: 7468 2055 5446 2d38 2063 6f6e 7465 6e74 th UTF-8 content │ │ │ │ +0014dcb0: 2e3c 2f70 3e0a 3c70 3e41 6c73 6f20 7468 .

    .

    Also th │ │ │ │ +0014dcc0: 6520 3c63 6f64 653e 2353 4f41 505f 435f e #SOAP_C_ │ │ │ │ +0014dcd0: 4d42 5354 5249 4e47 3c2f 636f 6465 3e20 MBSTRING │ │ │ │ +0014dce0: 666c 6167 2063 616e 2062 6520 7573 6564 flag can be used │ │ │ │ +0014dcf0: 2074 6f20 6163 7469 7661 7465 206d 756c to activate mul │ │ │ │ +0014dd00: 7469 6279 7465 2063 6861 7261 6374 6572 tibyte character │ │ │ │ +0014dd10: 2073 7570 706f 7274 2075 7369 6e67 2074 support using t │ │ │ │ +0014dd20: 6865 2063 7572 7265 6e74 206c 6f63 616c he current local │ │ │ │ +0014dd30: 652e 204d 756c 7469 6279 7465 2073 7570 e. Multibyte sup │ │ │ │ +0014dd40: 706f 7274 2064 6570 656e 6473 206f 6e20 port depends on │ │ │ │ +0014dd50: 7468 6520 6c6f 6361 6c65 2073 6574 7469 the locale setti │ │ │ │ +0014dd60: 6e67 7320 666f 7220 6465 616c 696e 6720 ngs for dealing │ │ │ │ +0014dd70: 7769 7468 2065 7874 656e 6465 6420 6e61 with extended na │ │ │ │ +0014dd80: 7475 7261 6c20 6c61 6e67 7561 6765 2065 tural language e │ │ │ │ +0014dd90: 6e63 6f64 696e 6773 2e3c 2f70 3e0a 3c70 ncodings.

    .

    Both 8-bit stri │ │ │ │ +0014ddb0: 6e67 7320 616e 6420 7769 6465 2d63 6861 ngs and wide-cha │ │ │ │ +0014ddc0: 7261 6374 6572 2073 7472 696e 6773 2063 racter strings c │ │ │ │ +0014ddd0: 616e 2062 6520 7573 6564 2074 6f67 6574 an be used toget │ │ │ │ +0014dde0: 6865 7220 7769 7468 696e 2061 6e20 6170 her within an ap │ │ │ │ +0014ddf0: 706c 6963 6174 696f 6e2e 2046 6f72 2065 plication. For e │ │ │ │ +0014de00: 7861 6d70 6c65 2c20 7468 6520 666f 6c6c xample, the foll │ │ │ │ +0014de10: 6f77 696e 6720 6865 6164 6572 2066 696c owing header fil │ │ │ │ +0014de20: 6520 6465 636c 6172 6174 696f 6e20 696e e declaration in │ │ │ │ +0014de30: 7472 6f64 7563 6573 2074 776f 2073 7472 troduces two str │ │ │ │ +0014de40: 696e 6720 7363 6865 6d61 2074 7970 6573 ing schema types │ │ │ │ +0014de50: 3a3c 2f70 3e0a 3c64 6976 2063 6c61 7373 :

    .
    typedef wch │ │ │ │ +0014dec0: 6172 5f74 3c2f 7370 616e 3e20 2a78 7364 ar_t *xsd │ │ │ │ +0014ded0: 5f5f 7374 7269 6e67 3b20 3c2f 6469 763e __string;
    │ │ │ │ +0014dee0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    typedef │ │ │ │ +0014df10: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c char *x │ │ │ │ +0014df40: 7364 5f5f 7374 7269 6e67 5f3b 203c 7370 sd__string_; // trailing & │ │ │ │ +0014df70: 2333 393b 5f26 2333 393b 2061 766f 6964 #39;_' avoid │ │ │ │ +0014df80: 7320 6e61 6d65 2063 6c61 7368 203c 2f73 s name clash
    .
    int ns__myMethod(x │ │ │ │ +0014dfe0: 7364 5f5f 7374 7269 6e67 2069 6e70 7574 sd__string input │ │ │ │ +0014dff0: 2c20 7873 645f 5f73 7472 696e 675f 202a , xsd__string_ * │ │ │ │ +0014e000: 6f75 7470 7574 293b 3c2f 6469 763e 0a3c output);
    .< │ │ │ │ +0014e010: 2f64 6976 3e3c 212d 2d20 6672 6167 6d65 /div>

    Please │ │ │ │ +0014e030: 636f 6e73 756c 7420 7468 6520 5554 462d consult the UTF- │ │ │ │ +0014e040: 3820 7370 6563 6966 6963 6174 696f 6e20 8 specification │ │ │ │ +0014e050: 666f 7220 6465 7461 696c 7320 6f6e 2074 for details on t │ │ │ │ +0014e060: 6865 2055 5446 2d38 2066 6f72 6d61 7420 he UTF-8 format │ │ │ │ +0014e070: 7768 656e 2070 726f 6365 7373 696e 6720 when processing │ │ │ │ +0014e080: 382d 6269 7420 7374 7269 6e67 7320 7769 8-bit strings wi │ │ │ │ +0014e090: 7468 2055 5446 2d38 2063 6f6e 7465 6e74 th UTF-8 content │ │ │ │ +0014e0a0: 2e20 4e6f 7465 2074 6861 7420 7468 6520 . Note that the │ │ │ │ +0014e0b0: 4153 4349 4920 6368 6172 6163 7465 7220 ASCII character │ │ │ │ +0014e0c0: 7365 7420 5b31 2d31 3237 5d20 6973 2061 set [1-127] is a │ │ │ │ +0014e0d0: 2073 7562 7365 7420 6f66 2055 5446 2d38 subset of UTF-8 │ │ │ │ +0014e0e0: 2e20 5468 6572 6566 6f72 652c 2077 6974 . Therefore, wit │ │ │ │ +0014e0f0: 6820 7468 6520 3c63 6f64 653e 2353 4f41 h the #SOA │ │ │ │ +0014e100: 505f 435f 5554 4653 5452 494e 473c 2f63 P_C_UTFSTRING flag set, s │ │ │ │ +0014e120: 7472 696e 6773 206d 6179 2068 6f6c 6420 trings may hold │ │ │ │ +0014e130: 4153 4349 4920 6368 6172 6163 7465 7220 ASCII character │ │ │ │ +0014e140: 6461 7461 2061 6e64 2055 5446 2d38 2065 data and UTF-8 e │ │ │ │ +0014e150: 7874 656e 7369 6f6e 732e 3c2f 703e 0a3c xtensions.

    .< │ │ │ │ +0014e160: 703e 5365 6520 616c 736f 203c 6120 6872 p>See also C and C++ │ │ │ │ +0014e1a0: 2058 4d4c 2064 6174 6120 6269 6e64 696e XML data bindin │ │ │ │ +0014e1b0: 6773 3c2f 613e 2064 6f63 756d 656e 7461 gs documenta │ │ │ │ +0014e1c0: 7469 6f6e 2066 6f72 206d 6f72 6520 6465 tion for more de │ │ │ │ +0014e1d0: 7461 696c 7320 6f6e 2075 7369 6e67 203c tails on using < │ │ │ │ +0014e1e0: 656d 3e3c 636f 6465 3e74 7970 656d 6170 em>typemap │ │ │ │ +0014e1f0: 2e64 6174 3c2f 636f 6465 3e3c 2f65 6d3e .dat
    │ │ │ │ +0014e200: 2066 6f72 2077 7364 6c32 682e 3c2f 703e for wsdl2h.

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

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

    .

    .Directives

    .

    An interfac │ │ │ │ +0014e290: 6520 6865 6164 6572 2066 696c 6520 666f e header file fo │ │ │ │ +0014e2a0: 7220 736f 6170 6370 7032 206d 6179 2069 r soapcpp2 may i │ │ │ │ +0014e2b0: 6e63 6c75 6465 203c 636f 6465 3e2f 2f67 nclude //g │ │ │ │ +0014e2c0: 736f 6170 3c2f 636f 6465 3e20 6469 7265 soap dire │ │ │ │ +0014e2d0: 6374 6976 6573 2074 6f20 636f 6e66 6967 ctives to config │ │ │ │ +0014e2e0: 7572 6520 6d65 7373 6167 696e 6720 7072 ure messaging pr │ │ │ │ +0014e2f0: 6f74 6f63 6f6c 7320 7375 6368 2061 7320 otocols such as │ │ │ │ +0014e300: 534f 4150 206f 7220 5245 5354 2c20 746f SOAP or REST, to │ │ │ │ +0014e310: 2061 7373 6f63 6961 7465 2053 4f41 5020 associate SOAP │ │ │ │ +0014e320: 4865 6164 6572 7320 616e 6420 4661 756c Headers and Faul │ │ │ │ +0014e330: 7473 2077 6974 6820 6d65 7373 6167 6573 ts with messages │ │ │ │ +0014e340: 2c20 616e 6420 746f 2073 6574 2070 726f , and to set pro │ │ │ │ +0014e350: 7065 7274 6965 7320 6f66 2074 6865 2057 perties of the W │ │ │ │ +0014e360: 6562 2073 6572 7669 6365 2064 6566 696e eb service defin │ │ │ │ +0014e370: 6564 2069 6e20 7468 6520 736f 6170 6370 ed in the soapcp │ │ │ │ +0014e380: 7032 2d67 656e 6572 6174 6564 2057 5344 p2-generated WSD │ │ │ │ +0014e390: 4c20 616e 6420 5853 4420 6669 6c65 732e L and XSD files. │ │ │ │ +0014e3a0: 2044 6972 6563 7469 7665 7320 666f 7220 Directives for │ │ │ │ +0014e3b0: 736f 6170 6370 7032 2061 7265 2073 7065 soapcpp2 are spe │ │ │ │ +0014e3c0: 6369 6669 6564 2061 7320 3c63 6f64 653e cified as │ │ │ │ +0014e3d0: 2f2f 6773 6f61 703c 2f63 6f64 653e 2d63 //gsoap-c │ │ │ │ +0014e3e0: 6f6d 6d65 6e74 7320 7468 6174 2061 7265 omments that are │ │ │ │ +0014e3f0: 2070 726f 6365 7373 6564 2062 7920 736f processed by so │ │ │ │ +0014e400: 6170 6370 7032 2e3c 2f70 3e0a 3c68 333e apcpp2.

    .

    │ │ │ │ +0014e410: 3c61 2063 6c61 7373 3d22 616e 6368 6f72 .Service │ │ │ │ +0014e440: 2064 6972 6563 7469 7665 733c 2f68 333e directives

    │ │ │ │ +0014e450: 0a3c 703e 4120 7365 7276 6963 6520 6469 .

    A service di │ │ │ │ +0014e460: 7265 6374 6976 6520 6d75 7374 2073 7461 rective must sta │ │ │ │ +0014e470: 7274 2061 7420 6120 6e65 7720 6c69 6e65 rt at a new line │ │ │ │ +0014e480: 2061 6e64 2069 7320 6f66 2074 6865 2066 and is of the f │ │ │ │ +0014e490: 6f72 6d3a 3c2f 703e 0a3c 6469 7620 636c orm:

    .
    < │ │ │ │ +0014e4b0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +0014e4c0: 3e3c 7370 616e 2063 6c61 7373 3d22 636f >//gsoap & │ │ │ │ +0014e4e0: 6c74 3b70 7265 6669 7826 6774 3b20 7365 lt;prefix> se │ │ │ │ +0014e4f0: 7276 6963 6520 266c 743b 7072 6f70 6572 rvice <proper │ │ │ │ +0014e500: 7479 2667 743b 3a20 266c 743b 7661 6c75 ty>: <valu │ │ │ │ +0014e510: 6526 6774 3b3c 2f73 7061 6e3e 3c2f 6469 e>.

    whe │ │ │ │ +0014e540: 7265 203c 636f 6465 3e26 6c74 3b70 7265 re <pre │ │ │ │ +0014e550: 6669 7826 6774 3b3c 2f63 6f64 653e 2069 fix> i │ │ │ │ +0014e560: 7320 7468 6520 584d 4c20 6e61 6d65 7370 s the XML namesp │ │ │ │ +0014e570: 6163 6520 7072 6566 6978 206f 6620 6120 ace prefix of a │ │ │ │ +0014e580: 7365 7276 6963 6520 6269 6e64 696e 672e service binding. │ │ │ │ +0014e590: 2054 6865 203c 636f 6465 3e26 6c74 3b70 The <p │ │ │ │ +0014e5a0: 726f 7065 7274 7926 6774 3b3c 2f63 6f64 roperty> and < │ │ │ │ +0014e5c0: 3b76 616c 7565 2667 743b 3c2f 636f 6465 ;value> fields are one │ │ │ │ +0014e5e0: 206f 6620 7468 6520 666f 6c6c 6f77 696e of the followin │ │ │ │ +0014e5f0: 673a 3c2f 703e 0a3c 7461 626c 6520 636c g:

    ...... │ │ │ │ +0014e770: 3c74 7220 636c 6173 733d 226d 6172 6b64 ... │ │ │ │ +0014e910: 0a3c 7472 2063 6c61 7373 3d22 6d61 726b ....< │ │ │ │ +0014ea30: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ │ +0014ea40: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ │ +0014ea50: 3e3c 636f 6465 3e64 6f63 756d 656e 743c >document< │ │ │ │ +0014ea60: 2f63 6f64 653e 2028 6465 6661 756c 7429 /code> (default) │ │ │ │ +0014ea70: 2053 4f41 5020 6d65 7373 6167 696e 6720 SOAP messaging │ │ │ │ +0014ea80: 7374 796c 6520 6f72 203c 636f 6465 3e72 style or r │ │ │ │ +0014ea90: 7063 3c2f 636f 6465 3e20 666f 7220 534f pc for SO │ │ │ │ +0014eaa0: 4150 2052 5043 2020 2020 3c2f 7464 3e3c AP RPC < │ │ │ │ +0014eab0: 2f74 723e 0a3c 7472 2063 6c61 7373 3d22 /tr>....< │ │ │ │ +0014ebc0: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ │ +0014ebd0: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ │ +0014ebe0: 3e3c 636f 6465 3e70 726f 746f 636f 6c3c >protocol< │ │ │ │ +0014ebf0: 2f63 6f64 653e 2020 203c 2f74 643e 3c74 /code> │ │ │ │ +0014ec20: 7370 6563 6966 6965 7320 534f 4150 206f specifies SOAP o │ │ │ │ +0014ec30: 7220 5245 5354 2c20 7365 6520 6265 6c6f r REST, see belo │ │ │ │ +0014ec40: 7720 2020 203c 2f74 643e 3c2f 7472 3e0a w . │ │ │ │ +0014ec50: 3c74 7220 636c 6173 733d 226d 6172 6b64 ... │ │ │ │ +0014ee10: 3c2f 7472 3e0a 3c74 7220 636c 6173 733d .......... │ │ │ │ +0014f1c0: 3c63 6f64 653e 706f 7274 5479 7065 3c2f portType < │ │ │ │ +0014f270: 2f74 723e 0a3c 7472 2063 6c61 7373 3d22 /tr>...< │ │ │ │ +0014f370: 7472 2063 6c61 7373 3d22 6d61 726b 646f tr class="markdo │ │ │ │ +0014f380: 776e 5461 626c 6552 6f77 4576 656e 223e wnTableRowEven"> │ │ │ │ +0014f390: 0a3c 7464 2063 6c61 7373 3d22 6d61 726b .< │ │ │ │ +0014f3d0: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ │ +0014f3e0: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ │ +0014f3f0: 3e6e 616d 6520 6f66 2074 6865 2057 5344 >name of the WSD │ │ │ │ +0014f400: 4c20 6465 6669 6e69 7469 6f6e 732f 6269 L definitions/bi │ │ │ │ +0014f410: 6e64 696e 672f 406e 616d 6520 2020 203c nding/@name < │ │ │ │ +0014f420: 2f74 643e 3c2f 7472 3e0a 3c74 7220 636c /td>.....
    property │ │ │ │ +0014e660: 203c 2f74 683e 3c74 6820 636c 6173 733d value │ │ │ │ +0014e690: 203c 2f74 683e 3c2f 7472 3e0a 3c74 7220
    < │ │ │ │ +0014e6e0: 636f 6465 3e6e 616d 653c 2f63 6f64 653e code>name │ │ │ │ +0014e6f0: 2020 203c 2f74 643e 3c74 6420 636c 6173 name o │ │ │ │ +0014e720: 6620 7468 6520 7365 7276 6963 652c 206f f the service, o │ │ │ │ +0014e730: 7074 696f 6e61 6c6c 7920 666f 6c6c 6f77 ptionally follow │ │ │ │ +0014e740: 6564 2062 7920 7465 7874 2064 6573 6372 ed by text descr │ │ │ │ +0014e750: 6962 696e 6720 7468 6520 7365 7276 6963 ibing the servic │ │ │ │ +0014e760: 6520 2020 203c 2f74 643e 3c2f 7472 3e0a e
    namesp │ │ │ │ +0014e7c0: 6163 653c 2f63 6f64 653e 2020 203c 2f74 ace URI of the W │ │ │ │ +0014e800: 5344 4c20 7461 7267 6574 4e61 6d65 7370 SDL targetNamesp │ │ │ │ +0014e810: 6163 6520 2020 203c 2f74 643e 3c2f 7472 ace
    docum │ │ │ │ +0014e870: 656e 7461 7469 6f6e 3c2f 636f 6465 3e20 entation │ │ │ │ +0014e880: 2020 3c2f 7464 3e3c 7464 2063 6c61 7373 text de │ │ │ │ +0014e8b0: 7363 7269 6269 6e67 2074 6865 2073 6572 scribing the ser │ │ │ │ +0014e8c0: 7669 6365 2028 7365 6520 616c 736f 2074 vice (see also t │ │ │ │ +0014e8d0: 6865 203c 636f 6465 3e6e 616d 653c 2f63 he name property), │ │ │ │ +0014e8f0: 6d75 6c74 6970 6c65 2070 6572 6d69 7474 multiple permitt │ │ │ │ +0014e900: 6564 2020 2020 3c2f 7464 3e3c 2f74 723e ed
    doc a │ │ │ │ +0014e990: 6e20 616c 6961 7320 666f 7220 7468 6520 n alias for the │ │ │ │ +0014e9a0: 3c63 6f64 653e 646f 6375 6d65 6e74 6174 documentat │ │ │ │ +0014e9b0: 696f 6e3c 2f63 6f64 653e 2070 726f 7065 ion prope │ │ │ │ +0014e9c0: 7274 7920 2020 203c 2f74 643e 3c2f 7472 rty
    style │ │ │ │ +0014ea20: 3c2f 636f 6465 3e20 2020 3c2f 7464 3e3c
    e │ │ │ │ +0014eb00: 6e63 6f64 696e 673c 2f63 6f64 653e 2020 ncoding │ │ │ │ +0014eb10: 203c 2f74 643e 3c74 6420 636c 6173 733d li │ │ │ │ +0014eb40: 7465 7261 6c3c 2f63 6f64 653e 2028 6465 teral (de │ │ │ │ +0014eb50: 6661 756c 7429 2c20 3c63 6f64 653e 656e fault), en │ │ │ │ +0014eb60: 636f 6465 643c 2f63 6f64 653e 2066 6f72 coded for │ │ │ │ +0014eb70: 2053 4f41 5020 656e 636f 6469 6e67 2c20 SOAP encoding, │ │ │ │ +0014eb80: 6f72 2061 2063 7573 746f 6d20 5552 4920 or a custom URI │ │ │ │ +0014eb90: 2020 203c 2f74 643e 3c2f 7472 3e0a 3c74
    port U │ │ │ │ +0014ecd0: 524c 206f 6620 7468 6520 7365 7276 6963 RL of the servic │ │ │ │ +0014ece0: 6520 656e 6470 6f69 6e74 2c20 7573 7561 e endpoint, usua │ │ │ │ +0014ecf0: 6c6c 7920 616e 2068 7474 7020 6f72 2068 lly an http or h │ │ │ │ +0014ed00: 7474 7073 2061 6464 7265 7373 2c20 746f ttps address, to │ │ │ │ +0014ed10: 2075 7365 2069 6e20 7468 6520 5753 444c use in the WSDL │ │ │ │ +0014ed20: 2064 6566 696e 6974 696f 6e73 2f73 6572 definitions/ser │ │ │ │ +0014ed30: 7669 6365 2f70 6f72 742f 6164 6472 6573 vice/port/addres │ │ │ │ +0014ed40: 732f 406c 6f63 6174 696f 6e20 2020 203c s/@location < │ │ │ │ +0014ed50: 2f74 643e 3c2f 7472 3e0a 3c74 7220 636c /td>
    location an a │ │ │ │ +0014ede0: 6c69 6173 2066 6f72 2074 6865 203c 636f lias for the port p │ │ │ │ +0014ee00: 726f 7065 7274 7920 2020 203c 2f74 643e roperty
    │ │ │ │ +0014ee60: 656e 6470 6f69 6e74 3c2f 636f 6465 3e20 endpoint │ │ │ │ +0014ee70: 2020 3c2f 7464 3e3c 7464 2063 6c61 7373 an alia │ │ │ │ +0014eea0: 7320 666f 7220 7468 6520 3c63 6f64 653e s for the │ │ │ │ +0014eeb0: 706f 7274 3c2f 636f 6465 3e20 7072 6f70 port prop │ │ │ │ +0014eec0: 6572 7479 2020 2020 3c2f 7464 3e3c 2f74 erty
    tran │ │ │ │ +0014ef20: 7370 6f72 743c 2f63 6f64 653e 2020 203c sport < │ │ │ │ +0014ef30: 2f74 643e 3c74 6420 636c 6173 733d 226d /td>URI declar │ │ │ │ +0014ef60: 6174 696f 6e20 6f66 2074 6865 2074 7261 ation of the tra │ │ │ │ +0014ef70: 6e73 706f 7274 2c20 7573 7561 6c6c 7920 nsport, usually │ │ │ │ +0014ef80: 3c63 6f64 653e 3c61 2068 7265 663d 2268 http://sche │ │ │ │ +0014efc0: 6d61 732e 786d 6c73 6f61 702e 6f72 672f mas.xmlsoap.org/ │ │ │ │ +0014efd0: 736f 6170 2f68 7474 703c 2f61 3e3c 2f63 soap/http
    def │ │ │ │ +0014f040: 696e 6974 696f 6e73 3c2f 636f 6465 3e20 initions │ │ │ │ +0014f050: 2020 3c2f 7464 3e3c 7464 2063 6c61 7373 name of │ │ │ │ +0014f080: 2074 6865 2057 5344 4c20 6465 6669 6e69 the WSDL defini │ │ │ │ +0014f090: 7469 6f6e 732f 406e 616d 6520 2020 203c tions/@name < │ │ │ │ +0014f0a0: 2f74 643e 3c2f 7472 3e0a 3c74 7220 636c /td>
    type │ │ │ │ +0014f100: 203c 2f74 643e 3c74 6420 636c 6173 733d name of │ │ │ │ +0014f130: 7468 6520 5753 444c 2064 6566 696e 6974 the WSDL definit │ │ │ │ +0014f140: 696f 6e73 2f70 6f72 7454 7970 652f 406e ions/portType/@n │ │ │ │ +0014f150: 616d 6520 2857 5344 4c32 2e30 2069 6e74 ame (WSDL2.0 int │ │ │ │ +0014f160: 6572 6661 6365 2f40 6e61 6d65 2920 2020 erface/@name) │ │ │ │ +0014f170: 203c 2f74 643e 3c2f 7472 3e0a 3c74 7220
    a │ │ │ │ +0014f200: 6e20 616c 6961 7320 666f 7220 7468 6520 n alias for the │ │ │ │ +0014f210: 3c63 6f64 653e 7479 7065 3c2f 636f 6465 type property (portType follows SOAP 1 │ │ │ │ +0014f250: 2e31 206e 616d 696e 6720 636f 6e76 656e .1 naming conven │ │ │ │ +0014f260: 7469 6f6e 7329 2020 2020 3c2f 7464 3e3c tions)
    in │ │ │ │ +0014f2c0: 7465 7266 6163 653c 2f63 6f64 653e 2020 terface │ │ │ │ +0014f2d0: 203c 2f74 643e 3c74 6420 636c 6173 733d an alias │ │ │ │ +0014f300: 2066 6f72 2074 6865 203c 636f 6465 3e74 for the t │ │ │ │ +0014f310: 7970 653c 2f63 6f64 653e 2070 726f 7065 ype prope │ │ │ │ +0014f320: 7274 7920 283c 636f 6465 3e69 6e74 6572 rty (inter │ │ │ │ +0014f330: 6661 6365 3c2f 636f 6465 3e20 666f 6c6c face foll │ │ │ │ +0014f340: 6f77 7320 534f 4150 2031 2e32 206e 616d ows SOAP 1.2 nam │ │ │ │ +0014f350: 696e 6720 636f 6e76 656e 7469 6f6e 7329 ing conventions) │ │ │ │ +0014f360: 2020 2020 3c2f 7464 3e3c 2f74 723e 0a3c
    binding │ │ │ │ +0014f3c0: 3c2f 636f 6465 3e20 2020 3c2f 7464 3e3c
    portName name │ │ │ │ +0014f4b0: 206f 6620 7468 6520 5753 444c 2064 6566 of the WSDL def │ │ │ │ +0014f4c0: 696e 6974 696f 6e73 2f73 6572 7669 6365 initions/service │ │ │ │ +0014f4d0: 2f70 6f72 742f 406e 616d 6520 2020 203c /port/@name < │ │ │ │ +0014f4e0: 2f74 643e 3c2f 7472 3e0a 3c74 7220 636c /td>
    executable n │ │ │ │ +0014f570: 616d 6520 6f66 2074 6865 2022 6578 6563 ame of the "exec │ │ │ │ +0014f580: 7574 6162 6c65 2220 746f 2075 7365 2069 utable" to use i │ │ │ │ +0014f590: 6e20 7468 6520 5753 444c 2064 6566 696e n the WSDL defin │ │ │ │ +0014f5a0: 6974 696f 6e73 2f73 6572 7669 6365 2f70 itions/service/p │ │ │ │ +0014f5b0: 6f72 742f 6164 6472 6573 732f 406c 6f63 ort/address/@loc │ │ │ │ +0014f5c0: 6174 696f 6e20 2020 3c2f 7464 3e3c 2f74 ation
    .

    T │ │ │ │ +0014f5e0: 6865 2073 6572 7669 6365 203c 636f 6465 he service name and │ │ │ │ +0014f600: 203c 636f 6465 3e6e 616d 6573 7061 6365 namespace │ │ │ │ +0014f610: 3c2f 636f 6465 3e20 7072 6f70 6572 7469 properti │ │ │ │ +0014f620: 6573 2061 7265 2072 6571 7569 7265 6420 es are required │ │ │ │ +0014f630: 696e 206f 7264 6572 2074 6f20 6765 6e65 in order to gene │ │ │ │ +0014f640: 7261 7465 2061 2076 616c 6964 2057 5344 rate a valid WSD │ │ │ │ +0014f650: 4c20 7769 7468 2073 6f61 7063 7070 322e L with soapcpp2. │ │ │ │ +0014f660: 2054 6865 206f 7468 6572 2070 726f 7065 The other prope │ │ │ │ +0014f670: 7274 6965 7320 6172 6520 6f70 7469 6f6e rties are option │ │ │ │ +0014f680: 616c 2e3c 2f70 3e0a 3c70 3e54 6865 203c al.

    .

    The < │ │ │ │ +0014f690: 636f 6465 3e73 7479 6c65 3c2f 636f 6465 code>style and enco │ │ │ │ +0014f6b0: 6469 6e67 3c2f 636f 6465 3e20 7072 6f70 ding prop │ │ │ │ +0014f6c0: 6572 7479 2064 6566 6175 6c74 7320 6172 erty defaults ar │ │ │ │ +0014f6d0: 6520 6368 616e 6765 6420 7769 7468 203c e changed with < │ │ │ │ +0014f6e0: 623e 3c63 6f64 653e 736f 6170 6370 7032 b>soapcpp2 │ │ │ │ +0014f6f0: 202d 653c 2f63 6f64 653e 3c2f 623e 206f -e o │ │ │ │ +0014f700: 7074 696f 6e20 3c62 3e3c 636f 6465 3e2d ption - │ │ │ │ +0014f710: 653c 2f63 6f64 653e 3c2f 623e 2074 6f20 e to │ │ │ │ +0014f720: 3c63 6f64 653e 7270 633c 2f63 6f64 653e rpc │ │ │ │ +0014f730: 2061 6e64 203c 636f 6465 3e65 6e63 6f64 and encod │ │ │ │ +0014f740: 6564 3c2f 636f 6465 3e2e 3c2f 703e 0a3c ed.

    .< │ │ │ │ +0014f750: 703e 596f 7520 6361 6e20 6f76 6572 7269 p>You can overri │ │ │ │ +0014f760: 6465 2074 6865 203c 636f 6465 3e70 6f72 de the por │ │ │ │ +0014f770: 743c 2f63 6f64 653e 2065 6e64 706f 696e t endpoin │ │ │ │ +0014f780: 7420 5552 4c20 6174 2072 756e 7469 6d65 t URL at runtime │ │ │ │ +0014f790: 2069 6e20 7468 6520 6175 746f 2d67 656e in the auto-gen │ │ │ │ +0014f7a0: 6572 6174 6564 203c 636f 6465 3e73 6f61 erated soa │ │ │ │ +0014f7b0: 705f 6361 6c6c 5f70 7265 6669 785f 5f66 p_call_prefix__f │ │ │ │ +0014f7c0: 756e 633c 2f63 6f64 653e 2073 6572 7669 unc servi │ │ │ │ +0014f7d0: 6365 2063 616c 6c20 2843 2f43 2b2b 2063 ce call (C/C++ c │ │ │ │ +0014f7e0: 6c69 656e 7420 7369 6465 2920 616e 6420 lient side) and │ │ │ │ +0014f7f0: 696e 2074 6865 2043 2b2b 2070 726f 7879 in the C++ proxy │ │ │ │ +0014f800: 2063 6c61 7373 2073 6572 7669 6365 2063 class service c │ │ │ │ +0014f810: 616c 6c2e 3c2f 703e 0a3c 703e 5072 6f74 all.

    .

    Prot │ │ │ │ +0014f820: 6f63 6f6c 2070 726f 7065 7274 7920 7661 ocol property va │ │ │ │ +0014f830: 6c75 6573 2061 7265 3a3c 2f70 3e0a 3c74 lues are:

    ...pro │ │ │ │ +0014f8a0: 746f 636f 6c20 7661 6c75 6520 2020 3c2f tocol value description │ │ │ │ +0014f8e0: 2020 2020 3c2f 7468 3e3c 2f74 723e 0a3c .< │ │ │ │ +0014f8f0: 7472 2063 6c61 7373 3d22 6d61 726b 646f tr class="markdo │ │ │ │ +0014f900: 776e 5461 626c 6552 6f77 4f64 6422 3e0a wnTableRowOdd">. │ │ │ │ +0014f910: 3c74 6420 636c 6173 733d 226d 6172 6b64 SOAP SOA │ │ │ │ +0014f970: 5020 7472 616e 7370 6f72 742c 2073 7570 P transport, sup │ │ │ │ +0014f980: 706f 7274 696e 6720 626f 7468 2053 4f41 porting both SOA │ │ │ │ +0014f990: 5020 312e 3120 616e 6420 312e 3220 2020 P 1.1 and 1.2 │ │ │ │ +0014f9a0: 203c 2f74 643e 3c2f 7472 3e0a 3c74 7220 .. │ │ │ │ +0014f9f0: 3c63 6f64 653e 534f 4150 312e 313c 2f63 SOAP1.1 SO │ │ │ │ +0014fa30: 4150 2031 2e31 2074 7261 6e73 706f 7274 AP 1.1 transport │ │ │ │ +0014fa40: 2028 7361 6d65 2061 7320 3c63 6f64 653e (same as │ │ │ │ +0014fa50: 736f 6170 6370 7032 202d 313c 2f63 6f64 soapcpp2 -1) ..SOAP1 │ │ │ │ +0014fac0: 2e32 3c2f 636f 6465 3e20 2020 3c2f 7464 .2 SOAP 1.2 tran │ │ │ │ +0014fb00: 7370 6f72 7420 2873 616d 6520 6173 203c sport (same as < │ │ │ │ +0014fb10: 636f 6465 3e73 6f61 7063 7070 3220 2d32 code>soapcpp2 -2 │ │ │ │ +0014fb20: 3c2f 636f 6465 3e29 2020 2020 3c2f 7464 ) ..SOAP-GET │ │ │ │ +0014fb90: 2020 203c 2f74 643e 3c74 6420 636c 6173 one-wa │ │ │ │ +0014fbc0: 7920 534f 4150 2031 2e31 206f 7220 312e y SOAP 1.1 or 1. │ │ │ │ +0014fbd0: 3220 7769 7468 2048 5454 5020 4745 5420 2 with HTTP GET │ │ │ │ +0014fbe0: 2020 203c 2f74 643e 3c2f 7472 3e0a 3c74 ..< │ │ │ │ +0014fc10: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ │ +0014fc20: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ │ +0014fc30: 3e3c 636f 6465 3e53 4f41 5031 2e31 2d47 >SOAP1.1-G │ │ │ │ +0014fc40: 4554 3c2f 636f 6465 3e20 2020 3c2f 7464 ET one-way SOAP │ │ │ │ +0014fc80: 312e 3120 7769 7468 2048 5454 5020 4745 1.1 with HTTP GE │ │ │ │ +0014fc90: 5420 2020 203c 2f74 643e 3c2f 7472 3e0a T . │ │ │ │ +0014fca0: 3c74 7220 636c 6173 733d 226d 6172 6b64 .SOAP1. │ │ │ │ +0014fcf0: 322d 4745 543c 2f63 6f64 653e 2020 203c 2-GET < │ │ │ │ +0014fd00: 2f74 643e 3c74 6420 636c 6173 733d 226d /td>one-way SO │ │ │ │ +0014fd30: 4150 2031 2e32 2077 6974 6820 4854 5450 AP 1.2 with HTTP │ │ │ │ +0014fd40: 2047 4554 2020 2020 3c2f 7464 3e3c 2f74 GET ..HTTP │ │ │ │ +0014fda0: 3c2f 636f 6465 3e20 2020 3c2f 7464 3e3c < │ │ │ │ +0014fdb0: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ │ +0014fdc0: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ │ +0014fdd0: 3e61 6e20 616c 6961 7320 666f 7220 3c63 >an alias for POST │ │ │ │ +0014fdf0: 2873 616d 6520 6173 203c 636f 6465 3e73 (same as s │ │ │ │ +0014fe00: 6f61 7063 7070 3220 2d30 3c2f 636f 6465 oapcpp2 -0) │ │ │ │ +0014fe20: 0a3c 7472 2063 6c61 7373 3d22 6d61 726b ..POST< │ │ │ │ +0014fe70: 2f63 6f64 653e 2020 203c 2f74 643e 3c74 /code> │ │ │ │ +0014fea0: 6e6f 6e2d 534f 4150 2052 4553 5420 7072 non-SOAP REST pr │ │ │ │ +0014feb0: 6f74 6f63 6f6c 2077 6974 6820 4854 5450 otocol with HTTP │ │ │ │ +0014fec0: 2050 4f53 5420 2020 203c 2f74 643e 3c2f POST ..GET │ │ │ │ +0014ff20: 3c2f 636f 6465 3e20 2020 3c2f 7464 3e3c < │ │ │ │ +0014ff30: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ │ +0014ff40: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ │ +0014ff50: 3e6e 6f6e 2d53 4f41 5020 5245 5354 2070 >non-SOAP REST p │ │ │ │ +0014ff60: 726f 746f 636f 6c20 7769 7468 2048 5454 rotocol with HTT │ │ │ │ +0014ff70: 5020 4745 5420 2020 203c 2f74 643e 3c2f P GET ..PU │ │ │ │ +0014ffd0: 543c 2f63 6f64 653e 2020 203c 2f74 643e T │ │ │ │ +0014ffe0: 3c74 6420 636c 6173 733d 226d 6172 6b64 non-SOAP REST │ │ │ │ +00150010: 7072 6f74 6f63 6f6c 2077 6974 6820 4854 protocol with HT │ │ │ │ +00150020: 5450 2050 5554 2020 2020 3c2f 7464 3e3c TP PUT < │ │ │ │ +00150030: 2f74 723e 0a3c 7472 2063 6c61 7373 3d22 /tr>..DE │ │ │ │ +00150080: 4c45 5445 3c2f 636f 6465 3e20 2020 3c2f LETE non-SOAP RE │ │ │ │ +001500c0: 5354 2070 726f 746f 636f 6c20 7769 7468 ST protocol with │ │ │ │ +001500d0: 2048 5454 5020 4445 4c45 5445 2020 203c HTTP DELETE < │ │ │ │ +001500e0: 2f74 643e 3c2f 7472 3e0a 3c2f 7461 626c /td>..

    The │ │ │ │ +00150100: 7072 6f74 6f63 6f6c 3c2f 636f 6465 3e20 protocol │ │ │ │ +00150110: 7072 6f70 6572 7479 2069 7320 3c63 6f64 property is SOAP by │ │ │ │ +00150130: 2064 6566 6175 6c74 2e20 5468 6520 6465 default. The de │ │ │ │ +00150140: 6661 756c 7420 6973 2063 6861 6e67 6564 fault is changed │ │ │ │ +00150150: 2077 6974 6820 3c62 3e3c 636f 6465 3e73 with s │ │ │ │ +00150160: 6f61 7063 7070 3220 2d31 3c2f 636f 6465 oapcpp2 -1 option │ │ │ │ +00150180: 3c63 6f64 653e 2d31 3c2f 636f 6465 3e3c -1< │ │ │ │ +00150190: 2f62 3e20 746f 2053 4f41 5020 312e 312c /b> to SOAP 1.1, │ │ │ │ +001501a0: 203c 623e 3c63 6f64 653e 736f 6170 6370 soapcp │ │ │ │ +001501b0: 7032 202d 323c 2f63 6f64 653e 3c2f 623e p2 -2 │ │ │ │ +001501c0: 206f 7074 696f 6e20 3c62 3e3c 636f 6465 option -2 t │ │ │ │ +001501e0: 6f20 534f 4150 2031 2e32 2c20 616e 6420 o SOAP 1.2, and │ │ │ │ +001501f0: 6e6f 6e2d 534f 4150 2052 4553 5420 7769 non-SOAP REST wi │ │ │ │ +00150200: 7468 203c 623e 3c63 6f64 653e 736f 6170 th soap │ │ │ │ +00150210: 6370 7032 202d 303c 2f63 6f64 653e 3c2f cpp2 -0 option -0 │ │ │ │ +00150240: 3c2f 703e 0a3c 703e 5468 6520 3c63 6f64

    .

    The GET pro │ │ │ │ +00150260: 746f 636f 6c73 2066 6f72 2053 4f41 5020 tocols for SOAP │ │ │ │ +00150270: 616e 6420 5245 5354 2072 6571 7569 7265 and REST require │ │ │ │ +00150280: 2074 6861 7420 7468 6520 7365 7276 6963 that the servic │ │ │ │ +00150290: 6520 6f70 6572 6174 696f 6e73 206f 6e6c e operations onl │ │ │ │ +001502a0: 7920 7573 6520 7072 696d 6974 6976 6520 y use primitive │ │ │ │ +001502b0: 7479 7065 7320 7769 7468 2074 6865 6972 types with their │ │ │ │ +001502c0: 2069 6e70 7574 2070 6172 616d 6574 6572 input parameter │ │ │ │ +001502d0: 732c 2062 6563 6175 7365 2074 6865 7365 s, because these │ │ │ │ +001502e0: 2070 6172 616d 6574 6572 7320 6172 6520 parameters are │ │ │ │ +001502f0: 656e 636f 6465 6420 7769 7468 2074 6865 encoded with the │ │ │ │ +00150300: 2055 524c 2061 7320 5552 4c20 7175 6572 URL as URL quer │ │ │ │ +00150310: 7920 7661 6c75 6573 2e3c 2f70 3e0a 3c70 y values.

    .

    To let directiv │ │ │ │ +00150330: 6573 2074 616b 6520 6566 6665 6374 2077 es take effect w │ │ │ │ +00150340: 6974 6820 7365 7276 6963 6520 6f70 6572 ith service oper │ │ │ │ +00150350: 6174 696f 6e73 2c20 796f 7520 7368 6f75 ations, you shou │ │ │ │ +00150360: 6c64 2062 696e 6420 7468 6520 7365 7276 ld bind the serv │ │ │ │ +00150370: 6963 6520 6f70 6572 6174 696f 6e73 2074 ice operations t │ │ │ │ +00150380: 6f20 7468 6520 5753 444c 206e 616d 6573 o the WSDL names │ │ │ │ +00150390: 7061 6365 206f 6620 6120 7365 7276 6963 pace of a servic │ │ │ │ +001503a0: 6520 6279 2075 7369 6e67 2074 6865 206e e by using the n │ │ │ │ +001503b0: 616d 6573 7061 6365 2070 7265 6669 7820 amespace prefix │ │ │ │ +001503c0: 6173 2070 6172 7420 6f66 2074 6865 2069 as part of the i │ │ │ │ +001503d0: 6465 6e74 6966 6965 7220 6e61 6d65 206f dentifier name o │ │ │ │ +001503e0: 6620 7468 6520 6675 6e63 7469 6f6e 2074 f the function t │ │ │ │ +001503f0: 6861 7420 6465 6669 6e65 7320 7468 6520 hat defines the │ │ │ │ +00150400: 7365 7276 6963 6520 6f70 6572 6174 696f service operatio │ │ │ │ +00150410: 6e3a 3c2f 703e 0a3c 6469 7620 636c 6173 n:

    .
    < │ │ │ │ +00150440: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +00150450: 6f72 6474 7970 6522 3e69 6e74 3c2f 7370 ordtype">int prefix__func │ │ │ │ +00150470: 2861 7267 312c 2061 7267 322c 202e 2e2e (arg1, arg2, ... │ │ │ │ +00150480: 2c20 6172 676e 2c20 7265 7375 6c74 293b , argn, result); │ │ │ │ +00150490: 3c2f 6469 763e 0a3c 2f64 6976 3e3c 212d
    .

    where pre │ │ │ │ +001504c0: 6669 783c 2f63 6f64 653e 2063 616e 206e fix can n │ │ │ │ +001504d0: 6f77 2062 6520 7573 6564 2074 6f20 6c65 ow be used to le │ │ │ │ +001504e0: 7420 6469 7265 6374 6976 6573 2074 616b t directives tak │ │ │ │ +001504f0: 6520 6566 6665 6374 206f 6e20 7468 6973 e effect on this │ │ │ │ +00150500: 2073 6572 7669 6365 206f 7065 7261 7469 service operati │ │ │ │ +00150510: 6f6e 2e3c 2f70 3e0a 3c70 3ef0 9f94 9d20 on.

    .

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

    ..Servi │ │ │ │ +00150580: 6365 206d 6574 686f 6420 6469 7265 6374 ce method direct │ │ │ │ +00150590: 6976 6573 3c2f 6833 3e0a 3c70 3e53 6572 ives.

    Ser │ │ │ │ +001505a0: 7669 6365 2070 726f 7065 7274 6965 7320 vice properties │ │ │ │ +001505b0: 6172 6520 6170 706c 6963 6162 6c65 2074 are applicable t │ │ │ │ +001505c0: 6f20 6120 7365 7276 6963 6520 616e 6420 o a service and │ │ │ │ +001505d0: 746f 2061 6c6c 206f 6620 6974 7320 6f70 to all of its op │ │ │ │ +001505e0: 6572 6174 696f 6e73 2e20 5365 7276 6963 erations. Servic │ │ │ │ +001505f0: 6520 6d65 7468 6f64 2064 6972 6563 7469 e method directi │ │ │ │ +00150600: 7665 7320 6172 6520 7370 6563 6966 6963 ves are specific │ │ │ │ +00150610: 616c 6c79 2061 7070 6c69 6361 626c 6520 ally applicable │ │ │ │ +00150620: 746f 2061 2073 6572 7669 6365 206f 7065 to a service ope │ │ │ │ +00150630: 7261 7469 6f6e 2e3c 2f70 3e0a 3c70 3e41 ration.

    .

    A │ │ │ │ +00150640: 2073 6572 7669 6365 206d 6574 686f 6420 service method │ │ │ │ +00150650: 6469 7265 6374 6976 6520 6973 206f 6620 directive is of │ │ │ │ +00150660: 7468 6520 666f 726d 3a3c 2f70 3e0a 3c64 the form:

    .
    //gs │ │ │ │ +001506b0: 6f61 7020 266c 743b 7072 6566 6978 2667 oap <prefix&g │ │ │ │ +001506c0: 743b 2073 6572 7669 6365 206d 6574 686f t; service metho │ │ │ │ +001506d0: 642d 266c 743b 7072 6f70 6572 7479 2667 d-<property&g │ │ │ │ +001506e0: 743b 3a20 266c 743b 6d65 7468 6f64 2667 t;: <method&g │ │ │ │ +001506f0: 743b 2026 6c74 3b76 616c 7565 2667 743b t; <value> │ │ │ │ +00150700: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c2f
    .

    where <prefix&g │ │ │ │ +00150740: 743b 3c2f 636f 6465 3e20 6973 2074 6865 t; is the │ │ │ │ +00150750: 2058 4d4c 206e 616d 6573 7061 6365 2070 XML namespace p │ │ │ │ +00150760: 7265 6669 7820 6f66 2061 2073 6572 7669 refix of a servi │ │ │ │ +00150770: 6365 2062 696e 6469 6e67 2061 6e64 203c ce binding and < │ │ │ │ +00150780: 636f 6465 3e26 6c74 3b6d 6574 686f 6426 code><method& │ │ │ │ +00150790: 6774 3b3c 2f63 6f64 653e 2069 7320 7468 gt; is th │ │ │ │ +001507a0: 6520 756e 7175 616c 6966 6965 6420 6e61 e unqualified na │ │ │ │ +001507b0: 6d65 206f 6620 6120 7365 7276 6963 6520 me of a service │ │ │ │ +001507c0: 6f70 6572 6174 696f 6e2e 2054 6865 203c operation. The < │ │ │ │ +001507d0: 636f 6465 3e26 6c74 3b70 726f 7065 7274 code><propert │ │ │ │ +001507e0: 7926 6774 3b3c 2f63 6f64 653e 2061 6e64 y> and │ │ │ │ +001507f0: 203c 636f 6465 3e26 6c74 3b76 616c 7565 <value │ │ │ │ +00150800: 2667 743b 3c2f 636f 6465 3e20 6669 656c > fiel │ │ │ │ +00150810: 6473 2061 7265 206f 6e65 206f 6620 7468 ds are one of th │ │ │ │ +00150820: 6520 666f 6c6c 6f77 696e 673a 3c2f 703e e following:

    │ │ │ │ +00150830: 0a3c 7461 626c 6520 636c 6173 733d 226d ..< │ │ │ │ +00150850: 7472 2063 6c61 7373 3d22 6d61 726b 646f tr class="markdo │ │ │ │ +00150860: 776e 5461 626c 6548 6561 6422 3e0a 3c74 wnTableHead">. │ │ │ │ +00150890: 6d65 7468 6f64 2070 726f 7065 7274 7920 method property │ │ │ │ +001508a0: 2020 3c2f 7468 3e3c 7468 2063 6c61 7373 .. │ │ │ │ +00150920: 3c63 6f64 653e 6d65 7468 6f64 2d64 6f63 method-doc │ │ │ │ +00150930: 756d 656e 7461 7469 6f6e 3c2f 636f 6465 umentation .< │ │ │ │ +001509a0: 7472 2063 6c61 7373 3d22 6d61 726b 646f tr class="markdo │ │ │ │ +001509b0: 776e 5461 626c 6552 6f77 4576 656e 223e wnTableRowEven"> │ │ │ │ +001509c0: 0a3c 7464 2063 6c61 7373 3d22 6d61 726b . │ │ │ │ +00150a20: 7361 6d65 2061 7320 6162 6f76 652c 2073 same as above, s │ │ │ │ +00150a30: 686f 7274 6861 6e64 2066 6f72 6d20 2020 horthand form │ │ │ │ +00150a40: 203c 2f74 643e 3c2f 7472 3e0a 3c74 7220 ...... │ │ │ │ +00150c60: 3c63 6f64 653e 6d65 7468 6f64 2d6f 7574 method-out │ │ │ │ +00150c70: 7075 742d 6163 7469 6f6e 3c2f 636f 6465 put-action .. │ │ │ │ +00150d70: 3c74 6420 636c 6173 733d 226d 6172 6b64 ....< │ │ │ │ +00150f50: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ │ +00150f60: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ │ +00150f70: 3e3c 636f 6465 3e6d 6574 686f 642d 696e >method-in │ │ │ │ +00150f80: 7075 742d 6865 6164 6572 2d70 6172 743c put-header-part< │ │ │ │ +00150f90: 2f63 6f64 653e 2020 203c 2f74 643e 3c74 /code> │ │ │ │ +00150fc0: 6d65 6d62 6572 206e 616d 6520 6f66 2074 member name of t │ │ │ │ +00150fd0: 6865 203c 636f 6465 3e3c 6120 636c 6173 he SOAP_ENV__He │ │ │ │ +00151040: 6164 6572 3c2f 613e 3c2f 636f 6465 3e20 ader │ │ │ │ +00151050: 7374 7275 6374 2075 7365 6420 696e 2053 struct used in S │ │ │ │ +00151060: 4f41 5020 4865 6164 6572 7320 6f66 2072 OAP Headers of r │ │ │ │ +00151070: 6571 7565 7374 7320 2020 203c 2f74 643e equests │ │ │ │ +00151080: 3c2f 7472 3e0a 3c74 7220 636c 6173 733d ... │ │ │ │ +001511e0: 3c74 7220 636c 6173 733d 226d 6172 6b64 ...............< │ │ │ │ +00151890: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ │ +001518a0: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ │ +001518b0: 3e53 4f41 5020 6f72 2052 4553 542c 2073 >SOAP or REST, s │ │ │ │ +001518c0: 6565 203c 6120 636c 6173 733d 2265 6c22 ee │ │ │ │ +001518f0: 5365 7276 6963 6520 6469 7265 6374 6976 Service directiv │ │ │ │ +00151900: 6573 3c2f 613e 2020 203c 2f74 643e 3c2f es .
    value │ │ │ │ +001508d0: 2020 3c2f 7468 3e3c 2f74 723e 0a3c 7472
    text │ │ │ │ +00150970: 6465 7363 7269 6269 6e67 2074 6865 2073 describing the s │ │ │ │ +00150980: 6572 7669 6365 206f 7065 7261 7469 6f6e ervice operation │ │ │ │ +00150990: 2020 2020 3c2f 7464 3e3c 2f74 723e 0a3c
    method< │ │ │ │ +001509f0: 2f63 6f64 653e 2020 203c 2f74 643e 3c74 /code>
    < │ │ │ │ +00150a90: 636f 6465 3e6d 6574 686f 642d 6163 7469 code>method-acti │ │ │ │ +00150aa0: 6f6e 3c2f 636f 6465 3e20 2020 3c2f 7464 on "" or URI SOAPAc │ │ │ │ +00150af0: 7469 6f6e 2048 5454 5020 6865 6164 6572 tion HTTP header │ │ │ │ +00150b00: 2c20 6f72 2055 524c 2071 7565 7279 2073 , or URL query s │ │ │ │ +00150b10: 7472 696e 6720 666f 7220 5245 5354 2070 tring for REST p │ │ │ │ +00150b20: 726f 746f 636f 6c73 2020 2020 3c2f 7464 rotocols
    method-input-ac │ │ │ │ +00150b90: 7469 6f6e 3c2f 636f 6465 3e20 2020 3c2f tion "" or URI SOAP │ │ │ │ +00150be0: 4163 7469 6f6e 2048 5454 5020 6865 6164 Action HTTP head │ │ │ │ +00150bf0: 6572 206f 6620 7365 7276 6963 6520 7265 er of service re │ │ │ │ +00150c00: 7175 6573 7420 6d65 7373 6167 6573 2020 quest messages │ │ │ │ +00150c10: 2020 3c2f 7464 3e3c 2f74 723e 0a3c 7472
    "" or UR │ │ │ │ +00150cc0: 4920 534f 4150 4163 7469 6f6e 2048 5454 I SOAPAction HTT │ │ │ │ +00150cd0: 5020 6865 6164 6572 206f 6620 7365 7276 P header of serv │ │ │ │ +00150ce0: 6963 6520 7265 7370 6f6e 7365 206d 6573 ice response mes │ │ │ │ +00150cf0: 7361 6765 7320 2020 203c 2f74 643e 3c2f sages
    me │ │ │ │ +00150d50: 7468 6f64 2d66 6175 6c74 2d61 6374 696f thod-fault-actio │ │ │ │ +00150d60: 6e3c 2f63 6f64 653e 2020 203c 2f74 643e n "" or URI SOAPAct │ │ │ │ +00150db0: 696f 6e20 4854 5450 2068 6561 6465 7220 ion HTTP header │ │ │ │ +00150dc0: 6f66 2073 6572 7669 6365 2066 6175 6c74 of service fault │ │ │ │ +00150dd0: 206d 6573 7361 6765 7320 2020 203c 2f74 messages
    method-header-p │ │ │ │ +00150e40: 6172 743c 2f63 6f64 653e 2020 203c 2f74 art member name │ │ │ │ +00150e80: 6f66 2074 6865 203c 636f 6465 3e3c 6120 of the SOAP_ENV │ │ │ │ +00150ef0: 5f5f 4865 6164 6572 3c2f 613e 3c2f 636f __Header struct used │ │ │ │ +00150f10: 696e 2053 4f41 5020 4865 6164 6572 2020 in SOAP Header │ │ │ │ +00150f20: 2020 3c2f 7464 3e3c 2f74 723e 0a3c 7472
    m │ │ │ │ +001510d0: 6574 686f 642d 6f75 7470 7574 2d68 6561 ethod-output-hea │ │ │ │ +001510e0: 6465 722d 7061 7274 3c2f 636f 6465 3e20 der-part │ │ │ │ +001510f0: 2020 3c2f 7464 3e3c 7464 2063 6c61 7373 member │ │ │ │ +00151120: 6e61 6d65 206f 6620 7468 6520 3c63 6f64 name of the SOA │ │ │ │ +00151190: 505f 454e 565f 5f48 6561 6465 723c 2f61 P_ENV__Header struct │ │ │ │ +001511b0: 7573 6564 2069 6e20 534f 4150 2048 6561 used in SOAP Hea │ │ │ │ +001511c0: 6465 7273 206f 6620 7265 7370 6f6e 7365 ders of response │ │ │ │ +001511d0: 7320 2020 203c 2f74 643e 3c2f 7472 3e0a s
    method │ │ │ │ +00151230: 2d66 6175 6c74 3c2f 636f 6465 3e20 2020 -fault │ │ │ │ +00151240: 3c2f 7464 3e3c 7464 2063 6c61 7373 3d22 type name │ │ │ │ +00151270: 206f 6620 6120 7374 7275 6374 206f 7220 of a struct or │ │ │ │ +00151280: 636c 6173 7320 6d65 6d62 6572 2075 7365 class member use │ │ │ │ +00151290: 6420 696e 203c 636f 6465 3e53 4f41 505f d in SOAP_ │ │ │ │ +001512a0: 454e 565f 5f44 6574 6169 6c73 3c2f 636f ENV__Details struct
    method-mime-ty │ │ │ │ +00151320: 7065 3c2f 636f 6465 3e20 2020 3c2f 7464 pe REST content │ │ │ │ +00151360: 7479 7065 206f 7220 534f 4150 204d 494d type or SOAP MIM │ │ │ │ +00151370: 4520 6174 7461 6368 6d65 6e74 2063 6f6e E attachment con │ │ │ │ +00151380: 7465 6e74 2074 7970 6528 7329 2020 2020 tent type(s) │ │ │ │ +00151390: 3c2f 7464 3e3c 2f74 723e 0a3c 7472 2063
    < │ │ │ │ +001513e0: 636f 6465 3e6d 6574 686f 642d 696e 7075 code>method-inpu │ │ │ │ +001513f0: 742d 6d69 6d65 2d74 7970 653c 2f63 6f64 t-mime-type REST │ │ │ │ +00151430: 2063 6f6e 7465 6e74 2074 7970 6520 6f72 content type or │ │ │ │ +00151440: 2053 4f41 5020 4d49 4d45 2061 7474 6163 SOAP MIME attac │ │ │ │ +00151450: 686d 656e 7420 636f 6e74 656e 7420 7479 hment content ty │ │ │ │ +00151460: 7065 2873 2920 6f66 2072 6571 7565 7374 pe(s) of request │ │ │ │ +00151470: 206d 6573 7361 6765 2020 2020 3c2f 7464 message
    │ │ │ │ +001514d0: 6d65 7468 6f64 2d6f 7574 7075 742d 6d69 method-output-mi │ │ │ │ +001514e0: 6d65 2d74 7970 653c 2f63 6f64 653e 2020 me-type │ │ │ │ +001514f0: 203c 2f74 643e 3c74 6420 636c 6173 733d REST con │ │ │ │ +00151520: 7465 6e74 2074 7970 6520 6f72 2053 4f41 tent type or SOA │ │ │ │ +00151530: 5020 4d49 4d45 2061 7474 6163 686d 656e P MIME attachmen │ │ │ │ +00151540: 7420 636f 6e74 656e 7420 7479 7065 2873 t content type(s │ │ │ │ +00151550: 2920 6f66 2072 6573 706f 6e73 6520 6d65 ) of response me │ │ │ │ +00151560: 7373 6167 6520 2020 203c 2f74 643e 3c2f ssage
    me │ │ │ │ +001515c0: 7468 6f64 2d73 7479 6c65 3c2f 636f 6465 thod-style document │ │ │ │ +00151610: 206f 7220 3c63 6f64 653e 7270 633c 2f63 or rpc
    meth │ │ │ │ +00151680: 6f64 2d65 6e63 6f64 696e 673c 2f63 6f64 od-encoding literal │ │ │ │ +001516d0: 2c20 3c63 6f64 653e 656e 636f 6465 643c , encoded< │ │ │ │ +001516e0: 2f63 6f64 653e 2c20 6f72 2061 2063 7573 /code>, or a cus │ │ │ │ +001516f0: 746f 6d20 5552 4920 666f 7220 656e 636f tom URI for enco │ │ │ │ +00151700: 6469 6e67 5374 796c 6520 6f66 206d 6573 dingStyle of mes │ │ │ │ +00151710: 7361 6765 7320 2020 203c 2f74 643e 3c2f sages
    me │ │ │ │ +00151770: 7468 6f64 2d72 6573 706f 6e73 652d 656e thod-response-en │ │ │ │ +00151780: 636f 6469 6e67 3c2f 636f 6465 3e20 2020 coding │ │ │ │ +00151790: 3c2f 7464 3e3c 7464 2063 6c61 7373 3d22 lit │ │ │ │ +001517c0: 6572 616c 3c2f 636f 6465 3e2c 203c 636f eral, encoded, or a custom U │ │ │ │ +001517f0: 5249 2066 6f72 2065 6e63 6f64 696e 6753 RI for encodingS │ │ │ │ +00151800: 7479 6c65 206f 6620 7265 7370 6f6e 7365 tyle of response │ │ │ │ +00151810: 206d 6573 7361 6765 7320 2020 203c 2f74 messages
    method-protocol │ │ │ │ +00151880: 3c2f 636f 6465 3e20 2020 3c2f 7464 3e3c
    .

    │ │ │ │ +00151920: 5468 6520 3c63 6f64 653e 6d65 7468 6f64 The method │ │ │ │ +00151930: 2d68 6561 6465 722d 7061 7274 3c2f 636f -header-part properties c │ │ │ │ +00151950: 616e 2062 6520 7265 7065 6174 6564 2066 an be repeated f │ │ │ │ +00151960: 6f72 2061 2073 6572 7669 6365 206f 7065 or a service ope │ │ │ │ +00151970: 7261 7469 6f6e 2074 6f20 6465 636c 6172 ration to declar │ │ │ │ +00151980: 6520 6d75 6c74 6970 6c65 2053 4f41 5020 e multiple SOAP │ │ │ │ +00151990: 4865 6164 6572 2070 6172 7473 2074 6861 Header parts tha │ │ │ │ +001519a0: 7420 7468 6520 7365 7276 6963 6520 6f70 t the service op │ │ │ │ +001519b0: 6572 6174 696f 6e20 7265 7175 6972 6573 eration requires │ │ │ │ +001519c0: 2e20 596f 7520 6361 6e20 7573 6520 3c63 . You can use method-input │ │ │ │ +001519e0: 2d68 6561 6465 722d 7061 7274 3c2f 636f -header-part and me │ │ │ │ +00151a00: 7468 6f64 2d6f 7574 7075 742d 6865 6164 thod-output-head │ │ │ │ +00151a10: 6572 2d70 6172 743c 2f63 6f64 653e 2074 er-part t │ │ │ │ +00151a20: 6f20 6469 6666 6572 656e 7469 6174 6520 o differentiate │ │ │ │ +00151a30: 6265 7477 6565 6e20 7265 7175 6573 7420 between request │ │ │ │ +00151a40: 616e 6420 7265 7370 6f6e 7365 206d 6573 and response mes │ │ │ │ +00151a50: 7361 6765 732e 3c2f 703e 0a3c 703e 5468 sages.

    .

    Th │ │ │ │ +00151a60: 6520 3c63 6f64 653e 6d65 7468 6f64 2d66 e method-f │ │ │ │ +00151a70: 6175 6c74 3c2f 636f 6465 3e20 7072 6f70 ault prop │ │ │ │ +00151a80: 6572 7479 2063 616e 2062 6520 7265 7065 erty can be repe │ │ │ │ +00151a90: 6174 6564 2066 6f72 2061 2073 6572 7669 ated for a servi │ │ │ │ +00151aa0: 6365 206f 7065 7261 7469 6f6e 2074 6f20 ce operation to │ │ │ │ +00151ab0: 6465 636c 6172 6520 6d75 6c74 6970 6c65 declare multiple │ │ │ │ +00151ac0: 2066 6175 6c74 7320 7468 6174 2074 6865 faults that the │ │ │ │ +00151ad0: 2073 6572 7669 6365 206f 7065 7261 7469 service operati │ │ │ │ +00151ae0: 6f6e 206d 6179 2072 6574 7572 6e2e 3c2f on may return..

    The │ │ │ │ +00151b00: 6d65 7468 6f64 2d61 6374 696f 6e3c 2f63 method-action property se │ │ │ │ +00151b20: 7276 6573 2074 776f 2070 7572 706f 7365 rves two purpose │ │ │ │ +00151b30: 733a 3c2f 703e 0a3c 6f6c 2074 7970 653d s:

    .
      .
    1. To set │ │ │ │ +00151b50: 7468 6520 534f 4150 4163 7469 6f6e 2068 the SOAPAction h │ │ │ │ +00151b60: 6561 6465 7220 666f 7220 534f 4150 2070 eader for SOAP p │ │ │ │ +00151b70: 726f 746f 636f 6c73 2c20 692e 652e 2073 rotocols, i.e. s │ │ │ │ +00151b80: 6574 7320 7468 6520 6465 6669 6e69 7469 ets the definiti │ │ │ │ +00151b90: 6f6e 732f 6269 6e64 696e 672f 6f70 6572 ons/binding/oper │ │ │ │ +00151ba0: 6174 696f 6e2f 534f 4150 3a6f 7065 7261 ation/SOAP:opera │ │ │ │ +00151bb0: 7469 6f6e 2f40 736f 6170 4163 7469 6f6e tion/@soapAction │ │ │ │ +00151bc0: 2e3c 2f6c 693e 0a3c 6c69 3e54 6f20 7365 .
    2. .
    3. To se │ │ │ │ +00151bd0: 7420 7468 6520 5552 4c20 7175 6572 7920 t the URL query │ │ │ │ +00151be0: 7374 7269 6e67 2066 6f72 2065 6e64 706f string for endpo │ │ │ │ +00151bf0: 696e 7473 2077 6974 6820 5245 5354 2070 ints with REST p │ │ │ │ +00151c00: 726f 746f 636f 6c73 2c20 692e 652e 2073 rotocols, i.e. s │ │ │ │ +00151c10: 6574 7320 7468 6520 6465 6669 6e69 7469 ets the definiti │ │ │ │ +00151c20: 6f6e 732f 6269 6e64 696e 672f 6f70 6572 ons/binding/oper │ │ │ │ +00151c30: 6174 696f 6e2f 4854 5450 3a6f 7065 7261 ation/HTTP:opera │ │ │ │ +00151c40: 7469 6f6e 2f40 6c6f 6361 7469 6f6e 2c20 tion/@location, │ │ │ │ +00151c50: 7768 6963 6820 7370 6563 6966 6965 7320 which specifies │ │ │ │ +00151c60: 6120 5552 4c20 7175 6572 7920 7374 7269 a URL query stri │ │ │ │ +00151c70: 6e67 2028 7374 6172 7473 2077 6974 6820 ng (starts with │ │ │ │ +00151c80: 6120 3c63 6f64 653e 3f3c 2f63 6f64 653e a ? │ │ │ │ +00151c90: 2920 746f 2063 6f6d 706c 6574 6520 7468 ) to complete th │ │ │ │ +00151ca0: 6520 7365 7276 6963 6520 656e 6470 6f69 e service endpoi │ │ │ │ +00151cb0: 6e74 2055 524c 206f 7220 6578 7465 6e64 nt URL or extend │ │ │ │ +00151cc0: 7320 7468 6520 656e 6470 6f69 6e74 2055 s the endpoint U │ │ │ │ +00151cd0: 524c 2077 6974 6820 6120 6c6f 6361 6c20 RL with a local │ │ │ │ +00151ce0: 7061 7468 2028 7374 6172 7473 2077 6974 path (starts wit │ │ │ │ +00151cf0: 6820 6120 3c63 6f64 653e 2f3c 2f63 6f64 h a /).
    4. .
    . │ │ │ │ +00151d10: 3c70 3e55 7365 203c 636f 6465 3e6d 6574

    Use met │ │ │ │ +00151d20: 686f 642d 696e 7075 742d 6163 7469 6f6e hod-input-action │ │ │ │ +00151d30: 3c2f 636f 6465 3e20 616e 6420 3c63 6f64 and method-output- │ │ │ │ +00151d50: 6163 7469 6f6e 3c2f 636f 6465 3e20 746f action to │ │ │ │ +00151d60: 2064 6966 6665 7265 6e74 6961 7465 2074 differentiate t │ │ │ │ +00151d70: 6865 2053 4f41 5041 6374 696f 6e20 6265 he SOAPAction be │ │ │ │ +00151d80: 7477 6565 6e20 534f 4150 2072 6571 7565 tween SOAP reque │ │ │ │ +00151d90: 7374 2061 6e64 2072 6573 706f 6e73 6520 st and response │ │ │ │ +00151da0: 6d65 7373 6167 6573 2e3c 2f70 3e0a 3c70 messages.

    .

    You can always │ │ │ │ +00151dc0: 6f76 6572 7269 6465 2074 6865 2070 6f72 override the por │ │ │ │ +00151dd0: 7420 656e 6470 6f69 6e74 2055 524c 2061 t endpoint URL a │ │ │ │ +00151de0: 6e64 2061 6374 696f 6e20 7661 6c75 6573 nd action values │ │ │ │ +00151df0: 2061 7420 7275 6e74 696d 6520 696e 2074 at runtime in t │ │ │ │ +00151e00: 6865 2061 7574 6f2d 6765 6e65 7261 7465 he auto-generate │ │ │ │ +00151e10: 6420 3c63 6f64 653e 736f 6170 5f63 616c d soap_cal │ │ │ │ +00151e20: 6c5f 7072 6566 6978 5f5f 6675 6e63 3c2f l_prefix__func service ca │ │ │ │ +00151e40: 6c6c 2028 432f 432b 2b20 636c 6965 6e74 ll (C/C++ client │ │ │ │ +00151e50: 2073 6964 6529 2061 6e64 2069 6e20 7468 side) and in th │ │ │ │ +00151e60: 6520 6175 746f 2d67 656e 6572 6174 6564 e auto-generated │ │ │ │ +00151e70: 2043 2b2b 2070 726f 7879 2063 6c61 7373 C++ proxy class │ │ │ │ +00151e80: 2073 6572 7669 6365 2063 616c 6c73 2e20 service calls. │ │ │ │ +00151e90: 4120 7275 6e74 696d 6520 4e55 4c4c 2065 A runtime NULL e │ │ │ │ +00151ea0: 6e64 706f 696e 7420 5552 4c20 616e 642f ndpoint URL and/ │ │ │ │ +00151eb0: 6f72 2061 6374 696f 6e20 7573 6573 2074 or action uses t │ │ │ │ +00151ec0: 6865 2064 6566 6175 6c74 7320 7365 7420 he defaults set │ │ │ │ +00151ed0: 6279 2074 6865 7365 2064 6972 6563 7469 by these directi │ │ │ │ +00151ee0: 7665 732e 3c2f 703e 0a3c 703e 5468 6520 ves.

    .

    The │ │ │ │ +00151ef0: 3c63 6f64 653e 6d65 7468 6f64 2d6d 696d method-mim │ │ │ │ +00151f00: 652d 7479 7065 3c2f 636f 6465 3e20 7072 e-type pr │ │ │ │ +00151f10: 6f70 6572 7479 2073 6572 7665 7320 7477 operty serves tw │ │ │ │ +00151f20: 6f20 7075 7270 6f73 6573 3a3c 2f70 3e0a o purposes:

    . │ │ │ │ +00151f30: 3c6f 6c20 7479 7065 3d22 3122 3e0a 3c6c
      .To set the typ │ │ │ │ +00151f50: 6520 6f66 204d 494d 452f 4d54 4f4d 2061 e of MIME/MTOM a │ │ │ │ +00151f60: 7474 6163 686d 656e 7473 2075 7365 6420 ttachments used │ │ │ │ +00151f70: 7769 7468 2053 4f41 5020 7072 6f74 6f63 with SOAP protoc │ │ │ │ +00151f80: 6f6c 732e 204d 756c 7469 706c 6520 6174 ols. Multiple at │ │ │ │ +00151f90: 7461 6368 6d65 6e74 2074 7970 6573 2063 tachment types c │ │ │ │ +00151fa0: 616e 2062 6520 6465 636c 6172 6564 2066 an be declared f │ │ │ │ +00151fb0: 6f72 2061 2053 4f41 5020 7365 7276 6963 or a SOAP servic │ │ │ │ +00151fc0: 6520 6f70 6572 6174 696f 6e2c 2069 2e65 e operation, i.e │ │ │ │ +00151fd0: 2e20 6164 6473 2064 6566 696e 6974 696f . adds definitio │ │ │ │ +00151fe0: 6e73 2f62 696e 6469 6e67 2f6f 7065 7261 ns/binding/opera │ │ │ │ +00151ff0: 7469 6f6e 2f69 6e70 7574 2f4d 494d 453a tion/input/MIME: │ │ │ │ +00152000: 6d75 6c74 6970 6172 7452 656c 6174 6564 multipartRelated │ │ │ │ +00152010: 2f4d 494d 453a 7061 7274 2f4d 494d 453a /MIME:part/MIME: │ │ │ │ +00152020: 636f 6e74 656e 742f 4074 7970 6520 666f content/@type fo │ │ │ │ +00152030: 7220 6561 6368 2074 7970 6520 7370 6563 r each type spec │ │ │ │ +00152040: 6966 6965 642e 3c2f 6c69 3e0a 3c6c 693e ified..
    1. │ │ │ │ +00152050: 546f 2073 6574 2074 6865 204d 494d 4520 To set the MIME │ │ │ │ +00152060: 7479 7065 206f 6620 6120 5245 5354 206f type of a REST o │ │ │ │ +00152070: 7065 7261 7469 6f6e 2e20 5468 6973 2072 peration. This r │ │ │ │ +00152080: 6570 6c61 6365 7320 584d 4c20 6465 636c eplaces XML decl │ │ │ │ +00152090: 6172 6564 2069 6e20 5753 444c 2062 7920 ared in WSDL by │ │ │ │ +001520a0: 6465 6669 6e69 7469 6f6e 732f 6269 6e64 definitions/bind │ │ │ │ +001520b0: 696e 672f 6f70 6572 6174 696f 6e2f 2869 ing/operation/(i │ │ │ │ +001520c0: 6e70 7574 7c6f 7574 7075 7429 2f4d 494d nput|output)/MIM │ │ │ │ +001520d0: 453a 6d69 6d65 586d 6c20 7769 7468 204d E:mimeXml with M │ │ │ │ +001520e0: 494d 453a 636f 6e74 656e 742f 4074 7970 IME:content/@typ │ │ │ │ +001520f0: 652e 2055 7365 203c 636f 6465 3e61 7070 e. Use app │ │ │ │ +00152100: 6c69 6361 7469 6f6e 2f78 2d77 7777 2d66 lication/x-www-f │ │ │ │ +00152110: 6f72 6d2d 7572 6c65 6e63 6f64 6564 3c2f orm-urlencoded with REST │ │ │ │ +00152130: 504f 5354 2061 6e64 2050 5554 2070 726f POST and PUT pro │ │ │ │ +00152140: 746f 636f 6c73 2074 6f20 7365 6e64 2065 tocols to send e │ │ │ │ +00152150: 6e63 6f64 6564 2066 6f72 6d20 6461 7461 ncoded form data │ │ │ │ +00152160: 2061 7574 6f6d 6174 6963 616c 6c79 2069 automatically i │ │ │ │ +00152170: 6e73 7465 6164 206f 6620 584d 4c2e 204f nstead of XML. O │ │ │ │ +00152180: 6e6c 7920 7072 696d 6974 6976 6520 7479 nly primitive ty │ │ │ │ +00152190: 7065 2076 616c 7565 7320 6361 6e20 6265 pe values can be │ │ │ │ +001521a0: 2074 7261 6e73 6d69 7474 6564 2077 6974 transmitted wit │ │ │ │ +001521b0: 6820 666f 726d 2064 6174 612c 2073 7563 h form data, suc │ │ │ │ +001521c0: 6820 6173 206e 756d 6265 7273 2061 6e64 h as numbers and │ │ │ │ +001521d0: 2073 7472 696e 6773 2c20 692e 652e 206f strings, i.e. o │ │ │ │ +001521e0: 6e6c 7920 7479 7065 7320 7468 6174 2061 nly types that a │ │ │ │ +001521f0: 7265 206c 6567 616c 2074 6f20 7573 6520 re legal to use │ │ │ │ +00152200: 6173 2061 7474 7269 6275 7465 7320 6d65 as attributes me │ │ │ │ +00152210: 6d62 6572 732e 3c2f 6c69 3e0a 3c2f 6f6c mbers.
    2. .
    .

    Use m │ │ │ │ +00152230: 6574 686f 642d 696e 7075 742d 6d69 6d65 ethod-input-mime │ │ │ │ +00152240: 2d74 7970 653c 2f63 6f64 653e 2061 6e64 -type and │ │ │ │ +00152250: 203c 636f 6465 3e6d 6574 686f 642d 6f75 method-ou │ │ │ │ +00152260: 7470 7574 2d6d 696d 652d 7479 7065 3c2f tput-mime-type to differe │ │ │ │ +00152280: 6e74 6961 7465 2074 6865 2061 7474 6163 ntiate the attac │ │ │ │ +00152290: 686d 656e 7420 7479 7065 7320 6265 7477 hment types betw │ │ │ │ +001522a0: 6565 6e20 7265 7175 6573 7420 616e 6420 een request and │ │ │ │ +001522b0: 7265 7370 6f6e 7365 206d 6573 7361 6765 response message │ │ │ │ +001522c0: 732e 3c2f 703e 0a3c 703e f09f 949d 203c s.

    .

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

    .

    .Schema │ │ │ │ +00152330: 2064 6972 6563 7469 7665 733c 2f68 333e directives

    │ │ │ │ +00152340: 0a3c 703e 4120 7363 6865 6d61 2064 6972 .

    A schema dir │ │ │ │ +00152350: 6563 7469 7665 2069 7320 6f66 2074 6865 ective is of the │ │ │ │ +00152360: 2066 6f72 6d3a 3c2f 703e 0a3c 6469 7620 form:

    .
    //gsoap │ │ │ │ +001523b0: 2026 6c74 3b70 7265 6669 7826 6774 3b20 <prefix> │ │ │ │ +001523c0: 7363 6865 6d61 2026 6c74 3b70 726f 7065 schema <prope │ │ │ │ +001523d0: 7274 7926 6774 3b3a 2026 6c74 3b76 616c rty>: <val │ │ │ │ +001523e0: 7565 2667 743b 3c2f 7370 616e 3e3c 2f64 ue>.

    wh │ │ │ │ +00152410: 6572 6520 3c63 6f64 653e 266c 743b 7072 ere <pr │ │ │ │ +00152420: 6566 6978 2667 743b 3c2f 636f 6465 3e20 efix> │ │ │ │ +00152430: 6973 2074 6865 2058 4d4c 206e 616d 6573 is the XML names │ │ │ │ +00152440: 7061 6365 2070 7265 6669 7820 6f66 2061 pace prefix of a │ │ │ │ +00152450: 2073 6368 656d 612e 2054 6865 203c 636f schema. The <property& │ │ │ │ +00152470: 6774 3b3c 2f63 6f64 653e 2061 6e64 203c gt; and < │ │ │ │ +00152480: 636f 6465 3e26 6c74 3b76 616c 7565 2667 code><value&g │ │ │ │ +00152490: 743b 3c2f 636f 6465 3e20 6669 656c 6473 t; fields │ │ │ │ +001524a0: 2061 7265 206f 6e65 206f 6620 7468 6520 are one of the │ │ │ │ +001524b0: 666f 6c6c 6f77 696e 673a 3c2f 703e 0a3c following:

    .< │ │ │ │ +001524c0: 7461 626c 6520 636c 6173 733d 226d 6172 table class="mar │ │ │ │ +001524d0: 6b64 6f77 6e54 6162 6c65 223e 0a3c 7472 kdownTable">..pr │ │ │ │ +00152520: 6f70 6572 7479 2020 203c 2f74 683e 3c74 operty │ │ │ │ +00152550: 7661 6c75 6520 2020 203c 2f74 683e 3c2f value ..nam │ │ │ │ +001525b0: 6573 7061 6365 3c2f 636f 6465 3e20 2020 espace │ │ │ │ +001525c0: 3c2f 7464 3e3c 7464 2063 6c61 7373 3d22 URI of th │ │ │ │ +001525f0: 6520 5853 4420 7461 7267 6574 4e61 6d65 e XSD targetName │ │ │ │ +00152600: 7370 6163 6520 2020 203c 2f74 643e 3c2f space ..na │ │ │ │ +00152660: 6d65 7370 6163 6532 3c2f 636f 6465 3e20 mespace2 │ │ │ │ +00152670: 2020 3c2f 7464 3e3c 7464 2063 6c61 7373 alterna │ │ │ │ +001526a0: 7465 2055 5249 2070 6174 7465 726e 2066 te URI pattern f │ │ │ │ +001526b0: 6f72 2074 6865 2058 5344 206e 616d 6573 or the XSD names │ │ │ │ +001526c0: 7061 6365 2028 692e 652e 2055 5249 2069 pace (i.e. URI i │ │ │ │ +001526d0: 7320 616c 736f 2061 6363 6570 7465 6420 s also accepted │ │ │ │ +001526e0: 6279 2074 6865 2058 4d4c 2070 6172 7365 by the XML parse │ │ │ │ +001526f0: 7229 2020 2020 3c2f 7464 3e3c 2f74 723e r) │ │ │ │ +00152700: 0a3c 7472 2063 6c61 7373 3d22 6d61 726b ..import │ │ │ │ +00152750: 3c2f 636f 6465 3e20 2020 3c2f 7464 3e3c < │ │ │ │ +00152760: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ │ +00152770: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ │ +00152780: 3e55 5249 206f 6620 616e 2069 6d70 6f72 >URI of an impor │ │ │ │ +00152790: 7465 6420 6e61 6d65 7370 6163 652c 2061 ted namespace, a │ │ │ │ +001527a0: 7320 616e 2061 6c74 6572 6e61 7469 7665 s an alternative │ │ │ │ +001527b0: 206f 7220 696e 2061 6464 6974 696f 6e20 or in addition │ │ │ │ +001527c0: 746f 203c 636f 6465 3e6e 616d 6573 7061 to namespa │ │ │ │ +001527d0: 6365 3c2f 636f 6465 3e2c 2061 6464 7320 ce, adds │ │ │ │ +001527e0: 3c63 6f64 653e 7873 643a 696d 706f 7274 xsd:import │ │ │ │ +001527f0: 3c2f 636f 6465 3e20 746f 2074 6865 2067 to the g │ │ │ │ +00152800: 656e 6572 6174 6564 2057 5344 4c20 616e enerated WSDL an │ │ │ │ +00152810: 6420 5853 4420 6669 6c65 7320 2020 203c d XSD files < │ │ │ │ +00152820: 2f74 643e 3c2f 7472 3e0a 3c74 7220 636c /td>..form │ │ │ │ +00152880: 2020 3c2f 7464 3e3c 7464 2063 6c61 7373 u │ │ │ │ +001528b0: 6e71 7561 6c69 6669 6564 3c2f 636f 6465 nqualified (default) or < │ │ │ │ +001528d0: 636f 6465 3e71 7561 6c69 6669 6564 3c2f code>qualified local elem │ │ │ │ +001528f0: 656e 7420 616e 6420 6174 7472 6962 7574 ent and attribut │ │ │ │ +00152900: 6520 666f 726d 2064 6566 6175 6c74 7320 e form defaults │ │ │ │ +00152910: 2020 203c 2f74 643e 3c2f 7472 3e0a 3c74 ..< │ │ │ │ +00152940: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ │ +00152950: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ │ +00152960: 3e3c 636f 6465 3e65 6c65 6d65 6e74 466f >elementFo │ │ │ │ +00152970: 726d 3c2f 636f 6465 3e20 2020 3c2f 7464 rm unquali │ │ │ │ +001529b0: 6669 6564 3c2f 636f 6465 3e20 2864 6566 fied (def │ │ │ │ +001529c0: 6175 6c74 2920 6f72 203c 636f 6465 3e71 ault) or q │ │ │ │ +001529d0: 7561 6c69 6669 6564 3c2f 636f 6465 3e20 ualified │ │ │ │ +001529e0: 6c6f 6361 6c20 656c 656d 656e 7420 666f local element fo │ │ │ │ +001529f0: 726d 2064 6566 6175 6c74 2020 2020 3c2f rm default ..attributeForm │ │ │ │ +00152a60: 3c2f 636f 6465 3e20 2020 3c2f 7464 3e3c < │ │ │ │ +00152a70: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ │ +00152a80: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ │ +00152a90: 3e3c 636f 6465 3e75 6e71 7561 6c69 6669 >unqualifi │ │ │ │ +00152aa0: 6564 3c2f 636f 6465 3e20 2864 6566 6175 ed (defau │ │ │ │ +00152ab0: 6c74 2920 6f72 203c 636f 6465 3e71 7561 lt) or qua │ │ │ │ +00152ac0: 6c69 6669 6564 3c2f 636f 6465 3e20 6c6f lified lo │ │ │ │ +00152ad0: 6361 6c20 6174 7472 6962 7574 6520 666f cal attribute fo │ │ │ │ +00152ae0: 726d 2064 6566 6175 6c74 2020 2020 3c2f rm default ..typed │ │ │ │ +00152b50: 203c 2f74 643e 3c74 6420 636c 6173 733d no │ │ │ │ +00152b80: 3c2f 636f 6465 3e20 2864 6566 6175 6c74 (default │ │ │ │ +00152b90: 2920 6f72 203c 636f 6465 3e79 6573 3c2f ) or yes for serial │ │ │ │ +00152bb0: 697a 6572 7320 746f 2061 6464 203c 636f izers to add xsi:type attributes to │ │ │ │ +00152be0: 2058 4d4c 2020 203c 2f74 643e 3c2f 7472 XML ..

    Th │ │ │ │ +00152c00: 6520 3c63 6f64 653e 6e61 6d65 7370 6163 e namespac │ │ │ │ +00152c10: 6532 3c2f 636f 6465 3e20 5552 4920 6973 e2 URI is │ │ │ │ +00152c20: 2061 2070 6174 7465 726e 2077 6974 6820 a pattern with │ │ │ │ +00152c30: 3c63 6f64 653e 2a3c 2f63 6f64 653e 206d * m │ │ │ │ +00152c40: 6174 6368 696e 6720 616e 7920 7365 7175 atching any sequ │ │ │ │ +00152c50: 656e 6365 206f 6620 6368 6172 6163 7465 ence of characte │ │ │ │ +00152c60: 7273 2061 6e64 203c 636f 6465 3e2d 3c2f rs and - matching a │ │ │ │ +00152c80: 6e79 2063 6861 7261 6374 6572 2e20 5468 ny character. Th │ │ │ │ +00152c90: 6973 2070 6174 7465 726e 2069 6e73 7472 is pattern instr │ │ │ │ +00152ca0: 7563 7473 2074 6865 2058 4d4c 2070 6172 ucts the XML par │ │ │ │ +00152cb0: 7365 7220 616e 6420 7661 6c69 6461 746f ser and validato │ │ │ │ +00152cc0: 7220 746f 2061 6c73 6f20 6163 6365 7074 r to also accept │ │ │ │ +00152cd0: 2074 6865 2055 5249 2070 6174 7465 726e the URI pattern │ │ │ │ +00152ce0: 2061 7320 6120 7661 6c69 6420 6e61 6d65 as a valid name │ │ │ │ +00152cf0: 7370 6163 6520 666f 7220 7468 6520 7370 space for the sp │ │ │ │ +00152d00: 6563 6966 6965 6420 3c63 6f64 653e 266c ecified &l │ │ │ │ +00152d10: 743b 7072 6566 6978 2667 743b 3c2f 636f t;prefix>.

    .

    The │ │ │ │ +00152d30: 3c63 6f64 653e 7479 7065 643c 2f63 6f64 typed property is < │ │ │ │ +00152d50: 636f 6465 3e6e 6f3c 2f63 6f64 653e 2062 code>no b │ │ │ │ +00152d60: 7920 6465 6661 756c 7420 616e 6420 6361 y default and ca │ │ │ │ +00152d70: 6e20 6265 2063 6861 6e67 6564 2074 6f20 n be changed to │ │ │ │ +00152d80: 3c63 6f64 653e 7965 733c 2f63 6f64 653e yes │ │ │ │ +00152d90: 2077 6974 6820 3c62 3e3c 636f 6465 3e73 with s │ │ │ │ +00152da0: 6f61 7063 7070 3220 2d74 3c2f 636f 6465 oapcpp2 -t option │ │ │ │ +00152dc0: 3c63 6f64 653e 2d74 3c2f 636f 6465 3e3c -t< │ │ │ │ +00152dd0: 2f62 3e2e 3c2f 703e 0a3c 703e f09f 949d /b>.

    .

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

    .< │ │ │ │ +00152e10: 6833 3e3c 6120 636c 6173 733d 2261 6e63 h3>.Sche │ │ │ │ +00152e40: 6d61 2074 7970 6520 6469 7265 6374 6976 ma type directiv │ │ │ │ +00152e50: 6573 3c2f 6833 3e0a 3c70 3e41 2073 6368 es.

    A sch │ │ │ │ +00152e60: 656d 6120 7479 7065 2064 6972 6563 7469 ema type directi │ │ │ │ +00152e70: 7665 2069 7320 6f66 2074 6865 2066 6f72 ve is of the for │ │ │ │ +00152e80: 6d3a 3c2f 703e 0a3c 6469 7620 636c 6173 m:

    .
    < │ │ │ │ +00152eb0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ +00152ec0: 656e 7422 3e2f 2f67 736f 6170 2026 6c74 ent">//gsoap < │ │ │ │ +00152ed0: 3b70 7265 6669 7826 6774 3b20 7363 6865 ;prefix> sche │ │ │ │ +00152ee0: 6d61 2074 7970 652d 266c 743b 7072 6f70 ma type-<prop │ │ │ │ +00152ef0: 6572 7479 2667 743b 3a20 266c 743b 6e61 erty>: <na │ │ │ │ +00152f00: 6d65 2667 743b 2026 6c74 3b76 616c 7565 me> <value │ │ │ │ +00152f10: 2667 743b 3c2f 7370 616e 3e3c 2f64 6976 >
    .
    //gsoa │ │ │ │ +00152f50: 7020 266c 743b 7072 6566 6978 2667 743b p <prefix> │ │ │ │ +00152f60: 2073 6368 656d 6120 7479 7065 2d26 6c74 schema type-< │ │ │ │ +00152f70: 3b70 726f 7065 7274 7926 6774 3b3a 2026 ;property>: & │ │ │ │ +00152f80: 6c74 3b6e 616d 6526 6774 3b3a 3a26 6c74 lt;name>::< │ │ │ │ +00152f90: 3b6d 656d 6265 7226 6774 3b20 266c 743b ;member> < │ │ │ │ +00152fa0: 7661 6c75 6526 6774 3b3c 2f73 7061 6e3e value> │ │ │ │ +00152fb0: 3c2f 6469 763e 0a3c 2f64 6976 3e3c 212d
    .

    where < │ │ │ │ +00152fe0: 3b70 7265 6669 7826 6774 3b3c 2f63 6f64 ;prefix> is the XML na │ │ │ │ +00153000: 6d65 7370 6163 6520 7072 6566 6978 206f mespace prefix o │ │ │ │ +00153010: 6620 6120 7363 6865 6d61 2061 6e64 203c f a schema and < │ │ │ │ +00153020: 636f 6465 3e26 6c74 3b6e 616d 6526 6774 code><name> │ │ │ │ +00153030: 3b3c 2f63 6f64 653e 2069 7320 616e 2075 ; is an u │ │ │ │ +00153040: 6e71 7561 6c69 6669 6564 206e 616d 6520 nqualified name │ │ │ │ +00153050: 6f66 2061 2043 2f43 2b2b 2074 7970 652c of a C/C++ type, │ │ │ │ +00153060: 2061 6e64 2074 6865 206f 7074 696f 6e61 and the optiona │ │ │ │ +00153070: 6c20 3c63 6f64 653e 266c 743b 6d65 6d62 l <memb │ │ │ │ +00153080: 6572 2667 743b 3c2f 636f 6465 3e20 6973 er> is │ │ │ │ +00153090: 2061 2063 6c61 7373 2f73 7472 7563 7420 a class/struct │ │ │ │ +001530a0: 6d65 6d62 6572 7320 6f72 2065 6e75 6d20 members or enum │ │ │ │ +001530b0: 636f 6e73 7461 6e74 2e3c 2f70 3e0a 3c70 constant.

    .

    You can describ │ │ │ │ +001530d0: 6520 6120 7479 7065 2077 6974 6820 6f6e e a type with on │ │ │ │ +001530e0: 6520 6f66 2074 6865 2066 6f6c 6c6f 7769 e of the followi │ │ │ │ +001530f0: 6e67 3a3c 2f70 3e0a 3c74 6162 6c65 2063 ng:

    ....... │ │ │ │ +001532a0: 3c63 6f64 653e 7479 7065 3c2f 636f 6465 type .
    type prop │ │ │ │ +00153160: 6572 7479 2020 203c 2f74 683e 3c74 6820 erty va │ │ │ │ +00153190: 6c75 6520 2020 203c 2f74 683e 3c2f 7472 lue
    type- │ │ │ │ +001531f0: 646f 6375 6d65 6e74 6174 696f 6e3c 2f63 documentation te │ │ │ │ +00153230: 7874 2064 6573 6372 6962 696e 6720 7468 xt describing th │ │ │ │ +00153240: 6520 7363 6865 6d61 2074 7970 6520 2020 e schema type │ │ │ │ +00153250: 203c 2f74 643e 3c2f 7472 3e0a 3c74 7220
    an al │ │ │ │ +001532e0: 6961 7320 666f 7220 7468 6520 3c63 6f64 ias for the type-documenta │ │ │ │ +00153300: 7469 6f6e 3c2f 636f 6465 3e20 7072 6f70 tion prop │ │ │ │ +00153310: 6572 7479 2020 203c 2f74 643e 3c2f 7472 erty
    .

    Fo │ │ │ │ +00153330: 7220 6578 616d 706c 652c 2079 6f75 2063 r example, you c │ │ │ │ +00153340: 616e 2061 6464 2061 2064 6573 6372 6970 an add a descrip │ │ │ │ +00153350: 7469 6f6e 2074 6f20 616e 2065 6e75 6d65 tion to an enume │ │ │ │ +00153360: 7261 7469 6f6e 3a3c 2f70 3e0a 3c64 6976 ration:

    .
    //gsoa │ │ │ │ +001533b0: 7020 6e73 2073 6368 656d 6120 7479 7065 p ns schema type │ │ │ │ +001533c0: 3a20 566f 7765 6c73 2054 6865 206c 6574 : Vowels The let │ │ │ │ +001533d0: 7465 7273 2041 2c20 452c 2049 2c20 4f2c ters A, E, I, O, │ │ │ │ +001533e0: 2055 2c20 616e 6420 736f 6d65 7469 6d65 U, and sometime │ │ │ │ +001533f0: 7320 593c 2f73 7061 6e3e 3c2f 6469 763e s Y
    │ │ │ │ +00153400: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    //gsoap │ │ │ │ +00153430: 206e 7320 7363 6865 6d61 2074 7970 653a ns schema type: │ │ │ │ +00153440: 2056 6f77 656c 733a 3a59 2041 2076 6f77 Vowels::Y A vow │ │ │ │ +00153450: 656c 2c20 736f 6d65 7469 6d65 733c 2f73 el, sometimes
    .
    enum class ns__Vowels │ │ │ │ +001534b0: 3a20 6368 6172 207b 2041 203d 203c 7370 : char { A = 'A │ │ │ │ +001534e0: 393b 3c2f 7370 616e 3e2c 2045 203d 203c 9;, E = < │ │ │ │ +001534f0: 7370 616e 2063 6c61 7373 3d22 6368 6172 span class="char │ │ │ │ +00153500: 6c69 7465 7261 6c22 3e26 2333 393b 4526 literal">'E& │ │ │ │ +00153510: 2333 393b 3c2f 7370 616e 3e2c 2049 203d #39;, I = │ │ │ │ +00153520: 203c 7370 616e 2063 6c61 7373 3d22 6368 ' │ │ │ │ +00153540: 4926 2333 393b 3c2f 7370 616e 3e2c 204f I', O │ │ │ │ +00153550: 203d 203c 7370 616e 2063 6c61 7373 3d22 =  │ │ │ │ +00153570: 393b 4f26 2333 393b 3c2f 7370 616e 3e2c 9;O', │ │ │ │ +00153580: 2055 203d 203c 7370 616e 2063 6c61 7373 U = & │ │ │ │ +001535a0: 2333 393b 5526 2333 393b 3c2f 7370 616e #39;U', Y = 'Y' };
    .

    This docu │ │ │ │ +00153610: 6d65 6e74 6564 2065 6e75 6d65 7261 7469 mented enumerati │ │ │ │ +00153620: 6f6e 206d 6170 7320 746f 2061 2073 696d on maps to a sim │ │ │ │ +00153630: 706c 6554 7970 6520 7265 7374 7269 6374 pleType restrict │ │ │ │ +00153640: 696f 6e20 6f66 203c 656d 3e3c 636f 6465 ion of xsd:string in the s │ │ │ │ +00153670: 6f61 7063 7070 322d 6765 6e65 7261 7465 oapcpp2-generate │ │ │ │ +00153680: 6420 7363 6865 6d61 3a3c 2f70 3e0a 3c64 d schema:

    . │ │ │ │ +001536a0: 3c64 6976 2063 6c61 7373 3d22 6672 6167
    <simpleType │ │ │ │ +001536f0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c na │ │ │ │ +00153710: 6d65 3c2f 7370 616e 3e3d 3c73 7061 6e20 me="Vowe │ │ │ │ +00153740: 6c73 2671 756f 743b 3c2f 7370 616e 3e26 ls"& │ │ │ │ +00153750: 6774 3b3c 2f64 6976 3e0a 3c64 6976 2063 gt;
    .
    &l │ │ │ │ +00153770: 743b 3c73 7061 6e20 636c 6173 733d 226b t;anno │ │ │ │ +00153790: 7461 7469 6f6e 3c2f 7370 616e 3e26 6774 tation> │ │ │ │ +001537a0: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
    .
    &l │ │ │ │ +001537c0: 743b 3c73 7061 6e20 636c 6173 733d 226b t;docu │ │ │ │ +001537e0: 6d65 6e74 6174 696f 6e3c 2f73 7061 6e3e mentation │ │ │ │ +001537f0: 2667 743b 3c73 7061 6e20 636c 6173 733d >The lette │ │ │ │ +00153830: 7273 3c2f 7370 616e 3e20 3c73 7061 6e20 rs │ │ │ │ +00153850: 413c 2f73 7061 6e3e 2c20 3c73 7061 6e20 A, │ │ │ │ +00153870: 453c 2f73 7061 6e3e 2c20 3c73 7061 6e20 E, │ │ │ │ +00153890: 493c 2f73 7061 6e3e 2c20 3c73 7061 6e20 I, │ │ │ │ +001538b0: 4f3c 2f73 7061 6e3e 2c20 3c73 7061 6e20 O, │ │ │ │ +001538d0: 553c 2f73 7061 6e3e 2c20 3c73 7061 6e20 U, │ │ │ │ +001538f0: 616e 643c 2f73 7061 6e3e 203c 7370 616e and sometimes Y │ │ │ │ +00153940: 266c 743b 2f3c 7370 616e 2063 6c61 7373 </d │ │ │ │ +00153960: 6f63 756d 656e 7461 7469 6f6e 3c2f 7370 ocumentation>
    . │ │ │ │ +00153990: 2020 266c 743b 2f3c 7370 616e 2063 6c61 </annotation>
    . │ │ │ │ +001539e0: 2026 6c74 3b3c 7370 616e 2063 6c61 7373 <r │ │ │ │ +00153a00: 6573 7472 6963 7469 6f6e 3c2f 7370 616e estriction base= │ │ │ │ +00153a50: 2671 756f 743b 7873 643a 7374 7269 6e67 "xsd:string │ │ │ │ +00153a60: 2671 756f 743b 3c2f 7370 616e 3e26 6774 "> │ │ │ │ +00153a70: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
    .
    &l │ │ │ │ +00153a90: 743b 3c73 7061 6e20 636c 6173 733d 226b t;enum │ │ │ │ +00153ab0: 6572 6174 696f 6e3c 2f73 7061 6e3e 203c eration < │ │ │ │ +00153ac0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +00153ad0: 6f72 6422 3e76 616c 7565 3c2f 7370 616e ord">value=&q │ │ │ │ +00153b00: 756f 743b 4126 7175 6f74 3b3c 2f73 7061 uot;A"/>
    . │ │ │ │ +00153b30: 2020 2020 266c 743b 3c73 7061 6e20 636c <enumeration
    value │ │ │ │ +00153b80: 3c2f 7370 616e 3e3d 3c73 7061 6e20 636c ="E" │ │ │ │ +00153bb0: 3b3c 2f73 7061 6e3e 2f26 6774 3b3c 2f64 ;/>.
    <enumerat │ │ │ │ +00153c00: 696f 6e3c 2f73 7061 6e3e 203c 7370 616e ion value=" │ │ │ │ +00153c50: 4926 7175 6f74 3b3c 2f73 7061 6e3e 2f26 I"/& │ │ │ │ +00153c60: 6774 3b3c 2f64 6976 3e0a 3c64 6976 2063 gt;
    .
    │ │ │ │ +00153c80: 266c 743b 3c73 7061 6e20 636c 6173 733d <en │ │ │ │ +00153ca0: 756d 6572 6174 696f 6e3c 2f73 7061 6e3e umeration │ │ │ │ +00153cb0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 value= │ │ │ │ +00153cf0: 2671 756f 743b 4f26 7175 6f74 3b3c 2f73 "O"/>
    . │ │ │ │ +00153d10: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    <enumeration< │ │ │ │ +00153d50: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> val │ │ │ │ +00153d70: 7565 3c2f 7370 616e 3e3d 3c73 7061 6e20 ue="U&qu │ │ │ │ +00153da0: 6f74 3b3c 2f73 7061 6e3e 2f26 6774 3b3c ot;/>< │ │ │ │ +00153db0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    < │ │ │ │ +00153dd0: 3c73 7061 6e20 636c 6173 733d 226b 6579 enumer │ │ │ │ +00153df0: 6174 696f 6e3c 2f73 7061 6e3e 203c 7370 ation value= │ │ │ │ +00153e20: 3c73 7061 6e20 636c 6173 733d 2273 7472 &quo │ │ │ │ +00153e40: 743b 5926 7175 6f74 3b3c 2f73 7061 6e3e t;Y" │ │ │ │ +00153e50: 2667 743b 3c2f 6469 763e 0a3c 6469 7620 >
    .
    │ │ │ │ +00153e70: 2020 2026 6c74 3b3c 7370 616e 2063 6c61 <annotation>
    . │ │ │ │ +00153ec0: 2020 2020 2020 2026 6c74 3b3c 7370 616e <documentati │ │ │ │ +00153ef0: 6f6e 3c2f 7370 616e 3e26 6774 3b3c 7370 on>A
    vowel, │ │ │ │ +00153f40: 3c73 7061 6e20 636c 6173 733d 226b 6579 sometimes< │ │ │ │ +00153f60: 2f73 7061 6e3e 266c 743b 2f3c 7370 616e /span></documentati │ │ │ │ +00153f90: 6f6e 3c2f 7370 616e 3e26 6774 3b3c 2f64 on>.
    < │ │ │ │ +00153fc0: 2f3c 7370 616e 2063 6c61 7373 3d22 6b65 /annot │ │ │ │ +00153fe0: 6174 696f 6e3c 2f73 7061 6e3e 2667 743b ation> │ │ │ │ +00153ff0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    < │ │ │ │ +00154010: 3b3c 7370 616e 2063 6c61 7373 3d22 6b65 ;enume │ │ │ │ +00154030: 7261 7469 6f6e 3c2f 7370 616e 3e2f 2667 ration/&g │ │ │ │ +00154040: 743b 3c2f 6469 763e 0a3c 6469 7620 636c t;
    .
    < │ │ │ │ +00154060: 3b2f 3c73 7061 6e20 636c 6173 733d 226b ;/rest │ │ │ │ +00154080: 7269 6374 696f 6e3c 2f73 7061 6e3e 2667 riction&g │ │ │ │ +00154090: 743b 3c2f 6469 763e 0a3c 6469 7620 636c t;
    .
    </ │ │ │ │ +001540b0: 3c73 7061 6e20 636c 6173 733d 226b 6579 simple │ │ │ │ +001540d0: 5479 7065 3c2f 7370 616e 3e26 6774 3b3c Type>< │ │ │ │ +001540e0: 2f64 6976 3e0a 3c2f 6469 763e 3c21 2d2d /div>.

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

    .

    < │ │ │ │ +00154160: 2f61 3e0a 4578 616d 706c 653c 2f68 333e /a>.Example

    │ │ │ │ +00154170: 0a3c 703e 5468 6520 7573 6520 6f66 2064 .

    The use of d │ │ │ │ +00154180: 6972 6563 7469 7665 7320 6973 2062 6573 irectives is bes │ │ │ │ +00154190: 7420 696c 6c75 7374 7261 7465 6420 7769 t illustrated wi │ │ │ │ +001541a0: 7468 2061 6e20 6578 616d 706c 652e 2054 th an example. T │ │ │ │ +001541b0: 6865 2065 7861 6d70 6c65 2075 7365 7320 he example uses │ │ │ │ +001541c0: 6120 6879 706f 7468 6574 6963 616c 2073 a hypothetical s │ │ │ │ +001541d0: 746f 636b 2071 756f 7465 2073 6572 7669 tock quote servi │ │ │ │ +001541e0: 6365 2061 6e64 2065 7863 6861 6e67 6520 ce and exchange │ │ │ │ +001541f0: 7261 7465 2073 6572 7669 6365 2c20 6163 rate service, ac │ │ │ │ +00154200: 7475 616c 2073 6572 7669 6365 7320 7375 tual services su │ │ │ │ +00154210: 6368 2061 7320 7468 6573 6520 6172 6520 ch as these are │ │ │ │ +00154220: 6176 6169 6c61 626c 6520 666f 7220 6672 available for fr │ │ │ │ +00154230: 6565 206f 6e20 7468 6520 7765 622e 3c2f ee on the web..

    //gsoap ns1 ser │ │ │ │ +00154290: 7669 6365 206e 616d 6573 7061 6365 3a20 vice namespace: │ │ │ │ +001542a0: 2075 726e 3a47 6574 5175 6f74 6520 3c2f urn:GetQuote
    .
    int ns1__getQuote │ │ │ │ +00154300: 283c 7370 616e 2063 6c61 7373 3d22 6b65 (char< │ │ │ │ +00154320: 2f73 7061 6e3e 202a 7379 6d62 6f6c 2c20 /span> *symbol, │ │ │ │ +00154330: 3c73 7061 6e20 636c 6173 733d 226b 6579 float< │ │ │ │ +00154350: 2f73 7061 6e3e 2026 616d 703b 7265 7375 /span> &resu │ │ │ │ +00154360: 6c74 293b 203c 2f64 6976 3e0a 3c64 6976 lt);
    .
    < │ │ │ │ +00154380: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    // │ │ │ │ +001543b0: 6773 6f61 7020 6e73 3220 7365 7276 6963 gsoap ns2 servic │ │ │ │ +001543c0: 6520 6e61 6d65 7370 6163 653a 2020 7572 e namespace: ur │ │ │ │ +001543d0: 6e3a 4375 7272 656e 6379 4578 6368 616e n:CurrencyExchan │ │ │ │ +001543e0: 6765 203c 2f73 7061 6e3e 3c2f 6469 763e ge
    │ │ │ │ +001543f0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    int │ │ │ │ +00154420: 3c2f 7370 616e 3e20 6e73 325f 5f67 6574 ns2__get │ │ │ │ +00154430: 5261 7465 283c 7370 616e 2063 6c61 7373 Rate(c │ │ │ │ +00154450: 6861 723c 2f73 7061 6e3e 202a 636f 756e har *coun │ │ │ │ +00154460: 7472 7931 2c20 3c73 7061 6e20 636c 6173 try1, │ │ │ │ +00154480: 6368 6172 3c2f 7370 616e 3e20 2a63 6f75 char *cou │ │ │ │ +00154490: 6e74 7279 322c 203c 7370 616e 2063 6c61 ntry2, float &a │ │ │ │ +001544c0: 6d70 3b72 6573 756c 7429 3b20 3c2f 6469 mp;result); .
    .< │ │ │ │ +00154500: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ +00154510: 656e 7422 3e2f 2f67 736f 6170 206e 7333 ent">//gsoap ns3 │ │ │ │ +00154520: 2073 6572 7669 6365 206e 616d 653a 2020 service name: │ │ │ │ +00154530: 2020 2020 2071 756f 7465 7820 3c2f 7370 quotex
    .
    //gsoap ns3 se │ │ │ │ +00154580: 7276 6963 6520 7374 796c 653a 2020 2020 rvice style: │ │ │ │ +00154590: 2020 7270 6320 3c2f 7370 616e 3e3c 2f64 rpc .
    //gs │ │ │ │ +001545d0: 6f61 7020 6e73 3320 7365 7276 6963 6520 oap ns3 service │ │ │ │ +001545e0: 656e 636f 6469 6e67 3a20 2020 656e 636f encoding: enco │ │ │ │ +001545f0: 6465 6420 3c2f 7370 616e 3e3c 2f64 6976 ded
    .
    //gsoa │ │ │ │ +00154630: 7020 6e73 3320 7365 7276 6963 6520 706f p ns3 service po │ │ │ │ +00154640: 7274 3a20 2020 2020 2020 6874 7470 3a2f rt: http:/ │ │ │ │ +00154650: 2f77 7777 2e6d 7964 6f6d 6169 6e2e 636f /www.mydomain.co │ │ │ │ +00154660: 6d2f 7175 6f74 6578 2e63 6769 203c 2f73 m/quotex.cgi
    .
    //gsoap ns3 s │ │ │ │ +001546b0: 6572 7669 6365 206e 616d 6573 7061 6365 ervice namespace │ │ │ │ +001546c0: 3a20 2075 726e 3a71 756f 7465 7820 3c2f : urn:quotex
    .
    int ns3__getQuote │ │ │ │ +00154720: 283c 7370 616e 2063 6c61 7373 3d22 6b65 (char< │ │ │ │ +00154740: 2f73 7061 6e3e 202a 7379 6d62 6f6c 2c20 /span> *symbol, │ │ │ │ +00154750: 3c73 7061 6e20 636c 6173 733d 226b 6579 char *country, │ │ │ │ +00154780: 3c73 7061 6e20 636c 6173 733d 226b 6579 float< │ │ │ │ +001547a0: 2f73 7061 6e3e 2026 616d 703b 7265 7375 /span> &resu │ │ │ │ +001547b0: 6c74 293b 3c2f 6469 763e 0a3c 2f64 6976 lt);
    .
    < │ │ │ │ +001553a0: 703e 4f6e 6c79 2074 6865 203c 636f 6465 p>Only the name mem │ │ │ │ +001553c0: 6265 7220 6973 2073 6572 6961 6c69 7a65 ber is serialize │ │ │ │ +001553d0: 6420 6f66 203c 636f 6465 3e6e 735f 5f72 d of ns__r │ │ │ │ +001553e0: 6563 6f72 643c 2f63 6f64 653e 2e3c 2f70 ecord.

    .

    Another exa │ │ │ │ +00155400: 6d70 6c65 3a3c 2f70 3e0a 3c64 6976 2063 mple:

    .
    │ │ │ │ +00155420: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    extern clas │ │ │ │ +00155470: 7320 3c2f 7370 616e 3e73 7464 3a3a 6f73 s std::os │ │ │ │ +00155480: 7472 6561 6d3b 203c 7370 616e 2063 6c61 tream; // │ │ │ │ +001554a0: 7374 643a 3a6f 7374 7265 616d 2063 616e std::ostream can │ │ │ │ +001554b0: 2623 3339 3b74 2062 6520 7365 7269 616c 't be serial │ │ │ │ +001554c0: 697a 6564 2c20 6275 7420 6e65 6564 2074 ized, but need t │ │ │ │ +001554d0: 6f20 6265 2064 6563 6c61 7265 643c 2f73 o be declared
    .
    class │ │ │ │ +00155520: 6e73 5f5f 6d79 436c 6173 7320 3c2f 6469 ns__myClass .
    { pub │ │ │ │ +00155560: 6c69 633c 2f73 7061 6e3e 3a3c 2f64 6976 lic:
    .
    vi │ │ │ │ +001555a0: 7274 7561 6c3c 2f73 7061 6e3e 203c 7370 rtual void print(std::os │ │ │ │ +001555e0: 7472 6561 6d20 2661 6d70 3b73 2920 3c73 tream &s) const │ │ │ │ +00155610: 3b20 3c73 7061 6e20 636c 6173 733d 2263 ; // need │ │ │ │ +00155630: 6f73 7472 6561 6d20 6865 7265 203c 2f73 ostream here
    .
    │ │ │ │ +00155660: 202e 2e2e 203c 7370 616e 2063 6c61 7373 ... //
    .
    };< │ │ │ │ +001556a0: 2f64 6976 3e0a 3c2f 6469 763e 3c21 2d2d /div>.

    │ │ │ │ +001556c0: 496e 206f 7468 6572 2063 6173 6573 2077 In other cases w │ │ │ │ +001556d0: 6520 646f 2077 616e 7420 746f 2064 6563 e do want to dec │ │ │ │ +001556e0: 6c61 7265 2061 2074 7970 6520 7468 6174 lare a type that │ │ │ │ +001556f0: 2073 6f61 7063 7070 3220 7368 6f75 6c64 soapcpp2 should │ │ │ │ +00155700: 2063 6f70 7920 696e 746f 203c 656d 3e3c copy into < │ │ │ │ +00155710: 636f 6465 3e73 6f61 7053 7475 622e 683c code>soapStub.h< │ │ │ │ +00155720: 2f63 6f64 653e 3c2f 656d 3e20 666f 7220 /code> for │ │ │ │ +00155730: 7468 6520 6170 706c 6963 6174 696f 6e20 the application │ │ │ │ +00155740: 736f 7572 6365 2063 6f64 652c 2062 7574 source code, but │ │ │ │ +00155750: 2077 6869 6368 2073 686f 756c 6420 6e6f which should no │ │ │ │ +00155760: 7420 6265 2073 6572 6961 6c69 7a61 626c t be serializabl │ │ │ │ +00155770: 652e 2057 6520 6361 6e20 7573 6520 3c63 e. We can use extern for this or pu │ │ │ │ +001557a0: 7420 7468 6520 6465 636c 6172 6174 696f t the declaratio │ │ │ │ +001557b0: 6e20 696e 203c 636f 6465 3e5b 3c2f 636f n in [ and ]< │ │ │ │ +001557d0: 2f63 6f64 653e 2062 7261 636b 6574 733a /code> brackets: │ │ │ │ +001557e0: 3c2f 703e 0a3c 6469 7620 636c 6173 733d

    .
    [ < │ │ │ │ +00155810: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    │ │ │ │ +00155840: 636c 6173 7320 3c2f 7370 616e 3e6e 735f class ns_ │ │ │ │ +00155850: 5f6d 7942 6173 6520 3c73 7061 6e20 636c _myBase // │ │ │ │ +00155870: 2062 6173 6520 636c 6173 7320 6e65 6564 base class need │ │ │ │ +00155880: 206e 6f74 2062 6520 7365 7269 616c 697a not be serializ │ │ │ │ +00155890: 6162 6c65 3c2f 7370 616e 3e3c 2f64 6976 able
    .
    {
    . │ │ │ │ +001558d0: 2020 2020 2e2e 2e20 3c73 7061 6e20 636c ... // │ │ │ │ +001558f0: 206d 656d 6265 7273 3c2f 7370 616e 3e3c members< │ │ │ │ +00155900: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    }; .
    ]
    .< │ │ │ │ +00155940: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00155950: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >class ns__myDerive │ │ │ │ +00155980: 6420 3a20 6e73 5f5f 6d79 4261 7365 203c d : ns__myBase < │ │ │ │ +00155990: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    {
    . │ │ │ │ +001559b0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    ... // │ │ │ │ +001559e0: 206d 656d 6265 7273 3c2f 7370 616e 3e3c members< │ │ │ │ +001559f0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    };
    .

    We c │ │ │ │ +00155a30: 616e 2075 7365 203c 636f 6465 3e5b 3c2f an use [ and │ │ │ │ +00155a50: 5d3c 2f63 6f64 653e 2062 7261 636b 6574 ] bracket │ │ │ │ +00155a60: 7320 666f 7220 7061 7274 7320 6f66 2074 s for parts of t │ │ │ │ +00155a70: 6865 2063 6f64 652c 2066 6f72 2065 7861 he code, for exa │ │ │ │ +00155a80: 6d70 6c65 2074 6f20 6d61 6b65 2073 6576 mple to make sev │ │ │ │ +00155a90: 6572 616c 2063 6c61 7373 206d 656d 6265 eral class membe │ │ │ │ +00155aa0: 7273 2074 7261 6e73 6965 6e74 3a3c 2f70 rs transient:

    .
    [ typedef │ │ │ │ +00155b00: 203c 7370 616e 2063 6c61 7373 3d22 6b65 int transientI │ │ │ │ +00155b30: 6e74 3b20 5d20 3c2f 6469 763e 0a3c 6469 nt; ]
    .< │ │ │ │ +00155b50: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +00155b60: 6f72 6422 3e63 6c61 7373 203c 2f73 7061 ord">class ns__myClass .
    {
    .< │ │ │ │ +00155ba0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00155bb0: 3e20 203c 7370 616e 2063 6c61 7373 3d22 > int │ │ │ │ +00155bd0: 3c2f 7370 616e 3e20 613b 203c 7370 616e a; // will be seri │ │ │ │ +00155c00: 616c 697a 6564 203c 2f73 7061 6e3e 3c2f alized .
    [
    .
    │ │ │ │ +00155c60: 696e 743c 2f73 7061 6e3e 2062 3b20 3c73 int b; // transient │ │ │ │ +00155c90: 206d 656d 6265 7220 3c2f 7370 616e 3e3c member < │ │ │ │ +00155ca0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    char │ │ │ │ +00155ce0: 735b 3235 365d 3b20 3c73 7061 6e20 636c s[256]; // │ │ │ │ +00155d00: 2074 7261 6e73 6965 6e74 206d 656d 6265 transient membe │ │ │ │ +00155d10: 7220 3c2f 7370 616e 3e3c 2f64 6976 3e0a r
    . │ │ │ │ +00155d20: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    ]
    . │ │ │ │ +00155d50: 2020 3c73 7061 6e20 636c 6173 733d 226b extern │ │ │ │ +00155d90: 666c 6f61 743c 2f73 7061 6e3e 2064 3b20 float d; │ │ │ │ +00155da0: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // transie │ │ │ │ +00155dc0: 6e74 2074 7970 6520 666c 6f61 7420 616e nt type float an │ │ │ │ +00155dd0: 6420 6d65 6d62 6572 3c2f 7370 616e 3e3c d member< │ │ │ │ +00155de0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    char │ │ │ │ +00155e20: 2a74 3b20 3c73 7061 6e20 636c 6173 733d *t; // wil │ │ │ │ +00155e40: 6c20 6265 2073 6572 6961 6c69 7a65 6420 l be serialized │ │ │ │ +00155e50: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ │ +00155e70: 2020 7472 616e 7369 656e 7449 6e74 202a transientInt * │ │ │ │ +00155e80: 6e3b 203c 7370 616e 2063 6c61 7373 3d22 n; // tran │ │ │ │ +00155ea0: 7369 656e 7420 7479 7065 2069 6e74 2061 sient type int a │ │ │ │ +00155eb0: 6e64 206d 656d 6265 7220 3c2f 7370 616e nd member
    .
    [ .
    v │ │ │ │ +00155f10: 6972 7475 616c 3c2f 7370 616e 3e20 3c73 irtual void method(char │ │ │ │ +00155f70: 2062 7566 5b31 3032 345d 293b 203c 7370 buf[1024]); // does not c │ │ │ │ +00155fa0: 7265 6174 6520 6120 6368 6172 5b31 3032 reate a char[102 │ │ │ │ +00155fb0: 345d 2073 6572 6961 6c69 7a65 7220 3c2f 4] serializer
    .
    │ │ │ │ +00155fe0: 5d20 203c 2f64 6976 3e0a 3c64 6976 2063 ]
    .
    };.

    I │ │ │ │ +00156020: 6e20 7468 6973 2065 7861 6d70 6c65 2c20 n this example, │ │ │ │ +00156030: 3c63 6f64 653e 6e73 5f5f 6d79 436c 6173 ns__myClas │ │ │ │ +00156040: 733c 2f63 6f64 653e 2068 6173 2074 6872 s has thr │ │ │ │ +00156050: 6565 2074 7261 6e73 6965 6e74 206d 656d ee transient mem │ │ │ │ +00156060: 6265 7273 3a20 3c63 6f64 653e 623c 2f63 bers: b, s, and │ │ │ │ +00156090: 6e3c 2f63 6f64 653e 2077 6869 6368 2077 n which w │ │ │ │ +001560a0: 696c 6c20 6e6f 7420 6265 2073 6572 6961 ill not be seria │ │ │ │ +001560b0: 6c69 7a65 642e 204d 656d 6265 7220 3c63 lized. Member n is │ │ │ │ +001560d0: 7472 616e 7369 656e 7420 6265 6361 7573 transient becaus │ │ │ │ +001560e0: 6520 7468 6520 7479 7065 2069 7320 6465 e the type is de │ │ │ │ +001560f0: 636c 6172 6564 2077 6974 6869 6e20 6120 clared within a │ │ │ │ +00156100: 7472 616e 7369 656e 7420 626c 6f63 6b2e transient block. │ │ │ │ +00156110: 2050 6f69 6e74 6572 732c 2072 6566 6572 Pointers, refer │ │ │ │ +00156120: 656e 6365 732c 2061 6e64 2061 7272 6179 ences, and array │ │ │ │ +00156130: 7320 6f66 2074 7261 6e73 6965 6e74 2074 s of transient t │ │ │ │ +00156140: 7970 6573 2061 7265 2074 7261 6e73 6965 ypes are transie │ │ │ │ +00156150: 6e74 2e20 5468 6520 7369 6e67 6c65 2063 nt. The single c │ │ │ │ +00156160: 6c61 7373 206d 6574 686f 6420 6973 2065 lass method is e │ │ │ │ +00156170: 6e63 6170 7375 6c61 7465 6420 7769 7468 ncapsulated with │ │ │ │ +00156180: 696e 203c 636f 6465 3e5b 3c2f 636f 6465 in [ and ] to prevent │ │ │ │ +001561b0: 736f 6170 6370 7032 2066 726f 6d20 6372 soapcpp2 from cr │ │ │ │ +001561c0: 6561 7469 6e67 2073 6572 6961 6c69 7a65 eating serialize │ │ │ │ +001561d0: 7273 2066 6f72 2074 6865 203c 636f 6465 rs for the char[1024] type.

    .

    │ │ │ │ +00156200: 5765 2061 6c73 6f20 7573 6520 3c63 6f64 We also use [ and < │ │ │ │ +00156220: 636f 6465 3e5d 3c2f 636f 6465 3e20 6272 code>] br │ │ │ │ +00156230: 6163 6b65 7473 2074 6f20 696e 7472 6f64 ackets to introd │ │ │ │ +00156240: 7563 6520 6120 7472 616e 7369 656e 7420 uce a transient │ │ │ │ +00156250: 696e 7465 6765 7220 7479 7065 203c 636f integer type transientInt< │ │ │ │ +00156270: 2f63 6f64 653e 2075 7369 6e67 2061 2074 /code> using a t │ │ │ │ +00156280: 7970 6564 6566 2e20 5765 2063 616e 6e6f ypedef. We canno │ │ │ │ +00156290: 7420 7573 6520 3c63 6f64 653e 6578 7465 t use exte │ │ │ │ +001562a0: 726e 3c2f 636f 6465 3e20 7769 7468 203c rn with < │ │ │ │ +001562b0: 636f 6465 3e74 7970 6564 6566 3c2f 636f code>typedef because this │ │ │ │ +001562d0: 2063 6f6e 7374 7275 6374 2069 7320 7265 construct is re │ │ │ │ +001562e0: 7365 7276 6564 2066 6f72 2063 7573 746f served for custo │ │ │ │ +001562f0: 6d20 7365 7269 616c 697a 6572 732e 3c2f m serializers..

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

    .

    .Serialization │ │ │ │ +00156370: 2261 7320 6973 2220 6f66 2076 6f6c 6174 "as is" of volat │ │ │ │ +00156380: 696c 6520 6461 7461 2074 7970 6573 3c2f ile data types.

    Types dec │ │ │ │ +001563a0: 6c61 7265 6420 3c63 6f64 653e 766f 6c61 lared vola │ │ │ │ +001563b0: 7469 6c65 3c2f 636f 6465 3e20 696e 2061 tile in a │ │ │ │ +001563c0: 6e20 696e 7465 7266 6163 6520 6865 6164 n interface head │ │ │ │ +001563d0: 6572 2066 696c 6520 6172 6520 7365 7269 er file are seri │ │ │ │ +001563e0: 616c 697a 6162 6c65 2062 7574 206e 6f74 alizable but not │ │ │ │ +001563f0: 2063 6f70 6965 6420 6279 2073 6f61 7063 copied by soapc │ │ │ │ +00156400: 7070 3220 746f 203c 656d 3e3c 636f 6465 pp2 to soapStub.h. These t │ │ │ │ +00156430: 7970 6573 2061 7265 2074 7970 6963 616c ypes are typical │ │ │ │ +00156440: 6c79 206c 6962 7261 7279 2074 7970 6573 ly library types │ │ │ │ +00156450: 2074 6861 7420 6172 6520 696e 636c 7564 that are includ │ │ │ │ +00156460: 6564 2069 6e20 7468 6520 736f 7572 6365 ed in the source │ │ │ │ +00156470: 2063 6f64 6520 616e 6420 7368 6f75 6c64 code and should │ │ │ │ +00156480: 206e 6f74 2062 6520 7265 6465 6669 6e65 not be redefine │ │ │ │ +00156490: 6420 696e 2074 6865 2061 7070 6c69 6361 d in the applica │ │ │ │ +001564a0: 7469 6f6e 2073 6f75 7263 6520 636f 6465 tion source code │ │ │ │ +001564b0: 2e20 5765 2077 616e 7420 746f 2073 6572 . We want to ser │ │ │ │ +001564c0: 6961 6c69 7a65 2074 6865 7365 206c 6962 ialize these lib │ │ │ │ +001564d0: 7261 7279 2074 7970 6573 2022 6173 2069 rary types "as i │ │ │ │ +001564e0: 7322 2077 6974 686f 7574 2072 6564 6566 s" without redef │ │ │ │ +001564f0: 696e 696e 6720 7468 656d 2e3c 2f70 3e0a ining them.

    . │ │ │ │ +00156500: 3c70 3e43 6f6e 7369 6465 7220 666f 7220

    Consider for │ │ │ │ +00156510: 6578 616d 706c 6520 3c63 6f64 653e 7374 example st │ │ │ │ +00156520: 7275 6374 2074 6d3c 2f63 6f64 653e 2c20 ruct tm, │ │ │ │ +00156530: 6465 636c 6172 6564 2069 6e20 3c65 6d3e declared in │ │ │ │ +00156540: 3c63 6f64 653e 7469 6d65 2e68 3c2f 636f time.h. The st │ │ │ │ +00156560: 7275 6374 7572 6520 6d61 7920 6163 7475 ructure may actu │ │ │ │ +00156570: 616c 6c79 2076 6172 7920 6265 7477 6565 ally vary betwee │ │ │ │ +00156580: 6e20 706c 6174 666f 726d 732c 2062 7574 n platforms, but │ │ │ │ +00156590: 2074 6865 203c 636f 6465 3e74 6d3c 2f63 the tm structure i │ │ │ │ +001565b0: 6e63 6c75 6465 7320 6174 206c 6561 7374 ncludes at least │ │ │ │ +001565c0: 2074 6865 2066 6f6c 6c6f 7769 6e67 206d the following m │ │ │ │ +001565d0: 656d 6265 7273 2061 7320 6465 636c 6172 embers as declar │ │ │ │ +001565e0: 6564 2069 6e20 7468 6520 666f 6c6c 6f77 ed in the follow │ │ │ │ +001565f0: 696e 6720 696e 7465 7266 6163 6520 6865 ing interface he │ │ │ │ +00156600: 6164 6572 2066 696c 6520 666f 7220 736f ader file for so │ │ │ │ +00156610: 6170 6370 7032 3a3c 2f70 3e0a 3c64 6976 apcpp2:

    .
    # │ │ │ │ +00156660: 696e 636c 7564 6520 266c 743b 7469 6d65 include <time │ │ │ │ +00156670: 2e68 2667 743b 3c2f 7370 616e 3e3c 2f64 .h>.
    vola │ │ │ │ +001566b0: 7469 6c65 3c2f 7370 616e 3e20 3c73 7061 tile struct │ │ │ │ +001566e0: 746d 203c 2f64 6976 3e0a 3c64 6976 2063 tm
    .
    {.
    int t │ │ │ │ +00156740: 6d5f 7365 633b 2020 2020 2020 2020 203c m_sec; < │ │ │ │ +00156750: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ +00156760: 656e 7422 3e2f 2a20 7365 636f 6e64 7320 ent">/* seconds │ │ │ │ +00156770: 2830 202d 2036 3029 202a 2f3c 2f73 7061 (0 - 60) */
    .
    │ │ │ │ +001567a0: 3c73 7061 6e20 636c 6173 733d 226b 6579 int tm_min; │ │ │ │ +001567d0: 2020 2020 203c 7370 616e 2063 6c61 7373 /* mi │ │ │ │ +001567f0: 6e75 7465 7320 2830 202d 2035 3929 202a nutes (0 - 59) * │ │ │ │ +00156800: 2f3c 2f73 7061 6e3e 203c 2f64 6976 3e0a /
    . │ │ │ │ +00156810: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    │ │ │ │ +00156840: 696e 743c 2f73 7061 6e3e 2074 6d5f 686f int tm_ho │ │ │ │ +00156850: 7572 3b20 2020 2020 2020 203c 7370 616e ur; /* hours (0 - 2 │ │ │ │ +00156880: 3329 202a 2f3c 2f73 7061 6e3e 203c 2f64 3) */ .
    int t │ │ │ │ +001568d0: 6d5f 6d64 6179 3b20 2020 2020 2020 203c m_mday; < │ │ │ │ +001568e0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ +001568f0: 656e 7422 3e2f 2a20 6461 7920 6f66 206d ent">/* day of m │ │ │ │ +00156900: 6f6e 7468 2028 3120 2d20 3331 2920 2a2f onth (1 - 31) */ │ │ │ │ +00156910: 3c2f 7370 616e 3e20 3c2f 6469 763e 0a3c
    .< │ │ │ │ +00156920: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00156930: 3e20 2020 203c 7370 616e 2063 6c61 7373 > i │ │ │ │ +00156950: 6e74 3c2f 7370 616e 3e20 746d 5f6d 6f6e nt tm_mon │ │ │ │ +00156960: 3b20 2020 2020 2020 2020 3c73 7061 6e20 ; │ │ │ │ +00156980: 2f2a 206d 6f6e 7468 206f 6620 7965 6172 /* month of year │ │ │ │ +00156990: 2028 3020 2d20 3131 2920 2a2f 3c2f 7370 (0 - 11) */
    .
    │ │ │ │ +001569c0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 int tm_year; │ │ │ │ +001569f0: 2020 2020 2020 3c73 7061 6e20 636c 6173 /* y │ │ │ │ +00156a10: 6561 7220 2d20 3139 3030 202a 2f3c 2f73 ear - 1900 */
    .
    │ │ │ │ +00156a40: 2020 3c73 7061 6e20 636c 6173 733d 226b int< │ │ │ │ +00156a60: 2f73 7061 6e3e 2074 6d5f 7764 6179 3b20 /span> tm_wday; │ │ │ │ +00156a70: 2020 2020 2020 203c 7370 616e 2063 6c61 /* │ │ │ │ +00156a90: 6461 7920 6f66 2077 6565 6b20 2853 756e day of week (Sun │ │ │ │ +00156aa0: 6461 7920 3d20 3029 202a 2f3c 2f73 7061 day = 0) */
    .
    │ │ │ │ +00156ad0: 3c73 7061 6e20 636c 6173 733d 226b 6579 int tm_yday; │ │ │ │ +00156b00: 2020 2020 203c 7370 616e 2063 6c61 7373 /* da │ │ │ │ +00156b20: 7920 6f66 2079 6561 7220 2830 202d 2033 y of year (0 - 3 │ │ │ │ +00156b30: 3635 2920 2a2f 3c2f 7370 616e 3e20 3c2f 65) */ .
    int │ │ │ │ +00156b80: 746d 5f69 7364 7374 3b20 2020 2020 2020 tm_isdst; │ │ │ │ +00156b90: 3c73 7061 6e20 636c 6173 733d 2263 6f6d /* is summ │ │ │ │ +00156bb0: 6572 2074 696d 6520 696e 2065 6666 6563 er time in effec │ │ │ │ +00156bc0: 743f 202a 2f3c 2f73 7061 6e3e 203c 2f64 t? */ .
    char │ │ │ │ +00156c10: 2a74 6d5f 7a6f 6e65 3b20 2020 2020 2020 *tm_zone; │ │ │ │ +00156c20: 203c 7370 616e 2063 6c61 7373 3d22 636f /* abbrev │ │ │ │ +00156c40: 6961 7469 6f6e 206f 6620 7469 6d65 7a6f iation of timezo │ │ │ │ +00156c50: 6e65 206e 616d 6520 2a2f 3c2f 7370 616e ne name */
    .
    < │ │ │ │ +00156c80: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +00156c90: 6f72 6474 7970 6522 3e6c 6f6e 673c 2f73 ordtype">long tm_gmtoff; │ │ │ │ +00156cb0: 2020 2020 203c 7370 616e 2063 6c61 7373 /* of │ │ │ │ +00156cd0: 6673 6574 2066 726f 6d20 5554 4320 696e fset from UTC in │ │ │ │ +00156ce0: 2073 6563 6f6e 6473 202a 2f3c 2f73 7061 seconds */
    .
    };.

    B │ │ │ │ +00156d30: 7920 6465 636c 6172 696e 6720 7374 7275 y declaring stru │ │ │ │ +00156d40: 6374 203c 636f 6465 3e74 6d3c 2f63 6f64 ct tm volatile, soa │ │ │ │ +00156d60: 7063 7070 3220 646f 6573 206e 6f74 2072 pcpp2 does not r │ │ │ │ +00156d70: 6564 6566 696e 6520 6974 2069 6e20 7468 edefine it in th │ │ │ │ +00156d80: 6520 6f75 7470 7574 2073 6f75 7263 6520 e output source │ │ │ │ +00156d90: 636f 6465 2e20 5468 6520 3c63 6f64 653e code. The │ │ │ │ +00156da0: 2369 6e63 6c75 6465 2026 6c74 3b74 696d #include <tim │ │ │ │ +00156db0: 652e 6826 6774 3b3c 2f63 6f64 653e 2069 e.h> i │ │ │ │ +00156dc0: 7320 636f 7069 6564 2074 6f20 7468 6520 s copied to the │ │ │ │ +00156dd0: 736f 7572 6365 2063 6f64 6520 6f75 7470 source code outp │ │ │ │ +00156de0: 7574 2e20 5765 2063 616e 206e 6f77 2073 ut. We can now s │ │ │ │ +00156df0: 6572 6961 6c69 7a65 2074 6865 203c 636f erialize the tm str │ │ │ │ +00156e10: 7563 7475 7265 2e20 5468 6520 666f 6c6c ucture. The foll │ │ │ │ +00156e20: 6f77 696e 6720 6578 616d 706c 6520 7365 owing example se │ │ │ │ +00156e30: 7269 616c 697a 6573 2074 6865 206c 6f63 rializes the loc │ │ │ │ +00156e40: 616c 2074 696d 6520 7374 6f72 6564 2069 al time stored i │ │ │ │ +00156e50: 6e20 6120 3c63 6f64 653e 746d 3c2f 636f n a tm structure to │ │ │ │ +00156e70: 2073 7464 6f75 743a 3c2f 703e 0a3c 6469 stdout:

    .
    struc │ │ │ │ +00156ec0: 7420 3c2f 7370 616e 3e3c 6120 636c 6173 t │ │ │ │ +00156ef0: 736f 6170 3c2f 613e 202a 3c61 2063 6c61 soap *soap = soap_new(); │ │ │ │ +00156f90: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    time_t │ │ │ │ +00156fb0: 2054 203d 2074 696d 6528 4e55 4c4c 293b T = time(NULL); │ │ │ │ +00156fc0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    │ │ │ │ +00156ff0: 7374 7275 6374 203c 2f73 7061 6e3e 746d struct tm │ │ │ │ +00157000: 202a 7420 3d20 6c6f 6361 6c74 696d 6528 *t = localtime( │ │ │ │ +00157010: 2661 6d70 3b54 293b 203c 2f64 6976 3e0a &T);
    . │ │ │ │ +00157020: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    soap_write_tm( │ │ │ │ +00157040: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap, │ │ │ │ +00157070: 2074 293b 203c 2f64 6976 3e0a 3c64 6976 t);
    ..< │ │ │ │ +00157140: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +00157150: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ │ +00157160: 705f 5f63 6f6e 7465 7874 2e68 746d 6c23 p__context.html# │ │ │ │ +00157170: 6761 3831 6130 3039 6165 3165 6138 3235 ga81a009ae1ea825 │ │ │ │ +00157180: 6130 3565 3532 3431 6532 6237 6138 6563 a05e5241e2b7a8ec │ │ │ │ +00157190: 6539 223e 736f 6170 5f65 6e64 3c2f 613e e9">soap_end │ │ │ │ +001571a0: 283c 6120 636c 6173 733d 2263 6f64 6522 (soap │ │ │ │ +001571d0: 293b 203c 2f64 6976 3e0a 3c64 6976 2063 );
    .
    soap_free(< │ │ │ │ +00157250: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +00157260: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ +00157270: 6874 6d6c 223e 736f 6170 3c2f 613e 293b html">soap); │ │ │ │ +00157280: 3c2f 6469 763e 0a3c 2f64 6976 3e3c 212d
    .

    It is also poss │ │ │ │ +001572b0: 6962 6c65 2074 6f20 7365 7269 616c 697a ible to serializ │ │ │ │ +001572c0: 6520 7468 6520 3c63 6f64 653e 746d 3c2f e the tm members as │ │ │ │ +001572e0: 2058 4d4c 2061 7474 7269 6275 7465 7320 XML attributes │ │ │ │ +001572f0: 6279 2064 6563 6c61 7269 6e67 2074 6865 by declaring the │ │ │ │ +00157300: 206d 656d 6265 7273 2061 7320 6174 7472 members as attr │ │ │ │ +00157310: 6962 7574 6573 2077 6974 6820 7468 6520 ibutes with the │ │ │ │ +00157320: 3c63 6f64 653e 403c 2f63 6f64 653e 2071 @ q │ │ │ │ +00157330: 7561 6c69 6669 6572 2c20 7365 6520 5365 ualifier, see Se │ │ │ │ +00157340: 6374 696f 6e20 3c61 2063 6c61 7373 3d22 ction How to declare │ │ │ │ +00157380: 584d 4c20 6174 7472 6962 7574 6573 3c2f XML attributes .

    .

    If y │ │ │ │ +001573a0: 6f75 2077 616e 7420 746f 2070 726f 6475 ou want to produ │ │ │ │ +001573b0: 6365 2061 2073 6368 656d 6120 6669 6c65 ce a schema file │ │ │ │ +001573c0: 2c20 7361 7920 3c65 6d3e 3c63 6f64 653e , say │ │ │ │ +001573d0: 7469 6d65 2e78 7364 3c2f 636f 6465 3e3c time.xsd< │ │ │ │ +001573e0: 2f65 6d3e 2c20 7468 6174 2064 6566 696e /em>, that defin │ │ │ │ +001573f0: 6573 2061 6e20 584d 4c20 7363 6865 6d61 es an XML schema │ │ │ │ +00157400: 2061 6e64 206e 616d 6573 7061 6365 2066 and namespace f │ │ │ │ +00157410: 6f72 2074 6865 203c 636f 6465 3e74 6d3c or the tm< │ │ │ │ +00157420: 2f63 6f64 653e 2073 7472 7563 742c 2079 /code> struct, y │ │ │ │ +00157430: 6f75 2063 616e 2061 6464 2061 203c 636f ou can add a typedef declaration to │ │ │ │ +00157460: 2074 6865 2068 6561 6465 7220 6669 6c65 the header file │ │ │ │ +00157470: 3a3c 2f70 3e0a 3c64 6976 2063 6c61 7373 :

    .
    #includ │ │ │ │ +001574c0: 6520 266c 743b 7469 6d65 2e68 2667 743b e <time.h> │ │ │ │ +001574d0: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ │ +001574f0: 3c73 7061 6e20 636c 6173 733d 226b 6579 volatile stru │ │ │ │ +00157530: 6374 203c 2f73 7061 6e3e 746d 3c2f 6469 ct tm.
    {
    . │ │ │ │ +00157570: 2020 202e 2e2e 203c 7370 616e 2063 6c61 ... // │ │ │ │ +00157590: 7365 6520 6162 6f76 653c 2f73 7061 6e3e see above │ │ │ │ +001575a0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    };
    .
    typede │ │ │ │ +001575f0: 663c 2f73 7061 6e3e 203c 7370 616e 2063 f s │ │ │ │ +00157610: 7472 7563 7420 3c2f 7370 616e 3e74 6d20 truct tm │ │ │ │ +00157620: 7469 6d65 5f5f 7374 7275 6374 5f74 6d3b time__struct_tm; │ │ │ │ +00157630: 3c2f 6469 763e 0a3c 2f64 6976 3e3c 212d
    .

    or simply use c │ │ │ │ +00157660: 6f6c 6f6e 206e 6f74 6174 696f 6e20 7369 olon notation si │ │ │ │ +00157670: 6e63 6520 7765 206b 6565 7020 7468 6520 nce we keep the │ │ │ │ +00157680: 3c63 6f64 653e 746d 3c2f 636f 6465 3e20 tm │ │ │ │ +00157690: 6e61 6d65 3a3c 2f70 3e0a 3c64 6976 2063 name:

    .
    │ │ │ │ +001576b0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    #in │ │ │ │ +001576e0: 636c 7564 6520 266c 743b 7469 6d65 2e68 clude <time.h │ │ │ │ +001576f0: 2667 743b 3c2f 7370 616e 3e3c 2f64 6976 >
    .
    volati │ │ │ │ +00157730: 6c65 3c2f 7370 616e 3e20 3c73 7061 6e20 le │ │ │ │ +00157750: 7374 7275 6374 203c 2f73 7061 6e3e 7469 struct ti │ │ │ │ +00157760: 6d65 3a74 6d20 3c2f 6469 763e 0a3c 6469 me:tm
    .{ │ │ │ │ +00157780: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    int tm_sec; │ │ │ │ +001577d0: 2020 3c73 7061 6e20 636c 6173 733d 2263 /* secon │ │ │ │ +001577f0: 6473 2028 3020 2d20 3630 2920 2a2f 3c2f ds (0 - 60) */
    . │ │ │ │ +00157820: 2020 203c 7370 616e 2063 6c61 7373 3d22 int │ │ │ │ +00157840: 3c2f 7370 616e 3e20 746d 5f6d 696e 3b20 tm_min; │ │ │ │ +00157850: 2020 2020 2020 2020 3c73 7061 6e20 636c /* │ │ │ │ +00157870: 206d 696e 7574 6573 2028 3020 2d20 3539 minutes (0 - 59 │ │ │ │ +00157880: 2920 2a2f 3c2f 7370 616e 3e20 3c2f 6469 ) */ .
    int tm │ │ │ │ +001578d0: 5f68 6f75 723b 2020 2020 2020 2020 3c73 _hour; /* hours (0 │ │ │ │ +00157900: 2d20 3233 2920 2a2f 3c2f 7370 616e 3e20 - 23) */ │ │ │ │ +00157910: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    int tm_mday; │ │ │ │ +00157960: 2020 3c73 7061 6e20 636c 6173 733d 2263 /* day o │ │ │ │ +00157980: 6620 6d6f 6e74 6820 2831 202d 2033 3129 f month (1 - 31) │ │ │ │ +00157990: 202a 2f3c 2f73 7061 6e3e 203c 2f64 6976 */
    .
    int tm_ │ │ │ │ +001579e0: 6d6f 6e3b 2020 2020 2020 2020 203c 7370 mon; /* month of y │ │ │ │ +00157a10: 6561 7220 2830 202d 2031 3129 202a 2f3c ear (0 - 11) */< │ │ │ │ +00157a20: 2f73 7061 6e3e 203c 2f64 6976 3e0a 3c64 /span>
    . │ │ │ │ +00157a40: 2020 2020 3c73 7061 6e20 636c 6173 733d in │ │ │ │ +00157a60: 743c 2f73 7061 6e3e 2074 6d5f 7965 6172 t tm_year │ │ │ │ +00157a70: 3b20 2020 2020 2020 203c 7370 616e 2063 ; / │ │ │ │ +00157a90: 2a20 7965 6172 202d 2031 3930 3020 2a2f * year - 1900 */ │ │ │ │ +00157aa0: 3c2f 7370 616e 3e20 3c2f 6469 763e 0a3c
    .< │ │ │ │ +00157ab0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00157ac0: 3e20 2020 203c 7370 616e 2063 6c61 7373 > i │ │ │ │ +00157ae0: 6e74 3c2f 7370 616e 3e20 746d 5f77 6461 nt tm_wda │ │ │ │ +00157af0: 793b 2020 2020 2020 2020 3c73 7061 6e20 y; │ │ │ │ +00157b10: 2f2a 2064 6179 206f 6620 7765 656b 2028 /* day of week ( │ │ │ │ +00157b20: 5375 6e64 6179 203d 2030 2920 2a2f 3c2f Sunday = 0) */
    . │ │ │ │ +00157b50: 2020 203c 7370 616e 2063 6c61 7373 3d22 int │ │ │ │ +00157b70: 3c2f 7370 616e 3e20 746d 5f79 6461 793b tm_yday; │ │ │ │ +00157b80: 2020 2020 2020 2020 3c73 7061 6e20 636c /* │ │ │ │ +00157ba0: 2064 6179 206f 6620 7965 6172 2028 3020 day of year (0 │ │ │ │ +00157bb0: 2d20 3336 3529 202a 2f3c 2f73 7061 6e3e - 365) */ │ │ │ │ +00157bc0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61

    .
    int tm_isdst; │ │ │ │ +00157c10: 2020 203c 7370 616e 2063 6c61 7373 3d22 /* is s │ │ │ │ +00157c30: 756d 6d65 7220 7469 6d65 2069 6e20 6566 ummer time in ef │ │ │ │ +00157c40: 6665 6374 3f20 2a2f 3c2f 7370 616e 3e20 fect? */ │ │ │ │ +00157c50: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    char *tm_zone; │ │ │ │ +00157ca0: 2020 3c73 7061 6e20 636c 6173 733d 2263 /* abbre │ │ │ │ +00157cc0: 7669 6174 696f 6e20 6f66 2074 696d 657a viation of timez │ │ │ │ +00157cd0: 6f6e 6520 6e61 6d65 202a 2f3c 2f73 7061 one name */
    .
    │ │ │ │ +00157d00: 3c73 7061 6e20 636c 6173 733d 226b 6579 long tm_gmtoff; │ │ │ │ +00157d30: 2020 2020 203c 7370 616e 2063 6c61 7373 /* of │ │ │ │ +00157d50: 6673 6574 2066 726f 6d20 5554 4320 696e fset from UTC in │ │ │ │ +00157d60: 2073 6563 6f6e 6473 202a 2f3c 2f73 7061 seconds */
    .
    };.

    W │ │ │ │ +00157db0: 6520 7573 6564 2074 6865 2074 7970 6564 e used the typed │ │ │ │ +00157dc0: 6566 206e 616d 6520 3c63 6f64 653e 7469 ef name ti │ │ │ │ +00157dd0: 6d65 5f5f 7374 7275 6374 5f74 6d3c 2f63 me__struct_tm rather than │ │ │ │ +00157df0: 203c 636f 6465 3e74 696d 655f 5f74 6d3c time__tm< │ │ │ │ +00157e00: 2f63 6f64 653e 2c20 6265 6361 7573 6520 /code>, because │ │ │ │ +00157e10: 6120 7363 6865 6d61 206e 616d 6520 636c a schema name cl │ │ │ │ +00157e20: 6173 6820 7769 6c6c 206f 6363 7572 2066 ash will occur f │ │ │ │ +00157e30: 6f72 2074 6865 2066 6972 7374 2065 7861 or the first exa │ │ │ │ +00157e40: 6d70 6c65 2061 626f 7665 2074 6861 7420 mple above that │ │ │ │ +00157e50: 6861 7320 3c63 6f64 653e 746d 3c2f 636f has tm already decl │ │ │ │ +00157e70: 6172 6564 2061 7320 7365 7269 616c 697a ared as serializ │ │ │ │ +00157e80: 6162 6c65 2074 7970 6520 696e 2074 6865 able type in the │ │ │ │ +00157e90: 2073 6368 656d 6120 6f66 2074 6865 2067 schema of the g │ │ │ │ +00157ea0: 656e 6572 6174 6564 2057 5344 4c2e 2054 enerated WSDL. T │ │ │ │ +00157eb0: 6865 2073 6563 6f6e 6420 6578 616d 706c he second exampl │ │ │ │ +00157ec0: 6520 7769 7468 2074 6865 2063 6f6c 6f6e e with the colon │ │ │ │ +00157ed0: 206e 6f74 6174 696f 6e20 6176 6f69 6473 notation avoids │ │ │ │ +00157ee0: 2074 6869 7320 616c 746f 6765 7468 6572 this altogether │ │ │ │ +00157ef0: 2e3c 2f70 3e0a 3c70 3ef0 9f94 9d20 3c61 .

    .

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

    .

    │ │ │ │ +00157f30: 3c61 2063 6c61 7373 3d22 616e 6368 6f72 .How to declar │ │ │ │ +00157f60: 6520 6375 7374 6f6d 2073 6572 6961 6c69 e custom seriali │ │ │ │ +00157f70: 7a65 7273 2061 6e64 2064 6573 6572 6961 zers and deseria │ │ │ │ +00157f80: 6c69 7a65 7273 3c2f 6832 3e0a 3c70 3e59 lizers

    .

    Y │ │ │ │ +00157f90: 6f75 2063 616e 2069 6d70 6c65 6d65 6e74 ou can implement │ │ │ │ +00157fa0: 2079 6f75 7220 6f77 6e20 6375 7374 6f6d your own custom │ │ │ │ +00157fb0: 2073 6572 6961 6c69 7a65 7273 2066 6f72 serializers for │ │ │ │ +00157fc0: 2064 6174 6120 7479 7065 732e 2041 2063 data types. A c │ │ │ │ +00157fd0: 7573 746f 6d20 7365 7269 616c 697a 6572 ustom serializer │ │ │ │ +00157fe0: 2069 7320 6465 636c 6172 6564 2069 6e20 is declared in │ │ │ │ +00157ff0: 616e 2069 6e74 6572 6661 6365 2068 6561 an interface hea │ │ │ │ +00158000: 6465 7220 6669 6c65 2066 6f72 2073 6f61 der file for soa │ │ │ │ +00158010: 7063 7070 3220 7573 696e 6720 7468 6520 pcpp2 using the │ │ │ │ +00158020: 7061 6972 206f 6620 6b65 7977 6f72 6473 pair of keywords │ │ │ │ +00158030: 203c 636f 6465 3e65 7874 6572 6e20 7479 extern ty │ │ │ │ +00158040: 7065 6465 663c 2f63 6f64 653e 2e20 466f pedef. Fo │ │ │ │ +00158050: 7220 6578 616d 706c 653a 3c2f 703e 0a3c r example:

    .< │ │ │ │ +00158060: 6469 7620 636c 6173 733d 2266 7261 676d div class="fragm │ │ │ │ +00158070: 656e 7422 3e3c 6469 7620 636c 6173 733d ent">
    ext │ │ │ │ +001580a0: 6572 6e3c 2f73 7061 6e3e 203c 7370 616e ern typedef │ │ │ │ +001580d0: 3c73 7061 6e20 636c 6173 733d 226b 6579 char *MyData; < │ │ │ │ +00158100: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    st │ │ │ │ +00158130: 7275 6374 203c 2f73 7061 6e3e 5361 6d70 ruct Samp │ │ │ │ +00158140: 6c65 203c 2f64 6976 3e0a 3c64 6976 2063 le
    .
    {.
    MyData │ │ │ │ +00158180: 2073 3b20 3c73 7061 6e20 636c 6173 733d s; // use │ │ │ │ +001581a0: 2063 7573 746f 6d20 7365 7269 616c 697a custom serializ │ │ │ │ +001581b0: 6572 2066 6f72 2074 6869 7320 6d65 6d62 er for this memb │ │ │ │ +001581c0: 6572 203c 2f73 7061 6e3e 3c2f 6469 763e er
    │ │ │ │ +001581d0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    char *t; │ │ │ │ +00158210: 2020 3c73 7061 6e20 636c 6173 733d 2263 // use a │ │ │ │ +00158230: 7574 6f2d 6765 6e65 7261 7465 6420 7365 uto-generated se │ │ │ │ +00158240: 7269 616c 697a 6572 3c2f 7370 616e 3e3c rializer< │ │ │ │ +00158250: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    };
    │ │ │ │ +00158270: 0a3c 2f64 6976 3e3c 212d 2d20 6672 6167 .

    Then │ │ │ │ +00158290: 7072 6f76 6964 6520 7468 6520 666f 6c6c provide the foll │ │ │ │ +001582a0: 6f77 696e 6720 6675 6e63 7469 6f6e 7320 owing functions │ │ │ │ +001582b0: 666f 7220 6561 6368 203c 636f 6465 3e65 for each e │ │ │ │ +001582c0: 7874 6572 6e20 7479 7065 6465 663c 2f63 xtern typedef declares ty │ │ │ │ +001582e0: 7065 203c 636f 6465 3e54 3c2f 636f 6465 pe T:

    .
    .
    void soap_default_ │ │ │ │ +00158450: 5428 3c73 7061 6e20 636c 6173 733d 226b T(struct soa │ │ │ │ +001584a0: 703c 2f61 3e20 2a3c 6120 636c 6173 733d p *so │ │ │ │ +001584d0: 6170 3c2f 613e 2c20 5420 2a61 293b 3c2f ap, T *a);.
    int soap │ │ │ │ +00158520: 5f6f 7574 5f54 283c 7370 616e 2063 6c61 _out_T(str │ │ │ │ +00158540: 7563 743c 2f73 7061 6e3e 203c 6120 636c uct soap *soap, const │ │ │ │ +001585d0: 3c73 7061 6e20 636c 6173 733d 226b 6579 char *tag, int │ │ │ │ +00158620: 203c 7370 616e 2063 6c61 7373 3d22 6b65 id, cons │ │ │ │ +00158660: 743c 2f73 7061 6e3e 2054 202a 612c 203c t T *a, < │ │ │ │ +00158670: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +00158680: 6f72 6422 3e63 6f6e 7374 3c2f 7370 616e ord">const char │ │ │ │ +001586b0: 3c2f 7370 616e 3e20 2a74 7970 6529 3b3c *type);< │ │ │ │ +001586c0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    T *soap_ │ │ │ │ +001586e0: 696e 5f54 283c 7370 616e 2063 6c61 7373 in_T(struc │ │ │ │ +00158700: 743c 2f73 7061 6e3e 203c 6120 636c 6173 t │ │ │ │ +00158730: 736f 6170 3c2f 613e 202a 3c61 2063 6c61 soap *soap, const char *tag, T *a, │ │ │ │ +001587c0: 3c73 7061 6e20 636c 6173 733d 226b 6579 const cha │ │ │ │ +00158800: 723c 2f73 7061 6e3e 202a 7479 7065 293b r *type); │ │ │ │ +00158810: 3c2f 6469 763e 0a3c 2f64 6976 3e3c 212d
    .

    The function pr │ │ │ │ +00158840: 6f74 6f74 7970 6573 206f 6620 7468 6573 ototypes of thes │ │ │ │ +00158850: 6520 6675 6e63 7469 6f6e 7320 6361 6e20 e functions can │ │ │ │ +00158860: 6265 2066 6f75 6e64 2069 6e20 7468 6520 be found in the │ │ │ │ +00158870: 736f 6170 6370 7032 2d67 656e 6572 6174 soapcpp2-generat │ │ │ │ +00158880: 6564 203c 656d 3e3c 636f 6465 3e73 6f61 ed soa │ │ │ │ +00158890: 7048 2e68 3c2f 636f 6465 3e3c 2f65 6d3e pH.h │ │ │ │ +001588a0: 2066 696c 652e 3c2f 703e 0a3c 703e 466f file.

    .

    Fo │ │ │ │ +001588b0: 7220 6578 616d 706c 652c 2074 6865 2073 r example, the s │ │ │ │ +001588c0: 6572 6961 6c69 7a61 7469 6f6e 206f 6620 erialization of │ │ │ │ +001588d0: 3c63 6f64 653e 4d79 4461 7461 3c2f 636f MyData can be done │ │ │ │ +001588f0: 7769 7468 2074 6865 2066 6f6c 6c6f 7769 with the followi │ │ │ │ +00158900: 6e67 2063 6f64 653a 3c2f 703e 0a3c 6469 ng code:

    .
    i │ │ │ │ +00158950: 6e74 3c2f 7370 616e 3e20 736f 6170 5f73 nt soap_s │ │ │ │ +00158960: 6572 6961 6c69 7a65 5f4d 7944 6174 6128 erialize_MyData( │ │ │ │ +00158970: 3c73 7061 6e20 636c 6173 733d 226b 6579 struct soap< │ │ │ │ +001589c0: 2f61 3e20 2a3c 6120 636c 6173 733d 2263 /a> *soap │ │ │ │ +001589f0: 3c2f 613e 2c20 4d79 4461 7461 203c 7370 , MyData const* │ │ │ │ +00158a20: 6129 203c 2f64 6976 3e0a 3c64 6976 2063 a)
    .
    {.
    // │ │ │ │ +00158a70: 206e 6f20 6e65 6564 2074 6f20 6d61 726b no need to mark │ │ │ │ +00158a80: 2074 6869 7320 6e6f 6465 2028 666f 7220 this node (for │ │ │ │ +00158a90: 6d75 6c74 692d 7265 6620 616e 6420 6379 multi-ref and cy │ │ │ │ +00158aa0: 636c 6520 6465 7465 6374 696f 6e29 203c cle detection) < │ │ │ │ +00158ab0: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    . │ │ │ │ +00158ad0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 retur │ │ │ │ +00158af0: 6e3c 2f73 7061 6e3e 203c 6120 636c 6173 n SOA │ │ │ │ +00158b50: 505f 4f4b 3c2f 613e 3b3c 2f64 6976 3e0a P_OK;
    . │ │ │ │ +00158b60: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    }
    .
    void soap_default_M │ │ │ │ +00158bc0: 7944 6174 6128 3c73 7061 6e20 636c 6173 yData(stru │ │ │ │ +00158be0: 6374 3c2f 7370 616e 3e20 3c61 2063 6c61 ct soap *soap, MyDa │ │ │ │ +00158c50: 7461 202a 6129 203c 2f64 6976 3e0a 3c64 ta *a)
    . │ │ │ │ +00158c70: 7b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 {
    .
    *a = │ │ │ │ +00158c90: 204e 554c 4c3b 3c2f 6469 763e 0a3c 6469 NULL;
    .} │ │ │ │ +00158cb0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    ..
    {
    .
    │ │ │ │ +00158ed0: 3c73 7061 6e20 636c 6173 733d 226b 6579 if (soap_elemen │ │ │ │ +00158f00: 745f 6265 6769 6e5f 6f75 7428 3c61 2063 t_begin_out(soap, tag │ │ │ │ +00158f40: 2c20 3c73 7061 6e20 636c 6173 733d 226b , id, type) // print XML │ │ │ │ +00158f90: 6265 6769 6e6e 696e 6720 7461 6720 3c2f beginning tag
    .
    │ │ │ │ +00158fc0: 207c 7c20 3c61 2063 6c61 7373 3d22 636f || soap_send(soap, *a) // │ │ │ │ +00159070: 6a75 7374 2070 7269 6e74 2074 6865 2073 just print the s │ │ │ │ +00159080: 7472 696e 6720 286e 6f20 584d 4c20 636f tring (no XML co │ │ │ │ +00159090: 6e76 6572 7369 6f6e 2920 3c2f 7370 616e nversion)
    .
    || │ │ │ │ +001590c0: 736f 6170 5f65 6c65 6d65 6e74 5f65 6e64 soap_element_end │ │ │ │ +001590d0: 5f6f 7574 283c 6120 636c 6173 733d 2263 _out(soap │ │ │ │ +00159100: 3c2f 613e 2c20 7461 6729 2920 3c73 7061 , tag)) // print XML e │ │ │ │ +00159130: 6e64 696e 6720 7461 6720 3c2f 7370 616e nding tag
    .
    return soa │ │ │ │ +001591b0: 703c 2f61 3e2d 2667 743b 3c61 2063 6c61 p->error; .
    return │ │ │ │ +00159250: 203c 6120 636c 6173 733d 2263 6f64 6522 SOAP_OK │ │ │ │ +001592b0: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
    .
    } ..
    │ │ │ │ +001594f0: 2020 3c73 7061 6e20 636c 6173 733d 226b retu │ │ │ │ +00159510: 726e 3c2f 7370 616e 3e20 4e55 4c4c 3b20 rn NULL; │ │ │ │ +00159520: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    if ( │ │ │ │ +00159560: 2161 2920 3c2f 6469 763e 0a3c 6469 7620 !a)
    ... │ │ │ │ +00159720: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    *a = NULL; │ │ │ │ +00159740: 203c 7370 616e 2063 6c61 7373 3d22 636f // xsi:ni │ │ │ │ +00159760: 6c20 656c 656d 656e 7420 3c2f 7370 616e l element
    .
    if │ │ │ │ +001597b0: 282a 3c61 2063 6c61 7373 3d22 636f 6465 (*soap->type & │ │ │ │ +001597f0: 2661 6d70 3b20 3c61 2063 6c61 7373 3d22 & soap_mat │ │ │ │ +00159850: 6368 5f74 6167 3c2f 613e 283c 6120 636c ch_tag(soap, soap-> │ │ │ │ +001598c0: 7479 7065 2c20 7479 7065 2929 203c 2f64 type, type)) .
    {
    . │ │ │ │ +001598f0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    soa │ │ │ │ +00159930: 703c 2f61 3e2d 2667 743b 3c61 2063 6c61 p->error = < │ │ │ │ +00159990: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +001599a0: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ │ +001599b0: 705f 5f65 7272 6f72 732e 6874 6d6c 2367 p__errors.html#g │ │ │ │ +001599c0: 6166 6561 3636 6332 3536 6264 6161 3833 afea66c256bdaa83 │ │ │ │ +001599d0: 3736 6531 3231 3036 6533 3633 3037 6330 76e12106e36307c0 │ │ │ │ +001599e0: 3222 3e53 4f41 505f 5459 5045 3c2f 613e 2">SOAP_TYPE │ │ │ │ +001599f0: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
    .
    < │ │ │ │ +00159a10: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +00159a20: 6f72 6466 6c6f 7722 3e72 6574 7572 6e3c ordflow">return< │ │ │ │ +00159a30: 2f73 7061 6e3e 204e 554c 4c3b 203c 7370 /span> NULL; // type misma │ │ │ │ +00159a60: 7463 6820 3c2f 7370 616e 3e3c 2f64 6976 tch
    .
    }
    .< │ │ │ │ +00159a90: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00159aa0: 3e20 203c 7370 616e 2063 6c61 7373 3d22 > if< │ │ │ │ +00159ac0: 2f73 7061 6e3e 2028 2a3c 6120 636c 6173 /span> (* │ │ │ │ +00159af0: 736f 6170 3c2f 613e 2d26 6774 3b68 7265 soap->hre │ │ │ │ +00159b00: 6629 203c 2f64 6976 3e0a 3c64 6976 2063 f)
    .
    │ │ │ │ +00159b20: 6120 3d20 284d 7944 6174 612a 2a29 736f a = (MyData**)so │ │ │ │ +00159b30: 6170 5f69 645f 666f 7277 6172 6428 3c61 ap_id_forward(soap, < │ │ │ │ +00159b70: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +00159b80: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ +00159b90: 6874 6d6c 223e 736f 6170 3c2f 613e 2d26 html">soap-& │ │ │ │ +00159ba0: 6774 3b68 7265 662c 2061 2c20 302c 2053 gt;href, a, 0, S │ │ │ │ +00159bb0: 4f41 505f 5459 5045 5f4d 7944 6174 612c OAP_TYPE_MyData, │ │ │ │ +00159bc0: 2030 2c20 3c73 7061 6e20 636c 6173 733d 0, sizeof │ │ │ │ +00159be0: 3c2f 7370 616e 3e28 4d79 4461 7461 292c (MyData), │ │ │ │ +00159bf0: 2030 2c20 4e55 4c4c 2c20 4e55 4c4c 2920 0, NULL, NULL) │ │ │ │ +00159c00: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    else │ │ │ │ +00159c40: 203c 7370 616e 2063 6c61 7373 3d22 6b65 if (soa │ │ │ │ +00159c90: 703c 2f61 3e2d 2667 743b 3c61 2063 6c61 p->body) .
    {
    . │ │ │ │ +00159d10: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    │ │ │ │ +00159d40: 6368 6172 3c2f 7370 616e 3e20 2a73 203d char *s = │ │ │ │ +00159d50: 2073 6f61 705f 7661 6c75 6528 3c61 2063 soap_value(soap); // fill buff │ │ │ │ +00159db0: 6572 203c 2f73 7061 6e3e 3c2f 6469 763e er
    │ │ │ │ +00159dc0: 0a3c 6469 7620 636c 6173 733d 226c 696e ..< │ │ │ │ +00159eb0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00159ec0: 3e20 2020 2073 7472 6370 7928 2a61 2c20 > strcpy(*a, │ │ │ │ +00159ed0: 7329 3b20 3c2f 6469 763e 0a3c 6469 7620 s);
    .
    } │ │ │ │ +00159ef0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    if │ │ │ │ +00159f30: 283c 6120 636c 6173 733d 2263 6f64 6522 (soap │ │ │ │ +00159f60: 2d26 6774 3b3c 6120 636c 6173 733d 2263 ->bo │ │ │ │ +00159fb0: 6479 3c2f 613e 2026 616d 703b 2661 6d70 dy && │ │ │ │ +00159fc0: 3b20 736f 6170 5f65 6c65 6d65 6e74 5f65 ; soap_element_e │ │ │ │ +00159fd0: 6e64 5f69 6e28 3c61 2063 6c61 7373 3d22 nd_in(soa │ │ │ │ +0015a000: 703c 2f61 3e2c 2074 6167 2929 203c 2f64 p, tag)) .
    return NULL;
    .< │ │ │ │ +0015a060: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +0015a070: 3e20 203c 7370 616e 2063 6c61 7373 3d22 > ret │ │ │ │ +0015a090: 7572 6e3c 2f73 7061 6e3e 2061 3b20 3c2f urn a; .
    }
    .< │ │ │ │ +0015a0c0: 6469 7620 636c 6173 733d 2274 7463 2220 div class="ttc" │ │ │ │ +0015a0d0: 6964 3d22 6167 726f 7570 5f5f 6772 6f75 id="agroup__grou │ │ │ │ +0015a0e0: 705f 5f65 7272 6f72 735f 6874 6d6c 5f67 p__errors_html_g │ │ │ │ +0015a0f0: 6166 6561 3636 6332 3536 6264 6161 3833 afea66c256bdaa83 │ │ │ │ +0015a100: 3736 6531 3231 3036 6533 3633 3037 6330 76e12106e36307c0 │ │ │ │ +0015a110: 3222 3e3c 6469 7620 636c 6173 733d 2274 2">
    #define SOA │ │ │ │ +0015a1a0: 505f 5459 5045 3c2f 6469 763e 3c64 6976 P_TYPE
    A │ │ │ │ +0015a1c0: 2073 6f61 705f 7374 6174 7573 2065 7272 soap_status err │ │ │ │ +0015a1d0: 6f72 2063 6f64 653a 2058 4d4c 2065 6c65 or code: XML ele │ │ │ │ +0015a1e0: 6d65 6e74 206f 7220 6174 7472 6962 7574 ment or attribut │ │ │ │ +0015a1f0: 6520 6861 7320 6120 6d69 736d 6174 6368 e has a mismatch │ │ │ │ +0015a200: 696e 6720 7479 7065 206f 7220 7661 6c75 ing type or valu │ │ │ │ +0015a210: 6520 7468 6174 2069 7320 6361 7573 696e e that is causin │ │ │ │ +0015a220: 6720 6120 2e2e 2e3c 2f64 6976 3e3c 6469 g a ...
    │ │ │ │ +0015a240: 3c62 3e44 6566 696e 6974 696f 6e3a 3c2f Definition: stdsoap2.h:26 │ │ │ │ +0015a260: 3037 3c2f 6469 763e 3c2f 6469 763e 0a3c 07
    .< │ │ │ │ +0015a270: 6469 7620 636c 6173 733d 2274 7463 2220 div class="ttc" │ │ │ │ +0015a280: 6964 3d22 6167 726f 7570 5f5f 6772 6f75 id="agroup__grou │ │ │ │ +0015a290: 705f 5f69 6f5f 6874 6d6c 5f67 6137 3731 p__io_html_ga771 │ │ │ │ +0015a2a0: 3266 3562 6333 3631 3237 3035 3061 3131 2f5bc36127050a11 │ │ │ │ +0015a2b0: 6164 3939 3564 3035 3933 6264 6322 3e3c ad995d0593bdc">< │ │ │ │ +0015a2c0: 6469 7620 636c 6173 733d 2274 746e 616d div class="ttnam │ │ │ │ +0015a2d0: 6522 3e3c 6120 6872 6566 3d22 6772 6f75 e">soap_send< │ │ │ │ +0015a320: 2f61 3e3c 2f64 6976 3e3c 6469 7620 636c /a>
    . │ │ │ │ +0015a3a0: 3c64 6976 2063 6c61 7373 3d22 7474 6322
    soap_ │ │ │ │ +0015a450: 6d61 7463 685f 7461 673c 2f61 3e3c 2f64 match_tag
    int soap_ │ │ │ │ +0015a480: 6d61 7463 685f 7461 6728 7374 7275 6374 match_tag(struct │ │ │ │ +0015a490: 2073 6f61 7020 2a73 6f61 702c 2063 6f6e soap *soap, con │ │ │ │ +0015a4a0: 7374 2063 6861 7220 2a74 6167 312c 2063 st char *tag1, c │ │ │ │ +0015a4b0: 6f6e 7374 2063 6861 7220 2a74 6167 3229 onst char *tag2) │ │ │ │ +0015a4c0: 3c2f 6469 763e 3c64 6976 2063 6c61 7373
    Match a │ │ │ │ +0015a4e0: 6e20 584d 4c20 7461 6720 6e61 6d65 2e3c n XML tag name.< │ │ │ │ +0015a4f0: 2f64 6976 3e3c 2f64 6976 3e0a 3c64 6976 /div>
    .Definition:< │ │ │ │ +0015a670: 2f62 3e20 7374 6473 6f61 7032 2e68 3a32 /b> stdsoap2.h:2 │ │ │ │ +0015a680: 3936 353c 2f64 6976 3e3c 2f64 6976 3e0a 965
    . │ │ │ │ +0015a690: 3c64 6976 2063 6c61 7373 3d22 7474 6322
    The soap::nu │ │ │ │ +0015a780: 6c6c 2066 6c61 6720 6973 2073 6574 2077 ll flag is set w │ │ │ │ +0015a790: 6865 6e20 616e 2065 6c65 6d65 6e74 2063 hen an element c │ │ │ │ +0015a7a0: 6172 7269 6573 2061 2078 7369 3a6e 696c arries a xsi:nil │ │ │ │ +0015a7b0: 2061 7474 7269 6275 7465 2074 6861 7420 attribute that │ │ │ │ +0015a7c0: 6973 2074 7275 652e 3c2f 6469 763e 3c64 is true.
    Definition:< │ │ │ │ +0015a7f0: 2f62 3e20 7374 6473 6f61 7032 2e68 3a32 /b> stdsoap2.h:2 │ │ │ │ +0015a800: 3936 333c 2f64 6976 3e3c 2f64 6976 3e0a 963
    . │ │ │ │ +0015a810: 3c2f 6469 763e 3c21 2d2d 2066 7261 676d

    More i │ │ │ │ +0015a830: 6e66 6f72 6d61 7469 6f6e 206f 6e20 6375 nformation on cu │ │ │ │ +0015a840: 7374 6f6d 2073 6572 6961 6c69 7a61 7469 stom serializati │ │ │ │ +0015a850: 6f6e 2069 7320 6176 6169 6c61 626c 6520 on is available │ │ │ │ +0015a860: 696e 2074 6865 2067 534f 4150 2073 6f75 in the gSOAP sou │ │ │ │ +0015a870: 7263 6520 636f 6465 2070 6163 6b61 6765 rce code package │ │ │ │ +0015a880: 2069 6e20 7468 6520 3c65 6d3e 3c63 6f64 in the gsoap/custom direc │ │ │ │ +0015a8b0: 746f 7279 2c20 7768 6572 6520 796f 7520 tory, where you │ │ │ │ +0015a8c0: 6361 6e20 616c 736f 2066 696e 6420 7365 can also find se │ │ │ │ +0015a8d0: 7665 7261 6c20 6375 7374 6f6d 2073 6572 veral custom ser │ │ │ │ +0015a8e0: 6961 6c69 7a65 7273 2074 6f20 7573 6520 ializers to use │ │ │ │ +0015a8f0: 7769 7468 2079 6f75 7220 7072 6f6a 6563 with your projec │ │ │ │ +0015a900: 7473 2e3c 2f70 3e0a 3c70 3ef0 9f94 9d20 ts.

    .

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

    ..Function │ │ │ │ +0015a970: 6361 6c6c 6261 636b 7320 666f 7220 6375 callbacks for cu │ │ │ │ +0015a980: 7374 6f6d 697a 6564 2049 2f4f 2061 6e64 stomized I/O and │ │ │ │ +0015a990: 2048 5454 5020 6861 6e64 6c69 6e67 3c2f HTTP handling.

    The follo │ │ │ │ +0015a9b0: 7769 6e67 206c 6973 7420 6f66 2066 756e wing list of fun │ │ │ │ +0015a9c0: 6374 696f 6e73 2063 616e 2062 6520 7573 ctions can be us │ │ │ │ +0015a9d0: 6564 2066 6f72 2063 7573 746f 6d69 7a65 ed for customize │ │ │ │ +0015a9e0: 6420 4854 5450 2068 616e 646c 696e 6720 d HTTP handling │ │ │ │ +0015a9f0: 616e 6420 492f 4f2e 3c2f 703e 0a3c 703e and I/O.

    .

    │ │ │ │ +0015aa00: 5365 6520 616c 736f 2041 5049 2064 6f63 See also API doc │ │ │ │ +0015aa10: 756d 656e 7461 7469 6f6e 204d 6f64 756c umentation Modul │ │ │ │ +0015aa20: 6520 3c61 2063 6c61 7373 3d22 656c 2220 e Callback fun │ │ │ │ +0015aa60: 6374 696f 6e73 3c2f 613e 2e3c 2f70 3e0a ctions.

    . │ │ │ │ +0015aa70: 3c70 3e54 6f20 7265 7365 7420 7468 6520

    To reset the │ │ │ │ +0015aa80: 6361 6c6c 6261 636b 2066 756e 6374 696f callback functio │ │ │ │ +0015aa90: 6e73 2074 6f20 7468 6520 696e 7465 726e ns to the intern │ │ │ │ +0015aaa0: 616c 2066 756e 6374 696f 6e73 206f 6620 al functions of │ │ │ │ +0015aab0: 7468 6520 656e 6769 6e65 2c20 7573 6520 the engine, use │ │ │ │ +0015aac0: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 soap_d │ │ │ │ +0015ab90: 6f6e 653c 2f61 3e3c 2f63 6f64 653e 2066 one f │ │ │ │ +0015aba0: 6f6c 6c6f 7765 6420 6279 203c 636f 6465 ollowed by soap_init │ │ │ │ +0015ac40: 3c2f 613e 3c2f 636f 6465 3e2e 2054 6869 . Thi │ │ │ │ +0015ac50: 7320 7265 2d69 6e69 7469 616c 697a 6573 s re-initializes │ │ │ │ +0015ac60: 2074 6865 203c 636f 6465 3e3c 6120 636c the soap< │ │ │ │ +0015acc0: 2f63 6f64 653e 2063 6f6e 7465 7874 2c20 /code> context, │ │ │ │ +0015acd0: 7265 6d6f 7665 7320 616c 6c20 706c 7567 removes all plug │ │ │ │ +0015ace0: 696e 732c 2061 6e64 2072 6573 6574 7320 ins, and resets │ │ │ │ +0015acf0: 6675 6e63 7469 6f6e 2063 616c 6c62 6163 function callbac │ │ │ │ +0015ad00: 6b73 2e3c 2f70 3e0a 3c68 333e 3c61 2063 ks.

    .

    │ │ │ │ +0015ad30: 3c2f 613e 0a66 706f 7374 3c2f 6833 3e0a .fpost

    . │ │ │ │ +0015ad40: 3c70 3e3c 636f 6465 3e69 6e74 2028 3c61

    int ( │ │ │ │ +0015ae10: 736f 6170 3a3a 6670 6f73 743c 2f61 3e29 soap::fpost) │ │ │ │ +0015ae20: 2873 7472 7563 7420 736f 6170 202a 736f (struct soap *so │ │ │ │ +0015ae30: 6170 2c20 636f 6e73 7420 6368 6172 202a ap, const char * │ │ │ │ +0015ae40: 656e 6470 6f69 6e74 2c20 636f 6e73 7420 endpoint, const │ │ │ │ +0015ae50: 6368 6172 202a 686f 7374 2c20 696e 7420 char *host, int │ │ │ │ +0015ae60: 706f 7274 2c20 636f 6e73 7420 6368 6172 port, const char │ │ │ │ +0015ae70: 202a 7061 7468 2c20 636f 6e73 7420 6368 *path, const ch │ │ │ │ +0015ae80: 6172 202a 6163 7469 6f6e 2c20 554c 4f4e ar *action, ULON │ │ │ │ +0015ae90: 4736 3420 636f 756e 7429 3c2f 636f 6465 G64 count)

    .

    This ca │ │ │ │ +0015aeb0: 6c6c 6261 636b 2069 7320 6361 6c6c 6564 llback is called │ │ │ │ +0015aec0: 2061 7420 7468 6520 7365 7276 6572 2073 at the server s │ │ │ │ +0015aed0: 6964 6520 6279 2074 6865 2065 6e67 696e ide by the engin │ │ │ │ +0015aee0: 6520 746f 2073 656e 6420 7468 6520 4854 e to send the HT │ │ │ │ +0015aef0: 5450 2068 6561 6465 7273 2074 6f20 7468 TP headers to th │ │ │ │ +0015af00: 6520 636f 6e6e 6563 7465 6420 636c 6965 e connected clie │ │ │ │ +0015af10: 6e74 2e20 5468 6520 7061 7261 6d65 7465 nt. The paramete │ │ │ │ +0015af20: 7220 3c63 6f64 653e 7374 6174 7573 3c2f r status should be │ │ │ │ +0015af40: 616e 2048 5454 5020 7374 6174 7573 2065 an HTTP status e │ │ │ │ +0015af50: 7272 6f72 2063 6f64 6520 6f72 203c 636f rror code or #SOAP_OK (200 OK) or < │ │ │ │ +0015af80: 636f 6465 3e23 534f 4150 5f48 544d 4c3c code>#SOAP_HTML< │ │ │ │ +0015af90: 2f63 6f64 653e 206f 7220 3c63 6f64 653e /code> or │ │ │ │ +0015afa0: 2353 4f41 505f 4649 4c45 3c2f 636f 6465 #SOAP_FILE. Using # │ │ │ │ +0015afc0: 534f 4150 5f48 544d 4c3c 2f63 6f64 653e SOAP_HTML │ │ │ │ +0015afd0: 2073 6574 7320 7468 6520 636f 6e74 656e sets the conten │ │ │ │ +0015afe0: 742d 7479 7065 2068 6561 6465 7220 746f t-type header to │ │ │ │ +0015aff0: 203c 636f 6465 3e74 6578 742f 6874 6d6c text/html │ │ │ │ +0015b000: 3b20 6368 6172 7365 743d 7574 662d 383c ; charset=utf-8< │ │ │ │ +0015b010: 2f63 6f64 653e 2e20 5573 696e 6720 3c63 /code>. Using #SOAP_FILE sets the c │ │ │ │ +0015b040: 6f6e 7465 6e74 2d74 7970 6520 6865 6164 ontent-type head │ │ │ │ +0015b050: 6572 2074 6f20 7468 6520 7661 6c75 6520 er to the value │ │ │ │ +0015b060: 6f66 203c 636f 6465 3e3c 6120 636c 6173 of soap::http_cont │ │ │ │ +0015b130: 656e 743c 2f61 3e3c 2f63 6f64 653e 2e20 ent. │ │ │ │ +0015b140: 4578 7472 6120 4854 5450 2068 6561 6465 Extra HTTP heade │ │ │ │ +0015b150: 7273 2061 7265 2061 6464 6564 2077 6865 rs are added whe │ │ │ │ +0015b160: 6e20 3c63 6f64 653e 3c61 2063 6c61 7373 n soap::htt │ │ │ │ +0015b220: 705f 6578 7472 615f 6865 6164 6572 3c2f p_extra_header is set │ │ │ │ +0015b240: 2074 6f20 6f6e 6520 6f72 206d 6f72 6520 to one or more │ │ │ │ +0015b250: 6865 6164 6572 206c 696e 6573 2073 6570 header lines sep │ │ │ │ +0015b260: 6172 6174 6564 2062 7920 4352 4c46 2e20 arated by CRLF. │ │ │ │ +0015b270: 5768 656e 2072 6564 6566 696e 696e 6720 When redefining │ │ │ │ +0015b280: 7468 6973 2063 616c 6c62 6163 6b2c 2075 this callback, u │ │ │ │ +0015b290: 7365 2066 756e 6374 696f 6e20 3c63 6f64 se function soap_send │ │ │ │ +0015b310: 3c2f 613e 3c2f 636f 6465 3e20 746f 2077 to w │ │ │ │ +0015b320: 7269 7465 2074 6865 2068 6561 6465 7220 rite the header │ │ │ │ +0015b330: 636f 6e74 656e 7473 2e20 5265 7475 726e contents. Return │ │ │ │ +0015b340: 7320 3c63 6f64 653e 2353 4f41 505f 4f4b s #SOAP_OK │ │ │ │ +0015b350: 3c2f 636f 6465 3e20 6f72 2061 203c 636f or a soap_status< │ │ │ │ +0015b420: 2f61 3e3c 2f63 6f64 653e 2065 7272 6f72 /a> error │ │ │ │ +0015b430: 2063 6f64 652e 2054 6865 2062 7569 6c74 code. The built │ │ │ │ +0015b440: 2d69 6e20 6675 6e63 7469 6f6e 2061 7373 -in function ass │ │ │ │ +0015b450: 6967 6e65 6420 746f 203c 636f 6465 3e3c igned to < │ │ │ │ +0015b460: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ +0015b470: 663d 2267 726f 7570 5f5f 6772 6f75 705f f="group__group_ │ │ │ │ +0015b480: 5f63 616c 6c62 6163 6b73 2e68 746d 6c23 _callbacks.html# │ │ │ │ +0015b490: 6761 3364 3865 3865 3262 3761 6437 6631 ga3d8e8e2b7ad7f1 │ │ │ │ +0015b4a0: 6163 3939 3563 3238 3762 3361 3966 3637 ac995c287b3a9f67 │ │ │ │ +0015b4b0: 6139 2220 7469 746c 653d 2243 616c 6c62 a9" title="Callb │ │ │ │ +0015b4c0: 6163 6b20 7468 6174 2070 6f70 756c 6174 ack that populat │ │ │ │ +0015b4d0: 6573 2061 6e64 2074 6865 6e20 7365 6e64 es and then send │ │ │ │ +0015b4e0: 7320 4854 5450 2068 6561 6465 7273 2066 s HTTP headers f │ │ │ │ +0015b4f0: 726f 6d20 7468 6520 7365 7276 6572 2d73 rom the server-s │ │ │ │ +0015b500: 6964 6520 746f 2061 2063 6f6e 6e65 6374 ide to a connect │ │ │ │ +0015b510: 6564 2063 6c69 656e 742e 223e 736f 6170 ed client.">soap │ │ │ │ +0015b520: 3a3a 6672 6573 706f 6e73 653c 2f61 3e3c ::fresponse< │ │ │ │ +0015b530: 2f63 6f64 653e 2069 7320 3c63 6f64 653e /code> is │ │ │ │ +0015b540: 6874 7470 5f72 6573 706f 6e73 653c 2f63 http_response.

    .

    .fresponse │ │ │ │ +0015b590: 3c2f 6833 3e0a 3c70 3e3c 636f 6465 3e69

    .

    i │ │ │ │ +0015b5a0: 6e74 2028 3c61 2063 6c61 7373 3d22 656c nt (soap::fresponse │ │ │ │ +0015b670: 3c2f 613e 2928 7374 7275 6374 2073 6f61 )(struct soa │ │ │ │ +0015b680: 7020 2a73 6f61 702c 2069 6e74 2073 6f61 p *soap, int soa │ │ │ │ +0015b690: 705f 6572 726f 725f 636f 6465 2c20 554c p_error_code, UL │ │ │ │ +0015b6a0: 4f4e 4736 3420 636f 756e 7429 3c2f 636f ONG64 count)

    .

    This │ │ │ │ +0015b6c0: 6361 6c6c 6261 636b 2069 7320 6361 6c6c callback is call │ │ │ │ +0015b6d0: 6564 2061 7420 7468 6520 7365 7276 6572 ed at the server │ │ │ │ +0015b6e0: 2073 6964 6520 6279 2074 6865 2065 6e67 side by the eng │ │ │ │ +0015b6f0: 696e 6520 746f 2073 656e 6420 7468 6520 ine to send the │ │ │ │ +0015b700: 4854 5450 2068 6561 6465 7273 2074 6f20 HTTP headers to │ │ │ │ +0015b710: 7468 6520 636f 6e6e 6563 7465 6420 636c the connected cl │ │ │ │ +0015b720: 6965 6e74 2e20 5468 6520 7061 7261 6d65 ient. The parame │ │ │ │ +0015b730: 7465 7220 3c63 6f64 653e 7374 6174 7573 ter status │ │ │ │ +0015b740: 3c2f 636f 6465 3e20 7368 6f75 6c64 2062 should b │ │ │ │ +0015b750: 6520 616e 2048 5454 5020 7374 6174 7573 e an HTTP status │ │ │ │ +0015b760: 2065 7272 6f72 2063 6f64 6520 6f72 203c error code or < │ │ │ │ +0015b770: 636f 6465 3e23 534f 4150 5f4f 4b3c 2f63 code>#SOAP_OK (200 OK) or │ │ │ │ +0015b790: 203c 636f 6465 3e23 534f 4150 5f48 544d #SOAP_HTM │ │ │ │ +0015b7a0: 4c3c 2f63 6f64 653e 206f 7220 3c63 6f64 L or #SOAP_FILE. Using #SOAP_HTML sets the cont │ │ │ │ +0015b7f0: 656e 742d 7479 7065 2068 6561 6465 7220 ent-type header │ │ │ │ +0015b800: 746f 203c 636f 6465 3e74 6578 742f 6874 to text/ht │ │ │ │ +0015b810: 6d6c 3b20 6368 6172 7365 743d 7574 662d ml; charset=utf- │ │ │ │ +0015b820: 383c 2f63 6f64 653e 2e20 5573 696e 6720 8. Using │ │ │ │ +0015b830: 3c63 6f64 653e 2353 4f41 505f 4649 4c45 #SOAP_FILE │ │ │ │ +0015b840: 3c2f 636f 6465 3e20 7365 7473 2074 6865 sets the │ │ │ │ +0015b850: 2063 6f6e 7465 6e74 2d74 7970 6520 6865 content-type he │ │ │ │ +0015b860: 6164 6572 2074 6f20 7468 6520 7661 6c75 ader to the valu │ │ │ │ +0015b870: 6520 6f66 203c 636f 6465 3e3c 6120 636c e of soap::http_co │ │ │ │ +0015b940: 6e74 656e 743c 2f61 3e3c 2f63 6f64 653e ntent │ │ │ │ +0015b950: 2e20 4578 7472 6120 4854 5450 2068 6561 . Extra HTTP hea │ │ │ │ +0015b960: 6465 7273 2061 7265 2061 6464 6564 2077 ders are added w │ │ │ │ +0015b970: 6865 6e20 3c63 6f64 653e 3c61 2063 6c61 hen soap::h │ │ │ │ +0015ba30: 7474 705f 6578 7472 615f 6865 6164 6572 ttp_extra_header │ │ │ │ +0015ba40: 3c2f 613e 3c2f 636f 6465 3e20 6973 2073 is s │ │ │ │ +0015ba50: 6574 2074 6f20 6f6e 6520 6f72 206d 6f72 et to one or mor │ │ │ │ +0015ba60: 6520 6865 6164 6572 206c 696e 6573 2073 e header lines s │ │ │ │ +0015ba70: 6570 6172 6174 6564 2062 7920 4352 4c46 eparated by CRLF │ │ │ │ +0015ba80: 2e20 5768 656e 2072 6564 6566 696e 696e . When redefinin │ │ │ │ +0015ba90: 6720 7468 6973 2063 616c 6c62 6163 6b2c g this callback, │ │ │ │ +0015baa0: 2075 7365 2066 756e 6374 696f 6e20 3c63 use function soap_se │ │ │ │ +0015bb20: 6e64 3c2f 613e 3c2f 636f 6465 3e20 746f nd to │ │ │ │ +0015bb30: 2077 7269 7465 2074 6865 2068 6561 6465 write the heade │ │ │ │ +0015bb40: 7220 636f 6e74 656e 7473 2e20 5265 7475 r contents. Retu │ │ │ │ +0015bb50: 726e 7320 3c63 6f64 653e 2353 4f41 505f rns #SOAP_ │ │ │ │ +0015bb60: 4f4b 3c2f 636f 6465 3e20 6f72 2061 203c OK or a < │ │ │ │ +0015bb70: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soap_statu │ │ │ │ +0015bc30: 733c 2f61 3e3c 2f63 6f64 653e 2065 7272 s err │ │ │ │ +0015bc40: 6f72 2063 6f64 652e 2054 6865 2062 7569 or code. The bui │ │ │ │ +0015bc50: 6c74 2d69 6e20 6675 6e63 7469 6f6e 2061 lt-in function a │ │ │ │ +0015bc60: 7373 6967 6e65 6420 746f 203c 636f 6465 ssigned to so │ │ │ │ +0015bd30: 6170 3a3a 6672 6573 706f 6e73 653c 2f61 ap::fresponse is http_response< │ │ │ │ +0015bd60: 2f63 6f64 653e 2e3c 2f70 3e0a 3c68 333e /code>.

    .

    │ │ │ │ +0015bd70: 3c61 2063 6c61 7373 3d22 616e 6368 6f72 .fposthd │ │ │ │ +0015bda0: 723c 2f68 333e 0a3c 703e 3c63 6f64 653e r

    .

    │ │ │ │ +0015bdb0: 696e 7420 283c 6120 636c 6173 733d 2265 int (soap::fposthd │ │ │ │ +0015be60: 723c 2f61 3e29 2873 7472 7563 7420 736f r)(struct so │ │ │ │ +0015be70: 6170 202a 736f 6170 2c20 636f 6e73 7420 ap *soap, const │ │ │ │ +0015be80: 6368 6172 202a 6b65 792c 2063 6f6e 7374 char *key, const │ │ │ │ +0015be90: 2063 6861 7220 2a76 616c 293c 2f63 6f64 char *val)

    .

    This c │ │ │ │ +0015beb0: 616c 6c62 6163 6b20 6973 2063 616c 6c65 allback is calle │ │ │ │ +0015bec0: 6420 6279 203c 636f 6465 3e3c 6120 636c d by soa │ │ │ │ +0015bf90: 703a 3a66 706f 7374 3c2f 613e 3c2f 636f p::fpost and soap: │ │ │ │ +0015c070: 3a66 7265 7370 6f6e 7365 3c2f 613e 3c2f :fresponse to send an │ │ │ │ +0015c090: 2048 5454 5020 6865 6164 6572 2077 6974 HTTP header wit │ │ │ │ +0015c0a0: 6820 6120 6b65 7920 616e 6420 616e 206f h a key and an o │ │ │ │ +0015c0b0: 7074 696f 6e61 6c20 7661 6c75 652e 2052 ptional value. R │ │ │ │ +0015c0c0: 6574 7572 6e73 203c 636f 6465 3e23 534f eturns #SO │ │ │ │ +0015c0d0: 4150 5f4f 4b3c 2f63 6f64 653e 206f 7220 AP_OK or │ │ │ │ +0015c0e0: 6120 3c63 6f64 653e 3c61 2063 6c61 7373 a soap_st │ │ │ │ +0015c1a0: 6174 7573 3c2f 613e 3c2f 636f 6465 3e20 atus │ │ │ │ +0015c1b0: 2869 6e74 2920 6572 726f 7220 636f 6465 (int) error code │ │ │ │ +0015c1c0: 2e20 5468 6520 6275 696c 742d 696e 2066 . The built-in f │ │ │ │ +0015c1d0: 756e 6374 696f 6e20 6173 7369 676e 6564 unction assigned │ │ │ │ +0015c1e0: 2074 6f20 3c63 6f64 653e 3c61 2063 6c61 to soap::fp │ │ │ │ +0015c290: 6f73 7468 6472 3c2f 613e 3c2f 636f 6465 osthdr is http_ │ │ │ │ +0015c2b0: 706f 7374 5f68 6561 6465 723c 2f63 6f64 post_header.

    .

    │ │ │ │ +0015c2f0: 3c2f 613e 0a66 7061 7273 653c 2f68 333e .fparse

    │ │ │ │ +0015c300: 0a3c 703e 3c63 6f64 653e 696e 7420 283c .

    int (< │ │ │ │ +0015c310: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ +0015c320: 663d 2267 726f 7570 5f5f 6772 6f75 705f f="group__group_ │ │ │ │ +0015c330: 5f63 616c 6c62 6163 6b73 2e68 746d 6c23 _callbacks.html# │ │ │ │ +0015c340: 6761 3963 6230 3563 6539 3866 3834 3566 ga9cb05ce98f845f │ │ │ │ +0015c350: 3136 6339 3230 6334 3434 3236 6163 3335 16c920c44426ac35 │ │ │ │ +0015c360: 6135 2220 7469 746c 653d 2243 616c 6c62 a5" title="Callb │ │ │ │ +0015c370: 6163 6b20 7468 6174 2072 6561 6473 2061 ack that reads a │ │ │ │ +0015c380: 6e64 2070 6172 7365 7320 4854 5450 2061 nd parses HTTP a │ │ │ │ +0015c390: 6e64 204d 494d 4520 6865 6164 6572 732e nd MIME headers. │ │ │ │ +0015c3a0: 223e 736f 6170 3a3a 6670 6172 7365 3c2f ">soap::fparse)(struct soap │ │ │ │ +0015c3c0: 2a73 6f61 7029 3c2f 636f 6465 3e3c 2f70 *soap)

    .

    This callba │ │ │ │ +0015c3e0: 636b 2069 7320 6361 6c6c 6564 2062 7920 ck is called by │ │ │ │ +0015c3f0: 7468 6520 656e 6769 6e65 2028 6173 2061 the engine (as a │ │ │ │ +0015c400: 2063 6c69 656e 7420 6f72 2073 6572 7665 client or serve │ │ │ │ +0015c410: 7229 2074 6f20 7265 6164 2061 6e64 2070 r) to read and p │ │ │ │ +0015c420: 6172 7365 2048 5454 5020 6865 6164 6572 arse HTTP header │ │ │ │ +0015c430: 7320 6f72 204d 494d 4520 6865 6164 6572 s or MIME header │ │ │ │ +0015c440: 732e 2057 6865 6e20 7265 6465 6669 6e65 s. When redefine │ │ │ │ +0015c450: 642c 2074 6869 7320 6675 6e63 7469 6f6e d, this function │ │ │ │ +0015c460: 2073 686f 756c 6420 6174 2072 6561 6420 should at read │ │ │ │ +0015c470: 6f72 2073 6b69 7020 7468 6520 656e 7469 or skip the enti │ │ │ │ +0015c480: 7265 2048 5454 5020 6865 6164 6572 2074 re HTTP header t │ │ │ │ +0015c490: 6f20 7265 6163 6820 7468 6520 6d65 7373 o reach the mess │ │ │ │ +0015c4a0: 6167 6520 626f 6479 2e20 4675 6e63 7469 age body. Functi │ │ │ │ +0015c4b0: 6f6e 203c 636f 6465 3e3c 6120 636c 6173 on soap_getline is use │ │ │ │ +0015c540: 6420 6279 2074 6869 7320 6361 6c6c 6261 d by this callba │ │ │ │ +0015c550: 636b 2074 6f20 7265 6164 2065 6163 6820 ck to read each │ │ │ │ +0015c560: 6865 6164 6572 206c 696e 6520 696e 746f header line into │ │ │ │ +0015c570: 2061 6e20 696e 7465 726e 616c 2062 7566 an internal buf │ │ │ │ +0015c580: 6665 7220 3c63 6f64 653e 3c61 2063 6c61 fer soap::msgbuf with < │ │ │ │ +0015c660: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>so │ │ │ │ +0015c6d0: 6170 5f67 6574 6c69 6e65 3c2f 613e 2873 ap_getline(s │ │ │ │ +0015c6e0: 6f61 702c 2073 6f61 702d 2667 743b 6d73 oap, soap->ms │ │ │ │ +0015c6f0: 6762 7566 2c20 7369 7a65 6f66 2873 6f61 gbuf, sizeof(soa │ │ │ │ +0015c700: 702d 2667 743b 6d73 6762 7566 2929 3c2f p->msgbuf)). Returns < │ │ │ │ +0015c720: 636f 6465 3e23 534f 4150 5f4f 4b3c 2f63 code>#SOAP_OK, or a gSOAP │ │ │ │ +0015c740: 2065 7272 6f72 2063 6f64 652e 2054 6865 error code. The │ │ │ │ +0015c750: 2062 7569 6c74 2d69 6e20 6675 6e63 7469 built-in functi │ │ │ │ +0015c760: 6f6e 2061 7373 6967 6e65 6420 746f 203c on assigned to < │ │ │ │ +0015c770: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soap::fp │ │ │ │ +0015c810: 6172 7365 3c2f 613e 3c2f 636f 6465 3e20 arse │ │ │ │ +0015c820: 6973 203c 636f 6465 3e68 7474 705f 7061 is http_pa │ │ │ │ +0015c830: 7273 653c 2f63 6f64 653e 2e3c 2f70 3e0a rse.

    . │ │ │ │ +0015c840: 3c68 333e 3c61 2063 6c61 7373 3d22 616e

    .fpa │ │ │ │ +0015c870: 7273 6568 6472 3c2f 6833 3e0a 3c70 3e3c rsehdr

    .

    < │ │ │ │ +0015c880: 636f 6465 3e69 6e74 2028 3c61 2063 6c61 code>int ( │ │ │ │ +0015c930: 736f 6170 3a3a 6670 6172 7365 6864 723c soap::fparsehdr< │ │ │ │ +0015c940: 2f61 3e29 2873 7472 7563 7420 736f 6170 /a>)(struct soap │ │ │ │ +0015c950: 202a 736f 6170 2c20 636f 6e73 7420 6368 *soap, const ch │ │ │ │ +0015c960: 6172 202a 6b65 792c 2063 6f6e 7374 2063 ar *key, const c │ │ │ │ +0015c970: 6861 7220 2a76 616c 293c 2f63 6f64 653e har *val) │ │ │ │ +0015c980: 3c2f 703e 0a3c 703e 5468 6973 2063 616c

    .

    This cal │ │ │ │ +0015c990: 6c62 6163 6b20 6973 2063 616c 6c65 6420 lback is called │ │ │ │ +0015c9a0: 6279 203c 636f 6465 3e3c 6120 636c 6173 by soap │ │ │ │ +0015ca40: 3a3a 6670 6172 7365 3c2f 613e 3c2f 636f ::fparse, consumes an │ │ │ │ +0015ca60: 2048 5454 5020 6865 6164 6572 2074 6861 HTTP header tha │ │ │ │ +0015ca70: 7420 6973 2073 706c 6974 2069 6e20 6120 t is split in a │ │ │ │ +0015ca80: 6b65 792d 7661 6c75 6520 7061 6972 2061 key-value pair a │ │ │ │ +0015ca90: 6e64 2075 7064 6174 6573 2074 6865 203c nd updates the < │ │ │ │ +0015caa0: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soap │ │ │ │ +0015cb00: 2063 6f6e 7465 7874 2073 7461 7465 2061 context state a │ │ │ │ +0015cb10: 6363 6f72 6469 6e67 6c79 2e20 5468 6520 ccordingly. The │ │ │ │ +0015cb20: 636f 6e74 6578 7420 6973 2075 7064 6174 context is updat │ │ │ │ +0015cb30: 6564 2077 6974 6820 7468 6520 4854 5450 ed with the HTTP │ │ │ │ +0015cb40: 2068 6561 6465 7220 696e 666f 726d 6174 header informat │ │ │ │ +0015cb50: 696f 6e20 7265 6365 6976 6564 2c20 6275 ion received, bu │ │ │ │ +0015cb60: 7420 4854 5450 2068 6561 6465 7273 2061 t HTTP headers a │ │ │ │ +0015cb70: 7265 206e 6f74 206c 6974 6572 616c 6c79 re not literally │ │ │ │ +0015cb80: 2072 6574 6169 6e65 6420 6279 2074 6865 retained by the │ │ │ │ +0015cb90: 2065 6e67 696e 652e 2052 6574 7572 6e73 engine. Returns │ │ │ │ +0015cba0: 203c 636f 6465 3e23 534f 4150 5f4f 4b3c #SOAP_OK< │ │ │ │ +0015cbb0: 2f63 6f64 653e 206f 7220 3c63 6f64 653e /code> or │ │ │ │ +0015cbc0: 2353 4f41 505f 5354 4f50 3c2f 636f 6465 #SOAP_STOP to prevent fur │ │ │ │ +0015cbe0: 7468 6572 2072 6561 6469 6e67 206f 6620 ther reading of │ │ │ │ +0015cbf0: 7468 6520 4854 5450 2062 6f64 792c 206f the HTTP body, o │ │ │ │ +0015cc00: 7220 6120 3c63 6f64 653e 3c61 2063 6c61 r a soap_ │ │ │ │ +0015ccc0: 7374 6174 7573 3c2f 613e 3c2f 636f 6465 status (int) error co │ │ │ │ +0015cce0: 6465 2e20 5468 6520 6275 696c 742d 696e de. The built-in │ │ │ │ +0015ccf0: 2066 756e 6374 696f 6e20 6173 7369 676e function assign │ │ │ │ +0015cd00: 6564 2074 6f20 3c63 6f64 653e 3c61 2063 ed to soap::fparsehd │ │ │ │ +0015cdc0: 723c 2f61 3e3c 2f63 6f64 653e 2069 7320 r is │ │ │ │ +0015cdd0: 3c63 6f64 653e 6874 7470 5f70 6172 7365 http_parse │ │ │ │ +0015cde0: 5f68 6561 6465 723c 2f63 6f64 653e 2e3c _header.< │ │ │ │ +0015cdf0: 2f70 3e0a 3c68 333e 3c61 2063 6c61 7373 /p>.

    │ │ │ │ +0015ce20: 0a66 6765 743c 2f68 333e 0a3c 703e 3c63 .fget

    .

    int (soap: │ │ │ │ +0015cf00: 3a66 6765 743c 2f61 3e29 2873 7472 7563 :fget)(struc │ │ │ │ +0015cf10: 7420 736f 6170 202a 736f 6170 293c 2f63 t soap *soap)

    .

    This │ │ │ │ +0015cf30: 2063 616c 6c62 6163 6b20 6973 2063 616c callback is cal │ │ │ │ +0015cf40: 6c65 6420 6279 2074 6865 2073 6572 7669 led by the servi │ │ │ │ +0015cf50: 6365 2064 6973 7061 7463 6865 7220 7768 ce dispatcher wh │ │ │ │ +0015cf60: 656e 2061 6e20 4854 5450 2047 4554 2072 en an HTTP GET r │ │ │ │ +0015cf70: 6571 7565 7374 2069 7320 7065 6e64 696e equest is pendin │ │ │ │ +0015cf80: 672e 2052 6564 6566 696e 6520 7468 6973 g. Redefine this │ │ │ │ +0015cf90: 2063 616c 6c62 6163 6b20 746f 2072 6573 callback to res │ │ │ │ +0015cfa0: 706f 6e64 2074 6f20 4854 5450 2047 4554 pond to HTTP GET │ │ │ │ +0015cfb0: 2072 6571 7565 7374 7320 7769 7468 2063 requests with c │ │ │ │ +0015cfc0: 6f6e 7465 6e74 2c20 7365 6520 7468 6520 ontent, see the │ │ │ │ +0015cfd0: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 http_get< │ │ │ │ +0015d060: 2f61 3e3c 2f63 6f64 653e 2048 5454 5020 /a> HTTP │ │ │ │ +0015d070: 4745 5420 706c 7567 696e 2066 6f72 206d GET plugin for m │ │ │ │ +0015d080: 6f72 6520 6465 7461 696c 732e 2052 6574 ore details. Ret │ │ │ │ +0015d090: 7572 6e73 203c 636f 6465 3e23 534f 4150 urns #SOAP │ │ │ │ +0015d0a0: 5f4f 4b3c 2f63 6f64 653e 206f 7220 6120 _OK or a │ │ │ │ +0015d0b0: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 soap_stat │ │ │ │ +0015d170: 7573 3c2f 613e 3c2f 636f 6465 3e20 2869 us (i │ │ │ │ +0015d180: 6e74 2920 6572 726f 7220 636f 6465 2e20 nt) error code. │ │ │ │ +0015d190: 5468 6520 6275 696c 742d 696e 2066 756e The built-in fun │ │ │ │ +0015d1a0: 6374 696f 6e20 6173 7369 676e 6564 2074 ction assigned t │ │ │ │ +0015d1b0: 6f20 3c63 6f64 653e 3c61 2063 6c61 7373 o soap:: │ │ │ │ +0015d280: 6667 6574 3c2f 613e 3c2f 636f 6465 3e20 fget │ │ │ │ +0015d290: 6973 2074 6865 2069 6e74 6572 6e61 6c20 is the internal │ │ │ │ +0015d2a0: 7374 6174 6963 2066 756e 6374 696f 6e20 static function │ │ │ │ +0015d2b0: 3c63 6f64 653e 6874 7470 5f67 6574 3c2f http_get that retur │ │ │ │ +0015d2d0: 6e73 2074 6865 203c 636f 6465 3e23 534f ns the #SO │ │ │ │ +0015d2e0: 4150 5f47 4554 5f4d 4554 484f 443c 2f63 AP_GET_METHOD error.

    . │ │ │ │ +0015d300: 3c68 333e 3c61 2063 6c61 7373 3d22 616e

    .fpu │ │ │ │ +0015d330: 743c 2f68 333e 0a3c 703e 3c63 6f64 653e t

    .

    │ │ │ │ +0015d340: 696e 7420 283c 6120 636c 6173 733d 2265 int (soap::fpu │ │ │ │ +0015d410: 743c 2f61 3e29 2873 7472 7563 7420 736f t)(struct so │ │ │ │ +0015d420: 6170 202a 736f 6170 293c 2f63 6f64 653e ap *soap) │ │ │ │ +0015d430: 3c2f 703e 0a3c 703e 5468 6973 2063 616c

    .

    This cal │ │ │ │ +0015d440: 6c62 6163 6b20 6973 2063 616c 6c65 6420 lback is called │ │ │ │ +0015d450: 6279 2074 6865 2073 6572 7669 6365 2064 by the service d │ │ │ │ +0015d460: 6973 7061 7463 6865 7220 7768 656e 2061 ispatcher when a │ │ │ │ +0015d470: 6e20 4854 5450 2050 5554 2072 6571 7565 n HTTP PUT reque │ │ │ │ +0015d480: 7374 2069 7320 7065 6e64 696e 672e 2052 st is pending. R │ │ │ │ +0015d490: 6564 6566 696e 6520 7468 6973 2063 616c edefine this cal │ │ │ │ +0015d4a0: 6c62 6163 6b20 746f 2072 6573 706f 6e64 lback to respond │ │ │ │ +0015d4b0: 2074 6f20 4854 5450 2050 5554 2072 6571 to HTTP PUT req │ │ │ │ +0015d4c0: 7565 7374 732c 2073 6565 2074 6865 203c uests, see the < │ │ │ │ +0015d4d0: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>http_post │ │ │ │ +0015d560: 3c2f 613e 3c2f 636f 6465 3e20 4854 5450 HTTP │ │ │ │ +0015d570: 2050 4f53 5420 706c 7567 696e 2066 6f72 POST plugin for │ │ │ │ +0015d580: 206d 6f72 6520 6465 7461 696c 732e 2052 more details. R │ │ │ │ +0015d590: 6574 7572 6e73 203c 636f 6465 3e23 534f eturns #SO │ │ │ │ +0015d5a0: 4150 5f4f 4b3c 2f63 6f64 653e 206f 7220 AP_OK or │ │ │ │ +0015d5b0: 6120 3c63 6f64 653e 3c61 2063 6c61 7373 a soap_st │ │ │ │ +0015d670: 6174 7573 3c2f 613e 3c2f 636f 6465 3e20 atus │ │ │ │ +0015d680: 6572 726f 7220 636f 6465 2e20 5468 6520 error code. The │ │ │ │ +0015d690: 6275 696c 742d 696e 2066 756e 6374 696f built-in functio │ │ │ │ +0015d6a0: 6e20 6173 7369 676e 6564 2074 6f20 3c63 n assigned to soap::fput │ │ │ │ +0015d780: 3c2f 613e 3c2f 636f 6465 3e20 6973 2074 is t │ │ │ │ +0015d790: 6865 2069 6e74 6572 6e61 6c20 7374 6174 he internal stat │ │ │ │ +0015d7a0: 6963 2066 756e 6374 696f 6e20 3c63 6f64 ic function http_put that returns t │ │ │ │ +0015d7d0: 6865 203c 636f 6465 3e23 534f 4150 5f50 he #SOAP_P │ │ │ │ +0015d7e0: 5554 5f4d 4554 484f 443c 2f63 6f64 653e UT_METHOD │ │ │ │ +0015d7f0: 2065 7272 6f72 2e3c 2f70 3e0a 3c68 333e error.

    .

    │ │ │ │ +0015d800: 3c61 2063 6c61 7373 3d22 616e 6368 6f72 .fpatch< │ │ │ │ +0015d830: 2f68 333e 0a3c 703e 3c63 6f64 653e 696e /h3>.

    in │ │ │ │ +0015d840: 7420 283c 6120 636c 6173 733d 2265 6c22 t (soap::f │ │ │ │ +0015d910: 7061 7463 683c 2f61 3e29 2873 7472 7563 patch)(struc │ │ │ │ +0015d920: 7420 736f 6170 202a 736f 6170 293c 2f63 t soap *soap)

    .

    This │ │ │ │ +0015d940: 2063 616c 6c62 6163 6b20 6973 2063 616c callback is cal │ │ │ │ +0015d950: 6c65 6420 6279 2074 6865 2073 6572 7669 led by the servi │ │ │ │ +0015d960: 6365 2064 6973 7061 7463 6865 7220 7768 ce dispatcher wh │ │ │ │ +0015d970: 656e 2061 6e20 4854 5450 2050 4154 4348 en an HTTP PATCH │ │ │ │ +0015d980: 2072 6571 7565 7374 2069 7320 7065 6e64 request is pend │ │ │ │ +0015d990: 696e 672e 2052 6564 6566 696e 6520 7468 ing. Redefine th │ │ │ │ +0015d9a0: 6973 2063 616c 6c62 6163 6b20 746f 2072 is callback to r │ │ │ │ +0015d9b0: 6573 706f 6e64 2074 6f20 4854 5450 2050 espond to HTTP P │ │ │ │ +0015d9c0: 4154 4348 2072 6571 7565 7374 732c 2073 ATCH requests, s │ │ │ │ +0015d9d0: 6565 2074 6865 203c 636f 6465 3e3c 6120 ee the h │ │ │ │ +0015da60: 7474 705f 706f 7374 3c2f 613e 3c2f 636f ttp_post HTTP POST pl │ │ │ │ +0015da80: 7567 696e 2066 6f72 206d 6f72 6520 6465 ugin for more de │ │ │ │ +0015da90: 7461 696c 732e 2052 6574 7572 6e73 203c tails. Returns < │ │ │ │ +0015daa0: 636f 6465 3e23 534f 4150 5f4f 4b3c 2f63 code>#SOAP_OK or a │ │ │ │ +0015dac0: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap_status │ │ │ │ +0015db80: 3c2f 636f 6465 3e20 6572 726f 7220 636f error co │ │ │ │ +0015db90: 6465 2e20 5468 6520 6275 696c 742d 696e de. The built-in │ │ │ │ +0015dba0: 2066 756e 6374 696f 6e20 6173 7369 676e function assign │ │ │ │ +0015dbb0: 6564 2074 6f20 3c63 6f64 653e 3c61 2063 ed to soap::fpatch is the │ │ │ │ +0015dca0: 2069 6e74 6572 6e61 6c20 7374 6174 6963 internal static │ │ │ │ +0015dcb0: 2066 756e 6374 696f 6e20 3c63 6f64 653e function │ │ │ │ +0015dcc0: 6874 7470 5f70 6174 6368 3c2f 636f 6465 http_patch that returns t │ │ │ │ +0015dce0: 6865 203c 636f 6465 3e23 534f 4150 5f50 he #SOAP_P │ │ │ │ +0015dcf0: 4154 4348 5f4d 4554 484f 443c 2f63 6f64 ATCH_METHOD error.

    ..fdel< │ │ │ │ +0015dd40: 2f68 333e 0a3c 703e 3c63 6f64 653e 696e /h3>.

    in │ │ │ │ +0015dd50: 7420 283c 6120 636c 6173 733d 2265 6c22 t (soap::f │ │ │ │ +0015de20: 6465 6c3c 2f61 3e29 2873 7472 7563 7420 del)(struct │ │ │ │ +0015de30: 736f 6170 202a 736f 6170 293c 2f63 6f64 soap *soap)

    .

    This c │ │ │ │ +0015de50: 616c 6c62 6163 6b20 6973 2063 616c 6c65 allback is calle │ │ │ │ +0015de60: 6420 6279 2074 6865 2073 6572 7669 6365 d by the service │ │ │ │ +0015de70: 2064 6973 7061 7463 6865 7220 7768 656e dispatcher when │ │ │ │ +0015de80: 2061 6e20 4854 5450 2044 454c 4554 4520 an HTTP DELETE │ │ │ │ +0015de90: 7265 7175 6573 7420 6973 2070 656e 6469 request is pendi │ │ │ │ +0015dea0: 6e67 2e20 5265 6465 6669 6e65 2074 6869 ng. Redefine thi │ │ │ │ +0015deb0: 7320 6361 6c6c 6261 636b 2074 6f20 7265 s callback to re │ │ │ │ +0015dec0: 7370 6f6e 6420 746f 2048 5454 5020 4445 spond to HTTP DE │ │ │ │ +0015ded0: 4c45 5445 2072 6571 7565 7374 732c 2073 LETE requests, s │ │ │ │ +0015dee0: 6565 2074 6865 203c 636f 6465 3e3c 6120 ee the h │ │ │ │ +0015df70: 7474 705f 706f 7374 3c2f 613e 3c2f 636f ttp_post HTTP POST pl │ │ │ │ +0015df90: 7567 696e 2066 6f72 206d 6f72 6520 6465 ugin for more de │ │ │ │ +0015dfa0: 7461 696c 732e 2052 6574 7572 6e73 203c tails. Returns < │ │ │ │ +0015dfb0: 636f 6465 3e23 534f 4150 5f4f 4b3c 2f63 code>#SOAP_OK or a │ │ │ │ +0015dfd0: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap_status │ │ │ │ +0015e090: 3c2f 636f 6465 3e20 2869 6e74 2920 6572 (int) er │ │ │ │ +0015e0a0: 726f 7220 636f 6465 2e20 5468 6520 6275 ror code. The bu │ │ │ │ +0015e0b0: 696c 742d 696e 2066 756e 6374 696f 6e20 ilt-in function │ │ │ │ +0015e0c0: 6173 7369 676e 6564 2074 6f20 3c63 6f64 assigned to soap::fd │ │ │ │ +0015e1a0: 656c 3c2f 613e 3c2f 636f 6465 3e20 6973 el is │ │ │ │ +0015e1b0: 2074 6865 2069 6e74 6572 6e61 6c20 7374 the internal st │ │ │ │ +0015e1c0: 6174 6963 2066 756e 6374 696f 6e20 3c63 atic function http_del that returns │ │ │ │ +0015e1f0: 2074 6865 203c 636f 6465 3e23 534f 4150 the #SOAP │ │ │ │ +0015e200: 5f44 454c 5f4d 4554 484f 443c 2f63 6f64 _DEL_METHOD error.

    ..fopt< │ │ │ │ +0015e250: 2f68 333e 0a3c 703e 3c63 6f64 653e 696e /h3>.

    in │ │ │ │ +0015e260: 7420 283c 6120 636c 6173 733d 2265 6c22 t (soap::f │ │ │ │ +0015e330: 6f70 743c 2f61 3e29 2873 7472 7563 7420 opt)(struct │ │ │ │ +0015e340: 736f 6170 202a 736f 6170 293c 2f63 6f64 soap *soap)

    .

    Called │ │ │ │ +0015e360: 2062 7920 7468 6520 7365 7276 6963 6520 by the service │ │ │ │ +0015e370: 6469 7370 6174 6368 6572 2077 6865 6e20 dispatcher when │ │ │ │ +0015e380: 616e 2048 5454 5020 4f50 5449 4f4e 2072 an HTTP OPTION r │ │ │ │ +0015e390: 6571 7565 7374 2069 7320 7065 6e64 696e equest is pendin │ │ │ │ +0015e3a0: 672e 2052 6564 6566 696e 6520 7468 6973 g. Redefine this │ │ │ │ +0015e3b0: 2063 616c 6c62 6163 6b20 746f 2072 6573 callback to res │ │ │ │ +0015e3c0: 706f 6e64 2074 6f20 4854 5450 204f 5054 pond to HTTP OPT │ │ │ │ +0015e3d0: 494f 4e20 7265 7175 6573 7473 2c20 7365 ION requests, se │ │ │ │ +0015e3e0: 6520 7468 6520 3c63 6f64 653e 3c61 2063 e the ht │ │ │ │ +0015e470: 7470 5f70 6f73 743c 2f61 3e3c 2f63 6f64 tp_post HTTP POST plu │ │ │ │ +0015e490: 6769 6e20 666f 7220 6d6f 7265 2064 6574 gin for more det │ │ │ │ +0015e4a0: 6169 6c73 2e20 5265 7475 726e 7320 3c63 ails. Returns #SOAP_OK or a < │ │ │ │ +0015e4d0: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ +0015e4e0: 663d 2267 726f 7570 5f5f 6772 6f75 705f f="group__group_ │ │ │ │ +0015e4f0: 5f65 7272 6f72 732e 6874 6d6c 2367 6163 _errors.html#gac │ │ │ │ +0015e500: 3065 6164 6638 6637 3262 6163 6235 6234 0eadf8f72bacb5b4 │ │ │ │ +0015e510: 3162 3735 3062 6561 6563 6130 3434 3422 1b750beaeca0444" │ │ │ │ +0015e520: 2074 6974 6c65 3d22 5374 6174 7573 2061 title="Status a │ │ │ │ +0015e530: 6e64 2065 7272 6f72 2063 6f64 6573 2061 nd error codes a │ │ │ │ +0015e540: 7265 2069 6e74 2076 616c 7565 732c 2061 re int values, a │ │ │ │ +0015e550: 207a 6572 6f20 7661 6c75 6520 6f72 2023 zero value or # │ │ │ │ +0015e560: 534f 4150 5f4f 4b20 2830 2920 6d65 616e SOAP_OK (0) mean │ │ │ │ +0015e570: 7320 6e6f 2065 7272 6f72 2c2e 2e2e 223e s no error,..."> │ │ │ │ +0015e580: 736f 6170 5f73 7461 7475 733c 2f61 3e3c soap_status< │ │ │ │ +0015e590: 2f63 6f64 653e 2028 696e 7429 2065 7272 /code> (int) err │ │ │ │ +0015e5a0: 6f72 2063 6f64 652e 2054 6865 2062 7569 or code. The bui │ │ │ │ +0015e5b0: 6c74 2d69 6e20 6675 6e63 7469 6f6e 2061 lt-in function a │ │ │ │ +0015e5c0: 7373 6967 6e65 6420 746f 203c 636f 6465 ssigned to soap::fop │ │ │ │ +0015e6a0: 743c 2f61 3e3c 2f63 6f64 653e 2069 7320 t is │ │ │ │ +0015e6b0: 7468 6520 696e 7465 726e 616c 2073 7461 the internal sta │ │ │ │ +0015e6c0: 7469 6320 6675 6e63 7469 6f6e 203c 636f tic function http_200 that returns │ │ │ │ +0015e6f0: 4854 5450 2032 3030 204f 4b2e 3c2f 703e HTTP 200 OK.

    │ │ │ │ +0015e700: 0a3c 6833 3e3c 6120 636c 6173 733d 2261 .

    .fh │ │ │ │ +0015e730: 6561 643c 2f68 333e 0a3c 703e 3c63 6f64 ead

    .

    int (soap:: │ │ │ │ +0015e810: 6668 6561 643c 2f61 3e29 2873 7472 7563 fhead)(struc │ │ │ │ +0015e820: 7420 736f 6170 202a 736f 6170 293c 2f63 t soap *soap)

    .

    This │ │ │ │ +0015e840: 2063 616c 6c62 6163 6b20 6973 2063 616c callback is cal │ │ │ │ +0015e850: 6c65 6420 6279 2074 6865 2073 6572 7669 led by the servi │ │ │ │ +0015e860: 6365 2064 6973 7061 7463 6865 7220 7768 ce dispatcher wh │ │ │ │ +0015e870: 656e 2061 6e20 4854 5450 2048 4541 4420 en an HTTP HEAD │ │ │ │ +0015e880: 7265 7175 6573 7420 6973 2070 656e 6469 request is pendi │ │ │ │ +0015e890: 6e67 2e20 5265 6465 6669 6e65 2074 6869 ng. Redefine thi │ │ │ │ +0015e8a0: 7320 6361 6c6c 6261 636b 2074 6f20 7265 s callback to re │ │ │ │ +0015e8b0: 7370 6f6e 6420 746f 2048 5454 5020 4845 spond to HTTP HE │ │ │ │ +0015e8c0: 4144 2072 6571 7565 7374 7320 6d6f 7265 AD requests more │ │ │ │ +0015e8d0: 2073 7065 6369 6669 6361 6c6c 792e 2052 specifically. R │ │ │ │ +0015e8e0: 6574 7572 6e73 203c 636f 6465 3e23 534f eturns #SO │ │ │ │ +0015e8f0: 4150 5f4f 4b3c 2f63 6f64 653e 206f 7220 AP_OK or │ │ │ │ +0015e900: 6120 3c63 6f64 653e 3c61 2063 6c61 7373 a soap_st │ │ │ │ +0015e9c0: 6174 7573 3c2f 613e 3c2f 636f 6465 3e20 atus │ │ │ │ +0015e9d0: 2869 6e74 2920 6572 726f 7220 636f 6465 (int) error code │ │ │ │ +0015e9e0: 2e20 5468 6520 6275 696c 742d 696e 2066 . The built-in f │ │ │ │ +0015e9f0: 756e 6374 696f 6e20 6173 7369 676e 6564 unction assigned │ │ │ │ +0015ea00: 2074 6f20 3c63 6f64 653e 3c61 2063 6c61 to soa │ │ │ │ +0015ead0: 703a 3a66 6865 6164 3c2f 613e 3c2f 636f p::fhead is the inter │ │ │ │ +0015eaf0: 6e61 6c20 7374 6174 6963 2066 756e 6374 nal static funct │ │ │ │ +0015eb00: 696f 6e20 3c63 6f64 653e 6874 7470 5f32 ion http_2 │ │ │ │ +0015eb10: 3030 3c2f 636f 6465 3e20 7468 6174 2072 00 that r │ │ │ │ +0015eb20: 6574 7572 6e73 2048 5454 5020 3230 3020 eturns HTTP 200 │ │ │ │ +0015eb30: 4f4b 2e3c 2f70 3e0a 3c68 333e 3c61 2063 OK.

    .

    │ │ │ │ +0015eb60: 3c2f 613e 0a66 666f 726d 3c2f 6833 3e0a .fform

    . │ │ │ │ +0015eb70: 3c70 3e3c 636f 6465 3e69 6e74 2028 3c61

    int (soap::fform< │ │ │ │ +0015ec50: 2f61 3e29 2873 7472 7563 7420 736f 6170 /a>)(struct soap │ │ │ │ +0015ec60: 202a 736f 6170 293c 2f63 6f64 653e 3c2f *soap).

    This callb │ │ │ │ +0015ec80: 6163 6b20 6973 2063 616c 6c65 6420 6279 ack is called by │ │ │ │ +0015ec90: 2074 6865 2048 5454 5020 464f 524d 2068 the HTTP FORM h │ │ │ │ +0015eca0: 616e 646c 6572 2070 6c75 6769 6e20 746f andler plugin to │ │ │ │ +0015ecb0: 2070 6172 7365 2048 544d 4c20 666f 726d parse HTML form │ │ │ │ +0015ecc0: 7320 7265 6365 6976 6564 2077 6974 6820 s received with │ │ │ │ +0015ecd0: 4854 5450 2050 4f53 5420 616e 6420 5055 HTTP POST and PU │ │ │ │ +0015ece0: 5420 7265 7175 6573 7473 2c20 7365 6520 T requests, see │ │ │ │ +0015ecf0: 7468 6520 3c63 6f64 653e 3b3a 6874 7470 the ;:http │ │ │ │ +0015ed00: 5f66 6f72 6d3c 2f63 6f64 653e 2048 5454 _form HTT │ │ │ │ +0015ed10: 5020 464f 524d 2070 6c75 6769 6e20 666f P FORM plugin fo │ │ │ │ +0015ed20: 7220 6d6f 7265 2064 6574 6169 6c73 2e20 r more details. │ │ │ │ +0015ed30: 5468 6520 4854 5450 2062 6f64 7920 7769 The HTTP body wi │ │ │ │ +0015ed40: 7468 2074 6865 2066 6f72 6d20 6461 7461 th the form data │ │ │ │ +0015ed50: 2073 686f 756c 6420 6265 2070 6172 7365 should be parse │ │ │ │ +0015ed60: 6420 6279 2074 6869 7320 6361 6c6c 6261 d by this callba │ │ │ │ +0015ed70: 636b 2c20 6f74 6865 7277 6973 6520 4854 ck, otherwise HT │ │ │ │ +0015ed80: 5450 206b 6565 702d 616c 6976 6520 6d65 TP keep-alive me │ │ │ │ +0015ed90: 7373 6167 6573 2077 696c 6c20 656e 6420 ssages will end │ │ │ │ +0015eda0: 7570 206f 7574 206f 6620 7379 6e63 2061 up out of sync a │ │ │ │ +0015edb0: 7320 6120 7265 7375 6c74 206f 6620 7468 s a result of th │ │ │ │ +0015edc0: 6520 6375 7272 656e 7420 706f 7369 7469 e current positi │ │ │ │ +0015edd0: 6f6e 206e 6f74 2062 6569 6e67 2061 6476 on not being adv │ │ │ │ +0015ede0: 616e 6365 6420 746f 2074 6865 2065 6e64 anced to the end │ │ │ │ +0015edf0: 206f 6620 7468 6520 4854 5450 2062 6f64 of the HTTP bod │ │ │ │ +0015ee00: 792e 2052 6574 7572 6e73 203c 636f 6465 y. Returns #SOAP_OK │ │ │ │ +0015ee20: 206f 7220 6120 3c63 6f64 653e 3c61 2063 or a soa │ │ │ │ +0015eee0: 705f 7374 6174 7573 3c2f 613e 3c2f 636f p_status (int) error │ │ │ │ +0015ef00: 636f 6465 2e20 4e6f 2062 7569 6c74 2d69 code. No built-i │ │ │ │ +0015ef10: 6e20 6675 6e63 7469 6f6e 2069 7320 6173 n function is as │ │ │ │ +0015ef20: 7369 676e 6564 2074 6f20 3c63 6f64 653e signed to │ │ │ │ +0015ef30: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap::ffor │ │ │ │ +0015f000: 6d3c 2f61 3e3c 2f63 6f64 653e 2e3c 2f70 m.

    .

    .f │ │ │ │ +0015f040: 6865 6164 6572 3c2f 6833 3e0a 3c70 3e3c header

    .

    < │ │ │ │ +0015f050: 636f 6465 3e69 6e74 2028 3c61 2063 6c61 code>int ( │ │ │ │ +0015f120: 736f 6170 3a3a 6668 6561 6465 723c 2f61 soap::fheader)(struct soap * │ │ │ │ +0015f140: 736f 6170 293c 2f63 6f64 653e 3c2f 703e soap)

    │ │ │ │ +0015f150: 0a3c 703e 5468 6973 2063 616c 6c62 6163 .

    This callbac │ │ │ │ +0015f160: 6b20 6973 2063 616c 6c65 6420 696d 6d65 k is called imme │ │ │ │ +0015f170: 6469 6174 656c 7920 6166 7465 7220 7061 diately after pa │ │ │ │ +0015f180: 7273 696e 6720 6120 534f 4150 2048 6561 rsing a SOAP Hea │ │ │ │ +0015f190: 6465 7220 696e 746f 2074 6865 203c 636f der into the soap: │ │ │ │ +0015f260: 3a68 6561 6465 723c 2f61 3e3c 2f63 6f64 :header structure. Th │ │ │ │ +0015f280: 6520 534f 4150 2048 6561 6465 7220 7374 e SOAP Header st │ │ │ │ +0015f290: 7275 6374 7572 6520 3c63 6f64 653e 3c61 ructure soap::head │ │ │ │ +0015f360: 6572 3c2f 613e 3c2f 636f 6465 3e20 6361 er ca │ │ │ │ +0015f370: 6e20 6265 2069 6e73 7065 6374 6564 2062 n be inspected b │ │ │ │ +0015f380: 7920 7468 6973 2066 756e 6374 696f 6e20 y this function │ │ │ │ +0015f390: 616e 6420 7665 7269 6669 6564 206f 7220 and verified or │ │ │ │ +0015f3a0: 7265 6a65 6374 6564 2062 6566 6f72 6520 rejected before │ │ │ │ +0015f3b0: 7468 6520 7265 7374 206f 6620 7468 6520 the rest of the │ │ │ │ +0015f3c0: 6d65 7373 6167 6520 7769 7468 2074 6865 message with the │ │ │ │ +0015f3d0: 2053 4f41 5020 426f 6479 2069 7320 636f SOAP Body is co │ │ │ │ +0015f3e0: 6e73 756d 6564 2e20 5265 7475 726e 7320 nsumed. Returns │ │ │ │ +0015f3f0: 3c63 6f64 653e 2353 4f41 505f 4f4b 3c2f #SOAP_OK or a soap_status (int) e │ │ │ │ +0015f4e0: 7272 6f72 2063 6f64 652e 204e 6f20 6275 rror code. No bu │ │ │ │ +0015f4f0: 696c 742d 696e 2066 756e 6374 696f 6e20 ilt-in function │ │ │ │ +0015f500: 6973 2061 7373 6967 6e65 6420 746f 203c is assigned to < │ │ │ │ +0015f510: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soap: │ │ │ │ +0015f5e0: 3a66 6865 6164 6572 3c2f 613e 3c2f 636f :fheader.

    .

    .fignore.

    int │ │ │ │ +0015f640: 283c 6120 636c 6173 733d 2265 6c22 2068 (soap::fig │ │ │ │ +0015f710: 6e6f 7265 3c2f 613e 2928 7374 7275 6374 nore)(struct │ │ │ │ +0015f720: 2073 6f61 7020 2a73 6f61 702c 2063 6f6e soap *soap, con │ │ │ │ +0015f730: 7374 2063 6861 7220 2a74 6167 293c 2f63 st char *tag)

    .

    This │ │ │ │ +0015f750: 2063 616c 6c62 6163 6b20 6973 2063 616c callback is cal │ │ │ │ +0015f760: 6c65 6420 7768 656e 2061 6e20 756e 7265 led when an unre │ │ │ │ +0015f770: 636f 676e 697a 6564 2058 4d4c 2065 6c65 cognized XML ele │ │ │ │ +0015f780: 6d65 6e74 2077 6173 2065 6e63 6f75 6e74 ment was encount │ │ │ │ +0015f790: 6572 6564 206f 6e20 7468 6520 696e 7075 ered on the inpu │ │ │ │ +0015f7a0: 7420 7468 6174 2063 6f75 6c64 2062 6520 t that could be │ │ │ │ +0015f7b0: 6967 6e6f 7265 6420 6465 7065 6e64 696e ignored dependin │ │ │ │ +0015f7c0: 6720 6f6e 2073 6f6d 6520 7370 6563 6966 g on some specif │ │ │ │ +0015f7d0: 6965 6420 6c6f 6769 632e 2054 6865 203c ied logic. The < │ │ │ │ +0015f7e0: 636f 6465 3e74 6167 3c2f 636f 6465 3e20 code>tag │ │ │ │ +0015f7f0: 7061 7261 6d65 7465 7220 6973 2074 6865 parameter is the │ │ │ │ +0015f800: 206f 6666 656e 6469 6e67 2058 4d4c 2065 offending XML e │ │ │ │ +0015f810: 6c65 6d65 6e74 2074 6167 206e 616d 6520 lement tag name │ │ │ │ +0015f820: 7374 7269 6e67 2e20 5468 6520 6361 6c6c string. The call │ │ │ │ +0015f830: 6261 636b 2073 686f 756c 6420 7265 7475 back should retu │ │ │ │ +0015f840: 726e 203c 636f 6465 3e23 534f 4150 5f4f rn #SOAP_O │ │ │ │ +0015f850: 4b3c 2f63 6f64 653e 2074 6f20 6967 6e6f K to igno │ │ │ │ +0015f860: 7265 2074 6865 2065 6c65 6d65 6e74 206f re the element o │ │ │ │ +0015f870: 7220 7265 7475 726e 2061 6e20 3c63 6f64 r return an soap_status error │ │ │ │ +0015f950: 636f 6465 2073 7563 6820 6173 203c 636f code such as #SOAP_TAG_MIS │ │ │ │ +0015f970: 4d41 5443 483c 2f63 6f64 653e 2074 6f20 MATCH to │ │ │ │ +0015f980: 7472 6967 6765 7220 6120 7661 6c69 6461 trigger a valida │ │ │ │ +0015f990: 7469 6f6e 2065 7272 6f72 2e20 5468 6973 tion error. This │ │ │ │ +0015f9a0: 2063 616c 6c62 6163 6b20 616c 736f 206f callback also o │ │ │ │ +0015f9b0: 7665 7272 6964 6573 203c 636f 6465 3e6d verrides m │ │ │ │ +0015f9c0: 7573 7455 6e64 6572 7374 616e 643c 2f63 ustUnderstand attributes │ │ │ │ +0015f9e0: 6f6e 2075 6e72 6563 6f67 6e69 7a65 6420 on unrecognized │ │ │ │ +0015f9f0: 534f 4150 2048 6561 6465 7220 656c 656d SOAP Header elem │ │ │ │ +0015fa00: 656e 7473 2074 6861 7420 6e6f 726d 616c ents that normal │ │ │ │ +0015fa10: 6c79 2072 6169 7365 2066 6175 6c74 732e ly raise faults. │ │ │ │ +0015fa20: 2049 7420 6973 2073 7472 6f6e 676c 7920 It is strongly │ │ │ │ +0015fa30: 7265 636f 6d6d 656e 6465 6420 7468 6174 recommended that │ │ │ │ +0015fa40: 2074 6865 2063 616c 6c62 6163 6b20 7265 the callback re │ │ │ │ +0015fa50: 7475 726e 7320 3c63 6f64 653e 2353 4f41 turns #SOA │ │ │ │ +0015fa60: 505f 4d55 5354 554e 4445 5253 5441 4e44 P_MUSTUNDERSTAND │ │ │ │ +0015fa70: 3c2f 636f 6465 3e20 7768 656e 203c 636f when soap: │ │ │ │ +0015fb40: 3a6d 7573 7455 6e64 6572 7374 616e 643c :mustUnderstand< │ │ │ │ +0015fb50: 2f61 3e3c 2f63 6f64 653e 2021 3d20 3c63 /a> != 0. Re │ │ │ │ +0015fb70: 7475 726e 7320 3c63 6f64 653e 2353 4f41 turns #SOA │ │ │ │ +0015fb80: 505f 4f4b 3c2f 636f 6465 3e20 6f72 2061 P_OK or a │ │ │ │ +0015fb90: 203c 636f 6465 3e3c 6120 636c 6173 733d soap_sta │ │ │ │ +0015fc50: 7475 733c 2f61 3e3c 2f63 6f64 653e 2028 tus ( │ │ │ │ +0015fc60: 696e 7429 2065 7272 6f72 2063 6f64 652e int) error code. │ │ │ │ +0015fc70: 204e 6f20 6275 696c 742d 696e 2066 756e No built-in fun │ │ │ │ +0015fc80: 6374 696f 6e20 6973 2061 7373 6967 6e65 ction is assigne │ │ │ │ +0015fc90: 6420 746f 203c 636f 6465 3e3c 6120 636c d to soap::fignore.

    .< │ │ │ │ +0015fd80: 6833 3e3c 6120 636c 6173 733d 2261 6e63 h3>.fsva │ │ │ │ +0015fdb0: 6c69 6461 7465 3c2f 6833 3e0a 3c70 3e3c lidate

    .

    < │ │ │ │ +0015fdc0: 636f 6465 3e69 6e74 2028 3c61 2063 6c61 code>int ( │ │ │ │ +0015fe60: 736f 6170 3a3a 6673 7661 6c69 6461 7465 soap::fsvalidate │ │ │ │ +0015fe70: 3c2f 613e 2928 7374 7275 6374 2073 6f61 )(struct soa │ │ │ │ +0015fe80: 7020 2a73 6f61 702c 2063 6f6e 7374 2063 p *soap, const c │ │ │ │ +0015fe90: 6861 7220 2a70 6174 7465 726e 2c20 636f har *pattern, co │ │ │ │ +0015fea0: 6e73 7420 6368 6172 202a 7374 7269 6e67 nst char *string │ │ │ │ +0015feb0: 293c 2f63 6f64 653e 3c2f 703e 0a3c 703e )

    .

    │ │ │ │ +0015fec0: 5468 6973 2063 616c 6c62 6163 6b20 6973 This callback is │ │ │ │ +0015fed0: 2063 616c 6c65 6420 746f 2076 616c 6964 called to valid │ │ │ │ +0015fee0: 6174 6520 6120 7374 7269 6e67 2061 6761 ate a string aga │ │ │ │ +0015fef0: 696e 7374 2061 6e20 584d 4c20 7265 6765 inst an XML rege │ │ │ │ +0015ff00: 7820 7061 7474 6572 6e2e 2050 6174 7465 x pattern. Patte │ │ │ │ +0015ff10: 726e 7320 7573 6520 584d 4c20 7363 6865 rns use XML sche │ │ │ │ +0015ff20: 6d61 2072 6567 6578 2073 796e 7461 782e ma regex syntax. │ │ │ │ +0015ff30: 2054 6869 7320 6361 6c6c 6261 636b 2061 This callback a │ │ │ │ +0015ff40: 6c6c 6f77 7320 7573 6572 2d64 6566 696e llows user-defin │ │ │ │ +0015ff50: 6564 2070 6174 7465 726e 2076 616c 6964 ed pattern valid │ │ │ │ +0015ff60: 6174 696f 6e20 7468 6174 2069 7320 6e6f ation that is no │ │ │ │ +0015ff70: 726d 616c 6c79 2064 6973 6162 6c65 642e rmally disabled. │ │ │ │ +0015ff80: 2052 6574 7572 6e73 203c 636f 6465 3e23 Returns # │ │ │ │ +0015ff90: 534f 4150 5f4f 4b3c 2f63 6f64 653e 2077 SOAP_OK w │ │ │ │ +0015ffa0: 6865 6e20 7468 6520 7374 7269 6e67 206d hen the string m │ │ │ │ +0015ffb0: 6174 6368 6573 2074 6865 2070 6174 7465 atches the patte │ │ │ │ +0015ffc0: 726e 206f 7220 3c63 6f64 653e 2353 4f41 rn or #SOA │ │ │ │ +0015ffd0: 505f 5459 5045 3c2f 636f 6465 3e20 7768 P_TYPE wh │ │ │ │ +0015ffe0: 656e 2074 6865 2073 7472 696e 6720 646f en the string do │ │ │ │ +0015fff0: 6573 206e 6f74 206d 6174 6368 2e20 4e6f es not match. No │ │ │ │ +00160000: 2062 7569 6c74 2d69 6e20 6675 6e63 7469 built-in functi │ │ │ │ +00160010: 6f6e 2069 7320 6173 7369 676e 6564 2074 on is assigned t │ │ │ │ +00160020: 6f20 3c63 6f64 653e 3c61 2063 6c61 7373 o so │ │ │ │ +001600c0: 6170 3a3a 6673 7661 6c69 6461 7465 3c2f ap::fsvalidate.

    .< │ │ │ │ +001600e0: 6833 3e3c 6120 636c 6173 733d 2261 6e63 h3>.fwva │ │ │ │ +00160110: 6c69 6461 7465 3c2f 6833 3e0a 3c70 3e3c lidate

    .

    < │ │ │ │ +00160120: 636f 6465 3e69 6e74 2028 3c61 2063 6c61 code>int (soap::fwval │ │ │ │ +001601d0: 6964 6174 653c 2f61 3e29 2873 7472 7563 idate)(struc │ │ │ │ +001601e0: 7420 736f 6170 202a 736f 6170 2c20 636f t soap *soap, co │ │ │ │ +001601f0: 6e73 7420 6368 6172 202a 7061 7474 6572 nst char *patter │ │ │ │ +00160200: 6e2c 2063 6f6e 7374 2077 6368 6172 5f74 n, const wchar_t │ │ │ │ +00160210: 202a 7374 7269 6e67 293c 2f63 6f64 653e *string) │ │ │ │ +00160220: 2054 6869 7320 6361 6c6c 6261 636b 2069 This callback i │ │ │ │ +00160230: 7320 6361 6c6c 6564 2074 6f20 7661 6c69 s called to vali │ │ │ │ +00160240: 6461 7465 2061 2077 6964 6520 7374 7269 date a wide stri │ │ │ │ +00160250: 6e67 2061 6761 696e 7374 2061 6e20 584d ng against an XM │ │ │ │ +00160260: 4c20 7265 6765 7820 7061 7474 6572 6e2e L regex pattern. │ │ │ │ +00160270: 2050 6174 7465 726e 7320 7573 6520 584d Patterns use XM │ │ │ │ +00160280: 4c20 7363 6865 6d61 2072 6567 6578 2073 L schema regex s │ │ │ │ +00160290: 796e 7461 782e 2054 6869 7320 6361 6c6c yntax. This call │ │ │ │ +001602a0: 6261 636b 2061 6c6c 6f77 7320 7573 6572 back allows user │ │ │ │ +001602b0: 2d64 6566 696e 6564 2070 6174 7465 726e -defined pattern │ │ │ │ +001602c0: 2076 616c 6964 6174 696f 6e20 7468 6174 validation that │ │ │ │ +001602d0: 2069 7320 6e6f 726d 616c 6c79 2064 6973 is normally dis │ │ │ │ +001602e0: 6162 6c65 642e 2052 6574 7572 6e73 203c abled. Returns < │ │ │ │ +001602f0: 636f 6465 3e23 534f 4150 5f4f 4b3c 2f63 code>#SOAP_OK when the st │ │ │ │ +00160310: 7269 6e67 206d 6174 6368 6573 2074 6865 ring matches the │ │ │ │ +00160320: 2070 6174 7465 726e 206f 7220 3c63 6f64 pattern or #SOAP_TYPE when the str │ │ │ │ +00160350: 696e 6720 646f 6573 206e 6f74 206d 6174 ing does not mat │ │ │ │ +00160360: 6368 2e20 4e6f 2062 7569 6c74 2d69 6e20 ch. No built-in │ │ │ │ +00160370: 6675 6e63 7469 6f6e 2069 7320 6173 7369 function is assi │ │ │ │ +00160380: 676e 6564 2074 6f20 3c63 6f64 653e 3c61 gned to soap::f │ │ │ │ +00160430: 7776 616c 6964 6174 653c 2f61 3e3c 2f63 wvalidate.

    .

    .fseterror │ │ │ │ +00160480: 3c2f 6833 3e0a 3c70 3e3c 636f 6465 3e76

    .

    v │ │ │ │ +00160490: 6f69 6420 283c 6120 636c 6173 733d 2265 oid (soap::fse │ │ │ │ +00160540: 7465 7272 6f72 3c2f 613e 2928 7374 7275 terror)(stru │ │ │ │ +00160550: 6374 2073 6f61 7020 2a73 6f61 702c 2063 ct soap *soap, c │ │ │ │ +00160560: 6f6e 7374 2063 6861 7220 2a2a 636f 6465 onst char **code │ │ │ │ +00160570: 2c20 636f 6e73 7420 6368 6172 202a 2a73 , const char **s │ │ │ │ +00160580: 7472 696e 6729 3c2f 636f 6465 3e3c 2f70 tring)

    .

    This callba │ │ │ │ +001605a0: 636b 2069 7320 6361 6c6c 6564 2062 7920 ck is called by │ │ │ │ +001605b0: 7468 6520 656e 6769 6e65 2077 6865 6e20 the engine when │ │ │ │ +001605c0: 616e 2065 7272 6f72 2069 7320 7261 6973 an error is rais │ │ │ │ +001605d0: 6564 2074 6f20 616c 6c6f 7720 696e 7370 ed to allow insp │ │ │ │ +001605e0: 6563 7469 6f6e 206f 7220 6f76 6572 7269 ection or overri │ │ │ │ +001605f0: 6469 6e67 206f 6620 7468 6520 6661 756c ding of the faul │ │ │ │ +00160600: 7420 636f 6465 206f 7220 6661 756c 7420 t code or fault │ │ │ │ +00160610: 7374 7269 6e67 206d 6573 7361 6765 7320 string messages │ │ │ │ +00160620: 6265 666f 7265 2074 6865 2065 7272 6f72 before the error │ │ │ │ +00160630: 2069 7320 7265 706f 7274 6564 206f 7220 is reported or │ │ │ │ +00160640: 7472 616e 736d 6974 7465 642e 204e 6f20 transmitted. No │ │ │ │ +00160650: 6275 696c 742d 696e 2066 756e 6374 696f built-in functio │ │ │ │ +00160660: 6e20 6973 2061 7373 6967 6e65 6420 746f n is assigned to │ │ │ │ +00160670: 203c 636f 6465 3e3c 6120 636c 6173 733d soap::f │ │ │ │ +00160720: 7365 7465 7272 6f72 3c2f 613e 3c2f 636f seterror.

    .

    .fopen

    │ │ │ │ +00160770: 0a3c 703e 3c63 6f64 653e 534f 4150 5f53 .

    SOAP_S │ │ │ │ +00160780: 4f43 4b45 5420 283c 6120 636c 6173 733d OCKET (soap::fopen)(struct soap * │ │ │ │ +00160840: 736f 6170 2c20 636f 6e73 7420 6368 6172 soap, const char │ │ │ │ +00160850: 202a 656e 6470 6f69 6e74 2c20 636f 6e73 *endpoint, cons │ │ │ │ +00160860: 7420 6368 6172 202a 686f 7374 2c20 696e t char *host, in │ │ │ │ +00160870: 7420 706f 7274 293c 2f63 6f64 653e 3c2f t port).

    This callb │ │ │ │ +00160890: 6163 6b20 6973 2063 616c 6c65 6420 6279 ack is called by │ │ │ │ +001608a0: 2074 6865 2065 6e67 696e 6520 6174 2074 the engine at t │ │ │ │ +001608b0: 6865 2063 6c69 656e 742d 7369 6465 2062 he client-side b │ │ │ │ +001608c0: 7920 3c63 6f64 653e 3c61 2063 6c61 7373 y soap_connect< │ │ │ │ +00160950: 2f61 3e3c 2f63 6f64 653e 206f 7220 3c63 /a> or s │ │ │ │ +001609d0: 6f61 705f 636f 6e6e 6563 745f 636f 6d6d oap_connect_comm │ │ │ │ +001609e0: 616e 643c 2f61 3e3c 2f63 6f64 653e 2074 and t │ │ │ │ +001609f0: 6f20 6f70 656e 2061 2054 4350 206f 7220 o open a TCP or │ │ │ │ +00160a00: 5544 5020 636f 6e6e 6563 7469 6f6e 2074 UDP connection t │ │ │ │ +00160a10: 6f20 6120 7365 7276 6572 2073 7065 6369 o a server speci │ │ │ │ +00160a20: 6669 6564 2061 7420 616e 2065 6e64 706f fied at an endpo │ │ │ │ +00160a30: 696e 742e 2050 6172 616d 6574 6572 7320 int. Parameters │ │ │ │ +00160a40: 3c63 6f64 653e 686f 7374 3c2f 636f 6465 host and port │ │ │ │ +00160a60: 3c2f 636f 6465 3e20 6172 6520 6d69 6372 are micr │ │ │ │ +00160a70: 6f2d 7061 7273 6564 2066 726f 6d20 3c63 o-parsed from endpoint before being │ │ │ │ +00160aa0: 2070 6173 7365 6420 746f 203c 636f 6465 passed to soap │ │ │ │ +00160b50: 3a3a 666f 7065 6e3c 2f61 3e3c 2f63 6f64 ::fopen. Returns a va │ │ │ │ +00160b70: 6c69 6420 736f 636b 6574 206f 7220 3c63 lid socket or #SOAP_INVALI │ │ │ │ +00160b90: 445f 534f 434b 4554 3c2f 636f 6465 3e20 D_SOCKET │ │ │ │ +00160ba0: 7769 7468 2061 203c 636f 6465 3e3c 6120 with a soap::error set to │ │ │ │ +00160c70: 2061 203c 636f 6465 3e3c 6120 636c 6173 a soap_s │ │ │ │ +00160d30: 7461 7475 733c 2f61 3e3c 2f63 6f64 653e tatus │ │ │ │ +00160d40: 2028 696e 7429 2065 7272 6f72 2063 6f64 (int) error cod │ │ │ │ +00160d50: 6520 616e 6420 3c63 6f64 653e 3c61 2063 e and soap │ │ │ │ +00160de0: 3a3a 6572 726e 756d 3c2f 613e 3c2f 636f ::errnum set to errno of │ │ │ │ +00160e10: 2074 6865 2063 6f6e 6e65 6374 696f 6e20 the connection │ │ │ │ +00160e20: 6661 696c 7572 652e 2054 6865 2062 7569 failure. The bui │ │ │ │ +00160e30: 6c74 2d69 6e20 6675 6e63 7469 6f6e 2061 lt-in function a │ │ │ │ +00160e40: 7373 6967 6e65 6420 746f 203c 636f 6465 ssigned to soap │ │ │ │ +00160ef0: 3a3a 666f 7065 6e3c 2f61 3e3c 2f63 6f64 ::fopen is tcp_ │ │ │ │ +00160f10: 636f 6e6e 6563 743c 2f63 6f64 653e 2e3c connect.< │ │ │ │ +00160f20: 2f70 3e0a 3c68 333e 3c61 2063 6c61 7373 /p>.

    │ │ │ │ +00160f50: 0a66 6163 6365 7074 3c2f 6833 3e0a 3c70 .faccept

    .

    SOAP_SOCK │ │ │ │ +00160f70: 4554 2028 3c61 2063 6c61 7373 3d22 656c ET ( │ │ │ │ +00161020: 736f 6170 3a3a 6661 6363 6570 743c 2f61 soap::faccept)(struct soap * │ │ │ │ +00161040: 736f 6170 2c20 534f 4150 5f53 4f43 4b45 soap, SOAP_SOCKE │ │ │ │ +00161050: 5420 732c 2073 7472 7563 7420 736f 636b T s, struct sock │ │ │ │ +00161060: 6164 6472 202a 612c 2069 6e74 202a 6e29 addr *a, int *n) │ │ │ │ +00161070: 3c2f 636f 6465 3e3c 2f70 3e0a 3c70 3e54

    .

    T │ │ │ │ +00161080: 6869 7320 6361 6c6c 6261 636b 2069 7320 his callback is │ │ │ │ +00161090: 6361 6c6c 6564 2062 7920 3c63 6f64 653e called by │ │ │ │ +001610a0: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap_ac │ │ │ │ +00161120: 6365 7074 3c2f 613e 3c2f 636f 6465 3e20 cept │ │ │ │ +00161130: 286f 7220 7468 6520 432b 2b20 7365 7276 (or the C++ serv │ │ │ │ +00161140: 6963 6520 636c 6173 7320 3c63 6f64 653e ice class │ │ │ │ +00161150: 6163 6365 7074 3c2f 636f 6465 3e20 6d65 accept me │ │ │ │ +00161160: 7468 6f64 2920 746f 2077 6169 7420 666f thod) to wait fo │ │ │ │ +00161170: 7220 616e 6420 6163 6365 7074 2061 2073 r and accept a s │ │ │ │ +00161180: 6f63 6b65 7420 636f 6e6e 6563 7469 6f6e ocket connection │ │ │ │ +00161190: 2072 6571 7565 7374 6564 2062 7920 6120 requested by a │ │ │ │ +001611a0: 636c 6965 6e74 2e20 5265 7475 726e 7320 client. Returns │ │ │ │ +001611b0: 6120 7661 6c69 6420 736f 636b 6574 206f a valid socket o │ │ │ │ +001611c0: 7220 3c63 6f64 653e 2353 4f41 505f 494e r #SOAP_IN │ │ │ │ +001611d0: 5641 4c49 445f 534f 434b 4554 3c2f 636f VALID_SOCKET when an erro │ │ │ │ +001611f0: 7220 6f63 6375 7272 6564 2061 6e64 2073 r occurred and s │ │ │ │ +00161200: 6574 7320 3c63 6f64 653e 3c61 2063 6c61 ets │ │ │ │ +001612b0: 736f 6170 3a3a 6572 726f 723c 2f61 3e3c soap::error< │ │ │ │ +001612c0: 2f63 6f64 653e 2074 6f20 6120 3c63 6f64 /code> to a soap_status value. │ │ │ │ +001613a0: 2054 6865 2062 7569 6c74 2d69 6e20 6675 The built-in fu │ │ │ │ +001613b0: 6e63 7469 6f6e 2061 7373 6967 6e65 6420 nction assigned │ │ │ │ +001613c0: 746f 203c 636f 6465 3e3c 6120 636c 6173 to soap::facce │ │ │ │ +00161480: 7074 3c2f 613e 3c2f 636f 6465 3e20 6973 pt is │ │ │ │ +00161490: 203c 636f 6465 3e74 6370 5f61 6363 6570 tcp_accep │ │ │ │ +001614a0: 743c 2f63 6f64 653e 2e3c 2f70 3e0a 3c68 t.

    ..fclos │ │ │ │ +001614e0: 653c 2f68 333e 0a3c 703e 3c63 6f64 653e e.

    │ │ │ │ +001614f0: 696e 7420 283c 6120 636c 6173 733d 2265 int (soap::fclo │ │ │ │ +00161590: 7365 3c2f 613e 2928 7374 7275 6374 2073 se)(struct s │ │ │ │ +001615a0: 6f61 7020 2a73 6f61 7029 3c2f 636f 6465 oap *soap)

    .

    This ca │ │ │ │ +001615c0: 6c6c 6261 636b 2069 7320 6361 6c6c 6564 llback is called │ │ │ │ +001615d0: 2062 7920 7468 6520 656e 6769 6e65 2061 by the engine a │ │ │ │ +001615e0: 7420 7468 6520 636c 6965 6e74 2d73 6964 t the client-sid │ │ │ │ +001615f0: 6520 746f 2063 6c6f 7365 2074 6865 2063 e to close the c │ │ │ │ +00161600: 7572 7265 6e74 2073 6f63 6b65 7420 636f urrent socket co │ │ │ │ +00161610: 6e6e 6563 7469 6f6e 2062 6566 6f72 6520 nnection before │ │ │ │ +00161620: 6120 6e65 7720 736f 636b 6574 2063 6f6e a new socket con │ │ │ │ +00161630: 6e65 6374 696f 6e20 6973 2065 7374 6162 nection is estab │ │ │ │ +00161640: 6c69 7368 6564 2e20 5468 6973 2063 616c lished. This cal │ │ │ │ +00161650: 6c62 6163 6b20 6d61 7920 6265 2063 616c lback may be cal │ │ │ │ +00161660: 6c65 6420 6d75 6c74 6970 6c65 2074 696d led multiple tim │ │ │ │ +00161670: 6573 2028 652e 672e 2062 7920 7468 6520 es (e.g. by the │ │ │ │ +00161680: 656e 6769 6e65 2061 6e64 2062 7920 706c engine and by pl │ │ │ │ +00161690: 7567 696e 7329 2074 6f20 636c 6f73 6520 ugins) to close │ │ │ │ +001616a0: 7468 6520 7361 6d65 2073 6f63 6b65 7420 the same socket │ │ │ │ +001616b0: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 so │ │ │ │ +00161770: 6170 3a3a 736f 636b 6574 3c2f 613e 3c2f ap::socket. Checks in │ │ │ │ +00161790: 7465 726e 616c 6c79 2069 6620 3c63 6f64 ternally if soap:: │ │ │ │ +00161860: 736f 636b 6574 3c2f 613e 3c2f 636f 6465 socket == #SOAP │ │ │ │ +00161880: 5f49 4e56 414c 4944 5f53 4f43 4b45 543c _INVALID_SOCKET< │ │ │ │ +00161890: 2f63 6f64 653e 2062 6566 6f72 6520 636c /code> before cl │ │ │ │ +001618a0: 6f73 696e 672c 2077 6869 6368 206d 6561 osing, which mea │ │ │ │ +001618b0: 6e73 2074 6861 7420 7468 6520 736f 636b ns that the sock │ │ │ │ +001618c0: 6574 2077 6173 2061 6c72 6561 6479 2063 et was already c │ │ │ │ +001618d0: 6c6f 7365 642e 2052 6574 7572 6e73 203c losed. Returns < │ │ │ │ +001618e0: 636f 6465 3e23 534f 4150 5f4f 4b3c 2f63 code>#SOAP_OK or a │ │ │ │ +00161900: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap_status │ │ │ │ +001619c0: 3c2f 636f 6465 3e20 2869 6e74 2920 6572 (int) er │ │ │ │ +001619d0: 726f 7220 636f 6465 2e20 5468 6520 6275 ror code. The bu │ │ │ │ +001619e0: 696c 742d 696e 2066 756e 6374 696f 6e20 ilt-in function │ │ │ │ +001619f0: 6173 7369 676e 6564 2074 6f20 3c63 6f64 assigned to soap::fclose< │ │ │ │ +00161aa0: 2f61 3e3c 2f63 6f64 653e 2069 7320 3c63 /a> is tcp_disconne │ │ │ │ +00161ac0: 6374 3c2f 636f 6465 3e2e 3c2f 703e 0a3c ct.

    .< │ │ │ │ +00161ad0: 6833 3e3c 6120 636c 6173 733d 2261 6e63 h3>.fres │ │ │ │ +00161b00: 6f6c 7665 3c2f 6833 3e0a 3c70 3e3c 636f olve.

    int ( │ │ │ │ +00161bb0: 736f 6170 3a3a 6672 6573 6f6c 7665 3c2f soap::fresolve)(struct soap │ │ │ │ +00161bd0: 2a73 6f61 702c 2063 6f6e 7374 2063 6861 *soap, const cha │ │ │ │ +00161be0: 7220 2a61 6464 722c 2073 7472 7563 7420 r *addr, struct │ │ │ │ +00161bf0: 696e 5f61 6464 7220 2a69 6e61 6464 7229 in_addr *inaddr) │ │ │ │ +00161c00: 3c2f 636f 6465 3e3c 2f70 3e0a 3c70 3e54

    .

    T │ │ │ │ +00161c10: 6869 7320 6361 6c6c 6261 636b 2069 7320 his callback is │ │ │ │ +00161c20: 6361 6c6c 6564 2062 7920 3c63 6f64 653e called by │ │ │ │ +00161c30: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap_bind (or the C+ │ │ │ │ +00161cc0: 2b20 7365 7276 6963 6520 636c 6173 7320 + service class │ │ │ │ +00161cd0: 3c63 6f64 653e 6269 6e64 3c2f 636f 6465 bind method) at the │ │ │ │ +00161cf0: 2073 6572 7665 722d 7369 6465 2061 6e64 server-side and │ │ │ │ +00161d00: 2062 7920 3c63 6f64 653e 3c61 2063 6c61 by soap_connec │ │ │ │ +00161d90: 743c 2f61 3e3c 2f63 6f64 653e 206f 7220 t or │ │ │ │ +00161da0: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 soap_connect_co │ │ │ │ +00161e20: 6d6d 616e 643c 2f61 3e3c 2f63 6f64 653e mmand │ │ │ │ +00161e30: 2061 7420 7468 6520 636c 6965 6e74 2d73 at the client-s │ │ │ │ +00161e40: 6964 6520 7769 7468 2061 2068 6f73 7420 ide with a host │ │ │ │ +00161e50: 3c63 6f64 653e 6e61 6d65 3c2f 636f 6465 name parameter to r │ │ │ │ +00161e70: 6573 6f6c 7665 2074 6f20 6164 6472 6573 esolve to addres │ │ │ │ +00161e80: 7320 3c63 6f64 653e 696e 6164 6472 3c2f s inaddr by address │ │ │ │ +00161ea0: 2074 7261 6e73 6c61 7469 6f6e 2e20 5768 translation. Wh │ │ │ │ +00161eb0: 656e 2073 7563 6365 7373 6675 6c20 7365 en successful se │ │ │ │ +00161ec0: 7473 2070 6172 616d 6574 6572 203c 636f ts parameter inaddr │ │ │ │ +00161ee0: 2061 6e64 2072 6574 7572 6e73 203c 636f and returns #SOAP_OK or a s │ │ │ │ +00161fc0: 6f61 705f 7374 6174 7573 3c2f 613e 3c2f oap_status (int) erro │ │ │ │ +00161fe0: 7220 636f 6465 2e20 5468 6520 6275 696c r code. The buil │ │ │ │ +00161ff0: 742d 696e 2066 756e 6374 696f 6e20 6173 t-in function as │ │ │ │ +00162000: 7369 676e 6564 2074 6f20 3c63 6f64 653e signed to │ │ │ │ +00162010: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap::fr │ │ │ │ +001620b0: 6573 6f6c 7665 3c2f 613e 3c2f 636f 6465 esolve is tcp_g │ │ │ │ +001620d0: 6574 686f 7374 3c2f 636f 6465 3e2e 3c2f ethost..

    . │ │ │ │ +00162110: 6663 6f6e 6e65 6374 3c2f 6833 3e0a 3c70 fconnect

    .

    int (soap::fc │ │ │ │ +001621d0: 6f6e 6e65 6374 3c2f 613e 2928 7374 7275 onnect)(stru │ │ │ │ +001621e0: 6374 2073 6f61 7020 2a73 6f61 702c 2063 ct soap *soap, c │ │ │ │ +001621f0: 6f6e 7374 2063 6861 7220 2a65 6e64 706f onst char *endpo │ │ │ │ +00162200: 696e 742c 2063 6f6e 7374 2063 6861 7220 int, const char │ │ │ │ +00162210: 2a68 6f73 742c 2069 6e74 2070 6f72 7429 *host, int port) │ │ │ │ +00162220: 3c2f 636f 6465 3e3c 2f70 3e0a 3c70 3e54

    .

    T │ │ │ │ +00162230: 6869 7320 6361 6c6c 6261 636b 2069 7320 his callback is │ │ │ │ +00162240: 6361 6c6c 6564 2062 7920 7468 6520 656e called by the en │ │ │ │ +00162250: 6769 6e65 2074 6f20 6f70 7469 6f6e 616c gine to optional │ │ │ │ +00162260: 6c79 206f 7665 7272 6964 6520 636c 6965 ly override clie │ │ │ │ +00162270: 6e74 2d73 6964 6520 636f 6e6e 6563 7469 nt-side connecti │ │ │ │ +00162280: 6e67 2e20 5468 6520 7061 7261 6d65 7465 ng. The paramete │ │ │ │ +00162290: 7273 203c 636f 6465 3e68 6f73 743c 2f63 rs host and p │ │ │ │ +001622b0: 6f72 743c 2f63 6f64 653e 2077 6572 6520 ort were │ │ │ │ +001622c0: 6d69 6372 6f2d 7061 7273 6564 2066 726f micro-parsed fro │ │ │ │ +001622d0: 6d20 7468 6520 3c63 6f64 653e 656e 6470 m the endp │ │ │ │ +001622e0: 6f69 6e74 3c2f 636f 6465 3e20 7072 696f oint prio │ │ │ │ +001622f0: 7220 746f 2070 6173 7369 6e67 2074 6865 r to passing the │ │ │ │ +00162300: 6d20 746f 2074 6869 7320 6361 6c6c 6261 m to this callba │ │ │ │ +00162310: 636b 2e20 5265 7475 726e 7320 3c63 6f64 ck. Returns #SOAP_OK or a so │ │ │ │ +001623f0: 6170 5f73 7461 7475 733c 2f61 3e3c 2f63 ap_status (int) error │ │ │ │ +00162410: 2063 6f64 652e 204e 6f20 6275 696c 742d code. No built- │ │ │ │ +00162420: 696e 2066 756e 6374 696f 6e20 6973 2061 in function is a │ │ │ │ +00162430: 7373 6967 6e65 6420 746f 203c 636f 6465 ssigned to soa │ │ │ │ +001624e0: 703a 3a66 636f 6e6e 6563 743c 2f61 3e3c p::fconnect< │ │ │ │ +001624f0: 2f63 6f64 653e 2e3c 2f70 3e0a 3c68 333e /code>.

    .

    │ │ │ │ +00162500: 3c61 2063 6c61 7373 3d22 616e 6368 6f72 .fdiscon │ │ │ │ +00162530: 6e65 6374 3c2f 6833 3e0a 3c70 3e3c 636f nect

    .

    int (soa │ │ │ │ +001625e0: 703a 3a66 6469 7363 6f6e 6e65 6374 3c2f p::fdisconnect)(struct soap │ │ │ │ +00162600: 2a73 6f61 7029 3c2f 636f 6465 3e3c 2f70 *soap)

    .

    This callba │ │ │ │ +00162620: 636b 2069 7320 6361 6c6c 6564 2062 7920 ck is called by │ │ │ │ +00162630: 7468 6520 656e 6769 6e65 203c 636f 6465 the engine soap_closeso │ │ │ │ +001626c0: 636b 3c2f 613e 3c2f 636f 6465 3e20 6265 ck be │ │ │ │ +001626d0: 666f 7265 2074 6865 203c 636f 6465 3e3c fore the < │ │ │ │ +001626e0: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ +001626f0: 663d 2267 726f 7570 5f5f 6772 6f75 705f f="group__group_ │ │ │ │ +00162700: 5f63 616c 6c62 6163 6b73 2e68 746d 6c23 _callbacks.html# │ │ │ │ +00162710: 6761 6239 3539 3164 6438 3064 6262 3065 gab9591dd80dbb0e │ │ │ │ +00162720: 3537 3137 3834 6261 6435 3432 3162 3232 571784bad5421b22 │ │ │ │ +00162730: 3032 2220 7469 746c 653d 2243 616c 6c62 02" title="Callb │ │ │ │ +00162740: 6163 6b20 7468 6174 2063 6c6f 7365 7320 ack that closes │ │ │ │ +00162750: 7468 6520 6375 7272 656e 7420 736f 636b the current sock │ │ │ │ +00162760: 6574 2063 6f6e 6e65 6374 696f 6e2e 223e et connection."> │ │ │ │ +00162770: 736f 6170 3a3a 6663 6c6f 7365 3c2f 613e soap::fclose │ │ │ │ +00162780: 3c2f 636f 6465 3e20 6361 6c6c 6261 636b callback │ │ │ │ +00162790: 2069 7320 6361 6c6c 6564 2074 6f20 7368 is called to sh │ │ │ │ +001627a0: 7574 646f 776e 2f64 6973 636f 6e6e 6563 utdown/disconnec │ │ │ │ +001627b0: 742e 2052 6574 7572 6e73 203c 636f 6465 t. Returns #SOAP_OK │ │ │ │ +001627d0: 206f 7220 6120 3c63 6f64 653e 3c61 2063 or a soa │ │ │ │ +00162890: 705f 7374 6174 7573 3c2f 613e 3c2f 636f p_status (int) error │ │ │ │ +001628b0: 636f 6465 2e20 4e6f 2062 7569 6c74 2d69 code. No built-i │ │ │ │ +001628c0: 6e20 6675 6e63 7469 6f6e 2069 7320 6173 n function is as │ │ │ │ +001628d0: 7369 676e 6564 2074 6f20 3c63 6f64 653e signed to │ │ │ │ +001628e0: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap::fdisc │ │ │ │ +00162980: 6f6e 6e65 6374 3c2f 613e 3c2f 636f 6465 onnect.

    .

    < │ │ │ │ +001629c0: 2f61 3e0a 6663 6c6f 7365 736f 636b 6574 /a>.fclosesocket │ │ │ │ +001629d0: 3c2f 6833 3e0a 3c70 3e3c 636f 6465 3e69

    .

    i │ │ │ │ +001629e0: 6e74 2028 3c61 2063 6c61 7373 3d22 656c nt (soap::fclo │ │ │ │ +00162a70: 7365 736f 636b 6574 3c2f 613e 2928 7374 sesocket)(st │ │ │ │ +00162a80: 7275 6374 2073 6f61 7020 2a73 6f61 702c ruct soap *soap, │ │ │ │ +00162a90: 2053 4f41 505f 534f 434b 4554 2073 6f63 SOAP_SOCKET soc │ │ │ │ +00162aa0: 6b29 3c2f 636f 6465 3e3c 2f70 3e0a 3c70 k)

    .

    This callback i │ │ │ │ +00162ac0: 7320 6361 6c6c 6564 2074 6f20 636c 6f73 s called to clos │ │ │ │ +00162ad0: 6520 6120 736f 636b 6574 2062 7920 7468 e a socket by th │ │ │ │ +00162ae0: 6520 656e 6769 6e65 2e20 5265 7475 726e e engine. Return │ │ │ │ +00162af0: 7320 3c63 6f64 653e 2353 4f41 505f 4f4b s #SOAP_OK │ │ │ │ +00162b00: 3c2f 636f 6465 3e20 6f72 2061 203c 636f or a soap_status< │ │ │ │ +00162bd0: 2f61 3e3c 2f63 6f64 653e 2028 696e 7429 /a> (int) │ │ │ │ +00162be0: 2065 7272 6f72 2063 6f64 652e 2054 6865 error code. The │ │ │ │ +00162bf0: 2062 7569 6c74 2d69 6e20 6675 6e63 7469 built-in functi │ │ │ │ +00162c00: 6f6e 2061 7373 6967 6e65 6420 746f 203c on assigned to < │ │ │ │ +00162c10: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soap::fcl │ │ │ │ +00162ca0: 6f73 6573 6f63 6b65 743c 2f61 3e3c 2f63 osesocket is tc │ │ │ │ +00162cc0: 705f 636c 6f73 6573 6f63 6b65 743c 2f63 p_closesocket.

    .

    .fshutdown │ │ │ │ +00162d10: 736f 636b 6574 3c2f 6833 3e0a 3c70 3e3c socket

    .

    < │ │ │ │ +00162d20: 636f 6465 3e69 6e74 2028 3c61 2063 6c61 code>int ( │ │ │ │ +00162db0: 736f 6170 3a3a 6673 6875 7464 6f77 6e73 soap::fshutdowns │ │ │ │ +00162dc0: 6f63 6b65 743c 2f61 3e29 2873 7472 7563 ocket)(struc │ │ │ │ +00162dd0: 7420 736f 6170 202a 736f 6170 2c20 534f t soap *soap, SO │ │ │ │ +00162de0: 4150 5f53 4f43 4b45 5420 736f 636b 2c20 AP_SOCKET sock, │ │ │ │ +00162df0: 696e 7420 686f 7729 3c2f 636f 6465 3e3c int how)< │ │ │ │ +00162e00: 2f70 3e0a 3c70 3e54 6869 7320 6361 6c6c /p>.

    This call │ │ │ │ +00162e10: 6261 636b 2069 7320 6361 6c6c 6564 2074 back is called t │ │ │ │ +00162e20: 6f20 7368 7574 2064 6f77 6e20 6120 736f o shut down a so │ │ │ │ +00162e30: 636b 6574 2062 7920 7468 6520 656e 6769 cket by the engi │ │ │ │ +00162e40: 6e65 2e20 5265 7475 726e 7320 3c63 6f64 ne. Returns #SOAP_OK or a so │ │ │ │ +00162f20: 6170 5f73 7461 7475 733c 2f61 3e3c 2f63 ap_status (int) error │ │ │ │ +00162f40: 2063 6f64 652e 2054 6865 2062 7569 6c74 code. The built │ │ │ │ +00162f50: 2d69 6e20 6675 6e63 7469 6f6e 2061 7373 -in function ass │ │ │ │ +00162f60: 6967 6e65 6420 746f 203c 636f 6465 3e3c igned to < │ │ │ │ +00162f70: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ +00162f80: 663d 2267 726f 7570 5f5f 6772 6f75 705f f="group__group_ │ │ │ │ +00162f90: 5f63 616c 6c62 6163 6b73 2e68 746d 6c23 _callbacks.html# │ │ │ │ +00162fa0: 6761 3531 6530 3964 6466 3736 3961 3264 ga51e09ddf769a2d │ │ │ │ +00162fb0: 6463 6438 3734 6662 3665 3666 6235 3238 dcd874fb6e6fb528 │ │ │ │ +00162fc0: 3964 2220 7469 746c 653d 2243 616c 6c62 9d" title="Callb │ │ │ │ +00162fd0: 6163 6b20 7468 6174 2073 6875 7473 2064 ack that shuts d │ │ │ │ +00162fe0: 6f77 6e20 6120 6769 7665 6e20 736f 636b own a given sock │ │ │ │ +00162ff0: 6574 2e22 3e73 6f61 703a 3a66 7368 7574 et.">soap::fshut │ │ │ │ +00163000: 646f 776e 736f 636b 6574 3c2f 613e 3c2f downsocket is t │ │ │ │ +00163020: 6370 5f73 6875 7464 6f77 6e73 6f63 6b65 cp_shutdownsocke │ │ │ │ +00163030: 743c 2f63 6f64 653e 2e3c 2f70 3e0a 3c68 t.

    ..fpoll │ │ │ │ +00163070: 3c2f 6833 3e0a 3c70 3e3c 636f 6465 3e69 .

    i │ │ │ │ +00163080: 6e74 2028 3c61 2063 6c61 7373 3d22 656c nt ( │ │ │ │ +00163140: 736f 6170 3a3a 6670 6f6c 6c3c 2f61 3e29 soap::fpoll) │ │ │ │ +00163150: 2873 7472 7563 7420 736f 6170 202a 736f (struct soap *so │ │ │ │ +00163160: 6170 293c 2f63 6f64 653e 3c2f 703e 0a3c ap)

    .< │ │ │ │ +00163170: 703e 5468 6973 2063 616c 6c62 6163 6b20 p>This callback │ │ │ │ +00163180: 6973 2063 616c 6c65 6420 6279 2074 6865 is called by the │ │ │ │ +00163190: 2065 6e67 696e 6520 746f 2077 6169 7420 engine to wait │ │ │ │ +001631a0: 666f 7220 6163 7469 7669 7479 206f 6e20 for activity on │ │ │ │ +001631b0: 7468 6520 3c63 6f64 653e 3c61 2063 6c61 the soap::socket or soap: │ │ │ │ +00163350: 3a6d 6173 7465 723c 2f61 3e3c 2f63 6f64 :master socket using │ │ │ │ +00163370: 3c63 6f64 653e 706f 6c6c 3c2f 636f 6465 poll or selec │ │ │ │ +00163390: 743c 2f63 6f64 653e 2e20 5469 6d65 7320 t. Times │ │ │ │ +001633a0: 6f75 7420 7768 656e 203c 636f 6465 3e3c out when < │ │ │ │ +001633b0: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ +001633c0: 663d 2273 7472 7563 7473 6f61 702e 6874 f="structsoap.ht │ │ │ │ +001633d0: 6d6c 2361 3731 3162 6233 6135 3364 6537 ml#a711bb3a53de7 │ │ │ │ +001633e0: 6363 3632 3432 3965 3464 3361 3265 3062 cc62429e4d3a2e0b │ │ │ │ +001633f0: 3534 3734 2220 7469 746c 653d 2255 7365 5474" title="Use │ │ │ │ +00163400: 722d 6465 6669 6e61 626c 6520 7469 6d65 r-definable time │ │ │ │ +00163410: 6f75 7420 746f 2073 656e 6420 6120 7061 out to send a pa │ │ │ │ +00163420: 636b 6574 206f 6620 6461 7461 2c20 706f cket of data, po │ │ │ │ +00163430: 7369 7469 7665 2074 696d 656f 7574 2076 sitive timeout v │ │ │ │ +00163440: 616c 7565 7320 6172 6520 7365 636f 6e64 alues are second │ │ │ │ +00163450: 732c 2e2e 2e22 3e73 6f61 703a 3a73 656e s,...">soap::sen │ │ │ │ +00163460: 645f 7469 6d65 6f75 743c 2f61 3e3c 2f63 d_timeout or soap::r │ │ │ │ +00163530: 6563 765f 7469 6d65 6f75 743c 2f61 3e3c ecv_timeout< │ │ │ │ +00163540: 2f63 6f64 653e 2061 7265 206e 6f6e 7a65 /code> are nonze │ │ │ │ +00163550: 726f 2e20 5265 7475 726e 7320 3c63 6f64 ro. Returns #SOAP_OK or a so │ │ │ │ +00163630: 6170 5f73 7461 7475 733c 2f61 3e3c 2f63 ap_status (int) error │ │ │ │ +00163650: 2063 6f64 652e 2054 6865 2062 7569 6c74 code. The built │ │ │ │ +00163660: 2d69 6e20 6675 6e63 7469 6f6e 2061 7373 -in function ass │ │ │ │ +00163670: 6967 6e65 6420 746f 203c 636f 6465 3e3c igned to < │ │ │ │ +00163680: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ +00163690: 663d 2267 726f 7570 5f5f 6772 6f75 705f f="group__group_ │ │ │ │ +001636a0: 5f63 616c 6c62 6163 6b73 2e68 746d 6c23 _callbacks.html# │ │ │ │ +001636b0: 6761 3230 3231 3061 6131 3731 3031 3962 ga20210aa171019b │ │ │ │ +001636c0: 3237 6566 3138 3264 3835 3365 3264 3665 27ef182d853e2d6e │ │ │ │ +001636d0: 3266 2220 7469 746c 653d 2243 616c 6c62 2f" title="Callb │ │ │ │ +001636e0: 6163 6b20 7468 6174 2062 6c6f 636b 7320 ack that blocks │ │ │ │ +001636f0: 756e 7469 6c20 6163 7469 7669 7479 2069 until activity i │ │ │ │ +00163700: 7320 6465 7465 6374 6564 206f 6e20 7468 s detected on th │ │ │ │ +00163710: 6520 736f 6170 3a3a 736f 636b 6574 206f e soap::socket o │ │ │ │ +00163720: 7220 736f 6170 3a3a 6d61 7374 6572 2073 r soap::master s │ │ │ │ +00163730: 6f63 6b65 742c 2e2e 2e22 3e73 6f61 703a ocket,...">soap: │ │ │ │ +00163740: 3a66 706f 6c6c 3c2f 613e 3c2f 636f 6465 :fpoll is soap_ │ │ │ │ +00163760: 706f 6c6c 3c2f 636f 6465 3e2e 3c2f 703e poll.

    │ │ │ │ +00163770: 0a3c 6833 3e3c 6120 636c 6173 733d 2261 .

    .fr │ │ │ │ +001637a0: 6563 763c 2f68 333e 0a3c 703e 3c63 6f64 ecv

    .

    size_t (soap::frecv)(struct soap │ │ │ │ +00163870: 2a73 6f61 702c 2063 6861 7220 2a62 7566 *soap, char *buf │ │ │ │ +00163880: 2c20 7369 7a65 5f74 206c 656e 293c 2f63 , size_t len)

    .

    This │ │ │ │ +001638a0: 2063 616c 6c62 6163 6b20 6973 2063 616c callback is cal │ │ │ │ +001638b0: 6c65 6420 6279 2074 6865 2065 6e67 696e led by the engin │ │ │ │ +001638c0: 6520 746f 2072 6563 6569 7665 2028 6f72 e to receive (or │ │ │ │ +001638d0: 2072 6561 6429 2064 6174 6120 696e 746f read) data into │ │ │ │ +001638e0: 2061 2073 7065 6369 6669 6564 2062 7566 a specified buf │ │ │ │ +001638f0: 6665 7220 3c63 6f64 653e 6275 663c 2f63 fer buf and l │ │ │ │ +00163910: 656e 3c2f 636f 6465 3e2e 2054 6865 2073 en. The s │ │ │ │ +00163920: 6f75 7263 6520 666f 7220 7468 6520 6461 ource for the da │ │ │ │ +00163930: 7461 2074 6f20 7265 6164 2062 7920 7468 ta to read by th │ │ │ │ +00163940: 6973 2063 616c 6c62 6163 6b20 6973 203c is callback is < │ │ │ │ +00163950: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soa │ │ │ │ +00163a10: 703a 3a69 733c 2f61 3e3c 2f63 6f64 653e p::is │ │ │ │ +00163a20: 2077 6865 6e20 6e6f 6e2d 4e55 4c4c 2c20 when non-NULL, │ │ │ │ +00163a30: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 so │ │ │ │ +00163af0: 6170 3a3a 736f 636b 6574 3c2f 613e 3c2f ap::socket when valid │ │ │ │ +00163b10: 2c20 6f72 203c 636f 6465 3e3c 6120 636c , or soap::recvfd< │ │ │ │ +00163be0: 2f61 3e3c 2f63 6f64 653e 2e20 5265 7475 /a>. Retu │ │ │ │ +00163bf0: 726e 7320 3c63 6f64 653e 2353 4f41 505f rns #SOAP_ │ │ │ │ +00163c00: 4f4b 3c2f 636f 6465 3e20 6f72 2061 203c OK or a < │ │ │ │ +00163c10: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soap_statu │ │ │ │ +00163cd0: 733c 2f61 3e3c 2f63 6f64 653e 2028 696e s (in │ │ │ │ +00163ce0: 7429 2065 7272 6f72 2063 6f64 652e 2054 t) error code. T │ │ │ │ +00163cf0: 6865 2062 7569 6c74 2d69 6e20 6675 6e63 he built-in func │ │ │ │ +00163d00: 7469 6f6e 2061 7373 6967 6e65 6420 746f tion assigned to │ │ │ │ +00163d10: 203c 636f 6465 3e3c 6120 636c 6173 733d │ │ │ │ +00163db0: 736f 6170 3a3a 6672 6563 763c 2f61 3e3c soap::frecv< │ │ │ │ +00163dc0: 2f63 6f64 653e 2069 7320 3c63 6f64 653e /code> is │ │ │ │ +00163dd0: 6672 6563 763c 2f63 6f64 653e 2e3c 2f70 frecv.

    .

    .f │ │ │ │ +00163e10: 7365 6e64 3c2f 6833 3e0a 3c70 3e3c 636f send

    .

    int (soap::fsend)(struct soap * │ │ │ │ +00163ed0: 736f 6170 2c20 636f 6e73 7420 6368 6172 soap, const char │ │ │ │ +00163ee0: 202a 6275 662c 2073 697a 655f 7420 6c65 *buf, size_t le │ │ │ │ +00163ef0: 6e29 3c2f 636f 6465 3e3c 2f70 3e0a 3c70 n)

    .

    This callback i │ │ │ │ +00163f10: 7320 6361 6c6c 6564 2062 7920 7468 6520 s called by the │ │ │ │ +00163f20: 656e 6769 6e65 2074 6f20 7365 6e64 2028 engine to send ( │ │ │ │ +00163f30: 6f72 2077 7269 7465 2920 6461 7461 2073 or write) data s │ │ │ │ +00163f40: 7065 6369 6669 6564 2062 7920 3c63 6f64 pecified by data by │ │ │ │ +00163f60: 7465 7320 6f66 206c 656e 6774 6820 3c63 tes of length len. │ │ │ │ +00163f80: 5468 6520 7369 6e6b 2066 6f72 2074 6865 The sink for the │ │ │ │ +00163f90: 2064 6174 6120 746f 2062 6520 7365 6e74 data to be sent │ │ │ │ +00163fa0: 2074 6f20 6973 2074 7970 6963 616c 6c79 to is typically │ │ │ │ +00163fb0: 203c 636f 6465 3e3c 6120 636c 6173 733d s │ │ │ │ +00164070: 6f61 703a 3a73 6f63 6b65 743c 2f61 3e3c oap::socket< │ │ │ │ +00164080: 2f63 6f64 653e 2c20 3c63 6f64 653e 3c61 /code>, soap::send │ │ │ │ +00164150: 6664 3c2f 613e 3c2f 636f 6465 3e20 6f72 fd or │ │ │ │ +00164160: 203c 636f 6465 3e3c 6120 636c 6173 733d s │ │ │ │ +00164220: 6f61 703a 3a6f 733c 2f61 3e3c 2f63 6f64 oap::os. Returns #SOAP_OK or a so │ │ │ │ +00164310: 6170 5f73 7461 7475 733c 2f61 3e3c 2f63 ap_status (int) error │ │ │ │ +00164330: 2063 6f64 652e 2054 6865 2062 7569 6c74 code. The built │ │ │ │ +00164340: 2d69 6e20 6675 6e63 7469 6f6e 2061 7373 -in function ass │ │ │ │ +00164350: 6967 6e65 6420 746f 203c 636f 6465 3e3c igned to < │ │ │ │ +00164360: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ +00164370: 663d 2267 726f 7570 5f5f 6772 6f75 705f f="group__group_ │ │ │ │ +00164380: 5f63 616c 6c62 6163 6b73 2e68 746d 6c23 _callbacks.html# │ │ │ │ +00164390: 6761 6664 3532 6238 3036 3535 6534 6631 gafd52b80655e4f1 │ │ │ │ +001643a0: 3032 3165 6464 3663 3535 6238 6466 6564 021edd6c55b8dfed │ │ │ │ +001643b0: 6666 2220 7469 746c 653d 2243 616c 6c62 ff" title="Callb │ │ │ │ +001643c0: 6163 6b20 7468 6174 2073 656e 6473 2074 ack that sends t │ │ │ │ +001643d0: 6865 2067 6976 656e 2062 7974 6573 206f he given bytes o │ │ │ │ +001643e0: 6620 6461 7461 2e22 3e73 6f61 703a 3a66 f data.">soap::f │ │ │ │ +001643f0: 7365 6e64 3c2f 613e 3c2f 636f 6465 3e20 send │ │ │ │ +00164400: 6973 203c 636f 6465 3e66 7365 6e64 3c2f is fsend.

    .

    < │ │ │ │ +00164420: 6120 636c 6173 733d 2261 6e63 686f 7222 a class="anchor" │ │ │ │ +00164430: 2069 643d 2261 7574 6f74 6f63 5f6d 6435 id="autotoc_md5 │ │ │ │ +00164440: 3622 3e3c 2f61 3e0a 6673 6572 7665 726c 6">.fserverl │ │ │ │ +00164450: 6f6f 703c 2f68 333e 0a3c 703e 3c63 6f64 oop

    .

    int (soa │ │ │ │ +00164530: 703a 3a66 7365 7276 656c 6f6f 703c 2f61 p::fserveloop)(struct soap * │ │ │ │ +00164550: 736f 6170 293c 2f63 6f64 653e 3c2f 703e soap)

    │ │ │ │ +00164560: 0a3c 703e 5468 6973 2063 616c 6c62 6163 .

    This callbac │ │ │ │ +00164570: 6b20 6973 2063 616c 6c65 6420 6166 7465 k is called afte │ │ │ │ +00164580: 7220 6561 6368 2073 7563 6365 7373 6675 r each successfu │ │ │ │ +00164590: 6c20 636f 6d70 6c65 7469 6f6e 206f 6620 l completion of │ │ │ │ +001645a0: 6120 7365 7276 6572 206f 7065 7261 7469 a server operati │ │ │ │ +001645b0: 6f6e 2069 6e20 7468 6520 7365 7276 6572 on in the server │ │ │ │ +001645c0: 206c 6f6f 702e 2045 7865 6375 7465 7320 loop. Executes │ │ │ │ +001645d0: 696d 6d65 6469 6174 656c 7920 6166 7465 immediately afte │ │ │ │ +001645e0: 7220 7365 6e64 696e 6720 7468 6520 7265 r sending the re │ │ │ │ +001645f0: 7370 6f6e 7365 2074 6f20 6120 636c 6965 sponse to a clie │ │ │ │ +00164600: 6e74 2061 6e64 2062 6566 6f72 6520 7468 nt and before th │ │ │ │ +00164610: 6520 6e65 7874 206b 6565 702d 616c 6976 e next keep-aliv │ │ │ │ +00164620: 6520 7365 7276 6572 206c 6f6f 7020 6974 e server loop it │ │ │ │ +00164630: 6572 6174 696f 6e20 7768 656e 2065 6e61 eration when ena │ │ │ │ +00164640: 626c 6564 2077 6974 6820 3c63 6f64 653e bled with │ │ │ │ +00164650: 2353 4f41 505f 494f 5f4b 4545 5041 4c49 #SOAP_IO_KEEPALI │ │ │ │ +00164660: 5645 3c2f 636f 6465 3e2e 2054 6869 7320 VE. This │ │ │ │ +00164670: 6361 6c6c 6261 636b 2063 616e 2062 6520 callback can be │ │ │ │ +00164680: 7573 6564 2074 6f20 7265 636c 6169 6d20 used to reclaim │ │ │ │ +00164690: 7265 736f 7572 6365 7320 696e 2074 6865 resources in the │ │ │ │ +001646a0: 206b 6565 702d 616c 6976 6520 7365 7276 keep-alive serv │ │ │ │ +001646b0: 6572 206c 6f6f 702c 2066 6f72 2065 7861 er loop, for exa │ │ │ │ +001646c0: 6d70 6c65 206d 616e 6167 6564 206d 656d mple managed mem │ │ │ │ +001646d0: 6f72 7920 6361 6e20 6265 2072 6563 6c61 ory can be recla │ │ │ │ +001646e0: 696d 6564 2062 7920 6361 6c6c 696e 6720 imed by calling │ │ │ │ +001646f0: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 soap_destro │ │ │ │ +001647b0: 793c 2f61 3e3c 2f63 6f64 653e 2061 6e64 y and │ │ │ │ +001647c0: 203c 636f 6465 3e3c 6120 636c 6173 733d soap_ │ │ │ │ +00164890: 656e 643c 2f61 3e3c 2f63 6f64 653e 2069 end i │ │ │ │ +001648a0: 6e20 7468 6174 206f 7264 6572 2061 6e64 n that order and │ │ │ │ +001648b0: 2061 6c6c 2064 6573 6572 6961 6c69 7a65 all deserialize │ │ │ │ +001648c0: 6420 616e 6420 6f74 6865 7220 6479 6e61 d and other dyna │ │ │ │ +001648d0: 6d69 6361 6c6c 792d 616c 6c6f 6361 7465 mically-allocate │ │ │ │ +001648e0: 6420 6461 7461 206d 616e 6167 6564 2062 d data managed b │ │ │ │ +001648f0: 7920 7468 6520 636f 6e74 6578 7420 7769 y the context wi │ │ │ │ +00164900: 6c6c 2062 6520 6465 616c 6c6f 6361 7465 ll be deallocate │ │ │ │ +00164910: 642e 2052 6574 7572 6e73 203c 636f 6465 d. Returns #SOAP_OK │ │ │ │ +00164930: 206f 7220 6120 3c63 6f64 653e 3c61 2063 or a soa │ │ │ │ +001649f0: 705f 7374 6174 7573 3c2f 613e 3c2f 636f p_status (int) error │ │ │ │ +00164a10: 636f 6465 2e20 4e6f 2062 7569 6c74 2d69 code. No built-i │ │ │ │ +00164a20: 6e20 6675 6e63 7469 6f6e 2069 7320 6173 n function is as │ │ │ │ +00164a30: 7369 676e 6564 2074 6f20 3c63 6f64 653e signed to │ │ │ │ +00164a40: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap::fser │ │ │ │ +00164b10: 7665 6c6f 6f70 3c2f 613e 3c2f 636f 6465 veloop.

    .

    < │ │ │ │ +00164b50: 2f61 3e0a 666d 616c 6c6f 633c 2f68 333e /a>.fmalloc

    │ │ │ │ +00164b60: 0a3c 703e 3c63 6f64 653e 766f 6964 2028 .

    void ( │ │ │ │ +00164b70: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap │ │ │ │ +00164c10: 3a3a 666d 616c 6c6f 633c 2f61 3e29 2873 ::fmalloc)(s │ │ │ │ +00164c20: 7472 7563 7420 736f 6170 202a 736f 6170 truct soap *soap │ │ │ │ +00164c30: 2c20 7369 7a65 5f74 2073 697a 6529 3c2f , size_t size)

    .

    Thi │ │ │ │ +00164c50: 7320 6361 6c6c 6261 636b 2063 616e 2062 s callback can b │ │ │ │ +00164c60: 6520 7573 6564 2074 6f20 6f76 6572 7269 e used to overri │ │ │ │ +00164c70: 6465 206d 656d 6f72 7920 616c 6c6f 6361 de memory alloca │ │ │ │ +00164c80: 7469 6f6e 2061 6e64 206d 616e 6167 656d tion and managem │ │ │ │ +00164c90: 656e 7420 646f 6e65 2062 7920 3c63 6f64 ent done by soap_malloc< │ │ │ │ +00164d50: 2f61 3e3c 2f63 6f64 653e 2069 6e20 432e /a> in C. │ │ │ │ +00164d60: 204d 656d 6f72 7920 616c 6c6f 6361 7465 Memory allocate │ │ │ │ +00164d70: 6420 7669 6120 7468 6973 2063 616c 6c62 d via this callb │ │ │ │ +00164d80: 6163 6b20 7769 6c6c 206e 6f74 2062 6520 ack will not be │ │ │ │ +00164d90: 6d61 6e61 6765 6420 616e 6420 6e6f 7420 managed and not │ │ │ │ +00164da0: 6265 2061 7574 6f6d 6174 6963 616c 6c79 be automatically │ │ │ │ +00164db0: 2072 656c 6561 7365 6420 6279 2074 6865 released by the │ │ │ │ +00164dc0: 2065 6e67 696e 652e 2049 6e73 7465 6164 engine. Instead │ │ │ │ +00164dd0: 2c20 7468 6520 6170 706c 6963 6174 696f , the applicatio │ │ │ │ +00164de0: 6e20 7573 696e 6720 7468 6973 2063 616c n using this cal │ │ │ │ +00164df0: 6c62 6163 6b20 7368 6f75 6c64 2072 656c lback should rel │ │ │ │ +00164e00: 6561 7365 2061 6c6c 6f63 6174 6564 206d ease allocated m │ │ │ │ +00164e10: 656d 6f72 792e 2041 6c6c 2061 6c6c 6f63 emory. All alloc │ │ │ │ +00164e20: 6174 696f 6e73 2064 6f6e 6520 6279 203c ations done by < │ │ │ │ +00164e30: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soap_mall │ │ │ │ +00164ee0: 6f63 3c2f 613e 3c2f 636f 6465 3e20 6172 oc ar │ │ │ │ +00164ef0: 6520 7265 706c 6163 6564 2077 6974 6820 e replaced with │ │ │ │ +00164f00: 6120 6361 6c6c 2074 6f20 3c63 6f64 653e a call to │ │ │ │ +00164f10: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap │ │ │ │ +00164fb0: 3a3a 666d 616c 6c6f 633c 2f61 3e3c 2f63 ::fmalloc. However, n │ │ │ │ +00164fd0: 6f20 6f74 6865 7220 616c 6c6f 6361 7469 o other allocati │ │ │ │ +00164fe0: 6f6e 732c 2073 7563 6820 6173 203c 636f ons, such as soap_n │ │ │ │ +00165080: 6577 3c2f 613e 3c2f 636f 6465 3e20 616e ew an │ │ │ │ +00165090: 6420 3c63 6f64 653e 736f 6170 5f6e 6577 d soap_new │ │ │ │ +001650a0: 5f54 3c2f 636f 6465 3e20 666f 7220 432b _T for C+ │ │ │ │ +001650b0: 2b20 636c 6173 7365 7320 3c63 6f64 653e + classes │ │ │ │ +001650c0: 543c 2f63 6f64 653e 2061 7265 2061 6666 T are aff │ │ │ │ +001650d0: 6563 7465 642c 2062 6563 6175 7365 206f ected, because o │ │ │ │ +001650e0: 626a 6563 7473 2061 7265 2061 6c6c 6f63 bjects are alloc │ │ │ │ +001650f0: 6174 6564 2064 6966 6665 7265 6e74 6c79 ated differently │ │ │ │ +00165100: 2e20 5468 6973 2063 616c 6c62 6163 6b20 . This callback │ │ │ │ +00165110: 6973 2074 6865 7265 666f 7265 206e 6f74 is therefore not │ │ │ │ +00165120: 2075 7365 6675 6c20 666f 7220 432b 2b20 useful for C++ │ │ │ │ +00165130: 6170 706c 6963 6174 696f 6e73 2e20 5265 applications. Re │ │ │ │ +00165140: 7475 726e 7320 6120 706f 696e 7465 7220 turns a pointer │ │ │ │ +00165150: 746f 2064 796e 616d 6963 616c 6c79 2061 to dynamically a │ │ │ │ +00165160: 6c6c 6f63 6174 6564 206d 656d 6f72 7920 llocated memory │ │ │ │ +00165170: 6f72 204e 554c 4c20 6f6e 2066 6169 6c75 or NULL on failu │ │ │ │ +00165180: 7265 2074 6f20 616c 6c6f 6361 7465 2e20 re to allocate. │ │ │ │ +00165190: 4e6f 2062 7569 6c74 2d69 6e20 6675 6e63 No built-in func │ │ │ │ +001651a0: 7469 6f6e 2069 7320 6173 7369 676e 6564 tion is assigned │ │ │ │ +001651b0: 2074 6f20 3c63 6f64 653e 3c61 2063 6c61 to soap::fmal │ │ │ │ +00165260: 6c6f 633c 2f61 3e3c 2f63 6f64 653e 2e3c loc.< │ │ │ │ +00165270: 2f70 3e0a 3c64 6c20 636c 6173 733d 2273 /p>.

    │ │ │ │ +00165290: 3c64 743e 5761 726e 696e 673c 2f64 743e
    Warning
    │ │ │ │ +001652a0: 3c64 643e 4465 7072 6563 6174 6564 2073
    Deprecated s │ │ │ │ +001652b0: 696e 6365 2032 2e38 2e37 322e 2044 6566 ince 2.8.72. Def │ │ │ │ +001652c0: 696e 6520 3c63 6f64 653e 2353 4f41 505f ine #SOAP_ │ │ │ │ +001652d0: 4d41 4c4c 4f43 3c2f 636f 6465 3e20 616e MALLOC an │ │ │ │ +001652e0: 6420 3c63 6f64 653e 2353 4f41 505f 4652 d #SOAP_FR │ │ │ │ +001652f0: 4545 3c2f 636f 6465 3e20 696e 7374 6561 EE instea │ │ │ │ +00165300: 642e 3c2f 6464 3e3c 2f64 6c3e 0a3c 6833 d.
    .

    .user v │ │ │ │ +00165340: 6172 6961 626c 653c 2f68 333e 0a3c 703e ariable

    .

    │ │ │ │ +00165350: 4120 3c63 6f64 653e 766f 6964 2a20 3c61 A void* soap::user │ │ │ │ +00165420: 3c2f 613e 3c2f 636f 6465 3e20 7661 7269 vari │ │ │ │ +00165430: 6162 6c65 2069 7320 6176 6169 6c61 626c able is availabl │ │ │ │ +00165440: 6520 746f 2070 6173 7320 7573 6572 2d64 e to pass user-d │ │ │ │ +00165450: 6566 696e 6564 2064 6174 6120 746f 2074 efined data to t │ │ │ │ +00165460: 6865 2063 616c 6c62 6163 6b73 2e3c 2f70 he callbacks.

    .

    .E │ │ │ │ +001654a0: 7861 6d70 6c65 733c 2f68 333e 0a3c 703e xamples

    .

    │ │ │ │ +001654b0: 5468 6520 666f 6c6c 6f77 696e 6720 6578 The following ex │ │ │ │ +001654c0: 616d 706c 6520 7573 6573 2049 2f4f 2063 ample uses I/O c │ │ │ │ +001654d0: 616c 6c62 6163 6b73 2066 6f72 2063 7573 allbacks for cus │ │ │ │ +001654e0: 746f 6d69 7a65 6420 7365 7269 616c 697a tomized serializ │ │ │ │ +001654f0: 6174 696f 6e20 6f66 2064 6174 6120 696e ation of data in │ │ │ │ +00165500: 746f 2061 2066 6978 6564 2d73 697a 6520 to a fixed-size │ │ │ │ +00165510: 6275 6666 6572 2061 6e64 2064 6573 6572 buffer and deser │ │ │ │ +00165520: 6961 6c69 7a61 7469 6f6e 2062 6163 6b20 ialization back │ │ │ │ +00165530: 696e 746f 2061 2064 6174 6120 7374 7275 into a data stru │ │ │ │ +00165540: 6374 7572 653a 3c2f 703e 0a3c 6469 7620 cture:

    .
    cha │ │ │ │ +00165590: 723c 2f73 7061 6e3e 2062 7566 5b31 3030 r buf[100 │ │ │ │ +001655a0: 3030 5d3b 203c 7370 616e 2063 6c61 7373 00]; // XM │ │ │ │ +001655c0: 4c20 6275 6666 6572 203c 2f73 7061 6e3e L buffer │ │ │ │ +001655d0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    int le │ │ │ │ +00165610: 6e31 203d 2030 3b20 2020 203c 7370 616e n1 = 0; // #chars writt │ │ │ │ +00165640: 656e 203c 2f73 7061 6e3e 3c2f 6469 763e en
    │ │ │ │ +00165650: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    int │ │ │ │ +00165680: 3c2f 7370 616e 3e20 6c65 6e32 203d 2030 len2 = 0 │ │ │ │ +00165690: 3b20 2020 203c 7370 616e 2063 6c61 7373 ; // #c │ │ │ │ +001656b0: 6861 7273 2072 6561 6420 3c2f 7370 616e hars read
    .
    .
    // mys │ │ │ │ +00165710: 656e 643a 2070 7574 2058 4d4c 2069 6e20 end: put XML in │ │ │ │ +00165720: 6275 665b 5d20 3c2f 7370 616e 3e3c 2f64 buf[] .
    │ │ │ │ +00165760: 696e 743c 2f73 7061 6e3e 206d 7973 656e int mysen │ │ │ │ +00165770: 6428 3c73 7061 6e20 636c 6173 733d 226b d(struct soa │ │ │ │ +001657c0: 703c 2f61 3e20 2a3c 6120 636c 6173 733d p *so │ │ │ │ +001657f0: 6170 3c2f 613e 2c20 3c73 7061 6e20 636c ap, co │ │ │ │ +00165810: 6e73 743c 2f73 7061 6e3e 203c 7370 616e nst char │ │ │ │ +00165840: 202a 732c 203c 7370 616e 2063 6c61 7373 *s, s │ │ │ │ +00165860: 697a 655f 743c 2f73 7061 6e3e 206e 2920 ize_t n) │ │ │ │ +00165870: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    {
    │ │ │ │ +00165890: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    i │ │ │ │ +001658c0: 663c 2f73 7061 6e3e 2028 6c65 6e31 202b f (len1 + │ │ │ │ +001658d0: 206e 2026 6774 3b20 3c73 7061 6e20 636c n > si │ │ │ │ +001658f0: 7a65 6f66 3c2f 7370 616e 3e28 6275 6629 zeof(buf) │ │ │ │ +00165900: 2920 3c2f 6469 763e 0a3c 6469 7620 636c )
    .
    < │ │ │ │ +00165920: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +00165930: 6f72 6466 6c6f 7722 3e72 6574 7572 6e3c ordflow">return< │ │ │ │ +00165940: 2f73 7061 6e3e 203c 6120 636c 6173 733d /span> SOAP_ │ │ │ │ +001659a0: 454f 463c 2f61 3e3b 203c 2f64 6976 3e0a EOF;
    . │ │ │ │ +001659b0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    strcpy(buf + │ │ │ │ +001659d0: 206c 656e 312c 2073 293b 203c 2f64 6976 len1, s);
    .
    len1 += n; │ │ │ │ +00165a00: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    ..
    } │ │ │ │ +00165ac0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    │ │ │ │ +00165ae0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    // myre │ │ │ │ +00165b10: 6376 3a20 6765 7420 584d 4c20 6672 6f6d cv: get XML from │ │ │ │ +00165b20: 2062 7566 5b5d 203c 2f73 7061 6e3e 3c2f buf[] .
    size_t m │ │ │ │ +00165b70: 7972 6563 7628 3c73 7061 6e20 636c 6173 yrecv(stru │ │ │ │ +00165b90: 6374 3c2f 7370 616e 3e20 3c61 2063 6c61 ct soap *soap, char *s, │ │ │ │ +00165c40: 7369 7a65 5f74 3c2f 7370 616e 3e20 6e29 size_t n) │ │ │ │ +00165c50: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    {
    .
    │ │ │ │ +00165ca0: 6966 3c2f 7370 616e 3e20 286c 656e 3220 if (len2 │ │ │ │ +00165cb0: 2b20 6e20 2667 743b 206c 656e 3129 203c + n > len1) < │ │ │ │ +00165cc0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    n = │ │ │ │ +00165ce0: 6c65 6e31 202d 206c 656e 323b 203c 2f64 len1 - len2; .
    strncpy( │ │ │ │ +00165d10: 732c 2062 7566 202b 206c 656e 322c 206e s, buf + len2, n │ │ │ │ +00165d20: 293b 203c 2f64 6976 3e0a 3c64 6976 2063 );
    .
    le │ │ │ │ +00165d40: 6e32 202b 3d20 6e3b 203c 2f64 6976 3e0a n2 += n;
    . │ │ │ │ +00165d50: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    re │ │ │ │ +00165d80: 7475 726e 3c2f 7370 616e 3e20 6e3b 203c turn n; < │ │ │ │ +00165d90: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    }
    │ │ │ │ +00165db0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    .
    int main()
    . │ │ │ │ +00165e10: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    {
    .
    struct soap soap;
    .
    struct ns__person p; │ │ │ │ +00165f10: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    │ │ │ │ +00165f80: 736f 6170 5f69 6e69 7431 3c2f 613e 2826 soap_init1(& │ │ │ │ +00165f90: 616d 703b 3c61 2063 6c61 7373 3d22 636f amp;soap< │ │ │ │ +00165fc0: 2f61 3e2c 203c 6120 636c 6173 733d 2263 /a>, SOAP_XML │ │ │ │ +00166020: 5f54 5245 453c 2f61 3e29 3b20 3c2f 6469 _TREE); .
    len1 = le │ │ │ │ +00166050: 6e32 203d 2030 3b20 2020 2020 3c73 7061 n2 = 0; // reset buffe │ │ │ │ +00166080: 7220 706f 696e 7465 7273 203c 2f73 7061 r pointers
    .
    p.n │ │ │ │ +001660b0: 616d 6520 3d20 3c73 7061 6e20 636c 6173 ame = "John Doe │ │ │ │ +001660e0: 2671 756f 743b 3c2f 7370 616e 3e3b 203c "; < │ │ │ │ +001660f0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    p.age │ │ │ │ +00166110: 3d20 3235 3b20 3c2f 6469 763e 0a3c 6469 = 25;
    . │ │ │ │ +00166130: 203c 6120 636c 6173 733d 2263 6f64 6522 soap │ │ │ │ +00166160: 2e3c 6120 636c 6173 733d 2263 6f64 6522 .fsend = mysend; // assign call │ │ │ │ +001661f0: 6261 636b 203c 2f73 7061 6e3e 3c2f 6469 back .
    so │ │ │ │ +00166240: 6170 3c2f 613e 2e3c 6120 636c 6173 733d ap.fr │ │ │ │ +001662a0: 6563 763c 2f61 3e20 3d20 6d79 7265 6376 ecv = myrecv │ │ │ │ +001662b0: 3b20 3c73 7061 6e20 636c 6173 733d 2263 ; // assig │ │ │ │ +001662d0: 6e20 6361 6c6c 6261 636b 203c 2f73 7061 n callback
    .
    if │ │ │ │ +00166320: 2028 736f 6170 5f77 7269 7465 5f6e 735f (soap_write_ns_ │ │ │ │ +00166330: 5f70 6572 736f 6e28 2661 6d70 3b3c 6120 _person(&soap, &a │ │ │ │ +00166370: 6d70 3b70 2929 3c2f 6469 763e 0a3c 6469 mp;p))
    . │ │ │ │ +00166390: 207b 3c2f 6469 763e 0a3c 6469 7620 636c {
    .
    < │ │ │ │ +001663b0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +001663c0: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ │ +001663d0: 705f 5f66 6175 6c74 2e68 746d 6c23 6761 p__fault.html#ga │ │ │ │ +001663e0: 3933 3161 3461 6236 6466 3235 3533 6234 931a4ab6df2553b4 │ │ │ │ +001663f0: 3861 3063 3237 3066 3861 3061 3838 6166 8a0c270f8a0a88af │ │ │ │ +00166400: 223e 736f 6170 5f70 7269 6e74 5f66 6175 ">soap_print_fau │ │ │ │ +00166410: 6c74 3c2f 613e 2826 616d 703b 3c61 2063 lt(&soap, std │ │ │ │ +00166450: 6f75 7429 3b20 3c2f 6469 763e 0a3c 6469 out);
    . │ │ │ │ +00166470: 2020 2065 7869 7428 4558 4954 5f46 4149 exit(EXIT_FAI │ │ │ │ +00166480: 4c55 5245 293b 203c 2f64 6976 3e0a 3c64 LURE);
    . │ │ │ │ +001664a0: 2020 7d20 3c2f 6469 763e 0a3c 6469 7620 }
    .
    < │ │ │ │ +001664c0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +001664d0: 6f72 6466 6c6f 7722 3e69 663c 2f73 7061 ordflow">if (soap_read_ns │ │ │ │ +001664f0: 5f5f 5065 7273 6f6e 2826 616d 703b 3c61 __Person(&soap, & │ │ │ │ +00166530: 616d 703b 7029 293c 2f64 6976 3e0a 3c64 amp;p))
    . │ │ │ │ +00166550: 2020 7b3c 2f64 6976 3e0a 3c64 6976 2063 {
    .
    │ │ │ │ +00166570: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap_print_fa │ │ │ │ +001665d0: 756c 743c 2f61 3e28 2661 6d70 3b3c 6120 ult(&soap, st │ │ │ │ +00166610: 646f 7574 293b 203c 2f64 6976 3e0a 3c64 dout);
    . │ │ │ │ +00166630: 2020 2020 6578 6974 2845 5849 545f 4641 exit(EXIT_FA │ │ │ │ +00166640: 494c 5552 4529 3b20 3c2f 6469 763e 0a3c ILURE);
    .< │ │ │ │ +00166650: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00166660: 3e20 207d 203c 2f64 6976 3e0a 3c64 6976 > }
    .
    │ │ │ │ +00166680: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap_destro │ │ │ │ +001666e0: 793c 2f61 3e28 2661 6d70 3b3c 6120 636c y(&soap); .
    soa │ │ │ │ +00166790: 705f 656e 643c 2f61 3e28 2661 6d70 3b3c p_end(&< │ │ │ │ +001667a0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +001667b0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ +001667c0: 6874 6d6c 223e 736f 6170 3c2f 613e 293b html">soap); │ │ │ │ +001667d0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    soap_done(& │ │ │ │ +00166850: 616d 703b 3c61 2063 6c61 7373 3d22 636f amp;soap< │ │ │ │ +00166880: 2f61 3e29 3b3c 2f64 6976 3e0a 3c64 6976 /a>);
    .
    }< │ │ │ │ +001668a0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>. │ │ │ │ +00166970: 3c64 6976 2063 6c61 7373 3d22 7474 6465
    size_t(* fre │ │ │ │ +00166990: 6376 2928 7374 7275 6374 2073 6f61 7020 cv)(struct soap │ │ │ │ +001669a0: 2a73 6f61 702c 2063 6861 7220 2a62 7566 *soap, char *buf │ │ │ │ +001669b0: 2c20 7369 7a65 5f74 206c 656e 293c 2f64 , size_t len)
    Callback t │ │ │ │ +001669e0: 6861 7420 7265 6365 6976 6573 2062 7974 hat receives byt │ │ │ │ +001669f0: 6573 206f 6620 6461 7461 2069 6e74 6f20 es of data into │ │ │ │ +00166a00: 7468 6520 6769 7665 6e20 6275 6666 6572 the given buffer │ │ │ │ +00166a10: 2e3c 2f64 6976 3e3c 6469 7620 636c 6173 .
    Def │ │ │ │ +00166a30: 696e 6974 696f 6e3a 3c2f 623e 2073 7464 inition: std │ │ │ │ +00166a40: 736f 6170 322e 683a 3436 3037 3c2f 6469 soap2.h:4607
    .
    │ │ │ │ +00166ab0: 3c64 6976 2063 6c61 7373 3d22 7474 6e61
    so │ │ │ │ +00166b10: 6170 3a3a 6673 656e 643c 2f61 3e3c 2f64 ap::fsend
    int(* fse │ │ │ │ +00166b40: 6e64 2928 7374 7275 6374 2073 6f61 7020 nd)(struct soap │ │ │ │ +00166b50: 2a73 6f61 702c 2063 6f6e 7374 2063 6861 *soap, const cha │ │ │ │ +00166b60: 7220 2a64 6174 612c 2073 697a 655f 7420 r *data, size_t │ │ │ │ +00166b70: 6c65 6e29 3c2f 6469 763e 3c64 6976 2063 len)
    Cal │ │ │ │ +00166b90: 6c62 6163 6b20 7468 6174 2073 656e 6473 lback that sends │ │ │ │ +00166ba0: 2074 6865 2067 6976 656e 2062 7974 6573 the given bytes │ │ │ │ +00166bb0: 206f 6620 6461 7461 2e3c 2f64 6976 3e3c of data.
    < │ │ │ │ +00166bc0: 6469 7620 636c 6173 733d 2274 7464 6566 div class="ttdef │ │ │ │ +00166bd0: 223e 3c62 3e44 6566 696e 6974 696f 6e3a ">Definition: │ │ │ │ +00166be0: 3c2f 623e 2073 7464 736f 6170 322e 683a stdsoap2.h: │ │ │ │ +00166bf0: 3436 3230 3c2f 6469 763e 3c2f 6469 763e 4620
    │ │ │ │ +00166c00: 0a3c 2f64 6976 3e3c 212d 2d20 6672 6167 .

    A fix │ │ │ │ +00166c20: 6564 2d73 697a 6520 6275 6666 6572 2074 ed-size buffer t │ │ │ │ +00166c30: 6f20 7374 6f72 6520 7468 6520 6f75 7462 o store the outb │ │ │ │ +00166c40: 6f75 6e64 206d 6573 7361 6765 2073 656e ound message sen │ │ │ │ +00166c50: 7420 6973 206e 6f74 2066 6c65 7869 626c t is not flexibl │ │ │ │ +00166c60: 6520 746f 2068 616e 646c 6520 6c61 7267 e to handle larg │ │ │ │ +00166c70: 6520 636f 6e74 656e 742e 2054 6f20 7374 e content. To st │ │ │ │ +00166c80: 6f72 6520 7468 6520 6d65 7373 6167 6520 ore the message │ │ │ │ +00166c90: 696e 2061 6e20 6578 7061 6e64 696e 6720 in an expanding │ │ │ │ +00166ca0: 6275 6666 6572 3a3c 2f70 3e0a 3c64 6976 buffer:

    .
    struct │ │ │ │ +00166cf0: 203c 2f73 7061 6e3e 6275 6666 6572 203c buffer < │ │ │ │ +00166d00: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    {
    . │ │ │ │ +00166d20: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    si │ │ │ │ +00166d50: 7a65 5f74 3c2f 7370 616e 3e20 6c65 6e3b ze_t len; │ │ │ │ +00166d60: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    size_t max;
    . │ │ │ │ +00166db0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    ch │ │ │ │ +00166de0: 6172 3c2f 7370 616e 3e20 2a62 7566 3b20 ar *buf; │ │ │ │ +00166df0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    }; .
    .< │ │ │ │ +00166e40: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +00166e50: 6f72 6474 7970 6522 3e69 6e74 3c2f 7370 ordtype">int main()
    .
    {
    .
    .
    │ │ │ │ +00166f40: 3c73 7061 6e20 636c 6173 733d 226b 6579 struct ns__person p │ │ │ │ +00166f70: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
    .
    struct buffer *h = mal │ │ │ │ +00166fc0: 6c6f 6328 3c73 7061 6e20 636c 6173 733d loc(sizeof │ │ │ │ +00166fe0: 3c2f 7370 616e 3e28 3c73 7061 6e20 636c (st │ │ │ │ +00167000: 7275 6374 3c2f 7370 616e 3e20 6275 6666 ruct buff │ │ │ │ +00167010: 6572 2929 3b20 3c2f 6469 763e 0a3c 6469 er));
    . │ │ │ │ +00167030: 2068 2d26 6774 3b6c 656e 203d 2030 3b20 h->len = 0; │ │ │ │ +00167040: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    h-> │ │ │ │ +00167060: 3b6d 6178 203d 2030 3b20 3c2f 6469 763e ;max = 0;
    │ │ │ │ +00167070: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    h->buf = │ │ │ │ +00167090: 204e 554c 4c3b 203c 2f64 6976 3e0a 3c64 NULL;
    . │ │ │ │ +001670b0: 2020 3c61 2063 6c61 7373 3d22 636f 6465
    soap_init │ │ │ │ +00167110: 313c 2f61 3e28 2661 6d70 3b3c 6120 636c 1(&soap, S │ │ │ │ +001671a0: 4f41 505f 584d 4c5f 5452 4545 3c2f 613e OAP_XML_TREE │ │ │ │ +001671b0: 293b 203c 2f64 6976 3e0a 3c64 6976 2063 );
    .
    soap.user │ │ │ │ +00167250: 3d20 283c 7370 616e 2063 6c61 7373 3d22 = (voi │ │ │ │ +00167270: 643c 2f73 7061 6e3e 2a29 683b 203c 7370 d*)h; // pass buffe │ │ │ │ +001672a0: 7220 6173 2061 2068 616e 646c 6520 746f r as a handle to │ │ │ │ +001672b0: 2074 6865 2063 616c 6c62 6163 6b20 3c2f the callback
    .
    │ │ │ │ +001672e0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap. │ │ │ │ +00167310: 3c61 2063 6c61 7373 3d22 636f 6465 2220 fsend │ │ │ │ +00167370: 203d 206d 7973 656e 643b 2020 3c73 7061 = mysend; // assign call │ │ │ │ +001673a0: 6261 636b 203c 2f73 7061 6e3e 3c2f 6469 back .
    if (soap │ │ │ │ +001673f0: 5f77 7269 7465 5f6e 735f 5f70 6572 736f _write_ns__perso │ │ │ │ +00167400: 6e28 2661 6d70 3b3c 6120 636c 6173 733d n(&so │ │ │ │ +00167430: 6170 3c2f 613e 2c20 2661 6d70 3b70 2929 ap, &p)) │ │ │ │ +00167440: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    {.
    soap │ │ │ │ +001674d0: 5f70 7269 6e74 5f66 6175 6c74 3c2f 613e _print_fault │ │ │ │ +001674e0: 2826 616d 703b 3c61 2063 6c61 7373 3d22 (&soa │ │ │ │ +00167510: 703c 2f61 3e2c 2073 7464 6f75 7429 3b20 p, stdout); │ │ │ │ +00167520: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    exi │ │ │ │ +00167540: 7428 4558 4954 5f46 4149 4c55 5245 293b t(EXIT_FAILURE); │ │ │ │ +00167550: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    } .
    if (h- │ │ │ │ +001675b0: 2667 743b 6c65 6e29 203c 2f64 6976 3e0a >len)
    . │ │ │ │ +001675c0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    {
    .
    │ │ │ │ +001675f0: 2020 2e2e 2e20 3c73 7061 6e20 636c 6173 ... // u │ │ │ │ +00167610: 7365 2068 2d26 6774 3b62 7566 5b30 2e2e se h->buf[0.. │ │ │ │ +00167620: 682d 2667 743b 6c65 6e2d 315d 2063 6f6e h->len-1] con │ │ │ │ +00167630: 7465 6e74 203c 2f73 7061 6e3e 3c2f 6469 tent .
    / │ │ │ │ +00167670: 2f20 7468 656e 2063 6c65 616e 7570 3a20 / then cleanup: │ │ │ │ +00167680: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ │ +001676a0: 2020 2020 682d 2667 743b 6c65 6e20 3d20 h->len = │ │ │ │ +001676b0: 303b 203c 2f64 6976 3e0a 3c64 6976 2063 0;
    .
    │ │ │ │ +001676d0: 682d 2667 743b 6d61 7820 3d20 303b 203c h->max = 0; < │ │ │ │ +001676e0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    free │ │ │ │ +00167700: 2868 2d26 6774 3b62 7566 293b 203c 2f64 (h->buf); .
    h-> │ │ │ │ +00167730: 6275 6620 3d20 4e55 4c4c 3b20 3c2f 6469 buf = NULL; .
    }
    . │ │ │ │ +00167760: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    soap_de │ │ │ │ +001677d0: 7374 726f 793c 2f61 3e28 2661 6d70 3b3c stroy(&< │ │ │ │ +001677e0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +001677f0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ +00167800: 6874 6d6c 223e 736f 6170 3c2f 613e 293b html">soap); │ │ │ │ +00167810: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    soap_end(&a │ │ │ │ +00167890: 6d70 3b3c 6120 636c 6173 733d 2263 6f64 mp;soap);
    .. │ │ │ │ +00167980: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    }
    .
    .
    int myse │ │ │ │ +001679f0: 6e64 283c 7370 616e 2063 6c61 7373 3d22 nd(struct< │ │ │ │ +00167a10: 2f73 7061 6e3e 203c 6120 636c 6173 733d /span> so │ │ │ │ +00167a40: 6170 3c2f 613e 202a 3c61 2063 6c61 7373 ap *s │ │ │ │ +00167a70: 6f61 703c 2f61 3e2c 203c 7370 616e 2063 oap, c │ │ │ │ +00167a90: 6f6e 7374 3c2f 7370 616e 3e20 3c73 7061 onst char *s, │ │ │ │ +00167ae0: 7369 7a65 5f74 3c2f 7370 616e 3e20 6e29 size_t n) │ │ │ │ +00167af0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    {
    .
    stru │ │ │ │ +00167b40: 6374 203c 2f73 7061 6e3e 6275 6666 6572 ct buffer │ │ │ │ +00167b50: 202a 6820 3d20 283c 7370 616e 2063 6c61 *h = (str │ │ │ │ +00167b70: 7563 7420 3c2f 7370 616e 3e62 7566 6665 uct buffe │ │ │ │ +00167b80: 722a 293c 6120 636c 6173 733d 2263 6f64 r*)soap-> │ │ │ │ +00167c00: 7573 6572 3c2f 613e 3b20 3c73 7061 6e20 user; │ │ │ │ +00167c20: 2f2f 2067 6574 2062 7566 6665 7220 7468 // get buffer th │ │ │ │ +00167c30: 726f 7567 6820 6861 6e64 6c65 203c 2f73 rough handle
    .
    < │ │ │ │ +00167c60: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +00167c70: 6f72 6474 7970 6522 3e69 6e74 3c2f 7370 ordtype">int m = h->ma │ │ │ │ +00167c90: 782c 206b 203d 2068 2d26 6774 3b6c 656e x, k = h->len │ │ │ │ +00167ca0: 202b 206e 3b20 3c2f 6469 763e 0a3c 6469 + n;
    . │ │ │ │ +00167cc0: 203c 7370 616e 2063 6c61 7373 3d22 636f // need t │ │ │ │ +00167ce0: 6f20 696e 6372 6561 7365 2073 7061 6365 o increase space │ │ │ │ +00167cf0: 3f20 3c2f 7370 616e 3e3c 2f64 6976 3e0a ?
    . │ │ │ │ +00167d00: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    if (m == 0) │ │ │ │ +00167d20: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    m = │ │ │ │ +00167d40: 2031 3032 343b 203c 2f64 6976 3e0a 3c64 1024;
    . │ │ │ │ +00167d60: 2020 3c73 7061 6e20 636c 6173 733d 226b else │ │ │ │ +00167d80: 3c2f 7370 616e 3e20 3c2f 6469 763e 0a3c
    .< │ │ │ │ +00167d90: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00167da0: 3e20 2020 203c 7370 616e 2063 6c61 7373 > w │ │ │ │ +00167dc0: 6869 6c65 3c2f 7370 616e 3e20 286b 2026 hile (k & │ │ │ │ +00167dd0: 6774 3b3d 206d 2920 3c2f 6469 763e 0a3c gt;= m)
    .< │ │ │ │ +00167de0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00167df0: 3e20 2020 2020 206d 202a 3d20 323b 203c > m *= 2; < │ │ │ │ +00167e00: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    if (m │ │ │ │ +00167e40: 2021 3d20 682d 2667 743b 6d61 7829 203c != h->max) < │ │ │ │ +00167e50: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    {
    .
    char *b │ │ │ │ +00167eb0: 7566 203d 206d 616c 6c6f 6328 6d29 3b20 uf = malloc(m); │ │ │ │ +00167ec0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    mem │ │ │ │ +00167ee0: 6370 7928 6275 662c 2068 2d26 6774 3b62 cpy(buf, h->b │ │ │ │ +00167ef0: 7566 2c20 682d 2667 743b 6c65 6e29 3b20 uf, h->len); │ │ │ │ +00167f00: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    h-& │ │ │ │ +00167f20: 6774 3b6d 6178 203d 206d 3b20 3c2f 6469 gt;max = m; .
    if (h- │ │ │ │ +00167f70: 2667 743b 6275 6629 203c 2f64 6976 3e0a >buf)
    . │ │ │ │ +00167f80: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    free(h-& │ │ │ │ +00167fa0: 6774 3b62 7566 293b 203c 2f64 6976 3e0a gt;buf);
    . │ │ │ │ +00167fb0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    h->buf │ │ │ │ +00167fd0: 3d20 6275 663b 203c 2f64 6976 3e0a 3c64 = buf;
    . │ │ │ │ +00167ff0: 2020 7d20 3c2f 6469 763e 0a3c 6469 7620 }
    .
    m │ │ │ │ +00168010: 656d 6370 7928 682d 2667 743b 6275 6620 emcpy(h->buf │ │ │ │ +00168020: 2b20 682d 2667 743b 6c65 6e2c 2073 2c20 + h->len, s, │ │ │ │ +00168030: 6e29 3b20 3c2f 6469 763e 0a3c 6469 7620 n);
    .
    h │ │ │ │ +00168050: 2d26 6774 3b6c 656e 202b 3d20 6e3b 203c ->len += n; < │ │ │ │ +00168060: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    return SOAP_OK;
    .
    }.

    Th │ │ │ │ +00168140: 6520 666f 6c6c 6f77 696e 6720 6578 616d e following exam │ │ │ │ +00168150: 706c 6520 696c 6c75 7374 7261 7465 7320 ple illustrates │ │ │ │ +00168160: 6375 7374 6f6d 697a 6564 2049 2f4f 2061 customized I/O a │ │ │ │ +00168170: 6e64 2048 5454 5020 6865 6164 6572 2068 nd HTTP header h │ │ │ │ +00168180: 616e 646c 696e 672e 2054 6865 2058 4d4c andling. The XML │ │ │ │ +00168190: 206d 6573 7361 6765 2069 7320 7361 7665 message is save │ │ │ │ +001681a0: 6420 746f 2061 2066 696c 6520 746f 2064 d to a file to d │ │ │ │ +001681b0: 656d 6f6e 7374 7261 7465 2049 2f4f 2061 emonstrate I/O a │ │ │ │ +001681c0: 6e64 2048 5454 5020 6361 6c6c 6261 636b nd HTTP callback │ │ │ │ +001681d0: 732e 2054 6865 2063 6c69 656e 7420 7072 s. The client pr │ │ │ │ +001681e0: 6f78 7920 7468 656e 2072 6561 6473 2074 oxy then reads t │ │ │ │ +001681f0: 6865 2066 696c 6520 636f 6e74 656e 7473 he file contents │ │ │ │ +00168200: 2061 7320 7468 6520 7365 7276 6963 6520 as the service │ │ │ │ +00168210: 7265 7370 6f6e 7365 2e20 546f 2070 6572 response. To per │ │ │ │ +00168220: 666f 726d 2074 6869 7320 7472 6963 6b2c form this trick, │ │ │ │ +00168230: 2074 6865 2073 6572 7669 6365 2072 6573 the service res │ │ │ │ +00168240: 706f 6e73 6520 6861 7320 6578 6163 746c ponse has exactl │ │ │ │ +00168250: 7920 7468 6520 7361 6d65 2073 7472 7563 y the same struc │ │ │ │ +00168260: 7475 7265 2061 7320 7468 6520 7265 7175 ture as the requ │ │ │ │ +00168270: 6573 742e 2054 6869 7320 6973 2064 6563 est. This is dec │ │ │ │ +00168280: 6c61 7265 6420 6279 2074 6865 203c 636f lared by the struct ns__te │ │ │ │ +001682a0: 7374 3c2f 636f 6465 3e20 6f75 7470 7574 st output │ │ │ │ +001682b0: 2070 6172 616d 6574 6572 2070 6172 7420 parameter part │ │ │ │ +001682c0: 6f66 2074 6865 2073 6572 7669 6365 206f of the service o │ │ │ │ +001682d0: 7065 7261 7469 6f6e 2064 6563 6c61 7261 peration declara │ │ │ │ +001682e0: 7469 6f6e 2e20 5468 6973 2073 7472 7563 tion. This struc │ │ │ │ +001682f0: 7420 7265 7365 6d62 6c65 7320 7468 6520 t resembles the │ │ │ │ +00168300: 7365 7276 6963 6520 7265 7175 6573 7420 service request │ │ │ │ +00168310: 2873 6565 2074 6865 2067 656e 6572 6174 (see the generat │ │ │ │ +00168320: 6564 203c 656d 3e3c 636f 6465 3e73 6f61 ed soa │ │ │ │ +00168330: 7053 7475 622e 683c 2f63 6f64 653e 3c2f pStub.h file generat │ │ │ │ +00168350: 6564 2062 7920 736f 6170 6370 7032 2066 ed by soapcpp2 f │ │ │ │ +00168360: 726f 6d20 7468 6520 696e 7465 7266 6163 rom the interfac │ │ │ │ +00168370: 6520 6865 6164 6572 2066 696c 6520 696e e header file in │ │ │ │ +00168380: 7075 7429 2e3c 2f70 3e0a 3c70 3e54 6865 put).

    .

    The │ │ │ │ +00168390: 2069 6e74 6572 6661 6365 2068 6561 6465 interface heade │ │ │ │ +001683a0: 7220 6669 6c65 2066 6f72 2073 6f61 7063 r file for soapc │ │ │ │ +001683b0: 7070 3220 6973 3a3c 2f70 3e0a 3c64 6976 pp2 is:

    .
    //gsoa │ │ │ │ +00168400: 7020 6e73 2073 6572 7669 6365 206e 616d p ns service nam │ │ │ │ +00168410: 653a 2063 616c 6c62 6163 6b20 3c2f 7370 e: callback
    .
    //gsoap ns ser │ │ │ │ +00168460: 7669 6365 206e 616d 6573 7061 6365 3a20 vice namespace: │ │ │ │ +00168470: 7572 6e3a 6361 6c6c 6261 636b 203c 2f73 urn:callback
    .
    struct ns__person .
    {
    . │ │ │ │ +00168500: 2020 203c 7370 616e 2063 6c61 7373 3d22 cha │ │ │ │ +00168520: 723c 2f73 7061 6e3e 202a 6e61 6d65 3b20 r *name; │ │ │ │ +00168530: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    int age;
    . │ │ │ │ +00168590: 7d3b 203c 2f64 6976 3e0a 3c64 6976 2063 };
    .
    int │ │ │ │ +001685d0: 206e 735f 5f74 6573 7428 3c73 7061 6e20 ns__test( │ │ │ │ +001685f0: 7374 7275 6374 3c2f 7370 616e 3e20 6e73 struct ns │ │ │ │ +00168600: 5f5f 7065 7273 6f6e 2069 6e2c 203c 7370 __person in, struct │ │ │ │ +00168630: 206e 735f 5f74 6573 7420 2661 6d70 3b6f ns__test &o │ │ │ │ +00168640: 7574 293b 3c2f 6469 763e 0a3c 2f64 6976 ut);
    .

    SOAP 1 │ │ │ │ +0016ac50: 2e31 2f31 2e32 2052 5043 2065 6e63 6f64 .1/1.2 RPC encod │ │ │ │ +0016ac60: 696e 6720 7370 6563 6966 6965 7320 7468 ing specifies th │ │ │ │ +0016ac70: 6174 2053 4f41 502f 584d 4c20 656c 656d at SOAP/XML elem │ │ │ │ +0016ac80: 656e 7473 206d 6179 2062 6520 6967 6e6f ents may be igno │ │ │ │ +0016ac90: 7265 6420 7768 656e 2070 7265 7365 6e74 red when present │ │ │ │ +0016aca0: 2069 6e20 6120 534f 4150 2070 6179 6c6f in a SOAP paylo │ │ │ │ +0016acb0: 6164 206f 6e20 7468 6520 7265 6365 6976 ad on the receiv │ │ │ │ +0016acc0: 696e 6720 7369 6465 2e20 486f 7765 7665 ing side. Howeve │ │ │ │ +0016acd0: 722c 2064 6f63 756d 656e 742f 6c69 7465 r, document/lite │ │ │ │ +0016ace0: 7261 6c20 7374 796c 6520 6d65 7373 6167 ral style messag │ │ │ │ +0016acf0: 696e 6720 7661 6c69 6461 7465 7320 584d ing validates XM │ │ │ │ +0016ad00: 4c20 6d65 7373 6167 6573 2061 6e64 2065 L messages and e │ │ │ │ +0016ad10: 7874 7261 2065 6c65 6d65 6e74 7320 6361 xtra elements ca │ │ │ │ +0016ad20: 6e6e 6f74 206a 7573 7420 6265 2069 676e nnot just be ign │ │ │ │ +0016ad30: 6f72 6564 2061 7320 7375 6368 2e20 5769 ored as such. Wi │ │ │ │ +0016ad40: 7468 2053 4f41 5020 646f 6375 6d65 6e74 th SOAP document │ │ │ │ +0016ad50: 2f6c 6974 6572 616c 2073 7479 6c65 2069 /literal style i │ │ │ │ +0016ad60: 7420 6973 2072 6563 6f6d 6d65 6e64 6564 t is recommended │ │ │ │ +0016ad70: 2074 6f20 656e 6162 6c65 2074 6865 203c to enable the < │ │ │ │ +0016ad80: 636f 6465 3e23 534f 4150 5f58 4d4c 5f53 code>#SOAP_XML_S │ │ │ │ +0016ad90: 5452 4943 543c 2f63 6f64 653e 206d 6f64 TRICT mod │ │ │ │ +0016ada0: 6520 666c 6167 2e20 5769 7468 2053 4f41 e flag. With SOA │ │ │ │ +0016adb0: 5020 5250 4320 656e 636f 6469 6e67 2c20 P RPC encoding, │ │ │ │ +0016adc0: 7468 6520 656e 6769 6e65 2069 676e 6f72 the engine ignor │ │ │ │ +0016add0: 6573 2058 4d4c 2065 6c65 6d65 6e74 7320 es XML elements │ │ │ │ +0016ade0: 7468 6174 2061 7265 2075 6e6b 6e6f 776e that are unknown │ │ │ │ +0016adf0: 2062 7920 6465 6661 756c 742c 2075 6e6c by default, unl │ │ │ │ +0016ae00: 6573 7320 7468 6520 584d 4c20 6174 7472 ess the XML attr │ │ │ │ +0016ae10: 6962 7574 6520 3c65 6d3e 3c63 6f64 653e ibute │ │ │ │ +0016ae20: 6d75 7374 556e 6465 7273 7461 6e64 3d22 mustUnderstand=" │ │ │ │ +0016ae30: 7472 7565 223c 2f63 6f64 653e 3c2f 656d true" is present in │ │ │ │ +0016ae50: 7468 6520 584d 4c20 656c 656d 656e 742e the XML element. │ │ │ │ +0016ae60: 2049 7420 6d61 7920 6265 2075 6e64 6573 It may be undes │ │ │ │ +0016ae70: 6972 6162 6c65 2066 6f72 2065 6c65 6d65 irable for eleme │ │ │ │ +0016ae80: 6e74 7320 746f 2062 6520 6967 6e6f 7265 nts to be ignore │ │ │ │ +0016ae90: 6420 7768 656e 2074 6865 206f 7574 636f d when the outco │ │ │ │ +0016aea0: 6d65 206f 6620 7468 6520 6f6d 6973 7369 me of the omissi │ │ │ │ +0016aeb0: 6f6e 2069 7320 756e 6365 7274 6169 6e2e on is uncertain. │ │ │ │ +0016aec0: 2054 6865 203c 636f 6465 3e3c 6120 636c The soap::fignore callba │ │ │ │ +0016afb0: 636b 2063 616e 2062 6520 7365 7420 746f ck can be set to │ │ │ │ +0016afc0: 2061 2066 756e 6374 696f 6e20 7468 6174 a function that │ │ │ │ +0016afd0: 2072 6574 7572 6e73 203c 636f 6465 3e23 returns # │ │ │ │ +0016afe0: 534f 4150 5f4f 4b3c 2f63 6f64 653e 2069 SOAP_OK i │ │ │ │ +0016aff0: 6e20 6361 7365 2074 6865 2065 6c65 6d65 n case the eleme │ │ │ │ +0016b000: 6e74 2063 616e 2062 6520 7361 6665 6c79 nt can be safely │ │ │ │ +0016b010: 2069 676e 6f72 6564 2c20 6f72 203c 636f ignored, or #SOAP_MUSTUND │ │ │ │ +0016b030: 4552 5354 414e 443c 2f63 6f64 653e 2074 ERSTAND t │ │ │ │ +0016b040: 6f20 7468 726f 7720 616e 2065 7863 6570 o throw an excep │ │ │ │ +0016b050: 7469 6f6e 2c20 6f72 2074 6f20 7065 7266 tion, or to perf │ │ │ │ +0016b060: 6f72 6d20 736f 6d65 2061 7070 6c69 6361 orm some applica │ │ │ │ +0016b070: 7469 6f6e 2d73 7065 6369 6669 6320 6163 tion-specific ac │ │ │ │ +0016b080: 7469 6f6e 2e20 466f 7220 6578 616d 706c tion. For exampl │ │ │ │ +0016b090: 652c 2074 6f20 7468 726f 7720 616e 2065 e, to throw an e │ │ │ │ +0016b0a0: 7863 6570 7469 6f6e 2061 7320 736f 6f6e xception as soon │ │ │ │ +0016b0b0: 2061 7320 616e 2075 6e6b 6e6f 776e 2065 as an unknown e │ │ │ │ +0016b0c0: 6c65 6d65 6e74 2069 7320 656e 636f 756e lement is encoun │ │ │ │ +0016b0d0: 7465 7265 6420 6f6e 2074 6865 2069 6e70 tered on the inp │ │ │ │ +0016b0e0: 7574 2c20 7573 653a 3c2f 703e 0a3c 6469 ut, use:

    .
    i │ │ │ │ +0016b130: 6e74 3c2f 7370 616e 3e20 6d61 696e 2829 nt main() │ │ │ │ +0016b140: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    {
    │ │ │ │ +0016b160: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    .
    soap->< │ │ │ │ +0016b2b0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +0016b2c0: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ │ +0016b2d0: 705f 5f63 616c 6c62 6163 6b73 2e68 746d p__callbacks.htm │ │ │ │ +0016b2e0: 6c23 6761 3063 3265 3161 3062 3561 3531 l#ga0c2e1a0b5a51 │ │ │ │ +0016b2f0: 3937 3132 3861 6631 6163 6334 3836 3632 97128af1acc48662 │ │ │ │ +0016b300: 6231 6264 223e 6669 676e 6f72 653c 2f61 b1bd">fignore = myignore; .
    ... // soap_call_ │ │ │ │ +0016b360: 6e73 5f5f 7765 626d 6574 686f 6428 736f ns__webmethod(so │ │ │ │ +0016b370: 6170 2c20 2e2e 2e29 206f 7220 736f 6170 ap, ...) or soap │ │ │ │ +0016b380: 5f73 6572 7665 2873 6f61 7029 203c 2f73 _serve(soap)
    .
    }.
    .< │ │ │ │ +0016b3d0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +0016b3e0: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >int myignore(< │ │ │ │ +0016b410: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +0016b420: 6f72 6422 3e73 7472 7563 743c 2f73 7061 ord">struct soap *soap< │ │ │ │ +0016b490: 2f61 3e2c 203c 7370 616e 2063 6c61 7373 /a>, const │ │ │ │ +0016b4b0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c char *t │ │ │ │ +0016b4e0: 6167 2920 3c2f 6469 763e 0a3c 6469 7620 ag)
    .
    {.
    return │ │ │ │ +0016b540: 203c 6120 636c 6173 733d 2263 6f64 6522 SOAP_MUSTUN │ │ │ │ +0016b5a0: 4445 5253 5441 4e44 3c2f 613e 3b20 3c73 DERSTAND; // never ski │ │ │ │ +0016b5d0: 7020 656c 656d 656e 7473 2028 7365 6375 p elements (secu │ │ │ │ +0016b5e0: 7265 2920 3c2f 7370 616e 3e3c 2f64 6976 re)
    .
    }
    .
    int │ │ │ │ +0016b6f0: 282a 2066 6967 6e6f 7265 2928 7374 7275 (* fignore)(stru │ │ │ │ +0016b700: 6374 2073 6f61 7020 2a73 6f61 702c 2063 ct soap *soap, c │ │ │ │ +0016b710: 6f6e 7374 2063 6861 7220 2a74 6167 293c onst char *tag)< │ │ │ │ +0016b720: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
    Callback │ │ │ │ +0016b740: 2074 6f20 6361 7463 6820 756e 7265 636f to catch unreco │ │ │ │ +0016b750: 676e 697a 6564 2058 4d4c 2065 6c65 6d65 gnized XML eleme │ │ │ │ +0016b760: 6e74 7320 616e 6420 6f76 6572 7269 6465 nts and override │ │ │ │ +0016b770: 7320 2353 4f41 505f 584d 4c5f 5354 5249 s #SOAP_XML_STRI │ │ │ │ +0016b780: 4354 2076 616c 6964 6174 696f 6e20 6572 CT validation er │ │ │ │ +0016b790: 726f 7273 2066 6f72 2074 6865 732e 2e2e rors for thes... │ │ │ │ +0016b7a0: 3c2f 6469 763e 3c64 6976 2063 6c61 7373
    Defi │ │ │ │ +0016b7c0: 6e69 7469 6f6e 3a3c 2f62 3e20 7374 6473 nition: stds │ │ │ │ +0016b7d0: 6f61 7032 2e68 3a34 3434 333c 2f64 6976 oap2.h:4443
    .
    │ │ │ │ +0016b850: 3c61 2068 7265 663d 2267 726f 7570 5f5f SOAP_MUST │ │ │ │ +0016b8a0: 554e 4445 5253 5441 4e44 3c2f 613e 3c2f UNDERSTAND
    #define │ │ │ │ +0016b8d0: 534f 4150 5f4d 5553 5455 4e44 4552 5354 SOAP_MUSTUNDERST │ │ │ │ +0016b8e0: 414e 443c 2f64 6976 3e3c 6469 7620 636c AND
    A so │ │ │ │ +0016b900: 6170 5f73 7461 7475 7320 6572 726f 7220 ap_status error │ │ │ │ +0016b910: 636f 6465 3a20 616e 2058 4d4c 2065 6c65 code: an XML ele │ │ │ │ +0016b920: 6d65 6e74 2069 7320 7072 6573 656e 7420 ment is present │ │ │ │ +0016b930: 7769 7468 2061 206d 7573 7455 6e64 6572 with a mustUnder │ │ │ │ +0016b940: 7374 616e 6420 6174 7472 6962 7574 6520 stand attribute │ │ │ │ +0016b950: 7768 6963 6820 6d75 7374 2062 6520 756e which must be un │ │ │ │ +0016b960: 642e 2e2e 3c2f 6469 763e 3c64 6976 2063 d...
    │ │ │ │ +0016b980: 4465 6669 6e69 7469 6f6e 3a3c 2f62 3e20 Definition: │ │ │ │ +0016b990: 7374 6473 6f61 7032 2e68 3a32 3439 303c stdsoap2.h:2490< │ │ │ │ +0016b9a0: 2f64 6976 3e3c 2f64 6976 3e0a 3c2f 6469 /div>
    .

    To selecti │ │ │ │ +0016b9d0: 7665 6c79 2074 6872 6f77 2061 6e20 6578 vely throw an ex │ │ │ │ +0016b9e0: 6365 7074 696f 6e20 7768 656e 203c 656d ception when mustUnder │ │ │ │ +0016ba00: 7374 616e 643d 2274 7275 6522 3c2f 636f stand="true" SOAP He │ │ │ │ +0016ba20: 6164 6572 2065 6c65 6d65 6e74 2069 7320 ader element is │ │ │ │ +0016ba30: 656e 636f 756e 7465 7265 6420 6f72 2077 encountered or w │ │ │ │ +0016ba40: 6865 6e20 616e 2075 6e6b 6e6f 776e 2065 hen an unknown e │ │ │ │ +0016ba50: 6c65 6d65 6e74 2069 7320 656e 636f 756e lement is encoun │ │ │ │ +0016ba60: 7465 7265 6420 6578 6365 7074 2066 6f72 tered except for │ │ │ │ +0016ba70: 2065 6c65 6d65 6e74 203c 656d 3e3c 636f element ns:xyz │ │ │ │ +0016ba90: 3c2f 656d 3e2c 2075 7365 3a3c 2f70 3e0a , use:

    . │ │ │ │ +0016baa0: 3c64 6976 2063 6c61 7373 3d22 6672 6167
    int mai │ │ │ │ +0016baf0: 6e28 293c 2f64 6976 3e0a 3c64 6976 2063 n()
    .
    {.
    st │ │ │ │ +0016bb40: 7275 6374 203c 2f73 7061 6e3e 3c61 2063 ruct soap *soap = < │ │ │ │ +0016bbb0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +0016bbc0: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ │ +0016bbd0: 705f 5f63 6f6e 7465 7874 2e68 746d 6c23 p__context.html# │ │ │ │ +0016bbe0: 6761 3837 6332 3034 3838 6232 6463 3638 ga87c20488b2dc68 │ │ │ │ +0016bbf0: 3061 6161 3736 3839 6231 6430 3234 3938 0aaa7689b1d02498 │ │ │ │ +0016bc00: 3963 223e 736f 6170 5f6e 6577 3c2f 613e 9c">soap_new │ │ │ │ +0016bc10: 2829 3b3c 2f64 6976 3e0a 3c64 6976 2063 ();
    .
    soap-&g │ │ │ │ +0016bc60: 743b 3c61 2063 6c61 7373 3d22 636f 6465 t;fignore │ │ │ │ +0016bcc0: 3c2f 613e 203d 2069 676e 6f72 653b 203c = ignore; < │ │ │ │ +0016bcd0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    ... // soap_call │ │ │ │ +0016bd10: 5f6e 735f 5f77 6562 6d65 7468 6f64 2873 _ns__webmethod(s │ │ │ │ +0016bd20: 6f61 702c 202e 2e2e 2920 6f72 2073 6f61 oap, ...) or soa │ │ │ │ +0016bd30: 705f 7365 7276 6528 736f 6170 2920 3c2f p_serve(soap)
    ..
    │ │ │ │ +0016c020: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // tags &l │ │ │ │ +0016c040: 743b 6e73 3a73 6f6d 6545 6c65 6d65 6e74 t;ns:someElement │ │ │ │ +0016c050: 2667 743b 2063 616e 2062 6520 7361 6665 > can be safe │ │ │ │ +0016c060: 6c79 2069 676e 6f72 6564 3c2f 7370 616e ly ignored
    .
    if (soap_match_ │ │ │ │ +0016c110: 7461 673c 2f61 3e28 3c61 2063 6c61 7373 tag(s │ │ │ │ +0016c140: 6f61 703c 2f61 3e2c 2074 6167 2c20 3c73 oap, tag, " │ │ │ │ +0016c170: 6e73 3a73 6f6d 6545 6c65 6d65 6e74 2671 ns:someElement&q │ │ │ │ +0016c180: 756f 743b 3c2f 7370 616e 3e29 203d 3d20 uot;) == │ │ │ │ +0016c190: 3c61 2063 6c61 7373 3d22 636f 6465 2220 SOAP_OK) │ │ │ │ +0016c1f0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    < │ │ │ │ +0016c210: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +0016c220: 6f72 6466 6c6f 7722 3e72 6574 7572 6e3c ordflow">return< │ │ │ │ +0016c230: 2f73 7061 6e3e 203c 6120 636c 6173 733d /span> SOAP_ │ │ │ │ +0016c290: 4f4b 3c2f 613e 3b3c 2f64 6976 3e0a 3c64 OK;
    . │ │ │ │ +0016c2b0: 2020 7d3c 2f64 6976 3e0a 3c64 6976 2063 }
    ..
    }.
    . │ │ │ │ +0016c3b0: 3c73 7061 6e20 636c 6173 733d 226b 6579 struct
    Namespace < │ │ │ │ +0016c410: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +0016c420: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ │ +0016c430: 705f 5f6e 616d 6573 7061 6365 2e68 746d p__namespace.htm │ │ │ │ +0016c440: 6c23 6761 6162 6661 6330 6133 6238 6433 l#gaabfac0a3b8d3 │ │ │ │ +0016c450: 3834 3938 6263 3565 3165 3362 6334 3635 8498bc5e1e3bc465 │ │ │ │ +0016c460: 6561 6436 223e 6e61 6d65 7370 6163 6573 ead6">namespaces │ │ │ │ +0016c470: 3c2f 613e 5b5d 203d 203c 2f64 6976 3e0a [] =
    . │ │ │ │ +0016c480: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    {
    .
    { │ │ │ │ +0016c4b0: 3c73 7061 6e20 636c 6173 733d 2273 7472 &quo │ │ │ │ +0016c4d0: 743b 534f 4150 2d45 4e56 2671 756f 743b t;SOAP-ENV" │ │ │ │ +0016c4e0: 3c2f 7370 616e 3e2c 203c 7370 616e 2063 , "http: │ │ │ │ +0016c510: 2f2f 7363 6865 6d61 732e 786d 6c73 6f61 //schemas.xmlsoa │ │ │ │ +0016c520: 702e 6f72 672f 736f 6170 2f65 6e76 656c p.org/soap/envel │ │ │ │ +0016c530: 6f70 652f 2671 756f 743b 3c2f 7370 616e ope/" },
    .
    │ │ │ │ +0016c560: 7b20 3c73 7061 6e20 636c 6173 733d 2273 { &q │ │ │ │ +0016c580: 756f 743b 534f 4150 2d45 4e43 2671 756f uot;SOAP-ENC&quo │ │ │ │ +0016c590: 743b 3c2f 7370 616e 3e2c 203c 7370 616e t;, "htt │ │ │ │ +0016c5c0: 703a 2f2f 7363 6865 6d61 732e 786d 6c73 p://schemas.xmls │ │ │ │ +0016c5d0: 6f61 702e 6f72 672f 736f 6170 2f65 6e63 oap.org/soap/enc │ │ │ │ +0016c5e0: 6f64 696e 672f 2671 756f 743b 3c2f 7370 oding/" },
    . │ │ │ │ +0016c610: 2020 7b20 3c73 7061 6e20 636c 6173 733d { │ │ │ │ +0016c630: 2671 756f 743b 7873 6926 7175 6f74 3b3c "xsi"< │ │ │ │ +0016c640: 2f73 7061 6e3e 2c20 2020 2020 203c 7370 /span>, "h │ │ │ │ +0016c670: 7474 703a 2f2f 7777 772e 7733 2e6f 7267 ttp://www.w3.org │ │ │ │ +0016c680: 2f32 3030 312f 584d 4c53 6368 656d 612d /2001/XMLSchema- │ │ │ │ +0016c690: 696e 7374 616e 6365 2671 756f 743b 3c2f instance" },
    . │ │ │ │ +0016c6b0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    { "xsd" │ │ │ │ +0016c6f0: 3b3c 2f73 7061 6e3e 2c20 2020 2020 203c ;, < │ │ │ │ +0016c700: 7370 616e 2063 6c61 7373 3d22 7374 7269 span class="stri │ │ │ │ +0016c710: 6e67 6c69 7465 7261 6c22 3e26 7175 6f74 ngliteral">" │ │ │ │ +0016c720: 3b68 7474 703a 2f2f 7777 772e 7733 2e6f ;http://www.w3.o │ │ │ │ +0016c730: 7267 2f32 3030 312f 584d 4c53 6368 656d rg/2001/XMLSchem │ │ │ │ +0016c740: 6126 7175 6f74 3b3c 2f73 7061 6e3e 207d a" } │ │ │ │ +0016c750: 2c20 3c2f 6469 763e 0a3c 6469 7620 636c ,
    .
    { < │ │ │ │ +0016c770: 7370 616e 2063 6c61 7373 3d22 7374 7269 span class="stri │ │ │ │ +0016c780: 6e67 6c69 7465 7261 6c22 3e26 7175 6f74 ngliteral">" │ │ │ │ +0016c790: 3b6e 7326 7175 6f74 3b3c 2f73 7061 6e3e ;ns" │ │ │ │ +0016c7a0: 2c20 2020 2020 2020 3c73 7061 6e20 636c , "some-U │ │ │ │ +0016c7d0: 5249 2671 756f 743b 3c2f 7370 616e 3e7d RI"} │ │ │ │ +0016c7e0: 2c20 3c73 7061 6e20 636c 6173 733d 2263 , // binds │ │ │ │ +0016c800: 2026 7175 6f74 3b6e 7326 7175 6f74 3b20 "ns" │ │ │ │ +0016c810: 6e61 6d65 7370 6163 6520 7072 6566 6978 namespace prefix │ │ │ │ +0016c820: 2074 6f20 7363 6865 6d61 2055 5249 3c2f to schema URI
    .
    │ │ │ │ +0016c850: 7b20 4e55 4c4c 2c20 4e55 4c4c 7d20 3c2f { NULL, NULL} .
    ];
    . │ │ │ │ +0016c880: 3c64 6976 2063 6c61 7373 3d22 7474 6322
    short │ │ │ │ +0016c950: 206d 7573 7455 6e64 6572 7374 616e 643c mustUnderstand< │ │ │ │ +0016c960: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
    The soap │ │ │ │ +0016c980: 3a3a 6d75 7374 556e 6465 7273 7461 6e64 ::mustUnderstand │ │ │ │ +0016c990: 2066 6c61 6720 6973 2073 6574 2077 6865 flag is set whe │ │ │ │ +0016c9a0: 6e20 6120 534f 4150 2048 6561 6465 7220 n a SOAP Header │ │ │ │ +0016c9b0: 656c 656d 656e 7420 6361 7272 6965 7320 element carries │ │ │ │ +0016c9c0: 6120 534f 4150 2d45 4e56 3a6d 7573 7455 a SOAP-ENV:mustU │ │ │ │ +0016c9d0: 6e64 6572 7374 616e 6420 6174 742e 2e2e nderstand att... │ │ │ │ +0016c9e0: 3c2f 6469 763e 3c64 6976 2063 6c61 7373
    Defi │ │ │ │ +0016ca00: 6e69 7469 6f6e 3a3c 2f62 3e20 7374 6473 nition: stds │ │ │ │ +0016ca10: 6f61 7032 2e68 3a32 3936 313c 2f64 6976 oap2.h:2961
    .
    < │ │ │ │ +0016ca40: 703e 4675 6e63 7469 6f6e 203c 636f 6465 p>Function │ │ │ │ +0016cac0: 736f 6170 5f6d 6174 6368 5f74 6167 3c2f soap_match_tag compar │ │ │ │ +0016cae0: 6573 2074 776f 2074 6167 732e 2054 6865 es two tags. The │ │ │ │ +0016caf0: 2074 6869 7264 2070 6172 616d 6574 6572 third parameter │ │ │ │ +0016cb00: 206d 6179 2062 6520 6120 7061 7474 6572 may be a patter │ │ │ │ +0016cb10: 6e20 7768 6572 6520 3c63 6f64 653e 2a3c n where *< │ │ │ │ +0016cb20: 2f63 6f64 653e 2069 7320 6120 7769 6c64 /code> is a wild │ │ │ │ +0016cb30: 6361 7264 2061 6e64 203c 636f 6465 3e2d card and - │ │ │ │ +0016cb40: 3c2f 636f 6465 3e20 6973 2061 2073 696e is a sin │ │ │ │ +0016cb50: 676c 6520 6368 6172 6163 7465 7220 7769 gle character wi │ │ │ │ +0016cb60: 6c64 6361 7264 2e20 536f 2066 6f72 2065 ldcard. So for e │ │ │ │ +0016cb70: 7861 6d70 6c65 203c 636f 6465 3e73 6f61 xample soa │ │ │ │ +0016cb80: 705f 6d61 7463 685f 7461 6728 736f 6170 p_match_tag(soap │ │ │ │ +0016cb90: 2c20 7461 672c 2022 6e73 3a2a 2229 3c2f , tag, "ns:*") will match │ │ │ │ +0016cbb0: 2061 6e79 2065 6c65 6d65 6e74 2069 6e20 any element in │ │ │ │ +0016cbc0: 6e61 6d65 7370 6163 6520 3c63 6f64 653e namespace │ │ │ │ +0016cbd0: 6e73 3c2f 636f 6465 3e20 6f72 2077 6865 ns or whe │ │ │ │ +0016cbe0: 6e20 6e6f 206e 616d 6573 7061 6365 2070 n no namespace p │ │ │ │ +0016cbf0: 7265 6669 7820 6973 2070 7265 7365 6e74 refix is present │ │ │ │ +0016cc00: 2069 6e20 7468 6520 584d 4c20 6d65 7373 in the XML mess │ │ │ │ +0016cc10: 6167 652e 3c2f 703e 0a3c 703e 5468 6520 age.

    .

    The │ │ │ │ +0016cc20: 6361 6c6c 6261 636b 2063 616e 2061 6c73 callback can als │ │ │ │ +0016cc30: 6f20 6265 2075 7365 6420 746f 206b 6565 o be used to kee │ │ │ │ +0016cc40: 7020 7472 6163 6b20 6f66 2075 6e6b 6e6f p track of unkno │ │ │ │ +0016cc50: 776e 2065 6c65 6d65 6e74 7320 696e 2061 wn elements in a │ │ │ │ +0016cc60: 6e20 696e 7465 726e 616c 2064 6174 6120 n internal data │ │ │ │ +0016cc70: 7374 7275 6374 7572 6520 7375 6368 2061 structure such a │ │ │ │ +0016cc80: 7320 6120 6c69 7374 3a3c 2f70 3e0a 3c64 s a list:

    .
    stru │ │ │ │ +0016ccd0: 6374 203c 2f73 7061 6e3e 556e 6b6e 6f77 ct Unknow │ │ │ │ +0016cce0: 6e20 3c2f 6469 763e 0a3c 6469 7620 636c n
    .
    {.
    char *ta │ │ │ │ +0016cd40: 673b 203c 2f64 6976 3e0a 3c64 6976 2063 g;
    .
    struct Unknown *next; │ │ │ │ +0016cd90: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    }; .. │ │ │ │ +0016ced0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    {
    .
    char *s = (char* │ │ │ │ +0016cf50: 293c 6120 636c 6173 733d 2263 6f64 6522 )soap_mallo │ │ │ │ +0016cfb0: 633c 2f61 3e28 3c61 2063 6c61 7373 3d22 c(soa │ │ │ │ +0016cfe0: 703c 2f61 3e2c 2073 7472 6c65 6e28 7461 p, strlen(ta │ │ │ │ +0016cff0: 6729 2b31 293b 203c 2f64 6976 3e0a 3c64 g)+1);
    . │ │ │ │ +0016d010: 2020 3c73 7061 6e20 636c 6173 733d 226b struct < │ │ │ │ +0016d030: 2f73 7061 6e3e 556e 6b6e 6f77 6e20 2a75 /span>Unknown *u │ │ │ │ +0016d040: 203d 2028 3c73 7061 6e20 636c 6173 733d = (struct │ │ │ │ +0016d060: 203c 2f73 7061 6e3e 556e 6b6e 6f77 6e2a Unknown* │ │ │ │ +0016d070: 293c 6120 636c 6173 733d 2263 6f64 6522 )soap_mallo │ │ │ │ +0016d0d0: 633c 2f61 3e28 3c61 2063 6c61 7373 3d22 c(soa │ │ │ │ +0016d100: 703c 2f61 3e2c 203c 7370 616e 2063 6c61 p, siz │ │ │ │ +0016d120: 656f 663c 2f73 7061 6e3e 283c 7370 616e eof(struct U │ │ │ │ +0016d150: 6e6b 6e6f 776e 2929 3b20 3c2f 6469 763e nknown));
    │ │ │ │ +0016d160: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    i │ │ │ │ +0016d190: 663c 2f73 7061 6e3e 2028 7320 2661 6d70 f (s & │ │ │ │ +0016d1a0: 3b26 616d 703b 2075 2920 3c2f 6469 763e ;& u)
    │ │ │ │ +0016d1b0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    {
    . │ │ │ │ +0016d1e0: 2020 2073 7472 6370 7928 732c 2074 6167 strcpy(s, tag │ │ │ │ +0016d1f0: 293b 203c 2f64 6976 3e0a 3c64 6976 2063 );
    .
    │ │ │ │ +0016d210: 752d 2667 743b 7461 6720 3d20 733b 203c u->tag = s; < │ │ │ │ +0016d220: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    u-&g │ │ │ │ +0016d240: 743b 6e65 7874 203d 2075 6c69 7374 3b20 t;next = ulist; │ │ │ │ +0016d250: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    uli │ │ │ │ +0016d270: 7374 203d 2075 3b20 3c2f 6469 763e 0a3c st = u;
    .< │ │ │ │ +0016d280: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +0016d290: 3e20 207d 203c 2f64 6976 3e0a 3c64 6976 > }
    .
    } │ │ │ │ +0016d2b0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    │ │ │ │ +0016d2d0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    int │ │ │ │ +0016d300: 3c2f 7370 616e 3e20 6d61 696e 2829 3c2f main().
    {
    .< │ │ │ │ +0016d330: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +0016d340: 3e20 203c 7370 616e 2063 6c61 7373 3d22 > struct │ │ │ │ +0016d360: 3c2f 7370 616e 3e3c 6120 636c 6173 733d so │ │ │ │ +0016d390: 6170 3c2f 613e 202a 3c61 2063 6c61 7373 ap *soap;
    .
    stru │ │ │ │ +0016d420: 6374 203c 2f73 7061 6e3e 556e 6b6e 6f77 ct Unknow │ │ │ │ +0016d430: 6e20 2a75 6c69 7374 203d 204e 554c 4c3b n *ulist = NULL; │ │ │ │ +0016d440: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    soap_init(& │ │ │ │ +0016d4c0: 616d 703b 3c61 2063 6c61 7373 3d22 636f amp;soap< │ │ │ │ +0016d4f0: 2f61 3e29 3b20 3c2f 6469 763e 0a3c 6469 /a>);
    . │ │ │ │ +0016d510: 203c 6120 636c 6173 733d 2263 6f64 6522 soap │ │ │ │ +0016d540: 2e3c 6120 636c 6173 733d 2263 6f64 6522 .fignore< │ │ │ │ +0016d5a0: 2f61 3e20 3d20 6d79 6967 6e6f 7265 3b20 /a> = myignore; │ │ │ │ +0016d5b0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    ... < │ │ │ │ +0016d5d0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ +0016d5e0: 656e 7422 3e2f 2f20 736f 6170 5f63 616c ent">// soap_cal │ │ │ │ +0016d5f0: 6c5f 6e73 5f5f 7765 626d 6574 686f 6428 l_ns__webmethod( │ │ │ │ +0016d600: 736f 6170 2c20 2e2e 2e29 206f 7220 736f soap, ...) or so │ │ │ │ +0016d610: 6170 5f73 6572 7665 2873 6f61 7029 203c ap_serve(soap) < │ │ │ │ +0016d620: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    . │ │ │ │ +0016d640: 202e 2e2e 203c 7370 616e 2063 6c61 7373 ... // pr │ │ │ │ +0016d660: 696e 7420 7468 6520 6c69 7374 206f 6620 int the list of │ │ │ │ +0016d670: 756e 6b6e 6f77 6e20 656c 656d 656e 7473 unknown elements │ │ │ │ +0016d680: 2073 746f 7265 6420 696e 2075 6c69 7374 stored in ulist │ │ │ │ +0016d690: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ │ +0016d6b0: 2020 3c61 2063 6c61 7373 3d22 636f 6465 soap_dest │ │ │ │ +0016d710: 726f 793c 2f61 3e28 2661 6d70 3b3c 6120 roy(&soap);.
    so │ │ │ │ +0016d7c0: 6170 5f65 6e64 3c2f 613e 2826 616d 703b ap_end(& │ │ │ │ +0016d7d0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap) │ │ │ │ +0016d800: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
    .
    soap_done(& │ │ │ │ +0016d880: 616d 703b 3c61 2063 6c61 7373 3d22 636f amp;soap< │ │ │ │ +0016d8b0: 2f61 3e29 3b3c 2f64 6976 3e0a 3c64 6976 /a>);
    .
    }< │ │ │ │ +0016d8d0: 2f64 6976 3e0a 3c2f 6469 763e 3c21 2d2d /div>.

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

    .How t │ │ │ │ +0016d950: 6f20 6861 6e64 6c65 2048 5454 5020 3330 o handle HTTP 30 │ │ │ │ +0016d960: 3720 7465 6d70 6f72 6172 7920 7265 6469 7 temporary redi │ │ │ │ +0016d970: 7265 6374 3c2f 6832 3e0a 3c70 3e54 6865 rect

    .

    The │ │ │ │ +0016d980: 2063 6c69 656e 742d 7369 6465 2068 616e client-side han │ │ │ │ +0016d990: 646c 696e 6720 6f66 2048 5454 5020 3330 dling of HTTP 30 │ │ │ │ +0016d9a0: 3720 636f 6465 2022 5465 6d70 6f72 6172 7 code "Temporar │ │ │ │ +0016d9b0: 7920 5265 6469 7265 6374 2220 616e 6420 y Redirect" and │ │ │ │ +0016d9c0: 616e 7920 6f66 2074 6865 2072 6564 6972 any of the redir │ │ │ │ +0016d9d0: 6563 7420 636f 6465 7320 3330 312c 2033 ect codes 301, 3 │ │ │ │ +0016d9e0: 3032 2c20 616e 6420 3330 3320 6172 6520 02, and 303 are │ │ │ │ +0016d9f0: 6e6f 7420 6175 746f 6d61 7465 642e 2043 not automated. C │ │ │ │ +0016da00: 6c69 656e 7420 6170 706c 6963 6174 696f lient applicatio │ │ │ │ +0016da10: 6e20 6465 7665 6c6f 7065 7273 206d 6179 n developers may │ │ │ │ +0016da20: 2077 616e 7420 746f 2063 6f6e 7369 6465 want to conside │ │ │ │ +0016da30: 7220 6164 6469 6e67 2061 2066 6577 206c r adding a few l │ │ │ │ +0016da40: 696e 6573 206f 6620 636f 6465 2074 6f20 ines of code to │ │ │ │ +0016da50: 7375 7070 6f72 7420 7265 6469 7265 6374 support redirect │ │ │ │ +0016da60: 732e 2049 7420 7761 7320 6465 6369 6465 s. It was decide │ │ │ │ +0016da70: 6420 6e6f 7420 746f 2061 7574 6f6d 6174 d not to automat │ │ │ │ +0016da80: 6963 616c 6c79 2073 7570 706f 7274 2072 ically support r │ │ │ │ +0016da90: 6564 6972 6563 7473 2066 6f72 2074 6865 edirects for the │ │ │ │ +0016daa0: 2066 6f6c 6c6f 7769 6e67 2072 6561 736f following reaso │ │ │ │ +0016dab0: 6e73 3a3c 2f70 3e0a 3c75 6c3e 0a3c 6c69 ns:

    .
      .
    • Redirecting a s │ │ │ │ +0016dad0: 6563 7572 6520 4854 5450 5320 6164 6472 ecure HTTPS addr │ │ │ │ +0016dae0: 6573 7320 746f 2061 206e 6f6e 2d73 6563 ess to a non-sec │ │ │ │ +0016daf0: 7572 6520 4854 5450 2061 6464 7265 7373 ure HTTP address │ │ │ │ +0016db00: 2076 6961 2033 3037 2063 7265 6174 6573 via 307 creates │ │ │ │ +0016db10: 2061 2073 6563 7572 6974 7920 7675 6c6e a security vuln │ │ │ │ +0016db20: 6572 6162 696c 6974 792e 3c2f 6c69 3e0a erability.
    • . │ │ │ │ +0016db30: 3c6c 693e 4379 636c 6963 2072 6564 6972
    • Cyclic redir │ │ │ │ +0016db40: 6563 7473 206d 7573 7420 6265 2064 6574 ects must be det │ │ │ │ +0016db50: 6563 7465 6420 2865 2e67 2e20 616c 6c6f ected (e.g. allo │ │ │ │ +0016db60: 7769 6e67 206f 6e6c 7920 6120 6c69 6d69 wing only a limi │ │ │ │ +0016db70: 7465 6420 6e75 6d62 6572 206f 6620 7265 ted number of re │ │ │ │ +0016db80: 6469 7265 6374 206c 6576 656c 7329 2e3c direct levels).< │ │ │ │ +0016db90: 2f6c 693e 0a3c 6c69 3e52 6564 6972 6563 /li>.
    • Redirec │ │ │ │ +0016dba0: 7469 6e67 2048 5454 5020 504f 5354 2077 ting HTTP POST w │ │ │ │ +0016dbb0: 696c 6c20 7265 7375 6c74 2069 6e20 7265 ill result in re │ │ │ │ +0016dbc0: 2d73 6572 6961 6c69 7a61 7469 6f6e 2061 -serialization a │ │ │ │ +0016dbd0: 6e64 2072 652d 706f 7374 206f 6620 7468 nd re-post of th │ │ │ │ +0016dbe0: 6520 656e 7469 7265 2053 4f41 5020 7265 e entire SOAP re │ │ │ │ +0016dbf0: 7175 6573 742e 2054 6865 2053 4f41 5020 quest. The SOAP │ │ │ │ +0016dc00: 7265 7175 6573 7420 6d65 7373 6167 6520 request message │ │ │ │ +0016dc10: 6d75 7374 2062 6520 7265 2d70 6f73 7465 must be re-poste │ │ │ │ +0016dc20: 6420 696e 2069 7473 2065 6e74 6972 6574 d in its entiret │ │ │ │ +0016dc30: 7920 7768 656e 2072 652d 6973 7375 696e y when re-issuin │ │ │ │ +0016dc40: 6720 7468 6520 534f 4150 206f 7065 7261 g the SOAP opera │ │ │ │ +0016dc50: 7469 6f6e 2074 6f20 6120 6e65 7720 6164 tion to a new ad │ │ │ │ +0016dc60: 6472 6573 732e 3c2f 6c69 3e0a 3c2f 756c dress.
    • .
    .

    To implemen │ │ │ │ +0016dc80: 7420 636c 6965 6e74 2d73 6964 6520 3330 t client-side 30 │ │ │ │ +0016dc90: 3720 7265 6469 7265 6374 2c20 6164 6420 7 redirect, add │ │ │ │ +0016dca0: 7468 6520 666f 6c6c 6f77 696e 6720 6c69 the following li │ │ │ │ +0016dcb0: 6e65 7320 6f66 2063 6f64 653a 3c2f 703e nes of code:

    │ │ │ │ +0016dcc0: 0a3c 6469 7620 636c 6173 733d 2266 7261 .
    c │ │ │ │ +0016dd00: 6f6e 7374 3c2f 7370 616e 3e20 3c73 7061 onst char *endpoint = NU │ │ │ │ +0016dd40: 4c4c 3b20 3c73 7061 6e20 636c 6173 733d LL; // use │ │ │ │ +0016dd60: 2064 6566 6175 6c74 2065 6e64 706f 696e default endpoin │ │ │ │ +0016dd70: 7420 6769 7665 6e20 696e 2057 5344 4c20 t given in WSDL │ │ │ │ +0016dd80: 6f72 2073 7065 6369 6679 206f 6e65 2068 or specify one h │ │ │ │ +0016dd90: 6572 653c 2f73 7061 6e3e 3c2f 6469 763e ere
    │ │ │ │ +0016dda0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    int │ │ │ │ +0016ddd0: 3c2f 7370 616e 3e20 7265 6469 7265 6374 redirect │ │ │ │ +0016dde0: 7320 3d20 3130 3b20 2020 2020 2020 2020 s = 10; │ │ │ │ +0016ddf0: 203c 7370 616e 2063 6c61 7373 3d22 636f // max re │ │ │ │ +0016de10: 6469 7265 6374 2063 6f75 6e74 203c 2f73 direct count
    .
    while (redirects-- │ │ │ │ +0016de70: 2920 3c2f 6469 763e 0a3c 6469 7620 636c )
    .
    {.
    if (soap │ │ │ │ +0016ded0: 5f63 616c 6c5f 6e73 315f 5f6d 794d 6574 _call_ns1__myMet │ │ │ │ +0016dee0: 686f 6428 3c61 2063 6c61 7373 3d22 636f hod(soap< │ │ │ │ +0016df10: 2f61 3e2c 2065 6e64 706f 696e 742c 202e /a>, endpoint, . │ │ │ │ +0016df20: 2e2e 2929 203c 2f64 6976 3e0a 3c64 6976 ..))
    .
    │ │ │ │ +0016df40: 7b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 {
    .
    if ((soap< │ │ │ │ +0016dfb0: 2f61 3e2d 2667 743b 3c61 2063 6c61 7373 /a>->error >= │ │ │ │ +0016e010: 2033 3031 2026 616d 703b 2661 6d70 3b20 301 && │ │ │ │ +0016e020: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap- │ │ │ │ +0016e050: 2667 743b 3c61 2063 6c61 7373 3d22 636f >err │ │ │ │ +0016e0a0: 6f72 3c2f 613e 2026 6c74 3b3d 2033 3033 or <= 303 │ │ │ │ +0016e0b0: 2920 7c7c 203c 6120 636c 6173 733d 2263 ) || soap │ │ │ │ +0016e0e0: 3c2f 613e 2d26 6774 3b3c 6120 636c 6173 ->error == 3 │ │ │ │ +0016e140: 3037 2920 3c2f 6469 763e 0a3c 6469 7620 07)
    .
    │ │ │ │ +0016e160: 207b 3c2f 6469 763e 0a3c 6469 7620 636c {
    .
    │ │ │ │ +0016e180: 2065 6e64 706f 696e 7420 3d20 3c61 2063 endpoint = soap_strdup │ │ │ │ +0016e1f0: 283c 6120 636c 6173 733d 2263 6f64 6522 (soap │ │ │ │ +0016e220: 2c20 3c61 2063 6c61 7373 3d22 636f 6465 , soap->e │ │ │ │ +0016e2a0: 6e64 706f 696e 743c 2f61 3e29 3b20 3c73 ndpoint); // endpoint │ │ │ │ +0016e2d0: 6672 6f6d 2048 5454 5020 3330 312c 2033 from HTTP 301, 3 │ │ │ │ +0016e2e0: 3032 2c20 3330 332c 2033 3037 204c 6f63 02, 303, 307 Loc │ │ │ │ +0016e2f0: 6174 696f 6e20 6865 6164 6572 203c 2f73 ation header
    .
    │ │ │ │ +0016e320: 207d 3c2f 6469 763e 0a3c 6469 7620 636c }
    .
    < │ │ │ │ +0016e340: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +0016e350: 6f72 6466 6c6f 7722 3e65 6c73 653c 2f73 ordflow">else
    .
    │ │ │ │ +0016e380: 2020 7b3c 2f64 6976 3e0a 3c64 6976 2063 {
    .
    │ │ │ │ +0016e3a0: 2020 2e2e 2e20 3c73 7061 6e20 636c 6173 ... // h │ │ │ │ +0016e3c0: 616e 646c 6520 6572 726f 7220 3c2f 7370 andle error
    .
    │ │ │ │ +0016e3f0: 2020 3c73 7061 6e20 636c 6173 733d 226b brea │ │ │ │ +0016e410: 6b3c 2f73 7061 6e3e 3b20 3c2f 6469 763e k;
    │ │ │ │ +0016e420: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    }
    . │ │ │ │ +0016e440: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    }
    . │ │ │ │ +0016e470: 203c 7370 616e 2063 6c61 7373 3d22 6b65 else< │ │ │ │ +0016e490: 2f73 7061 6e3e 203c 2f64 6976 3e0a 3c64 /span>
    . │ │ │ │ +0016e4b0: 2020 7b3c 2f64 6976 3e0a 3c64 6976 2063 {
    .
    │ │ │ │ +0016e4d0: 3c73 7061 6e20 636c 6173 733d 226b 6579 break< │ │ │ │ +0016e4f0: 2f73 7061 6e3e 3b20 3c73 7061 6e20 636c /span>; // │ │ │ │ +0016e510: 2061 6c6c 204f 4b20 6e6f 773c 2f73 7061 all OK now
    .
    }.
    }
    .< │ │ │ │ +0016e560: 2f64 6976 3e3c 212d 2d20 6672 6167 6d65 /div>

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

    .

    │ │ │ │ +0016e5b0: 3c61 2063 6c61 7373 3d22 616e 6368 6f72 . │ │ │ │ +0016e5d0: 486f 7720 746f 2069 6d70 6c65 6d65 6e74 How to implement │ │ │ │ +0016e5e0: 2048 5454 5020 4745 542c 2050 5554 2c20 HTTP GET, PUT, │ │ │ │ +0016e5f0: 616e 6420 5041 5443 4820 7365 7276 6963 and PATCH servic │ │ │ │ +0016e600: 6573 3c2f 6832 3e0a 3c70 3e54 6f20 696d es

    .

    To im │ │ │ │ +0016e610: 706c 656d 656e 7420 4854 5450 2047 4554 plement HTTP GET │ │ │ │ +0016e620: 2072 6571 7565 7374 2072 6573 706f 6e73 request respons │ │ │ │ +0016e630: 6573 2c20 6465 6669 6e65 2074 6865 203c es, define the < │ │ │ │ +0016e640: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soap::fge │ │ │ │ +0016e710: 743c 2f61 3e3c 2f63 6f64 653e 2063 616c t cal │ │ │ │ +0016e720: 6c62 6163 6b20 6675 6e63 7469 6f6e 2e20 lback function. │ │ │ │ +0016e730: 5468 6520 6361 6c6c 6261 636b 2069 7320 The callback is │ │ │ │ +0016e740: 7265 7175 6972 6564 2074 6f20 7072 6f64 required to prod │ │ │ │ +0016e750: 7563 6520 6120 7265 7370 6f6e 7365 2074 uce a response t │ │ │ │ +0016e760: 6f20 7468 6520 7265 7175 6573 7420 696e o the request in │ │ │ │ +0016e770: 2074 6578 7475 616c 2066 6f72 6d2c 2073 textual form, s │ │ │ │ +0016e780: 7563 6820 6173 2061 2057 6562 2070 6167 uch as a Web pag │ │ │ │ +0016e790: 6520 6f72 2061 6e20 584d 4c20 6f72 204a e or an XML or J │ │ │ │ +0016e7a0: 534f 4e20 7265 7370 6f6e 7365 2e3c 2f70 SON response.

    .

    You can als │ │ │ │ +0016e7c0: 6f20 7573 6520 7468 6520 3c63 6f64 653e o use the │ │ │ │ +0016e7d0: 3c61 2063 6c61 7373 3d22 656c 2220 6872 http_get plugin whic │ │ │ │ +0016e870: 6820 6573 7365 6e74 6961 6c6c 7920 7365 h essentially se │ │ │ │ +0016e880: 7473 2074 6865 203c 636f 6465 3e3c 6120 ts the s │ │ │ │ +0016e950: 6f61 703a 3a66 6765 743c 2f61 3e3c 2f63 oap::fget callback an │ │ │ │ +0016e970: 6420 616c 736f 206b 6565 7073 2074 7261 d also keeps tra │ │ │ │ +0016e980: 636b 206f 6620 7468 6520 6e75 6d62 6572 ck of the number │ │ │ │ +0016e990: 206f 6620 4854 5450 2047 4554 2061 6e64 of HTTP GET and │ │ │ │ +0016e9a0: 2050 4f53 5420 7265 7175 6573 7473 206d POST requests m │ │ │ │ +0016e9b0: 6164 6520 6174 2074 6865 2073 6572 7665 ade at the serve │ │ │ │ +0016e9c0: 7220 7369 6465 2e3c 2f70 3e0a 3c70 3e54 r side.

    .

    T │ │ │ │ +0016e9d0: 6865 2066 6f6c 6c6f 7769 6e67 2065 7861 he following exa │ │ │ │ +0016e9e0: 6d70 6c65 2070 726f 6475 6365 7320 6120 mple produces a │ │ │ │ +0016e9f0: 5765 6220 7061 6765 2075 706f 6e20 6120 Web page upon a │ │ │ │ +0016ea00: 4854 5450 2047 4554 2072 6571 7565 7374 HTTP GET request │ │ │ │ +0016ea10: 2028 652e 672e 2066 726f 6d20 6120 6272 (e.g. from a br │ │ │ │ +0016ea20: 6f77 7365 7229 3a3c 2f70 3e0a 3c64 6976 owser):

    .
    in │ │ │ │ +0016ea70: 743c 2f73 7061 6e3e 206d 6169 6e28 293c t main()< │ │ │ │ +0016ea80: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    {
    . │ │ │ │ +0016eaa0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    struct │ │ │ │ +0016ead0: 203c 2f73 7061 6e3e 3c61 2063 6c61 7373 s │ │ │ │ +0016eb00: 6f61 703c 2f61 3e20 2a3c 6120 636c 6173 oap * │ │ │ │ +0016eb30: 736f 6170 3c2f 613e 203d 203c 6120 636c soap = │ │ │ │ +0016eb90: 736f 6170 5f6e 6577 3c2f 613e 2829 3b20 soap_new(); │ │ │ │ +0016eba0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    soap->< │ │ │ │ +0016ebf0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +0016ec00: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ │ +0016ec10: 705f 5f63 616c 6c62 6163 6b73 2e68 746d p__callbacks.htm │ │ │ │ +0016ec20: 6c23 6761 6530 3232 3230 3466 6637 3030 l#gae022204ff700 │ │ │ │ +0016ec30: 3464 6632 6435 6163 3965 3038 3363 6262 4df2d5ac9e083cbb │ │ │ │ +0016ec40: 3562 3136 223e 6667 6574 3c2f 613e 203d 5b16">fget = │ │ │ │ +0016ec50: 203c 6120 636c 6173 733d 2263 6f64 6522 http_get; < │ │ │ │ +0016ecb0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    ... //.. │ │ │ │ +0016eda0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    ... // │ │ │ │ +0016edd0: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ │ +0016edf0: 7d3c 2f64 6976 3e0a 3c64 6976 2063 6c61 }
    .
    .
    in │ │ │ │ +0016ee40: 743c 2f73 7061 6e3e 203c 6120 636c 6173 t http_ge │ │ │ │ +0016eea0: 743c 2f61 3e28 3c73 7061 6e20 636c 6173 t(stru │ │ │ │ +0016eec0: 6374 3c2f 7370 616e 3e20 3c61 2063 6c61 ct soap *soap) .
    {
    . │ │ │ │ +0016ef60: 203c 7370 616e 2063 6c61 7373 3d22 6b65 if
    (soap_respo │ │ │ │ +0016efe0: 6e73 653c 2f61 3e28 3c61 2063 6c61 7373 nse(s │ │ │ │ +0016f010: 6f61 703c 2f61 3e2c 203c 6120 636c 6173 oap, SOAP_HT │ │ │ │ +0016f070: 4d4c 3c2f 613e 2920 3c73 7061 6e20 636c ML) // │ │ │ │ +0016f090: 2048 5454 5020 7265 7370 6f6e 7365 2068 HTTP response h │ │ │ │ +0016f0a0: 6561 6465 7220 7769 7468 2074 6578 742f eader with text/ │ │ │ │ +0016f0b0: 6874 6d6c 203c 2f73 7061 6e3e 3c2f 6469 html .
    || soap_ │ │ │ │ +0016f130: 7365 6e64 3c2f 613e 283c 6120 636c 6173 send( │ │ │ │ +0016f160: 736f 6170 3c2f 613e 2c20 3c73 7061 6e20 soap, "< │ │ │ │ +0016f190: 4854 4d4c 2667 743b 4d79 2057 6562 2073 HTML>My Web s │ │ │ │ +0016f1a0: 6572 7665 7220 6973 206f 7065 7261 7469 erver is operati │ │ │ │ +0016f1b0: 6f6e 616c 2e26 6c74 3b2f 4854 4d4c 2667 onal.</HTML&g │ │ │ │ +0016f1c0: 743b 2671 756f 743b 3c2f 7370 616e 3e29 t;") │ │ │ │ +0016f1d0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    || < │ │ │ │ +0016f1f0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +0016f200: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ │ +0016f210: 705f 5f69 6f2e 6874 6d6c 2367 6132 3930 p__io.html#ga290 │ │ │ │ +0016f220: 6464 6234 3661 6664 6266 3565 6336 3636 ddb46afdbf5ec666 │ │ │ │ +0016f230: 3962 3661 6338 6461 6361 3563 3922 3e73 9b6ac8daca5c9">s │ │ │ │ +0016f240: 6f61 705f 656e 645f 7365 6e64 3c2f 613e oap_end_send │ │ │ │ +0016f250: 283c 6120 636c 6173 733d 2263 6f64 6522 (soap │ │ │ │ +0016f280: 2929 3c2f 6469 763e 0a3c 6469 7620 636c ))
    .
    < │ │ │ │ +0016f2a0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +0016f2b0: 6f72 6466 6c6f 7722 3e72 6574 7572 6e3c ordflow">return< │ │ │ │ +0016f2c0: 2f73 7061 6e3e 203c 6120 636c 6173 733d /span> soap_clos │ │ │ │ +0016f320: 6573 6f63 6b3c 2f61 3e28 3c61 2063 6c61 esock(soap);
    .
    │ │ │ │ +0016f390: 7265 7475 726e 3c2f 7370 616e 3e20 3c61 return so │ │ │ │ +0016f3f0: 6170 5f63 6c6f 7365 736f 636b 3c2f 613e ap_closesock │ │ │ │ +0016f400: 283c 6120 636c 6173 733d 2263 6f64 6522 (soap │ │ │ │ +0016f430: 293b 3c2f 6469 763e 0a3c 6469 7620 636c );
    .
    }.
    │ │ │ │ +0016f530: 696e 7428 2a20 6667 6574 2928 7374 7275 int(* fget)(stru │ │ │ │ +0016f540: 6374 2073 6f61 7020 2a73 6f61 7029 3c2f ct soap *soap)
    Callback │ │ │ │ +0016f570: 746f 2069 6d70 6c65 6d65 6e74 206c 6f67 to implement log │ │ │ │ +0016f580: 6963 2061 7420 7468 6520 7365 7276 6572 ic at the server │ │ │ │ +0016f590: 2d73 6964 6520 746f 2073 6572 7665 2072 -side to serve r │ │ │ │ +0016f5a0: 6573 706f 6e73 6573 2074 6f20 4854 5450 esponses to HTTP │ │ │ │ +0016f5b0: 2047 4554 2072 6571 7565 7374 7320 6672 GET requests fr │ │ │ │ +0016f5c0: 6f6d 2063 6c69 656e 7473 2e3c 2f64 6976 om clients.
    Definitio │ │ │ │ +0016f5f0: 6e3a 3c2f 623e 2073 7464 736f 6170 322e n: stdsoap2. │ │ │ │ +0016f600: 683a 3433 3330 3c2f 6469 763e 3c2f 6469 h:4330
    .
    int soap_re │ │ │ │ +0016f6f0: 7370 6f6e 7365 2873 7472 7563 7420 736f sponse(struct so │ │ │ │ +0016f700: 6170 202a 736f 6170 2c20 696e 7420 7374 ap *soap, int st │ │ │ │ +0016f710: 6174 7573 293c 2f64 6976 3e3c 6469 7620 atus)
    In │ │ │ │ +0016f730: 6974 6961 6c69 7a65 2074 6865 2063 6f6e itialize the con │ │ │ │ +0016f740: 7465 7874 2066 6f72 2073 6572 7665 722d text for server- │ │ │ │ +0016f750: 7369 6465 2073 656e 6469 6e67 2061 6e64 side sending and │ │ │ │ +0016f760: 2073 656e 6420 6120 4854 5450 2072 6573 send a HTTP res │ │ │ │ +0016f770: 706f 6e73 6520 6865 6164 6572 2e3c 2f64 ponse header.
    .
    .
    int http_get(st │ │ │ │ +0016f9a0: 7275 6374 2073 6f61 7020 2a2c 2073 7472 ruct soap *, str │ │ │ │ +0016f9b0: 7563 7420 736f 6170 5f70 6c75 6769 6e20 uct soap_plugin │ │ │ │ +0016f9c0: 2a2c 2076 6f69 6420 2a29 3c2f 6469 763e *, void *)
    │ │ │ │ +0016f9d0: 3c64 6976 2063 6c61 7373 3d22 7474 646f
    The HTTP GET │ │ │ │ +0016f9f0: 706c 7567 696e 2072 6567 6973 7472 6174 plugin registrat │ │ │ │ +0016fa00: 696f 6e20 6675 6e63 7469 6f6e 2e3c 2f64 ion function.
    .
    SOAP_HTML
    #define │ │ │ │ +0016faf0: 534f 4150 5f48 544d 4c3c 2f64 6976 3e3c SOAP_HTML
    < │ │ │ │ +0016fb00: 6469 7620 636c 6173 733d 2274 7464 6f63 div class="ttdoc │ │ │ │ +0016fb10: 223e 4120 7370 6563 6961 6c20 736f 6170 ">A special soap │ │ │ │ +0016fb20: 5f73 7461 7475 7320 6572 726f 7220 636f _status error co │ │ │ │ +0016fb30: 6465 2074 6f20 7369 676e 616c 2074 6861 de to signal tha │ │ │ │ +0016fb40: 7420 6120 6375 7374 6f6d 2048 5454 5020 t a custom HTTP │ │ │ │ +0016fb50: 7265 7370 6f6e 7365 2069 7320 7072 6573 response is pres │ │ │ │ +0016fb60: 656e 7420 616e 6420 6e6f 2048 5454 5020 ent and no HTTP │ │ │ │ +0016fb70: 7265 7370 6f6e 732e 2e2e 3c2f 6469 763e respons...
    │ │ │ │ +0016fb80: 3c64 6976 2063 6c61 7373 3d22 7474 6465
    Definition │ │ │ │ +0016fba0: 3a3c 2f62 3e20 7374 6473 6f61 7032 2e68 : stdsoap2.h │ │ │ │ +0016fbb0: 3a32 3731 323c 2f64 6976 3e3c 2f64 6976 :2712
    .
    │ │ │ │ +0016fc80: 3c64 6976 2063 6c61 7373 3d22 7474 6465
    int soap_end │ │ │ │ +0016fca0: 5f73 656e 6428 7374 7275 6374 2073 6f61 _send(struct soa │ │ │ │ +0016fcb0: 7020 2a73 6f61 7029 3c2f 6469 763e 3c64 p *soap)
    Finalize the co │ │ │ │ +0016fce0: 6e74 6578 7420 6166 7465 7220 7365 6e64 ntext after send │ │ │ │ +0016fcf0: 696e 672e 3c2f 6469 763e 3c2f 6469 763e ing.
    │ │ │ │ +0016fd00: 0a3c 2f64 6976 3e3c 212d 2d20 6672 6167 .

    The e │ │ │ │ +0016fd20: 7861 6d70 6c65 2062 656c 6f77 2070 726f xample below pro │ │ │ │ +0016fd30: 6475 6365 7320 6120 5753 444c 2066 696c duces a WSDL fil │ │ │ │ +0016fd40: 6520 7570 6f6e 2061 2048 5454 5020 4745 e upon a HTTP GE │ │ │ │ +0016fd50: 5420 7769 7468 2070 6174 6820 3c63 6f64 T with path ?wsdl:< │ │ │ │ +0016fd70: 2f70 3e0a 3c64 6976 2063 6c61 7373 3d22 /p>.

    int │ │ │ │ +0016fdc0: 203c 6120 636c 6173 733d 2263 6f64 6522 http_get(struct soap *soap)
    .
    {.
    FILE *f │ │ │ │ +0016fee0: 6420 3d20 4e55 4c4c 3b3c 2f64 6976 3e0a d = NULL;
    . │ │ │ │ +0016fef0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    ch │ │ │ │ +0016ff20: 6172 3c2f 7370 616e 3e20 2a73 203d 2073 ar *s = s │ │ │ │ +0016ff30: 7472 6368 7228 3c61 2063 6c61 7373 3d22 trchr(soa │ │ │ │ +0016ff60: 703c 2f61 3e2d 2667 743b 3c61 2063 6c61 p->path, '? │ │ │ │ +0016ffe0: 393b 3c2f 7370 616e 3e29 3b20 3c2f 6469 9;); .
    if (!s | │ │ │ │ +00170030: 7c20 7374 7263 6d70 2873 2c20 3c73 7061 | strcmp(s, "?w │ │ │ │ +00170060: 7364 6c26 7175 6f74 3b3c 2f73 7061 6e3e sdl" │ │ │ │ +00170070: 2929 203c 2f64 6976 3e0a 3c64 6976 2063 ))
    .
    │ │ │ │ +00170090: 3c73 7061 6e20 636c 6173 733d 226b 6579 return │ │ │ │ +001700b0: 3c2f 7370 616e 3e20 3c61 2063 6c61 7373 SOAP │ │ │ │ +00170110: 5f47 4554 5f4d 4554 484f 443c 2f61 3e3b _GET_METHOD; │ │ │ │ +00170120: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    fd = │ │ │ │ +00170140: 203c 6120 636c 6173 733d 2263 6f64 6522 fopen(&q │ │ │ │ +001701c0: 756f 743b 6d79 7365 7276 6963 652e 7773 uot;myservice.ws │ │ │ │ +001701d0: 646c 2671 756f 743b 3c2f 7370 616e 3e2c dl", │ │ │ │ +001701e0: 203c 7370 616e 2063 6c61 7373 3d22 7374 &qu │ │ │ │ +00170200: 6f74 3b72 6226 7175 6f74 3b3c 2f73 7061 ot;rb"); // op │ │ │ │ +00170230: 656e 2057 5344 4c20 6669 6c65 2074 6f20 en WSDL file to │ │ │ │ +00170240: 636f 7079 203c 2f73 7061 6e3e 3c2f 6469 copy .
    if (!fd) │ │ │ │ +00170290: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    return 404; // return HTTP │ │ │ │ +00170300: 6e6f 7420 666f 756e 6420 6572 726f 7220 not found error │ │ │ │ +00170310: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ │ +00170330: 2020 3c61 2063 6c61 7373 3d22 636f 6465 soap->h │ │ │ │ +001703b0: 7474 705f 636f 6e74 656e 743c 2f61 3e20 ttp_content │ │ │ │ +001703c0: 3d20 3c73 7061 6e20 636c 6173 733d 2273 = &q │ │ │ │ +001703e0: 756f 743b 7465 7874 2f78 6d6c 2671 756f uot;text/xml&quo │ │ │ │ +001703f0: 743b 3c2f 7370 616e 3e3b 203c 7370 616e t;; // HTTP header │ │ │ │ +00170420: 7769 7468 2074 6578 742f 786d 6c20 636f with text/xml co │ │ │ │ +00170430: 6e74 656e 7420 3c2f 7370 616e 3e3c 2f64 ntent .
    if (soa │ │ │ │ +001704d0: 705f 7265 7370 6f6e 7365 3c2f 613e 283c p_response(< │ │ │ │ +001704e0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +001704f0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ +00170500: 6874 6d6c 223e 736f 6170 3c2f 613e 2c20 html">soap, │ │ │ │ +00170510: 3c61 2063 6c61 7373 3d22 636f 6465 2220 │ │ │ │ +00170560: 534f 4150 5f46 494c 453c 2f61 3e29 203d SOAP_FILE) = │ │ │ │ +00170570: 3d20 3c61 2063 6c61 7373 3d22 636f 6465 = SOAP_OK)
    .
    {.
    while (1)
    .
    │ │ │ │ +00170650: 2020 7b3c 2f64 6976 3e0a 3c64 6976 2063 {
    .
    │ │ │ │ +00170670: 2020 3c73 7061 6e20 636c 6173 733d 226b size │ │ │ │ +00170690: 5f74 3c2f 7370 616e 3e20 7220 3d20 6672 _t r = fr │ │ │ │ +001706a0: 6561 6428 3c61 2063 6c61 7373 3d22 636f ead(soap< │ │ │ │ +001706d0: 2f61 3e2d 2667 743b 3c61 2063 6c61 7373 /a>->tmpbuf, 1, │ │ │ │ +00170730: 3c73 7061 6e20 636c 6173 733d 226b 6579 sizeof(soap< │ │ │ │ +00170780: 2f61 3e2d 2667 743b 3c61 2063 6c61 7373 /a>->tmpbuf), fd │ │ │ │ +001707e0: 293b 203c 2f64 6976 3e0a 3c64 6976 2063 );
    .
    │ │ │ │ +00170800: 2020 3c73 7061 6e20 636c 6173 733d 226b if (!r || soa │ │ │ │ +00170880: 705f 7365 6e64 5f72 6177 3c2f 613e 283c p_send_raw(< │ │ │ │ +00170890: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +001708a0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ +001708b0: 6874 6d6c 223e 736f 6170 3c2f 613e 2c20 html">soap, │ │ │ │ +001708c0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap- │ │ │ │ +001708f0: 2667 743b 3c61 2063 6c61 7373 3d22 636f >tmp │ │ │ │ +00170940: 6275 663c 2f61 3e2c 2072 2929 203c 2f64 buf, r)) .
    break;
    .
    │ │ │ │ +001709b0: 2020 7d20 3c2f 6469 763e 0a3c 6469 7620 }
    .
    } │ │ │ │ +001709d0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    fclose(fd) │ │ │ │ +00170a50: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
    .
    soa │ │ │ │ +00170ac0: 705f 656e 645f 7365 6e64 3c2f 613e 283c p_end_send(< │ │ │ │ +00170ad0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +00170ae0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ +00170af0: 6874 6d6c 223e 736f 6170 3c2f 613e 293b html">soap); │ │ │ │ +00170b00: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .. │ │ │ │ +00170bf0: 7d3c 2f64 6976 3e0a 3c64 6976 2063 6c61 }
    .
    │ │ │ │ +00170c60: 3c61 2068 7265 663d 2267 726f 7570 5f5f SOAP_GET_ │ │ │ │ +00170cb0: 4d45 5448 4f44 3c2f 613e 3c2f 6469 763e METHOD
    │ │ │ │ +00170cc0: 3c64 6976 2063 6c61 7373 3d22 7474 6465
    #define SOAP │ │ │ │ +00170ce0: 5f47 4554 5f4d 4554 484f 443c 2f64 6976 _GET_METHOD
    A soap_statu │ │ │ │ +00170d10: 7320 6572 726f 7220 636f 6465 3a20 616e s error code: an │ │ │ │ +00170d20: 2048 5454 5020 4745 5420 7265 7175 6573 HTTP GET reques │ │ │ │ +00170d30: 7420 7761 7320 7265 6365 6976 6564 2062 t was received b │ │ │ │ +00170d40: 7920 7468 6520 7365 7276 6963 6520 6275 y the service bu │ │ │ │ +00170d50: 7420 7468 6520 4745 5420 7265 7175 6573 t the GET reques │ │ │ │ +00170d60: 7420 6361 6c6c 6261 632e 2e2e 3c2f 6469 t callbac...
    Definiti │ │ │ │ +00170d90: 6f6e 3a3c 2f62 3e20 7374 6473 6f61 7032 on: stdsoap2 │ │ │ │ +00170da0: 2e68 3a32 3339 373c 2f64 6976 3e3c 2f64 .h:2397
    .
    #define SOAP_F │ │ │ │ +00170e90: 494c 453c 2f64 6976 3e3c 6469 7620 636c ILE
    A sp │ │ │ │ +00170eb0: 6563 6961 6c20 736f 6170 5f73 7461 7475 ecial soap_statu │ │ │ │ +00170ec0: 7320 6572 726f 7220 636f 6465 2074 6f20 s error code to │ │ │ │ +00170ed0: 7369 676e 616c 2074 6861 7420 6120 6375 signal that a cu │ │ │ │ +00170ee0: 7374 6f6d 2066 696c 652d 6261 7365 6420 stom file-based │ │ │ │ +00170ef0: 4854 5450 2072 6573 706f 6e73 6520 6973 HTTP response is │ │ │ │ +00170f00: 2070 7265 7365 6e74 2061 6e64 206e 6f20 present and no │ │ │ │ +00170f10: 482e 2e2e 3c2f 6469 763e 3c64 6976 2063 H...
    │ │ │ │ +00170f30: 4465 6669 6e69 7469 6f6e 3a3c 2f62 3e20 Definition: │ │ │ │ +00170f40: 7374 6473 6f61 7032 2e68 3a32 3731 393c stdsoap2.h:2719< │ │ │ │ +00170f50: 2f64 6976 3e3c 2f64 6976 3e0a 3c64 6976 /div>
    .
    │ │ │ │ +00170fc0: 3c61 2068 7265 663d 2267 726f 7570 5f5f soap_send_raw │ │ │ │ +00171010: 3c2f 613e 3c2f 6469 763e 3c64 6976 2063
    in │ │ │ │ +00171030: 7420 736f 6170 5f73 656e 645f 7261 7728 t soap_send_raw( │ │ │ │ +00171040: 7374 7275 6374 2073 6f61 7020 2a73 6f61 struct soap *soa │ │ │ │ +00171050: 702c 2063 6f6e 7374 2063 6861 7220 2a73 p, const char *s │ │ │ │ +00171060: 2c20 7369 7a65 5f74 206e 293c 2f64 6976 , size_t n)
    Send raw byt │ │ │ │ +00171090: 6573 2e3c 2f64 6976 3e3c 2f64 6976 3e0a es.
    . │ │ │ │ +001710a0: 3c64 6976 2063 6c61 7373 3d22 7474 6322
    < │ │ │ │ +00171150: 6469 7620 636c 6173 733d 2274 7464 6563 div class="ttdec │ │ │ │ +00171160: 6922 3e63 6861 7220 746d 7062 7566 5b53 i">char tmpbuf[S │ │ │ │ +00171170: 4f41 505f 544d 504c 454e 5d3c 2f64 6976 OAP_TMPLEN]
    Internal buf │ │ │ │ +001711a0: 6665 7220 746f 2068 6f6c 6420 7465 6d70 fer to hold temp │ │ │ │ +001711b0: 6f72 6172 7920 7374 7269 6e67 7320 7375 orary strings su │ │ │ │ +001711c0: 6368 2061 7320 7374 7269 6e67 2072 6570 ch as string rep │ │ │ │ +001711d0: 7265 7365 6e74 6174 696f 6e73 206f 6620 resentations of │ │ │ │ +001711e0: 7072 696d 6974 6976 6520 7661 6c75 6573 primitive values │ │ │ │ +001711f0: 2c2e 2e2e 3c2f 6469 763e 3c64 6976 2063 ,...
    │ │ │ │ +00171210: 4465 6669 6e69 7469 6f6e 3a3c 2f62 3e20 Definition: │ │ │ │ +00171220: 7374 6473 6f61 7032 2e68 3a34 3139 393c stdsoap2.h:4199< │ │ │ │ +00171230: 2f64 6976 3e3c 2f64 6976 3e0a 3c64 6976 /div>
    .
    const char │ │ │ │ +00171310: 2a20 6874 7470 5f63 6f6e 7465 6e74 3c2f * http_content
    String wi │ │ │ │ +00171340: 7468 2048 5454 5020 636f 6e74 656e 7420 th HTTP content │ │ │ │ +00171350: 7479 7065 2068 6561 6465 7220 7661 6c75 type header valu │ │ │ │ +00171360: 6520 7265 6365 6976 6564 2c20 6361 6e20 e received, can │ │ │ │ +00171370: 616c 736f 2062 6520 6173 7369 676e 6564 also be assigned │ │ │ │ +00171380: 2074 6f20 7370 6563 6966 7920 6120 636f to specify a co │ │ │ │ +00171390: 6e74 656e 7420 7479 7065 2068 2e2e 2e3c ntent type h...< │ │ │ │ +001713a0: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
    Defin │ │ │ │ +001713c0: 6974 696f 6e3a 3c2f 623e 2073 7464 736f ition: stdso │ │ │ │ +001713d0: 6170 322e 683a 3239 3830 3c2f 6469 763e ap2.h:2980
    │ │ │ │ +001713e0: 3c2f 6469 763e 0a3c 2f64 6976 3e3c 212d
    .

    This example sh │ │ │ │ +00171410: 6f77 7320 686f 7720 6f6e 6520 7072 6564 ows how one pred │ │ │ │ +00171420: 6574 6572 6d69 6e65 6420 6669 6c65 2069 etermined file i │ │ │ │ +00171430: 7320 7365 7276 6564 2e20 5468 6520 3c65 s served. The gsoap/sa │ │ │ │ +00171450: 6d70 6c65 732f 7765 6273 6572 7665 723c mples/webserver< │ │ │ │ +00171460: 2f63 6f64 653e 3c2f 656d 3e20 6465 6d6f /code> demo │ │ │ │ +00171470: 6e73 7472 6174 6573 2068 6f77 2066 696c nstrates how fil │ │ │ │ +00171480: 6573 2073 686f 756c 6420 6265 2073 6572 es should be ser │ │ │ │ +00171490: 7665 6420 696e 2067 656e 6572 616c 2c20 ved in general, │ │ │ │ +001714a0: 6279 2061 6464 696e 6720 7468 6520 6e65 by adding the ne │ │ │ │ +001714b0: 6365 7373 6172 7920 6c6f 6769 6320 746f cessary logic to │ │ │ │ +001714c0: 2061 6464 206d 6564 6961 2074 7970 6573 add media types │ │ │ │ +001714d0: 2074 6f20 4854 5450 2068 6561 6465 7273 to HTTP headers │ │ │ │ +001714e0: 2061 6e64 2074 6f20 7265 7374 7269 6374 and to restrict │ │ │ │ +001714f0: 2074 6865 2073 656c 6563 7469 6f6e 206f the selection o │ │ │ │ +00171500: 6620 6669 6c65 7320 7468 6174 2073 686f f files that sho │ │ │ │ +00171510: 756c 6420 6265 2073 6572 7665 642e 3c2f uld be served..

    < │ │ │ │ +00171540: 6474 3e57 6172 6e69 6e67 3c2f 6474 3e3c dt>Warning< │ │ │ │ +00171550: 6464 3e57 6865 6e20 7365 7276 696e 6720 dd>When serving │ │ │ │ +00171560: 6669 6c65 7320 6173 2072 6573 706f 6e73 files as respons │ │ │ │ +00171570: 6573 2074 6f20 7265 7175 6573 7473 2c20 es to requests, │ │ │ │ +00171580: 7765 206e 6565 6420 746f 2062 6520 7661 we need to be va │ │ │ │ +00171590: 7279 2063 6172 6566 756c 2c20 6265 6361 ry careful, beca │ │ │ │ +001715a0: 7573 6520 7765 2064 6f6e 2774 2077 616e use we don't wan │ │ │ │ +001715b0: 7420 7265 7175 6573 7473 2074 6f20 736e t requests to sn │ │ │ │ +001715c0: 6f6f 7020 6172 6f75 6e64 2069 6e20 6469 oop around in di │ │ │ │ +001715d0: 7265 6374 6f72 6965 7320 616e 6420 7365 rectories and se │ │ │ │ +001715e0: 7276 6520 6669 6c65 7320 7468 6174 2073 rve files that s │ │ │ │ +001715f0: 686f 756c 6420 6265 2070 726f 7465 6374 hould be protect │ │ │ │ +00171600: 6564 2066 726f 6d20 7075 626c 6963 2076 ed from public v │ │ │ │ +00171610: 6965 772e 2054 6865 7265 666f 7265 2c20 iew. Therefore, │ │ │ │ +00171620: 7768 656e 2061 6464 696e 6720 6c6f 6769 when adding logi │ │ │ │ +00171630: 6320 746f 2073 6572 7665 2066 696c 6573 c to serve files │ │ │ │ +00171640: 2c20 7765 206d 7573 7420 7265 6a65 6374 , we must reject │ │ │ │ +00171650: 2072 6571 7565 7374 2074 6861 7420 6861 request that ha │ │ │ │ +00171660: 7665 203c 636f 6465 3e3c 6120 636c 6173 ve │ │ │ │ +001716f0: 736f 6170 3a3a 7061 7468 3c2f 613e 3c2f soap::path values wit │ │ │ │ +00171710: 6820 6120 3c63 6f64 653e 2f3c 2f63 6f64 h a / or a \< │ │ │ │ +00171730: 2f63 6f64 653e 2028 3c63 6f64 653e 3c61 /code> (soap::path< │ │ │ │ +001717d0: 2f61 3e3c 2f63 6f64 653e 2069 7320 6120 /a> is a │ │ │ │ +001717e0: 7374 7269 6e67 2077 6974 6820 7468 6520 string with the │ │ │ │ +001717f0: 7061 7468 2070 6172 7420 6f66 2074 6865 path part of the │ │ │ │ +00171800: 2055 524c 2c20 7374 6172 7469 6e67 2077 URL, starting w │ │ │ │ +00171810: 6974 6820 6120 3c63 6f64 653e 2f3c 2f63 ith a /). If these │ │ │ │ +00171830: 6172 6520 616c 6c6f 7765 642c 2074 6865 are allowed, the │ │ │ │ +00171840: 6e20 7765 206d 7573 7420 6174 206c 6561 n we must at lea │ │ │ │ +00171850: 7374 2063 6865 636b 2066 6f72 203c 636f st check for .. in │ │ │ │ +00171870: 7468 6520 7061 7468 2074 6f20 6176 6f69 the path to avoi │ │ │ │ +00171880: 6420 7265 7175 6573 7420 6672 6f6d 2073 d request from s │ │ │ │ +00171890: 6e6f 6f70 696e 6720 6172 6f75 6e64 2069 nooping around i │ │ │ │ +001718a0: 6e20 6869 6768 6572 2064 6972 6563 746f n higher directo │ │ │ │ +001718b0: 7269 6573 2061 6c6c 2074 6865 2077 6179 ries all the way │ │ │ │ +001718c0: 2075 7020 746f 2074 6865 2072 6f6f 742e up to the root. │ │ │ │ +001718d0: 3c2f 6464 3e3c 2f64 6c3e 0a3c 703e 466f
    .

    Fo │ │ │ │ +001718e0: 7220 6120 6f6e 652d 7761 7920 534f 4150 r a one-way SOAP │ │ │ │ +001718f0: 2f58 4d4c 206d 6573 7361 6765 2c20 796f /XML message, yo │ │ │ │ +00171900: 7520 6361 6e20 616c 736f 2072 6574 7572 u can also retur │ │ │ │ +00171910: 6e20 6120 534f 4150 2f58 4d4c 2072 6573 n a SOAP/XML res │ │ │ │ +00171920: 706f 6e73 653a 3c2f 703e 0a3c 6469 7620 ponse:

    .
    .
    {
    .
    │ │ │ │ +00171a90: 3c61 2063 6c61 7373 3d22 636f 6465 2220 │ │ │ │ +00171ae0: 736f 6170 5f72 6573 706f 6e73 653c 2f61 soap_response(soap, SOAP_OK);
    .
    │ │ │ │ +00171ba0: 3c73 7061 6e20 636c 6173 733d 226b 6579 return │ │ │ │ +00171bc0: 3c2f 7370 616e 3e20 736f 6170 5f73 656e soap_sen │ │ │ │ +00171bd0: 645f 6e73 315f 5f6d 7953 656e 644d 6574 d_ns1__mySendMet │ │ │ │ +00171be0: 686f 6452 6573 706f 6e73 6528 3c61 2063 hodResponse(soap, "& │ │ │ │ +00171c40: 7175 6f74 3b3c 2f73 7061 6e3e 2c20 4e55 quot;, NU │ │ │ │ +00171c50: 4c4c 2c20 2e2e 2e20 7061 7261 6d73 202e LL, ... params . │ │ │ │ +00171c60: 2e2e 293b 203c 2f64 6976 3e0a 3c64 6976 ..);
    .
    } │ │ │ │ +00171c80: 3c2f 6469 763e 0a3c 2f64 6976 3e3c 212d
    .

    where ns1 │ │ │ │ +00171cb0: 5f5f 6d79 5365 6e64 4d65 7468 6f64 5265 __mySendMethodRe │ │ │ │ +00171cc0: 7370 6f6e 7365 3c2f 636f 6465 3e20 6973 sponse is │ │ │ │ +00171cd0: 2061 206f 6e65 2d77 6179 206d 6573 7361 a one-way messa │ │ │ │ +00171ce0: 6765 2064 6563 6c61 7265 6420 696e 2061 ge declared in a │ │ │ │ +00171cf0: 2069 6e74 6572 6661 6365 2068 6561 6465 interface heade │ │ │ │ +00171d00: 7220 6669 6c65 2061 733a 3c2f 703e 0a3c r file as:

    .< │ │ │ │ +00171d10: 6469 7620 636c 6173 733d 2266 7261 676d div class="fragm │ │ │ │ +00171d20: 656e 7422 3e3c 6469 7620 636c 6173 733d ent">
    int ns1_ │ │ │ │ +00171d60: 5f6d 7953 656e 644d 6574 686f 6452 6573 _mySendMethodRes │ │ │ │ +00171d70: 706f 6e73 6528 2e2e 2e20 7061 7261 6d73 ponse(... params │ │ │ │ +00171d80: 202e 2e2e 2c20 3c73 7061 6e20 636c 6173 ..., │ │ │ │ +00171da0: 766f 6964 3c2f 7370 616e 3e29 3b3c 2f64 void);.

    Th │ │ │ │ +00171dd0: 6520 6765 6e65 7261 7465 6420 3c65 6d3e e generated │ │ │ │ +00171de0: 3c63 6f64 653e 736f 6170 436c 6965 6e74 soapClient │ │ │ │ +00171df0: 2e63 7070 3c2f 636f 6465 3e3c 2f65 6d3e .cpp │ │ │ │ +00171e00: 2069 6e63 6c75 6465 7320 7468 6520 7365 includes the se │ │ │ │ +00171e10: 6e64 696e 672d 7369 6465 2073 7475 6220 nding-side stub │ │ │ │ +00171e20: 6675 6e63 7469 6f6e 2e3c 2f70 3e0a 3c70 function.

    .

    The examples ab │ │ │ │ +00171e40: 6f76 6520 6172 6520 666f 7220 4854 5450 ove are for HTTP │ │ │ │ +00171e50: 2047 4554 2e20 546f 2069 6d70 6c65 6d65 GET. To impleme │ │ │ │ +00171e60: 6e74 2048 5454 5020 5055 5420 616e 6420 nt HTTP PUT and │ │ │ │ +00171e70: 5041 5443 4820 7365 7420 7468 6520 3c63 PATCH set the soap::fput │ │ │ │ +00171f50: 3c2f 613e 3c2f 636f 6465 3e20 616e 6420 and │ │ │ │ +00171f60: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 soap │ │ │ │ +00172030: 3a3a 6670 6174 6368 3c2f 613e 3c2f 636f ::fpatch callback fun │ │ │ │ +00172050: 6374 696f 6e73 206f 7220 7573 6520 7468 ctions or use th │ │ │ │ +00172060: 6520 3c63 6f64 653e 3c61 2063 6c61 7373 e http_p │ │ │ │ +001720f0: 6f73 743c 2f61 3e3c 2f63 6f64 653e 2070 ost p │ │ │ │ +00172100: 6c75 6769 6e20 7768 6963 6820 6973 206d lugin which is m │ │ │ │ +00172110: 6f72 6520 6361 7061 626c 652e 3c2f 703e ore capable.

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

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

    .

    │ │ │ │ +00172180: 0a54 4350 2061 6e64 2048 5454 5020 6b65 .TCP and HTTP ke │ │ │ │ +00172190: 6570 2d61 6c69 7665 3c2f 6832 3e0a 3c70 ep-alive

    .

    To activate HTT │ │ │ │ +001721b0: 5020 6b65 6570 2d61 6c69 7665 2c20 7365 P keep-alive, se │ │ │ │ +001721c0: 7420 7468 6520 3c63 6f64 653e 2353 4f41 t the #SOA │ │ │ │ +001721d0: 505f 494f 5f4b 4545 5041 4c49 5645 3c2f P_IO_KEEPALIVE flag for b │ │ │ │ +001721f0: 6f74 6820 696e 7075 7420 616e 6420 6f75 oth input and ou │ │ │ │ +00172200: 7470 7574 206d 6f64 6573 2c20 7365 6520 tput modes, see │ │ │ │ +00172210: 5365 6374 696f 6e20 3c61 2063 6c61 7373 Section Ru │ │ │ │ +00172240: 6e2d 7469 6d65 2066 6c61 6773 3c2f 613e n-time flags │ │ │ │ +00172250: 202e 2046 6f72 2065 7861 6d70 6c65 3c2f . For example.

    struct < │ │ │ │ +001722b0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +001722c0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ +001722d0: 6874 6d6c 223e 736f 6170 3c2f 613e 203c html">soap < │ │ │ │ +001722e0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +001722f0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ +00172300: 6874 6d6c 223e 736f 6170 3c2f 613e 3b20 html">soap; │ │ │ │ +00172310: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .

    W │ │ │ │ +00172450: 6865 6e20 6120 636c 6965 6e74 206f 7220 hen a client or │ │ │ │ +00172460: 6120 7365 7276 6963 6520 636f 6d6d 756e a service commun │ │ │ │ +00172470: 6963 6174 6573 2077 6974 6820 616e 6f74 icates with anot │ │ │ │ +00172480: 6865 7220 636c 6965 6e74 206f 7220 7365 her client or se │ │ │ │ +00172490: 7276 6963 6520 7468 6174 2073 7570 706f rvice that suppo │ │ │ │ +001724a0: 7274 7320 6b65 6570 2061 6c69 7665 2c20 rts keep alive, │ │ │ │ +001724b0: 7468 6520 3c63 6f64 653e 3c61 2063 6c61 the soap::ke │ │ │ │ +00172570: 6570 5f61 6c69 7665 3c2f 613e 3c2f 636f ep_alive variable wil │ │ │ │ +00172590: 6c20 6265 2073 6574 2074 6f20 312c 206f l be set to 1, o │ │ │ │ +001725a0: 7468 6572 7769 7365 2069 7420 6973 2072 therwise it is r │ │ │ │ +001725b0: 6573 6574 2074 6f20 3020 696e 6469 6361 eset to 0 indica │ │ │ │ +001725c0: 7469 6e67 2074 6861 7420 7468 6520 6f74 ting that the ot │ │ │ │ +001725d0: 6865 7220 7061 7274 7920 7761 6e74 7320 her party wants │ │ │ │ +001725e0: 746f 2063 6c6f 7365 2074 6865 2063 6f6e to close the con │ │ │ │ +001725f0: 6e65 6374 696f 6e2e 2054 6865 2063 6f6e nection. The con │ │ │ │ +00172600: 6e65 6374 696f 6e20 6d61 7962 6520 7465 nection maybe te │ │ │ │ +00172610: 726d 696e 6174 6564 206f 6e20 6569 7468 rminated on eith │ │ │ │ +00172620: 6572 2065 6e64 2062 6566 6f72 6520 7468 er end before th │ │ │ │ +00172630: 6520 636f 6d6d 756e 6963 6174 696f 6e20 e communication │ │ │ │ +00172640: 636f 6d70 6c65 7465 642c 2066 6f72 2065 completed, for e │ │ │ │ +00172650: 7861 6d70 6c65 2077 6865 6e20 7468 6520 xample when the │ │ │ │ +00172660: 7365 7276 6572 206b 6565 702d 616c 6976 server keep-aliv │ │ │ │ +00172670: 6520 636f 6e6e 6563 7469 6f6e 2068 6173 e connection has │ │ │ │ +00172680: 2074 696d 6564 206f 7574 2e20 5468 6973 timed out. This │ │ │ │ +00172690: 206d 6179 2067 656e 6572 6174 6520 6120 may generate a │ │ │ │ +001726a0: 2242 726f 6b65 6e20 5069 7065 2220 7369 "Broken Pipe" si │ │ │ │ +001726b0: 676e 616c 206f 6e20 556e 6978 2f4c 696e gnal on Unix/Lin │ │ │ │ +001726c0: 7578 2070 6c61 7466 6f72 6d73 2e20 5468 ux platforms. Th │ │ │ │ +001726d0: 6973 2073 6967 6e61 6c20 6361 6e20 6265 is signal can be │ │ │ │ +001726e0: 2063 6175 6768 7420 7769 7468 2061 2073 caught with a s │ │ │ │ +001726f0: 6967 6e61 6c20 6861 6e64 6c65 723a 3c2f ignal handler:.

    signa │ │ │ │ +00172730: 6c28 5349 4750 4950 452c 2073 6967 7069 l(SIGPIPE, sigpi │ │ │ │ +00172740: 7065 5f68 616e 646c 6529 3b3c 2f64 6976 pe_handle);
    .

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

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

    Alt │ │ │ │ +00172830: 6572 6e61 7469 7665 6c79 2c20 6272 6f6b ernatively, brok │ │ │ │ +00172840: 656e 2070 6970 6573 2063 616e 2062 6520 en pipes can be │ │ │ │ +00172850: 6b65 7074 2073 696c 656e 7420 6279 2073 kept silent by s │ │ │ │ +00172860: 6574 7469 6e67 3a3c 2f70 3e0a 3c64 6976 etting:

    .
    soap< │ │ │ │ +001728c0: 2f61 3e2e 3c61 2063 6c61 7373 3d22 636f /a>.soc │ │ │ │ +00172910: 6b65 745f 666c 6167 733c 2f61 3e20 3d20 ket_flags = │ │ │ │ +00172920: 4d53 475f 4e4f 5349 474e 414c 3b3c 2f64 MSG_NOSIGNAL;.
    int │ │ │ │ +00172a00: 2073 6f63 6b65 745f 666c 6167 733c 2f64 socket_flags
    User-defin │ │ │ │ +00172a30: 6162 6c65 2073 6f63 6b65 7420 7365 6e64 able socket send │ │ │ │ +00172a40: 2061 6e64 2072 6563 7620 666c 6167 732c and recv flags, │ │ │ │ +00172a50: 2066 6f72 2065 7861 6d70 6c65 2061 7373 for example ass │ │ │ │ +00172a60: 6967 6e20 4d53 475f 4e4f 5349 474e 414c ign MSG_NOSIGNAL │ │ │ │ +00172a70: 2074 6f20 6469 7361 626c 6520 7369 6770 to disable sigp │ │ │ │ +00172a80: 6970 6520 2874 6865 2076 612e 2e2e 3c2f ipe (the va...
    Defini │ │ │ │ +00172ab0: 7469 6f6e 3a3c 2f62 3e20 7374 6473 6f61 tion: stdsoa │ │ │ │ +00172ac0: 7032 2e68 3a33 3335 393c 2f64 6976 3e3c p2.h:3359
    < │ │ │ │ +00172ad0: 2f64 6976 3e0a 3c2f 6469 763e 3c21 2d2d /div>.

    │ │ │ │ +00172af0: 5468 6973 2073 6574 7469 6e67 2077 696c This setting wil │ │ │ │ +00172b00: 6c20 6e6f 7420 6765 6e65 7261 7465 2061 l not generate a │ │ │ │ +00172b10: 2053 4947 5049 5045 2062 7574 2072 6561 SIGPIPE but rea │ │ │ │ +00172b20: 642f 7772 6974 6520 6f70 6572 6174 696f d/write operatio │ │ │ │ +00172b30: 6e73 2072 6574 7572 6e20 3c63 6f64 653e ns return │ │ │ │ +00172b40: 2353 4f41 505f 454f 463c 2f63 6f64 653e #SOAP_EOF │ │ │ │ +00172b50: 2069 6e73 7465 6164 2e20 4e6f 7465 2074 instead. Note t │ │ │ │ +00172b60: 6861 7420 5769 6e64 6f77 7320 646f 6573 hat Windows does │ │ │ │ +00172b70: 206e 6f74 2073 7570 706f 7274 2073 6967 not support sig │ │ │ │ +00172b80: 6e61 6c73 2061 6e64 206c 6163 6b20 7468 nals and lack th │ │ │ │ +00172b90: 6520 3c63 6f64 653e 4d53 475f 4e4f 5349 e MSG_NOSI │ │ │ │ +00172ba0: 474e 414c 3c2f 636f 6465 3e20 666c 6167 GNAL flag │ │ │ │ +00172bb0: 2e3c 2f70 3e0a 3c70 3e49 6620 7468 6520 .

    .

    If the │ │ │ │ +00172bc0: 636c 6965 6e74 2064 6f65 7320 6e6f 7420 client does not │ │ │ │ +00172bd0: 636c 6f73 6520 7468 6520 636f 6e6e 6563 close the connec │ │ │ │ +00172be0: 7469 6f6e 2c20 7468 6520 7365 7276 6572 tion, the server │ │ │ │ +00172bf0: 2077 696c 6c20 7761 6974 2066 6f72 6576 will wait forev │ │ │ │ +00172c00: 6572 2077 6865 6e20 6e6f 203c 636f 6465 er when no soap │ │ │ │ +00172cc0: 3a3a 7265 6376 5f74 696d 656f 7574 3c2f ::recv_timeout is spe │ │ │ │ +00172ce0: 6369 6669 6564 2c20 736f 2062 6520 6361 cified, so be ca │ │ │ │ +00172cf0: 7265 6675 6c20 746f 2073 6574 2074 696d reful to set tim │ │ │ │ +00172d00: 656f 7574 732c 2053 6565 2053 6563 7469 eouts, See Secti │ │ │ │ +00172d10: 6f6e 203c 6120 636c 6173 733d 2265 6c22 on Timeo │ │ │ │ +00172d40: 7574 206d 616e 6167 656d 656e 7420 666f ut management fo │ │ │ │ +00172d50: 7220 6e6f 6e2d 626c 6f63 6b69 6e67 206f r non-blocking o │ │ │ │ +00172d60: 7065 7261 7469 6f6e 733c 2f61 3e2e 2049 perations. I │ │ │ │ +00172d70: 6e20 6164 6469 7469 6f6e 2c20 6f74 6865 n addition, othe │ │ │ │ +00172d80: 7220 636c 6965 6e74 7320 7769 6c6c 2062 r clients will b │ │ │ │ +00172d90: 6520 6465 6e69 6564 2073 6572 7669 6365 e denied service │ │ │ │ +00172da0: 2061 7320 6c6f 6e67 2061 7320 6120 636c as long as a cl │ │ │ │ +00172db0: 6965 6e74 206b 6565 7073 2074 6865 2063 ient keeps the c │ │ │ │ +00172dc0: 6f6e 6e65 6374 696f 6e20 746f 2074 6865 onnection to the │ │ │ │ +00172dd0: 2073 6572 7665 7220 6f70 656e 2e20 546f server open. To │ │ │ │ +00172de0: 2070 7265 7665 6e74 2074 6869 7320 6672 prevent this fr │ │ │ │ +00172df0: 6f6d 2068 6170 7065 6e69 6e67 2c20 7468 om happening, th │ │ │ │ +00172e00: 6520 7365 7276 6963 6520 7368 6f75 6c64 e service should │ │ │ │ +00172e10: 2062 6520 6d75 6c74 692d 7468 7265 6164 be multi-thread │ │ │ │ +00172e20: 6564 2073 7563 6820 7468 6174 2065 6163 ed such that eac │ │ │ │ +00172e30: 6820 7468 7265 6164 2068 616e 646c 6573 h thread handles │ │ │ │ +00172e40: 2074 6865 2063 6c69 656e 7420 636f 6e6e the client conn │ │ │ │ +00172e50: 6563 7469 6f6e 3a3c 2f70 3e0a 3c64 6976 ection:

    .
    in │ │ │ │ +00172ea0: 743c 2f73 7061 6e3e 206d 6169 6e28 3c73 t main(int argc, char * │ │ │ │ +00172f00: 2a61 7267 7629 203c 2f64 6976 3e0a 3c64 *argv)
    . │ │ │ │ +00172f20: 7b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 {
    .
    struct │ │ │ │ +00172f60: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap │ │ │ │ +00172f90: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap, │ │ │ │ +00172fc0: 202a 7473 6f61 703b 203c 2f64 6976 3e0a *tsoap;
    . │ │ │ │ +00172fd0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    THREAD_ │ │ │ │ +00173040: 5459 5045 3c2f 613e 2074 6964 3b20 3c2f TYPE tid; .
    int m, │ │ │ │ +00173090: 2073 3b20 3c2f 6469 763e 0a3c 6469 7620 s;
    .
    < │ │ │ │ +001730b0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +001730c0: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ │ +001730d0: 705f 5f63 6f6e 7465 7874 2e68 746d 6c23 p__context.html# │ │ │ │ +001730e0: 6761 3363 3730 6235 3837 6663 3466 3635 ga3c70b587fc4f65 │ │ │ │ +001730f0: 3535 3363 6665 3639 3735 3164 3161 3135 553cfe69751d1a15 │ │ │ │ +00173100: 3765 223e 736f 6170 5f69 6e69 7432 3c2f 7e">soap_init2(&s │ │ │ │ +00173140: 6f61 703c 2f61 3e2c 203c 6120 636c 6173 oap, SOAP │ │ │ │ +001731a0: 5f49 4f5f 4b45 4550 414c 4956 453c 2f61 _IO_KEEPALIVE, SOAP_IO_KE │ │ │ │ +00173210: 4550 414c 4956 453c 2f61 3e29 3b20 3c2f EPALIVE); .
    │ │ │ │ +00173260: 736f 6170 3c2f 613e 2e3c 6120 636c 6173 soap.max_keep_alive │ │ │ │ +001732c0: 3c2f 613e 203d 2031 3030 3b20 3c73 7061 = 100; // at most 100 │ │ │ │ +001732f0: 2063 616c 6c73 2070 6572 206b 6565 702d calls per keep- │ │ │ │ +00173300: 616c 6976 6520 7365 7373 696f 6e20 3c2f alive session
    .
    │ │ │ │ +00173330: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap. │ │ │ │ +00173360: 3c61 2063 6c61 7373 3d22 636f 6465 2220 accept_ │ │ │ │ +001733b0: 7469 6d65 6f75 743c 2f61 3e20 3d20 3630 timeout = 60 │ │ │ │ +001733c0: 303b 203c 7370 616e 2063 6c61 7373 3d22 0; // opti │ │ │ │ +001733e0: 6f6e 616c 3a20 6c65 7420 7365 7276 6572 onal: let server │ │ │ │ +001733f0: 2074 696d 6520 6f75 7420 6166 7465 7220 time out after │ │ │ │ +00173400: 7465 6e20 6d69 6e75 7465 7320 6f66 2069 ten minutes of i │ │ │ │ +00173410: 6e61 6374 6976 6974 7920 3c2f 7370 616e nactivity
    ..
    if │ │ │ │ +00173570: 2821 3c61 2063 6c61 7373 3d22 636f 6465 (!soap_valid_s │ │ │ │ +001735d0: 6f63 6b65 743c 2f61 3e28 6d29 2920 3c2f ocket(m)) .
    {
    │ │ │ │ +00173600: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    soap_p │ │ │ │ +00173670: 7269 6e74 5f66 6175 6c74 3c2f 613e 2826 rint_fault(& │ │ │ │ +00173680: 616d 703b 3c61 2063 6c61 7373 3d22 636f amp;soap< │ │ │ │ +001736b0: 2f61 3e2c 2073 7464 6572 7229 3b20 3c2f /a>, stderr); .
    exit( │ │ │ │ +001736e0: 4558 4954 5f46 4149 4c55 5245 293b 203c EXIT_FAILURE); < │ │ │ │ +001736f0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    } ..
    │ │ │ │ +00173910: 203c 6120 636c 6173 733d 2263 6f64 6522 soap │ │ │ │ +00173940: 2e3c 6120 636c 6173 733d 2263 6f64 6522 .socket │ │ │ │ +00173990: 5f66 6c61 6773 3c2f 613e 203d 204d 5347 _flags = MSG │ │ │ │ +001739a0: 5f4e 4f53 4947 4e41 4c3b 203c 7370 616e _NOSIGNAL; // use this
    .
    │ │ │ │ +001739f0: 203c 6120 636c 6173 733d 2263 6f64 6522 soap │ │ │ │ +00173a20: 2e3c 6120 636c 6173 733d 2263 6f64 6522 .accept │ │ │ │ +00173a70: 5f66 6c61 6773 3c2f 613e 203d 2053 4f5f _flags = SO_ │ │ │ │ +00173a80: 4e4f 5349 4750 4950 453b 203c 7370 616e NOSIGPIPE; // or this to p │ │ │ │ +00173ab0: 7265 7665 6e74 2053 4947 5049 5045 203c revent SIGPIPE < │ │ │ │ +00173ac0: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    . │ │ │ │ +00173ae0: 2020 2073 203d 203c 6120 636c 6173 733d s = soap_acce │ │ │ │ +00173b40: 7074 3c2f 613e 2826 616d 703b 3c61 2063 pt(&soap); .
    if ( │ │ │ │ +00173bc0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap_valid_soc │ │ │ │ +00173c20: 6b65 743c 2f61 3e28 7329 2920 3c2f 6469 ket(s)) .
    {
    │ │ │ │ +00173c50: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    fprintf │ │ │ │ +00173c70: 2873 7464 6572 722c 203c 7370 616e 2063 (stderr, "Accep │ │ │ │ +00173ca0: 7420 736f 636b 6574 2025 6420 636f 6e6e t socket %d conn │ │ │ │ +00173cb0: 6563 7469 6f6e 2066 726f 6d20 4950 2025 ection from IP % │ │ │ │ +00173cc0: 642e 2564 2e25 642e 2564 5c6e 2671 756f d.%d.%d.%d\n&quo │ │ │ │ +00173cd0: 743b 3c2f 7370 616e 3e2c 2073 2c20 283c t;, s, (< │ │ │ │ +00173ce0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +00173cf0: 6f72 6474 7970 6522 3e69 6e74 3c2f 7370 ordtype">int)(soap │ │ │ │ +00173d30: 3c2f 613e 2e3c 6120 636c 6173 733d 2263 .ip │ │ │ │ +00173d80: 3c2f 613e 2667 743b 2667 743b 3234 2926 >>24)& │ │ │ │ +00173d90: 616d 703b 3078 4646 2c20 283c 7370 616e amp;0xFF, (int) │ │ │ │ +00173dc0: 283c 6120 636c 6173 733d 2263 6f64 6522 (soap │ │ │ │ +00173df0: 2e3c 6120 636c 6173 733d 2263 6f64 6522 .ip │ │ │ │ +00173e40: 2667 743b 2667 743b 3136 2926 616d 703b >>16)& │ │ │ │ +00173e50: 3078 4646 2c20 283c 7370 616e 2063 6c61 0xFF, (int)(soap.ip> │ │ │ │ +00173f00: 2667 743b 3829 2661 6d70 3b30 7846 462c >8)&0xFF, │ │ │ │ +00173f10: 2028 3c73 7061 6e20 636c 6173 733d 226b (int< │ │ │ │ +00173f30: 2f73 7061 6e3e 293c 6120 636c 6173 733d /span>)so │ │ │ │ +00173f60: 6170 3c2f 613e 2e3c 6120 636c 6173 733d ap. │ │ │ │ +00173fb0: 6970 3c2f 613e 2661 6d70 3b30 7846 4629 ip&0xFF) │ │ │ │ +00173fc0: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
    .
    │ │ │ │ +00173fe0: 2074 736f 6170 203d 203c 6120 636c 6173 tsoap = so │ │ │ │ +00174040: 6170 5f63 6f70 793c 2f61 3e28 2661 6d70 ap_copy(& │ │ │ │ +00174050: 3b3c 6120 636c 6173 733d 2263 6f64 6522 ;soap │ │ │ │ +00174080: 293b 203c 2f64 6976 3e0a 3c64 6976 2063 );
    .
    │ │ │ │ +001740a0: 2020 3c73 7061 6e20 636c 6173 733d 226b if (!tsoap).
    < │ │ │ │ +001740f0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +00174100: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ │ +00174110: 705f 5f69 6f2e 6874 6d6c 2367 6130 6361 p__io.html#ga0ca │ │ │ │ +00174120: 3063 3634 6463 3736 6166 3836 3137 3935 0c64dc76af861795 │ │ │ │ +00174130: 3661 3632 6366 3131 3764 6239 3422 3e73 6a62cf117db94">s │ │ │ │ +00174140: 6f61 705f 666f 7263 655f 636c 6f73 6573 oap_force_closes │ │ │ │ +00174150: 6f63 6b3c 2f61 3e28 2661 6d70 3b3c 6120 ock(&soap);.
    else
    .
    │ │ │ │ +001741f0: 2020 203c 7370 616e 2063 6c61 7373 3d22 whi │ │ │ │ +00174210: 6c65 3c2f 7370 616e 3e20 283c 6120 636c le ( │ │ │ │ +00174270: 5448 5245 4144 5f43 5245 4154 453c 2f61 THREAD_CREATE(&tid, (void*(*)(void*))p │ │ │ │ +001742e0: 726f 6365 7373 5f72 6571 7565 7374 2c20 rocess_request, │ │ │ │ +001742f0: 283c 7370 616e 2063 6c61 7373 3d22 6b65 (void< │ │ │ │ +00174310: 2f73 7061 6e3e 2a29 7473 6f61 7029 293c /span>*)tsoap))< │ │ │ │ +00174320: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    │ │ │ │ +00174340: 2020 736c 6565 7028 3129 3b20 3c73 7061 sleep(1); // failed, try │ │ │ │ +00174370: 2061 6761 696e 3c2f 7370 616e 3e3c 2f64 again.
    }
    .
    else if (soap.errn │ │ │ │ +00174480: 756d 3c2f 613e 2920 3c73 7061 6e20 636c um) // │ │ │ │ +001744a0: 2061 6363 6570 7420 6661 696c 6564 2c20 accept failed, │ │ │ │ +001744b0: 7472 7920 6167 6169 6e20 6166 7465 7220 try again after │ │ │ │ +001744c0: 3120 7365 636f 6e64 3c2f 7370 616e 3e3c 1 second< │ │ │ │ +001744d0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    {..
    │ │ │ │ +001745d0: 2020 736c 6565 7028 3129 3b3c 2f64 6976 sleep(1);
    .
    }
    . │ │ │ │ +00174600: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    │ │ │ │ +00174630: 656c 7365 3c2f 7370 616e 3e3c 2f64 6976 else
    .
    {
    . │ │ │ │ +00174660: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    fprintf( │ │ │ │ +00174680: 7374 6465 7272 2c20 3c73 7061 6e20 636c stderr, "Server │ │ │ │ +001746b0: 2074 696d 6564 206f 7574 5c6e 2671 756f timed out\n&quo │ │ │ │ +001746c0: 743b 3c2f 7370 616e 3e29 3b3c 2f64 6976 t;);
    .
    break │ │ │ │ +00174710: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
    .
    } │ │ │ │ +00174730: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    } .
    return │ │ │ │ +00174790: 2030 3b20 3c2f 6469 763e 0a3c 6469 7620 0;
    .
    } < │ │ │ │ +001747b0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    . │ │ │ │ +001747d0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    void │ │ │ │ +00174800: 3c2f 7370 616e 3e20 2a70 726f 6365 7373 *process │ │ │ │ +00174810: 5f72 6571 7565 7374 283c 7370 616e 2063 _request(void * │ │ │ │ +00174840: 7473 6f61 7029 203c 2f64 6976 3e0a 3c64 tsoap)
    . │ │ │ │ +00174860: 7b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 {
    .
    struct │ │ │ │ +001748a0: 2a3c 6120 636c 6173 733d 2263 6f64 6522 *soap │ │ │ │ +001748d0: 203d 2028 3c73 7061 6e20 636c 6173 733d = (struct │ │ │ │ +001748f0: 203c 2f73 7061 6e3e 3c61 2063 6c61 7373 s │ │ │ │ +00174920: 6f61 703c 2f61 3e2a 2974 736f 6170 3b3c oap*)tsoap;< │ │ │ │ +00174930: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.. │ │ │ │ +00174a30: 2028 283c 7370 616e 2063 6c61 7373 3d22 ((struct │ │ │ │ +00174a50: 3c2f 7370 616e 3e3c 6120 636c 6173 733d so │ │ │ │ +00174a80: 6170 3c2f 613e 2a29 3c61 2063 6c61 7373 ap*)s │ │ │ │ +00174ab0: 6f61 703c 2f61 3e29 2d26 6774 3b72 6563 oap)->rec │ │ │ │ +00174ac0: 765f 7469 6d65 6f75 7420 3d20 3630 3b20 v_timeout = 60; │ │ │ │ +00174ad0: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // Timeout │ │ │ │ +00174af0: 2061 6674 6572 2031 206d 696e 7574 6520 after 1 minute │ │ │ │ +00174b00: 7374 616c 6c20 6f6e 2072 6563 7620 3c2f stall on recv
    .
    │ │ │ │ +00174b30: 2828 3c73 7061 6e20 636c 6173 733d 226b ((struct < │ │ │ │ +00174b50: 2f73 7061 6e3e 3c61 2063 6c61 7373 3d22 /span>soa │ │ │ │ +00174b80: 703c 2f61 3e2a 293c 6120 636c 6173 733d p*)so │ │ │ │ +00174bb0: 6170 3c2f 613e 292d 2667 743b 7365 6e64 ap)->send │ │ │ │ +00174bc0: 5f74 696d 656f 7574 203d 2031 303b 203c _timeout = 10; < │ │ │ │ +00174bd0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ +00174be0: 656e 7422 3e2f 2f20 5469 6d65 6f75 7420 ent">// Timeout │ │ │ │ +00174bf0: 6166 7465 7220 3130 2073 6563 6f6e 6420 after 10 second │ │ │ │ +00174c00: 7374 616c 6c20 6f6e 2073 656e 6420 3c2f stall on send
    .
    │ │ │ │ +00174c30: 3c61 2063 6c61 7373 3d22 636f 6465 2220 │ │ │ │ +00174c80: 736f 6170 5f73 6572 7665 3c2f 613e 283c soap_serve(< │ │ │ │ +00174c90: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +00174ca0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ +00174cb0: 6874 6d6c 223e 736f 6170 3c2f 613e 293b html">soap); │ │ │ │ +00174cc0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    ..
    < │ │ │ │ +00174d90: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +00174da0: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ │ +00174db0: 705f 5f63 6f6e 7465 7874 2e68 746d 6c23 p__context.html# │ │ │ │ +00174dc0: 6761 3831 6130 3039 6165 3165 6138 3235 ga81a009ae1ea825 │ │ │ │ +00174dd0: 6130 3565 3532 3431 6532 6237 6138 6563 a05e5241e2b7a8ec │ │ │ │ +00174de0: 6539 223e 736f 6170 5f65 6e64 3c2f 613e e9">soap_end │ │ │ │ +00174df0: 283c 6120 636c 6173 733d 2263 6f64 6522 (soap │ │ │ │ +00174e20: 293b 203c 2f64 6976 3e0a 3c64 6976 2063 );
    .
    soap_free │ │ │ │ +00174ea0: 283c 6120 636c 6173 733d 2263 6f64 6522 (soap │ │ │ │ +00174ed0: 293b 203c 2f64 6976 3e0a 3c64 6976 2063 );
    .
    return NULL; .
    }
    .
    U │ │ │ │ +00175000: 4c4f 4e47 3634 2063 6f75 6e74 3c2f 6469 LONG64 count
    Message len │ │ │ │ +00175030: 6774 6820 636f 756e 7465 7220 7661 6c75 gth counter valu │ │ │ │ +00175040: 6520 6f66 2074 6865 206d 6573 7361 6765 e of the message │ │ │ │ +00175050: 2072 6563 6569 7665 6420 616e 6420 636f received and co │ │ │ │ +00175060: 756e 7465 7220 7661 6c75 6520 6f66 2074 unter value of t │ │ │ │ +00175070: 6865 2048 5454 5020 636f 6e74 656e 7420 he HTTP content │ │ │ │ +00175080: 6c65 6e67 7468 2068 6561 2e2e 2e3c 2f64 length hea...
    Definit │ │ │ │ +001750b0: 696f 6e3a 3c2f 623e 2073 7464 736f 6170 ion: stdsoap │ │ │ │ +001750c0: 322e 683a 3432 3034 3c2f 6469 763e 3c2f 2.h:4204
    .
    in │ │ │ │ +001751a0: 7420 6163 6365 7074 5f66 6c61 6773 3c2f t accept_flags
    User-defi │ │ │ │ +001751d0: 6e61 626c 6520 7365 7473 6f63 6b6f 7074 nable setsockopt │ │ │ │ +001751e0: 206c 6576 656c 2053 4f4c 5f53 4f43 4b45 level SOL_SOCKE │ │ │ │ +001751f0: 5420 666c 6167 7320 2830 2062 7920 6465 T flags (0 by de │ │ │ │ +00175200: 6661 756c 7429 2c20 7768 656e 206e 6f6e fault), when non │ │ │ │ +00175210: 7a65 726f 2073 6574 7320 7468 6520 736f zero sets the so │ │ │ │ +00175220: 6170 3a3a 736f 636b 6574 2066 2e2e 2e3c ap::socket f...< │ │ │ │ +00175230: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
    Defin │ │ │ │ +00175250: 6974 696f 6e3a 3c2f 623e 2073 7464 736f ition: stdso │ │ │ │ +00175260: 6170 322e 683a 3334 3533 3c2f 6469 763e ap2.h:3453
    │ │ │ │ +00175270: 3c2f 6469 763e 0a3c 2f64 6976 3e3c 212d
    .

    A client call w │ │ │ │ +001752a0: 696c 6c20 6175 746f 6d61 7469 6361 6c6c ill automaticall │ │ │ │ +001752b0: 7920 6174 7465 6d70 7420 746f 2072 652d y attempt to re- │ │ │ │ +001752c0: 6573 7461 626c 6973 6820 6120 636f 6e6e establish a conn │ │ │ │ +001752d0: 6563 7469 6f6e 2074 6f20 6120 7365 7276 ection to a serv │ │ │ │ +001752e0: 6572 2077 6865 6e20 7468 6520 7365 7276 er when the serv │ │ │ │ +001752f0: 6572 2068 6173 2074 6572 6d69 6e61 7465 er has terminate │ │ │ │ +00175300: 6420 7468 6520 636f 6e6e 6563 7469 6f6e d the connection │ │ │ │ +00175310: 2066 6f72 2061 6e79 2072 6561 736f 6e2e for any reason. │ │ │ │ +00175320: 2054 6869 7320 7761 792c 2061 2073 6571 This way, a seq │ │ │ │ +00175330: 7565 6e63 6520 6f66 2063 616c 6c73 2063 uence of calls c │ │ │ │ +00175340: 616e 2062 6520 6d61 6465 2074 6f20 7468 an be made to th │ │ │ │ +00175350: 6520 7365 7276 6572 2077 6869 6c65 206b e server while k │ │ │ │ +00175360: 6565 7069 6e67 2074 6865 2063 6f6e 6e65 eeping the conne │ │ │ │ +00175370: 6374 696f 6e20 6f70 656e 2e20 436c 6965 ction open. Clie │ │ │ │ +00175380: 6e74 2073 7475 6220 6675 6e63 7469 6f6e nt stub function │ │ │ │ +00175390: 7320 706f 6c6c 2074 6865 2073 6572 7665 s poll the serve │ │ │ │ +001753a0: 7220 746f 2063 6865 636b 2069 6620 7468 r to check if th │ │ │ │ +001753b0: 6520 636f 6e6e 6563 7469 6f6e 2069 7320 e connection is │ │ │ │ +001753c0: 7374 696c 6c20 6f70 656e 2e20 5768 656e still open. When │ │ │ │ +001753d0: 2074 6865 2063 6f6e 6e65 6374 696f 6e20 the connection │ │ │ │ +001753e0: 7761 7320 7465 726d 696e 6174 6564 2062 was terminated b │ │ │ │ +001753f0: 7920 7468 6520 7365 7276 6572 2c20 7468 y the server, th │ │ │ │ +00175400: 6520 636c 6965 6e74 2077 696c 6c20 6175 e client will au │ │ │ │ +00175410: 746f 6d61 7469 6361 6c6c 7920 7265 636f tomatically reco │ │ │ │ +00175420: 6e6e 6563 742e 203c 6272 2020 2f3e 0a3c nnect.
    .< │ │ │ │ +00175430: 2f70 3e0a 3c70 3e41 2063 6c69 656e 7420 /p>.

    A client │ │ │ │ +00175440: 6d61 7920 636c 6561 7220 7468 6520 3c63 may clear the #SOAP_IO_KEE │ │ │ │ +00175460: 5041 4c49 5645 3c2f 636f 6465 3e20 666c PALIVE fl │ │ │ │ +00175470: 6167 206a 7573 7420 6265 666f 7265 2074 ag just before t │ │ │ │ +00175480: 6865 206c 6173 7420 6361 6c6c 2074 6f20 he last call to │ │ │ │ +00175490: 6120 7365 7276 6572 2074 6f20 6c65 7420 a server to let │ │ │ │ +001754a0: 7468 6520 7365 7276 6572 206b 6e6f 7720 the server know │ │ │ │ +001754b0: 6974 2077 616e 7473 2074 6f20 636c 6f73 it wants to clos │ │ │ │ +001754c0: 6520 7468 6520 636f 6e6e 6563 7469 6f6e e the connection │ │ │ │ +001754d0: 2061 6674 6572 2074 6869 7320 6c61 7374 after this last │ │ │ │ +001754e0: 2063 616c 6c2e 2054 6869 7320 7769 6c6c call. This will │ │ │ │ +001754f0: 2063 6c6f 7365 2074 6865 2073 6f63 6b65 close the socke │ │ │ │ +00175500: 7420 6166 7465 7220 7468 6520 6361 6c6c t after the call │ │ │ │ +00175510: 2061 6e64 2061 6c73 6f20 696e 666f 726d and also inform │ │ │ │ +00175520: 7320 7468 6520 7365 7276 6572 2074 6f20 s the server to │ │ │ │ +00175530: 6772 6163 6566 756c 6c79 2063 6c6f 7365 gracefully close │ │ │ │ +00175540: 2074 6865 2063 6f6e 6e65 6374 696f 6e2e the connection. │ │ │ │ +00175550: 3c2f 703e 0a3c 703e 5468 6520 636c 6965

    .

    The clie │ │ │ │ +00175560: 6e74 2d73 6964 6520 6361 6e20 616c 736f nt-side can also │ │ │ │ +00175570: 2073 6574 2074 6865 2054 4350 206b 6565 set the TCP kee │ │ │ │ +00175580: 702d 616c 6976 6520 736f 636b 6574 2070 p-alive socket p │ │ │ │ +00175590: 726f 7065 7274 6965 732c 2075 7369 6e67 roperties, using │ │ │ │ +001755a0: 2074 6865 203c 636f 6465 3e3c 6120 636c the soap::tcp_kee │ │ │ │ +00175670: 705f 616c 6976 653c 2f61 3e3c 2f63 6f64 p_alive flag (set to │ │ │ │ +00175690: 3120 746f 2065 6e61 626c 6529 2c20 3c63 1 to enable), soap::tcp_kee │ │ │ │ +00175750: 705f 6964 6c65 3c2f 613e 3c2f 636f 6465 p_idle to set the TCP_KEEPIDLE< │ │ │ │ +00175780: 2f63 6f64 653e 2076 616c 7565 2c20 3c63 /code> value, soap::tcp_ke │ │ │ │ +00175840: 6570 5f69 6e74 766c 3c2f 613e 3c2f 636f ep_intvl to set the < │ │ │ │ +00175860: 636f 6465 3e54 4350 5f4b 4545 5049 4e54 code>TCP_KEEPINT │ │ │ │ +00175870: 564c 3c2f 636f 6465 3e20 7661 6c75 652c VL value, │ │ │ │ +00175880: 2061 6e64 203c 636f 6465 3e3c 6120 636c and soap::t │ │ │ │ +00175930: 6370 5f6b 6565 705f 636e 743c 2f61 3e3c cp_keep_cnt< │ │ │ │ +00175940: 2f63 6f64 653e 2074 6f20 7365 7420 7468 /code> to set th │ │ │ │ +00175950: 6520 3c63 6f64 653e 5443 505f 4b45 4550 e TCP_KEEP │ │ │ │ +00175960: 434e 543c 2f63 6f64 653e 2076 616c 7565 CNT value │ │ │ │ +00175970: 2e3c 2f70 3e0a 3c70 3e49 6620 6120 636c .

    .

    If a cl │ │ │ │ +00175980: 6965 6e74 2069 7320 696e 2074 6865 206d ient is in the m │ │ │ │ +00175990: 6964 646c 6520 6f66 2073 6f61 7020 6361 iddle of soap ca │ │ │ │ +001759a0: 6c6c 2074 6861 7420 6d69 6768 7420 7461 ll that might ta │ │ │ │ +001759b0: 6b65 2061 206c 6f6e 6720 7469 6d65 2061 ke a long time a │ │ │ │ +001759c0: 6e64 2074 6865 2073 6572 7665 7220 676f nd the server go │ │ │ │ +001759d0: 6573 2061 7761 792f 646f 776e 2074 6865 es away/down the │ │ │ │ +001759e0: 2063 616c 6c65 7220 646f 6573 206e 6f74 caller does not │ │ │ │ +001759f0: 2067 6574 2061 6e79 2066 6565 6462 6163 get any feedbac │ │ │ │ +00175a00: 6b20 756e 7469 6c20 7468 6520 3c63 6f64 k until the soa │ │ │ │ +00175ac0: 703a 3a72 6563 765f 7469 6d65 6f75 743c p::recv_timeout< │ │ │ │ +00175ad0: 2f61 3e3c 2f63 6f64 653e 2069 7320 7265 /a> is re │ │ │ │ +00175ae0: 6163 6865 642e 2045 6e61 626c 696e 6720 ached. Enabling │ │ │ │ +00175af0: 5443 5020 6b65 6570 2061 6c69 7665 206f TCP keep alive o │ │ │ │ +00175b00: 6e20 7379 7374 656d 7320 7468 6174 2073 n systems that s │ │ │ │ +00175b10: 7570 706f 7274 2069 7420 616c 6c6f 7773 upport it allows │ │ │ │ +00175b20: 2066 6f72 2061 2066 6173 7465 7220 636f for a faster co │ │ │ │ +00175b30: 6e6e 6563 7469 6f6e 2074 6561 7264 6f77 nnection teardow │ │ │ │ +00175b40: 6e20 6465 7465 6374 696f 6e20 666f 7220 n detection for │ │ │ │ +00175b50: 6170 706c 6963 6174 696f 6e73 2074 6861 applications tha │ │ │ │ +00175b60: 7420 6e65 6564 2069 742e 3c2f 703e 0a3c t need it.

    .< │ │ │ │ +00175b70: 703e f09f 949d 203c 6120 6872 6566 3d22 p>.... Back to table │ │ │ │ +00175b90: 206f 6620 636f 6e74 656e 7473 3c2f 613e of contents │ │ │ │ +00175ba0: 3c2f 703e 0a3c 6832 3e3c 6120 636c 6173

    .

    .HTT │ │ │ │ +00175bd0: 5020 6368 756e 6b65 6420 7472 616e 7366 P chunked transf │ │ │ │ +00175be0: 6572 2065 6e63 6f64 696e 673c 2f68 323e er encoding

    │ │ │ │ +00175bf0: 0a3c 703e 4f75 7462 6f75 6e64 2048 5454 .

    Outbound HTT │ │ │ │ +00175c00: 5020 6d65 7373 6167 6573 2061 7265 206e P messages are n │ │ │ │ +00175c10: 6f74 2063 6875 6e6b 6564 2075 6e6c 6573 ot chunked unles │ │ │ │ +00175c20: 7320 7468 6520 3c63 6f64 653e 2353 4f41 s the #SOA │ │ │ │ +00175c30: 505f 494f 5f43 4855 4e4b 3c2f 636f 6465 P_IO_CHUNK flag is enable │ │ │ │ +00175c50: 642e 2043 6875 6e6b 696e 6720 6d61 7920 d. Chunking may │ │ │ │ +00175c60: 696d 7072 6f76 6520 7468 6520 7370 6565 improve the spee │ │ │ │ +00175c70: 6420 6f66 206d 6573 7361 6765 2073 656e d of message sen │ │ │ │ +00175c80: 6469 6e67 2077 6974 6820 4854 5450 2c20 ding with HTTP, │ │ │ │ +00175c90: 6265 6361 7573 6520 7468 6520 6d65 7373 because the mess │ │ │ │ +00175ca0: 6167 6520 6c65 6e67 7468 2064 6f65 7320 age length does │ │ │ │ +00175cb0: 6e6f 7420 6e65 6564 2074 6f20 6265 2064 not need to be d │ │ │ │ +00175cc0: 6574 6572 6d69 6e65 6420 696e 2061 6476 etermined in adv │ │ │ │ +00175cd0: 616e 6365 2066 6f72 2074 6865 2048 5454 ance for the HTT │ │ │ │ +00175ce0: 5020 636f 6e74 656e 7420 6c65 6e67 7468 P content length │ │ │ │ +00175cf0: 2068 6561 6465 722e 3c2f 703e 0a3c 703e header.

    .

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

    .HTTP │ │ │ │ +00175d60: 2062 7566 6665 7265 6420 7365 6e64 733c buffered sends< │ │ │ │ +00175d70: 2f68 323e 0a3c 703e 5468 6520 656e 7469 /h2>.

    The enti │ │ │ │ +00175d80: 7265 206f 7574 626f 756e 6420 6d65 7373 re outbound mess │ │ │ │ +00175d90: 6167 6520 6361 6e20 6265 2073 746f 7265 age can be store │ │ │ │ +00175da0: 6420 696e 2061 2062 7566 6665 7220 746f d in a buffer to │ │ │ │ +00175db0: 2064 6574 6572 6d69 6e65 2074 6865 2048 determine the H │ │ │ │ +00175dc0: 5454 5020 636f 6e74 656e 7420 6c65 6e67 TTP content leng │ │ │ │ +00175dd0: 7468 2072 6174 6865 7220 7468 616e 2074 th rather than t │ │ │ │ +00175de0: 6865 2074 776f 2d70 6861 7365 2065 6e63 he two-phase enc │ │ │ │ +00175df0: 6f64 696e 6720 7573 6564 2062 7920 6753 oding used by gS │ │ │ │ +00175e00: 4f41 5020 636c 6965 6e74 2d73 6964 6520 OAP client-side │ │ │ │ +00175e10: 7374 7562 2066 756e 6374 696f 6e73 2061 stub functions a │ │ │ │ +00175e20: 6e64 2073 6572 7665 722d 7369 6465 2073 nd server-side s │ │ │ │ +00175e30: 6b65 6c65 746f 6e20 6675 6e63 7469 6f6e keleton function │ │ │ │ +00175e40: 7320 6765 6e65 7261 7465 6420 6279 2073 s generated by s │ │ │ │ +00175e50: 6f61 7063 7070 322c 2077 6869 6368 2070 oapcpp2, which p │ │ │ │ +00175e60: 6572 666f 726d 2061 2073 6570 6172 6174 erform a separat │ │ │ │ +00175e70: 6520 7061 7373 206f 7665 7220 7468 6520 e pass over the │ │ │ │ +00175e80: 6461 7461 2074 6f20 6465 7465 726d 696e data to determin │ │ │ │ +00175e90: 6520 7468 6520 6c65 6e67 7468 206f 6620 e the length of │ │ │ │ +00175ea0: 7468 6520 6f75 7462 6f75 6e64 206d 6573 the outbound mes │ │ │ │ +00175eb0: 7361 6765 2e20 5365 7474 696e 6720 7468 sage. Setting th │ │ │ │ +00175ec0: 6520 666c 6167 203c 636f 6465 3e23 534f e flag #SO │ │ │ │ +00175ed0: 4150 5f49 4f5f 5354 4f52 453c 2f63 6f64 AP_IO_STORE for the outpu │ │ │ │ +00175ef0: 7420 6d6f 6465 2077 696c 6c20 6275 6666 t mode will buff │ │ │ │ +00175f00: 6572 2074 6865 2065 6e74 6972 6520 6d65 er the entire me │ │ │ │ +00175f10: 7373 6167 652e 2054 6869 7320 6d61 7920 ssage. This may │ │ │ │ +00175f20: 6f72 206d 6179 206e 6f74 2073 7065 6564 or may not speed │ │ │ │ +00175f30: 2075 7020 7468 6520 7472 616e 736d 6973 up the transmis │ │ │ │ +00175f40: 7369 6f6e 206f 6620 6d65 7373 6167 6573 sion of messages │ │ │ │ +00175f50: 2c20 6465 7065 6e64 696e 6720 6f6e 2074 , depending on t │ │ │ │ +00175f60: 6865 2063 6f6e 7465 6e74 2c20 6275 7420 he content, but │ │ │ │ +00175f70: 6d61 7920 7265 7175 6972 6520 7369 676e may require sign │ │ │ │ +00175f80: 6966 6963 616e 7420 7374 6f72 6167 6520 ificant storage │ │ │ │ +00175f90: 7370 6163 6520 746f 2068 6f6c 6420 6c61 space to hold la │ │ │ │ +00175fa0: 7267 6520 6d65 7373 6167 6573 2074 656d rge messages tem │ │ │ │ +00175fb0: 706f 7261 7269 6c79 2e3c 2f70 3e0a 3c70 porarily.

    .

    .... Back to table │ │ │ │ +00175fe0: 6f66 2063 6f6e 7465 6e74 733c 2f61 3e3c of contents< │ │ │ │ +00175ff0: 2f70 3e0a 3c68 323e 3c61 2063 6c61 7373 /p>.

    .HTTP authenti │ │ │ │ +00176030: 6361 7469 6f6e 3c2f 6832 3e0a 3c70 3e54 cation

    .

    T │ │ │ │ +00176040: 6865 2066 6f6c 6c6f 7769 6e67 2073 6563 he following sec │ │ │ │ +00176050: 7469 6f6e 7320 6578 706c 6169 6e20 686f tions explain ho │ │ │ │ +00176060: 7720 746f 2061 7574 6865 6e74 6963 6174 w to authenticat │ │ │ │ +00176070: 6520 7769 7468 2048 5454 5020 6265 6172 e with HTTP bear │ │ │ │ +00176080: 6572 2c20 6261 7369 632c 2064 6967 6573 er, basic, diges │ │ │ │ +00176090: 742c 2061 6e64 204e 544c 4d2e 2050 726f t, and NTLM. Pro │ │ │ │ +001760a0: 7879 2061 7574 6865 6e74 6963 6174 696f xy authenticatio │ │ │ │ +001760b0: 6e20 6973 2061 6c73 6f20 636f 7665 7265 n is also covere │ │ │ │ +001760c0: 642e 3c2f 703e 0a3c 703e 596f 7520 636f d.

    .

    You co │ │ │ │ +001760d0: 756c 6420 616c 736f 2075 7365 2074 6865 uld also use the │ │ │ │ +001760e0: 2057 696e 496e 6574 2070 6c75 6769 6e20 WinInet plugin │ │ │ │ +001760f0: 6176 6169 6c61 626c 6520 696e 2074 6865 available in the │ │ │ │ +00176100: 203c 656d 3e3c 636f 6465 3e67 736f 6170 gsoap │ │ │ │ +00176110: 2f6d 6f64 5f67 736f 6170 3c2f 636f 6465 /mod_gsoap directory │ │ │ │ +00176130: 206f 6620 7468 6520 6753 4f41 5020 736f of the gSOAP so │ │ │ │ +00176140: 7572 6365 2063 6f64 6520 7061 636b 6167 urce code packag │ │ │ │ +00176150: 6520 746f 2073 696d 706c 6966 7920 496e e to simplify In │ │ │ │ +00176160: 7465 726e 6574 2061 6363 6573 7320 666f ternet access fo │ │ │ │ +00176170: 7220 6753 4f41 5020 636c 6965 6e74 2061 r gSOAP client a │ │ │ │ +00176180: 7070 6c69 6361 7469 6f6e 7320 616e 6420 pplications and │ │ │ │ +00176190: 6465 616c 2077 6974 6820 656e 6372 7970 deal with encryp │ │ │ │ +001761a0: 7469 6f6e 2c20 7072 6f78 6965 732c 2061 tion, proxies, a │ │ │ │ +001761b0: 6e64 2061 7574 6865 6e74 6963 6174 696f nd authenticatio │ │ │ │ +001761c0: 6e2c 2073 6565 2074 6865 2067 534f 4150 n, see the gSOAP │ │ │ │ +001761d0: 203c 6120 6872 6566 3d22 2e2e 2f2e 2e2f WinInet │ │ │ │ +00176200: 2070 6c75 6769 6e3c 2f61 3e20 646f 6375 plugin docu │ │ │ │ +00176210: 6d65 6e74 6174 696f 6e2e 3c2f 703e 0a3c mentation.

    .< │ │ │ │ +00176220: 703e 5468 6520 6753 4f41 5020 4355 524c p>The gSOAP CURL │ │ │ │ +00176230: 2070 6c75 6769 6e20 6361 6e20 616c 736f plugin can also │ │ │ │ +00176240: 2062 6520 7573 6564 2074 6f20 6465 7665 be used to deve │ │ │ │ +00176250: 6c6f 7020 6753 4f41 5020 636c 6965 6e74 lop gSOAP client │ │ │ │ +00176260: 2061 7070 6c69 6361 7469 6f6e 7320 616e applications an │ │ │ │ +00176270: 6420 4355 524c 2069 6d70 6c65 6d65 6e74 d CURL implement │ │ │ │ +00176280: 7320 7661 7269 6f75 7320 4854 5450 2061 s various HTTP a │ │ │ │ +00176290: 7574 6865 6e74 6963 6174 696f 6e20 6d65 uthentication me │ │ │ │ +001762a0: 7468 6f64 732c 2073 6565 2074 6865 2067 thods, see the g │ │ │ │ +001762b0: 534f 4150 203c 6120 6872 6566 3d22 2e2e SOAP CURL p │ │ │ │ +001762e0: 6c75 6769 6e3c 2f61 3e20 646f 6375 6d65 lugin docume │ │ │ │ +001762f0: 6e74 6174 696f 6e2e 3c2f 703e 0a3c 703e ntation.

    .

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

    .HTTP bea │ │ │ │ +00176370: 7265 7220 6175 7468 656e 7469 6361 7469 rer authenticati │ │ │ │ +00176380: 6f6e 3c2f 6833 3e0a 3c70 3e48 5454 5020 on

    .

    HTTP │ │ │ │ +00176390: 6265 6172 6572 2061 7574 6865 6e74 6963 bearer authentic │ │ │ │ +001763a0: 6174 696f 6e20 6973 2065 6e61 626c 6564 ation is enabled │ │ │ │ +001763b0: 2061 7420 7468 6520 636c 6965 6e74 2d73 at the client-s │ │ │ │ +001763c0: 6964 6520 6279 2073 6574 7469 6e67 2074 ide by setting t │ │ │ │ +001763d0: 6865 203c 636f 6465 3e3c 6120 636c 6173 he soap::bearer string │ │ │ │ +001764b0: 746f 2074 6865 2062 6561 7265 7220 746f to the bearer to │ │ │ │ +001764c0: 6b65 6e3a 3c2f 703e 0a3c 6469 7620 636c ken:

    .
    < │ │ │ │ +001764e0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +001764f0: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >struct soap │ │ │ │ +00176540: 3c2f 613e 202a 3c61 2063 6c61 7373 3d22 *soa │ │ │ │ +00176570: 703c 2f61 3e20 3d20 3c61 2063 6c61 7373 p = soa │ │ │ │ +001765d0: 705f 6e65 773c 2f61 3e28 293b 203c 2f64 p_new(); .
    soa │ │ │ │ +00176620: 703c 2f61 3e2d 2667 743b 3c61 2063 6c61 p->bearer = │ │ │ │ +00176680: 3c73 7061 6e20 636c 6173 733d 2273 7472 &quo │ │ │ │ +001766a0: 743b 2e2e 2e26 7175 6f74 3b3c 2f73 7061 t;...";
    .
    if │ │ │ │ +001766f0: 2028 736f 6170 5f63 616c 6c5f 6e73 5f5f (soap_call_ns__ │ │ │ │ +00176700: 7765 626d 6574 686f 6428 3c61 2063 6c61 webmethod(soap, ...)) │ │ │ │ +00176740: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    ... < │ │ │ │ +00176760: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ +00176770: 656e 7422 3e2f 2f20 6572 726f 723c 2f73 ent">// error
    .
    else
    .
    ... │ │ │ │ +001767e0: 203c 7370 616e 2063 6c61 7373 3d22 636f // OK
    .< │ │ │ │ +001769b0: 212d 2d20 6672 6167 6d65 6e74 202d 2d3e !-- fragment --> │ │ │ │ +001769c0: 3c70 3ef0 9f94 9d20 3c61 2068 7265 663d

    .... Back to tabl │ │ │ │ +001769e0: 6520 6f66 2063 6f6e 7465 6e74 733c 2f61 e of contents

    .

    .HTTP b │ │ │ │ +00176a30: 6173 6963 2061 7574 6865 6e74 6963 6174 asic authenticat │ │ │ │ +00176a40: 696f 6e3c 2f68 333e 0a3c 703e 4854 5450 ion

    .

    HTTP │ │ │ │ +00176a50: 2062 6173 6963 2061 7574 6865 6e74 6963 basic authentic │ │ │ │ +00176a60: 6174 696f 6e20 6973 2065 6e61 626c 6564 ation is enabled │ │ │ │ +00176a70: 2061 7420 7468 6520 636c 6965 6e74 2d73 at the client-s │ │ │ │ +00176a80: 6964 6520 6279 2073 6574 7469 6e67 2074 ide by setting t │ │ │ │ +00176a90: 6865 203c 636f 6465 3e63 6f6e 7374 2063 he const c │ │ │ │ +00176aa0: 6861 722a 203c 6120 636c 6173 733d 2265 har* soa │ │ │ │ +00176b60: 703a 3a75 7365 7269 643c 2f61 3e3c 2f63 p::userid and c │ │ │ │ +00176b80: 6f6e 7374 2063 6861 722a 203c 6120 636c onst char* soap::passwd< │ │ │ │ +00176c50: 2f61 3e3c 2f63 6f64 653e 2073 7472 696e /a> strin │ │ │ │ +00176c60: 6773 2074 6f20 6120 7573 6572 6e61 6d65 gs to a username │ │ │ │ +00176c70: 2061 6e64 2070 6173 7377 6f72 642c 2072 and password, r │ │ │ │ +00176c80: 6573 7065 6374 6976 656c 792e 2041 2073 espectively. A s │ │ │ │ +00176c90: 6572 7665 7220 6d61 7920 7265 7175 6573 erver may reques │ │ │ │ +00176ca0: 7420 7573 6572 2061 7574 6865 6e74 6963 t user authentic │ │ │ │ +00176cb0: 6174 696f 6e20 616e 6420 6465 6e69 6573 ation and denies │ │ │ │ +00176cc0: 2061 6363 6573 7320 2848 5454 5020 3430 access (HTTP 40 │ │ │ │ +00176cd0: 3120 6572 726f 7229 2077 6865 6e20 7468 1 error) when th │ │ │ │ +00176ce0: 6520 636c 6965 6e74 2074 7269 6573 2074 e client tries t │ │ │ │ +00176cf0: 6f20 636f 6e6e 6563 7420 7769 7468 6f75 o connect withou │ │ │ │ +00176d00: 7420 4854 5450 2061 7574 6865 6e74 6963 t HTTP authentic │ │ │ │ +00176d10: 6174 696f 6e20 286f 7220 7769 7468 2074 ation (or with t │ │ │ │ +00176d20: 6865 2077 726f 6e67 2061 7574 6865 6e74 he wrong authent │ │ │ │ +00176d30: 6963 6174 696f 6e20 696e 666f 726d 6174 ication informat │ │ │ │ +00176d40: 696f 6e29 2e3c 2f70 3e0a 3c70 3e42 6173 ion).

    .

    Bas │ │ │ │ +00176d50: 6963 2061 7574 6865 6e74 6963 6174 696f ic authenticatio │ │ │ │ +00176d60: 6e20 7368 6f75 6c64 206f 6e6c 7920 6265 n should only be │ │ │ │ +00176d70: 2075 7365 6420 6f76 6572 2048 5454 5053 used over HTTPS │ │ │ │ +00176d80: 2c20 6265 6361 7573 6520 7468 6520 6372 , because the cr │ │ │ │ +00176d90: 6564 656e 7469 616c 7320 6172 6520 7365 edentials are se │ │ │ │ +00176da0: 6e74 2069 6e20 7468 6520 636c 6561 7220 nt in the clear │ │ │ │ +00176db0: 7769 7468 2048 5454 502e 2053 6565 2053 with HTTP. See S │ │ │ │ +00176dc0: 6563 7469 6f6e 203c 6120 636c 6173 733d ection The HTTP dig │ │ │ │ +00176e00: 6573 7420 6175 7468 656e 7469 6361 7469 est authenticati │ │ │ │ +00176e10: 6f6e 2070 6c75 6769 6e3c 2f61 3e20 746f on plugin to │ │ │ │ +00176e20: 2075 7365 2074 6865 2048 5454 5020 6469 use the HTTP di │ │ │ │ +00176e30: 6765 7374 2070 6c75 6769 6e20 7468 6174 gest plugin that │ │ │ │ +00176e40: 2069 7320 7361 6665 2066 6f72 2061 7574 is safe for aut │ │ │ │ +00176e50: 6865 6e74 6963 6174 696f 6e20 6f76 6572 hentication over │ │ │ │ +00176e60: 2048 5454 502e 3c2f 703e 0a3c 703e 4865 HTTP.

    .

    He │ │ │ │ +00176e70: 7265 2069 7320 616e 2065 7861 6d70 6c65 re is an example │ │ │ │ +00176e80: 2063 6c69 656e 7420 636f 6465 2066 7261 client code fra │ │ │ │ +00176e90: 676d 656e 7420 746f 2073 6574 2074 6865 gment to set the │ │ │ │ +00176ea0: 2048 5454 5020 6175 7468 656e 7469 6361 HTTP authentica │ │ │ │ +00176eb0: 7469 6f6e 2075 7365 726e 616d 6520 616e tion username an │ │ │ │ +00176ec0: 6420 7061 7373 776f 7264 3a3c 2f70 3e0a d password:

    . │ │ │ │ +00176ed0: 3c64 6976 2063 6c61 7373 3d22 6672 6167
    st │ │ │ │ +00176f10: 7275 6374 203c 2f73 7061 6e3e 3c61 2063 ruct soap *soap = < │ │ │ │ +00176f80: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +00176f90: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ │ +00176fa0: 705f 5f63 6f6e 7465 7874 2e68 746d 6c23 p__context.html# │ │ │ │ +00176fb0: 6761 3837 6332 3034 3838 6232 6463 3638 ga87c20488b2dc68 │ │ │ │ +00176fc0: 3061 6161 3736 3839 6231 6430 3234 3938 0aaa7689b1d02498 │ │ │ │ +00176fd0: 3963 223e 736f 6170 5f6e 6577 3c2f 613e 9c">soap_new │ │ │ │ +00176fe0: 2829 3b20 3c2f 6469 763e 0a3c 6469 7620 ();
    .
    soap-> │ │ │ │ +00177030: 3b3c 6120 636c 6173 733d 2263 6f64 6522 ;userid │ │ │ │ +00177080: 3c2f 613e 203d 203c 7370 616e 2063 6c61 = "guest&q │ │ │ │ +001770b0: 756f 743b 3c2f 7370 616e 3e3b 203c 2f64 uot;; .
    soa │ │ │ │ +00177100: 703c 2f61 3e2d 2667 743b 3c61 2063 6c61 p->passwd = │ │ │ │ +00177160: 3c73 7061 6e20 636c 6173 733d 2273 7472 &quo │ │ │ │ +00177180: 743b 7669 7369 7426 7175 6f74 3b3c 2f73 t;visit";
    .< │ │ │ │ +001771b0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +001771c0: 6f72 6466 6c6f 7722 3e69 663c 2f73 7061 ordflow">if (soap_call_ns │ │ │ │ +001771e0: 5f5f 7765 626d 6574 686f 6428 3c61 2063 __webmethod(soap, ... │ │ │ │ +00177220: 2929 3c2f 6469 763e 0a3c 6469 7620 636c ))
    .
    ... │ │ │ │ +00177240: 203c 7370 616e 2063 6c61 7373 3d22 636f // error< │ │ │ │ +00177260: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    .< │ │ │ │ +00177280: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +00177290: 6f72 6466 6c6f 7722 3e65 6c73 653c 2f73 ordflow">else
    .
    . │ │ │ │ +001772c0: 2e2e 203c 7370 616e 2063 6c61 7373 3d22 .. // succ │ │ │ │ +001772e0: 6573 733c 2f73 7061 6e3e 3c2f 6469 763e ess
    │ │ │ │ +001772f0: 0a3c 6469 7620 636c 6173 733d 2274 7463 .
    │ │ │ │ +001773a0: 3c64 6976 2063 6c61 7373 3d22 7474 6465
    const char * │ │ │ │ +001773c0: 2070 6173 7377 643c 2f64 6976 3e3c 6469 passwd
    │ │ │ │ +001773e0: 5573 6572 2d64 6566 696e 6162 6c65 2048 User-definable H │ │ │ │ +001773f0: 5454 5020 616e 6420 4e54 4c4d 2061 7574 TTP and NTLM aut │ │ │ │ +00177400: 686f 7269 7a61 7469 6f6e 2070 6173 7377 horization passw │ │ │ │ +00177410: 6f72 6420 7374 7269 6e67 2072 6571 7569 ord string requi │ │ │ │ +00177420: 7265 6420 666f 7220 4854 5450 2062 6173 red for HTTP bas │ │ │ │ +00177430: 6963 2061 6e64 204e 544c 4d20 6175 7468 ic and NTLM auth │ │ │ │ +00177440: 656e 7469 632e 2e2e 3c2f 6469 763e 3c64 entic...
    Definition:< │ │ │ │ +00177470: 2f62 3e20 7374 6473 6f61 7032 2e68 3a33 /b> stdsoap2.h:3 │ │ │ │ +00177480: 3832 373c 2f64 6976 3e3c 2f64 6976 3e0a 827

    . │ │ │ │ +00177490: 3c64 6976 2063 6c61 7373 3d22 7474 6322
    < │ │ │ │ +00177540: 6469 7620 636c 6173 733d 2274 7464 6563 div class="ttdec │ │ │ │ +00177550: 6922 3e63 6f6e 7374 2063 6861 7220 2a20 i">const char * │ │ │ │ +00177560: 7573 6572 6964 3c2f 6469 763e 3c64 6976 userid
    U │ │ │ │ +00177580: 7365 722d 6465 6669 6e61 626c 6520 4854 ser-definable HT │ │ │ │ +00177590: 5450 2061 6e64 204e 544c 4d20 6175 7468 TP and NTLM auth │ │ │ │ +001775a0: 6f72 697a 6174 696f 6e20 7573 6572 2069 orization user i │ │ │ │ +001775b0: 6420 7374 7269 6e67 2066 6f72 2048 5454 d string for HTT │ │ │ │ +001775c0: 5020 6261 7369 6320 616e 6420 4e54 4c4d P basic and NTLM │ │ │ │ +001775d0: 2061 7574 6865 6e74 6963 6174 696f 6e20 authentication │ │ │ │ +001775e0: 6279 2074 2e2e 2e3c 2f64 6976 3e3c 6469 by t...
    │ │ │ │ +00177600: 3c62 3e44 6566 696e 6974 696f 6e3a 3c2f Definition: stdsoap2.h:38 │ │ │ │ +00177620: 3232 3c2f 6469 763e 3c2f 6469 763e 0a3c 22
    .< │ │ │ │ +00177630: 2f64 6976 3e3c 212d 2d20 6672 6167 6d65 /div>

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

    PO
    │ │ │ │ +001776a0: 5354 202f 5858 5820 4854 5450 2f31 2e31  ST /XXX HTTP/1.1
    │ │ │ │ +001776b0: 200a 486f 7374 3a20 5959 5920 0a55 7365   .Host: YYY .Use
    │ │ │ │ +001776c0: 722d 4167 656e 743a 2067 534f 4150 2f32  r-Agent: gSOAP/2
    │ │ │ │ +001776d0: 2e38 200a 436f 6e74 656e 742d 5479 7065  .8 .Content-Type
    │ │ │ │ +001776e0: 3a20 7465 7874 2f78 6d6c 3b20 6368 6172  : text/xml; char
    │ │ │ │ +001776f0: 7365 743d 7574 662d 3820 0a43 6f6e 7465  set=utf-8 .Conte
    │ │ │ │ +00177700: 6e74 2d4c 656e 6774 683a 205a 5a5a 200a  nt-Length: ZZZ .
    │ │ │ │ +00177710: 4175 7468 6f72 697a 6174 696f 6e3a 2042  Authorization: B
    │ │ │ │ +00177720: 6173 6963 205a 3356 6c63 3351 365a 3356  asic Z3Vlc3Q6Z3V
    │ │ │ │ +00177730: 6c63 3351 3d20 0a3c 2f70 7265 3e3c 703e  lc3Q= .

    │ │ │ │ +00177740: 2041 2063 6c69 656e 7420 6d75 7374 2073 A client must s │ │ │ │ +00177750: 6574 2074 6865 203c 636f 6465 3e63 6f6e et the con │ │ │ │ +00177760: 7374 2063 6861 722a 203c 6120 636c 6173 st char* soap::userid and const char* < │ │ │ │ +00177850: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ +00177860: 663d 2273 7472 7563 7473 6f61 702e 6874 f="structsoap.ht │ │ │ │ +00177870: 6d6c 2361 3232 6432 3139 6339 3866 3066 ml#a22d219c98f0f │ │ │ │ +00177880: 6366 3435 3636 3431 3237 3763 6336 3431 cf456641277cc641 │ │ │ │ +00177890: 3734 6133 2220 7469 746c 653d 2255 7365 74a3" title="Use │ │ │ │ +001778a0: 722d 6465 6669 6e61 626c 6520 4854 5450 r-definable HTTP │ │ │ │ +001778b0: 2061 6e64 204e 544c 4d20 6175 7468 6f72 and NTLM author │ │ │ │ +001778c0: 697a 6174 696f 6e20 7061 7373 776f 7264 ization password │ │ │ │ +001778d0: 2073 7472 696e 6720 7265 7175 6972 6564 string required │ │ │ │ +001778e0: 2066 6f72 2048 5454 5020 6261 7369 6320 for HTTP basic │ │ │ │ +001778f0: 616e 6420 4e54 4c4d 2061 7574 6865 6e74 and NTLM authent │ │ │ │ +00177900: 6963 2e2e 2e22 3e73 6f61 703a 3a70 6173 ic...">soap::pas │ │ │ │ +00177910: 7377 643c 2f61 3e3c 2f63 6f64 653e 2073 swd s │ │ │ │ +00177920: 7472 696e 6773 2066 6f72 2065 6163 6820 trings for each │ │ │ │ +00177930: 6361 6c6c 2074 6861 7420 7265 7175 6972 call that requir │ │ │ │ +00177940: 6573 2063 6c69 656e 7420 6175 7468 656e es client authen │ │ │ │ +00177950: 7469 6361 7469 6f6e 2e20 5468 6520 7374 tication. The st │ │ │ │ +00177960: 7269 6e67 7320 6172 6520 7265 7365 7420 rings are reset │ │ │ │ +00177970: 6166 7465 7220 6561 6368 2073 7563 6365 after each succe │ │ │ │ +00177980: 7373 6675 6c20 6f72 2075 6e73 7563 6365 ssful or unsucce │ │ │ │ +00177990: 7373 6675 6c20 6361 6c6c 2e3c 2f70 3e0a ssful call.

    . │ │ │ │ +001779a0: 3c70 3e57 6865 6e20 7072 6573 656e 742c

    When present, │ │ │ │ +001779b0: 2074 6865 203c 636f 6465 3e57 5757 2d41 the WWW-A │ │ │ │ +001779c0: 7574 6865 6e74 6963 6174 653c 2f63 6f64 uthenticate HTTP header r │ │ │ │ +001779e0: 6574 7572 6e65 6420 6279 2074 6865 2073 eturned by the s │ │ │ │ +001779f0: 6572 7665 7220 7769 7468 2074 6865 2061 erver with the a │ │ │ │ +00177a00: 7574 6865 6e74 6963 6174 696f 6e20 7265 uthentication re │ │ │ │ +00177a10: 616c 6d20 6973 2073 746f 7265 6420 696e alm is stored in │ │ │ │ +00177a20: 2074 6865 2074 6865 203c 636f 6465 3e3c the the < │ │ │ │ +00177a30: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ +00177a40: 663d 2273 7472 7563 7473 6f61 702e 6874 f="structsoap.ht │ │ │ │ +00177a50: 6d6c 2361 3864 6265 3537 6435 3966 3638 ml#a8dbe57d59f68 │ │ │ │ +00177a60: 3364 3939 3330 3561 3434 6234 6437 3933 3d99305a44b4d793 │ │ │ │ +00177a70: 3962 6664 2220 7469 746c 653d 2254 6865 9bfd" title="The │ │ │ │ +00177a80: 2048 5454 5020 616e 6420 4e54 4c4d 2061 HTTP and NTLM a │ │ │ │ +00177a90: 7574 686f 7269 7a61 7469 6f6e 2072 6561 uthorization rea │ │ │ │ +00177aa0: 6c6d 2f64 6f6d 6169 6e20 7374 7269 6e67 lm/domain string │ │ │ │ +00177ab0: 2072 6563 6569 7665 6420 6279 2074 6865 received by the │ │ │ │ +00177ac0: 2063 6c69 656e 7420 7769 7468 2074 6865 client with the │ │ │ │ +00177ad0: 2057 5757 2d41 7574 6865 6e74 6963 6174 WWW-Authenticat │ │ │ │ +00177ae0: 6520 2e2e 2e22 3e73 6f61 703a 3a61 7574 e ...">soap::aut │ │ │ │ +00177af0: 6872 6561 6c6d 3c2f 613e 3c2f 636f 6465 hrealm string. This i │ │ │ │ +00177b10: 7320 7573 6566 756c 2066 6f72 2063 6c69 s useful for cli │ │ │ │ +00177b20: 656e 7473 2074 6f20 7573 6520 7468 6973 ents to use this │ │ │ │ +00177b30: 2064 6f6d 6169 6e20 696e 666f 726d 6174 domain informat │ │ │ │ +00177b40: 696f 6e20 746f 2072 6573 706f 6e64 2074 ion to respond t │ │ │ │ +00177b50: 6f20 6175 7468 656e 7469 6361 7469 6f6e o authentication │ │ │ │ +00177b60: 2072 6571 7565 7374 732e 3c2f 703e 0a3c requests.

    .< │ │ │ │ +00177b70: 703e 4120 7374 616e 642d 616c 6f6e 6520 p>A stand-alone │ │ │ │ +00177b80: 6753 4f41 5020 5765 6220 5365 7276 6963 gSOAP Web Servic │ │ │ │ +00177b90: 6520 6170 706c 6963 6174 696f 6e20 6361 e application ca │ │ │ │ +00177ba0: 6e20 656e 666f 7263 6520 4854 5450 2061 n enforce HTTP a │ │ │ │ +00177bb0: 7574 6865 6e74 6963 6174 696f 6e20 6f6e uthentication on │ │ │ │ +00177bc0: 2063 6c69 656e 7473 2062 7920 6368 6563 clients by chec │ │ │ │ +00177bd0: 6b69 6e67 2074 6865 203c 636f 6465 3e63 king the c │ │ │ │ +00177be0: 6f6e 7374 2063 6861 722a 203c 6120 636c onst char* soap::userid< │ │ │ │ +00177cb0: 2f61 3e3c 2f63 6f64 653e 2061 6e64 203c /a> and < │ │ │ │ +00177cc0: 636f 6465 3e63 6f6e 7374 2063 6861 722a code>const char* │ │ │ │ +00177cd0: 203c 6120 636c 6173 733d 2265 6c22 2068 soap::p │ │ │ │ +00177d90: 6173 7377 643c 2f61 3e3c 2f63 6f64 653e asswd │ │ │ │ +00177da0: 2073 7472 696e 6773 2e20 5468 6573 6520 strings. These │ │ │ │ +00177db0: 7374 7269 6e67 7320 6172 6520 7365 7420 strings are set │ │ │ │ +00177dc0: 7768 656e 2061 2063 6c69 656e 7420 7265 when a client re │ │ │ │ +00177dd0: 7175 6573 7420 636f 6e74 6169 6e73 2048 quest contains H │ │ │ │ +00177de0: 5454 5020 6175 7468 656e 7469 6361 7469 TTP authenticati │ │ │ │ +00177df0: 6f6e 2068 6561 6465 7273 2e20 5468 6520 on headers. The │ │ │ │ +00177e00: 7374 7269 6e67 7320 7368 6f75 6c64 2062 strings should b │ │ │ │ +00177e10: 6520 6368 6563 6b65 6420 696e 2065 6163 e checked in eac │ │ │ │ +00177e20: 6820 7365 7276 6963 6520 6d65 7468 6f64 h service method │ │ │ │ +00177e30: 2028 7468 6174 2072 6571 7569 7265 7320 (that requires │ │ │ │ +00177e40: 6175 7468 656e 7469 6361 7469 6f6e 2074 authentication t │ │ │ │ +00177e50: 6f20 6578 6563 7574 6529 2e3c 2f70 3e0a o execute).

    . │ │ │ │ +00177e60: 3c70 3e48 6572 6520 6973 2061 6e20 6578

    Here is an ex │ │ │ │ +00177e70: 616d 706c 6520 7365 7276 6963 6520 6d65 ample service me │ │ │ │ +00177e80: 7468 6f64 2069 6d70 6c65 6d65 6e74 6174 thod implementat │ │ │ │ +00177e90: 696f 6e20 7468 6174 2065 6e66 6f72 6365 ion that enforce │ │ │ │ +00177ea0: 6420 636c 6965 6e74 2061 7574 6865 6e74 d client authent │ │ │ │ +00177eb0: 6963 6174 696f 6e3a 3c2f 703e 0a3c 6469 ication:

    .
    i │ │ │ │ +00177f00: 6e74 3c2f 7370 616e 3e20 6e73 5f5f 7765 nt ns__we │ │ │ │ +00177f10: 626d 6574 686f 6428 3c73 7061 6e20 636c bmethod(st │ │ │ │ +00177f30: 7275 6374 3c2f 7370 616e 3e20 3c61 2063 ruct soap *soap, .. │ │ │ │ +00177fa0: 2e29 203c 2f64 6976 3e0a 3c64 6976 2063 .)
    .
    {.
    if (!soap-&g │ │ │ │ +00178030: 743b 3c61 2063 6c61 7373 3d22 636f 6465 t;useri │ │ │ │ +00178080: 643c 2f61 3e3c 2f64 6976 3e0a 3c64 6976 d
    .
    │ │ │ │ +001780a0: 207c 7c20 213c 6120 636c 6173 733d 2263 || !soap │ │ │ │ +001780d0: 3c2f 613e 2d26 6774 3b3c 6120 636c 6173 ->passwd.
    || strcm │ │ │ │ +00178150: 7028 3c61 2063 6c61 7373 3d22 636f 6465 p(soap->u │ │ │ │ +001781d0: 7365 7269 643c 2f61 3e2c 203c 7370 616e serid, "gue │ │ │ │ +00178200: 7374 2671 756f 743b 3c2f 7370 616e 3e29 st") │ │ │ │ +00178210: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    || s │ │ │ │ +00178230: 7472 636d 7028 3c61 2063 6c61 7373 3d22 trcmp(soa │ │ │ │ +00178260: 703c 2f61 3e2d 2667 743b 3c61 2063 6c61 p->passwd, < │ │ │ │ +001782c0: 7370 616e 2063 6c61 7373 3d22 7374 7269 span class="stri │ │ │ │ +001782d0: 6e67 6c69 7465 7261 6c22 3e26 7175 6f74 ngliteral">" │ │ │ │ +001782e0: 3b76 6973 6974 2671 756f 743b 3c2f 7370 ;visit"))
    . │ │ │ │ +00178310: 207b 3c2f 6469 763e 0a3c 6469 7620 636c {
    .
    < │ │ │ │ +00178330: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +00178340: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ +00178350: 6874 6d6c 223e 736f 6170 3c2f 613e 2d26 html">soap-& │ │ │ │ +00178360: 6774 3b3c 6120 636c 6173 733d 2263 6f64 gt;auth │ │ │ │ +001783b0: 7265 616c 6d3c 2f61 3e20 3d20 3c73 7061 realm = ".. │ │ │ │ +001783e0: 2e26 7175 6f74 3b3c 2f73 7061 6e3e 3b20 ."; │ │ │ │ +001783f0: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // domain │ │ │ │ +00178410: 7265 616c 6d20 6163 6365 7373 6564 2028 realm accessed ( │ │ │ │ +00178420: 6f70 7469 6f6e 616c 2c20 4e55 4c4c 2074 optional, NULL t │ │ │ │ +00178430: 6f20 6f6d 6974 293c 2f73 7061 6e3e 3c2f o omit).
    return 401;
    .< │ │ │ │ +00178490: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +001784a0: 3e20 207d 3c2f 6469 763e 0a3c 6469 7620 > }
    .
    . │ │ │ │ +001784c0: 2e2e 203c 7370 616e 2063 6c61 7373 3d22 .. // webm │ │ │ │ +001784e0: 6574 686f 6420 6c6f 6769 633c 2f73 7061 ethod logic
    ..

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

    .HTTP NTLM │ │ │ │ +00178a10: 6175 7468 656e 7469 6361 7469 6f6e 3c2f authentication.

    HTTP NTLM │ │ │ │ +00178a30: 2061 7574 6865 6e74 6963 6174 696f 6e20 authentication │ │ │ │ +00178a40: 6973 2065 6e61 626c 6564 2061 7420 7468 is enabled at th │ │ │ │ +00178a50: 6520 636c 6965 6e74 2d73 6964 6520 6279 e client-side by │ │ │ │ +00178a60: 2069 6e73 7461 6c6c 696e 6720 3c63 6f64 installing libntlm │ │ │ │ +00178a80: 2066 726f 6d20 3c61 2068 7265 663d 2268 from ht │ │ │ │ +00178ab0: 7470 3a2f 2f77 7777 2e6e 6f6e 676e 752e tp://www.nongnu. │ │ │ │ +00178ac0: 6f72 672f 6c69 626e 746c 6d3c 2f61 3e20 org/libntlm │ │ │ │ +00178ad0: 616e 6420 636f 6d70 696c 696e 6720 616c and compiling al │ │ │ │ +00178ae0: 6c20 7072 6f6a 6563 7420 736f 7572 6365 l project source │ │ │ │ +00178af0: 2063 6f64 6573 2077 6974 6820 7468 6520 codes with the │ │ │ │ +00178b00: 636f 6d70 696c 652d 7469 6d65 2066 6c61 compile-time fla │ │ │ │ +00178b10: 6720 3c63 6f64 653e 2357 4954 485f 4e54 g #WITH_NT │ │ │ │ +00178b20: 4c4d 3c2f 636f 6465 3e2e 3c2f 703e 0a3c LM.

    .< │ │ │ │ +00178b30: 703e 496e 2079 6f75 7220 6170 706c 6963 p>In your applic │ │ │ │ +00178b40: 6174 696f 6e20 636f 6465 2073 6574 2074 ation code set t │ │ │ │ +00178b50: 6865 203c 636f 6465 3e63 6f6e 7374 2063 he const c │ │ │ │ +00178b60: 6861 722a 203c 6120 636c 6173 733d 2265 har* soa │ │ │ │ +00178c20: 703a 3a75 7365 7269 643c 2f61 3e3c 2f63 p::userid and c │ │ │ │ +00178c40: 6f6e 7374 2063 6861 722a 203c 6120 636c onst char* soap::passwd< │ │ │ │ +00178d10: 2f61 3e3c 2f63 6f64 653e 2073 7472 696e /a> strin │ │ │ │ +00178d20: 6773 2074 6f20 6120 7573 6572 6e61 6d65 gs to a username │ │ │ │ +00178d30: 2061 6e64 2070 6173 7377 6f72 642e 2041 and password. A │ │ │ │ +00178d40: 2073 6572 7665 7220 6d61 7920 7265 7175 server may requ │ │ │ │ +00178d50: 6573 7420 4e54 4c4d 2061 7574 6865 6e74 est NTLM authent │ │ │ │ +00178d60: 6963 6174 696f 6e20 616e 6420 6465 6e69 ication and deni │ │ │ │ +00178d70: 6573 2061 6363 6573 7320 2848 5454 5020 es access (HTTP │ │ │ │ +00178d80: 3430 3120 6175 7468 656e 7469 6361 7469 401 authenticati │ │ │ │ +00178d90: 6f6e 2072 6571 7569 7265 6420 6f72 2048 on required or H │ │ │ │ +00178da0: 5454 5020 3430 3720 4854 5450 2070 726f TTP 407 HTTP pro │ │ │ │ +00178db0: 7879 2061 7574 6865 6e74 6963 6174 696f xy authenticatio │ │ │ │ +00178dc0: 6e20 7265 7175 6972 6564 2920 7768 656e n required) when │ │ │ │ +00178dd0: 2074 6865 2063 6c69 656e 7420 7472 6965 the client trie │ │ │ │ +00178de0: 7320 746f 2063 6f6e 6e65 6374 2077 6974 s to connect wit │ │ │ │ +00178df0: 686f 7574 2048 5454 5020 6175 7468 656e hout HTTP authen │ │ │ │ +00178e00: 7469 6361 7469 6f6e 2028 6f72 2077 6974 tication (or wit │ │ │ │ +00178e10: 6820 7468 6520 7772 6f6e 6720 6175 7468 h the wrong auth │ │ │ │ +00178e20: 656e 7469 6361 7469 6f6e 2069 6e66 6f72 entication infor │ │ │ │ +00178e30: 6d61 7469 6f6e 292e 3c2f 703e 0a3c 703e mation).

    .

    │ │ │ │ +00178e40: 4865 7265 2069 7320 616e 2065 7861 6d70 Here is an examp │ │ │ │ +00178e50: 6c65 2063 6c69 656e 7420 636f 6465 2066 le client code f │ │ │ │ +00178e60: 7261 676d 656e 7420 746f 2073 6574 2074 ragment to set t │ │ │ │ +00178e70: 6865 204e 544c 4d20 6175 7468 656e 7469 he NTLM authenti │ │ │ │ +00178e80: 6361 7469 6f6e 2075 7365 726e 616d 6520 cation username │ │ │ │ +00178e90: 616e 6420 7061 7373 776f 7264 3a3c 2f70 and password:

    .
    │ │ │ │ +00178ee0: 7374 7275 6374 203c 2f73 7061 6e3e 3c61 struct soap *< │ │ │ │ +00178f20: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +00178f30: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ +00178f40: 6874 6d6c 223e 736f 6170 3c2f 613e 203d html">soap = │ │ │ │ +00178f50: 203c 6120 636c 6173 733d 2263 6f64 6522 soap_new1< │ │ │ │ +00178fb0: 2f61 3e28 3c61 2063 6c61 7373 3d22 636f /a>(SOAP_IO_K │ │ │ │ +00179010: 4545 5041 4c49 5645 3c2f 613e 293b 203c EEPALIVE); < │ │ │ │ +00179020: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    if (soa │ │ │ │ +00179060: 705f 6361 6c6c 5f6e 735f 5f77 6562 6d65 p_call_ns__webme │ │ │ │ +00179070: 7468 6f64 283c 6120 636c 6173 733d 2263 thod(soap │ │ │ │ +001790a0: 3c2f 613e 2c20 2e2e 2e29 2920 3c2f 6469 , ...)) .
    {
    . │ │ │ │ +001790e0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 if (soa │ │ │ │ +00179130: 703c 2f61 3e2d 2667 743b 3c61 2063 6c61 p->error == │ │ │ │ +00179190: 3430 3129 203c 2f64 6976 3e0a 3c64 6976 401)
    .
    │ │ │ │ +001791b0: 7b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 {
    .
    soap-&g │ │ │ │ +00179200: 743b 3c61 2063 6c61 7373 3d22 636f 6465 t;useri │ │ │ │ +00179250: 643c 2f61 3e20 3d20 3c73 7061 6e20 636c d = "Zaphod │ │ │ │ +00179280: 2671 756f 743b 3c2f 7370 616e 3e3b 203c "; < │ │ │ │ +00179290: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>..
    if (soap_call_ns_ │ │ │ │ +001793c0: 5f77 6562 6d65 7468 6f64 283c 6120 636c _webmethod(soap, ...) │ │ │ │ +00179400: 2920 3c2f 6469 763e 0a3c 6469 7620 636c )
    .
    │ │ │ │ +00179420: 202e 2e2e 203c 7370 616e 2063 6c61 7373 ... // er │ │ │ │ +00179440: 726f 723c 2f73 7061 6e3e 3c2f 6469 763e ror
    │ │ │ │ +00179450: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    else.
    ... < │ │ │ │ +001794b0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ +001794c0: 656e 7422 3e2f 2f20 7375 6363 6573 733c ent">// success< │ │ │ │ +001794d0: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    . │ │ │ │ +001794f0: 207d 3c2f 6469 763e 0a3c 6469 7620 636c }
    .
    }.

    The │ │ │ │ +00179530: 2066 6f6c 6c6f 7769 6e67 204e 544c 4d20 following NTLM │ │ │ │ +00179540: 6861 6e64 7368 616b 6520 6265 7477 6565 handshake betwee │ │ │ │ +00179550: 6e20 7468 6520 636c 6965 6e74 2043 2061 n the client C a │ │ │ │ +00179560: 6e64 2073 6572 7665 7220 5320 6973 2070 nd server S is p │ │ │ │ +00179570: 6572 666f 726d 6564 3a20 3c2f 703e 3c70 erformed:

    1: C --> │ │ │ │ +001795a0: 2053 2026 616d 703b 2050 4f53 5420 2e2e S & POST .. │ │ │ │ +001795b0: 2e20 0a20 2020 2020 2020 2020 2020 2026 . . & │ │ │ │ +001795c0: 616d 703b 2043 6f6e 7465 6e74 2d54 7970 amp; Content-Typ │ │ │ │ +001795d0: 653a 2074 6578 742f 786d 6c3b 2063 6861 e: text/xml; cha │ │ │ │ +001795e0: 7273 6574 3d75 7466 2d38 200a 0a32 3a20 rset=utf-8 ..2: │ │ │ │ +001795f0: 4320 266c 743b 2d2d 2020 5320 2661 6d70 C <-- S & │ │ │ │ +00179600: 3b20 3430 3120 556e 6175 7468 6f72 697a ; 401 Unauthoriz │ │ │ │ +00179610: 6564 200a 2020 2020 2020 2020 2020 2020 ed . │ │ │ │ +00179620: 2661 6d70 3b20 5757 572d 4175 7468 656e & WWW-Authen │ │ │ │ +00179630: 7469 6361 7465 3a20 4e54 4c4d 200a 0a33 ticate: NTLM ..3 │ │ │ │ +00179640: 3a20 4320 202d 2d26 6774 3b20 5320 2661 : C --> S &a │ │ │ │ +00179650: 6d70 3b20 4745 5420 2e2e 2e20 0a20 2020 mp; GET ... . │ │ │ │ +00179660: 2020 2020 2020 2020 2026 616d 703b 2041 & A │ │ │ │ +00179670: 7574 686f 7269 7a61 7469 6f6e 3a20 4e54 uthorization: NT │ │ │ │ +00179680: 4c4d 2026 6c74 3b62 6173 6536 342d 656e LM <base64-en │ │ │ │ +00179690: 636f 6465 6420 7479 7065 2d31 2d6d 6573 coded type-1-mes │ │ │ │ +001796a0: 7361 6765 2667 743b 200a 0a34 3a20 4320 sage> ..4: C │ │ │ │ +001796b0: 266c 743b 2d2d 2020 5320 2661 6d70 3b20 <-- S & │ │ │ │ +001796c0: 3430 3120 556e 6175 7468 6f72 697a 6564 401 Unauthorized │ │ │ │ +001796d0: 200a 2020 2020 2020 2020 2020 2020 2661 . &a │ │ │ │ +001796e0: 6d70 3b20 5757 572d 4175 7468 656e 7469 mp; WWW-Authenti │ │ │ │ +001796f0: 6361 7465 3a20 4e54 4c4d 2026 6c74 3b62 cate: NTLM <b │ │ │ │ +00179700: 6173 6536 342d 656e 636f 6465 6420 7479 ase64-encoded ty │ │ │ │ +00179710: 7065 2d32 2d6d 6573 7361 6765 2667 743b pe-2-message> │ │ │ │ +00179720: 200a 0a35 3a20 4320 202d 2d26 6774 3b20 ..5: C --> │ │ │ │ +00179730: 5320 2661 6d70 3b20 504f 5354 202e 2e2e S & POST ... │ │ │ │ +00179740: 200a 2020 2020 2020 2020 2020 2020 2661 . &a │ │ │ │ +00179750: 6d70 3b20 436f 6e74 656e 742d 5479 7065 mp; Content-Type │ │ │ │ +00179760: 3a20 7465 7874 2f78 6d6c 3b20 6368 6172 : text/xml; char │ │ │ │ +00179770: 7365 743d 7574 662d 3820 0a20 2020 2020 set=utf-8 . │ │ │ │ +00179780: 2020 2020 2020 2026 616d 703b 2041 7574 & Aut │ │ │ │ +00179790: 686f 7269 7a61 7469 6f6e 3a20 4e54 4c4d horization: NTLM │ │ │ │ +001797a0: 2026 6c74 3b62 6173 6536 342d 656e 636f <base64-enco │ │ │ │ +001797b0: 6465 6420 7479 7065 2d33 2d6d 6573 7361 ded type-3-messa │ │ │ │ +001797c0: 6765 2667 743b 200a 0a36 3a20 4320 266c ge> ..6: C &l │ │ │ │ +001797d0: 743b 2d2d 2020 5320 2661 6d70 3b20 3230 t;-- S & 20 │ │ │ │ +001797e0: 3020 4f4b 0a3c 2f70 7265 3e3c 703e 2077 0 OK.

    w │ │ │ │ +001797f0: 6865 7265 2073 7461 6765 7320 3120 616e here stages 1 an │ │ │ │ +00179800: 6420 3220 696e 6469 6361 7465 7320 6120 d 2 indicates a │ │ │ │ +00179810: 636c 6965 6e74 2061 7474 656d 7074 696e client attemptin │ │ │ │ +00179820: 6720 746f 2063 6f6e 6e65 6374 2077 6974 g to connect wit │ │ │ │ +00179830: 686f 7574 2061 7574 686f 7269 7a61 7469 hout authorizati │ │ │ │ +00179840: 6f6e 2069 6e66 6f72 6d61 7469 6f6e 2c20 on information, │ │ │ │ +00179850: 7768 6963 6820 6973 2074 6865 2066 6972 which is the fir │ │ │ │ +00179860: 7374 206d 6574 686f 6420 6361 6c6c 2069 st method call i │ │ │ │ +00179870: 6e20 7468 6520 636f 6465 2061 626f 7665 n the code above │ │ │ │ +00179880: 2e20 5374 6167 6520 3320 746f 2036 2068 . Stage 3 to 6 h │ │ │ │ +00179890: 6170 7065 6e20 7769 7468 2074 6865 2070 appen with the p │ │ │ │ +001798a0: 726f 7065 7220 636c 6965 6e74 2061 7574 roper client aut │ │ │ │ +001798b0: 6865 6e74 6963 6174 696f 6e20 7365 7420 hentication set │ │ │ │ +001798c0: 7769 7468 203c 636f 6465 3e63 6f6e 7374 with const │ │ │ │ +001798d0: 2063 6861 722a 203c 6120 636c 6173 733d char* s │ │ │ │ +00179990: 6f61 703a 3a75 7365 7269 643c 2f61 3e3c oap::userid< │ │ │ │ +001799a0: 2f63 6f64 653e 2061 6e64 203c 636f 6465 /code> and const char* soap::passw │ │ │ │ +00179a80: 643c 2f61 3e3c 2f63 6f64 653e 2e20 4f70 d. Op │ │ │ │ +00179a90: 7469 6f6e 616c 6c79 2c20 7468 6520 3c63 tionally, the const char* │ │ │ │ +00179ab0: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap::au │ │ │ │ +00179b70: 7468 7265 616c 6d3c 2f61 3e3c 2f63 6f64 threalm string should │ │ │ │ +00179b90: 2062 6520 7365 7420 6173 2077 656c 6c20 be set as well │ │ │ │ +00179ba0: 746f 2069 6e64 6963 6174 6520 7468 6520 to indicate the │ │ │ │ +00179bb0: 646f 6d61 696e 2061 6363 6573 7365 6420 domain accessed │ │ │ │ +00179bc0: 2874 6869 7320 7374 7269 6e67 2069 7320 (this string is │ │ │ │ +00179bd0: 6e6f 726d 616c 6c79 2073 6574 2077 6865 normally set whe │ │ │ │ +00179be0: 6e20 7468 6520 7365 7276 6572 2072 6573 n the server res │ │ │ │ +00179bf0: 706f 6e64 7320 7769 7468 2048 5454 5020 ponds with HTTP │ │ │ │ +00179c00: 3430 3120 736f 2074 6865 2063 6c69 656e 401 so the clien │ │ │ │ +00179c10: 7420 7265 6365 6976 6573 2074 6869 7320 t receives this │ │ │ │ +00179c20: 7365 7276 6572 2064 6f6d 6169 6e20 696e server domain in │ │ │ │ +00179c30: 666f 726d 6174 696f 6e29 2e20 4e54 4c4d formation). NTLM │ │ │ │ +00179c40: 2061 7574 6865 6e74 6963 6174 6573 2063 authenticates c │ │ │ │ +00179c50: 6f6e 6e65 6374 696f 6e73 2c20 6e6f 7420 onnections, not │ │ │ │ +00179c60: 7265 7175 6573 7473 2e20 5768 656e 2074 requests. When t │ │ │ │ +00179c70: 6865 2063 6f6e 6e65 6374 696f 6e20 6973 he connection is │ │ │ │ +00179c80: 206b 6570 7420 616c 6976 652c 2073 7562 kept alive, sub │ │ │ │ +00179c90: 7365 7175 656e 7420 6d65 7373 6167 6573 sequent messages │ │ │ │ +00179ca0: 2063 616e 2062 6520 6578 6368 616e 6765 can be exchange │ │ │ │ +00179cb0: 6420 7769 7468 6f75 7420 7265 2d61 7574 d without re-aut │ │ │ │ +00179cc0: 6865 6e74 6963 6174 696f 6e2e 3c2f 703e hentication.

    │ │ │ │ +00179cd0: 0a3c 703e 546f 2061 766f 6964 2074 6865 .

    To avoid the │ │ │ │ +00179ce0: 206f 7665 7268 6561 6420 6f66 2074 6865 overhead of the │ │ │ │ +00179cf0: 2066 6972 7374 2072 656a 6563 7465 6420 first rejected │ │ │ │ +00179d00: 6361 6c6c 2c20 7573 653a 3c2f 703e 0a3c call, use:

    .< │ │ │ │ +00179d10: 6469 7620 636c 6173 733d 2266 7261 676d div class="fragm │ │ │ │ +00179d20: 656e 7422 3e3c 6469 7620 636c 6173 733d ent">
    str │ │ │ │ +00179d50: 7563 7420 3c2f 7370 616e 3e3c 6120 636c uct soap *soap = soap_new1 │ │ │ │ +00179e20: 283c 6120 636c 6173 733d 2263 6f64 6522 (SOAP_IO_KEEP │ │ │ │ +00179e80: 414c 4956 453c 2f61 3e29 3b20 3c2f 6469 ALIVE); ..< │ │ │ │ +00179f70: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00179f80: 3e3c 6120 636c 6173 733d 2263 6f64 6522 >soap │ │ │ │ +00179fb0: 2d26 6774 3b3c 6120 636c 6173 733d 2263 ->us │ │ │ │ +0017a000: 6572 6964 3c2f 613e 203d 203c 7370 616e erid = "Zap │ │ │ │ +0017a030: 686f 6426 7175 6f74 3b3c 2f73 7061 6e3e hod" │ │ │ │ +0017a040: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
    .
    soap->< │ │ │ │ +0017a090: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +0017a0a0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ +0017a0b0: 6874 6d6c 2361 3232 6432 3139 6339 3866 html#a22d219c98f │ │ │ │ +0017a0c0: 3066 6366 3435 3636 3431 3237 3763 6336 0fcf456641277cc6 │ │ │ │ +0017a0d0: 3431 3734 6133 223e 7061 7373 7764 3c2f 4174a3">passwd = "Beeblebro │ │ │ │ +0017a110: 7826 7175 6f74 3b3c 2f73 7061 6e3e 3b20 x"; │ │ │ │ +0017a120: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    ..
    if (s │ │ │ │ +0017a240: 6f61 705f 6361 6c6c 5f6e 735f 5f77 6562 oap_call_ns__web │ │ │ │ +0017a250: 6d65 7468 6f64 283c 6120 636c 6173 733d method(so │ │ │ │ +0017a280: 6170 3c2f 613e 2c20 2e2e 2e29 2920 3c2f ap, ...)) .
    ... // error
    .
    else │ │ │ │ +0017a310: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    ... < │ │ │ │ +0017a330: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ +0017a340: 656e 7422 3e2f 2f20 7375 6363 6573 733c ent">// success< │ │ │ │ +0017a350: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    .
    soap::ntlm │ │ │ │ +0017a400: 5f63 6861 6c6c 656e 6765 3c2f 613e 3c2f _challenge
    const ch │ │ │ │ +0017a430: 6172 202a 206e 746c 6d5f 6368 616c 6c65 ar * ntlm_challe │ │ │ │ +0017a440: 6e67 653c 2f64 6976 3e3c 6469 7620 636c nge
    User │ │ │ │ +0017a460: 2d64 6566 696e 6162 6c65 204e 544c 4d20 -definable NTLM │ │ │ │ +0017a470: 6175 7468 656e 7469 6361 7469 6f6e 2063 authentication c │ │ │ │ +0017a480: 6861 6c6c 656e 6765 206b 6579 2073 7472 hallenge key str │ │ │ │ +0017a490: 696e 672e 3c2f 6469 763e 3c64 6976 2063 ing.
    │ │ │ │ +0017a4b0: 4465 6669 6e69 7469 6f6e 3a3c 2f62 3e20 Definition: │ │ │ │ +0017a4c0: 7374 6473 6f61 7032 2e68 3a33 3837 383c stdsoap2.h:3878< │ │ │ │ +0017a4d0: 2f64 6976 3e3c 2f64 6976 3e0a 3c2f 6469 /div>
    .

    When the a │ │ │ │ +0017a500: 7574 6865 6e74 6963 6174 696f 6e20 6661 uthentication fa │ │ │ │ +0017a510: 696c 7320 2873 7461 6765 2031 2061 6e64 ils (stage 1 and │ │ │ │ +0017a520: 2032 292c 2074 6865 2073 6572 7669 6365 2), the service │ │ │ │ +0017a530: 2072 6573 706f 6e73 6520 7769 7468 2048 response with H │ │ │ │ +0017a540: 5454 5020 6572 726f 7220 636f 6465 2022 TTP error code " │ │ │ │ +0017a550: 3430 3120 556e 6175 7468 6f72 697a 6564 401 Unauthorized │ │ │ │ +0017a560: 2220 616e 6420 3c63 6f64 653e 3c61 2063 " and soap::error is set │ │ │ │ +0017a630: 746f 2048 5454 5020 636f 6465 2034 3031 to HTTP code 401 │ │ │ │ +0017a640: 2e3c 2f70 3e0a 3c70 3ef0 9f94 9d20 3c61 .

    .

    .... Back t │ │ │ │ +0017a660: 6f20 7461 626c 6520 6f66 2063 6f6e 7465 o table of conte │ │ │ │ +0017a670: 6e74 733c 2f61 3e3c 2f70 3e0a 3c68 333e nts

    .

    │ │ │ │ +0017a680: 3c61 2063 6c61 7373 3d22 616e 6368 6f72 < │ │ │ │ +0017a6b0: 2f61 3e0a 4854 5450 2070 726f 7879 204e /a>.HTTP proxy N │ │ │ │ +0017a6c0: 544c 4d20 6175 7468 656e 7469 6361 7469 TLM authenticati │ │ │ │ +0017a6d0: 6f6e 3c2f 6833 3e0a 3c70 3e46 6f72 2048 on

    .

    For H │ │ │ │ +0017a6e0: 5454 5020 3430 3720 5072 6f78 7920 4175 TTP 407 Proxy Au │ │ │ │ +0017a6f0: 7468 656e 7469 6361 7469 6f6e 2052 6571 thentication Req │ │ │ │ +0017a700: 7569 7265 6420 7365 7420 7468 6520 3c63 uired set the soap::proxy_u │ │ │ │ +0017a7d0: 7365 7269 643c 2f61 3e3c 2f63 6f64 653e serid │ │ │ │ +0017a7e0: 2061 6e64 203c 636f 6465 3e3c 6120 636c and soap: │ │ │ │ +0017a8a0: 3a70 726f 7879 5f70 6173 7377 643c 2f61 :proxy_passwd:

    .
    stru │ │ │ │ +0017a900: 6374 203c 2f73 7061 6e3e 3c61 2063 6c61 ct soap *soap = soap_new1( │ │ │ │ +0017a9d0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 SOAP_IO_KEEPA │ │ │ │ +0017aa30: 4c49 5645 3c2f 613e 293b 203c 2f64 6976 LIVE);
    .
    soap< │ │ │ │ +0017aa80: 2f61 3e2d 2667 743b 3c61 2063 6c61 7373 /a>->proxy_host │ │ │ │ +0017aae0: 3d20 3c73 7061 6e20 636c 6173 733d 2273 = &q │ │ │ │ +0017ab00: 756f 743b 2e2e 2e26 7175 6f74 3b3c 2f73 uot;...";
    .< │ │ │ │ +0017ab30: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +0017ab40: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ +0017ab50: 6874 6d6c 223e 736f 6170 3c2f 613e 2d26 html">soap-& │ │ │ │ +0017ab60: 6774 3b3c 6120 636c 6173 733d 2263 6f64 gt;prox │ │ │ │ +0017abb0: 795f 706f 7274 3c2f 613e 203d 202e 2e2e y_port = ... │ │ │ │ +0017abc0: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
    .
    if ( │ │ │ │ +0017ac00: 736f 6170 5f63 616c 6c5f 6e73 5f5f 7765 soap_call_ns__we │ │ │ │ +0017ac10: 626d 6574 686f 6428 3c61 2063 6c61 7373 bmethod(s │ │ │ │ +0017ac40: 6f61 703c 2f61 3e2c 202e 2e2e 2929 203c oap, ...)) < │ │ │ │ +0017ac50: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    {
    . │ │ │ │ +0017ac70: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    if │ │ │ │ +0017aca0: 3c2f 7370 616e 3e20 283c 6120 636c 6173 ( │ │ │ │ +0017acd0: 736f 6170 3c2f 613e 2d26 6774 3b3c 6120 soap->error │ │ │ │ +0017ad30: 3d3d 2034 3037 2920 3c2f 6469 763e 0a3c == 407)
    .< │ │ │ │ +0017ad40: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +0017ad50: 3e20 207b 3c2f 6469 763e 0a3c 6469 7620 > {
    .
    │ │ │ │ +0017ad70: 203c 6120 636c 6173 733d 2263 6f64 6522 soap │ │ │ │ +0017ada0: 2d26 6774 3b3c 6120 636c 6173 733d 2263 ->pr │ │ │ │ +0017adf0: 6f78 795f 7573 6572 6964 3c2f 613e 203d oxy_userid = │ │ │ │ +0017ae00: 203c 7370 616e 2063 6c61 7373 3d22 7374 &qu │ │ │ │ +0017ae20: 6f74 3b5a 6170 686f 6426 7175 6f74 3b3c ot;Zaphod"< │ │ │ │ +0017ae30: 2f73 7061 6e3e 3b20 3c2f 6469 763e 0a3c /span>;
    .< │ │ │ │ +0017ae40: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +0017ae50: 3e20 2020 203c 6120 636c 6173 733d 2263 > soap │ │ │ │ +0017ae80: 3c2f 613e 2d26 6774 3b3c 6120 636c 6173 ->proxy_passwd = "Beeblebro │ │ │ │ +0017af10: 7826 7175 6f74 3b3c 2f73 7061 6e3e 3b20 x"; │ │ │ │ +0017af20: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    soap-> │ │ │ │ +0017af70: 3b3c 6120 636c 6173 733d 2263 6f64 6522 ;authre │ │ │ │ +0017afc0: 616c 6d3c 2f61 3e20 3d20 3c73 7061 6e20 alm = "Ursa │ │ │ │ +0017aff0: 2d4d 696e 6f72 2671 756f 743b 3c2f 7370 -Minor";
    .
    │ │ │ │ +0017b020: 2020 3c73 7061 6e20 636c 6173 733d 226b if (soap_call │ │ │ │ +0017b050: 5f6e 735f 5f77 6562 6d65 7468 6f64 283c _ns__webmethod(< │ │ │ │ +0017b060: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +0017b070: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ +0017b080: 6874 6d6c 223e 736f 6170 3c2f 613e 2c20 html">soap, │ │ │ │ +0017b090: 2e2e 2e29 2920 3c2f 6469 763e 0a3c 6469 ...))
    . │ │ │ │ +0017b0b0: 2020 2020 202e 2e2e 203c 7370 616e 2063 ... / │ │ │ │ +0017b0d0: 2f20 6572 726f 723c 2f73 7061 6e3e 3c2f / error.
    else │ │ │ │ +0017b120: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    . │ │ │ │ +0017b140: 2e2e 203c 7370 616e 2063 6c61 7373 3d22 .. // succ │ │ │ │ +0017b160: 6573 733c 2f73 7061 6e3e 3c2f 6469 763e ess
    │ │ │ │ +0017b170: 0a3c 6469 7620 636c 6173 733d 2274 7463 .
    soap:: │ │ │ │ +0017b210: 7072 6f78 795f 706f 7274 3c2f 613e 3c2f proxy_port
    int prox │ │ │ │ +0017b240: 795f 706f 7274 3c2f 6469 763e 3c64 6976 y_port
    U │ │ │ │ +0017b260: 7365 722d 6465 6669 6e61 626c 6520 7072 ser-definable pr │ │ │ │ +0017b270: 6f78 7920 706f 7274 2077 6869 6368 2073 oxy port which s │ │ │ │ +0017b280: 686f 756c 6420 6265 2073 6574 2074 6f20 hould be set to │ │ │ │ +0017b290: 636f 6e6e 6563 7420 7468 726f 7567 6820 connect through │ │ │ │ +0017b2a0: 616e 2048 5454 5020 7072 6f78 7920 2874 an HTTP proxy (t │ │ │ │ +0017b2b0: 6865 2076 616c 7565 2069 7320 3830 3830 he value is 8080 │ │ │ │ +0017b2c0: 2062 7920 2e2e 2e3c 2f64 6976 3e3c 6469 by ...
    │ │ │ │ +0017b2e0: 3c62 3e44 6566 696e 6974 696f 6e3a 3c2f Definition: stdsoap2.h:39 │ │ │ │ +0017b300: 3036 3c2f 6469 763e 3c2f 6469 763e 0a3c 06
    .< │ │ │ │ +0017b310: 6469 7620 636c 6173 733d 2274 7463 2220 div class="ttc" │ │ │ │ +0017b320: 6964 3d22 6173 7472 7563 7473 6f61 705f id="astructsoap_ │ │ │ │ +0017b330: 6874 6d6c 5f61 3765 3765 3965 3964 3635 html_a7e7e9e9d65 │ │ │ │ +0017b340: 6262 6136 3233 3732 3938 6366 3265 6437 bba6237298cf2ed7 │ │ │ │ +0017b350: 6365 6335 3939 223e 3c64 6976 2063 6c61 cec599">
    soap::pr │ │ │ │ +0017b3b0: 6f78 795f 7573 6572 6964 3c2f 613e 3c2f oxy_userid
    const ch │ │ │ │ +0017b3e0: 6172 202a 2070 726f 7879 5f75 7365 7269 ar * proxy_useri │ │ │ │ +0017b3f0: 643c 2f64 6976 3e3c 6469 7620 636c 6173 d
    User-d │ │ │ │ +0017b410: 6566 696e 6162 6c65 2070 726f 7879 2061 efinable proxy a │ │ │ │ +0017b420: 7574 686f 7269 7a61 7469 6f6e 2075 7365 uthorization use │ │ │ │ +0017b430: 7220 6964 2073 7472 696e 6720 746f 2061 r id string to a │ │ │ │ +0017b440: 7574 6865 6e74 6963 6174 6520 616e 6420 uthenticate and │ │ │ │ +0017b450: 636f 6e6e 6563 7420 746f 2061 6e20 4854 connect to an HT │ │ │ │ +0017b460: 5450 2070 726f 7879 2e3c 2f64 6976 3e3c TP proxy.
    < │ │ │ │ +0017b470: 6469 7620 636c 6173 733d 2274 7464 6566 div class="ttdef │ │ │ │ +0017b480: 223e 3c62 3e44 6566 696e 6974 696f 6e3a ">Definition: │ │ │ │ +0017b490: 3c2f 623e 2073 7464 736f 6170 322e 683a stdsoap2.h: │ │ │ │ +0017b4a0: 3339 3131 3c2f 6469 763e 3c2f 6469 763e 3911
    │ │ │ │ +0017b4b0: 0a3c 6469 7620 636c 6173 733d 2274 7463 .
    soap:: │ │ │ │ +0017b550: 7072 6f78 795f 686f 7374 3c2f 613e 3c2f proxy_host
    const ch │ │ │ │ +0017b580: 6172 202a 2070 726f 7879 5f68 6f73 743c ar * proxy_host< │ │ │ │ +0017b590: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
    User-def │ │ │ │ +0017b5b0: 696e 6162 6c65 2070 726f 7879 2068 6f73 inable proxy hos │ │ │ │ +0017b5c0: 7420 6e61 6d65 2073 7472 696e 6720 7768 t name string wh │ │ │ │ +0017b5d0: 6963 6820 7368 6f75 6c64 2062 6520 7365 ich should be se │ │ │ │ +0017b5e0: 7420 746f 2063 6f6e 6e65 6374 2074 6872 t to connect thr │ │ │ │ +0017b5f0: 6f75 6768 2061 6e20 4854 5450 2070 726f ough an HTTP pro │ │ │ │ +0017b600: 7879 2e3c 2f64 6976 3e3c 6469 7620 636c xy.
    D │ │ │ │ +0017b620: 6566 696e 6974 696f 6e3a 3c2f 623e 2073 efinition: s │ │ │ │ +0017b630: 7464 736f 6170 322e 683a 3339 3031 3c2f tdsoap2.h:3901
    .
    │ │ │ │ +0017b700: 3c64 6976 2063 6c61 7373 3d22 7474 6465
    const char * │ │ │ │ +0017b720: 2070 726f 7879 5f70 6173 7377 643c 2f64 proxy_passwd
    User-defin │ │ │ │ +0017b750: 6162 6c65 2070 726f 7879 2061 7574 686f able proxy autho │ │ │ │ +0017b760: 7269 7a61 7469 6f6e 2070 6173 7377 6f72 rization passwor │ │ │ │ +0017b770: 6420 7374 7269 6e67 2074 6f20 6175 7468 d string to auth │ │ │ │ +0017b780: 656e 7469 6361 7465 2061 6e64 2063 6f6e enticate and con │ │ │ │ +0017b790: 6e65 6374 2074 6f20 616e 2048 5454 5020 nect to an HTTP │ │ │ │ +0017b7a0: 7072 6f78 792e 3c2f 6469 763e 3c64 6976 proxy.
    < │ │ │ │ +0017b7c0: 623e 4465 6669 6e69 7469 6f6e 3a3c 2f62 b>Definition: stdsoap2.h:391 │ │ │ │ +0017b7e0: 363c 2f64 6976 3e3c 2f64 6976 3e0a 3c2f 6
    .

    To avoid │ │ │ │ +0017b810: 2074 6865 206f 7665 7268 6561 6420 6f66 the overhead of │ │ │ │ +0017b820: 2074 6865 2066 6972 7374 2072 656a 6563 the first rejec │ │ │ │ +0017b830: 7465 6420 6361 6c6c 2c20 7573 653a 3c2f ted call, use:.

    struct < │ │ │ │ +0017b890: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +0017b8a0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ +0017b8b0: 6874 6d6c 223e 736f 6170 3c2f 613e 202a html">soap * │ │ │ │ +0017b8c0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap │ │ │ │ +0017b8f0: 3d20 3c61 2063 6c61 7373 3d22 636f 6465 = soap_new1 │ │ │ │ +0017b950: 3c2f 613e 283c 6120 636c 6173 733d 2263 (SOAP_IO_ │ │ │ │ +0017b9b0: 4b45 4550 414c 4956 453c 2f61 3e29 3b20 KEEPALIVE); │ │ │ │ +0017b9c0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    ..
    soap< │ │ │ │ +0017bae0: 2f61 3e2d 2667 743b 3c61 2063 6c61 7373 /a>->proxy_port │ │ │ │ +0017bb40: 3d20 2e2e 2e3b 203c 2f64 6976 3e0a 3c64 = ...;
    . │ │ │ │ +0017bb60: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap- │ │ │ │ +0017bb90: 2667 743b 3c61 2063 6c61 7373 3d22 636f >pro │ │ │ │ +0017bbe0: 7879 5f75 7365 7269 643c 2f61 3e20 3d20 xy_userid = │ │ │ │ +0017bbf0: 3c73 7061 6e20 636c 6173 733d 2273 7472 &quo │ │ │ │ +0017bc10: 743b 5a61 7068 6f64 2671 756f 743b 3c2f t;Zaphod";
    . │ │ │ │ +0017bc40: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap- │ │ │ │ +0017bc70: 2667 743b 3c61 2063 6c61 7373 3d22 636f >pro │ │ │ │ +0017bcc0: 7879 5f70 6173 7377 643c 2f61 3e20 3d20 xy_passwd = │ │ │ │ +0017bcd0: 3c73 7061 6e20 636c 6173 733d 2273 7472 &quo │ │ │ │ +0017bcf0: 743b 4265 6562 6c65 6272 6f78 2671 756f t;Beeblebrox&quo │ │ │ │ +0017bd00: 743b 3c2f 7370 616e 3e3b 203c 2f64 6976 t;;
    .
    soap< │ │ │ │ +0017bd50: 2f61 3e2d 2667 743b 3c61 2063 6c61 7373 /a>->authrealm = │ │ │ │ +0017bdb0: 203c 7370 616e 2063 6c61 7373 3d22 7374 &qu │ │ │ │ +0017bdd0: 6f74 3b55 7273 612d 4d69 6e6f 7226 7175 ot;Ursa-Minor&qu │ │ │ │ +0017bde0: 6f74 3b3c 2f73 7061 6e3e 3b20 3c2f 6469 ot;; ..< │ │ │ │ +0017bed0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +0017bee0: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >if (soap_call_ │ │ │ │ +0017bf10: 6e73 5f5f 7765 626d 6574 686f 6428 3c61 ns__webmethod(soap, . │ │ │ │ +0017bf50: 2e2e 2929 203c 2f64 6976 3e0a 3c64 6976 ..))
    .
    │ │ │ │ +0017bf70: 2e2e 2e20 3c73 7061 6e20 636c 6173 733d ... // err │ │ │ │ +0017bf90: 6f72 3c2f 7370 616e 3e3c 2f64 6976 3e0a or
    . │ │ │ │ +0017bfa0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    else │ │ │ │ +0017bfd0: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ │ +0017bff0: 2020 2e2e 2e20 3c73 7061 6e20 636c 6173 ... // s │ │ │ │ +0017c010: 7563 6365 7373 3c2f 7370 616e 3e3c 2f64 uccess.

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

    │ │ │ │ +0017c070: 0a3c 6833 3e3c 6120 636c 6173 733d 2261 .

    │ │ │ │ +0017c0a0: 3c2f 613e 0a48 5454 5020 7072 6f78 7920 .HTTP proxy │ │ │ │ +0017c0b0: 6261 7369 6320 6175 7468 656e 7469 6361 basic authentica │ │ │ │ +0017c0c0: 7469 6f6e 3c2f 6833 3e0a 3c70 3e48 5454 tion

    .

    HTT │ │ │ │ +0017c0d0: 5020 7072 6f78 7920 6175 7468 656e 7469 P proxy authenti │ │ │ │ +0017c0e0: 6361 7469 6f6e 2028 6261 7369 6329 2069 cation (basic) i │ │ │ │ +0017c0f0: 7320 656e 6162 6c65 6420 6174 2074 6865 s enabled at the │ │ │ │ +0017c100: 2063 6c69 656e 742d 7369 6465 2062 7920 client-side by │ │ │ │ +0017c110: 7365 7474 696e 6720 7468 6520 3c63 6f64 setting the soap::proxy_use │ │ │ │ +0017c1e0: 7269 643c 2f61 3e3c 2f63 6f64 653e 2061 rid a │ │ │ │ +0017c1f0: 6e64 203c 636f 6465 3e3c 6120 636c 6173 nd soap::p │ │ │ │ +0017c2b0: 726f 7879 5f70 6173 7377 643c 2f61 3e3c roxy_passwd< │ │ │ │ +0017c2c0: 2f63 6f64 653e 2073 7472 696e 6773 2074 /code> strings t │ │ │ │ +0017c2d0: 6f20 6120 7573 6572 6e61 6d65 2061 6e64 o a username and │ │ │ │ +0017c2e0: 2070 6173 7377 6f72 642c 2072 6573 7065 password, respe │ │ │ │ +0017c2f0: 6374 6976 656c 792e 2046 6f72 2065 7861 ctively. For exa │ │ │ │ +0017c300: 6d70 6c65 2c20 6120 7072 6f78 7920 7365 mple, a proxy se │ │ │ │ +0017c310: 7276 6572 206d 6179 2072 6571 7565 7374 rver may request │ │ │ │ +0017c320: 2075 7365 7220 6175 7468 656e 7469 6361 user authentica │ │ │ │ +0017c330: 7469 6f6e 2e20 4f74 6865 7277 6973 652c tion. Otherwise, │ │ │ │ +0017c340: 2061 6363 6573 7320 6973 2064 656e 6965 access is denie │ │ │ │ +0017c350: 6420 6279 2074 6865 2070 726f 7879 2028 d by the proxy ( │ │ │ │ +0017c360: 4854 5450 2034 3037 2065 7272 6f72 292e HTTP 407 error). │ │ │ │ +0017c370: 2045 7861 6d70 6c65 2063 6c69 656e 7420 Example client │ │ │ │ +0017c380: 636f 6465 2066 7261 676d 656e 7420 746f code fragment to │ │ │ │ +0017c390: 2073 6574 2070 726f 7879 2073 6572 7665 set proxy serve │ │ │ │ +0017c3a0: 722c 2075 7365 726e 616d 652c 2061 6e64 r, username, and │ │ │ │ +0017c3b0: 2070 6173 7377 6f72 643a 3c2f 703e 0a3c password:

    .< │ │ │ │ +0017c3c0: 6469 7620 636c 6173 733d 2266 7261 676d div class="fragm │ │ │ │ +0017c3d0: 656e 7422 3e3c 6469 7620 636c 6173 733d ent">
    str │ │ │ │ +0017c400: 7563 7420 3c2f 7370 616e 3e3c 6120 636c uct soap *soap = soap_new( │ │ │ │ +0017c4d0: 293b 203c 2f64 6976 3e0a 3c64 6976 2063 );
    .
    soap-> │ │ │ │ +0017c520: 3c61 2063 6c61 7373 3d22 636f 6465 2220 proxy_h │ │ │ │ +0017c570: 6f73 743c 2f61 3e20 3d20 3c73 7061 6e20 ost = "xx.x │ │ │ │ +0017c5a0: 782e 7878 2e78 7826 7175 6f74 3b3c 2f73 x.xx.xx"; // I │ │ │ │ +0017c5d0: 5020 6f72 2064 6f6d 6169 6e20 3c2f 7370 P or domain
    .
    soap-> │ │ │ │ +0017c630: 3c61 2063 6c61 7373 3d22 636f 6465 2220 proxy_p │ │ │ │ +0017c680: 6f72 743c 2f61 3e20 3d20 3830 3830 3b20 ort = 8080; │ │ │ │ +0017c690: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    │ │ │ │ +0017c6d0: 736f 6170 3c2f 613e 2d26 6774 3b3c 6120 soap->proxy_user │ │ │ │ +0017c730: 6964 3c2f 613e 203d 203c 7370 616e 2063 id = "guest │ │ │ │ +0017c760: 2671 756f 743b 3c2f 7370 616e 3e3b 203c "; < │ │ │ │ +0017c770: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.

    A │ │ │ │ +0017c870: 2063 6c69 656e 7420 534f 4150 2072 6571 client SOAP req │ │ │ │ +0017c880: 7565 7374 2077 696c 6c20 6861 7665 2074 uest will have t │ │ │ │ +0017c890: 6865 2066 6f6c 6c6f 7769 6e67 2048 5454 he following HTT │ │ │ │ +0017c8a0: 5020 6865 6164 6572 3a20 3c2f 703e 3c70 P header:

    POST /XXX HT │ │ │ │ +0017c8d0: 5450 2f31 2e31 200a 486f 7374 3a20 5959 TP/1.1 .Host: YY │ │ │ │ +0017c8e0: 5920 0a55 7365 722d 4167 656e 743a 2067 Y .User-Agent: g │ │ │ │ +0017c8f0: 534f 4150 2f32 2e38 200a 436f 6e74 656e SOAP/2.8 .Conten │ │ │ │ +0017c900: 742d 5479 7065 3a20 7465 7874 2f78 6d6c t-Type: text/xml │ │ │ │ +0017c910: 3b20 6368 6172 7365 743d 7574 662d 3820 ; charset=utf-8 │ │ │ │ +0017c920: 0a43 6f6e 7465 6e74 2d4c 656e 6774 683a .Content-Length: │ │ │ │ +0017c930: 205a 5a5a 200a 5072 6f78 792d 4175 7468 ZZZ .Proxy-Auth │ │ │ │ +0017c940: 6f72 697a 6174 696f 6e3a 2042 6173 6963 orization: Basic │ │ │ │ +0017c950: 205a 3356 6c63 3351 365a 3356 6c63 3351 Z3Vlc3Q6Z3Vlc3Q │ │ │ │ +0017c960: 3d20 0a3c 2f70 7265 3e3c 703e 2057 6865 = .

    Whe │ │ │ │ +0017c970: 6e20 582d 466f 7277 6172 6465 642d 466f n X-Forwarded-Fo │ │ │ │ +0017c980: 7220 6865 6164 6572 7320 6172 6520 7265 r headers are re │ │ │ │ +0017c990: 7475 726e 6564 2062 7920 7468 6520 7072 turned by the pr │ │ │ │ +0017c9a0: 6f78 792c 2074 6865 2068 6561 6465 7220 oxy, the header │ │ │ │ +0017c9b0: 6361 6e20 6265 2061 6363 6573 7365 6420 can be accessed │ │ │ │ +0017c9c0: 696e 2074 6865 203c 636f 6465 3e3c 6120 in the soap::proxy_ │ │ │ │ +0017ca60: 6672 6f6d 3c2f 613e 3c2f 636f 6465 3e20 from │ │ │ │ +0017ca70: 7374 7269 6e67 2e3c 2f70 3e0a 3c70 3e54 string.

    .

    T │ │ │ │ +0017ca80: 6865 2043 4f4e 4e45 4354 206d 6574 686f he CONNECT metho │ │ │ │ +0017ca90: 6420 6973 2075 7365 6420 666f 7220 4854 d is used for HT │ │ │ │ +0017caa0: 5450 2070 726f 7879 2061 7574 6865 6e74 TP proxy authent │ │ │ │ +0017cab0: 6963 6174 696f 6e3a 203c 2f70 3e3c 7072 ication:

    CONNECT serve │ │ │ │ +0017cae0: 722e 6578 616d 706c 652e 636f 6d3a 3830 r.example.com:80 │ │ │ │ +0017caf0: 2048 5454 502f 312e 310a 3c2f 7072 653e HTTP/1.1. │ │ │ │ +0017cb00: 3c70 3e20 496e 2073 6f6d 6520 6361 7365

    In some case │ │ │ │ +0017cb10: 732c 2079 6f75 2077 696c 6c20 6e6f 7469 s, you will noti │ │ │ │ +0017cb20: 6365 2074 6861 7420 7468 6520 486f 7374 ce that the Host │ │ │ │ +0017cb30: 2048 5454 5020 6865 6164 6572 2075 7365 HTTP header use │ │ │ │ +0017cb40: 7320 7468 6520 434f 4e4e 4543 5420 7072 s the CONNECT pr │ │ │ │ +0017cb50: 6f74 6f63 6f6c 3a20 3c2f 703e 3c70 7265 otocol:

    CONNECT server
    │ │ │ │ +0017cb80: 2e65 7861 6d70 6c65 2e63 6f6d 3a38 3020  .example.com:80 
    │ │ │ │ +0017cb90: 4854 5450 2f31 2e31 200a 486f 7374 3a20  HTTP/1.1 .Host: 
    │ │ │ │ +0017cba0: 7365 7276 6572 2e65 7861 6d70 6c65 2e63  server.example.c
    │ │ │ │ +0017cbb0: 6f6d 3a38 300a 3c2f 7072 653e 3c70 3e20  om:80.

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

    .Performa │ │ │ │ +0017cc20: 6e63 6520 696d 7072 6f76 656d 656e 7420 nce improvement │ │ │ │ +0017cc30: 7469 7073 3c2f 6832 3e0a 3c70 3e48 6572 tips

    .

    Her │ │ │ │ +0017cc40: 6520 6172 6520 736f 6d65 2074 6970 7320 e are some tips │ │ │ │ +0017cc50: 796f 7520 6361 6e20 7573 6520 746f 2073 you can use to s │ │ │ │ +0017cc60: 7065 6564 2075 7020 6753 4f41 502e 2054 peed up gSOAP. T │ │ │ │ +0017cc70: 6865 2064 6566 6175 6c74 2073 6574 7469 he default setti │ │ │ │ +0017cc80: 6e67 7320 6172 6520 6368 6f73 656e 2074 ngs are chosen t │ │ │ │ +0017cc90: 6f20 6d61 7869 6d69 7a65 2070 6f72 7461 o maximize porta │ │ │ │ +0017cca0: 6269 6c69 7479 2061 6e64 2063 6f6d 7061 bility and compa │ │ │ │ +0017ccb0: 7469 6269 6c69 7479 2e20 5468 6520 7365 tibility. The se │ │ │ │ +0017ccc0: 7474 696e 6773 2063 616e 2062 6520 7477 ttings can be tw │ │ │ │ +0017ccd0: 6561 6b65 6420 746f 206f 7074 696d 697a eaked to optimiz │ │ │ │ +0017cce0: 6520 7468 6520 7065 7266 6f72 6d61 6e63 e the performanc │ │ │ │ +0017ccf0: 6520 6173 2066 6f6c 6c6f 7773 3a3c 2f70 e as follows:

    .
      .
    • Incre │ │ │ │ +0017cd10: 6173 6520 7468 6520 6275 6666 6572 2073 ase the buffer s │ │ │ │ +0017cd20: 697a 6520 3c63 6f64 653e 2353 4f41 505f ize #SOAP_ │ │ │ │ +0017cd30: 4255 464c 454e 3c2f 636f 6465 3e20 6279 BUFLEN by │ │ │ │ +0017cd40: 2063 6861 6e67 696e 6720 7468 6520 3c63 changing the #SOAP_BUFLEN │ │ │ │ +0017cd60: 3c2f 636f 6465 3e20 6d61 6372 6f20 696e macro in │ │ │ │ +0017cd70: 203c 656d 3e3c 636f 6465 3e67 736f 6170 gsoap │ │ │ │ +0017cd80: 2f73 7464 736f 6170 322e 683c 2f63 6f64 /stdsoap2.h. Use buf │ │ │ │ +0017cda0: 6665 7220 7369 7a65 2032 5e31 383d 3236 fer size 2^18=26 │ │ │ │ +0017cdb0: 3231 3434 2066 6f72 2065 7861 6d70 6c65 2144 for example │ │ │ │ +0017cdc0: 2e3c 2f6c 693e 0a3c 6c69 3e55 7365 2048 .
    • .
    • Use H │ │ │ │ +0017cdd0: 5454 5020 6b65 6570 2d61 6c69 7665 2061 TTP keep-alive a │ │ │ │ +0017cde0: 7420 7468 6520 636c 6965 6e74 2d73 6964 t the client-sid │ │ │ │ +0017cdf0: 652c 2073 6565 2053 6563 7469 6f6e 203c e, see Section < │ │ │ │ +0017ce00: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ +0017ce10: 663d 2269 6e64 6578 2e68 746d 6c23 6b65 f="index.html#ke │ │ │ │ +0017ce20: 6570 616c 6976 6522 3e54 4350 2061 6e64 epalive">TCP and │ │ │ │ +0017ce30: 2048 5454 5020 6b65 6570 2d61 6c69 7665 HTTP keep-alive │ │ │ │ +0017ce40: 3c2f 613e 202c 2077 6865 6e20 7468 6520 , when the │ │ │ │ +0017ce50: 636c 6965 6e74 206e 6565 6473 2074 6f20 client needs to │ │ │ │ +0017ce60: 6d61 6b65 2061 2073 6572 6965 7320 6f66 make a series of │ │ │ │ +0017ce70: 2063 616c 6c73 2074 6f20 7468 6520 7361 calls to the sa │ │ │ │ +0017ce80: 6d65 2073 6572 7665 722e 2053 6572 7665 me server. Serve │ │ │ │ +0017ce90: 722d 7369 6465 206b 6565 702d 616c 6976 r-side keep-aliv │ │ │ │ +0017cea0: 6520 7375 7070 6f72 7420 6361 6e20 6772 e support can gr │ │ │ │ +0017ceb0: 6561 746c 7920 696d 7072 6f76 6520 7065 eatly improve pe │ │ │ │ +0017cec0: 7266 6f72 6d61 6e63 6520 6f66 2062 6f74 rformance of bot │ │ │ │ +0017ced0: 6820 636c 6965 6e74 2061 6e64 2073 6572 h client and ser │ │ │ │ +0017cee0: 7665 722e 2042 7574 2062 6520 6177 6172 ver. But be awar │ │ │ │ +0017cef0: 6520 7468 6174 2063 6c69 656e 7473 2061 e that clients a │ │ │ │ +0017cf00: 6e64 2073 6572 7669 6365 7320 756e 6465 nd services unde │ │ │ │ +0017cf10: 7220 556e 6978 2f4c 696e 7578 2072 6571 r Unix/Linux req │ │ │ │ +0017cf20: 7569 7265 2073 6967 6e61 6c20 6861 6e64 uire signal hand │ │ │ │ +0017cf30: 6c65 7273 2074 6f20 6361 7463 6820 6472 lers to catch dr │ │ │ │ +0017cf40: 6f70 7065 6420 636f 6e6e 6563 7469 6f6e opped connection │ │ │ │ +0017cf50: 732e 3c2f 6c69 3e0a 3c6c 693e 5573 6520 s.
    • .
    • Use │ │ │ │ +0017cf60: 4854 5450 2063 6875 6e6b 6564 2074 7261 HTTP chunked tra │ │ │ │ +0017cf70: 6e73 6665 7273 2c20 7365 6520 5365 6374 nsfers, see Sect │ │ │ │ +0017cf80: 696f 6e20 3c61 2063 6c61 7373 3d22 656c ion HTTP │ │ │ │ +0017cfb0: 2063 6875 6e6b 6564 2074 7261 6e73 6665 chunked transfe │ │ │ │ +0017cfc0: 7220 656e 636f 6469 6e67 3c2f 613e 202e r encoding . │ │ │ │ +0017cfd0: 3c2f 6c69 3e0a 3c6c 693e 446f 206e 6f74
    • .
    • Do not │ │ │ │ +0017cfe0: 2075 7365 2067 7a69 7020 636f 6d70 7265 use gzip compre │ │ │ │ +0017cff0: 7373 696f 6e2c 2073 696e 6365 2074 6865 ssion, since the │ │ │ │ +0017d000: 206f 7665 7268 6561 6420 6f66 2063 6f6d overhead of com │ │ │ │ +0017d010: 7072 6573 7369 6f6e 2069 7320 7479 7069 pression is typi │ │ │ │ +0017d020: 6361 6c6c 7920 6869 6768 6572 2074 6861 cally higher tha │ │ │ │ +0017d030: 6e20 7468 6520 6261 6e64 7769 6474 6820 n the bandwidth │ │ │ │ +0017d040: 6761 696e 732e 3c2f 6c69 3e0a 3c6c 693e gains.
    • .
    • │ │ │ │ +0017d050: 5365 7420 7468 6520 3c63 6f64 653e 2353 Set the #S │ │ │ │ +0017d060: 4f41 505f 584d 4c5f 5452 4545 3c2f 636f OAP_XML_TREE flag to disa │ │ │ │ +0017d080: 626c 6520 6964 2d72 6566 206d 756c 7469 ble id-ref multi │ │ │ │ +0017d090: 2d72 6566 206f 626a 6563 7420 7365 7269 -ref object seri │ │ │ │ +0017d0a0: 616c 697a 6174 696f 6e2e 2054 6869 7320 alization. This │ │ │ │ +0017d0b0: 626f 6f73 7473 2070 6572 666f 726d 616e boosts performan │ │ │ │ +0017d0c0: 6365 2073 6967 6e69 6669 6361 6e74 6c79 ce significantly │ │ │ │ +0017d0d0: 2061 6e64 2077 6f72 6b73 2077 6974 6820 and works with │ │ │ │ +0017d0e0: 534f 4150 2064 6f63 756d 656e 742f 6c69 SOAP document/li │ │ │ │ +0017d0f0: 7465 7261 6c20 7374 796c 6520 2869 2e65 teral style (i.e │ │ │ │ +0017d100: 2e20 6e6f 2069 642d 7265 6620 6772 6170 . no id-ref grap │ │ │ │ +0017d110: 6820 7365 7269 616c 697a 6174 696f 6e20 h serialization │ │ │ │ +0017d120: 6173 2072 6571 7569 7265 6420 7769 7468 as required with │ │ │ │ +0017d130: 2053 4f41 5020 656e 636f 6469 6e67 2073 SOAP encoding s │ │ │ │ +0017d140: 7479 6c65 292e 2044 6f20 6e6f 7420 7573 tyle). Do not us │ │ │ │ +0017d150: 6520 7468 6973 2066 6f72 2053 4f41 5020 e this for SOAP │ │ │ │ +0017d160: 5250 4320 656e 636f 6465 6420 6d65 7373 RPC encoded mess │ │ │ │ +0017d170: 6167 696e 672e 3c2f 6c69 3e0a 3c6c 693e aging.
    • .
    • │ │ │ │ +0017d180: 436f 6d70 696c 6520 3c65 6d3e 3c63 6f64 Compile gsoap/stdsoap2 │ │ │ │ +0017d1a0: 2e63 3c2f 636f 6465 3e3c 2f65 6d3e 2061 .c a │ │ │ │ +0017d1b0: 6e64 203c 656d 3e3c 636f 6465 3e67 736f nd gso │ │ │ │ +0017d1c0: 6170 2f73 7464 736f 6170 322e 6370 703c ap/stdsoap2.cpp< │ │ │ │ +0017d1d0: 2f63 6f64 653e 3c2f 656d 3e20 616e 6420 /code> and │ │ │ │ +0017d1e0: 616c 6c20 6f74 6865 7220 736f 7572 6365 all other source │ │ │ │ +0017d1f0: 2063 6f64 6573 2077 6974 6820 7468 6520 codes with the │ │ │ │ +0017d200: 636f 6d70 696c 6520 7469 6d65 2066 6c61 compile time fla │ │ │ │ +0017d210: 6720 3c63 6f64 653e 2357 4954 485f 4e4f g #WITH_NO │ │ │ │ +0017d220: 4944 5245 463c 2f63 6f64 653e 2074 6f20 IDREF to │ │ │ │ +0017d230: 696d 7072 6f76 6520 7065 7266 6f72 6d61 improve performa │ │ │ │ +0017d240: 6e63 6520 6576 656e 2062 6574 7465 7220 nce even better │ │ │ │ +0017d250: 6279 2070 6572 6d61 6e65 6e74 6c79 2064 by permanently d │ │ │ │ +0017d260: 6973 6162 6c69 6e67 2069 642d 7265 6620 isabling id-ref │ │ │ │ +0017d270: 6d75 6c74 692d 7265 6620 6f62 6a65 6374 multi-ref object │ │ │ │ +0017d280: 2073 6572 6961 6c69 7a61 7469 6f6e 2e20 serialization. │ │ │ │ +0017d290: 446f 206e 6f74 2075 7365 2074 6869 7320 Do not use this │ │ │ │ +0017d2a0: 666f 7220 534f 4150 2052 5043 2065 6e63 for SOAP RPC enc │ │ │ │ +0017d2b0: 6f64 6564 206d 6573 7361 6769 6e67 2e3c oded messaging.< │ │ │ │ +0017d2c0: 2f6c 693e 0a3c 6c69 3e44 6f20 6e6f 7420 /li>.
    • Do not │ │ │ │ +0017d2d0: 7573 6520 4445 4255 4720 6d6f 6465 2c20 use DEBUG mode, │ │ │ │ +0017d2e0: 7369 6e63 6520 7468 6520 6f76 6572 6865 since the overhe │ │ │ │ +0017d2f0: 6164 206f 6620 6c6f 6767 696e 6720 6973 ad of logging is │ │ │ │ +0017d300: 2073 6967 6e69 6669 6361 6e74 2e3c 2f6c significant..
    .

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

    .< │ │ │ │ +0017d350: 6832 3e3c 6120 636c 6173 733d 2261 6e63 h2>.Safety gua │ │ │ │ +0017d380: 7264 733c 2f68 323e 0a3c 703e 5468 6520 rds

    .

    The │ │ │ │ +0017d390: 666f 6c6c 6f77 696e 6720 7365 7474 696e following settin │ │ │ │ +0017d3a0: 6773 2061 7265 2069 6d70 6f72 7461 6e74 gs are important │ │ │ │ +0017d3b0: 2074 6f20 656e 7375 7265 2074 6861 7420 to ensure that │ │ │ │ +0017d3c0: 584d 4c20 6d65 7373 6167 696e 6720 6973 XML messaging is │ │ │ │ +0017d3d0: 2073 6166 6520 6279 2064 6566 696e 696e safe by definin │ │ │ │ +0017d3e0: 6720 7265 6173 6f6e 6162 6c65 2058 4d4c g reasonable XML │ │ │ │ +0017d3f0: 206d 6573 7361 6765 2072 6573 7472 6963 message restric │ │ │ │ +0017d400: 7469 6f6e 732e 2041 6c73 6f20 6d65 7373 tions. Also mess │ │ │ │ +0017d410: 6167 696e 6720 7469 6d65 6f75 7473 2073 aging timeouts s │ │ │ │ +0017d420: 686f 756c 6420 6265 2073 6574 2061 7320 hould be set as │ │ │ │ +0017d430: 6578 706c 6169 6e65 6420 696e 2053 6563 explained in Sec │ │ │ │ +0017d440: 7469 6f6e 203c 6120 636c 6173 733d 2265 tion Tim │ │ │ │ +0017d470: 656f 7574 206d 616e 6167 656d 656e 7420 eout management │ │ │ │ +0017d480: 666f 7220 6e6f 6e2d 626c 6f63 6b69 6e67 for non-blocking │ │ │ │ +0017d490: 206f 7065 7261 7469 6f6e 733c 2f61 3e2e operations. │ │ │ │ +0017d4a0: 3c2f 703e 0a3c 703e 5468 6520 584d 4c20

    .

    The XML │ │ │ │ +0017d4b0: 7061 7273 6572 2069 7320 636f 6e66 6967 parser is config │ │ │ │ +0017d4c0: 7572 6564 2074 6f20 7265 7374 7269 6374 ured to restrict │ │ │ │ +0017d4d0: 2074 6865 2058 4d4c 206e 6573 7469 6e67 the XML nesting │ │ │ │ +0017d4e0: 2064 6570 7468 206c 6576 656c 2074 6f20 depth level to │ │ │ │ +0017d4f0: 3c63 6f64 653e 2353 4f41 505f 4d41 584c #SOAP_MAXL │ │ │ │ +0017d500: 4556 454c 3c2f 636f 6465 3e20 616e 6420 EVEL and │ │ │ │ +0017d510: 7265 7374 7269 6374 7320 7468 6520 7265 restricts the re │ │ │ │ +0017d520: 7065 6174 6564 206f 6363 7572 7265 6e63 peated occurrenc │ │ │ │ +0017d530: 6520 6f66 2065 6c65 6d65 6e74 7320 7468 e of elements th │ │ │ │ +0017d540: 6174 2061 7265 2064 6573 6572 6961 6c69 at are deseriali │ │ │ │ +0017d550: 7a65 6420 696e 746f 2061 7272 6179 7320 zed into arrays │ │ │ │ +0017d560: 616e 6420 636f 6e74 6169 6e65 7273 2062 and containers b │ │ │ │ +0017d570: 7920 3c63 6f64 653e 2353 4f41 505f 4d41 y #SOAP_MA │ │ │ │ +0017d580: 584f 4343 5552 533c 2f63 6f64 653e 2e20 XOCCURS. │ │ │ │ +0017d590: 5468 6573 6520 6d61 6372 6f73 2063 616e These macros can │ │ │ │ +0017d5a0: 2062 6520 6368 616e 6765 642c 2062 7574 be changed, but │ │ │ │ +0017d5b0: 2079 6f75 2063 616e 2061 6c73 6f20 6368 you can also ch │ │ │ │ +0017d5c0: 616e 6765 2074 6865 2066 6f6c 6c6f 7769 ange the followi │ │ │ │ +0017d5d0: 6e67 2063 6f6e 7465 7874 2061 7474 7269 ng context attri │ │ │ │ +0017d5e0: 6275 7465 7320 6174 2072 756e 2d74 696d butes at run-tim │ │ │ │ +0017d5f0: 652c 2065 2e67 2e20 746f 2065 6e68 616e e, e.g. to enhan │ │ │ │ +0017d600: 6365 2074 6865 2073 6166 6574 7920 666f ce the safety fo │ │ │ │ +0017d610: 7220 7370 6563 6966 6963 2073 6572 7669 r specific servi │ │ │ │ +0017d620: 6365 2061 6e64 2f6f 7220 636c 6965 6e74 ce and/or client │ │ │ │ +0017d630: 206f 7065 7261 7469 6f6e 733a 3c2f 703e operations:

    │ │ │ │ +0017d640: 0a3c 756c 3e0a 3c6c 693e 3c63 6f64 653e .
    .

    X │ │ │ │ +0017dce0: 4d4c 2073 6368 656d 6120 7661 6c69 6461 ML schema valida │ │ │ │ +0017dcf0: 7469 6f6e 2063 6f6e 7374 7261 696e 7473 tion constraints │ │ │ │ +0017dd00: 2061 7265 2065 6e66 6f72 6365 6420 7769 are enforced wi │ │ │ │ +0017dd10: 7468 2074 6865 203c 636f 6465 3e23 534f th the #SO │ │ │ │ +0017dd20: 4150 5f58 4d4c 5f53 5452 4943 543c 2f63 AP_XML_STRICT context fla │ │ │ │ +0017dd40: 672e 2054 6865 2073 6368 656d 6120 6d61 g. The schema ma │ │ │ │ +0017dd50: 784c 656e 6774 6820 7661 6c69 6461 7469 xLength validati │ │ │ │ +0017dd60: 6f6e 2063 6f6e 7374 7261 696e 7420 6f76 on constraint ov │ │ │ │ +0017dd70: 6572 7275 6c65 7320 7468 6520 3c63 6f64 errules the soap::maxle │ │ │ │ +0017de40: 6e67 7468 3c2f 613e 3c2f 636f 6465 3e20 ngth │ │ │ │ +0017de50: 6775 6172 642e 2054 6865 2073 6368 656d guard. The schem │ │ │ │ +0017de60: 6120 6d61 784f 6363 7572 7320 7661 6c69 a maxOccurs vali │ │ │ │ +0017de70: 6461 7469 6f6e 2063 6f6e 7374 7261 696e dation constrain │ │ │ │ +0017de80: 7420 646f 6573 206e 6f74 206f 7665 7272 t does not overr │ │ │ │ +0017de90: 756c 6520 7468 6520 3c63 6f64 653e 3c61 ule the soap::maxo │ │ │ │ +0017df60: 6363 7572 733c 2f61 3e3c 2f63 6f64 653e ccurs │ │ │ │ +0017df70: 2067 7561 7264 2c20 736f 2061 7272 6179 guard, so array │ │ │ │ +0017df80: 7320 616e 6420 636f 6e74 6169 6e65 7273 s and containers │ │ │ │ +0017df90: 2061 7265 2061 6c77 6179 7320 7265 7374 are always rest │ │ │ │ +0017dfa0: 7269 6374 6564 2069 6e20 6c65 6e67 7468 ricted in length │ │ │ │ +0017dfb0: 2062 7920 7468 6973 2067 7561 7264 2e3c by this guard.< │ │ │ │ +0017dfc0: 2f70 3e0a 3c70 3e4f 7468 6572 2063 6f6d /p>.

    Other com │ │ │ │ +0017dfd0: 7069 6c65 2d74 696d 6520 636f 6e66 6967 pile-time config │ │ │ │ +0017dfe0: 7572 6174 696f 6e20 7365 7474 696e 6773 uration settings │ │ │ │ +0017dff0: 2061 7265 3a3c 2f70 3e0a 3c75 6c3e 0a3c are:

    .
      .< │ │ │ │ +0017e000: 6c69 3e3c 636f 6465 3e23 534f 4150 5f4d li>#SOAP_M │ │ │ │ +0017e010: 4158 414c 4c4f 4353 495a 453c 2f63 6f64 AXALLOCSIZE the maximum s │ │ │ │ +0017e030: 697a 6520 6f66 2061 2062 6c6f 636b 206f ize of a block o │ │ │ │ +0017e040: 6620 6d65 6d6f 7279 2074 6861 7420 3c63 f memory that malloc can allocate.< │ │ │ │ +0017e070: 2f6c 693e 0a3c 6c69 3e3c 636f 6465 3e23 /li>.
    • # │ │ │ │ +0017e080: 534f 4150 5f4d 4158 4152 5241 5953 495a SOAP_MAXARRAYSIZ │ │ │ │ +0017e090: 453c 2f63 6f64 653e 2074 6865 206d 6178 E the max │ │ │ │ +0017e0a0: 696d 756d 2061 6c6c 6f63 6174 696f 6e20 imum allocation │ │ │ │ +0017e0b0: 7468 7265 7368 6f6c 6420 746f 2070 7265 threshold to pre │ │ │ │ +0017e0c0: 2d61 6c6c 6f63 6174 6520 534f 4150 2061 -allocate SOAP a │ │ │ │ +0017e0d0: 7272 6179 7320 696e 206d 656d 6f72 792e rrays in memory. │ │ │ │ +0017e0e0: 3c2f 6c69 3e0a 3c6c 693e 3c63 6f64 653e
    • .
    • │ │ │ │ +0017e0f0: 2353 4f41 505f 4d41 5844 494d 4553 495a #SOAP_MAXDIMESIZ │ │ │ │ +0017e100: 453c 2f63 6f64 653e 2074 6865 206d 6178 E the max │ │ │ │ +0017e110: 696d 756d 2044 494d 4520 6174 7461 6368 imum DIME attach │ │ │ │ +0017e120: 6d65 6e74 2073 697a 6520 616c 6c6f 7765 ment size allowe │ │ │ │ +0017e130: 6420 746f 2072 6563 6569 7665 2e3c 2f6c d to receive..
    • #SO │ │ │ │ +0017e150: 4150 5f4d 4158 4549 4e54 523c 2f63 6f64 AP_MAXEINTR maximum numbe │ │ │ │ +0017e170: 7220 6f66 2045 494e 5452 2069 6e74 6572 r of EINTR inter │ │ │ │ +0017e180: 7275 7074 7320 746f 2069 676e 6f72 6520 rupts to ignore │ │ │ │ +0017e190: 7768 696c 6520 706f 6c6c 696e 6720 6120 while polling a │ │ │ │ +0017e1a0: 736f 636b 6574 2066 6f72 2070 656e 6469 socket for pendi │ │ │ │ +0017e1b0: 6e67 2061 6374 6976 6974 792e 3c2f 6c69 ng activity.
    • .
    .

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

    ..Timeout ma │ │ │ │ +0017e230: 6e61 6765 6d65 6e74 2066 6f72 206e 6f6e nagement for non │ │ │ │ +0017e240: 2d62 6c6f 636b 696e 6720 6f70 6572 6174 -blocking operat │ │ │ │ +0017e250: 696f 6e73 3c2f 6832 3e0a 3c70 3e53 6f63 ions.

    Soc │ │ │ │ +0017e260: 6b65 7420 636f 6e6e 6563 742c 2061 6363 ket connect, acc │ │ │ │ +0017e270: 6570 742c 2073 656e 642c 2061 6e64 2072 ept, send, and r │ │ │ │ +0017e280: 6563 6569 7665 2074 696d 656f 7574 2076 eceive timeout v │ │ │ │ +0017e290: 616c 7565 7320 6361 6e20 6265 2073 6574 alues can be set │ │ │ │ +0017e2a0: 2074 6f20 6d61 6e61 6765 2073 6f63 6b65 to manage socke │ │ │ │ +0017e2b0: 7420 636f 6d6d 756e 6963 6174 696f 6e20 t communication │ │ │ │ +0017e2c0: 7469 6d65 6f75 7473 2e20 5468 6520 3c63 timeouts. The soap │ │ │ │ +0017e390: 3a3a 636f 6e6e 6563 745f 7469 6d65 6f75 ::connect_timeou │ │ │ │ +0017e3a0: 743c 2f61 3e3c 2f63 6f64 653e 2c20 3c63 t, soap │ │ │ │ +0017e470: 3a3a 6163 6365 7074 5f74 696d 656f 7574 ::accept_timeout │ │ │ │ +0017e480: 3c2f 613e 3c2f 636f 6465 3e2c 203c 636f , soap: │ │ │ │ +0017e540: 3a73 656e 645f 7469 6d65 6f75 743c 2f61 :send_timeout, │ │ │ │ +0017e560: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap: │ │ │ │ +0017e610: 3a72 6563 765f 7469 6d65 6f75 743c 2f61 :recv_timeout and soap::tra │ │ │ │ +0017e6f0: 6e73 6665 725f 7469 6d65 6f75 743c 2f61 nsfer_timeout context │ │ │ │ +0017e710: 2061 7474 7269 6275 7465 7320 6f66 2074 attributes of t │ │ │ │ +0017e720: 6865 2063 7572 7265 6e74 2063 6f6e 7465 he current conte │ │ │ │ +0017e730: 7874 203c 636f 6465 3e3c 6120 636c 6173 xt soap can be set │ │ │ │ +0017e7a0: 746f 2074 6865 2061 7070 726f 7072 6961 to the appropria │ │ │ │ +0017e7b0: 7465 2075 7365 722d 6465 6669 6e65 6420 te user-defined │ │ │ │ +0017e7c0: 736f 636b 6574 2073 656e 642c 2072 6563 socket send, rec │ │ │ │ +0017e7d0: 6569 7665 2c20 616e 6420 6163 6365 7074 eive, and accept │ │ │ │ +0017e7e0: 2074 696d 656f 7574 2076 616c 7565 732e timeout values. │ │ │ │ +0017e7f0: 2041 2070 6f73 6974 6976 6520 7661 6c75 A positive valu │ │ │ │ +0017e800: 6520 6d65 6173 7572 6573 2074 6865 2074 e measures the t │ │ │ │ +0017e810: 696d 656f 7574 2069 6e20 7365 636f 6e64 imeout in second │ │ │ │ +0017e820: 732e 2041 206e 6567 6174 6976 6520 7469 s. A negative ti │ │ │ │ +0017e830: 6d65 6f75 7420 7661 6c75 6520 6d65 6173 meout value meas │ │ │ │ +0017e840: 7572 6573 2074 6865 2074 696d 656f 7574 ures the timeout │ │ │ │ +0017e850: 2069 6e20 6d69 6372 6f73 6563 6f6e 6473 in microseconds │ │ │ │ +0017e860: 2028 3130 5e2d 3620 7365 6329 2e3c 2f70 (10^-6 sec).

    .

    The < │ │ │ │ +0017e880: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ +0017e890: 663d 2273 7472 7563 7473 6f61 702e 6874 f="structsoap.ht │ │ │ │ +0017e8a0: 6d6c 2361 6633 3262 3566 3339 3735 6561 ml#af32b5f3975ea │ │ │ │ +0017e8b0: 6332 6264 3132 3032 3537 3135 3135 3835 c2bd120257151585 │ │ │ │ +0017e8c0: 3931 3633 2220 7469 746c 653d 2255 7365 9163" title="Use │ │ │ │ +0017e8d0: 722d 6465 6669 6e61 626c 6520 7469 6d65 r-definable time │ │ │ │ +0017e8e0: 6f75 7420 7768 656e 2077 6169 7469 6e67 out when waiting │ │ │ │ +0017e8f0: 2074 6f20 636f 6e6e 6563 7420 746f 2061 to connect to a │ │ │ │ +0017e900: 2073 6572 7665 7220 6174 2074 6865 2063 server at the c │ │ │ │ +0017e910: 6c69 656e 742d 7369 6465 2c20 706f 7369 lient-side, posi │ │ │ │ +0017e920: 7469 7665 2074 696d 656f 7574 2076 616c tive timeout val │ │ │ │ +0017e930: 7565 2e2e 2e22 3e73 6f61 703a 3a63 6f6e ue...">soap::con │ │ │ │ +0017e940: 6e65 6374 5f74 696d 656f 7574 3c2f 613e nect_timeout │ │ │ │ +0017e950: 3c2f 636f 6465 3e20 7370 6563 6966 6965 specifie │ │ │ │ +0017e960: 7320 7468 6520 7469 6d65 6f75 7420 666f s the timeout fo │ │ │ │ +0017e970: 7220 3c63 6f64 653e 736f 6170 5f63 616c r soap_cal │ │ │ │ +0017e980: 6c5f 6e73 5f5f 7765 626d 6574 686f 643c l_ns__webmethod< │ │ │ │ +0017e990: 2f63 6f64 653e 2073 7475 6220 6675 6e63 /code> stub func │ │ │ │ +0017e9a0: 7469 6f6e 2063 616c 6c73 2061 6e64 2066 tion calls and f │ │ │ │ +0017e9b0: 6f72 2043 2b2b 2070 726f 7879 2063 6c61 or C++ proxy cla │ │ │ │ +0017e9c0: 7373 2063 616c 6c73 2e3c 2f70 3e0a 3c70 ss calls.

    .

    The soap::accept_ │ │ │ │ +0017eaa0: 7469 6d65 6f75 743c 2f61 3e3c 2f63 6f64 timeout specifies the │ │ │ │ +0017eac0: 2074 696d 656f 7574 2066 6f72 203c 636f timeout for soap │ │ │ │ +0017eb50: 5f61 6363 6570 743c 2f61 3e3c 2f63 6f64 _accept calls.

    .

    The soap::send_ti │ │ │ │ +0017ec30: 6d65 6f75 743c 2f61 3e3c 2f63 6f64 653e meout │ │ │ │ +0017ec40: 2061 6e64 203c 636f 6465 3e3c 6120 636c and soap::recv │ │ │ │ +0017ed00: 5f74 696d 656f 7574 3c2f 613e 3c2f 636f _timeout specify the │ │ │ │ +0017ed20: 7469 6d65 6f75 7420 666f 7220 6e6f 6e2d timeout for non- │ │ │ │ +0017ed30: 626c 6f63 6b69 6e67 2073 6f63 6b65 7420 blocking socket │ │ │ │ +0017ed40: 492f 4f20 6f70 6572 6174 696f 6e73 2e20 I/O operations. │ │ │ │ +0017ed50: 5468 6973 2069 7320 7468 6520 6d61 7869 This is the maxi │ │ │ │ +0017ed60: 6d75 6d20 6465 6c61 7920 6f6e 2074 6865 mum delay on the │ │ │ │ +0017ed70: 2073 6f63 6b65 7420 6f70 6572 6174 696f socket operatio │ │ │ │ +0017ed80: 6e20 7065 726d 6974 7465 642e 3c2f 703e n permitted.

    │ │ │ │ +0017ed90: 0a3c 703e 5468 6520 3c63 6f64 653e 3c61 .

    The soap::transfer │ │ │ │ +0017ee60: 5f74 696d 656f 7574 3c2f 613e 3c2f 636f _timeout is new since │ │ │ │ +0017ee80: 2032 2e38 2e34 3820 616e 6420 6c69 6d69 2.8.48 and limi │ │ │ │ +0017ee90: 7473 2074 6865 2074 696d 6520 6120 6d65 ts the time a me │ │ │ │ +0017eea0: 7373 6167 6520 7365 6e64 2061 6e64 2061 ssage send and a │ │ │ │ +0017eeb0: 206d 6573 7361 6765 2072 6563 6569 7665 message receive │ │ │ │ +0017eec0: 206f 7065 7261 7469 6f6e 2063 616e 2074 operation can t │ │ │ │ +0017eed0: 616b 652e 2054 6869 7320 7661 6c75 6520 ake. This value │ │ │ │ +0017eee0: 7368 6f75 6c64 2062 6520 7573 6564 2069 should be used i │ │ │ │ +0017eef0: 6e20 636f 6d62 696e 6174 696f 6e20 7769 n combination wi │ │ │ │ +0017ef00: 7468 203c 636f 6465 3e3c 6120 636c 6173 th soap::send_time │ │ │ │ +0017efc0: 6f75 743c 2f61 3e3c 2f63 6f64 653e 2061 out a │ │ │ │ +0017efd0: 6e64 203c 636f 6465 3e3c 6120 636c 6173 nd soap::recv_t │ │ │ │ +0017f090: 696d 656f 7574 3c2f 613e 3c2f 636f 6465 imeout for accurate t │ │ │ │ +0017f0b0: 696d 656f 7574 2063 6f6e 7472 6f6c 2e20 imeout control. │ │ │ │ +0017f0c0: 5468 6520 3c63 6f64 653e 3c61 2063 6c61 The soap::recv_max │ │ │ │ +0017f190: 6c65 6e67 7468 3c2f 613e 3c2f 636f 6465 length value when non │ │ │ │ +0017f1b0: 2d7a 6572 6f20 6c69 6d69 7473 2074 6865 -zero limits the │ │ │ │ +0017f1c0: 206c 656e 6774 6820 6f66 206d 6573 7361 length of messa │ │ │ │ +0017f1d0: 6765 7320 7468 6174 2063 616e 2062 6520 ges that can be │ │ │ │ +0017f1e0: 7265 6365 6976 6564 2069 6e20 6279 7465 received in byte │ │ │ │ +0017f1f0: 7320 696e 2074 6f74 616c 2069 6e20 6465 s in total in de │ │ │ │ +0017f200: 636f 6d70 7265 7373 6564 2066 6f72 6d20 compressed form │ │ │ │ +0017f210: 286d 6573 7361 6765 206c 656e 6774 6820 (message length │ │ │ │ +0017f220: 696e 636c 7564 6573 2048 5454 5020 6865 includes HTTP he │ │ │ │ +0017f230: 6164 6572 7320 616e 6420 4854 5450 2063 aders and HTTP c │ │ │ │ +0017f240: 6875 6e6b 2073 697a 6520 6669 656c 6473 hunk size fields │ │ │ │ +0017f250: 292e 2054 6865 2076 616c 7565 206f 6620 ). The value of │ │ │ │ +0017f260: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 so │ │ │ │ +0017f320: 6170 3a3a 7265 6376 5f6d 6178 6c65 6e67 ap::recv_maxleng │ │ │ │ +0017f330: 7468 3c2f 613e 3c2f 636f 6465 3e20 6973 th is │ │ │ │ +0017f340: 2032 4742 2062 7920 6465 6661 756c 742e 2GB by default. │ │ │ │ +0017f350: 3c2f 703e 0a3c 703e 4578 616d 706c 653a

    .

    Example: │ │ │ │ +0017f360: 3c2f 703e 0a3c 6469 7620 636c 6173 733d

    .
    struct soap │ │ │ │ +0017f3e0: 202a 3c61 2063 6c61 7373 3d22 636f 6465 *soap = soap_ne │ │ │ │ +0017f470: 773c 2f61 3e28 293b 203c 2f64 6976 3e0a w();
    . │ │ │ │ +0017f480: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    soap->s │ │ │ │ +0017f510: 656e 645f 7469 6d65 6f75 743c 2f61 3e20 end_timeout │ │ │ │ +0017f520: 3d20 3130 3b20 3c2f 6469 763e 0a3c 6469 = 10;
    .< │ │ │ │ +0017f540: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +0017f550: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ +0017f560: 6874 6d6c 223e 736f 6170 3c2f 613e 2d26 html">soap-& │ │ │ │ +0017f570: 6774 3b3c 6120 636c 6173 733d 2263 6f64 gt;recv │ │ │ │ +0017f5c0: 5f74 696d 656f 7574 3c2f 613e 203d 2031 _timeout = 1 │ │ │ │ +0017f5d0: 303b 203c 2f64 6976 3e0a 3c64 6976 2063 0;
    .
    soap-> │ │ │ │ +0017f620: 3c61 2063 6c61 7373 3d22 636f 6465 2220 recv_ti │ │ │ │ +0017f670: 6d65 6f75 743c 2f61 3e20 3d20 3630 3b20 meout = 60; │ │ │ │ +0017f680: 3c2f 6469 763e 0a3c 2f64 6976 3e3c 212d
    .

    This will resul │ │ │ │ +0017f6b0: 7420 696e 2061 2074 696d 656f 7574 2069 t in a timeout i │ │ │ │ +0017f6c0: 6620 6e6f 2064 6174 6120 6361 6e20 6265 f no data can be │ │ │ │ +0017f6d0: 2073 656e 6420 696e 2031 3020 7365 636f send in 10 seco │ │ │ │ +0017f6e0: 6e64 7320 616e 6420 6e6f 2064 6174 6120 nds and no data │ │ │ │ +0017f6f0: 6973 2072 6563 6569 7665 6420 7769 7468 is received with │ │ │ │ +0017f700: 696e 2031 3020 7365 636f 6e64 7320 6166 in 10 seconds af │ │ │ │ +0017f710: 7465 7220 696e 6974 6961 7469 6e67 2061 ter initiating a │ │ │ │ +0017f720: 2073 656e 6420 6f72 2072 6563 6569 7665 send or receive │ │ │ │ +0017f730: 206f 7065 7261 7469 6f6e 206f 7665 7220 operation over │ │ │ │ +0017f740: 7468 6520 736f 636b 6574 2e20 4120 7661 the socket. A va │ │ │ │ +0017f750: 6c75 6520 6f66 207a 6572 6f20 6469 7361 lue of zero disa │ │ │ │ +0017f760: 626c 6573 2074 696d 656f 7574 2c20 666f bles timeout, fo │ │ │ │ +0017f770: 7220 6578 616d 706c 653a 3c2f 703e 0a3c r example:

    .< │ │ │ │ +0017f780: 6469 7620 636c 6173 733d 2266 7261 676d div class="fragm │ │ │ │ +0017f790: 656e 7422 3e3c 6469 7620 636c 6173 733d ent">
    str │ │ │ │ +0017f7c0: 7563 7420 3c2f 7370 616e 3e3c 6120 636c uct soap *soap = soap_new( │ │ │ │ +0017f890: 293b 203c 2f64 6976 3e0a 3c64 6976 2063 );
    .
    soap-> │ │ │ │ +0017f8e0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 send_ti │ │ │ │ +0017f930: 6d65 6f75 743c 2f61 3e20 3d20 303b 203c meout = 0; < │ │ │ │ +0017f940: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    s │ │ │ │ +0017f980: 6f61 703c 2f61 3e2d 2667 743b 3c61 2063 oap->recv_timeou │ │ │ │ +0017f9e0: 743c 2f61 3e20 3d20 303b 2020 3c2f 6469 t = 0; ..< │ │ │ │ +0017faa0: 2f64 6976 3e3c 212d 2d20 6672 6167 6d65 /div>

    When a │ │ │ │ +0017fac0: 7469 6d65 6f75 7420 6f63 6375 7273 2069 timeout occurs i │ │ │ │ +0017fad0: 6e20 7468 6520 7365 6e64 206f 7220 7265 n the send or re │ │ │ │ +0017fae0: 6365 6976 6520 6f70 6572 6174 696f 6e73 ceive operations │ │ │ │ +0017faf0: 2c20 6120 3c63 6f64 653e 2353 4f41 505f , a #SOAP_ │ │ │ │ +0017fb00: 454f 463c 2f63 6f64 653e 2065 7863 6570 EOF excep │ │ │ │ +0017fb10: 7469 6f6e 2077 696c 6c20 6265 2072 6169 tion will be rai │ │ │ │ +0017fb20: 7365 6420 2822 656e 6420 6f66 2066 696c sed ("end of fil │ │ │ │ +0017fb30: 6520 6f72 206e 6f20 696e 7075 7422 292e e or no input"). │ │ │ │ +0017fb40: 204e 6567 6174 6976 6520 7469 6d65 6f75 Negative timeou │ │ │ │ +0017fb50: 7420 7661 6c75 6573 206d 6561 7375 7265 t values measure │ │ │ │ +0017fb60: 2074 696d 656f 7574 7320 696e 206d 6963 timeouts in mic │ │ │ │ +0017fb70: 726f 7365 636f 6e64 732c 2066 6f72 2065 roseconds, for e │ │ │ │ +0017fb80: 7861 6d70 6c65 3a3c 2f70 3e0a 3c64 6976 xample:

    .
    # │ │ │ │ +0017fbd0: 6465 6669 6e65 2075 5365 6320 2a2d 3120 define uSec *-1 │ │ │ │ +0017fbe0: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ │ +0017fc00: 3c73 7061 6e20 636c 6173 733d 2270 7265 #defi │ │ │ │ +0017fc20: 6e65 206d 5365 6320 2a2d 3130 3030 203c ne mSec *-1000 < │ │ │ │ +0017fc30: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    . │ │ │ │ +0017fc50: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    s │ │ │ │ +0017fc80: 7472 7563 7420 3c2f 7370 616e 3e3c 6120 truct soap *soap = │ │ │ │ +0017fcf0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap_new();
    .
    soap-&g │ │ │ │ +0017fda0: 743b 3c61 2063 6c61 7373 3d22 636f 6465 t;accep │ │ │ │ +0017fdf0: 745f 7469 6d65 6f75 743c 2f61 3e20 3d20 t_timeout = │ │ │ │ +0017fe00: 3130 2075 5365 633b 203c 2f64 6976 3e0a 10 uSec;
    . │ │ │ │ +0017fe10: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    soap->s │ │ │ │ +0017fea0: 656e 645f 7469 6d65 6f75 743c 2f61 3e20 end_timeout │ │ │ │ +0017feb0: 3d20 3230 206d 5365 633b 203c 2f64 6976 = 20 mSec;
    .
    Warning
    Many Linu │ │ │ │ +00180070: 7820 7665 7273 696f 6e73 2064 6f20 6e6f x versions do no │ │ │ │ +00180080: 7420 7375 7070 6f72 7420 6e6f 6e2d 626c t support non-bl │ │ │ │ +00180090: 6f63 6b69 6e67 203c 636f 6465 3e63 6f6e ocking con │ │ │ │ +001800a0: 6e65 6374 2829 3c2f 636f 6465 3e2e 2054 nect(). T │ │ │ │ +001800b0: 6865 7265 666f 7265 2c20 7365 7474 696e herefore, settin │ │ │ │ +001800c0: 6720 3c63 6f64 653e 3c61 2063 6c61 7373 g │ │ │ │ +00180180: 736f 6170 3a3a 636f 6e6e 6563 745f 7469 soap::connect_ti │ │ │ │ +00180190: 6d65 6f75 743c 2f61 3e3c 2f63 6f64 653e meout │ │ │ │ +001801a0: 2066 6f72 206e 6f6e 2d62 6c6f 636b 696e for non-blockin │ │ │ │ +001801b0: 6720 3c63 6f64 653e 736f 6170 5f63 616c g soap_cal │ │ │ │ +001801c0: 6c5f 6e73 5f5f 7765 626d 6574 686f 643c l_ns__webmethod< │ │ │ │ +001801d0: 2f63 6f64 653e 2063 616c 6c73 206d 6179 /code> calls may │ │ │ │ +001801e0: 206e 6f74 2077 6f72 6b20 756e 6465 7220 not work under │ │ │ │ +001801f0: 4c69 6e75 782e 3c2f 6464 3e0a 3c64 643e Linux.
    .
    │ │ │ │ +00180200: 0a49 6e74 6572 7275 7074 7320 2845 494e .Interrupts (EIN │ │ │ │ +00180210: 5452 2920 6361 6e20 6166 6665 6374 2074 TR) can affect t │ │ │ │ +00180220: 6865 2062 6c6f 636b 696e 6720 7469 6d65 he blocking time │ │ │ │ +00180230: 2069 6e20 492f 4f20 6f70 6572 6174 696f in I/O operatio │ │ │ │ +00180240: 6e73 2e20 5468 6520 6d61 7869 6d75 6d20 ns. The maximum │ │ │ │ +00180250: 6e75 6d62 6572 206f 6620 4549 4e54 5220 number of EINTR │ │ │ │ +00180260: 7468 6174 2077 696c 6c20 6e6f 7420 7472 that will not tr │ │ │ │ +00180270: 6967 6765 7220 616e 2065 7272 6f72 2069 igger an error i │ │ │ │ +00180280: 7320 7365 7420 6279 203c 636f 6465 3e23 s set by # │ │ │ │ +00180290: 534f 4150 5f4d 4158 4549 4e54 523c 2f63 SOAP_MAXEINTR in gsoap/stdsoap2 │ │ │ │ +001802c0: 2e68 3c2f 636f 6465 3e3c 2f65 6d3e 2c20 .h, │ │ │ │ +001802d0: 7768 6963 6820 6973 2031 3020 6279 2064 which is 10 by d │ │ │ │ +001802e0: 6566 6175 6c74 2e20 4561 6368 2045 494e efault. Each EIN │ │ │ │ +001802f0: 5452 206d 6179 2069 6e63 7265 6173 6520 TR may increase │ │ │ │ +00180300: 7468 6520 626c 6f63 6b69 6e67 2074 696d the blocking tim │ │ │ │ +00180310: 6520 6279 2075 7020 746f 206f 6e65 2073 e by up to one s │ │ │ │ +00180320: 6563 6f6e 642c 2075 7020 746f 203c 636f econd, up to #SOAP_MAXEINT │ │ │ │ +00180340: 523c 2f63 6f64 653e 2073 6563 6f6e 6473 R seconds │ │ │ │ +00180350: 2074 6f74 616c 2e3c 2f64 643e 3c2f 646c total.
    .

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

    .

    .Closing conne │ │ │ │ +001803d0: 6374 696f 6e73 2062 7920 666f 7263 653c ctions by force< │ │ │ │ +001803e0: 2f68 323e 0a3c 703e 546f 2063 6c6f 7365 /h2>.

    To close │ │ │ │ +001803f0: 2061 2073 6f63 6b65 7420 636f 6e6e 6563 a socket connec │ │ │ │ +00180400: 7469 6f6e 2062 7920 666f 7263 652c 2079 tion by force, y │ │ │ │ +00180410: 6f75 2063 616e 2075 7365 203c 636f 6465 ou can use soap_force_clos │ │ │ │ +00180430: 6573 6f63 6b28 736f 6170 293c 2f63 6f64 esock(soap), which closes │ │ │ │ +00180450: 2074 6865 2063 6f6e 6e65 6374 696f 6e20 the connection │ │ │ │ +00180460: 7265 6761 7264 6c65 7373 2069 6620 6b65 regardless if ke │ │ │ │ +00180470: 6570 2d61 6c69 7665 2069 7320 6163 7469 ep-alive is acti │ │ │ │ +00180480: 7665 2e20 4279 2063 6f6e 7472 6173 742c ve. By contrast, │ │ │ │ +00180490: 203c 636f 6465 3e73 6f61 705f 636c 6f73 soap_clos │ │ │ │ +001804a0: 6573 6f63 6b28 736f 6170 293c 2f63 6f64 esock(soap) only closes t │ │ │ │ +001804c0: 6865 2063 6f6e 6e65 6374 696f 6e20 7768 he connection wh │ │ │ │ +001804d0: 656e 206b 6565 702d 616c 6976 6520 6973 en keep-alive is │ │ │ │ +001804e0: 206e 6f74 2061 6374 6976 652e 3c2f 703e not active.

    │ │ │ │ +001804f0: 0a3c 703e 546f 2066 6f72 6365 2d63 6c6f .

    To force-clo │ │ │ │ +00180500: 7365 2061 2063 6f6e 6e65 6374 696f 6e20 se a connection │ │ │ │ +00180510: 6672 6f6d 2061 6e6f 7468 6572 2074 6872 from another thr │ │ │ │ +00180520: 6561 642c 2063 6f6d 7069 6c65 2073 7464 ead, compile std │ │ │ │ +00180530: 736f 6170 322e 6320 6f72 2073 7464 736f soap2.c or stdso │ │ │ │ +00180540: 6170 322e 6370 7020 616e 6420 796f 7572 ap2.cpp and your │ │ │ │ +00180550: 2070 726f 6a65 6374 2073 6f75 7263 6520 project source │ │ │ │ +00180560: 636f 6465 2077 6974 6820 3c63 6f64 653e code with │ │ │ │ +00180570: 2357 4954 485f 5345 4c46 5f50 4950 453c #WITH_SELF_PIPE< │ │ │ │ +00180580: 2f63 6f64 653e 2074 6f20 656e 6162 6c65 /code> to enable │ │ │ │ +00180590: 2074 6869 7320 6665 6174 7572 652e 2055 this feature. U │ │ │ │ +001805a0: 7365 203c 636f 6465 3e73 6f61 705f 636c se soap_cl │ │ │ │ +001805b0: 6f73 655f 636f 6e6e 6563 7469 6f6e 2873 ose_connection(s │ │ │ │ +001805c0: 6f61 7029 3c2f 636f 6465 3e20 6f6e 2074 oap) on t │ │ │ │ +001805d0: 6865 203c 636f 6465 3e3c 6120 636c 6173 he soap context tha │ │ │ │ +00180640: 7420 6d75 7374 2063 6c6f 7365 2e20 596f t must close. Yo │ │ │ │ +00180650: 7520 6361 6e20 6d61 6b65 2074 6869 7320 u can make this │ │ │ │ +00180660: 6361 6c6c 2066 726f 6d20 616e 6f74 6865 call from anothe │ │ │ │ +00180670: 7220 7468 7265 6164 2061 6e64 2070 6173 r thread and pas │ │ │ │ +00180680: 7320 7468 6520 3c63 6f64 653e 3c61 2063 s the soap │ │ │ │ +001806e0: 3c2f 636f 6465 3e20 636f 6e74 6578 7420 context │ │ │ │ +001806f0: 746f 2074 6869 7320 6675 6e63 7469 6f6e to this function │ │ │ │ +00180700: 206f 6620 7468 6520 7468 7265 6164 2074 of the thread t │ │ │ │ +00180710: 6861 7420 6d75 7374 2063 6c6f 7365 2063 hat must close c │ │ │ │ +00180720: 6f6e 6e65 6374 696f 6e73 2e3c 2f70 3e0a onnections.

    . │ │ │ │ +00180730: 3c70 3ef0 9f94 9d20 3c61 2068 7265 663d

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

    .

    . │ │ │ │ +00180790: 536f 636b 6574 206f 7074 696f 6e73 2061 Socket options a │ │ │ │ +001807a0: 6e64 2066 6c61 6773 3c2f 6832 3e0a 3c70 nd flags

    .

    Socket communic │ │ │ │ +001807c0: 6174 696f 6e73 2063 616e 2062 6520 636f ations can be co │ │ │ │ +001807d0: 6e74 726f 6c6c 6564 2077 6974 6820 736f ntrolled with so │ │ │ │ +001807e0: 636b 6574 206f 7074 696f 6e73 2061 6e64 cket options and │ │ │ │ +001807f0: 2066 6c61 6773 2e20 5468 6520 3c63 6f64 flags. The so │ │ │ │ +00180850: 6170 3c2f 613e 3c2f 636f 6465 3e20 636f ap co │ │ │ │ +00180860: 6e74 6578 7420 666c 6167 7320 6172 653a ntext flags are: │ │ │ │ +00180870: 3c2f 703e 0a3c 756c 3e0a 3c6c 693e 3c63

    .
    . │ │ │ │ +00180fd0: 3c70 3e53 6565 2074 6865 206f 7065 7261

    See the opera │ │ │ │ +00180fe0: 7469 6e67 2073 7973 7465 6d20 6d61 6e75 ting system manu │ │ │ │ +00180ff0: 616c 2070 6167 6573 206f 6620 3c63 6f64 al pages of send an │ │ │ │ +00181010: 6420 3c63 6f64 653e 7265 6376 3c2f 636f d recv for soap::sock │ │ │ │ +001810f0: 6574 5f66 6c61 6773 3c2f 613e 3c2f 636f et_flags values and s │ │ │ │ +00181110: 6565 2074 6865 206f 7065 7261 7469 6e67 ee the operating │ │ │ │ +00181120: 2073 7973 7465 6d20 6d61 6e75 616c 2070 system manual p │ │ │ │ +00181130: 6167 6573 206f 6620 3c63 6f64 653e 7365 ages of se │ │ │ │ +00181140: 7473 6f63 6b6f 7074 3c2f 636f 6465 3e20 tsockopt │ │ │ │ +00181150: 666f 7220 3c63 6f64 653e 3c61 2063 6c61 for soap::connect_ │ │ │ │ +00181220: 666c 6167 733c 2f61 3e3c 2f63 6f64 653e flags │ │ │ │ +00181230: 2c20 3c63 6f64 653e 3c61 2063 6c61 7373 , │ │ │ │ +001812f0: 736f 6170 3a3a 6269 6e64 5f66 6c61 6773 soap::bind_flags │ │ │ │ +00181300: 3c2f 613e 3c2f 636f 6465 3e2c 2061 6e64 , and │ │ │ │ +00181310: 203c 636f 6465 3e3c 6120 636c 6173 733d s │ │ │ │ +001813d0: 6f61 703a 3a61 6363 6570 745f 666c 6167 oap::accept_flag │ │ │ │ +001813e0: 733c 2f61 3e3c 2f63 6f64 653e 2028 6c65 s (le │ │ │ │ +001813f0: 7665 6c20 3c63 6f64 653e 534f 4c5f 534f vel SOL_SO │ │ │ │ +00181400: 434b 4554 3c2f 636f 6465 3e29 2076 616c CKET) val │ │ │ │ +00181410: 7565 732e 2054 6865 7365 203c 636f 6465 ues. These SO_ sock │ │ │ │ +00181430: 6574 206f 7074 696f 6e20 666c 6167 7320 et option flags │ │ │ │ +00181440: 2873 6565 203c 636f 6465 3e73 6574 736f (see setso │ │ │ │ +00181450: 636b 6f70 743c 2f63 6f64 653e 206d 616e ckopt man │ │ │ │ +00181460: 7561 6c20 7061 6765 7329 2063 616e 2062 ual pages) can b │ │ │ │ +00181470: 6520 6269 742d 7769 7365 206f 722d 6564 e bit-wise or-ed │ │ │ │ +00181480: 2074 6f20 7365 7420 6d75 6c74 6970 6c65 to set multiple │ │ │ │ +00181490: 2073 6f63 6b65 7420 6f70 7469 6f6e 7320 socket options │ │ │ │ +001814a0: 6174 206f 6e63 652e 3c2f 703e 0a3c 703e at once.

    .

    │ │ │ │ +001814b0: 5468 6520 636c 6965 6e74 2d73 6964 6520 The client-side │ │ │ │ +001814c0: 666c 6167 203c 636f 6465 3e3c 6120 636c flag soap::connect │ │ │ │ +00181590: 5f66 6c61 6773 3c2f 613e 3c2f 636f 6465 _flags = SO_LIN │ │ │ │ +001815b0: 4745 523c 2f63 6f64 653e 2069 7320 7375 GER is su │ │ │ │ +001815c0: 7070 6f72 7465 6420 7769 7468 2076 616c pported with val │ │ │ │ +001815d0: 7565 7320 3c63 6f64 653e 6c5f 6f6e 6f66 ues l_onof │ │ │ │ +001815e0: 663c 2f63 6f64 653e 203d 2031 2061 6e64 f = 1 and │ │ │ │ +001815f0: 203c 636f 6465 3e6c 5f6c 696e 6765 723c l_linger< │ │ │ │ +00181600: 2f63 6f64 653e 203d 203c 636f 6465 3e3c /code> = < │ │ │ │ +00181610: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ +00181620: 663d 2273 7472 7563 7473 6f61 702e 6874 f="structsoap.ht │ │ │ │ +00181630: 6d6c 2361 3066 3464 3032 3530 3533 6664 ml#a0f4d025053fd │ │ │ │ +00181640: 6537 3732 3136 6130 6361 3637 3430 3737 e77216a0ca674077 │ │ │ │ +00181650: 3139 3864 2220 7469 746c 653d 2255 7365 198d" title="Use │ │ │ │ +00181660: 722d 6465 6669 6e61 626c 6520 6c69 6e67 r-definable ling │ │ │ │ +00181670: 6572 2074 696d 6520 7661 6c75 652c 2072 er time value, r │ │ │ │ +00181680: 6571 7569 7265 7320 7468 6520 534f 5f4c equires the SO_L │ │ │ │ +00181690: 494e 4745 5220 7365 7473 6f63 6b6f 7074 INGER setsockopt │ │ │ │ +001816a0: 2066 6c61 6720 7661 6c75 6520 746f 2062 flag value to b │ │ │ │ +001816b0: 6520 6173 7369 676e 6564 2074 6f20 736f e assigned to so │ │ │ │ +001816c0: 6170 2e2e 2e22 3e73 6f61 703a 3a6c 696e ap...">soap::lin │ │ │ │ +001816d0: 6765 725f 7469 6d65 3c2f 613e 3c2f 636f ger_time. The < │ │ │ │ +001816f0: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ +00181700: 663d 2273 7472 7563 7473 6f61 702e 6874 f="structsoap.ht │ │ │ │ +00181710: 6d6c 2361 3066 3464 3032 3530 3533 6664 ml#a0f4d025053fd │ │ │ │ +00181720: 6537 3732 3136 6130 6361 3637 3430 3737 e77216a0ca674077 │ │ │ │ +00181730: 3139 3864 2220 7469 746c 653d 2255 7365 198d" title="Use │ │ │ │ +00181740: 722d 6465 6669 6e61 626c 6520 6c69 6e67 r-definable ling │ │ │ │ +00181750: 6572 2074 696d 6520 7661 6c75 652c 2072 er time value, r │ │ │ │ +00181760: 6571 7569 7265 7320 7468 6520 534f 5f4c equires the SO_L │ │ │ │ +00181770: 494e 4745 5220 7365 7473 6f63 6b6f 7074 INGER setsockopt │ │ │ │ +00181780: 2066 6c61 6720 7661 6c75 6520 746f 2062 flag value to b │ │ │ │ +00181790: 6520 6173 7369 676e 6564 2074 6f20 736f e assigned to so │ │ │ │ +001817a0: 6170 2e2e 2e22 3e73 6f61 703a 3a6c 696e ap...">soap::lin │ │ │ │ +001817b0: 6765 725f 7469 6d65 3c2f 613e 3c2f 636f ger_time determines t │ │ │ │ +001817d0: 6865 2077 6169 7420 7469 6d65 2028 7468 he wait time (th │ │ │ │ +001817e0: 6520 7469 6d65 2072 6573 6f6c 7574 696f e time resolutio │ │ │ │ +001817f0: 6e20 6973 2073 7973 7465 6d20 6465 7065 n is system depe │ │ │ │ +00181800: 6e64 656e 742c 2074 686f 7567 6820 6163 ndent, though ac │ │ │ │ +00181810: 636f 7264 696e 6720 746f 2073 6f6d 6520 cording to some │ │ │ │ +00181820: 6578 7065 7274 7320 6f6e 6c79 207a 6572 experts only zer │ │ │ │ +00181830: 6f20 616e 6420 6e6f 6e7a 6572 6f20 7661 o and nonzero va │ │ │ │ +00181840: 6c75 6573 206d 6174 7465 7229 2e20 5468 lues matter). Th │ │ │ │ +00181850: 6520 6c69 6e67 6572 206f 7074 696f 6e20 e linger option │ │ │ │ +00181860: 6361 6e20 6265 2075 7365 6420 746f 206d can be used to m │ │ │ │ +00181870: 616e 6167 6520 7468 6520 6e75 6d62 6572 anage the number │ │ │ │ +00181880: 206f 6620 636f 6e6e 6563 7469 6f6e 7320 of connections │ │ │ │ +00181890: 7468 6174 2072 656d 6169 6e20 696e 203c that remain in < │ │ │ │ +001818a0: 636f 6465 3e54 494d 455f 5741 4954 3c2f code>TIME_WAIT state at t │ │ │ │ +001818c0: 6865 2073 6572 7665 7220 7369 6465 2e3c he server side.< │ │ │ │ +001818d0: 2f70 3e0a 3c70 3e46 6f72 2065 7861 6d70 /p>.

    For examp │ │ │ │ +001818e0: 6c65 2c20 746f 2064 6973 6162 6c65 2053 le, to disable S │ │ │ │ +001818f0: 4947 5049 5045 2073 6967 6e61 6c73 206f IGPIPE signals o │ │ │ │ +00181900: 6e20 556e 6978 2f4c 696e 7578 2070 6c61 n Unix/Linux pla │ │ │ │ +00181910: 7466 6f72 6d73 2075 7365 3a20 3c63 6f64 tforms use: soap:: │ │ │ │ +001819e0: 736f 636b 6574 5f66 6c61 6773 3c2f 613e socket_flags │ │ │ │ +001819f0: 3c2f 636f 6465 3e20 3d20 3c63 6f64 653e = │ │ │ │ +00181a00: 4d53 475f 4e4f 5349 474e 414c 3c2f 636f MSG_NOSIGNAL and/or soap::c │ │ │ │ +00181ae0: 6f6e 6e65 6374 5f66 6c61 6773 3c2f 613e onnect_flags │ │ │ │ +00181af0: 3c2f 636f 6465 3e20 3d20 3c63 6f64 653e = │ │ │ │ +00181b00: 534f 5f4e 4f53 4947 5049 5045 3c2f 636f SO_NOSIGPIPE (i.e. client │ │ │ │ +00181b20: 2d73 6964 6520 636f 6e6e 6563 7429 2064 -side connect) d │ │ │ │ +00181b30: 6570 656e 6469 6e67 206f 6e20 796f 7572 epending on your │ │ │ │ +00181b40: 2070 6c61 7466 6f72 6d2e 3c2f 703e 0a3c platform.

    .< │ │ │ │ +00181b50: 703e 5573 6520 3c63 6f64 653e 3c61 2063 p>Use soap::bind_f │ │ │ │ +00181c20: 6c61 6773 3c2f 613e 3c2f 636f 6465 3e20 lags │ │ │ │ +00181c30: 3d20 3c63 6f64 653e 534f 5f52 4555 5345 = SO_REUSE │ │ │ │ +00181c40: 4144 4452 3c2f 636f 6465 3e20 746f 2065 ADDR to e │ │ │ │ +00181c50: 6e61 626c 6520 7365 7276 6572 2d73 6964 nable server-sid │ │ │ │ +00181c60: 6520 706f 7274 2072 6575 7365 2061 6e64 e port reuse and │ │ │ │ +00181c70: 206c 6f63 616c 2070 6f72 7420 7368 6172 local port shar │ │ │ │ +00181c80: 696e 6720 2862 7574 2062 6520 6177 6172 ing (but be awar │ │ │ │ +00181c90: 6520 6f66 2074 6865 2070 6f73 7369 626c e of the possibl │ │ │ │ +00181ca0: 6520 7365 6375 7269 7479 2069 6d70 6c69 e security impli │ │ │ │ +00181cb0: 6361 7469 6f6e 7320 7375 6368 2061 7320 cations such as │ │ │ │ +00181cc0: 706f 7274 2068 696a 6163 6b69 6e67 292e port hijacking). │ │ │ │ +00181cd0: 3c2f 703e 0a3c 703e 4e6f 7465 2074 6861

    .

    Note tha │ │ │ │ +00181ce0: 7420 796f 7520 6861 7665 2061 6363 6573 t you have acces │ │ │ │ +00181cf0: 7320 746f 2074 6865 203c 636f 6465 3e3c s to the < │ │ │ │ +00181d00: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ +00181d10: 663d 2273 7472 7563 7473 6f61 702e 6874 f="structsoap.ht │ │ │ │ +00181d20: 6d6c 2220 7469 746c 653d 2243 6f6e 7465 ml" title="Conte │ │ │ │ +00181d30: 7874 2077 6974 6820 7468 6520 656e 6769 xt with the engi │ │ │ │ +00181d40: 6e65 2073 7461 7465 2e22 3e73 6f61 703c ne state.">soap< │ │ │ │ +00181d50: 2f61 3e2d 2667 743b 6d61 7374 6572 3c2f /a>->master socket val │ │ │ │ +00181d70: 7565 2072 6574 7572 6e65 6420 6279 203c ue returned by < │ │ │ │ +00181d80: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soap_bind< │ │ │ │ +00181e00: 2f61 3e3c 2f63 6f64 653e 2073 6f20 796f /a> so yo │ │ │ │ +00181e10: 7520 6361 6e20 7365 7420 6d75 6c74 6970 u can set multip │ │ │ │ +00181e20: 6c65 2073 6f63 6b65 7420 6f70 7469 6f6e le socket option │ │ │ │ +00181e30: 7320 6279 2063 616c 6c69 6e67 203c 636f s by calling setsockopt as follows: │ │ │ │ +00181e60: 3c2f 703e 0a3c 6469 7620 636c 6173 733d

    .
    .< │ │ │ │ +00182000: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00182010: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >if (soap_val │ │ │ │ +00182090: 6964 5f73 6f63 6b65 743c 2f61 3e28 736f id_socket(so │ │ │ │ +001820a0: 636b 2929 203c 2f64 6976 3e0a 3c64 6976 ck))
    .
    < │ │ │ │ +0018aeb0: 703e 7768 6572 652c 2066 6f72 2065 7861 p>where, for exa │ │ │ │ +0018aec0: 6d70 6c65 3a3c 2f70 3e0a 3c64 6976 2063 mple:

    .
    │ │ │ │ +0018aee0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    void │ │ │ │ +0018af10: 3c2f 7370 616e 3e20 7369 6770 6970 655f sigpipe_ │ │ │ │ +0018af20: 6861 6e64 6c65 283c 7370 616e 2063 6c61 handle(int x) { │ │ │ │ +0018af50: 207d 3c2f 6469 763e 0a3c 2f64 6976 3e3c }
    .
    < │ │ │ │ +0018af60: 212d 2d20 6672 6167 6d65 6e74 202d 2d3e !-- fragment --> │ │ │ │ +0018af70: 3c64 6c20 636c 6173 733d 2273 6563 7469
    │ │ │ │ +0018af90: 5761 726e 696e 673c 2f64 743e 3c64 643e Warning
    │ │ │ │ +0018afa0: 4974 2069 7320 696d 706f 7274 616e 7420 It is important │ │ │ │ +0018afb0: 7468 6174 2074 6865 203c 636f 6465 3e23 that the # │ │ │ │ +0018afc0: 5749 5448 5f4f 5045 4e53 534c 3c2f 636f WITH_OPENSSL macro is con │ │ │ │ +0018afe0: 7369 7374 656e 746c 7920 6465 6669 6e65 sistently define │ │ │ │ +0018aff0: 6420 746f 2063 6f6d 7069 6c65 2074 6865 d to compile the │ │ │ │ +0018b000: 2073 6f75 7263 6573 2c20 7375 6368 2061 sources, such a │ │ │ │ +0018b010: 7320 3c65 6d3e 3c63 6f64 653e 6773 6f61 s gsoa │ │ │ │ +0018b020: 702f 7374 6473 6f61 7032 2e63 7070 3c2f p/stdsoap2.cpp, │ │ │ │ +0018b040: 3c63 6f64 653e 736f 6170 432e 6370 703c soapC.cpp< │ │ │ │ +0018b050: 2f63 6f64 653e 3c2f 656d 3e2c 203c 656d /code>, soapClien │ │ │ │ +0018b070: 742e 6370 703c 2f63 6f64 653e 3c2f 656d t.cpp, soa │ │ │ │ +0018b090: 7053 6572 7665 722e 6370 703c 2f63 6f64 pServer.cpp, and all │ │ │ │ +0018b0b0: 2061 7070 6c69 6361 7469 6f6e 2073 6f75 application sou │ │ │ │ +0018b0c0: 7263 6573 2074 6861 7420 696e 636c 7564 rces that includ │ │ │ │ +0018b0d0: 6520 3c65 6d3e 3c63 6f64 653e 6773 6f61 e gsoa │ │ │ │ +0018b0e0: 702f 7374 6473 6f61 7032 2e68 3c2f 636f p/stdsoap2.h or │ │ │ │ +0018b100: 3c63 6f64 653e 736f 6170 482e 683c 2f63 soapH.h. If th │ │ │ │ +0018b120: 6520 6d61 6372 6f73 2061 7265 206e 6f74 e macros are not │ │ │ │ +0018b130: 2063 6f6e 7369 7374 656e 746c 7920 7573 consistently us │ │ │ │ +0018b140: 6564 2c20 7468 6520 6170 706c 6963 6174 ed, the applicat │ │ │ │ +0018b150: 696f 6e20 7769 6c6c 2063 7261 7368 2064 ion will crash d │ │ │ │ +0018b160: 7565 2074 6f20 6120 6d69 736d 6174 6368 ue to a mismatch │ │ │ │ +0018b170: 6573 2069 6e20 7468 6520 6465 636c 6172 es in the declar │ │ │ │ +0018b180: 6174 696f 6e20 616e 6420 6163 6365 7373 ation and access │ │ │ │ +0018b190: 206f 6620 7468 6520 3c63 6f64 653e 3c61 of the soap contex │ │ │ │ +0018b200: 742e 2041 6c74 6572 6e61 7469 7665 6c79 t. Alternatively │ │ │ │ +0018b210: 2c20 7573 6520 6c69 6272 6172 7920 3c62 , use library -lgsoapss │ │ │ │ +0018b230: 6c3c 2f63 6f64 653e 3c2f 623e 206f 7220 l or │ │ │ │ +0018b240: 3c62 3e3c 636f 6465 3e2d 6c67 736f 6170 -lgsoap │ │ │ │ +0018b250: 7373 6c2b 2b3c 2f63 6f64 653e 3c2f 623e ssl++ │ │ │ │ +0018b260: 2061 6e64 2063 6f6d 7069 6c65 2065 7665 and compile eve │ │ │ │ +0018b270: 7279 7468 696e 6720 656c 7365 2077 6974 rything else wit │ │ │ │ +0018b280: 6820 3c63 6f64 653e 2357 4954 485f 4f50 h #WITH_OP │ │ │ │ +0018b290: 454e 5353 4c3c 2f63 6f64 653e 2e3c 2f64 ENSSL..
    .Concurre │ │ │ │ +0018b2b0: 6e74 2063 6c69 656e 7420 6361 6c6c 7320 nt client calls │ │ │ │ +0018b2c0: 7769 7468 2074 6872 6561 6473 2073 686f with threads sho │ │ │ │ +0018b2d0: 756c 6420 7573 6520 7365 7061 7261 7465 uld use separate │ │ │ │ +0018b2e0: 203c 636f 6465 3e3c 6120 636c 6173 733d soap contexts In a │ │ │ │ +0018b350: 6464 6974 696f 6e2c 2074 6865 2074 6872 ddition, the thr │ │ │ │ +0018b360: 6561 6420 696e 6974 6961 6c69 7a61 7469 ead initializati │ │ │ │ +0018b370: 6f6e 2063 6f64 6520 6469 7363 7573 7365 on code discusse │ │ │ │ +0018b380: 6420 696e 2053 6563 7469 6f6e 203c 6120 d in Section Secur │ │ │ │ +0018b3c0: 6520 5765 6220 7365 7276 6963 6573 2077 e Web services w │ │ │ │ +0018b3d0: 6974 6820 4854 5450 533c 2f61 3e20 6d75 ith HTTPS mu │ │ │ │ +0018b3e0: 7374 2062 6520 7573 6564 2074 6f20 7072 st be used to pr │ │ │ │ +0018b3f0: 6f70 6572 6c79 2073 6574 7570 204f 7065 operly setup Ope │ │ │ │ +0018b400: 6e53 534c 2069 6e20 6120 6d75 6c74 692d nSSL in a multi- │ │ │ │ +0018b410: 7468 7265 6164 6564 2063 6c69 656e 7420 threaded client │ │ │ │ +0018b420: 6170 706c 6963 6174 696f 6e2e 3c2f 6464 application.
    .

    See al │ │ │ │ +0018b440: 736f 2041 5049 2064 6f63 756d 656e 7461 so API documenta │ │ │ │ +0018b450: 7469 6f6e 204d 6f64 756c 6520 3c61 2063 tion Module SSL/TLS │ │ │ │ +0018b490: 636f 6e74 6578 7420 616e 6420 6675 6e63 context and func │ │ │ │ +0018b4a0: 7469 6f6e 733c 2f61 3e20 666f 7220 6d6f tions for mo │ │ │ │ +0018b4b0: 7265 2064 6574 6169 6c73 206f 6e20 7468 re details on th │ │ │ │ +0018b4c0: 6520 5353 4c2f 544c 5320 6675 6e63 7469 e SSL/TLS functi │ │ │ │ +0018b4d0: 6f6e 732e 3c2f 703e 0a3c 703e 596f 7520 ons.

    .

    You │ │ │ │ +0018b4e0: 6361 6e20 616c 736f 2075 7365 2074 6865 can also use the │ │ │ │ +0018b4f0: 2057 696e 496e 6574 2069 6e74 6572 6661 WinInet interfa │ │ │ │ +0018b500: 6365 2074 6f20 6573 7461 626c 6973 6820 ce to establish │ │ │ │ +0018b510: 7365 6375 7265 2048 5454 5053 2063 6f6e secure HTTPS con │ │ │ │ +0018b520: 6e65 6374 696f 6e73 206f 6e20 5769 6e64 nections on Wind │ │ │ │ +0018b530: 6f77 7320 6d61 6368 696e 6573 2c20 6176 ows machines, av │ │ │ │ +0018b540: 6169 6c61 626c 6520 696e 2074 6865 203c ailable in the < │ │ │ │ +0018b550: 656d 3e3c 636f 6465 3e67 736f 6170 2f6d em>gsoap/m │ │ │ │ +0018b560: 6f64 5f67 736f 6170 3c2f 636f 6465 3e3c od_gsoap< │ │ │ │ +0018b570: 2f65 6d3e 2064 6972 6563 746f 7279 206f /em> directory o │ │ │ │ +0018b580: 6620 7468 6520 6753 4f41 5020 736f 7572 f the gSOAP sour │ │ │ │ +0018b590: 6365 2063 6f64 6520 7061 636b 6167 652c ce code package, │ │ │ │ +0018b5a0: 2073 6565 2061 6c73 6f20 5365 6374 696f see also Sectio │ │ │ │ +0018b5b0: 6e20 3c61 2063 6c61 7373 3d22 656c 2220 n │ │ │ │ +0018b5e0: 5468 6520 5769 6e49 6e65 7420 706c 7567 The WinInet plug │ │ │ │ +0018b5f0: 696e 3c2f 613e 2e20 4f72 2079 6f75 2063 in. Or you c │ │ │ │ +0018b600: 616e 2075 7365 2074 6865 2043 5552 4c20 an use the CURL │ │ │ │ +0018b610: 706c 7567 696e 2074 6f20 7573 6520 4355 plugin to use CU │ │ │ │ +0018b620: 524c 2074 6f20 6573 7461 626c 6973 6820 RL to establish │ │ │ │ +0018b630: 7365 6375 7265 2048 5454 5053 2063 6f6e secure HTTPS con │ │ │ │ +0018b640: 6e65 6374 696f 6e73 2c20 7365 6520 5365 nections, see Se │ │ │ │ +0018b650: 6374 696f 6e20 3c61 2063 6c61 7373 3d22 ction The CURL plugin │ │ │ │ +0018b690: 3c2f 613e 2e3c 2f70 3e0a 3c70 3ef0 9f94 .

    .

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

    . │ │ │ │ +0018b6d0: 3c68 323e 3c61 2063 6c61 7373 3d22 616e

    .SSL a │ │ │ │ +0018b710: 7574 6865 6e74 6963 6174 696f 6e20 6361 uthentication ca │ │ │ │ +0018b720: 6c6c 6261 636b 733c 2f68 323e 0a3c 703e llbacks

    .

    │ │ │ │ +0018b730: 5468 6520 3c63 6f64 653e 6673 736c 6175 The fsslau │ │ │ │ +0018b740: 7468 3c2f 636f 6465 3e20 6361 6c6c 6261 th callba │ │ │ │ +0018b750: 636b 2066 756e 6374 696f 6e20 636f 6e74 ck function cont │ │ │ │ +0018b760: 726f 6c73 204f 7065 6e53 534c 2f47 4e55 rols OpenSSL/GNU │ │ │ │ +0018b770: 544c 5320 6175 7468 656e 7469 6361 7469 TLS authenticati │ │ │ │ +0018b780: 6f6e 2069 6e69 7469 616c 697a 6174 696f on initializatio │ │ │ │ +0018b790: 6e3a 3c2f 703e 0a3c 756c 3e0a 3c6c 693e n:

    ..

    The │ │ │ │ +0018bc40: 203c 636f 6465 3e66 7373 6c76 6572 6966 fsslverif │ │ │ │ +0018bc50: 793c 2f63 6f64 653e 2063 616c 6c62 6163 y callbac │ │ │ │ +0018bc60: 6b20 6675 6e63 7469 6f6e 2063 6f6e 7472 k function contr │ │ │ │ +0018bc70: 6f6c 7320 4f70 656e 5353 4c20 7065 6572 ols OpenSSL peer │ │ │ │ +0018bc80: 2063 6572 7469 6669 6361 7465 2076 6572 certificate ver │ │ │ │ +0018bc90: 6966 6963 6174 696f 6e2c 2076 6961 2069 ification, via i │ │ │ │ +0018bca0: 6e74 6572 6e61 6c6c 7920 696e 766f 6b69 nternally invoki │ │ │ │ +0018bcb0: 6e67 203c 636f 6465 3e53 534c 5f43 5458 ng SSL_CTX │ │ │ │ +0018bcc0: 5f73 6574 5f76 6572 6966 793c 2f63 6f64 _set_verify:

    .
      .
    • int (soap │ │ │ │ +0018bcf0: 3a3a 6673 7376 6572 6966 7929 2869 6e74 ::fssverify)(int │ │ │ │ +0018bd00: 206f 6b2c 2058 3530 395f 5354 4f52 455f ok, X509_STORE_ │ │ │ │ +0018bd10: 4354 5820 2a73 746f 7265 3c2f 636f 6465 CTX *store This callback │ │ │ │ +0018bd30: 6973 2063 616c 6c65 6420 6279 2074 6865 is called by the │ │ │ │ +0018bd40: 2065 6e67 696e 6520 746f 206d 616e 6167 engine to manag │ │ │ │ +0018bd50: 6520 7468 6520 7665 7269 6669 6361 7469 e the verificati │ │ │ │ +0018bd60: 6f6e 206f 6620 7468 6520 6365 7274 6966 on of the certif │ │ │ │ +0018bd70: 6963 6174 6520 7072 6f76 6964 6564 2062 icate provided b │ │ │ │ +0018bd80: 7920 6120 7065 6572 2c20 7375 6368 2061 y a peer, such a │ │ │ │ +0018bd90: 7320 7468 6520 6365 7274 6966 6963 6174 s the certificat │ │ │ │ +0018bda0: 6520 7072 6f76 6964 6564 2062 7920 6120 e provided by a │ │ │ │ +0018bdb0: 7365 7276 6572 2063 6f6e 6e65 6374 6564 server connected │ │ │ │ +0018bdc0: 206f 7665 7220 4854 5450 5320 6f72 2074 over HTTPS or t │ │ │ │ +0018bdd0: 6f20 7665 7269 6679 2074 6865 2063 6572 o verify the cer │ │ │ │ +0018bde0: 7469 6669 6361 7465 2069 6e63 6c75 6465 tificate include │ │ │ │ +0018bdf0: 6420 7769 7468 2061 2057 532d 5365 6375 d with a WS-Secu │ │ │ │ +0018be00: 7269 7479 206d 6573 7361 6765 2e20 546f rity message. To │ │ │ │ +0018be10: 2072 6571 7569 7265 2063 6572 7469 6669 require certifi │ │ │ │ +0018be20: 6361 7465 2076 6572 6966 6963 6174 696f cate verificatio │ │ │ │ +0018be30: 6e20 6f66 2061 2073 6572 7665 7220 636f n of a server co │ │ │ │ +0018be40: 6e6e 6563 7465 6420 7669 6120 4854 5450 nnected via HTTP │ │ │ │ +0018be50: 532c 2075 7365 203c 636f 6465 3e3c 6120 S, use │ │ │ │ +0018bee0: 736f 6170 5f73 736c 5f63 6c69 656e 745f soap_ssl_client_ │ │ │ │ +0018bef0: 636f 6e74 6578 743c 2f61 3e3c 2f63 6f64 context with #S │ │ │ │ +0018bf10: 4f41 505f 5353 4c5f 5245 5155 4952 455f OAP_SSL_REQUIRE_ │ │ │ │ +0018bf20: 5345 5256 4552 5f41 5554 4845 4e54 4943 SERVER_AUTHENTIC │ │ │ │ +0018bf30: 4154 494f 4e3c 2f63 6f64 653e 2e20 546f ATION. To │ │ │ │ +0018bf40: 2072 6571 7569 7265 2063 6572 7469 6669 require certifi │ │ │ │ +0018bf50: 6361 7465 2076 6572 6966 6963 6174 696f cate verificatio │ │ │ │ +0018bf60: 6e20 6f66 2061 2063 6c69 656e 7420 636f n of a client co │ │ │ │ +0018bf70: 6e6e 6563 7465 6420 746f 2061 2073 6572 nnected to a ser │ │ │ │ +0018bf80: 7665 722c 2075 7365 203c 636f 6465 3e3c ver, use < │ │ │ │ +0018bf90: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ +0018bfa0: 663d 2267 726f 7570 5f5f 6772 6f75 705f f="group__group_ │ │ │ │ +0018bfb0: 5f73 736c 2e68 746d 6c23 6761 3334 3932 _ssl.html#ga3492 │ │ │ │ +0018bfc0: 3436 3563 6464 3861 6137 3166 6537 3436 465cdd8aa71fe746 │ │ │ │ +0018bfd0: 3139 3964 3338 3432 6361 6337 2220 7469 199d3842cac7" ti │ │ │ │ +0018bfe0: 746c 653d 2249 6e69 7469 616c 697a 6520 tle="Initialize │ │ │ │ +0018bff0: 7468 6520 7365 7276 6572 2d73 6964 6520 the server-side │ │ │ │ +0018c000: 5353 4c2f 544c 5320 636f 6e74 6578 742e SSL/TLS context. │ │ │ │ +0018c010: 223e 736f 6170 5f73 736c 5f73 6572 7665 ">soap_ssl_serve │ │ │ │ +0018c020: 725f 636f 6e74 6578 743c 2f61 3e3c 2f63 r_context with │ │ │ │ +0018c040: 2353 4f41 505f 5353 4c5f 5245 5155 4952 #SOAP_SSL_REQUIR │ │ │ │ +0018c050: 455f 434c 4945 4e54 5f41 5554 4845 4e54 E_CLIENT_AUTHENT │ │ │ │ +0018c060: 4943 4154 494f 4e3c 2f63 6f64 653e 2e20 ICATION. │ │ │ │ +0018c070: 5468 6520 3c63 6f64 653e 6f6b 3c2f 636f The ok parameter of │ │ │ │ +0018c090: 2074 6869 7320 6361 6c6c 6261 636b 2069 this callback i │ │ │ │ +0018c0a0: 6e64 6963 6174 6573 2077 6865 7468 6572 ndicates whether │ │ │ │ +0018c0b0: 2074 6865 2076 6572 6966 6963 6174 696f the verificatio │ │ │ │ +0018c0c0: 6e20 6f66 2074 6865 2063 6572 7469 6669 n of the certifi │ │ │ │ +0018c0d0: 6361 7465 2069 6e20 7175 6573 7469 6f6e cate in question │ │ │ │ +0018c0e0: 2070 6173 7365 6420 283c 636f 6465 3e6f passed (o │ │ │ │ +0018c0f0: 6b3c 2f63 6f64 653e 203d 3d20 3129 206f k == 1) o │ │ │ │ +0018c100: 7220 6661 696c 6564 2028 3c63 6f64 653e r failed ( │ │ │ │ +0018c110: 6f6b 3c2f 636f 6465 3e20 3d3d 2030 2920 ok == 0) │ │ │ │ +0018c120: 6173 2064 6574 6572 6d69 6e65 6420 6279 as determined by │ │ │ │ +0018c130: 2074 6865 204f 7065 6e53 534c 206c 6962 the OpenSSL lib │ │ │ │ +0018c140: 7261 7279 2062 6173 6564 206f 6e20 7468 rary based on th │ │ │ │ +0018c150: 6520 3c63 6f64 653e 3c61 2063 6c61 7373 e soap_ │ │ │ │ +0018c1e0: 7373 6c5f 636c 6965 6e74 5f63 6f6e 7465 ssl_client_conte │ │ │ │ +0018c1f0: 7874 3c2f 613e 3c2f 636f 6465 3e20 6f72 xt or │ │ │ │ +0018c200: 203c 636f 6465 3e3c 6120 636c 6173 733d soap_s │ │ │ │ +0018c290: 736c 5f73 6572 7665 725f 636f 6e74 6578 sl_server_contex │ │ │ │ +0018c2a0: 743c 2f61 3e3c 2f63 6f64 653e 2063 6f6e t con │ │ │ │ +0018c2b0: 6669 6775 7261 7469 6f6e 2e20 4966 2074 figuration. If t │ │ │ │ +0018c2c0: 6865 2063 616c 6c62 6163 6b20 7265 7475 he callback retu │ │ │ │ +0018c2d0: 726e 7320 3120 7468 656e 2074 6865 2068 rns 1 then the h │ │ │ │ +0018c2e0: 616e 6473 6861 6b65 2069 7320 636f 6e74 andshake is cont │ │ │ │ +0018c2f0: 696e 7565 6420 616e 6420 7468 6520 636f inued and the co │ │ │ │ +0018c300: 6e6e 6563 7469 6f6e 206d 6179 6265 2065 nnection maybe e │ │ │ │ +0018c310: 7374 6162 6c69 7368 6564 2e20 546f 2072 stablished. To r │ │ │ │ +0018c320: 6574 7572 6e20 3120 7768 656e 203c 636f eturn 1 when ok == │ │ │ │ +0018c340: 3020 7265 7175 6972 6573 2072 6573 6574 0 requires reset │ │ │ │ +0018c350: 7469 6e67 2074 6865 2065 7272 6f72 2073 ting the error s │ │ │ │ +0018c360: 7461 7465 2077 6974 6820 3c63 6f64 653e tate with │ │ │ │ +0018c370: 5835 3039 5f53 544f 5245 5f43 5458 5f73 X509_STORE_CTX_s │ │ │ │ +0018c380: 6574 5f65 7272 6f72 2873 746f 7265 2c20 et_error(store, │ │ │ │ +0018c390: 5835 3039 5f56 5f4f 4b29 3c2f 636f 6465 X509_V_OK). If the callba │ │ │ │ +0018c3b0: 636b 2072 6574 7572 6e73 2030 2074 6865 ck returns 0 the │ │ │ │ +0018c3c0: 6e20 7468 6520 6861 6e64 7368 616b 6520 n the handshake │ │ │ │ +0018c3d0: 6973 2069 6d6d 6564 6961 7465 6c79 2074 is immediately t │ │ │ │ +0018c3e0: 6572 6d69 6e61 7465 6420 7769 7468 2022 erminated with " │ │ │ │ +0018c3f0: 7665 7269 6669 6361 7469 6f6e 2066 6169 verification fai │ │ │ │ +0018c400: 6c65 6422 2061 6e64 2061 2076 6572 6966 led" and a verif │ │ │ │ +0018c410: 6963 6174 696f 6e20 6661 696c 7572 6520 ication failure │ │ │ │ +0018c420: 616c 6572 7420 6973 2073 656e 7420 746f alert is sent to │ │ │ │ +0018c430: 2074 6865 2070 6565 722e 2054 6865 2062 the peer. The b │ │ │ │ +0018c440: 7569 6c74 2d69 6e20 6675 6e63 7469 6f6e uilt-in function │ │ │ │ +0018c450: 2061 7373 6967 6e65 6420 746f 203c 636f assigned to s │ │ │ │ +0018c520: 6f61 703a 3a66 7373 6c76 6572 6966 793c oap::fsslverify< │ │ │ │ +0018c530: 2f61 3e3c 2f63 6f64 653e 2069 7320 3c63 /a> is ssl_verify_c │ │ │ │ +0018c550: 616c 6c62 6163 6b3c 2f63 6f64 653e 206f allback o │ │ │ │ +0018c560: 7220 7768 656e 203c 636f 6465 3e23 534f r when #SO │ │ │ │ +0018c570: 4150 5f53 534c 5f41 4c4c 4f57 5f45 5850 AP_SSL_ALLOW_EXP │ │ │ │ +0018c580: 4952 4544 5f43 4552 5449 4649 4341 5445 IRED_CERTIFICATE │ │ │ │ +0018c590: 3c2f 636f 6465 3e20 6973 2075 7365 6420 is used │ │ │ │ +0018c5a0: 3c63 6f64 653e 7373 6c5f 7665 7269 6679 ssl_verify │ │ │ │ +0018c5b0: 5f63 616c 6c62 6163 6b5f 616c 6c6f 775f _callback_allow_ │ │ │ │ +0018c5c0: 6578 7069 7265 645f 6365 7274 6966 6963 expired_certific │ │ │ │ +0018c5d0: 6174 653c 2f63 6f64 653e 2e3c 2f6c 693e ate.
    • │ │ │ │ +0018c5e0: 0a3c 2f75 6c3e 0a3c 703e f09f 949d 203c .
    .

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

    .

    │ │ │ │ +0018c640: 0a53 534c 2063 6572 7469 6669 6361 7465 .SSL certificate │ │ │ │ +0018c650: 7320 616e 6420 6b65 7920 6669 6c65 733c s and key files< │ │ │ │ +0018c660: 2f68 323e 0a3c 703e 5468 6520 6753 4f41 /h2>.

    The gSOA │ │ │ │ +0018c670: 5020 7061 636b 6167 6520 696e 636c 7564 P package includ │ │ │ │ +0018c680: 6573 2061 203c 656d 3e3c 636f 6465 3e63 es a c │ │ │ │ +0018c690: 6163 6572 7473 2e70 656d 3c2f 636f 6465 acerts.pem file with │ │ │ │ +0018c6b0: 2074 6865 2063 6572 7469 6669 6361 7465 the certificate │ │ │ │ +0018c6c0: 7320 6f66 2061 6c6c 2063 6572 7469 6669 s of all certifi │ │ │ │ +0018c6d0: 6361 7465 2061 7574 686f 7269 7469 6573 cate authorities │ │ │ │ +0018c6e0: 2e20 596f 7520 6361 6e20 7573 6520 7468 . You can use th │ │ │ │ +0018c6f0: 6973 2066 696c 6520 746f 2076 6572 6966 is file to verif │ │ │ │ +0018c700: 7920 7468 6520 6175 7468 656e 7469 6361 y the authentica │ │ │ │ +0018c710: 7469 6f6e 206f 6620 7365 7276 6572 7320 tion of servers │ │ │ │ +0018c720: 7468 6174 2070 726f 7669 6465 2063 6572 that provide cer │ │ │ │ +0018c730: 7469 6669 6361 7465 7320 6973 7375 6564 tificates issued │ │ │ │ +0018c740: 2062 7920 7468 6573 6520 4341 732e 204a by these CAs. J │ │ │ │ +0018c750: 7573 7420 7365 7420 7468 6520 3c63 6f64 ust set the cafile │ │ │ │ +0018c770: 7061 7261 6d65 7465 7220 746f 2074 6865 parameter to the │ │ │ │ +0018c780: 206c 6f63 6174 696f 6e20 6f66 2074 6869 location of thi │ │ │ │ +0018c790: 7320 6669 6c65 206f 6e20 796f 7572 2066 s file on your f │ │ │ │ +0018c7a0: 696c 6520 7379 7374 656d 2e20 5468 6572 ile system. Ther │ │ │ │ +0018c7b0: 6566 6f72 652c 2077 6865 6e20 796f 7520 efore, when you │ │ │ │ +0018c7c0: 6f62 7461 696e 2061 2063 6572 7469 6669 obtain a certifi │ │ │ │ +0018c7d0: 6361 7465 2073 6967 6e65 6420 6279 2061 cate signed by a │ │ │ │ +0018c7e0: 2074 7275 7374 6564 2043 4120 796f 7520 trusted CA you │ │ │ │ +0018c7f0: 6361 6e20 7369 6d70 6c79 2075 7365 2074 can simply use t │ │ │ │ +0018c800: 6865 203c 656d 3e3c 636f 6465 3e63 6163 he cac │ │ │ │ +0018c810: 6572 7473 2e70 656d 3c2f 636f 6465 3e3c erts.pem< │ │ │ │ +0018c820: 2f65 6d3e 2066 696c 6520 746f 2064 6576 /em> file to dev │ │ │ │ +0018c830: 656c 6f70 2063 6c69 656e 7420 6170 706c elop client appl │ │ │ │ +0018c840: 6963 6174 696f 6e73 2074 6861 7420 6361 ications that ca │ │ │ │ +0018c850: 6e20 7665 7269 6679 2074 6865 2061 7574 n verify the aut │ │ │ │ +0018c860: 6865 6e74 6963 6974 7920 6f66 2079 6f75 henticity of you │ │ │ │ +0018c870: 7220 7365 7276 6572 2e3c 2f70 3e0a 3c70 r server.

    .

    Alternatively, │ │ │ │ +0018c890: 796f 7520 6361 6e20 7573 6520 7468 6520 you can use the │ │ │ │ +0018c8a0: 3c65 6d3e 3c63 6f64 653e 6773 6f61 702f gsoap/ │ │ │ │ +0018c8b0: 706c 7567 696e 2f63 6163 6572 7473 2e68 plugin/cacerts.h │ │ │ │ +0018c8c0: 3c2f 636f 6465 3e3c 2f65 6d3e 2061 6e64 and │ │ │ │ +0018c8d0: 203c 656d 3e3c 636f 6465 3e67 736f 6170 gsoap │ │ │ │ +0018c8e0: 2f70 6c75 6769 6e2f 6361 6365 7274 732e /plugin/cacerts. │ │ │ │ +0018c8f0: 633c 2f63 6f64 653e 3c2f 656d 3e20 636f c co │ │ │ │ +0018c900: 6465 2074 6f20 656d 6265 6420 4341 2063 de to embed CA c │ │ │ │ +0018c910: 6572 7469 6669 6361 7465 7320 696e 2079 ertificates in y │ │ │ │ +0018c920: 6f75 7220 636c 6965 6e74 2063 6f64 652e our client code. │ │ │ │ +0018c930: 3c2f 703e 0a3c 703e 466f 7220 7379 7374

    .

    For syst │ │ │ │ +0018c940: 656d 7320 6261 7365 6420 6f6e 204d 6963 ems based on Mic │ │ │ │ +0018c950: 726f 736f 6674 2077 696e 646f 7773 2c20 rosoft windows, │ │ │ │ +0018c960: 7468 6520 5769 6e49 6e65 7420 6d6f 6475 the WinInet modu │ │ │ │ +0018c970: 6c65 2063 616e 2062 6520 7573 6564 2069 le can be used i │ │ │ │ +0018c980: 6e73 7465 6164 2c20 7365 6520 7468 6520 nstead, see the │ │ │ │ +0018c990: 3c63 6f64 653e 5245 4144 4d45 2e74 7874 README.txt │ │ │ │ +0018c9a0: 3c2f 636f 6465 3e20 6c6f 6361 7465 6420 located │ │ │ │ +0018c9b0: 696e 2074 6865 2067 534f 4150 2073 6f75 in the gSOAP sou │ │ │ │ +0018c9c0: 7263 6520 636f 6465 2070 6163 6b61 6765 rce code package │ │ │ │ +0018c9d0: 2075 6e64 6572 203c 636f 6465 3e6d 6f64 under mod │ │ │ │ +0018c9e0: 5f67 736f 6170 2f67 736f 6170 5f77 696e _gsoap/gsoap_win │ │ │ │ +0018c9f0: 2f77 696e 696e 6574 3c2f 636f 6465 3e2c /wininet, │ │ │ │ +0018ca00: 2073 6565 2074 6865 2067 534f 4150 203c see the gSOAP < │ │ │ │ +0018ca10: 6120 6872 6566 3d22 2e2e 2f2e 2e2f 7769 a href="../../wi │ │ │ │ +0018ca20: 6e69 6e65 742f 6874 6d6c 2f69 6e64 6578 ninet/html/index │ │ │ │ +0018ca30: 2e68 746d 6c22 3e57 696e 496e 6574 2070 .html">WinInet p │ │ │ │ +0018ca40: 6c75 6769 6e3c 2f61 3e20 646f 6375 6d65 lugin docume │ │ │ │ +0018ca50: 6e74 6174 696f 6e2e 3c2f 703e 0a3c 703e ntation.

    .

    │ │ │ │ +0018ca60: 5468 6520 6f74 6865 7220 3c65 6d3e 3c63 The other .pem< │ │ │ │ +0018ca80: 2f65 6d3e 2066 696c 6573 2069 6e20 7468 /em> files in th │ │ │ │ +0018ca90: 6520 6753 4f41 5020 7061 636b 6167 6520 e gSOAP package │ │ │ │ +0018caa0: 6172 6520 6578 616d 706c 6573 206f 6620 are examples of │ │ │ │ +0018cab0: 7365 6c66 2d73 6967 6e65 6420 6365 7274 self-signed cert │ │ │ │ +0018cac0: 6966 6963 6174 6573 2066 6f72 2074 6573 ificates for tes │ │ │ │ +0018cad0: 7469 6e67 2070 7572 706f 7365 7320 283c ting purposes (< │ │ │ │ +0018cae0: 656d 3e3c 636f 6465 3e63 6163 6572 742e em>cacert. │ │ │ │ +0018caf0: 7065 6d3c 2f63 6f64 653e 3c2f 656d 3e2c pem, │ │ │ │ +0018cb00: 203c 656d 3e3c 636f 6465 3e63 6c69 656e clien │ │ │ │ +0018cb10: 742e 7065 6d3c 2f63 6f64 653e 3c2f 656d t.pem, ser │ │ │ │ +0018cb30: 7665 722e 7065 6d3c 2f63 6f64 653e 3c2f ver.pem). The client.pem and < │ │ │ │ +0018cb70: 656d 3e3c 636f 6465 3e73 6572 7665 722e em>server. │ │ │ │ +0018cb80: 7065 6d3c 2f63 6f64 653e 3c2f 656d 3e20 pem │ │ │ │ +0018cb90: 636f 6e74 6169 6e20 7468 6520 7072 6976 contain the priv │ │ │ │ +0018cba0: 6174 6520 6b65 7920 616e 6420 6365 7274 ate key and cert │ │ │ │ +0018cbb0: 6966 6963 6174 6520 6f66 2074 6865 2063 ificate of the c │ │ │ │ +0018cbc0: 6c69 656e 7420 6f72 2073 6572 7665 722c lient or server, │ │ │ │ +0018cbd0: 2072 6573 7065 6374 6976 656c 792e 2054 respectively. T │ │ │ │ +0018cbe0: 6865 206b 6579 6669 6c65 7320 283c 656d he keyfiles (client.pe │ │ │ │ +0018cc00: 6d3c 2f63 6f64 653e 3c2f 656d 3e20 616e m an │ │ │ │ +0018cc10: 6420 3c65 6d3e 3c63 6f64 653e 7365 7276 d serv │ │ │ │ +0018cc20: 6572 2e70 656d 3c2f 636f 6465 3e3c 2f65 er.pem) are created │ │ │ │ +0018cc40: 6279 2063 6f6e 6361 7465 6e61 7469 6e67 by concatenating │ │ │ │ +0018cc50: 2074 6865 2070 7269 7661 7465 206b 6579 the private key │ │ │ │ +0018cc60: 2050 454d 2077 6974 6820 7468 6520 6365 PEM with the ce │ │ │ │ +0018cc70: 7274 6966 6963 6174 6520 5045 4d2e 2054 rtificate PEM. T │ │ │ │ +0018cc80: 6865 206b 6579 6669 6c65 2073 686f 756c he keyfile shoul │ │ │ │ +0018cc90: 6420 6e6f 7420 6265 2073 6861 7265 6420 d not be shared │ │ │ │ +0018cca0: 7769 7468 2061 6e79 2070 6172 7479 2e20 with any party. │ │ │ │ +0018ccb0: 5769 7468 204f 7065 6e53 534c 2c20 796f With OpenSSL, yo │ │ │ │ +0018ccc0: 7520 6361 6e20 656e 6372 7970 7420 7468 u can encrypt th │ │ │ │ +0018ccd0: 6520 6b65 7966 696c 6573 2077 6974 6820 e keyfiles with │ │ │ │ +0018cce0: 6120 7061 7373 776f 7264 2074 6f20 6f66 a password to of │ │ │ │ +0018ccf0: 6665 7220 736f 6d65 2070 726f 7465 6374 fer some protect │ │ │ │ +0018cd00: 696f 6e20 616e 6420 7468 6520 7061 7373 ion and the pass │ │ │ │ +0018cd10: 776f 7264 2069 7320 7573 6564 2069 6e20 word is used in │ │ │ │ +0018cd20: 7468 6520 636c 6965 6e74 2f73 6572 7665 the client/serve │ │ │ │ +0018cd30: 7220 636f 6465 2074 6f20 7265 6164 2074 r code to read t │ │ │ │ +0018cd40: 6865 206b 6579 6669 6c65 2e20 474e 5554 he keyfile. GNUT │ │ │ │ +0018cd50: 4c53 2064 6f65 7320 6e6f 7420 7375 7070 LS does not supp │ │ │ │ +0018cd60: 6f72 7420 7468 6973 2066 6561 7475 7265 ort this feature │ │ │ │ +0018cd70: 2061 6e64 2063 616e 6e6f 7420 656e 6372 and cannot encr │ │ │ │ +0018cd80: 7970 7420 6f72 2064 6563 7279 7074 2061 ypt or decrypt a │ │ │ │ +0018cd90: 206b 6579 6669 6c65 2e3c 2f70 3e0a 3c70 keyfile.

    .

    You can also cr │ │ │ │ +0018cdb0: 6561 7465 2079 6f75 7220 6f77 6e20 7365 eate your own se │ │ │ │ +0018cdc0: 6c66 2d73 6967 6e65 6420 6365 7274 6966 lf-signed certif │ │ │ │ +0018cdd0: 6963 6174 6573 2e20 5468 6572 6520 6973 icates. There is │ │ │ │ +0018cde0: 206d 6f72 6520 7468 616e 206f 6e65 2077 more than one w │ │ │ │ +0018cdf0: 6179 2074 6f20 6765 6e65 7261 7465 2074 ay to generate t │ │ │ │ +0018ce00: 6865 206e 6563 6573 7361 7279 2066 696c he necessary fil │ │ │ │ +0018ce10: 6573 2066 6f72 2063 6c69 656e 7473 2061 es for clients a │ │ │ │ +0018ce20: 6e64 2073 6572 7665 7273 2e20 5365 6520 nd servers. See │ │ │ │ +0018ce30: 3c61 2068 7265 663d 2268 7474 703a 2f2f http://www.open │ │ │ │ +0018ce60: 7373 6c2e 6f72 673c 2f61 3e20 666f 7220 ssl.org for │ │ │ │ +0018ce70: 696e 666f 726d 6174 696f 6e20 6f6e 204f information on O │ │ │ │ +0018ce80: 7065 6e53 534c 2061 6e64 203c 6120 6872 penSSL and http://si │ │ │ │ +0018cec0: 616c 2e6f 7267 2f68 6f77 746f 2f6f 7065 al.org/howto/ope │ │ │ │ +0018ced0: 6e73 736c 2f63 612f 3c2f 613e 206f 6e20 nssl/ca/ on │ │ │ │ +0018cee0: 686f 7720 746f 2073 6574 7570 2061 6e64 how to setup and │ │ │ │ +0018cef0: 206d 616e 6167 6520 6120 6c6f 6361 6c20 manage a local │ │ │ │ +0018cf00: 4341 2061 6e64 203c 6120 6872 6566 3d22 CA and http: │ │ │ │ +0018cf40: 2f2f 7369 616c 2e6f 7267 2f68 6f77 746f //sial.org/howto │ │ │ │ +0018cf50: 2f6f 7065 6e73 736c 2f73 656c 662d 7369 /openssl/self-si │ │ │ │ +0018cf60: 676e 6564 3c2f 613e 206f 6e20 686f 7720 gned on how │ │ │ │ +0018cf70: 746f 2073 6574 7570 2073 656c 662d 7369 to setup self-si │ │ │ │ +0018cf80: 676e 6564 2074 6573 7420 6365 7274 6966 gned test certif │ │ │ │ +0018cf90: 6963 6174 6573 2e3c 2f70 3e0a 3c70 3e49 icates.

    .

    I │ │ │ │ +0018cfa0: 7420 6973 2070 6f73 7369 626c 6520 746f t is possible to │ │ │ │ +0018cfb0: 2063 6f6e 7665 7274 2049 4953 2d67 656e convert IIS-gen │ │ │ │ +0018cfc0: 6572 6174 6564 2063 6572 7469 6669 6361 erated certifica │ │ │ │ +0018cfd0: 7465 7320 746f 2050 454d 2066 6f72 6d61 tes to PEM forma │ │ │ │ +0018cfe0: 7420 7769 7468 2074 6865 206f 7065 6e73 t with the opens │ │ │ │ +0018cff0: 736c 206c 6962 7261 7279 2061 6e64 206f sl library and o │ │ │ │ +0018d000: 7065 6e73 736c 2063 6f6d 6d61 6e64 2d6c penssl command-l │ │ │ │ +0018d010: 696e 6520 746f 6f6c 3a20 3c2f 703e 3c70 ine tool:

    openssl x509 │ │ │ │ +0018d040: 202d 696e 206d 7963 6572 742e 6365 7220 -in mycert.cer │ │ │ │ +0018d050: 2d69 6e66 6f72 6d20 4445 5220 2d6f 7574 -inform DER -out │ │ │ │ +0018d060: 206d 7963 6572 742e 7065 6d20 2d6f 7574 mycert.pem -out │ │ │ │ +0018d070: 666f 726d 2050 454d 0a3c 2f70 7265 3e3c form PEM.< │ │ │ │ +0018d080: 703e 2054 6869 7320 636f 6e76 6572 7473 p> This converts │ │ │ │ +0018d090: 2074 6865 2043 5254 2d66 6f72 6d61 7474 the CRT-formatt │ │ │ │ +0018d0a0: 6564 206d 7963 6572 742e 6365 7220 746f ed mycert.cer to │ │ │ │ +0018d0b0: 2050 454d 2d66 6f72 6d61 7474 6564 206d PEM-formatted m │ │ │ │ +0018d0c0: 7963 6572 742e 7065 6d2e 3c2f 703e 0a3c ycert.pem.

    .< │ │ │ │ +0018d0d0: 703e 4865 7265 2069 7320 7468 6520 7369 p>Here is the si │ │ │ │ +0018d0e0: 6d70 6c65 7374 2077 6179 2074 6f20 7365 mplest way to se │ │ │ │ +0018d0f0: 7475 7020 7365 6c66 2d73 6967 6e65 6420 tup self-signed │ │ │ │ +0018d100: 6365 7274 6966 6963 6174 6573 2e20 4669 certificates. Fi │ │ │ │ +0018d110: 7273 7420 796f 7520 6e65 6564 2074 6f20 rst you need to │ │ │ │ +0018d120: 6372 6561 7465 2061 2070 7269 7661 7465 create a private │ │ │ │ +0018d130: 2043 6572 7469 6669 6361 7465 2041 7574 Certificate Aut │ │ │ │ +0018d140: 686f 7269 7479 2028 4341 292e 2054 6865 hority (CA). The │ │ │ │ +0018d150: 2043 4120 6973 2075 7365 6420 696e 2053 CA is used in S │ │ │ │ +0018d160: 534c 2074 6f20 7665 7269 6679 2074 6865 SL to verify the │ │ │ │ +0018d170: 2061 7574 6865 6e74 6963 6974 7920 6f66 authenticity of │ │ │ │ +0018d180: 2061 2067 6976 656e 2063 6572 7469 6669 a given certifi │ │ │ │ +0018d190: 6361 7465 2e20 5468 6520 4341 2061 6374 cate. The CA act │ │ │ │ +0018d1a0: 7320 6173 2061 2074 7275 7374 6564 2074 s as a trusted t │ │ │ │ +0018d1b0: 6869 7264 2070 6172 7479 2077 686f 2068 hird party who h │ │ │ │ +0018d1c0: 6173 2061 7574 6865 6e74 6963 6174 6564 as authenticated │ │ │ │ +0018d1d0: 2074 6865 2075 7365 7220 6f66 2074 6865 the user of the │ │ │ │ +0018d1e0: 2073 6967 6e65 6420 6365 7274 6966 6963 signed certific │ │ │ │ +0018d1f0: 6174 6520 6173 2062 6569 6e67 2077 686f ate as being who │ │ │ │ +0018d200: 2074 6865 7920 7361 792e 2054 6865 2063 they say. The c │ │ │ │ +0018d210: 6572 7469 6669 6361 7465 2069 7320 7369 ertificate is si │ │ │ │ +0018d220: 676e 6564 2062 7920 7468 6520 4341 2c20 gned by the CA, │ │ │ │ +0018d230: 616e 6420 6966 2074 6865 2063 6c69 656e and if the clien │ │ │ │ +0018d240: 7420 7472 7573 7473 2074 6865 2043 412c t trusts the CA, │ │ │ │ +0018d250: 2069 7420 7769 6c6c 2074 7275 7374 2079 it will trust y │ │ │ │ +0018d260: 6f75 7220 6365 7274 6966 6963 6174 652e our certificate. │ │ │ │ +0018d270: 2046 6f72 2075 7365 2077 6974 6869 6e20 For use within │ │ │ │ +0018d280: 796f 7572 206f 7267 616e 697a 6174 696f your organizatio │ │ │ │ +0018d290: 6e2c 2061 2070 7269 7661 7465 2043 4120 n, a private CA │ │ │ │ +0018d2a0: 7769 6c6c 2070 726f 6261 626c 7920 7365 will probably se │ │ │ │ +0018d2b0: 7276 6520 796f 7572 206e 6565 6473 2e20 rve your needs. │ │ │ │ +0018d2c0: 486f 7765 7665 722c 2069 6620 796f 7520 However, if you │ │ │ │ +0018d2d0: 696e 7465 6e64 2075 7365 2079 6f75 7220 intend use your │ │ │ │ +0018d2e0: 6365 7274 6966 6963 6174 6573 2066 6f72 certificates for │ │ │ │ +0018d2f0: 2061 2070 7562 6c69 6320 7365 7276 6963 a public servic │ │ │ │ +0018d300: 652c 2079 6f75 2073 686f 756c 6420 7072 e, you should pr │ │ │ │ +0018d310: 6f62 6162 6c79 206f 6274 6169 6e20 6120 obably obtain a │ │ │ │ +0018d320: 6365 7274 6966 6963 6174 6520 6672 6f6d certificate from │ │ │ │ +0018d330: 2061 206b 6e6f 776e 2043 412e 2049 6e20 a known CA. In │ │ │ │ +0018d340: 6164 6469 7469 6f6e 2074 6f20 6964 656e addition to iden │ │ │ │ +0018d350: 7469 6669 6361 7469 6f6e 2c20 796f 7572 tification, your │ │ │ │ +0018d360: 2063 6572 7469 6669 6361 7465 2069 7320 certificate is │ │ │ │ +0018d370: 616c 736f 2075 7365 6420 666f 7220 656e also used for en │ │ │ │ +0018d380: 6372 7970 7469 6f6e 2e3c 2f70 3e0a 3c70 cryption.

    .

    Creating certif │ │ │ │ +0018d3a0: 6963 6174 6573 2073 686f 756c 6420 6265 icates should be │ │ │ │ +0018d3b0: 2064 6f6e 6520 7468 726f 7567 6820 6120 done through a │ │ │ │ +0018d3c0: 4341 2074 6f20 6f62 7461 696e 2073 6967 CA to obtain sig │ │ │ │ +0018d3d0: 6e65 6420 6365 7274 6966 6963 6174 6573 ned certificates │ │ │ │ +0018d3e0: 2e20 4275 7420 796f 7520 6361 6e20 6372 . But you can cr │ │ │ │ +0018d3f0: 6561 7465 2079 6f75 7220 6f77 6e20 6365 eate your own ce │ │ │ │ +0018d400: 7274 6966 6963 6174 6573 2066 6f72 2074 rtificates for t │ │ │ │ +0018d410: 6573 7469 6e67 2070 7572 706f 7365 7320 esting purposes │ │ │ │ +0018d420: 6173 2066 6f6c 6c6f 7773 2e3c 2f70 3e0a as follows.

    . │ │ │ │ +0018d430: 3c75 6c3e 0a3c 6c69 3e47 6f20 746f 2074
      .
    • Go to t │ │ │ │ +0018d440: 6865 204f 7065 6e53 534c 2062 696e 2064 he OpenSSL bin d │ │ │ │ +0018d450: 6972 6563 746f 7279 2028 3c63 6f64 653e irectory ( │ │ │ │ +0018d460: 2f75 7372 2f6c 6f63 616c 2f73 736c 3c2f /usr/local/ssl by default │ │ │ │ +0018d480: 2061 6e64 203c 636f 6465 3e2f 5379 7374 and /Syst │ │ │ │ +0018d490: 656d 2f4c 6962 7261 7279 2f4f 7065 6e53 em/Library/OpenS │ │ │ │ +0018d4a0: 534c 3c2f 636f 6465 3e20 6f6e 204d 6163 SL on Mac │ │ │ │ +0018d4b0: 204f 5320 5829 3c2f 6c69 3e0a 3c6c 693e OS X)
    • .
    • │ │ │ │ +0018d4c0: 5468 6572 6520 7368 6f75 6c64 2062 6520 There should be │ │ │ │ +0018d4d0: 6120 6669 6c65 2063 616c 6c65 6420 6f70 a file called op │ │ │ │ +0018d4e0: 656e 7373 6c2e 636e 663c 2f6c 693e 0a3c enssl.cnf
    • .< │ │ │ │ +0018d4f0: 6c69 3e43 7265 6174 6520 6120 6e65 7720 li>Create a new │ │ │ │ +0018d500: 6469 7265 6374 6f72 7920 696e 2079 6f75 directory in you │ │ │ │ +0018d510: 7220 686f 6d65 2061 6363 6f75 6e74 2c20 r home account, │ │ │ │ +0018d520: 652e 672e 2024 484f 4d45 2f43 412c 2061 e.g. $HOME/CA, a │ │ │ │ +0018d530: 6e64 2063 6f70 7920 7468 6520 6f70 656e nd copy the open │ │ │ │ +0018d540: 7373 6c2e 636e 6620 6669 6c65 2074 6f20 ssl.cnf file to │ │ │ │ +0018d550: 7468 6973 2064 6972 6563 746f 7279 3c2f this directory.
    • Modify o │ │ │ │ +0018d570: 7065 6e73 736c 2e63 6e66 2062 7920 6368 penssl.cnf by ch │ │ │ │ +0018d580: 616e 6769 6e67 2074 6865 2027 6469 7227 anging the 'dir' │ │ │ │ +0018d590: 2076 616c 7565 2074 6f20 484f 4d45 2f43 value to HOME/C │ │ │ │ +0018d5a0: 413c 2f6c 693e 0a3c 6c69 3e43 6f70 7920 A
    • .
    • Copy │ │ │ │ +0018d5b0: 7468 6520 5245 4144 4d45 2e74 7874 2c20 the README.txt, │ │ │ │ +0018d5c0: 726f 6f74 2e73 682c 2061 6e64 2063 6572 root.sh, and cer │ │ │ │ +0018d5d0: 742e 7368 2073 6372 6970 7473 2066 726f t.sh scripts fro │ │ │ │ +0018d5e0: 6d20 7468 6520 6753 4f41 5020 736f 7572 m the gSOAP sour │ │ │ │ +0018d5f0: 6365 2063 6f64 6520 7061 636b 6167 6520 ce code package │ │ │ │ +0018d600: 6c6f 6361 7465 6420 696e 2074 6865 203c located in the < │ │ │ │ +0018d610: 656d 3e3c 636f 6465 3e67 736f 6170 2f73 em>gsoap/s │ │ │ │ +0018d620: 616d 706c 6573 2f73 736c 3c2f 636f 6465 amples/ssl directory │ │ │ │ +0018d640: 2074 6f20 484f 4d45 2f43 413c 2f6c 693e to HOME/CA
    • │ │ │ │ +0018d650: 0a3c 6c69 3e46 6f6c 6c6f 7720 7468 6520 .
    • Follow the │ │ │ │ +0018d660: 5245 4144 4d45 2e74 7874 2069 6e73 7472 README.txt instr │ │ │ │ +0018d670: 7563 7469 6f6e 733c 2f6c 693e 0a3c 2f75 uctions
    • ..

      You now ha │ │ │ │ +0018d690: 7665 2061 2073 656c 662d 7369 676e 6564 ve a self-signed │ │ │ │ +0018d6a0: 2043 4120 726f 6f74 2063 6572 7469 6669 CA root certifi │ │ │ │ +0018d6b0: 6361 7465 2063 6163 6572 742e 7065 6d20 cate cacert.pem │ │ │ │ +0018d6c0: 616e 6420 6120 7365 7276 6572 2e70 656d and a server.pem │ │ │ │ +0018d6d0: 2028 6f72 2063 6c69 656e 742e 7065 6d29 (or client.pem) │ │ │ │ +0018d6e0: 2063 6572 7469 6669 6361 7465 2069 6e20 certificate in │ │ │ │ +0018d6f0: 5045 4d20 666f 726d 6174 2e20 5468 6520 PEM format. The │ │ │ │ +0018d700: 6361 6365 7274 2e70 656d 2063 6572 7469 cacert.pem certi │ │ │ │ +0018d710: 6669 6361 7465 2069 7320 7573 6564 2069 ficate is used i │ │ │ │ +0018d720: 6e20 7468 6520 3c63 6f64 653e 6361 6669 n the cafi │ │ │ │ +0018d730: 6c65 3c2f 636f 6465 3e20 7061 7261 6d65 le parame │ │ │ │ +0018d740: 7465 7220 6f66 2074 6865 203c 636f 6465 ter of the soap_ssl_cli │ │ │ │ +0018d7e0: 656e 745f 636f 6e74 6578 743c 2f61 3e3c ent_context< │ │ │ │ +0018d7f0: 2f63 6f64 653e 2028 6f72 203c 636f 6465 /code> (or soap_ssl_ser │ │ │ │ +0018d890: 7665 725f 636f 6e74 6578 743c 2f61 3e3c ver_context< │ │ │ │ +0018d8a0: 2f63 6f64 653e 2920 6174 2074 6865 2063 /code>) at the c │ │ │ │ +0018d8b0: 6c69 656e 7420 286f 7220 7365 7276 6572 lient (or server │ │ │ │ +0018d8c0: 2920 7369 6465 2074 6f20 7665 7269 6679 ) side to verify │ │ │ │ +0018d8d0: 2074 6865 2061 7574 6865 6e74 6963 6974 the authenticit │ │ │ │ +0018d8e0: 7920 6f66 2074 6865 2070 6565 722e 2059 y of the peer. Y │ │ │ │ +0018d8f0: 6f75 2063 616e 2061 6c73 6f20 7072 6f76 ou can also prov │ │ │ │ +0018d900: 6964 6520 6120 6361 7061 7468 2070 6172 ide a capath par │ │ │ │ +0018d910: 616d 6574 6572 2074 6f20 7468 6573 6520 ameter to these │ │ │ │ +0018d920: 7472 7573 7465 6420 6365 7274 6966 6963 trusted certific │ │ │ │ +0018d930: 6174 6573 2e20 5468 6520 7365 7276 6572 ates. The server │ │ │ │ +0018d940: 2e70 656d 2028 6f72 2063 6c69 656e 742e .pem (or client. │ │ │ │ +0018d950: 7065 6d29 206d 7573 7420 6265 2070 726f pem) must be pro │ │ │ │ +0018d960: 7669 6465 6420 7769 7468 2074 6865 203c vided with the < │ │ │ │ +0018d970: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soap_ssl │ │ │ │ +0018da00: 5f73 6572 7665 725f 636f 6e74 6578 743c _server_context< │ │ │ │ +0018da10: 2f61 3e3c 2f63 6f64 653e 2061 7420 7468 /a> at th │ │ │ │ +0018da20: 6520 7365 7276 6572 2073 6964 6520 286f e server side (o │ │ │ │ +0018da30: 7220 3c63 6f64 653e 3c61 2063 6c61 7373 r soap_ │ │ │ │ +0018dac0: 7373 6c5f 636c 6965 6e74 5f63 6f6e 7465 ssl_client_conte │ │ │ │ +0018dad0: 7874 3c2f 613e 3c2f 636f 6465 3e20 6174 xt at │ │ │ │ +0018dae0: 2074 6865 2063 6c69 656e 7420 7369 6465 the client side │ │ │ │ +0018daf0: 2920 746f 6765 7468 6572 2077 6974 6820 ) together with │ │ │ │ +0018db00: 7468 6520 7061 7373 776f 7264 2079 6f75 the password you │ │ │ │ +0018db10: 2065 6e74 6572 6564 2077 6865 6e20 6765 entered when ge │ │ │ │ +0018db20: 6e65 7261 7469 6e67 2074 6865 2063 6572 nerating the cer │ │ │ │ +0018db30: 7469 6669 6361 7465 2075 7369 6e67 2063 tificate using c │ │ │ │ +0018db40: 6572 742e 7368 2074 6f20 6163 6365 7373 ert.sh to access │ │ │ │ +0018db50: 2074 6865 2066 696c 652e 2054 6865 7365 the file. These │ │ │ │ +0018db60: 2063 6572 7469 6669 6361 7465 7320 6d75 certificates mu │ │ │ │ +0018db70: 7374 2062 6520 7072 6573 656e 7420 746f st be present to │ │ │ │ +0018db80: 2067 7261 6e74 2061 7574 6865 6e74 6963 grant authentic │ │ │ │ +0018db90: 6174 696f 6e20 7265 7175 6573 7473 2062 ation requests b │ │ │ │ +0018dba0: 7920 7065 6572 732e 2049 6e20 6164 6469 y peers. In addi │ │ │ │ +0018dbb0: 7469 6f6e 2c20 7468 6520 7365 7276 6572 tion, the server │ │ │ │ +0018dbc0: 2e70 656d 2028 616e 6420 636c 6965 6e74 .pem (and client │ │ │ │ +0018dbd0: 2e70 656d 2920 696e 636c 7564 6520 7468 .pem) include th │ │ │ │ +0018dbe0: 6520 686f 7374 206e 616d 6520 6f66 2074 e host name of t │ │ │ │ +0018dbf0: 6865 206d 6163 6869 6e65 206f 6e20 7768 he machine on wh │ │ │ │ +0018dc00: 6963 6820 7468 6520 6170 706c 6963 6174 ich the applicat │ │ │ │ +0018dc10: 696f 6e20 7275 6e73 2028 652e 672e 206c ion runs (e.g. l │ │ │ │ +0018dc20: 6f63 616c 686f 7374 292c 2073 6f20 796f ocalhost), so yo │ │ │ │ +0018dc30: 7520 6e65 6564 2074 6f20 6765 6e65 7261 u need to genera │ │ │ │ +0018dc40: 7465 206e 6577 2063 6572 7469 6669 6361 te new certifica │ │ │ │ +0018dc50: 7465 7320 7768 656e 206d 6967 7261 7469 tes when migrati │ │ │ │ +0018dc60: 6e67 2061 2073 6572 7665 7220 286f 7220 ng a server (or │ │ │ │ +0018dc70: 636c 6965 6e74 292e 3c2f 703e 0a3c 703e client).

      .

      │ │ │ │ +0018dc80: 4669 6e61 6c6c 792c 2079 6f75 206e 6565 Finally, you nee │ │ │ │ +0018dc90: 6420 746f 2067 656e 6572 6174 6520 4469 d to generate Di │ │ │ │ +0018dca0: 6666 6965 2d48 656c 6d61 6e6e 2028 4448 ffie-Helmann (DH │ │ │ │ +0018dcb0: 2920 7061 7261 6d65 7465 7273 2066 6f72 ) parameters for │ │ │ │ +0018dcc0: 2074 6865 2073 6572 7665 7220 6966 2079 the server if y │ │ │ │ +0018dcd0: 6f75 2077 6973 6820 746f 2075 7365 2044 ou wish to use D │ │ │ │ +0018dce0: 4820 696e 7374 6561 6420 6f66 2052 5341 H instead of RSA │ │ │ │ +0018dcf0: 2e20 5468 6572 6520 6172 6520 7477 6f20 . There are two │ │ │ │ +0018dd00: 6f70 7469 6f6e 733a 3c2f 703e 0a3c 756c options:

      .
      .

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

      .< │ │ │ │ +0018e010: 6832 3e3c 6120 636c 6173 733d 2261 6e63 h2> │ │ │ │ +0018e030: 3c2f 613e 0a53 534c 2068 6172 6477 6172 .SSL hardwar │ │ │ │ +0018e040: 6520 6163 6365 6c65 7261 7469 6f6e 3c2f e acceleration.

      You can s │ │ │ │ +0018e060: 7065 6369 6679 2061 2068 6172 6477 6172 pecify a hardwar │ │ │ │ +0018e070: 6520 656e 6769 6e65 2074 6f20 656e 6162 e engine to enab │ │ │ │ +0018e080: 6c65 2068 6172 6477 6172 6520 7375 7070 le hardware supp │ │ │ │ +0018e090: 6f72 7420 666f 7220 6372 7970 746f 6772 ort for cryptogr │ │ │ │ +0018e0a0: 6170 6869 6320 6163 6365 6c65 7261 7469 aphic accelerati │ │ │ │ +0018e0b0: 6f6e 2e20 5468 6973 2063 616e 2062 6520 on. This can be │ │ │ │ +0018e0c0: 646f 6e65 206f 6e63 6520 696e 2061 2073 done once in a s │ │ │ │ +0018e0d0: 6572 7665 7220 6f72 2063 6c69 656e 7420 erver or client │ │ │ │ +0018e0e0: 7769 7468 2074 6865 2066 6f6c 6c6f 7769 with the followi │ │ │ │ +0018e0f0: 6e67 2073 7461 7465 6d65 6e74 733a 3c2f ng statements:.

      static < │ │ │ │ +0018e150: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +0018e160: 6f72 6422 3e63 6f6e 7374 3c2f 7370 616e ord">const char │ │ │ │ +0018e190: 3c2f 7370 616e 3e20 2a65 6e67 696e 6520 *engine │ │ │ │ +0018e1a0: 3d20 3c73 7061 6e20 636c 6173 733d 2273 = &q │ │ │ │ +0018e1c0: 756f 743b 6373 7769 6674 2671 756f 743b uot;cswift" │ │ │ │ +0018e1d0: 3c2f 7370 616e 3e3b 203c 7370 616e 2063 ; / │ │ │ │ +0018e1f0: 2a20 656e 6769 6e65 206e 616d 6520 2a2f * engine name */ │ │ │ │ +0018e200: 3c2f 7370 616e 3e20 3c2f 6469 763e 0a3c
      .< │ │ │ │ +0018e210: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +0018e220: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >int main() .
      {
      . │ │ │ │ +0018e280: 2020 454e 4749 4e45 202a 653b 203c 2f64 ENGINE *e; .
      if (!(e │ │ │ │ +0018e2d0: 203d 2045 4e47 494e 455f 6279 5f69 6428 = ENGINE_by_id( │ │ │ │ +0018e2e0: 656e 6769 6e65 2929 2920 3c2f 6469 763e engine)))
      │ │ │ │ +0018e2f0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
      fprintf(s │ │ │ │ +0018e310: 7464 6572 722c 203c 7370 616e 2063 6c61 tderr, "Error f │ │ │ │ +0018e340: 696e 6469 6e67 2065 6e67 696e 6520 2573 inding engine %s │ │ │ │ +0018e350: 5c6e 2671 756f 743b 3c2f 7370 616e 3e2c \n", │ │ │ │ +0018e360: 2065 6e67 696e 6529 3b20 3c2f 6469 763e engine);
      │ │ │ │ +0018e370: 0a3c 6469 7620 636c 6173 733d 226c 696e .
      e │ │ │ │ +0018e3a0: 6c73 653c 2f73 7061 6e3e 203c 7370 616e lse if ( │ │ │ │ +0018e3d0: 2145 4e47 494e 455f 7365 745f 6465 6661 !ENGINE_set_defa │ │ │ │ +0018e3e0: 756c 7428 652c 2045 4e47 494e 455f 4d45 ult(e, ENGINE_ME │ │ │ │ +0018e3f0: 5448 4f44 5f41 4c4c 2929 203c 2f64 6976 THOD_ALL))
      .
      fprintf( │ │ │ │ +0018e420: 7374 6465 7272 2c20 3c73 7061 6e20 636c stderr, "Error │ │ │ │ +0018e450: 7573 696e 6720 656e 6769 6e65 2025 735c using engine %s\ │ │ │ │ +0018e460: 6e26 7175 6f74 3b3c 2f73 7061 6e3e 2c20 n", │ │ │ │ +0018e470: 656e 6769 6e65 293b 203c 2f64 6976 3e0a engine);
      . │ │ │ │ +0018e480: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
      ... // │ │ │ │ +0018e4b0: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
      . │ │ │ │ +0018e4d0: 7d3c 2f64 6976 3e0a 3c2f 6469 763e 3c21 }
      .

    {< │ │ │ │ +001820c0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    setsoc │ │ │ │ +001820e0: 6b6f 7074 2873 6f63 6b2c 202e 2e2e 2c20 kopt(sock, ..., │ │ │ │ +001820f0: 2e2e 2e2c 202e 2e2e 2c20 2e2e 2e29 3b3c ..., ..., ...);< │ │ │ │ +00182100: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    setsoc │ │ │ │ +00182120: 6b6f 7074 2873 6f63 6b2c 202e 2e2e 2c20 kopt(sock, ..., │ │ │ │ +00182130: 2e2e 2e2c 202e 2e2e 2c20 2e2e 2e29 3b3c ..., ..., ...);< │ │ │ │ +00182140: 2f64 6976 3e0a 3c2f 6469 763e 3c21 2d2d /div>.

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

    .Overriding th │ │ │ │ +001821d0: 6520 686f 7374 2061 6e64 2070 6f72 7420 e host and port │ │ │ │ +001821e0: 746f 2063 6f6e 6e65 6374 3c2f 6832 3e0a to connect

    . │ │ │ │ +001821f0: 3c70 3e54 6f20 6f76 6572 7269 6465 2074

    To override t │ │ │ │ +00182200: 6865 2068 6f73 7420 616e 6420 706f 7274 he host and port │ │ │ │ +00182210: 206f 6620 7468 6520 636c 6965 6e74 2063 of the client c │ │ │ │ +00182220: 6f6e 6e65 6374 696e 6720 746f 2061 2073 onnecting to a s │ │ │ │ +00182230: 6572 7665 722c 2073 6574 203c 636f 6465 erver, set soap::o │ │ │ │ +00182300: 7665 7272 6964 655f 686f 7374 3c2f 613e verride_host │ │ │ │ +00182310: 3c2f 636f 6465 3e20 616e 6420 3c63 6f64 and soap:: │ │ │ │ +001823e0: 6f76 6572 7269 6465 5f70 6f72 743c 2f61 override_port:

    .
    soa │ │ │ │ +00182450: 703c 2f61 3e2d 2667 743b 3c61 2063 6c61 p->override_host │ │ │ │ +001824b0: 3c2f 613e 203d 203c 7370 616e 2063 6c61 = "example │ │ │ │ +001824e0: 2e63 6f6d 2671 756f 743b 3c2f 7370 616e .com"; // host │ │ │ │ +00182510: 206e 616d 6520 6f72 2049 5020 6164 6472 name or IP addr │ │ │ │ +00182520: 6573 7320 3c2f 7370 616e 3e3c 2f64 6976 ess
    ..
    < │ │ │ │ +001826f0: 6469 7620 636c 6173 733d 2274 7464 6563 div class="ttdec │ │ │ │ +00182700: 6922 3e63 6f6e 7374 2063 6861 7220 2a20 i">const char * │ │ │ │ +00182710: 6f76 6572 7269 6465 5f68 6f73 743c 2f64 override_host
    User-defin │ │ │ │ +00182740: 6162 6c65 2073 7472 696e 6720 746f 206f able string to o │ │ │ │ +00182750: 7665 7272 6964 6520 7468 6520 686f 7374 verride the host │ │ │ │ +00182760: 206e 616d 6520 6f72 2049 5020 6164 6472 name or IP addr │ │ │ │ +00182770: 6573 7320 696e 2074 6865 2048 5454 5020 ess in the HTTP │ │ │ │ +00182780: 6865 6164 6572 2077 6865 6e20 636f 6e6e header when conn │ │ │ │ +00182790: 6563 7469 6e67 2061 7420 742e 2e2e 3c2f ecting at t...
    Defini │ │ │ │ +001827c0: 7469 6f6e 3a3c 2f62 3e20 7374 6473 6f61 tion: stdsoa │ │ │ │ +001827d0: 7032 2e68 3a34 3035 343c 2f64 6976 3e3c p2.h:4054
    < │ │ │ │ +001827e0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    < │ │ │ │ +00182830: 6469 7620 636c 6173 733d 2274 746e 616d div class="ttnam │ │ │ │ +00182840: 6522 3e3c 6120 6872 6566 3d22 7374 7275 e">s │ │ │ │ +00182880: 6f61 703a 3a6f 7665 7272 6964 655f 706f oap::override_po │ │ │ │ +00182890: 7274 3c2f 613e 3c2f 6469 763e 3c64 6976 rt
    │ │ │ │ +001828b0: 696e 7420 6f76 6572 7269 6465 5f70 6f72 int override_por │ │ │ │ +001828c0: 743c 2f64 6976 3e3c 6469 7620 636c 6173 t
    User-d │ │ │ │ +001828e0: 6566 696e 6162 6c65 2070 6f72 7420 6e75 efinable port nu │ │ │ │ +001828f0: 6d62 6572 2074 6f20 6f76 6572 7269 6465 mber to override │ │ │ │ +00182900: 2074 6865 2070 6f72 7420 6164 6472 6573 the port addres │ │ │ │ +00182910: 7320 696e 2074 6865 2048 5454 5020 6865 s in the HTTP he │ │ │ │ +00182920: 6164 6572 2077 6865 6e20 636f 6e6e 6563 ader when connec │ │ │ │ +00182930: 7469 6e67 2061 7420 7468 6520 636c 692e ting at the cli. │ │ │ │ +00182940: 2e2e 3c2f 6469 763e 3c64 6976 2063 6c61 ..
    De │ │ │ │ +00182960: 6669 6e69 7469 6f6e 3a3c 2f62 3e20 7374 finition: st │ │ │ │ +00182970: 6473 6f61 7032 2e68 3a34 3035 393c 2f64 dsoap2.h:4059
    .
    │ │ │ │ +00182990: 3c21 2d2d 2066 7261 676d 656e 7420 2d2d

    The soap_ssl_ │ │ │ │ +00185e80: 7365 7276 6572 5f63 6f6e 7465 7874 3c2f server_context functi │ │ │ │ +00185ea0: 6f6e 2069 6e69 7469 616c 697a 6573 2074 on initializes t │ │ │ │ +00185eb0: 6865 2073 6572 7665 722d 7369 6465 2053 he server-side S │ │ │ │ +00185ec0: 534c 2063 6f6e 7465 7874 2e20 5468 6520 SL context. The │ │ │ │ +00185ed0: 3c65 6d3e 3c63 6f64 653e 7365 7276 6572 server │ │ │ │ +00185ee0: 2e70 656d 3c2f 636f 6465 3e3c 2f65 6d3e .pem │ │ │ │ +00185ef0: 206b 6579 2066 696c 6520 6973 2074 6865 key file is the │ │ │ │ +00185f00: 2073 6572 7665 7227 7320 7072 6976 6174 server's privat │ │ │ │ +00185f10: 6520 6b65 7920 636f 6e63 6174 656e 6174 e key concatenat │ │ │ │ +00185f20: 6564 2077 6974 6820 6974 7320 6365 7274 ed with its cert │ │ │ │ +00185f30: 6966 6963 6174 652e 2054 6865 203c 656d ificate. The cacert.pe │ │ │ │ +00185f50: 6d3c 2f63 6f64 653e 3c2f 656d 3e20 6973 m is │ │ │ │ +00185f60: 2075 7365 6420 746f 2061 7574 6865 6e74 used to authent │ │ │ │ +00185f70: 6963 6174 6520 636c 6965 6e74 7320 616e icate clients an │ │ │ │ +00185f80: 6420 636f 6e74 6169 6e73 2074 6865 2063 d contains the c │ │ │ │ +00185f90: 6c69 656e 7420 6365 7274 6966 6963 6174 lient certificat │ │ │ │ +00185fa0: 6573 2e20 416c 7465 726e 6174 6976 656c es. Alternativel │ │ │ │ +00185fb0: 7920 6120 6469 7265 6374 6f72 7920 6e61 y a directory na │ │ │ │ +00185fc0: 6d65 2063 616e 2062 6520 7370 6563 6966 me can be specif │ │ │ │ +00185fd0: 6965 642e 2054 6869 7320 6469 7265 6374 ied. This direct │ │ │ │ +00185fe0: 6f72 7920 6973 2061 7373 756d 6564 2074 ory is assumed t │ │ │ │ +00185ff0: 6f20 636f 6e74 6169 6e20 7468 6520 6365 o contain the ce │ │ │ │ +00186000: 7274 6966 6963 6174 6573 2e20 5468 6520 rtificates. The │ │ │ │ +00186010: 3c65 6d3e 3c63 6f64 653e 6468 3531 322e dh512. │ │ │ │ +00186020: 7065 6d3c 2f63 6f64 653e 3c2f 656d 3e20 pem │ │ │ │ +00186030: 6669 6c65 2073 7065 6369 6669 6573 2074 file specifies t │ │ │ │ +00186040: 6861 7420 4448 2077 696c 6c20 6265 2075 hat DH will be u │ │ │ │ +00186050: 7365 6420 666f 7220 6b65 7920 6167 7265 sed for key agre │ │ │ │ +00186060: 656d 656e 7420 696e 7374 6561 6420 6f66 ement instead of │ │ │ │ +00186070: 2052 5341 2e20 4120 6e75 6d65 7269 6320 RSA. A numeric │ │ │ │ +00186080: 7661 6c75 6520 6772 6561 7465 7220 7468 value greater th │ │ │ │ +00186090: 616e 2035 3132 2063 616e 2062 6520 7072 an 512 can be pr │ │ │ │ +001860a0: 6f76 6964 6564 2069 6e73 7465 6164 2061 ovided instead a │ │ │ │ +001860b0: 7320 6120 7374 7269 6e67 2063 6f6e 7374 s a string const │ │ │ │ +001860c0: 616e 7420 2865 2e67 2e20 3c63 6f64 653e ant (e.g. │ │ │ │ +001860d0: 2235 3132 223c 2f63 6f64 653e 2920 746f "512") to │ │ │ │ +001860e0: 2061 6c6c 6f77 2074 6865 2065 6e67 696e allow the engin │ │ │ │ +001860f0: 6520 746f 2067 656e 6572 6174 6520 7468 e to generate th │ │ │ │ +00186100: 6520 4448 2070 6172 616d 6574 6572 7320 e DH parameters │ │ │ │ +00186110: 6f6e 2074 6865 2066 6c79 2028 7468 6973 on the fly (this │ │ │ │ +00186120: 2063 616e 2074 616b 6520 6120 7768 696c can take a whil │ │ │ │ +00186130: 6529 2072 6174 6865 7220 7468 616e 2072 e) rather than r │ │ │ │ +00186140: 6574 7269 6576 696e 6720 7468 656d 2066 etrieving them f │ │ │ │ +00186150: 726f 6d20 6120 6669 6c65 2e20 5468 6520 rom a file. The │ │ │ │ +00186160: 7261 6e64 6669 6c65 2065 6e74 7279 2063 randfile entry c │ │ │ │ +00186170: 616e 2062 6520 7573 6564 2074 6f20 7365 an be used to se │ │ │ │ +00186180: 6564 2074 6865 2050 524e 472e 2054 6865 ed the PRNG. The │ │ │ │ +00186190: 206c 6173 7420 656e 7472 7920 656e 6162 last entry enab │ │ │ │ +001861a0: 6c65 2073 6572 7665 722d 7369 6465 2073 le server-side s │ │ │ │ +001861b0: 6573 7369 6f6e 2063 6163 6869 6e67 2074 ession caching t │ │ │ │ +001861c0: 6f20 7370 6565 6420 7570 2054 4c53 2e20 o speed up TLS. │ │ │ │ +001861d0: 4120 756e 6971 7565 2073 6572 7665 7220 A unique server │ │ │ │ +001861e0: 6e61 6d65 2069 7320 7265 7175 6972 6564 name is required │ │ │ │ +001861f0: 2e3c 2f70 3e0a 3c70 3e59 6f75 2063 616e .

    .

    You can │ │ │ │ +00186200: 2073 7065 6369 6679 2061 2063 6970 6865 specify a ciphe │ │ │ │ +00186210: 7220 6c69 7374 2074 6f20 7573 6520 7769 r list to use wi │ │ │ │ +00186220: 7468 2054 4c53 7631 2e32 2061 6e64 2062 th TLSv1.2 and b │ │ │ │ +00186230: 656c 6f77 2077 6974 6820 3c63 6f64 653e elow with │ │ │ │ +00186240: 5353 4c5f 4354 585f 7365 745f 6369 7068 SSL_CTX_set_ciph │ │ │ │ +00186250: 6572 5f6c 6973 7428 736f 6170 2d26 6774 er_list(soap-> │ │ │ │ +00186260: 3b63 7478 2c20 222e 2e2e 2229 3c2f 636f ;ctx, "...") where │ │ │ │ +00186280: 736f 6170 2d26 6774 3b63 7478 3c2f 636f soap->ctx is the SSL c │ │ │ │ +001862a0: 6f6e 7465 7874 2063 7265 6174 6564 2062 ontext created b │ │ │ │ +001862b0: 7920 3c63 6f64 653e 3c61 2063 6c61 7373 y soap_ │ │ │ │ +00186340: 7373 6c5f 7365 7276 6572 5f63 6f6e 7465 ssl_server_conte │ │ │ │ +00186350: 7874 2829 3c2f 613e 3c2f 636f 6465 3e2e xt(). │ │ │ │ +00186360: 204c 696b 6577 6973 652c 2075 7365 203c Likewise, use < │ │ │ │ +00186370: 636f 6465 3e53 534c 5f43 5458 5f73 6574 code>SSL_CTX_set │ │ │ │ +00186380: 5f63 6970 6865 7273 7569 7465 7328 736f _ciphersuites(so │ │ │ │ +00186390: 6170 2d26 6774 3b63 7478 2c20 222e 2e2e ap->ctx, "... │ │ │ │ +001863a0: 2229 3c2f 636f 6465 3e20 746f 2063 6f6e ") to con │ │ │ │ +001863b0: 6669 6775 7265 2074 6865 2061 7661 696c figure the avail │ │ │ │ +001863c0: 6162 6c65 2054 4c53 7631 2e33 2063 6970 able TLSv1.3 cip │ │ │ │ +001863d0: 6865 7273 7569 7465 732e 3c2f 703e 0a3c hersuites.

    .< │ │ │ │ +001863e0: 703e 5765 2072 6566 6572 2074 6f20 7468 p>We refer to th │ │ │ │ +001863f0: 6520 4f70 656e 5353 4c20 646f 6375 6d65 e OpenSSL docume │ │ │ │ +00186400: 6e74 6174 696f 6e20 616e 6420 6d61 6e75 ntation and manu │ │ │ │ +00186410: 616c 2070 6167 6573 206f 6620 3c63 6f64 al pages of SSL_CTX_set_ci │ │ │ │ +00186430: 7068 6572 5f6c 6973 743c 2f63 6f64 653e pher_list │ │ │ │ +00186440: 2061 6e64 203c 636f 6465 3e53 534c 5f43 and SSL_C │ │ │ │ +00186450: 5458 5f73 6574 5f63 6970 6865 7273 7569 TX_set_ciphersui │ │ │ │ +00186460: 7465 733c 2f63 6f64 653e 2066 6f72 2064 tes for d │ │ │ │ +00186470: 6574 6169 6c73 206f 6e20 7468 6520 6c61 etails on the la │ │ │ │ +00186480: 7465 7374 2063 6970 6865 7220 6c69 7374 test cipher list │ │ │ │ +00186490: 7320 616e 6420 7375 6974 6573 2061 7661 s and suites ava │ │ │ │ +001864a0: 696c 6162 6c65 2074 6f20 7573 652e 3c2f ilable to use..

    The GNUTLS │ │ │ │ +001864c0: 206d 7574 6578 206c 6f63 6b20 7365 7475 mutex lock setu │ │ │ │ +001864d0: 7020 6973 2061 7574 6f6d 6174 6963 616c p is automatical │ │ │ │ +001864e0: 6c79 2070 6572 666f 726d 6564 2069 6e20 ly performed in │ │ │ │ +001864f0: 7468 6520 656e 6769 6e65 2c20 6275 7420 the engine, but │ │ │ │ +00186500: 6f6e 6c79 2077 6865 6e20 504f 5349 5820 only when POSIX │ │ │ │ +00186510: 7468 7265 6164 7320 6172 6520 6465 7465 threads are dete │ │ │ │ +00186520: 6374 6564 2061 6e64 2061 7661 696c 6162 cted and availab │ │ │ │ +00186530: 6c65 2e3c 2f70 3e0a 3c70 3e41 6c6c 204f le.

    .

    All O │ │ │ │ +00186540: 7065 6e53 534c 2076 6572 7369 6f6e 7320 penSSL versions │ │ │ │ +00186550: 7072 696f 7220 746f 2031 2e31 2e30 2072 prior to 1.1.0 r │ │ │ │ +00186560: 6571 7569 7265 206d 7574 6578 206c 6f63 equire mutex loc │ │ │ │ +00186570: 6b73 2074 6f20 6265 2065 7870 6c69 6369 ks to be explici │ │ │ │ +00186580: 746c 7920 7365 7420 7570 2069 6e20 796f tly set up in yo │ │ │ │ +00186590: 7572 2063 6f64 6520 666f 7220 6d75 6c74 ur code for mult │ │ │ │ +001865a0: 692d 7468 7265 6164 6564 2061 7070 6c69 i-threaded appli │ │ │ │ +001865b0: 6361 7469 6f6e 7320 6279 2063 616c 6c69 cations by calli │ │ │ │ +001865c0: 6e67 203c 636f 6465 3e3c 6120 636c 6173 ng CRYPTO_ │ │ │ │ +00186690: 7468 7265 6164 5f73 6574 7570 2829 3c2f thread_setup() and CRYPTO_thread_c │ │ │ │ +00186750: 6c65 616e 7570 2829 3c2f 613e 3c2f 636f leanup() as was shown │ │ │ │ +00186770: 2069 6e20 7468 6520 636f 6465 2061 626f in the code abo │ │ │ │ +00186780: 7665 2e20 4f70 656e 5353 4c20 312e 312e ve. OpenSSL 1.1. │ │ │ │ +00186790: 3020 616e 6420 6772 6561 7465 7220 646f 0 and greater do │ │ │ │ +001867a0: 6573 206e 6f74 2072 6571 7569 7265 2074 es not require t │ │ │ │ +001867b0: 6865 7365 206c 6f63 6b73 2074 6f20 6265 hese locks to be │ │ │ │ +001867c0: 2073 6574 2075 702e 2049 6620 796f 7520 set up. If you │ │ │ │ +001867d0: 6172 6520 6e6f 7420 7375 7265 2077 6869 are not sure whi │ │ │ │ +001867e0: 6368 2076 6572 7369 6f6e 206f 6620 4f70 ch version of Op │ │ │ │ +001867f0: 656e 5353 4c20 796f 7520 6d61 7920 6265 enSSL you may be │ │ │ │ +00186800: 2075 7369 6e67 2077 6974 6820 796f 7572 using with your │ │ │ │ +00186810: 206d 756c 7469 2d74 6872 6561 6465 6420 multi-threaded │ │ │ │ +00186820: 6170 706c 6963 6174 696f 6e2c 2074 6865 application, the │ │ │ │ +00186830: 6e20 7365 7420 7570 2074 6865 206c 6f63 n set up the loc │ │ │ │ +00186840: 6b73 2e3c 2f70 3e0a 3c70 3e46 6f72 2055 ks.

    .

    For U │ │ │ │ +00186850: 6e69 7820 616e 6420 4c69 6e75 782c 206d nix and Linux, m │ │ │ │ +00186860: 616b 6520 7375 7265 2079 6f75 2068 6176 ake sure you hav │ │ │ │ +00186870: 6520 7369 676e 616c 2068 616e 646c 6572 e signal handler │ │ │ │ +00186880: 7320 7365 7420 696e 2079 6f75 7220 7365 s set in your se │ │ │ │ +00186890: 7276 6963 6520 616e 642f 6f72 2063 6c69 rvice and/or cli │ │ │ │ +001868a0: 656e 7420 6170 706c 6963 6174 696f 6e73 ent applications │ │ │ │ +001868b0: 2074 6f20 6361 7463 6820 6272 6f6b 656e to catch broken │ │ │ │ +001868c0: 2063 6f6e 6e65 6374 696f 6e73 2028 3c63 connections (SIGPIPE):

    .
    < │ │ │ │ +00186900: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00186910: 3e73 6967 6e61 6c28 5349 4750 4950 452c >signal(SIGPIPE, │ │ │ │ +00186920: 2073 6967 7069 7065 5f68 616e 646c 6529 sigpipe_handle) │ │ │ │ +00186930: 3b3c 2f64 6976 3e0a 3c2f 6469 763e 3c21 ;
    .
    < │ │ │ │ +00186950: 703e 7768 6572 652c 2066 6f72 2065 7861 p>where, for exa │ │ │ │ +00186960: 6d70 6c65 3a3c 2f70 3e0a 3c64 6976 2063 mple:

    .
    │ │ │ │ +00186980: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    void │ │ │ │ +001869b0: 3c2f 7370 616e 3e20 7369 6770 6970 655f sigpipe_ │ │ │ │ +001869c0: 6861 6e64 6c65 283c 7370 616e 2063 6c61 handle(int x) { │ │ │ │ +001869f0: 207d 3c2f 6469 763e 0a3c 2f64 6976 3e3c }
    .
    < │ │ │ │ +00186a00: 212d 2d20 6672 6167 6d65 6e74 202d 2d3e !-- fragment --> │ │ │ │ +00186a10: 3c70 3e42 7920 6465 6661 756c 742c 2063

    By default, c │ │ │ │ +00186a20: 6c69 656e 7473 2061 7265 206e 6f74 2072 lients are not r │ │ │ │ +00186a30: 6571 7569 7265 6420 746f 2061 7574 6865 equired to authe │ │ │ │ +00186a40: 6e74 6963 6174 652e 2054 6f20 7265 7175 nticate. To requ │ │ │ │ +00186a50: 6972 6520 636c 6965 6e74 2061 7574 6865 ire client authe │ │ │ │ +00186a60: 6e74 6963 6174 696f 6e20 7573 6520 7468 ntication use th │ │ │ │ +00186a70: 6520 666f 6c6c 6f77 696e 673a 3c2f 703e e following:

    │ │ │ │ +00186a80: 0a3c 6469 7620 636c 6173 733d 2266 7261 .
    if (s │ │ │ │ +00186b20: 6f61 705f 7373 6c5f 7365 7276 6572 5f63 oap_ssl_server_c │ │ │ │ +00186b30: 6f6e 7465 7874 3c2f 613e 2826 616d 703b ontext(& │ │ │ │ +00186b40: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap, │ │ │ │ +00186b70: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    ..
    "server │ │ │ │ +00186c50: 2e70 656d 2671 756f 743b 3c2f 7370 616e .pem",
    .
    │ │ │ │ +00186c80: 3c73 7061 6e20 636c 6173 733d 2273 7472 &quo │ │ │ │ +00186ca0: 743b 7061 7373 776f 7264 2671 756f 743b t;password" │ │ │ │ +00186cb0: 3c2f 7370 616e 3e2c 203c 2f64 6976 3e0a ,
    . │ │ │ │ +00186cc0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    "cacert.p │ │ │ │ +00186d00: 656d 2671 756f 743b 3c2f 7370 616e 3e2c em", │ │ │ │ +00186d10: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    NU │ │ │ │ +00186d30: 4c4c 2c20 3c2f 6469 763e 0a3c 6469 7620 LL,
    .
    │ │ │ │ +00186d50: 203c 7370 616e 2063 6c61 7373 3d22 7374 &qu │ │ │ │ +00186d70: 6f74 3b64 6835 3132 2e70 656d 2671 756f ot;dh512.pem&quo │ │ │ │ +00186d80: 743b 3c2f 7370 616e 3e2c 203c 2f64 6976 t;,
    .
    NULL, .
    NULL) │ │ │ │ +00186dd0: 2920 3c2f 6469 763e 0a3c 6469 7620 636c )
    .
    {.
    soap_p │ │ │ │ +00186e60: 7269 6e74 5f66 6175 6c74 3c2f 613e 2826 rint_fault(& │ │ │ │ +00186e70: 616d 703b 3c61 2063 6c61 7373 3d22 636f amp;soap< │ │ │ │ +00186ea0: 2f61 3e2c 2073 7464 6572 7229 3b20 3c2f /a>, stderr); .
    #defi │ │ │ │ +00186ff0: 6e65 2053 4f41 505f 5353 4c5f 5245 5155 ne SOAP_SSL_REQU │ │ │ │ +00187000: 4952 455f 434c 4945 4e54 5f41 5554 4845 IRE_CLIENT_AUTHE │ │ │ │ +00187010: 4e54 4943 4154 494f 4e3c 2f64 6976 3e3c NTICATION
    < │ │ │ │ +00187020: 6469 7620 636c 6173 733d 2274 7464 6f63 div class="ttdoc │ │ │ │ +00187030: 223e 736f 6170 5f73 736c 5f66 6c61 6773 ">soap_ssl_flags │ │ │ │ +00187040: 2066 6c61 6720 666f 7220 7365 7276 6572 flag for server │ │ │ │ +00187050: 7320 746f 2072 6571 7569 7265 2063 6c69 s to require cli │ │ │ │ +00187060: 656e 7473 2074 6f20 6175 7468 656e 7469 ents to authenti │ │ │ │ +00187070: 6361 7465 2074 6f20 7365 7276 6572 7320 cate to servers │ │ │ │ +00187080: 6475 7269 6e67 2074 6865 2048 5454 5053 during the HTTPS │ │ │ │ +00187090: 2068 616e 6473 682e 2e2e 3c2f 6469 763e handsh...
    │ │ │ │ +001870a0: 3c64 6976 2063 6c61 7373 3d22 7474 6465
    Definition │ │ │ │ +001870c0: 3a3c 2f62 3e20 7374 6473 6f61 7032 2e68 : stdsoap2.h │ │ │ │ +001870d0: 3a35 3835 343c 2f64 6976 3e3c 2f64 6976 :5854
    .

    This │ │ │ │ +00187100: 2072 6571 7569 7265 7320 6561 6368 2063 requires each c │ │ │ │ +00187110: 6c69 656e 7420 746f 2061 7574 6865 6e74 lient to authent │ │ │ │ +00187120: 6963 6174 6520 7769 7468 2069 7473 2063 icate with its c │ │ │ │ +00187130: 6572 7469 6669 6361 7465 2c20 696e 2061 ertificate, in a │ │ │ │ +00187140: 6464 6974 696f 6e20 666f 7220 7468 6520 ddition for the │ │ │ │ +00187150: 7365 7276 6572 2074 6f20 6175 7468 656e server to authen │ │ │ │ +00187160: 7469 6361 7465 2074 6f20 7468 6520 636c ticate to the cl │ │ │ │ +00187170: 6965 6e74 2e3c 2f70 3e0a 3c70 3e53 696e ient.

    .

    Sin │ │ │ │ +00187180: 6365 2072 656c 6561 7365 2076 6572 7369 ce release versi │ │ │ │ +00187190: 6f6e 2032 2e38 2e32 302c 2053 534c 2076 on 2.8.20, SSL v │ │ │ │ +001871a0: 3320 6973 2064 6973 6162 6c65 642e 2054 3 is disabled. T │ │ │ │ +001871b0: 6f20 656e 6162 6c65 2053 534c 2076 3320 o enable SSL v3 │ │ │ │ +001871c0: 746f 6765 7468 6572 2077 6974 6820 544c together with TL │ │ │ │ +001871d0: 5320 312e 3020 616e 6420 6869 6768 6572 S 1.0 and higher │ │ │ │ +001871e0: 2c20 7573 6520 3c63 6f64 653e 2353 4f41 , use #SOA │ │ │ │ +001871f0: 505f 5353 4c76 335f 544c 5376 313c 2f63 P_SSLv3_TLSv1 with │ │ │ │ +00187210: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap_ssl_serv │ │ │ │ +001872a0: 6572 5f63 6f6e 7465 7874 3c2f 613e 3c2f er_context. To use TL │ │ │ │ +001872c0: 5320 312e 3120 616e 6420 312e 3220 7573 S 1.1 and 1.2 us │ │ │ │ +001872d0: 6520 3c63 6f64 653e 534f 4150 5f54 4c53 e SOAP_TLS │ │ │ │ +001872e0: 7631 5f31 207c 2053 4f41 505f 544c 5376 v1_1 | SOAP_TLSv │ │ │ │ +001872f0: 315f 323c 2f63 6f64 653e 2e20 546f 2075 1_2. To u │ │ │ │ +00187300: 7365 2054 4c53 2031 2e32 206f 6e6c 7920 se TLS 1.2 only │ │ │ │ +00187310: 7573 6520 3c63 6f64 653e 2353 4f41 505f use #SOAP_ │ │ │ │ +00187320: 544c 5376 315f 323c 2f63 6f64 653e 2e20 TLSv1_2. │ │ │ │ +00187330: 546f 2075 7365 2053 534c 2076 3320 6f6e To use SSL v3 on │ │ │ │ +00187340: 6c79 2075 7365 203c 636f 6465 3e23 534f ly use #SO │ │ │ │ +00187350: 4150 5f53 534c 7633 3c2f 636f 6465 3e2e AP_SSLv3. │ │ │ │ +00187360: 3c2f 703e 0a3c 703e 5468 6520 3c63 6f64

    .

    The cacert │ │ │ │ +00187380: 6669 6c65 2061 6e64 203c 636f 6465 3e63 file and c │ │ │ │ +00187390: 6170 6174 683c 2f63 6f64 653e 2061 7265 apath are │ │ │ │ +001873a0: 206f 7074 696f 6e61 6c2e 2045 6974 6865 optional. Eithe │ │ │ │ +001873b0: 7220 6f6e 6520 6361 6e20 6265 2073 7065 r one can be spe │ │ │ │ +001873c0: 6369 6669 6564 2077 6865 6e20 636c 6965 cified when clie │ │ │ │ +001873d0: 6e74 7320 6d75 7374 2072 756e 206f 6e20 nts must run on │ │ │ │ +001873e0: 6e6f 6e2d 7472 7573 7465 6420 7379 7374 non-trusted syst │ │ │ │ +001873f0: 656d 7320 283c 636f 6465 3e63 6170 6174 ems (capat │ │ │ │ +00187400: 683c 2f63 6f64 653e 2069 7320 6e6f 7420 h is not │ │ │ │ +00187410: 7573 6564 2077 6974 6820 474e 5554 4c53 used with GNUTLS │ │ │ │ +00187420: 292e 2057 6520 7761 6e74 2074 6f20 6176 ). We want to av │ │ │ │ +00187430: 6f69 6420 7374 6f72 696e 6720 7472 7573 oid storing trus │ │ │ │ +00187440: 7465 6420 6365 7274 6966 6963 6174 6573 ted certificates │ │ │ │ +00187450: 2069 6e20 7468 6520 6465 6661 756c 7420 in the default │ │ │ │ +00187460: 6c6f 6361 7469 6f6e 206f 6e20 7468 6520 location on the │ │ │ │ +00187470: 6669 6c65 2073 7973 7465 6d20 7768 656e file system when │ │ │ │ +00187480: 2074 6861 7420 6973 206e 6f74 2073 6563 that is not sec │ │ │ │ +00187490: 7572 652e 2054 6865 7265 666f 7265 2c20 ure. Therefore, │ │ │ │ +001874a0: 6120 666c 6174 203c 656d 3e3c 636f 6465 a flat cacert.pem file or │ │ │ │ +001874d0: 6469 7265 6374 6f72 7920 6361 6e20 6265 directory can be │ │ │ │ +001874e0: 2073 7065 6369 6669 6564 2074 6f20 7374 specified to st │ │ │ │ +001874f0: 6f72 6520 7472 7573 7465 6420 6365 7274 ore trusted cert │ │ │ │ +00187500: 6966 6963 6174 6573 2e3c 2f70 3e0a 3c70 ificates.

    .

    The gSOAP packa │ │ │ │ +00187520: 6765 2069 6e63 6c75 6465 7320 6120 3c65 ge includes a cacerts. │ │ │ │ +00187540: 7065 6d3c 2f63 6f64 653e 3c2f 656d 3e20 pem │ │ │ │ +00187550: 6669 6c65 2077 6974 6820 7468 6520 6365 file with the ce │ │ │ │ +00187560: 7274 6966 6963 6174 6573 206f 6620 616c rtificates of al │ │ │ │ +00187570: 6c20 6365 7274 6966 6963 6174 6520 6175 l certificate au │ │ │ │ +00187580: 7468 6f72 6974 6965 732e 2059 6f75 2063 thorities. You c │ │ │ │ +00187590: 616e 2075 7365 2074 6869 7320 6669 6c65 an use this file │ │ │ │ +001875a0: 2074 6f20 7665 7269 6679 2074 6865 2061 to verify the a │ │ │ │ +001875b0: 7574 6865 6e74 6963 6174 696f 6e20 6f66 uthentication of │ │ │ │ +001875c0: 2073 6572 7665 7273 2074 6861 7420 7072 servers that pr │ │ │ │ +001875d0: 6f76 6964 6520 6365 7274 6966 6963 6174 ovide certificat │ │ │ │ +001875e0: 6573 2069 7373 7565 6420 6279 2074 6865 es issued by the │ │ │ │ +001875f0: 7365 2043 4173 2e3c 2f70 3e0a 3c70 3e54 se CAs.

    .

    T │ │ │ │ +00187600: 6865 203c 656d 3e3c 636f 6465 3e63 6163 he cac │ │ │ │ +00187610: 6572 742e 7065 6d3c 2f63 6f64 653e 3c2f ert.pem, c │ │ │ │ +00187630: 6c69 656e 742e 7065 6d3c 2f63 6f64 653e lient.pem │ │ │ │ +00187640: 3c2f 656d 3e2c 2061 6e64 203c 656d 3e3c , and < │ │ │ │ +00187650: 636f 6465 3e73 6572 7665 722e 7065 6d3c code>server.pem< │ │ │ │ +00187660: 2f63 6f64 653e 3c2f 656d 3e20 6669 6c65 /code> file │ │ │ │ +00187670: 7320 696e 2074 6865 2067 534f 4150 2070 s in the gSOAP p │ │ │ │ +00187680: 6163 6b61 6765 2061 7265 2065 7861 6d70 ackage are examp │ │ │ │ +00187690: 6c65 7320 6f66 2073 656c 662d 7369 676e les of self-sign │ │ │ │ +001876a0: 6564 2063 6572 7469 6669 6361 7465 732e ed certificates. │ │ │ │ +001876b0: 2054 6865 203c 656d 3e3c 636f 6465 3e63 The c │ │ │ │ +001876c0: 6c69 656e 742e 7065 6d3c 2f63 6f64 653e lient.pem │ │ │ │ +001876d0: 3c2f 656d 3e20 616e 6420 3c65 6d3e 3c63 and server.pem conta │ │ │ │ +00187700: 696e 2074 6865 2063 6c69 656e 742f 7365 in the client/se │ │ │ │ +00187710: 7276 6572 2070 7269 7661 7465 206b 6579 rver private key │ │ │ │ +00187720: 2063 6f6e 6361 7465 6e61 7465 6420 7769 concatenated wi │ │ │ │ +00187730: 7468 2074 6865 2063 6572 7469 6669 6361 th the certifica │ │ │ │ +00187740: 7465 2e20 5468 6520 6b65 7966 696c 6573 te. The keyfiles │ │ │ │ +00187750: 2028 3c65 6d3e 3c63 6f64 653e 636c 6965 (clie │ │ │ │ +00187760: 6e74 2e70 656d 3c2f 636f 6465 3e3c 2f65 nt.pem and server.pem) are cre │ │ │ │ +001877a0: 6174 6564 2062 7920 636f 6e63 6174 656e ated by concaten │ │ │ │ +001877b0: 6174 696e 6720 7468 6520 7072 6976 6174 ating the privat │ │ │ │ +001877c0: 6520 6b65 7920 5045 4d20 7769 7468 2074 e key PEM with t │ │ │ │ +001877d0: 6865 2063 6572 7469 6669 6361 7465 2050 he certificate P │ │ │ │ +001877e0: 454d 2e20 5468 6520 6b65 7966 696c 6520 EM. The keyfile │ │ │ │ +001877f0: 7368 6f75 6c64 206e 6f74 2062 6520 7368 should not be sh │ │ │ │ +00187800: 6172 6564 2077 6974 6820 616e 7920 7061 ared with any pa │ │ │ │ +00187810: 7274 792e 2057 6974 6820 4f70 656e 5353 rty. With OpenSS │ │ │ │ +00187820: 4c2c 2079 6f75 2063 616e 2065 6e63 7279 L, you can encry │ │ │ │ +00187830: 7074 2074 6865 206b 6579 6669 6c65 7320 pt the keyfiles │ │ │ │ +00187840: 7769 7468 2061 2070 6173 7377 6f72 6420 with a password │ │ │ │ +00187850: 746f 206f 6666 6572 2073 6f6d 6520 7072 to offer some pr │ │ │ │ +00187860: 6f74 6563 7469 6f6e 2061 6e64 2074 6865 otection and the │ │ │ │ +00187870: 2070 6173 7377 6f72 6420 6973 2075 7365 password is use │ │ │ │ +00187880: 6420 696e 2074 6865 2063 6c69 656e 742f d in the client/ │ │ │ │ +00187890: 7365 7276 6572 2063 6f64 6520 746f 2072 server code to r │ │ │ │ +001878a0: 6561 6420 7468 6520 6b65 7966 696c 652e ead the keyfile. │ │ │ │ +001878b0: 2047 4e55 544c 5320 646f 6573 206e 6f74 GNUTLS does not │ │ │ │ +001878c0: 2073 7570 706f 7274 2074 6869 7320 6665 support this fe │ │ │ │ +001878d0: 6174 7572 6520 616e 6420 6361 6e6e 6f74 ature and cannot │ │ │ │ +001878e0: 2065 6e63 7279 7074 206f 7220 6465 6372 encrypt or decr │ │ │ │ +001878f0: 7970 7420 6120 6b65 7966 696c 652e 3c2f ypt a keyfile..

    < │ │ │ │ +00187920: 6474 3e57 6172 6e69 6e67 3c2f 6474 3e3c dt>Warning< │ │ │ │ +00187930: 6464 3e49 7420 6973 2069 6d70 6f72 7461 dd>It is importa │ │ │ │ +00187940: 6e74 2074 6861 7420 7468 6520 3c63 6f64 nt that the #WITH_OPENSSL< │ │ │ │ +00187960: 2f63 6f64 653e 206d 6163 726f 206d 7573 /code> macro mus │ │ │ │ +00187970: 7420 6265 2063 6f6e 7369 7374 656e 746c t be consistentl │ │ │ │ +00187980: 7920 6465 6669 6e65 6420 746f 2063 6f6d y defined to com │ │ │ │ +00187990: 7069 6c65 2074 6865 2073 6f75 7263 6573 pile the sources │ │ │ │ +001879a0: 2c20 7375 6368 2061 7320 3c65 6d3e 3c63 , such as gsoap/stdsoa │ │ │ │ +001879c0: 7032 2e63 7070 3c2f 636f 6465 3e3c 2f65 p2.cpp, so │ │ │ │ +001879e0: 6170 432e 6370 703c 2f63 6f64 653e 3c2f apC.cpp, s │ │ │ │ +00187a00: 6f61 7043 6c69 656e 742e 6370 703c 2f63 oapClient.cpp, < │ │ │ │ +00187a20: 636f 6465 3e73 6f61 7053 6572 7665 722e code>soapServer. │ │ │ │ +00187a30: 6370 703c 2f63 6f64 653e 3c2f 656d 3e2c cpp, │ │ │ │ +00187a40: 2061 6e64 2061 6c6c 2061 7070 6c69 6361 and all applica │ │ │ │ +00187a50: 7469 6f6e 2073 6f75 7263 6573 2074 6861 tion sources tha │ │ │ │ +00187a60: 7420 696e 636c 7564 6520 3c65 6d3e 3c63 t include gsoap/stdsoa │ │ │ │ +00187a80: 7032 2e68 3c2f 636f 6465 3e3c 2f65 6d3e p2.h │ │ │ │ +00187a90: 206f 7220 3c65 6d3e 3c63 6f64 653e 736f or so │ │ │ │ +00187aa0: 6170 482e 683c 2f63 6f64 653e 3c2f 656d apH.h. If the macros │ │ │ │ +00187ac0: 2061 7265 206e 6f74 2063 6f6e 7369 7374 are not consist │ │ │ │ +00187ad0: 656e 746c 7920 7573 6564 2c20 7468 6520 ently used, the │ │ │ │ +00187ae0: 6170 706c 6963 6174 696f 6e20 7769 6c6c application will │ │ │ │ +00187af0: 2063 7261 7368 2064 7565 2074 6f20 6120 crash due to a │ │ │ │ +00187b00: 6d69 736d 6174 6368 6573 2069 6e20 7468 mismatches in th │ │ │ │ +00187b10: 6520 6465 636c 6172 6174 696f 6e20 616e e declaration an │ │ │ │ +00187b20: 6420 6163 6365 7373 206f 6620 7468 6520 d access of the │ │ │ │ +00187b30: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 soap context.< │ │ │ │ +00187ba0: 2f64 6c3e 0a3c 703e 5365 6520 616c 736f /dl>.

    See also │ │ │ │ +00187bb0: 2041 5049 2064 6f63 756d 656e 7461 7469 API documentati │ │ │ │ +00187bc0: 6f6e 204d 6f64 756c 6520 3c61 2063 6c61 on Module SSL/TLS co │ │ │ │ +00187c00: 6e74 6578 7420 616e 6420 6675 6e63 7469 ntext and functi │ │ │ │ +00187c10: 6f6e 733c 2f61 3e20 666f 7220 6d6f 7265 ons for more │ │ │ │ +00187c20: 2064 6574 6169 6c73 206f 6e20 7468 6520 details on the │ │ │ │ +00187c30: 5353 4c2f 544c 5320 6675 6e63 7469 6f6e SSL/TLS function │ │ │ │ +00187c40: 732e 3c2f 703e 0a3c 703e f09f 949d 203c s.

    .

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

    .

    .Secur │ │ │ │ +00187cb0: 6520 636c 6965 6e74 7320 7769 7468 2048 e clients with H │ │ │ │ +00187cc0: 5454 5053 3c2f 6832 3e0a 3c70 3e54 6f20 TTPS

    .

    To │ │ │ │ +00187cd0: 7574 696c 697a 6520 4854 5450 532f 5353 utilize HTTPS/SS │ │ │ │ +00187ce0: 4c2c 2079 6f75 206e 6565 6420 746f 2069 L, you need to i │ │ │ │ +00187cf0: 6e73 7461 6c6c 2074 6865 204f 7065 6e53 nstall the OpenS │ │ │ │ +00187d00: 534c 206c 6962 7261 7279 206f 6e20 796f SL library on yo │ │ │ │ +00187d10: 7572 2070 6c61 7466 6f72 6d20 6f72 2047 ur platform or G │ │ │ │ +00187d20: 4e55 544c 5320 666f 7220 6120 6c69 6768 NUTLS for a ligh │ │ │ │ +00187d30: 742d 7765 6967 6874 2053 534c 2f54 4c53 t-weight SSL/TLS │ │ │ │ +00187d40: 206c 6962 7261 7279 2e20 4166 7465 7220 library. After │ │ │ │ +00187d50: 696e 7374 616c 6c61 7469 6f6e 2c20 636f installation, co │ │ │ │ +00187d60: 6d70 696c 6520 616c 6c20 7468 6520 736f mpile all the so │ │ │ │ +00187d70: 7572 6365 7320 6f66 2079 6f75 7220 6170 urces of your ap │ │ │ │ +00187d80: 706c 6963 6174 696f 6e20 7769 7468 2063 plication with c │ │ │ │ +00187d90: 6f6d 7069 6c65 2d74 696d 6520 666c 6167 ompile-time flag │ │ │ │ +00187da0: 203c 636f 6465 3e23 5749 5448 5f4f 5045 #WITH_OPE │ │ │ │ +00187db0: 4e53 534c 3c2f 636f 6465 3e20 286f 7220 NSSL (or │ │ │ │ +00187dc0: 3c63 6f64 653e 2357 4954 485f 474e 5554 #WITH_GNUT │ │ │ │ +00187dd0: 4c53 3c2f 636f 6465 3e20 7768 656e 2075 LS when u │ │ │ │ +00187de0: 7369 6e67 2047 4e55 544c 5329 2e20 466f sing GNUTLS). Fo │ │ │ │ +00187df0: 7220 6578 616d 706c 6520 6f6e 204c 696e r example on Lin │ │ │ │ +00187e00: 7578 3a20 3c2f 703e 3c70 7265 2063 6c61 ux:

     c
    │ │ │ │ +00187e20: 2b2b 202d 4457 4954 485f 4f50 454e 5353  ++ -DWITH_OPENSS
    │ │ │ │ +00187e30: 4c20 6d79 636c 6965 6e74 2e63 7070 2073  L myclient.cpp s
    │ │ │ │ +00187e40: 7464 736f 6170 2e63 7070 2073 6f61 7043  tdsoap.cpp soapC
    │ │ │ │ +00187e50: 2e63 7070 2073 6f61 7043 6c69 656e 742e  .cpp soapClient.
    │ │ │ │ +00187e60: 6370 7020 2d6c 7373 6c20 2d6c 6372 7970  cpp -lssl -lcryp
    │ │ │ │ +00187e70: 746f 0a3c 2f70 7265 3e3c 703e 206f 7220  to.

    or │ │ │ │ +00187e80: 556e 6978 3a20 3c2f 703e 3c70 7265 2063 Unix:

    │ │ │ │ +00187ea0: 2063 2b2b 202d 4457 4954 485f 4f50 454e   c++ -DWITH_OPEN
    │ │ │ │ +00187eb0: 5353 4c20 6d79 636c 6965 6e74 2e63 7070  SSL myclient.cpp
    │ │ │ │ +00187ec0: 2073 7464 736f 6170 2e63 7070 2073 6f61   stdsoap.cpp soa
    │ │ │ │ +00187ed0: 7043 2e63 7070 2073 6f61 7043 6c69 656e  pC.cpp soapClien
    │ │ │ │ +00187ee0: 742e 6370 7020 2d6c 786e 6574 202d 6c73  t.cpp -lxnet -ls
    │ │ │ │ +00187ef0: 6f63 6b65 7420 2d6c 6e73 6c20 2d6c 7373  ocket -lnsl -lss
    │ │ │ │ +00187f00: 6c20 2d6c 6372 7970 746f 0a3c 2f70 7265  l -lcrypto.

    or you can │ │ │ │ +00187f20: 6164 6420 7468 6520 666f 6c6c 6f77 696e add the followin │ │ │ │ +00187f30: 6720 6c69 6e65 2074 6f20 3c65 6d3e 3c63 g line to soapdefs.h:

    . │ │ │ │ +00187f60: 3c64 6976 2063 6c61 7373 3d22 6672 6167
    #define WITH_ │ │ │ │ +00187fb0: 4f50 454e 5353 4c3c 2f73 7061 6e3e 3c2f OPENSSL.

    a │ │ │ │ +00187fe0: 6e64 2063 6f6d 7069 6c65 2077 6974 6820 nd compile with │ │ │ │ +00187ff0: 636f 6d70 696c 652d 7469 6d65 2066 6c61 compile-time fla │ │ │ │ +00188000: 6720 3c63 6f64 653e 2357 4954 485f 534f g #WITH_SO │ │ │ │ +00188010: 4150 4445 4653 5f48 3c2f 636f 6465 3e20 APDEFS_H │ │ │ │ +00188020: 746f 2069 6e63 6c75 6465 203c 656d 3e3c to include < │ │ │ │ +00188030: 636f 6465 3e73 6f61 7064 6566 732e 683c code>soapdefs.h< │ │ │ │ +00188040: 2f63 6f64 653e 3c2f 656d 3e20 696e 2079 /code> in y │ │ │ │ +00188050: 6f75 7220 7072 6f6a 6563 742e 2041 6c74 our project. Alt │ │ │ │ +00188060: 6572 6e61 7469 7665 6c79 2c20 636f 6d70 ernatively, comp │ │ │ │ +00188070: 696c 6520 7769 7468 2047 4e55 544c 533a ile with GNUTLS: │ │ │ │ +00188080: 203c 2f70 3e3c 7072 6520 636c 6173 733d

     c++ 
    │ │ │ │ +001880a0: 2d44 5749 5448 5f47 4e55 544c 5320 6d79  -DWITH_GNUTLS my
    │ │ │ │ +001880b0: 636c 6965 6e74 2e63 7070 2073 7464 736f  client.cpp stdso
    │ │ │ │ +001880c0: 6170 2e63 7070 2073 6f61 7043 2e63 7070  ap.cpp soapC.cpp
    │ │ │ │ +001880d0: 2073 6f61 7043 6c69 656e 742e 6370 7020   soapClient.cpp 
    │ │ │ │ +001880e0: 2d6c 676e 7574 6c73 202d 6c67 6372 7970  -lgnutls -lgcryp
    │ │ │ │ +001880f0: 7420 2d6c 6770 672d 6572 726f 720a 3c2f  t -lgpg-error.

    A client │ │ │ │ +00188110: 7072 6f67 7261 6d20 7369 6d70 6c79 2075 program simply u │ │ │ │ +00188120: 7365 7320 7468 6520 7072 6566 6978 203c ses the prefix < │ │ │ │ +00188130: 656d 3e3c 636f 6465 3e68 7474 7073 3a3c em>https:< │ │ │ │ +00188140: 2f63 6f64 653e 3c2f 656d 3e20 696e 7374 /code> inst │ │ │ │ +00188150: 6561 6420 6f66 203c 656d 3e3c 636f 6465 ead of http: in the endpoi │ │ │ │ +00188180: 6e74 2055 524c 206f 6620 6120 7365 7276 nt URL of a serv │ │ │ │ +00188190: 6963 6520 6f70 6572 6174 696f 6e20 6361 ice operation ca │ │ │ │ +001881a0: 6c6c 2074 6f20 6120 5765 6220 5365 7276 ll to a Web Serv │ │ │ │ +001881b0: 6963 6520 746f 2075 7365 2065 6e63 7279 ice to use encry │ │ │ │ +001881c0: 7074 6564 2074 7261 6e73 6665 7273 2028 pted transfers ( │ │ │ │ +001881d0: 6966 2074 6865 2073 6572 7669 6365 2073 if the service s │ │ │ │ +001881e0: 7570 706f 7274 7320 4854 5450 5329 2e20 upports HTTPS). │ │ │ │ +001881f0: 596f 7520 6e65 6564 2074 6f20 7370 6563 You need to spec │ │ │ │ +00188200: 6966 7920 7468 6520 636c 6965 6e74 2d73 ify the client-s │ │ │ │ +00188210: 6964 6520 6b65 7920 6669 6c65 2061 6e64 ide key file and │ │ │ │ +00188220: 2070 6173 7377 6f72 6420 6f66 2074 6865 password of the │ │ │ │ +00188230: 206b 6579 6669 6c65 3a3c 2f70 3e0a 3c64 keyfile:

    .
    stru │ │ │ │ +00188280: 6374 203c 2f73 7061 6e3e 3c61 2063 6c61 ct soap soap;
    │ │ │ │ +001882f0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    soap_ssl_ini │ │ │ │ +00188360: 743c 2f61 3e28 293b 203c 7370 616e 2063 t(); / │ │ │ │ +00188380: 2a20 696e 6974 204f 7065 6e53 534c 2028 * init OpenSSL ( │ │ │ │ +00188390: 736b 6970 7069 6e67 2074 6869 7320 6f72 skipping this or │ │ │ │ +001883a0: 2063 616c 6c69 6e67 206d 756c 7469 706c calling multipl │ │ │ │ +001883b0: 6520 7469 6d65 7320 6973 204f 4b2c 2073 e times is OK, s │ │ │ │ +001883c0: 696e 6365 2074 6865 2065 6e67 696e 6520 ince the engine │ │ │ │ +001883d0: 7769 6c6c 2069 6e69 7420 5353 4c20 6175 will init SSL au │ │ │ │ +001883e0: 746f 6d61 7469 6361 6c6c 7929 202a 2f3c tomatically) */< │ │ │ │ +001883f0: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    .< │ │ │ │ +00188410: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ +00188420: 656e 7422 3e2f 2a20 736f 6170 5f73 736c ent">/* soap_ssl │ │ │ │ +00188430: 5f6e 6f69 6e69 7428 293b 202a 2f3c 2f73 _noinit(); */ /* do │ │ │ │ +00188460: 206e 6f74 2069 6e69 7420 4f70 656e 5353 not init OpenSS │ │ │ │ +00188470: 4c20 2869 6620 5353 4c20 6973 2061 6c72 L (if SSL is alr │ │ │ │ +00188480: 6561 6479 2069 6e69 7469 616c 697a 6564 eady initialized │ │ │ │ +00188490: 2065 6c73 6577 6865 7265 2069 6e20 7468 elsewhere in th │ │ │ │ +001884a0: 6973 2061 7070 6c69 6361 7469 6f6e 2920 is application) │ │ │ │ +001884b0: 2a2f 3c2f 7370 616e 3e3c 2f64 6976 3e0a */
    . │ │ │ │ +001884c0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65 .
    if │ │ │ │ +001885a0: 3c2f 7370 616e 3e20 283c 6120 636c 6173 (soap_s │ │ │ │ +00188600: 736c 5f63 6c69 656e 745f 636f 6e74 6578 sl_client_contex │ │ │ │ +00188610: 743c 2f61 3e28 2661 6d70 3b3c 6120 636c t(&soap, .
    SOAP_SSL │ │ │ │ +001886c0: 5f44 4546 4155 4c54 3c2f 613e 2c20 3c2f _DEFAULT, .
    "clien │ │ │ │ +00188710: 742e 7065 6d26 7175 6f74 3b3c 2f73 7061 t.pem", /* keyfile: req │ │ │ │ +00188750: 7569 7265 6420 6f6e 6c79 2077 6865 6e20 uired only when │ │ │ │ +00188760: 636c 6965 6e74 206d 7573 7420 6175 7468 client must auth │ │ │ │ +00188770: 656e 7469 6361 7465 2074 6f20 7365 7276 enticate to serv │ │ │ │ +00188780: 6572 2028 7365 6520 5353 4c20 646f 6373 er (see SSL docs │ │ │ │ +00188790: 206f 6e20 686f 7720 746f 206f 6274 6169 on how to obtai │ │ │ │ +001887a0: 6e20 7468 6973 2066 696c 6529 202a 2f3c n this file) */< │ │ │ │ +001887b0: 2f73 7061 6e3e 203c 2f64 6976 3e0a 3c64 /span>
    . │ │ │ │ +001887d0: 2020 3c73 7061 6e20 636c 6173 733d 2273 &q │ │ │ │ +001887f0: 756f 743b 7061 7373 776f 7264 2671 756f uot;password&quo │ │ │ │ +00188800: 743b 3c2f 7370 616e 3e2c 2020 2020 2020 t;, │ │ │ │ +00188810: 2020 2020 3c73 7061 6e20 636c 6173 733d /* pas │ │ │ │ +00188830: 7377 6f72 6420 746f 2072 6561 6420 7468 sword to read th │ │ │ │ +00188840: 6520 6b65 7920 6669 6c65 2028 6e6f 7420 e key file (not │ │ │ │ +00188850: 7573 6564 2077 6974 6820 474e 5554 4c53 used with GNUTLS │ │ │ │ +00188860: 2920 2a2f 3c2f 7370 616e 3e20 3c2f 6469 ) */ .
    "cacerts │ │ │ │ +001888b0: 2e70 656d 2671 756f 743b 3c2f 7370 616e .pem", / │ │ │ │ +001888e0: 2a20 6361 6365 7274 2066 696c 6520 746f * cacert file to │ │ │ │ +001888f0: 2073 746f 7265 2074 7275 7374 6564 2063 store trusted c │ │ │ │ +00188900: 6572 7469 6669 6361 7465 7320 286e 6565 ertificates (nee │ │ │ │ +00188910: 6465 6420 746f 2076 6572 6966 7920 7365 ded to verify se │ │ │ │ +00188920: 7276 6572 2920 2a2f 3c2f 7370 616e 3e20 rver) */ │ │ │ │ +00188930: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    NULL, │ │ │ │ +00188950: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +00188960: 3c73 7061 6e20 636c 6173 733d 2263 6f6d /* capath │ │ │ │ +00188980: 746f 2064 6972 6563 746f 7279 2077 6974 to directory wit │ │ │ │ +00188990: 6820 7472 7573 7465 6420 6365 7274 6966 h trusted certif │ │ │ │ +001889a0: 6963 6174 6573 202a 2f3c 2f73 7061 6e3e icates */ │ │ │ │ +001889b0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    NULL │ │ │ │ +001889d0: 2020 2020 2020 2020 203c 7370 616e 2063 / │ │ │ │ +001889f0: 2a20 6966 2072 616e 6466 696c 6521 3d4e * if randfile!=N │ │ │ │ +00188a00: 554c 4c3a 2075 7365 2061 2066 696c 6520 ULL: use a file │ │ │ │ +00188a10: 7769 7468 2072 616e 646f 6d20 6461 7461 with random data │ │ │ │ +00188a20: 2074 6f20 7365 6564 2072 616e 646f 6d6e to seed randomn │ │ │ │ +00188a30: 6573 7320 2a2f 3c2f 7370 616e 3e20 203c ess */ < │ │ │ │ +00188a40: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    ))
    .
    {
    .
    │ │ │ │ +00188a90: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap_print_fa │ │ │ │ +00188af0: 756c 743c 2f61 3e28 2661 6d70 3b3c 6120 ult(&soap, st │ │ │ │ +00188b30: 6465 7272 293b 203c 2f64 6976 3e0a 3c64 derr);
    . │ │ │ │ +00188b50: 2020 6578 6974 2845 5849 545f 4641 494c exit(EXIT_FAIL │ │ │ │ +00188b60: 5552 4529 3b20 3c2f 6469 763e 0a3c 6469 URE);
    .} │ │ │ │ +00188b80: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    soap_c │ │ │ │ +00188ba0: 616c 6c5f 6e73 5f5f 6d79 6d65 7468 6f64 all_ns__mymethod │ │ │ │ +00188bb0: 2826 616d 703b 3c61 2063 6c61 7373 3d22 (&soa │ │ │ │ +00188be0: 703c 2f61 3e2c 203c 7370 616e 2063 6c61 p, "https:/ │ │ │ │ +00188c10: 2f64 6f6d 6169 6e2f 7061 7468 2f73 6563 /domain/path/sec │ │ │ │ +00188c20: 7572 652e 6367 6926 7175 6f74 3b3c 2f73 ure.cgi", "", ...);.
    int soap_ssl_cl │ │ │ │ +00188d60: 6965 6e74 5f63 6f6e 7465 7874 2873 7472 ient_context(str │ │ │ │ +00188d70: 7563 7420 736f 6170 202a 736f 6170 2c20 uct soap *soap, │ │ │ │ +00188d80: 736f 6170 5f73 736c 5f66 6c61 6773 2066 soap_ssl_flags f │ │ │ │ +00188d90: 6c61 6773 2c20 636f 6e73 7420 6368 6172 lags, const char │ │ │ │ +00188da0: 202a 6b65 7966 696c 652c 2063 6f6e 7374 *keyfile, const │ │ │ │ +00188db0: 2063 6861 7220 2a70 6173 7377 6f72 642c char *password, │ │ │ │ +00188dc0: 2063 6f6e 7374 2063 6861 7220 2a63 6166 const char *caf │ │ │ │ +00188dd0: 696c 652c 2063 6f6e 7374 2063 6861 7220 ile, const char │ │ │ │ +00188de0: 2a63 6170 6174 682c 2063 6f6e 7374 2063 *capath, const c │ │ │ │ +00188df0: 6861 7220 2a72 616e 6466 696c 6529 3c2f har *randfile)
    Initializ │ │ │ │ +00188e20: 6520 7468 6520 636c 6965 6e74 2d73 6964 e the client-sid │ │ │ │ +00188e30: 6520 5353 4c2f 544c 5320 636f 6e74 6578 e SSL/TLS contex │ │ │ │ +00188e40: 742e 3c2f 6469 763e 3c2f 6469 763e 0a3c t.
    .< │ │ │ │ +00188e50: 2f64 6976 3e3c 212d 2d20 6672 6167 6d65 /div>

    By defa │ │ │ │ +00188e70: 756c 742c 2073 6572 7665 7220 6175 7468 ult, server auth │ │ │ │ +00188e80: 656e 7469 6361 7469 6f6e 2069 7320 656e entication is en │ │ │ │ +00188e90: 6162 6c65 6420 616e 6420 7468 6520 3c65 abled and the cacerts. │ │ │ │ +00188eb0: 7065 6d3c 2f63 6f64 653e 3c2f 656d 3e20 pem │ │ │ │ +00188ec0: 6f72 203c 636f 6465 3e63 6170 6174 683c or capath< │ │ │ │ +00188ed0: 2f63 6f64 653e 2028 6e6f 7420 7573 6564 /code> (not used │ │ │ │ +00188ee0: 2077 6974 6820 474e 5554 4c53 2920 6d75 with GNUTLS) mu │ │ │ │ +00188ef0: 7374 2062 6520 7365 7420 736f 2074 6861 st be set so tha │ │ │ │ +00188f00: 7420 7468 6520 4341 2063 6572 7469 6669 t the CA certifi │ │ │ │ +00188f10: 6361 7465 7320 6f66 2074 6865 2073 6572 cates of the ser │ │ │ │ +00188f20: 7665 7228 7329 2061 7265 2061 6363 6573 ver(s) are acces │ │ │ │ +00188f30: 7369 626c 6520 6174 2072 756e 2074 696d sible at run tim │ │ │ │ +00188f40: 652e 2054 6865 203c 656d 3e3c 636f 6465 e. The cacerts.pem file in │ │ │ │ +00188f70: 636c 7564 6564 2069 6e20 7468 6520 6753 cluded in the gS │ │ │ │ +00188f80: 4f41 5020 736f 7572 6365 2063 6f64 6520 OAP source code │ │ │ │ +00188f90: 7061 636b 6167 6520 636f 6e74 6169 6e73 package contains │ │ │ │ +00188fa0: 2074 6865 2063 6572 7469 6669 6361 7465 the certificate │ │ │ │ +00188fb0: 7320 6f66 2063 6f6d 6d6f 6e20 4341 732e s of common CAs. │ │ │ │ +00188fc0: 2054 6869 7320 6669 6c65 206d 7573 7420 This file must │ │ │ │ +00188fd0: 6265 2073 7570 706c 6965 6420 7769 7468 be supplied with │ │ │ │ +00188fe0: 2074 6865 2063 6c69 656e 742c 2069 6620 the client, if │ │ │ │ +00188ff0: 7365 7276 6572 2061 7574 6865 6e74 6963 server authentic │ │ │ │ +00189000: 6174 696f 6e20 6973 2072 6571 7569 7265 ation is require │ │ │ │ +00189010: 642e 2041 6c74 6572 6e61 7469 7665 6c79 d. Alternatively │ │ │ │ +00189020: 2c20 796f 7520 6361 6e20 7573 6520 7468 , you can use th │ │ │ │ +00189030: 6520 3c65 6d3e 3c63 6f64 653e 6773 6f61 e gsoa │ │ │ │ +00189040: 702f 706c 7567 696e 2f63 6163 6572 7473 p/plugin/cacerts │ │ │ │ +00189050: 2e68 3c2f 636f 6465 3e3c 2f65 6d3e 2061 .h a │ │ │ │ +00189060: 6e64 203c 656d 3e3c 636f 6465 3e67 736f nd gso │ │ │ │ +00189070: 6170 2f70 6c75 6769 6e2f 6361 6365 7274 ap/plugin/cacert │ │ │ │ +00189080: 732e 633c 2f63 6f64 653e 3c2f 656d 3e20 s.c │ │ │ │ +00189090: 636f 6465 2074 6f20 656d 6265 6420 4341 code to embed CA │ │ │ │ +001890a0: 2063 6572 7469 6669 6361 7465 7320 696e certificates in │ │ │ │ +001890b0: 2079 6f75 7220 636c 6965 6e74 2063 6f64 your client cod │ │ │ │ +001890c0: 652e 3c2f 703e 0a3c 703e 596f 7520 6361 e.

    .

    You ca │ │ │ │ +001890d0: 6e20 7370 6563 6966 7920 6120 6369 7068 n specify a ciph │ │ │ │ +001890e0: 6572 206c 6973 7420 746f 2075 7365 2077 er list to use w │ │ │ │ +001890f0: 6974 6820 544c 5376 312e 3220 616e 6420 ith TLSv1.2 and │ │ │ │ +00189100: 6265 6c6f 7720 7769 7468 203c 636f 6465 below with SSL_CTX_set_cip │ │ │ │ +00189120: 6865 725f 6c69 7374 2873 6f61 702d 2667 her_list(soap-&g │ │ │ │ +00189130: 743b 6374 782c 2022 2e2e 2e22 293c 2f63 t;ctx, "...") where soap->ctx is the SSL │ │ │ │ +00189170: 636f 6e74 6578 7420 6372 6561 7465 6420 context created │ │ │ │ +00189180: 6279 203c 636f 6465 3e3c 6120 636c 6173 by soap │ │ │ │ +00189210: 5f73 736c 5f63 6c69 656e 745f 636f 6e74 _ssl_client_cont │ │ │ │ +00189220: 6578 7428 293c 2f61 3e3c 2f63 6f64 653e ext() │ │ │ │ +00189230: 2e20 4c69 6b65 7769 7365 2c20 7573 6520 . Likewise, use │ │ │ │ +00189240: 3c63 6f64 653e 5353 4c5f 4354 585f 7365 SSL_CTX_se │ │ │ │ +00189250: 745f 6369 7068 6572 7375 6974 6573 2873 t_ciphersuites(s │ │ │ │ +00189260: 6f61 702d 2667 743b 6374 782c 2022 2e2e oap->ctx, ".. │ │ │ │ +00189270: 2e22 293c 2f63 6f64 653e 2074 6f20 636f .") to co │ │ │ │ +00189280: 6e66 6967 7572 6520 7468 6520 6176 6169 nfigure the avai │ │ │ │ +00189290: 6c61 626c 6520 544c 5376 312e 3320 6369 lable TLSv1.3 ci │ │ │ │ +001892a0: 7068 6572 7375 6974 6573 2e3c 2f70 3e0a phersuites.

    . │ │ │ │ +001892b0: 3c70 3e57 6520 7265 6665 7220 746f 2074

    We refer to t │ │ │ │ +001892c0: 6865 204f 7065 6e53 534c 2064 6f63 756d he OpenSSL docum │ │ │ │ +001892d0: 656e 7461 7469 6f6e 2061 6e64 206d 616e entation and man │ │ │ │ +001892e0: 7561 6c20 7061 6765 7320 6f66 203c 636f ual pages of SSL_CTX_set_c │ │ │ │ +00189300: 6970 6865 725f 6c69 7374 3c2f 636f 6465 ipher_list and SSL_ │ │ │ │ +00189320: 4354 585f 7365 745f 6369 7068 6572 7375 CTX_set_ciphersu │ │ │ │ +00189330: 6974 6573 3c2f 636f 6465 3e20 666f 7220 ites for │ │ │ │ +00189340: 6465 7461 696c 7320 6f6e 2074 6865 206c details on the l │ │ │ │ +00189350: 6174 6573 7420 6369 7068 6572 206c 6973 atest cipher lis │ │ │ │ +00189360: 7473 2061 6e64 2073 7569 7465 7320 6176 ts and suites av │ │ │ │ +00189370: 6169 6c61 626c 6520 746f 2075 7365 2e3c ailable to use.< │ │ │ │ +00189380: 2f70 3e0a 3c70 3e4f 7468 6572 2063 6c69 /p>.

    Other cli │ │ │ │ +00189390: 656e 742d 7369 6465 2053 534c 206f 7074 ent-side SSL opt │ │ │ │ +001893a0: 696f 6e73 2061 7265 203c 636f 6465 3e23 ions are # │ │ │ │ +001893b0: 534f 4150 5f53 534c 5f53 4b49 505f 484f SOAP_SSL_SKIP_HO │ │ │ │ +001893c0: 5354 5f43 4845 434b 3c2f 636f 6465 3e20 ST_CHECK │ │ │ │ +001893d0: 746f 2073 6b69 7020 7468 6520 686f 7374 to skip the host │ │ │ │ +001893e0: 206e 616d 6520 7665 7269 6669 6361 7469 name verificati │ │ │ │ +001893f0: 6f6e 2063 6865 636b 2061 6e64 203c 636f on check and #SOAP_SSL_ALL │ │ │ │ +00189410: 4f57 5f45 5850 4952 4544 5f43 4552 5449 OW_EXPIRED_CERTI │ │ │ │ +00189420: 4649 4341 5445 3c2f 636f 6465 3e20 746f FICATE to │ │ │ │ +00189430: 2061 6c6c 6f77 2063 6f6e 6e65 6374 696e allow connectin │ │ │ │ +00189440: 6720 746f 2061 2068 6f73 7420 7769 7468 g to a host with │ │ │ │ +00189450: 2061 6e20 6578 7069 7265 6420 6365 7274 an expired cert │ │ │ │ +00189460: 6966 6963 6174 652e 2046 6f72 2065 7861 ificate. For exa │ │ │ │ +00189470: 6d70 6c65 2c3c 2f70 3e0a 3c64 6976 2063 mple,

    .
    │ │ │ │ +00189490: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65 .< │ │ │ │ +00189540: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +00189550: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ │ +00189560: 705f 5f73 736c 2e68 746d 6c23 6761 3537 p__ssl.html#ga57 │ │ │ │ +00189570: 3062 3236 3261 6339 6435 3566 6335 3039 0b262ac9d55fc509 │ │ │ │ +00189580: 6631 6635 3939 3964 6561 6131 3866 223e f1f5999deaa18f"> │ │ │ │ +00189590: 736f 6170 5f73 736c 5f69 6e69 743c 2f61 soap_ssl_init(); /* in │ │ │ │ +001895c0: 6974 204f 7065 6e53 534c 2028 736b 6970 it OpenSSL (skip │ │ │ │ +001895d0: 7069 6e67 2074 6869 7320 6f72 2063 616c ping this or cal │ │ │ │ +001895e0: 6c69 6e67 206d 756c 7469 706c 6520 7469 ling multiple ti │ │ │ │ +001895f0: 6d65 7320 6973 204f 4b2c 2073 696e 6365 mes is OK, since │ │ │ │ +00189600: 2074 6865 2065 6e67 696e 6520 7769 6c6c the engine will │ │ │ │ +00189610: 2069 6e69 7420 5353 4c20 6175 746f 6d61 init SSL automa │ │ │ │ +00189620: 7469 6361 6c6c 7929 202a 2f3c 2f73 7061 tically) */
    .
    /* soap_ssl_noi │ │ │ │ +00189670: 6e69 7428 293b 202a 2f3c 2f73 7061 6e3e nit(); */ │ │ │ │ +00189680: 203c 7370 616e 2063 6c61 7373 3d22 636f /* do not │ │ │ │ +001896a0: 2069 6e69 7420 4f70 656e 5353 4c20 2869 init OpenSSL (i │ │ │ │ +001896b0: 6620 5353 4c20 6973 2061 6c72 6561 6479 f SSL is already │ │ │ │ +001896c0: 2069 6e69 7469 616c 697a 6564 2065 6c73 initialized els │ │ │ │ +001896d0: 6577 6865 7265 2069 6e20 7468 6973 2061 ewhere in this a │ │ │ │ +001896e0: 7070 6c69 6361 7469 6f6e 2920 2a2f 3c2f pplication) */
    .
    soap_init │ │ │ │ +00189770: 2826 616d 703b 3c61 2063 6c61 7373 3d22 (&soa │ │ │ │ +001897a0: 703c 2f61 3e29 3b3c 2f64 6976 3e0a 3c64 p);
    . │ │ │ │ +001897c0: 3c73 7061 6e20 636c 6173 733d 226b 6579 if (soap_ssl_c │ │ │ │ +00189840: 6c69 656e 745f 636f 6e74 6578 743c 2f61 lient_context(&so │ │ │ │ +00189880: 6170 3c2f 613e 2c20 3c2f 6469 763e 0a3c ap,
    .< │ │ │ │ +00189890: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +001898a0: 3e20 203c 6120 636c 6173 733d 2263 6f64 > SOAP_SSL_REQ │ │ │ │ +00189900: 5549 5245 5f53 4552 5645 525f 4155 5448 UIRE_SERVER_AUTH │ │ │ │ +00189910: 454e 5449 4341 5449 4f4e 3c2f 613e 2020 ENTICATION │ │ │ │ +00189920: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    | SO │ │ │ │ +00189990: 4150 5f53 534c 5f53 4b49 505f 484f 5354 AP_SSL_SKIP_HOST │ │ │ │ +001899a0: 5f43 4845 434b 3c2f 613e 2c20 3c2f 6469 _CHECK, ..
    "c │ │ │ │ +00189a80: 6c69 656e 742e 7065 6d26 7175 6f74 3b3c lient.pem"< │ │ │ │ +00189a90: 2f73 7061 6e3e 2c20 2020 2020 2020 203c /span>, < │ │ │ │ +00189aa0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ +00189ab0: 656e 7422 3e2f 2a20 6b65 7966 696c 653a ent">/* keyfile: │ │ │ │ +00189ac0: 2072 6571 7569 7265 6420 6f6e 6c79 2077 required only w │ │ │ │ +00189ad0: 6865 6e20 636c 6965 6e74 206d 7573 7420 hen client must │ │ │ │ +00189ae0: 6175 7468 656e 7469 6361 7465 2074 6f20 authenticate to │ │ │ │ +00189af0: 7365 7276 6572 2028 7365 6520 5353 4c20 server (see SSL │ │ │ │ +00189b00: 646f 6373 206f 6e20 686f 7720 746f 206f docs on how to o │ │ │ │ +00189b10: 6274 6169 6e20 7468 6973 2066 696c 6529 btain this file) │ │ │ │ +00189b20: 202a 2f3c 2f73 7061 6e3e 203c 2f64 6976 */
    .
    "password │ │ │ │ +00189b70: 2671 756f 743b 3c2f 7370 616e 3e2c 2020 ", │ │ │ │ +00189b80: 2020 2020 2020 2020 3c73 7061 6e20 636c /* │ │ │ │ +00189ba0: 2070 6173 7377 6f72 6420 746f 2072 6561 password to rea │ │ │ │ +00189bb0: 6420 7468 6520 6b65 7920 6669 6c65 2028 d the key file ( │ │ │ │ +00189bc0: 6e6f 7420 7573 6564 2077 6974 6820 474e not used with GN │ │ │ │ +00189bd0: 5554 4c53 2920 2a2f 3c2f 7370 616e 3e20 UTLS) */ │ │ │ │ +00189be0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    "cac │ │ │ │ +00189c20: 6572 7473 2e70 656d 2671 756f 743b 3c2f erts.pem", /* cacert fil │ │ │ │ +00189c60: 6520 746f 2073 746f 7265 2074 7275 7374 e to store trust │ │ │ │ +00189c70: 6564 2063 6572 7469 6669 6361 7465 7320 ed certificates │ │ │ │ +00189c80: 286e 6565 6465 6420 746f 2076 6572 6966 (needed to verif │ │ │ │ +00189c90: 7920 7365 7276 6572 2920 2a2f 3c2f 7370 y server) */
    .
    NU │ │ │ │ +00189cc0: 4c4c 2c20 2020 2020 2020 2020 2020 2020 LL, │ │ │ │ +00189cd0: 2020 203c 7370 616e 2063 6c61 7373 3d22 /* capa │ │ │ │ +00189cf0: 7468 2074 6f20 6469 7265 6374 6f72 7920 th to directory │ │ │ │ +00189d00: 7769 7468 2074 7275 7374 6564 2063 6572 with trusted cer │ │ │ │ +00189d10: 7469 6669 6361 7465 7320 2a2f 3c2f 7370 tificates */
    .
    N │ │ │ │ +00189d40: 554c 4c20 2020 2020 2020 2020 3c73 7061 ULL /* if randfile │ │ │ │ +00189d70: 213d 4e55 4c4c 3a20 7573 6520 6120 6669 !=NULL: use a fi │ │ │ │ +00189d80: 6c65 2077 6974 6820 7261 6e64 6f6d 2064 le with random d │ │ │ │ +00189d90: 6174 6120 746f 2073 6565 6420 7261 6e64 ata to seed rand │ │ │ │ +00189da0: 6f6d 6e65 7373 202a 2f3c 2f73 7061 6e3e omness */ │ │ │ │ +00189db0: 2020 3c2f 6469 763e 0a3c 6469 7620 636c
    .
    )) .
    {
    .< │ │ │ │ +00189df0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00189e00: 3e20 203c 6120 636c 6173 733d 2263 6f64 > soap_print │ │ │ │ +00189e60: 5f66 6175 6c74 3c2f 613e 2826 616d 703b _fault(& │ │ │ │ +00189e70: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap, │ │ │ │ +00189ea0: 2073 7464 6572 7229 3b20 3c2f 6469 763e stderr);
    │ │ │ │ +00189eb0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    exit(EXIT_F │ │ │ │ +00189ed0: 4149 4c55 5245 293b 203c 2f64 6976 3e0a AILURE);
    . │ │ │ │ +00189ee0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    }
    .
    soa │ │ │ │ +00189f10: 705f 6361 6c6c 5f6e 735f 5f6d 796d 6574 p_call_ns__mymet │ │ │ │ +00189f20: 686f 6428 2661 6d70 3b3c 6120 636c 6173 hod(& │ │ │ │ +00189f50: 736f 6170 3c2f 613e 2c20 3c73 7061 6e20 soap, "http │ │ │ │ +00189f80: 733a 2f2f 646f 6d61 696e 2f70 6174 682f s://domain/path/ │ │ │ │ +00189f90: 7365 6375 7265 2e63 6769 2671 756f 743b secure.cgi" │ │ │ │ +00189fa0: 3c2f 7370 616e 3e2c 203c 7370 616e 2063 , "" │ │ │ │ +00189fd0: 3b3c 2f73 7061 6e3e 2c20 2e2e 2e29 3b3c ;, ...);< │ │ │ │ +00189fe0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    #define SOA │ │ │ │ +0018a0d0: 505f 5353 4c5f 534b 4950 5f48 4f53 545f P_SSL_SKIP_HOST_ │ │ │ │ +0018a0e0: 4348 4543 4b3c 2f64 6976 3e3c 6469 7620 CHECK
    so │ │ │ │ +0018a100: 6170 5f73 736c 5f66 6c61 6773 2066 6c61 ap_ssl_flags fla │ │ │ │ +0018a110: 6720 666f 7220 636c 6965 6e74 7320 746f g for clients to │ │ │ │ +0018a120: 2061 6c6c 6f77 2063 6c69 656e 7473 2074 allow clients t │ │ │ │ +0018a130: 6f20 736b 6970 2063 6f6d 6d6f 6e20 6e61 o skip common na │ │ │ │ +0018a140: 6d65 2063 6865 636b 7320 6167 6169 6e73 me checks agains │ │ │ │ +0018a150: 7420 7468 6520 686f 7374 206e 616d 6520 t the host name │ │ │ │ +0018a160: 6f66 202e 2e2e 3c2f 6469 763e 3c64 6976 of ...
    < │ │ │ │ +0018a180: 623e 4465 6669 6e69 7469 6f6e 3a3c 2f62 b>Definition: stdsoap2.h:586 │ │ │ │ +0018a1a0: 383c 2f64 6976 3e3c 2f64 6976 3e0a 3c64 8
    .< │ │ │ │ +0018a200: 6469 7620 636c 6173 733d 2274 746e 616d div class="ttnam │ │ │ │ +0018a210: 6522 3e3c 6120 6872 6566 3d22 6772 6f75 e">SOAP_SSL_ │ │ │ │ +0018a260: 5245 5155 4952 455f 5345 5256 4552 5f41 REQUIRE_SERVER_A │ │ │ │ +0018a270: 5554 4845 4e54 4943 4154 494f 4e3c 2f61 UTHENTICATION
    #defi │ │ │ │ +0018a2a0: 6e65 2053 4f41 505f 5353 4c5f 5245 5155 ne SOAP_SSL_REQU │ │ │ │ +0018a2b0: 4952 455f 5345 5256 4552 5f41 5554 4845 IRE_SERVER_AUTHE │ │ │ │ +0018a2c0: 4e54 4943 4154 494f 4e3c 2f64 6976 3e3c NTICATION
    < │ │ │ │ +0018a2d0: 6469 7620 636c 6173 733d 2274 7464 6f63 div class="ttdoc │ │ │ │ +0018a2e0: 223e 736f 6170 5f73 736c 5f66 6c61 6773 ">soap_ssl_flags │ │ │ │ +0018a2f0: 2066 6c61 6720 666f 7220 636c 6965 6e74 flag for client │ │ │ │ +0018a300: 7320 746f 2072 6571 7569 7265 2073 6572 s to require ser │ │ │ │ +0018a310: 7665 7273 2074 6f20 6175 7468 656e 7469 vers to authenti │ │ │ │ +0018a320: 6361 7465 2074 6f20 636c 6965 6e74 7320 cate to clients │ │ │ │ +0018a330: 6475 7269 6e67 2074 6865 2048 5454 5053 during the HTTPS │ │ │ │ +0018a340: 2068 616e 6473 682e 2e2e 3c2f 6469 763e handsh...
    │ │ │ │ +0018a350: 3c64 6976 2063 6c61 7373 3d22 7474 6465
    Definition │ │ │ │ +0018a370: 3a3c 2f62 3e20 7374 6473 6f61 7032 2e68 : stdsoap2.h │ │ │ │ +0018a380: 3a35 3836 323c 2f64 6976 3e3c 2f64 6976 :5862
    .
    #defi │ │ │ │ +0018a480: 6e65 2053 4f41 505f 5353 4c5f 414c 4c4f ne SOAP_SSL_ALLO │ │ │ │ +0018a490: 575f 4558 5049 5245 445f 4345 5254 4946 W_EXPIRED_CERTIF │ │ │ │ +0018a4a0: 4943 4154 453c 2f64 6976 3e3c 6469 7620 ICATE
    so │ │ │ │ +0018a4c0: 6170 5f73 736c 5f66 6c61 6773 2066 6c61 ap_ssl_flags fla │ │ │ │ +0018a4d0: 6720 7661 6c75 6520 746f 2061 6c6c 6f77 g value to allow │ │ │ │ +0018a4e0: 2073 656c 662d 7369 676e 6564 2061 6e64 self-signed and │ │ │ │ +0018a4f0: 2065 7870 6972 6564 2063 6572 7469 6669 expired certifi │ │ │ │ +0018a500: 6361 7465 7320 616e 6420 7468 6f73 6520 cates and those │ │ │ │ +0018a510: 7769 7468 6f75 7420 4352 4c20 746f 2062 without CRL to b │ │ │ │ +0018a520: 6520 752e 2e2e 3c2f 6469 763e 3c64 6976 e u...
    < │ │ │ │ +0018a540: 623e 4465 6669 6e69 7469 6f6e 3a3c 2f62 b>Definition: stdsoap2.h:583 │ │ │ │ +0018a560: 323c 2f64 6976 3e3c 2f64 6976 3e0a 3c2f 2
    .

    For syst │ │ │ │ +0018a590: 656d 7320 6261 7365 6420 6f6e 204d 6963 ems based on Mic │ │ │ │ +0018a5a0: 726f 736f 6674 2077 696e 646f 7773 2c20 rosoft windows, │ │ │ │ +0018a5b0: 7468 6520 5769 6e49 6e65 7420 6d6f 6475 the WinInet modu │ │ │ │ +0018a5c0: 6c65 2063 616e 2062 6520 7573 6564 2069 le can be used i │ │ │ │ +0018a5d0: 6e73 7465 6164 2c20 7365 6520 3c63 6f64 nstead, see mod_gsoap/gsoa │ │ │ │ +0018a5f0: 705f 7769 6e2f 7769 6e69 6e65 743c 2f63 p_win/wininet.

    .

    Sin │ │ │ │ +0018a610: 6365 2072 656c 6561 7365 2076 6572 7369 ce release versi │ │ │ │ +0018a620: 6f6e 2032 2e38 2e32 3020 5353 4c20 7633 on 2.8.20 SSL v3 │ │ │ │ +0018a630: 2069 7320 6469 7361 626c 6564 2e20 546f is disabled. To │ │ │ │ +0018a640: 2065 6e61 626c 6520 5353 4c20 7633 2074 enable SSL v3 t │ │ │ │ +0018a650: 6f67 6574 6865 7220 7769 7468 2054 4c53 ogether with TLS │ │ │ │ +0018a660: 2031 2e30 2061 6e64 2068 6967 6865 722c 1.0 and higher, │ │ │ │ +0018a670: 2075 7365 203c 636f 6465 3e23 534f 4150 use #SOAP │ │ │ │ +0018a680: 5f53 534c 7633 5f54 4c53 7631 3c2f 636f _SSLv3_TLSv1 with < │ │ │ │ +0018a6a0: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ +0018a6b0: 663d 2267 726f 7570 5f5f 6772 6f75 705f f="group__group_ │ │ │ │ +0018a6c0: 5f73 736c 2e68 746d 6c23 6761 3334 3932 _ssl.html#ga3492 │ │ │ │ +0018a6d0: 3436 3563 6464 3861 6137 3166 6537 3436 465cdd8aa71fe746 │ │ │ │ +0018a6e0: 3139 3964 3338 3432 6361 6337 2220 7469 199d3842cac7" ti │ │ │ │ +0018a6f0: 746c 653d 2249 6e69 7469 616c 697a 6520 tle="Initialize │ │ │ │ +0018a700: 7468 6520 7365 7276 6572 2d73 6964 6520 the server-side │ │ │ │ +0018a710: 5353 4c2f 544c 5320 636f 6e74 6578 742e SSL/TLS context. │ │ │ │ +0018a720: 223e 736f 6170 5f73 736c 5f73 6572 7665 ">soap_ssl_serve │ │ │ │ +0018a730: 725f 636f 6e74 6578 743c 2f61 3e3c 2f63 r_context. To use TLS │ │ │ │ +0018a750: 2031 2e31 2061 6e64 2031 2e32 2075 7365 1.1 and 1.2 use │ │ │ │ +0018a760: 203c 636f 6465 3e53 4f41 505f 544c 5376 SOAP_TLSv │ │ │ │ +0018a770: 315f 3120 7c20 534f 4150 5f54 4c53 7631 1_1 | SOAP_TLSv1 │ │ │ │ +0018a780: 5f32 3c2f 636f 6465 3e2e 2054 6f20 7573 _2. To us │ │ │ │ +0018a790: 6520 544c 5320 312e 3220 6f6e 6c79 2075 e TLS 1.2 only u │ │ │ │ +0018a7a0: 7365 203c 636f 6465 3e23 534f 4150 5f54 se #SOAP_T │ │ │ │ +0018a7b0: 4c53 7631 5f32 3c2f 636f 6465 3e2e 2054 LSv1_2. T │ │ │ │ +0018a7c0: 6f20 7573 6520 5353 4c20 7633 206f 6e6c o use SSL v3 onl │ │ │ │ +0018a7d0: 7920 7573 6520 3c63 6f64 653e 2353 4f41 y use #SOA │ │ │ │ +0018a7e0: 505f 5353 4c76 333c 2f63 6f64 653e 2e3c P_SSLv3.< │ │ │ │ +0018a7f0: 2f70 3e0a 3c70 3e54 6f20 6469 7361 626c /p>.

    To disabl │ │ │ │ +0018a800: 6520 7365 7276 6572 2061 7574 6865 6e74 e server authent │ │ │ │ +0018a810: 6963 6174 696f 6e20 666f 7220 7465 7374 ication for test │ │ │ │ +0018a820: 696e 6720 7075 7270 6f73 6573 2c20 7573 ing purposes, us │ │ │ │ +0018a830: 6520 7468 6520 666f 6c6c 6f77 696e 673a e the following: │ │ │ │ +0018a840: 3c2f 703e 0a3c 6469 7620 636c 6173 733d

    .
    if │ │ │ │ +0018a890: 2028 3c61 2063 6c61 7373 3d22 636f 6465 (soap_ssl_clie │ │ │ │ +0018a8f0: 6e74 5f63 6f6e 7465 7874 3c2f 613e 2826 nt_context(& │ │ │ │ +0018a900: 616d 703b 3c61 2063 6c61 7373 3d22 636f amp;soap< │ │ │ │ +0018a930: 2f61 3e2c 203c 2f64 6976 3e0a 3c64 6976 /a>,
    ..
    NULL │ │ │ │ +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 203c 2f64 6976 3e0a 3c64 6976 NULL
    .
    )) │ │ │ │ +0018aa80: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    {
    .
    soap_pr │ │ │ │ +0018ab10: 696e 745f 6661 756c 743c 2f61 3e28 2661 int_fault(&a │ │ │ │ +0018ab20: 6d70 3b3c 6120 636c 6173 733d 2263 6f64 mp;soap, stderr); .
    # │ │ │ │ +0018ac90: 6465 6669 6e65 2053 4f41 505f 5353 4c5f define SOAP_SSL_ │ │ │ │ +0018aca0: 4e4f 5f41 5554 4845 4e54 4943 4154 494f NO_AUTHENTICATIO │ │ │ │ +0018acb0: 4e3c 2f64 6976 3e3c 6469 7620 636c 6173 N
    soap_s │ │ │ │ +0018acd0: 736c 5f66 6c61 6773 2066 6c61 6720 7661 sl_flags flag va │ │ │ │ +0018ace0: 6c75 6520 746f 2064 6973 6162 6c65 2061 lue to disable a │ │ │ │ +0018acf0: 7574 6865 6e74 6963 6174 696f 6e20 6f66 uthentication of │ │ │ │ +0018ad00: 2074 6865 2070 6565 723c 2f64 6976 3e3c the peer
    < │ │ │ │ +0018ad10: 6469 7620 636c 6173 733d 2274 7464 6566 div class="ttdef │ │ │ │ +0018ad20: 223e 3c62 3e44 6566 696e 6974 696f 6e3a ">Definition: │ │ │ │ +0018ad30: 3c2f 623e 2073 7464 736f 6170 322e 683a stdsoap2.h: │ │ │ │ +0018ad40: 3538 3430 3c2f 6469 763e 3c2f 6469 763e 5840
    │ │ │ │ +0018ad50: 0a3c 2f64 6976 3e3c 212d 2d20 6672 6167 .

    This │ │ │ │ +0018ad70: 616c 736f 2061 7373 756d 6573 2074 6861 also assumes tha │ │ │ │ +0018ad80: 7420 7468 6520 7365 7276 6572 2064 6f65 t the server doe │ │ │ │ +0018ad90: 7320 6e6f 7420 7265 7175 6972 6520 636c s not require cl │ │ │ │ +0018ada0: 6965 6e74 7320 746f 2061 7574 6865 6e74 ients to authent │ │ │ │ +0018adb0: 6963 6174 6520 2874 6865 206b 6579 6669 icate (the keyfi │ │ │ │ +0018adc0: 6c65 2069 7320 6162 7365 6e74 292e 3c2f le is absent)..

    Make sure │ │ │ │ +0018ade0: 796f 7520 6861 7665 2073 6967 6e61 6c20 you have signal │ │ │ │ +0018adf0: 6861 6e64 6c65 7273 2073 6574 2069 6e20 handlers set in │ │ │ │ +0018ae00: 796f 7572 2061 7070 6c69 6361 7469 6f6e your application │ │ │ │ +0018ae10: 2074 6f20 6361 7463 6820 6272 6f6b 656e to catch broken │ │ │ │ +0018ae20: 2063 6f6e 6e65 6374 696f 6e73 2028 3c63 connections (SIGPIPE):

    .
    < │ │ │ │ +0018ae60: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +0018ae70: 3e73 6967 6e61 6c28 5349 4750 4950 452c >signal(SIGPIPE, │ │ │ │ +0018ae80: 2073 6967 7069 7065 5f68 616e 646c 6529 sigpipe_handle) │ │ │ │ +0018ae90: 3b3c 2f64 6976 3e0a 3c2f 6469 763e 3c21 ;
    .

    < │ │ │ │ +0018e4f0: 703e 5468 6520 666f 6c6c 6f77 696e 6720 p>The following │ │ │ │ +0018e500: 7461 626c 6520 6c69 7374 7320 7468 6520 table lists the │ │ │ │ +0018e510: 6e61 6d65 7320 6f66 2074 6865 2068 6172 names of the har │ │ │ │ +0018e520: 6477 6172 6520 616e 6420 736f 6674 7761 dware and softwa │ │ │ │ +0018e530: 7265 2065 6e67 696e 6573 3a3c 2f70 3e0a re engines:

    . │ │ │ │ +0018e540: 3c74 6162 6c65 2063 6c61 7373 3d22 6d61 ...... │ │ │ │ +0018e6f0: 3c63 6f64 653e 6f70 656e 6273 645f 6465 openbsd_de │ │ │ │ +0018e700: 765f 6372 7970 746f 3c2f 636f 6465 3e20 v_crypto │ │ │ │ +0018e710: 2020 3c2f 7464 3e3c 7464 2063 6c61 7373 .. │ │ │ │ +0018e7d0: 3c74 6420 636c 6173 733d 226d 6172 6b64 ..< │ │ │ │ +0018e880: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ │ +0018e890: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ │ +0018e8a0: 3e6e 4369 7068 6572 2043 4849 4c20 6163 >nCipher CHIL ac │ │ │ │ +0018e8b0: 6365 6c65 7261 7469 6f6e 2068 6172 6477 celeration hardw │ │ │ │ +0018e8c0: 6172 6520 2020 203c 2f74 643e 3c2f 7472 are .. │ │ │ │ +0018e930: 3c74 6420 636c 6173 733d 226d 6172 6b64 ....< │ │ │ │ +0018ea50: 7464 2063 6c61 7373 3d22 6d61 726b 646f td class="markdo │ │ │ │ +0018ea60: 776e 5461 626c 6542 6f64 794e 6f6e 6522 wnTableBodyNone" │ │ │ │ +0018ea70: 3e3c 636f 6465 3e75 6273 6563 3c2f 636f >ubsec . │ │ │ │ +0018eae0: 3c74 7220 636c 6173 733d 226d 6172 6b64 . │ │ │ │ +0018eb80: 3c2f 7472 3e0a 3c74 7220 636c 6173 733d ...
    e │ │ │ │ +0018e5a0: 6e67 696e 6520 2020 3c2f 7468 3e3c 7468 ngine r │ │ │ │ +0018e5d0: 6573 756c 7420 2020 203c 2f74 683e 3c2f esult
    ope │ │ │ │ +0018e630: 6e73 736c 3c2f 636f 6465 3e20 2020 3c2f nssl The default │ │ │ │ +0018e670: 2073 6f66 7477 6172 6520 656e 6769 6e65 software engine │ │ │ │ +0018e680: 2066 6f72 2063 7279 7074 6f67 7261 7068 for cryptograph │ │ │ │ +0018e690: 6963 206f 7065 7261 7469 6f6e 7320 2020 ic operations │ │ │ │ +0018e6a0: 203c 2f74 643e 3c2f 7472 3e0a 3c74 7220
    OpenBSD │ │ │ │ +0018e740: 2073 7570 706f 7274 7320 6b65 726e 656c supports kernel │ │ │ │ +0018e750: 206c 6576 656c 2063 7279 7074 6f67 7261 level cryptogra │ │ │ │ +0018e760: 7068 7920 2020 203c 2f74 643e 3c2f 7472 phy
    cswif │ │ │ │ +0018e7c0: 743c 2f63 6f64 653e 2020 203c 2f74 643e t CryptoSwift ac │ │ │ │ +0018e800: 6365 6c65 7261 7469 6f6e 2068 6172 6477 celeration hardw │ │ │ │ +0018e810: 6172 6520 2020 203c 2f74 643e 3c2f 7472 are
    chil │ │ │ │ +0018e870: 3c2f 636f 6465 3e20 2020 3c2f 7464 3e3c
    atall │ │ │ │ +0018e920: 613c 2f63 6f64 653e 2020 203c 2f74 643e a Compaq Atalla │ │ │ │ +0018e960: 6163 6365 6c65 7261 7469 6f6e 2068 6172 acceleration har │ │ │ │ +0018e970: 6477 6172 6520 2020 203c 2f74 643e 3c2f dware
    nu │ │ │ │ +0018e9d0: 726f 6e3c 2f63 6f64 653e 2020 203c 2f74 ron Nuron accele │ │ │ │ +0018ea10: 7261 7469 6f6e 2068 6172 6477 6172 6520 ration hardware │ │ │ │ +0018ea20: 2020 203c 2f74 643e 3c2f 7472 3e0a 3c74
    Bro │ │ │ │ +0018eab0: 6164 636f 6d20 7542 5365 6320 6163 6365 adcom uBSec acce │ │ │ │ +0018eac0: 6c65 7261 7469 6f6e 2068 6172 6477 6172 leration hardwar │ │ │ │ +0018ead0: 6520 2020 203c 2f74 643e 3c2f 7472 3e0a e
    aep Ae │ │ │ │ +0018eb60: 7020 6163 6365 6c65 7261 7469 6f6e 2068 p acceleration h │ │ │ │ +0018eb70: 6172 6477 6172 6520 2020 203c 2f74 643e ardware
    s │ │ │ │ +0018ebd0: 7572 6577 6172 653c 2f63 6f64 653e 2020 ureware │ │ │ │ +0018ebe0: 203c 2f74 643e 3c74 6420 636c 6173 733d SureWare │ │ │ │ +0018ec10: 2061 6363 656c 6572 6174 696f 6e20 6861 acceleration ha │ │ │ │ +0018ec20: 7264 7761 7265 2020 203c 2f74 643e 3c2f rdware
    .

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

    .SSL on │ │ │ │ +0018eca0: 2057 696e 646f 7773 3c2f 6832 3e0a 3c70 Windows

    .

    Set the full pa │ │ │ │ +0018ecc0: 7468 2074 6f20 3c65 6d3e 3c63 6f64 653e th to │ │ │ │ +0018ecd0: 6c69 6273 736c 2e6c 6962 3c2f 636f 6465 libssl.lib and < │ │ │ │ +0018ecf0: 636f 6465 3e6c 6962 6372 7970 746f 2e6c code>libcrypto.l │ │ │ │ +0018ed00: 6962 3c2f 636f 6465 3e3c 2f65 6d3e 2075 ib u │ │ │ │ +0018ed10: 6e64 6572 2074 6865 204d 5356 432b 2b20 nder the MSVC++ │ │ │ │ +0018ed20: 2250 726f 6a65 6374 7322 206d 656e 752c "Projects" menu, │ │ │ │ +0018ed30: 2074 6865 6e20 6368 6f6f 7365 2022 4c69 then choose "Li │ │ │ │ +0018ed40: 6e6b 223a 2022 4f62 6a65 6374 2f4d 6f64 nk": "Object/Mod │ │ │ │ +0018ed50: 756c 6573 222e 2050 6c65 6173 6520 6d61 ules". Please ma │ │ │ │ +0018ed60: 6b65 2073 7572 6520 3c65 6d3e 3c63 6f64 ke sure libssl32.dll and < │ │ │ │ +0018ed90: 656d 3e3c 636f 6465 3e6c 6962 6561 7933 em>libeay3 │ │ │ │ +0018eda0: 322e 646c 6c3c 2f63 6f64 653e 3c2f 656d 2.dll can be loaded │ │ │ │ +0018edc0: 6279 2079 6f75 7220 6170 706c 6963 6174 by your applicat │ │ │ │ +0018edd0: 696f 6e73 2c20 7468 7573 2074 6865 7920 ions, thus they │ │ │ │ +0018ede0: 6d75 7374 2062 6520 696e 7374 616c 6c65 must be installe │ │ │ │ +0018edf0: 6420 7072 6f70 6572 6c79 206f 6e20 7468 d properly on th │ │ │ │ +0018ee00: 6520 7461 7267 6574 206d 6163 6869 6e65 e target machine │ │ │ │ +0018ee10: 2e3c 2f70 3e0a 3c70 3e49 6620 796f 7527 .

    .

    If you' │ │ │ │ +0018ee20: 7265 2075 7369 6e67 2063 6f6d 7069 6c61 re using compila │ │ │ │ +0018ee30: 7469 6f6e 2073 6574 7469 6e67 7320 7375 tion settings su │ │ │ │ +0018ee40: 6368 2061 7320 3c63 6f64 653e 2f4d 5464 ch as /MTd │ │ │ │ +0018ee50: 3c2f 636f 6465 3e20 7468 656e 206c 696e then lin │ │ │ │ +0018ee60: 6b20 746f 2074 6865 2063 6f72 7265 6374 k to the correct │ │ │ │ +0018ee70: 203c 656d 3e3c 636f 6465 3e6c 6962 6561 libea │ │ │ │ +0018ee80: 7933 324d 5464 2e6c 6962 3c2f 636f 6465 y32MTd.lib and < │ │ │ │ +0018eea0: 636f 6465 3e73 736c 6561 7933 324d 5464 code>ssleay32MTd │ │ │ │ +0018eeb0: 2e6c 6962 3c2f 636f 6465 3e3c 2f65 6d3e .lib │ │ │ │ +0018eec0: 206c 6962 7261 7269 6573 2e3c 2f70 3e0a libraries.

    . │ │ │ │ +0018eed0: 3c70 3e41 6c74 6572 6e61 7469 7665 6c79

    Alternatively │ │ │ │ +0018eee0: 2c20 796f 7520 6361 6e20 7573 6520 7468 , you can use th │ │ │ │ +0018eef0: 6520 5769 6e49 6e65 7420 696e 7465 7266 e WinInet interf │ │ │ │ +0018ef00: 6163 6520 666f 7220 7365 6375 7265 2063 ace for secure c │ │ │ │ +0018ef10: 6f6e 6e65 6374 696f 6e73 2c20 6176 6169 onnections, avai │ │ │ │ +0018ef20: 6c61 626c 6520 696e 2074 6865 203c 656d lable in the gsoap/mod │ │ │ │ +0018ef40: 5f67 736f 6170 3c2f 636f 6465 3e3c 2f65 _gsoap directory of │ │ │ │ +0018ef60: 7468 6520 6753 4f41 5020 7061 636b 6167 the gSOAP packag │ │ │ │ +0018ef70: 652c 2073 6565 2061 6c73 6f20 5365 6374 e, see also Sect │ │ │ │ +0018ef80: 696f 6e20 3c61 2063 6c61 7373 3d22 656c ion The WinInet pl │ │ │ │ +0018efc0: 7567 696e 3c2f 613e 2e20 4f72 2079 6f75 ugin. Or you │ │ │ │ +0018efd0: 2063 616e 2075 7365 2074 6865 2043 5552 can use the CUR │ │ │ │ +0018efe0: 4c20 706c 7567 696e 2074 6f20 7573 6520 L plugin to use │ │ │ │ +0018eff0: 4355 524c 2066 6f72 2073 6563 7572 6520 CURL for secure │ │ │ │ +0018f000: 636f 6e6e 6563 7469 6f6e 732c 2073 6565 connections, see │ │ │ │ +0018f010: 2053 6563 7469 6f6e 203c 6120 636c 6173 Section The CURL plu │ │ │ │ +0018f050: 6769 6e3c 2f61 3e2e 3c2f 703e 0a3c 703e gin.

    .

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

    .Z │ │ │ │ +0018f0c0: 6c69 6220 636f 6d70 7265 7373 696f 6e3c lib compression< │ │ │ │ +0018f0d0: 2f68 323e 0a3c 703e 546f 2065 6e61 626c /h2>.

    To enabl │ │ │ │ +0018f0e0: 6520 6465 666c 6174 6520 616e 6420 677a e deflate and gz │ │ │ │ +0018f0f0: 6970 2063 6f6d 7072 6573 7369 6f6e 2077 ip compression w │ │ │ │ +0018f100: 6974 6820 5a6c 6962 2c20 696e 7374 616c ith Zlib, instal │ │ │ │ +0018f110: 6c20 5a6c 6962 2066 726f 6d20 3c61 2068 l Zlib from http:/ │ │ │ │ +0018f140: 2f77 7777 2e7a 6c69 622e 6f72 673c 2f61 /www.zlib.org if not already │ │ │ │ +0018f160: 2069 6e73 7461 6c6c 6564 206f 6e20 796f installed on yo │ │ │ │ +0018f170: 7572 2073 7973 7465 6d2e 2043 6f6d 7069 ur system. Compi │ │ │ │ +0018f180: 6c65 203c 656d 3e3c 636f 6465 3e67 736f le gso │ │ │ │ +0018f190: 6170 2f73 7464 736f 6170 322e 6370 703c ap/stdsoap2.cpp< │ │ │ │ +0018f1a0: 2f63 6f64 653e 3c2f 656d 3e20 286f 7220 /code> (or │ │ │ │ +0018f1b0: 3c65 6d3e 3c63 6f64 653e 6773 6f61 702f gsoap/ │ │ │ │ +0018f1c0: 7374 6473 6f61 7032 2e63 3c2f 636f 6465 stdsoap2.c) and all │ │ │ │ +0018f1e0: 796f 7572 2073 6f75 7263 6573 2074 6861 your sources tha │ │ │ │ +0018f1f0: 7420 696e 636c 7564 6520 3c65 6d3e 3c63 t include gsoap/stdsoa │ │ │ │ +0018f210: 7032 2e68 3c2f 636f 6465 3e3c 2f65 6d3e p2.h │ │ │ │ +0018f220: 206f 7220 3c65 6d3e 3c63 6f64 653e 736f or so │ │ │ │ +0018f230: 6170 482e 683c 2f63 6f64 653e 3c2f 656d apH.h with compile-t │ │ │ │ +0018f250: 696d 6520 666c 6167 203c 636f 6465 3e23 ime flag # │ │ │ │ +0018f260: 5749 5448 5f47 5a49 503c 2f63 6f64 653e WITH_GZIP │ │ │ │ +0018f270: 2061 6e64 206c 696e 6b20 796f 7572 2063 and link your c │ │ │ │ +0018f280: 6f64 6520 7769 7468 2074 6865 205a 6c69 ode with the Zli │ │ │ │ +0018f290: 6220 6c69 6272 6172 792c 2065 2e67 2e20 b library, e.g. │ │ │ │ +0018f2a0: 3c62 3e3c 636f 6465 3e2d 6c7a 3c2f 636f -lz on Unix/ │ │ │ │ +0018f2c0: 4c69 6e75 7820 706c 6174 666f 726d 732e Linux platforms. │ │ │ │ +0018f2d0: 3c2f 703e 0a3c 703e 5468 6520 677a 6970

    .

    The gzip │ │ │ │ +0018f2e0: 2063 6f6d 7072 6573 7369 6f6e 2069 7320 compression is │ │ │ │ +0018f2f0: 6f72 7468 6f67 6f6e 616c 2074 6f20 616c orthogonal to al │ │ │ │ +0018f300: 6c20 7472 616e 7370 6f72 7420 656e 636f l transport enco │ │ │ │ +0018f310: 6469 6e67 7320 7375 6368 2061 7320 4854 dings such as HT │ │ │ │ +0018f320: 5450 2c20 5353 4c2c 2044 494d 452c 2061 TP, SSL, DIME, a │ │ │ │ +0018f330: 6e64 2063 616e 2062 6520 7573 6564 2077 nd can be used w │ │ │ │ +0018f340: 6974 6820 6f74 6865 7220 7472 616e 7370 ith other transp │ │ │ │ +0018f350: 6f72 7420 6c61 7965 7273 2e20 596f 7520 ort layers. You │ │ │ │ +0018f360: 6361 6e20 6576 656e 2073 6176 6520 616e can even save an │ │ │ │ +0018f370: 6420 6c6f 6164 2063 6f6d 7072 6573 7365 d load compresse │ │ │ │ +0018f380: 6420 584d 4c20 6461 7461 2074 6f2f 6672 d XML data to/fr │ │ │ │ +0018f390: 6f6d 2066 696c 6573 2e3c 2f70 3e0a 3c70 om files.

    .

    Two compression │ │ │ │ +0018f3b0: 2066 6f72 6d61 7473 2061 7265 2073 7570 formats are sup │ │ │ │ +0018f3c0: 706f 7274 6564 2062 7920 7468 6520 656e ported by the en │ │ │ │ +0018f3d0: 6769 6e65 3a20 6465 666c 6174 6520 616e gine: deflate an │ │ │ │ +0018f3e0: 6420 677a 6970 2e20 5468 6520 677a 6970 d gzip. The gzip │ │ │ │ +0018f3f0: 2066 6f72 6d61 7420 6973 2075 7365 6420 format is used │ │ │ │ +0018f400: 6279 2064 6566 6175 6c74 2e20 5468 6520 by default. The │ │ │ │ +0018f410: 677a 6970 2066 6f72 6d61 7420 6861 7320 gzip format has │ │ │ │ +0018f420: 7365 7665 7261 6c20 6265 6e65 6669 7473 several benefits │ │ │ │ +0018f430: 206f 7665 7220 6465 666c 6174 652e 2046 over deflate. F │ │ │ │ +0018f440: 6972 7374 6c79 2c20 7468 6520 656e 6769 irstly, the engi │ │ │ │ +0018f450: 6e65 2061 7574 6f6d 6174 6963 616c 6c79 ne automatically │ │ │ │ +0018f460: 2064 6574 6563 7473 2067 7a69 7020 636f detects gzip co │ │ │ │ +0018f470: 6d70 7265 7373 6564 2069 6e62 6f75 6e64 mpressed inbound │ │ │ │ +0018f480: 206d 6573 7361 6765 732c 2065 7665 6e20 messages, even │ │ │ │ +0018f490: 7769 7468 6f75 7420 4854 5450 2068 6561 without HTTP hea │ │ │ │ +0018f4a0: 6465 7273 2c20 6279 2063 6865 636b 696e ders, by checkin │ │ │ │ +0018f4b0: 6720 666f 7220 7468 6520 7072 6573 656e g for the presen │ │ │ │ +0018f4c0: 6365 206f 6620 6120 677a 6970 2068 6561 ce of a gzip hea │ │ │ │ +0018f4d0: 6465 7220 696e 2074 6865 206d 6573 7361 der in the messa │ │ │ │ +0018f4e0: 6765 2063 6f6e 7465 6e74 2e20 5365 636f ge content. Seco │ │ │ │ +0018f4f0: 6e64 6c79 2c20 677a 6970 2069 6e63 6c75 ndly, gzip inclu │ │ │ │ +0018f500: 6465 7320 6120 4352 4333 3220 6368 6563 des a CRC32 chec │ │ │ │ +0018f510: 6b73 756d 2074 6f20 656e 7375 7265 206d ksum to ensure m │ │ │ │ +0018f520: 6573 7361 6765 7320 6861 7665 2062 6565 essages have bee │ │ │ │ +0018f530: 6e20 636f 7272 6563 746c 7920 7265 6365 n correctly rece │ │ │ │ +0018f540: 6976 6564 2e20 5468 6972 646c 792c 2067 ived. Thirdly, g │ │ │ │ +0018f550: 7a69 7020 636f 6d70 7265 7373 6564 2063 zip compressed c │ │ │ │ +0018f560: 6f6e 7465 6e74 2063 616e 2062 6520 6465 ontent can be de │ │ │ │ +0018f570: 636f 6d70 7265 7373 6564 2077 6974 6820 compressed with │ │ │ │ +0018f580: 6f74 6865 7220 636f 6d70 7265 7373 696f other compressio │ │ │ │ +0018f590: 6e20 736f 6674 7761 7265 2c20 736f 2079 n software, so y │ │ │ │ +0018f5a0: 6f75 2063 616e 2064 6563 6f6d 7072 6573 ou can decompres │ │ │ │ +0018f5b0: 7320 584d 4c20 6461 7461 2073 6176 6564 s XML data saved │ │ │ │ +0018f5c0: 2062 7920 6120 6753 4f41 5020 6170 706c by a gSOAP appl │ │ │ │ +0018f5d0: 6963 6174 696f 6e20 696e 2067 7a69 7020 ication in gzip │ │ │ │ +0018f5e0: 666f 726d 6174 2e3c 2f70 3e0a 3c70 3e47 format.

    .

    G │ │ │ │ +0018f5f0: 7a69 7020 636f 6d70 7265 7373 696f 6e20 zip compression │ │ │ │ +0018f600: 6973 2065 6e61 626c 6564 2062 7920 636f is enabled by co │ │ │ │ +0018f610: 6d70 696c 696e 6720 7468 6520 736f 7572 mpiling the sour │ │ │ │ +0018f620: 6365 7320 7769 7468 2063 6f6d 7069 6c65 ces with compile │ │ │ │ +0018f630: 2d74 696d 6520 666c 6167 203c 636f 6465 -time flag #WITH_GZIP. To transmit │ │ │ │ +0018f660: 677a 6970 2063 6f6d 7072 6573 7365 6420 gzip compressed │ │ │ │ +0018f670: 534f 4150 2f58 4d4c 2064 6174 612c 2073 SOAP/XML data, s │ │ │ │ +0018f680: 6574 2074 6865 206f 7574 7075 7420 6d6f et the output mo │ │ │ │ +0018f690: 6465 2066 6c61 6773 2074 6f20 3c63 6f64 de flags to #SOAP_ENC_ZLIB │ │ │ │ +0018f6b0: 3c2f 636f 6465 3e2e 2046 6f72 2065 7861 . For exa │ │ │ │ +0018f6c0: 6d70 6c65 3a3c 2f70 3e0a 3c64 6976 2063 mple:

    .
    │ │ │ │ +0018f6e0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    soap_init │ │ │ │ +0018f750: 3c2f 613e 2826 616d 703b 3c61 2063 6c61 (&soap); .
    soap_s │ │ │ │ +0018f800: 6574 5f6f 6d6f 6465 3c2f 613e 2826 616d et_omode(&am │ │ │ │ +0018f810: 703b 3c61 2063 6c61 7373 3d22 636f 6465 p;soap, SOAP_ENC_Z │ │ │ │ +0018f8a0: 4c49 423c 2f61 3e29 3b20 3c73 7061 6e20 LIB); │ │ │ │ +0018f8c0: 2f2f 2065 6e61 626c 6520 5a6c 6962 2623 // enable Zlib&# │ │ │ │ +0018f8d0: 3339 3b73 2067 7a69 7020 3c2f 7370 616e 39;s gzip
    .
    if (s │ │ │ │ +0018f920: 6f61 705f 6361 6c6c 5f6e 735f 5f6d 794d oap_call_ns__myM │ │ │ │ +0018f930: 6574 686f 6428 2661 6d70 3b3c 6120 636c ethod(&soap, ...) │ │ │ │ +0018f970: 2920 3c2f 6469 763e 0a3c 6469 7620 636c )
    .
    ... │ │ │ │ +0018f990: 203c 7370 616e 2063 6c61 7373 3d22 636f // error< │ │ │ │ +0018f9b0: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    .< │ │ │ │ +0018f9d0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +0018f9e0: 6f72 6466 6c6f 7722 3e65 6c73 653c 2f73 ordflow">else
    .
    . │ │ │ │ +0018fa10: 2e2e 203c 7370 616e 2063 6c61 7373 3d22 .. // succ │ │ │ │ +0018fa30: 6573 733c 2f73 7061 6e3e 3c2f 6469 763e ess
    │ │ │ │ +0018fa40: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    soap_clr │ │ │ │ +0018fab0: 5f6f 6d6f 6465 3c2f 613e 2826 616d 703b _omode(& │ │ │ │ +0018fac0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap, │ │ │ │ +0018faf0: 203c 6120 636c 6173 733d 2263 6f64 6522 SOAP_ENC_ZLI │ │ │ │ +0018fb50: 423c 2f61 3e29 3b20 3c73 7061 6e20 636c B); // │ │ │ │ +0018fb70: 2064 6973 6162 6c65 205a 6c69 6226 2333 disable Zlib │ │ │ │ +0018fb80: 393b 7320 677a 6970 203c 2f73 7061 6e3e 9;s gzip │ │ │ │ +0018fb90: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    # │ │ │ │ +0018fc70: 6465 6669 6e65 2053 4f41 505f 454e 435f define SOAP_ENC_ │ │ │ │ +0018fc80: 5a4c 4942 3c2f 6469 763e 3c64 6976 2063 ZLIB
    soa │ │ │ │ +0018fca0: 705f 6d6f 6465 2045 4e43 206f 7574 7075 p_mode ENC outpu │ │ │ │ +0018fcb0: 7420 666c 6167 2076 616c 7565 2074 6f20 t flag value to │ │ │ │ +0018fcc0: 636f 6d70 7265 7373 206d 6573 7361 6765 compress message │ │ │ │ +0018fcd0: 7320 7365 6e74 2c20 7265 7175 6972 6573 s sent, requires │ │ │ │ +0018fce0: 207a 6c69 6220 656e 6162 6c65 6420 7769 zlib enabled wi │ │ │ │ +0018fcf0: 7468 2063 6f6d 7069 6c65 2d74 696d 6520 th compile-time │ │ │ │ +0018fd00: 666c 2e2e 2e3c 2f64 6976 3e3c 6469 7620 fl...
    Definition: │ │ │ │ +0018fd30: 2073 7464 736f 6170 322e 683a 3137 3838 stdsoap2.h:1788 │ │ │ │ +0018fd40: 3c2f 6469 763e 3c2f 6469 763e 0a3c 2f64
    .

    This will │ │ │ │ +0018fd70: 2073 656e 6420 6120 636f 6d70 7265 7373 send a compress │ │ │ │ +0018fd80: 6564 2053 4f41 502f 584d 4c20 7265 7175 ed SOAP/XML requ │ │ │ │ +0018fd90: 6573 7420 746f 2061 2073 6572 7669 6365 est to a service │ │ │ │ +0018fda0: 2c20 7072 6f76 6964 6564 2074 6861 7420 , provided that │ │ │ │ +0018fdb0: 5a6c 6962 2069 7320 696e 7374 616c 6c65 Zlib is installe │ │ │ │ +0018fdc0: 6420 616e 6420 6c69 6e6b 6564 2077 6974 d and linked wit │ │ │ │ +0018fdd0: 6820 7468 6520 6170 706c 6963 6174 696f h the applicatio │ │ │ │ +0018fde0: 6e20 616e 6420 7468 6520 636f 6d70 696c n and the compil │ │ │ │ +0018fdf0: 652d 7469 6d65 2066 6c61 6720 3c63 6f64 e-time flag #WITH_GZIP option was u │ │ │ │ +0018fe20: 7365 6420 746f 2063 6f6d 7069 6c65 2074 sed to compile t │ │ │ │ +0018fe30: 6865 2073 6f75 7263 6573 2e20 5265 6365 he sources. Rece │ │ │ │ +0018fe40: 6976 696e 6720 636f 6d70 7265 7373 6564 iving compressed │ │ │ │ +0018fe50: 2053 4f41 502f 584d 4c20 6f76 6572 2048 SOAP/XML over H │ │ │ │ +0018fe60: 5454 5020 6569 7468 6572 2069 6e20 677a TTP either in gz │ │ │ │ +0018fe70: 6970 206f 7220 6465 666c 6174 6520 666f ip or deflate fo │ │ │ │ +0018fe80: 726d 6174 7320 6973 2061 7574 6f6d 6174 rmats is automat │ │ │ │ +0018fe90: 6963 2e20 5468 6520 3c63 6f64 653e 2353 ic. The #S │ │ │ │ +0018fea0: 4f41 505f 454e 435f 5a4c 4942 3c2f 636f OAP_ENC_ZLIB flag does no │ │ │ │ +0018fec0: 7420 6861 7665 2074 6f20 6265 2073 6574 t have to be set │ │ │ │ +0018fed0: 2061 7420 7468 6520 7365 7276 6572 2073 at the server s │ │ │ │ +0018fee0: 6964 6520 746f 2061 6363 6570 7420 636f ide to accept co │ │ │ │ +0018fef0: 6d70 7265 7373 6564 206d 6573 7361 6765 mpressed message │ │ │ │ +0018ff00: 732e 2052 6561 6469 6e67 2061 6e64 2072 s. Reading and r │ │ │ │ +0018ff10: 6563 6569 7669 6e67 2067 7a69 7020 636f eceiving gzip co │ │ │ │ +0018ff20: 6d70 7265 7373 6564 2053 4f41 502f 584d mpressed SOAP/XM │ │ │ │ +0018ff30: 4c20 7769 7468 6f75 7420 4854 5450 2068 L without HTTP h │ │ │ │ +0018ff40: 6561 6465 7273 2028 652e 672e 2077 6974 eaders (e.g. wit │ │ │ │ +0018ff50: 6820 6f74 6865 7220 7472 616e 7370 6f72 h other transpor │ │ │ │ +0018ff60: 7420 7072 6f74 6f63 6f6c 7329 2069 7320 t protocols) is │ │ │ │ +0018ff70: 616c 736f 2061 7574 6f6d 6174 6963 2e3c also automatic.< │ │ │ │ +0018ff80: 2f70 3e0a 3c70 3e54 6f20 636f 6e74 726f /p>.

    To contro │ │ │ │ +0018ff90: 6c20 7468 6520 6c65 7665 6c20 6f66 2063 l the level of c │ │ │ │ +0018ffa0: 6f6d 7072 6573 7369 6f6e 2066 6f72 206f ompression for o │ │ │ │ +0018ffb0: 7574 626f 756e 6420 6d65 7373 6167 6573 utbound messages │ │ │ │ +0018ffc0: 2c20 796f 7520 6361 6e20 7365 7420 7468 , you can set th │ │ │ │ +0018ffd0: 6520 3c63 6f64 653e 3c61 2063 6c61 7373 e soap │ │ │ │ +00190090: 3a3a 7a5f 6c65 7665 6c3c 2f61 3e3c 2f63 ::z_level to a value │ │ │ │ +001900b0: 6265 7477 6565 6e20 3120 616e 6420 392c between 1 and 9, │ │ │ │ +001900c0: 2077 6865 7265 2031 2069 7320 7468 6520 where 1 is the │ │ │ │ +001900d0: 6265 7374 2073 7065 6564 2061 6e64 2039 best speed and 9 │ │ │ │ +001900e0: 2069 7320 7468 6520 6265 7374 2063 6f6d is the best com │ │ │ │ +001900f0: 7072 6573 7369 6f6e 2028 6465 6661 756c pression (defaul │ │ │ │ +00190100: 7420 6973 2036 292e 2046 6f72 2065 7861 t is 6). For exa │ │ │ │ +00190110: 6d70 6c65 3c2f 703e 0a3c 6469 7620 636c mple

    .
    < │ │ │ │ +00190130: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00190140: 3e3c 6120 636c 6173 733d 2263 6f64 6522 >soap_init< │ │ │ │ +001901a0: 2f61 3e28 2661 6d70 3b3c 6120 636c 6173 /a>(& │ │ │ │ +001901d0: 736f 6170 3c2f 613e 293b 203c 2f64 6976 soap);
    .
    soap_se │ │ │ │ +00190250: 745f 6f6d 6f64 653c 2f61 3e28 2661 6d70 t_omode(& │ │ │ │ +00190260: 3b3c 6120 636c 6173 733d 2263 6f64 6522 ;soap │ │ │ │ +00190290: 2c20 3c61 2063 6c61 7373 3d22 636f 6465 , SOAP_ENC_ZL │ │ │ │ +001902f0: 4942 3c2f 613e 293b 203c 2f64 6976 3e0a IB);
    . │ │ │ │ +00190300: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    soap.z_lev │ │ │ │ +00190390: 656c 3c2f 613e 203d 2039 3b20 3c73 7061 el = 9; // best compre │ │ │ │ +001903c0: 7373 696f 6e20 3c2f 7370 616e 3e3c 2f64 ssion .
    soa │ │ │ │ +00190470: 703a 3a7a 5f6c 6576 656c 3c2f 613e 3c2f p::z_level
    unsigned │ │ │ │ +001904a0: 2073 686f 7274 207a 5f6c 6576 656c 3c2f short z_level
    User-defi │ │ │ │ +001904d0: 6e61 626c 6520 636f 6d70 7265 7373 696f nable compressio │ │ │ │ +001904e0: 6e20 6c65 7665 6c20 666f 7220 677a 6970 n level for gzip │ │ │ │ +001904f0: 2063 6f6d 7072 6573 7369 6f6e 2028 303d compression (0= │ │ │ │ +00190500: 6e6f 6e65 2c20 313d 6661 7374 2074 6f20 none, 1=fast to │ │ │ │ +00190510: 393d 6265 7374 2920 6465 6661 756c 7420 9=best) default │ │ │ │ +00190520: 6c65 7665 6c20 6973 2036 2e3c 2f64 6976 level is 6.
    Definitio │ │ │ │ +00190550: 6e3a 3c2f 623e 2073 7464 736f 6170 322e n: stdsoap2. │ │ │ │ +00190560: 683a 3337 3034 3c2f 6469 763e 3c2f 6469 h:3704
    .

    To │ │ │ │ +00190590: 7665 7269 6679 2061 6e64 206d 6f6e 6974 verify and monit │ │ │ │ +001905a0: 6f72 2063 6f6d 7072 6573 7369 6f6e 2072 or compression r │ │ │ │ +001905b0: 6174 6573 2c20 796f 7520 6361 6e20 7573 ates, you can us │ │ │ │ +001905c0: 6520 7468 6520 7661 6c75 6573 203c 636f e the values │ │ │ │ +00190680: 736f 6170 3a3a 7a5f 7261 7469 6f5f 696e soap::z_ratio_in │ │ │ │ +00190690: 3c2f 613e 3c2f 636f 6465 3e20 616e 6420 and │ │ │ │ +001906a0: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 s │ │ │ │ +00190750: 6f61 703a 3a7a 5f72 6174 696f 5f6f 7574 oap::z_ratio_out │ │ │ │ +00190760: 3c2f 613e 3c2f 636f 6465 3e2e 2054 6865 . The │ │ │ │ +00190770: 7365 2074 776f 2066 6c6f 6174 2076 616c se two float val │ │ │ │ +00190780: 7565 7320 6c69 6520 6265 7477 6565 6e20 ues lie between │ │ │ │ +00190790: 302e 3020 616e 6420 312e 3020 616e 6420 0.0 and 1.0 and │ │ │ │ +001907a0: 6578 7072 6573 7320 7468 6520 7261 7469 express the rati │ │ │ │ +001907b0: 6f20 6f66 2074 6865 2063 6f6d 7072 6573 o of the compres │ │ │ │ +001907c0: 7365 6420 6d65 7373 6167 6520 6c65 6e67 sed message leng │ │ │ │ +001907d0: 7468 206f 7665 7220 756e 636f 6d70 7265 th over uncompre │ │ │ │ +001907e0: 7373 6564 206d 6573 7361 6765 206c 656e ssed message len │ │ │ │ +001907f0: 6774 682e 3c2f 703e 0a3c 6469 7620 636c gth.

    .
    < │ │ │ │ +00190810: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00190820: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >if (soap_call_ │ │ │ │ +00190850: 6e73 5f5f 6d79 4d65 7468 6f64 2826 616d ns__myMethod(&am │ │ │ │ +00190860: 703b 3c61 2063 6c61 7373 3d22 636f 6465 p;soap, ...))
    .< │ │ │ │ +001908a0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +001908b0: 3e7b 3c2f 6469 763e 0a3c 6469 7620 636c >{
    .
    ... │ │ │ │ +001908d0: 203c 7370 616e 2063 6c61 7373 3d22 636f // error< │ │ │ │ +001908f0: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    .} │ │ │ │ +00190910: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    else.
    {
    .< │ │ │ │ +00190970: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00190980: 3e20 2070 7269 6e74 6628 3c73 7061 6e20 > printf("Comp │ │ │ │ +001909b0: 7265 7373 696f 6e20 7261 7469 6f3a 2025 ression ratio: % │ │ │ │ +001909c0: 6625 2520 2869 6e29 2025 6625 2520 286f f%% (in) %f%% (o │ │ │ │ +001909d0: 7574 295c 6e26 7175 6f74 3b3c 2f73 7061 ut)\n", 100*s │ │ │ │ +00190a10: 6f61 703c 2f61 3e2e 3c61 2063 6c61 7373 oap.z_ratio_out │ │ │ │ +00190a70: 2c20 3130 302a 3c61 2063 6c61 7373 3d22 , 100*soa │ │ │ │ +00190aa0: 703c 2f61 3e2e 3c61 2063 6c61 7373 3d22 p.z │ │ │ │ +00190af0: 5f72 6174 696f 5f69 6e3c 2f61 3e29 3b20 _ratio_in); │ │ │ │ +00190b00: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    ... < │ │ │ │ +00190b20: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ +00190b30: 656e 7422 3e2f 2f20 7375 6363 6573 733c ent">// success< │ │ │ │ +00190b40: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    .} │ │ │ │ +00190b60: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    │ │ │ │ +00190bb0: 3c64 6976 2063 6c61 7373 3d22 7474 6e61
    fl │ │ │ │ +00190c30: 6f61 7420 7a5f 7261 7469 6f5f 696e 3c2f oat z_ratio_in
    The compr │ │ │ │ +00190c60: 6573 7369 6f6e 2072 6174 696f 203d 2063 ession ratio = c │ │ │ │ +00190c70: 6f6d 7072 6573 7365 642e 7369 7a65 2f75 ompressed.size/u │ │ │ │ +00190c80: 6e63 6f6d 7072 6573 7365 642e 7369 7a65 ncompressed.size │ │ │ │ +00190c90: 206f 6620 7468 6520 636f 6d70 7265 7373 of the compress │ │ │ │ +00190ca0: 6564 206d 6573 7361 6765 2072 6563 6569 ed message recei │ │ │ │ +00190cb0: 7665 642e 3c2f 6469 763e 3c64 6976 2063 ved.
    │ │ │ │ +00190cd0: 4465 6669 6e69 7469 6f6e 3a3c 2f62 3e20 Definition: │ │ │ │ +00190ce0: 7374 6473 6f61 7032 2e68 3a33 3730 393c stdsoap2.h:3709< │ │ │ │ +00190cf0: 2f64 6976 3e3c 2f64 6976 3e0a 3c64 6976 /div>
    .
    │ │ │ │ +00190db0: 3c64 6976 2063 6c61 7373 3d22 7474 6465
    float z_rati │ │ │ │ +00190dd0: 6f5f 6f75 743c 2f64 6976 3e3c 6469 7620 o_out
    Th │ │ │ │ +00190df0: 6520 636f 6d70 7265 7373 696f 6e20 7261 e compression ra │ │ │ │ +00190e00: 7469 6f20 3d20 636f 6d70 7265 7373 6564 tio = compressed │ │ │ │ +00190e10: 2e73 697a 652f 756e 636f 6d70 7265 7373 .size/uncompress │ │ │ │ +00190e20: 6564 2e73 697a 6520 6f66 2074 6865 2063 ed.size of the c │ │ │ │ +00190e30: 6f6d 7072 6573 7365 6420 6d65 7373 6167 ompressed messag │ │ │ │ +00190e40: 6520 7365 6e74 2e3c 2f64 6976 3e3c 6469 e sent.
    │ │ │ │ +00190e60: 3c62 3e44 6566 696e 6974 696f 6e3a 3c2f Definition: stdsoap2.h:37 │ │ │ │ +00190e80: 3134 3c2f 6469 763e 3c2f 6469 763e 0a3c 14
    .< │ │ │ │ +00190e90: 2f64 6976 3e3c 212d 2d20 6672 6167 6d65 /div>

    Note: l │ │ │ │ +00190eb0: 6f77 6572 2072 6174 696f 7320 6d65 616e ower ratios mean │ │ │ │ +00190ec0: 2068 6967 6865 7220 636f 6d70 7265 7373 higher compress │ │ │ │ +00190ed0: 696f 6e20 7261 7465 732e 3c2f 703e 0a3c ion rates.

    .< │ │ │ │ +00190ee0: 703e 436f 6d70 7265 7373 6564 2074 7261 p>Compressed tra │ │ │ │ +00190ef0: 6e73 6665 7273 2072 6571 7569 7265 2062 nsfers require b │ │ │ │ +00190f00: 7566 6665 7269 6e67 2074 6865 2065 6e74 uffering the ent │ │ │ │ +00190f10: 6972 6520 6f75 7470 7574 206d 6573 7361 ire output messa │ │ │ │ +00190f20: 6765 2074 6f20 6465 7465 726d 696e 6520 ge to determine │ │ │ │ +00190f30: 4854 5450 206d 6573 7361 6765 206c 656e HTTP message len │ │ │ │ +00190f40: 6774 682e 2054 6869 7320 6d65 616e 7320 gth. This means │ │ │ │ +00190f50: 7468 6174 2074 6865 203c 636f 6465 3e23 that the # │ │ │ │ +00190f60: 534f 4150 5f49 4f5f 5354 4f52 453c 2f63 SOAP_IO_STORE flag is aut │ │ │ │ +00190f80: 6f6d 6174 6963 616c 6c79 2073 6574 2077 omatically set w │ │ │ │ +00190f90: 6865 6e20 7468 6520 3c63 6f64 653e 2353 hen the #S │ │ │ │ +00190fa0: 4f41 505f 454e 435f 5a4c 4942 3c2f 636f OAP_ENC_ZLIB flag is set │ │ │ │ +00190fc0: 746f 2073 656e 6420 636f 6d70 7265 7373 to send compress │ │ │ │ +00190fd0: 6564 206d 6573 7361 6765 732e 2054 6865 ed messages. The │ │ │ │ +00190fe0: 2075 7365 206f 6620 4854 5450 2063 6875 use of HTTP chu │ │ │ │ +00190ff0: 6e6b 696e 6720 7369 676e 6966 6963 616e nking significan │ │ │ │ +00191000: 746c 7920 7265 6475 6365 7320 6d65 6d6f tly reduces memo │ │ │ │ +00191010: 7279 2075 7361 6765 2061 6e64 206d 6179 ry usage and may │ │ │ │ +00191020: 2073 7065 6564 2075 7020 7468 6520 7472 speed up the tr │ │ │ │ +00191030: 616e 736d 6973 7369 6f6e 206f 6620 636f ansmission of co │ │ │ │ +00191040: 6d70 7265 7373 6564 2053 4f41 502f 584d mpressed SOAP/XM │ │ │ │ +00191050: 4c20 6d65 7373 6167 6573 2e20 5468 6973 L messages. This │ │ │ │ +00191060: 2069 7320 6163 636f 6d70 6c69 7368 6564 is accomplished │ │ │ │ +00191070: 2062 7920 7365 7474 696e 6720 7468 6520 by setting the │ │ │ │ +00191080: 3c63 6f64 653e 2353 4f41 505f 494f 5f43 #SOAP_IO_C │ │ │ │ +00191090: 4855 4e4b 3c2f 636f 6465 3e20 666c 6167 HUNK flag │ │ │ │ +001910a0: 2077 6974 6820 3c63 6f64 653e 2353 4f41 with #SOA │ │ │ │ +001910b0: 505f 454e 435f 5a4c 4942 3c2f 636f 6465 P_ENC_ZLIB for the output │ │ │ │ +001910d0: 206d 6f64 652e 2048 6f77 6576 6572 2c20 mode. However, │ │ │ │ +001910e0: 736f 6d65 2057 6562 2073 6572 7665 7273 some Web servers │ │ │ │ +001910f0: 2064 6f20 6e6f 7420 6163 6365 7074 2048 do not accept H │ │ │ │ +00191100: 5454 5020 6368 756e 6b65 6420 7265 7175 TTP chunked requ │ │ │ │ +00191110: 6573 7420 6d65 7373 6167 6573 2028 6576 est messages (ev │ │ │ │ +00191120: 656e 2077 6865 6e20 7468 6579 2072 6574 en when they ret │ │ │ │ +00191130: 7572 6e20 4854 5450 2063 6875 6e6b 6564 urn HTTP chunked │ │ │ │ +00191140: 206d 6573 7361 6765 7321 292e 2053 7461 messages!). Sta │ │ │ │ +00191150: 6e64 2d61 6c6f 6e65 2067 534f 4150 2073 nd-alone gSOAP s │ │ │ │ +00191160: 6572 7669 6365 7320 616c 7761 7973 2061 ervices always a │ │ │ │ +00191170: 6363 6570 7420 6368 756e 6b65 6420 7265 ccept chunked re │ │ │ │ +00191180: 7175 6573 7420 6d65 7373 6167 6573 2e3c quest messages.< │ │ │ │ +00191190: 2f70 3e0a 3c70 3e54 6f20 7265 7374 7269 /p>.

    To restri │ │ │ │ +001911a0: 6374 2074 6865 2063 6f6d 7072 6573 7369 ct the compressi │ │ │ │ +001911b0: 6f6e 2074 6f20 7468 6520 6465 666c 6174 on to the deflat │ │ │ │ +001911c0: 6520 666f 726d 6174 206f 6e6c 792c 2063 e format only, c │ │ │ │ +001911d0: 6f6d 7069 6c65 2074 6865 2073 6f75 7263 ompile the sourc │ │ │ │ +001911e0: 6573 2077 6974 6820 7468 6520 636f 6d70 es with the comp │ │ │ │ +001911f0: 696c 652d 7469 6d65 2066 6c61 6720 3c63 ile-time flag #WITH_ZLIB. This limi │ │ │ │ +00191220: 7473 2063 6f6d 7072 6573 7369 6f6e 2061 ts compression a │ │ │ │ +00191230: 6e64 2064 6563 6f6d 7072 6573 7369 6f6e nd decompression │ │ │ │ +00191240: 2074 6f20 7468 6520 6465 666c 6174 6520 to the deflate │ │ │ │ +00191250: 666f 726d 6174 2e20 4f6e 6c79 2070 6c61 format. Only pla │ │ │ │ +00191260: 696e 2061 6e64 2064 6566 6c61 7465 6420 in and deflated │ │ │ │ +00191270: 6d65 7373 6167 6573 2063 616e 2062 6520 messages can be │ │ │ │ +00191280: 6578 6368 616e 6765 642c 2067 7a69 7020 exchanged, gzip │ │ │ │ +00191290: 6973 206e 6f74 2073 7570 706f 7274 6564 is not supported │ │ │ │ +001912a0: 2077 6974 6820 7468 6973 206f 7074 696f with this optio │ │ │ │ +001912b0: 6e2e 2052 6563 6569 7669 6e67 2067 7a69 n. Receiving gzi │ │ │ │ +001912c0: 7020 636f 6d70 7265 7373 6564 2063 6f6e p compressed con │ │ │ │ +001912d0: 7465 6e74 2069 7320 6175 746f 6d61 7469 tent is automati │ │ │ │ +001912e0: 632c 2065 7665 6e20 696e 2074 6865 2061 c, even in the a │ │ │ │ +001912f0: 6273 656e 6365 206f 6620 4854 5450 2068 bsence of HTTP h │ │ │ │ +00191300: 6561 6465 7273 2e20 5265 6365 6976 696e eaders. Receivin │ │ │ │ +00191310: 6720 6465 666c 6174 6520 636f 6d70 7265 g deflate compre │ │ │ │ +00191320: 7373 6564 2063 6f6e 7465 6e74 2069 7320 ssed content is │ │ │ │ +00191330: 6e6f 7420 6175 746f 6d61 7469 6320 696e not automatic in │ │ │ │ +00191340: 2074 6865 2061 6273 656e 6365 206f 6620 the absence of │ │ │ │ +00191350: 4854 5450 2068 6561 6465 7273 2061 6e64 HTTP headers and │ │ │ │ +00191360: 2072 6571 7569 7265 7320 7468 6520 666c requires the fl │ │ │ │ +00191370: 6167 203c 636f 6465 3e23 534f 4150 5f45 ag #SOAP_E │ │ │ │ +00191380: 4e43 5f5a 4c49 423c 2f63 6f64 653e 2074 NC_ZLIB t │ │ │ │ +00191390: 6f20 6265 2073 6574 2066 6f72 2074 6865 o be set for the │ │ │ │ +001913a0: 2069 6e70 7574 206d 6f64 6520 746f 2064 input mode to d │ │ │ │ +001913b0: 6563 6f6d 7072 6573 7320 6465 666c 6174 ecompress deflat │ │ │ │ +001913c0: 6564 2064 6174 612e 3c2f 703e 0a3c 646c ed data.

    .
    War │ │ │ │ +001913f0: 6e69 6e67 3c2f 6474 3e3c 6464 3e49 7420 ning
    It │ │ │ │ +00191400: 6973 2069 6d70 6f72 7461 6e74 2074 6861 is important tha │ │ │ │ +00191410: 7420 7468 6520 3c63 6f64 653e 2357 4954 t the #WIT │ │ │ │ +00191420: 485f 475a 4950 3c2f 636f 6465 3e20 616e H_GZIP an │ │ │ │ +00191430: 6420 3c63 6f64 653e 2357 4954 485f 5a4c d #WITH_ZL │ │ │ │ +00191440: 4942 3c2f 636f 6465 3e20 6d61 6372 6f73 IB macros │ │ │ │ +00191450: 206d 7573 7420 6265 2063 6f6e 7369 7374 must be consist │ │ │ │ +00191460: 656e 746c 7920 6465 6669 6e65 6420 746f ently defined to │ │ │ │ +00191470: 2063 6f6d 7069 6c65 2074 6865 2073 6f75 compile the sou │ │ │ │ +00191480: 7263 6573 2c20 7375 6368 2061 7320 3c65 rces, such as gsoap/st │ │ │ │ +001914a0: 6473 6f61 7032 2e63 7070 3c2f 636f 6465 dsoap2.cpp, soapC.cpp, soapClient.cp │ │ │ │ +001914f0: 703c 2f63 6f64 653e 3c2f 656d 3e2c 203c p, < │ │ │ │ +00191500: 656d 3e3c 636f 6465 3e73 6f61 7053 6572 em>soapSer │ │ │ │ +00191510: 7665 722e 6370 703c 2f63 6f64 653e 3c2f ver.cpp, and all app │ │ │ │ +00191530: 6c69 6361 7469 6f6e 2073 6f75 7263 6573 lication sources │ │ │ │ +00191540: 2074 6861 7420 696e 636c 7564 6520 3c65 that include gsoap/st │ │ │ │ +00191560: 6473 6f61 7032 2e68 3c2f 636f 6465 3e3c dsoap2.h< │ │ │ │ +00191570: 2f65 6d3e 206f 7220 3c65 6d3e 3c63 6f64 /em> or soapH.h │ │ │ │ +00191590: 3c2f 656d 3e2e 2049 6620 7468 6520 6d61 . If the ma │ │ │ │ +001915a0: 6372 6f73 2061 7265 206e 6f74 2063 6f6e cros are not con │ │ │ │ +001915b0: 7369 7374 656e 746c 7920 7573 6564 2c20 sistently used, │ │ │ │ +001915c0: 7468 6520 6170 706c 6963 6174 696f 6e20 the application │ │ │ │ +001915d0: 7769 6c6c 2063 7261 7368 2064 7565 2074 will crash due t │ │ │ │ +001915e0: 6f20 6120 6d69 736d 6174 6368 6573 2069 o a mismatches i │ │ │ │ +001915f0: 6e20 7468 6520 6465 636c 6172 6174 696f n the declaratio │ │ │ │ +00191600: 6e20 616e 6420 6163 6365 7373 206f 6620 n and access of │ │ │ │ +00191610: 7468 6520 3c63 6f64 653e 3c61 2063 6c61 the soap context.
    .

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

    .< │ │ │ │ +001916c0: 6832 3e3c 6120 636c 6173 733d 2261 6e63 h2>.Clie │ │ │ │ +001916f0: 6e74 2d73 6964 6520 636f 6f6b 6965 2073 nt-side cookie s │ │ │ │ +00191700: 7570 706f 7274 3c2f 6832 3e0a 3c70 3e43 upport

    .

    C │ │ │ │ +00191710: 6c69 656e 742d 7369 6465 2063 6f6f 6b69 lient-side cooki │ │ │ │ +00191720: 6520 7375 7070 6f72 7420 6973 206f 7074 e support is opt │ │ │ │ +00191730: 696f 6e61 6c2e 2054 6f20 656e 6162 6c65 ional. To enable │ │ │ │ +00191740: 2063 6f6f 6b69 6520 7375 7070 6f72 742c cookie support, │ │ │ │ +00191750: 2063 6f6d 7069 6c65 2061 6c6c 2073 6f75 compile all sou │ │ │ │ +00191760: 7263 6573 2077 6974 6820 7468 6520 636f rces with the co │ │ │ │ +00191770: 6d70 696c 652d 7469 6d65 2066 6c61 6720 mpile-time flag │ │ │ │ +00191780: 3c63 6f64 653e 2357 4954 485f 434f 4f4b #WITH_COOK │ │ │ │ +00191790: 4945 533c 2f63 6f64 653e 2c20 666f 7220 IES, for │ │ │ │ +001917a0: 6578 616d 706c 653a 203c 2f70 3e3c 7072 example:

    c++ -DWITH_C │ │ │ │ +001917d0: 4f4f 4b49 4553 202d 6f20 6d79 636c 6965 OOKIES -o myclie │ │ │ │ +001917e0: 6e74 2073 7464 736f 6170 322e 6370 7020 nt stdsoap2.cpp │ │ │ │ +001917f0: 736f 6170 432e 6370 7020 736f 6170 436c soapC.cpp soapCl │ │ │ │ +00191800: 6965 6e74 2e63 7070 0a3c 2f70 7265 3e3c ient.cpp.< │ │ │ │ +00191810: 703e 206f 7220 6164 6420 7468 6520 666f p> or add the fo │ │ │ │ +00191820: 6c6c 6f77 696e 6720 6c69 6e65 2074 6f20 llowing line to │ │ │ │ +00191830: 3c65 6d3e 3c63 6f64 653e 7374 6473 6f61 stdsoa │ │ │ │ +00191840: 702e 683c 2f63 6f64 653e 3c2f 656d 3e3a p.h: │ │ │ │ +00191850: 3c2f 703e 0a3c 6469 7620 636c 6173 733d

    .
    #define │ │ │ │ +001918a0: 5749 5448 5f43 4f4f 4b49 4553 3c2f 7370 WITH_COOKIES
    .
    │ │ │ │ +001918c0: 3c21 2d2d 2066 7261 676d 656e 7420 2d2d

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

    .

    .Connecting │ │ │ │ +00197850: 2063 6c69 656e 7473 2074 6872 6f75 6768 clients through │ │ │ │ +00197860: 2070 726f 7879 2073 6572 7665 7273 3c2f proxy servers.

    When a cl │ │ │ │ +00197880: 6965 6e74 206e 6565 6473 2074 6f20 636f ient needs to co │ │ │ │ +00197890: 6e6e 6563 7420 746f 2061 2057 6562 2053 nnect to a Web S │ │ │ │ +001978a0: 6572 7669 6365 2074 6872 6f75 6768 2061 ervice through a │ │ │ │ +001978b0: 2070 726f 7879 2073 6572 7665 722c 2073 proxy server, s │ │ │ │ +001978c0: 6574 2074 6865 203c 636f 6465 3e3c 6120 et the soap::pr │ │ │ │ +00197980: 6f78 795f 686f 7374 3c2f 613e 3c2f 636f oxy_host string and < │ │ │ │ +001979a0: 636f 6465 3e3c 6120 636c 6173 733d 2265 code>soa │ │ │ │ +00197a60: 703a 3a70 726f 7879 5f70 6f72 743c 2f61 p::proxy_port integer │ │ │ │ +00197a80: 2061 7474 7269 6275 7465 7320 6f66 2074 attributes of t │ │ │ │ +00197a90: 6865 2063 7572 7265 6e74 203c 636f 6465 he current soa │ │ │ │ +00197af0: 703c 2f61 3e3c 2f63 6f64 653e 2063 6f6e p con │ │ │ │ +00197b00: 7465 7874 2074 6f20 7468 6520 7072 6f78 text to the prox │ │ │ │ +00197b10: 7927 7320 686f 7374 206e 616d 6520 616e y's host name an │ │ │ │ +00197b20: 6420 706f 7274 2c20 7265 7370 6563 7469 d port, respecti │ │ │ │ +00197b30: 7665 6c79 2e20 466f 7220 6578 616d 706c vely. For exampl │ │ │ │ +00197b40: 653a 3c2f 703e 0a3c 6469 7620 636c 6173 e:

    .
    < │ │ │ │ +00197b70: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +00197b80: 6f72 6422 3e73 7472 7563 7420 3c2f 7370 ord">struct soap soap;
    .
    soap_init( │ │ │ │ +00197c70: 2661 6d70 3b3c 6120 636c 6173 733d 2263 &soap │ │ │ │ +00197ca0: 3c2f 613e 293b 203c 2f64 6976 3e0a 3c64 );
    . │ │ │ │ +00197cc0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap. │ │ │ │ +00197cf0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 proxy_h │ │ │ │ +00197d40: 6f73 743c 2f61 3e20 3d20 3c73 7061 6e20 ost = "prox │ │ │ │ +00197d70: 7968 6f73 746e 616d 6526 7175 6f74 3b3c yhostname"< │ │ │ │ +00197d80: 2f73 7061 6e3e 3b20 3c2f 6469 763e 0a3c /span>;

    .< │ │ │ │ +00197d90: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00197da0: 3e3c 6120 636c 6173 733d 2263 6f64 6522 >soap │ │ │ │ +00197dd0: 2e3c 6120 636c 6173 733d 2263 6f64 6522 .proxy_ │ │ │ │ +00197e20: 706f 7274 3c2f 613e 203d 2038 3038 303b port = 8080; │ │ │ │ +00197e30: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    if (s │ │ │ │ +00197e70: 6f61 705f 6361 6c6c 5f6e 735f 5f77 6562 oap_call_ns__web │ │ │ │ +00197e80: 6d65 7468 6f64 2826 616d 703b 3c61 2063 method(&soap, "h │ │ │ │ +00197ee0: 7474 703a 2f2f 686f 7374 3a70 6f72 742f ttp://host:port/ │ │ │ │ +00197ef0: 7061 7468 2671 756f 743b 3c2f 7370 616e path", & │ │ │ │ +00197f20: 7175 6f74 3b61 6374 696f 6e26 7175 6f74 quot;action" │ │ │ │ +00197f30: 3b3c 2f73 7061 6e3e 2c20 2e2e 2e29 2920 ;, ...)) │ │ │ │ +00197f40: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    ..
    else │ │ │ │ +00198040: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    ... │ │ │ │ +00198060: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // success │ │ │ │ +00198080: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c2f
    .

    The cont │ │ │ │ +001980b0: 6578 7420 6174 7472 6962 7574 6573 203c ext attributes < │ │ │ │ +001980c0: 636f 6465 3e3c 6120 636c 6173 733d 2265 code> │ │ │ │ +00198170: 736f 6170 3a3a 7072 6f78 795f 686f 7374 soap::proxy_host │ │ │ │ +00198180: 3c2f 613e 3c2f 636f 6465 3e20 616e 6420 and │ │ │ │ +00198190: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 so │ │ │ │ +00198250: 6170 3a3a 7072 6f78 795f 706f 7274 3c2f ap::proxy_port keep t │ │ │ │ +00198270: 6865 6972 2076 616c 7565 7320 7468 726f heir values thro │ │ │ │ +00198280: 7567 6820 6120 7365 7175 656e 6365 206f ugh a sequence o │ │ │ │ +00198290: 6620 7365 7276 6963 6520 6f70 6572 6174 f service operat │ │ │ │ +001982a0: 696f 6e20 6361 6c6c 732c 2073 6f20 7468 ion calls, so th │ │ │ │ +001982b0: 6579 206f 6e6c 7920 6e65 6564 2074 6f20 ey only need to │ │ │ │ +001982c0: 6265 2073 6574 206f 6e63 652e 3c2f 703e be set once.

    │ │ │ │ +001982d0: 0a3c 703e 5768 656e 2058 2d46 6f72 7761 .

    When X-Forwa │ │ │ │ +001982e0: 7264 6564 2d46 6f72 2068 6561 6465 7273 rded-For headers │ │ │ │ +001982f0: 2061 7265 2072 6574 7572 6e65 6420 6279 are returned by │ │ │ │ +00198300: 2074 6865 2070 726f 7879 2c20 7468 6520 the proxy, the │ │ │ │ +00198310: 6865 6164 6572 2063 616e 2062 6520 6163 header can be ac │ │ │ │ +00198320: 6365 7373 6564 2069 6e20 7468 6520 3c63 cessed in the soap: │ │ │ │ +001983c0: 3a70 726f 7879 5f66 726f 6d3c 2f61 3e3c :proxy_from< │ │ │ │ +001983d0: 2f63 6f64 653e 2073 7472 696e 672e 3c2f /code> string..

    See also S │ │ │ │ +001983f0: 6563 7469 6f6e 7320 3c61 2063 6c61 7373 ections HTTP │ │ │ │ +00198430: 2070 726f 7879 2062 6173 6963 2061 7574 proxy basic aut │ │ │ │ +00198440: 6865 6e74 6963 6174 696f 6e3c 2f61 3e20 hentication │ │ │ │ +00198450: 616e 6420 3c61 2063 6c61 7373 3d22 656c and HTTP │ │ │ │ +00198490: 2070 726f 7879 204e 544c 4d20 6175 7468 proxy NTLM auth │ │ │ │ +001984a0: 656e 7469 6361 7469 6f6e 3c2f 613e 2e3c entication.< │ │ │ │ +001984b0: 2f70 3e0a 3c70 3ef0 9f94 9d20 3c61 2068 /p>.

    .... Back to │ │ │ │ +001984d0: 7461 626c 6520 6f66 2063 6f6e 7465 6e74 table of content │ │ │ │ +001984e0: 733c 2f61 3e3c 2f70 3e0a 3c68 323e 3c61 s

    .

    .Bind │ │ │ │ +00198520: 2062 6566 6f72 6520 636f 6e6e 6563 7420 before connect │ │ │ │ +00198530: 616e 6420 7365 7474 696e 6720 7468 6520 and setting the │ │ │ │ +00198540: 636c 6965 6e74 2069 6e74 6572 6661 6365 client interface │ │ │ │ +00198550: 2061 6464 7265 7373 3c2f 6832 3e0a 3c70 address

    .

    To bind the cli │ │ │ │ +00198570: 656e 7420 746f 2061 2070 6f72 7420 6265 ent to a port be │ │ │ │ +00198580: 666f 7265 2063 6f6e 6e65 6374 2c20 7365 fore connect, se │ │ │ │ +00198590: 7420 7468 6520 3c63 6f64 653e 3c61 2063 t the soap::client_ │ │ │ │ +00198650: 706f 7274 3c2f 613e 3c2f 636f 6465 3e20 port │ │ │ │ +00198660: 746f 2061 206e 6f6e 2d6e 6567 6174 6976 to a non-negativ │ │ │ │ +00198670: 6520 706f 7274 206e 756d 6265 723a 3c2f e port number:.

    struct < │ │ │ │ +001986d0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +001986e0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ +001986f0: 6874 6d6c 223e 736f 6170 3c2f 613e 202a html">soap * │ │ │ │ +00198700: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap │ │ │ │ +00198730: 3d20 3c61 2063 6c61 7373 3d22 636f 6465 = soap_new< │ │ │ │ +00198790: 2f61 3e28 293b 203c 2f64 6976 3e0a 3c64 /a>();
    . │ │ │ │ +001987b0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap- │ │ │ │ +001987e0: 2667 743b 3c61 2063 6c61 7373 3d22 636f >cli │ │ │ │ +00198830: 656e 745f 706f 7274 3c2f 613e 203d 202e ent_port = . │ │ │ │ +00198840: 2e2e 3b20 3c73 7061 6e20 636c 6173 733d ..; // non │ │ │ │ +00198860: 2d6e 6567 6174 6976 6520 706f 7274 206e -negative port n │ │ │ │ +00198870: 756d 6265 7220 3c2f 7370 616e 3e3c 2f64 umber .. │ │ │ │ +001989a0: 2020 2e2e 2e20 3c73 7061 6e20 636c 6173 ... // e │ │ │ │ +001989c0: 7272 6f72 3c2f 7370 616e 3e3c 2f64 6976 rror
    .
    el │ │ │ │ +00198a00: 7365 3c2f 7370 616e 3e20 3c2f 6469 763e se
    │ │ │ │ +00198a10: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    ... / │ │ │ │ +00198a40: 2f20 7375 6363 6573 733c 2f73 7061 6e3e / success │ │ │ │ +00198a50: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    │ │ │ │ +00198aa0: 3c64 6976 2063 6c61 7373 3d22 7474 6e61
    i │ │ │ │ +00198b20: 6e74 2063 6c69 656e 745f 706f 7274 3c2f nt client_port
    User-defi │ │ │ │ +00198b50: 6e61 626c 6520 636c 6965 6e74 2070 6f72 nable client por │ │ │ │ +00198b60: 7420 746f 2062 696e 6420 746f 2062 6566 t to bind to bef │ │ │ │ +00198b70: 6f72 6520 636f 6e6e 6563 7469 6e67 2074 ore connecting t │ │ │ │ +00198b80: 6f20 6120 7365 7276 6572 2c20 7768 656e o a server, when │ │ │ │ +00198b90: 206e 6f6e 2d6e 6567 6174 6976 652e 3c2f non-negative.
    Defini │ │ │ │ +00198bc0: 7469 6f6e 3a3c 2f62 3e20 7374 6473 6f61 tion: stdsoa │ │ │ │ +00198bd0: 7032 2e68 3a33 3639 303c 2f64 6976 3e3c p2.h:3690
    < │ │ │ │ +00198be0: 2f64 6976 3e0a 3c2f 6469 763e 3c21 2d2d /div>.

    │ │ │ │ +00198c00: 5468 6973 2070 6f72 7420 6e75 6d62 6572 This port number │ │ │ │ +00198c10: 2069 7320 7573 6564 206f 6e6c 7920 6f6e is used only on │ │ │ │ +00198c20: 6365 2061 6e64 2072 6573 6574 2074 6f20 ce and reset to │ │ │ │ +00198c30: 2d31 2028 6469 7361 626c 6564 292e 2053 -1 (disabled). S │ │ │ │ +00198c40: 6574 2069 7420 6167 6169 6e20 666f 7220 et it again for │ │ │ │ +00198c50: 7468 6520 6e65 7874 2063 616c 6c2e 3c2f the next call..

    To set a c │ │ │ │ +00198c70: 6c69 656e 7420 696e 7465 7266 6163 6520 lient interface │ │ │ │ +00198c80: 6164 6472 6573 7320 666f 7220 7468 6520 address for the │ │ │ │ +00198c90: 636f 6e6e 6563 7469 6f6e 2074 6861 7420 connection that │ │ │ │ +00198ca0: 6973 2061 6e20 4950 2061 6464 7265 7373 is an IP address │ │ │ │ +00198cb0: 206f 6620 7468 6520 636c 6965 6e74 3a3c of the client:< │ │ │ │ +00198cc0: 2f70 3e0a 3c64 6976 2063 6c61 7373 3d22 /p>.

    struct │ │ │ │ +00198d10: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap │ │ │ │ +00198d40: 2a3c 6120 636c 6173 733d 2263 6f64 6522 *soap │ │ │ │ +00198d70: 203d 203c 6120 636c 6173 733d 2263 6f64 = soap_new │ │ │ │ +00198dd0: 3c2f 613e 2829 3b20 3c2f 6469 763e 0a3c ();
    .< │ │ │ │ +00198de0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +00198df0: 3e3c 6120 636c 6173 733d 2263 6f64 6522 >soap │ │ │ │ +00198e20: 2d26 6774 3b3c 6120 636c 6173 733d 2263 ->cl │ │ │ │ +00198e70: 6965 6e74 5f69 6e74 6572 6661 6365 3c2f ient_interface = "..." │ │ │ │ +00198eb0: 3c2f 7370 616e 3e3b 203c 7370 616e 2063 ; / │ │ │ │ +00198ed0: 2f20 4950 2061 6464 7265 7373 203c 2f73 / IP address
    .
    if │ │ │ │ +00198f20: 2028 736f 6170 5f63 616c 6c5f 6e73 5f5f (soap_call_ns__ │ │ │ │ +00198f30: 7765 626d 6574 686f 6428 3c61 2063 6c61 webmethod(soap, "htt │ │ │ │ +00198f90: 703a 2f2f 686f 7374 3a70 6f72 742f 7061 p://host:port/pa │ │ │ │ +00198fa0: 7468 2671 756f 743b 3c2f 7370 616e 3e2c th", │ │ │ │ +00198fb0: 203c 7370 616e 2063 6c61 7373 3d22 7374 &qu │ │ │ │ +00198fd0: 6f74 3b61 6374 696f 6e26 7175 6f74 3b3c ot;action"< │ │ │ │ +00198fe0: 2f73 7061 6e3e 2c20 2e2e 2e29 2920 3c2f /span>, ...)) .
    ... // error
    .
    else │ │ │ │ +00199070: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    ... │ │ │ │ +00199090: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // success │ │ │ │ +001990b0: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    .
    const │ │ │ │ +00199190: 2063 6861 7220 2a20 636c 6965 6e74 5f69 char * client_i │ │ │ │ +001991a0: 6e74 6572 6661 6365 3c2f 6469 763e 3c64 nterface
    User-definable │ │ │ │ +001991d0: 636c 6965 6e74 2069 6e74 6572 6661 6365 client interface │ │ │ │ +001991e0: 2061 6464 7265 7373 2074 6f20 6f76 6572 address to over │ │ │ │ +001991f0: 7269 6465 2077 6865 6e20 636f 6e6e 6563 ride when connec │ │ │ │ +00199200: 7469 6e67 2074 6f20 6120 7365 7276 6572 ting to a server │ │ │ │ +00199210: 2c20 7768 656e 206e 6f6e 2d4e 554c 4c20 , when non-NULL │ │ │ │ +00199220: 2857 696e 646f 2e2e 2e3c 2f64 6976 3e3c (Windo...
    < │ │ │ │ +00199230: 6469 7620 636c 6173 733d 2274 7464 6566 div class="ttdef │ │ │ │ +00199240: 223e 3c62 3e44 6566 696e 6974 696f 6e3a ">Definition: │ │ │ │ +00199250: 3c2f 623e 2073 7464 736f 6170 322e 683a stdsoap2.h: │ │ │ │ +00199260: 3336 3939 3c2f 6469 763e 3c2f 6469 763e 3699
    │ │ │ │ +00199270: 0a3c 2f64 6976 3e3c 212d 2d20 6672 6167 .

    This │ │ │ │ +00199290: 636c 6965 6e74 2069 6e74 6572 6661 6365 client interface │ │ │ │ +001992a0: 2061 6464 7265 7373 2073 7472 696e 6720 address string │ │ │ │ +001992b0: 6973 2075 7365 6420 6f6e 6c79 206f 6e63 is used only onc │ │ │ │ +001992c0: 6520 616e 6420 7265 7365 7420 746f 204e e and reset to N │ │ │ │ +001992d0: 554c 4c20 2864 6973 6162 6c65 6429 2e20 ULL (disabled). │ │ │ │ +001992e0: 5365 7420 6974 2061 6761 696e 2066 6f72 Set it again for │ │ │ │ +001992f0: 2074 6865 206e 6578 7420 6361 6c6c 2e20 the next call. │ │ │ │ +00199300: 5468 6973 2066 6561 7475 7265 2069 7320 This feature is │ │ │ │ +00199310: 6e6f 7420 6176 6169 6c61 626c 6520 7768 not available wh │ │ │ │ +00199320: 656e 2063 6f6d 7069 6c69 6e67 2074 6865 en compiling the │ │ │ │ +00199330: 2063 6f64 6520 6f6e 2077 696e 646f 7773 code on windows │ │ │ │ +00199340: 2e3c 2f70 3e0a 3c70 3ef0 9f94 9d20 3c61 .

    .

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

    .

    │ │ │ │ +00199380: 3c61 2063 6c61 7373 3d22 616e 6368 6f72 < │ │ │ │ +001993a0: 2f61 3e0a 4661 7374 4347 493c 2f68 323e /a>.FastCGI

    │ │ │ │ +001993b0: 0a3c 703e 546f 2065 6e61 626c 6520 4661 .

    To enable Fa │ │ │ │ +001993c0: 7374 4347 4920 7375 7070 6f72 742c 2069 stCGI support, i │ │ │ │ +001993d0: 6e73 7461 6c6c 2046 6173 7443 4749 2061 nstall FastCGI a │ │ │ │ +001993e0: 6e64 2063 6f6d 7069 6c65 2061 6c6c 2073 nd compile all s │ │ │ │ +001993f0: 6f61 7063 7070 322d 6765 6e65 7261 7465 oapcpp2-generate │ │ │ │ +00199400: 6420 736f 7572 6365 2063 6f64 6520 6669 d source code fi │ │ │ │ +00199410: 6c65 7320 616e 6420 796f 7572 2061 7070 les and your app │ │ │ │ +00199420: 6c69 6361 7469 6f6e 2073 6f75 7263 6573 lication sources │ │ │ │ +00199430: 2077 6974 6820 7468 6520 636f 6d70 696c with the compil │ │ │ │ +00199440: 652d 7469 6d65 2066 6c61 6720 3c63 6f64 e-time flag #WITH_FASTCGI< │ │ │ │ +00199460: 2f63 6f64 653e 206f 7220 6164 643a 3c2f /code> or add:.

    #define WI │ │ │ │ +001994c0: 5448 5f46 4153 5443 4749 3c2f 7370 616e TH_FASTCGI
    .
    < │ │ │ │ +001994f0: 703e 746f 203c 656d 3e3c 636f 6465 3e67 p>to g │ │ │ │ +00199500: 736f 6170 2f73 7464 736f 6170 322e 683c soap/stdsoap2.h< │ │ │ │ +00199510: 2f63 6f64 653e 3c2f 656d 3e20 616e 6420 /code> and │ │ │ │ +00199520: 7265 636f 6d70 696c 6520 7468 6520 7072 recompile the pr │ │ │ │ +00199530: 6f6a 6563 7420 636f 6465 2e3c 2f70 3e0a oject code.

    . │ │ │ │ +00199540: 3c64 6c20 636c 6173 733d 2273 6563 7469
    │ │ │ │ +00199560: 5761 726e 696e 673c 2f64 743e 3c64 643e Warning
    │ │ │ │ +00199570: 446f 206e 6f74 206c 696e 6b20 6167 6169 Do not link agai │ │ │ │ +00199580: 6e73 7420 7468 6520 3c65 6d3e 3c63 6f64 nst the gsoap/libgsoap │ │ │ │ +001995a0: 2a3c 2f63 6f64 653e 3c2f 656d 3e20 6c69 * li │ │ │ │ +001995b0: 6272 6172 6965 7320 6173 2074 6865 7365 braries as these │ │ │ │ +001995c0: 2061 7265 206e 6f74 2073 7569 7461 626c are not suitabl │ │ │ │ +001995d0: 6520 666f 7220 4661 7374 4347 492e 2043 e for FastCGI. C │ │ │ │ +001995e0: 6f6d 7069 6c65 203c 656d 3e3c 636f 6465 ompile gsoap/stdsoap2. │ │ │ │ +00199600: 633c 2f63 6f64 653e 3c2f 656d 3e20 286f c (o │ │ │ │ +00199610: 7220 3c65 6d3e 3c63 6f64 653e 6773 6f61 r gsoa │ │ │ │ +00199620: 702f 7374 6473 6f61 7032 2e63 7070 3c2f p/stdsoap2.cpp) inst │ │ │ │ +00199640: 6561 642e 3c2f 6464 3e3c 2f64 6c3e 0a3c ead.
    .< │ │ │ │ +00199650: 703e f09f 949d 203c 6120 6872 6566 3d22 p>....
    Back to table │ │ │ │ +00199670: 206f 6620 636f 6e74 656e 7473 3c2f 613e of contents │ │ │ │ +00199680: 3c2f 703e 0a3c 6832 3e3c 6120 636c 6173

    .

    .How to │ │ │ │ +001996b0: 206d 696e 696d 697a 6520 6170 706c 6963 minimize applic │ │ │ │ +001996c0: 6174 696f 6e20 6d65 6d6f 7279 2066 6f6f ation memory foo │ │ │ │ +001996d0: 7470 7269 6e74 3c2f 6832 3e0a 3c70 3e54 tprint

    .

    T │ │ │ │ +001996e0: 6f20 636f 6d70 696c 6520 6753 4f41 5020 o compile gSOAP │ │ │ │ +001996f0: 6170 706c 6963 6174 696f 6e73 2069 6e74 applications int │ │ │ │ +00199700: 656e 6465 6420 666f 7220 736d 616c 6c20 ended for small │ │ │ │ +00199710: 6d65 6d6f 7279 2064 6576 6963 6573 2c20 memory devices, │ │ │ │ +00199720: 796f 7520 6d61 7920 7761 6e74 2074 6f20 you may want to │ │ │ │ +00199730: 7265 6d6f 7665 2061 6c6c 206e 6f6e 2d65 remove all non-e │ │ │ │ +00199740: 7373 656e 7469 616c 2066 6561 7475 7265 ssential feature │ │ │ │ +00199750: 7320 7468 6174 2063 6f6e 7375 6d65 2070 s that consume p │ │ │ │ +00199760: 7265 6369 6f75 7320 636f 6465 2061 6e64 recious code and │ │ │ │ +00199770: 2064 6174 6120 7370 6163 652e 2054 6f20 data space. To │ │ │ │ +00199780: 646f 2074 6869 732c 2063 6f6d 7069 6c65 do this, compile │ │ │ │ +00199790: 2074 6865 2073 6f75 7263 6520 636f 6465 the source code │ │ │ │ +001997a0: 2066 696c 6573 2077 6974 6820 7468 6520 files with the │ │ │ │ +001997b0: 636f 6d70 696c 652d 7469 6d65 2066 6c61 compile-time fla │ │ │ │ +001997c0: 6720 3c63 6f64 653e 2357 4954 485f 4c45 g #WITH_LE │ │ │ │ +001997d0: 414e 3c2f 636f 6465 3e20 2869 2e65 2e20 AN (i.e. │ │ │ │ +001997e0: 3c63 6f64 653e 2364 6566 696e 6520 5749 #define WI │ │ │ │ +001997f0: 5448 5f4c 4541 4e3c 2f63 6f64 653e 2920 TH_LEAN) │ │ │ │ +00199800: 746f 2072 656d 6f76 6520 6d61 6e79 206e to remove many n │ │ │ │ +00199810: 6f6e 2d65 7373 656e 7469 616c 2066 6561 on-essential fea │ │ │ │ +00199820: 7475 7265 732e 2054 6865 2066 6561 7475 tures. The featu │ │ │ │ +00199830: 7265 7320 7468 6174 2077 696c 6c20 6265 res that will be │ │ │ │ +00199840: 2064 6973 6162 6c65 6420 6172 653a 3c2f disabled are:.

    .

    Use th │ │ │ │ +0019a190: 6520 636f 6d70 696c 652d 7469 6d65 2066 e compile-time f │ │ │ │ +0019a1a0: 6c61 6720 3c63 6f64 653e 2357 4954 485f lag #WITH_ │ │ │ │ +0019a1b0: 4c45 414e 4552 3c2f 636f 6465 3e20 746f LEANER to │ │ │ │ +0019a1c0: 206d 616b 6520 7468 6520 6578 6563 7574 make the execut │ │ │ │ +0019a1d0: 6162 6c65 2065 7665 6e20 736d 616c 6c65 able even smalle │ │ │ │ +0019a1e0: 7220 6279 2072 656d 6f76 696e 6720 4449 r by removing DI │ │ │ │ +0019a1f0: 4d45 2061 6e64 204d 494d 4520 6174 7461 ME and MIME atta │ │ │ │ +0019a200: 6368 6d65 6e74 2068 616e 646c 696e 672c chment handling, │ │ │ │ +0019a210: 203c 636f 6465 3e23 4c4f 4e47 3634 3c2f #LONG64 (64 bit) s │ │ │ │ +0019a230: 6572 6961 6c69 7a61 7469 6f6e 2c20 3c63 erialization, wchar_t* serializatio │ │ │ │ +0019a260: 6e2c 2061 6e64 2073 7570 706f 7274 2066 n, and support f │ │ │ │ +0019a270: 6f72 2058 4d4c 2044 4f4d 206f 7065 7261 or XML DOM opera │ │ │ │ +0019a280: 7469 6f6e 732e 204e 6f74 6520 7468 6174 tions. Note that │ │ │ │ +0019a290: 2044 494d 452f 4d49 4d45 2061 7474 6163 DIME/MIME attac │ │ │ │ +0019a2a0: 686d 656e 7473 2061 7265 206e 6f74 2065 hments are not e │ │ │ │ +0019a2b0: 7373 656e 7469 616c 2074 6f20 6163 6869 ssential to achi │ │ │ │ +0019a2c0: 6576 6520 534f 4150 2f58 4d4c 2069 6e74 eve SOAP/XML int │ │ │ │ +0019a2d0: 6572 6f70 6572 6162 696c 6974 792e 2044 eroperability. D │ │ │ │ +0019a2e0: 494d 4520 6174 7461 6368 6d65 6e74 7320 IME attachments │ │ │ │ +0019a2f0: 6172 6520 6120 636f 6e76 656e 6965 6e74 are a convenient │ │ │ │ +0019a300: 2077 6179 2074 6f20 6578 6368 616e 6765 way to exchange │ │ │ │ +0019a310: 206e 6f6e 2d74 6578 742d 6261 7365 6420 non-text-based │ │ │ │ +0019a320: 2869 2e65 2e20 6269 6e61 7279 2920 636f (i.e. binary) co │ │ │ │ +0019a330: 6e74 656e 742c 2062 7574 2061 7265 206e ntent, but are n │ │ │ │ +0019a340: 6f74 2072 6571 7569 7265 6420 666f 7220 ot required for │ │ │ │ +0019a350: 6261 7369 6320 534f 4150 2f58 4d4c 2069 basic SOAP/XML i │ │ │ │ +0019a360: 6e74 6572 6f70 6572 6162 696c 6974 792e nteroperability. │ │ │ │ +0019a370: 2041 7474 6163 686d 656e 7420 7265 7175 Attachment requ │ │ │ │ +0019a380: 6972 656d 656e 7473 2061 7265 2070 7265 irements are pre │ │ │ │ +0019a390: 6469 6374 6162 6c65 2e20 5468 6174 2069 dictable. That i │ │ │ │ +0019a3a0: 732c 2061 7070 6c69 6361 7469 6f6e 7320 s, applications │ │ │ │ +0019a3b0: 776f 6e27 7420 7375 6464 656e 6c79 2064 won't suddenly d │ │ │ │ +0019a3c0: 6563 6964 6520 746f 2075 7365 2044 494d ecide to use DIM │ │ │ │ +0019a3d0: 4520 6f72 204d 494d 4520 696e 7374 6561 E or MIME instea │ │ │ │ +0019a3e0: 6420 6f66 2058 4d4c 2074 6f20 6578 6368 d of XML to exch │ │ │ │ +0019a3f0: 616e 6765 2063 6f6e 7465 6e74 2e3c 2f70 ange content.

    .

    It is safe │ │ │ │ +0019a410: 746f 2074 7279 2074 6f20 636f 6d70 696c to try to compil │ │ │ │ +0019a420: 6520 796f 7572 2061 7070 6c69 6361 7469 e your applicati │ │ │ │ +0019a430: 6f6e 2077 6974 6820 7468 6520 636f 6d70 on with the comp │ │ │ │ +0019a440: 696c 652d 7469 6d65 2066 6c61 6720 3c63 ile-time flag #WITH_LEAN, provided │ │ │ │ +0019a470: 7468 6174 2079 6f75 7220 6170 706c 6963 that your applic │ │ │ │ +0019a480: 6174 696f 6e20 646f 6573 206e 6f74 2072 ation does not r │ │ │ │ +0019a490: 656c 7920 6f6e 2049 2f4f 2074 696d 656f ely on I/O timeo │ │ │ │ +0019a4a0: 7574 732e 2057 6865 6e20 6e6f 206c 696e uts. When no lin │ │ │ │ +0019a4b0: 6b61 6765 2065 7272 6f72 206f 6363 7572 kage error occur │ │ │ │ +0019a4c0: 7320 696e 2074 6865 2063 6f6d 7069 6c61 s in the compila │ │ │ │ +0019a4d0: 7469 6f6e 2070 726f 6365 7373 2c20 6974 tion process, it │ │ │ │ +0019a4e0: 2069 7320 7361 6665 2074 6f20 6173 7375 is safe to assu │ │ │ │ +0019a4f0: 6d65 2074 6861 7420 796f 7572 2061 7070 me that your app │ │ │ │ +0019a500: 6c69 6361 7469 6f6e 2077 696c 6c20 7275 lication will ru │ │ │ │ +0019a510: 6e20 6a75 7374 2066 696e 652e 3c2f 703e n just fine.

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

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

    .

    .How │ │ │ │ +0019a580: 746f 2072 656d 6f76 6520 7468 6520 4253 to remove the BS │ │ │ │ +0019a590: 4420 736f 636b 6574 206c 6962 7261 7279 D socket library │ │ │ │ +0019a5a0: 2072 6571 7569 7265 6d65 6e74 3c2f 6832 requirement

    .

    The gsoap/stdsoap │ │ │ │ +0019a5d0: 322e 633c 2f63 6f64 653e 3c2f 656d 3e20 2.c │ │ │ │ +0019a5e0: 616e 6420 3c65 6d3e 3c63 6f64 653e 6773 and gs │ │ │ │ +0019a5f0: 6f61 702f 7374 6473 6f61 7032 2e63 7070 oap/stdsoap2.cpp │ │ │ │ +0019a600: 3c2f 636f 6465 3e3c 2f65 6d3e 206c 6962 lib │ │ │ │ +0019a610: 7261 7269 6573 2073 686f 756c 6420 6265 raries should be │ │ │ │ +0019a620: 206c 696e 6b65 6420 7769 7468 2061 2042 linked with a B │ │ │ │ +0019a630: 5344 2073 6f63 6b65 7420 6c69 6272 6172 SD socket librar │ │ │ │ +0019a640: 7920 696e 2074 6865 2070 726f 6a65 6374 y in the project │ │ │ │ +0019a650: 2062 7569 6c64 2e20 546f 2072 656d 6f76 build. To remov │ │ │ │ +0019a660: 6520 7468 6520 6e65 6564 2074 6f20 6c69 e the need to li │ │ │ │ +0019a670: 6e6b 2061 2073 6f63 6b65 7420 6c69 6272 nk a socket libr │ │ │ │ +0019a680: 6172 792c 2079 6f75 2063 616e 2063 6f6d ary, you can com │ │ │ │ +0019a690: 7069 6c65 203c 656d 3e3c 636f 6465 3e67 pile g │ │ │ │ +0019a6a0: 736f 6170 2f73 7464 736f 6170 322e 633c soap/stdsoap2.c< │ │ │ │ +0019a6b0: 2f63 6f64 653e 3c2f 656d 3e20 2866 6f72 /code> (for │ │ │ │ +0019a6c0: 2043 2920 616e 6420 3c65 6d3e 3c63 6f64 C) and gsoap/stdsoap2 │ │ │ │ +0019a6e0: 2e63 7070 3c2f 636f 6465 3e3c 2f65 6d3e .cpp │ │ │ │ +0019a6f0: 2028 666f 7220 432b 2b29 2077 6974 6820 (for C++) with │ │ │ │ +0019a700: 7468 6520 7468 6520 636f 6d70 696c 652d the the compile- │ │ │ │ +0019a710: 7469 6d65 2066 6c61 6720 3c63 6f64 653e time flag │ │ │ │ +0019a720: 2357 4954 485f 4e4f 494f 3c2f 636f 6465 #WITH_NOIO macro set (i.e │ │ │ │ +0019a740: 2e20 3c63 6f64 653e 2364 6566 696e 6520 . #define │ │ │ │ +0019a750: 5749 5448 5f4e 4f49 4f3c 2f63 6f64 653e WITH_NOIO │ │ │ │ +0019a760: 292e 2054 6869 7320 7265 6d6f 7665 7320 ). This removes │ │ │ │ +0019a770: 7468 6520 6465 7065 6e64 656e 6379 206f the dependency o │ │ │ │ +0019a780: 6e20 7468 6520 4253 4420 736f 636b 6574 n the BSD socket │ │ │ │ +0019a790: 2041 5049 2c20 494f 2073 7472 6561 6d73 API, IO streams │ │ │ │ +0019a7a0: 2c20 3c63 6f64 653e 4649 4c45 3c2f 636f , FILE type, and errno │ │ │ │ +0019a7d0: 2e3c 2f70 3e0a 3c70 3e59 6f75 2073 686f .

    .

    You sho │ │ │ │ +0019a7e0: 756c 6420 6465 6669 6e65 2063 616c 6c62 uld define callb │ │ │ │ +0019a7f0: 6163 6b73 2074 6f20 7265 706c 6163 6520 acks to replace │ │ │ │ +0019a800: 7468 6520 6d69 7373 696e 6720 736f 636b the missing sock │ │ │ │ +0019a810: 6574 2073 7461 636b 2e20 546f 2064 6f20 et stack. To do │ │ │ │ +0019a820: 736f 2c20 6164 6420 746f 2079 6f75 7220 so, add to your │ │ │ │ +0019a830: 636f 6465 2074 6865 2066 6f6c 6c6f 7769 code the followi │ │ │ │ +0019a840: 6e67 2064 6566 696e 6974 696f 6e73 3a3c ng definitions:< │ │ │ │ +0019a850: 2f70 3e0a 3c64 6976 2063 6c61 7373 3d22 /p>.

    struct │ │ │ │ +0019a8a0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap │ │ │ │ +0019a8d0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap; │ │ │ │ +0019a900: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    s │ │ │ │ +0019a970: 6f61 705f 696e 6974 3c2f 613e 2826 616d oap_init(&am │ │ │ │ +0019a980: 703b 3c61 2063 6c61 7373 3d22 636f 6465 p;soap);
    .
    /* fsend is u │ │ │ │ +0019a9f0: 7365 6420 746f 2074 7261 6e73 6d69 7420 sed to transmit │ │ │ │ +0019aa00: 6461 7461 2069 6e20 626c 6f63 6b73 202a data in blocks * │ │ │ │ +0019aa10: 2f3c 2f73 7061 6e3e 203c 2f64 6976 3e0a /
    . │ │ │ │ +0019aa20: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    soap.fsend = my_send; .
    /* │ │ │ │ +0019ab00: 6672 6563 7620 6973 2075 7365 6420 746f frecv is used to │ │ │ │ +0019ab10: 2072 6563 6569 7665 2064 6174 6120 696e receive data in │ │ │ │ +0019ab20: 2062 6c6f 636b 7320 2a2f 3c2f 7370 616e blocks */
    .
    soap.frecv = my │ │ │ │ +0019abe0: 5f72 6563 763b 203c 2f64 6976 3e0a 3c64 _recv;
    . │ │ │ │ +0019ac00: 3c73 7061 6e20 636c 6173 733d 2263 6f6d /* fopen i │ │ │ │ +0019ac20: 7320 7573 6564 2074 6f20 636f 6e6e 6563 s used to connec │ │ │ │ +0019ac30: 7420 2a2f 3c2f 7370 616e 3e20 3c2f 6469 t */ ..< │ │ │ │ +0019ad00: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +0019ad10: 3e3c 7370 616e 2063 6c61 7373 3d22 636f >/* fclose │ │ │ │ +0019ad30: 2069 7320 7573 6564 2074 6f20 6469 7363 is used to disc │ │ │ │ +0019ad40: 6f6e 6e65 6374 202a 2f3c 2f73 7061 6e3e onnect */ │ │ │ │ +0019ad50: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    soap.fclose = my │ │ │ │ +0019ae00: 5f74 6370 5f64 6973 636f 6e6e 6563 743b _tcp_disconnect; │ │ │ │ +0019ae10: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    │ │ │ │ +0019ae40: 2f2a 2066 636c 6f73 6573 6f63 6b65 7420 /* fclosesocket │ │ │ │ +0019ae50: 6973 2075 7365 6420 6f6e 6c79 2074 6f20 is used only to │ │ │ │ +0019ae60: 636c 6f73 6520 7468 6520 6d61 7374 6572 close the master │ │ │ │ +0019ae70: 2073 6f63 6b65 7420 696e 2061 2073 6572 socket in a ser │ │ │ │ +0019ae80: 7665 7220 7570 6f6e 2073 6f61 705f 646f ver upon soap_do │ │ │ │ +0019ae90: 6e65 2829 202a 2f3c 2f73 7061 6e3e 203c ne() */ < │ │ │ │ +0019aea0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    s │ │ │ │ +0019aee0: 6f61 703c 2f61 3e2e 3c61 2063 6c61 7373 oap.f │ │ │ │ +0019af40: 636c 6f73 6573 6f63 6b65 743c 2f61 3e20 closesocket │ │ │ │ +0019af50: 3d20 6d79 5f74 6370 5f63 6c6f 7365 736f = my_tcp_closeso │ │ │ │ +0019af60: 636b 6574 3b20 3c2f 6469 763e 0a3c 6469 cket;
    .< │ │ │ │ +0019af80: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ +0019af90: 656e 7422 3e2f 2a20 6673 6875 7464 6f77 ent">/* fshutdow │ │ │ │ +0019afa0: 6e73 6f63 6b65 7420 6973 2075 7365 6420 nsocket is used │ │ │ │ +0019afb0: 6166 7465 7220 636f 6d70 6c65 7469 6e67 after completing │ │ │ │ +0019afc0: 2061 2073 656e 6420 6f70 6572 6174 696f a send operatio │ │ │ │ +0019afd0: 6e20 746f 2073 656e 6420 5443 5020 4649 n to send TCP FI │ │ │ │ +0019afe0: 4e20 2a2f 3c2f 7370 616e 3e20 3c2f 6469 N */ .
    soap │ │ │ │ +0019b030: 3c2f 613e 2e3c 6120 636c 6173 733d 2263 .fshu │ │ │ │ +0019b090: 7464 6f77 6e73 6f63 6b65 743c 2f61 3e20 tdownsocket │ │ │ │ +0019b0a0: 3d20 6d79 5f74 6370 5f73 6875 7464 6f77 = my_tcp_shutdow │ │ │ │ +0019b0b0: 6e73 6f63 6b65 743b 203c 2f64 6976 3e0a nsocket;
    . │ │ │ │ +0019b0c0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    /* setti │ │ │ │ +0019b0f0: 6e67 2066 706f 6c6c 2069 7320 6f70 7469 ng fpoll is opti │ │ │ │ +0019b100: 6f6e 616c 2c20 6c65 6176 6520 6974 204e onal, leave it N │ │ │ │ +0019b110: 554c 4c20 746f 206f 6d69 7420 706f 6c6c ULL to omit poll │ │ │ │ +0019b120: 696e 6720 7468 6520 7365 7276 6572 202a ing the server * │ │ │ │ +0019b130: 2f3c 2f73 7061 6e3e 203c 2f64 6976 3e0a /
    . │ │ │ │ +0019b140: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    soap.fpoll = my_poll; .
    /* │ │ │ │ +0019b220: 6661 6363 6570 7420 6973 2075 7365 6420 faccept is used │ │ │ │ +0019b230: 6f6e 6c79 2062 7920 6120 7365 7276 6572 only by a server │ │ │ │ +0019b240: 2061 7070 6c69 6361 7469 6f6e 202a 2f3c application */< │ │ │ │ +0019b250: 2f73 7061 6e3e 203c 2f64 6976 3e0a 3c64 /span>
    . │ │ │ │ +0019b270: 3c61 2063 6c61 7373 3d22 636f 6465 2220
    soap. │ │ │ │ +0019b2a0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 faccept = my_accept;< │ │ │ │ +0019b310: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>. │ │ │ │ +0019b3e0: 3c64 6976 2063 6c61 7373 3d22 7474 6465
    int(* fpoll) │ │ │ │ +0019b400: 2873 7472 7563 7420 736f 6170 202a 736f (struct soap *so │ │ │ │ +0019b410: 6170 293c 2f64 6976 3e3c 6469 7620 636c ap)
    Call │ │ │ │ +0019b430: 6261 636b 2074 6861 7420 626c 6f63 6b73 back that blocks │ │ │ │ +0019b440: 2075 6e74 696c 2061 6374 6976 6974 7920 until activity │ │ │ │ +0019b450: 6973 2064 6574 6563 7465 6420 6f6e 2074 is detected on t │ │ │ │ +0019b460: 6865 2073 6f61 703a 3a73 6f63 6b65 7420 he soap::socket │ │ │ │ +0019b470: 6f72 2073 6f61 703a 3a6d 6173 7465 7220 or soap::master │ │ │ │ +0019b480: 736f 636b 6574 2c2e 2e2e 3c2f 6469 763e socket,...
    │ │ │ │ +0019b490: 3c64 6976 2063 6c61 7373 3d22 7474 6465
    Definition │ │ │ │ +0019b4b0: 3a3c 2f62 3e20 7374 6473 6f61 7032 2e68 : stdsoap2.h │ │ │ │ +0019b4c0: 3a34 3539 343c 2f64 6976 3e3c 2f64 6976 :4594
    .
    soap::fcl │ │ │ │ +0019b590: 6f73 6573 6f63 6b65 743c 2f61 3e3c 2f64 osesocket
    int(* fcl │ │ │ │ +0019b5c0: 6f73 6573 6f63 6b65 7429 2873 7472 7563 osesocket)(struc │ │ │ │ +0019b5d0: 7420 736f 6170 202a 736f 6170 2c20 534f t soap *soap, SO │ │ │ │ +0019b5e0: 4150 5f53 4f43 4b45 5420 736f 636b 293c AP_SOCKET sock)< │ │ │ │ +0019b5f0: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
    Callback │ │ │ │ +0019b610: 2074 6861 7420 636c 6f73 6573 2061 2067 that closes a g │ │ │ │ +0019b620: 6976 656e 2073 6f63 6b65 742e 3c2f 6469 iven socket.
    Definiti │ │ │ │ +0019b650: 6f6e 3a3c 2f62 3e20 7374 6473 6f61 7032 on: stdsoap2 │ │ │ │ +0019b660: 2e68 3a34 3537 303c 2f64 6976 3e3c 2f64 .h:4570
    .
    < │ │ │ │ +0019b6e0: 6120 6872 6566 3d22 6772 6f75 705f 5f67 a href="group__g │ │ │ │ +0019b6f0: 726f 7570 5f5f 6361 6c6c 6261 636b 732e roup__callbacks. │ │ │ │ +0019b700: 6874 6d6c 2367 6135 3165 3039 6464 6637 html#ga51e09ddf7 │ │ │ │ +0019b710: 3639 6132 6464 6364 3837 3466 6236 6536 69a2ddcd874fb6e6 │ │ │ │ +0019b720: 6662 3532 3839 6422 3e73 6f61 703a 3a66 fb5289d">soap::f │ │ │ │ +0019b730: 7368 7574 646f 776e 736f 636b 6574 3c2f shutdownsocket
    int( │ │ │ │ +0019b760: 2a20 6673 6875 7464 6f77 6e73 6f63 6b65 * fshutdownsocke │ │ │ │ +0019b770: 7429 2873 7472 7563 7420 736f 6170 202a t)(struct soap * │ │ │ │ +0019b780: 736f 6170 2c20 534f 4150 5f53 4f43 4b45 soap, SOAP_SOCKE │ │ │ │ +0019b790: 5420 736f 636b 2c20 696e 7420 686f 7729 T sock, int how) │ │ │ │ +0019b7a0: 3c2f 6469 763e 3c64 6976 2063 6c61 7373
    Callbac │ │ │ │ +0019b7c0: 6b20 7468 6174 2073 6875 7473 2064 6f77 k that shuts dow │ │ │ │ +0019b7d0: 6e20 6120 6769 7665 6e20 736f 636b 6574 n a given socket │ │ │ │ +0019b7e0: 2e3c 2f64 6976 3e3c 6469 7620 636c 6173 .
    Def │ │ │ │ +0019b800: 696e 6974 696f 6e3a 3c2f 623e 2073 7464 inition: std │ │ │ │ +0019b810: 736f 6170 322e 683a 3435 3833 3c2f 6469 soap2.h:4583
    .
    │ │ │ │ +0019b880: 3c64 6976 2063 6c61 7373 3d22 7474 6e61
    so │ │ │ │ +0019b8e0: 6170 3a3a 6661 6363 6570 743c 2f61 3e3c ap::faccept< │ │ │ │ +0019b8f0: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
    SOAP_SO │ │ │ │ +0019b910: 434b 4554 282a 2066 6163 6365 7074 2928 CKET(* faccept)( │ │ │ │ +0019b920: 7374 7275 6374 2073 6f61 7020 2a73 6f61 struct soap *soa │ │ │ │ +0019b930: 702c 2053 4f41 505f 534f 434b 4554 2073 p, SOAP_SOCKET s │ │ │ │ +0019b940: 6f63 6b2c 2073 7472 7563 7420 736f 636b ock, struct sock │ │ │ │ +0019b950: 6164 6472 202a 6164 6472 2c20 696e 7420 addr *addr, int │ │ │ │ +0019b960: 2a6c 656e 293c 2f64 6976 3e3c 6469 7620 *len)
    Ca │ │ │ │ +0019b980: 6c6c 6261 636b 2074 6861 7420 7761 6974 llback that wait │ │ │ │ +0019b990: 7320 666f 7220 616e 6420 6163 6365 7074 s for and accept │ │ │ │ +0019b9a0: 7320 6120 736f 636b 6574 2063 6f6e 6e65 s a socket conne │ │ │ │ +0019b9b0: 6374 696f 6e20 7265 7175 6573 7465 6420 ction requested │ │ │ │ +0019b9c0: 6279 2061 2063 6c69 656e 742e 3c2f 6469 by a client.
    Definiti │ │ │ │ +0019b9f0: 6f6e 3a3c 2f62 3e20 7374 6473 6f61 7032 on: stdsoap2 │ │ │ │ +0019ba00: 2e68 3a34 3530 393c 2f64 6976 3e3c 2f64 .h:4509
    .

    Th │ │ │ │ +0019ba30: 6573 6520 6675 6e63 7469 6f6e 7320 7368 ese functions sh │ │ │ │ +0019ba40: 6f75 6c64 2070 726f 7669 6465 2061 206d ould provide a m │ │ │ │ +0019ba50: 696e 696d 616c 2069 6e70 7574 2f6f 7574 inimal input/out │ │ │ │ +0019ba60: 7075 7420 7374 6163 6b20 283c 636f 6465 put stack (soap:: │ │ │ │ +0019bb10: 6672 6563 763c 2f61 3e3c 2f63 6f64 653e frecv │ │ │ │ +0019bb20: 2061 6e64 203c 636f 6465 3e3c 6120 636c and soap::fsend │ │ │ │ +0019bbc0: 3c2f 613e 3c2f 636f 6465 3e29 2074 6f20 ) to │ │ │ │ +0019bbd0: 7265 6164 2f77 7269 7465 2058 4d4c 2061 read/write XML a │ │ │ │ +0019bbe0: 6e64 2073 6f63 6b65 742d 6c69 6b65 2073 nd socket-like s │ │ │ │ +0019bbf0: 7461 636b 2028 7468 6520 6f74 6865 7220 tack (the other │ │ │ │ +0019bc00: 6675 6e63 7469 6f6e 7329 2077 6865 6e20 functions) when │ │ │ │ +0019bc10: 6465 7665 6c6f 7069 6e67 2063 6c69 656e developing clien │ │ │ │ +0019bc20: 7420 616e 6420 7365 7276 6572 2061 7070 t and server app │ │ │ │ +0019bc30: 6c69 6361 7469 6f6e 732e 3c2f 703e 0a3c lications.

    .< │ │ │ │ +0019bc40: 703e 5365 6520 5365 6374 696f 6e20 3c61 p>See Section Function │ │ │ │ +0019bc80: 6361 6c6c 6261 636b 7320 666f 7220 6375 callbacks for cu │ │ │ │ +0019bc90: 7374 6f6d 697a 6564 2049 2f4f 2061 6e64 stomized I/O and │ │ │ │ +0019bca0: 2048 5454 5020 6861 6e64 6c69 6e67 3c2f HTTP handling for more deta │ │ │ │ +0019bcc0: 696c 7320 6f6e 2074 6865 2075 7365 206f ils on the use o │ │ │ │ +0019bcd0: 6620 7468 6573 6520 6361 6c6c 6261 636b f these callback │ │ │ │ +0019bce0: 732e 2041 6c6c 2063 616c 6c62 6163 6b20 s. All callback │ │ │ │ +0019bcf0: 6675 6e63 7469 6f6e 2070 6f69 6e74 6572 function pointer │ │ │ │ +0019bd00: 7320 7368 6f75 6c64 2062 6520 6e6f 6e2d s should be non- │ │ │ │ +0019bd10: 4e55 4c4c 2c20 6578 6365 7074 203c 636f NULL, except s │ │ │ │ +0019bde0: 6f61 703a 3a66 706f 6c6c 3c2f 613e 3c2f oap::fpoll.

    .

    Yo │ │ │ │ +0019be00: 7520 6361 6e6e 6f74 2075 7365 203c 636f u cannot use soap_pr │ │ │ │ +0019bea0: 696e 745f 6661 756c 743c 2f61 3e3c 2f63 int_fault and < │ │ │ │ +0019bec0: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ +0019bed0: 663d 2267 726f 7570 5f5f 6772 6f75 705f f="group__group_ │ │ │ │ +0019bee0: 5f66 6175 6c74 2e68 746d 6c23 6761 6137 _fault.html#gaa7 │ │ │ │ +0019bef0: 3038 3232 3933 3865 3066 3131 3664 3164 0822938e0f116d1d │ │ │ │ +0019bf00: 3030 3230 6166 6636 3663 6337 3935 2220 0020aff66cc795" │ │ │ │ +0019bf10: 7469 746c 653d 2250 7269 6e74 2074 6865 title="Print the │ │ │ │ +0019bf20: 206c 6f63 6174 696f 6e20 696e 2074 6865 location in the │ │ │ │ +0019bf30: 206d 6573 7361 6765 2077 6865 7265 2061 message where a │ │ │ │ +0019bf40: 6e64 2077 6865 6e20 7468 6520 6572 726f nd when the erro │ │ │ │ +0019bf50: 7220 6f63 6375 7272 6564 2e22 3e73 6f61 r occurred.">soa │ │ │ │ +0019bf60: 705f 7072 696e 745f 6661 756c 745f 6c6f p_print_fault_lo │ │ │ │ +0019bf70: 6361 7469 6f6e 3c2f 613e 3c2f 636f 6465 cation to print error │ │ │ │ +0019bf90: 2064 6961 676e 6f73 7469 6373 2e20 496e diagnostics. In │ │ │ │ +0019bfa0: 7374 6561 642c 2074 6865 2076 616c 7565 stead, the value │ │ │ │ +0019bfb0: 206f 6620 3c63 6f64 653e 3c61 2063 6c61 of │ │ │ │ +0019c060: 736f 6170 3a3a 6572 726f 723c 2f61 3e3c soap::error< │ │ │ │ +0019c070: 2f63 6f64 653e 2c20 7768 6963 6820 636f /code>, which co │ │ │ │ +0019c080: 6e74 6169 6e73 2074 6865 2067 534f 4150 ntains the gSOAP │ │ │ │ +0019c090: 2065 7272 6f72 2063 6f64 652c 2063 616e error code, can │ │ │ │ +0019c0a0: 2062 6520 7573 6564 2074 6f20 6465 7465 be used to dete │ │ │ │ +0019c0b0: 726d 696e 6520 7468 6520 6361 7573 6520 rmine the cause │ │ │ │ +0019c0c0: 6f66 2061 2066 6175 6c74 2e3c 2f70 3e0a of a fault.

    . │ │ │ │ +0019c0d0: 3c70 3ef0 9f94 9d20 3c61 2068 7265 663d

    .... Back to tabl │ │ │ │ +0019c0f0: 6520 6f66 2063 6f6e 7465 6e74 733c 2f61 e of contents

    .

    .Ho │ │ │ │ +0019c130: 7720 746f 2063 6f6d 6269 6e65 206d 756c w to combine mul │ │ │ │ +0019c140: 7469 706c 6520 636c 6965 6e74 2061 6e64 tiple client and │ │ │ │ +0019c150: 2073 6572 7665 7220 696d 706c 656d 656e server implemen │ │ │ │ +0019c160: 7461 7469 6f6e 7320 696e 746f 206f 6e65 tations into one │ │ │ │ +0019c170: 2065 7865 6375 7461 626c 653c 2f68 323e executable

    │ │ │ │ +0019c180: 0a3c 703e 5468 6520 7773 646c 3268 2074 .

    The wsdl2h t │ │ │ │ +0019c190: 6f6f 6c20 6361 6e20 6265 2075 7365 6420 ool can be used │ │ │ │ +0019c1a0: 746f 2069 6d70 6f72 7420 6d75 6c74 6970 to import multip │ │ │ │ +0019c1b0: 6c65 2057 5344 4c73 2061 6e64 2073 6368 le WSDLs and sch │ │ │ │ +0019c1c0: 656d 6173 2061 7420 6f6e 6365 2e20 5468 emas at once. Th │ │ │ │ +0019c1d0: 6520 7365 7276 6963 6520 6465 6669 6e69 e service defini │ │ │ │ +0019c1e0: 7469 6f6e 7320 6172 6520 636f 6d62 696e tions are combin │ │ │ │ +0019c1f0: 6564 2069 6e20 6f6e 6520 6865 6164 6572 ed in one header │ │ │ │ +0019c200: 2066 696c 6520 746f 2062 6520 7061 7273 file to be pars │ │ │ │ +0019c210: 6564 2062 7920 736f 6170 6370 7032 2e20 ed by soapcpp2. │ │ │ │ +0019c220: 4974 2069 7320 696d 706f 7274 616e 7420 It is important │ │ │ │ +0019c230: 746f 2061 7373 6967 6e20 6e61 6d65 7370 to assign namesp │ │ │ │ +0019c240: 6163 6520 7072 6566 6978 6573 2074 6f20 ace prefixes to │ │ │ │ +0019c250: 6e61 6d65 7370 6163 6520 5552 4973 2075 namespace URIs u │ │ │ │ +0019c260: 7369 6e67 2074 6865 203c 656d 3e3c 636f sing the typemap.dat file. │ │ │ │ +0019c290: 204f 7468 6572 7769 7365 2c20 7773 646c Otherwise, wsdl │ │ │ │ +0019c2a0: 3268 2077 696c 6c20 6173 7369 676e 206e 2h will assign n │ │ │ │ +0019c2b0: 616d 6573 7061 6365 2070 7265 6669 7865 amespace prefixe │ │ │ │ +0019c2c0: 7320 3c63 6f64 653e 6e73 313c 2f63 6f64 s ns1, ns2, and so on │ │ │ │ +0019c2f0: 746f 2074 6865 2073 6572 7669 6365 206f to the service o │ │ │ │ +0019c300: 7065 7261 7469 6f6e 7320 616e 6420 7363 perations and sc │ │ │ │ +0019c310: 6865 6d61 2074 7970 6573 2e20 5468 7573 hema types. Thus │ │ │ │ +0019c320: 2c20 616e 7920 6368 616e 6765 2074 6f20 , any change to │ │ │ │ +0019c330: 6120 5753 444c 206f 7220 7363 6865 6d61 a WSDL or schema │ │ │ │ +0019c340: 206d 6179 2072 6573 756c 7420 696e 2061 may result in a │ │ │ │ +0019c350: 206e 6577 2070 7265 6669 7820 6173 7369 new prefix assi │ │ │ │ +0019c360: 676e 6d65 6e74 2e20 466f 7220 6d6f 7265 gnment. For more │ │ │ │ +0019c370: 2064 6574 6169 6c73 2c20 706c 6561 7365 details, please │ │ │ │ +0019c380: 2073 6565 2053 6563 7469 6f6e 203c 6120 see Section Customizing │ │ │ │ +0019c3c0: 2058 4d4c 2064 6174 6120 6269 6e64 696e XML data bindin │ │ │ │ +0019c3d0: 6773 2077 6974 6820 7468 6520 7479 7065 gs with the type │ │ │ │ +0019c3e0: 6d61 702e 6461 7420 6669 6c65 3c2f 613e map.dat file │ │ │ │ +0019c3f0: 202e 3c2f 703e 0a3c 703e 416e 6f74 6865 .

    .

    Anothe │ │ │ │ +0019c400: 7220 6170 7072 6f61 6368 2074 6f20 636f r approach to co │ │ │ │ +0019c410: 6d62 696e 6520 6d75 6c74 6970 6c65 2063 mbine multiple c │ │ │ │ +0019c420: 6c69 656e 7420 616e 6420 7365 7276 6963 lient and servic │ │ │ │ +0019c430: 6520 6170 706c 6963 6174 696f 6e73 2069 e applications i │ │ │ │ +0019c440: 6e74 6f20 6f6e 6520 6578 6563 7574 6162 nto one executab │ │ │ │ +0019c450: 6c65 2069 7320 6279 2075 7369 6e67 2043 le is by using C │ │ │ │ +0019c460: 2b2b 206e 616d 6573 7061 6365 7320 746f ++ namespaces to │ │ │ │ +0019c470: 2073 7472 7563 7475 7261 6c6c 7920 7365 structurally se │ │ │ │ +0019c480: 7061 7261 7465 2074 6865 2064 6566 696e parate the defin │ │ │ │ +0019c490: 6974 696f 6e73 2e20 5468 6973 2069 7320 itions. This is │ │ │ │ +0019c4a0: 6175 746f 6d61 7465 6420 7769 7468 203c automated with < │ │ │ │ +0019c4b0: 6120 6872 6566 3d22 2377 7364 6c32 682d a href="#wsdl2h- │ │ │ │ +0019c4c0: 7122 3e3c 623e 3c63 6f64 653e 7773 646c q">wsdl │ │ │ │ +0019c4d0: 3268 202d 7120 6e61 6d65 3c2f 636f 6465 2h -q name option │ │ │ │ +0019c4f0: 3c63 6f64 653e 2d71 206e 616d 653c 2f63 -q name. Or │ │ │ │ +0019c510: 2062 7920 6372 6561 7469 6e67 206c 6962 by creating lib │ │ │ │ +0019c520: 7261 7269 6573 2069 6e20 4320 666f 7220 raries in C for │ │ │ │ +0019c530: 7468 6520 636c 6965 6e74 2f73 6572 7665 the client/serve │ │ │ │ +0019c540: 7220 6f62 6a65 6374 7320 6173 2065 7870 r objects as exp │ │ │ │ +0019c550: 6c61 696e 6564 2069 6e20 7375 6273 6571 lained in subseq │ │ │ │ +0019c560: 7565 6e74 2073 6563 7469 6f6e 733c 2f70 uent sections

    .

    Both approa │ │ │ │ +0019c580: 6368 6573 2061 7265 2064 656d 6f6e 7374 ches are demonst │ │ │ │ +0019c590: 7261 7465 6420 6279 2065 7861 6d70 6c65 rated by example │ │ │ │ +0019c5a0: 7320 696e 2074 6865 2067 534f 4150 2073 s in the gSOAP s │ │ │ │ +0019c5b0: 6f75 7263 6520 636f 6465 2070 6163 6b61 ource code packa │ │ │ │ +0019c5c0: 6765 2c20 7468 6520 3c65 6d3e 3c63 6f64 ge, the gsoap/samples/ │ │ │ │ +0019c5e0: 6c69 6e6b 3c2f 636f 6465 3e3c 2f65 6d3e link │ │ │ │ +0019c5f0: 2028 4320 6f6e 6c79 2920 616e 6420 3c65 (C only) and gsoap/sa │ │ │ │ +0019c610: 6d70 6c65 732f 6c69 6e6b 2b2b 3c2f 636f mples/link++ (C++ wi │ │ │ │ +0019c630: 7468 2043 2b2b 206e 616d 6573 7061 6365 th C++ namespace │ │ │ │ +0019c640: 7329 2065 7861 6d70 6c65 732e 3c2f 703e s) examples.

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

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

    .

    │ │ │ │ +0019c6b0: 3c2f 613e 0a48 6f77 2074 6f20 6275 696c .How to buil │ │ │ │ +0019c6c0: 6420 6120 636c 6965 6e74 206f 7220 7365 d a client or se │ │ │ │ +0019c6d0: 7276 6572 2069 6e20 6120 432b 2b20 636f rver in a C++ co │ │ │ │ +0019c6e0: 6465 206e 616d 6573 7061 6365 3c2f 6832 de namespace

    .

    You can use │ │ │ │ +0019c700: 2061 2043 2b2b 2063 6f64 6520 6e61 6d65 a C++ code name │ │ │ │ +0019c710: 7370 6163 6520 6f66 2079 6f75 7220 6368 space of your ch │ │ │ │ +0019c720: 6f69 6365 2069 6e20 796f 7572 2069 6e74 oice in your int │ │ │ │ +0019c730: 6572 6661 6365 2068 6561 6465 7220 6669 erface header fi │ │ │ │ +0019c740: 6c65 2074 6f20 6275 696c 6420 6120 636c le to build a cl │ │ │ │ +0019c750: 6965 6e74 206f 7220 7365 7276 6572 2069 ient or server i │ │ │ │ +0019c760: 6e20 7468 6174 2043 2b2b 206e 616d 6573 n that C++ names │ │ │ │ +0019c770: 7061 6365 2e20 496e 2074 6869 7320 7761 pace. In this wa │ │ │ │ +0019c780: 792c 2079 6f75 2063 616e 2063 7265 6174 y, you can creat │ │ │ │ +0019c790: 6520 6d75 6c74 6970 6c65 2063 6c69 656e e multiple clien │ │ │ │ +0019c7a0: 7473 2061 6e64 2073 6572 7665 7273 2074 ts and servers t │ │ │ │ +0019c7b0: 6861 7420 6361 6e20 6265 2063 6f6d 6269 hat can be combi │ │ │ │ +0019c7c0: 6e65 6420 616e 6420 6c69 6e6b 6564 2074 ned and linked t │ │ │ │ +0019c7d0: 6f67 6574 6865 7220 7769 7468 6f75 7420 ogether without │ │ │ │ +0019c7e0: 636f 6e66 6c69 6374 732c 2077 6869 6368 conflicts, which │ │ │ │ +0019c7f0: 2069 7320 6578 706c 6169 6e65 6420 696e is explained in │ │ │ │ +0019c800: 206d 6f72 6520 6465 7461 696c 2069 6e20 more detail in │ │ │ │ +0019c810: 7468 6520 6e65 7874 2073 6563 7469 6f6e the next section │ │ │ │ +0019c820: 2028 7768 6963 6820 616c 736f 2073 686f (which also sho │ │ │ │ +0019c830: 7773 2061 6e20 6578 616d 706c 6520 636f ws an example co │ │ │ │ +0019c840: 6d62 696e 696e 6720 7477 6f20 636c 6965 mbining two clie │ │ │ │ +0019c850: 6e74 206c 6962 7261 7269 6573 2064 6566 nt libraries def │ │ │ │ +0019c860: 696e 6564 2069 6e20 7477 6f20 432b 2b20 ined in two C++ │ │ │ │ +0019c870: 636f 6465 206e 616d 6573 7061 6365 7329 code namespaces) │ │ │ │ +0019c880: 2e3c 2f70 3e0a 3c70 3e55 7365 203c 6120 .

    .

    Use wsdl2h │ │ │ │ +0019c8b0: 202d 7120 6e61 6d65 3c2f 636f 6465 3e3c -q name< │ │ │ │ +0019c8c0: 2f62 3e20 6f70 7469 6f6e 203c 623e 3c63 /b> option -q name to ge │ │ │ │ +0019c8f0: 6e65 7261 7465 2064 6566 696e 6974 696f nerate definitio │ │ │ │ +0019c900: 6e73 2069 6e20 7468 6520 432b 2b20 3c63 ns in the C++ name │ │ │ │ +0019c920: 6e61 6d65 7370 6163 652e 2054 6869 7320 namespace. This │ │ │ │ +0019c930: 6f70 7469 6f6e 2063 616e 2061 6c73 6f20 option can also │ │ │ │ +0019c940: 6265 2075 7365 6420 696e 2063 6f6d 6269 be used in combi │ │ │ │ +0019c950: 6e61 7469 6f6e 2077 6974 6820 432b 2b20 nation with C++ │ │ │ │ +0019c960: 7072 6f78 7920 616e 6420 7365 7276 6572 proxy and server │ │ │ │ +0019c970: 206f 626a 6563 7420 6765 6e65 7261 7469 object generati │ │ │ │ +0019c980: 6f6e 2c20 7573 696e 6720 3c62 3e3c 636f on, using soapcpp2 -j option │ │ │ │ +0019c9b0: 203c 623e 3c63 6f64 653e 2d6a 3c2f 636f -j or optio │ │ │ │ +0019c9d0: 6e20 3c62 3e3c 636f 6465 3e2d 693c 2f63 n -i).

    .< │ │ │ │ +0019c9f0: 703e 4174 206d 6f73 7420 6f6e 6520 6e61 p>At most one na │ │ │ │ +0019ca00: 6d65 7370 6163 6520 6361 6e20 6265 2064 mespace can be d │ │ │ │ +0019ca10: 6566 696e 6564 2066 6f72 2074 6865 2065 efined for the e │ │ │ │ +0019ca20: 6e74 6972 6520 696e 7465 7266 6163 6520 ntire interface │ │ │ │ +0019ca30: 6865 6164 6572 2066 696c 6520 666f 7220 header file for │ │ │ │ +0019ca40: 736f 6170 6370 7032 2e20 5468 6520 432b soapcpp2. The C+ │ │ │ │ +0019ca50: 2b20 6e61 6d65 7370 6163 6520 6d75 7374 + namespace must │ │ │ │ +0019ca60: 2063 6f6d 706c 6574 656c 7920 656e 6361 completely enca │ │ │ │ +0019ca70: 7073 756c 6174 6520 7468 6520 656e 7469 psulate the enti │ │ │ │ +0019ca80: 7265 2063 6f6e 7465 6e74 7320 6f66 2074 re contents of t │ │ │ │ +0019ca90: 6865 2068 6561 6465 7220 6669 6c65 3a3c he header file:< │ │ │ │ +0019caa0: 2f70 3e0a 3c64 6976 2063 6c61 7373 3d22 /p>.
    namespace NamespaceName │ │ │ │ +0019cb00: 207b 3c2f 6469 763e 0a3c 6469 7620 636c {
    .
    ... │ │ │ │ +0019cb20: 203c 7370 616e 2063 6c61 7373 3d22 6b65 interface │ │ │ │ +0019cb40: 203c 2f73 7061 6e3e 6865 6164 6572 2066 header f │ │ │ │ +0019cb50: 696c 6520 636f 6e74 656e 7473 202e 2e2e ile contents ... │ │ │ │ +0019cb60: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    }
    .

    When │ │ │ │ +0019cba0: 2063 6f6d 7069 6c69 6e67 2074 6869 7320 compiling this │ │ │ │ +0019cbb0: 696e 7465 7266 6163 6520 6865 6164 6572 interface header │ │ │ │ +0019cbc0: 2066 696c 6520 7769 7468 2074 6865 2073 file with the s │ │ │ │ +0019cbd0: 6f61 7063 7070 3220 746f 6f6c 2c20 616c oapcpp2 tool, al │ │ │ │ +0019cbe0: 6c20 7479 7065 2064 6566 696e 6974 696f l type definitio │ │ │ │ +0019cbf0: 6e73 2c20 7468 6520 7365 7269 616c 697a ns, the serializ │ │ │ │ +0019cc00: 6572 7320 666f 7220 7468 6573 6520 7479 ers for these ty │ │ │ │ +0019cc10: 7065 732c 2061 6e64 2074 6865 2073 7475 pes, and the stu │ │ │ │ +0019cc20: 6220 616e 6420 736b 656c 6574 6f6e 2066 b and skeleton f │ │ │ │ +0019cc30: 756e 6374 696f 6e73 2077 696c 6c20 6265 unctions will be │ │ │ │ +0019cc40: 2070 6c61 6365 6420 696e 2074 6869 7320 placed in this │ │ │ │ +0019cc50: 6e61 6d65 7370 6163 652e 2054 6865 2058 namespace. The X │ │ │ │ +0019cc60: 4d4c 206e 616d 6573 7061 6365 206d 6170 ML namespace map │ │ │ │ +0019cc70: 7069 6e67 2074 6162 6c65 2028 7361 7665 ping table (save │ │ │ │ +0019cc80: 6420 696e 2061 203c 656d 3e3c 636f 6465 d in a .nsmap file) will n │ │ │ │ +0019ccb0: 6f74 2062 6520 706c 6163 6564 2069 6e20 ot be placed in │ │ │ │ +0019ccc0: 7468 6520 636f 6465 206e 616d 6573 7061 the code namespa │ │ │ │ +0019ccd0: 6365 2074 6f20 616c 6c6f 7720 6974 2074 ce to allow it t │ │ │ │ +0019cce0: 6f20 6265 206c 696e 6b65 6420 6173 2061 o be linked as a │ │ │ │ +0019ccf0: 2067 6c6f 6261 6c20 6f62 6a65 6374 2e20 global object. │ │ │ │ +0019cd00: 596f 7520 6361 6e20 7573 6520 3c62 3e3c You can use < │ │ │ │ +0019cd10: 636f 6465 3e73 6f61 7063 7070 3220 2d6e code>soapcpp2 -n │ │ │ │ +0019cd20: 3c2f 636f 6465 3e3c 2f62 3e20 6f70 7469 opti │ │ │ │ +0019cd30: 6f6e 203c 623e 3c63 6f64 653e 2d6e 3c2f on -n to cre │ │ │ │ +0019cd50: 6174 6520 6c6f 6361 6c20 584d 4c20 6e61 ate local XML na │ │ │ │ +0019cd60: 6d65 7370 6163 6520 7461 626c 6573 2c20 mespace tables, │ │ │ │ +0019cd70: 7365 6520 5365 6374 696f 6e20 3c61 2063 see Section soap │ │ │ │ +0019cdb0: 6370 7032 206f 7074 696f 6e73 3c2f 613e cpp2 options │ │ │ │ +0019cdc0: 2028 6275 7420 7265 6d65 6d62 6572 2074 (but remember t │ │ │ │ +0019cdd0: 6861 7420 796f 7520 6578 706c 6963 6974 hat you explicit │ │ │ │ +0019cde0: 6c79 206e 6565 6420 746f 2069 6e69 7469 ly need to initi │ │ │ │ +0019cdf0: 616c 697a 6520 7468 6520 6e61 6d65 7370 alize the namesp │ │ │ │ +0019ce00: 6163 6573 2074 6f20 706f 696e 7420 746f aces to point to │ │ │ │ +0019ce10: 2061 2074 6162 6c65 2061 7420 7275 6e20 a table at run │ │ │ │ +0019ce20: 7469 6d65 2075 7369 6e67 203c 636f 6465 time using soap_set_namesp │ │ │ │ +0019cf00: 6163 6573 3c2f 613e 3c2f 636f 6465 3e29 aces) │ │ │ │ +0019cf10: 2e20 5468 6520 6765 6e65 7261 7465 6420 . The generated │ │ │ │ +0019cf20: 6669 6c65 7320 6172 6520 7072 6566 6978 files are prefix │ │ │ │ +0019cf30: 6564 2077 6974 6820 7468 6520 636f 6465 ed with the code │ │ │ │ +0019cf40: 206e 616d 6573 7061 6365 206e 616d 6520 namespace name │ │ │ │ +0019cf50: 696e 7374 6561 6420 6f66 2074 6865 2075 instead of the u │ │ │ │ +0019cf60: 7375 616c 203c 656d 3e3c 636f 6465 3e73 sual s │ │ │ │ +0019cf70: 6f61 703c 2f63 6f64 653e 3c2f 656d 3e20 oap │ │ │ │ +0019cf80: 6669 6c65 206e 616d 6520 7072 6566 6978 file name prefix │ │ │ │ +0019cf90: 2074 6f20 656e 6162 6c65 206d 756c 7469 to enable multi │ │ │ │ +0019cfa0: 706c 6520 636c 6965 6e74 2f73 6572 7665 ple client/serve │ │ │ │ +0019cfb0: 7220 636f 6465 7320 746f 2062 6520 6275 r codes to be bu │ │ │ │ +0019cfc0: 696c 6420 696e 2074 6865 2073 616d 6520 ild in the same │ │ │ │ +0019cfd0: 7072 6f6a 6563 7420 6469 7265 6374 6f72 project director │ │ │ │ +0019cfe0: 792e 3c2f 703e 0a3c 703e 4265 6361 7573 y.

    .

    Becaus │ │ │ │ +0019cff0: 6520 7468 6520 534f 4150 2048 6561 6465 e the SOAP Heade │ │ │ │ +0019d000: 7220 616e 6420 4661 756c 7420 7365 7269 r and Fault seri │ │ │ │ +0019d010: 616c 697a 6572 7320 7769 6c6c 2061 6c73 alizers will als │ │ │ │ +0019d020: 6f20 6265 2070 6c61 6365 6420 696e 2074 o be placed in t │ │ │ │ +0019d030: 6865 206e 616d 6573 7061 6365 2c20 7468 he namespace, th │ │ │ │ +0019d040: 6579 2063 616e 6e6f 7420 6265 2063 616c ey cannot be cal │ │ │ │ +0019d050: 6c65 6420 6672 6f6d 2074 6865 203c 656d led from the gsoap/std │ │ │ │ +0019d070: 736f 6170 322e 6370 703c 2f63 6f64 653e soap2.cpp │ │ │ │ +0019d080: 3c2f 656d 3e20 7275 6e20 7469 6d65 206c run time l │ │ │ │ +0019d090: 6962 7261 7279 2063 6f64 6520 616e 6420 ibrary code and │ │ │ │ +0019d0a0: 6172 6520 7468 6572 6566 6f72 6520 7265 are therefore re │ │ │ │ +0019d0b0: 6e64 6572 6564 2075 6e75 7361 626c 652e ndered unusable. │ │ │ │ +0019d0c0: 2054 6865 7265 666f 7265 2c20 7468 6573 Therefore, thes │ │ │ │ +0019d0d0: 6520 7365 7269 616c 697a 6572 7320 6172 e serializers ar │ │ │ │ +0019d0e0: 6520 6e6f 7420 636f 6d70 696c 6564 2061 e not compiled a │ │ │ │ +0019d0f0: 7420 616c 6c20 2865 6e66 6f72 6365 6420 t all (enforced │ │ │ │ +0019d100: 7769 7468 203c 636f 6465 3e23 6465 6669 with #defi │ │ │ │ +0019d110: 6e65 2057 4954 485f 4e4f 474c 4f42 414c ne WITH_NOGLOBAL │ │ │ │ +0019d120: 3c2f 636f 6465 3e29 2e20 546f 2061 6464 ). To add │ │ │ │ +0019d130: 2053 4f41 5020 4865 6164 6572 2061 6e64 SOAP Header and │ │ │ │ +0019d140: 2046 6175 6c74 2073 6572 6961 6c69 7a65 Fault serialize │ │ │ │ +0019d150: 7273 2c20 796f 7520 6d75 7374 2063 6f6d rs, you must com │ │ │ │ +0019d160: 7069 6c65 2074 6865 6d20 7365 7061 7261 pile them separa │ │ │ │ +0019d170: 7465 6c79 2061 7320 666f 6c6c 6f77 732e tely as follows. │ │ │ │ +0019d180: 2046 6972 7374 2c20 6372 6561 7465 2061 First, create a │ │ │ │ +0019d190: 206e 6577 2068 6561 6465 7220 6669 6c65 new header file │ │ │ │ +0019d1a0: 203c 656d 3e3c 636f 6465 3e65 6e76 2e68 env.h │ │ │ │ +0019d1b0: 3c2f 636f 6465 3e3c 2f65 6d3e 2077 6974 wit │ │ │ │ +0019d1c0: 6820 7468 6520 534f 4150 2048 6561 6465 h the SOAP Heade │ │ │ │ +0019d1d0: 7220 3c63 6f64 653e 3c61 2063 6c61 7373 r SOAP_ENV__Hea │ │ │ │ +0019d240: 6465 723c 2f61 3e3c 2f63 6f64 653e 2061 der a │ │ │ │ +0019d250: 6e64 2053 4f41 5020 4661 756c 7420 3c63 nd SOAP Fault SOA │ │ │ │ +0019d2c0: 505f 454e 565f 5f46 6175 6c74 3c2f 613e P_ENV__Fault │ │ │ │ +0019d2d0: 3c2f 636f 6465 3e20 7374 7275 6374 7572 structur │ │ │ │ +0019d2e0: 6573 2c20 696e 636c 7564 696e 6720 3c63 es, including SOAP_ENV__D │ │ │ │ +0019d360: 6574 6169 6c3c 2f61 3e3c 2f63 6f64 653e etail │ │ │ │ +0019d370: 2069 6620 7468 6973 2073 7472 7563 7475 if this structu │ │ │ │ +0019d380: 7265 2063 6f6e 7461 696e 7320 6d65 6d62 re contains memb │ │ │ │ +0019d390: 6572 7320 7468 6174 2061 7265 2073 6572 ers that are ser │ │ │ │ +0019d3a0: 6961 6c69 7a65 6420 6173 2066 6175 6c74 ialized as fault │ │ │ │ +0019d3b0: 2064 6574 6169 6c73 2e20 596f 7520 6361 details. You ca │ │ │ │ +0019d3c0: 6e20 6c65 6176 6520 7468 6973 2068 6561 n leave this hea │ │ │ │ +0019d3d0: 6465 7220 6669 6c65 2065 6d70 7479 2069 der file empty i │ │ │ │ +0019d3e0: 6620 796f 7520 7761 6e74 2074 6f20 7573 f you want to us │ │ │ │ +0019d3f0: 6520 7468 6520 6465 6661 756c 7420 534f e the default SO │ │ │ │ +0019d400: 4150 2048 6561 6465 7220 616e 6420 4661 AP Header and Fa │ │ │ │ +0019d410: 756c 742e 2048 6f77 6576 6572 2c20 6966 ult. However, if │ │ │ │ +0019d420: 2053 4f41 5020 4865 6164 6572 7320 6172 SOAP Headers ar │ │ │ │ +0019d430: 6520 7265 7175 6972 6564 2074 6865 6e20 e required then │ │ │ │ +0019d440: 796f 7520 6361 6e6e 6f74 206c 6561 7665 you cannot leave │ │ │ │ +0019d450: 2074 6865 203c 636f 6465 3e3c 6120 636c the SOAP_ENV__ │ │ │ │ +0019d4c0: 4865 6164 6572 3c2f 613e 3c2f 636f 6465 Header structure empt │ │ │ │ +0019d4e0: 792e 2046 6f72 2065 7861 6d70 6c65 2c20 y. For example, │ │ │ │ +0019d4f0: 7468 6520 5753 2d41 6464 7265 7373 696e the WS-Addressin │ │ │ │ +0019d500: 6720 616e 6420 5753 2d53 6563 7572 6974 g and WS-Securit │ │ │ │ +0019d510: 7920 706c 7567 696e 7320 7265 7175 6972 y plugins requir │ │ │ │ +0019d520: 6520 534f 4150 2048 6561 6465 7273 2077 e SOAP Headers w │ │ │ │ +0019d530: 6869 6368 2063 616e 2062 6520 696d 706f hich can be impo │ │ │ │ +0019d540: 7274 6564 2062 7920 6164 6469 6e67 203c rted by adding < │ │ │ │ +0019d550: 636f 6465 3e23 696d 706f 7274 2022 7773 code>#import "ws │ │ │ │ +0019d560: 6135 2e68 223c 2f63 6f64 653e 2061 6e64 a5.h" and │ │ │ │ +0019d570: 203c 636f 6465 3e23 696d 706f 7274 2022 #import " │ │ │ │ +0019d580: 7773 7365 2e68 223c 2f63 6f64 653e 2c20 wsse.h", │ │ │ │ +0019d590: 7265 7370 6563 7469 7665 6c79 2074 6f20 respectively to │ │ │ │ +0019d5a0: 3c65 6d3e 3c63 6f64 653e 656e 762e 683c env.h< │ │ │ │ +0019d5b0: 2f63 6f64 653e 3c2f 656d 3e2e 2054 6865 /code>. The │ │ │ │ +0019d5c0: 6e20 636f 6d70 696c 6520 7468 6973 2068 n compile this h │ │ │ │ +0019d5d0: 6561 6465 7220 6669 6c65 2077 6974 683a eader file with: │ │ │ │ +0019d5e0: 203c 2f70 3e3c 7072 6520 636c 6173 733d

     soap
    │ │ │ │ +0019d600: 6370 7032 202d 7065 6e76 2065 6e76 2e68  cpp2 -penv env.h
    │ │ │ │ +0019d610: 0a3c 2f70 7265 3e3c 703e 2054 6865 2067  .

    The g │ │ │ │ +0019d620: 656e 6572 6174 6564 203c 656d 3e3c 636f enerated envC.cpp file hol │ │ │ │ +0019d650: 6473 2074 6865 2053 4f41 5020 4865 6164 ds the SOAP Head │ │ │ │ +0019d660: 6572 2061 6e64 2046 6175 6c74 2073 6572 er and Fault ser │ │ │ │ +0019d670: 6961 6c69 7a65 7273 2061 6e64 2079 6f75 ializers and you │ │ │ │ +0019d680: 2063 616e 206c 696e 6b20 7468 6973 2066 can link this f │ │ │ │ +0019d690: 696c 6520 7769 7468 2079 6f75 7220 636c ile with your cl │ │ │ │ +0019d6a0: 6965 6e74 2061 6e64 2073 6572 7665 7220 ient and server │ │ │ │ +0019d6b0: 6170 706c 6963 6174 696f 6e73 2e3c 2f70 applications.

    .

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

    .

    .H │ │ │ │ +0019d720: 6f77 2074 6f20 6372 6561 7465 2063 6c69 ow to create cli │ │ │ │ +0019d730: 656e 742f 7365 7276 6572 206c 6962 7261 ent/server libra │ │ │ │ +0019d740: 7269 6573 3c2f 6832 3e0a 3c70 3e54 6865 ries

    .

    The │ │ │ │ +0019d750: 2073 6f61 7063 7070 3220 746f 6f6c 2070 soapcpp2 tool p │ │ │ │ +0019d760: 726f 6475 6365 7320 3c65 6d3e 3c63 6f64 roduces soapClientLib. │ │ │ │ +0019d780: 6370 703c 2f63 6f64 653e 3c2f 656d 3e20 cpp │ │ │ │ +0019d790: 616e 6420 3c65 6d3e 3c63 6f64 653e 736f and so │ │ │ │ +0019d7a0: 6170 5365 7276 6572 4c69 622e 6370 703c apServerLib.cpp< │ │ │ │ +0019d7b0: 2f63 6f64 653e 3c2f 656d 3e20 736f 7572 /code> sour │ │ │ │ +0019d7c0: 6365 2063 6f64 6520 6669 6c65 7320 7468 ce code files th │ │ │ │ +0019d7d0: 6174 2061 7265 2073 7065 6369 6669 6361 at are specifica │ │ │ │ +0019d7e0: 6c6c 7920 696e 7465 6e64 6564 2066 6f72 lly intended for │ │ │ │ +0019d7f0: 2062 7569 6c64 696e 6720 7374 6174 6963 building static │ │ │ │ +0019d800: 206f 7220 6479 6e61 6d69 6320 636c 6965 or dynamic clie │ │ │ │ +0019d810: 6e74 2061 6e64 2073 6572 7665 7220 6c69 nt and server li │ │ │ │ +0019d820: 6272 6172 6965 7320 696e 2043 206f 7220 braries in C or │ │ │ │ +0019d830: 432b 2b2e 2054 6865 7365 2066 696c 6573 C++. These files │ │ │ │ +0019d840: 2065 7870 6f72 7420 7468 6520 7374 7562 export the stub │ │ │ │ +0019d850: 2061 6e64 2073 6b65 6c65 746f 6e20 6675 and skeleton fu │ │ │ │ +0019d860: 6e63 7469 6f6e 732c 2062 7574 206b 6565 nctions, but kee │ │ │ │ +0019d870: 7020 616c 6c20 7365 7269 616c 697a 6174 p all serializat │ │ │ │ +0019d880: 696f 6e20 636f 6465 2073 7461 7469 632c ion code static, │ │ │ │ +0019d890: 2074 6875 7320 6869 6464 656e 2074 6f20 thus hidden to │ │ │ │ +0019d8a0: 6176 6f69 6420 6c69 6e6b 2073 796d 626f avoid link symbo │ │ │ │ +0019d8b0: 6c20 636f 6e66 6c69 6374 7320 7768 656e l conflicts when │ │ │ │ +0019d8c0: 2063 6f6d 6269 6e69 6e67 206d 756c 7469 combining multi │ │ │ │ +0019d8d0: 706c 6520 636c 6965 6e74 7320 616e 6420 ple clients and │ │ │ │ +0019d8e0: 7365 7276 6963 6573 2069 6e74 6f20 6f6e services into on │ │ │ │ +0019d8f0: 6520 6578 6563 7574 6162 6c65 2e20 4e6f e executable. No │ │ │ │ +0019d900: 7465 2074 6861 7420 6974 2069 7320 6661 te that it is fa │ │ │ │ +0019d910: 7220 7369 6d70 6c65 7220 746f 2075 7365 r simpler to use │ │ │ │ +0019d920: 2074 6865 2077 7364 6c32 6820 746f 6f6c the wsdl2h tool │ │ │ │ +0019d930: 206f 6e20 6d75 6c74 6970 6c65 2057 5344 on multiple WSD │ │ │ │ +0019d940: 4c20 6669 6c65 7320 746f 2067 656e 6572 L files to gener │ │ │ │ +0019d950: 6174 6520 6120 6865 6164 6572 2066 696c ate a header fil │ │ │ │ +0019d960: 6520 7468 6174 2063 6f6d 6269 6e65 7320 e that combines │ │ │ │ +0019d970: 616c 6c20 7365 7276 6963 6520 6465 6669 all service defi │ │ │ │ +0019d980: 6e69 7469 6f6e 732e 2048 6f77 6576 6572 nitions. However │ │ │ │ +0019d990: 2c20 7468 6520 6170 7072 6f61 6368 2070 , the approach p │ │ │ │ +0019d9a0: 7265 7365 6e74 6564 2069 6e20 7468 6973 resented in this │ │ │ │ +0019d9b0: 2073 6563 7469 6f6e 2069 7320 7573 6566 section is usef │ │ │ │ +0019d9c0: 756c 2077 6865 6e20 6372 6561 7469 6e67 ul when creating │ │ │ │ +0019d9d0: 2028 6479 6e61 6d69 6329 206c 6962 7261 (dynamic) libra │ │ │ │ +0019d9e0: 7269 6573 2066 6f72 2063 6c69 656e 7420 ries for client │ │ │ │ +0019d9f0: 616e 6420 7365 7276 6572 206f 626a 6563 and server objec │ │ │ │ +0019da00: 7473 2c20 7375 6368 2061 7320 444c 4c73 ts, such as DLLs │ │ │ │ +0019da10: 2061 7320 6465 7363 7269 6265 6420 696e as described in │ │ │ │ +0019da20: 2053 6563 7469 6f6e 203c 6120 636c 6173 Section How │ │ │ │ +0019da50: 2074 6f20 6372 6561 7465 2044 4c4c 733c to create DLLs< │ │ │ │ +0019da60: 2f61 3e20 2e3c 2f70 3e0a 3c64 6c20 636c /a> .

    .
    Note
    │ │ │ │ +0019da90: 3c64 643e 4f6e 6520 6d61 6a6f 7220 6469
    One major di │ │ │ │ +0019daa0: 7361 6476 616e 7461 6765 206f 6620 7468 sadvantage of th │ │ │ │ +0019dab0: 6520 6170 7072 6f61 6368 2070 7265 7365 e approach prese │ │ │ │ +0019dac0: 6e74 6564 2068 6572 6520 6973 2074 6861 nted here is tha │ │ │ │ +0019dad0: 7420 7468 6520 7365 7269 616c 697a 6572 t the serializer │ │ │ │ +0019dae0: 2066 756e 6374 696f 6e73 2061 7265 206e functions are n │ │ │ │ +0019daf0: 6f20 6c6f 6e67 6572 2061 6363 6573 7369 o longer accessi │ │ │ │ +0019db00: 626c 6520 696e 2074 6865 2075 7365 7227 ble in the user' │ │ │ │ +0019db10: 7320 736f 7572 6365 2063 6f64 652c 2062 s source code, b │ │ │ │ +0019db20: 6563 6175 7365 2073 6572 6961 6c69 7a65 ecause serialize │ │ │ │ +0019db30: 7273 2077 696c 6c20 6265 2063 6f6e 7665 rs will be conve │ │ │ │ +0019db40: 7274 6564 2074 6f20 7374 6174 6963 2066 rted to static f │ │ │ │ +0019db50: 756e 6374 696f 6e73 2028 746f 2062 6520 unctions (to be │ │ │ │ +0019db60: 7573 6564 2062 7920 7468 6520 6765 6e65 used by the gene │ │ │ │ +0019db70: 7261 7465 6420 7374 7562 2061 6e64 2073 rated stub and s │ │ │ │ +0019db80: 6b65 6c65 746f 6e20 6675 6e63 7469 6f6e keleton function │ │ │ │ +0019db90: 7320 6f6e 6c79 292e 2046 6f72 2065 7861 s only). For exa │ │ │ │ +0019dba0: 6d70 6c65 2c20 6675 6e63 7469 6f6e 7320 mple, functions │ │ │ │ +0019dbb0: 7375 6368 2061 7320 3c63 6f64 653e 736f such as so │ │ │ │ +0019dbc0: 6170 5f6e 6577 5f54 3c2f 636f 6465 3e2c ap_new_T, │ │ │ │ +0019dbd0: 203c 636f 6465 3e73 6f61 705f 6465 6661 soap_defa │ │ │ │ +0019dbe0: 756c 745f 543c 2f63 6f64 653e 2c20 3c63 ult_T, soap_write_T │ │ │ │ +0019dc00: 3c2f 636f 6465 3e2c 203c 636f 6465 3e73 , s │ │ │ │ +0019dc10: 6f61 705f 7265 6164 5f54 3c2f 636f 6465 oap_read_T, soap_pu │ │ │ │ +0019dc30: 745f 543c 2f63 6f64 653e 2c20 616e 6420 t_T, and │ │ │ │ +0019dc40: 3c63 6f64 653e 736f 6170 5f67 6574 5f54 soap_get_T │ │ │ │ +0019dc50: 3c2f 636f 6465 3e20 6361 6e6e 6f74 2062 cannot b │ │ │ │ +0019dc60: 6520 7573 6564 2061 6e79 206c 6f6e 6765 e used any longe │ │ │ │ +0019dc70: 722e 3c2f 6464 3e3c 2f64 6c3e 0a3c 703e r.
    .

    │ │ │ │ +0019dc80: 5573 696e 6720 432b 2b20 6e61 6d65 7370 Using C++ namesp │ │ │ │ +0019dc90: 6163 6573 2069 7320 6120 6265 7474 6572 aces is a better │ │ │ │ +0019dca0: 2061 6c74 6572 6e61 7469 7665 2077 6865 alternative whe │ │ │ │ +0019dcb0: 6e20 6275 696c 6469 6e67 2061 7070 6c69 n building appli │ │ │ │ +0019dcc0: 6361 7469 6f6e 7320 696e 2043 2b2b 2074 cations in C++ t │ │ │ │ +0019dcd0: 6861 7420 636f 6d62 696e 6520 6d75 6c74 hat combine mult │ │ │ │ +0019dce0: 6970 6c65 2063 6c69 656e 7473 2061 6e64 iple clients and │ │ │ │ +0019dcf0: 2073 6572 7669 6365 732e 2054 6f20 6275 services. To bu │ │ │ │ +0019dd00: 696c 6420 6d75 6c74 6970 6c65 206c 6962 ild multiple lib │ │ │ │ +0019dd10: 7261 7269 6573 2c20 796f 7520 6361 6e20 raries, you can │ │ │ │ +0019dd20: 6465 6669 6e65 2061 2043 2b2b 206e 616d define a C++ nam │ │ │ │ +0019dd30: 6573 7061 6365 2069 6e20 796f 7572 2068 espace in your h │ │ │ │ +0019dd40: 6561 6465 7220 6669 6c65 2077 6974 6820 eader file with │ │ │ │ +0019dd50: 3c62 3e3c 636f 6465 3e73 6f61 7063 7070 soapcpp │ │ │ │ +0019dd60: 3220 2d71 6e61 6d65 3c2f 636f 6465 3e3c 2 -qname< │ │ │ │ +0019dd70: 2f62 3e20 6f70 7469 6f6e 203c 623e 3c63 /b> option -qname, see Secti │ │ │ │ +0019dda0: 6f6e 203c 6120 636c 6173 733d 2265 6c22 on How to build a │ │ │ │ +0019dde0: 636c 6965 6e74 206f 7220 7365 7276 6572 client or server │ │ │ │ +0019ddf0: 2069 6e20 6120 432b 2b20 636f 6465 206e in a C++ code n │ │ │ │ +0019de00: 616d 6573 7061 6365 3c2f 613e 2066 6f72 amespace for │ │ │ │ +0019de10: 2064 6574 6169 6c73 2e3c 2f70 3e0a 3c70 details.

    .

    For C, you can │ │ │ │ +0019de30: 7573 6520 3c62 3e3c 636f 6465 3e73 6f61 use soa │ │ │ │ +0019de40: 7063 7070 3220 2d63 202d 7020 6e61 6d65 pcpp2 -c -p name │ │ │ │ +0019de50: 3c2f 636f 6465 3e3c 2f62 3e20 6f70 7469 opti │ │ │ │ +0019de60: 6f6e 203c 623e 3c63 6f64 653e 2d70 206e on -p n │ │ │ │ +0019de70: 616d 653c 2f63 6f64 653e 3c2f 623e 2074 ame t │ │ │ │ +0019de80: 6f20 7265 6e61 6d65 2074 6865 2067 656e o rename the gen │ │ │ │ +0019de90: 6572 6174 6564 203c 656d 3e3c 636f 6465 erated soapClientLib.c │ │ │ │ +0019deb0: 3c2f 636f 6465 3e3c 2f65 6d3e 2061 6e64 and │ │ │ │ +0019dec0: 203c 656d 3e3c 636f 6465 3e73 6f61 7053 soapS │ │ │ │ +0019ded0: 6572 7665 724c 6962 2e63 3c2f 636f 6465 erverLib.c (and asso │ │ │ │ +0019def0: 6369 6174 6564 2920 6669 6c65 732e 2054 ciated) files. T │ │ │ │ +0019df00: 6865 203c 623e 3c63 6f64 653e 2d70 206e he -p n │ │ │ │ +0019df10: 616d 653c 2f63 6f64 653e 3c2f 623e 206f ame o │ │ │ │ +0019df20: 7074 696f 6e20 7370 6563 6966 6965 7320 ption specifies │ │ │ │ +0019df30: 7468 6520 6669 6c65 203c 656d 3e3c 636f the file name prefix to re │ │ │ │ +0019df60: 706c 6163 6520 7468 6520 3c65 6d3e 3c63 place the soap< │ │ │ │ +0019df80: 2f65 6d3e 2066 696c 6520 6e61 6d65 2070 /em> file name p │ │ │ │ +0019df90: 7265 6669 782e 3c2f 703e 0a3c 703e 5468 refix.

    .

    Th │ │ │ │ +0019dfa0: 6520 656e 6769 6e65 2064 6f65 7320 6e6f e engine does no │ │ │ │ +0019dfb0: 7420 6465 6669 6e65 2053 4f41 5020 4865 t define SOAP He │ │ │ │ +0019dfc0: 6164 6572 2061 6e64 2046 6175 6c74 2073 ader and Fault s │ │ │ │ +0019dfd0: 6572 6961 6c69 7a65 7273 2074 6861 7420 erializers that │ │ │ │ +0019dfe0: 7468 6520 656e 6769 6e65 206e 6565 6473 the engine needs │ │ │ │ +0019dff0: 2e20 5765 2074 6865 7265 666f 7265 2061 . We therefore a │ │ │ │ +0019e000: 6464 2053 4f41 5020 4865 6164 6572 2061 dd SOAP Header a │ │ │ │ +0019e010: 6e64 2046 6175 6c74 2073 6572 6961 6c69 nd Fault seriali │ │ │ │ +0019e020: 7a65 7273 2c20 7768 6963 6820 6172 6520 zers, which are │ │ │ │ +0019e030: 636f 6d70 696c 6564 2073 6570 6172 6174 compiled separat │ │ │ │ +0019e040: 656c 7920 6173 2066 6f6c 6c6f 7773 2e20 ely as follows. │ │ │ │ +0019e050: 4669 7273 742c 2063 7265 6174 6520 6120 First, create a │ │ │ │ +0019e060: 6e65 7720 6865 6164 6572 2066 696c 6520 new header file │ │ │ │ +0019e070: 3c65 6d3e 3c63 6f64 653e 656e 762e 683c env.h< │ │ │ │ +0019e080: 2f63 6f64 653e 3c2f 656d 3e20 7769 7468 /code> with │ │ │ │ +0019e090: 2074 6865 2053 4f41 5020 4865 6164 6572 the SOAP Header │ │ │ │ +0019e0a0: 203c 636f 6465 3e3c 6120 636c 6173 733d SOAP_ENV__Head │ │ │ │ +0019e110: 6572 3c2f 613e 3c2f 636f 6465 3e20 616e er an │ │ │ │ +0019e120: 6420 534f 4150 2046 6175 6c74 203c 636f d SOAP Fault SOAP │ │ │ │ +0019e190: 5f45 4e56 5f5f 4661 756c 743c 2f61 3e3c _ENV__Fault< │ │ │ │ +0019e1a0: 2f63 6f64 653e 2073 7472 7563 7475 7265 /code> structure │ │ │ │ +0019e1b0: 732c 2069 6e63 6c75 6469 6e67 203c 636f s, including SOAP_ENV__De │ │ │ │ +0019e230: 7461 696c 3c2f 613e 3c2f 636f 6465 3e20 tail │ │ │ │ +0019e240: 6966 2074 6869 7320 7374 7275 6374 7572 if this structur │ │ │ │ +0019e250: 6520 636f 6e74 6169 6e73 206d 656d 6265 e contains membe │ │ │ │ +0019e260: 7273 2074 6861 7420 6172 6520 7365 7269 rs that are seri │ │ │ │ +0019e270: 616c 697a 6564 2061 7320 6661 756c 7420 alized as fault │ │ │ │ +0019e280: 6465 7461 696c 732e 2059 6f75 2063 616e details. You can │ │ │ │ +0019e290: 206c 6561 7665 2074 6869 7320 6865 6164 leave this head │ │ │ │ +0019e2a0: 6572 2066 696c 6520 656d 7074 7920 6966 er file empty if │ │ │ │ +0019e2b0: 2079 6f75 2077 616e 7420 746f 2075 7365 you want to use │ │ │ │ +0019e2c0: 2074 6865 2064 6566 6175 6c74 2053 4f41 the default SOA │ │ │ │ +0019e2d0: 5020 4865 6164 6572 2061 6e64 2046 6175 P Header and Fau │ │ │ │ +0019e2e0: 6c74 2e20 486f 7765 7665 722c 2069 6620 lt. However, if │ │ │ │ +0019e2f0: 534f 4150 2048 6561 6465 7273 2061 7265 SOAP Headers are │ │ │ │ +0019e300: 2072 6571 7569 7265 6420 7468 656e 2079 required then y │ │ │ │ +0019e310: 6f75 2063 616e 6e6f 7420 6c65 6176 6520 ou cannot leave │ │ │ │ +0019e320: 7468 6520 3c63 6f64 653e 3c61 2063 6c61 the SOAP_ENV__H │ │ │ │ +0019e390: 6561 6465 723c 2f61 3e3c 2f63 6f64 653e eader │ │ │ │ +0019e3a0: 2073 7472 7563 7475 7265 2065 6d70 7479 structure empty │ │ │ │ +0019e3b0: 2e20 466f 7220 6578 616d 706c 652c 2074 . For example, t │ │ │ │ +0019e3c0: 6865 2057 532d 4164 6472 6573 7369 6e67 he WS-Addressing │ │ │ │ +0019e3d0: 2061 6e64 2057 532d 5365 6375 7269 7479 and WS-Security │ │ │ │ +0019e3e0: 2070 6c75 6769 6e73 2072 6571 7569 7265 plugins require │ │ │ │ +0019e3f0: 2053 4f41 5020 4865 6164 6572 7320 7768 SOAP Headers wh │ │ │ │ +0019e400: 6963 6820 6361 6e20 6265 2069 6d70 6f72 ich can be impor │ │ │ │ +0019e410: 7465 6420 6279 2061 6464 696e 6720 3c63 ted by adding #import "wsa │ │ │ │ +0019e430: 352e 6822 3c2f 636f 6465 3e20 616e 6420 5.h" and │ │ │ │ +0019e440: 3c63 6f64 653e 2369 6d70 6f72 7420 2277 #import "w │ │ │ │ +0019e450: 7373 652e 6822 3c2f 636f 6465 3e2c 2072 sse.h", r │ │ │ │ +0019e460: 6573 7065 6374 6976 656c 7920 746f 203c espectively to < │ │ │ │ +0019e470: 656d 3e3c 636f 6465 3e65 6e76 2e68 3c2f em>env.h. Then │ │ │ │ +0019e490: 2063 6f6d 7069 6c65 2074 6869 7320 6865 compile this he │ │ │ │ +0019e4a0: 6164 6572 2066 696c 6520 7769 7468 3a20 ader file with: │ │ │ │ +0019e4b0: 3c2f 703e 3c70 7265 2063 6c61 7373 3d22

     soapc
    │ │ │ │ +0019e4d0: 7070 3220 2d70 656e 7620 656e 762e 680a  pp2 -penv env.h.
    │ │ │ │ +0019e4e0: 3c2f 7072 653e 3c70 3e20 5468 6520 6765  

    The ge │ │ │ │ +0019e4f0: 6e65 7261 7465 6420 3c65 6d3e 3c63 6f64 nerated envC.cpp file hold │ │ │ │ +0019e520: 7320 7468 6520 534f 4150 2048 6561 6465 s the SOAP Heade │ │ │ │ +0019e530: 7220 616e 6420 4661 756c 7420 7365 7269 r and Fault seri │ │ │ │ +0019e540: 616c 697a 6572 7320 616e 6420 796f 7520 alizers and you │ │ │ │ +0019e550: 6361 6e20 6372 6561 7465 2061 2028 6479 can create a (dy │ │ │ │ +0019e560: 6e61 6d69 6329 206c 6962 7261 7279 2066 namic) library f │ │ │ │ +0019e570: 6f72 2069 7420 746f 206c 696e 6b20 6974 or it to link it │ │ │ │ +0019e580: 2077 6974 6820 796f 7572 2063 6c69 656e with your clien │ │ │ │ +0019e590: 7420 616e 6420 7365 7276 6572 2061 7070 t and server app │ │ │ │ +0019e5a0: 6c69 6361 7469 6f6e 732e 3c2f 703e 0a3c lications.

    .< │ │ │ │ +0019e5b0: 703e 596f 7520 7368 6f75 6c64 2074 6865 p>You should the │ │ │ │ +0019e5c0: 6e20 636f 6d70 696c 6520 7468 6520 3c65 n compile the gsoap/st │ │ │ │ +0019e5e0: 6473 6f61 7032 2e63 7070 3c2f 636f 6465 dsoap2.cpp
    library w │ │ │ │ +0019e600: 6974 6820 7468 6520 636f 6d70 696c 652d ith the compile- │ │ │ │ +0019e610: 7469 6d65 203c 636f 6465 3e23 5749 5448 time #WITH │ │ │ │ +0019e620: 5f4e 4f4e 414d 4553 5041 4345 533c 2f63 _NONAMESPACES flag:

    < │ │ │ │ +0019e640: 7072 6520 636c 6173 733d 2266 7261 676d pre class="fragm │ │ │ │ +0019e650: 656e 7422 3e20 632b 2b20 2d44 5749 5448 ent"> c++ -DWITH │ │ │ │ +0019e660: 5f4e 4f4e 414d 4553 5041 4345 5320 2d63 _NONAMESPACES -c │ │ │ │ +0019e670: 2073 7464 736f 6170 322e 6370 700a 3c2f stdsoap2.cpp.

    This omi │ │ │ │ +0019e690: 7473 2074 6865 2072 6566 6572 656e 6365 ts the reference │ │ │ │ +0019e6a0: 2074 6f20 7468 6520 676c 6f62 616c 206e to the global n │ │ │ │ +0019e6b0: 616d 6573 7061 6365 7320 7461 626c 652c amespaces table, │ │ │ │ +0019e6c0: 2077 6869 6368 2069 7320 6e6f 7768 6572 which is nowher │ │ │ │ +0019e6d0: 6520 746f 2062 6520 6465 6669 6e65 6420 e to be defined │ │ │ │ +0019e6e0: 7369 6e63 6520 7765 2077 696c 6c20 7573 since we will us │ │ │ │ +0019e6f0: 6520 584d 4c20 6e61 6d65 7370 6163 6573 e XML namespaces │ │ │ │ +0019e700: 2066 6f72 2065 6163 6820 636c 6965 6e74 for each client │ │ │ │ +0019e710: 2f73 6572 7669 6365 2073 6570 6172 6174 /service separat │ │ │ │ +0019e720: 656c 792e 2054 6865 7265 666f 7265 2c20 ely. Therefore, │ │ │ │ +0019e730: 796f 7520 6d75 7374 2065 7870 6c69 6369 you must explici │ │ │ │ +0019e740: 746c 7920 7365 7420 7468 6520 6e61 6d65 tly set the name │ │ │ │ +0019e750: 7370 6163 6573 2076 616c 7565 206f 6620 spaces value of │ │ │ │ +0019e760: 7468 6520 3c63 6f64 653e 3c61 2063 6c61 the soap context in │ │ │ │ +0019e7d0: 2079 6f75 7220 636f 6465 2065 7665 7279 your code every │ │ │ │ +0019e7e0: 2074 696d 6520 6166 7465 7220 696e 6974 time after init │ │ │ │ +0019e7f0: 6961 6c69 7a61 7469 6f6e 206f 6620 7468 ialization of th │ │ │ │ +0019e800: 6520 3c63 6f64 653e 3c61 2063 6c61 7373 e soap context with │ │ │ │ +0019e870: 2074 6865 203c 636f 6465 3e3c 6120 636c the soap_ │ │ │ │ +0019e940: 7365 745f 6e61 6d65 7370 6163 6573 2873 set_namespaces(s │ │ │ │ +0019e950: 7472 7563 7420 736f 6170 2a2c 2063 6f6e truct soap*, con │ │ │ │ +0019e960: 7374 2073 7472 7563 7420 4e61 6d65 7370 st struct Namesp │ │ │ │ +0019e970: 6163 652a 293c 2f61 3e3c 2f63 6f64 653e ace*) │ │ │ │ +0019e980: 2066 756e 6374 696f 6e2e 3c2f 703e 0a3c function.

    .< │ │ │ │ +0019e990: 703e 466f 7220 6578 616d 706c 652c 2073 p>For example, s │ │ │ │ +0019e9a0: 7570 706f 7365 2077 6520 6861 7665 2074 uppose we have t │ │ │ │ +0019e9b0: 776f 2063 6c69 656e 7473 2064 6566 696e wo clients defin │ │ │ │ +0019e9c0: 6564 2069 6e20 6865 6164 6572 2066 696c ed in header fil │ │ │ │ +0019e9d0: 6573 203c 656d 3e3c 636f 6465 3e63 6c69 es cli │ │ │ │ +0019e9e0: 656e 7431 2e68 3c2f 636f 6465 3e3c 2f65 ent1.h and client2.h. We first │ │ │ │ +0019ea20: 2067 656e 6572 6174 6520 7468 6520 3c65 generate the envH.h file │ │ │ │ +0019ea50: 666f 7220 7468 6520 534f 4150 2048 6561 for the SOAP Hea │ │ │ │ +0019ea60: 6465 7220 616e 6420 4661 756c 7420 6465 der and Fault de │ │ │ │ +0019ea70: 6669 6e69 7469 6f6e 733a 203c 2f70 3e3c finitions:

    < │ │ │ │ +0019ea80: 7072 6520 636c 6173 733d 2266 7261 676d pre class="fragm │ │ │ │ +0019ea90: 656e 7422 3e20 736f 6170 6370 7032 202d ent"> soapcpp2 - │ │ │ │ +0019eaa0: 6320 2d70 656e 7620 656e 762e 680a 3c2f c -penv env.h.

    Then we │ │ │ │ +0019eac0: 6765 6e65 7261 7465 2074 6865 2063 6f64 generate the cod │ │ │ │ +0019ead0: 6520 666f 7220 636c 6965 6e74 3120 616e e for client1 an │ │ │ │ +0019eae0: 6420 636c 6965 6e74 323a 203c 2f70 3e3c d client2:

    < │ │ │ │ +0019eaf0: 7072 6520 636c 6173 733d 2266 7261 676d pre class="fragm │ │ │ │ +0019eb00: 656e 7422 3e20 736f 6170 6370 7032 202d ent"> soapcpp2 - │ │ │ │ +0019eb10: 6320 2d6e 202d 706d 7943 6c69 656e 7431 c -n -pmyClient1 │ │ │ │ +0019eb20: 2063 6c69 656e 7431 2e68 0a20 736f 6170 client1.h. soap │ │ │ │ +0019eb30: 6370 7032 202d 6320 2d6e 202d 706d 7943 cpp2 -c -n -pmyC │ │ │ │ +0019eb40: 6c69 656e 7432 2063 6c69 656e 7432 2e68 lient2 client2.h │ │ │ │ +0019eb50: 0a3c 2f70 7265 3e3c 703e 2054 6869 7320 .

    This │ │ │ │ +0019eb60: 6765 6e65 7261 7465 7320 3c65 6d3e 3c63 generates myClient1Cli │ │ │ │ +0019eb80: 656e 744c 6962 2e63 3c2f 636f 6465 3e3c entLib.c< │ │ │ │ +0019eb90: 2f65 6d3e 2061 6e64 203c 656d 3e3c 636f /em> and myClient2Clie │ │ │ │ +0019ebb0: 6e74 4c69 622e 633c 2f63 6f64 653e 3c2f ntLib.c (among sever │ │ │ │ +0019ebd0: 616c 206f 7468 6572 2066 696c 6573 292e al other files). │ │ │ │ +0019ebe0: 2054 6865 7365 2074 776f 2066 696c 6573 These two files │ │ │ │ +0019ebf0: 2073 686f 756c 6420 6265 2063 6f6d 7069 should be compi │ │ │ │ +0019ec00: 6c65 6420 616e 6420 6c69 6e6b 6564 2077 led and linked w │ │ │ │ +0019ec10: 6974 6820 796f 7572 2061 7070 6c69 6361 ith your applica │ │ │ │ +0019ec20: 7469 6f6e 2e20 5468 6520 736f 7572 6365 tion. The source │ │ │ │ +0019ec30: 2063 6f64 6520 6f66 2079 6f75 7220 6170 code of your ap │ │ │ │ +0019ec40: 706c 6963 6174 696f 6e20 7368 6f75 6c64 plication should │ │ │ │ +0019ec50: 2069 6e63 6c75 6465 2074 6865 2067 656e include the gen │ │ │ │ +0019ec60: 6572 6174 6564 203c 656d 3e3c 636f 6465 erated envH.h, m │ │ │ │ +0019ec90: 7943 6c69 656e 7431 482e 683c 2f63 6f64 yClient1H.h, myClient2.h files │ │ │ │ +0019ecd0: 2061 6e64 203c 656d 3e3c 636f 6465 3e6d and m │ │ │ │ +0019ece0: 7943 6c69 656e 7431 2e6e 736d 6170 3c2f yClient1.nsmap, │ │ │ │ +0019ed00: 3c63 6f64 653e 6d79 436c 6965 6e74 322e myClient2. │ │ │ │ +0019ed10: 6e73 6d61 703c 2f63 6f64 653e 3c2f 656d nsmap files:

    .
    │ │ │ │ +0019ed70: 2369 6e63 6c75 6465 2026 7175 6f74 3b6d #include "m │ │ │ │ +0019ed80: 7943 6c69 656e 7431 482e 6826 7175 6f74 yClient1H.h" │ │ │ │ +0019ed90: 3b3c 2f73 7061 6e3e 203c 7370 616e 2063 ; / │ │ │ │ +0019edb0: 2f20 696e 636c 7564 6520 636c 6965 6e74 / include client │ │ │ │ +0019edc0: 2031 2073 7475 6273 203c 2f73 7061 6e3e 1 stubs │ │ │ │ +0019edd0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    #include &qu │ │ │ │ +0019ee10: 6f74 3b6d 7943 6c69 656e 7432 482e 6826 ot;myClient2H.h& │ │ │ │ +0019ee20: 7175 6f74 3b3c 2f73 7061 6e3e 203c 7370 quot; // include cl │ │ │ │ +0019ee50: 6965 6e74 2032 2073 7475 6273 203c 2f73 ient 2 stubs
    .
    #include │ │ │ │ +0019eea0: 2026 7175 6f74 3b65 6e76 482e 6826 7175 "envH.h&qu │ │ │ │ +0019eeb0: 6f74 3b3c 2f73 7061 6e3e 203c 2f64 6976 ot;
    .
    ... // │ │ │ │ +0019eef0: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ │ +0019ef10: 3c73 7061 6e20 636c 6173 733d 2270 7265 #incl │ │ │ │ +0019ef30: 7564 6520 2671 756f 743b 6d79 436c 6965 ude "myClie │ │ │ │ +0019ef40: 6e74 3148 2e6e 736d 6170 2671 756f 743b nt1H.nsmap" │ │ │ │ +0019ef50: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c // │ │ │ │ +0019ef70: 2069 6e63 6c75 6465 2063 6c69 656e 7420 include client │ │ │ │ +0019ef80: 3120 6e73 6d61 7020 3c2f 7370 616e 3e3c 1 nsmap < │ │ │ │ +0019ef90: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    #include &quo │ │ │ │ +0019efd0: 743b 6d79 436c 6965 6e74 3248 2e6e 736d t;myClient2H.nsm │ │ │ │ +0019efe0: 6170 2671 756f 743b 3c2f 7370 616e 3e20 ap" │ │ │ │ +0019eff0: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // include │ │ │ │ +0019f010: 2063 6c69 656e 7420 3220 6e73 6d61 7020 client 2 nsmap │ │ │ │ +0019f020: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ │ +0019f040: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    │ │ │ │ +0019f070: 7374 7275 6374 203c 2f73 7061 6e3e 3c61 struct soap *< │ │ │ │ +0019f0b0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +0019f0c0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ +0019f0d0: 6874 6d6c 223e 736f 6170 3c2f 613e 203d html">soap = │ │ │ │ +0019f0e0: 203c 6120 636c 6173 733d 2263 6f64 6522 soap_new();
    .
    soap_set_na │ │ │ │ +0019f1c0: 6d65 7370 6163 6573 3c2f 613e 283c 6120 mespaces(soap, my │ │ │ │ +0019f200: 436c 6965 6e74 315f 6e61 6d65 7370 6163 Client1_namespac │ │ │ │ +0019f210: 6573 293b 203c 2f64 6976 3e0a 3c64 6976 es);
    .
    .. │ │ │ │ +0019f230: 2e20 3c73 7061 6e20 636c 6173 733d 2263 . // make │ │ │ │ +0019f250: 436c 6965 6e74 2031 2069 6e76 6f63 6174 Client 1 invocat │ │ │ │ +0019f260: 696f 6e73 3c2f 7370 616e 3e3c 2f64 6976 ions
    .
    ... // │ │ │ │ +0019f2a0: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ │ +0019f2c0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap_set_ │ │ │ │ +0019f320: 6e61 6d65 7370 6163 6573 3c2f 613e 283c namespaces(< │ │ │ │ +0019f330: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +0019f340: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ +0019f350: 6874 6d6c 223e 736f 6170 3c2f 613e 2c20 html">soap, │ │ │ │ +0019f360: 6d79 436c 6965 6e74 325f 6e61 6d65 7370 myClient2_namesp │ │ │ │ +0019f370: 6163 6573 293b 203c 2f64 6976 3e0a 3c64 aces);
    . │ │ │ │ +0019f390: 2e2e 2e20 3c73 7061 6e20 636c 6173 733d ... // mak │ │ │ │ +0019f3b0: 6520 436c 6965 6e74 2032 2069 6e76 6f63 e Client 2 invoc │ │ │ │ +0019f3c0: 6174 696f 6e73 3c2f 7370 616e 3e3c 2f64 ations.

    It │ │ │ │ +0019f3f0: 2069 7320 696d 706f 7274 616e 7420 746f is important to │ │ │ │ +0019f400: 2075 7365 203c 623e 3c63 6f64 653e 736f use so │ │ │ │ +0019f410: 6170 6370 7032 202d 6e3c 2f63 6f64 653e apcpp2 -n │ │ │ │ +0019f420: 3c2f 623e 206f 7074 696f 6e20 3c62 3e3c option < │ │ │ │ +0019f430: 636f 6465 3e2d 6e3c 2f63 6f64 653e 3c2f code>-n, see Section │ │ │ │ +0019f450: 3c61 2063 6c61 7373 3d22 656c 2220 6872 │ │ │ │ +0019f480: 736f 6170 6370 7032 206f 7074 696f 6e73 soapcpp2 options │ │ │ │ +0019f490: 3c2f 613e 2c20 746f 2072 656e 616d 6520 , to rename │ │ │ │ +0019f4a0: 7468 6520 6e61 6d65 7370 6163 6520 7461 the namespace ta │ │ │ │ +0019f4b0: 626c 6573 2073 6f20 7765 2063 616e 2069 bles so we can i │ │ │ │ +0019f4c0: 6e63 6c75 6465 2074 6865 6d20 616c 6c20 nclude them all │ │ │ │ +0019f4d0: 7769 7468 6f75 7420 7275 6e6e 696e 6720 without running │ │ │ │ +0019f4e0: 696e 746f 2072 6564 6566 696e 6974 696f into redefinitio │ │ │ │ +0019f4f0: 6e73 2e3c 2f70 3e0a 3c64 6c20 636c 6173 ns.

    .
    Note
    Link conflicts │ │ │ │ +0019f530: 206d 6179 2073 7469 6c6c 206f 6363 7572 may still occur │ │ │ │ +0019f540: 2069 6e20 7468 6520 756e 6c69 6b65 6c79 in the unlikely │ │ │ │ +0019f550: 2073 6974 7561 7469 6f6e 2074 6861 7420 situation that │ │ │ │ +0019f560: 6964 656e 7469 6361 6c20 7365 7276 6963 identical servic │ │ │ │ +0019f570: 6520 6f70 6572 6174 696f 6e20 6e61 6d65 e operation name │ │ │ │ +0019f580: 7320 6172 6520 6465 6669 6e65 6420 696e s are defined in │ │ │ │ +0019f590: 2074 776f 206f 7220 6d6f 7265 2073 7475 two or more stu │ │ │ │ +0019f5a0: 6220 6f72 2073 6b65 6c65 746f 6e20 6675 b or skeleton fu │ │ │ │ +0019f5b0: 6e63 7469 6f6e 7320 7768 656e 2074 6865 nctions when the │ │ │ │ +0019f5c0: 7365 206d 6574 686f 6473 2073 6861 7265 se methods share │ │ │ │ +0019f5d0: 2074 6865 2073 616d 6520 584d 4c20 6e61 the same XML na │ │ │ │ +0019f5e0: 6d65 7370 6163 6520 7072 6566 6978 2e3c mespace prefix.< │ │ │ │ +0019f5f0: 2f64 643e 3c2f 646c 3e0a 3c70 3ef0 9f94 /dd>
    .

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

    . │ │ │ │ +0019f630: 3c68 333e 3c61 2063 6c61 7373 3d22 616e

    .C++ ex │ │ │ │ +0019f660: 616d 706c 6573 3c2f 6833 3e0a 3c70 3e41 amples

    .

    A │ │ │ │ +0019f670: 7320 616e 2065 7861 6d70 6c65 2077 6520 s an example we │ │ │ │ +0019f680: 7769 6c6c 2062 7569 6c64 2061 2044 656c will build a Del │ │ │ │ +0019f690: 6179 6564 2053 746f 636b 2051 756f 7465 ayed Stock Quote │ │ │ │ +0019f6a0: 2063 6c69 656e 7420 6c69 6272 6172 7920 client library │ │ │ │ +0019f6b0: 616e 6420 6120 4375 7272 656e 6379 2045 and a Currency E │ │ │ │ +0019f6c0: 7863 6861 6e67 6520 5261 7465 2063 6c69 xchange Rate cli │ │ │ │ +0019f6d0: 656e 7420 6c69 6272 6172 792e 3c2f 703e ent library.

    │ │ │ │ +0019f6e0: 0a3c 703e 4669 7273 742c 2077 6520 6372 .

    First, we cr │ │ │ │ +0019f6f0: 6561 7465 2061 6e20 656d 7074 7920 6865 eate an empty he │ │ │ │ +0019f700: 6164 6572 2066 696c 6520 3c65 6d3e 3c63 ader file env.h │ │ │ │ +0019f720: 3c2f 656d 3e2c 2077 6869 6368 206d 6179 , which may │ │ │ │ +0019f730: 2062 6520 656d 7074 7920 6f72 2073 686f be empty or sho │ │ │ │ +0019f740: 756c 6420 636f 6e74 6169 6e20 534f 4150 uld contain SOAP │ │ │ │ +0019f750: 2048 6561 6465 7220 616e 6420 4661 756c Header and Faul │ │ │ │ +0019f760: 7420 6465 6669 6e69 7469 6f6e 7320 6173 t definitions as │ │ │ │ +0019f770: 2065 7870 6c61 696e 6564 2069 6e20 5365 explained in Se │ │ │ │ +0019f780: 6374 696f 6e20 3c61 2063 6c61 7373 3d22 ction How │ │ │ │ +0019f7b0: 2074 6f20 6372 6561 7465 2063 6c69 656e to create clien │ │ │ │ +0019f7c0: 742f 7365 7276 6572 206c 6962 7261 7269 t/server librari │ │ │ │ +0019f7d0: 6573 3c2f 613e 2c20 616e 6420 636f 6d70 es, and comp │ │ │ │ +0019f7e0: 696c 6520 6974 2061 7320 666f 6c6c 6f77 ile it as follow │ │ │ │ +0019f7f0: 733a 203c 2f70 3e3c 7072 6520 636c 6173 s:

     so
    │ │ │ │ +0019f810: 6170 6370 7032 202d 7065 6e76 2065 6e76  apcpp2 -penv env
    │ │ │ │ +0019f820: 2e68 0a20 632b 2b20 2d63 2065 6e76 432e  .h. c++ -c envC.
    │ │ │ │ +0019f830: 6370 700a 3c2f 7072 653e 3c70 3e20 5765  cpp.

    We │ │ │ │ +0019f840: 2061 6c73 6f20 636f 6d70 696c 6520 3c65 also compile gsoap/st │ │ │ │ +0019f860: 6473 6f61 7032 2e63 7070 3c2f 636f 6465 dsoap2.cpp without n │ │ │ │ +0019f880: 616d 6573 7061 6365 733a 203c 2f70 3e3c amespaces:

    < │ │ │ │ +0019f890: 7072 6520 636c 6173 733d 2266 7261 676d pre class="fragm │ │ │ │ +0019f8a0: 656e 7422 3e20 632b 2b20 2d63 202d 4457 ent"> c++ -c -DW │ │ │ │ +0019f8b0: 4954 485f 4e4f 4e41 4d45 5350 4143 4553 ITH_NONAMESPACES │ │ │ │ +0019f8c0: 2073 7464 736f 6170 322e 6370 700a 3c2f stdsoap2.cpp.

    If you d │ │ │ │ +0019f8e0: 6f20 6e6f 7420 7573 6520 3c63 6f64 653e o not use │ │ │ │ +0019f8f0: 2357 4954 485f 4e4f 4e41 4d45 5350 4143 #WITH_NONAMESPAC │ │ │ │ +0019f900: 4553 3c2f 636f 6465 3e20 7468 656e 2079 ES then y │ │ │ │ +0019f910: 6f75 2077 696c 6c20 6765 7420 616e 2075 ou will get an u │ │ │ │ +0019f920: 6e72 6573 6f6c 7665 6420 6c69 6e6b 2065 nresolved link e │ │ │ │ +0019f930: 7272 6f72 2066 6f72 2074 6865 2067 6c6f rror for the glo │ │ │ │ +0019f940: 6261 6c20 3c63 6f64 653e 6e61 6d65 7370 bal namesp │ │ │ │ +0019f950: 6163 6573 3c2f 636f 6465 3e20 7461 626c aces tabl │ │ │ │ +0019f960: 652e 2059 6f75 2063 616e 2064 6566 696e e. You can defin │ │ │ │ +0019f970: 6520 6120 6475 6d6d 7920 7461 626c 6520 e a dummy table │ │ │ │ +0019f980: 746f 2061 766f 6964 2068 6176 696e 6720 to avoid having │ │ │ │ +0019f990: 746f 2072 6563 6f6d 7069 6c65 203c 656d to recompile gsoap/std │ │ │ │ +0019f9b0: 736f 6170 322e 6370 703c 2f63 6f64 653e soap2.cpp │ │ │ │ +0019f9c0: 3c2f 656d 3e2e 3c2f 703e 0a3c 703e 5365 .

    .

    Se │ │ │ │ +0019f9d0: 636f 6e64 2c20 7765 2063 7265 6174 6520 cond, we create │ │ │ │ +0019f9e0: 7468 6520 4465 6c61 7965 6420 5374 6f63 the Delayed Stoc │ │ │ │ +0019f9f0: 6b20 5175 6f74 6520 6865 6164 6572 2066 k Quote header f │ │ │ │ +0019fa00: 696c 6520 7370 6563 6966 6963 6174 696f ile specificatio │ │ │ │ +0019fa10: 6e2c 2077 6869 6368 206d 6179 2062 6520 n, which may be │ │ │ │ +0019fa20: 6f62 7461 696e 6564 2075 7369 6e67 2074 obtained using t │ │ │ │ +0019fa30: 6865 2057 5344 4c20 696d 706f 7274 6572 he WSDL importer │ │ │ │ +0019fa40: 2e20 4966 2079 6f75 2077 616e 7420 746f . If you want to │ │ │ │ +0019fa50: 2075 7365 2043 2b2b 206e 616d 6573 7061 use C++ namespa │ │ │ │ +0019fa60: 6365 7320 7468 656e 2079 6f75 206e 6565 ces then you nee │ │ │ │ +0019fa70: 6420 746f 206d 616e 7561 6c6c 7920 6164 d to manually ad │ │ │ │ +0019fa80: 6420 7468 6520 3c63 6f64 653e 6e61 6d65 d the name │ │ │ │ +0019fa90: 7370 6163 653c 2f63 6f64 653e 2064 6563 space dec │ │ │ │ +0019faa0: 6c61 7261 7469 6f6e 2074 6f20 7468 6520 laration to the │ │ │ │ +0019fab0: 6765 6e65 7261 7465 6420 6865 6164 6572 generated header │ │ │ │ +0019fac0: 2066 696c 653a 3c2f 703e 0a3c 6469 7620 file:

    .
    namespa │ │ │ │ +0019fb10: 6365 203c 2f73 7061 6e3e 7175 6f74 6520 ce quote │ │ │ │ +0019fb20: 7b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 {
    .
    .
    //gsoa │ │ │ │ +0019fb70: 7020 6e73 2073 6572 7669 6365 206e 616d p ns service nam │ │ │ │ +0019fb80: 653a 2053 6572 7669 6365 203c 2f73 7061 e: Service
    .
    //gsoap ns serv │ │ │ │ +0019fbd0: 6963 6520 7374 796c 653a 2072 7063 203c ice style: rpc < │ │ │ │ +0019fbe0: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    .< │ │ │ │ +0019fc00: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ +0019fc10: 656e 7422 3e2f 2f67 736f 6170 206e 7320 ent">//gsoap ns │ │ │ │ +0019fc20: 7365 7276 6963 6520 656e 636f 6469 6e67 service encoding │ │ │ │ +0019fc30: 3a20 656e 636f 6465 6420 3c2f 7370 616e : encoded
    .
    │ │ │ │ +0019fc70: 2f2f 6773 6f61 7020 6e73 2073 6572 7669 //gsoap ns servi │ │ │ │ +0019fc80: 6365 206c 6f63 6174 696f 6e3a 2068 7474 ce location: htt │ │ │ │ +0019fc90: 703a 2f2f 7365 7276 6963 6573 2e78 6d65 p://services.xme │ │ │ │ +0019fca0: 7468 6f64 732e 6e65 742f 736f 6170 203c thods.net/soap < │ │ │ │ +0019fcb0: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    .< │ │ │ │ +0019fcd0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ +0019fce0: 656e 7422 3e2f 2f67 736f 6170 206e 7320 ent">//gsoap ns │ │ │ │ +0019fcf0: 7363 6865 6d61 206e 616d 6573 7061 6365 schema namespace │ │ │ │ +0019fd00: 3a20 7572 6e3a 786d 6574 686f 6473 2d64 : urn:xmethods-d │ │ │ │ +0019fd10: 656c 6179 6564 2d71 756f 7465 7320 3c2f elayed-quotes
    .
    //gsoap ns s │ │ │ │ +0019fd60: 6572 7669 6365 206d 6574 686f 642d 6163 ervice method-ac │ │ │ │ +0019fd70: 7469 6f6e 3a20 6765 7451 756f 7465 2026 tion: getQuote & │ │ │ │ +0019fd80: 7175 6f74 3b26 7175 6f74 3b20 3c2f 7370 quot;"
    .
    int │ │ │ │ +0019fdd0: 206e 735f 5f67 6574 5175 6f74 6528 3c73 ns__getQuote(char *symbol, float &Result) │ │ │ │ +0019fe40: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
    .
    .
    } // │ │ │ │ +0019fe90: 6e61 6d65 7370 6163 6520 7175 6f74 653c namespace quote< │ │ │ │ +0019fea0: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 2f64 /span>
    .

    We then c │ │ │ │ +0019fed0: 6f6d 7069 6c65 2069 7420 6173 2061 206c ompile it as a l │ │ │ │ +0019fee0: 6962 7261 7279 2061 6e64 2077 6520 7573 ibrary and we us │ │ │ │ +0019fef0: 6520 6f70 7469 6f6e 203c 623e 3c63 6f64 e option -n │ │ │ │ +0019ff10: 746f 2070 7265 6669 7820 7468 6520 6765 to prefix the ge │ │ │ │ +0019ff20: 6e65 7261 7465 6420 6669 6c65 7320 616e nerated files an │ │ │ │ +0019ff30: 6420 746f 2072 656e 616d 6520 7468 6520 d to rename the │ │ │ │ +0019ff40: 6e61 6d65 7370 6163 6520 7461 626c 6520 namespace table │ │ │ │ +0019ff50: 746f 2061 766f 6964 206c 696e 6b20 636f to avoid link co │ │ │ │ +0019ff60: 6e66 6c69 6374 7320 6c61 7465 723a 203c nflicts later: < │ │ │ │ +0019ff70: 2f70 3e3c 7072 6520 636c 6173 733d 2266 /p>

     soapcp
    │ │ │ │ +0019ff90: 7032 202d 6e20 7175 6f74 652e 680a 2063  p2 -n quote.h. c
    │ │ │ │ +0019ffa0: 2b2b 202d 6320 7175 6f74 6543 6c69 656e  ++ -c quoteClien
    │ │ │ │ +0019ffb0: 744c 6962 2e63 7070 0a3c 2f70 7265 3e3c  tLib.cpp.
    < │ │ │ │ +0019ffc0: 703e 2049 6620 796f 7520 646f 6e27 7420 p> If you don't │ │ │ │ +0019ffd0: 7761 6e74 2074 6f20 7573 6520 6120 432b want to use a C+ │ │ │ │ +0019ffe0: 2b20 636f 6465 206e 616d 6573 7061 6365 + code namespace │ │ │ │ +0019fff0: 2c20 796f 7520 7368 6f75 6c64 2063 6f6d , you should com │ │ │ │ +001a0000: 7069 6c65 203c 656d 3e3c 636f 6465 3e71 pile q │ │ │ │ +001a0010: 756f 7465 2e68 3c2f 636f 6465 3e3c 2f65 uote.h "as is" with │ │ │ │ +001a0030: 6f70 7469 6f6e 203c 623e 3c63 6f64 653e option │ │ │ │ +001a0040: 2d70 7175 6f74 653c 2f63 6f64 653e 3c2f -pquote:

     s
    │ │ │ │ +001a0070: 6f61 7063 7070 3220 2d6e 202d 7071 756f  oapcpp2 -n -pquo
    │ │ │ │ +001a0080: 7465 2071 756f 7465 2e68 0a20 632b 2b20  te quote.h. c++ 
    │ │ │ │ +001a0090: 2d63 2071 756f 7465 436c 6965 6e74 4c69  -c quoteClientLi
    │ │ │ │ +001a00a0: 622e 6370 700a 3c2f 7072 653e 3c70 3e20  b.cpp.

    │ │ │ │ +001a00b0: 5468 6972 642c 2077 6520 6372 6561 7465 Third, we create │ │ │ │ +001a00c0: 2074 6865 2043 7572 7265 6e63 7920 4578 the Currency Ex │ │ │ │ +001a00d0: 6368 616e 6765 2052 6174 6520 6865 6164 change Rate head │ │ │ │ +001a00e0: 6572 2066 696c 6520 7370 6563 6966 6963 er file specific │ │ │ │ +001a00f0: 6174 696f 6e3a 3c2f 703e 0a3c 6469 7620 ation:

    .
    namespa │ │ │ │ +001a0140: 6365 203c 2f73 7061 6e3e 7261 7465 207b ce rate { │ │ │ │ +001a0150: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    │ │ │ │ +001a0170: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    //gsoap │ │ │ │ +001a01a0: 206e 7320 7365 7276 6963 6520 6e61 6d65 ns service name │ │ │ │ +001a01b0: 3a20 5365 7276 6963 6520 3c2f 7370 616e : Service
    .
    │ │ │ │ +001a01f0: 2f2f 6773 6f61 7020 6e73 2073 6572 7669 //gsoap ns servi │ │ │ │ +001a0200: 6365 2073 7479 6c65 3a20 7270 6320 3c2f ce style: rpc
    .
    //gsoap ns s │ │ │ │ +001a0250: 6572 7669 6365 2065 6e63 6f64 696e 673a ervice encoding: │ │ │ │ +001a0260: 2065 6e63 6f64 6564 203c 2f73 7061 6e3e encoded │ │ │ │ +001a0270: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    / │ │ │ │ +001a02a0: 2f67 736f 6170 206e 7320 7365 7276 6963 /gsoap ns servic │ │ │ │ +001a02b0: 6520 6c6f 6361 7469 6f6e 3a20 6874 7470 e location: http │ │ │ │ +001a02c0: 3a2f 2f73 6572 7669 6365 732e 786d 6574 ://services.xmet │ │ │ │ +001a02d0: 686f 6473 2e6e 6574 2f73 6f61 7020 3c2f hods.net/soap
    .
    //gsoap ns s │ │ │ │ +001a0320: 6368 656d 6120 6e61 6d65 7370 6163 653a chema namespace: │ │ │ │ +001a0330: 2075 726e 3a78 6d65 7468 6f64 732d 4375 urn:xmethods-Cu │ │ │ │ +001a0340: 7272 656e 6379 4578 6368 616e 6765 203c rrencyExchange < │ │ │ │ +001a0350: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    .< │ │ │ │ +001a0370: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ +001a0380: 656e 7422 3e2f 2f67 736f 6170 206e 7320 ent">//gsoap ns │ │ │ │ +001a0390: 7365 7276 6963 6520 6d65 7468 6f64 2d61 service method-a │ │ │ │ +001a03a0: 6374 696f 6e3a 2067 6574 5261 7465 2026 ction: getRate & │ │ │ │ +001a03b0: 7175 6f74 3b26 7175 6f74 3b20 3c2f 7370 quot;"
    .
    int │ │ │ │ +001a0400: 206e 735f 5f67 6574 5261 7465 283c 7370 ns__getRate(char *country1, char *country2, < │ │ │ │ +001a0470: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +001a0480: 6f72 6474 7970 6522 3e66 6c6f 6174 3c2f ordtype">float &Resul │ │ │ │ +001a04a0: 7429 3b20 3c2f 6469 763e 0a3c 6469 7620 t);
    .
    .
    } / │ │ │ │ +001a04f0: 2f20 6e61 6d65 7370 6163 6520 7261 7465 / namespace rate │ │ │ │ +001a0500: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c2f
    .

    Similar │ │ │ │ +001a0530: 746f 2074 6865 2051 756f 7465 2065 7861 to the Quote exa │ │ │ │ +001a0540: 6d70 6c65 2061 626f 7665 2c20 7765 2067 mple above, we g │ │ │ │ +001a0550: 656e 6572 6174 6520 736f 7572 6365 2063 enerate source c │ │ │ │ +001a0560: 6f64 6520 7573 696e 6720 6f70 7469 6f6e ode using option │ │ │ │ +001a0570: 203c 623e 3c63 6f64 653e 2d6e 3c2f 636f -n to prefi │ │ │ │ +001a0590: 7820 7468 6520 6765 6e65 7261 7465 6420 x the generated │ │ │ │ +001a05a0: 6669 6c65 7320 616e 6420 746f 2072 656e files and to ren │ │ │ │ +001a05b0: 616d 6520 7468 6520 6e61 6d65 7370 6163 ame the namespac │ │ │ │ +001a05c0: 6520 7461 626c 6520 746f 2061 766f 6964 e table to avoid │ │ │ │ +001a05d0: 206c 696e 6b20 636f 6e66 6c69 6374 733a link conflicts: │ │ │ │ +001a05e0: 203c 2f70 3e3c 7072 6520 636c 6173 733d

     soap
    │ │ │ │ +001a0600: 6370 7032 202d 6e20 7261 7465 2e68 0a3c  cpp2 -n rate.h.<
    │ │ │ │ +001a0610: 2f70 7265 3e3c 703e 2046 6f75 7274 682c  /pre>

    Fourth, │ │ │ │ +001a0620: 2077 6520 7573 6520 7468 6520 6765 6e65 we use the gene │ │ │ │ +001a0630: 7261 7465 6420 736f 7572 6365 2063 6f64 rated source cod │ │ │ │ +001a0640: 6520 6c69 6272 6172 6965 7320 7769 7468 e libraries with │ │ │ │ +001a0650: 2074 6865 206d 6169 6e20 7072 6f67 7261 the main progra │ │ │ │ +001a0660: 6d2e 3c2f 703e 0a3c 6469 7620 636c 6173 m.

    .
    < │ │ │ │ +001a0690: 7370 616e 2063 6c61 7373 3d22 7072 6570 span class="prep │ │ │ │ +001a06a0: 726f 6365 7373 6f72 223e 2369 6e63 6c75 rocessor">#inclu │ │ │ │ +001a06b0: 6465 2026 7175 6f74 3b71 756f 7465 482e de "quoteH. │ │ │ │ +001a06c0: 682e 6826 7175 6f74 3b3c 2f73 7061 6e3e h.h" │ │ │ │ +001a06d0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    #include &qu │ │ │ │ +001a0710: 6f74 3b72 6174 6548 2e68 2e68 2671 756f ot;rateH.h.h&quo │ │ │ │ +001a0720: 743b 3c2f 7370 616e 3e3c 2f64 6976 3e0a t;
    . │ │ │ │ +001a0730: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    #in │ │ │ │ +001a0760: 636c 7564 6520 2671 756f 743b 7175 6f74 clude "quot │ │ │ │ +001a0770: 652e 6e73 6d61 7026 7175 6f74 3b3c 2f73 e.nsmap"
    .
    #include │ │ │ │ +001a07c0: 2026 7175 6f74 3b72 6174 652e 6e73 6d61 "rate.nsma │ │ │ │ +001a07d0: 7026 7175 6f74 3b3c 2f73 7061 6e3e 3c2f p".
    .< │ │ │ │ +001a0800: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +001a0810: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >int main(int │ │ │ │ +001a0860: 6172 6763 2c20 3c73 7061 6e20 636c 6173 argc, │ │ │ │ +001a0880: 6368 6172 3c2f 7370 616e 3e20 2a61 7267 char *arg │ │ │ │ +001a0890: 765b 5d29 203c 2f64 6976 3e0a 3c64 6976 v[])
    .
    {< │ │ │ │ +001a08b0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    if (a │ │ │ │ +001a08f0: 7267 6320 266c 743b 3d20 3129 203c 2f64 rgc <= 1) .
    {
    . │ │ │ │ +001a0920: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    std::cerr │ │ │ │ +001a0940: 266c 743b 266c 743b 203c 7370 616e 2063 << "Usage │ │ │ │ +001a0970: 3a20 6d61 696e 2074 6963 6b65 7220 5b63 : main ticker [c │ │ │ │ +001a0980: 7572 7265 6e63 795d 2671 756f 743b 3c2f urrency]" << s │ │ │ │ +001a09a0: 7464 3a3a 656e 646c 203c 2f64 6976 3e0a td::endl
    . │ │ │ │ +001a09b0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    exit(EXIT_ │ │ │ │ +001a09d0: 4641 494c 5552 4529 3b20 3c2f 6469 763e FAILURE);
    │ │ │ │ +001a09e0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    }
    . │ │ │ │ +001a0a10: 2020 3c73 7061 6e20 636c 6173 733d 226b struct < │ │ │ │ +001a0a30: 2f73 7061 6e3e 3c61 2063 6c61 7373 3d22 /span>soa │ │ │ │ +001a0a60: 703c 2f61 3e20 2a3c 6120 636c 6173 733d p *so │ │ │ │ +001a0a90: 6170 3c2f 613e 203d 203c 6120 636c 6173 ap = so │ │ │ │ +001a0af0: 6170 5f6e 6577 3c2f 613e 2829 3b3c 2f64 ap_new();.
    float q │ │ │ │ +001a0b40: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
    .
    soap_set_nam │ │ │ │ +001a0bc0: 6573 7061 6365 733c 2f61 3e28 3c61 2063 espaces(soap, quo │ │ │ │ +001a0c00: 7465 5f6e 616d 6573 7061 6365 7329 3b20 te_namespaces); │ │ │ │ +001a0c10: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    if ( │ │ │ │ +001a0c50: 736f 6170 5f63 616c 6c5f 6e73 5f5f 6765 soap_call_ns__ge │ │ │ │ +001a0c60: 7451 756f 7465 283c 6120 636c 6173 733d tQuote(so │ │ │ │ +001a0c90: 6170 3c2f 613e 2c20 4e55 4c4c 2c20 4e55 ap, NULL, NU │ │ │ │ +001a0ca0: 4c4c 2c20 6172 6776 5b31 5d2c 2071 2929 LL, argv[1], q)) │ │ │ │ +001a0cb0: 203c 7370 616e 2063 6c61 7373 3d22 636f // get qu │ │ │ │ +001a0cd0: 6f74 6520 3c2f 7370 616e 3e3c 2f64 6976 ote
    .
    {
    . │ │ │ │ +001a0d10: 2020 2020 3c61 2063 6c61 7373 3d22 636f soap_prin │ │ │ │ +001a0d70: 745f 6661 756c 743c 2f61 3e28 3c61 2063 t_fault(soap, std │ │ │ │ +001a0db0: 6572 7229 3b20 3c2f 6469 763e 0a3c 6469 err);
    . │ │ │ │ +001a0dd0: 207d 3c2f 6469 763e 0a3c 6469 7620 636c }
    .
    else
    .
    {< │ │ │ │ +001a0e30: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    if │ │ │ │ +001a0e70: 2861 7267 6320 2667 743b 2032 2920 3c2f (argc > 2) .
    {.
    float r;
    .. │ │ │ │ +001a0fd0: 2020 2020 203c 7370 616e 2063 6c61 7373 i │ │ │ │ +001a0ff0: 663c 2f73 7061 6e3e 2028 736f 6170 5f63 f (soap_c │ │ │ │ +001a1000: 616c 6c5f 6e73 5f5f 6765 7452 6174 6528 all_ns__getRate( │ │ │ │ +001a1010: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap, │ │ │ │ +001a1040: 204e 554c 4c2c 204e 554c 4c2c 203c 7370 NULL, NULL, "u │ │ │ │ +001a1070: 7326 7175 6f74 3b3c 2f73 7061 6e3e 2c20 s", │ │ │ │ +001a1080: 6172 6776 5b32 5d2c 2072 2929 203c 7370 argv[2], r)) // get rate i │ │ │ │ +001a10b0: 6e20 5553 2064 6f6c 6c61 7273 203c 2f73 n US dollars
    .
    │ │ │ │ +001a10e0: 2020 2020 203c 6120 636c 6173 733d 2263 soap_pri │ │ │ │ +001a1140: 6e74 5f66 6175 6c74 3c2f 613e 283c 6120 nt_fault(soap, st │ │ │ │ +001a1180: 6465 7272 293b 203c 2f64 6976 3e0a 3c64 derr);
    . │ │ │ │ +001a11a0: 2020 2020 2020 3c73 7061 6e20 636c 6173 │ │ │ │ +001a11c0: 656c 7365 3c2f 7370 616e 3e20 3c2f 6469 else .
    q * │ │ │ │ +001a11f0: 3d20 723b 203c 7370 616e 2063 6c61 7373 = r; // co │ │ │ │ +001a1210: 6e76 6572 7420 7468 6520 7175 6f74 6520 nvert the quote │ │ │ │ +001a1220: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ │ +001a1240: 2020 2020 7d20 3c2f 6469 763e 0a3c 6469 }
    . │ │ │ │ +001a1260: 2020 2073 7464 3a3a 636f 7574 2026 6c74 std::cout < │ │ │ │ +001a1270: 3b26 6c74 3b20 6172 6776 5b31 5d20 266c ;< argv[1] &l │ │ │ │ +001a1280: 743b 266c 743b 203c 7370 616e 2063 6c61 t;< ": " │ │ │ │ +001a12b0: 3b3c 2f73 7061 6e3e 2026 6c74 3b26 6c74 ; << │ │ │ │ +001a12c0: 3b20 7120 266c 743b 266c 743b 2073 7464 ; q << std │ │ │ │ +001a12d0: 3a3a 656e 646c 3b20 3c2f 6469 763e 0a3c ::endl;
    .< │ │ │ │ +001a12e0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +001a12f0: 3e20 207d 203c 2f64 6976 3e0a 3c64 6976 > }
    .. │ │ │ │ +001a13c0: 2020 3c61 2063 6c61 7373 3d22 636f 6465 soap_end< │ │ │ │ +001a1420: 2f61 3e28 3c61 2063 6c61 7373 3d22 636f /a>(soap< │ │ │ │ +001a1450: 2f61 3e29 3b3c 2f64 6976 3e0a 3c64 6976 /a>);
    ..
    < │ │ │ │ +001a1520: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +001a1530: 6f72 6466 6c6f 7722 3e72 6574 7572 6e3c ordflow">return< │ │ │ │ +001a1540: 2f73 7061 6e3e 2030 3b20 3c2f 6469 763e /span> 0;
    │ │ │ │ +001a1550: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    }
    .

    │ │ │ │ +001a1dd0: 5765 2067 656e 6572 6174 6520 636f 6465 We generate code │ │ │ │ +001a1de0: 3a20 3c2f 703e 3c70 7265 2063 6c61 7373 :

     soa
    │ │ │ │ +001a1e00: 7063 7070 3220 2d6a 202d 6e20 6361 6c63  pcpp2 -j -n calc
    │ │ │ │ +001a1e10: 2e68 0a3c 2f70 7265 3e3c 703e 2048 6572  .h.

    Her │ │ │ │ +001a1e20: 6520 7765 2075 7365 6420 6f70 7469 6f6e e we used option │ │ │ │ +001a1e30: 203c 623e 3c63 6f64 653e 2d6a 3c2f 636f -j to gener │ │ │ │ +001a1e50: 6174 6520 6120 432b 2b20 7365 7276 6963 ate a C++ servic │ │ │ │ +001a1e60: 6520 636c 6173 7320 3c65 6d3e 3c63 6f64 e class calcCalcServic │ │ │ │ +001a1e80: 652e 683c 2f63 6f64 653e 3c2f 656d 3e20 e.h │ │ │ │ +001a1e90: 616e 6420 3c65 6d3e 3c63 6f64 653e 6361 and ca │ │ │ │ +001a1ea0: 6c63 4361 6c63 5365 7276 6963 652e 6370 lcCalcService.cp │ │ │ │ +001a1eb0: 703c 2f63 6f64 653e 3c2f 656d 3e2e 2054 p. T │ │ │ │ +001a1ec0: 6865 2065 6666 6563 7420 6f66 2074 6865 he effect of the │ │ │ │ +001a1ed0: 203c 623e 3c63 6f64 653e 2d6e 3c2f 636f -n option i │ │ │ │ +001a1ef0: 7320 7468 6174 2069 7420 6372 6561 7465 s that it create │ │ │ │ +001a1f00: 7320 6c6f 6361 6c20 6e61 6d65 7370 6163 s local namespac │ │ │ │ +001a1f10: 6520 7461 626c 6573 2061 6e64 2075 7365 e tables and use │ │ │ │ +001a1f20: 7320 3c65 6d3e 3c63 6f64 653e 6361 6c63 s calc │ │ │ │ +001a1f30: 3c2f 636f 6465 3e3c 2f65 6d3e 2074 6f20 to │ │ │ │ +001a1f40: 7072 6566 6978 2074 6865 2067 656e 6572 prefix the gener │ │ │ │ +001a1f50: 6174 6564 2066 696c 6573 2e3c 2f70 3e0a ated files.

    . │ │ │ │ +001a1f60: 3c64 6976 2063 6c61 7373 3d22 6672 6167
    #include &quo │ │ │ │ +001a1fb0: 743b 6361 6c63 4361 6c63 5365 7276 6963 t;calcCalcServic │ │ │ │ +001a1fc0: 652e 6826 7175 6f74 3b3c 2f73 7061 6e3e e.h" │ │ │ │ +001a1fd0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    #include &qu │ │ │ │ +001a2010: 6f74 3b63 616c 632e 6e73 6d61 7026 7175 ot;calc.nsmap&qu │ │ │ │ +001a2020: 6f74 3b3c 2f73 7061 6e3e 3c2f 6469 763e ot;
    │ │ │ │ +001a2030: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    .
    int main()
    .< │ │ │ │ +001a2090: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +001a20a0: 3e7b 3c2f 6469 763e 0a3c 6469 7620 636c >{
    .
    cal │ │ │ │ +001a20c0: 633a 3a43 616c 6320 6361 6c63 3b20 3c2f c::Calc calc; .
    ... //.
    calc.serv │ │ │ │ +001a2130: 6528 293b 203c 7370 616e 2063 6c61 7373 e(); // ca │ │ │ │ +001a2150: 6c6c 7320 7265 7175 6573 7420 6469 7370 lls request disp │ │ │ │ +001a2160: 6174 6368 6572 2074 6f20 696e 766f 6b65 atcher to invoke │ │ │ │ +001a2170: 206f 6e65 206f 6620 7468 6520 6675 6e63 one of the func │ │ │ │ +001a2180: 7469 6f6e 7320 6265 6c6f 7720 3c2f 7370 tions below
    .
    .. │ │ │ │ +001a21b0: 2e20 3c73 7061 6e20 636c 6173 733d 2263 . //
    .
    }
    .
    .
    int calc::Calc::a │ │ │ │ +001a2250: 6464 283c 7370 616e 2063 6c61 7373 3d22 dd(dou │ │ │ │ +001a2270: 626c 653c 2f73 7061 6e3e 2061 2c20 3c73 ble a, double b, double │ │ │ │ +001a22d0: 2026 616d 703b 7265 7375 6c74 293c 2f64 &result).
    {
    . │ │ │ │ +001a2310: 2020 7265 7375 6c74 203d 2061 202b 2062 result = a + b │ │ │ │ +001a2320: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
    .
    ..
    .
    │ │ │ │ +001a2620: 696e 743c 2f73 7061 6e3e 2063 616c 633a int calc: │ │ │ │ +001a2630: 3a43 616c 633a 3a6d 756c 283c 7370 616e :Calc::mul(double a, │ │ │ │ +001a2680: 646f 7562 6c65 3c2f 7370 616e 3e20 622c double b, │ │ │ │ +001a2690: 203c 7370 616e 2063 6c61 7373 3d22 6b65 doubl │ │ │ │ +001a26b0: 653c 2f73 7061 6e3e 2026 616d 703b 7265 e &re │ │ │ │ +001a26c0: 7375 6c74 293c 2f64 6976 3e0a 3c64 6976 sult)
    .
    {< │ │ │ │ +001a26e0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    result │ │ │ │ +001a2700: 203d 2061 202a 2062 3b3c 2f64 6976 3e0a = a * b;
    . │ │ │ │ +001a2710: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    re │ │ │ │ +001a2740: 7475 726e 3c2f 7370 616e 3e20 3c61 2063 turn │ │ │ │ +001a27a0: 534f 4150 5f4f 4b3c 2f61 3e3b 3c2f 6469 SOAP_OK;.
    }
    . │ │ │ │ +001a27e0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    int c │ │ │ │ +001a2820: 616c 633a 3a43 616c 633a 3a64 6976 283c alc::Calc::div(< │ │ │ │ +001a2830: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +001a2840: 6f72 6474 7970 6522 3e64 6f75 626c 653c ordtype">double< │ │ │ │ +001a2850: 2f73 7061 6e3e 2061 2c20 3c73 7061 6e20 /span> a, double b, d │ │ │ │ +001a28a0: 6f75 626c 653c 2f73 7061 6e3e 2026 616d ouble &am │ │ │ │ +001a28b0: 703b 7265 7375 6c74 293c 2f64 6976 3e0a p;result)
    . │ │ │ │ +001a28c0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    {
    .
    re │ │ │ │ +001a28f0: 7375 6c74 203d 2061 202f 2062 3b3c 2f64 sult = a / b;.
    return │ │ │ │ +001a2940: 3c61 2063 6c61 7373 3d22 636f 6465 2220 SOAP_OK; │ │ │ │ +001a29a0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    }
    .

    The │ │ │ │ +001a29e0: 6578 616d 706c 6520 6162 6f76 6520 7365 example above se │ │ │ │ +001a29f0: 7276 6573 2072 6571 7565 7374 7320 6f76 rves requests ov │ │ │ │ +001a2a00: 6572 2073 7464 696e 2f6f 7574 2e20 5573 er stdin/out. Us │ │ │ │ +001a2a10: 6520 7468 6520 6269 6e64 2061 6e64 2061 e the bind and a │ │ │ │ +001a2a20: 6363 6570 7420 6361 6c6c 7320 746f 2063 ccept calls to c │ │ │ │ +001a2a30: 7265 6174 6520 6120 7374 616e 642d 616c reate a stand-al │ │ │ │ +001a2a40: 6f6e 6520 7365 7276 6572 2074 6f20 7365 one server to se │ │ │ │ +001a2a50: 7276 6963 6520 696e 626f 756e 6420 7265 rvice inbound re │ │ │ │ +001a2a60: 7175 6573 7473 206f 7665 7220 736f 636b quests over sock │ │ │ │ +001a2a70: 6574 732c 2073 6565 2053 6563 7469 6f6e ets, see Section │ │ │ │ +001a2a80: 203c 6120 636c 6173 733d 2265 6c22 2068 How │ │ │ │ +001a2ab0: 2074 6f20 6372 6561 7465 2061 2073 7461 to create a sta │ │ │ │ +001a2ac0: 6e64 2d61 6c6f 6e65 2073 6572 7665 723c nd-alone server< │ │ │ │ +001a2ad0: 2f61 3e20 2e3c 2f70 3e0a 3c70 3ef0 9f94 /a> .

    .

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

    . │ │ │ │ +001a2b10: 3c68 333e 3c61 2063 6c61 7373 3d22 616e

    .C exam │ │ │ │ +001a2b40: 706c 6573 3c2f 6833 3e0a 3c70 3e54 6869 ples

    .

    Thi │ │ │ │ +001a2b50: 7320 6973 2074 6865 2073 616d 6520 6578 s is the same ex │ │ │ │ +001a2b60: 616d 706c 6520 6173 2061 626f 7665 2c20 ample as above, │ │ │ │ +001a2b70: 6275 7420 7468 6520 636c 6965 6e74 7320 but the clients │ │ │ │ +001a2b80: 6172 6520 6275 696c 6420 696e 2043 2e3c are build in C.< │ │ │ │ +001a2b90: 2f70 3e0a 3c70 3e57 6520 6372 6561 7465 /p>.

    We create │ │ │ │ +001a2ba0: 2061 203c 656d 3e3c 636f 6465 3e65 6e76 a env │ │ │ │ +001a2bb0: 2e68 3c2f 636f 6465 3e3c 2f65 6d3e 2074 .h t │ │ │ │ +001a2bc0: 6861 7420 636f 6e74 6169 6e73 2074 6865 hat contains the │ │ │ │ +001a2bd0: 206a 6f69 6e74 2053 4f41 5020 4865 6164 joint SOAP Head │ │ │ │ +001a2be0: 6572 2061 6e64 2053 4f41 5020 4661 756c er and SOAP Faul │ │ │ │ +001a2bf0: 7420 6465 6669 6e69 7469 6f6e 732e 2059 t definitions. Y │ │ │ │ +001a2c00: 6f75 206d 6179 2068 6176 6520 746f 2063 ou may have to c │ │ │ │ +001a2c10: 6f70 792d 7061 7374 6520 7468 6573 6520 opy-paste these │ │ │ │ +001a2c20: 6672 6f6d 2074 6865 206f 7468 6572 2068 from the other h │ │ │ │ +001a2c30: 6561 6465 7220 6669 6c65 732e 2054 6865 eader files. The │ │ │ │ +001a2c40: 6e2c 2063 6f6d 7069 6c65 2069 7420 6173 n, compile it as │ │ │ │ +001a2c50: 2066 6f6c 6c6f 7773 3a20 3c2f 703e 3c70 follows:

    soapcpp2 -c │ │ │ │ +001a2c80: 202d 7065 6e76 2065 6e76 2e68 0a20 6363 -penv env.h. cc │ │ │ │ +001a2c90: 202d 6320 656e 7643 2e63 0a3c 2f70 7265 -c envC.c.

    We also com │ │ │ │ +001a2cb0: 7069 6c65 203c 656d 3e3c 636f 6465 3e67 pile g │ │ │ │ +001a2cc0: 736f 6170 2f73 7464 736f 6170 322e 633c soap/stdsoap2.c< │ │ │ │ +001a2cd0: 2f63 6f64 653e 3c2f 656d 3e20 7769 7468 /code> with │ │ │ │ +001a2ce0: 6f75 7420 6e61 6d65 7370 6163 6573 3a20 out namespaces: │ │ │ │ +001a2cf0: 3c2f 703e 3c70 7265 2063 6c61 7373 3d22

     cc -c
    │ │ │ │ +001a2d10: 202d 4457 4954 485f 4e4f 4e41 4d45 5350   -DWITH_NONAMESP
    │ │ │ │ +001a2d20: 4143 4553 2073 7464 736f 6170 322e 630a  ACES stdsoap2.c.
    │ │ │ │ +001a2d30: 3c2f 7072 653e 3c70 3e20 5365 636f 6e64  

    Second │ │ │ │ +001a2d40: 2c20 7765 2063 7265 6174 6520 7468 6520 , we create the │ │ │ │ +001a2d50: 4465 6c61 7965 6420 5374 6f63 6b20 5175 Delayed Stock Qu │ │ │ │ +001a2d60: 6f74 6520 6865 6164 6572 2066 696c 6520 ote header file │ │ │ │ +001a2d70: 7370 6563 6966 6963 6174 696f 6e2c 2077 specification, w │ │ │ │ +001a2d80: 6869 6368 206d 6179 2062 6520 6f62 7461 hich may be obta │ │ │ │ +001a2d90: 696e 6564 2075 7369 6e67 2074 6865 2057 ined using the W │ │ │ │ +001a2da0: 5344 4c20 696d 706f 7274 6572 2e3c 2f70 SDL importer.

    .
    │ │ │ │ +001a2df0: 2f2f 6773 6f61 7020 6e73 2073 6572 7669 //gsoap ns servi │ │ │ │ +001a2e00: 6365 206e 616d 653a 2053 6572 7669 6365 ce name: Service │ │ │ │ +001a2e10: 203c 2f73 7061 6e3e 3c2f 6469 763e 0a3c
    .< │ │ │ │ +001a2e20: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +001a2e30: 3e3c 7370 616e 2063 6c61 7373 3d22 636f >//gsoap n │ │ │ │ +001a2e50: 7320 7365 7276 6963 6520 7374 796c 653a s service style: │ │ │ │ +001a2e60: 2072 7063 203c 2f73 7061 6e3e 3c2f 6469 rpc .
    //gso │ │ │ │ +001a2ea0: 6170 206e 7320 7365 7276 6963 6520 656e ap ns service en │ │ │ │ +001a2eb0: 636f 6469 6e67 3a20 656e 636f 6465 6420 coding: encoded │ │ │ │ +001a2ec0: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ │ +001a2ee0: 3c73 7061 6e20 636c 6173 733d 2263 6f6d //gsoap ns │ │ │ │ +001a2f00: 2073 6572 7669 6365 206c 6f63 6174 696f service locatio │ │ │ │ +001a2f10: 6e3a 2068 7474 703a 2f2f 7365 7276 6963 n: http://servic │ │ │ │ +001a2f20: 6573 2e78 6d65 7468 6f64 732e 6e65 742f es.xmethods.net/ │ │ │ │ +001a2f30: 736f 6170 203c 2f73 7061 6e3e 3c2f 6469 soap .
    //gso │ │ │ │ +001a2f70: 6170 206e 7320 7363 6865 6d61 206e 616d ap ns schema nam │ │ │ │ +001a2f80: 6573 7061 6365 3a20 7572 6e3a 786d 6574 espace: urn:xmet │ │ │ │ +001a2f90: 686f 6473 2d64 656c 6179 6564 2d71 756f hods-delayed-quo │ │ │ │ +001a2fa0: 7465 7320 3c2f 7370 616e 3e3c 2f64 6976 tes
    .
    //gsoa │ │ │ │ +001a2fe0: 7020 6e73 2073 6572 7669 6365 206d 6574 p ns service met │ │ │ │ +001a2ff0: 686f 642d 6163 7469 6f6e 3a20 6765 7451 hod-action: getQ │ │ │ │ +001a3000: 756f 7465 2026 7175 6f74 3b26 7175 6f74 uote "" │ │ │ │ +001a3010: 3b20 3c2f 7370 616e 3e3c 2f64 6976 3e0a ;
    . │ │ │ │ +001a3020: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    int< │ │ │ │ +001a3050: 2f73 7061 6e3e 206e 735f 5f67 6574 5175 /span> ns__getQu │ │ │ │ +001a3060: 6f74 6528 3c73 7061 6e20 636c 6173 733d ote(ch │ │ │ │ +001a3080: 6172 3c2f 7370 616e 3e20 2a73 796d 626f ar *symbo │ │ │ │ +001a3090: 6c2c 203c 7370 616e 2063 6c61 7373 3d22 l, flo │ │ │ │ +001a30b0: 6174 3c2f 7370 616e 3e20 2a52 6573 756c at *Resul │ │ │ │ +001a30c0: 7429 3b3c 2f64 6976 3e0a 3c2f 6469 763e t);
    .
    │ │ │ │ +001a30d0: 3c21 2d2d 2066 7261 676d 656e 7420 2d2d

    We │ │ │ │ +001a35b0: 2063 6f6d 7069 6c65 2069 7420 6173 2061 compile it as a │ │ │ │ +001a35c0: 206c 6962 7261 7279 2061 6e64 2077 6520 library and we │ │ │ │ +001a35d0: 7573 6520 6f70 7469 6f6e 7320 3c62 3e3c use options < │ │ │ │ +001a35e0: 636f 6465 3e2d 6e3c 2f63 6f64 653e 3c2f code>-n and │ │ │ │ +001a3600: 2d70 7261 7465 3c2f 636f 6465 3e3c 2f62 -prate to prefix the │ │ │ │ +001a3620: 6765 6e65 7261 7465 6420 6669 6c65 7320 generated files │ │ │ │ +001a3630: 616e 6420 746f 2072 656e 616d 6520 7468 and to rename th │ │ │ │ +001a3640: 6520 6e61 6d65 7370 6163 6520 7461 626c e namespace tabl │ │ │ │ +001a3650: 6520 746f 2061 766f 6964 206c 696e 6b20 e to avoid link │ │ │ │ +001a3660: 636f 6e66 6c69 6374 733a 203c 2f70 3e3c conflicts:

    < │ │ │ │ +001a3670: 7072 6520 636c 6173 733d 2266 7261 676d pre class="fragm │ │ │ │ +001a3680: 656e 7422 3e20 736f 6170 6370 7032 202d ent"> soapcpp2 - │ │ │ │ +001a3690: 6320 2d6e 202d 7072 6174 6520 7261 7465 c -n -prate rate │ │ │ │ +001a36a0: 2e68 0a20 6363 202d 6320 7261 7465 436c .h. cc -c rateCl │ │ │ │ +001a36b0: 6965 6e74 4c69 622e 630a 3c2f 7072 653e ientLib.c. │ │ │ │ +001a36c0: 3c70 3e20 5468 6520 6d61 696e 2070 726f

    The main pro │ │ │ │ +001a36d0: 6772 616d 2069 733a 3c2f 703e 0a3c 6469 gram is:

    .
    │ │ │ │ +001a3720: 2369 6e63 6c75 6465 2026 7175 6f74 3b71 #include "q │ │ │ │ +001a3730: 756f 7465 482e 6826 7175 6f74 3b3c 2f73 uoteH.h"
    .
    #include │ │ │ │ +001a3780: 2026 7175 6f74 3b72 6174 6548 2e68 2671 "rateH.h&q │ │ │ │ +001a3790: 756f 743b 3c2f 7370 616e 3e3c 2f64 6976 uot;
    .
    # │ │ │ │ +001a37d0: 696e 636c 7564 6520 2671 756f 743b 7175 include "qu │ │ │ │ +001a37e0: 6f74 652e 6e73 6d61 7026 7175 6f74 3b3c ote.nsmap"< │ │ │ │ +001a37f0: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    .< │ │ │ │ +001a3810: 7370 616e 2063 6c61 7373 3d22 7072 6570 span class="prep │ │ │ │ +001a3820: 726f 6365 7373 6f72 223e 2369 6e63 6c75 rocessor">#inclu │ │ │ │ +001a3830: 6465 2026 7175 6f74 3b72 6174 652e 6e73 de "rate.ns │ │ │ │ +001a3840: 6d61 7026 7175 6f74 3b3c 2f73 7061 6e3e map" │ │ │ │ +001a3850: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    │ │ │ │ +001a3870: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    int │ │ │ │ +001a38a0: 3c2f 7370 616e 3e20 6d61 696e 283c 7370 main(int argc, char *a │ │ │ │ +001a3900: 7267 765b 5d29 203c 2f64 6976 3e0a 3c64 rgv[])
    . │ │ │ │ +001a3920: 7b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 {
    .
    if │ │ │ │ +001a3960: 2861 7267 6320 266c 743b 3d20 3129 203c (argc <= 1) < │ │ │ │ +001a3970: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    {
    .
    fprintf( │ │ │ │ +001a39b0: 7374 6465 7272 2c20 3c73 7061 6e20 636c stderr, "Usage: │ │ │ │ +001a39e0: 206d 6169 6e20 7469 636b 6572 205b 6375 main ticker [cu │ │ │ │ +001a39f0: 7272 656e 6379 5d5c 6e26 7175 6f74 3b3c rrency]\n"< │ │ │ │ +001a3a00: 2f73 7061 6e3e 293b 203c 2f64 6976 3e0a /span>);
    . │ │ │ │ +001a3a10: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    exit(EXIT_ │ │ │ │ +001a3a30: 4641 494c 5552 4529 3b20 3c2f 6469 763e FAILURE);
    │ │ │ │ +001a3a40: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    }
    . │ │ │ │ +001a3a70: 2020 3c73 7061 6e20 636c 6173 733d 226b struct < │ │ │ │ +001a3a90: 2f73 7061 6e3e 3c61 2063 6c61 7373 3d22 /span>soa │ │ │ │ +001a3ac0: 703c 2f61 3e20 2a3c 6120 636c 6173 733d p *so │ │ │ │ +001a3af0: 6170 3c2f 613e 203d 203c 6120 636c 6173 ap = so │ │ │ │ +001a3b50: 6170 5f6e 6577 3c2f 613e 2829 3b20 3c2f ap_new(); .
    float │ │ │ │ +001a3ba0: 713b 203c 2f64 6976 3e0a 3c64 6976 2063 q;
    .
    soap_set_na │ │ │ │ +001a3c20: 6d65 7370 6163 6573 3c2f 613e 283c 6120 mespaces(soap, qu │ │ │ │ +001a3c60: 6f74 655f 6e61 6d65 7370 6163 6573 293b ote_namespaces); │ │ │ │ +001a3c70: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    if │ │ │ │ +001a3cb0: 2873 6f61 705f 6361 6c6c 5f6e 735f 5f67 (soap_call_ns__g │ │ │ │ +001a3cc0: 6574 5175 6f74 6528 3c61 2063 6c61 7373 etQuote(s │ │ │ │ +001a3cf0: 6f61 703c 2f61 3e2c 204e 554c 4c2c 204e oap, NULL, N │ │ │ │ +001a3d00: 554c 4c2c 2061 7267 765b 315d 2c20 2661 ULL, argv[1], &a │ │ │ │ +001a3d10: 6d70 3b71 2929 203c 7370 616e 2063 6c61 mp;q)) // │ │ │ │ +001a3d30: 6765 7420 7175 6f74 6520 3c2f 7370 616e get quote
    ..
    else │ │ │ │ +001a3e40: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    {.
    if (a │ │ │ │ +001a3ea0: 7267 6320 2667 743b 2032 2920 3c2f 6469 rgc > 2) .
    {
    │ │ │ │ +001a3ed0: 0a3c 6469 7620 636c 6173 733d 226c 696e ..
    float │ │ │ │ +001a3fe0: 2072 3b20 3c2f 6469 763e 0a3c 6469 7620 r;
    .
    │ │ │ │ +001a4000: 2020 203c 7370 616e 2063 6c61 7373 3d22 if< │ │ │ │ +001a4020: 2f73 7061 6e3e 2028 736f 6170 5f63 616c /span> (soap_cal │ │ │ │ +001a4030: 6c5f 6e73 5f5f 6765 7452 6174 6528 3c61 l_ns__getRate(soap, N │ │ │ │ +001a4070: 554c 4c2c 204e 554c 4c2c 203c 7370 616e ULL, NULL, "us& │ │ │ │ +001a40a0: 7175 6f74 3b3c 2f73 7061 6e3e 2c20 6172 quot;, ar │ │ │ │ +001a40b0: 6776 5b32 5d2c 2026 616d 703b 7229 2920 gv[2], &r)) │ │ │ │ +001a40c0: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // get rat │ │ │ │ +001a40e0: 6520 696e 2055 5320 646f 6c6c 6172 7320 e in US dollars │ │ │ │ +001a40f0: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ │ +001a4110: 2020 2020 2020 2020 3c61 2063 6c61 7373 soap_ │ │ │ │ +001a4170: 7072 696e 745f 6661 756c 743c 2f61 3e28 print_fault( │ │ │ │ +001a4180: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap, │ │ │ │ +001a41b0: 2073 7464 6572 7229 3b20 3c2f 6469 763e stderr);
    │ │ │ │ +001a41c0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    else < │ │ │ │ +001a4200: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    │ │ │ │ +001a4220: 7120 2a3d 2072 3b20 3c73 7061 6e20 636c q *= r; // │ │ │ │ +001a4240: 2063 6f6e 7665 7274 2074 6865 2071 756f convert the quo │ │ │ │ +001a4250: 7465 203c 2f73 7061 6e3e 3c2f 6469 763e te
    │ │ │ │ +001a4260: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    }
    . │ │ │ │ +001a4280: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    printf("% │ │ │ │ +001a42c0: 733a 2025 6620 5c6e 2671 756f 743b 3c2f s: %f \n", argv[1], │ │ │ │ +001a42e0: 7129 3b20 3c2f 6469 763e 0a3c 6469 7620 q);
    .
    } │ │ │ │ +001a4300: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    ..
    soap_end( │ │ │ │ +001a4430: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap) │ │ │ │ +001a4460: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
    .
    soap_free(< │ │ │ │ +001a44e0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +001a44f0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ +001a4500: 6874 6d6c 223e 736f 6170 3c2f 613e 293b html">soap); │ │ │ │ +001a4510: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    return 0;
    .} │ │ │ │ +001a4570: 3c2f 6469 763e 0a3c 2f64 6976 3e3c 212d
    .

    Compile and lin │ │ │ │ +001a45a0: 6b20 7468 6973 2061 7070 6c69 6361 7469 k this applicati │ │ │ │ +001a45b0: 6f6e 2077 6974 6820 3c65 6d3e 3c63 6f64 on with stdsoap2.o, envC.o, quoteClientLib │ │ │ │ +001a4610: 2e6f 3c2f 636f 6465 3e3c 2f65 6d3e 2c20 .o, │ │ │ │ +001a4620: 616e 6420 3c65 6d3e 3c63 6f64 653e 7261 and ra │ │ │ │ +001a4630: 7465 436c 6965 6e74 4c69 622e 6f3c 2f63 teClientLib.o.

    .< │ │ │ │ +001a4650: 703e f09f 949d 203c 6120 6872 6566 3d22 p>.... Back to table │ │ │ │ +001a4670: 206f 6620 636f 6e74 656e 7473 3c2f 613e of contents │ │ │ │ +001a4680: 3c2f 703e 0a3c 6833 3e3c 6120 636c 6173

    .

    .H │ │ │ │ +001a46b0: 6f77 2074 6f20 6368 6169 6e20 4320 7365 ow to chain C se │ │ │ │ +001a46c0: 7276 6963 6573 2074 6f20 6163 6365 7074 rvices to accept │ │ │ │ +001a46d0: 206d 6573 7361 6765 7320 6f6e 2074 6865 messages on the │ │ │ │ +001a46e0: 2073 616d 6520 706f 7274 3c2f 6833 3e0a same port

    . │ │ │ │ +001a46f0: 3c70 3e57 6865 6e20 636f 6d62 696e 696e

    When combinin │ │ │ │ +001a4700: 6720 6d75 6c74 6970 6c65 2073 6572 7669 g multiple servi │ │ │ │ +001a4710: 6365 7320 696e 746f 206f 6e65 2061 7070 ces into one app │ │ │ │ +001a4720: 6c69 6361 7469 6f6e 2c20 796f 7520 6361 lication, you ca │ │ │ │ +001a4730: 6e20 7275 6e20 7773 646c 3268 206f 6e20 n run wsdl2h on │ │ │ │ +001a4740: 6d75 6c74 6970 6c65 2057 5344 4c73 2074 multiple WSDLs t │ │ │ │ +001a4750: 6f20 6765 6e65 7261 7465 2074 6865 2073 o generate the s │ │ │ │ +001a4760: 696e 676c 6520 616c 6c2d 696e 636c 7573 ingle all-inclus │ │ │ │ +001a4770: 6976 6520 7365 7276 6963 6520 6465 6669 ive service defi │ │ │ │ +001a4780: 6e69 7469 6f6e 7320 696e 7465 7266 6163 nitions interfac │ │ │ │ +001a4790: 6520 6865 6164 6572 2066 696c 6520 666f e header file fo │ │ │ │ +001a47a0: 7220 736f 6170 6370 7032 2e20 5468 6973 r soapcpp2. This │ │ │ │ +001a47b0: 2068 6561 6465 7220 6669 6c65 2069 7320 header file is │ │ │ │ +001a47c0: 7468 656e 2070 726f 6365 7373 6564 2077 then processed w │ │ │ │ +001a47d0: 6974 6820 736f 6170 6370 7032 2074 6f20 ith soapcpp2 to │ │ │ │ +001a47e0: 6765 6e65 7261 7465 2073 6b65 6c65 746f generate skeleto │ │ │ │ +001a47f0: 6e20 6675 6e63 7469 6f6e 7320 696e 2043 n functions in C │ │ │ │ +001a4800: 2e3c 2f70 3e0a 3c70 3e57 6861 7420 6966 .

    .

    What if │ │ │ │ +001a4810: 2077 6520 6765 6e65 7261 7465 206d 756c we generate mul │ │ │ │ +001a4820: 7469 706c 6520 7365 7276 6963 6573 2c20 tiple services, │ │ │ │ +001a4830: 6561 6368 2066 726f 6d20 6120 5753 444c each from a WSDL │ │ │ │ +001a4840: 2073 6570 6172 6174 656c 792c 2061 6e64 separately, and │ │ │ │ +001a4850: 2077 616e 7420 746f 2064 6570 6c6f 7920 want to deploy │ │ │ │ +001a4860: 7468 656d 206f 6e20 7468 6520 7361 6d65 them on the same │ │ │ │ +001a4870: 2070 6f72 743f 2054 6869 7320 7265 7175 port? This requ │ │ │ │ +001a4880: 6972 6573 206c 6973 7465 6e69 6e67 2074 ires listening t │ │ │ │ +001a4890: 6f20 7468 6520 7361 6d65 2070 6f72 7420 o the same port │ │ │ │ +001a48a0: 616e 6420 7468 656e 2063 6861 696e 696e and then chainin │ │ │ │ +001a48b0: 6720 7468 6520 7365 7276 6963 6520 6469 g the service di │ │ │ │ +001a48c0: 7370 6174 6368 6573 2073 6f20 7468 6174 spatches so that │ │ │ │ +001a48d0: 2065 6163 6820 7365 7276 6963 6520 6361 each service ca │ │ │ │ +001a48e0: 6e20 7365 7276 6520 6120 7265 7175 6573 n serve a reques │ │ │ │ +001a48f0: 742e 3c2f 703e 0a3c 703e 4669 7273 7420 t.

    .

    First │ │ │ │ +001a4900: 7765 2063 7265 6174 6520 6120 3c65 6d3e we create a │ │ │ │ +001a4910: 3c63 6f64 653e 656e 762e 683c 2f63 6f64 env.h that con │ │ │ │ +001a4930: 7461 696e 7320 7468 6520 6a6f 696e 7420 tains the joint │ │ │ │ +001a4940: 534f 4150 2048 6561 6465 7220 616e 6420 SOAP Header and │ │ │ │ +001a4950: 534f 4150 2046 6175 6c74 2064 6566 696e SOAP Fault defin │ │ │ │ +001a4960: 6974 696f 6e73 2c20 666f 7220 6578 616d itions, for exam │ │ │ │ +001a4970: 706c 6520 6279 2063 6f70 792d 7061 7374 ple by copy-past │ │ │ │ +001a4980: 696e 6720 7468 6573 6520 6672 6f6d 2074 ing these from t │ │ │ │ +001a4990: 6865 206f 7468 6572 2068 6561 6465 7220 he other header │ │ │ │ +001a49a0: 6669 6c65 7320 6765 6e65 7261 7465 6420 files generated │ │ │ │ +001a49b0: 6279 2077 7364 6c32 682e 204f 7220 7468 by wsdl2h. Or th │ │ │ │ +001a49c0: 6973 2066 696c 6520 6973 2065 6d70 7479 is file is empty │ │ │ │ +001a49d0: 2069 6620 6e6f 2073 7065 6369 616c 697a if no specializ │ │ │ │ +001a49e0: 6564 2053 4f41 5020 4865 6164 6572 7320 ed SOAP Headers │ │ │ │ +001a49f0: 616e 6420 4661 756c 7473 2061 7265 2075 and Faults are u │ │ │ │ +001a4a00: 7365 642e 2057 6520 636f 6d70 696c 6520 sed. We compile │ │ │ │ +001a4a10: 6974 2061 7320 666f 6c6c 6f77 733a 203c it as follows: < │ │ │ │ +001a4a20: 2f70 3e3c 7072 6520 636c 6173 733d 2266 /p>

     soapcp
    │ │ │ │ +001a4a40: 7032 202d 6320 2d70 656e 7620 656e 762e  p2 -c -penv env.
    │ │ │ │ +001a4a50: 680a 2063 6320 2d63 2065 6e76 432e 630a  h. cc -c envC.c.
    │ │ │ │ +001a4a60: 3c2f 7072 653e 3c70 3e20 5765 2061 6c73  

    We als │ │ │ │ +001a4a70: 6f20 636f 6d70 696c 6520 3c65 6d3e 3c63 o compile gsoap/stdsoa │ │ │ │ +001a4a90: 7032 2e63 3c2f 636f 6465 3e3c 2f65 6d3e p2.c │ │ │ │ +001a4aa0: 2077 6974 686f 7574 206e 616d 6573 7061 without namespa │ │ │ │ +001a4ab0: 6365 733a 203c 2f70 3e3c 7072 6520 636c ces:

     
    │ │ │ │ +001a4ad0: 6363 202d 6320 2d44 5749 5448 5f4e 4f4e  cc -c -DWITH_NON
    │ │ │ │ +001a4ae0: 414d 4553 5041 4345 5320 7374 6473 6f61  AMESPACES stdsoa
    │ │ │ │ +001a4af0: 7032 2e63 0a3c 2f70 7265 3e3c 703e 2053  p2.c.

    S │ │ │ │ +001a4b00: 6179 2066 6f72 2065 7861 6d70 6c65 2074 ay for example t │ │ │ │ +001a4b10: 6861 7420 7765 2068 6176 6520 6120 7365 hat we have a se │ │ │ │ +001a4b20: 7276 6963 6520 6465 6669 6e69 7469 6f6e rvice definition │ │ │ │ +001a4b30: 2069 6e20 3c65 6d3e 3c63 6f64 653e 7175 in qu │ │ │ │ +001a4b40: 6f74 652e 683c 2f63 6f64 653e 3c2f 656d ote.h. We compile it │ │ │ │ +001a4b60: 2061 7320 6120 6c69 6272 6172 7920 616e as a library an │ │ │ │ +001a4b70: 6420 7765 2075 7365 206f 7074 696f 6e73 d we use options │ │ │ │ +001a4b80: 203c 623e 3c63 6f64 653e 2d6e 3c2f 636f -n and < │ │ │ │ +001a4ba0: 636f 6465 3e2d 7071 756f 7465 3c2f 636f code>-pquote to prefi │ │ │ │ +001a4bc0: 7820 7468 6520 6765 6e65 7261 7465 6420 x the generated │ │ │ │ +001a4bd0: 6669 6c65 7320 616e 6420 746f 2072 656e files and to ren │ │ │ │ +001a4be0: 616d 6520 7468 6520 6e61 6d65 7370 6163 ame the namespac │ │ │ │ +001a4bf0: 6520 7461 626c 6520 746f 2061 766f 6964 e table to avoid │ │ │ │ +001a4c00: 206c 696e 6b20 636f 6e66 6c69 6374 733a link conflicts: │ │ │ │ +001a4c10: 203c 2f70 3e3c 7072 6520 636c 6173 733d

     soap
    │ │ │ │ +001a4c30: 6370 7032 202d 6320 2d6e 202d 7071 756f  cpp2 -c -n -pquo
    │ │ │ │ +001a4c40: 7465 2071 756f 7465 2e68 0a20 6363 202d  te quote.h. cc -
    │ │ │ │ +001a4c50: 6320 7175 6f74 6543 6c69 656e 744c 6962  c quoteClientLib
    │ │ │ │ +001a4c60: 2e63 0a3c 2f70 7265 3e3c 703e 2057 6520  .c.

    We │ │ │ │ +001a4c70: 646f 2074 6865 2073 616d 6520 666f 7220 do the same for │ │ │ │ +001a4c80: 6120 7365 7276 6963 6520 6465 6669 6e69 a service defini │ │ │ │ +001a4c90: 7469 6f6e 2069 6e20 3c65 6d3e 3c63 6f64 tion in rate.h< │ │ │ │ +001a4cb0: 2f65 6d3e 3a20 3c2f 703e 3c70 7265 2063 /em>:

    │ │ │ │ +001a4cd0: 2073 6f61 7063 7070 3220 2d63 202d 6e20   soapcpp2 -c -n 
    │ │ │ │ +001a4ce0: 2d70 7261 7465 2072 6174 652e 680a 2063  -prate rate.h. c
    │ │ │ │ +001a4cf0: 6320 2d63 2072 6174 6543 6c69 656e 744c  c -c rateClientL
    │ │ │ │ +001a4d00: 6962 2e63 0a3c 2f70 7265 3e3c 703e 2054  ib.c.

    T │ │ │ │ +001a4d10: 6f20 7365 7276 6520 626f 7468 2074 6865 o serve both the │ │ │ │ +001a4d20: 2071 756f 7465 2061 6e64 2072 6174 6520 quote and rate │ │ │ │ +001a4d30: 7365 7276 6963 6573 206f 6e20 7468 6520 services on the │ │ │ │ +001a4d40: 7361 6d65 2070 6f72 742c 2077 6520 6368 same port, we ch │ │ │ │ +001a4d50: 6169 6e20 7468 6520 7365 7276 6963 6520 ain the service │ │ │ │ +001a4d60: 6469 7370 6174 6368 6572 7320 6173 2066 dispatchers as f │ │ │ │ +001a4d70: 6f6c 6c6f 7773 3a3c 2f70 3e0a 3c64 6976 ollows:

    .
    # │ │ │ │ +001a4dc0: 696e 636c 7564 6520 2671 756f 743b 7175 include "qu │ │ │ │ +001a4dd0: 6f74 6548 2e68 2671 756f 743b 3c2f 7370 oteH.h"
    .
    #include │ │ │ │ +001a4e20: 2671 756f 743b 7261 7465 482e 6826 7175 "rateH.h&qu │ │ │ │ +001a4e30: 6f74 3b3c 2f73 7061 6e3e 3c2f 6469 763e ot;
    │ │ │ │ +001a4e40: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    #i │ │ │ │ +001a4e70: 6e63 6c75 6465 2026 7175 6f74 3b71 756f nclude "quo │ │ │ │ +001a4e80: 7465 2e6e 736d 6170 2671 756f 743b 3c2f te.nsmap"
    .
    #includ │ │ │ │ +001a4ed0: 6520 2671 756f 743b 7261 7465 2e6e 736d e "rate.nsm │ │ │ │ +001a4ee0: 6170 2671 756f 743b 3c2f 7370 616e 3e3c ap"< │ │ │ │ +001a4ef0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    . │ │ │ │ +001a4f10: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    struct < │ │ │ │ +001a4f40: 2f73 7061 6e3e 3c61 2063 6c61 7373 3d22 /span>soa │ │ │ │ +001a4f70: 703c 2f61 3e20 2a3c 6120 636c 6173 733d p *so │ │ │ │ +001a4fa0: 6170 3c2f 613e 203d 203c 6120 636c 6173 ap = so │ │ │ │ +001a5000: 6170 5f6e 6577 3c2f 613e 2829 3b20 3c2f ap_new(); .
    if (so │ │ │ │ +001a50a0: 6170 5f76 616c 6964 5f73 6f63 6b65 743c ap_valid_socket< │ │ │ │ +001a50b0: 2f61 3e28 3c61 2063 6c61 7373 3d22 636f /a>(soap_bind(soap, NULL, 8080, 1 │ │ │ │ +001a5150: 3029 2929 203c 7370 616e 2063 6c61 7373 0))) // sm │ │ │ │ +001a5170: 616c 6c20 4241 434b 4c4f 4720 666f 7220 all BACKLOG for │ │ │ │ +001a5180: 6974 6572 6174 6976 6520 7365 7276 6572 iterative server │ │ │ │ +001a5190: 733c 2f73 7061 6e3e 3c2f 6469 763e 0a3c s
    .< │ │ │ │ +001a51a0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +001a51b0: 3e7b 3c2f 6469 763e 0a3c 6469 7620 636c >{
    .
    while (1)
    . │ │ │ │ +001a5210: 2020 7b3c 2f64 6976 3e0a 3c64 6976 2063 {
    .
    │ │ │ │ +001a5230: 3c73 7061 6e20 636c 6173 733d 226b 6579 if (soap_vali │ │ │ │ +001a52b0: 645f 736f 636b 6574 3c2f 613e 283c 6120 d_socket(soa │ │ │ │ +001a5310: 705f 6163 6365 7074 3c2f 613e 283c 6120 p_accept(soap)))< │ │ │ │ +001a5350: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    {..< │ │ │ │ +001a5450: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +001a5460: 3e20 2020 2020 207b 3c2f 6469 763e 0a3c > {
    .< │ │ │ │ +001a5470: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +001a5480: 3e20 2020 2020 2020 203c 6120 636c 6173 > soap │ │ │ │ +001a54e0: 5f70 7269 6e74 5f66 6175 6c74 3c2f 613e _print_fault │ │ │ │ +001a54f0: 283c 6120 636c 6173 733d 2263 6f64 6522 (soap │ │ │ │ +001a5520: 2c20 7374 6465 7272 293b 203c 2f64 6976 , stderr);
    .
    continue;
    . │ │ │ │ +001a5590: 2020 2020 207d 3c2f 6469 763e 0a3c 6469 }
    . │ │ │ │ +001a55b0: 2020 2020 203c 6120 636c 6173 733d 2263 soap │ │ │ │ +001a5610: 5f73 6574 5f6e 616d 6573 7061 6365 733c _set_namespaces< │ │ │ │ +001a5620: 2f61 3e28 3c61 2063 6c61 7373 3d22 636f /a>(soap< │ │ │ │ +001a5650: 2f61 3e2c 2071 756f 7465 5f6e 616d 6573 /a>, quote_names │ │ │ │ +001a5660: 7061 6365 7329 3b3c 2f64 6976 3e0a 3c64 paces);
    . │ │ │ │ +001a5680: 2020 2020 2020 3c73 7061 6e20 636c 6173 │ │ │ │ +001a56a0: 6966 3c2f 7370 616e 3e20 2871 756f 7465 if (quote │ │ │ │ +001a56b0: 5f73 6572 7665 5f72 6571 7565 7374 283c _serve_request(< │ │ │ │ +001a56c0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +001a56d0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ +001a56e0: 6874 6d6c 223e 736f 6170 3c2f 613e 2920 html">soap) │ │ │ │ +001a56f0: 3d3d 203c 6120 636c 6173 733d 2263 6f64 == SOAP_NO_M │ │ │ │ +001a5750: 4554 484f 443c 2f61 3e29 203c 2f64 6976 ETHOD)
    .
    {
    .
    soap_set_name │ │ │ │ +001a5800: 7370 6163 6573 3c2f 613e 283c 6120 636c spaces(soap, rate │ │ │ │ +001a5840: 5f6e 616d 6573 7061 6365 7329 3b3c 2f64 _namespaces);.
    if (rate_serve_re │ │ │ │ +001a58a0: 7175 6573 7428 3c61 2063 6c61 7373 3d22 quest(soa │ │ │ │ +001a58d0: 703c 2f61 3e29 293c 2f64 6976 3e0a 3c64 p))
    . │ │ │ │ +001a58f0: 2020 2020 2020 2020 2020 3c61 2063 6c61 soap_s │ │ │ │ +001a5950: 656e 645f 6661 756c 743c 2f61 3e28 3c61 end_fault(soap); │ │ │ │ +001a5990: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // send fa │ │ │ │ +001a59b0: 756c 7420 746f 2063 6c69 656e 7420 3c2f ult to client
    .
    │ │ │ │ +001a59e0: 2020 2020 7d20 3c2f 6469 763e 0a3c 6469 }
    . │ │ │ │ +001a5a00: 2020 2020 203c 7370 616e 2063 6c61 7373 e │ │ │ │ +001a5a20: 6c73 653c 2f73 7061 6e3e 203c 7370 616e lse if ( │ │ │ │ +001a5a50: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap- │ │ │ │ +001a5a80: 2667 743b 3c61 2063 6c61 7373 3d22 636f >err │ │ │ │ +001a5ad0: 6f72 3c2f 613e 2920 3c2f 6469 763e 0a3c or)
    .< │ │ │ │ +001a5ae0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +001a5af0: 3e20 2020 2020 207b 3c2f 6469 763e 0a3c > {
    .< │ │ │ │ +001a5b00: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +001a5b10: 3e20 2020 2020 2020 203c 6120 636c 6173 > soap_se │ │ │ │ +001a5b70: 6e64 5f66 6175 6c74 3c2f 613e 283c 6120 nd_fault(soap); < │ │ │ │ +001a5bb0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ +001a5bc0: 656e 7422 3e2f 2f20 7365 6e64 2066 6175 ent">// send fau │ │ │ │ +001a5bd0: 6c74 2074 6f20 636c 6965 6e74 203c 2f73 lt to client
    .
    │ │ │ │ +001a5c00: 2020 207d 3c2f 6469 763e 0a3c 6469 7620 }
    .
    │ │ │ │ +001a5c20: 207d 3c2f 6469 763e 0a3c 6469 7620 636c }
    .
    < │ │ │ │ +001a5c40: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +001a5c50: 6f72 6466 6c6f 7722 3e65 6c73 653c 2f73 ordflow">else i │ │ │ │ +001a5c80: 663c 2f73 7061 6e3e 2028 3c61 2063 6c61 f (soap->errnum) // acce │ │ │ │ +001a5d30: 7074 2066 6169 6c65 642c 2074 7279 2061 pt failed, try a │ │ │ │ +001a5d40: 6761 696e 2061 6674 6572 2031 2073 6563 gain after 1 sec │ │ │ │ +001a5d50: 6f6e 643c 2f73 7061 6e3e 3c2f 6469 763e ond
    │ │ │ │ +001a5d60: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    {
    .< │ │ │ │ +001a5d80: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +001a5d90: 3e20 2020 2020 203c 6120 636c 6173 733d > soap_p │ │ │ │ +001a5df0: 7269 6e74 5f66 6175 6c74 3c2f 613e 283c rint_fault(< │ │ │ │ +001a5e00: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +001a5e10: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ +001a5e20: 6874 6d6c 223e 736f 6170 3c2f 613e 2c20 html">soap, │ │ │ │ +001a5e30: 7374 6465 7272 293b 203c 2f64 6976 3e0a stderr);
    . │ │ │ │ +001a5e40: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    sleep(1) │ │ │ │ +001a5e60: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
    .
    } │ │ │ │ +001a5e80: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    else
    .
    { │ │ │ │ +001a5ee0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    f │ │ │ │ +001a5f00: 7072 696e 7466 2873 7464 6572 722c 203c printf(stderr, < │ │ │ │ +001a5f10: 7370 616e 2063 6c61 7373 3d22 7374 7269 span class="stri │ │ │ │ +001a5f20: 6e67 6c69 7465 7261 6c22 3e26 7175 6f74 ngliteral">" │ │ │ │ +001a5f30: 3b73 6572 7665 7220 7469 6d65 6420 6f75 ;server timed ou │ │ │ │ +001a5f40: 745c 6e26 7175 6f74 3b3c 2f73 7061 6e3e t\n" │ │ │ │ +001a5f50: 293b 203c 2f64 6976 3e0a 3c64 6976 2063 );
    .
    │ │ │ │ +001a5f70: 2020 3c73 7061 6e20 636c 6173 733d 226b brea │ │ │ │ +001a5f90: 6b3c 2f73 7061 6e3e 3b20 3c2f 6469 763e k;
    │ │ │ │ +001a5fa0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    }
    .< │ │ │ │ +001a5fc0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +001a5fd0: 3e20 2020 203c 6120 636c 6173 733d 2263 > soap_d │ │ │ │ +001a6030: 6573 7472 6f79 3c2f 613e 283c 6120 636c estroy(soap); .
    s │ │ │ │ +001a60e0: 6f61 705f 656e 643c 2f61 3e28 3c61 2063 oap_end(soap); .
    }
    │ │ │ │ +001a6140: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    }
    ..
    soap_end( │ │ │ │ +001a6280: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap) │ │ │ │ +001a62b0: 3b20 3c2f 6469 763e 0a3c 6469 7620 636c ;
    .
    │ │ │ │ +001a6320: 736f 6170 5f66 7265 653c 2f61 3e28 3c61 soap_free(soap);< │ │ │ │ +001a6360: 2f64 6976 3e0a 3c2f 6469 763e 3c21 2d2d /div>.

    │ │ │ │ +001a6380: 5468 6973 2063 6861 696e 696e 6720 6361 This chaining ca │ │ │ │ +001a6390: 6e20 6265 2061 7262 6974 7261 7269 6c79 n be arbitrarily │ │ │ │ +001a63a0: 2064 6565 702e 2057 6865 6e20 7468 6520 deep. When the │ │ │ │ +001a63b0: 7072 6576 696f 7573 2072 6571 7565 7374 previous request │ │ │ │ +001a63c0: 2066 6169 6c73 2077 6974 6820 6120 3c63 fails with a #SOAP_NO_MET │ │ │ │ +001a63e0: 484f 443c 2f63 6f64 653e 2074 6865 6e20 HOD then │ │ │ │ +001a63f0: 6e65 7874 2072 6571 7565 7374 2064 6973 next request dis │ │ │ │ +001a6400: 7061 7463 6865 7220 6361 6e20 6265 2074 patcher can be t │ │ │ │ +001a6410: 7269 6564 2e3c 2f70 3e0a 3c70 3e54 6865 ried.

    .

    The │ │ │ │ +001a6420: 2073 6572 7665 7220 7368 6f75 6c64 2061 server should a │ │ │ │ +001a6430: 6c73 6f20 6465 6669 6e65 2074 6865 2073 lso define the s │ │ │ │ +001a6440: 6572 7669 6365 206f 7065 7261 7469 6f6e ervice operation │ │ │ │ +001a6450: 733a 3c2f 703e 0a3c 6469 7620 636c 6173 s:

    .
    < │ │ │ │ +001a6480: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +001a6490: 6f72 6474 7970 6522 3e69 6e74 3c2f 7370 ordtype">int ns__getQuote │ │ │ │ +001a64b0: 283c 7370 616e 2063 6c61 7373 3d22 6b65 (struct soap │ │ │ │ +001a6500: 3c2f 613e 202a 3c61 2063 6c61 7373 3d22 *soa │ │ │ │ +001a6530: 703c 2f61 3e2c 203c 7370 616e 2063 6c61 p, char *sy │ │ │ │ +001a6560: 6d62 6f6c 2c20 3c73 7061 6e20 636c 6173 mbol, │ │ │ │ +001a6580: 666c 6f61 743c 2f73 7061 6e3e 202a 5265 float *Re │ │ │ │ +001a6590: 7375 6c74 293b 203c 2f64 6976 3e0a 3c64 sult);
    . │ │ │ │ +001a65b0: 7b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 {
    .
    *Res │ │ │ │ +001a65d0: 756c 7420 3d20 2e2e 2e20 3b20 3c2f 6469 ult = ... ; .
    return < │ │ │ │ +001a6620: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +001a6630: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ │ +001a6640: 705f 5f65 7272 6f72 732e 6874 6d6c 2367 p__errors.html#g │ │ │ │ +001a6650: 6133 6231 3061 3638 6633 3534 6633 3963 a3b10a68f354f39c │ │ │ │ +001a6660: 6262 3066 6530 6430 3433 6164 3463 3763 bb0fe0d043ad4c7c │ │ │ │ +001a6670: 3022 3e53 4f41 505f 4f4b 3c2f 613e 3b20 0">SOAP_OK; │ │ │ │ +001a6680: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    }
    .
    ..< │ │ │ │ +001a6820: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +001a6830: 3e7b 3c2f 6469 763e 0a3c 6469 7620 636c >{
    .

    Howe │ │ │ │ +001a6940: 7665 722c 2074 6865 2077 6869 6c65 206c ver, the while l │ │ │ │ +001a6950: 6f6f 7020 6974 6572 6174 6573 2066 6f72 oop iterates for │ │ │ │ +001a6960: 2065 6163 6820 6e65 7720 636f 6e6e 6563 each new connec │ │ │ │ +001a6970: 7469 6f6e 2074 6861 7420 6973 2065 7374 tion that is est │ │ │ │ +001a6980: 6162 6c69 7368 6564 2077 6974 6820 3c63 ablished with soa │ │ │ │ +001a6a10: 705f 6163 6365 7074 3c2f 613e 3c2f 636f p_accept and does not │ │ │ │ +001a6a30: 2061 6c6c 6f77 2066 6f72 2048 5454 5020 allow for HTTP │ │ │ │ +001a6a40: 6b65 6570 2d61 6c69 7665 2063 6f6e 6e65 keep-alive conne │ │ │ │ +001a6a50: 6374 696f 6e73 2074 6f20 7065 7273 6973 ctions to persis │ │ │ │ +001a6a60: 742e 2046 6f72 206f 7572 2066 696e 616c t. For our final │ │ │ │ +001a6a70: 2069 6d70 726f 7665 6d65 6e74 2077 6520 improvement we │ │ │ │ +001a6a80: 7761 6e74 2074 6f20 7375 7070 6f72 7420 want to support │ │ │ │ +001a6a90: 4854 5450 206b 6565 702d 616c 6976 6520 HTTP keep-alive │ │ │ │ +001a6aa0: 636f 6e6e 6563 7469 6f6e 7320 7468 6174 connections that │ │ │ │ +001a6ab0: 2072 6571 7569 7265 206c 6f6f 7069 6e67 require looping │ │ │ │ +001a6ac0: 206f 7665 7220 7468 6520 7365 7276 6963 over the servic │ │ │ │ +001a6ad0: 6520 6469 7370 6174 6368 6573 2075 6e74 e dispatches unt │ │ │ │ +001a6ae0: 696c 2074 6865 2063 6f6e 6e65 6374 696f il the connectio │ │ │ │ +001a6af0: 6e20 636c 6f73 6573 206f 6e20 6569 7468 n closes on eith │ │ │ │ +001a6b00: 6572 2065 6e64 2c20 6166 7465 7220 7768 er end, after wh │ │ │ │ +001a6b10: 6963 6820 7765 2072 6573 756d 6520 7468 ich we resume th │ │ │ │ +001a6b20: 6520 6f75 7465 7220 6c6f 6f70 2e20 5468 e outer loop. Th │ │ │ │ +001a6b30: 6520 7265 7375 6c74 696e 6720 636f 6465 e resulting code │ │ │ │ +001a6b40: 2069 7320 7665 7279 2063 6c6f 7365 2074 is very close t │ │ │ │ +001a6b50: 6f20 7468 6520 736f 6170 6370 7032 2d67 o the soapcpp2-g │ │ │ │ +001a6b60: 656e 6572 6174 6564 203c 636f 6465 3e3c enerated < │ │ │ │ +001a6b70: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ +001a6b80: 663d 2267 726f 7570 5f5f 6772 6f75 705f f="group__group_ │ │ │ │ +001a6b90: 5f69 6f2e 6874 6d6c 2367 6135 3164 6261 _io.html#ga51dba │ │ │ │ +001a6ba0: 3737 3036 6135 3035 3234 3062 6438 3933 7706a505240bd893 │ │ │ │ +001a6bb0: 3563 3062 3238 6534 3139 6422 2074 6974 5c0b28e419d" tit │ │ │ │ +001a6bc0: 6c65 3d22 5365 7276 6520 6120 7065 6e64 le="Serve a pend │ │ │ │ +001a6bd0: 696e 6720 7265 7175 6573 742e 223e 736f ing request.">so │ │ │ │ +001a6be0: 6170 5f73 6572 7665 3c2f 613e 3c2f 636f ap_serve code and the │ │ │ │ +001a6c00: 203c 636f 6465 3e73 6572 7665 3c2f 636f serve service clas │ │ │ │ +001a6c20: 7320 6d65 7468 6f64 732c 2077 6974 6820 s methods, with │ │ │ │ +001a6c30: 7468 6520 6164 6469 7469 6f6e 206f 6620 the addition of │ │ │ │ +001a6c40: 7468 6520 6368 6169 6e20 6f66 2073 6572 the chain of ser │ │ │ │ +001a6c50: 7669 6365 2064 6973 7061 7463 6865 7320 vice dispatches │ │ │ │ +001a6c60: 696e 2074 6865 206c 6f6f 7020 626f 6479 in the loop body │ │ │ │ +001a6c70: 3a3c 2f70 3e0a 3c64 6976 2063 6c61 7373 :

    .
    #includ │ │ │ │ +001a6cc0: 6520 2671 756f 743b 7175 6f74 6548 2e68 e "quoteH.h │ │ │ │ +001a6cd0: 2671 756f 743b 3c2f 7370 616e 3e3c 2f64 ".
    #include " │ │ │ │ +001a6d20: 7261 7465 482e 6826 7175 6f74 3b3c 2f73 rateH.h"
    .
    #include │ │ │ │ +001a6d70: 2026 7175 6f74 3b71 756f 7465 2e6e 736d "quote.nsm │ │ │ │ +001a6d80: 6170 2671 756f 743b 3c2f 7370 616e 3e3c ap"< │ │ │ │ +001a6d90: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    #include &quo │ │ │ │ +001a6dd0: 743b 7261 7465 2e6e 736d 6170 2671 756f t;rate.nsmap&quo │ │ │ │ +001a6de0: 743b 3c2f 7370 616e 3e3c 2f64 6976 3e0a t;
    . │ │ │ │ +001a6df0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    .
    struct │ │ │ │ +001a6e40: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap │ │ │ │ +001a6e70: 2a3c 6120 636c 6173 733d 2263 6f64 6522 *soap │ │ │ │ +001a6ea0: 203d 203c 6120 636c 6173 733d 2263 6f64 = soap_new │ │ │ │ +001a6f00: 3c2f 613e 2829 3b20 3c2f 6469 763e 0a3c ();
    .< │ │ │ │ +001a6f10: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +001a6f20: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >if
    (soap_val │ │ │ │ +001a6fa0: 6964 5f73 6f63 6b65 743c 2f61 3e28 3c61 id_socket(so │ │ │ │ +001a7000: 6170 5f62 696e 643c 2f61 3e28 3c61 2063 ap_bind(soap, NUL │ │ │ │ +001a7040: 4c2c 2038 3038 302c 2031 3029 2929 203c L, 8080, 10))) < │ │ │ │ +001a7050: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ +001a7060: 656e 7422 3e2f 2f20 736d 616c 6c20 4241 ent">// small BA │ │ │ │ +001a7070: 434b 4c4f 4720 666f 7220 6974 6572 6174 CKLOG for iterat │ │ │ │ +001a7080: 6976 6520 7365 7276 6572 733c 2f73 7061 ive servers
    .
    {.
    while (1 │ │ │ │ +001a70f0: 293c 2f64 6976 3e0a 3c64 6976 2063 6c61 )
    .
    {.
    if (< │ │ │ │ +001a7150: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +001a7160: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ │ +001a7170: 705f 5f73 6f61 702e 6874 6d6c 2367 6161 p__soap.html#gaa │ │ │ │ +001a7180: 6165 3837 3437 6634 6364 6163 6565 3537 ae8747f4cdacee57 │ │ │ │ +001a7190: 3538 3735 6333 6132 3438 3864 3939 6322 5875c3a2488d99c" │ │ │ │ +001a71a0: 3e73 6f61 705f 7661 6c69 645f 736f 636b >soap_valid_sock │ │ │ │ +001a71b0: 6574 3c2f 613e 283c 6120 636c 6173 733d et(soap_acce │ │ │ │ +001a7210: 7074 3c2f 613e 283c 6120 636c 6173 733d pt(so │ │ │ │ +001a7240: 6170 3c2f 613e 2929 293c 2f64 6976 3e0a ap)))
    . │ │ │ │ +001a7250: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    {
    . │ │ │ │ +001a7280: 2020 2020 2020 3c61 2063 6c61 7373 3d22 soa │ │ │ │ +001a72b0: 703c 2f61 3e2d 2667 743b 3c61 2063 6c61 p->keep_alive = soap< │ │ │ │ +001a7340: 2f61 3e2d 2667 743b 3c61 2063 6c61 7373 /a>->max_keep_alive< │ │ │ │ +001a73a0: 2f61 3e20 2b20 313b 203c 7370 616e 2063 /a> + 1; / │ │ │ │ +001a73c0: 2f20 6d61 7820 6b65 6570 2d61 6c69 7665 / max keep-alive │ │ │ │ +001a73d0: 2069 7465 7261 7469 6f6e 733c 2f73 7061 iterations
    .
    │ │ │ │ +001a7400: 203c 7370 616e 2063 6c61 7373 3d22 6b65 do
    .
    │ │ │ │ +001a7440: 2020 207b 3c2f 6469 763e 0a3c 6469 7620 {
    .
    │ │ │ │ +001a7460: 2020 2020 203c 7370 616e 2063 6c61 7373 i │ │ │ │ +001a7480: 663c 2f73 7061 6e3e 2028 283c 6120 636c f ((soap->< │ │ │ │ +001a74c0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +001a74d0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ +001a74e0: 6874 6d6c 2361 3364 3933 6261 3936 3862 html#a3d93ba968b │ │ │ │ +001a74f0: 6235 3833 3733 6635 3838 3431 3737 6137 b58373f5884177a7 │ │ │ │ +001a7500: 6563 3064 3833 223e 6b65 6570 5f61 6c69 ec0d83">keep_ali │ │ │ │ +001a7510: 7665 3c2f 613e 2026 6774 3b20 3029 2026 ve > 0) & │ │ │ │ +001a7520: 616d 703b 2661 6d70 3b20 283c 6120 636c amp;& (soap->< │ │ │ │ +001a7560: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +001a7570: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ +001a7580: 6874 6d6c 2361 3164 3761 6361 3661 6331 html#a1d7aca6ac1 │ │ │ │ +001a7590: 6436 3233 3032 3130 3263 3137 3530 3861 d62302102c17508a │ │ │ │ +001a75a0: 3862 3065 6330 223e 6d61 785f 6b65 6570 8b0ec0">max_keep │ │ │ │ +001a75b0: 5f61 6c69 7665 3c2f 613e 2026 6774 3b20 _alive > │ │ │ │ +001a75c0: 3029 293c 2f64 6976 3e0a 3c64 6976 2063 0))
    .
    │ │ │ │ +001a75e0: 2020 2020 2020 3c61 2063 6c61 7373 3d22 soa │ │ │ │ +001a7610: 703c 2f61 3e2d 2667 743b 3c61 2063 6c61 p->keep_alive--;
    .
    │ │ │ │ +001a7690: 2020 2020 203c 7370 616e 2063 6c61 7373 i │ │ │ │ +001a76b0: 663c 2f73 7061 6e3e 2028 3c61 2063 6c61 f (soap_b │ │ │ │ +001a7710: 6567 696e 5f73 6572 7665 3c2f 613e 283c egin_serve(< │ │ │ │ +001a7720: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +001a7730: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ +001a7740: 6874 6d6c 223e 736f 6170 3c2f 613e 2929 html">soap)) │ │ │ │ +001a7750: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    │ │ │ │ +001a7770: 207b 3c2f 6469 763e 0a3c 6469 7620 636c {
    .
    │ │ │ │ +001a7790: 2020 2020 203c 7370 616e 2063 6c61 7373 i │ │ │ │ +001a77b0: 663c 2f73 7061 6e3e 2028 3c61 2063 6c61 f (soap->error │ │ │ │ +001a7840: 2026 6774 3b3d 203c 6120 636c 6173 733d >= SOAP_ │ │ │ │ +001a78a0: 5354 4f50 3c2f 613e 2920 3c73 7061 6e20 STOP) │ │ │ │ +001a78c0: 2f2f 2069 6620 6120 706c 7567 696e 2068 // if a plugin h │ │ │ │ +001a78d0: 6173 2073 6572 7665 6420 7468 6520 7265 as served the re │ │ │ │ +001a78e0: 7175 6573 743c 2f73 7061 6e3e 3c2f 6469 quest.
    │ │ │ │ +001a7910: 203c 7370 616e 2063 6c61 7373 3d22 6b65 conti │ │ │ │ +001a7930: 6e75 653c 2f73 7061 6e3e 3b20 2020 2020 nue; │ │ │ │ +001a7940: 2020 2020 2020 2020 2020 2020 2020 3c73 // then cont │ │ │ │ +001a7970: 696e 7565 2077 6974 6820 7468 6520 6e65 inue with the ne │ │ │ │ +001a7980: 7874 2072 6571 7565 7374 3c2f 7370 616e xt request
    .
    │ │ │ │ +001a79b0: 2020 2020 3c73 7061 6e20 636c 6173 733d br │ │ │ │ +001a79d0: 6561 6b3c 2f73 7061 6e3e 3b20 2020 2020 eak; │ │ │ │ +001a79e0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +001a79f0: 2020 203c 7370 616e 2063 6c61 7373 3d22 // an e │ │ │ │ +001a7a10: 7272 6f72 206f 6363 7572 7265 643c 2f73 rror occurred
    .
    │ │ │ │ +001a7a40: 2020 2020 207d 3c2f 6469 763e 0a3c 6469 }
    . │ │ │ │ +001a7a60: 2020 2020 2020 203c 6120 636c 6173 733d so │ │ │ │ +001a7ac0: 6170 5f73 6574 5f6e 616d 6573 7061 6365 ap_set_namespace │ │ │ │ +001a7ad0: 733c 2f61 3e28 3c61 2063 6c61 7373 3d22 s(soa │ │ │ │ +001a7b00: 703c 2f61 3e2c 2071 756f 7465 5f6e 616d p, quote_nam │ │ │ │ +001a7b10: 6573 7061 6365 7329 3b3c 2f64 6976 3e0a espaces);
    . │ │ │ │ +001a7b20: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    if (q │ │ │ │ +001a7b60: 756f 7465 5f73 6572 7665 5f72 6571 7565 uote_serve_reque │ │ │ │ +001a7b70: 7374 283c 6120 636c 6173 733d 2263 6f64 st(soap) == SOAP_ │ │ │ │ +001a7c00: 4e4f 5f4d 4554 484f 443c 2f61 3e29 203c NO_METHOD) < │ │ │ │ +001a7c10: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    │ │ │ │ +001a7c30: 7b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 {
    ...
    │ │ │ │ +001a7db0: 2020 2020 2020 3c61 2063 6c61 7373 3d22 soap_send_ │ │ │ │ +001a7e10: 6661 756c 743c 2f61 3e28 3c61 2063 6c61 fault(soap); // send fault │ │ │ │ +001a7e70: 746f 2063 6c69 656e 7420 3c2f 7370 616e to client
    .
    │ │ │ │ +001a7ea0: 2020 7d20 3c2f 6469 763e 0a3c 6469 7620 }
    .
    │ │ │ │ +001a7ec0: 2020 2020 203c 7370 616e 2063 6c61 7373 e │ │ │ │ +001a7ee0: 6c73 653c 2f73 7061 6e3e 203c 7370 616e lse if ( │ │ │ │ +001a7f10: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap- │ │ │ │ +001a7f40: 2667 743b 3c61 2063 6c61 7373 3d22 636f >err │ │ │ │ +001a7f90: 6f72 3c2f 613e 2920 3c2f 6469 763e 0a3c or)
    .< │ │ │ │ +001a7fa0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +001a7fb0: 3e20 2020 2020 2020 207b 3c2f 6469 763e > {
    │ │ │ │ +001a7fc0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    soa │ │ │ │ +001a8030: 705f 7365 6e64 5f66 6175 6c74 3c2f 613e p_send_fault │ │ │ │ +001a8040: 283c 6120 636c 6173 733d 2263 6f64 6522 (soap │ │ │ │ +001a8070: 293b 203c 7370 616e 2063 6c61 7373 3d22 ); // send │ │ │ │ +001a8090: 2066 6175 6c74 2074 6f20 636c 6965 6e74 fault to client │ │ │ │ +001a80a0: 203c 2f73 7061 6e3e 3c2f 6469 763e 0a3c
    .< │ │ │ │ +001a80b0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +001a80c0: 3e20 2020 2020 2020 207d 3c2f 6469 763e > }
    │ │ │ │ +001a80d0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    │ │ │ │ +001a8140: 736f 6170 5f64 6573 7472 6f79 3c2f 613e soap_destroy │ │ │ │ +001a8150: 283c 6120 636c 6173 733d 2263 6f64 6522 (soap │ │ │ │ +001a8180: 293b 203c 2f64 6976 3e0a 3c64 6976 2063 );
    ..< │ │ │ │ +001a8240: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +001a8250: 3e20 2020 2020 207d 203c 7370 616e 2063 > } while │ │ │ │ +001a8280: 283c 6120 636c 6173 733d 2263 6f64 6522 (soap │ │ │ │ +001a82b0: 2d26 6774 3b3c 6120 636c 6173 733d 2263 ->ke │ │ │ │ +001a8300: 6570 5f61 6c69 7665 3c2f 613e 293b 3c2f ep_alive);.
    }.
    else < │ │ │ │ +001a8370: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +001a8380: 6f72 6466 6c6f 7722 3e69 663c 2f73 7061 ordflow">if (soap< │ │ │ │ +001a83c0: 2f61 3e2d 2667 743b 3c61 2063 6c61 7373 /a>->errnum) // accept fai │ │ │ │ +001a8440: 6c65 642c 2074 7279 2061 6761 696e 2061 led, try again a │ │ │ │ +001a8450: 6674 6572 2031 2073 6563 6f6e 643c 2f73 fter 1 second
    .
    │ │ │ │ +001a8480: 207b 3c2f 6469 763e 0a3c 6469 7620 636c {
    .
    │ │ │ │ +001a84a0: 203c 6120 636c 6173 733d 2263 6f64 6522 soap_print_f │ │ │ │ +001a8500: 6175 6c74 3c2f 613e 283c 6120 636c 6173 ault( │ │ │ │ +001a8530: 736f 6170 3c2f 613e 2c20 7374 6465 7272 soap, stderr │ │ │ │ +001a8540: 293b 203c 2f64 6976 3e0a 3c64 6976 2063 );
    .
    │ │ │ │ +001a8560: 2020 736c 6565 7028 3129 3b3c 2f64 6976 sleep(1);
    .
    }
    │ │ │ │ +001a8590: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    else.
    {
    │ │ │ │ +001a85f0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    fprintf │ │ │ │ +001a8610: 2873 7464 6572 722c 203c 7370 616e 2063 (stderr, "serve │ │ │ │ +001a8640: 7220 7469 6d65 6420 6f75 745c 6e26 7175 r timed out\n&qu │ │ │ │ +001a8650: 6f74 3b3c 2f73 7061 6e3e 293b 203c 2f64 ot;); .
    break;
    .
    │ │ │ │ +001a86c0: 207d 3c2f 6469 763e 0a3c 6469 7620 636c }
    .
    < │ │ │ │ +001a86e0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +001a86f0: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ │ +001a8700: 705f 5f63 6f6e 7465 7874 2e68 746d 6c23 p__context.html# │ │ │ │ +001a8710: 6761 6637 6430 3137 3631 3631 6539 6465 gaf7d0176161e9de │ │ │ │ +001a8720: 6633 3639 3831 6532 3466 6161 3139 3133 f36981e24faa1913 │ │ │ │ +001a8730: 6439 223e 736f 6170 5f64 6573 7472 6f79 d9">soap_destroy │ │ │ │ +001a8740: 3c2f 613e 283c 6120 636c 6173 733d 2263 (soap │ │ │ │ +001a8770: 3c2f 613e 293b 203c 2f64 6976 3e0a 3c64 );
    . │ │ │ │ +001a8790: 2020 2020 3c61 2063 6c61 7373 3d22 636f soap_en │ │ │ │ +001a87f0: 643c 2f61 3e28 3c61 2063 6c61 7373 3d22 d(soa │ │ │ │ +001a8820: 703c 2f61 3e29 3b20 3c2f 6469 763e 0a3c p);
    .< │ │ │ │ +001a8830: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +001a8840: 3e20 207d 3c2f 6469 763e 0a3c 6469 7620 > }
    .
    }.
    soap │ │ │ │ +001a88d0: 5f64 6573 7472 6f79 3c2f 613e 283c 6120 _destroy(soap); < │ │ │ │ +001a8910: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.

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

    .

    │ │ │ │ +001a8ae0: 0a48 6f77 2074 6f20 6372 6561 7465 2044 .How to create D │ │ │ │ +001a8af0: 4c4c 733c 2f68 323e 0a3c 703e f09f 949d LLs

    .

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

    .< │ │ │ │ +001a8b30: 6833 3e3c 6120 636c 6173 733d 2261 6e63 h3>.Creating │ │ │ │ +001a8b60: 7468 6520 6261 7365 2073 7464 736f 6170 the base stdsoap │ │ │ │ +001a8b70: 322e 646c 6c3c 2f68 333e 0a3c 703e 5468 2.dll.

    Th │ │ │ │ +001a8b80: 6520 656e 6769 6e65 2064 6f65 7320 6e6f e engine does no │ │ │ │ +001a8b90: 7420 6465 6669 6e65 2053 4f41 5020 4865 t define SOAP He │ │ │ │ +001a8ba0: 6164 6572 2061 6e64 2046 6175 6c74 2073 ader and Fault s │ │ │ │ +001a8bb0: 6572 6961 6c69 7a65 7273 2074 6861 7420 erializers that │ │ │ │ +001a8bc0: 7468 6520 656e 6769 6e65 206e 6565 6473 the engine needs │ │ │ │ +001a8bd0: 2077 6865 6e20 696e 7374 616c 6c65 6420 when installed │ │ │ │ +001a8be0: 6173 2061 206c 6962 7261 7279 2e20 5765 as a library. We │ │ │ │ +001a8bf0: 2074 6865 7265 666f 7265 2061 6464 2053 therefore add S │ │ │ │ +001a8c00: 4f41 5020 4865 6164 6572 2061 6e64 2046 OAP Header and F │ │ │ │ +001a8c10: 6175 6c74 2073 6572 6961 6c69 7a65 7273 ault serializers │ │ │ │ +001a8c20: 2c20 7768 6963 6820 6172 6520 636f 6d70 , which are comp │ │ │ │ +001a8c30: 696c 6564 2073 6570 6172 6174 656c 7920 iled separately │ │ │ │ +001a8c40: 6173 2066 6f6c 6c6f 7773 2e20 4669 7273 as follows. Firs │ │ │ │ +001a8c50: 742c 2063 7265 6174 6520 6120 6e65 7720 t, create a new │ │ │ │ +001a8c60: 6865 6164 6572 2066 696c 6520 3c65 6d3e header file │ │ │ │ +001a8c70: 3c63 6f64 653e 656e 762e 683c 2f63 6f64 env.h with the │ │ │ │ +001a8c90: 2053 4f41 5020 4865 6164 6572 203c 636f SOAP Header SO │ │ │ │ +001a8d00: 4150 5f45 4e56 5f5f 4865 6164 6572 3c2f AP_ENV__Header and SO │ │ │ │ +001a8d20: 4150 2046 6175 6c74 203c 636f 6465 3e3c AP Fault < │ │ │ │ +001a8d30: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ +001a8d40: 663d 2273 7472 7563 745f 735f 6f5f 615f f="struct_s_o_a_ │ │ │ │ +001a8d50: 705f 5f5f 655f 6e5f 765f 5f5f 5f5f 6661 p___e_n_v_____fa │ │ │ │ +001a8d60: 756c 742e 6874 6d6c 2220 7469 746c 653d ult.html" title= │ │ │ │ +001a8d70: 2253 4f41 5020 4661 756c 7420 7374 7275 "SOAP Fault stru │ │ │ │ +001a8d80: 6374 7572 652e 223e 534f 4150 5f45 4e56 cture.">SOAP_ENV │ │ │ │ +001a8d90: 5f5f 4661 756c 743c 2f61 3e3c 2f63 6f64 __Fault structures, i │ │ │ │ +001a8db0: 6e63 6c75 6469 6e67 203c 636f 6465 3e3c ncluding < │ │ │ │ +001a8dc0: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ +001a8dd0: 663d 2273 7472 7563 745f 735f 6f5f 615f f="struct_s_o_a_ │ │ │ │ +001a8de0: 705f 5f5f 655f 6e5f 765f 5f5f 5f5f 6465 p___e_n_v_____de │ │ │ │ +001a8df0: 7461 696c 2e68 746d 6c22 2074 6974 6c65 tail.html" title │ │ │ │ +001a8e00: 3d22 534f 4150 2046 6175 6c74 2044 6574 ="SOAP Fault Det │ │ │ │ +001a8e10: 6169 6c20 7374 7275 6374 7572 652e 223e ail structure."> │ │ │ │ +001a8e20: 534f 4150 5f45 4e56 5f5f 4465 7461 696c SOAP_ENV__Detail │ │ │ │ +001a8e30: 3c2f 613e 3c2f 636f 6465 3e20 6966 2074 if t │ │ │ │ +001a8e40: 6869 7320 7374 7275 6374 7572 6520 636f his structure co │ │ │ │ +001a8e50: 6e74 6169 6e73 206d 656d 6265 7273 2074 ntains members t │ │ │ │ +001a8e60: 6861 7420 6172 6520 7365 7269 616c 697a hat are serializ │ │ │ │ +001a8e70: 6564 2061 7320 6661 756c 7420 6465 7461 ed as fault deta │ │ │ │ +001a8e80: 696c 732e 2059 6f75 2063 616e 206c 6561 ils. You can lea │ │ │ │ +001a8e90: 7665 2074 6869 7320 6865 6164 6572 2066 ve this header f │ │ │ │ +001a8ea0: 696c 6520 656d 7074 7920 6966 2079 6f75 ile empty if you │ │ │ │ +001a8eb0: 2077 616e 7420 746f 2075 7365 2074 6865 want to use the │ │ │ │ +001a8ec0: 2064 6566 6175 6c74 2053 4f41 5020 4865 default SOAP He │ │ │ │ +001a8ed0: 6164 6572 2061 6e64 2046 6175 6c74 2e20 ader and Fault. │ │ │ │ +001a8ee0: 486f 7765 7665 722c 2069 6620 534f 4150 However, if SOAP │ │ │ │ +001a8ef0: 2048 6561 6465 7273 2061 7265 2072 6571 Headers are req │ │ │ │ +001a8f00: 7569 7265 6420 7468 656e 2079 6f75 2063 uired then you c │ │ │ │ +001a8f10: 616e 6e6f 7420 6c65 6176 6520 7468 6520 annot leave the │ │ │ │ +001a8f20: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 SOAP_ENV__Heade │ │ │ │ +001a8f90: 723c 2f61 3e3c 2f63 6f64 653e 2073 7472 r str │ │ │ │ +001a8fa0: 7563 7475 7265 2065 6d70 7479 2e20 466f ucture empty. Fo │ │ │ │ +001a8fb0: 7220 6578 616d 706c 652c 2074 6865 2057 r example, the W │ │ │ │ +001a8fc0: 532d 4164 6472 6573 7369 6e67 2061 6e64 S-Addressing and │ │ │ │ +001a8fd0: 2057 532d 5365 6375 7269 7479 2070 6c75 WS-Security plu │ │ │ │ +001a8fe0: 6769 6e73 2072 6571 7569 7265 2053 4f41 gins require SOA │ │ │ │ +001a8ff0: 5020 4865 6164 6572 7320 7768 6963 6820 P Headers which │ │ │ │ +001a9000: 6361 6e20 6265 2069 6d70 6f72 7465 6420 can be imported │ │ │ │ +001a9010: 6279 2061 6464 696e 6720 3c63 6f64 653e by adding │ │ │ │ +001a9020: 2369 6d70 6f72 7420 2277 7361 352e 6822 #import "wsa5.h" │ │ │ │ +001a9030: 3c2f 636f 6465 3e20 616e 6420 3c63 6f64 and #import "wsse. │ │ │ │ +001a9050: 6822 3c2f 636f 6465 3e2c 2072 6573 7065 h", respe │ │ │ │ +001a9060: 6374 6976 656c 7920 746f 203c 656d 3e3c ctively to < │ │ │ │ +001a9070: 636f 6465 3e65 6e76 2e68 3c2f 636f 6465 code>env.h. Then com │ │ │ │ +001a9090: 7069 6c65 2074 6869 7320 6865 6164 6572 pile this header │ │ │ │ +001a90a0: 2066 696c 6520 7769 7468 3a20 3c2f 703e file with:

    │ │ │ │ +001a90b0: 3c70 7265 2063 6c61 7373 3d22 6672 6167
     soapcpp2 
    │ │ │ │ +001a90d0: 2d70 656e 7620 656e 762e 680a 3c2f 7072  -penv env.h.

    The genera │ │ │ │ +001a90f0: 7465 6420 3c65 6d3e 3c63 6f64 653e 656e ted en │ │ │ │ +001a9100: 7643 2e63 7070 3c2f 636f 6465 3e3c 2f65 vC.cpp file holds th │ │ │ │ +001a9120: 6520 534f 4150 2048 6561 6465 7220 616e e SOAP Header an │ │ │ │ +001a9130: 6420 4661 756c 7420 7365 7269 616c 697a d Fault serializ │ │ │ │ +001a9140: 6572 732e 2057 6520 6361 6e20 6569 7468 ers. We can eith │ │ │ │ +001a9150: 6572 2063 7265 6174 6520 6120 7365 7061 er create a sepa │ │ │ │ +001a9160: 7261 7465 203c 656d 3e3c 636f 6465 3e65 rate e │ │ │ │ +001a9170: 6e76 432e 646c 6c3c 2f63 6f64 653e 3c2f nvC.dll DLL for this │ │ │ │ +001a9190: 2074 6861 7420 616c 6c20 636c 6965 6e74 that all client │ │ │ │ +001a91a0: 7320 616e 6420 7365 7276 6963 6520 6170 s and service ap │ │ │ │ +001a91b0: 706c 6963 6174 696f 6e73 2077 696c 6c20 plications will │ │ │ │ +001a91c0: 7573 652c 206f 7220 636f 6d62 696e 6520 use, or combine │ │ │ │ +001a91d0: 3c65 6d3e 3c63 6f64 653e 656e 7643 2e63 envC.c │ │ │ │ +001a91e0: 7070 3c2f 636f 6465 3e3c 2f65 6d3e 2077 pp w │ │ │ │ +001a91f0: 6974 6820 7468 6520 3c65 6d3e 3c63 6f64 ith the stdsoap2.dll we cr │ │ │ │ +001a9220: 6561 7465 2c20 7768 6963 6820 7765 2077 eate, which we w │ │ │ │ +001a9230: 696c 6c20 6578 706c 6169 6e20 6675 7274 ill explain furt │ │ │ │ +001a9240: 6865 722e 3c2f 703e 0a3c 703e 5468 6520 her.

    .

    The │ │ │ │ +001a9250: 6e65 7874 2073 7465 7020 6973 2074 6f20 next step is to │ │ │ │ +001a9260: 6372 6561 7465 203c 656d 3e3c 636f 6465 create stdsoap2.dll which │ │ │ │ +001a9290: 636f 6e73 6973 7473 206f 6620 7468 6520 consists of the │ │ │ │ +001a92a0: 6669 6c65 203c 656d 3e3c 636f 6465 3e67 file g │ │ │ │ +001a92b0: 736f 6170 2f73 7464 736f 6170 322e 6370 soap/stdsoap2.cp │ │ │ │ +001a92c0: 703c 2f63 6f64 653e 3c2f 656d 3e20 616e p an │ │ │ │ +001a92d0: 6420 3c65 6d3e 3c63 6f64 653e 656e 7643 d envC │ │ │ │ +001a92e0: 2e63 7070 3c2f 636f 6465 3e3c 2f65 6d3e .cpp │ │ │ │ +001a92f0: 2061 6e64 206f 7074 696f 6e61 6c6c 7920 and optionally │ │ │ │ +001a9300: 7468 6520 706c 7567 696e 7320 796f 7520 the plugins you │ │ │ │ +001a9310: 7761 6e74 2074 6f20 7573 6520 7375 6368 want to use such │ │ │ │ +001a9320: 2061 7320 3c65 6d3e 3c63 6f64 653e 7773 as ws │ │ │ │ +001a9330: 7365 6170 692e 6370 703c 2f63 6f64 653e seapi.cpp │ │ │ │ +001a9340: 3c2f 656d 3e20 2877 6520 6e65 6564 2074 (we need t │ │ │ │ +001a9350: 6f20 7265 6e61 6d65 2061 6c6c 203c 656d o rename all .c │ │ │ │ +001a9370: 3c2f 656d 3e20 6669 6c65 7320 746f 203c files to < │ │ │ │ +001a9380: 656d 3e3c 636f 6465 3e2e 6370 703c 2f63 em>.cpp files │ │ │ │ +001a93a0: 746f 2061 766f 6964 2069 7373 7565 7320 to avoid issues │ │ │ │ +001a93b0: 7769 7468 204d 5356 432b 2b29 2e20 5468 with MSVC++). Th │ │ │ │ +001a93c0: 6973 2044 4c4c 2063 6f6e 7461 696e 7320 is DLL contains │ │ │ │ +001a93d0: 616c 6c20 636f 6d6d 6f6e 2066 756e 6374 all common funct │ │ │ │ +001a93e0: 696f 6e73 206e 6565 6465 6420 666f 7220 ions needed for │ │ │ │ +001a93f0: 616c 6c20 6f74 6865 7220 636c 6965 6e74 all other client │ │ │ │ +001a9400: 7320 616e 6420 7365 7276 6572 7320 6261 s and servers ba │ │ │ │ +001a9410: 7365 6420 6f6e 2067 534f 4150 2e20 436f sed on gSOAP. Co │ │ │ │ +001a9420: 6d70 696c 6520 3c65 6d3e 3c63 6f64 653e mpile │ │ │ │ +001a9430: 656e 7643 2e63 7070 3c2f 636f 6465 3e3c envC.cpp< │ │ │ │ +001a9440: 2f65 6d3e 2061 6e64 203c 656d 3e3c 636f /em> and gsoap/stdsoap │ │ │ │ +001a9460: 322e 6370 703c 2f63 6f64 653e 3c2f 656d 2.cpp into stdsoap2.dll using │ │ │ │ +001a94a0: 7468 6520 636f 6d70 696c 6572 206f 7074 the compiler opt │ │ │ │ +001a94b0: 696f 6e20 3c63 6f64 653e 2f44 3c2f 636f ion /D #WITH_ │ │ │ │ +001a94d0: 4e4f 4e41 4d45 5350 4143 4553 3c2f 636f NONAMESPACES and the MSVC │ │ │ │ +001a94f0: 2050 7265 2d50 726f 6365 7373 6f72 2064 Pre-Processor d │ │ │ │ +001a9500: 6566 696e 6974 696f 6e73 203c 636f 6465 efinitions SOAP_FMAC1=__de │ │ │ │ +001a9520: 636c 7370 6563 2864 6c6c 6578 706f 7274 clspec(dllexport │ │ │ │ +001a9530: 293c 2f63 6f64 653e 2c20 3c63 6f64 653e ), │ │ │ │ +001a9540: 534f 4150 5f46 4d41 4333 3d5f 5f64 6563 SOAP_FMAC3=__dec │ │ │ │ +001a9550: 6c73 7065 6328 646c 6c65 7870 6f72 7429 lspec(dllexport) │ │ │ │ +001a9560: 3c2f 636f 6465 3e2c 2061 6e64 2074 6865 , and the │ │ │ │ +001a9570: 203c 636f 6465 3e23 534f 4150 5f53 5444 #SOAP_STD │ │ │ │ +001a9580: 5f45 5850 4f52 5453 3c2f 636f 6465 3e20 _EXPORTS │ │ │ │ +001a9590: 6d61 6372 6f20 7365 7420 6173 2073 686f macro set as sho │ │ │ │ +001a95a0: 776e 2062 656c 6f77 2066 726f 6d20 7468 wn below from th │ │ │ │ +001a95b0: 6520 4d53 5643 2063 6f6d 6d61 6e64 2070 e MSVC command p │ │ │ │ +001a95c0: 726f 6d70 743a 203c 2f70 3e3c 7072 6520 rompt:

    C:> cl /c /I
    │ │ │ │ +001a95f0: 2e20 2f45 4873 6320 2f44 5749 5448 5f4e  . /EHsc /DWITH_N
    │ │ │ │ +001a9600: 4f4e 414d 4553 5041 4345 5320 2f44 534f  ONAMESPACES /DSO
    │ │ │ │ +001a9610: 4150 5f46 4d41 4331 3d5f 5f64 6563 6c73  AP_FMAC1=__decls
    │ │ │ │ +001a9620: 7065 6328 646c 6c65 7870 6f72 7429 202f  pec(dllexport) /
    │ │ │ │ +001a9630: 4453 4f41 505f 464d 4143 333d 5f5f 6465  DSOAP_FMAC3=__de
    │ │ │ │ +001a9640: 636c 7370 6563 2864 6c6c 6578 706f 7274  clspec(dllexport
    │ │ │ │ +001a9650: 2920 2f44 534f 4150 5f53 5444 5f45 5850  ) /DSOAP_STD_EXP
    │ │ │ │ +001a9660: 4f52 5453 2065 6e76 432e 6370 7020 7374  ORTS envC.cpp st
    │ │ │ │ +001a9670: 6473 6f61 7032 2e63 7070 0a43 3a26 6774  dsoap2.cpp.C:>
    │ │ │ │ +001a9680: 3b20 6c69 6e6b 202f 4c49 4250 4154 4820  ; link /LIBPATH 
    │ │ │ │ +001a9690: 7773 325f 3332 2e6c 6962 202f 4f55 543a  ws2_32.lib /OUT:
    │ │ │ │ +001a96a0: 6d79 6773 6f61 702e 646c 6c20 2f44 4c4c  mygsoap.dll /DLL
    │ │ │ │ +001a96b0: 2065 6e76 432e 6f62 6a20 7374 6473 6f61   envC.obj stdsoa
    │ │ │ │ +001a96c0: 7032 2e6f 626a 0a3c 2f70 7265 3e3c 703e  p2.obj.

    │ │ │ │ +001a96d0: 204e 6f74 653a 2061 7320 6f66 2067 534f Note: as of gSO │ │ │ │ +001a96e0: 4150 2032 2e38 2e33 3020 616e 6420 6c61 AP 2.8.30 and la │ │ │ │ +001a96f0: 7465 722c 2074 6865 2044 4c4c 2065 7870 ter, the DLL exp │ │ │ │ +001a9700: 6f72 7420 6d61 6372 6f73 2073 686f 776e ort macros shown │ │ │ │ +001a9710: 2068 6572 6520 6172 6520 616c 6c20 7365 here are all se │ │ │ │ +001a9720: 7420 7769 7468 206f 6e65 2070 7265 2d70 t with one pre-p │ │ │ │ +001a9730: 726f 6365 7373 6f72 2064 6566 696e 6974 rocessor definit │ │ │ │ +001a9740: 696f 6e20 3c63 6f64 653e 2353 4f41 505f ion #SOAP_ │ │ │ │ +001a9750: 5354 445f 4558 504f 5254 533c 2f63 6f64 STD_EXPORTS.

    .

    Alter │ │ │ │ +001a9770: 6e61 7469 7665 6c79 2c20 796f 7520 6361 natively, you ca │ │ │ │ +001a9780: 6e20 636f 6d70 696c 6520 7769 7468 203c n compile with < │ │ │ │ +001a9790: 636f 6465 3e2f 443c 2f63 6f64 653e 203c code>/D < │ │ │ │ +001a97a0: 636f 6465 3e23 5749 5448 5f53 4f41 5044 code>#WITH_SOAPD │ │ │ │ +001a97b0: 4546 535f 483c 2f63 6f64 653e 2061 6e64 EFS_H and │ │ │ │ +001a97c0: 2070 7574 2074 6865 206d 6163 726f 2064 put the macro d │ │ │ │ +001a97d0: 6566 696e 6974 696f 6e73 2069 6e20 3c65 efinitions in soapdefs │ │ │ │ +001a97f0: 2e68 3c2f 636f 6465 3e3c 2f65 6d3e 2e20 .h. │ │ │ │ +001a9800: 5468 6973 2065 7870 6f72 7473 2061 6c6c This exports all │ │ │ │ +001a9810: 2066 756e 6374 696f 6e73 2077 6869 6368 functions which │ │ │ │ +001a9820: 2061 7265 2070 7265 6365 6465 6420 6279 are preceded by │ │ │ │ +001a9830: 2074 6865 206d 6163 726f 203c 636f 6465 the macro #SOAP_FMAC1 in the < │ │ │ │ +001a9860: 636f 6465 3e73 6f61 7063 7070 322e 6370 code>soapcpp2.cp │ │ │ │ +001a9870: 703c 2f63 6f64 653e 3c2f 656d 3e20 736f p so │ │ │ │ +001a9880: 7572 6365 2066 696c 6520 616e 6420 6d61 urce file and ma │ │ │ │ +001a9890: 6372 6f20 3c63 6f64 653e 2353 4f41 505f cro #SOAP_ │ │ │ │ +001a98a0: 464d 4143 333c 2f63 6f64 653e 2069 6e20 FMAC3 in │ │ │ │ +001a98b0: 7468 6520 3c65 6d3e 3c63 6f64 653e 656e the en │ │ │ │ +001a98c0: 7643 2e63 7070 3c2f 636f 6465 3e3c 2f65 vC.cpp source file.< │ │ │ │ +001a98e0: 2f70 3e0a 3c70 3e46 696e 616c 6c79 2c20 /p>.

    Finally, │ │ │ │ +001a98f0: 6e6f 7465 2074 6861 7420 7468 6520 6753 note that the gS │ │ │ │ +001a9900: 4f41 5020 736f 7572 6365 2063 6f64 6520 OAP source code │ │ │ │ +001a9910: 7061 636b 6167 6520 636f 6e74 6169 6e73 package contains │ │ │ │ +001a9920: 2061 206c 6f74 206f 6620 3c65 6d3e 3c63 a lot of .c source code f │ │ │ │ +001a9950: 696c 6573 2e20 4d69 7869 6e67 2043 2077 iles. Mixing C w │ │ │ │ +001a9960: 6974 6820 432b 2b20 6669 6c65 7320 6973 ith C++ files is │ │ │ │ +001a9970: 206e 6f74 2072 6563 6f6d 6d65 6e64 6564 not recommended │ │ │ │ +001a9980: 2077 6974 6820 5669 7375 616c 2053 7475 with Visual Stu │ │ │ │ +001a9990: 6469 6f20 616e 6420 7769 6c6c 206c 6561 dio and will lea │ │ │ │ +001a99a0: 6420 746f 2072 756e 2d74 696d 6520 6572 d to run-time er │ │ │ │ +001a99b0: 726f 7273 2077 6865 6e20 6275 696c 6469 rors when buildi │ │ │ │ +001a99c0: 6e67 2044 4c4c 732e 2054 6865 7265 666f ng DLLs. Therefo │ │ │ │ +001a99d0: 7265 2c20 616c 7761 7973 2072 656e 616d re, always renam │ │ │ │ +001a99e0: 6520 3c65 6d3e 3c63 6f64 653e 2e63 3c2f e .c sourc │ │ │ │ +001a9a00: 6520 636f 6465 2066 696c 6573 2074 6f20 e code files to │ │ │ │ +001a9a10: 3c65 6d3e 3c63 6f64 653e 2e63 7070 3c2f .cpp sourc │ │ │ │ +001a9a30: 6520 636f 6465 2066 696c 6573 2077 6865 e code files whe │ │ │ │ +001a9a40: 6e20 6372 6561 7469 6e67 2044 4c4c 732e n creating DLLs. │ │ │ │ +001a9a50: 3c2f 703e 0a3c 703e f09f 949d 203c 6120

    .

    .... Back to │ │ │ │ +001a9a70: 2074 6162 6c65 206f 6620 636f 6e74 656e table of conten │ │ │ │ +001a9a80: 7473 3c2f 613e 3c2f 703e 0a3c 6833 3e3c ts

    .

    < │ │ │ │ +001a9a90: 6120 636c 6173 733d 2261 6e63 686f 7222 a class="anchor" │ │ │ │ +001a9aa0: 2069 643d 2263 6c69 656e 7473 6572 7665 id="clientserve │ │ │ │ +001a9ab0: 7264 6c6c 223e 3c2f 613e 0a43 7265 6174 rdll">.Creat │ │ │ │ +001a9ac0: 696e 6720 636c 6965 6e74 2061 6e64 2073 ing client and s │ │ │ │ +001a9ad0: 6572 7665 7220 444c 4c73 3c2f 6833 3e0a erver DLLs

    . │ │ │ │ +001a9ae0: 3c70 3e43 6f6d 7069 6c65 2074 6865 203c

    Compile the < │ │ │ │ +001a9af0: 656d 3e3c 636f 6465 3e73 6f61 7043 6c69 em>soapCli │ │ │ │ +001a9b00: 656e 744c 6962 2e63 7070 3c2f 636f 6465 entLib.cpp and < │ │ │ │ +001a9b20: 636f 6465 3e73 6f61 7053 6572 7665 724c code>soapServerL │ │ │ │ +001a9b30: 6962 2e63 7070 3c2f 636f 6465 3e3c 2f65 ib.cpp sources as DL │ │ │ │ +001a9b50: 4c73 2062 7920 7573 696e 6720 7468 6520 Ls by using the │ │ │ │ +001a9b60: 4d53 5643 2050 7265 2d50 726f 6365 7373 MSVC Pre-Process │ │ │ │ +001a9b70: 6f72 2064 6566 696e 6974 696f 6e73 203c or definitions < │ │ │ │ +001a9b80: 636f 6465 3e53 4f41 505f 464d 4143 353d code>SOAP_FMAC5= │ │ │ │ +001a9b90: 5f5f 6465 636c 7370 6563 2864 6c6c 6578 __declspec(dllex │ │ │ │ +001a9ba0: 706f 7274 293c 2f63 6f64 653e 2061 6e64 port) and │ │ │ │ +001a9bb0: 203c 636f 6465 3e53 4f41 505f 434d 4143 SOAP_CMAC │ │ │ │ +001a9bc0: 3d5f 5f64 6563 6c73 7065 6328 646c 6c65 =__declspec(dlle │ │ │ │ +001a9bd0: 7870 6f72 7429 3c2f 636f 6465 3e2c 2061 xport), a │ │ │ │ +001a9be0: 6e64 2062 7920 7573 696e 6720 7468 6520 nd by using the │ │ │ │ +001a9bf0: 432b 2b20 636f 6d70 696c 6572 206f 7074 C++ compiler opt │ │ │ │ +001a9c00: 696f 6e20 3c63 6f64 653e 2f44 3c2f 636f ion /D #WITH_ │ │ │ │ +001a9c20: 4e4f 4e41 4d45 5350 4143 4553 3c2f 636f NONAMESPACES. All of thes │ │ │ │ +001a9c40: 6520 6d61 6372 6f73 2061 7265 2073 6574 e macros are set │ │ │ │ +001a9c50: 2061 7320 6120 7368 6f72 7468 616e 6420 as a shorthand │ │ │ │ +001a9c60: 7769 7468 206f 6e65 2070 7265 2d70 726f with one pre-pro │ │ │ │ +001a9c70: 6365 7373 6f72 2064 6566 696e 6974 696f cessor definitio │ │ │ │ +001a9c80: 6e20 3c63 6f64 653e 2353 4f41 505f 5354 n #SOAP_ST │ │ │ │ +001a9c90: 445f 4558 504f 5254 533c 2f63 6f64 653e D_EXPORTS │ │ │ │ +001a9ca0: 2028 7265 7175 6972 6573 2067 534f 4150 (requires gSOAP │ │ │ │ +001a9cb0: 2032 2e38 2e33 3020 6f72 206c 6174 6572 2.8.30 or later │ │ │ │ +001a9cc0: 292e 3c2f 703e 0a3c 703e 5468 6973 2044 ).

    .

    This D │ │ │ │ +001a9cd0: 4c4c 206c 696e 6b73 2074 6f20 3c65 6d3e LL links to │ │ │ │ +001a9ce0: 3c63 6f64 653e 7374 6473 6f61 7032 2e64 stdsoap2.d │ │ │ │ +001a9cf0: 6c6c 3c2f 636f 6465 3e3c 2f65 6d3e 2077 ll w │ │ │ │ +001a9d00: 6520 6372 6561 7465 6420 696e 2053 6563 e created in Sec │ │ │ │ +001a9d10: 7469 6f6e 203c 6120 636c 6173 733d 2265 tion Cre │ │ │ │ +001a9d40: 6174 696e 6720 7468 6520 6261 7365 2073 ating the base s │ │ │ │ +001a9d50: 7464 736f 6170 322e 646c 6c3c 2f61 3e2e tdsoap2.dll. │ │ │ │ +001a9d60: 3c2f 703e 0a3c 703e 546f 2063 7265 6174

    .

    To creat │ │ │ │ +001a9d70: 6520 6d75 6c74 6970 6c65 2044 4c4c 7320 e multiple DLLs │ │ │ │ +001a9d80: 696e 2074 6865 2073 616d 6520 7072 6f6a in the same proj │ │ │ │ +001a9d90: 6563 7420 6469 7265 6374 6f72 792c 2079 ect directory, y │ │ │ │ +001a9da0: 6f75 2073 686f 756c 6420 7573 6520 3c62 ou should use soapcpp2 │ │ │ │ +001a9dc0: 2d70 206e 616d 653c 2f63 6f64 653e 3c2f -p name option -p name to rename │ │ │ │ +001a9e00: 7468 6520 6765 6e65 7261 7465 6420 3c65 the generated soapClie │ │ │ │ +001a9e20: 6e74 4c69 622e 6370 703c 2f63 6f64 653e ntLib.cpp │ │ │ │ +001a9e30: 3c2f 656d 3e20 616e 6420 3c65 6d3e 3c63 and soapServerLi │ │ │ │ +001a9e50: 622e 6370 703c 2f63 6f64 653e 3c2f 656d b.cpp (and associate │ │ │ │ +001a9e70: 6429 2066 696c 6573 2e20 5468 6520 3c62 d) files. The -p name option │ │ │ │ +001a9ea0: 2073 7065 6369 6669 6573 2061 203c 656d specifies a name prefix t │ │ │ │ +001a9ed0: 6f20 7265 706c 6163 6520 7468 6520 3c65 o replace the soap file na │ │ │ │ +001a9f00: 6d65 2070 7265 6669 782e 2041 6e6f 7468 me prefix. Anoth │ │ │ │ +001a9f10: 6572 2077 6179 2069 7320 746f 2075 7365 er way is to use │ │ │ │ +001a9f20: 2043 2b2b 206e 616d 6573 7061 6365 7320 C++ namespaces │ │ │ │ +001a9f30: 7769 7468 203c 623e 3c63 6f64 653e 736f with so │ │ │ │ +001a9f40: 6170 6370 7032 202d 7120 6e61 6d65 3c2f apcpp2 -q name option │ │ │ │ +001a9f60: 203c 623e 3c63 6f64 653e 2d71 206e 616d -q nam │ │ │ │ +001a9f70: 653c 2f63 6f64 653e 3c2f 623e 2c20 6966 e, if │ │ │ │ +001a9f80: 2074 6865 2069 6e74 6572 6661 6365 2068 the interface h │ │ │ │ +001a9f90: 6561 6465 7220 6669 6c65 2069 6e70 7574 eader file input │ │ │ │ +001a9fa0: 2074 6f20 736f 6170 6370 7032 2064 6f65 to soapcpp2 doe │ │ │ │ +001a9fb0: 7320 6e6f 7420 616c 7265 6164 7920 6465 s not already de │ │ │ │ +001a9fc0: 636c 6172 6520 6120 432b 2b20 6e61 6d65 clare a C++ name │ │ │ │ +001a9fd0: 7370 6163 652e 2041 2063 6c65 616e 2073 space. A clean s │ │ │ │ +001a9fe0: 6570 6172 6174 696f 6e20 6f66 206c 6962 eparation of lib │ │ │ │ +001a9ff0: 7261 7269 6573 2063 616e 2061 6c73 6f20 raries can also │ │ │ │ +001aa000: 6265 2061 6368 6965 7665 6420 7769 7468 be achieved with │ │ │ │ +001aa010: 2043 2b2b 206e 616d 6573 7061 6365 732c C++ namespaces, │ │ │ │ +001aa020: 2073 6565 2053 6563 7469 6f6e 203c 6120 see Section How t │ │ │ │ +001aa060: 6f20 6275 696c 6420 6120 636c 6965 6e74 o build a client │ │ │ │ +001aa070: 206f 7220 7365 7276 6572 2069 6e20 6120 or server in a │ │ │ │ +001aa080: 432b 2b20 636f 6465 206e 616d 6573 7061 C++ code namespa │ │ │ │ +001aa090: 6365 3c2f 613e 202e 3c2f 703e 0a3c 703e ce .

    .

    │ │ │ │ +001aa0a0: 556e 6c65 7373 2079 6f75 2075 7365 2074 Unless you use t │ │ │ │ +001aa0b0: 6865 2063 6c69 656e 7420 7072 6f78 7920 he client proxy │ │ │ │ +001aa0c0: 616e 6420 7365 7276 6572 206f 626a 6563 and server objec │ │ │ │ +001aa0d0: 7420 636c 6173 7365 7320 283c 656d 3e3c t classes (< │ │ │ │ +001aa0e0: 636f 6465 3e73 6f61 7058 595a 5072 6f78 code>soapXYZProx │ │ │ │ +001aa0f0: 792e 683c 2f63 6f64 653e 3c2f 656d 3e20 y.h │ │ │ │ +001aa100: 616e 6420 3c65 6d3e 3c63 6f64 653e 736f and so │ │ │ │ +001aa110: 6170 5859 5a53 6572 7669 6365 2e68 3c2f apXYZService.h), all │ │ │ │ +001aa130: 2063 6c69 656e 7420 616e 6420 7365 7276 client and serv │ │ │ │ +001aa140: 6572 2061 7070 6c69 6361 7469 6f6e 7320 er applications │ │ │ │ +001aa150: 6d75 7374 2065 7870 6c69 6369 746c 7920 must explicitly │ │ │ │ +001aa160: 7365 7420 7468 6520 6e61 6d65 7370 6163 set the namespac │ │ │ │ +001aa170: 6573 2076 616c 7565 206f 6620 7468 6520 es value of the │ │ │ │ +001aa180: 3c63 6f64 653e 3c61 2063 6c61 7373 3d22 soap context with:< │ │ │ │ +001aa1f0: 2f70 3e0a 3c64 6976 2063 6c61 7373 3d22 /p>.

    │ │ │ │ +001aa330: 3c21 2d2d 2066 7261 676d 656e 7420 2d2d

    The │ │ │ │ +001aae90: 3c65 6d3e 3c63 6f64 653e 6d6f 6475 6c65 module │ │ │ │ +001aaea0: 2e68 3c2f 636f 6465 3e3c 2f65 6d3e 2064 .h d │ │ │ │ +001aaeb0: 6174 6120 6269 6e64 696e 6720 696e 7465 ata binding inte │ │ │ │ +001aaec0: 7266 6163 6520 6865 6164 6572 2066 696c rface header fil │ │ │ │ +001aaed0: 6520 666f 7220 736f 6170 6370 7032 2064 e for soapcpp2 d │ │ │ │ +001aaee0: 6563 6c61 7265 7320 6d6f 6475 6c65 2d73 eclares module-s │ │ │ │ +001aaef0: 7065 6369 6669 6320 7365 7269 616c 697a pecific serializ │ │ │ │ +001aaf00: 6162 6c65 2074 7970 6573 203c 636f 6465 able types LONG64, │ │ │ │ +001aaf20: 3c63 6f64 653e 7873 645f 5f6c 6f6e 673c xsd__long< │ │ │ │ +001aaf30: 2f63 6f64 653e 2c20 3c63 6f64 653e 6368 /code>, ch │ │ │ │ +001aaf40: 6172 2a3c 2f63 6f64 653e 2c20 616e 6420 ar*, and │ │ │ │ +001aaf50: 6120 3c63 6f64 653e 7374 7275 6374 206e a struct n │ │ │ │ +001aaf60: 735f 5f53 3c2f 636f 6465 3e2e 2054 6865 s__S. The │ │ │ │ +001aaf70: 206d 6f64 756c 6520 6e61 6d65 2069 7320 module name is │ │ │ │ +001aaf80: 2274 6573 7422 2c20 736f 2074 6865 2073 "test", so the s │ │ │ │ +001aaf90: 6f61 7063 7070 3220 746f 6f6c 2070 726f oapcpp2 tool pro │ │ │ │ +001aafa0: 6475 6365 7320 6120 3c65 6d3e 3c63 6f64 duces a testC.cpp file wit │ │ │ │ +001aafd0: 6820 7468 6520 584d 4c20 7365 7269 616c h the XML serial │ │ │ │ +001aafe0: 697a 6572 7320 666f 7220 7468 6573 6520 izers for these │ │ │ │ +001aaff0: 7479 7065 732e 2054 6865 203c 656d 3e3c types. The < │ │ │ │ +001ab000: 636f 6465 3e74 6573 7443 2e63 7070 3c2f code>testC.cpp data │ │ │ │ +001ab020: 6269 6e64 696e 6720 696d 706c 656d 656e binding implemen │ │ │ │ +001ab030: 7461 7469 6f6e 2073 6f75 7263 6520 636f tation source co │ │ │ │ +001ab040: 6465 2063 616e 2062 6520 7365 7061 7261 de can be separa │ │ │ │ +001ab050: 7465 6c79 2063 6f6d 7069 6c65 6420 616e tely compiled an │ │ │ │ +001ab060: 6420 6c69 6e6b 6564 2077 6974 6820 616e d linked with an │ │ │ │ +001ab070: 2061 7070 6c69 6361 7469 6f6e 2e20 4966 application. If │ │ │ │ +001ab080: 2073 6572 7669 6365 206f 7065 7261 7469 service operati │ │ │ │ +001ab090: 6f6e 7320 6172 6520 6465 636c 6172 6564 ons are declared │ │ │ │ +001ab0a0: 2069 6e20 7468 6520 696e 7465 7266 6163 in the interfac │ │ │ │ +001ab0b0: 6520 6865 6164 6572 2066 696c 6520 6173 e header file as │ │ │ │ +001ab0c0: 2066 756e 6374 696f 6e20 7072 6f74 6f74 function protot │ │ │ │ +001ab0d0: 7970 6573 2c20 7765 2061 6c73 6f20 6765 ypes, we also ge │ │ │ │ +001ab0e0: 7420 3c65 6d3e 3c63 6f64 653e 7465 7374 t test │ │ │ │ +001ab0f0: 436c 6965 6e74 2e63 7070 3c2f 636f 6465 Client.cpp client st │ │ │ │ +001ab110: 7562 2066 756e 6374 696f 6e73 2061 6e64 ub functions and │ │ │ │ +001ab120: 203c 656d 3e3c 636f 6465 3e74 6573 7453 testS │ │ │ │ +001ab130: 6572 7665 722e 6370 703c 2f63 6f64 653e erver.cpp │ │ │ │ +001ab140: 3c2f 656d 3e20 7365 7276 6572 2073 6b65 server ske │ │ │ │ +001ab150: 6c65 746f 6e20 6675 6e63 7469 6f6e 732e leton functions. │ │ │ │ +001ab160: 3c2f 703e 0a3c 703e 5468 6572 6520 6172

    .

    There ar │ │ │ │ +001ab170: 6520 736f 6d65 206c 696d 6974 6174 696f e some limitatio │ │ │ │ +001ab180: 6e73 2066 6f72 206d 6f64 756c 6520 696d ns for module im │ │ │ │ +001ab190: 706f 7274 733a 3c2f 703e 0a3c 756c 3e0a ports:

    .
      . │ │ │ │ +001ab1a0: 3c6c 693e 4120 6d6f 6475 6c65 206d 7573
    • A module mus │ │ │ │ +001ab1b0: 7420 6265 2069 6d70 6f72 7465 6420 696e t be imported in │ │ │ │ +001ab1c0: 746f 2061 6e6f 7468 6572 2069 6e74 6572 to another inter │ │ │ │ +001ab1d0: 6661 6365 2068 6561 6465 7220 746f 2075 face header to u │ │ │ │ +001ab1e0: 7365 2074 6865 206d 6f64 756c 6527 7320 se the module's │ │ │ │ +001ab1f0: 7479 7065 2064 6566 696e 6974 696f 6e73 type definitions │ │ │ │ +001ab200: 2e3c 2f6c 693e 0a3c 6c69 3e57 6865 6e20 .
    • .
    • When │ │ │ │ +001ab210: 6d75 6c74 6970 6c65 206d 6f64 756c 6573 multiple modules │ │ │ │ +001ab220: 2061 7265 2069 6d70 6f72 7465 642c 2074 are imported, t │ │ │ │ +001ab230: 6865 2074 7970 6573 2074 6861 7420 7468 he types that th │ │ │ │ +001ab240: 6579 2064 6563 6c61 7265 206d 7573 7420 ey declare must │ │ │ │ +001ab250: 6265 2064 6563 6c61 7265 6420 696e 206f be declared in o │ │ │ │ +001ab260: 6e65 206d 6f64 756c 6520 6f6e 6c79 2074 ne module only t │ │ │ │ +001ab270: 6f20 6176 6f69 6420 6e61 6d65 2063 6c61 o avoid name cla │ │ │ │ +001ab280: 7368 6573 2061 6e64 206c 696e 6b20 6572 shes and link er │ │ │ │ +001ab290: 726f 7273 2e20 596f 7520 6361 6e6e 6f74 rors. You cannot │ │ │ │ +001ab2a0: 2063 7265 6174 6520 7477 6f20 6d6f 6475 create two modu │ │ │ │ +001ab2b0: 6c65 7320 7468 6174 2064 6563 6c61 7265 les that declare │ │ │ │ +001ab2c0: 206f 7220 7573 6520 7468 6520 7361 6d65 or use the same │ │ │ │ +001ab2d0: 2074 7970 6520 616e 6420 696d 706f 7274 type and import │ │ │ │ +001ab2e0: 2074 6865 7365 206d 6f64 756c 6573 2073 these modules s │ │ │ │ +001ab2f0: 6570 6172 6174 656c 7920 696e 746f 2061 eparately into a │ │ │ │ +001ab300: 6e6f 7468 6572 2068 6561 6465 7220 6669 nother header fi │ │ │ │ +001ab310: 6c65 2e20 5768 656e 2075 7369 6e67 206d le. When using m │ │ │ │ +001ab320: 6f64 756c 6573 2c20 636f 6e73 6964 6572 odules, consider │ │ │ │ +001ab330: 2063 7265 6174 696e 6720 6120 6d6f 6475 creating a modu │ │ │ │ +001ab340: 6c65 2068 6965 7261 7263 6879 2073 7563 le hierarchy suc │ │ │ │ +001ab350: 6820 7468 6174 2074 7970 6573 2061 7265 h that types are │ │ │ │ +001ab360: 2064 6563 6c61 7265 6420 6f6e 6c79 206f declared only o │ │ │ │ +001ab370: 6e63 6520 616e 6420 6279 206f 6e6c 7920 nce and by only │ │ │ │ +001ab380: 6f6e 6520 6d6f 6475 6c65 2077 6865 6e20 one module when │ │ │ │ +001ab390: 7468 6573 6520 6d6f 6475 6c65 7320 6d75 these modules mu │ │ │ │ +001ab3a0: 7374 2062 6520 6c69 6e6b 6564 2e3c 2f6c st be linked..
    .

    With │ │ │ │ +001ab3c0: 206d 6f64 756c 6573 2c20 7468 6520 736f modules, the so │ │ │ │ +001ab3d0: 7572 6365 2063 6f64 6520 7365 7269 616c urce code serial │ │ │ │ +001ab3e0: 697a 6572 7320 666f 7220 7468 6520 7479 izers for the ty │ │ │ │ +001ab3f0: 7065 7320 6465 6669 6e65 6420 696e 2074 pes defined in t │ │ │ │ +001ab400: 6865 206d 6f64 756c 6573 2061 7265 2067 he modules are g │ │ │ │ +001ab410: 656e 6572 6174 6564 2077 6974 6820 736f enerated with so │ │ │ │ +001ab420: 6170 6370 7032 2073 6570 6172 6174 656c apcpp2 separatel │ │ │ │ +001ab430: 792e 2046 6f72 2065 7861 6d70 6c65 2c20 y. For example, │ │ │ │ +001ab440: 6173 7375 6d65 2074 6861 7420 7765 2068 assume that we h │ │ │ │ +001ab450: 6176 6520 6120 6d6f 6475 6c65 203c 656d ave a module module.h< │ │ │ │ +001ab470: 2f63 6f64 653e 3c2f 656d 3e3a 3c2f 703e /code>:

    │ │ │ │ +001ab480: 0a3c 6469 7620 636c 6173 733d 2266 7261 .
    / │ │ │ │ +001ab4c0: 2a20 436f 6e74 656e 7473 206f 6620 6669 * Contents of fi │ │ │ │ +001ab4d0: 6c65 2026 7175 6f74 3b6d 6f64 756c 652e le "module. │ │ │ │ +001ab4e0: 6826 7175 6f74 3b20 2a2f 3c2f 7370 616e h" */
    .
    #module &qu │ │ │ │ +001ab530: 6f74 3b74 6573 7426 7175 6f74 3b3c 2f73 ot;test"
    .
    .
    str │ │ │ │ +001ab590: 7563 7420 3c2f 7370 616e 3e6e 735f 5f53 uct ns__S │ │ │ │ +001ab5a0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    {
    │ │ │ │ +001ab5c0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    char *na │ │ │ │ +001ab600: 6d65 3b3c 2f64 6976 3e0a 3c64 6976 2063 me;
    .
    │ │ │ │ +001ab620: 3c73 7061 6e20 636c 6173 733d 226b 6579 int amount;.
    };
    .

    and a he │ │ │ │ +001ab690: 6164 6572 2066 696c 6520 3c65 6d3e 3c63 ader file example.h that u │ │ │ │ +001ab6c0: 7365 7320 6974 3a3c 2f70 3e0a 3c64 6976 ses it:

    .
    /* Con │ │ │ │ +001ab710: 7465 6e74 7320 6f66 2066 696c 6520 2671 tents of file &q │ │ │ │ +001ab720: 756f 743b 6578 616d 706c 652e 6826 7175 uot;example.h&qu │ │ │ │ +001ab730: 6f74 3b20 2a2f 3c2f 7370 616e 3e3c 2f64 ot; */.
    #import "m │ │ │ │ +001ab780: 6f64 756c 652e 6826 7175 6f74 3b3c 2f73 odule.h"
    .
    .
    int ns__ │ │ │ │ +001ab7f0: 7765 626d 6574 686f 6428 3c73 7061 6e20 webmethod( │ │ │ │ +001ab810: 636f 6e73 743c 2f73 7061 6e3e 203c 7370 const char *code, │ │ │ │ +001ab860: 7374 7275 6374 3c2f 7370 616e 3e20 6e73 struct ns │ │ │ │ +001ab870: 5f5f 5320 2a72 6563 6f72 642c 203c 7370 __S *record, int *result); < │ │ │ │ +001ab8b0: 2f64 6976 3e0a 3c2f 6469 763e 3c21 2d2d /div>.

    │ │ │ │ +001ab8d0: 5468 6520 6d6f 6475 6c65 2069 7320 636f The module is co │ │ │ │ +001ab8e0: 6d70 696c 6564 2061 7320 666f 6c6c 6f77 mpiled as follow │ │ │ │ +001ab8f0: 733a 203c 2f70 3e3c 7072 6520 636c 6173 s:

    soa
    │ │ │ │ +001ab910: 7063 7070 3220 6d6f 6475 6c65 312e 680a  pcpp2 module1.h.
    │ │ │ │ +001ab920: 3c2f 7072 653e 3c70 3e20 5468 6973 2067  

    This g │ │ │ │ +001ab930: 656e 6572 6174 6573 2074 6865 2066 696c enerates the fil │ │ │ │ +001ab940: 6573 203c 656d 3e3c 636f 6465 3e74 6573 es tes │ │ │ │ +001ab950: 7453 7475 622e 683c 2f63 6f64 653e 3c2f tStub.h, t │ │ │ │ +001ab970: 6573 7448 2e68 3c2f 636f 6465 3e3c 2f65 estH.h, and testC.cpp with ser │ │ │ │ +001ab9b0: 6961 6c69 7a65 7273 2066 6f72 203c 636f ializers for struct ns__S< │ │ │ │ +001ab9d0: 2f63 6f64 653e 2062 7574 2061 6c73 6f20 /code> but also │ │ │ │ +001ab9e0: 666f 7220 3c63 6f64 653e 6368 6172 2a3c for char*< │ │ │ │ +001ab9f0: 2f63 6f64 653e 2061 6e64 203c 636f 6465 /code> and int.

    │ │ │ │ +001aba10: 0a3c 703e 5275 6e6e 696e 6720 736f 6170 .

    Running soap │ │ │ │ +001aba20: 6370 7032 206f 6e20 3c65 6d3e 3c63 6f64 cpp2 on example.h imports │ │ │ │ +001aba50: 7468 6520 6d6f 6475 6c65 2064 6566 696e the module defin │ │ │ │ +001aba60: 6974 696f 6e73 2c20 6275 7420 646f 6573 itions, but does │ │ │ │ +001aba70: 206e 6f74 2067 656e 6572 6174 6520 7365 not generate se │ │ │ │ +001aba80: 7269 616c 697a 6572 7320 666f 7220 3c63 rializers for struct ns__S │ │ │ │ +001abaa0: 3c2f 636f 6465 3e2c 203c 636f 6465 3e63 , c │ │ │ │ +001abab0: 6861 722a 3c2f 636f 6465 3e20 616e 6420 har* and │ │ │ │ +001abac0: 3c63 6f64 653e 696e 743c 2f63 6f64 653e int │ │ │ │ +001abad0: 2073 696e 6365 2074 6865 7365 2061 7265 since these are │ │ │ │ +001abae0: 2064 6566 696e 6564 2062 7920 3c65 6d3e defined by │ │ │ │ +001abaf0: 3c63 6f64 653e 6d6f 6475 6c65 2e68 3c2f module.h:

    │ │ │ │ +001abb10: 3c70 7265 2063 6c61 7373 3d22 6672 6167
    soapcpp2 -
    │ │ │ │ +001abb30: 434c 2065 7861 6d70 6c65 2e68 0a3c 2f70  CL example.h.

    An exampl │ │ │ │ +001abb50: 6520 636c 6965 6e74 2061 7070 6c69 6361 e client applica │ │ │ │ +001abb60: 7469 6f6e 2074 6861 7420 6361 6c6c 7320 tion that calls │ │ │ │ +001abb70: 7468 6520 636c 6965 6e74 2073 7475 6220 the client stub │ │ │ │ +001abb80: 6675 6e63 7469 6f6e 3a3c 2f70 3e0a 3c64 function:

    .
    #include " │ │ │ │ +001abbe0: 736f 6170 482e 6826 7175 6f74 3b3c 2f73 soapH.h"
    .
    #include │ │ │ │ +001abc30: 2026 7175 6f74 3b6e 732e 6e73 6d61 7026 "ns.nsmap& │ │ │ │ +001abc40: 7175 6f74 3b3c 2f73 7061 6e3e 3c2f 6469 quot;.
    .< │ │ │ │ +001abc80: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +001abc90: 6f72 6474 7970 6522 3e69 6e74 3c2f 7370 ordtype">int
    main()
    │ │ │ │ +001abcb0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    {
    .
    < │ │ │ │ +001abce0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +001abcf0: 6f72 6422 3e73 7472 7563 7420 3c2f 7370 ord">struct soap *soap< │ │ │ │ +001abd60: 2f61 3e20 3d20 3c61 2063 6c61 7373 3d22 /a> = soap_ │ │ │ │ +001abdc0: 6e65 773c 2f61 3e28 293b 3c2f 6469 763e new();
    │ │ │ │ +001abdd0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    struc │ │ │ │ +001abe00: 7420 3c2f 7370 616e 3e6e 735f 5f53 2073 t ns__S s │ │ │ │ +001abe10: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
    .
    soap │ │ │ │ +001abe30: 5f64 6566 6175 6c74 5f6e 735f 5f53 283c _default_ns__S(< │ │ │ │ +001abe40: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +001abe50: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ +001abe60: 6874 6d6c 223e 736f 6170 3c2f 613e 2c20 html">soap, │ │ │ │ +001abe70: 2661 6d70 3b73 293b 3c2f 6469 763e 0a3c &s);
    .< │ │ │ │ +001abe80: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +001abe90: 3e20 2073 2e6e 616d 6520 3d20 3c61 2063 > s.name = soap_strdup │ │ │ │ +001abf00: 283c 6120 636c 6173 733d 2263 6f64 6522 (soap │ │ │ │ +001abf30: 2c20 3c73 7061 6e20 636c 6173 733d 2273 , &q │ │ │ │ +001abf50: 756f 743b 6e61 6d65 2671 756f 743b 3c2f uot;name");
    . │ │ │ │ +001abf80: 2020 732e 616d 6f75 6e74 203d 2031 3234 s.amount = 124 │ │ │ │ +001abf90: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
    .
    int │ │ │ │ +001abfd0: 206e 3b3c 2f64 6976 3e0a 3c64 6976 2063 n;
    .
    if (soap_call_ns_ │ │ │ │ +001ac020: 5f77 6562 6d65 7468 6f64 283c 6120 636c _webmethod(soap, endp │ │ │ │ +001ac060: 6f69 6e74 2c20 4e55 4c4c 2c20 3c73 7061 oint, NULL, "co │ │ │ │ +001ac090: 6465 2671 756f 743b 3c2f 7370 616e 3e2c de", │ │ │ │ +001ac0a0: 2026 616d 703b 732c 2026 616d 703b 6e29 &s, &n) │ │ │ │ +001ac0b0: 293c 2f64 6976 3e0a 3c64 6976 2063 6c61 )
    .
    soap_print_faul │ │ │ │ +001ac130: 743c 2f61 3e28 3c61 2063 6c61 7373 3d22 t(soa │ │ │ │ +001ac160: 703c 2f61 3e2c 2073 7464 6572 7229 3b3c p, stderr);< │ │ │ │ +001ac170: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    else< │ │ │ │ +001ac1b0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    prin │ │ │ │ +001ac1d0: 7466 283c 7370 616e 2063 6c61 7373 3d22 tf(& │ │ │ │ +001ac1f0: 7175 6f74 3b4f 4b20 6e20 3d20 2564 5c6e quot;OK n = %d\n │ │ │ │ +001ac200: 2671 756f 743b 3c2f 7370 616e 3e2c 206e ", n │ │ │ │ +001ac210: 293b 3c2f 6469 763e 0a3c 6469 7620 636c );
    ...
    soap_free( │ │ │ │ +001ac3f0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap) │ │ │ │ +001ac420: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
    .
    }
    .

    We c │ │ │ │ +001ac460: 6f6d 7069 6c65 2074 6869 7320 6578 616d ompile this exam │ │ │ │ +001ac470: 706c 6520 6173 2066 6f6c 6c6f 7773 3a20 ple as follows: │ │ │ │ +001ac480: 3c2f 703e 3c70 7265 2063 6c61 7373 3d22

    c++ -o
    │ │ │ │ +001ac4a0: 2065 7861 6d70 6c65 2065 7861 6d70 6c65   example example
    │ │ │ │ +001ac4b0: 2e63 7070 2074 6573 7443 2e63 7070 2073  .cpp testC.cpp s
    │ │ │ │ +001ac4c0: 6f61 7043 2e63 7070 2073 6f61 7043 6c69  oapC.cpp soapCli
    │ │ │ │ +001ac4d0: 656e 742e 6370 7020 7374 6473 6f61 7032  ent.cpp stdsoap2
    │ │ │ │ +001ac4e0: 2e63 7070 0a3c 2f70 7265 3e3c 703e 204d  .cpp.

    M │ │ │ │ +001ac4f0: 6f64 756c 6573 206d 6179 2068 656c 7020 odules may help │ │ │ │ +001ac500: 746f 2064 6566 696e 6520 6120 6d6f 6475 to define a modu │ │ │ │ +001ac510: 6c61 7220 6869 6572 6172 6368 7920 6f66 lar hierarchy of │ │ │ │ +001ac520: 206c 6962 7261 7269 6573 2077 6974 6820 libraries with │ │ │ │ +001ac530: 7265 7573 6162 6c65 2073 6572 6961 6c69 reusable seriali │ │ │ │ +001ac540: 7a61 626c 6520 7479 7065 732e 3c2f 703e zable types.

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

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

    .

    .P │ │ │ │ +001ac5b0: 6c75 6769 6e73 2c20 6d6f 6475 6c65 732c lugins, modules, │ │ │ │ +001ac5c0: 2061 6e64 2065 7874 656e 7369 6f6e 733c and extensions< │ │ │ │ +001ac5d0: 2f68 323e 0a3c 703e 506c 7567 696e 7320 /h2>.

    Plugins │ │ │ │ +001ac5e0: 6f66 6665 7220 6120 636f 6e76 656e 6965 offer a convenie │ │ │ │ +001ac5f0: 6e74 2065 7874 656e 7369 6f6e 206d 6563 nt extension mec │ │ │ │ +001ac600: 6861 6e69 736d 2066 6f72 2074 6865 2067 hanism for the g │ │ │ │ +001ac610: 534f 4150 2074 6f6f 6c6b 6974 2062 7920 SOAP toolkit by │ │ │ │ +001ac620: 6578 7465 6e64 696e 6720 7468 6520 6361 extending the ca │ │ │ │ +001ac630: 7061 6269 6c69 7469 6573 206f 6620 6974 pabilities of it │ │ │ │ +001ac640: 7320 656e 6769 6e65 2e20 5768 656e 2074 s engine. When t │ │ │ │ +001ac650: 6865 2070 6c75 6769 6e20 7265 6769 7374 he plugin regist │ │ │ │ +001ac660: 6572 7320 7769 7468 2074 6865 2067 534f ers with the gSO │ │ │ │ +001ac670: 4150 2065 6e67 696e 652c 2069 7420 6861 AP engine, it ha │ │ │ │ +001ac680: 7320 6675 6c6c 2061 6363 6573 7320 746f s full access to │ │ │ │ +001ac690: 2074 6865 2072 756e 2d74 696d 6520 7365 the run-time se │ │ │ │ +001ac6a0: 7474 696e 6773 2061 6e64 2074 6865 2065 ttings and the e │ │ │ │ +001ac6b0: 6e67 696e 6527 7320 6675 6e63 7469 6f6e ngine's function │ │ │ │ +001ac6c0: 2063 616c 6c62 6163 6b73 2e20 5570 6f6e callbacks. Upon │ │ │ │ +001ac6d0: 2072 6567 6973 7472 792c 2074 6865 2070 registry, the p │ │ │ │ +001ac6e0: 6c75 6769 6e27 7320 6c6f 6361 6c20 6461 lugin's local da │ │ │ │ +001ac6f0: 7461 2069 7320 6173 736f 6369 6174 6564 ta is associated │ │ │ │ +001ac700: 2077 6974 6820 7468 6520 3c63 6f64 653e with the │ │ │ │ +001ac710: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap │ │ │ │ +001ac760: 3c2f 613e 3c2f 636f 6465 3e20 636f 6e74 cont │ │ │ │ +001ac770: 6578 742e 2042 7920 6f76 6572 7269 6469 ext. By overridi │ │ │ │ +001ac780: 6e67 2074 6865 2063 616c 6c62 6163 6b73 ng the callbacks │ │ │ │ +001ac790: 2077 6974 6820 7468 6520 706c 7567 696e with the plugin │ │ │ │ +001ac7a0: 2773 2063 616c 6c62 6163 6b73 2c20 7468 's callbacks, th │ │ │ │ +001ac7b0: 6520 706c 7567 696e 2065 7874 656e 6473 e plugin extends │ │ │ │ +001ac7c0: 206f 7220 6d6f 6469 6669 6573 2074 6865 or modifies the │ │ │ │ +001ac7d0: 2065 6e67 696e 6527 7320 6361 7061 6269 engine's capabi │ │ │ │ +001ac7e0: 6c69 7469 6573 2e20 5468 6520 6c6f 6361 lities. The loca │ │ │ │ +001ac7f0: 6c20 706c 7567 696e 2064 6174 6120 6361 l plugin data ca │ │ │ │ +001ac800: 6e20 6265 2061 6363 6573 7365 6420 7468 n be accessed th │ │ │ │ +001ac810: 726f 7567 6820 6120 6c6f 6f6b 7570 2066 rough a lookup f │ │ │ │ +001ac820: 756e 6374 696f 6e2c 2075 7375 616c 6c79 unction, usually │ │ │ │ +001ac830: 2069 6e76 6f6b 6564 2077 6974 6869 6e20 invoked within │ │ │ │ +001ac840: 6120 6361 6c6c 6261 636b 2066 756e 6374 a callback funct │ │ │ │ +001ac850: 696f 6e20 746f 2061 6363 6573 7320 7468 ion to access th │ │ │ │ +001ac860: 6520 706c 7567 696e 2064 6174 612e 2054 e plugin data. T │ │ │ │ +001ac870: 6865 2072 6567 6973 7472 7920 616e 6420 he registry and │ │ │ │ +001ac880: 6c6f 6f6b 7570 2066 756e 6374 696f 6e73 lookup functions │ │ │ │ +001ac890: 2061 7265 3a3c 2f70 3e0a 3c64 6976 2063 are:

    .
    │ │ │ │ +001ac8b0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65 .
    < │ │ │ │ +001acb90: 6120 6872 6566 3d22 6772 6f75 705f 5f67 a href="group__g │ │ │ │ +001acba0: 726f 7570 5f5f 706c 7567 696e 2e68 746d roup__plugin.htm │ │ │ │ +001acbb0: 6c23 6761 3830 3061 3030 3563 6530 6630 l#ga800a005ce0f0 │ │ │ │ +001acbc0: 3233 3634 3631 6431 6135 6462 6634 6265 236461d1a5dbf4be │ │ │ │ +001acbd0: 3261 3830 223e 736f 6170 5f72 6567 6973 2a80">soap_regis │ │ │ │ +001acbe0: 7465 725f 706c 7567 696e 5f61 7267 3c2f ter_plugin_arg
    int │ │ │ │ +001acc10: 736f 6170 5f72 6567 6973 7465 725f 706c soap_register_pl │ │ │ │ +001acc20: 7567 696e 5f61 7267 2873 7472 7563 7420 ugin_arg(struct │ │ │ │ +001acc30: 736f 6170 202a 736f 6170 2c20 696e 7428 soap *soap, int( │ │ │ │ +001acc40: 2a66 6372 6561 7465 2928 7374 7275 6374 *fcreate)(struct │ │ │ │ +001acc50: 2073 6f61 7020 2a2c 2073 7472 7563 7420 soap *, struct │ │ │ │ +001acc60: 736f 6170 5f70 6c75 6769 6e20 2a2c 2076 soap_plugin *, v │ │ │ │ +001acc70: 6f69 6420 2a29 2c20 766f 6964 202a 6172 oid *), void *ar │ │ │ │ +001acc80: 6729 3c2f 6469 763e 3c64 6976 2063 6c61 g)
    Regis │ │ │ │ +001acca0: 7465 7220 6120 706c 7567 696e 2077 6974 ter a plugin wit │ │ │ │ +001accb0: 6820 616e 2061 7267 756d 656e 742e 3c2f h an argument.
    .

    The soap │ │ │ │ +001acec0: 5f63 6f70 793c 2f61 3e3c 2f63 6f64 653e _copy │ │ │ │ +001aced0: 2066 756e 6374 696f 6e20 7265 7475 726e function return │ │ │ │ +001acee0: 7320 6120 6e65 7720 6479 6e61 6d69 6361 s a new dynamica │ │ │ │ +001acef0: 6c6c 7920 616c 6c6f 6361 7465 6420 3c63 lly allocated │ │ │ │ +001acf50: 736f 6170 3c2f 613e 3c2f 636f 6465 3e20 soap │ │ │ │ +001acf60: 636f 6e74 6578 7420 7468 6174 2069 7320 context that is │ │ │ │ +001acf70: 6120 636f 7079 206f 6620 616e 6f74 6865 a copy of anothe │ │ │ │ +001acf80: 722c 2073 7563 6820 7468 6174 206e 6f20 r, such that no │ │ │ │ +001acf90: 6461 7461 2069 7320 7368 6172 6564 2062 data is shared b │ │ │ │ +001acfa0: 6574 7765 656e 2074 6865 2063 6f70 7920 etween the copy │ │ │ │ +001acfb0: 616e 6420 7468 6520 6f72 6967 696e 616c and the original │ │ │ │ +001acfc0: 2063 6f6e 7465 7874 2e20 5468 6520 3c63 context. The s │ │ │ │ +001ad080: 6f61 705f 636f 7079 3c2f 613e 3c2f 636f oap_copy function inv │ │ │ │ +001ad0a0: 6f6b 6573 2074 6865 2063 6f70 7920 6675 okes the copy fu │ │ │ │ +001ad0b0: 6e63 7469 6f6e 7320 6f66 2074 6865 2072 nctions of the r │ │ │ │ +001ad0c0: 6567 6973 7465 7265 6420 706c 7567 696e egistered plugin │ │ │ │ +001ad0d0: 7320 746f 2063 6f70 7920 7468 6520 706c s to copy the pl │ │ │ │ +001ad0e0: 7567 696e 7327 206c 6f63 616c 2064 6174 ugins' local dat │ │ │ │ +001ad0f0: 612e 2054 6865 203c 636f 6465 3e3c 6120 a. The soap_done and │ │ │ │ +001ad1e0: 3c61 2063 6c61 7373 3d22 656c 2220 6872 │ │ │ │ +001ad280: 736f 6170 5f66 7265 653c 2f61 3e3c 2f63 soap_free functions d │ │ │ │ +001ad2a0: 652d 7265 6769 7374 6572 7320 616c 6c20 e-registers all │ │ │ │ +001ad2b0: 706c 7567 696e 2e3c 2f70 3e0a 3c70 3e54 plugin.

    .

    T │ │ │ │ +001ad2c0: 6865 2066 6f6c 6c6f 7720 6578 616d 706c he follow exampl │ │ │ │ +001ad2d0: 6520 6f76 6572 7269 6465 7320 7468 6520 e overrides the │ │ │ │ +001ad2e0: 7365 6e64 2061 6e64 2072 6563 6569 7665 send and receive │ │ │ │ +001ad2f0: 2063 616c 6c62 6163 6b73 2074 6f20 636f callbacks to co │ │ │ │ +001ad300: 7079 2061 6c6c 206d 6573 7361 6765 7320 py all messages │ │ │ │ +001ad310: 7468 6174 2061 7265 2073 656e 7420 616e that are sent an │ │ │ │ +001ad320: 6420 7265 6365 6976 6564 2074 6f20 7468 d received to th │ │ │ │ +001ad330: 6520 7465 726d 696e 616c 2028 7374 6465 e terminal (stde │ │ │ │ +001ad340: 7272 292e 3c2f 703e 0a3c 703e 4669 7273 rr).

    .

    Firs │ │ │ │ +001ad350: 742c 2077 6520 7772 6974 6520 6120 6865 t, we write a he │ │ │ │ +001ad360: 6164 6572 2066 696c 6520 3c65 6d3e 3c63 ader file plugin.h to defi │ │ │ │ +001ad390: 6e65 2074 6865 206c 6f63 616c 2070 6c75 ne the local plu │ │ │ │ +001ad3a0: 6769 6e20 6461 7461 2073 7472 7563 7475 gin data structu │ │ │ │ +001ad3b0: 7265 2873 2920 616e 6420 7765 2064 6566 re(s) and we def │ │ │ │ +001ad3c0: 696e 6520 6120 676c 6f62 616c 206e 616d ine a global nam │ │ │ │ +001ad3d0: 6520 746f 2069 6465 6e74 6966 7920 7468 e to identify th │ │ │ │ +001ad3e0: 6520 706c 7567 696e 3a3c 2f70 3e0a 3c64 e plugin:

    .
    #include " │ │ │ │ +001ad440: 3c61 2063 6c61 7373 3d22 636f 6465 2220 stdsoap2 │ │ │ │ +001ad470: 2e68 3c2f 613e 2671 756f 743b 3c2f 7370 .h"
    .
    #define │ │ │ │ +001ad4c0: 504c 5547 494e 5f49 4420 2671 756f 743b PLUGIN_ID " │ │ │ │ +001ad4d0: 504c 5547 494e 2d31 2e30 2671 756f 743b PLUGIN-1.0" │ │ │ │ +001ad4e0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c // │ │ │ │ +001ad500: 2073 6f6d 6520 6e61 6d65 2074 6f20 6964 some name to id │ │ │ │ +001ad510: 656e 7469 6679 2070 6c75 6769 6e20 3c2f entify plugin
    .
    < │ │ │ │ +001ad540: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    st │ │ │ │ +001ad570: 7275 6374 203c 2f73 7061 6e3e 706c 7567 ruct plug │ │ │ │ +001ad580: 696e 5f64 6174 6120 3c73 7061 6e20 636c in_data // │ │ │ │ +001ad5a0: 206c 6f63 616c 2070 6c75 6769 6e20 6461 local plugin da │ │ │ │ +001ad5b0: 7461 203c 2f73 7061 6e3e 3c2f 6469 763e ta
    │ │ │ │ +001ad5c0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    {
    .
    i │ │ │ │ +001ad5f0: 6e74 2028 2a66 7365 6e64 2928 3c73 7061 nt (*fsend)(struct │ │ │ │ +001ad620: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap* │ │ │ │ +001ad650: 2c20 3c73 7061 6e20 636c 6173 733d 226b , const c │ │ │ │ +001ad690: 6861 723c 2f73 7061 6e3e 2a2c 2073 697a har*, siz │ │ │ │ +001ad6a0: 655f 7429 3b20 3c73 7061 6e20 636c 6173 e_t); // t │ │ │ │ +001ad6c0: 6f20 7361 7665 2061 6e64 2075 7365 2073 o save and use s │ │ │ │ +001ad6d0: 656e 6420 6361 6c6c 6261 636b 203c 2f73 end callback
    .
    s │ │ │ │ +001ad700: 697a 655f 7420 282a 3c61 2063 6c61 7373 ize_t (*f │ │ │ │ +001ad760: 7265 6376 3c2f 613e 2928 3c73 7061 6e20 recv)( │ │ │ │ +001ad780: 7374 7275 6374 203c 2f73 7061 6e3e 3c61 struct soap*, │ │ │ │ +001ad7c0: 3c73 7061 6e20 636c 6173 733d 226b 6579 char*, size_t); │ │ │ │ +001ad7f0: 203c 7370 616e 2063 6c61 7373 3d22 636f // to sav │ │ │ │ +001ad810: 6520 616e 6420 7573 6520 7265 6376 2063 e and use recv c │ │ │ │ +001ad820: 616c 6c62 6163 6b20 3c2f 7370 616e 3e3c allback < │ │ │ │ +001ad830: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    };
    .
    in │ │ │ │ +001ad880: 743c 2f73 7061 6e3e 2070 6c75 6769 6e28 t plugin( │ │ │ │ +001ad890: 3c73 7061 6e20 636c 6173 733d 226b 6579 struct soap< │ │ │ │ +001ad8e0: 2f61 3e20 2a3c 6120 636c 6173 733d 2263 /a> *soap │ │ │ │ +001ad910: 3c2f 613e 2c20 3c73 7061 6e20 636c 6173 , stru │ │ │ │ +001ad930: 6374 3c2f 7370 616e 3e20 736f 6170 5f70 ct soap_p │ │ │ │ +001ad940: 6c75 6769 6e20 2a70 6c75 6769 6e2c 203c lugin *plugin, < │ │ │ │ +001ad950: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +001ad960: 6f72 6474 7970 6522 3e76 6f69 643c 2f73 ordtype">void *arg);
    .
    │ │ │ │ +001ada00: 5468 6973 2066 696c 6520 6465 6669 6e65 This file define │ │ │ │ +001ada10: 7320 7468 6520 636f 6d6d 6f6e 206d 6163 s the common mac │ │ │ │ +001ada20: 726f 732c 2074 7970 6573 2061 6e64 2066 ros, types and f │ │ │ │ +001ada30: 756e 6374 696f 6e73 206f 6620 7468 6520 unctions of the │ │ │ │ +001ada40: 6753 4f41 5020 4150 4920 6772 6f75 7065 gSOAP API groupe │ │ │ │ +001ada50: 6420 6279 206d 6f64 756c 6573 3c2f 6469 d by modules
    .
    < │ │ │ │ +001ada70: 212d 2d20 6672 6167 6d65 6e74 202d 2d3e !-- fragment --> │ │ │ │ +001ada80: 3c70 3e54 6865 6e2c 2077 6520 7772 6974

    Then, we writ │ │ │ │ +001ada90: 6520 7468 6520 706c 7567 696e 2072 6567 e the plugin reg │ │ │ │ +001adaa0: 6973 7472 7920 6675 6e63 7469 6f6e 2061 istry function a │ │ │ │ +001adab0: 6e64 2074 6865 2063 616c 6c62 6163 6b73 nd the callbacks │ │ │ │ +001adac0: 3a3c 2f70 3e0a 3c64 6976 2063 6c61 7373 :

    .
    #includ │ │ │ │ +001adb10: 6520 2671 756f 743b 706c 7567 696e 2e68 e "plugin.h │ │ │ │ +001adb20: 2671 756f 743b 3c2f 7370 616e 3e20 3c2f " .
    .< │ │ │ │ +001adb50: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +001adb60: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >static
    const │ │ │ │ +001adba0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c char pl │ │ │ │ +001adbd0: 7567 696e 5f69 645b 5d20 3d20 504c 5547 ugin_id[] = PLUG │ │ │ │ +001adbe0: 494e 5f49 443b 203c 7370 616e 2063 6c61 IN_ID; // │ │ │ │ +001adc00: 7468 6520 706c 7567 696e 2069 6420 3c2f the plugin id
    .
    static int< │ │ │ │ +001adc70: 2f73 7061 6e3e 2070 6c75 6769 6e5f 696e /span> plugin_in │ │ │ │ +001adc80: 6974 283c 7370 616e 2063 6c61 7373 3d22 it(struct< │ │ │ │ +001adca0: 2f73 7061 6e3e 203c 6120 636c 6173 733d /span> so │ │ │ │ +001adcd0: 6170 3c2f 613e 202a 3c61 2063 6c61 7373 ap *s │ │ │ │ +001add00: 6f61 703c 2f61 3e2c 203c 7370 616e 2063 oap, s │ │ │ │ +001add20: 7472 7563 743c 2f73 7061 6e3e 2070 6c75 truct plu │ │ │ │ +001add30: 6769 6e5f 6461 7461 202a 6461 7461 293b gin_data *data); │ │ │ │ +001add40: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    ..
    static < │ │ │ │ +001adee0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +001adef0: 6f72 6474 7970 6522 3e76 6f69 643c 2f73 ordtype">void plugin_dele │ │ │ │ +001adf10: 7465 283c 7370 616e 2063 6c61 7373 3d22 te(struct< │ │ │ │ +001adf30: 2f73 7061 6e3e 203c 6120 636c 6173 733d /span> so │ │ │ │ +001adf60: 6170 3c2f 613e 202a 3c61 2063 6c61 7373 ap *s │ │ │ │ +001adf90: 6f61 703c 2f61 3e2c 203c 7370 616e 2063 oap, s │ │ │ │ +001adfb0: 7472 7563 743c 2f73 7061 6e3e 2073 6f61 truct soa │ │ │ │ +001adfc0: 705f 706c 7567 696e 202a 7029 3b20 3c2f p_plugin *p); .
    sta │ │ │ │ +001ae000: 7469 633c 2f73 7061 6e3e 203c 7370 616e tic int │ │ │ │ +001ae030: 706c 7567 696e 5f73 656e 6428 3c73 7061 plugin_send(struct │ │ │ │ +001ae060: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap │ │ │ │ +001ae090: 2a3c 6120 636c 6173 733d 2263 6f64 6522 *soap │ │ │ │ +001ae0c0: 2c20 3c73 7061 6e20 636c 6173 733d 226b , const c │ │ │ │ +001ae100: 6861 723c 2f73 7061 6e3e 202a 3c61 2063 har *buf, size_t len); .
    stati │ │ │ │ +001ae1c0: 633c 2f73 7061 6e3e 203c 7370 616e 2063 c size_t │ │ │ │ +001ae1f0: 2070 6c75 6769 6e5f 7265 6376 283c 7370 plugin_recv(struct │ │ │ │ +001ae220: 203c 6120 636c 6173 733d 2263 6f64 6522 soap │ │ │ │ +001ae250: 202a 3c61 2063 6c61 7373 3d22 636f 6465 *soap, cha │ │ │ │ +001ae2a0: 723c 2f73 7061 6e3e 202a 3c61 2063 6c61 r *buf, size_t len);
    │ │ │ │ +001ae330: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    .
    // the regist │ │ │ │ +001ae380: 7279 2066 756e 6374 696f 6e3a 203c 2f73 ry function:
    .
    int plugin(s │ │ │ │ +001ae3f0: 7472 7563 743c 2f73 7061 6e3e 203c 6120 truct soap *soap, < │ │ │ │ +001ae460: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +001ae470: 6f72 6422 3e73 7472 7563 743c 2f73 7061 ord">struct soap_plugin * │ │ │ │ +001ae490: 702c 203c 7370 616e 2063 6c61 7373 3d22 p, voi │ │ │ │ +001ae4b0: 643c 2f73 7061 6e3e 202a 6172 6729 203c d *arg) < │ │ │ │ +001ae4c0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    {
    . │ │ │ │ +001ae4e0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    p->id = p │ │ │ │ +001ae500: 6c75 6769 6e5f 6964 3b20 3c2f 6469 763e lugin_id;
    │ │ │ │ +001ae510: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    p->data │ │ │ │ +001ae530: 3d20 283c 7370 616e 2063 6c61 7373 3d22 = (voi │ │ │ │ +001ae550: 643c 2f73 7061 6e3e 2a29 6d61 6c6c 6f63 d*)malloc │ │ │ │ +001ae560: 283c 7370 616e 2063 6c61 7373 3d22 6b65 (sizeof(struc │ │ │ │ +001ae5a0: 743c 2f73 7061 6e3e 2070 6c75 6769 6e5f t plugin_ │ │ │ │ +001ae5b0: 6461 7461 2929 3b20 3c2f 6469 763e 0a3c data));
    .< │ │ │ │ +001ae5c0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +001ae5d0: 3e20 2070 2d26 6774 3b66 636f 7079 203d > p->fcopy = │ │ │ │ +001ae5e0: 2070 6c75 6769 6e5f 636f 7079 3b20 3c73 plugin_copy; /* optional: │ │ │ │ +001ae610: 2077 6865 6e20 7365 7420 7468 6520 706c when set the pl │ │ │ │ +001ae620: 7567 696e 206d 7573 7420 636f 7079 2069 ugin must copy i │ │ │ │ +001ae630: 7473 206c 6f63 616c 2064 6174 6120 2a2f ts local data */ │ │ │ │ +001ae640: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ │ +001ae660: 2020 702d 2667 743b 6664 656c 6574 6520 p->fdelete │ │ │ │ +001ae670: 3d20 706c 7567 696e 5f64 656c 6574 653b = plugin_delete; │ │ │ │ +001ae680: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    if │ │ │ │ +001ae6c0: 2870 2d26 6774 3b64 6174 6129 203c 2f64 (p->data) .
    {
    . │ │ │ │ +001ae6f0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    │ │ │ │ +001ae720: 6966 3c2f 7370 616e 3e20 2870 6c75 6769 if (plugi │ │ │ │ +001ae730: 6e5f 696e 6974 283c 6120 636c 6173 733d n_init(so │ │ │ │ +001ae760: 6170 3c2f 613e 2c20 283c 7370 616e 2063 ap, (s │ │ │ │ +001ae780: 7472 7563 743c 2f73 7061 6e3e 2070 6c75 truct plu │ │ │ │ +001ae790: 6769 6e5f 6461 7461 2a29 702d 2667 743b gin_data*)p-> │ │ │ │ +001ae7a0: 6461 7461 2929 203c 2f64 6976 3e0a 3c64 data))
    . │ │ │ │ +001ae7c0: 2020 2020 7b3c 2f64 6976 3e0a 3c64 6976 {
    .
    │ │ │ │ +001ae7e0: 2020 2020 6672 6565 2870 2d26 6774 3b64 free(p->d │ │ │ │ +001ae7f0: 6174 6129 3b20 3c73 7061 6e20 636c 6173 ata); // e │ │ │ │ +001ae810: 7272 6f72 3a20 636f 756c 6420 6e6f 7420 rror: could not │ │ │ │ +001ae820: 696e 6974 203c 2f73 7061 6e3e 3c2f 6469 init ..
    } │ │ │ │ +001ae920: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    }.
    return │ │ │ │ +001ae980: 3c61 2063 6c61 7373 3d22 636f 6465 2220 SOAP_OK; │ │ │ │ +001ae9e0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    } .
    .< │ │ │ │ +001aea30: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +001aea40: 6f72 6422 3e73 7461 7469 633c 2f73 7061 ord">static int │ │ │ │ +001aea70: 3c2f 7370 616e 3e20 706c 7567 696e 5f69 plugin_i │ │ │ │ +001aea80: 6e69 7428 3c73 7061 6e20 636c 6173 733d nit(struct │ │ │ │ +001aeaa0: 3c2f 7370 616e 3e20 3c61 2063 6c61 7373 s │ │ │ │ +001aead0: 6f61 703c 2f61 3e20 2a3c 6120 636c 6173 oap * │ │ │ │ +001aeb00: 736f 6170 3c2f 613e 2c20 3c73 7061 6e20 soap, │ │ │ │ +001aeb20: 7374 7275 6374 3c2f 7370 616e 3e20 706c struct pl │ │ │ │ +001aeb30: 7567 696e 5f64 6174 6120 2a64 6174 6129 ugin_data *data) │ │ │ │ +001aeb40: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    {
    .
    data->f │ │ │ │ +001aeb80: 7365 6e64 203d 203c 6120 636c 6173 733d send = so │ │ │ │ +001aebb0: 6170 3c2f 613e 2d26 6774 3b3c 6120 636c ap->fsend; // save old r │ │ │ │ +001aec40: 6563 7620 6361 6c6c 6261 636b 203c 2f73 ecv callback
    .
    d │ │ │ │ +001aec70: 6174 612d 2667 743b 6672 6563 7620 3d20 ata->frecv = │ │ │ │ +001aec80: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap- │ │ │ │ +001aecb0: 2667 743b 3c61 2063 6c61 7373 3d22 636f >frecv │ │ │ │ +001aed10: 3c2f 613e 3b20 3c73 7061 6e20 636c 6173 ; // s │ │ │ │ +001aed30: 6176 6520 6f6c 6420 7365 6e64 2063 616c ave old send cal │ │ │ │ +001aed40: 6c62 6163 6b20 3c2f 7370 616e 3e3c 2f64 lback .
    s │ │ │ │ +001aed90: 6f61 703c 2f61 3e2d 2667 743b 3c61 2063 oap->fsend = p │ │ │ │ +001aee00: 6c75 6769 6e5f 7365 6e64 3b20 3c73 7061 lugin_send; // replace sen │ │ │ │ +001aee30: 6420 6361 6c6c 6261 636b 2077 6974 6820 d callback with │ │ │ │ +001aee40: 6e65 7720 3c2f 7370 616e 3e3c 2f64 6976 new
    .
    soa │ │ │ │ +001aee90: 703c 2f61 3e2d 2667 743b 3c61 2063 6c61 p->frecv = plu │ │ │ │ +001aef00: 6769 6e5f 7265 6376 3b20 3c73 7061 6e20 gin_recv; │ │ │ │ +001aef20: 2f2f 2072 6570 6c61 6365 2072 6563 7620 // replace recv │ │ │ │ +001aef30: 6361 6c6c 6261 636b 2077 6974 6820 6e65 callback with ne │ │ │ │ +001aef40: 7720 3c2f 7370 616e 3e3c 2f64 6976 3e0a w
    . │ │ │ │ +001aef50: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    re │ │ │ │ +001aef80: 7475 726e 3c2f 7370 616e 3e20 3c61 2063 turn │ │ │ │ +001aefe0: 534f 4150 5f4f 4b3c 2f61 3e3b 203c 2f64 SOAP_OK; .
    }
    .< │ │ │ │ +001af010: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +001af020: 3e20 3c2f 6469 763e 0a3c 6469 7620 636c >
    .
    // copy plugin │ │ │ │ +001af060: 6461 7461 2c20 6361 6c6c 6564 2062 7920 data, called by │ │ │ │ +001af070: 736f 6170 5f63 6f70 7928 293c 2f73 7061 soap_copy()
    .
    // This is impo │ │ │ │ +001af0c0: 7274 616e 743a 2077 6520 6e65 6564 2061 rtant: we need a │ │ │ │ +001af0d0: 2064 6565 7020 636f 7079 2074 6f20 6176 deep copy to av │ │ │ │ +001af0e0: 6f69 6420 6461 7461 2073 6861 7269 6e67 oid data sharing │ │ │ │ +001af0f0: 2062 7920 7477 6f20 636f 6e74 6578 7473 by two contexts │ │ │ │ +001af100: 203c 2f73 7061 6e3e 3c2f 6469 763e 0a3c
    .< │ │ │ │ +001af110: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +001af120: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >static i │ │ │ │ +001af160: 6e74 3c2f 7370 616e 3e20 706c 7567 696e nt plugin │ │ │ │ +001af170: 5f63 6f70 7928 3c73 7061 6e20 636c 6173 _copy(stru │ │ │ │ +001af190: 6374 3c2f 7370 616e 3e20 3c61 2063 6c61 ct soap *soap, struct │ │ │ │ +001af220: 736f 6170 5f70 6c75 6769 6e20 2a64 7374 soap_plugin *dst │ │ │ │ +001af230: 2c20 3c73 7061 6e20 636c 6173 733d 226b , struct soap_plugi │ │ │ │ +001af260: 6e20 2a73 7263 2920 3c2f 6469 763e 0a3c n *src)
    .< │ │ │ │ +001af270: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +001af280: 3e7b 3c2f 6469 763e 0a3c 6469 7620 636c >{
    .
    if │ │ │ │ +001af2c0: 2028 2128 6473 742d 2667 743b 6461 7461 (!(dst->data │ │ │ │ +001af2d0: 203d 2028 3c73 7061 6e20 636c 6173 733d = (struct │ │ │ │ +001af2f0: 3c2f 7370 616e 3e20 706c 7567 696e 5f64 plugin_d │ │ │ │ +001af300: 6174 612a 296d 616c 6c6f 6328 3c73 7061 ata*)malloc(sizeof( │ │ │ │ +001af330: 3c73 7061 6e20 636c 6173 733d 226b 6579 struct plugin_data) │ │ │ │ +001af360: 2929 2920 3c2f 6469 763e 0a3c 6469 7620 )))
    .
    │ │ │ │ +001af380: 203c 7370 616e 2063 6c61 7373 3d22 6b65 retur │ │ │ │ +001af3a0: 6e3c 2f73 7061 6e3e 203c 6120 636c 6173 n SOA │ │ │ │ +001af400: 505f 454f 4d3c 2f61 3e3b 203c 2f64 6976 P_EOM;
    .
    *dst->d │ │ │ │ +001af430: 6174 6120 3d20 2a73 7263 2d26 6774 3b64 ata = *src->d │ │ │ │ +001af440: 6174 613b 203c 2f64 6976 3e0a 3c64 6976 ata;
    .
    │ │ │ │ +001af460: 3c73 7061 6e20 636c 6173 733d 226b 6579 return │ │ │ │ +001af480: 3c2f 7370 616e 3e20 3c61 2063 6c61 7373 SOAP │ │ │ │ +001af4e0: 5f4f 4b3c 2f61 3e3b 203c 2f64 6976 3e0a _OK;
    . │ │ │ │ +001af4f0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    }
    .
    .
    // │ │ │ │ +001af550: 706c 7567 696e 2064 656c 6574 696f 6e2c plugin deletion, │ │ │ │ +001af560: 2063 616c 6c65 6420 6279 2073 6f61 705f called by soap_ │ │ │ │ +001af570: 646f 6e65 2829 203c 2f73 7061 6e3e 3c2f done() .
    sta │ │ │ │ +001af5b0: 7469 633c 2f73 7061 6e3e 203c 7370 616e tic void │ │ │ │ +001af5e0: 2070 6c75 6769 6e5f 6465 6c65 7465 283c plugin_delete(< │ │ │ │ +001af5f0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +001af600: 6f72 6422 3e73 7472 7563 743c 2f73 7061 ord">struct soap *soap< │ │ │ │ +001af670: 2f61 3e2c 203c 7370 616e 2063 6c61 7373 /a>, struc │ │ │ │ +001af690: 743c 2f73 7061 6e3e 2073 6f61 705f 706c t soap_pl │ │ │ │ +001af6a0: 7567 696e 202a 7029 203c 2f64 6976 3e0a ugin *p)
    . │ │ │ │ +001af6b0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    {
    .
    fr │ │ │ │ +001af6e0: 6565 2870 2d26 6774 3b64 6174 6129 3b20 ee(p->data); │ │ │ │ +001af6f0: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // free al │ │ │ │ +001af710: 6c6f 6361 7465 6420 706c 7567 696e 2064 located plugin d │ │ │ │ +001af720: 6174 6120 3c2f 7370 616e 3e3c 2f64 6976 ata
    .
    }
    . │ │ │ │ +001af760: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    / │ │ │ │ +001af790: 2f20 7468 6520 6e65 7720 7365 6e64 2063 / the new send c │ │ │ │ +001af7a0: 616c 6c62 6163 6b20 3c2f 7370 616e 3e3c allback < │ │ │ │ +001af7b0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    st │ │ │ │ +001af7e0: 6174 6963 3c2f 7370 616e 3e20 3c73 7061 atic int │ │ │ │ +001af810: 2070 6c75 6769 6e5f 7365 6e64 283c 7370 plugin_send(struct │ │ │ │ +001af840: 203c 6120 636c 6173 733d 2263 6f64 6522 soap │ │ │ │ +001af870: 202a 3c61 2063 6c61 7373 3d22 636f 6465 *soap, const │ │ │ │ +001af8e0: 6368 6172 3c2f 7370 616e 3e20 2a3c 6120 char *buf, < │ │ │ │ +001af940: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +001af950: 6f72 6474 7970 6522 3e73 697a 655f 743c ordtype">size_t< │ │ │ │ +001af960: 2f73 7061 6e3e 206c 656e 2920 3c2f 6469 /span> len) .
    {
    . │ │ │ │ +001af9a0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 struct plugin_data │ │ │ │ +001af9d0: 202a 6461 7461 203d 2028 3c73 7061 6e20 *data = ( │ │ │ │ +001af9f0: 7374 7275 6374 203c 2f73 7061 6e3e 706c struct pl │ │ │ │ +001afa00: 7567 696e 5f64 6174 612a 2973 6f61 705f ugin_data*)soap_ │ │ │ │ +001afa10: 6c6f 6f6b 7570 5f70 6c75 6769 6e28 3c61 lookup_plugin(soap, p │ │ │ │ +001afa50: 6c75 6769 6e5f 6964 293b 203c 7370 616e lugin_id); // fetch plugin │ │ │ │ +001afa80: 2623 3339 3b73 206c 6f63 616c 2064 6174 's local dat │ │ │ │ +001afa90: 6120 3c2f 7370 616e 3e3c 2f64 6976 3e0a a
    . │ │ │ │ +001afaa0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    fwrite(buf, │ │ │ │ +001afac0: 6c65 6e2c 2031 2c20 7374 6465 7272 293b len, 1, stderr); │ │ │ │ +001afad0: 203c 7370 616e 2063 6c61 7373 3d22 636f // write │ │ │ │ +001afaf0: 6d65 7373 6167 6520 746f 2073 7464 6572 message to stder │ │ │ │ +001afb00: 7220 3c2f 7370 616e 3e3c 2f64 6976 3e0a r
    . │ │ │ │ +001afb10: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    re │ │ │ │ +001afb40: 7475 726e 3c2f 7370 616e 3e20 6461 7461 turn data │ │ │ │ +001afb50: 2d26 6774 3b66 7365 6e64 283c 6120 636c ->fsend(soap, buf, │ │ │ │ +001afb90: 206c 656e 293b 203c 7370 616e 2063 6c61 len); // │ │ │ │ +001afbb0: 7061 7373 2064 6174 6120 6f6e 2074 6f20 pass data on to │ │ │ │ +001afbc0: 6f6c 6420 7365 6e64 2063 616c 6c62 6163 old send callbac │ │ │ │ +001afbd0: 6b20 3c2f 7370 616e 3e3c 2f64 6976 3e0a k
    . │ │ │ │ +001afbe0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    }
    .
    .
    // │ │ │ │ +001afc40: 7468 6520 6e65 7720 7265 6365 6976 6520 the new receive │ │ │ │ +001afc50: 6361 6c6c 6261 636b 203c 2f73 7061 6e3e callback │ │ │ │ +001afc60: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    s │ │ │ │ +001afc90: 7461 7469 633c 2f73 7061 6e3e 203c 7370 tatic size_t plugin_recv │ │ │ │ +001afcd0: 283c 7370 616e 2063 6c61 7373 3d22 6b65 (struct soap │ │ │ │ +001afd20: 3c2f 613e 202a 3c61 2063 6c61 7373 3d22 *soa │ │ │ │ +001afd50: 703c 2f61 3e2c 203c 7370 616e 2063 6c61 p, char *bu │ │ │ │ +001afd80: 662c 203c 7370 616e 2063 6c61 7373 3d22 f, siz │ │ │ │ +001afda0: 655f 743c 2f73 7061 6e3e 206c 656e 2920 e_t len) │ │ │ │ +001afdb0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    {
    │ │ │ │ +001afdd0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    struc │ │ │ │ +001afe00: 7420 3c2f 7370 616e 3e70 6c75 6769 6e5f t plugin_ │ │ │ │ +001afe10: 6461 7461 202a 6461 7461 203d 2028 3c73 data *data = (struct plugin_data*)s │ │ │ │ +001afe50: 6f61 705f 6c6f 6f6b 7570 5f70 6c75 6769 oap_lookup_plugi │ │ │ │ +001afe60: 6e28 3c61 2063 6c61 7373 3d22 636f 6465 n(soap, plugin_id); < │ │ │ │ +001afea0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ +001afeb0: 656e 7422 3e2f 2f20 6665 7463 6820 706c ent">// fetch pl │ │ │ │ +001afec0: 7567 696e 2623 3339 3b73 206c 6f63 616c ugin's local │ │ │ │ +001afed0: 2064 6174 6120 3c2f 7370 616e 3e3c 2f64 data .
    size_t │ │ │ │ +001aff20: 7265 7320 3d20 6461 7461 2d26 6774 3b66 res = data->f │ │ │ │ +001aff30: 7265 6376 283c 6120 636c 6173 733d 2263 recv(soap │ │ │ │ +001aff60: 3c2f 613e 2c20 6275 662c 206c 656e 293b , buf, len); │ │ │ │ +001aff70: 203c 7370 616e 2063 6c61 7373 3d22 636f // get da │ │ │ │ +001aff90: 7461 2066 726f 6d20 6f6c 6420 7265 6376 ta from old recv │ │ │ │ +001affa0: 2063 616c 6c62 6163 6b20 3c2f 7370 616e callback
    .
    fwri │ │ │ │ +001affd0: 7465 2862 7566 2c20 7265 732c 2031 2c20 te(buf, res, 1, │ │ │ │ +001affe0: 7374 6465 7272 293b 203c 2f64 6976 3e0a stderr);
    . │ │ │ │ +001afff0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    re │ │ │ │ +001b0020: 7475 726e 3c2f 7370 616e 3e20 7265 733b turn res; │ │ │ │ +001b0030: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    }
    .
    SOAP_EOM
    #define S │ │ │ │ +001b0130: 4f41 505f 454f 4d3c 2f64 6976 3e3c 6469 OAP_EOM
    │ │ │ │ +001b0150: 4120 736f 6170 5f73 7461 7475 7320 6572 A soap_status er │ │ │ │ +001b0160: 726f 7220 636f 6465 3a20 6f75 7420 6f66 ror code: out of │ │ │ │ +001b0170: 206d 656d 6f72 792e 3c2f 6469 763e 3c64 memory.
    Definition:< │ │ │ │ +001b01a0: 2f62 3e20 7374 6473 6f61 7032 2e68 3a32 /b> stdsoap2.h:2 │ │ │ │ +001b01b0: 3337 313c 2f64 6976 3e3c 2f64 6976 3e0a 371
    . │ │ │ │ +001b01c0: 3c2f 6469 763e 3c21 2d2d 2066 7261 676d

    It is │ │ │ │ +001b01e0: 7468 6520 7265 7370 6f6e 7369 6269 6c69 the responsibili │ │ │ │ +001b01f0: 7479 206f 6620 7468 6520 706c 7567 696e ty of the plugin │ │ │ │ +001b0200: 2074 6f20 6861 6e64 6c65 2072 6567 6973 to handle regis │ │ │ │ +001b0210: 7472 7920 2869 6e69 7429 2c20 636f 7079 try (init), copy │ │ │ │ +001b0220: 2c20 616e 6420 6465 6c65 7469 6f6e 206f , and deletion o │ │ │ │ +001b0230: 6620 7468 6520 706c 7567 696e 2064 6174 f the plugin dat │ │ │ │ +001b0240: 6120 616e 6420 7265 7365 7420 6361 6c6c a and reset call │ │ │ │ +001b0250: 6261 636b 732e 3c2f 703e 0a3c 703e 5468 backs.

    .

    Th │ │ │ │ +001b0260: 6520 3c63 6f64 653e 6664 656c 6574 653c e fdelete< │ │ │ │ +001b0270: 2f63 6f64 653e 2063 616c 6c62 6163 6b20 /code> callback │ │ │ │ +001b0280: 6f66 203c 636f 6465 3e73 7472 7563 7420 of struct │ │ │ │ +001b0290: 736f 6170 5f70 6c75 6769 6e3c 2f63 6f64 soap_plugin must be set t │ │ │ │ +001b02b0: 6f20 6465 2d72 6567 6973 7465 7220 7468 o de-register th │ │ │ │ +001b02c0: 6520 706c 7567 696e 2061 6e64 206c 6574 e plugin and let │ │ │ │ +001b02d0: 2069 7420 6465 6c65 7465 2069 7473 2072 it delete its r │ │ │ │ +001b02e0: 6573 6f75 7263 6573 2e3c 2f70 3e0a 3c70 esources.

    .

    A plugin is cop │ │ │ │ +001b0300: 6965 6420 616c 6f6e 6720 7769 7468 2069 ied along with i │ │ │ │ +001b0310: 7473 2063 6f72 7265 7370 6f6e 6469 6e67 ts corresponding │ │ │ │ +001b0320: 203c 636f 6465 3e3c 6120 636c 6173 733d soap context with │ │ │ │ +001b0390: 7468 6520 3c63 6f64 653e 3c61 2063 6c61 the soap_copy call. │ │ │ │ +001b0460: 5468 6973 2066 756e 6374 696f 6e20 636f This function co │ │ │ │ +001b0470: 7069 6573 2061 203c 636f 6465 3e3c 6120 pies a soap context │ │ │ │ +001b04e0: 2061 6e64 2074 6865 2063 6861 696e 206f and the chain o │ │ │ │ +001b04f0: 6620 706c 7567 696e 732e 2049 7420 6973 f plugins. It is │ │ │ │ +001b0500: 2075 7020 746f 2074 6865 2070 6c75 6769 up to the plugi │ │ │ │ +001b0510: 6e20 696d 706c 656d 656e 7461 7469 6f6e n implementation │ │ │ │ +001b0520: 2074 6f20 7368 6172 6520 7468 6520 706c to share the pl │ │ │ │ +001b0530: 7567 696e 2064 6174 6120 6f72 206e 6f74 ugin data or not │ │ │ │ +001b0540: 2061 7320 666f 6c6c 6f77 733a 3c2f 703e as follows:

    │ │ │ │ +001b0550: 0a3c 756c 3e0a 3c6c 693e 6966 2074 6865 .
      .
    • if the │ │ │ │ +001b0560: 203c 636f 6465 3e66 636f 7079 2829 3c2f fcopy() callback i │ │ │ │ +001b0580: 7320 7365 7420 6279 2074 6865 2070 6c75 s set by the plu │ │ │ │ +001b0590: 6769 6e20 696e 6974 6961 6c69 7a61 7469 gin initializati │ │ │ │ +001b05a0: 6f6e 2c20 7468 6973 2063 616c 6c62 6163 on, this callbac │ │ │ │ +001b05b0: 6b20 7769 6c6c 2062 6520 6361 6c6c 6564 k will be called │ │ │ │ +001b05c0: 2074 6f20 616c 6c6f 7720 7468 6520 706c to allow the pl │ │ │ │ +001b05d0: 7567 696e 2074 6f20 636f 7079 2069 7473 ugin to copy its │ │ │ │ +001b05e0: 206c 6f63 616c 2064 6174 6120 7570 6f6e local data upon │ │ │ │ +001b05f0: 2061 203c 636f 6465 3e3c 6120 636c 6173 a soap_copy call. W │ │ │ │ +001b06c0: 6865 6e20 3c63 6f64 653e 3c61 2063 6c61 hen so │ │ │ │ +001b0790: 6170 5f64 6f6e 653c 2f61 3e3c 2f63 6f64 ap_done or soap │ │ │ │ +001b0850: 5f66 7265 653c 2f61 3e3c 2f63 6f64 653e _free │ │ │ │ +001b0860: 2069 7320 6361 6c6c 6564 206f 6e20 7468 is called on th │ │ │ │ +001b0870: 6973 203c 636f 6465 3e3c 6120 636c 6173 is soap context cop │ │ │ │ +001b08e0: 792c 2074 6865 203c 636f 6465 3e66 6465 y, the fde │ │ │ │ +001b08f0: 6c65 7465 2829 3c2f 636f 6465 3e20 6361 lete() ca │ │ │ │ +001b0900: 6c6c 6261 636b 2069 7320 6361 6c6c 6564 llback is called │ │ │ │ +001b0910: 2066 6f72 2064 6561 6c6c 6f63 6174 696f for deallocatio │ │ │ │ +001b0920: 6e20 616e 6420 636c 6561 6e75 7020 6f66 n and cleanup of │ │ │ │ +001b0930: 2074 6865 206c 6f63 616c 2064 6174 612e the local data. │ │ │ │ +001b0940: 3c2f 6c69 3e0a 3c6c 693e 6966 2074 6865
    • .
    • if the │ │ │ │ +001b0950: 203c 636f 6465 3e66 636f 7079 2829 3c2f fcopy() callback i │ │ │ │ +001b0970: 7320 6e6f 7420 7365 742c 2074 6865 6e20 s not set, then │ │ │ │ +001b0980: 7468 6520 706c 7567 696e 2064 6174 6120 the plugin data │ │ │ │ +001b0990: 7769 6c6c 2062 6520 7368 6172 6564 2028 will be shared ( │ │ │ │ +001b09a0: 692e 652e 2074 6865 2064 6174 6120 706f i.e. the data po │ │ │ │ +001b09b0: 696e 7465 7220 706f 696e 7473 2074 6f20 inter points to │ │ │ │ +001b09c0: 7468 6520 7361 6d65 2061 6464 7265 7373 the same address │ │ │ │ +001b09d0: 292e 2054 6865 203c 636f 6465 3e66 6465 ). The fde │ │ │ │ +001b09e0: 6c65 7465 2829 3c2f 636f 6465 3e20 6361 lete() ca │ │ │ │ +001b09f0: 6c6c 6261 636b 2077 696c 6c20 6e6f 7420 llback will not │ │ │ │ +001b0a00: 6265 2063 616c 6c65 6420 7570 6f6e 2061 be called upon a │ │ │ │ +001b0a10: 203c 636f 6465 3e3c 6120 636c 6173 733d soap_ │ │ │ │ +001b0ae0: 646f 6e65 3c2f 613e 3c2f 636f 6465 3e20 done │ │ │ │ +001b0af0: 6f6e 2061 2063 6f70 7920 6f66 2074 6865 on a copy of the │ │ │ │ +001b0b00: 203c 636f 6465 3e3c 6120 636c 6173 733d soap context . The │ │ │ │ +001b0b70: 203c 636f 6465 3e66 6465 6c65 7465 2829 fdelete() │ │ │ │ +001b0b80: 3c2f 636f 6465 3e20 6361 6c6c 6261 636b callback │ │ │ │ +001b0b90: 2077 696c 6c20 6265 2063 616c 6c65 6420 will be called │ │ │ │ +001b0ba0: 666f 7220 7468 6520 6f72 6967 696e 616c for the original │ │ │ │ +001b0bb0: 203c 636f 6465 3e3c 6120 636c 6173 733d soap context with │ │ │ │ +001b0c20: 7768 6963 6820 7468 6520 706c 7567 696e which the plugin │ │ │ │ +001b0c30: 2077 6173 2072 6567 6973 7465 7265 642e was registered. │ │ │ │ +001b0c40: 3c2f 6c69 3e0a 3c2f 756c 3e0a 3c70 3e54
    • .
    .

    T │ │ │ │ +001b0c50: 6865 2065 7861 6d70 6c65 2070 6c75 6769 he example plugi │ │ │ │ +001b0c60: 6e20 7368 6f75 6c64 2062 6520 7573 6564 n should be used │ │ │ │ +001b0c70: 2061 7320 666f 6c6c 6f77 733a 3c2f 703e as follows:

    │ │ │ │ +001b0c80: 0a3c 6469 7620 636c 6173 733d 2266 7261 .
    s │ │ │ │ +001b0cc0: 7472 7563 7420 3c2f 7370 616e 3e3c 6120 truct soap *soap = │ │ │ │ +001b0d30: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap_new();
    .
    soap_register_ │ │ │ │ +001b0e10: 706c 7567 696e 3c2f 613e 283c 6120 636c plugin(soap, plug │ │ │ │ +001b0e50: 696e 293b 203c 2f64 6976 3e0a 3c2f 6469 in);
    .

    To pass a │ │ │ │ +001b0e80: 3c63 6f64 653e 766f 6964 2a3c 2f63 6f64 void* argument to t │ │ │ │ +001b0ea0: 6865 2070 6c75 6769 6e27 7320 7265 6769 he plugin's regi │ │ │ │ +001b0eb0: 7374 7279 2066 756e 6374 696f 6e20 7573 stry function us │ │ │ │ +001b0ec0: 653a 3c2f 703e 0a3c 6469 7620 636c 6173 e:

    .
    < │ │ │ │ +001b0ef0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +001b0f00: 6f72 6422 3e73 7472 7563 7420 3c2f 7370 ord">struct soap *soap< │ │ │ │ +001b0f70: 2f61 3e20 3d20 3c61 2063 6c61 7373 3d22 /a> = soap_ │ │ │ │ +001b0fd0: 6e65 773c 2f61 3e28 293b 203c 2f64 6976 new();
    ..

    This d │ │ │ │ +001b1740: 6563 6c61 7265 7320 3c63 6f64 653e 7873 eclares xs │ │ │ │ +001b1750: 645f 5f61 6e79 5479 7065 3c2f 636f 6465 d__anyType and xsd_ │ │ │ │ +001b1770: 5f61 6e79 4174 7472 6962 7574 653c 2f63 _anyAttribute types.

    . │ │ │ │ +001b1790: 3c70 3e41 2044 4f4d 2065 6c65 6d65 6e74

    A DOM element │ │ │ │ +001b17a0: 206e 6f64 6520 6973 2073 6572 6961 6c69 node is seriali │ │ │ │ +001b17b0: 7a65 6420 7769 7468 2074 6865 203c 636f zed with the xsd__anyType< │ │ │ │ +001b17d0: 2f63 6f64 653e 2073 6572 6961 6c69 7a61 /code> serializa │ │ │ │ +001b17e0: 626c 6520 7479 7065 2e20 5468 6520 756e ble type. The un │ │ │ │ +001b17f0: 6465 726c 7969 6e67 2069 6d70 6c65 6d65 derlying impleme │ │ │ │ +001b1800: 6e74 6174 696f 6e20 7479 7065 206f 6620 ntation type of │ │ │ │ +001b1810: 3c63 6f64 653e 7873 645f 5f61 6e79 5479 xsd__anyTy │ │ │ │ +001b1820: 7065 3c2f 636f 6465 3e20 6973 203c 636f pe is soap_dom_elem │ │ │ │ +001b1840: 656e 743c 2f63 6f64 653e 2e20 4f6e 6520 ent. One │ │ │ │ +001b1850: 6f72 206d 6f72 6520 444f 4d20 6174 7472 or more DOM attr │ │ │ │ +001b1860: 6962 7574 6520 6e6f 6465 7320 6172 6520 ibute nodes are │ │ │ │ +001b1870: 7365 7269 616c 697a 6564 2077 6974 6820 serialized with │ │ │ │ +001b1880: 7468 6520 3c63 6f64 653e 7873 645f 5f61 the xsd__a │ │ │ │ +001b1890: 6e79 4174 7472 6962 7574 653c 2f63 6f64 nyAttribute serializable │ │ │ │ +001b18b0: 7479 7065 2e20 5468 6520 756e 6465 726c type. The underl │ │ │ │ +001b18c0: 7969 6e67 2069 6d70 6c65 6d65 6e74 6174 ying implementat │ │ │ │ +001b18d0: 696f 6e20 7479 7065 206f 6620 3c63 6f64 ion type of xsd__anyAttrib │ │ │ │ +001b18f0: 7574 653c 2f63 6f64 653e 2069 7320 3c63 ute is soap_dom_att │ │ │ │ +001b1910: 7269 6275 7465 3c2f 636f 6465 3e2c 2077 ribute, w │ │ │ │ +001b1920: 6869 6368 2069 7320 6120 6c69 6e6b 6564 hich is a linked │ │ │ │ +001b1930: 206c 6973 742e 3c2f 703e 0a3c 6469 7620 list.

    .
    .< │ │ │ │ +001b2700: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +001b2710: 3e3c 6120 636c 6173 733d 2263 6f64 6522 >soap_set_log │ │ │ │ +001b2770: 6769 6e67 5f6f 7574 626f 756e 643c 2f61 ging_outbound(soap, NULL); │ │ │ │ +001b27d0: 2f2f 2064 6973 6162 6c65 206c 6f67 6769 // disable loggi │ │ │ │ +001b27e0: 6e67 203c 2f73 7061 6e3e 3c2f 6469 763e ng
    #i │ │ │ │ +001b1980: 6d70 6f72 7420 2671 756f 743b 646f 6d2e mport "dom. │ │ │ │ +001b1990: 6826 7175 6f74 3b3c 2f73 7061 6e3e 203c h" < │ │ │ │ +001b19a0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ +001b19b0: 656e 7422 3e2f 2f20 696d 706f 7274 7320 ent">// imports │ │ │ │ +001b19c0: 7873 645f 5f61 6e79 5479 7065 2061 7320 xsd__anyType as │ │ │ │ +001b19d0: 6120 444f 4d20 6e6f 6465 3c2f 7370 616e a DOM node
    .
    .
    class │ │ │ │ +001b1a30: 3c2f 7370 616e 3e6e 735f 5f64 6174 6120 ns__data │ │ │ │ +001b1a40: 3a20 3c73 7061 6e20 636c 6173 733d 226b : public xsd__anyTy │ │ │ │ +001b1a70: 7065 3c2f 6469 763e 0a3c 6469 7620 636c pe
    .
    { public │ │ │ │ +001b1ab0: 3a3c 2f64 6976 3e0a 3c64 6976 2063 6c61 :
    .
    xs │ │ │ │ +001b1ad0: 645f 5f61 6e79 5479 7065 2a20 666f 6f3b d__anyType* foo; │ │ │ │ +001b1ae0: 2020 2020 2020 2020 2020 2020 2020 2020 │ │ │ │ +001b1af0: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // Store & │ │ │ │ +001b1b10: 6c74 3b66 6f6f 2667 743b 2065 6c65 6d65 lt;foo> eleme │ │ │ │ +001b1b20: 6e74 2069 6e20 444f 4d20 736f 6170 5f64 nt in DOM soap_d │ │ │ │ +001b1b30: 6f6d 5f65 6c65 6d65 6e74 3c2f 7370 616e om_element
    .
    xs │ │ │ │ +001b1b60: 645f 5f61 6e79 5479 7065 205f 5f61 6e79 d__anyType __any │ │ │ │ +001b1b70: 3b20 2020 2020 2020 2020 2020 2020 2020 ; │ │ │ │ +001b1b80: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // Store a │ │ │ │ +001b1ba0: 6e79 2065 6c65 6d65 6e74 2063 6f6e 7465 ny element conte │ │ │ │ +001b1bb0: 6e74 2069 6e20 444f 4d20 736f 6170 5f64 nt in DOM soap_d │ │ │ │ +001b1bc0: 6f6d 5f65 6c65 6d65 6e74 3c2f 7370 616e om_element
    .
    @ xs │ │ │ │ +001b1bf0: 645f 5f61 6e79 4174 7472 6962 7574 6520 d__anyAttribute │ │ │ │ +001b1c00: 5f5f 616e 7941 7474 7269 6275 7465 3b20 __anyAttribute; │ │ │ │ +001b1c10: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // Store a │ │ │ │ +001b1c30: 6e79 4174 7472 6962 7574 6520 636f 6e74 nyAttribute cont │ │ │ │ +001b1c40: 656e 7420 696e 2044 4f4d 2073 6f61 705f ent in DOM soap_ │ │ │ │ +001b1c50: 646f 6d5f 6174 7472 6962 7574 6520 6c69 dom_attribute li │ │ │ │ +001b1c60: 6e6b 6564 206e 6f64 6520 7374 7275 6374 nked node struct │ │ │ │ +001b1c70: 7572 653c 2f73 7061 6e3e 3c2f 6469 763e ure
    │ │ │ │ +001b1c80: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    };
    .

    To manipul │ │ │ │ +001b1cc0: 6174 6520 7468 6520 444f 4d20 656c 656d ate the DOM elem │ │ │ │ +001b1cd0: 656e 7473 2061 6e64 2061 7474 7269 6275 ents and attribu │ │ │ │ +001b1ce0: 7465 7320 7765 2075 7365 2074 6865 2044 tes we use the D │ │ │ │ +001b1cf0: 4f4d 2041 5049 2066 756e 6374 696f 6e73 OM API functions │ │ │ │ +001b1d00: 2064 6f63 756d 656e 7465 6420 696e 2074 documented in t │ │ │ │ +001b1d10: 6865 2067 534f 4150 203c 6120 6872 6566 he gSOAP XML │ │ │ │ +001b1d40: 2044 4f4d 2041 5049 2064 6f63 756d 656e DOM API documen │ │ │ │ +001b1d50: 7461 7469 6f6e 3c2f 613e 2e3c 2f70 3e0a tation.

    . │ │ │ │ +001b1d60: 3c70 3ef0 9f94 9d20 3c61 2068 7265 663d

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

    .

    < │ │ │ │ +001b1dc0: 2f61 3e0a 5468 6520 6d65 7373 6167 6520 /a>.The message │ │ │ │ +001b1dd0: 6c6f 6767 696e 6720 706c 7567 696e 3c2f logging plugin.

    The messa │ │ │ │ +001b1df0: 6765 203c 636f 6465 3e3c 6120 636c 6173 ge logg │ │ │ │ +001b1e80: 696e 673c 2f61 3e3c 2f63 6f64 653e 2070 ing p │ │ │ │ +001b1e90: 6c75 6769 6e20 6361 6e20 6265 2075 7365 lugin can be use │ │ │ │ +001b1ea0: 6420 746f 2073 656c 6563 7469 7665 6c79 d to selectively │ │ │ │ +001b1eb0: 206c 6f67 2069 6e62 6f75 6e64 2061 6e64 log inbound and │ │ │ │ +001b1ec0: 206f 7574 626f 756e 6420 6d65 7373 6167 outbound messag │ │ │ │ +001b1ed0: 6573 2074 6f20 6120 6669 6c65 206f 7220 es to a file or │ │ │ │ +001b1ee0: 7374 7265 616d 2e20 4974 2061 6c73 6f20 stream. It also │ │ │ │ +001b1ef0: 6b65 6570 7320 6163 6365 7373 2073 7461 keeps access sta │ │ │ │ +001b1f00: 7469 7374 6963 7320 746f 206c 6f67 2074 tistics to log t │ │ │ │ +001b1f10: 6865 2074 6f74 616c 206e 756d 6265 7220 he total number │ │ │ │ +001b1f20: 6f66 2062 7974 6573 2073 656e 7420 616e of bytes sent an │ │ │ │ +001b1f30: 6420 7265 6365 6976 6564 2e3c 2f70 3e0a d received.

    . │ │ │ │ +001b1f40: 3c70 3e54 6f20 7573 6520 7468 6520 706c

    To use the pl │ │ │ │ +001b1f50: 7567 696e 2c20 636f 6d70 696c 6520 616e ugin, compile an │ │ │ │ +001b1f60: 6420 6c69 6e6b 2079 6f75 7220 6170 706c d link your appl │ │ │ │ +001b1f70: 6963 6174 696f 6e20 7769 7468 203c 656d ication with logging.c │ │ │ │ +001b1f90: 3c2f 636f 6465 3e3c 2f65 6d3e 206c 6f63 loc │ │ │ │ +001b1fa0: 6174 6564 2069 6e20 7468 6520 3c65 6d3e ated in the │ │ │ │ +001b1fb0: 3c63 6f64 653e 6773 6f61 702f 706c 7567 gsoap/plug │ │ │ │ +001b1fc0: 696e 3c2f 636f 6465 3e3c 2f65 6d3e 2064 in d │ │ │ │ +001b1fd0: 6972 6563 746f 7279 206f 6620 7468 6520 irectory of the │ │ │ │ +001b1fe0: 6753 4f41 5020 7061 636b 6167 652e 2054 gSOAP package. T │ │ │ │ +001b1ff0: 6f20 656e 6162 6c65 2074 6865 2070 6c75 o enable the plu │ │ │ │ +001b2000: 6769 6e20 696e 2079 6f75 7220 636f 6465 gin in your code │ │ │ │ +001b2010: 2c20 7265 6769 7374 6572 2074 6865 2070 , register the p │ │ │ │ +001b2020: 6c75 6769 6e20 616e 6420 7365 7420 7468 lugin and set th │ │ │ │ +001b2030: 6520 7374 7265 616d 7320 6173 2066 6f6c e streams as fol │ │ │ │ +001b2040: 6c6f 7773 3a3c 2f70 3e0a 3c64 6976 2063 lows:

    .
    │ │ │ │ +001b2060: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    #in │ │ │ │ +001b2090: 636c 7564 6520 2671 756f 743b 6c6f 6767 clude "logg │ │ │ │ +001b20a0: 696e 672e 6826 7175 6f74 3b3c 2f73 7061 ing.h"
    .
    .
    stru │ │ │ │ +001b2100: 6374 203c 2f73 7061 6e3e 3c61 2063 6c61 ct soap *soap = soap_new() │ │ │ │ +001b21d0: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
    .
    size_t bytes_in; .
    s │ │ │ │ +001b2250: 697a 655f 743c 2f73 7061 6e3e 2062 7974 ize_t byt │ │ │ │ +001b2260: 6573 5f6f 7574 3b20 3c2f 6469 763e 0a3c es_out;
    .< │ │ │ │ +001b2270: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +001b2280: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >if
    (soap_r │ │ │ │ +001b2300: 6567 6973 7465 725f 706c 7567 696e 3c2f egister_plugin(soap, logging))
    .
    │ │ │ │ +001b23c0: 2e2e 2e20 3c73 7061 6e20 636c 6173 733d ... // fai │ │ │ │ +001b23e0: 6c65 6420 746f 2072 6567 6973 7465 7220 led to register │ │ │ │ +001b23f0: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ │ +001b2410: 2e2e 2e20 3c73 7061 6e20 636c 6173 733d ... //
    ..< │ │ │ │ +001b2510: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +001b2520: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ │ +001b2530: 705f 5f64 6562 7567 2e68 746d 6c23 6761 p__debug.html#ga │ │ │ │ +001b2540: 3038 6136 3765 3839 3839 6463 3834 3936 08a67e8989dc8496 │ │ │ │ +001b2550: 3032 6236 3165 3433 3861 3766 3836 6532 02b61e438a7f86e2 │ │ │ │ +001b2560: 223e 736f 6170 5f73 6574 5f6c 6f67 6769 ">soap_set_loggi │ │ │ │ +001b2570: 6e67 5f6f 7574 626f 756e 643c 2f61 3e28 ng_outbound( │ │ │ │ +001b2580: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap, │ │ │ │ +001b25b0: 2073 7464 6f75 7429 3b20 3c2f 6469 763e stdout);
    │ │ │ │ +001b25c0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    ... // │ │ │ │ +001b25f0: 7072 6f63 6573 7320 6d65 7373 6167 6573 process messages │ │ │ │ +001b2600: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ │ +001b2620: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap_set_logg │ │ │ │ +001b2680: 696e 675f 696e 626f 756e 643c 2f61 3e28 ing_inbound( │ │ │ │ +001b2690: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap, │ │ │ │ +001b26c0: 204e 554c 4c29 3b20 3c73 7061 6e20 636c NULL); // │ │ │ │ +001b26e0: 2064 6973 6162 6c65 206c 6f67 6769 6e67 disable logging │ │ │ │ +001b26f0: 203c 2f73 7061 6e3e 3c2f 6469 763e 0a3c

    │ │ │ │ +001b27f0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    soap_loggi │ │ │ │ +001b2860: 6e67 5f73 7461 7473 3c2f 613e 283c 6120 ng_stats(soap, &a │ │ │ │ +001b28a0: 6d70 3b62 7974 6573 5f6f 7574 2c20 2661 mp;bytes_out, &a │ │ │ │ +001b28b0: 6d70 3b62 7974 6573 5f69 6e29 3b3c 2f64 mp;bytes_in);.
    ... │ │ │ │ +001b28f0: 2f2f 3c2f 7370 616e 3e3c 2f64 6976 3e0a //
    . │ │ │ │ +001b2900: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65 .
    vo │ │ │ │ +001b2aa0: 6964 2073 6f61 705f 7365 745f 6c6f 6767 id soap_set_logg │ │ │ │ +001b2ab0: 696e 675f 6f75 7462 6f75 6e64 2873 7472 ing_outbound(str │ │ │ │ +001b2ac0: 7563 7420 736f 6170 202a 736f 6170 2c20 uct soap *soap, │ │ │ │ +001b2ad0: 4649 4c45 202a 6664 293c 2f64 6976 3e3c FILE *fd)
    < │ │ │ │ +001b2ae0: 6469 7620 636c 6173 733d 2274 7464 6f63 div class="ttdoc │ │ │ │ +001b2af0: 223e 5370 6563 6966 7920 6f75 7462 6f75 ">Specify outbou │ │ │ │ +001b2b00: 6e64 206d 6573 7361 6765 206c 6f67 6769 nd message loggi │ │ │ │ +001b2b10: 6e67 2077 6974 6820 7468 6520 6c6f 6767 ng with the logg │ │ │ │ +001b2b20: 696e 6720 706c 7567 696e 2e3c 2f64 6976 ing plugin.
    .
    < │ │ │ │ +001b2ba0: 6120 6872 6566 3d22 6772 6f75 705f 5f67 a href="group__g │ │ │ │ +001b2bb0: 726f 7570 5f5f 6465 6275 672e 6874 6d6c roup__debug.html │ │ │ │ +001b2bc0: 2367 6134 3936 3561 3264 3538 6165 6334 #ga4965a2d58aec4 │ │ │ │ +001b2bd0: 6165 3339 3833 6165 3733 6663 3731 3164 ae3983ae73fc711d │ │ │ │ +001b2be0: 6636 3022 3e73 6f61 705f 7265 7365 745f f60">soap_reset_ │ │ │ │ +001b2bf0: 6c6f 6767 696e 675f 7374 6174 733c 2f61 logging_stats
    void │ │ │ │ +001b2c20: 736f 6170 5f72 6573 6574 5f6c 6f67 6769 soap_reset_loggi │ │ │ │ +001b2c30: 6e67 5f73 7461 7473 2873 7472 7563 7420 ng_stats(struct │ │ │ │ +001b2c40: 736f 6170 202a 736f 6170 293c 2f64 6976 soap *soap)
    Reset messag │ │ │ │ +001b2c70: 696e 6720 7374 6174 6973 7469 6373 2077 ing statistics w │ │ │ │ +001b2c80: 6974 6820 7468 6520 6c6f 6767 696e 6720 ith the logging │ │ │ │ +001b2c90: 706c 7567 696e 2e3c 2f64 6976 3e3c 2f64 plugin.
    .
    void soap_loggi │ │ │ │ +001b2d90: 6e67 5f73 7461 7473 2873 7472 7563 7420 ng_stats(struct │ │ │ │ +001b2da0: 736f 6170 202a 736f 6170 2c20 7369 7a65 soap *soap, size │ │ │ │ +001b2db0: 5f74 202a 7365 6e74 2c20 7369 7a65 5f74 _t *sent, size_t │ │ │ │ +001b2dc0: 202a 7265 6376 293c 2f64 6976 3e3c 6469 *recv)
    │ │ │ │ +001b2de0: 436f 6c6c 6563 7420 6d65 7373 6167 696e Collect messagin │ │ │ │ +001b2df0: 6720 7374 6174 6973 7469 6373 2077 6974 g statistics wit │ │ │ │ +001b2e00: 6820 7468 6520 6c6f 6767 696e 6720 706c h the logging pl │ │ │ │ +001b2e10: 7567 696e 2e3c 2f64 6976 3e3c 2f64 6976 ugin.
    .
    void soap_s │ │ │ │ +001b2f10: 6574 5f6c 6f67 6769 6e67 5f69 6e62 6f75 et_logging_inbou │ │ │ │ +001b2f20: 6e64 2873 7472 7563 7420 736f 6170 202a nd(struct soap * │ │ │ │ +001b2f30: 736f 6170 2c20 4649 4c45 202a 6664 293c soap, FILE *fd)< │ │ │ │ +001b2f40: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
    Specify │ │ │ │ +001b2f60: 696e 626f 756e 6420 6d65 7373 6167 6520 inbound message │ │ │ │ +001b2f70: 6c6f 6767 696e 6720 7769 7468 2074 6865 logging with the │ │ │ │ +001b2f80: 206c 6f67 6769 6e67 2070 6c75 6769 6e2e logging plugin. │ │ │ │ +001b2f90: 3c2f 6469 763e 3c2f 6469 763e 0a3c 6469
    . │ │ │ │ +001b2ff0: 3c64 6976 2063 6c61 7373 3d22 7474 6e61
    i │ │ │ │ +001b3070: 6e74 206c 6f67 6769 6e67 2873 7472 7563 nt logging(struc │ │ │ │ +001b3080: 7420 736f 6170 202a 2c20 7374 7275 6374 t soap *, struct │ │ │ │ +001b3090: 2073 6f61 705f 706c 7567 696e 202a 2c20 soap_plugin *, │ │ │ │ +001b30a0: 766f 6964 202a 293c 2f64 6976 3e3c 6469 void *)
    │ │ │ │ +001b30c0: 5468 6520 6c6f 6767 696e 6720 706c 7567 The logging plug │ │ │ │ +001b30d0: 696e 2072 6567 6973 7472 6174 696f 6e20 in registration │ │ │ │ +001b30e0: 6675 6e63 7469 6f6e 2e3c 2f64 6976 3e3c function.
    < │ │ │ │ +001b30f0: 2f64 6976 3e0a 3c2f 6469 763e 3c21 2d2d /div>.

    │ │ │ │ +001b3110: 4966 2079 6f75 2075 7365 203c 636f 6465 If you use soap │ │ │ │ +001b31d0: 5f63 6f70 793c 2f61 3e3c 2f63 6f64 653e _copy │ │ │ │ +001b31e0: 2074 6f20 636f 7079 2074 6865 203c 636f to copy the s │ │ │ │ +001b3240: 6f61 703c 2f61 3e3c 2f63 6f64 653e 2063 oap c │ │ │ │ +001b3250: 6f6e 7465 7874 2077 6974 6820 7468 6520 ontext with the │ │ │ │ +001b3260: 706c 7567 696e 2c20 7468 6520 706c 7567 plugin, the plug │ │ │ │ +001b3270: 696e 2773 2073 7461 7465 2077 696c 6c20 in's state will │ │ │ │ +001b3280: 6265 2073 6861 7265 6420 6279 2074 6865 be shared by the │ │ │ │ +001b3290: 2063 6f70 792e 2054 6865 2070 6c75 6769 copy. The plugi │ │ │ │ +001b32a0: 6e20 6973 2074 6872 6561 642d 7361 6665 n is thread-safe │ │ │ │ +001b32b0: 2c20 6275 7420 646f 6573 206e 6f74 2075 , but does not u │ │ │ │ +001b32c0: 7365 2061 206c 6f63 6b20 746f 2070 726f se a lock to pro │ │ │ │ +001b32d0: 7465 6374 2074 6865 2069 6e74 6572 6e61 tect the interna │ │ │ │ +001b32e0: 6c20 7374 6174 6973 7469 6373 2063 6f75 l statistics cou │ │ │ │ +001b32f0: 6e74 6572 7320 746f 2065 6e73 7572 6520 nters to ensure │ │ │ │ +001b3300: 7468 6520 7370 6565 6420 6f66 206d 6573 the speed of mes │ │ │ │ +001b3310: 7361 6769 6e67 2069 7320 6e6f 7420 636f saging is not co │ │ │ │ +001b3320: 6d70 726f 6d69 7365 642c 206d 6561 6e69 mpromised, meani │ │ │ │ +001b3330: 6e67 2074 6861 7420 796f 7520 7368 6f75 ng that you shou │ │ │ │ +001b3340: 6c64 206e 6f74 2066 756c 6c79 2072 656c ld not fully rel │ │ │ │ +001b3350: 7920 6f6e 2074 6865 2073 7461 7469 7374 y on the statist │ │ │ │ +001b3360: 6963 7320 746f 2062 6520 3130 3025 2061 ics to be 100% a │ │ │ │ +001b3370: 6363 7572 6174 6520 666f 7220 6d75 6c74 ccurate for mult │ │ │ │ +001b3380: 692d 7468 7265 6164 6564 2073 6572 7669 i-threaded servi │ │ │ │ +001b3390: 6365 732e 3c2f 703e 0a3c 703e 5365 6520 ces.

    .

    See │ │ │ │ +001b33a0: 616c 736f 203c 636f 6465 3e3c 6120 636c also lo │ │ │ │ +001b3430: 6767 696e 673c 2f61 3e3c 2f63 6f64 653e gging │ │ │ │ +001b3440: 2e3c 2f70 3e0a 3c70 3ef0 9f94 9d20 3c61 .

    .

    .... Back t │ │ │ │ +001b3460: 6f20 7461 626c 6520 6f66 2063 6f6e 7465 o table of conte │ │ │ │ +001b3470: 6e74 733c 2f61 3e3c 2f70 3e0a 3c68 333e nts

    .

    │ │ │ │ +001b3480: 3c61 2063 6c61 7373 3d22 616e 6368 6f72 .RES │ │ │ │ +001b34b0: 5466 756c 2073 6572 7665 722d 7369 6465 Tful server-side │ │ │ │ +001b34c0: 2041 5049 2077 6974 6820 7468 6520 4854 API with the HT │ │ │ │ +001b34d0: 5450 2047 4554 2070 6c75 6769 6e3c 2f68 TP GET plugin.

    Server-sid │ │ │ │ +001b34f0: 6520 7573 6520 6f66 2052 4553 5466 756c e use of RESTful │ │ │ │ +001b3500: 2048 5454 5020 4745 5420 6f70 6572 6174 HTTP GET operat │ │ │ │ +001b3510: 696f 6e73 2069 7320 7375 7070 6f72 7465 ions is supporte │ │ │ │ +001b3520: 6420 7769 7468 2074 6865 203c 636f 6465 d with the http_get HTTP GET p │ │ │ │ +001b35d0: 6c75 6769 6e20 3c65 6d3e 3c63 6f64 653e lugin │ │ │ │ +001b35e0: 6773 6f61 702f 706c 7567 696e 2f68 7474 gsoap/plugin/htt │ │ │ │ +001b35f0: 7067 6574 2e63 3c2f 636f 6465 3e3c 2f65 pget.c.

    .

    The H │ │ │ │ +001b3610: 5454 5020 4745 5420 706c 7567 696e 2061 TTP GET plugin a │ │ │ │ +001b3620: 6c6c 6f77 7320 796f 7572 2073 6572 7665 llows your serve │ │ │ │ +001b3630: 7220 746f 2068 616e 646c 6520 5245 5354 r to handle REST │ │ │ │ +001b3640: 6675 6c20 4854 5450 2047 4554 2072 6571 ful HTTP GET req │ │ │ │ +001b3650: 7565 7374 7320 616e 6420 6174 2074 6865 uests and at the │ │ │ │ +001b3660: 2073 616d 6520 7469 6d65 2073 7469 6c6c same time still │ │ │ │ +001b3670: 2073 6572 7665 2053 4f41 502d 6261 7365 serve SOAP-base │ │ │ │ +001b3680: 6420 504f 5354 2072 6571 7565 7374 732e d POST requests. │ │ │ │ +001b3690: 2054 6865 2070 6c75 6769 6e20 7072 6f76 The plugin prov │ │ │ │ +001b36a0: 6964 6573 2073 7570 706f 7274 2074 6f20 ides support to │ │ │ │ +001b36b0: 636c 6965 6e74 2061 7070 6c69 6361 7469 client applicati │ │ │ │ +001b36c0: 6f6e 7320 746f 2069 7373 7565 2048 5454 ons to issue HTT │ │ │ │ +001b36d0: 5020 4745 5420 6f70 6572 6174 696f 6e73 P GET operations │ │ │ │ +001b36e0: 2074 6f20 6120 7365 7276 6572 2e3c 2f70 to a server.

    .

    Note that H │ │ │ │ +001b3700: 5454 5020 4745 5420 7265 7175 6573 7473 TTP GET requests │ │ │ │ +001b3710: 2063 616e 2061 6c73 6f20 6265 2068 616e can also be han │ │ │ │ +001b3720: 646c 6564 2061 7420 7468 6520 7365 7276 dled at the serv │ │ │ │ +001b3730: 6572 2073 6964 6520 7769 7468 2074 6865 er side with the │ │ │ │ +001b3740: 203c 636f 6465 3e3c 6120 636c 6173 733d soap::f │ │ │ │ +001b3810: 6765 743c 2f61 3e3c 2f63 6f64 653e 2063 get c │ │ │ │ +001b3820: 616c 6c62 6163 6b2c 2073 6565 2053 6563 allback, see Sec │ │ │ │ +001b3830: 7469 6f6e 203c 6120 636c 6173 733d 2265 tion Fu │ │ │ │ +001b3860: 6e63 7469 6f6e 2063 616c 6c62 6163 6b73 nction callbacks │ │ │ │ +001b3870: 2066 6f72 2063 7573 746f 6d69 7a65 6420 for customized │ │ │ │ +001b3880: 492f 4f20 616e 6420 4854 5450 2068 616e I/O and HTTP han │ │ │ │ +001b3890: 646c 696e 673c 2f61 3e20 2e20 486f 7765 dling . Howe │ │ │ │ +001b38a0: 7665 722c 2074 6865 2048 5454 5020 4745 ver, the HTTP GE │ │ │ │ +001b38b0: 5420 706c 7567 696e 2061 6c73 6f20 6b65 T plugin also ke │ │ │ │ +001b38c0: 6570 7320 7374 6174 6973 7469 6373 206f eps statistics o │ │ │ │ +001b38d0: 6e20 7468 6520 6e75 6d62 6572 206f 6620 n the number of │ │ │ │ +001b38e0: 7375 6363 6573 7366 756c 2050 4f53 5420 successful POST │ │ │ │ +001b38f0: 616e 6420 4745 5420 6578 6368 616e 6765 and GET exchange │ │ │ │ +001b3900: 7320 616e 6420 6661 696c 6564 206f 7065 s and failed ope │ │ │ │ +001b3910: 7261 7469 6f6e 7320 2848 5454 5020 6661 rations (HTTP fa │ │ │ │ +001b3920: 756c 7473 2c20 534f 4150 2046 6175 6c74 ults, SOAP Fault │ │ │ │ +001b3930: 732c 2065 7463 2e29 2e20 4974 2061 6c73 s, etc.). It als │ │ │ │ +001b3940: 6f20 6b65 6570 7320 6869 7420 6869 7374 o keeps hit hist │ │ │ │ +001b3950: 6f67 7261 6d73 2061 6363 756d 756c 6174 ograms accumulat │ │ │ │ +001b3960: 6564 2066 6f72 2075 7020 746f 2061 2079 ed for up to a y │ │ │ │ +001b3970: 6561 7220 6f66 2072 756e 6e69 6e67 2074 ear of running t │ │ │ │ +001b3980: 696d 652e 3c2f 703e 0a3c 703e 546f 2075 ime.

    .

    To u │ │ │ │ +001b3990: 7365 2074 6865 203c 636f 6465 3e3c 6120 se the ht │ │ │ │ +001b3a20: 7470 5f67 6574 3c2f 613e 3c2f 636f 6465 tp_get plugin, compil │ │ │ │ +001b3a40: 6520 616e 6420 6c69 6e6b 2079 6f75 7220 e and link your │ │ │ │ +001b3a50: 6170 706c 6963 6174 696f 6e20 7769 7468 application with │ │ │ │ +001b3a60: 203c 656d 3e3c 636f 6465 3e68 7474 7067 httpg │ │ │ │ +001b3a70: 6574 2e63 3c2f 636f 6465 3e3c 2f65 6d3e et.c │ │ │ │ +001b3a80: 206c 6f63 6174 6564 2069 6e20 7468 6520 located in the │ │ │ │ +001b3a90: 3c65 6d3e 3c63 6f64 653e 6773 6f61 702f gsoap/ │ │ │ │ +001b3aa0: 706c 7567 696e 3c2f 636f 6465 3e3c 2f65 plugin directory of │ │ │ │ +001b3ac0: 7468 6520 6753 4f41 5020 7061 636b 6167 the gSOAP packag │ │ │ │ +001b3ad0: 652e 2054 6f20 656e 6162 6c65 2074 6865 e. To enable the │ │ │ │ +001b3ae0: 2070 6c75 6769 6e20 696e 2079 6f75 7220 plugin in your │ │ │ │ +001b3af0: 636f 6465 2c20 7265 6769 7374 6572 2074 code, register t │ │ │ │ +001b3b00: 6865 2070 6c75 6769 6e20 7769 7468 2079 he plugin with y │ │ │ │ +001b3b10: 6f75 7220 4854 5450 2047 4554 2068 616e our HTTP GET han │ │ │ │ +001b3b20: 646c 6572 2066 756e 6374 696f 6e20 6173 dler function as │ │ │ │ +001b3b30: 2066 6f6c 6c6f 7773 3a3c 2f70 3e0a 3c64 follows:

    .
    #include " │ │ │ │ +001b3b90: 6874 7470 6765 742e 6826 7175 6f74 3b3c httpget.h"< │ │ │ │ +001b3ba0: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    . │ │ │ │ +001b3bc0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173

    .
    int ma │ │ │ │ +001b3c00: 696e 2829 3c2f 6469 763e 0a3c 6469 7620 in()
    .
    {.
    s │ │ │ │ +001b3c50: 7472 7563 7420 3c2f 7370 616e 3e3c 6120 truct soap *soap = │ │ │ │ +001b3cc0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap_new();
    ..
    < │ │ │ │ +001b3ec0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +001b3ed0: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ │ +001b3ee0: 705f 5f66 6175 6c74 2e68 746d 6c23 6761 p__fault.html#ga │ │ │ │ +001b3ef0: 3933 3161 3461 6236 6466 3235 3533 6234 931a4ab6df2553b4 │ │ │ │ +001b3f00: 3861 3063 3237 3066 3861 3061 3838 6166 8a0c270f8a0a88af │ │ │ │ +001b3f10: 223e 736f 6170 5f70 7269 6e74 5f66 6175 ">soap_print_fau │ │ │ │ +001b3f20: 6c74 3c2f 613e 283c 6120 636c 6173 733d lt(so │ │ │ │ +001b3f50: 6170 3c2f 613e 2c20 7374 6465 7272 293b ap, stderr); │ │ │ │ +001b3f60: 203c 7370 616e 2063 6c61 7373 3d22 636f // failed │ │ │ │ +001b3f80: 2074 6f20 7265 6769 7374 6572 203c 2f73 to register
    .
    . │ │ │ │ +001b3fb0: 2e2e 203c 7370 616e 2063 6c61 7373 3d22 .. //
    .
    struct http_get_data * │ │ │ │ +001b4020: 6874 7470 6765 7464 6174 613b 203c 2f64 httpgetdata; .
    httpgetd │ │ │ │ +001b4050: 6174 6120 3d20 283c 7370 616e 2063 6c61 ata = (str │ │ │ │ +001b4070: 7563 7420 3c2f 7370 616e 3e68 7474 705f uct http_ │ │ │ │ +001b4080: 6765 745f 6461 7461 2a29 736f 6170 5f6c get_data*)soap_l │ │ │ │ +001b4090: 6f6f 6b75 705f 706c 7567 696e 283c 6120 ookup_plugin(soap, ht │ │ │ │ +001b40d0: 7470 5f67 6574 5f69 6429 3b20 3c2f 6469 tp_get_id); .
    if (!htt │ │ │ │ +001b4120: 7067 6574 6461 7461 2920 3c2f 6469 763e pgetdata)
    │ │ │ │ +001b4130: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    ... // if the plugi │ │ │ │ +001b4170: 6e20 7265 6769 7374 6572 6564 204f 4b2c n registered OK, │ │ │ │ +001b4180: 2074 6865 7265 2069 7320 6365 7274 6169 there is certai │ │ │ │ +001b4190: 6e6c 7920 6461 7461 2062 7574 2063 616e nly data but can │ │ │ │ +001b41a0: 2623 3339 3b74 2068 7572 7420 746f 2063 't hurt to c │ │ │ │ +001b41b0: 6865 636b 203c 2f73 7061 6e3e 3c2f 6469 heck .
    ... // process mess │ │ │ │ +001b4200: 6167 6573 3c2f 7370 616e 3e3c 2f64 6976 ages
    .
    │ │ │ │ +001b4240: 7369 7a65 5f74 3c2f 7370 616e 3e20 6765 size_t ge │ │ │ │ +001b4250: 745f 6f6b 203d 2068 7474 7067 6574 6461 t_ok = httpgetda │ │ │ │ +001b4260: 7461 2d26 6774 3b73 7461 745f 6765 743b ta->stat_get; │ │ │ │ +001b4270: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    size_t post_ok = ht │ │ │ │ +001b42c0: 7470 6765 7464 6174 612d 2667 743b 7374 tpgetdata->st │ │ │ │ +001b42d0: 6174 5f70 6f73 743b 203c 2f64 6976 3e0a at_post;
    . │ │ │ │ +001b42e0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    si │ │ │ │ +001b4310: 7a65 5f74 3c2f 7370 616e 3e20 6572 726f ze_t erro │ │ │ │ +001b4320: 7273 203d 2068 7474 7067 6574 6461 7461 rs = httpgetdata │ │ │ │ +001b4330: 2d26 6774 3b73 7461 745f 6661 696c 3b20 ->stat_fail; │ │ │ │ +001b4340: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    time_ │ │ │ │ +001b4360: 7420 6e6f 7720 3d20 7469 6d65 284e 554c t now = time(NUL │ │ │ │ +001b4370: 4c29 3b20 3c2f 6469 763e 0a3c 6469 7620 L);
    .
    < │ │ │ │ +001b4390: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +001b43a0: 6f72 6422 3e73 7472 7563 7420 3c2f 7370 ord">struct tm *T;
    │ │ │ │ +001b43c0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    T = localti │ │ │ │ +001b43e0: 6d65 2826 616d 703b 6e6f 7729 3b20 3c2f me(&now); .
    size_t │ │ │ │ +001b4430: 2068 6974 7374 6869 736d 696e 7574 6520 hitsthisminute │ │ │ │ +001b4440: 3d20 6874 7470 6765 7464 6174 612d 2667 = httpgetdata-&g │ │ │ │ +001b4450: 743b 6869 7374 5f6d 696e 5b54 2d26 6774 t;hist_min[T-> │ │ │ │ +001b4460: 3b74 6d5f 6d69 6e5d 3b20 3c2f 6469 763e ;tm_min];
    │ │ │ │ +001b4470: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    s │ │ │ │ +001b44a0: 697a 655f 743c 2f73 7061 6e3e 2068 6974 ize_t hit │ │ │ │ +001b44b0: 7374 6869 7368 6f75 7220 3d20 6874 7470 sthishour = http │ │ │ │ +001b44c0: 6765 7464 6174 612d 2667 743b 6869 7374 getdata->hist │ │ │ │ +001b44d0: 5f68 6f75 725b 542d 2667 743b 746d 5f68 _hour[T->tm_h │ │ │ │ +001b44e0: 6f75 725d 3b20 3c2f 6469 763e 0a3c 6469 our];
    . │ │ │ │ +001b4500: 203c 7370 616e 2063 6c61 7373 3d22 6b65 size_ │ │ │ │ +001b4520: 743c 2f73 7061 6e3e 2068 6974 7374 6f64 t hitstod │ │ │ │ +001b4530: 6179 203d 2068 7474 7067 6574 6461 7461 ay = httpgetdata │ │ │ │ +001b4540: 2d26 6774 3b68 6973 745f 6461 795b 542d ->hist_day[T- │ │ │ │ +001b4550: 2667 743b 746d 5f79 6461 795d 3b3c 2f64 >tm_yday];.
    }
    .

    An HTTP │ │ │ │ +001b45a0: 4745 5420 6861 6e64 6c65 7220 6361 6e20 GET handler can │ │ │ │ +001b45b0: 7369 6d70 6c79 2070 726f 6475 6365 2073 simply produce s │ │ │ │ +001b45c0: 6f6d 6520 4854 4d4c 2063 6f6e 7465 6e74 ome HTML content │ │ │ │ +001b45d0: 2c20 6f72 2061 6e79 206f 7468 6572 2074 , or any other t │ │ │ │ +001b45e0: 7970 6520 6f66 2063 6f6e 7465 6e74 2062 ype of content b │ │ │ │ +001b45f0: 7920 7365 6e64 696e 6720 6461 7461 2075 y sending data u │ │ │ │ +001b4600: 7369 6e67 203c 636f 6465 3e3c 6120 636c sing soap_response:

    .< │ │ │ │ +001b46d0: 6469 7620 636c 6173 733d 2266 7261 676d div class="fragm │ │ │ │ +001b46e0: 656e 7422 3e3c 6469 7620 636c 6173 733d ent">.{ │ │ │ │ +001b47d0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    soap->< │ │ │ │ +001b4820: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +001b4830: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ +001b4840: 6874 6d6c 2361 6535 6539 3837 3333 6134 html#ae5e98733a4 │ │ │ │ +001b4850: 3334 3962 3565 3134 3636 6139 6530 6363 349b5e1466a9e0cc │ │ │ │ +001b4860: 6332 3263 3131 223e 6874 7470 5f63 6f6e c22c11">http_con │ │ │ │ +001b4870: 7465 6e74 3c2f 613e 203d 203c 7370 616e tent = "tex │ │ │ │ +001b48a0: 742f 6874 6d6c 2671 756f 743b 3c2f 7370 t/html";
    .. │ │ │ │ +001b4a00: 2020 7c7c 203c 6120 636c 6173 733d 2263 || soap_send(soap, │ │ │ │ +001b4ab0: 2671 756f 743b 266c 743b 6874 6d6c 2667 "<html&g │ │ │ │ +001b4ac0: 743b 4865 6c6c 6f26 6c74 3b2f 6874 6d6c t;Hello</html │ │ │ │ +001b4ad0: 2667 743b 2671 756f 743b 3c2f 7370 616e >")
    ..
    │ │ │ │ +001b4bb0: 3c73 7061 6e20 636c 6173 733d 226b 6579 return │ │ │ │ +001b4bd0: 3c2f 7370 616e 3e20 3c61 2063 6c61 7373 soap_clo │ │ │ │ +001b4c30: 7365 736f 636b 3c2f 613e 283c 6120 636c sesock(soap);.
    return < │ │ │ │ +001b4cb0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +001b4cc0: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ │ +001b4cd0: 705f 5f65 7272 6f72 732e 6874 6d6c 2367 p__errors.html#g │ │ │ │ +001b4ce0: 6133 6231 3061 3638 6633 3534 6633 3963 a3b10a68f354f39c │ │ │ │ +001b4cf0: 6262 3066 6530 6430 3433 6164 3463 3763 bb0fe0d043ad4c7c │ │ │ │ +001b4d00: 3022 3e53 4f41 505f 4f4b 3c2f 613e 3b20 0">SOAP_OK; │ │ │ │ +001b4d10: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // return │ │ │ │ +001b4d30: 534f 4150 5f4f 4b20 6f72 2048 5454 5020 SOAP_OK or HTTP │ │ │ │ +001b4d40: 6572 726f 7220 636f 6465 2c20 652e 672e error code, e.g. │ │ │ │ +001b4d50: 2034 3034 203c 2f73 7061 6e3e 3c2f 6469 404 .
    }
    .

    If you us │ │ │ │ +001b4da0: 6520 3c63 6f64 653e 3c61 2063 6c61 7373 e soap_copy │ │ │ │ +001b4e60: 3c2f 636f 6465 3e20 746f 2063 6f70 7920 to copy │ │ │ │ +001b4e70: 7468 6520 3c63 6f64 653e 3c61 2063 6c61 the soap context wi │ │ │ │ +001b4ee0: 7468 2074 6865 2070 6c75 6769 6e2c 2074 th the plugin, t │ │ │ │ +001b4ef0: 6865 2070 6c75 6769 6e27 7320 6461 7461 he plugin's data │ │ │ │ +001b4f00: 2077 696c 6c20 6265 2073 6861 7265 6420 will be shared │ │ │ │ +001b4f10: 6279 2074 6865 2063 6f70 792e 2054 6865 by the copy. The │ │ │ │ +001b4f20: 7265 666f 7265 2c20 7468 6520 7374 6174 refore, the stat │ │ │ │ +001b4f30: 6973 7469 6373 2061 7265 206e 6f74 2031 istics are not 1 │ │ │ │ +001b4f40: 3030 2520 6775 6172 616e 7465 6564 2074 00% guaranteed t │ │ │ │ +001b4f50: 6f20 6265 2061 6363 7572 6174 6520 666f o be accurate fo │ │ │ │ +001b4f60: 7220 6d75 6c74 692d 7468 7265 6164 6564 r multi-threaded │ │ │ │ +001b4f70: 2073 6572 7669 6365 7320 7369 6e63 6520 services since │ │ │ │ +001b4f80: 7261 6365 2063 6f6e 6469 7469 6f6e 7320 race conditions │ │ │ │ +001b4f90: 6f6e 2074 6865 2063 6f75 6e74 6572 7320 on the counters │ │ │ │ +001b4fa0: 6d61 7920 6f63 6375 722e 204d 7574 6578 may occur. Mutex │ │ │ │ +001b4fb0: 2069 7320 6e6f 7420 7573 6564 2074 6f20 is not used to │ │ │ │ +001b4fc0: 7570 6461 7465 2074 6865 2063 6f75 6e74 update the count │ │ │ │ +001b4fd0: 6572 7320 746f 2061 766f 6964 2069 6e74 ers to avoid int │ │ │ │ +001b4fe0: 726f 6475 6369 6e67 2065 7870 656e 7369 roducing expensi │ │ │ │ +001b4ff0: 7665 2073 796e 6368 726f 6e69 7a61 7469 ve synchronizati │ │ │ │ +001b5000: 6f6e 2070 6f69 6e74 732e 2049 6620 3130 on points. If 10 │ │ │ │ +001b5010: 3025 2073 6572 7665 722d 7369 6465 2061 0% server-side a │ │ │ │ +001b5020: 6363 7572 6163 7920 6973 2072 6571 7569 ccuracy is requi │ │ │ │ +001b5030: 7265 642c 2061 6464 206d 7574 6578 2061 red, add mutex a │ │ │ │ +001b5040: 7420 7468 6520 706f 696e 7473 2069 6e64 t the points ind │ │ │ │ +001b5050: 6963 6174 6564 2069 6e20 7468 6520 3c65 icated in the httpget. │ │ │ │ +001b5070: 633c 2f63 6f64 653e 3c2f 656d 3e20 636f c co │ │ │ │ +001b5080: 6465 2e3c 2f70 3e0a 3c70 3e54 6865 2063 de.

    .

    The c │ │ │ │ +001b5090: 6c69 656e 742d 7369 6465 2075 7365 206f lient-side use o │ │ │ │ +001b50a0: 6620 4854 5450 2047 4554 2069 7320 7072 f HTTP GET is pr │ │ │ │ +001b50b0: 6f76 6964 6564 2062 7920 7468 6520 3c63 ovided by the soap_GET │ │ │ │ +001b5140: 3c2f 613e 3c2f 636f 6465 3e20 6f70 6572 oper │ │ │ │ +001b5150: 6174 696f 6e2e 2054 6f20 7265 6365 6976 ation. To receiv │ │ │ │ +001b5160: 6520 6120 534f 4150 2f58 4d4c 2028 7265 e a SOAP/XML (re │ │ │ │ +001b5170: 7370 6f6e 7365 2920 6d65 7373 6167 6520 sponse) message │ │ │ │ +001b5180: 3c65 6d3e 3c63 6f64 653e 6e73 3a6d 6574 ns:met │ │ │ │ +001b5190: 686f 6452 6573 706f 6e73 653c 2f63 6f64 hodResponse, use:

    .
    int m │ │ │ │ +001b5200: 6169 6e28 293c 2f64 6976 3e0a 3c64 6976 ain()
    .
    {< │ │ │ │ +001b5220: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    │ │ │ │ +001b5250: 7374 7275 6374 203c 2f73 7061 6e3e 3c61 struct soap *< │ │ │ │ +001b5290: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +001b52a0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ +001b52b0: 6874 6d6c 223e 736f 6170 3c2f 613e 203d html">soap = │ │ │ │ +001b52c0: 203c 6120 636c 6173 733d 2263 6f64 6522 soap_new();
    ..
    .. │ │ │ │ +001b5470: 2e20 3c73 7061 6e20 636c 6173 733d 2263 . // error │ │ │ │ +001b5490: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ │ +001b54b0: 2020 3c73 7061 6e20 636c 6173 733d 226b else │ │ │ │ +001b54d0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c if (soa │ │ │ │ +001b5500: 705f 7265 6376 5f6e 735f 5f77 6562 6d65 p_recv_ns__webme │ │ │ │ +001b5510: 7468 6f64 5265 7370 6f6e 7365 283c 6120 thodResponse(soap, .. │ │ │ │ +001b5550: 2e29 2920 3c2f 6469 763e 0a3c 6469 7620 .))
    .
    │ │ │ │ +001b5570: 202e 2e2e 203c 7370 616e 2063 6c61 7373 ... // er │ │ │ │ +001b5590: 726f 723c 2f73 7061 6e3e 3c2f 6469 763e ror
    │ │ │ │ +001b55a0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    e │ │ │ │ +001b55d0: 6c73 653c 2f73 7061 6e3e 203c 2f64 6976 lse
    .
    ... // success
    ..
    soap_end(< │ │ │ │ +001b5750: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +001b5760: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ +001b5770: 6874 6d6c 223e 736f 6170 3c2f 613e 293b html">soap); │ │ │ │ +001b5780: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    s │ │ │ │ +001b57f0: 6f61 705f 646f 6e65 3c2f 613e 283c 6120 oap_done(soap);.
    int soap_GET(s │ │ │ │ +001b5910: 7472 7563 7420 736f 6170 202a 736f 6170 truct soap *soap │ │ │ │ +001b5920: 2c20 636f 6e73 7420 6368 6172 202a 656e , const char *en │ │ │ │ +001b5930: 6470 6f69 6e74 2c20 636f 6e73 7420 6368 dpoint, const ch │ │ │ │ +001b5940: 6172 202a 6163 7469 6f6e 293c 2f64 6976 ar *action)
    HTTP GET con │ │ │ │ +001b5970: 7465 6e74 2066 726f 6d20 7365 7276 6572 tent from server │ │ │ │ +001b5980: 2e3c 2f64 6976 3e3c 2f64 6976 3e0a 3c2f .
    .

    To recei │ │ │ │ +001b59b0: 7665 2061 6e79 2048 5454 5020 426f 6479 ve any HTTP Body │ │ │ │ +001b59c0: 2064 6174 6120 696e 746f 2061 2062 7566 data into a buf │ │ │ │ +001b59d0: 6665 722c 2075 7365 3a3c 2f70 3e0a 3c64 fer, use:

    .
    │ │ │ │ +001b5a20: 696e 743c 2f73 7061 6e3e 206d 6169 6e28 int main( │ │ │ │ +001b5a30: 293c 2f64 6976 3e0a 3c64 6976 2063 6c61 )
    .
    {
    .
    stru │ │ │ │ +001b5a80: 6374 203c 2f73 7061 6e3e 3c61 2063 6c61 ct soap *soap = soap_new() │ │ │ │ +001b5b50: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
    .
    char *response = NU │ │ │ │ +001b5ba0: 4c4c 3b20 3c2f 6469 763e 0a3c 6469 7620 LL;
    .
    < │ │ │ │ +001b5bc0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +001b5bd0: 6f72 6474 7970 6522 3e73 697a 655f 743c ordtype">size_t< │ │ │ │ +001b5be0: 2f73 7061 6e3e 2072 6573 706f 6e73 655f /span> response_ │ │ │ │ +001b5bf0: 6c65 6e3b 3c2f 6469 763e 0a3c 6469 7620 len;
    .
    < │ │ │ │ +001b5c10: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +001b5c20: 6f72 6466 6c6f 7722 3e69 663c 2f73 7061 ordflow">if (soap_GET │ │ │ │ +001b5c90: 283c 6120 636c 6173 733d 2263 6f64 6522 (soap │ │ │ │ +001b5cc0: 2c20 3c61 2063 6c61 7373 3d22 636f 6465 , endpo │ │ │ │ +001b5d10: 696e 743c 2f61 3e2c 204e 554c 4c29 3c2f int, NULL).
    || (re │ │ │ │ +001b5d40: 7370 6f6e 7365 203d 203c 6120 636c 6173 sponse = soap_ht │ │ │ │ +001b5da0: 7470 5f67 6574 5f62 6f64 793c 2f61 3e28 tp_get_body( │ │ │ │ +001b5db0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap, │ │ │ │ +001b5de0: 2026 616d 703b 7265 7370 6f6e 7365 5f6c &response_l │ │ │ │ +001b5df0: 656e 2929 203d 3d20 4e55 4c4c 3c2f 6469 en)) == NULL.
    || soap_ │ │ │ │ +001b5e70: 656e 645f 7265 6376 3c2f 613e 2826 616d end_recv(&am │ │ │ │ +001b5e80: 703b 3c61 2063 6c61 7373 3d22 636f 6465 p;soap))
    .
    │ │ │ │ +001b5ed0: 2e2e 2e20 3c73 7061 6e20 636c 6173 733d ... // err │ │ │ │ +001b5ef0: 6f72 3c2f 7370 616e 3e3c 2f64 6976 3e0a or
    . │ │ │ │ +001b5f00: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    el │ │ │ │ +001b5f30: 7365 3c2f 7370 616e 3e3c 2f64 6976 3e0a se
    . │ │ │ │ +001b5f40: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    ... │ │ │ │ +001b5f70: 2f2f 2075 7365 2074 6865 2072 6573 706f // use the respo │ │ │ │ +001b5f80: 6e73 6520 7374 7269 6e67 2028 4e55 4c4c nse string (NULL │ │ │ │ +001b5f90: 2069 6e64 6963 6174 6573 206e 6f20 626f indicates no bo │ │ │ │ +001b5fa0: 6479 206f 7220 6572 726f 7229 3c2f 7370 dy or error)
    ..
    soap_ │ │ │ │ +001b60e0: 656e 643c 2f61 3e28 2661 6d70 3b3c 6120 end(&soap); < │ │ │ │ +001b6120: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    s │ │ │ │ +001b6190: 6f61 705f 646f 6e65 3c2f 613e 2826 616d oap_done(&am │ │ │ │ +001b61a0: 703b 3c61 2063 6c61 7373 3d22 636f 6465 p;soap);
    .
    }.

    See a │ │ │ │ +001b64b0: 6c73 6f20 3c63 6f64 653e 3c61 2063 6c61 lso http_ │ │ │ │ +001b6540: 6765 743c 2f61 3e3c 2f63 6f64 653e 2e3c get.< │ │ │ │ +001b6550: 2f70 3e0a 3c70 3ef0 9f94 9d20 3c61 2068 /p>.

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

    .

    .RES │ │ │ │ +001b65c0: 5466 756c 2073 6572 7665 722d 7369 6465 Tful server-side │ │ │ │ +001b65d0: 2041 5049 2077 6974 6820 7468 6520 4854 API with the HT │ │ │ │ +001b65e0: 5450 2050 4f53 5420 706c 7567 696e 3c2f TP POST plugin.

    Server-si │ │ │ │ +001b6600: 6465 2075 7365 206f 6620 5245 5354 6675 de use of RESTfu │ │ │ │ +001b6610: 6c20 4854 5450 2050 4f53 542c 2050 5554 l HTTP POST, PUT │ │ │ │ +001b6620: 2c20 5041 5443 482c 2061 6e64 2044 454c , PATCH, and DEL │ │ │ │ +001b6630: 4554 4520 6f70 6572 6174 696f 6e73 2061 ETE operations a │ │ │ │ +001b6640: 7265 2073 7570 706f 7274 6564 2077 6974 re supported wit │ │ │ │ +001b6650: 6820 7468 6520 3c63 6f64 653e 3c61 2063 h the ht │ │ │ │ +001b66e0: 7470 5f70 6f73 743c 2f61 3e3c 2f63 6f64 tp_post HTTP POST plu │ │ │ │ +001b6700: 6769 6e20 3c65 6d3e 3c63 6f64 653e 6773 gin gs │ │ │ │ +001b6710: 6f61 702f 706c 7567 696e 2f68 7474 7070 oap/plugin/httpp │ │ │ │ +001b6720: 6f73 742e 633c 2f63 6f64 653e 3c2f 656d ost.c.

    .

    The http_post< │ │ │ │ +001b67d0: 2f61 3e3c 2f63 6f64 653e 2048 5454 5020 /a> HTTP │ │ │ │ +001b67e0: 504f 5354 2070 6c75 6769 6e20 616c 6c6f POST plugin allo │ │ │ │ +001b67f0: 7773 2079 6f75 7220 7365 7276 6572 2074 ws your server t │ │ │ │ +001b6800: 6f20 6861 6e64 6c65 2052 4553 5466 756c o handle RESTful │ │ │ │ +001b6810: 2048 5454 5020 504f 5354 2072 6571 7565 HTTP POST reque │ │ │ │ +001b6820: 7374 7320 616e 6420 6174 2074 6865 2073 sts and at the s │ │ │ │ +001b6830: 616d 6520 7469 6d65 2073 7469 6c6c 2073 ame time still s │ │ │ │ +001b6840: 6572 7665 2053 4f41 502d 6261 7365 6420 erve SOAP-based │ │ │ │ +001b6850: 504f 5354 2072 6571 7565 7374 732e 2054 POST requests. T │ │ │ │ +001b6860: 6865 2070 6c75 6769 6e20 616c 736f 2070 he plugin also p │ │ │ │ +001b6870: 726f 7669 6465 7320 7375 7070 6f72 7420 rovides support │ │ │ │ +001b6880: 666f 7220 636c 6965 6e74 2061 7070 6c69 for client appli │ │ │ │ +001b6890: 6361 7469 6f6e 7320 746f 2069 7373 7565 cations to issue │ │ │ │ +001b68a0: 2048 5454 5020 504f 5354 206f 7065 7261 HTTP POST opera │ │ │ │ +001b68b0: 7469 6f6e 7320 746f 2061 2073 6572 7665 tions to a serve │ │ │ │ +001b68c0: 722e 3c2f 703e 0a3c 703e 546f 2073 696d r.

    .

    To sim │ │ │ │ +001b68d0: 706c 6966 7920 7468 6520 7365 7276 6572 plify the server │ │ │ │ +001b68e0: 2d73 6964 6520 6861 6e64 6c69 6e67 206f -side handling o │ │ │ │ +001b68f0: 6620 504f 5354 2072 6571 7565 7374 732c f POST requests, │ │ │ │ +001b6900: 2068 616e 646c 6572 7320 6361 6e20 6265 handlers can be │ │ │ │ +001b6910: 2061 7373 6f63 6961 7465 6420 7769 7468 associated with │ │ │ │ +001b6920: 206d 6564 6961 2074 7970 6573 3a3c 2f70 media types:

    .
    │ │ │ │ +001b6970: 7374 7275 6374 203c 2f73 7061 6e3e 6874 struct ht │ │ │ │ +001b6980: 7470 5f70 6f73 745f 6861 6e64 6c65 7273 tp_post_handlers │ │ │ │ +001b6990: 206d 795f 6861 6e64 6c65 7273 5b5d 203d my_handlers[] = │ │ │ │ +001b69a0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    {
    .
    { "image/ │ │ │ │ +001b6a00: 6a70 6726 7175 6f74 3b3c 2f73 7061 6e3e jpg" │ │ │ │ +001b6a10: 2c20 6a70 6567 5f68 616e 646c 6572 207d , jpeg_handler } │ │ │ │ +001b6a20: 2c20 3c2f 6469 763e 0a3c 6469 7620 636c ,
    .
    { < │ │ │ │ +001b6a40: 7370 616e 2063 6c61 7373 3d22 7374 7269 span class="stri │ │ │ │ +001b6a50: 6e67 6c69 7465 7261 6c22 3e26 7175 6f74 ngliteral">" │ │ │ │ +001b6a60: 3b69 6d61 6765 2f2a 2671 756f 743b 3c2f ;image/*", image_h │ │ │ │ +001b6a80: 616e 646c 6572 207d 2c20 3c2f 6469 763e andler },
    │ │ │ │ +001b6a90: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    { "text/ht │ │ │ │ +001b6ad0: 6d6c 2671 756f 743b 3c2f 7370 616e 3e2c ml", │ │ │ │ +001b6ae0: 2068 746d 6c5f 6861 6e64 6c65 7220 7d2c html_handler }, │ │ │ │ +001b6af0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    { " │ │ │ │ +001b6b30: 7465 7874 2f2a 2671 756f 743b 3c2f 7370 text/*", text_han │ │ │ │ +001b6b50: 646c 6572 207d 2c20 3c2f 6469 763e 0a3c dler },
    .< │ │ │ │ +001b6b60: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +001b6b70: 3e20 207b 203c 7370 616e 2063 6c61 7373 > { "POST" │ │ │ │ +001b6ba0: 3b3c 2f73 7061 6e3e 2c20 2020 2020 2067 ;, g │ │ │ │ +001b6bb0: 656e 6572 6963 5f50 4f53 545f 6861 6e64 eneric_POST_hand │ │ │ │ +001b6bc0: 6c65 7220 7d2c 203c 2f64 6976 3e0a 3c64 ler },
    . │ │ │ │ +001b6be0: 2020 7b20 3c73 7061 6e20 636c 6173 733d { │ │ │ │ +001b6c00: 2671 756f 743b 5055 5426 7175 6f74 3b3c "PUT"< │ │ │ │ +001b6c10: 2f73 7061 6e3e 2c20 2020 2020 2020 6765 /span>, ge │ │ │ │ +001b6c20: 6e65 7269 635f 5055 545f 6861 6e64 6c65 neric_PUT_handle │ │ │ │ +001b6c30: 7220 7d2c 203c 2f64 6976 3e0a 3c64 6976 r },

    .
    │ │ │ │ +001b6c50: 7b20 3c73 7061 6e20 636c 6173 733d 2273 { &q │ │ │ │ +001b6c70: 756f 743b 5041 5443 4826 7175 6f74 3b3c uot;PATCH"< │ │ │ │ +001b6c80: 2f73 7061 6e3e 2c20 2020 2020 6765 6e65 /span>, gene │ │ │ │ +001b6c90: 7269 635f 5041 5443 485f 6861 6e64 6c65 ric_PATCH_handle │ │ │ │ +001b6ca0: 7220 7d2c 203c 2f64 6976 3e0a 3c64 6976 r },
    .
    │ │ │ │ +001b6cc0: 7b20 3c73 7061 6e20 636c 6173 733d 2273 { &q │ │ │ │ +001b6ce0: 756f 743b 4445 4c45 5445 2671 756f 743b uot;DELETE" │ │ │ │ +001b6cf0: 3c2f 7370 616e 3e2c 2020 2020 6765 6e65 , gene │ │ │ │ +001b6d00: 7269 635f 4445 4c45 5445 5f68 616e 646c ric_DELETE_handl │ │ │ │ +001b6d10: 6572 207d 2c20 3c2f 6469 763e 0a3c 6469 er },
    . │ │ │ │ +001b6d30: 207b 204e 554c 4c20 7d20 3c2f 6469 763e { NULL }
    │ │ │ │ +001b6d40: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    };
    .

    Note that │ │ │ │ +001b6d80: 3c63 6f64 653e 2a3c 2f63 6f64 653e 2061 * a │ │ │ │ +001b6d90: 6e64 203c 636f 6465 3e2d 3c2f 636f 6465 nd - can be used as │ │ │ │ +001b6db0: 2077 696c 6463 6172 6473 2074 6f20 6d61 wildcards to ma │ │ │ │ +001b6dc0: 7463 6820 616e 7920 7465 7874 2061 6e64 tch any text and │ │ │ │ +001b6dd0: 2061 6e79 2063 6861 7261 6374 6572 2c20 any character, │ │ │ │ +001b6de0: 7265 7370 6563 7469 7665 6c79 2e20 4d65 respectively. Me │ │ │ │ +001b6df0: 6469 6120 7479 7065 7320 6d61 7920 6861 dia types may ha │ │ │ │ +001b6e00: 7665 206f 7074 696f 6e61 6c20 7061 7261 ve optional para │ │ │ │ +001b6e10: 6d65 7465 7273 2061 6674 6572 203c 636f meters after ; such │ │ │ │ +001b6e30: 2061 7320 3c63 6f64 653e 6368 6172 7365 as charse │ │ │ │ +001b6e40: 743c 2f63 6f64 653e 2061 6e64 203c 636f t and boundary. These parame │ │ │ │ +001b6e70: 7465 7273 2063 616e 2062 6520 6d61 7463 ters can be matc │ │ │ │ +001b6e80: 6865 6420 6279 2074 6865 206d 6564 6961 hed by the media │ │ │ │ +001b6e90: 2074 7970 6520 7061 7474 6572 6e73 2069 type patterns i │ │ │ │ +001b6ea0: 6e20 7468 6520 7461 626c 652e 2050 6174 n the table. Pat │ │ │ │ +001b6eb0: 7465 726e 7320 7468 6174 2061 7265 206d terns that are m │ │ │ │ +001b6ec0: 6f72 6520 7370 6563 6966 6963 206d 7573 ore specific mus │ │ │ │ +001b6ed0: 7420 7072 6563 6564 6520 7061 7474 6572 t precede patter │ │ │ │ +001b6ee0: 6e73 2074 6861 7420 6172 6520 6c65 7373 ns that are less │ │ │ │ +001b6ef0: 2073 7065 6369 6669 6320 696e 2074 6865 specific in the │ │ │ │ +001b6f00: 2074 6162 6c65 2e20 466f 7220 6578 616d table. For exam │ │ │ │ +001b6f10: 706c 652c 203c 636f 6465 3e22 7465 7874 ple, "text │ │ │ │ +001b6f20: 2f78 6d6c 3b2a 6368 6172 7365 743d 7574 /xml;*charset=ut │ │ │ │ +001b6f30: 662d 382a 223c 2f63 6f64 653e 206d 7573 f-8*" mus │ │ │ │ +001b6f40: 7420 7072 6563 6564 6520 3c63 6f64 653e t precede │ │ │ │ +001b6f50: 2274 6578 742f 786d 6c22 3c2f 636f 6465 "text/xml" which must pre │ │ │ │ +001b6f70: 6365 6465 203c 636f 6465 3e22 7465 7874 cede "text │ │ │ │ +001b6f80: 2f2a 223c 2f63 6f64 653e 2e20 4e6f 7465 /*". Note │ │ │ │ +001b6f90: 2074 6861 7420 3c63 6f64 653e 2274 6578 that "tex │ │ │ │ +001b6fa0: 742f 786d 6c22 3c2f 636f 6465 3e20 616c t/xml" al │ │ │ │ +001b6fb0: 736f 206d 6174 6368 6573 2061 6e79 2070 so matches any p │ │ │ │ +001b6fc0: 6172 616d 6574 6572 7320 6f66 2074 6865 arameters of the │ │ │ │ +001b6fd0: 206d 6564 6961 2074 7970 6520 6f66 2074 media type of t │ │ │ │ +001b6fe0: 6865 206d 6573 7361 6765 2072 6576 6569 he message revei │ │ │ │ +001b6ff0: 7665 642c 2073 7563 6820 6173 203c 636f ved, such as "text/xml; ch │ │ │ │ +001b7010: 6172 7365 743d 7574 662d 3822 3c2f 636f arset=utf-8" (only since │ │ │ │ +001b7030: 6753 4f41 5020 7665 7273 696f 6e20 322e gSOAP version 2. │ │ │ │ +001b7040: 382e 3735 292e 3c2f 703e 0a3c 703e 5468 8.75).

    .

    Th │ │ │ │ +001b7050: 6520 6861 6e64 6c65 7273 2061 7265 2066 e handlers are f │ │ │ │ +001b7060: 756e 6374 696f 6e73 2074 6861 7420 7769 unctions that wi │ │ │ │ +001b7070: 6c6c 2062 6520 696e 766f 6b65 6420 7768 ll be invoked wh │ │ │ │ +001b7080: 656e 2061 2050 4f53 5465 6420 7265 7175 en a POSTed requ │ │ │ │ +001b7090: 6573 7420 6d65 7373 6167 6520 6d61 7463 est message matc │ │ │ │ +001b70a0: 6869 6e67 206d 6564 6961 2074 7970 6520 hing media type │ │ │ │ +001b70b0: 6973 2073 656e 7420 746f 2074 6865 2073 is sent to the s │ │ │ │ +001b70c0: 6572 7665 722e 3c2f 703e 0a3c 703e 416e erver.

    .

    An │ │ │ │ +001b70d0: 2065 7861 6d70 6c65 2069 6d61 6765 2068 example image h │ │ │ │ +001b70e0: 616e 646c 6572 2074 6861 7420 6368 6563 andler that chec │ │ │ │ +001b70f0: 6b73 2074 6865 2073 7065 6369 6669 6320 ks the specific │ │ │ │ +001b7100: 696d 6167 6520 7479 7065 3a3c 2f70 3e0a image type:

    . │ │ │ │ +001b7110: 3c64 6976 2063 6c61 7373 3d22 6672 6167
    .
    {
    .
    cons │ │ │ │ +001b7240: 743c 2f73 7061 6e3e 203c 7370 616e 2063 t char * │ │ │ │ +001b7270: 6275 663b 203c 2f64 6976 3e0a 3c64 6976 buf;
    .
    │ │ │ │ +001b7290: 3c73 7061 6e20 636c 6173 733d 226b 6579 size_t │ │ │ │ +001b72b0: 3c2f 7370 616e 3e20 6c65 6e3b 203c 2f64 len; .
    // │ │ │ │ +001b72f0: 2069 6620 6e65 6365 7373 6172 792c 2063 if necessary, c │ │ │ │ +001b7300: 6865 636b 2074 7970 6520 696e 2073 6f61 heck type in soa │ │ │ │ +001b7310: 702d 2667 743b 6874 7470 5f63 6f6e 7465 p->http_conte │ │ │ │ +001b7320: 6e74 203c 2f73 7061 6e3e 3c2f 6469 763e nt
    │ │ │ │ +001b7330: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    i │ │ │ │ +001b7360: 663c 2f73 7061 6e3e 2028 3c61 2063 6c61 f (soap->http_cont │ │ │ │ +001b73f0: 656e 743c 2f61 3e20 2661 6d70 3b26 616d ent &&am │ │ │ │ +001b7400: 703b 2021 3c61 2063 6c61 7373 3d22 636f p; !soap_tag_c │ │ │ │ +001b7460: 6d70 3c2f 613e 283c 6120 636c 6173 733d mp(so │ │ │ │ +001b7490: 6170 3c2f 613e 2d26 6774 3b3c 6120 636c ap->http_content │ │ │ │ +001b74f0: 3c2f 613e 2c20 3c73 7061 6e20 636c 6173 , "image/gi │ │ │ │ +001b7520: 6626 7175 6f74 3b3c 2f73 7061 6e3e 2920 f") │ │ │ │ +001b7530: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    return 404; │ │ │ │ +001b7590: 2f2f 2048 5454 5020 6572 726f 7220 3430 // HTTP error 40 │ │ │ │ +001b75a0: 3420 3c2f 7370 616e 3e3c 2f64 6976 3e0a 4
    . │ │ │ │ +001b75b0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    if ((buf = < │ │ │ │ +001b75d0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +001b75e0: 7265 663d 2267 726f 7570 5f5f 6772 6f75 ref="group__grou │ │ │ │ +001b75f0: 705f 5f69 6f2e 6874 6d6c 2367 6165 3263 p__io.html#gae2c │ │ │ │ +001b7600: 6433 3766 3837 3564 3333 3134 6565 6333 d37f875d3314eec3 │ │ │ │ +001b7610: 3134 6238 3732 3365 3266 6664 3822 3e73 14b8723e2ffd8">s │ │ │ │ +001b7620: 6f61 705f 6874 7470 5f67 6574 5f62 6f64 oap_http_get_bod │ │ │ │ +001b7630: 793c 2f61 3e28 3c61 2063 6c61 7373 3d22 y(soa │ │ │ │ +001b7660: 703c 2f61 3e2c 2026 616d 703b 6c65 6e29 p, &len) │ │ │ │ +001b7670: 2920 3d3d 204e 554c 4c29 3c2f 6469 763e ) == NULL)
    │ │ │ │ +001b7680: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    return < │ │ │ │ +001b76c0: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +001b76d0: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ +001b76e0: 6874 6d6c 223e 736f 6170 3c2f 613e 2d26 html">soap-& │ │ │ │ +001b76f0: 6774 3b3c 6120 636c 6173 733d 2263 6f64 gt;erro │ │ │ │ +001b7740: 723c 2f61 3e3b 203c 2f64 6976 3e0a 3c64 r;
    . │ │ │ │ +001b7760: 2020 3c73 7061 6e20 636c 6173 733d 2263 // ... n │ │ │ │ +001b7780: 6f77 2070 726f 6365 7373 2069 6d61 6765 ow process image │ │ │ │ +001b7790: 2069 6e20 6275 6620 3c2f 7370 616e 3e3c in buf < │ │ │ │ +001b77a0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    │ │ │ │ +001b77d0: 2f2f 2072 6570 6c79 2077 6974 6820 656d // reply with em │ │ │ │ +001b77e0: 7074 7920 4854 5450 2032 3030 204f 4b20 pty HTTP 200 OK │ │ │ │ +001b77f0: 7265 7370 6f6e 7365 3a20 3c2f 7370 616e response:
    .
    return soap_send_em │ │ │ │ +001b78a0: 7074 795f 7265 7370 6f6e 7365 3c2f 613e pty_response │ │ │ │ +001b78b0: 283c 6120 636c 6173 733d 2263 6f64 6522 (soap │ │ │ │ +001b78e0: 2c20 3230 3029 3b20 3c2f 6469 763e 0a3c , 200);
    .< │ │ │ │ +001b78f0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +001b7900: 3e7d 3c2f 6469 763e 0a3c 6469 7620 636c >}
    .
    < │ │ │ │ +001b7970: 6120 6872 6566 3d22 6772 6f75 705f 5f67 a href="group__g │ │ │ │ +001b7980: 726f 7570 5f5f 6d69 7363 2e68 746d 6c23 roup__misc.html# │ │ │ │ +001b7990: 6761 6532 6266 6164 3439 3937 3966 6161 gae2bfad49979faa │ │ │ │ +001b79a0: 3361 3632 3561 6361 3434 6163 6161 3031 3a625aca44acaa01 │ │ │ │ +001b79b0: 3763 223e 736f 6170 5f74 6167 5f63 6d70 7c">soap_tag_cmp │ │ │ │ +001b79c0: 3c2f 613e 3c2f 6469 763e 3c64 6976 2063
    in │ │ │ │ +001b79e0: 7420 736f 6170 5f74 6167 5f63 6d70 2863 t soap_tag_cmp(c │ │ │ │ +001b79f0: 6f6e 7374 2063 6861 7220 2a73 7472 696e onst char *strin │ │ │ │ +001b7a00: 672c 2063 6f6e 7374 2063 6861 7220 2a70 g, const char *p │ │ │ │ +001b7a10: 6174 7465 726e 293c 2f64 6976 3e3c 6469 attern)
    │ │ │ │ +001b7a30: 436f 6d70 6172 6520 7374 7269 6e67 2074 Compare string t │ │ │ │ +001b7a40: 6f20 6120 7061 7474 6572 6e2e 3c2f 6469 o a pattern.
    .
    < │ │ │ │ +001b7a60: 212d 2d20 6672 6167 6d65 6e74 202d 2d3e !-- fragment --> │ │ │ │ +001b7a70: 3c70 3e54 6865 2061 626f 7665 2065 7861

    The above exa │ │ │ │ +001b7a80: 6d70 6c65 2072 6574 7572 6e73 2048 5454 mple returns HTT │ │ │ │ +001b7a90: 5020 4f4b 2e20 4966 2063 6f6e 7465 6e74 P OK. If content │ │ │ │ +001b7aa0: 2069 7320 7375 7070 6f73 6564 2074 6f20 is supposed to │ │ │ │ +001b7ab0: 6265 2072 6574 7572 6e65 642c 2074 6865 be returned, the │ │ │ │ +001b7ac0: 6e20 7573 653a 3c2f 703e 0a3c 6469 7620 n use:

    .
    struct │ │ │ │ +001b7b10: 3c2f 7370 616e 3e3c 6120 636c 6173 733d so │ │ │ │ +001b7b40: 6170 3c2f 613e 202a 3c61 2063 6c61 7373 ap *s │ │ │ │ +001b7b70: 6f61 703c 2f61 3e20 3d20 3c61 2063 6c61 oap = s │ │ │ │ +001b7bd0: 6f61 705f 6e65 773c 2f61 3e28 293b 3c2f oap_new();.
    ... //
    │ │ │ │ +001b7c20: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    soap-> │ │ │ │ +001b7cb0: 6874 7470 5f63 6f6e 7465 6e74 3c2f 613e http_content │ │ │ │ +001b7cc0: 203d 203c 7370 616e 2063 6c61 7373 3d22 = & │ │ │ │ +001b7ce0: 7175 6f74 3b69 6d61 6765 2f6a 7065 6726 quot;image/jpeg& │ │ │ │ +001b7cf0: 7175 6f74 3b3c 2f73 7061 6e3e 3b20 3c73 quot;; // a jpeg im │ │ │ │ +001b7d20: 6167 6520 746f 2072 6574 7572 6e20 6261 age to return ba │ │ │ │ +001b7d30: 636b 203c 2f73 7061 6e3e 3c2f 6469 763e ck
    │ │ │ │ +001b7d40: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    if< │ │ │ │ +001b7d70: 2f73 7061 6e3e 2028 3c61 2063 6c61 7373 /span> (soap_res │ │ │ │ +001b7dd0: 706f 6e73 653c 2f61 3e28 3c61 2063 6c61 ponse(soap, SOAP_ │ │ │ │ +001b7e60: 4649 4c45 3c2f 613e 2929 203c 7370 616e FILE)) // SOAP_FILE se │ │ │ │ +001b7e90: 7473 2063 7573 746f 6d20 6874 7470 2063 ts custom http c │ │ │ │ +001b7ea0: 6f6e 7465 6e74 203c 2f73 7061 6e3e 3c2f ontent .
    || soap_ │ │ │ │ +001b7f20: 7365 6e64 5f72 6177 3c2f 613e 283c 6120 send_raw(soap, buf, │ │ │ │ +001b7fb0: 6c65 6e29 203c 7370 616e 2063 6c61 7373 len) // se │ │ │ │ +001b7fd0: 6e64 2069 6d61 6765 203c 2f73 7061 6e3e nd image │ │ │ │ +001b7fe0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    || soa │ │ │ │ +001b8050: 705f 656e 645f 7365 6e64 3c2f 613e 283c p_end_send(< │ │ │ │ +001b8060: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +001b8070: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ +001b8080: 6874 6d6c 223e 736f 6170 3c2f 613e 293c html">soap)< │ │ │ │ +001b8090: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>..< │ │ │ │ +001b8180: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +001b8190: 6f72 6466 6c6f 7722 3e72 6574 7572 6e3c ordflow">return< │ │ │ │ +001b81a0: 2f73 7061 6e3e 203c 6120 636c 6173 733d /span> SOAP_ │ │ │ │ +001b8200: 4f4b 3c2f 613e 3b3c 2f64 6976 3e0a 3c2f OK;
    .

    For clie │ │ │ │ +001b8230: 6e74 2061 7070 6c69 6361 7469 6f6e 7320 nt applications │ │ │ │ +001b8240: 746f 2075 7365 2048 5454 5020 504f 5354 to use HTTP POST │ │ │ │ +001b8250: 2c20 7573 6520 7468 6520 3c63 6f64 653e , use the │ │ │ │ +001b8260: 3c61 2063 6c61 7373 3d22 656c 2220 6872 soap_POST │ │ │ │ +001b82e0: 3c2f 636f 6465 3e20 6f70 6572 6174 696f operatio │ │ │ │ +001b82f0: 6e3a 3c2f 703e 0a3c 6469 7620 636c 6173 n:

    .
    < │ │ │ │ +001b8320: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +001b8330: 6f72 6422 3e73 7472 7563 7420 3c2f 7370 ord">struct soap *soap< │ │ │ │ +001b83a0: 2f61 3e20 3d20 3c61 2063 6c61 7373 3d22 /a> = soap_ │ │ │ │ +001b8400: 6e65 773c 2f61 3e28 293b 3c2f 6469 763e new();
    │ │ │ │ +001b8410: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    ... //< │ │ │ │ +001b8440: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    .< │ │ │ │ +001b8460: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +001b8470: 6f72 6474 7970 6522 3e63 6861 723c 2f73 ordtype">char
    *b │ │ │ │ +001b84d0: 7566 3c2f 613e 3b20 3c73 7061 6e20 636c uf; // │ │ │ │ +001b84f0: 2068 6f6c 6473 2074 6865 2048 5454 5020 holds the HTTP │ │ │ │ +001b8500: 7265 7175 6573 742f 7265 7370 6f6e 7365 request/response │ │ │ │ +001b8510: 2062 6f64 7920 6461 7461 203c 2f73 7061 body data
    .
    size_t len; // │ │ │ │ +001b8580: 206c 656e 6774 6820 6f66 2064 6174 6120 length of data │ │ │ │ +001b8590: 3c2f 7370 616e 3e3c 2f64 6976 3e0a 3c64
    . │ │ │ │ +001b85b0: 2e2e 2e20 3c73 7061 6e20 636c 6173 733d ... // pop │ │ │ │ +001b85d0: 756c 6174 6520 6275 6620 616e 6420 6c65 ulate buf and le │ │ │ │ +001b85e0: 6e20 7769 7468 206d 6573 7361 6765 2074 n with message t │ │ │ │ +001b85f0: 6f20 7365 6e64 3c2f 7370 616e 3e3c 2f64 o send.
    │ │ │ │ +001b8630: 6966 3c2f 7370 616e 3e20 283c 6120 636c if (soap_ │ │ │ │ +001b8690: 504f 5354 3c2f 613e 283c 6120 636c 6173 POST( │ │ │ │ +001b86c0: 736f 6170 3c2f 613e 2c20 3c73 7061 6e20 soap, "URL& │ │ │ │ +001b86f0: 7175 6f74 3b3c 2f73 7061 6e3e 2c20 3c73 quot;, " │ │ │ │ +001b8720: 534f 4150 2061 6374 696f 6e20 6f72 204e SOAP action or N │ │ │ │ +001b8730: 554c 4c26 7175 6f74 3b3c 2f73 7061 6e3e ULL" │ │ │ │ +001b8740: 2c20 3c73 7061 6e20 636c 6173 733d 2273 , &q │ │ │ │ +001b8760: 756f 743b 6d65 6469 6120 7479 7065 2671 uot;media type&q │ │ │ │ +001b8770: 756f 743b 3c2f 7370 616e 3e29 203c 2f64 uot;) .
    || soap_s │ │ │ │ +001b87f0: 656e 645f 7261 773c 2f61 3e28 3c61 2063 end_raw(soap, buf, l │ │ │ │ +001b8880: 656e 293b 203c 2f64 6976 3e0a 3c64 6976 en);
    .. │ │ │ │ +001b8950: 2e2e 2e20 3c73 7061 6e20 636c 6173 733d ... // err │ │ │ │ +001b8970: 6f72 3c2f 7370 616e 3e3c 2f64 6976 3e0a or
    . │ │ │ │ +001b8980: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    if (soap_begi │ │ │ │ +001b8a10: 6e5f 7265 6376 3c2f 613e 2826 616d 703b n_recv(& │ │ │ │ +001b8a20: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap) │ │ │ │ +001b8a50: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    || (< │ │ │ │ +001b8a70: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +001b8a80: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ +001b8a90: 6874 6d6c 2361 6364 6131 3733 3666 6261 html#acda1736fba │ │ │ │ +001b8aa0: 6163 3037 3236 3132 3236 6265 6665 3136 ac07261226befe16 │ │ │ │ +001b8ab0: 3561 3536 3831 223e 6275 663c 2f61 3e20 5a5681">buf │ │ │ │ +001b8ac0: 3d20 3c61 2063 6c61 7373 3d22 636f 6465 = soap_http_get_ │ │ │ │ +001b8b20: 626f 6479 3c2f 613e 283c 6120 636c 6173 body( │ │ │ │ +001b8b50: 736f 6170 3c2f 613e 2c20 2661 6d70 3b6c soap, &l │ │ │ │ +001b8b60: 656e 2929 203d 3d20 4e55 4c4c 3c2f 6469 en)) == NULL.
    || soap_en │ │ │ │ +001b8be0: 645f 7265 6376 3c2f 613e 2826 616d 703b d_recv(& │ │ │ │ +001b8bf0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap) │ │ │ │ +001b8c20: 2920 3c2f 6469 763e 0a3c 6469 7620 636c )
    .
    ... │ │ │ │ +001b8c40: 203c 7370 616e 2063 6c61 7373 3d22 636f // error< │ │ │ │ +001b8c60: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    .< │ │ │ │ +001b8c80: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ +001b8c90: 656e 7422 3e2f 2f20 2e2e 2e20 7573 6520 ent">// ... use │ │ │ │ +001b8ca0: 6275 665b 302e 2e6c 656e 2d31 5d20 3c2f buf[0..len-1]
    ..
    soap_end( │ │ │ │ +001b8de0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap) │ │ │ │ +001b8e10: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
    .
    s │ │ │ │ +001b8e80: 6f61 705f 6672 6565 3c2f 613e 283c 6120 oap_free(soap);.
    soap │ │ │ │ +001b8f70: 5f62 6567 696e 5f72 6563 763c 2f61 3e3c _begin_recv< │ │ │ │ +001b8f80: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
    int soa │ │ │ │ +001b8fa0: 705f 6265 6769 6e5f 7265 6376 2873 7472 p_begin_recv(str │ │ │ │ +001b8fb0: 7563 7420 736f 6170 202a 736f 6170 293c uct soap *soap)< │ │ │ │ +001b8fc0: 2f64 6976 3e3c 6469 7620 636c 6173 733d /div>
    Initiali │ │ │ │ +001b8fe0: 7a65 2074 6865 2063 6f6e 7465 7874 2066 ze the context f │ │ │ │ +001b8ff0: 6f72 2072 6563 6569 7669 6e67 2e3c 2f64 or receiving.
    .
    soap_POST
    int soap │ │ │ │ +001b90e0: 5f50 4f53 5428 7374 7275 6374 2073 6f61 _POST(struct soa │ │ │ │ +001b90f0: 7020 2a73 6f61 702c 2063 6f6e 7374 2063 p *soap, const c │ │ │ │ +001b9100: 6861 7220 2a65 6e64 706f 696e 742c 2063 har *endpoint, c │ │ │ │ +001b9110: 6f6e 7374 2063 6861 7220 2a61 6374 696f onst char *actio │ │ │ │ +001b9120: 6e2c 2063 6f6e 7374 2063 6861 7220 2a74 n, const char *t │ │ │ │ +001b9130: 7970 6529 3c2f 6469 763e 3c64 6976 2063 ype)
    HTT │ │ │ │ +001b9150: 5020 504f 5354 2063 6f6e 7465 6e74 2074 P POST content t │ │ │ │ +001b9160: 6f20 7365 7276 6572 2e3c 2f64 6976 3e3c o server.
    < │ │ │ │ +001b9170: 2f64 6976 3e0a 3c2f 6469 763e 3c21 2d2d /div>.

    │ │ │ │ +001b9190: 5369 6d69 6c61 726c 792c 203c 636f 6465 Similarly, soap_PUT< │ │ │ │ +001b9220: 2f63 6f64 653e 2c20 3c63 6f64 653e 3c61 /code>, soap_PATCH │ │ │ │ +001b92b0: 3c2f 636f 6465 3e2c 2061 6e64 203c 636f , and soap_D │ │ │ │ +001b9340: 454c 4554 453c 2f61 3e3c 2f63 6f64 653e ELETE │ │ │ │ +001b9350: 2063 6f6d 6d61 6e64 7320 6172 6520 7072 commands are pr │ │ │ │ +001b9360: 6f76 6964 6564 2066 6f72 2050 5554 2c20 ovided for PUT, │ │ │ │ +001b9370: 5041 5443 482c 2061 6e64 2044 454c 4554 PATCH, and DELET │ │ │ │ +001b9380: 4520 6861 6e64 6c69 6e67 2e3c 2f70 3e0a E handling.

    . │ │ │ │ +001b9390: 3c70 3e54 6f20 7375 7070 6f72 7420 4854

    To support HT │ │ │ │ +001b93a0: 5450 2070 6970 656c 696e 696e 6720 7765 TP pipelining we │ │ │ │ +001b93b0: 2075 7365 2074 6865 203c 636f 6465 3e3c use the < │ │ │ │ +001b93c0: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ +001b93d0: 663d 2267 726f 7570 5f5f 6772 6f75 705f f="group__group_ │ │ │ │ +001b93e0: 5f69 6f2e 6874 6d6c 2367 6162 6562 6334 _io.html#gabebc4 │ │ │ │ +001b93f0: 3063 6234 6466 3736 3431 3837 3439 3635 0cb4df7641874965 │ │ │ │ +001b9400: 6466 3237 6366 6437 6162 6322 2074 6974 df27cfd7abc" tit │ │ │ │ +001b9410: 6c65 3d22 5468 6520 4854 5450 2070 6970 le="The HTTP pip │ │ │ │ +001b9420: 656c 696e 696e 6720 706c 7567 696e 2072 elining plugin r │ │ │ │ +001b9430: 6567 6973 7472 6174 696f 6e20 6675 6e63 egistration func │ │ │ │ +001b9440: 7469 6f6e 2e22 3e68 7474 705f 7069 7065 tion.">http_pipe │ │ │ │ +001b9450: 3c2f 613e 3c2f 636f 6465 3e20 706c 7567 plug │ │ │ │ +001b9460: 696e 2c20 7768 6963 6820 6361 6e20 6265 in, which can be │ │ │ │ +001b9470: 2075 7365 6420 6174 2074 6865 2073 6572 used at the ser │ │ │ │ +001b9480: 7665 7220 7369 6465 2074 6f20 656e 6162 ver side to enab │ │ │ │ +001b9490: 6c65 2048 5454 5020 7069 7065 6c69 6e69 le HTTP pipelini │ │ │ │ +001b94a0: 6e67 2061 7574 6f6d 6174 6963 616c 6c79 ng automatically │ │ │ │ +001b94b0: 2c20 7768 656e 2072 6567 6973 7465 7265 , when registere │ │ │ │ +001b94c0: 642e 2054 6865 2070 6c75 6769 6e20 6361 d. The plugin ca │ │ │ │ +001b94d0: 6e20 616c 736f 2062 6520 7573 6564 2061 n also be used a │ │ │ │ +001b94e0: 7420 7468 6520 636c 6965 6e74 2073 6964 t the client sid │ │ │ │ +001b94f0: 652c 2074 686f 7567 6820 7468 6973 2069 e, though this i │ │ │ │ +001b9500: 7320 6f6e 6c79 206e 6563 6573 7361 7279 s only necessary │ │ │ │ +001b9510: 2069 6e20 7363 656e 6172 696f 7320 7468 in scenarios th │ │ │ │ +001b9520: 6174 2072 6571 7569 7265 2074 6865 2063 at require the c │ │ │ │ +001b9530: 6c69 656e 7420 746f 2072 6563 6569 7665 lient to receive │ │ │ │ +001b9540: 206d 756c 7469 706c 6520 6d65 7373 6167 multiple messag │ │ │ │ +001b9550: 6573 2077 6974 686f 7574 2069 6e74 6572 es without inter │ │ │ │ +001b9560: 6d69 7474 656e 6420 7365 6e64 732c 2069 mittend sends, i │ │ │ │ +001b9570: 2e65 2e20 6d75 6c74 6970 6c65 2073 656e .e. multiple sen │ │ │ │ +001b9580: 6473 2066 6f6c 6c6f 7765 6420 6279 206d ds followed by m │ │ │ │ +001b9590: 756c 7469 706c 6520 7265 6365 6976 6573 ultiple receives │ │ │ │ +001b95a0: 2062 7920 7468 6520 7361 6d65 2074 6872 by the same thr │ │ │ │ +001b95b0: 6561 6420 7573 696e 6720 7468 6520 7361 ead using the sa │ │ │ │ +001b95c0: 6d65 203c 636f 6465 3e3c 6120 636c 6173 me soap context. Ho │ │ │ │ +001b9630: 7765 7665 722c 2063 6c69 656e 7473 2073 wever, clients s │ │ │ │ +001b9640: 686f 756c 6420 7573 6520 6d75 6c74 6970 hould use multip │ │ │ │ +001b9650: 6c65 2074 6872 6561 6473 2077 6865 6e20 le threads when │ │ │ │ +001b9660: 4854 5450 2070 6970 656c 696e 696e 6720 HTTP pipelining │ │ │ │ +001b9670: 6973 2075 7365 6420 746f 2070 7265 7665 is used to preve │ │ │ │ +001b9680: 6e74 2062 6c6f 636b 696e 672e 2053 6565 nt blocking. See │ │ │ │ +001b9690: 2074 6865 203c 656d 3e3c 636f 6465 3e67 the g │ │ │ │ +001b96a0: 736f 6170 2f73 616d 706c 6573 2f61 7379 soap/samples/asy │ │ │ │ +001b96b0: 6e63 3c2f 636f 6465 3e3c 2f65 6d3e 2066 nc f │ │ │ │ +001b96c0: 6f6c 6465 7220 696e 2074 6865 2067 534f older in the gSO │ │ │ │ +001b96d0: 4150 2070 6163 6b61 6765 2066 6f72 2065 AP package for e │ │ │ │ +001b96e0: 7870 6c61 6e61 7469 6f6e 2061 6e64 2065 xplanation and e │ │ │ │ +001b96f0: 7861 6d70 6c65 732e 3c2f 703e 0a3c 703e xamples.

    .

    │ │ │ │ +001b9700: 5365 6520 616c 736f 203c 636f 6465 3e3c See also < │ │ │ │ +001b9710: 6120 636c 6173 733d 2265 6c22 2068 7265 a class="el" hre │ │ │ │ +001b9720: 663d 2267 726f 7570 5f5f 6772 6f75 705f f="group__group_ │ │ │ │ +001b9730: 5f69 6f2e 6874 6d6c 2367 6134 6330 3864 _io.html#ga4c08d │ │ │ │ +001b9740: 3565 6632 3862 6330 6463 3337 6565 6534 5ef28bc0dc37eee4 │ │ │ │ +001b9750: 3633 3361 6364 6431 3134 3022 2074 6974 633acdd1140" tit │ │ │ │ +001b9760: 6c65 3d22 5468 6520 4854 5450 2050 4f53 le="The HTTP POS │ │ │ │ +001b9770: 5420 706c 7567 696e 2072 6567 6973 7472 T plugin registr │ │ │ │ +001b9780: 6174 696f 6e20 6675 6e63 7469 6f6e 2e22 ation function." │ │ │ │ +001b9790: 3e68 7474 705f 706f 7374 3c2f 613e 3c2f >http_post and │ │ │ │ +001b97b0: 3c61 2063 6c61 7373 3d22 656c 2220 6872 http_pip │ │ │ │ +001b9840: 653c 2f61 3e3c 2f63 6f64 653e 2e3c 2f70 e.

    .

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

    .

    │ │ │ │ +001b98b0: 3c2f 613e 0a54 6865 2048 5454 5020 6469 .The HTTP di │ │ │ │ +001b98c0: 6765 7374 2061 7574 6865 6e74 6963 6174 gest authenticat │ │ │ │ +001b98d0: 696f 6e20 706c 7567 696e 3c2f 6833 3e0a ion plugin

    . │ │ │ │ +001b98e0: 3c70 3e54 6865 2048 5454 5020 6469 6765

    The HTTP dige │ │ │ │ +001b98f0: 7374 2061 7574 6865 6e74 6963 6174 696f st authenticatio │ │ │ │ +001b9900: 6e20 706c 7567 696e 2065 6e61 626c 6573 n plugin enables │ │ │ │ +001b9910: 2061 206d 6f72 6520 7365 6375 7265 2061 a more secure a │ │ │ │ +001b9920: 7574 6865 6e74 6963 6174 696f 6e20 7363 uthentication sc │ │ │ │ +001b9930: 6865 6d65 2063 6f6d 7061 7265 6420 746f heme compared to │ │ │ │ +001b9940: 2062 6173 6963 2061 7574 6865 6e74 6963 basic authentic │ │ │ │ +001b9950: 6174 696f 6e2e 2048 5454 5020 6261 7369 ation. HTTP basi │ │ │ │ +001b9960: 6320 6175 7468 656e 7469 6361 7469 6f6e c authentication │ │ │ │ +001b9970: 2073 656e 6473 2075 6e65 6e63 7279 7074 sends unencrypt │ │ │ │ +001b9980: 6564 2075 7365 7269 6473 2061 6e64 2070 ed userids and p │ │ │ │ +001b9990: 6173 7377 6f72 6473 206f 7665 7220 7468 asswords over th │ │ │ │ +001b99a0: 6520 6e65 742c 2077 6869 6c65 2064 6967 e net, while dig │ │ │ │ +001b99b0: 6573 7420 6175 7468 656e 7469 6361 7469 est authenticati │ │ │ │ +001b99c0: 6f6e 2064 6f65 7320 6e6f 7420 6578 6368 on does not exch │ │ │ │ +001b99d0: 616e 6765 2070 6173 7377 6f72 6473 2062 ange passwords b │ │ │ │ +001b99e0: 7574 2065 7863 6861 6e67 6573 2063 6865 ut exchanges che │ │ │ │ +001b99f0: 636b 7375 6d73 206f 6620 7061 7373 776f cksums of passwo │ │ │ │ +001b9a00: 7264 7320 2861 6e64 206f 7468 6572 2064 rds (and other d │ │ │ │ +001b9a10: 6174 6120 7375 6368 2061 7320 6e6f 6e63 ata such as nonc │ │ │ │ +001b9a20: 6573 2074 6f20 6176 6f69 6420 7265 706c es to avoid repl │ │ │ │ +001b9a30: 6179 2061 7474 6163 6b73 292e 2046 6f72 ay attacks). For │ │ │ │ +001b9a40: 206d 6f72 6520 6465 7461 696c 732c 2070 more details, p │ │ │ │ +001b9a50: 6c65 6173 6520 7365 6520 5246 4320 3236 lease see RFC 26 │ │ │ │ +001b9a60: 3137 2e3c 2f70 3e0a 3c70 3e54 6865 2048 17.

    .

    The H │ │ │ │ +001b9a70: 5454 5020 6469 6765 7374 2061 7574 6865 TTP digest authe │ │ │ │ +001b9a80: 6e74 6963 6174 696f 6e20 6361 6e20 6265 ntication can be │ │ │ │ +001b9a90: 2075 7365 6420 6e65 7874 2074 6f20 7468 used next to th │ │ │ │ +001b9aa0: 6520 6275 696c 742d 696e 2062 6173 6963 e built-in basic │ │ │ │ +001b9ab0: 2061 7574 6865 6e74 6963 6174 696f 6e2c authentication, │ │ │ │ +001b9ac0: 206f 7220 6261 7369 6320 6175 7468 656e or basic authen │ │ │ │ +001b9ad0: 7469 6361 7469 6f6e 2063 616e 2062 6520 tication can be │ │ │ │ +001b9ae0: 7265 6a65 6374 6564 2074 6f20 7469 6768 rejected to tigh │ │ │ │ +001b9af0: 7465 6e20 7365 6375 7269 7479 2e20 5468 ten security. Th │ │ │ │ +001b9b00: 6520 7365 7276 6572 206d 7573 7420 6861 e server must ha │ │ │ │ +001b9b10: 7665 2061 2064 6174 6162 6173 6520 7769 ve a database wi │ │ │ │ +001b9b20: 7468 2075 7365 7269 6427 7320 616e 6420 th userid's and │ │ │ │ +001b9b30: 7061 7373 776f 7264 7320 2869 6e20 706c passwords (in pl │ │ │ │ +001b9b40: 6169 6e20 7465 7874 2066 6f72 6d29 2e20 ain text form). │ │ │ │ +001b9b50: 5468 6520 636c 6965 6e74 2c20 7768 656e The client, when │ │ │ │ +001b9b60: 2063 6861 6c6c 656e 6765 6420 6279 2074 challenged by t │ │ │ │ +001b9b70: 6865 2073 6572 7665 722c 2063 6865 636b he server, check │ │ │ │ +001b9b80: 7320 7468 6520 6175 7468 656e 7469 6361 s the authentica │ │ │ │ +001b9b90: 7469 6f6e 2072 6561 6c6d 2070 726f 7669 tion realm provi │ │ │ │ +001b9ba0: 6465 6420 6279 2074 6865 2073 6572 7665 ded by the serve │ │ │ │ +001b9bb0: 7220 616e 6420 7365 7473 2074 6865 2075 r and sets the u │ │ │ │ +001b9bc0: 7365 7269 6420 616e 6420 7061 7373 776f serid and passwo │ │ │ │ +001b9bd0: 7264 7320 666f 7220 6469 6765 7374 2061 rds for digest a │ │ │ │ +001b9be0: 7574 6865 6e74 6963 6174 696f 6e2e 2054 uthentication. T │ │ │ │ +001b9bf0: 6865 2063 6c69 656e 7420 6170 706c 6963 he client applic │ │ │ │ +001b9c00: 6174 696f 6e20 6361 6e20 7465 6d70 6f72 ation can tempor │ │ │ │ +001b9c10: 6172 696c 7920 7374 6f72 6520 7468 6520 arily store the │ │ │ │ +001b9c20: 7573 6572 6964 2061 6e64 2070 6173 7377 userid and passw │ │ │ │ +001b9c30: 6f72 6420 666f 7220 6120 7365 7175 656e ord for a sequen │ │ │ │ +001b9c40: 6365 206f 6620 6d65 7373 6167 6520 6578 ce of message ex │ │ │ │ +001b9c50: 6368 616e 6765 7320 7769 7468 2074 6865 changes with the │ │ │ │ +001b9c60: 2073 6572 7665 722c 2077 6869 6368 2069 server, which i │ │ │ │ +001b9c70: 7320 6661 7374 6572 2074 6861 6e20 7265 s faster than re │ │ │ │ +001b9c80: 7065 6174 6564 2061 7574 686f 7269 7a61 peated authoriza │ │ │ │ +001b9c90: 7469 6f6e 2063 6861 6c6c 656e 6765 7320 tion challenges │ │ │ │ +001b9ca0: 616e 6420 6175 7468 656e 7469 6361 7469 and authenticati │ │ │ │ +001b9cb0: 6f6e 2072 6573 706f 6e73 6573 2e3c 2f70 on responses.

    .

    At the clie │ │ │ │ +001b9cd0: 6e74 2073 6964 652c 2074 6865 2070 6c75 nt side, the plu │ │ │ │ +001b9ce0: 6769 6e20 6973 2072 6567 6973 7465 7265 gin is registere │ │ │ │ +001b9cf0: 6420 616e 6420 7365 7276 6963 6520 696e d and service in │ │ │ │ +001b9d00: 766f 6361 7469 6f6e 7320 6172 6520 6368 vocations are ch │ │ │ │ +001b9d10: 6563 6b65 6420 666f 7220 6175 7468 6f72 ecked for author │ │ │ │ +001b9d20: 697a 6174 696f 6e20 6368 616c 6c65 6e67 ization challeng │ │ │ │ +001b9d30: 6573 2028 4854 5450 2065 7272 6f72 2063 es (HTTP error c │ │ │ │ +001b9d40: 6f64 6520 3430 3129 2e20 5768 656e 2074 ode 401). When t │ │ │ │ +001b9d50: 6865 2073 6572 7665 7220 6368 616c 6c65 he server challe │ │ │ │ +001b9d60: 6e67 6573 2074 6865 2063 6c69 656e 742c nges the client, │ │ │ │ +001b9d70: 2074 6865 2063 6c69 656e 7420 7368 6f75 the client shou │ │ │ │ +001b9d80: 6c64 2073 6574 2074 6865 2075 7365 7269 ld set the useri │ │ │ │ +001b9d90: 6420 616e 6420 7061 7373 776f 7264 2061 d and password a │ │ │ │ +001b9da0: 6e64 2072 6574 7279 2074 6865 2069 6e76 nd retry the inv │ │ │ │ +001b9db0: 6f63 6174 696f 6e2e 2054 6865 2063 6c69 ocation. The cli │ │ │ │ +001b9dc0: 656e 7420 6361 6e20 6465 7465 726d 696e ent can determin │ │ │ │ +001b9dd0: 6520 7468 6520 7573 6572 6964 2061 6e64 e the userid and │ │ │ │ +001b9de0: 2070 6173 7377 6f72 6420 6261 7365 6420 password based │ │ │ │ +001b9df0: 6f6e 2074 6865 2061 7574 6865 6e74 6963 on the authentic │ │ │ │ +001b9e00: 6174 696f 6e20 7265 616c 6d20 7061 7274 ation realm part │ │ │ │ +001b9e10: 206f 6620 7468 6520 7365 7276 6572 2773 of the server's │ │ │ │ +001b9e20: 2063 6861 6c6c 656e 6765 2e20 5468 6520 challenge. The │ │ │ │ +001b9e30: 6175 7468 656e 7469 6361 7469 6f6e 2069 authentication i │ │ │ │ +001b9e40: 6e66 6f72 6d61 7469 6f6e 2063 616e 2062 nformation can b │ │ │ │ +001b9e50: 6520 7465 6d70 6f72 6172 696c 7920 7361 e temporarily sa │ │ │ │ +001b9e60: 7665 6420 666f 7220 6d75 6c74 6970 6c65 ved for multiple │ │ │ │ +001b9e70: 2069 6e76 6f63 6174 696f 6e73 2e3c 2f70 invocations.

    .

    Client-side │ │ │ │ +001b9e90: 2065 7861 6d70 6c65 3a3c 2f70 3e0a 3c64 example:

    .
    #include " │ │ │ │ +001b9ef0: 6874 7470 6461 2e68 2671 756f 743b 3c2f httpda.h"
    . │ │ │ │ +001b9f20: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    int ma │ │ │ │ +001b9f60: 696e 2829 3c2f 6469 763e 0a3c 6469 7620 in()
    .
    {.
    s │ │ │ │ +001b9fb0: 7472 7563 7420 3c2f 7370 616e 3e3c 6120 truct soap *soap = │ │ │ │ +001ba020: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap_new();
    .
    < │ │ │ │ +001ba0a0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +001ba0b0: 6f72 6466 6c6f 7722 3e69 663c 2f73 7061 ordflow">if soap_regi │ │ │ │ +001ba120: 7374 6572 5f70 6c75 6769 6e3c 2f61 3e28 ster_plugin( │ │ │ │ +001ba130: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap, │ │ │ │ +001ba160: 2068 7474 705f 6461 2929 203c 2f64 6976 http_da))
    .
    exit(EXI │ │ │ │ +001ba190: 545f 4641 494c 5552 4529 3b20 3c73 7061 T_FAILURE); // failed to r │ │ │ │ +001ba1c0: 6567 6973 7465 7220 3c2f 7370 616e 3e3c egister < │ │ │ │ +001ba1d0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    if (s │ │ │ │ +001ba210: 6f61 705f 6361 6c6c 5f6e 735f 5f77 6562 oap_call_ns__web │ │ │ │ +001ba220: 6d65 7468 6f64 283c 6120 636c 6173 733d method(so │ │ │ │ +001ba250: 6170 3c2f 613e 2c20 2e2e 2e29 2920 3c2f ap, ...)) .
    {
    │ │ │ │ +001ba280: 0a3c 6469 7620 636c 6173 733d 226c 696e ..
    │ │ │ │ +001ba3b0: 7b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 {
    .
    │ │ │ │ +001ba3d0: 3c73 7061 6e20 636c 6173 733d 226b 6579 if (!strcmp(soap-> │ │ │ │ +001ba430: 3b3c 6120 636c 6173 733d 2263 6f64 6522 ;authre │ │ │ │ +001ba480: 616c 6d3c 2f61 3e2c 203c 6120 636c 6173 alm, authrealm) │ │ │ │ +001ba4e0: 2920 3c73 7061 6e20 636c 6173 733d 2263 ) // optio │ │ │ │ +001ba500: 6e61 6c6c 7920 6465 7465 726d 696e 6520 nally determine │ │ │ │ +001ba510: 6175 7468 656e 7469 6361 7469 6f6e 2072 authentication r │ │ │ │ +001ba520: 6561 6c6d 3c2f 7370 616e 3e3c 2f64 6976 ealm
    .
    {
    .
    struct │ │ │ │ +001ba590: 6874 7470 5f64 615f 696e 666f 2069 6e66 http_da_info inf │ │ │ │ +001ba5a0: 6f3b 203c 7370 616e 2063 6c61 7373 3d22 o; // to s │ │ │ │ +001ba5c0: 746f 7265 2075 7365 7269 6420 616e 6420 tore userid and │ │ │ │ +001ba5d0: 7061 7373 7764 203c 2f73 7061 6e3e 3c2f passwd .
    h │ │ │ │ +001ba600: 7474 705f 6461 5f73 6176 6528 3c61 2063 ttp_da_save(soap, &am │ │ │ │ +001ba640: 703b 696e 666f 2c20 6175 7468 7265 616c p;info, authreal │ │ │ │ +001ba650: 6d2c 2075 7365 7269 642c 2070 6173 7377 m, userid, passw │ │ │ │ +001ba660: 6429 3b20 3c73 7061 6e20 636c 6173 733d d); // set │ │ │ │ +001ba680: 2075 7365 7269 6420 616e 6420 7061 7373 userid and pass │ │ │ │ +001ba690: 7764 2066 6f72 2074 6869 7320 7265 616c wd for this real │ │ │ │ +001ba6a0: 6d3c 2f73 7061 6e3e 3c2f 6469 763e 0a3c m
    .< │ │ │ │ +001ba6b0: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +001ba6c0: 3e20 2020 2020 2020 203c 7370 616e 2063 > if (so │ │ │ │ +001ba6f0: 6170 5f63 616c 6c5f 6e73 5f5f 7765 626d ap_call_ns__webm │ │ │ │ +001ba700: 6574 686f 6428 3c61 2063 6c61 7373 3d22 ethod(soa │ │ │ │ +001ba730: 703c 2f61 3e2c 202e 2e2e 2929 203c 7370 p, ...)) // retry
    .
    │ │ │ │ +001ba780: 2020 2020 7b3c 2f64 6976 3e0a 3c64 6976 {
    .
    │ │ │ │ +001ba7a0: 2020 2020 2020 2020 2e2e 2e20 3c73 7061 ... //
    .
    soap_end( │ │ │ │ +001ba850: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap) │ │ │ │ +001ba880: 3b20 3c73 7061 6e20 636c 6173 733d 2263 ; // useri │ │ │ │ +001ba8a0: 6420 616e 6420 7061 7373 7764 2077 6572 d and passwd wer │ │ │ │ +001ba8b0: 6520 6465 616c 6c6f 6361 7465 6420 3c2f e deallocated
    .
    │ │ │ │ +001ba8e0: 2020 2020 2020 2020 6874 7470 5f64 615f http_da_ │ │ │ │ +001ba8f0: 7265 7374 6f72 6528 3c61 2063 6c61 7373 restore(s │ │ │ │ +001ba920: 6f61 703c 2f61 3e2c 2026 616d 703b 696e oap, &in │ │ │ │ +001ba930: 666f 293b 203c 7370 616e 2063 6c61 7373 fo); // re │ │ │ │ +001ba950: 7374 6f72 6520 7573 6572 6964 2061 6e64 store userid and │ │ │ │ +001ba960: 2070 6173 7377 6420 3c2f 7370 616e 3e3c passwd < │ │ │ │ +001ba970: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    │ │ │ │ +001ba990: 2020 3c73 7061 6e20 636c 6173 733d 226b if (!soap_cal │ │ │ │ +001ba9c0: 6c5f 6e73 5f5f 7765 626d 6574 686f 6428 l_ns__webmethod( │ │ │ │ +001ba9d0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap, │ │ │ │ +001baa00: 202e 2e2e 2929 203c 7370 616e 2063 6c61 ...)) // │ │ │ │ +001baa20: 616e 6f74 6865 7220 6361 6c6c 203c 2f73 another call
    .
    │ │ │ │ +001baa50: 2020 2020 2020 2020 202e 2e2e 203c 7370 ... //.
    }.
    }.
    }.
    }
    .< │ │ │ │ +001bab00: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +001bab10: 3e20 2068 7474 705f 6461 5f72 656c 6561 > http_da_relea │ │ │ │ +001bab20: 7365 283c 6120 636c 6173 733d 2263 6f64 se(soap, &info); │ │ │ │ +001bab60: 3c73 7061 6e20 636c 6173 733d 2263 6f6d // to remo │ │ │ │ +001bab80: 7665 2061 6c6c 2075 7365 7269 6420 616e ve all userid an │ │ │ │ +001bab90: 6420 7061 7373 7764 3c2f 7370 616e 3e3c d passwd< │ │ │ │ +001baba0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    s │ │ │ │ +001bac10: 6f61 705f 6465 7374 726f 793c 2f61 3e28 oap_destroy( │ │ │ │ +001bac20: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap) │ │ │ │ +001bac50: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
    .
    soap_end(soap);< │ │ │ │ +001bad00: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    s │ │ │ │ +001bad70: 6f61 705f 6672 6565 3c2f 613e 283c 6120 oap_free(soap);.
    }
    .< │ │ │ │ +001badd0: 2f64 6976 3e3c 212d 2d20 6672 6167 6d65 /div>

    This co │ │ │ │ +001badf0: 6465 2073 7570 706f 7274 7320 626f 7468 de supports both │ │ │ │ +001bae00: 2062 6173 6963 2061 6e64 2064 6967 6573 basic and diges │ │ │ │ +001bae10: 7420 6175 7468 656e 7469 6361 7469 6f6e t authentication │ │ │ │ +001bae20: 2e3c 2f70 3e0a 3c70 3e54 6865 2073 6572 .

    .

    The ser │ │ │ │ +001bae30: 7665 7220 6361 6e20 6368 616c 6c65 6e67 ver can challeng │ │ │ │ +001bae40: 6520 6120 636c 6965 6e74 2075 7369 6e67 e a client using │ │ │ │ +001bae50: 2048 5454 5020 636f 6465 2034 3031 2e20 HTTP code 401. │ │ │ │ +001bae60: 5769 7468 2074 6865 2070 6c75 6769 6e2c With the plugin, │ │ │ │ +001bae70: 2048 5454 5020 6469 6765 7374 2061 7574 HTTP digest aut │ │ │ │ +001bae80: 6865 6e74 6963 6174 696f 6e20 6368 616c hentication chal │ │ │ │ +001bae90: 6c65 6e67 6573 2061 7265 2073 656e 642e lenges are send. │ │ │ │ +001baea0: 2057 6974 686f 7574 2074 6865 2070 6c75 Without the plu │ │ │ │ +001baeb0: 6769 6e2c 2062 6173 6963 2061 7574 6865 gin, basic authe │ │ │ │ +001baec0: 6e74 6963 6174 696f 6e20 6368 616c 6c65 ntication challe │ │ │ │ +001baed0: 6e67 6573 2061 7265 2073 656e 642e 3c2f nges are send..

    Each serve │ │ │ │ +001baef0: 7220 6d65 7468 6f64 2063 616e 2069 6d70 r method can imp │ │ │ │ +001baf00: 6c65 6d65 6e74 2061 7574 6865 6e74 6963 lement authentic │ │ │ │ +001baf10: 6174 696f 6e20 6173 2064 6573 6972 6564 ation as desired │ │ │ │ +001baf20: 2061 6e64 206d 6179 2065 6e66 6f72 6365 and may enforce │ │ │ │ +001baf30: 2064 6967 6573 7420 6175 7468 656e 7469 digest authenti │ │ │ │ +001baf40: 6361 7469 6f6e 206f 7220 6d61 7920 616c cation or may al │ │ │ │ +001baf50: 736f 2061 6363 6570 7420 6261 7369 6320 so accept basic │ │ │ │ +001baf60: 6175 7468 656e 7469 6361 7469 6f6e 2072 authentication r │ │ │ │ +001baf70: 6573 706f 6e73 6573 2e20 546f 2076 6572 esponses. To ver │ │ │ │ +001baf80: 6966 7920 6469 6765 7374 2061 7574 6865 ify digest authe │ │ │ │ +001baf90: 6e74 6963 6174 696f 6e20 7265 7370 6f6e ntication respon │ │ │ │ +001bafa0: 7365 732c 2074 6865 2073 6572 7665 7220 ses, the server │ │ │ │ +001bafb0: 7368 6f75 6c64 2063 6f6d 7075 7465 2061 should compute a │ │ │ │ +001bafc0: 6e64 2063 6f6d 7061 7265 2074 6865 2063 nd compare the c │ │ │ │ +001bafd0: 6865 636b 7375 6d73 2075 7369 6e67 2074 hecksums using t │ │ │ │ +001bafe0: 6865 2070 6c75 6769 6e27 7320 3c63 6f64 he plugin's http_da_verify │ │ │ │ +001bb000: 5f70 6f73 743c 2f63 6f64 653e 2066 756e _post fun │ │ │ │ +001bb010: 6374 696f 6e20 666f 7220 4854 5450 2050 ction for HTTP P │ │ │ │ +001bb020: 4f53 5420 7265 7175 6573 7473 2028 616e OST requests (an │ │ │ │ +001bb030: 6420 3c63 6f64 653e 6874 7470 5f64 615f d http_da_ │ │ │ │ +001bb040: 7665 7269 6679 5f67 6574 3c2f 636f 6465 verify_get for HTTP GET r │ │ │ │ +001bb060: 6571 7565 7374 7320 7769 7468 2074 6865 equests with the │ │ │ │ +001bb070: 2048 5454 5020 4745 5420 706c 7567 696e HTTP GET plugin │ │ │ │ +001bb080: 2920 6173 2066 6f6c 6c6f 7773 3a3c 2f70 ) as follows:

    .
    #include &q │ │ │ │ +001bb0e0: 756f 743b 6874 7470 6461 2e68 2671 756f uot;httpda.h&quo │ │ │ │ +001bb0f0: 743b 3c2f 7370 616e 3e20 3c2f 6469 763e t;
    │ │ │ │ +001bb100: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    .
    int main()
    .< │ │ │ │ +001bb160: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +001bb170: 3e7b 3c2f 6469 763e 0a3c 6469 7620 636c >{
    .
    struct soap │ │ │ │ +001bb1e0: 202a 3c61 2063 6c61 7373 3d22 636f 6465 *soap = soap_ne │ │ │ │ +001bb270: 773c 2f61 3e28 293b 3c2f 6469 763e 0a3c w();
    .< │ │ │ │ +001bb280: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +001bb290: 3e20 203c 7370 616e 2063 6c61 7373 3d22 > if< │ │ │ │ +001bb2b0: 2f73 7061 6e3e 2028 3c61 2063 6c61 7373 /span> (soap │ │ │ │ +001bb310: 5f72 6567 6973 7465 725f 706c 7567 696e _register_plugin │ │ │ │ +001bb320: 3c2f 613e 283c 6120 636c 6173 733d 2263 (soap │ │ │ │ +001bb350: 3c2f 613e 2c20 6874 7470 5f64 6129 2920 , http_da)) │ │ │ │ +001bb360: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    exi │ │ │ │ +001bb380: 7428 4558 4954 5f46 4149 4c55 5245 293b t(EXIT_FAILURE); │ │ │ │ +001bb390: 203c 7370 616e 2063 6c61 7373 3d22 636f // failed │ │ │ │ +001bb3b0: 2074 6f20 7265 6769 7374 6572 203c 2f73 to register
    .
    . │ │ │ │ +001bb3e0: 2e2e 203c 7370 616e 2063 6c61 7373 3d22 .. // use │ │ │ │ +001bb400: 736f 6170 5f62 696e 6420 616e 6420 736f soap_bind and so │ │ │ │ +001bb410: 6170 5f61 6363 6570 7420 696e 2061 2028 ap_accept in a ( │ │ │ │ +001bb420: 6d75 6c74 692d 7468 7265 6164 6564 2920 multi-threaded) │ │ │ │ +001bb430: 7365 7276 6963 6520 6c6f 6f70 3c2f 7370 service loop
    ..
    │ │ │ │ +001bb530: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap_print_fa │ │ │ │ +001bb590: 756c 743c 2f61 3e28 3c61 2063 6c61 7373 ult(s │ │ │ │ +001bb5c0: 6f61 703c 2f61 3e2c 2073 7464 6572 7229 oap, stderr) │ │ │ │ +001bb5d0: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
    .
    ... │ │ │ │ +001bb5f0: 3c73 7061 6e20 636c 6173 733d 2263 6f6d //< │ │ │ │ +001bb610: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    s │ │ │ │ +001bb680: 6f61 705f 6465 7374 726f 793c 2f61 3e28 oap_destroy( │ │ │ │ +001bb690: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap) │ │ │ │ +001bb6c0: 3b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 ;
    .
    soap_end(soap);< │ │ │ │ +001bb770: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    s │ │ │ │ +001bb7e0: 6f61 705f 6672 6565 3c2f 613e 283c 6120 oap_free(soap);.
    }
    .< │ │ │ │ +001bb840: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +001bb850: 3e20 3c2f 6469 763e 0a3c 6469 7620 636c >
    .
    int │ │ │ │ +001bb890: 6e73 5f5f 7765 626d 6574 686f 6428 3c73 ns__webmethod(struct soap *soap, ...)
    . │ │ │ │ +001bb930: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    {
    .
    if (soap-> │ │ │ │ +001bba00: 7573 6572 6964 3c2f 613e 2026 616d 703b userid & │ │ │ │ +001bba10: 2661 6d70 3b20 3c61 2063 6c61 7373 3d22 & soa │ │ │ │ +001bba40: 703c 2f61 3e2d 2667 743b 3c61 2063 6c61 p->passwd) < │ │ │ │ +001bbaa0: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ +001bbab0: 656e 7422 3e2f 2f20 636c 6965 6e74 2075 ent">// client u │ │ │ │ +001bbac0: 7365 6420 6261 7369 6320 6175 7468 656e sed basic authen │ │ │ │ +001bbad0: 7469 6361 7469 6f6e 203c 2f73 7061 6e3e tication │ │ │ │ +001bbae0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    {.
    / │ │ │ │ +001bbb30: 2f20 6d61 7920 6465 6369 6465 206e 6f74 / may decide not │ │ │ │ +001bbb40: 2074 6f20 6861 6e64 6c65 2c20 6275 7420 to handle, but │ │ │ │ +001bbb50: 6966 206f 6b20 7468 656e 2067 6f20 6168 if ok then go ah │ │ │ │ +001bbb60: 6561 6420 616e 6420 636f 6d70 6172 6520 ead and compare │ │ │ │ +001bbb70: 696e 666f 3a20 3c2f 7370 616e 3e3c 2f64 info: .. │ │ │ │ +001bbdb0: 2020 2020 7b3c 2f64 6976 3e0a 3c64 6976 {
    .
    │ │ │ │ +001bbdd0: 2020 2020 2e2e 2e20 3c73 7061 6e20 636c ... // │ │ │ │ +001bbdf0: 2068 616e 646c 6520 7265 7175 6573 743c handle request< │ │ │ │ +001bbe00: 2f73 7061 6e3e 3c2f 6469 763e 0a3c 6469 /span>
    . │ │ │ │ +001bbe20: 2020 2020 203c 7370 616e 2063 6c61 7373 r │ │ │ │ +001bbe40: 6574 7572 6e3c 2f73 7061 6e3e 203c 6120 eturn SOAP_OK; .
    } .
    }
    │ │ │ │ +001bbef0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    e │ │ │ │ +001bbf20: 6c73 653c 2f73 7061 6e3e 203c 7370 616e lse if ( │ │ │ │ +001bbf50: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap- │ │ │ │ +001bbf80: 2667 743b 3c61 2063 6c61 7373 3d22 636f >aut │ │ │ │ +001bbfd0: 6872 6561 6c6d 3c2f 613e 2026 616d 703b hrealm & │ │ │ │ +001bbfe0: 2661 6d70 3b20 3c61 2063 6c61 7373 3d22 & soa │ │ │ │ +001bc010: 703c 2f61 3e2d 2667 743b 3c61 2063 6c61 p->userid) < │ │ │ │ +001bc070: 7370 616e 2063 6c61 7373 3d22 636f 6d6d span class="comm │ │ │ │ +001bc080: 656e 7422 3e2f 2f20 4469 6765 7374 2061 ent">// Digest a │ │ │ │ +001bc090: 7574 6865 6e74 6963 6174 696f 6e20 3c2f uthentication
    .
    │ │ │ │ +001bc0c0: 7b3c 2f64 6976 3e0a 3c64 6976 2063 6c61 {
    .
    passwd = ...; / │ │ │ │ +001bc150: 2f20 6461 7461 6261 7365 206c 6f6f 6b75 / database looku │ │ │ │ +001bc160: 7020 6f6e 2075 7365 7269 6420 616e 6420 p on userid and │ │ │ │ +001bc170: 6175 7468 7265 616c 6d20 746f 2066 696e authrealm to fin │ │ │ │ +001bc180: 6420 7061 7373 7764 203c 2f73 7061 6e3e d passwd │ │ │ │ +001bc190: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    if │ │ │ │ +001bc1d0: 2028 2173 7472 636d 7028 3c61 2063 6c61 (!strcmp(soap->authrealm │ │ │ │ +001bc260: 3c2f 613e 2c20 3c61 2063 6c61 7373 3d22 , a │ │ │ │ +001bc2b0: 7574 6872 6561 6c6d 3c2f 613e 2920 2661 uthrealm) &a │ │ │ │ +001bc2c0: 6d70 3b26 616d 703b 2021 7374 7263 6d70 mp;& !strcmp │ │ │ │ +001bc2d0: 283c 6120 636c 6173 733d 2263 6f64 6522 (soap │ │ │ │ +001bc300: 2d26 6774 3b3c 6120 636c 6173 733d 2263 ->us │ │ │ │ +001bc350: 6572 6964 3c2f 613e 2c20 3c61 2063 6c61 erid, userid)) │ │ │ │ +001bc3b0: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    {.
    if │ │ │ │ +001bc410: 2028 2168 7474 705f 6461 5f76 6572 6966 (!http_da_verif │ │ │ │ +001bc420: 795f 706f 7374 283c 6120 636c 6173 733d y_post(so │ │ │ │ +001bc450: 6170 3c2f 613e 2c20 3c61 2063 6c61 7373 ap, passwd)) .
    {.
    . │ │ │ │ +001bc4f0: 2e2e 203c 7370 616e 2063 6c61 7373 3d22 .. // hand │ │ │ │ +001bc510: 6c65 2072 6571 7565 7374 3c2f 7370 616e le request
    .
    │ │ │ │ +001bc540: 2020 3c73 7061 6e20 636c 6173 733d 226b retu │ │ │ │ +001bc560: 726e 3c2f 7370 616e 3e20 3c61 2063 6c61 rn SO │ │ │ │ +001bc5c0: 4150 5f4f 4b3c 2f61 3e3b 203c 2f64 6976 AP_OK;
    .
    } .
    }
    .
    }
    .< │ │ │ │ +001bc630: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +001bc640: 3e20 203c 6120 636c 6173 733d 2263 6f64 > soap-> │ │ │ │ +001bc6c0: 6175 7468 7265 616c 6d3c 2f61 3e20 3d20 authrealm = │ │ │ │ +001bc6d0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 authrea │ │ │ │ +001bc720: 6c6d 3c2f 613e 3b20 3c73 7061 6e20 636c lm; // │ │ │ │ +001bc740: 2073 6574 2072 6561 6c6d 2066 6f72 2063 set realm for c │ │ │ │ +001bc750: 6861 6c6c 656e 6765 203c 2f73 7061 6e3e hallenge │ │ │ │ +001bc760: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    return 401; // │ │ │ │ +001bc7c0: 204e 6f74 2061 7574 686f 7269 7a65 642c Not authorized, │ │ │ │ +001bc7d0: 2063 6861 6c6c 656e 6765 2064 6967 6573 challenge diges │ │ │ │ +001bc7e0: 7420 6175 7468 656e 7469 6361 7469 6f6e t authentication │ │ │ │ +001bc7f0: 203c 2f73 7061 6e3e 3c2f 6469 763e 0a3c
    .< │ │ │ │ +001bc800: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +001bc810: 3e7d 3c2f 6469 763e 0a3c 2f64 6976 3e3c >}
    .
    < │ │ │ │ +001bc820: 212d 2d20 6672 6167 6d65 6e74 202d 2d3e !-- fragment --> │ │ │ │ +001bc830: 3c70 3e46 6f72 206d 6f72 6520 6465 7461

    For more deta │ │ │ │ +001bc840: 696c 732c 2069 6e63 6c75 6469 6e67 2068 ils, including h │ │ │ │ +001bc850: 6f77 2074 6f20 636f 6e66 6967 7572 6520 ow to configure │ │ │ │ +001bc860: 4854 5450 2044 6967 6573 7420 6175 7468 HTTP Digest auth │ │ │ │ +001bc870: 656e 7469 6361 7469 6f6e 2066 6f72 2070 entication for p │ │ │ │ +001bc880: 726f 7869 6573 2c20 7365 6520 7468 6520 roxies, see the │ │ │ │ +001bc890: 3c61 2068 7265 663d 222e 2e2f 2e2e 2f68 HTTP dig │ │ │ │ +001bc8c0: 6573 7420 6175 7468 656e 7469 6361 7469 est authenticati │ │ │ │ +001bc8d0: 6f6e 2070 6c75 6769 6e3c 2f61 3e20 646f on plugin do │ │ │ │ +001bc8e0: 6375 6d65 6e74 6174 696f 6e2e 3c2f 703e cumentation.

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

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

    .

    .The HTTP s │ │ │ │ +001bc960: 6573 7369 6f6e 7320 706c 7567 696e 3c2f essions plugin.

    The plugi │ │ │ │ +001bc980: 6e20 636f 6465 2069 7320 6c6f 6361 7465 n code is locate │ │ │ │ +001bc990: 6420 696e 2074 6865 203c 656d 3e3c 636f d in the gsoap/plugin< │ │ │ │ +001bc9b0: 2f63 6f64 653e 3c2f 656d 3e20 6469 7265 /code> dire │ │ │ │ +001bc9c0: 6374 6f72 7920 636f 6e74 6169 6e69 6e67 ctory containing │ │ │ │ +001bc9d0: 203c 656d 3e3c 636f 6465 3e73 6573 7369 sessi │ │ │ │ +001bc9e0: 6f6e 732e 683c 2f63 6f64 653e 3c2f 656d ons.h and │ │ │ │ +001bca00: 7365 7373 696f 6e73 2e63 3c2f 636f 6465 sessions.c.

    .

    F │ │ │ │ +001bca20: 6f72 206d 6f72 6520 6465 7461 696c 732c or more details, │ │ │ │ +001bca30: 2073 6565 2074 6865 203c 6120 6872 6566 see the HTTP sessions │ │ │ │ +001bca70: 706c 7567 696e 3c2f 613e 2064 6f63 756d plugin docum │ │ │ │ +001bca80: 656e 7461 7469 6f6e 2e3c 2f70 3e0a 3c70 entation.

    .

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

    │ │ │ │ +001bcaf0: 0a54 6865 2041 7061 6368 6520 6d6f 6475 .The Apache modu │ │ │ │ +001bcb00: 6c65 2070 6c75 6769 6e3c 2f68 333e 0a3c le plugin

    .< │ │ │ │ +001bcb10: 703e 5468 6520 706c 7567 696e 2063 6f64 p>The plugin cod │ │ │ │ +001bcb20: 6520 6973 206c 6f63 6174 6564 2069 6e20 e is located in │ │ │ │ +001bcb30: 7468 6520 3c65 6d3e 3c63 6f64 653e 6773 the gs │ │ │ │ +001bcb40: 6f61 702f 6d6f 645f 6773 6f61 702f 6d6f oap/mod_gsoap/mo │ │ │ │ +001bcb50: 645f 6773 6f61 702d 302e 392f 6170 6163 d_gsoap-0.9/apac │ │ │ │ +001bcb60: 6865 5f32 303c 2f63 6f64 653e 3c2f 656d he_20 directory.

    │ │ │ │ +001bcb80: 0a3c 703e 466f 7220 6d6f 7265 2064 6574 .

    For more det │ │ │ │ +001bcb90: 6169 6c73 2c20 7365 6520 7468 6520 3c61 ails, see the Apache modu │ │ │ │ +001bcbd0: 6c65 3c2f 613e 2064 6f63 756d 656e 7461 le documenta │ │ │ │ +001bcbe0: 7469 6f6e 2e3c 2f70 3e0a 3c70 3ef0 9f94 tion.

    .

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

    . │ │ │ │ +001bcc20: 3c68 333e 3c61 2063 6c61 7373 3d22 616e

    .The │ │ │ │ +001bcc50: 4953 4150 4920 6578 7465 6e73 696f 6e20 ISAPI extension │ │ │ │ +001bcc60: 706c 7567 696e 3c2f 6833 3e0a 3c70 3e54 plugin

    .

    T │ │ │ │ +001bcc70: 6865 2070 6c75 6769 6e20 636f 6465 2069 he plugin code i │ │ │ │ +001bcc80: 7320 6c6f 6361 7465 6420 696e 2074 6865 s located in the │ │ │ │ +001bcc90: 203c 656d 3e3c 636f 6465 3e67 736f 6170 gsoap │ │ │ │ +001bcca0: 2f6d 6f64 5f67 736f 6170 2f67 736f 6170 /mod_gsoap/gsoap │ │ │ │ +001bccb0: 5f77 696e 2f69 7361 7069 3c2f 636f 6465 _win/isapi directory │ │ │ │ +001bccd0: 2e3c 2f70 3e0a 3c70 3e46 6f72 206d 6f72 .

    .

    For mor │ │ │ │ +001bcce0: 6520 6465 7461 696c 732c 2073 6565 2074 e details, see t │ │ │ │ +001bccf0: 6865 203c 6120 6872 6566 3d22 2e2e 2f2e he ISAPI e │ │ │ │ +001bcd20: 7874 656e 7369 6f6e 3c2f 613e 2064 6f63 xtension doc │ │ │ │ +001bcd30: 756d 656e 7461 7469 6f6e 2e3c 2f70 3e0a umentation.

    . │ │ │ │ +001bcd40: 3c70 3ef0 9f94 9d20 3c61 2068 7265 663d

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

    .

    │ │ │ │ +001bcda0: 0a54 6865 2043 5552 4c20 706c 7567 696e .The CURL plugin │ │ │ │ +001bcdb0: 3c2f 6833 3e0a 3c70 3e54 6865 2070 6c75

    .

    The plu │ │ │ │ +001bcdc0: 6769 6e20 636f 6465 2069 7320 6c6f 6361 gin code is loca │ │ │ │ +001bcdd0: 7465 6420 696e 2074 6865 203c 656d 3e3c ted in the < │ │ │ │ +001bcde0: 636f 6465 3e67 736f 6170 2f70 6c75 6769 code>gsoap/plugi │ │ │ │ +001bcdf0: 6e3c 2f63 6f64 653e 3c2f 656d 3e20 6469 n di │ │ │ │ +001bce00: 7265 6374 6f72 7920 636f 6e74 6169 6e69 rectory containi │ │ │ │ +001bce10: 6e67 203c 656d 3e3c 636f 6465 3e63 7572 ng cur │ │ │ │ +001bce20: 6c61 7069 2e68 3c2f 636f 6465 3e3c 2f65 lapi.h and curlapi.c.

    .

    F │ │ │ │ +001bce60: 6f72 206d 6f72 6520 6465 7461 696c 732c or more details, │ │ │ │ +001bce70: 2073 6565 2074 6865 203c 6120 6872 6566 see the CU │ │ │ │ +001bcea0: 524c 2070 6c75 6769 6e3c 2f61 3e20 646f RL plugin do │ │ │ │ +001bceb0: 6375 6d65 6e74 6174 696f 6e2e 3c2f 703e cumentation.

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

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

    .

    │ │ │ │ +001bcf20: 3c2f 613e 0a54 6865 2057 696e 496e 6574 .The WinInet │ │ │ │ +001bcf30: 2070 6c75 6769 6e3c 2f68 333e 0a3c 703e plugin

    .

    │ │ │ │ +001bcf40: 5468 6520 706c 7567 696e 2063 6f64 6520 The plugin code │ │ │ │ +001bcf50: 6973 206c 6f63 6174 6564 2069 6e20 7468 is located in th │ │ │ │ +001bcf60: 6520 3c65 6d3e 3c63 6f64 653e 6773 6f61 e gsoa │ │ │ │ +001bcf70: 702f 6d6f 645f 6773 6f61 702f 6773 6f61 p/mod_gsoap/gsoa │ │ │ │ +001bcf80: 705f 7769 6e2f 7769 6e69 6e65 743c 2f63 p_win/wininet direct │ │ │ │ +001bcfa0: 6f72 792e 3c2f 703e 0a3c 703e 466f 7220 ory.

    .

    For │ │ │ │ +001bcfb0: 6d6f 7265 2064 6574 6169 6c73 2c20 7365 more details, se │ │ │ │ +001bcfc0: 6520 7468 6520 3c61 2068 7265 663d 222e e the Wi │ │ │ │ +001bcff0: 6e49 6e65 7420 706c 7567 696e 3c2f 613e nInet plugin │ │ │ │ +001bd000: 2064 6f63 756d 656e 7461 7469 6f6e 2e3c documentation.< │ │ │ │ +001bd010: 2f70 3e0a 3c70 3ef0 9f94 9d20 3c61 2068 /p>.

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

    .

    < │ │ │ │ +001bd070: 2f61 3e0a 5468 6520 5753 2d41 6464 7265 /a>.The WS-Addre │ │ │ │ +001bd080: 7373 696e 6720 706c 7567 696e 3c2f 6833 ssing plugin

    .

    The plugin │ │ │ │ +001bd0a0: 636f 6465 2069 7320 6c6f 6361 7465 6420 code is located │ │ │ │ +001bd0b0: 696e 2074 6865 203c 656d 3e3c 636f 6465 in the gsoap/plugin direct │ │ │ │ +001bd0e0: 6f72 7920 636f 6e74 6169 6e69 6e67 203c ory containing < │ │ │ │ +001bd0f0: 656d 3e3c 636f 6465 3e77 7361 6170 692e em>wsaapi. │ │ │ │ +001bd100: 683c 2f63 6f64 653e 3c2f 656d 3e20 616e h an │ │ │ │ +001bd110: 6420 3c65 6d3e 3c63 6f64 653e 7773 6161 d wsaa │ │ │ │ +001bd120: 7069 2e63 3c2f 636f 6465 3e3c 2f65 6d3e pi.c │ │ │ │ +001bd130: 2028 746f 2062 6520 7573 6564 2069 6e20 (to be used in │ │ │ │ +001bd140: 4320 616e 6420 432b 2b29 2e3c 2f70 3e0a C and C++).

    . │ │ │ │ +001bd150: 3c70 3e54 6f20 656e 6162 6c65 2057 532d

    To enable WS- │ │ │ │ +001bd160: 4164 6472 6573 7369 6e67 2032 3030 3520 Addressing 2005 │ │ │ │ +001bd170: 2861 6e64 2073 7570 706f 7274 2066 6f72 (and support for │ │ │ │ +001bd180: 2038 2f32 3030 3429 2c20 7468 6520 7365 8/2004), the se │ │ │ │ +001bd190: 7276 6963 6520 6465 6669 6e69 7469 6f6e rvice definition │ │ │ │ +001bd1a0: 7320 6865 6164 6572 2066 696c 6520 666f s header file fo │ │ │ │ +001bd1b0: 7220 736f 6170 6370 7032 2073 686f 756c r soapcpp2 shoul │ │ │ │ +001bd1c0: 6420 696e 636c 7564 6520 7468 6520 666f d include the fo │ │ │ │ +001bd1d0: 6c6c 6f77 696e 6720 696d 706f 7274 733a llowing imports: │ │ │ │ +001bd1e0: 3c2f 703e 0a3c 6469 7620 636c 6173 733d

    .
    #import │ │ │ │ +001bd230: 2671 756f 743b 696d 706f 7274 2f77 7361 "import/wsa │ │ │ │ +001bd240: 352e 6826 7175 6f74 3b3c 2f73 7061 6e3e 5.h" │ │ │ │ +001bd250: 3c2f 6469 763e 0a3c 2f64 6976 3e3c 212d
    .

    This imports th │ │ │ │ +001bd280: 6520 534f 4150 2068 6561 6465 7220 656c e SOAP header el │ │ │ │ +001bd290: 656d 656e 7473 2072 6571 7569 7265 6420 ements required │ │ │ │ +001bd2a0: 6279 2057 532d 4164 6472 6573 7369 6e67 by WS-Addressing │ │ │ │ +001bd2b0: 2e3c 2f70 3e0a 3c70 3e46 6f72 206d 6f72 .

    .

    For mor │ │ │ │ +001bd2c0: 6520 6465 7461 696c 732c 2073 6565 2074 e details, see t │ │ │ │ +001bd2d0: 6865 203c 6120 6872 6566 3d22 2e2e 2f2e he WS-Addres │ │ │ │ +001bd300: 7369 6e67 2070 6c75 6769 6e3c 2f61 3e20 sing plugin │ │ │ │ +001bd310: 646f 6375 6d65 6e74 6174 696f 6e2e 3c2f documentation..

    .... Back to t │ │ │ │ +001bd340: 6162 6c65 206f 6620 636f 6e74 656e 7473 able of contents │ │ │ │ +001bd350: 3c2f 613e 3c2f 703e 0a3c 6833 3e3c 6120

    .

    < │ │ │ │ +001bd380: 2f61 3e0a 5468 6520 5753 2d52 656c 6961 /a>.The WS-Relia │ │ │ │ +001bd390: 626c 654d 6573 7361 6769 6e67 2070 6c75 bleMessaging plu │ │ │ │ +001bd3a0: 6769 6e3c 2f68 333e 0a3c 703e 5468 6520 gin

    .

    The │ │ │ │ +001bd3b0: 706c 7567 696e 2063 6f64 6520 6973 206c plugin code is l │ │ │ │ +001bd3c0: 6f63 6174 6564 2069 6e20 7468 6520 3c65 ocated in the gsoap/pl │ │ │ │ +001bd3e0: 7567 696e 3c2f 636f 6465 3e3c 2f65 6d3e ugin │ │ │ │ +001bd3f0: 2064 6972 6563 746f 7279 2063 6f6e 7461 directory conta │ │ │ │ +001bd400: 696e 696e 6720 3c65 6d3e 3c63 6f64 653e ining │ │ │ │ +001bd410: 7773 726d 6170 692e 683c 2f63 6f64 653e wsrmapi.h │ │ │ │ +001bd420: 3c2f 656d 3e20 616e 6420 3c65 6d3e 3c63 and wsrmapi.c (to be │ │ │ │ +001bd450: 2075 7365 6420 696e 2043 2061 6e64 2043 used in C and C │ │ │ │ +001bd460: 2b2b 292e 3c2f 703e 0a3c 703e 416c 736f ++).

    .

    Also │ │ │ │ +001bd470: 206e 6565 6465 6420 6172 6520 3c65 6d3e needed are │ │ │ │ +001bd480: 3c63 6f64 653e 7468 7265 6164 732e 683c threads.h< │ │ │ │ +001bd490: 2f63 6f64 653e 3c2f 656d 3e20 616e 6420 /code> and │ │ │ │ +001bd4a0: 3c65 6d3e 3c63 6f64 653e 7468 7265 6164 thread │ │ │ │ +001bd4b0: 732e 633c 2f63 6f64 653e 3c2f 656d 3e20 s.c │ │ │ │ +001bd4c0: 666f 7220 6d75 6c74 692d 7468 7265 6164 for multi-thread │ │ │ │ +001bd4d0: 696e 6720 616e 6420 6c6f 636b 696e 6720 ing and locking │ │ │ │ +001bd4e0: 7375 7070 6f72 742e 3c2f 703e 0a3c 703e support.

    .

    │ │ │ │ +001bd4f0: 546f 2065 6e61 626c 6520 5753 2d52 656c To enable WS-Rel │ │ │ │ +001bd500: 6961 626c 654d 6573 7361 6769 6e67 2c20 iableMessaging, │ │ │ │ +001bd510: 7468 6520 7365 7276 6963 6520 6465 6669 the service defi │ │ │ │ +001bd520: 6e69 7469 6f6e 7320 6865 6164 6572 2066 nitions header f │ │ │ │ +001bd530: 696c 6520 666f 7220 736f 6170 6370 7032 ile for soapcpp2 │ │ │ │ +001bd540: 2073 686f 756c 6420 696e 636c 7564 6520 should include │ │ │ │ +001bd550: 7468 6520 666f 6c6c 6f77 696e 6720 696d the following im │ │ │ │ +001bd560: 706f 7274 733a 3c2f 703e 0a3c 6469 7620 ports:

    .
    #i │ │ │ │ +001bd5b0: 6d70 6f72 7420 2671 756f 743b 696d 706f mport "impo │ │ │ │ +001bd5c0: 7274 2f77 7372 6d2e 6826 7175 6f74 3b3c rt/wsrm.h"< │ │ │ │ +001bd5d0: 2f73 7061 6e3e 203c 2f64 6976 3e0a 3c64 /span>
    . │ │ │ │ +001bd5f0: 3c73 7061 6e20 636c 6173 733d 2270 7265 #impo │ │ │ │ +001bd610: 7274 2026 7175 6f74 3b69 6d70 6f72 742f rt "import/ │ │ │ │ +001bd620: 7773 6135 2e68 2671 756f 743b 3c2f 7370 wsa5.h"
    .
    │ │ │ │ +001bd640: 3c21 2d2d 2066 7261 676d 656e 7420 2d2d

    Thi │ │ │ │ +001bdac0: 7320 696d 706f 7274 7320 7468 6520 534f s imports the SO │ │ │ │ +001bdad0: 4150 2068 6561 6465 7220 656c 656d 656e AP header elemen │ │ │ │ +001bdae0: 7473 2072 6571 7569 7265 6420 6279 2057 ts required by W │ │ │ │ +001bdaf0: 532d 5365 6375 7269 7479 2e3c 2f70 3e0a S-Security.

    . │ │ │ │ +001bdb00: 3c70 3e46 6f72 206d 6f72 6520 6465 7461

    For more deta │ │ │ │ +001bdb10: 696c 732c 2073 6565 2074 6865 203c 6120 ils, see the WS-Security plu │ │ │ │ +001bdb50: 6769 6e3c 2f61 3e20 646f 6375 6d65 6e74 gin document │ │ │ │ +001bdb60: 6174 696f 6e2e 3c2f 703e 0a3c 703e f09f ation.

    .

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

    │ │ │ │ +001bdba0: 0a3c 6833 3e3c 6120 636c 6173 733d 2261 .

    .The │ │ │ │ +001bdbd0: 5753 2d44 6973 636f 7665 7279 2070 6c75 WS-Discovery plu │ │ │ │ +001bdbe0: 6769 6e3c 2f68 333e 0a3c 703e 4261 7369 gin

    .

    Basi │ │ │ │ +001bdbf0: 6361 6c6c 792c 2074 6f20 6164 6420 5753 cally, to add WS │ │ │ │ +001bdc00: 2d44 6973 636f 7665 7279 2073 7570 706f -Discovery suppo │ │ │ │ +001bdc10: 7274 2074 6865 2066 6f6c 6c6f 7769 6e67 rt the following │ │ │ │ +001bdc20: 2065 7665 6e74 2068 616e 646c 6572 7320 event handlers │ │ │ │ +001bdc30: 6d75 7374 2062 6520 6465 6669 6e65 6420 must be defined │ │ │ │ +001bdc40: 616e 6420 6c69 6e6b 6564 3a3c 2f70 3e0a and linked:

    . │ │ │ │ +001bdc50: 3c64 6976 2063 6c61 7373 3d22 6672 6167
    void ws │ │ │ │ +001bdca0: 6464 5f65 7665 6e74 5f48 656c 6c6f 283c dd_event_Hello(< │ │ │ │ +001bdcb0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +001bdcc0: 6f72 6422 3e73 7472 7563 743c 2f73 7061 ord">struct soap *soap< │ │ │ │ +001bdd30: 2f61 3e2c 203c 2f64 6976 3e0a 3c64 6976 /a>,
    .
    unsigned │ │ │ │ +001bdd70: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c int Ins │ │ │ │ +001bdda0: 7461 6e63 6549 642c 203c 2f64 6976 3e0a tanceId,
    . │ │ │ │ +001bddb0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    const c │ │ │ │ +001bde00: 6861 723c 2f73 7061 6e3e 202a 5365 7175 har *Sequ │ │ │ │ +001bde10: 656e 6365 4964 2c20 3c2f 6469 763e 0a3c enceId,
    .< │ │ │ │ +001bde20: 6469 7620 636c 6173 733d 226c 696e 6522 div class="line" │ │ │ │ +001bde30: 3e3c 7370 616e 2063 6c61 7373 3d22 6b65 >unsig │ │ │ │ +001bde50: 6e65 643c 2f73 7061 6e3e 203c 7370 616e ned int │ │ │ │ +001bde80: 4d65 7373 6167 654e 756d 6265 722c 203c MessageNumber, < │ │ │ │ +001bde90: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    co │ │ │ │ +001bdec0: 6e73 743c 2f73 7061 6e3e 203c 7370 616e nst char │ │ │ │ +001bdef0: 202a 4d65 7373 6167 6549 442c 203c 2f64 *MessageID, .
    cons │ │ │ │ +001bdf30: 743c 2f73 7061 6e3e 203c 7370 616e 2063 t char * │ │ │ │ +001bdf60: 5265 6c61 7465 7354 6f2c 203c 2f64 6976 RelatesTo,
    .
    const< │ │ │ │ +001bdfa0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> char *En │ │ │ │ +001bdfd0: 6470 6f69 6e74 5265 6665 7265 6e63 652c dpointReference, │ │ │ │ +001bdfe0: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    │ │ │ │ +001be010: 636f 6e73 743c 2f73 7061 6e3e 203c 7370 const char *Types,
    .
    const< │ │ │ │ +001be080: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> char *Sc │ │ │ │ +001be0b0: 6f70 6573 2c20 3c2f 6469 763e 0a3c 6469 opes,
    .< │ │ │ │ +001be0d0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +001be0e0: 6f72 6422 3e63 6f6e 7374 3c2f 7370 616e ord">const char │ │ │ │ +001be110: 3c2f 7370 616e 3e20 2a4d 6174 6368 4279 *MatchBy │ │ │ │ +001be120: 2c20 3c2f 6469 763e 0a3c 6469 7620 636c ,
    .
    const char *XAddrs, .
    │ │ │ │ +001be1c0: 756e 7369 676e 6564 3c2f 7370 616e 3e20 unsigned │ │ │ │ +001be1d0: 3c73 7061 6e20 636c 6173 733d 226b 6579 int MetadataVer │ │ │ │ +001be200: 7369 6f6e 293c 2f64 6976 3e0a 3c2f 6469 sion)
    .
    .< │ │ │ │ +001be320: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +001be330: 6f72 6474 7970 6522 3e75 6e73 6967 6e65 ordtype">unsigne │ │ │ │ +001be340: 643c 2f73 7061 6e3e 203c 7370 616e 2063 d int In │ │ │ │ +001be370: 7374 616e 6365 4964 2c20 3c2f 6469 763e stanceId,
    │ │ │ │ +001be380: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    const │ │ │ │ +001be3d0: 6368 6172 3c2f 7370 616e 3e20 2a53 6571 char *Seq │ │ │ │ +001be3e0: 7565 6e63 6549 642c 203c 2f64 6976 3e0a uenceId,
    . │ │ │ │ +001be3f0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    unsi │ │ │ │ +001be420: 676e 6564 3c2f 7370 616e 3e20 3c73 7061 gned int │ │ │ │ +001be450: 204d 6573 7361 6765 4e75 6d62 6572 2c20 MessageNumber, │ │ │ │ +001be460: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    c │ │ │ │ +001be490: 6f6e 7374 3c2f 7370 616e 3e20 3c73 7061 onst char *MessageID, .
    con │ │ │ │ +001be500: 7374 3c2f 7370 616e 3e20 3c73 7061 6e20 st char │ │ │ │ +001be530: 2a52 656c 6174 6573 546f 2c20 3c2f 6469 *RelatesTo, .
    const │ │ │ │ +001be570: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c char *E │ │ │ │ +001be5a0: 6e64 706f 696e 7452 6566 6572 656e 6365 ndpointReference │ │ │ │ +001be5b0: 2c20 3c2f 6469 763e 0a3c 6469 7620 636c ,
    .
    const char *Types, .
    const │ │ │ │ +001be650: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c char *S │ │ │ │ +001be680: 636f 7065 732c 203c 2f64 6976 3e0a 3c64 copes,
    . │ │ │ │ +001be6a0: 3c73 7061 6e20 636c 6173 733d 226b 6579 const cha │ │ │ │ +001be6e0: 723c 2f73 7061 6e3e 202a 4d61 7463 6842 r *MatchB │ │ │ │ +001be6f0: 792c 203c 2f64 6976 3e0a 3c64 6976 2063 y,
    .
    const < │ │ │ │ +001be730: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +001be740: 6f72 6474 7970 6522 3e63 6861 723c 2f73 ordtype">char *XAddrs, .
    unsigned │ │ │ │ +001be7a0: 203c 7370 616e 2063 6c61 7373 3d22 6b65 int MetadataVe │ │ │ │ +001be7d0: 7273 696f 6e29 3c2f 6469 763e 0a3c 2f64 rsion)
    .
    soap │ │ │ │ +001be820: 5f77 7364 645f 6d6f 6465 2077 7364 645f _wsdd_mode wsdd_ │ │ │ │ +001be830: 6576 656e 745f 5072 6f62 6528 3c73 7061 event_Probe(struct │ │ │ │ +001be860: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap │ │ │ │ +001be890: 2a3c 6120 636c 6173 733d 2263 6f64 6522 *soap │ │ │ │ +001be8c0: 2c20 3c2f 6469 763e 0a3c 6469 7620 636c ,
    .
    const char *MessageID, │ │ │ │ +001be930: 3c2f 6469 763e 0a3c 6469 7620 636c 6173
    .
    c │ │ │ │ +001be960: 6f6e 7374 3c2f 7370 616e 3e20 3c73 7061 onst char *ReplyTo, .
    const │ │ │ │ +001be9d0: 3c2f 7370 616e 3e20 3c73 7061 6e20 636c char *T │ │ │ │ +001bea00: 7970 6573 2c20 3c2f 6469 763e 0a3c 6469 ypes,
    .< │ │ │ │ +001bea20: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +001bea30: 6f72 6422 3e63 6f6e 7374 3c2f 7370 616e ord">const char │ │ │ │ +001bea60: 3c2f 7370 616e 3e20 2a53 636f 7065 732c *Scopes, │ │ │ │ +001bea70: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    │ │ │ │ +001beaa0: 636f 6e73 743c 2f73 7061 6e3e 203c 7370 const char *MatchBy, .
    stru │ │ │ │ +001beb10: 6374 3c2f 7370 616e 3e20 7773 6464 5f5f ct wsdd__ │ │ │ │ +001beb20: 5072 6f62 654d 6174 6368 6573 5479 7065 ProbeMatchesType │ │ │ │ +001beb30: 202a 5072 6f62 654d 6174 6368 6573 293c *ProbeMatches)< │ │ │ │ +001beb40: 2f64 6976 3e0a 3c2f 6469 763e 3c21 2d2d /div>.
    v │ │ │ │ +001beba0: 6f69 643c 2f73 7061 6e3e 2077 7364 645f oid wsdd_ │ │ │ │ +001bebb0: 6576 656e 745f 5072 6f62 654d 6174 6368 event_ProbeMatch │ │ │ │ +001bebc0: 6573 283c 7370 616e 2063 6c61 7373 3d22 es(struct< │ │ │ │ +001bebe0: 2f73 7061 6e3e 203c 6120 636c 6173 733d /span> so │ │ │ │ +001bec10: 6170 3c2f 613e 202a 3c61 2063 6c61 7373 ap *s │ │ │ │ +001bec40: 6f61 703c 2f61 3e2c 203c 2f64 6976 3e0a oap,
    . │ │ │ │ +001bec50: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    unsi │ │ │ │ +001bec80: 676e 6564 3c2f 7370 616e 3e20 3c73 7061 gned int │ │ │ │ +001becb0: 2049 6e73 7461 6e63 6549 642c 203c 2f64 InstanceId, .
    cons │ │ │ │ +001becf0: 743c 2f73 7061 6e3e 203c 7370 616e 2063 t char * │ │ │ │ +001bed20: 5365 7175 656e 6365 4964 2c20 3c2f 6469 SequenceId, .
    u │ │ │ │ +001bed60: 6e73 6967 6e65 643c 2f73 7061 6e3e 203c nsigned < │ │ │ │ +001bed70: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +001bed80: 6f72 6474 7970 6522 3e69 6e74 3c2f 7370 ordtype">int MessageNumbe │ │ │ │ +001beda0: 722c 203c 2f64 6976 3e0a 3c64 6976 2063 r,
    .
    const < │ │ │ │ +001bede0: 7370 616e 2063 6c61 7373 3d22 6b65 7977 span class="keyw │ │ │ │ +001bedf0: 6f72 6474 7970 6522 3e63 6861 723c 2f73 ordtype">char *MessageID, │ │ │ │ +001bee10: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    │ │ │ │ +001bee40: 636f 6e73 743c 2f73 7061 6e3e 203c 7370 const char *RelatesTo, < │ │ │ │ +001bee80: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    st │ │ │ │ +001beeb0: 7275 6374 3c2f 7370 616e 3e20 7773 6464 ruct wsdd │ │ │ │ +001beec0: 5f5f 5072 6f62 654d 6174 6368 6573 5479 __ProbeMatchesTy │ │ │ │ +001beed0: 7065 202a 5072 6f62 654d 6174 6368 6573 pe *ProbeMatches │ │ │ │ +001beee0: 293c 2f64 6976 3e0a 3c2f 6469 763e 3c21 )
    .
    < │ │ │ │ +001bef00: 6469 7620 636c 6173 733d 2266 7261 676d div class="fragm │ │ │ │ +001bef10: 656e 7422 3e3c 6469 7620 636c 6173 733d ent">
    soap_wsdd │ │ │ │ +001bef30: 5f6d 6f64 6520 7773 6464 5f65 7665 6e74 _mode wsdd_event │ │ │ │ +001bef40: 5f52 6573 6f6c 7665 283c 7370 616e 2063 _Resolve(s │ │ │ │ +001bef60: 7472 7563 743c 2f73 7061 6e3e 203c 6120 truct soap *soap, < │ │ │ │ +001befd0: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    co │ │ │ │ +001bf000: 6e73 743c 2f73 7061 6e3e 203c 7370 616e nst char │ │ │ │ +001bf030: 202a 4d65 7373 6167 6549 442c 203c 2f64 *MessageID, .
    cons │ │ │ │ +001bf070: 743c 2f73 7061 6e3e 203c 7370 616e 2063 t char * │ │ │ │ +001bf0a0: 5265 706c 7954 6f2c 203c 2f64 6976 3e0a ReplyTo,
    . │ │ │ │ +001bf0b0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    const c │ │ │ │ +001bf100: 6861 723c 2f73 7061 6e3e 202a 456e 6470 har *Endp │ │ │ │ +001bf110: 6f69 6e74 5265 6665 7265 6e63 652c 203c ointReference, < │ │ │ │ +001bf120: 2f64 6976 3e0a 3c64 6976 2063 6c61 7373 /div>.
    st │ │ │ │ +001bf150: 7275 6374 3c2f 7370 616e 3e20 7773 6464 ruct wsdd │ │ │ │ +001bf160: 5f5f 5265 736f 6c76 654d 6174 6368 6573 __ResolveMatches │ │ │ │ +001bf170: 5479 7065 202a 5265 736f 6c76 654d 6174 Type *ResolveMat │ │ │ │ +001bf180: 6368 6573 293c 2f64 6976 3e0a 3c2f 6469 ches)
    .
    void │ │ │ │ +001bf1f0: 2077 7364 645f 6576 656e 745f 5265 736f wsdd_event_Reso │ │ │ │ +001bf200: 6c76 654d 6174 6368 6573 283c 7370 616e lveMatches(struct < │ │ │ │ +001bf230: 6120 636c 6173 733d 2263 6f64 6522 2068 a class="code" h │ │ │ │ +001bf240: 7265 663d 2273 7472 7563 7473 6f61 702e ref="structsoap. │ │ │ │ +001bf250: 6874 6d6c 223e 736f 6170 3c2f 613e 202a html">soap * │ │ │ │ +001bf260: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap, │ │ │ │ +001bf290: 203c 2f64 6976 3e0a 3c64 6976 2063 6c61
    .
    unsigned in │ │ │ │ +001bf2f0: 743c 2f73 7061 6e3e 2049 6e73 7461 6e63 t Instanc │ │ │ │ +001bf300: 6549 642c 203c 2f64 6976 3e0a 3c64 6976 eId,
    .
    const │ │ │ │ +001bf340: 203c 7370 616e 2063 6c61 7373 3d22 6b65 char< │ │ │ │ +001bf360: 2f73 7061 6e3e 202a 5365 7175 656e 6365 /span> *Sequence │ │ │ │ +001bf370: 4964 2c20 3c2f 6469 763e 0a3c 6469 7620 Id,
    .
    unsigned< │ │ │ │ +001bf3b0: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> int Mess │ │ │ │ +001bf3e0: 6167 654e 756d 6265 722c 203c 2f64 6976 ageNumber,
    .
    const< │ │ │ │ +001bf420: 2f73 7061 6e3e 203c 7370 616e 2063 6c61 /span> char *Me │ │ │ │ +001bf450: 7373 6167 6549 442c 203c 2f64 6976 3e0a ssageID,
    . │ │ │ │ +001bf460: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    const c │ │ │ │ +001bf4b0: 6861 723c 2f73 7061 6e3e 202a 5265 6c61 har *Rela │ │ │ │ +001bf4c0: 7465 7354 6f2c 203c 2f64 6976 3e0a 3c64 tesTo,
    . │ │ │ │ +001bf4e0: 3c73 7061 6e20 636c 6173 733d 226b 6579 const cha │ │ │ │ +001bf520: 723c 2f73 7061 6e3e 202a 456e 6470 6f69 r *Endpoi │ │ │ │ +001bf530: 6e74 5265 6665 7265 6e63 652c 203c 2f64 ntReference, .
    cons │ │ │ │ +001bf570: 743c 2f73 7061 6e3e 203c 7370 616e 2063 t char * │ │ │ │ +001bf5a0: 5479 7065 732c 203c 2f64 6976 3e0a 3c64 Types,
    . │ │ │ │ +001bf5c0: 3c73 7061 6e20 636c 6173 733d 226b 6579 const cha │ │ │ │ +001bf600: 723c 2f73 7061 6e3e 202a 5363 6f70 6573 r *Scopes │ │ │ │ +001bf610: 2c20 3c2f 6469 763e 0a3c 6469 7620 636c ,
    .
    const char *MatchBy, .
    con │ │ │ │ +001bf6b0: 7374 3c2f 7370 616e 3e20 3c73 7061 6e20 st char │ │ │ │ +001bf6e0: 2a58 4164 6472 732c 203c 2f64 6976 3e0a *XAddrs,
    . │ │ │ │ +001bf6f0: 3c64 6976 2063 6c61 7373 3d22 6c69 6e65
    unsi │ │ │ │ +001bf720: 676e 6564 3c2f 7370 616e 3e20 3c73 7061 gned int │ │ │ │ +001bf750: 204d 6574 6164 6174 6156 6572 7369 6f6e MetadataVersion │ │ │ │ +001bf760: 293c 2f64 6976 3e0a 3c2f 6469 763e 3c21 )
    .
    < │ │ │ │ +001bf780: 703e 5468 6573 6520 6576 656e 7420 6861 p>These event ha │ │ │ │ +001bf790: 6e64 6c65 7273 2077 696c 6c20 6265 2069 ndlers will be i │ │ │ │ +001bf7a0: 6e76 6f6b 6564 2077 6865 6e20 696e 626f nvoked when inbo │ │ │ │ +001bf7b0: 756e 6420 5753 2d44 6973 636f 7665 7279 und WS-Discovery │ │ │ │ +001bf7c0: 206d 6573 7361 6765 7320 6172 7269 7665 messages arrive │ │ │ │ +001bf7d0: 2075 7369 6e67 3a3c 2f70 3e0a 3c64 6976 using:

    .
    if │ │ │ │ +001bf820: 3c2f 7370 616e 3e20 2821 3c61 2063 6c61 (!soap │ │ │ │ +001bf880: 5f76 616c 6964 5f73 6f63 6b65 743c 2f61 _valid_socket(soap_bind( │ │ │ │ +001bf8f0: 3c61 2063 6c61 7373 3d22 636f 6465 2220 soap, │ │ │ │ +001bf920: 204e 554c 4c2c 203c 6120 636c 6173 733d NULL, │ │ │ │ +001bf970: 706f 7274 3c2f 613e 2c20 4241 434b 4c4f port, BACKLO │ │ │ │ +001bf980: 4729 2929 203c 2f64 6976 3e0a 3c64 6976 G)))
    .
    │ │ │ │ +001bf9a0: 2e2e 2e20 3c73 7061 6e20 636c 6173 733d ... // err │ │ │ │ +001bf9c0: 6f72 203c 2f73 7061 6e3e 3c2f 6469 763e or
    │ │ │ │ +001bf9d0: 0a3c 6469 7620 636c 6173 733d 226c 696e .
    if< │ │ │ │ +001bfa00: 2f73 7061 6e3e 2028 736f 6170 5f77 7364 /span> (soap_wsd │ │ │ │ +001bfa10: 645f 6c69 7374 656e 283c 6120 636c 6173 d_listen( │ │ │ │ +001bfa40: 736f 6170 3c2f 613e 2c20 7469 6d65 6f75 soap, timeou │ │ │ │ +001bfa50: 7429 2920 3c2f 6469 763e 0a3c 6469 7620 t))
    .
    . │ │ │ │ +001bfa70: 2e2e 203c 7370 616e 2063 6c61 7373 3d22 .. // erro │ │ │ │ +001bfa90: 723c 2f73 7061 6e3e 3c2f 6469 763e 0a3c r
    .< │ │ │ │ +001bfaa0: 2f64 6976 3e3c 212d 2d20 6672 6167 6d65 /div>

    which w │ │ │ │ +001bfac0: 696c 6c20 6c69 7374 656e 2066 6f72 203c ill listen for < │ │ │ │ +001bfad0: 636f 6465 3e74 696d 656f 7574 3c2f 636f code>timeout seconds to i │ │ │ │ +001bfaf0: 6e62 6f75 6e64 2057 532d 4469 7363 6f76 nbound WS-Discov │ │ │ │ +001bfb00: 6572 7920 6d65 7373 6167 6573 206f 6e20 ery messages on │ │ │ │ +001bfb10: 6120 706f 7274 2061 6e64 2064 6973 7061 a port and dispa │ │ │ │ +001bfb20: 7463 6865 7320 7468 656d 2074 6f20 7468 tches them to th │ │ │ │ +001bfb30: 6520 6576 656e 7420 6861 6e64 6c65 7273 e event handlers │ │ │ │ +001bfb40: 2e20 4120 6e65 6761 7469 7665 203c 636f . A negative timeout value specifie │ │ │ │ +001bfb70: 7320 7468 6520 7469 6d65 6f75 7420 696e s the timeout in │ │ │ │ +001bfb80: 206d 6963 726f 7365 636f 6e64 732e 3c2f microseconds..

    For more d │ │ │ │ +001bfba0: 6574 6169 6c73 2c20 7365 6520 7468 6520 etails, see the │ │ │ │ +001bfbb0: 3c61 2068 7265 663d 222e 2e2f 2e2e 2f77 WS-Discove │ │ │ │ +001bfbe0: 7279 2070 6c75 6769 6e3c 2f61 3e20 646f ry plugin do │ │ │ │ +001bfbf0: 6375 6d65 6e74 6174 696f 6e2e 3c2f 703e cumentation.

    │ │ │ │ +001bfc00: 0a3c 6831 3e3c 6120 636c 6173 733d 2261 .

    .Copyr │ │ │ │ +001bfc30: 6967 6874 3c2f 6831 3e0a 3c70 3e3c 656d ight

    .

    Copyright (c) 2 │ │ │ │ +001bfc50: 3030 302d 3230 3230 2c20 526f 6265 7274 000-2020, Robert │ │ │ │ +001bfc60: 2041 2e20 7661 6e20 456e 6765 6c65 6e2c A. van Engelen, │ │ │ │ +001bfc70: 2047 656e 6976 6961 2049 6e63 2e3c 6272 Genivia Inc.
    .All rights │ │ │ │ +001bfc90: 7265 7365 7276 6564 2e3c 2f65 6d3e 203c reserved.
    < │ │ │ │ +001bfca0: 2f70 3e0a 3c2f 6469 763e 3c2f 6469 763e /p>.

    │ │ │ │ +001bfcb0: 3c21 2d2d 2050 6167 6544 6f63 202d 2d3e │ │ │ │ +001bfcc0: 0a3c 2f64 6976 3e3c 212d 2d20 636f 6e74 .
    .
    < │ │ │ │ +001bfce0: 212d 2d20 646f 632d 636f 6e74 656e 7420 !-- doc-content │ │ │ │ +001bfcf0: 2d2d 3e0a 3c68 7220 636c 6173 733d 2266 -->.
    .