Fuse 6 is no longer supported
As of February 2025, Red Hat Fuse 6 is no longer supported. If you are using Fuse 6, please upgrade to Red Hat build of Apache Camel.Deploying into a Web Server
Deploying Apache CXF and Apache Camel applications into a JBoss Web Server or a JBoss Enterprise Application Platform container
Copyright © 2011-2015 Red Hat, Inc. and/or its affiliates.
Abstract
Chapter 1. Overview of JBoss Fuse Deployment
Abstract
1.1. Supported Web Server Platforms
Overview
- JBoss Web Server (JBoss WS)
- JBoss Enterprise Application Platform (JBoss EAP)
Supported product versions
1.2. Camel on EAP Subsystem
Overview
1.3. WAR Build and Deployment Model
How to install Fuse libraries
Build model
Figure 1.1. Building the WAR with Maven
Maven POM file
pom.xml
, which is typically used to configure the following aspects of the build:
- The packaging type to be
war
(which instructs Maven to build a WAR file). - Dependent JAR files, which will be bundled with the WAR (including the requisite JBoss Fuse libraries).
- The name of the WAR file.
Build process
Deployment
Chapter 2. Apache Camel on Red Hat JBoss EAP
Abstract
2.1. Overview of Camel on EAP Subsystem
- Less bloated war deployments
- Patch the application server instead of individual deployments
- No need to ship camel dependencies with applications
- Use supported versions of component libraries
2.2. Getting Started with Camel on EAP Subsystem
2.2.1. Running Camel on EAP Subsystem
- Standalone Server: Run the following command in your JBoss EAP home directory.
$ bin/standalone.sh -c standalone-camel.xml
- Domain Mode: Run the following command in your JBoss EAP home directory.
$ bin/domain.sh -c domain-camel.xml
2.2.2. Enabling Camel on EAP Subsystem
$ bin/fuseconfig.sh --configs=camel --enable
2.2.3. Disabling the Camel Subsystem
enabled
to false. For example, In jboss-all.xml
file, set the attribute enabled
to false in jboss-camel
XML element
<jboss umlns="urn:jboss:1.0"> <jboss-camel xmlns="urn:jboss:jboss-camel:1.0" enabled="false"/> </jboss>
2.3. Working with Camel on EAP Subsystem
2.3.1. Using a Camel Context
CamelContext
represents a single Camel routing rulebase. It contains all the routes of your application. You can have as many CamelContexts as necessary, provided they have different names.
- define a
CamelContext
as a part of the subsystem definition in thestandalone.xml
anddomain.xml
files - deploy them in a supported deployment artifact that includes the
-camel-context.xml
suffixed file - provide CamelContexts along with their routes via a RouteBuilder and the CDI integration
CamelContext
as a part of the subsystem definition this way:
<route> <from uri="direct:start"/> <transform> <simple>Hello #{body}</simple> </transform> </route>Also, you can consume a defined CamelContext two ways:
- @injected via Camel-CDI
- via JNDI tree
2.3.1.1. Example of a Context and a Route
@ContextName
annotation provides a specific name to the CamelContext.
@ApplicationScoped @Startup @ContextName("cdi-context") public class HelloRouteBuilder extends RouteBuilder { @Inject HelloBean helloBean; @Override public void configure() throws Exception { from("direct:start").transform(body().prepend(helloBean.sayHello()).append(" user.")); } }
2.3.1.2. Configuring Camel Context using CDI Mechanism
CamelContext
bean. After you initialise the CDI container, a CamelContext bean starts and instantiates automatically.
CamelContext
bean into the application as:
@Inject @ContextName(cdi-context) private CamelContext context;
2.3.1.3. Configuring Camel Routes using CDI Mechanism
class MyRouteBean extends RouteBuilder { @Override public void configure() { from("jms:invoices").to("file:/invoices"); } }
2.3.1.4. Customizing Camel Context
@ContextName
qualifier that allows you to change the name of the default CamelContext bean. For example,
@ApplicationScoped class CustomCamelContext extends DefaultCamelContext { @PostConstruct void customize() { // Set the Camel context name setName("custom"); // Disable JMX disableJMX(); } @PreDestroy void cleanUp() { // ... } }
CamelContext
class to declare a custom camel context bean.
2.3.1.5. Supporting Multiple CamelContexts
@Inject @ContextName("foo") @Uri("direct:inbound") ProducerTemplate producerTemplate; @Inject @BarContextQualifier MockEndpoint outbound; // URI defaults to the member name, i.e. mock:outbound @Inject @ContextName("baz") @Uri("direct:inbound") Endpoint endpoint;
2.3.2. Camel Context Deployment
- Use the
-camel-context.xml
suffix as a part of another supported deployment, such as a JAR, WAR, or EAR deploymentThis deployment may contain multiple-camel-context.xml
files. - Use the
-camel-context.xml
suffix in a standaloneXML
file deployment by dropping the file into the EAP deployment directory
@Resource(name = "java:jboss/camel/context/mycontext") CamelContext camelContext;
2.3.3. Hawtio Web Console
- deploy HawtIO as a WAR file
- add some users to your management and application realms by using the following command: $ bin/add-user.sh
- navigate to the
http://localhost:8080/hawtio
, the HawtIO login page appears - Clickin the top navigation bar to view all the running Camel Contexts
- list of all the running camel applications
- detail information of each Camel Context such as Camel version number, runtime statics
- list of all the routes and their runtime statistics in each camel application
- manage the lifecycle of all camel applications and their routes
- graphical representation of the running routes along with real time metrics
- live tracing and debugging of running routes
- profile the running routes with real time runtime statics
- browse and send messages to camel endpoint
2.3.4. Selecting Components
<jboss umlns="urn:jboss:1.0"> <jboss-camel xmlns="urn:jboss:jboss-camel:1.0"> <component name="camel-ftp"/> <component-module name="org.apache.camel.component.rss"/> </jboss-camel> </jboss>
2.3.5. Configuring Camel Subsystem
<route> <from uri="direct:start"/> <transform> <simple>Hello #{body}</simple> </transform> </route>
2.3.6. Configuring Camel Deployment
WEB-INF/jboss-all.xml
or META-INF/jboss-all.xml
configuration file.
jboss-all.xml
file, to control the camel configuration.
2.4. Integration with JMS
camel-jms
component provides messaging support. It integrates with the EAP Messaging (HornetQ) subsystem. Integration with other JMS implementations is possible by using the JBoss generic JMS Resource Adapter.
2.4.1. Configuring EAP JMS
jms-destinations
section.
<jms-queue name="WildFlyCamelQueue"> <entry name="java:/jms/queue/WildFlyCamelQueue"/> </jms-queue>
jms-queue add --queue-address=WildFlyCamelQueue --entries=queue/WildFlyCamelQueue,java:/jms/queue/WildFlyCamelQueue
2.4.2. Configuring Camel Route
camel-cdi
component. You can inject the JMS ConnectionFactory instances into the Camel RouteBuilder via JNDI lookups.
2.4.2.1. JMS Producer
RouteBuilder
by injecting the DefaultJMSConnectionFactory
connection factory from JNDI. However, the connection factory is defined within the messaging subsystem. Also, a timer endpoint runs after every 10 seconds to share an XML payload to the EAPCamelQueue
destination.
@Startup @ApplicationScoped @ContextName("jms-camel-context") public class JmsRouteBuilder extends RouteBuilder { @Resource(mappedName = "java:jboss/DefaultJMSConnectionFactory") private ConnectionFactory connectionFactory; @Override public void configure() throws Exception { JmsComponent component = new JmsComponent(); component.setConnectionFactory(connectionFactory); getContext().addComponent("jms", component); from("timer://sendJMSMessage?fixedRate=true&period=10000") .transform(constant("<?xml version='1.0><message><greeting>hello world</greeting></message>")) .to("jms:queue:WildFlyCamelQueue") .log("JMS Message sent"); } }
EAPCamelQueue
destination, a log message appears. Use the EAP Administration console to verify that the messages are placed onto the queue.
2.4.2.2. JMS Consumer
@Override public void configure() throws Exception { JmsComponent component = new JmsComponent(); component.setConnectionFactory(connectionFactory); getContext().addComponent("jms", component); from("jms:queue:WildFlyCamelQueue") .to("log:jms?showAll=true"); }
2.4.2.3. JMS Transactions
camel-jms
component requires a transaction manager of type org.springframework.transaction.PlatformTransactionManager
. Therefore, you can create a bean extending JtaTransactionManager.
@Named
to make the bean available to Camel. It enables you to register the bean within the camel bean registry. Also, inject the EAP transaction manager and user transaction instances by using CDI.
@Named("transactionManager") public class CdiTransactionManager extends JtaTransactionManager { @Resource(mappedName = "java:/TransactionManager") private TransactionManager transactionManager; @Resource private UserTransaction userTransaction; @PostConstruct public void initTransactionManager() { setTransactionManager(transactionManager); setUserTransaction(userTransaction); } }
PROPAGATION_REQUIRED
in this instance.
@Named("PROPAGATION_REQUIRED") public class CdiRequiredPolicy extends SpringTransactionPolicy { @Inject public CdiRequiredPolicy(CdiTransactionManager cdiTransactionManager) { super(new TransactionTemplate(cdiTransactionManager, new DefaultTransactionDefinition(TransactionDefinition.PROPAGATION_REQUIRED))); } }
@Startup @ApplicationScoped @ContextName("jms-camel-context") public class JMSRouteBuilder extends RouteBuilder { @Resource(mappedName = "java:/JmsXA") private ConnectionFactory connectionFactory; @Inject CdiTransactionManager transactionManager; @Override public void configure() throws Exception { // Creates a JMS component which supports transactions JmsComponent jmsComponent = JmsComponent.jmsComponentTransacted(connectionFactory, transactionManager); getContext().addComponent("jms", jmsComponent); from("jms:queue:queue1") .transacted("PROPAGATION_REQUIRED") .to("jms:queue:queue2"); from("jms:queue:queue2") .to("log:end") .rollback(); }
2.4.2.4. Remote JMS destinations
java:jboss/export
namespace are appropriate for remote clients.
<jms-queue name="RemoteQueue"> <entry name="java:jboss/exported/jms/queues/RemoteQueue"/> </jms-queue>
Chapter 3. Building a WAR
Abstract
3.1. Preparing to use Maven
Overview
Prerequisites
- Maven installation—Maven is a free, open source build tool from Apache. You can download the latest version from the Maven download page.
- Network connection—whilst performing a build, Maven dynamically searches external repositories and downloads the required artifacts on the fly. By default, Maven looks for repositories that are accessed over the Internet. You can change this behavior so that Maven will prefer searching repositories that are on a local network.NoteMaven can run in an offline mode. In offline mode Maven will only look for artifacts in its local repository.
Adding the Red Hat JBoss Fuse repository
settings.xml
file. Maven looks for your settings.xml
file in the .m2
directory of the user's home directory. If there is not a user specified settings.xml
file, Maven will use the system-level settings.xml
file at M2_HOME/conf/settings.xml
.
.m2/settings.xml
file or modify the system-level settings. In the settings.xml
file, add the repository
element for the JBoss Fuse repository as shown in bold text in Example 3.1, “Adding the Red Hat JBoss Fuse Repositories to Maven”.
Example 3.1. Adding the Red Hat JBoss Fuse Repositories to Maven
<settings> <profiles> <profile> <id>my-profile</id> <activation> <activeByDefault>true</activeByDefault> </activation> <repositories> <repository> <id>fusesource</id> <url>http://repo.fusesource.com/nexus/content/groups/public/</url> <snapshots> <enabled>false</enabled> </snapshots> <releases> <enabled>true</enabled> </releases> </repository> <repository> <id>fusesource.snapshot</id> <url>http://repo.fusesource.com/nexus/content/groups/public-snapshots/</url> <snapshots> <enabled>true</enabled> </snapshots> <releases> <enabled>false</enabled> </releases> </repository> <repository> <id>apache-public</id> <url>https://repository.apache.org/content/groups/public/</url> <snapshots> <enabled>true</enabled> </snapshots> <releases> <enabled>true</enabled> </releases> </repository> ... </repositories> <pluginRepositories> <pluginRepository> <id>fusesource</id> <url>https://repo.fusesource.com/nexus/content/groups/public/</url> <snapshots> <enabled>true</enabled> </snapshots> <releases> <enabled>true</enabled> </releases> </pluginRepository> <pluginRepository> <id>fusesource.snapshot</id> <url>http://repo.fusesource.com/nexus/content/groups/public-snapshots/</url> <snapshots> <enabled>true</enabled> </snapshots> <releases> <enabled>false</enabled> </releases> </pluginRepository> <pluginRepository> <id>apache-public</id> <url>https://repository.apache.org/content/groups/public/</url> <snapshots> <enabled>true</enabled> </snapshots> <releases> <enabled>true</enabled> </releases> </pluginRepository> ... </pluginRepositories> </profile> </profiles> ... </settings>
fusesource-snapshot
repository—if you want to experiment with building your application using an Red Hat JBoss Fuse snapshot kit, you can include this repository.apache-public
repository—you might not always need this repository, but it is often useful to include it, because JBoss Fuse depends on many of the artifacts from Apache.
Artifacts
Maven coordinates
{groupId, artifactId, version}
. Sometimes Maven augments the basic set of coordinates with the additional coordinates, packaging and classifier. A tuple can be written with the basic coordinates, or with the additional packaging coordinate, or with the addition of both the packaging and classifier coordinates, as follows:
groupdId:artifactId:version groupdId:artifactId:packaging:version groupdId:artifactId:packaging:classifier:version
- groupdId
- Defines a scope for the name of the artifact. You would typically use all or part of a package name as a group ID—for example,
org.fusesource.example
. - artifactId
- Defines the artifact name (relative to the group ID).
- version
- Specifies the artifact's version. A version number can have up to four parts:
n.n.n.n
, where the last part of the version number can contain non-numeric characters (for example, the last part of1.0-SNAPSHOT
is the alphanumeric substring,0-SNAPSHOT
). - packaging
- Defines the packaged entity that is produced when you build the project. For OSGi projects, the packaging is
bundle
. The default value isjar
. - classifier
- Enables you to distinguish between artifacts that were built from the same POM, but have different content.
<project ... > ... <groupId>org.fusesource.example</groupId> <artifactId>bundle-demo</artifactId> <packaging>bundle</packaging> <version>1.0-SNAPSHOT</version> ... </project>
dependency
element to a POM:
<project ... > ... <dependencies> <dependency> <groupId>org.fusesource.example</groupId> <artifactId>bundle-demo</artifactId> <version>1.0-SNAPSHOT</version> </dependency> </dependencies> ... </project>
bundle
package type in the preceding dependency, because a bundle is just a particular kind of JAR file and jar
is the default Maven package type. If you do need to specify the packaging type explicitly in a dependency, however, you can use the type
element.
3.2. Modifying an Existing Maven Project
Overview
Change the package type to WAR
war
in your project's pom.xml
file. Change the contents of the packaging
element to war
, as shown in the following example:
<project ... >
...
<packaging>war</packaging>
...
</project>
maven-war-plugin
, to perform packaging for this project.
Customize the JDK compiler version
JAVA_HOME
and the PATH
environment variables to the correct values for your JDK, you must also modify the POM file.
maven-compiler-plugin
plug-in settings to your POM (if they are not already present):
<project ... > ... <build> <defaultGoal>install</defaultGoal> <plugins> ... <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.7</source> <target>1.7</target> </configuration> </plugin> </plugins> </build> ... </project>
Store resources under webapp/WEB-INF
/WEB-INF
directory in the standard WAR directory layout. In order to ensure that these resources are copied into the root of the generated WAR package, store the WEB-INF
directory under ProjectDir/src/main/webapp
in the Maven directory tree, as follows:
ProjectDir/
pom.xml
src/
main/
webapp/
WEB-INF/
web.xml
classes/
lib/
web.xml
file is stored at ProjectDir/src/main/webapp/WEB-INF/web.xml
.
Customize the Maven WAR plug-in
plugins
section of the pom.xml
file. Most of the configuration options are concerned with adding additonal resources to the WAR package. For example, to include all of the resources under the src/main/resources
directory (specified relative to the location of pom.xml
) in the WAR package, you could add the following WAR plug-in configuration to your POM:
<project ...>
...
<build>
...
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<!-- Optionally specify where the web.xml file comes from -->
<webXml>src/main/webapp/WEB-INF/web.xml</webXml>
<!-- Optionally specify extra resources to include -->
<webResources>
<resource>
<directory>src/main/resources</directory>
<targetPath>WEB-INF</targetPath>
<includes>
<include>**/*</include>
</includes>
</resource>
</webResources>
</configuration>
</plugin>
...
</plugins>
</build>
</project>
webXml
- Specifies where to find the
web.xml
file in the current Maven project, relative to the location ofpom.xml
. The default issrc/main/webapp/WEB-INF/web.xml
. webResources
- Specifies additional resource files that are to be included in the generated WAR package. It can contain the following sub-elements:
webResources/resource
—each resource elements specifies a set of resource files to include in the WAR.webResources/resource/directory
—specifies the base directory from which to copy resource files, where this directory is specified relative to the location ofpom.xml
.webResources/resource/targetPath
—specifies where to put the resource files in the generated WAR package.webResources/resource/includes
—uses an Ant-style wildcard pattern to specify explicitly which resources should be included in the WAR.webResources/resource/excludes
—uses an Ant-style wildcard pattern to specify explicitly which resources should be excluded from the WAR (exclusions have priority over inclusions).
maven-war-plugin
plug-in, which has a bug that causes two copies of the web.xml
file to be inserted into the generated .war
file.
Building the WAR
pom.xml
file), and enter the following Maven command:
mvn install
ProjectDir/target
directory, and then to install the generated WAR in the local Maven repository.
3.3. Bootstrapping a CXF Servlet in a WAR
Overview
web.xml
to use the standard CXF servlet, org.apache.cxf.transport.servlet.CXFServlet
.
Example
web.xml
file shows how to configure the CXF servlet, where all Web service addresses accessed through this servlet would be prefixed by /services/
(as specified by the value of servlet-mapping/url-pattern
):
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> <web-app> <display-name>cxf</display-name> <description>cxf</description> <servlet> <servlet-name>cxf</servlet-name> <display-name>cxf</display-name> <description>Apache CXF Endpoint</description> <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>cxf</servlet-name> <url-pattern>/services/*</url-pattern> </servlet-mapping> <session-config> <session-timeout>60</session-timeout> </session-config> </web-app>
cxf-servlet.xml file
web.xml
file, it is also necessary to configure your Web services by defining a cxf-servlet.xml
file, which must be copied into the root of the generated WAR.
cxf-servlet.xml
in the default location, you can customize its name and location, by setting the contextConfigLocation
context parameter in the web.xml
file. For example, to specify that Apache CXF configuration is located in WEB-INF/cxf-servlet.xml
, set the following context parameter in web.xml
:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> <web-app> ... <context-param> <param-name>contextConfigLocation</param-name> <param-value>WEB-INF/cxf-servlet.xml</param-value> </context-param> ... </web-app>
Reference
3.4. Bootstrapping a Spring Context in a WAR
Overview
Bootstrapping a Spring context in a WAR
web.xml
file shows how to boot up a Spring application context that is initialized by the XML file, /WEB-INF/applicationContext.xml
(which is the location of the context file in the generated WAR package):
<?xml version="1.0" encoding="ISO-8859-1"?> <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> <display-name>Camel Routes</display-name> <!-- location of spring xml files --> <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/applicationContext.xml</param-value> </context-param> <!-- the listener that kick-starts Spring --> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> </web-app>
Maven dependency
ContextLoaderListener
class from the Spring framework, you must add the following dependency to your project's pom.xml
file:
<dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> <version>${spring-version}</version> </dependency>
spring-version
property specifies the version of the Spring framework you are using.
Chapter 4. Deploying an Apache CXF Web Service
Abstract
4.1. Apache CXF Example
Overview
url-pattern
setting from web.xml
, and the address
attribute of the Web services endpoint are combined to give the URL, http://localhost:8080/wsdl_first/services/CustomerServicePort
.
Figure 4.1. Example Web Service Deployed in a Web Server
wsdl_first sample
samples/wsdl_first
directory. For details of how to install the Apache CXF distribution, see the section called “Install Apache CXF”.
web.xml file
web.xml
file. In the wsdl_first
project, the web.xml
file is stored at the following location:
wsdl_first/src/main/webapp/WEB-INF/web.xml
web.xml
file.
Example 4.1. web.xml File for the wsdl_first Example
<?xml version="1.0" encoding="UTF-8"?> <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> <display-name>cxf</display-name> <servlet> <servlet-name>cxf</servlet-name> <display-name>cxf</display-name> <description>Apache CXF Endpoint</description> <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>cxf</servlet-name> <url-pattern>/services/*</url-pattern> </servlet-mapping> <session-config> <session-timeout>60</session-timeout> </session-config> </web-app>
web.xml
file are:
- Servlet class—specifies the
org.apache.cxf.transport.servlet.CXFServlet
class, which implements a special servlet that integrates with Web services. - URL pattern—determines which URLs are routed to this servlet. In general, the servlet URL has the following form:
http://Host:Port/WARFileName/URLPattern
Where the base URL,http://Host:Port
, is determined by the configuration of the Web server, theWARFileName
is the root of theWARFileName.war
WAR file, and theURLPattern
is specified by the contents of theurl-pattern
element.Assuming that the Web server port is set to 8080, thewsdl_first
example servlet will match URLs of the following form:http://localhost:8080/wsdl_first/services/*
Implied Spring container
CXFServlet
automatically creates and starts up a Spring container, which you can then use for defining Web service endpoints. By default, this Spring container automatically loads the following XML file in the WAR:
WEB-INF/cxf-servlet.xml
wsdl_first
example project, this file is stored at the following location:
wsdl_first/src/main/webapp/WEB-INF/cxf-servlet.xml
cxf-servlet.xml file
cxf-servlet.xml
file is primarily used to create Web service endpoints, which represent the Web services exposed through the Web server. Apache CXF provides a convenient and flexible syntax for defining Web service endpoints in XML and you can use this flexible syntax to define endpoints in cxf-servlet.xml
.
cxf-servlet.xml
file, which creates a single CustomerService
endpoint, using the jaxws:endpoint
element.
Example 4.2. Spring Configuration for the wsdl_first Example
<?xml version="1.0" encoding="UTF-8"?>
<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.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">
<jaxws:endpoint
xmlns:customer="http://customerservice.example.com/"
id="CustomerServiceHTTP"
address="/CustomerServicePort"
serviceName="customer:CustomerServiceService"
endpointName="customer:CustomerServicePort"
implementor="com.example.customerservice.server.CustomerServiceImpl">
<!--jaxws:properties>
<entry key="schema-validation-enabled" value="true" />
</jaxws:properties-->
</jaxws:endpoint>
</beans>
address
attribute of the jaxws:endpoint
specifies the final segment of the Web service's URL. When you put together all of the settings from the Web server, the web.xml
file, and the cxf-server.xml
file, you obtain the following URL for this Web service endpoint:
http://localhost:8080/wsdl_first/services/CustomerServicePort
WSDL address configuration
web.xml
, and the Spring configuration, cxf-servlet.xml
, it is also necessary to ensure that the SOAP address in the WSDL contract is correctly specified, so that it matches the URL for this Web service.
wsdl_first
example, the WSDL contract is located in the following file:
wsdl_first/src/main/resources/CustomerService.wsdl
location
attribute of the soap:address
element must be set to the correct Web service URL, as shown in Example 4.3, “Address in the WSDL CustomerService Contract”.
Example 4.3. Address in the WSDL CustomerService Contract
<?xml version="1.0" encoding="UTF-8"?>
...
<wsdl:definitions name="CustomerServiceService" targetNamespace="http://customerservice.example.com/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://customerservice.example.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
...
<wsdl:service name="CustomerServiceService">
<wsdl:port name="CustomerServicePort" binding="tns:CustomerServiceServiceSoapBinding">
<!-- embedded deployment -->
<!--soap:address location="http://localhost:9090/CustomerServicePort"/-->
<!-- standalone Tomcat deployment -->
<soap:address location="http://localhost:8080/wsdl_first/services/CustomerServicePort"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
4.2. Deploy the Apache CXF Example
Overview
wsdl_first
example) and shows you how to deploy it into a Web server, by packaging the application as a WAR. In this example, the Web service is implemented by binding the service to a Java class with the JAX-WS mapping.
Prerequisites
- Either of the following Web servers are installed:
- JBoss Web Server, or
- JBoss Enterprise Application Platform
- Java version 1.7 or later is installed.
- Apache Maven 3.0.0 or later is installed.
- Maven is configured to access the JBoss Fuse repositories, as described in Section 3.1, “Preparing to use Maven”.
- You have access to the Internet, so that Maven can download dependencies from remote repositories.
Install Apache CXF
wsdl_first
example, you need to install the Apache CXF kit, apache-cxf-3.0.4.redhat-621084.zip
, provided in the extras/
directory of the JBoss Fuse installation.
- Find the Apache CXF kit at the following location:
InstallDir/extras/apache-cxf-3.0.4.redhat-621084.zip
- Using a suitable archive utility on your platform, unzip the
apache-cxf-3.0.4.redhat-621084.zip
file and extract it to a convenient location,CXFInstallDir
.
The wsdl_first example
wsdl_first
example is located under the following sub-directory of the Apache CXF installation:
CXFInstallDir/samples/wsdl_first/
Build and run the example
wsdl_first
example, perform the following steps:
- Using your favorite text editor, open the
CustomerService.wsdl
file, which can be found in the following location in thewsdl_first
project:wsdl_first/src/main/resources/CustomerService.wsdl
Edit thesoap:address
element in the WSDL contract, removing comments around the element labeledstandalone Tomcat deployment
and inserting comments around the element labeledembedded deployment
. When you are finished editing, thesoap:address
element should be look as follows:<?xml version="1.0" encoding="UTF-8"?> ... <wsdl:definitions name="CustomerServiceService" targetNamespace="http://customerservice.example.com/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://customerservice.example.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"> ... <wsdl:service name="CustomerServiceService"> <wsdl:port name="CustomerServicePort" binding="tns:CustomerServiceServiceSoapBinding"> <!-- embedded deployment --> <!--soap:address location="http://localhost:9090/CustomerServicePort"/--> <!-- standalone Tomcat deployment --> <soap:address location="http://localhost:8080/wsdl_first/services/CustomerServicePort"/> </wsdl:port> </wsdl:service> </wsdl:definitions>
- Build the
wsdl_first
example using Maven. Change directory to theCXFInstallDir/samples/wsdl_first
directory, open a command prompt, and enter the following command at the command line:mvn clean package
If this command executes successfully, you should be able to find the WAR file,wsdl_first.war
, under thewsdl_first/target
sub-directory. - Make sure that the Web server is already running (a simple way to test this is to enter the URL,
http://localhost:8080
, into your browser). If you need to start the Web server, you can typically do this from the command line. The command to start the Web server depends on the particular product you are using, as follows:- JBoss Web Server (WS)—open a new command prompt and execute the
startup.sh
script from thetomcat8/bin/
directory (or thetomcat7/bin/
directory, as appropriate). For more details about how to configure and launch the Web server, see the Installation Guide from the JBoss Web Server library. - JBoss Enterprise Application Platform (EAP)—for a standalone instance, open a new command prompt and execute the
bin/standalone.sh
script. For more details about how to configure and launch the EAP, see the Administration and Configuration Guide from the JBoss Enterprise Application Platform library.
- Deploy the
wsdl_first
example to the running Web server. Manually copy thewsdl_first.war
WAR file from thewsdl_first/target
directory to the Web server's deployment directory, as follows:- JBoss Web Server (WS)—copy the
wsdl_first.war
WAR file to thetomcat8/webapps
directory (ortomcat7/webapps
directory, as appropriate). - JBoss Enterprise Application Platform (EAP)—copy the
wsdl_first.war
WAR file to thestandalone/deployments
directory.
- Use a Web browser to query the WSDL contract from the newly deployed Web service. Navigate to the following URL in your browser:
http://localhost:8080/wsdl_first/services/CustomerServicePort?wsdl
NoteThis step might not work in the Safari browser. - Run the test client against the deployed Web service. Change directory to the
CXFInstallDir/samples/wsdl_first
directory, open a command prompt, and enter the following command at the command line:mvn -Pclient
If the client runs successfully, you should see some output like the following in your command window:... Sending request for customers named Smith Response received Did not find any matching customer for name=None NoSuchCustomer exception was received as expected All calls were successful
Chapter 5. Deploying an Apache Camel Servlet Endpoint
Abstract
5.1. Apache Camel Servlet Example
Overview
url-pattern
setting from web.xml
, and the endpoint URI of the Camel servlet endpoint are combined to give the URL, http://localhost:8080/camel-example-servlet-tomcat-2.15.1.redhat-621084/camel/hello
.
Figure 5.1. Camel Servlet Example Deployed in a Web Server
camel-example-servlet-tomcat example
examples/camel-example-servlet-tomcat
directory. For details of how to install the Apache Camel distribution, see the section called “Install Apache Camel”.
Camel servlet component
org.apache.camel.component.servlet.CamelHttpTransportServlet
servlet://RelativePath[?Options]
RelativePath
specifies the tail segment of the HTTP URL path for this servlet.
web.xml file
web.xml
file. In the camel-example-servlet-tomcat
project, the web.xml
file is stored at the following location:
camel-example-servlet-tomcat/src/main/webapp/WEB-INF/web.xml
web.xml
file.
Example 5.1. web.xml File for the camel-example-servlet-tomcat Example
<?xml version="1.0" encoding="ISO-8859-1"?> <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> <display-name>My Web Application</display-name> <!-- location of spring xml files --> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:camel-config.xml</param-value> </context-param> <!-- the listener that kick-starts Spring --> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <!-- Camel servlet --> <servlet> <servlet-name>CamelServlet</servlet-name> <servlet-class>org.apache.camel.component.servlet.CamelHttpTransportServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <!-- Camel servlet mapping --> <servlet-mapping> <servlet-name>CamelServlet</servlet-name> <url-pattern>/camel/*</url-pattern> </servlet-mapping> </web-app>
web.xml
file are:
servlet/servlet-class
- Specifies the
org.apache.camel.component.servlet.CamelHttpTransportServlet
class, which implements the Camel servlet component. servlet-mapping/url-pattern
- Determines which URLs are routed to this servlet. In general, the servlet URL has the following form:
http://Host:Port/WARFileName/URLPattern
Where the base URL,http://Host:Port
, is determined by the configuration of the Web server, theWARFileName
is the root of theWARFileName.war
WAR file, and theURLPattern
is specified by the contents of theurl-pattern
element.Assuming that the Web server port is set to 8080, thecamel-example-servlet-tomcat
example servlet will match URLs of the following form:http://localhost:8080/camel-example-servlet-tomcat-2.15.1.redhat-621084/camel/*
listener/listener-class
- This element launches the Spring container.
context-param
- This element specifies the location of the Spring XML file,
camel-config.xml
, in the WAR. The Spring container will read this parameter and load the specified Spring XML file, which contains the definition of the Camel route.
Example Camel route
Example 5.2. Route Definition for the Camel Servlet Example
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:camel="http://camel.apache.org/schema/spring"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
<camelContext xmlns="http://camel.apache.org/schema/spring">
<route>
<!-- incoming requests from the servlet is routed -->
<from uri="servlet:///hello"/>
<choice>
<when>
<!-- is there a header with the key name? -->
<header>name</header>
<!-- yes so return back a message to the user -->
<transform>
<simple>Hello ${header.name} how are you?</simple>
</transform>
</when>
<otherwise>
<!-- if no name parameter then output a syntax to the user -->
<transform>
<constant>Add a name parameter to uri, eg ?name=foo</constant>
</transform>
</otherwise>
</choice>
</route>
</camelContext>
</beans>
servlet:///hello
, specifies the relative path, /hello
, the complete URL to access this servlet is the following:
http://localhost:8080/camel-example-servlet-tomcat-2.15.1.redhat-621084/camel/hello
5.2. Deploy the Apache Camel Servlet
Overview
camel-example-servlet-tomcat
example) and shows you how to deploy it into a Web server, by packaging the application as a WAR.
Prerequisites
- Either of the following Web servers are installed:
- JBoss Web Server, or
- JBoss Enterprise Application Platform
- Java version 1.7 or later is installed.
- Apache Maven 3.0.0 or later is installed.
- Maven is configured to access the JBoss Fuse repositories, as described in Section 3.1, “Preparing to use Maven”.
- You have access to the Internet, so that Maven can download dependencies from remote repositories.
Install Apache Camel
camel-example-servlet-tomcat
example, you need to install the Apache Camel kit, apache-camel-2.15.1.redhat-621084.zip
, provided in the extras/
directory of the JBoss Fuse installation.
- Find the Apache Camel kit at the following location:
InstallDir/extras/apache-camel-2.15.1.redhat-621084.zip
- Using a suitable archive utility on your platform, unzip the
apache-camel-2.15.1.redhat-621084.zip
file and extract it to a convenient location,CamelInstallDir
.
The camel-example-servlet-tomcat example
camel-example-servlet-tomcat
example is located under the following sub-directory of the Apache Camel installation:
CamelInstallDir/examples/camel-example-servlet-tomcat/
Build and run the example
camel-example-servlet-tomcat
example, perform the following steps:
- Build the
camel-example-servlet-tomcat
example using Maven. Change directory to theCamelInstallDir/examples/camel-example-servlet-tomcat/
directory, open a command prompt, and enter the following command at the command line:mvn package
If this command executes successfully, you should be able to find the WAR file,camel-example-servlet-tomcat-2.15.1.redhat-621084.war
, under thecamel-example-servlet-tomcat/target
sub-directory. - Make sure that the Web server is already running (a simple way to test this is to enter the URL,
http://localhost:8080
, into your browser). If you need to start the Web server, you can typically do this from the command line. The command to start the Web server depends on the particular product you are using, as follows:- JBoss Web Server (WS)—open a new command prompt and execute the
startup.sh
script from thetomcat8/bin/
directory (or thetomcat7/bin/
directory, as appropriate). For more details about how to configure and launch the WS, see the Installation Guide from the JBoss Web Server library. - JBoss Enterprise Application Platform (EAP)—for a standalone instance, open a new command prompt and execute the
bin/standalone.sh
script. For more details about how to configure and launch the EAP, see the Administration and Configuration Guide from the JBoss Enterprise Application Platform library.
- Deploy the
camel-example-servlet-tomcat
example to the running Web server. Manually copy thecamel-example-servlet-tomcat-2.15.1.redhat-621084.war
WAR file from thecamel-example-servlet-tomcat/target
directory to the Web server's deployment directory, as follows:- JBoss Web Server (WS)—copy the
camel-example-servlet-tomcat-2.15.1.redhat-621084.war
WAR file to thetomcat8/webapps
directory (ortomcat7/webapps
directory, as appropriate). - JBoss Enterprise Application Platform (EAP)—copy the
camel-example-servlet-tomcat-2.15.1.redhat-621084.war
WAR file to thestandalone/deployments
directory.
- Navigate to the following URL in your browser:
http://localhost:8080/camel-example-servlet-tomcat-2.15.1.redhat-621084/
When the page loads, you should see the following text in your browser window: - Click the highlighted link in the line
To get started click this link.
and follow the on-screen instructions to test the servlet.
Chapter 6. Deploying an Apache Camel WS Endpoint
Abstract
6.1. Apache Camel CXF Example
Overview
url-pattern
setting from web.xml
, and the URI of the Camel CXF endpoint are combined to give the URL, http://localhost:8080/camel-example-cxf-tomcat/webservices/incident
.
Figure 6.1. Camel CXF Example Deployed in a Web Server
camel-example-cxf-tomcat example
examples/camel-example-cxf-tomcat
directory. For details of how to install the Apache Camel distribution, see the section called “Install Apache Camel”.
Camel CXF component
Exchange
object, and can then propagate through the route.
cxf:Address[?Options]
- Specifies the WSDL endpoint address and a (potentially large) number of options to configure the endpoint.
cxf:bean:BeanID[?Options]
- References a bean with the ID,
BeanID
, defined using thecxf:cxfEndpoint
element (where thecxf
prefix is bound to thehttp://camel.apache.org/schema/cxf
namespace). The advantage of this approach is that all of the configuration complexity is encapsulated in the bean. Typically, this means that very few options (or none) need to be specified on the endpoint URI.NoteThecxf:cxfEndpoint
element, which binds a WS endpoint to a Camel route, should not be confused with thejaxws:endpoint
element, which binds a WS endpoint directly to a Java class.
More about the Camel CXF component
- Web Services and Routing with Camel CXF
- The CXF chapter from the EIP Component Reference.
web.xml file
web.xml
file. In the camel-example-cxf-tomcat
project, the web.xml
file is stored at the following location:
camel-example-cxf-tomcat/src/main/webapp/WEB-INF/web.xml
web.xml
file.
Example 6.1. web.xml File for the camel-example-cxf-tomcat Example
<?xml version="1.0" encoding="ISO-8859-1"?> <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> <display-name>My Web Application</display-name> <!-- location of spring xml files --> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:camel-config.xml</param-value> </context-param> <!-- the listener that kick-starts Spring --> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <!-- CXF servlet --> <servlet> <servlet-name>CXFServlet</servlet-name> <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class> <load-on-startup>1</load-on-startup> <!-- If you want to leverage the Servlet3's async feature in Tomcat, please enable this feature <async-supported>true</async-supported> --> </servlet> <!-- all our webservices are mapped under this URI pattern --> <servlet-mapping> <servlet-name>CXFServlet</servlet-name> <url-pattern>/webservices/*</url-pattern> </servlet-mapping> </web-app>
web.xml
file are:
servlet/servlet-class
- Specifies the
org.apache.cxf.transport.servlet.CXFServlet
class, which implements a special servlet that enables you to deploy Apache CXF WS endpoints. servlet-mapping/url-pattern
- Determines which URLs are routed to this servlet. In general, the servlet URL has the following form:
http://Host:Port/WARFileName/URLPattern
Where the base URL,http://Host:Port
, is determined by the configuration of the Web server, theWARFileName
is the root of theWARFileName.war
WAR file, and theURLPattern
is specified by the contents of theurl-pattern
element.Assuming that the Web server port is set to 8080, thecamel-example-cxf-tomcat
example servlet will match URLs of the following form:http://localhost:8080/camel-example-cxf-tomcat/webservices/*
listener/listener-class
- This element launches a Spring container.
context-param
- This element specifies the location of the Spring XML file,
camel-config.xml
, in the WAR. The Spring container will read this parameter and load the specified Spring XML file, which contains the definition of the Camel route.
listener-class
element here, because the CXFServlet
class already creates its own Spring container. If you put the Spring XML file in the location expected by the CXFServlet
class (that is, WEB-INF/cxf-servlet.xml
) instead of the location used by this example (that is, WEB-INF/classes/camel-config.xml
), you could remove the Spring container settings from this web.xml
file.
Spring XML file
camel-config.xml
, contains the following XML code:
<?xml version="1.0" encoding="UTF-8"?> <beans ...> <import resource="classpath:META-INF/cxf/cxf.xml"/> <bean id="myRoutes" class="org.apache.camel.example.cxf.CamelRoute"/> <camelContext xmlns="http://camel.apache.org/schema/spring"> <routeBuilder ref="myRoutes"/> </camelContext> </beans>
RouteBuilder
class is defined in the Java class, org.apache.camel.example.cxf.CamelRoute
.
Camel route class
Example 6.2. Route Definitions in the CamelRoute Class
// Java
package org.apache.camel.example.cxf;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.example.cxf.incident.IncidentService;
import org.apache.camel.example.cxf.incident.InputReportIncident;
import org.apache.camel.example.cxf.incident.OutputReportIncident;
import org.apache.camel.example.cxf.incident.OutputStatusIncident;
// this static import is needed for older versions of Camel than 2.5
// import static org.apache.camel.language.simple.SimpleLanguage.simple;
public class CamelRoute extends RouteBuilder {
// CXF webservice using code first approach
private String uri = "cxf:/incident?serviceClass=" + IncidentService.class.getName();
@Override
public void configure() throws Exception {
from(uri)
.to("log:input")
// send the request to the route to handle the operation
// the name of the operation is in that header
.recipientList(simple("direct:${header.operationName}"));
// report incident
from("direct:reportIncident")
.process(new Processor() {
public void process(Exchange exchange) throws Exception {
// get the id of the input
String id = exchange.getIn().getBody(InputReportIncident.class).getIncidentId();
// set reply including the id
OutputReportIncident output = new OutputReportIncident();
output.setCode("OK;" + id);
exchange.getOut().setBody(output);
}
})
.to("log:output");
// status incident
from("direct:statusIncident")
.process(new Processor() {
public void process(Exchange exchange) throws Exception {
// set reply
OutputStatusIncident output = new OutputStatusIncident();
output.setStatus("IN PROGRESS");
exchange.getOut().setBody(output);
}
})
.to("log:output");
}
}
from(uri)
DSL command). The Camel CXF endpoint is defined using the following endpoint URI:
cxf:/incident?serviceClass=org.apache.camel.example.cxf.incident.IncidentService
IncidentService
class in this URI. The relative path, /incident
, defines the tail of the servlet URL for this Web service. Hence, the full servlet URL for the Web service is the following:
http://localhost:8080/camel-example-cxf-tomcat/webservices/incident
serviceClass
option specifies the name of the Service Endpoint Interface (SEI) for this Web service. By default, the CXF endpoint is set up to use the POJO mode, using the SEI to check the syntax of incoming messages.
6.2. Deploy the Apache Camel CXF Example
Overview
camel-example-cxf-tomcat
example) and shows you how to deploy it into a Web server, by packaging the application as a WAR. In this example, the Web service is implemented by binding the service to a Camel route using the Camel CXF component.
Prerequisites
- Either of the following Web servers are installed:
- JBoss Web Server, or
- JBoss Enterprise Application Platform
- Java version 1.7 or later is installed.
- Apache Maven 3.0.0 or later is installed.
- Maven is configured to access the JBoss Fuse repositories, as described in Section 3.1, “Preparing to use Maven”.
- You have access to the Internet, so that Maven can download dependencies from remote repositories.
Install Apache Camel
camel-example-cxf-tomcat
example, you need to install the Apache Camel kit, apache-camel-2.15.1.redhat-621084.zip
, provided in the extras/
directory of the JBoss Fuse installation.
- Find the Apache Camel kit at the following location:
InstallDir/extras/apache-camel-2.15.1.redhat-621084.zip
- Using a suitable archive utility on your platform, unzip the
apache-camel-2.15.1.redhat-621084.zip
file and extract it to a convenient location,CamelInstallDir
.
The camel-example-cxf-tomcat example
camel-example-cxf-tomcat
example is located under the following sub-directory of the Apache Camel installation:
CamelInstallDir/examples/camel-example-cxf-tomcat/
Build and run the example
camel-example-cxf-tomcat
example, perform the following steps:
- Build the
camel-example-cxf-tomcat
example using Maven. Change directory to theCamelInstallDir/examples/camel-example-cxf-tomcat/
directory, open a command prompt, and enter the following command at the command line:mvn clean package
If this command executes successfully, you should be able to find the WAR file,camel-example-cxf-tomcat.war
, under thecamel-example-cxf-tomcat/target
sub-directory. - Make sure that the Web server is already running (a simple way to test this is to enter the URL,
http://localhost:8080
, into your browser). If you need to start the Web server, you can typically do this from the command line. The command to start the Web server depends on the particular product you are using, as follows:- JBoss Web Server (WS)—open a new command prompt and execute the
startup.sh
script from thetomcat8/bin/
directory (or thetomcat7/bin/
directory, as appropriate). For more details about how to configure and launch the Web server, see the Installation Guide from the JBoss Web Server library. - JBoss Enterprise Application Platform (EAP)—for a standalone instance, open a new command prompt and execute the
bin/standalone.sh
script. For more details about how to configure and launch the EAP, see the Administration and Configuration Guide from the JBoss Enterprise Application Platform library.
- Deploy the
camel-example-cxf-tomcat
example to the running Web server. Manually copy thecamel-example-cxf-tomcat.war
WAR file from thecamel-example-cxf-tomcat/target
directory to the Web server's deployment directory, as follows:- JBoss Web Server (WS)—copy the
camel-example-cxf-tomcat.war
WAR file to thetomcat8/webapps
directory (ortomcat7/webapps
directory, as appropriate). - JBoss Enterprise Application Platform (EAP)—copy the
camel-example-cxf-tomcat.war
WAR file to thestandalone/deployments
directory.
- Use a Web browser to query the WSDL contract from the newly deployed Web service. Navigate to the following URL in your browser:
http://localhost:8080/camel-example-cxf-tomcat/webservices/incident?wsdl
NoteThis step might not work in the Safari browser. - Run the test client against the deployed Web service. Change directory to the
CamelInstallDir/examples/camel-example-cxf-tomcat/
directory, open a command prompt, and enter the following command at the command line:mvn exec:java
If the client runs successfully, you should see some output like the following in your command window:... [INFO] --- exec-maven-plugin:1.1.1:java (default-cli) @ camel-example-cxf-tomcat --- 2013-07-24 13:59:16,829 [teClient.main()] INFO ReflectionServiceFactoryBean - Creating Service {http://incident.cxf.example.camel.apache.org/}IncidentService from class org.apache.camel.example.cxf.incident.IncidentService OK;123 IN PROGRESS [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 7.445s [INFO] Finished at: Wed Jul 24 13:59:17 CEST 2013 [INFO] Final Memory: 10M/81M [INFO] ------------------------------------------------------------------------
Legal Notice
Trademark Disclaimer