通过WSDL / SoapServer解析SOAP响应

时间:2012-05-31 14:11:38

标签: php web-services soap wsdl soapserver

我需要接受包含一些数据的不可修改的SOAP消息。它发布到我的WSDL文件,然后发布到PHP SoapServer。如何通过我的wsdl或php提取消息中的特定数据(包含在xml密钥中)?

数据流(操作是箭头,第二个箭头来自SoapServer.php气泡并接收响应): Data flow (actions are arrows, with the second arrow originating from the SoapServer.php bubble and receiving a response)

1 个答案:

答案 0 :(得分:2)

事实证明,做我正在寻找的最好的方法就是file_get_contents("php://input")

这是通过侦听POST来触发脚本的简单方法。我只是将服务的webhook网址指向脚本,file_get_contents("php://input")转换为array,然后simplexml_load_string()解析它并使用其中一个键的数据作为我的参数脚本。