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:
objCallOptionsis the call options object returned by the method.functionNameis the Web service method you want to call.portNameis the port name associated with the Web service.asyncModeis the calling mode. It can betruefor asynchronous mode, andfalsefor synchronous mode.timeOutis the length of period in milliseconds during which the Web service will be called. If the Web service does not answer, theWebServicewill quit calling after this limit.userNameis the user name provided by the user for authenticating SSL-based Web sites.passWordis the password provided by the user for authenticating SSL-based Web sites.soapHeaderis a user-given SOAP header. Not needed unless the user wants to overwrite the default header.endPointis a Boolean that tellsWebServicewhether or not to go to another URL after calling the Web service. Set it tofalseif you don't want to go to some other URL.paramsis 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: http://www.webreference.com/js/column98/5.html


