2017-10-04 12 views
0

J'essaie de créer un client SOAP dans une application JEE wildfly. J'utilise CXF directement. Je produis le client SOAP en utilisant wsdl2java et utiliser le client ainsi:Apache CXF Soap Client dans Wildlfy

ServicePortTypeV1 servicePortV1 = new ServiceV1().getServicePortV1(); 

Ensuite, je suis en train d'appeler une méthode qui ne fonctionne pas

En fin de compte, je reçois l'exception suivante:

Caused by: java.lang.NullPointerException 
     at org.apache.cxf.transport.http.URLConnectionHTTPConduit.createConnection(URLConnectionHTTPConduit.java:104) 
     at org.apache.cxf.transport.http.URLConnectionHTTPConduit.setupConnection(URLConnectionHTTPConduit.java:117) 
     at org.apache.cxf.transport.http.HTTPConduit.prepare(HTTPConduit.java:497) 
     at org.apache.cxf.interceptor.MessageSenderInterceptor.handleMessage(MessageSenderInterceptor.java:46) 
     at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308) 
     at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:514) 
     at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:423) 
     at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:324) 
     at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:277) 
     at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96) 
     at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:13 

Il semble que l'adresse est nulle. Mais je ne peux pas dire pourquoi? Quelqu'un peut-il m'aider s'il-vous-plaît?

+0

Pourriez-vous partager le fichier WSDL? – Namphibian

Répondre

0

J'ai trouvé la solution. Nous avons d'abord implémenté ceci sur un tomcat. Le wsdl a été "recherché" par le chemin relatif du classpath, qui est autorisé dans tomcat mais pas dans wildfly. Je l'ai changé en utilisant la ressource pour ouvrir l'URL pour le wsdl.