Hello,
We are programming a web site to use vcloud Director and to test the vcloud API . we use the sdk PHP.
Our work is based on the sdk php beta.
our vcd director cell is the 1.0.0-285979 build.
I tried to migrate to the last stable version (vcloudPHP-1.0.0-314767). And I had some problems. but the first diffcult problem is the following :
we have a php code like this :
$vappRef = a_function_to_get_an_vappTemplate_href() ;
$mySDKvappTemplate = $service->createSDKObj($vappRef) ;
the result is that $vappRef = https://10.170.232.44/api/v1.0/vAppTemplate/vappTemplate-746320306
and when $service->createSDKObj($vappRef) is executed. we have this error :
PHP Fatal error: Uncaught exception 'VMware_VCloud_SDK_Exception' with message 'Class VMware_VCloud_SDK_ does not exist!
the problem seams to be in the getClassByUrl($svc, $url) private function in VMware_VCloud_SDK_Factory class in Factory.php of the sdk.
in fact, the difference between the beta version and the stable version is that the function get the /vAppTemplate/ chain in beta version and in the stable version it get /vappTemplate- chain in the url and to use it as the key in urlMap array.
so to resolve the problem we tried to replace vappTemplate-746320306 by vAppTemplate-746320306 in the url. it works, but the error was moved to the vcd which didn't know this type of items.
So to resolve definetely the problem we replaced in private static $urlMap variable declaration,
this line :'vAppTemplate' => 'VAppTemplate',
by this one : 'vappTemplate' => 'VAppTemplate',
maybe this stable version works for a more recent vcd Director than Ours ? or is there good practice to follow ?
regards,
Yann Conan