Index: ClientSide.tcl ================================================================== --- ClientSide.tcl +++ ClientSide.tcl @@ -1034,13 +1034,16 @@ $wsdlDoc documentElement wsdlNode set nsCount 1 set targetNs [$wsdlNode getAttribute targetNamespace] set ::WS::Utils::targetNs $targetNs dict set nsDict url $targetNs tns$nsCount - foreach itemList [$wsdlNode attributes xmlns:*] { + set xmlnsList "" + parseXMLNS wsdlNode xmlnsList + foreach itemList $xmlnsList { set ns [lindex $itemList 0] - set url [$wsdlNode getAttribute xmlns:$ns] + ;###set url [$wsdlNode getAttribute xmlns:$ns] + set url [getXMLNSAttribute wsdlNode "xmlns:$ns"] if {[dict exists $nsDict url $url]} { set tns [dict get $nsDict url $url] } else { ## ## Check for hardcoded namespaces @@ -1107,10 +1110,42 @@ $wsdlDoc delete unset -nocomplain ::WS::Utils::targetNs return $serviceInfo +} +proc ::WS::Client::parseXMLNS {wsdlNodeVar xmlnsListVar} { + + upvar $xmlnsListVar xmlnsList + upvar $wsdlNodeVar wsdlNode + + foreach itemList [$wsdlNode attributes xmlns:*] { + if {[lsearch $xmlnsList $itemList] < 0} { + lappend xmlnsList $itemList + } + } + if {[$wsdlNode hasChildNodes] > 0} { + foreach childNode [$wsdlNode childNodes] { + parseXMLNS childNode xmlnsList + } + } +} + +proc ::WS::Client::getXMLNSAttribute {wsdlNodeVar attribute} { + upvar $wsdlNodeVar wsdlNode + set url "" + if {[catch {set url [$wsdlNode getAttribute $attribute]}] } { + if {[$wsdlNode hasChildNodes] > 0} { + foreach childNode [$wsdlNode childNodes] { + set url [getXMLNSAttribute childNode $attribute] + if {![string equal $url ""]} { + return $url + } + } + } + } + return $url } ########################################################################### # # Public Procedure Header - as this procedure is modified, please be sure Index: Utilities.tcl ================================================================== --- Utilities.tcl +++ Utilities.tcl @@ -567,11 +567,11 @@ set type [string trimright $type {()}] set results {} if {[string equal $type {}]} { ::log::log debug "@1" - set results [dict get $typeInfo $mode $service] + catch {set results [dict get $typeInfo $mode $service]} } else { set typeInfoList [TypeInfo $mode $service $type] if {[string equal -nocase -length 3 $type {xs:}]} { set type [string range $type 3 end] }