2017-10-04 115 views
0

我正在尝试在蜻蜓JEE应用程序内部构建SOAP客户端。我直接使用CXF。我使用的WSDL2Java生成SOAP客户端,并使用客户端是这样的:Wildfy中的Apache CXF Soap客户端

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

后来我试图调用不工作

最后我得到下面的异常的方法:

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 

看起来地址为空。但我不知道为什么?任何人都可以帮助我吗?

+0

你能分享WSDL吗? – Namphibian

回答

0

我找到了解决方案。首先我们在tomcat上实现了这个。 wsdl是通过classpath相对路径“搜索”的,这在tomcat中是允许的,但不是在wildfly中。我通过使用资源打开wsdl的URL来更改它。