3 Replies Latest reply on Feb 14, 2007 5:38 PM by mpardeshi

    Error when invoking Webservice deployed in Jboss 4.0.3

    mpardeshi

      Hi,

      I downloaded the jbossws-1.0.4.GA and deployed one sample (jsr109pojo) in Jboss 4.0.3. When I hit this URL: http://localhost:8080/ws4ee/services , I do see the deployed service as:

      And now... Some Services
      jaxrpc-samples-jsr109pojo-rpc.war#TestService/JaxRpcTestServicePort (wsdl)

      echoSimpleUserType
      echoString


      However I get an exception when I try to access the service from a standalone java client. I have tried a lot of options but in vain.
      Here is my client code:

       ServiceFactoryImpl factory = new ServiceFactoryImpl();
       URL wsdlURL = new File("resources/jaxrpc/samples/jsr109pojo/rpclit//WEB-INF/wsdl/TestService.wsdl").toURL();
       URL mappingURL = new File("resources/jaxrpc/samples/jsr109pojo/rpclit/WEB-INF/jaxrpc-mapping.xml").toURL();
       QName qname = new QName("http://org.jboss.ws/samples/jsr109pojo", "TestService");
       Service service = factory.createService(wsdlURL, qname, mappingURL);
       port = (JaxRpcTestService)service.getPort(JaxRpcTestService.class);
       ((Stub)port)._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, "http://" + "SECEMPARDESM" + ":8080/jaxrpc-samples-jsr109pojo-rpc");
       port.echoString("test", "test");



      And here is the exception I get when I call
      port.echoString("test", "test");
      above:


      Exception in thread "main" java.lang.NoSuchMethodError:
      org.jboss.remoting.Client.<init>(Lorg/jboss/remoting/InvokerLocator;Ljava/lang/String;Ljava/util/Map;)V
       at org.jboss.ws.soap.SOAPConnectionImpl.createRemotingClient(SOAPConnectionImpl.java:205)
       at org.jboss.ws.soap.SOAPConnectionImpl.callInternal(SOAPConnectionImpl.java:149)
       at org.jboss.ws.soap.SOAPConnectionImpl.call(SOAPConnectionImpl.java:92)
       at org.jboss.ws.common.CommonClient.invoke(CommonClient.java:294)
       at org.jboss.ws.jaxrpc.CallImpl.invokeInternal(CallImpl.java:560)
       at org.jboss.ws.jaxrpc.CallImpl.invoke(CallImpl.java:338)
       at org.jboss.ws.jaxrpc.CallProxy.invoke(CallProxy.java:148)
       at $Proxy0.echoString(Unknown Source)
       at org.jboss.test.ws.jaxws.samples.jsr181pojo.RpcJSETestCase.main(JSR181WebServiceJSETestCase.java:103)
      


      I have followed exactly the same steps as in the WS documentation. Can anyone please let me know what am I missing?

        • 1. Re: Error when invoking Webservice deployed in Jboss 4.0.3
          mpardeshi

          I resolved the issue. The problem was I was deploying the webservice in JBoss 4.0.3. The default WS implementation that ships with jboss 4.0.3 does not work with jbossws-1.0.4.GA. So when you are running clients from jbossws-samples-1.0.4.GA be sure to include the following jars from 4.0.3/client:

          axis-ws4ee.jar

          commons-discovery.jar

          jboss-ws4ee-client.jar


          This is probably becauce the WS mechanics are different in both versions, so if you run a client that uses new libraries to call a service deployed in an older version it won't work. May be it was pretty obvious but it didn't struck me.

          • 2. Re: Error when invoking Webservice deployed in Jboss 4.0.3
            thomas.diesler
            • 3. Re: Error when invoking Webservice deployed in Jboss 4.0.3
              mpardeshi

              Thanks for the reply. That is correct. I figured out a better way to call the WebService. Actually I was working on a prototype where we need to call a smalltalk WebService from JBoss so my basic requirement was I should be able to invoke a WebService based on only the WSDL and without writing cryptic code to create SOAP xml. I achieved it using Apache Axis. Axis has a nice tool WSDL2Java which generates all client side artifacts (including the stubs and JAXB binding objects) from a WSDL. I assume it will work the same way when I call the smalltalk service.

              Thanks again for the reply.