Skip to content

Example of how to use akka-camel and cxf in order to connect with Weather web services

License

Notifications You must be signed in to change notification settings

JSantosP/akka-camel-cxf-weather

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

About

Example of how to use akka-camel and cxf in order to connect with Weather web services

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published