From 0de3de9c009018db3b9922c084d6419c32cac5f5 Mon Sep 17 00:00:00 2001 From: Luciano Fantone Date: Tue, 8 Aug 2017 13:32:14 -0300 Subject: [PATCH 1/2] Lookup definitions in child element first --- lib/wsdl.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/wsdl.js b/lib/wsdl.js index e3d170bcc..ddd69f66f 100644 --- a/lib/wsdl.js +++ b/lib/wsdl.js @@ -2048,7 +2048,7 @@ WSDL.prototype.findChildSchemaObject = function(parameterTypeObj, childName, bac if (child.$base) { var baseQName = splitQName(child.$base); var childNameSpace = baseQName.prefix === TNS_PREFIX ? '' : baseQName.prefix; - childNsURI = this.definitions.xmlns[baseQName.prefix]; + childNsURI = child.xmlns[baseQName.prefix] || this.definitions.xmlns[baseQName.prefix]; var foundBase = this.findSchemaType(baseQName.name, childNsURI); From 201e4cf45db1c64ea8fac20e898cd66fa6c3f019 Mon Sep 17 00:00:00 2001 From: Christian Musa Date: Mon, 30 Oct 2017 09:42:14 -0300 Subject: [PATCH 2/2] Add request/response test for child fix --- .../childs/childxs0.wsdl | 18 ++ .../childs/childxs3.wsdl | 31 ++++ .../childs/childxs7.wsdl | 160 ++++++++++++++++++ .../childs/childxs9.wsdl | 14 ++ .../request.json | 45 +++++ .../request.xml | 60 +++++++ .../response.json | 24 +++ .../response.xml | 30 ++++ .../soap.wsdl | 42 +++++ 9 files changed, 424 insertions(+) create mode 100644 test/request-response-samples/RetrieveFareQuoteDateRange__should_handle_child_namespaces/childs/childxs0.wsdl create mode 100644 test/request-response-samples/RetrieveFareQuoteDateRange__should_handle_child_namespaces/childs/childxs3.wsdl create mode 100644 test/request-response-samples/RetrieveFareQuoteDateRange__should_handle_child_namespaces/childs/childxs7.wsdl create mode 100644 test/request-response-samples/RetrieveFareQuoteDateRange__should_handle_child_namespaces/childs/childxs9.wsdl create mode 100644 test/request-response-samples/RetrieveFareQuoteDateRange__should_handle_child_namespaces/request.json create mode 100644 test/request-response-samples/RetrieveFareQuoteDateRange__should_handle_child_namespaces/request.xml create mode 100644 test/request-response-samples/RetrieveFareQuoteDateRange__should_handle_child_namespaces/response.json create mode 100644 test/request-response-samples/RetrieveFareQuoteDateRange__should_handle_child_namespaces/response.xml create mode 100644 test/request-response-samples/RetrieveFareQuoteDateRange__should_handle_child_namespaces/soap.wsdl diff --git a/test/request-response-samples/RetrieveFareQuoteDateRange__should_handle_child_namespaces/childs/childxs0.wsdl b/test/request-response-samples/RetrieveFareQuoteDateRange__should_handle_child_namespaces/childs/childxs0.wsdl new file mode 100644 index 000000000..1739eff8a --- /dev/null +++ b/test/request-response-samples/RetrieveFareQuoteDateRange__should_handle_child_namespaces/childs/childxs0.wsdl @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + diff --git a/test/request-response-samples/RetrieveFareQuoteDateRange__should_handle_child_namespaces/childs/childxs3.wsdl b/test/request-response-samples/RetrieveFareQuoteDateRange__should_handle_child_namespaces/childs/childxs3.wsdl new file mode 100644 index 000000000..8a544e891 --- /dev/null +++ b/test/request-response-samples/RetrieveFareQuoteDateRange__should_handle_child_namespaces/childs/childxs3.wsdl @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/request-response-samples/RetrieveFareQuoteDateRange__should_handle_child_namespaces/childs/childxs7.wsdl b/test/request-response-samples/RetrieveFareQuoteDateRange__should_handle_child_namespaces/childs/childxs7.wsdl new file mode 100644 index 000000000..fd3f0a4c5 --- /dev/null +++ b/test/request-response-samples/RetrieveFareQuoteDateRange__should_handle_child_namespaces/childs/childxs7.wsdl @@ -0,0 +1,160 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/request-response-samples/RetrieveFareQuoteDateRange__should_handle_child_namespaces/childs/childxs9.wsdl b/test/request-response-samples/RetrieveFareQuoteDateRange__should_handle_child_namespaces/childs/childxs9.wsdl new file mode 100644 index 000000000..f48af89da --- /dev/null +++ b/test/request-response-samples/RetrieveFareQuoteDateRange__should_handle_child_namespaces/childs/childxs9.wsdl @@ -0,0 +1,14 @@ + + + + + + + + + + + + diff --git a/test/request-response-samples/RetrieveFareQuoteDateRange__should_handle_child_namespaces/request.json b/test/request-response-samples/RetrieveFareQuoteDateRange__should_handle_child_namespaces/request.json new file mode 100644 index 000000000..faa4f51c7 --- /dev/null +++ b/test/request-response-samples/RetrieveFareQuoteDateRange__should_handle_child_namespaces/request.json @@ -0,0 +1,45 @@ +{ + "RetrieveFareQuoteDateRangeRequest": { + "CarrierCodes": { + "CarrierCode": { "AccessibleCarrierCode": "DUMMY" } + }, + "ClientIPAddress": "?", + "HistoricUserName": "?", + "CurrencyOfFareQuote": "ARS", + "PromotionalCode": null, + "IataNumberOfRequestor": null, + "CorporationID": 1, + "FareFilterMethod": "NoComb", + "FareGroupMethod": "FareType", + "InventoryFilterMethod": "Available", + "FareQuoteDetails": { + "FareQuoteDetailDateRange": [ + { + "Origin": "A", + "Destination": "B", + "UseAirportsNotMetroGroups": "false", + "UseAirportsNotMetroGroupsAsRule": "false", + "UseAirportsNotMetroGroupsForFrom": "false", + "UseAirportsNotMetroGroupsForTo": "false", + "DateOfDepartureStart": "2017-10-27", + "DateOfDepartureEnd": "2017-10-27", + "FareTypeCategory": 1, + "FareClass": null, + "FareBasisCode": null, + "Cabin": null, + "LFID": 0, + "OperatingCarrierCode": null, + "MarketingCarrierCode": null, + "LanguageCode": "en", + "TicketPackageID": 1, + "FareQuoteRequestInfos": { + "FareQuoteRequestInfo": { + "PassengerTypeID": 1, + "TotalSeatsRequired": 1 + } + } + } + ] + } + } +} diff --git a/test/request-response-samples/RetrieveFareQuoteDateRange__should_handle_child_namespaces/request.xml b/test/request-response-samples/RetrieveFareQuoteDateRange__should_handle_child_namespaces/request.xml new file mode 100644 index 000000000..f07a172ef --- /dev/null +++ b/test/request-response-samples/RetrieveFareQuoteDateRange__should_handle_child_namespaces/request.xml @@ -0,0 +1,60 @@ + + + + + + + + DUMMY + + + ? + ? + ARS + + + 1 + NoComb + FareType + Available + + + A + B + false + false + false + false + 2017-10-27 + 2017-10-27 + 1 + + + + 0 + + + en + 1 + + + 1 + 1 + + + + + + + + \ No newline at end of file diff --git a/test/request-response-samples/RetrieveFareQuoteDateRange__should_handle_child_namespaces/response.json b/test/request-response-samples/RetrieveFareQuoteDateRange__should_handle_child_namespaces/response.json new file mode 100644 index 000000000..f1e39e115 --- /dev/null +++ b/test/request-response-samples/RetrieveFareQuoteDateRange__should_handle_child_namespaces/response.json @@ -0,0 +1,24 @@ +{ + "RetrieveFareQuoteDateRangeResult": { + "CommissionIncluded": "false", + "Exceptions": { + "ExceptionInformation.Exception": { + "ExceptionCode": "0", + "ExceptionDescription": "Successful Transaction", + "ExceptionSource": "RetrieveFareQuoteDateRange", + "ExceptionLevel": "Success" + } + }, + "FlightSegments": null, + "LegDetails": null, + "RequestedCorporationID": "0", + "RequestedCurrencyOfFareQuote": "ARS", + "RequestedFareFilterMethod": "102", + "RequestedGroupMethod": "0", + "RequestedIataNumber": null, + "RequestedInventoryFilterMethod": "0", + "RequestedReservationChannel": "8", + "SegmentDetails": null, + "TaxDetails": null + } +} diff --git a/test/request-response-samples/RetrieveFareQuoteDateRange__should_handle_child_namespaces/response.xml b/test/request-response-samples/RetrieveFareQuoteDateRange__should_handle_child_namespaces/response.xml new file mode 100644 index 000000000..2e4c3cbb8 --- /dev/null +++ b/test/request-response-samples/RetrieveFareQuoteDateRange__should_handle_child_namespaces/response.xml @@ -0,0 +1,30 @@ + + + + + false + + + 0 + Successful Transaction + RetrieveFareQuoteDateRange + Success + + + + + 0 + ARS + 102 + 0 + + 0 + + 8 + + + + + + \ No newline at end of file diff --git a/test/request-response-samples/RetrieveFareQuoteDateRange__should_handle_child_namespaces/soap.wsdl b/test/request-response-samples/RetrieveFareQuoteDateRange__should_handle_child_namespaces/soap.wsdl new file mode 100644 index 000000000..e367a2b6f --- /dev/null +++ b/test/request-response-samples/RetrieveFareQuoteDateRange__should_handle_child_namespaces/soap.wsdl @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +