Check-in [e11e603f89]
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:Documentation and formatting, Client.tcl now version 2.4.4
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | rfe-dcce437d7aa5e64a
Files: files | file ages | folders
SHA3-256: e11e603f895d78acaddf6ab2c67d10daaf02620c11acf77db952e20cd3d24b77
User & Date: oehhar 2017-11-03 15:51:37
Context
2017-11-03 16:00
Search namespace prefix also in element nodes and not only in definition node of wsdl file. Patch by by Wolfgang Winkler. Ticket [dcce437d7a] check-in: 1915e65746 user: oehhar tags: trunk
2017-11-03 15:51
Documentation and formatting, Client.tcl now version 2.4.4 Closed-Leaf check-in: e11e603f89 user: oehhar tags: rfe-dcce437d7aa5e64a
2017-11-03 15:18
merged trunk check-in: b774fc3821 user: oehhar tags: rfe-dcce437d7aa5e64a
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ClientSide.tcl.

43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
...
985
986
987
988
989
990
991





992
993
994
995
996
997
998
....
1046
1047
1048
1049
1050
1051
1052
1053






1054
1055
1056


1057
1058

1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
package require Tcl 8.4
package require WS::Utils 2.4 ; # dict, lassign
package require tdom 0.8
package require http 2
package require log
package require uri

package provide WS::Client 2.4.3

