Intégration Web Services et GWT
Bonjour
je ne connais présque rien sur GWT, et je me retrouve a travailler sur un projet GWT-Spring-maven.
mon projet est constitué de deux projet
-1) audit-web : projet contient IHM devloppé en GWT 2.4.0
-2) audit-core: embarque la logique metier (la definition des services se fait via spring)
la communication entre les deux projet se fait via une factory. auditServiceFactory.getBean("nomService")
mon besoin c'est d'exposer un service en "webservice" en utilisant CXF
Je me suis inspiré du l'exemple http://united-coders.com/phillip-ste...apache-cxf-226 , j'arrive à deployer un webService au sein d un projet web sans problème, mais quand j'essaye de l'integrer dans mon vrai projet mon serveur Jetty ne demarre par.
quelqu'un a une idé ou a deja intégrer des CXF et GWT
voici comment j ai procédé
Exception au demarage du serveur Jetty
Code:
1 2 3
|
nested exception is org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://cxf.apache.org/jaxws]
Offending resource: class path resource [ws-definition.xml] |
ws-definition.xml
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
<!-- Spring manage ServiceBean -->
<bean id="personServ" class="com.unitedcoders.demo.PersonServiceImpl" />
<!-- JAX-WS Service Endpoint -->
<jaxws:endpoint id="personService" implementor="#personServ" address="/personService" />
</beans> |
web.xml
Code:
1 2 3 4 5 6 7 8 9 10 11
|
<servlet>
<servlet-name>CXFServlet</servlet-name>
<servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>CXFServlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping> |
les dependences maven dans le projet core (les meme que ceux de l exemple)
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>${cxf.version}</version>
</dependency>
<!-- Spring Dependencies -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring-version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring-version}</version>
</dependency>
<!-- Logging -->
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>${commons-logging-version}</version>
</dependency>
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-java2ws-plugin</artifactId>
<version>${cxf.version}</version>
<dependencies>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-simple</artifactId>
<version>${cxf.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>process-classes</id>
<phase>process-classes</phase>
<configuration>
<className>com.unitedcoders.demo.PersonService</className>
<genWsdl>true</genWsdl>
<verbose>true</verbose>
</configuration>
<goals>
<goal>java2ws</goal>
</goals>
</execution>
</executions>
</plugin> |