<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Hi James,<div><br></div><div>Thanks for the quick response!</div><div><br></div><div>Here are my system details:</div><div><br></div><div>Host: openSuSe 11.1</div><div>PHP: PHP 5.2.11 with Suhosin-Patch 0.9.7 (cli) (built: Sep 24 2009 12:37:34)</div><div><br></div><div>Regarding being verbose ... you are absolutely correct.  That is actually a residue of my converting from the classes I had written before your generated version was published.  Thanks for the reminder ... I'll adjust my code.</div><div><br></div><div>Once you have had a chance to look at this and possibly made any updates ... I would be happy to run through a suite of quick tests before you release ... just drop me a note.</div><div><br></div><div><br></div><div>Thanks,</div><div>Joe<br><br>--- On <b>Fri, 12/4/09, James Lucas <i><jimmy@secsme.org.au></i></b>
 wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: James Lucas <jimmy@secsme.org.au><br>Subject: Re: [vbox-dev] Problems w/ the vboxServiceWrappers.php module<br>To: "Joseph Smith" <joseph1962smith@yahoo.com><br>Cc: vbox-dev@virtualbox.org<br>Date: Friday, December 4, 2009, 4:06 PM<br><br><div class="plainMail">Hi Joseph,<br><br>I'll take a look at all of these by Monday (I am away about to leave on a<br>weekend holiday with no laptop).<br><br>Can you please tell me your PHP version / OS. There should be no need to perform<br>a type cast to array in the return val as the collection class should handle<br>that, however it does make sense just to add it as a safety.<br><br>The last issue with Progress I'll have to have a think about. The XIDL code is <br><br>    <attribute name="object" type="$unknown" readonly="yes"><br>     
 <desc><br>        Object this metric belongs to.<br>      </desc><br>    </attribute><br><br>Which as you see doesn't define a class. I'll have to think how to handle this.<br><br>Just a final note. You don't need to be as verbose on the function calls there<br>are magic __get and __set methods for instance variables (Have a look at the<br>sample code which takes a screen shot of a running vm).<br><br>$mediumAttachmentRefList = $machine->getMediumAttachments (); can become<br>$mediumAttachmentRefList = $machine->mediumAttachments;<br><br>- James<br><br>Quoting Joseph Smith <<a ymailto="mailto:joseph1962smith@yahoo.com" href="/mc/compose?to=joseph1962smith@yahoo.com">joseph1962smith@yahoo.com</a>>:<br><br>> Hi,<br>> I've been working extensively on a PHP web interface using the virtual box<br>> webservice APIs.  I had already completed a working version of a base
 class<br>> that handled interaction with the APIs using raw Soap calls ... but then came<br>> the generated vboxServiceWrappers.php module.  I've been modifying my code to<br>> use the wrappers ... but have found some problems.<br>> I have opened Ticket #5657 with an explanation of the issues I have found.<br>> In talking w/ the dev team on IRC, it was suggested I drop a note to this<br>> list and include mjlucas on 'cc'.<br>> For your convenience, here is the contents of the ticket I opened:<br>> Ticket #5657 (new defect)Opened 1 day agoProblems with<br>> vboxServiceWrappers.php moduleReported by:joseph1962smithAssigned<br>> to:Priority:majorComponent:webservicesVersion:VirtualBox<br>> 3.1.0Keywords:vboxServiceWrappers.phpCc:Guest type:LinuxHost<br>> type:LinuxDescriptionA number of issues have been detected with the PHP<br>> wrapper module. Many of the instances are related to a single class and
 by<br>> addressing that issue, it should address a large number of them.The problems<br>> I describe below may also exist in other SDK wrappers as the wrappers are<br>> generated from presumably the same code-base.Where possible, I have provided<br>> one possible solution approach to the problem but is not the only way the bug<br>> can be fixed.For Possible solutions, the typecasting in many cases to an<br>> array by using '(array)' vs 'array ( ... )' will depend on whether the<br>> data-element is an array of objects vs an array of references to an object.<br>> Bugs:<br>> //<br>><br>---------------------------------------------------------------------getDVDDrives<br>> method of the IHost object incorrectly tries to build the IMediumCollection<br>> object .. - Should pass an array of items for parameter number 2 ... not a<br>> string.Current code:return new IMediumCollection ($this->connection,<br>>
 $response->returnval);Possible Solutions:return new IMediumCollection<br>> ($this->connection, (array) $response->returnval);<br>> //<br>><br>---------------------------------------------------------------------getFloppyDrives<br>> method of the IHost object incorrectly tries to build the IMediumCollection<br>> object .. - Should pass an array of items for parameter number 2 ... not a<br>> string.Current code:return new IMediumCollection ($this->connection,<br>> $response->returnval);Should Be:return new IMediumCollection<br>> ($this->connection, array ($response->returnval));<br>> //<br>><br>---------------------------------------------------------------------getFloppyImages<br>> method of the IVirtualBox object incorrectly tries to build the<br>> IMediumCollection object .. - Should pass an array of items for parameter<br>> number 2 ... not a string.Current code:return new
 IMediumCollection<br>> ($this->connection, $response->returnval);Should Be:return new<br>> IMediumCollection ($this->connection, (array)$response->returnval);<br>> //<br>><br>---------------------------------------------------------------------IMediumCollection<br>> in general: It seems when an IMedium collection is used, an array of<br>> reference IDs (handles) is returned rather than an array of IMedium<br>> objects.e.g: Array ([0] '20e6f88ea0bffc6d-0000000000000822'[1]<br>> '20e6f88ea0bffc6d-0000000000000823'[2] '20e6f88ea0bffc6d-0000000000000824'[3]<br>> '20e6f88ea0bffc6d-0000000000000825'[4]<br>> '20e6f88ea0bffc6d-0000000000000826')The work-around for<br>> IMediumAttachment::getMedium below can allow developers to build the IMedium<br>> object on-the-fly if this scenario should happen.IMediumAttachment::getMedium<br>> method retuns a string (with the handle for the IMedium object) rather
 than<br>> returning the IMedium object.Work-Around:$mediumAttachmentRefList =<br>> $machine->getMediumAttachments ();foreach ($mediumAttachmentRefList as<br>> $mediumAttachmentRef){    $mediumRef = $mediumAttachmentRef->getMedium ();    //<br>> BUG w/ 3.1 APIs ... mediumRef should be an object    //<br>>  however, an internal reference pointer string is returnd    // handle for both<br>> string and object until it's fixed    if (!is_object ($mediumRef))        $mediumRef =<br>> new IMedium ($this->connection, $mediumRef);<br>>     ...    ...}<br>> NOTE: The work-around above assumes $machine is valid and is of type<br>> IMachine<br>> //<br>><br>---------------------------------------------------------------------IMedium::getMachineIds<br>> type-casts to string which is
 not correct.Current code:return<br>> (string)$response->returnval;Should Bereturn (array)$response->returnval;<br>> //<br>><br>---------------------------------------------------------------------getSharedFolders<br>> method of the IVirtualBox object incorrectly tries to build the<br>> ISharedFolderCollection object .. - Should pass an array of items for<br>> parameter number 2 ... not a string.Current code:return new<br>> ISharedFolderCollection ($this->connection, $response->returnval);Should<br>> Be:return new ISharedFolderCollection ($this->connection, (array)<br>> $response->returnval);<br>> //<br>><br>---------------------------------------------------------------------getDHCPServers<br>> method of the IVirtualBox object incorrectly tries to build the<br>> IDHCPServerCollection object .. - Should pass an array of items for parameter<br>> number 2 ... not a string.Current code:return new
 ISharedFolderCollection<br>> ($this->connection, $response->returnval);Should Be:return new<br>> IDHCPServerCollection ($this->connection, (array) $response->returnval);<br>> //<br>><br>---------------------------------------------------------------------getProgressOperations<br>> method of the IVirtualBox object incorrectly tries to build the<br>> IProgressCollection object .. - Should pass an array of items for parameter<br>> number 2 ... not a string.Current code:return new ISharedFolderCollection<br>> ($this->connection, $response->returnval);Should Be:return new<br>> IProgressCollection ($this->connection, (array) $response->returnval);<br>> <br>> //<br>><br>---------------------------------------------------------------------getObject<br>> method on the IPerformanceMetric class attempts to return an 'unknown'<br>> object<br>>
 //<br>><br>---------------------------------------------------------------------getInitiator<br>> method on the IProgress class attempts to return a '$unknown' object ... but<br>> $unknown is not defined.<br>> <br>> <br>> <br>>       <br><br><br>--<br>UTS CRICOS Provider Code:  00099F<br>DISCLAIMER: This email message and any accompanying attachments may contain<br>confidential information.  If you are not the intended recipient, do not<br>read, use, disseminate, distribute or copy this message or attachments.  If<br>you have received this message in error, please notify the sender<br>immediately and delete this message. Any views expressed in this message<br>are those of the individual sender, except where the sender expressly, and<br>with authority, states them to be the views the University of Technology,<br>Sydney. Before opening any attachments, please check them for viruses
 and<br>defects.<br></div></blockquote></div></td></tr></table><br>