[Xml-compile] XML::Compile::SOAP 2.02 woes (2)
Gert Doering
gert at space.net
Wed Mar 18 15:43:26 GMT 2009
Hi,
update - the test case displayed the problem, but hid the cause.
- if the string is "native ISO 8859-1", it will be sent as ISO 8859-1
- if the string is promoted to UTF8 before sending (utf8::upgrade),
the resulting message will be sent as UTF8
- if some *other* part of the request hash has been promoted to UTF8, that
other part will be sent as UTF8, but any not-yet-prompted bits of the
hash will keep being "native", so the following code fragment will
create a weird-encoded message:
my $string = 'C0815-4711-äöü';
my $id = '200711250087ä';
utf8::upgrade($id);
my %request =
( parameters => {userName => 'user',
password => 'pass'},
WEBINT_TICKETID => $string,
WEBINT_CUSTTICKETID => $id,
);
on the wire:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header><s:AuthenticationInfo xmlns:s="urn:TDeModify"><s:userName>user</s:userName><s:password>pass</s:password></s:AuthenticationInfo></SOAP-ENV:Header><SOAP-ENV:Body><s:OpSelfTest xmlns:s="urn:TDeModify"><s:WEBINT_CUSTTICKETID>200711250087..</s:WEBINT_CUSTTICKETID><s:WEBINT_TICKETID>C0815-4711-...</s:WEBINT_TICKETID></s:OpSelfTest></SOAP-ENV:Body></SOAP-ENV:Envelope>
(two "." for the single umlaut in $id, 3 "." for the *three* umlauts in
$string)
- so the problem seems to be that automagic promotion to UTF-8 when
building the XML is not happening.
Nicely enough - *if* I call utf8::upgrade() before passing the hash
to XML::Compile::SOAP, it will now work with HTTP and with HTTPS (long-
standing source of pain).
So, for my usage cases, I can work around this problem (if needed).
Gert Doering
-- NetMaster
--
Total number of prefixes smaller than registry allocations: 128645
SpaceNet AG Vorstand: Sebastian v. Bomhard
Joseph-Dollinger-Bogen 14 Aufsichtsratsvors.: A. Grundner-Culemann
D-80807 Muenchen HRB: 136055 (AG Muenchen)
Tel: +49 (89) 32356-444 USt-IdNr.: DE813185279
More information about the Xml-compile
mailing list