Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

CXF provides a lightweight container that allows you to deploy your Javascript and E4X services and take advantage of CXF's pluggable transport infrastructure.

Note
titleNote

Script based services can only work with SOAP messages. So, while they are multi-transport, they can only use the SOAP binding.

You deploy them services into the container using the following command:

Panel

java org.

...

apache.

...

cxf.js.rhino.ServerApp [ -

...

a addressURL ] [ -b baseAddressURL ] file.js [ file2.

...

js file3.jsx ... ]

The org.objectwebapache.celtixcxf.js.rhino.ServerApp class, shorted to ServerApp below, takes one or more Javascript files, suffixed with a .js, or E4X files, suffixed with a .jsx, and loads them into the Celtix CXF runtime. If ServerApp locates JAX-WS metadata in the files it creates and registers a JAX-WS Provider<DOMSource> object for each service. The Provider<DOMSource> object delegates the processing of requests to the implementation stored in the associated file. ServerApp can also take the name of a directory containing Javascript and E4X files. It will load all of the scripts that contain JAX-WS metadata, load them, and publish a service endpoint for each one.

ServerApp has three optional arguments:

Argument

Description

-a addressURL

Specifies the address at which ServerApp publishes the service endpoint implementation found in the script file following the URL.

-b baseAddressURL

Specifies the base address used by ServerApp when publishing the service endpoints defined by the script files. The full address for the service endpoints is formed by appending the service's port name to the base address.

-v

Specifies that {ServerApp is to run in verbose mode.

...

The optional arguments take precedence over any addressing information provided in {{EndpointAddress}}properties that appear in the JAX-WS metadata.

For example, if you deployed a Javascript service using the command shown in Example 4, your service would be deployed at http://celtixcxf.objectwebapache.org/goodnessImage Modified.

To deploy a number of services using a common base URL you could use the command shown in Example 5. If the service defined by hello_world.jsx had port name of helloWorld, ServerApp would publish it at http://celtixcxf.objectwebapache.org/helloWorldImage Modified. If the service defined by goodbye_moon.js had a port name of blue, ServerApp would publish at http://celtixcxf.objectwebapache.org/blueImage Modified.

You can also combine the arguments as shown in Example 6., your service would be deployed at http://celtixcxf.objectwebapache.org/goodnessImage Modified. ServerApp would publish three service endpoints: