0 Replies Latest reply: Feb 19, 2013 1:24 PM by 992019 RSS

    Adding @Webservices to an existing .war

      I've a J2EE web application based on Spring/Struts/Hibernate, that I usually deploy as a .war on Tomcat.
      All the required .jar are included in the WEB-INF/lib of the .war

      I did succeed in creating an .ear file that simply includes the .war and I can deploy it on Weblogic. It works!

      I now wish to expose some webservices from the application using the standard @Webservice @Webmethod etc annotations.

      On another application server (SAP Netweaver Java AS) I just created a plain java class, annotated them with @Webservice @Webmethod and I've said it extends SpringBeanAutowiringSupport
      In this way spring injects into that class the service beans that will implement the business logic of the webservices using all the features I already have in the original application and it's absolutely great and easy.
      And SAP Netweaver finds at runtime the @Webservice annotations and exposes automatically all of them!

      I thought that on Weblogic the solution was similar. but it is not.

      After deploying an application annotated with @Webservice I did notice that Weblogic did not recognized automatically the webservices.
      So after reading a lot of documentation I am finally trying to play with "jswc" and task (and even with "wsdlc") but with no success.

      It seems that jswc create an indipendent .war for just the webservice, but I wish to put the webservice into the same .war where it is running the struts/spring application!

      I would accept of course of having two different .war (one for the struts/spring application and one for the tiny application just exposing the webservice)
      But the problem is that in the second war (where there is the @Webservice annotated class) I didn't find any way to use some service singleton beans that Spring manages on the other .war

      And, about the JPA entity classes, they are defined and compiled in the Struts/Spring application .war, how can I use those classes in the second .war????

      A solution could be to move all the .jar from the struts/spring .war to the .ear containers, and I should compile all my custom .java into a .jar and put it in the .ear container so that both application can access the same classes, JPA entities services and so on (but even this very difficult solution failed!)

      What's the best way to approach this problem?

      Thank you