Debugging SOAP with Xdebug and Eclipse

It's been a while since I've worked on a project which is providing as well as consuming web services.

In this case I need to debug incoming requests that are not initiated from with the browser (I'm using soapui as a test tool).

In order to allow Eclipse to pick up xdebug responses triggered by requests from soapui I just needed to

  • start a debuging session within eclipse as normal
  • ensure that the query string ?XDEBUG_SESSION_START=ECLIPSE_DBGP is appended to all requests by editing the WSDL file so that the address looks like

Read more

Debugging drush updb

If you've ever tried to debug your update hooks via drush you may (like me) have been puzzled as to why your breakpoints don't seem to work.

It seems that proc_open() is used to avoid memory issues http://drupal.org/node/687724 (effectively resetting all the Drupal static variables??) and this separate process isn't available to the debugger.

After stepping though the drush update process I found where this happens and have a bypass that is basically functional (drush reporting seems broken - but I can step through my code).

This patch is the change I've made.

Read more

xdebug and Eclipse

xdebug is an immensely powerful tool for exploring what your code really does.

You can get a long way using print_r  but ultimately this always requires that you predict the path your code will take - and the tricky bit about debugging is you need it when your predications have gone wrong.

It's generally pretty easy to set up

Read more