vendredi 31 mars 2017

error: cannot find symbol - Web Service java

I am trying to develop a GUI on Netbeans using a web Service. When I try to run the GUI Frame, an error is displayed saying "error: cannot find symbol". The location of all files are correct and I have refreshed all web services, so this would not be an issue.

The code I drag and dropped into the main GUI frame from the web service java code is below:

private static String addEmployee(java.lang.String username, java.lang.String password, java.lang.String employeep, java.lang.String firstname, java.lang.String secondname) {
    bankserver.BankEmployeeServer_Service service = new bankserver.BankEmployeeServer_Service();
    bankserver.BankEmployeeServer port = service.getBankEmployeeServerPort();
    return port.addEmployee(username, password, employeep, firstname, secondname);
}

This method is then called into a Jbutton Action performed.

  try {


            if(validation() == true){

            username = usernameep.getText();
            password = passwordep.getText();
            String employeep = positionep.getText();
            String firstname = firstnameep.getText();
            String secondname = secondnameep.getText();

            addEmployee(username, password, employeep, firstname, secondname);



               usernameep.setText(null);
                passwordep.setText(null);
                positionep.setText(null);
                firstnameep.setText(null);
                secondnameep.setText(null);


        }
    } catch (IOException ex) {
        Logger.getLogger(employeesPage.class.getName()).log(Level.SEVERE, null, ex);
    }

The code I have in my actual web server is shown below:

     @WebMethod(operationName = "addEmployee")
     public String addEmployee(@WebParam(name = "username") String username,     
     @WebParam(name = "password") String password, @WebParam(name = "employeep") String employeep, @WebParam(name = "firstname") String firstname, @WebParam(name = "secondname") String secondname) {

           String newEmployee = username + "," + password + "," + employeep + "," + firstname + "," + secondname;

           try{
               FileWriter out = new FileWriter("C:\\Users\\Evisa\\Desktop\\University of Westminster\\2nd Year\\2nd Semester\\Client Server Architecture\\coursework\\BankGUI v1.1\\Users.txt", true);
                BufferedWriter bw = new BufferedWriter(out);
                bw.write(newEmployee + "\r\n");
                bw.close();

           } catch (IOException ex) {
        Logger.getLogger(BankCustomerServer.class.getName()).log(Level.SEVERE, null, ex);
    }

    return newEmployee;


}




Aucun commentaire:

Enregistrer un commentaire