0

There is a web application. It runs on Apache Tomcat 5.5. Now the requirement is I have to integrate a module in it that will behave as a web service and keeping this web application intact i.e. there will be two parts of this web application one act as SOAP web service and other as a web application.

I have tried this by integrating AXIS2 inside web application. I have included axis2 jars in the existing web project and generate the .aar file. The web application contains the axis2 engine in itself. I have deployed the web project as a war in Tomcat and run the project.

My application is running and web service is listening at its endpoint.

Below is the directory structure of the project:

enter image description here

My question is how the web service module(.aar) and web application module can communicate with each other?

Infotechie
  • 1,653
  • 6
  • 23
  • 35

1 Answers1

0

Now the requirement is I have to integrate a module in it that will behave as a web service and keeping this web application intact

Assuming you have a basic MVC layout:

View (JSP Files) [Top]
      |
Controllers (Java Classes)
      |
Model (Database Abstraction Layer) [Bottom]

Since you have to integrate them with each other, you could do something like so:

View (JSP Files)          Web Service Interface (Axis)  [Top]
      |                         |
Controllers               Service Layer (Java Classes)  [Middle Layer]
      |                         |
      Model (Database Abstraction) [Bottom]

The aim of the service layer would be to hide the database layer and mimic some other logic you might have in the controllers. This would allow the Web Service Layer to be relatively clean and serve solely as a wrapper.

npinti
  • 51,780
  • 5
  • 72
  • 96
  • Model can't be common between both as WebService part is wrapped in .aar. Can you please help me understand what you are trying to say? – Infotechie Oct 17 '13 at 06:44
  • @Infotechie: You essentially add a new layer, called `Service Layer` is found within the Web Application. This layer is then exposed to the web service, which can make use of it. – npinti Oct 17 '13 at 07:20