2 Replies Latest reply on Apr 15, 2008 4:39 AM by he keji

    Generate WSDL (From JBoss Eclipse IDE or Command line)

    paata lominadze Master

      hi all,
      i am newbie on this,
      i need help.
      i have documentation about Jboss Web Services and i am trying to run one small example (This is Thomas Diesler's example)
      here is example from doc:
      1. Remote Interface :

      import javax.ejb.Remote;
      public interface EJB3RemoteInterface {
       String echo(String input);
      }
      

      2. Implementation

      import javax.annotation.Resource;
      import javax.ejb.Remote;
      import javax.ejb.SessionContext;
      import javax.ejb.Stateless;
      import javax.jws.WebMethod;
      import javax.jws.WebService;
      import javax.jws.soap.SOAPBinding;
      import org.jboss.annotation.ejb.RemoteBinding;
      import org.jboss.ws.annotation.WebContext;
      
      /**
       * Test the JSR-181 javax.jws.WebService annotation on an EJB3 endpoint.
       *
       * Uses the wsdlLocation attribute.
       *
       * @author Thomas.Diesler@jboss.org
       * @since 29-Apr-2005
       */
      @WebService(
       name = "EndpointInterface",
       targetNamespace = "http://www.openuri.org/2004/04/HelloWorld",
       serviceName = "TestService",
       wsdlLocation = "META-INF/wsdl/TestService.wsdl")
      @WebContext(contextRoot = "/jaxws-samples-webservice02-ejb3", urlPattern = "/*")
      @SOAPBinding(style = javax.jws.soap.SOAPBinding.Style.RPC)
      @Remote(EJB3RemoteInterface.class)
      @RemoteBinding(jndiBinding = "/ejb3/EJB3EndpointInterface")
      @Stateless
      public class EJB3Bean02 implements EJB3RemoteInterface {
       @Resource
       SessionContext sessionContext;
       @WebMethod
       public String echo(String input) {
       System.out.println("Reseive = " + input);
       return input + " - Reseived";
       }
      }
      

      3. soapui-project.xml
      <?xml version="1.0" encoding="UTF-8"?>
      <con:soapui-project name="CustomerCare" soapui-version="SNAPSHOT" xmlns:con="http://eviware.com/soapui/config">
       <con:settings>
       <con:setting id="Output Classes Directory">/CustomerCare/bin</con:setting>
       <con:setting id="Output Source Directory">src</con:setting>
       <con:setting id="JBossWS wstools">/home/paatal/InstalledPrograms/jbossws-1.2.1.GA/install/bin</con:setting>
       <con:setting id="Add JBossWS JAR">true</con:setting>
       <con:setting id="com.eviware.soapui.jbosside.jbosswsNature">true</con:setting>
       </con:settings>
      </con:soapui-project>
      


      i add JbossWs Nature For My Project from right click on project and add JBossWS -> Add JBossWS Nature,
      I want generate WSDL from this class (EJB3Bean02)
      after all i tried to generate wsdl from right click on this class and JBossWS -> Publish as web service, enter some parameters and than click generate but i got an error like this :


      
      Running JBossWS wstools for [CustomerCare]
      directory: /home/paatal/InstalledPrograms/Temp/Workshop_Studio_3.2_589/workspace/CustomerCare
      command: sh -c .//home/paatal/InstalledPrograms/jbossws-1.2.1.GA/install/bin/wstools.sh -cp bin -config /tmp/wstools-config52642.xml -dest /home/paatal/InstalledPrograms/Temp/Workshop_Studio_3.2_589/workspace/CustomerCare/src
      -cp: .//home/paatal/InstalledPrograms/jbossws-1.2.1.GA/install/bin/wstools.sh: No such file or directory
      


      There is Incorrect path (There is two backslash - > ".//" i don't know why :( ) Is This JBoss Eclipse IDE Bug or maybe i have something incorrect

      i configure my JBossWS Instalation Directory From Window -> Preferances -> JBoss Eclipse IDE -> Integrated Tools and set classpath for JBossWS wstools : "/home/paatal/InstalledPrograms/jbossws-1.2.1.GA/install/bin"

      am i right ? can anybody help me on it ???


      after all i tried to generate wsdl from command line without JBoss Eclipse IDE

      paatal@paatal:~/InstalledPrograms/jbossws-1.2.1.GA/install/bin> ./wstools.sh -cp bin -config /tmp/wstools-config52642.xml -dest /home/paatal/InstalledPrograms/Temp/Workshop_Studio_3.2_589/workspace/CustomerCare/src
      


      but i got another error like This :
      Exception in thread "main" java.lang.NoClassDefFoundError: javax/jws/soap/SOAPBinding$ParameterStyle
       at org.jboss.ws.tools.helpers.ToolsHelper.handleJavaToWSDLGeneration(ToolsHelper.java:105)
       at org.jboss.ws.tools.WSTools.process(WSTools.java:133)
       at org.jboss.ws.tools.WSTools.generate(WSTools.java:69)
       at org.jboss.ws.tools.WSTools.generate(WSTools.java:119)
       at org.jboss.ws.tools.WSTools.main(WSTools.java:58)
      


      did i something incorrect ?
      can anybody help me ?

      Regards,
      Paata.


        • 1. Re: Generate WSDL (From JBoss Eclipse IDE or Command line)
          rudy fella Newbie

          i have the same problem running wstools from the eclipse ide in linux. I am therefore using the comand line which is working well.

          About the error you receive when using the command line

          Exception in thread "main" java.lang.NoClassDefFoundError: javax/jws/soap/SOAPBinding$ParameterStyle
           at org.jboss.ws.tools.helpers.ToolsHelper.handleJavaToWSDLGeneration(ToolsHelper.java:105)
           at org.jboss.ws.tools.WSTools.process(WSTools.java:133)
           at org.jboss.ws.tools.WSTools.generate(WSTools.java:69)
           at org.jboss.ws.tools.WSTools.generate(WSTools.java:119)
           at org.jboss.ws.tools.WSTools.main(WSTools.java:58)
          


          i think its because you have not added jboss-wsclient.jar to build path since it contains the javax.jws.soap package. Therefore adding this to your project should make it work. It can be found in the com.eviware.soapui.jbosside.wstools_0.4.1/lib which is under eclipse/plugins.