Example of how to use akka-camel and cxf in order to connect with Weather web services
Java Scala
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
project
res
src
tutorial
.travis.yml
LICENSE.txt
README.md
activator.properties
build.sbt

README.md

akka-camel-cxf-weather

Build Status

This is an example of how to integrate akka-camel and cxf in order to connect with Weather web services.

Weather WS is described at Weather Web Service

Java classes were generated using apache-cxf tool wsdl2java from weather wsdl file (located at res/Weather.wsdl). It can be used this way:

wsdl2java -client -d <output_directory> -p <package_name> -autoNameResolution <wsdl_file>

Once these JAXB-annotated Java classes are generated, a CamelProducer is defined using akka-camel module:

class MyProducerActor extends Actor {

  val camel = CamelExtension(context.system)

  val uri = "cxf:http://some.uri.with.ws"

  def receive = {

    case Request(body, headers) =>
      camel.template.requestBodyAndHeaders(uri, body, headers) match {

        case response => println(response)

      }

  }

}

And now you can send requests via message to this actor and it will forward them to camel for routing and processing both the request and possibly response.

You can get extra information at: