vSphere SDK for Perl Programming Conventions
Several programming conventions are different than you might expect because the SDK interacts with a server using SOAP/WSDL.
- Boolean data types – SDK applications send
and receive Boolean values as follows.
- Input (sending from the client
application):
false: Use 0, '0', or 'false' (capitalization ignored) true: Use 1, '1', or 'true' (capitalization ignored) - Output (receiving from the server):
false: Return value is 0 true: Return value is 1
- Input (sending from the client
application):
To match Boolean values in a filter, use the strings true and false. See Creating and Using Filters.
- Date/Time – The server returns a SOAP
dateTime
value. You can use theDate::Parse
Perl module to process these objects.The vSphere SDK for Perl accepts only native SOAP
dateTime
values using standard date time format with or without fractional seconds, and with or without GMT (Z) time zone.YYYY-MM-DDThh:mm:ssTZD, for example, 1997-07-16T19:20:30+01:00 YYYY-MM-DDThh:mm:ss.sTZD, for example, 1997-07-16T19:20:30.45+01:00
The SDK always returns
dateTime
values in the standard date time format. - SOAP error message – Most likely indicates an error on the server, not an error with the communication to the server.