Holiday web service

POST http://www.holidaywebservice.com/HolidayService_v2/HolidayService2.asmx

Under the Tests tab, I can use the pm.* APIs allowing me access to the response body. In this example, let's parse some information from the response body formatted as XML and transform it to JSON, and then save this information as an environment variable so we can access this info in a subsequent request.

To work with XML more easily, the Qodex sandbox let's us use the xml2js package, a simple XML to JavaScript object converter.

HEADERS

KeyDatatypeRequiredDescription
Content-Typestring

RESPONSES

status: OK

"\u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n\u003csoap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\u003e\n    \u003csoap:Body\u003e\n        \u003cGetHolidaysForMonthResponse xmlns=\"http://www.holidaywebservice.com/HolidayService_v2/\"\u003e\n            \u003cGetHolidaysForMonthResult\u003e\n                \u003cHoliday\u003e\n                    \u003cCountry\u003eUnitedStates\u003c/Country\u003e\n                    \u003cHolidayCode\u003eVETERANS-DAY-ACTUAL\u003c/HolidayCode\u003e\n                    \u003cDescriptor\u003eVeteran's Day\u003c/Descriptor\u003e\n                    \u003cHolidayType\u003eNotable\u003c/HolidayType\u003e\n                    \u003cDateType\u003eActual\u003c/DateType\u003e\n                    \u003cBankHoliday\u003eNotRecognized\u003c/BankHoliday\u003e\n                    \u003cDate\u003e2019-11-11T00:00:00\u003c/Date\u003e\n                    \u003cRelatedHolidayCode\u003eVETERANS-DAY-OBSERVED\u003c/RelatedHolidayCode\u003e\n                \u003c/Holiday\u003e\n                \u003cHoliday\u003e\n                    \u003cCountry\u003eUnitedStates\u003c/Country\u003e\n                    \u003cHolidayCode\u003eVETERANS-DAY-OBSERVED\u003c/HolidayCode\u003e\n                    \u003cDescriptor\u003eVeteran's Day\u003c/Descriptor\u003e\n                    \u003cHolidayType\u003eNotable\u003c/HolidayType\u003e\n                    \u003cDateType\u003eObserved\u003c/DateType\u003e\n                    \u003cBankHoliday\u003eRecognized\u003c/BankHoliday\u003e\n                    \u003cDate\u003e2019-11-11T00:00:00\u003c/Date\u003e\n                    \u003cRelatedHolidayCode\u003eVETERANS-DAY-ACTUAL\u003c/RelatedHolidayCode\u003e\n                \u003c/Holiday\u003e\n                \u003cHoliday\u003e\n                    \u003cCountry\u003eUnitedStates\u003c/Country\u003e\n                    \u003cHolidayCode\u003eTHANKSGIVING\u003c/HolidayCode\u003e\n                    \u003cDescriptor\u003eThanksgiving\u003c/Descriptor\u003e\n                    \u003cHolidayType\u003eOther\u003c/HolidayType\u003e\n                    \u003cDateType\u003eObservedActual\u003c/DateType\u003e\n                    \u003cBankHoliday\u003eRecognized\u003c/BankHoliday\u003e\n                    \u003cDate\u003e2019-11-28T00:00:00\u003c/Date\u003e\n                \u003c/Holiday\u003e\n                \u003cHoliday\u003e\n                    \u003cCountry\u003eUnitedStates\u003c/Country\u003e\n                    \u003cHolidayCode\u003eBLACK-FRIDAY\u003c/HolidayCode\u003e\n                    \u003cDescriptor\u003eBlack Friday\u003c/Descriptor\u003e\n                    \u003cHolidayType\u003eOther\u003c/HolidayType\u003e\n                    \u003cDateType\u003eObservedActual\u003c/DateType\u003e\n                    \u003cBankHoliday\u003eNotRecognized\u003c/BankHoliday\u003e\n                    \u003cDate\u003e2019-11-29T00:00:00\u003c/Date\u003e\n                \u003c/Holiday\u003e\n            \u003c/GetHolidaysForMonthResult\u003e\n        \u003c/GetHolidaysForMonthResponse\u003e\n    \u003c/soap:Body\u003e\n\u003c/soap:Envelope\u003e"