How to create a WebServices client using JSP


Web tier: servlets, JSP, Web frameworks: How to create a WebServices client using JSP

  1. Hi,

    I am relatively new to Web Services. What's the best way to call an web service from a JSP? I'll be provided with the web services WSDL but am not sure what's the best way to call/access the web service from a JSP using WebLogic 8.1.

    Thanks in advance for your help.
  2. Mr.
    You can generate a webservices client using WSDL provided by the host and then use the JSP scriplets to write the java code in JSP and to invoke the webservice, get the result and put it to JSP page. Or use your servlet help to invoke the webservice and return only the necessary result to JSP.
  3. Have similar situation, but in project am using struts, so its not in jsp do webservice call, but in action class. Anyway calling webservice from webapp should be same as invoking it from normal java.
    In action class we call interface from factory called XXXClientService, factory gives us either XXXXClientServiceInMemoryImpl, XXXXClientServiceRMIImpl, or XXXXClientServiceWebServiceImpl, as remote client is a session bean and is exposed as rmi-iiop and webservice.

    Definetly try avoiding calling it from scriptlets in jsp,but if ya have to should be perfectly ok.
  4. Helo Mr. With the previous message I understand that ur successful in communicating with Web Service using Struts. Can u pls send the code for me. I am working on the same. It is urgent... hope u will understand it. Thanks in Advance. Regards. Siva Prasad