Tuesday, August 26, 2014

Using PrimType in the vSphere Perl SDK

One of the issues that can arise with the vSphere Perl SDK is the serialization of various numeric types as strings.  For example, when trying to remove a DRS rule from a ClusterComputeResource the following error will manifest: SOAP fault: A specified parameter was not correct.  Internally, the vSphere Perl SDK is setting the removeKey property type to xsd:string and the vSphere Web Service is unable to coerce the string into the expected xsd:int type.

However, a base type called PrimType is available to set the proper SOAP XSD data type when serializing the data objects for the vSphere Web Service.