Check-in [0c0c56dfc5]
Not logged in

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

Overview
Comment:Correction to ignore namespace definitions on child elements when parsing response with attributes.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | Release_2.3.6
Files: files | file ages | folders
SHA1:0c0c56dfc5ac33947211cde8c7b2837bb3bdae28
User & Date: gerald 2013-05-31 18:31:24
Context
2013-06-29 00:56
Correct typo in debug statement and added code to handle a reply message that is just a simple type (e.g. a string) with no components. check-in: 7e11ee2877 user: gerald tags: trunk
2013-05-31 18:31
Correction to ignore namespace definitions on child elements when parsing response with attributes. check-in: 0c0c56dfc5 user: gerald tags: trunk, Release_2.3.6
2013-05-29 22:03
Correct ::WS::Client::SetOptions to actual set the option to the value passed in. ≈ß≈ç check-in: 2ae4e3011a user: gerald tags: trunk, Release_2.3.5
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to Utilities.tcl.

1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440

1441
1442
1443
1444
1445
1446
1447
1448
1449
1450

1451
1452
1453
1454
1455
1456
1457
....
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479

1480
1481
1482
1483
1484
1485
1486
1487
1488
1489

1490
1491
1492
1493
1494
1495
1496
....
1511
1512
1513
1514
1515
1516
1517

1518
1519
1520
1521
1522
1523
1524
1525
1526
1527

1528
1529
1530
1531
1532
1533
1534
....
1542
1543
1544
1545
1546
1547
1548

1549
1550
1551
1552
1553
1554
1555
1556
1557
1558

