Web Services, Part III: WebService's Methods: The createUseOptions() Method - Doc JavaScript
Web Services, Part III: WebService's Methods
The createUseOptions() Method
The WebService
behavior supports four methods:
crateUseOptions()
createCallOptions()
callService()
useService()
The first two methods create objects, while the latter two consumes these objects and pass them to the WebService
behavior. The createUseOptions()
method creates a useOptions
object, which tells the WebService
behavior whether to persist the connection authentication data for each remote method invocation. Here is the syntax:
objReuseConn = sElementID.createUseOptions ([boolReuseConn])
where:
sElementID
is theID
of the element to which theWebService
behavior is attached.boolReuseConn
is an optional Boolean, specifying whether the Secure Sockets Layer (SSL) authentication data is preserved for each remote method invocation.
The objReuseConn
object is of type useOptions
. The useOptions
object has a single property, reuseConnection
. This parameter can be either true
when the connection authentication persists, or false
when it does not persist. When the authentication persists, the user is not prompted again for the username and password before a repetitive transaction with a Web site that requires SSL.
Here is an example for enabling the authentication persistency by explicitly setting the reuseConnection
property:
<SCRIPT LANGUAGE="JavaScript"> function init() { var options = service.createUseOptions(); options.reuseConnection = true; oProxy.useService(wsdl, aService, options); } </SCRIPT> <BODY onload="init()"> <DIV ID="service" STYLE="behavior:url(webservice.htc)"> </DIV> </BODY>
In the following example, the reuseConnection
property is set to true
by passing a Boolean parameter to the createUseOptions
method:
<SCRIPT LANGUAGE="JavaScript"> function init() { var options = service.createUseOptions(true); oProxy.useService(wsdl, aService, options); } </SCRIPT> <BODY onload="init()"> <DIV ID="service" STYLE="behavior:url(webservice.htc)"> </DIV> </BODY>
Next: How to use the createCallOptions() 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/4.html