amabnl / amadeus-ws-client

PHP Amadeus SOAP Web Service client library
Apache License 2.0
178 stars 191 forks source link

Getting the outgoing XML message #37

Closed ghost closed 7 years ago

ghost commented 7 years ago

Hello all,

I need to get the outgoing XML message for every request that is send to the Amadeus API. I am able to gather the incoming XML message from the aforementioned API (using $response->responseXml) but I wasn't able to locate a similar functionality for getting the request XML. Is it possible to get that XML without using a workaround with loggers?

DerMika commented 7 years ago

Sure, you can do this by providing a logger object on instantiation. This is explained in the docs here.

Ok, I just read you want a workaround without loggers. The client also exposes methods getLastRequest() and getLastResponse() to get the request and response string from the last message sent. See here in the client's code

ghost commented 7 years ago

Thank you! I didn't realise that was hidden in the client class. I will update you if I happen to have any further problems.

DerMika commented 7 years ago

Added this information to the How-to docs: https://github.com/amabnl/amadeus-ws-client/blob/master/docs/how-to.rst#getting-individual-requests-and-responses