Parsing SOAP response via WSDL/SoapServer

2019-07-13 22:44发布

I need to accept an unmodifiable SOAP message that includes some data. It is posted to my WSDL file and then PHP SoapServer. How can I extract specific data (wrapped in an xml key) in the message via my wsdl or php?

Data flow (actions are arrows, with the second arrow originating from the SoapServer.php bubble and receiving a response): Data flow (actions are arrows, with the second arrow originating from the SoapServer.php bubble and receiving a response)

1条回答
走好不送
2楼-- · 2019-07-13 23:32

Turns out that the best way to do what I'm looking for is simply file_get_contents("php://input").

This is an easy way to trigger scripts by listening for POSTs. I simply point a service's webhook url to the script, which file_get_contents("php://input"), cast to an array, and then simplexml_load_string() to parse it and use one of the keys' data as the parameter for my script.

查看更多
登录 后发表回答