You are viewing a plain text version of this content. The canonical link for it is here.
Posted to kandula-dev@ws.apache.org by "Stephan van Hugten (JIRA)" <ji...@apache.org> on 2010/03/25 11:34:27 UTC

[jira] Created: (AXIS2-4662) Improve

Improve
-------

                 Key: AXIS2-4662
                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
             Project: Axis2
          Issue Type: Improvement
          Components: kernel
    Affects Versions: 1.5.1
            Reporter: Stephan van Hugten
             Fix For: 1.5.1


I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.

To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.

The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="namespace stuff">
  
  <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
  	<constructor-arg value="repository" />
  	<constructor-arg value="config/axis2.xml" />
  	<property name="deployedWebservices">
  		<props>
  			<prop key="WeatherSpringService">
com.example.poc.webservice.WeatherSpringService
</prop>
  		</props>
  	</property>
  </bean>

</beans>

With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Attachment:     (was: POC_Axis2.zip)

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Attachment:     (was: POC_Axis2.zip)

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Issue Comment Edited: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12852161#action_12852161 ] 

Stephan van Hugten edited comment on AXIS2-4662 at 3/31/10 11:19 PM:
---------------------------------------------------------------------

After looking at your example project, I redid the @Webservice parser. You can see my vision in the newly enclosed zip file. I made a single element (axis2:webServiceAnnotationConfig) that will pick up any @Webservice annoted class on the classpath and deploy it on the configured ConfigurationContext. I hope you like it.
Possible fine-tuning could be to include a optional package attribute again, because now defining different ConfigurationContexts will again deploy all @Webservice annotated webservice on that ConfigurationContext.

      was (Author: stephan.vanhugten):
    After looking at your example project, I redid the @Webservice parser. You can see my vision in the newly enclosed zip file. I made a single element (axis2:webServiceAnnotationConfig) that will pick up any @Webservice annoted class on the classpath and deploy it on the configured ConfigurationContext. I hope you like it.
  
> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: axis2-spring-core.zip, POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Commented: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12851359#action_12851359 ] 

Andreas Veithen commented on AXIS2-4662:
----------------------------------------

Stephan,

I've combined your code with PoC code implementing some of the ideas I've presented in my blog post. You can find the project at [1]. This is what the Spring configuration would look like for your use case:

<beans:beans xmlns:beans="http://www.springframework.org/schema/beans"
             xmlns="http://axis.apache.org/spring-axis2"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
                                 http://axis.apache.org/spring-axis2 http://axis.apache.org/schema/spring-axis2.xsd">
    <configurationContext/>
    <transportReceiver name="http" class="org.apache.axis2.transport.http.SimpleHTTPServer">
        <parameter name="port">6060</parameter>
    </transportReceiver>
    <transportSender name="http" class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
        <parameter name="PROTOCOL">HTTP/1.1</parameter>
        <parameter name="Transfer-Encoding">chunked</parameter>
    </transportSender>
    <listenerManager/>
    <pojoService bean="weatherService"/>
    <beans:bean id="weatherService" class="org.apache.axis2.spring.WeatherSpringService"/>
</beans:beans>

What do you think about this?

I think it should be possible to configure Spring so that all beans annotated with @WebService are automatically deployed, i.e. to get rid of the explicit <pojoService bean="weatherService"/>. Any idea how this can be achieved?

[1] http://svn.apache.org/repos/asf/axis/axis2/java/core/scratch/java/veithen/spring/axis2-spring-core/

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Attachment:     (was: POC_Axis2.zip)

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Commented: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12850559#action_12850559 ] 

Andreas Veithen commented on AXIS2-4662:
----------------------------------------

To provide the service implementation instance to the Axis service, it is probably better to use org.apache.axis2.ServiceObjectSupplier instead of a context listener.

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Issue Comment Edited: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12849654#action_12849654 ] 

Stephan van Hugten edited comment on AXIS2-4662 at 3/25/10 10:38 AM:
---------------------------------------------------------------------

Included a Proof of Concept for my proposed solution

      was (Author: stephan.vanhugten):
    Proof of Concept for my proposed solution
  
> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>             Fix For: 1.5.1
>
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Attachment: POC_Axis2.zip

Proof of Concept for my proposed solution

> Improve
> -------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>             Fix For: 1.5.1
>
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Attachment:     (was: POC_Axis2.zip)

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Attachment: POC_Axis2.zip

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Description: 
I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.

To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.

The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="namespace stuff">
  
  <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
  	<constructor-arg value="repository" />
  	<constructor-arg value="config/axis2.xml" />
  	<property name="deployedWebservices">
  		<props>
  			<prop key="WeatherSpringService">
com.example.poc.webservice.WeatherSpringService
</prop>
  		</props>
  	</property>
  </bean>

</beans>

With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

  was:
I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.

To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.

The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="namespace stuff">
  
  <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
  	<constructor-arg value="repository" />
  	<constructor-arg value="config/axis2.xml" />
  	<property name="deployedWebservices">
  		<props>
  			<prop key="WeatherSpringService">
com.example.poc.webservice.WeatherSpringService
</prop>
  		</props>
  	</property>
  </bean>

</beans>

With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component.


> Improve
> -------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>             Fix For: 1.5.1
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Attachment: axis2-spring-core.zip

After looking at your example project, I redid the @Webservice parser. You can see my vision in the newly enclosed zip file. I made a single element (axis2:webServiceAnnotationConfig) that will pick up any @Webservice annoted class on the classpath and deploy it on the configured ConfigurationContext. I hope you like it.

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: axis2-spring-core.zip, POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Summary: Improve Spring Integration for Axis2  (was: Improve)

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>             Fix For: 1.5.1
>
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Commented: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12851366#action_12851366 ] 

Stephan van Hugten commented on AXIS2-4662:
-------------------------------------------

It's good that you take the bigger scope in mind. Let me comment on the above mentioned blogpost and example:

It's important for a framework to have this feature as a native implementation, because you can see with the other frameworks that these are patched or hooked into the existing code-base. While the possibility might be good, you must watch out that this does not endanger the interchangeability. Look at what happened to JSF 1.x. People took their ideas and plugged them into JSF with different visions about how AJAX, view handling or state saving should work. This lead to a whole slew of integration issues.

Your first attempt is already a good start, but I would advise convention over configuration, i.e. to include default configuration XMLs with a default transport configuration, much like CXF does. As a user you only would have to define an engine and sometimes services. The transports you include would automatically be added to the default engine or you could define to which engine you add them.
Annotated services could be picked up by a BeanProcessor or as part of the Spring Context Scan. If you define a repository directory, it would pick up the AARs in there.

I sure want to help you with that.

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Veithen updated AXIS2-4662:
-----------------------------------

    Fix Version/s:     (was: 1.5.1)

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Commented: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12850650#action_12850650 ] 

Stephan van Hugten commented on AXIS2-4662:
-------------------------------------------

Okay, so now instead of the ContextListener I use a SpringServiceObjectSupplier that returns the value of the SpringBeanName parameter much the same like the existing Spring object suppliers, except for the  fact that it doesn't need the ApplicationContext to resolve the bean because it's the value of the parameter.

In code, instead of:
configContext.addContextListener(
         new SpringContextListener(serviceImplementation)); 

I use:
Parameter objectSupplierParam = 
        	service.getAxisConfiguration().getParameter(Constants.SERVICE_OBJECT_SUPPLIER);
        if (objectSupplierParam != null) {
        	service.addParameter(SpringServiceObjectSupplier.SERVICE_SPRING_BEANNAME, serviceImplementation);
        } else {
        	service.getAxisConfiguration().addParameter(Constants.SERVICE_OBJECT_SUPPLIER, SpringServiceObjectSupplier.class.getName());
        	service.addParameter(SpringServiceObjectSupplier.SERVICE_SPRING_BEANNAME, serviceImplementation);   	
        }

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Commented: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12850650#action_12850650 ] 

Stephan van Hugten commented on AXIS2-4662:
-------------------------------------------

Okay, so now instead of the ContextListener I use a SpringServiceObjectSupplier that returns the value of the SpringBeanName parameter much the same like the existing Spring object suppliers, except for the  fact that it doesn't need the ApplicationContext to resolve the bean because it's the value of the parameter.

In code, instead of:
configContext.addContextListener(
         new SpringContextListener(serviceImplementation)); 

I use:
Parameter objectSupplierParam = 
        	service.getAxisConfiguration().getParameter(Constants.SERVICE_OBJECT_SUPPLIER);
        if (objectSupplierParam != null) {
        	service.addParameter(SpringServiceObjectSupplier.SERVICE_SPRING_BEANNAME, serviceImplementation);
        } else {
        	service.getAxisConfiguration().addParameter(Constants.SERVICE_OBJECT_SUPPLIER, SpringServiceObjectSupplier.class.getName());
        	service.addParameter(SpringServiceObjectSupplier.SERVICE_SPRING_BEANNAME, serviceImplementation);   	
        }

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Attachment: POC_Axis2.zip

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Issue Comment Edited: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12849654#action_12849654 ] 

Stephan van Hugten edited comment on AXIS2-4662 at 3/25/10 10:38 AM:
---------------------------------------------------------------------

Included a Proof of Concept for my proposed solution

      was (Author: stephan.vanhugten):
    Proof of Concept for my proposed solution
  
> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>             Fix For: 1.5.1
>
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Commented: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12850559#action_12850559 ] 

Andreas Veithen commented on AXIS2-4662:
----------------------------------------

To provide the service implementation instance to the Axis service, it is probably better to use org.apache.axis2.ServiceObjectSupplier instead of a context listener.

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Attachment:     (was: POC_Axis2.zip)

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Issue Comment Edited: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12852161#action_12852161 ] 

Stephan van Hugten edited comment on AXIS2-4662 at 3/31/10 11:19 PM:
---------------------------------------------------------------------

After looking at your example project, I redid the @Webservice parser. You can see my vision in the newly enclosed zip file. I made a single element (axis2:webServiceAnnotationConfig) that will pick up any @Webservice annoted class on the classpath and deploy it on the configured ConfigurationContext. I hope you like it.
Possible fine-tuning could be to include a optional package attribute again, because now defining different ConfigurationContexts will again deploy all @Webservice annotated webservice on that ConfigurationContext.

      was (Author: stephan.vanhugten):
    After looking at your example project, I redid the @Webservice parser. You can see my vision in the newly enclosed zip file. I made a single element (axis2:webServiceAnnotationConfig) that will pick up any @Webservice annoted class on the classpath and deploy it on the configured ConfigurationContext. I hope you like it.
  
> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: axis2-spring-core.zip, POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Attachment: POC_Axis2.zip

Proof of Concept for my proposed solution

> Improve
> -------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>             Fix For: 1.5.1
>
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Attachment:     (was: POC_Axis2.zip)

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Commented: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12853230#action_12853230 ] 

Amila Chinthaka Suriarachchi commented on AXIS2-4662:
-----------------------------------------------------

seem like that your axis2-spring-core.zip is missing with some classes.

NamespaceHandler class is not get compiled.

Can you please send this as a maven project? Then it is easy me to compile this can crate and idea project from that.

your configuration file looks like this. Is this the correct way to refer beans in an spring config file?

<axis2:configurationContext id="config1" />
    <axis2:transportReceiver name="dummy2" class="org.apache.axis2.spring.cfgctx.DummyTransportListener" configurationContext="config1"/>
    
    <axis2:webServiceAnnotationConfig createClients="true" configurationContext="config1" />

I think this should be something like this,


<axis2:configurationContext id="config1" />
    <axis2:transportReceiver name="dummy2" class="org.apache.axis2.spring.cfgctx.DummyTransportListener" >
       <property name="configurationContext" ref="config1"></property>
    </axis2:transportReceiver>
    
  
    <axis2:webServiceAnnotationConfig createClients="true">
        <property name="configurationContext" ref="config1"></property>
    </axis2:webServiceAnnotationConfig>


> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: axis2-spring-core.zip, POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Issue Comment Edited: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12850106#action_12850106 ] 

Stephan van Hugten edited comment on AXIS2-4662 at 3/26/10 3:48 PM:
--------------------------------------------------------------------

You have a very valid point which I didn't consider yet. To address this use case I modified the Spring configuration and also the AxisServer class.

The Spring configuration now looks like this:

  <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
  	<constructor-arg value="repository" />
  	<constructor-arg value="config/axis2.xml" />
  	<property name="deployedWebservices">
  		<list>
  			<value>com.example.poc.webservice.WeatherSpringService</value>
  			<ref bean="DependantWeatherService" />
  		</list>
  	</property>
  </bean>
  
  <bean name="DependantWeatherService" class="com.example.poc.webservice.DependantWeatherSpringService">
  	<property name="weatherSpringService" ref="WeatherService" />
  </bean>

  <bean name="WeatherService" class="com.example.poc.webservice.WeatherSpringService" />

You can put a class name literal in the List or refer to a Spring bean like the one configured below the run-time. In the AxisRunner.setDeployedWebservices method it call the regular AxisServer.deployService(..) for class names and a new deployService(bean instance) method for the Spring beans. It looks like this:

public void deployService(Object serviceImplementation) throws AxisFault {
    	String serviceClassName = serviceImplementation.getClass().getName();
    	if (configContext == null) {
            configContext = getConfigurationContext();
        }
        AxisConfiguration axisConfig = configContext.getAxisConfiguration();
        AxisService service = AxisService.createService(serviceClassName, axisConfig);
        axisConfig.addService(service);
        configContext.addContextListener(
        		new SpringContextListener(serviceImplementation));
        if (startOnDeploy) {
            start();
        }
    }

