Hi again,
i already found out, that there seems to be a spring integration for Jax-WS:
https://jax-ws-commons.dev.java.net/spring/
but i still can't get this running...
here is my situation:
i have several spring bean definition xml config files in my classpath
(/src/main/resources/spring/...) and also one where all my beans are
imported and aggregated into one bean definition file (called
"spring.AllInOne_WS.xml").
my webservice implementing class is also defined as a spring bean, and gets
all necessary members set via the spring context wiring.
(As mentioned below, when using the
"org.springframework.web.context.ContextLoaderListener" my spring context is
created correctly, and all beans are set.)
i found this example:
https://jax-ws-commons.dev.java.net/source/browse/jax-ws-commons/trunk/sprin
g/
and found out that there seems to be a way to bind a service to a bean, but
since i don't won't to copy all my bean definitions
into the "applicationContext.xml", i would like to tell JAX-WS to load all
necessary beans from the spring context.
----------------
some other questions are:
- do i need to use
<servlet-class>com.sun.xml.ws.transport.http.servlet.WSSpringServlet</servle
t-class>
instead of
<servlet-class>com.sun.xml.ws.transport.http.servlet.WSServlet</servlet-clas
s-->
- which one is the correct xsd schema?
i found this in the mentioned example:
<beans xmlns="
http://www.springframework.org/schema/beans"
xmlns:ws="
http://jax-ws.dev.java.net/spring/core"
xmlns:wss="
http://jax-ws.dev.java.net/spring/servlet"
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.0.xsd
http://jax-ws.dev.java.net/spring/core
http://jax-ws.dev.java.net/spring/core.xsd
http://jax-ws.dev.java.net/spring/servlet
http://jax-ws.dev.java.net/spring/servlet.xsd" >
but my eclipse always complains that there are errors in the "core.xsd" and
"servlet.xsd"?
- when do i need to add the following <dependency> to my pom.xml?
<dependency>
<groupId>org.jvnet.jax-ws-commons.spring</groupId>
<artifactId>jaxws-spring</artifactId>
<version>${version}</version>
</dependency>
- what does this @SOAPBinding(style=Style.RPC, use=Use.LITERAL) i found
in the example?
maybe there is someone who uses JAX-WS with spring beans and would post the
web.xml, applicationContext.xml, sun-jaxws.xml?
thx
R.C.
-----Ursprüngliche Nachricht-----
Von: Roman Cerny [mailto:roman.cerny_at_researchstudio.at]
Gesendet: Freitag, 30. November 2007 13:59
An: 'users_at_jax-ws-commons.dev.java.net'
Betreff: JAX-WS + Spring Integration: retreive WS implementation from spring
context??
Hi,
i currently try to get my spring application, running as a webservice.
i use the following config in my 'web.xml' to create the spring context (and
instantiate several spring beans):
<!-- spring context generation -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:spring/webservice/spring.AllInOne_WS.xml
</param-value>
</context-param>
<context-param>
<param-name>contextClass</param-name>
<param-value>
org.springframework.web.context.support.XmlWebApplicationContext
</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<!-- web services -->
<description>Web Services</description>
<display-name>Web Services</display-name>
<listener>
<listener-class>
com.sun.xml.ws.transport.http.servlet.WSServletContextListener
</listener-class>
</listener>
<servlet>
<description>My Web Service</description>
<display-name>My Web Service</display-name>
<servlet-name>MyWS</servlet-name>
<servlet-class>
com.sun.xml.ws.transport.http.servlet.WSServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>MyWS</servlet-name>
<url-pattern>/ws</url-pattern>
</servlet-mapping>
additionally i have defined my endpoint in the 'sun-jaxws.xml':
<endpoint
name="MyWS"
implementation="mypackage.MyWSImpl"
url-pattern="/ws" />
on startup the spring context is created correctly, but afterwards the WS is
instantiated again (due to the endpoint definition), and all my
members/beans (that are usually set by the spring framework) are null, which
leads to NullPointerExceptions in my methods.
i wonder how to tell the WSServletContextListener to use the spring defined
WS bean as implementation for the endpoint, instead of re-instantiating it.
thx 4 any advise
R.C.