You can specify username and password credentials to establish a session with a vCenter Server. This method of establishing a session has been deprecated as of vSphere 5.1. The following steps describe how a client application specifies username and password credentials for access to a vCenter Server.
This section includes an example of a complete client application that demonstrates the basic client capability. The sample client application prints out the product name, server type, and product version to demonstrate that it is connected and able to retrieve information from the server.
While Example: Java Test Client Application is a complete client application that demonstrates the basic client capability, it uses a slightly different format than the Java sample files in the
SDK\ directory. This example, and the Java samples that are included with your vSphere Web Service SDK, have been compiled using JAX-WS bindings.
Most of the vSphere Web Services SDK samples do not handle exceptions, and they accept all security certificates. Use the samples as examples for extracting the types of data you want to view, but do not use these security or exception techniques in your production applications.
Example: Java Test Client Application is a stand-alone application that accepts command-line arguments for the vSphere server name (DNS name or IP address), user name, and password.
Example: Java Test Client Application shows the complete sample client application code, without the explanation steps.