5 Replies Latest reply on Sep 6, 2006 3:55 AM by mmarcom

    JBossWS and xdoclet with ejb

    mmarcom

      hi all,
      i am trying to expose an EJB via webserviecs using XDoclet....
      i have checked plenty of docs on the wbe on how to do that... and basically i end up with 2 different way of doing that:
      - one where , using xdoclet, we generate proper ejb-jar.xml,then wsdl file, mapping.xml and webservices.xml
      - another where xdoclet is not used at all, but it uses jbossws annotations..

      i am tyring to move my EJBs/webservices from WAS to JBoss, could anyone tell me which of the two approaches shall i follow? i am finding more docs on the first option, but there are not much examples left out
      could anyone help me out?
      thanks in advance and regards
      marco

        • 1. Re: JBossWS and xdoclet with ejb
          thomas.diesler

          Why not use annotations (JSR181), xdoclet is dead for webservices.

          http://labs.jboss.com/portal/jbossws/user-guide/en/html/endpoints.html#jsr181-ejb3-endpoint

          • 2. Re: JBossWS and xdoclet with ejb
            mmarcom

            Hello Thomas,
            thanks for your reply.. Unfortunately, i am trying to port an existing app (done with j2ee 1.3, currently deploying on websphere) to jboss..

            THE problem i have is that i have more than 1 webservice in the same application, and putting them in the same wsdl-config results in one ws overriding the other in webservices.xml ...
            i m using xdoclet just to build ejb classes and endpoint interfaces, i had to fight a little to find out how to generate webservices.xml etc.
            foudn this jira about my problem

            JBWS-1090

            it will actually solve my problem... JIRA is marked as resolved, so will it be enough if i get the latest jboss app server from svn?

            thanks and regards
            marco

            • 3. Re: JBossWS and xdoclet with ejb
              mmarcom

              Hello,
              i have just downloaded jbossws-1.0.3GA, and installed jars properly in my jboss directories

              i am currently using Maven2, to build my application, here' sthe ant task that i have defined

              <tasks>
               <taskdef name="wstools" classname="org.jboss.ws.tools.ant.wstools">
               <classpath refid="maven.dependency.classpath"/>
               <classpath>
               <fileset dir="${jboss.libdir}\client">
               <include name="activation.jar"/>
               <include name="javassist.jar"/>
               <include name="jbossall-client.jar"/>
               <include name="jbossretro-rt.jar"/>
               <include name="jboss-backport-concurrent.jar"/>
               <include name="jbossws-client.jar"/>
               <include name="jboss-xml-binding.jar"/>
               <include name="jbossws14-client.jar"/>
               <include name="log4j.jar"/>
               <include name="mail.jar"/>
               </fileset>
               <fileset dir="${jboss.libdir}\lib\endorsed">
               <include name="*.jar"/>
               </fileset>
               </classpath>
               </taskdef>
               <echo message="********** Running jboss ws **************"/>
               <mkdir dir="dd/ws" />
               <wstools dest="D:/Sw/step-by-step/middleware/dd/ws"
               config="D:/Sw/step-by-step/middleware/boss/wstools-messenger-config.xml"/>
              
               <wstools dest="D:/Sw/step-by-step/middleware/dd/ws"
               config="D:/Sw/step-by-step/middleware/jboss/wstools-translation-config.xml"/>
              
               </tasks>
              


              here's my config files

              <configuration xmlns="http://www.jboss.org/jbossws-tools">
               <java-wsdl>
               <service name="TranslationService" style="rpc" endpoint="webservices.TranslationService"/>
               <namespaces target-namespace="http://mw.com/translationservice"
               type-namespace="http://mw.com/translationservice/types"/>
               <mapping file="tss-mapping.xml"/>
               <webservices ejb-link="TranslationServiceSessionBean" override="false"/>
               </java-wsdl>
              

              <configuration xmlns="http://www.jboss.org/jbossws-tools">
              
               <java-wsdl>
               <service name="MessengerService" style="rpc" endpoint="webservices.MessengerService"/>
               <namespaces target-namespace="http://mw.com/messengerservice"
               type-namespace="http://mw.com/messengerservice/types"/>
               <mapping file="mss-mapping.xml"/>
               <webservices ejb-link="ResponderBean" override="false"/>
               </java-wsdl>
              </configuration>
              



              but the webservice that gets generated shows only the last service (the translation service)

              am i missingn something? am i using wrong jar files in the classpath?

              can anyone help me out?

              thanks and regards
              marco








              • 4. Re: JBossWS and xdoclet with ejb
                aguizar

                Hi Marco,

                Use:

                <webservices ejb-link="ResponderBean" append="true"/>


                instead of:
                <webservices ejb-link="ResponderBean" override="false"/>


                • 5. Re: JBossWS and xdoclet with ejb
                  mmarcom

                  THanx alex, it worked just fine!!

                  regards
                  marco