Web Services, Part III: WebService's Methods: The createCallOptions() Method - Doc JavaScript | WebReference

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:

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

https://www.internet.com


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