The different between the regular deployService is that it extracts the serviceClassName from the object and that it sets the SERVICE_OBJECT property on the appropriate ServiceContext via a ContextListener (The SpringContextListener class) so that the bean will be used as implementation class.

      was (Author: stephan.vanhugten):
    You have a very valid point which I didn't consider yet. To address this use case I modified the Spring configuration and also the AxisServer class.

The Spring configuration now looks like this:

  <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
  	<constructor-arg value="repository" />
  	<constructor-arg value="config/axis2.xml" />
  	<property name="deployedWebservices">
  		<list>
  			<value>com.example.poc.webservice.WeatherSpringService</value>
  			<ref bean="DependantWeatherService" />
  		</list>
  	</property>
  </bean>
  
  <bean name="DependantWeatherService" class="com.example.poc.webservice.DependantWeatherSpringService">
  	<property name="weatherSpringService" ref="WeatherService" />
  </bean>

  <bean name="WeatherService" class="com.example.poc.webservice.WeatherSpringService" />

You can put a class name literal in the List or refer to a Spring bean like the one configured below the run-time. In the AxisRunner.setDeployedWebservices method it call the regular AxisServer.deployService(..) for class names and a new deployService(bean instance) method for the Spring beans. It looks like this:

public void deployService(Object serviceImplementation) throws AxisFault {
    	String serviceClassName = serviceImplementation.getClass().getName();
    	if (configContext == null) {
            configContext = getConfigurationContext();
        }
        AxisConfiguration axisConfig = configContext.getAxisConfiguration();
        AxisService service = AxisService.createService(serviceClassName, axisConfig);
        axisConfig.addService(service);
        getConfigurationContext().setProperty(ServiceContext.SERVICE_OBJECT, serviceImplementation);
        if (startOnDeploy) {
            start();
        }
    }

The different between the regular deployService is that it extracts the serviceClassName from the object and that it sets the SERVICE_OBJECT property on the context so that the bean will be used as implementation class. If you like you can also implement it like this in the AxisRunner:

if (webservice instanceof String) { //Just classname
    			this.deployService(webservice.toString());
    		} else { //It's a bean
    			this.deployService(webservice.getClass().getName());
getConfigurationContext().setProperty(ServiceContext.SERVICE_OBJECT, webservice);
    		}
  
> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Commented: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12850893#action_12850893 ] 

Andreas Veithen commented on AXIS2-4662:
----------------------------------------

Stephan,

I was thinking about the Axis2-Spring integration issue from a larger perspective, especially considering that there are already third-party libraries that provide this. I summarized my conclusions in [1] and I would like to have your opinion on this.

[1] http://veithen.blogspot.com/2010/03/some-thoughts-about-axis2-spring.html

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Issue Comment Edited: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12850106#action_12850106 ] 

Stephan van Hugten edited comment on AXIS2-4662 at 3/26/10 3:48 PM:
--------------------------------------------------------------------

You have a very valid point which I didn't consider yet. To address this use case I modified the Spring configuration and also the AxisServer class.

The Spring configuration now looks like this:

  <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
  	<constructor-arg value="repository" />
  	<constructor-arg value="config/axis2.xml" />
  	<property name="deployedWebservices">
  		<list>
  			<value>com.example.poc.webservice.WeatherSpringService</value>
  			<ref bean="DependantWeatherService" />
  		</list>
  	</property>
  </bean>
  
  <bean name="DependantWeatherService" class="com.example.poc.webservice.DependantWeatherSpringService">
  	<property name="weatherSpringService" ref="WeatherService" />
  </bean>

  <bean name="WeatherService" class="com.example.poc.webservice.WeatherSpringService" />

You can put a class name literal in the List or refer to a Spring bean like the one configured below the run-time. In the AxisRunner.setDeployedWebservices method it call the regular AxisServer.deployService(..) for class names and a new deployService(bean instance) method for the Spring beans. It looks like this:

public void deployService(Object serviceImplementation) throws AxisFault {
    	String serviceClassName = serviceImplementation.getClass().getName();
    	if (configContext == null) {
            configContext = getConfigurationContext();
        }
        AxisConfiguration axisConfig = configContext.getAxisConfiguration();
        AxisService service = AxisService.createService(serviceClassName, axisConfig);
        axisConfig.addService(service);
        configContext.addContextListener(
        		new SpringContextListener(serviceImplementation));
        if (startOnDeploy) {
            start();
        }
    }

The different between the regular deployService is that it extracts the serviceClassName from the object and that it sets the SERVICE_OBJECT property on the appropriate ServiceContext via a ContextListener (The SpringContextListener class) so that the bean will be used as implementation class.

      was (Author: stephan.vanhugten):
    You have a very valid point which I didn't consider yet. To address this use case I modified the Spring configuration and also the AxisServer class.

The Spring configuration now looks like this:

  <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
  	<constructor-arg value="repository" />
  	<constructor-arg value="config/axis2.xml" />
  	<property name="deployedWebservices">
  		<list>
  			<value>com.example.poc.webservice.WeatherSpringService</value>
  			<ref bean="DependantWeatherService" />
  		</list>
  	</property>
  </bean>
  
  <bean name="DependantWeatherService" class="com.example.poc.webservice.DependantWeatherSpringService">
  	<property name="weatherSpringService" ref="WeatherService" />
  </bean>

  <bean name="WeatherService" class="com.example.poc.webservice.WeatherSpringService" />

You can put a class name literal in the List or refer to a Spring bean like the one configured below the run-time. In the AxisRunner.setDeployedWebservices method it call the regular AxisServer.deployService(..) for class names and a new deployService(bean instance) method for the Spring beans. It looks like this:

public void deployService(Object serviceImplementation) throws AxisFault {
    	String serviceClassName = serviceImplementation.getClass().getName();
    	if (configContext == null) {
            configContext = getConfigurationContext();
        }
        AxisConfiguration axisConfig = configContext.getAxisConfiguration();
        AxisService service = AxisService.createService(serviceClassName, axisConfig);
        axisConfig.addService(service);
        getConfigurationContext().setProperty(ServiceContext.SERVICE_OBJECT, serviceImplementation);
        if (startOnDeploy) {
            start();
        }
    }

The different between the regular deployService is that it extracts the serviceClassName from the object and that it sets the SERVICE_OBJECT property on the context so that the bean will be used as implementation class. If you like you can also implement it like this in the AxisRunner:

if (webservice instanceof String) { //Just classname
    			this.deployService(webservice.toString());
    		} else { //It's a bean
    			this.deployService(webservice.getClass().getName());
getConfigurationContext().setProperty(ServiceContext.SERVICE_OBJECT, webservice);
    		}
  
> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Attachment: POC_Axis2.zip

You have a very valid point which I didn't consider yet. To address this use case I modified the Spring configuration and also the AxisServer class.

The Spring configuration now looks like this:

  <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
  	<constructor-arg value="repository" />
  	<constructor-arg value="config/axis2.xml" />
  	<property name="deployedWebservices">
  		<list>
  			<value>com.example.poc.webservice.WeatherSpringService</value>
  			<ref bean="DependantWeatherService" />
  		</list>
  	</property>
  </bean>
  
  <bean name="DependantWeatherService" class="com.example.poc.webservice.DependantWeatherSpringService">
  	<property name="weatherSpringService" ref="WeatherService" />
  </bean>

  <bean name="WeatherService" class="com.example.poc.webservice.WeatherSpringService" />

You can put a class name literal in the List or refer to a Spring bean like the one configured below the run-time. In the AxisRunner.setDeployedWebservices method it call the regular AxisServer.deployService(..) for class names and a new deployService(bean instance) method for the Spring beans. It looks like this:

public void deployService(Object serviceImplementation) throws AxisFault {
    	String serviceClassName = serviceImplementation.getClass().getName();
    	if (configContext == null) {
            configContext = getConfigurationContext();
        }
        AxisConfiguration axisConfig = configContext.getAxisConfiguration();
        AxisService service = AxisService.createService(serviceClassName, axisConfig);
        axisConfig.addService(service);
        getConfigurationContext().setProperty(ServiceContext.SERVICE_OBJECT, serviceImplementation);
        if (startOnDeploy) {
            start();
        }
    }

The different between the regular deployService is that it extracts the serviceClassName from the object and that it sets the SERVICE_OBJECT property on the context so that the bean will be used as implementation class. If you like you can also implement it like this in the AxisRunner:

if (webservice instanceof String) { //Just classname
    			this.deployService(webservice.toString());
    		} else { //It's a bean
    			this.deployService(webservice.getClass().getName());
getConfigurationContext().setProperty(ServiceContext.SERVICE_OBJECT, webservice);
    		}

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Commented: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12853332#action_12853332 ] 

Stephan van Hugten commented on AXIS2-4662:
-------------------------------------------

I'm sorry, this might only be clear to Andreas and me. My zip is a patch file based on Andreas' scratch project[1]. Andreas here chose to pass configurationContext as an attribute in the first setup, so I just followed him for my patch. I can see your point as well. I would like something like this:

<axis2:configurationContext id="config1">
<axis2:transportReceiver>
<axis2:transportReceiver ref="dummy2" />
</axis2:transportReceivers> 
</axis2:configurationContext>

    <axis2:transportReceiver name="dummy2" class="org.apache.axis2.spring.cfgctx.DummyTransportListener" />
    
    <axis2:webServiceAnnotationConfig createClients="true" configurationContext="config1" /> <!-- This being a complete separate entity, is completely up for debate -->

[1] http://svn.apache.org/repos/asf/axis/axis2/java/core/scratch/java/veithen/spring/axis2-spring-core/

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: axis2-spring-core.zip, POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Attachment:     (was: POC_Axis2.zip)

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Commented: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12851366#action_12851366 ] 

Stephan van Hugten commented on AXIS2-4662:
-------------------------------------------

It's good that you take the bigger scope in mind. Let me comment on the above mentioned blogpost and example:

It's important for a framework to have this feature as a native implementation, because you can see with the other frameworks that these are patched or hooked into the existing code-base. While the possibility might be good, you must watch out that this does not endanger the interchangeability. Look at what happened to JSF 1.x. People took their ideas and plugged them into JSF with different visions about how AJAX, view handling or state saving should work. This lead to a whole slew of integration issues.

Your first attempt is already a good start, but I would advise convention over configuration, i.e. to include default configuration XMLs with a default transport configuration, much like CXF does. As a user you only would have to define an engine and sometimes services. The transports you include would automatically be added to the default engine or you could define to which engine you add them.
Annotated services could be picked up by a BeanProcessor or as part of the Spring Context Scan. If you define a repository directory, it would pick up the AARs in there.

I sure want to help you with that.

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Veithen updated AXIS2-4662:
-----------------------------------

    Fix Version/s:     (was: 1.5.1)

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Commented: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12850031#action_12850031 ] 

Amila Chinthaka Suriarachchi commented on AXIS2-4662:
-----------------------------------------------------

WSF spring[1] addresses the problem of embeding spring inside a spring container.


[1] http://wso2.org/projects/wsf/spring

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Attachment:     (was: POC_Axis2.zip)

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Issue Comment Edited: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12852161#action_12852161 ] 

Stephan van Hugten edited comment on AXIS2-4662 at 3/31/10 11:19 PM:
---------------------------------------------------------------------

After looking at your example project, I redid the @Webservice parser. You can see my vision in the newly enclosed zip file. I made a single element (axis2:webServiceAnnotationConfig) that will pick up any @Webservice annoted class on the classpath and deploy it on the configured ConfigurationContext. I hope you like it.
Possible fine-tuning could be to include a optional package attribute again, because now defining different ConfigurationContexts will again deploy all @Webservice annotated webservice on that ConfigurationContext.

      was (Author: stephan.vanhugten):
    After looking at your example project, I redid the @Webservice parser. You can see my vision in the newly enclosed zip file. I made a single element (axis2:webServiceAnnotationConfig) that will pick up any @Webservice annoted class on the classpath and deploy it on the configured ConfigurationContext. I hope you like it.
  
> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: axis2-spring-core.zip, POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Description: 
I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.

To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.

The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="namespace stuff">
  
  <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
  	<constructor-arg value="repository" />
  	<constructor-arg value="config/axis2.xml" />
  	<property name="deployedWebservices">
  		<props>
  			<prop key="WeatherSpringService">
com.example.poc.webservice.WeatherSpringService
</prop>
  		</props>
  	</property>
  </bean>

</beans>

With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

  was:
I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.

To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.

The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="namespace stuff">
  
  <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
  	<constructor-arg value="repository" />
  	<constructor-arg value="config/axis2.xml" />
  	<property name="deployedWebservices">
  		<props>
  			<prop key="WeatherSpringService">
com.example.poc.webservice.WeatherSpringService
</prop>
  		</props>
  	</property>
  </bean>

</beans>

With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component.


> Improve
> -------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>             Fix For: 1.5.1
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Description: 
I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.

To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.

The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="namespace stuff">
  
  <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
  	<constructor-arg value="repository" />
  	<constructor-arg value="config/axis2.xml" />
  	<property name="deployedWebservices">
  		<props>
  			<prop key="WeatherSpringService">
com.example.poc.webservice.WeatherSpringService
</prop>
  		</props>
  	</property>
  </bean>

</beans>

With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

  was:
I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.

To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.

The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="namespace stuff">
  
  <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
  	<constructor-arg value="repository" />
  	<constructor-arg value="config/axis2.xml" />
  	<property name="deployedWebservices">
  		<props>
  			<prop key="WeatherSpringService">
com.example.poc.webservice.WeatherSpringService
</prop>
  		</props>
  	</property>
  </bean>

</beans>

