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.此内容没有您所选择的语言版本。
Chapter 1. Deploying a Web Service into Red Hat JBoss Fuse
Abstract
Here we will take an in depth look at the CXF OSGi example, a JAX-WS web service packaged as an OSGi bundle.
You are going to build and deploy a simple service that is based on a WSDL document. The source for this example can be found in the
InstallDir/examples/cxf-osgi
folder of your Red Hat JBoss Fuse installation.
The example uses the JBoss Fuse Maven tooling to build a bundle that contains the service implementation and all of the metadata needed to deploy it into the JBoss Fuse container.
The sample code includes a web page,
client.html
, that will allow you to access the service once it is exposed.
1.1. Deploying the Example 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
Before you run the example, start Red Hat JBoss Fuse.
Installing a prebuilt version of the example 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
To install and run a prebuilt version of this example, enter the following command in the Red Hat JBoss Fuse console:
features:install examples-cxf-osgi
Building and deploying the example yourself 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
To build and deploy the example do the following:
- If you installed the examples-cxf-osgi feature, first uninstall it by running the following from the Red Hat JBoss Fuse console:
features:uninstall examples-cxf-osgi
- In a separate command window or terminal, change to the root folder of the example.
cd InstallDir/examples/cxf-osgi
- Enter the following command:
mvn install
mvn install
Copy to Clipboard Copied! Toggle word wrap Toggle overflow This command will build a bundle calledcxf-osgi-6.0.0.redhat-024.jar
and place it into thetarget
folder of the example. - Copy the bundle to
InstallDir/deploy
to deploy it to the container.
Testing the example 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
To see if the example is running you can visit http://localhost:8181/cxf/HelloWorld?wsdl in your Web browser. You should see the WSDL shown in Example 1.1, “CXF OSGi Example WSDL”.
Example 1.1. CXF OSGi Example WSDL