soap 1.4.1 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/Readme.md +585 -560
  2. package/eslint.config.mjs +15 -0
  3. package/lib/client.d.ts +1 -2
  4. package/lib/client.js +80 -49
  5. package/lib/client.js.map +1 -1
  6. package/lib/http.d.ts +2 -4
  7. package/lib/http.js +28 -15
  8. package/lib/http.js.map +1 -1
  9. package/lib/nscontext.js +5 -3
  10. package/lib/nscontext.js.map +1 -1
  11. package/lib/security/BasicAuthSecurity.js +18 -8
  12. package/lib/security/BasicAuthSecurity.js.map +1 -1
  13. package/lib/security/BearerSecurity.js +17 -7
  14. package/lib/security/BearerSecurity.js.map +1 -1
  15. package/lib/security/ClientSSLSecurity.d.ts +0 -1
  16. package/lib/security/ClientSSLSecurity.js +18 -8
  17. package/lib/security/ClientSSLSecurity.js.map +1 -1
  18. package/lib/security/ClientSSLSecurityPFX.d.ts +0 -1
  19. package/lib/security/ClientSSLSecurityPFX.js +17 -7
  20. package/lib/security/ClientSSLSecurityPFX.js.map +1 -1
  21. package/lib/security/NTLMSecurity.js +17 -7
  22. package/lib/security/NTLMSecurity.js.map +1 -1
  23. package/lib/security/WSSecurity.js +36 -24
  24. package/lib/security/WSSecurity.js.map +1 -1
  25. package/lib/security/WSSecurityCert.js +22 -23
  26. package/lib/security/WSSecurityCert.js.map +1 -1
  27. package/lib/security/WSSecurityCertWithToken.d.ts +0 -1
  28. package/lib/security/WSSecurityCertWithToken.js +26 -22
  29. package/lib/security/WSSecurityCertWithToken.js.map +1 -1
  30. package/lib/security/WSSecurityPlusCert.js.map +1 -1
  31. package/lib/security/index.js.map +1 -1
  32. package/lib/server.d.ts +0 -2
  33. package/lib/server.js +64 -63
  34. package/lib/server.js.map +1 -1
  35. package/lib/soap.js +21 -16
  36. package/lib/soap.js.map +1 -1
  37. package/lib/types.d.ts +2 -2
  38. package/lib/utils.d.ts +0 -1
  39. package/lib/utils.js +25 -20
  40. package/lib/utils.js.map +1 -1
  41. package/lib/wsdl/elements.d.ts +1 -0
  42. package/lib/wsdl/elements.js +88 -166
  43. package/lib/wsdl/elements.js.map +1 -1
  44. package/lib/wsdl/index.js +59 -69
  45. package/lib/wsdl/index.js.map +1 -1
  46. package/package.json +15 -12
  47. package/tsconfig.json +6 -8
  48. package/index.js +0 -3
  49. package/soap-stub.js +0 -146
  50. package/tslint.json +0 -24
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
37
  };
@@ -105,8 +115,10 @@ class Element {
105
115
  this.init();
106
116
  }
107
117
  deleteFixedAttrs() {
108
- this.children && this.children.length === 0 && delete this.children;
109
- this.xmlns && Object.keys(this.xmlns).length === 0 && delete this.xmlns;
118
+ if (this.children && this.children.length === 0)
119
+ delete this.children;
120
+ if (this.xmlns && Object.keys(this.xmlns).length === 0)
121
+ delete this.xmlns;
110
122
  delete this.nsName;
111
123
  delete this.prefix;
112
124
  delete this.name;
@@ -147,29 +159,32 @@ class Element {
147
159
  stack.pop();
148
160
  }
149
161
  }
162
+ //eslint-disable-next-line @typescript-eslint/no-unused-vars
150
163
  addChild(child) {
151
164
  return;
152
165
  }
153
166
  unexpected(name) {
154
167
  throw new Error('Found unexpected element (' + name + ') inside ' + this.nsName);
155
168
  }
