Wiki page
[Using Options] by
gerald
2012-11-04 18:33:29.
D 2012-11-04T18:33:29.761
L Using\sOptions
P 15a493c7b66027cd93227ef6870d867e6c942cd9
U gerald
W 6383
<TABLE class=toc id=toc>
<TR>
<TD>
<H2>Contents</H2></DIV>
<UL>
<LI class=toclevel-1><A href="#Overview"><SPAN class=toctext>Overview</SPAN></A>
<LI class=toclevel-1><A href="#Loading_the_Webservices_Utilities_Package"><SPAN class=toctext>Loading the Webservices Utilities Package</SPAN></A>
<LI class=toclevel-1><A href="#Options"> <SPAN class=toctext>Options</SPAN></A>
<UL>
<LI class=toclevel-2><A href="#UseNS"> <SPAN class=toctext>UseNS - put namespaces on field tags</SPAN></A>
<LI class=toclevel-2><A href="#StrictMode"> <SPAN class=toctext>StrictMode - WSDL processing mode</SPAN></A>
<LI class=toclevel-2><A href="#parseInAttr"><SPAN class=toctext>parseInAttr - parse attributes on inbound tags</SPAN></A>
<LI class=toclevel-2><A href="#genOutAttr"> <SPAN class=toctext>genOutAttr - generate attributes on outbound tags</SPAN></A>
<LI class=toclevel-2><A href="#useTypeNs"> <SPAN class=toctext>useTypeNs - use type's namespace prefix as prefix of elements</SPAN></A>
<LI class=toclevel-2><A href="#nsOnChangeOnly"> <SPAN class=toctext>nsOnChangeOnly - only put namespace prefix when namespaces change</SPAN></A>
<LI class=toclevel-2><A href="#suppressNS"> <SPAN class=toctext>suppressNS - do not put a particular namespace prefix</SPAN></A>
</UL>
<LI class=toclevel-1><A href="#SetOption"> <SPAN class=toctext>Access Routine</SPAN></A>
</UL>
<P>
</P>
<A name=Overview></A>
<H2>Overview</H2>
</P>
<P>The Webservices Client and Server packages make use of the following options:
<UL>
<LI><A href="#UseNS">UseNS</A>, when set the following options become relevant:
<UL>
<LI><A href="#useTypeNs">useTypeNs</A>
<LI><A href="#nsOnChangeOnly">nsOnChangeOnly</A>
<LI><A href="#suppressNS">suppressNS</A>
</UL>
<LI><A href="#StrictMode">StrictMode</A>
<LI><A href="#parseInAttr">parseInAttr</A>
<LI><A href="#genOutAttr">genOutAttr</A>
</UL>
</P>
<P>The attributes can be retrieved and set using <A href="#SetOption">::WS::Utils::SetOption</A>.</P>
<HR>
<A name=Loading_the_Webservices_Utilities_Package></A>
<H2>Loading the Webservices Utilities Package </H2>
<P>To load the webservices server package, do: </P><PRE> package require WS::Utils
</PRE>
<P>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. </P>
<HR>
<A name=UseNS></A>
<H2>UseNS - put namespaces on field tags </H2>
<P>
The <I>UseNS</I> option, if set to a "true" value, will put a namespace alias on all field tags.
</P>
<P>
The default value, "1", is for this option to be turned on.
</P>
<HR>
<A name=StrictMode></A>
<H2>StrictMode - WSDL processing mode </H2>
<P>
The <I>StrictMode</I> option determines what happens when an error is detected in parsing a WSDL. The legal values are:
<UL>
<LI><B>debug</B></LI>
<LI><B>warning</B></LI>
<LI><B>error</B></LI>
</UL>
</P>
<P>
If the <I>StrictMode</I> is set to <B>debug</B> or <B>warning</B>,
a message is logged using the ::log package at that level and the error is then ignored.
</P>
<P>
If the <I>StrictMode</I> is set to any value other than <B>debug</B> or <B>warning</B>,
a message is logged using the ::log package at the <B>error</B> level and exception is generated.
</P>
<P>
The default value is <B>error</B>.
</P>
<P>
A major use of this is to ignore namespace imports in a WDSL that do not actually import any definitions.
</P>
<HR>
<A name=parseInAttr></A>
<H2>parseInAttr - parse attributes on inbound tags </H2>
<P>
The <I>parseInAttr</I> 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. <B>{}</B>).
</P>
<P>
The default value, "0", is for this option to be turned off.
</P>
<HR>
<A name=useTypeNs></A>
<H2>useTypeNs - use type's namespace prefix as prefix of elements </H2>
<P>
The <I>useTypeNs</I> 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.
</P>
<P>
The default value, "0", is for this option to be turned off.
</P>
<HR>
<A name=nsOnChangeOnly></A>
<H2>nsOnChangeOnly - only put namespace prefix when namespaces change </H2>
<P>
The <I>nsOnChangeOnly</I> option, if set to a "true" value,
will only place namespace prefixes when the namespaces change.
</P>
<P>
The default value, "0", is for this option to be turned off.
</P>
<HR>
<A name=suppressNS></A>
<H2>suppressNS - do not put a given namespace prefix. </H2>
<P>
The <I>suppressNS</I> option, if set, will cause the given namespace to never be used as a prefix (i.e. tags that would normally have had the given prefix will not have any prefix).
</P>
<P>
The default value, "{}", is for this option to be turned off.
</P>
<HR>
<A name=genOutAttr></A>
<H2>genOutAttr - generate attributes on outbound tags </H2>
<P>
The <I>genOutAttr</I> 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. <B>{}</B>).
</P>
<P>
The default value, "0", is for this option to be turned off.
</P>
<HR>
<A name=SetOption></A>
<H2>Access Routine </H2>
<P><B>Procedure Name : <I>::WS::Utils::SetOption</I></B> </P>
<P><B>Description : </B> Retrieve or set an option </P>
<P><B>Arguments :</B> </P>
<PRE>
<I>option</I> - name of the option
<I>value</I> - value of the option (optional)
</PRE>
<P><B>Returns : The value of the option</B> </P>
<P><B>Side-Effects : None</B> </P>
<P><B>Exception Conditions :None</B> </P>
<P><B>Pre-requisite Conditions : None</B> </P>
<HR>
Z 6a53bb22afd6e68f1e9172b39da5a1f5