5 Replies Latest reply on Apr 4, 2014 1:56 AM by japearson

    JBossWS-CXF and EAP 6.1.0

    bapats

      We are exploring the migration from using plain CXF on JBoss 7.1 (as cxf servlets) to using the built in JBossWS-CXF on JBoss EAP 6.1.0.

       

      A few questions:

       

      1. Our existing plain CXF web services currently use the cxf-servlet.xml. In order to migrate to JBossWS-CXF, based on the JBossWS-CXF documentation, we would have to use jbossws-cxf.xml, and configure the web.xml. The official JBoss EAP 6.1 documentation (link below) does not make any mention of JBossWS-CXF/CXF/jbossws-cxf.xml , or say that this is supported. Is configuring the WS completely using jbossws-cxf.xml (equivalent of cxf-servlet.xml) fully supported under EAP? We wanted to stay close to the CXF way of configuration.
        https://access.redhat.com/site/documentation/en-US/JBoss_Enterprise_Application_Platform/6.1/html-single/Development_Guide/index.html#About_JAX-WS_Web_Services
      2. Is JBossWS-CXF installed in the default EAP 6.1.0, or does it need to be installed? In addition to the org.springframework.spring module, do I need to install or configure anything else in the server? The modules seems to indicate that it is there, but once I deployed a web service, I could access the wsdl, and the ws works, but http://localhost:8080/jbossws returns a 404.  Here's the deployment log.

        09:56:44,865 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015876: Starting deployment of "hello-

      world.war" (runtime-name: "hello-world.war")

      09:56:45,400 INFO  [org.jboss.ws.cxf.metadata] (MSC service thread 1-1) JBWS024061: Adding service endpoint metadata: id=HelloWorl

      dService

      address=http://localhost:8080/hello-world/HelloWorldService

      implementor=com.test.demo.ws.HelloWorldService

      serviceName={http://test.com/services/demo/HelloWorldService}HelloWorldService

      portName={http://test.com/services/demo/HelloWorldService}HelloWorldServicePort

      annotationWsdlLocation=null

      wsdlLocationOverride=null

      mtomEnabled=false

      09:56:45,808 INFO  [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (MSC service thread 1-1) Creating Service {http:/

      /test.com/services/demo/HelloWorldService}HelloWorldService from class com.test.demo.ws.HelloWorldServiceI

      09:56:46,380 INFO  [org.apache.cxf.endpoint.ServerImpl] (MSC service thread 1-1) Setting the server's publish address to be http:/

      /localhost:8080/hello-world/HelloWorldService

      09:56:46,554 INFO  [org.jboss.ws.cxf.deployment] (MSC service thread 1-1) JBWS024074: WSDL published to: file:/C:/jboss-eap-6.1/standalone/data/wsdl/hello-world.war/HelloWorldService.wsdl

      09:56:46,557 INFO  [org.jboss.as.webservices] (MSC service thread 1-6) JBAS015539: Starting service jboss.ws.port-component-link

      09:56:46,579 INFO  [org.jboss.as.webservices] (MSC service thread 1-3) JBAS015539: Starting service jboss.ws.endpoint."

      hello-world.war".HelloWorldService

      09:56:46,592 INFO  [org.jboss.ws.common.management] (MSC service thread 1-3) JBWS022050: Endpoint registered: jboss.ws:context=hello-world,endpoint=HelloWorldService

      09:56:46,669 INFO  [org.jboss.web] (ServerService Thread Pool -- 55) JBAS018210: Register web context: /hello-world

       

       

      Thanks

        • 1. Re: JBossWS-CXF and EAP 6.1.0
          asoldano

          Hi,

          jbossws-cxf.xml usage is supported, but not the suggested / preferred approach. Yes, you need to add the org.springframework.spring module.

          JBossWS-CXF is installed by default on EAP 6.1.0.GA, the "/jbossws" context is simply not available anymore in EAP 6 series.

          • 2. Re: JBossWS-CXF and EAP 6.1.0
            bapats

            Thanks for the response. A few followup questions.

             

            Is WS-Security policy documented in https://docs.jboss.org/author/display/JBWS/WS-Security also supported in EAP?

             

            Are all the WS-Security wss4j configurations (jaxws properties in cxf) supported int he @EndpointConfig without using the cxf configuration file?
            For example is ws-security.ut.validator (for username token validation), ws-security.saml2.validator (for saml validation), etc supported in addition to the ws-security.* mentioned in the above link ?

            • 3. Re: JBossWS-CXF and EAP 6.1.0
              asoldano

              S Bapat wrote:

               

              Thanks for the response. A few followup questions.

               

              Is WS-Security policy documented in https://docs.jboss.org/author/display/JBWS/WS-Security also supported in EAP?

              Yes, the AS 7.1 version of the doc is possibly closer to the EAP 6.1 stuff, https://docs.jboss.org/author/display/AS71/WS-Security

               

              Are all the WS-Security wss4j configurations (jaxws properties in cxf) supported int he @EndpointConfig without using the cxf configuration file?

              For example is ws-security.ut.validator (for username token validation), ws-security.saml2.validator (for saml validation), etc supported in addition to the ws-security.* mentioned in the above link ?

              They should, even if I have not tried those 2 explicitly.

              • 4. Re: JBossWS-CXF and EAP 6.1.0
                bapats

                Great. Thanks. I will give it a try and let you know. As I am going through further migration research, there are a few more questions. Any ideas?

                 

                Schemas

                Our services are bottom up (not wsdl-first). We define the web service datatypes in a schema, which then gets imported into the auto generated wsdl. The way we do that in plain CXF is using the jaxws:schemaLocation as follows.
                Is there a JBossWS-CXF way to achieve the same result?

                 

                <jaxws:endpoint ...>

                 

                      <jaxws:schemaLocations>

                          <jaxws:schemaLocation>classpath:xsd/dataTypes.xsd</jaxws:schemaLocation>

                      </jaxws:schemaLocations>                 

                 

                   </jaxws:endpoint>

                 

                Security Policy file

                The web services security policy is defined in a separate policy file, and brought in using the CXF annotations as shown below.
                What is the JBoss-CXF equivalent?

                 

                import org.apache.cxf.annotations.Policies;

                import org.apache.cxf.annotations.Policy;

                @Policies({

                   @Policy(uri="META-INF/wspolicy.xml")

                })

                 

                wspolicy.xml:

                <?xml version="1.0" encoding="UTF-8"?>

                <wsp:Policy xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702"

                            xmlns:wsp="http://www.w3.org/ns/ws-policy"

                            xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"

                            xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata"

                            wsu:Id="wspolicy">

                 

                ….

                </wsp:Policy>

                 

                WSDL Documentation

                We use the @WSDLDocumentation annotation for generating the documentation for web services. Is there a JBossWS-CXF equivalent?

                import org.apache.cxf.annotations.WSDLDocumentation;

                @WSDLDocumentation("….")

                 

                Thanks.

                • 5. Re: Re: JBossWS-CXF and EAP 6.1.0
                  japearson

                  Hi,

                   

                  I realise this is an old post, but I figured I'd post some of my findings here.

                  What is the JBoss-CXF equivalent?

                   

                  import org.apache.cxf.annotations.Policies;

                  import org.apache.cxf.annotations.Policy;

                  @Policies({

                     @Policy(uri="META-INF/wspolicy.xml")

                  })

                  Yes you can use those annotations with JBoss EAP 6.1, but I found there is a catch, you need to add a dependency to the org.apache.cxf JBoss module otherwise the org.apache.cxf.ws.policy.PolicyAnnotationListener that actually processes the annotations can't actually find the annotations.  That's what I've found through a debugger at least.

                   

                  As to your Schemas or WSDL Documentation questions, I haven't needed to do it, so not sure of the answer there.

                   

                  Cheers,

                   

                  Joel