Java and C# Sample Applications
The vSphere Web Services SDK includes sample applications, written in Java and C#, that demonstrate features of the vSphere API and object model (see Sample Program Overview). Most of the samples do not handle exceptions, and they accept all security certificates. So use the applications as examples for extracting the types of data you want to view, but do not use the helper classes, trust store methods or exception handling techniques in your production environment.
Java Samples
The Java samples in your vSphere Web Services SDK include .java files that you can compile and then run using any Java editor or IDE. The samples accept command-line arguments for the vSphere server name (DNS name or IP address), user name, and password.
C# Samples
The C# samples in your vSphere Web Services SDK include a .cs file and three project files in each directory (.proj, 2008.proj, and 2010.proj) so you can run them using Microsoft’s Visual Studio.
Like the Java samples, the C# samples also accept command-line arguments for the vSphere server name (DNS name or IP address), user name, and password, and they accept all certificates to establish the SSL handshake.
Unlike the Java samples, the C# samples use the helper classes discussed in Helper Classes for C# Sample Applications.
Helper Classes for C# Sample Applications
The C# sample applications included with the vSphere Web Services SDK include C# helper classes that handle the details of creating sessions, obtaining session tokens, saving the session token as a string to a file, and reusing the session. The Microsoft .NET Web services implementation uses the Cookie class to handle the session information from the server.
The helper classes (listed in Helper Classes for C# Sample Applications) handle command-line input such as common parameters, server name, and other details. These helper classes are located in the unpacked C# version of the SDK download, in this location:
C# Helper Classes
%SDKHOME%\vsphere-ws\dotnet\cs\samples\AppUtil
Helper Classes for C# Sample Applications lists the helper classes available for C#.
Wrapper methods for the vimService methods (the local proxy code methods) for API 2.0 and prior releases.