JavaScripts Generated from Web Services
The JavaScript Web Service Consumer Generator is primarily designed to aid JavaScript developers invoke JADE Web services. Within the JADE development environment, the developer selects a Web service to be accessed from JavaScript and the generator creates a number of JavaScript files, which enable the JavaScript developer to invoke that Web service.
The generator supports only Web services in the document/literal SOAP 1.1 format.
The generated files are downloaded and used on the client. The JavaScript developer can simply interact with the messages as though they were static methods. For example, a Web service provider application named CustomerService provides a JADE Web service method with the following signature.
addCustomer(firstName: String; lastName: String; age: Integer) webService;
The JavaScript code to add a customer would be as follows.
Jade.CustomerService.addCustomer("John", "Smith", 40);
In this example, Jade is the namespace specified by the user who generated the JavaScript.
The generated API also provides the following functionality.
-
Client-side cache
-
Session handling
-
Exception handling
-
Message preprocessing
-
A type-checked class framework