1 Reply Latest reply on Apr 7, 2009 6:00 AM by dejanmr

    EJB3 - web service client problem

    hauch

      I am developing a Webservice client in a ejb.

      I prefer the solution where the service object is bound in jndi using <service-ref> as sketched in "Application Server Guide 4.0.4: 12.3.2 Service references".

      Using an ejb the <service-ref> tag is placed in ejb-jar.xml which should be fine according to:
      "This chapter uses a J2EE-1.4 client, but for all intents and purposes, this could also be a Servlet, JSP, or EJB component. All of these J2EE components support <service-ref> elements in their respective deployment descriptor."

      However it seems that the service object is never bound.

      I have now discovered that service-ref no longer is part of the ejb-jar.xml in ejb3, which may explain that it seems to be ignored.

      And now the questions:
      Is this assumption correct (ie. that service-ref in ejb-jar.xml is ignored using ejb3)?
      If this is the case: Is there another way to bind the service object in jndi?
      If not: Has anybody succeded in getting the service object from jndi using ejb3 and <service-ref>? Please provide an example.

      By the way: I am able to connect using the method with qname, servicefactory etc (12.3.1), which indicates that my client artifacts are ok.

        • 1. Re: EJB3 - web service client problem

           

          Is this assumption correct (ie. that service-ref in ejb-jar.xml is ignored using ejb3)?


          No.

          If not: Has anybody succeded in getting the service object from jndi using ejb3 and <service-ref>? Please provide an example



          The only way I have made it work is by specifying the name:
          @WebServiceRef (name="service/myServiceName")

          in Service bean class, and then referencing it from the ejb-jar.xml
          <service-ref-name>service/myServiceName</service-ref-name>

          within <service-ref> tag.

          NOTE: Override does not work. It only work if no WSDL address is specified in @WebServiceRef