Check-in [150950db68]
Not logged in
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

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

Overview
Comment:Reduce non logging log impact by only building log message when logging. Requires tcllib log package 1.4 or included emulation. Ticket [93ebedfa]
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 150950db68b9163ae319eb252ff6005ada55b823af946bfb3720b15df50dd74f
User & Date: oehhar 2018-02-20 14:20:43
References
2018-02-20 14:23 Closed ticket [93ebedfa4a]: Replace log package by logger package plus 2 other changes artifact: c7f94a1d2f user: oehhar
Context
2018-05-28 11:16
Add support to translate distant namespace prefixes in attribute values or text values to local correspondances, required for abstract types. Ticket [584bfb77]: client.tcl 2.5.1, utilities.tcl 2.4.2 check-in: e406ab9e21 user: oehhar tags: trunk
2018-02-20 21:31
First step to parse complex abstract type in wsdl. Bug [584bfb7727] check-in: 6975d0e818 user: oehhar tags: bug584bfb7727-abstract-type
2018-02-20 14:20
Reduce non logging log impact by only building log message when logging. Requires tcllib log package 1.4 or included emulation. Ticket [93ebedfa] check-in: 150950db68 user: oehhar tags: trunk
2018-01-08 17:37
Set package version to release version 2.5.0 check-in: 53f12a2aa1 user: oehhar tags: trunk, Release_2.5.0
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to Utilities.tcl.

    52     52               uplevel 1 [list set $var [lindex $inList $i]]
    53     53           }
    54     54           return [lrange $inList $numArgs end]
    55     55       }
    56     56   }
    57     57   
    58     58   package require log
           59  +
           60  +# Emulate the log::logsubst command introduced in log 1.4
           61  +if {![llength [info command ::log::logsubst]]} {
           62  +    if {![llength [info command ::tailcall]]} {
           63  +        proc ::log::logsubst {level text} {
           64  +            if {[::log::lvIsSuppressed $level]} {
           65  +                return
           66  +            }
           67  +            ::log::log $level [uplevel 1 [list subst $text]]
           68  +        }
           69  +    } else {
           70  +        proc ::log::logsubst {level text} {
           71  +            if {[::log::lvIsSuppressed $level]} {
           72  +                return
           73  +            }
           74  +            tailcall ::log::log $level [uplevel 1 [list subst $text]]
           75  +        }
           76  +    }
           77  +}
           78  +
    59     79   package require tdom 0.8
    60     80   package require struct::set
    61     81   
    62         -package provide WS::Utils 2.4.0
           82  +package provide WS::Utils 2.4.1
    63     83   
    64     84   namespace eval ::WS {}
    65     85   
    66     86   namespace eval ::WS::Utils {
    67     87       set ::WS::Utils::typeInfo {}
    68     88       set ::WS::Utils::currentSchema {}
    69     89       array set ::WS::Utils::importedXref {}
................................................................................
   295    315       variable options
   296    316   
   297    317       if {[llength $args] == 0} {
   298    318           ::log::log debug {Return all options}
   299    319           return [array get options]
   300    320       } elseif {[llength $args] == 1} {
   301    321           set opt [lindex $args 0]
   302         -        ::log::log debug "One Option {$opt}"
          322  +        ::log::logsubst debug {One Option {$opt}}
   303    323           if {[info exists options($opt)]} {
   304    324               return $options($opt)
   305    325           } else {
   306         -            ::log::log debug "Unkown option {$opt}"
          326  +            ::log::logsubst debug {Unkown option {$opt}}
   307    327               return \
   308    328                   -code error \
   309    329                   -errorcode [list WS CLIENT UNKOPTION $opt] \
   310    330                   "Unknown option'$opt'"
   311    331           }
   312    332       } elseif {([llength $args] % 2) == 0} {
   313    333           ::log::log debug {Multiple option pairs}
   314    334           foreach {opt value} $args {
   315    335               if {[info exists options($opt)]} {
   316         -                ::log::log debug "Setting Option {$opt} to {$value}"
          336  +                ::log::logsubst debug {Setting Option {$opt} to {$value}}
   317    337                   set options($opt) $value
   318    338               } else {
   319         -                ::log::log debug "Unkown option {$opt}"
          339  +                ::log::logsubst debug {Unkown option {$opt}}
   320    340                   return \
   321    341                       -code error \
   322    342                       -errorcode [list WS CLIENT UNKOPTION $opt] \
   323    343                       "Unknown option'$opt'"
   324    344               }
   325    345           }
   326    346       } else {
   327         -        ::log::log debug "Bad number of arguments {$args}"
          347  +        ::log::logsubst debug {Bad number of arguments {$args}}
   328    348           return \
   329    349               -code error \
   330    350               -errorcode [list WS CLIENT INVARGCNT $args] \
   331    351               "Invalid argument count'$args'"
   332    352       }
   333    353       return;
   334    354   }
