This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.

Spring Context In Axis Web Service

Mar 1st, 2011, 09:47 AM

So let me start out by saying I have searched the forum and Google for the answer to the question with no luck so far. I'm new to Spring so it's quite possible (and likely) I'm making a rookie mistake. Now onto my question:

I have an existing SOAP web service that I wrote using Eclipse, Axis, and Tomcat. Basically I designed my WSDL file and generated the service skeleton from that WSDL file. I have since discovered Spring because I want to be able to switch between Databases by simply changing a configuration file. I've been able to write a stand-alone Spring application where I can configure the DAO, no problem. Now what I am attempting to do is incorporate that configurability into my web service. So far the only way I've been able to do this is to brute force move the applicationContext.xml file into WEB-INF/classes after deployment in combination with the following code in my Skeleton object.

Obviously this is not ideal. Googling lead me to the ServletEndpointSupport solution which is now deprecated. I've also seen suggestions to use RmiServiceExporter which is probably the way to go but I don't know how to integrate that with Tomcat.

So simply put I'm looking for information on how best to get Spring beans into my web service without having to fundamentally change my web service. This is not a servlet so I cannot use the ServletContext object.