Menu

#28 Encoding

open
SOAP (17)
5
2005-08-19
2005-08-19
Anonymous
No

Hi,

Because I need soap calls with different encodings
(latin1 / utf-8 / ... ) I modified soap.tcl and
http.tcl to support the encoding types.
These will be properly shown in the Content-Type field
in the HTTP header and in the <?xml version> tag.

moreover I made tclsoap compatible with tcldom 3.0
(soap.tcl, soap-service.tcl, xpath.tcl)

All these things are based on tclSoap 1.6.7 (didn't get
the latest version from CVS)

Discussion

  • Nobody/Anonymous

    updated soap.tcl

     
  • Nobody/Anonymous

    Logged In: NO

    diff SOAP.tcl SOAP.tcl.old

    25,30c25,27
    < if { [catch {package require dom 3.0}
    ::SOAP::domVersion]} {
    [15:41]
    < if { [catch {package require dom 2.0}
    ::SOAP::domVersion]} {
    < if { [catch {package require dom 1.6}
    ::SOAP::domVersion]} {
    < error "require dom package greater than 1.6"
    < }
    < package require SOAP::xpath; # TclSOAP
    ---
    > if { [catch {package require dom 2.0}
    ::SOAP::domVersion]} {
    > if { [catch {package require dom 1.6}
    ::SOAP::domVersion]} {
    > error "require dom package greater than 1.6"
    31a29
    > package require SOAP::xpath; # TclSOAP
    42c40
    < variable version 1.6.8
    ---
    > variable version 1.6.7
    44c42
    < variable rcs_version { $Id: SOAP.tcl,v 1.48 2005/08/19
    17:08:46 patthoyts Exp $ }
    ---
    > variable rcs_version { $Id: SOAP.tcl,v 1.48 2003/09/06
    17:08:46 patthoyts Exp $ }
    241c239
    < encoding charset }
    ---
    > encoding }
    298d295
    < -char* { set procvar(charset) $value }
    388,395d384
    < #Default charset = utf-8
    < if { $procvar(charset) == {} } {
    < set procvar(charset) utf-8
    < }
    < if { [lsearch [encoding names] $procvar(charset)] ==
    -1 } {
    < return -code error "character encoding
    \"$procvar(charset)\" not supported by your system.\
    < Must be one of \"[encoding
    names]\""
    < }
    439d427
    < array set $varName {charset {}} ;# Character
    encoding of the SOAP call
    824,825c812
    < set charset $procvar(charset)
    <
    ---
    >
    923d909
    <
    926,927c912
    < regsub "<!DOCTYPE\[^>\]*>\r?\n?" $prereq {} prereq2
    ;# hack
    < regsub "xml version='1.0'" $prereq2 "xml version='1.0'
    encoding=\"$charset\"" req ;#hack2
    ---
    > regsub "<!DOCTYPE\[^>\]*>\r?\n?" $prereq {} req ;# hack
    929,930c914
    < set req [encoding convertto $charset $req] ;#
    make it the configured charset (defaults utf-8)
    <
    ---
    > set req [encoding convertto utf-8 $req] ;#
    make it UTF-8

     
  • Nobody/Anonymous

    Logged In: NO

    diff http.tcl http.tcl.old

    189d188
    < set charset $procvar(charset)
    192c191
    < -type \"text/xml\;
    charset=\\"$charset\\"\"\
    ---
    > -type text/xml \

     
  • Nobody/Anonymous

    Logged In: NO

    In the comments the diff's

    Bert Salaets (bert.salaets at thomson.net)

    diff SOAP-service.tcl SOAP-service.tcl.old

    29,33c29,31
    < if { [catch {package require dom 3.0}] } {
    < if { [catch {package require dom 2.0}] } {
    < if { [catch {package require dom 1.6}] } {
    < error "require dom package greater than 1.6"
    < }
    ---
    > if { [catch {package require dom 2.0}] } {
    > if { [catch {package require dom 1.6}] } {
    > error "require dom package greater than 1.6"
    35a34
    >

    diff xpath.tcl xpath.tcl.old
    17,21c17,19
    < if { [catch {package require dom 3.0}] } {
    < if { [catch {package require dom 2.0}] } {
    < if { [catch {package require dom 1.6}] } {
    < error "require dom package greater than 1.6"
    < }
    ---
    > if { [catch {package require dom 2.0}] } {
    > if { [catch {package require dom 1.6}] } {
    > error "require dom package greater than 1.6"
    23a22
    >

     

Log in to post a comment.

Auth0 Logo