Parsing SOAP response via WSDL/SoapServer

一世执手 提交于 2019-12-13 15:59:32

问题


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):


回答1:


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.



来源:https://stackoverflow.com/questions/10835336/parsing-soap-response-via-wsdl-soapserver

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!