14 Replies Latest reply on Mar 1, 2007 10:21 AM by thomas.diesler

    EJB3 and JBossWS (JAXWS), is WSgen even needed for bottom to

    dwin

      Hey guys

      I relatively new to web services

      I am deploying a stateless session bean (EJB 3.0) on JBoss 4.0.5 with JBossWS 1.2 (JAXWS). Bottom to top development.

      I use the @WebService and @webmethod annotation on my EJB with no real config files (other than the application.xml). I deploy the EJB in a jar which is inside an EAR.

      I've read some JAXWS (from Sun) and it seems that they use wsgen to generate the WSDL and request/response classes. However, I could deploy the EJB on Jboss with JBossWS 1.2 without doing the wsgen. The WSDL appears without me even generating it and the web service seems to work fine.

      Basically, to deploy a webservice in the new JAXWS...all I really needed was to mark an EJB with @webservice annotation. No WSDL generation. No need for the response, request classes. I am not sure what goes on internally (run time generation of the handlers and WSDL).

      From reading the developer forums, there is work for wsimport but no mention of wsgen.

      Basically, to do a bottom to top with EJB3.0 and the @webservice annotation...there is no need for wsgen? However, sun's tutorial for jaxws requires an invocation of wsgen to generate the wsdl and handler classes ( found here: http://www.netbeans.org/kb/50/jaxws20.html)





        • 1. Re: EJB3 and JBossWS (JAXWS), is WSgen even needed for botto
          dwin

          I made a mistake, I actually meant ties and stubs as opposed to request /response classes...but you guys get the idea :)

          • 2. Re: EJB3 and JBossWS (JAXWS), is WSgen even needed for botto
            dwin

            mistake again, ties are actually the response/request classes. Client side still may need the stubs.

            • 3. Re: EJB3 and JBossWS (JAXWS), is WSgen even needed for botto
              heiko.braun

              The code first approach leverages our own tools codebase internally that does all the magic. However it's not yet ready to do WSDL first. In this case we still point the people to wsimport.

              Does this answer your question?

              • 4. Re: EJB3 and JBossWS (JAXWS), is WSgen even needed for botto
                dwin

                hey Heiko

                thanks for the info. Yes it does answer my question!

                • 5. Re: EJB3 and JBossWS (JAXWS), is WSgen even needed for botto
                  dwin

                  please clarify for me,

                  this "magic" that happens behind the scene is specific to JBossWS 1.2 or to any implementation of JAX-WS?

                  • 6. Re: EJB3 and JBossWS (JAXWS), is WSgen even needed for botto
                    bk8133

                    I'm facing the same issue here. It seems that wstools, jaxws implementation, axis are trying to get along aroung jsr181. Is there a standard way to declare web services in a war, which would be deployable to multiple app servers?

                    • 7. Re: EJB3 and JBossWS (JAXWS), is WSgen even needed for botto
                      dwin

                      hey BK,

                      do you mean clustering of web services. Currently, web services can be exposed as stateless session beans.

                      All you really need is the POJO class (with the @Webservice annotation) and the JBossWS service runtime will take care of the rest (including the generation of the WSDL and Tie classes).

                      • 8. Re: EJB3 and JBossWS (JAXWS), is WSgen even needed for botto
                        jason.greene

                         

                        "dwin" wrote:
                        please clarify for me,

                        this "magic" that happens behind the scene is specific to JBossWS 1.2 or to any implementation of JAX-WS?


                        It's a feature specific to JBossWS. The whole reason for the JAX-WS wrapper classes is to solve a technical problem that is specific to the vender. So since the end-user never actually does anything with these classes, we think it's silly to epect them to run an offline tool to generate them. So if you do not include them, we generate them on the fly for you during deployment.

                        That said, since the wrapper types are required artifacts, in order for your deployment to be portable to other containers (if you even care) you would need to generate them offline using the wsgen tool. I recently finished the offline tool for this purpose (code is currently in trunk).

                        Also, this only applies to the wrapper types. The WSDL file is not needed on any JAX-WS compliant container.

                        -Jason



                        • 9. Re: EJB3 and JBossWS (JAXWS), is WSgen even needed for botto
                          bk8133

                          (dwin) Actually no. Sorry for not being clear enaugh. What i ment was.. the confusion around [wsgen,wsimportand,apt ] and [wstools]. As wstools being "the" toolset for JBoss implementation of JSR181. I'm working at a company that is considering JBoss as AS for web services and we are facing issues with deploying a JSR181 WS on 4.04 version.


                          I use plain POJO with anotations and i set web.xml as for servlet based version. But we get exception at deploy time

                          ($Proxy53 cannot be cast to org.jboss.lang.Annotation).

                          Is it possible to get a JSR 109 compatible war fileset from anotated POJO using wstools?

                          Should we try in that way?

                          clustering of WS will be an issue later.

                          • 10. Re: EJB3 and JBossWS (JAXWS), is WSgen even needed for botto
                            dwin

                            hey BK,

                            Since you're using JBoss 4.04, I am assuming you're using JBossWS 1.0.x (which is not JAX-WS 2.0 compliant but JAX-RPC 1.x). In fact, there is no binary release of a JAX-WS JBossWS unless you're using JBoss 5.

                            I had to check out the code (via SVN) for JBoss 4.0.5 and compile it myself to get JBossWS 1.2 (JAX-WS) to work.

                            Also, I am also assuming you want to do bottom to top (meaning java to WSDL). If that is the case, then you don't need to use wsgen.

                            all you really need to do in your war file is just package a POJO with @Stateless, @WebService and annotate the specific methods, you want to release as web services, with @WebMethod.

                            This should work, you can check if your web service is deployed by going to http://<your server>:<http port number>/jbossws/services. ie

                            http://localhost:8080/jbossws/services

                            you should see your service on the list along with the pertaining WSDL.


                            • 11. Re: EJB3 and JBossWS (JAXWS), is WSgen even needed for botto
                              dwin

                              hey BK,

                              Since you're using JBoss 4.04, I am assuming you're using JBossWS 1.0.x (which is not JAX-WS 2.0 compliant but JAX-RPC 1.x). In fact, there is no binary release of a JAX-WS JBossWS unless you're using JBoss 5.

                              I had to check out the code (via SVN) for JBoss 4.0.5 and compile it myself to get JBossWS 1.2 (JAX-WS) to work.

                              Also, I am also assuming you want to do bottom to top (meaning java to WSDL). If that is the case, then you don't need to use wsgen.

                              all you really need to do in your war file is just package a POJO with @Stateless, @WebService and annotate the specific methods, you want to release as web services, with @WebMethod.

                              This should work, you can check if your web service is deployed by going to http://<your server>:<http port number>/jbossws/services. ie

                              http://localhost:8080/jbossws/services

                              you should see your service on the list along with the pertaining WSDL.


                              • 12. Re: EJB3 and JBossWS (JAXWS), is WSgen even needed for botto
                                bk8133

                                Hey!! Thank you very much for the best description about WS in java i ever read. The fact was , i was wrong about the AS (i'm using 4.05). So everything with WSTools was ok. The problem was in Java. The JDK 1.6.0 was used. And there's a bug reported in JIRA. Sadly but trully i missed it. I changed to 1.5.0_09 and everything is working flawlesly.

                                JSR181 looks really great. We decided to go for JBossAS solution. Allthough there's a possible conflict in future (jboss+wstools+hibernate) vs (jdk1.6.0 + [JPA + jaxws), we believe solution. OpenSource is great if used with caution ;).

                                thank you.. i will be in touch with our progres.

                                • 13. Re: EJB3 and JBossWS (JAXWS), is WSgen even needed for botto
                                  santhoshitha

                                  hey bk8133, thanks a lot for the last post. without that i wouldn't have known that the issue was with jdk 1.6. i have been trying to deploy my web services(hello worlds) in vain since my java_home was set to jdk 1.6.0 :)

                                  i have been in the same situation as u have, evaluating web service stacks and implementations, and we here have also decided to go ahead with JSR181.

                                  thank u again.

                                  • 14. Re: EJB3 and JBossWS (JAXWS), is WSgen even needed for botto
                                    thomas.diesler

                                    Please have a look at jbossws-1.2.0