3 Replies Latest reply on Oct 19, 2006 2:46 PM by mholzner

    Portlet calling a webservice

    Praveen Cheruvu Newbie


      I checked portalswap.com, but did not find a sample of a portlet that calls a webservice. can you please provide some link or info.

      I guess WSRP is new standard for calling webservices from portlets. But a sample which does not adhere to this standard will also work.

      Thanks for all the help.


        • 1. Re: Portlet calling a webservice
          Peter Halverson Newbie

          You invoke webservices from a portlet just like any other WS client -- get your hands on the service proxy (either pre-generated or through a dynamic proxy) and start calling operations (either through a generated service endpoint interface or dynamically). The portlet configuration mechanism may give you a cleaner place to isolate the configuration (e.g. the endpoint URL, etc.), and there are probably some lifecycle considerations (e.g. acquire the proxy in the init() method), but otherwise there's nothing special about it being in portlet. So if you're looking for examples you need to look at the usual web services tutorials.

          WSRP has nothing to do with it -- WSRP is about calling portlets via webservices, not calling web services from portlets.

          • 2. Re: Portlet calling a webservice

            Hi portalgeek,

            did you get your portlet to call a web service? I need to do the same thing, I already implemented a web service and need to call whithin the portlet in my portal. If you did, do you think you can give me some tips?

            I really appreciate it.


            • 3. Re: Portlet calling a webservice

              generate the client stubs, and use them in the portlet. There is no difference in calling the WS from a portlet to any other client. Look at the examples that come with your SOAP engine (AXIS, JBoss-WS, ....)

              WSRP is something completely different. It used WS as a transport protocol, but that's about it.