With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component.


> Improve
> -------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>             Fix For: 1.5.1
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Attachment: POC_Axis2.zip

Proof of Concept for my proposed solution

> Improve
> -------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>             Fix For: 1.5.1
>
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Commented: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12850893#action_12850893 ] 

Andreas Veithen commented on AXIS2-4662:
----------------------------------------

Stephan,

I was thinking about the Axis2-Spring integration issue from a larger perspective, especially considering that there are already third-party libraries that provide this. I summarized my conclusions in [1] and I would like to have your opinion on this.

[1] http://veithen.blogspot.com/2010/03/some-thoughts-about-axis2-spring.html

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Commented: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12851366#action_12851366 ] 

Stephan van Hugten commented on AXIS2-4662:
-------------------------------------------

It's good that you take the bigger scope in mind. Let me comment on the above mentioned blogpost and example:

It's important for a framework to have this feature as a native implementation, because you can see with the other frameworks that these are patched or hooked into the existing code-base. While the possibility might be good, you must watch out that this does not endanger the interchangeability. Look at what happened to JSF 1.x. People took their ideas and plugged them into JSF with different visions about how AJAX, view handling or state saving should work. This lead to a whole slew of integration issues.

Your first attempt is already a good start, but I would advise convention over configuration, i.e. to include default configuration XMLs with a default transport configuration, much like CXF does. As a user you only would have to define an engine and sometimes services. The transports you include would automatically be added to the default engine or you could define to which engine you add them.
Annotated services could be picked up by a BeanProcessor or as part of the Spring Context Scan. If you define a repository directory, it would pick up the AARs in there.

I sure want to help you with that.

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Attachment: POC_Axis2.zip

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Commented: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12849912#action_12849912 ] 

Andreas Veithen commented on AXIS2-4662:
----------------------------------------

Note that the existing solution addresses a different use case, namely that of embedding Spring inside a service archive (i.e. running a Spring container inside Axis2). Axis2 indeed doesn't provide a solution to embed Axis2 inside a Spring container. While your PoC may be a starting point, it lacks a very important aspect: dependency injection. How would you address a use case where references to some other beans need to be injected into WeatherSpringService?

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Veithen updated AXIS2-4662:
-----------------------------------

    Fix Version/s:     (was: 1.5.1)

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Commented: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12851383#action_12851383 ] 

Stephan van Hugten commented on AXIS2-4662:
-------------------------------------------

After some tinkering I have come up with this:

ApplicationContext.xml:

  <context:component-scan base-package="com.example">
  	<context:include-filter type="annotation" expression="javax.jws.WebService"/>
  </context:component-scan>
  
  <bean class="com.example.poc.beanprocessor.WebServiceAnnotationBeanPostProcessor" />

BeanPostProcessor:

public class WebServiceAnnotationBeanPostProcessor extends CommonAnnotationBeanPostProcessor implements
		ApplicationContextAware {

	/**
	 * 
	 */
	private static final long serialVersionUID = -4394340453143619407L;
	private AxisServer axisServer;
	private ApplicationContext applicationContext;

	@Override
	public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
		if (bean.getClass().isAnnotationPresent(WebService.class)) {
			if (axisServer == null) {
				Map beans = applicationContext.getBeansOfType(AxisServer.class);
				if (beans.isEmpty()) {
					throw new NoSuchBeanDefinitionException("No Axis2 engine configured in the Spring context!");
				} else {
					// TODO Can there be more than 1?
					axisServer = (AxisServer) beans.values().iterator().next();
				}
			}
			try {
				//FIXME: Use annotation configured servicename
				axisServer.deployService(bean);
			} catch (AxisFault e) {
				throw new BeanCreationException(e.getMessage(), e);
			}
		}
		return bean;
	}

	@Override
	public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
		this.applicationContext = applicationContext;
	}
}

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Attachment:     (was: POC_Axis2.zip)

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Commented: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12851359#action_12851359 ] 

Andreas Veithen commented on AXIS2-4662:
----------------------------------------

Stephan,

I've combined your code with PoC code implementing some of the ideas I've presented in my blog post. You can find the project at [1]. This is what the Spring configuration would look like for your use case:

<beans:beans xmlns:beans="http://www.springframework.org/schema/beans"
             xmlns="http://axis.apache.org/spring-axis2"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
                                 http://axis.apache.org/spring-axis2 http://axis.apache.org/schema/spring-axis2.xsd">
    <configurationContext/>
    <transportReceiver name="http" class="org.apache.axis2.transport.http.SimpleHTTPServer">
        <parameter name="port">6060</parameter>
    </transportReceiver>
    <transportSender name="http" class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
        <parameter name="PROTOCOL">HTTP/1.1</parameter>
        <parameter name="Transfer-Encoding">chunked</parameter>
    </transportSender>
    <listenerManager/>
    <pojoService bean="weatherService"/>
    <beans:bean id="weatherService" class="org.apache.axis2.spring.WeatherSpringService"/>
</beans:beans>

What do you think about this?

I think it should be possible to configure Spring so that all beans annotated with @WebService are automatically deployed, i.e. to get rid of the explicit <pojoService bean="weatherService"/>. Any idea how this can be achieved?

[1] http://svn.apache.org/repos/asf/axis/axis2/java/core/scratch/java/veithen/spring/axis2-spring-core/

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Commented: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12851359#action_12851359 ] 

Andreas Veithen commented on AXIS2-4662:
----------------------------------------

Stephan,

I've combined your code with PoC code implementing some of the ideas I've presented in my blog post. You can find the project at [1]. This is what the Spring configuration would look like for your use case:

<beans:beans xmlns:beans="http://www.springframework.org/schema/beans"
             xmlns="http://axis.apache.org/spring-axis2"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
                                 http://axis.apache.org/spring-axis2 http://axis.apache.org/schema/spring-axis2.xsd">
    <configurationContext/>
    <transportReceiver name="http" class="org.apache.axis2.transport.http.SimpleHTTPServer">
        <parameter name="port">6060</parameter>
    </transportReceiver>
    <transportSender name="http" class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
        <parameter name="PROTOCOL">HTTP/1.1</parameter>
        <parameter name="Transfer-Encoding">chunked</parameter>
    </transportSender>
    <listenerManager/>
    <pojoService bean="weatherService"/>
    <beans:bean id="weatherService" class="org.apache.axis2.spring.WeatherSpringService"/>
</beans:beans>

What do you think about this?

I think it should be possible to configure Spring so that all beans annotated with @WebService are automatically deployed, i.e. to get rid of the explicit <pojoService bean="weatherService"/>. Any idea how this can be achieved?

[1] http://svn.apache.org/repos/asf/axis/axis2/java/core/scratch/java/veithen/spring/axis2-spring-core/

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Attachment:     (was: axis2-spring-core.zip)

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Issue Comment Edited: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12849654#action_12849654 ] 

Stephan van Hugten edited comment on AXIS2-4662 at 3/25/10 10:38 AM:
---------------------------------------------------------------------

Included a Proof of Concept for my proposed solution

      was (Author: stephan.vanhugten):
    Proof of Concept for my proposed solution
  
> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>             Fix For: 1.5.1
>
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Veithen updated AXIS2-4662:
-----------------------------------

    Fix Version/s:     (was: 1.5.1)

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Commented: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12850031#action_12850031 ] 

Amila Chinthaka Suriarachchi commented on AXIS2-4662:
-----------------------------------------------------

WSF spring[1] addresses the problem of embeding spring inside a spring container.


[1] http://wso2.org/projects/wsf/spring

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Attachment: POC_Axis2.zip

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Attachment:     (was: axis2-spring-core.zip)

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Commented: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12853230#action_12853230 ] 

Amila Chinthaka Suriarachchi commented on AXIS2-4662:
-----------------------------------------------------

seem like that your axis2-spring-core.zip is missing with some classes.

NamespaceHandler class is not get compiled.

Can you please send this as a maven project? Then it is easy me to compile this can crate and idea project from that.

your configuration file looks like this. Is this the correct way to refer beans in an spring config file?

<axis2:configurationContext id="config1" />
    <axis2:transportReceiver name="dummy2" class="org.apache.axis2.spring.cfgctx.DummyTransportListener" configurationContext="config1"/>
    
    <axis2:webServiceAnnotationConfig createClients="true" configurationContext="config1" />

I think this should be something like this,


<axis2:configurationContext id="config1" />
    <axis2:transportReceiver name="dummy2" class="org.apache.axis2.spring.cfgctx.DummyTransportListener" >
       <property name="configurationContext" ref="config1"></property>
    </axis2:transportReceiver>
    
  
    <axis2:webServiceAnnotationConfig createClients="true">
        <property name="configurationContext" ref="config1"></property>
    </axis2:webServiceAnnotationConfig>


> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: axis2-spring-core.zip, POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Attachment: POC_Axis2.zip

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Issue Comment Edited: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12849654#action_12849654 ] 

Stephan van Hugten edited comment on AXIS2-4662 at 3/25/10 10:38 AM:
---------------------------------------------------------------------

Included a Proof of Concept for my proposed solution

      was (Author: stephan.vanhugten):
    Proof of Concept for my proposed solution
  
> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>             Fix For: 1.5.1
>
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Commented: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12850893#action_12850893 ] 

Andreas Veithen commented on AXIS2-4662:
----------------------------------------

Stephan,

I was thinking about the Axis2-Spring integration issue from a larger perspective, especially considering that there are already third-party libraries that provide this. I summarized my conclusions in [1] and I would like to have your opinion on this.

[1] http://veithen.blogspot.com/2010/03/some-thoughts-about-axis2-spring.html

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Commented: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12853332#action_12853332 ] 

Stephan van Hugten commented on AXIS2-4662:
-------------------------------------------

I'm sorry, this might only be clear to Andreas and me. My zip is a patch file based on Andreas' scratch project[1]. Andreas here chose to pass configurationContext as an attribute in the first setup, so I just followed him for my patch. I can see your point as well. I would like something like this:

<axis2:configurationContext id="config1">
<axis2:transportReceiver>
<axis2:transportReceiver ref="dummy2" />
</axis2:transportReceivers> 
</axis2:configurationContext>

    <axis2:transportReceiver name="dummy2" class="org.apache.axis2.spring.cfgctx.DummyTransportListener" />
    
    <axis2:webServiceAnnotationConfig createClients="true" configurationContext="config1" /> <!-- This being a complete separate entity, is completely up for debate -->

[1] http://svn.apache.org/repos/asf/axis/axis2/java/core/scratch/java/veithen/spring/axis2-spring-core/

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: axis2-spring-core.zip, POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Attachment: POC_Axis2.zip

You have a very valid point which I didn't consider yet. To address this use case I modified the Spring configuration and also the AxisServer class.

The Spring configuration now looks like this:

  <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
  	<constructor-arg value="repository" />
  	<constructor-arg value="config/axis2.xml" />
  	<property name="deployedWebservices">
  		<list>
  			<value>com.example.poc.webservice.WeatherSpringService</value>
  			<ref bean="DependantWeatherService" />
  		</list>
  	</property>
  </bean>
  
  <bean name="DependantWeatherService" class="com.example.poc.webservice.DependantWeatherSpringService">
  	<property name="weatherSpringService" ref="WeatherService" />
  </bean>

  <bean name="WeatherService" class="com.example.poc.webservice.WeatherSpringService" />

You can put a class name literal in the List or refer to a Spring bean like the one configured below the run-time. In the AxisRunner.setDeployedWebservices method it call the regular AxisServer.deployService(..) for class names and a new deployService(bean instance) method for the Spring beans. It looks like this:

public void deployService(Object serviceImplementation) throws AxisFault {
    	String serviceClassName = serviceImplementation.getClass().getName();
    	if (configContext == null) {
            configContext = getConfigurationContext();
        }
        AxisConfiguration axisConfig = configContext.getAxisConfiguration();
        AxisService service = AxisService.createService(serviceClassName, axisConfig);
        axisConfig.addService(service);
        getConfigurationContext().setProperty(ServiceContext.SERVICE_OBJECT, serviceImplementation);
        if (startOnDeploy) {
            start();
        }
    }

The different between the regular deployService is that it extracts the serviceClassName from the object and that it sets the SERVICE_OBJECT property on the context so that the bean will be used as implementation class. If you like you can also implement it like this in the AxisRunner:

if (webservice instanceof String) { //Just classname
    			this.deployService(webservice.toString());
    		} else { //It's a bean
    			this.deployService(webservice.getClass().getName());
getConfigurationContext().setProperty(ServiceContext.SERVICE_OBJECT, webservice);
    		}

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Attachment:     (was: POC_Axis2.zip)

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Attachment: axis2-spring-core.zip

As a final thing before we start the new subproject I added an optional boolean attribute to my webServiceAnnotationConfig element; createClients. If 'true' the WebServiceAnnotationConfigParser will also create a client bean for the service bean with the name <servicename>Client as detailed in the ServiceClientFactoryBean class. Furthermore I cleaned up my code and documented it.

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: axis2-spring-core.zip, POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Attachment: POC_Axis2.zip

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Commented: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12851359#action_12851359 ] 

Andreas Veithen commented on AXIS2-4662:
----------------------------------------

Stephan,

I've combined your code with PoC code implementing some of the ideas I've presented in my blog post. You can find the project at [1]. This is what the Spring configuration would look like for your use case:

