Quick Start (SwaRef): Delete Content Services content using the web service API (Deprecated)

The following Java code example deletes a space named /Company Home/Test Directory. (See Deleting Content from Content Services (deprecated).)

/** 
    * Ensure that you create Java proxy files that consume 
    * the DocumentManagement WSDL. You can use JAX-WS to create 
    * the proxy Java files.   
    *    
    * For information, see "Invoking LiveCycle using SwaRef" in Programming with LiveCycle.   
    */ 
 
import javax.xml.ws.BindingProvider; 
import com.adobe.idp.services.*; 
 
public class DeleteContentSwaRef { 
 
    public static void main(String[] args) 
        { 
         try{ 
           String url = "http://localhost:8080/soap/services/DocumentManagementService?blob=swaref"; 
           String username = "administrator"; 
           String password = "password"; 
 
           //Create a DocumentManagementService instance 
           DocumentManagementServiceService myDMServiceInterface = new DocumentManagementServiceService(); 
           DocumentManagementService documentManagement = myDMServiceInterface.getDocumentManagementService(); 
 
     ((BindingProvider)documentManagement).getRequestContext().put(javax.xml.ws.BindingProvider.ENDPOINT_ADDRESS_PROPERTY, url); 
     ((BindingProvider)documentManagement).getRequestContext().put(javax.xml.ws.BindingProvider.USERNAME_PROPERTY, username); 
     ((BindingProvider)documentManagement).getRequestContext().put(javax.xml.ws.BindingProvider.PASSWORD_PROPERTY, password); 
 
         //Specify the name of the store and node 
        String storeName ="SpacesStore";  
        String nodeName = "/Company Home/Test Directory" ; 
         
        //Delete /Company Home/Test Directory 
        Boolean ans = documentManagement.deleteContent(storeName, nodeName); 
         
        if (ans == true) 
            System.out.println("The content was successfully deleted"); 
        else 
            System.out.println("The content was not deleted"); 
         
 
         }catch (Exception e) { 
               e.printStackTrace(); 
             }      
          } 
     }