이 콘텐츠는 선택한 언어로 제공되지 않습니다.

33.2. Running the Demonstrations


Building the demonstrations

Use Apache Maven to build the demonstrations. Open a new command prompt, change directory to cxf-webinars-jboss-fuse-6.2, and enter the following commands:
mvn install
Copy to Clipboard Toggle word wrap
This command builds all of the demonstrations under the cxf-webinars-jboss-fuse-6.2 directory (where the demonstrations are defined to be submodules of the cxf-webinars-jboss-fuse-6.2/pom.xml project). While Maven is building the demonstration code, it downloads whatever dependencies it needs from the Internet and installs them in the local Maven repository.

Starting and configuring the Red Hat JBoss Fuse container

Start and configure the Red Hat JBoss Fuse container as follows:
  1. (Optional) If your local Maven repository is in a non-standard location, you might need to edit the JBoss Fuse configuration to specify your custom location. Edit the InstallDir/etc/org.ops4j.pax.url.mvn.cfg file and set the org.ops4j.pax.url.mvn.localRepository property to the location of your local Maven repository:
    #
    # Path to the local maven repository which is used to avoid downloading
    # artifacts when they already exist locally.
    # The value of this property will be extracted from the settings.xml file
    # above, or defaulted to:
    #     System.getProperty( "user.home" ) + "/.m2/repository"
    #
    #org.ops4j.pax.url.mvn.localRepository=
    org.ops4j.pax.url.mvn.localRepository=file:E:/Data/.m2/repository
    Copy to Clipboard Toggle word wrap
  2. Launch the JBoss Fuse container. Open a new command prompt, change directory to InstallDir/bin, and enter the following command:
    ./fuse
    Copy to Clipboard Toggle word wrap

Running the customer-ws-osgi-bundle demonstration

It is now a relatively straightforward task to run each of the demonstrations by installing the relevant OSGi bundles.
For example, to start up the WSDL-first Web service (discussed in Chapter 35, WSDL-First Service Implementation), enter the following console commands:
JBossFuse:karaf@root> install -s mvn:com.fusesource.byexample.cxf-webinars/customer-ws-osgi-bundle
Copy to Clipboard Toggle word wrap
To see the Web service in action, start up the sample Web service client (discussed in Chapter 36, Implementing a WS Client), by entering the following console command:
JBossFuse:karaf@root> install -s mvn:com.fusesource.byexample.cxf-webinars/customer-ws-client
Copy to Clipboard Toggle word wrap
The bundle creates a thread that invokes the Web service once a second and logs the response. View the log by entering the following console command:
JBossFuse:karaf@root> log:tail -n 4
Copy to Clipboard Toggle word wrap
You should see log output like the following:
2015-08-20 16:10:16,271 | INFO  | #0 - timer://foo | timerToLog                       | ?                                   ? | 198 - org.apache.camel.camel-core - 2.15.1.redhat-620133 | The message contains Hi from Camel at 2015-08-20 16:10:16
2015-08-20 16:10:16,367 | INFO  | qtp432302853-183 | CustomerServiceImpl              | ?                                   ? | 283 - com.fusesource.byexample.cxf-webinars.customer-ws-osgi-bundle - 1.0.0.SNAPSHOT | Getting status for customer 1234
2015-08-20 16:10:16,370 | INFO  |  invoker thread. | ClientInvoker                    | ?                                   ? | 284 - com.fusesource.byexample.cxf-webinars.customer-ws-client - 1.0.0.SNAPSHOT | Got back: status = Active, statusMessage = In the park, playing with my frisbee.
2015-08-20 16:10:18,373 | INFO  | qtp432302853-182 | CustomerServiceImpl              | ?                                   ? | 283 - com.fusesource.byexample.cxf-webinars.customer-ws-osgi-bundle - 1.0.0.SNAPSHOT | Getting status for customer 1234
2015-08-20 16:10:18,376 | INFO  |  invoker thread. | ClientInvoker                    | ?                                   ? | 284 - com.fusesource.byexample.cxf-webinars.customer-ws-client - 1.0.0.SNAPSHOT | Got back: status = Active, statusMessage = In the park, playing with my frisbee.
Copy to Clipboard Toggle word wrap
To stop viewing the log, type the interrupt character (usually Ctrl-C).
To stop the client, first discover the client's bundle ID using the osgi:list console command. For example:
JBossFuse:karaf@root> list | grep customer-ws-client
[ 284] [Active     ] [            ] [Started] [   80] customer-ws-client (1.0.0.SNAPSHOT)
Copy to Clipboard Toggle word wrap
You can then stop the client using the osgi:stop console command. For example:
JBossFuse:karaf@root> stop 284
Copy to Clipboard Toggle word wrap
To shut down the container completely, enter the following console command:
JBossFuse:karaf@root> shutdown -f
Copy to Clipboard Toggle word wrap

Running the other demonstrations

The remaining demonstrations are all based on the Camel CXF component. You can only run one of these demonstrations at a time, because they all use the same Web service port and would clash, if started at the same time:
  • customer-ws-camel-cxf-pojo
  • customer-ws-camel-cxf-payload
  • customer-ws-camel-cxf-provider
The preceding demonstrations all require the Camel CXF component and some of them require the Camel Velocity component as well. Before you run the demonstrations, you must install the requisite features for these Camel components, as follows:
JBossFuse:karaf@root> features:install camel-cxf
JBossFuse:karaf@root> features:install camel-velocity
Copy to Clipboard Toggle word wrap
You can test these demonstrations using the provided customer-ws-client client or using the third-party SoapUI utility.
맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat