Check-in [6975d0e818]

Not logged in

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

Overview
Comment:First step to parse complex abstract type in wsdl. Bug [584bfb7727]
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | bug584bfb7727-abstract-type
Files: files | file ages | folders
SHA3-256:6975d0e818b89239d516f66513651b5e3dc0f6eeee989b5cc1c30bb3e5a33242
User & Date: oehhar 2018-02-20 21:31:02
References
2018-05-14 15:06 Ticket [584bfb7727] WS::Client returns nonsense for abstract types status still Review with 1 other change artifact: 9e2af91732 user: oehhar
2018-02-20 21:50 Ticket [584bfb7727]: 1 change artifact: f85ef1c289 user: oehhar
Context
2018-05-14 14:52
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 Closed-Leaf check-in: 300b2b5c3a user: oehhar tags: bug584bfb7727-abstract-type
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
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to Utilities.tcl.

3386
3387
3388
3389
3390
3391
3392





















3393
3394
3395
3396
3397
3398
3399
....
3457
3458
3459
3460
3461
3462
3463
3464








3465


3466
3467
3468
3469
3470
3471
3472
            }
            complexType {
                $middleNode setAttribute name $typeName
                parseComplexType $mode results $serviceName $middleNode $tns
            }
            simpleContent -
            complexContent {





















                foreach child [$middleNode childNodes] {
                    set parent [$child parent]
                    set contentType [$child localName]
                    ::log::logsubst debug {Content Type is {$contentType}}
                    switch -exact -- $contentType {
                        restriction {
                            set nodeFound 1
................................................................................
            }
        }
    }
    ::log::logsubst debug {at end of foreach {$typeName} with {$partList}}
    if {[llength $partList] || $isAbstractType} {
        #dict set results types $tns:$typeName $partList
        dict set results types $typeName $partList
        ::log:::log debug  "Defining $typeName"








        if {[llength $partList]  && ![string equal [lindex $partList 0] {}]} {


            ::WS::Utils::ServiceTypeDef $mode $serviceName $typeName $partList $tns $isAbstractType
        } else {
            ::WS::Utils::ServiceSimpleTypeDef $mode $serviceName $typeName [list base $defaultType comment {}] $tns
        }

    } elseif {!$nodeFound} {
        #puts "Defined $typeName as simple type"







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







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







3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
....
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
            }
            complexType {
                $middleNode setAttribute name $typeName
                parseComplexType $mode results $serviceName $middleNode $tns
            }
            simpleContent -
            complexContent {
                ##
                ## Save simple or complex content for abstract types, which
                ## may have content type with no fields. [Bug 584bfb77]
                ## Example xml type snippet:
                ##  <xs:complexType name="Envelope" abstract="true">
                ##    <xs:annotation><xs:documentation /></xs:annotation>
                ##    <xs:complexContent mixed="false">
                ##      <xs:extension base="Geometry" />
                ##    </xs:complexContent>
                ##  </xs:complexType>
                ##  ...
                ##  <xs:complexType name="Geometry">
                ##    <xs:annotation><xs:documentation /></xs:annotation>
                ##  </xs:complexType>
                
                set isComplexContent [expr {$middle eq "complexContent"}]
                ::log::logsubst debug {isComplexContent = $isComplexContent}
                
                ##
                ## Loop over the components of the type
                ##
                foreach child [$middleNode childNodes] {
                    set parent [$child parent]
                    set contentType [$child localName]
                    ::log::logsubst debug {Content Type is {$contentType}}
                    switch -exact -- $contentType {
                        restriction {
                            set nodeFound 1
................................................................................
            }
        }
    }
    ::log::logsubst debug {at end of foreach {$typeName} with {$partList}}
    if {[llength $partList] || $isAbstractType} {
        #dict set results types $tns:$typeName $partList
        dict set results types $typeName $partList
        ::log:::logsubst debug  {Defining $typeName as '$partList'}
        ##
        ## Add complex type definition, if:
        ##   *  there is a part list
        ##   *  or it is an abstract type announced as complex
        ##      (see xml snipped above about [Bug 584bfb77])
        ##      -> will set dict typeInfo client $service tns1:envelope {
        ##          definition {} xns tns1 abstract true}
        ##
        if {    ([llength $partList]  && ![string equal [lindex $partList 0] {}])
                || ($isAbstractType && [info exists isComplexContent] && $isComplexContent)
        } {
            ::WS::Utils::ServiceTypeDef $mode $serviceName $typeName $partList $tns $isAbstractType
        } else {
            ::WS::Utils::ServiceSimpleTypeDef $mode $serviceName $typeName [list base $defaultType comment {}] $tns
        }

    } elseif {!$nodeFound} {
        #puts "Defined $typeName as simple type"