...
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 | ||
---|---|---|
| ||
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 |
---|
|
...
|
...
|
...
|
...
|
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 |
---|---|
| Specifies the address at which |
| Specifies the base address used by |
| Specifies that { |
...
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/goodness
.
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/helloWorld
. If the service defined by goodbye_moon.js
had a port name of blue
, ServerApp
would publish at http://
celtixcxf.
objectwebapache.org/blue
.
You can also combine the arguments as shown in Example 6., your service would be deployed at http://
celtixcxf.
objectwebapache.org/goodness
. ServerApp
would publish three service endpoints:
- The service defined by
hello_world.jsx
athttp://
celtixcxf.
objectwebapache.org/helloWorld
. - The service defined by
goodbye_moon.js
at {{http://celtix.objectweb.org/blue.
- The service defined by
chocolate.jsx
athttp://celtix.objectweb.org/goodness
.