7 Replies Latest reply on Jul 30, 2003 2:19 PM by PC

    Remote Beans as Services?

    Mark Gargan Newbie

      Hi Guys,
      I've had a modicum of success exposing a local stateless session bean as a web service using axis. However when I converted this bean into a remote bean it no longer worked?

      Is this done on purpose so that client's won't access the bean as a web service and a remote service at the same time? Or have I just got my web-service.xml file wrong?

      <?xml version="1.0" encoding="UTF-8"?>

      <deployment
      xmlns="http://xml.apache.org/axis/wsdd/"
      targetNamespace="http://net.jboss.org/hello"
      xmlns:hello="http://net.jboss.org/hello"
      xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
      <!-- this is an extension to the Axis deployment descriptor which allows to
      specify the naming environment for the deployed ws logic -->























      This is from the EJB and JSP helloworld tutorial by Bruce Scharlau. And can be located at

      http://www.csd.abdn.ac.uk/~bscharla/teaching/mtp_software/jboss/jboss-net-EJB-example.shtml

      Bruce if yer out there man.. if it weren't for blokes like ye hosting tutorials like that .. I dunno I don't even wanna think about it.. Thanks again.

      Mark.

        • 1. Re: Remote Beans as Services?
          Peter McCombs Newbie

          Mark,

          Sorry I don't have any help for you, however, I noticed that you have accomplished something that I have yet to figure out. How do I expose my local session bean as a web service using jboss.net?

          I have written some entity CMP beans, which xdoclet creates a session facade (management beans) for. I think these session beans are good candidates for web services, but I don't know what to do once the session beans are generated.

          Any help would be appreciated...

          • 2. Re: Remote Beans as Services?
            Mark Gargan Newbie

            Hi there,
            I've attached a zip file that you can deploy into jboss. I deployed into a build I made from a nightly build there the other day so maybe you wanna make sure you're up to date.

            If you've any problems get back to me or else subscribe to the jboss users mailing list on the sourceforge website. The folks there know their stuff I tells ye.

            Apologies for the delay in getting back to you but I only got it working in the past few minutes myself.

            Thanks,
            Mark.

            • 3. Re: Remote Beans as Services?
              Mark Gargan Newbie

              Ahem and for my next trick I'm going to...wait for it... actually remember to post the zip file!!! Yeaeeaahahhy. Tas been a long day..

              • 4. Re: Remote Beans as Services?
                Mark Gargan Newbie

                ...Hmm she doesn't seem to want to upload...

                Here I've hosted it here. By the by there's .classpath and .project files in there so you can import it directly into eclipse2.0.2 at least.

                Here's the url, don't hesitate to ask us questions and I'll do my best to answer them.

                http://www.cs.tcd.ie/Mark.Gargan/Work\remoteHelloBeanAsWS.zip

                Quick note.
                If in the web-service.xml, if you set allowmethods="*" and you attempt to check and see what services you have at

                http://localhost:8080/jboss-net/servlet/AxisServlet

                you'll get a NullPointerException this is something to do with the compatibility of some of the EJB methods and the provider that generates the WSDL. (Lads on the mailing list snared that one. Nice one cheers).. Anyway make sure that allowedMethods="hello" i.e. the business method.

                Thanks,
                Mark.


                • 5. Re: Remote Beans as Services?
                  Peter McCombs Newbie

                  Hey Mark,

                  Thanks for the help! I got this working, I think.

                  I found an xdoclet add-on for auto-generating the web-services.xml file for me. I made a small tweak to the xdoclet template for the session facade that I am having xdoclet generate, so that it will also publish the session facade beans as web services.

                  I then wrapped the generated web-services.xml into a wsr, and dropped it into my deploy folder. I had to restart jboss for it to read that (wouldn't hot-deploy the wsr), but after that, I was able to obtain the wsdl by putting in the URL to my service in my web browser.It looked OK.

                  Right now, I am trying to use WSD2Java to generate some client-side stubs, etc. I was using the latest axis WSDL2Java to do this (it integrates nicely with ant), but the resulting files would not compile.

                  So I am going to try the WSDL2Java that comes with the jboss-net axis package that I have, but unfortunately, I think ant doesn't automatically support that one.

                  • 6. Re: Remote Beans as Services?
                    nanda Newbie

                    Could you please post more information about the ant task you used to automatically create web.xml

                    I tried with 'jbossnet' task and I get an error saying task doesn't support 'jbossnet' element.

                    Thanks

                    • 7. Re: Remote Beans as Services?
                      PC Newbie

                      mark,
                      could you repost the zip file.
                      the http link is invalid.
                      thanks.