Giter Club home page Giter Club logo

smx-ws-examples's Introduction

This projects contains a set of OSGi bundles that demonstrate web services in JBoss Fuse using CXF and Camel.

The following patterns are shown:

  • generating Java objects from a WSDL using the cxf-codegen-plugin wsdl2java command
  • a concrete CXF web service implementation
  • a Camel route that dynamically acts as a web service implementation
  • a Camel route that invokes a SOAP web service
  • a Camel route that acts as a web service proxy, taking requests and passing them to another web service

Project layout

The Maven projects contained within are as follows:

  • greeter-api - Contains a WSDL file from which Java objects are generated at build time.
  • ws-cxf-service - Contains a bundle with a concrete "naked" CXF service implementation; no Camel is used here.
  • ws-camel-service - Contains a bundle with a Camel CXF endpoint that picks up all requests from a web service and dynamically responds. No concrete implementation ins necessary here.
  • ws-camel-proxy - Contains a bundle with a Camel route that proxies requests from the bundle's CXF endpoint to a remote instance of the service.
  • ws-camel-client - Contains a Camel route that sends request on a round-robin basis between the services from the bundles above.

All of the above ws- bundles are based on Spring DM.

There are two additional parent projects that simplify the Maven project configuration:

  • ws-parent - used as parent by the web service bundles
  • ws-examples - Contains an XML features file used to install the rest of the bundles.

Prerequisites

Set up JBoss Fuse by downloading the latest (6.1.0) version from Red Hat. The installation guide can be reached from the Documentation tab on that page.

Ensure that Maven is set up on your system.

Installation

Download this project and run

smx-ws-examples> mvn clean install

Start up Fuse

$JBOSS_FUSE_HOME> bin/fuse console

      _ ____                  ______
     | |  _ \                |  ____|
     | | |_) | ___  ___ ___  | |__ _   _ ___  ___
 _   | |  _ < / _ \/ __/ __| |  __| | | / __|/ _ \
| |__| | |_) | (_) \__ \__ \ | |  | |_| \__ \  __/
 \____/|____/ \___/|___/___/ |_|   \__,_|___/\___|

  JBoss Fuse (6.1.0.redhat-312)
  http://www.redhat.com/products/jbossenterprisemiddleware/fuse/

Hit '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '<ctrl-d>' or 'osgi:shutdown' to shutdown JBoss Fuse.

Install the smx-ws-examples features file. This gets pulled out from your local Maven repository, and defines which bundles you mean to install for the example project.

JBossFuse:karaf@root> features:addurl mvn:com.fusesource.examples/ws-features/1.0-SNAPSHOT/xml/features

Install all of the necessary OSGi bundles by installing the smx-ws-examples feature

JBossFuse:karaf@root> features:install smx-ws-examples
JBossFuse:karaf@root> list | grep Examples
[ 225] [Active     ] [            ] [Started] [   60] ServiceMix Web Service Examples :: greeter-api (1.0.0.SNAPSHOT)
[ 226] [Active     ] [            ] [Started] [   60] ServiceMix Web Service Examples :: ws-cxf-service (1.0.0.SNAPSHOT)
[ 227] [Active     ] [            ] [Started] [   60] ServiceMix Web Service Examples :: ws-camel-service (1.0.0.SNAPSHOT)
[ 228] [Active     ] [            ] [Started] [   60] ServiceMix Web Service Examples :: ws-camel-proxy (1.0.0.SNAPSHOT)
[ 229] [Active     ] [            ] [Started] [   60] ServiceMix Web Service Examples :: ws-camel-client (1.0.0.SNAPSHOT)

Tail the logs and you should see the CXF invocations ticking over.

JBossFuse:karaf@root> log:Display

You can also verify that the web services are available by accessing the following from your browser:

smx-ws-examples's People

Contributors

kevinearls avatar gertv avatar jkorab avatar joshdreagan avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.