I have a Java Java Web service URL for http://localhost:8080/WebServiceEx/rest/hello/dgdg
When I run the URL, the WebService method returns a string
My requirement is to call the aforementioned WebService url inside the servlet, can there be any help?
ServletCode:
public Class StoreServlet extends HttpServlet{ protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException {
WebService Code:
public class HelloWorldService { @Context private ServletContext context; @GET @Path("/{param}") public Response getMsg(@PathParam("param") String msg) { return Response.status(200).entity(msg).build(); } }
source share