<beans:beans xmlns:beans="http://www.springframework.org/schema/beans"
             xmlns="http://axis.apache.org/spring-axis2"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
                                 http://axis.apache.org/spring-axis2 http://axis.apache.org/schema/spring-axis2.xsd">
    <configurationContext/>
    <transportReceiver name="http" class="org.apache.axis2.transport.http.SimpleHTTPServer">
        <parameter name="port">6060</parameter>
    </transportReceiver>
    <transportSender name="http" class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
        <parameter name="PROTOCOL">HTTP/1.1</parameter>
        <parameter name="Transfer-Encoding">chunked</parameter>
    </transportSender>
    <listenerManager/>
    <pojoService bean="weatherService"/>
    <beans:bean id="weatherService" class="org.apache.axis2.spring.WeatherSpringService"/>
</beans:beans>

What do you think about this?

I think it should be possible to configure Spring so that all beans annotated with @WebService are automatically deployed, i.e. to get rid of the explicit <pojoService bean="weatherService"/>. Any idea how this can be achieved?

[1] http://svn.apache.org/repos/asf/axis/axis2/java/core/scratch/java/veithen/spring/axis2-spring-core/

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Commented: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12851383#action_12851383 ] 

Stephan van Hugten commented on AXIS2-4662:
-------------------------------------------

After some tinkering I have come up with this:

ApplicationContext.xml:

  <context:component-scan base-package="com.example">
  	<context:include-filter type="annotation" expression="javax.jws.WebService"/>
  </context:component-scan>
  
  <bean class="com.example.poc.beanprocessor.WebServiceAnnotationBeanPostProcessor" />

BeanPostProcessor:

public class WebServiceAnnotationBeanPostProcessor extends CommonAnnotationBeanPostProcessor implements
		ApplicationContextAware {

	/**
	 * 
	 */
	private static final long serialVersionUID = -4394340453143619407L;
	private AxisServer axisServer;
	private ApplicationContext applicationContext;

	@Override
	public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
		if (bean.getClass().isAnnotationPresent(WebService.class)) {
			if (axisServer == null) {
				Map beans = applicationContext.getBeansOfType(AxisServer.class);
				if (beans.isEmpty()) {
					throw new NoSuchBeanDefinitionException("No Axis2 engine configured in the Spring context!");
				} else {
					// TODO Can there be more than 1?
					axisServer = (AxisServer) beans.values().iterator().next();
				}
			}
			try {
				//FIXME: Use annotation configured servicename
				axisServer.deployService(bean);
			} catch (AxisFault e) {
				throw new BeanCreationException(e.getMessage(), e);
			}
		}
		return bean;
	}

	@Override
	public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
		this.applicationContext = applicationContext;
	}
}

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Attachment: POC_Axis2.zip

Proof of Concept for my proposed solution

> Improve
> -------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>             Fix For: 1.5.1
>
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Commented: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12850893#action_12850893 ] 

Andreas Veithen commented on AXIS2-4662:
----------------------------------------

Stephan,

I was thinking about the Axis2-Spring integration issue from a larger perspective, especially considering that there are already third-party libraries that provide this. I summarized my conclusions in [1] and I would like to have your opinion on this.

[1] http://veithen.blogspot.com/2010/03/some-thoughts-about-axis2-spring.html

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Attachment:     (was: POC_Axis2.zip)

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Commented: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12850031#action_12850031 ] 

Amila Chinthaka Suriarachchi commented on AXIS2-4662:
-----------------------------------------------------

WSF spring[1] addresses the problem of embeding spring inside a spring container.


[1] http://wso2.org/projects/wsf/spring

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Commented: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12851366#action_12851366 ] 

Stephan van Hugten commented on AXIS2-4662:
-------------------------------------------

It's good that you take the bigger scope in mind. Let me comment on the above mentioned blogpost and example:

It's important for a framework to have this feature as a native implementation, because you can see with the other frameworks that these are patched or hooked into the existing code-base. While the possibility might be good, you must watch out that this does not endanger the interchangeability. Look at what happened to JSF 1.x. People took their ideas and plugged them into JSF with different visions about how AJAX, view handling or state saving should work. This lead to a whole slew of integration issues.

Your first attempt is already a good start, but I would advise convention over configuration, i.e. to include default configuration XMLs with a default transport configuration, much like CXF does. As a user you only would have to define an engine and sometimes services. The transports you include would automatically be added to the default engine or you could define to which engine you add them.
Annotated services could be picked up by a BeanProcessor or as part of the Spring Context Scan. If you define a repository directory, it would pick up the AARs in there.

I sure want to help you with that.

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Commented: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12853230#action_12853230 ] 

Amila Chinthaka Suriarachchi commented on AXIS2-4662:
-----------------------------------------------------

seem like that your axis2-spring-core.zip is missing with some classes.

NamespaceHandler class is not get compiled.

Can you please send this as a maven project? Then it is easy me to compile this can crate and idea project from that.

your configuration file looks like this. Is this the correct way to refer beans in an spring config file?

<axis2:configurationContext id="config1" />
    <axis2:transportReceiver name="dummy2" class="org.apache.axis2.spring.cfgctx.DummyTransportListener" configurationContext="config1"/>
    
    <axis2:webServiceAnnotationConfig createClients="true" configurationContext="config1" />

I think this should be something like this,


<axis2:configurationContext id="config1" />
    <axis2:transportReceiver name="dummy2" class="org.apache.axis2.spring.cfgctx.DummyTransportListener" >
       <property name="configurationContext" ref="config1"></property>
    </axis2:transportReceiver>
    
  
    <axis2:webServiceAnnotationConfig createClients="true">
        <property name="configurationContext" ref="config1"></property>
    </axis2:webServiceAnnotationConfig>


> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: axis2-spring-core.zip, POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Attachment: POC_Axis2.zip

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Attachment: axis2-spring-core.zip

After looking at your example project, I redid the @Webservice parser. You can see my vision in the newly enclosed zip file. I made a single element (axis2:webServiceAnnotationConfig) that will pick up any @Webservice annoted class on the classpath and deploy it on the configured ConfigurationContext. I hope you like it.

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: axis2-spring-core.zip, POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Commented: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12849912#action_12849912 ] 

Andreas Veithen commented on AXIS2-4662:
----------------------------------------

Note that the existing solution addresses a different use case, namely that of embedding Spring inside a service archive (i.e. running a Spring container inside Axis2). Axis2 indeed doesn't provide a solution to embed Axis2 inside a Spring container. While your PoC may be a starting point, it lacks a very important aspect: dependency injection. How would you address a use case where references to some other beans need to be injected into WeatherSpringService?

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Summary: Improve Spring Integration for Axis2  (was: Improve)

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>             Fix For: 1.5.1
>
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Issue Comment Edited: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12851383#action_12851383 ] 

Stephan van Hugten edited comment on AXIS2-4662 at 3/30/10 1:00 PM:
--------------------------------------------------------------------

After some tinkering I have come up with this. Dependencies are injected by using @Resource:

ApplicationContext.xml:

  <context:component-scan base-package="com.example">
  	<context:include-filter type="annotation" expression="javax.jws.WebService"/>
  </context:component-scan>
  
  <bean class="com.example.poc.beanprocessor.WebServiceAnnotationBeanPostProcessor" />

BeanPostProcessor:

public class WebServiceAnnotationBeanPostProcessor extends CommonAnnotationBeanPostProcessor implements
		ApplicationContextAware {

	/**
	 * 
	 */
	private static final long serialVersionUID = -4394340453143619407L;
	private AxisServer axisServer;
	private ApplicationContext applicationContext;

	@Override
	public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
		if (bean.getClass().isAnnotationPresent(WebService.class)) {
			if (axisServer == null) {
				Map beans = applicationContext.getBeansOfType(AxisServer.class);
				if (beans.isEmpty()) {
					throw new NoSuchBeanDefinitionException("No Axis2 engine configured in the Spring context!");
				} else {
					// TODO Can there be more than 1?
					axisServer = (AxisServer) beans.values().iterator().next();
				}
			}
			try {
				//FIXME: Use annotation configured servicename
				axisServer.deployService(bean);
			} catch (AxisFault e) {
				throw new BeanCreationException(e.getMessage(), e);
			}
		}
		return bean;
	}

	@Override
	public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
		this.applicationContext = applicationContext;
	}
}

      was (Author: stephan.vanhugten):
    After some tinkering I have come up with this:

ApplicationContext.xml:

  <context:component-scan base-package="com.example">
  	<context:include-filter type="annotation" expression="javax.jws.WebService"/>
  </context:component-scan>
  
  <bean class="com.example.poc.beanprocessor.WebServiceAnnotationBeanPostProcessor" />

BeanPostProcessor:

public class WebServiceAnnotationBeanPostProcessor extends CommonAnnotationBeanPostProcessor implements
		ApplicationContextAware {

	/**
	 * 
	 */
	private static final long serialVersionUID = -4394340453143619407L;
	private AxisServer axisServer;
	private ApplicationContext applicationContext;

	@Override
	public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
		if (bean.getClass().isAnnotationPresent(WebService.class)) {
			if (axisServer == null) {
				Map beans = applicationContext.getBeansOfType(AxisServer.class);
				if (beans.isEmpty()) {
					throw new NoSuchBeanDefinitionException("No Axis2 engine configured in the Spring context!");
				} else {
					// TODO Can there be more than 1?
					axisServer = (AxisServer) beans.values().iterator().next();
				}
			}
			try {
				//FIXME: Use annotation configured servicename
				axisServer.deployService(bean);
			} catch (AxisFault e) {
				throw new BeanCreationException(e.getMessage(), e);
			}
		}
		return bean;
	}

	@Override
	public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
		this.applicationContext = applicationContext;
	}
}
  
> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Commented: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12853332#action_12853332 ] 

Stephan van Hugten commented on AXIS2-4662:
-------------------------------------------

I'm sorry, this might only be clear to Andreas and me. My zip is a patch file based on Andreas' scratch project[1]. Andreas here chose to pass configurationContext as an attribute in the first setup, so I just followed him for my patch. I can see your point as well. I would like something like this:

<axis2:configurationContext id="config1">
<axis2:transportReceiver>
<axis2:transportReceiver ref="dummy2" />
</axis2:transportReceivers> 
</axis2:configurationContext>

    <axis2:transportReceiver name="dummy2" class="org.apache.axis2.spring.cfgctx.DummyTransportListener" />
    
    <axis2:webServiceAnnotationConfig createClients="true" configurationContext="config1" /> <!-- This being a complete separate entity, is completely up for debate -->

[1] http://svn.apache.org/repos/asf/axis/axis2/java/core/scratch/java/veithen/spring/axis2-spring-core/

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: axis2-spring-core.zip, POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Issue Comment Edited: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12852161#action_12852161 ] 

Stephan van Hugten edited comment on AXIS2-4662 at 3/31/10 11:19 PM:
---------------------------------------------------------------------

After looking at your example project, I redid the @Webservice parser. You can see my vision in the newly enclosed zip file. I made a single element (axis2:webServiceAnnotationConfig) that will pick up any @Webservice annoted class on the classpath and deploy it on the configured ConfigurationContext. I hope you like it.
Possible fine-tuning could be to include a optional package attribute again, because now defining different ConfigurationContexts will again deploy all @Webservice annotated webservice on that ConfigurationContext.

      was (Author: stephan.vanhugten):
    After looking at your example project, I redid the @Webservice parser. You can see my vision in the newly enclosed zip file. I made a single element (axis2:webServiceAnnotationConfig) that will pick up any @Webservice annoted class on the classpath and deploy it on the configured ConfigurationContext. I hope you like it.
  
> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: axis2-spring-core.zip, POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Commented: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12851359#action_12851359 ] 

Andreas Veithen commented on AXIS2-4662:
----------------------------------------

Stephan,

I've combined your code with PoC code implementing some of the ideas I've presented in my blog post. You can find the project at [1]. This is what the Spring configuration would look like for your use case:

<beans:beans xmlns:beans="http://www.springframework.org/schema/beans"
             xmlns="http://axis.apache.org/spring-axis2"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
                                 http://axis.apache.org/spring-axis2 http://axis.apache.org/schema/spring-axis2.xsd">
    <configurationContext/>
    <transportReceiver name="http" class="org.apache.axis2.transport.http.SimpleHTTPServer">
        <parameter name="port">6060</parameter>
    </transportReceiver>
    <transportSender name="http" class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
        <parameter name="PROTOCOL">HTTP/1.1</parameter>
        <parameter name="Transfer-Encoding">chunked</parameter>
    </transportSender>
    <listenerManager/>
    <pojoService bean="weatherService"/>
    <beans:bean id="weatherService" class="org.apache.axis2.spring.WeatherSpringService"/>
</beans:beans>

What do you think about this?

I think it should be possible to configure Spring so that all beans annotated with @WebService are automatically deployed, i.e. to get rid of the explicit <pojoService bean="weatherService"/>. Any idea how this can be achieved?

[1] http://svn.apache.org/repos/asf/axis/axis2/java/core/scratch/java/veithen/spring/axis2-spring-core/

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Attachment: POC_Axis2.zip

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Commented: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12851383#action_12851383 ] 

Stephan van Hugten commented on AXIS2-4662:
-------------------------------------------

After some tinkering I have come up with this:

ApplicationContext.xml:

  <context:component-scan base-package="com.example">
  	<context:include-filter type="annotation" expression="javax.jws.WebService"/>
  </context:component-scan>
  
  <bean class="com.example.poc.beanprocessor.WebServiceAnnotationBeanPostProcessor" />

BeanPostProcessor:

