问题描述
我正在使用symfony2应用程序中的内置SOAP服务器,并且除了处理StdClass-Object外,我还需要读取接收到的完整xml进行调试和记录.有没有一种方法可以简单地捕获已传输的xml?它应该在请求标头中的某处,但是我根本找不到它.
I'm using the build-in SOAP-Server within a symfony2 application and beside handling the StdClass-Object, I would need to read the complete xml received for debugging and logging. Is there a way to simply catch the transferred xml? It should be somewhere in the request header, but I simply can't find it there.
推荐答案
我一直在寻找相同的东西,最终找到了它.希望这对您或其他人有帮助.
I was looking for the same thing and finally found it. Hope this helps you or someone else.
$postdata = file_get_contents("php://input");
$postdata
变量将具有原始XML.通过以下两个链接找到:
The $postdata
variable will have the raw XML. Found through the following two links:
http://php.net/manual/en/reserved.variables. httprawpostdata.php
http://php.net/manual/en/soapserver.soapserver.php
这篇关于从PHP SOAP服务器获取XML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!