我需要接受包含一些数据的不可修改的 SOAP 消息。它被发布到我的 WSDL 文件,然后是 PHP SoapServer。如何通过 wsdl 或 php 提取消息中的特定数据(封装在 xml 键中)?
Data flow (actions are arrows, with the second arrow originating from the SoapServer.php bubble and receiving a response):
事实证明,做我正在寻找的事情的最好方法就是file_get_contents("php://input")
.
这是通过监听 POST 来触发脚本的简单方法。我只是将服务的 webhook url 指向脚本,file_get_contents("php://input")
,投射到array
, 进而simplexml_load_string()
解析它并使用其中一个键的数据作为我的脚本的参数。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)