File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes Design problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "Design problem" Watch "Design problem" New topic

Design problem

Pritesha Agrawala

Joined: Mar 28, 2008
Posts: 6

I am facing with some integration of web service with the web application.

First I am just explaining architecture of my application:
We have a web application that is running over a Tomcat web server. It has some basic set of operations like insert, search, edit and delete of employee. Now we need to expose those operations as a web service to client. So client can perform those operation from command prompt(run as a script file).

We are using AXIS2 to host those web services.

For that I already write down my request and Response XSD. Also I created WSDL files. by using WSDL2java tool I generated my skeleton's.
Now the problem is:
My skeleton needs to communicate with the code that is written in the web application. So how I can do it?
Means either I used that code as a jar file in service achive file(.aar) and use it. But in this case I am just duplicating my code.Do we have some other alternative in Java?
My problem in simple words how and service archive file(.aar) can communicate with the web archive file(.war) in some web server instance that is running in same JVM.

please if possible then give some time to this problem and help me out.
Abhinav Srivastava
Ranch Hand

Joined: Nov 19, 2002
Posts: 354

Do you really need an AAR file, you can keep all the stuff in your WAR file - this would of course require some changes in descriptor(s).
Deepak Bala

Joined: Feb 24, 2006
Posts: 6662

But in this case I am just duplicating my code

Let me present my understanding of the problem. I am not sure I understood everything you said.

You have a web application .WAR that has a .jar which contains your application specific classes.

You would like to service enable the logic in the .jar and hence you created a web service with AXIS and created a .AAR that contains the skeleton of the service that you will provide.

You now want to know how to go about accessing the code in the .jar file that is in the .war so that the skeleton can access the logic.

Is this correct ? Also, what does this have to do with SCEA

SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
I agree. Here's the link:
subject: Design problem
It's not a secret anymore!