If you plan to use the Java programming language to develop your applications and the .NET version is 4.5 on the Mirage Server, you must perform certain tasks to set up a Java development environment.

Procedure

  1. Download Java SOAP library Axis2 from http://axis.apache.org/axis2/java/core.
  2. Unzip the file axis2-1.x.y to a folder and set the environment variable %AXIS2_HOME% to the path of this folder.
  3. Get the WSDL file MitService.wsdl from https://server-address:7443/mirageapi/MitService.svc?singleWsdl.
  4. Generate Java classes with the following command:
    %AXIS2_HOME%\bin\wsdl2java -uri MitService.wsdl -p com.vmware.mirage.mit

Results

With the generated classes, you can login to Mirage API. For example:

client = new MitServiceStub("https://server-address:7443/mirageapi/MitService.svc");
final SSLContext sslCtx = SSLContext.getInstance("TLS");
sslCtx.init(null, new TrustManager[] { new TrustAllTrustManager() }, null);
client._getServiceClient()
    .getOptions()
    .setProperty(HTTPConstants.CUSTOM_PROTOCOL_HANDLER, new Protocol("https", (ProtocolSocketFactory) new SSLProtocolSocketFactory(sslCtx), 7443));
final HttpState httpState = new HttpState();
client._getServiceClient().getOptions()
    .setProperty(org.apache.axis2.transport.http.HTTPConstants.CACHED_HTTP_STATE, httpState);
final Login login = new Login();
login.setUsername(“username”);
login.setPassword(“password”);
client.login(login);  
          
//Perform tasks