4 Replies Latest reply on Jan 6, 2009 2:46 PM by rodosa

    Problem calling a ws in a servlet

    apieropan

      Hi,
      i am developing an application using jboss 4.2.2,ejb 3.0 and netbeans.
      Following one of the tutorials online i created a web service inside the ejb container, then i created a web service inside my web container. After that i created a servlet. In the servlet i used the "command call web service operation" to auto generate the needed code to call the ws.
      The result is the injection

      @WebServiceRef(wsdlLocation = "http://localhost:8080/prova/NewWebService?wsdl")
      

      That is not supported in jboss 4.2 causing a null pointer exception when i try to access the requested resource.

      I tried the "walkaruond" found on this forum using this code in stand of the previous injection:
      private NewWebServiceService service;
      service = new NewWebServiceService();
      


      and i got the following exception:
      java.lang.ClassCastException: org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl cannot be cast to javax.xml.ws.spi.ServiceDelegate21
      


      Can someone help me solving this trouble, is there any working "walkaround" to call a ws inside a servlet using Jboss 4.2 and Netbeans?

        • 1. Re: Problem calling a ws in a servlet
          sagimann

          I'm getting the same problem. Are you sure JBoss 4.2 doesn't support WebServiceRef annotation? could you pls point me to a doc ref that says that? I've been looking all over for an "official" statement about this...

          anyway, I worked around the problem as you did. However, make sure that the object you create with the 'new' statement is of the class that was auto-generated for you on the client side - not of the class that was used to implement the "real" service.

          • 2. Re: Problem calling a ws in a servlet
            apieropan

            I found that WebServiceRef is not supported in Jboss 4.2 web container even on this forum. If you search that annotation you can find many topics related.

            What do you mean by the class auto generated on the client side? When i create a web service client the only thing that is generate by the ide is a web service reference wsdl.

            • 3. Re: Problem calling a ws in a servlet
              rodosa

              Hello!!

              Had you found the solution or the reason of this problem???

              Thanks,

              • 4. Re: Problem calling a ws in a servlet
                rodosa

                After a bit of time I resolved my problem deleting all jboss-jaxws.jar of my JBoss


                Regards