phpxmlrequestcxml-commercexml

Catch CXML-Urlencoded with PHP. Not POST or GET


Is there other ways to receive a form other than POST, GET, COOKIE, SESSION and RAW?

I explain: I'm trying to implement cXML Punchout with PHP but it seems that I'm not receiving the information as is usually sent. I try to catch it with PHP, GET, POST and even as raw:

file_get_contents('php://input')

But I don't catch any var.

I found a URL to send a dummy request to my program: https://punchoutcommerce.com/tools/cxml-punchout-tester

If I send a request my program (https://serlimax.com/api) it does not register anything in my logs, but I see there were a CXML-Urlencoded sent using browser tools.

what I see with browser tools

How do I catch that that info I see?

PS: If you want to see it by yourself in the browser you can send any info but an existing URL, otherwise it'll send a 404 error. what to send

PS2: If you're wondering how do I know I'm not receiving anything, this is how I log the received info:

ob_flush();
ob_start();
echo "User: - ". $_SERVER['HTTP_USER_AGENT']. ' - IP:'. $_SERVER['REMOTE_ADDR'].' - METHOD:'.$_SERVER['REQUEST_METHOD'].PHP_EOL;
echo 'POST:---------'.PHP_EOL;
var_dump($_POST);
echo 'GET:---------'.PHP_EOL;
var_dump($_GET);
echo 'RAW:---------'.PHP_EOL;
echo file_get_contents('php://input');
file_put_contents('./punchout_log_'.date("j.n.Y.H.i.s").'.txt', ob_get_flush());

Resulting in an empty log: enter image description here


Solution

  • Well it was out of my knowledge but it was due to be using https://url/api/, instead of https://url/api/index.php

    The laking of "index.php" caused a redirection which avoid the catching of php://input