The team that works on the client side in my project asked me to write a sample test page and give them a working URL that they can put in and return 200. They asked me to also provide a sample request body. Here is the request body that I will give them .
{ "MyApp": { "mAppHeader": { "appId": "", "personId": "", "serviceName": "", "clientIP": "", "requestTimeStamp": "", "encoding": "", "inputDataFormat": "", "outputDataFormat": "", "environment": "" }, "requestPayload": { "header": { "element": "" }, "body": { "request": { "MyTestApp": { "data": { "AuthenticationRequestData": { "appId": "", "appPwd": "" } } } } } } } }
To create a sample page, I have no idea where to start. Goodbye, please, on your downvotes (if the question seems inappropriate), since I have no experience with JSP servlets.
Here is what I have at the moment. His simple login page is
<%@ page language="java" contentType="text/html; charset=windows-1256" pageEncoding="windows-1256" %> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1256"> <title>Login Page</title> </head> <body> <form action="TestClient"> AppId <input type="text" name="appID"/><br> AppPassword <input type="text" name="appPwd"/> <input type="submit" value="submit"> </form> </body> </html>
And this is my servlet class -
package com.test; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class TestClient extends HttpServlet { private static final long serialVersionUID = 1L; public TestClient() { super();
My application is a simple Java class with appID and appPassword with getters and setters, so I will not post it here.
My question is: am I doing this right or 100% wrong? Please give me your advice.