namespace eval ::WS::Client {
    # register https only if not yet registered
    if {[catch { http::unregister https } lPortCmd]} {
        # not registered -> register on my own
        if {[catch {
            package require tls
................................................................................
# Maintenance History - as this file is modified, please be sure that you
#                       update this segment of the file header block by
#                       adding a complete entry at the bottom of the list.
#
# Version     Date     Programmer   Comments / Changes / Reasons
# -------  ----------  ----------   -------------------------------------------
#       1  07/06/2006  G.Lester     Initial version





#
#
###########################################################################
proc ::WS::Client::ParseWsdl {wsdlXML args} {
    variable currentBaseUrl
    variable serviceArr

................................................................................

    $wsdlDoc selectNodesNamespaces {
        w http://schemas.xmlsoap.org/wsdl/
        d http://schemas.xmlsoap.org/wsdl/soap/
        xs http://www.w3.org/2001/XMLSchema
    }

    set elems $wsdlNode






    set elems [concat $elems [$wsdlDoc selectNodes {//xs:element}]]

    foreach elemNode $elems {


      set xmlnsAttributes [$elemNode attributes xmlns:*] 


      foreach itemList $xmlnsAttributes {
          set ns [lindex $itemList 0]
          set url [$elemNode getAttribute xmlns:$ns]
          if {[dict exists $nsDict url $url]} {
              set tns [dict get $nsDict url $url]
          } else {
              ##
              ## Check for hardcoded namespaces
              ##
              switch -exact -- $url {
                  http://schemas.xmlsoap.org/wsdl/ {
                      set tns w
                  }
                  http://schemas.xmlsoap.org/wsdl/soap/ {
                      set tns d
                  }
                  http://www.w3.org/2001/XMLSchema {
                      set tns xs
                  }
                  default {
                      set tns tns[incr nsCount]
                  }
              }
              dict set nsDict url $url $tns
          }
          dict set nsDict tns $ns $tns
      }
    }

    if {[info exists currentBaseUrl]} {
        set url $currentBaseUrl
    } else {
        set url $targetNs
    }






|







 







>
>
>
>
>







 







<
>
>
>
>
>
>
|
<
<
>
>
|
<
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|







43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
...
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
....
1051
1052
1053
1054
1055
1056
1057

1058
1059
1060
1061
1062
1063
1064


1065
1066
1067

1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
package require Tcl 8.4
package require WS::Utils 2.4 ; # dict, lassign
package require tdom 0.8
package require http 2
package require log
package require uri

package provide WS::Client 2.4.4

namespace eval ::WS::Client {
    # register https only if not yet registered
    if {[catch { http::unregister https } lPortCmd]} {
        # not registered -> register on my own
        if {[catch {
            package require tls
................................................................................
# Maintenance History - as this file is modified, please be sure that you
#                       update this segment of the file header block by
#                       adding a complete entry at the bottom of the list.
#
# Version     Date     Programmer   Comments / Changes / Reasons
# -------  ----------  ----------   -------------------------------------------
#       1  07/06/2006  G.Lester     Initial version
# 2.4.4    2017-11-03  H. Oehlmann  Included ticket [dcce437d7a] with
#                                   solution by Wolfgang Winkler:
#                                   Search namespace prfix also in element
#                                   nodes and not only in definition node
#                                   of wsdl file.
#
#
###########################################################################
proc ::WS::Client::ParseWsdl {wsdlXML args} {
    variable currentBaseUrl
    variable serviceArr

................................................................................

    $wsdlDoc selectNodesNamespaces {
        w http://schemas.xmlsoap.org/wsdl/
        d http://schemas.xmlsoap.org/wsdl/soap/
        xs http://www.w3.org/2001/XMLSchema
    }


    ##
    ## loop over the top definitions node and all elements nodes
    ##
    # Element nodes may declare namespaces inline like:
    # <xs:element xmlns:q1="myNS" type="q1:MessageQ1"/>
    # ticket [dcce437d7a]
    foreach elemNode [linsert [$wsdlDoc selectNodes {//xs:element}] 0 $wsdlNode] {


        # Get list of xmlns attributes
        # This list looks for the example like: {{q1 q1 {}} ... }
        set xmlnsAttributes [$elemNode attributes xmlns:*] 

        # Loop over found namespaces
        foreach itemList $xmlnsAttributes {
            set ns [lindex $itemList 0]
            set url [$elemNode getAttribute xmlns:$ns]
            if {[dict exists $nsDict url $url]} {
                set tns [dict get $nsDict url $url]
            } else {
                ##
                ## Check for hardcoded namespaces
                ##
                switch -exact -- $url {
                    http://schemas.xmlsoap.org/wsdl/ {
                        set tns w
                    }
                    http://schemas.xmlsoap.org/wsdl/soap/ {
                        set tns d
                    }
                    http://www.w3.org/2001/XMLSchema {
                        set tns xs
                    }
                    default {
                        set tns tns[incr nsCount]
                    }
                }
                dict set nsDict url $url $tns
            }
            dict set nsDict tns $ns $tns
        }
    }

    if {[info exists currentBaseUrl]} {
        set url $currentBaseUrl
    } else {
        set url $targetNs
    }

Changes to pkgIndex.tcl.

6
7
8
9
10
11
12
13
14
15
16
17
18
19
# information so that packages will be loaded automatically
# in response to "package require" commands.  When this
# script is sourced, the variable $dir must contain the
# full path name of this file's directory.

package ifneeded WS::AOLserver 2.4.0 [list source [file join $dir AOLserver.tcl]]
package ifneeded WS::Channel 2.4.0 [list source [file join $dir ChannelServer.tcl]]
package ifneeded WS::Client 2.4.3 [list source [file join $dir ClientSide.tcl]]
package ifneeded WS::Embeded 2.4.0 [list source [file join $dir Embedded.tcl]]
package ifneeded WS::Server 2.4.0 [list source [file join $dir ServerSide.tcl]]
package ifneeded WS::Utils 2.4.0 [list source [file join $dir Utilities.tcl]]
package ifneeded WS::Wub 2.4.0 [list source [file join $dir WubServer.tcl]]
package ifneeded Wsdl 2.4.0 [list source [file join $dir WubServer.tcl]]







|






6
7
8
9
10
11
12
13
14
15
16
17
18
19
# information so that packages will be loaded automatically
# in response to "package require" commands.  When this
# script is sourced, the variable $dir must contain the
# full path name of this file's directory.

package ifneeded WS::AOLserver 2.4.0 [list source [file join $dir AOLserver.tcl]]
package ifneeded WS::Channel 2.4.0 [list source [file join $dir ChannelServer.tcl]]
package ifneeded WS::Client 2.4.4 [list source [file join $dir ClientSide.tcl]]
package ifneeded WS::Embeded 2.4.0 [list source [file join $dir Embedded.tcl]]
package ifneeded WS::Server 2.4.0 [list source [file join $dir ServerSide.tcl]]
package ifneeded WS::Utils 2.4.0 [list source [file join $dir Utilities.tcl]]
package ifneeded WS::Wub 2.4.0 [list source [file join $dir WubServer.tcl]]
package ifneeded Wsdl 2.4.0 [list source [file join $dir WubServer.tcl]]