November 30, 2001 - Sending the Options Object to the Web Service | WebReference

November 30, 2001 - Sending the Options Object to the Web Service

Yehuda Shiran November 30, 2001
Sending the Options Object to the Web Service
Tips: November 2001

Yehuda Shiran, Ph.D.
Doc JavaScript

In order to persist the SSL authentication information, you need to create the useOptions object, and send it as the last (optional) parameter of useService(). Here is an example:

<SCRIPT LANGUAGE="JavaScript">
function init()
{
   var optionsObj = webServiceCallerBody.createUseOptions();
   optionsObj.reuseConnection = true;
   oProxy.useService(wsdl, aService, optionsObj);
}
</SCRIPT>
<BODY onload="init()" ID="webServiceCallerBody" style="behavior:url(webservice.htc)">
</BODY>
Notice the setting of the reuseConnection property to true. You can assign it directly during the object creation, as follows:

<SCRIPT LANGUAGE="JavaScript">
function init()
{
   var optionsObj = webServiceCallerBody.createUseOptions(true);
   oProxy.useService(wsdl, aService, optionsObj);
}
</SCRIPT>
<BODY onload="init()" ID="webServiceCallerBody" STYLE="behavior:url(webservice.htc)">
</BODY>