Debugging a PHP XMLRPC Service with Xdebug and Curl

Standard

curl -i -X POST \
   -H "Content-Type:application/xml" \
   -d \
'<?xml version="1.0"?>
<methodCall>
<methodName>sample.sumAndDifference</methodName>
<params>
<param><value><int>1</int></value></param>
<param><value><int>2</int></value></param>
</params>
</methodCall>' \
 'http://localhost/xmlrpc_server.php?XDEBUG_SESSION_START=sublime.xdebug'

xmlrpc_server.php

<?xml version="1.0"?>
<methodResponse>
<params>
<param>
<value><struct>
<member><name>sum</name>
<value><int>3</int></value>
</member>
<member><name>difference</name>
<value><int>-1</int></value>
</member>
</struct></value>
</param>
</params>
</methodResponse>

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.