<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'Passing Arrays Of Objects in a Webservice Using PHP' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'Passing Arrays Of Objects in a Webservice Using PHP' posted on the 'PHP' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2013 Programmers Heaven</copyright>
    <pubDate>Sat, 25 May 2013 23:01:27 -0700</pubDate>
    <lastBuildDate>Sat, 25 May 2013 23:01:27 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>Passing Arrays Of Objects in a Webservice Using PHP</title>
      <link>http://www.programmersheaven.com/mb/phpstuff/427126/427126/passing-arrays-of-objects-in-a-webservice-using-php/</link>
      <description>Any help on this problem would be much appreciated as I'm out of ideas.  Basically, I need to pass an array of objects from the client php page to the web service.  Whenever I try this I get the following error: Object of class stdClass could not be converted to string.&lt;br /&gt;
I stripped out all of the code that's not relevant to the problem.  Basically, I just need to know how to get the array of objects passed correctly to php server page.&lt;br /&gt;
&lt;br /&gt;
Here's the code I have.&lt;br /&gt;
&lt;br /&gt;
First, here's the class I'm using for the object:&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
class LicenseInformation {&lt;br /&gt;
	public $AssigneeId;&lt;br /&gt;
	public $ToolVersion;	&lt;br /&gt;
	public $Count;&lt;br /&gt;
	public $Duration;&lt;br /&gt;
	public $AutoRenewal;&lt;br /&gt;
	public $IsFloating;&lt;br /&gt;
}&lt;br /&gt;
	&lt;br /&gt;
Next, here's the client php with only the relevant code in it:&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
 include_once('LicenseInformation.class.php');	&lt;br /&gt;
 $wsdl = 'http://fspqs13.fs.cummins.com/services/server/oms?wsdl';&lt;br /&gt;
 $client = new SoapClient($wsdl, array('trace'=&amp;gt;true));&lt;br /&gt;
&lt;br /&gt;
 $count = 0;&lt;br /&gt;
 $License = new LicenseInformation();&lt;br /&gt;
 $License-&amp;gt;AssigneeId = 'bl651';&lt;br /&gt;
 $License-&amp;gt;Count = '4';&lt;br /&gt;
 $Licenses[] = $License;&lt;br /&gt;
	&lt;br /&gt;
 try {&lt;br /&gt;
  $result = $client-&amp;gt;CreateOrder('bl651', 'INSITE', $Licenses, 1);&lt;br /&gt;
 } catch (SoapFault $e) {&lt;br /&gt;
	   $result = new stdClass;&lt;br /&gt;
	   $result-&amp;gt;Return_Code = '2';&lt;br /&gt;
           $result-&amp;gt;Return_Message = $e-&amp;gt;getMessage();&lt;br /&gt;
	   $result-&amp;gt;SoapFault = TRUE;&lt;br /&gt;
	   echo $result;&lt;br /&gt;
 }		&lt;br /&gt;
&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, here's the service side php page with only the relevant code:&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
 include_once('LicenseInformation.class.php');&lt;br /&gt;
&lt;br /&gt;
 class EtoService {&lt;br /&gt;
  /*&lt;br /&gt;
   * Creates New ETO Licenses.&lt;br /&gt;
   *&lt;br /&gt;
   * @param string $RequesterId&lt;br /&gt;
   * @param string $ToolName&lt;br /&gt;
   * @param LicenseInformation[] LicenseOrders&lt;br /&gt;
   * @param int $RecordCount&lt;br /&gt;
   * @return string&lt;br /&gt;
   */&lt;br /&gt;
   public function CreateOrder($RequesterId,                                           $ToolName,$LicenseOrders, $RecordCount) {&lt;br /&gt;
   for ($i = 0; $i &amp;lt;= $RecordCount; $i++) {&lt;br /&gt;
    $AssigneeId = $LicenseOrders[$i]-&amp;gt;AssigneeId;&lt;br /&gt;
    $Count = $LicenseOrders[$i]-&amp;gt;Count;&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/phpstuff/427126/427126/passing-arrays-of-objects-in-a-webservice-using-php/</guid>
      <pubDate>Tue, 31 Jan 2012 11:23:01 -0700</pubDate>
      <category>PHP</category>
    </item>
  </channel>
</rss>