Wildfly上基于WSDL的Web服务 [英] WSDL based webservices on Wildfly

查看:639
本文介绍了Wildfly上基于WSDL的Web服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个基于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


Apache CXF在ws端点部署中检测到库(cxf-api-2.7.3.jar);要么提供适当的部署,要么使用容器模块依赖项替换嵌入式库,要么为当前部署禁用webservices子系统,添加适当的jboss-deployment-structure.xml

Apache CXF library (cxf-api-2.7.3.jar) detected in ws endpoint deployment; either provide a proper deployment replacing embedded libraries with container module dependencies or disable the webservices subsystem for the current deployment adding a proper jboss-deployment-structure.xml

我正在使用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服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