<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>anty.info &#187; debugging</title>
	<atom:link href="http://www.anty.info/tag/debugging/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.anty.info</link>
	<description>Comments and help on web development.</description>
	<lastBuildDate>Fri, 11 Jun 2010 14:50:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Server-side SOAP debugging in PHP</title>
		<link>http://www.anty.info/2008/08/30/server-side-soap-debugging-in-php/</link>
		<comments>http://www.anty.info/2008/08/30/server-side-soap-debugging-in-php/#comments</comments>
		<pubDate>Sat, 30 Aug 2008 12:59:05 +0000</pubDate>
		<dc:creator>anty</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[soap]]></category>

		<guid isPermaLink="false">http://www.anty.info/?p=51</guid>
		<description><![CDATA[Debugging SOAP in PHP can be really time intensive. I found the best practice debugging SOAP is using a log file. I use this code to catch exceptions in the server implementation: $logfilePath = '/path/to/your/logfile.txt'; $debug = true; require_once('Zend/Log.php'); require_once('Zend/Log/Writer/Stream.php'); $writer = new Zend_Log_Writer_Stream(fopen($logfilePath, 'a', false)); $logger = new Zend_Log($writer); try { require_once('MySoapClass.php'); if ($debug) [...]]]></description>
			<content:encoded><![CDATA[<p>Debugging SOAP in PHP can be really time intensive.</p>
<p>I found the best practice debugging SOAP is using a log file. I use this code to catch exceptions in the server implementation:</p>
<p><span id="more-51"></span></p>
<p><code class="prettyprint">$logfilePath = '/path/to/your/logfile.txt';
$debug = true;

require_once('Zend/Log.php');
require_once('Zend/Log/Writer/Stream.php');
$writer = new Zend_Log_Writer_Stream(fopen($logfilePath, 'a', false));
$logger = new Zend_Log($writer);
try {
require_once('MySoapClass.php');
if ($debug) {
ini_set(&quot;soap.wsdl_cache_enabled&quot;, &quot;0&quot;);
}
$server = new SoapServer($wsdl_url);
$server-&gt;setClass('MySoapClass');
$server-&gt;handle();
} catch (Exception $exception) {
if ($debug) {
$logger-&gt;err($exception);
}
throw new SoapFault('MySoapServer', $exception);
}</code></p>
<p>I&#8217;m using <a href="http://framework.zend.com/manual/en/zend.log.html">Zend_Log</a> for the logging part, but you should get the idea.</p>
<p>For faster feedback I&#8217;m tailing the logfile (tail -f /path/to/your/logfile.txt) and use my usual SOAP client to do the requests.</p>
<p>This debugging technique is useful if you get errors like &#8220;looks like we got no XML document&#8221; on the client side.</p>
<p>How do <em>you</em> debug server-side SOAP code?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.anty.info/2008/08/30/server-side-soap-debugging-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
