Receiving data from SAP Web Application Server over HTTPS

痞子三分冷 提交于 2019-12-24 15:09:55

问题


I am trying to receive xml idoc data I from a 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 the SAP is trying to send me something because I am getting an 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 loges this 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?


回答1:


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




回答2:


Thought the problem is not very clear but can you please let me know how are you connecting SAP 7.1 system with PHP.

First of all, what need to do on the SAP side to expose a Remote Function Module which can be accessed via RFC. All you need to do is to create a ‘remote-enabled’ Function Module in SAP. This can be done by ticking ‘Remote-enabled module’ under the function module’s attributes. You can write whatever program logic in ABAP in the Function Module. Pay special attention to the Importing and Exporting parameters of the Function Module as these will be what are passed to and from your PHP program.



来源:https://stackoverflow.com/questions/13969416/receiving-data-from-sap-web-application-server-over-https

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!