I am trying to develop a very simple Java web application using JSP and Servlets.
1) The page has a text box and a submit button,
2) The user enters his name, say John, in the text box and presses the button,
3) The string is sent to my servlet,
4) In the doPost method of my servlet, I refer to the published string variable,
5) The web service that I will use has a sayHello method that takes an argument and returns the "Hello " associated with the argument,
6) So, I call the sayHello method of the web service, get the returned variable and forward it to the JSP, which basically writes Hello John .
I am familiar with JSP and Servlet, but I do not know how to use an existing web service or how to use the functionality that is already implemented in this web service.
All I have is a method name, sayHello , a web service URL, http://example.com/hello_service and a link to a wsdl file that contains xml code that I donโt know how to make use of.
My question is: how can I use this web service or how can I call a method inside the servlet?
Thanks in advance.
source share