pp108 : makeAndSetRequest()

makeAndSetRequest()


It creates a request with the specified parameters at runtime and sets it to the model.

Syntax

Script

modelID.makeAndSetRequest(sMethodName, sRequestNamespace, aParameters, sMethodType)


Parameters

Parameter

Description

sMethodName

String that denotes the name of the method.

sRequestNamespace

String that denotes the namespace of the methodset to which this method belongs.

aParameters

Object array that denotes the parameters that is to be set to the request. This is a parameter indexed array which contains values and can be retrieved on the name of the parameter.

sMethodType

String that denotes the type of the method to be created. Possible values can be

  • get: A method is created of type GET request.
  • next: A method is created of type NEXT request.
  • previous: A method is created of type PREVIOUS request.


Return Value


No value is returned.

Remarks


This method can be used when the nature of the request and the method involved or the parameter and their values are not known, or are dependent upon some other data. This creates a SOAP Request which is automatically set to the method type mentioned in the method.

Example

This sample code demonstrates how the method can be used.

//Create instance and model
var newInstance = WebForm.getInstance("", "http://schemas.cordys.com/Employees", "Employees", application);
var newModel = WebForm.getModel(newInstance, "EmployeesModel");
//Create parameter array
var parameters = new Array();
parameters['EmployeeID'] = 1;
//Create and set for GET method
newModel.makeAndSetRequest("GetEmployeesObject", "http://schemas.cordys.com/Employees", parameters, "get");
newModel.getDataset();

Applies to


Model