CODE(insertrecord.java): package ty; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import javax.jws.WebService; import javax.jws.WebMethod; import javax.jws.WebParam; @WebService(serviceName = "insertrecord") public class insertrecord { @WebMethod(operationName = "insert") public String insert(@WebParam(name = "sname") String sname, @WebParam(name = "srollno") String srollno, @WebParam(name = "sclass") String sclass) { try{ Class.forName("com.mysql.jdbc.Driver"); Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/p3","root","root"); PreparedStatement stmt=con.prepareStatement("insert into student values(?,?,?)"); stmt.setString(1,sname); stmt.setString(2,srollno); stmt.setString(3,sclass); int i=stmt.executeUpdate(); con.close(); return i+" Record(s) Inserted!"; } catch(Exception e){return e+"Error";} } } CODE(index.jsp): <%@page contentType="text/html" pageEncoding="UTF-8"%> pageEncoding="UTF <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" Type" content="text/html; charset=UTF charset=UTF-8"> <title>JSP Page</title> </head> <body> <center> <h1>---Student's Record---</h1> <form action="indexaction.jsp" method="POST"> Enter Name: <input type="text" name="sname" value="" /><br> Enter RollNo.: <input type="text" name="sroll" value="" /><br> Enter Class: <input type="text" name="sclass" value="" /><br> <input type="submit" value="Submit" /> </form> </center> </body> </html> CODE(indexaction.jsp): <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> </head> <body> <center> <% tycs.Insertrecord_Service obj=new tycs.Insertrecord_Service(); //obj of service tycs.Insertrecord port=obj.getInsertrecordPort(); //port for service String sname = request.getParameter("sname"); //took input1 String sroll = request.getParameter("sroll"); //took input2 String sclass = request.getParameter("sclass"); //took input3 String res = port.insert(sname, sroll, sclass); //inserting values by insert method out.println("Result: "+res); %> </center> </body> </html>