1 pièce(s) jointe(s)
Pas moyen de faire tourner ce WebService
Bonjour,
j'essaie de faire tourner un webservice tout simple via CXFServlet. Mais je tourne en rond, il doit me manquer une notion que je capte pas.
Voici le code et l'interface:
Code:
1 2 3 4 5 6 7 8 9 10
| @WebService(endpointInterface = "company.webservice.PublicationService")
public class PublicationServiceImpl implements PublicationService {
@Override
public Scpub[] listPublications() {
// TODO Auto-generated method stub
return null; //il fait vraiment rien
}
} |
Code:
1 2 3 4 5
| @WebService
public interface PublicationService {
public Scpub[] listPublications();
} |
Coté web.xml
Code:
1 2 3 4 5 6 7 8 9 10
|
<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>*.service</url-pattern>
</servlet-mapping> |
Le tout démarré avec spring
Code:
1 2 3 4
| <bean id="publicationServiceImpl" class="company.webservice.PublicationServiceImpl" />
<!-- JAX-WS Service Endpoint -->
<jaxws:endpoint id="publicationService" implementor="#publicationServiceImpl" address="/publication.service"/> |
Avec cette config, l'application démarre. Cependant, alors qu'on devrais me service le wsdl quand j'accède à l'url
j'obtiens la page suivante au lieu de wsdl :?
http://www.developpez.net/forums/att...1&d=1316535709
Si je clique sur le lien wsdl, il m'envoie vers publication.service/publication.service, mais continue de m'afficher la même page 8O Et ça continue ad nauseam.
Si je génère explicitement le wsdl (avec eclipse) et que je le référence dans le fichier de configuration spring
Code:
1 2 3 4 5 6
| <bean id="publicationServiceImpl" class="company.webservice.PublicationServiceImpl" />
<!-- JAX-WS Service Endpoint -->
<jaxws:endpoint id="publicationService" implementor="#publicationServiceImpl" address="/publication.service"
wsdlLocation="file:/home/delbd/dev/workspace-intranetv2/company.datas.parent/webapp/webapp/wsdl/PublicationServiceImpl.wsdl"
/> |
L'application ne démarre alors plus
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
| Caused by: javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException: Could not
find definition for service {http://webservice.company/}PublicationServiceImplService.
at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:275)
at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:209)
at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:404)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAut
owireCapableBeanFactory.java:1527)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowire
CapableBeanFactory.java:1468)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCap
ableBeanFactory.java:1400)
... 76 more
Caused by: org.apache.cxf.service.factory.ServiceConstructionException: Could not find definition for service {http
://webservice.intranet.rmi.be/}PublicationServiceImplService.
at org.apache.cxf.wsdl11.WSDLServiceFactory.create(WSDLServiceFactory.java:126)
at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.j
ava:415)
at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean
.java:528)
at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:278)
at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:178)
at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:1
00)
at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:105)
at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:167)
at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:346)
at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:259)
... 85 more |
Si quelqu'un pouvait m'expliquer ce que je rate, je suis les exemples simple en ligne, mais je tombe toujours là. Et tant que ça ne génèrera pas de wsdl, impossible de continuer :calim2:
Merci d'avance