Language-Specific Classes and Methods
The SOAP tools generate language-specific classes and methods that match the WSDL definitions. The tools also produce objects and methods that are not in the WSDL files.
- Generated objects. The additional objects provide access to the vSphere Web Service to establish the client-server connection (VimService, AppUtil) and declare the methods defined for the vSphere API (VimPortType, VimService).
- Generated methods. The additional methods are accessor (getter) and mutator (setter) methods for properties. For Java, the method names are constructed by adding get and set prefixes to a property name, and changing the first character of the property name to upper case.
The following table identifies client proxy definitions for the vSphere Web Services SDK WSDL.
Element Access | Java | C# |
---|---|---|
Access to vSphere Web service (HTTPS/HTTP) | VimService class | AppUtil class |
Access to vSphere API methods | VimPortType class | VimPortType class
(Vim25Api.VimService in vSphere 6.0 and before) |
Access to vSphere API properties | getPropertyName and setPropertyName methods defined for data objects | get and set methods defined for properties |
vSphere API data objects | Data objects in the vSphere API (see the vSphere API Reference) defined as objects in the proxy interface |
The following code fragments show getter and setter method definitions for the AfterStartupTaskScheduler.minute property.
Java
public int getMinute() { return minute; } public void setMinute(int minute) { this.minute = minute; }
C#
public int minute { set; get; }
You can extrapolate the getter and setter methods that are available in the client proxy interface from the vSphere API Reference. For example, the ScsiLun data object has a displayName property. For the Java API, you can use a setDisplayName method to assign a string value to the property, and obtain the string value by using the getDisplayName method. The vSphere Web Services SDK includes Java and C# sample code that illustrates how to use the proxy interfaces. See GUID-CEBD41E1-71DC-42B7-BAFF-F773A9B18A06.html#GUID-CEBD41E1-71DC-42B7-BAFF-F773A9B18A06.