When trying to use the current version on eXist-db 6.x.x the following error is reported:
HTTP ERROR 500 jakarta.servlet.ServletException: jakarta.servlet.ServletException: An error occurred while processing request to /exist/apps/myapp: err:XPTY0004 xs:base64Binary(fZBBa8MwDIX/SvDdiefGXiaSQNguhe2yjt3dVKyBxM4su/TnT20ZdJeBLnrS+9BTS26ZVxhyOvp3/M5IqTgvsye4DjqRo4fgaCLwbkGCNMJueHsFXSpYY0hhDLMoti+dcMZurFWNkk/Y7GXd2FruWZCNugiWe6tF8YmRpuA7wQQ2EmXcekrOJ5aU3kjVSG0+Hgxorrp8NFIZULw7EGFM7H0OnvKCcYfxNI1sP+C5E0r07eVouDLjXYz/U7hfrOiPKa0EVUU3sOSAp+mAsQzxq63u4P2t+/u4/gc=) is not a sub-type of xs:string [at line 103, column 34, source: /db/apps/existdb-saml/content/exsaml.xqm] In function: exsaml:build-authnreq-redir-url(xs:string) [53:29:/db/apps/existdb-saml/content/exsaml.xqm]
This occurs because of the line 103 in question:
let $urlenc := xmldb:encode($zip)
At that point $zip is of type xs:base64Binary (generated by line 100: let $zip := compression:deflate($bin, true())) , but the xmldb:encode function only accepts a string. The error is caused by the fact that there is no type promotion from xs:base64Binary to xs:string in XQuery. eXist-db in older versions may have allowed such bogus type promotion.
The backward compatible fix is to instead write: xmldb:encode($zip cast as xs:string)
When trying to use the current version on eXist-db 6.x.x the following error is reported:
This occurs because of the line 103 in question:
At that point
$zip
is of typexs:base64Binary
(generated by line 100:let $zip := compression:deflate($bin, true())
) , but thexmldb:encode
function only accepts a string. The error is caused by the fact that there is no type promotion fromxs:base64Binary
toxs:string
in XQuery. eXist-db in older versions may have allowed such bogus type promotion.The backward compatible fix is to instead write:
xmldb:encode($zip cast as xs:string)