public class WebServiceAnnotationBeanPostProcessor extends CommonAnnotationBeanPostProcessor implements
		ApplicationContextAware {

	/**
	 * 
	 */
	private static final long serialVersionUID = -4394340453143619407L;
	private AxisServer axisServer;
	private ApplicationContext applicationContext;

	@Override
	public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
		if (bean.getClass().isAnnotationPresent(WebService.class)) {
			if (axisServer == null) {
				Map beans = applicationContext.getBeansOfType(AxisServer.class);
				if (beans.isEmpty()) {
					throw new NoSuchBeanDefinitionException("No Axis2 engine configured in the Spring context!");
				} else {
					// TODO Can there be more than 1?
					axisServer = (AxisServer) beans.values().iterator().next();
				}
			}
			try {
				//FIXME: Use annotation configured servicename
				axisServer.deployService(bean);
			} catch (AxisFault e) {
				throw new BeanCreationException(e.getMessage(), e);
			}
		}
		return bean;
	}

	@Override
	public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
		this.applicationContext = applicationContext;
	}
}

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Issue Comment Edited: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12851383#action_12851383 ] 

Stephan van Hugten edited comment on AXIS2-4662 at 3/30/10 1:00 PM:
--------------------------------------------------------------------

After some tinkering I have come up with this. Dependencies are injected by using @Resource:

ApplicationContext.xml:

  <context:component-scan base-package="com.example">
  	<context:include-filter type="annotation" expression="javax.jws.WebService"/>
  </context:component-scan>
  
  <bean class="com.example.poc.beanprocessor.WebServiceAnnotationBeanPostProcessor" />

BeanPostProcessor:

public class WebServiceAnnotationBeanPostProcessor extends CommonAnnotationBeanPostProcessor implements
		ApplicationContextAware {

	/**
	 * 
	 */
	private static final long serialVersionUID = -4394340453143619407L;
	private AxisServer axisServer;
	private ApplicationContext applicationContext;

	@Override
	public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
		if (bean.getClass().isAnnotationPresent(WebService.class)) {
			if (axisServer == null) {
				Map beans = applicationContext.getBeansOfType(AxisServer.class);
				if (beans.isEmpty()) {
					throw new NoSuchBeanDefinitionException("No Axis2 engine configured in the Spring context!");
				} else {
					// TODO Can there be more than 1?
					axisServer = (AxisServer) beans.values().iterator().next();
				}
			}
			try {
				//FIXME: Use annotation configured servicename
				axisServer.deployService(bean);
			} catch (AxisFault e) {
				throw new BeanCreationException(e.getMessage(), e);
			}
		}
		return bean;
	}

	@Override
	public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
		this.applicationContext = applicationContext;
	}
}

      was (Author: stephan.vanhugten):
    After some tinkering I have come up with this:

ApplicationContext.xml:

  <context:component-scan base-package="com.example">
  	<context:include-filter type="annotation" expression="javax.jws.WebService"/>
  </context:component-scan>
  
  <bean class="com.example.poc.beanprocessor.WebServiceAnnotationBeanPostProcessor" />

BeanPostProcessor:

public class WebServiceAnnotationBeanPostProcessor extends CommonAnnotationBeanPostProcessor implements
		ApplicationContextAware {

	/**
	 * 
	 */
	private static final long serialVersionUID = -4394340453143619407L;
	private AxisServer axisServer;
	private ApplicationContext applicationContext;

	@Override
	public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
		if (bean.getClass().isAnnotationPresent(WebService.class)) {
			if (axisServer == null) {
				Map beans = applicationContext.getBeansOfType(AxisServer.class);
				if (beans.isEmpty()) {
					throw new NoSuchBeanDefinitionException("No Axis2 engine configured in the Spring context!");
				} else {
					// TODO Can there be more than 1?
					axisServer = (AxisServer) beans.values().iterator().next();
				}
			}
			try {
				//FIXME: Use annotation configured servicename
				axisServer.deployService(bean);
			} catch (AxisFault e) {
				throw new BeanCreationException(e.getMessage(), e);
			}
		}
		return bean;
	}

	@Override
	public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
		this.applicationContext = applicationContext;
	}
}
  
> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Commented: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12853332#action_12853332 ] 

Stephan van Hugten commented on AXIS2-4662:
-------------------------------------------

I'm sorry, this might only be clear to Andreas and me. My zip is a patch file based on Andreas' scratch project[1]. Andreas here chose to pass configurationContext as an attribute in the first setup, so I just followed him for my patch. I can see your point as well. I would like something like this:

<axis2:configurationContext id="config1">
<axis2:transportReceiver>
<axis2:transportReceiver ref="dummy2" />
</axis2:transportReceivers> 
</axis2:configurationContext>

    <axis2:transportReceiver name="dummy2" class="org.apache.axis2.spring.cfgctx.DummyTransportListener" />
    
    <axis2:webServiceAnnotationConfig createClients="true" configurationContext="config1" /> <!-- This being a complete separate entity, is completely up for debate -->

[1] http://svn.apache.org/repos/asf/axis/axis2/java/core/scratch/java/veithen/spring/axis2-spring-core/

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: axis2-spring-core.zip, POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Attachment: axis2-spring-core.zip

As a final thing before we start the new subproject I added an optional boolean attribute to my webServiceAnnotationConfig element; createClients. If 'true' the WebServiceAnnotationConfigParser will also create a client bean for the service bean with the name <servicename>Client as detailed in the ServiceClientFactoryBean class. Furthermore I cleaned up my code and documented it.

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: axis2-spring-core.zip, POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Commented: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12850650#action_12850650 ] 

Stephan van Hugten commented on AXIS2-4662:
-------------------------------------------

Okay, so now instead of the ContextListener I use a SpringServiceObjectSupplier that returns the value of the SpringBeanName parameter much the same like the existing Spring object suppliers, except for the  fact that it doesn't need the ApplicationContext to resolve the bean because it's the value of the parameter.

In code, instead of:
configContext.addContextListener(
         new SpringContextListener(serviceImplementation)); 

I use:
Parameter objectSupplierParam = 
        	service.getAxisConfiguration().getParameter(Constants.SERVICE_OBJECT_SUPPLIER);
        if (objectSupplierParam != null) {
        	service.addParameter(SpringServiceObjectSupplier.SERVICE_SPRING_BEANNAME, serviceImplementation);
        } else {
        	service.getAxisConfiguration().addParameter(Constants.SERVICE_OBJECT_SUPPLIER, SpringServiceObjectSupplier.class.getName());
        	service.addParameter(SpringServiceObjectSupplier.SERVICE_SPRING_BEANNAME, serviceImplementation);   	
        }

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Commented: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12850893#action_12850893 ] 

Andreas Veithen commented on AXIS2-4662:
----------------------------------------

Stephan,

I was thinking about the Axis2-Spring integration issue from a larger perspective, especially considering that there are already third-party libraries that provide this. I summarized my conclusions in [1] and I would like to have your opinion on this.

[1] http://veithen.blogspot.com/2010/03/some-thoughts-about-axis2-spring.html

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Issue Comment Edited: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12849654#action_12849654 ] 

Stephan van Hugten edited comment on AXIS2-4662 at 3/25/10 10:38 AM:
---------------------------------------------------------------------

Included a Proof of Concept for my proposed solution

      was (Author: stephan.vanhugten):
    Proof of Concept for my proposed solution
  
> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>             Fix For: 1.5.1
>
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Issue Comment Edited: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12850106#action_12850106 ] 

Stephan van Hugten edited comment on AXIS2-4662 at 3/26/10 3:48 PM:
--------------------------------------------------------------------

You have a very valid point which I didn't consider yet. To address this use case I modified the Spring configuration and also the AxisServer class.

The Spring configuration now looks like this:

  <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
  	<constructor-arg value="repository" />
  	<constructor-arg value="config/axis2.xml" />
  	<property name="deployedWebservices">
  		<list>
  			<value>com.example.poc.webservice.WeatherSpringService</value>
  			<ref bean="DependantWeatherService" />
  		</list>
  	</property>
  </bean>
  
  <bean name="DependantWeatherService" class="com.example.poc.webservice.DependantWeatherSpringService">
  	<property name="weatherSpringService" ref="WeatherService" />
  </bean>

  <bean name="WeatherService" class="com.example.poc.webservice.WeatherSpringService" />

You can put a class name literal in the List or refer to a Spring bean like the one configured below the run-time. In the AxisRunner.setDeployedWebservices method it call the regular AxisServer.deployService(..) for class names and a new deployService(bean instance) method for the Spring beans. It looks like this:

public void deployService(Object serviceImplementation) throws AxisFault {
    	String serviceClassName = serviceImplementation.getClass().getName();
    	if (configContext == null) {
            configContext = getConfigurationContext();
        }
        AxisConfiguration axisConfig = configContext.getAxisConfiguration();
        AxisService service = AxisService.createService(serviceClassName, axisConfig);
        axisConfig.addService(service);
        configContext.addContextListener(
        		new SpringContextListener(serviceImplementation));
        if (startOnDeploy) {
            start();
        }
    }

The different between the regular deployService is that it extracts the serviceClassName from the object and that it sets the SERVICE_OBJECT property on the appropriate ServiceContext via a ContextListener (The SpringContextListener class) so that the bean will be used as implementation class.

      was (Author: stephan.vanhugten):
    You have a very valid point which I didn't consider yet. To address this use case I modified the Spring configuration and also the AxisServer class.

The Spring configuration now looks like this:

  <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
  	<constructor-arg value="repository" />
  	<constructor-arg value="config/axis2.xml" />
  	<property name="deployedWebservices">
  		<list>
  			<value>com.example.poc.webservice.WeatherSpringService</value>
  			<ref bean="DependantWeatherService" />
  		</list>
  	</property>
  </bean>
  
  <bean name="DependantWeatherService" class="com.example.poc.webservice.DependantWeatherSpringService">
  	<property name="weatherSpringService" ref="WeatherService" />
  </bean>

  <bean name="WeatherService" class="com.example.poc.webservice.WeatherSpringService" />

You can put a class name literal in the List or refer to a Spring bean like the one configured below the run-time. In the AxisRunner.setDeployedWebservices method it call the regular AxisServer.deployService(..) for class names and a new deployService(bean instance) method for the Spring beans. It looks like this:

public void deployService(Object serviceImplementation) throws AxisFault {
    	String serviceClassName = serviceImplementation.getClass().getName();
    	if (configContext == null) {
            configContext = getConfigurationContext();
        }
        AxisConfiguration axisConfig = configContext.getAxisConfiguration();
        AxisService service = AxisService.createService(serviceClassName, axisConfig);
        axisConfig.addService(service);
        getConfigurationContext().setProperty(ServiceContext.SERVICE_OBJECT, serviceImplementation);
        if (startOnDeploy) {
            start();
        }
    }

The different between the regular deployService is that it extracts the serviceClassName from the object and that it sets the SERVICE_OBJECT property on the context so that the bean will be used as implementation class. If you like you can also implement it like this in the AxisRunner:

if (webservice instanceof String) { //Just classname
    			this.deployService(webservice.toString());
    		} else { //It's a bean
    			this.deployService(webservice.getClass().getName());
getConfigurationContext().setProperty(ServiceContext.SERVICE_OBJECT, webservice);
    		}
  
> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Attachment: axis2-spring-core.zip

As a final thing before we start the new subproject I added an optional boolean attribute to my webServiceAnnotationConfig element; createClients. If 'true' the WebServiceAnnotationConfigParser will also create a client bean for the service bean with the name <servicename>Client as detailed in the ServiceClientFactoryBean class. Furthermore I cleaned up my code and documented it.

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: axis2-spring-core.zip, POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Attachment: POC_Axis2.zip

You have a very valid point which I didn't consider yet. To address this use case I modified the Spring configuration and also the AxisServer class.

The Spring configuration now looks like this:

  <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
  	<constructor-arg value="repository" />
  	<constructor-arg value="config/axis2.xml" />
  	<property name="deployedWebservices">
  		<list>
  			<value>com.example.poc.webservice.WeatherSpringService</value>
  			<ref bean="DependantWeatherService" />
  		</list>
  	</property>
  </bean>
  
  <bean name="DependantWeatherService" class="com.example.poc.webservice.DependantWeatherSpringService">
  	<property name="weatherSpringService" ref="WeatherService" />
  </bean>

  <bean name="WeatherService" class="com.example.poc.webservice.WeatherSpringService" />

You can put a class name literal in the List or refer to a Spring bean like the one configured below the run-time. In the AxisRunner.setDeployedWebservices method it call the regular AxisServer.deployService(..) for class names and a new deployService(bean instance) method for the Spring beans. It looks like this:

public void deployService(Object serviceImplementation) throws AxisFault {
    	String serviceClassName = serviceImplementation.getClass().getName();
    	if (configContext == null) {
            configContext = getConfigurationContext();
        }
        AxisConfiguration axisConfig = configContext.getAxisConfiguration();
        AxisService service = AxisService.createService(serviceClassName, axisConfig);
        axisConfig.addService(service);
        getConfigurationContext().setProperty(ServiceContext.SERVICE_OBJECT, serviceImplementation);
        if (startOnDeploy) {
            start();
        }
    }

The different between the regular deployService is that it extracts the serviceClassName from the object and that it sets the SERVICE_OBJECT property on the context so that the bean will be used as implementation class. If you like you can also implement it like this in the AxisRunner:

if (webservice instanceof String) { //Just classname
    			this.deployService(webservice.toString());
    		} else { //It's a bean
    			this.deployService(webservice.getClass().getName());
getConfigurationContext().setProperty(ServiceContext.SERVICE_OBJECT, webservice);
    		}

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Attachment:     (was: axis2-spring-core.zip)

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Summary: Improve Spring Integration for Axis2  (was: Improve)

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>             Fix For: 1.5.1
>
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Attachment: axis2-spring-core.zip

