0 Replies Latest reply on Oct 25, 2010 11:47 AM by ws ws

    deployment descriptor for @WebService

    ws ws Newbie

      Hello,

       

      I have successfully deployed a JAX-RPC Webservice at jboss 4.2.2 using EJB 3.0 and java 6. I am using the @WebService annotation and a web.xml entry for the corresponding Servlet. After deployment the wsdl file was generated automatically and correctly.

       

      The Bean I have written:

      @WebService
      @SOAPBinding(style = SOAPBinding.Style.RPC)
      public class HelloBean {
      @WebMethod
      public String echo(String input) {
      return "Hello " +input;
      }
      }

      The web.xml:

      <web-app ...>

         <servlet>
              <servlet-name>TestService</servlet-name>
              <servlet-class>hello.HelloBean</servlet-class>
          </servlet>
          <servlet-mapping>
              <servlet-name>TestService</servlet-name>
              <url-pattern>/*</url-pattern>
          </servlet-mapping>   
      </web-app>

       

      I will be using the class HelloBean in different war-archives: archive1.war, archive2.war, archive3.war, archive4.war. I want the Webservice to be deployed when I deploy archive1.war and archive2.war but not when I deploy archive3.war and archive4.war

       

      I want to solve the problem in the following way:

      First I want to remove the @WebService annotation.

      Second I want to use a deployment-descriptor in archive1.war and archive2.war to activate the Webservice. I will not use the deployment-descriptor in archive3.war and archive4.war.

       

      So my question is:

      How must the deployent-descriptor look like?

      Can I replace the @WebService annotation with a simple deployment descriptor? As I mentioned the wsdl-file should be generated by the application server. I have seen people providing a webservices.xml, a wsdl.xml file and a mapping.xml file, but I do not want to provide the wsdl.xml file and the mapping.xml file because providing these files is not necessary when I use the @WebService annotation. So I simply want a deployment descriptor that is equivalent to the @WevService annotation. Is this possible?

       

      Regards,

      Walter, Austria