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
Microsoft Shows Off Silverlight 4, IE9 Plans
Metasploit Expands Vulnerability Test Framework
HyperCard Reborn?

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

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

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

webref The latest from WebReference.com Browse >
Rolling Out Your Own HTML Application Version Control · HTML 5: Client-side Storage · Working with Ajax Server Extensions
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Wi-Fi Product Watch, November 2009 · Chip Market Recovering From '08 Collapse · Low-Cost Tools to Kickstart Your New Business


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