Quantcast
Channel: VMware Communities : All Content - vSphere Management SDK
Viewing all articles
Browse latest Browse all 1860

PHP nusoap - problems with WSDL and namespace

$
0
0

Hi all,

 

I've finally decided to make an account and ask for help.

 

First off, I am using php and nusoap to make calls to my vCenter to perform operations. I am working on automating clone vm via RecommendDatastores method. I had it working, but I came to a point where I had to specify the xsi:type as an object. When I set the xml type through soapval, soapval just sets the xml type as string. This got me thinking that my soapclient isn't receving the WSDL or not using the right namespace because soapval has no idea of the existence of the complex object types such as CustomizationIdentitySettings or CustomizationFixedIp.

 

Upon doing some digging, I noticed when I create my soapclient I need to pass the url to the WSDL AND set the second paramter (wsdl) to true, i.e., new soapclient(https://hostIP/sdk/vimService.wsdl", true). When I set the second parameter to true, it broke my whole class.

 

I get a soapclient error that says the type is invalid, e.g., "soapclient: got wsdl error: ServiceInstance (ServiceInstance) is not a supported type." or "soapclient: got wsdl error: SessionManager (SessionManager) is not a supported type.".


Here is my code:

 

[code]

 

$this->vsConnection = new soapclient(https://hostIP/sdk/vimService.wsdl", true)

$soapmsg['_this'] = new soapval('_this','ServiceInstance','ServiceInstance');

$result = $this->vsConnection->call('RetrieveServiceContent',$soapmsg,$this->namespace); //namespace = "urn:vim25"

 

[/code]

 

If instead I decide to change the parameters from ('_this','ServiceInstance','ServiceInstance') to ('_this', false,'ServiceInstance'), I get "soapclient: got wsdl error: phpType is struct, but value is not an array: see debug output for details".

 

Any help would be much appreciated.


Viewing all articles
Browse latest Browse all 1860

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>