Hi DW community.
I had an unusuall fix made the other day for one service and wanted to find out exacly what happened. The situation was the following:
For this one specific ADS channel, the communication works this way:
The hotel reservation is sent via $_POST['RES_DATA'] , and after the reservation is parsed, we need to send (echo ) the simple xml response including echo token sent in the reservation xml with PROCESSED value, in order to confirm the that we have received the reservation.
If the response is not sent towards the server that is sending the reservation it would try every hour to resend that reservation until the proper response is sent.
Now the situation was following:
If the reservation was sucesfully parsed, my script would echo the response end then end. It would end normally, no exit, dies or stuff, just plain end of the function.
In case the reservation is faulty. For example, I first check the hotel code for the received reservation, and if we don't have it, we also echo the response, but immediately after it, I put die() ,so I finish the script.
To summ up the problem, server on the other side is waiting for my XML. When the XML is sent and script end, the server accepts the response normally and the reservation is not re-sent.
In other situation, when I echo the xml and put die() immediately after it,the server doesn't "approve" my response, and starts resending the reservation as if I didn't send the proper response.
In case when there is die() after echoing the response I have checked that the xml is correct ( it is ) and that there is no output sent besides the needed xml.
When I fixed the code logically, making my script end normally istead of die() , the responses are approved normally.
The only thing I could think of that caused the problem is exit status which is sent on die() versus normal script ending.
As far as I know, the both exit statuses for die() and normal script ending is 0, ( no errors ).
Please correct me if I am wrong :)
Thank you,
Toni