问题描述
我正在尝试创建一个基于WSDL的简单Web服务,使用Apache CXF在Wildfly上部署。我尝试使用wsdl文件的标准web.xml,cxf-servlet.xml配置,但是服务器给了我以下错误
I am trying to create a simple WSDL based webservice to be deployed on Wildfly using Apache CXF. I tried the standard web.xml, cxf-servlet.xml configurations with the wsdl file but the server gave me the following error
我正在使用Maven进行构建和部署过程。在进一步阅读时,我意识到Wildfly使用JBossWS堆栈并且不鼓励基于Spring的CXF配置。我也应该使用wsdl2java或wsprovide / wsconsume吗?
任何人都可以请指导我如何设置一个简单的项目来创建WSDL第一个webservice并在Wildfly上部署或指向一个有效的例子。
I am using Maven for my build and deploy process. On reading further I realize that Wildfly uses the JBossWS stack and Spring based CXF configuration is discouraged. Also should I be using wsdl2java or wsprovide/wsconsume ?Could anyone please point guide me on how to setup a simple project to create a WSDL first webservice and deploy on Wildfly or point me to a working example.
感谢帮助,谢谢。
推荐答案
添加所有提供范围的依赖项,因为wildfly有自己的cxf jar。 wildfly不需要cxf jar来执行ws。只有你需要cxf jar才能让IDE编译项目。
Add all the dependancies with provided scope, as wildfly has its own cxf jars. wildfly does not required cxf jars to execute the ws. only you required cxf jars for IDE to compile the project.
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>${cxf.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>${cxf.version}</version>
<scope>provided</scope>
</dependency>
<!-- Jetty is needed if you're are not using the CXFServlet -->
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http-jetty</artifactId>
<version>${cxf.version}</version>
<scope>provided</scope>
</dependency>
你可以找到答案
这篇关于Wildfly上基于WSDL的Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!