Invocation d'un web service depuis une portlet
Bonjour,
J'utilise Liferay, j'ai développé un petit web service (celui-ci fait une addition). Je génère le code a parti du wsdl gràce à cxf. Quand j'utilise le client lourd Java, mon web service fonctionne très bien. Quand je veux l'invoquer à partir d'une portlet, j'ai cette erreur :
Code:
1 2 3 4 5 6 7 8
|
17:03:32,976 ERROR [Jsr168Dispatcher:27] Could not execute action
javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
at org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:150)
at org.apache.cxf.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:65)
at javax.xml.ws.Service.<init>(Service.java:56)
at org.example.service.Service_Service.<init>(Service_Service.java:47)
at test.tuto.MavenStruts2Portlet.execute(MavenStruts2Portlet.java:31) |
et un peu plus bas :
Code:
1 2 3 4 5 6 7 8 9 10 11
|
Caused by: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:93)
at org.apache.cxf.jaxws.ServiceImpl.initializePorts(ServiceImpl.java:205)
at org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:148)
... 164 more
Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: java.lang.IllegalArgumentException: InputSource must have a ByteStream or CharacterStream
at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:226)
at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:179)
at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:91)
... 166 more |
Voici le code de ma portlet :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
public MavenStruts2Portlet() {
URL wsdlURL = Service_Service.WSDL_LOCATION;
Service_Service ss = new Service_Service(wsdlURL, SERVICE_NAME);
this.port = ss.getAddService();
}
public String execute() throws Exception {
System.out.println("Invoking add...");
org.example.service.AddType _add_parameters = new AddType();
_add_parameters.setP1(number1);
_add_parameters.setP2(number2);
this.result = port.add(_add_parameters);
return ActionSupport.SUCCESS;
} |
Faut-il configurer quelque chose? Ai-je louper un truc (surement)?
Merci pour vos renseignements.