diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000..a0f39dd3
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,9 @@
+/StackExchangeWS/build/
+/StackExchangeWS/dist/
+/StackExchangeWS/nbproject/
+/StackExchangeClient/build/
+/StackExchangeClient/dist/
+/StackExchangeClient/nbproject/
+/StackExchangeIS/build/
+/StackExchangeIS/dist/
+/StackExchangeIS/nbproject/
\ No newline at end of file
diff --git a/README.md b/README.md
index c079a1d2..0b04ba63 100644
--- a/README.md
+++ b/README.md
@@ -24,7 +24,7 @@ Diharapkan dengan tugas ini anda dapat mengerti:
### Link Laporan
-*Masukkan link laporan anda di sini*
+http://bit.ly/LaporanHMIFMerdu
### Arsitektur Umum Server
diff --git a/StackExchangeClient/build.xml b/StackExchangeClient/build.xml
new file mode 100644
index 00000000..d67c49f6
--- /dev/null
+++ b/StackExchangeClient/build.xml
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+
+
+
+
+ Builds, tests, and runs the project StackExchangeClient.
+
+
+
diff --git a/StackExchangeClient/catalog.xml b/StackExchangeClient/catalog.xml
new file mode 100644
index 00000000..ad74474c
--- /dev/null
+++ b/StackExchangeClient/catalog.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/StackExchangeClient/json-simple-1.1.1.jar b/StackExchangeClient/json-simple-1.1.1.jar
new file mode 100644
index 00000000..66347a6c
Binary files /dev/null and b/StackExchangeClient/json-simple-1.1.1.jar differ
diff --git a/StackExchangeClient/src/conf/MANIFEST.MF b/StackExchangeClient/src/conf/MANIFEST.MF
new file mode 100644
index 00000000..59499bce
--- /dev/null
+++ b/StackExchangeClient/src/conf/MANIFEST.MF
@@ -0,0 +1,2 @@
+Manifest-Version: 1.0
+
diff --git a/StackExchangeClient/src/conf/xml-resources/web-service-references/AnswersWS/wsdl/localhost_8081/StackExchangeWS/AnswersWS.wsdl b/StackExchangeClient/src/conf/xml-resources/web-service-references/AnswersWS/wsdl/localhost_8081/StackExchangeWS/AnswersWS.wsdl
new file mode 100644
index 00000000..bfc0f986
--- /dev/null
+++ b/StackExchangeClient/src/conf/xml-resources/web-service-references/AnswersWS/wsdl/localhost_8081/StackExchangeWS/AnswersWS.wsdl
@@ -0,0 +1,93 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/StackExchangeClient/src/conf/xml-resources/web-service-references/AnswersWS/wsdl/localhost_8081/StackExchangeWS/AnswersWS.xsd_1.xsd b/StackExchangeClient/src/conf/xml-resources/web-service-references/AnswersWS/wsdl/localhost_8081/StackExchangeWS/AnswersWS.xsd_1.xsd
new file mode 100644
index 00000000..7201b794
--- /dev/null
+++ b/StackExchangeClient/src/conf/xml-resources/web-service-references/AnswersWS/wsdl/localhost_8081/StackExchangeWS/AnswersWS.xsd_1.xsd
@@ -0,0 +1,82 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/StackExchangeClient/src/conf/xml-resources/web-service-references/QuestionsWS/wsdl/localhost_8081/StackExchangeWS/QuestionsWS.wsdl b/StackExchangeClient/src/conf/xml-resources/web-service-references/QuestionsWS/wsdl/localhost_8081/StackExchangeWS/QuestionsWS.wsdl
new file mode 100644
index 00000000..5d01f5a5
--- /dev/null
+++ b/StackExchangeClient/src/conf/xml-resources/web-service-references/QuestionsWS/wsdl/localhost_8081/StackExchangeWS/QuestionsWS.wsdl
@@ -0,0 +1,169 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/StackExchangeClient/src/conf/xml-resources/web-service-references/QuestionsWS/wsdl/localhost_8081/StackExchangeWS/QuestionsWS.xsd_1.xsd b/StackExchangeClient/src/conf/xml-resources/web-service-references/QuestionsWS/wsdl/localhost_8081/StackExchangeWS/QuestionsWS.xsd_1.xsd
new file mode 100644
index 00000000..bc47d4e7
--- /dev/null
+++ b/StackExchangeClient/src/conf/xml-resources/web-service-references/QuestionsWS/wsdl/localhost_8081/StackExchangeWS/QuestionsWS.xsd_1.xsd
@@ -0,0 +1,148 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/StackExchangeClient/src/conf/xml-resources/web-service-references/UserWS/wsdl/localhost_8081/StackExchangeWS/UserWS.wsdl b/StackExchangeClient/src/conf/xml-resources/web-service-references/UserWS/wsdl/localhost_8081/StackExchangeWS/UserWS.wsdl
new file mode 100644
index 00000000..98d2d7a5
--- /dev/null
+++ b/StackExchangeClient/src/conf/xml-resources/web-service-references/UserWS/wsdl/localhost_8081/StackExchangeWS/UserWS.wsdl
@@ -0,0 +1,93 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/StackExchangeClient/src/conf/xml-resources/web-service-references/UserWS/wsdl/localhost_8081/StackExchangeWS/UserWS.xsd_1.xsd b/StackExchangeClient/src/conf/xml-resources/web-service-references/UserWS/wsdl/localhost_8081/StackExchangeWS/UserWS.xsd_1.xsd
new file mode 100644
index 00000000..694b034e
--- /dev/null
+++ b/StackExchangeClient/src/conf/xml-resources/web-service-references/UserWS/wsdl/localhost_8081/StackExchangeWS/UserWS.xsd_1.xsd
@@ -0,0 +1,78 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/StackExchangeClient/src/java/Container/addanswer.java b/StackExchangeClient/src/java/Container/addanswer.java
new file mode 100644
index 00000000..2f867e44
--- /dev/null
+++ b/StackExchangeClient/src/java/Container/addanswer.java
@@ -0,0 +1,104 @@
+/*
+ * 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 Container;
+
+import answer.AnswersWS_Service;
+import java.io.IOException;
+import java.io.PrintWriter;
+import javax.servlet.http.Cookie;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.ws.WebServiceRef;
+
+/**
+ *
+ * @author mochamadtry
+ */
+public class addanswer extends HttpServlet {
+
+ @WebServiceRef(wsdlLocation = "WEB-INF/wsdl/localhost_8081/StackExchangeWS/AnswersWS.wsdl")
+ private AnswersWS_Service service;
+
+ /**
+ * Processes requests for both HTTP GET
and POST
+ * methods.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ protected void processRequest(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ int qid = Integer.parseInt(request.getParameter("qid"));
+ boolean found = false;
+ int i=0;
+ int ins;
+ Cookie[] cookies = null;
+ cookies = request.getCookies();
+ if (cookies != null) {
+ while (!found && i < cookies.length){
+ if (cookies[i].getName().equals("token_cookie")) {
+ String token = cookies[i].getValue();
+ String content = request.getParameter("content");
+ ins = insertAnswer(token, qid ,content);
+ found = true;
+ }
+ i++;
+ }
+ }
+ response.sendRedirect("viewpost?qid="+qid);
+ }
+
+ //
+ /**
+ * Handles the HTTP GET
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Handles the HTTP POST
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Returns a short description of the servlet.
+ *
+ * @return a String containing servlet description
+ */
+ @Override
+ public String getServletInfo() {
+ return "Short description";
+ }//
+
+ private int insertAnswer(java.lang.String token, int qId, java.lang.String content) {
+ // Note that the injected javax.xml.ws.Service reference as well as port objects are not thread safe.
+ // If the calling of port operations may lead to race condition some synchronization is required.
+ answer.AnswersWS port = service.getAnswersWSPort();
+ return port.insertAnswer(token, qId, content);
+ }
+
+}
diff --git a/StackExchangeClient/src/java/Container/askquestion.java b/StackExchangeClient/src/java/Container/askquestion.java
new file mode 100644
index 00000000..f22c188d
--- /dev/null
+++ b/StackExchangeClient/src/java/Container/askquestion.java
@@ -0,0 +1,105 @@
+/*
+ * 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 Container;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.ws.WebServiceRef;
+import question.QuestionsWS_Service;
+import javax.servlet.http.Cookie;
+
+/**
+ *
+ * @author mochamadtry
+ */
+@WebServlet(name = "askquestion", urlPatterns = {"/askquestion"})
+public class askquestion extends HttpServlet {
+
+ @WebServiceRef(wsdlLocation = "WEB-INF/wsdl/localhost_8081/StackExchangeWS/QuestionsWS.wsdl")
+ private QuestionsWS_Service service;
+
+ /**
+ * Processes requests for both HTTP GET
and POST
+ * methods.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ protected void processRequest(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ boolean found = false;
+ int i = 0;
+ Cookie[] cookies = null;
+ cookies = request.getCookies();
+ if (cookies != null) {
+ while (!found && i < cookies.length){
+ if (cookies[i].getName().equals("token_cookie")) {
+ String token = cookies[i].getValue();
+ String topic = request.getParameter("topic");
+ String content = request.getParameter("content");
+ int suc = createQuestion(token, topic, content);
+ found = true;
+ }
+ i++;
+ }
+ }
+ response.sendRedirect("home");
+ }
+
+ //
+ /**
+ * Handles the HTTP GET
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Handles the HTTP POST
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Returns a short description of the servlet.
+ *
+ * @return a String containing servlet description
+ */
+ @Override
+ public String getServletInfo() {
+ return "Short description";
+ }//
+
+ private int createQuestion(java.lang.String token, java.lang.String topic, java.lang.String content) {
+ // Note that the injected javax.xml.ws.Service reference as well as port objects are not thread safe.
+ // If the calling of port operations may lead to race condition some synchronization is required.
+ question.QuestionsWS port = service.getQuestionsWSPort();
+ return port.createQuestion(token, topic, content);
+ }
+
+}
diff --git a/StackExchangeClient/src/java/Container/deletequestion.java b/StackExchangeClient/src/java/Container/deletequestion.java
new file mode 100644
index 00000000..beffa70c
--- /dev/null
+++ b/StackExchangeClient/src/java/Container/deletequestion.java
@@ -0,0 +1,130 @@
+/*
+ * 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 Container;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import javax.servlet.ServletException;
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.ws.WebServiceRef;
+import question.Question;
+import question.QuestionsWS_Service;
+import user.User;
+import user.UserWS_Service;
+
+/**
+ *
+ * @author Bimo
+ */
+public class deletequestion extends HttpServlet {
+
+ @WebServiceRef(wsdlLocation = "WEB-INF/wsdl/localhost_8081/StackExchangeWS/UserWS.wsdl")
+ private UserWS_Service service_1;
+
+ @WebServiceRef(wsdlLocation = "WEB-INF/wsdl/localhost_8081/StackExchangeWS/QuestionsWS.wsdl")
+ private QuestionsWS_Service service;
+
+ /**
+ * Processes requests for both HTTP GET
and POST
+ * methods.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ protected void processRequest(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+
+ int questionid = Integer.parseInt(request.getParameter("qid"));
+
+ question.Question tanya = getQuestionById(questionid);
+ boolean found = false;
+ int i=0;
+ Cookie[] cookies;
+ cookies = request.getCookies();
+ int ins;
+ if (cookies != null) {
+ while (!found && i < cookies.length){
+ if (cookies[i].getName().equals("token_cookie")) {
+ String token = cookies[i].getValue();
+ if (getUserByToken(token).getUid() == tanya.getQuestionUid() ){
+ ins = deleteQuestion(token, questionid);
+ }
+
+ found = true;
+ }
+ i++;
+ }
+ }
+ response.sendRedirect("home");
+
+ }
+
+ //
+ /**
+ * Handles the HTTP GET
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Handles the HTTP POST
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Returns a short description of the servlet.
+ *
+ * @return a String containing servlet description
+ */
+ @Override
+ public String getServletInfo() {
+ return "Short description";
+ }//
+
+ private int deleteQuestion(java.lang.String token, int qid) {
+ // Note that the injected javax.xml.ws.Service reference as well as port objects are not thread safe.
+ // If the calling of port operations may lead to race condition some synchronization is required.
+ question.QuestionsWS port = service.getQuestionsWSPort();
+ return port.deleteQuestion(token, qid);
+ }
+
+ private User getUserByToken(java.lang.String token) {
+ // Note that the injected javax.xml.ws.Service reference as well as port objects are not thread safe.
+ // If the calling of port operations may lead to race condition some synchronization is required.
+ user.UserWS port = service_1.getUserWSPort();
+ return port.getUserByToken(token);
+ }
+
+ private Question getQuestionById(int qid) {
+ // Note that the injected javax.xml.ws.Service reference as well as port objects are not thread safe.
+ // If the calling of port operations may lead to race condition some synchronization is required.
+ question.QuestionsWS port = service.getQuestionsWSPort();
+ return port.getQuestionById(qid);
+ }
+
+}
diff --git a/StackExchangeClient/src/java/Container/editquestion.java b/StackExchangeClient/src/java/Container/editquestion.java
new file mode 100644
index 00000000..9f4f2ff5
--- /dev/null
+++ b/StackExchangeClient/src/java/Container/editquestion.java
@@ -0,0 +1,138 @@
+/*
+ * 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 Container;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletException;
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.ws.WebServiceRef;
+import question.Question;
+import question.QuestionsWS_Service;
+import user.User;
+import user.UserWS_Service;
+
+/**
+ *
+ * @author mochamadtry
+ */
+public class editquestion extends HttpServlet {
+
+ @WebServiceRef(wsdlLocation = "WEB-INF/wsdl/localhost_8081/StackExchangeWS/UserWS.wsdl")
+ private UserWS_Service service_1;
+
+ @WebServiceRef(wsdlLocation = "WEB-INF/wsdl/localhost_8081/StackExchangeWS/QuestionsWS.wsdl")
+ private QuestionsWS_Service service;
+
+ /**
+ * Processes requests for both HTTP GET
and POST
+ * methods.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ protected void processRequest(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+
+ int qid = Integer.parseInt(request.getParameter("qid"));
+
+ String token = "";
+ boolean found = false;
+ int i = 0;
+ Cookie[] cookies = request.getCookies();
+ if (cookies != null) {
+ while (!found && i < cookies.length){
+ if (cookies[i].getName().equals("token_cookie")) {
+ token = cookies[i].getValue();
+ found = true;
+ }
+ i++;
+ }
+ }
+
+ if (found) {
+ // get user and compare it with the token ID
+ User user = getUserByToken(token);
+ Question question = getQuestionById(qid);
+ if (question.getQuestionUid() == user.getUid()) {
+ // if the question is edited by the same user, proceed
+ request.setAttribute("question", question);
+ request.setAttribute("name", user.getName());
+ RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/editquestion.jsp");
+ dispatcher.forward(request, response);
+
+ } else {
+ request.setAttribute("error", "You're not the owner!");
+ RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/" + request.getRequestURL().toString());
+ dispatcher.forward(request, response);
+ }
+ } else {
+ request.setAttribute("error", "You have to log in first!");
+ RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/" + request.getRequestURL().toString());
+ dispatcher.forward(request, response);
+ }
+ }
+
+ //
+ /**
+ * Handles the HTTP GET
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Handles the HTTP POST
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Returns a short description of the servlet.
+ *
+ * @return a String containing servlet description
+ */
+ @Override
+ public String getServletInfo() {
+ return "Short description";
+ }//
+
+ private Question getQuestionById(int qid) {
+ // Note that the injected javax.xml.ws.Service reference as well as port objects are not thread safe.
+ // If the calling of port operations may lead to race condition some synchronization is required.
+ question.QuestionsWS port = service.getQuestionsWSPort();
+ return port.getQuestionById(qid);
+ }
+
+ private User getUserByToken(java.lang.String token) {
+ // Note that the injected javax.xml.ws.Service reference as well as port objects are not thread safe.
+ // If the calling of port operations may lead to race condition some synchronization is required.
+ user.UserWS port = service_1.getUserWSPort();
+ return port.getUserByToken(token);
+ }
+
+}
diff --git a/StackExchangeClient/src/java/Container/home.java b/StackExchangeClient/src/java/Container/home.java
new file mode 100644
index 00000000..2200dc79
--- /dev/null
+++ b/StackExchangeClient/src/java/Container/home.java
@@ -0,0 +1,195 @@
+/*
+ * 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 Container;
+
+import answer.AnswersWS_Service;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.HashMap;
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletException;
+import java.util.HashMap;
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.ws.WebServiceRef;
+import question.QuestionsWS_Service;
+import user.User;
+import user.UserWS_Service;
+
+/**
+ *
+ * @author mochamadtry
+ */
+public class home extends HttpServlet {
+
+ @WebServiceRef(wsdlLocation = "WEB-INF/wsdl/localhost_8081/StackExchangeWS/AnswersWS.wsdl")
+ private AnswersWS_Service service_2;
+
+ @WebServiceRef(wsdlLocation = "WEB-INF/wsdl/localhost_8081/StackExchangeWS/UserWS.wsdl")
+ private UserWS_Service service_1;
+
+ @WebServiceRef(wsdlLocation = "WEB-INF/wsdl/localhost_8081/StackExchangeWS/QuestionsWS.wsdl")
+ private QuestionsWS_Service service;
+
+ /**
+ * Processes requests for both HTTP GET
and POST
+ * methods.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ protected void processRequest(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ boolean found = false;
+ int i = 0;
+ Cookie[] cookies = null;
+ cookies = request.getCookies();
+ if (cookies != null) {
+ while (!found && i < cookies.length){
+ if (cookies[i].getName().equals("token_cookie")) {
+ User user = getUserByToken(cookies[i].getValue());
+ request.setAttribute("name", user.getName());
+ found = true;
+
+ }
+ i++;
+
+ }
+ }
+
+
+ HashMap hmap = new HashMap();
+ HashMap answermap = new HashMap();
+ HashMap askmap = new HashMap();
+
+ int j = 0;
+ String keyword = request.getParameter("keyword");
+ if (keyword == null){
+ java.util.List result = getAllQuestions();
+ request.setAttribute("result", result);
+
+ for (j = 0;j result = searchQuestions(keyword);
+ request.setAttribute("result", result);
+
+ for (j = 0;j
+ /**
+ * Handles the HTTP GET
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Handles the HTTP POST
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Returns a short description of the servlet.
+ *
+ * @return a String containing servlet description
+ */
+ @Override
+ public String getServletInfo() {
+ return "Short description";
+ }//
+
+ private java.util.List getAllQuestions() {
+ // Note that the injected javax.xml.ws.Service reference as well as port objects are not thread safe.
+ // If the calling of port operations may lead to race condition some synchronization is required.
+ question.QuestionsWS port = service.getQuestionsWSPort();
+ return port.getAllQuestions();
+ }
+
+ private User getUserByToken(java.lang.String token) {
+ // Note that the injected javax.xml.ws.Service reference as well as port objects are not thread safe.
+ // If the calling of port operations may lead to race condition some synchronization is required.
+ user.UserWS port = service_1.getUserWSPort();
+ return port.getUserByToken(token);
+ }
+
+ private java.util.List searchQuestions(java.lang.String keyword) {
+ // Note that the injected javax.xml.ws.Service reference as well as port objects are not thread safe.
+ // If the calling of port operations may lead to race condition some synchronization is required.
+ question.QuestionsWS port = service.getQuestionsWSPort();
+ return port.searchQuestions(keyword);
+ }
+
+ private java.util.List getAnswersByQid(int qid) {
+ // Note that the injected javax.xml.ws.Service reference as well as port objects are not thread safe.
+ // If the calling of port operations may lead to race condition some synchronization is required.
+ answer.AnswersWS port = service_2.getAnswersWSPort();
+ return port.getAnswersByQid(qid);
+ }
+
+ private User getUser(int userId) {
+ // Note that the injected javax.xml.ws.Service reference as well as port objects are not thread safe.
+ // If the calling of port operations may lead to race condition some synchronization is required.
+ user.UserWS port = service_1.getUserWSPort();
+ return port.getUser(userId);
+ }
+
+ private int getquestionvote(int qid) {
+ // Note that the injected javax.xml.ws.Service reference as well as port objects are not thread safe.
+ // If the calling of port operations may lead to race condition some synchronization is required.
+ question.QuestionsWS port = service.getQuestionsWSPort();
+ return port.getquestionvote(qid);
+ }
+
+
+
+}
diff --git a/StackExchangeClient/src/java/Container/registers.java b/StackExchangeClient/src/java/Container/registers.java
new file mode 100644
index 00000000..6f390ec5
--- /dev/null
+++ b/StackExchangeClient/src/java/Container/registers.java
@@ -0,0 +1,89 @@
+/*
+ * 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 Container;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.ws.WebServiceRef;
+import user.UserWS_Service;
+
+/**
+ *
+ * @author mochamadtry
+ */
+public class registers extends HttpServlet {
+
+ @WebServiceRef(wsdlLocation = "WEB-INF/wsdl/localhost_8081/StackExchangeWS/UserWS.wsdl")
+ private UserWS_Service service;
+
+ /**
+ * Processes requests for both HTTP GET
and POST
+ * methods.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ protected void processRequest(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ String name = request.getParameter("name");
+ String email = request.getParameter("email");
+ String password = request.getParameter("password");
+ addUser(name, email, password);
+ response.sendRedirect("home");
+ }
+
+ //
+ /**
+ * Handles the HTTP GET
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Handles the HTTP POST
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Returns a short description of the servlet.
+ *
+ * @return a String containing servlet description
+ */
+ @Override
+ public String getServletInfo() {
+ return "Short description";
+ }//
+
+ private int addUser(java.lang.String name, java.lang.String email, java.lang.String password) {
+ // Note that the injected javax.xml.ws.Service reference as well as port objects are not thread safe.
+ // If the calling of port operations may lead to race condition some synchronization is required.
+ user.UserWS port = service.getUserWSPort();
+ return port.addUser(name, email, password);
+ }
+
+}
diff --git a/StackExchangeClient/src/java/Container/savequestion.java b/StackExchangeClient/src/java/Container/savequestion.java
new file mode 100644
index 00000000..ec500d0d
--- /dev/null
+++ b/StackExchangeClient/src/java/Container/savequestion.java
@@ -0,0 +1,106 @@
+/*
+ * 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 Container;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import javax.servlet.ServletException;
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.ws.WebServiceRef;
+import question.QuestionsWS_Service;
+
+/**
+ *
+ * @author mochamadtry
+ */
+public class savequestion extends HttpServlet {
+
+ @WebServiceRef(wsdlLocation = "WEB-INF/wsdl/localhost_8081/StackExchangeWS/QuestionsWS.wsdl")
+ private QuestionsWS_Service service;
+
+ /**
+ * Processes requests for both HTTP GET
and POST
+ * methods.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ protected void processRequest(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ String token ="";
+ boolean found = false;
+ int i = 0;
+ Cookie[] cookies = null;
+ cookies = request.getCookies();
+ if (cookies != null) {
+ while (!found && i < cookies.length){
+ if (cookies[i].getName().equals("token_cookie")) {
+ token = cookies[i].getValue();
+ found = true;
+
+ }
+ i++;
+ }
+ }
+ int qid = Integer.parseInt(request.getParameter("qid"));
+ String newTopic = request.getParameter("topic");
+ String newContent = request.getParameter("content");
+ updateQuestion(token, qid, newTopic, newContent);
+ response.sendRedirect("home");
+ }
+
+ //
+ /**
+ * Handles the HTTP GET
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Handles the HTTP POST
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Returns a short description of the servlet.
+ *
+ * @return a String containing servlet description
+ */
+ @Override
+ public String getServletInfo() {
+ return "Short description";
+ }//
+
+ private int updateQuestion(java.lang.String token, int qid, java.lang.String newTopic, java.lang.String newContent) {
+ // Note that the injected javax.xml.ws.Service reference as well as port objects are not thread safe.
+ // If the calling of port operations may lead to race condition some synchronization is required.
+ question.QuestionsWS port = service.getQuestionsWSPort();
+ return port.updateQuestion(token, qid, newTopic, newContent);
+ }
+
+}
diff --git a/StackExchangeClient/src/java/Container/viewpost.java b/StackExchangeClient/src/java/Container/viewpost.java
new file mode 100644
index 00000000..89cdd7c3
--- /dev/null
+++ b/StackExchangeClient/src/java/Container/viewpost.java
@@ -0,0 +1,181 @@
+/*
+ * 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 Container;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.List;
+import java.util.HashMap;
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.ws.WebServiceRef;
+import question.Question;
+import question.QuestionsWS_Service;
+import answer.AnswersWS_Service;
+import javax.servlet.http.Cookie;
+import user.User;
+import user.UserWS_Service;
+/**
+ *
+ * @author Bimo
+ */
+public class viewpost extends HttpServlet {
+
+ @WebServiceRef(wsdlLocation = "WEB-INF/wsdl/localhost_8081/StackExchangeWS/UserWS.wsdl")
+ private UserWS_Service service_2;
+
+ @WebServiceRef(wsdlLocation = "WEB-INF/wsdl/localhost_8081/StackExchangeWS/AnswersWS.wsdl")
+ private AnswersWS_Service service_1;
+
+ @WebServiceRef(wsdlLocation = "WEB-INF/wsdl/localhost_8081/StackExchangeWS/QuestionsWS.wsdl")
+ private QuestionsWS_Service service;
+
+ /**
+ * Processes requests for both HTTP GET
and POST
+ * methods.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ protected void processRequest(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+
+ boolean found = false;
+ int j=0;
+ Cookie[] cookies = request.getCookies();
+ if (cookies != null) {
+ while (!found && j < cookies.length){
+ if (cookies[j].getName().equals("token_cookie")) {
+ String token = cookies[j].getValue();
+ User user = getUserByToken(token);
+ request.setAttribute("name", user.getName());
+ found = true;
+ }
+ j++;
+ }
+ }
+
+ String paramqid = request.getParameter("qid");
+ request.setAttribute("qid", Integer.parseInt(paramqid));
+
+ java.util.List answers = getAnswersByQid(Integer.parseInt(paramqid));
+ request.setAttribute("answers", answers);
+
+ question.Question result = getQuestionById(Integer.parseInt(paramqid));
+ request.setAttribute("result", result);
+ request.setAttribute("asker", getUser(result.getQuestionUid()).getName());
+
+ HashMap hmap = new HashMap();
+ HashMap ansvotemap = new HashMap();
+ int i = 0;
+ for (i = 0;i
+ /**
+ * Handles the HTTP GET
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+
+ processRequest(request, response);
+ }
+
+ /**
+ * Handles the HTTP POST
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Returns a short description of the servlet.
+ *
+ * @return a String containing servlet description
+ */
+ @Override
+ public String getServletInfo() {
+ return "Short description";
+ }//
+
+ private java.util.List getAnswersByQid(int qid) {
+ // Note that the injected javax.xml.ws.Service reference as well as port objects are not thread safe.
+ // If the calling of port operations may lead to race condition some synchronization is required.
+ answer.AnswersWS port = service_1.getAnswersWSPort();
+ return port.getAnswersByQid(qid);
+ }
+
+ private Question getQuestionById(int qid) {
+ // Note that the injected javax.xml.ws.Service reference as well as port objects are not thread safe.
+ // If the calling of port operations may lead to race condition some synchronization is required.
+ question.QuestionsWS port = service.getQuestionsWSPort();
+ return port.getQuestionById(qid);
+ }
+
+ private int getquestionvote(int qid) {
+ // Note that the injected javax.xml.ws.Service reference as well as port objects are not thread safe.
+ // If the calling of port operations may lead to race condition some synchronization is required.
+ question.QuestionsWS port = service.getQuestionsWSPort();
+ return port.getquestionvote(qid);
+ }
+
+ private User getUser(int userId) {
+ // Note that the injected javax.xml.ws.Service reference as well as port objects are not thread safe.
+ // If the calling of port operations may lead to race condition some synchronization is required.
+ user.UserWS port = service_2.getUserWSPort();
+ return port.getUser(userId);
+ }
+
+ private int getanswervote(int aid) {
+ // Note that the injected javax.xml.ws.Service reference as well as port objects are not thread safe.
+ // If the calling of port operations may lead to race condition some synchronization is required.
+ answer.AnswersWS port = service_1.getAnswersWSPort();
+ return port.getanswervote(aid);
+ }
+
+ private User getUserByToken(java.lang.String token) {
+ // Note that the injected javax.xml.ws.Service reference as well as port objects are not thread safe.
+ // If the calling of port operations may lead to race condition some synchronization is required.
+ user.UserWS port = service_2.getUserWSPort();
+ return port.getUserByToken(token);
+ }
+
+
+
+}
\ No newline at end of file
diff --git a/StackExchangeClient/src/java/Container/voteanswer.java b/StackExchangeClient/src/java/Container/voteanswer.java
new file mode 100644
index 00000000..084af2c2
--- /dev/null
+++ b/StackExchangeClient/src/java/Container/voteanswer.java
@@ -0,0 +1,113 @@
+/*
+ * 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 Container;
+
+import answer.AnswersWS_Service;
+import java.io.IOException;
+import java.io.PrintWriter;
+import javax.servlet.ServletException;
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.ws.WebServiceRef;
+
+/**
+ *
+ * @author Bimo
+ */
+public class voteanswer extends HttpServlet {
+
+ @WebServiceRef(wsdlLocation = "WEB-INF/wsdl/localhost_8081/StackExchangeWS/AnswersWS.wsdl")
+ private AnswersWS_Service service;
+
+ /**
+ * Processes requests for both HTTP GET
and POST
+ * methods.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ protected void processRequest(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ int qid = Integer.parseInt(request.getParameter("qid"));
+ int aid = Integer.parseInt(request.getParameter("aid"));
+ boolean found = false;
+ int i=0;
+ int ins;
+ Cookie[] cookies = null;
+ cookies = request.getCookies();
+ if (cookies != null) {
+ while (!found && i < cookies.length){
+ if (cookies[i].getName().equals("token_cookie")) {
+ String token = cookies[i].getValue();
+ int value = Integer.parseInt(request.getParameter("jlhvote"));
+ ins = voteanswers(token, aid ,value);
+ found = true;
+ }
+ i++;
+ }
+ }
+ response.sendRedirect("viewpost?qid="+qid);
+ }
+
+ private int voteanswers(java.lang.String token, int aid, int value) {
+ // Note that the injected javax.xml.ws.Service reference as well as port objects are not thread safe.
+ // If the calling of port operations may lead to race condition some synchronization is required.
+ answer.AnswersWS port = service.getAnswersWSPort();
+ return port.voteanswers(token, aid, value);
+ }
+
+ //
+ /**
+ * Handles the HTTP GET
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Handles the HTTP POST
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Returns a short description of the servlet.
+ *
+ * @return a String containing servlet description
+ */
+ @Override
+ public String getServletInfo() {
+ return "Short description";
+ }//
+
+ private int getanswervote(int aid) {
+ // Note that the injected javax.xml.ws.Service reference as well as port objects are not thread safe.
+ // If the calling of port operations may lead to race condition some synchronization is required.
+ answer.AnswersWS port = service.getAnswersWSPort();
+ return port.getanswervote(aid);
+ }
+
+
+}
diff --git a/StackExchangeClient/src/java/Container/votequestion.java b/StackExchangeClient/src/java/Container/votequestion.java
new file mode 100644
index 00000000..a45676b1
--- /dev/null
+++ b/StackExchangeClient/src/java/Container/votequestion.java
@@ -0,0 +1,105 @@
+/*
+ * 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 Container;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import javax.servlet.http.Cookie;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.ws.WebServiceRef;
+import question.QuestionsWS_Service;
+
+/**
+ *
+ * @author Bimo
+ */
+public class votequestion extends HttpServlet {
+
+ @WebServiceRef(wsdlLocation = "WEB-INF/wsdl/localhost_8081/StackExchangeWS/QuestionsWS.wsdl")
+ private QuestionsWS_Service service;
+
+ /**
+ * Processes requests for both HTTP GET
and POST
+ * methods.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ protected void processRequest(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ int qid = Integer.parseInt(request.getParameter("qid"));
+ boolean found = false;
+ int i=0;
+ int ins;
+ Cookie[] cookies = null;
+ cookies = request.getCookies();
+ if (cookies != null) {
+ while (!found && i < cookies.length){
+ if (cookies[i].getName().equals("token_cookie")) {
+ String token = cookies[i].getValue();
+ int value = Integer.parseInt(request.getParameter("jlhvote"));
+ ins = votequestion(token, qid ,value);
+ found = true;
+ }
+ i++;
+ }
+ }
+ response.sendRedirect("viewpost?qid="+qid);
+ }
+
+
+ //
+ /**
+ * Handles the HTTP GET
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Handles the HTTP POST
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Returns a short description of the servlet.
+ *
+ * @return a String containing servlet description
+ */
+ @Override
+ public String getServletInfo() {
+ return "Short description";
+ }//
+
+ private int votequestion(java.lang.String token, int qid, int value) {
+ // Note that the injected javax.xml.ws.Service reference as well as port objects are not thread safe.
+ // If the calling of port operations may lead to race condition some synchronization is required.
+ question.QuestionsWS port = service.getQuestionsWSPort();
+ return port.votequestion(token, qid, value);
+ }
+
+}
diff --git a/StackExchangeClient/src/java/Login/Login.java b/StackExchangeClient/src/java/Login/Login.java
new file mode 100644
index 00000000..9f10f74d
--- /dev/null
+++ b/StackExchangeClient/src/java/Login/Login.java
@@ -0,0 +1,148 @@
+/*
+ * 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 Login;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.net.URLEncoder;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletException;
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.json.simple.JSONObject;
+import org.json.simple.parser.JSONParser;
+import org.json.simple.parser.ParseException;
+
+/**
+ *
+ * @author Ahmad Naufal Farhan
+ */
+public class Login extends HttpServlet {
+
+ private static final String URL_LOGIN = "http://localhost:8082/StackExchangeIS/LoginAuth";
+ /**
+ * Processes requests for both HTTP GET
and POST
+ * methods.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ protected void processRequest(HttpServletRequest request,
+ HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("application/json");
+ String redirectUrl = request.getContextPath();
+
+ String email = request.getParameter("email");
+ String password = request.getParameter("password");
+
+ try {
+ // establish a connection with the identity service that handles login
+ URL url = new URL(URL_LOGIN);
+ HttpURLConnection conn = (HttpURLConnection) url.openConnection();
+ // set the request property
+ conn.setDoOutput(true);
+ conn.setRequestMethod("POST");
+ conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
+ conn.setRequestProperty("charset", "utf-8");
+
+ String params = String.format("email=%s&password=%s",
+ URLEncoder.encode(email, "UTF-8"),
+ URLEncoder.encode(password, "UTF-8"));
+
+ try (OutputStream output = conn.getOutputStream()) {
+ output.write(params.getBytes("UTF-8"));
+ }
+
+ BufferedReader in = new BufferedReader(new InputStreamReader(
+ conn.getInputStream()));
+ StringBuilder sb = new StringBuilder();
+
+ String temp;
+ while ((temp = in.readLine()) != null)
+ sb.append(temp);
+
+ // json parser needed to parse the string
+ JSONParser parser = new JSONParser();
+ JSONObject object = (JSONObject) parser.parse(sb.toString());
+
+ // get the attributes and add the cookie
+ String strToken = (String) object.get("token_str");
+ Cookie tokenCookie;
+
+ if (strToken != null) {
+ tokenCookie = new Cookie("token_cookie", strToken);
+ tokenCookie.setPath(request.getContextPath());
+ tokenCookie.setMaxAge(5 * 60);
+ response.addCookie(tokenCookie);
+ redirectUrl += "/home";
+ response.sendRedirect(redirectUrl);
+ } else {
+ String error = (String) object.get("error");
+ request.setAttribute("error", error);
+ RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/login.jsp");
+ dispatcher.forward(request, response);
+
+ }
+
+ conn.disconnect();
+ } catch (IOException | ParseException ex) {
+ Logger.getLogger(Login.class.getName()).log(Level.SEVERE, null, ex);
+ }
+
+ }
+
+ //
+ /**
+ * Handles the HTTP GET
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Handles the HTTP POST
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Returns a short description of the servlet.
+ *
+ * @return a String containing servlet description
+ */
+ @Override
+ public String getServletInfo() {
+ return "Short description";
+ }//
+
+}
diff --git a/StackExchangeClient/src/java/Login/Logout.java b/StackExchangeClient/src/java/Login/Logout.java
new file mode 100644
index 00000000..43af4428
--- /dev/null
+++ b/StackExchangeClient/src/java/Login/Logout.java
@@ -0,0 +1,111 @@
+/*
+ * 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 Login;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import javax.servlet.ServletException;
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.ws.WebServiceRef;
+import user.UserWS_Service;
+
+/**
+ *
+ * @author Ahmad Naufal Farhan
+ */
+public class Logout extends HttpServlet {
+
+ @WebServiceRef(wsdlLocation = "WEB-INF/wsdl/localhost_8081/StackExchangeWS/UserWS.wsdl")
+ private UserWS_Service service;
+
+ /**
+ * Processes requests for both HTTP GET
and POST
+ * methods.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ protected void processRequest(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+
+ String token ="";
+ boolean found = false;
+ int i = 0;
+ Cookie[] cookies = request.getCookies();
+ if (cookies != null) {
+ while (!found && i < cookies.length) {
+ if (cookies[i].getName().equals("token_cookie")) {
+ token = cookies[i].getValue();
+ found = true;
+ } else
+ i++;
+ }
+ }
+
+ if (found) {
+ int res = logoutUser(token);
+ if (res > 0) {
+ Cookie cookie = new Cookie("token_cookie", null);
+ cookie.setMaxAge(0);
+ response.addCookie(cookie);
+ }
+ }
+
+ response.sendRedirect(request.getContextPath());
+ }
+
+ //
+ /**
+ * Handles the HTTP GET
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Handles the HTTP POST
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Returns a short description of the servlet.
+ *
+ * @return a String containing servlet description
+ */
+ @Override
+ public String getServletInfo() {
+ return "Short description";
+ }//
+
+ private int logoutUser(java.lang.String token) {
+ // Note that the injected javax.xml.ws.Service reference as well as port objects are not thread safe.
+ // If the calling of port operations may lead to race condition some synchronization is required.
+ user.UserWS port = service.getUserWSPort();
+ return port.logoutUser(token);
+ }
+
+}
diff --git a/StackExchangeClient/web/WEB-INF/jax-ws-catalog.xml b/StackExchangeClient/web/WEB-INF/jax-ws-catalog.xml
new file mode 100644
index 00000000..c6a5565e
--- /dev/null
+++ b/StackExchangeClient/web/WEB-INF/jax-ws-catalog.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/StackExchangeClient/web/WEB-INF/json-simple-1.1.1.jar b/StackExchangeClient/web/WEB-INF/json-simple-1.1.1.jar
new file mode 100644
index 00000000..66347a6c
Binary files /dev/null and b/StackExchangeClient/web/WEB-INF/json-simple-1.1.1.jar differ
diff --git a/StackExchangeClient/web/WEB-INF/web.xml b/StackExchangeClient/web/WEB-INF/web.xml
new file mode 100644
index 00000000..c3a368d4
--- /dev/null
+++ b/StackExchangeClient/web/WEB-INF/web.xml
@@ -0,0 +1,128 @@
+
+
+
+ Test
+ Questions.Test
+
+
+ Login
+ Login.Login
+
+
+ registers
+ Container.registers
+
+
+ homes
+ Container.homes
+
+
+ AskQuestion
+ Container.AskQuestion
+
+
+ askquestion
+ Container.askquestion
+
+
+ viewpost
+ Container.viewpost
+
+
+ home
+ Container.home
+
+
+ addanswer
+ Container.addanswer
+
+
+ savequestion
+ Container.savequestion
+
+
+ editquestion
+ Container.editquestion
+
+
+ votequestion
+ Container.votequestion
+
+
+ voteanswer
+ Container.voteanswer
+
+
+ deletequestion
+ Container.deletequestion
+
+
+ Logout
+ Login.Logout
+
+
+ Test
+ /Test
+
+
+ Login
+ /Login
+
+
+ registers
+ /registers
+
+
+ homes
+ /homes
+
+
+ AskQuestion
+ /AskQuestion
+
+
+ askquestion
+ /askquestion
+
+
+ viewpost
+ /viewpost
+
+
+ home
+ /
+
+
+ addanswer
+ /addanswer
+
+
+ savequestion
+ /savequestion
+
+
+ editquestion
+ /editquestion
+
+
+ votequestion
+ /votequestion
+
+
+ voteanswer
+ /voteanswer
+
+
+ deletequestion
+ /deletequestion
+
+
+ Logout
+ /Logout
+
+
+
+ 30
+
+
+
diff --git a/StackExchangeClient/web/WEB-INF/wsdl/localhost_32229/StackExchangeWS/AnswersWS.wsdl b/StackExchangeClient/web/WEB-INF/wsdl/localhost_32229/StackExchangeWS/AnswersWS.wsdl
new file mode 100644
index 00000000..f9a3aabd
--- /dev/null
+++ b/StackExchangeClient/web/WEB-INF/wsdl/localhost_32229/StackExchangeWS/AnswersWS.wsdl
@@ -0,0 +1,93 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/StackExchangeClient/web/WEB-INF/wsdl/localhost_32229/StackExchangeWS/AnswersWS.xsd_1.xsd b/StackExchangeClient/web/WEB-INF/wsdl/localhost_32229/StackExchangeWS/AnswersWS.xsd_1.xsd
new file mode 100644
index 00000000..07e1f496
--- /dev/null
+++ b/StackExchangeClient/web/WEB-INF/wsdl/localhost_32229/StackExchangeWS/AnswersWS.xsd_1.xsd
@@ -0,0 +1,82 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/StackExchangeClient/web/WEB-INF/wsdl/localhost_32229/StackExchangeWS/Register.wsdl b/StackExchangeClient/web/WEB-INF/wsdl/localhost_32229/StackExchangeWS/Register.wsdl
new file mode 100644
index 00000000..c1f8e48d
--- /dev/null
+++ b/StackExchangeClient/web/WEB-INF/wsdl/localhost_32229/StackExchangeWS/Register.wsdl
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/StackExchangeClient/web/WEB-INF/wsdl/localhost_32229/StackExchangeWS/Register.xsd_1.xsd b/StackExchangeClient/web/WEB-INF/wsdl/localhost_32229/StackExchangeWS/Register.xsd_1.xsd
new file mode 100644
index 00000000..79c80555
--- /dev/null
+++ b/StackExchangeClient/web/WEB-INF/wsdl/localhost_32229/StackExchangeWS/Register.xsd_1.xsd
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/StackExchangeClient/web/WEB-INF/wsdl/localhost_41585/StackExchangeWS/QuestionsWS.wsdl b/StackExchangeClient/web/WEB-INF/wsdl/localhost_41585/StackExchangeWS/QuestionsWS.wsdl
new file mode 100644
index 00000000..dc3755d5
--- /dev/null
+++ b/StackExchangeClient/web/WEB-INF/wsdl/localhost_41585/StackExchangeWS/QuestionsWS.wsdl
@@ -0,0 +1,150 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/StackExchangeClient/web/WEB-INF/wsdl/localhost_41585/StackExchangeWS/QuestionsWS.xsd_1.xsd b/StackExchangeClient/web/WEB-INF/wsdl/localhost_41585/StackExchangeWS/QuestionsWS.xsd_1.xsd
new file mode 100644
index 00000000..eb6dfb41
--- /dev/null
+++ b/StackExchangeClient/web/WEB-INF/wsdl/localhost_41585/StackExchangeWS/QuestionsWS.xsd_1.xsd
@@ -0,0 +1,132 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/StackExchangeClient/web/WEB-INF/wsdl/localhost_41585/StackExchangeWS/UserWS.wsdl b/StackExchangeClient/web/WEB-INF/wsdl/localhost_41585/StackExchangeWS/UserWS.wsdl
new file mode 100644
index 00000000..db352467
--- /dev/null
+++ b/StackExchangeClient/web/WEB-INF/wsdl/localhost_41585/StackExchangeWS/UserWS.wsdl
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/StackExchangeClient/web/WEB-INF/wsdl/localhost_41585/StackExchangeWS/UserWS.xsd_1.xsd b/StackExchangeClient/web/WEB-INF/wsdl/localhost_41585/StackExchangeWS/UserWS.xsd_1.xsd
new file mode 100644
index 00000000..b63b4c25
--- /dev/null
+++ b/StackExchangeClient/web/WEB-INF/wsdl/localhost_41585/StackExchangeWS/UserWS.xsd_1.xsd
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/StackExchangeClient/web/WEB-INF/wsdl/localhost_8080/StackExchangeWS/QuestionsWS.wsdl b/StackExchangeClient/web/WEB-INF/wsdl/localhost_8080/StackExchangeWS/QuestionsWS.wsdl
new file mode 100644
index 00000000..927c3a5e
--- /dev/null
+++ b/StackExchangeClient/web/WEB-INF/wsdl/localhost_8080/StackExchangeWS/QuestionsWS.wsdl
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/StackExchangeClient/web/WEB-INF/wsdl/localhost_8080/StackExchangeWS/QuestionsWS.xsd_1.xsd b/StackExchangeClient/web/WEB-INF/wsdl/localhost_8080/StackExchangeWS/QuestionsWS.xsd_1.xsd
new file mode 100644
index 00000000..b31f13c5
--- /dev/null
+++ b/StackExchangeClient/web/WEB-INF/wsdl/localhost_8080/StackExchangeWS/QuestionsWS.xsd_1.xsd
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/StackExchangeClient/web/WEB-INF/wsdl/localhost_8081/StackExchangeWS/AnswersWS.wsdl b/StackExchangeClient/web/WEB-INF/wsdl/localhost_8081/StackExchangeWS/AnswersWS.wsdl
new file mode 100644
index 00000000..bfc0f986
--- /dev/null
+++ b/StackExchangeClient/web/WEB-INF/wsdl/localhost_8081/StackExchangeWS/AnswersWS.wsdl
@@ -0,0 +1,93 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/StackExchangeClient/web/WEB-INF/wsdl/localhost_8081/StackExchangeWS/AnswersWS.xsd_1.xsd b/StackExchangeClient/web/WEB-INF/wsdl/localhost_8081/StackExchangeWS/AnswersWS.xsd_1.xsd
new file mode 100644
index 00000000..7201b794
--- /dev/null
+++ b/StackExchangeClient/web/WEB-INF/wsdl/localhost_8081/StackExchangeWS/AnswersWS.xsd_1.xsd
@@ -0,0 +1,82 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/StackExchangeClient/web/WEB-INF/wsdl/localhost_8081/StackExchangeWS/QuestionsWS.wsdl b/StackExchangeClient/web/WEB-INF/wsdl/localhost_8081/StackExchangeWS/QuestionsWS.wsdl
new file mode 100644
index 00000000..5d01f5a5
--- /dev/null
+++ b/StackExchangeClient/web/WEB-INF/wsdl/localhost_8081/StackExchangeWS/QuestionsWS.wsdl
@@ -0,0 +1,169 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/StackExchangeClient/web/WEB-INF/wsdl/localhost_8081/StackExchangeWS/QuestionsWS.xsd_1.xsd b/StackExchangeClient/web/WEB-INF/wsdl/localhost_8081/StackExchangeWS/QuestionsWS.xsd_1.xsd
new file mode 100644
index 00000000..bc47d4e7
--- /dev/null
+++ b/StackExchangeClient/web/WEB-INF/wsdl/localhost_8081/StackExchangeWS/QuestionsWS.xsd_1.xsd
@@ -0,0 +1,148 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/StackExchangeClient/web/WEB-INF/wsdl/localhost_8081/StackExchangeWS/UserWS.wsdl b/StackExchangeClient/web/WEB-INF/wsdl/localhost_8081/StackExchangeWS/UserWS.wsdl
new file mode 100644
index 00000000..98d2d7a5
--- /dev/null
+++ b/StackExchangeClient/web/WEB-INF/wsdl/localhost_8081/StackExchangeWS/UserWS.wsdl
@@ -0,0 +1,93 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/StackExchangeClient/web/WEB-INF/wsdl/localhost_8081/StackExchangeWS/UserWS.xsd_1.xsd b/StackExchangeClient/web/WEB-INF/wsdl/localhost_8081/StackExchangeWS/UserWS.xsd_1.xsd
new file mode 100644
index 00000000..694b034e
--- /dev/null
+++ b/StackExchangeClient/web/WEB-INF/wsdl/localhost_8081/StackExchangeWS/UserWS.xsd_1.xsd
@@ -0,0 +1,78 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/StackExchangeClient/web/askquestion.jsp b/StackExchangeClient/web/askquestion.jsp
new file mode 100644
index 00000000..a00ff6bb
--- /dev/null
+++ b/StackExchangeClient/web/askquestion.jsp
@@ -0,0 +1,36 @@
+<%--
+ Document : AskQuestion
+ Created on : Nov 25, 2015, 1:44:34 PM
+ Author : mochamadtry
+--%>
+<%@page contentType="text/html" pageEncoding="UTF-8"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+
+<%@include file="includes/header.jsp" %>
+
+
+
+