1 Reply Latest reply on Oct 9, 2007 9:51 AM by fantagir

    error using wsprovide

    fantagir

      Hi!

      I'm trying to generate the wsdl and the artifacts of a class that I develop to create a WebService . But I did something wrong because don't work.
      I do it with this:

      $c:\jboss\wsprovide -w -c . IContar.class Contar.class -o .\artf

      And the error is:
      Error: Could not load class [Icontar.class]. Did you specify a valid ?classpath?


      I'm using Jboss 4.2.0GA.
      I've the endpoint IContar and the class Contar that implements the core of the WebService. I have this classes in the directory where I execute the wsprovide command.

      Can you tell me what I'm doing wrong?


      Thanks

        • 1. Re: error using wsprovide
          fantagir

          HI!

          I've solved the error before. I execute the wsprovide in the build directory instead of the build\service directory and change the command like this:

          $c:\jboss\wsprovide -t -o generated -w service. IContar service.Contar

          But know I've got another error:
          java.lang.NoClassDefFoundError: javax/ejb/Stateless

          I don't implement EJB. This could be the problem?

          I put here the code of my classes:

          IContar

          package service;
          
          import java.rmi.Remote;
          import java.rmi.RemoteException;
          
          import javax.jws.WebMethod;
          import javax.jws.WebResult;
          import javax.jws.WebService;
          import javax.jws.WebParam;
          
          import org.osid.OsidContext;
          
          import util.DatePalabra;
          
          @WebService(
           name="IContar", // wsdl:portType
           targetNamespace="urn:service" //wsdl:targetNamespace
           )
          public interface IContar extends Remote {
          
           @WebMethod
           @WebResult(name="IContar_darCuentaResponse")
           public DatePalabra darCuenta(@WebParam(name = "ctx", partName ="ctx") OsidContext ctx) throws RemoteException;
          }
          
          



          Contar

          package service;

          import java.rmi.RemoteException;

          import javax.jws.WebService;
          import javax.jws.soap.SOAPBinding;

          import org.osid.OsidContext;
          import org.osid.OsidException;

          import util.DatePalabra;

          @WebService(
          serviceName="Contar", // wsdl:service
          portName= "IContarPort", //wsdl:port name=... binding=...
          endpointInterface = "service.IContar", //nombre de la interficie del WebService
          targetNamespace="urn:service", //wsdl:targetNamespace
          wsdlLocation = "WEB-INF/wsdl/Contar.wsdl" //nombre y ubicación en el proyecto del fichero .wsdl
          )
          @SOAPBinding(
          style=SOAPBinding.Style.RPC,
          use=SOAPBinding.Use.LITERAL
          )
          public class Contar implements IContar{

          public DatePalabra darCuenta(OsidContext ctx) throws RemoteException {
          DatePalabra dp = new DatePalabra();

          try {
          String str = (String) ctx.getContext("iduser");
          dp.setPalabra(str);
          dp.setLongitud(Integer.toString(str.length()));
          return dp;
          } catch (OsidException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
          dp.setLongitud("0");
          dp.setPalabra("vacio");
          return dp;
          }

          }

          }



          Thanks