Question

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)

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top