Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse')
-rw-r--r--bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/AxisConsumptionCore.properties37
-rw-r--r--bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/AxisConsumptionCoreMessages.java38
-rw-r--r--bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/command/AxisDeployCommand.java155
-rw-r--r--bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/command/GeronimoAxisDeployCommand.java279
-rw-r--r--bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/command/Java2WSDLCommand.java256
-rw-r--r--bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/command/WSDL2JavaCommand.java421
-rw-r--r--bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/common/JavaWSDLParamModifier.java90
-rw-r--r--bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/common/JavaWSDLParameter.java472
-rw-r--r--bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/common/NameMappingUtils.java73
-rw-r--r--bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/context/AxisEmitterContext.java160
-rw-r--r--bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/context/AxisEmitterDefaults.java78
-rw-r--r--bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/context/PersistentAxisEmitterContext.java103
-rw-r--r--bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/locator/AxisWebServiceLocator.java192
-rw-r--r--bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/plugin/WebServiceAxisConsumptionCorePlugin.java118
14 files changed, 0 insertions, 2472 deletions
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/AxisConsumptionCore.properties b/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/AxisConsumptionCore.properties
deleted file mode 100644
index 022ed2f0a..000000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/AxisConsumptionCore.properties
+++ /dev/null
@@ -1,37 +0,0 @@
-###############################################################################
-# Copyright (c) 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-#
-# Messages for AxisDeployCommand
-#
-MSG_ERROR_PROJECT_URL_PARAM_NOT_SET=IWAB0054E Web project URL for deployment of Web service is not set in AxisDeployCommand
-MSG_ERROR_DEPLOY_FILE_PARAM_NOT_SET=IWAB0488E Location of Axis deployment file is not set in AxisDeployCommand
-MSG_ERROR_AXIS_DEPLOY=IWAB0489E Error when deploying Web service to Axis runtime
-MSG_AXIS_DEPLOY=Deploying Web service to Axis run-time environment
-
-#
-# Messages for Java2WSDLCommand
-#
-MSG_GENERATE_WSDL=Generating WSDL file: {0}
-MSG_ERROR_JAVA_WSDL_GENERATE=IWAB0398E Error in generating WSDL from Java:
-
-#
-# Messages for WSDL2JavaCommand
-#
-MSG_PARSING_WSDL=Parsing WSDL file: {0}
-MSG_ERROR_WSDL_JAVA_GENERATE=IWAB0399E Error in generating Java from WSDL:
-MSG_ERROR_MOVE_RESOURCE=IWAB0523E Error moving resource: {0}
-MSG_ERROR_CREATE_TEMP_DIR=Error creating temporary directory
-
-#
-# Messages common for all
-#
-MSG_ERROR_JAVA_WSDL_PARAM_NOT_SET=IWAB0397E JavaWSDLParam not set
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/AxisConsumptionCoreMessages.java b/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/AxisConsumptionCoreMessages.java
deleted file mode 100644
index c43b740c6..000000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/AxisConsumptionCoreMessages.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.consumption.core;
-
-import org.eclipse.osgi.util.NLS;
-
-public final class AxisConsumptionCoreMessages extends NLS {
-
- private static final String BUNDLE_NAME = "org.eclipse.jst.ws.internal.axis.consumption.core.AxisConsumptionCore";//$NON-NLS-1$
-
- private AxisConsumptionCoreMessages() {
- // Do not instantiate
- }
-
- public static String MSG_ERROR_PROJECT_URL_PARAM_NOT_SET;
- public static String MSG_ERROR_DEPLOY_FILE_PARAM_NOT_SET;
- public static String MSG_ERROR_AXIS_DEPLOY;
- public static String MSG_AXIS_DEPLOY;
- public static String MSG_GENERATE_WSDL;
- public static String MSG_ERROR_JAVA_WSDL_GENERATE;
- public static String MSG_PARSING_WSDL;
- public static String MSG_ERROR_WSDL_JAVA_GENERATE;
- public static String MSG_ERROR_JAVA_WSDL_PARAM_NOT_SET;
- public static String MSG_ERROR_MOVE_RESOURCE;
- public static String MSG_ERROR_CREATE_TEMP_DIR;
-
- static {
- NLS.initializeMessages(BUNDLE_NAME, AxisConsumptionCoreMessages.class);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/command/AxisDeployCommand.java b/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/command/AxisDeployCommand.java
deleted file mode 100644
index 602f83dc3..000000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/command/AxisDeployCommand.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.consumption.core.command;
-
-
-import java.io.File;
-
-import org.apache.axis.tools.ant.axis.AdminClientTask;
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.Target;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jst.ws.internal.axis.consumption.core.AxisConsumptionCoreMessages;
-import org.eclipse.jst.ws.internal.axis.consumption.core.common.JavaWSDLParameter;
-import org.eclipse.wst.command.internal.env.core.common.ProgressUtils;
-import org.eclipse.wst.command.internal.env.core.common.StatusUtils;
-import org.eclipse.wst.common.environment.IEnvironment;
-import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
-/**
- * Commands are executable, undoable, redoable objects. Every Command has a name and a description.
- */
-
-public class AxisDeployCommand extends AbstractDataModelOperation
-{
- protected static final String SERVICE_EXT = "/services/AdminService"; //$NON-NLS-1$
-
- private JavaWSDLParameter javaWSDLParam;
-
- /**
- * Constructor for AxisDeployCommand.
- * @param String description
- * @param String name
- *
- */
- public AxisDeployCommand()
- {
- }
-
- public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable )
- {
- IEnvironment environment = getEnvironment();
- if (javaWSDLParam == null)
- {
- return StatusUtils.errorStatus(AxisConsumptionCoreMessages.MSG_ERROR_JAVA_WSDL_PARAM_NOT_SET);
- }
-
- if (javaWSDLParam.getProjectURL() == null || javaWSDLParam.getProjectURL().equals(""))
- { //$NON-NLS-1$
- return StatusUtils.errorStatus(AxisConsumptionCoreMessages.MSG_ERROR_PROJECT_URL_PARAM_NOT_SET);
- }
-
- if (javaWSDLParam.getDeploymentFiles() == null || javaWSDLParam.getDeploymentFiles().length == 0)
- {
- return StatusUtils.errorStatus(AxisConsumptionCoreMessages.MSG_ERROR_DEPLOY_FILE_PARAM_NOT_SET);
- }
-
- ProgressUtils.report(monitor, AxisConsumptionCoreMessages.MSG_AXIS_DEPLOY);
-
- IStatus status = executeAntTask();
- if (status.getSeverity() == Status.ERROR)
- {
- environment.getStatusHandler().reportError(status);
- }
-
- return status;
- }
-
- protected IStatus executeAntTask()
- {
- final class DeployTask extends AdminClientTask
- {
- public DeployTask()
- {
- super.setProject(new Project());
- super.getProject().init();
- super.setTaskType("axis"); //$NON-NLS-1$
- super.setTaskName("axis-admin"); //$NON-NLS-1$
- super.setOwningTarget(new Target());
- }
- }
-
- DeployTask adminClient = new DeployTask();
- String url = javaWSDLParam.getProjectURL() + SERVICE_EXT;
- adminClient.setUrl(url);
- adminClient.setXmlFile(new File(javaWSDLParam.getDeploymentFiles()[0]));
-
- // Since the admin server may not be available right away we will try
- // several times to execute it.
- try
- {
- BuildException lastException = null;
-
- for( int index = 0; index < 20; index++ )
- {
- try
- {
- lastException = null;
- adminClient.execute();
- }
- catch( BuildException exc )
- {
- lastException = exc;
-
- try
- {
- Thread.sleep( 200 );
- }
- catch( InterruptedException threadException )
- {
- }
- }
-
- // If no exception occured then we should break out of the loop.
- if( lastException == null ) break;
- }
-
- // If after many tries we still get an exception, then we will re throw it.
- if( lastException != null ) throw lastException;
- }
- catch (BuildException e)
- {
- e.printStackTrace();
- String message = e.getMessage();
- if (e.getCause() != null)
- {
- message = e.getCause().toString();
- }
-
- IStatus[] childStatus = new Status[1];
- childStatus[0] = StatusUtils.errorStatus( message);
- return StatusUtils.multiStatus(AxisConsumptionCoreMessages.MSG_ERROR_AXIS_DEPLOY, childStatus);
- }
- return Status.OK_STATUS;
- }
-
- /**
- * @param javaWSDLParam The javaWSDLParam to set.
- */
- public void setJavaWSDLParam(JavaWSDLParameter javaWSDLParam)
- {
- this.javaWSDLParam = javaWSDLParam;
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/command/GeronimoAxisDeployCommand.java b/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/command/GeronimoAxisDeployCommand.java
deleted file mode 100644
index 55abee273..000000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/command/GeronimoAxisDeployCommand.java
+++ /dev/null
@@ -1,279 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.consumption.core.command;
-
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.InputStream;
-
-import org.apache.axis.AxisEngine;
-import org.apache.axis.server.AxisServer;
-import org.apache.axis.tools.ant.axis.AdminClientTask;
-import org.apache.axis.utils.ClassUtils;
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.Target;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jst.ws.internal.axis.consumption.core.AxisConsumptionCoreMessages;
-import org.eclipse.jst.ws.internal.axis.consumption.core.common.JavaWSDLParameter;
-import org.eclipse.jst.ws.internal.common.J2EEUtils;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.wst.command.internal.env.core.common.ProgressUtils;
-import org.eclipse.wst.command.internal.env.core.common.StatusUtils;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.environment.IEnvironment;
-import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
-
-/**
- * Commands are executable, undoable, redoable objects. Every Command has a name and a description.
- */
-
-public class GeronimoAxisDeployCommand extends AbstractDataModelOperation
-{
-
- private JavaWSDLParameter javaWSDLParam;
-
- private String projectName_;
- private static final String AXIS_SERVER_CONFIG_FILE = "axis.ServerConfigFile";
-
- IFolder outputRoot;
-
- /**
- * Constructor for GeronimoAxisDeployCommand.
- * @param String projectName
- *
- */
- public GeronimoAxisDeployCommand(String projectName)
- {
- }
-
- public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable )
- {
- IEnvironment environment = getEnvironment();
- if (javaWSDLParam == null)
- {
- return StatusUtils.errorStatus(AxisConsumptionCoreMessages.MSG_ERROR_JAVA_WSDL_PARAM_NOT_SET);
- }
-
- if (javaWSDLParam.getProjectURL() == null || javaWSDLParam.getProjectURL().equals(""))
- { //$NON-NLS-1$
- return StatusUtils.errorStatus(AxisConsumptionCoreMessages.MSG_ERROR_PROJECT_URL_PARAM_NOT_SET);
- }
-
- if (javaWSDLParam.getDeploymentFiles() == null || javaWSDLParam.getDeploymentFiles().length == 0)
- {
- return StatusUtils.errorStatus(
- AxisConsumptionCoreMessages.MSG_ERROR_DEPLOY_FILE_PARAM_NOT_SET);
- }
-
- ProgressUtils.report(monitor, AxisConsumptionCoreMessages.MSG_AXIS_DEPLOY);
-
- IStatus status = executeAdminTask();
- if (status.getSeverity() == Status.ERROR)
- {
- environment.getStatusHandler().reportError(status);
- }
-
- status = executeAntTask();
- if (status.getSeverity() == Status.ERROR)
- {
- environment.getStatusHandler().reportError(status);
- }
- return status;
- }
-
- protected IStatus executeAntTask()
- {
- final class DeployTask extends AdminClientTask
- {
- public DeployTask()
- {
- super.setProject(new Project());
- super.getProject().init();
- super.setTaskType("axis"); //$NON-NLS-1$
- super.setTaskName("axis-admin"); //$NON-NLS-1$
- super.setOwningTarget(new Target());
- }
- }
-
- DeployTask adminClient = new DeployTask();
- String url = javaWSDLParam.getProjectURL() + AxisDeployCommand.SERVICE_EXT;
- adminClient.setUrl(url);
- adminClient.setXmlFile(new File(javaWSDLParam.getDeploymentFiles()[0]));
-
- // Since the admin server may not be available right away we will try
- // several times to execute it.
- try
- {
- BuildException lastException = null;
-
- for( int index = 0; index < 20; index++ )
- {
- try
- {
- lastException = null;
- adminClient.execute();
- }
- catch( BuildException exc )
- {
- lastException = exc;
-
- try
- {
- Thread.sleep( 200 );
- }
- catch( InterruptedException threadException )
- {
- }
- }
-
- // If no exception occured then we should break out of the loop.
- if( lastException == null ) break;
- }
-
- // If after many tries we still get an exception, then we will re throw it.
- if( lastException != null ) throw lastException;
- }
- catch (BuildException e)
- {
- e.printStackTrace();
- String message = e.getMessage();
- if (e.getCause() != null)
- {
- message = e.getCause().toString();
- }
-
- IStatus[] childStatus = new Status[1];
- childStatus[0] = StatusUtils.errorStatus( message);
- return StatusUtils.multiStatus(AxisConsumptionCoreMessages.MSG_ERROR_AXIS_DEPLOY, childStatus);
- }
- return Status.OK_STATUS;
-
- }
-
- protected IStatus executeAdminTask(){
-
- IStatus status = Status.OK_STATUS;
- // check if server-config.wsdd exists
- IVirtualComponent component = J2EEUtils.getVirtualComponent( projectName_ );
- outputRoot = J2EEUtils.getOutputContainerRoot( component );
- IPath path = new Path( "WEB-INF" ).append( "server-config.wsdd" );
- IFile descriptorFile = outputRoot.getFile( path );
-
- if (!descriptorFile.exists()){
- status = createServerConfigFile();
- if (status.getSeverity()==Status.ERROR)
- return status;
- }
-
- // check if deploy.wsdd exists
- String deployWSDD = javaWSDLParam.getDeploymentFiles()[0];
- File deployFile = new File(deployWSDD);
- if (deployFile==null || !deployFile.exists()){
- return status;
- }
-
- try {
- // get Classpath
- String jarsCP = new String();
- // classes dir
- IPath classesPath = new Path("WEB-INF").append("classes");
- IFile classesDir = outputRoot.getFile(classesPath);
- jarsCP = "\""+classesDir.getRawLocation().toOSString()+"\"";
-
- // lib JARs
- IPath libPath = new Path("WEB-INF").append("lib");
- IFile libEntry = outputRoot.getFile(libPath);
- IFolder libFolder = (IFolder)ResourceUtils.findResource(libEntry.getFullPath());
- IResource[] JARfiles = libFolder.members();
- for (int i=0;i<JARfiles.length;i++){
- IResource res = JARfiles[i];
- if (res.getFileExtension().equals("jar")){
- jarsCP = jarsCP + ";\""+ res.getRawLocation().toOSString()+"\"";
- }
- }
-
- // form and run utils.Admin command
- String adminCommand = new String("java -Daxis.ServerConfigFile="+ descriptorFile.getRawLocation().toOSString()
- +" -cp "+jarsCP+" org.apache.axis.utils.Admin server "+deployFile.getCanonicalPath());
- Runtime.getRuntime().exec(adminCommand);
-
- }
- catch(Exception e){
- System.setProperty(AXIS_SERVER_CONFIG_FILE,"server-conifg.wsdd");
- e.printStackTrace();
- String message = e.getMessage();
- if (e.getCause() != null)
- {
- message = e.getCause().toString();
- }
-
- IStatus[] childStatus = new Status[1];
- childStatus[0] = StatusUtils.errorStatus( message);
- return StatusUtils.multiStatus(AxisConsumptionCoreMessages.MSG_ERROR_AXIS_DEPLOY, childStatus);
- }
-
- return status;
- }
-
- /**t
- * Creates the initial server-config.wsdd file from a template in Axis
- * @return
- */
- private IStatus createServerConfigFile(){
- try{
-
- // server-config.wsdd file
- IPath path = new Path( "WEB-INF" ).append( "server-config.wsdd" );
- IFile descriptorFile = outputRoot.getFile( path );
-
- // create the initial server-config.wsdd file
- AxisEngine preEngine = new AxisServer();
- InputStream is = ClassUtils.getResourceAsStream(preEngine.getClass(), "server-config.wsdd");
- FileOutputStream fos = new FileOutputStream(descriptorFile.getRawLocation().toOSString());
- ResourceUtils.copyStream(is, fos);
- fos.close();
-
- return Status.OK_STATUS;
- }
- catch(Exception e){
- e.printStackTrace();
- String message = e.getMessage();
- if (e.getCause() != null)
- {
- message = e.getCause().toString();
- }
-
- IStatus[] childStatus = new Status[1];
- childStatus[0] = StatusUtils.errorStatus( message);
- return StatusUtils.multiStatus(AxisConsumptionCoreMessages.MSG_ERROR_AXIS_DEPLOY, childStatus);
-
- }
- }
-
- /**
- * @param javaWSDLParam The javaWSDLParam to set.
- */
- public void setJavaWSDLParam(JavaWSDLParameter javaWSDLParam)
- {
- this.javaWSDLParam = javaWSDLParam;
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/command/Java2WSDLCommand.java b/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/command/Java2WSDLCommand.java
deleted file mode 100644
index 41e72f630..000000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/command/Java2WSDLCommand.java
+++ /dev/null
@@ -1,256 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * yyyymmdd bug Email and other contact information
- * -------- -------- -----------------------------------------------------------
- * 20060106 121199 jesper@selskabet.org - Jesper Møller
- * 20060329 127016 andyzhai@ca.ibm.com - Andy Zhai
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.consumption.core.command;
-
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.util.HashMap;
-import java.util.Iterator;
-
-import org.apache.axis.tools.ant.wsdl.Java2WsdlAntTask;
-import org.apache.axis.tools.ant.wsdl.NamespaceMapping;
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.Target;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jst.ws.internal.axis.consumption.core.AxisConsumptionCoreMessages;
-import org.eclipse.jst.ws.internal.axis.consumption.core.common.JavaWSDLParameter;
-import org.eclipse.jst.ws.internal.axis.consumption.core.context.AxisEmitterContext;
-import org.eclipse.jst.ws.internal.axis.consumption.core.context.AxisEmitterDefaults;
-import org.eclipse.jst.ws.internal.axis.consumption.core.plugin.WebServiceAxisConsumptionCorePlugin;
-import org.eclipse.jst.ws.internal.plugin.WebServicePlugin;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.command.internal.env.common.FileResourceUtils;
-import org.eclipse.wst.command.internal.env.core.common.ProgressUtils;
-import org.eclipse.wst.command.internal.env.core.common.StatusUtils;
-import org.eclipse.wst.command.internal.env.core.context.ResourceContext;
-import org.eclipse.wst.common.environment.IEnvironment;
-import org.eclipse.wst.common.environment.ILog;
-import org.eclipse.wst.common.environment.IStatusHandler;
-import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
-
-/**
- * Commands are executable, undoable, redoable objects.
- * Every Command has a name and a description.
- */
-
-public class Java2WSDLCommand extends AbstractDataModelOperation
-{
-
- private JavaWSDLParameter javaWSDLParam_;
- private File tempOutputWsdlFile;
- private final String TEMP = "temp"; //$NON-NLS-1$
- private final String WSDL_EXT = ".wsdl"; //$NON-NLS-1$
-
- public Java2WSDLCommand() {
- }
- /**
- * Constructor for Java2WSDLCommand.
- */
- public Java2WSDLCommand(JavaWSDLParameter javaWSDLParam) {
- super();
- this.javaWSDLParam_ = javaWSDLParam;
- }
-
- public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable )
- {
- IEnvironment environment = getEnvironment();
- IStatus status;
- if (javaWSDLParam_ == null) {
- status = StatusUtils.errorStatus(AxisConsumptionCoreMessages.MSG_ERROR_JAVA_WSDL_PARAM_NOT_SET);
- environment.getStatusHandler().reportError(status);
- return status;
- }
-
- if (javaWSDLParam_.getBeanName() == null) {
- status = StatusUtils.errorStatus(AxisConsumptionCoreMessages.MSG_ERROR_JAVA_WSDL_PARAM_NOT_SET);
- environment.getStatusHandler().reportError(status);
- return status;
- }
-
- ProgressUtils.report(monitor, NLS.bind(AxisConsumptionCoreMessages.MSG_GENERATE_WSDL, javaWSDLParam_.getBeanName() ));
-
- return executeAntTask(environment, monitor);
- }
-
- protected IStatus executeAntTask(IEnvironment environment, IProgressMonitor monitor) {
-
- final class Emitter extends Java2WsdlAntTask {
- public Emitter() {
- super.setProject(new Project());
- super.getProject().init();
- super.setTaskType("axis"); //$NON-NLS-1$
- super.setTaskName("axis-java2wsdl"); //$NON-NLS-1$
- super.setOwningTarget(new Target());
- }
- }
-
- IStatus status = Status.OK_STATUS;
- Emitter emitter = new Emitter();
- emitter.createClasspath().setPath(javaWSDLParam_.getClasspath());
- environment.getLog().log(ILog.INFO, 5008, this, "executeAntTask", "Class Path = "+ javaWSDLParam_.getClasspath());
-
- emitter.setPortTypeName(javaWSDLParam_.getPortTypeName());
- environment.getLog().log(ILog.INFO, 5009, this, "executeAntTask", "Port Type Name = "+ javaWSDLParam_.getPortTypeName());
-
- emitter.setServiceElementName(javaWSDLParam_.getServiceName());
- environment.getLog().log(ILog.INFO, 5010, this, "executeAntTask", "Service Name = "+ javaWSDLParam_.getServiceName());
-
- emitter.setLocation(javaWSDLParam_.getUrlLocation());
- environment.getLog().log(ILog.INFO, 5011, this, "executeAntTask", "URL Location = "+ javaWSDLParam_.getUrlLocation());
-
- emitter.setMethods(javaWSDLParam_.getMethodString());
- environment.getLog().log(ILog.INFO, 5012, this, "executeAntTask", "Methods = "+ javaWSDLParam_.getMethodString());
-
- emitter.setStyle(javaWSDLParam_.getStyle());
- environment.getLog().log(ILog.INFO, 5013, this, "executeAntTask", "Style = "+ javaWSDLParam_.getStyle());
-
- emitter.setUse(javaWSDLParam_.getUse());
- environment.getLog().log(ILog.INFO, 5014, this, "executeAntTask", "Use = "+ javaWSDLParam_.getUse());
-
- // create temporary directory to use as output directory for java2wsdl
- IPath pluginStateLoc = WebServiceAxisConsumptionCorePlugin.getInstance().getStateLocation();
- File tempDir = new File(pluginStateLoc.toString());
- File newTempFile = null;
- try {
- newTempFile = File.createTempFile(TEMP, WSDL_EXT, tempDir);
- tempOutputWsdlFile = newTempFile;
- } catch (Exception e) {
- tempOutputWsdlFile = new File (pluginStateLoc.append(TEMP+WSDL_EXT).toString());
- }
-
- emitter.setOutput(tempOutputWsdlFile);
-
- environment.getLog().log(ILog.INFO, 5015, this, "executeAntTask", "WSDL Location = "+ javaWSDLParam_.getOutputWsdlLocation());
-
- emitter.setNamespace(javaWSDLParam_.getNamespace());
- environment.getLog().log(ILog.INFO, 5016, this, "executeAntTask", "Name Space = "+ javaWSDLParam_.getNamespace());
-
- emitter.setClassName(javaWSDLParam_.getBeanName());
- environment.getLog().log(ILog.INFO, 5017, this, "executeAntTask", "Bean name = "+ javaWSDLParam_.getBeanName());
-
- emitter.setImplClass(javaWSDLParam_.getBeanName());
-
- AxisEmitterContext context = WebServiceAxisConsumptionCorePlugin.getInstance().getAxisEmitterContext();
-
- if (context.isUseInheritedMethodsEnabled() != AxisEmitterDefaults.getUseInheritedMethodsDefault())
- {
- emitter.setUseInheritedMethods(context.isUseInheritedMethodsEnabled());
- environment.getLog().log(ILog.INFO, 5099, this, "executeAntTask", " set UseInheritedMethods : " + context.isUseInheritedMethodsEnabled() );
- }
-
- HashMap mappings = javaWSDLParam_.getMappings();
- if(mappings != null){
- Iterator keys = mappings.keySet().iterator();
- while(keys.hasNext()){
- String pakage = (String)keys.next();
- String namespace = (String)mappings.get(pakage);
- NamespaceMapping map = new NamespaceMapping();
- map.setPackage(pakage);
- map.setNamespace(namespace);
- emitter.addMapping(map);
- }
- }
-
-
- try {
- emitter.execute();
- status = moveGeneratedWSDL(environment, monitor);
- } catch (BuildException e) {
- environment.getLog().log(ILog.ERROR, 5018, this, "executeAntTask", e);
- status = StatusUtils.errorStatus(
- AxisConsumptionCoreMessages.MSG_ERROR_JAVA_WSDL_GENERATE + " " //$NON-NLS-1$
- +e.getCause().toString(), e.getCause());
- environment.getStatusHandler().reportError(status);
- return status;
- } finally {
- if (tempOutputWsdlFile.exists()) {
- tempOutputWsdlFile.delete();
- }
- }
- return status;
-
- }
-
- public IStatus moveGeneratedWSDL(IEnvironment environment,
- IProgressMonitor monitor) {
- IStatus status = Status.OK_STATUS;
- FileInputStream finStream = null;
-
- ResourceContext context = WebServicePlugin.getInstance().getResourceContext();
- IStatusHandler statusHandler = environment.getStatusHandler();
-
- String outputWsdlLocation = javaWSDLParam_.getOutputWsdlLocation();
- IPath targetPath = new Path(outputWsdlLocation);
- try {
- finStream = new FileInputStream(tempOutputWsdlFile);
- if (finStream != null) {
- FileResourceUtils.createFileAtLocation(context, targetPath.makeAbsolute(), finStream,
- monitor, statusHandler);
- finStream.close();
- }
- } catch (Exception e) {
- status = StatusUtils.errorStatus(NLS.bind(AxisConsumptionCoreMessages.MSG_ERROR_MOVE_RESOURCE,new String[]{e.getLocalizedMessage()}), e);
- environment.getStatusHandler().reportError(status);
- } finally {
- try {
- if (finStream != null) {
- finStream.close();
- }
- } catch (IOException e) {
- }
- }
- return status;
- }
-
- public Status undo(IEnvironment environment) {
- return null;
- }
-
- public Status redo(IEnvironment environment) {
- return null;
- }
-
- /**
- * Returns the javaWSDLParam.
- * @return JavaWSDLParameter
- */
- public JavaWSDLParameter getJavaWSDLParam() {
- return javaWSDLParam_;
- }
-
- public void setJavaWSDLParam(JavaWSDLParameter javaWSDLParm) {
- this.javaWSDLParam_ = javaWSDLParm;
- }
-
- public String getWsdlURI()
- {
- File file = new File(getJavaWSDLParam().getOutputWsdlLocation());
- String url = "";
- try {
- url = file.toURL().toString();
- }
- catch(MalformedURLException mue){}
- return url;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/command/WSDL2JavaCommand.java b/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/command/WSDL2JavaCommand.java
deleted file mode 100644
index 797bec3ad..000000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/command/WSDL2JavaCommand.java
+++ /dev/null
@@ -1,421 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * yyyymmdd bug Email and other contact information
- * -------- -------- -----------------------------------------------------------
- * 20060329 127016 andyzhai@ca.ibm.com - Andy Zhai
- * 20060404 134791 andyzhai@ca.ibm.com - Andy Zhai
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.consumption.core.command;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import org.apache.axis.constants.Scope;
-import org.apache.axis.wsdl.toJava.Emitter;
-import org.apache.axis.wsdl.toJava.GeneratedFileInfo;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jst.ws.internal.axis.consumption.core.AxisConsumptionCoreMessages;
-import org.eclipse.jst.ws.internal.axis.consumption.core.common.JavaWSDLParameter;
-import org.eclipse.jst.ws.internal.axis.consumption.core.context.AxisEmitterContext;
-import org.eclipse.jst.ws.internal.axis.consumption.core.context.AxisEmitterDefaults;
-import org.eclipse.jst.ws.internal.axis.consumption.core.plugin.WebServiceAxisConsumptionCorePlugin;
-import org.eclipse.jst.ws.internal.common.ResourceUtils;
-import org.eclipse.jst.ws.internal.plugin.WebServicePlugin;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.command.internal.env.common.FileResourceUtils;
-import org.eclipse.wst.command.internal.env.core.common.ProgressUtils;
-import org.eclipse.wst.command.internal.env.core.common.StatusUtils;
-import org.eclipse.wst.command.internal.env.core.context.ResourceContext;
-import org.eclipse.wst.common.environment.IEnvironment;
-import org.eclipse.wst.common.environment.ILog;
-import org.eclipse.wst.common.environment.IStatusHandler;
-import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
-
-
-public class WSDL2JavaCommand extends AbstractDataModelOperation {
-
- private final String DEPLOY_TYPE = "deploy"; //$NON-NLS-1$
- private final String UNDEPLOY_TYPE = "undeploy"; //$NON-NLS-1$
- private final String TEMP = "temp"; //$NON-NLS-1$
- private JavaWSDLParameter javaWSDLParam;
- private String wsdlURI;
- private String httpBasicAuthUsername;
- private String httpBasicAuthPassword;
- private List deployFiles;
- private List javaFiles;
- private File tempOutputFile;
-
- public WSDL2JavaCommand() {
- }
-
- public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable )
- {
- IEnvironment environment = getEnvironment();
- IStatus status;
- if (javaWSDLParam == null) {
- status = StatusUtils.errorStatus(
- AxisConsumptionCoreMessages.MSG_ERROR_JAVA_WSDL_PARAM_NOT_SET);
- environment.getStatusHandler().reportError(status);
- return status;
- }
-
- if (wsdlURI != null) //bottom up case has already has the correct WSDL on javaWSDLParam
- {
- javaWSDLParam.setInputWsdlLocation(wsdlURI);
- }
- javaWSDLParam.setHTTPUsername(httpBasicAuthUsername);
- javaWSDLParam.setHTTPPassword(httpBasicAuthPassword);
-
- Emitter wsdl2Java = new Emitter();
- if (environment.getLog().isEnabled("emitter")) {
- wsdl2Java.setVerbose(true);
- } else {
- wsdl2Java.setVerbose(false);
- }
- boolean serverSide = javaWSDLParam.getServerSide() == JavaWSDLParameter.SERVER_SIDE_BEAN;
- wsdl2Java.setServerSide(serverSide);
- if (serverSide) {
- wsdl2Java.setSkeletonWanted(javaWSDLParam.isSkeletonDeploy());
- }
-
- // create temporary directory to use as output directory for wsdl2java
- tempOutputFile = createTempDir();
- wsdl2Java.setOutputDir(tempOutputFile.toString());
-
- try {
- if (javaWSDLParam.isMetaInfOnly()) {
- // for the case Java2WSDL-WSDL2Java
- HashMap pck2nsMap = javaWSDLParam.getMappings();
- if (pck2nsMap != null) {
- HashMap ns2pckMap = new HashMap();
- Iterator keys = pck2nsMap.keySet().iterator();
- while (keys.hasNext()) {
- String pakage = (String) keys.next();
- String namespace = (String) pck2nsMap.get(pakage);
- ns2pckMap.put(namespace, pakage);
- }
- wsdl2Java.setNamespaceMap(ns2pckMap);
- }
- } else {
- // for the case WSDL2Java
- if (javaWSDLParam.getMappings() != null) {
- wsdl2Java.setNamespaceMap(javaWSDLParam.getMappings());
- }
- }
- environment.getLog().log(ILog.INFO, 5019, this, "execute", "Java output = " + javaWSDLParam.getJavaOutput());
- if (javaWSDLParam.getHTTPPassword() != null) {
- wsdl2Java.setPassword(javaWSDLParam.getHTTPPassword());
- environment.getLog().log(ILog.INFO, 5081, this, "execute", "password: " + javaWSDLParam.getHTTPPassword());
- }
- if (javaWSDLParam.getHTTPUsername() != null) {
- wsdl2Java.setUsername(javaWSDLParam.getHTTPUsername());
- environment.getLog().log(ILog.INFO, 5082, this, "execute", "username: " + javaWSDLParam.getHTTPUsername());
- }
- environment.getLog().log(ILog.INFO, 5020, this, "execute", "WSDL Location = " + javaWSDLParam.getInputWsdlLocation());
-
- // If timeout is not set, the default timeout for wsdl2java is 45 seconds.
- // The user can change the timeout value by setting
- // "-DAxisWsdl2JavaTimeout=<timeout_value_in_milliseconds>" as VM argument
- // when starting the Eclipse workbench.
- //
- // For example, enter the following command to start the Eclipse workbench
- // in order to set the Axis WSDL to Java emitter timeout to 60 seconds:
- //
- // eclipse -vmargs "-DAxisWsdl2JavaTimeout=60000"
- //
- // When AxisWsdl2JavaTimeout is set, the Axis emitter preference page timeout setting is ignored
- AxisEmitterContext context = WebServiceAxisConsumptionCorePlugin.getInstance().getAxisEmitterContext();
- String wsdl2JavaTimeoutProperty = System.getProperty("AxisWsdl2JavaTimeout");
- long timeout;
- if (wsdl2JavaTimeoutProperty != null) {
- timeout = new Integer(wsdl2JavaTimeoutProperty).longValue();
- wsdl2Java.setTimeout(timeout);
- environment.getLog().log(ILog.INFO, 5091, this, "execute", "AxisWsdl2JavaTimeout = " + timeout);
- }
- else if(context.getTimeOut() != AxisEmitterDefaults.getTimeOutDefault())
- {
- timeout = context.getTimeOut() == -1 ? -1 : context.getTimeOut()* 1000;
- wsdl2Java.setTimeout(timeout);
- environment.getLog().log(ILog.INFO, 5100, this, "execute", "Timeout = " + timeout);
- }
- if (context.getDeployScopeType() != AxisEmitterDefaults.getDeployScopeDefault())
- {
- switch (context.getDeployScopeType())
- {
- case AxisEmitterContext.DEPLOY_SCOPE_TYPE_APPLICATION:
- wsdl2Java.setScope(Scope.APPLICATION);
- environment.getLog().log(ILog.INFO, 5101, this, "execute", " Deploy Scope: Application" );
- break;
- case AxisEmitterContext.DEPLOY_SCOPE_TYPE_REQUEST:
- wsdl2Java.setScope(Scope.REQUEST);
- environment.getLog().log(ILog.INFO, 5102, this, "execute", " Deploy Scope: Request" );
- break;
- case AxisEmitterContext.DEPLOY_SCOPE_TYPE_SESSTION:
- wsdl2Java.setScope(Scope.SESSION);
- environment.getLog().log(ILog.INFO, 5103, this, "execute", " Deploy Scope: Session" );
- break;
- default:
- }
- }
-
- if (context.isAllWantedEnabled() != AxisEmitterDefaults.getAllWantedDefault())
- {
- wsdl2Java.setAllWanted(context.isAllWantedEnabled());
- environment.getLog().log(ILog.INFO, 5104, this, "execute", " set AllWanted : " + context.isAllWantedEnabled() );
- }
-
- if (context.isHelperWantedEnabled() != AxisEmitterDefaults.getHelperWantedDefault())
- {
- wsdl2Java.setHelperWanted(context.isHelperWantedEnabled());
- environment.getLog().log(ILog.INFO, 5105, this, "execute", " set HelperWanted : " + context.isHelperWantedEnabled() );
- }
- if (context.isWrapArraysEnabled() != AxisEmitterDefaults.getWrapArraysDefault())
- {
- wsdl2Java.setWrapArrays(context.isWrapArraysEnabled());
- environment.getLog().log(ILog.INFO, 5106, this, "execute", " set WrapArrays : " + context.isWrapArraysEnabled() );
- }
-
- ProgressUtils.report(monitor, NLS.bind(AxisConsumptionCoreMessages.MSG_PARSING_WSDL, javaWSDLParam.getInputWsdlLocation() ) );
-
- wsdl2Java.run(javaWSDLParam.getInputWsdlLocation());
-
- javaFiles = wsdl2Java.getGeneratedFileNames();
-
- deployFiles = new ArrayList();
- if (serverSide) {
- // set deployment files
- List deploymentFiles1 = wsdl2Java.getGeneratedFileInfo().findType(DEPLOY_TYPE);
- List deploymentFiles2 = wsdl2Java.getGeneratedFileInfo().findType(UNDEPLOY_TYPE);
- if (deploymentFiles1 != null && deploymentFiles2 != null) {
- deploymentFiles1.addAll(deploymentFiles2);
- for (int i = 0; i < deploymentFiles1.size(); i++) {
- GeneratedFileInfo.Entry entry = (GeneratedFileInfo.Entry) deploymentFiles1.get(i);
- deployFiles.add(entry.fileName);
- }
- }
- javaFiles.removeAll(deployFiles);
- }
-
- status = moveGeneratedFiles(environment, monitor);
-
- } catch (Exception e) {
- environment.getLog().log(ILog.ERROR, 5021, this, "execute", e);
- status = StatusUtils.errorStatus(
- AxisConsumptionCoreMessages.MSG_ERROR_WSDL_JAVA_GENERATE + " " //$NON-NLS-1$
- + e.toString(), e);
- environment.getStatusHandler().reportError(status);
- } finally {
- deleteDir(tempOutputFile);
- }
- return status;
- }
-
- public IStatus moveGeneratedFiles( IEnvironment environment, IProgressMonitor monitor )
- {
- IStatus status = Status.OK_STATUS;
-
- FileInputStream finStream = null;
-
- try {
- String outputDir, javaOutput;
- outputDir = removeFileProtocol(javaWSDLParam.getOutput());
- javaOutput = removeFileProtocol(javaWSDLParam.getJavaOutput());
- ResourceContext context = WebServicePlugin.getInstance().getResourceContext();
-
- IPath outputPath = new Path (outputDir);
-
- String fileName;
- IPath targetPath=null;
- IStatusHandler statusHandler = environment.getStatusHandler();
- String deployFile;
- Iterator iterator;
-
- String tempOutputDir = tempOutputFile.toString();
- String [] movedDeployFiles = new String [deployFiles.size()];
- iterator = deployFiles.iterator();
- int i = 0;
- while (iterator.hasNext()) {
- deployFile = (String) iterator.next();
- File source = new File(deployFile);
- finStream = new FileInputStream(source);
- if (finStream != null) {
- if (deployFile.startsWith(tempOutputDir)) {
- fileName = deployFile.substring(tempOutputDir.length());
- targetPath = outputPath.append(fileName).makeAbsolute();
- FileResourceUtils.createFileAtLocation(context,
- targetPath,
- finStream,
- monitor,
- statusHandler);
- movedDeployFiles[i++]= ResourceUtils.getWorkspaceRoot().getFileForLocation(targetPath).getLocation().toString();
- }
- finStream.close();
- }
- }
-
- javaWSDLParam.setDeploymentFiles(movedDeployFiles);
-
- IPath javaOutputPath = new Path (javaOutput);
-
- String javaFile;
- String fullClassName = null;
- String [] movedJavaFiles = new String [javaFiles.size()];
- iterator = javaFiles.iterator();
- i = 0;
- while (iterator.hasNext()) {
- javaFile = (String) iterator.next();
- File source = new File(javaFile);
- finStream = new FileInputStream(source);
- if (finStream != null) {
- // for the case Java2WSDL-WSDL2Java, no need to move Java files, just delete them
- if (!javaWSDLParam.isMetaInfOnly()) {
- // for the case WSDL2Java, move Java files to Java output directory
- if (javaFile.startsWith(tempOutputDir)) {
- fullClassName = javaFile.substring(tempOutputDir.length());
- targetPath = javaOutputPath.append(fullClassName).makeAbsolute();
- FileResourceUtils.createFileAtLocation(context,
- targetPath,
- finStream,
- monitor,
- statusHandler);
- movedJavaFiles[i++]= ResourceUtils.getWorkspaceRoot().getFileForLocation(targetPath).getLocation().toString();
- }
- }
-
- finStream.close();
- }
- }
- javaWSDLParam.setJavaFiles(movedJavaFiles);
-
- } catch (Exception e) {
- status = StatusUtils.errorStatus(NLS.bind(AxisConsumptionCoreMessages.MSG_ERROR_MOVE_RESOURCE,new String[]{e.getLocalizedMessage()}), e);
- environment.getStatusHandler().reportError(status);
-
- } finally {
- if (finStream != null) {
- try {
- finStream.close();
- } catch (IOException e) {
- }
- }
- }
-
- return status;
- }
-
- /**
- * Deletes all files and subdirectories under dir.
- * Just ignore and keep going if delete is not successful
- *
- * @param dir directory to delete
- */
- public void deleteDir(File dir) {
- if (dir.isDirectory()) {
- String[] children = dir.list();
- for (int i = 0; i < children.length; i++) {
- deleteDir(new File(dir, children[i]));
- }
- }
- // The directory is now empty so delete it
- dir.delete();
- }
-
- /**
- * Creates a temporary directory under the plugin's state location (i.e.
- * .metadata/.plugin directory)
- *
- * @return File
- */
- private File createTempDir() {
- String pluginTempDir = WebServiceAxisConsumptionCorePlugin
- .getInstance().getStateLocation().toString();
- File tempDir = new File(pluginTempDir);
- File newTempDir = null;
- try {
- newTempDir = File.createTempFile(TEMP, "", tempDir);
- // delete the temp file and create a temp directory instead
- if (newTempDir.delete()) {
- if (newTempDir.mkdir()) {
- tempDir = newTempDir;
- }
- }
- return tempDir;
- } catch (Exception e) {
- return tempDir;
- }
- }
-
- /*
- * Hack: Axis doesn't like file URLs
- */
- private String removeFileProtocol(String s) {
- if (s.startsWith("file:")) {
- String newS = s.substring(5, s.length());
- int i = newS.indexOf(':');
- if (i != -1) {
- String protocol = newS.substring(0, i);
- int j = protocol.indexOf('/');
- int k = protocol.indexOf('\\');
- int max = Math.max(j, k);
- if (max != -1)
- newS = newS.substring(max + 1, newS.length());
- }
- return newS;
- }
- return s;
- }
-
- public Status undo(IEnvironment environment) {
- return null;
- }
-
- public Status redo(IEnvironment environment) {
- return null;
- }
-
- public void setJavaWSDLParam(JavaWSDLParameter javaWSDLParam) {
- this.javaWSDLParam = javaWSDLParam;
- }
-
- public JavaWSDLParameter getJavaWSDLParam() {
- return javaWSDLParam;
- }
-
- /**
- * @param httpBasicAuthPassword
- * The httpBasicAuthPassword to set.
- */
- public void setHttpBasicAuthPassword(String httpBasicAuthPassword) {
- this.httpBasicAuthPassword = httpBasicAuthPassword;
- }
-
- /**
- * @param httpBasicAuthUsername
- * The httpBasicAuthUsername to set.
- */
- public void setHttpBasicAuthUsername(String httpBasicAuthUsername) {
- this.httpBasicAuthUsername = httpBasicAuthUsername;
- }
-
- public void setWsdlURI(String wsdlURI) {
- this.wsdlURI = wsdlURI;
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/common/JavaWSDLParamModifier.java b/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/common/JavaWSDLParamModifier.java
deleted file mode 100644
index 8d1b149b6..000000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/common/JavaWSDLParamModifier.java
+++ /dev/null
@@ -1,90 +0,0 @@
-package org.eclipse.jst.ws.internal.axis.consumption.core.common;
-
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Map;
-import java.util.Properties;
-import java.util.StringTokenizer;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.command.internal.env.core.data.BeanModifier;
-
-public class JavaWSDLParamModifier implements BeanModifier {
-
- public void modify(Object bean, Object propertyHolder)
- {
- JavaWSDLParameter javaWSDLParam;
- if (bean != null)
- {
- javaWSDLParam = (JavaWSDLParameter)bean;
- }
- else
- {
- javaWSDLParam = new JavaWSDLParameter();
- }
-
- //look for each known key in the map & if there, convert the properties and set on javaWSDLParam
- if (propertyHolder instanceof Map)
- {
- Map propertyMap = (Map)propertyHolder;
-
- if (propertyMap.containsKey("Use"))
- {
- javaWSDLParam.setUse((String)propertyMap.get("Use"));
- }
- if (propertyMap.containsKey("Style"))
- {
- javaWSDLParam.setStyle((String)propertyMap.get("Style"));
- }
- if (propertyMap.containsKey("JavaOutput"))
- {
- javaWSDLParam.setJavaOutput((String)propertyMap.get("JavaOutput"));
- }
- if (propertyMap.containsKey("Methods"))
- {
- //get Method list from the map
- String methodList = (String)propertyMap.get("Methods");
-
- //tokenize the method list
- StringTokenizer tok = new StringTokenizer(methodList, " ");
- Hashtable methods = new Hashtable();
- while (tok.hasMoreTokens())
- {
- methods.put(tok.nextToken(), new Boolean(true));
- }
- javaWSDLParam.setMethods(methods);
- }
- if (propertyMap.containsKey("Mappings"))
- {
- //get name of the file that has the mappings in it from the map
- String filename = (String)propertyMap.get("Mappings");
- //get the list of mapping from the file
- HashMap mappings = readMappingsFromFile(filename);
- javaWSDLParam.setMappings(mappings);
- }
- }
- }
-
- private HashMap readMappingsFromFile(String filename)
- {
- HashMap hashmap = new HashMap();
- IFile resource = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(filename));
-
- if (resource != null )
- {
- try
- {
- Properties props = new Properties();
- props.load(resource.getContents());
- hashmap.putAll(props);
- }
- catch (Exception e)
- {
- // TODO Report some error here.
- }
- }
- return hashmap;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/common/JavaWSDLParameter.java b/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/common/JavaWSDLParameter.java
deleted file mode 100644
index 03fa1f860..000000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/common/JavaWSDLParameter.java
+++ /dev/null
@@ -1,472 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * yyyymmdd bug Email and other contact information
- * -------- -------- -----------------------------------------------------------
- * 20060330 124667 kathy@ca.ibm.com - Kathy Chan
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.consumption.core.common;
-
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Hashtable;
-
-
-public class JavaWSDLParameter {
-
- public static final byte SERVER_SIDE_NONE = 0;
- public static final byte SERVER_SIDE_BEAN = 1;
- public static final byte SERVER_SIDE_EJB = 2;
-
- public static final String STYLE_RPC = "RPC"; //$NON-NLS-1$
- public static final String STYLE_DOCUMENT = "DOCUMENT"; //$NON-NLS-1$
- public static final String STYLE_WRAPPED = "WRAPPED"; //$NON-NLS-1$
-
- public static final String USE_LITERAL = "LITERAL"; //$NON-NLS-1$
- public static final String USE_ENCODED = "ENCODED"; //$NON-NLS-1$
-
- private String beanName = null; // The name of the Java bean
- private String classpath = null;
- // The class path for loading the bean and command execution
- private String beanPackage = null; // The package location of the bean
- private String portTypeName = null; // The name of the port type element
- private String serviceName = null; // The name of the service element
- private String outputWsdlLocation = null;
- // The output location of the WSDL file
- private String inputWsdlLocation = null;
- // The input location of the WSDL file
- private String urlLocation = null; // The URL location of the web service
- private Hashtable methods = null; // The array of method names
- private String methodString_ = ""; //$NON-NLS-1$
- //The string representation of the method array
- private String style = null;
- // The style (RPC | DOCUMENT | WRAPPED) attribute for the generated WSDL
- private String use = null;
- // The use (LITERAL | ENCODED) attribtue for the generated WSDL
- private String output = null;
- // The output location for deployment descriptors & Java code (output from WSDL2Java command)
- private String javaOutput = null;
- // The output location for Java code (output from WSDL2Java command)
- private boolean metaInfOnly = false; // META-INF-ONLY flag
- private byte serverSide = SERVER_SIDE_NONE;
- // server-side flag (SERVER_SIDE_NONE | SERVER_SIDE_BEAN | SERVER_SIDE_EJB)
- private String namespace = null;
- private boolean skeletonDeploy = true;
- private String container = null;
- private String[] deploymentFiles = null;
- private String[] javaFiles = null;
- private String projectURL = null;
- private boolean guessProjectURL = false;
- private HashMap mappingPairs;
- private String httpUsername_ = null;
- private String httpPassword_ = null;
-
- public void setContainer(String container) {
- this.container = container;
- }
-
- public String getContainer() {
- return container;
- }
-
- /**
- * Constructor for JavaWSDLParameter.
- */
- public JavaWSDLParameter() {
- }
-
- /**
- * Returns the beanName.
- * @return String
- */
- public String getBeanName() {
- return beanName;
- }
-
- public String getBeanPackage() {
- return beanPackage;
- }
-
- /**
- * Returns the portTypeName.
- * @return String
- */
- public String getPortTypeName() {
- return portTypeName;
- }
-
- /**
- * Returns the serviceName.
- * @return String
- */
- public String getServiceName() {
- return serviceName;
- }
-
- /**
- * Returns the output.
- * @return String
- */
- public String getOutput() {
- return output;
- }
-
- /**
- * Returns the methods.
- * @return String[]
- */
- public Hashtable getMethods() {
- return methods;
- }
-
- /**
- * Returns the comma seperated string represetation of the methods.
- * @return String
- */
- public String getMethodString() {
- if (methodString_.equals(""))
- {
- Enumeration e = methods.keys();
- for (int i=0; e.hasMoreElements(); i++)
- {
-
- String signature = (String) e.nextElement();
- if (((Boolean) methods.get(signature)).booleanValue()){
- int index = signature.indexOf('(');
- String name = signature.substring(0, index);
- methodString_ += name;
- }
- if (i != methods.size() -1) // this is not the last array item
- {
- methodString_ += ",";
- }
- }
- }
- return methodString_;
- }
-
- /**
- * Sets a comma separated string of methods *
- */
- public void setMethodString(String methods)
- {
- methodString_ = methods;
- }
-
- /**
- * Returns the style attribute.
- * @return String
- */
- public String getStyle() {
- return style;
- }
-
- /**
- * Returns the urlLocation.
- * @return String
- */
- public String getUrlLocation() {
- return urlLocation;
- }
-
- /**
- * Returns the use attribute.
- * @return String
- */
- public String getUse() {
- return use;
- }
-
- /**
- * Returns the outputWsdlLocation.
- * @return String
- */
- public String getOutputWsdlLocation() {
- return outputWsdlLocation;
- }
-
- /**
- * Sets the beanName.
- * @param beanName The beanName to set
- */
- public void setBeanName(String beanName) {
- this.beanName = beanName;
- }
-
- public void setBeanPackage(String beanPackage) {
- this.beanPackage = beanPackage;
- }
-
- /**
- * Sets the portTypeName.
- * @param portTypeName The portTypeName to set
- */
- public void setPortTypeName(String portTypeName) {
- this.portTypeName = portTypeName;
- }
-
- /**
- * Sets the serviceName.
- * @param serviceName The serviceName to set
- */
- public void setServiceName(String serviceName) {
- this.serviceName = serviceName;
- }
-
- /**
- * Sets the output.
- * @param output The output to set
- */
- public void setOutput(String output) {
- this.output = output;
- }
-
- /**
- * Sets the methods.
- * @param methods The methods to set
- */
- public void setMethods(Hashtable methods) {
- this.methods = methods;
- }
-
- /**
- * Sets the style.
- * @param style The style to set
- */
- public void setStyle(String style) {
- this.style = style;
- }
-
- /**
- * Sets the urlLocation.
- * @param urlLocation The urlLocation to set
- */
- public void setUrlLocation(String urlLocation) {
- this.urlLocation = urlLocation;
- }
-
- /**
- * Sets the use.
- * @param use The use to set
- */
- public void setUse(String use) {
- this.use = use;
- }
-
- /**
- * Sets the outputWsdlLocation.
- * @param outputWsdlLocation The outputWsdlLocation to set
- */
- public void setOutputWsdlLocation(String wsdlLocation) {
- this.outputWsdlLocation = wsdlLocation;
- }
-
- /**
- * Returns the metaInfOnly.
- * @return boolean
- */
- public boolean isMetaInfOnly() {
- return metaInfOnly;
- }
-
- /**
- * Sets the metaInfOnly.
- * @param metaInfOnly The metaInfOnly to set
- */
- public void setMetaInfOnly(boolean metaInfOnly) {
- this.metaInfOnly = metaInfOnly;
- }
-
- /**
- * Returns the serverSide.
- * @return byte
- */
- public byte getServerSide() {
- return serverSide;
- }
-
- /**
- * Sets the serverSide.
- * @param serverSide The serverSide to set
- */
- public void setServerSide(byte serverSide) {
- this.serverSide = serverSide;
- }
-
- /**
- * Returns the inputWsdlLocation.
- * @return String
- */
- public String getInputWsdlLocation() {
- return inputWsdlLocation;
- }
-
- /**
- * Sets the inputWsdlLocation.
- * @param inputWsdlLocation The inputWsdlLocation to set
- */
- public void setInputWsdlLocation(String inputWsdlLocation) {
- this.inputWsdlLocation = inputWsdlLocation;
- }
-
- /**
- * Returns the namespace.
- * @return String
- */
- public String getNamespace() {
- return namespace;
- }
-
- /**
- * Sets the namespace.
- * @param namespace The namespace to set
- */
- public void setNamespace(String namespace) {
- this.namespace = namespace;
- }
-
- /**
- * Returns the Java output.
- * @return String
- */
- public String getJavaOutput() {
- return javaOutput;
- }
-
- /**
- * Sets the javaOutput.
- * @param javaOutput The Java output to set
- */
- public void setJavaOutput(String javaOutput) {
- this.javaOutput = javaOutput;
- }
-
- /**
- * @return
- */
- public String getClasspath() {
- return classpath;
- }
-
- /**
- * @param string
- */
- public void setClasspath(String string) {
- classpath = string;
- }
-
- /**
- * @return
- */
- public boolean isSkeletonDeploy() {
- return skeletonDeploy;
- }
-
- /**
- * @param b
- */
- public void setSkeletonDeploy(boolean b) {
- skeletonDeploy = b;
- }
-
- /**
- * @return
- */
- public String[] getDeploymentFiles() {
- return deploymentFiles;
- }
-
- /**
- * @param strings
- */
- public void setDeploymentFiles(String[] strings) {
- deploymentFiles = strings;
- }
-
- /**
- * @return
- */
- public String[] getJavaFiles() {
- return javaFiles;
- }
-
- /**
- * @param strings
- */
- public void setJavaFiles(String[] strings) {
- javaFiles = strings;
- }
-
- /**
- * @return
- */
- public String getProjectURL() {
- return projectURL;
- }
-
- /**
- * @param string
- */
- public void setProjectURL(String string) {
- projectURL = string;
- }
-
- public HashMap getMappings()
- {
- return mappingPairs;
- }
-
- public void setMappings(HashMap map)
- {
- mappingPairs = map;
- }
-
- /**
- * Returns the user name for HTTP basic authentication
- * @return String
- */
- public String getHTTPUsername()
- {
- return httpUsername_;
- }
-
- /**
- * Sets the user name for HTTP basic authentication
- * @param String
- */
- public void setHTTPUsername(String httpUsername)
- {
- httpUsername_ = httpUsername;
- }
-
- /**
- * Returns the password for HTTP basic authentication
- * @return String
- */
- public String getHTTPPassword()
- {
- return httpPassword_;
- }
-
- /**
- * @param string
- */
- public void setHTTPPassword(String httpPassword) {
- httpPassword_ = httpPassword;
- }
-
- public boolean isGuessProjectURL() {
- return guessProjectURL;
- }
-
- public void setGuessProjectURL(boolean guessProjectURL) {
- this.guessProjectURL = guessProjectURL;
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/common/NameMappingUtils.java b/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/common/NameMappingUtils.java
deleted file mode 100644
index 061fdac56..000000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/common/NameMappingUtils.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-
-package org.eclipse.jst.ws.internal.axis.consumption.core.common;
-
-import java.util.Map;
-
-import org.apache.axis.utils.JavaUtils;
-import org.apache.axis.wsdl.toJava.Utils;
-
-public class NameMappingUtils {
-
- private NameMappingUtils() {
- }
-
- public static String getPackageName(String namespace, Map ns2pkgMap)
- {
- if (namespace != null)
- {
- if (ns2pkgMap != null)
- {
- Object pkg = ns2pkgMap.get(namespace);
- if (pkg != null)
- return (String)pkg;
- }
- return namespaceURI2PackageName(namespace);
- }
- else
- return "";
- }
-
- /**
- * namespaceURI2PackageName
- * @param namespaceURI
- * @return package name based on namespace
- */
- public static String namespaceURI2PackageName(String namespaceURI)
- {
- return Utils.makePackageName(namespaceURI);
- }
-
- /**
- * xmlNameToJavaClass
- * @param xmlname
- * @return Java class name
- */
- public static String xmlNameToJavaClass(String xmlname)
- {
- return Utils.xmlNameToJavaClass(xmlname);
- }
-
- /**
- * getPortName
- * @param partName
- * @return port name used by the Axis emitter
- */
- public static String getPortName(String portName)
- {
- if (!JavaUtils.isJavaId(portName))
- portName = xmlNameToJavaClass(portName);
- return portName;
- }
-
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/context/AxisEmitterContext.java b/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/context/AxisEmitterContext.java
deleted file mode 100644
index 6f39617b0..000000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/context/AxisEmitterContext.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * yyyymmdd bug Email and other contact information
- * -------- -------- -----------------------------------------------------------
- * 20060329 127016 andyzhai@ca.ibm.com - Andy Zhai
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.consumption.core.context;
-
-public interface AxisEmitterContext {
- /**
- * This constant string is used to lookup the all_wanted general preference
- * from the plugins local preferences store.
- */
- public static final String PREFERENCE_ALL_WANTED = "allWanted";
-
- /**
- * This constant string is used to lookup the helper_wanted general
- * preference from the plugins local preferences store.
- */
- public static final String PREFERENCE_HELPER_WANTED = "helperWanted";
-
- /**
- * This constant string is used to lookup the wrap_arrays general preference
- * from the plugins local preferences store.
- */
- public static final String PREFERENCE_WRAP_ARRAYS = "wrapArrays";
-
- /**
- * This constant string is used to lookup the deploy_scope general
- * preference from the plugins local preferences store.
- */
- public static final String PREFERENCE_DEPLOY_SCOPE = "deployScope";
-
- /**
- * This constant string is used to lookup the time_out general preference
- * from the plugins local preferences store.
- */
- public static final String PREFERENCE_TIME_OUT = "timeOut";
-
- /*
- * Ensure the order is the same as it in deployScopeTypes.setItems(...) for
- * class
- * org.eclipse.jst.ws.internal.axis.consumption.ui.preferences.AxisEmitterPreferencePage.
- */
- public static final int DEPLOY_SCOPE_TYPE_APPLICATION = 0;
-
- public static final int DEPLOY_SCOPE_TYPE_REQUEST = 1;
-
- public static final int DEPLOY_SCOPE_TYPE_SESSTION = 2;
-
- /**
- * This constant string is used to lookup the use_inherited_methods general
- * preference from the plugins local preferences store.
- */
- public static final String PREFERENCE_USE_INHERITED_METHODS = "useInheritedMethods";
-
- /**
- *
- * @param enable
- * set whether generating code for all elements is enabled.
- */
- public void setAllWantedEnabled(boolean enable);
-
- /**
- *
- * @return returns whether generating code for all elements is enabled.
- */
- public boolean isAllWantedEnabled();
-
- /**
- *
- * @param enable
- * set whether emitting separate Helper classes for meta data is
- * enabled.
- */
- public void setHelperWantedEnabled(boolean enable);
-
- /**
- *
- * @param returns
- * whether emitting separate Helper classes for meta data is
- * enabled.
- */
- public boolean isHelperWantedEnabled();
-
- /**
- *
- * @param enable
- * set whether wrapping arrays is enabled.
- */
-
- public void setWrapArraysEnabled(boolean enable);
-
- /**
- *
- * @param returns
- * whether wrapping arrays is enabled.
- */
-
- public boolean isWrapArraysEnabled();
-
- /**
- *
- * @param enable
- * set whether using inherited methods is enabled.
- */
- public void setUseInheritedMethodsEnabled(boolean enable);
-
- /**
- *
- * @param returns
- * whether using inherited methods is enabled.
- */
-
- public boolean isUseInheritedMethodsEnabled();
-
- /**
- *
- * @param selection
- * set the deploy scope type.
- */
-
- public void selectDeployScopeType(int selection);
-
- /**
- *
- * @param returns
- * the deploy scope type.
- */
-
- public int getDeployScopeType();
-
- /**
- *
- * @param seconds
- * set the time out.
- */
-
- public void setTimeOut(int seconds);
-
- /**
- *
- * @param returns
- * the time out.
- */
-
- public int getTimeOut();
-
- /**
- *
- * @return returns a copy of this AxisEmitterContext.
- */
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/context/AxisEmitterDefaults.java b/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/context/AxisEmitterDefaults.java
deleted file mode 100644
index f9ad3c010..000000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/context/AxisEmitterDefaults.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * yyyymmdd bug Email and other contact information
- * -------- -------- -----------------------------------------------------------
- * 20060329 127016 andyzhai@ca.ibm.com - Andy Zhai
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.consumption.core.context;
-
-public class AxisEmitterDefaults
-{
- private static final boolean PREFERENCE_ALL_WANTED_DEFAULT = false;
- private static final boolean PREFERENCE_HELPER_WANTED_DEFAULT = false;
- private static final boolean PREFERENCE_WRAP_ARRAYS_DEFAULT = false;
- private static final boolean PREFERENCE_USE_INHERITED_METHODS_DEFAULT = false;
- private static final int DEPLOY_SCOPE_DEFAULT = AxisEmitterContext.DEPLOY_SCOPE_TYPE_REQUEST;
- private static final int TIME_OUT_DEFAULT = 45;
-
- /**
- *
- * @return returns the default setting for generating code for all elements.
- */
- public static boolean getAllWantedDefault ()
- {
- return PREFERENCE_ALL_WANTED_DEFAULT;
- }
-
- /**
- *
- * @return returns the default setting for emitting seperate helpser class for metadata.
- */
- public static boolean getHelperWantedDefault ()
- {
- return PREFERENCE_HELPER_WANTED_DEFAULT;
- }
-
- /**
- *
- * @return returns the default seting for wrapping arrays.
- */
- public static boolean getWrapArraysDefault()
- {
- return PREFERENCE_WRAP_ARRAYS_DEFAULT;
- }
-
- /**
- *
- * @return returns the default setting for using inherited methods.
- */
- public static boolean getUseInheritedMethodsDefault()
- {
- return PREFERENCE_USE_INHERITED_METHODS_DEFAULT;
- }
-
- /**
- *
- * @return returns the default setting for deploy scope type.
- */
- public static int getDeployScopeDefault()
- {
- return DEPLOY_SCOPE_DEFAULT;
- }
-
- /**
- *
- * @return returns the default setting for time out.
- */
- public static int getTimeOutDefault()
- {
- return TIME_OUT_DEFAULT;
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/context/PersistentAxisEmitterContext.java b/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/context/PersistentAxisEmitterContext.java
deleted file mode 100644
index 92b76edec..000000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/context/PersistentAxisEmitterContext.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * yyyymmdd bug Email and other contact information
- * -------- -------- -----------------------------------------------------------
- * 20060329 127016 andyzhai@ca.ibm.com - Andy Zhai
- *******************************************************************************/
-package org.eclipse.jst.ws.internal.axis.consumption.core.context;
-
-import org.eclipse.jst.ws.internal.axis.consumption.core.plugin.WebServiceAxisConsumptionCorePlugin;
-import org.eclipse.wst.command.internal.env.context.PersistentContext;
-
-public class PersistentAxisEmitterContext extends PersistentContext implements AxisEmitterContext
-{
- private static PersistentAxisEmitterContext context_ = null;
-
- public static PersistentAxisEmitterContext getInstance()
- {
- if (context_ == null) {
- context_ = new PersistentAxisEmitterContext();
- context_.load();
- }
-
- return context_;
- }
-
- private PersistentAxisEmitterContext()
- {
- super(WebServiceAxisConsumptionCorePlugin.getInstance());
- }
-
- public void load()
- {
- setDefault(PREFERENCE_ALL_WANTED, AxisEmitterDefaults.getAllWantedDefault());
- setDefault(PREFERENCE_HELPER_WANTED, AxisEmitterDefaults.getHelperWantedDefault());
- setDefault(PREFERENCE_WRAP_ARRAYS, AxisEmitterDefaults.getWrapArraysDefault());
- setDefault(PREFERENCE_USE_INHERITED_METHODS, AxisEmitterDefaults.getUseInheritedMethodsDefault());
- setDefault(PREFERENCE_DEPLOY_SCOPE, AxisEmitterDefaults.getDeployScopeDefault());
- setDefault(PREFERENCE_TIME_OUT, AxisEmitterDefaults.getTimeOutDefault());
- }
-
- public void setAllWantedEnabled(boolean enable)
- {
- setValue(PREFERENCE_ALL_WANTED, enable);
- }
-
- public boolean isAllWantedEnabled()
- {
- return getValueAsBoolean(PREFERENCE_ALL_WANTED);
- }
-
- public void setHelperWantedEnabled(boolean enable)
- {
- setValue(PREFERENCE_HELPER_WANTED, enable);
- }
-
- public boolean isHelperWantedEnabled()
- {
- return getValueAsBoolean(PREFERENCE_HELPER_WANTED);
- }
-
- public void setWrapArraysEnabled(boolean enable)
- {
- setValue(PREFERENCE_WRAP_ARRAYS, enable);
- }
-
- public boolean isWrapArraysEnabled()
- {
- return getValueAsBoolean(PREFERENCE_WRAP_ARRAYS);
- }
-
- public void setUseInheritedMethodsEnabled(boolean enable)
- {
- setValue(PREFERENCE_USE_INHERITED_METHODS, enable);
- }
-
- public boolean isUseInheritedMethodsEnabled()
- {
- return getValueAsBoolean(PREFERENCE_USE_INHERITED_METHODS);
- }
-
- public void selectDeployScopeType(int selection) {
- setValue(PREFERENCE_DEPLOY_SCOPE, selection);
- }
-
- public int getDeployScopeType() {
- return getValueAsInt(PREFERENCE_DEPLOY_SCOPE);
- }
-
- public void setTimeOut(int seconds) {
- setValue(PREFERENCE_TIME_OUT, seconds);
- }
-
- public int getTimeOut() {
- return getValueAsInt(PREFERENCE_TIME_OUT);
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/locator/AxisWebServiceLocator.java b/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/locator/AxisWebServiceLocator.java
deleted file mode 100644
index 79c9a9df3..000000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/locator/AxisWebServiceLocator.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * yyyymmdd bug Email and other contact information
- * -------- -------- -----------------------------------------------------------
- * 20060317 127456 cbrealey@ca.ibm.com - Chris Brealey
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.axis.consumption.core.locator;
-
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jdt.core.IJavaModel;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.ITypeHierarchy;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.wst.ws.internal.wsfinder.AbstractWebServiceLocator;
-import org.eclipse.wst.ws.internal.wsrt.WebServiceClientInfo;
-
-/**
- * @author cbrealey
- * The Axis Web service locator plugs itself into the
- * Web Services Finder framework and does the job of
- * locating Axis clients and services.
- */
-public class AxisWebServiceLocator extends AbstractWebServiceLocator
-{
- private String AXIS_STUB = "org.apache.axis.client.Stub";
-
- /**
- * Searches the workspace for Axis clients as
- * identified by non-stub classes that implement
- * SEIs that are implemented by stubs that implement
- * org.apache.axis.client.Stub.
- * @param monitor A progress monitor, possibly null.
- * @return A possibly empty list of WebServiceClientInfo objects.
- */
- public List getWebServiceClients (IProgressMonitor monitor)
- {
- List list = new LinkedList();
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- IJavaModel javaModel = JavaCore.create(root);
- try
- {
- javaModel.open(monitor);
- IJavaProject[] javaProjects = javaModel.getJavaProjects();
- for (int i=0; i<javaProjects.length; i++)
- {
- // We're only interested in Java projects within which
- // the Axis runtime's client "Stub" class is loadable:
- IType axisStub = javaProjects[i].findType(AXIS_STUB);
- if (axisStub != null)
- {
- // Find "Proxy" classes in the project and add to the list.
- addAxisProxies(javaProjects[i],axisStub,list,monitor);
- }
- }
- javaModel.close();
- }
- catch (Exception e)
- {
- // Fall thru and return an empty list.
- }
- return list;
- }
-
- /**
- * Tries to find Axis "Proxy" classes related the given Stub.
- * @param axisStub The Axis client "Stub" from which to search.
- * @param list A list to which we'll add and WebServiceClientInfo
- * objects for "Proxy" classes we find in the search.
- */
- private void addAxisProxies (IJavaProject javaProject, IType axisStub, List list, IProgressMonitor monitor)
- {
- try
- {
- // Compute a hierarchy to help us find all the
- // generated Stub subclasses of the Axis "Stub"
- // class across the entire workspace:
- ITypeHierarchy axisStubHierarchy = axisStub.newTypeHierarchy(javaProject,monitor);
- IType[] stubs = axisStubHierarchy.getSubtypes(axisStub);
- for (int s=0; s<stubs.length; s++)
- {
- // For each stub, find all its super-interfaces of which
- // there should be one, namely the generated SEI:
- IType seis[] = axisStubHierarchy.getSuperInterfaces(stubs[s]);
- for (int i=0; i<seis.length; i++)
- {
- try
- {
- // Compute a hierarchy to help us find all the
- // generated classes that implement the SEI
- // confined to the current project:
- ITypeHierarchy seiHierarchy = seis[i].newTypeHierarchy(javaProject,monitor);
- IType[] proxies = seiHierarchy.getSubtypes(seis[i]);
- for (int p=0; p<proxies.length; p++)
- {
- // Under normal circumstances we should find two subclasses:
- // 1. The generated stub that got us here (two loops above).
- // 2. The generated "Proxy" that we're looking for.
- // Skip #1 and capture #2:
- if (!proxies[p].getFullyQualifiedName().equals(stubs[s].getFullyQualifiedName()))
- {
- WebServiceClientInfo wscInfo = newWebServiceClientInfo(proxies[p]);
- if (wscInfo != null)
- {
- list.add(wscInfo);
- }
- }
- }
- }
- catch (Exception e)
- {
- // We'll land here if the JDT was unable to compute
- // a type hierarchy for the current SEI.
- // This should never happen, but if it does,
- // there's not much we can do except bypass the SEI
- // and loop on to the next one.
- }
- }
- }
- }
- catch (Exception e)
- {
- // We'll land here if JDT was unable to compute
- // a type hierarchy for the Axis client "Stub" class.
- // This should never happen, but if it does,
- // there's not much we can do except bail out, having
- // added nothing to the list.
- }
- }
-
- /**
- * Creates a new WebServiceClientInfo object for a
- * JDT IType object representing a generated Proxy.
- * @param axisProxy The IType of the generated Proxy.
- * @return A new WebServiceClientInfo object describing the Proxy,
- * or null if the IType does not appear to describe a normal Proxy.
- */
- private WebServiceClientInfo newWebServiceClientInfo (IType axisProxy)
- {
- WebServiceClientInfo wscInfo = null;
- try
- {
- IResource resource = axisProxy.getUnderlyingResource();
- if (resource != null)
- {
- IPath proxyPath = resource.getLocation();
- if (proxyPath != null)
- {
- String proxyURL = proxyPath.toFile().toURL().toString();
- wscInfo = new WebServiceClientInfo();
- wscInfo.setImplURL(proxyURL);
- }
- }
- }
- catch (Exception e)
- {
- // We'll land here if we could not convert the IType
- // into an IResource, or if we could not compute a URL
- // from that resource. Either way, it definitely isn't
- // a normal generated Proxy, so get out and return null.
- }
- return wscInfo;
- }
-
- /**
- * Searches the workspace for Axis services as
- * identified by deploy.wsdd <service> elements
- * in projects with an Axis servlet registered
- * in the web.xml descriptor.
- * @param monitor A progress monitor, possibly null.
- * @return A possibly empty list of WebServiceInfo objects.
- */
- public List getWebServices (IProgressMonitor monitor)
- {
- return super.getWebServices(monitor);
- }
-}
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/plugin/WebServiceAxisConsumptionCorePlugin.java b/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/plugin/WebServiceAxisConsumptionCorePlugin.java
deleted file mode 100644
index 14531701b..000000000
--- a/bundles/org.eclipse.jst.ws.axis.consumption.core/src/org/eclipse/jst/ws/internal/axis/consumption/core/plugin/WebServiceAxisConsumptionCorePlugin.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * yyyymmdd bug Email and other contact information
- * -------- -------- -----------------------------------------------------------
- * 20060329 127016 andyzhai@ca.ibm.com - Andy Zhai
- *******************************************************************************/
-
-package org.eclipse.jst.ws.internal.axis.consumption.core.plugin;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.jst.ws.internal.axis.consumption.core.context.AxisEmitterContext;
-import org.eclipse.jst.ws.internal.axis.consumption.core.context.PersistentAxisEmitterContext;
-import org.eclipse.wst.common.environment.EnvironmentService;
-import org.eclipse.wst.common.environment.ILog;
-import org.osgi.framework.BundleContext;
-
-
-/**
-* This is the plugin class for the Web Services plugin.
-* <p>
-* This plugin contains the graphic user interface to the
-* Web Services runtime found in org.eclipse.jst.ws.
-*/
-public class WebServiceAxisConsumptionCorePlugin extends Plugin
-{
-
- /**
- * The identifier of the descriptor of this plugin in plugin.xml.
- */
- public static final String ID =
- "org.eclipse.jst.ws.axis.consumption.core";
-
- /**
- * The reference to the singleton instance of this plugin.
- */
- private static WebServiceAxisConsumptionCorePlugin instance_;
- private ILog log_;
-
- private PersistentAxisEmitterContext axisEmitterContext_;
- /**
- * Constructs a runtime plugin object for this plugin.
- * The "plugin" element in plugin.xml should include the attribute
- * class = "org.eclipse.jst.ws.axis.consumption.core".
- * @param descriptor The descriptor of this plugin.
- */
- public WebServiceAxisConsumptionCorePlugin() {
- super();
- if (instance_ == null) {
- instance_ = this;
- }
- log_ = EnvironmentService.getEclipseLog();
-
- }
-
- // This method is needed to keep the logging from blowing up.
- public String toString()
- {
- return ID;
- }
-
- /**
- * Returns the singleton instance of this plugin. Equivalent to calling
- * (WebServiceWasConsumptionPlugin)Platform.getPlugin("org.eclipse.jst.ws.was.v5.tp");
- * @return The WebServiceAxisConsumptionCorePlugin singleton.
- */
- static public WebServiceAxisConsumptionCorePlugin getInstance() {
- return instance_;
- }
-
- public AxisEmitterContext getAxisEmitterContext()
- {
- if (axisEmitterContext_ == null)
- axisEmitterContext_ = PersistentAxisEmitterContext.getInstance();
- return axisEmitterContext_;
- }
-
- /**
- * Called once by the platform when this plugin is first loaded.
- * @throws CoreException If this plugin fails to start.
- */
- public void start( BundleContext bundle ) throws CoreException {
- log_.log(ILog.INFO, 5087, this, "start", "Starting plugin org.eclipse.jst.ws.axis.consumption.core");
-
- try
- {
- super.start( bundle );
- }
- catch( Exception exc )
- {
- log_.log( ILog.ERROR, 5088, this, "start", exc );
- }
- }
-
- /**
- * Called once by the platform when this plugin is unloaded.
- * @throws CoreException If this plugin fails to shutdown.
- */
- public void stop( BundleContext context ) throws CoreException {
- log_.log(ILog.INFO, 5089, this, "shutdown", "Shutting plugin org.eclipse.jst.ws.axis.consumption.core");
-
- try
- {
- super.stop( context );
- }
- catch( Exception exc )
- {
- log_.log( ILog.ERROR, 5090, this, "stop", exc );
- }
- }
-}

Back to the top