1559
1560
1561
1562
1563
1564
1565
            set isAbstract [dict get $typeInfo $mode $serviceName $partType abstract]
        }
        switch -exact -- $typeInfoList {
            {0 0} {
                ##
                ## Simple non-array
                ##
				if {[dict exists $tmpTypeInfo base]} {
					set baseType [dict get $tmpTypeInfo base]
				} else {
					set baseType string
				}
                if {$options(parseInAttr)} {
                    foreach attrList [$item attributes] {

                        lassign $attrList attr nsAlias nsUrl
                        if {[string equal $nsUrl $xsiNsUrl]} {
                            set attrValue [$item getAttribute ${nsAlias}:$attr]
                            dict set results $partName ::$attr $attrValue
                        } elseif {![string equal $nsAlias {}]} {
                            set attrValue [$item getAttribute ${nsAlias}:$attr]
                            dict set results $partName $attr $attrValue
                        } else {
                            set attrValue [$item getAttribute $attr]
                            dict set results $partName $attr $attrValue

                        }
                    }
                    if {[string equal $baseType {XML}]} {
                        dict set results $partName $valueAttr [$item asXML]
                    } else {
                        dict set results $partName $valueAttr [$item asText]
                    }
................................................................................
                    }
                }
            }
            {0 1} {
                ##
                ## Simple array
                ##
				if {[dict exists $tmpTypeInfo base]} {
					set baseType [dict get $tmpTypeInfo base]
				} else {
					set baseType string
				}
                set tmp {}
                foreach row $item {
                    if {$options(parseInAttr)} {
                        set rowList {}
                        foreach attrList [$row attributes] {

                            lassign $attrList attr nsAlias nsUrl
                            if {[string equal $nsUrl $xsiNsUrl]} {
                                set attrValue [$row getAttribute ${nsAlias}:$attr]
                                lappend rowList ::$attr $attrValue
                            } elseif {![string equal $nsAlias {}]} {
                                set attrValue [$row getAttribute ${nsAlias}:$attr]
                                lappend rowList $attr $attrValue
                            } else {
                                set attrValue [$row getAttribute $attr]
                                lappend rowList $attr $attrValue

                            }
                        }
                        if {[string equal $baseType {XML}]} {
                            lappend rowList $valueAttr [$row asXML]
                        } else {
                            lappend rowList $valueAttr [$row asText]
                        }
................................................................................
                ##
                if {$options(parseInAttr)} {
                    if {$isAbstract && [$item hasAttributeNS {http://www.w3.org/2001/XMLSchema-instance} type]} {
                        set partType [$item getAttributeNS {http://www.w3.org/2001/XMLSchema-instance} type]
                        $item removeAttributeNS {http://www.w3.org/2001/XMLSchema-instance} type
                    }
                    foreach attrList [$item attributes] {

                        lassign $attrList attr nsAlias nsUrl
                        if {[string equal $nsUrl $xsiNsUrl]} {
                            set attrValue [$item getAttribute ${nsAlias}:$attr]
                            dict set results $partName ::$attr $attrValue
                        } elseif {![string equal $nsAlias {}]} {
                            set attrValue [$item getAttribute ${nsAlias}:$attr]
                            dict set results $partName $attr $attrValue
                        } else {
                            set attrValue [$item getAttribute $attr]
                            dict set results $partName $attr $attrValue

                        }
                    }
                    dict set results $partName $valueAttr [convertTypeToDict $mode $serviceName $item $partType $root]
                } else {
                    dict set results $partName [convertTypeToDict $mode $serviceName $item $partType $root]
                }
            }
................................................................................
                    if {$options(parseInAttr)} {
                        set rowList {}
                        if {$isAbstract && [$row hasAttributeNS {http://www.w3.org/2001/XMLSchema-instance} type]} {
                            set partType [$row getAttributeNS {http://www.w3.org/2001/XMLSchema-instance} type]
                            $row removeAttributeNS {http://www.w3.org/2001/XMLSchema-instance} type
                        }
                        foreach attrList [$row attributes] {

                            lassign $attrList attr nsAlias nsUrl
                            if {[string equal $nsUrl $xsiNsUrl]} {
                                set attrValue [$row getAttribute ${nsAlias}:$attr]
                                lappend rowList ::$attr $attrValue
                            } elseif {![string equal $nsAlias {}]} {
                                set attrValue [$row getAttribute ${nsAlias}:$attr]
                                lappend rowList $attr $attrValue
                            } else {
                                set attrValue [$row getAttribute $attr]
                                lappend rowList $attr $attrValue

                            }
                        }
                        lappend rowList $valueAttr [convertTypeToDict $mode $serviceName $row $partType $root 1]
                        lappend tmp $rowList
                    } else {
                        lappend tmp [convertTypeToDict $mode $serviceName $row $partType $root 1]
                    }







|
|
|
|
|


>
|
|
|
|
|
|
|
|
|
|
>







 







|
|
|
|
|





>
|
|
|
|
|
|
|
|
|
|
>







 







>
|
|
|
|
|
|
|
|
|
|
>







 







>
|
|
|
|
|
|
|
|
|
|
>







1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
....
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
....
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
....
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
            set isAbstract [dict get $typeInfo $mode $serviceName $partType abstract]
        }
        switch -exact -- $typeInfoList {
            {0 0} {
                ##
                ## Simple non-array
                ##
		if {[dict exists $tmpTypeInfo base]} {
		    set baseType [dict get $tmpTypeInfo base]
		} else {
		    set baseType string
		}
                if {$options(parseInAttr)} {
                    foreach attrList [$item attributes] {
                        catch {
                            lassign $attrList attr nsAlias nsUrl
                            if {[string equal $nsUrl $xsiNsUrl]} {
                                set attrValue [$item getAttribute ${nsAlias}:$attr]
                                dict set results $partName ::$attr $attrValue
                            } elseif {![string equal $nsAlias {}]} {
                                set attrValue [$item getAttribute ${nsAlias}:$attr]
                                dict set results $partName $attr $attrValue
                            } else {
                                set attrValue [$item getAttribute $attr]
                                dict set results $partName $attr $attrValue
                            }
                        }
                    }
                    if {[string equal $baseType {XML}]} {
                        dict set results $partName $valueAttr [$item asXML]
                    } else {
                        dict set results $partName $valueAttr [$item asText]
                    }
................................................................................
                    }
                }
            }
            {0 1} {
                ##
                ## Simple array
                ##
		if {[dict exists $tmpTypeInfo base]} {
		    set baseType [dict get $tmpTypeInfo base]
		} else {
		    set baseType string
		}
                set tmp {}
                foreach row $item {
                    if {$options(parseInAttr)} {
                        set rowList {}
                        foreach attrList [$row attributes] {
                            catch {
                                lassign $attrList attr nsAlias nsUrl
                                if {[string equal $nsUrl $xsiNsUrl]} {
                                    set attrValue [$row getAttribute ${nsAlias}:$attr]
                                    lappend rowList ::$attr $attrValue
                                } elseif {![string equal $nsAlias {}]} {
                                    set attrValue [$row getAttribute ${nsAlias}:$attr]
                                    lappend rowList $attr $attrValue
                                } else {
                                    set attrValue [$row getAttribute $attr]
                                    lappend rowList $attr $attrValue
                                }
                            }
                        }
                        if {[string equal $baseType {XML}]} {
                            lappend rowList $valueAttr [$row asXML]
                        } else {
                            lappend rowList $valueAttr [$row asText]
                        }
................................................................................
                ##
                if {$options(parseInAttr)} {
                    if {$isAbstract && [$item hasAttributeNS {http://www.w3.org/2001/XMLSchema-instance} type]} {
                        set partType [$item getAttributeNS {http://www.w3.org/2001/XMLSchema-instance} type]
                        $item removeAttributeNS {http://www.w3.org/2001/XMLSchema-instance} type
                    }
                    foreach attrList [$item attributes] {
                        catch {
                            lassign $attrList attr nsAlias nsUrl
                            if {[string equal $nsUrl $xsiNsUrl]} {
                                set attrValue [$item getAttribute ${nsAlias}:$attr]
                                dict set results $partName ::$attr $attrValue
                            } elseif {![string equal $nsAlias {}]} {
                                set attrValue [$item getAttribute ${nsAlias}:$attr]
                                dict set results $partName $attr $attrValue
                            } else {
                                set attrValue [$item getAttribute $attr]
                                dict set results $partName $attr $attrValue
                            }
                        }
                    }
                    dict set results $partName $valueAttr [convertTypeToDict $mode $serviceName $item $partType $root]
                } else {
                    dict set results $partName [convertTypeToDict $mode $serviceName $item $partType $root]
                }
            }
................................................................................
                    if {$options(parseInAttr)} {
                        set rowList {}
                        if {$isAbstract && [$row hasAttributeNS {http://www.w3.org/2001/XMLSchema-instance} type]} {
                            set partType [$row getAttributeNS {http://www.w3.org/2001/XMLSchema-instance} type]
                            $row removeAttributeNS {http://www.w3.org/2001/XMLSchema-instance} type
                        }
                        foreach attrList [$row attributes] {
                            catch {
                                lassign $attrList attr nsAlias nsUrl
                                if {[string equal $nsUrl $xsiNsUrl]} {
                                    set attrValue [$row getAttribute ${nsAlias}:$attr]
                                    lappend rowList ::$attr $attrValue
                                } elseif {![string equal $nsAlias {}]} {
                                    set attrValue [$row getAttribute ${nsAlias}:$attr]
                                    lappend rowList $attr $attrValue
                                } else {
                                    set attrValue [$row getAttribute $attr]
                                    lappend rowList $attr $attrValue
                                }
                            }
                        }
                        lappend rowList $valueAttr [convertTypeToDict $mode $serviceName $row $partType $root 1]
                        lappend tmp $rowList
                    } else {
                        lappend tmp [convertTypeToDict $mode $serviceName $row $partType $root 1]
                    }