9 Replies Latest reply on Oct 19, 2005 7:20 PM by Thomas Diesler

    JNDI Lookup not returning 'javax.xml.rpc.Service'

    Darran Lofthouse Master

      I have been trying to put together my own web service based on the Sample and documentation in the Wiki.

      I can get a simple bean / web service deployed that takes a String as a paramter and returns a String. Executing a client for the simple bean is also fine.

      I run into problems when I try and implement a complex bean that takes a complex type as a parameter and returns a complex type.

      I have deployed my web service within an ear that contains the jar file for the WS and a jar file for the client.

      When I try and run my client code I try and lookup the service ref and cast it to 'javax.xml.Service', I keep getting ClassCastExceptions thrown.

      It turns out that the object I have retrieved from JNDI is a 'javax.naming.Reference' object.

      Looking at the jmx-console the item bound is a 'org.jboss.webservice.client.ServiceReferenceable' object: -

      +- ws4ee-client (class: org.jnp.interfaces.NamingContext)
       | +- service (class: org.jnp.interfaces.NamingContext)
       | | +- CustomerOrderService (class: org.jboss.webservice.client.ServiceReferenceable)

      I went back to the sample code downloaded from the Wiki to deploy that and see if I missed anything.

      The sample code (complexbean) compiles and deploys the same as my code, then running the JUnit test case I get the same behaviour as I get with my service?

      Is there a anything missing from the sample that needs changing to get the correct object returned?

      This is using the latest JBoss (jboss-head) code from CVS last night with Sun JDK 1.4.2_02 on Windows XP.

      I also looked at the JBoss testsuite and it doesn't look as if this scenario is tested yet, one thing I did notice is that the eclipse .classpath file for the testsuite currently excludes the 'org.jboss.test.webservices' package, I think this exclusion needs removing now that the tests are run as part of the build.