|
|
 |
The createCallOptions() method creates an object of options for the WebService behavior. Here is the syntax:
objCallOptions.createCallOptions(functionName, portName,
asyncMode, timeOut, userName, passWord, soapHeader,
endPoint, params);
where:
objCallOptions is the call options object returned by the method.
functionName is the Web service method you want to call.
portName is the port name associated with the Web service.
asyncMode is the calling mode. It can be true for asynchronous mode, and false for synchronous mode.
timeOut is the length of period in milliseconds during which the Web service will be called. If the Web service does not answer, the WebService will quit calling after this limit.
userName is the user name provided by the user for authenticating SSL-based Web sites.
passWord is the password provided by the user for authenticating SSL-based Web sites.
soapHeader is a user-given SOAP header. Not needed unless the user wants to overwrite the default header.
endPoint is a Boolean that tells WebService whether or not to go to another URL after calling the Web service. Set it to false if you don't want to go to some other URL.
params is a Boolean that should be set to false.
Each parameter translates into a property. Here is the definition of the function in WebService:
function createCallOptions(fn, pn, cm, to, un, pw,
hd, ep, pr) {
var o = new Object();
o.funcName = fn;
o.portName = pn;
o.async = cm;
o.timeout = to;
o.userName = un;
o.password = pw;
o.SOAPHeader= hd;
o.endpoint = ep;
o.params = pr;
return o;
}
Usually, you don't want to specify all nine function parameters. You have only a few that you want to explicitly overwrite. In the following example, we want to overwrite just the function name of the Web service, and make the call synchronous instead of the asynchronous default:
var co = webServiceCallerBody.createCallOptions();
co.funcName = "echoString";
co.async = false;
|