After looking at your example project, I redid the @Webservice parser. You can see my vision in the newly enclosed zip file. I made a single element (axis2:webServiceAnnotationConfig) that will pick up any @Webservice annoted class on the classpath and deploy it on the configured ConfigurationContext. I hope you like it.

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: axis2-spring-core.zip, POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Commented: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12849912#action_12849912 ] 

Andreas Veithen commented on AXIS2-4662:
----------------------------------------

Note that the existing solution addresses a different use case, namely that of embedding Spring inside a service archive (i.e. running a Spring container inside Axis2). Axis2 indeed doesn't provide a solution to embed Axis2 inside a Spring container. While your PoC may be a starting point, it lacks a very important aspect: dependency injection. How would you address a use case where references to some other beans need to be injected into WeatherSpringService?

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Attachment:     (was: axis2-spring-core.zip)

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Summary: Improve Spring Integration for Axis2  (was: Improve)

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>             Fix For: 1.5.1
>
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Attachment:     (was: POC_Axis2.zip)

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Attachment: axis2-spring-core.zip

After looking at your example project, I redid the @Webservice parser. You can see my vision in the newly enclosed zip file. I made a single element (axis2:webServiceAnnotationConfig) that will pick up any @Webservice annoted class on the classpath and deploy it on the configured ConfigurationContext. I hope you like it.

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: axis2-spring-core.zip, POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Commented: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12850031#action_12850031 ] 

Amila Chinthaka Suriarachchi commented on AXIS2-4662:
-----------------------------------------------------

WSF spring[1] addresses the problem of embeding spring inside a spring container.


[1] http://wso2.org/projects/wsf/spring

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Commented: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12853230#action_12853230 ] 

Amila Chinthaka Suriarachchi commented on AXIS2-4662:
-----------------------------------------------------

seem like that your axis2-spring-core.zip is missing with some classes.

NamespaceHandler class is not get compiled.

Can you please send this as a maven project? Then it is easy me to compile this can crate and idea project from that.

your configuration file looks like this. Is this the correct way to refer beans in an spring config file?

<axis2:configurationContext id="config1" />
    <axis2:transportReceiver name="dummy2" class="org.apache.axis2.spring.cfgctx.DummyTransportListener" configurationContext="config1"/>
    
    <axis2:webServiceAnnotationConfig createClients="true" configurationContext="config1" />

I think this should be something like this,


<axis2:configurationContext id="config1" />
    <axis2:transportReceiver name="dummy2" class="org.apache.axis2.spring.cfgctx.DummyTransportListener" >
       <property name="configurationContext" ref="config1"></property>
    </axis2:transportReceiver>
    
  
    <axis2:webServiceAnnotationConfig createClients="true">
        <property name="configurationContext" ref="config1"></property>
    </axis2:webServiceAnnotationConfig>


> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: axis2-spring-core.zip, POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Attachment: axis2-spring-core.zip

As a final thing before we start the new subproject I added an optional boolean attribute to my webServiceAnnotationConfig element; createClients. If 'true' the WebServiceAnnotationConfigParser will also create a client bean for the service bean with the name <servicename>Client as detailed in the ServiceClientFactoryBean class. Furthermore I cleaned up my code and documented it.

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: axis2-spring-core.zip, POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Commented: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12851366#action_12851366 ] 

Stephan van Hugten commented on AXIS2-4662:
-------------------------------------------

It's good that you take the bigger scope in mind. Let me comment on the above mentioned blogpost and example:

It's important for a framework to have this feature as a native implementation, because you can see with the other frameworks that these are patched or hooked into the existing code-base. While the possibility might be good, you must watch out that this does not endanger the interchangeability. Look at what happened to JSF 1.x. People took their ideas and plugged them into JSF with different visions about how AJAX, view handling or state saving should work. This lead to a whole slew of integration issues.

Your first attempt is already a good start, but I would advise convention over configuration, i.e. to include default configuration XMLs with a default transport configuration, much like CXF does. As a user you only would have to define an engine and sometimes services. The transports you include would automatically be added to the default engine or you could define to which engine you add them.
Annotated services could be picked up by a BeanProcessor or as part of the Spring Context Scan. If you define a repository directory, it would pick up the AARs in there.

I sure want to help you with that.

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Attachment: axis2-spring-core.zip

After looking at your example project, I redid the @Webservice parser. You can see my vision in the newly enclosed zip file. I made a single element (axis2:webServiceAnnotationConfig) that will pick up any @Webservice annoted class on the classpath and deploy it on the configured ConfigurationContext. I hope you like it.

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: axis2-spring-core.zip, POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Attachment: POC_Axis2.zip

Proof of Concept for my proposed solution

> Improve
> -------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>             Fix For: 1.5.1
>
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Description: 
I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.

To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.

The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="namespace stuff">
  
  <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
  	<constructor-arg value="repository" />
  	<constructor-arg value="config/axis2.xml" />
  	<property name="deployedWebservices">
  		<props>
  			<prop key="WeatherSpringService">
com.example.poc.webservice.WeatherSpringService
</prop>
  		</props>
  	</property>
  </bean>

</beans>

With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

  was:
I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.

To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.

The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="namespace stuff">
  
  <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
  	<constructor-arg value="repository" />
  	<constructor-arg value="config/axis2.xml" />
  	<property name="deployedWebservices">
  		<props>
  			<prop key="WeatherSpringService">
com.example.poc.webservice.WeatherSpringService
</prop>
  		</props>
  	</property>
  </bean>

</beans>

With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component.


> Improve
> -------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>             Fix For: 1.5.1
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Issue Comment Edited: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12852161#action_12852161 ] 

Stephan van Hugten edited comment on AXIS2-4662 at 3/31/10 11:19 PM:
---------------------------------------------------------------------

After looking at your example project, I redid the @Webservice parser. You can see my vision in the newly enclosed zip file. I made a single element (axis2:webServiceAnnotationConfig) that will pick up any @Webservice annoted class on the classpath and deploy it on the configured ConfigurationContext. I hope you like it.
Possible fine-tuning could be to include a optional package attribute again, because now defining different ConfigurationContexts will again deploy all @Webservice annotated webservice on that ConfigurationContext.

      was (Author: stephan.vanhugten):
    After looking at your example project, I redid the @Webservice parser. You can see my vision in the newly enclosed zip file. I made a single element (axis2:webServiceAnnotationConfig) that will pick up any @Webservice annoted class on the classpath and deploy it on the configured ConfigurationContext. I hope you like it.
  
> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: axis2-spring-core.zip, POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Attachment: POC_Axis2.zip

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Summary: Improve Spring Integration for Axis2  (was: Improve)

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>             Fix For: 1.5.1
>
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Attachment:     (was: axis2-spring-core.zip)

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Attachment:     (was: POC_Axis2.zip)

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Issue Comment Edited: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12851383#action_12851383 ] 

Stephan van Hugten edited comment on AXIS2-4662 at 3/30/10 1:00 PM:
--------------------------------------------------------------------

After some tinkering I have come up with this. Dependencies are injected by using @Resource:

ApplicationContext.xml:

  <context:component-scan base-package="com.example">
  	<context:include-filter type="annotation" expression="javax.jws.WebService"/>
  </context:component-scan>
  
  <bean class="com.example.poc.beanprocessor.WebServiceAnnotationBeanPostProcessor" />

BeanPostProcessor:

public class WebServiceAnnotationBeanPostProcessor extends CommonAnnotationBeanPostProcessor implements
		ApplicationContextAware {

	/**
	 * 
	 */
	private static final long serialVersionUID = -4394340453143619407L;
	private AxisServer axisServer;
	private ApplicationContext applicationContext;

	@Override
	public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
		if (bean.getClass().isAnnotationPresent(WebService.class)) {
			if (axisServer == null) {
				Map beans = applicationContext.getBeansOfType(AxisServer.class);
				if (beans.isEmpty()) {
					throw new NoSuchBeanDefinitionException("No Axis2 engine configured in the Spring context!");
				} else {
					// TODO Can there be more than 1?
					axisServer = (AxisServer) beans.values().iterator().next();
				}
			}
			try {
				//FIXME: Use annotation configured servicename
				axisServer.deployService(bean);
			} catch (AxisFault e) {
				throw new BeanCreationException(e.getMessage(), e);
			}
		}
		return bean;
	}

	@Override
	public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
		this.applicationContext = applicationContext;
	}
}

      was (Author: stephan.vanhugten):
    After some tinkering I have come up with this:

ApplicationContext.xml:

  <context:component-scan base-package="com.example">
  	<context:include-filter type="annotation" expression="javax.jws.WebService"/>
  </context:component-scan>
  
  <bean class="com.example.poc.beanprocessor.WebServiceAnnotationBeanPostProcessor" />

BeanPostProcessor:

public class WebServiceAnnotationBeanPostProcessor extends CommonAnnotationBeanPostProcessor implements
		ApplicationContextAware {

	/**
	 * 
	 */
	private static final long serialVersionUID = -4394340453143619407L;
	private AxisServer axisServer;
	private ApplicationContext applicationContext;

	@Override
	public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
		if (bean.getClass().isAnnotationPresent(WebService.class)) {
			if (axisServer == null) {
				Map beans = applicationContext.getBeansOfType(AxisServer.class);
				if (beans.isEmpty()) {
					throw new NoSuchBeanDefinitionException("No Axis2 engine configured in the Spring context!");
				} else {
					// TODO Can there be more than 1?
					axisServer = (AxisServer) beans.values().iterator().next();
				}
			}
			try {
				//FIXME: Use annotation configured servicename
				axisServer.deployService(bean);
			} catch (AxisFault e) {
				throw new BeanCreationException(e.getMessage(), e);
			}
		}
		return bean;
	}

	@Override
	public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
		this.applicationContext = applicationContext;
	}
}
  
> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Attachment: POC_Axis2.zip

You have a very valid point which I didn't consider yet. To address this use case I modified the Spring configuration and also the AxisServer class.

The Spring configuration now looks like this:

  <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
  	<constructor-arg value="repository" />
  	<constructor-arg value="config/axis2.xml" />
  	<property name="deployedWebservices">
  		<list>
  			<value>com.example.poc.webservice.WeatherSpringService</value>
  			<ref bean="DependantWeatherService" />
  		</list>
  	</property>
  </bean>
  
  <bean name="DependantWeatherService" class="com.example.poc.webservice.DependantWeatherSpringService">
  	<property name="weatherSpringService" ref="WeatherService" />
  </bean>

  <bean name="WeatherService" class="com.example.poc.webservice.WeatherSpringService" />

You can put a class name literal in the List or refer to a Spring bean like the one configured below the run-time. In the AxisRunner.setDeployedWebservices method it call the regular AxisServer.deployService(..) for class names and a new deployService(bean instance) method for the Spring beans. It looks like this:

public void deployService(Object serviceImplementation) throws AxisFault {
    	String serviceClassName = serviceImplementation.getClass().getName();
    	if (configContext == null) {
            configContext = getConfigurationContext();
        }
        AxisConfiguration axisConfig = configContext.getAxisConfiguration();
        AxisService service = AxisService.createService(serviceClassName, axisConfig);
        axisConfig.addService(service);
        getConfigurationContext().setProperty(ServiceContext.SERVICE_OBJECT, serviceImplementation);
        if (startOnDeploy) {
            start();
        }
    }

The different between the regular deployService is that it extracts the serviceClassName from the object and that it sets the SERVICE_OBJECT property on the context so that the bean will be used as implementation class. If you like you can also implement it like this in the AxisRunner:

if (webservice instanceof String) { //Just classname
    			this.deployService(webservice.toString());
    		} else { //It's a bean
    			this.deployService(webservice.getClass().getName());
getConfigurationContext().setProperty(ServiceContext.SERVICE_OBJECT, webservice);
    		}

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Issue Comment Edited: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12851383#action_12851383 ] 

Stephan van Hugten edited comment on AXIS2-4662 at 3/30/10 1:00 PM:
--------------------------------------------------------------------

After some tinkering I have come up with this. Dependencies are injected by using @Resource:

ApplicationContext.xml:

  <context:component-scan base-package="com.example">
  	<context:include-filter type="annotation" expression="javax.jws.WebService"/>
  </context:component-scan>
  
  <bean class="com.example.poc.beanprocessor.WebServiceAnnotationBeanPostProcessor" />

BeanPostProcessor:

public class WebServiceAnnotationBeanPostProcessor extends CommonAnnotationBeanPostProcessor implements
		ApplicationContextAware {

	/**
	 * 
	 */
	private static final long serialVersionUID = -4394340453143619407L;
	private AxisServer axisServer;
	private ApplicationContext applicationContext;

	@Override
	public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
		if (bean.getClass().isAnnotationPresent(WebService.class)) {
			if (axisServer == null) {
				Map beans = applicationContext.getBeansOfType(AxisServer.class);
				if (beans.isEmpty()) {
					throw new NoSuchBeanDefinitionException("No Axis2 engine configured in the Spring context!");
				} else {
					// TODO Can there be more than 1?
					axisServer = (AxisServer) beans.values().iterator().next();
				}
			}
			try {
				//FIXME: Use annotation configured servicename
				axisServer.deployService(bean);
			} catch (AxisFault e) {
				throw new BeanCreationException(e.getMessage(), e);
			}
		}
		return bean;
	}

	@Override
	public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
		this.applicationContext = applicationContext;
	}
}

      was (Author: stephan.vanhugten):
    After some tinkering I have come up with this:

ApplicationContext.xml:

  <context:component-scan base-package="com.example">
  	<context:include-filter type="annotation" expression="javax.jws.WebService"/>
  </context:component-scan>
  
  <bean class="com.example.poc.beanprocessor.WebServiceAnnotationBeanPostProcessor" />

