14 Replies Latest reply on May 2, 2008 5:04 PM by Chris Laprun

    WSRP Help

    Mark Stuff Newbie

      I am trying to figure out how to get a web service client to talk with a portlet. From what I have read, I should be able to gather data from a portlet using a web service client. I have followed the documentation at:

      http://docs.jboss.com/jbportal/v2.6.4/referenceGuide/html/wsrp.html

      I was OK with things until I got to section 14.6.2.1. "Using the configuration portlet". If I am writing a web service client, what am I supposed to put in for the WSDL? Wouldn't be the server (producer) who holds the WSDL?

      Thanks for any help you can provide.

        • 1. Re: WSRP Help
          Prabhat Jha Master

          Yes, producer holds the URL. See the sample BEA consumer that's mentioned in doc. If you are using JBoss Portal as WSRP consumer (client), what you are basically using is WSRP client not simply web services client.

          • 2. Re: WSRP Help
            Mark Stuff Newbie

            If I want a portlet to generate content (produce) and a web service client to consume the data, where would I get the WSDL from?

            • 3. Re: WSRP Help
              Prabhat Jha Master

              If you are using JBoss Portal as producer, the portlet has to be marked as remotable. You specify this in the deployment descriptor. I have not looked into it lately but producer configuration section of ref.guide should explain this better.

              • 4. Re: WSRP Help
                Mark Stuff Newbie

                I have a portlet marked as remotable. I will try it out again.

                Thanks.

                • 5. Re: WSRP Help
                  Chris Laprun Master

                  What are you trying to accomplish exactly?

                  You can use WSRP to get the portlet content via the WSRP protocol, in which case the WSDL URL would be the Producer's URL as detailed in the documentation and as Prabhat pointed out. And, indeed, the portlet you're trying to access will have to be published (marked as remotable) by Portal's producer.

                  However, you web service client will have to conform to the WSRP protocol so in essence, you will have to write a WSRP consumer (which depending on your needs might be more or less difficult).

                  • 6. Re: WSRP Help
                    Mark Stuff Newbie

                    Here is what I want to do:

                    1. Deploy a portlet on JBoss Portal. I have the portlet deployed but in my jboss-portlet.xml file I have marked the portlet as remotable and yet is does not show up as remotable in the admin page.
                    2. Write a web service client which will connect to the deployed portlet from step 1 and receive(consume) information that the web service has been programmed to generate(produce). I assume that this web service client will need to use the WSRP API.

                    • 7. Re: WSRP Help
                      Chris Laprun Master

                      Could you post your jboss-portlet.xml? If you marked the portlet as remotable it should show up in the admin page...
                      Which version of Portal are you using, by the way?

                      • 8. Re: WSRP Help
                        Chris Laprun Master

                        Note that the portlet won't appear as remotable when looking at it in the "self" producer: remote portlets are not remotable, they are just remote! :)

                        • 9. Re: WSRP Help
                          Mark Stuff Newbie

                          I think I have figured it out. The problem was that the "portlet-name" value in jboss-portlet.xml did not match "portlet-name" value in portlet.xml did not match.

                          • 10. Re: WSRP Help
                            Chris Laprun Master

                            That would indeed be a problem... :)

                            • 11. Re: WSRP Help
                              Mark Stuff Newbie

                              Are there any example projects/programs that show how to set all this up? I have JBoss Portal 2.6.4 running with JBoss 4.2.2 GA and have followed the documentation at http://docs.jboss.com/jbportal/v2.6/referenceGuide/html/wsrp.html

                              and am getting errors when I try and set up the consumer. I enter a URL to a valid WSDL file and get an error:

                              Error: Problem getting service description for producer weather, please see the logs for more information. Cause: ServiceFactory has an error condition that couldn't be recovered from.

                              I wonder if I am missing something in the version of JBoss that I am using, maybe there is something missing maybe? I am using the bundled version of the JBoss AS / Portal server.


                              • 12. Re: WSRP Help
                                Chris Laprun Master

                                Can you please attach the relevant portion of the log file so that I can see what is causing the issue with the ServiceFactory?
                                If you are running Portal behind a firewall, please see: http://wiki.jboss.org/wiki/WSRPOfflineInstructions

                                • 13. Re: WSRP Help
                                  Mark Stuff Newbie

                                  I don't actually get an exception in server.log. All I see is:

                                  09:04:16,546 INFO [WSRPConsumerImpl] Consumer with id 'weather' started
                                  09:04:16,562 INFO [WSRPConsumerImpl] Consumer with id 'weather' activated

                                  and in the web page I see:

                                  Error: Problem getting service description for producer weather, please see the logs for more information. Cause: ServiceFactory has an error condition that couldn't be recovered from.

                                  I checked the files in server/default/log and there is nothing there...

                                  • 14. Re: WSRP Help
                                    Chris Laprun Master

                                    Does it happen with a new consumer definition? Try deleting the configuration and re-create it to see if it makes a difference. There should definitely be some kind of exception triggering the failure condition at some point...