1 2 3 Previous Next 38 Replies Latest reply on Jul 1, 2008 10:14 AM by poisoner Go to original post
      • 15. Re: Jbossws Tutorial.
        zeeshan.javeed

        if I unzip my file the structure is as

        FirstTest-
        +META-INF
        +WEB-INF
        - web.xml
        +classes
        -Test.class


        Any clue?

        • 16. Re: Jbossws Tutorial.
          jtestori

          i think you need a package, i got an exception in the server.log when i tried without one

          • 17. Re: Jbossws Tutorial.
            jtestori

             

            "abdujaparov" wrote:
            Thank you! I deployed my web service. I have generated the web service wsdl, does it means that the web service work correctly?

            if you mean that the url ...?WSDL shows the wsdl-file in the browser, your service should be up and running

            "abdujaparov" wrote:
            Another question, I must write a web service that read/write an xml file, what is the current path of the war package?

            the path where the war-file is inflated changes with every deployment or server-restart. i'm not sure what the best way to do this is, maybe someone else can help you. i would try if if had time ;)

            • 18. Re: Jbossws Tutorial.

              Thanks you jtestori, the service works! I've written a client with the stubs genereted by axis from the wsdl was generated by jboss and everything work!

              If I go to the list of deployed services I find my service, in this screenview I have some statistics about the service, how can I get this statistics?
              Are this statistics calculated on all the interfaces of the services or are there statistics about every interfaces of a service?
              Thanks again!
              Bye Bye.

              • 19. Re: Jbossws Tutorial.
                zeeshan.javeed

                Hi,
                abdujaparov is it possible for you to post here your complete code including how u make war file ...
                I am not able to see any error on server console but also not able to see my webservice on jbossws page.

                plz do help me out.

                Thanks.

                • 20. Re: Jbossws Tutorial.
                  zeeshan.javeed

                  Hi,
                  You was very right that we have to speficy a package name. Without package name , it did not work but now it works. Now I will create a client and will keep on posting.
                  Thanks in deed.

                  Regards,
                  Zeeshan Javeed.

                  • 21. Re: Jbossws Tutorial.

                    Hi zeeshan.javeed, this is my code:

                    package sum;
                    
                    import javax.jws.WebMethod;
                    import javax.jws.WebService;
                    import javax.jws.soap.SOAPBinding;
                    
                    
                    
                    @WebService
                    @SOAPBinding(style = SOAPBinding.Style.RPC)
                    public class Sum {
                    
                     @WebMethod
                     public int sumAB(int a, int b){
                     return a+b;
                     }
                    
                    }
                    
                    


                    web.xml:
                    <?xml version="1.0" encoding="UTF-8"?>
                    
                    <web-app version="2.5"
                     xmlns="http://java.sun.com/xml/ns/javaee"
                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                     xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
                    
                     <servlet>
                     <servlet-name>Sum</servlet-name>
                     <servlet-class>sum.Sum</servlet-class>
                     </servlet>
                    
                     <servlet-mapping>
                     <servlet-name>Sum</servlet-name>
                     <url-pattern>/*</url-pattern>
                     </servlet-mapping>
                    
                    </web-app>
                    


                    file sum.war:

                    directory META-INF.

                    directory WEB-INF:
                    web.xml
                    directory classes:
                    directory sum:
                    Sum.class

                    If I go to http://localhost:8080/jbossws/services jboss give me these statistics:

                    Registered Service Endpoints
                    Endpoint Name jboss.ws:context=sum,endpoint=Sum
                    Endpoint Address http://127.0.0.1:8080/sum?wsdl
                    StartTime StopTime
                    Thu Oct 18 23:12:09 CEST 2007
                    RequestCount ResponseCount FaultCount
                    0 0 0
                    MinProcessingTime MaxProcessingTime AvgProcessingTime
                    0 0 0


                    • 22. Re: Jbossws Tutorial.
                      zeeshan.javeed

                      Hi,

                      Thanks a lot man. Another favour, can you please put the code of your consumer class (client class).
                      What is the role of different tools provided with Jbossws. For example,
                      wsconsume.bat
                      wsprovide.bat
                      wstools.bat
                      and
                      wsrunclient.bat

                      Thanks.
                      Zeeshan.

                      • 23. Re: Jbossws Tutorial.
                        jtestori
                        • 24. Re: Jbossws Tutorial.
                          zeeshan.javeed

                          HI,
                          I have tried to use both, wsconsume, and wsproivder but all the time i am getting error of ClassDEFFOUNDERROR.
                          Exception in thread "main" java.lang.NoClassDefFoundError: org/jboss/wsf/spi/tools/cmd/WSConsume

                          Althouhg, I have set classpath to jbossws-spi, where these files are present. I am using Java -version
                          java version "1.6.0_03"
                          Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
                          Java HotSpot(TM) Client VM (build 1.6.0_03-b05, mixed mode, sharing).

                          Please help out... how to use. If i try to make an ant.






                          give the error that classname="org.jboss.ws.tools.jaxws.ant.wsprovide" not found.

                          ...
                          Regard,
                          Zeeshan

                          • 25. Re: Jbossws Tutorial.

                            Hi everybody, I developed my client class with axis, with wsdl2java I have produced the stubs classes for the client.
                            For the client you can use every solution. The tools as wsprovide or wsconsume give me the same error of zeeshan and I don't know how can resolve it.

                            The client code is the following:

                            import java.rmi.RemoteException;
                            
                            import javax.xml.rpc.ServiceException;
                            
                            import client.*;
                            
                            
                            public class Client {
                            
                             /**
                             * @param args
                             * @throws ServiceException
                             * @throws RemoteException
                             */
                             public static void main(String[] args) throws ServiceException, RemoteException {
                             // TODO Auto-generated method stub
                            
                             SumService ss = new SumServiceLocator();
                            
                             Sum sun = ss.getSumPort();
                            
                             System.out.println(sun.sumAB(6, 3));
                             }
                            
                            }
                            


                            If someone discovers how resolve and how work wstools could tell me the way?
                            Thanks.
                            Bye bye.

                            • 26. Re: Jbossws Tutorial.
                              zeeshan.javeed

                              Hi abdujaparov,

                              I got few question..

                              what is in the package of client.*;
                              this points to ur webservice provider classes??

                              how you know which service locator you have to call along port ??
                              SumService ss = new SumServiceLocator(); // How you know SumServiceLocator you have to call ? and also .getSumPort(); ??

                              Regards,
                              Zeeshan

                              • 27. Re: Jbossws Tutorial.
                                jtestori

                                i'm using jboss-4.2.1.GA and the wsconsume in the bin-folder

                                @echo off
                                
                                rem $Id: wsgen.bat 2158 2007-01-27 06:20:59Z jason.greene@jboss.com $
                                
                                @if not "%ECHO%" == "" echo %ECHO%
                                @if "%OS%" == "Windows_NT" setlocal
                                
                                set DIRNAME=.\
                                if "%OS%" == "Windows_NT" set DIRNAME=%~dp0%
                                set PROGNAME=run.bat
                                if "%OS%" == "Windows_NT" set PROGNAME=%~nx0%
                                
                                rem Read all command line arguments
                                
                                REM
                                REM The %ARGS% env variable commented out in favor of using %* to include
                                REM all args in java command line. See bug #840239. [jpl]
                                REM
                                REM set ARGS=
                                REM :loop
                                REM if [%1] == [] goto endloop
                                REM set ARGS=%ARGS% %1
                                REM shift
                                REM goto loop
                                REM :endloop
                                
                                set JAVA=%JAVA_HOME%\bin\java
                                set JBOSS_HOME=%DIRNAME%\..
                                rem Setup the java endorsed dirs
                                set JBOSS_ENDORSED_DIRS=%JBOSS_HOME%\lib\endorsed
                                
                                rem Setup the wstools classpath
                                set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JAVA_HOME%/lib/tools.jar
                                set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jboss-xml-binding.jar
                                set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/wstx.jar
                                set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/activation.jar
                                set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/javassist.jar
                                set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/getopt.jar
                                set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jaxb-api.jar
                                set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/stax-api.jar
                                set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jaxb-impl.jar
                                set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jaxb-xjc.jar
                                set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jaxws-rt.jar
                                set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jaxws-tools.jar
                                set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jbossws-spi.jar
                                set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jbossall-client.jar
                                set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jboss-saaj.jar
                                set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jboss-jaxrpc.jar
                                set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jboss-jaxws.jar
                                set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jbossws-client.jar
                                set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/log4j.jar
                                set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/mail.jar
                                
                                rem Execute the JVM
                                "%JAVA%" %JAVA_OPTS% -Djava.endorsed.dirs="%JBOSS_ENDORSED_DIRS%" -Dlog4j.configuration=wstools-log4j.xml -classpath "%WSCONSUME_CLASSPATH%" org.jboss.wsf.spi.tools.cmd.WSConsume %*
                                


                                • 28. Re: Jbossws Tutorial.
                                  jtestori

                                  from the bin folder, the following works for me

                                  wsconsume -k http://localhost:8080/myservice?WSDL
                                  


                                  • 29. Re: Jbossws Tutorial.
                                    zeeshan.javeed

                                    Thanks , its working from there.