Update of ”Using Options”
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview

Artifact ID: 15a493c7b66027cd93227ef6870d867e6c942cd9
Page Name:Using Options
Date: 2012-11-04 18:24:00
Original User: gerald
Parent: d2b67099cdb68873b5fb4e1be9a33586d583dfad (diff)
Next 44b14002853ff23308fadebf39eac8a4b7ea2b38
Content

Contents

Overview

The Webservices Client and Server packages make use of the following options:

The attributes can be retrieved and set using ::WS::Utils::SetOption.


Loading the Webservices Utilities Package

To load the webservices server package, do:

 package require WS::Utils

This command will only load the utilities the first time it is used, so it causes no ill effects to put this in each file using the utilties.


UseNS - put namespaces on field tags

The UseNS option, if set to a "true" value, will put a namespace alias on all field tags.

The default value, "1", is for this option to be turned on.


StrictMode - WSDL processing mode

The StrictMode option determines what happens when an error is detected in parsing a WSDL. The legal values are:

  • debug
  • warning
  • error

If the StrictMode is set to debug or warning, a message is logged using the ::log package at that level and the error is then ignored.

If the StrictMode is set to any value other than debug or warning, a message is logged using the ::log package at the error level and exception is generated.

The default value is error.

A major use of this is to ignore namespace imports in a WDSL that do not actually import any definitions.


parseInAttr - parse attributes on inbound tags

The parseInAttr option, if set to a "true" value, will convert all attributes of inbound field tags to dictionary entries for that tag. The key will be the attribute name and the value will be the value of the attribute. The value of the tag will have an key of the null string (i.e. {}).

The default value, "0", is for this option to be turned off.


useTypeNs - use type's namespace prefix as prefix of elements

The useTypeNs option, if set to a "true" value, will use the prefix of the type's namespace instead of the prefix of the element's namespace.

The default value, "0", is for this option to be turned off.


nsOnChangeOnly - only put namespace prefix when namespaces change

The nsOnChangeOnly option, if set to a "true" value, will only place namespace prefixes when the namespaces change.

The default value, "0", is for this option to be turned off.


genOutAttr - generate attributes on outbound tags

The genOutAttr option, if set to a "true" value, will convert all dictionary keys of the entry for a given field tag to attribute value pairs of the tag in the outbound XML. The key will be the attribute name and the value will be the value of the attribute. The value of the tag will have a key of the null string (i.e. {}).

The default value, "0", is for this option to be turned off.


Access Routine

Procedure Name : ::WS::Utils::SetOption

Description : Retrieve or set an option

Arguments :

    option - name of the option
    value - value of the option (optional)

Returns : The value of the option

Side-Effects : None

Exception Conditions :None

Pre-requisite Conditions : None