3 Replies Latest reply on Feb 28, 2008 10:05 AM by Omar Bouchouicha

    the client can't invoke the service

    Omar Bouchouicha Newbie

      Hi everybody!
      I'm following the JBossWS quick start (http://jbws.dyndns.org/mediawiki/index.php?title=Quick_Start), and i'm facing some weird errors.
      Here is what i have done :

      Server side
      My implementation class :

      package org.domain.proj_essai.ws;
      
      import javax.ejb.Stateless;
      import javax.jws.WebParam;
      import javax.jws.WebService;
      import javax.jws.WebMethod;
      import javax.jws.soap.SOAPBinding;
      
      @Stateless
      @WebService(
       name="SommeWS",
       targetNamespace = "http://ws.proj_essai.domain.org",
       serviceName = "SommeWSService")
      @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.WRAPPED) public class SommeWS {
      
       @WebMethod
       public int additionner( int a, int b){
       return a + b;
       }
      
       @WebMethod
       public int soustraire( int a, int b){
       return a - b;
       }
      
       @WebMethod
       public String afficherBonjour() {
       return "Bonjour";
       }
      
      }
      


      my WSDL location (generated automatically when deploying):
      http://127.0.0.1:8080/SommeWSService/SommeWS?wsdl

      Client side:
      First, I generated all client classes with wsconsume :
      wsconsume -k -p bsa.ws http://127.0.0.1:8080/SommeWSService/SommeWS?wsdl
      

      it gave me the following files:
      bsa\ws\Additionner.java
      bsa\ws\AdditionnerResponse.java
      bsa\ws\AfficherBonjour.java
      bsa\ws\AfficherBonjourResponse.java
      bsa\ws\ObjectFactory.java
      bsa\ws\SommeWS.java
      bsa\ws\SommeWSService.java
      bsa\ws\Soustraire.java
      bsa\ws\SoustraireResponse.java
      bsa\ws\package-info.java
      bsa\ws\Additionner.java
      bsa\ws\AdditionnerResponse.java
      bsa\ws\AfficherBonjour.java
      bsa\ws\AfficherBonjourResponse.java
      bsa\ws\ObjectFactory.java
      bsa\ws\SommeWS.java
      bsa\ws\SommeWSService.java
      bsa\ws\Soustraire.java
      bsa\ws\SoustraireResponse.java
      bsa\ws\package-info.java

      Then i try to invoke the service from a method (that works without the web service invoking part) :
      URL url = null;
      try {
       url = new URL("http://127.0.0.1:8080/SommeWSService/SommeWS?wsdl");
      } catch (MalformedURLException e) {
       e.printStackTrace();
      }
      
      Logger.getRootLogger().info("---------------- FLAG1 ----------------");
      Service service = Service.create( url,new QName("SommeWSService") );
      //Service service = Service.create(url,new QName( "http://ws.proj_essai.domain.org", "SommeWSService") );
      
      Logger.getRootLogger().info("---------------- FLAG2 ----------------");
      SommeWS s = service.getPort( SommeWS.class);
      
      
      Logger.getRootLogger().info("------------------------- "+ s.afficherBonjour() +" -----------------------");
      


      PROBLEM:
      i have the following exception:
      ...
      Caused by: javax.xml.ws.WebServiceException: java.lang.IllegalArgumentException: Cannot obtain wsdl service: SommeWSService
      ...
      Caused by: java.lang.IllegalArgumentException: Cannot obtain wsdl service: SommeWSService
      ...
      


      Then, i modified the instruction in the FLAG1 zone by the commented one ( Service service = Service.create(url,new QName( "http://ws.proj_essai.domain.org", "SommeWSService") ); ) . It succeeds, but the FLAG2 instruction ( SommeWS s = service.getPort( SommeWS.class); ) brings me un error :
      ...
      Caused by: java.lang.LinkageError: Class javax/xml/rpc/ParameterMode violates loader constraints
      ...
      


      Could you help me please? If you need more informations ask me.

        • 1. Re: the client can't invoke the service
          Omar Bouchouicha Newbie

          I have the same problem even if i use directly the SommeWSService class :

          //FLAG1
          SommeWSService service = new SommeWSService();
          
          //FLAG2
          SommeWS s = service.getSommeWSPort();


          the same exception at the FLAG2 instruction.

          ...
          Caused by: java.lang.LinkageError: Class javax/xml/rpc/ParameterMode violates loader constraints
          ...


          • 2. Re: the client can't invoke the service
            Omar Bouchouicha Newbie

            I have some good news!! I made it work (somehow...)

            My server application (which provides the web service) is a SEAM application that runs on JBoss 4.2 server.
            My client that can't invoke the web service is an application of another type (non SEAM) running on JBoss 4.0 server.

            Now i've juste made a new Seam project (on 4.2). I could finally invoke the web service with it. I user the same instructions as before and it's perfectly working.

            Now the problem is to make the "old" client (on JBoss 4.0) invoke the service. What could be the origin of the problem? It's the JBoss server 4.0 or something else.

            If you have some answers could you help me please? I'm still searching.

            • 3. Re: the client can't invoke the service
              Omar Bouchouicha Newbie

              Fresh news!!!
              I made the thing work with an application running on JBoss 4.0 . It's another client application. So the problem isn't from the JBoss server itself, it's from my client application.

              Now i have to find WHY my client application can't invoke the service. (still the same exception). My help request is still open :p