3.2.4. Web Services Changes Web Services Changes

JBoss EAP 6 includes support for deploying JAX-WS Web Service endpoints. This support is provided by JBossWS. For more information about Web Services, refer to the chapter entitled JAX-WS Web Services in the Development Guide for JBoss EAP 6 on https://access.redhat.com/site/documentation/JBoss_Enterprise_Application_Platform/.
JBossWS 4 includes the following changes that may impact your migration.
JBossWS API Changes
SPI and Common components were refactored in JBossWS 4. The following table lists API and packaging changes may affect your application migration.

Table 3.7. JBossWS API Changes

Old JAR Old Package New JAR New Package
JBossWS SPI org.jboss.wsf.spi.annotation.* JBossWS API org.jboss.ws.api.annotation.*
JBossWS SPI org.jboss.wsf.spi.binding.* JBossWS API org.jboss.ws.api.binding.*
JBossWS SPI org.jboss.wsf.spi.management.recording.* JBossWS API org.jboss.ws.api.monitoring.*
JBossWS SPI org.jboss.wsf.spi.tools.* JBossWS API org.jboss.ws.api.tools.*
JBossWS SPI org.jboss.wsf.spi.tools.ant.* JBossWS API org.jboss.ws.tools.ant.*
JBossWS SPI org.jboss.wsf.spi.tools.cmd.* JBossWS API org.jboss.ws.tools.cmd.*
JBossWS SPI org.jboss.wsf.spi.util.ServiceLoader JBossWS API org.jboss.ws.api.util.ServiceLoader
JBossWS Common org.jboss.wsf.common.* JBossWS API org.jboss.ws.common.*
JBossWS Common org.jboss.wsf.common.handler.* JBossWS API org.jboss.ws.api.handler.*
JBossWS Common org.jboss.wsf.common.addressing.* JBossWS API org.jboss.ws.api.addressing.*
JBossWS Common org.jboss.wsf.common.DOMUtils JBossWS API org.jboss.ws.api.util.DOMUtils
JBossWS Native org.jboss.ws.annotation.EndpointConfig JBossWS API org.jboss.ws.api.annotation.EndpointConfig
@WebContext Annotation
In JBossWS 3.4.x, this annotation was packaged as org.jboss.wsf.spi.annotation.WebContext in the JBossWS SPI JAR. In JBossWS 4.0, this annotation was moved to org.jboss.ws.api.annotation.WebContext in the JBossWS API JAR. If your application includes the obsolete dependency, you must replace the imports and dependencies in your application source code and compile it against the new JBossWS API JAR.
There is also a change to an attribute that is not backward compatible. The String[] virtualHosts attribute has been changed to String virtualHost. In JBoss EAP 6, you can specify only one virtual host per deployment. If multiple webservices use the @WebContext annotation, the virtualHost value must be identical for all endpoints defined in the deployment archive.
Endpoint Configuration
JBossWS 4.0 provides integration of the JBoss Web Services stack with most of the Apache CXF modules. The integration layer allows the use of standard webservices APIs, including JAX-WS. It also allows the use of Apache CFX advanced features on top of the JBoss EAP 6 container without requiring complex configuration or setup.
The webservice subsystem in the domain configuration of JBoss EAP 6 includes predefined endpoint configurations. You can also define your own additional endpoint configurations. The @org.jboss.ws.api.annotation.EndpointConfig annotation is used to reference a given endpoint configuration.
For more information on how to configure webservice endpoints in the JBoss server, refer to the chapter entitled JAX-WS Web Services in the Development Guide for JBoss EAP 6 on https://access.redhat.com/site/documentation/JBoss_Enterprise_Application_Platform/.
jboss-webservices.xml Deployment Descriptor
JBossWS 4.0 introduces a new deployment descriptor to configure web services. The jboss-webservices.xml file provides additional information for the given deployment and partially replaces the obsolete jboss.xml file.
For EJB webservice deployments, the expected location of the jboss-webservices.xml descriptor file is in the META-INF/ directory. For POJO and EJB webservice endpoints bundled in WAR file, the expected location of the jboss-webservices.xml file is in the WEB-INF/ directory.
The following is an example of a jboss-webservices.xml descriptor file and a table describing the elements.
    <config-name>Standard WSSecurity Endpoint</config-name>

Table 3.8. jboss-webservice.xml File Element Description

Element Name Description
Used to customize the context root of the webservices deployment.
Used to associate an endpoint deployment with a given endpoint configuration. Endpoint configurations are specified in the referenced configuration file or in the webservices subsystem of the domain configuration.
Used to set up simple property name value pairs to configure the webservice stack behavior.
Used to customize the EJB endpoint target URI or to configure security related properties.
Used to customize or override the webservice WSDL published location.