................................................................................
   376    396   # Version     Date     Programmer   Comments / Changes / Reasons
   377    397   # -------  ----------  ----------   -------------------------------------------
   378    398   #       1  07/06/2006  G.Lester     Initial version
   379    399   #
   380    400   #
   381    401   ###########################################################################
   382    402   proc ::WS::Utils::ServiceTypeDef {mode service type definition {xns {}} {abstract {false}}} {
   383         -    ::log::log debug [info level 0]
          403  +    ::log::logsubst debug {Entering [info level 0]}
   384    404       variable typeInfo
   385    405   
   386    406       if {![string length $xns]} {
   387    407           set xns $service
   388    408       }
   389    409       if {[llength [split $type {:}]] == 1} {
   390    410           set type $xns:$type
................................................................................
   507    527   #
   508    528   #
   509    529   ###########################################################################
   510    530   proc ::WS::Utils::ServiceSimpleTypeDef {mode service type definition {xns {tns1}}} {
   511    531       variable simpleTypes
   512    532       variable typeInfo
   513    533   
   514         -    ::log::log debug [info level 0]
          534  +    ::log::logsubst debug {Entering [info level 0]}
   515    535       if {![dict exists $definition xns]} {
   516    536           set simpleTypes($mode,$service,$type) [concat $definition xns $xns]
   517    537       } else {
   518    538           set simpleTypes($mode,$service,$type) $definition
   519    539       }
   520    540       if {[dict exists $typeInfo $mode $service $type]} {
   521         -        ::log::log debug "\t Unsetting typeInfo $mode $service $type"
   522         -        ::log::log debug "\t Was [dict get $typeInfo $mode $service $type]"
          541  +        ::log::logsubst debug {\t Unsetting typeInfo $mode $service $type}
          542  +        ::log::logsubst debug {\t Was [dict get $typeInfo $mode $service $type]}
   523    543           dict unset typeInfo $mode $service $type
   524    544       }
   525    545       return;
   526    546   }
   527    547   
   528    548   ###########################################################################
   529    549   #
................................................................................
   593    613           ::log::log debug "@1"
   594    614           set results [dict get $typeInfo $mode $service]
   595    615       } else {
   596    616           set typeInfoList [TypeInfo $mode $service $type]
   597    617           if {[string equal -nocase -length 3 $type {xs:}]} {
   598    618               set type [string range $type 3 end]
   599    619           }
   600         -        ::log::log debug "Type = {$type} typeInfoList = {$typeInfoList}"
          620  +        ::log::logsubst debug {Type = {$type} typeInfoList = {$typeInfoList}}
   601    621           if {[info exists simpleTypes($mode,$service,$type)]} {
   602    622               ::log::log debug "@2"
   603    623               set results $simpleTypes($mode,$service,$type)
   604    624           } elseif {[info exists simpleTypes($type)]} {
   605    625               ::log::log debug "@3"
   606    626               set results [list type xs:$type xns xs]
   607    627           } elseif {[dict exists $typeInfo $mode $service $service:$type]} {
................................................................................
   743    763   # Version     Date     Programmer   Comments / Changes / Reasons
   744    764   # -------  ----------  ----------   -------------------------------------------
   745    765   #       1  08/06/2006  G.Lester     Initial version
   746    766   #
   747    767   #
   748    768   ###########################################################################
   749    769   proc ::WS::Utils::ProcessImportXml {mode baseUrl xml serviceName serviceInfoVar tnsCountVar} {
   750         -    ::log::log debug "Entering ProcessImportXml $mode $baseUrl xml $serviceName $serviceInfoVar $tnsCountVar"
          770  +    ::log::logsubst debug {Entering [info level 0]}
   751    771       upvar 1 $serviceInfoVar serviceInfo
   752    772       upvar 1 $tnsCountVar tnsCount
   753    773       variable currentSchema
   754    774       variable xsltSchemaDom
   755    775   
   756    776       set first [string first {<} $xml]
   757    777       if {$first > 0} {
................................................................................
   829    849   ###########################################################################
   830    850   proc ::WS::Utils::ProcessIncludes {rootNode baseUrl {includePath {}}} {
   831    851       variable xsltSchemaDom
   832    852       variable nsList
   833    853       variable options
   834    854       variable includeArr
   835    855   
   836         -    ::log::log debug "ProcessIncludes base: {$baseUrl} inculde: {$includePath}"
          856  +    ::log::logsubst debug {Entering [info level 0]}
   837    857   
   838    858       set includeNodeList [concat \
   839    859                               [$rootNode selectNodes -namespaces $nsList descendant::xs:include] \
   840    860                               [$rootNode selectNodes -namespaces $nsList descendant::w:include] \
   841    861       ]
   842    862       set inXml [$rootNode asXML]
   843    863       set included 0
   844    864       foreach includeNode $includeNodeList {
   845         -        ::log::log debug "\t Processing Include [$includeNode asXML]"
          865  +        ::log::logsubst debug {\t Processing Include [$includeNode asXML]}
   846    866           if {[$includeNode hasAttribute schemaLocation]} {
   847    867               set urlTail [$includeNode getAttribute schemaLocation]
   848    868               set url [::uri::resolve $baseUrl  $urlTail]
   849    869           } elseif {[$includeNode hasAttribute location]} {
   850    870               set url [$includeNode getAttribute location]
   851    871               set urlTail [file tail [dict get [::uri::split $url] path]]
   852    872           } else {
   853    873               continue
   854    874           }
   855    875           if {[lsearch -exact $includePath $url] != -1} {
   856         -            log::log warning "Include loop detected: [join $includePath { -> }]"
          876  +            log::logsubst warning {Include loop detected: [join $includePath { -> }]}
   857    877               continue
   858    878           } elseif {[info exists includeArr($url)]} {
   859    879               continue
   860    880           } else {
   861    881               set includeArr($url) 1
   862    882           }
   863    883           incr included
   864         -        ::log::log info "\t Including {$url} from base {$baseUrl}"
          884  +        ::log::logsubst info {\t Including {$url} from base {$baseUrl}}
   865    885           switch -exact -- [dict get [::uri::split $url] scheme] {
   866    886               file {
   867    887                   upvar #0 [::uri::geturl $url] token
   868    888                   set xml $token(data)
   869    889                   unset token
   870    890               }
   871    891               https -
   872    892               http {
   873    893                   set ncode -1
   874    894                   catch {
   875         -                    ::log::log info [list ::http::geturl $url]
          895  +                    ::log::logsubst info {[list ::http::geturl $url]}
   876    896                       set token [::http::geturl $url]
   877    897                       ::http::wait $token
   878    898                       set ncode [::http::ncode $token]
   879    899                       set xml [::http::data $token]
   880         -                    ::log::log info "Received Ncode = ($ncode), $xml"
          900  +                    ::log::logsubst info {Received Ncode = ($ncode), $xml}
   881    901                       ::http::cleanup $token
   882    902                   }
   883    903                   if {($ncode != 200) && [string equal $options(includeDirectory) {}]} {
   884    904                       return \
   885    905                           -code error \
   886    906                           -errorcode [list WS CLIENT HTTPFAIL $url $ncode] \
   887    907                           "HTTP get of import file failed '$url'"
................................................................................
  1236   1256           $parent appendChild [$doc createElement xs:schema schema]
  1237   1257       }
  1238   1258       $schema setAttribute \
  1239   1259           elementFormDefault qualified \
  1240   1260           targetNamespace $targetNamespace
  1241   1261   
  1242   1262       foreach baseType [lsort -dictionary [array names typeArr]] {
  1243         -        ::log::log debug "Outputing $baseType"
         1263  +        ::log::logsubst debug {Outputing $baseType}
  1244   1264           $schema appendChild [$doc createElement xs:element elem]
  1245   1265           set name [lindex [split $baseType {:}] end]
  1246   1266           $elem setAttribute name $name
  1247   1267           $elem setAttribute type $baseType
  1248   1268           $schema appendChild [$doc createElement xs:complexType comp]
  1249   1269           $comp setAttribute name $name
  1250   1270           $comp appendChild [$doc createElement xs:sequence seq]
  1251   1271           set baseTypeInfo [dict get $localTypeInfo $baseType definition]
  1252         -        ::log::log debug "\t parts {$baseTypeInfo}"
         1272  +        ::log::logsubst debug {\t parts {$baseTypeInfo}}
  1253   1273           foreach {field tmpTypeInfo} $baseTypeInfo {
  1254   1274               $seq appendChild  [$doc createElement xs:element tmp]
  1255   1275               set tmpType [dict get $tmpTypeInfo type]
  1256         -            ::log::log debug "Field $field of $tmpType"
         1276  +            ::log::logsubst debug {Field $field of $tmpType}
  1257   1277               foreach {name value} [getTypeWSDLInfo $mode $serviceName $field $tmpType] {
  1258   1278                   $tmp setAttribute $name $value
  1259   1279               }
  1260   1280           }
  1261   1281       }
  1262   1282   }
  1263   1283   
................................................................................
  1371   1391   
  1372   1392       if {$options(valueAttrCompatiblityMode)} {
  1373   1393           set valueAttr {}
  1374   1394       } else {
  1375   1395           set valueAttr {::value}
  1376   1396       }
  1377   1397       set xsiNsUrl {http://www.w3.org/2001/XMLSchema-instance}
  1378         -    ::log::log debug [list ::WS::Utils::convertTypeToDict $mode $serviceName $node $type $root $isArray]
         1398  +    ::log::logsubst debug {Entering [info level 0]}
  1379   1399       if {[dict exists $typeInfo $mode $serviceName $type]} {
  1380   1400           set typeName $type
  1381   1401       } elseif {[dict exists $typeInfo $mode $serviceName $serviceName:$type]} {
  1382   1402           set typeName $serviceName:$type
  1383   1403       } else {
  1384   1404           ##
  1385   1405           ## Assume this is a simple type
................................................................................
  1389   1409               set results [$node asXML]
  1390   1410           } else {
  1391   1411               set results [$node asText]
  1392   1412           }
  1393   1413           return $results
  1394   1414       }
  1395   1415       set typeDefInfo [dict get $typeInfo $mode $serviceName $typeName]
  1396         -    ::log::log debug "\t type def = {$typeDefInfo}"
         1416  +    ::log::logsubst debug {\t type def = {$typeDefInfo}}
  1397   1417       set xns [dict get $typeDefInfo xns]
  1398   1418       if {[$node hasAttribute href]} {
  1399   1419           set node [GetReferenceNode $root [$node getAttribute href]]
  1400   1420       }
  1401         -    ::log::log debug "\t XML of node is [$node asXML]"
         1421  +    ::log::logsubst debug {\t XML of node is [$node asXML]}
  1402   1422       if {[info exists mutableTypeInfo([list $mode $serviceName $typeName])]} {
  1403   1423           set type [(*)[lindex mutableTypeInfo([list $mode $serviceName $type]) 0] $mode $serviceName $typeName $xns $node]
  1404   1424           set typeDefInfo [dict get $typeInfo $mode $serviceName $typeName]
  1405         -        ::log::log debug "\t type def replaced with = {$typeDefInfo}"
         1425  +        ::log::logsubst debug {\t type def replaced with = {$typeDefInfo}}
  1406   1426       }
  1407   1427       set results {}
  1408   1428       #if {$options(parseInAttr)} {
  1409   1429       #    foreach attr [$node attributes] {
  1410   1430       #        if {[llength $attr] == 1} {
  1411   1431       #            dict set results $attr [$node getAttribute $attr]
  1412   1432       #        }
  1413   1433       #    }
  1414   1434       #}
  1415   1435       set partsList [dict keys [dict get $typeDefInfo definition]]
  1416         -    ::log::log debug "\t partsList is {$partsList}"
         1436  +    ::log::logsubst debug {\t partsList is {$partsList}}
  1417   1437       set arrayOverride [expr {$isArray && ([llength $partsList] == 1)}]
  1418   1438       foreach partName $partsList {
  1419   1439           set partType [dict get $typeDefInfo definition $partName type]
  1420   1440           set partType [string trimright $partType {?}]
  1421   1441           if {[dict exists $typeDefInfo definition $partName allowAny] && [dict get $typeDefInfo definition $partName allowAny]} {
  1422   1442               set allowAny 1
  1423   1443           } else {
................................................................................
  1436   1456               set typeInfo $savedTypeInfo
  1437   1457               continue
  1438   1458           }
  1439   1459           set partXns $xns
  1440   1460           catch {set partXns  [dict get $typeInfo $mode $serviceName $partType xns]}
  1441   1461           set typeInfoList [TypeInfo $mode $serviceName $partType]
  1442   1462           set tmpTypeInfo [::WS::Utils::GetServiceTypeDef $mode $serviceName $partType]
  1443         -        ::log::log debug "\tpartName $partName partType $partType xns $xns typeInfoList $typeInfoList"
         1463  +        ::log::logsubst debug {\tpartName $partName partType $partType xns $xns typeInfoList $typeInfoList}
  1444   1464           ##
  1445   1465           ## Try for fully qualified name
  1446   1466           ##
  1447         -        ::log::log debug "Trying #1 [list $node selectNodes $partXns:$partName]"
         1467  +        ::log::logsubst debug {Trying #1 [list $node selectNodes $partXns:$partName]}
  1448   1468           if {[catch {llength [set item [$node selectNodes $partXns:$partName]]} len] || ($len == 0)} {
  1449         -            ::log::log debug "Trying #2 [list $node selectNodes $xns:$partName]"
         1469  +            ::log::logsubst debug {Trying #2 [list $node selectNodes $xns:$partName]}
  1450   1470               if {[catch {llength [set item [$node selectNodes $xns:$partName]]} len] || ($len == 0)} {
  1451   1471                   ##
  1452   1472                   ## Try for unqualified name
  1453   1473                   ##
  1454         -                ::log::log debug "Trying #3 [list $node selectNodes $partName]"
         1474  +                ::log::logsubst debug {Trying #3 [list $node selectNodes $partName]}
  1455   1475                   if {[catch {llength [set item [$node selectNodes $partName]]} len] || ($len == 0)} {
  1456   1476                       ::log::log debug "Trying #4 -- search of children"
  1457   1477                       set item {}
  1458   1478                       set matchList [list $partXns:$partName  $xns:$partName $partName]
  1459   1479                       foreach childNode [$node childNodes] {
  1460   1480                           set nodeType [$childNode nodeType]
  1461         -                        ::log::log debug "\t\t Looking at {[$childNode localName],[$childNode nodeName]} ($allowAny,$isArray,$nodeType,$partName)"
         1481  +                        ::log::logsubst debug {\t\t Looking at {[$childNode localName],[$childNode nodeName]} ($allowAny,$isArray,$nodeType,$partName)}
  1462   1482                           # From SOAP1.1 Spec:
  1463   1483                           #    Within an array value, element names are not significant
  1464   1484                           # for distinguishing accessors. Elements may have any name.
  1465   1485                           # Here we don't need check the element name, just simple check
  1466   1486                           # it's a element node
  1467   1487                           if {$allowAny  || ($arrayOverride && [string equal $nodeType "ELEMENT_NODE"])} {
  1468         -                            ::log::log debug "\t\t Found $partName [$childNode asXML]"
         1488  +                            ::log::logsubst debug {\t\t Found $partName [$childNode asXML]}
  1469   1489                               lappend item $childNode
  1470   1490                           }
  1471   1491                       }
  1472   1492                       if {![string length $item]} {
  1473   1493                           ::log::log debug "\tSkipping"
  1474   1494                           continue
  1475   1495                       }
  1476   1496                   } else {
  1477         -                    ::log::log debug "\t\t Found [llength $item] $partName"
         1497  +                    ::log::logsubst debug {\t\t Found [llength $item] $partName}
  1478   1498                   }
  1479   1499               } else {
  1480         -                ::log::log debug "\t\t Found [llength $item] $partName"
         1500  +                ::log::logsubst debug {\t\t Found [llength $item] $partName}
  1481   1501               }
  1482   1502           } else {
  1483         -            ::log::log debug "\t\t Found [llength $item] $partName"
         1503  +            ::log::logsubst debug {\t\t Found [llength $item] $partName}
  1484   1504           }
  1485   1505           set origItemList $item
  1486   1506           set newItemList {}
  1487   1507           foreach item $origItemList {
  1488   1508               if {[$item hasAttribute href]} {
  1489   1509                   set oldXML [$item asXML]
  1490         -                ::log::log debug "\t\t Replacing: $oldXML"
         1510  +                ::log::logsubst debug {\t\t Replacing: $oldXML}
  1491   1511                   set item [GetReferenceNode $root [$item getAttribute href]]
  1492         -                ::log::log debug "\t\t With: [$item asXML]"
         1512  +                ::log::logsubst debug {\t\t With: [$item asXML]}
  1493   1513               }
  1494   1514               lappend newItemList $item
  1495   1515           }
  1496   1516           set item $newItemList
  1497   1517           set isAbstract false
  1498   1518           if {[dict exists $typeInfo $mode $serviceName $partType abstract]} {
  1499   1519               set isAbstract [dict get $typeInfo $mode $serviceName $partType abstract]
................................................................................
  1649   1669               default {
  1650   1670                   ##
  1651   1671                   ## Placed here to shut up tclchecker
  1652   1672                   ##
  1653   1673               }
  1654   1674           }
  1655   1675       }
  1656         -    ::log::log debug [list Leaving ::WS::Utils::convertTypeToDict with $results]
         1676  +    ::log::logsubst debug {Leaving ::WS::Utils::convertTypeToDict with $results}
  1657   1677       return $results
  1658   1678   }
  1659   1679   
  1660   1680   ###########################################################################
  1661   1681   #
  1662   1682   # Private Procedure Header - as this procedure is modified, please be sure
  1663   1683   #                            that you update this header block. Thanks.
................................................................................
  1741   1761   # Version     Date     Programmer   Comments / Changes / Reasons
  1742   1762   # -------  ----------  ----------   -------------------------------------------
  1743   1763   #       1  07/06/2006  G.Lester     Initial version
  1744   1764   #
  1745   1765   #
  1746   1766   ###########################################################################
  1747   1767   proc ::WS::Utils::convertDictToType {mode service doc parent dict type {forceNs 0} {enforceRequired 0}} {
  1748         -    ::log::log debug "Entering ::WS::Utils::convertDictToType $mode $service $doc $parent {$dict} $type"
  1749         -    # ::log::log debug "  Parent xml: [$parent asXML]"
         1768  +    ::log::logsubst debug {Entering [info level 0]}
         1769  +    # ::log::logsubst debug {  Parent xml: [$parent asXML]}
  1750   1770       variable typeInfo
  1751   1771       variable simpleTypes
  1752   1772       variable options
  1753   1773       variable standardAttributes
  1754   1774       variable currentNs
  1755   1775   
  1756   1776       if {!$options(UseNS)} {
................................................................................
  1760   1780       if {$options(valueAttrCompatiblityMode)} {
  1761   1781           set valueAttr {}
  1762   1782       } else {
  1763   1783           set valueAttr {::value}
  1764   1784       }
  1765   1785       set typeInfoList [TypeInfo $mode $service $type]
  1766   1786       set type [string trimright $type {?}]
  1767         -    ::log::log debug "\t typeInfoList = {$typeInfoList}"
         1787  +    ::log::logsubst debug {\t typeInfoList = {$typeInfoList}}
  1768   1788       if {[dict exists $typeInfo $mode $service $service:$type]} {
  1769   1789           set typeName $service:$type
  1770   1790       } else {
  1771   1791           set typeName $type
  1772   1792       }
  1773   1793       set itemList {}
  1774   1794       if {[lindex $typeInfoList 0] && [dict exists $typeInfo $mode $service $typeName definition]} {
................................................................................
  1797   1817                 set xns [dict get $simpleTypes($mode,$service,$currentNs:$typeName) xns]
  1798   1818               } else {
  1799   1819                 error "Simple type cannot be found: $typeName"
  1800   1820               }
  1801   1821               set itemList [list $type {type string}]
  1802   1822           }
  1803   1823       }
  1804         -    ::log::log debug "\titemList is {$itemList} in $xns"
         1824  +    ::log::logsubst debug {\titemList is {$itemList} in $xns}
  1805   1825       set entryNs $currentNs
  1806   1826       if {!$forceNs} {
  1807   1827           set currentNs $xns
  1808   1828       }
  1809   1829       set fieldList {}
  1810   1830       foreach {itemName itemDef} $itemList {
  1811   1831           set baseName [lindex [split $itemName {:}] end]
  1812   1832           lappend fieldList $itemName
  1813   1833           set itemType [dict get $itemDef type]
  1814         -        ::log::log debug "\t\titemName = {$itemName} itemDef = {$itemDef} itemType ={$itemType}"
         1834  +        ::log::logsubst debug {\t\titemName = {$itemName} itemDef = {$itemDef} itemType ={$itemType}}
  1815   1835           set typeInfoList [TypeInfo $mode $service $itemType 1]
  1816         -        ::log::log debug "Expr [list ![dict exists $dict $itemName] && ![dict exists $dict $baseName]]"
         1836  +        ::log::logsubst debug {Expr [list ![dict exists $dict $itemName] && ![dict exists $dict $baseName]]}
  1817   1837           if {![dict exists $dict $itemName] && ![dict exists $dict $baseName]} {
  1818         -            ::log::log debug "Neither {$itemName} nor {$baseName} are in dictionary {$dict}, skipping"
         1838  +            ::log::logsubst debug {Neither {$itemName} nor {$baseName} are in dictionary {$dict}, skipping}
  1819   1839               # If required parameters are being enforced and this field is not optional, throw an error
  1820   1840               if {$enforceRequired && ![lindex $typeInfoList 2]} {
  1821   1841                   error "Required field $itemName is missing from response"
  1822   1842               }
  1823   1843               continue
  1824   1844           } elseif {[dict exists $dict $baseName]} {
  1825   1845               set useName $baseName
................................................................................
  1837   1857           }
  1838   1858           if {$options(nsOnChangeOnly) && [string equal $itemXns $currentNs]} {
  1839   1859               set itemXns {}
  1840   1860           }
  1841   1861           foreach key [dict keys $itemDef] {
  1842   1862               if {[lsearch -exact $standardAttributes $key] == -1 && $key ne "isList" && $key ne "xns"} {
  1843   1863                   lappend attrList $key [dict get $itemDef $key]
  1844         -                ::log::log debug "key = {$key} standardAttributes = {$standardAttributes}"
         1864  +                ::log::logsubst debug {key = {$key} standardAttributes = {$standardAttributes}}
  1845   1865               }
  1846   1866           }
  1847         -        ::log::log debug "\t\titemName = {$itemName} itemDef = {$itemDef} typeInfoList = {$typeInfoList} itemXns = {$itemXns} tmpInfo = {$tmpInfo} attrList = {$attrList}"
         1867  +        ::log::logsubst debug {\t\titemName = {$itemName} itemDef = {$itemDef} typeInfoList = {$typeInfoList} itemXns = {$itemXns} tmpInfo = {$tmpInfo} attrList = {$attrList}}
  1848   1868           set isAbstract false
  1849   1869           set baseType [string trimright $itemType {()?}]
  1850   1870           if {$options(genOutAttr) && [dict exists $typeInfo $mode $service $baseType abstract]} {
  1851   1871               set isAbstract [dict get $typeInfo $mode $service $baseType abstract]
  1852   1872           }
  1853         -        ::log::log debug "\t\titemName = {$itemName} itemDef = {$itemDef} typeInfoList = {$typeInfoList} isAbstract = {$isAbstract}"
         1873  +        ::log::logsubst debug {\t\titemName = {$itemName} itemDef = {$itemDef} typeInfoList = {$typeInfoList} isAbstract = {$isAbstract}}
  1854   1874           # Strip the optional flag off the typeInfoList
  1855   1875           set typeInfoList [lrange $typeInfoList 0 1]
  1856   1876           switch -exact -- $typeInfoList {
  1857   1877               {0 0} {
  1858   1878                   ##
  1859   1879                   ## Simple non-array
  1860   1880                   ##
................................................................................
  1900   1920                       if {[string equal $itemXns $options(suppressNS)] || [string equal $itemXns {}]} {
  1901   1921                           $parent appendChild [$doc createElement $itemName retNode]
  1902   1922                       } else {
  1903   1923                           $parent appendChild [$doc createElement $itemXns:$itemName retNode]
  1904   1924                       }
  1905   1925                       if {$options(genOutAttr)} {
  1906   1926                           set dictList [dict keys $row]
  1907         -                        ::log::log debug "<$row> '$dictList'"
         1927  +                        ::log::logsubst debug {<$row> '$dictList'}
  1908   1928                           set resultValue {}
  1909   1929                           foreach attr [lindex [::struct::set intersect3 $standardAttributes $dictList] end] {
  1910   1930                               if {[string equal $attr $valueAttr]} {
  1911   1931                                   set resultValue [dict get $row $attr]
  1912   1932                               } elseif {[string match {::*} $attr]} {
  1913   1933                                   set baseAttr [string range $attr 2 end]
  1914   1934                                   set attrValue [dict get $row $attr]
................................................................................
  2034   2054           #    set dictList [dict keys $dict]
  2035   2055           #    foreach attr [lindex [::struct::set intersect3 $fieldList $dictList] end] {
  2036   2056           #        $parent setAttribute $attr [dict get $dict $attr]
  2037   2057           #    }
  2038   2058           #}
  2039   2059       }
  2040   2060       set currentNs $entryNs
  2041         -    ::log::log debug "Leaving ::WS::Utils::convertDictToType with xml: [$parent asXML]"
         2061  +    ::log::logsubst debug {Leaving ::WS::Utils::convertDictToType with xml: [$parent asXML]}
  2042   2062       return;
  2043   2063   }
  2044   2064   
  2045   2065   ###########################################################################
  2046   2066   #
  2047   2067   # Private Procedure Header - as this procedure is modified, please be sure
  2048   2068   #                            that you update this header block. Thanks.
................................................................................
  2079   2099   # Version     Date     Programmer   Comments / Changes / Reasons
  2080   2100   # -------  ----------  ----------   -------------------------------------------
  2081   2101   #       1  03/23/2011  J.Lawson     Initial version
  2082   2102   #
  2083   2103   #
  2084   2104   ###########################################################################
  2085   2105   proc ::WS::Utils::convertDictToJson {mode service doc dict type {enforceRequired 0}} {
  2086         -    ::log::log debug "Entering ::WS::Utils::convertDictToJson $mode $service $doc {$dict} $type"
         2106  +    ::log::logsubst debug {Entering [info level 0]}
  2087   2107       variable typeInfo
  2088   2108       variable simpleTypes
  2089   2109       variable simpleTypesJson
  2090   2110       variable options
  2091   2111       variable standardAttributes
  2092   2112   
  2093   2113       set typeInfoList [TypeInfo $mode $service $type]
................................................................................
  2110   2130           set typeInfoList [TypeInfo $mode $service $typeName]
  2111   2131           if {[lindex $typeInfoList 0]} {
  2112   2132               set itemList [dict get $typeInfo $mode $service $typeName definition]
  2113   2133           } else {
  2114   2134               set itemList [list $type {type string}]
  2115   2135           }
  2116   2136       }
  2117         -    ::log::log debug "\titemList is {$itemList}"
         2137  +    ::log::logsubst debug {\titemList is {$itemList}}
  2118   2138       set fieldList {}
  2119   2139       foreach {itemName itemDef} $itemList {
  2120   2140           lappend fieldList $itemName
  2121   2141           set itemType [dict get $itemDef type]
  2122         -        ::log::log debug "\t\titemName = {$itemName} itemDef = {$itemDef} itemType = {$itemType}"
         2142  +        ::log::logsubst debug {\t\titemName = {$itemName} itemDef = {$itemDef} itemType = {$itemType}}
  2123   2143           set typeInfoList [TypeInfo $mode $service $itemType 1]
  2124   2144           if {![dict exists $dict $itemName]} {
  2125   2145               if {$enforceRequired && ![lindex $typeInfoList 2]} {
  2126   2146                   error "Required field $itemName is missing from response"
  2127   2147               }
  2128   2148               continue
  2129   2149           }
................................................................................
  2130   2150   
  2131   2151           if {[info exists simpleTypesJson([string trimright $itemType {()?}])]} {
  2132   2152               set yajlType $simpleTypesJson([string trimright $itemType {()?}])
  2133   2153           } else {
  2134   2154               set yajlType "string"
  2135   2155           }
  2136   2156   
  2137         -        ::log::log debug "\t\titemName = {$itemName} itemDef = {$itemDef} typeInfoList = {$typeInfoList}"
         2157  +        ::log::logsubst debug {\t\titemName = {$itemName} itemDef = {$itemDef} typeInfoList = {$typeInfoList}}
  2138   2158           set typeInfoList [lrange $typeInfoList 0 1]
  2139   2159           switch $typeInfoList {
  2140   2160               {0 0} {
  2141   2161                   ##
  2142   2162                   ## Simple non-array
  2143   2163                   ##
  2144   2164                   set resultValue [dict get $dict $itemName]
................................................................................
  2224   2244   # Version     Date     Programmer   Comments / Changes / Reasons
  2225   2245   # -------  ----------  ----------   -------------------------------------------
  2226   2246   #       1  07/06/2006  G.Lester     Initial version
  2227   2247   #
  2228   2248   #
  2229   2249   ###########################################################################
  2230   2250   proc ::WS::Utils::convertDictToTypeNoNs {mode service doc parent dict type {enforceRequired 0}} {
  2231         -    ::log::log debug "Entering ::WS::Utils::convertDictToTypeNoNs $mode $service $doc $parent {$dict} $type"
         2251  +    ::log::logsubst debug {Entering [info level 0]}
  2232   2252       # ::log::log debug "  Parent xml: [$parent asXML]"
  2233   2253       variable typeInfo
  2234   2254       variable simpleTypes
  2235   2255       variable options
  2236   2256       variable standardAttributes
  2237   2257   
  2238   2258       if {$options(valueAttrCompatiblityMode)} {
................................................................................
  2250   2270           } elseif {[info exists simpleTypes($mode,$service,$currentNs:$type)]} {
  2251   2271             set xns [dict get $simpleTypes($mode,$service,$currentNs:$type) xns]
  2252   2272           } else {
  2253   2273             error "Simple type cannot be found: $type"
  2254   2274           }
  2255   2275           set itemList [list $type {type string}]
  2256   2276       }
  2257         -    ::log::log debug "\titemList is {$itemList}"
         2277  +    ::log::logsubst debug {\titemList is {$itemList}}
  2258   2278       foreach {itemName itemDef} $itemList {
  2259         -        ::log::log debug "\t\titemName = {$itemName} itemDef = {$itemDef}"
         2279  +        ::log::logsubst debug {\t\titemName = {$itemName} itemDef = {$itemDef}}
  2260   2280           set itemType [dict get $itemDef type]
  2261   2281           set isAbstract false
  2262   2282           set baseType [string trimright $itemType {()?}]
  2263   2283           if {$options(genOutAttr) && [dict exists $typeInfo $mode $service $baseType abstract]} {
  2264   2284               set isAbstract [dict get $typeInfo $mode $service $baseType abstract]
  2265   2285           }
  2266   2286           set typeInfoList [TypeInfo $mode $service $itemType 1]
................................................................................
  2270   2290               }
  2271   2291               continue
  2272   2292           }
  2273   2293           set attrList {}
  2274   2294           foreach key [dict keys $itemDef] {
  2275   2295               if {[lsearch -exact $standardAttributes $key] == -1 && $key ne "isList" && $key ne "xns"} {
  2276   2296                   lappend attrList $key [dict get $itemDef $key]
  2277         -                ::log::log debug "key = {$key} standardAttributes = {$standardAttributes}"
         2297  +                ::log::logsubst debug {key = {$key} standardAttributes = {$standardAttributes}}
  2278   2298               }
  2279   2299           }
  2280         -        ::log::log debug "\t\titemName = {$itemName} itemDef = {$itemDef} typeInfoList = {$typeInfoList}"
         2300  +        ::log::logsubst debug {\t\titemName = {$itemName} itemDef = {$itemDef} typeInfoList = {$typeInfoList}}
  2281   2301           set typeInfoList [lrange $typeInfoList 0 1]
  2282   2302           switch -exact -- $typeInfoList {
  2283   2303               {0 0} {
  2284   2304                   ##
  2285   2305                   ## Simple non-array
  2286   2306                   ##
  2287   2307                   $parent appendChild [$doc createElement $itemName retNode]
................................................................................
  2450   2470   # Version     Date     Programmer   Comments / Changes / Reasons
  2451   2471   # -------  ----------  ----------   -------------------------------------------
  2452   2472   #       1  07/06/2006  G.Lester     Initial version
  2453   2473   #
  2454   2474   #
  2455   2475   ###########################################################################
  2456   2476   proc ::WS::Utils::convertDictToEncodedType {mode service doc parent dict type} {
  2457         -    ::log::log debug "Entering ::WS::Utils::convertDictToEncodedType $mode $service $doc $parent {$dict} $type"
         2477  +    ::log::logsubst debug {Entering [info level 0]}
  2458   2478       variable typeInfo
  2459   2479       variable options
  2460   2480   
  2461   2481   
  2462   2482       set typeInfoList [TypeInfo $mode $service $type]
  2463         -    ::log::log debug "\t typeInfoList = {$typeInfoList}"
         2483  +    ::log::logsubst debug {\t typeInfoList = {$typeInfoList}}
  2464   2484       set type [string trimright $type {?}]
  2465   2485       if {[lindex $typeInfoList 0]} {
  2466   2486           set itemList [dict get $typeInfo $mode $service $type definition]
  2467   2487           set xns [dict get $typeInfo $mode $service $type xns]
  2468   2488       } else {
  2469   2489           if {[info exists simpleTypes($mode,$service,$type)]} {
  2470   2490             set xns [dict get $simpleTypes($mode,$service,$type) xns]
................................................................................
  2484   2504                 set xns [dict get $simpleTypes($mode,$service,$type) xns]
  2485   2505               } else {
  2486   2506                 error "Simple type cannot be found: $type"
  2487   2507               }
  2488   2508               set itemList [list $type {type string}]
  2489   2509           }
  2490   2510       }
  2491         -    ::log::log debug "\titemList is {$itemList} in $xns"
         2511  +    ::log::logsubst debug {\titemList is {$itemList} in $xns}
  2492   2512       foreach {itemName itemDef} $itemList {
  2493   2513           set itemType [string trimright [dict get $itemList $itemName type] {?}]
  2494   2514           set typeInfoList [TypeInfo $mode $service $itemType]
  2495         -        ::log::log debug "\t\t Looking for {$itemName} in {$dict}"
         2515  +        ::log::logsubst debug {\t\t Looking for {$itemName} in {$dict}}
  2496   2516           if {![dict exists $dict $itemName]} {
  2497   2517               ::log::log debug "\t\t Not found, skipping"
  2498   2518               continue
  2499   2519           }
  2500         -        ::log::log debug "\t\t Type info is {$typeInfoList}"
         2520  +        ::log::logsubst debug {\t\t Type info is {$typeInfoList}}
  2501   2521           switch -exact -- $typeInfoList {
  2502   2522               {0 0} {
  2503   2523                   ##
  2504   2524                   ## Simple non-array
  2505   2525                   ##
  2506   2526                   if {[string equal $xns $options(suppressNS)]} {
  2507   2527                       $parent appendChild [$doc createElement $itemName retNode]
................................................................................
  2630   2650   #
  2631   2651   #
  2632   2652   ###########################################################################
  2633   2653   proc ::WS::Utils::parseDynamicType {mode serviceName node type} {
  2634   2654       variable typeInfo
  2635   2655       variable nsList
  2636   2656   
  2637         -    ::log::log debug [list ::WS::Utils::parseDynamicType $mode $serviceName $node $type]
         2657  +    ::log::logsubst debug {Entering [info level 0]}
  2638   2658   
  2639   2659       foreach child [$node childNodes] {
  2640         -        ::log::log debug "\t Child $child is [$child nodeName]"
         2660  +        ::log::logsubst debug {\t Child $child is [$child nodeName]}
  2641   2661       }
  2642   2662   
  2643   2663       ##
  2644   2664       ## Get type being defined
  2645   2665       ##
  2646   2666       set schemeNode [$node selectNodes -namespaces $nsList xs:schema]
  2647   2667       set newTypeNode [$node selectNodes -namespaces $nsList  xs:schema/xs:element]
................................................................................
  2717   2737   # Version     Date     Programmer   Comments / Changes / Reasons
  2718   2738   # -------  ----------  ----------   -------------------------------------------
  2719   2739   #       1  08/06/2006  G.Lester     Initial version
  2720   2740   #
  2721   2741   #
  2722   2742   ###########################################################################
  2723   2743   proc ::WS::Utils::parseScheme {mode baseUrl schemaNode serviceName serviceInfoVar tnsCountVar} {
  2724         -    ::log::log debug "Entering :WS::Utils::parseScheme $mode $baseUrl $schemaNode $serviceName $serviceInfoVar $tnsCountVar"
         2744  +    ::log::logsubst debug {Entering [info level 0]}
  2725   2745   
  2726   2746       upvar 1 $tnsCountVar tnsCount
  2727   2747       upvar 1 $serviceInfoVar serviceInfo
  2728   2748       variable currentSchema
  2729   2749       variable nsList
  2730   2750       variable options
  2731   2751       variable unkownRef
  2732   2752   
  2733   2753       set currentSchema $schemaNode
  2734   2754       set tmpTargetNs $::WS::Utils::targetNs
  2735   2755       foreach attr [$schemaNode attributes] {
  2736   2756           set value {?}
  2737   2757           catch {set value [$schemaNode getAttribute $attr]}
  2738         -        ::log::log debug "Attribute $attr = $value"
         2758  +        ::log::logsubst debug {Attribute $attr = $value}
  2739   2759       }
  2740   2760       if {[$schemaNode hasAttribute targetNamespace]} {
  2741   2761           set xns [$schemaNode getAttribute targetNamespace]
  2742         -        ::log::log debug "In Parse Scheme, found targetNamespace attribute with {$xns}"
         2762  +        ::log::logsubst debug {In Parse Scheme, found targetNamespace attribute with {$xns}}
  2743   2763           set ::WS::Utils::targetNs $xns
  2744   2764       } else {
  2745   2765           set xns $::WS::Utils::targetNs
  2746   2766       }
  2747         -    ::log::log debug "@3a {$xns} {[dict get $serviceInfo tnsList url]}"
         2767  +    ::log::logsubst debug {@3a {$xns} {[dict get $serviceInfo tnsList url]}}
  2748   2768       if {![dict exists $serviceInfo tnsList url $xns]} {
  2749   2769           set tns [format {tns%d} [incr tnsCount]]
  2750   2770           dict set serviceInfo targetNamespace $tns $xns
  2751   2771           dict set serviceInfo tnsList url $xns $tns
  2752   2772           dict set serviceInfo tnsList tns $tns $tns
  2753   2773       } else {
  2754   2774           set tns [dict get $serviceInfo tnsList url $xns]
  2755   2775       }
  2756         -    ::log::log debug "@3 TNS count for $xns is $tnsCount {$tns}"
         2776  +    ::log::logsubst debug {@3 TNS count for $xns is $tnsCount {$tns}}
  2757   2777   
  2758   2778       set prevTnsDict [dict get $serviceInfo tnsList tns]
  2759   2779       dict set serviceInfo tns {}
  2760   2780       foreach itemList [$schemaNode attributes xmlns:*] {
  2761   2781           set ns [lindex $itemList 0]
  2762   2782           set url [$schemaNode getAttribute xmlns:$ns]
  2763   2783           if {[dict exists $serviceInfo tnsList url $url]} {
................................................................................
  2788   2808       ##
  2789   2809       ## Process the scheme in multiple passes to handle forward references and extensions
  2790   2810       ##
  2791   2811       set pass 1
  2792   2812       set lastUnknownRefCount 0
  2793   2813       array unset unkownRef
  2794   2814       while {($pass == 1) || ($lastUnknownRefCount != [array size unkownRef])} {
  2795         -        ::log::log debug  "Pass $pass over schema"
         2815  +        ::log::logsubst debug  {Pass $pass over schema}
  2796   2816           incr pass
  2797   2817           set lastUnknownRefCount [array size unkownRef]
  2798   2818           array unset unkownRef
  2799   2819   
  2800   2820           foreach element [$schemaNode selectNodes -namespaces $nsList xs:import] {
  2801   2821               if {[catch {processImport $mode $baseUrl $element $serviceName serviceInfo tnsCount} msg]} {
  2802         -                ::log::log notice "Import failed due to: {$msg}.  Trace: $::errorInfo"
         2822  +                ::log::logsubst notice {Import failed due to: {$msg}.  Trace: $::errorInfo}
  2803   2823               }
  2804   2824           }
  2805   2825   
  2806   2826           foreach element [$schemaNode selectNodes -namespaces $nsList w:import] {
  2807   2827               if {[catch {processImport $mode $baseUrl $element $serviceName serviceInfo tnsCount} msg]} {
  2808         -                ::log::log notice "Import failed due to: {$msg}.  Trace: $::errorInfo"
         2828  +                ::log::logsubst notice {Import failed due to: {$msg}.  Trace: $::errorInfo}
  2809   2829               }
  2810   2830           }
  2811   2831   
  2812         -        ::log::log debug  "Parsing Element types for $xns as $tns"
         2832  +        ::log::logsubst debug {Parsing Element types for $xns as $tns}
  2813   2833           foreach element [$schemaNode selectNodes -namespaces $nsList child::xs:element] {
  2814         -            ::log::log debug "\tprocessing $element"
         2834  +            ::log::logsubst debug {\tprocessing $element}
  2815   2835               if {[catch {parseElementalType $mode serviceInfo $serviceName $element $tns} msg]} {
  2816         -                ::log::log notice "Unhandled error: {$msg}.  Trace: $::errorInfo"
         2836  +                ::log::logsubst notice {Unhandled error: {$msg}.  Trace: $::errorInfo}
  2817   2837               }
  2818   2838           }
  2819   2839   
  2820         -        ::log::log debug  "Parsing Attribute types for $xns as $tns"
         2840  +        ::log::logsubst debug {Parsing Attribute types for $xns as $tns}
  2821   2841           foreach element [$schemaNode selectNodes -namespaces $nsList child::xs:attribute] {
  2822         -            ::log::log debug "\tprocessing $element"
         2842  +            ::log::logsubst debug {\tprocessing $element}
  2823   2843               if {[catch {parseElementalType $mode serviceInfo $serviceName $element $tns} msg]} {
  2824         -                ::log::log notice "Unhandled error: {$msg}.  Trace: $::errorInfo"
         2844  +                ::log::logsubst notice {Unhandled error: {$msg}.  Trace: $::errorInfo}
  2825   2845               }
  2826   2846           }
  2827   2847   
  2828         -        ::log::log debug "Parsing Simple types for $xns as $tns"
         2848  +        ::log::logsubst debug {Parsing Simple types for $xns as $tns}
  2829   2849           foreach element [$schemaNode selectNodes -namespaces $nsList child::xs:simpleType] {
  2830         -            ::log::log debug "\tprocessing $element"
         2850  +            ::log::logsubst debug {\tprocessing $element}
  2831   2851               if {[catch {parseSimpleType $mode serviceInfo $serviceName $element $tns} msg]} {
  2832         -                ::log::log notice "Unhandled error: {$msg}.  Trace: $::errorInfo"
         2852  +                ::log::logsubst notice {Unhandled error: {$msg}.  Trace: $::errorInfo}
  2833   2853               }
  2834   2854           }
  2835   2855   
  2836         -        ::log::log debug  "Parsing Complex types for $xns as $tns"
         2856  +        ::log::logsubst debug {Parsing Complex types for $xns as $tns}
  2837   2857           foreach element [$schemaNode selectNodes -namespaces $nsList child::xs:complexType] {
  2838         -            ::log::log debug "\tprocessing $element"
         2858  +            ::log::logsubst debug {\tprocessing $element}
  2839   2859               if {[catch {parseComplexType $mode serviceInfo $serviceName $element $tns} msg]} {
  2840         -                ::log::log notice "Unhandled error: {$msg}.  Trace: $::errorInfo"
         2860  +                ::log::logsubst notice {Unhandled error: {$msg}.  Trace: $::errorInfo}
  2841   2861               }
  2842   2862           }
  2843   2863       }
  2844   2864   
  2845   2865       set lastUnknownRefCount [array size unkownRef]
  2846   2866       foreach {unkRef usedByTypeList} [array get unkownRef] {
  2847   2867           foreach usedByType $usedByTypeList {
  2848   2868               switch -exact -- $options(StrictMode) {
  2849   2869                   debug -
  2850   2870                   warning {
  2851         -                    log::log $options(StrictMode) "Unknown type reference $unkRef in type $usedByType"
         2871  +                    ::log::logsubst $options(StrictMode) {Unknown type reference $unkRef in type $usedByType}
  2852   2872                   }
  2853   2873                   error -
  2854   2874                   default {
  2855         -                    log::log error "Unknown type reference $unkRef in type $usedByType"
         2875  +                    ::log::logsubst error {Unknown type reference $unkRef in type $usedByType}
  2856   2876                   }
  2857   2877               }
  2858   2878           }
  2859   2879       }
  2860   2880   
  2861   2881       if {$lastUnknownRefCount} {
  2862   2882           switch -exact -- $options(StrictMode) {
  2863   2883               debug -
  2864   2884               warning {
  2865   2885                   set ::WS::Utils::targetNs $tmpTargetNs
  2866         -                ::log::log $options(StrictMode) "Found $lastUnknownRefCount forward type references: [join [array names unkownRef] {,}]"
         2886  +                ::log::logsubst $options(StrictMode) {Found $lastUnknownRefCount forward type references: [join [array names unkownRef] {,}]}
  2867   2887               }
  2868   2888               error -
  2869   2889               default {
  2870   2890                   set ::WS::Utils::targetNs $tmpTargetNs
  2871   2891                   return \
  2872   2892                       -code error \
  2873   2893                       -errorcode [list WS $mode UNKREFS [list $lastUnknownRefCount]] \
................................................................................
  2886   2906                               [$schemaNode selectNodes -namespaces $nsList w:import] \
  2887   2907       ]
  2888   2908       foreach element $importNodeList {
  2889   2909           if {[catch {processImport $mode $baseUrl $element $serviceName serviceInfo tnsCount} msg]} {
  2890   2910               switch -exact -- $options(StrictMode) {
  2891   2911                   debug -
  2892   2912                   warning {
  2893         -                    log::log $options(StrictMode) "Could not parse:\n [$element asXML]"
  2894         -                    log::log $options(StrictMode) "\t error was: $msg"
         2913  +                    ::log::logsubst $options(StrictMode) {Could not parse:\n [$element asXML]}
         2914  +                    ::log::logsubst $options(StrictMode) {\t error was: $msg}
         2915  +                }
         2916  +                error -
         2917  +                default {
         2918  +                    set errorCode $::errorCode
         2919  +                    set errorInfo $::errorInfo
         2920  +                    ::log::logsubst error {Could not parse:\n [$element asXML]}
         2921  +                    ::log::logsubst error {\t error was: $msg}
         2922  +                    ::log::logsubst error {\t error info: $errorInfo}
         2923  +                    ::log::logsubst error {\t error in: [lindex [info level 0] 0]}
         2924  +                    ::log::logsubst error {\t error code: $errorCode}
         2925  +                    set ::WS::Utils::targetNs $tmpTargetNs
         2926  +                    return \
         2927  +                        -code error \
         2928  +                        -errorcode $errorCode \
         2929  +                        -errorinfo $errorInfo \
         2930  +                        $msg
         2931  +                }
         2932  +            }
         2933  +        }
         2934  +    }
         2935  +
         2936  +    ::log::logsubst debug {Parsing Element types for $xns as $tns}
         2937  +    foreach element [$schemaNode selectNodes -namespaces $nsList child::xs:element] {
         2938  +        ::log::logsubst debug {\tprocessing $element}
         2939  +        if {[catch {parseElementalType $mode serviceInfo $serviceName $element $tns} msg]} {
         2940  +            switch -exact -- $options(StrictMode) {
         2941  +                debug -
         2942  +                warning {
         2943  +                    ::log::logsubst $options(StrictMode) {Could not parse:\n [$element asXML]}
         2944  +                    ::log::logsubst $options(StrictMode) {\t error was: $msg}
  2895   2945                   }
  2896   2946                   error -
  2897   2947                   default {
  2898   2948                       set errorCode $::errorCode
  2899   2949                       set errorInfo $::errorInfo
  2900         -                    log::log error "Could not parse:\n [$element asXML]"
  2901         -                    log::log error "\t error was: $msg"
  2902         -                    log::log error "\t error info: $errorInfo"
  2903         -                    log::log error "\t error in: [lindex [info level 0] 0]"
  2904         -                    log::log error "\t error code: $errorCode"
         2950  +                    ::log::logsubst error {Could not parse:\n [$element asXML]}
         2951  +                    ::log::logsubst error {\t error was: $msg}
         2952  +                    ::log::logsubst error {\t error info: $errorInfo}
         2953  +                    ::log::logsubst error {\t last element: $::elementName}
         2954  +                    ::log::logsubst error {\t error in: [lindex [info level 0] 0]}
         2955  +                    ::log::logsubst error {\t error code: $errorCode}
  2905   2956                       set ::WS::Utils::targetNs $tmpTargetNs
  2906   2957                       return \
  2907   2958                           -code error \
  2908   2959                           -errorcode $errorCode \
  2909   2960                           -errorinfo $errorInfo \
  2910   2961                           $msg
  2911   2962                   }
  2912   2963               }
  2913   2964           }
  2914   2965       }
  2915   2966   
  2916         -    ::log::log debug  "Parsing Element types for $xns as $tns"
  2917         -    foreach element [$schemaNode selectNodes -namespaces $nsList child::xs:element] {
  2918         -        ::log::log debug "\tprocessing $element"
         2967  +    ::log::logsubst debug {Parsing Attribute types for $xns as $tns}
         2968  +    foreach element [$schemaNode selectNodes -namespaces $nsList child::xs:attribute] {
         2969  +        ::log::logsubst debug {\tprocessing $element}
  2919   2970           if {[catch {parseElementalType $mode serviceInfo $serviceName $element $tns} msg]} {
  2920   2971               switch -exact -- $options(StrictMode) {
  2921   2972                   debug -
  2922   2973                   warning {
  2923         -                    log::log $options(StrictMode) "Could not parse:\n [$element asXML]"
  2924         -                    log::log $options(StrictMode) "\t error was: $msg"
         2974  +                    ::log::logsubst $options(StrictMode) {Could not parse:\n [$element asXML]}
         2975  +                    ::log::logsubst $options(StrictMode) {\t error was: $msg}
  2925   2976                   }
  2926   2977                   error -
  2927   2978                   default {
  2928   2979                       set errorCode $::errorCode
  2929   2980                       set errorInfo $::errorInfo
  2930         -                    log::log error "Could not parse:\n [$element asXML]"
  2931         -                    log::log error "\t error was: $msg"
  2932         -                    log::log error "\t error info: $errorInfo"
  2933         -                    log::log error "\t last element: $::elementName"
  2934         -                    log::log error "\t error in: [lindex [info level 0] 0]"
  2935         -                    log::log error "\t error code: $errorCode"
         2981  +                    ::log::logsubst error {Could not parse:\n [$element asXML]}
         2982  +                    ::log::logsubst error {\t error was: $msg}
         2983  +                    ::log::logsubst error {\t error info: $errorInfo}
         2984  +                    ::log::logsubst error {\t error in: [lindex [info level 0] 0]}
         2985  +                    ::log::logsubst error {\t error code: $errorCode}
         2986  +                    ::log::logsubst error {\t last element: $::elementName}
  2936   2987                       set ::WS::Utils::targetNs $tmpTargetNs
  2937   2988                       return \
  2938   2989                           -code error \
  2939   2990                           -errorcode $errorCode \
  2940   2991                           -errorinfo $errorInfo \
  2941   2992                           $msg
  2942   2993                   }
  2943   2994               }
  2944   2995           }
  2945   2996       }
  2946   2997   
  2947         -    ::log::log debug  "Parsing Attribute types for $xns as $tns"
  2948         -    foreach element [$schemaNode selectNodes -namespaces $nsList child::xs:attribute] {
  2949         -        ::log::log debug "\tprocessing $element"
  2950         -        if {[catch {parseElementalType $mode serviceInfo $serviceName $element $tns} msg]} {
         2998  +    ::log::logsubst debug {Parsing Simple types for $xns as $tns}
         2999  +    foreach element [$schemaNode selectNodes -namespaces $nsList child::xs:simpleType] {
         3000  +        ::log::logsubst debug {\tprocessing $element}
         3001  +        if {[catch {parseSimpleType $mode serviceInfo $serviceName $element $tns} msg]} {
  2951   3002               switch -exact -- $options(StrictMode) {
  2952   3003                   debug -
  2953   3004                   warning {
  2954         -                    log::log $options(StrictMode) "Could not parse:\n [$element asXML]"
  2955         -                    log::log $options(StrictMode) "\t error was: $msg"
         3005  +                    ::log::logsubst $options(StrictMode) {Could not parse:\n [$element asXML]}
         3006  +                    ::log::logsubst $options(StrictMode) {\t error was: $msg}
  2956   3007                   }
  2957   3008                   error -
  2958   3009                   default {
  2959   3010                       set errorCode $::errorCode
  2960   3011                       set errorInfo $::errorInfo
  2961         -                    log::log error "Could not parse:\n [$element asXML]"
  2962         -                    log::log error "\t error was: $msg"
  2963         -                    log::log error "\t error info: $errorInfo"
  2964         -                    log::log error "\t error in: [lindex [info level 0] 0]"
  2965         -                    log::log error "\t error code: $errorCode"
  2966         -                    log::log error "\t last element: $::elementName"
         3012  +                    ::log::logsubst error {Could not parse:\n [$element asXML]}
         3013  +                    ::log::logsubst error {\t error was: $msg}
         3014  +                    ::log::logsubst error {\t error info: $errorInfo}
         3015  +                    ::log::logsubst error {\t error in: [lindex [info level 0] 0]}
         3016  +                    ::log::logsubst error {\t error code: $errorCode}
  2967   3017                       set ::WS::Utils::targetNs $tmpTargetNs
  2968   3018                       return \
  2969   3019                           -code error \
  2970   3020                           -errorcode $errorCode \
  2971   3021                           -errorinfo $errorInfo \
  2972   3022                           $msg
  2973   3023                   }
  2974   3024               }
  2975   3025           }
  2976   3026       }
  2977   3027   
  2978         -    ::log::log debug "Parsing Simple types for $xns as $tns"
  2979         -    foreach element [$schemaNode selectNodes -namespaces $nsList child::xs:simpleType] {
  2980         -        ::log::log debug "\tprocessing $element"
  2981         -        if {[catch {parseSimpleType $mode serviceInfo $serviceName $element $tns} msg]} {
         3028  +    ::log::logsubst debug {Parsing Complex types for $xns as $tns}
         3029  +    foreach element [$schemaNode selectNodes -namespaces $nsList child::xs:complexType] {
         3030  +        ::log::logsubst debug {\tprocessing $element}
         3031  +        if {[catch {parseComplexType $mode serviceInfo $serviceName $element $tns} msg]} {
  2982   3032               switch -exact -- $options(StrictMode) {
  2983   3033                   debug -
  2984   3034                   warning {
  2985         -                    log::log $options(StrictMode) "Could not parse:\n [$element asXML]"
  2986         -                    log::log $options(StrictMode) "\t error was: $msg"
         3035  +                    ::log::logsubst $options(StrictMode) {Could not parse:\n [$element asXML]}
         3036  +                    ::log::logsubst $options(StrictMode) {\t error was: $msg}
  2987   3037                   }
  2988   3038                   error -
  2989   3039                   default {
  2990   3040                       set errorCode $::errorCode
  2991   3041                       set errorInfo $::errorInfo
  2992         -                    log::log error "Could not parse:\n [$element asXML]"
  2993         -                    log::log error "\t error was: $msg"
  2994         -                    log::log error "\t error info: $errorInfo"
  2995         -                    log::log error "\t error in: [lindex [info level 0] 0]"
  2996         -                    log::log error "\t error code: $errorCode"
  2997         -                    set ::WS::Utils::targetNs $tmpTargetNs
  2998         -                    return \
  2999         -                        -code error \
  3000         -                        -errorcode $errorCode \
  3001         -                        -errorinfo $errorInfo \
  3002         -                        $msg
  3003         -                }
  3004         -            }
  3005         -        }
  3006         -    }
  3007         -
  3008         -    ::log::log debug  "Parsing Complex types for $xns as $tns"
  3009         -    foreach element [$schemaNode selectNodes -namespaces $nsList child::xs:complexType] {
  3010         -        ::log::log debug "\tprocessing $element"
  3011         -        if {[catch {parseComplexType $mode serviceInfo $serviceName $element $tns} msg]} {
  3012         -            switch -exact -- $options(StrictMode) {
  3013         -                debug -
  3014         -                warning {
  3015         -                    log::log $options(StrictMode) "Could not parse:\n [$element asXML]"
  3016         -                    log::log $options(StrictMode) "\t error was: $msg"
  3017         -                }
  3018         -                error -
  3019         -                default {
  3020         -                    set errorCode $::errorCode
  3021         -                    set errorInfo $::errorInfo
  3022         -                    log::log error "Could not parse:\n [$element asXML]"
  3023         -                    log::log error "\t error was: $msg"
  3024         -                    log::log error "\t error info: $errorInfo"
  3025         -                    log::log error "\t error in: [lindex [info level 0] 0]"
  3026         -                    log::log error "\t error code: $errorCode"
         3042  +                    ::log::logsubst error {Could not parse:\n [$element asXML]}
         3043  +                    ::log::logsubst error {\t error was: $msg}
         3044  +                    ::log::logsubst error {\t error info: $errorInfo}
         3045  +                    ::log::logsubst error {\t error in: [lindex [info level 0] 0]}
         3046  +                    ::log::logsubst error {\t error code: $errorCode}
  3027   3047                       set ::WS::Utils::targetNs $tmpTargetNs
  3028   3048                       return \
  3029   3049                           -code error \
  3030   3050                           -errorcode $errorCode \
  3031   3051                           -errorinfo $errorInfo \
  3032   3052                           $msg
  3033   3053                   }
  3034   3054               }
  3035   3055           }
  3036   3056       }
  3037   3057   
  3038   3058       set ::WS::Utils::targetNs $tmpTargetNs
  3039         -    ::log::log debug "Leaving :WS::Utils::parseScheme $mode $baseUrl $schemaNode $serviceName $serviceInfoVar $tnsCountVar"
  3040         -    ::log::log debug "Target NS is now: $::WS::Utils::targetNs"
         3059  +    ::log::logsubst debug {Leaving :WS::Utils::parseScheme $mode $baseUrl $schemaNode $serviceName $serviceInfoVar $tnsCountVar}
         3060  +    ::log::logsubst debug {Target NS is now: $::WS::Utils::targetNs}
  3041   3061       dict set serviceInfo tnsList tns $prevTnsDict
  3042   3062   }
  3043   3063   
  3044   3064   ###########################################################################
  3045   3065   #
  3046   3066   # Private Procedure Header - as this procedure is modified, please be sure
  3047   3067   #                            that you update this header block. Thanks.
................................................................................
  3087   3107   proc ::WS::Utils::processImport {mode baseUrl importNode serviceName serviceInfoVar tnsCountVar} {
  3088   3108       upvar 1 $serviceInfoVar serviceInfo
  3089   3109       upvar 1 $tnsCountVar tnsCount
  3090   3110       variable currentSchema
  3091   3111       variable importedXref
  3092   3112       variable options
  3093   3113   
  3094         -    ::log::log debug "Entering [info level 0]"
         3114  +    ::log::logsubst debug {Entering [info level 0]}
  3095   3115       ##
  3096   3116       ## Get the xml
  3097   3117       ##
  3098   3118       set attrName schemaLocation
  3099   3119       if {![$importNode hasAttribute $attrName]} {
  3100   3120           set attrName namespace
  3101   3121           if {![$importNode hasAttribute $attrName]} {
................................................................................
  3104   3124                   -code error \
  3105   3125                   -errorcode [list WS CLIENT MISSCHLOC $baseUrl] \
  3106   3126                   "Missing Schema Location in '$baseUrl'"
  3107   3127           }
  3108   3128       }
  3109   3129       set urlTail [$importNode getAttribute $attrName]
  3110   3130       set url [::uri::resolve $baseUrl  $urlTail]
  3111         -    ::log::log debug "Including $url"
         3131  +    ::log::logsubst debug {Including $url}
  3112   3132   
  3113   3133       set lastPos [string last / $url]
  3114   3134       set testUrl [string range $url 0 [expr {$lastPos - 1}]]
  3115   3135       if { [info exists ::WS::Utils::redirectArray($testUrl)] } {
  3116   3136           set newUrl $::WS::Utils::redirectArray($testUrl)
  3117   3137           append newUrl [string range $url $lastPos end]
  3118         -        ::log::log debug "newUrl = $newUrl"
         3138  +        ::log::logsubst debug {newUrl = $newUrl}
  3119   3139           set url $newUrl
  3120   3140       }
  3121   3141   
  3122         -    ::log::log debug "\t Importing {$url}"
         3142  +    ::log::logsubst debug {\t Importing {$url}}
  3123   3143   
  3124   3144       ##
  3125   3145       ## Skip "known" namespace
  3126   3146       ##
  3127   3147       switch -exact -- $url {
  3128   3148           http://schemas.xmlsoap.org/wsdl/ -
  3129   3149           http://schemas.xmlsoap.org/wsdl/soap/ -
................................................................................
  3137   3157           }
  3138   3158       }
  3139   3159   
  3140   3160       ##
  3141   3161       ## Short-circuit infinite loop on inports
  3142   3162       ##
  3143   3163       if { [info exists importedXref($mode,$serviceName,$url)] } {
  3144         -        ::log::log debug "$mode,$serviceName,$url was already imported: $importedXref($mode,$serviceName,$url)"
         3164  +        ::log::logsubst debug {$mode,$serviceName,$url was already imported: $importedXref($mode,$serviceName,$url)}
  3145   3165           return
  3146   3166       }
  3147   3167       dict lappend serviceInfo imports $url
  3148   3168       set importedXref($mode,$serviceName,$url) [list $mode $serviceName $tnsCount]
  3149   3169       set urlScheme [dict get [::uri::split $url] scheme]
  3150         -    ::log::log debug "URL Scheme of {$url} is {$urlScheme}"
         3170  +    ::log::logsubst debug {URL Scheme of {$url} is {$urlScheme}}
  3151   3171       switch -exact -- $urlScheme {
  3152   3172           file {
  3153         -            ::log::log debug "In file processor -- {$urlTail}"
         3173  +            ::log::logsubst debug {In file processor -- {$urlTail}}
  3154   3174               set fn [file join  $options(includeDirectory) [string range $urlTail 8 end]]
  3155   3175               set ifd  [open $fn r]
  3156   3176               set xml [read $ifd]
  3157   3177               close $ifd
  3158   3178               ProcessImportXml $mode $baseUrl $xml $serviceName $serviceInfoVar $tnsCountVar
  3159   3179           }
  3160   3180           https -
................................................................................
  3171   3191               if {($ncode != 200) && [string equal $options(includeDirectory) {}]} {
  3172   3192                   return \
  3173   3193                       -code error \
  3174   3194                       -errorcode [list WS CLIENT HTTPFAIL $url $ncode] \
  3175   3195                       "HTTP get of import file failed '$url'"
  3176   3196               } elseif {($ncode == 200) && ![string equal $options(includeDirectory) {}]} {
  3177   3197                   set fn [file join  $options(includeDirectory) [file tail $urlTail]]
  3178         -                ::log::log info "Could not access $url -- using $fn"
         3198  +                ::log::logsubst info {Could not access $url -- using $fn}
  3179   3199                   set ifd  [open $fn r]
  3180   3200                   set xml [read $ifd]
  3181   3201                   close $ifd
  3182   3202               }
  3183   3203               if {[catch {ProcessImportXml $mode $baseUrl $xml $serviceName $serviceInfoVar $tnsCountVar} err]} {
  3184         -                ::log::log info "Error during processing of XML: $err"
         3204  +                ::log::logsubst info {Error during processing of XML: $err}
  3185   3205                   #puts stderr "error Info: $::errorInfo"
  3186   3206               } else {
  3187   3207                   #puts stderr "import successful"
  3188   3208               }
  3189   3209           }
  3190   3210           default {
  3191   3211               return \
................................................................................
  3240   3260   proc ::WS::Utils::parseComplexType {mode dictVar serviceName node tns} {
  3241   3261       upvar 1 $dictVar results
  3242   3262       variable currentSchema
  3243   3263       variable nsList
  3244   3264       variable unkownRef
  3245   3265       variable defaultType
  3246   3266   
  3247         -    ::log::log debug "Entering [info level 0]"
         3267  +    ::log::logsubst debug {Entering [info level 0]}
  3248   3268   
  3249   3269       set isAbstractType false
  3250   3270       set defaultType string
  3251   3271       set typeName $tns:[$node getAttribute name]
  3252         -    ::log::log debug "Complex Type is $typeName"
         3272  +    ::log::logsubst debug {Complex Type is $typeName}
  3253   3273       if {[$node hasAttribute abstract]} {
  3254   3274           set isAbstractType [$node getAttribute abstract]
  3255         -        ::log::log debug "\t Abstract type = $isAbstractType"
         3275  +        ::log::logsubst debug {\t Abstract type = $isAbstractType}
  3256   3276       }
  3257   3277       #if {[string length [::WS::Utils::GetServiceTypeDef $mode $serviceName $typeName]]} {
  3258   3278       #    ::log::log debug "\t Type $typeName is already defined -- leaving"
  3259   3279       #    return
  3260   3280       #}
  3261   3281       set partList {}
  3262   3282       set nodeFound 0
................................................................................
  3266   3286       foreach middleNode $middleNodeList {
  3267   3287           set commentNodeList [$middleNode selectNodes -namespaces $nsList xs:annotation]
  3268   3288           if {[llength $commentNodeList]} {
  3269   3289               set commentNode [lindex $commentNodeList 0]
  3270   3290               set comment [string trim [$commentNode asText]]
  3271   3291           }
  3272   3292           set middle [$middleNode localName]
  3273         -        ::log::log debug "Complex Type is $typeName, middle is $middle"
         3293  +        ::log::logsubst debug {Complex Type is $typeName, middle is $middle}
  3274   3294           #if {$isAbstractType && [string equal $middle attribute]} {
  3275   3295           #    ##
  3276   3296           #    ## Abstract type, so treat like an element
  3277   3297           #    ##
  3278   3298           #    set middle element
  3279   3299           #}
  3280   3300   
................................................................................
  3286   3306                   ##
  3287   3307                   continue
  3288   3308               }
  3289   3309               element {
  3290   3310                   set nodeFound 1
  3291   3311                   if {[$middleNode hasAttribute ref]} {
  3292   3312                       set partType [$middleNode getAttribute ref]
  3293         -                    ::log::log debug "\t\t has a ref of {$partType}"
         3313  +                    ::log::logsubst debug {\t\t has a ref of {$partType}}
  3294   3314                       if {[catch {
  3295   3315                           set refTypeInfo [split $partType {:}]
  3296   3316                           set partName [lindex $refTypeInfo end]
  3297   3317                           set refNS [lindex $refTypeInfo 0]
  3298   3318                           if {[string equal $refNS {}]} {
  3299   3319                               set partType $tns:$partType
  3300   3320                           }
................................................................................
  3347   3367               choice -
  3348   3368               sequence -
  3349   3369               all {
  3350   3370                   # set elementList [$middleNode selectNodes -namespaces $nsList xs:element]
  3351   3371                   set partMax [$middleNode getAttribute maxOccurs 1]
  3352   3372                   set tmp [partList $mode $middleNode $serviceName results $tns $partMax]
  3353   3373                   if {[llength $tmp]} {
  3354         -                    ::log::log debug "\tadding {$tmp} to partslist"
         3374  +                    ::log::logsubst debug {\tadding {$tmp} to partslist}
  3355   3375                       set nodeFound 1
  3356   3376                       set partList [concat $partList $tmp]
  3357   3377                   } elseif {!$nodeFound} {
  3358   3378                       ::WS::Utils::ServiceSimpleTypeDef $mode $serviceName $typeName [list base string comment $comment] $tns
  3359   3379                       return
  3360   3380                   }
  3361   3381               # simpleType {
................................................................................
  3369   3389                   parseComplexType $mode results $serviceName $middleNode $tns
  3370   3390               }
  3371   3391               simpleContent -
  3372   3392               complexContent {
  3373   3393                   foreach child [$middleNode childNodes] {
  3374   3394                       set parent [$child parent]
  3375   3395                       set contentType [$child localName]
  3376         -                    ::log::log debug "Content Type is {$contentType}"
         3396  +                    ::log::logsubst debug {Content Type is {$contentType}}
  3377   3397                       switch -exact -- $contentType {
  3378   3398                           restriction {
  3379   3399                               set nodeFound 1
  3380   3400                               set restriction $child
  3381   3401                               set element [$child selectNodes -namespaces $nsList xs:attribute]
  3382   3402                               set typeInfoList [list baseType [$restriction getAttribute base]]
  3383   3403                               array unset attrArr
................................................................................
  3394   3414                               set partName item
  3395   3415                               set partType [getQualifiedType $results $attrArr(arrayType) $tns]
  3396   3416                               set partType [string map {{[]} {()}} $partType]
  3397   3417                               lappend partList $partName [list type [string trimright ${partType} {()?}]() comment $comment allowAny 1]
  3398   3418                               set nodeFound 1
  3399   3419                           }
  3400   3420                           extension {
  3401         -                            ::log::log debug "Calling partList for $contentType of $typeName"
         3421  +                            ::log::logsubst debug {Calling partList for $contentType of $typeName}
  3402   3422                               if {[catch {set tmp [partList $mode $child $serviceName results $tns]} msg]} {
  3403         -                                ::log::log debug "Error in partList {$msg}, errorInfo: $errorInfo"
         3423  +                                ::log::logsubst debug {Error in partList {$msg}, errorInfo: $errorInfo}
  3404   3424                               }
  3405         -                            ::log::log debug "partList for $contentType of $typeName is {$tmp}"
         3425  +                            ::log::logsubst debug {partList for $contentType of $typeName is {$tmp}}
  3406   3426                               if {[llength $tmp]  && ![string equal [lindex $tmp 0] {}]} {
  3407   3427                                   set nodeFound 1
  3408   3428                                   set partList [concat $partList $tmp]
  3409   3429                               } elseif {[llength $tmp]} {
  3410   3430                                   ##
  3411   3431                                   ## Found extension, but it is an empty type
  3412   3432                                   ##
................................................................................
  3433   3453                   if {!$nodeFound} {
  3434   3454                       parseElementalType $mode results $serviceName $node $tns
  3435   3455                       return
  3436   3456                   }
  3437   3457               }
  3438   3458           }
  3439   3459       }
  3440         -    ::log::log debug "at end of foreach {$typeName} with {$partList}"
         3460  +    ::log::logsubst debug {at end of foreach {$typeName} with {$partList}}
  3441   3461       if {[llength $partList] || $isAbstractType} {
  3442   3462           #dict set results types $tns:$typeName $partList
  3443   3463           dict set results types $typeName $partList
  3444   3464           ::log:::log debug  "Defining $typeName"
  3445   3465           if {[llength $partList]  && ![string equal [lindex $partList 0] {}]} {
  3446   3466               ::WS::Utils::ServiceTypeDef $mode $serviceName $typeName $partList $tns $isAbstractType
  3447   3467           } else {
................................................................................
  3508   3528       variable defaultType
  3509   3529       variable options
  3510   3530       variable simpleTypes
  3511   3531       upvar 1 $dictVar results
  3512   3532   
  3513   3533       set partList {}
  3514   3534       set middle [$node localName]
  3515         -    ::log::log debug "Entering [info level 0] -- for $middle"
         3535  +    ::log::logsubst debug {Entering [info level 0] -- for $middle}
  3516   3536       switch -exact -- $middle {
  3517   3537           anyAttribute -
  3518   3538           attribute {
  3519   3539               ##
  3520   3540               ## Do Nothing
  3521   3541               ##
  3522   3542           }
................................................................................
  3531   3551                       set partList [list $partName [list type [string trimright ${partType} {()}]() comment {}]]
  3532   3552                   }
  3533   3553               }
  3534   3554           }
  3535   3555           extension {
  3536   3556               set baseName [getQualifiedType $results [$node getAttribute base string] $tns]
  3537   3557               set baseTypeInfo [TypeInfo Client $serviceName $baseName]
  3538         -            ::log::log debug "\t base name of extension is {$baseName} with typeinfo {$baseTypeInfo}"
         3558  +            ::log::logsubst debug {\t base name of extension is {$baseName} with typeinfo {$baseTypeInfo}}
  3539   3559               if {[lindex $baseTypeInfo 0]} {
  3540   3560                   if {[catch {::WS::Utils::GetServiceTypeDef Client $serviceName $baseName}]} {
  3541   3561                       set baseQuery [format {child::*[attribute::name='%s']} $baseName]
  3542   3562                       set baseNode [$currentSchema selectNodes $baseQuery]
  3543   3563                       #puts "$baseQuery gave {$baseNode}"
  3544   3564                       set baseNodeType [$baseNode localName]
  3545   3565                       switch -exact -- $baseNodeType {
................................................................................
  3556   3576                               ##
  3557   3577                               ## Placed here to shut up tclchecker
  3558   3578                               ##
  3559   3579                           }
  3560   3580                       }
  3561   3581                   }
  3562   3582                   set baseInfo [GetServiceTypeDef $mode $serviceName $baseName]
  3563         -                ::log::log debug "\t baseInfo is {$baseInfo}"
         3583  +                ::log::logsubst debug {\t baseInfo is {$baseInfo}}
  3564   3584                   if {[llength $baseInfo] == 0} {
  3565         -                    ::log::log debug "\t Unknown reference '$baseName'"
         3585  +                    ::log::logsubst debug {\t Unknown reference '$baseName'}
  3566   3586                       set unkownRef($baseName) 1
  3567   3587                       return;
  3568   3588                   }
  3569   3589                   catch {set partList [concat $partList [dict get $baseInfo definition]]}
  3570   3590               } else {
  3571         -                ::log::log debug "\t Simple type"
         3591  +                ::log::logsubst debug {\t Simple type}
  3572   3592               }
  3573   3593               foreach elementNode [$node childNodes] {
  3574   3594                   set tmp [partList $mode $elementNode $serviceName results $tns]
  3575   3595                   if {[llength $tmp]} {
  3576   3596                       set partList [concat $partList $tmp]
  3577   3597                   }
  3578   3598               }
  3579   3599           }
  3580   3600           choice -
  3581   3601           sequence -
  3582   3602           all {
  3583   3603               set elementList [$node selectNodes -namespaces $nsList xs:element]
  3584   3604               set elementsFound 0
  3585         -            ::log::log debug "\telement list is {$elementList}"
         3605  +            ::log::logsubst debug {\telement list is {$elementList}}
  3586   3606               foreach element $elementList {
  3587         -                ::log::log debug "\t\tprocessing $element ([$element nodeName])"
         3607  +                ::log::logsubst debug {\t\tprocessing $element ([$element nodeName])}
  3588   3608                   set comment {}
  3589   3609                   set additional_defininition_elements {}
  3590   3610                   if {[catch {
  3591   3611                       set elementsFound 1
  3592   3612                       set attrName name
  3593   3613                       set isRef 0
  3594   3614                       if {![$element hasAttribute name]} {
................................................................................
  3598   3618                       set partName [$element getAttribute $attrName]
  3599   3619                       if {$isRef} {
  3600   3620                           set partType {}
  3601   3621                           set partTypeInfo {}
  3602   3622                           set partType [string trimright [getQualifiedType $results $partName $tns] {?}]
  3603   3623                           set partTypeInfo [::WS::Utils::GetServiceTypeDef $mode $serviceName $partType]
  3604   3624                           set partName [lindex [split $partName {:}] end]
  3605         -                        ::log::log debug "\t\t\t part name is {$partName} type is {$partTypeInfo}"
         3625  +                        ::log::logsubst debug {\t\t\t part name is {$partName} type is {$partTypeInfo}}
  3606   3626                           if {[dict exists $partTypeInfo definition $partName]} {
  3607   3627                               set partType [dict get $partTypeInfo definition $partName type]
  3608   3628                           }
  3609         -                        ::log::log debug "\t\t\t part name is {$partName} type is {$partType}"
         3629  +                        ::log::logsubst debug {\t\t\t part name is {$partName} type is {$partType}}
  3610   3630                       } else {
  3611   3631                           ##
  3612   3632                           ## See if really a complex definition
  3613   3633                           ##
  3614   3634                           if {[$element hasChildNodes]} {
  3615   3635                               set isComplex 0; set isSimple 0
  3616   3636                               foreach child [$element childNodes] {
................................................................................
  3647   3667                       }
  3648   3668                       if {$partMax <= 1} {
  3649   3669                           lappend partList $partName [concat [list type $partType comment $comment] $additional_defininition_elements]
  3650   3670                       } else {
  3651   3671                           lappend partList $partName [concat [list type [string trimright ${partType} {()?}]() comment $comment] $additional_defininition_elements]
  3652   3672                       }
  3653   3673                   } msg]} {
  3654         -                    ::log::log error "\tError processing {$msg} for [$element asXML]"
         3674  +                    ::log::logsubst error {\tError processing {$msg} for [$element asXML]}
  3655   3675                       if {$isRef} {
  3656   3676                           ::log::log error "\t\t Was a reference.  Additionally information is:"
  3657         -                        ::log::log error "\t\t\t part name is {$partName} type is {$partType} with {$partTypeInfo}"
         3677  +                        ::log::logsubst error {\t\t\t part name is {$partName} type is {$partType} with {$partTypeInfo}}
  3658   3678                       }
  3659   3679                   }
  3660   3680               }
  3661   3681               if {!$elementsFound} {
  3662   3682                   set defaultType $options(anyType)
  3663   3683                   return
  3664   3684               }
................................................................................
  3763   3783   proc ::WS::Utils::parseElementalType {mode dictVar serviceName node tns} {
  3764   3784   
  3765   3785       upvar 1 $dictVar results
  3766   3786       variable importedXref
  3767   3787       variable nsList
  3768   3788       variable unkownRef
  3769   3789   
  3770         -    ::log::log debug "Entering [info level 0]"
         3790  +    ::log::logsubst debug {Entering [info level 0]}
  3771   3791   
  3772   3792       set attributeName name
  3773   3793       if {![$node hasAttribute $attributeName]} {
  3774   3794           set attributeName ref
  3775   3795       }
  3776   3796       set typeName [$node getAttribute $attributeName]
  3777   3797       if {[string length [::WS::Utils::GetServiceTypeDef $mode $serviceName $tns:$typeName]]} {
  3778         -        ::log::log debug "\t Type $tns:$typeName is already defined -- leaving"
         3798  +        ::log::logsubst debug {\t Type $tns:$typeName is already defined -- leaving}
  3779   3799           return
  3780   3800       }
  3781   3801       set typeType ""
  3782   3802       if {[$node hasAttribute type]} {
  3783   3803           set typeType [getQualifiedType $results [$node getAttribute type string] $tns]
  3784   3804       }
  3785         -    ::log::log debug "Elemental Type is $typeName"
         3805  +    ::log::logsubst debug {Elemental Type is $typeName}
  3786   3806       set partList {}
  3787   3807       set partType {}
  3788   3808       set isAbstractType false
  3789   3809       if {[$node hasAttribute abstract]} {
  3790   3810           set isAbstractType [$node getAttribute abstract]
  3791         -        ::log::log debug "\t Abstract type = $isAbstractType"
         3811  +        ::log::logsubst debug {\t Abstract type = $isAbstractType}
  3792   3812       }
  3793   3813       set elements [$node selectNodes -namespaces $nsList xs:complexType/xs:sequence/xs:element]
  3794         -    ::log::log debug "\t element list is {$elements} partList {$partList}"
         3814  +    ::log::logsubst debug {\t element list is {$elements} partList {$partList}}
  3795   3815       foreach element $elements {
  3796   3816           set ::elementName [$element asXML]
  3797         -        ::log::log debug "\t\t Processing element {[$element nodeName]}"
         3817  +        ::log::logsubst debug {\t\t Processing element {[$element nodeName]}}
  3798   3818           set elementsFound 1
  3799   3819           set typeAttribute ""
  3800   3820           if {[$element hasAttribute ref]} {
  3801   3821               set partType [$element getAttribute ref]
  3802         -            ::log::log debug "\t\t has a ref of {$partType}"
         3822  +            ::log::logsubst debug {\t\t has a ref of {$partType}}
  3803   3823               if {[catch {
  3804   3824                   set refTypeInfo [split $partType {:}]
  3805   3825                   set partName [lindex $refTypeInfo end]
  3806   3826                   set refNS [lindex $refTypeInfo 0]
  3807   3827                   if {[string equal $refNS {}]} {
  3808   3828                       set partType $tns:$partType
  3809   3829                   }
  3810   3830                   ##
  3811   3831                   ## Convert the reference to the local tns space
  3812   3832                   ##
  3813   3833                   set partType  [getQualifiedType $results $partType $tns]
  3814   3834                   set refTypeInfo [GetServiceTypeDef $mode $serviceName $partType]
  3815         -                log::log debug "looking up ref {$partType} got {$refTypeInfo}"
         3835  +                log::logsubst debug {looking up ref {$partType} got {$refTypeInfo}}
  3816   3836                   if {![llength $refTypeInfo]} {
  3817   3837                       error "lookup failed"
  3818   3838                   }
  3819   3839                   if {[dict exists $refTypeInfo definition]} {
  3820   3840                       set refTypeInfo [dict get $refTypeInfo definition]
  3821   3841                   }
  3822   3842                   set tmpList [dict keys $refTypeInfo]
................................................................................
  3837   3857                           ## Not a simple element, so point type to type of same name as element
  3838   3858                           ##
  3839   3859                           set partType [getQualifiedType $results $partName $tns]
  3840   3860                       }
  3841   3861                   }
  3842   3862               } msg]} {
  3843   3863                   lappend unkownRef($partType) $typeName
  3844         -                log::log debug "Unknown ref {$partType,$typeName} error: {$msg} trace: $::errorInfo"
         3864  +                log::logsubst debug {Unknown ref {$partType,$typeName} error: {$msg} trace: $::errorInfo}
  3845   3865                   return \
  3846   3866                       -code error \
  3847   3867                       -errorcode [list WS $mode UNKREF [list $typeName $partType]] \
  3848   3868                       "Unknown forward type reference {$partType} in {$typeName}"
  3849   3869               }
  3850   3870           } else {
  3851         -            ::log::log debug "\t\t\t has no ref has {[$element attributes]}"
         3871  +            ::log::logsubst debug {\t\t\t has no ref has {[$element attributes]}}
  3852   3872               set childList [$element selectNodes -namespaces $nsList xs:complexType/xs:sequence/xs:element]
  3853         -            ::log::log debug "\t\t\ has no ref has [llength $childList]"
         3873  +            ::log::logsubst debug {\t\t\ has no ref has [llength $childList]}
  3854   3874               if {[llength $childList]} {
  3855   3875                   ##
  3856   3876                   ## Element defines another element layer
  3857   3877                   ##
  3858   3878                   set partName [$element getAttribute name]
  3859   3879                   set partType [getQualifiedType $results $partName $tns]
  3860   3880                   parseElementalType $mode results $serviceName $element $tns
................................................................................
  3865   3885                   } else {
  3866   3886                       set partType xs:string
  3867   3887                   }
  3868   3888   
  3869   3889               }
  3870   3890           }
  3871   3891           set partMax [$element getAttribute maxOccurs -1]
  3872         -        ::log::log debug "\t\t\t part is {$partName} {$partType} {$partMax}"
         3892  +        ::log::logsubst debug {\t\t\t part is {$partName} {$partType} {$partMax}}
  3873   3893   
  3874   3894           if {[string equal $partMax -1]} {
  3875   3895               set partMax [[$element parent] getAttribute maxOccurs -1]
  3876   3896           }
  3877   3897           if {$partMax <= 1} {
  3878   3898               lappend partList $partName [list type $partType comment {}]
  3879   3899           } else {
................................................................................
  3987   4007   #
  3988   4008   #
  3989   4009   ###########################################################################
  3990   4010   proc ::WS::Utils::parseSimpleType {mode dictVar serviceName node tns} {
  3991   4011       upvar 1 $dictVar results
  3992   4012       variable nsList
  3993   4013   
  3994         -    ::log::log debug "Entering [info level 0]"
         4014  +    ::log::logsubst debug {Entering [info level 0]}
  3995   4015   
  3996   4016       set typeName [$node getAttribute name]
  3997   4017       if {$typeName in {SAP_VALID_FROM}} {
  3998   4018           set foo 1
  3999   4019       }
  4000   4020       set isList no
  4001         -    ::log::log debug "Simple Type is $typeName"
         4021  +    ::log::logsubst debug {Simple Type is $typeName}
  4002   4022       if {[string length [::WS::Utils::GetServiceTypeDef $mode $serviceName $tns:$typeName]]} {
  4003         -        ::log::log debug "\t Type $tns:$typeName is already defined -- leaving"
         4023  +        ::log::logsubst debug {\t Type $tns:$typeName is already defined -- leaving}
  4004   4024           return
  4005   4025       }
  4006   4026       #puts "Simple Type is $typeName"
  4007   4027       set restrictionNode [$node selectNodes -namespaces $nsList xs:restriction]
  4008   4028       if {[string equal $restrictionNode {}]} {
  4009   4029           set restrictionNode [$node selectNodes -namespaces $nsList xs:simpleType/xs:restriction]
  4010   4030       }
................................................................................
  4045   4065       if {[llength $enumList]} {
  4046   4066           lappend partList enumeration $enumList
  4047   4067       }
  4048   4068       if {![dict exists $results types $tns:$typeName]} {
  4049   4069           ServiceSimpleTypeDef $mode $serviceName $tns:$typeName $partList $tns
  4050   4070           dict set results simpletypes $tns:$typeName $partList
  4051   4071       } else {
  4052         -        ::log::log debug "\t type already exists as $tns:$typeName"
         4072  +        ::log::logsubst debug {\t type already exists as $tns:$typeName}
  4053   4073       }
  4054   4074   }
  4055   4075   
  4056   4076   
  4057   4077   
  4058   4078   ###########################################################################
  4059   4079   #
................................................................................
  4443   4463           lassign $typePartsList tmpTns tmpType
  4444   4464           if {[dict exists $serviceInfo tnsList tns $tmpTns]} {
  4445   4465               set result [dict get $serviceInfo tnsList tns $tmpTns]:$tmpType
  4446   4466           } elseif {[dict exists $serviceInfo types $type]} {
  4447   4467               set result $type
  4448   4468           } else {
  4449   4469               ::log::log error $serviceInfo
  4450         -            ::log::log error "Could not find tns '$tmpTns' in '[dict get $serviceInfo tnsList tns]' for type {$type}"
         4470  +            ::log::logsubst error {Could not find tns '$tmpTns' in '[dict get $serviceInfo tnsList tns]' for type {$type}}
  4451   4471               set result $tns:$type
  4452   4472               return -code error
  4453   4473           }
  4454   4474   
  4455   4475       }
  4456   4476       return $result
  4457   4477   }
................................................................................
  4496   4516   #       1  07/06/2006  G.Lester     Initial version
  4497   4517   #
  4498   4518   #
  4499   4519   ###########################################################################
  4500   4520   proc ::WS::Utils::GenerateTemplateDict {mode serviceName type {arraySize 2}} {
  4501   4521       variable generatedTypes
  4502   4522   
  4503         -    ::log::log debug "Entering [info level 0]"
         4523  +    ::log::logsubst debug {Entering [info level 0]}
  4504   4524       unset -nocomplain -- generatedTypes
  4505   4525   
  4506   4526       set result [_generateTemplateDict $mode $serviceName $type $arraySize]
  4507   4527   
  4508   4528       unset -nocomplain -- generatedTypes
  4509         -    ::log::log debug "Leaving [info level 0] with {$result}"
         4529  +    ::log::logsubst debug {Leaving [info level 0] with {$result}}
  4510   4530   
  4511   4531       return $result
  4512   4532   }
  4513   4533   
  4514   4534   ###########################################################################
  4515   4535   #
  4516   4536   # Private Procedure Header - as this procedure is modified, please be sure
................................................................................
  4554   4574   ###########################################################################
  4555   4575   proc ::WS::Utils::_generateTemplateDict {mode serviceName type arraySize {xns {}}} {
  4556   4576       variable typeInfo
  4557   4577       variable mutableTypeInfo
  4558   4578       variable options
  4559   4579       variable generatedTypes
  4560   4580   
  4561         -    ::log::log debug "Entering [info level 0]"
         4581  +    ::log::logsubst debug {Entering [info level 0]}
  4562   4582       set results {}
  4563   4583   
  4564   4584       ##
  4565   4585       ## Check for circular reference
  4566   4586       ##
  4567   4587       if {[info exists generatedTypes([list $mode $serviceName $type])]} {
  4568   4588           set results {<** Circular Reference **>}
  4569         -        ::log::log debug "Leaving [info level 0] with {$results}"
         4589  +        ::log::logsubst debug {Leaving [info level 0] with {$results}}
  4570   4590           return $results
  4571   4591       } else {
  4572   4592           set generatedTypes([list $mode $serviceName $type]) 1
  4573   4593       }
  4574   4594   
  4575   4595       set type [string trimright $type {?}]
  4576   4596       # set typeDefInfo [dict get $typeInfo $mode $serviceName $type]
  4577   4597       set typeDefInfo [GetServiceTypeDef $mode $serviceName $type]
  4578   4598       if {![llength $typeDefInfo]} {
  4579   4599         ## We failed to locate the type. try with the last known xns...
  4580   4600         set typeDefInfo [GetServiceTypeDef $mode $serviceName ${xns}:$type]
  4581   4601       }
  4582   4602   
  4583         -    ::log::log debug "\t type def = {$typeDefInfo}"
         4603  +    ::log::logsubst debug {\t type def = {$typeDefInfo}}
  4584   4604       set xns [dict get $typeDefInfo xns]
  4585   4605   
  4586   4606       ##
  4587   4607       ## Check for mutable type
  4588   4608       ##
  4589   4609       if {[info exists mutableTypeInfo([list $mode $serviceName $type])]} {
  4590   4610           set results {<** Mutable Type **>}
  4591         -        ::log::log debug "Leaving [info level 0] with {$results}"
         4611  +        ::log::logsubst debug {Leaving [info level 0] with {$results}}
  4592   4612           return $results
  4593   4613       }
  4594   4614   
  4595   4615       if {![dict exists $typeDefInfo definition]} {
  4596   4616         ## This is a simple type, simulate a type definition...
  4597   4617         if {![dict exists $typeDefInfo type]} {
  4598   4618           if {[dict exists $typeDefInfo baseType]} {
................................................................................
  4600   4620           } else {
  4601   4621             dict set typeDefInfo type xs:string
  4602   4622           }
  4603   4623         }
  4604   4624         set typeDefInfo [dict create definition [dict create $type $typeDefInfo]]
  4605   4625       }
  4606   4626       set partsList [dict keys [dict get $typeDefInfo definition]]
  4607         -    ::log::log debug "\t partsList is {$partsList}"
         4627  +    ::log::logsubst debug {\t partsList is {$partsList}}
  4608   4628       foreach partName $partsList {
  4609   4629           set partType [string trimright [dict get $typeDefInfo definition $partName type] {?}]
  4610   4630           set partXns $xns
  4611   4631           catch {set partXns  [dict get $typeInfo $mode $serviceName $partType xns]}
  4612   4632           set typeInfoList [TypeInfo $mode $serviceName $partType]
  4613   4633           set isArray [lindex $typeInfoList end]
  4614   4634   
  4615         -        ::log::log debug "\tpartName $partName partType $partType xns $xns typeInfoList $typeInfoList"
         4635  +        ::log::logsubst debug {\tpartName $partName partType $partType xns $xns typeInfoList $typeInfoList}
  4616   4636           switch -exact -- $typeInfoList {
  4617   4637               {0 0} {
  4618   4638                   ##
  4619   4639                   ## Simple non-array
  4620   4640                   ##
  4621   4641                   set msg {Simple non-array}
  4622   4642                   ## Is there an enumenration?
................................................................................
  4665   4685               default {
  4666   4686                   ##
  4667   4687                   ## Placed here to shut up tclchecker
  4668   4688                   ##
  4669   4689               }
  4670   4690           }
  4671   4691       }
  4672         -    ::log::log debug "Leaving [info level 0] with {$results}"
         4692  +    ::log::logsubst debug {Leaving [info level 0] with {$results}}
  4673   4693       return $results
  4674   4694   }
  4675   4695   
  4676   4696   
  4677   4697   
  4678   4698   
  4679   4699   ###########################################################################
................................................................................
  4766   4786   # Version     Date     Programmer   Comments / Changes / Reasons
  4767   4787   # -------  ----------  ----------   -------------------------------------------
  4768   4788   #       1  02/24/2011  G. Lester    Initial version
  4769   4789   #  2.3.10  11/09/2015  H. Oehlmann  Allow only 5 redirects (loop protection)
  4770   4790   #
  4771   4791   ###########################################################################
  4772   4792   proc ::WS::Utils::geturl_followRedirects {url args} {
  4773         -    ::log::log debug "[info level 0]"
         4793  +    ::log::logsubst debug {[info level 0]}
  4774   4794       set initialUrl $url
  4775   4795       set finalUrl $url
  4776   4796       array set URI [::uri::split $url] ;# Need host info from here
  4777   4797       for {set loop 1} {$loop <=5} {incr loop} {
  4778   4798           if {[llength $args]} {
  4779         -            ::log::log info [concat [list ::http::geturl $url] $args]
         4799  +            ::log::logsubst info {[concat [list ::http::geturl $url] $args]}
  4780   4800               set token [eval [list http::geturl $url] $args]
  4781   4801           } else {
  4782         -            ::log::log info [list ::http::geturl $url]
         4802  +            ::log::logsubst info {::http::geturl $url}
  4783   4803               set token [::http::geturl $url]
  4784   4804           }
  4785   4805           set ncode [::http::ncode $token]
  4786         -        ::log::log info "ncode = $ncode"
         4806  +        ::log::logsubst info {ncode = $ncode}
  4787   4807           if {![string match {30[12378]} $ncode]} {
  4788         -            ::log::log debug "initialUrl = $initialUrl, finalUrl = $finalUrl"
         4808  +            ::log::logsubst debug {initialUrl = $initialUrl, finalUrl = $finalUrl}
  4789   4809               if {![string equal $finalUrl {}]} {
  4790   4810                   ::log::log debug "Getting initial URL directory"
  4791   4811                   set lastPos [string last / $initialUrl]
  4792   4812                   set initialUrlDir [string range $initialUrl 0 [expr {$lastPos - 1}]]
  4793   4813                   set lastPos [string last / $finalUrl]
  4794   4814                   set finalUrlDir [string range $finalUrl 0 [expr {$lastPos - 1}]]
  4795         -                ::log::log debug "initialUrlDir = $initialUrlDir, finalUrlDir = $finalUrlDir"
         4815  +                ::log::logsubst debug {initialUrlDir = $initialUrlDir, finalUrlDir = $finalUrlDir}
  4796   4816                   set ::WS::Utils::redirectArray($initialUrlDir) $finalUrlDir
  4797   4817               }
  4798   4818               return $token
  4799   4819           } elseif {![string match {20[1237]} $ncode]} {
  4800   4820               return $token
  4801   4821           }
  4802   4822           # http code announces redirect (3xx)
................................................................................
  4810   4830           array unset meta
  4811   4831           ::http::cleanup $token
  4812   4832           if {[string equal $uri(host) {}]} {
  4813   4833               set uri(host) $URI(host)
  4814   4834           }
  4815   4835           # problem w/ relative versus absolute paths
  4816   4836           set url [eval ::uri::join [array get uri]]
  4817         -        ::log::log debug "url = $url"
         4837  +        ::log::logsubst debug {url = $url}
  4818   4838           set finalUrl $url
  4819   4839       }
  4820   4840       # > 5 redirects reached -> exit with error
  4821   4841       return -errorcode [list WS CLIENT REDIRECTLIMIT $url]\
  4822   4842               -code error "http redirect limit exceeded for $url"
  4823   4843   }
  4824   4844   ###########################################################################
................................................................................
  4862   4882   #       1  11/08/2015  H.Oehlmann   Initial version
  4863   4883   #
  4864   4884   ###########################################################################
  4865   4885   proc ::WS::Utils::geturl_fetchbody {args} {
  4866   4886       set codeOkList {200}
  4867   4887       set codeVar ""
  4868   4888       set bodyAlwaysOk 0
  4869         -    ::log::log info [concat ::WS::Utils::geturl_fetchbody $args]
         4889  +    ::log::logsubst info {Entering [info level 0]}
  4870   4890       if {[lindex $args 0] eq "-codeok"} {
  4871   4891           set codeOkList [lindex $args 1]
  4872   4892           set args [lrange $args 2 end]
  4873   4893       }
  4874   4894       if {[lindex $args 0] eq "-codevar"} {
  4875   4895           set codeVar [lindex $args 1]
  4876   4896           set args [lrange $args 2 end]
................................................................................
  4895   4915           set ncode [::http::ncode $token]
  4896   4916           set body [::http::data $token]
  4897   4917           ::http::cleanup $token
  4898   4918           if {$bodyAlwaysOk && ![string equal $body ""]
  4899   4919               || -1 != [lsearch $codeOkList $ncode]
  4900   4920           } {
  4901   4921               # >> Fetch ok
  4902         -            ::log::log debug "\tReceived: $body"
         4922  +            ::log::logsubst debug {\tReceived: $body}
  4903   4923               return $body
  4904   4924           }
  4905         -        ::log::log debug "\tHTTP error: Wrong code $ncode or no data"
         4925  +        ::log::logsubst debug {\tHTTP error: Wrong code $ncode or no data}
  4906   4926           return -code error -errorcode [list WS CLIENT HTTPERROR $ncode]\
  4907   4927                   "HTTP failure code $ncode"
  4908   4928       }
  4909         -    ::log::log debug "\tHTTP error [array get $token]"
         4929  +    ::log::logsubst debug {\tHTTP error [array get $token]}
  4910   4930       set error [::http::error $token]
  4911   4931       ::http::cleanup $token
  4912   4932       return -errorcode [list WS CLIENT HTTPERROR $error]\
  4913   4933               -code error "HTTP error: $error"
  4914   4934   }

Changes to pkgIndex.tcl.

     9      9   # full path name of this file's directory.
    10     10   
    11     11   package ifneeded WS::AOLserver 2.4.0 [list source [file join $dir AOLserver.tcl]]
    12     12   package ifneeded WS::Channel 2.4.0 [list source [file join $dir ChannelServer.tcl]]
    13     13   package ifneeded WS::Client 2.5.0 [list source [file join $dir ClientSide.tcl]]
    14     14   package ifneeded WS::Embeded 2.4.0 [list source [file join $dir Embedded.tcl]]
    15     15   package ifneeded WS::Server 2.4.0 [list source [file join $dir ServerSide.tcl]]
    16         -package ifneeded WS::Utils 2.4.0 [list source [file join $dir Utilities.tcl]]
           16  +package ifneeded WS::Utils 2.4.1 [list source [file join $dir Utilities.tcl]]
    17     17   package ifneeded WS::Wub 2.4.0 [list source [file join $dir WubServer.tcl]]
    18     18   package ifneeded Wsdl 2.4.0 [list source [file join $dir WubServer.tcl]]