Web-service_types.js

The Web-service_types.js file uses the class structure provided by the Classes.js file to construct all the classes used by the Web service. This includes both Array classes and normal classes. These classes are exposed to the user and are needed to invoke Web service calls where the parameters of the method are not primitive types; for example, a CustWeb provider in JADE has the following Web service method.

addCustomers(CustomerArray) webService;

The CustomerArray class is an array of Customer objects. The Customer class has name and age properties defined. The Web service is invoked from JavaScript, using the generated framework as follows.

var cust1 = new Jade.CustWeb_Types.Customer(); // Create the customer
cust1.name("Harold");
cust1.age(31);
var custArr = new Jade.CustWeb_Types.CustomerArray(); // Create the array
custArr.Add(cust1);
Jade.CustWeb.addCustomers(custArr, {callback:function(){// Invoke service
    alert("Successfully added the customer");}
});