<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Fri, 04 Jul 2008 16:59:58 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Eirik Hoem's Blog: Setting xsi:type for objects sent over SOAP (inheritance)]]></title>
      <guid>http://www.phpdeveloper.org/news/9822</guid>
      <link>http://www.phpdeveloper.org/news/9822</link>
      <description><![CDATA[<p>
<i>Eirik Hoem</i> has <a href="http://blog.eirikhoem.net/index.php/2008/03/17/setting-xsitype-for-objects-sent-over-soap-inheritance/">posted a tip</a> for all of the PHP SOAP developers out there - a method for setting the xsi:type correctly for objects sent in the message.
</p>
<blockquote>
I spent quite some time looking for info on how to specify the xsi:type for the objects, and I finally came across <a href="http://no.php.net/manual/en/function.soap-soapvar-construct.php">SoapVar</a>. I created a base class which the SOAP classes extended. A method called pack is responsible for setting xsi:type.
</blockquote>
<p>
In <a href="http://blog.eirikhoem.net/index.php/2008/03/17/setting-xsitype-for-objects-sent-over-soap-inheritance/">his example</a>, he creates a BaseClass to work from and builds a createCustomer class on top of it, defining a setCustomer function inside. When the new Person is created, a new Customer is too complete with the correctly formatted type on the object.
</p>]]></description>
      <pubDate>Wed, 19 Mar 2008 10:26:27 -0500</pubDate>
    </item>
  </channel>
</rss>
