Index: ClientSide.tcl ================================================================== --- ClientSide.tcl +++ ClientSide.tcl @@ -45,11 +45,11 @@ package require tdom 0.8 package require http 2 package require log package require uri -package provide WS::Client 2.4.3 +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 @@ -987,10 +987,15 @@ # 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 @@ -1041,43 +1046,56 @@ # The top node # xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/ ...> # contains the target namespace and all namespace definitions dict set nsDict url $targetNs tns$nsCount - # returns {wsdl wsdl {}} ....} for the upper example. - foreach itemList [$wsdlNode attributes xmlns:*] { - set ns [lindex $itemList 0] - set url [$wsdlNode 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 - } + $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: + # + # 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 Index: pkgIndex.tcl ================================================================== --- pkgIndex.tcl +++ pkgIndex.tcl @@ -8,11 +8,11 @@ # 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::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]]