File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Spring and the fly likes Axis2 WebService Using Spring Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Axis2 WebService Using Spring" Watch "Axis2 WebService Using Spring" New topic
Author

Axis2 WebService Using Spring

Sheeraz Junejo
Greenhorn

Joined: Jul 28, 2009
Posts: 13
Hi,

I have a web service package called 'TestService.aar' deployed in 'axis2.war/WEB-INF/services'. Each web-method of my service has following code;



Currently as you can see, I am creating an object of a ServiceFactory class (present under axis2.war/WEB-INF/lib directory as an independent JAR) in each web-method which can be re-factored and improved. Following are my options;

1) One way is to make my 'ServiceFactory' instance static (singleton) and all will use single instance. (Not recommended as my code will run in an Application Server like jBoss, WAS, WL and GS and it can cause problems)
2) The other way is to introduce Spring and make my WebSerice class springaware. I followed the instructions under 'Wihtout ServletContext' part of the link http://axis.apache.org/axis2/java/core/docs/spring.html but I am unable to implement it successfully.

Can some provide me a simple example from which I can achieve my target. I just want all my services deployed as '*.aar' within axis2.war to access my ServiceFactory class which is deployed as 'jar' in 'axis2/WEB-INF/lib'.

Your comments and help will be appreciated,

Thanks

--

SJunejo

Sheeraz Junejo
Greenhorn

Joined: Jul 28, 2009
Posts: 13
any luck?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Axis2 WebService Using Spring
 
Similar Threads
Axis2 NoSuchMethodError
axis2
Axis2 (1.5) - Use App Server's Admin console to deploy EAR, WAR, JAR|| Message service in Axis2
New to Axis2 - Unable to see the service
Register web service with Axis2 deployed in JBoss