Web Services, Part III: WebService's Methods: The createCallOptions() Method - Doc JavaScript
Web Services, Part III: WebService's Methods
The createCallOptions() Method
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 betrue
for asynchronous mode, andfalse
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, theWebService
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 tellsWebService
whether or not to go to another URL after calling the Web service. Set it tofalse
if you don't want to go to some other URL.params
is a Boolean that should be set tofalse
.
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;
Next: How to use the useService() method
Produced by Yehuda Shiran and Tomer Shiran
All Rights Reserved. Legal Notices.
Created: December 3, 2001
Revised: December 3, 2001
URL: https://www.webreference.com/js/column98/5.html