169
+ //eslint-disable-next-line @typescript-eslint/no-unused-vars
156
170
  description(definitions, xmlns) {
157
171
  return this.$name || this.name;
158
172
  }
159
- init() {
160
- }
173
+ init() { }
161
174
  _initializeOptions(options) {
162
175
  if (options) {
163
176
  this.valueKey = options.valueKey || '$value';
164
177
  this.xmlKey = options.xmlKey || '$xml';
165
178
  this.ignoredNamespaces = options.ignoredNamespaces || [];
166
179
  this.strict = options.strict || false;
180
+ this.forceUseSchemaXmlns = options.forceUseSchemaXmlns || false;
167
181
  }
168
182
  else {
169
183
  this.valueKey = '$value';
170
184
  this.xmlKey = '$xml';
171
185
  this.ignoredNamespaces = [];
172
186
  this.strict = false;
187
+ this.forceUseSchemaXmlns = false;
173
188
  }
174
189
  }
175
190
  }
@@ -185,11 +200,7 @@ exports.UnexpectedElement = UnexpectedElement;
185
200
  class ElementElement extends Element {
186
201
  constructor() {
187
202
  super(...arguments);
188
- this.allowedChildren = buildAllowedChildren([
189
- 'annotation',
190
- 'complexType',
191
- 'simpleType',
192
- ]);
203
+ this.allowedChildren = buildAllowedChildren(['annotation', 'complexType', 'simpleType']);
193
204
  }
194
205
  description(definitions, xmlns) {
195
206
  let element = {};
@@ -201,10 +212,11 @@ class ElementElement extends Element {
201
212
  if (this.$maxOccurs === 'unbounded') {
202
213
  maxOccurs = Infinity;
203
214
  }
204
- else if (Boolean(this.$maxOccurs)) {
215
+ else if (this.$maxOccurs) {
205
216
  maxOccurs = parseInt(this.$maxOccurs, 10);
206
217
  }
207
- if (Boolean(this.$minOccurs)) {
218
+ if (this.$minOccurs) {
219
+ //eslint-disable-next-line @typescript-eslint/no-unused-vars
208
220
  minOccurs = parseInt(this.$minOccurs, 10);
209
221
  }
210
222
  const isMany = maxOccurs > 1;
@@ -218,8 +230,7 @@ class ElementElement extends Element {
218
230
  if (type) {
219
231
  type = (0, utils_1.splitQName)(type);
220
232
  const typeName = type.name;
221
- const useSchemaXmlns = !!findNs(type.prefix, this.definitionsXmlns, definitions.xmlns) ||
222
- !!findNs(this.targetNSAlias, this.definitionsXmlns, definitions.xmlns);
233
+ const useSchemaXmlns = !!findNs(type.prefix, this.definitionsXmlns, definitions.xmlns) || !!findNs(this.targetNSAlias, this.definitionsXmlns, definitions.xmlns) || this.forceUseSchemaXmlns;
223
234
  const ns = findNs(type.prefix, xmlns, this.xmlns, useSchemaXmlns ? this.schemaXmlns : undefined, this.definitionsXmlns, definitions.xmlns);
224
235
  const schema = definitions.schemas[ns];
225
236
  const typeElement = schema && (this.$type ? schema.complexTypes[typeName] || schema.types[typeName] : schema.elements[typeName]);
@@ -302,12 +313,7 @@ exports.AnyElement = AnyElement;
302
313
  class InputElement extends Element {
303
314
  constructor() {
304
315
  super(...arguments);
305
- this.allowedChildren = buildAllowedChildren([
306
- 'body',
307
- 'documentation',
308
- 'header',
309
- 'SecuritySpecRef',
310
- ]);
316
+ this.allowedChildren = buildAllowedChildren(['body', 'documentation', 'header', 'SecuritySpecRef']);
311
317
  }
312
318
  addChild(child) {
313
319
  if (child instanceof BodyElement) {
@@ -323,12 +329,7 @@ exports.InputElement = InputElement;
323
329
  class OutputElement extends Element {
324
330
  constructor() {
325
331
  super(...arguments);
326
- this.allowedChildren = buildAllowedChildren([
327
- 'body',
328
- 'documentation',
329
- 'header',
330
- 'SecuritySpecRef',
331
- ]);
332
+ this.allowedChildren = buildAllowedChildren(['body', 'documentation', 'header', 'SecuritySpecRef']);
332
333
  }
333
334
  addChild(child) {
334
335
  if (child instanceof BodyElement) {
@@ -344,10 +345,9 @@ exports.OutputElement = OutputElement;
344
345
  class SimpleTypeElement extends Element {
345
346
  constructor() {
346
347
  super(...arguments);
347
- this.allowedChildren = buildAllowedChildren([
348
- 'restriction',
349
- ]);
348
+ this.allowedChildren = buildAllowedChildren(['restriction']);
350
349
  }
350
+ //eslint-disable-next-line @typescript-eslint/no-unused-vars
351
351
  description(definitions) {
352
352
  for (const child of this.children) {
353
353
  if (child instanceof RestrictionElement) {
@@ -361,13 +361,7 @@ exports.SimpleTypeElement = SimpleTypeElement;
361
361
  class RestrictionElement extends Element {
362
362
  constructor() {
363
363
  super(...arguments);
364
- this.allowedChildren = buildAllowedChildren([
365
- 'all',
366
- 'choice',
367
- 'enumeration',
368
- 'sequence',
369
- 'attribute',
370
- ]);
364
+ this.allowedChildren = buildAllowedChildren(['all', 'choice', 'enumeration', 'sequence', 'attribute']);
371
365
  }
372
366
  description(definitions, xmlns) {
373
367
  const children = this.children;
@@ -406,9 +400,11 @@ class RestrictionElement extends Element {
406
400
  }
407
401
  return desc;
408
402
  }
409
- const restrictions = this.children.map((child) => {
403
+ const restrictions = this.children
404
+ .map((child) => {
410
405
  return child.description();
411
- }).join(',');
406
+ })
407
+ .join(',');
412
408
  return [this.$base, restrictions].filter(Boolean).join('|');
413
409
  }
414
410
  }
@@ -416,11 +412,7 @@ exports.RestrictionElement = RestrictionElement;
416
412
  class ExtensionElement extends Element {
417
413
  constructor() {
418
414
  super(...arguments);
419
- this.allowedChildren = buildAllowedChildren([
420
- 'all',
421
- 'choice',
422
- 'sequence',
423
- ]);
415
+ this.allowedChildren = buildAllowedChildren(['all', 'choice', 'sequence']);
424
416
  }
425
417
  description(definitions, xmlns) {
426
418
  let desc = {};
@@ -438,9 +430,7 @@ class ExtensionElement extends Element {
438
430
  return this.$base;
439
431
  }
440
432
  else {
441
- const typeElement = schema && (schema.complexTypes[typeName] ||
442
- schema.types[typeName] ||
443
- schema.elements[typeName]);
433
+ const typeElement = schema && (schema.complexTypes[typeName] || schema.types[typeName] || schema.elements[typeName]);
444
434
  if (typeElement) {
445
435
  const base = typeElement.description(definitions, schema.xmlns);
446
436
  desc = typeof base === 'string' ? base : _.defaults(base, desc);
@@ -454,12 +444,7 @@ exports.ExtensionElement = ExtensionElement;
454
444
  class ChoiceElement extends Element {
455
445
  constructor() {
456
446
  super(...arguments);
457
- this.allowedChildren = buildAllowedChildren([
458
- 'any',
459
- 'choice',
460
- 'element',
461
- 'sequence',
462
- ]);
447
+ this.allowedChildren = buildAllowedChildren(['any', 'choice', 'element', 'sequence']);
463
448
  }
464
449
  description(definitions, xmlns) {
465
450
  const choice = {};
@@ -483,15 +468,7 @@ exports.EnumerationElement = EnumerationElement;
483
468
  class ComplexTypeElement extends Element {
484
469
  constructor() {
485
470
  super(...arguments);
486
- this.allowedChildren = buildAllowedChildren([
487
- 'all',
488
- 'annotation',
489
- 'choice',
490
- 'complexContent',
491
- 'sequence',
492
- 'simpleContent',
493
- 'attribute',
494
- ]);
471
+ this.allowedChildren = buildAllowedChildren(['all', 'annotation', 'choice', 'complexContent', 'sequence', 'simpleContent', 'attribute']);
495
472
  }
496
473
  description(definitions, xmlns) {
497
474
  let ret = {};
@@ -503,11 +480,7 @@ class ComplexTypeElement extends Element {
503
480
  $attributes[child.$name] = child.description(definitions);
504
481
  continue;
505
482
  }
506
- if (!isFirstChild && (child instanceof ChoiceElement ||
507
- child instanceof SequenceElement ||
508
- child instanceof AllElement ||
509
- child instanceof SimpleContentElement ||
510
- child instanceof ComplexContentElement)) {
483
+ if (!isFirstChild && (child instanceof ChoiceElement || child instanceof SequenceElement || child instanceof AllElement || child instanceof SimpleContentElement || child instanceof ComplexContentElement)) {
511
484
  isFirstChild = true;
512
485
  ret = child.description(definitions, xmlns);
513
486
  }
@@ -522,10 +495,7 @@ exports.ComplexTypeElement = ComplexTypeElement;
522
495
  class ComplexContentElement extends Element {
523
496
  constructor() {
524
497
  super(...arguments);
525
- this.allowedChildren = buildAllowedChildren([
526
- 'extension',
527
- 'restriction',
528
- ]);
498
+ this.allowedChildren = buildAllowedChildren(['extension', 'restriction']);
529
499
  }
530
500
  description(definitions, xmlns) {
531
501
  for (const child of this.children) {
@@ -540,9 +510,7 @@ exports.ComplexContentElement = ComplexContentElement;
540
510
  class SimpleContentElement extends Element {
541
511
  constructor() {
542
512
  super(...arguments);
543
- this.allowedChildren = buildAllowedChildren([
544
- 'extension',
545
- ]);
513
+ this.allowedChildren = buildAllowedChildren(['extension']);
546
514
  }
547
515
  description(definitions, xmlns) {
548
516
  for (const child of this.children) {
@@ -557,12 +525,7 @@ exports.SimpleContentElement = SimpleContentElement;
557
525
  class SequenceElement extends Element {
558
526
  constructor() {
559
527
  super(...arguments);
560
- this.allowedChildren = buildAllowedChildren([
561
- 'any',
562
- 'choice',
563
- 'element',
564
- 'sequence',
565
- ]);
528
+ this.allowedChildren = buildAllowedChildren(['any', 'choice', 'element', 'sequence']);
566
529
  }
567
530
  description(definitions, xmlns) {
568
531
  const sequence = {};
@@ -580,6 +543,7 @@ class SequenceElement extends Element {
580
543
  }
581
544
  exports.SequenceElement = SequenceElement;
582
545
  class AttributeElement extends Element {
546
+ //eslint-disable-next-line @typescript-eslint/no-unused-vars
583
547
  description(definitions) {
584
548
  return {
585
549
  type: this.$type,
@@ -592,10 +556,7 @@ AttributeElement.Symbol = Symbol('$attributes');
592
556
  class AllElement extends Element {
593
557
  constructor() {
594
558
  super(...arguments);
595
- this.allowedChildren = buildAllowedChildren([
596
- 'choice',
597
- 'element',
598
- ]);
559
+ this.allowedChildren = buildAllowedChildren(['choice', 'element']);
599
560
  }
600
561
  description(definitions, xmlns) {
601
562
  const sequence = {};
@@ -615,10 +576,7 @@ exports.AllElement = AllElement;
615
576
  class MessageElement extends Element {
616
577
  constructor() {
617
578
  super(...arguments);
618
- this.allowedChildren = buildAllowedChildren([
619
- 'part',
620
- 'documentation',
621
- ]);
579
+ this.allowedChildren = buildAllowedChildren(['part', 'documentation']);
622
580
  this.element = null;
623
581
  this.parts = null;
624
582
  }
@@ -659,10 +617,10 @@ class MessageElement extends Element {
659
617
  }
660
618
  // if nested lookup types where found, prepare them for furter usage
661
619
  if (lookupTypes.length > 0) {
662
- lookupTypes = lookupTypes.
663
- join('_').
664
- split('_').
665
- filter(function removeEmptyLookupTypes(type) {
620
+ lookupTypes = lookupTypes
621
+ .join('_')
622
+ .split('_')
623
+ .filter(function removeEmptyLookupTypes(type) {
666
624
  return type !== '^';
667
625
  });
668
626
  const schemaXmlns = definitions.schemas[this.element.targetNamespace].xmlns;
@@ -698,7 +656,8 @@ class MessageElement extends Element {
698
656
  // rpc encoding
699
657
  this.parts = {};
700
658
  delete this.element;
701
- for (let i = 0; part = this.children[i]; i++) {
659
+ for (let i = 0; i < this.children.length; i++) {
660
+ const part = this.children[i];
702
661
  if (part.name === 'documentation') {
703
662
  // <wsdl:documentation can be present under <wsdl:message>
704
663
  continue;
@@ -767,16 +726,16 @@ class MessageElement extends Element {
767
726
  _getNestedLookupTypeString(element) {
768
727
  let resolvedType = '^';
769
728
  const excluded = this.ignoredNamespaces.concat('xs'); // do not process $type values wich start with
770
- if (element.hasOwnProperty('$type') && typeof element.$type === 'string') {
729
+ if (Object.hasOwnProperty.call(element, '$type') && typeof element.$type === 'string') {
771
730
  if (excluded.indexOf(element.$type.split(':')[0]) === -1) {
772
- resolvedType += ('_' + element.$type + '#' + element.$name);
731
+ resolvedType += '_' + element.$type + '#' + element.$name;
773
732
  }
774
733
  }
775
734
  if (element.children.length > 0) {
776
735
  element.children.forEach((child) => {
777
736
  const resolvedChildType = this._getNestedLookupTypeString(child).replace(/\^_/, '');
778
737
  if (resolvedChildType && typeof resolvedChildType === 'string') {
779
- resolvedType += ('_' + resolvedChildType);
738
+ resolvedType += '_' + resolvedChildType;
780
739
  }
781
740
  });
782
741
  }
@@ -790,13 +749,7 @@ exports.DocumentationElement = DocumentationElement;
790
749
  class SchemaElement extends Element {
791
750
  constructor() {
792
751
  super(...arguments);
793
- this.allowedChildren = buildAllowedChildren([
794
- 'complexType',
795
- 'element',
796
- 'import',
797
- 'include',
798
- 'simpleType',
799
- ]);
752
+ this.allowedChildren = buildAllowedChildren(['complexType', 'element', 'import', 'include', 'simpleType']);
800
753
  this.complexTypes = {};
801
754
  this.types = {};
802
755
  this.elements = {};
@@ -810,7 +763,7 @@ class SchemaElement extends Element {
810
763
  _.merge(this.xmlns, source.xmlns);
811
764
  // Merge attributes from source without overwriting our's
812
765
  _.merge(this, _.pickBy(source, (value, key) => {
813
- return key.startsWith('$') && !this.hasOwnProperty(key);
766
+ return key.startsWith('$') && !Object.hasOwnProperty.call(this, key);
814
767
  }));
815
768
  return this;
816
769
  }
@@ -844,25 +797,18 @@ exports.SchemaElement = SchemaElement;
844
797
  class TypesElement extends Element {
845
798
  constructor() {
846
799
  super(...arguments);
847
- this.allowedChildren = buildAllowedChildren([
848
- 'documentation',
849
- 'schema',
850
- ]);
800
+ this.allowedChildren = buildAllowedChildren(['documentation', 'schema']);
851
801
  this.schemas = {};
852
802
  }
853
803
  // fix#325
854
804
  addChild(child) {
855
805
  (0, assert_1.ok)(child instanceof SchemaElement);
856
806
  const childInclude = child.includes.find((e) => {
857
- return e.hasOwnProperty('namespace');
807
+ return Object.hasOwnProperty.call(e, 'namespace');
858
808
  });
859
- const childIncludeNs = ((typeof childInclude !== 'undefined' &&
860
- childInclude.hasOwnProperty('namespace') &&
861
- child instanceof SchemaElement) ?
862
- childInclude.namespace :
863
- undefined);
809
+ const childIncludeNs = typeof childInclude !== 'undefined' && Object.hasOwnProperty.call(childInclude, 'namespace') && child instanceof SchemaElement ? childInclude.namespace : undefined;
864
810
  const targetNamespace = child.$targetNamespace || child.includes[0]?.namespace || childIncludeNs;
865
- if (!this.schemas.hasOwnProperty(targetNamespace)) {
811
+ if (!Object.hasOwnProperty.call(this.schemas, targetNamespace)) {
866
812
  this.schemas[targetNamespace] = child;
867
813
  }
868
814
  else {
@@ -879,13 +825,7 @@ exports.TypesElement = TypesElement;
879
825
  class OperationElement extends Element {
880
826
  constructor() {
881
827
  super(...arguments);
882
- this.allowedChildren = buildAllowedChildren([
883
- 'documentation',
884
- 'fault',
885
- 'input',
886
- 'operation',
887
- 'output',
888
- ]);
828
+ this.allowedChildren = buildAllowedChildren(['documentation', 'fault', 'input', 'operation', 'output']);
889
829
  this.input = null;
890
830
  this.output = null;
891
831
  this.inputSoap = null;
@@ -902,7 +842,8 @@ class OperationElement extends Element {
902
842
  }
903
843
  postProcess(definitions, tag) {
904
844
  const children = this.children;
905
- for (let i = 0, child; child = children[i]; i++) {
845
+ for (let i = 0; i < children.length; i++) {
846
+ const child = children[i];
906
847
  if (child.name !== 'input' && child.name !== 'output') {
907
848
  continue;
908
849
  }
@@ -940,10 +881,7 @@ exports.OperationElement = OperationElement;
940
881
  class PortTypeElement extends Element {
941
882
  constructor() {
942
883
  super(...arguments);
943
- this.allowedChildren = buildAllowedChildren([
944
- 'documentation',
945
- 'operation',
946
- ]);
884
+ this.allowedChildren = buildAllowedChildren(['documentation', 'operation']);
947
885
  this.methods = {};
948
886
  }
949
887
  postProcess(definitions) {
@@ -951,7 +889,8 @@ class PortTypeElement extends Element {
951
889
  if (typeof children === 'undefined') {
952
890
  return;
953
891
  }
954
- for (let i = 0, child; child = children[i]; i++) {
892
+ for (let i = 0; i < children.length; i++) {
893
+ const child = children[i];
955
894
  if (child.name !== 'operation') {
956
895
  continue;
957
896
  }
@@ -975,12 +914,7 @@ exports.PortTypeElement = PortTypeElement;
975
914
  class BindingElement extends Element {
976
915
  constructor() {
977
916
  super(...arguments);
978
- this.allowedChildren = buildAllowedChildren([
979
- 'binding',
980
- 'documentation',
981
- 'operation',
982
- 'SecuritySpec',
983
- ]);
917
+ this.allowedChildren = buildAllowedChildren(['binding', 'documentation', 'operation', 'SecuritySpec']);
984
918
  this.transport = '';
985
919
  this.style = '';
986
920
  this.methods = {};
@@ -1000,21 +934,25 @@ class BindingElement extends Element {
1000
934
  if (portType) {
1001
935
  portType.postProcess(definitions);
1002
936
  this.methods = portType.methods;
1003
- for (let i = 0, child; child = children[i]; i++) {
937
+ for (let i = 0; i < children.length; i++) {
938
+ const child = children[i];
1004
939
  if (child.name !== 'operation') {
1005
940
  continue;
1006
941
  }
1007
942
  child.postProcess(definitions, 'binding');
1008
943
  children.splice(i--, 1);
1009
- child.style || (child.style = style);
944
+ if (!child.style)
945
+ child.style = style;
1010
946
  const method = this.methods[child.$name];
1011
947
  if (method) {
1012
948
  method.style = child.style;
1013
949
  method.soapAction = child.soapAction;
1014
950
  method.inputSoap = child.input || null;
1015
951
  method.outputSoap = child.output || null;
1016
- method.inputSoap && method.inputSoap.deleteFixedAttrs();
1017
- method.outputSoap && method.outputSoap.deleteFixedAttrs();
952
+ if (method.inputSoap)
953
+ method.inputSoap.deleteFixedAttrs();
954
+ if (method.outputSoap)
955
+ method.outputSoap.deleteFixedAttrs();
1018
956
  }
1019
957
  }
1020
958
  }
@@ -1035,14 +973,11 @@ exports.BindingElement = BindingElement;
1035
973
  class PortElement extends Element {
1036
974
  constructor() {
1037
975
  super(...arguments);
1038
- this.allowedChildren = buildAllowedChildren([
1039
- 'address',
1040
- 'documentation',
1041
- ]);
976
+ this.allowedChildren = buildAllowedChildren(['address', 'documentation']);
1042
977
  this.location = null;
1043
978
  }
1044
979
  addChild(child) {
1045
- if (child.name === 'address' && typeof (child.$location) !== 'undefined') {
980
+ if (child.name === 'address' && typeof child.$location !== 'undefined') {
1046
981
  this.location = child.$location;
1047
982
  }
1048
983
  }
@@ -1051,17 +986,15 @@ exports.PortElement = PortElement;
1051
986
  class ServiceElement extends Element {
1052
987
  constructor() {
1053
988
  super(...arguments);
1054
- this.allowedChildren = buildAllowedChildren([
1055
- 'documentation',
1056
- 'port',
1057
- ]);
989
+ this.allowedChildren = buildAllowedChildren(['documentation', 'port']);
1058
990
  this.ports = {};
1059
991
  }
1060
992
  postProcess(definitions) {
1061
993
  const children = this.children;
1062
994
  const bindings = definitions.bindings;
1063
995
  if (children && children.length > 0) {
1064
- for (let i = 0, child; child = children[i]; i++) {
996
+ for (let i = 0; i < children.length; i++) {
997
+ const child = children[i];
1065
998
  if (child.name !== 'port') {
1066
999
  continue;
1067
1000
  }
@@ -1093,15 +1026,7 @@ exports.ServiceElement = ServiceElement;
1093
1026
  class DefinitionsElement extends Element {
1094
1027
  constructor() {
1095
1028
  super(...arguments);
1096
- this.allowedChildren = buildAllowedChildren([
1097
- 'binding',
1098
- 'documentation',
1099
- 'import',
1100
- 'message',
1101
- 'portType',
1102
- 'service',
1103
- 'types',
1104
- ]);
1029
+ this.allowedChildren = buildAllowedChildren(['binding', 'documentation', 'import', 'message', 'portType', 'service', 'types']);
1105
1030
  this.messages = {};
1106
1031
  this.portTypes = {};
1107
1032
  this.bindings = {};
@@ -1135,16 +1060,13 @@ class DefinitionsElement extends Element {
1135
1060
  this.portTypes[child.$name] = child;
1136
1061
  }
1137
1062
  else if (child instanceof BindingElement) {
1138
- if (child.transport === 'http://schemas.xmlsoap.org/soap/http' ||
1139
- child.transport === 'http://www.w3.org/2003/05/soap/bindings/HTTP/') {
1063
+ if (child.transport === 'http://schemas.xmlsoap.org/soap/http' || child.transport === 'http://www.w3.org/2003/05/soap/bindings/HTTP/') {
1140
1064
  this.bindings[child.$name] = child;
1141
1065
  }
1142
1066
  }
1143
1067
  else if (child instanceof ServiceElement) {
1144
1068
  this.services[child.$name] = child;
1145
1069
  }
1146
- else if (child instanceof DocumentationElement) {
1147
- }
1148
1070
  this.children.pop();
1149
1071
  }
1150
1072
  }