[vbox-dev] SOAP & PHP problem...

Michael A. Thompson mathomp at bgsu.edu
Wed Sep 10 14:16:50 GMT 2008


Never mind... Im an idiot. Figured it out.

m

On Sep 9, 2008, at 4:27 PM, Michael A. Thompson wrote:

> Hi,
>
> I am having issues with the SOAP interface to vboxwebsrv using php. I
> am sure the problem is mostly my fault as I am new to SOAP.
> php version: 5.2.1
> VBox Version: 2.0.0
>
> Here is the error I am getting when trying top execute the
> IVirtualBox_getVersion method...
>
> Getting VBox Version
> Code: 0
> Message: SOAP-ERROR: Encoding: object hasn't '_this' property
> Trace: #0 [internal function]: SoapClient->__call
> ('IVirtualBox_get...', Array) #1 /Users/xxxx/Sites/vbox/index.php
> (24): SoapClient->IVirtualBox_getVersion(Object(stdClass)) #2 {main}
>
> If anyone can point me in the right direction would be greatly
> appreciated...
>
> The source example:
> <?php
>
> //create a SOAP connection to the vboxwebsrv
> print('SOAP VBox');
>
> print('<br><br>Connecting...');
> $client = new SoapClient("vboxwebService.wsdl");
> if($client) {
>         print('<br>connected<br>');
>         print(var_dump($client) . '<br>');
>         print_r($client);
>         print('<br><br>Authenticating...');
>         $vbox = $client->IWebsessionManager_logon("test", "test");
>         if($vbox) {
>                 print('<br>logged in<br>');
>                 print(var_dump($vbox) . '<br>');
>                 print_r($vbox);
>         } else {
>                 print('<br>not logged in');
>         }
>         //get vbox version
>         try {
>                 print('<br><br>Getting VBox Version');
>                 $ver = $client->IVirtualBox_getVersion($vbox);
>                 print("<br>" . $ver);
>                 print_r($ver);
>         } catch (SoapFault $f) {
>                 print('<br> Code: ' . $f->getCode() . '<br>  
> Message: ' . $f-
>> getMessage() . '<br> Trace: ' . $f->getTraceAsString());
>         }
> } else {
>         print('<br>not connected');
> }
>
> //list all vbox manage functions
> print('<br><br><br>Show all VBox functions...');
> echo '<br>=====================================<br>';
> var_dump($client->__getFunctions());
>
> //and logoff when done
> print('<br>Logoff...');
> $client->IWebsessionManager_logoff();
> print('<br>==============================<br>');
> var_dump($client);
> ?>
>
> The complete output:
> SOAP VBox
>
> Connecting...
> connected
> object(SoapClient)#1 (2) { ["_soap_version"]=> int(1) ["sdl"]=>
> resource(2) of type (Unknown) }
> SoapClient Object ( [_soap_version] => 1 [sdl] => Resource id #2 )
>
> Authenticating...
> logged in
> object(stdClass)#2 (1) { ["returnval"]=> string(33)
> "af70c6c5340febb3-0000000000000012" }
> stdClass Object ( [returnval] => af70c6c5340febb3-0000000000000012 )
>
> Getting VBox Version
> Code: 0
> Message: SOAP-ERROR: Encoding: object hasn't '_this' property
> Trace: #0 [internal function]: SoapClient->__call
> ('IVirtualBox_get...', Array) #1 /Users/xxxxx/Sites/vbox/index.php
> (24): SoapClient->IVirtualBox_getVersion(Object(stdClass)) #2 {main}
>
>
> Show all VBox functions...
> =====================================
> array(479) { [0]=> string(89) "IVirtualBox_getVersionResponse
> IVirtualBox_getVersion(IVirtualBox_getVersion $parameters)" [1]=>
> string(101) "IVirtualBox_getPackageTypeResponse
> IVirtualBox_getPackageType(IVirtualBox_getPackageType
> $parameters)" [2]=> string(98) "IVirtualBox_getHomeFolderResponse
> IVirtualBox_getHomeFolder(IVirtualBox_getHomeFolder $parameters)" [3]
> => string(116) "IVirtualBox_getSettingsFilePathResponse
> IVirtualBox_getSettingsFilePath(IVirtualBox_getSettingsFilePath
> $parameters)" [4]=> string(125)
> "IVirtualBox_getSettingsFileVersionResponse
> IVirtualBox_getSettingsFileVersion 
> (IVirtualBox_getSettingsFileVersion...
>
> truncated...
>
> Logoff...
> ==============================
> object(SoapClient)#1 (3) { ["_soap_version"]=> int(1) ["sdl"]=>
> resource(2) of type (Unknown) ["httpurl"]=> resource(6) of type
> (Unknown) }
>
> thanks,
> m
>
>
> _______________________________________________
> vbox-dev mailing list
> vbox-dev at virtualbox.org
> http://vbox.innotek.de/mailman/listinfo/vbox-dev





More information about the vbox-dev mailing list