├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── LICENSE ├── README.md ├── examples ├── hello_world │ ├── README.md │ ├── hello.wsdl │ ├── hello_request.xml │ ├── hello_response.xml │ ├── main.rs │ ├── parsers.rs │ └── types.rs ├── travel │ ├── Air.wsdl │ ├── Air.xsd │ ├── AirAbstract.wsdl │ ├── AirReqRsp.xsd │ └── Kestrel.xsd ├── travel_light │ ├── README.md │ ├── flight_response.xml │ ├── main.rs │ └── service.wsdl └── weather │ ├── etoimik.wsdl │ └── main.rs └── src ├── autogen ├── mod.rs ├── parser.rs └── types.rs ├── header.rs ├── lib.rs ├── request.rs └── wsdl ├── errors.rs ├── file.rs ├── http.rs ├── mod.rs └── schema.rs /.gitignore: -------------------------------------------------------------------------------- 1 | # Generated by Cargo 2 | # will have compiled files and executables 3 | /target/ 4 | 5 | # Ignore example output files in examples 6 | /examples/*.txt 7 | /examples/*/*.txt 8 | 9 | # Some general ignores 10 | .DS_Store -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | [[package]] 2 | name = "aho-corasick" 3 | version = "0.6.4" 4 | source = "registry+https://github.com/rust-lang/crates.io-index" 5 | dependencies = [ 6 | "memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", 7 | ] 8 | 9 | [[package]] 10 | name = "backtrace" 11 | version = "0.3.5" 12 | source = "registry+https://github.com/rust-lang/crates.io-index" 13 | dependencies = [ 14 | "backtrace-sys 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", 15 | "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", 16 | "libc 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)", 17 | "rustc-demangle 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", 18 | "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", 19 | ] 20 | 21 | [[package]] 22 | name = "backtrace-sys" 23 | version = "0.1.16" 24 | source = "registry+https://github.com/rust-lang/crates.io-index" 25 | dependencies = [ 26 | "cc 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", 27 | "libc 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)", 28 | ] 29 | 30 | [[package]] 31 | name = "base64" 32 | version = "0.6.0" 33 | source = "registry+https://github.com/rust-lang/crates.io-index" 34 | dependencies = [ 35 | "byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 36 | "safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 37 | ] 38 | 39 | [[package]] 40 | name = "bitflags" 41 | version = "0.7.0" 42 | source = "registry+https://github.com/rust-lang/crates.io-index" 43 | 44 | [[package]] 45 | name = "bitflags" 46 | version = "0.9.1" 47 | source = "registry+https://github.com/rust-lang/crates.io-index" 48 | 49 | [[package]] 50 | name = "byteorder" 51 | version = "1.2.1" 52 | source = "registry+https://github.com/rust-lang/crates.io-index" 53 | 54 | [[package]] 55 | name = "cargo_metadata" 56 | version = "0.2.3" 57 | source = "registry+https://github.com/rust-lang/crates.io-index" 58 | dependencies = [ 59 | "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", 60 | "serde_derive 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", 61 | "serde_json 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", 62 | ] 63 | 64 | [[package]] 65 | name = "cc" 66 | version = "1.0.5" 67 | source = "registry+https://github.com/rust-lang/crates.io-index" 68 | 69 | [[package]] 70 | name = "cfg-if" 71 | version = "0.1.2" 72 | source = "registry+https://github.com/rust-lang/crates.io-index" 73 | 74 | [[package]] 75 | name = "clippy" 76 | version = "0.0.187" 77 | source = "registry+https://github.com/rust-lang/crates.io-index" 78 | dependencies = [ 79 | "cargo_metadata 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", 80 | "clippy_lints 0.0.187 (registry+https://github.com/rust-lang/crates.io-index)", 81 | "regex 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", 82 | ] 83 | 84 | [[package]] 85 | name = "clippy_lints" 86 | version = "0.0.187" 87 | source = "registry+https://github.com/rust-lang/crates.io-index" 88 | dependencies = [ 89 | "if_chain 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", 90 | "itertools 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", 91 | "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", 92 | "matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", 93 | "pulldown-cmark 0.0.15 (registry+https://github.com/rust-lang/crates.io-index)", 94 | "quine-mc_cluskey 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", 95 | "regex-syntax 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", 96 | "semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", 97 | "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", 98 | "serde_derive 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", 99 | "toml 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", 100 | "unicode-normalization 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", 101 | "url 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", 102 | ] 103 | 104 | [[package]] 105 | name = "codegen" 106 | version = "0.1.0" 107 | source = "git+https://github.com/raventid/codegen.git#2d4dcc96f530ba163674d5efa985c3b133b3022e" 108 | dependencies = [ 109 | "indexmap 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", 110 | ] 111 | 112 | [[package]] 113 | name = "dtoa" 114 | version = "0.4.2" 115 | source = "registry+https://github.com/rust-lang/crates.io-index" 116 | 117 | [[package]] 118 | name = "either" 119 | version = "1.4.0" 120 | source = "registry+https://github.com/rust-lang/crates.io-index" 121 | 122 | [[package]] 123 | name = "encoding" 124 | version = "0.2.33" 125 | source = "registry+https://github.com/rust-lang/crates.io-index" 126 | dependencies = [ 127 | "encoding-index-japanese 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)", 128 | "encoding-index-korean 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)", 129 | "encoding-index-simpchinese 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)", 130 | "encoding-index-singlebyte 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)", 131 | "encoding-index-tradchinese 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)", 132 | ] 133 | 134 | [[package]] 135 | name = "encoding-index-japanese" 136 | version = "1.20141219.5" 137 | source = "registry+https://github.com/rust-lang/crates.io-index" 138 | dependencies = [ 139 | "encoding_index_tests 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", 140 | ] 141 | 142 | [[package]] 143 | name = "encoding-index-korean" 144 | version = "1.20141219.5" 145 | source = "registry+https://github.com/rust-lang/crates.io-index" 146 | dependencies = [ 147 | "encoding_index_tests 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", 148 | ] 149 | 150 | [[package]] 151 | name = "encoding-index-simpchinese" 152 | version = "1.20141219.5" 153 | source = "registry+https://github.com/rust-lang/crates.io-index" 154 | dependencies = [ 155 | "encoding_index_tests 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", 156 | ] 157 | 158 | [[package]] 159 | name = "encoding-index-singlebyte" 160 | version = "1.20141219.5" 161 | source = "registry+https://github.com/rust-lang/crates.io-index" 162 | dependencies = [ 163 | "encoding_index_tests 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", 164 | ] 165 | 166 | [[package]] 167 | name = "encoding-index-tradchinese" 168 | version = "1.20141219.5" 169 | source = "registry+https://github.com/rust-lang/crates.io-index" 170 | dependencies = [ 171 | "encoding_index_tests 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", 172 | ] 173 | 174 | [[package]] 175 | name = "encoding_index_tests" 176 | version = "0.1.4" 177 | source = "registry+https://github.com/rust-lang/crates.io-index" 178 | 179 | [[package]] 180 | name = "error-chain" 181 | version = "0.10.0" 182 | source = "registry+https://github.com/rust-lang/crates.io-index" 183 | dependencies = [ 184 | "backtrace 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", 185 | ] 186 | 187 | [[package]] 188 | name = "getopts" 189 | version = "0.2.17" 190 | source = "registry+https://github.com/rust-lang/crates.io-index" 191 | 192 | [[package]] 193 | name = "httparse" 194 | version = "1.2.4" 195 | source = "registry+https://github.com/rust-lang/crates.io-index" 196 | 197 | [[package]] 198 | name = "hyper" 199 | version = "0.10.13" 200 | source = "registry+https://github.com/rust-lang/crates.io-index" 201 | dependencies = [ 202 | "base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", 203 | "httparse 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)", 204 | "language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", 205 | "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", 206 | "mime 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", 207 | "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", 208 | "time 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", 209 | "traitobject 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 210 | "typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", 211 | "unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", 212 | "url 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", 213 | ] 214 | 215 | [[package]] 216 | name = "idna" 217 | version = "0.1.4" 218 | source = "registry+https://github.com/rust-lang/crates.io-index" 219 | dependencies = [ 220 | "matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", 221 | "unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", 222 | "unicode-normalization 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", 223 | ] 224 | 225 | [[package]] 226 | name = "if_chain" 227 | version = "0.1.2" 228 | source = "registry+https://github.com/rust-lang/crates.io-index" 229 | 230 | [[package]] 231 | name = "indexmap" 232 | version = "1.0.2" 233 | source = "registry+https://github.com/rust-lang/crates.io-index" 234 | 235 | [[package]] 236 | name = "itertools" 237 | version = "0.6.5" 238 | source = "registry+https://github.com/rust-lang/crates.io-index" 239 | dependencies = [ 240 | "either 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 241 | ] 242 | 243 | [[package]] 244 | name = "itoa" 245 | version = "0.3.4" 246 | source = "registry+https://github.com/rust-lang/crates.io-index" 247 | 248 | [[package]] 249 | name = "language-tags" 250 | version = "0.2.2" 251 | source = "registry+https://github.com/rust-lang/crates.io-index" 252 | 253 | [[package]] 254 | name = "lazy_static" 255 | version = "1.0.0" 256 | source = "registry+https://github.com/rust-lang/crates.io-index" 257 | 258 | [[package]] 259 | name = "libc" 260 | version = "0.2.37" 261 | source = "registry+https://github.com/rust-lang/crates.io-index" 262 | 263 | [[package]] 264 | name = "log" 265 | version = "0.3.9" 266 | source = "registry+https://github.com/rust-lang/crates.io-index" 267 | dependencies = [ 268 | "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", 269 | ] 270 | 271 | [[package]] 272 | name = "log" 273 | version = "0.4.1" 274 | source = "registry+https://github.com/rust-lang/crates.io-index" 275 | dependencies = [ 276 | "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", 277 | ] 278 | 279 | [[package]] 280 | name = "matches" 281 | version = "0.1.6" 282 | source = "registry+https://github.com/rust-lang/crates.io-index" 283 | 284 | [[package]] 285 | name = "memchr" 286 | version = "2.0.1" 287 | source = "registry+https://github.com/rust-lang/crates.io-index" 288 | dependencies = [ 289 | "libc 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)", 290 | ] 291 | 292 | [[package]] 293 | name = "mime" 294 | version = "0.2.6" 295 | source = "registry+https://github.com/rust-lang/crates.io-index" 296 | dependencies = [ 297 | "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", 298 | ] 299 | 300 | [[package]] 301 | name = "num-traits" 302 | version = "0.2.1" 303 | source = "registry+https://github.com/rust-lang/crates.io-index" 304 | 305 | [[package]] 306 | name = "num_cpus" 307 | version = "1.8.0" 308 | source = "registry+https://github.com/rust-lang/crates.io-index" 309 | dependencies = [ 310 | "libc 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)", 311 | ] 312 | 313 | [[package]] 314 | name = "percent-encoding" 315 | version = "1.0.1" 316 | source = "registry+https://github.com/rust-lang/crates.io-index" 317 | 318 | [[package]] 319 | name = "pulldown-cmark" 320 | version = "0.0.15" 321 | source = "registry+https://github.com/rust-lang/crates.io-index" 322 | dependencies = [ 323 | "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", 324 | "getopts 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", 325 | ] 326 | 327 | [[package]] 328 | name = "quine-mc_cluskey" 329 | version = "0.2.4" 330 | source = "registry+https://github.com/rust-lang/crates.io-index" 331 | 332 | [[package]] 333 | name = "quote" 334 | version = "0.3.15" 335 | source = "registry+https://github.com/rust-lang/crates.io-index" 336 | 337 | [[package]] 338 | name = "redox_syscall" 339 | version = "0.1.37" 340 | source = "registry+https://github.com/rust-lang/crates.io-index" 341 | 342 | [[package]] 343 | name = "regex" 344 | version = "0.2.6" 345 | source = "registry+https://github.com/rust-lang/crates.io-index" 346 | dependencies = [ 347 | "aho-corasick 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", 348 | "memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", 349 | "regex-syntax 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", 350 | "thread_local 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", 351 | "utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", 352 | ] 353 | 354 | [[package]] 355 | name = "regex-syntax" 356 | version = "0.4.2" 357 | source = "registry+https://github.com/rust-lang/crates.io-index" 358 | 359 | [[package]] 360 | name = "roxmltree" 361 | version = "0.3.0" 362 | source = "registry+https://github.com/rust-lang/crates.io-index" 363 | dependencies = [ 364 | "xmlparser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", 365 | ] 366 | 367 | [[package]] 368 | name = "rustc-demangle" 369 | version = "0.1.7" 370 | source = "registry+https://github.com/rust-lang/crates.io-index" 371 | 372 | [[package]] 373 | name = "safemem" 374 | version = "0.2.0" 375 | source = "registry+https://github.com/rust-lang/crates.io-index" 376 | 377 | [[package]] 378 | name = "semver" 379 | version = "0.6.0" 380 | source = "registry+https://github.com/rust-lang/crates.io-index" 381 | dependencies = [ 382 | "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", 383 | ] 384 | 385 | [[package]] 386 | name = "semver-parser" 387 | version = "0.7.0" 388 | source = "registry+https://github.com/rust-lang/crates.io-index" 389 | 390 | [[package]] 391 | name = "serde" 392 | version = "1.0.27" 393 | source = "registry+https://github.com/rust-lang/crates.io-index" 394 | 395 | [[package]] 396 | name = "serde_derive" 397 | version = "1.0.27" 398 | source = "registry+https://github.com/rust-lang/crates.io-index" 399 | dependencies = [ 400 | "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", 401 | "serde_derive_internals 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)", 402 | "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", 403 | ] 404 | 405 | [[package]] 406 | name = "serde_derive_internals" 407 | version = "0.19.0" 408 | source = "registry+https://github.com/rust-lang/crates.io-index" 409 | dependencies = [ 410 | "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", 411 | "synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", 412 | ] 413 | 414 | [[package]] 415 | name = "serde_json" 416 | version = "1.0.10" 417 | source = "registry+https://github.com/rust-lang/crates.io-index" 418 | dependencies = [ 419 | "dtoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", 420 | "itoa 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", 421 | "num-traits 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 422 | "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", 423 | ] 424 | 425 | [[package]] 426 | name = "soap" 427 | version = "0.0.1" 428 | dependencies = [ 429 | "clippy 0.0.187 (registry+https://github.com/rust-lang/crates.io-index)", 430 | "codegen 0.1.0 (git+https://github.com/raventid/codegen.git)", 431 | "encoding 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", 432 | "error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", 433 | "hyper 0.10.13 (registry+https://github.com/rust-lang/crates.io-index)", 434 | "roxmltree 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", 435 | "xml-rs 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", 436 | ] 437 | 438 | [[package]] 439 | name = "syn" 440 | version = "0.11.11" 441 | source = "registry+https://github.com/rust-lang/crates.io-index" 442 | dependencies = [ 443 | "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", 444 | "synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", 445 | "unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", 446 | ] 447 | 448 | [[package]] 449 | name = "synom" 450 | version = "0.11.3" 451 | source = "registry+https://github.com/rust-lang/crates.io-index" 452 | dependencies = [ 453 | "unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", 454 | ] 455 | 456 | [[package]] 457 | name = "thread_local" 458 | version = "0.3.5" 459 | source = "registry+https://github.com/rust-lang/crates.io-index" 460 | dependencies = [ 461 | "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", 462 | "unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", 463 | ] 464 | 465 | [[package]] 466 | name = "time" 467 | version = "0.1.39" 468 | source = "registry+https://github.com/rust-lang/crates.io-index" 469 | dependencies = [ 470 | "libc 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)", 471 | "redox_syscall 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", 472 | "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", 473 | ] 474 | 475 | [[package]] 476 | name = "toml" 477 | version = "0.4.5" 478 | source = "registry+https://github.com/rust-lang/crates.io-index" 479 | dependencies = [ 480 | "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", 481 | ] 482 | 483 | [[package]] 484 | name = "traitobject" 485 | version = "0.1.0" 486 | source = "registry+https://github.com/rust-lang/crates.io-index" 487 | 488 | [[package]] 489 | name = "typeable" 490 | version = "0.1.2" 491 | source = "registry+https://github.com/rust-lang/crates.io-index" 492 | 493 | [[package]] 494 | name = "unicase" 495 | version = "1.4.2" 496 | source = "registry+https://github.com/rust-lang/crates.io-index" 497 | dependencies = [ 498 | "version_check 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", 499 | ] 500 | 501 | [[package]] 502 | name = "unicode-bidi" 503 | version = "0.3.4" 504 | source = "registry+https://github.com/rust-lang/crates.io-index" 505 | dependencies = [ 506 | "matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", 507 | ] 508 | 509 | [[package]] 510 | name = "unicode-normalization" 511 | version = "0.1.5" 512 | source = "registry+https://github.com/rust-lang/crates.io-index" 513 | 514 | [[package]] 515 | name = "unicode-xid" 516 | version = "0.0.4" 517 | source = "registry+https://github.com/rust-lang/crates.io-index" 518 | 519 | [[package]] 520 | name = "unreachable" 521 | version = "1.0.0" 522 | source = "registry+https://github.com/rust-lang/crates.io-index" 523 | dependencies = [ 524 | "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", 525 | ] 526 | 527 | [[package]] 528 | name = "url" 529 | version = "1.7.0" 530 | source = "registry+https://github.com/rust-lang/crates.io-index" 531 | dependencies = [ 532 | "idna 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", 533 | "matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", 534 | "percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", 535 | ] 536 | 537 | [[package]] 538 | name = "utf8-ranges" 539 | version = "1.0.0" 540 | source = "registry+https://github.com/rust-lang/crates.io-index" 541 | 542 | [[package]] 543 | name = "version_check" 544 | version = "0.1.3" 545 | source = "registry+https://github.com/rust-lang/crates.io-index" 546 | 547 | [[package]] 548 | name = "void" 549 | version = "1.0.2" 550 | source = "registry+https://github.com/rust-lang/crates.io-index" 551 | 552 | [[package]] 553 | name = "winapi" 554 | version = "0.3.4" 555 | source = "registry+https://github.com/rust-lang/crates.io-index" 556 | dependencies = [ 557 | "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 558 | "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 559 | ] 560 | 561 | [[package]] 562 | name = "winapi-i686-pc-windows-gnu" 563 | version = "0.4.0" 564 | source = "registry+https://github.com/rust-lang/crates.io-index" 565 | 566 | [[package]] 567 | name = "winapi-x86_64-pc-windows-gnu" 568 | version = "0.4.0" 569 | source = "registry+https://github.com/rust-lang/crates.io-index" 570 | 571 | [[package]] 572 | name = "xml-rs" 573 | version = "0.4.1" 574 | source = "registry+https://github.com/rust-lang/crates.io-index" 575 | dependencies = [ 576 | "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", 577 | ] 578 | 579 | [[package]] 580 | name = "xmlparser" 581 | version = "0.7.0" 582 | source = "registry+https://github.com/rust-lang/crates.io-index" 583 | 584 | [metadata] 585 | "checksum aho-corasick 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "d6531d44de723825aa81398a6415283229725a00fa30713812ab9323faa82fc4" 586 | "checksum backtrace 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ebbbf59b1c43eefa8c3ede390fcc36820b4999f7914104015be25025e0d62af2" 587 | "checksum backtrace-sys 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "44585761d6161b0f57afc49482ab6bd067e4edef48c12a152c237eb0203f7661" 588 | "checksum base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "96434f987501f0ed4eb336a411e0631ecd1afa11574fe148587adc4ff96143c9" 589 | "checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d" 590 | "checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5" 591 | "checksum byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "652805b7e73fada9d85e9a6682a4abd490cb52d96aeecc12e33a0de34dfd0d23" 592 | "checksum cargo_metadata 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "be1057b8462184f634c3a208ee35b0f935cfd94b694b26deadccd98732088d7b" 593 | "checksum cc 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "9be26b24e988625409b19736d130f0c7d224f01d06454b5f81d8d23d6c1a618f" 594 | "checksum cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d4c819a1287eb618df47cc647173c5c4c66ba19d888a6e50d605672aed3140de" 595 | "checksum clippy 0.0.187 (registry+https://github.com/rust-lang/crates.io-index)" = "17b10f6efdd5b8399ce0643fe8b4fc81d260a7a0c0a266e7c81b8b0949e077eb" 596 | "checksum clippy_lints 0.0.187 (registry+https://github.com/rust-lang/crates.io-index)" = "f2227eeb80d00b3e6f67d27953224b2087a65e40597e3253b2a25493aac63859" 597 | "checksum codegen 0.1.0 (git+https://github.com/raventid/codegen.git)" = "" 598 | "checksum dtoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "09c3753c3db574d215cba4ea76018483895d7bff25a31b49ba45db21c48e50ab" 599 | "checksum either 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "740178ddf48b1a9e878e6d6509a1442a2d42fd2928aae8e7a6f8a36fb01981b3" 600 | "checksum encoding 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "6b0d943856b990d12d3b55b359144ff341533e516d94098b1d3fc1ac666d36ec" 601 | "checksum encoding-index-japanese 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)" = "04e8b2ff42e9a05335dbf8b5c6f7567e5591d0d916ccef4e0b1710d32a0d0c91" 602 | "checksum encoding-index-korean 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)" = "4dc33fb8e6bcba213fe2f14275f0963fd16f0a02c878e3095ecfdf5bee529d81" 603 | "checksum encoding-index-simpchinese 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d87a7194909b9118fc707194baa434a4e3b0fb6a5a757c73c3adb07aa25031f7" 604 | "checksum encoding-index-singlebyte 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3351d5acffb224af9ca265f435b859c7c01537c0849754d3db3fdf2bfe2ae84a" 605 | "checksum encoding-index-tradchinese 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fd0e20d5688ce3cab59eb3ef3a2083a5c77bf496cb798dc6fcdb75f323890c18" 606 | "checksum encoding_index_tests 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a246d82be1c9d791c5dfde9a2bd045fc3cbba3fa2b11ad558f27d01712f00569" 607 | "checksum error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d9435d864e017c3c6afeac1654189b06cdb491cf2ff73dbf0d73b0f292f42ff8" 608 | "checksum getopts 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)" = "b900c08c1939860ce8b54dc6a89e26e00c04c380fd0e09796799bd7f12861e05" 609 | "checksum httparse 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "c2f407128745b78abc95c0ffbe4e5d37427fdc0d45470710cfef8c44522a2e37" 610 | "checksum hyper 0.10.13 (registry+https://github.com/rust-lang/crates.io-index)" = "368cb56b2740ebf4230520e2b90ebb0461e69034d85d1945febd9b3971426db2" 611 | "checksum idna 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "014b298351066f1512874135335d62a789ffe78a9974f94b43ed5621951eaf7d" 612 | "checksum if_chain 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "61bb90bdd39e3af69b0172dfc6130f6cd6332bf040fbb9bdd4401d37adbd48b8" 613 | "checksum indexmap 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7e81a7c05f79578dbc15793d8b619db9ba32b4577003ef3af1a91c416798c58d" 614 | "checksum itertools 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d3f2be4da1690a039e9ae5fd575f706a63ad5a2120f161b1d653c9da3930dd21" 615 | "checksum itoa 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8324a32baf01e2ae060e9de58ed0bc2320c9a2833491ee36cd3b4c414de4db8c" 616 | "checksum language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a" 617 | "checksum lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c8f31047daa365f19be14b47c29df4f7c3b581832407daabe6ae77397619237d" 618 | "checksum libc 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)" = "56aebce561378d99a0bb578f8cb15b6114d2a1814a6c7949bbe646d968bb4fa9" 619 | "checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" 620 | "checksum log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "89f010e843f2b1a31dbd316b3b8d443758bc634bed37aabade59c686d644e0a2" 621 | "checksum matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "100aabe6b8ff4e4a7e32c1c13523379802df0772b82466207ac25b013f193376" 622 | "checksum memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "796fba70e76612589ed2ce7f45282f5af869e0fdd7cc6199fa1aa1f1d591ba9d" 623 | "checksum mime 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ba626b8a6de5da682e1caa06bdb42a335aee5a84db8e5046a3e8ab17ba0a3ae0" 624 | "checksum num-traits 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0b3c2bd9b9d21e48e956b763c9f37134dc62d9e95da6edb3f672cacb6caf3cd3" 625 | "checksum num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c51a3322e4bca9d212ad9a158a02abc6934d005490c054a2778df73a70aa0a30" 626 | "checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" 627 | "checksum pulldown-cmark 0.0.15 (registry+https://github.com/rust-lang/crates.io-index)" = "378e941dbd392c101f2cb88097fa4d7167bc421d4b88de3ff7dbee503bc3233b" 628 | "checksum quine-mc_cluskey 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "07589615d719a60c8dd8a4622e7946465dfef20d1a428f969e3443e7386d5f45" 629 | "checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" 630 | "checksum redox_syscall 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "0d92eecebad22b767915e4d529f89f28ee96dbbf5a4810d2b844373f136417fd" 631 | "checksum regex 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "5be5347bde0c48cfd8c3fdc0766cdfe9d8a755ef84d620d6794c778c91de8b2b" 632 | "checksum regex-syntax 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "8e931c58b93d86f080c734bfd2bce7dd0079ae2331235818133c8be7f422e20e" 633 | "checksum roxmltree 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ad070c83663f89f74524e296935fc4b2479a111c0ac57098effcba59c6a76b69" 634 | "checksum rustc-demangle 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "11fb43a206a04116ffd7cfcf9bcb941f8eb6cc7ff667272246b0a1c74259a3cb" 635 | "checksum safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e27a8b19b835f7aea908818e871f5cc3a5a186550c30773be987e155e8163d8f" 636 | "checksum semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a3186ec9e65071a2095434b1f5bb24838d4e8e130f584c790f6033c79943537" 637 | "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" 638 | "checksum serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)" = "db99f3919e20faa51bb2996057f5031d8685019b5a06139b1ce761da671b8526" 639 | "checksum serde_derive 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)" = "f4ba7591cfe93755e89eeecdbcc668885624829b020050e6aec99c2a03bd3fd0" 640 | "checksum serde_derive_internals 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6e03f1c9530c3fb0a0a5c9b826bdd9246a5921ae995d75f512ac917fc4dd55b5" 641 | "checksum serde_json 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)" = "57781ed845b8e742fc2bf306aba8e3b408fe8c366b900e3769fbc39f49eb8b39" 642 | "checksum syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad" 643 | "checksum synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6" 644 | "checksum thread_local 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "279ef31c19ededf577bfd12dfae728040a21f635b06a24cd670ff510edd38963" 645 | "checksum time 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "a15375f1df02096fb3317256ce2cee6a1f42fc84ea5ad5fc8c421cfe40c73098" 646 | "checksum toml 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "a7540f4ffc193e0d3c94121edb19b055670d369f77d5804db11ae053a45b6e7e" 647 | "checksum traitobject 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079" 648 | "checksum typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1410f6f91f21d1612654e7cc69193b0334f909dcf2c790c4826254fbb86f8887" 649 | "checksum unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33" 650 | "checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" 651 | "checksum unicode-normalization 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "51ccda9ef9efa3f7ef5d91e8f9b83bbe6955f9bf86aec89d5cce2c874625920f" 652 | "checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc" 653 | "checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" 654 | "checksum url 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f808aadd8cfec6ef90e4a14eb46f24511824d1ac596b9682703c87056c8678b7" 655 | "checksum utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "662fab6525a98beff2921d7f61a39e7d59e0b425ebc7d0d9e66d316e55124122" 656 | "checksum version_check 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6b772017e347561807c1aa192438c5fd74242a670a6cffacc40f2defd1dc069d" 657 | "checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" 658 | "checksum winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "04e3bd221fcbe8a271359c04f21a76db7d0c6028862d1bb5512d85e1e2eb5bb3" 659 | "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 660 | "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 661 | "checksum xml-rs 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b46ee689ba7a669c08a1170c2348d2516c62dc461135c9e86b2f1f476e07be4a" 662 | "checksum xmlparser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "41e9a53f10a83f2d007556b671737aee4d4820d64f3f1b98e1ca27f31a81ddb4" 663 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "soap" 3 | version = "0.0.1" 4 | authors = ["Julian Pokrovsky "] 5 | description = "SOAP client for Rust programming language" 6 | license = "MIT" 7 | 8 | [dependencies] 9 | hyper = "0.10.10" 10 | xml-rs = "0.4.1" 11 | encoding = "0.2.33" 12 | error-chain = "0.10.0" 13 | clippy = {version = "*", optional = true} 14 | roxmltree = "0.3.0" 15 | codegen = { git = "https://github.com/raventid/codegen.git" } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Julian Pokrovsky 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # soap-rs 2 | 3 | STATUS: WORK IN PROGRESS. 4 | 5 | Rust 2018 edition and shiny async/await inside. 6 | 7 | SOAP client for Rust programming language. 8 | 9 | LICENSE NOTE: Current WSDL implementation is slightly modified version of https://github.com/jaxx/wsdl-rs. WSDL parser will be changed, but it's not a high priority now. 10 | 11 | This project is not intended to be used in production. It is more for a learning purpose, personally to me it is both Rust and SOAP, what I'm going to explore. 12 | 13 | Client is planned to support SOAP 1.2 and SOAP 1.1. Right now I think it would be nice to just have 1.1 and 1.2 adapters for generic codebase. 14 | 15 | For teting purposes I use some services from list here. 16 | http://stackoverflow.com/questions/311654/public-free-web-services-for-testing-soap-client 17 | 18 | To provide a better user experience we are looking at nice and functional SOAP libraries on other platforms: 19 | - http://php.net/manual/en/soapclient.soapclient.php 20 | - http://savonrb.com/version3/ 21 | - https://github.com/priore/SOAPEngine 22 | - http://www.cs.fsu.edu/~engelen/soap.html 23 | - http://axis.apache.org/axis/ 24 | 25 | ## FAQ 26 | #### Q: I see a SOAP client, but how to build a server? 27 | A: Soap-rs is SOAP client library, we understand the need for SOAP client in modern world, but if you are building a Rust service (and you are) don't use SOAP for your partners. Even if they're C# folks. Your new partner might use Ruby, think about them. (Protip: use JSON). 28 | #### Q: My partner send me some XSD files, but there's no WSDL, can I use this library? 29 | A: Short: XSD is not a standard way to describe SOAP service. In practice though it happens sometimes. We'll try to support XSD base client in future, but expect this to be harder for you (you might have to write glue code). 30 | #### Q: Well, I actually have to send just one request to my partner and I have XML example, can I generate structs just for this request? 31 | A: Again, it's not a valid case for SOAP library, but yep, it will be possible with same limitation as XSD generation. 32 | #### Q: I've used SOAP libraries for Perl, Ruby and I've used IBM Web Services Invocation Framework. They all generate 33 | #### code on the fly by WSDL. Why do you ask me to generate code by hand with CLI tool and store in my project?! 34 | #### It's ugly, takes space on my disk, and it's unreadable! 35 | A: First of all, we'll do our best to generate human readable code. Sometimes WSDL services are described badly, so service generated by WSDL is totally broken. But it might be just slightly broken! 36 | By generating SOAP mechanical code in a separate step we give you a freedom to fix generated code by changing signature, type, 37 | data, namespace or something else, without digging into complicated macro, which generate the code on the fly. So we do it for you! 38 | #### Q: Hm, sounds reasonable. But I still wanna do dynamic generation with WSDL url! 39 | A: Well... It might be done in the future. 40 | 41 | ## Features 42 | - [ ] Support both 2001 (v1.1) and 2003 (v1.2) XML schema. 43 | - [ ] Support array, array of structs, dictionary and sets. 44 | - [ ] Support for user-defined object with serialization of complex data types and array of complex data types, even embedded multilevel structures. 45 | - [ ] Supports ASMX Services, WCF Services (SVC) and the WSDL definitions. 46 | - [ ] Supports Basic, Digest and NTLM Authentication, WS-Security, Client side Certificate and custom security header. 47 | - [ ] AES256 or 3DES Encrypt/Decrypt data without SSL security. 48 | - [ ] An example of service and how to use it is included in source code. 49 | - [ ] Different WSDL caching mods. 50 | - [ ] Custom request headers. 51 | - [ ] Request compression with gzip or other provider. 52 | - [ ] Detailed documentation which covers every component. 53 | - [ ] This is a Rust library, so it should be fast, like really fast. 54 | -------------------------------------------------------------------------------- /examples/hello_world/README.md: -------------------------------------------------------------------------------- 1 | # Simple hello_world WSDL based service generation 2 | -------------------------------------------------------------------------------- /examples/hello_world/hello.wsdl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | WSDL File for HelloService 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /examples/hello_world/hello_request.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | World 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /examples/hello_world/hello_response.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Hello, World! 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /examples/hello_world/main.rs: -------------------------------------------------------------------------------- 1 | extern crate soap; 2 | extern crate roxmltree; 3 | extern crate codegen; 4 | 5 | use std::fs::File; 6 | use std::io::Write; 7 | use std::path::PathBuf; 8 | use std::env; 9 | use codegen::Scope; 10 | 11 | use soap::autogen; 12 | use soap::Wsdl; 13 | 14 | fn main() { 15 | // Parse WSDL from file 16 | let wsdl = match Wsdl::load_from_file("examples/hello_world/hello.wsdl") { 17 | Ok(v) => v, 18 | Err(e) => panic!("Error: {}", e), 19 | }; 20 | 21 | // Extract XSD messages information 22 | let messages_source_code = autogen::types::generate_messages(&wsdl.messages); 23 | 24 | let messages = wsdl.messages; 25 | 26 | // Code generation for parsers 27 | let mut parsers_scope = Scope::new(); 28 | 29 | // Include xmltree and types 30 | parsers_scope.import("types", "*"); 31 | 32 | parsers_scope.raw(r#" 33 | let response = match roxmltree::Document::parse(&content) { 34 | Ok(v) => v, 35 | Err(e) => { 36 | println!("Error: {}.", e); 37 | process::exit(1); 38 | } 39 | }; 40 | "#); 41 | 42 | messages.iter().for_each(|message| { 43 | message.parts.iter().for_each(|part| { 44 | parsers_scope.raw(&format!(r#" 45 | let {field} = response.get({field}); 46 | "#, 47 | field=part.name)); 48 | }); 49 | }); 50 | 51 | let types_file = env::current_dir().unwrap().join("examples/hello_world/").join("types.rs"); 52 | print_str(&messages_source_code, Some(types_file)).expect("Error while printing types"); 53 | 54 | let parsers_file = env::current_dir().unwrap().join("examples/hello_world/").join("parsers.rs"); 55 | print_codegen(&parsers_scope, Some(parsers_file)).expect("Error while printing parsers"); 56 | } 57 | 58 | 59 | fn print_str(types_scope: &str, file: Option) -> Result<(), std::io::Error> { 60 | match file { 61 | None => println!("Scope: {:#?}", types_scope), 62 | Some(f) => { 63 | File::create(f)?.write(types_scope.to_string().as_bytes())?; 64 | } 65 | } 66 | 67 | Ok(()) 68 | } 69 | 70 | fn print_codegen(types_scope: &Scope, file: Option) -> Result<(), std::io::Error> { 71 | match file { 72 | None => println!("Scope: {:#?}", types_scope), 73 | Some(f) => { 74 | File::create(f)?.write(types_scope.to_string().as_bytes())?; 75 | } 76 | } 77 | 78 | Ok(()) 79 | } 80 | -------------------------------------------------------------------------------- /examples/hello_world/parsers.rs: -------------------------------------------------------------------------------- 1 | use types::*; 2 | 3 | 4 | let response = match roxmltree::Document::parse(&content) { 5 | Ok(v) => v, 6 | Err(e) => { 7 | println!("Error: {}.", e); 8 | process::exit(1); 9 | } 10 | }; 11 | 12 | 13 | 14 | let firstName = response.get(firstName); 15 | 16 | 17 | 18 | let greeting = response.get(greeting); 19 | -------------------------------------------------------------------------------- /examples/hello_world/types.rs: -------------------------------------------------------------------------------- 1 | struct SayHelloRequest { 2 | firstName: String, 3 | } 4 | 5 | struct SayHelloResponse { 6 | greeting: String, 7 | } -------------------------------------------------------------------------------- /examples/travel/Air.wsdl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 13 | 14 | 16 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 35 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 53 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 72 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 91 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 110 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 129 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 149 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 168 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 188 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 207 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 226 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 245 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 265 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 284 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 303 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 322 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 341 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 360 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 498 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 520 | 522 | 523 | 524 | 526 | 528 | 529 | 530 | 532 | 534 | 535 | 536 | 538 | 540 | 541 | 542 | 544 | 546 | 547 | 548 | 550 | 552 | 553 | 554 | 556 | 558 | 559 | 560 | 562 | 564 | 565 | 566 | 568 | 570 | 571 | 572 | 574 | 576 | 577 | 578 | 580 | 582 | 583 | 584 | 586 | 588 | 589 | 590 | 592 | 594 | 595 | 596 | 598 | 600 | 601 | 602 | 604 | 606 | 607 | 608 | 610 | 612 | 613 | 614 | 616 | 618 | 619 | 620 | 622 | 624 | 625 | 626 | 628 | 630 | 631 | 632 | 634 | 636 | 637 | 638 | 640 | 642 | 643 | 644 | 646 | 648 | 649 | 650 | 652 | 654 | 655 | 656 | 658 | 660 | 661 | 662 | 664 | 666 | 667 | 668 | 670 | 672 | 673 | 674 | 676 | 678 | 679 | 680 | 681 | 683 | 685 | 686 | 687 | 688 | 689 | 690 | 691 | 692 | 693 | 694 | 695 | 696 | 697 | 698 | 699 | 700 | 702 | 704 | 705 | 706 | 708 | 710 | 711 | 712 | 713 | 715 | 717 | 718 | 719 | 720 | 721 | 722 | 723 | 724 | 725 | 726 | 727 | 728 | 729 | 730 | 731 | 732 | -------------------------------------------------------------------------------- /examples/travel/AirAbstract.wsdl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 12 | 13 | 14 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | -------------------------------------------------------------------------------- /examples/travel/AirReqRsp.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | (c) Travelport GDS 2008 All rights reserved. Proprietary Information of Travelport GDS. 5 | 6 | 7 | 8 | 9 | 10 | 11 | Context for Requests and Responses 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | Provider: 1G,1V,1P,1J,ACH. 24 | 25 | 26 | 27 | 28 | Provider: 1G,1V,1P,1J,ACH. 29 | 30 | 31 | 32 | 33 | Provider: 1G,1V,1P,1J,ACH-Maxinumber of passenger increased in to 18 to support 9 INF passenger along with 9 ADT,CHD,INS passenger 34 | 35 | 36 | 37 | 38 | Provider: 1G,1V,1P,1J,ACH. 39 | 40 | 41 | 42 | 43 | Provider: ACH,1P,1J 44 | 45 | 46 | 47 | 48 | Provider: ACH. 49 | 50 | 51 | 52 | 53 | Provider: 1G,1V,1P,1J,ACH. 54 | 55 | 56 | 57 | 58 | 59 | Special Service Request for GST tax details. Provider: ACH 60 | 61 | 62 | 63 | 64 | 65 | A flag to return fees for ticketing and for various forms of payment. The default is “TicketingOnly” and will return only ticketing fees. The value “All” will return ticketing fees and the applicable form of payment fees for the form of payment information specified in the request. “FOPOnly” will return the applicable form of payment fees for the form of payment information specified in the request. Form of payment fees are never included in the total unless specific card details are in the request.Provider notes:ACH - CheckOBFees is valid only for LowFareSearch. The valid values are “All”, “TicketingOnly” and “None” and the default value is “None”. 1P/1J -The valid values are “All”, “None” and “TicketingOnly”.1G – All four values are supported.1V/RCH – CheckOBFees are not supported.” 66 | 67 | 68 | 69 | 70 | Provider: 1G,1V,1P,1J,ACH. 71 | 72 | 73 | 74 | 75 | Specifies the supplier/ vendor for vendor specific price requests 76 | 77 | 78 | 79 | 80 | YYYY-MM-DD Using a date in the past is a request for an historical fare 81 | 82 | 83 | 84 | 85 | To Include FlightDetails in Response set to “true” the Default value is “false”. 86 | 87 | 88 | 89 | 90 | If this attribute is set to “true”, Fare Control Manager processing will be invoked. 91 | 92 | 93 | 94 | 95 | 1 to 3 numeric that defines a Search Control Console filter.This attribute is used to override that filter. 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | Indicates whether the AirSegments should be priced together or separately. Set ‘true’ for split pricing. Set ‘false’ for pricing together.SplitPricing is not supported with post book re-pricing. 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | Request to price an itinerary in one to many ways. Pricing commands can be specified globally, or specifically per command. 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | Provider: 1G,1V,1P,1J,ACH. 129 | 130 | 131 | 132 | 133 | Provider: 1G,1V,1P,1J,ACH. 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | Request to reprice a solution. 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | Request to ticket a previously stored reservation. 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | Provider: 1G,1V,1P,1J. 187 | 188 | 189 | 190 | 191 | Provider: 1G,1V,1P,1J-Indicates air pricing infos to be ticketed. 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | Provider: 1P,1J-Reference to a shared list of Ticketing Modifiers. This is supported for Worldspan and JAL providers only. When AirPricingInfoRef is used along with TicketingModifiersRef means that particular TicketingModifiers will to be applied while ticketing the Stored fare corresponding to the AirPricingInfo. Absence of AirPricingInfoRef means that particular TicketingModifiers will be applied to all Stored fares which are requested to be ticketed. 203 | 204 | 205 | 206 | 207 | 208 | 209 | Provider: 1G,1V. 210 | 211 | 212 | 213 | 214 | Provider: 1V. 215 | 216 | 217 | 218 | 219 | Provider: 1G,1V,1P,1J. 220 | 221 | 222 | 223 | 224 | Provider: 1P,1J. 225 | 226 | 227 | 228 | 229 | 230 | 231 | Provider: 1G,1V,1P,1J. 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | Response to ticket a previously stored reservation. 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | Provider: 1G,1V,1P,1J. 251 | 252 | 253 | 254 | 255 | Provider: 1G,1V,1P,1J. 256 | 257 | 258 | 259 | 260 | Provider: 1G,1V,1P,1J. 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | Provider: 1G/1V/1P/ACH - Represents a valid Provider Reservation/PNR whose itinerary is to be exchanged 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | Provider: ACH. 286 | 287 | 288 | 289 | 290 | Provider: ACH. 291 | 292 | 293 | 294 | 295 | Provider: ACH. 296 | 297 | 298 | 299 | 300 | Provider: ACH-This would allow a user to see the fees if they are changing from one Form Of Payment to other . 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | Provider: ACH. 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | Request to quote the exchange of an itinerary 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | Provider: 1G/1V/1P/1S/1A. 334 | 335 | 336 | 337 | 338 | 339 | Bundle exchange, pricing, and penalty information. Providers ACH/1G/1V/1P 340 | 341 | 342 | 343 | 344 | Encrypted data from the host. Required to send the HostToken from the AirExchangeQuoteRsp in the AirExchangeReq. Providers ACH/1G/1V/1P. 345 | 346 | 347 | 348 | 349 | Provider: ACH. 350 | 351 | 352 | 353 | 354 | Provider: ACH. 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | Request to exchange an itinerary 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | Identifies the PNR locator code. Providers ACH/1G/1V/1P 373 | 374 | 375 | 376 | 377 | 378 | Identifies the standard seat. Providers ACH/1G/1V/1P 379 | 380 | 381 | 382 | 383 | Providers ACH/1G/1V/1P. 384 | 385 | 386 | 387 | 388 | Provider: ACH. 389 | 390 | 391 | 392 | 393 | Provider: 1G/1V/1P/1S/1A. 394 | 395 | 396 | 397 | 398 | Bundle exchange, pricing, and penalty information. Providers ACH/1G/1V/1P. 399 | 400 | 401 | 402 | 403 | Encrypted data from the host. Required to send the HostToken from the AirExchangeQuoteRsp in the AirExchangeReq. Providers ACH/1G/1V/1P 404 | 405 | 406 | 407 | 408 | Provider: ACH. 409 | 410 | 411 | 412 | 413 | Form of Payment for any additional collection charges for the Exchange. For ACH, most carriers will only allow refund amounts to the original form of payment. Providers ACH/1G/1V/1P 414 | 415 | 416 | 417 | 418 | Provider: ACH-Universal Record reference to Form of Payment for any Additional Collection charges or Refund due for the itinerary exchange 419 | 420 | 421 | 422 | 423 | Providers ACH, 1G, 1V, 1P. 424 | 425 | 426 | 427 | 428 | 1P - Add SVC segments to collect additional fee 429 | 430 | 431 | 432 | 433 | 434 | Provider: ACH. 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | Provider: ACH. 450 | 451 | 452 | 453 | 454 | Provider: ACH. 455 | 456 | 457 | 458 | 459 | Provider: ACH. 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | Request to ticket an exchanged itinerary. Providers 1G, 1V, 1P. 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | Identifies the PNR to ticket. Providers 1G, 1V, 1P. 478 | 479 | 480 | 481 | 482 | Ticket number to reissue. Providers 1G, 1V, 1P. 483 | 484 | 485 | 486 | 487 | Provider: 1P-Reference to a shared list of Ticketing Modifiers. This is supported for Worldspan provider only. When AirPricingInfoRef is used along with TicketingModifiersRef means that particular TicketingModifiers will to be applied while ticketing the Stored fare corresponding to the AirPricingInfo. Absence of AirPricingInfoRef means that particular TicketingModifiers will be applied to all Stored fares which are requested to be ticketed. 488 | 489 | 490 | 491 | 492 | 493 | Providers 1G, 1V, 1P. 494 | 495 | 496 | 497 | 498 | Provider: 1G,1V,1P. 499 | 500 | 501 | 502 | 503 | 504 | Providers 1G, 1V, 1P. 505 | 506 | 507 | 508 | 509 | Applies the change fee/penalty to the original form of payment. Providers: 1V 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | Response to reissue a ticket. 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | Provider 1G, 1V, 1P. 529 | 530 | 531 | 532 | 533 | Provider 1G, 1V, 1P. 534 | 535 | 536 | 537 | 538 | Providers 1G, 1V, 1P. 539 | 540 | 541 | 542 | 543 | 544 | 545 | 546 | 547 | 548 | 549 | Request to quote a refund for an itinerary 550 | 551 | 552 | 553 | 554 | 555 | 556 | 557 | Provider: ACH. 558 | 559 | 560 | 561 | 562 | Provider: ACH-The identifying number for a Ticketless Air Reservation 563 | 564 | 565 | 566 | 567 | Provider: ACH. 568 | 569 | 570 | 571 | 572 | Provider: ACH. 573 | 574 | 575 | 576 | 577 | Provider: 1P - Represents a valid Provider Reservation/PNR whose itinerary is to be requested 578 | 579 | 580 | 581 | 582 | 583 | 584 | 585 | 586 | Provider: ACH. 587 | 588 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | Provider: ACH. 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | Request to refund an itinerary for the amount previously quoted 612 | 613 | 614 | 615 | 616 | 617 | 618 | 619 | Provider: ACH. 620 | 621 | 622 | 623 | 624 | Provider: ACH. 625 | 626 | 627 | 628 | 629 | 630 | Provider: ACH. 631 | 632 | 633 | 634 | 635 | Provider: ACH-Form of Payment for any Additional Collection charges for the Refund. 636 | 637 | 638 | 639 | 640 | 641 | 642 | 643 | 644 | 645 | 646 | 647 | 648 | 649 | 650 | Provider: ACH. 651 | 652 | 653 | 654 | 655 | Provider: ACH. 656 | 657 | 658 | 659 | 660 | Provider: ACH. 661 | 662 | 663 | 664 | 665 | 666 | 667 | 668 | 669 | 670 | Request to display a tariff for based on origin, destination, and other options 671 | 672 | 673 | 674 | 675 | 676 | 677 | 678 | Provider: 1G,1V,1P,1J. 679 | 680 | 681 | 682 | 683 | 684 | Provider: 1G,1V,1P,1J. 685 | 686 | 687 | 688 | 689 | Provider: 1G,1V,1P,1J. 690 | 691 | 692 | 693 | 694 | Provider: 1G,1V,1P,1J. 695 | 696 | 697 | 698 | 699 | Provider: 1G,1V,1P,1J. 700 | 701 | 702 | 703 | 704 | Provider: 1G,1V,1P,1J. 705 | 706 | 707 | 708 | 709 | Provider: 1G,1V,1P,1J. 710 | 711 | 712 | 713 | 714 | Provider: 1G,1V. 715 | 716 | 717 | 718 | 719 | Provider: 1G,1V,1P,1J. 720 | 721 | 722 | 723 | 724 | Provider: 1G,1V. 725 | 726 | 727 | 728 | 729 | Provider: 1G,1V,1P,1J. 730 | 731 | 732 | 733 | 734 | 735 | Provider: 1G,1V,1P,1J. 736 | 737 | 738 | 739 | 740 | Provider: 1G,1V,1P,1J. 741 | 742 | 743 | 744 | 745 | Provider: 1G,1V,1P,1J. 746 | 747 | 748 | 749 | 750 | Provider: 1G,1V,1P,1J-Used to request Mile/Route Information in follow on (Mile, Route, Both) 751 | 752 | 753 | 754 | 755 | Provider: 1G,1V,1P,1J-Used to request unsaleable fares only also known as place of sale fares. 756 | 757 | 758 | 759 | 760 | A Channel ID is 4 alpha-numeric characters used to activate the Search Control Console filter for a specific group of travelers being served by the agency credential. 761 | 762 | 763 | 764 | 765 | 766 | 767 | 768 | 769 | 770 | 771 | 1 to 3 numeric that define a Search Control Console filter.This attribute is used to override that filter. 772 | 773 | 774 | 775 | 776 | 777 | 778 | 779 | 780 | 781 | 782 | If this attribute is set to true, Fare Control Manager processing will be invoked. 783 | 784 | 785 | 786 | 787 | 788 | 789 | 790 | 791 | Response to an AirFareDisplayReq 792 | 793 | 794 | 795 | 796 | 797 | 798 | 799 | Provider: 1G,1V,1P,1J. 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | Request to display the full text fare rules. 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | Provider: 1G,1V,1P,1J,ACH-Parameters to use for a fare rule lookup associated with an Air Reservation Locator Code 819 | 820 | 821 | 822 | 823 | 824 | 825 | 826 | The Air Reservation locator code which is an unique identifier for the reservation 827 | 828 | 829 | 830 | 831 | 832 | 833 | Used to look up fare rules based on the origin, destination, and carrier of the air segment, the fare basis code and the provider code. Providers: 1P, 1J. 834 | 835 | 836 | 837 | 838 | Used to look up fare rules based on a fare rule key. Providers: 1G, 1V, 1P, 1J, ACH. 839 | 840 | 841 | 842 | 843 | Provider: 1G,1V,1P,1J. 844 | 845 | 846 | 847 | 848 | 849 | Provider: 1G,1V. 850 | 851 | 852 | 853 | 854 | 855 | Provider: 1G,1V,1P,1J,ACH. 856 | 857 | 858 | 859 | 860 | 861 | 862 | 863 | 864 | Response to an AirFareRuleReq. 865 | 866 | 867 | 868 | 869 | 870 | 871 | 872 | Provider: 1G,1V,1P,1J,ACH. 873 | 874 | 875 | 876 | 877 | 878 | 879 | 880 | 881 | 882 | Request for the Flight Details of segments. 883 | 884 | 885 | 886 | 887 | 888 | 889 | 890 | 891 | Provider: 1G,1V,1P,1J. 892 | 893 | 894 | 895 | 896 | 897 | 898 | 899 | 900 | 901 | 902 | 903 | 904 | 905 | 906 | Provider: 1G,1V,1P,1J. 907 | 908 | 909 | 910 | 911 | 912 | 913 | 914 | 915 | 916 | 917 | Request a seat map for the give flight information 918 | 919 | 920 | 921 | 922 | 923 | 924 | 925 | 926 | Provider: ACH-Required if the user requesting the seat map is not the same agent authenticated in the request. 927 | 928 | 929 | 930 | 931 | 932 | Provider: 1G,1V,1P,1J,ACH,MCH. 933 | 934 | 935 | 936 | 937 | Provider: ACH-Required if the carrier has multiple adapters. 938 | 939 | 940 | 941 | 942 | Provider: 1G,1V,ACH,MCH. 943 | 944 | 945 | 946 | 947 | Provider: ACH,MCH-Required when seat price is requested. 948 | 949 | 950 | 951 | 952 | Used to provide additional pricing options. Provider:ACH. 953 | 954 | 955 | 956 | 957 | 958 | Provider: 1G,1V,1P,1J,ACH-When set to true the price of the seat will be returned if it exists. 959 | 960 | 961 | 962 | 963 | A value of true will return the BrandingInfo block in the response if applicable. A value of false will not return the BrandingInfo block in the response. Providers: 1G, 1V, 1P, 1J, ACH 964 | 965 | 966 | 967 | 968 | 969 | 970 | 971 | 972 | 973 | 974 | 975 | 976 | 977 | 978 | Provider: ACH,MCH. 979 | 980 | 981 | 982 | 983 | Provider: 1G,1V,1P,1J,ACH,MCH. 984 | 985 | 986 | 987 | 988 | Provider: ACH,MCH. 989 | 990 | 991 | 992 | 993 | Provider: ACH,MCH. 994 | 995 | 996 | 997 | 998 | A wrapper for all the information regarding each of the Optional Services. 999 | Provider: 1G,1V,1P,1J,ACH. 1000 | 1001 | 1002 | 1003 | 1004 | Provider: 1G,1V,1P,1J,ACH,MCH. 1005 | 1006 | 1007 | 1008 | 1009 | 1010 | Provider: MCH-Information regarding valid payment types, if restrictions apply(supplier specific) 1011 | 1012 | 1013 | 1014 | 1015 | 1016 | Copyright text applicable for some seat content. Providers: 1G, 1V, 1P, 1J,ACH 1017 | 1018 | 1019 | 1020 | 1021 | 1022 | Provider: 1G,1V-Seat price for the all passengers traveling together only when supplier provides group flat fee. 1023 | 1024 | 1025 | 1026 | 1027 | 1028 | 1029 | 1030 | 1031 | 1032 | Base Request for Air Search 1033 | 1034 | 1035 | 1036 | 1037 | 1038 | 1039 | 1040 | 1041 | 1042 | 1043 | 1044 | 1045 | 1046 | 1047 | 1048 | 1049 | 1050 | 1051 | 1052 | The date and time at which this entity departs. 1053 | This does not include time zone information since it can be derived 1054 | from the origin location. 1055 | 1056 | 1057 | 1058 | 1059 | 1060 | The carrier that is marketing this segment 1061 | 1062 | 1063 | 1064 | 1065 | 1066 | The flight number under which the marketing 1067 | carrier is marketing this flight 1068 | 1069 | 1070 | 1071 | 1072 | The IATA location code for this origination of 1073 | this entity. 1074 | 1075 | 1076 | 1077 | 1078 | The IATA location code for this destination of 1079 | this entity. 1080 | 1081 | 1082 | 1083 | 1084 | The sequential AirSegment number that this segment 1085 | connected to. 1086 | 1087 | 1088 | 1089 | 1090 | 1091 | 1092 | Base Request for Low fare air Search 1093 | 1094 | 1095 | 1096 | 1097 | 1098 | 1099 | 1100 | 1101 | 1102 | 1103 | 1104 | 1105 | 1106 | 1107 | 1108 | 1109 | 1110 | 1111 | Base Low Fare Search Request 1112 | 1113 | 1114 | 1115 | 1116 | 1117 | 1118 | 1119 | Provider: 1G,1V,1P,1J,ACH-Maxinumber of passenger increased in to 18 to support 9 INF passenger along with 9 ADT,CHD,INS passenger 1120 | 1121 | 1122 | 1123 | 1124 | Provider: 1G,1V,1P,1J,ACH. 1125 | 1126 | 1127 | 1128 | 1129 | Provider: 1G,1V,1P,1J,ACH. 1130 | 1131 | 1132 | 1133 | 1134 | Provider: ACH. 1135 | 1136 | 1137 | 1138 | 1139 | This is the container for a set of modifiers which allow the user to perform a special kind of low fare search, depicted as flex explore, based on different parameters like Area, Zone, Country, State, Specific locations, Distance around the actual destination of the itinerary. Applicable for providers 1G,1V,1P. 1140 | 1141 | 1142 | 1143 | 1144 | 1145 | 1146 | Provider: 1P,1J 1147 | 1148 | 1149 | 1150 | 1151 | 1152 | Provider: 1G,1V,1P,1J,ACH-Indicates that low cost providers should be queried for top connection options and the results returned with the search. 1153 | 1154 | 1155 | 1156 | 1157 | Provider: 1G,1V,1P,1J,ACH-Indicates that suggestions for alternate connection cities for low cost providers should be returned with the search. 1158 | 1159 | 1160 | 1161 | 1162 | Provider: 1G,1V,1P,1J,ACH-Indicates the Maximum Number of Expert Solutions to be returned from the Knowledge Base for the provided search criteria 1163 | 1164 | 1165 | 1166 | 1167 | Provider: 1G,1V,1P,1J,ACH-Indicates whether the response will contain Solution result (AirPricingSolution) or Non Solution Result (AirPricingPoints). The default value is false. This attribute cannot be combined with EnablePointToPointSearch, EnablePointToPointAlternates and MaxNumberOfExpertSolutions. 1168 | 1169 | 1170 | 1171 | 1172 | Provider: ACH-This attribute is only supported for ACH .It works in conjunction with the @SolutionResult flag 1173 | 1174 | 1175 | 1176 | 1177 | Invoke Meta Search. Valid values are 00 to 99, or D for the default meta search configuration. When Meta Search not requested, normal LowFareSearch applies. Supported Providers; 1g/1v/1p/1j 1178 | 1179 | 1180 | 1181 | 1182 | 1183 | 1184 | 1185 | 1186 | 1187 | 1188 | When set to “true”, Upsell information will be returned in the shop response. Provider supported : 1G, 1V, 1P, 1J 1189 | 1190 | 1191 | 1192 | 1193 | Set to True to return FareInfoMessageList. Providers supported: 1G/1V/1P/1J 1194 | 1195 | 1196 | 1197 | 1198 | When ReturnBrandedFares is set to “false”, Rich Content and Branding will not be returned in the shop response. When ReturnBrandedFares it is set to “true” or is not sent, Rich Content and Branding will be returned in the shop response. Provider: 1P/1J/ACH. 1199 | 1200 | 1201 | 1202 | 1203 | A "true" value indicates MultiGDSSearch. Specific provisioning is required. 1204 | 1205 | 1206 | 1207 | 1208 | If this attribute is set to “true”, Fare Control Manager processing will be invoked. 1209 | 1210 | 1211 | 1212 | 1213 | A flag to return fees for ticketing and for various forms of payment. The default is “TicketingOnly” and will return only ticketing fees. The value “All” will return ticketing fees and the applicable form of payment fees for the form of payment information specified in the request. “FOPOnly” will return the applicable form of payment fees for the form of payment information specified in the request. Form of payment fees are never included in the total unless specific card details are in the request.Provider notes:ACH - CheckOBFees is valid only for LowFareSearch. The valid values are “All”, “TicketingOnly” and “None” and the default value is “None”. 1P/1J -The valid values are “All”, “None” and “TicketingOnly”.1G – All four values are supported.1V/RCH – CheckOBFees are not supported.” 1214 | 1215 | 1216 | 1217 | 1218 | 1 to 3 numeric that defines a Search Control Console filter.This attribute is used to override that filter. 1219 | 1220 | 1221 | 1222 | 1223 | 1224 | 1225 | 1226 | 1227 | 1228 | 1229 | Returns ChangePenalty and CancelPenalty values at the FareInfo level. If FareRulesFilterCategory is sent FareRulesFilter will be returned at FareInfo level. Provider: 1G/1V. 1230 | 1231 | 1232 | 1233 | 1234 | 1235 | 1236 | 1237 | Base Response for Air Search 1238 | 1239 | 1240 | 1241 | 1242 | 1243 | 1244 | 1245 | 1246 | 1247 | 1248 | 1249 | 1250 | 1251 | 1252 | 1253 | 1254 | 1255 | 1256 | 1257 | 1258 | 1259 | 1260 | 1261 | 1262 | 1263 | 1264 | 1265 | Schedule Search request 1266 | 1267 | 1268 | 1269 | 1270 | 1271 | 1272 | 1273 | 1274 | 1275 | Schedule Search response 1276 | 1277 | 1278 | 1279 | 1280 | 1281 | 1282 | 1283 | 1284 | 1285 | Availability Search request. 1286 | 1287 | 1288 | 1289 | 1290 | 1291 | 1292 | 1293 | Provider: 1G,1V,1P,1J,ACH-Maxinumber of passenger increased in to 18 to support 9 INF passenger along with 9 ADT,CHD,INS passenger 1294 | 1295 | 1296 | 1297 | 1298 | Provider: ACH. 1299 | 1300 | 1301 | 1302 | 1303 | 1304 | When set to “true”, the Brand Indicator can be returned in the availability search response. Provider: 1G, 1V, 1P, 1J, ACH 1305 | 1306 | 1307 | 1308 | 1309 | A Channel ID is 4 alpha-numeric characters used to activate the Search Control Console filter for a specific group of travelers being served by the agency credential. 1310 | 1311 | 1312 | 1313 | 1314 | 1315 | 1316 | 1317 | 1318 | 1319 | 1320 | Allows the agency to bypass/override the Search Control Console rule. 1321 | 1322 | 1323 | 1324 | 1325 | 1326 | 1327 | 1328 | 1329 | 1330 | 1331 | 1332 | 1333 | 1334 | 1335 | 1336 | 1337 | 1338 | Provider: 1G,1V,1P,1J,ACH. 1339 | 1340 | 1341 | 1342 | 1343 | 1344 | 1345 | 1346 | Availability Search response 1347 | 1348 | 1349 | 1350 | 1351 | 1352 | 1353 | 1354 | 1355 | 1356 | 1357 | 1358 | 1359 | 1360 | 1361 | 1362 | 1363 | 1364 | 1365 | Retrieve low fare search responses that were initiated by an asynchronous request. 1366 | 1367 | 1368 | 1369 | 1370 | 1371 | 1372 | Provider: 1G,1V,1P,1J,ACH-SearchID to be used for Asynchronous LowFareSearch Request 1373 | 1374 | 1375 | 1376 | 1377 | Provider: 1G,1V,1P,1J,ACH-Provider code of a specific host 1378 | 1379 | 1380 | 1381 | 1382 | 1383 | 1384 | 1385 | 1386 | Low Fare Search Asynchronous Result response. 1387 | 1388 | 1389 | 1390 | 1391 | 1392 | 1393 | 1394 | Provider: 1G,1V,1P,1J,ACH-Identifies pending responses from a specific provider using MoreResults attribute 1395 | 1396 | 1397 | 1398 | 1399 | 1400 | 1401 | Provider: 1G,1V,1P,1J,ACH. 1402 | 1403 | 1404 | 1405 | 1406 | 1407 | 1408 | 1409 | 1410 | 1411 | Low Fare Search request. 1412 | 1413 | 1414 | 1415 | 1416 | 1417 | 1418 | Provider: 1G,1V,1P,1J,ACH. 1419 | 1420 | 1421 | 1422 | This attribute will be used to pass in a value on the request which would be used to link to a ‘Policy Group’ in a policy engine external to UAPI. 1423 | 1424 | 1425 | 1426 | 1427 | 1428 | 1429 | 1430 | 1431 | 1432 | Low Fare Search Response 1433 | 1434 | 1435 | 1436 | 1437 | 1438 | 1439 | 1440 | 1441 | 1442 | 1443 | Provider: 1G,1V,1P,1J,ACH. 1444 | 1445 | 1446 | 1447 | 1448 | 1449 | 1450 | 1451 | 1452 | 1453 | Asynchronous Low Fare Search request. 1454 | 1455 | 1456 | 1457 | 1458 | 1459 | 1460 | 1461 | 1462 | Provider: 1G,1V,1P,1J,ACH. 1463 | 1464 | 1465 | 1466 | 1467 | 1468 | 1469 | 1470 | 1471 | 1472 | 1473 | Asynchronous Low Fare Search Response contains only the 1st Provider response unless time out occurs. 1474 | 1475 | 1476 | 1477 | 1478 | 1479 | 1480 | 1481 | 1482 | Provider: 1G,1V,1P,1J,ACH-Identifies pending responses from a specific provider using MoreResults attribute 1483 | 1484 | 1485 | 1486 | 1487 | 1488 | 1489 | Provider: 1G,1V,1P,1J,ACH-Indicates the Search Id of the LFS search 1490 | 1491 | 1492 | 1493 | 1494 | Provider: 1G,1V,1P,1J,ACH-Specifies the default Currency Type in the response. 1495 | 1496 | 1497 | 1498 | 1499 | 1500 | 1501 | 1502 | 1503 | Request to void all previously issued tickets for the PNR. 1504 | 1505 | 1506 | 1507 | 1508 | 1509 | 1510 | 1511 | Provider: 1G,1V. 1512 | 1513 | 1514 | 1515 | 1516 | Provider: 1G,1V-All tickets that belong to this PNR must be enumerated here. Voiding only some tickets of a multi-ticket PNR not currently supported. 1517 | 1518 | 1519 | 1520 | 1521 | 1522 | Provider: 1G,1V-If set as true, response will display the detailed ETR for successfully voided E-Tickets. 1523 | 1524 | 1525 | 1526 | 1527 | Provider: 1G,1V-Provider code of a specific host. 1528 | 1529 | 1530 | 1531 | 1532 | Provider: 1G,1V-Contains the locator of the host reservation. 1533 | 1534 | 1535 | 1536 | 1537 | 1538 | 1539 | 1540 | 1541 | Result of void ticket request. Includes ticket number of voided tickets and air segments with updated status. 1542 | 1543 | 1544 | 1545 | 1546 | 1547 | 1548 | 1549 | Provider: 1G,1V. 1550 | 1551 | 1552 | 1553 | 1554 | Provider: 1G,1V. 1555 | 1556 | 1557 | 1558 | 1559 | 1560 | 1561 | 1562 | 1563 | 1564 | Retrieve the post booking information for a PNR. ETRs will be returned for standard carriers. TCRs will be returned for Ticketless carriers. If the locator is send on a standard carrier, all ETRs will be retrieved. 1565 | 1566 | 1567 | 1568 | 1569 | 1570 | 1571 | 1572 | Provider: 1G,1V,1P,1J. 1573 | 1574 | 1575 | 1576 | 1577 | Provider: 1G,1V,1P,1J. 1578 | 1579 | 1580 | 1581 | 1582 | Provider: 1G,1V,1P,1J-The identifying number for a Ticketless Air Reservation. 1583 | 1584 | 1585 | 1586 | 1587 | 1588 | Will return a response which includes a set of restrictions associated with the document. 1589 | 1590 | 1591 | 1592 | 1593 | Provider: 1G,1V,1P,1J-Will return a response which includes the pricing associated with the ETR. 1594 | 1595 | 1596 | 1597 | 1598 | When true, returns MCO Information. The default value is false. 1599 | 1600 | 1601 | 1602 | 1603 | Provider: 1G,1V,1P,1J. 1604 | 1605 | 1606 | 1607 | 1608 | 1609 | 1610 | 1611 | 1612 | 1613 | 1614 | 1615 | 1616 | 1617 | Provider: 1G,1V,1P,1J. 1618 | 1619 | 1620 | 1621 | 1622 | Provider: 1G,1V,1P,1J. 1623 | 1624 | 1625 | 1626 | 1627 | Provider: 1G,1V,1P,1J. 1628 | 1629 | 1630 | 1631 | 1632 | Provider: 1G,1V,1P,1J-Will be optionally returned if there are duplicate ticket numbers. 1633 | 1634 | 1635 | 1636 | 1637 | Provider: 1G,1V 1638 | 1639 | 1640 | 1641 | 1642 | 1643 | 1644 | Provider: 1G,1V,1P,1J-Represents a valid Universal Record locator code. 1645 | 1646 | 1647 | 1648 | 1649 | 1650 | 1651 | 1652 | 1653 | 1654 | 1655 | Check with the supplier whether or not the reservation or air solution supports any merchandising offerings. 1656 | 1657 | 1658 | 1659 | 1660 | 1661 | 1662 | 1663 | Provider: 1G,1V,1P,1J,ACH. 1664 | 1665 | 1666 | 1667 | 1668 | Provider: 1G,1V,1P,1J,ACH. 1669 | 1670 | 1671 | 1672 | 1673 | Provider: 1G,1V,1P,1J,ACH. 1674 | 1675 | 1676 | 1677 | 1678 | Provider: 1G,1V,1P,1J,ACH. 1679 | 1680 | 1681 | 1682 | 1683 | Used to provide additional pricing modifiers. Provider:ACH. 1684 | 1685 | 1686 | 1687 | 1688 | 1689 | 1690 | 1691 | 1692 | 1693 | Contains the merchandising offerings for the given passenger and itinerary. 1694 | 1695 | 1696 | 1697 | 1698 | 1699 | 1700 | 1701 | Provider: 1G,1V,1P,1J,ACH. 1702 | 1703 | 1704 | 1705 | 1706 | Provider: 1G,1V,1P,1J,ACH. 1707 | 1708 | 1709 | 1710 | 1711 | 1712 | 1713 | 1714 | 1715 | 1716 | 1717 | 1718 | 1719 | 1720 | Request to search for Upsell Offers based on the 1721 | Itinerary. 1722 | 1723 | 1724 | 1725 | 1726 | 1727 | 1728 | 1729 | 1730 | 1731 | Provider: 1G,1V,1P,1J,ACH-AirItinerary of the pricing request. 1732 | 1733 | 1734 | 1735 | 1736 | 1737 | 1738 | Provider: 1G,1V,1P,1J,ACH-Result of AirPrice request. Upsell uses this to search for new offer. 1739 | 1740 | 1741 | 1742 | 1743 | 1744 | 1745 | 1746 | 1747 | 1748 | 1749 | 1750 | Response of Upsell Offers search for the given 1751 | Itinerary. 1752 | 1753 | 1754 | 1755 | 1756 | 1757 | 1758 | 1759 | 1760 | 1761 | 1762 | 1763 | Request for the Flight Info of segments. 1764 | 1765 | 1766 | 1767 | 1768 | 1769 | 1770 | 1771 | 1772 | Provider: 1G,1V. 1773 | 1774 | 1775 | 1776 | 1777 | 1778 | 1779 | 1780 | 1781 | 1782 | 1783 | 1784 | 1785 | 1786 | 1787 | Provider: 1G,1V. 1788 | 1789 | 1790 | 1791 | 1792 | 1793 | 1794 | 1795 | 1796 | 1797 | Request for Flight Time Table. 1798 | 1799 | 1800 | 1801 | 1802 | 1803 | 1804 | 1805 | Provider: 1G,1V. 1806 | 1807 | 1808 | 1809 | 1810 | 1811 | 1812 | 1813 | 1814 | 1815 | Response for Flight Time Table. 1816 | 1817 | 1818 | 1819 | 1820 | 1821 | 1822 | 1823 | Provider: 1G,1V. 1824 | 1825 | 1826 | 1827 | 1828 | 1829 | 1830 | 1831 | 1832 | 1833 | 1834 | 1835 | 1836 | 1837 | 1838 | Flight Pass Request. 1839 | 1840 | 1841 | 1842 | 1843 | 1844 | 1845 | 1846 | Provider: ACH. 1847 | 1848 | 1849 | 1850 | 1851 | 1852 | Customer name detail for searching flight pass content. 1853 | 1854 | 1855 | 1856 | 1857 | Customer loyalty card for searching flight pass content. 1858 | 1859 | 1860 | 1861 | 1862 | 1863 | Start index of the section of flight pass numbers that is being requested. 1864 | 1865 | 1866 | 1867 | 1868 | Max Number of Flight Passes being requested for. 1869 | 1870 | 1871 | 1872 | 1873 | 1874 | 1875 | Provider: ACH. 1876 | 1877 | 1878 | 1879 | 1880 | Pre pay id to retrieved,example flight pass number 1881 | 1882 | 1883 | 1884 | 1885 | Pre pay id type,example 'FlightPass' 1886 | 1887 | 1888 | 1889 | 1890 | 1891 | 1892 | 1893 | 1894 | 1895 | 1896 | 1897 | Flight Pass Response. 1898 | 1899 | 1900 | 1901 | 1902 | 1903 | 1904 | 1905 | Provider: ACH. 1906 | 1907 | 1908 | 1909 | 1910 | 1911 | Provider: ACH-Max Number of Flight Passes being returned. 1912 | 1913 | 1914 | 1915 | 1916 | Provider: ACH-Indicates if there are more flight passes to be offered 1917 | 1918 | 1919 | 1920 | 1921 | Provider: ACH-Indicates start index of the next flight Passes 1922 | 1923 | 1924 | 1925 | 1926 | 1927 | 1928 | 1929 | 1930 | Electronic Miscellaneous Document retrieve request.Supported providers are 1G/1V/1P/1J 1931 | 1932 | 1933 | 1934 | 1935 | 1936 | 1937 | 1938 | Provider: 1G/1V/1P/1J-Information required for retrieval of list of EMDs 1939 | 1940 | 1941 | 1942 | 1943 | 1944 | Provider reservation details to be provided to fetch list of EMDs associated with it. 1945 | 1946 | 1947 | 1948 | 1949 | 1950 | 1951 | 1952 | Provider: 1G/1V/1P/1J-Information required for a detailed EMD retrieve 1953 | 1954 | 1955 | 1956 | 1957 | 1958 | Provider reservation locator to be specified for display operation, if mentioned along woth the EMD number then synchronization of that EMD is performed considering the same to be associated with the mentioned PNR. 1959 | 1960 | 1961 | 1962 | 1963 | EMD number to be specified for display operation. If mentioned along with provider reservation detail then synchronization of that EMD is performed considering the same to be associated with the mentioned PNR. 1964 | 1965 | 1966 | 1967 | 1968 | 1969 | 1970 | 1971 | 1972 | 1973 | 1974 | 1975 | 1976 | Electronic Miscellaneous Document list and detail retrieve response.Supported providers are 1G/1V/1P/1J 1977 | 1978 | 1979 | 1980 | 1981 | 1982 | 1983 | 1984 | Provider: 1G/1V/1P/1J. 1985 | 1986 | 1987 | 1988 | 1989 | Provider: 1G/1V/1P/1J. 1990 | 1991 | 1992 | 1993 | 1994 | 1995 | 1996 | 1997 | 1998 | 1999 | Electronic Miscellaneous Document issuance request.Supported providers are 1V/1G/1P/1J 2000 | 2001 | 2002 | 2003 | 2004 | 2005 | 2006 | 2007 | PNR information for which EMD is going to be issued. 2008 | 2009 | 2010 | 2011 | 2012 | Ticket number for which EMD is going to be issued.Required for EMD-A issuance. 2013 | 2014 | 2015 | 2016 | 2017 | General modifiers related to EMD issuance. 2018 | 2019 | 2020 | 2021 | 2022 | Modifiers related to selection of services during EMD issuance. 2023 | 2024 | 2025 | 2026 | 2027 | 2028 | Represents a valid Universal Record locator code. 2029 | 2030 | 2031 | 2032 | 2033 | This attribute gives the control to request for complete information on Issued EMDs or minimal information.Requesting complete information leads to possible multiple supplier calls for fetching all the details. 2034 | 2035 | 2036 | 2037 | 2038 | Issues EMDS to all SVC segments. If it is true, TicketNumber and SVC segment reference need not be provided. Supported provider 1P. 2039 | 2040 | 2041 | 2042 | 2043 | 2044 | 2045 | 2046 | 2047 | Electronic Miscellaneous Document issuance response.Supported providers are 1V/1G/1P/1J 2048 | 2049 | 2050 | 2051 | 2052 | 2053 | 2054 | 2055 | List of EMDSummaryInfo elements to show minimal information in issuance response. Appears for ShowDetails=false in the request.This is the default behaviour. 2056 | 2057 | 2058 | 2059 | 2060 | List of EMDInfo elements to show detailoed information in issuance response. Appears for ShowDetails=true in the request. 2061 | 2062 | 2063 | 2064 | 2065 | 2066 | 2067 | 2068 | 2069 | 2070 | Request to retrieve brand details and optional services included in the brand 2071 | 2072 | 2073 | 2074 | 2075 | 2076 | 2077 | 2078 | 2079 | 2080 | 2081 | 2082 | 2083 | 2084 | 2085 | 2086 | Response for retrieved brand details and optional services included in them 2087 | 2088 | 2089 | 2090 | 2091 | 2092 | 2093 | 2094 | 2095 | 2096 | Lists classes of service by segment sent in the request which are not associated to a brand. 2097 | 2098 | 2099 | 2100 | 2101 | 2102 | 2103 | 2104 | 2105 | 2106 | 2107 | 2108 | 2109 | 2110 | 2111 | 2112 | 2113 | 2114 | 2115 | 2116 | 2117 | 2118 | Request to determine if the fares in an itinerary are exchangeable 2119 | 2120 | 2121 | 2122 | 2123 | 2124 | 2125 | 2126 | Provider:1P - Represents a valid Provider Reservation/PNR whose itinerary is to be exchanged 2127 | 2128 | 2129 | 2130 | 2131 | 2132 | 2133 | 2134 | 2135 | Type choices are "Detail" or "Summary" Default will be Summary 2136 | 2137 | 2138 | 2139 | 2140 | 2141 | 2142 | 2143 | 2144 | 2145 | 2146 | 2147 | 2148 | 2149 | 2150 | 2151 | 2152 | 2153 | 2154 | 2155 | 2156 | 2157 | 2158 | 2159 | 2160 | Provider: 1P - Represents a valid Provider Reservation/PNR whose itinerary is to be exchanged 2161 | 2162 | 2163 | 2164 | 2165 | 2166 | 2167 | 2168 | 2169 | 2170 | 2171 | 2172 | 2173 | 2174 | 2175 | 2176 | Request multiple quotes for the exchange of an itinerary. 1P transactions only 2177 | 2178 | 2179 | 2180 | 2181 | 2182 | 2183 | Type choices are "Detail" or "Summary" Default will be Summary 2184 | 2185 | 2186 | 2187 | 2188 | 2189 | 2190 | 2191 | 2192 | 2193 | 2194 | 2195 | 2196 | 2197 | 2198 | 2199 | 2200 | 2201 | 2202 | 2203 | 2204 | -------------------------------------------------------------------------------- /examples/travel/Kestrel.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | (c) Travelport GDS 2008 All rights reserved. Proprietary Information of Travelport GDS. 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /examples/travel_light/README.md: -------------------------------------------------------------------------------- 1 | # This is an example of advanced WSDL document. 2 | 3 | TODO: Write about what it shows, and explain how to use code. 4 | -------------------------------------------------------------------------------- /examples/travel_light/main.rs: -------------------------------------------------------------------------------- 1 | extern crate soap; 2 | extern crate roxmltree; 3 | 4 | use std::fs::File; 5 | use std::io::Read; 6 | use std::path::PathBuf; 7 | use std::path::Path; 8 | use std::io::Write; 9 | use std::env; 10 | use std::process; 11 | 12 | use soap::Wsdl; 13 | 14 | fn main() { 15 | let tmp_dir = env::current_dir() 16 | .unwrap(); 17 | // .join("examples/"); 18 | 19 | let path = Path::new(&env::current_dir().unwrap().join("service_response.xml")).to_path_buf(); 20 | 21 | 22 | println!("{:#?}", path); 23 | 24 | let mut content = String::new(); 25 | File::open(path) 26 | .unwrap() 27 | .read_to_string(&mut content) 28 | .unwrap(); 29 | 30 | let wsdl = match roxmltree::Document::parse(&content) { 31 | Ok(v) => v, 32 | Err(e) => { 33 | println!("Error: {}.", e); 34 | process::exit(1); 35 | } 36 | }; 37 | 38 | // Text representation. 39 | print_wsdl(&wsdl, Some(tmp_dir.join("wsdl_service.txt"))).expect("Error while printing WSDL."); 40 | } 41 | 42 | fn print_wsdl(wsdl: &roxmltree::Document, file: Option) -> Result<(), std::io::Error> { 43 | match file { 44 | None => println!("WSDL: {:#?}", wsdl), 45 | Some(f) => { 46 | let wsdl_str = format!("{:#?}", wsdl); 47 | File::create(f)?.write_all(wsdl_str.as_bytes())?; 48 | } 49 | } 50 | 51 | Ok(()) 52 | } 53 | -------------------------------------------------------------------------------- /examples/weather/main.rs: -------------------------------------------------------------------------------- 1 | extern crate soap; 2 | 3 | use std::fs::File; 4 | use std::path::PathBuf; 5 | use std::io::Write; 6 | use std::env; 7 | 8 | use soap::Wsdl; 9 | 10 | fn main() { 11 | // Run stub server on some port to perform this test? 12 | // This site is unavailable at the moment, and perhaps forever... 13 | // let wsdl = match Wsdl::load_from_url("http://www.webservicex.com/globalweather.asmx?WSDL") { 14 | // Ok(v) => v, 15 | // Err(e) => panic!("Error: {}", e), 16 | // }; 17 | 18 | let tmp_dir = env::current_dir().unwrap().join("examples/weather/"); 19 | 20 | let wsdl = match Wsdl::load_from_file("examples/weather/etoimik.wsdl") { 21 | Ok(v) => v, 22 | Err(e) => panic!("Error: {}", e), 23 | }; 24 | 25 | print_wsdl(&wsdl, Some(tmp_dir.join("wsdl_etoimik.txt"))).expect("Error while printing WSDL."); 26 | } 27 | 28 | fn print_wsdl(wsdl: &Wsdl, file: Option) -> Result<(), std::io::Error> { 29 | match file { 30 | None => println!("WSDL: {:#?}", wsdl), 31 | Some(f) => { 32 | let wsdl_str = format!("{:#?}", wsdl); 33 | File::create(f)?.write_all(wsdl_str.as_bytes())?; 34 | } 35 | } 36 | 37 | Ok(()) 38 | } 39 | -------------------------------------------------------------------------------- /src/autogen/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod types; 2 | -------------------------------------------------------------------------------- /src/autogen/parser.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raventid/soap-rs/c4e22b784daa3040aed1a79d4cded4d461e15ba6/src/autogen/parser.rs -------------------------------------------------------------------------------- /src/autogen/types.rs: -------------------------------------------------------------------------------- 1 | use codegen::Scope; 2 | use wsdl::schema::WsdlMessage; 3 | 4 | pub fn generate_messages(messages: &Vec) -> String { 5 | // Code generation for types 6 | let mut types_scope = Scope::new(); 7 | 8 | // Types generation 9 | messages.iter().for_each(|message| { 10 | let structure = types_scope.new_struct(&message.name); 11 | 12 | match &message.documentation { 13 | Some(doc) => structure.doc(doc.text.as_str()), 14 | None => structure, 15 | }; 16 | 17 | message.parts.iter().for_each(|part| { 18 | let type_info = match part.part_type { 19 | Some(ref val) => val.local_name.clone(), 20 | None => "String".to_string(), // if no type info - then String 21 | }; 22 | 23 | structure.field(&part.name, type_info); 24 | }); 25 | }); 26 | 27 | types_scope.to_string() 28 | } 29 | -------------------------------------------------------------------------------- /src/header.rs: -------------------------------------------------------------------------------- 1 | mod document; 2 | 3 | struct Header { 4 | wsse_auth: WsseAuth, 5 | wsse_timestamp: WsseTimestamp, 6 | wsse_signature: WsseSignature, 7 | soap_header: SoapHeader 8 | } 9 | -------------------------------------------------------------------------------- /src/lib.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(feature="clippy", feature(plugin))] 2 | #![cfg_attr(feature="clippy", plugin(clippy))] 3 | 4 | extern crate hyper; 5 | extern crate xml; 6 | extern crate encoding; 7 | extern crate codegen; 8 | 9 | #[macro_use] 10 | extern crate error_chain; 11 | 12 | mod wsdl; 13 | pub mod autogen; 14 | 15 | pub use wsdl::schema::{ 16 | Documented, 17 | NamedItem, 18 | Wsdl, 19 | WsdlBinding, 20 | WsdlOperationBinding, 21 | WsdlInputBinding, 22 | WsdlOutputBinding, 23 | WsdlFaultBinding, 24 | WsdlPort, 25 | WsdlService 26 | }; 27 | -------------------------------------------------------------------------------- /src/request.rs: -------------------------------------------------------------------------------- 1 | use std::collections::HashMap; 2 | use std::io::Read; 3 | 4 | // Use abstract HTTP request with reqwest default adapter. 5 | // Default adapter is reqwest? 6 | extern crate hyper; 7 | use self::hyper::server::Request as HttpRequest; 8 | 9 | #[derive(Default, Debug)] 10 | pub struct Request { 11 | pub header: HashMap, 12 | pub content: String, 13 | } 14 | 15 | impl Request { 16 | pub fn new(header: HashMap, content: String) -> Request { 17 | Request { 18 | header: header, 19 | content: content, 20 | } 21 | } 22 | } 23 | 24 | // So just generic request here with all cipher stuff 25 | // How to send all of the cipher stuff here??? 26 | impl<'a, 'b> From> for Request { 27 | fn from(mut other: HttpRequest<'a, 'b>) -> Request { 28 | let mut request = Request::default(); 29 | 30 | for h in other.headers.iter() { 31 | request 32 | .header 33 | .insert(h.name().to_string(), h.value_string()); 34 | } 35 | 36 | request.content = String::new(); 37 | let _ = other.read_to_string(&mut request.content); 38 | 39 | request 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/wsdl/errors.rs: -------------------------------------------------------------------------------- 1 | use std::io::Error as IoError; 2 | use std::borrow::Cow; 3 | 4 | use hyper::Error as HyperError; 5 | use xml::reader::Error as XmlError; 6 | 7 | error_chain! { 8 | foreign_links { 9 | Io(IoError); 10 | Http(HyperError); 11 | Xml(XmlError); 12 | } 13 | 14 | errors { 15 | MandatoryAttribute(attribute: String, element: String) { 16 | description("mandatory attribute") 17 | display("Attribute `{}` is mandatory for `{}` element", attribute, element) 18 | } 19 | 20 | InvalidElement(element: String) { 21 | description("invalid element") 22 | display("Invalid `{}` element", element) 23 | } 24 | 25 | MissingElement(element: String) { 26 | description("missing element") 27 | display("Required `{}` element is missing from WSDL document", element) 28 | } 29 | } 30 | } 31 | 32 | impl<'a> From> for Error { 33 | fn from(error: Cow<'a, str>) -> Error { 34 | error.into() 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/wsdl/file.rs: -------------------------------------------------------------------------------- 1 | use std::fs::File; 2 | use std::io::{Read, Result}; 3 | 4 | pub fn load(location: &str) -> Result> { 5 | let mut bytes = Vec::new(); 6 | 7 | File::open(location)?.read_to_end(&mut bytes)?; 8 | 9 | Ok(bytes) 10 | } 11 | 12 | #[cfg(test)] 13 | mod tests { 14 | use super::*; 15 | use std::path::PathBuf; 16 | 17 | #[test] 18 | fn load_file_test() { 19 | let file = get_wsdl_file("etoimik.wsdl").unwrap(); 20 | let result = load(&file); 21 | 22 | assert!(result.is_ok()); 23 | let file_contents = result.unwrap(); 24 | assert!(file_contents.len() > 0); 25 | } 26 | 27 | #[test] 28 | fn load_file_fail_test() { 29 | let file = get_wsdl_file("etoimik2.wsdl").unwrap(); 30 | let result = load(&file); 31 | 32 | assert!(result.is_err()); 33 | } 34 | 35 | fn get_wsdl_file(name: &str) -> Option { 36 | let mut start = PathBuf::from(env!("CARGO_MANIFEST_DIR")); 37 | 38 | start.push("examples"); 39 | start.push(name); 40 | 41 | start.to_str().map(String::from) 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/wsdl/http.rs: -------------------------------------------------------------------------------- 1 | use std::io::Read; 2 | use hyper::Client; 3 | use super::errors::*; 4 | 5 | // TODO: Some notes about http data transfering 6 | // What if someone want to use another client? 7 | // What about async/sync client does not matter? 8 | pub fn get(url: &str) -> Result> { 9 | let client = Client::new(); 10 | let mut bytes = Vec::new(); 11 | 12 | client.get(url).send()?.read_to_end(&mut bytes)?; 13 | 14 | Ok(bytes) 15 | } 16 | 17 | #[cfg(test)] 18 | mod tests { 19 | use super::*; 20 | 21 | #[test] 22 | fn get_url_test() { 23 | let result = get("http://httpbin.org/get"); 24 | 25 | assert!(result.is_ok()); 26 | let response = result.unwrap(); 27 | assert!(response.len() > 0) 28 | } 29 | 30 | #[test] 31 | fn get_url_fail_test() { 32 | let result = get("http://www.sde.dd/"); 33 | 34 | assert!(result.is_err()); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/wsdl/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod errors; 2 | pub mod file; 3 | pub mod http; 4 | pub mod schema; 5 | -------------------------------------------------------------------------------- /src/wsdl/schema.rs: -------------------------------------------------------------------------------- 1 | use super::errors::*; 2 | 3 | use super::http; 4 | use super::file; 5 | 6 | use xml::attribute::OwnedAttribute; 7 | use xml::name::OwnedName; 8 | use xml::namespace::Namespace; 9 | use xml::reader::{EventReader, Events, XmlEvent}; 10 | 11 | use encoding::all::UTF_8; 12 | use encoding::DecoderTrap; 13 | use encoding::types::decode; 14 | 15 | const NS_WSDL: &'static str = "http://schemas.xmlsoap.org/wsdl/"; 16 | 17 | pub trait Documented { 18 | fn get_documentation(&self) -> &Option; 19 | } 20 | 21 | macro_rules! impl_documented { 22 | ($type:ty) => { 23 | impl Documented for $type { 24 | fn get_documentation(&self) -> &Option { 25 | &self.documentation 26 | } 27 | } 28 | } 29 | } 30 | 31 | pub trait NamedItem { 32 | fn get_name(&self) -> &str; 33 | } 34 | 35 | macro_rules! impl_named_item { 36 | ($type:ty) => { 37 | impl NamedItem for $type { 38 | fn get_name(&self) -> &str { 39 | self.name.as_str() 40 | } 41 | } 42 | } 43 | } 44 | 45 | #[derive(Debug)] 46 | pub struct Wsdl { 47 | pub documentation: Option, 48 | pub target_namespace: Option, 49 | pub types: Vec, 50 | pub port_types: Vec, 51 | pub services: Vec, 52 | pub bindings: Vec, 53 | pub messages: Vec, 54 | } 55 | 56 | impl_documented!(Wsdl); 57 | 58 | #[derive(Debug)] 59 | pub struct WsdlService { 60 | pub documentation: Option, 61 | pub name: String, 62 | pub ports: Vec, 63 | } 64 | 65 | impl_documented!(WsdlService); 66 | impl_named_item!(WsdlService); 67 | 68 | #[derive(Debug)] 69 | pub struct WsdlBinding { 70 | pub documentation: Option, 71 | pub name: String, 72 | pub port_type: OwnedName, 73 | pub operations: Vec, 74 | } 75 | 76 | impl_documented!(WsdlBinding); 77 | impl_named_item!(WsdlBinding); 78 | 79 | #[derive(Debug)] 80 | pub struct WsdlMessage { 81 | pub documentation: Option, 82 | pub name: String, 83 | pub parts: Vec, 84 | } 85 | 86 | impl_documented!(WsdlMessage); 87 | impl_named_item!(WsdlMessage); 88 | 89 | #[derive(Debug)] 90 | pub struct WsdlPort { 91 | pub documentation: Option, 92 | pub name: String, 93 | pub binding: OwnedName, 94 | } 95 | 96 | impl_documented!(WsdlPort); 97 | impl_named_item!(WsdlPort); 98 | 99 | #[derive(Debug)] 100 | pub struct WsdlOperationBinding { 101 | pub documentation: Option, 102 | pub name: String, 103 | pub input: Option, 104 | pub output: Option, 105 | pub fault: Option, 106 | } 107 | 108 | impl_documented!(WsdlOperationBinding); 109 | impl_named_item!(WsdlOperationBinding); 110 | 111 | #[derive(Debug)] 112 | pub struct WsdlMessagePart { 113 | pub name: String, 114 | pub element: Option, 115 | pub part_type: Option, 116 | } 117 | 118 | #[derive(Debug)] 119 | pub struct WsdlInputBinding { 120 | pub documentation: Option, 121 | pub text: String, 122 | } 123 | 124 | impl_documented!(WsdlInputBinding); 125 | 126 | #[derive(Debug)] 127 | pub struct WsdlOutputBinding { 128 | pub documentation: Option, 129 | } 130 | 131 | impl_documented!(WsdlOutputBinding); 132 | 133 | #[derive(Debug)] 134 | pub struct WsdlFaultBinding { 135 | pub documentation: Option, 136 | pub name: String, 137 | } 138 | 139 | impl_documented!(WsdlFaultBinding); 140 | impl_named_item!(WsdlFaultBinding); 141 | 142 | #[derive(Debug)] 143 | pub struct WsdlTypes { 144 | pub documentation: Option, 145 | } 146 | 147 | impl_documented!(WsdlTypes); 148 | 149 | #[derive(Debug)] 150 | pub struct WsdlPortType { 151 | pub documentation: Option, 152 | pub name: String, 153 | } 154 | 155 | impl_documented!(WsdlPortType); 156 | impl_named_item!(WsdlPortType); 157 | 158 | #[derive(Debug)] 159 | pub struct WsdlDocumentation { 160 | pub text: String 161 | } 162 | 163 | impl Wsdl { 164 | pub fn load_from_url(url: &str) -> Result { 165 | let contents = http::get(url)?; 166 | let decoded_contents = decode_contents(&contents)?; 167 | Wsdl::parse(&decoded_contents[..]) 168 | } 169 | 170 | pub fn load_from_file(location: &str) -> Result { 171 | let contents = file::load(location)?; 172 | let decoded_contents = decode_contents(&contents)?; 173 | Wsdl::parse(&decoded_contents[..]) 174 | } 175 | 176 | pub fn parse(decoded_contents: &[u8]) -> Result { 177 | let ns_wsdl = Some(NS_WSDL.to_string()); 178 | let parser = EventReader::new(decoded_contents); 179 | let mut iter = parser.into_iter(); 180 | 181 | while let Some(v) = iter.next() { 182 | match v? { 183 | XmlEvent::StartElement { 184 | ref name, 185 | ref attributes, 186 | .. 187 | } if name.namespace == ns_wsdl && name.local_name == "definitions" => { 188 | return Wsdl::read(attributes, &mut iter); 189 | } 190 | _ => continue, 191 | } 192 | } 193 | 194 | Err(ErrorKind::MissingElement("definitions".to_string()).into()) 195 | } 196 | 197 | fn read(attributes: &[OwnedAttribute], mut iter: &mut Events<&[u8]>) -> Result { 198 | let ns_wsdl = Some(NS_WSDL.to_string()); 199 | let target_namespace = find_attribute("targetNamespace", attributes); 200 | 201 | let mut depth = 0; 202 | let mut documentation = None; 203 | let mut types = Vec::new(); 204 | let mut port_types = Vec::new(); 205 | let mut services = Vec::new(); 206 | let mut bindings = Vec::new(); 207 | let mut messages = Vec::new(); 208 | 209 | while let Some(v) = iter.next() { 210 | match (v?, depth) { 211 | (XmlEvent::StartElement { ref name, .. }, 0) if name.namespace == ns_wsdl && 212 | name.local_name == 213 | "documentation" => { 214 | documentation = Some(WsdlDocumentation::read(&mut iter)?) 215 | } 216 | (XmlEvent::StartElement { ref name, .. }, 0) if name.namespace == ns_wsdl && 217 | name.local_name == "import" => unimplemented!(), 218 | (XmlEvent::StartElement { ref name, .. }, 0) if name.namespace == ns_wsdl && 219 | name.local_name == "types" => { 220 | types.push(WsdlTypes::read(&mut iter)?) 221 | } 222 | (XmlEvent::StartElement { 223 | ref name, 224 | ref attributes, 225 | .. 226 | }, 227 | 0) if name.namespace == ns_wsdl && name.local_name == "message" => { 228 | messages.push(WsdlMessage::read(attributes, &mut iter)?) 229 | } 230 | (XmlEvent::StartElement { 231 | ref name, 232 | ref attributes, 233 | .. 234 | }, 235 | 0) if name.namespace == ns_wsdl && name.local_name == "portType" => { 236 | port_types.push(WsdlPortType::read(attributes, &mut iter)?) 237 | } 238 | (XmlEvent::StartElement { 239 | ref name, 240 | ref attributes, 241 | ref namespace, 242 | }, 243 | 0) if name.namespace == ns_wsdl && name.local_name == "binding" => { 244 | bindings.push(WsdlBinding::read(attributes, namespace, &mut iter)?) 245 | } 246 | (XmlEvent::StartElement { 247 | ref name, 248 | ref attributes, 249 | .. 250 | }, 251 | 0) if name.namespace == ns_wsdl && name.local_name == "service" => { 252 | services.push(WsdlService::read(attributes, &mut iter)?) 253 | } 254 | (XmlEvent::StartElement { .. }, _) => depth += 1, 255 | (XmlEvent::EndElement { ref name }, 0) if name.namespace == ns_wsdl && 256 | name.local_name == "definitions" => break, 257 | (XmlEvent::EndElement { .. }, _) => depth -= 1, 258 | _ => continue, 259 | } 260 | } 261 | 262 | Ok(Wsdl { 263 | documentation, 264 | target_namespace, 265 | types, 266 | port_types, 267 | services, 268 | bindings, 269 | messages, 270 | }) 271 | } 272 | } 273 | 274 | impl WsdlService { 275 | fn read(attributes: &[OwnedAttribute], iter: &mut Events<&[u8]>) -> Result { 276 | let ns_wsdl = Some(NS_WSDL.to_string()); 277 | let service_name = find_attribute("name", attributes); 278 | 279 | let mut depth = 0; 280 | let mut ports = Vec::new(); 281 | 282 | for event in iter { 283 | match (event?, depth) { 284 | (XmlEvent::StartElement { 285 | ref name, 286 | ref attributes, 287 | ref namespace, 288 | }, 289 | 0) if name.namespace == ns_wsdl && name.local_name == "port" => { 290 | ports.push(WsdlPort::read(attributes, namespace)?) 291 | } 292 | (XmlEvent::StartElement { .. }, _) => depth += 1, 293 | (XmlEvent::EndElement { ref name }, 0) if name.namespace == ns_wsdl && 294 | name.local_name == "service" => break, 295 | (XmlEvent::EndElement { .. }, _) => depth -= 1, 296 | _ => continue, 297 | } 298 | } 299 | 300 | Ok(WsdlService { 301 | documentation: None, 302 | name: service_name 303 | .ok_or_else(|| { 304 | ErrorKind::MandatoryAttribute("name".to_string(), 305 | "wsdl:service".to_string()) 306 | })?, 307 | ports, 308 | }) 309 | } 310 | } 311 | 312 | impl WsdlBinding { 313 | fn read(attributes: &[OwnedAttribute], 314 | namespace: &Namespace, 315 | iter: &mut Events<&[u8]>) 316 | -> Result { 317 | let ns_wsdl = Some(NS_WSDL.to_string()); 318 | let mut binding_name = None; 319 | let mut port_type = None; 320 | 321 | for attr in attributes { 322 | if attr.name.namespace.is_none() { 323 | if attr.name.local_name == "name" { 324 | binding_name = Some(attr.value.clone()); 325 | } else if attr.name.local_name == "type" { 326 | port_type = Some(attr.value.clone()); 327 | } 328 | } 329 | } 330 | 331 | let mut port_type: OwnedName = port_type 332 | .ok_or_else(|| { 333 | ErrorKind::MandatoryAttribute("type".to_string(), 334 | "wsdl:binding".to_string()) 335 | })? 336 | .parse() 337 | .unwrap(); 338 | 339 | if let Some(ref pfx) = port_type.prefix { 340 | port_type.namespace = namespace.get(pfx).map(|x| x.to_string()); 341 | } 342 | 343 | let mut operations = Vec::new(); 344 | 345 | for event in iter { 346 | match event? { 347 | XmlEvent::StartElement { 348 | ref name, 349 | ref attributes, 350 | .. 351 | } if name.namespace == ns_wsdl && name.local_name == "operation" => { 352 | operations.push(WsdlOperationBinding::read(attributes)?); 353 | } 354 | XmlEvent::EndElement { ref name, .. } if name.namespace == ns_wsdl && 355 | name.local_name == "binding" => {; 356 | return Ok(WsdlBinding { 357 | documentation: None, 358 | name: binding_name.ok_or_else(|| ErrorKind::MandatoryAttribute("name".to_string(), "wsdl:binding".to_string()))?, 359 | port_type, 360 | operations 361 | }); 362 | } 363 | _ => continue, 364 | } 365 | } 366 | 367 | Err(ErrorKind::InvalidElement("wsdl:binding".to_string()).into()) 368 | } 369 | } 370 | 371 | impl WsdlMessage { 372 | fn read(attributes: &[OwnedAttribute], iter: &mut Events<&[u8]>) -> Result { 373 | let ns_wsdl = Some(NS_WSDL.to_string()); 374 | let message_name = find_attribute("name", attributes); 375 | 376 | let mut parts = Vec::new(); 377 | 378 | for event in iter { 379 | match event? { 380 | XmlEvent::StartElement { 381 | ref name, 382 | ref attributes, 383 | .. 384 | } if name.namespace == ns_wsdl && name.local_name == "part" => { 385 | parts.push(WsdlMessagePart::read(attributes)?); 386 | } 387 | XmlEvent::EndElement { ref name, .. } if name.namespace == ns_wsdl && 388 | name.local_name == "message" => { 389 | return Ok(WsdlMessage { 390 | documentation: None, 391 | name: message_name.ok_or_else(|| ErrorKind::MandatoryAttribute("name".to_string(), "wsdl:message".to_string()))?, 392 | parts 393 | }); 394 | } 395 | _ => continue, 396 | } 397 | } 398 | 399 | Err(ErrorKind::InvalidElement("wsdl:message".to_string()).into()) 400 | } 401 | } 402 | 403 | impl WsdlPort { 404 | fn read(attributes: &[OwnedAttribute], namespace: &Namespace) -> Result { 405 | let mut name = None; 406 | let mut binding = None; 407 | 408 | for attr in attributes { 409 | if attr.name.namespace.is_none() { 410 | if attr.name.local_name == "name" { 411 | name = Some(attr.value.clone()); 412 | } else if attr.name.local_name == "binding" { 413 | binding = Some(attr.value.clone()); 414 | } 415 | } 416 | } 417 | 418 | let mut binding: OwnedName = binding 419 | .ok_or_else(|| { 420 | ErrorKind::MandatoryAttribute("binding".to_string(), 421 | "wsdl:port".to_string()) 422 | })? 423 | .parse() 424 | .unwrap(); 425 | 426 | if let Some(ref pfx) = binding.prefix { 427 | binding.namespace = namespace.get(pfx).map(|x| x.to_string()); 428 | } 429 | 430 | Ok(WsdlPort { 431 | documentation: None, 432 | name: name.ok_or_else(|| { 433 | ErrorKind::MandatoryAttribute("name".to_string(), 434 | "wsdl:port".to_string()) 435 | })?, 436 | binding, 437 | }) 438 | } 439 | } 440 | 441 | impl WsdlOperationBinding { 442 | fn read(attributes: &[OwnedAttribute]) -> Result { 443 | let name = find_attribute("name", attributes); 444 | let internals = attributes 445 | .iter() 446 | .map(|attr| attr.value.clone()) 447 | .collect::>() 448 | .join(""); 449 | 450 | Ok(WsdlOperationBinding { 451 | documentation: None, 452 | name: name.ok_or_else(|| { 453 | ErrorKind::MandatoryAttribute("name".to_string(), 454 | "wsdl:operation".to_string()) 455 | })?, 456 | input: Some(WsdlInputBinding{documentation: None, text: internals.clone()}), 457 | output: None, 458 | fault: None, 459 | }) 460 | } 461 | } 462 | 463 | impl WsdlMessagePart { 464 | fn read(attributes: &[OwnedAttribute]) -> Result { 465 | let part_name = find_attribute("name", attributes); 466 | 467 | Ok(WsdlMessagePart { 468 | name: part_name 469 | .ok_or_else(|| { 470 | ErrorKind::MandatoryAttribute("name".to_string(), 471 | "wsdl:part".to_string()) 472 | })?, 473 | element: None, 474 | part_type: None, 475 | }) 476 | } 477 | } 478 | 479 | impl WsdlTypes { 480 | fn read(iter: &mut Events<&[u8]>) -> Result { 481 | let ns_wsdl = Some(NS_WSDL.to_string()); 482 | 483 | let mut depth = 0; 484 | 485 | for event in iter { 486 | match (event?, depth) { 487 | (XmlEvent::StartElement { .. }, _) => depth += 1, 488 | (XmlEvent::EndElement { ref name, .. }, 0) if name.namespace == ns_wsdl && 489 | name.local_name == "types" => { 490 | break; 491 | } 492 | (XmlEvent::EndElement { .. }, _) => depth -= 1, 493 | _ => continue, 494 | } 495 | } 496 | 497 | Ok(WsdlTypes { documentation: None }) 498 | } 499 | } 500 | 501 | impl WsdlPortType { 502 | fn read(attributes: &[OwnedAttribute], iter: &mut Events<&[u8]>) -> Result { 503 | let name = find_attribute("name", attributes) 504 | .ok_or_else(|| { 505 | ErrorKind::MandatoryAttribute("name".to_string(), 506 | "wsdl:portType".to_string()) 507 | })?; 508 | 509 | let ns_wsdl = Some(NS_WSDL.to_string()); 510 | 511 | let mut depth = 0; 512 | 513 | for event in iter { 514 | match (event?, depth) { 515 | (XmlEvent::StartElement { .. }, _) => depth += 1, 516 | (XmlEvent::EndElement { ref name, .. }, 0) if name.namespace == ns_wsdl && 517 | name.local_name == "portType" => { 518 | break; 519 | } 520 | (XmlEvent::EndElement { .. }, _) => depth -= 1, 521 | _ => continue, 522 | } 523 | } 524 | 525 | Ok(WsdlPortType { 526 | name, 527 | documentation: None, 528 | }) 529 | } 530 | } 531 | 532 | impl WsdlDocumentation { 533 | fn read(iter: &mut Events<&[u8]>) -> Result { 534 | let ns_wsdl = Some(NS_WSDL.to_string()); 535 | 536 | let mut depth = 0; 537 | 538 | for event in iter { 539 | match (event?, depth) { 540 | (XmlEvent::StartElement { .. }, _) => depth += 1, 541 | (XmlEvent::EndElement { ref name, .. }, 0) if name.namespace == ns_wsdl && 542 | name.local_name == 543 | "documentation" => { 544 | break; 545 | } 546 | (XmlEvent::EndElement { .. }, _) => depth -= 1, 547 | _ => continue, 548 | } 549 | } 550 | 551 | Ok(WsdlDocumentation { text: "placeholder".to_string() }) 552 | } 553 | } 554 | 555 | fn decode_contents(bytes: &[u8]) -> Result> { 556 | let (decoded_contents, _) = decode(bytes, DecoderTrap::Replace, UTF_8); 557 | Ok(decoded_contents?.as_bytes().to_vec()) 558 | } 559 | 560 | fn find_attribute(name: &str, attributes: &[OwnedAttribute]) -> Option { 561 | attributes 562 | .iter() 563 | .find(|a| a.name.namespace.is_none() && a.name.local_name == name) 564 | .map(|a| a.value.clone()) 565 | } 566 | 567 | #[cfg(test)] 568 | mod tests { 569 | use super::*; 570 | 571 | #[test] 572 | fn must_check_depth() { 573 | let result = Wsdl::parse(r#" 574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | 582 | "# 583 | .as_bytes()); 584 | 585 | assert!(result.is_ok()); 586 | 587 | let wsdl = result.unwrap(); 588 | 589 | assert_eq!(2, wsdl.services.len()); 590 | assert_eq!("root1", wsdl.services[0].name); 591 | assert_eq!("root2", wsdl.services[1].name); 592 | } 593 | } 594 | --------------------------------------------------------------------------------