Quick Start (SOAP mode): Getting the applications using the Java API

The following Java code example gets the applications using the Java API.
Note: Getting AEM Forms Application API, getApplications(), returns only deployed applications.
/* 
 * This Java Quick Start uses the SOAP mode and contains the following JAR files 
 * in the class path: 
 * 1. adobe-livecycle-client.jar 
 * 2. adobe-usermanager-client.jar 
 * 3. adobe-application-remote-client.jar 
 * 4. activation.jar (required for SOAP mode) 
 * 5. axis.jar (required for SOAP mode) 
 * 6. commons-codec-1.3.jar (required for SOAP mode) 
 * 7. commons-collections-3.1.jar  (required for SOAP mode) 
 * 8. commons-discovery.jar (required for SOAP mode) 
 * 9. commons-logging.jar (required for SOAP mode) 
 * 10. dom3-xml-apis-2.5.0.jar (required for SOAP mode) 
 * 11. jaxen-1.1-beta-9.jar (required for SOAP mode) 
 * 12. jaxrpc.jar (required for SOAP mode) 
 * 13. log4j.jar (required for SOAP mode) 
 * 14. mail.jar (required for SOAP mode) 
 * 15. saaj.jar (required for SOAP mode) 
 * 16. wsdl4j.jar (required for SOAP mode) 
 * 17. xalan.jar (required for SOAP mode) 
 * 18. xbean.jar (required for SOAP mode) 
 * 19. xercesImpl.jar (required for SOAP mode) 
 *  
 * These JAR files are located in the following path: 
 * <install directory>/sdk/client-libs/common 
 *  
 *   
 * SOAP required JAR files are located in the following path: 
 * <install directory>/sdk/client-libs/thirdparty 
 *  
 * 
 */ package com.adobe.idp.dsc.applicationmanager; 
 
import java.io.FileInputStream; 
import java.util.List; 
import java.util.Properties; 
 
import com.adobe.idp.Document; 
import com.adobe.idp.dsc.clientsdk.ServiceClientFactory; 
import com.adobe.idp.dsc.clientsdk.ServiceClientFactoryProperties; 
import com.adobe.livecycle.applicationmanager.client.ApplicationManagerClient; 
import com.adobe.livecycle.applicationmanager.client.ApplicationManagerClientException; 
 
public class GetApplications_SOAP { 
 
    public static void main(String[] args) { 
        //Set connection properties required to invoke AEM Forms 
        Properties connectionProps = new Properties(); 
        connectionProps.setProperty("DSC_DEFAULT_SOAP_ENDPOINT", "http://[server]:[port]"); 
        connectionProps.setProperty("DSC_TRANSPORT_PROTOCOL", ServiceClientFactoryProperties.DSC_SOAP_PROTOCOL);          
        connectionProps.setProperty("DSC_SERVER_TYPE", "JBoss"); 
        connectionProps.setProperty("DSC_CREDENTIAL_USERNAME", "administrator"); 
        connectionProps.setProperty("DSC_CREDENTIAL_PASSWORD", "password"); 
 
        //Create ServiceClientFactory object 
        ServiceClientFactory myFactory = ServiceClientFactory.createInstance(connectionProps); 
        //Create ApplicationManagerClient object 
        ApplicationManagerClient appClient = new ApplicationManagerClient(myFactory); 
         
        Document doc = null; 
        try { 
             
            final FileInputStream fileApp = new FileInputStream("C:\\appraisal.lca"); 
            doc = new Document(fileApp); 
             
        } catch (Exception e) { 
            e.printStackTrace(); 
        } 
         
        try { 
         
            //Import the application into the LC server 
            final String resourceID = appClient.importApplication(doc); 
            System.out.println("Import application with resource ID: " + resourceID + " is completed successfully!"); 
         
        } catch (ApplicationManagerClientException e) { 
            e.printStackTrace();     
        } 
 
        try { 
                //Get applications from LC server 
                List appList = appClient.getApplications(); 
                System.out.println("Get applications from LC Server: " + appList.size()); 
        } catch (Exception e) { 
            e.printStackTrace(); 
        } 
    } 
}

// Ethnio survey code removed