Return-Path:
@@ -43,8 +43,8 @@
ServiceObjectSupplier that will supply the Object.
This guide will show how to use two separate ServiceObjectSupplier classes -that are part of the Axis2 standard distribution: One for use with a servlet -container, and one without. Once configured, the web service itself acts like +that are part of the Axis2 standard distribution: One for use with a ServletContext, +and one without. Once configured, the web service itself acts like any other Spring wired bean. These Spring beans can be loaded any way desired, as Axis2 has no configuration file dependencies from Spring. Spring versions 1.2.6, 1.2.8 and 2.0 have been tested, but probably any version would @@ -80,13 +80,13 @@ </context-param>
Next we will show two examples of Spring's /WEB-INF/applicationContext.xml -referenced in the web.xml listener - one with a servlet container, and one +referenced in the web.xml listener - one using a ServletContext, and one without.
-This 'inside a servlet container' example applicationContext.xml should be +
This 'with a ServletContext' example applicationContext.xml should be familiar to any Spring user:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> @@ -124,10 +124,10 @@ org.apache.axis2.receivers.AbstractMessageReceiver . -Outside a Servlet Container
+Without a ServletContext
-In the case Axis2 can't get a ServletContext, you have the option of -defining a bean that takes advantage of Spring's internal abilities +
In the case Axis2 can't get a ServletContext, ie another transport or running inside the AAR etc, +you have the option of defining a bean that takes advantage of Spring's internal abilities (ApplicationContextAware interface, specifically) to provide an Application Context to Axis2, with a bean ref 'applicationContext' :
<?xml version="1.0" encoding="UTF-8"?> @@ -153,7 +153,7 @@ </beans>If the service is _NOT_ running in a Servlet Container, i.e., Axis2 will -_NOT_ be able to get a hold of ServletContext, the services.xml for the +_NOT_ be able to get a hold of ServletContext or you prefer not to, the services.xml for the example would be using SpringAppContextAwareObjectSupplier such as:
<service name="SpringAwareService"> <description> @@ -171,7 +171,7 @@ would be any Message Receiver that extends org.apache.axis2.receivers.AbstractMessageReceiver . -In a non-servlet container environment, one way you could load the +
In a 'without a ServletContext' environment, one way you could load the applicationContext.xml file is in a place that will be run once, upon start-up, execute:
import org.springframework.context.support.ClassPathXmlApplicationContext; @@ -265,7 +265,6 @@ import org.apache.axis2.client.ServiceClient; public class TestClient { - /** Access point inside the servlet container. **/ private static EndpointReference targetEPR = new EndpointReference( "http://localhost:8080/axis2/services/SpringAwareService"); @@ -372,7 +371,7 @@ ./spring/SpringAwareService.class ./spring/SpringInit.class-As explained in the Outside a Servlet Container section, likewise the +
As explained in the Without a ServletContext section, likewise the 'Spring inside an AAR' config needs to hook Axis2 and Spring together via a Spring bean. Place the following in your Spring config file:
--------------------------------------------------------------------- To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org For additional commands, e-mail: axis-cvs-help@ws.apache.org