WSDL based webservices on Wildfly

Nova Guy picture Nova Guy · Oct 2, 2014 · Viewed 8k times · Source

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 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

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.

Appreciate the help, thanks.

Answer

Alessio Soldano picture Alessio Soldano · Feb 23, 2015

The reason for the message above is exactly that the webservices subsystem of WildFly spotted Apache CXF libraries in the deployment. That's not how a JavaEE application making use of webservices is expected to be provided and deployed on a JavaEE container like WildFly, basically because the container is responsible for supplying the WS engine functionalities. In particular, when it comes to WildFly, Apache CXF is internally used hence by adding some cxf libs in his deployment, the user can possibly end up into complex classloading issues that he might not be able to easily solve. Anyway, the message says what has to be done: (JBoss) modules dependencies has to be defined in the deployment. That can be easily done in the deployment MANIFEST.MF; some doc on this at https://docs.jboss.org/author/display/JBWS/JBoss+Modules (but you can google for JBoss Modules and find many info).

Generally speaking, I really suggest to read the doc at https://docs.jboss.org/author/display/JBWS/Apache+CXF+integration#ApacheCXFintegration-BuildingWSapplicationstheJBossway which explains the JBossWS integration with Apache CXF a bit more in details and gives direction on proper packaging apps.