Get received XML from PHP SOAP Server(从 PHP SOAP 服务器获取接收到的 XML)
问题描述
我在 symfony2 应用程序中使用内置的 SOAP-Server,除了处理 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:从 PHP SOAP 服务器获取接收到的 XML


基础教程推荐
- 如何替换eregi() 2022-01-01
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
- 在PHP中根据W3C规范Unicode 2022-01-01
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01