5 Replies Latest reply on Oct 30, 2009 3:14 PM by Keith Barlow

    cxfse vs jaxws

    Keith Barlow Newbie

      Hiyas,

       

      I am a little confused on the configuration of the cxfse component for JAX-WS web services.  It appears as though <cxfse:endpoint /> element is the one defaulted recognizes all the jaxws annotations and defers to the annotations for configuration information.  It also seems to be the correct component to use (servicemix-cxf-se-service-unit) for implementing JAX-WS web services (there are no servicemix-jaxws- components).

       

      However, this component's configuration is not well documented in the Service Mix 4.1 documentation.  Instead, all references to configuration of JAX-WS services in "Developing and Deploying JAX-WS Services" seems to be detailed through the <jaxws:endpoint /> element.

       

      Is the <cxfse:endpoint /> element the new preferred method of web service configuration in 4.1?

       

      Thanks.

       

      Keith

        • 1. Re: cxfse vs jaxws
          Martin Murphy Novice

          Hi Keith,

           

          I think the confusion here is around the separation of CXF components in Servicemix and the configuration of these components and the CXF bus used by these. There are two CXF components in Servicemix mapping to a Service Engine (SE) Component (deals with interface implementation) and a Binding Component (BC) (deals with transports and protocols).

           

          The CXF-SE component is configured using the <cxfse:endpoint> config. Note this deals only with the implementation of the interface and not with the transport, so you would not configure a <jaxws:endpoint> at this point. The CXF-SE should receive all its messages via the NMR.

           

          The CXF-BC component is configured using either <cxfbc:consumer> or <cxfbc:provider> configuration depending on if it is receiving messages from or sending message to the NMR. This component communicates outside the NMR and deals with protocols and transports. Hence these enspoints both can have a busCfg set. This is where you can configure the CXF bus used by the endpoints. The configuration of the CXF bus allows a <jaxws:endpoint> to be configured, this is CXF specific configuration that is seperate to, but used by, the ServiceMix CXF components.

           

          I hope that helps,

          - Martin

          • 2. Re: cxfse vs jaxws
            Keith Barlow Newbie

            Martin,

             

            If I understand you correctly, it sounds like what you are saying is that the <jaxws:endpoint > can be given to a CXF-BC component to effectively achieve the same setup as the CXF-SE component:  a full JAX-WS service hosting within the CXF component.  While the CXF-BC components are intended to communicate with external services, they can be given a <jaxws:endpoint > to reference internal services.  However, the CXF-SE is the preferred (easier) way of achieving such a configuration.

             

            If that is correct then I that helps... : )

             

            Thanks.

             

            Keith

            • 3. Re: cxfse vs jaxws
              Martin Murphy Novice

              I doubt very much that you could pass a <jaxws:endpoint> to a cxf-bc and achieve the same as the cxf-se. I would imagine you would see some classloading issues. The cxf-bc should not do any of the implementation, instead it should read the message in and place it on the NMR to be consumed by another service, or receive a message from the NMR and send it to some external service. If you want to have your transport and implementation all in the same package and not use the NMR you might as well just deploy a standalone CXF service, but then you lose the lifecycle management, deployment etc from ServiceMix.

               

              Really you don't need to worry about the <jaxws:endpoint> at all. Have a look at the cxf-wsdl-first example in ServiceMix, the cxf-bc simply sends the message on to the cxf-se where the interface is implemented.

              • 4. Re: cxfse vs jaxws
                Keith Barlow Newbie

                martin,

                 

                I checked out the cxf-wsdl-first project but after importing into eclipse, I seem to be missing a few dependencies.  Anything from the org.apache.servicemix.samples.wsdl_first.types package is showing an error:

                 

                import org.apache.servicemix.samples.wsdl_first.types.GetPerson;

                import org.apache.servicemix.samples.wsdl_first.types.GetPersonResponse;

                 

                Do you know where I can find this package?

                 

                Thanks.

                 

                Keith

                • 5. Re: cxfse vs jaxws
                  Keith Barlow Newbie

                  Nevermind... I found them... they are generated from the wsdl.

                   

                  Thanks.

                   

                  Keith