Travelport-Ukraine / uapi-json

Best Travelport Universal API wrapper ever :airplane: :mountain_railway: :hotel:
https://travelport-ukraine.github.io/uapi-json/
MIT License
74 stars 61 forks source link

How do I log raw XMLs for certification purposes? #654

Closed skills-up closed 3 months ago

skills-up commented 3 months ago

I'm planning to use this wrapper for the new version of my travel booking app, which currently uses SOAP via WSDL.

One of the certification requirements by Travelport is to submit XML logs for specified actions. Is this wrapper capable of generating raw XML logs? Or are there any methods available to get XML strings so that I can save them to a file myself?

dchertousov commented 3 months ago

Hi @skills-up !

There are some options for that.

First, there is setting.debug: number parameter, that will ensure debugging of many data including XML requests and responses as described here. It is enough to set it to 1 to get requests and responses logged.

By default, requests and responses will be logged with default logger, which is console.log.

If you want to change this behaviour, you may pass your own log function in settings.options.logFunction. All the requests start with Request XML: prefix and all the responses with Response SOAP:. With your own logger, you may filter only requests and responses and log only them.