BeanPostProcessor:

public class WebServiceAnnotationBeanPostProcessor extends CommonAnnotationBeanPostProcessor implements
		ApplicationContextAware {

	/**
	 * 
	 */
	private static final long serialVersionUID = -4394340453143619407L;
	private AxisServer axisServer;
	private ApplicationContext applicationContext;

	@Override
	public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
		if (bean.getClass().isAnnotationPresent(WebService.class)) {
			if (axisServer == null) {
				Map beans = applicationContext.getBeansOfType(AxisServer.class);
				if (beans.isEmpty()) {
					throw new NoSuchBeanDefinitionException("No Axis2 engine configured in the Spring context!");
				} else {
					// TODO Can there be more than 1?
					axisServer = (AxisServer) beans.values().iterator().next();
				}
			}
			try {
				//FIXME: Use annotation configured servicename
				axisServer.deployService(bean);
			} catch (AxisFault e) {
				throw new BeanCreationException(e.getMessage(), e);
			}
		}
		return bean;
	}

	@Override
	public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
		this.applicationContext = applicationContext;
	}
}
  
> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Issue Comment Edited: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12850106#action_12850106 ] 

Stephan van Hugten edited comment on AXIS2-4662 at 3/26/10 3:48 PM:
--------------------------------------------------------------------

You have a very valid point which I didn't consider yet. To address this use case I modified the Spring configuration and also the AxisServer class.

The Spring configuration now looks like this:

  <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
  	<constructor-arg value="repository" />
  	<constructor-arg value="config/axis2.xml" />
  	<property name="deployedWebservices">
  		<list>
  			<value>com.example.poc.webservice.WeatherSpringService</value>
  			<ref bean="DependantWeatherService" />
  		</list>
  	</property>
  </bean>
  
  <bean name="DependantWeatherService" class="com.example.poc.webservice.DependantWeatherSpringService">
  	<property name="weatherSpringService" ref="WeatherService" />
  </bean>

  <bean name="WeatherService" class="com.example.poc.webservice.WeatherSpringService" />

You can put a class name literal in the List or refer to a Spring bean like the one configured below the run-time. In the AxisRunner.setDeployedWebservices method it call the regular AxisServer.deployService(..) for class names and a new deployService(bean instance) method for the Spring beans. It looks like this:

public void deployService(Object serviceImplementation) throws AxisFault {
    	String serviceClassName = serviceImplementation.getClass().getName();
    	if (configContext == null) {
            configContext = getConfigurationContext();
        }
        AxisConfiguration axisConfig = configContext.getAxisConfiguration();
        AxisService service = AxisService.createService(serviceClassName, axisConfig);
        axisConfig.addService(service);
        configContext.addContextListener(
        		new SpringContextListener(serviceImplementation));
        if (startOnDeploy) {
            start();
        }
    }

The different between the regular deployService is that it extracts the serviceClassName from the object and that it sets the SERVICE_OBJECT property on the appropriate ServiceContext via a ContextListener (The SpringContextListener class) so that the bean will be used as implementation class.

      was (Author: stephan.vanhugten):
    You have a very valid point which I didn't consider yet. To address this use case I modified the Spring configuration and also the AxisServer class.

The Spring configuration now looks like this:

  <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
  	<constructor-arg value="repository" />
  	<constructor-arg value="config/axis2.xml" />
  	<property name="deployedWebservices">
  		<list>
  			<value>com.example.poc.webservice.WeatherSpringService</value>
  			<ref bean="DependantWeatherService" />
  		</list>
  	</property>
  </bean>
  
  <bean name="DependantWeatherService" class="com.example.poc.webservice.DependantWeatherSpringService">
  	<property name="weatherSpringService" ref="WeatherService" />
  </bean>

  <bean name="WeatherService" class="com.example.poc.webservice.WeatherSpringService" />

You can put a class name literal in the List or refer to a Spring bean like the one configured below the run-time. In the AxisRunner.setDeployedWebservices method it call the regular AxisServer.deployService(..) for class names and a new deployService(bean instance) method for the Spring beans. It looks like this:

public void deployService(Object serviceImplementation) throws AxisFault {
    	String serviceClassName = serviceImplementation.getClass().getName();
    	if (configContext == null) {
            configContext = getConfigurationContext();
        }
        AxisConfiguration axisConfig = configContext.getAxisConfiguration();
        AxisService service = AxisService.createService(serviceClassName, axisConfig);
        axisConfig.addService(service);
        getConfigurationContext().setProperty(ServiceContext.SERVICE_OBJECT, serviceImplementation);
        if (startOnDeploy) {
            start();
        }
    }

The different between the regular deployService is that it extracts the serviceClassName from the object and that it sets the SERVICE_OBJECT property on the context so that the bean will be used as implementation class. If you like you can also implement it like this in the AxisRunner:

if (webservice instanceof String) { //Just classname
    			this.deployService(webservice.toString());
    		} else { //It's a bean
    			this.deployService(webservice.getClass().getName());
getConfigurationContext().setProperty(ServiceContext.SERVICE_OBJECT, webservice);
    		}
  
> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Commented: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12850559#action_12850559 ] 

Andreas Veithen commented on AXIS2-4662:
----------------------------------------

To provide the service implementation instance to the Axis service, it is probably better to use org.apache.axis2.ServiceObjectSupplier instead of a context listener.

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Commented: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12853332#action_12853332 ] 

Stephan van Hugten commented on AXIS2-4662:
-------------------------------------------

I'm sorry, this might only be clear to Andreas and me. My zip is a patch file based on Andreas' scratch project[1]. Andreas here chose to pass configurationContext as an attribute in the first setup, so I just followed him for my patch. I can see your point as well. I would like something like this:

<axis2:configurationContext id="config1">
<axis2:transportReceiver>
<axis2:transportReceiver ref="dummy2" />
</axis2:transportReceivers> 
</axis2:configurationContext>

    <axis2:transportReceiver name="dummy2" class="org.apache.axis2.spring.cfgctx.DummyTransportListener" />
    
    <axis2:webServiceAnnotationConfig createClients="true" configurationContext="config1" /> <!-- This being a complete separate entity, is completely up for debate -->

[1] http://svn.apache.org/repos/asf/axis/axis2/java/core/scratch/java/veithen/spring/axis2-spring-core/

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: axis2-spring-core.zip, POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Commented: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12850031#action_12850031 ] 

Amila Chinthaka Suriarachchi commented on AXIS2-4662:
-----------------------------------------------------

WSF spring[1] addresses the problem of embeding spring inside a spring container.


[1] http://wso2.org/projects/wsf/spring

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Issue Comment Edited: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12851383#action_12851383 ] 

Stephan van Hugten edited comment on AXIS2-4662 at 3/30/10 1:00 PM:
--------------------------------------------------------------------

After some tinkering I have come up with this. Dependencies are injected by using @Resource:

ApplicationContext.xml:

  <context:component-scan base-package="com.example">
  	<context:include-filter type="annotation" expression="javax.jws.WebService"/>
  </context:component-scan>
  
  <bean class="com.example.poc.beanprocessor.WebServiceAnnotationBeanPostProcessor" />

BeanPostProcessor:

public class WebServiceAnnotationBeanPostProcessor extends CommonAnnotationBeanPostProcessor implements
		ApplicationContextAware {

	/**
	 * 
	 */
	private static final long serialVersionUID = -4394340453143619407L;
	private AxisServer axisServer;
	private ApplicationContext applicationContext;

	@Override
	public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
		if (bean.getClass().isAnnotationPresent(WebService.class)) {
			if (axisServer == null) {
				Map beans = applicationContext.getBeansOfType(AxisServer.class);
				if (beans.isEmpty()) {
					throw new NoSuchBeanDefinitionException("No Axis2 engine configured in the Spring context!");
				} else {
					// TODO Can there be more than 1?
					axisServer = (AxisServer) beans.values().iterator().next();
				}
			}
			try {
				//FIXME: Use annotation configured servicename
				axisServer.deployService(bean);
			} catch (AxisFault e) {
				throw new BeanCreationException(e.getMessage(), e);
			}
		}
		return bean;
	}

	@Override
	public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
		this.applicationContext = applicationContext;
	}
}

      was (Author: stephan.vanhugten):
    After some tinkering I have come up with this:

ApplicationContext.xml:

  <context:component-scan base-package="com.example">
  	<context:include-filter type="annotation" expression="javax.jws.WebService"/>
  </context:component-scan>
  
  <bean class="com.example.poc.beanprocessor.WebServiceAnnotationBeanPostProcessor" />

BeanPostProcessor:

public class WebServiceAnnotationBeanPostProcessor extends CommonAnnotationBeanPostProcessor implements
		ApplicationContextAware {

	/**
	 * 
	 */
	private static final long serialVersionUID = -4394340453143619407L;
	private AxisServer axisServer;
	private ApplicationContext applicationContext;

	@Override
	public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
		if (bean.getClass().isAnnotationPresent(WebService.class)) {
			if (axisServer == null) {
				Map beans = applicationContext.getBeansOfType(AxisServer.class);
				if (beans.isEmpty()) {
					throw new NoSuchBeanDefinitionException("No Axis2 engine configured in the Spring context!");
				} else {
					// TODO Can there be more than 1?
					axisServer = (AxisServer) beans.values().iterator().next();
				}
			}
			try {
				//FIXME: Use annotation configured servicename
				axisServer.deployService(bean);
			} catch (AxisFault e) {
				throw new BeanCreationException(e.getMessage(), e);
			}
		}
		return bean;
	}

	@Override
	public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
		this.applicationContext = applicationContext;
	}
}
  
> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Commented: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12850559#action_12850559 ] 

Andreas Veithen commented on AXIS2-4662:
----------------------------------------

To provide the service implementation instance to the Axis service, it is probably better to use org.apache.axis2.ServiceObjectSupplier instead of a context listener.

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Attachment: POC_Axis2.zip

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Commented: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12850650#action_12850650 ] 

Stephan van Hugten commented on AXIS2-4662:
-------------------------------------------

Okay, so now instead of the ContextListener I use a SpringServiceObjectSupplier that returns the value of the SpringBeanName parameter much the same like the existing Spring object suppliers, except for the  fact that it doesn't need the ApplicationContext to resolve the bean because it's the value of the parameter.

In code, instead of:
configContext.addContextListener(
         new SpringContextListener(serviceImplementation)); 

I use:
Parameter objectSupplierParam = 
        	service.getAxisConfiguration().getParameter(Constants.SERVICE_OBJECT_SUPPLIER);
        if (objectSupplierParam != null) {
        	service.addParameter(SpringServiceObjectSupplier.SERVICE_SPRING_BEANNAME, serviceImplementation);
        } else {
        	service.getAxisConfiguration().addParameter(Constants.SERVICE_OBJECT_SUPPLIER, SpringServiceObjectSupplier.class.getName());
        	service.addParameter(SpringServiceObjectSupplier.SERVICE_SPRING_BEANNAME, serviceImplementation);   	
        }

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Commented: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12849912#action_12849912 ] 

Andreas Veithen commented on AXIS2-4662:
----------------------------------------

Note that the existing solution addresses a different use case, namely that of embedding Spring inside a service archive (i.e. running a Spring container inside Axis2). Axis2 indeed doesn't provide a solution to embed Axis2 inside a Spring container. While your PoC may be a starting point, it lacks a very important aspect: dependency injection. How would you address a use case where references to some other beans need to be injected into WeatherSpringService?

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Attachment: POC_Axis2.zip

You have a very valid point which I didn't consider yet. To address this use case I modified the Spring configuration and also the AxisServer class.

The Spring configuration now looks like this:

  <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
  	<constructor-arg value="repository" />
  	<constructor-arg value="config/axis2.xml" />
  	<property name="deployedWebservices">
  		<list>
  			<value>com.example.poc.webservice.WeatherSpringService</value>
  			<ref bean="DependantWeatherService" />
  		</list>
  	</property>
  </bean>
  
  <bean name="DependantWeatherService" class="com.example.poc.webservice.DependantWeatherSpringService">
  	<property name="weatherSpringService" ref="WeatherService" />
  </bean>

  <bean name="WeatherService" class="com.example.poc.webservice.WeatherSpringService" />

You can put a class name literal in the List or refer to a Spring bean like the one configured below the run-time. In the AxisRunner.setDeployedWebservices method it call the regular AxisServer.deployService(..) for class names and a new deployService(bean instance) method for the Spring beans. It looks like this:

public void deployService(Object serviceImplementation) throws AxisFault {
    	String serviceClassName = serviceImplementation.getClass().getName();
    	if (configContext == null) {
            configContext = getConfigurationContext();
        }
        AxisConfiguration axisConfig = configContext.getAxisConfiguration();
        AxisService service = AxisService.createService(serviceClassName, axisConfig);
        axisConfig.addService(service);
        getConfigurationContext().setProperty(ServiceContext.SERVICE_OBJECT, serviceImplementation);
        if (startOnDeploy) {
            start();
        }
    }

The different between the regular deployService is that it extracts the serviceClassName from the object and that it sets the SERVICE_OBJECT property on the context so that the bean will be used as implementation class. If you like you can also implement it like this in the AxisRunner:

if (webservice instanceof String) { //Just classname
    			this.deployService(webservice.toString());
    		} else { //It's a bean
    			this.deployService(webservice.getClass().getName());
getConfigurationContext().setProperty(ServiceContext.SERVICE_OBJECT, webservice);
    		}

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Description: 
I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.

To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.

