<?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>equivocal ramblings &#187; Lazy Web</title>
	<atom:link href="http://www.kevinfrancis.net/journal/category/lazy-web/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kevinfrancis.net/journal</link>
	<description>the occasional journal of kevin francis</description>
	<lastBuildDate>Wed, 27 Jul 2011 08:07:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Building a SOAP Server with Zend_Soap_Server and Returning Arrays of ComplexTypes</title>
		<link>http://www.kevinfrancis.net/journal/2011/06/building-a-soap-server-with-zend_soap_server-and-returning-arrays-of-complextypes/</link>
		<comments>http://www.kevinfrancis.net/journal/2011/06/building-a-soap-server-with-zend_soap_server-and-returning-arrays-of-complextypes/#comments</comments>
		<pubDate>Tue, 14 Jun 2011 04:23:01 +0000</pubDate>
		<dc:creator>Kevin Francis</dc:creator>
				<category><![CDATA[Brilliance]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Lazy Web]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.kevinfrancis.net/journal/?p=242</guid>
		<description><![CDATA[ZendFramework is awesome but suffers from a peculiar lack of thorough examples and documentation. To save you all some time scouring the internet fruitlessly, I will document how to use Zend_Soap_Server, and Zend_Soap_AutoDiscover in combination with Zend_Soap_Wsdl_Strategy_ArrayOfTypeComplex (try saying that &#8230; <a href="http://www.kevinfrancis.net/journal/2011/06/building-a-soap-server-with-zend_soap_server-and-returning-arrays-of-complextypes/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>ZendFramework is awesome but suffers from a peculiar lack of thorough examples and documentation.</p>

<p>To save you all some time scouring the internet fruitlessly, I will document how to use <code>Zend_Soap_Server</code>, and <code>Zend_Soap_AutoDiscover</code> in combination with <code>Zend_Soap_Wsdl_Strategy_ArrayOfTypeComplex</code> (try saying that really fast a few times!).</p>

<h2>A Complete Example</h2>

<p>No one <strong>ever</strong> put together a full example in the documentation, their blog posts, the official Zend samples or anywhere else I searched yesterday. It&#8217;s always snippets here and there, and they don&#8217;t fit together well. So let me save you some trouble. I figure your reaching this page means you&#8217;ve already passed the first test which is to know the classes you need, which is why the search brought you here :)</p>

<p>I&#8217;m binding my webservice to a class, as that would be the logical choice in most cases.</p>

<pre><code>/* these are required for it all to work */
require("Zend/Soap/Server.php");
require("Zend/Soap/Wsdl.php");
require("Zend/Soap/Wsdl/Strategy/ArrayOfTypeComplex.php");
require("Zend/Soap/AutoDiscover.php");


/* my system makes use of a global prefix, feel free to do as needed */
$serviceURL = WWWPREFIX . '/webservices/myservice';


public class MyService {
     /**
     *
     * @param integer $UserID
     * @return array
     */
    function GetCoupons($UserID) {
        // do some work here
        $coupons = array(new Coupon(), new Coupon());
    }
}

// Generate WSDL relevant to code
if (isset($_GET['wsdl'])){
    $autodiscover = new Zend_Soap_AutoDiscover('Zend_Soap_Wsdl_Strategy_ArrayOfTypeComplex');
    $autodiscover-&gt;setClass('MyService');
    $autodiscover-&gt;handle();
} else {
    $server = new Zend_Soap_Server($serviceURL . "?wsdl");
    $server-&gt;setClass('MyService');
    $server-&gt;setObject(new MyService());
    $server-&gt;handle();
}
</code></pre>

<p>There are a few points of interest in the code block above (which is a completely functional service btw):</p>

<ul>
<li>Notice the <code>PHPDoc</code> block above the function? If you don&#8217;t get that right, it won&#8217;t work at all</li>
<li>The <em>return type of <strong><code>array</code></strong></em> because we&#8217;re returning an <em><code>array</code></em> of objects</li>
<li>The <code>Zend_Soap_AutoDiscover</code> bit at the bottom? That&#8217;ll auto-generate your <code>WSDL</code> for you</li>
</ul>

<p>There, you&#8217;re done. It should all just work, complete with WSDL auto-generation. If you&#8217;re looking to make use of an existing WSDL file, you can use the secondary method of binding to methods/functions as outlined over at the <a href="http://framework.zend.com/manual/en/zend.soap.server.html">official documentation on <code>Zend_Soap_Server</code></a>.</p>

<p>Say thank you Uncle Kevin :)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kevinfrancis.net/journal/2011/06/building-a-soap-server-with-zend_soap_server-and-returning-arrays-of-complextypes/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>SVNKit + Subclipse Problems</title>
		<link>http://www.kevinfrancis.net/journal/2009/05/svnkit-subclipse-problems/</link>
		<comments>http://www.kevinfrancis.net/journal/2009/05/svnkit-subclipse-problems/#comments</comments>
		<pubDate>Thu, 21 May 2009 17:35:47 +0000</pubDate>
		<dc:creator>Kevin Francis</dc:creator>
				<category><![CDATA[Asides]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Lazy Web]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://kevinfrancis.net/journal/?p=199</guid>
		<description><![CDATA[If you&#8217;re experiencing difficulty getting Subclipse working with SVNKit, install the very latest. One of the dependencies pulled in will list an SVNKit beta. Install that one and it&#8217;ll suddenly show up as a provider. This is true as of &#8230; <a href="http://www.kevinfrancis.net/journal/2009/05/svnkit-subclipse-problems/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re experiencing difficulty getting Subclipse working with SVNKit, install the very latest. One of the dependencies pulled in will list an SVNKit beta. Install <em>that</em> one and it&#8217;ll suddenly show up as a provider.</p>

<p>This is true as of Eclipse Ganymede and Subclipse 1.6.2 (installed with CollabNet Desktop). Just thought to save someone else several hours of their life :)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kevinfrancis.net/journal/2009/05/svnkit-subclipse-problems/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Safari 4 Scaling Zoom</title>
		<link>http://www.kevinfrancis.net/journal/2009/02/safari-4-scaling-zoom/</link>
		<comments>http://www.kevinfrancis.net/journal/2009/02/safari-4-scaling-zoom/#comments</comments>
		<pubDate>Thu, 26 Feb 2009 13:10:10 +0000</pubDate>
		<dc:creator>Kevin Francis</dc:creator>
				<category><![CDATA[Asides]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Lazy Web]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://kevinfrancis.net/journal/?p=178</guid>
		<description><![CDATA[Finally, Safari has page scaling in the v4 Beta. Sadly though it appears to exhibit strange behaviour with GMail for instance &#8212; When I zoom in, it also scales the width of the entire page, which means I now have &#8230; <a href="http://www.kevinfrancis.net/journal/2009/02/safari-4-scaling-zoom/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Finally, Safari has page scaling in the v4 Beta. Sadly though it appears to exhibit strange behaviour with GMail for instance &#8212; When I zoom in, it also scales the width of the entire page, which means I now have to scroll left and right :(</p>

<p>Now, whilst this may or may not be the best thing for scaling zoom to do, my question is rather about whether it&#8217;s the <em>right</em> thing to do&#8230;</p>

<p>Page scaling <em>should</em> in theory scale <strong>everything</strong> right? Thoughts anyone? Perhaps you&#8217;re familiar with the W3 recommendation on this matter&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kevinfrancis.net/journal/2009/02/safari-4-scaling-zoom/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

