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.
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.
Here's the code I have.
First, here's the class I'm using for the object:
Next, here's the client php with only the relevant code in it:
Finally, here's the service side php page with only the relevant code:
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.
Here's the code I have.
First, here's the class I'm using for the object:
Code:
<?php class LicenseInformation { public $AssigneeId; public $ToolVersion; public $Count; public $Duration; public $AutoRenewal; public $IsFloating; }
Code:
<?php include_once('LicenseInformation.class.php'); $wsdl = 'http://fspqs13.fs.cummins.com/services/server/oms?wsdl'; $client = new SoapClient($wsdl, array('trace'=>true)); $count = 0; $License = new LicenseInformation(); $License->AssigneeId = 'bl651'; $License->Count = '4'; $Licenses[] = $License; try { $result = $client->CreateOrder('bl651', 'INSITE', $Licenses, 1); } catch (SoapFault $e) { $result = new stdClass; $result->Return_Code = '2'; $result->Return_Message = $e->getMessage(); $result->SoapFault = TRUE; echo $result; } >
Code:
<?php include_once('LicenseInformation.class.php'); class EtoService { /* * Creates New ETO Licenses. * * @param string $RequesterId * @param string $ToolName * @param LicenseInformation[] LicenseOrders * @param int $RecordCount * @return string */ public function CreateOrder($RequesterId, $ToolName,$LicenseOrders, $RecordCount) { for ($i = 0; $i <= $RecordCount; $i++) { $AssigneeId = $LicenseOrders[$i]->AssigneeId; $Count = $LicenseOrders[$i]->Count; } } ?>
Comment