spacer

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

home / experts / javascript / column99


Web Services, Part IV: WebService Behavior's Objects, Properties, and Events

The Call Object (2)

Developer News
News Flash: Adobe Has iPhone Workaround
Adobe's Flash 10.1 Goes Mobile (Minus iPhone)
A Salute to Visionary CEOs

The password property specifies a password for Web services that requires user authentication. This property is case-sensitive and must match the userName property the very same call object. For this password to be in effect, remember to pass the call object as one of the parameters of callService().

The portName property specifies a port name through which you can access resources provided by a Web service. Here is an example for a port definition in a WSDL format:


<port name="TemperaturePort"
  binding="tns:TemperatureBinding">
  <soap:address location=
    "http://services.xmethods.net:80/soap/
      servlet/rpcrouter"/>
</port>

Usually, specifying the Web service port name is not needed. When you specify the Web service method, it determines the port name uniquely. The WSDL's binding attribute selects the right port for the specified Web service method. This property does not have a default, and you must pass the call object in callService() if you want to set it.

The SOAPHeader property specifies a SOAP header that will overwrite the default SOAP header normally generated by the WebService behavior. This property can be of three data structures:

  • A string containing a valid SOAP header
  • An XML node
  • A script object containing a valid SOAP header

Here is an example that shows how to assemble a SOAP header:

callObj.SOAPHeader = "<SOAP-ENV:Header>";
callObj.SOAPHeader += "<t:Transaction xmlns:t=
             'some-URI' SOAP-ENV:mustUnderstand='1'>";
callObj.SOAPHeader += 5;
callObj.SOAPHeader += "</t:Transaction>";
callObj.SOAPHeader += "</SOAP-ENV:Header>";  

The timeout property specifies a timeout period for a remote method invocation. Set it to the number of seconds you want the WebService behavior to wait for an answer from the remote Web service. To quit after two minutes, you will specify:

callObj.timeout = 120; 

The userName property specifies a user name for those Web services that require authentication. This property is case-sensitive and must correspond to the password property of the very same call object. The following two lines set both:

callObj.userName = "anonymous"
callObj.password = "none"

Next: How to use the WebService Behavior

Next: What are the result object's properties

http://www.internet.com

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

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

webref The latest from WebReference.com Browse >
Building a Banking Application Home Page with OOP · Mixing Scripting Languages · Review: phpFox, a Social Networking CMS with all the Bells and Whistles
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Enterprise 2.0: Social Networking in the Cloud · BroadSoft Marketplace Hastens Pace of Telephony Innovation · Review: HTC Hero for Sprint


Produced by Yehuda Shiran and Tomer Shiran
All Rights Reserved. Legal Notices.
Created: December 17, 2001
Revised: December 17, 2001

URL: http://www.webreference.com/js/column99/3.html