5 Replies Latest reply on Jun 15, 2005 6:40 AM by aih1013

    WebService invokation from JBoss Service

    aih1013

      I have written an MBean to start jobs from JBoss scheduler. The bean is packaged to .sar file. And the sar is a part of large EAR with libraries , persistence service and so on.

      But there is a problem. Jobs must call a remote web-service. What is the most appropriate way to do that? I may JAX-RPC Client API. But it seems like a hack. Moreover, my web-app packaged in the same ear use the ws too. In webapp's descriptor I can make a reference to the WS, an it will be available via component's JNDI context.

      May be there is a way to bind web-service client stub in global JNDI namespace?

      Thanks in advance

        • 1. Re: WebService invokation from JBoss Service
          zurchman

          I'm surprised that you haven't received any replies on this.

          Since both the web and ejb tiers are deployed in a single application unit, it appears that using a local interface would be the best solution. An EJB's local interface can be bound into global JNDI space using the <local-jndi-name> in jboss.xml.

          This local interface is accessible from the web tier, but how you do this depends on exactly what you're trying to accomplish.

          We might be able to offer more helpful information if you could provide a more complete description of what you're trying to do.





          • 2. Re: WebService invokation from JBoss Service
            aih1013

            May be my question was not clear enough.

            I have a web-service(WS) deployed on machine A. On machine B I have an enterprise application which includes web-app and jboss service sar.

            It quite simple to access the webservice from the web-app. I can add a reference onto the ws into web.xml file, and the service will be accessible from java:comp/env namespace.
            BUT, I could not find such way for jboss service. Is there a way to access my WS from the SAR without usage of direct JAX-RPC API?

            • 3. Re: WebService invokation from JBoss Service
              zurchman

               

              "aih1013" wrote:
              Is there a way to access my WS from the SAR without usage of direct JAX-RPC API?

              (I'm learning this as I go, but) I don't see how this can be done without writing the MBean as a WS client.

              Are you using JBoss 4? Then (at the risk of telling you something obvious that you already know) you should be able to bind your WS endpoint on machine A using <service-ref>, and the SAR code on machine B could obtain the endpoint using a remote JNDI lookup on machine A.

              http://wiki.jboss.org/wiki/Wiki.jsp?page=WSClientAppl




              • 4. Re: WebService invokation from JBoss Service
                thomas.diesler

                Alexey,

                MBeans don't have an environment context. It is indeed arguable that JBoss specific XMBeans (that already have a descriptor) could support JNDI lookup from java:comp/env, but currently we don't have it.

                Is it not possible for you service mbean to go through a SLSB deployed on the same box to access the remote WS?

                • 5. Re: WebService invokation from JBoss Service
                  aih1013

                  Yes, I suppose usage of the SLSB(StateLess Session Bean right?) via JNDI is the only right way.

                  Thanks for help.