LibraryLink ToToggle FramesPrintFeedback

Chapter 4. Developing Services in JavaScript

JavaScript is a popular dynamic and lightweight programming language that enables developers to quickly create functionality that runs on a large number of platforms. FUSE Services Framework supports both services and clients in JavaScript. FUSE Services Framework embeds Rhino, which provides a friendly programming environment for JavaScript implementations of services. FUSE Services Framework also provides a generator that produces clients for web services with SOAP bindings.

The pattern used to develop services written in JavaScript is similar to JAX-WS provider implementations that handle requests and responses (either SOAP messages or SOAP payloads) as DOM documents.

Writing a service in JavaScript requires that you define the JAX-WS style metadata and implement the service's business logic. Java providers typically use Java annotations to specify JAX-WS metadata. Since JavaScript does not support annotations, you use ordinary JavaScript variables to specify metadata for JavaScript implementations. FUSE Services Framework treats any JavaScript variable in your code whose name equals or begins with WebServiceProvider as a JAX-WS metadata variable.

FUSE Services Framework provides tools for writing service consumers in JavaScript. These tools enable you to generate code from existing applications and download JavaScript from FUSE Services Framework-based services. JavaScript client-side support allows you to create JavaScript service consumers that can communicate natively with SOAP/HTTP service providers. The code generators produce proxy code and support classes for communicating directly with a service provider. Using the generated code, you can use JavaScript to build web applications that access the back end services. The consumers use asynchronous communication to access the services, making interaction as smooth as possible.

See the following references for more information: