diff --git a/.gitignore b/.gitignore
index 07e8a6b..887849a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
/bin
-/nbproject/private/
\ No newline at end of file
+/nbproject/private/
+/dist/
\ No newline at end of file
diff --git a/README_webServices.txt b/README_webServices.txt
index ec4bfdf..c5902e4 100644
--- a/README_webServices.txt
+++ b/README_webServices.txt
@@ -2,7 +2,10 @@
HOW TO OPEN/USE THE PROJECT IN OPENESB
-------------------------------------------------------
+1-Run Main.java in ca.concordia.cse.gipsy.ws.soap
+2-Enter a number to run the service
+3-Once the files are created server side, enter the command getFileGenerated to retreive them
-1-libraries needed for this project is under src/lib, you will probably have to manually add dom4j-1.6.1.jar and jdom.jar in this folder
-2-Files created are located in ca/concordia/cse/gipsy/ws/soap
-3-Once you build/clean and deploy successfully the project, you should be able to access the generator in a browser
\ No newline at end of file
+
+Note:
+Libraries needed for this project is under src/lib
diff --git a/WebContent/WEB-INF/jax-ws-catalog.xml b/WebContent/WEB-INF/jax-ws-catalog.xml
new file mode 100644
index 0000000..31331d7
--- /dev/null
+++ b/WebContent/WEB-INF/jax-ws-catalog.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/WebContent/WEB-INF/wsdl/localhost_8080/WSC-Gen/GeneratorWSService.wsdl b/WebContent/WEB-INF/wsdl/localhost_8080/WSC-Gen/GeneratorWSService.wsdl
new file mode 100644
index 0000000..43db3c1
--- /dev/null
+++ b/WebContent/WEB-INF/wsdl/localhost_8080/WSC-Gen/GeneratorWSService.wsdl
@@ -0,0 +1,413 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/WebContent/WEB-INF/wsdl/localhost_8080/WSC-Gen/GeneratorWSService.xsd_1.xsd b/WebContent/WEB-INF/wsdl/localhost_8080/WSC-Gen/GeneratorWSService.xsd_1.xsd
new file mode 100644
index 0000000..af1b012
--- /dev/null
+++ b/WebContent/WEB-INF/wsdl/localhost_8080/WSC-Gen/GeneratorWSService.xsd_1.xsd
@@ -0,0 +1,272 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/build/web/wsdl/GeneratorWS.wsdl b/build/web/wsdl/GeneratorWS.wsdl
new file mode 100644
index 0000000..4827956
--- /dev/null
+++ b/build/web/wsdl/GeneratorWS.wsdl
@@ -0,0 +1,82 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/catalog.xml b/catalog.xml
new file mode 100644
index 0000000..c1ba74e
--- /dev/null
+++ b/catalog.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/nbproject/build-impl.xml b/nbproject/build-impl.xml
index b599774..7d53e42 100644
--- a/nbproject/build-impl.xml
+++ b/nbproject/build-impl.xml
@@ -844,7 +844,7 @@ exists or setup the property manually. For example like this:
-
+
diff --git a/nbproject/genfiles.properties b/nbproject/genfiles.properties
index 08f596d..f07bcc5 100644
--- a/nbproject/genfiles.properties
+++ b/nbproject/genfiles.properties
@@ -1,12 +1,20 @@
+
build.xml.data.CRC32=7b1a7c2c
+build.xml.data.CRC32=59c97cea
build.xml.script.CRC32=bcdf5eca
build.xml.stylesheet.CRC32=651128d4@1.77.1.1
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
+
nbproject/build-impl.xml.data.CRC32=7b1a7c2c
nbproject/build-impl.xml.script.CRC32=7965e830
nbproject/build-impl.xml.stylesheet.CRC32=99ea4b56@1.77.1.1
nbproject/rest-build.xml.data.CRC32=0ab29f81
nbproject/rest-build.xml.script.CRC32=c9ad12d8
nbproject/rest-build.xml.stylesheet.CRC32=0cfeebcc@1.31.1
+
+nbproject/build-impl.xml.data.CRC32=59c97cea
+nbproject/build-impl.xml.script.CRC32=37407d58
+nbproject/build-impl.xml.stylesheet.CRC32=99ea4b56@1.77.1.1
+
nbproject/jaxws-build.xml.stylesheet.CRC32=6608c2cf
diff --git a/nbproject/jax-ws.xml b/nbproject/jax-ws.xml
new file mode 100644
index 0000000..ec315b1
--- /dev/null
+++ b/nbproject/jax-ws.xml
@@ -0,0 +1,50 @@
+
+
+
+
+ ca.concordia.cse.gipsy.ws.soap.GeneratorWS
+
+
+
+
+ http://localhost:8080/WSC-Gen/GeneratorWSService?wsdl
+ localhost_8080/WSC-Gen/GeneratorWSService.wsdl
+ ca.concordia.cse.gipsy.ws.soap.client
+ catalog.xml
+
+
+ extension
+ true
+
+
+ verbose
+ true
+
+
+ fork
+ false
+
+
+ wsdlLocation
+ http://localhost:8080/WSC-Gen/GeneratorWSService?wsdl
+
+
+ xnocompile
+ true
+
+
+ xendorsed
+ true
+
+
+ package
+ ca.concordia.cse.gipsy.ws.soap.client
+
+
+ target
+ 2.1
+
+
+
+
+
diff --git a/nbproject/jaxws-build.xml b/nbproject/jaxws-build.xml
new file mode 100644
index 0000000..7180253
--- /dev/null
+++ b/nbproject/jaxws-build.xml
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/nbproject/project.xml b/nbproject/project.xml
index 1f49c20..5e0e8ed 100644
--- a/nbproject/project.xml
+++ b/nbproject/project.xml
@@ -4,7 +4,9 @@
-
+
+
+
WSC09Platform
diff --git a/nbproject/rest-build.xml b/nbproject/rest-build.xml
new file mode 100644
index 0000000..1335cb2
--- /dev/null
+++ b/nbproject/rest-build.xml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/ca/concordia/cse/gipsy/ws/soap/Generator.java b/src/ca/concordia/cse/gipsy/ws/soap/Generator.java
index c350022..0148c70 100644
--- a/src/ca/concordia/cse/gipsy/ws/soap/Generator.java
+++ b/src/ca/concordia/cse/gipsy/ws/soap/Generator.java
@@ -1,9 +1,15 @@
package ca.concordia.cse.gipsy.ws.soap;
+import de.vs.unikassel.generator.gui.listener.GeneratorGUIListener;
import java.io.File;
import de.vs.unikassel.generator.gui.listener.TaskGenerator;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import javax.swing.JOptionPane;
+
/**
* Generator based on GeneratorGUIListener.java in de.vs.unikassel.generator.gui.listener
* @author mrtnchps
@@ -537,4 +543,29 @@ public File getFile(String filePath) {
return new File(this.outputFolder + "/" + filePath);
}
+
+
+ /**
+ * Handles the "Info"-button.
+ * Displays some informations about us.
+ */
+ public String infoButton() {
+ // Read info-file.
+ BufferedReader infoFileReader = new BufferedReader(new InputStreamReader(GeneratorGUIListener.class.getClassLoader().getResourceAsStream(GeneratorGUIListener.infoFilePath)));
+ StringBuilder infoFileText = new StringBuilder();
+ String line = null;
+
+ try {
+ while((line = infoFileReader.readLine()) != null) {
+ infoFileText.append(line);
+ infoFileText.append("\n");
+ }
+ } catch (IOException exception) {
+ System.err.println("GeneratorGUIListener: An error occurred during the reading of the info-file at "+GeneratorGUIListener.infoFilePath);
+ return "message error";
+ }
+ return infoFileText.toString();
+
+ }
+
}
diff --git a/src/ca/concordia/cse/gipsy/ws/soap/GeneratorWS.java b/src/ca/concordia/cse/gipsy/ws/soap/GeneratorWS.java
index ebb26f0..c407c05 100644
--- a/src/ca/concordia/cse/gipsy/ws/soap/GeneratorWS.java
+++ b/src/ca/concordia/cse/gipsy/ws/soap/GeneratorWS.java
@@ -2,6 +2,9 @@
import javax.activation.DataHandler;
import javax.activation.FileDataSource;
+
+import javax.jws.Oneway;
+
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
@@ -70,7 +73,7 @@ public void setDefault() throws Exception {
@WebMethod(operationName="start")
public void start() throws Exception {
instance.start();
- }
+
/**
* Default is 10 000 - This is the number of concepts the user wants
@@ -82,15 +85,6 @@ public void start() throws Exception {
public void setNumberOfConcepts(@WebParam(name= "numberOfConcepts") int numberOfConcepts) {
instance.setNumberOfConcepts(numberOfConcepts);
}
- /**
- * Getter for numberOfConcepts
- *
- * @return numberOfConcepts
- */
- @WebMethod(operationName="getNumberOfConcepts")
- public int getNumberOfConcepts(){
- return instance.getNumberOfConcepts();
- }
/**
* Setter for number of services
@@ -104,15 +98,7 @@ public void setNumberOfServices(@WebParam(name= "numberOfServices")int numberOfS
}
/**
- * Getter for numberOfServices
- * @return
- */
- @WebMethod(operationName="getNumberOfServices")
- public int getNumberOfServices(){
- return instance.getNumberOfServices();
- }
- /**
* Setter for solvableProblem
*
* If set to false, solutionDepth, completeSolutionDepth and minNumberOfConcepts are not usable
@@ -123,23 +109,6 @@ public void setSolvableProblem(@WebParam(name="solvableProblem") boolean solvab
instance.setSolvableProblem(solvableProblem);
}
- /**
- * Getter for solvableProblem
- * @return solvableProblem
- */
- @WebMethod(operationName="getSolvableProblem")
- public boolean getSolvableProblem(){
- return instance.getSolvableProblem();
- }
-
- /**
- * Getter for solutionsList
- * @return solutionsList is an array of integer that represent solutionDepths asked by the user
- */
- @WebMethod(operationName="getSolutionsList")
- public int[] getSolutionsList() {
- return instance.getSolutionsList();
- }
/**
* Handle the "Add solutions" button
@@ -153,16 +122,7 @@ public void setSolutionsList(@WebParam(name="depthNumbers") int[] depthNumbers )
}
/**
- * Total solutionDepth number
- *
- * @return completeSolutionDepth
- */
- @WebMethod(operationName="getCompleteSolutionDepth")
- public int getCompleteSolutionDepth(){
- return instance.getCompleteSolutionDepth();
- }
- /**
* Sum the total solutionDepthList indexes to calculate the completeSolutionDepth
*/
@WebMethod(operationName="setCompleteSolutionDepth")
@@ -179,14 +139,6 @@ public void setGipsy(@WebParam(name= "_gipsy")boolean _gipsy){
instance.setGipsy(_gipsy);
}
- /**
- * Getter for Gipsy
- * @return gipsy
- */
- @WebMethod(operationName="getGispy")
- public boolean getGispy(){
- return instance.getGispy();
- }
/**
* Setter for Bpel file name
@@ -199,16 +151,7 @@ public void setBpelFileName(@WebParam(name= "bpelFileName")String bpelFileName)
}
/**
- * Getter for BPEL
- * @return bpel file name
- * @throws Exception if file name is null or empty
- */
- @WebMethod(operationName="getBpelFileName")
- public String getBpelFileName() throws Exception{
- return instance.getBpelFileName();
- }
- /**
* Setter for OwlFileName
* @param owlFileName
* @throws Exception if file name is null or empty, also if the user didn't ask to override and the operation will override files
@@ -219,16 +162,7 @@ public void setOwlFileName(@WebParam(name="owlFileName") String owlFileName) thr
}
/**
- * Getter for OwlFileName
- * @return the owlfilename
- * @throws Exception if the file is null or empty
- */
- @WebMethod(operationName="getOwlFileName")
- public String getOwlFileName() throws Exception{
- return instance.getOwlFileName();
- }
- /**
* Setter for taskWSDLFileName
* @param taskWSDLFileName
* @throws Exception if file is null or empty, also if the user didn't ask to override and the operation will override files
@@ -239,16 +173,7 @@ public void setTaskWSDLFileName(@WebParam(name="taskWSDLFileName") String taskWS
}
/**
- * Getter
- * @return taskWSDLFileName
- * @throws Exception if the file name is empty or null
- */
- @WebMethod(operationName="getTaskWSDLFileName")
- public String getTaskWSDLFileName() throws Exception{
- return instance.getTaskWSDLFileName();
- }
- /**
* Refactored function from GeneratorGUIListener.java
*
* Setter for WSLAFileName
@@ -262,16 +187,7 @@ public void setWSLAFileName(@WebParam(name="WSLAFileName") String WSLAFileName)
/**
- * Getter
- * @return WSLAFileName
- * @throws Exception if string is null or empty
- */
- @WebMethod(operationName="getWSLAFileName")
- public String getWSLAFileName() throws Exception{
- return instance.getWSLAFileName();
- }
- /**
* Setter
* @param serviceWSDLFileName
* @throws Exception if file is null or empty, also if the file will be override and the user didn't ask for it
@@ -282,16 +198,7 @@ public void setServiceWSDLFileName(@WebParam(name="serviceWSDLFileName")String s
}
/**
- * Getter
- * @return serviceWSDLFileName
- * @throws Exception
- */
- @WebMethod(operationName="getServiceWSDLFileName")
- public String getServiceWSDLFileName() throws Exception{
- return instance.getServiceWSDLFileName();
- }
- /**
* User can decide if intermediateFiles need to be created or not
*
* Setter
@@ -302,16 +209,6 @@ public void setGenerateIntermediateFiles(@WebParam(name= "generateIntermediateFi
instance.setGenerateIntermediateFiles(generateIntermediateFiles);
}
- /**
- * Getter
- * @return generateIntermediateFiles
- */
-
- @WebMethod(operationName="getGenerateIntermediateFiles")
- public boolean getGenerateIntermediateFiles(){
- return instance.getGenerateIntermediateFiles();
- }
-
/**
* User can decide if it wants to ignore the calculated minimum based on the solutiondepths numbers
*
@@ -322,14 +219,6 @@ public void setIgnoreMinimum(@WebParam(name= "ignoreMinimum")boolean ignoreMinim
instance.setIgnoreMinimum(ignoreMinimum);
}
- /**
- * Getter
- * @return ignoreMinimum
- */
- @WebMethod(operationName="getIgnoreMinimum")
- public boolean getIgnoreMinimum(){
- return instance.getIgnoreMinimum();
- }
/**
* Calculate the minimum number concepts
@@ -343,4 +232,15 @@ public void calculateMinNumberConcepts() {
public String getErrorMessages(){
return instance.getErrorMessages();
}
+
+
+ /**
+ *
+ * @return information about the generator
+ */
+ @WebMethod(operationName="infoButton")
+ public String infoButton(){
+ return instance.infoButton();
+ }
+
}
diff --git a/src/ca/concordia/cse/gipsy/ws/soap/Main.java b/src/ca/concordia/cse/gipsy/ws/soap/Main.java
index 7fbf6bf..cfd672d 100644
--- a/src/ca/concordia/cse/gipsy/ws/soap/Main.java
+++ b/src/ca/concordia/cse/gipsy/ws/soap/Main.java
@@ -1,44 +1,198 @@
package ca.concordia.cse.gipsy.ws.soap;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Scanner;
+import javax.swing.JFileChooser;
+
+
public class Main {
public static void main(String[] args) throws Exception {
+ SoapClient client = new SoapClient();
- Generator g = new Generator();
-
- g.setDefault();
-
- if (g.start()) {
- System.out.println("Generator start method sucessful.");
- System.out.println(g.getFile(g.getBpelFileName()).getAbsolutePath().toString());
- } else {
- System.out.println("Error in generator start method.");
+
+ client.setDefault();
+
+ Scanner scan = new Scanner(System.in);
+
+ boolean finished = false;
+
+ while (!finished) {
+ System.out.println("");
+ System.out.println("Choose your option (-1 to leave): ");
+ System.out.println("1- calculateMinNumberConcepts");
+ System.out.println("2- getErrorMessages");
+ System.out.println("3- getFileGenerated");
+ System.out.println("4- infoButton");
+ System.out.println("5- setBpelFileName");
+ System.out.println("6- setCompleteSolutionDepth");
+ System.out.println("7- setDefault");
+ System.out.println("8- setGenerateIntermediateFiles");
+ System.out.println("9- setGipsy");
+ System.out.println("10- setIgnoreMinimum");
+ System.out.println("11- setNumberOfConcepts");
+ System.out.println("12- setNumberOfServices");
+ System.out.println("13- setOwlFileName");
+ System.out.println("14- setServiceWSDLFileName");
+ System.out.println("15- setSolvableProblem");
+ System.out.println("16- setTaskWSDLFileName");
+ System.out.println("17- setWSLAFileName");
+ System.out.println("18- start");
+ System.out.println("19- setSolutionsList");
+ System.out.println("");
+
+ String answer = scan.nextLine();
+
+ try {
+ switch (answer) {
+ case "1":
+ client.calculateMinNumberConcepts();
+ break;
+ case "2":
+ System.out.println(client.getErrorMessages());
+ break;
+ case "3":
+ System.out.println("Enter file type (wsdl, wsla, owl, bpel): ");
+ String fileType = scan.nextLine();
+
+ byte[] fileAsBytes = client.getFileGenerated(fileType);
+ saveToFile(fileAsBytes);
+ break;
+ case "4":
+ System.out.println(client.infoButton());
+ break;
+ case "5":
+ System.out.println("Enter bpel file name: ");
+ String bpelName = scan.nextLine();
+
+ client.setBpelFileName(bpelName);
+ break;
+ case "6":
+ client.setCompleteSolutionDepth();
+ break;
+ case "7":
+ client.setDefault();
+ break;
+ case "8":
+ System.out.println("Enter true or false: ");
+ String generateIntermediate = scan.nextLine();
+
+ client.setGenerateIntermediateFiles(Boolean.parseBoolean(generateIntermediate));
+ break;
+ case "9":
+ System.out.println("Enter true or false: ");
+ String gipsy = scan.nextLine();
+
+ client.setGipsy(Boolean.parseBoolean(gipsy));
+ break;
+ case "10":
+ System.out.println("Enter true or false: ");
+ String ignoreMin = scan.nextLine();
+
+ client.setIgnoreMinimum(Boolean.parseBoolean(ignoreMin));
+ break;
+ case "11":
+ System.out.println("Enter an integer: ");
+ String numberConcepts = scan.nextLine();
+
+ client.setNumberOfConcepts(Integer.parseInt(numberConcepts));
+ break;
+ case "12":
+ System.out.println("Enter an integer: ");
+ String numberServices = scan.nextLine();
+
+ client.setNumberOfServices(Integer.parseInt(numberServices));
+ break;
+ case "13":
+ System.out.println("Enter owl file name: ");
+ String owlName = scan.nextLine();
+
+ client.setOwlFileName(owlName);
+ break;
+ case "14":
+ System.out.println("Enter service wsdl file name: ");
+ String serviceWSDL = scan.nextLine();
+
+ client.setServiceWSDLFileName(serviceWSDL);
+ break;
+ case "15":
+ System.out.println("Enter true or false: ");
+ String isSolvable = scan.nextLine();
+
+ client.setSolvableProblem(Boolean.parseBoolean(isSolvable));
+ break;
+ case "16":
+ System.out.println("Enter task wsdl file name: ");
+ String taskWSDL = scan.nextLine();
+
+ client.setTaskWSDLFileName(taskWSDL);
+ break;
+ case "17":
+ System.out.println("Enter wsla file name: ");
+ String wslaName = scan.nextLine();
+
+ client.setWSLAFileName(wslaName);
+ break;
+ case "18":
+ if (client.start()) {
+ System.out.println("Generation successful.");
+ } else {
+ System.out.println("Generation failed.");
+ }
+ break;
+ case "19":
+ System.out.println("Enter list of integer (separated by ,): ");
+ String[] solutionListEntered = scan.nextLine().split(",");
+
+ ArrayList solutionList = new ArrayList<>();
+
+ for (String s : solutionListEntered) {
+ solutionList.add(Integer.parseInt(s));
+ }
+
+ client.setSolutionsList(solutionList);
+ break;
+ case "-1":
+ finished = true;
+ break;
+ default:
+ System.out.println("Wrong choice. Please try again.");
+ break;
+ }
+ } catch (Exception ex) {
+ System.out.println("Problem with executing your choice. Error: " + ex.getMessage());
}
-
-// // need first an output folder.
-// g.browseOutputFolder();
-//
-//
-// // ------------Example----------------------------
-// // --------- if files already exist in folder --------
-// // user input a name for bpelFileName
-// String bpelFileName = "bpelFileName";
-// if(g.containsFile(g.getOutputFolder(), bpelFileName) && !g.getOverrideFiles()){
-// // if this check is not done, an exception is thrown.
-// // you can either handle the exception in the controller or output a response here
-// System.out.println("folder already exist...");
-// }
-//
-//
-// g.setDefault();
-//
-// // start to generate files and save them in folder.
-// g.start();
-//
-// if(g.getErrorMessages() != null){
-// System.out.println(g.getErrorMessages());
-// }
+ }
+
+ scan.close();
+
}
-}
+ private static File saveToFile(byte[] bytes) throws IOException {
+ JFileChooser fileChooser = new JFileChooser();
+
+ if (fileChooser.showSaveDialog(null) == JFileChooser.APPROVE_OPTION) {
+ FileOutputStream os = null;
+
+ try {
+ os = new FileOutputStream(fileChooser.getSelectedFile().toPath().toString());
+ os.write(bytes);
+ } catch (Exception ex) {
+ System.out.println("Exception when writing the file to disk. Error " + ex.getMessage());
+ } finally {
+ if (os != null) {
+ os.close();
+ }
+ }
+ }
+
+ return null;
+ }
+}
\ No newline at end of file
diff --git a/src/ca/concordia/cse/gipsy/ws/soap/SoapClient.java b/src/ca/concordia/cse/gipsy/ws/soap/SoapClient.java
new file mode 100644
index 0000000..65bb597
--- /dev/null
+++ b/src/ca/concordia/cse/gipsy/ws/soap/SoapClient.java
@@ -0,0 +1,133 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package ca.concordia.cse.gipsy.ws.soap;
+
+import ca.concordia.cse.gipsy.ws.soap.client.Exception_Exception;
+import ca.concordia.cse.gipsy.ws.soap.client.GeneratorWSService;
+import javax.xml.ws.WebServiceRef;
+
+/**
+ *
+ * @author Jo
+ */
+public class SoapClient {
+ @WebServiceRef(wsdlLocation = "WEB-INF/wsdl/localhost_8080/WSC-Gen/GeneratorWSService.wsdl")
+ private GeneratorWSService service;
+
+ public void calculateMinNumberConcepts() {
+ ca.concordia.cse.gipsy.ws.soap.client.GeneratorWSService service = new ca.concordia.cse.gipsy.ws.soap.client.GeneratorWSService();
+ ca.concordia.cse.gipsy.ws.soap.client.GeneratorWS port = service.getGeneratorWSPort();
+ port.calculateMinNumberConcepts();
+ }
+
+ public String getErrorMessages() {
+ ca.concordia.cse.gipsy.ws.soap.client.GeneratorWSService service = new ca.concordia.cse.gipsy.ws.soap.client.GeneratorWSService();
+ ca.concordia.cse.gipsy.ws.soap.client.GeneratorWS port = service.getGeneratorWSPort();
+ return port.getErrorMessages();
+ }
+
+ public byte[] getFileGenerated(java.lang.String fileType) throws Exception_Exception {
+ ca.concordia.cse.gipsy.ws.soap.client.GeneratorWSService service = new ca.concordia.cse.gipsy.ws.soap.client.GeneratorWSService();
+ ca.concordia.cse.gipsy.ws.soap.client.GeneratorWS port = service.getGeneratorWSPort();
+ return port.getFileGenerated(fileType);
+ }
+
+ public String infoButton() {
+ ca.concordia.cse.gipsy.ws.soap.client.GeneratorWSService service = new ca.concordia.cse.gipsy.ws.soap.client.GeneratorWSService();
+ ca.concordia.cse.gipsy.ws.soap.client.GeneratorWS port = service.getGeneratorWSPort();
+ return port.infoButton();
+ }
+
+ public void setBpelFileName(java.lang.String bpelFileName) throws Exception_Exception {
+ ca.concordia.cse.gipsy.ws.soap.client.GeneratorWSService service = new ca.concordia.cse.gipsy.ws.soap.client.GeneratorWSService();
+ ca.concordia.cse.gipsy.ws.soap.client.GeneratorWS port = service.getGeneratorWSPort();
+ port.setBpelFileName(bpelFileName);
+ }
+
+ public void setCompleteSolutionDepth() {
+ ca.concordia.cse.gipsy.ws.soap.client.GeneratorWSService service = new ca.concordia.cse.gipsy.ws.soap.client.GeneratorWSService();
+ ca.concordia.cse.gipsy.ws.soap.client.GeneratorWS port = service.getGeneratorWSPort();
+ port.setCompleteSolutionDepth();
+ }
+
+ public void setDefault() throws Exception_Exception {
+ ca.concordia.cse.gipsy.ws.soap.client.GeneratorWSService service = new ca.concordia.cse.gipsy.ws.soap.client.GeneratorWSService();
+ ca.concordia.cse.gipsy.ws.soap.client.GeneratorWS port = service.getGeneratorWSPort();
+ port.setDefault();
+ }
+
+ public void setGenerateIntermediateFiles(boolean generateIntermediateFiles) {
+ ca.concordia.cse.gipsy.ws.soap.client.GeneratorWSService service = new ca.concordia.cse.gipsy.ws.soap.client.GeneratorWSService();
+ ca.concordia.cse.gipsy.ws.soap.client.GeneratorWS port = service.getGeneratorWSPort();
+ port.setGenerateIntermediateFiles(generateIntermediateFiles);
+ }
+
+ public void setGipsy(boolean gipsy) {
+ ca.concordia.cse.gipsy.ws.soap.client.GeneratorWSService service = new ca.concordia.cse.gipsy.ws.soap.client.GeneratorWSService();
+ ca.concordia.cse.gipsy.ws.soap.client.GeneratorWS port = service.getGeneratorWSPort();
+ port.setGipsy(gipsy);
+ }
+
+ public void setIgnoreMinimum(boolean ignoreMinimum) {
+ ca.concordia.cse.gipsy.ws.soap.client.GeneratorWSService service = new ca.concordia.cse.gipsy.ws.soap.client.GeneratorWSService();
+ ca.concordia.cse.gipsy.ws.soap.client.GeneratorWS port = service.getGeneratorWSPort();
+ port.setIgnoreMinimum(ignoreMinimum);
+ }
+
+ public void setNumberOfConcepts(int numberOfConcepts) {
+ ca.concordia.cse.gipsy.ws.soap.client.GeneratorWSService service = new ca.concordia.cse.gipsy.ws.soap.client.GeneratorWSService();
+ ca.concordia.cse.gipsy.ws.soap.client.GeneratorWS port = service.getGeneratorWSPort();
+ port.setNumberOfConcepts(numberOfConcepts);
+ }
+
+ public void setNumberOfServices(int numberOfServices) {
+ ca.concordia.cse.gipsy.ws.soap.client.GeneratorWSService service = new ca.concordia.cse.gipsy.ws.soap.client.GeneratorWSService();
+ ca.concordia.cse.gipsy.ws.soap.client.GeneratorWS port = service.getGeneratorWSPort();
+ port.setNumberOfServices(numberOfServices);
+ }
+
+ public void setOwlFileName(java.lang.String owlFileName) throws Exception_Exception {
+ ca.concordia.cse.gipsy.ws.soap.client.GeneratorWSService service = new ca.concordia.cse.gipsy.ws.soap.client.GeneratorWSService();
+ ca.concordia.cse.gipsy.ws.soap.client.GeneratorWS port = service.getGeneratorWSPort();
+ port.setOwlFileName(owlFileName);
+ }
+
+ public void setServiceWSDLFileName(java.lang.String serviceWSDLFileName) throws Exception_Exception {
+ ca.concordia.cse.gipsy.ws.soap.client.GeneratorWSService service = new ca.concordia.cse.gipsy.ws.soap.client.GeneratorWSService();
+ ca.concordia.cse.gipsy.ws.soap.client.GeneratorWS port = service.getGeneratorWSPort();
+ port.setServiceWSDLFileName(serviceWSDLFileName);
+ }
+
+ public void setSolutionsList(java.util.List depthNumbers) {
+ ca.concordia.cse.gipsy.ws.soap.client.GeneratorWSService service = new ca.concordia.cse.gipsy.ws.soap.client.GeneratorWSService();
+ ca.concordia.cse.gipsy.ws.soap.client.GeneratorWS port = service.getGeneratorWSPort();
+ port.setSolutionsList(depthNumbers);
+ }
+
+ public void setSolvableProblem(boolean solvableProblem) {
+ ca.concordia.cse.gipsy.ws.soap.client.GeneratorWSService service = new ca.concordia.cse.gipsy.ws.soap.client.GeneratorWSService();
+ ca.concordia.cse.gipsy.ws.soap.client.GeneratorWS port = service.getGeneratorWSPort();
+ port.setSolvableProblem(solvableProblem);
+ }
+
+ public void setTaskWSDLFileName(java.lang.String taskWSDLFileName) throws Exception_Exception {
+ ca.concordia.cse.gipsy.ws.soap.client.GeneratorWSService service = new ca.concordia.cse.gipsy.ws.soap.client.GeneratorWSService();
+ ca.concordia.cse.gipsy.ws.soap.client.GeneratorWS port = service.getGeneratorWSPort();
+ port.setTaskWSDLFileName(taskWSDLFileName);
+ }
+
+ public void setWSLAFileName(java.lang.String wslaFileName) throws Exception_Exception {
+ ca.concordia.cse.gipsy.ws.soap.client.GeneratorWSService service = new ca.concordia.cse.gipsy.ws.soap.client.GeneratorWSService();
+ ca.concordia.cse.gipsy.ws.soap.client.GeneratorWS port = service.getGeneratorWSPort();
+ port.setWSLAFileName(wslaFileName);
+ }
+
+ public boolean start() throws Exception_Exception {
+ ca.concordia.cse.gipsy.ws.soap.client.GeneratorWSService service = new ca.concordia.cse.gipsy.ws.soap.client.GeneratorWSService();
+ ca.concordia.cse.gipsy.ws.soap.client.GeneratorWS port = service.getGeneratorWSPort();
+ return port.start();
+ }
+}
diff --git a/xml-resources/web-service-references/GeneratorWSService/wsdl/localhost_8080/WSC-Gen/GeneratorWSService.wsdl b/xml-resources/web-service-references/GeneratorWSService/wsdl/localhost_8080/WSC-Gen/GeneratorWSService.wsdl
new file mode 100644
index 0000000..c0f9259
--- /dev/null
+++ b/xml-resources/web-service-references/GeneratorWSService/wsdl/localhost_8080/WSC-Gen/GeneratorWSService.wsdl
@@ -0,0 +1,413 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/xml-resources/web-service-references/GeneratorWSService/wsdl/localhost_8080/WSC-Gen/GeneratorWSService.xsd_1.xsd b/xml-resources/web-service-references/GeneratorWSService/wsdl/localhost_8080/WSC-Gen/GeneratorWSService.xsd_1.xsd
new file mode 100644
index 0000000..7eab4a2
--- /dev/null
+++ b/xml-resources/web-service-references/GeneratorWSService/wsdl/localhost_8080/WSC-Gen/GeneratorWSService.xsd_1.xsd
@@ -0,0 +1,272 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file