The following steps outline, at a high-level, what you must do to successfully configure and deploy a FUSE Services Framework endpoint to the Spring container:
Write a FUSE Services Framework configuration file for your application. See Configuring your application.
Build a WAR file that contains the configuration file, the WSDL file that defines your service, and the code that you generated from that WSDL file, including the implementation file, and any libraries that your application requires. See Building a WAR file.
Deploy the WAR file in one of the following ways:
Copy the WAR file to the Spring container repository. See Deploying the WAR file to the Spring repository.
Use the JMX console. See Managing the Container using the JMX Console.
Use the Web service interface. See Managing the Container using the Web Service Interface.
You must write an XML configuration file for your application. The Spring container requires this file to instantiate, configure, and assemble the beans in your application.
Example 5.1 shows the spring.xml
configuration file used in the Spring container sample application. You can use any name for your
configuration file, however, it must end with a .xml
extension. This example file is taken from the
InstallDir
/samples/spring_container
sample application. Most of the samples in the
InstallDir
/samples
directory contain files namedspring.xml
, which configure
the samples for deployment to the Spring container.
Example 5.1. Configuration File—spring.xml
<?xml version="1.0" encoding="UTF-8"?> <beansxmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws" xsi:schemaLocation=" http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> <jaxws:endpoint id="SoapEndpoint"
implementor="#SOAPServiceImpl" address="http://localhost:9000/SoapContext/SoapPort" wsdlLocation="hello_world.wsdl" endpointName="e:SoapPort" serviceName="s:SOAPService" xmlns:e="http://apache.org/hello_world_soap_http" xmlns:s="http://apache.org/hello_world_soap_http"/> <bean id="SOAPServiceImpl" class="demo.hw.server.GreeterImpl"/>
</beans>
The code shown in Example 5.1 can be explained as follows:
The Spring | ||||
Configures a
For more information on configuring a FUSE Services Framework | ||||
Identifies the class that implements the service. |
To deploy your application to the Spring container you must build a WAR file that has the following structure and contents:
META-INF/spring
should include your configuration
file. The configuration file must have a .xml
extension.
WEB-INF/classes
should include your Web service
implementation class, and any other classes (including the class hierarchy)
generated by the wsdl2java utility. For details,
see wsdl2java in
WEB-INF/wsdl
should include the WSDL file that
defines the service that you are deploying.
WEB-INF/lib
should include any JARs required by your
application.
The simplest way to deploy a FUSE Services Framework endpoint to the Spring container is to:
Start the Spring container by running the following command:
InstallDir
/bin/spring_container start
Copy the WAR file to the Spring container repository.
The default location for the repository is
.InstallDir
/containers/spring_container/repository
The Spring container automatically scans the repository for newly deployed applications. The default value at which it scans the repository is every
5000
milliseconds.
You can use the Apache ant utility to build the FUSE Services Framework sample applications. This includes building the WAR files and deploying
them to the Spring container. If you want to use the ant utility to build your applications, including the WAR file for deployment to the Spring
container, see the example build.xml
file located in the
InstallDir
/samples/spring_container/wsdl_first
directory.
For more information about the ant utility, see http://ant.apache.org/.
You can change the time interval at which the Spring container scans the repository by changing the scanInterval
property in the
spring_container.xml
configuration file. See Example 5.2 for more detail.
You can change the Spring container repository location by changing the value of the containerRepository
property in the
spring_container.xml
configuration file. See Example 5.2 for more detail.