8 Replies Latest reply on Feb 1, 2010 6:25 PM by Peter Johnson

    JBoss Tools Web Service Consumer

    John Bailo Master

      I used Eclipse to build a web services client.

       

      I am trying to understand the structure of what was created.

       

       

      I looks like a Bean in a .war file that is contained by an .ear file

       

      Is the Bean an EJB3 Session Bean?

        • 1. Re: JBoss Tools Web Service Consumer
          Peter Johnson Master

          If it is in a WAR file, then no it is not a session bean. Though you can implement a web service using a session bean. What you currently have is a regular bean that sort of behaves like a servlet - see what was defined in web.xml.

           

          By the way, this is why I always recommend that people not use an IDE when exploring new technology. The IDE often masks what is really going on, and often gets in the way (especially when the IDE goofs up). When learning a new technology, if you wnat to understand how it works, you often have to do things by hand using a simple text editor (I use Eclipse as a simple text editor ) to write all of the source and confoiguration files by hand, and the command line to build, package, deploy, run.

          • 2. Re: JBoss Tools Web Service Consumer
            John Bailo Master

            Generally I agree, but this is the simple act of creating a "web reference" as they say in Visual Studio.Net.

             

             

            Not only cannot I identify the created object type, but the use of the service/bean in the sample .jsp seems mighty "wordy".

             

             

            To me, I should, having created a proxy stub, be able to do a simple proxy.method() and be done with it.

            • 3. Re: JBoss Tools Web Service Consumer
              Peter Johnson Master

              I'm sorry, when I reread your post just now I noticed the word "client" in the first paragraph. What threw me off was your reference to a bean and wondering about session beans, so I thought you were talking about implementing a web service.

               

              As to what Eclipse built for you as a web services client, I have no idea. What your client code gets back from JBoss AS when you look up a web service is a proxy that knows how to contact the actual web service when you call the exposed methods. The actual details on how this is done might even depend on the actual web service stack you are using (I'm more familiar with the native stack).

              • 4. Re: JBoss Tools Web Service Consumer
                Peter Johnson Master
                Are you using JBoss Tools to build this web services client? If not, you might consider doing so. It should mask a lot of the proxy-handling code for you. But this is all guesswork since I can't see your code.
                • 5. Re: JBoss Tools Web Service Consumer
                  John Bailo Master

                  You did read the title of this thread, right?

                   

                   

                  • 6. Re: JBoss Tools Web Service Consumer
                    Peter Johnson Master
                    No, I usually don't read the titles. I picked up that habit from the old forum where titles were cut off after about 40 characters and thus meaningless.
                    • 7. Re: JBoss Tools Web Service Consumer
                      John Bailo Master

                      Hah, I was just having fun with you.

                       

                      But it does seems like information about consuming a web service in eclipse/java/jboss is in short supply!

                       

                      (and same with .net   there's a lot about how to build web services, and very little about how to use them!   go figure!)

                      • 8. Re: JBoss Tools Web Service Consumer
                        Peter Johnson Master

                        "Hah, I was just having fun with you."

                         

                        I fugured as much, which I why I simply answered the question, admitting to my shortcoming, rather than defending myself.

                         

                        I haven't seen all that much effort being placing into consuming web services either. In VisualStudio it is all magic, though when .NET was first announced in August 2000 at the PDC I got the toolkit and developed a .NET web service and its client by hand using command line tools.

                         

                        You could look at chapter 9 of JBoss in Action (it's a free download), that's all about web services on JBoss AS, maybe that will help a little.