spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / javascript / column98


Web Services, Part III: WebService's Methods

The createUseOptions() Method

Developer News
OpenOffice 3.2 Lands Amid Critical Changes
Red Hat, IBM Firmly in KVM Virtualization Camp
Red Hat Talks Up Open Source Cloud Plans

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 the ID of the element to which the WebService 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

http://www.internet.com


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

webref The latest from WebReference.com Browse >
Installing and Using Meeplace, the Business Review CMS · Sending an HTML and Plain Text E-newsletter with ASP.NET, Part 2 · Create Multilingual Web Sites with Windows Unicode Fonts
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Telehealth Takes Hold In Upstate New York · Ten Wi-Fi Security Threats to Monitor · SanDisk's SSD As Rapid As It Is Reliable


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/4.html