The following operations are supported. For a formal definition,
please review the
Service Description.
Web Service Links
Namespace Children of ::wsdb::types::mywebservice::TestDecimal2
Namespace Code for ::wsdb::types::mywebservice::TestDecimal2
namespace eval ::wsdb::types::mywebservice::TestDecimal2 {
variable base xsd::integer
variable decimalPointCanon {}
variable fractionDigits 0
variable maxInclusive 9765
variable minInclusive 4
variable pattern {[0-9]{1,4}}
variable validate ::wsdb::types::mywebservice::TestDecimal2::validate
}
Procedures in ::wsdb::types::mywebservice::TestDecimal2
proc ::wsdb::types::mywebservice::TestDecimal2::validate {
value
{errorListVar }
{canonListVar }
} {
variable base
variable decimalPointCanon
variable maxInclusive
variable minInclusive
variable pattern
variable fractionDigits
if {"$errorListVar" ne ""} {
upvar $errorListVar errorList
}
if {"$canonListVar" ne ""} {
upvar $canonListVar canonList
}
set valid 0
set collapsedValue [string trim $value]
set errorList [list $collapsedValue]
set canonList [list]
if {![::wsdb::types::xsd::decimal::ifDecimalCanonize $value canonList $decimalPointCanon decimalList]} {
lappend errorList "failed decimal test"
return $valid
}
set foundDigits [lindex $decimalList 0]
set foundFractionDigits [lindex $decimalList 1]
set canonValue [join $canonList ""]
while {1} {
if {![::wsdb::types::${base}::validate $canonValue]} {
lappend errorList "failed base test $base"
break
}
if {![regexp $pattern $value]} {
lappend errorList "failed pattern test using [list $pattern]"
break
}
if {$canonValue < 4} {
lappend errorList "failed minInclusive test (4)"
break
}
if {$canonValue > 9765} {
lappend errorList "failed maxInclusive test (9765)"
break
}
set valid 1
break
}
return $valid
}