Debugging a SOAP service using xDebug

删除回忆录丶 提交于 2019-12-10 12:54:20

问题


Is there a way to debug a SOAP service that we publish ideally with integration into an IDE allowing me to step through the code.


回答1:


With a bit of inspiration from this article I've come up with a solution that allows me to call the service from SoapUI and step through the code in my IDE (PhpStorm).

The key is to alter a part of the WSDL that gets generated, in particular the <soap:address> node. This has a location attribute to which I append ?XDEBUG_SESSION_START=netbeans-xdebug. Clearly the netbeans-xdebug needs to be whatever IDE Key you have set up with you debugging environment.

I do this by capturing the WSDL before it is rendered and performing a preg_replace().

$wsdl = preg_replace('|soap:address location="(.*?)"|','soap:address location="$1' . $ide_key . '"', $wsdl );


来源:https://stackoverflow.com/questions/20423317/debugging-a-soap-service-using-xdebug

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