LibraryToggle FramesPrintFeedback

To deploy a Fuse Services Framework endpoint to a servlet container you must:

  1. Build a WAR that contains your application and all the required support files.

  2. Deploy the WAR file to your servlet container.

To deploy your application to a servlet container, you must build a WAR file. The WAR file's WEB-INF folder should include the following:

The cxf-servlet.xml file is a Fuse Services Framework configuration file that configures the endpoints that plug into the CXF servlet. When the CXF servlet starts up it reads the jaxws:endpoint elements in this file and initializes a service endpoint for each one.

Example 5.1 shows a simple cxf-servlet.xml file.

Example 5.1. CXF Servlet Configuration File

<?xml version="1.0" encoding="UTF-8"?>
1<beans xmlns="http://www.springframework.org/schema/beans" 
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance
       xmlns:jaxws="http://cxf.apache.org/jaxws"
       xmlns:soap="http://cxf.apache.org/bindings/soap"
       xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://cxf.apache.org/bindings/soap http://cxf.apache.org/schemas/configuration/soap.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
2    <jaxws:endpoint 
        id="hello_world"
        implementor="demo.hw.server.GreeterImpl"
        wsdlLocation="WEB-INF/wsdl/hello_world.wsdl"
        address="/hello_world">
             <jaxws:features>
                  <bean class="org.apache.cxf.feature.LoggingFeature"/>
             </jaxws:features>
    </jaxws:endpoint>
</beans>

The code shown in Example 5.1 is explained as follows:

1

The Spring beans element is required at the beginning of every Fuse Services Framework configuration file. It is the only Spring element that you need to be familiar with.

2

The jaxws:endpoint element defines a service provider endpoint. The jaxws:endpoint element has the following attributes:

  • id — Sets the endpoint id.

  • implementor — Specifies the class implementing the service.

    [Important]Important

    This class needs to be included in the WAR's WEB-INF/classes folder.

  • wsdlLocation — Specifies the WSDL file that contains the service definition.

    [Important]Important

    The WSDL file location is relative to the WAR's WEB-INF/wsdl folder.

  • address — Specifies the address of the endpoint as defined in the service's WSDL file that defines service that is being deployed.

  • jaxws:features — Defines features that can be added to your endpoint.

For more information on configuring a jaxws:endpoint element, see Using the jaxws:endpoint Element.

Comments powered by Disqus
loading table of contents...