The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="namespace stuff">
  
  <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
  	<constructor-arg value="repository" />
  	<constructor-arg value="config/axis2.xml" />
  	<property name="deployedWebservices">
  		<props>
  			<prop key="WeatherSpringService">
com.example.poc.webservice.WeatherSpringService
</prop>
  		</props>
  	</property>
  </bean>

</beans>

With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

  was:
I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.

To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.

The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="namespace stuff">
  
  <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
  	<constructor-arg value="repository" />
  	<constructor-arg value="config/axis2.xml" />
  	<property name="deployedWebservices">
  		<props>
  			<prop key="WeatherSpringService">
com.example.poc.webservice.WeatherSpringService
</prop>
  		</props>
  	</property>
  </bean>

</beans>

With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component.


> Improve
> -------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>             Fix For: 1.5.1
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Commented: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12850559#action_12850559 ] 

Andreas Veithen commented on AXIS2-4662:
----------------------------------------

To provide the service implementation instance to the Axis service, it is probably better to use org.apache.axis2.ServiceObjectSupplier instead of a context listener.

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Commented: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12850650#action_12850650 ] 

Stephan van Hugten commented on AXIS2-4662:
-------------------------------------------

Okay, so now instead of the ContextListener I use a SpringServiceObjectSupplier that returns the value of the SpringBeanName parameter much the same like the existing Spring object suppliers, except for the  fact that it doesn't need the ApplicationContext to resolve the bean because it's the value of the parameter.

In code, instead of:
configContext.addContextListener(
         new SpringContextListener(serviceImplementation)); 

I use:
Parameter objectSupplierParam = 
        	service.getAxisConfiguration().getParameter(Constants.SERVICE_OBJECT_SUPPLIER);
        if (objectSupplierParam != null) {
        	service.addParameter(SpringServiceObjectSupplier.SERVICE_SPRING_BEANNAME, serviceImplementation);
        } else {
        	service.getAxisConfiguration().addParameter(Constants.SERVICE_OBJECT_SUPPLIER, SpringServiceObjectSupplier.class.getName());
        	service.addParameter(SpringServiceObjectSupplier.SERVICE_SPRING_BEANNAME, serviceImplementation);   	
        }

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Commented: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12849912#action_12849912 ] 

Andreas Veithen commented on AXIS2-4662:
----------------------------------------

Note that the existing solution addresses a different use case, namely that of embedding Spring inside a service archive (i.e. running a Spring container inside Axis2). Axis2 indeed doesn't provide a solution to embed Axis2 inside a Spring container. While your PoC may be a starting point, it lacks a very important aspect: dependency injection. How would you address a use case where references to some other beans need to be injected into WeatherSpringService?

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Attachment:     (was: POC_Axis2.zip)

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Commented: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12853230#action_12853230 ] 

Amila Chinthaka Suriarachchi commented on AXIS2-4662:
-----------------------------------------------------

seem like that your axis2-spring-core.zip is missing with some classes.

NamespaceHandler class is not get compiled.

Can you please send this as a maven project? Then it is easy me to compile this can crate and idea project from that.

your configuration file looks like this. Is this the correct way to refer beans in an spring config file?

<axis2:configurationContext id="config1" />
    <axis2:transportReceiver name="dummy2" class="org.apache.axis2.spring.cfgctx.DummyTransportListener" configurationContext="config1"/>
    
    <axis2:webServiceAnnotationConfig createClients="true" configurationContext="config1" />

I think this should be something like this,


<axis2:configurationContext id="config1" />
    <axis2:transportReceiver name="dummy2" class="org.apache.axis2.spring.cfgctx.DummyTransportListener" >
       <property name="configurationContext" ref="config1"></property>
    </axis2:transportReceiver>
    
  
    <axis2:webServiceAnnotationConfig createClients="true">
        <property name="configurationContext" ref="config1"></property>
    </axis2:webServiceAnnotationConfig>


> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: axis2-spring-core.zip, POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Commented: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12851383#action_12851383 ] 

Stephan van Hugten commented on AXIS2-4662:
-------------------------------------------

After some tinkering I have come up with this:

ApplicationContext.xml:

  <context:component-scan base-package="com.example">
  	<context:include-filter type="annotation" expression="javax.jws.WebService"/>
  </context:component-scan>
  
  <bean class="com.example.poc.beanprocessor.WebServiceAnnotationBeanPostProcessor" />

BeanPostProcessor:

public class WebServiceAnnotationBeanPostProcessor extends CommonAnnotationBeanPostProcessor implements
		ApplicationContextAware {

	/**
	 * 
	 */
	private static final long serialVersionUID = -4394340453143619407L;
	private AxisServer axisServer;
	private ApplicationContext applicationContext;

	@Override
	public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
		if (bean.getClass().isAnnotationPresent(WebService.class)) {
			if (axisServer == null) {
				Map beans = applicationContext.getBeansOfType(AxisServer.class);
				if (beans.isEmpty()) {
					throw new NoSuchBeanDefinitionException("No Axis2 engine configured in the Spring context!");
				} else {
					// TODO Can there be more than 1?
					axisServer = (AxisServer) beans.values().iterator().next();
				}
			}
			try {
				//FIXME: Use annotation configured servicename
				axisServer.deployService(bean);
			} catch (AxisFault e) {
				throw new BeanCreationException(e.getMessage(), e);
			}
		}
		return bean;
	}

	@Override
	public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
		this.applicationContext = applicationContext;
	}
}

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Attachment:     (was: POC_Axis2.zip)

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Commented: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12851383#action_12851383 ] 

Stephan van Hugten commented on AXIS2-4662:
-------------------------------------------

After some tinkering I have come up with this:

ApplicationContext.xml:

  <context:component-scan base-package="com.example">
  	<context:include-filter type="annotation" expression="javax.jws.WebService"/>
  </context:component-scan>
  
  <bean class="com.example.poc.beanprocessor.WebServiceAnnotationBeanPostProcessor" />

BeanPostProcessor:

public class WebServiceAnnotationBeanPostProcessor extends CommonAnnotationBeanPostProcessor implements
		ApplicationContextAware {

	/**
	 * 
	 */
	private static final long serialVersionUID = -4394340453143619407L;
	private AxisServer axisServer;
	private ApplicationContext applicationContext;

	@Override
	public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
		if (bean.getClass().isAnnotationPresent(WebService.class)) {
			if (axisServer == null) {
				Map beans = applicationContext.getBeansOfType(AxisServer.class);
				if (beans.isEmpty()) {
					throw new NoSuchBeanDefinitionException("No Axis2 engine configured in the Spring context!");
				} else {
					// TODO Can there be more than 1?
					axisServer = (AxisServer) beans.values().iterator().next();
				}
			}
			try {
				//FIXME: Use annotation configured servicename
				axisServer.deployService(bean);
			} catch (AxisFault e) {
				throw new BeanCreationException(e.getMessage(), e);
			}
		}
		return bean;
	}

	@Override
	public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
		this.applicationContext = applicationContext;
	}
}

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan van Hugten updated AXIS2-4662:
--------------------------------------

    Attachment: axis2-spring-core.zip

As a final thing before we start the new subproject I added an optional boolean attribute to my webServiceAnnotationConfig element; createClients. If 'true' the WebServiceAnnotationConfigParser will also create a client bean for the service bean with the name <servicename>Client as detailed in the ServiceClientFactoryBean class. Furthermore I cleaned up my code and documented it.

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: axis2-spring-core.zip, POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Updated: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Veithen updated AXIS2-4662:
-----------------------------------

    Fix Version/s:     (was: 1.5.1)

> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] Issue Comment Edited: (AXIS2-4662) Improve Spring Integration for Axis2

Posted by "Stephan van Hugten (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12850106#action_12850106 ] 

Stephan van Hugten edited comment on AXIS2-4662 at 3/26/10 3:48 PM:
--------------------------------------------------------------------

You have a very valid point which I didn't consider yet. To address this use case I modified the Spring configuration and also the AxisServer class.

The Spring configuration now looks like this:

  <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
  	<constructor-arg value="repository" />
  	<constructor-arg value="config/axis2.xml" />
  	<property name="deployedWebservices">
  		<list>
  			<value>com.example.poc.webservice.WeatherSpringService</value>
  			<ref bean="DependantWeatherService" />
  		</list>
  	</property>
  </bean>
  
  <bean name="DependantWeatherService" class="com.example.poc.webservice.DependantWeatherSpringService">
  	<property name="weatherSpringService" ref="WeatherService" />
  </bean>

  <bean name="WeatherService" class="com.example.poc.webservice.WeatherSpringService" />

You can put a class name literal in the List or refer to a Spring bean like the one configured below the run-time. In the AxisRunner.setDeployedWebservices method it call the regular AxisServer.deployService(..) for class names and a new deployService(bean instance) method for the Spring beans. It looks like this:

public void deployService(Object serviceImplementation) throws AxisFault {
    	String serviceClassName = serviceImplementation.getClass().getName();
    	if (configContext == null) {
            configContext = getConfigurationContext();
        }
        AxisConfiguration axisConfig = configContext.getAxisConfiguration();
        AxisService service = AxisService.createService(serviceClassName, axisConfig);
        axisConfig.addService(service);
        configContext.addContextListener(
        		new SpringContextListener(serviceImplementation));
        if (startOnDeploy) {
            start();
        }
    }

The different between the regular deployService is that it extracts the serviceClassName from the object and that it sets the SERVICE_OBJECT property on the appropriate ServiceContext via a ContextListener (The SpringContextListener class) so that the bean will be used as implementation class.

      was (Author: stephan.vanhugten):
    You have a very valid point which I didn't consider yet. To address this use case I modified the Spring configuration and also the AxisServer class.

The Spring configuration now looks like this:

  <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
  	<constructor-arg value="repository" />
  	<constructor-arg value="config/axis2.xml" />
  	<property name="deployedWebservices">
  		<list>
  			<value>com.example.poc.webservice.WeatherSpringService</value>
  			<ref bean="DependantWeatherService" />
  		</list>
  	</property>
  </bean>
  
  <bean name="DependantWeatherService" class="com.example.poc.webservice.DependantWeatherSpringService">
  	<property name="weatherSpringService" ref="WeatherService" />
  </bean>

  <bean name="WeatherService" class="com.example.poc.webservice.WeatherSpringService" />

You can put a class name literal in the List or refer to a Spring bean like the one configured below the run-time. In the AxisRunner.setDeployedWebservices method it call the regular AxisServer.deployService(..) for class names and a new deployService(bean instance) method for the Spring beans. It looks like this:

public void deployService(Object serviceImplementation) throws AxisFault {
    	String serviceClassName = serviceImplementation.getClass().getName();
    	if (configContext == null) {
            configContext = getConfigurationContext();
        }
        AxisConfiguration axisConfig = configContext.getAxisConfiguration();
        AxisService service = AxisService.createService(serviceClassName, axisConfig);
        axisConfig.addService(service);
        getConfigurationContext().setProperty(ServiceContext.SERVICE_OBJECT, serviceImplementation);
        if (startOnDeploy) {
            start();
        }
    }

The different between the regular deployService is that it extracts the serviceClassName from the object and that it sets the SERVICE_OBJECT property on the context so that the bean will be used as implementation class. If you like you can also implement it like this in the AxisRunner:

if (webservice instanceof String) { //Just classname
    			this.deployService(webservice.toString());
    		} else { //It's a bean
    			this.deployService(webservice.getClass().getName());
getConfigurationContext().setProperty(ServiceContext.SERVICE_OBJECT, webservice);
    		}
  
> Improve Spring Integration for Axis2
> ------------------------------------
>
>                 Key: AXIS2-4662
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4662
>             Project: Axis2
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Stephan van Hugten
>         Attachments: POC_Axis2.zip
>
>
> I wanted to create an application that has tight integration between Axis2 webservices and Spring. There is already a solution presented at the Axis2 website, http://ws.apache.org/axis2/1_5_1/spring.html, but I found that solution very cumbersome in my opinion and doesn't support the JSR 181 annotations.
> With my proposed approach it is possible to fully integrate the Axis2 run-time with a spring container, whether it is stand-alone or in a web server such as Tomcat. This solution also supports both the JSR 181 annotated classes and the regular AAR-files.
> To fully integrate Axis2 with Spring I have overridden the SimpleAxis2Server class used by the standard stand-alone run-time. A full listing of this class is included in my example application.
> The important stuff is in line 21 up to 36. First it determines the absolute path of the repository and config location parameters. Then it passes those to the AxisRunner constructor (lines 10 to 13) and starts the server. After it successfully starts the Axis2 server it returns the bean to the Spring Container.
> After the creation of the bean it will invoke setDeployedWebservices (lines 46 to 51) which will cycle through the passed webservice classes and deploy them at the created run-time. That's it! No additional configuration or packaging is needed. If the Spring container starts up, so does the Axis2 run-time and the webservices get deployed.
> The needed configuration in order to integrate Axis2 is quite simple. Below is a complete listing of my applicationContext.xml (Spring 2.5.6):
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="namespace stuff">
>   
>   <bean name="axisServer" class="com.example.poc.server.AxisRunner" factory-method="create" scope="singleton">
>   	<constructor-arg value="repository" />
>   	<constructor-arg value="config/axis2.xml" />
>   	<property name="deployedWebservices">
>   		<props>
>   			<prop key="WeatherSpringService">
> com.example.poc.webservice.WeatherSpringService
> </prop>
>   		</props>
>   	</property>
>   </bean>
> </beans>
> With a little bit more effort I think it's also possible to integrate this solution with the Spring component scan, making it possible to annotate the webservice classes and the run-time with @component. I have tested my war-project with Tomcat 6 and Sun Webserver 7.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org