2 Instantiate a local proxy object for reference to ServiceInstance. Use this local proxy object to retrieve the ServiceContent object from the server. ServiceContent contains a reference to the root folder for the inventory and references to the managed objects that provide the vSphere services.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.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.
4 Include the class variable declarations/definitions. Use a TrustManager class to accept all certificates, as shown in Accessing the HTTP Endpoint with JAX-WS. This is not appropriate for a production environment. Production code should implement certificate support.
5
7 Use the VimPort object to close the connection, as shown in Closing the Connection. Always close your server connections to maintain security.Example: Java Test Client Application shows the complete sample client application code, without the explanation steps.Example: Java Test Client Application// See Example: Obtaining a Session Token - Code Fragments from VMPromoteDisks.java for more details.Use the following command to compile the code for Example: Java Test Client Application, after you have saved it as a .java file: