phphttpidoc

Receiving data from SAP Web Application Server over HTTPS


I am trying to receive XML IDoc data from an SAP system. It should get push to me over HTTPS but something is not working. I gave out a SSL certificate and the IP address of the server. I can see that the SAP system is trying to send me something because I am getting a call from Agent: SAP Web Application Server (1.0;701) but no data is transmitted in GET, POST or FILE.

The SAP system is controlled by someone else. They got this working with some other server so I assume it must be my fault.

Currently my script logs these values:

serialize($_GET),
serialize($_POST),
serialize($_FILES), 
$_SERVER['REMOTE_ADDR'], 
$_SERVER['HTTP_USER_AGENT'], 
serialize(apache_request_headers())

Header tells me:

content-type: text/xml
content-length: 76702

but I am not getting any content.

What I am doing wrong? How could I dig into this?


Solution

  • Solution is to read HTTP body directly from file_get_contents("php://input"). The data has no variable so it's not getting parsed into any $_POST variable:

    <?xml version="1.0" encoding="UTF-8"?><ZSHPMNT05>...
    

    See: http://php.net/manual/en/reserved.variables.httprawpostdata.php