Invoking Web Services From Web Pages

Discussions

XML & Web services: Invoking Web Services From Web Pages

  1. Invoking Web Services From Web Pages (1 messages)

    I am running a Tomcat5.5/Apache/Axis configeration. I need to invoke web service methods from a webpage(I have the necessary endpoint address). I know this is possible but there is very little information about it on the Internet. Is it done through JSP? Any information would be most helpful, William
  2. It's possible to do (at least) two different things: 1) Invoke your webservice from Javascript. The script somehow gathers the data to send, usually from HTML inputfields, and sends this with an XMLHttpRequest to the webservice. When the service returns a response, the javascript processes it and modifies the page through Dynamic HTML manipulation. This style of interaction is also referred to as AJAX, although this is not always about SOAP webservices. I can assure you there's a lot of information about it on the internet. When I create a Webservice with JDeveloper, it generates a javascript stub for me to access the webservice. Something like this probably exists for Axis as well, or maybe you can use a more generic javascript solution. 2) Another solution is to post data through an HTML form to your JSP or Servlet. The Java server code invokes webservices in order to generate a response, just like it queries a database or accesses a file. There are a lot of ways to access a webservice from Java, and as you're using Axis I'd recommend generating a Java stub with the Axis WSDL2Java tool. Good luck! Ivor