8 Replies Latest reply on Apr 29, 2008 2:52 AM by Richard Opalka

    Where do I have to *.jws web service files in JBoss ?

    thoste Newbie

      Sorry for this newbie question:
      From TomCat I know an easy way to deploy simple web services in *.jws files
      like:

      public class MyWebServiceClass
      {
      public double myWebServiceMethd( String job, double x )
      {
      if( "quare".equalsIgnoreCase( job ) )
      return x * x;
      if( "root".equalsIgnoreCase( job ) )
      return Math.sqrt( x );
      return 0.;
      }
      }

      I can put them into:

      <tomcat-root>\webapps\axis

      and they are available.
      Into which directory can I put such *.jws files in JBoss?

      Thomas

        • 1. Re: Where do I have to *.jws web service files in JBoss ?
          Pramod Nair Novice

          If you are planning to use Jax-WS


          @WebService(
          name=" <give values here> ",
          targetNamespace = "<give values here> ",
          serviceName = <give values here> )
          @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE, style = SOAPBinding.Style.DOCUMENT)


          public class MyWebServiceClass
          {

          @WebMethod (<give values here> )

          public double myWebServiceMethd( String job, double x )
          {
          if( "quare".equalsIgnoreCase( job ) )
          return x * x;
          if( "root".equalsIgnoreCase( job ) )
          return Math.sqrt( x );
          return 0.;
          }
          }



          In the web.xml have a serlvet entry.


          OR

          You can use the session bean.

          • 3. Re: Where do I have to *.jws web service files in JBoss ?
            thoste Newbie

             


            In the web.xml have a serlvet entry.
            You can use the session bean.


            Which web.xml do you mean?

            server\default\deploy\jboss-web.deployer\conf\web.xml

            or

            server\default\deploy\jbossws.sar\jbossws-context.war\WEB-INF\web.xml

            or

            another?


            • 4. Re: Where do I have to *.jws web service files in JBoss ?
              Richard Opalka Master

              Please, read our documentation first.
              If still confused download source distribution and try to find the example that fits your needs.
              If still confused post to user forum ;)

              • 5. Re: Where do I have to *.jws web service files in JBoss ?
                thoste Newbie

                 

                "richard.opalka@jboss.com" wrote:
                Please, read our documentation first.
                If still confused download source distribution and try to find the example that fits your needs.
                If still confused post to user forum ;)


                Yes, I read the documentation and I thought this is the user forum.

                Ok, lets explain the problem in more detail:

                I tried out the deployment as you suggested. When I put the *.jws and web.xml (see both below)
                into the deployment directory I got the error shown at the bottom.

                So what wrong?


                MyWebServiceClass.jws:

                @WebService( name="Sum", targetNamespace = "http://sumtest.ws.ptest/", serviceName = "aaa" )
                @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE, style = SOAPBinding.Style.DOCUMENT)


                public class MyWebServiceClass {

                @WebMethod
                public double myWebServiceMethod( String job, double x ) {
                if ("square".equalsIgnoreCase(job) )
                return x * x;
                if ("root".equalsIgnoreCase(job) )
                return Math.sqrt( x );
                return 0.; }
                }



                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-name>MyWebServiceClass</servlet-name>
                <servlet-class>MyWebServiceClass</servlet-class>


                <servlet-mapping>
                <servlet-name>MyWebServiceClass</servlet-name>
                <url-pattern>/*</url-pattern>
                </servlet-mapping>

                </web-app>



                Result in JBoss:

                14:34:25,640 ERROR [URLDeploymentScanner] Incomplete Deployment listing:

                --- Packages waiting for a deployer ---
                org.jboss.deployment.DeploymentInfo@e95e7022 { url=file:/D:/java/JBoss/v4.2.2/server/default/deploy/MyWebServiceClass.jws }
                deployer: null
                status: null
                state: INIT_WAITING_DEPLOYER
                watch: file:/D:/java/JBoss/v4.2.2/server/default/deploy/MyWebServiceClass.jws
                altDD: null
                lastDeployed: 1209385176890
                lastModified: 1209385176890
                mbeans:

                org.jboss.deployment.DeploymentInfo@dc36ff7c { url=file:/D:/java/JBoss/v4.2.2/server/default/deploy/web.xml }
                deployer: null
                status: null
                state: INIT_WAITING_DEPLOYER
                watch: file:/D:/java/JBoss/v4.2.2/server/default/deploy/web.xml
                altDD: null
                lastDeployed: 1209385865421
                lastModified: 1209385865421
                mbeans:

                --- Incompletely deployed packages ---
                org.jboss.deployment.DeploymentInfo@e95e7022 { url=file:/D:/java/JBoss/v4.2.2/server/default/deploy/MyWebServiceClass.jws }
                deployer: null
                status: null
                state: INIT_WAITING_DEPLOYER
                watch: file:/D:/java/JBoss/v4.2.2/server/default/deploy/MyWebServiceClass.jws
                altDD: null
                lastDeployed: 1209385176890
                lastModified: 1209385176890
                mbeans:

                org.jboss.deployment.DeploymentInfo@dc36ff7c { url=file:/D:/java/JBoss/v4.2.2/server/default/deploy/web.xml }
                deployer: null
                status: null
                state: INIT_WAITING_DEPLOYER
                watch: file:/D:/java/JBoss/v4.2.2/server/default/deploy/web.xml
                altDD: null
                lastDeployed: 1209385865421
                lastModified: 1209385865421
                mbeans:




                • 6. Re: Where do I have to *.jws web service files in JBoss ?
                  Peter Johnson Master

                  thoste, I think that Ricard encouraged you to read the documentation because if you did you would find that the extension .jws is not a valid extension. That extension is specific to Axis. This explains the error message:

                  url=file:/D:/java/JBoss/v4.2.2/server/default/deploy/MyWebServiceClass.jws
                  state: INIT_WAITING_DEPLOYER

                  If your web service is an EJB, package it in *.ear. If it is a POJO, package it in *.war or *.wsr.

                  • 7. Re: Where do I have to *.jws web service files in JBoss ?
                    thoste Newbie

                     

                    "PeterJ" wrote:
                    thoste, I think that Ricard encouraged you to read the documentation because if you did you would find that the extension .jws is not a valid extension. That extension is specific to Axis. This explains the error message:

                    url=file:/D:/java/JBoss/v4.2.2/server/default/deploy/MyWebServiceClass.jws
                    state: INIT_WAITING_DEPLOYER

                    If your web service is an EJB, package it in *.ear. If it is a POJO, package it in *.war or *.wsr.


                    Ok, this is an answer. Thank you.
                    "pramod_bs" answer (=second posting) indicated that there is a way of doing this.

                    BTW: The doc explains how to do it and NOT how to do it NOT. So the docs does not say: *.jws is NOT possible.


                    • 8. Re: Where do I have to *.jws web service files in JBoss ?
                      Richard Opalka Master

                       

                      "PeterJ" wrote:
                      thoste, I think that Ricard encouraged you to read the documentation because if you did you would find that the extension .jws is not a valid extension.

                      Exactly
                      "" wrote:
                      The doc explains how to do it and NOT how to do it NOT. So the docs does not say: *.jws is NOT possible.

                      You're right. But remember this user forum thread will help other users in the future ;) This is the purpose of the user forum.