Author: dennyxu
Date: 2008-04-23 03:38:18 -0400 (Wed, 23 Apr 2008)
New Revision: 7698
Modified:
trunk/ws/plugins/org.jboss.tools.ws.creation.core/META-INF/MANIFEST.MF
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboos/tools/ws/creation/core/commands/InitialCommnad.java
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboos/tools/ws/creation/core/commands/WSDL2JavaCommnad.java
Log:
to make Topdown jaxws work in wtp under Windows system
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.core/META-INF/MANIFEST.MF 2008-04-23
07:28:50 UTC (rev 7697)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/META-INF/MANIFEST.MF 2008-04-23
07:38:18 UTC (rev 7698)
@@ -12,7 +12,8 @@
org.jboss.tools.ws.ui,
org.eclipse.core.resources,
org.eclipse.jst.ws,
- org.jboss.tools.ws.core
+ org.jboss.tools.ws.core,
+ org.eclipse.wst.wsdl
Eclipse-LazyStart: true
Export-Package: org.jboos.tools.ws.creation.core,
org.jboos.tools.ws.creation.core.commands,
Modified:
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboos/tools/ws/creation/core/commands/InitialCommnad.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboos/tools/ws/creation/core/commands/InitialCommnad.java 2008-04-23
07:28:50 UTC (rev 7697)
+++
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboos/tools/ws/creation/core/commands/InitialCommnad.java 2008-04-23
07:38:18 UTC (rev 7698)
@@ -8,6 +8,11 @@
import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
import org.eclipse.wst.ws.internal.wsrt.IWebService;
import org.eclipse.wst.ws.internal.wsrt.WebServiceScenario;
+import org.eclipse.wst.wsdl.WSDLFactory;
+import org.eclipse.wst.wsdl.internal.impl.wsdl4j.WSDLFactoryImpl;
+import org.eclipse.wst.wsdl.internal.util.WSDLDefinitionFactory;
+import org.eclipse.wst.wsdl.internal.util.WSDLUtil;
+import org.eclipse.wst.wsdl.util.WSDLParser;
import org.jboos.tools.ws.creation.core.data.ServiceModel;
public class InitialCommnad extends AbstractDataModelOperation{
@@ -32,7 +37,8 @@
}
public ServiceModel getWebServiceDataModel()
- {
+ {
+
return model;
}
Modified:
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboos/tools/ws/creation/core/commands/WSDL2JavaCommnad.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboos/tools/ws/creation/core/commands/WSDL2JavaCommnad.java 2008-04-23
07:28:50 UTC (rev 7697)
+++
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboos/tools/ws/creation/core/commands/WSDL2JavaCommnad.java 2008-04-23
07:38:18 UTC (rev 7698)
@@ -2,7 +2,6 @@
import java.io.File;
import java.io.IOException;
-import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.LineNumberReader;
@@ -11,10 +10,8 @@
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.preference.PreferenceStore;
import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
import org.jboos.tools.ws.creation.core.data.ServiceModel;
import org.jboos.tools.ws.creation.core.utils.JBossWSCreationUtils;
@@ -34,27 +31,22 @@
throws ExecutionException {
String runtimeLocation =
JbossWSCorePlugin.getDefault().getPreferenceStore().getString("jbosswsruntimelocation");
- String binLocation = runtimeLocation + Path.SEPARATOR + "bin";
+ String commandLocation = runtimeLocation + Path.SEPARATOR + "bin";
+ String command = "sh wsconsume.sh ";
+ if(System.getProperty("os.name").toLowerCase().indexOf("win") >=
0){
+ command += "cmd wsconsume.bat";
+ }
+ String args = getCommandlineArgs();
+ command += " -k " + args + " " + model.getWsdlURI();
- String commandLine = binLocation + Path.SEPARATOR + "wsconsume.sh";
-
- String args = getCommandlineArgs();
-
- commandLine = commandLine + " -k " + args + " " +
model.getWsdlURI();
- commandLine = "sh " + commandLine;
-
-
-
try {
-
- InputStreamReader ir = new InputStreamReader(Runtime.getRuntime().exec(commandLine,
null, new File(binLocation)).getInputStream());
- LineNumberReader input = new LineNumberReader(ir);
-
- String str = "";
- for (int i = 1; str != null; i++)
- {
+
+ InputStreamReader ir = new InputStreamReader(Runtime.getRuntime().exec(command, null,
new File(commandLocation)).getInputStream());
+ LineNumberReader input = new LineNumberReader(ir);
+ String str = input.readLine();
+ while(str != null){
+ System.out.println(str);
str = input.readLine();
- System.out.println(str);
}
@@ -63,14 +55,14 @@
e.printStackTrace();
}
- refreshProject(model.getWebProjectName());
+ refreshProject(model.getWebProjectName(), monitor);
return Status.OK_STATUS;
}
- private void refreshProject(String project){
+ private void refreshProject(String project, IProgressMonitor monitor){
try {
- JBossWSCreationUtils.getProjectByName(project).refreshLocal(2, new
NullProgressMonitor());
+ JBossWSCreationUtils.getProjectByName(project).refreshLocal(2, monitor);
} catch (CoreException e) {
// TODO Auto-generated catch block
e.printStackTrace();
@@ -100,5 +92,28 @@
}
-
+/* private List<String> getEnv(){
+ List<String> env = new ArrayList<String>();
+
+ String project = model.getWebProjectName();
+ String projectRoot = JBossWSCreationUtils.getProjectRoot(project).toOSString();
+ env.add("o=" + projectRoot + Path.SEPARATOR + "src");
+
+ String customePkg = model.getPackageText();
+ if(customePkg != null && !"".equals(customePkg)){
+ env.add(" p=" + customePkg);
+ }
+
+ String bindingFileLocation = model.getBindingFileLocation();
+ if(bindingFileLocation != null && !"".equals(bindingFileLocation)){
+ File bindingFile = new File(bindingFileLocation);
+ if(bindingFile.exists()){
+ env.add("b=" + bindingFileLocation);
+ }
+ }
+
+ return env;
+
+ }
+*/
}
Show replies by date