Quantcast
Channel: VMware Communities : Discussion List - vSphere Client SDK
Viewing all articles
Browse latest Browse all 2218

VMWare SOAP SDK - PHP - Can't get output from method

$
0
0

We would like to execute the QueryNetworkHint method in VMWARE

https://www.vmware.com/support/developer/vc-sdk/visdk41pubs/ApiReference/vim.host.NetworkSystem.html#queryNetworkHint

We do this with SOAP PHP with the VMWARE SDK.

 

 

It works to retrieve the serviceinstance, to log in, to get alle VM's, to get all ESXs,

but not to execute a specific command. And there is no detailed information how to do this.

 

 

 

This works:

 

 

            $request = new stdClass();

            $request->_this = array ('_' => 'ServiceInstance', 'type' => 'ServiceInstance');

            $response = $this->__soapCall('RetrieveServiceContent', array((array)$request));

            $ret = $response->returnval;

 

 

This works:

 

 

            $request = new stdClass();

            $request->_this = $ret->sessionManager;

            $request->userName = $this->VMUSERNAME;

            $request->password = $this->VMPASSWORD;

            $response = $this->__soapCall('Login', array((array)$request));

 

 

Then we would like to execute this commands from the wsdl:

            <element name="QueryNetworkHint" type="vim25:QueryNetworkHintRequestType"/>

            <element name="QueryNetworkHintResponse">

            <complexType>

            <sequence>

            <element name="returnval" type="vim25:PhysicalNicHintInfo" minOccurs="0" maxOccurs="unbounded"/>

            </sequence>

            </complexType>

            </element>

 

 

So I do:

 

 

            $request = new stdClass();

            $request->_this = $ret->physicalNicHintInfo;

            $response = $this->__soapCall('QueryNetworkHint', array((array)$request));

            $ret = $response->returnval;

 

 

But... then I got this error:

 

 

            The object has already been deleted or has not been completely created

 

 

Then I try with:

 

 

            $request->_this = array ('name' => 'physicalNicHintInfo', 'type' => 'physicalNicHintInfo');

 

 

or with:

 

 

            $request->_this = $ret->hostSystem;

 

 

But still seems to got problems.

 

 

