package de.tu_dresden.diplom.richter_mirko_mat2628335;

import org.apache.log4j.Logger;
import org.apache.axis.client.AdminClient;

import java.net.URL;
import java.net.MalformedURLException;

/**
 * 
 */
public class UndeployServices {

   private static final Logger logger = Logger.getLogger(UndeployServices.class);

   public static void main(String[] args){
      AdminClient client = new AdminClient();
      Configuration conf = new Configuration(Configuration.APPLICATION_MODULES_BASE);
      try {
         client.setTargetEndpointAddress(new URL(conf.getDeploymentAdminServiceLocation()));
         String webInfDir = conf.getModuleUsageCounterHome() + "/WEB-INF";
         String deploymentServiceOption = "-l" + conf.getDeploymentServiceLocation();
         client.process(new String[]{deploymentServiceOption, webInfDir + "/witness_undeploy.wsdd"});
         //client.process(new String[]{deploymentServiceOption, webInfDir + "/client1_undeploy.wsdd"});
         //client.
      } catch (MalformedURLException e) {
         e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
      } catch (Exception e) {
         e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
      }
   }
}