If I look to the ServiceInstance output we have:

 

 

    stdClass Object

    (

    [returnval] => stdClass Object

        (

            [rootFolder] => stdClass Object

                (

                    [_] => group-d1

                    [type] => Folder

                )

 

 

            [propertyCollector] => stdClass Object

                (

                    [_] => propertyCollector

                    [type] => PropertyCollector

                )

 

 

            [viewManager] => stdClass Object

                (

                    [_] => ViewManager

                    [type] => ViewManager

                )

 

 

            [about] => stdClass Object

                (

                    [name] => VMware vCenter Server

                    [fullName] => VMware vCenter Server 5.5.0 build-1623101

                    [vendor] => VMware, Inc.

                    [version] => 5.5.0

                    [build] => 1623101

                    [localeVersion] => INTL

                    [localeBuild] => 000

                    [osType] => win32-x64

                    [productLineId] => vpx

                    [apiType] => VirtualCenter

                    [apiVersion] => 5.5

                    [instanceUuid] => 48C9BB63-****

                    [licenseProductName] => VMware VirtualCenter Server

                    [licenseProductVersion] => 5.0

                )

 

 

            [setting] => stdClass Object

                (

                    [_] => VpxSettings

                    [type] => OptionManager

                )

 

 

            [userDirectory] => stdClass Object

                (

                    [_] => UserDirectory

                    [type] => UserDirectory

                )

 

 

            [sessionManager] => stdClass Object

                (

                    [_] => SessionManager

                    [type] => SessionManager

                )

 

 

            [authorizationManager] => stdClass Object

                (

                    [_] => AuthorizationManager

                    [type] => AuthorizationManager

                )

 

 

            [serviceManager] => stdClass Object

                (

                    [_] => ServiceMgr

                    [type] => ServiceManager

                )

 

 

            [perfManager] => stdClass Object

                (

                    [_] => PerfMgr

                    [type] => PerformanceManager

                )

 

 

            [scheduledTaskManager] => stdClass Object

                (

                    [_] => ScheduledTaskManager

                    [type] => ScheduledTaskManager

                )

 

 

            [alarmManager] => stdClass Object

                (

                    [_] => AlarmManager

                    [type] => AlarmManager

                )

 

 

            [eventManager] => stdClass Object

                (

                    [_] => EventManager

                    [type] => EventManager

                )

 

 

            [taskManager] => stdClass Object

                (

                    [_] => TaskManager

                    [type] => TaskManager

                )

 

 

            [extensionManager] => stdClass Object

                (

                    [_] => ExtensionManager

                    [type] => ExtensionManager

                )

 

 

            [customizationSpecManager] => stdClass Object

                (

                    [_] => CustomizationSpecManager

                    [type] => CustomizationSpecManager

                )

 

 

            [customFieldsManager] => stdClass Object

                (

                    [_] => CustomFieldsManager

                    [type] => CustomFieldsManager

                )

 

 

            [diagnosticManager] => stdClass Object

                (

                    [_] => DiagMgr

                    [type] => DiagnosticManager

                )

 

 

            [licenseManager] => stdClass Object

                (

                    [_] => LicenseManager

                    [type] => LicenseManager

                )

 

 

            [searchIndex] => stdClass Object

                (

                    [_] => SearchIndex

                    [type] => SearchIndex

                )

 

 

            [fileManager] => stdClass Object

                (

                    [_] => FileManager

                    [type] => FileManager

                )

 

 

            [datastoreNamespaceManager] => stdClass Object

                (

                    [_] => DatastoreNamespaceManager

                    [type] => DatastoreNamespaceManager

                )

 

 

            [virtualDiskManager] => stdClass Object

                (

                    [_] => virtualDiskManager

                    [type] => VirtualDiskManager

                )

 

 

            [snmpSystem] => stdClass Object

                (

                    [_] => SnmpSystem

                    [type] => HostSnmpSystem

                )

 

 

            [vmProvisioningChecker] => stdClass Object

                (

                    [_] => ProvChecker

                    [type] => VirtualMachineProvisioningChecker

                )

 

 

            [vmCompatibilityChecker] => stdClass Object

                (

                    [_] => CompatChecker

                    [type] => VirtualMachineCompatibilityChecker

                )

 

 

            [ovfManager] => stdClass Object

                (

                    [_] => OvfManager

                    [type] => OvfManager

                )

 

 

            [ipPoolManager] => stdClass Object

                (

                    [_] => IpPoolManager

                    [type] => IpPoolManager

                )

 

 

            [dvSwitchManager] => stdClass Object

                (

                    [_] => DVSManager

                    [type] => DistributedVirtualSwitchManager

                )

 

 

            [hostProfileManager] => stdClass Object

                (

                    [_] => HostProfileManager

                    [type] => HostProfileManager

                )

 

 

            [clusterProfileManager] => stdClass Object

                (

                    [_] => ClusterProfileManager

                    [type] => ClusterProfileManager

                )

 

 

            [complianceManager] => stdClass Object

                (

                    [_] => MoComplianceManager

                    [type] => ProfileComplianceManager

                )

 

 

            [localizationManager] => stdClass Object

                (

                    [_] => LocalizationManager

                    [type] => LocalizationManager

                )

 

 

            [storageResourceManager] => stdClass Object

                (

                    [_] => StorageResourceManager

                    [type] => StorageResourceManager

                )

 

 

            [guestOperationsManager] => stdClass Object

                (

                    [_] => guestOperationsManager

                    [type] => GuestOperationsManager

                )

 

 

        )

 

 

    )

 

 

Other errors when trying which combination:

 

 

    The request refers to an unexpected or unknown type.


Viewing all articles
Browse latest Browse all 2218

Trending Articles



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